Print this page
dccp: conn_t

@@ -82,11 +82,11 @@
 #define IPCL_SCTPCONN           0x00000002      /* From sctp_conn_cache */
 #define IPCL_IPCCONN            0x00000004      /* From ip_conn_cache */
 #define IPCL_UDPCONN            0x00000008      /* From udp_conn_cache */
 #define IPCL_RAWIPCONN          0x00000010      /* From rawip_conn_cache */
 #define IPCL_RTSCONN            0x00000020      /* From rts_conn_cache */
-/* Unused                       0x00000040 */
+#define IPCL_DCCPCONN           0x00000040      /* From dccp_conn_cache */
 #define IPCL_IPTUN              0x00000080      /* iptun module above us */
 
 #define IPCL_NONSTR             0x00001000      /* A non-STREAMS socket */
 /* Unused                       0x10000000 */
 

@@ -119,10 +119,13 @@
         ((connp)->conn_flags & IPCL_RTSCONN)
 
 #define IPCL_IS_IPTUN(connp)                                            \
         ((connp)->conn_flags & IPCL_IPTUN)
 
+#define IPCL_IS_DCCP(connp)                                             \
+        ((connp)->conn_flags & IPCL_DCCPCONN)
+
 #define IPCL_IS_NONSTR(connp)   ((connp)->conn_flags & IPCL_NONSTR)
 
 typedef struct connf_s connf_t;
 
 typedef struct

@@ -235,18 +238,20 @@
                 struct udp_s    *cp_udp;        /* Pointer to the udp struct */
                 struct icmp_s   *cp_icmp;       /* Pointer to rawip struct */
                 struct rts_s    *cp_rts;        /* Pointer to rts struct */
                 struct iptun_s  *cp_iptun;      /* Pointer to iptun_t */
                 struct sctp_s   *cp_sctp;       /* For IPCL_SCTPCONN */
+                struct dccp_s   *cp_dccp;       /* Pointer to dccp struct */
                 void            *cp_priv;
         } conn_proto_priv;
 #define conn_tcp        conn_proto_priv.cp_tcp
 #define conn_udp        conn_proto_priv.cp_udp
 #define conn_icmp       conn_proto_priv.cp_icmp
 #define conn_rts        conn_proto_priv.cp_rts
 #define conn_iptun      conn_proto_priv.cp_iptun
 #define conn_sctp       conn_proto_priv.cp_sctp
+#define conn_dccp       conn_proto_priv.cp_dccp
 #define conn_priv       conn_proto_priv.cp_priv
 
         kcondvar_t      conn_cv;
         uint8_t         conn_proto;             /* protocol type */
 

@@ -649,10 +654,22 @@
         IN6_ARE_ADDR_EQUAL(&(connp)->conn_faddr_v6, (faddr)))
 
 #define IPCL_UDP_HASH(lport, ipst)      \
         IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_udp_fanout_size)
 
+#define IPCL_DCCP_CONN_HASH(src, ports, ipst)                           \
+        ((unsigned)(ntohl((src)) ^ ((ports) >> 24) ^ ((ports) >> 16) ^  \
+        ((ports) >> 8) ^ (ports)) % (ipst)->ips_ipcl_dccp_conn_fanout_size)
+
+#define IPCL_DCCP_CONN_HASH_V6(src, ports, ipst)                        \
+        IPCL_DCCP_CONN_HASH(V4_PART_OF_V6((src)), (ports), (ipst))
+
+#define IPCL_DCCP_BIND_HASH(lport, ipst)                                \
+        ((unsigned)(((lport) >> 8) ^ (lport)) %                         \
+            (ipst)->ips_ipcl_dccp_bind_fanout_size)
+
+
 #define CONN_G_HASH_SIZE        1024
 
 /* Raw socket hash function. */
 #define IPCL_RAW_HASH(lport, ipst)      \
         IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_raw_fanout_size)