Statistics
| Branch: | Revision:

iof-bird-daemon / proto / ospf / topology.h @ 035f6acb

History | View | Annotate | Download (2.02 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
  node cn;                                /* For adding into list of candidates
15
                                         * in intra-area routing table
16
                                         * calculation
17
                                         */
18
  struct top_hash_entry *next;                /* Next in hash chain */
19
  struct ospf_lsa_header lsa;
20
  void *lsa_body;
21
  bird_clock_t inst_t;                        /* Time of installation into DB */
22
  ip_addr nh;                                /* Next hop */
23
  struct iface *nhi;
24
  u16 dist;                                /* Distance from the root */
25
  u16 ini_age;
26
  u8 color;
27
#define OUTSPF 0
28
#define CANDIDATE 1
29
#define INSPF 2
30
  u8 padding;
31
  u16 padding2;
32
};
33

    
34
struct top_graph {
35
  pool *pool;                                /* Pool we allocate from */
36
  slab *hash_slab;                        /* Slab for hash entries */
37
  struct top_hash_entry **hash_table;        /* Hashing (modelled a`la fib) */
38
  unsigned int hash_size;
39
  unsigned int hash_order;
40
  unsigned int hash_mask;
41
  unsigned int hash_entries;
42
  unsigned int hash_entries_min, hash_entries_max;
43
};
44

    
45
struct top_graph *ospf_top_new(pool *, struct proto_ospf *);
46
void ospf_top_free(struct top_graph *);
47
void ospf_top_dump(struct top_graph *, struct proto *);
48
struct top_hash_entry *ospf_hash_find_header(struct top_graph *f, struct ospf_lsa_header *h);
49
struct top_hash_entry *ospf_hash_get_header(struct top_graph *f, struct ospf_lsa_header *h);
50
struct top_hash_entry *ospf_hash_find(struct top_graph *, u32 lsa, u32 rtr, u32 type);
51
struct top_hash_entry *ospf_hash_get(struct top_graph *, u32 lsa, u32 rtr, u32 type);
52
void ospf_hash_delete(struct top_graph *, struct top_hash_entry *);
53
void addifa_rtlsa(struct ospf_iface *ifa);
54
void originate_rt_lsa(struct ospf_area *oa);
55
void originate_net_lsa(struct ospf_iface *ifa);
56
int can_flush_lsa(struct ospf_area *oa);
57
int max_ext_lsa(unsigned pxlen);
58
void originate_ext_lsa(net *n, rte *e, struct proto_ospf *po, struct ea_list *attrs);
59

    
60
#endif /* _BIRD_OSPF_TOPOLOGY_H_ */