summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-05-25 16:37:48 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-05-30 14:00:55 +0200
commit215181cbf144f86ee87965174029e76f88aec42b (patch)
tree5caaf79fc79626eabda6bd8fb1013b45d647df9e
parentMerge pull request #2142 from pguibert6WIND/fs_zebra_complement (diff)
downloadfrr-215181cbf144f86ee87965174029e76f88aec42b.tar.xz
frr-215181cbf144f86ee87965174029e76f88aec42b.zip
zebra: Rename SOUTHBOUND_XXX to DP_XXX
The SOUTHBOUND_XXX enum was named a bit poorly. Let's use a bit better name for what we are trying to do. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--zebra/rt.h14
-rw-r--r--zebra/rt_netlink.c15
-rw-r--r--zebra/rt_socket.c8
-rw-r--r--zebra/rule_netlink.c8
-rw-r--r--zebra/zebra_mpls.c10
-rw-r--r--zebra/zebra_mpls_netlink.c20
-rw-r--r--zebra/zebra_mpls_openbsd.c20
-rw-r--r--zebra/zebra_pbr.c52
-rw-r--r--zebra/zebra_pbr.h10
-rw-r--r--zebra/zebra_rib.c10
10 files changed, 85 insertions, 82 deletions
diff --git a/zebra/rt.h b/zebra/rt.h
index fd298fd23..1c10fa5cd 100644
--- a/zebra/rt.h
+++ b/zebra/rt.h
@@ -42,11 +42,11 @@
*/
-enum southbound_results {
- SOUTHBOUND_INSTALL_SUCCESS,
- SOUTHBOUND_INSTALL_FAILURE,
- SOUTHBOUND_DELETE_SUCCESS,
- SOUTHBOUND_DELETE_FAILURE,
+enum dp_results {
+ DP_INSTALL_SUCCESS,
+ DP_INSTALL_FAILURE,
+ DP_DELETE_SUCCESS,
+ DP_DELETE_FAILURE,
};
/*
@@ -71,7 +71,7 @@ extern void kernel_route_rib(struct route_node *rn, struct prefix *p,
*/
extern void kernel_route_rib_pass_fail(struct route_node *rn, struct prefix *p,
struct route_entry *re,
- enum southbound_results res);
+ enum dp_results res);
extern int kernel_address_add_ipv4(struct interface *, struct connected *);
extern int kernel_address_delete_ipv4(struct interface *, struct connected *);
@@ -95,7 +95,7 @@ extern void kernel_del_lsp(zebra_lsp_t *lsp);
* the install/failure to set/unset flags and to notify
* as needed.
*/
-extern void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res);
+extern void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum dp_results res);
extern int mpls_kernel_init(void);
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index e9b3e59d0..d902f03a4 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1690,8 +1690,9 @@ int kernel_get_ipmr_sg_stats(struct zebra_vrf *zvrf, void *in)
}
void kernel_route_rib(struct route_node *rn, struct prefix *p,
- struct prefix *src_p, struct route_entry *old,
- struct route_entry *new)
+ struct prefix *src_p,
+ struct route_entry *old,
+ struct route_entry *new)
{
int ret = 0;
@@ -1721,8 +1722,8 @@ void kernel_route_rib(struct route_node *rn, struct prefix *p,
new, 0);
}
kernel_route_rib_pass_fail(rn, p, new,
- (!ret) ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ (!ret) ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
return;
}
@@ -1730,9 +1731,11 @@ void kernel_route_rib(struct route_node *rn, struct prefix *p,
ret = netlink_route_multipath(RTM_DELROUTE, p, src_p, old, 0);
kernel_route_rib_pass_fail(rn, p, old,
- (!ret) ? SOUTHBOUND_DELETE_SUCCESS
- : SOUTHBOUND_DELETE_FAILURE);
+ (!ret) ? DP_DELETE_SUCCESS
+ : DP_DELETE_FAILURE);
}
+
+ return;
}
int kernel_neigh_update(int add, int ifindex, uint32_t addr, char *lla,
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index f9cd1cbab..961e73247 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -411,13 +411,13 @@ void kernel_route_rib(struct route_node *rn, struct prefix *p,
if (new) {
kernel_route_rib_pass_fail(
rn, p, new,
- (!route) ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ (!route) ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
} else {
kernel_route_rib_pass_fail(rn, p, old,
(!route)
- ? SOUTHBOUND_DELETE_SUCCESS
- : SOUTHBOUND_DELETE_FAILURE);
+ ? DP_DELETE_SUCCESS
+ : DP_DELETE_FAILURE);
}
}
diff --git a/zebra/rule_netlink.c b/zebra/rule_netlink.c
index f0ed8f2f5..fdafb2286 100644
--- a/zebra/rule_netlink.c
+++ b/zebra/rule_netlink.c
@@ -148,8 +148,8 @@ void kernel_add_pbr_rule(struct zebra_pbr_rule *rule)
ret = netlink_rule_update(RTM_NEWRULE, rule);
kernel_pbr_rule_add_del_status(rule,
- (!ret) ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ (!ret) ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
}
/*
@@ -161,8 +161,8 @@ void kernel_del_pbr_rule(struct zebra_pbr_rule *rule)
ret = netlink_rule_update(RTM_DELRULE, rule);
kernel_pbr_rule_add_del_status(rule,
- (!ret) ? SOUTHBOUND_DELETE_SUCCESS
- : SOUTHBOUND_DELETE_FAILURE);
+ (!ret) ? DP_DELETE_SUCCESS
+ : DP_DELETE_FAILURE);
}
/*
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index 3ad640653..69d09a08c 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -1687,7 +1687,7 @@ static int mpls_processq_init(struct zebra_t *zebra)
/* Public functions */
-void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res)
+void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum dp_results res)
{
struct nexthop *nexthop;
zebra_nhlfe_t *nhlfe;
@@ -1696,12 +1696,12 @@ void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res)
return;
switch (res) {
- case SOUTHBOUND_INSTALL_FAILURE:
+ case DP_INSTALL_FAILURE:
UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
clear_nhlfe_installed(lsp);
zlog_warn("LSP Install Failure: %u", lsp->ile.in_label);
break;
- case SOUTHBOUND_INSTALL_SUCCESS:
+ case DP_INSTALL_SUCCESS:
SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
for (nhlfe = lsp->nhlfe_list; nhlfe; nhlfe = nhlfe->next) {
nexthop = nhlfe->nexthop;
@@ -1712,11 +1712,11 @@ void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res)
SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
}
break;
- case SOUTHBOUND_DELETE_SUCCESS:
+ case DP_DELETE_SUCCESS:
UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
clear_nhlfe_installed(lsp);
break;
- case SOUTHBOUND_DELETE_FAILURE:
+ case DP_DELETE_FAILURE:
zlog_warn("LSP Deletion Failure: %u", lsp->ile.in_label);
break;
}
diff --git a/zebra/zebra_mpls_netlink.c b/zebra/zebra_mpls_netlink.c
index d7c231c37..15aba89a2 100644
--- a/zebra/zebra_mpls_netlink.c
+++ b/zebra/zebra_mpls_netlink.c
@@ -34,15 +34,15 @@ void kernel_add_lsp(zebra_lsp_t *lsp)
int ret;
if (!lsp || !lsp->best_nhlfe) { // unexpected
- kernel_lsp_pass_fail(lsp, SOUTHBOUND_INSTALL_FAILURE);
+ kernel_lsp_pass_fail(lsp, DP_INSTALL_FAILURE);
return;
}
ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp);
kernel_lsp_pass_fail(lsp,
- (!ret) ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ (!ret) ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
}
/*
@@ -61,15 +61,15 @@ void kernel_upd_lsp(zebra_lsp_t *lsp)
int ret;
if (!lsp || !lsp->best_nhlfe) { // unexpected
- kernel_lsp_pass_fail(lsp, SOUTHBOUND_INSTALL_FAILURE);
+ kernel_lsp_pass_fail(lsp, DP_INSTALL_FAILURE);
return;
}
ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp);
kernel_lsp_pass_fail(lsp,
- (!ret) ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ (!ret) ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
}
/*
@@ -80,20 +80,20 @@ void kernel_del_lsp(zebra_lsp_t *lsp)
int ret;
if (!lsp) { // unexpected
- kernel_lsp_pass_fail(lsp, SOUTHBOUND_DELETE_FAILURE);
+ kernel_lsp_pass_fail(lsp, DP_DELETE_FAILURE);
return;
}
if (!CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED)) {
- kernel_lsp_pass_fail(lsp, SOUTHBOUND_DELETE_FAILURE);
+ kernel_lsp_pass_fail(lsp, DP_DELETE_FAILURE);
return;
}
ret = netlink_mpls_multipath(RTM_DELROUTE, lsp);
kernel_lsp_pass_fail(lsp,
- (!ret) ? SOUTHBOUND_DELETE_SUCCESS
- : SOUTHBOUND_DELETE_FAILURE);
+ (!ret) ? DP_DELETE_SUCCESS
+ : DP_DELETE_FAILURE);
}
int mpls_kernel_init(void)
diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c
index 2d75353c7..80595972b 100644
--- a/zebra/zebra_mpls_openbsd.c
+++ b/zebra/zebra_mpls_openbsd.c
@@ -290,15 +290,15 @@ void kernel_add_lsp(zebra_lsp_t *lsp)
int ret;
if (!lsp || !lsp->best_nhlfe) { // unexpected
- kernel_lsp_pass_fail(lsp, SOUTHBOUND_INSTALL_FAILURE);
+ kernel_lsp_pass_fail(lsp, DP_INSTALL_FAILURE);
return;
}
ret = kernel_lsp_cmd(RTM_ADD, lsp);
kernel_lsp_pass_fail(lsp,
- (!ret) ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ (!ret) ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
}
void kernel_upd_lsp(zebra_lsp_t *lsp)
@@ -306,15 +306,15 @@ void kernel_upd_lsp(zebra_lsp_t *lsp)
int ret;
if (!lsp || !lsp->best_nhlfe) { // unexpected
- kernel_lsp_pass_fail(lsp, SOUTHBOUND_INSTALL_FAILURE);
+ kernel_lsp_pass_fail(lsp, DP_INSTALL_FAILURE);
return;
}
ret = kernel_lsp_cmd(RTM_CHANGE, lsp);
kernel_lsp_pass_fail(lsp,
- (!ret) ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ (!ret) ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
return;
}
@@ -323,20 +323,20 @@ void kernel_del_lsp(zebra_lsp_t *lsp)
int ret;
if (!lsp) { // unexpected
- kernel_lsp_pass_fail(lsp, SOUTHBOUND_DELETE_FAILURE);
+ kernel_lsp_pass_fail(lsp, DP_DELETE_FAILURE);
return;
}
if (!CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED)) {
- kernel_lsp_pass_fail(lsp, SOUTHBOUND_DELETE_FAILURE);
+ kernel_lsp_pass_fail(lsp, DP_DELETE_FAILURE);
return;
}
ret = kernel_lsp_cmd(RTM_DELETE, lsp);
kernel_lsp_pass_fail(lsp,
- (!ret) ? SOUTHBOUND_DELETE_SUCCESS
- : SOUTHBOUND_DELETE_FAILURE);
+ (!ret) ? DP_DELETE_SUCCESS
+ : DP_DELETE_FAILURE);
}
static int kmpw_install(struct zebra_pw *pw)
diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c
index 6a42aaecb..84fb3d76a 100644
--- a/zebra/zebra_pbr.c
+++ b/zebra/zebra_pbr.c
@@ -489,8 +489,8 @@ void zebra_pbr_create_ipset(struct zebra_ns *zns,
ret = hook_call(zebra_pbr_ipset_wrap_script_update,
zns, 1, ipset);
kernel_pbr_ipset_add_del_status(ipset,
- ret ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ ret ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
}
void zebra_pbr_destroy_ipset(struct zebra_ns *zns,
@@ -573,8 +573,8 @@ void zebra_pbr_add_ipset_entry(struct zebra_ns *zns,
ret = hook_call(zebra_pbr_ipset_entry_wrap_script_update,
zns, 1, ipset);
kernel_pbr_ipset_entry_add_del_status(ipset,
- ret ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ ret ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
}
void zebra_pbr_del_ipset_entry(struct zebra_ns *zns,
@@ -616,8 +616,8 @@ void zebra_pbr_add_iptable(struct zebra_ns *zns,
pbr_iptable_alloc_intern);
ret = hook_call(zebra_pbr_iptable_wrap_script_update, zns, 1, iptable);
kernel_pbr_iptable_add_del_status(iptable,
- ret ? SOUTHBOUND_INSTALL_SUCCESS
- : SOUTHBOUND_INSTALL_FAILURE);
+ ret ? DP_INSTALL_SUCCESS
+ : DP_INSTALL_FAILURE);
}
void zebra_pbr_del_iptable(struct zebra_ns *zns,
@@ -648,19 +648,19 @@ void zebra_pbr_del_iptable(struct zebra_ns *zns,
* Handle success or failure of rule (un)install in the kernel.
*/
void kernel_pbr_rule_add_del_status(struct zebra_pbr_rule *rule,
- enum southbound_results res)
+ enum dp_results res)
{
switch (res) {
- case SOUTHBOUND_INSTALL_SUCCESS:
+ case DP_INSTALL_SUCCESS:
zsend_rule_notify_owner(rule, ZAPI_RULE_INSTALLED);
break;
- case SOUTHBOUND_INSTALL_FAILURE:
+ case DP_INSTALL_FAILURE:
zsend_rule_notify_owner(rule, ZAPI_RULE_FAIL_INSTALL);
break;
- case SOUTHBOUND_DELETE_SUCCESS:
+ case DP_DELETE_SUCCESS:
zsend_rule_notify_owner(rule, ZAPI_RULE_REMOVED);
break;
- case SOUTHBOUND_DELETE_FAILURE:
+ case DP_DELETE_FAILURE:
zsend_rule_notify_owner(rule, ZAPI_RULE_FAIL_REMOVE);
break;
}
@@ -670,19 +670,19 @@ void kernel_pbr_rule_add_del_status(struct zebra_pbr_rule *rule,
* Handle success or failure of ipset (un)install in the kernel.
*/
void kernel_pbr_ipset_add_del_status(struct zebra_pbr_ipset *ipset,
- enum southbound_results res)
+ enum dp_results res)
{
switch (res) {
- case SOUTHBOUND_INSTALL_SUCCESS:
+ case DP_INSTALL_SUCCESS:
zsend_ipset_notify_owner(ipset, ZAPI_IPSET_INSTALLED);
break;
- case SOUTHBOUND_INSTALL_FAILURE:
+ case DP_INSTALL_FAILURE:
zsend_ipset_notify_owner(ipset, ZAPI_IPSET_FAIL_INSTALL);
break;
- case SOUTHBOUND_DELETE_SUCCESS:
+ case DP_DELETE_SUCCESS:
zsend_ipset_notify_owner(ipset, ZAPI_IPSET_REMOVED);
break;
- case SOUTHBOUND_DELETE_FAILURE:
+ case DP_DELETE_FAILURE:
zsend_ipset_notify_owner(ipset, ZAPI_IPSET_FAIL_REMOVE);
break;
}
@@ -693,22 +693,22 @@ void kernel_pbr_ipset_add_del_status(struct zebra_pbr_ipset *ipset,
*/
void kernel_pbr_ipset_entry_add_del_status(
struct zebra_pbr_ipset_entry *ipset,
- enum southbound_results res)
+ enum dp_results res)
{
switch (res) {
- case SOUTHBOUND_INSTALL_SUCCESS:
+ case DP_INSTALL_SUCCESS:
zsend_ipset_entry_notify_owner(ipset,
ZAPI_IPSET_ENTRY_INSTALLED);
break;
- case SOUTHBOUND_INSTALL_FAILURE:
+ case DP_INSTALL_FAILURE:
zsend_ipset_entry_notify_owner(ipset,
ZAPI_IPSET_ENTRY_FAIL_INSTALL);
break;
- case SOUTHBOUND_DELETE_SUCCESS:
+ case DP_DELETE_SUCCESS:
zsend_ipset_entry_notify_owner(ipset,
ZAPI_IPSET_ENTRY_REMOVED);
break;
- case SOUTHBOUND_DELETE_FAILURE:
+ case DP_DELETE_FAILURE:
zsend_ipset_entry_notify_owner(ipset,
ZAPI_IPSET_ENTRY_FAIL_REMOVE);
break;
@@ -719,20 +719,20 @@ void kernel_pbr_ipset_entry_add_del_status(
* Handle success or failure of ipset (un)install in the kernel.
*/
void kernel_pbr_iptable_add_del_status(struct zebra_pbr_iptable *iptable,
- enum southbound_results res)
+ enum dp_results res)
{
switch (res) {
- case SOUTHBOUND_INSTALL_SUCCESS:
+ case DP_INSTALL_SUCCESS:
zsend_iptable_notify_owner(iptable, ZAPI_IPTABLE_INSTALLED);
break;
- case SOUTHBOUND_INSTALL_FAILURE:
+ case DP_INSTALL_FAILURE:
zsend_iptable_notify_owner(iptable, ZAPI_IPTABLE_FAIL_INSTALL);
break;
- case SOUTHBOUND_DELETE_SUCCESS:
+ case DP_DELETE_SUCCESS:
zsend_iptable_notify_owner(iptable,
ZAPI_IPTABLE_REMOVED);
break;
- case SOUTHBOUND_DELETE_FAILURE:
+ case DP_DELETE_FAILURE:
zsend_iptable_notify_owner(iptable,
ZAPI_IPTABLE_FAIL_REMOVE);
break;
diff --git a/zebra/zebra_pbr.h b/zebra/zebra_pbr.h
index 31fc55358..bd942b9ae 100644
--- a/zebra/zebra_pbr.h
+++ b/zebra/zebra_pbr.h
@@ -174,25 +174,25 @@ extern void kernel_del_pbr_rule(struct zebra_pbr_rule *rule);
*/
extern void kernel_read_pbr_rules(struct zebra_ns *zns);
-enum southbound_results;
+enum dp_results;
/*
* Handle success or failure of rule (un)install in the kernel.
*/
extern void kernel_pbr_rule_add_del_status(struct zebra_pbr_rule *rule,
- enum southbound_results res);
+ enum dp_results res);
/*
* Handle success or failure of ipset kinds (un)install in the kernel.
*/
extern void kernel_pbr_ipset_add_del_status(struct zebra_pbr_ipset *ipset,
- enum southbound_results res);
+ enum dp_results res);
extern void kernel_pbr_ipset_entry_add_del_status(
struct zebra_pbr_ipset_entry *ipset,
- enum southbound_results res);
+ enum dp_results res);
extern void kernel_pbr_iptable_add_del_status(struct zebra_pbr_iptable *iptable,
- enum southbound_results res);
+ enum dp_results res);
/*
* Handle rule delete notification from kernel.
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index dec4ed06a..4a4b0c781 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1014,7 +1014,7 @@ int zebra_rib_labeled_unicast(struct route_entry *re)
void kernel_route_rib_pass_fail(struct route_node *rn, struct prefix *p,
struct route_entry *re,
- enum southbound_results res)
+ enum dp_results res)
{
struct nexthop *nexthop;
char buf[PREFIX_STRLEN];
@@ -1023,7 +1023,7 @@ void kernel_route_rib_pass_fail(struct route_node *rn, struct prefix *p,
dest = rib_dest_from_rnode(rn);
switch (res) {
- case SOUTHBOUND_INSTALL_SUCCESS:
+ case DP_INSTALL_SUCCESS:
dest->selected_fib = re;
for (ALL_NEXTHOPS(re->ng, nexthop)) {
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
@@ -1036,7 +1036,7 @@ void kernel_route_rib_pass_fail(struct route_node *rn, struct prefix *p,
}
zsend_route_notify_owner(re, p, ZAPI_ROUTE_INSTALLED);
break;
- case SOUTHBOUND_INSTALL_FAILURE:
+ case DP_INSTALL_FAILURE:
/*
* I am not sure this is the right thing to do here
* but the code always set selected_fib before
@@ -1048,7 +1048,7 @@ void kernel_route_rib_pass_fail(struct route_node *rn, struct prefix *p,
zlog_warn("%u:%s: Route install failed", re->vrf_id,
prefix2str(p, buf, sizeof(buf)));
break;
- case SOUTHBOUND_DELETE_SUCCESS:
+ case DP_DELETE_SUCCESS:
/*
* The case where selected_fib is not re is
* when we have received a system route
@@ -1063,7 +1063,7 @@ void kernel_route_rib_pass_fail(struct route_node *rn, struct prefix *p,
zsend_route_notify_owner(re, p, ZAPI_ROUTE_REMOVED);
break;
- case SOUTHBOUND_DELETE_FAILURE:
+ case DP_DELETE_FAILURE:
/*
* Should we set this to NULL if the
* delete fails?