def IsOnMifi():
  ip = GetDefaultGateway()
  if not ip:
    return False

  if ip.startswith('192.168.1.'):  # Verizon and Sprint devices
    http_status, body = GetHttpResource(ip, redir=True)
    # MiFi-like devices usually run a http interface. It returns a long http
    # response with various easily found "MiFi" or "Jetpack" strings in it
    # when loaded. No http auth challenge is issued.
    if http_status == 200 and body and ('MiFi' in body or 'Jetpack' in body):
      return True
  elif ip == '192.168.8.1':  # common Huawei gateway
    http_status, _ = GetHttpResource(ip, redir=False)
    return http_status == 307

  return False
Checks if the wireless connection is to a MiFi-like device.
dataset/ETHPy150Open google/simian/src/simian/mac/client/network_detect.py/IsOnMifi