use of org.onlab.packet.Ip4Prefix in project up4 by omec-project.
the class UePoolInsertCommand method doExecute.
@Override
protected void doExecute() throws Exception {
Up4AdminService app = get(Up4AdminService.class);
Ip4Prefix poolPrefix = Ip4Prefix.valueOf(this.poolPrefix);
print("Adding UE IPv4 address pool prefix: %s", poolPrefix.toString());
app.adminApply(UpfInterface.createUePoolFrom(poolPrefix, sliceId));
}
use of org.onlab.packet.Ip4Prefix in project up4 by omec-project.
the class Up4Config method uePools.
/**
* Gets the list of UE IPv4 address pools assigned to the device.
*
* @return UE IPv4 address pools assigned to the device or empty list if not configured
*/
public List<Ip4Prefix> uePools() {
if (!object.has(UE_POOLS)) {
return ImmutableList.of();
}
List<Ip4Prefix> uePools = new ArrayList<>();
ArrayNode uePoolsNode = (ArrayNode) object.path(UE_POOLS);
for (JsonNode uePoolNode : uePoolsNode) {
String uePoolString = uePoolNode.asText("");
if (uePoolString.equals("")) {
return null;
}
uePools.add(Ip4Prefix.valueOf(uePoolString));
}
return ImmutableList.copyOf(uePools);
}
Aggregations