aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccid.h
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2008-11-23 19:04:59 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-23 19:04:59 -0500
commit71c262a3dd42dea73700646d969b0af7a4102edf (patch)
tree7586f62639805bc6b6854b71294e53be66490f2c /net/dccp/ccid.h
parentb20a9c24d5c5d466d7e4a25c6f1bedbd2d16ad4f (diff)
dccp: API to query the current TX/RX CCID
This provides function to query the current TX/RX CCID dynamically, without reliance on the minisock value, using dynamic information available in the currently loaded CCID module. This query function is then used to (a) provide the getsockopt part for getting/setting CCIDs via sockopts; (b) replace the current test for "which CCID is in use" in probe.c. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccid.h')
-rw-r--r--net/dccp/ccid.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/net/dccp/ccid.h b/net/dccp/ccid.h
index 259f5469d7d..803343aed00 100644
--- a/net/dccp/ccid.h
+++ b/net/dccp/ccid.h
@@ -116,6 +116,24 @@ extern struct ccid *ccid_hc_rx_new(unsigned char id, struct sock *sk,
116extern struct ccid *ccid_hc_tx_new(unsigned char id, struct sock *sk, 116extern struct ccid *ccid_hc_tx_new(unsigned char id, struct sock *sk,
117 gfp_t gfp); 117 gfp_t gfp);
118 118
119static inline int ccid_get_current_rx_ccid(struct dccp_sock *dp)
120{
121 struct ccid *ccid = dp->dccps_hc_rx_ccid;
122
123 if (ccid == NULL || ccid->ccid_ops == NULL)
124 return -1;
125 return ccid->ccid_ops->ccid_id;
126}
127
128static inline int ccid_get_current_tx_ccid(struct dccp_sock *dp)
129{
130 struct ccid *ccid = dp->dccps_hc_tx_ccid;
131
132 if (ccid == NULL || ccid->ccid_ops == NULL)
133 return -1;
134 return ccid->ccid_ops->ccid_id;
135}
136
119extern void ccid_hc_rx_delete(struct ccid *ccid, struct sock *sk); 137extern void ccid_hc_rx_delete(struct ccid *ccid, struct sock *sk);
120extern void ccid_hc_tx_delete(struct ccid *ccid, struct sock *sk); 138extern void ccid_hc_tx_delete(struct ccid *ccid, struct sock *sk);
121 139