]> git.proxmox.com Git - mirror_frr.git/blob - ospf6d/ospf6_network.h
ospfd: prevent from crashing when processing external lsa
[mirror_frr.git] / ospf6d / ospf6_network.h
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 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
19 */
20
21 #ifndef OSPF6_NETWORK_H
22 #define OSPF6_NETWORK_H
23
24 extern struct in6_addr allspfrouters6;
25 extern struct in6_addr alldrouters6;
26
27 extern int ospf6_serv_sock(struct ospf6 *ospf6);
28 extern void ospf6_serv_close(int *ospf6_sock);
29 extern int ospf6_sso(ifindex_t ifindex, struct in6_addr *group, int option,
30 int sockfd);
31
32 extern int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
33 ifindex_t ifindex, struct iovec *message,
34 int ospf6_sock);
35 extern int ospf6_recvmsg(struct in6_addr *src, struct in6_addr *dst,
36 ifindex_t *ifindex, struct iovec *message,
37 int ospf6_sock);
38
39 #define OSPF6_MESSAGE_WRITE_ON(oi) \
40 do { \
41 bool list_was_empty = \
42 list_isempty(oi->area->ospf6->oi_write_q); \
43 if ((oi)->on_write_q == 0) { \
44 listnode_add(oi->area->ospf6->oi_write_q, (oi)); \
45 (oi)->on_write_q = 1; \
46 } \
47 if (list_was_empty \
48 && !list_isempty(oi->area->ospf6->oi_write_q)) \
49 thread_add_write(master, ospf6_write, oi->area->ospf6, \
50 oi->area->ospf6->fd, \
51 &oi->area->ospf6->t_write); \
52 } while (0)
53
54 #endif /* OSPF6_NETWORK_H */