{code}public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed)
throws PacketRejectedException {
if (processed) { return; }
synchronized(this) {
while (maintenance) {
try { wait(); }
catch (InterruptedException e) { }
}
concurrent++;
}
try {
PacketData pd = new PacketData(packet, session, incoming);
int ar = root.doAction(pd);
switch (ar) {
case EAR_ACCEPT: {
return;
}
case EAR_DROP: {
throw new PacketRejectedException();
}
case EAR_CHECK: {
/* default behaivor: EAR_ACCEPT */
// TODO: Let user choose between accept and drop as default behaivor
return;
}
case EAR_ACTION: {
Log.warn(“Raptor : Last action was logical OR.”);
return;
}
}
}
finally {
synchronized(this) {
concurrent–;
notifyAll();
}
}
}{code}