Skip to content
Snippets Groups Projects
Commit 62f13818 authored by Ryan Izard's avatar Ryan Izard
Browse files

Merge pull request #561 from floodlight/revert-559-revert-555-master

Revert "Revert "writePacketOutForPacketIn to OFMessageUtils""
parents 0c8b74d8 2491de50
No related branches found
No related tags found
No related merge requests found
......@@ -355,27 +355,8 @@ implements IFloodlightModule, ILearningSwitchService, IOFMessageListener {
* @param egressPort The switchport to output the PacketOut.
*/
private void writePacketOutForPacketIn(IOFSwitch sw, OFPacketIn packetInMessage, OFPort egressPort) {
OFPacketOut.Builder pob = sw.getOFFactory().buildPacketOut();
// Set buffer_id, in_port, actions_len
pob.setBufferId(packetInMessage.getBufferId());
pob.setInPort(packetInMessage.getVersion().compareTo(OFVersion.OF_12) < 0 ? packetInMessage.getInPort() : packetInMessage.getMatch().get(MatchField.IN_PORT));
// set actions
List<OFAction> actions = new ArrayList<OFAction>(1);
actions.add(sw.getOFFactory().actions().buildOutput().setPort(egressPort).setMaxLen(0xffFFffFF).build());
pob.setActions(actions);
// set data - only if buffer_id == -1
if (packetInMessage.getBufferId() == OFBufferId.NO_BUFFER) {
byte[] packetData = packetInMessage.getData();
pob.setData(packetData);
}
// and write it out
OFMessageUtils.writePacketOutForPacketIn(sw, packetInMessage, egressPort);
counterPacketOut.increment();
sw.write(pob.build());
}
protected Match createMatchFromPacket(IOFSwitch sw, OFPort inPort, FloodlightContext cntx) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment