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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * These are the public elements of the Linux kernel AX.25 code. A similar
  3.  * file netrom.h exists for the NET/ROM protocol.
  4.  */
  5. #ifndef AX25_KERNEL_H
  6. #define AX25_KERNEL_H
  7. #define AX25_MTU 256
  8. #define AX25_MAX_DIGIS  8
  9. #define AX25_WINDOW 1
  10. #define AX25_T1 2
  11. #define AX25_N2 3
  12. #define AX25_T3 4
  13. #define AX25_T2 5
  14. #define AX25_BACKOFF 6
  15. #define AX25_EXTSEQ 7
  16. #define AX25_PIDINCL 8
  17. #define AX25_IDLE 9
  18. #define AX25_PACLEN 10
  19. #define AX25_IAMDIGI 12
  20. #define AX25_KILL 99
  21. #define SIOCAX25GETUID (SIOCPROTOPRIVATE+0)
  22. #define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1)
  23. #define SIOCAX25DELUID (SIOCPROTOPRIVATE+2)
  24. #define SIOCAX25NOUID (SIOCPROTOPRIVATE+3)
  25. #define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7)
  26. #define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8)
  27. #define SIOCAX25GETINFOOLD (SIOCPROTOPRIVATE+9)
  28. #define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10)
  29. #define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11)
  30. #define SIOCAX25DEVCTL          (SIOCPROTOPRIVATE+12)
  31. #define SIOCAX25GETINFO         (SIOCPROTOPRIVATE+13)
  32. #define AX25_SET_RT_IPMODE 2
  33. #define AX25_NOUID_DEFAULT 0
  34. #define AX25_NOUID_BLOCK 1
  35. typedef struct {
  36. char ax25_call[7]; /* 6 call + SSID (shifted ascii!) */
  37. } ax25_address;
  38. struct sockaddr_ax25 {
  39. sa_family_t sax25_family;
  40. ax25_address sax25_call;
  41. int sax25_ndigis;
  42. /* Digipeater ax25_address sets follow */
  43. };
  44. #define sax25_uid sax25_ndigis
  45. struct full_sockaddr_ax25 {
  46. struct sockaddr_ax25 fsa_ax25;
  47. ax25_address fsa_digipeater[AX25_MAX_DIGIS];
  48. };
  49. struct ax25_routes_struct {
  50. ax25_address port_addr;
  51. ax25_address dest_addr;
  52. unsigned char digi_count;
  53. ax25_address digi_addr[AX25_MAX_DIGIS];
  54. };
  55. struct ax25_route_opt_struct {
  56. ax25_address port_addr;
  57. ax25_address dest_addr;
  58. int cmd;
  59. int arg;
  60. };
  61. struct ax25_ctl_struct {
  62.         ax25_address            port_addr;
  63.         ax25_address            source_addr;
  64.         ax25_address            dest_addr;
  65.         unsigned int            cmd;
  66.         unsigned long           arg;
  67.         unsigned char           digi_count;
  68.         ax25_address            digi_addr[AX25_MAX_DIGIS];
  69. };
  70. /* this will go away. Please do not export to user land */
  71. struct ax25_info_struct_depreciated {
  72. unsigned int n2, n2count;
  73. unsigned int t1, t1timer;
  74. unsigned int t2, t2timer;
  75. unsigned int t3, t3timer;
  76. unsigned int idle, idletimer;
  77. unsigned int state;
  78. unsigned int rcv_q, snd_q;
  79. };
  80. struct ax25_info_struct {
  81. unsigned int n2, n2count;
  82. unsigned int t1, t1timer;
  83. unsigned int t2, t2timer;
  84. unsigned int t3, t3timer;
  85. unsigned int idle, idletimer;
  86. unsigned int state;
  87. unsigned int rcv_q, snd_q;
  88. unsigned int vs, vr, va, vs_max;
  89. unsigned int paclen;
  90. unsigned int window;
  91. };
  92. struct ax25_fwd_struct {
  93. ax25_address port_from;
  94. ax25_address port_to;
  95. };
  96. #endif