CF_DECLS
CF_KEYWORDS(ROUTER, ID, PROTOCOL, TEMPLATE, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
-CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, VRF, TABLE, STATES, ROUTES, FILTERS)
+CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, VRF, DEFAULT, TABLE, STATES, ROUTES, FILTERS)
CF_KEYWORDS(RECEIVE, LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE, KEEP, FILTERED)
CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
CF_KEYWORDS(ALGORITHM, KEYED, HMAC, MD5, SHA1, SHA256, SHA384, SHA512)
| IMPORT LIMIT limit_spec { this_proto->in_limit = $3; }
| EXPORT LIMIT limit_spec { this_proto->out_limit = $3; }
| IMPORT KEEP FILTERED bool { this_proto->in_keep_filtered = $4; }
- | VRF text { this_proto->vrf = if_get_by_name($2); }
+ | VRF text { this_proto->vrf = if_get_by_name($2); this_proto->vrf_set = 1; }
+ | VRF DEFAULT { this_proto->vrf = NULL; this_proto->vrf_set = 1; }
| TABLE rtable { this_proto->table = $2; }
| ROUTER ID idval { this_proto->router_id = $3; }
| DESCRIPTION text { this_proto->dsc = $2; }
static inline void
ifa_send_notify(struct proto *p, unsigned c, struct ifa *a)
{
- if (p->ifa_notify && (!p->vrf || p->vrf == a->iface->master))
+ if (p->ifa_notify && (!p->vrf_set || p->vrf == a->iface->master))
{
if (p->debug & D_IFACES)
log(L_TRACE "%s <%s address %I/%d on interface %s %s",
static inline void
if_send_notify(struct proto *p, unsigned c, struct iface *i)
{
- if (p->if_notify && (!p->vrf || p->vrf == i->master))
+ if (p->if_notify && (!p->vrf_set || p->vrf == i->master))
{
if (p->debug & D_IFACES)
log(L_TRACE "%s < interface %s %s", p->name, i->name,
}
else
WALK_LIST(i, iface_list)
- if ((!p->vrf || p->vrf == i->master) &&
+ if ((!p->vrf_set || p->vrf == i->master) &&
((scope = if_connected(a, i, &addr)) >= 0))
{
ifa = i;
q->export_state = ES_DOWN;
q->last_state_change = now;
q->vrf = c->vrf;
+ q->vrf_set = c->vrf_set;
add_tail(&initial_proto_list, &q->n);
if ((nc->protocol != oc->protocol) ||
(nc->disabled != p->disabled) ||
(nc->vrf != oc->vrf) ||
+ (nc->vrf_set != oc->vrf_set) ||
(nc->table->table != oc->table->table))
return 0;
if (p->cf->router_id)
cli_msg(-1006, " Router ID: %R", p->cf->router_id);
+ if (p->vrf_set)
+ cli_msg(-1006, " VRF: %s", p->vrf ? p->vrf->name : "default");
+
if (p->proto->show_proto_info)
p->proto->show_proto_info(p);
else
int class; /* SYM_PROTO or SYM_TEMPLATE */
u32 debug, mrtdump; /* Debugging bitfields, both use D_* constants */
unsigned preference, disabled; /* Generic parameters */
+ int vrf_set; /* Related VRF instance (below) is defined */
int in_keep_filtered; /* Routes rejected in import filter are kept */
u32 router_id; /* Protocol specific router ID */
struct iface *vrf; /* Related VRF instance, NULL if global */
unsigned preference; /* Default route preference */
byte accept_ra_types; /* Which types of route announcements are accepted (RA_OPTIMAL or RA_ANY) */
byte disabled; /* Manually disabled */
+ byte vrf_set; /* Related VRF instance (above) is defined */
byte proto_state; /* Protocol state machine (PS_*, see below) */
byte core_state; /* Core state machine (FS_*, see below) */
byte export_state; /* Route export state (ES_*, see below) */
static int
bfd_add_request(struct bfd_proto *p, struct bfd_request *req)
{
- if (p->p.vrf && (p->p.vrf != req->vrf))
+ if (p->p.vrf_set && (p->p.vrf != req->vrf))
return 0;
struct bfd_session *s = bfd_find_session_by_addr(p, req->addr);