pymnl Module¶
The NETLINK_* constants in this module help determine which family (a.k.a. sub-protocol or socket bus) to connect with. For example:
>>> import pymnl
>>> import pymnl.nlsocket
>>> sock = pymnl.nlsocket.Socket(pymnl.NETLINK_ROUTE)
>>> sock.bind()
will bind sock
to the kernel's routing information so that
queries can be run and changes can be requested.
Family Name | Family Function |
---|---|
NETLINK_ROUTE | Routing/device hook |
NETLINK_UNUSED | Unused number |
NETLINK_USERSOCK | Reserved for user mode socket protocols |
NETLINK_FIREWALL | Firewalling hook |
NETLINK_INET_DIAG | INET socket monitoring |
NETLINK_NFLOG | netfilter/iptables ULOG |
NETLINK_XFRM | ipsec |
NETLINK_SELINUX | SELinux event notifications |
NETLINK_ISCSI | Open-iSCSI |
NETLINK_AUDIT | auditing |
NETLINK_FIB_LOOKUP | |
NETLINK_CONNECTOR | |
NETLINK_NETFILTER | netfilter subsystem |
NETLINK_IP6_FW | |
NETLINK_DNRTMSG | DECnet routing messages |
NETLINK_KOBJECT_UEVENT | Kernel messages to userspace |
NETLINK_GENERIC | |
NETLINK_SCSITRANSPORT | SCSI Transports |
NETLINK_ECRYPTFS | |
NETLINK_RDMA | |
NETLINK_CRYPT | Crypto layer |
-
pymnl.__init__.
MAX_LINKS
¶
-
pymnl.__init__.
NET_MAJOR
¶ Major 36 is reserved for networking
-
pymnl.__init__.
PYMNL_ALIGN
(align_size)¶ Return a function to calculate alignment.
Only works with alignment on powers of 2.