x25.h 2.8 KB

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