Return the interface mode.
    params:
     - iface: the iwconfig interface

def get_iface_mode(iface):
    """Return the interface mode.
    params:
     - iface: the iwconfig interface
    """
    p = subprocess.Popen(["iwconfig", iface], stdout=subprocess.PIPE,
                         stderr=subprocess.STDOUT)
    output, err = p.communicate()
    match = re.search(br"mode:([a-zA-Z]*)", output.lower())
    if match:
        return plain_str(match.group(1))
    return "unknown"