15 #include <linux/capability.h>
16 #include <linux/errno.h>
17 #include <linux/types.h>
18 #include <linux/socket.h>
21 #include <linux/kernel.h>
22 #include <linux/sched.h>
23 #include <linux/string.h>
25 #include <linux/net.h>
26 #include <linux/slab.h>
29 #include <linux/netdevice.h>
30 #include <linux/if_arp.h>
34 #include <asm/uaccess.h>
35 #include <linux/fcntl.h>
40 #include <linux/export.h>
50 ax25_rt = ax25_route_list;
51 while (ax25_rt !=
NULL) {
53 ax25_rt = ax25_rt->
next;
56 if (ax25_route_list == s) {
57 ax25_route_list = s->
next;
61 for (t = ax25_route_list; t !=
NULL; t = t->
next) {
88 ax25_rt = ax25_route_list;
89 while (ax25_rt !=
NULL) {
91 ax25_rt->
dev == ax25_dev->
dev) {
109 ax25_rt = ax25_rt->
next;
119 ax25_rt->
dev = ax25_dev->
dev;
135 ax25_rt->
next = ax25_route_list;
136 ax25_route_list = ax25_rt;
158 ax25_rt = ax25_route_list;
159 while (ax25_rt !=
NULL) {
161 ax25_rt = ax25_rt->
next;
162 if (s->
dev == ax25_dev->
dev &&
164 if (ax25_route_list == s) {
165 ax25_route_list = s->
next;
168 for (t = ax25_route_list; t !=
NULL; t = t->
next) {
194 ax25_rt = ax25_route_list;
195 while (ax25_rt !=
NULL) {
196 if (ax25_rt->
dev == ax25_dev->
dev &&
198 switch (rt_option->
cmd) {
200 switch (rt_option->
arg) {
216 ax25_rt = ax25_rt->
next;
233 return ax25_rt_add(&route);
238 return ax25_rt_del(&route);
243 return ax25_rt_opt(&rt_option);
250 #ifdef CONFIG_PROC_FS
252 static void *ax25_rt_seq_start(
struct seq_file *seq, loff_t *
pos)
262 for (ax25_rt = ax25_route_list; ax25_rt !=
NULL; ax25_rt = ax25_rt->
next) {
271 static void *ax25_rt_seq_next(
struct seq_file *seq,
void *
v, loff_t *
pos)
278 static void ax25_rt_seq_stop(
struct seq_file *seq,
void *v)
284 static int ax25_rt_seq_show(
struct seq_file *seq,
void *v)
289 seq_puts(seq,
"callsign dev mode digipeaters\n");
296 callsign =
"default";
302 ax25_rt->
dev ? ax25_rt->
dev->name :
"???");
327 .
start = ax25_rt_seq_start,
328 .next = ax25_rt_seq_next,
329 .stop = ax25_rt_seq_stop,
330 .show = ax25_rt_seq_show,
335 return seq_open(file, &ax25_rt_seqops);
340 .open = ax25_rt_info_open,
364 for (ax25_rt = ax25_route_list; ax25_rt !=
NULL; ax25_rt = ax25_rt->
next) {
367 ax25_spe_rt = ax25_rt;
369 ax25_def_rt = ax25_rt;
372 ax25_spe_rt = ax25_rt;
374 ax25_def_rt = ax25_rt;
378 ax25_rt = ax25_def_rt;
379 if (ax25_spe_rt !=
NULL)
380 ax25_rt = ax25_spe_rt;
383 ax25_hold_route(ax25_rt);
399 for (k = 0; k < digipeat->
ndigi; k++) {
444 ax25_adjust_path(addr, ax25->
digipeat);
454 ax25_put_route(ax25_rt);
468 if (skb_headroom(skb) < len) {
475 skb_set_owner_w(skbn, skb->
sk);
497 while (ax25_rt !=
NULL) {
499 ax25_rt = ax25_rt->
next;