416 Commits

Author SHA1 Message Date
41bce7131c Remove surperfluous YAML file 2022-04-05 15:54:09 +00:00
0a755a0745 Add bond/bridge YAML emitter
Add int_to_mode() and int_to_lb() in config/bondethernet.py to map back
the retrieved values from VPP into their config strings.

Implement bond and bridge settings dumper, dumping all settings even if
they are default. This helps the user understand the configurable
options.
2022-04-05 15:53:26 +00:00
2360d28d0a Add the ability to set any mode/lb on bonds
This requires a schema change, adding 'mode' and 'load-balance' fields,
a semantic invariant that 'load-balance' can only be set in the case of
LACP and XOR bonds, a mapper from the mode/lb strings, ie.
"round-robin" to their VPP numeric counterparts, a bunch of unit tests.

Then in the reconciler, changing bonds (__bond_has_diff()) will
invalidate any LCP or sub-interfaces built on them, so those will have
to be pruned. create_bondethernet() will now create (or re-create)
the bond with the correct flags.

Unit-tests, YAML tests and the integration test all pass.

Updated config-guide.
2022-04-05 15:05:03 +00:00
289138da94 Bundle Yamale schema
TIL! Using the existence of obscure member sys._MEIPASS, I can detect if
we're running from a bundled PyInstaller binary, versus running from Python
directly.

Add schema.yaml to the datas of the PyInstaller spec. Then, if the
-/--schema flag is given, use it, and if it's not given, default to the
built-in one if we're running from a bundled binary, or fall-through to
./schema.yaml in other cases.

This avoids the need for config/schema.py as a carbon-copy of the schema,
slick!
2022-04-05 12:40:05 +00:00
fdb732142a Add bridgedomain settings.
Bridges can be created with default settings, with specific settings,
and they can be sync'd at runtime with all of the settings in this
change.

Notably missing are two features:
- unknown unicast flooding into specific interfaces (as opposed to
  on/off on the bridge)
- learn-limit, which does not have an API getter, only a setter.
2022-04-05 12:01:13 +00:00
f53f7d5095 Remove linux-cp / lcpng specialcase, the API exposed by lcpng and linux-cp is now identical 2022-04-05 11:08:58 +00:00
b461ef49bb Add 'state' field to interfaces and sub-interfaces
Assert that children cannot be 'up' of their parent is 'down'. Add tests. Update user-guide.
2022-04-05 11:06:33 +00:00
65de792e35 Implement workaround for endianness issue in linux-cp 2022-04-03 22:24:59 +00:00
a4a91d1f5e Replace dumper with an actual YAML emitter 2022-04-03 21:37:48 +00:00
53a7935168 Copy the Yamale schema.yaml file into the source-code verbatim. This allows the tool to run without any external (file) dependencies, using the built-in yamale_schema if the -s/--schema flag is not specified 2022-04-03 15:53:00 +00:00
a561dc64b1 Correctly prune addresses from untagged and tagged VXLAN tunnels 2022-04-03 15:40:21 +00:00
6bfb31e3fc Exclude .exec files 2022-04-03 15:23:31 +00:00
88f4240ddd Add a sub-interface test for VXLAN tunnels 2022-04-03 15:22:43 +00:00
593ffed772 Clarify the encap is optional 2022-04-03 15:03:10 +00:00
196e09b2d2 Add interface/sub-interface config documentation 2022-04-03 15:01:28 +00:00
dc3fb57274 Add config documentation for VXLAN tunnels 2022-04-03 14:46:59 +00:00
720f581e47 Do bounds checking on the BondEthernet and VXLAN Tunnel instances 2022-04-03 14:40:44 +00:00
79f41d447d Add caveat on bridgedomain configurability 2022-04-03 14:29:35 +00:00
dc0d785818 Add example.yaml reference 2022-04-03 14:22:31 +00:00
e25f73db9c Add BondEthernet documentation, with a caveat on its restrictive types 2022-04-03 14:20:30 +00:00
00731e38f1 Make code match documentation :-)
Bridge Domains must be [1,16M), Loopbacks must be [0,4096).
Loopbacks should be allowed to have an address without an LCP.
 => Reuse the unittest file for the bounds check for loopbacks.
 => Add a new unittest file for the bounds check for bridgedomains.
2022-04-03 14:07:56 +00:00
15daa65c0b Add bridgedomain config structure 2022-04-03 13:58:45 +00:00
1b13ab7c0c Add a first piece of explanation on the YAML config structure 2022-04-03 13:41:56 +00:00
ce15b5a6fd Document 'vppcfg plan' including an example 2022-04-03 13:18:32 +00:00
35e878a42e Add example output to illustrate the 'vppcfg dump' command 2022-04-03 13:05:48 +00:00
dfd8c8b8a9 Add user guide for 'vppcfg dump' command 2022-04-03 13:01:31 +00:00
eee47c02b1 Explain that 'check' does not use VPP interaction at all 2022-04-03 12:53:14 +00:00
82d78c721c Clarification on return value 2022-04-03 12:51:15 +00:00
3a4416e8d7 Add a user guide for 'vppcfg check' 2022-04-03 12:48:40 +00:00
2642e94dea Assert that sub-ints with addresses must have exact-match set 2022-04-03 12:48:09 +00:00
a8ed54308b Merge from github 2022-04-03 12:04:37 +00:00
ef475a200a Move docs into their own directory 2022-04-03 12:03:55 +00:00
c3f8a97de9 Move docs into their own directory 2022-04-03 12:02:41 +00:00
2b98d57fd2 Move VPPAPIDumper into its own class.
Create a 'dump' command that calls it and exits vppcfg.
Add help strings to each of the commands.
2022-04-03 11:53:51 +00:00
50581f7171 Rename 'config' to 'cache' in the VPPApi.
This makes it clearer what its purpose is, in preparation of actual VPP
dataplane configuration changes. For example remove_lcp() refers
currently to the removal of the LCP from the cache, not the VPP
dataplane itself, so rename it and its siblings cache_remove_*()
instead.

In a future commit, the call remove_*() will refer to the removal of an
object _in VPP_.
2022-04-03 11:21:29 +00:00
1a0daa48d1 Move to explicit 'plan -o XXX' commandline 2022-04-03 11:20:47 +00:00
b67493003f Only write output if in planning mode 2022-04-03 11:05:50 +00:00
566efe3596 Add a CLI output emitter (either to stdout or to filename), based on plan --output/-o flag 2022-04-03 09:49:27 +00:00
8499f2104e Clean up some debugging statements post-prune 2022-04-03 09:19:51 +00:00
342ccf3765 Add a real life example (hippo12.yaml) which shows all supported config so far 2022-04-03 09:19:25 +00:00
27b4500d3e Add integration tests in intest/ 2022-04-03 09:18:52 +00:00
75e5a23538 Merge branch 'main' of github.com:pimvanpelt/vppcfg into main 2022-04-03 09:04:19 +00:00
d30f2d8965 Relax the LCP requirements - it is OK to have an address without an LCP 2022-04-03 09:04:11 +00:00
5e7f1bdba4 Update LICENSE
file was copied from another project (github.com/pimvanpelt/vpp-snmp-agent) which contains code from another author. That author is not affiliated with this repository, so remove them from the LICENSE file.
2022-04-02 23:31:40 +02:00
682d157d5b Add note on 'Applying' verb which will come next. 2022-04-02 22:37:45 +02:00
6a6caa113e Update usage output 2022-04-02 22:34:13 +02:00
f786a00e9a Check for the existence of LCP config statements, and if so, require linux-cp or lcpng plugins are enabled in VPP 2022-04-02 20:16:51 +00:00
240fcebbcf Remove integration-test.sh 2022-03-29 17:13:55 +00:00
f70bff400f Introduce a CLI object
Instead of writing the CLI calls to stderr as INFO loglines, now add
them to a list of messages by prune/create/sync.

Always close the VPP connection after finishing, by adding a destructor
to the VPPApi class.

At the end of each phase, print out what was gathered to stdout. Later,
I will make this more advanced (output to file, output directly to a
pipe of a running vppctl binary, etc).
2022-03-29 14:04:53 +00:00
7c8f36d1fe Merge from upstream 2022-03-28 16:44:17 +00:00