@Test public void testGetHelloHeaderAsByteArray() throws Exception { result3 = helloPacket.getHelloHeaderAsByteArray(); assertThat(result3, is(notNullValue())); }
public byte[] getHelloHeaderAsByteArray() { List<Byte> headerLst = new ArrayList<>(); try { headerLst.add((byte) this.ospfVersion()); headerLst.add((byte) this.ospfType()); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.ospfPacLength()))); headerLst.addAll(Bytes.asList(this.routerId().toOctets())); headerLst.addAll(Bytes.asList(this.areaId().toOctets())); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.checksum()))); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.authType()))); byte[] auth = new byte[OspfUtil.EIGHT_BYTES]; headerLst.addAll(Bytes.asList(auth)); } catch (Exception e) { log.debug("Error::getHelloHeaderAsByteArray {}", e.getMessage()); return Bytes.toArray(headerLst); } return Bytes.toArray(headerLst); }
HelloPacket extends OspfPacketHeader { public byte[] getHelloHeaderAsByteArray() { List<Byte> headerLst = new ArrayList<>(); try { headerLst.add((byte) this.ospfVersion()); headerLst.add((byte) this.ospfType()); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.ospfPacLength()))); headerLst.addAll(Bytes.asList(this.routerId().toOctets())); headerLst.addAll(Bytes.asList(this.areaId().toOctets())); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.checksum()))); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.authType()))); byte[] auth = new byte[OspfUtil.EIGHT_BYTES]; headerLst.addAll(Bytes.asList(auth)); } catch (Exception e) { log.debug("Error::getHelloHeaderAsByteArray {}", e.getMessage()); return Bytes.toArray(headerLst); } return Bytes.toArray(headerLst); } }
HelloPacket extends OspfPacketHeader { public byte[] getHelloHeaderAsByteArray() { List<Byte> headerLst = new ArrayList<>(); try { headerLst.add((byte) this.ospfVersion()); headerLst.add((byte) this.ospfType()); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.ospfPacLength()))); headerLst.addAll(Bytes.asList(this.routerId().toOctets())); headerLst.addAll(Bytes.asList(this.areaId().toOctets())); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.checksum()))); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.authType()))); byte[] auth = new byte[OspfUtil.EIGHT_BYTES]; headerLst.addAll(Bytes.asList(auth)); } catch (Exception e) { log.debug("Error::getHelloHeaderAsByteArray {}", e.getMessage()); return Bytes.toArray(headerLst); } return Bytes.toArray(headerLst); } HelloPacket();  HelloPacket(OspfPacketHeader ospfHeader); }
HelloPacket extends OspfPacketHeader { public byte[] getHelloHeaderAsByteArray() { List<Byte> headerLst = new ArrayList<>(); try { headerLst.add((byte) this.ospfVersion()); headerLst.add((byte) this.ospfType()); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.ospfPacLength()))); headerLst.addAll(Bytes.asList(this.routerId().toOctets())); headerLst.addAll(Bytes.asList(this.areaId().toOctets())); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.checksum()))); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.authType()))); byte[] auth = new byte[OspfUtil.EIGHT_BYTES]; headerLst.addAll(Bytes.asList(auth)); } catch (Exception e) { log.debug("Error::getHelloHeaderAsByteArray {}", e.getMessage()); return Bytes.toArray(headerLst); } return Bytes.toArray(headerLst); } HelloPacket();  HelloPacket(OspfPacketHeader ospfHeader); Ip4Address networkMask(); void setNetworkMask(Ip4Address networkMask); Ip4Address bdr(); void setBdr(Ip4Address bdr); Ip4Address dr(); void setDr(Ip4Address dr); void addNeighbor(Ip4Address neighborID); boolean containsNeighbour(Ip4Address neighborID); int options(); void setOptions(int options); int routerPriority(); void setRouterPriority(int routerPriority); int helloInterval(); void setHelloInterval(int helloInterval); int routerDeadInterval(); void setRouterDeadInterval(int routerDeadInterval); @Override OspfPacketType ospfMessageType(); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] getHelloHeaderAsByteArray(); byte[] getHelloBodyAsByteArray(); @Override String toString(); }
HelloPacket extends OspfPacketHeader { public byte[] getHelloHeaderAsByteArray() { List<Byte> headerLst = new ArrayList<>(); try { headerLst.add((byte) this.ospfVersion()); headerLst.add((byte) this.ospfType()); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.ospfPacLength()))); headerLst.addAll(Bytes.asList(this.routerId().toOctets())); headerLst.addAll(Bytes.asList(this.areaId().toOctets())); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.checksum()))); headerLst.addAll(Bytes.asList(OspfUtil.convertToTwoBytes(this.authType()))); byte[] auth = new byte[OspfUtil.EIGHT_BYTES]; headerLst.addAll(Bytes.asList(auth)); } catch (Exception e) { log.debug("Error::getHelloHeaderAsByteArray {}", e.getMessage()); return Bytes.toArray(headerLst); } return Bytes.toArray(headerLst); } HelloPacket();  HelloPacket(OspfPacketHeader ospfHeader); Ip4Address networkMask(); void setNetworkMask(Ip4Address networkMask); Ip4Address bdr(); void setBdr(Ip4Address bdr); Ip4Address dr(); void setDr(Ip4Address dr); void addNeighbor(Ip4Address neighborID); boolean containsNeighbour(Ip4Address neighborID); int options(); void setOptions(int options); int routerPriority(); void setRouterPriority(int routerPriority); int helloInterval(); void setHelloInterval(int helloInterval); int routerDeadInterval(); void setRouterDeadInterval(int routerDeadInterval); @Override OspfPacketType ospfMessageType(); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] getHelloHeaderAsByteArray(); byte[] getHelloBodyAsByteArray(); @Override String toString();  }