11ae349f5Scvs2svn /* 21ae349f5Scvs2svn * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 31ae349f5Scvs2svn * 41ae349f5Scvs2svn * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 51ae349f5Scvs2svn * 61ae349f5Scvs2svn * Redistribution and use in source and binary forms are permitted 71ae349f5Scvs2svn * provided that the above copyright notice and this paragraph are 81ae349f5Scvs2svn * duplicated in all such forms and that any documentation, 91ae349f5Scvs2svn * advertising materials, and other materials related to such 101ae349f5Scvs2svn * distribution and use acknowledge that the software was developed 111ae349f5Scvs2svn * by the Internet Initiative Japan. The name of the 121ae349f5Scvs2svn * IIJ may not be used to endorse or promote products derived 131ae349f5Scvs2svn * from this software without specific prior written permission. 141ae349f5Scvs2svn * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 151ae349f5Scvs2svn * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 161ae349f5Scvs2svn * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 171ae349f5Scvs2svn * 18aef795ccSBrian Somers * $Id: command.h,v 1.12.2.3 1998/02/10 03:23:11 brian Exp $ 191ae349f5Scvs2svn * 201ae349f5Scvs2svn * TODO: 211ae349f5Scvs2svn */ 221ae349f5Scvs2svn 231ae349f5Scvs2svn struct cmdtab; 241ae349f5Scvs2svn 251ae349f5Scvs2svn struct cmdargs { 26aef795ccSBrian Somers struct cmdtab const *cmdtab; /* The entire command table */ 27aef795ccSBrian Somers struct cmdtab const *cmd; /* This command entry */ 281ae349f5Scvs2svn int argc; 291ae349f5Scvs2svn char const *const *argv; 307a6f8720SBrian Somers struct bundle *bundle; 31aef795ccSBrian Somers struct datalink *cx; 321ae349f5Scvs2svn }; 331ae349f5Scvs2svn 341ae349f5Scvs2svn struct cmdtab { 351ae349f5Scvs2svn const char *name; 361ae349f5Scvs2svn const char *alias; 371ae349f5Scvs2svn int (*func) (struct cmdargs const *); 381ae349f5Scvs2svn u_char lauth; 391ae349f5Scvs2svn const char *helpmes; 401ae349f5Scvs2svn const char *syntax; 411ae349f5Scvs2svn const void *args; 421ae349f5Scvs2svn }; 431ae349f5Scvs2svn 441ae349f5Scvs2svn #define VAR_AUTHKEY 0 451ae349f5Scvs2svn #define VAR_DIAL 1 461ae349f5Scvs2svn #define VAR_LOGIN 2 471ae349f5Scvs2svn #define VAR_AUTHNAME 3 481ae349f5Scvs2svn #define VAR_DEVICE 4 491ae349f5Scvs2svn #define VAR_ACCMAP 5 501ae349f5Scvs2svn #define VAR_PHONE 6 511ae349f5Scvs2svn #define VAR_HANGUP 7 521ae349f5Scvs2svn #ifdef HAVE_DES 531ae349f5Scvs2svn #define VAR_ENC 8 541ae349f5Scvs2svn #endif 551ae349f5Scvs2svn 561ae349f5Scvs2svn extern struct in_addr ifnetmask; 571ae349f5Scvs2svn extern int aft_cmd; 581ae349f5Scvs2svn 591ae349f5Scvs2svn extern int IsInteractive(int); 601ae349f5Scvs2svn extern void InterpretCommand(char *, int, int *, char ***); 617a6f8720SBrian Somers extern void RunCommand(struct bundle *, int, char const *const *, const char *); 627a6f8720SBrian Somers extern void DecodeCommand(struct bundle *, char *, int, const char *); 63