From c6207124b026badd09705424ed2dc0243b63530c Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kaber/emailAddress=kaber@netfilter.org" Date: Thu, 11 Jan 2007 09:08:22 +0000 Subject: Add UDPLITE multiport support --- extensions/libipt_multiport.c | 9 ++++++--- include/ip6tables.h | 3 +++ include/iptables.h | 3 +++ ip6tables.c | 1 + iptables.c | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/extensions/libipt_multiport.c b/extensions/libipt_multiport.c index 2a10abd..58b6a0e 100644 --- a/extensions/libipt_multiport.c +++ b/extensions/libipt_multiport.c @@ -59,6 +59,8 @@ proto_to_name(u_int8_t proto) return "tcp"; case IPPROTO_UDP: return "udp"; + case IPPROTO_UDPLITE: + return "udplite"; case IPPROTO_SCTP: return "sctp"; case IPPROTO_DCCP: @@ -141,16 +143,17 @@ check_proto(const struct ipt_entry *entry) if (entry->ip.invflags & IPT_INV_PROTO) exit_error(PARAMETER_PROBLEM, - "multiport only works with TCP or UDP"); + "multiport only works with TCP, UDP, UDPLITE, SCTP and DCCP"); if ((proto = proto_to_name(entry->ip.proto)) != NULL) return proto; else if (!entry->ip.proto) exit_error(PARAMETER_PROBLEM, - "multiport needs `-p tcp', `-p udp', `-p sctp' or `-p dccp'"); + "multiport needs `-p tcp', `-p udp', `-p udplite', " + "`-p sctp' or `-p dccp'"); else exit_error(PARAMETER_PROBLEM, - "multiport only works with TCP, UDP, SCTP and DCCP"); + "multiport only works with TCP, UDP, UDPLITE, SCTP and DCCP"); } /* Function which parses command options; returns true if it diff --git a/include/ip6tables.h b/include/ip6tables.h index 7907f66..f8f709b 100644 --- a/include/ip6tables.h +++ b/include/ip6tables.h @@ -14,6 +14,9 @@ #ifndef IPPROTO_DCCP #define IPPROTO_DCCP 33 #endif +#ifndef IPPROTO_UDPLITE +#define IPPROTO_UDPLITE 136 +#endif #ifndef IP6T_SO_GET_REVISION_MATCH /* Old kernel source. */ #define IP6T_SO_GET_REVISION_MATCH 68 diff --git a/include/iptables.h b/include/iptables.h index 6b3b956..cd51428 100644 --- a/include/iptables.h +++ b/include/iptables.h @@ -14,6 +14,9 @@ #ifndef IPPROTO_DCCP #define IPPROTO_DCCP 33 #endif +#ifndef IPPROTO_UDPLITE +#define IPPROTO_UDPLITE 136 +#endif #ifndef IPT_SO_GET_REVISION_MATCH /* Old kernel source. */ #define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2) diff --git a/ip6tables.c b/ip6tables.c index 9b1370a..211b81a 100644 --- a/ip6tables.c +++ b/ip6tables.c @@ -223,6 +223,7 @@ struct pprot { static const struct pprot chain_protos[] = { { "tcp", IPPROTO_TCP }, { "udp", IPPROTO_UDP }, + { "udplite", IPPROTO_UDPLITE }, { "icmpv6", IPPROTO_ICMPV6 }, { "ipv6-icmp", IPPROTO_ICMPV6 }, { "esp", IPPROTO_ESP }, diff --git a/iptables.c b/iptables.c index 7d8771d..d4aa26f 100644 --- a/iptables.c +++ b/iptables.c @@ -227,6 +227,7 @@ struct pprot { static const struct pprot chain_protos[] = { { "tcp", IPPROTO_TCP }, { "udp", IPPROTO_UDP }, + { "udplite", IPPROTO_UDPLITE }, { "icmp", IPPROTO_ICMP }, { "esp", IPPROTO_ESP }, { "ah", IPPROTO_AH }, -- cgit v1.2.3