1 /*
   2  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
   3  * Use is subject to license terms.
   4  */
   5 
   6 /*
   7  * Copyright (c) 1982, 1986 Regents of the University of California.
   8  * All rights reserved.  The Berkeley software License Agreement
   9  * specifies the terms and conditions for redistribution.
  10  */
  11 
  12 /*
  13  * Udp protocol header.
  14  * Per RFC 768, September, 1981.
  15  */
  16 
  17 #ifndef _NETINET_UDP_H
  18 #define _NETINET_UDP_H
  19 
  20 #pragma ident   "%Z%%M% %I%     %E% SMI"
  21 /* udp.h 1.7 88/08/19 SMI; from UCB 7.1 6/5/86  */
  22 
  23 #ifdef  __cplusplus
  24 extern "C" {
  25 #endif
  26 
  27 struct udphdr {
  28         in_port_t       uh_sport;               /* source port */
  29         in_port_t       uh_dport;               /* destination port */
  30         int16_t         uh_ulen;                /* udp length */
  31         uint16_t        uh_sum;                 /* udp checksum */
  32 };
  33 
  34 /* Option definitions. */
  35 #define UDP_ANONPRIVBIND        0x0100          /* for internal use only */
  36 #define UDP_EXCLBIND            0x0101          /* for internal use only */
  37 #define UDP_RCVHDR              0x0102          /* for internal use only */
  38 #define UDP_NAT_T_ENDPOINT      0x0103          /* for internal use only */
  39 /*
  40  * Following option in UDP_ namespace required to be exposed through
  41  * <xti.h> (It also requires exposing options not implemented). The options
  42  * with potential for conflicts use #ifndef guards.
  43  *
  44  */
  45 #ifndef UDP_CHECKSUM
  46 #define UDP_CHECKSUM    0x0600
  47 #endif
  48 
  49 #ifdef  __cplusplus
  50 }
  51 #endif
  52 
  53 #endif  /* _NETINET_UDP_H */
 | 
   1 /*
   2  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
   3  * Use is subject to license terms.
   4  * Copyright 2015 Joyent, Inc.
   5  */
   6 
   7 /*
   8  * Copyright (c) 1982, 1986 Regents of the University of California.
   9  * All rights reserved.  The Berkeley software License Agreement
  10  * specifies the terms and conditions for redistribution.
  11  */
  12 
  13 /*
  14  * Udp protocol header.
  15  * Per RFC 768, September, 1981.
  16  */
  17 
  18 #ifndef _NETINET_UDP_H
  19 #define _NETINET_UDP_H
  20 
  21 #pragma ident   "%Z%%M% %I%     %E% SMI"
  22 /* udp.h 1.7 88/08/19 SMI; from UCB 7.1 6/5/86  */
  23 
  24 #ifdef  __cplusplus
  25 extern "C" {
  26 #endif
  27 
  28 struct udphdr {
  29         in_port_t       uh_sport;               /* source port */
  30         in_port_t       uh_dport;               /* destination port */
  31         int16_t         uh_ulen;                /* udp length */
  32         uint16_t        uh_sum;                 /* udp checksum */
  33 };
  34 
  35 /* Option definitions. */
  36 #define UDP_ANONPRIVBIND        0x0100          /* for internal use only */
  37 #define UDP_EXCLBIND            0x0101          /* for internal use only */
  38 #define UDP_RCVHDR              0x0102          /* for internal use only */
  39 #define UDP_NAT_T_ENDPOINT      0x0103          /* for internal use only */
  40 #define UDP_SND_TO_CONNECTED    0x0105          /* for internal use only */
  41 
  42 /*
  43  * Following option in UDP_ namespace required to be exposed through
  44  * <xti.h> (It also requires exposing options not implemented). The options
  45  * with potential for conflicts use #ifndef guards.
  46  *
  47  */
  48 #ifndef UDP_CHECKSUM
  49 #define UDP_CHECKSUM    0x0600
  50 #endif
  51 
  52 #ifdef  __cplusplus
  53 }
  54 #endif
  55 
  56 #endif  /* _NETINET_UDP_H */
 |