paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
paul | 6cbbc3c | 2003-04-28 17:11:02 +0000 | [diff] [blame] | 76 | #define OSPF6_DAEMON_VERSION "0.9.6p" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 77 | |
| 78 | #define AF_LINKSTATE 0xff |
| 79 | |
| 80 | /* global variables */ |
| 81 | extern char *progname; |
| 82 | extern int errno; |
| 83 | extern int daemon_mode; |
| 84 | extern struct thread_master *master; |
| 85 | extern list iflist; |
| 86 | extern list nexthoplist; |
| 87 | extern struct sockaddr_in6 allspfrouters6; |
| 88 | extern struct sockaddr_in6 alldrouters6; |
| 89 | extern int ospf6_sock; |
| 90 | extern 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 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 97 | |
| 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 */ |
| 147 | void |
| 148 | ospf6_timeval_sub (const struct timeval *t1, const struct timeval *t2, |
| 149 | struct timeval *result); |
| 150 | void |
| 151 | ospf6_timeval_div (const struct timeval *t1, u_int by, |
| 152 | struct timeval *result); |
| 153 | void |
| 154 | ospf6_timeval_sub_equal (const struct timeval *t, struct timeval *result); |
| 155 | void |
| 156 | ospf6_timeval_decode (const struct timeval *t, long *dayp, long *hourp, |
| 157 | long *minp, long *secp, long *msecp, long *usecp); |
| 158 | void |
| 159 | ospf6_timeval_string (struct timeval *tv, char *buf, int size); |
| 160 | void |
| 161 | ospf6_timeval_string_summary (struct timeval *tv, char *buf, int size); |
| 162 | |
| 163 | void |
| 164 | ospf6_count_state (void *arg, int val, void *obj); |
| 165 | |
| 166 | void ospf6_init (); |
| 167 | void ospf6_terminate (); |
| 168 | |
| 169 | void ospf6_maxage_remover (); |
| 170 | |
| 171 | void *ospf6_lsa_get_scope (u_int16_t type, struct ospf6_interface *o6i); |
| 172 | |
| 173 | #endif /* OSPF6D_H */ |
| 174 | |