summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
2024-01-28build: remove mgmtd exception from xref2vtyshIgor Ryzhov
We may actually need to send CLI commands to mgmtd and another daemon at the same time, for example, if this daemon is not mgmtd-converted. The only daemon this exception protects is staticd. But we don't actually need any configuration commands in staticd, so just remove the exception and don't install unnecessary commands to staticd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26ripngd: convert ripngd to mgmtdChristian Hopps
- a couple small fixes for ripd conversion as well. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26ripd: ripd convert to mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26lib: convert filters to mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26lib: convert route-map to mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28zebra: add zebra to mgmtd oper-stateChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-09-16[ospfd]: add support for RFC 5709 HMAC-SHA AuthMahdi Varasteh
This patch includes: * Implementation of RFC 5709 support in OSPF. Using openssl library and FRR key-chain, one can use SHA1, SHA256, SHA384, SHA512 and keyed-MD5( backward compatibility with RFC 2328) HMAC algs. * Updating documentation of OSPF * add topotests for new HMAC algorithms Signed-off-by: Mahdi Varasteh <varasteh@amnesh.ir>
2023-05-01mgmtd: fully implement debug flags for mgmtd and clientsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-24lib: convert xref_threadsched to xref_eventschedDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
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>
2023-03-21mgmtd: nb library for client front-end codeChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-02-21Merge pull request #12248 from pguibert6WIND/bgpasdotRuss White
lib, bgp: add initial support for asdot format
2023-02-10lib, bgp: add initial support for asdot formatPhilippe Guibert
AS number can be defined as an unsigned long number, or two uint16 values separated by a period (.). The possible valus are: - usual 32 bit values : [1;2^32 -1] - <1.65535>.<0.65535> for dot notation - <0.65535>.<0.65535> for dot+ notation. The 0.0 value is forbidden when configuring BGP instances or peer configurations. A new ASN type is added for parsing in the vty. The following commands use that new identifier: - router bgp .. - bgp confederation .. - neighbor <> remote-as <> - neighbor <> local-as <> - clear ip bgp <> - route-map / set as-path <> An asn library is available in lib/ and provides some services: - convert an as string into an as number. - parse an as path list string and extract a number. - convert an as number into a string. Also, the bgp tests forge an as_zero_path, and to do that, an API to relax the possibility to have a 0 as value is specifically called from the tests. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-28python: hide inet_ntoa from frrbotDavid Lamparter
These are not the inet_ntoa you are looking for ;) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-28python: fix a bunch of pylint warnings in clippyDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-28python: apply black formattingDavid Lamparter
The python/ directory hasn't been shoved into black yet (unlike topotests, where most FRR python code is.) Run black over it. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26build: exclude a few more things from frr.xrefDavid Lamparter
... this might need some better approach long-term. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26python: fix for old (< 3.6) Python versionsDavid Lamparter
Sigh. No type annotations, no f-strings. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06python: use ujson if availableDavid Lamparter
It's noticeably faster. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06build: don't include vtysh.xref in frr.xrefDavid Lamparter
vtysh.xref only contains a rather-useless duplicate of every single CLI command incorporated into vtysh... and including it prevents frr.xref from becoming the source for vtysh_cmd.c. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06lib: add CMD_ATTR_NOSHDavid Lamparter
To propagate into .xref so extract.pl can be handled there. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06lib: make cmd_element->attr a bitmask & clarifyDavid Lamparter
It already "looks" like a bitmask, but we currently can't flag a command both YANG and HIDDEN at the same time. It really should be a bitmask. Also clarify DEPRECATED behaviour (or the absence thereof.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-06-16python: Remove redundant import of subprocessDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-26build: reformat makefile.pyDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-26build: add a bunch of comments to makefile.pyDavid Lamparter
... to (maybe?) make understandable what it's doing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-26build: fix LLVM bitcode per-target CFLAGSDavid Lamparter
When automake decides to customize CFLAGS, use those for building LLVM bitcode files too. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28python: improve clippy/clidef macro processingDavid Lamparter
Process macros from the current file, and warn if something is redefined (to a different value). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-13python: pass conditionals through clippy for DEFPYDavid Lamparter
Track what conditionals apply when a DEFPY is encountered, and stack them around the autogenerated clippy wrapper. Otherwise conditional DEFPYs result in undefined function warnings. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-05isisd: fix redistribute CLIIgor Ryzhov
Currently, it is possible to configure IPv6 protocols for IPv4 redistribution and vice versa in CLI. The YANG model doesn't allow this so the user receives the following error: ``` nfware(config-router)# redistribute ipv4 ospf6 level-1 % Failed to edit configuration. YANG error(s): Invalid enumeration value "ospf6". Invalid enumeration value "ospf6". Invalid enumeration value "ospf6". YANG path: Schema location /frr-isisd:isis/instance/redistribute/ipv4/protocol. ``` Let's make CLI more user-friendly and allow only supported protocols in redistribution commands. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-24build: add `-Werror` to xrelfo log format warningsDavid Lamparter
Adding a `\n' should now produce a warning. Controlled by `-Werror` so if you're doing a dev build and it's warning about some `prefix2str` that should be converted to `%pFX`, you can turn off `-Werror` to fix it later like with all other warnings. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-23*: make sure `config.h` or `zebra.h` is firstDavid Lamparter
`config.h` has all the defines from autoconf, which may include things that switch behavior of other included headers (e.g. _GNU_SOURCE enabling prototypes for additional functions.) So, the first include in any `.c` file must be either `config.h` (with the appropriate guard) or `zebra.h` (which includes `config.h` first thing.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-15python: add demo checker tool using frr.xrefDavid Lamparter
More of a demo on what to do with the frr.xref file, but also slightly useful in finding vtysh SNAFUs :) Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-08python: fix 32-bit pointers in xrelfo container_ofDavid Lamparter
This was mistakenly using the host platform's pointer size rather than the ELF file's. Only noticeable when cross compiling... Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-23python/xrelfo: cross-platform xrefstructs.jsonDavid Lamparter
Just get names, types and order from pahole; ditch offset & size since they're different on 32/64 bit. None of the structs has padding currently; if we really need that it can be implemented in the future. (Padding will raise an exception, so it won't break silently.) Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-23lib/xref: record log message format argsDavid Lamparter
Apparently you can do `#__VA_ARGS__` and it actually does something sensible, so here we go recording the format parameters for log messages into the xref. This allows some more checking in xrelfo.py, e.g. hints to use `%pFX` and co. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-23build: extract xrefsDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-23python/xrelfo: the ELF xref extractorDavid Lamparter
This creates JSON dumps of all the xref structs littered around FRR. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-10-07*: reformat python fileswhitespace
We are now using black. Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-08-19python: Make FRR build compatible with python 2.7 and 3.xMartin Winter
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-07-17build: fix Makefile rule redefinitionDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-05-05python: add graphviz callgraphsDavid Lamparter
Uses the JSON data extracted from LLVM bitcode by tools/frr-llvm-cg. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-05-05build: add LLVM bitcode targetsDavid Lamparter
Just an easy way to produce LLVM .bc (bitcode) files. Not used during normal builds. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-05-05build: rework Makefile var extraction... againDavid Lamparter
*sigh* I can't seem to catch a break on this. Add a regex variant. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27python: add check-first-header toolDavid Lamparter
The first #include statement in all FRR .c files should be either zebra.h or config.h. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27build: make clippy Makefile rules nicerDavid Lamparter
These are easy to get subtly wrong, and doing so can cause nondeterministic failures when racing in parallel builds. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27python: move MakeVars class into separate moduleDavid Lamparter
... so I can reuse it. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-08-30bgpd/bmp: BMP implementationDavid Lamparter
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>
2019-07-03clippy: find headers relative to source treeDavid Lamparter
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>