Lines Matching +full:com +full:- +full:seq

1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * lksctp developers <linux-sctp@vger.kernel.org>
12 * Sridhar Samudrala <sri@us.ibm.com>
59 static int sctp_snmp_seq_show(struct seq_file *seq, void *v) in sctp_snmp_seq_show() argument
62 struct net *net = seq->private; in sctp_snmp_seq_show()
68 net->sctp.sctp_statistics); in sctp_snmp_seq_show()
70 seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name, in sctp_snmp_seq_show()
77 static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb) in sctp_seq_dump_local_addrs() argument
85 if (epb->type == SCTP_EP_TYPE_ASSOCIATION) { in sctp_seq_dump_local_addrs()
88 peer = asoc->peer.primary_path; in sctp_seq_dump_local_addrs()
94 primary = &peer->saddr; in sctp_seq_dump_local_addrs()
98 list_for_each_entry_rcu(laddr, &epb->bind_addr.address_list, list) { in sctp_seq_dump_local_addrs()
99 if (!laddr->valid) in sctp_seq_dump_local_addrs()
102 addr = &laddr->a; in sctp_seq_dump_local_addrs()
103 af = sctp_get_af_specific(addr->sa.sa_family); in sctp_seq_dump_local_addrs()
104 if (primary && af->cmp_addr(addr, primary)) { in sctp_seq_dump_local_addrs()
105 seq_printf(seq, "*"); in sctp_seq_dump_local_addrs()
107 af->seq_dump_addr(seq, addr); in sctp_seq_dump_local_addrs()
113 static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_association *assoc) in sctp_seq_dump_remote_addrs() argument
119 primary = &assoc->peer.primary_addr; in sctp_seq_dump_remote_addrs()
120 list_for_each_entry_rcu(transport, &assoc->peer.transport_addr_list, in sctp_seq_dump_remote_addrs()
122 addr = &transport->ipaddr; in sctp_seq_dump_remote_addrs()
124 af = sctp_get_af_specific(addr->sa.sa_family); in sctp_seq_dump_remote_addrs()
125 if (af->cmp_addr(addr, primary)) { in sctp_seq_dump_remote_addrs()
126 seq_printf(seq, "*"); in sctp_seq_dump_remote_addrs()
128 af->seq_dump_addr(seq, addr); in sctp_seq_dump_remote_addrs()
132 static void *sctp_eps_seq_start(struct seq_file *seq, loff_t *pos) in sctp_eps_seq_start() argument
141 seq_printf(seq, " ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS\n"); in sctp_eps_seq_start()
146 static void sctp_eps_seq_stop(struct seq_file *seq, void *v) in sctp_eps_seq_stop() argument
151 static void *sctp_eps_seq_next(struct seq_file *seq, void *v, loff_t *pos) in sctp_eps_seq_next() argument
161 static int sctp_eps_seq_show(struct seq_file *seq, void *v) in sctp_eps_seq_show() argument
169 return -ENOMEM; in sctp_eps_seq_show()
172 read_lock_bh(&head->lock); in sctp_eps_seq_show()
173 sctp_for_each_hentry(ep, &head->chain) { in sctp_eps_seq_show()
174 sk = ep->base.sk; in sctp_eps_seq_show()
175 if (!net_eq(sock_net(sk), seq_file_net(seq))) in sctp_eps_seq_show()
177 seq_printf(seq, "%8pK %8pK %-3d %-3d %-4d %-5d %5u %5lu ", ep, sk, in sctp_eps_seq_show()
178 sctp_sk(sk)->type, sk->sk_state, hash, in sctp_eps_seq_show()
179 ep->base.bind_addr.port, in sctp_eps_seq_show()
180 from_kuid_munged(seq_user_ns(seq), sock_i_uid(sk)), in sctp_eps_seq_show()
183 sctp_seq_dump_local_addrs(seq, &ep->base); in sctp_eps_seq_show()
184 seq_printf(seq, "\n"); in sctp_eps_seq_show()
186 read_unlock_bh(&head->lock); in sctp_eps_seq_show()
203 static void *sctp_transport_seq_start(struct seq_file *seq, loff_t *pos) in sctp_transport_seq_start() argument
205 struct sctp_ht_iter *iter = seq->private; in sctp_transport_seq_start()
207 sctp_transport_walk_start(&iter->hti); in sctp_transport_seq_start()
209 return sctp_transport_get_idx(seq_file_net(seq), &iter->hti, *pos); in sctp_transport_seq_start()
212 static void sctp_transport_seq_stop(struct seq_file *seq, void *v) in sctp_transport_seq_stop() argument
214 struct sctp_ht_iter *iter = seq->private; in sctp_transport_seq_stop()
222 sctp_transport_walk_stop(&iter->hti); in sctp_transport_seq_stop()
225 static void *sctp_transport_seq_next(struct seq_file *seq, void *v, loff_t *pos) in sctp_transport_seq_next() argument
227 struct sctp_ht_iter *iter = seq->private; in sctp_transport_seq_next()
237 return sctp_transport_get_next(seq_file_net(seq), &iter->hti); in sctp_transport_seq_next()
241 static int sctp_assocs_seq_show(struct seq_file *seq, void *v) in sctp_assocs_seq_show() argument
249 seq_printf(seq, " ASSOC SOCK STY SST ST HBKT " in sctp_assocs_seq_show()
250 "ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT " in sctp_assocs_seq_show()
251 "RPORT LADDRS <-> RADDRS " in sctp_assocs_seq_show()
258 assoc = transport->asoc; in sctp_assocs_seq_show()
259 epb = &assoc->base; in sctp_assocs_seq_show()
260 sk = epb->sk; in sctp_assocs_seq_show()
262 seq_printf(seq, in sctp_assocs_seq_show()
263 "%8pK %8pK %-3d %-3d %-2d %-4d " in sctp_assocs_seq_show()
264 "%4d %8d %8d %7u %5lu %-5d %5d ", in sctp_assocs_seq_show()
265 assoc, sk, sctp_sk(sk)->type, sk->sk_state, in sctp_assocs_seq_show()
266 assoc->state, 0, in sctp_assocs_seq_show()
267 assoc->assoc_id, in sctp_assocs_seq_show()
268 assoc->sndbuf_used, in sctp_assocs_seq_show()
269 atomic_read(&assoc->rmem_alloc), in sctp_assocs_seq_show()
270 from_kuid_munged(seq_user_ns(seq), sock_i_uid(sk)), in sctp_assocs_seq_show()
272 epb->bind_addr.port, in sctp_assocs_seq_show()
273 assoc->peer.port); in sctp_assocs_seq_show()
274 seq_printf(seq, " "); in sctp_assocs_seq_show()
275 sctp_seq_dump_local_addrs(seq, epb); in sctp_assocs_seq_show()
276 seq_printf(seq, "<-> "); in sctp_assocs_seq_show()
277 sctp_seq_dump_remote_addrs(seq, assoc); in sctp_assocs_seq_show()
278 seq_printf(seq, "\t%8lu %5d %5d %4d %4d %4d %8d " in sctp_assocs_seq_show()
280 assoc->hbinterval, assoc->stream.incnt, in sctp_assocs_seq_show()
281 assoc->stream.outcnt, assoc->max_retrans, in sctp_assocs_seq_show()
282 assoc->init_retries, assoc->shutdown_retries, in sctp_assocs_seq_show()
283 assoc->rtx_data_chunks, in sctp_assocs_seq_show()
284 refcount_read(&sk->sk_wmem_alloc), in sctp_assocs_seq_show()
285 READ_ONCE(sk->sk_wmem_queued), in sctp_assocs_seq_show()
286 sk->sk_sndbuf, in sctp_assocs_seq_show()
287 sk->sk_rcvbuf); in sctp_assocs_seq_show()
288 seq_printf(seq, "\n"); in sctp_assocs_seq_show()
300 static int sctp_remaddr_seq_show(struct seq_file *seq, void *v) in sctp_remaddr_seq_show() argument
306 seq_printf(seq, "ADDR ASSOC_ID HB_ACT RTO MAX_PATH_RTX " in sctp_remaddr_seq_show()
312 assoc = transport->asoc; in sctp_remaddr_seq_show()
314 list_for_each_entry_rcu(tsp, &assoc->peer.transport_addr_list, in sctp_remaddr_seq_show()
319 tsp->af_specific->seq_dump_addr(seq, &tsp->ipaddr); in sctp_remaddr_seq_show()
320 seq_printf(seq, " "); in sctp_remaddr_seq_show()
324 seq_printf(seq, "%d ", tsp->asoc->assoc_id); in sctp_remaddr_seq_show()
330 seq_printf(seq, "%d ", timer_pending(&tsp->hb_timer)); in sctp_remaddr_seq_show()
335 seq_printf(seq, "%lu ", tsp->rto); in sctp_remaddr_seq_show()
340 seq_printf(seq, "%d ", tsp->pathmaxrxt); in sctp_remaddr_seq_show()
347 seq_puts(seq, "0 "); in sctp_remaddr_seq_show()
354 seq_puts(seq, "0 "); in sctp_remaddr_seq_show()
360 seq_printf(seq, "%d", tsp->state); in sctp_remaddr_seq_show()
362 seq_printf(seq, "\n"); in sctp_remaddr_seq_show()
378 net->sctp.proc_net_sctp = proc_net_mkdir(net, "sctp", net->proc_net); in sctp_proc_init()
379 if (!net->sctp.proc_net_sctp) in sctp_proc_init()
380 return -ENOMEM; in sctp_proc_init()
381 if (!proc_create_net_single("snmp", 0444, net->sctp.proc_net_sctp, in sctp_proc_init()
384 if (!proc_create_net("eps", 0444, net->sctp.proc_net_sctp, in sctp_proc_init()
387 if (!proc_create_net("assocs", 0444, net->sctp.proc_net_sctp, in sctp_proc_init()
390 if (!proc_create_net("remaddr", 0444, net->sctp.proc_net_sctp, in sctp_proc_init()
396 remove_proc_subtree("sctp", net->proc_net); in sctp_proc_init()
397 net->sctp.proc_net_sctp = NULL; in sctp_proc_init()
398 return -ENOMEM; in sctp_proc_init()