summaryrefslogtreecommitdiffstats
path: root/.clang-format (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: Modify clang-format column limit to 100Donald Sharp2024-09-261-1/+1
| | | | | | | A bunch of recent discussion has gone on about this. Let's see if we are actually interested in making a change. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* tools: Ignore ALIAS_* macros for clang-formatterDonatas Abraitis2024-07-171-0/+4
| | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* build: make clang-format ignore DEFUN/DEFPYDavid Lamparter2024-05-081-0/+17
| | | | | | | | This makes clang-format not wreck all our hand-formatted DEFUN/DEFPY statements. We apparently missed this option when we originally looked at setting up the .clang-format control file... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* tools: add comment about checking frrbotChristian Hopps2024-03-201-0/+1
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* tools: add more libyang iter macros to .clang-formatChristian Hopps2023-12-281-0/+2
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* *: convert `struct interface->connected` to DLISTDavid Lamparter2023-11-221-1/+0
| | | | | | | | | | | | | | | | | Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* mgmtd: simplify xpath registriesChristian Hopps2023-11-061-0/+1
| | | | | | | | | | - move from client id indexed array of uints for register info per client to a u64 bitmask. - add bit walking FOREACH macro Walk the client IDs whose bits are set in a mask. Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: add dynamic array typeChristian Hopps2023-06-281-0/+2
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* tools: less aggressive settings for clang-formatChristian Hopps2023-06-261-4/+4
| | | | | | | | - Reports were that the current settings were choosing to extend beyond 80 columns too often. This change makes that more expensive but still tries very hard to not break before first open parenthesis of function calls. Signed-off-by: Christian Hopps <chopps@labn.net>
* tools: import latest linux clang-format config w/ FRR modsChristian Hopps2023-06-221-85/+198
| | | | | | | | | | | | | | | | | | | | We modify the following from Linux Style: AlignEscapedNewlines: Left -> Right AlignTrailingComments: false -> true AlignConsecutiveMacros: false -> true ForEachMacros (replace linux with ours) Don't break a string into multi-string-fragments PenaltyBreakString: 200 Allow going past the ColumnLimit to keep function arguments aligned with the open parenthesis. PenaltyBreakBeforeFirstCallParameter: 200 Signed-off-by: Christian Hopps <chopps@labn.net>
* Revert "tools: config clang-format to allow aligned macros"Donatas Abraitis2023-05-151-1/+0
| | | | | | | | | | | | | | | | This reverts commit 25314d5d878bbcc5ff63ebe76db9b2143b3e04ab. This causes errors on clang-formatter for versions <= 10. ``` % git clang-format bgpd YAML:14:25: error: invalid boolean AlignConsecutiveMacros: AcrossComments ^~~~~~~~~~~~~~ error: `clang-format -lines=11624:11624 -lines=11802:11802 bgpd/bgp_vty.c` failed ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* tools: config clang-format to allow aligned macrosMark Stapp2023-05-121-0/+1
| | | | | | Add an AlignConsecutiveMacros config for clang-format. Signed-off-by: Mark Stapp <mjs@labn.net>
* mgmtd: Add MGMT Transaction FrameworkYash Ranjan2023-03-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the MGMT Transaction framework that takes management requests from one (or more) frontend client sessions, translates them into transactions and drives them to completion in co-oridination with one (or more) backend client daemons involved in the request. This commit includes the following functionalities in the changeset: 1. Introduces the actual Transaction module. Commands added related to transaction are: a. show mgmt transaction all 2. Adds support for commit rollback feature which stores upto the 10 commit buffers. Each commit has a commit-id which can be used to rollback to the exact configuration state. Commands supported for this feature are: a. show mgmt commit-history b. mgmt rollback commit-id COMMIT_ID 3. Add hidden commands to enable record various performance metrics: a. mgmt performance-measurement b. mgmt reset-statistic Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com> Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com> Co-authored-by: Ujwal P <ujwalp@vmware.com> Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* mgmtd: Add MGMT Backend Interface FrameworkChristian Hopps2023-03-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the MGMT Backend Interface which can be used by back-end management client daemons like BGPd, Staticd, Zebra to connect with new FRR Management daemon (MGMTd) and utilize the new FRR Management Framework to let any Frontend clients to retrieve any operational data or manipulate any configuration data owned by the individual Backend daemon component. This commit includes the following functionalities in the changeset: 1. Add new Backend server for Backend daemons connect to. 2. Add a C-based Backend client library which can be used by daemons to communicate with MGMTd via the Backend interface. 3. Maintain a backend adapter for each connection from an appropriate Backend client to facilitate client requests and track one or more transactions initiated from Frontend client sessions that involves the backend client component. 4. Add the following commands to inspect various Backend client related information a. show mgmt backend-adapter all b. show mgmt backend-yang-xpath-registry c. show mgmt yang-xpath-subscription Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com> Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com> Co-authored-by: Ujwal P <ujwalp@vmware.com> Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* mgmtd: Add MGMT Frontend Interface FrameworkChristian Hopps2023-03-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the Frontend Interface which can be used by front-end management clients like Netconf server, Restconf Server and CLI to interact with new FRR Management daemon (MGMTd) to access and sometimes modify FRR management data. This commit includes the following functionalities in the changeset: 1. Add new Frontend server for clients connect to. 2. Add a C-based Frontend client library which can be used by Frontend clients to communicate with MGMTd via the Frontend interface. 3. Maintain a frontend adapter for each connection from an appropriate Frontend client to facilitate client requests and track one or more client sessions across it. 4. Define the protobuf message format for messages to be exchanged between MGMTd Frontend module and the Frontend client. 5. This changeset also introduces an instance of MGMT Frontend client embedded within the lib/vty module that can be leveraged by any FRR daemon to connect to MGMTd's Frontend interface. The same has been integrated with and initialized within the MGMTd daemon's process context to implement a bunch of 'set-config', 'commit-apply', 'get-config' and 'get-data' commands via VTYSH Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com> Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com> Co-authored-by: Ujwal P <ujwalp@vmware.com> Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* lib: add `_last` and `_prev` on typesafe RB/DLISTDavid Lamparter2022-03-121-0/+3
| | | | | | | RB-tree and double-linked-list easily support backwards iteration, and an use case seems to have popped up. Let's make it accessible. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nestingDonatas Abraitis2022-01-131-0/+1
| | | | | | | | Used for graceful-restart mostly. Especially for bgp_show_neighbor_graceful_restart_capability_per_afi_safi() Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* tools: clang-format break after operatorsMark Stapp2021-12-061-1/+1
| | | | | | Break after binary operators, rather than before. Signed-off-by: Mark Stapp <mstapp@nvidia.com>
* lib: adapt to version 2 of libyangChristian Hopps2021-05-131-0/+3
| | | | | | | | | Compile with v2.0.0 tag of `libyang2` branch of: https://github.com/CESNET/libyang staticd init load time of 10k routes now 6s vs ly1 time of 150s Signed-off-by: Christian Hopps <chopps@labn.net>
* clang-format: add FOREACH_SAFI to the ForEachMacros listRenato Westphal2020-08-031-0/+1
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: frr_elevate_privs -> frr_with_privsDavid Lamparter2019-09-031-1/+1
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: add frr_with_mutex() block-wrapperDavid Lamparter2019-09-031-0/+2
| | | | | | | | | frr_with_mutex(...) { ... } locks and automatically unlocks the listed mutex(es) when the block is exited. This adds a bit of safety against forgetting the unlock in error paths & co. and makes the code a slight bit more readable. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* clang-format: update the ForEachMacros settingRenato Westphal2019-05-211-0/+3
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: introduce new northbound APIRenato Westphal2018-10-271-0/+3
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: import new JSON iteration macroRafael Zalamena2018-08-081-0/+1
| | | | | | | Save a few lines when iterating over JSON objects using the new JSON_FOREACH macro. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* ospfd: LSDB_LOOP treat it as a loop.Donald Sharp2018-01-171-0/+2
| | | | | | | | Inform the .clang-format file about LSDB_LOOP and put the proper indentation for this loop into the code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal2017-10-101-0/+2
| | | | | | | | | | This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: use clang's 'ForEachMacros' format style optionRenato Westphal2017-09-151-0/+32
| | | | | | | | | | | | | This fixes the broken indentation of several foreach loops throughout the code. From clang's documentation[1]: ForEachMacros: A vector of macros that should be interpreted as foreach loops instead of as function calls. [1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: add indent control filesreindent-master-beforeDavid Lamparter2017-07-171-0/+25
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>