case PACKET_OUT:
OFPacketOut pktOut = (OFPacketOut)msg;
packet.setSwPortTuple(new SwitchPortTuple(sw.getId(),
pktOut.getInPort()));
bb = ChannelBuffers.buffer(pktOut.getLength());
pktOut.writeTo(bb);
packet.setData(OFMessage.getData(sw, msg, cntx));
break;
case FLOW_MOD:
OFFlowMod offlowMod = (OFFlowMod)msg;
packet.setSwPortTuple(new SwitchPortTuple(sw.getId(),