rose.h 2.1 KB

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