class pyroute2.netlink.nlsocket.NetlinkSocketSpec(spec=None)
class pyroute2.netlink.nlsocket.AsyncNetlinkSocket(family=16, port=None, pid=None, fileno=None, sndbuf=1048576, rcvbuf=1048576, rcvsize=16384, all_ns=False, async_qsize=None, nlm_generator=None, target='localhost', ext_ack=False, strict_check=False, groups=0, nlm_echo=False, use_socket=False, netns=None, flags=64, libc=None)

Netlink socket

async setup_socket(sock=None)

Re-init a netlink socket.

async bind(groups=0, pid=None, **kwarg)

Bind the socket to given multicast groups, using given pid.

  • If pid is None, use automatic port allocation

  • If pid == 0, use process' pid

  • If pid == <int>, use the value instead of pid

class pyroute2.netlink.nlsocket.NetlinkSocket(family=16, port=None, pid=None, fileno=None, sndbuf=1048576, rcvbuf=1048576, rcvsize=16384, all_ns=False, async_qsize=None, nlm_generator=None, target='localhost', ext_ack=False, strict_check=False, groups=0, nlm_echo=False, use_socket=False, netns=None, flags=64, libc=None)
class pyroute2.netlink.nlsocket.ChaoticNetlinkSocket(*argv, **kwarg)
get(*argv, **kwarg)

Sync wrapper for async_get().