mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 06:53:03 +00:00
commit
247e6469da
17
lib/vrf.h
17
lib/vrf.h
@ -56,6 +56,20 @@ enum {
|
|||||||
#define VRF_CMD_HELP_STR "Specify the VRF\nThe VRF name\n"
|
#define VRF_CMD_HELP_STR "Specify the VRF\nThe VRF name\n"
|
||||||
#define VRF_ALL_CMD_HELP_STR "Specify the VRF\nAll VRFs\n"
|
#define VRF_ALL_CMD_HELP_STR "Specify the VRF\nAll VRFs\n"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Pass some OS specific data up through
|
||||||
|
* to the daemons
|
||||||
|
*/
|
||||||
|
struct vrf_data
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct {
|
||||||
|
uint32_t table_id;
|
||||||
|
} l;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
struct vrf
|
struct vrf
|
||||||
{
|
{
|
||||||
RB_ENTRY(vrf) id_entry, name_entry;
|
RB_ENTRY(vrf) id_entry, name_entry;
|
||||||
@ -76,6 +90,9 @@ struct vrf
|
|||||||
/* User data */
|
/* User data */
|
||||||
void *info;
|
void *info;
|
||||||
|
|
||||||
|
/* The table_id from the kernel */
|
||||||
|
struct vrf_data data;
|
||||||
|
|
||||||
QOBJ_FIELDS
|
QOBJ_FIELDS
|
||||||
};
|
};
|
||||||
RB_HEAD (vrf_id_head, vrf);
|
RB_HEAD (vrf_id_head, vrf);
|
||||||
|
@ -1077,12 +1077,15 @@ zclient_vrf_add (struct zclient *zclient, vrf_id_t vrf_id)
|
|||||||
{
|
{
|
||||||
struct vrf *vrf;
|
struct vrf *vrf;
|
||||||
char vrfname_tmp[VRF_NAMSIZ];
|
char vrfname_tmp[VRF_NAMSIZ];
|
||||||
|
struct vrf_data data;
|
||||||
|
|
||||||
|
stream_get (&data, zclient->ibuf, sizeof (struct vrf_data));
|
||||||
/* Read interface name. */
|
/* Read interface name. */
|
||||||
stream_get (vrfname_tmp, zclient->ibuf, VRF_NAMSIZ);
|
stream_get (vrfname_tmp, zclient->ibuf, VRF_NAMSIZ);
|
||||||
|
|
||||||
/* Lookup/create vrf by vrf_id. */
|
/* Lookup/create vrf by vrf_id. */
|
||||||
vrf = vrf_get (vrf_id, vrfname_tmp);
|
vrf = vrf_get (vrf_id, vrfname_tmp);
|
||||||
|
vrf->data = data;
|
||||||
|
|
||||||
vrf_enable (vrf);
|
vrf_enable (vrf);
|
||||||
}
|
}
|
||||||
|
@ -838,8 +838,9 @@ initialize_linkparams (struct mpls_te_link *lp)
|
|||||||
|
|
||||||
if ((oi = lookup_oi_by_ifp (ifp, NULL, OI_ANY)) == NULL)
|
if ((oi = lookup_oi_by_ifp (ifp, NULL, OI_ANY)) == NULL)
|
||||||
{
|
{
|
||||||
zlog_warn("MPLS-TE(initialize_linkparams) Could not find corresponding OSPF Interface for %s",
|
if (IS_DEBUG_OSPF_TE)
|
||||||
ifp->name);
|
zlog_warn("MPLS-TE(initialize_linkparams) Could not find corresponding OSPF Interface for %s",
|
||||||
|
ifp->name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -991,7 +992,8 @@ ospf_mpls_te_update_if (struct interface *ifp)
|
|||||||
/* Get Link context from interface */
|
/* Get Link context from interface */
|
||||||
if ((lp = lookup_linkparams_by_ifp(ifp)) == NULL)
|
if ((lp = lookup_linkparams_by_ifp(ifp)) == NULL)
|
||||||
{
|
{
|
||||||
zlog_warn ("OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s", ifp->name);
|
if (IS_DEBUG_OSPF_TE)
|
||||||
|
zlog_warn ("OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s", ifp->name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ static int detect_primary_address_change(struct interface *ifp,
|
|||||||
int changed;
|
int changed;
|
||||||
|
|
||||||
if (force_prim_as_any)
|
if (force_prim_as_any)
|
||||||
new_prim_addr = qpim_inaddr_any;
|
new_prim_addr.s_addr = INADDR_ANY;
|
||||||
else
|
else
|
||||||
new_prim_addr = pim_find_primary_addr(ifp);
|
new_prim_addr = pim_find_primary_addr(ifp);
|
||||||
|
|
||||||
|
@ -387,12 +387,14 @@ const char *pim_ifchannel_ifassert_name(enum pim_ifassert_state ifassert_state)
|
|||||||
*/
|
*/
|
||||||
void reset_ifassert_state(struct pim_ifchannel *ch)
|
void reset_ifassert_state(struct pim_ifchannel *ch)
|
||||||
{
|
{
|
||||||
|
struct in_addr any = { .s_addr = INADDR_ANY };
|
||||||
|
|
||||||
THREAD_OFF(ch->t_ifassert_timer);
|
THREAD_OFF(ch->t_ifassert_timer);
|
||||||
|
|
||||||
pim_ifassert_winner_set(ch,
|
pim_ifassert_winner_set(ch,
|
||||||
PIM_IFASSERT_NOINFO,
|
PIM_IFASSERT_NOINFO,
|
||||||
qpim_inaddr_any,
|
any,
|
||||||
qpim_infinite_assert_metric);
|
qpim_infinite_assert_metric);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pim_ifchannel *pim_ifchannel_find(struct interface *ifp,
|
struct pim_ifchannel *pim_ifchannel_find(struct interface *ifp,
|
||||||
|
@ -61,7 +61,6 @@ struct thread *qpim_rpf_cache_refresher = NULL;
|
|||||||
int64_t qpim_rpf_cache_refresh_requests = 0;
|
int64_t qpim_rpf_cache_refresh_requests = 0;
|
||||||
int64_t qpim_rpf_cache_refresh_events = 0;
|
int64_t qpim_rpf_cache_refresh_events = 0;
|
||||||
int64_t qpim_rpf_cache_refresh_last = 0;
|
int64_t qpim_rpf_cache_refresh_last = 0;
|
||||||
struct in_addr qpim_inaddr_any;
|
|
||||||
struct list *qpim_ssmpingd_list = NULL;
|
struct list *qpim_ssmpingd_list = NULL;
|
||||||
struct in_addr qpim_ssmpingd_group_addr;
|
struct in_addr qpim_ssmpingd_group_addr;
|
||||||
int64_t qpim_scan_oil_events = 0;
|
int64_t qpim_scan_oil_events = 0;
|
||||||
@ -293,7 +292,6 @@ void pim_init()
|
|||||||
|
|
||||||
pim_mroute_socket_enable();
|
pim_mroute_socket_enable();
|
||||||
|
|
||||||
qpim_inaddr_any.s_addr = PIM_NET_INADDR_ANY;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
RFC 4601: 4.6.3. Assert Metrics
|
RFC 4601: 4.6.3. Assert Metrics
|
||||||
@ -306,7 +304,7 @@ void pim_init()
|
|||||||
qpim_infinite_assert_metric.rpt_bit_flag = 1;
|
qpim_infinite_assert_metric.rpt_bit_flag = 1;
|
||||||
qpim_infinite_assert_metric.metric_preference = PIM_ASSERT_METRIC_PREFERENCE_MAX;
|
qpim_infinite_assert_metric.metric_preference = PIM_ASSERT_METRIC_PREFERENCE_MAX;
|
||||||
qpim_infinite_assert_metric.route_metric = PIM_ASSERT_ROUTE_METRIC_MAX;
|
qpim_infinite_assert_metric.route_metric = PIM_ASSERT_ROUTE_METRIC_MAX;
|
||||||
qpim_infinite_assert_metric.ip_address = qpim_inaddr_any;
|
qpim_infinite_assert_metric.ip_address.s_addr = INADDR_ANY;
|
||||||
|
|
||||||
pim_if_init();
|
pim_if_init();
|
||||||
pim_cmd_init();
|
pim_cmd_init();
|
||||||
|
@ -140,7 +140,6 @@ struct thread *qpim_rpf_cache_refresher;
|
|||||||
int64_t qpim_rpf_cache_refresh_requests;
|
int64_t qpim_rpf_cache_refresh_requests;
|
||||||
int64_t qpim_rpf_cache_refresh_events;
|
int64_t qpim_rpf_cache_refresh_events;
|
||||||
int64_t qpim_rpf_cache_refresh_last;
|
int64_t qpim_rpf_cache_refresh_last;
|
||||||
struct in_addr qpim_inaddr_any;
|
|
||||||
struct list *qpim_ssmpingd_list; /* list of struct ssmpingd_sock */
|
struct list *qpim_ssmpingd_list; /* list of struct ssmpingd_sock */
|
||||||
struct in_addr qpim_ssmpingd_group_addr;
|
struct in_addr qpim_ssmpingd_group_addr;
|
||||||
int64_t qpim_scan_oil_events;
|
int64_t qpim_scan_oil_events;
|
||||||
|
@ -183,9 +183,10 @@ vtysh_config_parse_line (void *arg, const char *line)
|
|||||||
config->index = INTERFACE_NODE;
|
config->index = INTERFACE_NODE;
|
||||||
}
|
}
|
||||||
else if (config->index == RMAP_NODE ||
|
else if (config->index == RMAP_NODE ||
|
||||||
config->index == INTERFACE_NODE ||
|
config->index == INTERFACE_NODE ||
|
||||||
config->index == NS_NODE ||
|
config->index == NS_NODE ||
|
||||||
config->index == VTY_NODE)
|
config->index == VTY_NODE ||
|
||||||
|
config->index == VRF_NODE)
|
||||||
config_add_line_uniq (config->line, line);
|
config_add_line_uniq (config->line, line);
|
||||||
else
|
else
|
||||||
config_add_line (config->line, line);
|
config_add_line (config->line, line);
|
||||||
@ -278,6 +279,7 @@ vtysh_config_parse_line (void *arg, const char *line)
|
|||||||
|| strncmp (line, "hostname", strlen ("hostname")) == 0
|
|| strncmp (line, "hostname", strlen ("hostname")) == 0
|
||||||
|| strncmp (line, "frr", strlen ("frr")) == 0
|
|| strncmp (line, "frr", strlen ("frr")) == 0
|
||||||
|| strncmp (line, "agentx", strlen ("agentx")) == 0
|
|| strncmp (line, "agentx", strlen ("agentx")) == 0
|
||||||
|
|| strncmp (line, "no log", strlen ("no log")) == 0
|
||||||
)
|
)
|
||||||
config_add_line_uniq (config_top, line);
|
config_add_line_uniq (config_top, line);
|
||||||
else
|
else
|
||||||
@ -319,41 +321,41 @@ vtysh_config_dump (FILE *fp)
|
|||||||
for (i = 0; i < vector_active (configvec); i++)
|
for (i = 0; i < vector_active (configvec); i++)
|
||||||
if ((master = vector_slot (configvec, i)) != NULL)
|
if ((master = vector_slot (configvec, i)) != NULL)
|
||||||
{
|
{
|
||||||
for (ALL_LIST_ELEMENTS (master, node, nnode, config))
|
for (ALL_LIST_ELEMENTS (master, node, nnode, config))
|
||||||
{
|
{
|
||||||
/* Don't print empty sections for interface/vrf. Route maps on the
|
/* Don't print empty sections for interface/vrf. Route maps on the
|
||||||
* other hand could have a legitimate empty section at the end.
|
* other hand could have a legitimate empty section at the end.
|
||||||
*/
|
*/
|
||||||
if ((config->index == INTERFACE_NODE || (config->index == VRF_NODE))
|
if ((config->index == INTERFACE_NODE || config->index == VRF_NODE)
|
||||||
&& list_isempty (config->line))
|
&& list_isempty (config->line))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
fprintf (fp, "%s\n", config->name);
|
fprintf (fp, "%s\n", config->name);
|
||||||
fflush (fp);
|
fflush (fp);
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS (config->line, mnode, mnnode, line))
|
for (ALL_LIST_ELEMENTS (config->line, mnode, mnnode, line))
|
||||||
{
|
{
|
||||||
fprintf (fp, "%s\n", line);
|
fprintf (fp, "%s\n", line);
|
||||||
fflush (fp);
|
fflush (fp);
|
||||||
}
|
}
|
||||||
if (! NO_DELIMITER (i))
|
if (! NO_DELIMITER (i))
|
||||||
{
|
{
|
||||||
fprintf (fp, "!\n");
|
fprintf (fp, "!\n");
|
||||||
fflush (fp);
|
fflush (fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (NO_DELIMITER (i))
|
if (NO_DELIMITER (i))
|
||||||
{
|
{
|
||||||
fprintf (fp, "!\n");
|
fprintf (fp, "!\n");
|
||||||
fflush (fp);
|
fflush (fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < vector_active (configvec); i++)
|
for (i = 0; i < vector_active (configvec); i++)
|
||||||
if ((master = vector_slot (configvec, i)) != NULL)
|
if ((master = vector_slot (configvec, i)) != NULL)
|
||||||
{
|
{
|
||||||
list_delete (master);
|
list_delete (master);
|
||||||
vector_slot (configvec, i) = NULL;
|
vector_slot (configvec, i) = NULL;
|
||||||
}
|
}
|
||||||
list_delete_all_node (config_top);
|
list_delete_all_node (config_top);
|
||||||
}
|
}
|
||||||
|
@ -192,6 +192,11 @@ zserv_encode_interface (struct stream *s, struct interface *ifp)
|
|||||||
static void
|
static void
|
||||||
zserv_encode_vrf (struct stream *s, struct zebra_vrf *zvrf)
|
zserv_encode_vrf (struct stream *s, struct zebra_vrf *zvrf)
|
||||||
{
|
{
|
||||||
|
struct vrf_data data;
|
||||||
|
|
||||||
|
data.l.table_id = zvrf->table_id;
|
||||||
|
/* Pass the tableid */
|
||||||
|
stream_put (s, &data, sizeof (struct vrf_data));
|
||||||
/* Interface information. */
|
/* Interface information. */
|
||||||
stream_put (s, zvrf_name (zvrf), VRF_NAMSIZ);
|
stream_put (s, zvrf_name (zvrf), VRF_NAMSIZ);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user