diff options
| author | Michael Biebl <biebl@debian.org> | 2010-11-29 19:00:22 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2010-11-29 19:00:22 +0100 |
| commit | a6b89d35fabd9f5934b84d7cde22e9268f92c3d3 (patch) | |
| tree | 9e44755880d5933fcc90c6008d4585a76298a1bd /cli | |
| parent | 9fae01fa351805b2903e535736e06971bc0b925e (diff) | |
Imported Upstream version 0.8.2 upstream/0.8.2
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/Makefile.in | 13 | ||||
| -rw-r--r-- | cli/src/Makefile.in | 106 | ||||
| -rw-r--r-- | cli/src/connections.c | 32 | ||||
| -rw-r--r-- | cli/src/devices.c | 19 | ||||
| -rw-r--r-- | cli/src/network-manager.c | 121 | ||||
| -rw-r--r-- | cli/src/nmcli.c | 1 | ||||
| -rw-r--r-- | cli/src/nmcli.h | 1 | ||||
| -rw-r--r-- | cli/src/settings.c | 58 |
8 files changed, 258 insertions, 93 deletions
diff --git a/cli/Makefile.in b/cli/Makefile.in index b4274994..5fdb04bb 100644 --- a/cli/Makefile.in +++ b/cli/Makefile.in @@ -48,6 +48,12 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -95,6 +101,7 @@ ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -115,6 +122,7 @@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCLIENT_VERSION = @DHCLIENT_VERSION@ DHCPCD_PATH = @DHCPCD_PATH@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DSYMUTIL = @DSYMUTIL@ @@ -156,6 +164,7 @@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ IPTABLES_PATH = @IPTABLES_PATH@ +KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBDL = @LIBDL@ @@ -195,6 +204,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POLKIT_CFLAGS = @POLKIT_CFLAGS@ POLKIT_LIBS = @POLKIT_LIBS@ @@ -251,7 +262,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -263,6 +273,7 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ diff --git a/cli/src/Makefile.in b/cli/src/Makefile.in index 4d26da6d..47421660 100644 --- a/cli/src/Makefile.in +++ b/cli/src/Makefile.in @@ -61,19 +61,35 @@ nmcli_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/libnm-glib/libnm-glib.la +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(nmcli_SOURCES) DIST_SOURCES = $(nmcli_SOURCES) ETAGS = etags @@ -83,6 +99,7 @@ ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -103,6 +120,7 @@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCLIENT_VERSION = @DHCLIENT_VERSION@ DHCPCD_PATH = @DHCPCD_PATH@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DSYMUTIL = @DSYMUTIL@ @@ -144,6 +162,7 @@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ IPTABLES_PATH = @IPTABLES_PATH@ +KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBDL = @LIBDL@ @@ -183,6 +202,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POLKIT_CFLAGS = @POLKIT_CFLAGS@ POLKIT_LIBS = @POLKIT_LIBS@ @@ -239,7 +260,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -251,6 +271,7 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ @@ -368,7 +389,7 @@ clean-binPROGRAMS: rm -f $$list nmcli$(EXEEXT): $(nmcli_OBJECTS) $(nmcli_DEPENDENCIES) @rm -f nmcli$(EXEEXT) - $(LINK) $(nmcli_OBJECTS) $(nmcli_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(nmcli_OBJECTS) $(nmcli_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -384,109 +405,124 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-utils.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< nmcli-connections.o: connections.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-connections.o -MD -MP -MF $(DEPDIR)/nmcli-connections.Tpo -c -o nmcli-connections.o `test -f 'connections.c' || echo '$(srcdir)/'`connections.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-connections.Tpo $(DEPDIR)/nmcli-connections.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-connections.o -MD -MP -MF $(DEPDIR)/nmcli-connections.Tpo -c -o nmcli-connections.o `test -f 'connections.c' || echo '$(srcdir)/'`connections.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-connections.Tpo $(DEPDIR)/nmcli-connections.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='connections.c' object='nmcli-connections.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-connections.o `test -f 'connections.c' || echo '$(srcdir)/'`connections.c nmcli-connections.obj: connections.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-connections.obj -MD -MP -MF $(DEPDIR)/nmcli-connections.Tpo -c -o nmcli-connections.obj `if test -f 'connections.c'; then $(CYGPATH_W) 'connections.c'; else $(CYGPATH_W) '$(srcdir)/connections.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-connections.Tpo $(DEPDIR)/nmcli-connections.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-connections.obj -MD -MP -MF $(DEPDIR)/nmcli-connections.Tpo -c -o nmcli-connections.obj `if test -f 'connections.c'; then $(CYGPATH_W) 'connections.c'; else $(CYGPATH_W) '$(srcdir)/connections.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-connections.Tpo $(DEPDIR)/nmcli-connections.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='connections.c' object='nmcli-connections.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-connections.obj `if test -f 'connections.c'; then $(CYGPATH_W) 'connections.c'; else $(CYGPATH_W) '$(srcdir)/connections.c'; fi` nmcli-devices.o: devices.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-devices.o -MD -MP -MF $(DEPDIR)/nmcli-devices.Tpo -c -o nmcli-devices.o `test -f 'devices.c' || echo '$(srcdir)/'`devices.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-devices.Tpo $(DEPDIR)/nmcli-devices.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-devices.o -MD -MP -MF $(DEPDIR)/nmcli-devices.Tpo -c -o nmcli-devices.o `test -f 'devices.c' || echo '$(srcdir)/'`devices.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-devices.Tpo $(DEPDIR)/nmcli-devices.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='devices.c' object='nmcli-devices.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-devices.o `test -f 'devices.c' || echo '$(srcdir)/'`devices.c nmcli-devices.obj: devices.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-devices.obj -MD -MP -MF $(DEPDIR)/nmcli-devices.Tpo -c -o nmcli-devices.obj `if test -f 'devices.c'; then $(CYGPATH_W) 'devices.c'; else $(CYGPATH_W) '$(srcdir)/devices.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-devices.Tpo $(DEPDIR)/nmcli-devices.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-devices.obj -MD -MP -MF $(DEPDIR)/nmcli-devices.Tpo -c -o nmcli-devices.obj `if test -f 'devices.c'; then $(CYGPATH_W) 'devices.c'; else $(CYGPATH_W) '$(srcdir)/devices.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-devices.Tpo $(DEPDIR)/nmcli-devices.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='devices.c' object='nmcli-devices.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-devices.obj `if test -f 'devices.c'; then $(CYGPATH_W) 'devices.c'; else $(CYGPATH_W) '$(srcdir)/devices.c'; fi` nmcli-network-manager.o: network-manager.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-network-manager.o -MD -MP -MF $(DEPDIR)/nmcli-network-manager.Tpo -c -o nmcli-network-manager.o `test -f 'network-manager.c' || echo '$(srcdir)/'`network-manager.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-network-manager.Tpo $(DEPDIR)/nmcli-network-manager.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-network-manager.o -MD -MP -MF $(DEPDIR)/nmcli-network-manager.Tpo -c -o nmcli-network-manager.o `test -f 'network-manager.c' || echo '$(srcdir)/'`network-manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-network-manager.Tpo $(DEPDIR)/nmcli-network-manager.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network-manager.c' object='nmcli-network-manager.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-network-manager.o `test -f 'network-manager.c' || echo '$(srcdir)/'`network-manager.c nmcli-network-manager.obj: network-manager.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-network-manager.obj -MD -MP -MF $(DEPDIR)/nmcli-network-manager.Tpo -c -o nmcli-network-manager.obj `if test -f 'network-manager.c'; then $(CYGPATH_W) 'network-manager.c'; else $(CYGPATH_W) '$(srcdir)/network-manager.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-network-manager.Tpo $(DEPDIR)/nmcli-network-manager.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-network-manager.obj -MD -MP -MF $(DEPDIR)/nmcli-network-manager.Tpo -c -o nmcli-network-manager.obj `if test -f 'network-manager.c'; then $(CYGPATH_W) 'network-manager.c'; else $(CYGPATH_W) '$(srcdir)/network-manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-network-manager.Tpo $(DEPDIR)/nmcli-network-manager.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network-manager.c' object='nmcli-network-manager.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-network-manager.obj `if test -f 'network-manager.c'; then $(CYGPATH_W) 'network-manager.c'; else $(CYGPATH_W) '$(srcdir)/network-manager.c'; fi` nmcli-settings.o: settings.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-settings.o -MD -MP -MF $(DEPDIR)/nmcli-settings.Tpo -c -o nmcli-settings.o `test -f 'settings.c' || echo '$(srcdir)/'`settings.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-settings.Tpo $(DEPDIR)/nmcli-settings.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-settings.o -MD -MP -MF $(DEPDIR)/nmcli-settings.Tpo -c -o nmcli-settings.o `test -f 'settings.c' || echo '$(srcdir)/'`settings.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-settings.Tpo $(DEPDIR)/nmcli-settings.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='settings.c' object='nmcli-settings.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-settings.o `test -f 'settings.c' || echo '$(srcdir)/'`settings.c nmcli-settings.obj: settings.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-settings.obj -MD -MP -MF $(DEPDIR)/nmcli-settings.Tpo -c -o nmcli-settings.obj `if test -f 'settings.c'; then $(CYGPATH_W) 'settings.c'; else $(CYGPATH_W) '$(srcdir)/settings.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-settings.Tpo $(DEPDIR)/nmcli-settings.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-settings.obj -MD -MP -MF $(DEPDIR)/nmcli-settings.Tpo -c -o nmcli-settings.obj `if test -f 'settings.c'; then $(CYGPATH_W) 'settings.c'; else $(CYGPATH_W) '$(srcdir)/settings.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-settings.Tpo $(DEPDIR)/nmcli-settings.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='settings.c' object='nmcli-settings.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-settings.obj `if test -f 'settings.c'; then $(CYGPATH_W) 'settings.c'; else $(CYGPATH_W) '$(srcdir)/settings.c'; fi` nmcli-nmcli.o: nmcli.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-nmcli.o -MD -MP -MF $(DEPDIR)/nmcli-nmcli.Tpo -c -o nmcli-nmcli.o `test -f 'nmcli.c' || echo '$(srcdir)/'`nmcli.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-nmcli.Tpo $(DEPDIR)/nmcli-nmcli.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-nmcli.o -MD -MP -MF $(DEPDIR)/nmcli-nmcli.Tpo -c -o nmcli-nmcli.o `test -f 'nmcli.c' || echo '$(srcdir)/'`nmcli.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-nmcli.Tpo $(DEPDIR)/nmcli-nmcli.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nmcli.c' object='nmcli-nmcli.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-nmcli.o `test -f 'nmcli.c' || echo '$(srcdir)/'`nmcli.c nmcli-nmcli.obj: nmcli.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-nmcli.obj -MD -MP -MF $(DEPDIR)/nmcli-nmcli.Tpo -c -o nmcli-nmcli.obj `if test -f 'nmcli.c'; then $(CYGPATH_W) 'nmcli.c'; else $(CYGPATH_W) '$(srcdir)/nmcli.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-nmcli.Tpo $(DEPDIR)/nmcli-nmcli.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-nmcli.obj -MD -MP -MF $(DEPDIR)/nmcli-nmcli.Tpo -c -o nmcli-nmcli.obj `if test -f 'nmcli.c'; then $(CYGPATH_W) 'nmcli.c'; else $(CYGPATH_W) '$(srcdir)/nmcli.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-nmcli.Tpo $(DEPDIR)/nmcli-nmcli.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nmcli.c' object='nmcli-nmcli.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-nmcli.obj `if test -f 'nmcli.c'; then $(CYGPATH_W) 'nmcli.c'; else $(CYGPATH_W) '$(srcdir)/nmcli.c'; fi` nmcli-utils.o: utils.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-utils.o -MD -MP -MF $(DEPDIR)/nmcli-utils.Tpo -c -o nmcli-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-utils.Tpo $(DEPDIR)/nmcli-utils.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-utils.o -MD -MP -MF $(DEPDIR)/nmcli-utils.Tpo -c -o nmcli-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-utils.Tpo $(DEPDIR)/nmcli-utils.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='nmcli-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c nmcli-utils.obj: utils.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-utils.obj -MD -MP -MF $(DEPDIR)/nmcli-utils.Tpo -c -o nmcli-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-utils.Tpo $(DEPDIR)/nmcli-utils.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-utils.obj -MD -MP -MF $(DEPDIR)/nmcli-utils.Tpo -c -o nmcli-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-utils.Tpo $(DEPDIR)/nmcli-utils.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='nmcli-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` diff --git a/cli/src/connections.c b/cli/src/connections.c index e9aa597d..e0b94ceb 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <unistd.h> #include <errno.h> #include <signal.h> #include <netinet/ether.h> @@ -64,9 +65,10 @@ static NmcOutputField nmc_fields_con_status[] = { {"DBUS-SERVICE", N_("DBUS-SERVICE"), 45, NULL, 0}, /* 5 */ {"SPEC-OBJECT", N_("SPEC-OBJECT"), 10, NULL, 0}, /* 6 */ {"VPN", N_("VPN"), 5, NULL, 0}, /* 7 */ + {"DBUS-PATH", N_("DBUS-PATH"), 51, NULL, 0}, /* 8 */ {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_CON_STATUS_ALL "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN,DBUS-SERVICE,SPEC-OBJECT" +#define NMC_FIELDS_CON_STATUS_ALL "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN,DBUS-SERVICE,DBUS-PATH,SPEC-OBJECT" #define NMC_FIELDS_CON_STATUS_COMMON "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN" /* Available fields for 'con list' */ @@ -79,9 +81,10 @@ static NmcOutputField nmc_fields_con_list[] = { {"TIMESTAMP-REAL", N_("TIMESTAMP-REAL"), 34, NULL, 0}, /* 5 */ {"AUTOCONNECT", N_("AUTOCONNECT"), 13, NULL, 0}, /* 6 */ {"READONLY", N_("READONLY"), 10, NULL, 0}, /* 7 */ + {"DBUS-PATH", N_("DBUS-PATH"), 42, NULL, 0}, /* 8 */ {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_CON_LIST_ALL "NAME,UUID,TYPE,SCOPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,READONLY" +#define NMC_FIELDS_CON_LIST_ALL "NAME,UUID,TYPE,SCOPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,READONLY,DBUS-PATH" #define NMC_FIELDS_CON_LIST_COMMON "NAME,UUID,TYPE,SCOPE,TIMESTAMP-REAL" @@ -375,6 +378,7 @@ show_connection (NMConnection *data, gpointer user_data) timestamp = nm_setting_connection_get_timestamp (s_con); timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT, timestamp); strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c", localtime ((time_t *) ×tamp)); + nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con); nmc->allowed_fields[1].value = nm_setting_connection_get_uuid (s_con); nmc->allowed_fields[2].value = nm_setting_connection_get_connection_type (s_con); @@ -383,6 +387,7 @@ show_connection (NMConnection *data, gpointer user_data) nmc->allowed_fields[5].value = timestamp ? timestamp_real_str : _("never"); nmc->allowed_fields[6].value = nm_setting_connection_get_autoconnect (s_con) ? _("yes") : _("no"); nmc->allowed_fields[7].value = nm_setting_connection_get_read_only (s_con) ? _("yes") : _("no"); + nmc->allowed_fields[8].value = nm_connection_get_path (connection); nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); @@ -603,6 +608,7 @@ show_active_connection (gpointer data, gpointer user_data) info->nmc->allowed_fields[5].value = nm_active_connection_get_service_name (active); info->nmc->allowed_fields[6].value = nm_active_connection_get_specific_object (active); info->nmc->allowed_fields[7].value = NM_IS_VPN_CONNECTION (active) ? _("yes") : _("no"); + info->nmc->allowed_fields[8].value = nm_object_get_path (NM_OBJECT (active)); info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (info->nmc->print_fields, info->nmc->allowed_fields); @@ -711,10 +717,11 @@ check_ethernet_compatible (NMDeviceEthernet *device, NMConnection *connection, G if (s_wired) { const GByteArray *mac; const char *device_mac_str; - struct ether_addr *device_mac; + struct ether_addr *device_mac = NULL; - device_mac_str = nm_device_ethernet_get_hw_address (device); - device_mac = ether_aton (device_mac_str); + device_mac_str = nm_device_ethernet_get_permanent_hw_address (device); + if (device_mac_str) + device_mac = ether_aton (device_mac_str); if (!device_mac) { g_set_error (error, 0, 0, "Invalid device MAC address."); return FALSE; @@ -760,10 +767,11 @@ check_wifi_compatible (NMDeviceWifi *device, NMConnection *connection, GError ** if (s_wireless) { const GByteArray *mac; const char *device_mac_str; - struct ether_addr *device_mac; + struct ether_addr *device_mac = NULL; - device_mac_str = nm_device_wifi_get_hw_address (device); - device_mac = ether_aton (device_mac_str); + device_mac_str = nm_device_wifi_get_permanent_hw_address (device); + if (device_mac_str) + device_mac = ether_aton (device_mac_str); if (!device_mac) { g_set_error (error, 0, 0, "Invalid device MAC address."); return FALSE; @@ -1288,7 +1296,7 @@ activate_connection_cb (gpointer user_data, const char *path, GError *error) printf (_("Active connection state: %s\n"), active_connection_state_to_string (state)); printf (_("Active connection path: %s\n"), orig_path); - if (!orig_nmc->should_wait || state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { + if (orig_nmc->nowait_flag || state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { /* don't want to wait or already activated */ quit (); } else { @@ -1415,7 +1423,10 @@ do_connection_up (NmCli *nmc, int argc, char **argv) goto error; } - nmc->should_wait = wait; + /* Use nowait_flag instead of should_wait because exitting has to be postponed till active_connection_state_cb() + * is called, giving NM time to check our permissions */ + nmc->nowait_flag = !wait; + nmc->should_wait = TRUE; nm_client_activate_connection (nmc->client, is_system ? NM_DBUS_SERVICE_SYSTEM_SETTINGS : NM_DBUS_SERVICE_USER_SETTINGS, con_path, @@ -1504,6 +1515,7 @@ do_connection_down (NmCli *nmc, int argc, char **argv) else { fprintf (stderr, _("Warning: Connection not active\n")); } + sleep (1); /* Don't quit immediatelly and give NM time to check our permissions */ error: nmc->should_wait = FALSE; diff --git a/cli/src/devices.c b/cli/src/devices.c index e2ce91e3..436b4b6e 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -58,12 +58,13 @@ /* Available fields for 'dev status' */ static NmcOutputField nmc_fields_dev_status[] = { - {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 0 */ - {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 1 */ - {"STATE", N_("STATE"), 12, NULL, 0}, /* 2 */ - {NULL, NULL, 0, NULL, 0} + {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 0 */ + {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 1 */ + {"STATE", N_("STATE"), 13, NULL, 0}, /* 2 */ + {"DBUS-PATH", N_("DBUS-PATH"), 43, NULL, 0}, /* 3 */ + {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE" +#define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE,DBUS-PATH" #define NMC_FIELDS_DEV_STATUS_COMMON "DEVICE,TYPE,STATE" @@ -763,6 +764,7 @@ show_device_status (NMDevice *device, NmCli *nmc) nmc->allowed_fields[0].value = nm_device_get_iface (device); nmc->allowed_fields[1].value = get_device_type (device); nmc->allowed_fields[2].value = device_state_to_string (nm_device_get_state (device)); + nmc->allowed_fields[3].value = nm_object_get_path (NM_OBJECT (device)); nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ print_fields (nmc->print_fields, nmc->allowed_fields); @@ -929,7 +931,7 @@ disconnect_device_cb (NMDevice *device, GError *error, gpointer user_data) state = nm_device_get_state (device); printf (_("Device state: %d (%s)\n"), state, device_state_to_string (state)); - if (!nmc->should_wait || state == NM_DEVICE_STATE_DISCONNECTED) { + if (nmc->nowait_flag || state == NM_DEVICE_STATE_DISCONNECTED) { /* Don't want to wait or device already disconnected */ quit (); } else { @@ -1015,7 +1017,10 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) goto error; } - nmc->should_wait = wait; + /* Use nowait_flag instead of should_wait because exitting has to be postponed till disconnect_device_cb() + * is called, giving NM time to check our permissions */ + nmc->nowait_flag = !wait; + nmc->should_wait = TRUE; nm_device_disconnect (device, disconnect_device_cb, nmc); error: diff --git a/cli/src/network-manager.c b/cli/src/network-manager.c index b65dfcd7..23a2ef11 100644 --- a/cli/src/network-manager.c +++ b/cli/src/network-manager.c @@ -34,14 +34,16 @@ static NmcOutputField nmc_fields_nm_status[] = { {"RUNNING", N_("RUNNING"), 15, NULL, 0}, /* 0 */ {"STATE", N_("STATE"), 15, NULL, 0}, /* 1 */ - {"WIFI-HARDWARE", N_("WIFI-HARDWARE"), 15, NULL, 0}, /* 2 */ - {"WIFI", N_("WIFI"), 10, NULL, 0}, /* 3 */ - {"WWAN-HARDWARE", N_("WWAN-HARDWARE"), 15, NULL, 0}, /* 4 */ - {"WWAN", N_("WWAN"), 10, NULL, 0}, /* 5 */ + {"NET-ENABLED", N_("NET-ENABLED"), 13, NULL, 0}, /* 2 */ + {"WIFI-HARDWARE", N_("WIFI-HARDWARE"), 15, NULL, 0}, /* 3 */ + {"WIFI", N_("WIFI"), 10, NULL, 0}, /* 4 */ + {"WWAN-HARDWARE", N_("WWAN-HARDWARE"), 15, NULL, 0}, /* 5 */ + {"WWAN", N_("WWAN"), 10, NULL, 0}, /* 6 */ {NULL, NULL, 0, NULL, 0} }; -#define NMC_FIELDS_NM_STATUS_ALL "RUNNING,STATE,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" +#define NMC_FIELDS_NM_STATUS_ALL "RUNNING,STATE,NET-ENABLED,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" #define NMC_FIELDS_NM_STATUS_COMMON "RUNNING,STATE,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" +#define NMC_FIELDS_NM_NET_ENABLED "NET-ENABLED" #define NMC_FIELDS_NM_WIFI "WIFI" #define NMC_FIELDS_NM_WWAN "WWAN" @@ -60,10 +62,10 @@ usage (void) { fprintf (stderr, _("Usage: nmcli nm { COMMAND | help }\n\n" - " COMMAND := { status | sleep | wakeup | wifi | wwan }\n\n" + " COMMAND := { status | enable | sleep | wifi | wwan }\n\n" " status\n" - " sleep\n" - " wakeup\n" + " enable [true|false]\n" + " sleep [true|false]\n" " wifi [on|off]\n" " wwan [on|off]\n\n")); } @@ -97,6 +99,7 @@ static NMCResultCode show_nm_status (NmCli *nmc) { gboolean nm_running; + gboolean net_enabled; NMState state; const char *wireless_hw_enabled_str, *wireless_enabled_str; const char *wwan_hw_enabled_str, *wwan_enabled_str; @@ -136,6 +139,7 @@ show_nm_status (NmCli *nmc) nm_running = nm_client_get_manager_running (nmc->client); state = nm_client_get_state (nmc->client); + net_enabled = nm_client_networking_get_enabled (nmc->client); if (nm_running) { wireless_hw_enabled_str = nm_client_wireless_hardware_get_enabled (nmc->client) ? _("enabled") : _("disabled"); wireless_enabled_str = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); @@ -147,10 +151,11 @@ show_nm_status (NmCli *nmc) nmc->allowed_fields[0].value = nm_running ? _("running") : _("not running"); nmc->allowed_fields[1].value = nm_state_to_string (state); - nmc->allowed_fields[2].value = wireless_hw_enabled_str; - nmc->allowed_fields[3].value = wireless_enabled_str; - nmc->allowed_fields[4].value = wwan_hw_enabled_str; - nmc->allowed_fields[5].value = wwan_enabled_str; + nmc->allowed_fields[2].value = net_enabled ? _("enabled") : _("disabled"); + nmc->allowed_fields[3].value = wireless_hw_enabled_str; + nmc->allowed_fields[4].value = wireless_enabled_str; + nmc->allowed_fields[5].value = wwan_hw_enabled_str; + nmc->allowed_fields[6].value = wwan_enabled_str; nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ @@ -158,12 +163,49 @@ show_nm_status (NmCli *nmc) return NMC_RESULT_SUCCESS; } +/* libnm-glib doesn't provide API fro Sleep method - implement D-Bus call ourselves */ +static void networking_set_sleep (NmCli *nmc, gboolean in_sleep) +{ + DBusGConnection *connection = NULL; + DBusGProxy *proxy = NULL; + GError *err = NULL; + + connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); + if (!connection) { + g_string_printf (nmc->return_text, _("Error: Couldn't connect to system bus: %s"), err->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_error_free (err); + goto gone; + } + + proxy = dbus_g_proxy_new_for_name (connection, + "org.freedesktop.NetworkManager", + "/org/freedesktop/NetworkManager", + "org.freedesktop.NetworkManager"); + if (!proxy) { + g_string_printf (nmc->return_text, _("Error: Couldn't create D-Bus object proxy.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto gone; + } + + if (!dbus_g_proxy_call (proxy, "Sleep", &err, G_TYPE_BOOLEAN, in_sleep, G_TYPE_INVALID, G_TYPE_INVALID)) { + g_string_printf (nmc->return_text, _("Error in sleep: %s"), err->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_error_free (err); + } + +gone: + if (connection) dbus_g_connection_unref (connection); + if (proxy) g_object_unref (proxy); +} /* entry point function for global network manager related commands 'nmcli nm' */ NMCResultCode do_network_manager (NmCli *nmc, int argc, char **argv) { GError *error = NULL; + gboolean sleep_flag; + gboolean enable_net; gboolean enable_wifi; gboolean enable_wwan; guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; @@ -186,11 +228,54 @@ do_network_manager (NmCli *nmc, int argc, char **argv) goto opt_error; nmc->return_value = show_nm_status (nmc); } - else if (matches (*argv, "sleep") == 0) { - nm_client_sleep (nmc->client, TRUE); + else if (matches (*argv, "enable") == 0) { + if (next_arg (&argc, &argv) != 0) { + /* no argument, show current state of networking */ + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto opt_error; + if (nmc->required_fields && strcasecmp (nmc->required_fields, "NET-ENABLED")) { + g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), + nmc->required_fields, NMC_FIELDS_NM_NET_ENABLED); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + nmc->allowed_fields = nmc_fields_nm_status; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_NET_ENABLED, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("Networking enabled"); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + nmc->allowed_fields[2].value = nm_client_networking_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + } else { + if (!strcmp (*argv, "true")) + enable_net = TRUE; + else if (!strcmp (*argv, "false")) + enable_net = FALSE; + else { + g_string_printf (nmc->return_text, _("Error: invalid 'enable' parameter: '%s'; use 'true' or 'false'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + nm_client_networking_set_enabled (nmc->client, enable_net); + } } - else if (matches (*argv, "wakeup") == 0) { - nm_client_sleep (nmc->client, FALSE); + else if (matches (*argv, "sleep") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: Sleeping status is not exported by NetworkManager.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } else { + if (!strcmp (*argv, "true")) + sleep_flag = TRUE; + else if (!strcmp (*argv, "false")) + sleep_flag = FALSE; + else { + g_string_printf (nmc->return_text, _("Error: invalid 'sleep' parameter: '%s'; use 'true' or 'false'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + networking_set_sleep (nmc, sleep_flag); + } } else if (matches (*argv, "wifi") == 0) { if (next_arg (&argc, &argv) != 0) { @@ -208,7 +293,7 @@ do_network_manager (NmCli *nmc, int argc, char **argv) nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WiFi enabled"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - nmc->allowed_fields[3].value = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->allowed_fields[4].value = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { @@ -240,7 +325,7 @@ do_network_manager (NmCli *nmc, int argc, char **argv) nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; nmc->print_fields.header_name = _("WWAN enabled"); print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ - nmc->allowed_fields[5].value = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->allowed_fields[6].value = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ } else { diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c index 328a6d8e..d416952c 100644 --- a/cli/src/nmcli.c +++ b/cli/src/nmcli.c @@ -286,6 +286,7 @@ nmc_init (NmCli *nmc) nmc->user_connections = NULL; nmc->should_wait = FALSE; + nmc->nowait_flag = TRUE; nmc->print_output = NMC_PRINT_NORMAL; nmc->multiline_output = FALSE; nmc->mode_specified = FALSE; diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h index b4e4562b..9788ef08 100644 --- a/cli/src/nmcli.h +++ b/cli/src/nmcli.h @@ -102,6 +102,7 @@ typedef struct _NmCli { GSList *user_connections; /* List of user connections */ gboolean should_wait; /* Indication that nmcli should not end yet */ + gboolean nowait_flag; /* '--nowait' option; used for passing to callbacks */ NMCPrintOutput print_output; /* Output mode */ gboolean multiline_output; /* Multiline output instead of default tabular */ gboolean mode_specified; /* Whether tabular/multiline mode was specified via '--mode' option */ diff --git a/cli/src/settings.c b/cli/src/settings.c index 1371bfbe..8b628764 100644 --- a/cli/src/settings.c +++ b/cli/src/settings.c @@ -50,13 +50,14 @@ static NmcOutputField nmc_fields_setting_connection[] = { /* Available fields for NM_SETTING_WIRED_SETTING_NAME */ static NmcOutputField nmc_fields_setting_wired[] = { - SETTING_FIELD ("name", 17), /* 0 */ - SETTING_FIELD (NM_SETTING_WIRED_PORT, 8), /* 1 */ - SETTING_FIELD (NM_SETTING_WIRED_SPEED, 10), /* 2 */ - SETTING_FIELD (NM_SETTING_WIRED_DUPLEX, 10), /* 3 */ - SETTING_FIELD (NM_SETTING_WIRED_AUTO_NEGOTIATE, 15), /* 4 */ - SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS, 19), /* 5 */ - SETTING_FIELD (NM_SETTING_WIRED_MTU, 6), /* 6 */ + SETTING_FIELD ("name", 17), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRED_PORT, 8), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRED_SPEED, 10), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRED_DUPLEX, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRED_AUTO_NEGOTIATE, 15), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS, 19), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, 19), /* 6 */ + SETTING_FIELD (NM_SETTING_WIRED_MTU, 6), /* 7 */ {NULL, NULL, 0, NULL, 0} }; #define NMC_FIELDS_SETTING_WIRED_ALL "name"","\ @@ -65,6 +66,7 @@ static NmcOutputField nmc_fields_setting_wired[] = { NM_SETTING_WIRED_DUPLEX","\ NM_SETTING_WIRED_AUTO_NEGOTIATE","\ NM_SETTING_WIRED_MAC_ADDRESS","\ + NM_SETTING_WIRED_CLONED_MAC_ADDRESS","\ NM_SETTING_WIRED_MTU #define NMC_FIELDS_SETTING_WIRED_COMMON NMC_FIELDS_SETTING_WIRED_ALL @@ -131,9 +133,10 @@ static NmcOutputField nmc_fields_setting_wireless[] = { SETTING_FIELD (NM_SETTING_WIRELESS_RATE, 10), /* 6 */ SETTING_FIELD (NM_SETTING_WIRELESS_TX_POWER, 10), /* 7 */ SETTING_FIELD (NM_SETTING_WIRELESS_MAC_ADDRESS, 19), /* 8 */ - SETTING_FIELD (NM_SETTING_WIRELESS_MTU, 6), /* 9 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SEEN_BSSIDS, 35), /* 10 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SEC, 10), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, 19), /* 9 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MTU, 6), /* 10 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SEEN_BSSIDS, 35), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SEC, 10), /* 12 */ {NULL, NULL, 0, NULL, 0} }; #define NMC_FIELDS_SETTING_WIRELESS_ALL "name"","\ @@ -145,6 +148,7 @@ static NmcOutputField nmc_fields_setting_wireless[] = { NM_SETTING_WIRELESS_RATE","\ NM_SETTING_WIRELESS_TX_POWER","\ NM_SETTING_WIRELESS_MAC_ADDRESS","\ + NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS","\ NM_SETTING_WIRELESS_MTU","\ NM_SETTING_WIRELESS_SEEN_BSSIDS","\ NM_SETTING_WIRELESS_SEC @@ -518,7 +522,7 @@ setting_wired_details (NMSetting *setting, NmCli *nmc) { NMSettingWired *s_wired; const GByteArray *mac; - char *speed_str, *mtu_str, *mac_str = NULL; + char *speed_str, *mtu_str, *device_mac_str = NULL, *cloned_mac_str = NULL; guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; @@ -535,21 +539,26 @@ setting_wired_details (NMSetting *setting, NmCli *nmc) mtu_str = g_strdup_printf ("%d", nm_setting_wired_get_mtu (s_wired)); mac = nm_setting_wired_get_mac_address (s_wired); if (mac) - mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + device_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + mac = nm_setting_wired_get_cloned_mac_address (s_wired); + if (mac) + cloned_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); nmc->allowed_fields[0].value = NM_SETTING_WIRED_SETTING_NAME; nmc->allowed_fields[1].value = nm_setting_wired_get_port (s_wired); nmc->allowed_fields[2].value = speed_str; nmc->allowed_fields[3].value = nm_setting_wired_get_duplex (s_wired); nmc->allowed_fields[4].value = nm_setting_wired_get_auto_negotiate (s_wired) ? _("yes") : _("no"); - nmc->allowed_fields[5].value = mac_str; - nmc->allowed_fields[6].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); + nmc->allowed_fields[5].value = device_mac_str; + nmc->allowed_fields[6].value = cloned_mac_str; + nmc->allowed_fields[7].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ g_free (speed_str); - g_free (mac_str); + g_free (device_mac_str); + g_free (cloned_mac_str); g_free (mtu_str); return TRUE; @@ -663,7 +672,7 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc) int i; const GByteArray *ssid, *bssid, *mac; char *ssid_str, *channel_str, *rate_str, *tx_power_str, *mtu_str; - char *mac_str = NULL, *bssid_str = NULL; + char *device_mac_str = NULL, *cloned_mac_str = NULL, *bssid_str = NULL; GString *seen_bssids; guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; @@ -688,7 +697,10 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc) mtu_str = g_strdup_printf ("%d", nm_setting_wireless_get_mtu (s_wireless)); mac = nm_setting_wireless_get_mac_address (s_wireless); if (mac) - mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + device_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + mac = nm_setting_wireless_get_cloned_mac_address (s_wireless); + if (mac) + cloned_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); seen_bssids = g_string_new (NULL); for (i = 0; i < nm_setting_wireless_get_num_seen_bssids (s_wireless); i++) { if (i > 0) @@ -704,10 +716,11 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc) nmc->allowed_fields[5].value = bssid_str ? bssid_str : _("not set"); nmc->allowed_fields[6].value = rate_str; nmc->allowed_fields[7].value = tx_power_str; - nmc->allowed_fields[8].value = mac_str ? mac_str : _("not set"); - nmc->allowed_fields[9].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); - nmc->allowed_fields[10].value = seen_bssids->str; - nmc->allowed_fields[11].value = nm_setting_wireless_get_security (s_wireless); + nmc->allowed_fields[8].value = device_mac_str ? device_mac_str : _("not set"); + nmc->allowed_fields[9].value = cloned_mac_str ? cloned_mac_str : _("not set"); + nmc->allowed_fields[10].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); + nmc->allowed_fields[11].value = seen_bssids->str; + nmc->allowed_fields[12].value = nm_setting_wireless_get_security (s_wireless); nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ @@ -717,7 +730,8 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc) g_free (bssid_str); g_free (rate_str); g_free (tx_power_str); - g_free (mac_str); + g_free (device_mac_str); + g_free (cloned_mac_str); g_free (mtu_str); g_string_free (seen_bssids, TRUE); |