'Packs this object into its wire format.
May normalize fields.
NOTE: If "data" has been specified, this method may actually return
*more than just a single ofp_flow_mod* in packed form.
Specifically, it may also have a barrier and an ofp_packet_out.'

def pack(self):

    po = None
    if self.data:
        assert self.data.is_complete
        assert (self.buffer_id is None)
        self.buffer_id = self.data.buffer_id
        if (self.buffer_id is None):
            po = ofp_packet_out(data=self.data)
            po.in_port = self.data.in_port
            po.actions.append(ofp_action_output(port=OFPP_TABLE))
    assert self._assert()
    match = self.match.pack()
    match_len = len(match)
    command = self.command
    command |= (self.table_id << 8)
    packed = ''
    packed += ofp_header.pack(self)
    packed += struct.pack('!LL', self.vendor, self.subtype)
    packed += struct.pack('!QHHHHLHHH', self.cookie, command, self.idle_timeout, self.hard_timeout, self.priority, self._buffer_id, self.out_port, self.flags, match_len)
    packed += _PAD6
    packed += match
    packed += (_PAD * ((((match_len + 7) / 8) * 8) - match_len))
    for i in self.actions:
        packed += i.pack()
    if po:
        packed += ofp_barrier_request().pack()
        packed += po.pack()
    assert (len(packed) == len(self))
    return packed
