/* * ISDN tunnel Daemon "ItunD" * * Copyright 2004-2006 SYSGO Real-Time Solutions AG * Klein-Winternheim, Germany * All rights reserved. * * Author: Armin Schindler * * Copyright 2004-2006 Cytronics & Melware * * Armin Schindler * * $Id$ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. See . * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ #include #include #include #include #include #include #include #include #include #include #include #include "isdntun.h" #include "options.h" #include "signals.h" #include "tun.h" static char pid_file[128]; int if_fd; int capi_fd; int status = EXIT_OK; int iphase = PHASE_DEAD; void new_phase(int phase) { iphase = phase; capi_new_phase(phase); } /* * exit */ void die(int val) { error("die with %d", val); itun_close(if_fd); itun_exit(); unlink(pid_file); exit(val); } /* * usage */ static void usage(char *prg) { fprintf(stderr, "ISDN-Tunnel Daemon Version %s (c) 2004-2006 Cytronics & Melware, SYSGO AG\n", VERSION); fprintf(stderr, "usage: %s