diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2018-11-09 16:45:21 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2018-11-21 11:46:21 +0100 |
commit | 522fd14251c7c5166d095b7b119e3fc829672323 (patch) | |
tree | 72da04e1a064121254bcc7fcb9f42e41312f09a6 | |
parent | 2a7e60d7244b20771933db61ee5a1c76bcb768a9 (diff) | |
download | NetworkManager-522fd14251c7c5166d095b7b119e3fc829672323.tar.gz |
cli/connections: export nmc_active_connection_cmp()
To be able to sensibly sort devices we want to be able to sort their
active connections. Currently it's implemented redundantly.
-rw-r--r-- | clients/cli/connections.c | 8 | ||||
-rw-r--r-- | clients/cli/connections.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 841d0f938a..b77869b6ec 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -141,8 +141,8 @@ active_connection_get_state_ord (NMActiveConnection *active) return -1; } -static int -active_connection_cmp (NMActiveConnection *ac_a, NMActiveConnection *ac_b) +int +nmc_active_connection_cmp (NMActiveConnection *ac_a, NMActiveConnection *ac_b) { NM_CMP_SELF (ac_a, ac_b); NM_CMP_DIRECT (active_connection_get_state_ord (ac_b), @@ -1149,7 +1149,7 @@ get_ac_for_connection_cmp (gconstpointer pa, gconstpointer pb, gpointer user_dat NMActiveConnection *ac_a = *((NMActiveConnection *const*) pa); NMActiveConnection *ac_b = *((NMActiveConnection *const*) pb); - return active_connection_cmp (ac_a, ac_b); + return nmc_active_connection_cmp (ac_a, ac_b); } static NMActiveConnection * @@ -1682,7 +1682,7 @@ con_show_get_items_cmp (gconstpointer pa, gconstpointer pb, gpointer user_data) * active connections... */ } - return active_connection_cmp (ac_a, ac_b); + return nmc_active_connection_cmp (ac_a, ac_b); } static GPtrArray * diff --git a/clients/cli/connections.h b/clients/cli/connections.h index 22bfa8ec2a..122a7e2763 100644 --- a/clients/cli/connections.h +++ b/clients/cli/connections.h @@ -35,6 +35,8 @@ nmc_read_connection_properties (NmCli *nmc, NMMetaColor nmc_active_connection_state_to_color (NMActiveConnectionState state); +int nmc_active_connection_cmp (NMActiveConnection *ac_a, NMActiveConnection *ac_b); + extern const NmcMetaGenericInfo *const metagen_con_show[]; extern const NmcMetaGenericInfo *const metagen_con_active_general[]; extern const NmcMetaGenericInfo *const metagen_con_active_vpn[]; |