mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 08:50:26 +00:00
zebra: start pseudowire support
Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
parent
761d8b29dd
commit
d613b8e1ed
@ -101,6 +101,23 @@ struct dplane_route_info {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Pseudowire info for the dataplane
|
||||||
|
*/
|
||||||
|
struct dplane_pw_info {
|
||||||
|
char ifname[IF_NAMESIZE];
|
||||||
|
ifindex_t ifindex;
|
||||||
|
int type;
|
||||||
|
int af;
|
||||||
|
int status;
|
||||||
|
uint32_t flags;
|
||||||
|
union g_addr nexthop;
|
||||||
|
mpls_label_t local_label;
|
||||||
|
mpls_label_t remote_label;
|
||||||
|
|
||||||
|
union pw_protocol_fields fields;
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The context block used to exchange info about route updates across
|
* The context block used to exchange info about route updates across
|
||||||
* the boundary between the zebra main context (and pthread) and the
|
* the boundary between the zebra main context (and pthread) and the
|
||||||
@ -136,6 +153,7 @@ struct zebra_dplane_ctx {
|
|||||||
union {
|
union {
|
||||||
struct dplane_route_info rinfo;
|
struct dplane_route_info rinfo;
|
||||||
zebra_lsp_t lsp;
|
zebra_lsp_t lsp;
|
||||||
|
struct dplane_pw_info pw;
|
||||||
} u;
|
} u;
|
||||||
|
|
||||||
/* Namespace info, used especially for netlink kernel communication */
|
/* Namespace info, used especially for netlink kernel communication */
|
||||||
@ -735,6 +753,71 @@ uint32_t dplane_ctx_get_lsp_num_ecmp(const struct zebra_dplane_ctx *ctx)
|
|||||||
return ctx->u.lsp.num_ecmp;
|
return ctx->u.lsp.num_ecmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *dplane_ctx_get_pw_ifname(const struct zebra_dplane_ctx *ctx)
|
||||||
|
{
|
||||||
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
|
return ctx->u.pw.ifname;
|
||||||
|
}
|
||||||
|
|
||||||
|
mpls_label_t dplane_ctx_get_pw_local_label(const struct zebra_dplane_ctx *ctx)
|
||||||
|
{
|
||||||
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
|
return ctx->u.pw.local_label;
|
||||||
|
}
|
||||||
|
|
||||||
|
mpls_label_t dplane_ctx_get_pw_remote_label(const struct zebra_dplane_ctx *ctx)
|
||||||
|
{
|
||||||
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
|
return ctx->u.pw.remote_label;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dplane_ctx_get_pw_type(const struct zebra_dplane_ctx *ctx)
|
||||||
|
{
|
||||||
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
|
return ctx->u.pw.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dplane_ctx_get_pw_af(const struct zebra_dplane_ctx *ctx)
|
||||||
|
{
|
||||||
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
|
return ctx->u.pw.af;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t dplane_ctx_get_pw_flags(const struct zebra_dplane_ctx *ctx)
|
||||||
|
{
|
||||||
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
|
return ctx->u.pw.flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dplane_ctx_get_pw_status(const struct zebra_dplane_ctx *ctx)
|
||||||
|
{
|
||||||
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
|
return ctx->u.pw.status;
|
||||||
|
}
|
||||||
|
|
||||||
|
const union g_addr *dplane_ctx_get_pw_nexthop(
|
||||||
|
const struct zebra_dplane_ctx *ctx)
|
||||||
|
{
|
||||||
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
|
return &(ctx->u.pw.nexthop);
|
||||||
|
}
|
||||||
|
|
||||||
|
const union pw_protocol_fields *dplane_ctx_get_pw_proto(
|
||||||
|
const struct zebra_dplane_ctx *ctx)
|
||||||
|
{
|
||||||
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
|
return &(ctx->u.pw.fields);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* End of dplane context accessors
|
* End of dplane context accessors
|
||||||
*/
|
*/
|
||||||
|
@ -203,6 +203,19 @@ zebra_nhlfe_t *dplane_ctx_get_nhlfe(struct zebra_dplane_ctx *ctx);
|
|||||||
zebra_nhlfe_t *dplane_ctx_get_best_nhlfe(struct zebra_dplane_ctx *ctx);
|
zebra_nhlfe_t *dplane_ctx_get_best_nhlfe(struct zebra_dplane_ctx *ctx);
|
||||||
uint32_t dplane_ctx_get_lsp_num_ecmp(const struct zebra_dplane_ctx *ctx);
|
uint32_t dplane_ctx_get_lsp_num_ecmp(const struct zebra_dplane_ctx *ctx);
|
||||||
|
|
||||||
|
/* Accessors for pseudowire information */
|
||||||
|
const char *dplane_ctx_get_pw_ifname(const struct zebra_dplane_ctx *ctx);
|
||||||
|
mpls_label_t dplane_ctx_get_pw_local_label(const struct zebra_dplane_ctx *ctx);
|
||||||
|
mpls_label_t dplane_ctx_get_pw_remote_label(const struct zebra_dplane_ctx *ctx);
|
||||||
|
int dplane_ctx_get_pw_type(const struct zebra_dplane_ctx *ctx);
|
||||||
|
int dplane_ctx_get_pw_af(const struct zebra_dplane_ctx *ctx);
|
||||||
|
uint32_t dplane_ctx_get_pw_flags(const struct zebra_dplane_ctx *ctx);
|
||||||
|
int dplane_ctx_get_pw_status(const struct zebra_dplane_ctx *ctx);
|
||||||
|
const union g_addr *dplane_ctx_get_pw_nexthop(
|
||||||
|
const struct zebra_dplane_ctx *ctx);
|
||||||
|
const union pw_protocol_fields *dplane_ctx_get_pw_proto(
|
||||||
|
const struct zebra_dplane_ctx *ctx);
|
||||||
|
|
||||||
/* Namespace info - esp. for netlink communication */
|
/* Namespace info - esp. for netlink communication */
|
||||||
const struct zebra_dplane_info *dplane_ctx_get_ns(
|
const struct zebra_dplane_info *dplane_ctx_get_ns(
|
||||||
const struct zebra_dplane_ctx *ctx);
|
const struct zebra_dplane_ctx *ctx);
|
||||||
|
Loading…
Reference in New Issue
Block a user