@Test public void testReadFrom() throws Exception { channelBuffer = ChannelBuffers.copiedBuffer(helloL1L2); l1L2HelloPdu.readFrom(channelBuffer); assertThat(l1L2HelloPdu, is(notNullValue())); }
@Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setPriority(channelBuffer.readByte()); tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setLanId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } }
L1L2HelloPdu extends HelloPdu { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setPriority(channelBuffer.readByte()); tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setLanId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } }
L1L2HelloPdu extends HelloPdu { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setPriority(channelBuffer.readByte()); tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setLanId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } L1L2HelloPdu(IsisHeader isisHeader); }
L1L2HelloPdu extends HelloPdu { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setPriority(channelBuffer.readByte()); tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setLanId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } L1L2HelloPdu(IsisHeader isisHeader); String lanId(); void setLanId(String lanId); byte priority(); void setPriority(byte priority); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] l1l2IsisPduHeader(); byte[] l1l2HelloPduBody(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
L1L2HelloPdu extends HelloPdu { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setPriority(channelBuffer.readByte()); tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setLanId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } L1L2HelloPdu(IsisHeader isisHeader); String lanId(); void setLanId(String lanId); byte priority(); void setPriority(byte priority); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] l1l2IsisPduHeader(); byte[] l1l2HelloPduBody(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }