xref: /freebsd/usr.sbin/ppp/command.h (revision 33b77e2decd50e53798014b70bf7ca3bdc4c0c7e)
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.11 1997/11/13 14:43:15 brian Exp $
19  *
20  *	TODO:
21  */
22 
23 struct cmdtab;
24 
25 struct cmdargs {
26   struct cmdtab const *cmd;
27   int argc;
28   char const *const *argv;
29   const void *data;
30 };
31 
32 struct cmdtab {
33   const char *name;
34   const char *alias;
35   int (*func) (struct cmdargs const *);
36   u_char lauth;
37   const char *helpmes;
38   const char *syntax;
39   const void *args;
40 };
41 
42 #define	VAR_AUTHKEY	0
43 #define	VAR_DIAL	1
44 #define	VAR_LOGIN	2
45 #define	VAR_AUTHNAME	3
46 #define	VAR_DEVICE	4
47 #define	VAR_ACCMAP	5
48 #define	VAR_PHONE	6
49 #define	VAR_HANGUP	7
50 #ifdef HAVE_DES
51 #define	VAR_ENC		8
52 #endif
53 
54 extern struct in_addr ifnetmask;
55 extern int aft_cmd;
56 
57 extern int SetVariable(struct cmdargs const *);
58 extern void Prompt(void);
59 extern int IsInteractive(int);
60 extern void InterpretCommand(char *, int, int *, char ***);
61 extern void RunCommand(int, char const *const *, const char *label);
62 extern void DecodeCommand(char *, int, const char *label);
63