00001 /*************************************************************************** 00002 * Copyright (C) 2001 by Rick L. Vinyard, Jr. * 00003 * rvinyard@cs.nmsu.edu * 00004 * * 00005 * This file is part of the conexus library. * 00006 * * 00007 * The conexus library is free software; you can redistribute it and/or * 00008 * modify it under the terms of the GNU General Public License * 00009 * version 3 as published by the Free Software Foundation. * 00010 * * 00011 * The conexus library is distributed in the hope that it will be * 00012 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * 00013 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00014 * General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this software. If not see <http://www.gnu.org/licenses/>. * 00018 ***************************************************************************/ 00019 #ifndef CONEXUS_UTILITY_H 00020 #define CONEXUS_UTILITY_H 00021 00022 #include <vector> 00023 #include <string> 00024 00025 #include <conexus/factory.h> 00026 #include <conexus/registry.h> 00027 00028 namespace Conexus { 00029 00030 unsigned interface_index( const std::string& name ); 00031 std::string interface_name( unsigned ifindex ); 00032 std::vector<std::string> interface_names(); 00033 std::vector<std::pair<unsigned,std::string> > interfaces(); 00034 std::vector<std::pair<std::string, std::string> > interface_ip_addresses(); 00035 00036 bool use_dispatcher_default(); 00037 00038 void set_use_dispatcher_default( bool use_dispatcher_default=true ); 00039 00052 void init( bool use_dispatcher_default=false ); 00053 00054 bool initialized(); 00055 00056 void set_default_multicast_hops( unsigned hops ); 00057 00058 void set_default_multicast_loopback( bool loopback ); 00059 00060 extern Factory::pointer __default_factory; 00061 00062 Factory& default_factory(); 00063 00064 bool set_default_factory( Factory::pointer new_factory ); 00065 00066 extern Registry::pointer __default_registry; 00067 00068 Registry& default_registry(); 00069 00070 bool set_default_registry( Registry::pointer new_registry ); 00071 00072 } 00073 00074 #endif