NetworkManager/src/nmcli/connections.h
Íñigo Huguet bb850fda0e nmcli: connection: process port-type, type and controller first
If the connection is a port we need to set the connection.port-type
property. Usually this property is guessed by nmcli depending on the
connection type or the chosen controller, so it doesn't need to be
specified by the user. However, if it is explicitly set by the user
we should not guess, but just use it.

When we process arguments like "controller" or "type" we call custom
functions like set_connection_controller that will guess the port-type
if needed. By processing port-type first, it will be set in the
connection by the time that these other properties are processed, so they
won't try to guess.

After port-type, process connection.type and connection.controller, as we
are usually capable of deducing the port-type from them. Type needs to
be processed first because some types like bond-slave or ovs-port have
only one possible port-type value so we must not try to guess from the
controller.

Fixes: c5324ed285 ('nmcli: streamline connection addition')
2025-04-14 10:08:01 +00:00

31 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2010 - 2018 Red Hat, Inc.
*/
#ifndef NMC_CONNECTIONS_H
#define NMC_CONNECTIONS_H
#include "nmcli.h"
void nmc_monitor_connections(NmCli *nmc);
const char *nmc_connection_check_deprecated(NMConnection *c);
gboolean nmc_process_connection_properties(NmCli *nmc,
NMConnection *connection,
int argc,
const char *const *args,
gboolean allow_remove_setting,
GError **error);
NMMetaColor nmc_active_connection_state_to_color(NMActiveConnection *ac);
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[];
extern const NmcMetaGenericInfo *const nmc_fields_con_active_details_groups[];
#endif /* NMC_CONNECTIONS_H */