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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/netinet/in.h
          +++ new/usr/src/uts/common/netinet/in.h
   1    1  /*
   2    2   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   3    3   * Use is subject to license terms.
   4    4   *
   5    5   * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
        6 + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
   6    7   */
   7    8  /*
   8    9   * Copyright (c) 1982, 1986 Regents of the University of California.
   9   10   * All rights reserved.
  10   11   *
  11   12   * Redistribution and use in source and binary forms are permitted
  12   13   * provided that this notice is preserved and that due credit is given
  13   14   * to the University of California at Berkeley. The name of the University
  14   15   * may not be used to endorse or promote products derived from this
  15   16   * software without specific prior written permission. This software
↓ open down ↓ 358 lines elided ↑ open up ↑
 374  375  #define IN_PRIVATE12_NET        0xac100000U     /* 172.16/12 */
 375  376  #define IN_PRIVATE12_MASK       0xfff00000U
 376  377  #define IN_PRIVATE16_NET        0xc0a80000U     /* 192.168/16 */
 377  378  #define IN_PRIVATE16_MASK       0xffff0000U
 378  379  
 379  380  /* RFC 3927 IPv4 link local address (i in host byte-order) */
 380  381  #define IN_LINKLOCAL(i)         (((i) & IN_AUTOCONF_MASK) == IN_AUTOCONF_NET)
 381  382  
 382  383  /* Well known 6to4 Relay Router Anycast address defined in RFC 3068 */
 383  384  #if !defined(_XPG4_2) || !defined(__EXTENSIONS__)
 384      -#define INADDR_6TO4RRANYCAST    0xc0586301U     /* 192.88.99.1 */
      385 +#define INADDR_6TO4RRANYCAST    0xc0586301U     /* 192.88.99.1 */
 385  386  #endif  /* !defined(_XPG4_2) || !defined(__EXTENSIONS__) */
 386  387  
 387  388  #define IN_LOOPBACKNET          127                     /* official! */
 388  389  
 389  390  /*
 390  391   * Define a macro to stuff the loopback address into an Internet address
 391  392   */
 392  393  #if !defined(_XPG4_2) || !defined(__EXTENSIONS__)
 393  394  #define IN_SET_LOOPBACK_ADDR(a) \
 394  395          { (a)->sin_addr.s_addr  = htonl(INADDR_LOOPBACK); \
↓ open down ↓ 64 lines elided ↑ open up ↑
 459  460  #ifdef _BIG_ENDIAN
 460  461  #define IN6ADDR_LOOPBACK_INIT           { 0, 0, 0, 0x00000001U }
 461  462  #else /* _BIG_ENDIAN */
 462  463  #define IN6ADDR_LOOPBACK_INIT           { 0, 0, 0, 0x01000000U }
 463  464  #endif /* _BIG_ENDIAN */
 464  465  
 465  466  #else
 466  467  
 467  468  #define IN6ADDR_ANY_INIT            {   0, 0, 0, 0,     \
 468  469                                          0, 0, 0, 0,     \
 469      -                                        0, 0, 0, 0,     \
      470 +                                        0, 0, 0, 0,     \
 470  471                                          0, 0, 0, 0 }
 471  472  
 472  473  #define IN6ADDR_LOOPBACK_INIT       {   0, 0, 0, 0,     \
 473  474                                          0, 0, 0, 0,     \
 474  475                                          0, 0, 0, 0,     \
 475  476                                          0, 0, 0, 0x1U }
 476  477  #endif /* _KERNEL */
 477  478  
 478  479  /*
 479  480   * RFC 2553 specifies the following macros. Their type is defined
↓ open down ↓ 418 lines elided ↑ open up ↑
 898  899  #define IP_TTL          4       /* int; IP time to live */
 899  900  #endif
 900  901  
 901  902  #define IP_RECVOPTS     0x5     /* int; receive all IP options w/datagram */
 902  903  #define IP_RECVRETOPTS  0x6     /* int; receive IP options for response */
 903  904  #define IP_RECVDSTADDR  0x7     /* int; receive IP dst addr w/datagram */
 904  905  #define IP_RETOPTS      0x8     /* ip_opts; set/get IP per-packet options */
 905  906  #define IP_RECVIF       0x9     /* int; receive the inbound interface index */
 906  907  #define IP_RECVSLLA     0xa     /* sockaddr_dl; get source link layer address */
 907  908  #define IP_RECVTTL      0xb     /* uint8_t; get TTL for inbound packet */
      909 +#define IP_RECVTOS      0xc     /* uint8_t; get TOS for inbound packet */
 908  910  
 909  911  #define IP_MULTICAST_IF         0x10    /* set/get IP multicast interface  */
 910  912  #define IP_MULTICAST_TTL        0x11    /* set/get IP multicast timetolive */
 911  913  #define IP_MULTICAST_LOOP       0x12    /* set/get IP multicast loopback   */
 912  914  #define IP_ADD_MEMBERSHIP       0x13    /* add  an IP group membership     */
 913  915  #define IP_DROP_MEMBERSHIP      0x14    /* drop an IP group membership     */
 914  916  #define IP_BLOCK_SOURCE         0x15    /* block   mcast pkts from source  */
 915  917  #define IP_UNBLOCK_SOURCE       0x16    /* unblock mcast pkts from source  */
 916  918  #define IP_ADD_SOURCE_MEMBERSHIP  0x17  /* add  mcast group/source pair    */
 917  919  #define IP_DROP_SOURCE_MEMBERSHIP 0x18  /* drop mcast group/source pair    */
↓ open down ↓ 14 lines elided ↑ open up ↑
 932  934  #define IPSEC_PREF_NEVER        0x01
 933  935  #define IPSEC_PREF_REQUIRED     0x02
 934  936  #define IPSEC_PREF_UNIQUE       0x04
 935  937  /*
 936  938   * This can be used with the setsockopt() call to set per socket security
 937  939   * options. When the application uses per-socket API, we will reflect
 938  940   * the request on both outbound and inbound packets.
 939  941   */
 940  942  
 941  943  typedef struct ipsec_req {
 942      -        uint_t          ipsr_ah_req;            /* AH request */
 943      -        uint_t          ipsr_esp_req;           /* ESP request */
      944 +        uint_t          ipsr_ah_req;            /* AH request */
      945 +        uint_t          ipsr_esp_req;           /* ESP request */
 944  946          uint_t          ipsr_self_encap_req;    /* Self-Encap request */
 945  947          uint8_t         ipsr_auth_alg;          /* Auth algs for AH */
 946  948          uint8_t         ipsr_esp_alg;           /* Encr algs for ESP */
 947  949          uint8_t         ipsr_esp_auth_alg;      /* Auth algs for ESP */
 948  950  } ipsec_req_t;
 949  951  
 950  952  /*
 951  953   * MCAST_* options are protocol-independent.  The actual definitions
 952  954   * are with the v6 options below; this comment is here to note the
 953  955   * namespace usage.
↓ open down ↓ 285 lines elided ↑ open up ↑
1239 1241  
1240 1242  #define IPV6_RECVRTHDR          0x16    /* enable/disable IPV6_RTHDR */
1241 1243  
1242 1244  /*
1243 1245   * enable/disable IPV6_RTHDRDSTOPTS.  Now obsolete.  IPV6_RECVDSTOPTS enables
1244 1246   * the receipt of both headers.
1245 1247   */
1246 1248  #define IPV6_RECVRTHDRDSTOPTS   0x17
1247 1249  
1248 1250  #define IPV6_CHECKSUM           0x18    /* Control checksum on raw sockets */
1249      -#define IPV6_RECVTCLASS         0x19    /* enable/disable IPV6_CLASS */
     1251 +#define IPV6_RECVTCLASS         0x19    /* enable/disable IPV6_TCLASS */
1250 1252  #define IPV6_USE_MIN_MTU        0x20    /* send packets with minimum MTU */
1251 1253  #define IPV6_DONTFRAG           0x21    /* don't fragment packets */
1252 1254  #define IPV6_SEC_OPT            0x22    /* Used to set IPSEC options */
1253 1255  #define IPV6_SRC_PREFERENCES    0x23    /* Control socket's src addr select */
1254 1256  #define IPV6_RECVPATHMTU        0x24    /* receive PMTU info */
1255 1257  #define IPV6_PATHMTU            0x25    /* get the PMTU */
1256 1258  #define IPV6_TCLASS             0x26    /* traffic class */
1257 1259  #define IPV6_V6ONLY             0x27    /* v6 only socket option */
1258 1260  
1259 1261  /*
↓ open down ↓ 69 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX