Hello,
I was looking at extending pyroute2 so it can create and manage nftables. Looking at the kernel source, I can see that the nla attributes required to create a new table are:
- NFTA_TABLE_NAME
I craft the nla payload: With the following:
def new_table(self):
msg = nfgen_msg()
msg['attrs'] = [('NFTA_TABLE_NAME', 'test')]
return self.request(msg, NFT_MSG_NEWTABLE,
msg_flags=NLM_F_REQUEST | NLM_F_ACK | NLM_F_EXCL)
{'attrs': [('NFTA_TABLE_NAME', 'test')],
'flags': 2,
'header': {},
'nfgen_family': 2,
'res_id': 0,
'value': <class 'pyroute2.netlink.NotInitialized'>,
'version': 0}
And I get the following exception
22, 'Invalid argument'
I was wondering if anyone could point me in the right direction so i can move forward with this.
Thanks!