x25.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * These are the public elements of the Linux kernel X.25 implementation.
  4. *
  5. * History
  6. * mar/20/00 Daniela Squassoni Disabling/enabling of facilities
  7. * negotiation.
  8. * apr/02/05 Shaun Pereira Selective sub address matching with
  9. * call user data
  10. */
  11. #ifndef X25_KERNEL_H
  12. #define X25_KERNEL_H
  13. #include <linux/types.h>
  14. #include <linux/socket.h>
  15. #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
  16. #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
  17. #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2)
  18. #define SIOCX25SFACILITIES (SIOCPROTOPRIVATE + 3)
  19. #define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4)
  20. #define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5)
  21. #define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6)
  22. #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7)
  23. #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8)
  24. #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9)
  25. #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10)
  26. #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11)
  27. #define SIOCX25SCAUSEDIAG (SIOCPROTOPRIVATE + 12)
  28. /*
  29. * Values for {get,set}sockopt.
  30. */
  31. #define X25_QBITINCL 1
  32. /*
  33. * X.25 Packet Size values.
  34. */
  35. #define X25_PS16 4
  36. #define X25_PS32 5
  37. #define X25_PS64 6
  38. #define X25_PS128 7
  39. #define X25_PS256 8
  40. #define X25_PS512 9
  41. #define X25_PS1024 10
  42. #define X25_PS2048 11
  43. #define X25_PS4096 12
  44. /*
  45. * An X.121 address, it is held as ASCII text, null terminated, up to 15
  46. * digits and a null terminator.
  47. */
  48. struct x25_address {
  49. char x25_addr[16];
  50. };
  51. /*
  52. * Linux X.25 Address structure, used for bind, and connect mostly.
  53. */
  54. struct sockaddr_x25 {
  55. __kernel_sa_family_t sx25_family; /* Must be AF_X25 */
  56. struct x25_address sx25_addr; /* X.121 Address */
  57. };
  58. /*
  59. * DTE/DCE subscription options.
  60. *
  61. * As this is missing lots of options, user should expect major
  62. * changes of this structure in 2.5.x which might break compatibilty.
  63. * The somewhat ugly dimension 200-sizeof() is needed to maintain
  64. * backward compatibility.
  65. */
  66. struct x25_subscrip_struct {
  67. char device[200-sizeof(unsigned long)];
  68. unsigned long global_facil_mask; /* 0 to disable negotiation */
  69. unsigned int extended;
  70. };
  71. /* values for above global_facil_mask */
  72. #define X25_MASK_REVERSE 0x01
  73. #define X25_MASK_THROUGHPUT 0x02
  74. #define X25_MASK_PACKET_SIZE 0x04
  75. #define X25_MASK_WINDOW_SIZE 0x08
  76. #define X25_MASK_CALLING_AE 0x10
  77. #define X25_MASK_CALLED_AE 0x20
  78. /*
  79. * Routing table control structure.
  80. */
  81. struct x25_route_struct {
  82. struct x25_address address;
  83. unsigned int sigdigits;
  84. char device[200];
  85. };
  86. /*
  87. * Facilities structure.
  88. */
  89. struct x25_facilities {
  90. unsigned int winsize_in, winsize_out;
  91. unsigned int pacsize_in, pacsize_out;
  92. unsigned int throughput;
  93. unsigned int reverse;
  94. };
  95. /*
  96. * ITU DTE facilities
  97. * Only the called and calling address
  98. * extension are currently implemented.
  99. * The rest are in place to avoid the struct
  100. * changing size if someone needs them later
  101. */
  102. struct x25_dte_facilities {
  103. __u16 delay_cumul;
  104. __u16 delay_target;
  105. __u16 delay_max;
  106. __u8 min_throughput;
  107. __u8 expedited;
  108. __u8 calling_len;
  109. __u8 called_len;
  110. __u8 calling_ae[20];
  111. __u8 called_ae[20];
  112. };
  113. /*
  114. * Call User Data structure.
  115. */
  116. struct x25_calluserdata {
  117. unsigned int cudlength;
  118. unsigned char cuddata[128];
  119. };
  120. /*
  121. * Call clearing Cause and Diagnostic structure.
  122. */
  123. struct x25_causediag {
  124. unsigned char cause;
  125. unsigned char diagnostic;
  126. };
  127. /*
  128. * Further optional call user data match length selection
  129. */
  130. struct x25_subaddr {
  131. unsigned int cudmatchlength;
  132. };
  133. #endif