/* * Copyright (c) 1992, 1993 Arno Augustin, Frank Hoering, University of * Erlangen-Nuremberg, Germany. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * Erlangen-Nuremberg, Germany. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software has not been validated by the ``Bundesamt fuer Zulassungen in * der Telekommunikation'' of the ``Deutsche Bundepost Telekom'' and thus * must not be used for accessing the BTX-Network of the Telekom in Germany. * * Diese Software hat keine Zulassung durch das Bundesamt fuer Zulassungen in * der Telekommunikation der Deutschen Bundespost Telekom und darf daher nicht * am Netz der Deutschen Bundespost Telekom in Deutschland betrieben werden. */ #include "config.h" #include "cept.h" #include "../xcept/protocol.h" #include "../xcept/version.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include FILE *openinitfile(); static ceptd(); static void disconnect(),childsig(); /* signal routine for child */ static void hang_child(), waitchild(); static void starttime(), initlog(); static int endtime(); static void exit_btx_server(); /* signal routine for parent */ static pid_t childpid = -1; /* pid of child process */ static int modem = -1; int debug =0; static char *userlogfilename = DEFAULTLOGFILENAME; static int connected; static char *caller; int connectstatus, isdnflag = 0, inetd = 0; main(argc,argv) int argc;char *argv[]; { FILE *initfile; /* fileptr for DEFAULTINITFILENAME*/ FILE *usersfile; /* fileptr for DEFAULTUSERSFILENAME*/ char *initfilename = DEFAULTINITFILENAME; char *usersfilename = DEFAULTUSERSFILENAME; int port = DEFAULTSOCKETPORT; int i,userlog; extern int sockfd; umask(022); if(issock(0) && issock(1)) inetd =1,sockfd=0; initlog(argv[0]); for(i=1; i