(num, pkt)
return pkt[0:layer_len + 4]
Returns a specific entry in the MySQL packet.
       @param num is the layer number in the response packet.
       @param pkt is the raw packet.
Returns a specific entry in the MySQL packet.
Returns a specific entry in the MySQL packet .
def get_layer(num, pkt):
    """Returns a specific entry in the MySQL packet.
       @param num is the layer number in the response packet.
       @param pkt is the raw packet.
    """
    for i in range(0, num):
        layer_len = endian_int(pkt[0:3])
        if num > 0:
            layer_len += 4  # account for the first packet's offset
        pkt = pkt[layer_len:]

    if len(pkt) is 0:
        return None

    # knock off the rest
    layer_len = endian_int(pkt[0:3])
    return pkt[0:layer_len + 4]
def get_layer ( num , pkt ) : for i in range ( 0 , num ) : layer_len = endian_int ( pkt [ 0 : 3 ] ) if num > 0 : layer_len += 4 # account for the first packet's offset pkt = pkt [ layer_len : ] if len ( pkt ) is 0 : return None # knock off the rest layer_len = endian_int ( pkt [ 0 : 3 ] ) return pkt [ 0 : layer_len + 4 ]