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
19struct parse_result;
20
21struct 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
37extern const struct output show_output, json_output;
38
39#define EOL0(flag)	((flag & F_CTL_SSV) ? ';' : '\n')
40
41const char	*fmt_timeframe_core(time_t);
42const char	*get_linkstate(uint8_t, int);
43const char	*print_ospf_rtr_flags(u_int8_t);
44const char	*print_ospf_options(u_int8_t);
45uint64_t	 get_ifms_type(uint8_t);
46const char	*get_media_descr(uint64_t);
47const char	*print_baudrate(u_int64_t);
48const char	*print_link(int);
49char		*print_ls_type(u_int8_t);
50const char	*log_id(u_int32_t );
51const char	*log_adv_rtr(u_int32_t);
52const char	*print_ospf_flags(u_int8_t);
53char		*print_rtr_link_type(u_int8_t);
54