/*************************************************************************** * Copyright (C) 03/2005 by Olaf Rempel * * razzor@kopf-tisch.de * * * * 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. * * * * 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. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "hlswmaster.h" static struct option opts[] = { {"config", 1, 0, 'c'}, {"user", 1, 0, 'u'}, {"debug", 1, 0, 'd'}, {"no-daemon", 0, 0, 'f'}, {"help", 0, 0, 'h'}, {0, 0, 0, 0} }; int main(int argc, char *argv[]) { int arg = 0, code = 0; pthread_t thread1, thread2, thread3, thread4; while (code != -1) { code = getopt_long(argc, argv, "c:u:d:fh", opts, &arg); switch (code) { case 'c': /* config */ break; case 'u': /* user */ break; case 'd': /* debug */ break; case 'f': /* no-daemon */ break; case 'h': /* help */ printf("Usage: hlsw-master [options]\n" "Options: \n" " --config -c configfile use this configfile\n" " --user -u username change uid to username\n" " --debug -d debuglevel level: 0 - 7\n" " --no-daemon -f do not fork\n" " --help -h this help\n" "\n"); exit(0); break; case '?': /* error */ exit(-1); break; default: /* unknown / all options parsed */ break; } } plugin_load("plugins/hlswproxy.so"); plugin_load("plugins/quake3.so"); plugin_load("plugins/quake2.so"); plugin_load("plugins/halo.so"); plugin_load("plugins/doom3.so"); plugin_load("plugins/ut.so"); plugin_load("plugins/battlefield1942.so"); scan_init(); // scan_transmit(); pthread_create(&thread1, NULL, (void *)&scan_transmit, NULL); pthread_create(&thread2, NULL, (void *)&scan_receive, NULL); pthread_create(&thread3, NULL, (void *)&server_collector, NULL); pthread_create(&thread4, NULL, (void *)&client_handler, NULL); sleep(9999); scan_exit(); return 0; }