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 ↓ 26 lines elided ↑ open up ↑
  27   27  #define _INET_IPCLASSIFIER_H
  28   28  
  29   29  #ifdef  __cplusplus
  30   30  extern "C" {
  31   31  #endif
  32   32  
  33   33  #include <inet/common.h>
  34   34  #include <inet/ip.h>
  35   35  #include <inet/mi.h>
  36   36  #include <inet/tcp.h>
       37 +#include <inet/dccp.h>
  37   38  #include <inet/ip6.h>
  38   39  #include <netinet/in.h>         /* for IPPROTO_* constants */
  39   40  #include <sys/sdt.h>
  40   41  #include <sys/socket_proto.h>
  41   42  #include <sys/sunddi.h>
  42   43  #include <sys/sunldi.h>
  43   44  
  44   45  typedef void (*edesc_rpf)(void *, mblk_t *, void *, ip_recv_attr_t *);
  45   46  struct icmph_s;
  46   47  struct icmp6_hdr;
↓ open down ↓ 30 lines elided ↑ open up ↑
  77   78  #define IPCL_CONNECTED          0x40000000      /* Conn in connected table */
  78   79  #define IPCL_BOUND              0x80000000      /* Conn in bind table */
  79   80  
  80   81  /* Flags identifying the type of conn */
  81   82  #define IPCL_TCPCONN            0x00000001      /* From tcp_conn_cache */
  82   83  #define IPCL_SCTPCONN           0x00000002      /* From sctp_conn_cache */
  83   84  #define IPCL_IPCCONN            0x00000004      /* From ip_conn_cache */
  84   85  #define IPCL_UDPCONN            0x00000008      /* From udp_conn_cache */
  85   86  #define IPCL_RAWIPCONN          0x00000010      /* From rawip_conn_cache */
  86   87  #define IPCL_RTSCONN            0x00000020      /* From rts_conn_cache */
  87      -/* Unused                       0x00000040 */
       88 +#define IPCL_DCCPCONN           0x00000040      /* From dccp_conn_cache */
  88   89  #define IPCL_IPTUN              0x00000080      /* iptun module above us */
  89   90  
  90   91  #define IPCL_NONSTR             0x00001000      /* A non-STREAMS socket */
  91   92  /* Unused                       0x10000000 */
  92   93  
  93   94  #define IPCL_REMOVED            0x00000100
  94   95  #define IPCL_REUSED             0x00000200
  95   96  
  96   97  #define IPCL_IS_CONNECTED(connp)                                        \
  97   98          ((connp)->conn_flags & IPCL_CONNECTED)
↓ open down ↓ 16 lines elided ↑ open up ↑
 114  115  
 115  116  #define IPCL_IS_RAWIP(connp)                                            \
 116  117          ((connp)->conn_flags & IPCL_RAWIPCONN)
 117  118  
 118  119  #define IPCL_IS_RTS(connp)                                              \
 119  120          ((connp)->conn_flags & IPCL_RTSCONN)
 120  121  
 121  122  #define IPCL_IS_IPTUN(connp)                                            \
 122  123          ((connp)->conn_flags & IPCL_IPTUN)
 123  124  
      125 +#define IPCL_IS_DCCP(connp)                                             \
      126 +        ((connp)->conn_flags & IPCL_DCCPCONN)
      127 +
 124  128  #define IPCL_IS_NONSTR(connp)   ((connp)->conn_flags & IPCL_NONSTR)
 125  129  
 126  130  typedef struct connf_s connf_t;
 127  131  
 128  132  typedef struct
 129  133  {
 130  134          int     ctb_depth;
 131  135  #define CONN_STACK_DEPTH        15
 132  136          pc_t    ctb_stack[CONN_STACK_DEPTH];
 133  137  } conn_trace_t;
↓ open down ↓ 96 lines elided ↑ open up ↑
 230  234          uint32_t        conn_ref;               /* Reference counter */
 231  235          uint32_t        conn_flags;             /* Conn Flags */
 232  236  
 233  237          union {
 234  238                  tcp_t           *cp_tcp;        /* Pointer to the tcp struct */
 235  239                  struct udp_s    *cp_udp;        /* Pointer to the udp struct */
 236  240                  struct icmp_s   *cp_icmp;       /* Pointer to rawip struct */
 237  241                  struct rts_s    *cp_rts;        /* Pointer to rts struct */
 238  242                  struct iptun_s  *cp_iptun;      /* Pointer to iptun_t */
 239  243                  struct sctp_s   *cp_sctp;       /* For IPCL_SCTPCONN */
      244 +                struct dccp_s   *cp_dccp;       /* Pointer to dccp struct */
 240  245                  void            *cp_priv;
 241  246          } conn_proto_priv;
 242  247  #define conn_tcp        conn_proto_priv.cp_tcp
 243  248  #define conn_udp        conn_proto_priv.cp_udp
 244  249  #define conn_icmp       conn_proto_priv.cp_icmp
 245  250  #define conn_rts        conn_proto_priv.cp_rts
 246  251  #define conn_iptun      conn_proto_priv.cp_iptun
 247  252  #define conn_sctp       conn_proto_priv.cp_sctp
      253 +#define conn_dccp       conn_proto_priv.cp_dccp
 248  254  #define conn_priv       conn_proto_priv.cp_priv
 249  255  
 250  256          kcondvar_t      conn_cv;
 251  257          uint8_t         conn_proto;             /* protocol type */
 252  258  
 253  259          edesc_rpf       conn_recv;              /* Pointer to recv routine */
 254  260          edesc_rpf       conn_recvicmp;          /* For ICMP error */
 255  261          edesc_vpf       conn_verifyicmp;        /* Verify ICMP error */
 256  262  
 257  263          ip_xmit_attr_t  *conn_ixa;              /* Options if no ancil data */
↓ open down ↓ 386 lines elided ↑ open up ↑
 644  650          (_IPCL_V4_MATCH((connp)->conn_laddr_v6, (laddr)) &&     \
 645  651          _IPCL_V4_MATCH((connp)->conn_faddr_v6, (faddr)))
 646  652  
 647  653  #define IPCL_IPTUN_MATCH_V6(connp, laddr, faddr)                \
 648  654          (IN6_ARE_ADDR_EQUAL(&(connp)->conn_laddr_v6, (laddr)) &&        \
 649  655          IN6_ARE_ADDR_EQUAL(&(connp)->conn_faddr_v6, (faddr)))
 650  656  
 651  657  #define IPCL_UDP_HASH(lport, ipst)      \
 652  658          IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_udp_fanout_size)
 653  659  
      660 +#define IPCL_DCCP_CONN_HASH(src, ports, ipst)                           \
      661 +        ((unsigned)(ntohl((src)) ^ ((ports) >> 24) ^ ((ports) >> 16) ^  \
      662 +        ((ports) >> 8) ^ (ports)) % (ipst)->ips_ipcl_dccp_conn_fanout_size)
      663 +
      664 +#define IPCL_DCCP_CONN_HASH_V6(src, ports, ipst)                        \
      665 +        IPCL_DCCP_CONN_HASH(V4_PART_OF_V6((src)), (ports), (ipst))
      666 +
      667 +#define IPCL_DCCP_BIND_HASH(lport, ipst)                                \
      668 +        ((unsigned)(((lport) >> 8) ^ (lport)) %                         \
      669 +            (ipst)->ips_ipcl_dccp_bind_fanout_size)
      670 +
      671 +
 654  672  #define CONN_G_HASH_SIZE        1024
 655  673  
 656  674  /* Raw socket hash function. */
 657  675  #define IPCL_RAW_HASH(lport, ipst)      \
 658  676          IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_raw_fanout_size)
 659  677  
 660  678  /*
 661  679   * This is similar to IPCL_BIND_MATCH except that the local port check
 662  680   * is changed to a wildcard port check.
 663  681   * We compare conn_laddr since it captures both connected and a bind to
↓ open down ↓ 39 lines elided ↑ open up ↑
 703  721  conn_t *ipcl_classify_raw(mblk_t *, uint8_t, uint32_t, ipha_t *,
 704  722      ip6_t *, ip_recv_attr_t *, ip_stack_t *);
 705  723  conn_t *ipcl_iptun_classify_v4(ipaddr_t *, ipaddr_t *, ip_stack_t *);
 706  724  conn_t *ipcl_iptun_classify_v6(in6_addr_t *, in6_addr_t *, ip_stack_t *);
 707  725  void    ipcl_globalhash_insert(conn_t *);
 708  726  void    ipcl_globalhash_remove(conn_t *);
 709  727  void    ipcl_walk(pfv_t, void *, ip_stack_t *);
 710  728  conn_t  *ipcl_tcp_lookup_reversed_ipv4(ipha_t *, tcpha_t *, int, ip_stack_t *);
 711  729  conn_t  *ipcl_tcp_lookup_reversed_ipv6(ip6_t *, tcpha_t *, int, uint_t,
 712  730              ip_stack_t *);
      731 +/*
      732 +conn_t  *ipcl_dccp_lookup_reversed_ipv4(ipha_t *, dccpha_t *, int, ip_stack_t *);
      733 +conn_t  *ipcl_dccp_lookup_reversed_ipv6(ip6_t *, dccpha_t *, int, uint_t,
      734 +            ip_stack_t *);
      735 +*/
 713  736  conn_t  *ipcl_lookup_listener_v4(uint16_t, ipaddr_t, zoneid_t, ip_stack_t *);
 714  737  conn_t  *ipcl_lookup_listener_v6(uint16_t, in6_addr_t *, uint_t, zoneid_t,
 715  738              ip_stack_t *);
 716  739  int     conn_trace_ref(conn_t *);
 717  740  int     conn_untrace_ref(conn_t *);
 718  741  void    ipcl_conn_cleanup(conn_t *);
 719  742  extern uint_t   conn_recvancillary_size(conn_t *, crb_t, ip_recv_attr_t *,
 720  743      mblk_t *, ip_pkt_t *);
 721  744  extern void     conn_recvancillary_add(conn_t *, crb_t, ip_recv_attr_t *,
 722  745      ip_pkt_t *, uchar_t *, uint_t);
↓ open down ↓ 15 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX