]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/dccp/ccid.h
[BRIDGE]: generate kobject remove event
[linux-2.6-omap-h63xx.git] / net / dccp / ccid.h
index 962f1e9e2f7e5fe42c16112ec657bdd7174f2aac..de681c6ad081307c8fd1069eb6c370b4854177cd 100644 (file)
  */
 
 #include <net/sock.h>
+#include <linux/compiler.h>
 #include <linux/dccp.h>
 #include <linux/list.h>
 #include <linux/module.h>
 
 #define CCID_MAX 255
 
+struct tcp_info;
+
 struct ccid {
        unsigned char   ccid_id;
        const char      *ccid_name;
@@ -54,6 +57,14 @@ struct ccid {
                                               struct tcp_info *info);
        void            (*ccid_hc_tx_get_info)(struct sock *sk,
                                               struct tcp_info *info);
+       int             (*ccid_hc_rx_getsockopt)(struct sock *sk,
+                                                const int optname, int len,
+                                                u32 __user *optval,
+                                                int __user *optlen);
+       int             (*ccid_hc_tx_getsockopt)(struct sock *sk,
+                                                const int optname, int len,
+                                                u32 __user *optval,
+                                                int __user *optlen);
 };
 
 extern int        ccid_register(struct ccid *ccid);
@@ -101,14 +112,14 @@ static inline int ccid_hc_tx_init(struct ccid *ccid, struct sock *sk)
 
 static inline void ccid_hc_rx_exit(struct ccid *ccid, struct sock *sk)
 {
-       if (ccid->ccid_hc_rx_exit != NULL &&
+       if (ccid != NULL && ccid->ccid_hc_rx_exit != NULL &&
            dccp_sk(sk)->dccps_hc_rx_ccid_private != NULL)
                ccid->ccid_hc_rx_exit(sk);
 }
 
 static inline void ccid_hc_tx_exit(struct ccid *ccid, struct sock *sk)
 {
-       if (ccid->ccid_hc_tx_exit != NULL &&
+       if (ccid != NULL && ccid->ccid_hc_tx_exit != NULL &&
            dccp_sk(sk)->dccps_hc_tx_ccid_private != NULL)
                ccid->ccid_hc_tx_exit(sk);
 }
@@ -177,4 +188,26 @@ static inline void ccid_hc_tx_get_info(struct ccid *ccid, struct sock *sk,
        if (ccid->ccid_hc_tx_get_info != NULL)
                ccid->ccid_hc_tx_get_info(sk, info);
 }
+
+static inline int ccid_hc_rx_getsockopt(struct ccid *ccid, struct sock *sk,
+                                       const int optname, int len,
+                                       u32 __user *optval, int __user *optlen)
+{
+       int rc = -ENOPROTOOPT;
+       if (ccid->ccid_hc_rx_getsockopt != NULL)
+               rc = ccid->ccid_hc_rx_getsockopt(sk, optname, len,
+                                                optval, optlen);
+       return rc;
+}
+
+static inline int ccid_hc_tx_getsockopt(struct ccid *ccid, struct sock *sk,
+                                       const int optname, int len,
+                                       u32 __user *optval, int __user *optlen)
+{
+       int rc = -ENOPROTOOPT;
+       if (ccid->ccid_hc_tx_getsockopt != NULL)
+               rc = ccid->ccid_hc_tx_getsockopt(sk, optname, len,
+                                                optval, optlen);
+       return rc;
+}
 #endif /* _CCID_H */