summaryrefslogtreecommitdiffstats
path: root/include/network.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-06-12 18:35:11 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2009-06-12 18:35:11 +0200
commitd9c0564db6b3f3ecb196508458a91b03d45fadb2 (patch)
tree327dec2eab601abe26522c267bdff23b1605dfc5 /include/network.h
parent8fc9066ee62d17cdb76bc064c945da3bb0d2e2a3 (diff)
build: use TLV format for SCTP/DCCP protocol information
In 400ae54438c4b85126f9fab0ae1dc067823b70f7, we added the SCTP support by means of a structure that was encapsulated in an TLV attribute. However, this structure didn't handle alignment and endianess issues appropriately. Similar problem was introduced in b808645ec71b7cc22cf5106b3d79625d07e6077c along with the DCCP support. This patch moves every field of this structure to independent attributes. I decided not to use nesting to make building and parsing more simple. Using TLV is a good idea, specially for DCCP and SCTP that are under development and that may include new fields and obsolete them in the future. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/network.h')
-rw-r--r--include/network.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/include/network.h b/include/network.h
index 2786585..3248245 100644
--- a/include/network.h
+++ b/include/network.h
@@ -199,7 +199,7 @@ enum nta_attr {
NTA_IPV6, /* struct nfct_attr_grp_ipv6 */
NTA_L4PROTO, /* uint8_t */
NTA_PORT, /* struct nfct_attr_grp_port */
- NTA_STATE_TCP = 4, /* uint8_t */
+ NTA_TCP_STATE = 4, /* uint8_t */
NTA_STATUS, /* uint32_t */
NTA_TIMEOUT, /* uint32_t */
NTA_MARK, /* uint32_t */
@@ -212,8 +212,11 @@ enum nta_attr {
NTA_SPAT_PORT, /* uint16_t */
NTA_DPAT_PORT, /* uint16_t */
NTA_NAT_SEQ_ADJ = 16, /* struct nta_attr_natseqadj */
- NTA_STATE_SCTP, /* struct nta_attr_sctp */
- NTA_STATE_DCCP, /* struct nta_attr_dccp */
+ NTA_SCTP_STATE, /* uint8_t */
+ NTA_SCTP_VTAG_ORIG, /* uint32_t */
+ NTA_SCTP_VTAG_REPL, /* uint32_t */
+ NTA_DCCP_STATE = 20, /* uint8_t */
+ NTA_DCCP_ROLE, /* uint8_t */
NTA_MAX
};
@@ -226,15 +229,6 @@ struct nta_attr_natseqadj {
uint32_t repl_seq_offset_after;
};
-struct nta_attr_sctp {
- uint8_t state;
- uint32_t vtag_orig, vtag_repl;
-};
-
-struct nta_attr_dccp {
- uint8_t state, role;
-};
-
void build_payload(const struct nf_conntrack *ct, struct nethdr *n);
int parse_payload(struct nf_conntrack *ct, struct nethdr *n, size_t remain);