}
attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL);
- attr->pmsi_tnl_type = tnl_type;
+ bgp_attr_set_pmsi_tnl_type(attr, tnl_type);
stream_get(&attr->label, peer->curr, BGP_LABEL_BYTES);
/* Forward read pointer of input stream. */
stream_putc(s, BGP_ATTR_PMSI_TUNNEL);
stream_putc(s, 9); // Length
stream_putc(s, 0); // Flags
- stream_putc(s, attr->pmsi_tnl_type);
+ stream_putc(s, bgp_attr_get_pmsi_tnl_type(attr));
stream_put(s, &(attr->label),
BGP_LABEL_BYTES); // MPLS Label / VXLAN VNI
stream_put_ipv4(s, attr->nexthop.s_addr);
{
return (attr) ? attr->mm_seqnum : 0;
}
+
+static inline enum pta_type bgp_attr_get_pmsi_tnl_type(struct attr *attr)
+{
+ return attr->pmsi_tnl_type;
+}
+
+static inline void bgp_attr_set_pmsi_tnl_type(struct attr *attr,
+ enum pta_type pmsi_tnl_type)
+{
+ attr->pmsi_tnl_type = pmsi_tnl_type;
+}
+
#endif /* _QUAGGA_BGP_ATTR_H */
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL)))
snprintf(buf + strlen(buf), size - strlen(buf),
- ", pmsi tnltype %u", attr->pmsi_tnl_type);
+ ", pmsi tnltype %u", bgp_attr_get_pmsi_tnl_type(attr));
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_AS_PATH)))
snprintf(buf + strlen(buf), size - strlen(buf), ", path %s",
} else if (p->prefix.route_type == BGP_EVPN_AD_ROUTE) {
ret = bgp_evpn_remote_es_evi_add(bgp, vpn, p);
} else {
- switch (pi->attr->pmsi_tnl_type) {
+ switch (bgp_attr_get_pmsi_tnl_type(pi->attr)) {
case PMSI_TNLTYPE_INGR_REPL:
flood_control = VXLAN_FLOOD_HEAD_END_REPL;
break;
/* PMSI is only needed for type-3 routes */
if (p->prefix.route_type == BGP_EVPN_IMET_ROUTE) {
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL);
- attr.pmsi_tnl_type = PMSI_TNLTYPE_INGR_REPL;
+ bgp_attr_set_pmsi_tnl_type(&attr, PMSI_TNLTYPE_INGR_REPL);
}
if (bgp_debug_zebra(NULL)) {
*/
if (attr &&
(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL))) {
- if (attr->pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL &&
- attr->pmsi_tnl_type != PMSI_TNLTYPE_PIM_SM) {
- flog_warn(EC_BGP_EVPN_PMSI_PRESENT,
- "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d",
- peer->bgp->vrf_id, peer->host,
- attr->pmsi_tnl_type);
+ enum pta_type pmsi_tnl_type = bgp_attr_get_pmsi_tnl_type(attr);
+
+ if (pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL
+ && pmsi_tnl_type != PMSI_TNLTYPE_PIM_SM) {
+ flog_warn(
+ EC_BGP_EVPN_PMSI_PRESENT,
+ "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d",
+ peer->bgp->vrf_id, peer->host, pmsi_tnl_type);
}
}
/* Line 10 display PMSI tunnel attribute, if present */
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL)) {
- const char *str =
- lookup_msg(bgp_pmsi_tnltype_str, attr->pmsi_tnl_type,
- PMSI_TNLTYPE_STR_DEFAULT);
+ const char *str = lookup_msg(bgp_pmsi_tnltype_str,
+ bgp_attr_get_pmsi_tnl_type(attr),
+ PMSI_TNLTYPE_STR_DEFAULT);
if (json_paths) {
json_pmsi = json_object_new_object();