diff options
author | Patrick McHardy <kaber@trash.net> | 2014-01-08 13:02:16 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2014-01-08 13:03:19 +0000 |
commit | 87787ee86ec95a8a5494615268a03a756f48433f (patch) | |
tree | e650af949a46f09b94f404c02bd9e5db8e9dc48d /src/proto.c | |
parent | 4180fba3821d13f06fde2d662d7000e99d140693 (diff) |
meta: add l4proto support
Add support for the meta l4proto type. This is used in the inet table to
match on the transport layer protocol without requiring the network layer
protocol to be known, allowing to use transport header matches that apply
to both IPv4 and IPv6.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/proto.c')
-rw-r--r-- | src/proto.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/proto.c b/src/proto.c index 81fe6cfd..56fb7930 100644 --- a/src/proto.c +++ b/src/proto.c @@ -626,6 +626,31 @@ const struct proto_desc proto_inet = { }; /* + * Dummy protocol for cases where the network layer protocol isn't known + * (IPv4 or IPv6), The higher layer protocols are the protocols common to + * both. + */ + +const struct proto_desc proto_inet_service = { + .name = "inet-service", + .base = PROTO_BASE_TRANSPORT_HDR, + .protocol_key = 0, + .protocols = { + PROTO_LINK(IPPROTO_ESP, &proto_esp), + PROTO_LINK(IPPROTO_AH, &proto_ah), + PROTO_LINK(IPPROTO_COMP, &proto_comp), + PROTO_LINK(IPPROTO_UDP, &proto_udp), + PROTO_LINK(IPPROTO_UDPLITE, &proto_udplite), + PROTO_LINK(IPPROTO_TCP, &proto_tcp), + PROTO_LINK(IPPROTO_DCCP, &proto_dccp), + PROTO_LINK(IPPROTO_SCTP, &proto_sctp), + }, + .templates = { + [0] = PROTO_META_TEMPLATE("l4proto", &inet_protocol_type, NFT_META_L4PROTO, 8), + }, +}; + +/* * ARP */ |