node.networkConfig() now creates ArrayLists of multicast subscriptions and assigned addresses
Signed-off-by: Grant Limberg <glimberg@gmail.com>
This commit is contained in:
parent
1bea940323
commit
7f6556eba0
4 changed files with 176 additions and 19 deletions
|
@ -933,16 +933,27 @@ JNIEXPORT jobject JNICALL Java_com_zerotierone_sdk_Node_networkConfig
|
|||
env->SetBooleanField(vnetConfigObj, portErrorField, vnetConfig->portError);
|
||||
|
||||
|
||||
jobject mcastSubsArrayObj = NULL;
|
||||
jobject assignedAddrArrayObj = NULL;
|
||||
|
||||
|
||||
jobject mcastSubsArrayObj = newArrayList(env);
|
||||
for(unsigned int i = 0; i < vnetConfig->multicastSubscriptionCount; ++i)
|
||||
{
|
||||
jobject mcastObj = newMulticastGroup(env, vnetConfig->multicastSubscriptions[i]);
|
||||
appendItemToArrayList(env, mcastSubsArrayObj, mcastObj);
|
||||
}
|
||||
env->SetObjectField(vnetConfigObj, multicastSubscriptionsField, mcastSubsArrayObj);
|
||||
|
||||
|
||||
jobject assignedAddrArrayObj = newArrayList(env);
|
||||
for(unsigned int i = 0; i < vnetConfig->assignedAddressCount; ++i)
|
||||
{
|
||||
jobject inetAddrObj = newInetAddress(env, vnetConfig->assignedAddresses[i]);
|
||||
appendItemToArrayList(env, assignedAddrArrayObj, inetAddrObj);
|
||||
}
|
||||
|
||||
env->SetObjectField(vnetConfigObj, assignedAddressesField, assignedAddrArrayObj);
|
||||
|
||||
ZT1_Node_freeQueryResult(node, vnetConfig);
|
||||
vnetConfig = NULL;
|
||||
|
||||
|
||||
return vnetConfigObj;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue