37 #include <linux/types.h>
40 #include <linux/export.h>
44 static const struct snmp_mib sctp_snmp_list[] = {
81 static int sctp_snmp_seq_show(
struct seq_file *seq,
void *
v)
86 for (i = 0; sctp_snmp_list[
i].
name !=
NULL; i++)
89 sctp_snmp_list[i].
entry));
102 .open = sctp_snmp_seq_open,
113 p = proc_create(
"snmp",
S_IRUGO, net->sctp.proc_net_sctp,
114 &sctp_snmp_seq_fops);
137 asoc = sctp_assoc(epb);
138 peer = asoc->
peer.primary_path;
139 primary = &peer->
saddr;
145 if (primary && af->
cmp_addr(addr, primary)) {
159 primary = &assoc->
peer.primary_addr;
162 addr = &transport->
ipaddr;
171 static void * sctp_eps_seq_start(
struct seq_file *seq, loff_t *
pos)
180 seq_printf(seq,
" ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS\n");
185 static void sctp_eps_seq_stop(
struct seq_file *seq,
void *v)
190 static void * sctp_eps_seq_next(
struct seq_file *seq,
void *v, loff_t *pos)
200 static int sctp_eps_seq_show(
struct seq_file *seq,
void *v)
207 int hash = *(loff_t *)v;
218 if (!net_eq(sock_net(sk), seq_file_net(seq)))
220 seq_printf(seq,
"%8pK %8pK %-3d %-3d %-4d %-5d %5d %5lu ", ep, sk,
221 sctp_sk(sk)->
type, sk->sk_state, hash,
226 sctp_seq_dump_local_addrs(seq, epb);
236 .start = sctp_eps_seq_start,
237 .next = sctp_eps_seq_next,
238 .stop = sctp_eps_seq_stop,
239 .show = sctp_eps_seq_show,
251 .open = sctp_eps_seq_open,
262 p = proc_create(
"eps",
S_IRUGO, net->sctp.proc_net_sctp,
277 static void * sctp_assocs_seq_start(
struct seq_file *seq, loff_t *pos)
286 seq_printf(seq,
" ASSOC SOCK STY SST ST HBKT "
287 "ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT "
288 "RPORT LADDRS <-> RADDRS "
289 "HBINT INS OUTS MAXRT T1X T2X RTXC\n");
294 static void sctp_assocs_seq_stop(
struct seq_file *seq,
void *v)
299 static void * sctp_assocs_seq_next(
struct seq_file *seq,
void *v, loff_t *pos)
308 static int sctp_assocs_seq_show(
struct seq_file *seq,
void *v)
315 int hash = *(loff_t *)v;
324 assoc = sctp_assoc(epb);
326 if (!net_eq(sock_net(sk), seq_file_net(seq)))
329 "%8pK %8pK %-3d %-3d %-2d %-4d "
330 "%4d %8d %8d %7d %5lu %-5d %5d ",
331 assoc, sk, sctp_sk(sk)->
type, sk->sk_state,
341 sctp_seq_dump_local_addrs(seq, epb);
343 sctp_seq_dump_remote_addrs(seq, assoc);
344 seq_printf(seq,
"\t%8lu %5d %5d %4d %4d %4d %8d ",
358 .start = sctp_assocs_seq_start,
359 .next = sctp_assocs_seq_next,
360 .stop = sctp_assocs_seq_stop,
361 .show = sctp_assocs_seq_show,
365 static int sctp_assocs_seq_open(
struct inode *inode,
struct file *file)
372 .open = sctp_assocs_seq_open,
383 p = proc_create(
"assocs",
S_IRUGO, net->sctp.proc_net_sctp,
384 &sctp_assocs_seq_fops);
397 static void *sctp_remaddr_seq_start(
struct seq_file *seq, loff_t *pos)
406 seq_printf(seq,
"ADDR ASSOC_ID HB_ACT RTO MAX_PATH_RTX "
407 "REM_ADDR_RTX START\n");
412 static void *sctp_remaddr_seq_next(
struct seq_file *seq,
void *v, loff_t *pos)
420 static void sctp_remaddr_seq_stop(
struct seq_file *seq,
void *v)
424 static int sctp_remaddr_seq_show(
struct seq_file *seq,
void *v)
431 int hash = *(loff_t *)v;
440 if (!net_eq(sock_net(epb->
sk), seq_file_net(seq)))
442 assoc = sctp_assoc(epb);
498 .start = sctp_remaddr_seq_start,
499 .next = sctp_remaddr_seq_next,
500 .stop = sctp_remaddr_seq_stop,
501 .show = sctp_remaddr_seq_show,
510 static int sctp_remaddr_seq_open(
struct inode *inode,
struct file *file)
517 .open = sctp_remaddr_seq_open,
527 p = proc_create(
"remaddr",
S_IRUGO, net->sctp.proc_net_sctp,
528 &sctp_remaddr_seq_fops);