Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Netlink control message

src/p/y/pyroute2-0.2.8/pyroute2/netlink/taskstats.py   pyroute2(Download)
from pyroute2.netlink.generic import nla
from pyroute2.netlink.generic import genlmsg
from pyroute2.netlink.generic import ctrlmsg
 
TASKSTATS_CMD_UNSPEC = 0      # Reserved
    def get_protocol_id(self, prid):
        msg = ctrlmsg()
        msg['cmd'] = CTRL_CMD_GETFAMILY
        msg['version'] = 1
        msg['attrs'].append(['CTRL_ATTR_FAMILY_NAME', prid])

src/p/y/pyroute2-HEAD/pyroute2/netlink/taskstats.py   pyroute2(Download)
from pyroute2.netlink.generic import nla
from pyroute2.netlink.generic import genlmsg
from pyroute2.netlink.generic import ctrlmsg
 
TASKSTATS_CMD_UNSPEC = 0      # Reserved
    def get_protocol_id(self, prid):
        msg = ctrlmsg()
        msg['cmd'] = CTRL_CMD_GETFAMILY
        msg['version'] = 1
        msg['attrs'].append(['CTRL_ATTR_FAMILY_NAME', prid])