xref: /linux/include/uapi/linux/udp.h (revision 8dd06ef34b6e2f41b29fbf5fc1663780f2524285)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  * INET		An implementation of the TCP/IP protocol suite for the LINUX
4607ca46eSDavid Howells  *		operating system.  INET is implemented using the  BSD Socket
5607ca46eSDavid Howells  *		interface as the means of communication with the user level.
6607ca46eSDavid Howells  *
7607ca46eSDavid Howells  *		Definitions for the UDP protocol.
8607ca46eSDavid Howells  *
9607ca46eSDavid Howells  * Version:	@(#)udp.h	1.0.2	04/28/93
10607ca46eSDavid Howells  *
11607ca46eSDavid Howells  * Author:	Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12607ca46eSDavid Howells  *
13607ca46eSDavid Howells  *		This program is free software; you can redistribute it and/or
14607ca46eSDavid Howells  *		modify it under the terms of the GNU General Public License
15607ca46eSDavid Howells  *		as published by the Free Software Foundation; either version
16607ca46eSDavid Howells  *		2 of the License, or (at your option) any later version.
17607ca46eSDavid Howells  */
18607ca46eSDavid Howells #ifndef _UAPI_LINUX_UDP_H
19607ca46eSDavid Howells #define _UAPI_LINUX_UDP_H
20607ca46eSDavid Howells 
21607ca46eSDavid Howells #include <linux/types.h>
22607ca46eSDavid Howells 
23607ca46eSDavid Howells struct udphdr {
24607ca46eSDavid Howells 	__be16	source;
25607ca46eSDavid Howells 	__be16	dest;
26607ca46eSDavid Howells 	__be16	len;
27607ca46eSDavid Howells 	__sum16	check;
28607ca46eSDavid Howells };
29607ca46eSDavid Howells 
30607ca46eSDavid Howells /* UDP socket options */
31607ca46eSDavid Howells #define UDP_CORK	1	/* Never send partially complete segments */
32607ca46eSDavid Howells #define UDP_ENCAP	100	/* Set the socket to accept encapsulated packets */
331c19448cSTom Herbert #define UDP_NO_CHECK6_TX 101	/* Disable sending checksum for UDP6X */
341c19448cSTom Herbert #define UDP_NO_CHECK6_RX 102	/* Disable accpeting checksum for UDP6 */
35bec1f6f6SWillem de Bruijn #define UDP_SEGMENT	103	/* Set GSO segmentation size */
36e20cf8d3SPaolo Abeni #define UDP_GRO		104	/* This socket can receive UDP GRO packets */
37607ca46eSDavid Howells 
38607ca46eSDavid Howells /* UDP encapsulation types */
39607ca46eSDavid Howells #define UDP_ENCAP_ESPINUDP_NON_IKE	1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
40607ca46eSDavid Howells #define UDP_ENCAP_ESPINUDP	2 /* draft-ietf-ipsec-udp-encaps-06 */
41607ca46eSDavid Howells #define UDP_ENCAP_L2TPINUDP	3 /* rfc2661 */
42459aa660SPablo Neira #define UDP_ENCAP_GTP0		4 /* GSM TS 09.60 */
43459aa660SPablo Neira #define UDP_ENCAP_GTP1U		5 /* 3GPP TS 29.060 */
445271953cSDavid Howells #define UDP_ENCAP_RXRPC		6
45*e27cca96SSabrina Dubroca #define TCP_ENCAP_ESPINTCP	7 /* Yikes, this is really xfrm encap types. */
46607ca46eSDavid Howells 
47607ca46eSDavid Howells #endif /* _UAPI_LINUX_UDP_H */
48