Selaa lähdekoodia

Rename MulticastTopology to Multicaster -- same name as old multicast controller but different code. More descriptive though.

Adam Ierymenko 11 vuotta sitten
vanhempi
commit
6c87f9f765
4 muutettua tiedostoa jossa 17 lisäystä ja 17 poistoa
  1. 7 7
      node/Multicaster.cpp
  2. 5 5
      node/Multicaster.hpp
  3. 4 4
      node/Network.hpp
  4. 1 1
      objects.mk

+ 7 - 7
node/MulticastTopology.cpp → node/Multicaster.cpp

@@ -28,24 +28,24 @@
 #include <algorithm>
 
 #include "Constants.hpp"
-#include "MulticastTopology.hpp"
+#include "Multicaster.hpp"
 #include "Topology.hpp"
 
 namespace ZeroTier {
 
-MulticastTopology::MulticastTopology()
+Multicaster::Multicaster()
 {
 }
 
-MulticastTopology::~MulticastTopology()
+Multicaster::~Multicaster()
 {
 }
 
-void MulticastTopology::add(const MulticastGroup &mg,const Address &learnedFrom,const Address &member)
+void Multicaster::add(const MulticastGroup &mg,const Address &learnedFrom,const Address &member)
 {
 }
 
-void MulticastTopology::erase(const MulticastGroup &mg,const Address &member)
+void Multicaster::erase(const MulticastGroup &mg,const Address &member)
 {
 	Mutex::Lock _l(_groups_m);
 	std::map< MulticastGroup,MulticastGroupStatus >::iterator r(_groups.find(mg));
@@ -67,7 +67,7 @@ void send(uint64_t nwid,uint64_t now,const Address &self,const MulticastGroup &m
 	std::map< MulticastGroup,MulticastGroupStatus >::iterator r(_groups.find(mg));
 }
 
-unsigned int MulticastTopology::shouldGather(const MulticastGroup &mg,uint64_t now,unsigned int limit,bool updateLastGatheredTimeOnNonzeroReturn)
+unsigned int Multicaster::shouldGather(const MulticastGroup &mg,uint64_t now,unsigned int limit,bool updateLastGatheredTimeOnNonzeroReturn)
 {
 	Mutex::Lock _l(_groups_m);
 	MulticastGroupStatus &gs = _groups[mg];
@@ -86,7 +86,7 @@ unsigned int MulticastTopology::shouldGather(const MulticastGroup &mg,uint64_t n
 	}
 }
 
-void MulticastTopology::clean(uint64_t now,const Topology &topology)
+void Multicaster::clean(uint64_t now,const Topology &topology)
 {
 	Mutex::Lock _l(_groups_m);
 	for(std::map< MulticastGroup,MulticastGroupStatus >::iterator mm(_groups.begin());mm!=_groups.end();) {

+ 5 - 5
node/MulticastTopology.hpp → node/Multicaster.hpp

@@ -25,8 +25,8 @@
  * LLC. Start here: http://www.zerotier.com/
  */
 
-#ifndef ZT_MULTICASTTOPOLOGY_HPP
-#define ZT_MULTICASTTOPOLOGY_HPP
+#ifndef ZT_MULTICASTER_HPP
+#define ZT_MULTICASTER_HPP
 
 #include <stdint.h>
 #include <string.h>
@@ -51,7 +51,7 @@ class Topology;
 /**
  * Database of known multicast peers within a network
  */
-class MulticastTopology
+class Multicaster
 {
 private:
 	struct MulticastGroupMember
@@ -78,8 +78,8 @@ private:
 	};
 
 public:
-	MulticastTopology();
-	~MulticastTopology();
+	Multicaster();
+	~Multicaster();
 
 	/**
 	 * Add or update a member in a multicast group

+ 4 - 4
node/Network.hpp

@@ -51,7 +51,7 @@
 #include "Identity.hpp"
 #include "InetAddress.hpp"
 #include "BandwidthAccount.hpp"
-#include "MulticastTopology.hpp"
+#include "Multicaster.hpp"
 #include "NetworkConfig.hpp"
 #include "CertificateOfMembership.hpp"
 #include "Thread.hpp"
@@ -416,8 +416,8 @@ public:
 	/**
 	 * @return Multicast topology for this network
 	 */
-	inline MulticastTopology &mcTopology() { return _multicastTopology; }
-	inline const MulticastTopology &mcTopology() const { return _multicastTopology; }
+	inline Multicaster &mc() { return _multicaster; }
+	inline const Multicaster &mc() const { return _multicaster; }
 
 	/**
 	 * Destroy this network
@@ -453,7 +453,7 @@ private:
 	std::set< MulticastGroup > _myMulticastGroups; // multicast groups that we belong to including those behind us (updated periodically)
 	std::map< MulticastGroup,uint64_t > _multicastGroupsBehindMe; // multicast groups bridged to us and when we last saw activity on each
 	std::map< MulticastGroup,BandwidthAccount > _multicastRateAccounts;
-	MulticastTopology _multicastTopology;
+	Multicaster _multicaster;
 
 	std::map<MAC,Address> _remoteBridgeRoutes; // remote addresses where given MACs are reachable
 

+ 1 - 1
objects.mk

@@ -13,7 +13,7 @@ OBJS=\
 	node/IncomingPacket.o \
 	node/InetAddress.o \
 	node/Logger.o \
-	node/MulticastTopology.o \
+	node/Multicaster.o \
 	node/Network.o \
 	node/NetworkConfig.o \
 	node/Node.o \