d3babe1252d05f07e58a6602b47e1a09bbd56af5,networkml/parsers/pcap/reader.py,,packetizer,#Any#,67

Before Change


    )
    packet_dict = OrderedDict()
    buf = ""
    for line in proc.stdout:
        line = line.decode("utf-8")
        if not line.startswith(" "):
            continue
        if line.startswith("  ,"):
            continue
        buf += line
        if line.startswith("  }"):
            parse_buf(buf)
            buf = ""
    return packet_dict


def sessionizer(path, duration=None, threshold_time=None):

After Change


    """

    packet_dict = OrderedDict()
    with pyshark.FileCapture(path, use_json=True, include_raw=True,
            custom_parameters={"-o": "tcp.desegment_tcp_streams:false"}) as cap:
        for packet in cap:
            data = packet.get_raw_packet()
            head = parse_packet_head(packet)
            if head is not None:
                packet_dict[head] = binascii.hexlify(data).decode("utf-8")
    return packet_dict


def sessionizer(path, duration=None, threshold_time=None):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: CyberReboot/NetworkML
Commit Name: d3babe1252d05f07e58a6602b47e1a09bbd56af5
Time: 2019-12-10
Author: josh@vandervecken.com
File Name: networkml/parsers/pcap/reader.py
Class Name:
Method Name: packetizer


Project Name: jsalt18-sentence-repl/jiant
Commit Name: 2573c649518391ada6214cfc72d20421dfac4072
Time: 2018-03-16
Author: wang.alex.c@gmail.com
File Name: src/preprocess.py
Class Name:
Method Name: get_embeddings


Project Name: tensorflow/datasets
Commit Name: 2b867a66ea0938ea281b5e6ea37ae3e18e15ae19
Time: 2018-12-04
Author: epot@google.com
File Name: tensorflow_datasets/testing/dataset_builder_testing.py
Class Name: TestCase
Method Name: test_download_and_prepare_as_dataset