More Go boilerplate.

This commit is contained in:
Adam Ierymenko 2019-09-20 14:11:15 -07:00
parent ae2120eb96
commit ed2024285d
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
7 changed files with 154 additions and 11 deletions

View file

@ -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 {