diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-10-18 14:33:54 +0300 | 
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-10-22 09:07:41 +0300 | 
| commit | 2dbe669bdf0f0bcbf0228ccdab7b631bd8b934f1 (patch) | |
| tree | 69c38032b07630b46d2d5852200789b13392153c /pbrd/pbr_zebra.c | |
| parent | 719e0a6a6c4af04d1e9f4ef4bcc1855fc35fda6c (diff) | |
:* Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'pbrd/pbr_zebra.c')
| -rw-r--r-- | pbrd/pbr_zebra.c | 37 | 
1 files changed, 15 insertions, 22 deletions
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index 866f27136e..b8ee974635 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -102,15 +102,14 @@ static int interface_address_add(ZAPI_CALLBACK_ARGS)  static int interface_address_delete(ZAPI_CALLBACK_ARGS)  {  	struct connected *c; -	char buf[PREFIX_STRLEN];  	c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);  	if (!c)  		return 0; -	DEBUGD(&pbr_dbg_zebra, "%s: %s deleted %s", __func__, c->ifp->name, -	       prefix2str(c->address, buf, sizeof(buf))); +	DEBUGD(&pbr_dbg_zebra, "%s: %s deleted %pFX", __func__, c->ifp->name, +	       c->address);  	connected_free(&c);  	return 0; @@ -162,40 +161,37 @@ static int route_notify_owner(ZAPI_CALLBACK_ARGS)  	struct prefix p;  	enum zapi_route_notify_owner note;  	uint32_t table_id; -	char buf[PREFIX_STRLEN];  	if (!zapi_route_notify_decode(zclient->ibuf, &p, &table_id, ¬e))  		return -1; -	prefix2str(&p, buf, sizeof(buf)); -  	switch (note) {  	case ZAPI_ROUTE_FAIL_INSTALL:  		DEBUGD(&pbr_dbg_zebra, -		       "%s: [%s] Route install failure for table: %u", __func__, -		       buf, table_id); +		       "%s: [%pFX] Route install failure for table: %u", +		       __func__, &p, table_id);  		break;  	case ZAPI_ROUTE_BETTER_ADMIN_WON:  		DEBUGD(&pbr_dbg_zebra, -		       "%s: [%s] Route better admin distance won for table: %u", -		       __func__, buf, table_id); +		       "%s: [%pFX] Route better admin distance won for table: %u", +		       __func__, &p, table_id);  		break;  	case ZAPI_ROUTE_INSTALLED:  		DEBUGD(&pbr_dbg_zebra, -		       "%s: [%s] Route installed succeeded for table: %u", -		       __func__, buf, table_id); +		       "%s: [%pFX] Route installed succeeded for table: %u", +		       __func__, &p, table_id);  		pbr_nht_route_installed_for_table(table_id);  		break;  	case ZAPI_ROUTE_REMOVED:  		DEBUGD(&pbr_dbg_zebra, -		       "%s: [%s] Route Removed succeeded for table: %u", -		       __func__, buf, table_id); +		       "%s: [%pFX] Route Removed succeeded for table: %u", +		       __func__, &p, table_id);  		pbr_nht_route_removed_for_table(table_id);  		break;  	case ZAPI_ROUTE_REMOVE_FAIL:  		DEBUGD(&pbr_dbg_zebra, -		       "%s: [%s] Route remove fail for table: %u", __func__, -		       buf, table_id); +		       "%s: [%pFX] Route remove fail for table: %u", __func__, +		       &p, table_id);  		break;  	} @@ -259,14 +255,12 @@ static void route_add_helper(struct zapi_route *api, struct nexthop_group nhg,  			     uint8_t install_afi)  {  	struct zapi_nexthop *api_nh; -	char buf[PREFIX_STRLEN];  	struct nexthop *nhop;  	int i;  	api->prefix.family = install_afi; -	DEBUGD(&pbr_dbg_zebra, "\tEncoding %s", -	       prefix2str(&api->prefix, buf, sizeof(buf))); +	DEBUGD(&pbr_dbg_zebra, "\tEncoding %pFX", &api->prefix);  	i = 0;  	for (ALL_NEXTHOPS(nhg, nhop)) { @@ -397,7 +391,6 @@ void route_delete(struct pbr_nexthop_group_cache *pnhgc, afi_t afi)  static int pbr_zebra_nexthop_update(ZAPI_CALLBACK_ARGS)  {  	struct zapi_route nhr; -	char buf[PREFIX2STR_BUFFER];  	uint32_t i;  	if (!zapi_nexthop_update_decode(zclient->ibuf, &nhr)) { @@ -407,8 +400,8 @@ static int pbr_zebra_nexthop_update(ZAPI_CALLBACK_ARGS)  	if (DEBUG_MODE_CHECK(&pbr_dbg_zebra, DEBUG_MODE_ALL)) { -		DEBUGD(&pbr_dbg_zebra, "%s: Received Nexthop update: %s", -		       __func__, prefix2str(&nhr.prefix, buf, sizeof(buf))); +		DEBUGD(&pbr_dbg_zebra, "%s: Received Nexthop update: %pFX", +		       __func__, &nhr.prefix);  		DEBUGD(&pbr_dbg_zebra, "%s: (\tNexthops(%u)", __func__,  		       nhr.nexthop_num);  | 
