Print this page
dccp: starting module template


  67  * "drivers" that are actually IP (e.g., ICMP, UDP) can use the same set
  68  * of flags.
  69  */
  70 #define IP_DEVMTFLAGS D_MP
  71 #endif  /* _KERNEL */
  72 
  73 #define IP_MOD_NAME     "ip"
  74 #define IP_DEV_NAME     "/dev/ip"
  75 #define IP6_DEV_NAME    "/dev/ip6"
  76 
  77 #define UDP_MOD_NAME    "udp"
  78 #define UDP_DEV_NAME    "/dev/udp"
  79 #define UDP6_DEV_NAME   "/dev/udp6"
  80 
  81 #define TCP_MOD_NAME    "tcp"
  82 #define TCP_DEV_NAME    "/dev/tcp"
  83 #define TCP6_DEV_NAME   "/dev/tcp6"
  84 
  85 #define SCTP_MOD_NAME   "sctp"
  86 




  87 #ifndef _IPADDR_T
  88 #define _IPADDR_T
  89 typedef uint32_t ipaddr_t;
  90 #endif
  91 
  92 /* Number of bits in an address */
  93 #define IP_ABITS                32
  94 #define IPV4_ABITS              IP_ABITS
  95 #define IPV6_ABITS              128
  96 #define IP_MAX_HW_LEN   40
  97 
  98 #define IP_HOST_MASK            (ipaddr_t)0xffffffffU
  99 
 100 #define IP_CSUM(mp, off, sum)           (~ip_cksum(mp, off, sum) & 0xFFFF)
 101 #define IP_CSUM_PARTIAL(mp, off, sum)   ip_cksum(mp, off, sum)
 102 #define IP_BCSUM_PARTIAL(bp, len, sum)  bcksum(bp, len, sum)
 103 
 104 #define ILL_FRAG_HASH_TBL_COUNT ((unsigned int)64)
 105 #define ILL_FRAG_HASH_TBL_SIZE  (ILL_FRAG_HASH_TBL_COUNT * sizeof (ipfb_t))
 106 


 200         ((mp)->b_next = (mblk_t *)(uintptr_t)(u))
 201 #define IP_REASS_END(mp)                ((uint_t)(uintptr_t)((mp)->b_prev))
 202 #define IP_REASS_SET_END(mp, u)         \
 203         ((mp)->b_prev = (mblk_t *)(uintptr_t)(u))
 204 
 205 #define IP_REASS_COMPLETE       0x1
 206 #define IP_REASS_PARTIAL        0x2
 207 #define IP_REASS_FAILED         0x4
 208 
 209 /*
 210  * Test to determine whether this is a module instance of IP or a
 211  * driver instance of IP.
 212  */
 213 #define CONN_Q(q)       (WR(q)->q_next == NULL)
 214 
 215 #define Q_TO_CONN(q)    ((conn_t *)(q)->q_ptr)
 216 #define Q_TO_TCP(q)     (Q_TO_CONN((q))->conn_tcp)
 217 #define Q_TO_UDP(q)     (Q_TO_CONN((q))->conn_udp)
 218 #define Q_TO_ICMP(q)    (Q_TO_CONN((q))->conn_icmp)
 219 #define Q_TO_RTS(q)     (Q_TO_CONN((q))->conn_rts)

 220 
 221 #define CONNP_TO_WQ(connp)      ((connp)->conn_wq)
 222 #define CONNP_TO_RQ(connp)      ((connp)->conn_rq)
 223 
 224 #define GRAB_CONN_LOCK(q)       {                               \
 225         if (q != NULL && CONN_Q(q))                             \
 226                 mutex_enter(&(Q_TO_CONN(q))->conn_lock); \
 227 }
 228 
 229 #define RELEASE_CONN_LOCK(q)    {                               \
 230         if (q != NULL && CONN_Q(q))                             \
 231                 mutex_exit(&(Q_TO_CONN(q))->conn_lock);          \
 232 }
 233 
 234 /*
 235  * Ref counter macros for ioctls. This provides a guard for TCP to stop
 236  * tcp_close from removing the rq/wq whilst an ioctl is still in flight on the
 237  * stream. The ioctl could have been queued on e.g. an ipsq. tcp_close will wait
 238  * until the ioctlref count is zero before proceeding.
 239  * Ideally conn_oper_pending_ill would be used for this purpose. However, in the


3731 #define SQTAG_IP_FANOUT_TCP             26
3732 #define SQTAG_IPSQ_CLEAN_RING           27
3733 #define SQTAG_TCP_WPUT_OTHER            28
3734 #define SQTAG_TCP_CONN_REQ_UNBOUND      29
3735 #define SQTAG_TCP_SEND_PENDING          30
3736 #define SQTAG_BIND_RETRY                31
3737 #define SQTAG_UDP_FANOUT                32
3738 #define SQTAG_UDP_INPUT                 33
3739 #define SQTAG_UDP_WPUT                  34
3740 #define SQTAG_UDP_OUTPUT                35
3741 #define SQTAG_TCP_KSSL_INPUT            36
3742 #define SQTAG_TCP_DROP_Q0               37
3743 #define SQTAG_TCP_CONN_REQ_2            38
3744 #define SQTAG_IP_INPUT_RX_RING          39
3745 #define SQTAG_SQUEUE_CHANGE             40
3746 #define SQTAG_CONNECT_FINISH            41
3747 #define SQTAG_SYNCHRONOUS_OP            42
3748 #define SQTAG_TCP_SHUTDOWN_OUTPUT       43
3749 #define SQTAG_TCP_IXA_CLEANUP           44
3750 #define SQTAG_TCP_SEND_SYNACK           45







3751 
3752 extern sin_t    sin_null;       /* Zero address for quick clears */
3753 extern sin6_t   sin6_null;      /* Zero address for quick clears */
3754 
3755 #endif  /* _KERNEL */
3756 
3757 #ifdef  __cplusplus
3758 }
3759 #endif
3760 
3761 #endif  /* _INET_IP_H */


  67  * "drivers" that are actually IP (e.g., ICMP, UDP) can use the same set
  68  * of flags.
  69  */
  70 #define IP_DEVMTFLAGS D_MP
  71 #endif  /* _KERNEL */
  72 
  73 #define IP_MOD_NAME     "ip"
  74 #define IP_DEV_NAME     "/dev/ip"
  75 #define IP6_DEV_NAME    "/dev/ip6"
  76 
  77 #define UDP_MOD_NAME    "udp"
  78 #define UDP_DEV_NAME    "/dev/udp"
  79 #define UDP6_DEV_NAME   "/dev/udp6"
  80 
  81 #define TCP_MOD_NAME    "tcp"
  82 #define TCP_DEV_NAME    "/dev/tcp"
  83 #define TCP6_DEV_NAME   "/dev/tcp6"
  84 
  85 #define SCTP_MOD_NAME   "sctp"
  86 
  87 #define DCCP_MOD_NAME   "dccp"
  88 #define DCCP_DEV_NAME   "/dev/dccp"
  89 #define DCCP6_DEV_NAME  "/dev/dccp6"
  90 
  91 #ifndef _IPADDR_T
  92 #define _IPADDR_T
  93 typedef uint32_t ipaddr_t;
  94 #endif
  95 
  96 /* Number of bits in an address */
  97 #define IP_ABITS                32
  98 #define IPV4_ABITS              IP_ABITS
  99 #define IPV6_ABITS              128
 100 #define IP_MAX_HW_LEN   40
 101 
 102 #define IP_HOST_MASK            (ipaddr_t)0xffffffffU
 103 
 104 #define IP_CSUM(mp, off, sum)           (~ip_cksum(mp, off, sum) & 0xFFFF)
 105 #define IP_CSUM_PARTIAL(mp, off, sum)   ip_cksum(mp, off, sum)
 106 #define IP_BCSUM_PARTIAL(bp, len, sum)  bcksum(bp, len, sum)
 107 
 108 #define ILL_FRAG_HASH_TBL_COUNT ((unsigned int)64)
 109 #define ILL_FRAG_HASH_TBL_SIZE  (ILL_FRAG_HASH_TBL_COUNT * sizeof (ipfb_t))
 110 


 204         ((mp)->b_next = (mblk_t *)(uintptr_t)(u))
 205 #define IP_REASS_END(mp)                ((uint_t)(uintptr_t)((mp)->b_prev))
 206 #define IP_REASS_SET_END(mp, u)         \
 207         ((mp)->b_prev = (mblk_t *)(uintptr_t)(u))
 208 
 209 #define IP_REASS_COMPLETE       0x1
 210 #define IP_REASS_PARTIAL        0x2
 211 #define IP_REASS_FAILED         0x4
 212 
 213 /*
 214  * Test to determine whether this is a module instance of IP or a
 215  * driver instance of IP.
 216  */
 217 #define CONN_Q(q)       (WR(q)->q_next == NULL)
 218 
 219 #define Q_TO_CONN(q)    ((conn_t *)(q)->q_ptr)
 220 #define Q_TO_TCP(q)     (Q_TO_CONN((q))->conn_tcp)
 221 #define Q_TO_UDP(q)     (Q_TO_CONN((q))->conn_udp)
 222 #define Q_TO_ICMP(q)    (Q_TO_CONN((q))->conn_icmp)
 223 #define Q_TO_RTS(q)     (Q_TO_CONN((q))->conn_rts)
 224 #define Q_TO_DCCP(q)    (Q_TO_CONN((q))->conn_dccp)
 225 
 226 #define CONNP_TO_WQ(connp)      ((connp)->conn_wq)
 227 #define CONNP_TO_RQ(connp)      ((connp)->conn_rq)
 228 
 229 #define GRAB_CONN_LOCK(q)       {                               \
 230         if (q != NULL && CONN_Q(q))                             \
 231                 mutex_enter(&(Q_TO_CONN(q))->conn_lock); \
 232 }
 233 
 234 #define RELEASE_CONN_LOCK(q)    {                               \
 235         if (q != NULL && CONN_Q(q))                             \
 236                 mutex_exit(&(Q_TO_CONN(q))->conn_lock);          \
 237 }
 238 
 239 /*
 240  * Ref counter macros for ioctls. This provides a guard for TCP to stop
 241  * tcp_close from removing the rq/wq whilst an ioctl is still in flight on the
 242  * stream. The ioctl could have been queued on e.g. an ipsq. tcp_close will wait
 243  * until the ioctlref count is zero before proceeding.
 244  * Ideally conn_oper_pending_ill would be used for this purpose. However, in the


3736 #define SQTAG_IP_FANOUT_TCP             26
3737 #define SQTAG_IPSQ_CLEAN_RING           27
3738 #define SQTAG_TCP_WPUT_OTHER            28
3739 #define SQTAG_TCP_CONN_REQ_UNBOUND      29
3740 #define SQTAG_TCP_SEND_PENDING          30
3741 #define SQTAG_BIND_RETRY                31
3742 #define SQTAG_UDP_FANOUT                32
3743 #define SQTAG_UDP_INPUT                 33
3744 #define SQTAG_UDP_WPUT                  34
3745 #define SQTAG_UDP_OUTPUT                35
3746 #define SQTAG_TCP_KSSL_INPUT            36
3747 #define SQTAG_TCP_DROP_Q0               37
3748 #define SQTAG_TCP_CONN_REQ_2            38
3749 #define SQTAG_IP_INPUT_RX_RING          39
3750 #define SQTAG_SQUEUE_CHANGE             40
3751 #define SQTAG_CONNECT_FINISH            41
3752 #define SQTAG_SYNCHRONOUS_OP            42
3753 #define SQTAG_TCP_SHUTDOWN_OUTPUT       43
3754 #define SQTAG_TCP_IXA_CLEANUP           44
3755 #define SQTAG_TCP_SEND_SYNACK           45
3756 #define SQTAG_IP_DCCP_INPUT             46
3757 #define SQTAG_DCCP_OUTPUT               47
3758 #define SQTAG_DCCP_CONN_REQ_UNBOUND     48
3759 #define SQTAG_DCCP_SEND_RESPONSE        49
3760 #define SQTAG_IP_DCCP_CLOSE             50
3761 #define SQTAG_DCCP_TIMER                51
3762 #define SQTAG_DCCP_SHUTDOWN_OUTPUT      52
3763 
3764 extern sin_t    sin_null;       /* Zero address for quick clears */
3765 extern sin6_t   sin6_null;      /* Zero address for quick clears */
3766 
3767 #endif  /* _KERNEL */
3768 
3769 #ifdef  __cplusplus
3770 }
3771 #endif
3772 
3773 #endif  /* _INET_IP_H */