@Test public void testGetLsAckBodyAsByteArray() throws Exception { lsaHeader = createLsaHeader(); opaqueLsaHeader = new OpaqueLsaHeader(); lsAck.addLinkStateHeader(lsaHeader); lsAck.addLinkStateHeader(opaqueLsaHeader); result = lsAck.getLsAckBodyAsByteArray(); assertThat(result, is(notNullValue())); }
public byte[] getLsAckBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { for (LsaHeader lsaHeader : linkStateHeaders) { if (lsaHeader.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AS_OPAQUE_LSA) { OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader; bodyLst.addAll(Bytes.asList(header.getOpaqueLsaHeaderAsByteArray())); } else { bodyLst.addAll(Bytes.asList(lsaHeader.getLsaHeaderAsByteArray())); } } } catch (Exception e) { log.debug("Error::getLsAckBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); }
LsAcknowledge extends OspfPacketHeader { public byte[] getLsAckBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { for (LsaHeader lsaHeader : linkStateHeaders) { if (lsaHeader.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AS_OPAQUE_LSA) { OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader; bodyLst.addAll(Bytes.asList(header.getOpaqueLsaHeaderAsByteArray())); } else { bodyLst.addAll(Bytes.asList(lsaHeader.getLsaHeaderAsByteArray())); } } } catch (Exception e) { log.debug("Error::getLsAckBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); } }
LsAcknowledge extends OspfPacketHeader { public byte[] getLsAckBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { for (LsaHeader lsaHeader : linkStateHeaders) { if (lsaHeader.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AS_OPAQUE_LSA) { OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader; bodyLst.addAll(Bytes.asList(header.getOpaqueLsaHeaderAsByteArray())); } else { bodyLst.addAll(Bytes.asList(lsaHeader.getLsaHeaderAsByteArray())); } } } catch (Exception e) { log.debug("Error::getLsAckBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); } LsAcknowledge();  LsAcknowledge(OspfPacketHeader ospfHeader); }
LsAcknowledge extends OspfPacketHeader { public byte[] getLsAckBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { for (LsaHeader lsaHeader : linkStateHeaders) { if (lsaHeader.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AS_OPAQUE_LSA) { OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader; bodyLst.addAll(Bytes.asList(header.getOpaqueLsaHeaderAsByteArray())); } else { bodyLst.addAll(Bytes.asList(lsaHeader.getLsaHeaderAsByteArray())); } } } catch (Exception e) { log.debug("Error::getLsAckBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); } LsAcknowledge();  LsAcknowledge(OspfPacketHeader ospfHeader); List<LsaHeader> getLinkStateHeaders(); void addLinkStateHeader(LsaHeader lsaHeader); @Override OspfPacketType ospfMessageType(); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] getLsAckAsByteArray(); byte[] getLsAckBodyAsByteArray(); @Override String toString(); }
LsAcknowledge extends OspfPacketHeader { public byte[] getLsAckBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { for (LsaHeader lsaHeader : linkStateHeaders) { if (lsaHeader.lsType() == OspfParameters.LINK_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AREA_LOCAL_OPAQUE_LSA || lsaHeader.lsType() == OspfParameters.AS_OPAQUE_LSA) { OpaqueLsaHeader header = (OpaqueLsaHeader) lsaHeader; bodyLst.addAll(Bytes.asList(header.getOpaqueLsaHeaderAsByteArray())); } else { bodyLst.addAll(Bytes.asList(lsaHeader.getLsaHeaderAsByteArray())); } } } catch (Exception e) { log.debug("Error::getLsAckBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); } LsAcknowledge();  LsAcknowledge(OspfPacketHeader ospfHeader); List<LsaHeader> getLinkStateHeaders(); void addLinkStateHeader(LsaHeader lsaHeader); @Override OspfPacketType ospfMessageType(); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] getLsAckAsByteArray(); byte[] getLsAckBodyAsByteArray(); @Override String toString();  }