Path: blob/main/tests/atf_python/sys/netlink/base_headers.py
39553 views
from ctypes import c_ubyte1from ctypes import c_uint2from ctypes import c_ushort3from ctypes import Structure4from enum import Enum567class Nlmsghdr(Structure):8_fields_ = [9("nlmsg_len", c_uint),10("nlmsg_type", c_ushort),11("nlmsg_flags", c_ushort),12("nlmsg_seq", c_uint),13("nlmsg_pid", c_uint),14]151617class Nlattr(Structure):18_fields_ = [19("nla_len", c_ushort),20("nla_type", c_ushort),21]222324class NlMsgType(Enum):25NLMSG_NOOP = 126NLMSG_ERROR = 227NLMSG_DONE = 328NLMSG_OVERRUN = 4293031class NlmBaseFlags(Enum):32NLM_F_REQUEST = 0x0133NLM_F_MULTI = 0x0234NLM_F_ACK = 0x0435NLM_F_ECHO = 0x0836NLM_F_DUMP_INTR = 0x1037NLM_F_DUMP_FILTERED = 0x20383940# XXX: in python3.8 it is possible to41# class NlmGetFlags(Enum, NlmBaseFlags):424344class NlmGetFlags(Enum):45NLM_F_ROOT = 0x10046NLM_F_MATCH = 0x20047NLM_F_ATOMIC = 0x400484950class NlmNewFlags(Enum):51NLM_F_REPLACE = 0x10052NLM_F_EXCL = 0x20053NLM_F_CREATE = 0x40054NLM_F_APPEND = 0x800555657class NlmDeleteFlags(Enum):58NLM_F_NONREC = 0x100596061class NlmAckFlags(Enum):62NLM_F_CAPPED = 0x10063NLM_F_ACK_TLVS = 0x200646566class GenlMsgHdr(Structure):67_fields_ = [68("cmd", c_ubyte),69("version", c_ubyte),70("reserved", c_ushort),71]727374