use of org.omecproject.up4.Up4Service in project up4 by omec-project.
the class TerminationDownlinkCommand method doExecute.
@Override
protected void doExecute() throws Exception {
Up4Service app = get(Up4Service.class);
UpfTerminationDownlink.Builder termBuilder = UpfTerminationDownlink.builder().needsDropping(drop).withUeSessionId(Ip4Address.valueOf(ueAddr)).withApplicationId(appId).withCounterId(counterID);
if (trafficClass != -1) {
termBuilder.withTrafficClass(trafficClass);
}
if (teid != -1) {
termBuilder.withTeid(teid);
}
if (qfi != -1) {
termBuilder.withQfi(qfi);
}
if (appMeterIdx != -1) {
termBuilder.withAppMeterIdx(appMeterIdx);
}
if (delete) {
app.delete(termBuilder.build());
} else {
app.apply(termBuilder.build());
}
}
use of org.omecproject.up4.Up4Service in project up4 by omec-project.
the class UpfSessionMeterCommand method doExecute.
@Override
protected void doExecute() throws Exception {
Up4Service app = get(Up4Service.class);
if (delete) {
app.apply(UpfMeter.resetSession(cellId));
} else {
if (pir == null || pburst == null) {
print("PIR and PBURST must be provided when creating a meter");
return;
}
UpfMeter sessionMeter = UpfMeter.builder().setCellId(cellId).setPeakBand(pir, pburst).setSession().build();
app.apply(sessionMeter);
}
}
use of org.omecproject.up4.Up4Service in project up4 by omec-project.
the class SessionUplinkCommand method doExecute.
@Override
protected void doExecute() throws Exception {
Up4Service app = get(Up4Service.class);
UpfSessionUplink.Builder sessionBuilder = UpfSessionUplink.builder().needsDropping(drop).withTunDstAddr(Ip4Address.valueOf(n3Addr)).withTeid(teid);
if (sessMeterIdx != -1) {
sessionBuilder.withSessionMeterIdx(sessMeterIdx);
}
if (delete) {
app.delete(sessionBuilder.build());
} else {
app.apply(sessionBuilder.build());
}
}
use of org.omecproject.up4.Up4Service in project up4 by omec-project.
the class ClearFlowsCommand method doExecute.
@Override
protected void doExecute() throws UpfProgrammableException {
Up4Service app = get(Up4Service.class);
Up4AdminService adminApp = get(Up4AdminService.class);
print("Clearing all currently installed UE sessions.");
app.deleteAll(UpfEntityType.APPLICATION);
app.deleteAll(UpfEntityType.SESSION_DOWNLINK);
app.deleteAll(UpfEntityType.SESSION_UPLINK);
app.deleteAll(UpfEntityType.TERMINATION_DOWNLINK);
app.deleteAll(UpfEntityType.TERMINATION_UPLINK);
app.deleteAll(UpfEntityType.TUNNEL_PEER);
adminApp.resetAllSessionMeters();
adminApp.resetAllApplicationMeters();
}
use of org.omecproject.up4.Up4Service in project up4 by omec-project.
the class ApplicationFilteringCommand method doExecute.
@Override
protected void doExecute() throws Exception {
Up4Service app = get(Up4Service.class);
UpfApplication.Builder appFilterBuilder = UpfApplication.builder().withAppId(appId).withPriority(priority).withSliceId(sliceId);
boolean oneFilter = false;
if (ipPrefix != null) {
appFilterBuilder.withIp4Prefix(Ip4Prefix.valueOf(ipPrefix));
oneFilter = true;
}
if (l4Port != null) {
appFilterBuilder.withL4PortRange(Range.closed(l4Port, l4Port));
oneFilter = true;
}
if (ipProto != null) {
appFilterBuilder.withIpProto(ipProto);
oneFilter = true;
}
if (!oneFilter) {
print("At least one filter (IpPrefix, L4Port, IpProto) must be provided");
return;
}
if (delete) {
app.delete(appFilterBuilder.build());
} else {
app.apply(appFilterBuilder.build());
}
}
Aggregations