Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/Makefile =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/Makefile (revision 311581) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/Makefile (revision 311582) @@ -1,24 +1,25 @@ # $FreeBSD$ # MOD= ipv6MIB SRCS+= ipv6.c SRCS+= ipv6_addrPrefixTable.c SRCS+= ipv6_addrTable.c SRCS+= ipv6_ifStatsTable.c SRCS+= ipv6_ifTable.c SRCS+= ipv6_netToMediaTable.c SRCS+= ipv6_routeTable.c +SRCS+= ipv6_sys.c XSYM= ${MOD} MAN= snmp_${MOD}.3 DEFS= ${MOD}_tree.def #INCS= snmp_${MOD}.h BMIBS= IPV6-MIB.txt CFLAGS+= -DSNMPTREE_TYPES .include Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6.c =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6.c (revision 311581) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6.c (revision 311582) @@ -1,145 +1,146 @@ /* * Copyright (c) 2017 Dell EMC Isilon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include "ipv6.h" +#include "ipv6_sys.h" #include "ipv6MIB_oid.h" static struct lmodule *module; static const struct asn_oid oid_ipv6MIB = OIDX_ipv6MIB; +uint32_t mib_ipv6_ipv6Interfaces; + uint64_t mib_ipv6_ipv6IfTableLastChange; static u_int ipv6_reg; int op_ipv6MIBObjects(struct snmp_context *ctx __unused, struct snmp_value *value, u_int sub, u_int iidx __unused, enum snmp_op op) { const char *namestr = NULL; int name[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 }; int result = 0; size_t resultsiz = sizeof(result); switch (op) { case SNMP_OP_GETNEXT: case SNMP_OP_GET: break; case SNMP_OP_SET: return (SNMP_ERR_NOT_WRITEABLE); case SNMP_OP_ROLLBACK: case SNMP_OP_COMMIT: return (SNMP_ERR_NOERROR); } switch (value->var.subs[sub - 1]) { case LEAF_ipv6Forwarding: name[3] = IPV6CTL_FORWARDING; namestr = "IPV6CTL_FORWARDING"; if (sysctl(name, nitems(name), &result, &resultsiz, NULL, 0) < 0) return (SNMP_ERR_GENERR); if (result == 0) value->v.integer = ipv6Forwarding_notForwarding; else value->v.integer = ipv6Forwarding_forwarding; break; case LEAF_ipv6DefaultHopLimit: name[3] = IPV6CTL_DEFHLIM; namestr = "IPV6CTL_DEFHLIM"; if (sysctl(name, nitems(name), &result, &resultsiz, NULL, 0) < 0) return (SNMP_ERR_GENERR); value->v.integer = result; break; case LEAF_ipv6IfTableLastChange: { - if (mib_ipv6_ipv6IfTableLastChange > start_tick) + mib_ipv6_refresh_interfaces(); + if (mib_ipv6_ipv6IfTableLastChange > start_tick) value->v.uint32 = mib_ipv6_ipv6IfTableLastChange - start_tick; else value->v.uint32 = 0; break; } case LEAF_ipv6Interfaces: - /* - * XXX (ngie): this incorrectly assumes that all interfaces - * are IPv6 enabled. - */ - /*value->v.integer = if_countifindex()*/; + mib_ipv6_refresh_interfaces(); + value->v.integer = mib_ipv6_ipv6Interfaces; break; default: return (SNMP_ERR_NOSUCHNAME); } return (SNMP_ERR_NOERROR); } static void ipv6MIB_start(void) { ipv6_reg = or_register(&oid_ipv6MIB, "The (incomplete) MIB module for RFC 2465.", module); } static int ipv6MIB_init(struct lmodule *mod, int argc __unused, char *argv[] __unused) { module = mod; return (0); } static int ipv6MIB_fini(void) { or_unregister(ipv6_reg); return (0); } const struct snmp_module config = { "This module implements RFC 2465.", ipv6MIB_init, ipv6MIB_fini, NULL, NULL, NULL, ipv6MIB_start, NULL, ipv6MIB_ctree, ipv6MIB_CTREE_SIZE, NULL }; Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6.h =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6.h (revision 311581) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6.h (revision 311582) @@ -1,34 +1,37 @@ /* * Copyright (c) 2017 Dell EMC Isilon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __SNMP_IPV6__IPV6_H__ #define __SNMP_IPV6__IPV6_H__ #include "ipv6MIB_tree.h" +extern uint32_t mib_ipv6_ipv6Interfaces; +extern uint64_t mib_ipv6_ipv6IfTableLastChange; + #endif Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_addrPrefixTable.c =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_addrPrefixTable.c (revision 311581) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_addrPrefixTable.c (revision 311582) @@ -1,66 +1,73 @@ /* * Copyright (c) 2017 Dell EMC Isilon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include -#include + #include #include "ipv6_addrPrefixTable.h" + +#if 0 +SLIST_HEAD(ipv6AddrPrefixTable, ipv6AddrPrefixEntry) + ipv6AddrPrefixTable_head = SLIST_HEAD_INITIALIZER(ipv6AddrPrefixTable); +struct ipv6AddrPrefixEntry *ipv6AddrPrefixTable; +SLIST_INIT(&ipv6AddrPrefixTable_head); +#endif int op_ipv6AddrPrefixTable(struct snmp_context *ctx __unused, struct snmp_value *value, u_int sub, u_int iidx __unused, enum snmp_op op) { asn_subid_t which; switch (op) { case SNMP_OP_GETNEXT: case SNMP_OP_GET: break; case SNMP_OP_SET: return (SNMP_ERR_NOT_WRITEABLE); case SNMP_OP_ROLLBACK: case SNMP_OP_COMMIT: return (SNMP_ERR_NOERROR); } which = value->var.subs[sub - 1]; switch (which) { case LEAF_ipv6AddrPrefixOnLinkFlag: case LEAF_ipv6AddrPrefixAutonomousFlag: case LEAF_ipv6AddrPrefixAdvPreferredLifetime: case LEAF_ipv6AddrPrefixAdvValidLifetime: default: return (SNMP_ERR_RES_UNAVAIL); } return (SNMP_ERR_NOERROR); } Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_addrPrefixTable.h =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_addrPrefixTable.h (revision 311581) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_addrPrefixTable.h (revision 311582) @@ -1,34 +1,49 @@ /* * Copyright (c) 2017 Dell EMC Isilon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __SNMP_IPV6__IPV6_ADDRPREFIXTABLE_H__ #define __SNMP_IPV6__IPV6_ADDRPREFIXTABLE_H__ #include "ipv6MIB_tree.h" +typedef struct ipv6AddrPrefixEntry { +#if 0 + SLIST_ENTRY(ipv6AddrPrefixEntry) entries; +#endif +/* + char *ipv6AddrPrefix; + u_int ipv6AddrPrefixLength; + */ + uint32_t ipv6AddrPrefixOnLinkFlag; + uint32_t ipv6AddrPrefixAutonomousFlag; + u_int ipv6AddrPrefixAdvPreferredLifetime; + u_int ipv6AddrPrefixAdvValidLifetime; + +} ipv6AddrPrefixEntry; + #endif Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_addrTable.h =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_addrTable.h (revision 311581) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_addrTable.h (revision 311582) @@ -1,34 +1,42 @@ /* * Copyright (c) 2017 Dell EMC Isilon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __SNMP_IPV6__IPV6_ADDRTABLE_H__ #define __SNMP_IPV6__IPV6_ADDRTABLE_H__ #include "ipv6MIB_tree.h" +typedef struct ipv6AddrEntry { + char * ipv6AddrAddress; + uint32_t ipv6AddrPfxLength; + uint32_t ipv6AddrType; + uint32_t ipv6AddrAnycastFlag; + uint32_t ipv6AddrStatus; +} ipv6AddrEntry; + #endif Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_ifStatsTable.h =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_ifStatsTable.h (revision 311581) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_ifStatsTable.h (revision 311582) @@ -1,34 +1,57 @@ /* * Copyright (c) 2017 Dell EMC Isilon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __SNMP_IPV6__IPV6_STATSTABLE_H__ #define __SNMP_IPV6__IPV6_STATSTABLE_H__ #include "ipv6MIB_tree.h" +typedef struct ipv6IfStatsEntry { + u_int ipv6IfStatsInReceives; + u_int ipv6IfStatsInHdrErrors; + u_int ipv6IfStatsInTooBigErrors; + u_int ipv6IfStatsInNoRoutes; + u_int ipv6IfStatsInAddrErrors; + u_int ipv6IfStatsInUnknownProtos; + u_int ipv6IfStatsInTruncatedPkts; + u_int ipv6IfStatsInDiscards; + u_int ipv6IfStatsInDelivers; + u_int ipv6IfStatsOutForwDatagrams; + u_int ipv6IfStatsOutRequests; + u_int ipv6IfStatsOutDiscards; + u_int ipv6IfStatsOutFragOKs; + u_int ipv6IfStatsOutFragFails; + u_int ipv6IfStatsOutFragCreates; + u_int ipv6IfStatsReasmReqds; + u_int ipv6IfStatsReasmOKs; + u_int ipv6IfStatsReasmFails; + u_int ipv6IfStatsInMcastPkts; + u_int ipv6IfStatsOutMcastPkts; +} ipv6IfStatsEntry; + #endif Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_ifTable.h =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_ifTable.h (revision 311581) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_ifTable.h (revision 311582) @@ -1,34 +1,52 @@ /*- * Copyright (c) 2017 Dell EMC Isilon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __SNMP_IPV6__IPV6_IFTABLE_H__ #define __SNMP_IPV6__IPV6_IFTABLE_H__ #include "ipv6MIB_tree.h" +typedef struct ipv6IfEntry { +/* + INTEGER ipv6IfIndex + */ + char *ipv6IfDescr; +/* + OID ipv6IfLowerLayer + */ + uint32_t ipv6IfEffectiveMtu; + uint32_t ipv6IfReasmMaxSize; + char *ipv6IfIdentifier; + u_int ipv6IfIdentifierLength; + char *ipv6IfPhysicalAddress; + uint32_t ipv6IfAdminStatus; + uint32_t ipv6IfOperStatus; + uint32_t ipv6IfLastChange; +} ipv6IfEntry; + #endif Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_routeTable.h =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_routeTable.h (revision 311581) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_routeTable.h (revision 311582) @@ -1,34 +1,56 @@ /* * Copyright (c) 2017 Dell EMC Isilon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef __SNMP_IPV6__IPV6_ROUTETABLE_H__ #define __SNMP_IPV6__IPV6_ROUTETABLE_H__ #include "ipv6MIB_tree.h" +typedef struct ipv6RouteEntry { +#if 0 + OCTETSTRING | Ipv6Address ipv6RouteDest + INTEGER ipv6RoutePfxLength + USIGNED32 ipv6RouteIndex +#endif + char *ipv6RouteNextHop; + uint32_t ipv6RouteIfIndex; + uint32_t ipv6RouteType; + uint32_t ipv6RouteProtocol; + int32_t ipv6RoutePolicy; + uint32_t ipv6RouteAge; + uint32_t ipv6RouteNextHopRDI; +#if 0 + UNSIGNED32 ipv6RouteIndex +#endif + uint32_t ipv6RouteMetric; + uint32_t ipv6RouteWeight; + void *ipv6RouteInfo; + uint32_t ipv6RouteValid; +} ipv6RouteEntry; + #endif Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_sys.c =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_sys.c (nonexistent) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_sys.c (revision 311582) @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017 Dell EMC Isilon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "ipv6.h" +#include "ipv6_sys.h" + +void +mib_ipv6_refresh_interfaces(void) +{ + + /* Refresh interfaces via MIB-II */ + + /* + * Take interface information from MIB-II and update cached interface + * structures + */ + + /* + * If there is a change between the cached interfaces and the + * retrieved interfaces, update the scalars. + */ + mib_ipv6_ipv6Interfaces = 0; + mib_ipv6_ipv6IfTableLastChange = this_tick; +} Property changes on: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_sys.c ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_sys.h =================================================================== --- projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_sys.h (nonexistent) +++ projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_sys.h (revision 311582) @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2017 Dell EMC Isilon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __SNMP_IPV6__IPV6_SYS_H__ +#define __SNMP_IPV6__IPV6_SYS_H__ + +void mib_ipv6_refresh_interfaces(void); + +#endif Property changes on: projects/bsnmp-ipv6-mib/usr.sbin/bsnmpd/modules/snmp_ipv6/ipv6_sys.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property