Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1.     public String tracePacket(Packet packet){
  2.         packet.recordPath(own_ip);
  3.         if(own_ip.isTheSame(packet.getDestination())){
  4.             return packet.toString();
  5.         }else{
  6.             if(packet.isLive()){
  7.                 for(Node child:children){
  8.                     if(packet.getDestination().insideRng(child.lower_ip, child.higher_ip)){
  9.                         return child.tracePacket(packet);
  10.                     }
  11.                 }
  12.                 if(parent == null){
  13.                     return "OUT";
  14.                 }else{
  15.                     return parent.tracePacket(packet);
  16.                 }
  17.             }else{
  18.                 return "LOOP";
  19.             }
  20.         }
  21.        
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement