From 508e53e2eef3eefba4c1aa771529027fd4486ea8 Mon Sep 17 00:00:00 2001 From: hasso Date: Tue, 18 May 2004 18:57:06 +0000 Subject: Ospf6d merge from Zebra repository with added privs stuff and merged zclient changes. --- ospf6d/ospf6d.h | 164 ++++++++++++++++++-------------------------------------- 1 file changed, 53 insertions(+), 111 deletions(-) (limited to 'ospf6d/ospf6d.h') diff --git a/ospf6d/ospf6d.h b/ospf6d/ospf6d.h index e867b1c1..c08007f0 100644 --- a/ospf6d/ospf6d.h +++ b/ospf6d/ospf6d.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999 Yasuhiro Ohara + * Copyright (C) 2003 Yasuhiro Ohara * * This file is part of GNU Zebra. * @@ -22,78 +22,11 @@ #ifndef OSPF6D_H #define OSPF6D_H -#include -#include "linklist.h" - -#ifndef HEADER_DEPENDENCY -/* Include other stuffs */ -#include -#include "log.h" -#include "getopt.h" -#include "thread.h" -#include "command.h" -#include "memory.h" -#include "sockunion.h" -#include "if.h" -#include "prefix.h" -#include "stream.h" -#include "thread.h" -#include "filter.h" -#include "zclient.h" -#include "table.h" -#include "plist.h" - -/* OSPF stuffs */ -#include "ospf6_hook.h" -#include "ospf6_types.h" -#include "ospf6_prefix.h" -#include "ospf6_lsa.h" -#include "ospf6_lsdb.h" - -#include "ospf6_message.h" -#include "ospf6_proto.h" -#include "ospf6_spf.h" -#include "ospf6_top.h" -#include "ospf6_area.h" -#include "ospf6_interface.h" -#include "ospf6_neighbor.h" -#include "ospf6_ism.h" -#include "ospf6_nsm.h" -#include "ospf6_route.h" -#include "ospf6_dbex.h" -#include "ospf6_network.h" -#include "ospf6_zebra.h" -#include "ospf6_dump.h" -#include "ospf6_routemap.h" -#include "ospf6_asbr.h" -#include "ospf6_abr.h" -#include "ospf6_intra.h" -#endif /*HEADER_DEPENDENCY*/ - -#define HASHVAL 64 -#define MAXIOVLIST 1024 - -#define OSPF6_DAEMON_VERSION "0.9.6p" - -#define AF_LINKSTATE 0xff +#define OSPF6_DAEMON_VERSION "0.9.7a" /* global variables */ -extern char *progname; extern int errno; -extern int daemon_mode; extern struct thread_master *master; -extern list iflist; -extern list nexthoplist; -extern struct sockaddr_in6 allspfrouters6; -extern struct sockaddr_in6 alldrouters6; -extern int ospf6_sock; -extern char *recent_reason; - -/* Default configuration file name for ospfd. */ -#define OSPF6_DEFAULT_CONFIG "ospf6d.conf" - -/* Default port values. */ -#define OSPF6_VTY_PORT 2606 #ifdef INRIA_IPV6 #ifndef IPV6_PKTINFO @@ -101,7 +34,7 @@ extern char *recent_reason; #endif /* IPV6_PKTINFO */ #endif /* INRIA_IPV6 */ -/* Historycal for KAME. */ +/* Historical for KAME. */ #ifndef IPV6_JOIN_GROUP #ifdef IPV6_ADD_MEMBERSHIP #define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP @@ -117,6 +50,53 @@ extern char *recent_reason; #endif /* IPV6_DROP_MEMBERSHIP */ #endif /* ! IPV6_LEAVE_GROUP */ +/* operation on timeval structure */ +#ifndef timerclear +#define timerclear(a) (a)->tv_sec = (tvp)->tv_usec = 0 +#endif /*timerclear*/ +#ifndef timersub +#define timersub(a, b, res) \ + do { \ + (res)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (res)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((res)->tv_usec < 0) \ + { \ + (res)->tv_sec--; \ + (res)->tv_usec += 1000000; \ + } \ + } while (0) +#endif /*timersub*/ +#define timerstring(tv, buf, size) \ + do { \ + if ((tv)->tv_sec / 60 / 60 / 24) \ + snprintf (buf, size, "%ldd%02ld:%02ld:%02ld", \ + (tv)->tv_sec / 60 / 60 / 24, \ + (tv)->tv_sec / 60 / 60 % 24, \ + (tv)->tv_sec / 60 % 60, \ + (tv)->tv_sec % 60); \ + else \ + snprintf (buf, size, "%02ld:%02ld:%02ld", \ + (tv)->tv_sec / 60 / 60 % 24, \ + (tv)->tv_sec / 60 % 60, \ + (tv)->tv_sec % 60); \ + } while (0) +#define timerstring_local(tv, buf, size) \ + do { \ + int ret; \ + struct tm *tm; \ + tm = localtime (&(tv)->tv_sec); \ + ret = strftime (buf, size, "%Y/%m/%d %H:%M:%S", tm); \ + if (ret == 0) \ + zlog_warn ("strftime error"); \ + } while (0) + +/* for commands */ +#define OSPF6_AREA_STR "Area information\n" +#define OSPF6_AREA_ID_STR "Area ID (as an IPv4 notation)\n" +#define OSPF6_SPF_STR "Shortest Path First tree information\n" +#define OSPF6_ROUTER_ID_STR "Specify Router-ID\n" +#define OSPF6_LS_ID_STR "Specify Link State ID\n" + #define OSPF6_CMD_CHECK_RUNNING() \ if (ospf6 == NULL) \ { \ @@ -124,51 +104,13 @@ extern char *recent_reason; return CMD_SUCCESS; \ } -#define OSPF6_LEVEL_NONE 0 -#define OSPF6_LEVEL_NEIGHBOR 1 -#define OSPF6_LEVEL_INTERFACE 2 -#define OSPF6_LEVEL_AREA 3 -#define OSPF6_LEVEL_TOP 4 -#define OSPF6_LEVEL_MAX 5 - -#define OSPF6_PASSIVE_STR \ - "Suppress routing updates on an interface\n" -#define OSPF6_PREFIX_LIST_STR \ - "Advertise I/F Address only match entries of prefix-list\n" - -#define OSPF6_AREA_STR "Area information\n" -#define OSPF6_AREA_ID_STR "Area ID (as an IPv4 notation)\n" -#define OSPF6_SPF_STR "Shortest Path First tree information\n" -#define OSPF6_ROUTER_ID_STR "Specify Router-ID\n" -#define OSPF6_LS_ID_STR "Specify Link State ID\n" - /* Function Prototypes */ -void -ospf6_timeval_sub (const struct timeval *t1, const struct timeval *t2, - struct timeval *result); -void -ospf6_timeval_div (const struct timeval *t1, u_int by, - struct timeval *result); -void -ospf6_timeval_sub_equal (const struct timeval *t, struct timeval *result); -void -ospf6_timeval_decode (const struct timeval *t, long *dayp, long *hourp, - long *minp, long *secp, long *msecp, long *usecp); -void -ospf6_timeval_string (struct timeval *tv, char *buf, int size); -void -ospf6_timeval_string_summary (struct timeval *tv, char *buf, int size); - -void -ospf6_count_state (void *arg, int val, void *obj); +struct route_node *route_prev (struct route_node *node); +void ospf6_debug (); void ospf6_init (); -void ospf6_terminate (); - -void ospf6_maxage_remover (); - -void *ospf6_lsa_get_scope (u_int16_t type, struct ospf6_interface *o6i); #endif /* OSPF6D_H */ + -- cgit v1.2.1