xref: /freebsd/usr.sbin/ppp/command.h (revision cd9647a100862f877a4459adffd24751a7026122)
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.6 1998/04/03 19:21:15 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_MRU		7
52 #define	VAR_MTU		8
53 #define	VAR_OPENMODE	9
54 #define	VAR_PHONE	10
55 #define	VAR_HANGUP	11
56 #define	VAR_ENC		12
57 #define	VAR_IDLETIMEOUT	13
58 #define	VAR_LQRPERIOD	14
59 #define	VAR_LCPRETRY	15
60 #define	VAR_CHAPRETRY	16
61 #define	VAR_PAPRETRY	17
62 #define	VAR_CCPRETRY	18
63 #define	VAR_IPCPRETRY	19
64 
65 extern struct in_addr ifnetmask;
66 extern int aft_cmd;
67 
68 extern int IsInteractive(int);
69 extern void InterpretCommand(char *, int, int *, char ***);
70 extern void RunCommand(struct bundle *, int, char const *const *, const char *);
71 extern void DecodeCommand(struct bundle *, char *, int, const char *);
72 extern struct link *ChooseLink(struct cmdargs const *);
73