Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Daniel Kahn Gillmor
Knot DNS Resolver
Commits
7d8938f6
Commit
7d8938f6
authored
Dec 17, 2015
by
Marek Vavruša
Browse files
daemon: optional FFI to support e500
parent
c6c080e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
daemon/lua/kres.lua
View file @
7d8938f6
-- LuaJIT ffi bindings for libkres, a DNS resolver library.
-- @note Since it's statically compiled, it expects to find the symbols in the C namespace.
local
ffi
=
require
(
'ffi'
)
local
ffi_ok
,
ffi
=
pcall
(
require
,
'ffi'
)
if
not
ffi_ok
then
local
M
=
{
error
=
'FFI not available, resolver bindings disabled.'
}
setmetatable
(
M
,
{
__index
=
function
(
t
,
k
,
v
)
error
(
rawget
(
M
,
'error'
))
end
})
return
M
end
local
bit
=
require
(
'bit'
)
local
bor
=
bit
.
bor
local
band
=
bit
.
band
...
...
daemon/lua/sandbox.lua
View file @
7d8938f6
...
...
@@ -12,7 +12,9 @@ day = 24 * hour
kres
=
require
(
'kres'
)
trust_anchors
=
require
(
'trust_anchors'
)
resolve
=
worker
.
resolve
todname
=
kres
.
str2dname
if
rawget
(
kres
,
'str2dname'
)
~=
nil
then
todname
=
kres
.
str2dname
end
-- Function aliases
-- `env.VAR returns os.getenv(VAR)`
...
...
daemon/lua/trust_anchors.lua
View file @
7d8938f6
local
ffi_ok
,
ffi
=
pcall
(
require
,
'ffi'
)
if
not
ffi_ok
then
return
{
error
=
'FFI not available, trust_anchors disabled.'
}
end
local
kres
=
require
(
'kres'
)
local
C
=
require
(
'
ffi
'
)
.
C
local
C
=
ffi
.
C
-- RFC5011 state table
local
key_state
=
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment