Print this page
13175 Add support for IP_RECVTOS
13182 CMSG_ macros should have man pages
Change-ID: I784aa36cfd3c17e3cccbf1fd329fa7e69b663ef9


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  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 /*
  27  * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
  28  */
  29 
  30 #ifndef _INET_IPCLASSIFIER_H
  31 #define _INET_IPCLASSIFIER_H
  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #include <inet/common.h>
  38 #include <inet/ip.h>
  39 #include <inet/mi.h>
  40 #include <inet/tcp.h>
  41 #include <inet/ip6.h>
  42 #include <netinet/in.h>           /* for IPPROTO_* constants */
  43 #include <sys/sdt.h>
  44 #include <sys/socket_proto.h>
  45 #include <sys/sunddi.h>
  46 #include <sys/sunldi.h>
  47 


 168 
 169 /*
 170  * conn receive ancillary definition.
 171  *
 172  * These are the set of socket options that make the receive side
 173  * potentially pass up ancillary data items.
 174  * We have a union with an integer so that we can quickly check whether
 175  * any ancillary data items need to be added.
 176  */
 177 typedef struct crb_s {
 178         union {
 179                 uint32_t        crbu_all;
 180                 struct {
 181                         uint32_t
 182         crbb_recvdstaddr : 1,           /* IP_RECVDSTADDR option */
 183         crbb_recvopts : 1,              /* IP_RECVOPTS option */
 184         crbb_recvif : 1,                /* IP_RECVIF option */
 185         crbb_recvslla : 1,              /* IP_RECVSLLA option */
 186 
 187         crbb_recvttl : 1,               /* IP_RECVTTL option */

 188         crbb_ip_recvpktinfo : 1,        /* IP*_RECVPKTINFO option  */
 189         crbb_ipv6_recvhoplimit : 1,     /* IPV6_RECVHOPLIMIT option */
 190         crbb_ipv6_recvhopopts : 1,      /* IPV6_RECVHOPOPTS option */
 191 
 192         crbb_ipv6_recvdstopts : 1,      /* IPV6_RECVDSTOPTS option */
 193         crbb_ipv6_recvrthdr : 1,        /* IPV6_RECVRTHDR option */
 194         crbb_old_ipv6_recvdstopts : 1,  /* old form of IPV6_DSTOPTS */
 195         crbb_ipv6_recvrthdrdstopts : 1, /* IPV6_RECVRTHDRDSTOPTS */
 196 
 197         crbb_ipv6_recvtclass : 1,       /* IPV6_RECVTCLASS */
 198         crbb_recvucred : 1,             /* IP_RECVUCRED option */
 199         crbb_timestamp : 1;             /* SO_TIMESTAMP "socket" option */
 200 
 201                 } crbb;
 202         } crbu;
 203 } crb_t;
 204 
 205 #define crb_all                         crbu.crbu_all
 206 #define crb_recvdstaddr                 crbu.crbb.crbb_recvdstaddr
 207 #define crb_recvopts                    crbu.crbb.crbb_recvopts
 208 #define crb_recvif                      crbu.crbb.crbb_recvif
 209 #define crb_recvslla                    crbu.crbb.crbb_recvslla
 210 #define crb_recvttl                     crbu.crbb.crbb_recvttl

 211 #define crb_ip_recvpktinfo              crbu.crbb.crbb_ip_recvpktinfo
 212 #define crb_ipv6_recvhoplimit           crbu.crbb.crbb_ipv6_recvhoplimit
 213 #define crb_ipv6_recvhopopts            crbu.crbb.crbb_ipv6_recvhopopts
 214 #define crb_ipv6_recvdstopts            crbu.crbb.crbb_ipv6_recvdstopts
 215 #define crb_ipv6_recvrthdr              crbu.crbb.crbb_ipv6_recvrthdr
 216 #define crb_old_ipv6_recvdstopts        crbu.crbb.crbb_old_ipv6_recvdstopts
 217 #define crb_ipv6_recvrthdrdstopts       crbu.crbb.crbb_ipv6_recvrthdrdstopts
 218 #define crb_ipv6_recvtclass             crbu.crbb.crbb_ipv6_recvtclass
 219 #define crb_recvucred                   crbu.crbb.crbb_recvucred
 220 #define crb_timestamp                   crbu.crbb.crbb_timestamp
 221 
 222 /*
 223  * The initial fields in the conn_t are setup by the kmem_cache constructor,
 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.




   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  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 /*
  27  * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  28  */
  29 
  30 #ifndef _INET_IPCLASSIFIER_H
  31 #define _INET_IPCLASSIFIER_H
  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #include <inet/common.h>
  38 #include <inet/ip.h>
  39 #include <inet/mi.h>
  40 #include <inet/tcp.h>
  41 #include <inet/ip6.h>
  42 #include <netinet/in.h>           /* for IPPROTO_* constants */
  43 #include <sys/sdt.h>
  44 #include <sys/socket_proto.h>
  45 #include <sys/sunddi.h>
  46 #include <sys/sunldi.h>
  47 


 168 
 169 /*
 170  * conn receive ancillary definition.
 171  *
 172  * These are the set of socket options that make the receive side
 173  * potentially pass up ancillary data items.
 174  * We have a union with an integer so that we can quickly check whether
 175  * any ancillary data items need to be added.
 176  */
 177 typedef struct crb_s {
 178         union {
 179                 uint32_t        crbu_all;
 180                 struct {
 181                         uint32_t
 182         crbb_recvdstaddr : 1,           /* IP_RECVDSTADDR option */
 183         crbb_recvopts : 1,              /* IP_RECVOPTS option */
 184         crbb_recvif : 1,                /* IP_RECVIF option */
 185         crbb_recvslla : 1,              /* IP_RECVSLLA option */
 186 
 187         crbb_recvttl : 1,               /* IP_RECVTTL option */
 188         crbb_recvtos : 1,               /* IP_RECVTOS option */
 189         crbb_ip_recvpktinfo : 1,        /* IP*_RECVPKTINFO option  */
 190         crbb_ipv6_recvhoplimit : 1,     /* IPV6_RECVHOPLIMIT option */
 191         crbb_ipv6_recvhopopts : 1,      /* IPV6_RECVHOPOPTS option */
 192 
 193         crbb_ipv6_recvdstopts : 1,      /* IPV6_RECVDSTOPTS option */
 194         crbb_ipv6_recvrthdr : 1,        /* IPV6_RECVRTHDR option */
 195         crbb_old_ipv6_recvdstopts : 1,  /* old form of IPV6_DSTOPTS */
 196         crbb_ipv6_recvrthdrdstopts : 1, /* IPV6_RECVRTHDRDSTOPTS */
 197 
 198         crbb_ipv6_recvtclass : 1,       /* IPV6_RECVTCLASS */
 199         crbb_recvucred : 1,             /* IP_RECVUCRED option */
 200         crbb_timestamp : 1;             /* SO_TIMESTAMP "socket" option */
 201 
 202                 } crbb;
 203         } crbu;
 204 } crb_t;
 205 
 206 #define crb_all                         crbu.crbu_all
 207 #define crb_recvdstaddr                 crbu.crbb.crbb_recvdstaddr
 208 #define crb_recvopts                    crbu.crbb.crbb_recvopts
 209 #define crb_recvif                      crbu.crbb.crbb_recvif
 210 #define crb_recvslla                    crbu.crbb.crbb_recvslla
 211 #define crb_recvttl                     crbu.crbb.crbb_recvttl
 212 #define crb_recvtos                     crbu.crbb.crbb_recvtos
 213 #define crb_ip_recvpktinfo              crbu.crbb.crbb_ip_recvpktinfo
 214 #define crb_ipv6_recvhoplimit           crbu.crbb.crbb_ipv6_recvhoplimit
 215 #define crb_ipv6_recvhopopts            crbu.crbb.crbb_ipv6_recvhopopts
 216 #define crb_ipv6_recvdstopts            crbu.crbb.crbb_ipv6_recvdstopts
 217 #define crb_ipv6_recvrthdr              crbu.crbb.crbb_ipv6_recvrthdr
 218 #define crb_old_ipv6_recvdstopts        crbu.crbb.crbb_old_ipv6_recvdstopts
 219 #define crb_ipv6_recvrthdrdstopts       crbu.crbb.crbb_ipv6_recvrthdrdstopts
 220 #define crb_ipv6_recvtclass             crbu.crbb.crbb_ipv6_recvtclass
 221 #define crb_recvucred                   crbu.crbb.crbb_recvucred
 222 #define crb_timestamp                   crbu.crbb.crbb_timestamp
 223 
 224 /*
 225  * The initial fields in the conn_t are setup by the kmem_cache constructor,
 226  * and are preserved when it is freed. Fields after that are bzero'ed when
 227  * the conn_t is freed.
 228  *
 229  * Much of the conn_t is protected by conn_lock.
 230  *
 231  * conn_lock is also used by some ULPs (like UDP and RAWIP) to protect
 232  * their state.