Example #1
0
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
Example #2
0
def get_ip_ethernet(buf):
    lp = Ethernet(buf)
    lp.unpack(buf)
    ip = lp.data
    return ip