From 86c84d76b706e77ec5977a3c9e300b0fca9f6b10 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Thu, 15 Jul 2004 16:37:52 +0000 Subject: Huge OSPF database redesign. Since now, all LSAs of all areas are in single database. This avoids duplication of external LSAs and fixes bug in external LSA distribution. --- proto/ospf/packet.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'proto/ospf/packet.c') diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c index 92e0522..5b0ad80 100644 --- a/proto/ospf/packet.c +++ b/proto/ospf/packet.c @@ -14,9 +14,7 @@ void ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type) { struct ospf_packet *pkt; - struct proto *p; - - p = (struct proto *) (ifa->proto); + struct proto *p = (struct proto *) (ifa->oa->po); pkt = (struct ospf_packet *) buf; @@ -40,7 +38,7 @@ ospf_pkt_maxsize(struct ospf_iface *ifa) void ospf_pkt_finalize(struct ospf_iface *ifa, struct ospf_packet *pkt) { - struct proto_ospf *po = ifa->proto; + struct proto_ospf *po = ifa->oa->po; struct proto *p = &po->proto; struct password_item *passwd = password_find (ifa->passwords); void *tail; @@ -97,7 +95,7 @@ static int ospf_pkt_checkauth(struct ospf_neighbor *n, struct ospf_iface *ifa, struct ospf_packet *pkt, int size) { int i; - struct proto_ospf *po = ifa->proto; + struct proto_ospf *po = ifa->oa->po; struct proto *p = &po->proto; struct password_item *pass = NULL, *ptmp; void *tail; @@ -219,8 +217,8 @@ ospf_rx_hook(sock * sk, int size) { struct ospf_packet *ps; struct ospf_iface *ifa = (struct ospf_iface *) (sk->data); - struct proto_ospf *po = ifa->proto; - struct proto *p = (struct proto *) (ifa->proto); + struct proto_ospf *po = ifa->oa->po; + struct proto *p = &po->proto; struct ospf_neighbor *n; int osize; char *mesg = "Bad OSPF packet from "; @@ -356,24 +354,16 @@ ospf_rx_hook(sock * sk, int size) void ospf_tx_hook(sock * sk) { - struct ospf_iface *ifa; - struct proto *p; - - ifa = (struct ospf_iface *) (sk->data); - - p = (struct proto *) (ifa->proto); + struct ospf_iface *ifa= (struct ospf_iface *) (sk->data); + struct proto *p = (struct proto *) (ifa->oa->po); DBG("%s: TX_Hook called on interface %s\n", p->name, sk->iface->name); } void ospf_err_hook(sock * sk, int err UNUSED) { - struct ospf_iface *ifa; - struct proto *p; - - ifa = (struct ospf_iface *) (sk->data); - - p = (struct proto *) (ifa->proto); + struct ospf_iface *ifa= (struct ospf_iface *) (sk->data); + struct proto *p = (struct proto *) (ifa->oa->po); DBG("%s: Err_Hook called on interface %s\n", p->name, sk->iface->name); } -- cgit v1.2.3