SourceCode?

{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}

[caption|http://example.com]

Hi Coolcat! Macros don’t work like that anymore. Check out the >> “insert” button,. It’ll set up the quoting and such.

yeah, I found it already, thanks

/** if all Checks do match then call {@link #doAction(PacketData)} and return result of the call. */
     public int doRule(PacketData pd) {
          if (!enabled) {
               return EAR_CHECK;
          }
          if (checks == null) {
               return doAction(pd);
          }           boolean match = true;
          Iterator itr = checks.iterator();
          while (match && itr.hasNext()) {
               Check check = itr.next();
               match = check.doCheck(pd);
          }           if (match) {
               return doAction(pd);
          }
          else {
               return EAR_CHECK;
          }
     }