summaryrefslogtreecommitdiff
path: root/proto/ospf/packet.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2004-07-15 16:37:52 +0000
committerOndrej Filip <feela@network.cz>2004-07-15 16:37:52 +0000
commit86c84d76b706e77ec5977a3c9e300b0fca9f6b10 (patch)
tree77663b13c8f4741893df9d4334c032c848820c46 /proto/ospf/packet.c
parent777acf91bb0d8ca0f33f367ae5fa00f46dde5a9a (diff)
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.
Diffstat (limited to 'proto/ospf/packet.c')
-rw-r--r--proto/ospf/packet.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index 92e05226..5b0ad807 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);
}