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
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.
22
#ifndef OSPF6_MESSAGE_H
23
#define OSPF6_MESSAGE_H
25
#define OSPF6_MESSAGE_BUFSIZ 4096
28
extern unsigned char conf_debug_ospf6_message[];
29
#define OSPF6_DEBUG_MESSAGE_SEND 0x01
30
#define OSPF6_DEBUG_MESSAGE_RECV 0x02
31
#define OSPF6_DEBUG_MESSAGE_ON(type, level) \
32
(conf_debug_ospf6_message[type] |= (level))
33
#define OSPF6_DEBUG_MESSAGE_OFF(type, level) \
34
(conf_debug_ospf6_message[type] &= ~(level))
35
#define IS_OSPF6_DEBUG_MESSAGE(t, e) \
36
(conf_debug_ospf6_message[t] & OSPF6_DEBUG_MESSAGE_ ## e)
39
#define OSPF6_MESSAGE_TYPE_UNKNOWN 0x0
40
#define OSPF6_MESSAGE_TYPE_HELLO 0x1 /* Discover/maintain neighbors */
41
#define OSPF6_MESSAGE_TYPE_DBDESC 0x2 /* Summarize database contents */
42
#define OSPF6_MESSAGE_TYPE_LSREQ 0x3 /* Database download request */
43
#define OSPF6_MESSAGE_TYPE_LSUPDATE 0x4 /* Database update */
44
#define OSPF6_MESSAGE_TYPE_LSACK 0x5 /* Flooding acknowledgment */
45
#define OSPF6_MESSAGE_TYPE_ALL 0x6 /* For debug option */
47
#define OSPF6_MESSAGE_TYPE_CANONICAL(T) \
48
((T) > OSPF6_MESSAGE_TYPE_LSACK ? OSPF6_MESSAGE_TYPE_UNKNOWN : (T))
50
extern const char *ospf6_message_type_str[];
51
#define OSPF6_MESSAGE_TYPE_NAME(T) \
52
(ospf6_message_type_str[ OSPF6_MESSAGE_TYPE_CANONICAL (T) ])
54
/* OSPFv3 packet header */
67
#define OSPF6_MESSAGE_END(H) ((caddr_t) (H) + ntohs ((H)->length))
72
u_int32_t interface_id;
75
u_int16_t hello_interval;
76
u_int16_t dead_interval;
79
/* Followed by Router-IDs */
82
/* Database Description */
91
/* Followed by LSA Headers */
94
#define OSPF6_DBDESC_MSBIT (0x01) /* master/slave bit */
95
#define OSPF6_DBDESC_MBIT (0x02) /* more bit */
96
#define OSPF6_DBDESC_IBIT (0x04) /* initial bit */
98
/* Link State Request */
99
/* It is just a sequence of entries below */
100
struct ospf6_lsreq_entry
102
u_int16_t reserved; /* Must Be Zero */
103
u_int16_t type; /* LS type */
104
u_int32_t id; /* Link State ID */
105
u_int32_t adv_router; /* Advertising Router */
108
/* Link State Update */
109
struct ospf6_lsupdate
111
u_int32_t lsa_number;
112
/* Followed by LSAs */
115
/* Link State Acknowledgement */
116
/* It is just a sequence of LSA Headers */
118
/* Function definition */
119
void ospf6_hello_print (struct ospf6_header *);
120
void ospf6_dbdesc_print (struct ospf6_header *);
121
void ospf6_lsreq_print (struct ospf6_header *);
122
void ospf6_lsupdate_print (struct ospf6_header *);
123
void ospf6_lsack_print (struct ospf6_header *);
125
int ospf6_iobuf_size (unsigned int size);
126
int ospf6_receive (struct thread *thread);
128
int ospf6_hello_send (struct thread *thread);
129
int ospf6_dbdesc_send (struct thread *thread);
130
int ospf6_dbdesc_send_newone (struct thread *thread);
131
int ospf6_lsreq_send (struct thread *thread);
132
int ospf6_lsupdate_send_interface (struct thread *thread);
133
int ospf6_lsupdate_send_neighbor (struct thread *thread);
134
int ospf6_lsack_send_interface (struct thread *thread);
135
int ospf6_lsack_send_neighbor (struct thread *thread);
137
int config_write_ospf6_debug_message (struct vty *);
138
void install_element_ospf6_debug_message ();
140
#endif /* OSPF6_MESSAGE_H */