1 /* 2 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 3 * 4 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 5 * 6 * Redistribution and use in source and binary forms are permitted 7 * provided that the above copyright notice and this paragraph are 8 * duplicated in all such forms and that any documentation, 9 * advertising materials, and other materials related to such 10 * distribution and use acknowledge that the software was developed 11 * by the Internet Initiative Japan. The name of the 12 * IIJ may not be used to endorse or promote products derived 13 * from this software without specific prior written permission. 14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 * 18 * $Id: command.h,v 1.12.2.4 1998/02/17 19:27:54 brian Exp $ 19 * 20 * TODO: 21 */ 22 23 struct cmdtab; 24 25 struct cmdargs { 26 struct cmdtab const *cmdtab; /* The entire command table */ 27 struct cmdtab const *cmd; /* This command entry */ 28 int argc; 29 char const *const *argv; 30 struct bundle *bundle; 31 struct datalink *cx; 32 }; 33 34 struct cmdtab { 35 const char *name; 36 const char *alias; 37 int (*func) (struct cmdargs const *); 38 u_char lauth; 39 const char *helpmes; 40 const char *syntax; 41 const void *args; 42 }; 43 44 #define VAR_AUTHKEY 0 45 #define VAR_DIAL 1 46 #define VAR_LOGIN 2 47 #define VAR_AUTHNAME 3 48 #define VAR_WINSIZE 4 49 #define VAR_DEVICE 5 50 #define VAR_ACCMAP 6 51 #define VAR_PHONE 7 52 #define VAR_HANGUP 8 53 #ifdef HAVE_DES 54 #define VAR_ENC 9 55 #endif 56 57 extern struct in_addr ifnetmask; 58 extern int aft_cmd; 59 60 extern int IsInteractive(int); 61 extern void InterpretCommand(char *, int, int *, char ***); 62 extern void RunCommand(struct bundle *, int, char const *const *, const char *); 63 extern void DecodeCommand(struct bundle *, char *, int, const char *); 64