rename interfaces() -> broadcasts()

This commit is contained in:
Michael Davidsaver
2021-08-04 07:45:49 -07:00
parent 52625e7430
commit d6bf565ed6
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -475,7 +475,7 @@ ContextImpl::ContextImpl(const Config& conf, const evbase& tcp_loop)
searchBuckets.resize(nBuckets);
std::set<SockAddr> bcasts;
for(auto& addr : searchTx.interfaces()) {
for(auto& addr : searchTx.broadcasts()) {
addr.setPort(0u);
bcasts.insert(addr);
}
+1 -1
View File
@@ -165,7 +165,7 @@ void expandAddrList(const std::vector<std::string>& ifaces,
continue;
}
for(auto& addr : dummy.interfaces(&saddr)) {
for(auto& addr : dummy.broadcasts(&saddr)) {
addr.setPort(0u);
bcasts.push_back(addr.tostring());
}
+1 -1
View File
@@ -107,7 +107,7 @@ std::ostream& target_information(std::ostream& strm)
strm<<indent{}<<"osiSockDiscoverBroadcastAddresses() ->\n";
Indented J(strm);
for(auto& addr : dummy.interfaces()) {
for(auto& addr : dummy.broadcasts()) {
strm<<indent{}<<addr.tostring()<<"\n";
}
}
+1 -1
View File
@@ -477,7 +477,7 @@ void evsocket::mcast_iface(const SockAddr& iface) const
// IPV6_MULTICAST_IF
}
std::vector<SockAddr> evsocket::interfaces(const SockAddr* match)
std::vector<SockAddr> evsocket::broadcasts(const SockAddr* match)
{
if(match && match->family()!=AF_INET) {
throw std::logic_error("osiSockDiscoverBroadcastAddresses() only understands AF_INET");
+1 -1
View File
@@ -227,7 +227,7 @@ struct PVXS_API evsocket
void mcast_iface(const SockAddr& iface) const;
//! wraps osiSockDiscoverBroadcastAddresses()
std::vector<SockAddr> interfaces(const SockAddr* match=nullptr);
std::vector<SockAddr> broadcasts(const SockAddr* match=nullptr);
};
} // namespace impl
+2 -2
View File
@@ -405,7 +405,7 @@ Server::Pvt::Pvt(const Config &conf)
* is to bind a second socket to the interface broadcast address,
* which will then receive only broadcasts.
*/
for(auto bcast : dummy.interfaces(&addr)) {
for(auto bcast : dummy.broadcasts(&addr)) {
bcast.setPort(addr.port());
listeners.push_back(manager.onSearch(bcast,
std::bind(&Pvt::onSearch, this, std::placeholders::_1) ));
@@ -457,7 +457,7 @@ Server::Pvt::Pvt(const Config &conf)
// i[1] host
// mix together first interface and all local bcast addresses
pun.i[1] ^= ntohl(osiLocalAddr(dummy.sock).ia.sin_addr.s_addr);
for(auto& addr : dummy.interfaces()) {
for(auto& addr : dummy.broadcasts()) {
if(addr.family()==AF_INET)
pun.i[1] ^= ntohl(addr->in.sin_addr.s_addr);
}