Search in sources :

Example 31 with Ip4Prefix

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));
}
Also used : Up4AdminService(org.omecproject.up4.impl.Up4AdminService) Ip4Prefix(org.onlab.packet.Ip4Prefix)

Example 32 with Ip4Prefix

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);
}
Also used : ArrayList(java.util.ArrayList) JsonNode(com.fasterxml.jackson.databind.JsonNode) Ip4Prefix(org.onlab.packet.Ip4Prefix) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode)

Aggregations

Ip4Prefix (org.onlab.packet.Ip4Prefix)32 Ip4Address (org.onlab.packet.Ip4Address)20 Test (org.junit.Test)15 ArrayList (java.util.ArrayList)11 Ip6Prefix (org.onlab.packet.Ip6Prefix)10 Ip6Address (org.onlab.packet.Ip6Address)6 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)4 LinkedList (java.util.LinkedList)2 Up4AdminService (org.omecproject.up4.impl.Up4AdminService)2 OduSignalId (org.onosproject.net.OduSignalId)2 UpfInterface (org.onosproject.net.behaviour.upf.UpfInterface)2 DefaultTrafficSelector (org.onosproject.net.flow.DefaultTrafficSelector)2 TrafficSelector (org.onosproject.net.flow.TrafficSelector)2 OFOxm (org.projectfloodlight.openflow.protocol.oxm.OFOxm)2 CircuitSignalID (org.projectfloodlight.openflow.types.CircuitSignalID)2 IPv4Address (org.projectfloodlight.openflow.types.IPv4Address)2 IPv6Address (org.projectfloodlight.openflow.types.IPv6Address)2 OFVlanVidMatch (org.projectfloodlight.openflow.types.OFVlanVidMatch)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1