1af57ed9fSAtsushi Murai /* 2af57ed9fSAtsushi Murai * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 3af57ed9fSAtsushi Murai * 4af57ed9fSAtsushi Murai * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 5af57ed9fSAtsushi Murai * 6af57ed9fSAtsushi Murai * Redistribution and use in source and binary forms are permitted 7af57ed9fSAtsushi Murai * provided that the above copyright notice and this paragraph are 8af57ed9fSAtsushi Murai * duplicated in all such forms and that any documentation, 9af57ed9fSAtsushi Murai * advertising materials, and other materials related to such 10af57ed9fSAtsushi Murai * distribution and use acknowledge that the software was developed 11af57ed9fSAtsushi Murai * by the Internet Initiative Japan. The name of the 12af57ed9fSAtsushi Murai * IIJ may not be used to endorse or promote products derived 13af57ed9fSAtsushi Murai * from this software without specific prior written permission. 14af57ed9fSAtsushi Murai * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 15af57ed9fSAtsushi Murai * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 16af57ed9fSAtsushi Murai * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17af57ed9fSAtsushi Murai * 18b6e82f33SBrian Somers * $Id: command.h,v 1.11 1997/11/13 14:43:15 brian Exp $ 19af57ed9fSAtsushi Murai * 20af57ed9fSAtsushi Murai * TODO: 21af57ed9fSAtsushi Murai */ 22af57ed9fSAtsushi Murai 23b6e82f33SBrian Somers struct cmdtab; 24b6e82f33SBrian Somers 25b6e82f33SBrian Somers struct cmdargs { 26b6e82f33SBrian Somers struct cmdtab const *cmd; 27b6e82f33SBrian Somers int argc; 28b6e82f33SBrian Somers char const *const *argv; 29b6e82f33SBrian Somers const void *data; 30b6e82f33SBrian Somers }; 31b6e82f33SBrian Somers 32af57ed9fSAtsushi Murai struct cmdtab { 33b6e82f33SBrian Somers const char *name; 34b6e82f33SBrian Somers const char *alias; 35b6e82f33SBrian Somers int (*func) (struct cmdargs const *); 3653c9f6c0SAtsushi Murai u_char lauth; 37b6e82f33SBrian Somers const char *helpmes; 38b6e82f33SBrian Somers const char *syntax; 39b6e82f33SBrian Somers const void *args; 40af57ed9fSAtsushi Murai }; 4135495becSBrian Somers 4235495becSBrian Somers #define VAR_AUTHKEY 0 4335495becSBrian Somers #define VAR_DIAL 1 4435495becSBrian Somers #define VAR_LOGIN 2 4535495becSBrian Somers #define VAR_AUTHNAME 3 4635495becSBrian Somers #define VAR_DEVICE 4 4735495becSBrian Somers #define VAR_ACCMAP 5 4835495becSBrian Somers #define VAR_PHONE 6 4935495becSBrian Somers #define VAR_HANGUP 7 507351f9d8SBrian Somers #ifdef HAVE_DES 5135495becSBrian Somers #define VAR_ENC 8 527351f9d8SBrian Somers #endif 5375240ed1SBrian Somers 5475240ed1SBrian Somers extern struct in_addr ifnetmask; 5575240ed1SBrian Somers extern int aft_cmd; 5675240ed1SBrian Somers 57b6e82f33SBrian Somers extern int SetVariable(struct cmdargs const *); 5875240ed1SBrian Somers extern void Prompt(void); 59a1e8f937SBrian Somers extern int IsInteractive(int); 6012ef29a8SBrian Somers extern void InterpretCommand(char *, int, int *, char ***); 61b6e82f33SBrian Somers extern void RunCommand(int, char const *const *, const char *label); 62d9181b05SBrian Somers extern void DecodeCommand(char *, int, const char *label); 63