ax25.h 2.8 KB

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