'process the output actions for a packet
ofp is the message which triggered this processing, if any (used for error
generation)'

def _process_actions_for_packet(self, actions, packet, in_port, ofp=None):

    assert assert_type('packet', packet, (ethernet, bytes), none_ok=False)
    if (not isinstance(packet, ethernet)):
        packet = ethernet.unpack(packet)
    for action in actions:
        h = self.action_handlers.get(action.type)
        if (h is None):
            self.log.warn(('Unknown    action    type:    %x    ' % (action.type,)))
            self.send_error(type=OFPET_BAD_ACTION, code=OFPBAC_BAD_TYPE, ofp=ofp)
            return
        packet = h(action, packet, in_port)
