/* * ppp.h * * Written by Archie Cobbs * Copyright (c) 1995-1999 Whistle Communications, Inc. All rights reserved. * See ``COPYRIGHT.whistle'' */ #ifndef _PPP_H_ #define _PPP_H_ /* Keep source files simple */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __DragonFly__ #include #else #include #endif #include #include #include #include #include #include #include #include #include #include "defs.h" #include "bund.h" #include "link.h" #include "msgdef.h" /* * DEFINITIONS */ /* Do our own version of assert() so it shows up in the logs */ #define assert(e) ((e) ? (void)0 : DoAssert(__FILE__, __LINE__, #e)) /* Giant Mutex handling */ #define GIANT_MUTEX_LOCK() assert(pthread_mutex_lock(&gGiantMutex) == 0) #define GIANT_MUTEX_UNLOCK() assert(pthread_mutex_unlock(&gGiantMutex) == 0) #define ADLG_WAN_AUTHORIZATION_FAILURE 0 #define ADLG_WAN_CONNECTED 1 #define ADLG_WAN_CONNECTING 2 #define ADLG_WAN_CONNECT_FAILURE 3 #define ADLG_WAN_DISABLED 4 #define ADLG_WAN_MESSAGE 5 #define ADLG_WAN_NEGOTIATION_FAILURE 6 #define ADLG_WAN_WAIT_FOR_DEMAND 7 /* * VARIABLES */ extern Link *gLinks; /* Links */ extern Bund *gBundles; /* Bundles */ extern int gNumLinks; /* Total number of links */ extern int gNumBundles; /* Total number of bundles */ extern struct console gConsole; extern ConsoleSession gConsoleSession; /* currently active console-session */ extern struct web gWeb; extern int gBackground; extern int gShutdownInProgress; extern pid_t gPid; extern struct globalconf gGlobalConf; /* Global config settings */ extern struct pevent_ctx *gPeventCtx; extern pthread_mutex_t gGiantMutex; /* Giant Mutex */ extern Bund bund; /* Current bundle */ extern Link lnk; /* Current link */ extern const char *gVersion; /* Program version string */ extern const char *gConfigFile; /* Main config file */ extern const char *gConfDirectory; /* Where the files are */ extern char *gLogFileId; /* Log file identifier */ extern int gOpenSig; /* Rec'd open signal */ extern int gCloseSig; /* Rec'd close signal */ extern int gDeathSig; /* Rec'd terminate signal */ /* * FUNCTIONS */ extern void Greetings(void); extern void SendSignal(int sig); extern void DoExit(int code); extern void DoAssert(const char *file, int line, const char *x); /* Custom stuff */ extern void SetStatus(int code, const char *fmt, ...); #endif