private OFPortStatus portStatus(boolean up, int port) { OFPortDesc desc = portDesc(port, up); OFPortStatus status = OFFactoryVer10.INSTANCE.buildPortStatus() .setDesc(desc) .setReason(up ? OFPortReason.ADD : OFPortReason.DELETE).build(); return status; }
private static OFPortDesc portDesc(int port, boolean up) { OFPortDesc.Builder builder = OFFactoryVer10.INSTANCE.buildPortDesc(); builder.setPortNo(OFPort.of(port)); if (!up) { builder.setConfig(Collections.singleton(OFPortConfig.PORT_DOWN)); } return builder.build(); }
private static OFPortDesc portDesc(int port) { OFPortDesc.Builder builder = OFFactoryVer10.INSTANCE.buildPortDesc(); builder.setPortNo(OFPort.of(port)); return builder.build(); }
private OFPortDesc portDesc(PortNumber port) { OFPortDesc.Builder builder = OFFactoryVer10.INSTANCE.buildPortDesc(); builder.setPortNo(OFPort.of((int) port.toLong())); return builder.build(); }