blob: 153ed21eb17e129bb28825677450ff6c2654c178 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
2 * Copyright (C) 2001 Yasuhiro Ohara
3 *
4 * This file is part of GNU Zebra.
5 *
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
22#ifndef OSPF6_ASBR_H
23#define OSPF6_ASBR_H
24
25#include "thread.h"
26
27struct ospf6_external_info
28{
29 int is_removed;
30 struct thread *thread_originate;
31
32 struct ospf6_external_route *route;
33
34 struct ospf6_external_info *prev;
35 struct ospf6_external_info *next;
36
37 /* external route type */
38 int type;
39
40 /* external route ifindex */
41 int ifindex;
42
43 /* LS-ID */
44 u_int32_t id;
45
46 /* nexthops */
47 u_int nexthop_num;
48 struct in6_addr *nexthop;
49
50 u_int8_t prefix_options;
51
52 u_int8_t metric_type;
53 u_int32_t metric;
54 struct in6_addr forwarding;
55 /* u_int32_t tag; */
56};
57
58struct ospf6_external_route
59{
60 struct route_node *node;
61
62 /* prefix */
63 struct prefix prefix;
64
65 /* external information */
66 struct ospf6_external_info *info_head;
67 struct ospf6_external_info *info_tail;
68};
69
70/* AS-External-LSA */
71struct ospf6_lsa_as_external
72{
73 u_int32_t bits_metric;
74
75 struct ospf6_prefix prefix;
76 /* followed by none or one forwarding address */
77 /* followed by none or one external route tag */
78 /* followed by none or one referenced LS-ID */
79};
80
81#define OSPF6_ASBR_BIT_T ntohl (0x01000000)
82#define OSPF6_ASBR_BIT_F ntohl (0x02000000)
83#define OSPF6_ASBR_BIT_E ntohl (0x04000000)
84
85#define OSPF6_ASBR_METRIC(E) (ntohl ((E)->bits_metric & htonl (0x00ffffff)))
86#define OSPF6_ASBR_METRIC_SET(E,C) \
87 { (E)->bits_metric &= htonl (0xff000000); \
88 (E)->bits_metric |= htonl (0x00ffffff) & htonl (C); }
89
90void ospf6_asbr_routemap_update ();
91
92int ospf6_redistribute_config_write (struct vty *vty);
93void ospf6_redistribute_show_config (struct vty *vty);
94
95void
96ospf6_asbr_route_add (int type, int ifindex, struct prefix *prefix,
97 u_int nexthop_num, struct in6_addr *nexthop);
98void
99ospf6_asbr_route_remove (int type, int ifindex, struct prefix *prefix);
100
101void ospf6_asbr_external_lsa_add (struct ospf6_lsa *lsa);
102void ospf6_asbr_external_lsa_remove (struct ospf6_lsa *lsa);
103void ospf6_asbr_external_lsa_change (struct ospf6_lsa *old,
104 struct ospf6_lsa *new);
105
106void ospf6_asbr_asbr_entry_add (struct ospf6_route_req *topo_entry);
107void ospf6_asbr_asbr_entry_remove (struct ospf6_route_req *topo_entry);
108
109void ospf6_asbr_init ();
110
111#endif /* OSPF6_ASBR_H */
112