]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6d.h
Update for git and emphasize asking for good reports.
[mirror_frr.git] / ospf6d / ospf6d.h
index 4c9f7dc3e8b4a4d6f9850ec50a7e3fa6b8166cd7..b6f1b7378dac56dbeb36aac600a5177673ce52ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1999 Yasuhiro Ohara
+ * Copyright (C) 2003 Yasuhiro Ohara
  *
  * This file is part of GNU Zebra.
  *
 #ifndef OSPF6D_H
 #define OSPF6D_H
 
-#include <zebra.h>
-#include "linklist.h"
-
-#ifndef HEADER_DEPENDENCY
-/* Include other stuffs */
-#include "version.h"
-#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.6o"
-
-#define AF_LINKSTATE  0xff
+#define OSPF6_DAEMON_VERSION    "0.9.7r"
 
 /* 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 +33,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 +49,60 @@ extern char *recent_reason;
 #endif /* IPV6_DROP_MEMBERSHIP */
 #endif /* ! IPV6_LEAVE_GROUP */
 
+/* cast macro: XXX - these *must* die, ick ick. */
+#define OSPF6_PROCESS(x) ((struct ospf6 *) (x))
+#define OSPF6_AREA(x) ((struct ospf6_area *) (x))
+#define OSPF6_INTERFACE(x) ((struct ospf6_interface *) (x))
+#define OSPF6_NEIGHBOR(x) ((struct ospf6_neighbor *) (x))
+
+/* 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 VNL VTY_NEWLINE
 #define OSPF6_CMD_CHECK_RUNNING() \
   if (ospf6 == NULL) \
     { \
@@ -124,51 +110,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"
-
 \f
 /* 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);
+extern struct route_node *route_prev (struct route_node *node);
 
-void ospf6_init ();
-void ospf6_terminate ();
-
-void ospf6_maxage_remover ();
-
-void *ospf6_lsa_get_scope (u_int16_t type, struct ospf6_interface *o6i);
+extern void ospf6_debug (void);
+extern void ospf6_init (void);
 
 #endif /* OSPF6D_H */
 
+