Skip to content

Commit

Permalink
*: fix frr_daemon_info indentation
Browse files Browse the repository at this point in the history
clang-format doesn't understand FRR_DAEMON_INFO is a long macro where
laying out items semantically makes sense.

(Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get
confused with the mismatching `( ( )`.

Signed-off-by: David Lamparter <[email protected]>
  • Loading branch information
eqvinox committed Jan 27, 2024
1 parent cd35ecc commit 634f481
Show file tree
Hide file tree
Showing 20 changed files with 209 additions and 126 deletions.
16 changes: 9 additions & 7 deletions babeld/babel_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,20 @@ static const struct frr_yang_module_info *const babeld_yang_modules[] = {
&frr_vrf_info,
};

/* clang-format off */
FRR_DAEMON_INFO(babeld, BABELD,
.vty_port = BABEL_VTY_PORT,
.proghelp = "Implementation of the BABEL routing protocol.",
.vty_port = BABEL_VTY_PORT,
.proghelp = "Implementation of the BABEL routing protocol.",

.signals = babel_signals,
.n_signals = array_size(babel_signals),
.signals = babel_signals,
.n_signals = array_size(babel_signals),

.privs = &babeld_privs,
.privs = &babeld_privs,

.yang_modules = babeld_yang_modules,
.n_yang_modules = array_size(babeld_yang_modules),
.yang_modules = babeld_yang_modules,
.n_yang_modules = array_size(babeld_yang_modules),
);
/* clang-format on */

int
main(int argc, char **argv)
Expand Down
19 changes: 13 additions & 6 deletions bfdd/bfdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,20 @@ static const struct frr_yang_module_info *const bfdd_yang_modules[] = {
&frr_vrf_info,
};

FRR_DAEMON_INFO(bfdd, BFD, .vty_port = 2617,
.proghelp = "Implementation of the BFD protocol.",
.signals = bfd_signals, .n_signals = array_size(bfd_signals),
.privs = &bglobal.bfdd_privs,
.yang_modules = bfdd_yang_modules,
.n_yang_modules = array_size(bfdd_yang_modules),
/* clang-format off */
FRR_DAEMON_INFO(bfdd, BFD,
.vty_port = 2617,
.proghelp = "Implementation of the BFD protocol.",

.signals = bfd_signals,
.n_signals = array_size(bfd_signals),

.privs = &bglobal.bfdd_privs,

.yang_modules = bfdd_yang_modules,
.n_yang_modules = array_size(bfdd_yang_modules),
);
/* clang-format on */

#define OPTION_CTLSOCK 1001
#define OPTION_DPLANEADDR 2000
Expand Down
15 changes: 10 additions & 5 deletions bgpd/bgp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,20 @@ static const struct frr_yang_module_info *const bgpd_yang_modules[] = {
&frr_bgp_route_map_info,
};

FRR_DAEMON_INFO(bgpd, BGP, .vty_port = BGP_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(bgpd, BGP,
.vty_port = BGP_VTY_PORT,
.proghelp = "Implementation of the BGP routing protocol.",

.proghelp = "Implementation of the BGP routing protocol.",
.signals = bgp_signals,
.n_signals = array_size(bgp_signals),

.signals = bgp_signals, .n_signals = array_size(bgp_signals),
.privs = &bgpd_privs,

.privs = &bgpd_privs, .yang_modules = bgpd_yang_modules,
.n_yang_modules = array_size(bgpd_yang_modules),
.yang_modules = bgpd_yang_modules,
.n_yang_modules = array_size(bgpd_yang_modules),
);
/* clang-format on */

#define DEPRECATED_OPTIONS ""

Expand Down
16 changes: 10 additions & 6 deletions eigrpd/eigrp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,20 @@ static const struct frr_yang_module_info *const eigrpd_yang_modules[] = {
&frr_vrf_info,
};

FRR_DAEMON_INFO(eigrpd, EIGRP, .vty_port = EIGRP_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(eigrpd, EIGRP,
.vty_port = EIGRP_VTY_PORT,
.proghelp = "Implementation of the EIGRP routing protocol.",

.proghelp = "Implementation of the EIGRP routing protocol.",
.signals = eigrp_signals,
.n_signals = array_size(eigrp_signals),

.signals = eigrp_signals,
.n_signals = array_size(eigrp_signals),
.privs = &eigrpd_privs,

.privs = &eigrpd_privs, .yang_modules = eigrpd_yang_modules,
.n_yang_modules = array_size(eigrpd_yang_modules),
.yang_modules = eigrpd_yang_modules,
.n_yang_modules = array_size(eigrpd_yang_modules),
);
/* clang-format on */

/* EIGRPd main routine. */
int main(int argc, char **argv, char **envp)
Expand Down
26 changes: 16 additions & 10 deletions isisd/isis_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,30 @@ static void isis_config_end(void)
isis_config_finish(t_isis_cfg);
}

/* clang-format off */
FRR_DAEMON_INFO(
#ifdef FABRICD
FRR_DAEMON_INFO(fabricd, OPEN_FABRIC, .vty_port = FABRICD_VTY_PORT,
fabricd, OPEN_FABRIC,

.proghelp = "Implementation of the OpenFabric routing protocol.",
.vty_port = FABRICD_VTY_PORT,
.proghelp = "Implementation of the OpenFabric routing protocol.",
#else
FRR_DAEMON_INFO(isisd, ISIS, .vty_port = ISISD_VTY_PORT,
isisd, ISIS,

.proghelp = "Implementation of the IS-IS routing protocol.",
.vty_port = ISISD_VTY_PORT,
.proghelp = "Implementation of the IS-IS routing protocol.",
#endif
.copyright =
"Copyright (c) 2001-2002 Sampo Saaristo, Ofer Wald and Hannes Gredler",
.copyright = "Copyright (c) 2001-2002 Sampo Saaristo, Ofer Wald and Hannes Gredler",

.signals = isisd_signals,
.n_signals = array_size(isisd_signals),

.signals = isisd_signals,
.n_signals = array_size(isisd_signals),
.privs = &isisd_privs,

.privs = &isisd_privs, .yang_modules = isisd_yang_modules,
.n_yang_modules = array_size(isisd_yang_modules),
.yang_modules = isisd_yang_modules,
.n_yang_modules = array_size(isisd_yang_modules),
);
/* clang-format on */

/*
* Main routine of isisd. Parse arguments and handle IS-IS state machine.
Expand Down
2 changes: 2 additions & 0 deletions ldpd/ldpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ static const struct frr_yang_module_info *const ldpd_yang_modules[] = {
&frr_vrf_info,
};

/* clang-format off */
FRR_DAEMON_INFO(ldpd, LDP,
.vty_port = LDP_VTY_PORT,

Expand All @@ -210,6 +211,7 @@ FRR_DAEMON_INFO(ldpd, LDP,
.yang_modules = ldpd_yang_modules,
.n_yang_modules = array_size(ldpd_yang_modules),
);
/* clang-format on */

static void ldp_config_fork_apply(struct event *t)
{
Expand Down
20 changes: 13 additions & 7 deletions mgmtd/mgmt_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,23 @@ static const struct frr_yang_module_info *const mgmt_yang_modules[] = {
#endif
};

FRR_DAEMON_INFO(mgmtd, MGMTD, .vty_port = MGMTD_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(mgmtd, MGMTD,
.vty_port = MGMTD_VTY_PORT,
.proghelp = "FRR Management Daemon.",

.proghelp = "FRR Management Daemon.",
.signals = mgmt_signals,
.n_signals = array_size(mgmt_signals),

.signals = mgmt_signals, .n_signals = array_size(mgmt_signals),
.privs = &mgmt_privs,

.privs = &mgmt_privs, .yang_modules = mgmt_yang_modules,
.n_yang_modules = array_size(mgmt_yang_modules),
.yang_modules = mgmt_yang_modules,
.n_yang_modules = array_size(mgmt_yang_modules),

/* avoid libfrr trying to read our config file for us */
.flags = FRR_MANUAL_VTY_START);
/* avoid libfrr trying to read our config file for us */
.flags = FRR_MANUAL_VTY_START,
);
/* clang-format on */

#define DEPRECATED_OPTIONS ""

Expand Down
15 changes: 10 additions & 5 deletions nhrpd/nhrp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,20 @@ static const struct frr_yang_module_info *const nhrpd_yang_modules[] = {
&frr_vrf_info,
};

FRR_DAEMON_INFO(nhrpd, NHRP, .vty_port = NHRP_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(nhrpd, NHRP,
.vty_port = NHRP_VTY_PORT,
.proghelp = "Implementation of the NHRP routing protocol.",

.proghelp = "Implementation of the NHRP routing protocol.",
.signals = sighandlers,
.n_signals = array_size(sighandlers),

.signals = sighandlers, .n_signals = array_size(sighandlers),
.privs = &nhrpd_privs,

.privs = &nhrpd_privs, .yang_modules = nhrpd_yang_modules,
.n_yang_modules = array_size(nhrpd_yang_modules),
.yang_modules = nhrpd_yang_modules,
.n_yang_modules = array_size(nhrpd_yang_modules),
);
/* clang-format on */

int main(int argc, char **argv)
{
Expand Down
16 changes: 10 additions & 6 deletions ospf6d/ospf6_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,20 @@ static const struct frr_yang_module_info *const ospf6d_yang_modules[] = {
&frr_ospf6_route_map_info,
};

FRR_DAEMON_INFO(ospf6d, OSPF6, .vty_port = OSPF6_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(ospf6d, OSPF6,
.vty_port = OSPF6_VTY_PORT,
.proghelp = "Implementation of the OSPFv3 routing protocol.",

.proghelp = "Implementation of the OSPFv3 routing protocol.",
.signals = ospf6_signals,
.n_signals = array_size(ospf6_signals),

.signals = ospf6_signals,
.n_signals = array_size(ospf6_signals),
.privs = &ospf6d_privs,

.privs = &ospf6d_privs, .yang_modules = ospf6d_yang_modules,
.n_yang_modules = array_size(ospf6d_yang_modules),
.yang_modules = ospf6d_yang_modules,
.n_yang_modules = array_size(ospf6d_yang_modules),
);
/* clang-format on */

/* Max wait time for config to load before accepting hellos */
#define OSPF6_PRE_CONFIG_MAX_WAIT_SECONDS 600
Expand Down
15 changes: 10 additions & 5 deletions ospfd/ospf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,20 @@ static const struct frr_yang_module_info *const ospfd_yang_modules[] = {
&frr_ospf_route_map_info,
};

FRR_DAEMON_INFO(ospfd, OSPF, .vty_port = OSPF_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(ospfd, OSPF,
.vty_port = OSPF_VTY_PORT,
.proghelp = "Implementation of the OSPFv2 routing protocol.",

.proghelp = "Implementation of the OSPFv2 routing protocol.",
.signals = ospf_signals,
.n_signals = array_size(ospf_signals),

.signals = ospf_signals, .n_signals = array_size(ospf_signals),
.privs = &ospfd_privs,

.privs = &ospfd_privs, .yang_modules = ospfd_yang_modules,
.n_yang_modules = array_size(ospfd_yang_modules),
.yang_modules = ospfd_yang_modules,
.n_yang_modules = array_size(ospfd_yang_modules),
);
/* clang-format on */

/** Max wait time for config to load before accepting hellos */
#define OSPF_PRE_CONFIG_MAX_WAIT_SECONDS 600
Expand Down
15 changes: 10 additions & 5 deletions pathd/path_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,20 @@ static const struct frr_yang_module_info *pathd_yang_modules[] = {

#define PATH_VTY_PORT 2621

FRR_DAEMON_INFO(pathd, PATH, .vty_port = PATH_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(pathd, PATH,
.vty_port = PATH_VTY_PORT,
.proghelp = "Implementation of PATH.",

.proghelp = "Implementation of PATH.",
.signals = path_signals,
.n_signals = array_size(path_signals),

.signals = path_signals, .n_signals = array_size(path_signals),
.privs = &pathd_privs,

.privs = &pathd_privs, .yang_modules = pathd_yang_modules,
.n_yang_modules = array_size(pathd_yang_modules),
.yang_modules = pathd_yang_modules,
.n_yang_modules = array_size(pathd_yang_modules),
);
/* clang-format on */

int main(int argc, char **argv, char **envp)
{
Expand Down
18 changes: 10 additions & 8 deletions pbrd/pbr_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,20 @@ static const struct frr_yang_module_info *const pbrd_yang_modules[] = {
&frr_vrf_info,
};

FRR_DAEMON_INFO(pbrd, PBR, .vty_port = PBR_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(pbrd, PBR,
.vty_port = PBR_VTY_PORT,
.proghelp = "Implementation of PBR.",

.proghelp = "Implementation of PBR.",
.signals = pbr_signals,
.n_signals = array_size(pbr_signals),

.signals = pbr_signals,
.n_signals = array_size(pbr_signals),
.privs = &pbr_privs,

.privs = &pbr_privs,

.yang_modules = pbrd_yang_modules,
.n_yang_modules = array_size(pbrd_yang_modules),
.yang_modules = pbrd_yang_modules,
.n_yang_modules = array_size(pbrd_yang_modules),
);
/* clang-format on */

int main(int argc, char **argv, char **envp)
{
Expand Down
17 changes: 10 additions & 7 deletions pimd/pim_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,20 @@ static const struct frr_yang_module_info *const pimd_yang_modules[] = {
&frr_gmp_info,
};

FRR_DAEMON_INFO(pimd, PIM, .vty_port = PIMD_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(pimd, PIM,
.vty_port = PIMD_VTY_PORT,
.proghelp = "Implementation of the PIM routing protocol.",

.proghelp = "Implementation of the PIM routing protocol.",
.signals = pimd_signals,
.n_signals = 4 /* XXX array_size(pimd_signals) XXX*/,

.signals = pimd_signals,
.n_signals = 4 /* XXX array_size(pimd_signals) XXX*/,
.privs = &pimd_privs,

.privs = &pimd_privs, .yang_modules = pimd_yang_modules,
.n_yang_modules = array_size(pimd_yang_modules),
.yang_modules = pimd_yang_modules,
.n_yang_modules = array_size(pimd_yang_modules),
);

/* clang-format on */

int main(int argc, char **argv, char **envp)
{
Expand Down
19 changes: 12 additions & 7 deletions ripd/rip_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,23 @@ static const struct frr_yang_module_info *const ripd_yang_modules[] = {
&frr_vrf_info,
};

FRR_DAEMON_INFO(ripd, RIP, .vty_port = RIP_VTY_PORT,
/* clang-format off */
FRR_DAEMON_INFO(ripd, RIP,
.vty_port = RIP_VTY_PORT,
.proghelp = "Implementation of the RIP routing protocol.",

.proghelp = "Implementation of the RIP routing protocol.",
.signals = ripd_signals,
.n_signals = array_size(ripd_signals),

.signals = ripd_signals, .n_signals = array_size(ripd_signals),
.privs = &ripd_privs,

.privs = &ripd_privs, .yang_modules = ripd_yang_modules,
.n_yang_modules = array_size(ripd_yang_modules),
.yang_modules = ripd_yang_modules,
.n_yang_modules = array_size(ripd_yang_modules),

/* mgmtd will load the per-daemon config file now */
.flags = FRR_NO_SPLIT_CONFIG,
/* mgmtd will load the per-daemon config file now */
.flags = FRR_NO_SPLIT_CONFIG,
);
/* clang-format on */

#define DEPRECATED_OPTIONS ""

Expand Down
Loading

0 comments on commit 634f481

Please sign in to comment.