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