mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 21:50:39 +00:00
Merge pull request #10443 from mjstapp/zebra_re_opaque
zebra: name the route_entry opaque struct more specifically
This commit is contained in:
commit
461a8d7aba
@ -87,7 +87,7 @@ struct rnh {
|
|||||||
|
|
||||||
PREDECL_LIST(re_list);
|
PREDECL_LIST(re_list);
|
||||||
|
|
||||||
struct opaque {
|
struct re_opaque {
|
||||||
uint16_t length;
|
uint16_t length;
|
||||||
uint8_t data[];
|
uint8_t data[];
|
||||||
};
|
};
|
||||||
@ -169,7 +169,7 @@ struct route_entry {
|
|||||||
/* Distance. */
|
/* Distance. */
|
||||||
uint8_t distance;
|
uint8_t distance;
|
||||||
|
|
||||||
struct opaque *opaque;
|
struct re_opaque *opaque;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RIB_SYSTEM_ROUTE(R) RSYSTEM_ROUTE((R)->type)
|
#define RIB_SYSTEM_ROUTE(R) RSYSTEM_ROUTE((R)->type)
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
#include "zebra/zebra_srte.h"
|
#include "zebra/zebra_srte.h"
|
||||||
#include "zebra/zebra_srv6.h"
|
#include "zebra/zebra_srv6.h"
|
||||||
|
|
||||||
DEFINE_MTYPE_STATIC(ZEBRA, OPAQUE, "Opaque Data");
|
DEFINE_MTYPE_STATIC(ZEBRA, RE_OPAQUE, "Route Opaque Data");
|
||||||
|
|
||||||
static int zapi_nhg_decode(struct stream *s, int cmd, struct zapi_nhg *api_nhg);
|
static int zapi_nhg_decode(struct stream *s, int cmd, struct zapi_nhg *api_nhg);
|
||||||
|
|
||||||
@ -2079,8 +2079,9 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
|
|||||||
re->mtu = api.mtu;
|
re->mtu = api.mtu;
|
||||||
|
|
||||||
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_OPAQUE)) {
|
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_OPAQUE)) {
|
||||||
re->opaque = XMALLOC(MTYPE_OPAQUE,
|
re->opaque =
|
||||||
sizeof(struct opaque) + api.opaque.length);
|
XMALLOC(MTYPE_RE_OPAQUE,
|
||||||
|
sizeof(struct re_opaque) + api.opaque.length);
|
||||||
re->opaque->length = api.opaque.length;
|
re->opaque->length = api.opaque.length;
|
||||||
memcpy(re->opaque->data, api.opaque.data, re->opaque->length);
|
memcpy(re->opaque->data, api.opaque.data, re->opaque->length);
|
||||||
}
|
}
|
||||||
@ -2092,7 +2093,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
|
|||||||
__func__);
|
__func__);
|
||||||
nexthop_group_delete(&ng);
|
nexthop_group_delete(&ng);
|
||||||
zebra_nhg_backup_free(&bnhg);
|
zebra_nhg_backup_free(&bnhg);
|
||||||
XFREE(MTYPE_OPAQUE, re->opaque);
|
XFREE(MTYPE_RE_OPAQUE, re->opaque);
|
||||||
XFREE(MTYPE_RE, re);
|
XFREE(MTYPE_RE, re);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2105,7 +2106,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
|
|||||||
__func__, api.safi);
|
__func__, api.safi);
|
||||||
nexthop_group_delete(&ng);
|
nexthop_group_delete(&ng);
|
||||||
zebra_nhg_backup_free(&bnhg);
|
zebra_nhg_backup_free(&bnhg);
|
||||||
XFREE(MTYPE_OPAQUE, re->opaque);
|
XFREE(MTYPE_RE_OPAQUE, re->opaque);
|
||||||
XFREE(MTYPE_RE, re);
|
XFREE(MTYPE_RE, re);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2134,7 +2135,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
|
|||||||
*/
|
*/
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
client->error_cnt++;
|
client->error_cnt++;
|
||||||
XFREE(MTYPE_OPAQUE, re->opaque);
|
XFREE(MTYPE_RE_OPAQUE, re->opaque);
|
||||||
XFREE(MTYPE_RE, re);
|
XFREE(MTYPE_RE, re);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2163,9 +2164,9 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void zapi_opaque_free(struct opaque *opaque)
|
void zapi_re_opaque_free(struct re_opaque *opaque)
|
||||||
{
|
{
|
||||||
XFREE(MTYPE_OPAQUE, opaque);
|
XFREE(MTYPE_RE_OPAQUE, opaque);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zread_route_del(ZAPI_HANDLER_ARGS)
|
static void zread_route_del(ZAPI_HANDLER_ARGS)
|
||||||
|
@ -115,7 +115,7 @@ extern int zsend_client_close_notify(struct zserv *client,
|
|||||||
int zsend_nhg_notify(uint16_t type, uint16_t instance, uint32_t session_id,
|
int zsend_nhg_notify(uint16_t type, uint16_t instance, uint32_t session_id,
|
||||||
uint32_t id, enum zapi_nhg_notify_owner note);
|
uint32_t id, enum zapi_nhg_notify_owner note);
|
||||||
|
|
||||||
extern void zapi_opaque_free(struct opaque *opaque);
|
extern void zapi_re_opaque_free(struct re_opaque *opaque);
|
||||||
|
|
||||||
extern int zsend_zebra_srv6_locator_add(struct zserv *client,
|
extern int zsend_zebra_srv6_locator_add(struct zserv *client,
|
||||||
struct srv6_locator *loc);
|
struct srv6_locator *loc);
|
||||||
|
@ -3105,7 +3105,7 @@ void rib_unlink(struct route_node *rn, struct route_entry *re)
|
|||||||
|
|
||||||
nexthops_free(re->fib_ng.nexthop);
|
nexthops_free(re->fib_ng.nexthop);
|
||||||
|
|
||||||
zapi_opaque_free(re->opaque);
|
zapi_re_opaque_free(re->opaque);
|
||||||
|
|
||||||
XFREE(MTYPE_RE, re);
|
XFREE(MTYPE_RE, re);
|
||||||
}
|
}
|
||||||
|
@ -443,6 +443,7 @@ static void zebra_show_ip_route_opaque(struct vty *vty, struct route_entry *re,
|
|||||||
vty_out(vty, " Opaque Data: %s",
|
vty_out(vty, " Opaque Data: %s",
|
||||||
(char *)re->opaque->data);
|
(char *)re->opaque->data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZEBRA_ROUTE_BGP:
|
case ZEBRA_ROUTE_BGP:
|
||||||
memcpy(&bzo, re->opaque->data, re->opaque->length);
|
memcpy(&bzo, re->opaque->data, re->opaque->length);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user