Search in sources :

Example 11 with Up4Service

use of org.omecproject.up4.Up4Service in project up4 by omec-project.

the class SessionDownlinkCommand method doExecute.

@Override
protected void doExecute() throws Exception {
    Up4Service app = get(Up4Service.class);
    UpfSessionDownlink.Builder sessBuilder = UpfSessionDownlink.builder().needsBuffering(buff).needsDropping(drop).withUeAddress(Ip4Address.valueOf(ueAddr));
    if (tunnelPeer != -1) {
        sessBuilder.withGtpTunnelPeerId(tunnelPeer);
    }
    if (sessMeterIdx != -1) {
        sessBuilder.withSessionMeterIdx(sessMeterIdx);
    }
    if (delete) {
        app.delete(sessBuilder.build());
    } else {
        app.apply(sessBuilder.build());
    }
}
Also used : Up4Service(org.omecproject.up4.Up4Service) UpfSessionDownlink(org.onosproject.net.behaviour.upf.UpfSessionDownlink)

Example 12 with Up4Service

use of org.omecproject.up4.Up4Service in project up4 by omec-project.

the class TerminationUplinkCommand method doExecute.

@Override
protected void doExecute() throws Exception {
    Up4Service app = get(Up4Service.class);
    UpfTerminationUplink.Builder termBuilder = UpfTerminationUplink.builder().needsDropping(drop).withUeSessionId(Ip4Address.valueOf(ueAddr)).withApplicationId(appId).withCounterId(counterID);
    if (trafficClass != -1) {
        termBuilder.withTrafficClass(trafficClass);
    }
    if (appMeterIdx != -1) {
        termBuilder.withAppMeterIdx(appMeterIdx);
    }
    if (delete) {
        app.delete(termBuilder.build());
    } else {
        app.apply(termBuilder.build());
    }
}
Also used : Up4Service(org.omecproject.up4.Up4Service) UpfTerminationUplink(org.onosproject.net.behaviour.upf.UpfTerminationUplink)

Example 13 with Up4Service

use of org.omecproject.up4.Up4Service in project up4 by omec-project.

the class UpfAppMeterCommand method doExecute.

@Override
protected void doExecute() throws Exception {
    Up4Service app = get(Up4Service.class);
    if (delete) {
        app.apply(UpfMeter.resetApplication(cellId));
    } else {
        if (pir == null || pburst == null) {
            print("PIR and PBURST must be provided when creating a meter");
            return;
        }
        if (cir == null || cburst == null) {
            print("CIR and CBURST must be provided when creating a meter");
            return;
        }
        UpfMeter.Builder appMeterBuilder = UpfMeter.builder().setCellId(cellId).setPeakBand(pir, pburst).setApplication().setCommittedBand(cir, cburst);
        app.apply(appMeterBuilder.build());
    }
}
Also used : Up4Service(org.omecproject.up4.Up4Service) UpfMeter(org.onosproject.net.behaviour.upf.UpfMeter)

Aggregations

Up4Service (org.omecproject.up4.Up4Service)12 Up4AdminService (org.omecproject.up4.impl.Up4AdminService)3 Ip4Address (org.onlab.packet.Ip4Address)2 UpfMeter (org.onosproject.net.behaviour.upf.UpfMeter)2 UpfProgrammableException (org.onosproject.net.behaviour.upf.UpfProgrammableException)2 UpfTerminationDownlink (org.onosproject.net.behaviour.upf.UpfTerminationDownlink)2 UpfTerminationUplink (org.onosproject.net.behaviour.upf.UpfTerminationUplink)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 List (java.util.List)1 Command (org.apache.karaf.shell.api.action.Command)1 Option (org.apache.karaf.shell.api.action.Option)1 Service (org.apache.karaf.shell.api.action.lifecycle.Service)1 Up4Translator (org.omecproject.up4.Up4Translator)1 Up4Store (org.omecproject.up4.impl.Up4Store)1 AbstractShellCommand (org.onosproject.cli.AbstractShellCommand)1 UpfApplication (org.onosproject.net.behaviour.upf.UpfApplication)1 UpfCounter (org.onosproject.net.behaviour.upf.UpfCounter)1 UpfEntity (org.onosproject.net.behaviour.upf.UpfEntity)1 UpfEntityType (org.onosproject.net.behaviour.upf.UpfEntityType)1