diff options
author | Quentin Young <qlyoung@users.noreply.github.com> | 2020-07-29 20:29:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-29 20:29:34 +0200 |
commit | 25ee44b52278c86fda27f76e932f6a12c375bf10 (patch) | |
tree | bea9a0e54e73dafb08400f7e2e435d5be7fa1e93 /tools | |
parent | Merge pull request #6769 from opensourcerouting/acl-regress (diff) | |
parent | tools: improve cocci.h (diff) | |
download | frr-25ee44b52278c86fda27f76e932f6a12c375bf10.tar.xz frr-25ee44b52278c86fda27f76e932f6a12c375bf10.zip |
Merge pull request #6732 from opensourcerouting/printfrr-prep
*: preparations for printfrr coccinelle run
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cocci.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/cocci.h b/tools/cocci.h index 8ca42b349..7d6bb4cd7 100644 --- a/tools/cocci.h +++ b/tools/cocci.h @@ -7,6 +7,18 @@ #define DEFUN_HIDDEN(funcname, cmdname, str, help) \ static int funcname(const struct cmd_element *self, struct vty *vty, \ int argc, struct cmd_token *argv[]) +#define DEFUN_NOSH(funcname, cmdname, str, help) \ + static int funcname(const struct cmd_element *self, struct vty *vty, \ + int argc, struct cmd_token *argv[]) +#define DEFPY(funcname, cmdname, str, help) \ + static int funcname(const struct cmd_element *self, struct vty *vty, \ + int argc, struct cmd_token *argv[]) +#define DEFPY_HIDDEN(funcname, cmdname, str, help) \ + static int funcname(const struct cmd_element *self, struct vty *vty, \ + int argc, struct cmd_token *argv[]) +#define DEFPY_NOSH(funcname, cmdname, str, help) \ + static int funcname(const struct cmd_element *self, struct vty *vty, \ + int argc, struct cmd_token *argv[]) #define ENABLE_BGP_VNC 1 #define ALL_LIST_ELEMENTS_RO(list, node, data) \ @@ -85,3 +97,28 @@ for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) #define FOREACH_SAFI(safi) for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) + +#define frr_with_privs(p) \ + for (int x = 1; x; x--) +#define frr_with_mutex(m) \ + for (int x = 1; x; x--) + +#define ALL_LSDB_TYPED_ADVRTR(lsdb, type, adv_router, lsa) \ + const struct route_node *iterend = \ + ospf6_lsdb_head(lsdb, 2, type, adv_router, &lsa); \ + lsa; \ + lsa = ospf6_lsdb_next(iterend, lsa) + +#define ALL_LSDB_TYPED(lsdb, type, lsa) \ + const struct route_node *iterend = \ + ospf6_lsdb_head(lsdb, 1, type, 0, &lsa); \ + lsa; \ + lsa = ospf6_lsdb_next(iterend, lsa) + +#define ALL_LSDB(lsdb, lsa) \ + const struct route_node *iterend = \ + ospf6_lsdb_head(lsdb, 0, 0, 0, &lsa); \ + lsa; \ + lsa = ospf6_lsdb_next(iterend, lsa) + +#define QOBJ_FIELDS struct qobj_node qobj_node; |