diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-18 03:19:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-09-18 03:19:32 -0400 |
commit | 88f964db6ef728982734356bf4c406270ea29c1d (patch) | |
tree | 7fb9ba2fb646f4917911fed4a0a37cd52a12eae4 /net/dccp/ccid.h | |
parent | 561713cf475de1f671cc89c437927ec008a20209 (diff) |
[DCCP]: Introduce CCID getsockopt for the CCIDs
Allocation for the optnames is similar to the DCCP options, with a
range for rx and tx half connection CCIDs.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccid.h')
-rw-r--r-- | net/dccp/ccid.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/net/dccp/ccid.h b/net/dccp/ccid.h index 962f1e9e2f7e..21e55142dcd3 100644 --- a/net/dccp/ccid.h +++ b/net/dccp/ccid.h | |||
@@ -14,6 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <net/sock.h> | 16 | #include <net/sock.h> |
17 | #include <linux/compiler.h> | ||
17 | #include <linux/dccp.h> | 18 | #include <linux/dccp.h> |
18 | #include <linux/list.h> | 19 | #include <linux/list.h> |
19 | #include <linux/module.h> | 20 | #include <linux/module.h> |
@@ -54,6 +55,14 @@ struct ccid { | |||
54 | struct tcp_info *info); | 55 | struct tcp_info *info); |
55 | void (*ccid_hc_tx_get_info)(struct sock *sk, | 56 | void (*ccid_hc_tx_get_info)(struct sock *sk, |
56 | struct tcp_info *info); | 57 | struct tcp_info *info); |
58 | int (*ccid_hc_rx_getsockopt)(struct sock *sk, | ||
59 | const int optname, int len, | ||
60 | u32 __user *optval, | ||
61 | int __user *optlen); | ||
62 | int (*ccid_hc_tx_getsockopt)(struct sock *sk, | ||
63 | const int optname, int len, | ||
64 | u32 __user *optval, | ||
65 | int __user *optlen); | ||
57 | }; | 66 | }; |
58 | 67 | ||
59 | extern int ccid_register(struct ccid *ccid); | 68 | extern int ccid_register(struct ccid *ccid); |
@@ -177,4 +186,26 @@ static inline void ccid_hc_tx_get_info(struct ccid *ccid, struct sock *sk, | |||
177 | if (ccid->ccid_hc_tx_get_info != NULL) | 186 | if (ccid->ccid_hc_tx_get_info != NULL) |
178 | ccid->ccid_hc_tx_get_info(sk, info); | 187 | ccid->ccid_hc_tx_get_info(sk, info); |
179 | } | 188 | } |
189 | |||
190 | static inline int ccid_hc_rx_getsockopt(struct ccid *ccid, struct sock *sk, | ||
191 | const int optname, int len, | ||
192 | u32 __user *optval, int __user *optlen) | ||
193 | { | ||
194 | int rc = -ENOPROTOOPT; | ||
195 | if (ccid->ccid_hc_rx_getsockopt != NULL) | ||
196 | rc = ccid->ccid_hc_rx_getsockopt(sk, optname, len, | ||
197 | optval, optlen); | ||
198 | return rc; | ||
199 | } | ||
200 | |||
201 | static inline int ccid_hc_tx_getsockopt(struct ccid *ccid, struct sock *sk, | ||
202 | const int optname, int len, | ||
203 | u32 __user *optval, int __user *optlen) | ||
204 | { | ||
205 | int rc = -ENOPROTOOPT; | ||
206 | if (ccid->ccid_hc_tx_getsockopt != NULL) | ||
207 | rc = ccid->ccid_hc_tx_getsockopt(sk, optname, len, | ||
208 | optval, optlen); | ||
209 | return rc; | ||
210 | } | ||
180 | #endif /* _CCID_H */ | 211 | #endif /* _CCID_H */ |