blob: e0d310a98061b88bd96282a4749b7c74c2e78a48 [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
97#define OSPF6_VTYSH_PATH "/tmp/.ospf6d"
98
99#ifdef INRIA_IPV6
100#ifndef IPV6_PKTINFO
101#define IPV6_PKTINFO IPV6_RECVPKTINFO
102#endif /* IPV6_PKTINFO */
103#endif /* INRIA_IPV6 */
104
105/* Historycal for KAME. */
106#ifndef IPV6_JOIN_GROUP
107#ifdef IPV6_ADD_MEMBERSHIP
108#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
109#endif /* IPV6_ADD_MEMBERSHIP. */
110#ifdef IPV6_JOIN_MEMBERSHIP
111#define IPV6_JOIN_GROUP IPV6_JOIN_MEMBERSHIP
112#endif /* IPV6_JOIN_MEMBERSHIP. */
113#endif /* ! IPV6_JOIN_GROUP*/
114
115#ifndef IPV6_LEAVE_GROUP
116#ifdef IPV6_DROP_MEMBERSHIP
117#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
118#endif /* IPV6_DROP_MEMBERSHIP */
119#endif /* ! IPV6_LEAVE_GROUP */
120
121#define OSPF6_CMD_CHECK_RUNNING() \
122 if (ospf6 == NULL) \
123 { \
124 vty_out (vty, "OSPFv3 is not running%s", VTY_NEWLINE); \
125 return CMD_SUCCESS; \
126 }
127
128#define OSPF6_LEVEL_NONE 0
129#define OSPF6_LEVEL_NEIGHBOR 1
130#define OSPF6_LEVEL_INTERFACE 2
131#define OSPF6_LEVEL_AREA 3
132#define OSPF6_LEVEL_TOP 4
133#define OSPF6_LEVEL_MAX 5
134
135#define OSPF6_PASSIVE_STR \
136 "Suppress routing updates on an interface\n"
137#define OSPF6_PREFIX_LIST_STR \
138 "Advertise I/F Address only match entries of prefix-list\n"
139
140#define OSPF6_AREA_STR "Area information\n"
141#define OSPF6_AREA_ID_STR "Area ID (as an IPv4 notation)\n"
142#define OSPF6_SPF_STR "Shortest Path First tree information\n"
143#define OSPF6_ROUTER_ID_STR "Specify Router-ID\n"
144#define OSPF6_LS_ID_STR "Specify Link State ID\n"
145
146
147/* Function Prototypes */
148void
149ospf6_timeval_sub (const struct timeval *t1, const struct timeval *t2,
150 struct timeval *result);
151void
152ospf6_timeval_div (const struct timeval *t1, u_int by,
153 struct timeval *result);
154void
155ospf6_timeval_sub_equal (const struct timeval *t, struct timeval *result);
156void
157ospf6_timeval_decode (const struct timeval *t, long *dayp, long *hourp,
158 long *minp, long *secp, long *msecp, long *usecp);
159void
160ospf6_timeval_string (struct timeval *tv, char *buf, int size);
161void
162ospf6_timeval_string_summary (struct timeval *tv, char *buf, int size);
163
164void
165ospf6_count_state (void *arg, int val, void *obj);
166
167void ospf6_init ();
168void ospf6_terminate ();
169
170void ospf6_maxage_remover ();
171
172void *ospf6_lsa_get_scope (u_int16_t type, struct ospf6_interface *o6i);
173
174#endif /* OSPF6D_H */
175