summaryrefslogtreecommitdiffstats
path: root/src/conntrack/snprintf_default.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conntrack/snprintf_default.c')
-rw-r--r--src/conntrack/snprintf_default.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/conntrack/snprintf_default.c b/src/conntrack/snprintf_default.c
index dbc5fb1..4802c47 100644
--- a/src/conntrack/snprintf_default.c
+++ b/src/conntrack/snprintf_default.c
@@ -16,6 +16,7 @@ static char *proto2str[IPPROTO_MAX] = {
[IPPROTO_SCTP] = "sctp",
[IPPROTO_GRE] = "gre",
[IPPROTO_UDPLITE] = "udplite",
+ [IPPROTO_DCCP] = "dccp",
};
static char *l3proto2str[AF_MAX] = {
@@ -47,6 +48,19 @@ static const char *sctp_states[] = {
"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)
@@ -86,6 +100,12 @@ int __snprintf_protoinfo_sctp(char *buf,
{
return snprintf(buf, len, "%s ", sctp_states[ct->protoinfo.sctp.state]);
}
+int __snprintf_protoinfo_dccp(char *buf,
+ unsigned int len,
+ const struct nf_conntrack *ct)
+{
+ return snprintf(buf, len, "%s ", dccp_states[ct->protoinfo.dccp.state]);
+}
int __snprintf_address_ipv4(char *buf,
unsigned int len,
@@ -288,6 +308,11 @@ int __snprintf_conntrack_default(char *buf,
BUFFER_SIZE(ret, size, len, offset);
}
+ if (test_bit(ATTR_DCCP_STATE, ct->set)) {
+ ret = __snprintf_protoinfo_dccp(buf+offset, len, ct);
+ BUFFER_SIZE(ret, size, len, offset);
+ }
+
ret = __snprintf_address(buf+offset, len, &ct->tuple[__DIR_ORIG]);
BUFFER_SIZE(ret, size, len, offset);