From 7e629bad0f752f6fb3e3a435666307992e74bee2 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 21 May 2008 13:30:43 +0200 Subject: add full support of SCTP --- src/conntrack/build.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/conntrack/build.c') diff --git a/src/conntrack/build.c b/src/conntrack/build.c index 638fbe2..f11af42 100644 --- a/src/conntrack/build.c +++ b/src/conntrack/build.c @@ -123,6 +123,25 @@ void __build_protoinfo(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest_proto); nfnl_nest_end(&req->nlh, nest); break; + case IPPROTO_SCTP: + nest = nfnl_nest(&req->nlh, size, CTA_PROTOINFO); + nest_proto = nfnl_nest(&req->nlh, size, CTA_PROTOINFO_SCTP); + if (test_bit(ATTR_SCTP_STATE, ct->set)) + nfnl_addattr_l(&req->nlh, size, + CTA_PROTOINFO_SCTP_STATE, + &ct->protoinfo.sctp.state, + sizeof(u_int8_t)); + if (test_bit(ATTR_SCTP_VTAG_ORIG, ct->set)) + nfnl_addattr32(&req->nlh, size, + CTA_PROTOINFO_SCTP_VTAG_ORIGINAL, + htonl(ct->protoinfo.sctp.vtag[__DIR_ORIG])); + if (test_bit(ATTR_SCTP_VTAG_REPL, ct->set)) + nfnl_addattr32(&req->nlh, size, + CTA_PROTOINFO_SCTP_VTAG_REPLY, + htonl(ct->protoinfo.sctp.vtag[__DIR_REPL])); + nfnl_nest_end(&req->nlh, nest_proto); + nfnl_nest_end(&req->nlh, nest); + break; default: break; } -- cgit v1.2.3