diff options
Diffstat (limited to 'src/conntrack/snprintf_default.c')
-rw-r--r-- | src/conntrack/snprintf_default.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/conntrack/snprintf_default.c b/src/conntrack/snprintf_default.c index e2573df..e89f2f5 100644 --- a/src/conntrack/snprintf_default.c +++ b/src/conntrack/snprintf_default.c @@ -34,6 +34,17 @@ static const char *states[] = { "LISTEN" }; +static const char *sctp_states[] = { + "NONE", + "CLOSED", + "COOKIE_WAIT", + "COOKIE_ECHOED", + "ESTABLISHED", + "SHUTDOWN_SENT", + "SHUTDOWN_RECD", + "SHUTDOWN_ACK_SENT", +}; + static int __snprintf_l3protocol(char *buf, unsigned int len, const struct nf_conntrack *ct) @@ -67,6 +78,12 @@ int __snprintf_protoinfo(char *buf, { return snprintf(buf, len, "%s ", states[ct->protoinfo.tcp.state]); } +int __snprintf_protoinfo_sctp(char *buf, + unsigned int len, + const struct nf_conntrack *ct) +{ + return snprintf(buf, len, "%s ", sctp_states[ct->protoinfo.sctp.state]); +} int __snprintf_address_ipv4(char *buf, unsigned int len, @@ -260,6 +277,11 @@ int __snprintf_conntrack_default(char *buf, BUFFER_SIZE(ret, size, len, offset); } + if (test_bit(ATTR_SCTP_STATE, ct->set)) { + ret = __snprintf_protoinfo_sctp(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); |