1193326Sed
2193326Sed/*
3193326Sed * ngctl.h
4193326Sed *
5193326Sed * Copyright (c) 1996-1999 Whistle Communications, Inc.
6193326Sed * All rights reserved.
7193326Sed *
8193326Sed * Subject to the following obligations and disclaimer of warranty, use and
9193326Sed * redistribution of this software, in source or object code forms, with or
10193326Sed * without modifications are expressly permitted by Whistle Communications;
11193326Sed * provided, however, that:
12193326Sed * 1. Any and all reproductions of the source or object code must include the
13193326Sed *    copyright notice above and the following disclaimer of warranties; and
14193326Sed * 2. No rights are granted, in any manner or form, to use Whistle
15193326Sed *    Communications, Inc. trademarks, including the mark "WHISTLE
16218893Sdim *    COMMUNICATIONS" on advertising, endorsements, or otherwise except as
17218893Sdim *    such appears in the above copyright notice or in the software.
18249423Sdim *
19193326Sed * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
20234353Sdim * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
21200583Srdivacky * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
22193326Sed * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
23193326Sed * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
24198092Srdivacky * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
25193326Sed * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
26193326Sed * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
27193326Sed * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
28193326Sed * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
29193326Sed * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
30193326Sed * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
31234353Sdim * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32234353Sdim * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33234353Sdim * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34234353Sdim * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35234353Sdim * OF SUCH DAMAGE.
36234353Sdim */
37234353Sdim
38203955Srdivacky#define MAX_CMD_ALIAS	8
39249423Sdim
40198092Srdivacky/* Command descriptors */
41221345Sdimstruct ngcmd {
42221345Sdim	  int		(*func)(int ac, char **av);	/* command function */
43234353Sdim	  const char	*cmd;				/* command usage */
44249423Sdim	  const char	*desc;				/* description */
45249423Sdim	  const char	*help;				/* help text */
46249423Sdim	  const char	*aliases[MAX_CMD_ALIAS];	/* command aliases */
47249423Sdim};
48249423Sdim
49249423Sdim/* Command return values */
50249423Sdim#define CMDRTN_OK		0
51249423Sdim#define CMDRTN_USAGE		1
52249423Sdim#define CMDRTN_ERROR		2
53249423Sdim#define CMDRTN_QUIT		3
54234353Sdim
55234353Sdim/* Available commands */
56249423Sdimextern const struct ngcmd config_cmd;
57223017Sdimextern const struct ngcmd connect_cmd;
58249423Sdimextern const struct ngcmd debug_cmd;
59249423Sdimextern const struct ngcmd dot_cmd;
60249423Sdimextern const struct ngcmd help_cmd;
61249423Sdimextern const struct ngcmd list_cmd;
62249423Sdimextern const struct ngcmd mkpeer_cmd;
63249423Sdimextern const struct ngcmd msg_cmd;
64249423Sdimextern const struct ngcmd name_cmd;
65249423Sdimextern const struct ngcmd read_cmd;
66203955Srdivackyextern const struct ngcmd rmhook_cmd;
67203955Srdivackyextern const struct ngcmd show_cmd;
68239462Sdimextern const struct ngcmd shutdown_cmd;
69239462Sdimextern const struct ngcmd status_cmd;
70239462Sdimextern const struct ngcmd types_cmd;
71239462Sdimextern const struct ngcmd write_cmd;
72239462Sdimextern const struct ngcmd quit_cmd;
73239462Sdim
74239462Sdim/* Data and control sockets */
75239462Sdimextern int	csock, dsock;
76203955Srdivacky
77221345Sdim/* Misc functions */
78221345Sdimextern void	MsgRead(void);
79221345Sdimextern void	DumpAscii(const u_char *buf, int len);
80203955Srdivacky
81193326Sed