Lunatik

linux.socketModule

Linux kernel constants exposed under linux.socket.

Values are populated at build time from the kernel headers.

Usage

local socket = require("linux.socket")

Tables

af Socket address families.
ip IP-level option names (IP_*).
ipproto IP-layer protocol numbers.
layout Socket option payload layouts.
msg Message flags for send/recv.
so Socket-level option names (SO_*).
sock Socket types (SOCK_STREAM, SOCK_DGRAM, …).
sol Socket option levels (SOL_*).

Tables in detail

af
Socket address families. Mirrors AF_* defines in <linux/socket.h>. Keys are the kernel names with the prefix stripped: AF_<NAME> is linux.socket.af.<NAME>.
ip
IP-level option names (IP_). Mirrors IP_ defines in <uapi/linux/in.h>. Keys are the kernel names with the prefix stripped: IP_<NAME> is linux.socket.ip.<NAME>.
ipproto
IP-layer protocol numbers. Mirrors IPPROTO_* defines in <uapi/linux/in.h>. Keys are the kernel names with the prefix stripped: IPPROTO_<NAME> is linux.socket.ipproto.<NAME>.
layout
Socket option payload layouts. Layout descriptors (per-field offset/size/signedness) generated from <uapi/linux/time_types.h>; consume via require("struct").
msg
Message flags for send/recv. Mirrors MSG_* defines in <linux/socket.h>. Keys are the kernel names with the prefix stripped: MSG_<NAME> is linux.socket.msg.<NAME>.
so
Socket-level option names (SO_). Mirrors SO_ defines in <uapi/asm-generic/socket.h>. Keys are the kernel names with the prefix stripped: SO_<NAME> is linux.socket.so.<NAME>.
sock
Socket types (SOCK_STREAM, SOCK_DGRAM, …). Mirrors SOCK_* defines in <linux/net.h>. Keys are the kernel names with the prefix stripped: SOCK_<NAME> is linux.socket.sock.<NAME>.
sol
Socket option levels (SOL_). Mirrors SOL_ defines in <linux/socket.h>. Keys are the kernel names with the prefix stripped: SOL_<NAME> is linux.socket.sol.<NAME>.