]> git.proxmox.com Git - mirror_frr.git/blame - ospf6d/ospf6d.h
Merge pull request #488 from donaldsharp/sudoers3
[mirror_frr.git] / ospf6d / ospf6d.h
CommitLineData
718e3744 1/*
508e53e2 2 * Copyright (C) 2003 Yasuhiro Ohara
718e3744 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
0b26f81b 25#define OSPF6_DAEMON_VERSION "0.9.7r"
718e3744 26
8551e6da
DD
27#include "libospf.h"
28#include "thread.h"
29
4a1ab8e4
DL
30#include "ospf6_memory.h"
31
718e3744 32/* global variables */
718e3744 33extern struct thread_master *master;
718e3744 34
508e53e2 35/* Historical for KAME. */
718e3744 36#ifndef IPV6_JOIN_GROUP
37#ifdef IPV6_ADD_MEMBERSHIP
38#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
39#endif /* IPV6_ADD_MEMBERSHIP. */
40#ifdef IPV6_JOIN_MEMBERSHIP
41#define IPV6_JOIN_GROUP IPV6_JOIN_MEMBERSHIP
42#endif /* IPV6_JOIN_MEMBERSHIP. */
43#endif /* ! IPV6_JOIN_GROUP*/
44
45#ifndef IPV6_LEAVE_GROUP
46#ifdef IPV6_DROP_MEMBERSHIP
47#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
48#endif /* IPV6_DROP_MEMBERSHIP */
49#endif /* ! IPV6_LEAVE_GROUP */
50
ef95122e
DO
51#define MSG_OK 0
52#define MSG_NG 1
53
1eb8ef25 54/* cast macro: XXX - these *must* die, ick ick. */
6452df09 55#define OSPF6_PROCESS(x) ((struct ospf6 *) (x))
56#define OSPF6_AREA(x) ((struct ospf6_area *) (x))
57#define OSPF6_INTERFACE(x) ((struct ospf6_interface *) (x))
58#define OSPF6_NEIGHBOR(x) ((struct ospf6_neighbor *) (x))
59
508e53e2 60/* operation on timeval structure */
8f2c16aa
DL
61#define timerstring(tv, buf, size) \
62 do { \
63 if ((tv)->tv_sec / 60 / 60 / 24) \
64 snprintf (buf, size, "%lldd%02lld:%02lld:%02lld", \
65 (tv)->tv_sec / 60LL / 60 / 24, \
66 (tv)->tv_sec / 60LL / 60 % 24, \
67 (tv)->tv_sec / 60LL % 60, \
68 (tv)->tv_sec % 60LL); \
69 else \
70 snprintf (buf, size, "%02lld:%02lld:%02lld", \
71 (tv)->tv_sec / 60LL / 60 % 24, \
72 (tv)->tv_sec / 60LL % 60, \
73 (tv)->tv_sec % 60LL); \
508e53e2 74 } while (0)
508e53e2 75
a0edf674
DD
76#define threadtimer_string(now, t, buf, size) \
77 do { \
78 struct timeval result; \
79 if (!t) \
80 snprintf(buf, size, "inactive"); \
81 else { \
82 timersub(&t->u.sands, &now, &result); \
83 timerstring(&result, buf, size); \
84 } \
85} while (0)
86
508e53e2 87/* for commands */
88#define OSPF6_AREA_STR "Area information\n"
89#define OSPF6_AREA_ID_STR "Area ID (as an IPv4 notation)\n"
90#define OSPF6_SPF_STR "Shortest Path First tree information\n"
91#define OSPF6_ROUTER_ID_STR "Specify Router-ID\n"
92#define OSPF6_LS_ID_STR "Specify Link State ID\n"
93
049207c3 94#define VNL VTY_NEWLINE
718e3744 95#define OSPF6_CMD_CHECK_RUNNING() \
96 if (ospf6 == NULL) \
97 { \
98 vty_out (vty, "OSPFv3 is not running%s", VTY_NEWLINE); \
99 return CMD_SUCCESS; \
100 }
101
6b0655a2 102
718e3744 103/* Function Prototypes */
6ac29a51 104extern struct route_node *route_prev (struct route_node *node);
718e3744 105
6ac29a51
PJ
106extern void ospf6_debug (void);
107extern void ospf6_init (void);
718e3744 108
109#endif /* OSPF6D_H */
110
508e53e2 111