Commit 7d8938f6 authored by Marek Vavruša's avatar Marek Vavruša

daemon: optional FFI to support e500

parent c6c080e5
-- 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
......
......@@ -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)`
......
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 = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment