x25.h 3.4 KB

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