Commit 5dd33558 authored by Thomas Haller's avatar Thomas Haller

release: bump version to 1.9.1-dev after 1.8.0 release

After 1.8.0 is released, merge it back into master so that
1.8.0 is part of the history of master. That means,
  $ git log --first-parent master
will also traverse 1.8.0 and 1.8-rc*.

Also bump the micro version to 1.9.1-dev to indicate that this is
after 1.8.0 is out.
parents 9c3df9ca 4dc905a9
......@@ -58,7 +58,7 @@ test-*.trs
/dispatcher/tests/test-dispatcher-envp
/clients/cli/nmcli
/clients/cli/settings-docs.c
/clients/common/settings-docs.c
/clients/tui/newt/libnmt-newt.a
/clients/tui/nmtui
/clients/nm-online
......@@ -271,6 +271,8 @@ test-*.trs
/src/tests/test-utils
/src/tests/test-wired-defname
/clients/common/tests/test-general
/vapi/*.vapi
# The following names are no longer present on this branch,
......@@ -304,8 +306,4 @@ test-*.trs
/libnm/nm-keyfile-docs.xml
/libnm/nm-setting-docs.xml
/libnm/nm-setting-docs-overrides.xml
# The following names are present on newer upstream. Ignore them
# also when switching branches
/clients/common/settings-docs.c
/clients/common/tests
/clients/cli/settings-docs.c
......@@ -28,6 +28,7 @@ examples_DATA =
CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
EXTRA_LTLIBRARIES =
dist_hook =
dist_dependencies =
dist_configure_check =
......@@ -414,9 +415,10 @@ libnm_core_lib_h_pub_real = \
libnm_core_lib_h_pub_mkenums = \
libnm-core/nm-core-enum-types.h
libnm_core_lib_h_priv = \
shared/nm-utils/nm-enum-utils.h \
shared/nm-utils/nm-shared-utils.h \
shared/nm-utils/nm-udev-utils.h \
shared/nm-setting-metadata.h \
shared/nm-meta-setting.h \
libnm-core/crypto.h \
libnm-core/nm-connection-private.h \
libnm-core/nm-core-internal.h \
......@@ -427,9 +429,10 @@ libnm_core_lib_h_priv = \
libnm-core/nm-setting-private.h \
libnm-core/nm-utils-private.h
libnm_core_lib_c_real = \
shared/nm-utils/nm-enum-utils.c \
shared/nm-utils/nm-shared-utils.c \
shared/nm-utils/nm-udev-utils.c \
shared/nm-setting-metadata.c \
shared/nm-meta-setting.c \
libnm-core/crypto.c \
libnm-core/nm-connection.c \
libnm-core/nm-dbus-utils.c \
......@@ -3141,6 +3144,121 @@ clients_nm_online_LDADD = \
$(clients_nm_online_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
###############################################################################
# clients/common
###############################################################################
clients_cppflags = \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
-I$(builddir)/libnm-core \
-I$(srcdir)/libnm \
-I$(builddir)/libnm \
-I$(srcdir)/clients/common \
-I$(builddir)/clients/common \
$(GLIB_CFLAGS) \
-DNMLOCALEDIR=\"$(datadir)/locale\"
check_ltlibraries += clients/common/libnmc-base.la
clients_common_libnmc_base_la_SOURCES = \
clients/common/nm-secret-agent-simple.c \
clients/common/nm-secret-agent-simple.h \
clients/common/nm-vpn-helpers.c \
clients/common/nm-vpn-helpers.h
clients_common_libnmc_base_la_CPPFLAGS = \
$(clients_cppflags) \
-DG_LOG_DOMAIN=\""libnmc"\"
clients_common_libnmc_base_la_LIBADD = \
libnm/libnm.la \
$(GLIB_LIBS)
$(clients_common_libnmc_base_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
clients_common_settings_doc_c = clients/common/settings-docs.c
if HAVE_INTROSPECTION
$(clients_common_settings_doc_c): clients/common/settings-docs.xsl libnm/nm-property-docs.xml clients/common/.dirstamp
$(AM_V_GEN) $(XSLTPROC) --output $@ $< $(word 2,$^)
DISTCLEANFILES += $(clients_common_settings_doc_c)
check-local-settings-docs: $(clients_common_settings_doc_c)
@if test -z "$$NMTST_NO_CHECK_SETTINGS_DOCS" ; then \
if ! cmp -s "$(srcdir)/$(clients_common_settings_doc_c).in" "$(builddir)/$(clients_common_settings_doc_c)" ; then \
echo "The generated file \"$(builddir)/$(clients_common_settings_doc_c)\" differs from the source file \"$(srcdir)/$(clients_common_settings_doc_c).in\". You probably should copy the generated file over to the source file. You can skip this test by setting \$$NMTST_NO_CHECK_SETTINGS_DOCS=yes"; \
false; \
fi;\
fi
check_local += check-local-settings-docs
else
$(clients_common_settings_doc_c): $(clients_common_settings_doc_c).in clients/common/.dirstamp
$(AM_V_GEN) cp "$(srcdir)/$(clients_common_settings_doc_c).in" "$(builddir)/$(clients_common_settings_doc_c)"
check-local-settings-docs:
endif
EXTRA_DIST += \
$(clients_common_settings_doc_c) \
$(clients_common_settings_doc_c).in
if HAVE_INTROSPECTION
check_ltlibraries += clients/common/libnmc.la
else
EXTRA_LTLIBRARIES += clients/common/libnmc.la
endif
clients_common_libnmc_la_SOURCES = \
shared/nm-utils/nm-enum-utils.c \
shared/nm-utils/nm-enum-utils.h \
shared/nm-utils/nm-shared-utils.c \
shared/nm-utils/nm-shared-utils.h \
\
shared/nm-meta-setting.c \
shared/nm-meta-setting.h \
\
clients/common/nm-client-utils.c \
clients/common/nm-client-utils.h \
clients/common/nm-meta-setting-desc.c \
clients/common/nm-meta-setting-desc.h \
clients/common/nm-meta-setting-access.c \
clients/common/nm-meta-setting-access.h \
$(NULL)
clients_common_libnmc_la_CPPFLAGS = \
$(clients_cppflags) \
-DG_LOG_DOMAIN=\""libnmc"\"
clients_common_libnmc_la_LIBADD = \
libnm/libnm.la \
clients/common/libnmc-base.la \
$(GLIB_LIBS)
$(clients_common_libnmc_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
$(clients_common_libnmc_la_OBJECTS): $(clients_common_settings_doc_c)
$(clients_common_libnmc_la_OBJECTS): clients/common/.dirstamp
if HAVE_INTROSPECTION
check_programs += clients/common/tests/test-general
else
if BUILD_NMCLI
check_programs += clients/common/tests/test-general
endif
endif
clients_common_tests_test_general_CPPFLAGS = \
-I$(srcdir)/clients/common/tests \
$(clients_cppflags) \
-DG_LOG_DOMAIN=\""libnmc"\"
clients_common_tests_test_general_LDADD = \
libnm/libnm.la \
clients/common/libnmc-base.la \
clients/common/libnmc.la \
$(GLIB_LIBS)
$(clients_common_tests_test_general_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
###############################################################################
# clients/cli
###############################################################################
......@@ -3150,50 +3268,38 @@ if BUILD_NMCLI
bin_PROGRAMS += clients/cli/nmcli
clients_cli_nmcli_SOURCES = \
\
clients/cli/agent.c \
clients/cli/agent.h \
clients/cli/common.c \
clients/cli/common.h \
clients/cli/utils.c \
clients/cli/utils.h \
clients/cli/agent.c \
clients/cli/agent.h \
clients/cli/general.c \
clients/cli/general.h \
clients/cli/connections.c \
clients/cli/connections.h \
clients/cli/devices.c \
clients/cli/devices.h \
clients/cli/general.c \
clients/cli/general.h \
clients/cli/settings.c \
clients/cli/settings.h \
clients/cli/nmcli.c \
clients/cli/nmcli.h \
clients/cli/utils.c \
clients/cli/utils.h \
clients/cli/polkit-agent.c \
clients/cli/polkit-agent.h \
\
clients/common/nm-secret-agent-simple.c \
clients/common/nm-secret-agent-simple.h \
clients/common/nm-vpn-helpers.c \
clients/common/nm-vpn-helpers.h \
$(NULL)
clients_cli_nmcli_CPPFLAGS = \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
-I$(builddir)/libnm-core \
-I$(srcdir)/libnm \
-I$(builddir)/libnm \
-I$(srcdir)/clients/cli \
-I$(builddir)/clients/cli \
-I$(srcdir)/clients/common \
$(GLIB_CFLAGS) \
$(clients_cppflags) \
-DG_LOG_DOMAIN=\""nmcli"\" \
-DNMCLI_LOCALEDIR=\"$(datadir)/locale\"
clients_cli_nmcli_LDADD = \
libnm/libnm.la \
clients/common/libnmc-base.la \
clients/common/libnmc.la \
$(GLIB_LIBS) \
$(READLINE_LIBS) \
libnm/libnm.la
$(READLINE_LIBS)
if WITH_POLKIT_AGENT
clients_cli_nmcli_CPPFLAGS += $(POLKIT_CFLAGS)
......@@ -3206,8 +3312,7 @@ endif
clients_cli_nmcli_LDFLAGS = \
-Wl,--version-script="$(srcdir)/linker-script-binary.ver"
$(clients_cli_nmcli_OBJECTS): $(clients_cli_settings_doc_c)
$(clients_cli_nmcli_OBJECTS): clients/cli/.dirstamp
$(clients_cli_nmcli_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
install-data-hook-nmcli:
$(mkinstalldirs) $(DESTDIR)$(completiondir)
......@@ -3222,25 +3327,9 @@ uninstall_hook += uninstall-hook-nmcli
endif
clients_cli_settings_doc_c = clients/cli/settings-docs.c
if HAVE_INTROSPECTION
$(clients_cli_settings_doc_c): clients/cli/settings-docs.xsl libnm/nm-property-docs.xml
$(AM_V_GEN) $(XSLTPROC) --output $@ $< $(word 2,$^)
$(clients_cli_settings_doc_c): clients/cli/.dirstamp
DISTCLEANFILES += $(clients_cli_settings_doc_c)
else
$(clients_cli_settings_doc_c):
@echo "to generate $(clients_cli_settings_doc_c), configure with --enable-introspection"
@echo "alternatively, build --without-nmcli"
@false
endif
EXTRA_DIST += $(clients_cli_settings_doc_c)
EXTRA_DIST += \
clients/cli/nmcli-completion \
clients/cli/settings-docs.xsl
clients/common/settings-docs.xsl
###############################################################################
# clients/tui
......@@ -3390,26 +3479,14 @@ clients_tui_nmtui_SOURCES = \
clients/tui/nmt-utils.h \
clients/tui/nmt-widget-list.c \
clients/tui/nmt-widget-list.h \
clients/common/nm-secret-agent-simple.c \
clients/common/nm-secret-agent-simple.h \
clients/common/nm-vpn-helpers.c \
clients/common/nm-vpn-helpers.h \
$(NULL)
clients_tui_nmtui_CPPFLAGS = \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
-I$(builddir)/libnm-core \
-I$(srcdir)/libnm \
-I$(builddir)/libnm \
-I$(srcdir)/clients/tui/newt \
-I$(srcdir)/clients/common \
$(GLIB_CFLAGS) \
$(clients_cppflags) \
$(NEWT_CFLAGS) \
-DG_LOG_DOMAIN=\""nmtui"\" \
-DLOCALEDIR=\""$(localedir)"\" \
$(NULL)
-DLOCALEDIR=\""$(localedir)"\"
clients_tui_nmtui_LDFLAGS = \
-Wl,--version-script="$(srcdir)/linker-script-binary.ver"
......@@ -3417,6 +3494,7 @@ clients_tui_nmtui_LDFLAGS = \
clients_tui_nmtui_LDADD = \
libnm/libnm.la \
clients/tui/newt/libnmt-newt.a \
clients/common/libnmc-base.la \
$(GLIB_LIBS) \
$(NEWT_LIBS) \
$(NULL)
......
......@@ -21,6 +21,8 @@
#include "nm-default.h"
#include "agent.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
......@@ -31,7 +33,6 @@
#include "utils.h"
#include "nm-secret-agent-simple.h"
#include "polkit-agent.h"
#include "agent.h"
static void
usage (void)
......@@ -125,7 +126,7 @@ secrets_requested (NMSecretAgentSimple *agent,
NmCli *nmc = (NmCli *) user_data;
gboolean success = FALSE;
if (nmc->print_output == NMC_PRINT_PRETTY)
if (nmc->nmc_config.print_output == NMC_PRINT_PRETTY)
nmc_terminal_erase_line ();
success = get_secrets_from_user (request_id, title, msg, secrets);
......
This diff is collapsed.
......@@ -25,27 +25,15 @@
#include "nmcli.h"
#include "nm-secret-agent-simple.h"
gboolean print_ip4_config (NMIPConfig *cfg4, NmCli *nmc, const char *group_prefix, const char *one_field);
gboolean print_ip6_config (NMIPConfig *cfg6, NmCli *nmc, const char *group_prefix, const char *one_field);
gboolean print_dhcp4_config (NMDhcpConfig *dhcp4, NmCli *nmc, const char *group_prefix, const char *one_field);
gboolean print_dhcp6_config (NMDhcpConfig *dhcp6, NmCli *nmc, const char *group_prefix, const char *one_field);
NMIPAddress *nmc_parse_and_build_address (int family, const char *ip_str, GError **error);
NMIPRoute *nmc_parse_and_build_route (int family, const char *str, GError **error);
gboolean print_ip4_config (NMIPConfig *cfg4, const NmcConfig *nmc_config, const char *one_field);
gboolean print_ip6_config (NMIPConfig *cfg6, const NmcConfig *nmc_config, const char *group_prefix, const char *one_field);
gboolean print_dhcp4_config (NMDhcpConfig *dhcp4, const NmcConfig *nmc_config, const char *group_prefix, const char *one_field);
gboolean print_dhcp6_config (NMDhcpConfig *dhcp6, const NmcConfig *nmc_config, const char *group_prefix, const char *one_field);
const char * nmc_device_state_to_string (NMDeviceState state);
const char * nmc_device_reason_to_string (NMDeviceStateReason reason);
const char * nmc_device_metered_to_string (NMMetered value);
char **
nmc_vlan_parse_priority_maps (const char *priority_map,
NMVlanPriorityMap map_type,
GError **error);
const char *nmc_bond_validate_mode (const char *mode, GError **error);
gboolean nmc_team_check_config (const char *config, char **out_config, GError **error);
gboolean nmc_proxy_check_script (const char *script, char **out_script, GError **error);
NMConnection *nmc_find_connection (const GPtrArray *connections,
const char *filter_type,
const char *filter_val,
......@@ -65,7 +53,8 @@ char *nmc_unique_connection_name (const GPtrArray *connections,
void nmc_cleanup_readline (void);
char *nmc_readline (const char *prompt_fmt, ...) G_GNUC_PRINTF (1, 2);
char *nmc_readline_echo (gboolean echo_on, const char *prompt_fmt, ...) G_GNUC_PRINTF (2, 3);
char *nmc_rl_gen_func_basic (const char *text, int state, const char **words);
NmcCompEntryFunc nmc_rl_compentry_func_wrap (const char *const*values);
char *nmc_rl_gen_func_basic (const char *text, int state, const char *const*words);
char *nmc_rl_gen_func_ifnames (const char *text, int state);
gboolean nmc_get_in_readline (void);
void nmc_set_in_readline (gboolean in_readline);
......@@ -92,9 +81,9 @@ void nmc_complete_bool (const char *prefix);
const char *nmc_error_get_simple_message (GError *error);
extern NmcOutputField nmc_fields_ip4_config[];
extern NmcOutputField nmc_fields_dhcp4_config[];
extern NmcOutputField nmc_fields_ip6_config[];
extern NmcOutputField nmc_fields_dhcp6_config[];
extern const NmcMetaGenericInfo *const metagen_ip4_config[];
extern const NmcMetaGenericInfo *const nmc_fields_dhcp4_config[];
extern const NmcMetaGenericInfo *const nmc_fields_ip6_config[];
extern const NmcMetaGenericInfo *const nmc_fields_dhcp6_config[];
#endif /* NMC_COMMON_H */
This diff is collapsed.
......@@ -33,12 +33,11 @@ nmc_read_connection_properties (NmCli *nmc,
char ***argv,
GError **error);
void nmc_active_connection_state_to_color (NMActiveConnectionState state, NmcTermColor *color);
void nmc_active_connection_state_to_color (NMActiveConnectionState state, NMMetaTermColor *color);
extern NmcOutputField nmc_fields_con_show[];
extern NmcOutputField nmc_fields_settings_names[];
extern NmcOutputField nmc_fields_con_active_details_general[];
extern NmcOutputField nmc_fields_con_active_details_vpn[];
extern NmcOutputField nmc_fields_con_active_details_groups[];
extern const NmcMetaGenericInfo *const nmc_fields_con_show[];
extern const NmcMetaGenericInfo *const nmc_fields_con_active_details_general[];
extern const NmcMetaGenericInfo *const nmc_fields_con_active_details_vpn[];
extern const NmcMetaGenericInfo *const nmc_fields_con_active_details_groups[];
#endif /* NMC_CONNECTIONS_H */
This diff is collapsed.
......@@ -32,22 +32,22 @@ void monitor_devices (NmCli *nmc);
NMDevice ** nmc_get_devices_sorted (NMClient *client);
void nmc_device_state_to_color (NMDeviceState state, NmcTermColor *color, NmcTermFormat *color_fmt);
extern NmcOutputField nmc_fields_dev_status[];
extern NmcOutputField nmc_fields_dev_show_general[];
extern NmcOutputField nmc_fields_dev_show_connections[];
extern NmcOutputField nmc_fields_dev_show_cap[];
extern NmcOutputField nmc_fields_dev_show_wired_prop[];
extern NmcOutputField nmc_fields_dev_show_wifi_prop[];
extern NmcOutputField nmc_fields_dev_show_wimax_prop[];
extern NmcOutputField nmc_fields_dev_wifi_list[];
extern NmcOutputField nmc_fields_dev_wimax_list[];
extern NmcOutputField nmc_fields_dev_show_master_prop[];
extern NmcOutputField nmc_fields_dev_show_team_prop[];
extern NmcOutputField nmc_fields_dev_show_vlan_prop[];
extern NmcOutputField nmc_fields_dev_show_bluetooth[];
extern NmcOutputField nmc_fields_dev_show_sections[];
extern NmcOutputField nmc_fields_dev_lldp_list[];
void nmc_device_state_to_color (NMDeviceState state, NMMetaTermColor *color, NMMetaTermFormat *color_fmt);
extern const NmcMetaGenericInfo *const nmc_fields_dev_status[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_general[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_connections[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_cap[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_wired_prop[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_wifi_prop[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_wimax_prop[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_wifi_list[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_wimax_list[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_master_prop[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_team_prop[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_vlan_prop[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_bluetooth[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_sections[];
extern const NmcMetaGenericInfo *const nmc_fields_dev_lldp_list[];
#endif /* NMC_DEVICES_H */
This diff is collapsed.
This diff is collapsed.
......@@ -23,6 +23,8 @@
#include "NetworkManager.h"
#include "nm-secret-agent-old.h"
#include "nm-meta-setting-desc.h"
#if WITH_POLKIT_AGENT
#include "nm-polkit-listener.h"
#else
......@@ -30,6 +32,8 @@
typedef gpointer NMPolkitListener;
#endif
typedef char *(*NmcCompEntryFunc) (const char *, int);
/* nmcli exit codes */
typedef enum {
/* Indicates successful execution */
......@@ -69,28 +73,6 @@ typedef enum {
NMC_RESULT_COMPLETE_FILE = 65,
} NMCResultCode;
typedef enum {
NMC_TERM_COLOR_NORMAL = 0,
NMC_TERM_COLOR_BLACK = 1,
NMC_TERM_COLOR_RED = 2,
NMC_TERM_COLOR_GREEN = 3,
NMC_TERM_COLOR_YELLOW = 4,
NMC_TERM_COLOR_BLUE = 5,
NMC_TERM_COLOR_MAGENTA = 6,
NMC_TERM_COLOR_CYAN = 7,
NMC_TERM_COLOR_WHITE = 8
} NmcTermColor;
typedef enum {
NMC_TERM_FORMAT_NORMAL,
NMC_TERM_FORMAT_BOLD,
NMC_TERM_FORMAT_DIM,
NMC_TERM_FORMAT_UNDERLINE,
NMC_TERM_FORMAT_BLINK,
NMC_TERM_FORMAT_REVERSE,
NMC_TERM_FORMAT_HIDDEN,
} NmcTermFormat;
typedef enum {
NMC_PRINT_TERSE = 0,
NMC_PRINT_NORMAL = 1,
......@@ -98,30 +80,29 @@ typedef enum {
} NMCPrintOutput;
/* === Output fields === */
/* Flags for NmcOutputField */
#define NMC_OF_FLAG_FIELD_NAMES 0x00000001 /* Print field names instead of values */
#define NMC_OF_FLAG_SECTION_PREFIX 0x00000002 /* Use the first value as section prefix for the other field names - just in multiline */
#define NMC_OF_FLAG_MAIN_HEADER_ADD 0x00000004 /* Print main header in addition to values/field names */
#define NMC_OF_FLAG_MAIN_HEADER_ONLY 0x00000008 /* Print main header only */
typedef struct _NmcOutputField {
const char *name; /* Field's name */
const char *name_l10n; /* Field's name for translation */
typedef enum {
NMC_OF_FLAG_FIELD_NAMES = 0x00000001, /* Print field names instead of values */
NMC_OF_FLAG_SECTION_PREFIX = 0x00000002, /* Use the first value as section prefix for the other field names - just in multiline */
NMC_OF_FLAG_MAIN_HEADER_ADD = 0x00000004, /* Print main header in addition to values/field names */
NMC_OF_FLAG_MAIN_HEADER_ONLY = 0x00000008, /* Print main header only */
} NmcOfFlags;
extern const const NMMetaType nmc_meta_type_generic_info;
typedef struct _NmcOutputField NmcOutputField;
typedef struct _NmcMetaGenericInfo NmcMetaGenericInfo;
struct _NmcOutputField {
const NMMetaAbstractInfo *info;
int width; /* Width in screen columns */
struct _NmcOutputField *group; /* Points to an array with available section field names if this is a section (group) field */
void *value; /* Value of current field - char* or char** (NULL-terminated array) */
gboolean value_is_array; /* Whether value is char** instead of char* */
gboolean free_value; /* Whether to free the value */
guint32 flags; /* Flags - whether and how to print values/field names/headers */
NmcTermColor color; /* Use this color to print value */
NmcTermFormat color_fmt; /* Use this terminal format to print value */
} NmcOutputField;
typedef struct {
GArray *indices; /* Array of field indices to the array of allowed fields */
char *header_name; /* Name of the output */
int indent; /* Indent by this number of spaces */
} NmcPrintFields;
NmcOfFlags flags; /* Flags - whether and how to print values/field names/headers */
NMMetaTermColor color; /* Use this color to print value */
NMMetaTermFormat color_fmt; /* Use this terminal format to print value */
};
typedef enum {
NMC_USE_COLOR_AUTO,
......@@ -129,6 +110,19 @@ typedef enum {
NMC_USE_COLOR_NO,
} NmcColorOption;
typedef struct _NmcConfig {
NMCPrintOutput print_output; /* Output mode */
NmcColorOption use_colors; /* Whether to use colors for output: option '--color' */
bool multiline_output; /* Multiline output instead of default tabular */
bool escape_values; /* Whether to escape ':' and '\' in terse tabular mode */
bool in_editor; /* Whether running the editor - nmcli con edit' */
bool show_secrets; /* Whether to display secrets (both input and output): option '--show-secrets' */
} NmcConfig;
typedef struct _NmcOutputData {
GPtrArray *output_data; /* GPtrArray of arrays of NmcOutputField structs - accumulates data for output */
} NmcOutputData;
/* NmCli - main structure */
typedef struct _NmCli {
NMClient *client; /* Pointer to NMClient of libnm */
......@@ -144,22 +138,17 @@ typedef struct _NmCli {
int should_wait; /* Semaphore indicating whether nmcli should not end or not 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 */
NmcColorOption use_colors; /* Whether to use colors for output: option '--color' */
gboolean escape_values; /* Whether to escape ':' and '\' in terse tabular mode */
union {
const NmcConfig nmc_config;
NmcConfig nmc_config_mutable;
};
char *required_fields; /* Required fields in output: '--fields' option */
GPtrArray *output_data; /* GPtrArray of arrays of NmcOutputField structs - accumulates data for output */
NmcPrintFields print_fields; /* Structure with field indices to print */
gboolean ask; /* Ask for missing parameters: option '--ask' */
gboolean complete; /* Autocomplete the command line */
gboolean show_secrets; /* Whether to display secrets (both input and output): option '--show-secrets' */
gboolean in_editor; /* Whether running the editor - nmcli con edit' */
gboolean editor_status_line; /* Whether to display status line in connection editor */
gboolean editor_save_confirmation; /* Whether to ask for confirmation on saving connections with 'autoconnect=yes' */
gboolean editor_show_secrets; /* Whether to display secrets in the editor' */
NmcTermColor editor_prompt_color; /* Color of prompt in connection editor */
NMMetaTermColor editor_prompt_color; /* Color of prompt in connection editor */
} NmCli;
extern NmCli nm_cli;
......@@ -168,9 +157,19 @@ extern NmCli nm_cli;
#define NMCLI_ERROR (nmcli_error_quark ())
GQuark nmcli_error_quark (void);
extern GMainLoop *loop;
gboolean nmc_seen_sigint (void);
void nmc_clear_sigint (void);
void nmc_set_sigquit_internal (void);
void nmc_exit (void);
void nmc_empty_output_fields (NmcOutputData *output_data);
#define NMC_OUTPUT_DATA_DEFINE_SCOPED(out) \
gs_unref_array GArray *out##_indices = NULL; \
nm_auto (nmc_empty_output_fields) NmcOutputData out = { \
.output_data = g_ptr_array_new_full (20, g_free), \
}
#endif /* NMC_NMCLI_H */
......@@ -21,13 +21,15 @@
#if WITH_POLKIT_AGENT
#include "polkit-agent.h"
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "polkit-agent.h"
#include "nm-polkit-listener.h"
#include "common.h"
static char *
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">