rose.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /* Definitions for Rose packet radio address family.
  2. Copyright (C) 1998-2020 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. /* What follows is copied from the 2.1.93 <linux/rose.h>. */
  16. #ifndef _NETROSE_ROSE_H
  17. #define _NETROSE_ROSE_H 1
  18. #include <sys/socket.h>
  19. #include <netax25/ax25.h>
  20. /* Socket level values. */
  21. #define SOL_ROSE 260
  22. /* These are the public elements of the Linux kernel Rose
  23. implementation. For kernel AX.25 see the file ax25.h. This file
  24. requires ax25.h for the definition of the ax25_address structure. */
  25. #define ROSE_MTU 251
  26. #define ROSE_MAX_DIGIS 6
  27. #define ROSE_DEFER 1
  28. #define ROSE_T1 2
  29. #define ROSE_T2 3
  30. #define ROSE_T3 4
  31. #define ROSE_IDLE 5
  32. #define ROSE_QBITINCL 6
  33. #define ROSE_HOLDBACK 7
  34. #define SIOCRSGCAUSE (SIOCPROTOPRIVATE + 0)
  35. #define SIOCRSSCAUSE (SIOCPROTOPRIVATE + 1)
  36. #define SIOCRSL2CALL (SIOCPROTOPRIVATE + 2)
  37. #define SIOCRSSL2CALL (SIOCPROTOPRIVATE + 2)
  38. #define SIOCRSACCEPT (SIOCPROTOPRIVATE + 3)
  39. #define SIOCRSCLRRT (SIOCPROTOPRIVATE + 4)
  40. #define SIOCRSGL2CALL (SIOCPROTOPRIVATE + 5)
  41. #define SIOCRSGFACILITIES (SIOCPROTOPRIVATE + 6)
  42. #define ROSE_DTE_ORIGINATED 0x00
  43. #define ROSE_NUMBER_BUSY 0x01
  44. #define ROSE_INVALID_FACILITY 0x03
  45. #define ROSE_NETWORK_CONGESTION 0x05
  46. #define ROSE_OUT_OF_ORDER 0x09
  47. #define ROSE_ACCESS_BARRED 0x0B
  48. #define ROSE_NOT_OBTAINABLE 0x0D
  49. #define ROSE_REMOTE_PROCEDURE 0x11
  50. #define ROSE_LOCAL_PROCEDURE 0x13
  51. #define ROSE_SHIP_ABSENT 0x39
  52. typedef struct
  53. {
  54. char rose_addr[5];
  55. } rose_address;
  56. struct sockaddr_rose
  57. {
  58. sa_family_t srose_family;
  59. rose_address srose_addr;
  60. ax25_address srose_call;
  61. int srose_ndigis;
  62. ax25_address srose_digi;
  63. };
  64. struct full_sockaddr_rose
  65. {
  66. sa_family_t srose_family;
  67. rose_address srose_addr;
  68. ax25_address srose_call;
  69. unsigned int srose_ndigis;
  70. ax25_address srose_digis[ROSE_MAX_DIGIS];
  71. };
  72. struct rose_route_struct
  73. {
  74. rose_address address;
  75. unsigned short int mask;
  76. ax25_address neighbour;
  77. char device[16];
  78. unsigned char ndigis;
  79. ax25_address digipeaters[AX25_MAX_DIGIS];
  80. };
  81. struct rose_cause_struct
  82. {
  83. unsigned char cause;
  84. unsigned char diagnostic;
  85. };
  86. struct rose_facilities_struct
  87. {
  88. rose_address source_addr, dest_addr;
  89. ax25_address source_call, dest_call;
  90. unsigned char source_ndigis, dest_ndigis;
  91. ax25_address source_digis[ROSE_MAX_DIGIS];
  92. ax25_address dest_digis[ROSE_MAX_DIGIS];
  93. unsigned int rand;
  94. rose_address fail_addr;
  95. ax25_address fail_call;
  96. };
  97. #endif /* netrose/rose.h */