xref: /openbsd-src/sbin/unwind/frontend.h (revision 99fd087599a8791921855f21bd7e36130f39aadc)
1 /*	$OpenBSD: frontend.h,v 1.6 2019/11/27 17:09:12 florian Exp $	*/
2 
3 /*
4  * Copyright (c) 2018 Florian Obser <florian@openbsd.org>
5  * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 TAILQ_HEAD(ctl_conns, ctl_conn)	ctl_conns;
21 
22 struct trust_anchor {
23 	TAILQ_ENTRY(trust_anchor)	 entry;
24 	char				*ta;
25 };
26 
27 TAILQ_HEAD(trust_anchor_head, trust_anchor);
28 
29 struct imsg_rdns_proposal {
30 	uint32_t		 if_index;
31 	int			 src;
32 	struct sockaddr_rtdns	 rtdns;
33 };
34 
35 void		 frontend(int, int);
36 void		 frontend_dispatch_main(int, short, void *);
37 void		 frontend_dispatch_resolver(int, short, void *);
38 int		 frontend_imsg_compose_main(int, pid_t, void *, uint16_t);
39 int		 frontend_imsg_compose_resolver(int, pid_t, void *, uint16_t);
40 char		*ip_port(struct sockaddr *);
41 void		 add_new_ta(struct trust_anchor_head *, char *);
42 void		 free_tas(struct trust_anchor_head *);
43 int		 merge_tas(struct trust_anchor_head *,
44 		    struct trust_anchor_head *);
45