Commit Graph

33 Commits

Author SHA1 Message Date
52b8cb5477 Add MPLS config option and interface.is_mpls()
Also add tests and documentation
2023-06-23 00:30:03 +02:00
cf5f1f0944 Add device-type, to ensure that plan --novpp generates MTU statements 2023-06-23 00:30:03 +02:00
7914659fa5 icmp-type/code also match for proto 58 (ipv6-icmp) 2023-01-16 21:09:08 +00:00
9a175e1bba Add an ACE with a an example prefixlist 2023-01-16 14:36:05 +00:00
0e4490fc06 Make 'any' a reserved name for prefixlists 2023-01-16 14:20:07 +00:00
4e2354c3d8 Add acl.get_network_list() + tests; Update docs to reference the ability to use prefixlist as a source/destination 2023-01-16 12:03:34 +00:00
da7609a685 acls: Syntax schema, example and docs
First stab at integrating the acl-plugin from VPP. Allow to craft ACLs
consisting of one-or-more ACEs (this is ensured by 'terms' being
required with min=1), and a rich language to be able to set any L3
and L4 (UDP, ICMP, TCP) matchers that the plugin provides.

Explain how the syntax will look like, although for now only YAMALE
syntax checking can be performed (semantic validation is next).

TESTED:
pim@hippo:~/src/vppcfg/vppcfg$ ./vppcfg.py check -c example.yaml
[INFO    ] root.main: Loading configfile example.yaml
[INFO    ] vppcfg.config.valid_config: Configuration validated successfully
[INFO    ] root.main: Configuration is valid
2023-01-15 21:41:58 +00:00
305a30b1a1 feature: stateless planning
Add a  feature to plan a configuration without reading from the VPP Dataplane.

In this mode, the configuration file is read and validated in the same way as `check` or `plan`,
but then instead of retrieving the running state from the VPP API, a state is re-created using
the physical interfaces specified in the YAML config.

Implement this by creating vppapi:mockconfig() which reads the 'interfaces' scope from the YAML
config file, and creates a VPPMessage() of type sw_interface_details for each interface that is a
PHY (for now, only supporting device-type 'dpdk').

If the flag --novpp is specified in the planner, call mockconfig() instead of readconfig().

Some further details:
- if the MAC is not set in the YAML config, it won't be set in the output exec file.
- for bondethernets, no MAC can be generated unless it's set in the first member.
- the MTU is always set, because it's mocked to 64b and the YAML file will always be higher.

TESTED:
- the unit tests and YAML tests all pass
- the integration tests all pass, but they do not call this new codepath

- Based on an empty VPP on Hippo, I compared the output of these two, side by side:
for i in intest/*yaml; do ./vppcfg.py plan -c $i -o /tmp/$i-vpp.exec; done
for i in intest/*yaml; do ./vppcfg.py plan --novpp -c $i -o /tmp/$i-novpp.exec; done

==> The only changes here are:
* if I cannot determine the bondether MAC in the --novpp case, it is not emitted
* if the MAC address is set in the YAML file, the --novpp case will always emit it
* if VPP has mtu 9000, the --novpp case will end up still emitting interface and packet MTU,
  because it mocks the interface MTU at 64.

In all cases, --novpp emits more configuration statements, and the statements that it emits are
redundant.
2022-12-03 16:03:38 +00:00
9f2ef0e56a build: fix python load paths
Fixed python load paths so that vppcfg will work installed as python
library and standalone from the source directory, fixing load
pathes for resources such as yaml files along the way.

Added a make target for pylint called 'make check-style', fixed a
number of minor pylint issues along the way.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
2022-07-12 15:38:14 +01:00
f8a6c3eba7 Add a note about black code formatting 2022-04-22 13:13:42 +00:00
d6e3496809 Add TAP syntax/semantic validator 2022-04-09 19:56:48 +00:00
1a00f14b53 Assert hardware APIs must be made available for testing 2022-04-07 21:39:41 +00:00
8854208b09 Add license for docs, add notes on AP2 for code, add requirement for origin certification 2022-04-07 21:18:05 +00:00
771d1ba62f Add contributing guide with a few baseline expectations 2022-04-07 20:57:51 +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
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
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
a4a91d1f5e Replace dumper with an actual YAML emitter 2022-04-03 21:37:48 +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
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
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
ef475a200a Move docs into their own directory 2022-04-03 12:03:55 +00:00