ZEBRA_LSP_STATIC = 1, /* Static LSP. */
ZEBRA_LSP_LDP = 2, /* LDP LSP. */
ZEBRA_LSP_BGP = 3, /* BGP LSP. */
- ZEBRA_LSP_SR = 4 /* Segment Routing LSP. */
+ ZEBRA_LSP_SR = 4, /* Segment Routing LSP. */
+ ZEBRA_LSP_SHARP = 5, /* Identifier for test protocol */
};
/* Functions for basic label operations. */
}
void zclient_send_vrf_label(struct zclient *zclient, vrf_id_t vrf_id,
- mpls_label_t label)
+ mpls_label_t label, enum lsp_types_t ltype)
{
struct stream *s;
zclient_create_header(s, ZEBRA_VRF_LABEL, vrf_id);
stream_putl(s, label);
+ stream_putc(s, ltype);
stream_putw_at(s, 0, stream_get_endp(s));
zclient_send_message(zclient);
}
* operation.
*/
extern void zclient_send_vrf_label(struct zclient *zclient, vrf_id_t vrf_id,
- mpls_label_t label);
+ mpls_label_t label, enum lsp_types_t ltype);
extern void zclient_send_reg_requests(struct zclient *, vrf_id_t);
extern void zclient_send_dereg_requests(struct zclient *, vrf_id_t);
void vrf_label_add(vrf_id_t vrf_id, mpls_label_t label)
{
- zclient_send_vrf_label(zclient, vrf_id, label);
+ zclient_send_vrf_label(zclient, vrf_id, label, ZEBRA_LSP_SHARP);
}
void route_add(struct prefix *p, struct nexthop *nh)
return (route_distance(ZEBRA_ROUTE_LDP));
case ZEBRA_LSP_BGP:
return (route_distance(ZEBRA_ROUTE_BGP));
- default:
+ case ZEBRA_LSP_NONE:
+ case ZEBRA_LSP_SHARP:
+ case ZEBRA_LSP_SR:
return 150;
}
+
+ /*
+ * For some reason certain compilers do not believe
+ * that all the cases have been handled. And
+ * WTF does this work differently than when I removed
+ * the default case????
+ */
+ return 150;
}
/*
return ZEBRA_LSP_STATIC;
case ZEBRA_ROUTE_BGP:
return ZEBRA_LSP_BGP;
+ case ZEBRA_ROUTE_SHARP:
+ return ZEBRA_LSP_SHARP;
default:
return ZEBRA_LSP_NONE;
}
case ZEBRA_LSP_SR:
return ZEBRA_ROUTE_OSPF;
case ZEBRA_LSP_NONE:
- default:
return ZEBRA_ROUTE_KERNEL;
+ case ZEBRA_LSP_SHARP:
+ return ZEBRA_ROUTE_SHARP;
}
+
+ /*
+ * For some reason certain compilers do not believe
+ * that all the cases have been handled. And
+ * WTF does this work differently than when I removed
+ * the default case????
+ */
+ return ZEBRA_ROUTE_KERNEL;
}
/* NHLFE type as printable string. */
return "BGP";
case ZEBRA_LSP_SR:
return "SR";
- default:
+ case ZEBRA_LSP_SHARP:
+ return "SHARP";
+ case ZEBRA_LSP_NONE:
return "Unknown";
}
+
+ /*
+ * For some reason certain compilers do not believe
+ * that all the cases have been handled. And
+ * WTF does this work differently than when I removed
+ * the default case????
+ */
+ return "Unknown";
}
static inline void mpls_mark_lsps_for_processing(struct zebra_vrf *zvrf)
mpls_label_t nlabel;
struct stream *s;
struct zebra_vrf *def_zvrf;
+ enum lsp_types_t ltype;
s = client->ibuf;
STREAM_GETL(s, nlabel);
-
if (nlabel == zvrf->label) {
/*
* Nothing to do here move along
*/
return;
}
+ STREAM_GETC(s, ltype);
if (zvrf->vrf->vrf_id != VRF_DEFAULT)
ifp = if_lookup_by_name(zvrf->vrf->name, zvrf->vrf->vrf_id);
def_zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT);
if (zvrf->label != MPLS_LABEL_IPV4_EXPLICIT_NULL)
- mpls_lsp_uninstall(def_zvrf, ZEBRA_LSP_STATIC,
- zvrf->label, NEXTHOP_TYPE_IFINDEX,
- NULL, ifp->ifindex);
+ mpls_lsp_uninstall(def_zvrf, ltype, zvrf->label,
+ NEXTHOP_TYPE_IFINDEX, NULL, ifp->ifindex);
if (nlabel != MPLS_LABEL_IPV4_EXPLICIT_NULL)
- mpls_lsp_install(def_zvrf, ZEBRA_LSP_STATIC, nlabel,
- MPLS_LABEL_IMPLICIT_NULL, NEXTHOP_TYPE_IFINDEX, NULL, ifp->ifindex);
+ mpls_lsp_install(def_zvrf, ltype, nlabel, MPLS_LABEL_IMPLICIT_NULL,
+ NEXTHOP_TYPE_IFINDEX, NULL, ifp->ifindex);
zvrf->label = nlabel;
stream_failure: