Statistics
| Branch: | Revision:

iof-bird-daemon / proto / ospf / topology.h @ 14a7921c

History | View | Annotate | Download (1.21 KB)

1
/*
2
 *        BIRD -- OSPF
3
 *
4
 *        (c) 1999 - 2000 Ondrej Filip <feela@network.cz>
5
 *
6
 *        Can be freely distributed and used under the terms of the GNU GPL.
7
 */
8

    
9
#ifndef _BIRD_OSPF_TOPOLOGY_H_
10
#define _BIRD_OSPF_TOPOLOGY_H_
11

    
12
struct top_hash_entry {  /* Index for fast mapping (type,rtrid,LSid)->vertex */
13
   snode n;
14
  struct top_hash_entry *next;                /* Next in hash chain */
15
  struct ospf_lsa_header lsa;
16
  void *lsa_body;
17
  unsigned int body_len;
18
};
19

    
20
struct top_graph {
21
  pool *pool;                                /* Pool we allocate from */
22
  slab *hash_slab;                        /* Slab for hash entries */
23
  struct top_hash_entry **hash_table;        /* Hashing (modelled a`la fib) */
24
  unsigned int hash_size;
25
  unsigned int hash_order;
26
  unsigned int hash_mask;
27
  unsigned int hash_entries;
28
  unsigned int hash_entries_min, hash_entries_max;
29
};
30

    
31
struct top_graph *ospf_top_new(struct proto_ospf *);
32
void ospf_top_free(struct top_graph *);
33
void ospf_top_dump(struct top_graph *);
34
struct top_hash_entry *ospf_hash_find(struct top_graph *, u32 lsa, u32 rtr, u32 type);
35
struct top_hash_entry *ospf_hash_get(struct top_graph *, u32 lsa, u32 rtr, u32 type);
36
void ospf_hash_delete(struct top_graph *, struct top_hash_entry *);
37
void addifa_rtlsa(struct ospf_iface *ifa);
38

    
39
#endif /* _BIRD_OSPF_TOPOLOGY_H_ */