summaryrefslogtreecommitdiffstats
path: root/python (follow)
Commit message (Collapse)AuthorAgeFilesLines
* bgpd/bmp: BMP implementationDavid Lamparter2019-08-301-0/+1
| | | | | | | | This implements BMP. There's no fine-grained history here, the non-BMP preparations are already split out from here so all that remains is BMP proper. Signed-off-by: David Lamparter <equinox@diac24.net>
* clippy: find headers relative to source treeDavid Lamparter2019-07-031-1/+3
| | | | | | | The current directory is in the build tree while running clippy; find ourselves so we can access headers from the source tree. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/clippy: expand some macrosDavid Lamparter2019-06-121-9/+41
| | | | | | At least the "easy" cases of macros work. Signed-off-by: David Lamparter <equinox@diac24.net>
* lib/clippy: assert() for non-optional argsDavid Lamparter2019-06-121-4/+34
| | | | | | | | | This is mostly to help static analysis; since we know from the command string which args are optional and which aren't, we can add assert() statements on them. Fixes: #3270 Signed-off-by: David Lamparter <equinox@diac24.net>
* lib/clippy: error out on unsupported bitsDavid Lamparter2019-06-121-1/+19
| | | | | | | | | clippy can't process #ifdef or similar bits inside of an argument list (e.g. within the braces of a DEFUN or DEFPY statement.) Improve error reporting to catch these cases instead of generating broken C code. Fixes: #3840 Signed-off-by: David Lamparter <equinox@diac24.net>
* python: make DEFPY provide the text token of fixed parametersRenato Westphal2019-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the CLI code, each cmd_token has both a "text" field, containing the full token text (e.g. "unicast"), and an "arg" field, containing the original text entered by the user (which might be an abbreviation, like "uni" instead of "unicast"). To avoid the need to handle abbreviations, the recommended pattern for DEFUN commands is to use the "text" value of fixed parameters and the "arg" value of everything else. Using DEFPY, however, the CLI parameters are automagically turned into C variables which are initialized under the hood (so that they're conveniently ready for use). The problem is that this initialization was always using the "arg" value of the parameters, which was leading to problems like these: debian# show ipv6 route isi Unknown route type debian# debian# conf t debian(config)# router isis 1 debian(config-router)# redistribute ipv4 st level-1 % Configuration failed. Invalid value "st" in "protocol" element. YANG path: /frr-isisd:isis/instance[area-tag='1']/redistribute/ipv4[protocol='st']/protocol To fix these problems (and probably others too), make DEFPY commands auto-detect the type of the input parameters and use either the "arg" or "text" value from the cmd_tokens accordingly. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Revert "isisd lib ospfd pbrd python: fix empty init"David Lamparter2018-12-011-5/+5
| | | | | | | | | This reverts commit 48944eb65e1d1ced03d46121d923d9d613a480d5. We're using GNU C, not ISO C - and this commit triggers new (real) warnings about {0} instead of bogus ones about {}. Signed-off-by: David Lamparter <equinox@diac24.net>
* isisd lib ospfd pbrd python: fix empty initF. Aragon2018-11-211-5/+5
| | | | | | | ISO C forbids empty initializer braces. Empty initializers have been replaced with {0} Signed-off-by: F. Aragon <paco@voltanet.io>
* *: fix some solaris warningsDavid Lamparter2018-09-081-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* build: trigger fewer unneccessary clippy rebuildsDavid Lamparter2018-08-301-1/+1
| | | | | | | | Make sure we include the clippy binary file in our timestamp mangling so `make` will correctly determine when clippy files don't need to be rebuilt. Signed-off-by: David Lamparter <equinox@diac24.net>
* lib, python: DEFPY_ATTR, DEFPY_HIDDENQuentin Young2018-04-101-1/+1
| | | | | | Add support for element attributes in DEFPY macros. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: unify the ipv4/ipv6 'show ip route' commands - part 1/2Renato Westphal2017-10-241-2/+0
| | | | | | | | Note: I had to remove one assert in clidef.py in order to fix a build error when using a preprocessor string (FRR_IP_REDIST_STR_ZEBRA) inside a DEFPY command. This should be revisited later. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* clippy: disable unneeded autogenerated codeDavid Lamparter2017-08-251-1/+23
| | | | | | | | Coverity is generating a lot of warnings about unused stuff being around. Disabling these bits is most easily done by just putting a few preprocessor directives into the template. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* python/clippy: make output file writing less weirdDavid Lamparter2017-08-242-4/+13
| | | | | | | This should stomp out any parallel build issues in this regard. Fixes: #971 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib, python: add M:A:C support for clippyQuentin Young2017-08-141-1/+7
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* build: non-recursive auxiliary directoriesDavid Lamparter2017-07-311-3/+0
| | | | | | | Flatten {m4,pkgsrc,python,redhat,snapcraft}/Makefile.am into the main one. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-1/+1
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: rebase vty_outln() -> masterQuentin Young2017-06-291-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* python: clidef.pyDavid Lamparter2017-06-143-0/+321
Adds "DEFPY()" which invokes an additional layer of preprocessing, so that we get pre-parsed and named function arguments for the CLI. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>