blob: 4c9f7dc3e8b4a4d6f9850ec50a7e3fa6b8166cd7 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
2 * Copyright (C) 1999 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 OSPF6D_H
23#define OSPF6D_H
24
25#include <zebra.h>
26#include "linklist.h"
27
28#ifndef HEADER_DEPENDENCY
29/* Include other stuffs */
30#include "version.h"
31#include "log.h"
32#include "getopt.h"
33#include "thread.h"
34#include "command.h"
35#include "memory.h"
36#include "sockunion.h"
37#include "if.h"
38#include "prefix.h"
39#include "stream.h"
40#include "thread.h"
41#include "filter.h"
42#include "zclient.h"
43#include "table.h"
44#include "plist.h"
45
46/* OSPF stuffs */
47#include "ospf6_hook.h"
48#include "ospf6_types.h"
49#include "ospf6_prefix.h"
50#include "ospf6_lsa.h"
51#include "ospf6_lsdb.h"
52
53#include "ospf6_message.h"
54#include "ospf6_proto.h"
55#include "ospf6_spf.h"
56#include "ospf6_top.h"
57#include "ospf6_area.h"
58#include "ospf6_interface.h"
59#include "ospf6_neighbor.h"
60#include "ospf6_ism.h"
61#include "ospf6_nsm.h"
62#include "ospf6_route.h"
63#include "ospf6_dbex.h"
64#include "ospf6_network.h"
65#include "ospf6_zebra.h"
66#include "ospf6_dump.h"
67#include "ospf6_routemap.h"
68#include "ospf6_asbr.h"
69#include "ospf6_abr.h"
70#include "ospf6_intra.h"
71#endif /*HEADER_DEPENDENCY*/
72
73#define HASHVAL 64
74#define MAXIOVLIST 1024
75
76#define OSPF6_DAEMON_VERSION "0.9.6o"
77
78#define AF_LINKSTATE 0xff
79
80/* global variables */
81extern char *progname;
82extern int errno;
83extern int daemon_mode;
84extern struct thread_master *master;
85extern list iflist;
86extern list nexthoplist;
87extern struct sockaddr_in6 allspfrouters6;
88extern struct sockaddr_in6 alldrouters6;
89extern int ospf6_sock;
90extern char *recent_reason;
91
92/* Default configuration file name for ospfd. */
93#define OSPF6_DEFAULT_CONFIG "ospf6d.conf"
94
95/* Default port values. */
96#define OSPF6_VTY_PORT 2606
paul718e3742002-12-13 20:15:29 +000097
98#ifdef INRIA_IPV6
99#ifndef IPV6_PKTINFO
100#define IPV6_PKTINFO IPV6_RECVPKTINFO
101#endif /* IPV6_PKTINFO */
102#endif /* INRIA_IPV6 */
103
104/* Historycal for KAME. */
105#ifndef IPV6_JOIN_GROUP
106#ifdef IPV6_ADD_MEMBERSHIP
107#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
108#endif /* IPV6_ADD_MEMBERSHIP. */
109#ifdef IPV6_JOIN_MEMBERSHIP
110#define IPV6_JOIN_GROUP IPV6_JOIN_MEMBERSHIP
111#endif /* IPV6_JOIN_MEMBERSHIP. */
112#endif /* ! IPV6_JOIN_GROUP*/
113
114#ifndef IPV6_LEAVE_GROUP
115#ifdef IPV6_DROP_MEMBERSHIP
116#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
117#endif /* IPV6_DROP_MEMBERSHIP */
118#endif /* ! IPV6_LEAVE_GROUP */
119
120#define OSPF6_CMD_CHECK_RUNNING() \
121 if (ospf6 == NULL) \
122 { \
123 vty_out (vty, "OSPFv3 is not running%s", VTY_NEWLINE); \
124 return CMD_SUCCESS; \
125 }
126
127#define OSPF6_LEVEL_NONE 0
128#define OSPF6_LEVEL_NEIGHBOR 1
129#define OSPF6_LEVEL_INTERFACE 2
130#define OSPF6_LEVEL_AREA 3
131#define OSPF6_LEVEL_TOP 4
132#define OSPF6_LEVEL_MAX 5
133
134#define OSPF6_PASSIVE_STR \
135 "Suppress routing updates on an interface\n"
136#define OSPF6_PREFIX_LIST_STR \
137 "Advertise I/F Address only match entries of prefix-list\n"
138
139#define OSPF6_AREA_STR "Area information\n"
140#define OSPF6_AREA_ID_STR "Area ID (as an IPv4 notation)\n"
141#define OSPF6_SPF_STR "Shortest Path First tree information\n"
142#define OSPF6_ROUTER_ID_STR "Specify Router-ID\n"
143#define OSPF6_LS_ID_STR "Specify Link State ID\n"
144
145
146/* Function Prototypes */
147void
148ospf6_timeval_sub (const struct timeval *t1, const struct timeval *t2,
149 struct timeval *result);
150void
151ospf6_timeval_div (const struct timeval *t1, u_int by,
152 struct timeval *result);
153void
154ospf6_timeval_sub_equal (const struct timeval *t, struct timeval *result);
155void
156ospf6_timeval_decode (const struct timeval *t, long *dayp, long *hourp,
157 long *minp, long *secp, long *msecp, long *usecp);
158void
159ospf6_timeval_string (struct timeval *tv, char *buf, int size);
160void
161ospf6_timeval_string_summary (struct timeval *tv, char *buf, int size);
162
163void
164ospf6_count_state (void *arg, int val, void *obj);
165
166void ospf6_init ();
167void ospf6_terminate ();
168
169void ospf6_maxage_remover ();
170
171void *ospf6_lsa_get_scope (u_int16_t type, struct ospf6_interface *o6i);
172
173#endif /* OSPF6D_H */
174