Print this page
13175 Add support for IP_RECVTOS
13182 CMSG_ macros should have man pages
Change-ID: I784aa36cfd3c17e3cccbf1fd329fa7e69b663ef9
   1 /*
   2  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   3  * Use is subject to license terms.
   4  *
   5  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.

   6  */
   7 /*
   8  * Copyright (c) 1982, 1986 Regents of the University of California.
   9  * All rights reserved.
  10  *
  11  * Redistribution and use in source and binary forms are permitted
  12  * provided that this notice is preserved and that due credit is given
  13  * to the University of California at Berkeley. The name of the University
  14  * may not be used to endorse or promote products derived from this
  15  * software without specific prior written permission. This software
  16  * is provided ``as is'' without express or implied warranty.
  17  */
  18 
  19 /*
  20  * Constants and structures defined by the internet system,
  21  * according to following documents
  22  *
  23  * Internet ASSIGNED NUMBERS (RFC1700) and its successors:
  24  *      http://www.iana.org/assignments/protocol-numbers
  25  *      http://www.iana.org/assignments/port-numbers


 888 #define IP_OPTIONS      1       /* set/get IP per-packet options   */
 889 #endif
 890 
 891 #define IP_HDRINCL      2       /* int; header is included with data (raw) */
 892 
 893 #ifndef IP_TOS
 894 #define IP_TOS          3       /* int; IP type of service and precedence */
 895 #endif
 896 
 897 #ifndef IP_TTL
 898 #define IP_TTL          4       /* int; IP time to live */
 899 #endif
 900 
 901 #define IP_RECVOPTS     0x5     /* int; receive all IP options w/datagram */
 902 #define IP_RECVRETOPTS  0x6     /* int; receive IP options for response */
 903 #define IP_RECVDSTADDR  0x7     /* int; receive IP dst addr w/datagram */
 904 #define IP_RETOPTS      0x8     /* ip_opts; set/get IP per-packet options */
 905 #define IP_RECVIF       0x9     /* int; receive the inbound interface index */
 906 #define IP_RECVSLLA     0xa     /* sockaddr_dl; get source link layer address */
 907 #define IP_RECVTTL      0xb     /* uint8_t; get TTL for inbound packet */

 908 
 909 #define IP_MULTICAST_IF         0x10    /* set/get IP multicast interface  */
 910 #define IP_MULTICAST_TTL        0x11    /* set/get IP multicast timetolive */
 911 #define IP_MULTICAST_LOOP       0x12    /* set/get IP multicast loopback   */
 912 #define IP_ADD_MEMBERSHIP       0x13    /* add  an IP group membership     */
 913 #define IP_DROP_MEMBERSHIP      0x14    /* drop an IP group membership     */
 914 #define IP_BLOCK_SOURCE         0x15    /* block   mcast pkts from source  */
 915 #define IP_UNBLOCK_SOURCE       0x16    /* unblock mcast pkts from source  */
 916 #define IP_ADD_SOURCE_MEMBERSHIP  0x17  /* add  mcast group/source pair    */
 917 #define IP_DROP_SOURCE_MEMBERSHIP 0x18  /* drop mcast group/source pair    */
 918 #define IP_NEXTHOP              0x19    /* send directly to next hop       */
 919 /*
 920  * IP_PKTINFO and IP_RECVPKTINFO have same value. Size of argument passed in
 921  * is used to differentiate b/w the two.
 922  */
 923 #define IP_PKTINFO              0x1a    /* specify src address and/or index */
 924 #define IP_RECVPKTINFO          0x1a    /* recv dest/matched addr and index */
 925 #define IP_DONTFRAG             0x1b    /* don't fragment packets */
 926 
 927 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)


1229                                         /* the routing header */
1230 #define IPV6_RECVPKTINFO        0x12    /* enable/disable IPV6_PKTINFO */
1231 #define IPV6_RECVHOPLIMIT       0x13    /* enable/disable IPV6_HOPLIMIT */
1232 #define IPV6_RECVHOPOPTS        0x14    /* enable/disable IPV6_HOPOPTS */
1233 
1234 /*
1235  * This options exists for backwards compatability and should no longer be
1236  * used.  Use IPV6_RECVDSTOPTS instead.
1237  */
1238 #define _OLD_IPV6_RECVDSTOPTS   0x15
1239 
1240 #define IPV6_RECVRTHDR          0x16    /* enable/disable IPV6_RTHDR */
1241 
1242 /*
1243  * enable/disable IPV6_RTHDRDSTOPTS.  Now obsolete.  IPV6_RECVDSTOPTS enables
1244  * the receipt of both headers.
1245  */
1246 #define IPV6_RECVRTHDRDSTOPTS   0x17
1247 
1248 #define IPV6_CHECKSUM           0x18    /* Control checksum on raw sockets */
1249 #define IPV6_RECVTCLASS         0x19    /* enable/disable IPV6_CLASS */
1250 #define IPV6_USE_MIN_MTU        0x20    /* send packets with minimum MTU */
1251 #define IPV6_DONTFRAG           0x21    /* don't fragment packets */
1252 #define IPV6_SEC_OPT            0x22    /* Used to set IPSEC options */
1253 #define IPV6_SRC_PREFERENCES    0x23    /* Control socket's src addr select */
1254 #define IPV6_RECVPATHMTU        0x24    /* receive PMTU info */
1255 #define IPV6_PATHMTU            0x25    /* get the PMTU */
1256 #define IPV6_TCLASS             0x26    /* traffic class */
1257 #define IPV6_V6ONLY             0x27    /* v6 only socket option */
1258 
1259 /*
1260  * enable/disable receipt of both both IPV6_DSTOPTS headers.
1261  */
1262 #define IPV6_RECVDSTOPTS        0x28
1263 
1264 /*
1265  * protocol-independent multicast membership options.
1266  */
1267 #define MCAST_JOIN_GROUP        0x29    /* join group for all sources */
1268 #define MCAST_LEAVE_GROUP       0x2a    /* leave group */
1269 #define MCAST_BLOCK_SOURCE      0x2b    /* block specified source */


   1 /*
   2  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   3  * Use is subject to license terms.
   4  *
   5  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
   6  * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
   7  */
   8 /*
   9  * Copyright (c) 1982, 1986 Regents of the University of California.
  10  * All rights reserved.
  11  *
  12  * Redistribution and use in source and binary forms are permitted
  13  * provided that this notice is preserved and that due credit is given
  14  * to the University of California at Berkeley. The name of the University
  15  * may not be used to endorse or promote products derived from this
  16  * software without specific prior written permission. This software
  17  * is provided ``as is'' without express or implied warranty.
  18  */
  19 
  20 /*
  21  * Constants and structures defined by the internet system,
  22  * according to following documents
  23  *
  24  * Internet ASSIGNED NUMBERS (RFC1700) and its successors:
  25  *      http://www.iana.org/assignments/protocol-numbers
  26  *      http://www.iana.org/assignments/port-numbers


 889 #define IP_OPTIONS      1       /* set/get IP per-packet options   */
 890 #endif
 891 
 892 #define IP_HDRINCL      2       /* int; header is included with data (raw) */
 893 
 894 #ifndef IP_TOS
 895 #define IP_TOS          3       /* int; IP type of service and precedence */
 896 #endif
 897 
 898 #ifndef IP_TTL
 899 #define IP_TTL          4       /* int; IP time to live */
 900 #endif
 901 
 902 #define IP_RECVOPTS     0x5     /* int; receive all IP options w/datagram */
 903 #define IP_RECVRETOPTS  0x6     /* int; receive IP options for response */
 904 #define IP_RECVDSTADDR  0x7     /* int; receive IP dst addr w/datagram */
 905 #define IP_RETOPTS      0x8     /* ip_opts; set/get IP per-packet options */
 906 #define IP_RECVIF       0x9     /* int; receive the inbound interface index */
 907 #define IP_RECVSLLA     0xa     /* sockaddr_dl; get source link layer address */
 908 #define IP_RECVTTL      0xb     /* uint8_t; get TTL for inbound packet */
 909 #define IP_RECVTOS      0xc     /* uint8_t; get TOS for inbound packet */
 910 
 911 #define IP_MULTICAST_IF         0x10    /* set/get IP multicast interface  */
 912 #define IP_MULTICAST_TTL        0x11    /* set/get IP multicast timetolive */
 913 #define IP_MULTICAST_LOOP       0x12    /* set/get IP multicast loopback   */
 914 #define IP_ADD_MEMBERSHIP       0x13    /* add  an IP group membership     */
 915 #define IP_DROP_MEMBERSHIP      0x14    /* drop an IP group membership     */
 916 #define IP_BLOCK_SOURCE         0x15    /* block   mcast pkts from source  */
 917 #define IP_UNBLOCK_SOURCE       0x16    /* unblock mcast pkts from source  */
 918 #define IP_ADD_SOURCE_MEMBERSHIP  0x17  /* add  mcast group/source pair    */
 919 #define IP_DROP_SOURCE_MEMBERSHIP 0x18  /* drop mcast group/source pair    */
 920 #define IP_NEXTHOP              0x19    /* send directly to next hop       */
 921 /*
 922  * IP_PKTINFO and IP_RECVPKTINFO have same value. Size of argument passed in
 923  * is used to differentiate b/w the two.
 924  */
 925 #define IP_PKTINFO              0x1a    /* specify src address and/or index */
 926 #define IP_RECVPKTINFO          0x1a    /* recv dest/matched addr and index */
 927 #define IP_DONTFRAG             0x1b    /* don't fragment packets */
 928 
 929 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)


1231                                         /* the routing header */
1232 #define IPV6_RECVPKTINFO        0x12    /* enable/disable IPV6_PKTINFO */
1233 #define IPV6_RECVHOPLIMIT       0x13    /* enable/disable IPV6_HOPLIMIT */
1234 #define IPV6_RECVHOPOPTS        0x14    /* enable/disable IPV6_HOPOPTS */
1235 
1236 /*
1237  * This options exists for backwards compatability and should no longer be
1238  * used.  Use IPV6_RECVDSTOPTS instead.
1239  */
1240 #define _OLD_IPV6_RECVDSTOPTS   0x15
1241 
1242 #define IPV6_RECVRTHDR          0x16    /* enable/disable IPV6_RTHDR */
1243 
1244 /*
1245  * enable/disable IPV6_RTHDRDSTOPTS.  Now obsolete.  IPV6_RECVDSTOPTS enables
1246  * the receipt of both headers.
1247  */
1248 #define IPV6_RECVRTHDRDSTOPTS   0x17
1249 
1250 #define IPV6_CHECKSUM           0x18    /* Control checksum on raw sockets */
1251 #define IPV6_RECVTCLASS         0x19    /* enable/disable IPV6_TCLASS */
1252 #define IPV6_USE_MIN_MTU        0x20    /* send packets with minimum MTU */
1253 #define IPV6_DONTFRAG           0x21    /* don't fragment packets */
1254 #define IPV6_SEC_OPT            0x22    /* Used to set IPSEC options */
1255 #define IPV6_SRC_PREFERENCES    0x23    /* Control socket's src addr select */
1256 #define IPV6_RECVPATHMTU        0x24    /* receive PMTU info */
1257 #define IPV6_PATHMTU            0x25    /* get the PMTU */
1258 #define IPV6_TCLASS             0x26    /* traffic class */
1259 #define IPV6_V6ONLY             0x27    /* v6 only socket option */
1260 
1261 /*
1262  * enable/disable receipt of both both IPV6_DSTOPTS headers.
1263  */
1264 #define IPV6_RECVDSTOPTS        0x28
1265 
1266 /*
1267  * protocol-independent multicast membership options.
1268  */
1269 #define MCAST_JOIN_GROUP        0x29    /* join group for all sources */
1270 #define MCAST_LEAVE_GROUP       0x2a    /* leave group */
1271 #define MCAST_BLOCK_SOURCE      0x2b    /* block specified source */