@Test(expected = Exception.class) public void testGetMessage1() throws Exception { ddPacket = new DdPacket(); ddPacket.setAuthType(1); ddPacket.setOspftype(2); ddPacket.setRouterId(Ip4Address.valueOf("10.226.165.164")); ddPacket.setAreaId(Ip4Address.valueOf("10.226.165.100")); ddPacket.setChecksum(201); ddPacket.setAuthentication(2); ddPacket.setOspfPacLength(48); ddPacket.setOspfVer(2); ospfMessageWriter.getMessage(ddPacket, 1, 1); assertThat(ospfMessageWriter, is(notNullValue())); }
public byte[] getMessage(OspfMessage ospfMessage, int interfaceIndex, int interfaceState) { byte[] buf = null; switch (ospfMessage.ospfMessageType().value()) { case OspfParameters.HELLO: case OspfParameters.LSACK: case OspfParameters.DD: case OspfParameters.LSREQUEST: case OspfParameters.LSUPDATE: buf = writeMessageToBytes(ospfMessage, interfaceIndex, interfaceState); break; default: log.debug("Message Writer[Encoder] - Unknown Message to encode..!!!"); break; } return buf; }
OspfMessageWriter { public byte[] getMessage(OspfMessage ospfMessage, int interfaceIndex, int interfaceState) { byte[] buf = null; switch (ospfMessage.ospfMessageType().value()) { case OspfParameters.HELLO: case OspfParameters.LSACK: case OspfParameters.DD: case OspfParameters.LSREQUEST: case OspfParameters.LSUPDATE: buf = writeMessageToBytes(ospfMessage, interfaceIndex, interfaceState); break; default: log.debug("Message Writer[Encoder] - Unknown Message to encode..!!!"); break; } return buf; } }
OspfMessageWriter { public byte[] getMessage(OspfMessage ospfMessage, int interfaceIndex, int interfaceState) { byte[] buf = null; switch (ospfMessage.ospfMessageType().value()) { case OspfParameters.HELLO: case OspfParameters.LSACK: case OspfParameters.DD: case OspfParameters.LSREQUEST: case OspfParameters.LSUPDATE: buf = writeMessageToBytes(ospfMessage, interfaceIndex, interfaceState); break; default: log.debug("Message Writer[Encoder] - Unknown Message to encode..!!!"); break; } return buf; }  }
OspfMessageWriter { public byte[] getMessage(OspfMessage ospfMessage, int interfaceIndex, int interfaceState) { byte[] buf = null; switch (ospfMessage.ospfMessageType().value()) { case OspfParameters.HELLO: case OspfParameters.LSACK: case OspfParameters.DD: case OspfParameters.LSREQUEST: case OspfParameters.LSUPDATE: buf = writeMessageToBytes(ospfMessage, interfaceIndex, interfaceState); break; default: log.debug("Message Writer[Encoder] - Unknown Message to encode..!!!"); break; } return buf; }  byte[] getMessage(OspfMessage ospfMessage, int interfaceIndex, int interfaceState); }
OspfMessageWriter { public byte[] getMessage(OspfMessage ospfMessage, int interfaceIndex, int interfaceState) { byte[] buf = null; switch (ospfMessage.ospfMessageType().value()) { case OspfParameters.HELLO: case OspfParameters.LSACK: case OspfParameters.DD: case OspfParameters.LSREQUEST: case OspfParameters.LSUPDATE: buf = writeMessageToBytes(ospfMessage, interfaceIndex, interfaceState); break; default: log.debug("Message Writer[Encoder] - Unknown Message to encode..!!!"); break; } return buf; }  byte[] getMessage(OspfMessage ospfMessage, int interfaceIndex, int interfaceState);  }