def ipv4_reassembly(frame):
    """Make data for IPv4 reassembly."""
    if 'IPv4' in frame:
        ipv4 = frame['IPv4'].info
        if ipv4.flags.df:       # dismiss not fragmented frame
            return False, None
        data = dict(
            bufid=(
                ipv4.src,                                   # source IP address
                ipv4.dst,                                   # destination IP address
                ipv4.id,                                    # identification
                ipv4.proto.name,                            # payload protocol type
            ),
            num=frame.info.number,                          # original packet range number
            fo=ipv4.frag_offset,                            # fragment offset
            ihl=ipv4.hdr_len,                               # internet header length
            mf=ipv4.flags.mf,                               # more fragment flag
            tl=ipv4.len,                                    # total length, header includes
            header=bytearray(ipv4.packet.header),           # raw bytearray type header
            payload=bytearray(ipv4.packet.payload or b''),  # raw bytearray type payload
        )
        return True, data
    return False, None
Make data for IPv4 reassembly.