]> arthur.barton.de Git - netdata.git/blob - src/proc_net_snmp6.c
replace strcmp() with strsame() and procfile improvements
[netdata.git] / src / proc_net_snmp6.c
1 #include "common.h"
2
3 #define RRD_TYPE_NET_SNMP6          "ipv6"
4
5 int do_proc_net_snmp6(int update_every, usec_t dt) {
6     (void)dt;
7
8     static procfile *ff = NULL;
9     static int initialized = 0;
10
11     static int do_ip_packets = -1, do_ip_fragsout = -1, do_ip_fragsin = -1, do_ip_errors = -1,
12         do_udplite_packets = -1, do_udplite_errors = -1,
13         do_udp_packets = -1, do_udp_errors = -1,
14         do_bandwidth = -1, do_mcast = -1, do_bcast = -1, do_mcast_p = -1,
15         do_icmp = -1, do_icmp_redir = -1, do_icmp_errors = -1, do_icmp_echos = -1, do_icmp_groupmemb = -1,
16         do_icmp_router = -1, do_icmp_neighbor = -1, do_icmp_mldv2 = -1, do_icmp_types = -1, do_ect = -1;
17
18     static uint32_t hash_Ip6InReceives = 0;
19
20     static uint32_t hash_Ip6InHdrErrors = 0;
21     static uint32_t hash_Ip6InTooBigErrors = 0;
22     static uint32_t hash_Ip6InNoRoutes = 0;
23     static uint32_t hash_Ip6InAddrErrors = 0;
24     static uint32_t hash_Ip6InUnknownProtos = 0;
25     static uint32_t hash_Ip6InTruncatedPkts = 0;
26     static uint32_t hash_Ip6InDiscards = 0;
27     static uint32_t hash_Ip6InDelivers = 0;
28
29     static uint32_t hash_Ip6OutForwDatagrams = 0;
30     static uint32_t hash_Ip6OutRequests = 0;
31     static uint32_t hash_Ip6OutDiscards = 0;
32     static uint32_t hash_Ip6OutNoRoutes = 0;
33
34     static uint32_t hash_Ip6ReasmTimeout = 0;
35     static uint32_t hash_Ip6ReasmReqds = 0;
36     static uint32_t hash_Ip6ReasmOKs = 0;
37     static uint32_t hash_Ip6ReasmFails = 0;
38
39     static uint32_t hash_Ip6FragOKs = 0;
40     static uint32_t hash_Ip6FragFails = 0;
41     static uint32_t hash_Ip6FragCreates = 0;
42
43     static uint32_t hash_Ip6InMcastPkts = 0;
44     static uint32_t hash_Ip6OutMcastPkts = 0;
45
46     static uint32_t hash_Ip6InOctets = 0;
47     static uint32_t hash_Ip6OutOctets = 0;
48
49     static uint32_t hash_Ip6InMcastOctets = 0;
50     static uint32_t hash_Ip6OutMcastOctets = 0;
51     static uint32_t hash_Ip6InBcastOctets = 0;
52     static uint32_t hash_Ip6OutBcastOctets = 0;
53
54     static uint32_t hash_Ip6InNoECTPkts = 0;
55     static uint32_t hash_Ip6InECT1Pkts = 0;
56     static uint32_t hash_Ip6InECT0Pkts = 0;
57     static uint32_t hash_Ip6InCEPkts = 0;
58
59     static uint32_t hash_Icmp6InMsgs = 0;
60     static uint32_t hash_Icmp6InErrors = 0;
61     static uint32_t hash_Icmp6OutMsgs = 0;
62     static uint32_t hash_Icmp6OutErrors = 0;
63     static uint32_t hash_Icmp6InCsumErrors = 0;
64     static uint32_t hash_Icmp6InDestUnreachs = 0;
65     static uint32_t hash_Icmp6InPktTooBigs = 0;
66     static uint32_t hash_Icmp6InTimeExcds = 0;
67     static uint32_t hash_Icmp6InParmProblems = 0;
68     static uint32_t hash_Icmp6InEchos = 0;
69     static uint32_t hash_Icmp6InEchoReplies = 0;
70     static uint32_t hash_Icmp6InGroupMembQueries = 0;
71     static uint32_t hash_Icmp6InGroupMembResponses = 0;
72     static uint32_t hash_Icmp6InGroupMembReductions = 0;
73     static uint32_t hash_Icmp6InRouterSolicits = 0;
74     static uint32_t hash_Icmp6InRouterAdvertisements = 0;
75     static uint32_t hash_Icmp6InNeighborSolicits = 0;
76     static uint32_t hash_Icmp6InNeighborAdvertisements = 0;
77     static uint32_t hash_Icmp6InRedirects = 0;
78     static uint32_t hash_Icmp6InMLDv2Reports = 0;
79     static uint32_t hash_Icmp6OutDestUnreachs = 0;
80     static uint32_t hash_Icmp6OutPktTooBigs = 0;
81     static uint32_t hash_Icmp6OutTimeExcds = 0;
82     static uint32_t hash_Icmp6OutParmProblems = 0;
83     static uint32_t hash_Icmp6OutEchos = 0;
84     static uint32_t hash_Icmp6OutEchoReplies = 0;
85     static uint32_t hash_Icmp6OutGroupMembQueries = 0;
86     static uint32_t hash_Icmp6OutGroupMembResponses = 0;
87     static uint32_t hash_Icmp6OutGroupMembReductions = 0;
88     static uint32_t hash_Icmp6OutRouterSolicits = 0;
89     static uint32_t hash_Icmp6OutRouterAdvertisements = 0;
90     static uint32_t hash_Icmp6OutNeighborSolicits = 0;
91     static uint32_t hash_Icmp6OutNeighborAdvertisements = 0;
92     static uint32_t hash_Icmp6OutRedirects = 0;
93     static uint32_t hash_Icmp6OutMLDv2Reports = 0;
94     static uint32_t hash_Icmp6InType1 = 0;
95     static uint32_t hash_Icmp6InType128 = 0;
96     static uint32_t hash_Icmp6InType129 = 0;
97     static uint32_t hash_Icmp6InType136 = 0;
98     static uint32_t hash_Icmp6OutType1 = 0;
99     static uint32_t hash_Icmp6OutType128 = 0;
100     static uint32_t hash_Icmp6OutType129 = 0;
101     static uint32_t hash_Icmp6OutType133 = 0;
102     static uint32_t hash_Icmp6OutType135 = 0;
103     static uint32_t hash_Icmp6OutType143 = 0;
104
105     static uint32_t hash_Udp6InDatagrams = 0;
106     static uint32_t hash_Udp6NoPorts = 0;
107     static uint32_t hash_Udp6InErrors = 0;
108     static uint32_t hash_Udp6OutDatagrams = 0;
109     static uint32_t hash_Udp6RcvbufErrors = 0;
110     static uint32_t hash_Udp6SndbufErrors = 0;
111     static uint32_t hash_Udp6InCsumErrors = 0;
112     static uint32_t hash_Udp6IgnoredMulti = 0;
113
114     static uint32_t hash_UdpLite6InDatagrams = 0;
115     static uint32_t hash_UdpLite6NoPorts = 0;
116     static uint32_t hash_UdpLite6InErrors = 0;
117     static uint32_t hash_UdpLite6OutDatagrams = 0;
118     static uint32_t hash_UdpLite6RcvbufErrors = 0;
119     static uint32_t hash_UdpLite6SndbufErrors = 0;
120     static uint32_t hash_UdpLite6InCsumErrors = 0;
121
122     if(unlikely(!initialized)) {
123         initialized = 1;
124
125         hash_Ip6InReceives = simple_hash("Ip6InReceives");
126         hash_Ip6InHdrErrors = simple_hash("Ip6InHdrErrors");
127         hash_Ip6InTooBigErrors = simple_hash("Ip6InTooBigErrors");
128         hash_Ip6InNoRoutes = simple_hash("Ip6InNoRoutes");
129         hash_Ip6InAddrErrors = simple_hash("Ip6InAddrErrors");
130         hash_Ip6InUnknownProtos = simple_hash("Ip6InUnknownProtos");
131         hash_Ip6InTruncatedPkts = simple_hash("Ip6InTruncatedPkts");
132         hash_Ip6InDiscards = simple_hash("Ip6InDiscards");
133         hash_Ip6InDelivers = simple_hash("Ip6InDelivers");
134         hash_Ip6OutForwDatagrams = simple_hash("Ip6OutForwDatagrams");
135         hash_Ip6OutRequests = simple_hash("Ip6OutRequests");
136         hash_Ip6OutDiscards = simple_hash("Ip6OutDiscards");
137         hash_Ip6OutNoRoutes = simple_hash("Ip6OutNoRoutes");
138         hash_Ip6ReasmTimeout = simple_hash("Ip6ReasmTimeout");
139         hash_Ip6ReasmReqds = simple_hash("Ip6ReasmReqds");
140         hash_Ip6ReasmOKs = simple_hash("Ip6ReasmOKs");
141         hash_Ip6ReasmFails = simple_hash("Ip6ReasmFails");
142         hash_Ip6FragOKs = simple_hash("Ip6FragOKs");
143         hash_Ip6FragFails = simple_hash("Ip6FragFails");
144         hash_Ip6FragCreates = simple_hash("Ip6FragCreates");
145         hash_Ip6InMcastPkts = simple_hash("Ip6InMcastPkts");
146         hash_Ip6OutMcastPkts = simple_hash("Ip6OutMcastPkts");
147         hash_Ip6InOctets = simple_hash("Ip6InOctets");
148         hash_Ip6OutOctets = simple_hash("Ip6OutOctets");
149         hash_Ip6InMcastOctets = simple_hash("Ip6InMcastOctets");
150         hash_Ip6OutMcastOctets = simple_hash("Ip6OutMcastOctets");
151         hash_Ip6InBcastOctets = simple_hash("Ip6InBcastOctets");
152         hash_Ip6OutBcastOctets = simple_hash("Ip6OutBcastOctets");
153         hash_Ip6InNoECTPkts = simple_hash("Ip6InNoECTPkts");
154         hash_Ip6InECT1Pkts = simple_hash("Ip6InECT1Pkts");
155         hash_Ip6InECT0Pkts = simple_hash("Ip6InECT0Pkts");
156         hash_Ip6InCEPkts = simple_hash("Ip6InCEPkts");
157         hash_Icmp6InMsgs = simple_hash("Icmp6InMsgs");
158         hash_Icmp6InErrors = simple_hash("Icmp6InErrors");
159         hash_Icmp6OutMsgs = simple_hash("Icmp6OutMsgs");
160         hash_Icmp6OutErrors = simple_hash("Icmp6OutErrors");
161         hash_Icmp6InCsumErrors = simple_hash("Icmp6InCsumErrors");
162         hash_Icmp6InDestUnreachs = simple_hash("Icmp6InDestUnreachs");
163         hash_Icmp6InPktTooBigs = simple_hash("Icmp6InPktTooBigs");
164         hash_Icmp6InTimeExcds = simple_hash("Icmp6InTimeExcds");
165         hash_Icmp6InParmProblems = simple_hash("Icmp6InParmProblems");
166         hash_Icmp6InEchos = simple_hash("Icmp6InEchos");
167         hash_Icmp6InEchoReplies = simple_hash("Icmp6InEchoReplies");
168         hash_Icmp6InGroupMembQueries = simple_hash("Icmp6InGroupMembQueries");
169         hash_Icmp6InGroupMembResponses = simple_hash("Icmp6InGroupMembResponses");
170         hash_Icmp6InGroupMembReductions = simple_hash("Icmp6InGroupMembReductions");
171         hash_Icmp6InRouterSolicits = simple_hash("Icmp6InRouterSolicits");
172         hash_Icmp6InRouterAdvertisements = simple_hash("Icmp6InRouterAdvertisements");
173         hash_Icmp6InNeighborSolicits = simple_hash("Icmp6InNeighborSolicits");
174         hash_Icmp6InNeighborAdvertisements = simple_hash("Icmp6InNeighborAdvertisements");
175         hash_Icmp6InRedirects = simple_hash("Icmp6InRedirects");
176         hash_Icmp6InMLDv2Reports = simple_hash("Icmp6InMLDv2Reports");
177         hash_Icmp6OutDestUnreachs = simple_hash("Icmp6OutDestUnreachs");
178         hash_Icmp6OutPktTooBigs = simple_hash("Icmp6OutPktTooBigs");
179         hash_Icmp6OutTimeExcds = simple_hash("Icmp6OutTimeExcds");
180         hash_Icmp6OutParmProblems = simple_hash("Icmp6OutParmProblems");
181         hash_Icmp6OutEchos = simple_hash("Icmp6OutEchos");
182         hash_Icmp6OutEchoReplies = simple_hash("Icmp6OutEchoReplies");
183         hash_Icmp6OutGroupMembQueries = simple_hash("Icmp6OutGroupMembQueries");
184         hash_Icmp6OutGroupMembResponses = simple_hash("Icmp6OutGroupMembResponses");
185         hash_Icmp6OutGroupMembReductions = simple_hash("Icmp6OutGroupMembReductions");
186         hash_Icmp6OutRouterSolicits = simple_hash("Icmp6OutRouterSolicits");
187         hash_Icmp6OutRouterAdvertisements = simple_hash("Icmp6OutRouterAdvertisements");
188         hash_Icmp6OutNeighborSolicits = simple_hash("Icmp6OutNeighborSolicits");
189         hash_Icmp6OutNeighborAdvertisements = simple_hash("Icmp6OutNeighborAdvertisements");
190         hash_Icmp6OutRedirects = simple_hash("Icmp6OutRedirects");
191         hash_Icmp6OutMLDv2Reports = simple_hash("Icmp6OutMLDv2Reports");
192         hash_Icmp6InType1 = simple_hash("Icmp6InType1");
193         hash_Icmp6InType128 = simple_hash("Icmp6InType128");
194         hash_Icmp6InType129 = simple_hash("Icmp6InType129");
195         hash_Icmp6InType136 = simple_hash("Icmp6InType136");
196         hash_Icmp6OutType1 = simple_hash("Icmp6OutType1");
197         hash_Icmp6OutType128 = simple_hash("Icmp6OutType128");
198         hash_Icmp6OutType129 = simple_hash("Icmp6OutType129");
199         hash_Icmp6OutType133 = simple_hash("Icmp6OutType133");
200         hash_Icmp6OutType135 = simple_hash("Icmp6OutType135");
201         hash_Icmp6OutType143 = simple_hash("Icmp6OutType143");
202         hash_Udp6InDatagrams = simple_hash("Udp6InDatagrams");
203         hash_Udp6NoPorts = simple_hash("Udp6NoPorts");
204         hash_Udp6InErrors = simple_hash("Udp6InErrors");
205         hash_Udp6OutDatagrams = simple_hash("Udp6OutDatagrams");
206         hash_Udp6RcvbufErrors = simple_hash("Udp6RcvbufErrors");
207         hash_Udp6SndbufErrors = simple_hash("Udp6SndbufErrors");
208         hash_Udp6InCsumErrors = simple_hash("Udp6InCsumErrors");
209         hash_Udp6IgnoredMulti = simple_hash("Udp6IgnoredMulti");
210         hash_UdpLite6InDatagrams = simple_hash("UdpLite6InDatagrams");
211         hash_UdpLite6NoPorts = simple_hash("UdpLite6NoPorts");
212         hash_UdpLite6InErrors = simple_hash("UdpLite6InErrors");
213         hash_UdpLite6OutDatagrams = simple_hash("UdpLite6OutDatagrams");
214         hash_UdpLite6RcvbufErrors = simple_hash("UdpLite6RcvbufErrors");
215         hash_UdpLite6SndbufErrors = simple_hash("UdpLite6SndbufErrors");
216         hash_UdpLite6InCsumErrors = simple_hash("UdpLite6InCsumErrors");
217
218         do_ip_packets       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 packets", CONFIG_ONDEMAND_ONDEMAND);
219         do_ip_fragsout      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments sent", CONFIG_ONDEMAND_ONDEMAND);
220         do_ip_fragsin       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments assembly", CONFIG_ONDEMAND_ONDEMAND);
221         do_ip_errors        = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 errors", CONFIG_ONDEMAND_ONDEMAND);
222         do_udp_packets      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP packets", CONFIG_ONDEMAND_ONDEMAND);
223         do_udp_errors       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP errors", CONFIG_ONDEMAND_ONDEMAND);
224         do_udplite_packets  = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite packets", CONFIG_ONDEMAND_ONDEMAND);
225         do_udplite_errors   = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite errors", CONFIG_ONDEMAND_ONDEMAND);
226         do_bandwidth        = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "bandwidth", CONFIG_ONDEMAND_ONDEMAND);
227         do_mcast            = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast bandwidth", CONFIG_ONDEMAND_ONDEMAND);
228         do_bcast            = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "broadcast bandwidth", CONFIG_ONDEMAND_ONDEMAND);
229         do_mcast_p          = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast packets", CONFIG_ONDEMAND_ONDEMAND);
230         do_icmp             = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp", CONFIG_ONDEMAND_ONDEMAND);
231         do_icmp_redir       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp redirects", CONFIG_ONDEMAND_ONDEMAND);
232         do_icmp_errors      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp errors", CONFIG_ONDEMAND_ONDEMAND);
233         do_icmp_echos       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp echos", CONFIG_ONDEMAND_ONDEMAND);
234         do_icmp_groupmemb   = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp group membership", CONFIG_ONDEMAND_ONDEMAND);
235         do_icmp_router      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp router", CONFIG_ONDEMAND_ONDEMAND);
236         do_icmp_neighbor    = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp neighbor", CONFIG_ONDEMAND_ONDEMAND);
237         do_icmp_mldv2       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp mldv2", CONFIG_ONDEMAND_ONDEMAND);
238         do_icmp_types       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp types", CONFIG_ONDEMAND_ONDEMAND);
239         do_ect              = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ect", CONFIG_ONDEMAND_ONDEMAND);
240     }
241
242     if(unlikely(!ff)) {
243         char filename[FILENAME_MAX + 1];
244         snprintfz(filename, FILENAME_MAX, "%s%s", global_host_prefix, "/proc/net/snmp6");
245         ff = procfile_open(config_get("plugin:proc:/proc/net/snmp6", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
246         if(unlikely(!ff))
247             return 1;
248     }
249
250     ff = procfile_readall(ff);
251     if(unlikely(!ff))
252         return 0; // we return 0, so that we will retry to open it next time
253
254     size_t lines = procfile_lines(ff), l;
255
256     unsigned long long Ip6InReceives = 0ULL;
257     unsigned long long Ip6InHdrErrors = 0ULL;
258     unsigned long long Ip6InTooBigErrors = 0ULL;
259     unsigned long long Ip6InNoRoutes = 0ULL;
260     unsigned long long Ip6InAddrErrors = 0ULL;
261     unsigned long long Ip6InUnknownProtos = 0ULL;
262     unsigned long long Ip6InTruncatedPkts = 0ULL;
263     unsigned long long Ip6InDiscards = 0ULL;
264     unsigned long long Ip6InDelivers = 0ULL;
265     unsigned long long Ip6OutForwDatagrams = 0ULL;
266     unsigned long long Ip6OutRequests = 0ULL;
267     unsigned long long Ip6OutDiscards = 0ULL;
268     unsigned long long Ip6OutNoRoutes = 0ULL;
269     unsigned long long Ip6ReasmTimeout = 0ULL;
270     unsigned long long Ip6ReasmReqds = 0ULL;
271     unsigned long long Ip6ReasmOKs = 0ULL;
272     unsigned long long Ip6ReasmFails = 0ULL;
273     unsigned long long Ip6FragOKs = 0ULL;
274     unsigned long long Ip6FragFails = 0ULL;
275     unsigned long long Ip6FragCreates = 0ULL;
276     unsigned long long Ip6InMcastPkts = 0ULL;
277     unsigned long long Ip6OutMcastPkts = 0ULL;
278     unsigned long long Ip6InOctets = 0ULL;
279     unsigned long long Ip6OutOctets = 0ULL;
280     unsigned long long Ip6InMcastOctets = 0ULL;
281     unsigned long long Ip6OutMcastOctets = 0ULL;
282     unsigned long long Ip6InBcastOctets = 0ULL;
283     unsigned long long Ip6OutBcastOctets = 0ULL;
284     unsigned long long Ip6InNoECTPkts = 0ULL;
285     unsigned long long Ip6InECT1Pkts = 0ULL;
286     unsigned long long Ip6InECT0Pkts = 0ULL;
287     unsigned long long Ip6InCEPkts = 0ULL;
288     unsigned long long Icmp6InMsgs = 0ULL;
289     unsigned long long Icmp6InErrors = 0ULL;
290     unsigned long long Icmp6OutMsgs = 0ULL;
291     unsigned long long Icmp6OutErrors = 0ULL;
292     unsigned long long Icmp6InCsumErrors = 0ULL;
293     unsigned long long Icmp6InDestUnreachs = 0ULL;
294     unsigned long long Icmp6InPktTooBigs = 0ULL;
295     unsigned long long Icmp6InTimeExcds = 0ULL;
296     unsigned long long Icmp6InParmProblems = 0ULL;
297     unsigned long long Icmp6InEchos = 0ULL;
298     unsigned long long Icmp6InEchoReplies = 0ULL;
299     unsigned long long Icmp6InGroupMembQueries = 0ULL;
300     unsigned long long Icmp6InGroupMembResponses = 0ULL;
301     unsigned long long Icmp6InGroupMembReductions = 0ULL;
302     unsigned long long Icmp6InRouterSolicits = 0ULL;
303     unsigned long long Icmp6InRouterAdvertisements = 0ULL;
304     unsigned long long Icmp6InNeighborSolicits = 0ULL;
305     unsigned long long Icmp6InNeighborAdvertisements = 0ULL;
306     unsigned long long Icmp6InRedirects = 0ULL;
307     unsigned long long Icmp6InMLDv2Reports = 0ULL;
308     unsigned long long Icmp6OutDestUnreachs = 0ULL;
309     unsigned long long Icmp6OutPktTooBigs = 0ULL;
310     unsigned long long Icmp6OutTimeExcds = 0ULL;
311     unsigned long long Icmp6OutParmProblems = 0ULL;
312     unsigned long long Icmp6OutEchos = 0ULL;
313     unsigned long long Icmp6OutEchoReplies = 0ULL;
314     unsigned long long Icmp6OutGroupMembQueries = 0ULL;
315     unsigned long long Icmp6OutGroupMembResponses = 0ULL;
316     unsigned long long Icmp6OutGroupMembReductions = 0ULL;
317     unsigned long long Icmp6OutRouterSolicits = 0ULL;
318     unsigned long long Icmp6OutRouterAdvertisements = 0ULL;
319     unsigned long long Icmp6OutNeighborSolicits = 0ULL;
320     unsigned long long Icmp6OutNeighborAdvertisements = 0ULL;
321     unsigned long long Icmp6OutRedirects = 0ULL;
322     unsigned long long Icmp6OutMLDv2Reports = 0ULL;
323     unsigned long long Icmp6InType1 = 0ULL;
324     unsigned long long Icmp6InType128 = 0ULL;
325     unsigned long long Icmp6InType129 = 0ULL;
326     unsigned long long Icmp6InType136 = 0ULL;
327     unsigned long long Icmp6OutType1 = 0ULL;
328     unsigned long long Icmp6OutType128 = 0ULL;
329     unsigned long long Icmp6OutType129 = 0ULL;
330     unsigned long long Icmp6OutType133 = 0ULL;
331     unsigned long long Icmp6OutType135 = 0ULL;
332     unsigned long long Icmp6OutType143 = 0ULL;
333     unsigned long long Udp6InDatagrams = 0ULL;
334     unsigned long long Udp6NoPorts = 0ULL;
335     unsigned long long Udp6InErrors = 0ULL;
336     unsigned long long Udp6OutDatagrams = 0ULL;
337     unsigned long long Udp6RcvbufErrors = 0ULL;
338     unsigned long long Udp6SndbufErrors = 0ULL;
339     unsigned long long Udp6InCsumErrors = 0ULL;
340     unsigned long long Udp6IgnoredMulti = 0ULL;
341     unsigned long long UdpLite6InDatagrams = 0ULL;
342     unsigned long long UdpLite6NoPorts = 0ULL;
343     unsigned long long UdpLite6InErrors = 0ULL;
344     unsigned long long UdpLite6OutDatagrams = 0ULL;
345     unsigned long long UdpLite6RcvbufErrors = 0ULL;
346     unsigned long long UdpLite6SndbufErrors = 0ULL;
347     unsigned long long UdpLite6InCsumErrors = 0ULL;
348
349     unsigned long long *ptr = NULL;
350
351     for(l = 0; l < lines ;l++) {
352         size_t words = procfile_linewords(ff, l);
353         if(unlikely(words < 2)) {
354             if(unlikely(words)) error("Cannot read /proc/net/snmp6 line %zu. Expected 2 params, read %zu.", l, words);
355             continue;
356         }
357
358         char *name = procfile_lineword(ff, l, 0);
359         char * value = procfile_lineword(ff, l, 1);
360         if(unlikely(!name || !*name || !value || !*value))
361             continue;
362
363         uint32_t hash = simple_hash(name);
364
365              if(unlikely(hash == hash_Ip6InReceives && strsame(name, "Ip6InReceives") == 0)) ptr = &Ip6InReceives;
366         else if(unlikely(hash == hash_Ip6InHdrErrors && strsame(name, "Ip6InHdrErrors") == 0)) ptr = &Ip6InHdrErrors;
367         else if(unlikely(hash == hash_Ip6InTooBigErrors && strsame(name, "Ip6InTooBigErrors") == 0)) ptr = &Ip6InTooBigErrors;
368         else if(unlikely(hash == hash_Ip6InNoRoutes && strsame(name, "Ip6InNoRoutes") == 0)) ptr = &Ip6InNoRoutes;
369         else if(unlikely(hash == hash_Ip6InAddrErrors && strsame(name, "Ip6InAddrErrors") == 0)) ptr = &Ip6InAddrErrors;
370         else if(unlikely(hash == hash_Ip6InUnknownProtos && strsame(name, "Ip6InUnknownProtos") == 0)) ptr = &Ip6InUnknownProtos;
371         else if(unlikely(hash == hash_Ip6InTruncatedPkts && strsame(name, "Ip6InTruncatedPkts") == 0)) ptr = &Ip6InTruncatedPkts;
372         else if(unlikely(hash == hash_Ip6InDiscards && strsame(name, "Ip6InDiscards") == 0)) ptr = &Ip6InDiscards;
373         else if(unlikely(hash == hash_Ip6InDelivers && strsame(name, "Ip6InDelivers") == 0)) ptr = &Ip6InDelivers;
374         else if(unlikely(hash == hash_Ip6OutForwDatagrams && strsame(name, "Ip6OutForwDatagrams") == 0)) ptr = &Ip6OutForwDatagrams;
375         else if(unlikely(hash == hash_Ip6OutRequests && strsame(name, "Ip6OutRequests") == 0)) ptr = &Ip6OutRequests;
376         else if(unlikely(hash == hash_Ip6OutDiscards && strsame(name, "Ip6OutDiscards") == 0)) ptr = &Ip6OutDiscards;
377         else if(unlikely(hash == hash_Ip6OutNoRoutes && strsame(name, "Ip6OutNoRoutes") == 0)) ptr = &Ip6OutNoRoutes;
378         else if(unlikely(hash == hash_Ip6ReasmTimeout && strsame(name, "Ip6ReasmTimeout") == 0)) ptr = &Ip6ReasmTimeout;
379         else if(unlikely(hash == hash_Ip6ReasmReqds && strsame(name, "Ip6ReasmReqds") == 0)) ptr = &Ip6ReasmReqds;
380         else if(unlikely(hash == hash_Ip6ReasmOKs && strsame(name, "Ip6ReasmOKs") == 0)) ptr = &Ip6ReasmOKs;
381         else if(unlikely(hash == hash_Ip6ReasmFails && strsame(name, "Ip6ReasmFails") == 0)) ptr = &Ip6ReasmFails;
382         else if(unlikely(hash == hash_Ip6FragOKs && strsame(name, "Ip6FragOKs") == 0)) ptr = &Ip6FragOKs;
383         else if(unlikely(hash == hash_Ip6FragFails && strsame(name, "Ip6FragFails") == 0)) ptr = &Ip6FragFails;
384         else if(unlikely(hash == hash_Ip6FragCreates && strsame(name, "Ip6FragCreates") == 0)) ptr = &Ip6FragCreates;
385         else if(unlikely(hash == hash_Ip6InMcastPkts && strsame(name, "Ip6InMcastPkts") == 0)) ptr = &Ip6InMcastPkts;
386         else if(unlikely(hash == hash_Ip6OutMcastPkts && strsame(name, "Ip6OutMcastPkts") == 0)) ptr = &Ip6OutMcastPkts;
387         else if(unlikely(hash == hash_Ip6InOctets && strsame(name, "Ip6InOctets") == 0)) ptr = &Ip6InOctets;
388         else if(unlikely(hash == hash_Ip6OutOctets && strsame(name, "Ip6OutOctets") == 0)) ptr = &Ip6OutOctets;
389         else if(unlikely(hash == hash_Ip6InMcastOctets && strsame(name, "Ip6InMcastOctets") == 0)) ptr = &Ip6InMcastOctets;
390         else if(unlikely(hash == hash_Ip6OutMcastOctets && strsame(name, "Ip6OutMcastOctets") == 0)) ptr = &Ip6OutMcastOctets;
391         else if(unlikely(hash == hash_Ip6InBcastOctets && strsame(name, "Ip6InBcastOctets") == 0)) ptr = &Ip6InBcastOctets;
392         else if(unlikely(hash == hash_Ip6OutBcastOctets && strsame(name, "Ip6OutBcastOctets") == 0)) ptr = &Ip6OutBcastOctets;
393         else if(unlikely(hash == hash_Ip6InNoECTPkts && strsame(name, "Ip6InNoECTPkts") == 0)) ptr = &Ip6InNoECTPkts;
394         else if(unlikely(hash == hash_Ip6InECT1Pkts && strsame(name, "Ip6InECT1Pkts") == 0)) ptr = &Ip6InECT1Pkts;
395         else if(unlikely(hash == hash_Ip6InECT0Pkts && strsame(name, "Ip6InECT0Pkts") == 0)) ptr = &Ip6InECT0Pkts;
396         else if(unlikely(hash == hash_Ip6InCEPkts && strsame(name, "Ip6InCEPkts") == 0)) ptr = &Ip6InCEPkts;
397         else if(unlikely(hash == hash_Icmp6InMsgs && strsame(name, "Icmp6InMsgs") == 0)) ptr = &Icmp6InMsgs;
398         else if(unlikely(hash == hash_Icmp6InErrors && strsame(name, "Icmp6InErrors") == 0)) ptr = &Icmp6InErrors;
399         else if(unlikely(hash == hash_Icmp6OutMsgs && strsame(name, "Icmp6OutMsgs") == 0)) ptr = &Icmp6OutMsgs;
400         else if(unlikely(hash == hash_Icmp6OutErrors && strsame(name, "Icmp6OutErrors") == 0)) ptr = &Icmp6OutErrors;
401         else if(unlikely(hash == hash_Icmp6InCsumErrors && strsame(name, "Icmp6InCsumErrors") == 0)) ptr = &Icmp6InCsumErrors;
402         else if(unlikely(hash == hash_Icmp6InDestUnreachs && strsame(name, "Icmp6InDestUnreachs") == 0)) ptr = &Icmp6InDestUnreachs;
403         else if(unlikely(hash == hash_Icmp6InPktTooBigs && strsame(name, "Icmp6InPktTooBigs") == 0)) ptr = &Icmp6InPktTooBigs;
404         else if(unlikely(hash == hash_Icmp6InTimeExcds && strsame(name, "Icmp6InTimeExcds") == 0)) ptr = &Icmp6InTimeExcds;
405         else if(unlikely(hash == hash_Icmp6InParmProblems && strsame(name, "Icmp6InParmProblems") == 0)) ptr = &Icmp6InParmProblems;
406         else if(unlikely(hash == hash_Icmp6InEchos && strsame(name, "Icmp6InEchos") == 0)) ptr = &Icmp6InEchos;
407         else if(unlikely(hash == hash_Icmp6InEchoReplies && strsame(name, "Icmp6InEchoReplies") == 0)) ptr = &Icmp6InEchoReplies;
408         else if(unlikely(hash == hash_Icmp6InGroupMembQueries && strsame(name, "Icmp6InGroupMembQueries") == 0)) ptr = &Icmp6InGroupMembQueries;
409         else if(unlikely(hash == hash_Icmp6InGroupMembResponses && strsame(name, "Icmp6InGroupMembResponses") == 0)) ptr = &Icmp6InGroupMembResponses;
410         else if(unlikely(hash == hash_Icmp6InGroupMembReductions && strsame(name, "Icmp6InGroupMembReductions") == 0)) ptr = &Icmp6InGroupMembReductions;
411         else if(unlikely(hash == hash_Icmp6InRouterSolicits && strsame(name, "Icmp6InRouterSolicits") == 0)) ptr = &Icmp6InRouterSolicits;
412         else if(unlikely(hash == hash_Icmp6InRouterAdvertisements && strsame(name, "Icmp6InRouterAdvertisements") == 0)) ptr = &Icmp6InRouterAdvertisements;
413         else if(unlikely(hash == hash_Icmp6InNeighborSolicits && strsame(name, "Icmp6InNeighborSolicits") == 0)) ptr = &Icmp6InNeighborSolicits;
414         else if(unlikely(hash == hash_Icmp6InNeighborAdvertisements && strsame(name, "Icmp6InNeighborAdvertisements") == 0)) ptr = &Icmp6InNeighborAdvertisements;
415         else if(unlikely(hash == hash_Icmp6InRedirects && strsame(name, "Icmp6InRedirects") == 0)) ptr = &Icmp6InRedirects;
416         else if(unlikely(hash == hash_Icmp6InMLDv2Reports && strsame(name, "Icmp6InMLDv2Reports") == 0)) ptr = &Icmp6InMLDv2Reports;
417         else if(unlikely(hash == hash_Icmp6OutDestUnreachs && strsame(name, "Icmp6OutDestUnreachs") == 0)) ptr = &Icmp6OutDestUnreachs;
418         else if(unlikely(hash == hash_Icmp6OutPktTooBigs && strsame(name, "Icmp6OutPktTooBigs") == 0)) ptr = &Icmp6OutPktTooBigs;
419         else if(unlikely(hash == hash_Icmp6OutTimeExcds && strsame(name, "Icmp6OutTimeExcds") == 0)) ptr = &Icmp6OutTimeExcds;
420         else if(unlikely(hash == hash_Icmp6OutParmProblems && strsame(name, "Icmp6OutParmProblems") == 0)) ptr = &Icmp6OutParmProblems;
421         else if(unlikely(hash == hash_Icmp6OutEchos && strsame(name, "Icmp6OutEchos") == 0)) ptr = &Icmp6OutEchos;
422         else if(unlikely(hash == hash_Icmp6OutEchoReplies && strsame(name, "Icmp6OutEchoReplies") == 0)) ptr = &Icmp6OutEchoReplies;
423         else if(unlikely(hash == hash_Icmp6OutGroupMembQueries && strsame(name, "Icmp6OutGroupMembQueries") == 0)) ptr = &Icmp6OutGroupMembQueries;
424         else if(unlikely(hash == hash_Icmp6OutGroupMembResponses && strsame(name, "Icmp6OutGroupMembResponses") == 0)) ptr = &Icmp6OutGroupMembResponses;
425         else if(unlikely(hash == hash_Icmp6OutGroupMembReductions && strsame(name, "Icmp6OutGroupMembReductions") == 0)) ptr = &Icmp6OutGroupMembReductions;
426         else if(unlikely(hash == hash_Icmp6OutRouterSolicits && strsame(name, "Icmp6OutRouterSolicits") == 0)) ptr = &Icmp6OutRouterSolicits;
427         else if(unlikely(hash == hash_Icmp6OutRouterAdvertisements && strsame(name, "Icmp6OutRouterAdvertisements") == 0)) ptr = &Icmp6OutRouterAdvertisements;
428         else if(unlikely(hash == hash_Icmp6OutNeighborSolicits && strsame(name, "Icmp6OutNeighborSolicits") == 0)) ptr = &Icmp6OutNeighborSolicits;
429         else if(unlikely(hash == hash_Icmp6OutNeighborAdvertisements && strsame(name, "Icmp6OutNeighborAdvertisements") == 0)) ptr = &Icmp6OutNeighborAdvertisements;
430         else if(unlikely(hash == hash_Icmp6OutRedirects && strsame(name, "Icmp6OutRedirects") == 0)) ptr = &Icmp6OutRedirects;
431         else if(unlikely(hash == hash_Icmp6OutMLDv2Reports && strsame(name, "Icmp6OutMLDv2Reports") == 0)) ptr = &Icmp6OutMLDv2Reports;
432         else if(unlikely(hash == hash_Icmp6InType1 && strsame(name, "Icmp6InType1") == 0)) ptr = &Icmp6InType1;
433         else if(unlikely(hash == hash_Icmp6InType128 && strsame(name, "Icmp6InType128") == 0)) ptr = &Icmp6InType128;
434         else if(unlikely(hash == hash_Icmp6InType129 && strsame(name, "Icmp6InType129") == 0)) ptr = &Icmp6InType129;
435         else if(unlikely(hash == hash_Icmp6InType136 && strsame(name, "Icmp6InType136") == 0)) ptr = &Icmp6InType136;
436         else if(unlikely(hash == hash_Icmp6OutType1 && strsame(name, "Icmp6OutType1") == 0)) ptr = &Icmp6OutType1;
437         else if(unlikely(hash == hash_Icmp6OutType128 && strsame(name, "Icmp6OutType128") == 0)) ptr = &Icmp6OutType128;
438         else if(unlikely(hash == hash_Icmp6OutType129 && strsame(name, "Icmp6OutType129") == 0)) ptr = &Icmp6OutType129;
439         else if(unlikely(hash == hash_Icmp6OutType133 && strsame(name, "Icmp6OutType133") == 0)) ptr = &Icmp6OutType133;
440         else if(unlikely(hash == hash_Icmp6OutType135 && strsame(name, "Icmp6OutType135") == 0)) ptr = &Icmp6OutType135;
441         else if(unlikely(hash == hash_Icmp6OutType143 && strsame(name, "Icmp6OutType143") == 0)) ptr = &Icmp6OutType143;
442         else if(unlikely(hash == hash_Udp6InDatagrams && strsame(name, "Udp6InDatagrams") == 0)) ptr = &Udp6InDatagrams;
443         else if(unlikely(hash == hash_Udp6NoPorts && strsame(name, "Udp6NoPorts") == 0)) ptr = &Udp6NoPorts;
444         else if(unlikely(hash == hash_Udp6InErrors && strsame(name, "Udp6InErrors") == 0)) ptr = &Udp6InErrors;
445         else if(unlikely(hash == hash_Udp6OutDatagrams && strsame(name, "Udp6OutDatagrams") == 0)) ptr = &Udp6OutDatagrams;
446         else if(unlikely(hash == hash_Udp6RcvbufErrors && strsame(name, "Udp6RcvbufErrors") == 0)) ptr = &Udp6RcvbufErrors;
447         else if(unlikely(hash == hash_Udp6SndbufErrors && strsame(name, "Udp6SndbufErrors") == 0)) ptr = &Udp6SndbufErrors;
448         else if(unlikely(hash == hash_Udp6InCsumErrors && strsame(name, "Udp6InCsumErrors") == 0)) ptr = &Udp6InCsumErrors;
449         else if(unlikely(hash == hash_Udp6IgnoredMulti && strsame(name, "Udp6IgnoredMulti") == 0)) ptr = &Udp6IgnoredMulti;
450         else if(unlikely(hash == hash_UdpLite6InDatagrams && strsame(name, "UdpLite6InDatagrams") == 0)) ptr = &UdpLite6InDatagrams;
451         else if(unlikely(hash == hash_UdpLite6NoPorts && strsame(name, "UdpLite6NoPorts") == 0)) ptr = &UdpLite6NoPorts;
452         else if(unlikely(hash == hash_UdpLite6InErrors && strsame(name, "UdpLite6InErrors") == 0)) ptr = &UdpLite6InErrors;
453         else if(unlikely(hash == hash_UdpLite6OutDatagrams && strsame(name, "UdpLite6OutDatagrams") == 0)) ptr = &UdpLite6OutDatagrams;
454         else if(unlikely(hash == hash_UdpLite6RcvbufErrors && strsame(name, "UdpLite6RcvbufErrors") == 0)) ptr = &UdpLite6RcvbufErrors;
455         else if(unlikely(hash == hash_UdpLite6SndbufErrors && strsame(name, "UdpLite6SndbufErrors") == 0)) ptr = &UdpLite6SndbufErrors;
456         else if(unlikely(hash == hash_UdpLite6InCsumErrors && strsame(name, "UdpLite6InCsumErrors") == 0)) ptr = &UdpLite6InCsumErrors;
457
458         if(unlikely(ptr)) {
459             *ptr = str2ull(value);
460             ptr = NULL;
461         }
462     }
463
464     RRDSET *st;
465
466     // --------------------------------------------------------------------
467
468     if(do_bandwidth == CONFIG_ONDEMAND_YES || (do_bandwidth == CONFIG_ONDEMAND_ONDEMAND && (Ip6InOctets || Ip6OutOctets))) {
469         do_bandwidth = CONFIG_ONDEMAND_YES;
470         st = rrdset_find("system.ipv6");
471         if(unlikely(!st)) {
472             st = rrdset_create("system", "ipv6", NULL, "network", NULL, "IPv6 Bandwidth", "kilobits/s", 500, update_every, RRDSET_TYPE_AREA);
473
474             rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
475             rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
476         }
477         else rrdset_next(st);
478
479         rrddim_set(st, "sent", Ip6OutOctets);
480         rrddim_set(st, "received", Ip6InOctets);
481         rrdset_done(st);
482     }
483
484     // --------------------------------------------------------------------
485
486     if(do_ip_packets == CONFIG_ONDEMAND_YES || (do_ip_packets == CONFIG_ONDEMAND_ONDEMAND && (Ip6InReceives || Ip6OutRequests || Ip6InDelivers || Ip6OutForwDatagrams))) {
487         do_ip_packets = CONFIG_ONDEMAND_YES;
488         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".packets");
489         if(unlikely(!st)) {
490             st = rrdset_create(RRD_TYPE_NET_SNMP6, "packets", NULL, "packets", NULL, "IPv6 Packets", "packets/s", 3000, update_every, RRDSET_TYPE_LINE);
491
492             rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
493             rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
494             rrddim_add(st, "forwarded", NULL, 1, 1, RRDDIM_INCREMENTAL);
495             rrddim_add(st, "delivers", NULL, -1, 1, RRDDIM_INCREMENTAL);
496         }
497         else rrdset_next(st);
498
499         rrddim_set(st, "sent", Ip6OutRequests);
500         rrddim_set(st, "received", Ip6InReceives);
501         rrddim_set(st, "forwarded", Ip6InDelivers);
502         rrddim_set(st, "delivers", Ip6OutForwDatagrams);
503         rrdset_done(st);
504     }
505
506     // --------------------------------------------------------------------
507
508     if(do_ip_fragsout == CONFIG_ONDEMAND_YES || (do_ip_fragsout == CONFIG_ONDEMAND_ONDEMAND && (Ip6FragOKs || Ip6FragFails || Ip6FragCreates))) {
509         do_ip_fragsout = CONFIG_ONDEMAND_YES;
510         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".fragsout");
511         if(unlikely(!st)) {
512             st = rrdset_create(RRD_TYPE_NET_SNMP6, "fragsout", NULL, "fragments", NULL, "IPv6 Fragments Sent", "packets/s", 3010, update_every, RRDSET_TYPE_LINE);
513             st->isdetail = 1;
514
515             rrddim_add(st, "ok", NULL, 1, 1, RRDDIM_INCREMENTAL);
516             rrddim_add(st, "failed", NULL, -1, 1, RRDDIM_INCREMENTAL);
517             rrddim_add(st, "all", NULL, 1, 1, RRDDIM_INCREMENTAL);
518         }
519         else rrdset_next(st);
520
521         rrddim_set(st, "ok", Ip6FragOKs);
522         rrddim_set(st, "failed", Ip6FragFails);
523         rrddim_set(st, "all", Ip6FragCreates);
524         rrdset_done(st);
525     }
526
527     // --------------------------------------------------------------------
528
529     if(do_ip_fragsin == CONFIG_ONDEMAND_YES || (do_ip_fragsin == CONFIG_ONDEMAND_ONDEMAND
530         && (
531             Ip6ReasmOKs
532             || Ip6ReasmFails
533             || Ip6ReasmTimeout
534             || Ip6ReasmReqds
535             ))) {
536         do_ip_fragsin = CONFIG_ONDEMAND_YES;
537         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".fragsin");
538         if(unlikely(!st)) {
539             st = rrdset_create(RRD_TYPE_NET_SNMP6, "fragsin", NULL, "fragments", NULL, "IPv6 Fragments Reassembly", "packets/s", 3011, update_every, RRDSET_TYPE_LINE);
540             st->isdetail = 1;
541
542             rrddim_add(st, "ok", NULL, 1, 1, RRDDIM_INCREMENTAL);
543             rrddim_add(st, "failed", NULL, -1, 1, RRDDIM_INCREMENTAL);
544             rrddim_add(st, "timeout", NULL, -1, 1, RRDDIM_INCREMENTAL);
545             rrddim_add(st, "all", NULL, 1, 1, RRDDIM_INCREMENTAL);
546         }
547         else rrdset_next(st);
548
549         rrddim_set(st, "ok", Ip6ReasmOKs);
550         rrddim_set(st, "failed", Ip6ReasmFails);
551         rrddim_set(st, "timeout", Ip6ReasmTimeout);
552         rrddim_set(st, "all", Ip6ReasmReqds);
553         rrdset_done(st);
554     }
555
556     // --------------------------------------------------------------------
557
558     if(do_ip_errors == CONFIG_ONDEMAND_YES || (do_ip_errors == CONFIG_ONDEMAND_ONDEMAND
559         && (
560             Ip6InDiscards
561             || Ip6OutDiscards
562             || Ip6InHdrErrors
563             || Ip6InAddrErrors
564             || Ip6InUnknownProtos
565             || Ip6InTooBigErrors
566             || Ip6InTruncatedPkts
567             || Ip6InNoRoutes
568         ))) {
569         do_ip_errors = CONFIG_ONDEMAND_YES;
570         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".errors");
571         if(unlikely(!st)) {
572             st = rrdset_create(RRD_TYPE_NET_SNMP6, "errors", NULL, "errors", NULL, "IPv6 Errors", "packets/s", 3002, update_every, RRDSET_TYPE_LINE);
573             st->isdetail = 1;
574
575             rrddim_add(st, "InDiscards", NULL, 1, 1, RRDDIM_INCREMENTAL);
576             rrddim_add(st, "OutDiscards", NULL, -1, 1, RRDDIM_INCREMENTAL);
577
578             rrddim_add(st, "InHdrErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
579             rrddim_add(st, "InAddrErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
580             rrddim_add(st, "InUnknownProtos", NULL, 1, 1, RRDDIM_INCREMENTAL);
581             rrddim_add(st, "InTooBigErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
582             rrddim_add(st, "InTruncatedPkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
583             rrddim_add(st, "InNoRoutes", NULL, 1, 1, RRDDIM_INCREMENTAL);
584
585             rrddim_add(st, "OutNoRoutes", NULL, -1, 1, RRDDIM_INCREMENTAL);
586         }
587         else rrdset_next(st);
588
589         rrddim_set(st, "InDiscards", Ip6InDiscards);
590         rrddim_set(st, "OutDiscards", Ip6OutDiscards);
591
592         rrddim_set(st, "InHdrErrors", Ip6InHdrErrors);
593         rrddim_set(st, "InAddrErrors", Ip6InAddrErrors);
594         rrddim_set(st, "InUnknownProtos", Ip6InUnknownProtos);
595         rrddim_set(st, "InTooBigErrors", Ip6InTooBigErrors);
596         rrddim_set(st, "InTruncatedPkts", Ip6InTruncatedPkts);
597         rrddim_set(st, "InNoRoutes", Ip6InNoRoutes);
598
599         rrddim_set(st, "OutNoRoutes", Ip6OutNoRoutes);
600         rrdset_done(st);
601     }
602
603     // --------------------------------------------------------------------
604
605     if(do_udp_packets == CONFIG_ONDEMAND_YES || (do_udp_packets == CONFIG_ONDEMAND_ONDEMAND && (Udp6InDatagrams || Udp6OutDatagrams))) {
606         do_udp_packets = CONFIG_ONDEMAND_YES;
607         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".udppackets");
608         if(unlikely(!st)) {
609             st = rrdset_create(RRD_TYPE_NET_SNMP6, "udppackets", NULL, "udp", NULL, "IPv6 UDP Packets", "packets/s", 3601, update_every, RRDSET_TYPE_LINE);
610
611             rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
612             rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
613         }
614         else rrdset_next(st);
615
616         rrddim_set(st, "received", Udp6InDatagrams);
617         rrddim_set(st, "sent", Udp6OutDatagrams);
618         rrdset_done(st);
619     }
620
621     // --------------------------------------------------------------------
622
623     if(do_udp_errors == CONFIG_ONDEMAND_YES || (do_udp_errors == CONFIG_ONDEMAND_ONDEMAND
624         && (
625             Udp6InErrors
626             || Udp6NoPorts
627             || Udp6RcvbufErrors
628             || Udp6SndbufErrors
629             || Udp6InCsumErrors
630             || Udp6IgnoredMulti
631         ))) {
632         do_udp_errors = CONFIG_ONDEMAND_YES;
633         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".udperrors");
634         if(unlikely(!st)) {
635             st = rrdset_create(RRD_TYPE_NET_SNMP6, "udperrors", NULL, "udp", NULL, "IPv6 UDP Errors", "events/s", 3701, update_every, RRDSET_TYPE_LINE);
636             st->isdetail = 1;
637
638             rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
639             rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRDDIM_INCREMENTAL);
640             rrddim_add(st, "InErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
641             rrddim_add(st, "NoPorts", NULL, 1, 1, RRDDIM_INCREMENTAL);
642             rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
643             rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRDDIM_INCREMENTAL);
644         }
645         else rrdset_next(st);
646
647         rrddim_set(st, "InErrors", Udp6InErrors);
648         rrddim_set(st, "NoPorts", Udp6NoPorts);
649         rrddim_set(st, "RcvbufErrors", Udp6RcvbufErrors);
650         rrddim_set(st, "SndbufErrors", Udp6SndbufErrors);
651         rrddim_set(st, "InCsumErrors", Udp6InCsumErrors);
652         rrddim_set(st, "IgnoredMulti", Udp6IgnoredMulti);
653         rrdset_done(st);
654     }
655
656     // --------------------------------------------------------------------
657
658     if(do_udplite_packets == CONFIG_ONDEMAND_YES || (do_udplite_packets == CONFIG_ONDEMAND_ONDEMAND && (UdpLite6InDatagrams || UdpLite6OutDatagrams))) {
659         do_udplite_packets = CONFIG_ONDEMAND_YES;
660         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".udplitepackets");
661         if(unlikely(!st)) {
662             st = rrdset_create(RRD_TYPE_NET_SNMP6, "udplitepackets", NULL, "udplite", NULL, "IPv6 UDPlite Packets", "packets/s", 3601, update_every, RRDSET_TYPE_LINE);
663
664             rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
665             rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
666         }
667         else rrdset_next(st);
668
669         rrddim_set(st, "received", UdpLite6InDatagrams);
670         rrddim_set(st, "sent", UdpLite6OutDatagrams);
671         rrdset_done(st);
672     }
673
674     // --------------------------------------------------------------------
675
676     if(do_udplite_errors == CONFIG_ONDEMAND_YES || (do_udplite_errors == CONFIG_ONDEMAND_ONDEMAND
677         && (
678             UdpLite6InErrors
679             || UdpLite6NoPorts
680             || UdpLite6RcvbufErrors
681             || UdpLite6SndbufErrors
682             || Udp6InCsumErrors
683             || UdpLite6InCsumErrors
684         ))) {
685         do_udplite_errors = CONFIG_ONDEMAND_YES;
686         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".udpliteerrors");
687         if(unlikely(!st)) {
688             st = rrdset_create(RRD_TYPE_NET_SNMP6, "udpliteerrors", NULL, "udplite", NULL, "IPv6 UDP Lite Errors", "events/s", 3701, update_every, RRDSET_TYPE_LINE);
689             st->isdetail = 1;
690
691             rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
692             rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRDDIM_INCREMENTAL);
693             rrddim_add(st, "InErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
694             rrddim_add(st, "NoPorts", NULL, 1, 1, RRDDIM_INCREMENTAL);
695             rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
696         }
697         else rrdset_next(st);
698
699         rrddim_set(st, "InErrors", UdpLite6InErrors);
700         rrddim_set(st, "NoPorts", UdpLite6NoPorts);
701         rrddim_set(st, "RcvbufErrors", UdpLite6RcvbufErrors);
702         rrddim_set(st, "SndbufErrors", UdpLite6SndbufErrors);
703         rrddim_set(st, "InCsumErrors", UdpLite6InCsumErrors);
704         rrdset_done(st);
705     }
706
707     // --------------------------------------------------------------------
708
709     if(do_mcast == CONFIG_ONDEMAND_YES || (do_mcast == CONFIG_ONDEMAND_ONDEMAND && (Ip6OutMcastOctets || Ip6InMcastOctets))) {
710         do_mcast = CONFIG_ONDEMAND_YES;
711         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".mcast");
712         if(unlikely(!st)) {
713             st = rrdset_create(RRD_TYPE_NET_SNMP6, "mcast", NULL, "multicast", NULL, "IPv6 Multicast Bandwidth", "kilobits/s", 9000, update_every, RRDSET_TYPE_AREA);
714             st->isdetail = 1;
715
716             rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
717             rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
718         }
719         else rrdset_next(st);
720
721         rrddim_set(st, "sent", Ip6OutMcastOctets);
722         rrddim_set(st, "received", Ip6InMcastOctets);
723         rrdset_done(st);
724     }
725
726     // --------------------------------------------------------------------
727
728     if(do_bcast == CONFIG_ONDEMAND_YES || (do_bcast == CONFIG_ONDEMAND_ONDEMAND && (Ip6OutBcastOctets || Ip6InBcastOctets))) {
729         do_bcast = CONFIG_ONDEMAND_YES;
730         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".bcast");
731         if(unlikely(!st)) {
732             st = rrdset_create(RRD_TYPE_NET_SNMP6, "bcast", NULL, "broadcast", NULL, "IPv6 Broadcast Bandwidth", "kilobits/s", 8000, update_every, RRDSET_TYPE_AREA);
733             st->isdetail = 1;
734
735             rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
736             rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
737         }
738         else rrdset_next(st);
739
740         rrddim_set(st, "sent", Ip6OutBcastOctets);
741         rrddim_set(st, "received", Ip6InBcastOctets);
742         rrdset_done(st);
743     }
744
745     // --------------------------------------------------------------------
746
747     if(do_mcast_p == CONFIG_ONDEMAND_YES || (do_mcast_p == CONFIG_ONDEMAND_ONDEMAND && (Ip6OutMcastPkts || Ip6InMcastPkts))) {
748         do_mcast_p = CONFIG_ONDEMAND_YES;
749         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".mcastpkts");
750         if(unlikely(!st)) {
751             st = rrdset_create(RRD_TYPE_NET_SNMP6, "mcastpkts", NULL, "multicast", NULL, "IPv6 Multicast Packets", "packets/s", 9500, update_every, RRDSET_TYPE_LINE);
752             st->isdetail = 1;
753
754             rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
755             rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
756         }
757         else rrdset_next(st);
758
759         rrddim_set(st, "sent", Ip6OutMcastPkts);
760         rrddim_set(st, "received", Ip6InMcastPkts);
761         rrdset_done(st);
762     }
763
764     // --------------------------------------------------------------------
765
766     if(do_icmp == CONFIG_ONDEMAND_YES || (do_icmp == CONFIG_ONDEMAND_ONDEMAND && (Icmp6InMsgs || Icmp6OutMsgs))) {
767         do_icmp = CONFIG_ONDEMAND_YES;
768         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmp");
769         if(unlikely(!st)) {
770             st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmp", NULL, "icmp", NULL, "IPv6 ICMP Messages", "messages/s", 10000, update_every, RRDSET_TYPE_LINE);
771
772             rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
773             rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
774         }
775         else rrdset_next(st);
776
777         rrddim_set(st, "sent", Icmp6InMsgs);
778         rrddim_set(st, "received", Icmp6OutMsgs);
779         rrdset_done(st);
780     }
781
782     // --------------------------------------------------------------------
783
784     if(do_icmp_redir == CONFIG_ONDEMAND_YES || (do_icmp_redir == CONFIG_ONDEMAND_ONDEMAND && (Icmp6InRedirects || Icmp6OutRedirects))) {
785         do_icmp_redir = CONFIG_ONDEMAND_YES;
786         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmpredir");
787         if(unlikely(!st)) {
788             st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmpredir", NULL, "icmp", NULL, "IPv6 ICMP Redirects", "redirects/s", 10050, update_every, RRDSET_TYPE_LINE);
789
790             rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
791             rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
792         }
793         else rrdset_next(st);
794
795         rrddim_set(st, "sent", Icmp6InRedirects);
796         rrddim_set(st, "received", Icmp6OutRedirects);
797         rrdset_done(st);
798     }
799
800     // --------------------------------------------------------------------
801
802     if(do_icmp_errors == CONFIG_ONDEMAND_YES || (do_icmp_errors == CONFIG_ONDEMAND_ONDEMAND
803         && (
804             Icmp6InErrors
805             || Icmp6OutErrors
806             || Icmp6InCsumErrors
807             || Icmp6InDestUnreachs
808             || Icmp6InPktTooBigs
809             || Icmp6InTimeExcds
810             || Icmp6InParmProblems
811             || Icmp6OutDestUnreachs
812             || Icmp6OutPktTooBigs
813             || Icmp6OutTimeExcds
814             || Icmp6OutParmProblems
815         ))) {
816         do_icmp_errors = CONFIG_ONDEMAND_YES;
817         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmperrors");
818         if(unlikely(!st)) {
819             st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmperrors", NULL, "icmp", NULL, "IPv6 ICMP Errors", "errors/s", 10100, update_every, RRDSET_TYPE_LINE);
820
821             rrddim_add(st, "InErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
822             rrddim_add(st, "OutErrors", NULL, -1, 1, RRDDIM_INCREMENTAL);
823
824             rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
825             rrddim_add(st, "InDestUnreachs", NULL, 1, 1, RRDDIM_INCREMENTAL);
826             rrddim_add(st, "InPktTooBigs", NULL, 1, 1, RRDDIM_INCREMENTAL);
827             rrddim_add(st, "InTimeExcds", NULL, 1, 1, RRDDIM_INCREMENTAL);
828             rrddim_add(st, "InParmProblems", NULL, 1, 1, RRDDIM_INCREMENTAL);
829             rrddim_add(st, "OutDestUnreachs", NULL, -1, 1, RRDDIM_INCREMENTAL);
830             rrddim_add(st, "OutPktTooBigs", NULL, -1, 1, RRDDIM_INCREMENTAL);
831             rrddim_add(st, "OutTimeExcds", NULL, -1, 1, RRDDIM_INCREMENTAL);
832             rrddim_add(st, "OutParmProblems", NULL, -1, 1, RRDDIM_INCREMENTAL);
833         }
834         else rrdset_next(st);
835
836         rrddim_set(st, "InErrors", Icmp6InErrors);
837         rrddim_set(st, "OutErrors", Icmp6OutErrors);
838         rrddim_set(st, "InCsumErrors", Icmp6InCsumErrors);
839         rrddim_set(st, "InDestUnreachs", Icmp6InDestUnreachs);
840         rrddim_set(st, "InPktTooBigs", Icmp6InPktTooBigs);
841         rrddim_set(st, "InTimeExcds", Icmp6InTimeExcds);
842         rrddim_set(st, "InParmProblems", Icmp6InParmProblems);
843         rrddim_set(st, "OutDestUnreachs", Icmp6OutDestUnreachs);
844         rrddim_set(st, "OutPktTooBigs", Icmp6OutPktTooBigs);
845         rrddim_set(st, "OutTimeExcds", Icmp6OutTimeExcds);
846         rrddim_set(st, "OutParmProblems", Icmp6OutParmProblems);
847         rrdset_done(st);
848     }
849
850     // --------------------------------------------------------------------
851
852     if(do_icmp_echos == CONFIG_ONDEMAND_YES || (do_icmp_echos == CONFIG_ONDEMAND_ONDEMAND
853         && (
854             Icmp6InEchos
855             || Icmp6OutEchos
856             || Icmp6InEchoReplies
857             || Icmp6OutEchoReplies
858         ))) {
859         do_icmp_echos = CONFIG_ONDEMAND_YES;
860         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmpechos");
861         if(unlikely(!st)) {
862             st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmpechos", NULL, "icmp", NULL, "IPv6 ICMP Echo", "messages/s", 10200, update_every, RRDSET_TYPE_LINE);
863
864             rrddim_add(st, "InEchos", NULL, 1, 1, RRDDIM_INCREMENTAL);
865             rrddim_add(st, "OutEchos", NULL, -1, 1, RRDDIM_INCREMENTAL);
866             rrddim_add(st, "InEchoReplies", NULL, 1, 1, RRDDIM_INCREMENTAL);
867             rrddim_add(st, "OutEchoReplies", NULL, -1, 1, RRDDIM_INCREMENTAL);
868         }
869         else rrdset_next(st);
870
871         rrddim_set(st, "InEchos", Icmp6InEchos);
872         rrddim_set(st, "OutEchos", Icmp6OutEchos);
873         rrddim_set(st, "InEchoReplies", Icmp6InEchoReplies);
874         rrddim_set(st, "OutEchoReplies", Icmp6OutEchoReplies);
875         rrdset_done(st);
876     }
877
878     // --------------------------------------------------------------------
879
880     if(do_icmp_groupmemb == CONFIG_ONDEMAND_YES || (do_icmp_groupmemb == CONFIG_ONDEMAND_ONDEMAND
881         && (
882             Icmp6InGroupMembQueries
883             || Icmp6OutGroupMembQueries
884             || Icmp6InGroupMembResponses
885             || Icmp6OutGroupMembResponses
886             || Icmp6InGroupMembReductions
887             || Icmp6OutGroupMembReductions
888         ))) {
889         do_icmp_groupmemb = CONFIG_ONDEMAND_YES;
890         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".groupmemb");
891         if(unlikely(!st)) {
892             st = rrdset_create(RRD_TYPE_NET_SNMP6, "groupmemb", NULL, "icmp", NULL, "IPv6 ICMP Group Membership", "messages/s", 10300, update_every, RRDSET_TYPE_LINE);
893
894             rrddim_add(st, "InQueries", NULL, 1, 1, RRDDIM_INCREMENTAL);
895             rrddim_add(st, "OutQueries", NULL, -1, 1, RRDDIM_INCREMENTAL);
896             rrddim_add(st, "InResponses", NULL, 1, 1, RRDDIM_INCREMENTAL);
897             rrddim_add(st, "OutResponses", NULL, -1, 1, RRDDIM_INCREMENTAL);
898             rrddim_add(st, "InReductions", NULL, 1, 1, RRDDIM_INCREMENTAL);
899             rrddim_add(st, "OutReductions", NULL, -1, 1, RRDDIM_INCREMENTAL);
900         }
901         else rrdset_next(st);
902
903         rrddim_set(st, "InQueries", Icmp6InGroupMembQueries);
904         rrddim_set(st, "OutQueries", Icmp6OutGroupMembQueries);
905         rrddim_set(st, "InResponses", Icmp6InGroupMembResponses);
906         rrddim_set(st, "OutResponses", Icmp6OutGroupMembResponses);
907         rrddim_set(st, "InReductions", Icmp6InGroupMembReductions);
908         rrddim_set(st, "OutReductions", Icmp6OutGroupMembReductions);
909         rrdset_done(st);
910     }
911
912     // --------------------------------------------------------------------
913
914     if(do_icmp_router == CONFIG_ONDEMAND_YES || (do_icmp_router == CONFIG_ONDEMAND_ONDEMAND
915         && (
916             Icmp6InRouterSolicits
917             || Icmp6OutRouterSolicits
918             || Icmp6InRouterAdvertisements
919             || Icmp6OutRouterAdvertisements
920         ))) {
921         do_icmp_router = CONFIG_ONDEMAND_YES;
922         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmprouter");
923         if(unlikely(!st)) {
924             st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmprouter", NULL, "icmp", NULL, "IPv6 Router Messages", "messages/s", 10400, update_every, RRDSET_TYPE_LINE);
925
926             rrddim_add(st, "InSolicits", NULL, 1, 1, RRDDIM_INCREMENTAL);
927             rrddim_add(st, "OutSolicits", NULL, -1, 1, RRDDIM_INCREMENTAL);
928             rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRDDIM_INCREMENTAL);
929             rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRDDIM_INCREMENTAL);
930         }
931         else rrdset_next(st);
932
933         rrddim_set(st, "InSolicits", Icmp6InRouterSolicits);
934         rrddim_set(st, "OutSolicits", Icmp6OutRouterSolicits);
935         rrddim_set(st, "InAdvertisements", Icmp6InRouterAdvertisements);
936         rrddim_set(st, "OutAdvertisements", Icmp6OutRouterAdvertisements);
937         rrdset_done(st);
938     }
939
940     // --------------------------------------------------------------------
941
942     if(do_icmp_neighbor == CONFIG_ONDEMAND_YES || (do_icmp_neighbor == CONFIG_ONDEMAND_ONDEMAND
943         && (
944             Icmp6InNeighborSolicits
945             || Icmp6OutNeighborSolicits
946             || Icmp6InNeighborAdvertisements
947             || Icmp6OutNeighborAdvertisements
948         ))) {
949         do_icmp_neighbor = CONFIG_ONDEMAND_YES;
950         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmpneighbor");
951         if(unlikely(!st)) {
952             st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmpneighbor", NULL, "icmp", NULL, "IPv6 Neighbor Messages", "messages/s", 10500, update_every, RRDSET_TYPE_LINE);
953
954             rrddim_add(st, "InSolicits", NULL, 1, 1, RRDDIM_INCREMENTAL);
955             rrddim_add(st, "OutSolicits", NULL, -1, 1, RRDDIM_INCREMENTAL);
956             rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRDDIM_INCREMENTAL);
957             rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRDDIM_INCREMENTAL);
958         }
959         else rrdset_next(st);
960
961         rrddim_set(st, "InSolicits", Icmp6InNeighborSolicits);
962         rrddim_set(st, "OutSolicits", Icmp6OutNeighborSolicits);
963         rrddim_set(st, "InAdvertisements", Icmp6InNeighborAdvertisements);
964         rrddim_set(st, "OutAdvertisements", Icmp6OutNeighborAdvertisements);
965         rrdset_done(st);
966     }
967
968     // --------------------------------------------------------------------
969
970     if(do_icmp_mldv2 == CONFIG_ONDEMAND_YES || (do_icmp_mldv2 == CONFIG_ONDEMAND_ONDEMAND && (Icmp6InMLDv2Reports || Icmp6OutMLDv2Reports))) {
971         do_icmp_mldv2 = CONFIG_ONDEMAND_YES;
972         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmpmldv2");
973         if(unlikely(!st)) {
974             st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmpmldv2", NULL, "icmp", NULL, "IPv6 ICMP MLDv2 Reports", "reports/s", 10600, update_every, RRDSET_TYPE_LINE);
975
976             rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
977             rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
978         }
979         else rrdset_next(st);
980
981         rrddim_set(st, "sent", Icmp6InMLDv2Reports);
982         rrddim_set(st, "received", Icmp6OutMLDv2Reports);
983         rrdset_done(st);
984     }
985
986     // --------------------------------------------------------------------
987
988     if(do_icmp_types == CONFIG_ONDEMAND_YES || (do_icmp_types == CONFIG_ONDEMAND_ONDEMAND
989         && (
990             Icmp6InType1
991             || Icmp6InType128
992             || Icmp6InType129
993             || Icmp6InType136
994             || Icmp6OutType1
995             || Icmp6OutType128
996             || Icmp6OutType129
997             || Icmp6OutType133
998             || Icmp6OutType135
999             || Icmp6OutType143
1000         ))) {
1001         do_icmp_types = CONFIG_ONDEMAND_YES;
1002         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmptypes");
1003         if(unlikely(!st)) {
1004             st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmptypes", NULL, "icmp", NULL, "IPv6 ICMP Types", "messages/s", 10700, update_every, RRDSET_TYPE_LINE);
1005
1006             rrddim_add(st, "InType1", NULL, 1, 1, RRDDIM_INCREMENTAL);
1007             rrddim_add(st, "InType128", NULL, 1, 1, RRDDIM_INCREMENTAL);
1008             rrddim_add(st, "InType129", NULL, 1, 1, RRDDIM_INCREMENTAL);
1009             rrddim_add(st, "InType136", NULL, 1, 1, RRDDIM_INCREMENTAL);
1010             rrddim_add(st, "OutType1", NULL, -1, 1, RRDDIM_INCREMENTAL);
1011             rrddim_add(st, "OutType128", NULL, -1, 1, RRDDIM_INCREMENTAL);
1012             rrddim_add(st, "OutType129", NULL, -1, 1, RRDDIM_INCREMENTAL);
1013             rrddim_add(st, "OutType133", NULL, -1, 1, RRDDIM_INCREMENTAL);
1014             rrddim_add(st, "OutType135", NULL, -1, 1, RRDDIM_INCREMENTAL);
1015             rrddim_add(st, "OutType143", NULL, -1, 1, RRDDIM_INCREMENTAL);
1016         }
1017         else rrdset_next(st);
1018
1019         rrddim_set(st, "InType1", Icmp6InType1);
1020         rrddim_set(st, "InType128", Icmp6InType128);
1021         rrddim_set(st, "InType129", Icmp6InType129);
1022         rrddim_set(st, "InType136", Icmp6InType136);
1023         rrddim_set(st, "OutType1", Icmp6OutType1);
1024         rrddim_set(st, "OutType128", Icmp6OutType128);
1025         rrddim_set(st, "OutType129", Icmp6OutType129);
1026         rrddim_set(st, "OutType133", Icmp6OutType133);
1027         rrddim_set(st, "OutType135", Icmp6OutType135);
1028         rrddim_set(st, "OutType143", Icmp6OutType143);
1029         rrdset_done(st);
1030     }
1031
1032     // --------------------------------------------------------------------
1033
1034     if(do_ect == CONFIG_ONDEMAND_YES || (do_ect == CONFIG_ONDEMAND_ONDEMAND
1035         && (
1036             Ip6InNoECTPkts
1037             || Ip6InECT1Pkts
1038             || Ip6InECT0Pkts
1039             || Ip6InCEPkts
1040         ))) {
1041         do_ect = CONFIG_ONDEMAND_YES;
1042         st = rrdset_find(RRD_TYPE_NET_SNMP6 ".ect");
1043         if(unlikely(!st)) {
1044             st = rrdset_create(RRD_TYPE_NET_SNMP6, "ect", NULL, "packets", NULL, "IPv6 ECT Packets", "packets/s", 10800, update_every, RRDSET_TYPE_LINE);
1045
1046             rrddim_add(st, "InNoECTPkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
1047             rrddim_add(st, "InECT1Pkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
1048             rrddim_add(st, "InECT0Pkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
1049             rrddim_add(st, "InCEPkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
1050         }
1051         else rrdset_next(st);
1052
1053         rrddim_set(st, "InNoECTPkts", Ip6InNoECTPkts);
1054         rrddim_set(st, "InECT1Pkts", Ip6InECT1Pkts);
1055         rrddim_set(st, "InECT0Pkts", Ip6InECT0Pkts);
1056         rrddim_set(st, "InCEPkts", Ip6InCEPkts);
1057         rrdset_done(st);
1058     }
1059
1060     return 0;
1061 }
1062