diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-07-14 17:16:08 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-07-14 17:16:08 +0200 |
commit | 19f35b21dbe2bb4386eeced4e0d87f3b2e1dd8bf (patch) | |
tree | cb78ecd7c55d040c6a017890b94851a54db95bc6 /src/conntrack/api.c | |
parent | dd73e5708cc2cd127ba03fd5a82fb96b3928e7fb (diff) |
src: add support for DCCP 64-bits sequence number tracking
From: Pablo Neira Ayuso <pablo@netfilter.org>
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 <pablo@netfilter.org>
Diffstat (limited to 'src/conntrack/api.c')
-rw-r--r-- | src/conntrack/api.c | 29 |
1 files changed, 29 insertions, 0 deletions
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 @@ -341,6 +341,19 @@ void nfct_set_attr_u32(struct nf_conntrack *ct, } /** + * 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 * @type: attribute type @@ -417,6 +430,22 @@ u_int32_t nfct_get_attr_u32(const struct nf_conntrack *ct, } /** + * 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 * @type: attribute type |