How to get a destination IP from a UDP packet?

Hi there,

I wanna to get the destination ip of a UDP packet, when it arrives at
the server.
I need this so that the server could inspect the packet whether it is a
broadcast or unicast(to the server) packet and do different things with
is