+// SPDX-License-Identifier: ISC
/* $OpenBSD$ */
/*
* 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;
};
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;
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];
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;
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;
#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;
};
struct kaddr {
- char ifname[IF_NAMESIZE];
+ char ifname[INTERFACE_NAMSIZ];
ifindex_t ifindex;
int af;
union ldpd_addr addr;
};
struct kif {
- char ifname[IF_NAMESIZE];
+ char ifname[INTERFACE_NAMSIZ];
ifindex_t ifindex;
int flags;
int operative;
/* 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;
};
struct ctl_disc_if {
- char name[IF_NAMESIZE];
+ char name[INTERFACE_NAMSIZ];
int active_v4;
int active_v6;
int no_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;
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;
};
struct ctl_ldp_sync {
- char name[IF_NAMESIZE];
+ char name[INTERFACE_NAMSIZ];
ifindex_t ifindex;
bool in_sync;
bool timer_running;
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 *,
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);