x25.h 3.3 KB

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