@Test public void testOnPacketReceived() throws Exception { ofPacketInListener.onPacketReceived(null); Assert.assertNotNull(ofPacketInListener); }
@Override public void onPacketReceived(PacketReceived packetReceived) { if (null == packetReceived) { return; } byte[] payload = packetReceived.getPayload(); Ethernet ethernet = new Ethernet(); try { ethernet.deserialize(payload, 0, NetUtils.NUM_BITS_IN_A_BYTE * payload.length); } catch (PacketException e) { LOG.warn("Failed to decode packet in message: {}", packetReceived); } if (EtherTypes.ARP.shortValue() == ethernet.getEtherType()) { NodeConnectorRef ingressNodeConnectorRef = packetReceived.getIngress(); LOG.debug("Receive one arp packet in message:\r\n {}.", packetReceived); ofFlowUtils.handleArp(packetReceived,ingressNodeConnectorRef); } }
OFPacketInListener implements PacketProcessingListener { @Override public void onPacketReceived(PacketReceived packetReceived) { if (null == packetReceived) { return; } byte[] payload = packetReceived.getPayload(); Ethernet ethernet = new Ethernet(); try { ethernet.deserialize(payload, 0, NetUtils.NUM_BITS_IN_A_BYTE * payload.length); } catch (PacketException e) { LOG.warn("Failed to decode packet in message: {}", packetReceived); } if (EtherTypes.ARP.shortValue() == ethernet.getEtherType()) { NodeConnectorRef ingressNodeConnectorRef = packetReceived.getIngress(); LOG.debug("Receive one arp packet in message:\r\n {}.", packetReceived); ofFlowUtils.handleArp(packetReceived,ingressNodeConnectorRef); } } }
OFPacketInListener implements PacketProcessingListener { @Override public void onPacketReceived(PacketReceived packetReceived) { if (null == packetReceived) { return; } byte[] payload = packetReceived.getPayload(); Ethernet ethernet = new Ethernet(); try { ethernet.deserialize(payload, 0, NetUtils.NUM_BITS_IN_A_BYTE * payload.length); } catch (PacketException e) { LOG.warn("Failed to decode packet in message: {}", packetReceived); } if (EtherTypes.ARP.shortValue() == ethernet.getEtherType()) { NodeConnectorRef ingressNodeConnectorRef = packetReceived.getIngress(); LOG.debug("Receive one arp packet in message:\r\n {}.", packetReceived); ofFlowUtils.handleArp(packetReceived,ingressNodeConnectorRef); } } OFPacketInListener(FlowUtils ofFlowUtils); }
OFPacketInListener implements PacketProcessingListener { @Override public void onPacketReceived(PacketReceived packetReceived) { if (null == packetReceived) { return; } byte[] payload = packetReceived.getPayload(); Ethernet ethernet = new Ethernet(); try { ethernet.deserialize(payload, 0, NetUtils.NUM_BITS_IN_A_BYTE * payload.length); } catch (PacketException e) { LOG.warn("Failed to decode packet in message: {}", packetReceived); } if (EtherTypes.ARP.shortValue() == ethernet.getEtherType()) { NodeConnectorRef ingressNodeConnectorRef = packetReceived.getIngress(); LOG.debug("Receive one arp packet in message:\r\n {}.", packetReceived); ofFlowUtils.handleArp(packetReceived,ingressNodeConnectorRef); } } OFPacketInListener(FlowUtils ofFlowUtils); @Override void onPacketReceived(PacketReceived packetReceived); }
OFPacketInListener implements PacketProcessingListener { @Override public void onPacketReceived(PacketReceived packetReceived) { if (null == packetReceived) { return; } byte[] payload = packetReceived.getPayload(); Ethernet ethernet = new Ethernet(); try { ethernet.deserialize(payload, 0, NetUtils.NUM_BITS_IN_A_BYTE * payload.length); } catch (PacketException e) { LOG.warn("Failed to decode packet in message: {}", packetReceived); } if (EtherTypes.ARP.shortValue() == ethernet.getEtherType()) { NodeConnectorRef ingressNodeConnectorRef = packetReceived.getIngress(); LOG.debug("Receive one arp packet in message:\r\n {}.", packetReceived); ofFlowUtils.handleArp(packetReceived,ingressNodeConnectorRef); } } OFPacketInListener(FlowUtils ofFlowUtils); @Override void onPacketReceived(PacketReceived packetReceived);  }