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


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   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 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.

  24  */
  25 
  26 #include <sys/types.h>
  27 #include <sys/stream.h>
  28 #define _SUN_TPI_VERSION 2
  29 #include <sys/tihdr.h>
  30 #include <sys/socket.h>
  31 #include <sys/xti_xtiopt.h>
  32 #include <sys/xti_inet.h>
  33 
  34 #include <inet/common.h>
  35 #include <netinet/ip6.h>
  36 #include <inet/ip.h>
  37 #include <inet/udp_impl.h>
  38 /*
  39  * MK_XXX Following 2 includes temporary to import ip6_rthdr_t
  40  *        definition. May not be needed if we fix ip6_dg_snd_attrs_t
  41  *        to do all extension headers in identical manner.
  42  */
  43 #include <net/if.h>


  94     384 + NGROUPS_UMAX * sizeof (gid_t), 0 },
  95 { SO_EXCLBIND, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
  96 { SO_DOMAIN,    SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
  97 { SO_PROTOTYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
  98 
  99 { IP_OPTIONS,   IPPROTO_IP, OA_RW, OA_RW, OP_NP,
 100         (OP_VARLEN|OP_NODEFAULT),
 101         IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ },
 102 { T_IP_OPTIONS, IPPROTO_IP, OA_RW, OA_RW, OP_NP,
 103         (OP_VARLEN|OP_NODEFAULT),
 104         IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ },
 105 
 106 { IP_TOS,       IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 107 { T_IP_TOS,     IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 108 { IP_TTL,       IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 109 { IP_RECVOPTS,  IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 110 { IP_RECVDSTADDR, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
 111         },
 112 { IP_RECVIF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 113 { IP_RECVSLLA, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 114 { IP_RECVTTL,   IPPROTO_IP,  OA_RW, OA_RW, OP_NP, 0, sizeof (int),
 115         0 },
 116 { IP_MULTICAST_IF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0,
 117         sizeof (struct in_addr),        0 /* INADDR_ANY */ },
 118 
 119 { IP_MULTICAST_LOOP, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_DEF_FN,
 120         sizeof (uchar_t), -1 /* not initialized */},
 121 
 122 { IP_MULTICAST_TTL, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_DEF_FN,
 123         sizeof (uchar_t), -1 /* not initialized */ },
 124 
 125 { IP_ADD_MEMBERSHIP, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
 126         sizeof (struct ip_mreq), -1 /* not initialized */ },
 127 
 128 { IP_DROP_MEMBERSHIP, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
 129         sizeof (struct ip_mreq), -1 /* not initialized */ },
 130 
 131 { IP_BLOCK_SOURCE, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
 132         sizeof (struct ip_mreq_source), -1 /* not initialized */ },
 133 
 134 { IP_UNBLOCK_SOURCE, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
 135         sizeof (struct ip_mreq_source), -1 /* not initialized */ },




   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   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 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  25  */
  26 
  27 #include <sys/types.h>
  28 #include <sys/stream.h>
  29 #define _SUN_TPI_VERSION 2
  30 #include <sys/tihdr.h>
  31 #include <sys/socket.h>
  32 #include <sys/xti_xtiopt.h>
  33 #include <sys/xti_inet.h>
  34 
  35 #include <inet/common.h>
  36 #include <netinet/ip6.h>
  37 #include <inet/ip.h>
  38 #include <inet/udp_impl.h>
  39 /*
  40  * MK_XXX Following 2 includes temporary to import ip6_rthdr_t
  41  *        definition. May not be needed if we fix ip6_dg_snd_attrs_t
  42  *        to do all extension headers in identical manner.
  43  */
  44 #include <net/if.h>


  95     384 + NGROUPS_UMAX * sizeof (gid_t), 0 },
  96 { SO_EXCLBIND, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
  97 { SO_DOMAIN,    SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
  98 { SO_PROTOTYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
  99 
 100 { IP_OPTIONS,   IPPROTO_IP, OA_RW, OA_RW, OP_NP,
 101         (OP_VARLEN|OP_NODEFAULT),
 102         IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ },
 103 { T_IP_OPTIONS, IPPROTO_IP, OA_RW, OA_RW, OP_NP,
 104         (OP_VARLEN|OP_NODEFAULT),
 105         IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ },
 106 
 107 { IP_TOS,       IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 108 { T_IP_TOS,     IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 109 { IP_TTL,       IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 110 { IP_RECVOPTS,  IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 111 { IP_RECVDSTADDR, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
 112         },
 113 { IP_RECVIF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 114 { IP_RECVSLLA, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 115 { IP_RECVTTL,   IPPROTO_IP,  OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 116 { IP_RECVTOS,   IPPROTO_IP,  OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
 117 { IP_MULTICAST_IF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0,
 118         sizeof (struct in_addr),        0 /* INADDR_ANY */ },
 119 
 120 { IP_MULTICAST_LOOP, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_DEF_FN,
 121         sizeof (uchar_t), -1 /* not initialized */},
 122 
 123 { IP_MULTICAST_TTL, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_DEF_FN,
 124         sizeof (uchar_t), -1 /* not initialized */ },
 125 
 126 { IP_ADD_MEMBERSHIP, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
 127         sizeof (struct ip_mreq), -1 /* not initialized */ },
 128 
 129 { IP_DROP_MEMBERSHIP, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
 130         sizeof (struct ip_mreq), -1 /* not initialized */ },
 131 
 132 { IP_BLOCK_SOURCE, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
 133         sizeof (struct ip_mreq_source), -1 /* not initialized */ },
 134 
 135 { IP_UNBLOCK_SOURCE, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
 136         sizeof (struct ip_mreq_source), -1 /* not initialized */ },