]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/ldpe.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / ldpd / ldpe.h
index ef4702341b8efccf568680c63f127bd697e562eb..e799538b628290bcb464da49c83257ef43de4089 100644 (file)
@@ -1,21 +1,10 @@
+// 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_
@@ -30,9 +19,6 @@
 #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);
 
@@ -151,7 +137,7 @@ extern struct nbr_pid_head   nbrs_by_pid;
 
 /* 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);
@@ -216,6 +202,7 @@ void                 ldpe_nbr_ctl(struct ctl_conn *);
 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 *);
@@ -266,6 +253,8 @@ struct nbr          *nbr_new(struct in_addr, int, int, union ldpd_addr *,
                            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);
@@ -292,8 +281,8 @@ int                  gen_ldp_hdr(struct ibuf *, uint16_t);
 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);
@@ -318,4 +307,7 @@ void        ldpe_l2vpn_exit(struct l2vpn *);
 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_ */