Trait network_packet::IncomingNetworkPacketDropObserver [−][src]
pub trait IncomingNetworkPacketDropObserver { type DropReason: IncomingNetworkPacketProcessingDropReason; fn dropped_packet(&self, reason: Self::DropReason); }
Allows for notification of dropped incoming network packets.
Associated Types
type DropReason: IncomingNetworkPacketProcessingDropReason
The type of the drop reason.
Usually implemented as an enum.
Required Methods
fn dropped_packet(&self, reason: Self::DropReason)
Notifies the observer that a packet has been dropped.
Things that can be done with this information:-
- Log to syslog.
- Log to standard error.
- Log to an in-memory ring buffer which can be 'inspected' (this has the advantage of fixing memory usage).
- Increment a statistic, such as a counter.
- Use injected Lua
- Pass to a security monitor which can reactively and automatically adjust configuration (eg ban an IP address).
- Ignore.
One additional possible idea, not yet supported, would to allow the observer to mutate the packet and 're-inject' it or 'reject' the drop. This is fraught with potential pitfalls.