use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.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(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length)));
end = op.isEndOfList();
packetLengths.add(builder.build());
}
return packetLengths;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.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(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length)));
end = op.isEndOfList();
ports.add(builder.build());
}
return ports;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.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(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length)));
end = op.isEndOfList();
ports.add(builder.build());
}
return ports;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.NumericOperand in project bgpcep by opendaylight.
the class FSDscpHandler method parseDscps.
private static List<Dscps> parseDscps(final ByteBuf nlri) {
final List<Dscps> dscps = new ArrayList<>();
boolean end = false;
// we can do this as all fields will be rewritten in the cycle
final DscpsBuilder builder = new DscpsBuilder();
while (!end) {
final byte b = nlri.readByte();
// RFC does not specify operator
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(new Dscp(nlri.readUnsignedByte()));
end = op.isEndOfList();
dscps.add(builder.build());
}
return dscps;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.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(nlri.readUnsignedByte());
end = op.isEndOfList();
codes.add(builder.build());
}
return codes;
}
Aggregations