defs.h revision 30697
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.20 1997/10/23 21:32:48 ache Exp $
19 *
20 *	TODO:
21 */
22
23#ifndef _DEFS_H_
24#define	_DEFS_H_
25
26#include <sys/types.h>
27#include <machine/endian.h>
28#include <unistd.h>
29#include <signal.h>
30#include <stdlib.h>
31#include <stdio.h>
32#include <string.h>
33#include <termios.h>
34#include "mbuf.h"
35#include "log.h"
36
37/*
38 *  Check follwiing definitions for your machine envirinment
39 */
40#ifdef __FreeBSD__
41#define	MODEM_DEV	"/dev/cuaa1"	/* name of tty device */
42#define	BASE_MODEM_DEV	"cuaa1"	/* name of base tty device */
43#else
44#ifdef __OpenBSD__
45#define	MODEM_DEV	"/dev/cua01"	/* name of tty device */
46#define	BASE_MODEM_DEV	"cua01"	/* name of base tty device */
47#else
48#define	MODEM_DEV	"/dev/tty01"	/* name of tty device */
49#define	BASE_MODEM_DEV	"tty01"	/* name of base tty device */
50#endif
51#endif
52#define MODEM_SPEED	B38400	/* tty speed */
53#define	SERVER_PORT	3000	/* Base server port no. */
54
55#define	MODEM_CTSRTS	TRUE	/* Default (true): use CTS/RTS signals */
56#define	RECONNECT_TIMER	3	/* Default timer for carrier loss */
57#define	RECONNECT_TRIES	0	/* Default retries on carrier loss */
58#define	REDIAL_PERIOD	30	/* Default Hold time to redial */
59#define	NEXT_REDIAL_PERIOD 3	/* Default Hold time to next number redial */
60
61#define	CONFFILE 	"ppp.conf"
62#define	LINKUPFILE 	"ppp.linkup"
63#define	LINKDOWNFILE 	"ppp.linkdown"
64#define	SECRETFILE	"ppp.secret"
65
66/*
67 *  Definition of working mode
68 */
69#define MODE_INTER	1	/* Interactive mode */
70#define MODE_AUTO	2	/* Auto calling mode */
71#define	MODE_DIRECT	4	/* Direct connection mode */
72#define	MODE_DEDICATED	8	/* Dedicated line mode */
73#define	MODE_DDIAL	16	/* Dedicated dialing line mode */
74#define	MODE_ALIAS	32	/* Packet aliasing (masquerading) */
75#define MODE_BACKGROUND 64	/* Background mode. */
76
77
78#define	EX_SIG		-1
79#define	EX_NORMAL	0
80#define	EX_START	1
81#define	EX_SOCK		2
82#define	EX_MODEM	3
83#define	EX_DIAL		4
84#define	EX_DEAD		5
85#define	EX_DONE		6
86#define	EX_REBOOT	7
87#define	EX_ERRDEAD	8
88#define	EX_HANGUP	10
89#define	EX_TERM		11
90#define EX_NODIAL	12
91#define EX_NOLOGIN	13
92
93int mode;
94int BGFiledes[2];
95
96int modem;
97int tun_in, tun_out;
98int netfd;
99char *dstsystem;
100
101#ifndef TRUE
102#define	TRUE 	(1)
103#endif
104#ifndef FALSE
105#define	FALSE 	(0)
106#endif
107
108#ifdef SIGALRM
109u_int nointr_sleep(u_int sec);
110void nointr_usleep(u_int usec);
111#endif
112
113#endif				/* _DEFS_H_ */
114