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