defs.h revision 25634
189857Sobrien/*
289857Sobrien *	    Written by Toshiharu OHNO (tony-o@iij.ad.jp)
389857Sobrien *
489857Sobrien *   Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
589857Sobrien *
689857Sobrien * Redistribution and use in source and binary forms are permitted
789857Sobrien * provided that the above copyright notice and this paragraph are
889857Sobrien * duplicated in all such forms and that any documentation,
989857Sobrien * advertising materials, and other materials related to such
1089857Sobrien * distribution and use acknowledge that the software was developed
1189857Sobrien * by the Internet Initiative Japan.  The name of the
1289857Sobrien * IIJ may not be used to endorse or promote products derived
1389857Sobrien * from this software without specific prior written permission.
1489857Sobrien * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1589857Sobrien * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1689857Sobrien * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1789857Sobrien *
1889857Sobrien * $Id: defs.h,v 1.13 1997/05/04 02:39:03 ache Exp $
1989857Sobrien *
2089857Sobrien *	TODO:
2189857Sobrien */
2289857Sobrien
2389857Sobrien#ifndef _DEFS_H_
2489857Sobrien#define	_DEFS_H_
2589857Sobrien
2689857Sobrien#include <machine/endian.h>
2789857Sobrien#include <sys/types.h>
2889857Sobrien#include <unistd.h>
2989857Sobrien#include <stdlib.h>
3089857Sobrien#include <stdio.h>
3189857Sobrien#include <string.h>
3289857Sobrien#include <termios.h>
3389857Sobrien#include "mbuf.h"
3489857Sobrien#include "log.h"
3589857Sobrien
3689857Sobrien/*
3789857Sobrien *  Check follwiing definitions for your machine envirinment
3889857Sobrien */
3989857Sobrien#define	LOGFILE		"/var/log/ppp.tun%d.log" /* Name of log	file */
4089857Sobrien#ifdef __FreeBSD__
4189857Sobrien#define	MODEM_DEV	"/dev/cuaa1"		/* name of tty device */
4289857Sobrien#define	BASE_MODEM_DEV	"cuaa1"			/* name of base tty device */
4389857Sobrien#else
4489857Sobrien#define	MODEM_DEV	"/dev/tty01"		/* name of tty device */
4589857Sobrien#define	BASE_MODEM_DEV	"tty01"			/* name of base tty device */
4689857Sobrien#endif
4789857Sobrien#define MODEM_SPEED	B38400			/* tty speed */
4889857Sobrien#define	SERVER_PORT	3000			/* Base server port no. */
4989857Sobrien
5089857Sobrien#define	MODEM_CTSRTS	TRUE	/* Default (true): use CTS/RTS signals */
5189857Sobrien#define	RECONNECT_TIMER	3	/* Default timer for carrier loss */
5289857Sobrien#define	RECONNECT_TRIES	0	/* Default retries on carrier loss */
5389857Sobrien#define	REDIAL_PERIOD	30	/* Default Hold time to redial */
5489857Sobrien#define	NEXT_REDIAL_PERIOD 3	/* Default Hold time to next number redial */
5589857Sobrien
5689857Sobrien#define	CONFFILE 	"ppp.conf"
5789857Sobrien#define	LINKFILE 	"ppp.linkup"
5889857Sobrien#define	ETHERFILE	"ppp.etherup"
5989857Sobrien#define	SECRETFILE	"ppp.secret"
6089857Sobrien
6189857Sobrien/*
6289857Sobrien *  Definition of working mode
6389857Sobrien */
6489857Sobrien#define MODE_INTER	1	/* Interactive mode */
6589857Sobrien#define MODE_AUTO	2	/* Auto calling mode */
6689857Sobrien#define	MODE_DIRECT	4	/* Direct connection mode */
6789857Sobrien#define	MODE_DEDICATED	8	/* Dedicated line mode */
6889857Sobrien#define	MODE_DDIAL	16	/* Dedicated dialing line mode */
6989857Sobrien#define	MODE_ALIAS	32	/* Packet aliasing (masquerading) */
7089857Sobrien#define MODE_BACKGROUND 64	/* Background mode. */
7189857Sobrien
7289857Sobrien
7389857Sobrien#define	EX_NORMAL	0
7489857Sobrien#define	EX_START	1
7589857Sobrien#define	EX_SOCK		2
7689857Sobrien#define	EX_MODEM	3
7789857Sobrien#define	EX_DIAL		4
7889857Sobrien#define	EX_DEAD		5
7989857Sobrien#define	EX_DONE		6
8089857Sobrien#define	EX_REBOOT	7
8189857Sobrien#define	EX_ERRDEAD	8
8289857Sobrien#define	EX_HANGUP	10
8389857Sobrien#define	EX_TERM		11
8489857Sobrien#define EX_NODIAL	12
8589857Sobrien#define EX_NOLOGIN	13
8689857Sobrien
8789857Sobrienint mode;
8889857Sobrienint BGFiledes[2];
8989857Sobrien
9089857Sobrienint modem;
9189857Sobrienint tun_in, tun_out;
9289857Sobrienint netfd;
9389857Sobrienchar *dstsystem;
9489857Sobrien
9589857Sobrien#ifndef TRUE
9689857Sobrien#define	TRUE 	(1)
9789857Sobrien#endif
9889857Sobrien#ifndef FALSE
9989857Sobrien#define	FALSE 	(0)
10089857Sobrien#endif
10189857Sobrien
10289857Sobrien#endif	/* _DEFS_H_ */
10389857Sobrien