Annotation of embedaddon/quagga/ospf6d/ospf6d.h, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (C) 2003 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: #define OSPF6_DAEMON_VERSION "0.9.7r"
26:
27: /* global variables */
28: extern struct thread_master *master;
29:
30: #ifdef INRIA_IPV6
31: #ifndef IPV6_PKTINFO
32: #define IPV6_PKTINFO IPV6_RECVPKTINFO
33: #endif /* IPV6_PKTINFO */
34: #endif /* INRIA_IPV6 */
35:
36: /* Historical for KAME. */
37: #ifndef IPV6_JOIN_GROUP
38: #ifdef IPV6_ADD_MEMBERSHIP
39: #define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
40: #endif /* IPV6_ADD_MEMBERSHIP. */
41: #ifdef IPV6_JOIN_MEMBERSHIP
42: #define IPV6_JOIN_GROUP IPV6_JOIN_MEMBERSHIP
43: #endif /* IPV6_JOIN_MEMBERSHIP. */
44: #endif /* ! IPV6_JOIN_GROUP*/
45:
46: #ifndef IPV6_LEAVE_GROUP
47: #ifdef IPV6_DROP_MEMBERSHIP
48: #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
49: #endif /* IPV6_DROP_MEMBERSHIP */
50: #endif /* ! IPV6_LEAVE_GROUP */
51:
52: #define MSG_OK 0
53: #define MSG_NG 1
54:
55: /* cast macro: XXX - these *must* die, ick ick. */
56: #define OSPF6_PROCESS(x) ((struct ospf6 *) (x))
57: #define OSPF6_AREA(x) ((struct ospf6_area *) (x))
58: #define OSPF6_INTERFACE(x) ((struct ospf6_interface *) (x))
59: #define OSPF6_NEIGHBOR(x) ((struct ospf6_neighbor *) (x))
60:
61: /* operation on timeval structure */
62: #ifndef timerclear
63: #define timerclear(a) (a)->tv_sec = (tvp)->tv_usec = 0
64: #endif /*timerclear*/
65: #ifndef timersub
66: #define timersub(a, b, res) \
67: do { \
68: (res)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
69: (res)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
70: if ((res)->tv_usec < 0) \
71: { \
72: (res)->tv_sec--; \
73: (res)->tv_usec += 1000000; \
74: } \
75: } while (0)
76: #endif /*timersub*/
77: #define timerstring(tv, buf, size) \
78: do { \
79: if ((tv)->tv_sec / 60 / 60 / 24) \
80: snprintf (buf, size, "%ldd%02ld:%02ld:%02ld", \
81: (tv)->tv_sec / 60 / 60 / 24, \
82: (tv)->tv_sec / 60 / 60 % 24, \
83: (tv)->tv_sec / 60 % 60, \
84: (tv)->tv_sec % 60); \
85: else \
86: snprintf (buf, size, "%02ld:%02ld:%02ld", \
87: (tv)->tv_sec / 60 / 60 % 24, \
88: (tv)->tv_sec / 60 % 60, \
89: (tv)->tv_sec % 60); \
90: } while (0)
91: #define timerstring_local(tv, buf, size) \
92: do { \
93: int ret; \
94: struct tm *tm; \
95: tm = localtime (&(tv)->tv_sec); \
96: ret = strftime (buf, size, "%Y/%m/%d %H:%M:%S", tm); \
97: if (ret == 0) \
98: zlog_warn ("strftime error"); \
99: } while (0)
100:
101: /* for commands */
102: #define OSPF6_AREA_STR "Area information\n"
103: #define OSPF6_AREA_ID_STR "Area ID (as an IPv4 notation)\n"
104: #define OSPF6_SPF_STR "Shortest Path First tree information\n"
105: #define OSPF6_ROUTER_ID_STR "Specify Router-ID\n"
106: #define OSPF6_LS_ID_STR "Specify Link State ID\n"
107:
108: #define VNL VTY_NEWLINE
109: #define OSPF6_CMD_CHECK_RUNNING() \
110: if (ospf6 == NULL) \
111: { \
112: vty_out (vty, "OSPFv3 is not running%s", VTY_NEWLINE); \
113: return CMD_SUCCESS; \
114: }
115:
116:
117: /* Function Prototypes */
118: extern struct route_node *route_prev (struct route_node *node);
119:
120: extern void ospf6_debug (void);
121: extern void ospf6_init (void);
122:
123: #endif /* OSPF6D_H */
124:
125:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>