Deleted Added
full compact
defs.h (44073) defs.h (44279)
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 *
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: defs.h,v 1.38 1999/02/11 10:14:08 brian Exp $
18 * $Id: defs.h,v 1.39 1999/02/16 00:16:56 brian Exp $
19 *
20 * TODO:
21 */
22
23/* Check the following definitions for your machine environment */
24#ifdef __FreeBSD__
25# define MODEM_LIST "/dev/cuaa1, /dev/cuaa0" /* name of tty device */
26#else
27# ifdef __OpenBSD__
28# define MODEM_LIST "/dev/cua01, /dev/cua00" /* name of tty device */
29# else
30# define MODEM_LIST "/dev/tty01, /dev/tty00" /* name of tty device */
31# endif
32#endif
33
34#define _PATH_PPP "/etc/ppp"
35
36#define TUN_NAME "tun"
37#define TUN_PREFIX (_PATH_DEV TUN_NAME) /* /dev/tun */
38
39#define MODEM_SPEED B38400 /* tty speed */
40#define SERVER_PORT 3000 /* Base server port no. */
41#define MODEM_CTSRTS 1 /* Default (true): use CTS/RTS signals */
42#define RECONNECT_TIMEOUT 3 /* Default timer for carrier loss */
43#define DIAL_TIMEOUT 30 /* Default and Max random time to redial */
44#define DIAL_NEXT_TIMEOUT 3 /* Default Hold time to next number redial */
45#define SCRIPT_LEN 512 /* Size of login scripts */
46#define LINE_LEN SCRIPT_LEN /* Size of login scripts */
47#define AUTHLEN 100 /* Size of authname/authkey */
48#define CHAPDIGESTLEN 100 /* Maximum chap digest */
49#define CHAPCHALLENGELEN 48 /* Maximum chap challenge */
50#define MAXARGS 40 /* How many args per config line */
51#define NCP_IDLE_TIMEOUT 180 /* Drop all links */
52#define CHOKED_TIMEOUT 120 /* Delete queued packets w/ blocked tun */
53
54#define LINK_MINWEIGHT 20
55#define MIN_LQRPERIOD 2 /* Minimum LQR frequency */
56#define DEF_LQRPERIOD 30 /* Default LQR frequency */
57#define MIN_FSMRETRY 3 /* Minimum FSM retry frequency */
58#define DEF_FSMRETRY 3 /* FSM retry frequency */
59#define DEF_REQs 5 /* This number of REQs in IRC */
60#define DEF_CDDELAY 1 /* Delay before checking for carrier */
61
62#define CONFFILE "ppp.conf"
63#define LINKUPFILE "ppp.linkup"
64#define LINKDOWNFILE "ppp.linkdown"
65#define SECRETFILE "ppp.secret"
66
67#define EX_SIG -1
68#define EX_NORMAL 0
69#define EX_START 1
70#define EX_SOCK 2
71#define EX_MODEM 3
72#define EX_DIAL 4
73#define EX_DEAD 5
74#define EX_DONE 6
75#define EX_REBOOT 7
76#define EX_ERRDEAD 8
77#define EX_HANGUP 10
78#define EX_TERM 11
79#define EX_NODIAL 12
80#define EX_NOLOGIN 13
81
82/* physical::type values (OR'd in bundle::phys_type) */
83#define PHYS_NONE 0
84#define PHYS_INTERACTIVE 1 /* Manual link */
85#define PHYS_AUTO 2 /* Dial-on-demand link */
86#define PHYS_DIRECT 4 /* Incoming link, deleted when closed */
87#define PHYS_DEDICATED 8 /* Dedicated link */
88#define PHYS_DDIAL 16 /* Dial immediately, stay connected */
89#define PHYS_BACKGROUND 32 /* Dial immediately, deleted when closed */
90#define PHYS_ALL 63
91
92extern void randinit(void);
93extern ssize_t fullread(int, void *, size_t);
94extern const char *mode2Nam(int);
95extern int Nam2mode(const char *);
19 *
20 * TODO:
21 */
22
23/* Check the following definitions for your machine environment */
24#ifdef __FreeBSD__
25# define MODEM_LIST "/dev/cuaa1, /dev/cuaa0" /* name of tty device */
26#else
27# ifdef __OpenBSD__
28# define MODEM_LIST "/dev/cua01, /dev/cua00" /* name of tty device */
29# else
30# define MODEM_LIST "/dev/tty01, /dev/tty00" /* name of tty device */
31# endif
32#endif
33
34#define _PATH_PPP "/etc/ppp"
35
36#define TUN_NAME "tun"
37#define TUN_PREFIX (_PATH_DEV TUN_NAME) /* /dev/tun */
38
39#define MODEM_SPEED B38400 /* tty speed */
40#define SERVER_PORT 3000 /* Base server port no. */
41#define MODEM_CTSRTS 1 /* Default (true): use CTS/RTS signals */
42#define RECONNECT_TIMEOUT 3 /* Default timer for carrier loss */
43#define DIAL_TIMEOUT 30 /* Default and Max random time to redial */
44#define DIAL_NEXT_TIMEOUT 3 /* Default Hold time to next number redial */
45#define SCRIPT_LEN 512 /* Size of login scripts */
46#define LINE_LEN SCRIPT_LEN /* Size of login scripts */
47#define AUTHLEN 100 /* Size of authname/authkey */
48#define CHAPDIGESTLEN 100 /* Maximum chap digest */
49#define CHAPCHALLENGELEN 48 /* Maximum chap challenge */
50#define MAXARGS 40 /* How many args per config line */
51#define NCP_IDLE_TIMEOUT 180 /* Drop all links */
52#define CHOKED_TIMEOUT 120 /* Delete queued packets w/ blocked tun */
53
54#define LINK_MINWEIGHT 20
55#define MIN_LQRPERIOD 2 /* Minimum LQR frequency */
56#define DEF_LQRPERIOD 30 /* Default LQR frequency */
57#define MIN_FSMRETRY 3 /* Minimum FSM retry frequency */
58#define DEF_FSMRETRY 3 /* FSM retry frequency */
59#define DEF_REQs 5 /* This number of REQs in IRC */
60#define DEF_CDDELAY 1 /* Delay before checking for carrier */
61
62#define CONFFILE "ppp.conf"
63#define LINKUPFILE "ppp.linkup"
64#define LINKDOWNFILE "ppp.linkdown"
65#define SECRETFILE "ppp.secret"
66
67#define EX_SIG -1
68#define EX_NORMAL 0
69#define EX_START 1
70#define EX_SOCK 2
71#define EX_MODEM 3
72#define EX_DIAL 4
73#define EX_DEAD 5
74#define EX_DONE 6
75#define EX_REBOOT 7
76#define EX_ERRDEAD 8
77#define EX_HANGUP 10
78#define EX_TERM 11
79#define EX_NODIAL 12
80#define EX_NOLOGIN 13
81
82/* physical::type values (OR'd in bundle::phys_type) */
83#define PHYS_NONE 0
84#define PHYS_INTERACTIVE 1 /* Manual link */
85#define PHYS_AUTO 2 /* Dial-on-demand link */
86#define PHYS_DIRECT 4 /* Incoming link, deleted when closed */
87#define PHYS_DEDICATED 8 /* Dedicated link */
88#define PHYS_DDIAL 16 /* Dial immediately, stay connected */
89#define PHYS_BACKGROUND 32 /* Dial immediately, deleted when closed */
90#define PHYS_ALL 63
91
92extern void randinit(void);
93extern ssize_t fullread(int, void *, size_t);
94extern const char *mode2Nam(int);
95extern int Nam2mode(const char *);
96extern struct in_addr GetIpAddr(const char *);