mcproxy/mcproxy/include/proxy/check_if.hpp
Go to the documentation of this file.00001 /* 00002 * This file is part of mcproxy. 00003 * 00004 * mcproxy is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Lesser General Public License as published by 00006 * the Free Software Foundation; either version 3 of the License, or (at your 00007 * option) any later version. 00008 * 00009 * mcproxy is distributed in the hope that it will be useful, but 00010 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00011 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00012 * License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public License 00015 * along with mcproxy; see the file COPYING.LESSER. 00016 * 00017 * written by Sebastian Woelke, in cooperation with: 00018 * INET group, Hamburg University of Applied Sciences, 00019 * Website: http://mcproxy.realmv6.org/ 00020 */ 00021 00027 #ifndef CHECK_IF_H 00028 #define CHECK_IF_H 00029 00030 #include "include/utils/if_prop.hpp" 00031 #include "vector" 00032 00036 class check_if 00037 { 00038 private: 00039 int m_addr_family; 00040 00041 if_prop m_if_property_a; 00042 if_prop m_if_property_b; 00043 if_prop* m_current_prop; 00044 00045 std::vector<int> m_check_lst; 00046 std::vector<int> m_swap_to_up; 00047 std::vector<int> m_swap_to_down; 00048 00049 public: 00050 00054 check_if(); 00055 00056 //return all dont running interfaces 00063 std::vector<int> init(std::vector<int>& check_lst, int addr_family); 00064 00069 bool check(); 00070 00074 std::vector<int> swap_to_up(); 00075 00079 std::vector<int> swap_to_down(); 00080 00084 static void test_check_if(); 00085 }; 00086 00087 #endif // CHECK_IF_H 00088