From f693586d1b69114049a47fa615872ad4c14dcff2 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 5 Mar 2009 13:26:29 +0100 Subject: src: add support for GRE transport protocol This patch adds support for GRE transport protocol. Tested-by: Byan Buff Signed-off-by: Pablo Neira Ayuso --- src/conntrack/snprintf_xml.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/conntrack/snprintf_xml.c') diff --git a/src/conntrack/snprintf_xml.c b/src/conntrack/snprintf_xml.c index b14ff43..cb6fc03 100644 --- a/src/conntrack/snprintf_xml.c +++ b/src/conntrack/snprintf_xml.c @@ -59,7 +59,8 @@ static char *proto2str[IPPROTO_MAX] = { [IPPROTO_UDPLITE] = "udplite", [IPPROTO_ICMP] = "icmp", [IPPROTO_ICMPV6] = "icmp6", - [IPPROTO_SCTP] = "sctp" + [IPPROTO_SCTP] = "sctp", + [IPPROTO_GRE] = "gre" }; static char *l3proto2str[AF_MAX] = { [AF_INET] = "ipv4", @@ -177,6 +178,17 @@ static int __snprintf_proto_xml(char *buf, BUFFER_SIZE(ret, size, len, offset); } break; + case IPPROTO_GRE: + if (type == __ADDR_SRC) { + ret = snprintf(buf, len, "0x%x", + ntohs(tuple->l4src.all)); + BUFFER_SIZE(ret, size, len, offset); + } else { + ret = snprintf(buf, len, "%u", + ntohs(tuple->l4dst.all)); + BUFFER_SIZE(ret, size, len, offset); + } + break; } return ret; -- cgit v1.2.3