]>
Commit | Line | Data |
---|---|---|
718e3744 | 1 | /* |
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 | * | |
896014f4 DL |
16 | * You should have received a copy of the GNU General Public License along |
17 | * with this program; see the file COPYING; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
718e3744 | 19 | */ |
20 | ||
21 | #ifndef OSPF6_ASBR_H | |
22 | #define OSPF6_ASBR_H | |
23 | ||
87362ceb DO |
24 | /* for struct ospf6_prefix */ |
25 | #include "ospf6_proto.h" | |
26 | /* for struct ospf6_lsa */ | |
27 | #include "ospf6_lsa.h" | |
28 | /* for struct ospf6_route */ | |
29 | #include "ospf6_route.h" | |
30 | ||
508e53e2 | 31 | /* Debug option */ |
32 | extern unsigned char conf_debug_ospf6_asbr; | |
d62a17ae | 33 | #define OSPF6_DEBUG_ASBR_ON() (conf_debug_ospf6_asbr = 1) |
34 | #define OSPF6_DEBUG_ASBR_OFF() (conf_debug_ospf6_asbr = 0) | |
35 | #define IS_OSPF6_DEBUG_ASBR (conf_debug_ospf6_asbr) | |
718e3744 | 36 | |
d62a17ae | 37 | struct ospf6_external_info { |
38 | /* External route type */ | |
39 | int type; | |
718e3744 | 40 | |
d62a17ae | 41 | /* Originating Link State ID */ |
d7c0a89a | 42 | uint32_t id; |
718e3744 | 43 | |
d62a17ae | 44 | struct in6_addr forwarding; |
464015fa | 45 | |
d62a17ae | 46 | route_tag_t tag; |
42a7debf | 47 | |
d62a17ae | 48 | ifindex_t ifindex; |
718e3744 | 49 | }; |
50 | ||
718e3744 | 51 | /* AS-External-LSA */ |
abc7ef44 | 52 | #define OSPF6_AS_EXTERNAL_LSA_MIN_SIZE 4U /* w/o IPv6 prefix */ |
d62a17ae | 53 | struct ospf6_as_external_lsa { |
d7c0a89a | 54 | uint32_t bits_metric; |
d62a17ae | 55 | |
56 | struct ospf6_prefix prefix; | |
57 | /* followed by none or one forwarding address */ | |
58 | /* followed by none or one external route tag */ | |
59 | /* followed by none or one referenced LS-ID */ | |
718e3744 | 60 | }; |
61 | ||
62 | #define OSPF6_ASBR_BIT_T ntohl (0x01000000) | |
63 | #define OSPF6_ASBR_BIT_F ntohl (0x02000000) | |
64 | #define OSPF6_ASBR_BIT_E ntohl (0x04000000) | |
65 | ||
66 | #define OSPF6_ASBR_METRIC(E) (ntohl ((E)->bits_metric & htonl (0x00ffffff))) | |
d62a17ae | 67 | #define OSPF6_ASBR_METRIC_SET(E, C) \ |
68 | { \ | |
69 | (E)->bits_metric &= htonl(0xff000000); \ | |
70 | (E)->bits_metric |= htonl(0x00ffffff) & htonl(C); \ | |
71 | } | |
72 | ||
73 | extern void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa); | |
07b37f93 CS |
74 | extern void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa, |
75 | struct ospf6_route *asbr_entry); | |
d62a17ae | 76 | extern void ospf6_asbr_lsentry_add(struct ospf6_route *asbr_entry); |
77 | extern void ospf6_asbr_lsentry_remove(struct ospf6_route *asbr_entry); | |
78 | ||
79 | extern int ospf6_asbr_is_asbr(struct ospf6 *o); | |
80 | extern void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex, | |
81 | struct prefix *prefix, | |
d7c0a89a | 82 | unsigned int nexthop_num, |
d62a17ae | 83 | struct in6_addr *nexthop, |
84 | route_tag_t tag); | |
85 | extern void ospf6_asbr_redistribute_remove(int type, ifindex_t ifindex, | |
86 | struct prefix *prefix); | |
87 | ||
88 | extern int ospf6_redistribute_config_write(struct vty *vty); | |
89 | ||
90 | extern void ospf6_asbr_init(void); | |
91 | extern void ospf6_asbr_redistribute_reset(void); | |
92 | extern void ospf6_asbr_terminate(void); | |
93 | extern void ospf6_asbr_send_externals_to_area(struct ospf6_area *); | |
94 | ||
95 | extern int config_write_ospf6_debug_asbr(struct vty *vty); | |
96 | extern void install_element_ospf6_debug_asbr(void); | |
064d4355 CS |
97 | extern void ospf6_asbr_update_route_ecmp_path(struct ospf6_route *old, |
98 | struct ospf6_route *route); | |
856ae1eb | 99 | extern void ospf6_asbr_distribute_list_update(int type); |
508e53e2 | 100 | |
718e3744 | 101 | #endif /* OSPF6_ASBR_H */ |