23 #include <linux/export.h>
30 static void *x25_seq_route_start(
struct seq_file *seq, loff_t *
pos)
37 static void *x25_seq_route_next(
struct seq_file *seq,
void *
v, loff_t *
pos)
42 static void x25_seq_route_stop(
struct seq_file *seq,
void *
v)
48 static int x25_seq_route_show(
struct seq_file *seq,
void *
v)
52 if (v == &x25_route_list) {
53 seq_puts(seq,
"Address Digits Device\n");
60 rt->
dev ? rt->
dev->name :
"???");
65 static void *x25_seq_socket_start(
struct seq_file *seq, loff_t *
pos)
72 static void *x25_seq_socket_next(
struct seq_file *seq,
void *v, loff_t *
pos)
77 static void x25_seq_socket_stop(
struct seq_file *seq,
void *v)
83 static int x25_seq_socket_show(
struct seq_file *seq,
void *v)
91 seq_printf(seq,
"dest_addr src_addr dev lci st vs vr "
92 "va t t2 t21 t22 t23 Snd-Q Rcv-Q inode\n");
104 seq_printf(seq,
"%-10s %-10s %-5s %3.3X %d %d %d %d %3lu %3lu "
105 "%3lu %3lu %3lu %5d %5d %ld\n",
107 !x25->source_addr.x25_addr[0] ?
"*" : x25->source_addr.x25_addr,
108 devname, x25->
lci & 0x0FFF, x25->
state, x25->
vs, x25->
vr,
111 sk_wmem_alloc_get(s),
112 sk_rmem_alloc_get(s),
118 static void *x25_seq_forward_start(
struct seq_file *seq, loff_t *
pos)
125 static void *x25_seq_forward_next(
struct seq_file *seq,
void *v, loff_t *
pos)
130 static void x25_seq_forward_stop(
struct seq_file *seq,
void *v)
136 static int x25_seq_forward_show(
struct seq_file *seq,
void *v)
140 if (v == &x25_forward_list) {
154 .
start = x25_seq_route_start,
155 .next = x25_seq_route_next,
156 .stop = x25_seq_route_stop,
157 .show = x25_seq_route_show,
161 .
start = x25_seq_socket_start,
162 .next = x25_seq_socket_next,
163 .stop = x25_seq_socket_stop,
164 .show = x25_seq_socket_show,
168 .
start = x25_seq_forward_start,
169 .next = x25_seq_forward_next,
170 .stop = x25_seq_forward_stop,
171 .show = x25_seq_forward_show,
176 return seq_open(file, &x25_seq_socket_ops);
181 return seq_open(file, &x25_seq_route_ops);
186 return seq_open(file, &x25_seq_forward_ops);
191 .open = x25_seq_socket_open,
199 .open = x25_seq_route_open,
207 .open = x25_seq_forward_open,
224 p = proc_create(
"route",
S_IRUGO, x25_proc_dir, &x25_seq_route_fops);
228 p = proc_create(
"socket",
S_IRUGO, x25_proc_dir, &x25_seq_socket_fops);
232 p = proc_create(
"forward",
S_IRUGO, x25_proc_dir,
233 &x25_seq_forward_fops);