1/*	$OpenBSD: parser.h,v 1.3 2014/03/22 04:30:31 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
23enum actions {
24	NONE,
25	SESSION_BRIEF,
26	SESSION_PKTS,
27	SESSION_ALL,
28	CLEAR_SESSION,
29	MONITOR_SESSION
30};
31
32enum protocol {
33	PROTO_UNSPEC = 0,
34	PPTP,
35	L2TP,
36	PPPOE,
37	SSTP
38};
39
40struct parse_result {
41	enum actions		 action;
42	u_int			 ppp_id;
43	int			 has_ppp_id;
44	struct sockaddr_storage	 address;
45	const char		*interface;
46	enum protocol		 protocol;
47	const char		*realm;
48	const char		*username;
49};
50
51struct parse_result	*parse(int, char *[]);
52enum protocol            parse_protocol(const char *);
53
54#endif /* _NPPPCTL_PARSER_H */
55