mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-03-10 14:34:16 +00:00
Removal of more mem*() calls.
This commit is contained in:
parent
b56753ea9f
commit
2600b1f144
@ -72,9 +72,13 @@ class Capability : public Credential
|
|||||||
public:
|
public:
|
||||||
static inline Credential::Type credentialType() { return Credential::CREDENTIAL_TYPE_CAPABILITY; }
|
static inline Credential::Type credentialType() { return Credential::CREDENTIAL_TYPE_CAPABILITY; }
|
||||||
|
|
||||||
Capability()
|
Capability() :
|
||||||
|
_nwid(0),
|
||||||
|
_ts(0),
|
||||||
|
_id(0),
|
||||||
|
_maxCustodyChainLength(0),
|
||||||
|
_ruleCount(0)
|
||||||
{
|
{
|
||||||
memset(this,0,sizeof(Capability));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,15 +89,14 @@ public:
|
|||||||
* @param rules Network flow rules for this capability
|
* @param rules Network flow rules for this capability
|
||||||
* @param ruleCount Number of flow rules
|
* @param ruleCount Number of flow rules
|
||||||
*/
|
*/
|
||||||
Capability(uint32_t id,uint64_t nwid,int64_t ts,unsigned int mccl,const ZT_VirtualNetworkRule *rules,unsigned int ruleCount)
|
Capability(uint32_t id,uint64_t nwid,int64_t ts,unsigned int mccl,const ZT_VirtualNetworkRule *rules,unsigned int ruleCount) :
|
||||||
|
_nwid(nwid),
|
||||||
|
_ts(ts),
|
||||||
|
_id(id),
|
||||||
|
_maxCustodyChainLength((mccl > 0) ? ((mccl < ZT_MAX_CAPABILITY_CUSTODY_CHAIN_LENGTH) ? mccl : (unsigned int)ZT_MAX_CAPABILITY_CUSTODY_CHAIN_LENGTH) : 1),
|
||||||
|
_ruleCount((ruleCount < ZT_MAX_CAPABILITY_RULES) ? ruleCount : ZT_MAX_CAPABILITY_RULES)
|
||||||
{
|
{
|
||||||
memset(this,0,sizeof(Capability));
|
if (_ruleCount > 0)
|
||||||
_nwid = nwid;
|
|
||||||
_ts = ts;
|
|
||||||
_id = id;
|
|
||||||
_maxCustodyChainLength = (mccl > 0) ? ((mccl < ZT_MAX_CAPABILITY_CUSTODY_CHAIN_LENGTH) ? mccl : (unsigned int)ZT_MAX_CAPABILITY_CUSTODY_CHAIN_LENGTH) : 1;
|
|
||||||
_ruleCount = (ruleCount < ZT_MAX_CAPABILITY_RULES) ? ruleCount : ZT_MAX_CAPABILITY_RULES;
|
|
||||||
if (_ruleCount)
|
|
||||||
memcpy(_rules,rules,sizeof(ZT_VirtualNetworkRule) * _ruleCount);
|
memcpy(_rules,rules,sizeof(ZT_VirtualNetworkRule) * _ruleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,9 +65,12 @@ class Tag : public Credential
|
|||||||
public:
|
public:
|
||||||
static inline Credential::Type credentialType() { return Credential::CREDENTIAL_TYPE_TAG; }
|
static inline Credential::Type credentialType() { return Credential::CREDENTIAL_TYPE_TAG; }
|
||||||
|
|
||||||
Tag()
|
Tag() :
|
||||||
|
_id(0),
|
||||||
|
_value(0),
|
||||||
|
_networkId(0),
|
||||||
|
_ts(0)
|
||||||
{
|
{
|
||||||
memset(this,0,sizeof(Tag));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user