use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.NumericOperand in project bgpcep by opendaylight.
the class FSPortHandler method parsePort.
private static List<Ports> parsePort(final ByteBuf nlri) {
final List<Ports> ports = new ArrayList<>();
boolean end = false;
// we can do this as all fields will be rewritten in the cycle
final PortsBuilder builder = new PortsBuilder();
while (!end) {
final byte b = nlri.readByte();
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(Uint16.valueOf(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length))));
end = op.getEndOfList();
ports.add(builder.build());
}
return ports;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.NumericOperand in project bgpcep by opendaylight.
the class FSPacketLengthHandler method parsePacketLength.
private static List<PacketLengths> parsePacketLength(final ByteBuf nlri) {
final List<PacketLengths> packetLengths = new ArrayList<>();
boolean end = false;
// we can do this as all fields will be rewritten in the cycle
final PacketLengthsBuilder builder = new PacketLengthsBuilder();
while (!end) {
final byte b = nlri.readByte();
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(Uint16.valueOf(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length))));
end = op.getEndOfList();
packetLengths.add(builder.build());
}
return packetLengths;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.NumericOperand in project bgpcep by opendaylight.
the class FSDestinationPortHandler method parseDestinationPort.
private static List<DestinationPorts> parseDestinationPort(final ByteBuf nlri) {
final List<DestinationPorts> ports = new ArrayList<>();
boolean end = false;
// we can do this as all fields will be rewritten in the cycle
final DestinationPortsBuilder builder = new DestinationPortsBuilder();
while (!end) {
final byte b = nlri.readByte();
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(Uint16.valueOf(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length))));
end = op.getEndOfList();
ports.add(builder.build());
}
return ports;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.NumericOperand in project bgpcep by opendaylight.
the class FSIcmpCodeHandler method parseIcmpCode.
private static List<Codes> parseIcmpCode(final ByteBuf nlri) {
final List<Codes> codes = new ArrayList<>();
boolean end = false;
// we can do this as all fields will be rewritten in the cycle
final CodesBuilder builder = new CodesBuilder();
while (!end) {
final byte b = nlri.readByte();
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(ByteBufUtils.readUint8(nlri));
end = op.getEndOfList();
codes.add(builder.build());
}
return codes;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.NumericOperand in project bgpcep by opendaylight.
the class FSIpProtocolHandler method parseProtocolIp.
private static List<ProtocolIps> parseProtocolIp(final ByteBuf nlri) {
final List<ProtocolIps> ips = new ArrayList<>();
boolean end = false;
// we can do this as all fields will be rewritten in the cycle
final ProtocolIpsBuilder builder = new ProtocolIpsBuilder();
while (!end) {
final byte b = nlri.readByte();
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(ByteBufUtils.readUint8(nlri));
end = op.getEndOfList();
ips.add(builder.build());
}
return ips;
}
Aggregations