]>
Commit | Line | Data |
---|---|---|
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 | * | |
896014f4 DL |
16 | * You should have received a copy of the GNU General Public License along |
17 | * with this program; see the file COPYING; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
718e3744 | 19 | */ |
20 | ||
21 | #ifndef OSPF6D_H | |
22 | #define OSPF6D_H | |
23 | ||
8551e6da DD |
24 | #include "libospf.h" |
25 | #include "thread.h" | |
26 | ||
4a1ab8e4 DL |
27 | #include "ospf6_memory.h" |
28 | ||
718e3744 | 29 | /* global variables */ |
718e3744 | 30 | extern struct thread_master *master; |
718e3744 | 31 | |
508e53e2 | 32 | /* Historical for KAME. */ |
718e3744 | 33 | #ifndef IPV6_JOIN_GROUP |
34 | #ifdef IPV6_ADD_MEMBERSHIP | |
35 | #define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP | |
36 | #endif /* IPV6_ADD_MEMBERSHIP. */ | |
37 | #ifdef IPV6_JOIN_MEMBERSHIP | |
38 | #define IPV6_JOIN_GROUP IPV6_JOIN_MEMBERSHIP | |
39 | #endif /* IPV6_JOIN_MEMBERSHIP. */ | |
40 | #endif /* ! IPV6_JOIN_GROUP*/ | |
41 | ||
42 | #ifndef IPV6_LEAVE_GROUP | |
43 | #ifdef IPV6_DROP_MEMBERSHIP | |
44 | #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP | |
45 | #endif /* IPV6_DROP_MEMBERSHIP */ | |
46 | #endif /* ! IPV6_LEAVE_GROUP */ | |
47 | ||
ef95122e DO |
48 | #define MSG_OK 0 |
49 | #define MSG_NG 1 | |
50 | ||
1eb8ef25 | 51 | /* cast macro: XXX - these *must* die, ick ick. */ |
6452df09 | 52 | #define OSPF6_PROCESS(x) ((struct ospf6 *) (x)) |
53 | #define OSPF6_AREA(x) ((struct ospf6_area *) (x)) | |
54 | #define OSPF6_INTERFACE(x) ((struct ospf6_interface *) (x)) | |
55 | #define OSPF6_NEIGHBOR(x) ((struct ospf6_neighbor *) (x)) | |
56 | ||
508e53e2 | 57 | /* operation on timeval structure */ |
d62a17ae | 58 | #define timerstring(tv, buf, size) \ |
59 | do { \ | |
60 | if ((tv)->tv_sec / 60 / 60 / 24) \ | |
61 | snprintf(buf, size, "%lldd%02lld:%02lld:%02lld", \ | |
62 | (tv)->tv_sec / 60LL / 60 / 24, \ | |
63 | (tv)->tv_sec / 60LL / 60 % 24, \ | |
64 | (tv)->tv_sec / 60LL % 60, \ | |
65 | (tv)->tv_sec % 60LL); \ | |
66 | else \ | |
67 | snprintf(buf, size, "%02lld:%02lld:%02lld", \ | |
68 | (tv)->tv_sec / 60LL / 60 % 24, \ | |
69 | (tv)->tv_sec / 60LL % 60, \ | |
70 | (tv)->tv_sec % 60LL); \ | |
71 | } while (0) | |
72 | ||
73 | #define threadtimer_string(now, t, buf, size) \ | |
74 | do { \ | |
7fe96307 | 75 | struct timeval _result; \ |
d62a17ae | 76 | if (!t) \ |
77 | snprintf(buf, size, "inactive"); \ | |
78 | else { \ | |
7fe96307 A |
79 | timersub(&t->u.sands, &now, &_result); \ |
80 | timerstring(&_result, buf, size); \ | |
d62a17ae | 81 | } \ |
82 | } while (0) | |
a0edf674 | 83 | |
508e53e2 | 84 | /* for commands */ |
85 | #define OSPF6_AREA_STR "Area information\n" | |
86 | #define OSPF6_AREA_ID_STR "Area ID (as an IPv4 notation)\n" | |
87 | #define OSPF6_SPF_STR "Shortest Path First tree information\n" | |
88 | #define OSPF6_ROUTER_ID_STR "Specify Router-ID\n" | |
89 | #define OSPF6_LS_ID_STR "Specify Link State ID\n" | |
90 | ||
d62a17ae | 91 | #define OSPF6_CMD_CHECK_RUNNING() \ |
92 | if (ospf6 == NULL) { \ | |
93 | vty_out(vty, "OSPFv3 is not running\n"); \ | |
94 | return CMD_SUCCESS; \ | |
95 | } | |
718e3744 | 96 | |
101dc9bc | 97 | extern struct zebra_privs_t ospf6d_privs; |
6b0655a2 | 98 | |
718e3744 | 99 | /* Function Prototypes */ |
d62a17ae | 100 | extern struct route_node *route_prev(struct route_node *node); |
718e3744 | 101 | |
d62a17ae | 102 | extern void ospf6_debug(void); |
103 | extern void ospf6_init(void); | |
718e3744 | 104 | |
105 | #endif /* OSPF6D_H */ |