Print this page




   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 2015, Joyent, Inc.
  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>


 276         OP_NODEFAULT, sizeof (struct group_source_req),
 277         -1 /* not initialized */ },
 278 { MCAST_UNBLOCK_SOURCE, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
 279         OP_NODEFAULT, sizeof (struct group_source_req),
 280         -1 /* not initialized */ },
 281 { MCAST_JOIN_SOURCE_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
 282         OP_NODEFAULT, sizeof (struct group_source_req),
 283         -1 /* not initialized */ },
 284 { MCAST_LEAVE_SOURCE_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
 285         OP_NODEFAULT, sizeof (struct group_source_req),
 286         -1 /* not initialized */ },
 287 
 288 { UDP_ANONPRIVBIND, IPPROTO_UDP, OA_R, OA_RW, OP_PRIVPORT, 0,
 289         sizeof (int), 0 },
 290 { UDP_EXCLBIND, IPPROTO_UDP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
 291         },
 292 { UDP_RCVHDR, IPPROTO_UDP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
 293         },
 294 { UDP_NAT_T_ENDPOINT, IPPROTO_UDP, OA_RW, OA_RW, OP_PRIVPORT, 0, sizeof (int),
 295         0 },
 296 { UDP_SRCPORT_HASH, IPPROTO_UDP, OA_R, OA_RW, OP_CONFIG, 0, sizeof (int), 0 },
 297 { UDP_SND_TO_CONNECTED, IPPROTO_UDP, OA_R, OA_RW, OP_CONFIG, 0, sizeof (int),
 298         0 }
 299 };
 300 
 301 /*
 302  * Table of all supported levels
 303  * Note: Some levels (e.g. XTI_GENERIC) may be valid but may not have
 304  * any supported options so we need this info separately.
 305  *
 306  * This is needed only for topmost tpi providers and is used only by
 307  * XTI interfaces.
 308  */
 309 optlevel_t      udp_valid_levels_arr[] = {
 310         XTI_GENERIC,
 311         SOL_SOCKET,
 312         IPPROTO_UDP,
 313         IPPROTO_IP,
 314         IPPROTO_IPV6
 315 };
 316 




   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>


 275         OP_NODEFAULT, sizeof (struct group_source_req),
 276         -1 /* not initialized */ },
 277 { MCAST_UNBLOCK_SOURCE, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
 278         OP_NODEFAULT, sizeof (struct group_source_req),
 279         -1 /* not initialized */ },
 280 { MCAST_JOIN_SOURCE_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
 281         OP_NODEFAULT, sizeof (struct group_source_req),
 282         -1 /* not initialized */ },
 283 { MCAST_LEAVE_SOURCE_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
 284         OP_NODEFAULT, sizeof (struct group_source_req),
 285         -1 /* not initialized */ },
 286 
 287 { UDP_ANONPRIVBIND, IPPROTO_UDP, OA_R, OA_RW, OP_PRIVPORT, 0,
 288         sizeof (int), 0 },
 289 { UDP_EXCLBIND, IPPROTO_UDP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
 290         },
 291 { UDP_RCVHDR, IPPROTO_UDP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
 292         },
 293 { UDP_NAT_T_ENDPOINT, IPPROTO_UDP, OA_RW, OA_RW, OP_PRIVPORT, 0, sizeof (int),
 294         0 },

 295 { UDP_SND_TO_CONNECTED, IPPROTO_UDP, OA_R, OA_RW, OP_CONFIG, 0, sizeof (int),
 296         0 }
 297 };
 298 
 299 /*
 300  * Table of all supported levels
 301  * Note: Some levels (e.g. XTI_GENERIC) may be valid but may not have
 302  * any supported options so we need this info separately.
 303  *
 304  * This is needed only for topmost tpi providers and is used only by
 305  * XTI interfaces.
 306  */
 307 optlevel_t      udp_valid_levels_arr[] = {
 308         XTI_GENERIC,
 309         SOL_SOCKET,
 310         IPPROTO_UDP,
 311         IPPROTO_IP,
 312         IPPROTO_IPV6
 313 };
 314