12 #ifdef OPENDDS_NETWORK_CONFIG_MODIFIER 27 bool NetworkConfigModifier::open()
33 bool NetworkConfigModifier::close()
39 void NetworkConfigModifier::update_interfaces()
42 ACE_DEBUG((LM_DEBUG,
"(%P|%t) NetworkConfigModifier::update_interfaces: enumerating interfaces.\n"));
48 if (::getifaddrs(&p_ifa) != 0) {
50 ACE_ERROR((LM_ERROR,
"(%P|%t) ERROR: NetworkConfigModifier::update_interfaces: %p\n",
62 for (p_if = p_ifa; p_if != 0; p_if = p_if->ifa_next) {
63 if (p_if->ifa_addr == 0)
67 if ((p_if->ifa_flags & IFF_UP) != IFF_UP)
70 if (p_if->ifa_addr->sa_family == AF_INET) {
71 struct sockaddr_in* addr =
reinterpret_cast<sockaddr_in*
> (p_if->ifa_addr);
75 if (addr->sin_addr.s_addr != INADDR_ANY) {
77 address.
set((u_short) 0, addr->sin_addr.s_addr, 0);
79 nia_list.push_back(NetworkInterfaceAddress(p_if->ifa_name, p_if->ifa_flags & (IFF_MULTICAST | IFF_LOOPBACK), NetworkAddress(address)));
82 # if defined (ACE_HAS_IPV6) 83 else if (p_if->ifa_addr->sa_family == AF_INET6) {
84 struct sockaddr_in6 *addr =
reinterpret_cast<sockaddr_in6 *
> (p_if->ifa_addr);
87 if (!IN6_IS_ADDR_UNSPECIFIED(&addr->sin6_addr)) {
89 address.
set(reinterpret_cast<struct sockaddr_in *> (addr),
sizeof(sockaddr_in6));
91 nia_list.push_back(NetworkInterfaceAddress(p_if->ifa_name, p_if->ifa_flags & (IFF_MULTICAST | IFF_LOOPBACK), NetworkAddress(address)));
97 ::freeifaddrs (p_ifa);
129 #endif // OPENDDS_NETWORK_CONFIG_MONITOR
void remove_interface(const OPENDDS_STRING &name)
void set(const List &list)
int set(const ACE_INET_Addr &)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
OpenDDS_Dcps_Export LogLevel log_level
void remove_address(const OPENDDS_STRING &name, const NetworkAddress &address)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.