]> git.proxmox.com Git - mirror_frr.git/blame - ospf6d/ospf6_asbr.h
debian: add pkg-config to build-depends
[mirror_frr.git] / ospf6d / ospf6_asbr.h
CommitLineData
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 *
16 * You should have received a copy of the GNU General Public License
ac4d0be5 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.
718e3744 20 */
21
22#ifndef OSPF6_ASBR_H
23#define OSPF6_ASBR_H
24
87362ceb
DO
25/* for struct ospf6_prefix */
26#include "ospf6_proto.h"
27/* for struct ospf6_lsa */
28#include "ospf6_lsa.h"
29/* for struct ospf6_route */
30#include "ospf6_route.h"
31
508e53e2 32/* Debug option */
33extern unsigned char conf_debug_ospf6_asbr;
ac4d0be5 34#define OSPF6_DEBUG_ASBR_ON() (conf_debug_ospf6_asbr = 1)
35#define OSPF6_DEBUG_ASBR_OFF() (conf_debug_ospf6_asbr = 0)
36#define IS_OSPF6_DEBUG_ASBR (conf_debug_ospf6_asbr)
718e3744 37
ac4d0be5 38struct ospf6_external_info {
39 /* External route type */
40 int type;
718e3744 41
ac4d0be5 42 /* Originating Link State ID */
43 u_int32_t id;
718e3744 44
ac4d0be5 45 struct in6_addr forwarding;
464015fa 46
ac4d0be5 47 route_tag_t tag;
42a7debf 48
ac4d0be5 49 ifindex_t ifindex;
718e3744 50};
51
718e3744 52/* AS-External-LSA */
abc7ef44 53#define OSPF6_AS_EXTERNAL_LSA_MIN_SIZE 4U /* w/o IPv6 prefix */
ac4d0be5 54struct ospf6_as_external_lsa {
55 u_int32_t bits_metric;
56
57 struct ospf6_prefix prefix;
58 /* followed by none or one forwarding address */
59 /* followed by none or one external route tag */
60 /* followed by none or one referenced LS-ID */
718e3744 61};
62
63#define OSPF6_ASBR_BIT_T ntohl (0x01000000)
64#define OSPF6_ASBR_BIT_F ntohl (0x02000000)
65#define OSPF6_ASBR_BIT_E ntohl (0x04000000)
66
67#define OSPF6_ASBR_METRIC(E) (ntohl ((E)->bits_metric & htonl (0x00ffffff)))
ac4d0be5 68#define OSPF6_ASBR_METRIC_SET(E, C) \
69 { \
70 (E)->bits_metric &= htonl(0xff000000); \
71 (E)->bits_metric |= htonl(0x00ffffff) & htonl(C); \
72 }
73
74extern void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa);
75extern void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa);
76extern void ospf6_asbr_lsentry_add(struct ospf6_route *asbr_entry);
77extern void ospf6_asbr_lsentry_remove(struct ospf6_route *asbr_entry);
78
79extern int ospf6_asbr_is_asbr(struct ospf6 *o);
80extern void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
81 struct prefix *prefix,
82 u_int nexthop_num,
83 struct in6_addr *nexthop,
84 route_tag_t tag);
85extern void ospf6_asbr_redistribute_remove(int type, ifindex_t ifindex,
86 struct prefix *prefix);
87
88extern int ospf6_redistribute_config_write(struct vty *vty);
89
90extern void ospf6_asbr_init(void);
91extern void ospf6_asbr_redistribute_reset(void);
92extern void ospf6_asbr_terminate(void);
93extern void ospf6_asbr_send_externals_to_area(struct ospf6_area *);
94
95extern int config_write_ospf6_debug_asbr(struct vty *vty);
96extern void install_element_ospf6_debug_asbr(void);
508e53e2 97
718e3744 98#endif /* OSPF6_ASBR_H */