Commit 8fa05bcd authored by Florent Fourcot's avatar Florent Fourcot Committed by Peter V. Saveliev

ipset: add support of mark types (#326)


Bug-Url: https://github.com/svinota/pyroute2/issues/324
parent 96de1920
......@@ -173,6 +173,8 @@ class IPSet(NetlinkSocket):
attrs += [['IPSET_ATTR_IP_FROM', {'attrs': [[ip_version, e]]}]]
elif t == 'iface':
attrs += [['IPSET_ATTR_IFACE', e]]
elif t == 'mark':
attrs += [['IPSET_ATTR_MARK', int(e)]]
return attrs
def _add_delete_test(self, name, entry, family, cmd, exclusive,
......
......@@ -70,8 +70,8 @@ class ipset_msg(nfgen_msg):
(7, 'IPSET_ATTR_PROTO', 'recursive'),
(8, 'IPSET_ATTR_CADT_FLAGS', 'be32', NLA_F_NET_BYTEORDER),
(9, 'IPSET_ATTR_CADT_LINENO', 'be32'),
(10, 'IPSET_ATTR_MARK', 'hex'),
(11, 'IPSET_ATTR_MARKMASK', 'hex'),
(10, 'IPSET_ATTR_MARK', 'be32', NLA_F_NET_BYTEORDER),
(11, 'IPSET_ATTR_MARKMASK', 'be32', NLA_F_NET_BYTEORDER),
(17, 'IPSET_ATTR_GC', 'hex'),
(17, 'IPSET_ATTR_ETHER', 'l2addr'),
(18, 'IPSET_ATTR_HASHSIZE', 'be32', NLA_F_NET_BYTEORDER),
......@@ -102,8 +102,8 @@ class ipset_msg(nfgen_msg):
(7, 'IPSET_ATTR_PROTO', 'recursive'),
(8, 'IPSET_ATTR_CADT_FLAGS', 'be32', NLA_F_NET_BYTEORDER),
(9, 'IPSET_ATTR_CADT_LINENO', 'be32'),
(10, 'IPSET_ATTR_MARK', 'hex'),
(11, 'IPSET_ATTR_MARKMASK', 'hex'),
(10, 'IPSET_ATTR_MARK', 'be32', NLA_F_NET_BYTEORDER),
(11, 'IPSET_ATTR_MARKMASK', 'be32', NLA_F_NET_BYTEORDER),
(17, 'IPSET_ATTR_ETHER', 'l2addr'),
(18, 'PSET_ATTR_NAME', 'hex'),
(19, 'IPSET_ATTR_NAMEREF', 'be32'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment