protected boolean isDefaultGateway(Ethernet frame){
  if (macToGateway.containsKey(frame.getSourceMAC()))   return true;
  Integer gwIp=macToGateway.get(frame.getDestinationMAC());
  if (gwIp != null) {
    MACAddress host=frame.getSourceMAC();
    String srcNet=macToGuid.get(host);
    if (srcNet != null) {
      Integer gwIpSrcNet=guidToGateway.get(srcNet);
      if ((gwIpSrcNet != null) && (gwIp.equals(gwIpSrcNet)))       return true;
    }
  }
  return false;
}

protected boolean isDefaultGateway ( Ethernet frame ) { if ( macToGateway . containsKey ( frame . getSourceMAC ( ) ) ) return true ; Integer gwIp = macToGateway . get ( frame . getDestinationMAC ( ) ) ; if ( gwIp != null ) { MACAddress host = frame . getSourceMAC ( ) ; String srcNet = macToGuid . get ( host ) ; if ( srcNet != null ) { Integer gwIpSrcNet = guidToGateway . get ( srcNet ) ; if ( ( gwIpSrcNet != null ) && ( gwIp . equals ( gwIpSrcNet ) ) ) return true ; } } return false ; }
checks whether the frame is destined to or from a gateway .
