xref: /openbsd-src/usr.sbin/relayctl/parser.h (revision 2b0358df1d88d06ef4139321dd05bd5e05d91eaf)
1 /*	$OpenBSD: parser.h,v 1.9 2007/12/20 20:15:43 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 	RDR_DISABLE,
27 	RDR_ENABLE,
28 	TABLE_DISABLE,
29 	TABLE_ENABLE,
30 	HOST_DISABLE,
31 	HOST_ENABLE,
32 	SHUTDOWN,
33 	POLL,
34 	RELOAD,
35 	MONITOR
36 };
37 
38 struct parse_result {
39 	struct ctl_id	id;
40 	enum actions	action;
41 };
42 
43 struct parse_result	*parse(int, char *[]);
44 const struct token      *match_token(const char *, const struct token []);
45 void                     show_valid_args(const struct token []);
46