xref: /linux-6.15/include/uapi/linux/net.h (revision 1f3c98ea)
1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2 /*
3  * NET		An implementation of the SOCKET network access protocol.
4  *		This is the master header file for the Linux NET layer,
5  *		or, in plain English: the networking handling part of the
6  *		kernel.
7  *
8  * Version:	@(#)net.h	1.0.3	05/25/93
9  *
10  * Authors:	Orest Zborowski, <[email protected]>
11  *		Ross Biro
12  *		Fred N. van Kempen, <[email protected]>
13  *
14  *		This program is free software; you can redistribute it and/or
15  *		modify it under the terms of the GNU General Public License
16  *		as published by the Free Software Foundation; either version
17  *		2 of the License, or (at your option) any later version.
18  */
19 #ifndef _UAPI_LINUX_NET_H
20 #define _UAPI_LINUX_NET_H
21 
22 #include <linux/socket.h>
23 #include <asm/socket.h>
24 
25 #define NPROTO		AF_MAX
26 
27 #define SYS_SOCKET	1		/* sys_socket(2)		*/
28 #define SYS_BIND	2		/* sys_bind(2)			*/
29 #define SYS_CONNECT	3		/* sys_connect(2)		*/
30 #define SYS_LISTEN	4		/* sys_listen(2)		*/
31 #define SYS_ACCEPT	5		/* sys_accept(2)		*/
32 #define SYS_GETSOCKNAME	6		/* sys_getsockname(2)		*/
33 #define SYS_GETPEERNAME	7		/* sys_getpeername(2)		*/
34 #define SYS_SOCKETPAIR	8		/* sys_socketpair(2)		*/
35 #define SYS_SEND	9		/* sys_send(2)			*/
36 #define SYS_RECV	10		/* sys_recv(2)			*/
37 #define SYS_SENDTO	11		/* sys_sendto(2)		*/
38 #define SYS_RECVFROM	12		/* sys_recvfrom(2)		*/
39 #define SYS_SHUTDOWN	13		/* sys_shutdown(2)		*/
40 #define SYS_SETSOCKOPT	14		/* sys_setsockopt(2)		*/
41 #define SYS_GETSOCKOPT	15		/* sys_getsockopt(2)		*/
42 #define SYS_SENDMSG	16		/* sys_sendmsg(2)		*/
43 #define SYS_RECVMSG	17		/* sys_recvmsg(2)		*/
44 #define SYS_ACCEPT4	18		/* sys_accept4(2)		*/
45 #define SYS_RECVMMSG	19		/* sys_recvmmsg(2)		*/
46 #define SYS_SENDMMSG	20		/* sys_sendmmsg(2)		*/
47 
48 typedef enum {
49 	SS_FREE = 0,			/* not allocated		*/
50 	SS_UNCONNECTED,			/* unconnected to any socket	*/
51 	SS_CONNECTING,			/* in process of connecting	*/
52 	SS_CONNECTED,			/* connected to socket		*/
53 	SS_DISCONNECTING		/* in process of disconnecting	*/
54 } socket_state;
55 
56 #define __SO_ACCEPTCON	(1 << 16)	/* performed a listen		*/
57 
58 static const char * const pf_family_names[] = {
59 	[PF_UNSPEC]	= "PF_UNSPEC",
60 	[PF_UNIX]	= "PF_UNIX/PF_LOCAL",
61 	[PF_INET]	= "PF_INET",
62 	[PF_AX25]	= "PF_AX25",
63 	[PF_IPX]	= "PF_IPX",
64 	[PF_APPLETALK]	= "PF_APPLETALK",
65 	[PF_NETROM]	= "PF_NETROM",
66 	[PF_BRIDGE]	= "PF_BRIDGE",
67 	[PF_ATMPVC]	= "PF_ATMPVC",
68 	[PF_X25]	= "PF_X25",
69 	[PF_INET6]	= "PF_INET6",
70 	[PF_ROSE]	= "PF_ROSE",
71 	[PF_DECnet]	= "PF_DECnet",
72 	[PF_NETBEUI]	= "PF_NETBEUI",
73 	[PF_SECURITY]	= "PF_SECURITY",
74 	[PF_KEY]	= "PF_KEY",
75 	[PF_NETLINK]	= "PF_NETLINK/PF_ROUTE",
76 	[PF_PACKET]	= "PF_PACKET",
77 	[PF_ASH]	= "PF_ASH",
78 	[PF_ECONET]	= "PF_ECONET",
79 	[PF_ATMSVC]	= "PF_ATMSVC",
80 	[PF_RDS]	= "PF_RDS",
81 	[PF_SNA]	= "PF_SNA",
82 	[PF_IRDA]	= "PF_IRDA",
83 	[PF_PPPOX]	= "PF_PPPOX",
84 	[PF_WANPIPE]	= "PF_WANPIPE",
85 	[PF_LLC]	= "PF_LLC",
86 	[PF_IB]		= "PF_IB",
87 	[PF_MPLS]	= "PF_MPLS",
88 	[PF_CAN]	= "PF_CAN",
89 	[PF_TIPC]	= "PF_TIPC",
90 	[PF_BLUETOOTH]	= "PF_BLUETOOTH",
91 	[PF_IUCV]	= "PF_IUCV",
92 	[PF_RXRPC]	= "PF_RXRPC",
93 	[PF_ISDN]	= "PF_ISDN",
94 	[PF_PHONET]	= "PF_PHONET",
95 	[PF_IEEE802154]	= "PF_IEEE802154",
96 	[PF_CAIF]	= "PF_CAIF",
97 	[PF_ALG]	= "PF_ALG",
98 	[PF_NFC]	= "PF_NFC",
99 	[PF_VSOCK]	= "PF_VSOCK",
100 	[PF_KCM]	= "PF_KCM",
101 	[PF_QIPCRTR]	= "PF_QIPCRTR",
102 	[PF_SMC]	= "PF_SMC",
103 	[PF_XDP]	= "PF_XDP",
104 };
105 
106 #endif /* _UAPI_LINUX_NET_H */
107