code: def ifconfig_inet (iface):
      
      res = pipecmd(["ifconfig", iface], ["grep", "inet "])
      info = {}
      lastpart = None
      for part in res.split():
          # Linux systems have prefixes for each value
          if part.startswith("addr:"):
              info["address"] = part[5:]
          elif part.startswith("Bcast:"):
              info["broadcast"] = part[6:]
          elif part.startswith("Mask:"):
              info["netmask"] = part[5:]
          elif lastpart == "inet":
              info["address"] = part
          elif lastpart in ("netmask", "broadcast"):
              info[lastpart] = part
          lastpart = part
      return info
docs: Return parsed IPv4 info from ifconfig(8) binary.