Print this page
dccp: conn_t


  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #ifndef _INET_IPCLASSIFIER_H
  27 #define _INET_IPCLASSIFIER_H
  28 
  29 #ifdef  __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <inet/common.h>
  34 #include <inet/ip.h>
  35 #include <inet/mi.h>
  36 #include <inet/tcp.h>

  37 #include <inet/ip6.h>
  38 #include <netinet/in.h>           /* for IPPROTO_* constants */
  39 #include <sys/sdt.h>
  40 #include <sys/socket_proto.h>
  41 #include <sys/sunddi.h>
  42 #include <sys/sunldi.h>
  43 
  44 typedef void (*edesc_rpf)(void *, mblk_t *, void *, ip_recv_attr_t *);
  45 struct icmph_s;
  46 struct icmp6_hdr;
  47 typedef boolean_t (*edesc_vpf)(conn_t *, void *, struct icmph_s *,
  48     struct icmp6_hdr *, ip_recv_attr_t *);
  49 
  50 /*
  51  * ==============================
  52  * =    The CONNECTION          =
  53  * ==============================
  54  */
  55 
  56 /*


  67 /* Unused                       0x00100000 */
  68 /* Unused                       0x00200000 */
  69 /* Unused                       0x00400000 */
  70 #define IPCL_CL_LISTENER        0x00800000      /* Cluster listener */
  71 /* Unused                       0x01000000 */
  72 /* Unused                       0x02000000 */
  73 /* Unused                       0x04000000 */
  74 /* Unused                       0x08000000 */
  75 /* Unused                       0x10000000 */
  76 /* Unused                       0x20000000 */
  77 #define IPCL_CONNECTED          0x40000000      /* Conn in connected table */
  78 #define IPCL_BOUND              0x80000000      /* Conn in bind table */
  79 
  80 /* Flags identifying the type of conn */
  81 #define IPCL_TCPCONN            0x00000001      /* From tcp_conn_cache */
  82 #define IPCL_SCTPCONN           0x00000002      /* From sctp_conn_cache */
  83 #define IPCL_IPCCONN            0x00000004      /* From ip_conn_cache */
  84 #define IPCL_UDPCONN            0x00000008      /* From udp_conn_cache */
  85 #define IPCL_RAWIPCONN          0x00000010      /* From rawip_conn_cache */
  86 #define IPCL_RTSCONN            0x00000020      /* From rts_conn_cache */
  87 /* Unused                       0x00000040 */
  88 #define IPCL_IPTUN              0x00000080      /* iptun module above us */
  89 
  90 #define IPCL_NONSTR             0x00001000      /* A non-STREAMS socket */
  91 /* Unused                       0x10000000 */
  92 
  93 #define IPCL_REMOVED            0x00000100
  94 #define IPCL_REUSED             0x00000200
  95 
  96 #define IPCL_IS_CONNECTED(connp)                                        \
  97         ((connp)->conn_flags & IPCL_CONNECTED)
  98 
  99 #define IPCL_IS_BOUND(connp)                                            \
 100         ((connp)->conn_flags & IPCL_BOUND)
 101 
 102 /*
 103  * Can't use conn_proto since we need to tell difference
 104  * between a real TCP socket and a SOCK_RAW, IPPROTO_TCP.
 105  */
 106 #define IPCL_IS_TCP(connp)                                              \
 107         ((connp)->conn_flags & IPCL_TCPCONN)
 108 
 109 #define IPCL_IS_SCTP(connp)                                             \
 110         ((connp)->conn_flags & IPCL_SCTPCONN)
 111 
 112 #define IPCL_IS_UDP(connp)                                              \
 113         ((connp)->conn_flags & IPCL_UDPCONN)
 114 
 115 #define IPCL_IS_RAWIP(connp)                                            \
 116         ((connp)->conn_flags & IPCL_RAWIPCONN)
 117 
 118 #define IPCL_IS_RTS(connp)                                              \
 119         ((connp)->conn_flags & IPCL_RTSCONN)
 120 
 121 #define IPCL_IS_IPTUN(connp)                                            \
 122         ((connp)->conn_flags & IPCL_IPTUN)
 123 



 124 #define IPCL_IS_NONSTR(connp)   ((connp)->conn_flags & IPCL_NONSTR)
 125 
 126 typedef struct connf_s connf_t;
 127 
 128 typedef struct
 129 {
 130         int     ctb_depth;
 131 #define CONN_STACK_DEPTH        15
 132         pc_t    ctb_stack[CONN_STACK_DEPTH];
 133 } conn_trace_t;
 134 
 135 typedef struct ip_helper_minor_info_s {
 136         dev_t   ip_minfo_dev;           /* Device */
 137         vmem_t  *ip_minfo_arena;        /* Arena */
 138 } ip_helper_minfo_t;
 139 
 140 /*
 141  * ip helper stream info
 142  */
 143 typedef struct ip_helper_stream_info_s {


 220  * and are preserved when it is freed. Fields after that are bzero'ed when
 221  * the conn_t is freed.
 222  *
 223  * Much of the conn_t is protected by conn_lock.
 224  *
 225  * conn_lock is also used by some ULPs (like UDP and RAWIP) to protect
 226  * their state.
 227  */
 228 struct conn_s {
 229         kmutex_t        conn_lock;
 230         uint32_t        conn_ref;               /* Reference counter */
 231         uint32_t        conn_flags;             /* Conn Flags */
 232 
 233         union {
 234                 tcp_t           *cp_tcp;        /* Pointer to the tcp struct */
 235                 struct udp_s    *cp_udp;        /* Pointer to the udp struct */
 236                 struct icmp_s   *cp_icmp;       /* Pointer to rawip struct */
 237                 struct rts_s    *cp_rts;        /* Pointer to rts struct */
 238                 struct iptun_s  *cp_iptun;      /* Pointer to iptun_t */
 239                 struct sctp_s   *cp_sctp;       /* For IPCL_SCTPCONN */

 240                 void            *cp_priv;
 241         } conn_proto_priv;
 242 #define conn_tcp        conn_proto_priv.cp_tcp
 243 #define conn_udp        conn_proto_priv.cp_udp
 244 #define conn_icmp       conn_proto_priv.cp_icmp
 245 #define conn_rts        conn_proto_priv.cp_rts
 246 #define conn_iptun      conn_proto_priv.cp_iptun
 247 #define conn_sctp       conn_proto_priv.cp_sctp

 248 #define conn_priv       conn_proto_priv.cp_priv
 249 
 250         kcondvar_t      conn_cv;
 251         uint8_t         conn_proto;             /* protocol type */
 252 
 253         edesc_rpf       conn_recv;              /* Pointer to recv routine */
 254         edesc_rpf       conn_recvicmp;          /* For ICMP error */
 255         edesc_vpf       conn_verifyicmp;        /* Verify ICMP error */
 256 
 257         ip_xmit_attr_t  *conn_ixa;              /* Options if no ancil data */
 258 
 259         /* Fields after this are bzero'ed when the conn_t is freed. */
 260 #define conn_start_clr  conn_recv_ancillary
 261 
 262         /* Options for receive-side ancillary data */
 263         crb_t           conn_recv_ancillary;
 264 
 265         squeue_t        *conn_sqp;              /* Squeue for processing */
 266         uint_t          conn_state_flags;       /* IP state flags */
 267 


 634         ((ntohl(laddr) ^ ((ntohl(faddr) << 24) | (ntohl(faddr) >> 8))) % \
 635         ipcl_iptun_fanout_size)
 636 
 637 #define IPCL_IPTUN_HASH_V6(laddr, faddr)                                \
 638         IPCL_IPTUN_HASH((laddr)->s6_addr32[0] ^ (laddr)->s6_addr32[1] ^   \
 639             (faddr)->s6_addr32[2] ^ (faddr)->s6_addr32[3],                \
 640             (faddr)->s6_addr32[0] ^ (faddr)->s6_addr32[1] ^               \
 641             (laddr)->s6_addr32[2] ^ (laddr)->s6_addr32[3])
 642 
 643 #define IPCL_IPTUN_MATCH(connp, laddr, faddr)                   \
 644         (_IPCL_V4_MATCH((connp)->conn_laddr_v6, (laddr)) &&  \
 645         _IPCL_V4_MATCH((connp)->conn_faddr_v6, (faddr)))
 646 
 647 #define IPCL_IPTUN_MATCH_V6(connp, laddr, faddr)                \
 648         (IN6_ARE_ADDR_EQUAL(&(connp)->conn_laddr_v6, (laddr)) && \
 649         IN6_ARE_ADDR_EQUAL(&(connp)->conn_faddr_v6, (faddr)))
 650 
 651 #define IPCL_UDP_HASH(lport, ipst)      \
 652         IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_udp_fanout_size)
 653 












 654 #define CONN_G_HASH_SIZE        1024
 655 
 656 /* Raw socket hash function. */
 657 #define IPCL_RAW_HASH(lport, ipst)      \
 658         IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_raw_fanout_size)
 659 
 660 /*
 661  * This is similar to IPCL_BIND_MATCH except that the local port check
 662  * is changed to a wildcard port check.
 663  * We compare conn_laddr since it captures both connected and a bind to
 664  * a multicast or broadcast address.
 665  */
 666 #define IPCL_RAW_MATCH(connp, proto, laddr)                     \
 667         ((connp)->conn_proto == (proto) &&                   \
 668         (connp)->conn_lport == 0 &&                          \
 669         (_IPCL_V4_MATCH_ANY((connp)->conn_laddr_v6) ||               \
 670         _IPCL_V4_MATCH((connp)->conn_laddr_v6, (laddr))))
 671 
 672 #define IPCL_RAW_MATCH_V6(connp, proto, laddr)                  \
 673         ((connp)->conn_proto == (proto) &&                   \


 693 extern int      ipcl_conn_insert(conn_t *);
 694 extern int      ipcl_conn_insert_v4(conn_t *);
 695 extern int      ipcl_conn_insert_v6(conn_t *);
 696 extern conn_t   *ipcl_get_next_conn(connf_t *, conn_t *, uint32_t);
 697 
 698 conn_t *ipcl_classify_v4(mblk_t *, uint8_t, uint_t, ip_recv_attr_t *,
 699             ip_stack_t *);
 700 conn_t *ipcl_classify_v6(mblk_t *, uint8_t, uint_t, ip_recv_attr_t *,
 701             ip_stack_t *);
 702 conn_t *ipcl_classify(mblk_t *, ip_recv_attr_t *, ip_stack_t *);
 703 conn_t *ipcl_classify_raw(mblk_t *, uint8_t, uint32_t, ipha_t *,
 704     ip6_t *, ip_recv_attr_t *, ip_stack_t *);
 705 conn_t *ipcl_iptun_classify_v4(ipaddr_t *, ipaddr_t *, ip_stack_t *);
 706 conn_t *ipcl_iptun_classify_v6(in6_addr_t *, in6_addr_t *, ip_stack_t *);
 707 void    ipcl_globalhash_insert(conn_t *);
 708 void    ipcl_globalhash_remove(conn_t *);
 709 void    ipcl_walk(pfv_t, void *, ip_stack_t *);
 710 conn_t  *ipcl_tcp_lookup_reversed_ipv4(ipha_t *, tcpha_t *, int, ip_stack_t *);
 711 conn_t  *ipcl_tcp_lookup_reversed_ipv6(ip6_t *, tcpha_t *, int, uint_t,
 712             ip_stack_t *);





 713 conn_t  *ipcl_lookup_listener_v4(uint16_t, ipaddr_t, zoneid_t, ip_stack_t *);
 714 conn_t  *ipcl_lookup_listener_v6(uint16_t, in6_addr_t *, uint_t, zoneid_t,
 715             ip_stack_t *);
 716 int     conn_trace_ref(conn_t *);
 717 int     conn_untrace_ref(conn_t *);
 718 void    ipcl_conn_cleanup(conn_t *);
 719 extern uint_t   conn_recvancillary_size(conn_t *, crb_t, ip_recv_attr_t *,
 720     mblk_t *, ip_pkt_t *);
 721 extern void     conn_recvancillary_add(conn_t *, crb_t, ip_recv_attr_t *,
 722     ip_pkt_t *, uchar_t *, uint_t);
 723 conn_t *ipcl_conn_tcp_lookup_reversed_ipv4(conn_t *, ipha_t *, tcpha_t *,
 724             ip_stack_t *);
 725 conn_t *ipcl_conn_tcp_lookup_reversed_ipv6(conn_t *, ip6_t *, tcpha_t *,
 726             ip_stack_t *);
 727 
 728 extern int ip_create_helper_stream(conn_t *, ldi_ident_t);
 729 extern void ip_free_helper_stream(conn_t *);
 730 extern int      ip_helper_stream_setup(queue_t *, dev_t *, int, int,
 731     cred_t *, boolean_t);
 732 


  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #ifndef _INET_IPCLASSIFIER_H
  27 #define _INET_IPCLASSIFIER_H
  28 
  29 #ifdef  __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <inet/common.h>
  34 #include <inet/ip.h>
  35 #include <inet/mi.h>
  36 #include <inet/tcp.h>
  37 #include <inet/dccp.h>
  38 #include <inet/ip6.h>
  39 #include <netinet/in.h>           /* for IPPROTO_* constants */
  40 #include <sys/sdt.h>
  41 #include <sys/socket_proto.h>
  42 #include <sys/sunddi.h>
  43 #include <sys/sunldi.h>
  44 
  45 typedef void (*edesc_rpf)(void *, mblk_t *, void *, ip_recv_attr_t *);
  46 struct icmph_s;
  47 struct icmp6_hdr;
  48 typedef boolean_t (*edesc_vpf)(conn_t *, void *, struct icmph_s *,
  49     struct icmp6_hdr *, ip_recv_attr_t *);
  50 
  51 /*
  52  * ==============================
  53  * =    The CONNECTION          =
  54  * ==============================
  55  */
  56 
  57 /*


  68 /* Unused                       0x00100000 */
  69 /* Unused                       0x00200000 */
  70 /* Unused                       0x00400000 */
  71 #define IPCL_CL_LISTENER        0x00800000      /* Cluster listener */
  72 /* Unused                       0x01000000 */
  73 /* Unused                       0x02000000 */
  74 /* Unused                       0x04000000 */
  75 /* Unused                       0x08000000 */
  76 /* Unused                       0x10000000 */
  77 /* Unused                       0x20000000 */
  78 #define IPCL_CONNECTED          0x40000000      /* Conn in connected table */
  79 #define IPCL_BOUND              0x80000000      /* Conn in bind table */
  80 
  81 /* Flags identifying the type of conn */
  82 #define IPCL_TCPCONN            0x00000001      /* From tcp_conn_cache */
  83 #define IPCL_SCTPCONN           0x00000002      /* From sctp_conn_cache */
  84 #define IPCL_IPCCONN            0x00000004      /* From ip_conn_cache */
  85 #define IPCL_UDPCONN            0x00000008      /* From udp_conn_cache */
  86 #define IPCL_RAWIPCONN          0x00000010      /* From rawip_conn_cache */
  87 #define IPCL_RTSCONN            0x00000020      /* From rts_conn_cache */
  88 #define IPCL_DCCPCONN           0x00000040      /* From dccp_conn_cache */
  89 #define IPCL_IPTUN              0x00000080      /* iptun module above us */
  90 
  91 #define IPCL_NONSTR             0x00001000      /* A non-STREAMS socket */
  92 /* Unused                       0x10000000 */
  93 
  94 #define IPCL_REMOVED            0x00000100
  95 #define IPCL_REUSED             0x00000200
  96 
  97 #define IPCL_IS_CONNECTED(connp)                                        \
  98         ((connp)->conn_flags & IPCL_CONNECTED)
  99 
 100 #define IPCL_IS_BOUND(connp)                                            \
 101         ((connp)->conn_flags & IPCL_BOUND)
 102 
 103 /*
 104  * Can't use conn_proto since we need to tell difference
 105  * between a real TCP socket and a SOCK_RAW, IPPROTO_TCP.
 106  */
 107 #define IPCL_IS_TCP(connp)                                              \
 108         ((connp)->conn_flags & IPCL_TCPCONN)
 109 
 110 #define IPCL_IS_SCTP(connp)                                             \
 111         ((connp)->conn_flags & IPCL_SCTPCONN)
 112 
 113 #define IPCL_IS_UDP(connp)                                              \
 114         ((connp)->conn_flags & IPCL_UDPCONN)
 115 
 116 #define IPCL_IS_RAWIP(connp)                                            \
 117         ((connp)->conn_flags & IPCL_RAWIPCONN)
 118 
 119 #define IPCL_IS_RTS(connp)                                              \
 120         ((connp)->conn_flags & IPCL_RTSCONN)
 121 
 122 #define IPCL_IS_IPTUN(connp)                                            \
 123         ((connp)->conn_flags & IPCL_IPTUN)
 124 
 125 #define IPCL_IS_DCCP(connp)                                             \
 126         ((connp)->conn_flags & IPCL_DCCPCONN)
 127 
 128 #define IPCL_IS_NONSTR(connp)   ((connp)->conn_flags & IPCL_NONSTR)
 129 
 130 typedef struct connf_s connf_t;
 131 
 132 typedef struct
 133 {
 134         int     ctb_depth;
 135 #define CONN_STACK_DEPTH        15
 136         pc_t    ctb_stack[CONN_STACK_DEPTH];
 137 } conn_trace_t;
 138 
 139 typedef struct ip_helper_minor_info_s {
 140         dev_t   ip_minfo_dev;           /* Device */
 141         vmem_t  *ip_minfo_arena;        /* Arena */
 142 } ip_helper_minfo_t;
 143 
 144 /*
 145  * ip helper stream info
 146  */
 147 typedef struct ip_helper_stream_info_s {


 224  * and are preserved when it is freed. Fields after that are bzero'ed when
 225  * the conn_t is freed.
 226  *
 227  * Much of the conn_t is protected by conn_lock.
 228  *
 229  * conn_lock is also used by some ULPs (like UDP and RAWIP) to protect
 230  * their state.
 231  */
 232 struct conn_s {
 233         kmutex_t        conn_lock;
 234         uint32_t        conn_ref;               /* Reference counter */
 235         uint32_t        conn_flags;             /* Conn Flags */
 236 
 237         union {
 238                 tcp_t           *cp_tcp;        /* Pointer to the tcp struct */
 239                 struct udp_s    *cp_udp;        /* Pointer to the udp struct */
 240                 struct icmp_s   *cp_icmp;       /* Pointer to rawip struct */
 241                 struct rts_s    *cp_rts;        /* Pointer to rts struct */
 242                 struct iptun_s  *cp_iptun;      /* Pointer to iptun_t */
 243                 struct sctp_s   *cp_sctp;       /* For IPCL_SCTPCONN */
 244                 struct dccp_s   *cp_dccp;       /* Pointer to dccp struct */
 245                 void            *cp_priv;
 246         } conn_proto_priv;
 247 #define conn_tcp        conn_proto_priv.cp_tcp
 248 #define conn_udp        conn_proto_priv.cp_udp
 249 #define conn_icmp       conn_proto_priv.cp_icmp
 250 #define conn_rts        conn_proto_priv.cp_rts
 251 #define conn_iptun      conn_proto_priv.cp_iptun
 252 #define conn_sctp       conn_proto_priv.cp_sctp
 253 #define conn_dccp       conn_proto_priv.cp_dccp
 254 #define conn_priv       conn_proto_priv.cp_priv
 255 
 256         kcondvar_t      conn_cv;
 257         uint8_t         conn_proto;             /* protocol type */
 258 
 259         edesc_rpf       conn_recv;              /* Pointer to recv routine */
 260         edesc_rpf       conn_recvicmp;          /* For ICMP error */
 261         edesc_vpf       conn_verifyicmp;        /* Verify ICMP error */
 262 
 263         ip_xmit_attr_t  *conn_ixa;              /* Options if no ancil data */
 264 
 265         /* Fields after this are bzero'ed when the conn_t is freed. */
 266 #define conn_start_clr  conn_recv_ancillary
 267 
 268         /* Options for receive-side ancillary data */
 269         crb_t           conn_recv_ancillary;
 270 
 271         squeue_t        *conn_sqp;              /* Squeue for processing */
 272         uint_t          conn_state_flags;       /* IP state flags */
 273 


 640         ((ntohl(laddr) ^ ((ntohl(faddr) << 24) | (ntohl(faddr) >> 8))) % \
 641         ipcl_iptun_fanout_size)
 642 
 643 #define IPCL_IPTUN_HASH_V6(laddr, faddr)                                \
 644         IPCL_IPTUN_HASH((laddr)->s6_addr32[0] ^ (laddr)->s6_addr32[1] ^   \
 645             (faddr)->s6_addr32[2] ^ (faddr)->s6_addr32[3],                \
 646             (faddr)->s6_addr32[0] ^ (faddr)->s6_addr32[1] ^               \
 647             (laddr)->s6_addr32[2] ^ (laddr)->s6_addr32[3])
 648 
 649 #define IPCL_IPTUN_MATCH(connp, laddr, faddr)                   \
 650         (_IPCL_V4_MATCH((connp)->conn_laddr_v6, (laddr)) &&  \
 651         _IPCL_V4_MATCH((connp)->conn_faddr_v6, (faddr)))
 652 
 653 #define IPCL_IPTUN_MATCH_V6(connp, laddr, faddr)                \
 654         (IN6_ARE_ADDR_EQUAL(&(connp)->conn_laddr_v6, (laddr)) && \
 655         IN6_ARE_ADDR_EQUAL(&(connp)->conn_faddr_v6, (faddr)))
 656 
 657 #define IPCL_UDP_HASH(lport, ipst)      \
 658         IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_udp_fanout_size)
 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 
 672 #define CONN_G_HASH_SIZE        1024
 673 
 674 /* Raw socket hash function. */
 675 #define IPCL_RAW_HASH(lport, ipst)      \
 676         IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_raw_fanout_size)
 677 
 678 /*
 679  * This is similar to IPCL_BIND_MATCH except that the local port check
 680  * is changed to a wildcard port check.
 681  * We compare conn_laddr since it captures both connected and a bind to
 682  * a multicast or broadcast address.
 683  */
 684 #define IPCL_RAW_MATCH(connp, proto, laddr)                     \
 685         ((connp)->conn_proto == (proto) &&                   \
 686         (connp)->conn_lport == 0 &&                          \
 687         (_IPCL_V4_MATCH_ANY((connp)->conn_laddr_v6) ||               \
 688         _IPCL_V4_MATCH((connp)->conn_laddr_v6, (laddr))))
 689 
 690 #define IPCL_RAW_MATCH_V6(connp, proto, laddr)                  \
 691         ((connp)->conn_proto == (proto) &&                   \


 711 extern int      ipcl_conn_insert(conn_t *);
 712 extern int      ipcl_conn_insert_v4(conn_t *);
 713 extern int      ipcl_conn_insert_v6(conn_t *);
 714 extern conn_t   *ipcl_get_next_conn(connf_t *, conn_t *, uint32_t);
 715 
 716 conn_t *ipcl_classify_v4(mblk_t *, uint8_t, uint_t, ip_recv_attr_t *,
 717             ip_stack_t *);
 718 conn_t *ipcl_classify_v6(mblk_t *, uint8_t, uint_t, ip_recv_attr_t *,
 719             ip_stack_t *);
 720 conn_t *ipcl_classify(mblk_t *, ip_recv_attr_t *, ip_stack_t *);
 721 conn_t *ipcl_classify_raw(mblk_t *, uint8_t, uint32_t, ipha_t *,
 722     ip6_t *, ip_recv_attr_t *, ip_stack_t *);
 723 conn_t *ipcl_iptun_classify_v4(ipaddr_t *, ipaddr_t *, ip_stack_t *);
 724 conn_t *ipcl_iptun_classify_v6(in6_addr_t *, in6_addr_t *, ip_stack_t *);
 725 void    ipcl_globalhash_insert(conn_t *);
 726 void    ipcl_globalhash_remove(conn_t *);
 727 void    ipcl_walk(pfv_t, void *, ip_stack_t *);
 728 conn_t  *ipcl_tcp_lookup_reversed_ipv4(ipha_t *, tcpha_t *, int, ip_stack_t *);
 729 conn_t  *ipcl_tcp_lookup_reversed_ipv6(ip6_t *, tcpha_t *, int, uint_t,
 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 */
 736 conn_t  *ipcl_lookup_listener_v4(uint16_t, ipaddr_t, zoneid_t, ip_stack_t *);
 737 conn_t  *ipcl_lookup_listener_v6(uint16_t, in6_addr_t *, uint_t, zoneid_t,
 738             ip_stack_t *);
 739 int     conn_trace_ref(conn_t *);
 740 int     conn_untrace_ref(conn_t *);
 741 void    ipcl_conn_cleanup(conn_t *);
 742 extern uint_t   conn_recvancillary_size(conn_t *, crb_t, ip_recv_attr_t *,
 743     mblk_t *, ip_pkt_t *);
 744 extern void     conn_recvancillary_add(conn_t *, crb_t, ip_recv_attr_t *,
 745     ip_pkt_t *, uchar_t *, uint_t);
 746 conn_t *ipcl_conn_tcp_lookup_reversed_ipv4(conn_t *, ipha_t *, tcpha_t *,
 747             ip_stack_t *);
 748 conn_t *ipcl_conn_tcp_lookup_reversed_ipv6(conn_t *, ip6_t *, tcpha_t *,
 749             ip_stack_t *);
 750 
 751 extern int ip_create_helper_stream(conn_t *, ldi_ident_t);
 752 extern void ip_free_helper_stream(conn_t *);
 753 extern int      ip_helper_stream_setup(queue_t *, dev_t *, int, int,
 754     cred_t *, boolean_t);
 755