summaryrefslogtreecommitdiffstats
path: root/include/linux/ax25.h
blob: f316c99607ddfd5b7e83b5b60e5247de6ea3dad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/*
 * These are the public elements of the Linux kernel AX.25 code. A similar
 * file netrom.h exists for the NET/ROM protocol.
 */

#ifndef	AX25_KERNEL_H
#define	AX25_KERNEL_H

#define AX25_NEW_DEVIF  1

#define AX25_MTU	256
#define AX25_MAX_DIGIS	8

#define AX25_WINDOW	1
#define AX25_T1		2
#define AX25_N2		3
#define AX25_T3		4
#define AX25_T2		5
#define	AX25_BACKOFF	6
#define	AX25_EXTSEQ	7
#define	AX25_PIDINCL	8
#define AX25_IDLE	9
#define AX25_PACLEN	10
#define AX25_IAMDIGI	12

#define AX25_KILL	99

#define SIOCAX25GETUID		(SIOCPROTOPRIVATE+0)
#define SIOCAX25ADDUID		(SIOCPROTOPRIVATE+1)
#define SIOCAX25DELUID		(SIOCPROTOPRIVATE+2)
#define SIOCAX25NOUID		(SIOCPROTOPRIVATE+3)
#define SIOCAX25OPTRT		(SIOCPROTOPRIVATE+7)
#define SIOCAX25CTLCON		(SIOCPROTOPRIVATE+8)
#define SIOCAX25GETINFOOLD	(SIOCPROTOPRIVATE+9)
#define SIOCAX25ADDFWD		(SIOCPROTOPRIVATE+10)
#define SIOCAX25DELFWD		(SIOCPROTOPRIVATE+11)
#define SIOCAX25DEVCTL          (SIOCPROTOPRIVATE+12)
#define SIOCAX25GETINFO         (SIOCPROTOPRIVATE+13)

#define AX25_SET_DEV_BITRATE    0
#define AX25_SET_DEV_MODE       1

#define AX25_SET_RT_IPMODE	2

#define AX25_NOUID_DEFAULT	0
#define AX25_NOUID_BLOCK	1

typedef struct {
	char		ax25_call[7];	/* 6 call + SSID (shifted ascii!) */
} ax25_address;

struct sockaddr_ax25 {
	sa_family_t	sax25_family;
	ax25_address	sax25_call;
	int		sax25_ndigis;
	/* Digipeater ax25_address sets follow */
};

#define sax25_uid	sax25_ndigis

struct full_sockaddr_ax25 {
	struct sockaddr_ax25 fsa_ax25;
	ax25_address	fsa_digipeater[AX25_MAX_DIGIS];
};

#define fsax25_family fsa_ax25.sax25_family
#define fsax25_call   fsa_ax25.sax25_call
#define fsax25_ndigis fsa_ax25.sax25_ndigis

typedef struct {
	ax25_address            addr;
	ax25_address            digipeater[AX25_MAX_DIGIS];;
	unsigned char           dcount;
} ax25_path_t;

typedef struct {
	ax25_address            dest;
	ax25_address            src;
	ax25_address            digipeater[AX25_MAX_DIGIS];
	unsigned char           dcount;
	char                    lastrepeat;
} ax25_addr_t;

struct ax25_rtmsg {
	char            port_name[32];
	unsigned int    mode;
	ax25_addr_t     addr;
};

struct ax25_armsg {
	char            port_name[32];
	unsigned int    ip_addr;
	ax25_address    ax_addr;
};

struct ax25_pathmsg {
	char            port_name[32];
	unsigned int    mode;
	ax25_path_t     path;
};

struct ax25_nlmsg {

#define AX25_MSG_RTINFO 0
#define AX25_MSG_ARINFO 1
#define AX25_MSG_SETRT  2
#define AX25_MSG_DELRT  3
#define AX25_MSG_OPTRT  4
	unsigned int msg_type;

	union {
		unsigned char raw[128-sizeof(unsigned int)];
		struct ax25_rtmsg rtmsg;
		struct ax25_armsg armsg;
		struct ax25_pathmsg pathmsg;
	} msg;
};

struct ax25_routes_struct {
	ax25_address	port_addr;
	ax25_address	dest_addr;
	unsigned char	digi_count;
	ax25_address	digi_addr[AX25_MAX_DIGIS];
};

struct ax25_route_opt_struct {
	ax25_address	port_addr;
	ax25_address	dest_addr;
	int		cmd;
	int		arg;
};

struct ax25_ctl_struct {
	ax25_address	port_addr;
	ax25_address	source_addr;
	ax25_address	dest_addr;
	unsigned int	cmd;
	unsigned long	arg;
};

/* this will go away. Please do not export to user land */
struct ax25_info_struct_depreciated {
	unsigned int	n2, n2count;
	unsigned int	t1, t1timer;
	unsigned int	t2, t2timer;
	unsigned int	t3, t3timer;
	unsigned int	idle, idletimer;
	unsigned int	state;
	unsigned int	rcv_q, snd_q;
};

struct ax25_info_struct {
	unsigned int	n2, n2count;
	unsigned int	t1, t1timer;
	unsigned int	t2, t2timer;
	unsigned int	t3, t3timer;
	unsigned int	idle, idletimer;
	unsigned int	state;
	unsigned int	rcv_q, snd_q;
	unsigned int	vs, vr, va, vs_max;
	unsigned int	paclen;
	unsigned int	window;
};

struct ax25_fwd_struct {
	ax25_address	port_from;
	ax25_address	port_to;
};

#endif