def decode_udp_packet(data):
 offset = 0
 (rsv, frag, address_type) = struct.unpack_from('!HBB', data, offset)
 offset += 4
 (offset, destination_address) = __decode_address(address_type, offset, data)
 (destination_port,) = struct.unpack_from('!H', data, offset)
 offset += 2
 payload = data[offset:]
 return UdpRequest(rsv, frag, address_type, destination_address, destination_port, payload)

def decode_udp_packet ( data ) : offset = 0 ( rsv , frag , address_type ) = struct . unpack_from ( '!HBB' , data , offset ) offset += 4 ( offset , destination_address ) = __decode_address ( address_type , offset , data ) ( destination_port , ) = struct . unpack_from ( '!H' , data , offset ) offset += 2 payload = data [ offset : ] return UdpRequest ( rsv , frag , address_type , destination_address , destination_port , payload )
decodes a socks5 udp packet .