-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME.ProcNetHandlers
More file actions
644 lines (590 loc) · 20.9 KB
/
README.ProcNetHandlers
File metadata and controls
644 lines (590 loc) · 20.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
#
# This document contains portions of Linux kernel source code, included
# to demonstrate how various "/proc" files are generated. That code,
# while not intended to be compiled/used as presented here, is distributed
# according to the terms of the following license.
#
# (C) 2014 Jim Jones <cnamejj@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
The module ProcNetHandlers.py contains code snippets from kernel source
as comments in each "handler" class where the relevant code sample is
less than 50 lines. For /proc files where the amount of source code
involved in generating the contents of the file is longer, the sample
code is document here instead.
--- File: /proc/net/ip_conntrack
source: net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
Excerpts from that code:
# if (seq_printf(s, "%-8s %u %ld ",
# l4proto->name, nf_ct_protonum(ct),
# timer_pending(&ct->timeout)
# ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0)
# goto release;
#
# if (l4proto->print_conntrack && l4proto->print_conntrack(s, ct))
# goto release;
#
# if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
# l3proto, l4proto))
# goto release;
#
# if (seq_print_acct(s, ct, IP_CT_DIR_ORIGINAL))
# goto release;
#
# if (!(test_bit(IPS_SEEN_REPLY_BIT, &ct->status)))
# if (seq_printf(s, "[UNREPLIED] "))
# goto release;
#
# if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_REPLY].tuple,
# l3proto, l4proto))
# goto release;
#
# if (seq_print_acct(s, ct, IP_CT_DIR_REPLY))
# goto release;
#
# if (test_bit(IPS_ASSURED_BIT, &ct->status))
# if (seq_printf(s, "[ASSURED] "))
# goto release;
#
# #ifdef CONFIG_NF_CONNTRACK_MARK
# if (seq_printf(s, "mark=%u ", ct->mark))
# goto release;
# #endif
#
# if (ct_show_secctx(s, ct))
# goto release;
#
# if (seq_printf(s, "use=%u\n", atomic_read(&ct->ct_general.use)))
#
# ------------
# -- from seq_print_acct()
# return seq_printf(s, "packets=%llu bytes=%llu ",
# (unsigned long long)acct[dir].packets,
# (unsigned long long)acct[dir].bytes);
#
# ------------
# -- from ct_show_secctx()
# ret = seq_printf(s, "secctx=%s ", secctx);
--- File: /proc/net/nf_conntrack
source: net/netfilter/nf_conntrack_standalone.c
Excerpts from that code:
# if (seq_printf(s, "%-8s %u %-8s %u %ld ",
# l3proto->name, nf_ct_l3num(ct),
# l4proto->name, nf_ct_protonum(ct),
# timer_pending(&ct->timeout)
# ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0)
# goto release;
#
# if (l4proto->print_conntrack && l4proto->print_conntrack(s, ct))
# goto release;
#
# if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
# l3proto, l4proto))
# goto release;
#
# if (seq_print_acct(s, ct, IP_CT_DIR_ORIGINAL))
# goto release;
#
# if (!(test_bit(IPS_SEEN_REPLY_BIT, &ct->status)))
# if (seq_printf(s, "[UNREPLIED] "))
# goto release;
#
# if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_REPLY].tuple,
# l3proto, l4proto))
# goto release;
#
# if (seq_print_acct(s, ct, IP_CT_DIR_REPLY))
# goto release;
#
# if (test_bit(IPS_ASSURED_BIT, &ct->status))
# if (seq_printf(s, "[ASSURED] "))
# goto release;
#
# #if defined(CONFIG_NF_CONNTRACK_MARK)
# if (seq_printf(s, "mark=%u ", ct->mark))
# goto release;
# #endif
#
# if (ct_show_secctx(s, ct))
# goto release;
#
# #ifdef CONFIG_NF_CONNTRACK_ZONES
# if (seq_printf(s, "zone=%u ", nf_ct_zone(ct)))
# goto release;
# #endif
#
# if (ct_show_delta_time(s, ct))
# goto release;
#
# if (seq_printf(s, "use=%u\n", atomic_read(&ct->ct_general.use)))
# goto release;
#
# ------------
# -- from ct_show_delta_time()
# return seq_printf(s, "delta-time=%llu ",
# (unsigned long long)delta_time);
#
# ------------
# -- from seq_print_acct()
# return seq_printf(s, "packets=%llu bytes=%llu ",
# (unsigned long long)acct[dir].packets,
# (unsigned long long)acct[dir].bytes);
#
# ------------
# -- from ct_show_secctx()
# ret = seq_printf(s, "secctx=%s ", secctx);
--- File: /proc/net/snmp
source: net/ipv4/proc.c
Excerpts from that code:
#... from icmpmsg_put()
# for (i = 0; i < ICMPMSG_MIB_MAX; i++) {
# val = snmp_fold_field((void __percpu **) net->mib.icmpmsg_statistics, i);
# if (val) {
# type[count] = i;
# vals[count++] = val;
# }
# if (count == PERLINE) {
# icmpmsg_put_line(seq, vals, type, count);
# count = 0;
# }
# }
# icmpmsg_put_line(seq, vals, type, count);
#
#
#
#... from icmp_put()
# seq_puts(seq, "\nIcmp: InMsgs InErrors");
# for (i=0; icmpmibmap[i].name != NULL; i++)
# seq_printf(seq, " In%s", icmpmibmap[i].name);
# seq_printf(seq, " OutMsgs OutErrors");
# for (i=0; icmpmibmap[i].name != NULL; i++)
# seq_printf(seq, " Out%s", icmpmibmap[i].name);
# seq_printf(seq, "\nIcmp: %lu %lu",
# snmp_fold_field((void __percpu **) net->mib.icmp_statistics, ICMP_MIB_INMSGS),
# snmp_fold_field((void __percpu **) net->mib.icmp_statistics, ICMP_MIB_INERRORS));
# for (i=0; icmpmibmap[i].name != NULL; i++)
# seq_printf(seq, " %lu",
# snmp_fold_field((void __percpu **) net->mib.icmpmsg_statistics,
# icmpmibmap[i].index));
# seq_printf(seq, " %lu %lu",
# snmp_fold_field((void __percpu **) net->mib.icmp_statistics, ICMP_MIB_OUTMSGS),
# snmp_fold_field((void __percpu **) net->mib.icmp_statistics, ICMP_MIB_OUTERRORS));
# for (i=0; icmpmibmap[i].name != NULL; i++)
# seq_printf(seq, " %lu",
# snmp_fold_field((void __percpu **) net->mib.icmpmsg_statistics,
# icmpmibmap[i].index | 0x100));
#
#
#
#...from snmp_seq_show()
# seq_puts(seq, "Ip: Forwarding DefaultTTL");
#
# for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
# seq_printf(seq, " %s", snmp4_ipstats_list[i].name);
#
# seq_printf(seq, "\nIp: %d %d",
# IPV4_DEVCONF_ALL(net, FORWARDING) ? 1 : 2,
# sysctl_ip_default_ttl);
#
# BUILD_BUG_ON(offsetof(struct ipstats_mib, mibs) != 0);
# for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
# seq_printf(seq, " %llu",
# snmp_fold_field64((void __percpu **)net->mib.ip_statistics,
# snmp4_ipstats_list[i].entry,
# offsetof(struct ipstats_mib, syncp)));
#
# icmp_put(seq); /* RFC 2011 compatibility */
# icmpmsg_put(seq);
#
# seq_puts(seq, "\nTcp:");
# for (i = 0; snmp4_tcp_list[i].name != NULL; i++)
# seq_printf(seq, " %s", snmp4_tcp_list[i].name);
#
# seq_puts(seq, "\nTcp:");
# for (i = 0; snmp4_tcp_list[i].name != NULL; i++) {
# /* MaxConn field is signed, RFC 2012 */
# if (snmp4_tcp_list[i].entry == TCP_MIB_MAXCONN)
# seq_printf(seq, " %ld",
# snmp_fold_field((void __percpu **)net->mib.tcp_statistics,
# snmp4_tcp_list[i].entry));
# else
# seq_printf(seq, " %lu",
# snmp_fold_field((void __percpu **)net->mib.tcp_statistics,
# snmp4_tcp_list[i].entry));
# }
#
# seq_puts(seq, "\nUdp:");
# for (i = 0; snmp4_udp_list[i].name != NULL; i++)
# seq_printf(seq, " %s", snmp4_udp_list[i].name);
#
# seq_puts(seq, "\nUdp:");
# for (i = 0; snmp4_udp_list[i].name != NULL; i++)
# seq_printf(seq, " %lu",
# snmp_fold_field((void __percpu **)net->mib.udp_statistics,
# snmp4_udp_list[i].entry));
#
# /* the UDP and UDP-Lite MIBs are the same */
# seq_puts(seq, "\nUdpLite:");
# for (i = 0; snmp4_udp_list[i].name != NULL; i++)
# seq_printf(seq, " %s", snmp4_udp_list[i].name);
#
# seq_puts(seq, "\nUdpLite:");
# for (i = 0; snmp4_udp_list[i].name != NULL; i++)
# seq_printf(seq, " %lu",
# snmp_fold_field((void __percpu **)net->mib.udplite_statistics,
# snmp4_udp_list[i].entry));
#
# seq_putc(seq, '\n');
--- File: /proc/net/fib_trie
source: net/ipv4/fib_trie.c
Excerpts from that code:
# static void fib_table_print(struct seq_file *seq, struct fib_table *tb)
# {
# if (tb->tb_id == RT_TABLE_LOCAL)
# seq_puts(seq, "Local:\n");
# else if (tb->tb_id == RT_TABLE_MAIN)
# seq_puts(seq, "Main:\n");
# else
# seq_printf(seq, "Id %d:\n", tb->tb_id);
# }
#
#
# /* Pretty print the trie */
# static int fib_trie_seq_show(struct seq_file *seq, void *v)
# {
# const struct fib_trie_iter *iter = seq->private;
# struct rt_trie_node *n = v;
#
# if (!node_parent_rcu(n))
# fib_table_print(seq, iter->tb);
#
# if (IS_TNODE(n)) {
# struct tnode *tn = (struct tnode *) n;
# __be32 prf = htonl(mask_pfx(tn->key, tn->pos));
#
# seq_indent(seq, iter->depth-1);
# seq_printf(seq, " +-- %pI4/%d %d %d %d\n",
# &prf, tn->pos, tn->bits, tn->full_children,
# tn->empty_children);
#
# } else {
# struct leaf *l = (struct leaf *) n;
# struct leaf_info *li;
# struct hlist_node *node;
# __be32 val = htonl(l->key);
#
# seq_indent(seq, iter->depth);
# seq_printf(seq, " |-- %pI4\n", &val);
#
# hlist_for_each_entry_rcu(li, node, &l->list, hlist) {
# struct fib_alias *fa;
#
# list_for_each_entry_rcu(fa, &li->falh, fa_list) {
# char buf1[32], buf2[32];
#
# seq_indent(seq, iter->depth+1);
# seq_printf(seq, " /%d %s %s", li->plen,
# rtn_scope(buf1, sizeof(buf1),
# fa->fa_info->fib_scope),
# rtn_type(buf2, sizeof(buf2),
# fa->fa_type));
# if (fa->fa_tos)
# seq_printf(seq, " tos=%d", fa->fa_tos);
# seq_putc(seq, '\n');
# }
# }
# }
#
# return 0;
# }
--- File: /proc/net/fib_triestat
source: net/ipv4/fib_trie.c
Excerpts from that code:
# static int fib_triestat_seq_show(struct seq_file *seq, void *v)
# {
# struct net *net = (struct net *)seq->private;
# unsigned int h;
#
# seq_printf(seq,
# "Basic info: size of leaf:"
# " %Zd bytes, size of tnode: %Zd bytes.\n",
# sizeof(struct leaf), sizeof(struct tnode));
#
# for (h = 0; h < FIB_TABLE_HASHSZ; h++) {
# struct hlist_head *head = &net->ipv4.fib_table_hash[h];
# struct hlist_node *node;
# struct fib_table *tb;
#
# hlist_for_each_entry_rcu(tb, node, head, tb_hlist) {
# struct trie *t = (struct trie *) tb->tb_data;
# struct trie_stat stat;
#
# if (!t)
# continue;
#
# fib_table_print(seq, tb);
#
# trie_collect_stats(t, &stat);
# trie_show_stats(seq, &stat);
# #ifdef CONFIG_IP_FIB_TRIE_STATS
# trie_show_usage(seq, &t->stats);
# #endif
# }
# }
#
# return 0;
# }
#
#
# static void fib_table_print(struct seq_file *seq, struct fib_table *tb)
# {
# if (tb->tb_id == RT_TABLE_LOCAL)
# seq_puts(seq, "Local:\n");
# else if (tb->tb_id == RT_TABLE_MAIN)
# seq_puts(seq, "Main:\n");
# else
# seq_printf(seq, "Id %d:\n", tb->tb_id);
# }
#
#
# static void trie_show_stats(struct seq_file *seq, struct trie_stat *stat)
# {
# unsigned int i, max, pointers, bytes, avdepth;
#
# if (stat->leaves)
# avdepth = stat->totdepth*100 / stat->leaves;
# else
# avdepth = 0;
#
# seq_printf(seq, "\tAver depth: %u.%02d\n",
# avdepth / 100, avdepth % 100);
# seq_printf(seq, "\tMax depth: %u\n", stat->maxdepth);
#
# seq_printf(seq, "\tLeaves: %u\n", stat->leaves);
# bytes = sizeof(struct leaf) * stat->leaves;
#
# seq_printf(seq, "\tPrefixes: %u\n", stat->prefixes);
# bytes += sizeof(struct leaf_info) * stat->prefixes;
#
# seq_printf(seq, "\tInternal nodes: %u\n\t", stat->tnodes);
# bytes += sizeof(struct tnode) * stat->tnodes;
#
# max = MAX_STAT_DEPTH;
# while (max > 0 && stat->nodesizes[max-1] == 0)
# max--;
#
# pointers = 0;
# for (i = 1; i <= max; i++)
# if (stat->nodesizes[i] != 0) {
# seq_printf(seq, " %u: %u", i, stat->nodesizes[i]);
# pointers += (1<<i) * stat->nodesizes[i];
# }
# seq_putc(seq, '\n');
# seq_printf(seq, "\tPointers: %u\n", pointers);
#
# bytes += sizeof(struct rt_trie_node *) * pointers;
# seq_printf(seq, "Null ptrs: %u\n", stat->nullpointers);
# seq_printf(seq, "Total size: %u kB\n", (bytes + 1023) / 1024);
# }
#
#
# static void trie_show_usage(struct seq_file *seq,
# const struct trie_use_stats *stats)
# {
# seq_printf(seq, "\nCounters:\n---------\n");
# seq_printf(seq, "gets = %u\n", stats->gets);
# seq_printf(seq, "backtracks = %u\n", stats->backtrack);
# seq_printf(seq, "semantic match passed = %u\n",
# stats->semantic_match_passed);
# seq_printf(seq, "semantic match miss = %u\n",
# stats->semantic_match_miss);
# seq_printf(seq, "null node hit= %u\n", stats->null_node_hit);
# seq_printf(seq, "skipped node resize = %u\n\n",
# stats->resize_node_skipped);
# }
--- Files: /proc/net/{ bnep | l2cap | hci | sco }
They all use a the same "bluetooth info" file format.
source: net/bluetooth/af_bluetooth.c
Excerpts from that code:
Note: In the kernel code I reviewed, every place where this routine is called,
"custom_seq_show" is NULL. So the callout in the code below which could result
in extra data appended to the standard record format is not current a concern.
# if (v == SEQ_START_TOKEN) {
# seq_puts(seq ,"sk RefCnt Rmem Wmem User Inode Src Dst Parent");
#
# if (l->custom_seq_show) {
# seq_putc(seq, ' ');
# l->custom_seq_show(seq, v);
# }
#
# seq_putc(seq, '\n');
# } else {
# struct sock *sk = sk_entry(v);
# struct bt_sock *bt = bt_sk(sk);
#
# seq_printf(seq,
# "%pK %-6d %-6u %-6u %-6u %-6lu %pMR %pMR %-6lu",
# sk,
# atomic_read(&sk->sk_refcnt),
# sk_rmem_alloc_get(sk),
# sk_wmem_alloc_get(sk),
# from_kuid(seq_user_ns(seq), sock_i_uid(sk)),
# sock_i_ino(sk),
# &bt->src,
# &bt->dst,
# bt->parent? sock_i_ino(bt->parent): 0LU);
#
# if (l->custom_seq_show) {
# seq_putc(seq, ' ');
# l->custom_seq_show(seq, v);
# }
#
# seq_putc(seq, '\n');
# }
--- File: /proc/net/pnp
source: net/ipv4/ipconfig.c
Excerpts from that code:
# static int pnp_seq_show(struct seq_file *seq, void *v)
# {
# int i;
#
# if (ic_proto_used & IC_PROTO)
# seq_printf(seq, "#PROTO: %s\n",
# (ic_proto_used & IC_RARP) ? "RARP"
# : (ic_proto_used & IC_USE_DHCP) ? "DHCP" : "BOOTP");
# else
# seq_puts(seq, "#MANUAL\n");
#
# if (ic_domain[0])
# seq_printf(seq,
# "domain %s\n", ic_domain);
# for (i = 0; i < CONF_NAMESERVERS_MAX; i++) {
# if (ic_nameservers[i] != NONE)
# seq_printf(seq, "nameserver %pI4\n",
# &ic_nameservers[i]);
# }
# if (ic_servaddr != NONE)
# seq_printf(seq, "bootserver %pI4\n",
# &ic_servaddr);
# return 0;
# }
--- File: /proc/net/pnp
source: net/ipv6/raw.c
--and--
source: net/ipv6/datagram.c
--and--
source: include/net/transp_v6.h
Excerpts from that code:
# from: net/ipv6/raw.c
# ---
#
# static int raw6_seq_show(struct seq_file *seq, void *v)
# {
# if (v == SEQ_START_TOKEN) {
# seq_puts(seq, IPV6_SEQ_DGRAM_HEADER);
# } else {
# struct sock *sp = v;
# __u16 srcp = inet_sk(sp)->inet_num;
# ip6_dgram_sock_seq_show(seq, v, srcp, 0,
# raw_seq_private(seq)->bucket);
# }
# return 0;
# }
#
#
# from: net/ipv6/datagram.c
# ---
#
# void ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp,
# __u16 srcp, __u16 destp, int bucket)
# {
# const struct in6_addr *dest, *src;
#
# dest = &sp->sk_v6_daddr;
# src = &sp->sk_v6_rcv_saddr;
# seq_printf(seq,
# "%5d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
# "%02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %d\n",
# bucket,
# src->s6_addr32[0], src->s6_addr32[1],
# src->s6_addr32[2], src->s6_addr32[3], srcp,
# dest->s6_addr32[0], dest->s6_addr32[1],
# dest->s6_addr32[2], dest->s6_addr32[3], destp,
# sp->sk_state,
# sk_wmem_alloc_get(sp),
# sk_rmem_alloc_get(sp),
# 0, 0L, 0,
# from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)),
# 0,
# sock_i_ino(sp),
# atomic_read(&sp->sk_refcnt), sp,
# atomic_read(&sp->sk_drops));
# }
#
#
# from: include/net/transp_v6.h
# ---
#
# #define IPV6_SEQ_DGRAM_HEADER \
# " sl " \
# "local_address " \
# "remote_address " \
# "st tx_queue rx_queue tr tm->when retrnsmt" \
# " uid timeout inode ref pointer drops\n"
--- File: /proc/net/xfrm_stat
source: net/xfrm/xfrm_proc.c
Excerpts from that code:
# static const struct snmp_mib xfrm_mib_list[] = {
# SNMP_MIB_ITEM("XfrmInError", LINUX_MIB_XFRMINERROR),
# SNMP_MIB_ITEM("XfrmInBufferError", LINUX_MIB_XFRMINBUFFERERROR),
# SNMP_MIB_ITEM("XfrmInHdrError", LINUX_MIB_XFRMINHDRERROR),
# SNMP_MIB_ITEM("XfrmInNoStates", LINUX_MIB_XFRMINNOSTATES),
# SNMP_MIB_ITEM("XfrmInStateProtoError", LINUX_MIB_XFRMINSTATEPROTOERROR),
# SNMP_MIB_ITEM("XfrmInStateModeError", LINUX_MIB_XFRMINSTATEMODEERROR),
# SNMP_MIB_ITEM("XfrmInStateSeqError", LINUX_MIB_XFRMINSTATESEQERROR),
# SNMP_MIB_ITEM("XfrmInStateExpired", LINUX_MIB_XFRMINSTATEEXPIRED),
# SNMP_MIB_ITEM("XfrmInStateMismatch", LINUX_MIB_XFRMINSTATEMISMATCH),
# SNMP_MIB_ITEM("XfrmInStateInvalid", LINUX_MIB_XFRMINSTATEINVALID),
# SNMP_MIB_ITEM("XfrmInTmplMismatch", LINUX_MIB_XFRMINTMPLMISMATCH),
# SNMP_MIB_ITEM("XfrmInNoPols", LINUX_MIB_XFRMINNOPOLS),
# SNMP_MIB_ITEM("XfrmInPolBlock", LINUX_MIB_XFRMINPOLBLOCK),
# SNMP_MIB_ITEM("XfrmInPolError", LINUX_MIB_XFRMINPOLERROR),
# SNMP_MIB_ITEM("XfrmOutError", LINUX_MIB_XFRMOUTERROR),
# SNMP_MIB_ITEM("XfrmOutBundleGenError", LINUX_MIB_XFRMOUTBUNDLEGENERROR),
# SNMP_MIB_ITEM("XfrmOutBundleCheckError", LINUX_MIB_XFRMOUTBUNDLECHECKERROR),
# SNMP_MIB_ITEM("XfrmOutNoStates", LINUX_MIB_XFRMOUTNOSTATES),
# SNMP_MIB_ITEM("XfrmOutStateProtoError", LINUX_MIB_XFRMOUTSTATEPROTOERROR),
# SNMP_MIB_ITEM("XfrmOutStateModeError", LINUX_MIB_XFRMOUTSTATEMODEERROR),
# SNMP_MIB_ITEM("XfrmOutStateSeqError", LINUX_MIB_XFRMOUTSTATESEQERROR),
# SNMP_MIB_ITEM("XfrmOutStateExpired", LINUX_MIB_XFRMOUTSTATEEXPIRED),
# SNMP_MIB_ITEM("XfrmOutPolBlock", LINUX_MIB_XFRMOUTPOLBLOCK),
# SNMP_MIB_ITEM("XfrmOutPolDead", LINUX_MIB_XFRMOUTPOLDEAD),
# SNMP_MIB_ITEM("XfrmOutPolError", LINUX_MIB_XFRMOUTPOLERROR),
# SNMP_MIB_ITEM("XfrmFwdHdrError", LINUX_MIB_XFRMFWDHDRERROR),
# SNMP_MIB_ITEM("XfrmOutStateInvalid", LINUX_MIB_XFRMOUTSTATEINVALID),
# SNMP_MIB_ITEM("XfrmAcquireError", LINUX_MIB_XFRMACQUIREERROR),
# SNMP_MIB_SENTINEL
# };
#
# static int xfrm_statistics_seq_show(struct seq_file *seq, void *v)
# {
# struct net *net = seq->private;
# int i;
# for (i = 0; xfrm_mib_list[i].name; i++)
# seq_printf(seq, "%-24s\t%lu\n", xfrm_mib_list[i].name,
# snmp_fold_field(net->mib.xfrm_statistics,
# xfrm_mib_list[i].entry));
# return 0;
# }