10SN/A 20SN/A/* 30SN/A * ngctl.h 40SN/A * 50SN/A * Copyright (c) 1996-1999 Whistle Communications, Inc. 61133Sjoehw * All rights reserved. 71133Sjoehw * 81133Sjoehw * Subject to the following obligations and disclaimer of warranty, use and 91133Sjoehw * redistribution of this software, in source or object code forms, with or 101133Sjoehw * without modifications are expressly permitted by Whistle Communications; 111133Sjoehw * provided, however, that: 120SN/A * 1. Any and all reproductions of the source or object code must include the 131133Sjoehw * copyright notice above and the following disclaimer of warranties; and 140SN/A * 2. No rights are granted, in any manner or form, to use Whistle 150SN/A * Communications, Inc. trademarks, including the mark "WHISTLE 160SN/A * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 170SN/A * such appears in the above copyright notice or in the software. 180SN/A * 190SN/A * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 200SN/A * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 211133Sjoehw * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 220SN/A * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 230SN/A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 240SN/A * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 250SN/A * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 260SN/A * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 270SN/A * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 280SN/A * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 290SN/A * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 300SN/A * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 310SN/A * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 320SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 330SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 340SN/A * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 350SN/A * OF SUCH DAMAGE. 360SN/A */ 370SN/A 380SN/A#define MAX_CMD_ALIAS 8 390SN/A 400SN/A/* Command descriptors */ 410SN/Astruct ngcmd { 420SN/A int (*func)(int ac, char **av); /* command function */ 430SN/A const char *cmd; /* command usage */ 440SN/A const char *desc; /* description */ 450SN/A const char *help; /* help text */ 460SN/A const char *aliases[MAX_CMD_ALIAS]; /* command aliases */ 470SN/A}; 480SN/A 490SN/A/* Command return values */ 500SN/A#define CMDRTN_OK 0 510SN/A#define CMDRTN_USAGE 1 520SN/A#define CMDRTN_ERROR 2 530SN/A#define CMDRTN_QUIT 3 540SN/A 550SN/A/* Available commands */ 560SN/Aextern const struct ngcmd config_cmd; 570SN/Aextern const struct ngcmd connect_cmd; 580SN/Aextern const struct ngcmd debug_cmd; 590SN/Aextern const struct ngcmd dot_cmd; 600SN/Aextern const struct ngcmd help_cmd; 610SN/Aextern const struct ngcmd list_cmd; 620SN/Aextern const struct ngcmd mkpeer_cmd; 630SN/Aextern const struct ngcmd msg_cmd; 640SN/Aextern const struct ngcmd name_cmd; 650SN/Aextern const struct ngcmd read_cmd; 660SN/Aextern const struct ngcmd rmhook_cmd; 670SN/Aextern const struct ngcmd show_cmd; 680SN/Aextern const struct ngcmd shutdown_cmd; 690SN/Aextern const struct ngcmd status_cmd; 700SN/Aextern const struct ngcmd types_cmd; 710SN/Aextern const struct ngcmd write_cmd; 720SN/Aextern const struct ngcmd quit_cmd; 730SN/A 740SN/A/* Data and control sockets */ 750SN/Aextern int csock, dsock; 760SN/A 770SN/A/* Misc functions */ 780SN/Aextern void MsgRead(void); 790SN/Aextern void DumpAscii(const u_char *buf, int len); 800SN/A 810SN/A