summaryrefslogtreecommitdiffstats
path: root/proto/ospf
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-03-30 22:00:42 +0200
committerOndrej Filip <feela@network.cz>2000-03-30 22:00:42 +0200
commitde769e24c01ff0c4aa573d9b4cec833dcae182d2 (patch)
tree2e930b785fecbe391e2ed53d67e8cc8e6c6cd243 /proto/ospf
parent95eb1dba3ffe810bd876546ca4580af3bccdf181 (diff)
downloadbird-de769e24c01ff0c4aa573d9b4cec833dcae182d2.tar
bird-de769e24c01ff0c4aa573d9b4cec833dcae182d2.zip
Skeleton structures and files added.
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/lsack.c39
-rw-r--r--proto/ospf/lsack.h17
-rw-r--r--proto/ospf/lsreq.c8
-rw-r--r--proto/ospf/lsupd.c39
-rw-r--r--proto/ospf/lsupd.h17
-rw-r--r--proto/ospf/ospf.h10
6 files changed, 128 insertions, 2 deletions
diff --git a/proto/ospf/lsack.c b/proto/ospf/lsack.c
new file mode 100644
index 0000000..5870809
--- /dev/null
+++ b/proto/ospf/lsack.c
@@ -0,0 +1,39 @@
+/*
+ * BIRD -- OSPF
+ *
+ * (c) 2000 Ondrej Filip <feela@network.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include "ospf.h"
+
+void
+ospf_lsack_tx(struct ospf_neighbor *n)
+{
+ /* FIXME Go on! */
+}
+
+void
+ospf_lsack_rx(struct ospf_lsack_packet *ps, struct proto *p,
+ struct ospf_iface *ifa, u16 size)
+{
+ u32 nrid, myrid;
+ struct ospf_neighbor *n;
+ struct ospf_lsreq_header *lsh;
+ int length;
+ u8 i;
+
+ nrid=ntohl(ps->ospf_packet.routerid);
+
+ myrid=p->cf->global->router_id;
+
+ if((n=find_neigh(ifa, nrid))==NULL)
+ {
+ debug("%s: Received lsack from unknown neigbor! (%u)\n", p->name,
+ nrid);
+ return ;
+ }
+ /* FIXME Go on! */
+}
+
diff --git a/proto/ospf/lsack.h b/proto/ospf/lsack.h
new file mode 100644
index 0000000..ed0ea21
--- /dev/null
+++ b/proto/ospf/lsack.h
@@ -0,0 +1,17 @@
+/*
+ * BIRD -- OSPF
+ *
+ * (c) 2000 Ondrej Filip <feela@network.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ *
+ */
+
+#ifndef _BIRD_OSPF_LSACK_H_
+#define _BIRD_OSPF_LSACK_H_
+
+void ospf_lsack_tx(struct ospf_neighbor *n);
+void ospf_lsack_rx(struct ospf_lsack_packet *ps, struct proto *p,
+ struct ospf_iface *ifa, u16 size);
+
+#endif /* _BIRD_OSPF_LSACK_H_ */
diff --git a/proto/ospf/lsreq.c b/proto/ospf/lsreq.c
index 5aa59f5..91bc988 100644
--- a/proto/ospf/lsreq.c
+++ b/proto/ospf/lsreq.c
@@ -86,7 +86,7 @@ ospf_lsreq_rx(struct ospf_lsreq_packet *ps, struct proto *p,
if((n=find_neigh(ifa, nrid))==NULL)
{
- debug("%s: Received dbdes from unknown neigbor! (%u)\n", p->name,
+ debug("%s: Received lsreq from unknown neigbor! (%u)\n", p->name,
nrid);
return ;
}
@@ -99,8 +99,12 @@ ospf_lsreq_rx(struct ospf_lsreq_packet *ps, struct proto *p,
{
DBG("Processing LSA: ID=%u, Type=%u, Router=%u\n", lsh->id, lsh->type,
lsh->rt);
+ if(ospf_hash_find(n->ifa->oa->gr, lsh->id, lsh->rt, lsh->type)==NULL)
+ {
+ ospf_neigh_sm(n,INM_BADLSREQ);
+ return;
+ }
/* FIXME Go on */
}
-
}
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
new file mode 100644
index 0000000..5f53311
--- /dev/null
+++ b/proto/ospf/lsupd.c
@@ -0,0 +1,39 @@
+/*
+ * BIRD -- OSPF
+ *
+ * (c) 2000 Ondrej Filip <feela@network.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include "ospf.h"
+
+void
+ospf_lsupd_tx(struct ospf_neighbor *n)
+{
+ /* FIXME Go on! */
+}
+
+void
+ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
+ struct ospf_iface *ifa, u16 size)
+{
+ u32 nrid, myrid;
+ struct ospf_neighbor *n;
+ struct ospf_lsreq_header *lsh;
+ int length;
+ u8 i;
+
+ nrid=ntohl(ps->ospf_packet.routerid);
+
+ myrid=p->cf->global->router_id;
+
+ if((n=find_neigh(ifa, nrid))==NULL)
+ {
+ debug("%s: Received lsupd from unknown neigbor! (%u)\n", p->name,
+ nrid);
+ return ;
+ }
+ /* FIXME Go on! */
+}
+
diff --git a/proto/ospf/lsupd.h b/proto/ospf/lsupd.h
new file mode 100644
index 0000000..1aee1dc
--- /dev/null
+++ b/proto/ospf/lsupd.h
@@ -0,0 +1,17 @@
+/*
+ * BIRD -- OSPF
+ *
+ * (c) 2000 Ondrej Filip <feela@network.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ *
+ */
+
+#ifndef _BIRD_OSPF_LSUPD_H_
+#define _BIRD_OSPF_LSUPD_H_
+
+void ospf_lsupd_tx(struct ospf_neighbor *n);
+void ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
+ struct ospf_iface *ifa, u16 size);
+
+#endif /* _BIRD_OSPF_LSUPD_H_ */
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index 283ccc9..bc37fc4 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -246,6 +246,16 @@ struct ospf_lsreq_header {
u32 rt; /* Advertising router */
};
+struct ospf_lsupd_packet {
+ struct ospf_packet ospf_packet;
+ u32 lsano; /* Number of LSA's */
+};
+
+struct ospf_lsack_packet {
+ struct ospf_packet ospf_packet;
+};
+
+
struct ospf_neighbor
{
node n;