struct top_hash_entry *he, *sn;
struct top_graph *gr = n->ifa->oa->gr;
struct ospf_packet *op;
- struct proto *p = (struct proto *) n->ifa->proto;
int i, j;
op = (struct ospf_packet *) ps;
struct ospf_iface *ifa, int size, ip_addr faddr)
{
u32 nrid, *pnrid;
- struct ospf_neighbor *neigh, *n;
+ struct ospf_neighbor *n;
u8 i, twoway, oldpriority;
ip_addr olddr, oldbdr;
ip_addr mask;
char *beg = "Bad OSPF hello packet from ", *rec = " received: ";
int eligible = 0;
- pool *pool;
struct proto *p = (struct proto *) ifa->proto;
nrid = ntohl(((struct ospf_packet *) ps)->routerid);
{
struct ospf_neighbor *n,*nx;
struct proto *p=&ifa->proto->proto;
- struct proto_ospf *po=ifa->proto;
WALK_LIST_DELSAFE(n,nx,ifa->neigh_list)
{
ospf_int_sm(struct ospf_iface *ifa, int event)
{
struct proto *p=(struct proto *)(ifa->proto);
- struct proto_ospf *po=ifa->proto;
struct ospf_area *oa=ifa->oa;
OSPF_TRACE(D_EVENTS, "SM on iface %s. Event is \"%s\".",
struct ospf_iface *ifa;
struct object_lock *lock;
struct nbma_node *nbma,*nb;
- u8 i;
- sock *mcsk;
-
DBG("%s: If notify called\n", p->name);
if (iface->flags & IF_IGNORE)
void
ospf_iface_info(struct ospf_iface *ifa)
{
- int x;
char *strict="(strict)";
if((ifa->type!=OSPF_IT_NBMA)||(ifa->strictnbma==0)) strict="";
u32 nrid, myrid;
struct ospf_neighbor *n;
struct ospf_lsa_header lsa, *plsa;
- int length;
u16 nolsa, i;
struct top_hash_entry *en;
u16 lenn = ntohs(ps->ospf_packet.length);
lsa_install_new(struct ospf_lsa_header *lsa, void *body, struct ospf_area *oa)
{
/* LSA can be temporarrily, but body must be mb_allocated. */
- struct proto *p=&oa->po->proto;
int change=0;
unsigned i;
struct top_hash_entry *en;
{
sock *sk;
- ip_addr to;
u16 len, age;
struct ospf_lsupd_packet *pk;
struct ospf_packet *op;
struct ospf_packet *op;
struct proto *p = &n->ifa->oa->po->proto;
void *pktpos;
- u8 ii;
- u8 *jj = n->ifa->ip_sk->tbuf;
if (EMPTY_LIST(*l))
return;
struct ospf_area *oa;
struct proto_ospf *po = ifa->proto;
struct proto *p = (struct proto *) po;
- u16 length;
u8 i;
int sendreq = 1;
void
bdr_election(struct ospf_iface *ifa)
{
- struct ospf_neighbor *neigh,*ndr,*nbdr,me,*tmp;
+ struct ospf_neighbor *neigh,*ndr,*nbdr,me;
u32 myid;
ip_addr ndrip, nbdrip;
int doadj;
{
struct ospf_neighbor *n = (struct ospf_neighbor *)timer->data;
struct ospf_iface *ifa = n->ifa;
- struct proto *p = (struct proto *)(ifa->proto);
struct top_hash_entry *en;
DBG("%s: RXMT timer fired on interface %s for neigh: %I.\n",
static void
ospf_dump(struct proto *p)
{
- char areastr[20];
struct ospf_iface *ifa;
struct ospf_neighbor *n;
- struct ospf_config *c = (void *) p->cf;
struct proto_ospf *po=(struct proto_ospf *)p;
struct ospf_area *oa;
struct proto *p = proto_new(c, sizeof(struct proto_ospf));
struct proto_ospf *po=(struct proto_ospf *)p;
struct ospf_config *oc=(struct ospf_config *)c;
- struct ospf_area_config *ac;
- struct ospf_iface_patt *patt;
p->import_control = ospf_import_control;
p->make_tmp_attrs = ospf_make_tmp_attrs;
static int
ospf_rte_better(struct rte *new, struct rte *old)
{
- struct proto *p = new->attrs->proto;
-
if(new->u.ospf.metric1==LSINFINITY) return 0;
/* External paths are always longer that internal */
area_disp(timer *timer)
{
struct ospf_area *oa=timer->data;
- struct top_hash_entry *en,*nxt;
+ struct top_hash_entry *nxt;
struct proto_ospf *po=oa->po;
struct ospf_iface *ifa;
ospf_import_control(struct proto *p, rte **new, ea_list **attrs, struct linpool *pool)
{
rte *e=*new;
- struct proto_ospf *po=(struct proto_ospf *)p;
if(p==e->attrs->proto) return -1; /* Reject our own routes */
*attrs = ospf_build_attrs(*attrs, pool, LSINFINITY, 10000, 0);
{
struct proto_ospf *po=(struct proto_ospf *)p;
struct ospf_iface *ifa;
- struct ospf_neighbor *n;
- struct ospf_area *oa;
OSPF_TRACE(D_EVENTS, "Shutdown requested");
/* And send to all my neighbors 1WAY */
}
void
-ospf_rt_notify(struct proto *p, net *n, rte *new, rte *old, ea_list *attrs)
+ospf_rt_notify(struct proto *p, net *n, rte *new, rte *old UNUSED, ea_list *attrs)
{
struct proto_ospf *po=(struct proto_ospf *)p;
}
static void
-ospf_get_route_info(rte *rte, byte *buf, ea_list *attrs)
+ospf_get_route_info(rte *rte, byte *buf, ea_list *attrs UNUSED)
{
char met=' ';
char type=' ';
void
ospf_sh_iface(struct proto *p, char *iff)
{
- struct ospf_area *oa;
struct proto_ospf *po=(struct proto_ospf *)p;
struct ospf_iface *ifa=NULL,*f;
- struct ospf_neighbor *n;
- int ifano;
- int nno;
- int adjno;
if(p->proto_state != PS_UP)
{
void
ospf_tx_authenticate (struct ospf_iface *ifa, struct ospf_packet *pkt)
{
- int i;
pkt->autype = htons (ifa->autype);
memcpy (pkt->authetication, ifa->aukey, 8);
return;
struct ospf_packet *ps;
struct ospf_iface *ifa = (struct ospf_iface *) (sk->data);
struct proto *p = (struct proto *) (ifa->proto);
- int i;
- u8 *pu8;
if (ifa->stub)
return (1);
}
void
-ospf_err_hook (sock * sk, int err)
+ospf_err_hook (sock * sk, int err UNUSED)
{
struct ospf_iface *ifa;
struct proto *p;
void
sk_send_to_bdr (sock * sk, u16 len, struct ospf_iface *ifa)
{
- struct ospf_neighbor *n;
-
if (ipa_compare (ifa->drip, ipa_from_u32 (0)) != 0)
sk_send_to (sk, len, ifa->drip, OSPF_PROTO);
if (ipa_compare (ifa->bdrip, ipa_from_u32 (0)) != 0)
void
ospf_rt_spfa(struct ospf_area *oa)
{
- struct top_hash_entry *en;
u32 i,*rts;
struct ospf_lsa_rt *rt;
struct ospf_lsa_rt_link *rtl,*rr;
struct fib *in=&oa->infib;
struct infib *nf;
struct fib_iterator fit;
- int age=0,flush=0;
struct proto *p=&oa->po->proto;
struct proto_ospf *po=oa->po;
ip_addr ip;
struct proto *p=&po->proto;
struct ospf_lsa_ext *le;
struct ospf_lsa_ext_tos *lt;
- struct ospf_lsa_rt *rt;
int mlen;
ip_addr ip,nnh;
struct iface *nnhi=NULL;
nf->oldtag=nf->tag;
}
}
-let:
FIB_ITERATE_END(nftmp);
}
u16 dist, struct ospf_area *oa)
{
node *prev,*n;
- int flag=0,added=0;
+ int added=0;
struct top_hash_entry *act;
- struct proto *p=&oa->po->proto;
if(en==NULL) return;
if(en->lsa.age==LSA_MAXAGE) return;
struct ospf_lsa_rt *rt;
struct ospf_lsa_rt_link *ln;
struct ospf_neighbor *neigh;
- struct top_hash_entry *old;
- struct proto_ospf *po=(struct proto_ospf *)p;
DBG("%s: Originating RT_lsa body for area \"%I\".\n", po->proto.name,
oa->areaid);
{
struct ospf_area *oa;
struct proto_ospf *po=ifa->proto;
- struct proto *p=&po->proto;
-
WALK_LIST(NODE oa,po->area_list)
{
struct proto_ospf *po=ifa->proto;
struct ospf_lsa_header lsa;
u32 rtid=po->proto.cf->global->router_id;
- struct top_hash_entry *en;
struct proto *p=&po->proto;
void *body;
struct proto *p=&po->proto;
struct ospf_lsa_ext *ext;
struct ospf_lsa_ext_tos *et;
- neighbor *nn;
u32 m1 = ea_get_int(attrs, EA_OSPF_METRIC1, LSINFINITY);
u32 m2 = ea_get_int(attrs, EA_OSPF_METRIC2, 10000);
u32 tag = ea_get_int(attrs, EA_OSPF_TAG, 0);
{
struct ospf_iface *ifa;
struct ospf_neighbor *n;
- struct proto_ospf *po=oa->po;
WALK_LIST(ifa, iface_list)
{