locator->sid_format = format;
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: Locator %s format has changed, old=%s new=%s",
__func__, locator->name,
locator->sid_format ? ((struct srv6_sid_format *)
zebra_srv6_sid_ctx_free(ctx);
}
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: Locator %s format has changed, send SRV6_LOCATOR_DEL notification to zclients",
__func__, locator->name);
block_new->refcnt++;
locator->sid_block = block_new;
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: Locator %s format has changed, send SRV6_LOCATOR_ADD notification to zclients",
__func__, locator->name);
struct listnode *node, *nnode;
struct zebra_srv6_sid_ctx *ctx;
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: SID format %s has changed. Notifying zclients.",
__func__, format->name);
for (ALL_LIST_ELEMENTS_RO(srv6->locators, node, locator)) {
if (locator->sid_format == format) {
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: Locator %s has changed because its format (%s) has been modified. Notifying zclients.",
__func__, locator->name,
format->name);
if (!*loc)
zlog_err("Unable to assign locator chunk to %s instance %u",
zebra_route_string(client->proto), client->instance);
- else if (IS_ZEBRA_DEBUG_PACKET)
+ else if (IS_ZEBRA_DEBUG_SRV6)
zlog_info("Assigned locator chunk %s to %s instance %u",
(*loc)->name, zebra_route_string(client->proto),
client->instance);
if (!loc)
return -1;
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: Releasing srv6-locator on %s", __func__,
locator_name);
struct srv6_locator *loc;
struct srv6_locator_chunk *chunk;
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: Releasing chunks for client proto %s, instance %d, session %u",
__func__, zebra_route_string(client->proto),
client->instance, client->session_id);
}
}
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: Released %d srv6-locator chunks",
__func__, count);
format = block->sid_format;
- if (ZEBRA_DEBUG_PACKET)
+ if (ZEBRA_DEBUG_SRV6)
zlog_debug("%s: trying to allocate explicit SID function %u from block %pFX",
__func__, sid_func, &block->prefix);
block->u.uncompressed.num_func_allocated++;
}
- if (ZEBRA_DEBUG_PACKET)
+ if (ZEBRA_DEBUG_SRV6)
zlog_debug("%s: allocated explicit SID function %u from block %pFX",
__func__, sid_func, &block->prefix);
format = block->sid_format;
- if (ZEBRA_DEBUG_PACKET)
+ if (ZEBRA_DEBUG_SRV6)
zlog_debug("%s: trying to allocate dynamic SID function from block %pFX",
__func__, &block->prefix);
block->u.uncompressed.num_func_allocated++;
}
- if (ZEBRA_DEBUG_PACKET)
+ if (ZEBRA_DEBUG_SRV6)
zlog_debug("%s: allocated dynamic SID function %u from block %pFX",
__func__, *sid_func, &block->prefix);
* return the existing SID
*/
if (sid_same(&s->sid->value, sid_value)) {
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: returning existing SRv6 SID %pI6 ctx %s",
__func__, &s->sid->value,
srv6_sid_ctx2str(buf,
* deallocate the current SID function before allocating the new one
*/
if (zctx->sid) {
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: ctx %s already associated with a dynamic SID %pI6, releasing dynamic SID",
__func__,
srv6_sid_ctx2str(buf, sizeof(buf),
zctx->sid = *sid;
listnode_add(srv6->sids, zctx);
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: allocated explicit SRv6 SID %pI6 for context %s",
__func__, &(*sid)->value,
srv6_sid_ctx2str(buf, sizeof(buf), ctx));
}
}
if (memcmp(&s->ctx, ctx, sizeof(struct srv6_sid_ctx)) == 0) {
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: returning existing SID %s %pI6",
__func__,
srv6_sid_ctx2str(buf, sizeof(buf),
zctx->sid = *sid;
listnode_add(srv6->sids, zctx);
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: allocated new dynamic SRv6 SID %pI6 for context %s",
__func__, &(*sid)->value,
srv6_sid_ctx2str(buf, sizeof(buf), ctx));
(sid_value) ? SRV6_SID_ALLOC_MODE_EXPLICIT
: SRV6_SID_ALLOC_MODE_DYNAMIC;
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: received SRv6 SID alloc request: SID ctx %s (%pI6), mode=%s",
__func__, srv6_sid_ctx2str(buf, sizeof(buf), ctx),
sid_value, srv6_sid_alloc_mode2str(alloc_mode));
format = block->sid_format;
- if (ZEBRA_DEBUG_PACKET)
+ if (ZEBRA_DEBUG_SRV6)
zlog_debug("%s: trying to release explicit SRv6 SID function %u from block %pFX",
__func__, sid_func, &block->prefix);
zebra_srv6_sid_func_free(sid_func_ptr);
}
- if (ZEBRA_DEBUG_PACKET)
+ if (ZEBRA_DEBUG_SRV6)
zlog_debug("%s: released explicit SRv6 SID function %u from block %pFX",
__func__, sid_func, &block->prefix);
format = block->sid_format;
- if (ZEBRA_DEBUG_PACKET)
+ if (ZEBRA_DEBUG_SRV6)
zlog_debug("%s: trying to release dynamic SRv6 SID function %u from block %pFX",
__func__, sid_func, &block->prefix);
}
}
- if (ZEBRA_DEBUG_PACKET)
+ if (ZEBRA_DEBUG_SRV6)
zlog_debug("%s: released dynamic SRv6 SID function %u from block %pFX",
__func__, sid_func, &block->prefix);
if (!zctx || !zctx->sid)
return -1;
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: releasing SRv6 SID %pI6 associated with ctx %s (proto=%u, instance=%u)",
__func__, &zctx->sid->value,
srv6_sid_ctx2str(buf, sizeof(buf), &zctx->ctx),
/* Remove the client from the list of clients using the SID */
listnode_delete(zctx->sid->client_list, client);
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: released SRv6 SID %pI6 associated with ctx %s (proto=%u, instance=%u)",
__func__, &zctx->sid->value,
srv6_sid_ctx2str(buf, sizeof(buf), &zctx->ctx),
* and remove it from the SRv6 database.
*/
if (listcount(zctx->sid->client_list) == 0) {
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: SRv6 SID %pI6 associated with ctx %s is no longer in use, removing it from SRv6 database",
__func__, &zctx->sid->value,
srv6_sid_ctx2str(buf, sizeof(buf),
struct zserv *c;
char buf[256];
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: getting SRv6 SID for ctx %s, sid_value=%pI6, locator_name=%s",
__func__, srv6_sid_ctx2str(buf, sizeof(buf), ctx),
sid_value ? sid_value : &in6addr_any, locator_name);
zsend_srv6_sid_notify(client, ctx, sid_value, 0, 0, NULL,
ZAPI_SRV6_SID_FAIL_ALLOC);
} else if (ret == 0) {
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: got existing SRv6 SID for ctx %s: sid_value=%pI6 (func=%u) (proto=%u, instance=%u, sessionId=%u), notify client",
__func__,
srv6_sid_ctx2str(buf, sizeof(buf), ctx),
: NULL,
ZAPI_SRV6_SID_ALLOCATED);
} else {
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: got new SRv6 SID for ctx %s: sid_value=%pI6 (func=%u) (proto=%u, instance=%u, sessionId=%u), notifying all clients",
__func__,
srv6_sid_ctx2str(buf, sizeof(buf), ctx),
int count = 0;
int ret;
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: releasing SRv6 SIDs for client proto %s, instance %d, session %u",
__func__, zebra_route_string(client->proto),
client->instance, client->session_id);
count++;
}
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: released %d SRv6 SIDs", __func__, count);
return count;
char buf[256];
const char *locator_name = NULL;
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: releasing SRv6 SID associated with ctx %s",
__func__, srv6_sid_ctx2str(buf, sizeof(buf), ctx));
break;
}
- if (IS_ZEBRA_DEBUG_PACKET)
+ if (IS_ZEBRA_DEBUG_SRV6)
zlog_debug("%s: no SID associated with ctx %s", __func__,
srv6_sid_ctx2str(buf, sizeof(buf), ctx));