예제 #1
0
파일: defines.py 프로젝트: ITI/Melody
def get_ip_ethernet(buf):
    """Unpack the data within the Ethernet frame (the IP packet)

    Pulling out src, dst, length, fragment info, TTL, and Protocol

    :param buf: A string buffer containing the entire packet
    :type buf: str
    :return: ip of type (dpkt.IP)
    """
    lp = Ethernet(buf)
    lp.unpack(buf)
    ip = lp.data
    return ip
예제 #2
0
def get_ip_ethernet(buf):
    lp = Ethernet(buf)
    lp.unpack(buf)
    ip = lp.data
    return ip