]> git.proxmox.com Git - mirror_frr.git/blob - eigrpd/eigrp_snmp.c
Merge pull request #6279 from opensourcerouting/nb-cb-args
[mirror_frr.git] / eigrpd / eigrp_snmp.c
1 /*
2 * EIGRP SNMP Support.
3 * Copyright (C) 2013-2014
4 * Authors:
5 * Donnie Savage
6 * Jan Janovic
7 * Matej Perina
8 * Peter Orsag
9 * Peter Paluch
10 *
11 * This file is part of GNU Zebra.
12 *
13 * GNU Zebra is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2, or (at your option) any
16 * later version.
17 *
18 * GNU Zebra is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; see the file COPYING; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 */
27
28 #include <zebra.h>
29
30 #ifdef HAVE_SNMP
31 #include <net-snmp/net-snmp-config.h>
32 #include <net-snmp/net-snmp-includes.h>
33
34 #include "thread.h"
35 #include "memory.h"
36 #include "linklist.h"
37 #include "prefix.h"
38 #include "if.h"
39 #include "table.h"
40 #include "sockunion.h"
41 #include "stream.h"
42 #include "log.h"
43 #include "sockopt.h"
44 #include "checksum.h"
45 #include "md5.h"
46 #include "keychain.h"
47 #include "smux.h"
48
49 #include "eigrpd/eigrp_structs.h"
50 #include "eigrpd/eigrpd.h"
51 #include "eigrpd/eigrp_interface.h"
52 #include "eigrpd/eigrp_neighbor.h"
53 #include "eigrpd/eigrp_packet.h"
54 #include "eigrpd/eigrp_zebra.h"
55 #include "eigrpd/eigrp_vty.h"
56 #include "eigrpd/eigrp_dump.h"
57 #include "eigrpd/eigrp_network.h"
58 #include "eigrpd/eigrp_topology.h"
59 #include "eigrpd/eigrp_fsm.h"
60 #include "eigrpd/eigrp_snmp.h"
61
62 struct list *eigrp_snmp_iflist;
63
64 /* Declare static local variables for convenience. */
65 SNMP_LOCAL_VARIABLES
66
67 /* EIGRP-MIB - 1.3.6.1.4.1.9.9.449.1*/
68 #define EIGRPMIB 1,3,6,1,4,1,9,9,449,1
69
70 /* EIGRP-MIB instances. */
71 oid eigrp_oid[] = {EIGRPMIB};
72
73 /* EIGRP VPN entry */
74 #define EIGRPVPNID 1
75 #define EIGRPVPNNAME 2
76
77 /* EIGRP Traffic statistics entry */
78 #define EIGRPASNUMBER 1
79 #define EIGRPNBRCOUNT 2
80 #define EIGRPHELLOSSENT 3
81 #define EIGRPHELLOSRCVD 4
82 #define EIGRPUPDATESSENT 5
83 #define EIGRPUPDATESRCVD 6
84 #define EIGRPQUERIESSENT 7
85 #define EIGRPQUERIESRCVD 8
86 #define EIGRPREPLIESSENT 9
87 #define EIGRPREPLIESRCVD 10
88 #define EIGRPACKSSENT 11
89 #define EIGRPACKSRCVD 12
90 #define EIGRPINPUTQHIGHMARK 13
91 #define EIGRPINPUTQDROPS 14
92 #define EIGRPSIAQUERIESSENT 15
93 #define EIGRPSIAQUERIESRCVD 16
94 #define EIGRPASROUTERIDTYPE 17
95 #define EIGRPASROUTERID 18
96 #define EIGRPTOPOROUTES 19
97 #define EIGRPHEADSERIAL 20
98 #define EIGRPNEXTSERIAL 21
99 #define EIGRPXMITPENDREPLIES 22
100 #define EIGRPXMITDUMMIES 23
101
102 /* EIGRP topology entry */
103 #define EIGRPDESTNETTYPE 1
104 #define EIGRPDESTNET 2
105 #define EIGRPDESTNETPREFIXLEN 4
106 #define EIGRPACTIVE 5
107 #define EIGRPSTUCKINACTIVE 6
108 #define EIGRPDESTSUCCESSORS 7
109 #define EIGRPFDISTANCE 8
110 #define EIGRPROUTEORIGINTYPE 9
111 #define EIGRPROUTEORIGINADDRTYPE 10
112 #define EIGRPROUTEORIGINADDR 11
113 #define EIGRPNEXTHOPADDRESSTYPE 12
114 #define EIGRPNEXTHOPADDRESS 13
115 #define EIGRPNEXTHOPINTERFACE 14
116 #define EIGRPDISTANCE 15
117 #define EIGRPREPORTDISTANCE 16
118
119 /* EIGRP peer entry */
120 #define EIGRPHANDLE 1
121 #define EIGRPPEERADDRTYPE 2
122 #define EIGRPPEERADDR 3
123 #define EIGRPPEERIFINDEX 4
124 #define EIGRPHOLDTIME 5
125 #define EIGRPUPTIME 6
126 #define EIGRPSRTT 7
127 #define EIGRPRTO 8
128 #define EIGRPPKTSENQUEUED 9
129 #define EIGRPLASTSEQ 10
130 #define EIGRPVERSION 11
131 #define EIGRPRETRANS 12
132 #define EIGRPRETRIES 13
133
134 /* EIGRP interface entry */
135 #define EIGRPPEERCOUNT 3
136 #define EIGRPXMITRELIABLEQ 4
137 #define EIGRPXMITUNRELIABLEQ 5
138 #define EIGRPMEANSRTT 6
139 #define EIGRPPACINGRELIABLE 7
140 #define EIGRPPACINGUNRELIABLE 8
141 #define EIGRPMFLOWTIMER 9
142 #define EIGRPPENDINGROUTES 10
143 #define EIGRPHELLOINTERVAL 11
144 #define EIGRPXMITNEXTSERIAL 12
145 #define EIGRPUMCASTS 13
146 #define EIGRPRMCASTS 14
147 #define EIGRPUUCASTS 15
148 #define EIGRPRUCASTS 16
149 #define EIGRPMCASTEXCEPTS 17
150 #define EIGRPCRPKTS 18
151 #define EIGRPACKSSUPPRESSED 19
152 #define EIGRPRETRANSSENT 20
153 #define EIGRPOOSRCVD 21
154 #define EIGRPAUTHMODE 22
155 #define EIGRPAUTHKEYCHAIN 23
156
157 /* SNMP value hack. */
158 #define COUNTER ASN_COUNTER
159 #define INTEGER ASN_INTEGER
160 #define GAUGE ASN_GAUGE
161 #define TIMETICKS ASN_TIMETICKS
162 #define IPADDRESS ASN_IPADDRESS
163 #define STRING ASN_OCTET_STR
164 #define IPADDRESSPREFIXLEN ASN_INTEGER
165 #define IPADDRESSTYPE ASN_INTEGER
166 #define INTERFACEINDEXORZERO ASN_INTEGER
167 #define UINTEGER ASN_UNSIGNED
168
169 /* Hook functions. */
170 static uint8_t *eigrpVpnEntry(struct variable *, oid *, size_t *, int, size_t *,
171 WriteMethod **);
172 static uint8_t *eigrpTraffStatsEntry(struct variable *, oid *, size_t *, int,
173 size_t *, WriteMethod **);
174 static uint8_t *eigrpTopologyEntry(struct variable *, oid *, size_t *, int,
175 size_t *, WriteMethod **);
176 static uint8_t *eigrpPeerEntry(struct variable *, oid *, size_t *, int,
177 size_t *, WriteMethod **);
178 static uint8_t *eigrpInterfaceEntry(struct variable *, oid *, size_t *, int,
179 size_t *, WriteMethod **);
180
181
182 struct variable eigrp_variables[] = {
183 /* EIGRP vpn variables */
184 {EIGRPVPNID, INTEGER, NOACCESS, eigrpVpnEntry, 4, {1, 1, 1, 1}},
185 {EIGRPVPNNAME, STRING, RONLY, eigrpVpnEntry, 4, {1, 1, 1, 2}},
186
187 /* EIGRP traffic stats variables */
188 {EIGRPASNUMBER,
189 UINTEGER,
190 NOACCESS,
191 eigrpTraffStatsEntry,
192 4,
193 {2, 1, 1, 1}},
194 {EIGRPNBRCOUNT, UINTEGER, RONLY, eigrpTraffStatsEntry, 4, {2, 1, 1, 2}},
195 {EIGRPHELLOSSENT,
196 COUNTER,
197 RONLY,
198 eigrpTraffStatsEntry,
199 4,
200 {2, 1, 1, 3}},
201 {EIGRPHELLOSRCVD,
202 COUNTER,
203 RONLY,
204 eigrpTraffStatsEntry,
205 4,
206 {2, 1, 1, 4}},
207 {EIGRPUPDATESSENT,
208 COUNTER,
209 RONLY,
210 eigrpTraffStatsEntry,
211 4,
212 {2, 1, 1, 5}},
213 {EIGRPUPDATESRCVD,
214 COUNTER,
215 RONLY,
216 eigrpTraffStatsEntry,
217 4,
218 {2, 1, 1, 6}},
219 {EIGRPQUERIESSENT,
220 COUNTER,
221 RONLY,
222 eigrpTraffStatsEntry,
223 4,
224 {2, 1, 1, 7}},
225 {EIGRPQUERIESRCVD,
226 COUNTER,
227 RONLY,
228 eigrpTraffStatsEntry,
229 4,
230 {2, 1, 1, 8}},
231 {EIGRPREPLIESSENT,
232 COUNTER,
233 RONLY,
234 eigrpTraffStatsEntry,
235 4,
236 {2, 1, 1, 9}},
237 {EIGRPREPLIESRCVD,
238 COUNTER,
239 RONLY,
240 eigrpTraffStatsEntry,
241 4,
242 {2, 1, 1, 10}},
243 {EIGRPACKSSENT, COUNTER, RONLY, eigrpTraffStatsEntry, 4, {2, 1, 1, 11}},
244 {EIGRPACKSRCVD, COUNTER, RONLY, eigrpTraffStatsEntry, 4, {2, 1, 1, 12}},
245 {EIGRPINPUTQHIGHMARK,
246 INTEGER,
247 RONLY,
248 eigrpTraffStatsEntry,
249 4,
250 {2, 1, 1, 13}},
251 {EIGRPINPUTQDROPS,
252 COUNTER,
253 RONLY,
254 eigrpTraffStatsEntry,
255 4,
256 {2, 1, 1, 14}},
257 {EIGRPSIAQUERIESSENT,
258 COUNTER,
259 RONLY,
260 eigrpTraffStatsEntry,
261 4,
262 {2, 1, 1, 15}},
263 {EIGRPSIAQUERIESRCVD,
264 COUNTER,
265 RONLY,
266 eigrpTraffStatsEntry,
267 4,
268 {2, 1, 1, 16}},
269 {EIGRPASROUTERIDTYPE,
270 IPADDRESSTYPE,
271 RONLY,
272 eigrpTraffStatsEntry,
273 4,
274 {2, 1, 1, 17}},
275 {EIGRPASROUTERID,
276 IPADDRESS,
277 RONLY,
278 eigrpTraffStatsEntry,
279 4,
280 {2, 1, 1, 18}},
281 {EIGRPTOPOROUTES,
282 COUNTER,
283 RONLY,
284 eigrpTraffStatsEntry,
285 4,
286 {2, 1, 1, 19}},
287 {EIGRPHEADSERIAL,
288 COUNTER,
289 RONLY,
290 eigrpTraffStatsEntry,
291 4,
292 {2, 1, 1, 20}},
293 {EIGRPNEXTSERIAL,
294 COUNTER,
295 RONLY,
296 eigrpTraffStatsEntry,
297 4,
298 {2, 1, 1, 21}},
299 {EIGRPXMITPENDREPLIES,
300 INTEGER,
301 RONLY,
302 eigrpTraffStatsEntry,
303 4,
304 {2, 1, 1, 22}},
305 {EIGRPXMITDUMMIES,
306 COUNTER,
307 RONLY,
308 eigrpTraffStatsEntry,
309 4,
310 {2, 1, 1, 23}},
311
312 /* EIGRP topology variables */
313 {EIGRPDESTNETTYPE,
314 IPADDRESSTYPE,
315 NOACCESS,
316 eigrpTopologyEntry,
317 4,
318 {3, 1, 1, 1}},
319 {EIGRPDESTNET,
320 IPADDRESSPREFIXLEN,
321 NOACCESS,
322 eigrpTopologyEntry,
323 4,
324 {3, 1, 1, 2}},
325 {EIGRPDESTNETPREFIXLEN,
326 IPADDRESSTYPE,
327 NOACCESS,
328 eigrpTopologyEntry,
329 4,
330 {3, 1, 1, 4}},
331 {EIGRPACTIVE, INTEGER, RONLY, eigrpTopologyEntry, 4, {3, 1, 1, 5}},
332 {EIGRPSTUCKINACTIVE,
333 INTEGER,
334 RONLY,
335 eigrpTopologyEntry,
336 4,
337 {3, 1, 1, 6}},
338 {EIGRPDESTSUCCESSORS,
339 INTEGER,
340 RONLY,
341 eigrpTopologyEntry,
342 4,
343 {3, 1, 1, 7}},
344 {EIGRPFDISTANCE, INTEGER, RONLY, eigrpTopologyEntry, 4, {3, 1, 1, 8}},
345 {EIGRPROUTEORIGINTYPE,
346 STRING,
347 RONLY,
348 eigrpTopologyEntry,
349 4,
350 {3, 1, 1, 9}},
351 {EIGRPROUTEORIGINADDRTYPE,
352 IPADDRESSTYPE,
353 RONLY,
354 eigrpTopologyEntry,
355 4,
356 {3, 1, 1, 10}},
357 {EIGRPROUTEORIGINADDR,
358 IPADDRESS,
359 RONLY,
360 eigrpTopologyEntry,
361 4,
362 {3, 1, 1, 11}},
363 {EIGRPNEXTHOPADDRESSTYPE,
364 IPADDRESSTYPE,
365 RONLY,
366 eigrpTopologyEntry,
367 4,
368 {3, 1, 1, 12}},
369 {EIGRPNEXTHOPADDRESS,
370 IPADDRESS,
371 RONLY,
372 eigrpTopologyEntry,
373 4,
374 {3, 1, 1, 13}},
375 {EIGRPNEXTHOPINTERFACE,
376 STRING,
377 RONLY,
378 eigrpTopologyEntry,
379 4,
380 {3, 1, 1, 14}},
381 {EIGRPDISTANCE, INTEGER, RONLY, eigrpTopologyEntry, 4, {3, 1, 1, 15}},
382 {EIGRPREPORTDISTANCE,
383 INTEGER,
384 RONLY,
385 eigrpTopologyEntry,
386 4,
387 {3, 1, 1, 16}},
388
389 /* EIGRP peer variables */
390 {EIGRPHANDLE, INTEGER, NOACCESS, eigrpPeerEntry, 4, {4, 1, 1, 1}},
391 {EIGRPPEERADDRTYPE,
392 IPADDRESSTYPE,
393 RONLY,
394 eigrpPeerEntry,
395 4,
396 {4, 1, 1, 2}},
397 {EIGRPPEERADDR, IPADDRESS, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 3}},
398 {EIGRPPEERIFINDEX,
399 INTERFACEINDEXORZERO,
400 RONLY,
401 eigrpPeerEntry,
402 4,
403 {4, 1, 1, 4}},
404 {EIGRPHOLDTIME, INTEGER, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 5}},
405 {EIGRPUPTIME, STRING, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 6}},
406 {EIGRPSRTT, INTEGER, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 7}},
407 {EIGRPRTO, INTEGER, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 8}},
408 {EIGRPPKTSENQUEUED, INTEGER, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 9}},
409 {EIGRPLASTSEQ, INTEGER, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 10}},
410 {EIGRPVERSION, STRING, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 11}},
411 {EIGRPRETRANS, COUNTER, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 12}},
412 {EIGRPRETRIES, INTEGER, RONLY, eigrpPeerEntry, 4, {4, 1, 1, 13}},
413
414 /* EIGRP interface variables */
415 {EIGRPPEERCOUNT, GAUGE, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 3}},
416 {EIGRPXMITRELIABLEQ,
417 GAUGE,
418 RONLY,
419 eigrpInterfaceEntry,
420 4,
421 {5, 1, 1, 4}},
422 {EIGRPXMITUNRELIABLEQ,
423 GAUGE,
424 RONLY,
425 eigrpInterfaceEntry,
426 4,
427 {5, 1, 1, 5}},
428 {EIGRPMEANSRTT, INTEGER, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 6}},
429 {EIGRPPACINGRELIABLE,
430 INTEGER,
431 RONLY,
432 eigrpInterfaceEntry,
433 4,
434 {5, 1, 1, 7}},
435 {EIGRPPACINGUNRELIABLE,
436 INTEGER,
437 RONLY,
438 eigrpInterfaceEntry,
439 4,
440 {5, 1, 1, 8}},
441 {EIGRPMFLOWTIMER, INTEGER, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 9}},
442 {EIGRPPENDINGROUTES,
443 GAUGE,
444 RONLY,
445 eigrpInterfaceEntry,
446 4,
447 {5, 1, 1, 10}},
448 {EIGRPHELLOINTERVAL,
449 INTEGER,
450 RONLY,
451 eigrpInterfaceEntry,
452 4,
453 {5, 1, 1, 11}},
454 {EIGRPXMITNEXTSERIAL,
455 COUNTER,
456 RONLY,
457 eigrpInterfaceEntry,
458 4,
459 {5, 1, 1, 12}},
460 {EIGRPUMCASTS, COUNTER, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 13}},
461 {EIGRPRMCASTS, COUNTER, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 14}},
462 {EIGRPUUCASTS, COUNTER, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 15}},
463 {EIGRPRUCASTS, COUNTER, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 16}},
464 {EIGRPMCASTEXCEPTS,
465 COUNTER,
466 RONLY,
467 eigrpInterfaceEntry,
468 4,
469 {5, 1, 1, 17}},
470 {EIGRPCRPKTS, COUNTER, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 18}},
471 {EIGRPACKSSUPPRESSED,
472 COUNTER,
473 RONLY,
474 eigrpInterfaceEntry,
475 4,
476 {5, 1, 1, 19}},
477 {EIGRPRETRANSSENT,
478 COUNTER,
479 RONLY,
480 eigrpInterfaceEntry,
481 4,
482 {5, 1, 1, 20}},
483 {EIGRPOOSRCVD, COUNTER, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 21}},
484 {EIGRPAUTHMODE, INTEGER, RONLY, eigrpInterfaceEntry, 4, {5, 1, 1, 22}},
485 {EIGRPAUTHKEYCHAIN,
486 STRING,
487 RONLY,
488 eigrpInterfaceEntry,
489 4,
490 {5, 1, 1, 23}}};
491
492 static struct eigrp_neighbor *eigrp_snmp_nbr_lookup(struct eigrp *eigrp,
493 struct in_addr *nbr_addr,
494 unsigned int *ifindex)
495 {
496 struct listnode *node, *nnode, *node2, *nnode2;
497 struct eigrp_interface *ei;
498 struct eigrp_neighbor *nbr;
499
500 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode, ei)) {
501 for (ALL_LIST_ELEMENTS(ei->nbrs, node2, nnode2, nbr)) {
502 if (IPV4_ADDR_SAME(&nbr->src, nbr_addr)) {
503 return nbr;
504 }
505 }
506 }
507 return NULL;
508 }
509
510 static struct eigrp_neighbor *
511 eigrp_snmp_nbr_lookup_next(struct in_addr *nbr_addr, unsigned int *ifindex,
512 int first)
513 {
514 struct listnode *node, *nnode, *node2, *nnode2;
515 struct eigrp_interface *ei;
516 struct eigrp_neighbor *nbr;
517 struct eigrp_neighbor *min = NULL;
518 struct eigrp *eigrp;
519
520 eigrp = eigrp_lookup();
521
522 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode, ei)) {
523 for (ALL_LIST_ELEMENTS(ei->nbrs, node2, nnode2, nbr)) {
524 if (first) {
525 if (!min)
526 min = nbr;
527 else if (ntohl(nbr->src.s_addr)
528 < ntohl(min->src.s_addr))
529 min = nbr;
530 } else if (ntohl(nbr->src.s_addr)
531 > ntohl(nbr_addr->s_addr)) {
532 if (!min)
533 min = nbr;
534 else if (ntohl(nbr->src.s_addr)
535 < ntohl(min->src.s_addr))
536 min = nbr;
537 }
538 }
539 }
540 if (min) {
541 *nbr_addr = min->src;
542 *ifindex = 0;
543 return min;
544 }
545 return NULL;
546 }
547
548 static struct eigrp_neighbor *eigrpNbrLookup(struct variable *v, oid *name,
549 size_t *length,
550 struct in_addr *nbr_addr,
551 unsigned int *ifindex, int exact)
552 {
553 unsigned int len;
554 int first;
555 struct eigrp_neighbor *nbr;
556 struct eigrp *eigrp;
557
558 eigrp = eigrp_lookup();
559
560 if (!eigrp)
561 return NULL;
562
563 if (exact) {
564 if (*length != v->namelen + IN_ADDR_SIZE + 1)
565 return NULL;
566
567 oid2in_addr(name + v->namelen, IN_ADDR_SIZE, nbr_addr);
568 *ifindex = name[v->namelen + IN_ADDR_SIZE];
569
570 return eigrp_snmp_nbr_lookup(eigrp, nbr_addr, ifindex);
571 } else {
572 first = 0;
573 len = *length - v->namelen;
574
575 if (len == 0)
576 first = 1;
577
578 if (len > IN_ADDR_SIZE)
579 len = IN_ADDR_SIZE;
580
581 oid2in_addr(name + v->namelen, len, nbr_addr);
582
583 len = *length - v->namelen - IN_ADDR_SIZE;
584 if (len >= 1)
585 *ifindex = name[v->namelen + IN_ADDR_SIZE];
586
587 nbr = eigrp_snmp_nbr_lookup_next(nbr_addr, ifindex, first);
588
589 if (nbr) {
590 *length = v->namelen + IN_ADDR_SIZE + 1;
591 oid_copy_addr(name + v->namelen, nbr_addr,
592 IN_ADDR_SIZE);
593 name[v->namelen + IN_ADDR_SIZE] = *ifindex;
594 return nbr;
595 }
596 }
597 return NULL;
598 }
599
600
601 static uint8_t *eigrpVpnEntry(struct variable *v, oid *name, size_t *length,
602 int exact, size_t *var_len,
603 WriteMethod **write_method)
604 {
605 struct eigrp *eigrp;
606
607 eigrp = eigrp_lookup();
608
609 /* Check whether the instance identifier is valid */
610 if (smux_header_generic(v, name, length, exact, var_len, write_method)
611 == MATCH_FAILED)
612 return NULL;
613
614 /* Return the current value of the variable */
615 switch (v->magic) {
616 case EIGRPVPNID: /* 1 */
617 /* The unique VPN identifier */
618 if (eigrp) {
619 return SNMP_INTEGER(1);
620 } else
621 return SNMP_INTEGER(0);
622 case EIGRPVPNNAME: /* 2 */
623 /* The name given to the VPN */
624 if (eigrp) {
625 return SNMP_INTEGER(1);
626 } else
627 return SNMP_INTEGER(0);
628 default:
629 return NULL;
630 }
631 return NULL;
632 }
633
634 static uint32_t eigrp_neighbor_count(struct eigrp *eigrp)
635 {
636 uint32_t count;
637 struct eigrp_interface *ei;
638 struct listnode *node, *node2, *nnode2;
639 struct eigrp_neighbor *nbr;
640
641 if (eigrp == NULL) {
642 return 0;
643 }
644
645 count = 0;
646 for (ALL_LIST_ELEMENTS_RO(eigrp->eiflist, node, ei)) {
647 for (ALL_LIST_ELEMENTS(ei->nbrs, node2, nnode2, nbr)) {
648 if (nbr->state == EIGRP_NEIGHBOR_UP)
649 count++;
650 }
651 }
652
653 return count;
654 }
655
656
657 static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
658 size_t *length, int exact, size_t *var_len,
659 WriteMethod **write_method)
660 {
661 struct eigrp *eigrp;
662 struct eigrp_interface *ei;
663 struct listnode *node, *nnode;
664 int counter;
665
666 eigrp = eigrp_lookup();
667
668 /* Check whether the instance identifier is valid */
669 if (smux_header_generic(v, name, length, exact, var_len, write_method)
670 == MATCH_FAILED)
671 return NULL;
672
673 /* Return the current value of the variable */
674 switch (v->magic) {
675 case EIGRPASNUMBER: /* 1 */
676 /* AS-number of this EIGRP instance. */
677 if (eigrp)
678 return SNMP_INTEGER(eigrp->AS);
679 else
680 return SNMP_INTEGER(0);
681 case EIGRPNBRCOUNT: /* 2 */
682 /* Neighbor count of this EIGRP instance */
683 if (eigrp)
684 return SNMP_INTEGER(eigrp_neighbor_count(eigrp));
685 else
686 return SNMP_INTEGER(0);
687 case EIGRPHELLOSSENT: /* 3 */
688 /* Hello packets output count */
689 if (eigrp) {
690 counter = 0;
691 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
692 ei)) {
693 counter += ei->hello_out;
694 }
695 return SNMP_INTEGER(counter);
696 } else
697 return SNMP_INTEGER(0);
698 case EIGRPHELLOSRCVD: /* 4 */
699 /* Hello packets input count */
700 if (eigrp) {
701 counter = 0;
702 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
703 ei)) {
704 counter += ei->hello_in;
705 }
706 return SNMP_INTEGER(counter);
707 } else
708 return SNMP_INTEGER(0);
709 case EIGRPUPDATESSENT: /* 5 */
710 /* Update packets output count */
711 if (eigrp) {
712 counter = 0;
713 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
714 ei)) {
715 counter += ei->update_out;
716 }
717 return SNMP_INTEGER(counter);
718 } else
719 return SNMP_INTEGER(0);
720 case EIGRPUPDATESRCVD: /* 6 */
721 /* Update packets input count */
722 if (eigrp) {
723 counter = 0;
724 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
725 ei)) {
726 counter += ei->update_in;
727 }
728 return SNMP_INTEGER(counter);
729 } else
730 return SNMP_INTEGER(0);
731 case EIGRPQUERIESSENT: /* 7 */
732 /* Querry packets output count */
733 if (eigrp) {
734 counter = 0;
735 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
736 ei)) {
737 counter += ei->query_out;
738 }
739 return SNMP_INTEGER(counter);
740 } else
741 return SNMP_INTEGER(0);
742 case EIGRPQUERIESRCVD: /* 8 */
743 /* Querry packets input count */
744 if (eigrp) {
745 counter = 0;
746 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
747 ei)) {
748 counter += ei->query_in;
749 }
750 return SNMP_INTEGER(counter);
751 } else
752 return SNMP_INTEGER(0);
753 case EIGRPREPLIESSENT: /* 9 */
754 /* Reply packets output count */
755 if (eigrp) {
756 counter = 0;
757 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
758 ei)) {
759 counter += ei->reply_out;
760 }
761 return SNMP_INTEGER(counter);
762 } else
763 return SNMP_INTEGER(0);
764 case EIGRPREPLIESRCVD: /* 10 */
765 /* Reply packets input count */
766 if (eigrp) {
767 counter = 0;
768 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
769 ei)) {
770 counter += ei->reply_in;
771 }
772 return SNMP_INTEGER(counter);
773 } else
774 return SNMP_INTEGER(0);
775 case EIGRPACKSSENT: /* 11 */
776 /* Acknowledgement packets output count */
777 if (eigrp) {
778 counter = 0;
779 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
780 ei)) {
781 counter += ei->ack_out;
782 }
783 return SNMP_INTEGER(counter);
784 } else
785 return SNMP_INTEGER(0);
786 case EIGRPACKSRCVD: /* 12 */
787 /* Acknowledgement packets input count */
788 if (eigrp) {
789 counter = 0;
790 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
791 ei)) {
792 counter += ei->ack_in;
793 }
794 return SNMP_INTEGER(counter);
795 } else
796 return SNMP_INTEGER(0);
797 case EIGRPINPUTQHIGHMARK: /* 13 */
798 /* The highest number of EIGRP packets in the input queue */
799 if (eigrp) {
800 return SNMP_INTEGER(1);
801 } else
802 return SNMP_INTEGER(0);
803 case EIGRPINPUTQDROPS: /* 14 */
804 /* The number of EIGRP packets dropped from the input queue */
805 if (eigrp) {
806 return SNMP_INTEGER(1);
807 } else
808 return SNMP_INTEGER(0);
809 case EIGRPSIAQUERIESSENT: /* 15 */
810 /* SIA querry packets output count */
811 if (eigrp) {
812 counter = 0;
813 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
814 ei)) {
815 counter += ei->siaQuery_out;
816 }
817 return SNMP_INTEGER(counter);
818 } else
819 return SNMP_INTEGER(0);
820 case EIGRPSIAQUERIESRCVD: /* 16 */
821 /* SIA querry packets input count */
822 if (eigrp) {
823 counter = 0;
824 for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode,
825 ei)) {
826 counter += ei->siaQuery_in;
827 }
828 return SNMP_INTEGER(counter);
829 } else
830 return SNMP_INTEGER(0);
831 case EIGRPASROUTERIDTYPE: /* 17 */
832 /* Whether the router ID is set manually or automatically */
833 if (eigrp)
834 if (eigrp->router_id_static != 0)
835 return SNMP_INTEGER(1);
836 else
837 return SNMP_INTEGER(1);
838 else
839 return SNMP_INTEGER(0);
840 case EIGRPASROUTERID: /* 18 */
841 /* Router ID for this EIGRP AS */
842 if (eigrp)
843 if (eigrp->router_id_static != 0)
844 return SNMP_INTEGER(eigrp->router_id_static);
845 else
846 return SNMP_INTEGER(eigrp->router_id);
847 else
848 return SNMP_INTEGER(0);
849 case EIGRPTOPOROUTES: /* 19 */
850 /* The total number of EIGRP derived routes currently existing
851 in the topology table for the AS */
852 if (eigrp) {
853 return SNMP_INTEGER(1);
854 } else
855 return SNMP_INTEGER(0);
856 case EIGRPHEADSERIAL: /* 20 */
857 /* The serial number of the first route in the internal
858 sequence for an AS*/
859 if (eigrp) {
860 return SNMP_INTEGER(1);
861 } else
862 return SNMP_INTEGER(0);
863 case EIGRPNEXTSERIAL: /* 21 */
864 /* The serial number that would be assigned to the next new
865 or changed route in the topology table for the AS*/
866 if (eigrp) {
867 return SNMP_INTEGER(1);
868 } else
869 return SNMP_INTEGER(0);
870 case EIGRPXMITPENDREPLIES: /* 22 */
871 /* Total number of outstanding replies expected to queries
872 that have been sent to peers in the current AS*/
873 if (eigrp) {
874 return SNMP_INTEGER(1);
875 } else
876 return SNMP_INTEGER(0);
877 case EIGRPXMITDUMMIES: /* 23 */
878 /* Total number of currently existing dummies associated with
879 * the AS*/
880 if (eigrp) {
881 return SNMP_INTEGER(1);
882 } else
883 return SNMP_INTEGER(0);
884 default:
885 return NULL;
886 }
887 return NULL;
888 }
889
890 static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
891 size_t *length, int exact, size_t *var_len,
892 WriteMethod **write_method)
893 {
894 struct eigrp *eigrp;
895
896 eigrp = eigrp_lookup();
897
898 /* Check whether the instance identifier is valid */
899 if (smux_header_generic(v, name, length, exact, var_len, write_method)
900 == MATCH_FAILED)
901 return NULL;
902
903 /* Return the current value of the variable */
904 switch (v->magic) {
905 case EIGRPDESTNETTYPE: /* 1 */
906 /* The format of the destination IP network number for a single
907 route in the topology table*/
908 if (eigrp) {
909 return SNMP_INTEGER(1);
910 } else
911 return SNMP_INTEGER(0);
912 case EIGRPDESTNET: /* 2 */
913 /* The destination IP network number for a single route in the
914 * topology table*/
915 if (eigrp) {
916 return SNMP_INTEGER(1);
917 } else
918 return SNMP_INTEGER(0);
919 case EIGRPDESTNETPREFIXLEN: /* 4 */
920 /* The prefix length associated with the destination IP network
921 address
922 for a single route in the topology table in the AS*/
923 if (eigrp) {
924 return SNMP_INTEGER(1);
925 } else
926 return SNMP_INTEGER(0);
927 case EIGRPACTIVE: /* 5 */
928 /* A value of true(1) indicates the route to the destination
929 network has failed
930 A value of false(2) indicates the route is stable
931 (passive).*/
932 if (eigrp) {
933 return SNMP_INTEGER(1);
934 } else
935 return SNMP_INTEGER(0);
936 case EIGRPSTUCKINACTIVE: /* 6 */
937 /* A value of true(1) indicates that that this route which is in
938 active state
939 has not received any replies to queries for alternate paths
940 */
941 if (eigrp) {
942 return SNMP_INTEGER(1);
943 } else
944 return SNMP_INTEGER(0);
945 case EIGRPDESTSUCCESSORS: /* 7 */
946 /* Next routing hop for a path to the destination IP network */
947 if (eigrp) {
948 return SNMP_INTEGER(1);
949 } else
950 return SNMP_INTEGER(0);
951 case EIGRPFDISTANCE: /* 8 */
952 /* Minimum distance from this router to the destination IP
953 * network */
954 if (eigrp) {
955 return SNMP_INTEGER(1);
956 } else
957 return SNMP_INTEGER(0);
958 case EIGRPROUTEORIGINTYPE: /* 9 */
959 /* Text string describing the internal origin of the EIGRP route
960 */
961 if (eigrp) {
962 return SNMP_INTEGER(1);
963 } else
964 return SNMP_INTEGER(0);
965 case EIGRPROUTEORIGINADDRTYPE: /* 10 */
966 /* The format of the IP address defined as the origin of this
967 topology route entry */
968 if (eigrp) {
969 return SNMP_INTEGER(1);
970 } else
971 return SNMP_INTEGER(0);
972 case EIGRPROUTEORIGINADDR: /* 11 */
973 /* If the origin of the topology route entry is external to this
974 router,
975 then this object is the IP address of the router from which
976 it originated */
977 if (eigrp) {
978 return SNMP_INTEGER(1);
979 } else
980 return SNMP_INTEGER(0);
981 case EIGRPNEXTHOPADDRESSTYPE: /* 12 */
982 /* The format of the next hop IP address */
983 if (eigrp) {
984 return SNMP_INTEGER(1);
985 } else
986 return SNMP_INTEGER(0);
987 case EIGRPNEXTHOPADDRESS: /* 13 */
988 /* Next hop IP address for the route */
989 if (eigrp) {
990 return SNMP_INTEGER(1);
991 } else
992 return SNMP_INTEGER(0);
993 case EIGRPNEXTHOPINTERFACE: /* 14 */
994 /* The interface through which the next hop IP address is
995 * reached */
996 if (eigrp) {
997 return SNMP_INTEGER(1);
998 } else
999 return SNMP_INTEGER(0);
1000 case EIGRPDISTANCE: /* 15 */
1001 /* The computed distance to the destination network entry from
1002 * this router */
1003 if (eigrp) {
1004 return SNMP_INTEGER(1);
1005 } else
1006 return SNMP_INTEGER(0);
1007 case EIGRPREPORTDISTANCE: /* 16 */
1008 /* The computed distance to the destination network in the
1009 topology entry
1010 reported to this router by the originator of this route */
1011 if (eigrp) {
1012 return SNMP_INTEGER(1);
1013 } else
1014 return SNMP_INTEGER(0);
1015 default:
1016 return NULL;
1017 }
1018 return NULL;
1019 }
1020
1021 static uint8_t *eigrpPeerEntry(struct variable *v, oid *name, size_t *length,
1022 int exact, size_t *var_len,
1023 WriteMethod **write_method)
1024 {
1025 struct eigrp *eigrp;
1026 struct eigrp_interface *ei;
1027 struct eigrp_neighbor *nbr;
1028 struct in_addr nbr_addr;
1029 unsigned int ifindex;
1030
1031 eigrp = eigrp_lookup();
1032
1033 /* Check whether the instance identifier is valid */
1034 if (smux_header_generic(v, name, length, exact, var_len, write_method)
1035 == MATCH_FAILED)
1036 return NULL;
1037
1038 memset(&nbr_addr, 0, sizeof(struct in_addr));
1039 ifindex = 0;
1040
1041 nbr = eigrpNbrLookup(v, name, length, &nbr_addr, &ifindex, exact);
1042 if (!nbr)
1043 return NULL;
1044 ei = nbr->ei;
1045 if (!ei)
1046 return NULL;
1047
1048 /* Return the current value of the variable */
1049 switch (v->magic) {
1050 case EIGRPHANDLE: /* 1 */
1051 /* The unique internal identifier for the peer in the AS */
1052 if (eigrp) {
1053 return SNMP_INTEGER(1);
1054 } else
1055 return SNMP_INTEGER(0);
1056 case EIGRPPEERADDRTYPE: /* 2 */
1057 /* The format of the remote source IP address used by the peer
1058 */
1059 if (eigrp) {
1060 return SNMP_INTEGER(1);
1061 } else
1062 return SNMP_INTEGER(0);
1063 case EIGRPPEERADDR: /* 3 */
1064 /* The source IP address used by the peer */
1065 if (eigrp) {
1066 return SNMP_INTEGER(1);
1067 } else
1068 return SNMP_INTEGER(0);
1069 case EIGRPPEERIFINDEX: /* 4 */
1070 /* The ifIndex of the interface on this router */
1071 if (eigrp) {
1072 return SNMP_INTEGER(1);
1073 } else
1074 return SNMP_INTEGER(0);
1075 case EIGRPHOLDTIME: /* 5 */
1076 /* How much time must pass without receiving a hello packet from
1077 this
1078 EIGRP peer before this router declares the peer down */
1079 if (eigrp) {
1080 return SNMP_INTEGER(1);
1081 } else
1082 return SNMP_INTEGER(0);
1083 case EIGRPUPTIME: /* 6 */
1084 /* The elapsed time since the EIGRP adjacency was first
1085 * established */
1086 if (eigrp) {
1087 return SNMP_INTEGER(1);
1088 } else
1089 return SNMP_INTEGER(0);
1090 case EIGRPSRTT: /* 7 */
1091 /* The computed smooth round trip time for packets to and from
1092 * the peer */
1093 if (eigrp) {
1094 return SNMP_INTEGER(1);
1095 } else
1096 return SNMP_INTEGER(0);
1097 case EIGRPRTO: /* 8 */
1098 /* The computed retransmission timeout for the peer */
1099 if (eigrp) {
1100 return SNMP_INTEGER(1);
1101 } else
1102 return SNMP_INTEGER(0);
1103 case EIGRPPKTSENQUEUED: /* 9 */
1104 /* The number of any EIGRP packets currently enqueued */
1105 if (eigrp) {
1106 return SNMP_INTEGER(1);
1107 } else
1108 return SNMP_INTEGER(0);
1109 case EIGRPLASTSEQ: /* 10 */
1110 /* sequence number of the last EIGRP packet sent to this peer */
1111 if (eigrp) {
1112 return SNMP_INTEGER(1);
1113 } else
1114 return SNMP_INTEGER(0);
1115 case EIGRPVERSION: /* 11 */
1116 /* The EIGRP version information reported by the remote peer */
1117 if (eigrp) {
1118 return SNMP_INTEGER(1);
1119 } else
1120 return SNMP_INTEGER(0);
1121 case EIGRPRETRANS: /* 12 */
1122 /* The cumulative number of retransmissions to this peer */
1123 if (eigrp) {
1124 return SNMP_INTEGER(1);
1125 } else
1126 return SNMP_INTEGER(0);
1127 case EIGRPRETRIES: /* 13 */
1128 /* The number of times the current unacknowledged packet has
1129 * been retried */
1130 if (eigrp) {
1131 return SNMP_INTEGER(1);
1132 } else
1133 return SNMP_INTEGER(0);
1134 default:
1135 return NULL;
1136 }
1137 return NULL;
1138 }
1139
1140 static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
1141 size_t *length, int exact, size_t *var_len,
1142 WriteMethod **write_method)
1143 {
1144 struct eigrp *eigrp;
1145 struct listnode *node, *nnode;
1146 struct keychain *keychain;
1147 struct list *keylist;
1148
1149 eigrp = eigrp_lookup();
1150
1151 /* Check whether the instance identifier is valid */
1152 if (smux_header_generic(v, name, length, exact, var_len, write_method)
1153 == MATCH_FAILED)
1154 return NULL;
1155
1156 /* Return the current value of the variable */
1157 switch (v->magic) {
1158 case EIGRPPEERCOUNT: /* 3 */
1159 /* The number of EIGRP adjacencies currently formed with
1160 peers reached through this interface */
1161 if (eigrp) {
1162 return SNMP_INTEGER(eigrp_neighbor_count(eigrp));
1163 } else
1164 return SNMP_INTEGER(0);
1165 case EIGRPXMITRELIABLEQ: /* 4 */
1166 /* The number of EIGRP packets currently waiting in the reliable
1167 transport transmission queue */
1168 if (eigrp) {
1169 return SNMP_INTEGER(1);
1170 } else
1171 return SNMP_INTEGER(0);
1172 case EIGRPXMITUNRELIABLEQ: /* 5 */
1173 /* The number of EIGRP packets currently waiting in the
1174 unreliable
1175 transport transmission queue */
1176 if (eigrp) {
1177 return SNMP_INTEGER(1);
1178 } else
1179 return SNMP_INTEGER(0);
1180 case EIGRPMEANSRTT: /* 6 */
1181 /* The average of all the computed smooth round trip time values
1182 for a packet to and from all peers established on this
1183 interface */
1184 if (eigrp) {
1185 return SNMP_INTEGER(1);
1186 } else
1187 return SNMP_INTEGER(0);
1188 case EIGRPPACINGRELIABLE: /* 7 */
1189 /* The configured time interval between EIGRP packet
1190 * transmissions */
1191 if (eigrp) {
1192 return SNMP_INTEGER(1);
1193 } else
1194 return SNMP_INTEGER(0);
1195 case EIGRPPACINGUNRELIABLE: /* 8 */
1196 /* The configured time interval between EIGRP packet
1197 transmissions
1198 on the interface when the unreliable transport method is used
1199 */
1200 if (eigrp) {
1201 return SNMP_INTEGER(1);
1202 } else
1203 return SNMP_INTEGER(0);
1204 case EIGRPMFLOWTIMER: /* 9 */
1205 /* The configured multicast flow control timer value */
1206 if (eigrp) {
1207 return SNMP_INTEGER(1);
1208 } else
1209 return SNMP_INTEGER(0);
1210 case EIGRPPENDINGROUTES: /* 10 */
1211 /* The number of queued EIGRP routing updates awaiting
1212 * transmission */
1213 if (eigrp) {
1214 return SNMP_INTEGER(1);
1215 } else
1216 return SNMP_INTEGER(0);
1217 case EIGRPHELLOINTERVAL: /* 11 */
1218 /* The configured time interval between Hello packet
1219 * transmissions */
1220 if (eigrp) {
1221 return SNMP_INTEGER(1);
1222 } else
1223 return SNMP_INTEGER(0);
1224 case EIGRPXMITNEXTSERIAL: /* 12 */
1225 /* The serial number of the next EIGRP packet that is to be
1226 queued
1227 for transmission */
1228 if (eigrp) {
1229 return SNMP_INTEGER(1);
1230 } else
1231 return SNMP_INTEGER(0);
1232 case EIGRPUMCASTS: /* 13 */
1233 /* The total number of unreliable EIGRP multicast packets sent
1234 on this interface */
1235 if (eigrp) {
1236 return SNMP_INTEGER(1);
1237 } else
1238 return SNMP_INTEGER(0);
1239 case EIGRPRMCASTS: /* 14 */
1240 /* The total number of reliable EIGRP multicast packets sent
1241 on this interface */
1242 if (eigrp) {
1243 return SNMP_INTEGER(1);
1244 } else
1245 return SNMP_INTEGER(0);
1246 case EIGRPUUCASTS: /* 15 */
1247 /* The total number of unreliable EIGRP unicast packets sent
1248 on this interface */
1249 if (eigrp) {
1250 return SNMP_INTEGER(1);
1251 } else
1252 return SNMP_INTEGER(0);
1253 case EIGRPRUCASTS: /* 16 */
1254 /* The total number of reliable EIGRP unicast packets sent
1255 on this interface */
1256 if (eigrp) {
1257 return SNMP_INTEGER(1);
1258 } else
1259 return SNMP_INTEGER(0);
1260 case EIGRPMCASTEXCEPTS: /* 17 */
1261 /* The total number of EIGRP multicast exception transmissions
1262 */
1263 if (eigrp) {
1264 return SNMP_INTEGER(1);
1265 } else
1266 return SNMP_INTEGER(0);
1267 case EIGRPCRPKTS: /* 18 */
1268 /* The total number EIGRP Conditional-Receive packets sent on
1269 * this interface */
1270 if (eigrp) {
1271 return SNMP_INTEGER(1);
1272 } else
1273 return SNMP_INTEGER(0);
1274 case EIGRPACKSSUPPRESSED: /* 19 */
1275 /* The total number of individual EIGRP acknowledgement packets
1276 that have been
1277 suppressed and combined in an already enqueued outbound
1278 reliable packet on this interface */
1279 if (eigrp) {
1280 return SNMP_INTEGER(1);
1281 } else
1282 return SNMP_INTEGER(0);
1283 case EIGRPRETRANSSENT: /* 20 */
1284 /* The total number EIGRP packet retransmissions sent on the
1285 * interface */
1286 if (eigrp) {
1287 return SNMP_INTEGER(1);
1288 } else
1289 return SNMP_INTEGER(0);
1290 case EIGRPOOSRCVD: /* 21 */
1291 /* The total number of out-of-sequence EIGRP packets received */
1292 if (eigrp) {
1293 return SNMP_INTEGER(1);
1294 } else
1295 return SNMP_INTEGER(0);
1296 case EIGRPAUTHMODE: /* 22 */
1297 /* The EIGRP authentication mode of the interface */
1298 if (eigrp) {
1299 return SNMP_INTEGER(1);
1300 } else
1301 return SNMP_INTEGER(0);
1302 case EIGRPAUTHKEYCHAIN: /* 23 */
1303 /* The name of the authentication key-chain configured
1304 on this interface. */
1305 keylist = keychain_list_get();
1306 for (ALL_LIST_ELEMENTS(keylist, node, nnode, keychain)) {
1307 return (uint8_t *)keychain->name;
1308 }
1309 if (eigrp && keychain) {
1310 *var_len = str_len(keychain->name);
1311 return (uint8_t *)keychain->name;
1312 } else
1313 return (uint8_t *)"TEST";
1314 break;
1315 default:
1316 return NULL;
1317 }
1318 return NULL;
1319 }
1320
1321 /* Register EIGRP-MIB. */
1322 void eigrp_snmp_init()
1323 {
1324 eigrp_snmp_iflist = list_new();
1325 smux_init(eigrp_om->master);
1326 REGISTER_MIB("ciscoEigrpMIB", eigrp_variables, variable, eigrp_oid);
1327 }
1328 #endif