+// SPDX-License-Identifier: ISC
/* $OpenBSD$ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
* Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _LDPE_H_
#include "ldpd.h"
#include "lib/ldp_sync.h"
-#define min(x,y) ((x) <= (y) ? (x) : (y))
-#define max(x,y) ((x) > (y) ? (x) : (y))
-
/* forward declarations */
TAILQ_HEAD(mapping_head, mapping_entry);
/* accept.c */
void accept_init(void);
-int accept_add(int, int (*)(struct thread *), void *);
+int accept_add(int, void (*)(struct thread *), void *);
void accept_del(int);
void accept_pause(void);
void accept_unpause(void);
void ldpe_ldp_sync_ctl(struct ctl_conn *);
void mapping_list_add(struct mapping_head *, struct map *);
void mapping_list_clr(struct mapping_head *);
+void ldpe_set_config_change_time(void);
/* interface.c */
struct iface *if_new(const char *);
uint32_t);
void nbr_del(struct nbr *);
struct nbr *nbr_find_ldpid(uint32_t);
+struct nbr *nbr_get_first_ldpid(void);
+struct nbr *nbr_get_next_ldpid(uint32_t);
struct nbr *nbr_find_addr(int, union ldpd_addr *);
struct nbr *nbr_find_peerid(uint32_t);
int nbr_adj_count(struct nbr *, int);
int gen_msg_hdr(struct ibuf *, uint16_t, uint16_t);
int send_packet(int, int, union ldpd_addr *,
struct iface_af *, void *, size_t);
-int disc_recv_packet(struct thread *);
-int session_accept(struct thread *);
+void disc_recv_packet(struct thread *thread);
+void session_accept(struct thread *thread);
void session_accept_nbr(struct nbr *, int);
void session_shutdown(struct nbr *, uint32_t, uint32_t,
uint32_t);
void ldpe_l2vpn_pw_init(struct l2vpn_pw *);
void ldpe_l2vpn_pw_exit(struct l2vpn_pw *);
+DECLARE_HOOK(ldp_nbr_state_change, (struct nbr * nbr, int old_state),
+ (nbr, old_state));
+
#endif /* _LDPE_H_ */