Use glib-mkenums to generate enum types

Rather than generating enum classes by hand (and complaining in each
file that "this should really be standard"), use glib-mkenums.

Unfortunately, we need a very new version of glib-mkenums in order to
deal with NM's naming conventions and to fix a few other bugs, so just
import that into the source tree temporarily.

Also, to simplify the use of glib-mkenums, import Makefile.glib from
https://bugzilla.gnome.org/654395.

To avoid having to run glib-mkenums for every subdirectory of src/,
add a new "generated" directory, and put the generated enums files
there.

Finally, use Makefile.glib for marshallers too, and generate separate
ones for libnm-glib and NetworkManager.
This commit is contained in:
Dan Winship 2012-02-08 12:56:52 -05:00
parent 0b57cc68fd
commit 839eab5564
112 changed files with 1031 additions and 1289 deletions

5
.gitignore vendored
View File

@ -6,6 +6,8 @@
*.bz2
*.gir
*.typelib
*.stamp
*-enum-types.[ch]
Makefile
Makefile.in*
configure
@ -143,11 +145,12 @@ initscript/*/[Nn]etwork[Mm]anager
*-glue.h
*-bindings.h
nm-marshal.[ch]
callouts/tests/test-dispatcher-envp
libnm-glib/libnm-glib-test
libnm-glib/nm-glib-marshal.*
src/NetworkManager
src/nm-crash-logger
src/generated/nm-marshal.*
src/supplicant-manager/tests/test-supplicant-config
system-settings/src
test/libnm-glib-test

View File

@ -1,5 +1,6 @@
include $(GLIB_MAKEFILE)
SUBDIRS = \
marshallers \
include \
libnm-util \
libnm-glib \
@ -22,7 +23,8 @@ EXTRA_DIST = \
NetworkManager.pc.in \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
intltool-update.in \
Makefile.glib
DISTCHECK_CONFIGURE_FLAGS = \
--with-tests=yes \
@ -42,4 +44,4 @@ CLEANFILES = cscope.in.out cscope.out cscope.po.out
.PHONY: cscope
cscope:
cscope -b -q -R -Iinclude -ssrc -slibnm-glib -slibnm-util -smarshallers -scli/src;
cscope -b -q -R -Iinclude -ssrc -slibnm-glib -slibnm-util -scli/src;

169
Makefile.glib Normal file
View File

@ -0,0 +1,169 @@
# -*- Mode: makefile -*-
#
# Work-in-progress...
# See https://bugzilla.gnome.org/show_bug.cgi?id=654395
_GLIB_CLEANFILES =
_GLIB_DISTCLEANFILES =
_GLIB_V_GEN = $(_glib_v_gen_$(V))
_glib_v_gen_ = $(_glib_v_gen_$(AM_DEFAULT_VERBOSITY))
_glib_v_gen_0 = @echo " GEN " $(subst .stamp,,$@);
### glib-genmarshal
_GLIB_MARSHAL_GENERATED = $(subst .h,,$(filter %marshal.h,$(GLIB_GENERATED)))
_glib_marshal_prefix = $(subst marshal,,$(subst _marshal,,$(subst -,_,$(notdir $(1)))))_marshal
_glib_marshal_sources_var = $(subst -,_,$(notdir $(1)))_sources
_glib_marshal_sources = $(filter-out %.h,$(filter-out $(GLIB_GENERATED),$($(_glib_marshal_sources_var))))
define _glib_make_genmarshal_rules
$(if $(_glib_marshal_sources),,$(error Need to define $(_glib_marshal_sources_var) for $(1).[ch]))
$(1).list.stamp: $(_glib_marshal_sources)
$$(_GLIB_V_GEN) sed -ne 's/.*_$(_glib_marshal_prefix)_\([_A-Z]*\).*/\1/p' $$^ | sort -u | sed -e 's/__/:/' -e 's/_/,/g' > $(1).list.tmp && \
(cmp -s $(1).list.tmp $(1).list || cp $(1).list.tmp $(1).list) && \
rm -f $(1).list.tmp && \
echo timestamp > $$@
$(1).list: $(1).list.stamp
@true
$(1).h: $(1).list
$$(_GLIB_V_GEN) $$(GLIB_GENMARSHAL) \
--prefix=_$(_glib_marshal_prefix) --header \
$$(GLIB_GENMARSHAL_H_FLAGS) \
$$($(_glib_marshal_prefix)_GENMARSHAL_H_FLAGS) \
$$< > $$@.tmp && \
mv $$@.tmp $$@
$(1).c: $(1).list
$$(_GLIB_V_GEN) (echo "#include \"$$(subst .c,.h,$$(@F))\""; $$(GLIB_GENMARSHAL) \
--prefix=_$(_glib_marshal_prefix) --body \
$$(GLIB_GENMARSHAL_C_FLAGS) \
$$($(_glib_marshal_prefix)_GENMARSHAL_C_FLAGS) \
$$< ) > $$@.tmp && \
mv $$@.tmp $$@
_GLIB_CLEANFILES += $(1).list.stamp $(1).list
_GLIB_DISTCLEANFILES += $(1).h $(1).c
endef
$(foreach f,$(_GLIB_MARSHAL_GENERATED),$(eval $(call _glib_make_genmarshal_rules,$f)))
### glib-mkenums
_GLIB_ENUM_TYPES_GENERATED = $(subst .h,,$(filter %enum-types.h %enumtypes.h,$(GLIB_GENERATED)))
_glib_enum_types_prefix = $(subst -,_,$(notdir $(1)))
_glib_enum_types_guard = __$(shell echo $(_glib_enum_types_prefix) | tr 'a-z' 'A-Z')_H__
_glib_enum_types_sources_var = $(_glib_enum_types_prefix)_sources
_glib_enum_types_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enum_types_sources_var)))
_glib_enum_types_h_sources = $(filter %.h,$(_glib_enum_types_sources))
define _glib_make_mkenums_rules
$(if $(_glib_enum_types_sources),,$(error Need to define $(_glib_enum_types_sources_var) for $(1).[ch]))
$(1).h.stamp: $(_glib_enum_types_h_sources)
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
--fhead "/* Generated by glib-mkenums. Do not edit */\n\n#ifndef $(_glib_enum_types_guard)\n#define $(_glib_enum_types_guard)\n\n" \
$$(GLIB_MKENUMS_H_FLAGS) \
$$($(_glib_enum_types_prefix)_MKENUMS_H_FLAGS) \
--fhead "#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n" \
--ftail "G_END_DECLS\n\n#endif /* $(_glib_enum_types_guard) */" \
$$^ > $(1).h.tmp && \
(cmp -s $(1).h.tmp $(1).h || cp $(1).h.tmp $(1).h) && \
rm -f $(1).h.tmp && \
echo timestamp > $$@
$(1).h: $(1).h.stamp
@true
$(1).c.stamp: $(_glib_enum_types_h_sources)
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
--fhead "/* Generated by glib-mkenums. Do not edit */\n\n#include \"$(notdir $(1)).h\"\n" \
$$(GLIB_MKENUMS_C_FLAGS) \
$$($(_glib_enum_types_prefix)_MKENUMS_C_FLAGS) \
--fhead "$$(foreach f,$$(^F),\n#include \"$$(f)\")\n\n" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" },\n" \
--vtail " { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n" \
$$^ > $(1).c.tmp && \
(cmp -s $(1).c.tmp $(1).c || cp $(1).c.tmp $(1).c) && \
rm -f $(1).c.tmp && \
echo timestamp > $$@
$(1).c: $(1).c.stamp
@true
_GLIB_CLEANFILES += $(1).h.stamp $(1).c.stamp
_GLIB_DISTCLEANFILES += $(1).h $(1).c $(1).h.stamp $(1).c.stamp
endef
$(foreach f,$(_GLIB_ENUM_TYPES_GENERATED),$(eval $(call _glib_make_mkenums_rules,$f)))
### glib-compile-schemas
_GLIB_ENUMS_XML_GENERATED = $(filter %.enums.xml,$(GLIB_GENERATED))
_GLIB_GSETTINGS_SCHEMA_FILES = $(filter %.gschema.xml,$(gsettingsschema_DATA))
_GLIB_GSETTINGS_VALID_FILES = $(subst .xml,.valid,$(_GLIB_GSETTINGS_SCHEMA_FILES))
_glib_enums_xml_prefix = $(subst .,_,$(notdir $(1)))
_glib_enums_xml_sources_var = $(_glib_enums_xml_prefix)_sources
_glib_enums_xml_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enums_xml_sources_var)))
_glib_enums_xml_namespace = $(subst .enums.xml,,$(notdir $(1)))
define _glib_make_enums_xml_rule
$(if $(_glib_enums_xml_sources),,$(error Need to define $(_glib_enums_xml_sources_var) for $(1)))
$(1): $(_glib_enums_xml_sources)
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) --comments '<!-- @comment@ -->' --fhead "<schemalist>" --vhead " <@type@ id='$(_glib_enums_xml_namespace).@EnumName@'>" --vprod " <value nick='@valuenick@' value='@valuenum@'/>" --vtail " </@type@>" --ftail "</schemalist>" $$^ > $$@.tmp && mv $$@.tmp $$@
endef
_GLIB_V_CHECK = $(_glib_v_check_$(V))
_glib_v_check_ = $(_glib_v_check_$(AM_DEFAULT_VERBOSITY))
_glib_v_check_0 = @echo " CHECK " $(subst .valid,.xml,$@);
define _glib_make_schema_validate_rule
$(subst .xml,.valid,$(1)): $(_GLIB_ENUMS_XML_GENERATED) $(1)
$$(_GLIB_V_CHECK) $$(GLIB_COMPILE_SCHEMAS) --strict --dry-run $$(addprefix --schema-file=,$$^) && touch $$@
endef
define _glib_make_schema_rules
all-am: $(_GLIB_GSETTINGS_VALID_FILES)
install-data-am: glib-install-schemas-hook
glib-install-schemas-hook: install-gsettingsschemaDATA
@test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
uninstall-am: glib-uninstall-schemas-hook
glib-uninstall-schemas-hook: uninstall-gsettingsschemaDATA
@test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
.PHONY: glib-install-schemas-hook glib-uninstall-schemas-hook
endef
_GLIB_CLEANFILES += $(_GLIB_ENUMS_XML_GENERATED) $(_GLIB_GSETTINGS_VALID_FILES)
$(foreach f,$(_GLIB_ENUMS_XML_GENERATED),$(eval $(call _glib_make_enums_xml_rule,$f)))
$(foreach f,$(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(call _glib_make_schema_validate_rule,$f)))
$(if $(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(_glib_make_schema_rules)))
### Cleanup
.PHONY: clean-glib distclean-glib
clean-am: clean-glib
clean-glib:
$(if $(strip $(_GLIB_CLEANFILES)),-rm -f $(_GLIB_CLEANFILES))
distclean-am: distclean-glib
distclean-glib:
$(if $(strip $(_GLIB_DISTCLEANFILES)),-rm -f $(_GLIB_DISTCLEANFILES))

View File

@ -467,8 +467,12 @@ if test x"$ac_nss" = xno -a x"$ac_gnutls" = xno; then
AC_MSG_ERROR([Could not find required development headers and libraries for '$ac_crypto'])
fi
GLIB_MAKEFILE='$(top_srcdir)/Makefile.glib'
AC_SUBST(GLIB_MAKEFILE)
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
GLIB_MKENUMS='$(top_srcdir)/tools/glib-mkenums'
AC_SUBST(GLIB_MKENUMS)
AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
@ -677,7 +681,7 @@ include/Makefile
include/nm-version.h
src/Makefile
src/tests/Makefile
marshallers/Makefile
src/generated/Makefile
src/logging/Makefile
src/dns-manager/Makefile
src/vpn-manager/Makefile

View File

@ -1,3 +1,5 @@
include $(GLIB_MAKEFILE)
SUBDIRS=. tests
INCLUDES = \
@ -71,12 +73,14 @@ libnminclude_HEADERS = \
nm-remote-settings.h \
nm-secret-agent.h \
nm-device-wimax.h \
nm-wimax-nsp.h
nm-wimax-nsp.h \
nm-glib-enum-types.h
libnmvpn_HEADERS = \
nm-vpn-plugin.h \
nm-vpn-plugin-ui-interface.h \
nm-vpn-plugin-utils.h
nm-vpn-plugin-utils.h \
nm-vpn-enum-types.h
libnm_glib_la_csources = \
nm-object.c \
@ -100,22 +104,32 @@ libnm_glib_la_csources = \
nm-remote-settings.c \
nm-secret-agent.c \
nm-device-wimax.c \
nm-wimax-nsp.c
nm-wimax-nsp.c \
nm-glib-enum-types.c \
nm-glib-marshal.c
libnm_glib_la_private_headers = \
nm-object-private.h \
nm-device-private.h \
nm-types-private.h \
nm-object-cache.h \
nm-remote-connection-private.h
nm-remote-connection-private.h \
nm-glib-marshal.h
libnm_glib_la_SOURCES = \
$(libnm_glib_la_csources) \
$(libnm_glib_la_private_headers)
GLIB_GENERATED = nm-glib-enum-types.h nm-glib-enum-types.c
nm_glib_enum_types_sources = $(libnminclude_HEADERS)
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
GLIB_GENERATED += nm-glib-marshal.h nm-glib-marshal.c
nm_glib_marshal_sources = $(libnm_glib_la_SOURCES)
libnm_glib_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/marshallers/libmarshallers.la \
$(builddir)/libdeprecated-nm-glib.la \
$(GIO_LIBS) \
$(DBUS_LIBS) \
@ -136,12 +150,17 @@ libnm_glib_test_LDADD = libnm-glib.la $(top_builddir)/libnm-util/libnm-util.la $
libnm_glib_vpn_la_SOURCES = \
nm-vpn-plugin.c \
nm-vpn-plugin-ui-interface.c \
nm-vpn-plugin-utils.c
nm-vpn-plugin-utils.c \
nm-vpn-enum-types.c
GLIB_GENERATED += nm-vpn-enum-types.h nm-vpn-enum-types.c
nm_vpn_enum_types_sources = $(libnmvpn_HEADERS)
libnm_glib_vpn_la_CFLAGS = $(GIO_CFLAGS) $(DBUS_CFLAGS)
libnm_glib_vpn_la_LIBADD = $(top_builddir)/libnm-util/libnm-util.la $(GIO_LIBS) $(DBUS_LIBS)
libnm_glib_vpn_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib-vpn.ver \
-version-info "2:0:1"
BUILT_SOURCES += $(GLIB_GENERATED)
#####################################################
# Test libnm-glib stuff
#####################################################
@ -158,7 +177,6 @@ libnm_glib_test_la_SOURCES = \
libnm_glib_test_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/marshallers/libmarshallers.la \
$(GIO_LIBS) \
$(DBUS_LIBS) \
$(GUDEV_LIBS)

View File

@ -46,6 +46,8 @@ global:
nm_client_new;
nm_client_new_async;
nm_client_new_finish;
nm_client_permission_get_type;
nm_client_permission_result_get_type;
nm_client_sleep;
nm_client_wimax_get_enabled;
nm_client_wimax_hardware_get_enabled;
@ -169,6 +171,7 @@ global:
nm_secret_agent_register;
nm_secret_agent_save_secrets;
nm_secret_agent_unregister;
nm_secret_agent_get_secrets_flags_get_type;
nm_ssid_get_type;
nm_string_array_get_type;
nm_uint_array_get_type;
@ -182,6 +185,7 @@ global:
nm_wimax_nsp_get_network_type;
nm_wimax_nsp_get_signal_quality;
nm_wimax_nsp_get_type;
nm_wimax_nsp_network_type_get_type;
nm_wimax_nsp_new;
local:
*;

View File

@ -29,7 +29,7 @@
#include "nm-device-ethernet.h"
#include "nm-device-wifi.h"
#include "nm-device-private.h"
#include "nm-marshal.h"
#include "nm-glib-marshal.h"
#include "nm-types-private.h"
#include "nm-object-private.h"
#include "nm-active-connection.h"
@ -1739,7 +1739,7 @@ nm_client_class_init (NMClientClass *client_class)
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
_nm_marshal_VOID__UINT_UINT,
_nm_glib_marshal_VOID__UINT_UINT,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
}

View File

@ -31,7 +31,7 @@
#include "nm-device-modem.h"
#include "nm-device-private.h"
#include "nm-object-private.h"
#include "nm-marshal.h"
#include "nm-glib-marshal.h"
G_DEFINE_TYPE (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE)

View File

@ -36,7 +36,7 @@
#include "nm-device-private.h"
#include "nm-object-private.h"
#include "nm-object-cache.h"
#include "nm-marshal.h"
#include "nm-glib-marshal.h"
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
@ -202,7 +202,7 @@ constructed (GObject *object)
register_properties (NM_DEVICE (object));
dbus_g_object_register_marshaller (_nm_marshal_VOID__UINT_UINT_UINT,
dbus_g_object_register_marshaller (_nm_glib_marshal_VOID__UINT_UINT_UINT,
G_TYPE_NONE,
G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT,
G_TYPE_INVALID);
@ -612,7 +612,7 @@ nm_device_class_init (NMDeviceClass *device_class)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMDeviceClass, state_changed),
NULL, NULL,
_nm_marshal_VOID__UINT_UINT_UINT,
_nm_glib_marshal_VOID__UINT_UINT_UINT,
G_TYPE_NONE, 3,
G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
}

View File

@ -25,7 +25,7 @@
#include <NetworkManager.h>
#include <nm-connection.h>
#include "nm-marshal.h"
#include "nm-glib-marshal.h"
#include "nm-dbus-glib-types.h"
#include "nm-remote-settings.h"
#include "nm-remote-connection-private.h"
@ -102,26 +102,6 @@ nm_remote_settings_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_remote_settings_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_REMOTE_SETTINGS_ERROR_UNKNOWN, "UnknownError"),
ENUM_ENTRY (NM_REMOTE_SETTINGS_ERROR_CONNECTION_REMOVED, "ConnectionRemoved"),
ENUM_ENTRY (NM_REMOTE_SETTINGS_ERROR_CONNECTION_UNAVAILABLE, "ConnectionUnavailable"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMRemoteSettingsError", values);
}
return etype;
}
/**********************************************************************/
typedef struct {
@ -812,7 +792,7 @@ constructed (GObject *object)
"org.freedesktop.DBus");
g_assert (priv->dbus_proxy);
dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING_STRING,
dbus_g_object_register_marshaller (_nm_glib_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_INVALID);

View File

@ -55,9 +55,6 @@ typedef enum {
NM_REMOTE_SETTINGS_ERROR_CONNECTION_UNAVAILABLE,
} NMRemoteSettingsError;
#define NM_TYPE_REMOTE_SETTINGS_ERROR (nm_remote_settings_error_get_type ())
GType nm_remote_settings_error_get_type (void);
#define NM_REMOTE_SETTINGS_ERROR nm_remote_settings_error_quark ()
GQuark nm_remote_settings_error_quark (void);

View File

@ -25,7 +25,8 @@
#include <dbus/dbus-glib-lowlevel.h>
#include "nm-secret-agent.h"
#include "nm-marshal.h"
#include "nm-glib-enum-types.h"
#include "nm-glib-marshal.h"
#include "NetworkManager.h"
static void impl_secret_agent_get_secrets (NMSecretAgent *self,
@ -111,34 +112,6 @@ nm_secret_agent_error_quark (void)
return ret;
}
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_secret_agent_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Sender is not authorized to make this request */
ENUM_ENTRY (NM_SECRET_AGENT_ERROR_NOT_AUTHORIZED, "NotAuthorized"),
/* Given connection details do not make a valid connection */
ENUM_ENTRY (NM_SECRET_AGENT_ERROR_INVALID_CONNECTION, "InvalidConnection"),
/* The request was canceled explicitly by the user */
ENUM_ENTRY (NM_SECRET_AGENT_ERROR_USER_CANCELED, "UserCanceled"),
/* The request was canceled, but not by the user */
ENUM_ENTRY (NM_SECRET_AGENT_ERROR_AGENT_CANCELED, "AgentCanceled"),
/* Some internal error prevented returning secrets */
ENUM_ENTRY (NM_SECRET_AGENT_ERROR_INTERNAL_ERROR, "InternalError"),
/* No secrets could be found to fulfill the request */
ENUM_ENTRY (NM_SECRET_AGENT_ERROR_NO_SECRETS, "NoSecrets"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSecretAgentError", values);
}
return etype;
}
/*************************************************************/
static const char *
@ -806,7 +779,7 @@ nm_secret_agent_init (NMSecretAgent *self)
return;
}
dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING_STRING,
dbus_g_object_register_marshaller (_nm_glib_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_INVALID);

View File

@ -26,10 +26,8 @@
G_BEGIN_DECLS
#define NM_SECRET_AGENT_ERROR (nm_secret_agent_error_quark ())
#define NM_TYPE_SECRET_AGENT_ERROR (nm_secret_agent_error_get_type ())
GQuark nm_secret_agent_error_quark (void);
GType nm_secret_agent_error_get_type (void);
typedef enum {
NM_SECRET_AGENT_ERROR_NOT_AUTHORIZED = 0,

View File

@ -26,6 +26,8 @@
#include <glib.h>
#include <glib-object.h>
#include <nm-glib-enum-types.h>
G_BEGIN_DECLS
#define NM_TYPE_SSID (nm_ssid_get_type ())

View File

@ -25,7 +25,7 @@
#include "nm-vpn-connection.h"
#include "NetworkManager.h"
#include "nm-utils.h"
#include "nm-marshal.h"
#include "nm-glib-marshal.h"
#include "nm-object-private.h"
#include "nm-active-connection.h"
@ -178,7 +178,7 @@ constructed (GObject *object)
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_VPN_CONNECTION);
dbus_g_object_register_marshaller (_nm_marshal_VOID__UINT_UINT,
dbus_g_object_register_marshaller (_nm_glib_marshal_VOID__UINT_UINT,
G_TYPE_NONE,
G_TYPE_UINT, G_TYPE_UINT,
G_TYPE_INVALID);
@ -271,7 +271,7 @@ nm_vpn_connection_class_init (NMVPNConnectionClass *connection_class)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMVPNConnectionClass, vpn_state_changed),
NULL, NULL,
_nm_marshal_VOID__UINT_UINT,
_nm_glib_marshal_VOID__UINT_UINT,
G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_UINT);
}

View File

@ -24,6 +24,7 @@
#include <signal.h>
#include "nm-glib-compat.h"
#include "nm-vpn-plugin.h"
#include "nm-vpn-enum-types.h"
#include "nm-utils.h"
#include "nm-connection.h"
#include "nm-dbus-glib-types.h"
@ -107,33 +108,6 @@ nm_vpn_plugin_error_quark (void)
return quark;
}
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_vpn_plugin_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_GENERAL, "General"),
ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_STARTING_IN_PROGRESS, "StartingInProgress"),
ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_ALREADY_STARTED, "AlreadyStarted"),
ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_STOPPING_IN_PROGRESS, "StoppingInProgress"),
ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_ALREADY_STOPPED, "AlreadyStopped"),
ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_WRONG_STATE, "WrongState"),
ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, "BadArguments"),
ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED, "LaunchFailed"),
ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMVPNPluginError", values);
}
return etype;
}
static void
nm_vpn_plugin_set_connection (NMVPNPlugin *plugin,

View File

@ -55,7 +55,6 @@ typedef enum {
} NMVPNPluginError;
#define NM_VPN_PLUGIN_ERROR (nm_vpn_plugin_error_quark ())
#define NM_TYPE_VPN_PLUGIN_ERROR (nm_vpn_plugin_error_get_type ())
typedef struct {
GObject parent;

View File

@ -1,3 +1,5 @@
include $(GLIB_MAKEFILE)
SUBDIRS=. tests
INCLUDES = -I${top_srcdir} -I${top_srcdir}/include -I${top_builddir}/include
@ -31,6 +33,7 @@ libnm_util_include_HEADERS = \
nm-setting-wireless.h \
nm-setting-wireless-security.h \
nm-setting-vpn.h \
nm-utils-enum-types.h \
nm-utils.h
libnm_util_la_private_headers = \
@ -62,12 +65,19 @@ libnm_util_la_csources = \
nm-setting-wireless.c \
nm-setting-wireless-security.c \
nm-setting-vpn.c \
nm-utils-enum-types.c \
nm-utils.c
libnm_util_la_SOURCES = \
$(libnm_util_la_csources) \
$(libnm_util_la_private_headers)
GLIB_GENERATED = nm-utils-enum-types.h nm-utils-enum-types.c
BUILT_SOURCES = $(GLIB_GENERATED)
nm_utils_enum_types_sources = $(libnm_util_include_HEADERS)
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS)
SYMBOL_VIS_FILE=$(srcdir)/libnm-util.ver

View File

@ -103,6 +103,8 @@ global:
nm_setting_802_1x_add_altsubject_match;
nm_setting_802_1x_add_eap_method;
nm_setting_802_1x_add_phase2_altsubject_match;
nm_setting_802_1x_ck_format_get_type;
nm_setting_802_1x_ck_scheme_get_type;
nm_setting_802_1x_clear_altsubject_matches;
nm_setting_802_1x_clear_eap_methods;
nm_setting_802_1x_clear_phase2_altsubject_matches;
@ -196,6 +198,7 @@ global:
nm_setting_clear_secrets;
nm_setting_clear_secrets_with_flags;
nm_setting_compare;
nm_setting_compare_flags_get_type;
nm_setting_connection_add_permission;
nm_setting_connection_error_get_type;
nm_setting_connection_error_quark;
@ -216,6 +219,7 @@ global:
nm_setting_connection_permissions_user_allowed;
nm_setting_connection_remove_permission;
nm_setting_diff;
nm_setting_diff_result_get_type;
nm_setting_duplicate;
nm_setting_enumerate_values;
nm_setting_error_get_type;
@ -238,7 +242,10 @@ global:
nm_setting_gsm_get_pin_flags;
nm_setting_gsm_get_type;
nm_setting_gsm_get_username;
nm_setting_gsm_network_band_get_type;
nm_setting_gsm_network_type_get_type;
nm_setting_gsm_new;
nm_setting_hash_flags_get_type;
nm_setting_infiniband_error_get_type;
nm_setting_infiniband_error_quark;
nm_setting_infiniband_get_mac_address;
@ -346,6 +353,7 @@ global:
nm_setting_pppoe_get_type;
nm_setting_pppoe_get_username;
nm_setting_pppoe_new;
nm_setting_secret_flags_get_type;
nm_setting_serial_error_get_type;
nm_setting_serial_error_quark;
nm_setting_serial_get_baud;
@ -477,6 +485,7 @@ global:
nm_utils_is_empty_ssid;
nm_utils_rsa_key_encrypt;
nm_utils_same_ssid;
nm_utils_security_type_get_type;
nm_utils_security_valid;
nm_utils_slist_free;
nm_utils_ssid_to_utf8;
@ -486,6 +495,7 @@ global:
nm_utils_wifi_find_next_channel;
nm_utils_wifi_freq_to_channel;
nm_utils_wifi_is_channel_valid;
nm_wep_key_type_get_type;
local:
*;
};

View File

@ -89,27 +89,6 @@ nm_connection_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_connection_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_CONNECTION_ERROR_UNKNOWN, "UnknownError"),
ENUM_ENTRY (NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND, "ConnectionSettingNotFound"),
ENUM_ENTRY (NM_CONNECTION_ERROR_CONNECTION_TYPE_INVALID, "ConnectionTypeInvalid"),
ENUM_ENTRY (NM_CONNECTION_ERROR_SETTING_NOT_FOUND, "SettingNotFound"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMConnectionError", values);
}
return etype;
}
typedef struct {
GHashTable *settings;

View File

@ -83,9 +83,6 @@ typedef enum
NM_CONNECTION_ERROR_SETTING_NOT_FOUND
} NMConnectionError;
#define NM_TYPE_CONNECTION_ERROR (nm_connection_error_get_type ())
GType nm_connection_error_get_type (void);
#define NM_CONNECTION_ERROR nm_connection_error_quark ()
GQuark nm_connection_error_quark (void);

View File

@ -82,30 +82,6 @@ nm_setting_802_1x_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_802_1x_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_802_1X_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, "MissingProperty"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSetting8021xError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSetting8021x, nm_setting_802_1x, NM_TYPE_SETTING)
#define NM_SETTING_802_1X_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_802_1X, NMSetting8021xPrivate))

View File

@ -42,7 +42,7 @@ G_BEGIN_DECLS
* #NMSetting8021xCKFormat values indicate the general type of a certificate
* or private key
*/
typedef enum {
typedef enum { /*< underscore_name=nm_setting_802_1x_ck_format >*/
NM_SETTING_802_1X_CK_FORMAT_UNKNOWN = 0,
NM_SETTING_802_1X_CK_FORMAT_X509,
NM_SETTING_802_1X_CK_FORMAT_RAW_KEY,
@ -62,7 +62,7 @@ typedef enum {
* stored in the setting properties, either as a blob of the item's data, or as
* a path to a certificate or private key file on the filesystem
*/
typedef enum {
typedef enum { /*< underscore_name=nm_setting_802_1x_ck_scheme >*/
NM_SETTING_802_1X_CK_SCHEME_UNKNOWN = 0,
NM_SETTING_802_1X_CK_SCHEME_BLOB,
NM_SETTING_802_1X_CK_SCHEME_PATH
@ -85,15 +85,12 @@ typedef enum {
* @NM_SETTING_802_1X_ERROR_MISSING_PROPERTY: the property was missing and is
* required
*/
typedef enum {
typedef enum { /*< underscore_name=nm_setting_802_1x_error >*/
NM_SETTING_802_1X_ERROR_UNKNOWN = 0,
NM_SETTING_802_1X_ERROR_INVALID_PROPERTY,
NM_SETTING_802_1X_ERROR_MISSING_PROPERTY
} NMSetting8021xError;
#define NM_TYPE_SETTING_802_1X_ERROR (nm_setting_802_1x_error_get_type ())
GType nm_setting_802_1x_error_get_type (void);
#define NM_SETTING_802_1X_ERROR nm_setting_802_1x_error_quark ()
GQuark nm_setting_802_1x_error_quark (void);

View File

@ -62,27 +62,6 @@ nm_setting_bluetooth_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_bluetooth_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_UNKNOWN, "UnknownError"),
ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_INVALID_PROPERTY, "InvalidProperty"),
ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_MISSING_PROPERTY, "MissingProperty"),
ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND, "TypeSettingNotFound"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingBluetoothError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING)

View File

@ -57,9 +57,6 @@ typedef enum {
NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND,
} NMSettingBluetoothError;
#define NM_TYPE_SETTING_BLUETOOTH_ERROR (nm_setting_bluetooth_error_get_type ())
GType nm_setting_bluetooth_error_get_type (void);
#define NM_SETTING_BLUETOOTH_ERROR nm_setting_bluetooth_error_quark ()
GQuark nm_setting_bluetooth_error_quark (void);

View File

@ -57,31 +57,6 @@ nm_setting_bond_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_bond_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_BOND_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_BOND_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_BOND_ERROR_MISSING_PROPERTY, "MissingProperty"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingBondError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingBond, nm_setting_bond, NM_TYPE_SETTING)

View File

@ -50,9 +50,6 @@ typedef enum {
NM_SETTING_BOND_ERROR_MISSING_PROPERTY,
} NMSettingBondError;
#define NM_TYPE_SETTING_BOND_ERROR (nm_setting_bond_error_get_type ())
GType nm_setting_bond_error_get_type (void);
#define NM_SETTING_BOND_ERROR nm_setting_bond_error_quark ()
GQuark nm_setting_bond_error_quark (void);

View File

@ -53,31 +53,6 @@ nm_setting_cdma_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_cdma_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_CDMA_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_CDMA_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The required serial setting is missing (DEPRECATED) */
ENUM_ENTRY (NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING, "MissingSerialSetting"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingCdmaError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingCdma, nm_setting_cdma, NM_TYPE_SETTING)

View File

@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING
} NMSettingCdmaError;
#define NM_TYPE_SETTING_CDMA_ERROR (nm_setting_cdma_error_get_type ())
GType nm_setting_cdma_error_get_type (void);
#define NM_SETTING_CDMA_ERROR nm_setting_cdma_error_quark ()
GQuark nm_setting_cdma_error_quark (void);

View File

@ -58,28 +58,6 @@ nm_setting_connection_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_connection_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_UNKNOWN, "UnknownError"),
ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY, "InvalidProperty"),
ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY, "MissingProperty"),
ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND, "TypeSettingNotFound"),
ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED, "IpConfigNotAllowed"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingConnectionError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING)

View File

@ -65,9 +65,6 @@ typedef enum
NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED,
} NMSettingConnectionError;
#define NM_TYPE_SETTING_CONNECTION_ERROR (nm_setting_connection_error_get_type ())
GType nm_setting_connection_error_get_type (void);
#define NM_SETTING_CONNECTION_ERROR nm_setting_connection_error_quark ()
GQuark nm_setting_connection_error_quark (void);

View File

@ -56,31 +56,6 @@ nm_setting_gsm_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_gsm_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_GSM_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_GSM_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_GSM_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The required serial setting is missing (DEPRECATED) */
ENUM_ENTRY (NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING, "MissingSerialSetting"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingGsmError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingGsm, nm_setting_gsm, NM_TYPE_SETTING)

View File

@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING
} NMSettingGsmError;
#define NM_TYPE_SETTING_GSM_ERROR (nm_setting_gsm_error_get_type ())
GType nm_setting_gsm_error_get_type (void);
#define NM_SETTING_GSM_ERROR nm_setting_gsm_error_quark ()
GQuark nm_setting_gsm_error_quark (void);

View File

@ -52,29 +52,6 @@ nm_setting_infiniband_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_infiniband_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_INFINIBAND_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_INFINIBAND_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_INFINIBAND_ERROR_MISSING_PROPERTY, "MissingProperty"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingInfinibandError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingInfiniband, nm_setting_infiniband, NM_TYPE_SETTING)
#define NM_SETTING_INFINIBAND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_INFINIBAND, NMSettingInfinibandPrivate))

View File

@ -48,9 +48,6 @@ typedef enum {
NM_SETTING_INFINIBAND_ERROR_MISSING_PROPERTY
} NMSettingInfinibandError;
#define NM_TYPE_SETTING_INFINIBAND_ERROR (nm_setting_infiniband_error_get_type ())
GType nm_setting_infiniband_error_get_type (void);
#define NM_SETTING_INFINIBAND_ERROR nm_setting_infiniband_error_quark ()
GQuark nm_setting_infiniband_error_quark (void);

View File

@ -57,31 +57,6 @@ nm_setting_ip4_config_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_ip4_config_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The specified property was not allowed in combination with the current 'method' */
ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, "NotAllowedForMethod"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingIP4ConfigError", values);
}
return etype;
}
#if GLIB_CHECK_VERSION(2,26,0)
G_DEFINE_BOXED_TYPE (NMIP4Address, nm_ip4_address, nm_ip4_address_dup, nm_ip4_address_unref)
G_DEFINE_BOXED_TYPE (NMIP4Route, nm_ip4_route, nm_ip4_route_dup, nm_ip4_route_unref)

View File

@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD
} NMSettingIP4ConfigError;
#define NM_TYPE_SETTING_IP4_CONFIG_ERROR (nm_setting_ip4_config_error_get_type ())
GType nm_setting_ip4_config_error_get_type (void);
#define NM_SETTING_IP4_CONFIG_ERROR nm_setting_ip4_config_error_quark ()
GQuark nm_setting_ip4_config_error_quark (void);

View File

@ -56,31 +56,6 @@ nm_setting_ip6_config_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_ip6_config_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The specified property was not allowed in combination with the current 'method' */
ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, "NotAllowedForMethod"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingIP6ConfigError", values);
}
return etype;
}
#if GLIB_CHECK_VERSION(2,26,0)
G_DEFINE_BOXED_TYPE (NMIP6Address, nm_ip6_address, nm_ip6_address_dup, nm_ip6_address_unref)
G_DEFINE_BOXED_TYPE (NMIP6Route, nm_ip6_route, nm_ip6_route_dup, nm_ip6_route_unref)

View File

@ -56,9 +56,6 @@ typedef enum {
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD
} NMSettingIP6ConfigError;
#define NM_TYPE_SETTING_IP6_CONFIG_ERROR (nm_setting_ip6_config_error_get_type ())
GType nm_setting_ip6_config_error_get_type (void);
#define NM_SETTING_IP6_CONFIG_ERROR nm_setting_ip6_config_error_quark ()
GQuark nm_setting_ip6_config_error_quark (void);

View File

@ -46,29 +46,6 @@ nm_setting_olpc_mesh_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_olpc_mesh_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_OLPC_MESH_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_OLPC_MESH_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_OLPC_MESH_ERROR_MISSING_PROPERTY, "MissingProperty"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingOlpcMeshError", values);
}
return etype;
}
static void nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting);
G_DEFINE_TYPE (NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING)

View File

@ -48,9 +48,6 @@ typedef enum
NM_SETTING_OLPC_MESH_ERROR_MISSING_PROPERTY
} NMSettingOlpcMeshError;
#define NM_TYPE_SETTING_OLPC_MESH_ERROR (nm_setting_olpc_mesh_error_get_type ())
GType nm_setting_olpc_mesh_error_get_type (void);
#define NM_SETTING_OLPC_MESH_ERROR nm_setting_olpc_mesh_error_quark ()
GQuark nm_setting_olpc_mesh_error_quark (void);

View File

@ -53,31 +53,6 @@ nm_setting_ppp_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_ppp_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_PPP_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_PPP_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_PPP_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The 'require-mppe' option is not allowed in conjunction with the specified authentication. */
ENUM_ENTRY (NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED, "RequireMPPENotAllowed"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingPPPError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingPPP, nm_setting_ppp, NM_TYPE_SETTING)

View File

@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED
} NMSettingPPPError;
#define NM_TYPE_SETTING_PPP_ERROR (nm_setting_ppp_error_get_type ())
GType nm_setting_ppp_error_get_type (void);
#define NM_SETTING_PPP_ERROR nm_setting_ppp_error_quark ()
GQuark nm_setting_ppp_error_quark (void);

View File

@ -55,31 +55,6 @@ nm_setting_pppoe_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_pppoe_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The required PPP setting is missing */
ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING, "MissingPPPSetting"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingPPPOEError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingPPPOE, nm_setting_pppoe, NM_TYPE_SETTING)

View File

@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING
} NMSettingPPPOEError;
#define NM_TYPE_SETTING_PPPOE_ERROR (nm_setting_pppoe_error_get_type ())
GType nm_setting_pppoe_error_get_type (void);
#define NM_SETTING_PPPOE_ERROR nm_setting_pppoe_error_quark ()
GQuark nm_setting_pppoe_error_quark (void);

View File

@ -56,31 +56,6 @@ nm_setting_serial_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_serial_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The required PPP setting is missing (DEPRECATED) */
ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING, "MissingPPPSetting"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingSerialError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingSerial, nm_setting_serial, NM_TYPE_SETTING)

View File

@ -55,9 +55,6 @@ typedef enum {
NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING
} NMSettingSerialError;
#define NM_TYPE_SETTING_SERIAL_ERROR (nm_setting_serial_error_get_type ())
GType nm_setting_serial_error_get_type (void);
#define NM_SETTING_SERIAL_ERROR nm_setting_serial_error_quark ()
GQuark nm_setting_serial_error_quark (void);

View File

@ -63,29 +63,6 @@ nm_setting_vpn_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_vpn_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_VPN_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_VPN_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_VPN_ERROR_MISSING_PROPERTY, "MissingProperty"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingVpnError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingVPN, nm_setting_vpn, NM_TYPE_SETTING)

View File

@ -52,9 +52,6 @@ typedef enum {
NM_SETTING_VPN_ERROR_MISSING_PROPERTY,
} NMSettingVpnError;
#define NM_TYPE_SETTING_VPN_ERROR (nm_setting_vpn_error_get_type ())
GType nm_setting_vpn_error_get_type (void);
#define NM_SETTING_VPN_ERROR nm_setting_vpn_error_quark ()
GQuark nm_setting_vpn_error_quark (void);

View File

@ -53,29 +53,6 @@ nm_setting_wimax_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_wimax_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_WIMAX_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_WIMAX_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_WIMAX_ERROR_MISSING_PROPERTY, "MissingProperty"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingWimaxError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING)

View File

@ -48,9 +48,6 @@ typedef enum {
NM_SETTING_WIMAX_ERROR_MISSING_PROPERTY
} NMSettingWimaxError;
#define NM_TYPE_SETTING_WIMAX_ERROR (nm_setting_wimax_error_get_type ())
GType nm_setting_wimax_error_get_type (void);
#define NM_SETTING_WIMAX_ERROR nm_setting_wimax_error_quark ()
GQuark nm_setting_wimax_error_quark (void);

View File

@ -61,29 +61,6 @@ nm_setting_wired_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_wired_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_WIRED_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_WIRED_ERROR_MISSING_PROPERTY, "MissingProperty"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingWiredError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingWired, nm_setting_wired, NM_TYPE_SETTING)

View File

@ -52,9 +52,6 @@ typedef enum {
NM_SETTING_WIRED_ERROR_MISSING_PROPERTY
} NMSettingWiredError;
#define NM_TYPE_SETTING_WIRED_ERROR (nm_setting_wired_error_get_type ())
GType nm_setting_wired_error_get_type (void);
#define NM_SETTING_WIRED_ERROR nm_setting_wired_error_quark ()
GQuark nm_setting_wired_error_quark (void);

View File

@ -75,37 +75,6 @@ nm_setting_wireless_security_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_wireless_security_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The required 802.1x setting is missing */
ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING, "Missing8021xSetting"),
/* The LEAP authentication algorithm requires use of 802.1x key management. */
ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X, "LEAPRequires8021x"),
/* The LEAP authentication algorithm requires a username. */
ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME, "LEAPRequiresUsername"),
/* Shared Key authentication can only be used with WEP encryption. */
ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP, "SharedKeyRequiresWEP"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingWirelessSecurityError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingWirelessSecurity, nm_setting_wireless_security, NM_TYPE_SETTING)

View File

@ -65,9 +65,6 @@ typedef enum {
NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP
} NMSettingWirelessSecurityError;
#define NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR (nm_setting_wireless_security_error_get_type ())
GType nm_setting_wireless_security_error_get_type (void);
#define NM_SETTING_WIRELESS_SECURITY_ERROR nm_setting_wireless_security_error_quark ()
GQuark nm_setting_wireless_security_error_quark (void);

View File

@ -61,33 +61,6 @@ nm_setting_wireless_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_wireless_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_UNKNOWN, "UnknownError"),
/* The specified property was invalid. */
ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The required security setting is missing */
ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING, "MissingSecuritySetting"),
/* The 'channel' property requires a valid 'band' */
ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND, "ChannelRequiresBand"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingWirelessError", values);
}
return etype;
}
G_DEFINE_TYPE (NMSettingWireless, nm_setting_wireless, NM_TYPE_SETTING)

View File

@ -60,9 +60,6 @@ typedef enum {
NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND
} NMSettingWirelessError;
#define NM_TYPE_SETTING_WIRELESS_ERROR (nm_setting_wireless_error_get_type ())
GType nm_setting_wireless_error_get_type (void);
#define NM_SETTING_WIRELESS_ERROR nm_setting_wireless_error_quark ()
GQuark nm_setting_wireless_error_quark (void);

View File

@ -60,27 +60,6 @@ nm_setting_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_setting_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_SETTING_ERROR_UNKNOWN, "UnknownError"),
ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_NOT_FOUND, "PropertyNotFound"),
ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_NOT_SECRET, "PropertyNotSecret"),
ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH, "PropertyTypeMismatch"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingError", values);
}
return etype;
}
G_DEFINE_ABSTRACT_TYPE (NMSetting, nm_setting, G_TYPE_OBJECT)
#define NM_SETTING_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING, NMSettingPrivate))

View File

@ -60,9 +60,6 @@ typedef enum
NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH
} NMSettingError;
#define NM_TYPE_SETTING_ERROR (nm_setting_error_get_type ())
GType nm_setting_error_get_type (void);
#define NM_SETTING_ERROR nm_setting_error_quark ()
GQuark nm_setting_error_quark (void);

View File

@ -29,6 +29,7 @@
#include <glib.h>
#include "nm-connection.h"
#include "nm-utils-enum-types.h"
G_BEGIN_DECLS

View File

@ -1,27 +0,0 @@
noinst_LTLIBRARIES = libmarshallers.la
BUILT_SOURCES = \
nm-marshal.h \
nm-marshal.c
libmarshallers_la_SOURCES = \
nm-marshal-main.c
libmarshallers_la_CPPFLAGS = \
$(GLIB_CFLAGS) \
-DG_DISABLE_DEPRECATED
libmarshallers_la_LIBADD = $(GLIB_LIBS)
EXTRA_DIST = nm-marshal.list
CLEANFILES = $(BUILT_SOURCES)
nm-marshal.h: nm-marshal.list
$(GLIB_GENMARSHAL) $< --prefix=_nm_marshal --header > $@
nm-marshal.c: nm-marshal.list
$(GLIB_GENMARSHAL) $< --prefix=_nm_marshal --body > $@
nm-marshal-main.c: nm-marshal.c nm-marshal.h

View File

@ -1,2 +0,0 @@
#include "nm-marshal.h"
#include "nm-marshal.c"

View File

@ -1,30 +0,0 @@
VOID:OBJECT
VOID:OBJECT,STRING
VOID:OBJECT,STRING,UINT
VOID:OBJECT,UINT
VOID:OBJECT,POINTER
VOID:OBJECT,POINTER,UINT
VOID:POINTER
VOID:STRING,STRING,STRING
VOID:UINT,UINT
VOID:UINT,UINT,UINT
VOID:STRING,STRING
VOID:STRING,UCHAR
VOID:STRING,OBJECT
VOID:POINTER,POINTER
VOID:STRING,STRING,STRING,UINT
VOID:OBJECT,UINT,UINT
VOID:STRING,INT
VOID:INT,UINT
VOID:INT,UINT,BOOLEAN
VOID:OBJECT,OBJECT,ENUM
VOID:POINTER,STRING
VOID:STRING,BOXED
BOOLEAN:POINTER,STRING,BOOLEAN,UINT,STRING,STRING
VOID:STRING,BOOLEAN,UINT,STRING,STRING
BOOLEAN:VOID
VOID:STRING,BOOLEAN
VOID:STRING,OBJECT,POINTER
VOID:BOOLEAN,UINT
UINT:STRING,STRING,POINTER,POINTER
VOID:POINTER,POINTER,POINTER,POINTER,INT

View File

@ -1,4 +1,5 @@
SUBDIRS= \
generated \
logging \
dns-manager \
vpn-manager \
@ -22,7 +23,7 @@ SUBDIRS += . tests
INCLUDES = -I${top_srcdir} \
-I${top_srcdir}/include \
-I${top_builddir}/include \
-I${top_builddir}/marshallers \
-I${top_srcdir}/src/generated \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src/dns-manager \
-I${top_srcdir}/src/vpn-manager \
@ -62,7 +63,7 @@ libtest_dhcp_la_CPPFLAGS = \
$(LIBNL_CFLAGS)
libtest_dhcp_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/generated/libnm-generated.la \
$(top_builddir)/libnm-util/libnm-util.la \
$(GLIB_LIBS) \
$(DBUS_LIBS) \
@ -276,7 +277,7 @@ NetworkManager_CPPFLAGS = \
-DARP_DEBUG
NetworkManager_LDADD = \
$(top_builddir)/marshallers/libmarshallers.la \
./generated/libnm-generated.la \
./logging/libnm-logging.la \
./dns-manager/libdns-manager.la \
./vpn-manager/libvpn-manager.la \

View File

@ -4,8 +4,8 @@ INCLUDES = \
-I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/src \
-I${top_srcdir}/src/logging \
-I${top_builddir}/marshallers
-I${top_srcdir}/src/generated \
-I${top_srcdir}/src/logging
noinst_LTLIBRARIES = libbluez-manager.la
@ -30,7 +30,7 @@ libbluez_manager_la_CPPFLAGS = \
-DLOCALSTATEDIR=\"$(localstatedir)\"
libbluez_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/generated/libnm-generated.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(DBUS_LIBS) \
$(GLIB_LIBS) \

View File

@ -4,7 +4,7 @@ INCLUDES = \
-I${top_srcdir} \
-I${top_srcdir}/include \
-I${top_builddir}/include \
-I${top_builddir}/marshallers \
-I${top_srcdir}/src/generated \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/src
@ -30,7 +30,6 @@ libdhcp_dhclient_la_CPPFLAGS = \
-DDHCLIENT_V$(DHCLIENT_VERSION)
libdhcp_dhclient_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(top_builddir)/libnm-util/libnm-util.la \
$(DBUS_LIBS) \
@ -56,7 +55,6 @@ libdhcp_manager_la_CPPFLAGS = \
-DDHCPCD_PATH=\"$(DHCPCD_PATH)\"
libdhcp_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(builddir)/libdhcp-dhclient.la \
$(DBUS_LIBS) \

View File

@ -44,8 +44,6 @@
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GQuark
nm_dhcp_manager_error_quark (void)
{
@ -57,22 +55,6 @@ nm_dhcp_manager_error_quark (void)
return ret;
}
GType
nm_dhcp_manager_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_DHCP_MANAGER_ERROR_BAD_CLIENT, "BadClient"),
ENUM_ENTRY (NM_DHCP_MANAGER_ERROR_INTERNAL, "InternalError"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMDhcpManagerError", values);
}
return etype;
}
#define NM_DHCP_CLIENT_DBUS_SERVICE "org.freedesktop.nm_dhcp_client"
#define NM_DHCP_CLIENT_DBUS_IFACE "org.freedesktop.nm_dhcp_client"

View File

@ -33,16 +33,14 @@
#include "nm-dhcp4-config.h"
#include "nm-hostname-provider.h"
enum {
typedef enum {
NM_DHCP_MANAGER_ERROR_BAD_CLIENT = 0,
NM_DHCP_MANAGER_ERROR_INTERNAL = 1,
};
} NMDHCPManagerError;
#define NM_DHCP_MANAGER_ERROR (nm_dhcp_manager_error_quark ())
#define NN_TYPE_DHCP_MANAGER_ERROR (nm_dhcp_manager_error_get_type ())
GQuark nm_dhcp_manager_error_quark (void);
GType nm_dhcp_manager_error_get_type (void);
#define NM_TYPE_DHCP_MANAGER (nm_dhcp_manager_get_type ())

View File

@ -2,8 +2,7 @@ INCLUDES = \
-I${top_srcdir}/src \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/include \
-I${top_srcdir}/libnm-util \
-I${top_builddir}/marshallers
-I${top_srcdir}/libnm-util
noinst_LTLIBRARIES = libfirewall-manager.la
@ -18,7 +17,6 @@ libfirewall_manager_la_CPPFLAGS = \
-DNM_LOCALSTATEDIR=\"$(localstatedir)\"
libfirewall_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(DBUS_LIBS) \
$(GLIB_LIBS)

75
src/generated/Makefile.am Normal file
View File

@ -0,0 +1,75 @@
include $(GLIB_MAKEFILE)
noinst_LTLIBRARIES = libnm-generated.la
libnm_generated_la_SOURCES = \
nm-enum-types.c \
nm-enum-types.h \
nm-marshal.c \
nm-marshal.h
nm_daemon_all_sources = \
$(top_srcdir)/src/*.[ch] \
$(top_srcdir)/src/logging/*.[ch] \
$(top_srcdir)/src/dns-manager/*.[ch] \
$(top_srcdir)/src/vpn-manager/*.[ch] \
$(top_srcdir)/src/dhcp-manager/*.[ch] \
$(top_srcdir)/src/ip6-manager/*.[ch] \
$(top_srcdir)/src/supplicant-manager/*.[ch] \
$(top_srcdir)/src/backends/*.[ch] \
$(top_srcdir)/src/ppp-manager/*.[ch] \
$(top_srcdir)/src/dnsmasq-manager/*.[ch] \
$(top_srcdir)/src/modem-manager/*.[ch] \
$(top_srcdir)/src/bluez-manager/*.[ch] \
$(top_srcdir)/src/firewall-manager/*.[ch] \
$(top_srcdir)/src/settings/*.[ch]
if WITH_WIMAX
nm_daemon_all_sources += $(top_srcdir)/src/wimax/*.[ch]
endif
nm_daemon_sources = \
$(filter-out %-glue.h %-bindings.h, $(wildcard $(nm_daemon_all_sources)))
GLIB_GENERATED = nm-enum-types.h nm-enum-types.c
nm_enum_types_sources = $(nm_daemon_sources)
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
GLIB_GENERATED += nm-marshal.h nm-marshal.c
nm_marshal_sources = $(nm_daemon_sources)
INCLUDES = \
-I${top_srcdir}/include \
-I${top_srcdir}/src \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src/dns-manager \
-I${top_srcdir}/src/vpn-manager \
-I${top_srcdir}/src/dhcp-manager \
-I${top_srcdir}/src/ip6-manager \
-I${top_srcdir}/src/supplicant-manager \
-I${top_srcdir}/src/backends \
-I${top_srcdir}/src/ppp-manager \
-I${top_srcdir}/src/dnsmasq-manager \
-I${top_srcdir}/src/modem-manager \
-I$(top_srcdir)/src/bluez-manager \
-I$(top_srcdir)/src/firewall-manager \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/src/wimax \
-I$(top_srcdir)/libnm-util
libnm_generated_la_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS) \
$(GUDEV_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GMODULE_CFLAGS) \
$(POLKIT_CFLAGS) \
$(SYSTEMD_CFLAGS) \
$(IWMX_SDK_CFLAGS)
libnm_generated_la_LIBADD = \
$(GLIB_LIBS)
BUILT_SOURCES = $(GLIB_GENERATED)

View File

@ -2,8 +2,8 @@ INCLUDES = \
-I${top_srcdir} \
-I${top_srcdir}/include \
-I${top_builddir}/include \
-I${top_builddir}/marshallers \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/src/generated \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src
@ -20,7 +20,7 @@ libip6_manager_la_CPPFLAGS = \
-DG_DISABLE_DEPRECATED
libip6_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/generated/libnm-generated.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(LIBNL_LIBS) \
$(DBUS_LIBS) \

View File

@ -94,13 +94,6 @@ static const LogDesc domain_descs[] = {
/************************************************************************/
enum {
NM_LOGGING_ERROR_UNKNOWN_LEVEL = 0,
NM_LOGGING_ERROR_UNKNOWN_DOMAIN = 1,
};
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GQuark
nm_logging_error_quark (void)
{
@ -111,22 +104,6 @@ nm_logging_error_quark (void)
return ret;
}
GType
nm_logging_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_LOGGING_ERROR_UNKNOWN_LEVEL, "UnknownLevel"),
ENUM_ENTRY (NM_LOGGING_ERROR_UNKNOWN_DOMAIN, "UnknownDomain"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMLoggingError", values);
}
return etype;
}
/************************************************************************/
gboolean

View File

@ -66,10 +66,13 @@ enum {
LOGL_DEBUG = 0x00000008
};
typedef enum {
NM_LOGGING_ERROR_UNKNOWN_LEVEL = 0,
NM_LOGGING_ERROR_UNKNOWN_DOMAIN = 1,
} NMLoggingError;
#define NM_LOGGING_ERROR (nm_logging_error_quark ())
#define NM_TYPE_LOGGING_ERROR (nm_logging_error_get_type ())
GQuark nm_logging_error_quark (void);
GType nm_logging_error_get_type (void);
#define nm_log_err(domain, ...) \

View File

@ -1,10 +1,12 @@
include $(GLIB_MAKEFILE)
INCLUDES = \
-I${top_srcdir}/src \
-I${top_srcdir}/src/generated \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/include \
-I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
-I${top_builddir}/marshallers
-I${top_srcdir}/libnm-util
noinst_LTLIBRARIES = libmodem-manager.la
@ -24,7 +26,7 @@ libmodem_manager_la_CPPFLAGS = \
$(DBUS_CFLAGS)
libmodem_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/generated/libnm-generated.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(LIBNL_LIBS) \
$(DBUS_LIBS)

View File

@ -27,6 +27,7 @@
#include "nm-dbus-glib-types.h"
#include "nm-modem-cdma.h"
#include "nm-modem-types.h"
#include "nm-enum-types.h"
#include "nm-device.h"
#include "nm-device-private.h"
#include "nm-dbus-manager.h"
@ -47,14 +48,7 @@ typedef struct {
} NMModemCdmaPrivate;
typedef enum {
NM_CDMA_ERROR_CONNECTION_NOT_CDMA = 0,
NM_CDMA_ERROR_CONNECTION_INVALID,
NM_CDMA_ERROR_CONNECTION_INCOMPATIBLE,
} NMCdmaError;
#define NM_CDMA_ERROR (nm_cdma_error_quark ())
#define NM_TYPE_CDMA_ERROR (nm_cdma_error_get_type ())
static GQuark
nm_cdma_error_quark (void)
@ -65,29 +59,6 @@ nm_cdma_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_cdma_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Connection was not a CDMA connection. */
ENUM_ENTRY (NM_CDMA_ERROR_CONNECTION_NOT_CDMA, "ConnectionNotCdma"),
/* Connection was not a valid CDMA connection. */
ENUM_ENTRY (NM_CDMA_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
/* Connection does not apply to this device. */
ENUM_ENTRY (NM_CDMA_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMCdmaError", values);
}
return etype;
}
NMModem *
nm_modem_cdma_new (const char *path,

View File

@ -33,6 +33,12 @@ G_BEGIN_DECLS
#define NM_IS_MODEM_CDMA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM_CDMA))
#define NM_MODEM_CDMA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM_CDMA, NMModemCdmaClass))
typedef enum {
NM_CDMA_ERROR_CONNECTION_NOT_CDMA = 0,
NM_CDMA_ERROR_CONNECTION_INVALID,
NM_CDMA_ERROR_CONNECTION_INCOMPATIBLE,
} NMCdmaError;
typedef struct {
NMModem parent;
} NMModemCdma;

View File

@ -32,6 +32,7 @@
#include "nm-setting-gsm.h"
#include "nm-setting-ppp.h"
#include "nm-modem-types.h"
#include "nm-enum-types.h"
#include "nm-logging.h"
#include "NetworkManagerUtils.h"
@ -76,14 +77,7 @@ typedef struct {
} NMModemGsmPrivate;
typedef enum {
NM_GSM_ERROR_CONNECTION_NOT_GSM = 0,
NM_GSM_ERROR_CONNECTION_INVALID,
NM_GSM_ERROR_CONNECTION_INCOMPATIBLE,
} NMGsmError;
#define NM_GSM_ERROR (nm_gsm_error_quark ())
#define NM_TYPE_GSM_ERROR (nm_gsm_error_get_type ())
static GQuark
nm_gsm_error_quark (void)
@ -94,30 +88,6 @@ nm_gsm_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_gsm_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Connection was not a GSM connection. */
ENUM_ENTRY (NM_GSM_ERROR_CONNECTION_NOT_GSM, "ConnectionNotGsm"),
/* Connection was not a valid GSM connection. */
ENUM_ENTRY (NM_GSM_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
/* Connection does not apply to this device. */
ENUM_ENTRY (NM_GSM_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMGsmError", values);
}
return etype;
}
NMModem *
nm_modem_gsm_new (const char *path,
const char *device,

View File

@ -33,6 +33,12 @@ G_BEGIN_DECLS
#define NM_IS_MODEM_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM_GSM))
#define NM_MODEM_GSM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM_GSM, NMModemGsmClass))
typedef enum {
NM_GSM_ERROR_CONNECTION_NOT_GSM = 0,
NM_GSM_ERROR_CONNECTION_INVALID,
NM_GSM_ERROR_CONNECTION_INCOMPATIBLE,
} NMGsmError;
typedef struct {
NMModem parent;
} NMModemGsm;

View File

@ -47,25 +47,6 @@ nm_config_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_config_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Not enough memory to parse the config file. */
ENUM_ENTRY (NM_CONFIG_ERROR_NO_MEMORY, "NoMemory"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMConfigError", values);
}
return etype;
}
/************************************************************************/
const char *

View File

@ -32,8 +32,6 @@ typedef enum {
#define NM_CONFIG_ERROR (nm_config_error_quark ())
GQuark nm_config_error_quark (void);
#define NM_TYPE_CONFIG_ERROR (nm_config_error_get_type ())
GType nm_config_error_get_type (void);
NMConfig *nm_config_new (const char *cli_config_path,

View File

@ -44,6 +44,7 @@
#include "nm-setting-ppp.h"
#include "nm-device-bt-glue.h"
#include "NetworkManagerUtils.h"
#include "nm-enum-types.h"
#define BLUETOOTH_DUN_UUID "dun"
#define BLUETOOTH_NAP_UUID "nap"
@ -90,14 +91,7 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
typedef enum {
NM_BT_ERROR_CONNECTION_NOT_BT = 0,
NM_BT_ERROR_CONNECTION_INVALID,
NM_BT_ERROR_CONNECTION_INCOMPATIBLE,
} NMBtError;
#define NM_BT_ERROR (nm_bt_error_quark ())
#define NM_TYPE_BT_ERROR (nm_bt_error_get_type ())
static GQuark
nm_bt_error_quark (void)
@ -108,30 +102,6 @@ nm_bt_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_bt_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Connection was not a BT connection. */
ENUM_ENTRY (NM_BT_ERROR_CONNECTION_NOT_BT, "ConnectionNotBt"),
/* Connection was not a valid BT connection. */
ENUM_ENTRY (NM_BT_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
/* Connection does not apply to this device. */
ENUM_ENTRY (NM_BT_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMBtError", values);
}
return etype;
}
guint32 nm_device_bt_get_capabilities (NMDeviceBt *self)
{
g_return_val_if_fail (self != NULL, NM_BT_CAPABILITY_NONE);

View File

@ -33,6 +33,12 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_BT))
#define NM_DEVICE_BT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_BT, NMDeviceBtClass))
typedef enum {
NM_BT_ERROR_CONNECTION_NOT_BT = 0,
NM_BT_ERROR_CONNECTION_INVALID,
NM_BT_ERROR_CONNECTION_INCOMPATIBLE,
} NMBtError;
#define NM_DEVICE_BT_HW_ADDRESS "hw-address"
#define NM_DEVICE_BT_NAME "name"
#define NM_DEVICE_BT_CAPABILITIES "bt-capabilities"

View File

@ -53,6 +53,7 @@
#include "nm-logging.h"
#include "nm-properties-changed-signal.h"
#include "nm-utils.h"
#include "nm-enum-types.h"
#include "nm-device-ethernet-glue.h"
@ -63,15 +64,7 @@ G_DEFINE_TYPE (NMDeviceEthernet, nm_device_ethernet, NM_TYPE_DEVICE_WIRED)
#define WIRED_SECRETS_TRIES "wired-secrets-tries"
typedef enum
{
NM_ETHERNET_ERROR_CONNECTION_NOT_WIRED = 0,
NM_ETHERNET_ERROR_CONNECTION_INVALID,
NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE,
} NMEthernetError;
#define NM_ETHERNET_ERROR (nm_ethernet_error_quark ())
#define NM_TYPE_ETHERNET_ERROR (nm_ethernet_error_get_type ())
typedef enum
{
@ -143,29 +136,6 @@ nm_ethernet_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_ethernet_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Connection was not a wired connection. */
ENUM_ENTRY (NM_ETHERNET_ERROR_CONNECTION_NOT_WIRED, "ConnectionNotWired"),
/* Connection was not a valid wired connection. */
ENUM_ENTRY (NM_ETHERNET_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
/* Connection does not apply to this device. */
ENUM_ENTRY (NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMEthernetError", values);
}
return etype;
}
static void
_update_s390_subchannels (NMDeviceEthernet *self)
{

View File

@ -35,6 +35,13 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_ETHERNET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_ETHERNET))
#define NM_DEVICE_ETHERNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass))
typedef enum
{
NM_ETHERNET_ERROR_CONNECTION_NOT_WIRED = 0,
NM_ETHERNET_ERROR_CONNECTION_INVALID,
NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE,
} NMEthernetError;
#define NM_DEVICE_ETHERNET_HW_ADDRESS "hw-address"
#define NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS "perm-hw-address"
#define NM_DEVICE_ETHERNET_SPEED "speed"

View File

@ -32,6 +32,7 @@
#include "nm-utils.h"
#include "NetworkManagerUtils.h"
#include "nm-device-private.h"
#include "nm-enum-types.h"
#include "nm-device-infiniband-glue.h"
@ -40,15 +41,7 @@ G_DEFINE_TYPE (NMDeviceInfiniband, nm_device_infiniband, NM_TYPE_DEVICE_WIRED)
#define NM_DEVICE_INFINIBAND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_INFINIBAND, NMDeviceInfinibandPrivate))
typedef enum
{
NM_INFINIBAND_ERROR_CONNECTION_NOT_INFINIBAND = 0,
NM_INFINIBAND_ERROR_CONNECTION_INVALID,
NM_INFINIBAND_ERROR_CONNECTION_INCOMPATIBLE,
} NMInfinibandError;
#define NM_INFINIBAND_ERROR (nm_infiniband_error_quark ())
#define NM_TYPE_INFINIBAND_ERROR (nm_infiniband_error_get_type ())
typedef struct {
int dummy;
@ -79,29 +72,6 @@ nm_infiniband_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_infiniband_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Connection was not a wired connection. */
ENUM_ENTRY (NM_INFINIBAND_ERROR_CONNECTION_NOT_INFINIBAND, "ConnectionNotInfiniband"),
/* Connection was not a valid wired connection. */
ENUM_ENTRY (NM_INFINIBAND_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
/* Connection does not apply to this device. */
ENUM_ENTRY (NM_INFINIBAND_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMInfinibandError", values);
}
return etype;
}
static GObject*
constructor (GType type,
guint n_construct_params,

View File

@ -34,6 +34,12 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_INFINIBAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_INFINIBAND))
#define NM_DEVICE_INFINIBAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_INFINIBAND, NMDeviceInfinibandClass))
typedef enum {
NM_INFINIBAND_ERROR_CONNECTION_NOT_INFINIBAND = 0,
NM_INFINIBAND_ERROR_CONNECTION_INVALID,
NM_INFINIBAND_ERROR_CONNECTION_INCOMPATIBLE,
} NMInfinibandError;
#define NM_DEVICE_INFINIBAND_HW_ADDRESS "hw-address"
#define NM_DEVICE_INFINIBAND_CARRIER "carrier"

View File

@ -53,6 +53,7 @@
#include "nm-setting-olpc-mesh.h"
#include "nm-system.h"
#include "nm-manager.h"
#include "nm-enum-types.h"
#include "wifi-utils.h"
/* This is a bug; but we can't really change API now... */
@ -83,15 +84,7 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
typedef enum
{
NM_OLPC_MESH_ERROR_CONNECTION_NOT_MESH = 0,
NM_OLPC_MESH_ERROR_CONNECTION_INVALID,
NM_OLPC_MESH_ERROR_CONNECTION_INCOMPATIBLE,
} NMOlpcMeshError;
#define NM_OLPC_MESH_ERROR (nm_olpc_mesh_error_quark ())
#define NM_TYPE_OLPC_MESH_ERROR (nm_olpc_mesh_error_get_type ())
struct _NMDeviceOlpcMeshPrivate
@ -120,29 +113,6 @@ nm_olpc_mesh_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_olpc_mesh_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Connection was not a wireless connection. */
ENUM_ENTRY (NM_OLPC_MESH_ERROR_CONNECTION_NOT_MESH, "ConnectionNotMesh"),
/* Connection was not a valid wireless connection. */
ENUM_ENTRY (NM_OLPC_MESH_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
/* Connection does not apply to this device. */
ENUM_ENTRY (NM_OLPC_MESH_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMOlpcMeshError", values);
}
return etype;
}
static guint32
real_get_generic_capabilities (NMDevice *dev)
{

View File

@ -42,6 +42,13 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_OLPC_MESH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_OLPC_MESH))
#define NM_DEVICE_OLPC_MESH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMeshClass))
typedef enum
{
NM_OLPC_MESH_ERROR_CONNECTION_NOT_MESH = 0,
NM_OLPC_MESH_ERROR_CONNECTION_INVALID,
NM_OLPC_MESH_ERROR_CONNECTION_INCOMPATIBLE,
} NMOlpcMeshError;
#define NM_DEVICE_OLPC_MESH_HW_ADDRESS "hw-address"
#define NM_DEVICE_OLPC_MESH_COMPANION "companion"
#define NM_DEVICE_OLPC_MESH_BITRATE "bitrate"

View File

@ -57,6 +57,7 @@
#include "nm-setting-ip6-config.h"
#include "nm-system.h"
#include "nm-settings-connection.h"
#include "nm-enum-types.h"
#include "wifi-utils.h"
static gboolean impl_device_get_access_points (NMDeviceWifi *device,
@ -183,15 +184,7 @@ static void cull_scan_list (NMDeviceWifi *self);
/*****************************************************************/
typedef enum {
NM_WIFI_ERROR_CONNECTION_NOT_WIRELESS = 0,
NM_WIFI_ERROR_CONNECTION_INVALID,
NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE,
NM_WIFI_ERROR_ACCESS_POINT_NOT_FOUND,
} NMWifiError;
#define NM_WIFI_ERROR (nm_wifi_error_quark ())
#define NM_TYPE_WIFI_ERROR (nm_wifi_error_get_type ())
static GQuark
nm_wifi_error_quark (void)
@ -202,31 +195,6 @@ nm_wifi_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_wifi_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Connection was not a wireless connection. */
ENUM_ENTRY (NM_WIFI_ERROR_CONNECTION_NOT_WIRELESS, "ConnectionNotWireless"),
/* Connection was not a valid wireless connection. */
ENUM_ENTRY (NM_WIFI_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
/* Connection does not apply to this device. */
ENUM_ENTRY (NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"),
/* Given access point was not in this device's scan list. */
ENUM_ENTRY (NM_WIFI_ERROR_ACCESS_POINT_NOT_FOUND, "AccessPointNotFound"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMWifiError", values);
}
return etype;
}
/*****************************************************************/
/* IPW rfkill handling (until 2.6.33) */

View File

@ -41,6 +41,12 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_WIFI))
#define NM_DEVICE_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass))
typedef enum {
NM_WIFI_ERROR_CONNECTION_NOT_WIRELESS = 0,
NM_WIFI_ERROR_CONNECTION_INVALID,
NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE,
NM_WIFI_ERROR_ACCESS_POINT_NOT_FOUND,
} NMWifiError;
#define NM_DEVICE_WIFI_HW_ADDRESS "hw-address"
#define NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS "perm-hw-address"

View File

@ -58,6 +58,7 @@
#include "nm-rfkill.h"
#include "nm-firewall-manager.h"
#include "nm-properties-changed-signal.h"
#include "nm-enum-types.h"
static void impl_device_disconnect (NMDevice *device, DBusGMethodInvocation *context);
@ -69,14 +70,7 @@ static void impl_device_disconnect (NMDevice *device, DBusGMethodInvocation *con
#define DBUS_G_TYPE_UINT_STRUCT (dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID))
/***********************************************************/
typedef enum {
NM_DEVICE_ERROR_CONNECTION_ACTIVATING = 0,
NM_DEVICE_ERROR_CONNECTION_INVALID,
NM_DEVICE_ERROR_NOT_ACTIVE,
} NMDeviceError;
#define NM_DEVICE_ERROR (nm_device_error_quark ())
#define NM_TYPE_DEVICE_ERROR (nm_device_error_get_type ())
static GQuark
nm_device_error_quark (void)
@ -87,29 +81,6 @@ nm_device_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_device_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Connection is already activating. */
ENUM_ENTRY (NM_DEVICE_ERROR_CONNECTION_ACTIVATING, "ConnectionActivating"),
/* Connection is invalid for this device. */
ENUM_ENTRY (NM_DEVICE_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
/* Operation could not be performed because the device is not active. */
ENUM_ENTRY (NM_DEVICE_ERROR_NOT_ACTIVE, "NotActive"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMDeviceError", values);
}
return etype;
}
/***********************************************************/
enum {

View File

@ -71,6 +71,12 @@ G_BEGIN_DECLS
typedef enum NMActStageReturn NMActStageReturn;
typedef enum {
NM_DEVICE_ERROR_CONNECTION_ACTIVATING = 0,
NM_DEVICE_ERROR_CONNECTION_INVALID,
NM_DEVICE_ERROR_NOT_ACTIVE,
} NMDeviceError;
typedef struct {
GObject parent;
} NMDevice;

View File

@ -63,6 +63,7 @@
#include "nm-utils.h"
#include "nm-device-factory.h"
#include "wifi-utils.h"
#include "nm-enum-types.h"
#define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd"
#define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd"
@ -270,20 +271,7 @@ enum {
/************************************************************************/
typedef enum {
NM_MANAGER_ERROR_UNKNOWN_CONNECTION = 0,
NM_MANAGER_ERROR_UNKNOWN_DEVICE,
NM_MANAGER_ERROR_UNMANAGED_DEVICE,
NM_MANAGER_ERROR_SYSTEM_CONNECTION,
NM_MANAGER_ERROR_PERMISSION_DENIED,
NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE,
NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE,
NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED,
NM_MANAGER_ERROR_UNSUPPORTED_CONNECTION_TYPE,
} NMManagerError;
#define NM_MANAGER_ERROR (nm_manager_error_quark ())
#define NM_TYPE_MANAGER_ERROR (nm_manager_error_get_type ())
static GQuark
nm_manager_error_quark (void)
@ -294,41 +282,6 @@ nm_manager_error_quark (void)
return quark;
}
/* This should really be standard. */
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_manager_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Connection was not provided by any known settings service. */
ENUM_ENTRY (NM_MANAGER_ERROR_UNKNOWN_CONNECTION, "UnknownConnection"),
/* Unknown device. */
ENUM_ENTRY (NM_MANAGER_ERROR_UNKNOWN_DEVICE, "UnknownDevice"),
/* Unmanaged device. */
ENUM_ENTRY (NM_MANAGER_ERROR_UNMANAGED_DEVICE, "UnmanagedDevice"),
/* Connection was superceded by a system connection. */
ENUM_ENTRY (NM_MANAGER_ERROR_SYSTEM_CONNECTION, "SystemConnection"),
/* User does not have the permission to activate this connection. */
ENUM_ENTRY (NM_MANAGER_ERROR_PERMISSION_DENIED, "PermissionDenied"),
/* The connection was not active. */
ENUM_ENTRY (NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE, "ConnectionNotActive"),
/* The manager is already in the requested sleep state */
ENUM_ENTRY (NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, "AlreadyAsleepOrAwake"),
/* The manager is already in the requested enabled/disabled state */
ENUM_ENTRY (NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, "AlreadyEnabledOrDisabled"),
/* The requested operation is unsupported for this type of connection */
ENUM_ENTRY (NM_MANAGER_ERROR_UNSUPPORTED_CONNECTION_TYPE, "UnsupportedConnectionType"),
{ 0, 0, 0 },
};
etype = g_enum_register_static ("NMManagerError", values);
}
return etype;
}
/************************************************************************/
static NMDevice *

View File

@ -35,6 +35,18 @@
#define NM_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_MANAGER))
#define NM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MANAGER, NMManagerClass))
typedef enum {
NM_MANAGER_ERROR_UNKNOWN_CONNECTION = 0,
NM_MANAGER_ERROR_UNKNOWN_DEVICE,
NM_MANAGER_ERROR_UNMANAGED_DEVICE,
NM_MANAGER_ERROR_SYSTEM_CONNECTION,
NM_MANAGER_ERROR_PERMISSION_DENIED,
NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE,
NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE,
NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED,
NM_MANAGER_ERROR_UNSUPPORTED_CONNECTION_TYPE,
} NMManagerError;
#define NM_MANAGER_VERSION "version"
#define NM_MANAGER_STATE "state"
#define NM_MANAGER_NETWORKING_ENABLED "networking-enabled"

View File

@ -34,31 +34,6 @@ nm_session_monitor_error_quark (void)
return ret;
}
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_session_monitor_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Some I/O operation on the CK database failed */
ENUM_ENTRY (NM_SESSION_MONITOR_ERROR_IO_ERROR, "IOError"),
/* Error parsing the CK database */
ENUM_ENTRY (NM_SESSION_MONITOR_ERROR_MALFORMED_DATABASE, "MalformedDatabase"),
/* Username or UID could could not be found */
ENUM_ENTRY (NM_SESSION_MONITOR_ERROR_UNKNOWN_USER, "UnknownUser"),
/* No ConsoleKit database */
ENUM_ENTRY (NM_SESSION_MONITOR_ERROR_NO_DATABASE, "NoDatabase"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSessionMonitorError", values);
}
return etype;
}
/********************************************************************/
gboolean

View File

@ -4,8 +4,8 @@ INCLUDES = \
-I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/src \
-I${top_srcdir}/src/logging \
-I${top_builddir}/marshallers
-I${top_srcdir}/src/generated \
-I${top_srcdir}/src/logging
noinst_LTLIBRARIES = libppp-manager.la
@ -29,7 +29,7 @@ libppp_manager_la_CPPFLAGS = \
-DPLUGINDIR=\"$(PPPD_PLUGIN_DIR)\"
libppp_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/generated/libnm-generated.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(DBUS_LIBS) \
$(GLIB_LIBS)

View File

@ -4,9 +4,9 @@ INCLUDES = -I${top_srcdir} \
-I${top_srcdir}/include \
-I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/src/generated \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src \
-I${top_builddir}/marshallers
-I${top_srcdir}/src
noinst_LTLIBRARIES = libsettings.la libtest-settings-utils.la
@ -65,7 +65,7 @@ libsettings_la_CPPFLAGS = \
libsettings_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/generated/libnm-generated.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(builddir)/plugins/keyfile/libnm-settings-plugin-keyfile.la \
$(DBUS_LIBS) \

View File

@ -36,6 +36,7 @@
#include "nm-manager-auth.h"
#include "nm-setting-vpn.h"
#include "nm-setting-connection.h"
#include "nm-enum-types.h"
G_DEFINE_TYPE (NMAgentManager, nm_agent_manager, G_TYPE_OBJECT)
@ -88,17 +89,6 @@ static void impl_agent_manager_unregister (NMAgentManager *self,
/********************************************************************/
#define NM_AGENT_MANAGER_ERROR (nm_agent_manager_error_quark ())
#define NM_TYPE_AGENT_MANAGER_ERROR (nm_agent_manager_error_get_type ())
typedef enum {
NM_AGENT_MANAGER_ERROR_SENDER_UNKNOWN = 0,
NM_AGENT_MANAGER_ERROR_PERMISSION_DENIED,
NM_AGENT_MANAGER_ERROR_SESSION_NOT_FOUND,
NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER,
NM_AGENT_MANAGER_ERROR_NOT_REGISTERED,
NM_AGENT_MANAGER_ERROR_INTERNAL_ERROR,
NM_AGENT_MANAGER_ERROR_NO_SECRETS
} NMAgentManagerError;
static GQuark
nm_agent_manager_error_quark (void)
@ -110,37 +100,6 @@ nm_agent_manager_error_quark (void)
return ret;
}
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
static GType
nm_agent_manager_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
/* Unable to determine caller's sender or UID */
ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_SENDER_UNKNOWN, "SenderUnknown"),
/* Permission for some operation was denied */
ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_PERMISSION_DENIED, "PermissionDenied"),
/* The caller's session could not be determined */
ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_SESSION_NOT_FOUND, "SessionNotFound"),
/* The identifier was invalid */
ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER, "InvalidIdentifier"),
/* Request was not from a registered agent */
ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_NOT_REGISTERED, "NotRegistered"),
/* Some internal error occurred */
ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_INTERNAL_ERROR, "InternalError"),
/* No secrets were available */
ENUM_ENTRY (NM_AGENT_MANAGER_ERROR_NO_SECRETS, "NoSecrets"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMAgentManagerError", values);
}
return etype;
}
/*************************************************************/
static gboolean

View File

@ -34,6 +34,16 @@
#define NM_IS_AGENT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_AGENT_MANAGER))
#define NM_AGENT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_AGENT_MANAGER, NMAgentManagerClass))
typedef enum {
NM_AGENT_MANAGER_ERROR_SENDER_UNKNOWN = 0,
NM_AGENT_MANAGER_ERROR_PERMISSION_DENIED,
NM_AGENT_MANAGER_ERROR_SESSION_NOT_FOUND,
NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER,
NM_AGENT_MANAGER_ERROR_NOT_REGISTERED,
NM_AGENT_MANAGER_ERROR_INTERNAL_ERROR,
NM_AGENT_MANAGER_ERROR_NO_SECRETS
} NMAgentManagerError;
typedef struct {
GObject parent;
} NMAgentManager;

View File

@ -31,53 +31,3 @@ nm_settings_error_quark (void)
return ret;
}
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_settings_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_SETTINGS_ERROR_GENERAL, "GeneralError"),
/* The connection was invalid. */
ENUM_ENTRY (NM_SETTINGS_ERROR_INVALID_CONNECTION, "InvalidConnection"),
/* The connection is read-only; modifications are not allowed. */
ENUM_ENTRY (NM_SETTINGS_ERROR_READ_ONLY_CONNECTION, "ReadOnlyConnection"),
/* A bug in the settings service caused the error. */
ENUM_ENTRY (NM_SETTINGS_ERROR_INTERNAL_ERROR, "InternalError"),
/* Retrieval or request of secrets failed. */
ENUM_ENTRY (NM_SETTINGS_ERROR_SECRETS_UNAVAILABLE, "SecretsUnavailable"),
/* The request for secrets was canceled. */
ENUM_ENTRY (NM_SETTINGS_ERROR_SECRETS_REQUEST_CANCELED, "SecretsRequestCanceled"),
/* The request could not be completed because permission was denied. */
ENUM_ENTRY (NM_SETTINGS_ERROR_PERMISSION_DENIED, "PermissionDenied"),
/* The requested setting does not existing in this connection. */
ENUM_ENTRY (NM_SETTINGS_ERROR_INVALID_SETTING, "InvalidSetting"),
/* The caller does not have permission to perform this operation */
ENUM_ENTRY (NM_SETTINGS_ERROR_NOT_PRIVILEGED, "NotPrivileged"),
/* No plugin supports adding new connections */
ENUM_ENTRY (NM_SETTINGS_ERROR_ADD_NOT_SUPPORTED, "AddNotSupported"),
/* The plugin providing this connection does not support updating it */
ENUM_ENTRY (NM_SETTINGS_ERROR_UPDATE_NOT_SUPPORTED, "UpdateNotSupported"),
/* The plugin providing this connection does not support deleting it */
ENUM_ENTRY (NM_SETTINGS_ERROR_DELETE_NOT_SUPPORTED, "DeleteNotSupported"),
/* Failed to add the connection */
ENUM_ENTRY (NM_SETTINGS_ERROR_ADD_FAILED, "AddFailed"),
/* No plugin supports modifying the system hostname */
ENUM_ENTRY (NM_SETTINGS_ERROR_SAVE_HOSTNAME_NOT_SUPPORTED, "SaveHostnameNotSupported"),
/* Saving the system hostname failed */
ENUM_ENTRY (NM_SETTINGS_ERROR_SAVE_HOSTNAME_FAILED, "SaveHostnameFailed"),
/* A connection with this UUID already exists */
ENUM_ENTRY (NM_SETTINGS_ERROR_UUID_EXISTS, "UuidExists"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSettingsError", values);
}
return etype;
}

Some files were not shown because too many files have changed in this diff Show More