rose.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* Definitions for Rose packet radio address family.
  2. Copyright (C) 1998-2016 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. <http://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. /* Socket level values. */
  19. #define SOL_ROSE 260
  20. /* These are the public elements of the Linux kernel Rose
  21. implementation. For kernel AX.25 see the file ax25.h. This file
  22. requires ax25.h for the definition of the ax25_address structure. */
  23. #define ROSE_MTU 251
  24. #define ROSE_MAX_DIGIS 6
  25. #define ROSE_DEFER 1
  26. #define ROSE_T1 2
  27. #define ROSE_T2 3
  28. #define ROSE_T3 4
  29. #define ROSE_IDLE 5
  30. #define ROSE_QBITINCL 6
  31. #define ROSE_HOLDBACK 7
  32. #define SIOCRSGCAUSE (SIOCPROTOPRIVATE + 0)
  33. #define SIOCRSSCAUSE (SIOCPROTOPRIVATE + 1)
  34. #define SIOCRSL2CALL (SIOCPROTOPRIVATE + 2)
  35. #define SIOCRSSL2CALL (SIOCPROTOPRIVATE + 2)
  36. #define SIOCRSACCEPT (SIOCPROTOPRIVATE + 3)
  37. #define SIOCRSCLRRT (SIOCPROTOPRIVATE + 4)
  38. #define SIOCRSGL2CALL (SIOCPROTOPRIVATE + 5)
  39. #define SIOCRSGFACILITIES (SIOCPROTOPRIVATE + 6)
  40. #define ROSE_DTE_ORIGINATED 0x00
  41. #define ROSE_NUMBER_BUSY 0x01
  42. #define ROSE_INVALID_FACILITY 0x03
  43. #define ROSE_NETWORK_CONGESTION 0x05
  44. #define ROSE_OUT_OF_ORDER 0x09
  45. #define ROSE_ACCESS_BARRED 0x0B
  46. #define ROSE_NOT_OBTAINABLE 0x0D
  47. #define ROSE_REMOTE_PROCEDURE 0x11
  48. #define ROSE_LOCAL_PROCEDURE 0x13
  49. #define ROSE_SHIP_ABSENT 0x39
  50. typedef struct
  51. {
  52. char rose_addr[5];
  53. } rose_address;
  54. struct sockaddr_rose
  55. {
  56. sa_family_t srose_family;
  57. rose_address srose_addr;
  58. ax25_address srose_call;
  59. int srose_ndigis;
  60. ax25_address srose_digi;
  61. };
  62. struct full_sockaddr_rose
  63. {
  64. sa_family_t srose_family;
  65. rose_address srose_addr;
  66. ax25_address srose_call;
  67. unsigned int srose_ndigis;
  68. ax25_address srose_digis[ROSE_MAX_DIGIS];
  69. };
  70. struct rose_route_struct
  71. {
  72. rose_address address;
  73. unsigned short int mask;
  74. ax25_address neighbour;
  75. char device[16];
  76. unsigned char ndigis;
  77. ax25_address digipeaters[AX25_MAX_DIGIS];
  78. };
  79. struct rose_cause_struct
  80. {
  81. unsigned char cause;
  82. unsigned char diagnostic;
  83. };
  84. struct rose_facilities_struct
  85. {
  86. rose_address source_addr, dest_addr;
  87. ax25_address source_call, dest_call;
  88. unsigned char source_ndigis, dest_ndigis;
  89. ax25_address source_digis[ROSE_MAX_DIGIS];
  90. ax25_address dest_digis[ROSE_MAX_DIGIS];
  91. unsigned int rand;
  92. rose_address fail_addr;
  93. ax25_address fail_call;
  94. };
  95. #endif /* netrose/rose.h */