ax25.h 2.7 KB

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