From a1586cea00b32b401c76f17aab4121967051d883 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 14 Apr 2009 10:36:07 +0200 Subject: snprintf: remove duplicated protocol string definitions This patch merges duplicated protocol string definitions in the snprintf infrastructure. I have also fixed the size of the string array. This patch is a cleanup. Signed-off-by: Pablo Neira Ayuso --- src/conntrack/snprintf_default.c | 54 ---------------------------------------- 1 file changed, 54 deletions(-) (limited to 'src/conntrack/snprintf_default.c') diff --git a/src/conntrack/snprintf_default.c b/src/conntrack/snprintf_default.c index 4802c47..5934306 100644 --- a/src/conntrack/snprintf_default.c +++ b/src/conntrack/snprintf_default.c @@ -7,60 +7,6 @@ #include "internal/internal.h" -static char *proto2str[IPPROTO_MAX] = { - [IPPROTO_TCP] = "tcp", - [IPPROTO_UDP] = "udp", - [IPPROTO_UDPLITE] = "udplite", - [IPPROTO_ICMP] = "icmp", - [IPPROTO_ICMPV6] = "icmpv6", - [IPPROTO_SCTP] = "sctp", - [IPPROTO_GRE] = "gre", - [IPPROTO_UDPLITE] = "udplite", - [IPPROTO_DCCP] = "dccp", -}; - -static char *l3proto2str[AF_MAX] = { - [AF_INET] = "ipv4", - [AF_INET6] = "ipv6" -}; - -static const char *states[] = { - "NONE", - "SYN_SENT", - "SYN_RECV", - "ESTABLISHED", - "FIN_WAIT", - "CLOSE_WAIT", - "LAST_ACK", - "TIME_WAIT", - "CLOSE", - "LISTEN" -}; - -static const char *sctp_states[] = { - "NONE", - "CLOSED", - "COOKIE_WAIT", - "COOKIE_ECHOED", - "ESTABLISHED", - "SHUTDOWN_SENT", - "SHUTDOWN_RECD", - "SHUTDOWN_ACK_SENT", -}; - -static const char *dccp_states[] = { - "NONE", - "REQUEST", - "RESPOND", - "PARTOPEN", - "OPEN", - "CLOSEREQ", - "CLOSING", - "TIMEWAIT", - "IGNORE", - "INVALID", -}; - static int __snprintf_l3protocol(char *buf, unsigned int len, const struct nf_conntrack *ct) -- cgit v1.2.3