/* IfMan.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 "RevArpDaemon.h" using namespace std; extern short DEBUG; // Interface wrapper struct Interface { // The daemon responsible for this interface // or NULL if the interface is not active RevArpDaemon* rARPd; // The interface int if_index; }; // To pass 2 args to thread struct Wrapper { // Pointer to InterfaceManager class IfMan* ifman; // Device char dev[256]; // The thread... pthread_t thread; bool run; }; typedef map InterfaceMap; // Interface Manager class IfMan { private: struct Wrapper wrap; InterfaceMap ifmap; bool run; AddressManager* addrMan; public: IfMan(AddressManager* addrMan); // Monitors interfaces present (WDS links may come and go and change) void* dowdsMonitor(struct Wrapper* wrap); void wdsMonitor(char* if_name); // Enable aladin on the specified interface void enable(char* if_name); // Diable void disable(char* if_name); }; // Thread helper void* imLauncher(void* obj);