]>
git.proxmox.com Git - mirror_frr.git/blob - ospf6d/ospf6_message.h
2 * Copyright (C) 1999-2003 Yasuhiro Ohara
4 * This file is part of GNU Zebra.
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
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.
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
21 #ifndef OSPF6_MESSAGE_H
22 #define OSPF6_MESSAGE_H
24 #define OSPF6_MESSAGE_BUFSIZ 4096
27 extern unsigned char conf_debug_ospf6_message
[];
28 #define OSPF6_ACTION_SEND 0x01
29 #define OSPF6_ACTION_RECV 0x02
30 #define OSPF6_DEBUG_MESSAGE_SEND 0x01
31 #define OSPF6_DEBUG_MESSAGE_RECV 0x02
32 #define OSPF6_DEBUG_MESSAGE_SEND_HDR 0x04
33 #define OSPF6_DEBUG_MESSAGE_RECV_HDR 0x08
34 #define OSPF6_DEBUG_MESSAGE_SEND_BOTH \
35 OSPF6_DEBUG_MESSAGE_SEND | OSPF6_DEBUG_MESSAGE_SEND_HDR
36 #define OSPF6_DEBUG_MESSAGE_RECV_BOTH \
37 OSPF6_DEBUG_MESSAGE_RECV | OSPF6_DEBUG_MESSAGE_RECV_HDR
39 #define OSPF6_DEBUG_MESSAGE_ON(type, level) \
40 (conf_debug_ospf6_message[type] |= (level))
41 #define OSPF6_DEBUG_MESSAGE_OFF(type, level) \
42 (conf_debug_ospf6_message[type] &= ~(level))
44 #define IS_OSPF6_DEBUG_MESSAGE(t, e) \
45 (((OSPF6_DEBUG_MESSAGE_##e) == OSPF6_DEBUG_MESSAGE_RECV_HDR) \
46 ? (conf_debug_ospf6_message[t] \
47 & (OSPF6_DEBUG_MESSAGE_RECV_BOTH)) \
48 : (((OSPF6_DEBUG_MESSAGE_##e) == OSPF6_DEBUG_MESSAGE_SEND_HDR) \
49 ? (conf_debug_ospf6_message[t] \
50 & (OSPF6_DEBUG_MESSAGE_SEND_BOTH)) \
51 : (conf_debug_ospf6_message[t] \
52 & (OSPF6_DEBUG_MESSAGE_##e))))
54 #define IS_OSPF6_DEBUG_MESSAGE_ENABLED(type, e) \
55 (conf_debug_ospf6_message[type] & (OSPF6_DEBUG_MESSAGE_##e))
58 #define OSPF6_MESSAGE_TYPE_UNKNOWN 0x0
59 #define OSPF6_MESSAGE_TYPE_HELLO 0x1 /* Discover/maintain neighbors */
60 #define OSPF6_MESSAGE_TYPE_DBDESC 0x2 /* Summarize database contents */
61 #define OSPF6_MESSAGE_TYPE_LSREQ 0x3 /* Database download request */
62 #define OSPF6_MESSAGE_TYPE_LSUPDATE 0x4 /* Database update */
63 #define OSPF6_MESSAGE_TYPE_LSACK 0x5 /* Flooding acknowledgment */
64 #define OSPF6_MESSAGE_TYPE_ALL 0x6 /* For debug option */
66 /* OSPFv3 packet header */
67 #define OSPF6_HEADER_SIZE 16U
79 #define OSPF6_MESSAGE_END(H) ((caddr_t) (H) + ntohs ((H)->length))
82 #define OSPF6_HELLO_MIN_SIZE 20U
84 ifindex_t interface_id
;
87 uint16_t hello_interval
;
88 uint16_t dead_interval
;
91 /* Followed by Router-IDs */
94 /* Database Description */
95 #define OSPF6_DB_DESC_MIN_SIZE 12U
103 /* Followed by LSA Headers */
106 #define OSPF6_DBDESC_MSBIT (0x01) /* master/slave bit */
107 #define OSPF6_DBDESC_MBIT (0x02) /* more bit */
108 #define OSPF6_DBDESC_IBIT (0x04) /* initial bit */
110 /* Link State Request */
111 #define OSPF6_LS_REQ_MIN_SIZE 0U
112 /* It is just a sequence of entries below */
113 #define OSPF6_LSREQ_LSDESC_FIX_SIZE 12U
114 struct ospf6_lsreq_entry
{
115 uint16_t reserved
; /* Must Be Zero */
116 uint16_t type
; /* LS type */
117 in_addr_t id
; /* Link State ID */
118 in_addr_t adv_router
; /* Advertising Router */
121 /* Link State Update */
122 #define OSPF6_LS_UPD_MIN_SIZE 4U
123 struct ospf6_lsupdate
{
125 /* Followed by LSAs */
128 /* Link State Acknowledgement */
129 #define OSPF6_LS_ACK_MIN_SIZE 0U
130 /* It is just a sequence of LSA Headers */
132 /* Function definition */
133 extern void ospf6_hello_print(struct ospf6_header
*, int action
);
134 extern void ospf6_dbdesc_print(struct ospf6_header
*, int action
);
135 extern void ospf6_lsreq_print(struct ospf6_header
*, int action
);
136 extern void ospf6_lsupdate_print(struct ospf6_header
*, int action
);
137 extern void ospf6_lsack_print(struct ospf6_header
*, int action
);
139 extern int ospf6_iobuf_size(unsigned int size
);
140 extern void ospf6_message_terminate(void);
141 extern int ospf6_receive(struct thread
*thread
);
143 extern int ospf6_hello_send(struct thread
*thread
);
144 extern int ospf6_dbdesc_send(struct thread
*thread
);
145 extern int ospf6_dbdesc_send_newone(struct thread
*thread
);
146 extern int ospf6_lsreq_send(struct thread
*thread
);
147 extern int ospf6_lsupdate_send_interface(struct thread
*thread
);
148 extern int ospf6_lsupdate_send_neighbor(struct thread
*thread
);
149 extern int ospf6_lsack_send_interface(struct thread
*thread
);
150 extern int ospf6_lsack_send_neighbor(struct thread
*thread
);
152 extern int config_write_ospf6_debug_message(struct vty
*);
153 extern void install_element_ospf6_debug_message(void);
155 #endif /* OSPF6_MESSAGE_H */