xref: /openbmc/linux/include/uapi/linux/rose.h (revision 6f52b16c)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  * These are the public elements of the Linux kernel Rose implementation.
4607ca46eSDavid Howells  * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
5607ca46eSDavid Howells  * definition of the ax25_address structure.
6607ca46eSDavid Howells  */
7607ca46eSDavid Howells 
8607ca46eSDavid Howells #ifndef	ROSE_KERNEL_H
9607ca46eSDavid Howells #define	ROSE_KERNEL_H
10607ca46eSDavid Howells 
11607ca46eSDavid Howells #include <linux/socket.h>
12607ca46eSDavid Howells #include <linux/ax25.h>
13607ca46eSDavid Howells 
14607ca46eSDavid Howells #define ROSE_MTU	251
15607ca46eSDavid Howells 
16607ca46eSDavid Howells #define ROSE_MAX_DIGIS 6
17607ca46eSDavid Howells 
18607ca46eSDavid Howells #define	ROSE_DEFER	1
19607ca46eSDavid Howells #define ROSE_T1		2
20607ca46eSDavid Howells #define	ROSE_T2		3
21607ca46eSDavid Howells #define	ROSE_T3		4
22607ca46eSDavid Howells #define	ROSE_IDLE	5
23607ca46eSDavid Howells #define	ROSE_QBITINCL	6
24607ca46eSDavid Howells #define	ROSE_HOLDBACK	7
25607ca46eSDavid Howells 
26607ca46eSDavid Howells #define	SIOCRSGCAUSE		(SIOCPROTOPRIVATE+0)
27607ca46eSDavid Howells #define	SIOCRSSCAUSE		(SIOCPROTOPRIVATE+1)
28607ca46eSDavid Howells #define	SIOCRSL2CALL		(SIOCPROTOPRIVATE+2)
29607ca46eSDavid Howells #define	SIOCRSSL2CALL		(SIOCPROTOPRIVATE+2)
30607ca46eSDavid Howells #define	SIOCRSACCEPT		(SIOCPROTOPRIVATE+3)
31607ca46eSDavid Howells #define	SIOCRSCLRRT		(SIOCPROTOPRIVATE+4)
32607ca46eSDavid Howells #define	SIOCRSGL2CALL		(SIOCPROTOPRIVATE+5)
33607ca46eSDavid Howells #define	SIOCRSGFACILITIES	(SIOCPROTOPRIVATE+6)
34607ca46eSDavid Howells 
35607ca46eSDavid Howells #define	ROSE_DTE_ORIGINATED	0x00
36607ca46eSDavid Howells #define	ROSE_NUMBER_BUSY	0x01
37607ca46eSDavid Howells #define	ROSE_INVALID_FACILITY	0x03
38607ca46eSDavid Howells #define	ROSE_NETWORK_CONGESTION	0x05
39607ca46eSDavid Howells #define	ROSE_OUT_OF_ORDER	0x09
40607ca46eSDavid Howells #define	ROSE_ACCESS_BARRED	0x0B
41607ca46eSDavid Howells #define	ROSE_NOT_OBTAINABLE	0x0D
42607ca46eSDavid Howells #define	ROSE_REMOTE_PROCEDURE	0x11
43607ca46eSDavid Howells #define	ROSE_LOCAL_PROCEDURE	0x13
44607ca46eSDavid Howells #define	ROSE_SHIP_ABSENT	0x39
45607ca46eSDavid Howells 
46607ca46eSDavid Howells typedef struct {
47607ca46eSDavid Howells 	char		rose_addr[5];
48607ca46eSDavid Howells } rose_address;
49607ca46eSDavid Howells 
50607ca46eSDavid Howells struct sockaddr_rose {
51607ca46eSDavid Howells 	__kernel_sa_family_t srose_family;
52607ca46eSDavid Howells 	rose_address	srose_addr;
53607ca46eSDavid Howells 	ax25_address	srose_call;
54607ca46eSDavid Howells 	int		srose_ndigis;
55607ca46eSDavid Howells 	ax25_address	srose_digi;
56607ca46eSDavid Howells };
57607ca46eSDavid Howells 
58607ca46eSDavid Howells struct full_sockaddr_rose {
59607ca46eSDavid Howells 	__kernel_sa_family_t srose_family;
60607ca46eSDavid Howells 	rose_address	srose_addr;
61607ca46eSDavid Howells 	ax25_address	srose_call;
62607ca46eSDavid Howells 	unsigned int	srose_ndigis;
63607ca46eSDavid Howells 	ax25_address	srose_digis[ROSE_MAX_DIGIS];
64607ca46eSDavid Howells };
65607ca46eSDavid Howells 
66607ca46eSDavid Howells struct rose_route_struct {
67607ca46eSDavid Howells 	rose_address	address;
68607ca46eSDavid Howells 	unsigned short	mask;
69607ca46eSDavid Howells 	ax25_address	neighbour;
70607ca46eSDavid Howells 	char		device[16];
71607ca46eSDavid Howells 	unsigned char	ndigis;
72607ca46eSDavid Howells 	ax25_address	digipeaters[AX25_MAX_DIGIS];
73607ca46eSDavid Howells };
74607ca46eSDavid Howells 
75607ca46eSDavid Howells struct rose_cause_struct {
76607ca46eSDavid Howells 	unsigned char	cause;
77607ca46eSDavid Howells 	unsigned char	diagnostic;
78607ca46eSDavid Howells };
79607ca46eSDavid Howells 
80607ca46eSDavid Howells struct rose_facilities_struct {
81607ca46eSDavid Howells 	rose_address	source_addr,   dest_addr;
82607ca46eSDavid Howells 	ax25_address	source_call,   dest_call;
83607ca46eSDavid Howells 	unsigned char	source_ndigis, dest_ndigis;
84607ca46eSDavid Howells 	ax25_address	source_digis[ROSE_MAX_DIGIS];
85607ca46eSDavid Howells 	ax25_address	dest_digis[ROSE_MAX_DIGIS];
86607ca46eSDavid Howells 	unsigned int	rand;
87607ca46eSDavid Howells 	rose_address	fail_addr;
88607ca46eSDavid Howells 	ax25_address	fail_call;
89607ca46eSDavid Howells };
90607ca46eSDavid Howells 
91607ca46eSDavid Howells #endif
92