mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-03 03:36:41 +00:00
multicastSubscribe() and multicastUnsubscribe()
Signed-off-by: Grant Limberg <glimberg@gmail.com>
This commit is contained in:
parent
b078d69372
commit
1308f02b93
@ -565,6 +565,66 @@ JNIEXPORT jobject JNICALL Java_com_zerotierone_sdk_Node_leave
|
|||||||
return createResultObject(env, rc);
|
return createResultObject(env, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_zerotierone_sdk_Node
|
||||||
|
* Method: multicastSubscribe
|
||||||
|
* Signature: (JJJJ)Lcom/zerotierone/sdk/ResultCode;
|
||||||
|
*/
|
||||||
|
JNIEXPORT jobject JNICALL Java_com_zerotierone_sdk_Node_multicastSubscribe
|
||||||
|
(JNIEnv *env, jobject obj,
|
||||||
|
jlong id,
|
||||||
|
jlong in_nwid,
|
||||||
|
jlong in_multicastGroup,
|
||||||
|
jlong in_multicastAdi)
|
||||||
|
{
|
||||||
|
uint64_t nodeId = (uint64_t) id;
|
||||||
|
ZT1_Node *node = findNode(nodeId);
|
||||||
|
if(node == NULL)
|
||||||
|
{
|
||||||
|
// cannot find valid node. We should never get here.
|
||||||
|
return createResultObject(env, ZT1_RESULT_FATAL_ERROR_INTERNAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t nwid = (uint64_t)in_nwid;
|
||||||
|
uint64_t multicastGroup = (uint64_t)in_multicastGroup;
|
||||||
|
uint64_t multicastAdi = (uint64_t)in_multicastAdi;
|
||||||
|
|
||||||
|
ZT1_ResultCode rc = ZT1_Node_multicastSubscribe(
|
||||||
|
node, nwid, multicastGroup, multicastAdi);
|
||||||
|
|
||||||
|
return createResultObject(env, rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_zerotierone_sdk_Node
|
||||||
|
* Method: multicastUnsubscribe
|
||||||
|
* Signature: (JJJJ)Lcom/zerotierone/sdk/ResultCode;
|
||||||
|
*/
|
||||||
|
JNIEXPORT jobject JNICALL Java_com_zerotierone_sdk_Node_multicastUnsubscribe
|
||||||
|
(JNIEnv *env, jobject obj,
|
||||||
|
jlong id,
|
||||||
|
jlong in_nwid,
|
||||||
|
jlong in_multicastGroup,
|
||||||
|
jlong in_multicastAdi)
|
||||||
|
{
|
||||||
|
uint64_t nodeId = (uint64_t) id;
|
||||||
|
ZT1_Node *node = findNode(nodeId);
|
||||||
|
if(node == NULL)
|
||||||
|
{
|
||||||
|
// cannot find valid node. We should never get here.
|
||||||
|
return createResultObject(env, ZT1_RESULT_FATAL_ERROR_INTERNAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t nwid = (uint64_t)in_nwid;
|
||||||
|
uint64_t multicastGroup = (uint64_t)in_multicastGroup;
|
||||||
|
uint64_t multicastAdi = (uint64_t)in_multicastAdi;
|
||||||
|
|
||||||
|
ZT1_ResultCode rc = ZT1_Node_multicastUnsubscribe(
|
||||||
|
node, nwid, multicastGroup, multicastAdi);
|
||||||
|
|
||||||
|
return createResultObject(env, rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
Loading…
Reference in New Issue
Block a user