2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2002-12-13 21:15:29 +01:00
|
|
|
/*
|
2004-05-18 20:57:06 +02:00
|
|
|
* Copyright (C) 2003 Yasuhiro Ohara
|
2002-12-13 21:15:29 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OSPF6_NETWORK_H
|
|
|
|
#define OSPF6_NETWORK_H
|
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
extern struct in6_addr allspfrouters6;
|
|
|
|
extern struct in6_addr alldrouters6;
|
|
|
|
|
2020-09-05 09:07:25 +02:00
|
|
|
extern int ospf6_serv_sock(struct ospf6 *ospf6);
|
|
|
|
extern void ospf6_serv_close(int *ospf6_sock);
|
2020-10-08 07:38:43 +02:00
|
|
|
extern int ospf6_sso(ifindex_t ifindex, struct in6_addr *group, int option,
|
|
|
|
int sockfd);
|
2008-08-15 14:45:30 +02:00
|
|
|
|
2020-10-29 11:55:04 +01:00
|
|
|
extern int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
|
2020-10-29 11:59:42 +01:00
|
|
|
ifindex_t ifindex, struct iovec *message,
|
2020-10-29 11:55:04 +01:00
|
|
|
int ospf6_sock);
|
|
|
|
extern int ospf6_recvmsg(struct in6_addr *src, struct in6_addr *dst,
|
|
|
|
ifindex_t *ifindex, struct iovec *message,
|
|
|
|
int ospf6_sock);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2021-03-12 11:58:22 +01:00
|
|
|
#define OSPF6_MESSAGE_WRITE_ON(oi) \
|
2021-03-12 11:56:28 +01:00
|
|
|
do { \
|
|
|
|
bool list_was_empty = \
|
|
|
|
list_isempty(oi->area->ospf6->oi_write_q); \
|
|
|
|
if ((oi)->on_write_q == 0) { \
|
|
|
|
listnode_add(oi->area->ospf6->oi_write_q, (oi)); \
|
|
|
|
(oi)->on_write_q = 1; \
|
|
|
|
} \
|
|
|
|
if (list_was_empty \
|
|
|
|
&& !list_isempty(oi->area->ospf6->oi_write_q)) \
|
|
|
|
thread_add_write(master, ospf6_write, oi->area->ospf6, \
|
|
|
|
oi->area->ospf6->fd, \
|
|
|
|
&oi->area->ospf6->t_write); \
|
|
|
|
} while (0)
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* OSPF6_NETWORK_H */
|