16 #include <linux/kernel.h>
18 #include <linux/errno.h>
20 #include <linux/export.h>
34 static struct sock *llc_get_sk_idx(loff_t
pos)
40 list_for_each_entry_rcu(sap, &llc_sap_list,
node) {
59 static void *llc_seq_start(
struct seq_file *seq, loff_t *pos)
67 static struct sock *laddr_hash_next(
struct llc_sap *sap,
int bucket)
88 sk = llc_get_sk_idx(0);
92 next = sk_nulls_next(sk);
99 sk = laddr_hash_next(sap, llc_sk_laddr_hashfn(sap, &llc->
laddr));
103 list_for_each_entry_continue_rcu(sap, &llc_sap_list, node) {
105 sk = laddr_hash_next(sap, -1);
114 static void llc_seq_stop(
struct seq_file *seq,
void *v)
123 rcu_read_unlock_bh();
126 static int llc_seq_socket_show(
struct seq_file *seq,
void *v)
132 seq_puts(seq,
"SKt Mc local_mac_sap remote_mac_sap "
133 " tx_queue rx_queue st uid link\n");
143 llc_ui_format_mac(seq, llc->
dev->dev_addr);
145 u8 addr[6] = {0,0,0,0,0,0};
146 llc_ui_format_mac(seq, addr);
149 llc_ui_format_mac(seq, llc->
daddr.mac);
151 sk_wmem_alloc_get(sk),
160 static const char *
const llc_conn_state_names[] = {
175 static int llc_seq_core_show(
struct seq_file *seq,
void *v)
182 "dsap state retr txw rxw pf ff sf df rs cs "
183 "tack tpfc trs tbs blog busr\n");
189 seq_printf(seq,
" %02X %-10s %3d %3d %3d %2d %2d %2d %2d %2d %2d "
190 "%4d %4d %3d %3d %4d %4d\n",
191 llc->
daddr.lsap, llc_conn_state_names[llc->
state],
204 .start = llc_seq_start,
205 .next = llc_seq_next,
206 .stop = llc_seq_stop,
207 .show = llc_seq_socket_show,
211 .start = llc_seq_start,
212 .next = llc_seq_next,
213 .stop = llc_seq_stop,
214 .show = llc_seq_core_show,
219 return seq_open(file, &llc_seq_socket_ops);
224 return seq_open(file, &llc_seq_core_ops);
229 .open = llc_seq_socket_open,
237 .open = llc_seq_core_open,
254 p = proc_create(
"socket",
S_IRUGO, llc_proc_dir, &llc_seq_socket_fops);
258 p = proc_create(
"core",
S_IRUGO, llc_proc_dir, &llc_seq_core_fops);