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
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/* AS-External-LSA */
26struct ospf6_lsa_as_external
27{
28  u_int32_t bits_metric;
29
30  struct ospf6_prefix prefix;
31  /* followed by none or one forwarding address */
32  /* followed by none or one external route tag */
33  /* followed by none or one referenced LS-ID */
34};
35
36#define OSPF6_ASBR_BIT_T  ntohl (0x01000000)
37#define OSPF6_ASBR_BIT_F  ntohl (0x02000000)
38#define OSPF6_ASBR_BIT_E  ntohl (0x04000000)
39
40#define OSPF6_ASBR_METRIC(E) (ntohl ((E)->bits_metric & htonl (0x00ffffff)))
41#define OSPF6_ASBR_METRIC_SET(E,C) \
42  { (E)->bits_metric &= htonl (0xff000000); \
43    (E)->bits_metric |= htonl (0x00ffffff) & htonl (C); }
44
45void ospf6_asbr_external_route_add (struct ospf6_route_req *route);
46void ospf6_asbr_external_route_remove (struct ospf6_route_req *route);
47
48void ospf6_asbr_external_lsa_add (struct ospf6_lsa *lsa);
49void ospf6_asbr_external_lsa_remove (struct ospf6_lsa *lsa);
50void ospf6_asbr_external_lsa_change (struct ospf6_lsa *old,
51                                     struct ospf6_lsa *new);
52
53void ospf6_asbr_asbr_entry_add (struct ospf6_route_req *topo_entry);
54void ospf6_asbr_asbr_entry_remove (struct ospf6_route_req *topo_entry);
55
56void ospf6_asbr_init ();
57
58#endif /* OSPF6_ASBR_H */
59
60