rose.h 2.1 KB

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