
/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */

#include "mm-daemon-enums-types.h"
/* enumerations from "../ModemManager/src/mm-base-bearer.h" */
static const GEnumValue mm_bearer_status_values[] = {
    { MM_BEARER_STATUS_DISCONNECTED, "MM_BEARER_STATUS_DISCONNECTED", "disconnected" },
    { MM_BEARER_STATUS_DISCONNECTING, "MM_BEARER_STATUS_DISCONNECTING", "disconnecting" },
    { MM_BEARER_STATUS_CONNECTING, "MM_BEARER_STATUS_CONNECTING", "connecting" },
    { MM_BEARER_STATUS_CONNECTED, "MM_BEARER_STATUS_CONNECTED", "connected" },
    { 0, NULL, NULL }
};

GType
mm_bearer_status_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_enum_register_static (g_intern_static_string ("MMBearerStatus"),
                                      mm_bearer_status_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_BEARER_STATUS_IS_ENUM__
const gchar *
mm_bearer_status_get_string (MMBearerStatus val)
{
    guint i;

    for (i = 0; mm_bearer_status_values[i].value_nick; i++) {
        if ((gint)val == mm_bearer_status_values[i].value)
            return mm_bearer_status_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __MM_BEARER_STATUS_IS_FLAGS__
gchar *
mm_bearer_status_build_string_from_mask (MMBearerStatus mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; mm_bearer_status_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == mm_bearer_status_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (mm_bearer_status_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & mm_bearer_status_values[i].value) {
            guint c;
            gulong number = mm_bearer_status_values[i].value;

            for (c = 0; number; c++)
                number &= number - 1;

            if (c == 1) {
                if (!str)
                    str = g_string_new ("");
                g_string_append_printf (str, "%s%s",
                                        first ? "" : ", ",
                                        mm_bearer_status_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GEnumValue mm_bearer_connection_status_values[] = {
    { MM_BEARER_CONNECTION_STATUS_UNKNOWN, "MM_BEARER_CONNECTION_STATUS_UNKNOWN", "unknown" },
    { MM_BEARER_CONNECTION_STATUS_DISCONNECTED, "MM_BEARER_CONNECTION_STATUS_DISCONNECTED", "disconnected" },
    { MM_BEARER_CONNECTION_STATUS_DISCONNECTING, "MM_BEARER_CONNECTION_STATUS_DISCONNECTING", "disconnecting" },
    { MM_BEARER_CONNECTION_STATUS_CONNECTED, "MM_BEARER_CONNECTION_STATUS_CONNECTED", "connected" },
    { MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED, "MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED", "connection-failed" },
    { 0, NULL, NULL }
};

GType
mm_bearer_connection_status_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_enum_register_static (g_intern_static_string ("MMBearerConnectionStatus"),
                                      mm_bearer_connection_status_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_BEARER_CONNECTION_STATUS_IS_ENUM__
const gchar *
mm_bearer_connection_status_get_string (MMBearerConnectionStatus val)
{
    guint i;

    for (i = 0; mm_bearer_connection_status_values[i].value_nick; i++) {
        if ((gint)val == mm_bearer_connection_status_values[i].value)
            return mm_bearer_connection_status_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __MM_BEARER_CONNECTION_STATUS_IS_FLAGS__
gchar *
mm_bearer_connection_status_build_string_from_mask (MMBearerConnectionStatus mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; mm_bearer_connection_status_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == mm_bearer_connection_status_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (mm_bearer_connection_status_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & mm_bearer_connection_status_values[i].value) {
            guint c;
            gulong number = mm_bearer_connection_status_values[i].value;

            for (c = 0; number; c++)
                number &= number - 1;

            if (c == 1) {
                if (!str)
                    str = g_string_new ("");
                g_string_append_printf (str, "%s%s",
                                        first ? "" : ", ",
                                        mm_bearer_connection_status_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
/* enumerations from "../ModemManager/src/mm-base-modem.h" */
static const GEnumValue mm_base_modem_operation_priority_values[] = {
    { MM_BASE_MODEM_OPERATION_PRIORITY_UNKNOWN, "MM_BASE_MODEM_OPERATION_PRIORITY_UNKNOWN", "unknown" },
    { MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT, "MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT", "default" },
    { MM_BASE_MODEM_OPERATION_PRIORITY_OVERRIDE, "MM_BASE_MODEM_OPERATION_PRIORITY_OVERRIDE", "override" },
    { 0, NULL, NULL }
};

GType
mm_base_modem_operation_priority_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_enum_register_static (g_intern_static_string ("MMBaseModemOperationPriority"),
                                      mm_base_modem_operation_priority_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_BASE_MODEM_OPERATION_PRIORITY_IS_ENUM__
const gchar *
mm_base_modem_operation_priority_get_string (MMBaseModemOperationPriority val)
{
    guint i;

    for (i = 0; mm_base_modem_operation_priority_values[i].value_nick; i++) {
        if ((gint)val == mm_base_modem_operation_priority_values[i].value)
            return mm_base_modem_operation_priority_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __MM_BASE_MODEM_OPERATION_PRIORITY_IS_FLAGS__
gchar *
mm_base_modem_operation_priority_build_string_from_mask (MMBaseModemOperationPriority mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; mm_base_modem_operation_priority_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == mm_base_modem_operation_priority_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (mm_base_modem_operation_priority_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & mm_base_modem_operation_priority_values[i].value) {
            guint c;
            gulong number = mm_base_modem_operation_priority_values[i].value;

            for (c = 0; number; c++)
                number &= number - 1;

            if (c == 1) {
                if (!str)
                    str = g_string_new ("");
                g_string_append_printf (str, "%s%s",
                                        first ? "" : ", ",
                                        mm_base_modem_operation_priority_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GEnumValue m_mbase_modem_operation_lock_values[] = {
    { MM_BASE_MODEM_OPERATION_LOCK_REQUIRED, "MM_BASE_MODEM_OPERATION_LOCK_REQUIRED", "required" },
    { MM_BASE_MODEM_OPERATION_LOCK_ALREADY_ACQUIRED, "MM_BASE_MODEM_OPERATION_LOCK_ALREADY_ACQUIRED", "already-acquired" },
    { 0, NULL, NULL }
};

GType
m_mbase_modem_operation_lock_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_enum_register_static (g_intern_static_string ("MMBaseModemOperationLock"),
                                      m_mbase_modem_operation_lock_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __M_MBASE_MODEM_OPERATION_LOCK_IS_ENUM__
const gchar *
m_mbase_modem_operation_lock_get_string (MMBaseModemOperationLock val)
{
    guint i;

    for (i = 0; m_mbase_modem_operation_lock_values[i].value_nick; i++) {
        if ((gint)val == m_mbase_modem_operation_lock_values[i].value)
            return m_mbase_modem_operation_lock_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __M_MBASE_MODEM_OPERATION_LOCK_IS_FLAGS__
gchar *
m_mbase_modem_operation_lock_build_string_from_mask (MMBaseModemOperationLock mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; m_mbase_modem_operation_lock_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == m_mbase_modem_operation_lock_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (m_mbase_modem_operation_lock_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & m_mbase_modem_operation_lock_values[i].value) {
            guint c;
            gulong number = m_mbase_modem_operation_lock_values[i].value;

            for (c = 0; number; c++)
                number &= number - 1;

            if (c == 1) {
                if (!str)
                    str = g_string_new ("");
                g_string_append_printf (str, "%s%s",
                                        first ? "" : ", ",
                                        m_mbase_modem_operation_lock_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
/* enumerations from "../ModemManager/src/mm-filter.h" */
static const GFlagsValue mm_filter_rule_values[] = {
    { MM_FILTER_RULE_NONE, "MM_FILTER_RULE_NONE", "none" },
    { MM_FILTER_RULE_EXPLICIT_ALLOWLIST, "MM_FILTER_RULE_EXPLICIT_ALLOWLIST", "explicit-allowlist" },
    { MM_FILTER_RULE_EXPLICIT_BLOCKLIST, "MM_FILTER_RULE_EXPLICIT_BLOCKLIST", "explicit-blocklist" },
    { MM_FILTER_RULE_PLUGIN_ALLOWLIST, "MM_FILTER_RULE_PLUGIN_ALLOWLIST", "plugin-allowlist" },
    { MM_FILTER_RULE_QRTR, "MM_FILTER_RULE_QRTR", "qrtr" },
    { MM_FILTER_RULE_VIRTUAL, "MM_FILTER_RULE_VIRTUAL", "virtual" },
    { MM_FILTER_RULE_NET, "MM_FILTER_RULE_NET", "net" },
    { MM_FILTER_RULE_USBMISC, "MM_FILTER_RULE_USBMISC", "usbmisc" },
    { MM_FILTER_RULE_RPMSG, "MM_FILTER_RULE_RPMSG", "rpmsg" },
    { MM_FILTER_RULE_WWAN, "MM_FILTER_RULE_WWAN", "wwan" },
    { MM_FILTER_RULE_TTY, "MM_FILTER_RULE_TTY", "tty" },
    { MM_FILTER_RULE_TTY_PLATFORM_DRIVER, "MM_FILTER_RULE_TTY_PLATFORM_DRIVER", "tty-platform-driver" },
    { MM_FILTER_RULE_TTY_DRIVER, "MM_FILTER_RULE_TTY_DRIVER", "tty-driver" },
    { MM_FILTER_RULE_TTY_ACM_INTERFACE, "MM_FILTER_RULE_TTY_ACM_INTERFACE", "tty-acm-interface" },
    { MM_FILTER_RULE_TTY_WITH_NET, "MM_FILTER_RULE_TTY_WITH_NET", "tty-with-net" },
    { MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN, "MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN", "tty-default-forbidden" },
    { 0, NULL, NULL }
};

GType
mm_filter_rule_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_flags_register_static (g_intern_static_string ("MMFilterRule"),
                                      mm_filter_rule_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_FILTER_RULE_IS_ENUM__
const gchar *
mm_filter_rule_get_string (MMFilterRule val)
{
    guint i;

    for (i = 0; mm_filter_rule_values[i].value_nick; i++) {
        if ((gint)val == mm_filter_rule_values[i].value)
            return mm_filter_rule_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __MM_FILTER_RULE_IS_FLAGS__
gchar *
mm_filter_rule_build_string_from_mask (MMFilterRule mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; mm_filter_rule_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == mm_filter_rule_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (mm_filter_rule_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & mm_filter_rule_values[i].value) {
            guint c;
            gulong number = mm_filter_rule_values[i].value;

            for (c = 0; number; c++)
                number &= number - 1;

            if (c == 1) {
                if (!str)
                    str = g_string_new ("");
                g_string_append_printf (str, "%s%s",
                                        first ? "" : ", ",
                                        mm_filter_rule_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
/* enumerations from "../ModemManager/src/mm-port-probe.h" */
static const GFlagsValue mm_port_probe_flag_values[] = {
    { MM_PORT_PROBE_NONE, "MM_PORT_PROBE_NONE", "none" },
    { MM_PORT_PROBE_AT, "MM_PORT_PROBE_AT", "at" },
    { MM_PORT_PROBE_AT_VENDOR, "MM_PORT_PROBE_AT_VENDOR", "at-vendor" },
    { MM_PORT_PROBE_AT_PRODUCT, "MM_PORT_PROBE_AT_PRODUCT", "at-product" },
    { MM_PORT_PROBE_AT_ICERA, "MM_PORT_PROBE_AT_ICERA", "at-icera" },
    { MM_PORT_PROBE_AT_XMM, "MM_PORT_PROBE_AT_XMM", "at-xmm" },
    { MM_PORT_PROBE_QCDM, "MM_PORT_PROBE_QCDM", "qcdm" },
    { MM_PORT_PROBE_QMI, "MM_PORT_PROBE_QMI", "qmi" },
    { MM_PORT_PROBE_MBIM, "MM_PORT_PROBE_MBIM", "mbim" },
    { 0, NULL, NULL }
};

GType
mm_port_probe_flag_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_flags_register_static (g_intern_static_string ("MMPortProbeFlag"),
                                      mm_port_probe_flag_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_PORT_PROBE_FLAG_IS_ENUM__
const gchar *
mm_port_probe_flag_get_string (MMPortProbeFlag val)
{
    guint i;

    for (i = 0; mm_port_probe_flag_values[i].value_nick; i++) {
        if ((gint)val == mm_port_probe_flag_values[i].value)
            return mm_port_probe_flag_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __MM_PORT_PROBE_FLAG_IS_FLAGS__
gchar *
mm_port_probe_flag_build_string_from_mask (MMPortProbeFlag mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; mm_port_probe_flag_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == mm_port_probe_flag_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (mm_port_probe_flag_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & mm_port_probe_flag_values[i].value) {
            guint c;
            gulong number = mm_port_probe_flag_values[i].value;

            for (c = 0; number; c++)
                number &= number - 1;

            if (c == 1) {
                if (!str)
                    str = g_string_new ("");
                g_string_append_printf (str, "%s%s",
                                        first ? "" : ", ",
                                        mm_port_probe_flag_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif

/* Generated data ends here */

