summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd/ldpd.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2016-05-23 16:14:38 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2016-05-23 16:14:38 +0000
commit23864ce1ee167f94ca9df3b42882c216d7b34615 (patch)
treee600baca2cf148eb7cae83be7c23afa19a549a3a /usr.sbin/ldpd/ldpd.c
parent74a0f263b82f760fff9cff8429f809bbb667cdba (diff)
More renaming.
Rename a few more things to improve readability. * s/F_PW_CONTROLWORD_CONF/F_PW_CWORD_CONF/ (shorter) * s/F_PW_CONTROLWORD/F_PW_CWORD/ (shorter) * s/LDPD_FLAG_*/F_LDPD_*/ (consistency) * s/lde_nbr_address/lde_addr/ (shorter) * s/ldp_discovery_socket/ldp_disc_socket/ (shorter) * s/ldp_ediscovery_socket/ldp_edisc_socket/ (shorter) * s/ldp_sendboth/main_imsg_compose_both/ (consistency) * s/cons/total/ (makes more sense) * s/kaddr/ka/ (consistency with remaining code) * Always use 'ln' for lde_nbrs (consistency)
Diffstat (limited to 'usr.sbin/ldpd/ldpd.c')
-rw-r--r--usr.sbin/ldpd/ldpd.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/usr.sbin/ldpd/ldpd.c b/usr.sbin/ldpd/ldpd.c
index 9eb04e24d3e..1cf82c446a1 100644
--- a/usr.sbin/ldpd/ldpd.c
+++ b/usr.sbin/ldpd/ldpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.c,v 1.33 2016/05/23 15:55:45 renato Exp $ */
+/* $OpenBSD: ldpd.c,v 1.34 2016/05/23 16:14:36 renato Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -247,7 +247,7 @@ main(int argc, char *argv[])
/* notify ldpe about existing interfaces and addresses */
kif_redistribute();
- if (kr_init(!(ldpd_conf->flags & LDPD_FLAG_NO_FIB_UPDATE)) == -1)
+ if (kr_init(!(ldpd_conf->flags & F_LDPD_NO_FIB_UPDATE)) == -1)
fatalx("kr_init failed");
/* remove unneded stuff from config */
@@ -480,7 +480,7 @@ main_imsg_compose_lde(int type, pid_t pid, void *data, u_int16_t datalen)
}
int
-ldp_sendboth(enum imsg_type type, void *buf, uint16_t len)
+main_imsg_compose_both(enum imsg_type type, void *buf, uint16_t len)
{
if (imsg_compose_event(iev_ldpe, type, 0, 0, -1, buf, len) == -1)
return (-1);
@@ -558,45 +558,46 @@ ldp_reload(void)
if ((xconf = parse_config(conffile, ldpd_conf->opts)) == NULL)
return (-1);
- if (ldp_sendboth(IMSG_RECONF_CONF, xconf, sizeof(*xconf)) == -1)
+ if (main_imsg_compose_both(IMSG_RECONF_CONF, xconf,
+ sizeof(*xconf)) == -1)
return (-1);
LIST_FOREACH(iface, &xconf->iface_list, entry) {
- if (ldp_sendboth(IMSG_RECONF_IFACE, iface,
+ if (main_imsg_compose_both(IMSG_RECONF_IFACE, iface,
sizeof(*iface)) == -1)
return (-1);
}
LIST_FOREACH(tnbr, &xconf->tnbr_list, entry) {
- if (ldp_sendboth(IMSG_RECONF_TNBR, tnbr,
+ if (main_imsg_compose_both(IMSG_RECONF_TNBR, tnbr,
sizeof(*tnbr)) == -1)
return (-1);
}
LIST_FOREACH(nbrp, &xconf->nbrp_list, entry) {
- if (ldp_sendboth(IMSG_RECONF_NBRP, nbrp,
+ if (main_imsg_compose_both(IMSG_RECONF_NBRP, nbrp,
sizeof(*nbrp)) == -1)
return (-1);
}
LIST_FOREACH(l2vpn, &xconf->l2vpn_list, entry) {
- if (ldp_sendboth(IMSG_RECONF_L2VPN, l2vpn,
+ if (main_imsg_compose_both(IMSG_RECONF_L2VPN, l2vpn,
sizeof(*l2vpn)) == -1)
return (-1);
LIST_FOREACH(lif, &l2vpn->if_list, entry) {
- if (ldp_sendboth(IMSG_RECONF_L2VPN_IF, lif,
+ if (main_imsg_compose_both(IMSG_RECONF_L2VPN_IF, lif,
sizeof(*lif)) == -1)
return (-1);
}
LIST_FOREACH(pw, &l2vpn->pw_list, entry) {
- if (ldp_sendboth(IMSG_RECONF_L2VPN_PW, pw,
+ if (main_imsg_compose_both(IMSG_RECONF_L2VPN_PW, pw,
sizeof(*pw)) == -1)
return (-1);
}
}
- if (ldp_sendboth(IMSG_RECONF_END, NULL, 0) == -1)
+ if (main_imsg_compose_both(IMSG_RECONF_END, NULL, 0) == -1)
return (-1);
merge_config(ldpd_conf, xconf);
@@ -883,9 +884,9 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
pw->addr.s_addr != xp->addr.s_addr ||
pw->pwid != xp->pwid ||
((pw->flags &
- (F_PW_STATUSTLV_CONF|F_PW_CONTROLWORD_CONF)) !=
+ (F_PW_STATUSTLV_CONF|F_PW_CWORD_CONF)) !=
(xp->flags &
- (F_PW_STATUSTLV_CONF|F_PW_CONTROLWORD_CONF)))) {
+ (F_PW_STATUSTLV_CONF|F_PW_CWORD_CONF)))) {
LIST_REMOVE(pw, entry);
LIST_REMOVE(xp, entry);
LIST_INSERT_HEAD(&l2vpn->pw_list, xp, entry);