Commit 9c932a74 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

family: list of families enabled in kernel

parent 369e3ddb
......@@ -4,4 +4,13 @@ Copyright (C) 2012-2019 Kaarle Ritvanen
See LICENSE file for license details
return {ALL={'inet', 'inet6'}}
local M = {ACTIVE={}, ALL={}}
local stat = require('posix').stat
for family, procfile in pairs{inet='raw', inet6='raw6'} do
table.insert(M.ALL, family)
if stat('/proc/net/'..procfile) then table.insert(M.ACTIVE, family) end
return M
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