1/*
2 * These are the public elements of the Linux kernel AX.25 code. A similar
3 * file netrom.h exists for the NET/ROM protocol.
4 */
5
6#ifndef	AX25_KERNEL_H
7#define	AX25_KERNEL_H
8
9#define AX25_MTU	256
10#define AX25_MAX_DIGIS  8
11
12#define AX25_WINDOW	1
13#define AX25_T1		2
14#define AX25_N2		3
15#define AX25_T3		4
16#define AX25_T2		5
17#define	AX25_BACKOFF	6
18#define	AX25_EXTSEQ	7
19#define	AX25_PIDINCL	8
20#define AX25_IDLE	9
21#define AX25_PACLEN	10
22#define AX25_IAMDIGI	12
23
24#define AX25_KILL	99
25
26#define SIOCAX25GETUID		(SIOCPROTOPRIVATE+0)
27#define SIOCAX25ADDUID		(SIOCPROTOPRIVATE+1)
28#define SIOCAX25DELUID		(SIOCPROTOPRIVATE+2)
29#define SIOCAX25NOUID		(SIOCPROTOPRIVATE+3)
30#define SIOCAX25OPTRT		(SIOCPROTOPRIVATE+7)
31#define SIOCAX25CTLCON		(SIOCPROTOPRIVATE+8)
32#define SIOCAX25GETINFOOLD	(SIOCPROTOPRIVATE+9)
33#define SIOCAX25ADDFWD		(SIOCPROTOPRIVATE+10)
34#define SIOCAX25DELFWD		(SIOCPROTOPRIVATE+11)
35#define SIOCAX25DEVCTL          (SIOCPROTOPRIVATE+12)
36#define SIOCAX25GETINFO         (SIOCPROTOPRIVATE+13)
37
38#define AX25_SET_RT_IPMODE	2
39
40#define AX25_NOUID_DEFAULT	0
41#define AX25_NOUID_BLOCK	1
42
43typedef struct {
44	char		ax25_call[7];	/* 6 call + SSID (shifted ascii!) */
45} ax25_address;
46
47struct sockaddr_ax25 {
48	sa_family_t	sax25_family;
49	ax25_address	sax25_call;
50	int		sax25_ndigis;
51	/* Digipeater ax25_address sets follow */
52};
53
54#define sax25_uid	sax25_ndigis
55
56struct full_sockaddr_ax25 {
57	struct sockaddr_ax25 fsa_ax25;
58	ax25_address	fsa_digipeater[AX25_MAX_DIGIS];
59};
60
61struct ax25_routes_struct {
62	ax25_address	port_addr;
63	ax25_address	dest_addr;
64	unsigned char	digi_count;
65	ax25_address	digi_addr[AX25_MAX_DIGIS];
66};
67
68struct ax25_route_opt_struct {
69	ax25_address	port_addr;
70	ax25_address	dest_addr;
71	int		cmd;
72	int		arg;
73};
74
75struct ax25_ctl_struct {
76        ax25_address            port_addr;
77        ax25_address            source_addr;
78        ax25_address            dest_addr;
79        unsigned int            cmd;
80        unsigned long           arg;
81        unsigned char           digi_count;
82        ax25_address            digi_addr[AX25_MAX_DIGIS];
83};
84
85/* this will go away. Please do not export to user land */
86struct ax25_info_struct_depreciated {
87	unsigned int	n2, n2count;
88	unsigned int	t1, t1timer;
89	unsigned int	t2, t2timer;
90	unsigned int	t3, t3timer;
91	unsigned int	idle, idletimer;
92	unsigned int	state;
93	unsigned int	rcv_q, snd_q;
94};
95
96struct ax25_info_struct {
97	unsigned int	n2, n2count;
98	unsigned int	t1, t1timer;
99	unsigned int	t2, t2timer;
100	unsigned int	t3, t3timer;
101	unsigned int	idle, idletimer;
102	unsigned int	state;
103	unsigned int	rcv_q, snd_q;
104	unsigned int	vs, vr, va, vs_max;
105	unsigned int	paclen;
106	unsigned int	window;
107};
108
109struct ax25_fwd_struct {
110	ax25_address	port_from;
111	ax25_address	port_to;
112};
113
114#endif
115