net.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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, <obz@Kodak.COM>
  11. * Ross Biro
  12. * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  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. #include <linux/socket.h>
  22. #include <asm/socket.h>
  23. #define NPROTO AF_MAX
  24. #define SYS_SOCKET 1 /* sys_socket(2) */
  25. #define SYS_BIND 2 /* sys_bind(2) */
  26. #define SYS_CONNECT 3 /* sys_connect(2) */
  27. #define SYS_LISTEN 4 /* sys_listen(2) */
  28. #define SYS_ACCEPT 5 /* sys_accept(2) */
  29. #define SYS_GETSOCKNAME 6 /* sys_getsockname(2) */
  30. #define SYS_GETPEERNAME 7 /* sys_getpeername(2) */
  31. #define SYS_SOCKETPAIR 8 /* sys_socketpair(2) */
  32. #define SYS_SEND 9 /* sys_send(2) */
  33. #define SYS_RECV 10 /* sys_recv(2) */
  34. #define SYS_SENDTO 11 /* sys_sendto(2) */
  35. #define SYS_RECVFROM 12 /* sys_recvfrom(2) */
  36. #define SYS_SHUTDOWN 13 /* sys_shutdown(2) */
  37. #define SYS_SETSOCKOPT 14 /* sys_setsockopt(2) */
  38. #define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */
  39. #define SYS_SENDMSG 16 /* sys_sendmsg(2) */
  40. #define SYS_RECVMSG 17 /* sys_recvmsg(2) */
  41. #define SYS_ACCEPT4 18 /* sys_accept4(2) */
  42. #define SYS_RECVMMSG 19 /* sys_recvmmsg(2) */
  43. #define SYS_SENDMMSG 20 /* sys_sendmmsg(2) */
  44. typedef enum {
  45. SS_FREE = 0, /* not allocated */
  46. SS_UNCONNECTED, /* unconnected to any socket */
  47. SS_CONNECTING, /* in process of connecting */
  48. SS_CONNECTED, /* connected to socket */
  49. SS_DISCONNECTING /* in process of disconnecting */
  50. } socket_state;
  51. #define __SO_ACCEPTCON (1 << 16) /* performed a listen */
  52. #endif /* _UAPI_LINUX_NET_H */