rose.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * These are the public elements of the Linux kernel Rose implementation.
  3. * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
  4. * definition of the ax25_address structure.
  5. */
  6. #ifndef ROSE_KERNEL_H
  7. #define ROSE_KERNEL_H
  8. #include <linux/ax25.h>
  9. #define ROSE_MTU 251
  10. #define ROSE_MAX_DIGIS 6
  11. #define ROSE_DEFER 1
  12. #define ROSE_T1 2
  13. #define ROSE_T2 3
  14. #define ROSE_T3 4
  15. #define ROSE_IDLE 5
  16. #define ROSE_QBITINCL 6
  17. #define ROSE_HOLDBACK 7
  18. #define SIOCRSGCAUSE (SIOCPROTOPRIVATE+0)
  19. #define SIOCRSSCAUSE (SIOCPROTOPRIVATE+1)
  20. #define SIOCRSL2CALL (SIOCPROTOPRIVATE+2)
  21. #define SIOCRSSL2CALL (SIOCPROTOPRIVATE+2)
  22. #define SIOCRSACCEPT (SIOCPROTOPRIVATE+3)
  23. #define SIOCRSCLRRT (SIOCPROTOPRIVATE+4)
  24. #define SIOCRSGL2CALL (SIOCPROTOPRIVATE+5)
  25. #define SIOCRSGFACILITIES (SIOCPROTOPRIVATE+6)
  26. #define ROSE_DTE_ORIGINATED 0x00
  27. #define ROSE_NUMBER_BUSY 0x01
  28. #define ROSE_INVALID_FACILITY 0x03
  29. #define ROSE_NETWORK_CONGESTION 0x05
  30. #define ROSE_OUT_OF_ORDER 0x09
  31. #define ROSE_ACCESS_BARRED 0x0B
  32. #define ROSE_NOT_OBTAINABLE 0x0D
  33. #define ROSE_REMOTE_PROCEDURE 0x11
  34. #define ROSE_LOCAL_PROCEDURE 0x13
  35. #define ROSE_SHIP_ABSENT 0x39
  36. typedef struct {
  37. char rose_addr[5];
  38. } rose_address;
  39. struct sockaddr_rose {
  40. sa_family_t srose_family;
  41. rose_address srose_addr;
  42. ax25_address srose_call;
  43. int srose_ndigis;
  44. ax25_address srose_digi;
  45. };
  46. struct full_sockaddr_rose {
  47. sa_family_t srose_family;
  48. rose_address srose_addr;
  49. ax25_address srose_call;
  50. unsigned int srose_ndigis;
  51. ax25_address srose_digis[ROSE_MAX_DIGIS];
  52. };
  53. struct rose_route_struct {
  54. rose_address address;
  55. unsigned short mask;
  56. ax25_address neighbour;
  57. char device[16];
  58. unsigned char ndigis;
  59. ax25_address digipeaters[AX25_MAX_DIGIS];
  60. };
  61. struct rose_cause_struct {
  62. unsigned char cause;
  63. unsigned char diagnostic;
  64. };
  65. struct rose_facilities_struct {
  66. rose_address source_addr, dest_addr;
  67. ax25_address source_call, dest_call;
  68. unsigned char source_ndigis, dest_ndigis;
  69. ax25_address source_digis[ROSE_MAX_DIGIS];
  70. ax25_address dest_digis[ROSE_MAX_DIGIS];
  71. unsigned int rand;
  72. rose_address fail_addr;
  73. ax25_address fail_call;
  74. };
  75. #endif