xref: /openbsd-src/usr.sbin/npppctl/parser.h (revision 4c1e55dc91edd6e69ccc60ce855900fbc12cf34f)
1 /*	$OpenBSD: parser.h,v 1.2 2012/05/08 13:15:11 yasuoka Exp $	*/
2 
3 /* This file is derived from OpenBSD:src/usr.sbin/ikectl/parser.h 1.9 */
4 /*
5  * Copyright (c) 2007, 2008 Reyk Floeter <reyk@vantronix.net>
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef _NPPPCTL_PARSER_H
21 #define _NPPPCTL_PARSER_H
22 
23 enum actions {
24 	NONE,
25 	SESSION_BRIEF,
26 	SESSION_PKTS,
27 	SESSION_ALL,
28 	CLEAR_SESSION
29 };
30 
31 enum protocol {
32 	PROTO_UNSPEC = 0,
33 	PPTP,
34 	L2TP,
35 	PPPOE,
36 	SSTP
37 };
38 
39 struct parse_result {
40 	enum actions		 action;
41 	u_int			 ppp_id;
42 	int			 has_ppp_id;
43 	struct sockaddr_storage	 address;
44 	const char		*interface;
45 	enum protocol		 protocol;
46 	const char		*realm;
47 	const char		*username;
48 };
49 
50 struct parse_result	*parse(int, char *[]);
51 enum protocol            parse_protocol(const char *);
52 
53 #endif /* _NPPPCTL_PARSER_H */
54