Print this page
dccp: conn_t

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ipclassifier.h
          +++ new/usr/src/uts/common/inet/ipclassifier.h
↓ open down ↓ 76 lines elided ↑ open up ↑
  77   77  #define IPCL_CONNECTED          0x40000000      /* Conn in connected table */
  78   78  #define IPCL_BOUND              0x80000000      /* Conn in bind table */
  79   79  
  80   80  /* Flags identifying the type of conn */
  81   81  #define IPCL_TCPCONN            0x00000001      /* From tcp_conn_cache */
  82   82  #define IPCL_SCTPCONN           0x00000002      /* From sctp_conn_cache */
  83   83  #define IPCL_IPCCONN            0x00000004      /* From ip_conn_cache */
  84   84  #define IPCL_UDPCONN            0x00000008      /* From udp_conn_cache */
  85   85  #define IPCL_RAWIPCONN          0x00000010      /* From rawip_conn_cache */
  86   86  #define IPCL_RTSCONN            0x00000020      /* From rts_conn_cache */
  87      -/* Unused                       0x00000040 */
       87 +#define IPCL_DCCPCONN           0x00000040      /* From dccp_conn_cache */
  88   88  #define IPCL_IPTUN              0x00000080      /* iptun module above us */
  89   89  
  90   90  #define IPCL_NONSTR             0x00001000      /* A non-STREAMS socket */
  91   91  /* Unused                       0x10000000 */
  92   92  
  93   93  #define IPCL_REMOVED            0x00000100
  94   94  #define IPCL_REUSED             0x00000200
  95   95  
  96   96  #define IPCL_IS_CONNECTED(connp)                                        \
  97   97          ((connp)->conn_flags & IPCL_CONNECTED)
↓ open down ↓ 16 lines elided ↑ open up ↑
 114  114  
 115  115  #define IPCL_IS_RAWIP(connp)                                            \
 116  116          ((connp)->conn_flags & IPCL_RAWIPCONN)
 117  117  
 118  118  #define IPCL_IS_RTS(connp)                                              \
 119  119          ((connp)->conn_flags & IPCL_RTSCONN)
 120  120  
 121  121  #define IPCL_IS_IPTUN(connp)                                            \
 122  122          ((connp)->conn_flags & IPCL_IPTUN)
 123  123  
      124 +#define IPCL_IS_DCCP(connp)                                             \
      125 +        ((connp)->conn_flags & IPCL_DCCPCONN)
      126 +
 124  127  #define IPCL_IS_NONSTR(connp)   ((connp)->conn_flags & IPCL_NONSTR)
 125  128  
 126  129  typedef struct connf_s connf_t;
 127  130  
 128  131  typedef struct
 129  132  {
 130  133          int     ctb_depth;
 131  134  #define CONN_STACK_DEPTH        15
 132  135          pc_t    ctb_stack[CONN_STACK_DEPTH];
 133  136  } conn_trace_t;
↓ open down ↓ 96 lines elided ↑ open up ↑
 230  233          uint32_t        conn_ref;               /* Reference counter */
 231  234          uint32_t        conn_flags;             /* Conn Flags */
 232  235  
 233  236          union {
 234  237                  tcp_t           *cp_tcp;        /* Pointer to the tcp struct */
 235  238                  struct udp_s    *cp_udp;        /* Pointer to the udp struct */
 236  239                  struct icmp_s   *cp_icmp;       /* Pointer to rawip struct */
 237  240                  struct rts_s    *cp_rts;        /* Pointer to rts struct */
 238  241                  struct iptun_s  *cp_iptun;      /* Pointer to iptun_t */
 239  242                  struct sctp_s   *cp_sctp;       /* For IPCL_SCTPCONN */
      243 +                struct dccp_s   *cp_dccp;       /* Pointer to dccp struct */
 240  244                  void            *cp_priv;
 241  245          } conn_proto_priv;
 242  246  #define conn_tcp        conn_proto_priv.cp_tcp
 243  247  #define conn_udp        conn_proto_priv.cp_udp
 244  248  #define conn_icmp       conn_proto_priv.cp_icmp
 245  249  #define conn_rts        conn_proto_priv.cp_rts
 246  250  #define conn_iptun      conn_proto_priv.cp_iptun
 247  251  #define conn_sctp       conn_proto_priv.cp_sctp
      252 +#define conn_dccp       conn_proto_priv.cp_dccp
 248  253  #define conn_priv       conn_proto_priv.cp_priv
 249  254  
 250  255          kcondvar_t      conn_cv;
 251  256          uint8_t         conn_proto;             /* protocol type */
 252  257  
 253  258          edesc_rpf       conn_recv;              /* Pointer to recv routine */
 254  259          edesc_rpf       conn_recvicmp;          /* For ICMP error */
 255  260          edesc_vpf       conn_verifyicmp;        /* Verify ICMP error */
 256  261  
 257  262          ip_xmit_attr_t  *conn_ixa;              /* Options if no ancil data */
↓ open down ↓ 386 lines elided ↑ open up ↑
 644  649          (_IPCL_V4_MATCH((connp)->conn_laddr_v6, (laddr)) &&     \
 645  650          _IPCL_V4_MATCH((connp)->conn_faddr_v6, (faddr)))
 646  651  
 647  652  #define IPCL_IPTUN_MATCH_V6(connp, laddr, faddr)                \
 648  653          (IN6_ARE_ADDR_EQUAL(&(connp)->conn_laddr_v6, (laddr)) &&        \
 649  654          IN6_ARE_ADDR_EQUAL(&(connp)->conn_faddr_v6, (faddr)))
 650  655  
 651  656  #define IPCL_UDP_HASH(lport, ipst)      \
 652  657          IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_udp_fanout_size)
 653  658  
      659 +#define IPCL_DCCP_CONN_HASH(src, ports, ipst)                           \
      660 +        ((unsigned)(ntohl((src)) ^ ((ports) >> 24) ^ ((ports) >> 16) ^  \
      661 +        ((ports) >> 8) ^ (ports)) % (ipst)->ips_ipcl_dccp_conn_fanout_size)
      662 +
      663 +#define IPCL_DCCP_CONN_HASH_V6(src, ports, ipst)                        \
      664 +        IPCL_DCCP_CONN_HASH(V4_PART_OF_V6((src)), (ports), (ipst))
      665 +
      666 +#define IPCL_DCCP_BIND_HASH(lport, ipst)                                \
      667 +        ((unsigned)(((lport) >> 8) ^ (lport)) %                         \
      668 +            (ipst)->ips_ipcl_dccp_bind_fanout_size)
      669 +
      670 +
 654  671  #define CONN_G_HASH_SIZE        1024
 655  672  
 656  673  /* Raw socket hash function. */
 657  674  #define IPCL_RAW_HASH(lport, ipst)      \
 658  675          IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_raw_fanout_size)
 659  676  
 660  677  /*
 661  678   * This is similar to IPCL_BIND_MATCH except that the local port check
 662  679   * is changed to a wildcard port check.
 663  680   * We compare conn_laddr since it captures both connected and a bind to
↓ open down ↓ 74 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX