mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 05:27:47 +00:00
ospfd Point-to-Multipoint support
This commit is contained in:
parent
30961a15cf
commit
7afa08da2d
@ -589,6 +589,44 @@ lsa_link_virtuallink_set (struct stream *s, struct ospf_interface *oi)
|
|||||||
|
|
||||||
#define lsa_link_nbma_set(S,O) lsa_link_broadcast_set (S, O)
|
#define lsa_link_nbma_set(S,O) lsa_link_broadcast_set (S, O)
|
||||||
|
|
||||||
|
/* this function add for support point-to-multipoint ,see rfc2328
|
||||||
|
12.4.1.4.*/
|
||||||
|
/* from "edward rrr" <edward_rrr@hotmail.com>
|
||||||
|
http://marc.theaimsgroup.com/?l=zebra&m=100739222210507&w=2 */
|
||||||
|
int lsa_link_ptomultip_set (struct stream *s, struct ospf_interface *oi)
|
||||||
|
{
|
||||||
|
int links = 0;
|
||||||
|
struct route_node *rn;
|
||||||
|
struct ospf_neighbor *nbr = NULL;
|
||||||
|
struct in_addr id, mask;
|
||||||
|
|
||||||
|
mask.s_addr = 0xffffffff;
|
||||||
|
id.s_addr = oi->address->u.prefix4.s_addr;
|
||||||
|
link_info_set (s, id, mask, LSA_LINK_TYPE_STUB, 0, 0);
|
||||||
|
links++;
|
||||||
|
|
||||||
|
zlog_info ("PointToMultipoint: running ptomultip_set");
|
||||||
|
|
||||||
|
/* Search neighbor, */
|
||||||
|
for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
|
||||||
|
if ((nbr = rn->info) != NULL)
|
||||||
|
/* Ignore myself. */
|
||||||
|
if (!IPV4_ADDR_SAME (&nbr->router_id, &ospf_top->router_id))
|
||||||
|
if (nbr->state == NSM_Full)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
link_info_set (s, nbr->router_id, oi->address->u.prefix4,
|
||||||
|
LSA_LINK_TYPE_POINTOPOINT, 0, oi->output_cost);
|
||||||
|
links++;
|
||||||
|
zlog_info ("PointToMultipoint: set link to %s",
|
||||||
|
inet_ntoa(oi->address->u.prefix4));
|
||||||
|
}
|
||||||
|
|
||||||
|
return links;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* Set router-LSA link information. */
|
/* Set router-LSA link information. */
|
||||||
int
|
int
|
||||||
router_lsa_link_set (struct stream *s, struct ospf_area *area)
|
router_lsa_link_set (struct stream *s, struct ospf_area *area)
|
||||||
@ -619,7 +657,7 @@ router_lsa_link_set (struct stream *s, struct ospf_area *area)
|
|||||||
links += lsa_link_nbma_set (s, oi);
|
links += lsa_link_nbma_set (s, oi);
|
||||||
break;
|
break;
|
||||||
case OSPF_IFTYPE_POINTOMULTIPOINT:
|
case OSPF_IFTYPE_POINTOMULTIPOINT:
|
||||||
/* Not supproted yet. */
|
links += lsa_link_ptomultip_set (s, oi);
|
||||||
break;
|
break;
|
||||||
case OSPF_IFTYPE_VIRTUALLINK:
|
case OSPF_IFTYPE_VIRTUALLINK:
|
||||||
links += lsa_link_virtuallink_set (s, oi);
|
links += lsa_link_virtuallink_set (s, oi);
|
||||||
|
@ -3137,6 +3137,8 @@ ospf_ls_upd_send (struct ospf_neighbor *nbr, list update, int flag)
|
|||||||
else if ((oi->type == OSPF_IFTYPE_POINTOPOINT)
|
else if ((oi->type == OSPF_IFTYPE_POINTOPOINT)
|
||||||
&& (flag == OSPF_SEND_PACKET_INDIRECT))
|
&& (flag == OSPF_SEND_PACKET_INDIRECT))
|
||||||
p.prefix.s_addr = htonl (OSPF_ALLSPFROUTERS);
|
p.prefix.s_addr = htonl (OSPF_ALLSPFROUTERS);
|
||||||
|
else if (oi->type == OSPF_IFTYPE_POINTOMULTIPOINT)
|
||||||
|
p.prefix.s_addr = htonl (OSPF_ALLSPFROUTERS);
|
||||||
else
|
else
|
||||||
p.prefix.s_addr = htonl (OSPF_ALLDROUTERS);
|
p.prefix.s_addr = htonl (OSPF_ALLDROUTERS);
|
||||||
|
|
||||||
|
@ -364,6 +364,27 @@ ospf_nexthop_calculation (struct ospf_area *area,
|
|||||||
struct router_lsa_link *l2 = NULL;
|
struct router_lsa_link *l2 = NULL;
|
||||||
|
|
||||||
if (l->m[0].type == LSA_LINK_TYPE_POINTOPOINT)
|
if (l->m[0].type == LSA_LINK_TYPE_POINTOPOINT)
|
||||||
|
{
|
||||||
|
/* check for PtMP, signified by PtP link V->W with link_data our PtMP interface */
|
||||||
|
oi = ospf_if_is_configured(&l->link_data);
|
||||||
|
if (oi && oi->type == OSPF_IFTYPE_POINTOMULTIPOINT)
|
||||||
|
{
|
||||||
|
|
||||||
|
struct prefix_ipv4 * la = prefix_ipv4_new();
|
||||||
|
la->prefixlen = oi->address->prefixlen;
|
||||||
|
|
||||||
|
/* we link to them on PtMP interface - find the interface on w */
|
||||||
|
while ((l2 = ospf_get_next_link (w, v, l2)))
|
||||||
|
{
|
||||||
|
la->prefix = l2->link_data;
|
||||||
|
|
||||||
|
if (prefix_cmp((struct prefix *)la, oi->address) == 0)
|
||||||
|
/* link_data is on our PtMP network */
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
while ((l2 = ospf_get_next_link (w, v, l2)))
|
while ((l2 = ospf_get_next_link (w, v, l2)))
|
||||||
{
|
{
|
||||||
@ -372,12 +393,12 @@ ospf_nexthop_calculation (struct ospf_area *area,
|
|||||||
if (oi == NULL)
|
if (oi == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (! IPV4_ADDR_SAME (&oi->address->u.prefix4,
|
if (!IPV4_ADDR_SAME (&oi->address->u.prefix4, &l->link_data))
|
||||||
&l->link_data))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (oi && l2)
|
if (oi && l2)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user