forked from DNS-OARC/dnsjit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `core.compat`: - Add `struct sockaddr_storage` - Check that we found all types - `output.tcpcli`: Issue DNS-OARC#47: Add `connect()` and `nonblocking()` - `output.udpcli`: - Issue DNS-OARC#46: Add `connect()` and `nonblocking()` - Use `struct sockaddr_storage`
- Loading branch information
Showing
12 changed files
with
277 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2018, OARC, Inc. | ||
* All rights reserved. | ||
* | ||
* This file is part of dnsjit. | ||
* | ||
* dnsjit is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* dnsjit is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "config.h" | ||
|
||
#include <stdint.h> | ||
|
||
#include "core/compat.hh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
for line in io.lines("config.h") do | ||
local n,s = line:match("define SIZEOF_(PTHREAD%S*)_T (%d+)") | ||
local n, s = line:match("define SIZEOF_(%S*) (%d+)") | ||
if n and s then | ||
s = math.ceil(s / 8) | ||
n = n:lower() | ||
print("typedef struct "..n.." { uint64_t a["..s.."]; } "..n.."_t;") | ||
if n:match("^PTHREAD") then | ||
s = math.ceil(s / 8) | ||
print("#if !defined(SIZEOF_"..n..") || SIZEOF_"..n.." == 0") | ||
print("#error \""..n.." is undefined or zero\"") | ||
print("#endif") | ||
n = n:lower() | ||
print("typedef struct "..n:sub(1,-3).." { uint64_t a["..s.."]; } "..n..";") | ||
elseif n:match("^STRUCT") then | ||
n = n:match("^STRUCT_(%S*)") | ||
if n == "SOCKADDR_STORAGE" then | ||
print("#if !defined(SIZEOF_STRUCT_"..n..") || SIZEOF_STRUCT_"..n.." == 0") | ||
print("#error \""..n.." is undefined or zero\"") | ||
print("#endif") | ||
n = n:lower() | ||
print("struct "..n.." { uint8_t a["..s.."]; };") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.