xref: /openbsd-src/usr.sbin/relayctl/parser.h (revision 91f110e064cd7c194e59e019b83bb7496c1c84d4)
1 /*	$OpenBSD: parser.h,v 1.14 2011/05/19 08:56:49 reyk Exp $	*/
2 
3 /*
4  * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@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 enum actions {
20 	NONE,
21 	SHOW_SUM,
22 	SHOW_HOSTS,
23 	SHOW_RDRS,
24 	SHOW_RELAYS,
25 	SHOW_SESSIONS,
26 	SHOW_ROUTERS,
27 	RDR_DISABLE,
28 	RDR_ENABLE,
29 	TABLE_DISABLE,
30 	TABLE_ENABLE,
31 	HOST_DISABLE,
32 	HOST_ENABLE,
33 	SHUTDOWN,
34 	POLL,
35 	LOAD,
36 	RELOAD,
37 	MONITOR,
38 	LOG_VERBOSE,
39 	LOG_BRIEF
40 };
41 
42 struct parse_result {
43 	struct ctl_id	id;
44 	enum actions	action;
45 	char		*path;
46 };
47 
48 struct parse_result	*parse(int, char *[]);
49