def GetNetworkGateway(network):
  route = ROUTE.get(_GetPlatform(), None)
  logging.debug('Route: %s', str(route))
  if not route:
    return

  try:
    return_code, stdout, stderr = flight_common.Exec(route)
  except OSError:
    return_code = None

  if return_code != 0 or stderr or not stdout:
    return

  gateway_pattern = (
      r'^%s\s+(via[\s\t])?'
      r'([\d\.]+|[0-9a-f:]+|link#\d+|dev [a-z\d]+)[\s\t]+' % network)
  gateway = re.search(gateway_pattern, str(stdout), re.MULTILINE)

  if gateway:
    return gateway.group(2)

  return
Get the gateway for a network.
dataset/ETHPy150Open google/simian/src/simian/mac/client/network_detect.py/GetNetworkGateway