aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cdp
AgeCommit message (Collapse)AuthorFilesLines
2020-10-13stats: counters data modelOle Troan1-21/+3
This adds a new data model for counters. Specifying the errors severity and unit. A later patch will update vpp_get_stats to take advantage of this. Only the map plugin is updates as an example. New .api language: A new "counters" keyword to define counter sets. counters map { none { severity info; type counter64; units "packets"; description "valid MAP packets"; }; bad_protocol { severity error; type counter64; units "packets"; description "bad protocol"; }; }; Each counter has 4 keywords. severity, which is one of error, info or warn. A type, which is one of counter64 or gauge64. units, which is a text field using units from YANG. paths { "/err/ip4-map" "map"; "/err/ip6-map" "map"; "/err/ip4-t-map" "map"; "/err/ip6-t-map" "map"; }; A new paths keyword that maps the counter-set to a path in the stats segment KV store. Updated VPP CLI to include severity so user can see error counter severity. DBGvpp# show errors Count Node Reason Severity 13 ethernet-input no error error Type: feature Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Ib2177543f49d4c3aef4d7fa72476cff2068f7771 Signed-off-by: Ole Troan <ot@cisco.com>
2019-12-06cdp: use explicit types in apiOle Troan1-1/+1
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: If50e66638554e0fcfc72d35a89a39379dfcb530d
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
Type: fix Since CentOS 8, RPM build script doesn't accept '#!/usr/bin/env python' as a valid shebang line. It requires scripts to explicitly chose between python2 or python3. Change all to use python3 as suggested by Paul Vinciguerra. Depends-On: https://gerrit.fd.io/r/23170 Signed-off-by: Renato Botelho do Couto <renato@netgate.com> Change-Id: Ie72af9f60fd0609e07f05b70f8d96e738b2754d1
2019-10-23cdp: re-enable skipped tests for python3Ole Troan1-4/+0
CDP uses the running sytems host name, which caused different failures on different systems. The root cause was an python3 specific error in checksum calculation. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I205436682d46e7e8cbb8c057c03a76dbbcab4d72
2019-10-22cdp: disable failing tests for python3Ole Troan1-0/+6
scapy in python3 does not seem to allow creating invalid protocol packets. Suggest the maintainer rewrite the invalid tests so they also work for python3. In the mean time they are disabled. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I554d57528422c98c6df4ba76eeae38c03f512a38
2019-10-16cdp: fix non-null terminated vector useBenoît Ganne1-1/+1
Type: fix Change-Id: I31e5d9d9e93339eb789aed20996f326b085c22a9 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-27cdp: remove api boilerplateOle Troan5-202/+8
Type: refactor Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I3b4bbbf2574faf8d06546eb72f127fa47479e988 Signed-off-by: Ole Troan <ot@cisco.com>
2019-08-22tests: move plugin tests to src/plugins/*/testDave Wallace1-0/+171
- Relocate plugin tests for 'make test' into src/plugins/*/test so that plugin test cases are co-located with the plugin source code. Type: refactor Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I503e6a43528e14981799b735fa65674155713f67 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-07-09vat: unload unused vat pluginsDave Barach1-19/+1
If the corresponding vpp plugin is absent, return a non-zero clib_error_t * from vat_plugin_register ("xxx plugin not loaded"). The vat plugin calls dlclose on the vat plugin, and it disappears. Depending on the plugin configuration, this can reduce the vpp virtual size by several gigabytes. Added a VAT_PLUGIN(<plugin-name>) macro to vat_helper_macros, clean up boilerplate vat_plugin_register() implementations. Fixed a number of non-standard vat_plugin_register methods. Type: refactor Change-Id: Iac908e5af7d5497c78d6aa9c3c51cdae08374045 Signed-off-by: Dave Barach <dave@barachs.net>
2019-05-29Start the cdp period process on demandDave Barach4-22/+20
Change-Id: I219b270f905dad5939ab38e933712845c314286d Signed-off-by: Dave Barach <dave@barachs.net>
2019-05-16init / exit function orderingDave Barach1-5/+6
The vlib init function subsystem now supports a mix of procedural and formally-specified ordering constraints. We should eliminate procedural knowledge wherever possible. The following schemes are *roughly* equivalent: static clib_error_t *init_runs_first (vlib_main_t *vm) { clib_error_t *error; ... do some stuff... if ((error = vlib_call_init_function (init_runs_next))) return error; ... } VLIB_INIT_FUNCTION (init_runs_first); and static clib_error_t *init_runs_first (vlib_main_t *vm) { ... do some stuff... } VLIB_INIT_FUNCTION (init_runs_first) = { .runs_before = VLIB_INITS("init_runs_next"), }; The first form will [most likely] call "init_runs_next" on the spot. The second form means that "init_runs_first" runs before "init_runs_next," possibly much earlier in the sequence. Please DO NOT construct sets of init functions where A before B actually means A *right before* B. It's not necessary - simply combine A and B - and it leads to hugely annoying debugging exercises when trying to switch from ad-hoc procedural ordering constraints to formal ordering constraints. Change-Id: I5e4353503bf43b4acb11a45fb33c79a5ade8426c Signed-off-by: Dave Barach <dave@barachs.net>
2019-05-03plugins: clean up plugin descriptionsDave Wallace1-0/+1
- Make plugin descriptions more consistent so the output of "show plugin" can be used in the wiki. Change-Id: I4c6feb11e7dcc5a4cf0848eed37f1d3b035c7dda Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-03-20tests: cdp plugin. Replace cdp enable cli command with API call.Paul Vinciguerra1-1/+1
Change-Id: Ic2d21b535a58c1c618ec9e652d30858ad45a7d43 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-07Remove local REPLY_MACRO so that socket transport works.Ole Troan1-23/+2
memif, lacp, nsh and cdp used local REPLY_MACROs. Remove and use those in api_helper.h Change-Id: Ib01d6ae5cff0b6f1cef90996a54b3177f0c53463 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-12Fix CDP failure in make testLijian.Zhang1-2/+2
Once the hostname is longer than 15 bytes, the name of device in the output of show cdp command will be truncated, and CDP test case will fail with below message. ============================================================================== FAIL: test_send_cdp_packet (test_cdp.TestCDP) ------------------------------------------------------------------------------ Traceback (most recent call last): File "vpp/test/test_cdp.py", line 92, in test_send_cdp_packet "CDP received invalid device id") File "vpp/test/framework.py", line 804, in assert_equal self.assertEqual(real_value, expected_value, msg) AssertionError: Invalid CDP received invalid device id: net-x86-supermi does not match expected value net-x86-supermicro-02 Change-Id: Ia32b92c6cd1bb6070adcee3ec45e38399ec382a7 Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
2018-11-17pcap-based dispatch tracerDave Barach1-1/+1
To facilitate dispatch trajectory tracing, vlib_buffer_t decoding, etc. through Wireshark Change-Id: I31356b9fa1f40cba8830aaf10a86a9fbb7546438 Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-06VPP-1481: fixed tlv length checking & added testsFilip Varga1-2/+10
Change-Id: I9375bca5f5136c84d801dbd635929bb1c37d75b4 Signed-off-by: Filip Varga <filip.varga@pantheon.tech>
2018-11-01Fix API name_crc format stored in msg_api_tableIgor Mikhailov (imichail)1-1/+1
Change-Id: I716d025beb8f649060238c2bd388357943643621 Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-10-23c11 safe string handling supportDave Barach2-9/+9
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-22VPP-1420 CDP check memory bounds fixFilip Varga1-4/+17
Change-Id: I7951ffd050acb618dd20b86ae5946e1228ff5d79 Signed-off-by: Filip Varga <fivarga@cisco.com>
2018-09-24Trivial: Clean up some typos.Paul Vinciguerra1-1/+1
Change-Id: I085615fde1f966490f30ed5d32017b8b088cfd59 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-09-16Register cdp_input when enabled for the first timeDave Barach3-26/+42
Graceful handling of unknown tlv types Change-Id: Idbc9ed524fc8b865c8e12571813cc73548bde480 Signed-off-by: Dave Barach <dave@barachs.net>
2018-08-27cmake: Fix plugins .h includesMohsin Kazmi1-0/+6
Change-Id: I90600d000afb02e8969f3c01bcf9e4b5c10a7d39 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-08-25cmake: handle api_test_plugins in add_vpp_plugin macroDamjan Marion1-3/+1
Change-Id: I76a1711af0a920cce66e6dfb07d019ba505d55b7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-25cmake: improve add_vpp_plugin macroDamjan Marion1-3/+6
Change-Id: Iffd5c45ab242a919592a1f686f7f880936b68a1a Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-0/+26
Change-Id: Ibc59323e849810531dd0963e85493efad3b86857 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-06-19Check get packet template allocation failure (VPP-1321)John Lo1-0/+6
After calling vlib_packet_template_get_packet(), make sure packet buffer is allocated before using it. Change-Id: Idb5199f4e2c9596137b2101e502d611f474a6ffe Signed-off-by: John Lo <loj@cisco.com>
2018-03-10Move the vnet cdp protocol implementation to a pluginDave Barach11-0/+2068
Add a binary API and debug cli to enable/disable cdp. cdp is disabled by default. Change-Id: I307c7e38dfda38e36ff3325f65de7036c34d89b1 Signed-off-by: Dave Barach <dave@barachs.net>