mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
Added stub interface. (Interface which is propagated to OSPF but
it does not sends nor listens packets.) I added some new options, please look at it and look into doc if it's OK.
This commit is contained in:
parent
5ddec4e6cf
commit
e3bc10fdc4
@ -1014,6 +1014,7 @@ protocol ospf <name> {
|
|||||||
interface <interface pattern>
|
interface <interface pattern>
|
||||||
{
|
{
|
||||||
cost <num>;
|
cost <num>;
|
||||||
|
stub <switch>;
|
||||||
hello <num>;
|
hello <num>;
|
||||||
poll <num>;
|
poll <num>;
|
||||||
retransmit <num>;
|
retransmit <num>;
|
||||||
@ -1060,6 +1061,10 @@ protocol ospf <name> {
|
|||||||
<tag>cost <M>num</M></tag>
|
<tag>cost <M>num</M></tag>
|
||||||
Specifies output cost (metric) of an interface. Default value is 10.
|
Specifies output cost (metric) of an interface. Default value is 10.
|
||||||
|
|
||||||
|
<tag>stub <M>switch</M></tag>
|
||||||
|
If set to interface it does not listen to any packet and does not send
|
||||||
|
any hello. Default value is no.
|
||||||
|
|
||||||
<tag>hello <M>num</M></tag>
|
<tag>hello <M>num</M></tag>
|
||||||
Specifies interval in seconds between sending of Hello messages. Beware, all
|
Specifies interval in seconds between sending of Hello messages. Beware, all
|
||||||
routers on the same network need to have the same hello interval.
|
routers on the same network need to have the same hello interval.
|
||||||
@ -1093,13 +1098,17 @@ protocol ospf <name> {
|
|||||||
convenient to force use of a different type manually.
|
convenient to force use of a different type manually.
|
||||||
On broadcast networks, flooding and Hello messages are sent using multicasts (a single packet for all the neighbors).
|
On broadcast networks, flooding and Hello messages are sent using multicasts (a single packet for all the neighbors).
|
||||||
|
|
||||||
|
<tag>type pointopoint</tag>
|
||||||
|
Point-to-point networks connect just 2 routers together. No election
|
||||||
|
is performed there which reduces the number of messages sent.
|
||||||
|
|
||||||
<tag>type nonbroadcast</tag>
|
<tag>type nonbroadcast</tag>
|
||||||
On nonbroadcast networks, the packets are sent to each neighbor
|
On nonbroadcast networks, the packets are sent to each neighbor
|
||||||
separately because of lack of multicast capabilities.
|
separately because of lack of multicast capabilities.
|
||||||
|
|
||||||
<tag>type pointopoint</tag>
|
<tag>strict nonbroadcast <M>switch</M></tag>
|
||||||
Point-to-point networks connect just 2 routers together. No election
|
If set, don't send hello to any undefined neighbor. This switch
|
||||||
is performed there which reduces the number of messages sent.
|
is ignored on on any non-NBMA network. Default is No.
|
||||||
|
|
||||||
<tag>authentication none</tag>
|
<tag>authentication none</tag>
|
||||||
No passwords are sent in OSPF packets. This is the default value.
|
No passwords are sent in OSPF packets. This is the default value.
|
||||||
@ -1116,10 +1125,6 @@ protocol ospf <name> {
|
|||||||
A set of neighbors to which Hello messages on nonbroadcast networks
|
A set of neighbors to which Hello messages on nonbroadcast networks
|
||||||
are to be sent. Some of them could be marked as eligible.
|
are to be sent. Some of them could be marked as eligible.
|
||||||
|
|
||||||
<tag>strict nonbroadcast <M>switch</M></tag>
|
|
||||||
If set, don't send hello to any undefined neighbor. This switch
|
|
||||||
is ignored on on any non-NBMA network. Default is No.
|
|
||||||
|
|
||||||
</descrip>
|
</descrip>
|
||||||
|
|
||||||
<sect1>Attributes
|
<sect1>Attributes
|
||||||
@ -1162,13 +1167,17 @@ protocol ospf MyOSPF {
|
|||||||
interface "ppp*" {
|
interface "ppp*" {
|
||||||
cost 100;
|
cost 100;
|
||||||
};
|
};
|
||||||
|
interface "arc0" {
|
||||||
|
cost 10;
|
||||||
|
stub yes;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
area 120 {
|
area 120 {
|
||||||
stub yes;
|
stub yes;
|
||||||
interface "-arc0" , "arc*" {
|
interface "-arc0" , "arc*" {
|
||||||
type nonbroadcast;
|
type nonbroadcast;
|
||||||
authentication none;
|
authentication none;
|
||||||
strict nonbroadcast no;
|
strict nonbroadcast yes;
|
||||||
wait 120;
|
wait 120;
|
||||||
poll 40;
|
poll 40;
|
||||||
dead count 8;
|
dead count 8;
|
||||||
|
@ -88,6 +88,7 @@ ospf_iface_item:
|
|||||||
| TYPE NONBROADCAST { OSPF_PATT->type = OSPF_IT_NBMA ; }
|
| TYPE NONBROADCAST { OSPF_PATT->type = OSPF_IT_NBMA ; }
|
||||||
| TYPE POINTOPOINT { OSPF_PATT->type = OSPF_IT_PTP ; }
|
| TYPE POINTOPOINT { OSPF_PATT->type = OSPF_IT_PTP ; }
|
||||||
| STRICT NONBROADCAST bool { OSPF_PATT->strictnbma = $3 ; }
|
| STRICT NONBROADCAST bool { OSPF_PATT->strictnbma = $3 ; }
|
||||||
|
| STUB bool { OSPF_PATT->stub = $2 ; }
|
||||||
| NEIGHBORS '{' ipa_list '}'
|
| NEIGHBORS '{' ipa_list '}'
|
||||||
| AUTHENTICATION NONE { OSPF_PATT->autype=AU_NONE ; }
|
| AUTHENTICATION NONE { OSPF_PATT->autype=AU_NONE ; }
|
||||||
| AUTHENTICATION SIMPLE { OSPF_PATT->autype=AU_SIMPLE ; }
|
| AUTHENTICATION SIMPLE { OSPF_PATT->autype=AU_SIMPLE ; }
|
||||||
@ -137,6 +138,7 @@ ospf_iface_start:
|
|||||||
OSPF_PATT->deadc = DEADC_D;
|
OSPF_PATT->deadc = DEADC_D;
|
||||||
OSPF_PATT->type = OSPF_IT_UNDEF;
|
OSPF_PATT->type = OSPF_IT_UNDEF;
|
||||||
OSPF_PATT->strictnbma = 0;
|
OSPF_PATT->strictnbma = 0;
|
||||||
|
OSPF_PATT->stub = 0;
|
||||||
init_list(&OSPF_PATT->nbma_list);
|
init_list(&OSPF_PATT->nbma_list);
|
||||||
OSPF_PATT->autype=AU_NONE;
|
OSPF_PATT->autype=AU_NONE;
|
||||||
}
|
}
|
||||||
|
@ -249,6 +249,8 @@ hello_send(timer *timer,int poll, struct ospf_neighbor *dirn)
|
|||||||
if(timer==NULL) ifa=dirn->ifa;
|
if(timer==NULL) ifa=dirn->ifa;
|
||||||
else ifa=(struct ospf_iface *)timer->data;
|
else ifa=(struct ospf_iface *)timer->data;
|
||||||
|
|
||||||
|
if(ifa->stub) return; /* Don't send any packet on stub iface */
|
||||||
|
|
||||||
p=(struct proto *)(ifa->proto);
|
p=(struct proto *)(ifa->proto);
|
||||||
DBG("%s: Hello/Poll timer fired on interface %s.\n",
|
DBG("%s: Hello/Poll timer fired on interface %s.\n",
|
||||||
p->name, ifa->iface->name);
|
p->name, ifa->iface->name);
|
||||||
|
@ -370,7 +370,8 @@ ospf_iface_info(struct ospf_iface *ifa)
|
|||||||
cli_msg(-1015,"Interface \"%s\":", ifa->iface->name);
|
cli_msg(-1015,"Interface \"%s\":", ifa->iface->name);
|
||||||
cli_msg(-1015,"\tArea: %I (%u)", ifa->oa->areaid, ifa->oa->areaid);
|
cli_msg(-1015,"\tArea: %I (%u)", ifa->oa->areaid, ifa->oa->areaid);
|
||||||
cli_msg(-1015,"\tType: %s %s", ospf_it[ifa->type], strict);
|
cli_msg(-1015,"\tType: %s %s", ospf_it[ifa->type], strict);
|
||||||
cli_msg(-1015,"\tState: %s", ospf_is[ifa->state]);
|
cli_msg(-1015,"\tState: %s %s", ospf_is[ifa->state],
|
||||||
|
ifa->stub ? "(stub)" : "");
|
||||||
cli_msg(-1015,"\tPriority: %u", ifa->priority);
|
cli_msg(-1015,"\tPriority: %u", ifa->priority);
|
||||||
cli_msg(-1015,"\tCost: %u", ifa->cost);
|
cli_msg(-1015,"\tCost: %u", ifa->cost);
|
||||||
cli_msg(-1015,"\tHello timer: %u", ifa->helloint);
|
cli_msg(-1015,"\tHello timer: %u", ifa->helloint);
|
||||||
@ -429,6 +430,7 @@ ospf_ifa_add(struct object_lock *lock)
|
|||||||
ifa->strictnbma=ip->strictnbma;
|
ifa->strictnbma=ip->strictnbma;
|
||||||
ifa->waitint=ip->waitint;
|
ifa->waitint=ip->waitint;
|
||||||
ifa->deadc=ip->deadc;
|
ifa->deadc=ip->deadc;
|
||||||
|
ifa->stub=ip->stub;
|
||||||
ifa->autype=ip->autype;
|
ifa->autype=ip->autype;
|
||||||
memcpy(ifa->aukey,ip->password,8);
|
memcpy(ifa->aukey,ip->password,8);
|
||||||
ifa->options=2; /* FIXME what options? */
|
ifa->options=2; /* FIXME what options? */
|
||||||
|
@ -558,14 +558,30 @@ ospf_reconfigure(struct proto *p, struct proto_config *c)
|
|||||||
{
|
{
|
||||||
ifa->strictnbma=ip2->strictnbma;
|
ifa->strictnbma=ip2->strictnbma;
|
||||||
OSPF_TRACE(D_EVENTS,
|
OSPF_TRACE(D_EVENTS,
|
||||||
"Interface %s is now strict NBMA",
|
"Interface %s is now strict NBMA.",
|
||||||
ifa->iface->name);
|
ifa->iface->name);
|
||||||
}
|
}
|
||||||
if((ip1->strictnbma!=0)&&(ip2->strictnbma==0))
|
if((ip1->strictnbma!=0)&&(ip2->strictnbma==0))
|
||||||
{
|
{
|
||||||
ifa->strictnbma=ip2->strictnbma;
|
ifa->strictnbma=ip2->strictnbma;
|
||||||
OSPF_TRACE(D_EVENTS,
|
OSPF_TRACE(D_EVENTS,
|
||||||
"Interface %s is no longer strict NBMA",
|
"Interface %s is no longer strict NBMA.",
|
||||||
|
ifa->iface->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* stub */
|
||||||
|
if((ip1->stub==0)&&(ip2->stub!=0))
|
||||||
|
{
|
||||||
|
ifa->stub=ip2->stub;
|
||||||
|
OSPF_TRACE(D_EVENTS,
|
||||||
|
"Interface %s is now stub.",
|
||||||
|
ifa->iface->name);
|
||||||
|
}
|
||||||
|
if((ip1->stub!=0)&&(ip2->stub==0))
|
||||||
|
{
|
||||||
|
ifa->stub=ip2->stub;
|
||||||
|
OSPF_TRACE(D_EVENTS,
|
||||||
|
"Interface %s is no longer stub.",
|
||||||
ifa->iface->name);
|
ifa->iface->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,6 +103,7 @@ struct ospf_iface {
|
|||||||
u32 bdrid;
|
u32 bdrid;
|
||||||
u8 type; /* OSPF view of type */
|
u8 type; /* OSPF view of type */
|
||||||
u8 strictnbma; /* Can I talk with unknown neighbors? */
|
u8 strictnbma; /* Can I talk with unknown neighbors? */
|
||||||
|
u8 stub; /* Inactive interface */
|
||||||
#define OSPF_IT_BCAST 0
|
#define OSPF_IT_BCAST 0
|
||||||
#define OSPF_IT_NBMA 1
|
#define OSPF_IT_NBMA 1
|
||||||
#define OSPF_IT_PTP 2
|
#define OSPF_IT_PTP 2
|
||||||
@ -390,6 +391,7 @@ struct ospf_iface_patt {
|
|||||||
int type;
|
int type;
|
||||||
int autype;
|
int autype;
|
||||||
int strictnbma;
|
int strictnbma;
|
||||||
|
int stub;
|
||||||
#define AU_NONE 0
|
#define AU_NONE 0
|
||||||
#define AU_SIMPLE 1
|
#define AU_SIMPLE 1
|
||||||
#define AU_CRYPT 2
|
#define AU_CRYPT 2
|
||||||
|
@ -84,6 +84,8 @@ ospf_rx_hook(sock *sk, int size)
|
|||||||
int i;
|
int i;
|
||||||
u8 *pu8;
|
u8 *pu8;
|
||||||
|
|
||||||
|
if(ifa->stub) return(1);
|
||||||
|
|
||||||
DBG("%s: RX_Hook called on interface %s.\n",p->name, sk->iface->name);
|
DBG("%s: RX_Hook called on interface %s.\n",p->name, sk->iface->name);
|
||||||
|
|
||||||
ps = (struct ospf_packet *) ipv4_skip_header(sk->rbuf, &size);
|
ps = (struct ospf_packet *) ipv4_skip_header(sk->rbuf, &size);
|
||||||
|
Loading…
Reference in New Issue
Block a user