if (m_random->GetValue () > snrPer.per)
{
...
}
else
{
/* failure. */
NotifyRxDrop (packet);
m_state->SwitchFromRxEndError (packet, snrPer.snr);
}
Question 2: the tag is added by the L4 protocol, where the IP address is already known. See for example UdpSocketImpl::ForwardUp.
The trace you're looking at is fired by L2 (or below) and doesn't contain that info.
As a side note, searching for that info is not "right". If the packet is dropped by the MAC, the node doesn't know where the packet came from, and can't know. If the packet is dropped it's because of errors, and any info from the partially decoded packet is unreliable.
Question 3: I don't understand the question. You use it as any other callback. The manual is full if examples (and the examples directory too).
T.