

@classmethod
def _parser(cls, buf):
    (op, htype, hlen) = struct.unpack_from(cls._HLEN_UNPACK_STR, buf)
    buf = buf[cls._HLEN_UNPACK_LEN:]
    unpack_str = (cls._DHCP_UNPACK_STR % (hlen, (cls._DHCP_CHADDR_LEN - hlen)))
    min_len = struct.calcsize(unpack_str)
    (hops, xid, secs, flags, ciaddr, yiaddr, siaddr, giaddr, chaddr, dummy, sname, boot_file) = struct.unpack_from(unpack_str, buf)
    length = min_len
    if (len(buf) > min_len):
        parse_opt = options.parser(buf[min_len:])
        length += parse_opt.options_len
    return (cls(op, addrconv.mac.bin_to_text(chaddr), parse_opt, htype, hlen, hops, xid, secs, flags, addrconv.ipv4.bin_to_text(ciaddr), addrconv.ipv4.bin_to_text(yiaddr), addrconv.ipv4.bin_to_text(siaddr), addrconv.ipv4.bin_to_text(giaddr), sname.decode('ascii'), boot_file), None, buf[length:])

dataset/ETHPy150Open osrg/ryu/ryu/lib/packet/dhcp.py dhcp._parser/original