More Go boilerplate.
This commit is contained in:
parent
ae2120eb96
commit
ed2024285d
7 changed files with 154 additions and 11 deletions
|
@ -41,8 +41,8 @@ public:
|
|||
((((uint64_t)d) & 0xffULL) << 16) |
|
||||
((((uint64_t)e) & 0xffULL) << 8) |
|
||||
(((uint64_t)f) & 0xffULL) ) {}
|
||||
ZT_ALWAYS_INLINE MAC(const void *bits,unsigned int len) { setTo(bits,len); }
|
||||
ZT_ALWAYS_INLINE MAC(const Address &ztaddr,uint64_t nwid) { fromAddress(ztaddr,nwid); }
|
||||
ZT_ALWAYS_INLINE MAC(const void *bits,unsigned int len) { setTo(bits,len); }
|
||||
ZT_ALWAYS_INLINE MAC(const Address &ztaddr,uint64_t nwid) { fromAddress(ztaddr,nwid); }
|
||||
ZT_ALWAYS_INLINE MAC(const uint64_t m) : _m(m & 0xffffffffffffULL) {}
|
||||
|
||||
/**
|
||||
|
|
|
@ -598,6 +598,14 @@ ZT_VirtualNetworkList *Node::networks() const
|
|||
return nl;
|
||||
}
|
||||
|
||||
void Node::setNetworkUserPtr(uint64_t nwid,void *ptr)
|
||||
{
|
||||
Mutex::Lock _l(_networks_m);
|
||||
const SharedPtr<Network> *const nw = _networks.get(nwid);
|
||||
if (nw)
|
||||
*((*nw)->userPtr()) = ptr;
|
||||
}
|
||||
|
||||
void Node::freeQueryResult(void *qr)
|
||||
{
|
||||
if (qr)
|
||||
|
@ -1011,6 +1019,13 @@ ZT_VirtualNetworkList *ZT_Node_networks(ZT_Node *node)
|
|||
}
|
||||
}
|
||||
|
||||
void ZT_Node_setNetworkUserPtr(ZT_Node *node,uint64_t nwid,void *ptr)
|
||||
{
|
||||
try {
|
||||
reinterpret_cast<ZeroTier::Node *>(node)->setNetworkUserPtr(nwid,ptr);
|
||||
} catch ( ... ) {}
|
||||
}
|
||||
|
||||
void ZT_Node_freeQueryResult(ZT_Node *node,void *qr)
|
||||
{
|
||||
try {
|
||||
|
|
|
@ -102,6 +102,7 @@ public:
|
|||
ZT_PeerList *peers() const;
|
||||
ZT_VirtualNetworkConfig *networkConfig(uint64_t nwid) const;
|
||||
ZT_VirtualNetworkList *networks() const;
|
||||
void setNetworkUserPtr(uint64_t nwid,void *ptr);
|
||||
void freeQueryResult(void *qr);
|
||||
int addLocalInterfaceAddress(const struct sockaddr_storage *addr);
|
||||
void clearLocalInterfaceAddresses();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue