mcproxy/mcproxy/include/proxy/routing.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 00028 #ifndef ROUTING_HPP 00029 #define ROUTING_HPP 00030 00031 #include "include/utils/mroute_socket.hpp" 00032 #include "include/utils/if_prop.hpp" 00033 #include "include/proxy/message_queue.hpp" 00034 #include "include/proxy/message_format.hpp" 00035 #include "include/proxy/worker.hpp" 00036 00037 #include <map> 00038 #include <list> 00039 00043 #define ROUTING_MSG_QUEUE_SIZE 1000 00044 00048 class routing: public worker{ 00049 private: 00050 int m_addr_family; //AF_INET or AF_INET6 00051 int m_version; //for AF_INET (1,2,3) to use IGMPv1/2/3, for AF_INET6 (1,2) to use MLDv1/2 00052 00053 mroute_socket* m_mrt_sock; 00054 if_prop m_if_prop; //return interface properties 00055 00056 void worker_thread(); 00057 00058 //init 00059 bool init_if_prop(); 00060 00061 //routing 00065 bool add_vif(routing_msg* msg); 00066 bool del_vif(routing_msg* msg); 00067 bool add_route(routing_msg* msg); 00068 bool del_route(routing_msg* msg); 00069 00070 //GOF singleton 00071 routing(); 00072 routing(const routing&); 00073 routing& operator=(const routing&); 00074 ~routing(); 00075 public: 00076 00080 static routing* getInstance(); 00081 00088 bool init(int addr_family, int version, mroute_socket* mrt_sock); 00089 00090 }; 00091 00092 #endif // ROUTING_HPP 00093