parser.h revision 1.11
1/*	$OpenBSD: parser.h,v 1.11 2012/09/18 12:07:59 reyk Exp $	*/
2
3/*
4 * Copyright (c) 2007, 2008 Reyk Floeter <reyk@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#ifndef _IKECTL_PARSER_H
20#define _IKECTL_PARSER_H
21
22enum actions {
23	NONE,
24	LOAD,
25	RELOAD,
26	MONITOR,
27	LOG_VERBOSE,
28	LOG_BRIEF,
29	COUPLE,
30	DECOUPLE,
31	ACTIVE,
32	PASSIVE,
33	RESETALL,
34	RESETCA,
35	RESETPOLICY,
36	RESETSA,
37	RESETUSER,
38	CA,
39	CA_CREATE,
40	CA_DELETE,
41	CA_INSTALL,
42	CA_EXPORT,
43	CA_CERTIFICATE,
44	CA_CERT_CREATE,
45	CA_SERVER,
46	CA_CLIENT,
47	CA_CERT_DELETE,
48	CA_CERT_INSTALL,
49	CA_CERT_EXPORT,
50	CA_CERT_REVOKE,
51	CA_KEY_CREATE,
52	CA_KEY_DELETE,
53	CA_KEY_INSTALL,
54	CA_KEY_IMPORT,
55	SHOW_CA,
56	SHOW_CA_CERTIFICATES
57};
58
59struct parse_result {
60	enum actions	 action;
61	struct imsgbuf	*ibuf;
62	char		*path;
63	char		*caname;
64	char		*pass;
65	char		*host;
66	char		*peer;
67	int		 htype;
68	int		 quiet;
69};
70
71#define HOST_IPADDR	1
72#define HOST_FQDN	2
73
74struct parse_result	*parse(int, char *[]);
75
76struct ca	*ca_setup(char *, int, int, char *);
77int		 ca_create(struct ca *);
78int		 ca_certificate(struct ca *, char *, int, int);
79int		 ca_export(struct ca *, char *, char *, char *);
80int		 ca_revoke(struct ca *, char *);
81int		 ca_delete(struct ca *);
82int		 ca_delkey(struct ca *, char *);
83int		 ca_install(struct ca *, char *);
84int		 ca_cert_install(struct ca *, char *, char *);
85int		 ca_show_certs(struct ca *, char *);
86int		 ca_key_create(struct ca *, char *);
87int		 ca_key_delete(struct ca *, char *);
88int		 ca_key_install(struct ca *, char *, char *);
89int		 ca_key_import(struct ca *, char *, char *);
90
91#endif /* _IKECTL_PARSER_H */
92