On this page
packet.drop
Drops the packet so it is not delivered.
Syntax
Atlas Script
packet.drop()Parameters
This method does not accept arguments.
Return value
See the remarks for the returned value and runtime behavior.
Remarks
Drops the packet so it is not delivered. A drop takes precedence over any edits made in the same event; packet.pass() cancels it.
Examples
Block traffic to and from one address.atlas
const string BLOCKED = "192.0.2.10";
event on_start() {
if (!network.capture("ip.DstAddr == 192.0.2.10 or ip.SrcAddr == 192.0.2.10")) {
system.log("Network capture could not start");
}
}
event on_network_send() {
if (packet.dst_ip == BLOCKED) {
packet.drop();
}
}
event on_network_recv() {
if (packet.src_ip == BLOCKED) {
packet.drop();
}
}