Allow multiple instantiations of GenericNetlink

This commit is contained in:
Ian Gulliver
2015-01-10 16:37:52 +00:00
parent 5b9c67b260
commit d6bbc263ad

View File

@@ -252,11 +252,12 @@ class GenericNetlink(object):
7: ('mcast_groups', Array(_mcast_grp_attr)), 7: ('mcast_groups', Array(_mcast_grp_attr)),
}) })
_msgtypes = [ def __init__(self):
self._msgtypes = [
{ {
'id': 0x10, 'id': 0x10,
'name': 'nlctrl', 'name': 'nlctrl',
'parser': _ctrl_attr, 'parser': self._ctrl_attr,
'commands': { 'commands': {
'newfamily': 1, 'newfamily': 1,
'getfamily': 3, 'getfamily': 3,
@@ -264,7 +265,6 @@ class GenericNetlink(object):
}, },
] ]
def __init__(self):
self._netlink = Netlink() self._netlink = Netlink()
self._UpdateMsgTypes() self._UpdateMsgTypes()
self.Send('nlctrl', ['dump'], 'getfamily', 1) self.Send('nlctrl', ['dump'], 'getfamily', 1)