From 19f35b21dbe2bb4386eeced4e0d87f3b2e1dd8bf Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 14 Jul 2009 17:16:08 +0200 Subject: src: add support for DCCP 64-bits sequence number tracking From: Pablo Neira Ayuso This patch adds the support for the DCCP sequence number tracking that is included in the upcoming Linux kernel 2.6.31. Signed-off-by: Pablo Neira Ayuso --- src/conntrack/api.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/conntrack/api.c') diff --git a/src/conntrack/api.c b/src/conntrack/api.c index 0639b5f..56a3a8a 100644 --- a/src/conntrack/api.c +++ b/src/conntrack/api.c @@ -340,6 +340,19 @@ void nfct_set_attr_u32(struct nf_conntrack *ct, nfct_set_attr(ct, type, &value); } +/** + * nfct_set_attr_u64 - set the value of a certain conntrack attribute + * @ct: pointer to a valid conntrack + * @type: attribute type + * @value: unsigned 64 bits attribute value + */ +void nfct_set_attr_u64(struct nf_conntrack *ct, + const enum nf_conntrack_attr type, + u_int64_t value) +{ + nfct_set_attr(ct, type, &value); +} + /** * nfct_get_attr - get a conntrack attribute * ct: pointer to a valid conntrack @@ -416,6 +429,22 @@ u_int32_t nfct_get_attr_u32(const struct nf_conntrack *ct, return ret == NULL ? 0 : *ret; } +/** + * nfct_get_attr_u64 - get attribute of unsigned 32-bits long + * @ct: pointer to a valid conntrack + * @type: attribute type + * + * Returns the value of the requested attribute, if the attribute is not + * set, 0 is returned. In order to check if the attribute is set or not, + * use nfct_attr_is_set. + */ +u_int64_t nfct_get_attr_u64(const struct nf_conntrack *ct, + const enum nf_conntrack_attr type) +{ + const u_int64_t *ret = nfct_get_attr(ct, type); + return ret == NULL ? 0 : *ret; +} + /** * nfct_attr_is_set - check if a certain attribute is set * @ct: pointer to a valid conntrack object -- cgit v1.2.3