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