logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

sockios.h (6846B)


  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * INET An implementation of the TCP/IP protocol suite for the LINUX
  4. * operating system. INET is implemented using the BSD Socket
  5. * interface as the means of communication with the user level.
  6. *
  7. * Definitions of the socket-level I/O control calls.
  8. *
  9. * Version: @(#)sockios.h 1.0.2 03/09/93
  10. *
  11. * Authors: 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 _LINUX_SOCKIOS_H
  20. #define _LINUX_SOCKIOS_H
  21. #include <asm/bitsperlong.h>
  22. #include <asm/sockios.h>
  23. /* Linux-specific socket ioctls */
  24. #define SIOCINQ FIONREAD
  25. #define SIOCOUTQ TIOCOUTQ /* output queue size (not sent + not acked) */
  26. #define SOCK_IOC_TYPE 0x89
  27. /*
  28. * the timeval/timespec data structure layout is defined by libc,
  29. * so we need to cover both possible versions on 32-bit.
  30. */
  31. /* Get stamp (timeval) */
  32. #define SIOCGSTAMP_NEW _IOR(SOCK_IOC_TYPE, 0x06, long long[2])
  33. /* Get stamp (timespec) */
  34. #define SIOCGSTAMPNS_NEW _IOR(SOCK_IOC_TYPE, 0x07, long long[2])
  35. #if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
  36. /* on 64-bit and x32, avoid the ?: operator */
  37. #define SIOCGSTAMP SIOCGSTAMP_OLD
  38. #define SIOCGSTAMPNS SIOCGSTAMPNS_OLD
  39. #else
  40. #define SIOCGSTAMP ((sizeof(struct timeval)) == 8 ? \
  41. SIOCGSTAMP_OLD : SIOCGSTAMP_NEW)
  42. #define SIOCGSTAMPNS ((sizeof(struct timespec)) == 8 ? \
  43. SIOCGSTAMPNS_OLD : SIOCGSTAMPNS_NEW)
  44. #endif
  45. /* Routing table calls. */
  46. #define SIOCADDRT 0x890B /* add routing table entry */
  47. #define SIOCDELRT 0x890C /* delete routing table entry */
  48. #define SIOCRTMSG 0x890D /* unused */
  49. /* Socket configuration controls. */
  50. #define SIOCGIFNAME 0x8910 /* get iface name */
  51. #define SIOCSIFLINK 0x8911 /* set iface channel */
  52. #define SIOCGIFCONF 0x8912 /* get iface list */
  53. #define SIOCGIFFLAGS 0x8913 /* get flags */
  54. #define SIOCSIFFLAGS 0x8914 /* set flags */
  55. #define SIOCGIFADDR 0x8915 /* get PA address */
  56. #define SIOCSIFADDR 0x8916 /* set PA address */
  57. #define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
  58. #define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
  59. #define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
  60. #define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
  61. #define SIOCGIFNETMASK 0x891b /* get network PA mask */
  62. #define SIOCSIFNETMASK 0x891c /* set network PA mask */
  63. #define SIOCGIFMETRIC 0x891d /* get metric */
  64. #define SIOCSIFMETRIC 0x891e /* set metric */
  65. #define SIOCGIFMEM 0x891f /* get memory address (BSD) */
  66. #define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
  67. #define SIOCGIFMTU 0x8921 /* get MTU size */
  68. #define SIOCSIFMTU 0x8922 /* set MTU size */
  69. #define SIOCSIFNAME 0x8923 /* set interface name */
  70. #define SIOCSIFHWADDR 0x8924 /* set hardware address */
  71. #define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
  72. #define SIOCSIFENCAP 0x8926
  73. #define SIOCGIFHWADDR 0x8927 /* Get hardware address */
  74. #define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
  75. #define SIOCSIFSLAVE 0x8930
  76. #define SIOCADDMULTI 0x8931 /* Multicast address lists */
  77. #define SIOCDELMULTI 0x8932
  78. #define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
  79. #define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
  80. #define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
  81. #define SIOCGIFPFLAGS 0x8935
  82. #define SIOCDIFADDR 0x8936 /* delete PA address */
  83. #define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
  84. #define SIOCGIFCOUNT 0x8938 /* get number of devices */
  85. #define SIOCGIFBR 0x8940 /* Bridging support */
  86. #define SIOCSIFBR 0x8941 /* Set bridging options */
  87. #define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
  88. #define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
  89. /* SIOCGIFDIVERT was: 0x8944 Frame diversion support */
  90. /* SIOCSIFDIVERT was: 0x8945 Set frame diversion options */
  91. #define SIOCETHTOOL 0x8946 /* Ethtool interface */
  92. #define SIOCGMIIPHY 0x8947 /* Get address of MII PHY in use. */
  93. #define SIOCGMIIREG 0x8948 /* Read MII PHY register. */
  94. #define SIOCSMIIREG 0x8949 /* Write MII PHY register. */
  95. #define SIOCWANDEV 0x894A /* get/set netdev parameters */
  96. #define SIOCOUTQNSD 0x894B /* output queue size (not sent only) */
  97. #define SIOCGSKNS 0x894C /* get socket network namespace */
  98. /* ARP cache control calls. */
  99. /* 0x8950 - 0x8952 * obsolete calls, don't re-use */
  100. #define SIOCDARP 0x8953 /* delete ARP table entry */
  101. #define SIOCGARP 0x8954 /* get ARP table entry */
  102. #define SIOCSARP 0x8955 /* set ARP table entry */
  103. /* RARP cache control calls. */
  104. #define SIOCDRARP 0x8960 /* delete RARP table entry */
  105. #define SIOCGRARP 0x8961 /* get RARP table entry */
  106. #define SIOCSRARP 0x8962 /* set RARP table entry */
  107. /* Driver configuration calls */
  108. #define SIOCGIFMAP 0x8970 /* Get device parameters */
  109. #define SIOCSIFMAP 0x8971 /* Set device parameters */
  110. /* DLCI configuration calls */
  111. #define SIOCADDDLCI 0x8980 /* Create new DLCI device */
  112. #define SIOCDELDLCI 0x8981 /* Delete DLCI device */
  113. #define SIOCGIFVLAN 0x8982 /* 802.1Q VLAN support */
  114. #define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */
  115. /* bonding calls */
  116. #define SIOCBONDENSLAVE 0x8990 /* enslave a device to the bond */
  117. #define SIOCBONDRELEASE 0x8991 /* release a slave from the bond*/
  118. #define SIOCBONDSETHWADDR 0x8992 /* set the hw addr of the bond */
  119. #define SIOCBONDSLAVEINFOQUERY 0x8993 /* rtn info about slave state */
  120. #define SIOCBONDINFOQUERY 0x8994 /* rtn info about bond state */
  121. #define SIOCBONDCHANGEACTIVE 0x8995 /* update to a new active slave */
  122. /* bridge calls */
  123. #define SIOCBRADDBR 0x89a0 /* create new bridge device */
  124. #define SIOCBRDELBR 0x89a1 /* remove bridge device */
  125. #define SIOCBRADDIF 0x89a2 /* add interface to bridge */
  126. #define SIOCBRDELIF 0x89a3 /* remove interface from bridge */
  127. /* hardware time stamping: parameters in linux/net_tstamp.h */
  128. #define SIOCSHWTSTAMP 0x89b0 /* set and get config */
  129. #define SIOCGHWTSTAMP 0x89b1 /* get config */
  130. /* Device private ioctl calls */
  131. /*
  132. * These 16 ioctls are available to devices via the do_ioctl() device
  133. * vector. Each device should include this file and redefine these names
  134. * as their own. Because these are device dependent it is a good idea
  135. * _NOT_ to issue them to random objects and hope.
  136. *
  137. * THESE IOCTLS ARE _DEPRECATED_ AND WILL DISAPPEAR IN 2.5.X -DaveM
  138. */
  139. #define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
  140. /*
  141. * These 16 ioctl calls are protocol private
  142. */
  143. #define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
  144. #endif /* _LINUX_SOCKIOS_H */