uint8_t gw_family,
struct nlmsghdr *nlmsg,
size_t req_size, int bytelen,
- struct nexthop *nexthop)
+ const struct nexthop *nexthop)
{
if (route_family == AF_MPLS) {
struct gw_family_t gw_fam;
struct rtattr *rta,
struct rtnexthop *rtnh,
size_t req_size, int bytelen,
- struct nexthop *nexthop)
+ const struct nexthop *nexthop)
{
if (route_family == AF_MPLS) {
struct gw_family_t gw_fam;
* @param req_size: The size allocated for the message.
*/
static void _netlink_route_build_singlepath(const char *routedesc, int bytelen,
- struct nexthop *nexthop,
+ const struct nexthop *nexthop,
struct nlmsghdr *nlmsg,
struct rtmsg *rtmsg,
size_t req_size, int cmd)
label_buf[0] = '\0';
assert(nexthop);
- for (struct nexthop *nh = nexthop; nh; nh = nh->rparent) {
+ for (const struct nexthop *nh = nexthop; nh; nh = nh->rparent) {
char label_buf1[20];
nh_label = nh->nh_label;
* the prefsrc should be stored.
*/
static void _netlink_route_build_multipath(const char *routedesc, int bytelen,
- struct nexthop *nexthop,
+ const struct nexthop *nexthop,
struct rtattr *rta,
struct rtnexthop *rtnh,
struct rtmsg *rtmsg,
- union g_addr **src)
+ const union g_addr **src)
{
struct mpls_label_stack *nh_label;
mpls_lse_t out_lse[MPLS_MAX_LABELS];
label_buf[0] = '\0';
assert(nexthop);
- for (struct nexthop *nh = nexthop; nh; nh = nh->rparent) {
+ for (const struct nexthop *nh = nexthop; nh; nh = nh->rparent) {
char label_buf1[20];
nh_label = nh->nh_label;
}
static inline void _netlink_mpls_build_singlepath(const char *routedesc,
- zebra_nhlfe_t *nhlfe,
+ const zebra_nhlfe_t *nhlfe,
struct nlmsghdr *nlmsg,
struct rtmsg *rtmsg,
size_t req_size, int cmd)
static inline void
-_netlink_mpls_build_multipath(const char *routedesc, zebra_nhlfe_t *nhlfe,
+_netlink_mpls_build_multipath(const char *routedesc, const zebra_nhlfe_t *nhlfe,
struct rtattr *rta, struct rtnexthop *rtnh,
- struct rtmsg *rtmsg, union g_addr **src)
+ struct rtmsg *rtmsg, const union g_addr **src)
{
int bytelen;
uint8_t family;
char buf[NL_PKT_BUF_SIZE];
struct rtattr *rta = (void *)buf;
struct rtnexthop *rtnh;
- union g_addr *src1 = NULL;
+ const union g_addr *src1 = NULL;
rta->rta_type = RTA_MULTIPATH;
rta->rta_len = RTA_LENGTH(0);
int netlink_mpls_multipath(int cmd, struct zebra_dplane_ctx *ctx)
{
mpls_lse_t lse;
- zebra_nhlfe_t *nhlfe;
+ const zebra_nhlfe_t *nhlfe;
struct nexthop *nexthop = NULL;
unsigned int nexthop_num;
const char *routedesc;
char buf[NL_PKT_BUF_SIZE];
struct rtattr *rta = (void *)buf;
struct rtnexthop *rtnh;
- union g_addr *src1 = NULL;
+ const union g_addr *src1 = NULL;
rta->rta_type = RTA_MULTIPATH;
rta->rta_len = RTA_LENGTH(0);
mpls_label_t dplane_ctx_get_in_label(const struct zebra_dplane_ctx *ctx);
uint8_t dplane_ctx_get_addr_family(const struct zebra_dplane_ctx *ctx);
uint32_t dplane_ctx_get_lsp_flags(const struct zebra_dplane_ctx *ctx);
-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);
+const zebra_nhlfe_t *dplane_ctx_get_nhlfe(const struct zebra_dplane_ctx *ctx);
+const zebra_nhlfe_t *dplane_ctx_get_best_nhlfe(
+ const struct zebra_dplane_ctx *ctx);
uint32_t dplane_ctx_get_lsp_num_ecmp(const struct zebra_dplane_ctx *ctx);
/* Accessors for pseudowire information */