diff options
author | Martin Mares <mj@ucw.cz> | 1999-11-10 12:27:01 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-11-10 12:27:01 +0000 |
commit | 6ba36f06ae10ea7efd60c30f8ef40d6143c69ef6 (patch) | |
tree | ba37f62a2d111351798513f3a8fbea7bc5263a6b /proto/ospf/ospf.h | |
parent | 3918b1b050701dee217fa9bc8c4c44d47cb84124 (diff) |
Added LSA hashing table (parts of code stolen from rt-fib.c, but
heavily simplified since we don't need asynchronous walking).
Diffstat (limited to 'proto/ospf/ospf.h')
-rw-r--r-- | proto/ospf/ospf.h | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h index 15a6e2cf..6404f1b1 100644 --- a/proto/ospf/ospf.h +++ b/proto/ospf/ospf.h @@ -9,6 +9,14 @@ #ifndef _BIRD_OSPF_H_ #define _BIRD_OSPF_H_ +#include "lib/ip.h" +#include "lib/lists.h" +#include "lib/socket.h" +#include "lib/timer.h" +#include "lib/resource.h" +#include "nest/protocol.h" +#include "nest/iface.h" + #define OSPF_PROTO 89 #ifndef IPV6 #define OSPF_VERSION 2 @@ -185,8 +193,36 @@ struct ospf_neighbor #define INM_ADJOK 7 /* AdjOK? */ #define INM_SEQMIS 8 /* Sequence number mismatch */ #define INM_1WAYREC 9 /* 1-Way */ -#define INM_KILLNBR 10 /* Kill Neigbor */ +#define INM_KILLNBR 10 /* Kill Neighbor */ #define INM_INACTTIM 11 /* Inactivity timer */ #define INM_LLDOWN 12 /* Line down */ +/* topology.c: Representation of network topology (LS graph) */ + +struct top_hash_entry { /* Index for fast mapping (type,rtrid,LSid)->vertex */ + struct top_hash_entry *next; /* Next in hash chain */ + struct top_vertex *vertex; + u32 lsa_id, rtr_id; + u16 lsa_type; + u16 pad; +}; + +struct top_graph { + pool *pool; /* Pool we allocate from */ + slab *hash_slab; /* Slab for hash entries */ + struct top_hash_entry **hash_table; /* Hashing (modelled a`la fib) */ + unsigned int hash_size; + unsigned int hash_order; + unsigned int hash_mask; + unsigned int hash_entries; + unsigned int hash_entries_min, hash_entries_max; +}; + +struct top_graph *ospf_top_new(struct proto_ospf *); +void ospf_top_free(struct top_graph *); +void ospf_top_dump(struct top_graph *); +struct top_hash_entry *ospf_hash_find(struct top_graph *, u32 lsa, u32 rtr, u32 type); +struct top_hash_entry *ospf_hash_get(struct top_graph *, u32 lsa, u32 rtr, u32 type); +void ospf_hash_delete(struct top_graph *, struct top_hash_entry *); + #endif /* _BIRD_OSPF_H_ */ |