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