mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-03 19:13:43 +02:00
Forgot some consts.
This commit is contained in:
parent
b40eba8fc7
commit
e26e77dd6d
9 changed files with 43 additions and 45 deletions
|
@ -61,9 +61,7 @@ public:
|
|||
}
|
||||
|
||||
ZT_INLINE ~Context() noexcept
|
||||
{
|
||||
Utils::burn(secretIdentityStr, sizeof(secretIdentityStr));
|
||||
}
|
||||
{ Utils::burn(secretIdentityStr, sizeof(secretIdentityStr)); }
|
||||
|
||||
// Unique ID generated on startup
|
||||
const uint64_t instanceId;
|
||||
|
|
|
@ -1095,7 +1095,7 @@ bool Network::gate(void *tPtr, const SharedPtr< Peer > &peer) noexcept
|
|||
return false;
|
||||
}
|
||||
|
||||
void Network::doPeriodicTasks(CallContext &cc)
|
||||
void Network::doPeriodicTasks(const CallContext &cc)
|
||||
{
|
||||
if (m_destroyed)
|
||||
return;
|
||||
|
@ -1157,7 +1157,7 @@ void Network::learnBridgeRoute(const MAC &mac, const Address &addr)
|
|||
}
|
||||
}
|
||||
|
||||
Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const MembershipCredential &com)
|
||||
Member::AddCredentialResult Network::addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const MembershipCredential &com)
|
||||
{
|
||||
if (com.networkId() != m_id)
|
||||
return Member::ADD_REJECTED;
|
||||
|
@ -1165,7 +1165,7 @@ Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identi
|
|||
return m_memberships[com.issuedTo().address].addCredential(m_ctx, cc, sourcePeerIdentity, m_config, com);
|
||||
}
|
||||
|
||||
Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const CapabilityCredential &cap)
|
||||
Member::AddCredentialResult Network::addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const CapabilityCredential &cap)
|
||||
{
|
||||
if (cap.networkId() != m_id)
|
||||
return Member::ADD_REJECTED;
|
||||
|
@ -1173,7 +1173,7 @@ Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identi
|
|||
return m_memberships[cap.issuedTo()].addCredential(m_ctx, cc, sourcePeerIdentity, m_config, cap);
|
||||
}
|
||||
|
||||
Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const TagCredential &tag)
|
||||
Member::AddCredentialResult Network::addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const TagCredential &tag)
|
||||
{
|
||||
if (tag.networkId() != m_id)
|
||||
return Member::ADD_REJECTED;
|
||||
|
@ -1181,7 +1181,7 @@ Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identi
|
|||
return m_memberships[tag.issuedTo()].addCredential(m_ctx, cc, sourcePeerIdentity, m_config, tag);
|
||||
}
|
||||
|
||||
Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const RevocationCredential &rev)
|
||||
Member::AddCredentialResult Network::addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const RevocationCredential &rev)
|
||||
{
|
||||
if (rev.networkId() != m_id)
|
||||
return Member::ADD_REJECTED;
|
||||
|
@ -1215,7 +1215,7 @@ Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identi
|
|||
return result;
|
||||
}
|
||||
|
||||
Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const OwnershipCredential &coo)
|
||||
Member::AddCredentialResult Network::addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const OwnershipCredential &coo)
|
||||
{
|
||||
if (coo.networkId() != m_id)
|
||||
return Member::ADD_REJECTED;
|
||||
|
@ -1223,7 +1223,7 @@ Member::AddCredentialResult Network::addCredential(CallContext &cc, const Identi
|
|||
return m_memberships[coo.issuedTo()].addCredential(m_ctx, cc, sourcePeerIdentity, m_config, coo);
|
||||
}
|
||||
|
||||
void Network::pushCredentials(CallContext &cc, const SharedPtr< Peer > &to)
|
||||
void Network::pushCredentials(const CallContext &cc, const SharedPtr< Peer > &to)
|
||||
{
|
||||
const int64_t tout = std::min(m_config.credentialTimeMaxDelta, m_config.com.timestampMaxDelta());
|
||||
Mutex::Lock _l(m_memberships_l);
|
||||
|
|
|
@ -237,7 +237,7 @@ public:
|
|||
/**
|
||||
* Do periodic cleanup and housekeeping tasks
|
||||
*/
|
||||
void doPeriodicTasks(CallContext &cc);
|
||||
void doPeriodicTasks(const CallContext &cc);
|
||||
|
||||
/**
|
||||
* Find the node on this network that has this MAC behind it (if any)
|
||||
|
@ -276,34 +276,34 @@ public:
|
|||
/**
|
||||
* Validate a credential and learn it if it passes certificate and other checks
|
||||
*/
|
||||
Member::AddCredentialResult addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const MembershipCredential &com);
|
||||
Member::AddCredentialResult addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const MembershipCredential &com);
|
||||
|
||||
/**
|
||||
* Validate a credential and learn it if it passes certificate and other checks
|
||||
*/
|
||||
Member::AddCredentialResult addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const CapabilityCredential &cap);
|
||||
Member::AddCredentialResult addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const CapabilityCredential &cap);
|
||||
|
||||
/**
|
||||
* Validate a credential and learn it if it passes certificate and other checks
|
||||
*/
|
||||
Member::AddCredentialResult addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const TagCredential &tag);
|
||||
Member::AddCredentialResult addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const TagCredential &tag);
|
||||
|
||||
/**
|
||||
* Validate a credential and learn it if it passes certificate and other checks
|
||||
*/
|
||||
Member::AddCredentialResult addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const RevocationCredential &rev);
|
||||
Member::AddCredentialResult addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const RevocationCredential &rev);
|
||||
|
||||
/**
|
||||
* Validate a credential and learn it if it passes certificate and other checks
|
||||
*/
|
||||
Member::AddCredentialResult addCredential(CallContext &cc, const Identity &sourcePeerIdentity, const OwnershipCredential &coo);
|
||||
Member::AddCredentialResult addCredential(const CallContext &cc, const Identity &sourcePeerIdentity, const OwnershipCredential &coo);
|
||||
|
||||
/**
|
||||
* Push credentials to a peer if timeouts indicate that we should do so
|
||||
*
|
||||
* @param to Destination peer
|
||||
*/
|
||||
void pushCredentials(CallContext &cc, const SharedPtr< Peer > &to);
|
||||
void pushCredentials(const CallContext &cc, const SharedPtr< Peer > &to);
|
||||
|
||||
/**
|
||||
* Destroy this network
|
||||
|
|
|
@ -70,7 +70,7 @@ struct _NodeObjects
|
|||
Node::Node(
|
||||
void *uPtr,
|
||||
const struct ZT_Node_Callbacks *callbacks,
|
||||
CallContext &cc) :
|
||||
const CallContext &cc) :
|
||||
m_ctx(this),
|
||||
m_store(&m_ctx),
|
||||
m_objects(nullptr),
|
||||
|
@ -154,7 +154,7 @@ Node::~Node()
|
|||
Buf::freePool();
|
||||
}
|
||||
|
||||
void Node::shutdown(CallContext &cc)
|
||||
void Node::shutdown(const CallContext &cc)
|
||||
{
|
||||
m_allNetworks_l.lock();
|
||||
m_ctx.networks->clear();
|
||||
|
@ -168,7 +168,7 @@ void Node::shutdown(CallContext &cc)
|
|||
}
|
||||
|
||||
ZT_ResultCode Node::processBackgroundTasks(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
volatile int64_t *nextBackgroundTaskDeadline)
|
||||
{
|
||||
Mutex::Lock bl(m_backgroundTasksLock);
|
||||
|
@ -241,7 +241,7 @@ ZT_ResultCode Node::join(
|
|||
uint64_t nwid,
|
||||
const ZT_Fingerprint *controllerFingerprint,
|
||||
void *uptr,
|
||||
CallContext &cc)
|
||||
const CallContext &cc)
|
||||
{
|
||||
Mutex::Lock l(m_allNetworks_l);
|
||||
|
||||
|
@ -267,7 +267,7 @@ ZT_ResultCode Node::join(
|
|||
ZT_ResultCode Node::leave(
|
||||
uint64_t nwid,
|
||||
void **uptr,
|
||||
CallContext &cc)
|
||||
const CallContext &cc)
|
||||
{
|
||||
Mutex::Lock l(m_allNetworks_l);
|
||||
|
||||
|
@ -302,7 +302,7 @@ ZT_ResultCode Node::leave(
|
|||
}
|
||||
|
||||
ZT_ResultCode Node::multicastSubscribe(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
uint64_t nwid,
|
||||
uint64_t multicastGroup,
|
||||
unsigned long multicastAdi)
|
||||
|
@ -318,7 +318,7 @@ ZT_ResultCode Node::multicastSubscribe(
|
|||
}
|
||||
|
||||
ZT_ResultCode Node::multicastUnsubscribe(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
uint64_t nwid,
|
||||
uint64_t multicastGroup,
|
||||
unsigned long multicastAdi)
|
||||
|
@ -363,7 +363,7 @@ struct p_sortPeerPtrsByAddress
|
|||
{ return (a->address() < b->address()); }
|
||||
};
|
||||
|
||||
ZT_PeerList *Node::peers(CallContext &cc) const
|
||||
ZT_PeerList *Node::peers(const CallContext &cc) const
|
||||
{
|
||||
p_ZT_PeerListPrivate *pl = nullptr;
|
||||
try {
|
||||
|
@ -509,7 +509,7 @@ void Node::setInterfaceAddresses(
|
|||
}
|
||||
|
||||
ZT_CertificateError Node::addCertificate(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
unsigned int localTrust,
|
||||
const ZT_Certificate *cert,
|
||||
const void *certData,
|
||||
|
@ -531,7 +531,7 @@ ZT_CertificateError Node::addCertificate(
|
|||
}
|
||||
|
||||
ZT_ResultCode Node::deleteCertificate(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
const void *serialNo)
|
||||
{
|
||||
if (!serialNo)
|
||||
|
@ -582,7 +582,7 @@ ZT_CertificateList *Node::listCertificates()
|
|||
}
|
||||
|
||||
int Node::sendUserMessage(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
uint64_t dest,
|
||||
uint64_t /*typeId*/,
|
||||
const void */*data*/,
|
||||
|
|
|
@ -44,35 +44,35 @@ public:
|
|||
void operator delete(void* p) { _mm_free(p); }
|
||||
#endif
|
||||
|
||||
Node(void *uPtr, const struct ZT_Node_Callbacks *callbacks, CallContext &cc);
|
||||
Node(void *uPtr, const struct ZT_Node_Callbacks *callbacks, const CallContext &cc);
|
||||
|
||||
virtual ~Node();
|
||||
|
||||
void shutdown(CallContext &cc);
|
||||
void shutdown(const CallContext &cc);
|
||||
|
||||
ZT_ResultCode processBackgroundTasks(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
volatile int64_t *nextBackgroundTaskDeadline);
|
||||
|
||||
ZT_ResultCode join(
|
||||
uint64_t nwid,
|
||||
const ZT_Fingerprint *controllerFingerprint,
|
||||
void *uptr,
|
||||
CallContext &cc);
|
||||
const CallContext &cc);
|
||||
|
||||
ZT_ResultCode leave(
|
||||
uint64_t nwid,
|
||||
void **uptr,
|
||||
CallContext &cc);
|
||||
const CallContext &cc);
|
||||
|
||||
ZT_ResultCode multicastSubscribe(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
uint64_t nwid,
|
||||
uint64_t multicastGroup,
|
||||
unsigned long multicastAdi);
|
||||
|
||||
ZT_ResultCode multicastUnsubscribe(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
uint64_t nwid,
|
||||
uint64_t multicastGroup,
|
||||
unsigned long multicastAdi);
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
ZT_NodeStatus *status) const;
|
||||
|
||||
ZT_PeerList *peers(
|
||||
CallContext &cc) const;
|
||||
const CallContext &cc) const;
|
||||
|
||||
ZT_VirtualNetworkConfig *networkConfig(
|
||||
uint64_t nwid) const;
|
||||
|
@ -97,20 +97,20 @@ public:
|
|||
unsigned int addrCount);
|
||||
|
||||
ZT_CertificateError addCertificate(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
unsigned int localTrust,
|
||||
const ZT_Certificate *cert,
|
||||
const void *certData,
|
||||
unsigned int certSize);
|
||||
|
||||
ZT_ResultCode deleteCertificate(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
const void *serialNo);
|
||||
|
||||
ZT_CertificateList *listCertificates();
|
||||
|
||||
int sendUserMessage(
|
||||
CallContext &cc,
|
||||
const CallContext &cc,
|
||||
uint64_t dest,
|
||||
uint64_t typeId,
|
||||
const void *data,
|
||||
|
|
|
@ -475,7 +475,7 @@ void Peer::resetWithinScope(const Context &ctx, const CallContext &cc, InetAddre
|
|||
m_paths[pc++].zero();
|
||||
}
|
||||
|
||||
bool Peer::directlyConnected(CallContext &cc)
|
||||
bool Peer::directlyConnected(const CallContext &cc)
|
||||
{
|
||||
if ((cc.ticks - m_lastPrioritizedPaths) > ZT_PEER_PRIORITIZE_PATHS_INTERVAL) {
|
||||
RWMutex::Lock l(m_lock);
|
||||
|
|
|
@ -355,7 +355,7 @@ public:
|
|||
/**
|
||||
* @return True if there is at least one alive direct path
|
||||
*/
|
||||
bool directlyConnected(CallContext &cc);
|
||||
bool directlyConnected(const CallContext &cc);
|
||||
|
||||
/**
|
||||
* Get all paths
|
||||
|
|
|
@ -28,7 +28,7 @@ SelfAwareness::SelfAwareness(const Context &ctx) :
|
|||
m_ctx(ctx)
|
||||
{}
|
||||
|
||||
void SelfAwareness::iam(CallContext &cc, const Identity &reporter, const int64_t receivedOnLocalSocket, const InetAddress &reporterPhysicalAddress, const InetAddress &myPhysicalAddress, bool trusted)
|
||||
void SelfAwareness::iam(const CallContext &cc, const Identity &reporter, const int64_t receivedOnLocalSocket, const InetAddress &reporterPhysicalAddress, const InetAddress &myPhysicalAddress, bool trusted)
|
||||
{
|
||||
const InetAddress::IpScope scope = myPhysicalAddress.ipScope();
|
||||
|
||||
|
@ -68,7 +68,7 @@ void SelfAwareness::iam(CallContext &cc, const Identity &reporter, const int64_t
|
|||
}
|
||||
}
|
||||
|
||||
void SelfAwareness::clean(CallContext &cc)
|
||||
void SelfAwareness::clean(const CallContext &cc)
|
||||
{
|
||||
Mutex::Lock l(m_phy_l);
|
||||
for (Map< p_PhySurfaceKey, p_PhySurfaceEntry >::iterator i(m_phy.begin()); i != m_phy.end();) {
|
||||
|
|
|
@ -46,12 +46,12 @@ public:
|
|||
* @param myPhysicalAddress Physical address that peer says we have
|
||||
* @param trusted True if this peer is trusted as an authority to inform us of external address changes
|
||||
*/
|
||||
void iam(CallContext &cc, const Identity &reporter, int64_t receivedOnLocalSocket, const InetAddress &reporterPhysicalAddress, const InetAddress &myPhysicalAddress, bool trusted);
|
||||
void iam(const CallContext &cc, const Identity &reporter, int64_t receivedOnLocalSocket, const InetAddress &reporterPhysicalAddress, const InetAddress &myPhysicalAddress, bool trusted);
|
||||
|
||||
/**
|
||||
* Clean up database periodically
|
||||
*/
|
||||
void clean(CallContext &cc);
|
||||
void clean(const CallContext &cc);
|
||||
|
||||
/**
|
||||
* Get external address consensus, which is the statistical "mode" of external addresses.
|
||||
|
|
Loading…
Add table
Reference in a new issue