/* RevArpDaemon.h Copyright (C) 2003 Mike Saywell Southampton Open Wireless Network, http://www.sown.org.uk 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* for the glibc version number */ #include #include /* the L2 protocols */ #include "Packet.h" using namespace std; extern short DEBUG; static int MODE_HELLO = 1; static int MODE_SERVER = 2; static int MODE_CLIENT = 3; class RevArpDaemon { private: AddressManager* man; pthread_t thread; // Set this to false to terminate bool run; int sock; int if_id; void ifup(); void assign(struct in_addr* network, struct in_addr* netmask, bool master); void deAssign(); public: RevArpDaemon(AddressManager* am, int interface); void stop(); void start(); void* doMain(); bool isRunning(); }; // Thread helpers void* radLauncher(void* obj);