x25.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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