xref: /openbsd/usr.sbin/ospfctl/ospfctl.h (revision ce7279d8)
1 /*
2  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
3  * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
4  * Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 struct parse_result;
20 
21 struct output {
22 	void	(*head)(struct parse_result *);
23 	void	(*interface)(struct ctl_iface *, int);
24 	void	(*summary)(struct ctl_sum *);
25 	void	(*summary_area)(struct ctl_sum_area *);
26 	void	(*neighbor)(struct ctl_nbr *, int);
27 	void	(*rib)(struct ctl_rt *, int);
28 	void	(*fib)(struct kroute *);
29 	void	(*fib_interface)(struct kif *);
30 	void	(*db)(struct lsa *, struct in_addr, u_int8_t,
31 		    char *);
32 	void	(*db_simple)(struct lsa_hdr *, struct in_addr, u_int8_t,
33 		    char *);
34 	void	(*tail)(void);
35 };
36 
37 extern const struct output show_output;
38 
39 #define EOL0(flag)	((flag & F_CTL_SSV) ? ';' : '\n')
40 
41 const char	*fmt_timeframe_core(time_t);
42 const char	*get_linkstate(uint8_t, int);
43 const char	*print_ospf_rtr_flags(u_int8_t);
44 const char	*print_ospf_options(u_int8_t);
45 uint64_t	 get_ifms_type(uint8_t);
46 const char	*get_media_descr(uint64_t);
47 const char	*print_baudrate(u_int64_t);
48 const char	*print_link(int);
49 char		*print_ls_type(u_int8_t);
50 const char	*log_id(u_int32_t );
51 const char	*log_adv_rtr(u_int32_t);
52 const char	*print_ospf_flags(u_int8_t);
53 char		*print_rtr_link_type(u_int8_t);
54