]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/ldpd.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / ldpd / ldpd.h
index 7e70aa3a445776069a3d7553d2ace71fb14fc3b7..dc993e3d7cc645571873c9e3c1b9f143adbc791f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2004 Esben Norby <norby@openbsd.org>
  * Copyright (c) 2003, 2004 Henning Brauer <henning@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 _LDPD_H_
 struct evbuf {
        struct msgbuf            wbuf;
        struct thread           *ev;
-       int                      (*handler)(struct thread *);
+       void (*handler)(struct thread *);
        void                    *arg;
 };
 
 struct imsgev {
        struct imsgbuf           ibuf;
-       int                     (*handler_write)(struct thread *);
+       void (*handler_write)(struct thread *);
        struct thread           *ev_write;
-       int                     (*handler_read)(struct thread *);
+       void (*handler_read)(struct thread *);
        struct thread           *ev_read;
 };
 
@@ -174,7 +163,6 @@ struct ldpd_init {
 
 struct ldp_access {
        char                     name[ACL_NAMSIZ];
-       enum access_type         type;
 };
 
 union ldpd_addr {
@@ -353,7 +341,7 @@ struct iface_ldp_sync {
 
 struct iface {
        RB_ENTRY(iface)          entry;
-       char                     name[IF_NAMESIZE];
+       char                     name[INTERFACE_NAMSIZ];
        ifindex_t                ifindex;
        struct if_addr_head      addr_list;
        struct in6_addr          linklocal;
@@ -459,7 +447,7 @@ struct ldp_entity_stats {
 struct l2vpn_if {
        RB_ENTRY(l2vpn_if)       entry;
        struct l2vpn            *l2vpn;
-       char                     ifname[IF_NAMESIZE];
+       char                     ifname[INTERFACE_NAMSIZ];
        ifindex_t                ifindex;
        int                      operative;
        uint8_t                  mac[ETH_ALEN];
@@ -476,7 +464,7 @@ struct l2vpn_pw {
        int                      af;
        union ldpd_addr          addr;
        uint32_t                 pwid;
-       char                     ifname[IF_NAMESIZE];
+       char                     ifname[INTERFACE_NAMSIZ];
        ifindex_t                ifindex;
        bool                     enabled;
        uint32_t                 remote_group;
@@ -508,7 +496,7 @@ struct l2vpn {
        int                      type;
        int                      pw_type;
        int                      mtu;
-       char                     br_ifname[IF_NAMESIZE];
+       char                     br_ifname[INTERFACE_NAMSIZ];
        ifindex_t                br_ifindex;
        struct l2vpn_if_head     if_tree;
        struct l2vpn_pw_head     pw_tree;
@@ -591,7 +579,7 @@ DECLARE_QOBJ_TYPE(ldpd_conf);
 #define        F_LDPD_DS_CISCO_INTEROP 0x0002
 #define        F_LDPD_ENABLED          0x0004
 #define        F_LDPD_ORDERED_CONTROL  0x0008
-
+#define        F_LDPD_ALLOW_BROKEN_LSP 0x0010
 
 struct ldpd_af_global {
        struct thread           *disc_ev;
@@ -630,7 +618,7 @@ struct kroute {
 };
 
 struct kaddr {
-       char                     ifname[IF_NAMESIZE];
+       char                     ifname[INTERFACE_NAMSIZ];
        ifindex_t                ifindex;
        int                      af;
        union ldpd_addr          addr;
@@ -639,7 +627,7 @@ struct kaddr {
 };
 
 struct kif {
-       char                     ifname[IF_NAMESIZE];
+       char                     ifname[INTERFACE_NAMSIZ];
        ifindex_t                ifindex;
        int                      flags;
        int                      operative;
@@ -657,7 +645,7 @@ struct acl_check {
 /* control data structures */
 struct ctl_iface {
        int                      af;
-       char                     name[IF_NAMESIZE];
+       char                     name[INTERFACE_NAMSIZ];
        ifindex_t                ifindex;
        int                      state;
        enum iface_type          type;
@@ -668,7 +656,7 @@ struct ctl_iface {
 };
 
 struct ctl_disc_if {
-       char                     name[IF_NAMESIZE];
+       char                     name[INTERFACE_NAMSIZ];
        int                      active_v4;
        int                      active_v6;
        int                      no_adj;
@@ -684,7 +672,7 @@ struct ctl_adj {
        int                      af;
        struct in_addr           id;
        enum hello_type          type;
-       char                     ifname[IF_NAMESIZE];
+       char                     ifname[INTERFACE_NAMSIZ];
        union ldpd_addr          src_addr;
        uint16_t                 holdtime;
        uint16_t                 holdtime_remaining;
@@ -724,7 +712,7 @@ struct ctl_rt {
 struct ctl_pw {
        uint16_t                 type;
        char                     l2vpn_name[L2VPN_NAME_LEN];
-       char                     ifname[IF_NAMESIZE];
+       char                     ifname[INTERFACE_NAMSIZ];
        uint32_t                 pwid;
        struct in_addr           lsr_id;
        uint32_t                 local_label;
@@ -740,7 +728,7 @@ struct ctl_pw {
 };
 
 struct ctl_ldp_sync {
-       char                     name[IF_NAMESIZE];
+       char                     name[INTERFACE_NAMSIZ];
        ifindex_t                ifindex;
        bool                     in_sync;
        bool                     timer_running;
@@ -793,7 +781,7 @@ void                 sa2addr(struct sockaddr *, int *, union ldpd_addr *,
 socklen_t       sockaddr_len(struct sockaddr *);
 
 /* ldpd.c */
-int                     ldp_write_handler(struct thread *);
+void ldp_write_handler(struct thread *thread);
 void                    main_imsg_compose_ldpe(int, pid_t, void *, uint16_t);
 void                    main_imsg_compose_lde(int, pid_t, void *, uint16_t);
 int                     main_imsg_compose_both(enum imsg_type, void *,
@@ -803,8 +791,7 @@ int                  imsg_compose_event(struct imsgev *, uint16_t, uint32_t,
                            pid_t, int, void *, uint16_t);
 void                    evbuf_enqueue(struct evbuf *, struct ibuf *);
 void                    evbuf_event_add(struct evbuf *);
-void                    evbuf_init(struct evbuf *, int,
-                           int (*)(struct thread *), void *);
+void evbuf_init(struct evbuf *, int, void (*)(struct thread *), void *);
 void                    evbuf_clear(struct evbuf *);
 int                     ldp_acl_request(struct imsgev *, char *, int,
                            union ldpd_addr *, uint8_t);