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