| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
We should probably prevent any type of namespace collision
with something else.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
|
|
|
|
|
|
| |
Let's find a better name for it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
|
|
|
|
|
|
|
| |
Convert the `struct thread_master` to `struct event_master`
across the code base.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This is a first in a series of commits, whose goal is to rename
the thread system in FRR to an event system. There is a continual
problem where people are confusing `struct thread` with a true
pthread. In reality, our entire thread.c is an event system.
In this commit rename the thread.[ch] files to event.[ch].
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
|
|
|
|
|
|
| |
Done with a combination of regex'ing and banging my head against a wall.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
| |
When shutting down ensure that any daemon operating with
snmp tells it to stop operating so no more data is sent.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
|
|
|
|
|
|
| |
FRR is using this as a bool. Let's just use a bool.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
http://www.circitor.fr/Mibs/Mib/B/BGP4V2-MIB.mib
Compared with Arista BGP4V2-MIB implementation, almost identical (despite that
Arista has slightly some additional MIBs).
Example:
```
iso.3.6.1.3.5.1.1.2.1.1.1.4.192.168.10.64 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.1.1.4.192.168.10.65 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.1.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.1.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.1.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.2.1.4.192.168.10.64 = INTEGER: 0
iso.3.6.1.3.5.1.1.2.1.2.1.4.192.168.10.65 = INTEGER: 0
iso.3.6.1.3.5.1.1.2.1.2.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = INTEGER: 2
iso.3.6.1.3.5.1.1.2.1.2.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = INTEGER: 0
iso.3.6.1.3.5.1.1.2.1.2.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = INTEGER: 0
iso.3.6.1.3.5.1.1.2.1.3.1.4.192.168.10.64 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.3.1.4.192.168.10.65 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.3.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Hex-STRING: 2A 02 47 80 01 23 00 00 00 00 00 00 00 00 00 01
iso.3.6.1.3.5.1.1.2.1.3.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.3.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.4.1.4.192.168.10.64 = INTEGER: 0
iso.3.6.1.3.5.1.1.2.1.4.1.4.192.168.10.65 = INTEGER: 0
iso.3.6.1.3.5.1.1.2.1.4.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = INTEGER: 2
iso.3.6.1.3.5.1.1.2.1.4.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = INTEGER: 0
iso.3.6.1.3.5.1.1.2.1.4.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = INTEGER: 0
iso.3.6.1.3.5.1.1.2.1.5.1.4.192.168.10.64 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.5.1.4.192.168.10.65 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.5.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Hex-STRING: 2A 02 47 80 01 23 00 00 00 00 00 00 00 00 00 02
iso.3.6.1.3.5.1.1.2.1.5.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.5.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.6.1.4.192.168.10.64 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.6.1.4.192.168.10.65 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.6.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 179
iso.3.6.1.3.5.1.1.2.1.6.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.6.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.7.1.4.192.168.10.64 = Gauge32: 65000
iso.3.6.1.3.5.1.1.2.1.7.1.4.192.168.10.65 = Gauge32: 65000
iso.3.6.1.3.5.1.1.2.1.7.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 65000
iso.3.6.1.3.5.1.1.2.1.7.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 65000
iso.3.6.1.3.5.1.1.2.1.7.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 65000
iso.3.6.1.3.5.1.1.2.1.8.1.4.192.168.10.64 = Hex-STRING: C0 00 02 FC
iso.3.6.1.3.5.1.1.2.1.8.1.4.192.168.10.65 = Hex-STRING: C0 00 02 FC
iso.3.6.1.3.5.1.1.2.1.8.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Hex-STRING: C0 00 02 FC
iso.3.6.1.3.5.1.1.2.1.8.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Hex-STRING: C0 00 02 FC
iso.3.6.1.3.5.1.1.2.1.8.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Hex-STRING: C0 00 02 FC
iso.3.6.1.3.5.1.1.2.1.9.1.4.192.168.10.64 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.9.1.4.192.168.10.65 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.9.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 54814
iso.3.6.1.3.5.1.1.2.1.9.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.9.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 0
iso.3.6.1.3.5.1.1.2.1.10.1.4.192.168.10.64 = Gauge32: 65002
iso.3.6.1.3.5.1.1.2.1.10.1.4.192.168.10.65 = Gauge32: 65002
iso.3.6.1.3.5.1.1.2.1.10.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Gauge32: 65002
iso.3.6.1.3.5.1.1.2.1.10.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Gauge32: 65001
iso.3.6.1.3.5.1.1.2.1.10.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Gauge32: 65001
iso.3.6.1.3.5.1.1.2.1.11.1.4.192.168.10.64 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.11.1.4.192.168.10.65 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.11.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = STRING: "dddd"
iso.3.6.1.3.5.1.1.2.1.11.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.11.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = Hex-STRING: 00 00 00 00
iso.3.6.1.3.5.1.1.2.1.12.1.4.192.168.10.64 = INTEGER: 2
iso.3.6.1.3.5.1.1.2.1.12.1.4.192.168.10.65 = INTEGER: 2
iso.3.6.1.3.5.1.1.2.1.12.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = INTEGER: 2
iso.3.6.1.3.5.1.1.2.1.12.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = INTEGER: 2
iso.3.6.1.3.5.1.1.2.1.12.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = INTEGER: 2
iso.3.6.1.3.5.1.1.2.1.13.1.4.192.168.10.64 = INTEGER: 1
iso.3.6.1.3.5.1.1.2.1.13.1.4.192.168.10.65 = INTEGER: 3
iso.3.6.1.3.5.1.1.2.1.13.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = INTEGER: 1
iso.3.6.1.3.5.1.1.2.1.13.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.121 = INTEGER: 3
iso.3.6.1.3.5.1.1.2.1.13.2.16.42.12.47.7.72.150.6.102.0.0.0.0.0.0.177.128 = INTEGER: 1
iso.3.6.1.3.5.1.1.2.1.14.1.4.192.168.10.64 = Hex-STRING: 4F 4B 00
iso.3.6.1.3.5.1.1.2.1.14.1.4.192.168.10.65 = Hex-STRING: 4F 4B 32 00
iso.3.6.1.3.5.1.1.2.1.14.2.16.42.2.71.128.1.35.0.0.0.0.0.0.0.0.0.2 = Hex-STRING: 69 70 76 36 00
```
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
|
|
|
|
|
|
|
| |
Do not overload the v4 oid_copy_addr function for ipv6
coverity does not like this kind of thing.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
|
|
|
|
|
|
| |
See previous commit.
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|\
| |
| | |
isisd: add support for read-only snmp mibs objects
|
| |
| |
| |
| |
| |
| |
| | |
Add support for read only mib objects from RFC4444.
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
|
|\ \
| | |
| | | |
lib: add agentx_enabled hook
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Adding agentx_enabled hook.
This permits the main LDP process to signal the lde and ldpe
processes when agentx is enabled.
Signed-off-by: Karen Schoener <karen@voltanet.io>
|
| |/
|/|
| |
| |
| |
| |
| |
| | |
The existing code was using the oid2in_addr API to copy IPv6
addresses passing an IPv6 length. Create a utility to do this
properly and avoid annoying coverity with type checking.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The return code from smux_trap is never used. If we have
never used it after all this time. Remove the return from
the function.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The function smux_trap only allows the paaasin of one index which is
applied to all indexed objects. However there is a requirement for
differently indexed objects within a singe trap. This commit
introduces a new function smux_trap_multi_index which can be called
with an array of indices. If this array is onf length 1 the original
smux_trap behaviour is maintained. smux_trap now calls the new
function with and index array length of 1 to avoid changes to
existing callers.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
|
| |
| |
| |
| |
| |
| | |
Add MIB support for the route table in RFC4382
Signed-off-by: Pat Ruddy <pat@voltanet.io>
|
| |
| |
| |
| |
| |
| | |
Add SNMP macro to allow a singe octet to be returned
Signed-off-by: Pat Ruddy <pat@voltanet.io>
|
| |
| |
| |
| |
| |
| |
| | |
Add defines for IANA SNMP routing protocol values
Add macro for returning an IPv6 address to the SNMP agent.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
|
| |
| |
| |
| |
| |
| |
| | |
Add 2 functions to encode/decode intergers to/from SNMP OIDs. Make
sure oid is in network format.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
|
|/
|
|
|
|
|
| |
Add SNMP support for L3vpn Vrf table as defined in [RFC4382]
Keep track of vrf status for the table and for future traps.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
|
|
|
|
| |
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
| |
These are necessary to use functions defined in these headers from C++.
Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t
Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
| |
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header. (The style with * at the beginning won out with
580 to 141 in existing files.)
Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
| |
Some places, particularly headers, were spewing warnings since they
don't include neccessary other headers to get struct/enum definitions.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 388f8857eb81ef75014060976776523a58a99389)
|
|
|
|
|
|
|
| |
batch-fix all warnings that come up when enabling AgentX SNMP support.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit dfee58f1d41a2e36c7f5f38a3ef5712224131824)
|
|
|
|
|
|
|
|
|
| |
Most table handlers do not expect to be given an OID whose prefix is
outside what they can handle. This is not a problem with the SMUX
implementation since it always correct the OID such that the prefix
matches. However, this is not the case for the AgentX
implementation. A new function, smux_header_table() is used to do this
normalization.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
smux_trap() signature has been changed to provide appropriate level
information to send SNMPv2 notifications. This includes the addition
of the enterprise OID to use (from which is derived the SNMP trap OID)
and the MIB registry to locate the appropriate function for variable
bindings provided by the trap.
The SMUX implementation has been updated but ignore the provided
enterprise OID. Instead, it still uses the SMUX peer OID to keep
compatibility with previous versions of Quagga. The SMUX
implementation also ignores the provided MIB registry since it uses
smux_get() function to grab the appropriate values. This is not
possible with the AgentX implementation since there is no such
function provided by NetSNMP.
|
|
|
|
| |
This element was not unused.
|
|
|
|
|
|
|
|
|
| |
smux_trap() contains an argument whose use appears to be to set
sysUpTime.0/timestamp field in SNMP trap. However, this value is not
used in smux_trap(). Moreover, it is expected that this field is the
value of sysUpTime.0 when the trap was sent and not any other time
related to the trap. To avoid any confusion, we remove this field from
the signature of the function.
|
|
|
|
|
|
|
|
| |
lib/snmp.c gets OID related helper functions that can be used with
another SNMP interface. smux.h is cleaned of SMUX specific bits to
only expose functions that may be used by an alternative
implementation. We also do not redefine functions already present in
NetSNMP. Just use the appropriate headers.
|
|
|
|
| |
smux_trap and oid_copy should allow read-only source.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Macro SNMP_INTEGER() prepares data which is eventually processed
by asn_build_int(). SNMP_INTEGER() was using "int32_t" whereas
asn_build_int() uses "long". On 32-bit systems these are the
same, both 4 bytes, but on x86 64-bit systems "long" is 8 bytes.
asn_build_int()'s reaction to an improperly sized value is to return
a NULL pointer. Quagga's smux.c would eventually get this NULL
pointer and use it in calculations to determine how much data to send
over the smux connection, resulting in garbage being sent to the
SNMP agent.
Corrected SNMP_INTEGER() to use "long".
Tested on 32-bit and 64-bit x86 Linux 2.6.27.10 systems running
Quagga 0.99.11 with bgpd smux.
|
|
|
|
|
|
|
|
| |
* lib/smux.[ch]: allow to retreive global OID (identified by <0
namelen).
* ospf_ism.c: generate SNMP traps on Interface state change
* ospf_nsm.c: generate SNMP traps on Neighbour state change
* ospf_snmp.[ch]: support for SNMP traps for interface and neighbours.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* (general) extern and static'ification of functions in code and
header.
Cleanup any definitions with unspecified arguments.
Add casts for callback assignments where the callback is defined,
typically, as passing void *, but the function being assigned has
some other pointer type defined as its argument, as gcc complains
about casts from void * to X* via function arguments.
Fix some old K&R style function argument definitions.
Add noreturn gcc attribute to some functions, as appropriate.
Add unused gcc attribute to some functions (eg ones meant to help
while debugging)
Add guard defines to headers which were missing them.
* command.c: (install_node) add const qualifier, still doesnt shut
up the warning though, because of the double pointer.
(cmp_node) ditto
* keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived
fromn vty.h ones to fix some of the (long) < 0 warnings.
* thread.c: (various) use thread_empty
(cpu_record_hash_key) should cast to uintptr_t, a stdint.h type
* vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they
removed from ospfd/ospf_vty.h
* zebra.h: Move definition of ZEBRA_PORT to here, to remove
dependence of lib on zebra/zserv.h
|
|
|
|
|
| |
initializes connection, and "no smux peer" command terminates it. Fixes
bugzilla #47 and #112.
|
|
|
|
|
|
| |
* if.h: mtu's should be unsigned.
* routemap.{c,h}: const char updates
* smux.{c,h}: ditto
|
|
|
|
|
| |
* Fix lib/smux.c's reliance on daemons exporting struct
thread_master *master.
|
|
|