X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ospf6d%2Fospf6_asbr.h;h=9890ef06194a08232d8cfc4566f7b60180e0fe6a;hb=91d227b7e3cb53ad8fdbcd9d4cff7f0a666918e3;hp=cd1c939ace84fd63e0dc531a89853aff9e3395de;hpb=abc7ef44ca05493500865ce81f7b84f5c4eb6594;p=mirror_frr.git diff --git a/ospf6d/ospf6_asbr.h b/ospf6d/ospf6_asbr.h index cd1c939ac..9890ef061 100644 --- a/ospf6d/ospf6_asbr.h +++ b/ospf6d/ospf6_asbr.h @@ -13,46 +13,50 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with GNU Zebra; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef OSPF6_ASBR_H #define OSPF6_ASBR_H +/* for struct ospf6_prefix */ +#include "ospf6_proto.h" +/* for struct ospf6_lsa */ +#include "ospf6_lsa.h" +/* for struct ospf6_route */ +#include "ospf6_route.h" + /* Debug option */ extern unsigned char conf_debug_ospf6_asbr; -#define OSPF6_DEBUG_ASBR_ON() \ - (conf_debug_ospf6_asbr = 1) -#define OSPF6_DEBUG_ASBR_OFF() \ - (conf_debug_ospf6_asbr = 0) -#define IS_OSPF6_DEBUG_ASBR \ - (conf_debug_ospf6_asbr) - -struct ospf6_external_info -{ - /* External route type */ - int type; - - /* Originating Link State ID */ - u_int32_t id; - - struct in6_addr forwarding; - /* u_int32_t tag; */ +#define OSPF6_DEBUG_ASBR_ON() (conf_debug_ospf6_asbr = 1) +#define OSPF6_DEBUG_ASBR_OFF() (conf_debug_ospf6_asbr = 0) +#define IS_OSPF6_DEBUG_ASBR (conf_debug_ospf6_asbr) + +struct ospf6_external_info { + /* External route type */ + int type; + + /* Originating Link State ID */ + uint32_t id; + + struct in6_addr forwarding; + + route_tag_t tag; + + ifindex_t ifindex; }; /* AS-External-LSA */ #define OSPF6_AS_EXTERNAL_LSA_MIN_SIZE 4U /* w/o IPv6 prefix */ -struct ospf6_as_external_lsa -{ - u_int32_t bits_metric; - - struct ospf6_prefix prefix; - /* followed by none or one forwarding address */ - /* followed by none or one external route tag */ - /* followed by none or one referenced LS-ID */ +struct ospf6_as_external_lsa { + uint32_t bits_metric; + + struct ospf6_prefix prefix; + /* followed by none or one forwarding address */ + /* followed by none or one external route tag */ + /* followed by none or one referenced LS-ID */ }; #define OSPF6_ASBR_BIT_T ntohl (0x01000000) @@ -60,29 +64,38 @@ struct ospf6_as_external_lsa #define OSPF6_ASBR_BIT_E ntohl (0x04000000) #define OSPF6_ASBR_METRIC(E) (ntohl ((E)->bits_metric & htonl (0x00ffffff))) -#define OSPF6_ASBR_METRIC_SET(E,C) \ - { (E)->bits_metric &= htonl (0xff000000); \ - (E)->bits_metric |= htonl (0x00ffffff) & htonl (C); } - -extern void ospf6_asbr_lsa_add (struct ospf6_lsa *lsa); -extern void ospf6_asbr_lsa_remove (struct ospf6_lsa *lsa); -extern void ospf6_asbr_lsentry_add (struct ospf6_route *asbr_entry); -extern void ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry); - -extern int ospf6_asbr_is_asbr (struct ospf6 *o); -extern void ospf6_asbr_redistribute_add (int type, int ifindex, - struct prefix *prefix, - u_int nexthop_num, - struct in6_addr *nexthop); -extern void ospf6_asbr_redistribute_remove (int type, int ifindex, - struct prefix *prefix); - -extern int ospf6_redistribute_config_write (struct vty *vty); - -extern void ospf6_asbr_init (void); -extern void ospf6_asbr_terminate (void); - -extern int config_write_ospf6_debug_asbr (struct vty *vty); -extern void install_element_ospf6_debug_asbr (void); +#define OSPF6_ASBR_METRIC_SET(E, C) \ + { \ + (E)->bits_metric &= htonl(0xff000000); \ + (E)->bits_metric |= htonl(0x00ffffff) & htonl(C); \ + } + +extern void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa); +extern void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa, + struct ospf6_route *asbr_entry); +extern void ospf6_asbr_lsentry_add(struct ospf6_route *asbr_entry); +extern void ospf6_asbr_lsentry_remove(struct ospf6_route *asbr_entry); + +extern int ospf6_asbr_is_asbr(struct ospf6 *o); +extern void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex, + struct prefix *prefix, + unsigned int nexthop_num, + struct in6_addr *nexthop, + route_tag_t tag); +extern void ospf6_asbr_redistribute_remove(int type, ifindex_t ifindex, + struct prefix *prefix); + +extern int ospf6_redistribute_config_write(struct vty *vty); + +extern void ospf6_asbr_init(void); +extern void ospf6_asbr_redistribute_reset(void); +extern void ospf6_asbr_terminate(void); +extern void ospf6_asbr_send_externals_to_area(struct ospf6_area *); + +extern int config_write_ospf6_debug_asbr(struct vty *vty); +extern void install_element_ospf6_debug_asbr(void); +extern void ospf6_asbr_update_route_ecmp_path(struct ospf6_route *old, + struct ospf6_route *route); +extern void ospf6_asbr_distribute_list_update(int type); #endif /* OSPF6_ASBR_H */