diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-11-23 19:07:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-23 19:07:53 -0500 |
commit | 02fa460ef553faabc7e0b15ff9f607f028739808 (patch) | |
tree | 04342d781df0b0a1953cfcc6c52cbca7e172896a /net/dccp/feat.h | |
parent | 71c262a3dd42dea73700646d969b0af7a4102edf (diff) |
dccp: Increase the scope of variable-length htonl/ntohl functions
This extends the scope of two available functions,
encode|decode_value_var, to work up to 6 (8) bytes, to match maximum
requirements in the RFC.
These functions are going to be used both by general option processing
and feature negotiation code, hence declarations have been put into
feat.h.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/feat.h')
-rw-r--r-- | net/dccp/feat.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/dccp/feat.h b/net/dccp/feat.h index 093af1610d11..a8ab9e1e8b17 100644 --- a/net/dccp/feat.h +++ b/net/dccp/feat.h | |||
@@ -125,4 +125,18 @@ extern int dccp_feat_clone(struct sock *oldsk, struct sock *newsk); | |||
125 | extern int dccp_feat_clone_list(struct list_head const *, struct list_head *); | 125 | extern int dccp_feat_clone_list(struct list_head const *, struct list_head *); |
126 | extern int dccp_feat_init(struct sock *sk); | 126 | extern int dccp_feat_init(struct sock *sk); |
127 | 127 | ||
128 | /* | ||
129 | * Encoding variable-length options and their maximum length. | ||
130 | * | ||
131 | * This affects NN options (SP options are all u8) and other variable-length | ||
132 | * options (see table 3 in RFC 4340). The limit is currently given the Sequence | ||
133 | * Window NN value (sec. 7.5.2) and the NDP count (sec. 7.7) option, all other | ||
134 | * options consume less than 6 bytes (timestamps are 4 bytes). | ||
135 | * When updating this constant (e.g. due to new internet drafts / RFCs), make | ||
136 | * sure that you also update all code which refers to it. | ||
137 | */ | ||
138 | #define DCCP_OPTVAL_MAXLEN 6 | ||
139 | |||
140 | extern void dccp_encode_value_var(const u64 value, u8 *to, const u8 len); | ||
141 | extern u64 dccp_decode_value_var(const u8 *bf, const u8 len); | ||
128 | #endif /* _DCCP_FEAT_H */ | 142 | #endif /* _DCCP_FEAT_H */ |