mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-04 15:21:12 +00:00
format: reformat source tree with clang-format 13.0
We use clang-format for automatic formatting of our source files. Since clang-format is actively maintained software, the actual formatting depends on the used version of clang-format. That is unfortunate and painful, but really unavoidable unless clang-format would be strictly bug-compatible. So the version that we must use is from the current Fedora release, which is also tested by our gitlab-ci. Previously, we were using Fedora 34 with clang-tools-extra-12.0.1-1.fc34.x86_64. As Fedora 35 comes along, we need to update our formatting as Fedora 35 comes with version "13.0.0~rc1-1.fc35". An alternative would be to freeze on version 12, but that has different problems (like, it's cumbersome to rebuild clang 12 on Fedora 35 and it would be cumbersome for our developers which are on Fedora 35 to use a clang that they cannot easily install). The (differently painful) solution is to reformat from time to time, as we switch to a new Fedora (and thus clang) version. Usually we would expect that such a reformatting brings minor changes. But this time, the changes are huge. That is mentioned in the release notes [1] as Makes PointerAligment: Right working with AlignConsecutiveDeclarations. (Fixes https://llvm.org/PR27353) [1] https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
This commit is contained in:
parent
e44cdc7981
commit
615221a99c
|
@ -27,7 +27,7 @@ char *
|
|||
nm_utils_uuid_generate(void)
|
||||
{
|
||||
uuid_t uuid;
|
||||
char * buf;
|
||||
char *buf;
|
||||
|
||||
buf = g_malloc0(37);
|
||||
uuid_generate_random(uuid);
|
||||
|
@ -40,10 +40,10 @@ add_connection(GDBusProxy *proxy, const char *con_name)
|
|||
{
|
||||
GVariantBuilder connection_builder;
|
||||
GVariantBuilder setting_builder;
|
||||
char * uuid;
|
||||
const char * new_con_path;
|
||||
GVariant * ret;
|
||||
GError * error = NULL;
|
||||
char *uuid;
|
||||
const char *new_con_path;
|
||||
GVariant *ret;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Initialize connection GVariantBuilder */
|
||||
g_variant_builder_init(&connection_builder, G_VARIANT_TYPE("a{sa{sv}}"));
|
||||
|
@ -117,7 +117,7 @@ int
|
|||
main(int argc, char *argv[])
|
||||
{
|
||||
GDBusProxy *proxy;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Create a D-Bus proxy; NM_DBUS_* defined in nm-dbus-interface.h */
|
||||
proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
static void
|
||||
added_cb(GObject *client, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
GMainLoop * loop = user_data;
|
||||
GMainLoop *loop = user_data;
|
||||
NMRemoteConnection *remote;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* NM responded to our request; either handle the resulting error or
|
||||
* print out the object path of the connection we just added.
|
||||
|
@ -43,11 +43,11 @@ added_cb(GObject *client, GAsyncResult *result, gpointer user_data)
|
|||
static void
|
||||
add_connection(NMClient *client, GMainLoop *loop, const char *con_name)
|
||||
{
|
||||
NMConnection * connection;
|
||||
NMConnection *connection;
|
||||
NMSettingConnection *s_con;
|
||||
NMSettingWired * s_wired;
|
||||
NMSettingIP4Config * s_ip4;
|
||||
char * uuid;
|
||||
NMSettingWired *s_wired;
|
||||
NMSettingIP4Config *s_ip4;
|
||||
char *uuid;
|
||||
|
||||
/* Create a new connection object */
|
||||
connection = nm_simple_connection_new();
|
||||
|
@ -88,9 +88,9 @@ add_connection(NMClient *client, GMainLoop *loop, const char *con_name)
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
NMClient * client;
|
||||
NMClient *client;
|
||||
GMainLoop *loop;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
loop = g_main_loop_new(NULL, FALSE);
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@ static void
|
|||
print_setting(const char *setting_name, GVariant *setting)
|
||||
{
|
||||
GVariantIter iter;
|
||||
const char * property_name;
|
||||
GVariant * value;
|
||||
char * printed_value;
|
||||
const char *property_name;
|
||||
GVariant *value;
|
||||
char *printed_value;
|
||||
|
||||
g_print(" %s:\n", setting_name);
|
||||
g_variant_iter_init(&iter, setting);
|
||||
|
@ -43,14 +43,14 @@ print_setting(const char *setting_name, GVariant *setting)
|
|||
static void
|
||||
print_connection(const char *path)
|
||||
{
|
||||
GDBusProxy * proxy;
|
||||
GError * error = NULL;
|
||||
GVariant * ret, *connection = NULL, *s_con = NULL;
|
||||
const char * id, *type;
|
||||
GDBusProxy *proxy;
|
||||
GError *error = NULL;
|
||||
GVariant *ret, *connection = NULL, *s_con = NULL;
|
||||
const char *id, *type;
|
||||
gboolean found;
|
||||
GVariantIter iter;
|
||||
const char * setting_name;
|
||||
GVariant * setting;
|
||||
const char *setting_name;
|
||||
GVariant *setting;
|
||||
|
||||
/* This function asks NetworkManager for the details of the connection */
|
||||
|
||||
|
@ -125,9 +125,9 @@ static void
|
|||
get_active_connection_details(const char *obj_path)
|
||||
{
|
||||
GDBusProxy *props_proxy;
|
||||
GVariant * ret = NULL, *path_value = NULL;
|
||||
GVariant *ret = NULL, *path_value = NULL;
|
||||
const char *path = NULL;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* This function gets the backing Connection object that describes the
|
||||
* network configuration that the ActiveConnection object is actually using.
|
||||
|
@ -185,9 +185,9 @@ out:
|
|||
static void
|
||||
get_active_connections(GDBusProxy *proxy)
|
||||
{
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
GVariant *ret = NULL, *value = NULL;
|
||||
char ** paths;
|
||||
char **paths;
|
||||
int i;
|
||||
|
||||
/* Get the ActiveConnections property from the NM Manager object */
|
||||
|
|
|
@ -65,11 +65,11 @@ show_access_point_info(NMAccessPoint *ap)
|
|||
{
|
||||
guint32 flags, wpa_flags, rsn_flags, freq, bitrate;
|
||||
guint8 strength;
|
||||
GBytes * ssid;
|
||||
GBytes *ssid;
|
||||
const char *hwaddr;
|
||||
NM80211Mode mode;
|
||||
char * freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str;
|
||||
GString * security_str;
|
||||
char *freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str;
|
||||
GString *security_str;
|
||||
|
||||
/* Get AP properties */
|
||||
flags = nm_access_point_get_flags(ap);
|
||||
|
@ -138,13 +138,13 @@ show_access_point_info(NMAccessPoint *ap)
|
|||
static void
|
||||
show_wifi_device_info(NMDevice *device)
|
||||
{
|
||||
NMAccessPoint * active_ap = NULL;
|
||||
NMAccessPoint *active_ap = NULL;
|
||||
const GPtrArray *aps;
|
||||
const char * iface;
|
||||
const char * driver;
|
||||
const char *iface;
|
||||
const char *driver;
|
||||
guint32 speed;
|
||||
GBytes * active_ssid;
|
||||
char * active_ssid_str = NULL;
|
||||
GBytes *active_ssid;
|
||||
char *active_ssid_str = NULL;
|
||||
int i;
|
||||
|
||||
/* Get active AP */
|
||||
|
@ -185,10 +185,10 @@ show_wifi_device_info(NMDevice *device)
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
NMClient * client;
|
||||
NMClient *client;
|
||||
const GPtrArray *devices;
|
||||
int i;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Get NMClient object */
|
||||
client = nm_client_new(NULL, &error);
|
||||
|
|
|
@ -21,9 +21,9 @@ static void
|
|||
list_connections(GDBusProxy *proxy)
|
||||
{
|
||||
int i;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
GVariant *ret;
|
||||
char ** paths;
|
||||
char **paths;
|
||||
|
||||
/* Call ListConnections D-Bus method */
|
||||
ret = g_dbus_proxy_call_sync(proxy,
|
||||
|
|
|
@ -24,9 +24,9 @@ show_connection(NMConnection *connection)
|
|||
{
|
||||
NMSettingConnection *s_con;
|
||||
guint64 timestamp;
|
||||
char * timestamp_str;
|
||||
char *timestamp_str;
|
||||
char timestamp_real_str[64];
|
||||
const char * val1, *val2, *val3, *val4, *val5;
|
||||
const char *val1, *val2, *val3, *val4, *val5;
|
||||
|
||||
s_con = nm_connection_get_setting_connection(connection);
|
||||
if (s_con) {
|
||||
|
@ -55,8 +55,8 @@ show_connection(NMConnection *connection)
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
NMClient * client;
|
||||
GError * error = NULL;
|
||||
NMClient *client;
|
||||
GError *error = NULL;
|
||||
const GPtrArray *connections;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
static void
|
||||
on_name_appeared(GDBusConnection *connection,
|
||||
const char * name,
|
||||
const char * name_owner,
|
||||
const char *name,
|
||||
const char *name_owner,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_print("Name '%s' on the system bus is owned by %s => NM is running\n", name, name_owner);
|
||||
|
@ -35,7 +35,7 @@ int
|
|||
main(int argc, char *argv[])
|
||||
{
|
||||
guint watcher_id;
|
||||
GMainLoop * loop;
|
||||
GMainLoop *loop;
|
||||
GBusNameWatcherFlags flags;
|
||||
|
||||
g_print("Monitor 'org.freedesktop.NetworkManager' D-Bus name\n");
|
||||
|
|
|
@ -45,9 +45,9 @@ nm_state_to_string(NMState state)
|
|||
|
||||
static void
|
||||
on_signal(GDBusProxy *proxy,
|
||||
char * sender_name,
|
||||
char * signal_name,
|
||||
GVariant * parameters,
|
||||
char *sender_name,
|
||||
char *signal_name,
|
||||
GVariant *parameters,
|
||||
gpointer user_data)
|
||||
{
|
||||
guint32 new_state;
|
||||
|
@ -72,10 +72,10 @@ on_signal(GDBusProxy *proxy,
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
GMainLoop * loop;
|
||||
GError * error = NULL;
|
||||
GMainLoop *loop;
|
||||
GError *error = NULL;
|
||||
GDBusProxyFlags flags;
|
||||
GDBusProxy * proxy;
|
||||
GDBusProxy *proxy;
|
||||
|
||||
/* Monitor 'StateChanged' signal on 'org.freedesktop.NetworkManager' interface */
|
||||
g_print("Monitor NetworkManager's state\n");
|
||||
|
|
|
@ -17,18 +17,18 @@ static NMConnection *
|
|||
vpn_connection_import(const char *filename)
|
||||
{
|
||||
NMConnection *conn = NULL;
|
||||
GSList * plugins;
|
||||
GSList * iter;
|
||||
GSList *plugins;
|
||||
GSList *iter;
|
||||
|
||||
g_print("Try to import file \"%s\"...\n", filename);
|
||||
|
||||
plugins = nm_vpn_plugin_info_list_load();
|
||||
|
||||
for (iter = plugins; iter; iter = iter->next) {
|
||||
GError * error = NULL;
|
||||
NMVpnPluginInfo * plugin = iter->data;
|
||||
GError *error = NULL;
|
||||
NMVpnPluginInfo *plugin = iter->data;
|
||||
NMVpnEditorPlugin *editor;
|
||||
const char * plugin_name = nm_vpn_plugin_info_get_name(plugin);
|
||||
const char *plugin_name = nm_vpn_plugin_info_get_name(plugin);
|
||||
|
||||
g_print("plugin[%s]: trying import...\n", plugin_name);
|
||||
|
||||
|
@ -72,8 +72,8 @@ vpn_connection_import(const char *filename)
|
|||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
GMainLoop * loop;
|
||||
GError * error;
|
||||
GMainLoop *loop;
|
||||
GError *error;
|
||||
NMRemoteConnection *rconn;
|
||||
} RequestData;
|
||||
|
||||
|
@ -89,8 +89,8 @@ add_cb(GObject *source, GAsyncResult *result, gpointer user_data)
|
|||
static NMRemoteConnection *
|
||||
connection_add(NMConnection *conn)
|
||||
{
|
||||
GError * error = NULL;
|
||||
NMClient * client;
|
||||
GError *error = NULL;
|
||||
NMClient *client;
|
||||
RequestData rdata;
|
||||
|
||||
g_print("Adding connection \"%s\" (%s)\n",
|
||||
|
@ -137,8 +137,8 @@ int
|
|||
main(int argc, char **argv)
|
||||
{
|
||||
NMRemoteConnection *rconn;
|
||||
NMConnection * conn;
|
||||
const char * filename;
|
||||
NMConnection *conn;
|
||||
const char *filename;
|
||||
gboolean success;
|
||||
|
||||
if (argc < 2) {
|
||||
|
|
|
@ -22,7 +22,7 @@ _get_keys(NMSettingVpn *setting, gboolean is_secrets, guint *out_length)
|
|||
{
|
||||
guint len;
|
||||
const char **keys = NULL;
|
||||
GPtrArray * a;
|
||||
GPtrArray *a;
|
||||
|
||||
nm_assert(NM_IS_SETTING_VPN(setting));
|
||||
|
||||
|
|
|
@ -33,21 +33,21 @@ typedef enum { /*< skip >*/
|
|||
} NMVpnEditorPluginServiceFlags;
|
||||
|
||||
struct _NMVpnEditorPluginVT {
|
||||
gboolean (*fcn_get_service_info)(NMVpnEditorPlugin * plugin,
|
||||
const char * service_type,
|
||||
char ** out_short_name,
|
||||
char ** out_pretty_name,
|
||||
char ** out_description,
|
||||
gboolean (*fcn_get_service_info)(NMVpnEditorPlugin *plugin,
|
||||
const char *service_type,
|
||||
char **out_short_name,
|
||||
char **out_pretty_name,
|
||||
char **out_description,
|
||||
NMVpnEditorPluginServiceFlags *out_flags);
|
||||
char **(*fcn_get_service_add_details)(NMVpnEditorPlugin *plugin, const char *service_name);
|
||||
gboolean (*fcn_get_service_add_detail)(NMVpnEditorPlugin *plugin,
|
||||
const char * service_type,
|
||||
const char * add_detail,
|
||||
char ** out_pretty_name,
|
||||
char ** out_description,
|
||||
char ** out_add_detail_key,
|
||||
char ** out_add_detail_val,
|
||||
guint * out_flags);
|
||||
const char *service_type,
|
||||
const char *add_detail,
|
||||
char **out_pretty_name,
|
||||
char **out_description,
|
||||
char **out_add_detail_key,
|
||||
char **out_add_detail_val,
|
||||
guint *out_flags);
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -58,17 +58,17 @@ struct _NMVpnEditorPluginVT {
|
|||
*****************************************************************************/
|
||||
|
||||
static inline gboolean
|
||||
nm_vpn_editor_plugin_get_service_info(NMVpnEditorPlugin * plugin,
|
||||
const char * service_type,
|
||||
char ** out_short_name,
|
||||
char ** out_pretty_name,
|
||||
char ** out_description,
|
||||
nm_vpn_editor_plugin_get_service_info(NMVpnEditorPlugin *plugin,
|
||||
const char *service_type,
|
||||
char **out_short_name,
|
||||
char **out_pretty_name,
|
||||
char **out_description,
|
||||
NMVpnEditorPluginServiceFlags *out_flags)
|
||||
{
|
||||
NMVpnEditorPluginVT vt;
|
||||
gs_free char * short_name_local = NULL;
|
||||
gs_free char * pretty_name_local = NULL;
|
||||
gs_free char * description_local = NULL;
|
||||
gs_free char *short_name_local = NULL;
|
||||
gs_free char *pretty_name_local = NULL;
|
||||
gs_free char *description_local = NULL;
|
||||
guint flags_local = 0;
|
||||
|
||||
g_return_val_if_fail(NM_IS_VPN_EDITOR_PLUGIN(plugin), FALSE);
|
||||
|
@ -94,7 +94,7 @@ static inline char **
|
|||
nm_vpn_editor_plugin_get_service_add_details(NMVpnEditorPlugin *plugin, const char *service_name)
|
||||
{
|
||||
NMVpnEditorPluginVT vt;
|
||||
char ** details = NULL;
|
||||
char **details = NULL;
|
||||
|
||||
g_return_val_if_fail(NM_IS_VPN_EDITOR_PLUGIN(plugin), NULL);
|
||||
g_return_val_if_fail(service_name, NULL);
|
||||
|
@ -109,19 +109,19 @@ nm_vpn_editor_plugin_get_service_add_details(NMVpnEditorPlugin *plugin, const ch
|
|||
|
||||
static inline gboolean
|
||||
nm_vpn_editor_plugin_get_service_add_detail(NMVpnEditorPlugin *plugin,
|
||||
const char * service_type,
|
||||
const char * add_detail,
|
||||
char ** out_pretty_name,
|
||||
char ** out_description,
|
||||
char ** out_add_detail_key,
|
||||
char ** out_add_detail_val,
|
||||
guint * out_flags)
|
||||
const char *service_type,
|
||||
const char *add_detail,
|
||||
char **out_pretty_name,
|
||||
char **out_description,
|
||||
char **out_add_detail_key,
|
||||
char **out_add_detail_val,
|
||||
guint *out_flags)
|
||||
{
|
||||
NMVpnEditorPluginVT vt;
|
||||
gs_free char * pretty_name_local = NULL;
|
||||
gs_free char * description_local = NULL;
|
||||
gs_free char * add_detail_key_local = NULL;
|
||||
gs_free char * add_detail_val_local = NULL;
|
||||
gs_free char *pretty_name_local = NULL;
|
||||
gs_free char *description_local = NULL;
|
||||
gs_free char *add_detail_key_local = NULL;
|
||||
gs_free char *add_detail_val_local = NULL;
|
||||
guint flags_local = 0;
|
||||
|
||||
g_return_val_if_fail(NM_IS_VPN_EDITOR_PLUGIN(plugin), FALSE);
|
||||
|
|
|
@ -12,22 +12,22 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
NMVpnEditor *
|
||||
nm_vpn_plugin_utils_load_editor(const char * module_name,
|
||||
const char * factory_name,
|
||||
nm_vpn_plugin_utils_load_editor(const char *module_name,
|
||||
const char *factory_name,
|
||||
NMVpnPluginUtilsEditorFactory editor_factory,
|
||||
NMVpnEditorPlugin * editor_plugin,
|
||||
NMConnection * connection,
|
||||
NMVpnEditorPlugin *editor_plugin,
|
||||
NMConnection *connection,
|
||||
gpointer user_data,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
|
||||
{
|
||||
static struct {
|
||||
gpointer factory;
|
||||
void * dl_module;
|
||||
char * module_name;
|
||||
char * factory_name;
|
||||
void *dl_module;
|
||||
char *module_name;
|
||||
char *factory_name;
|
||||
} cached = {0};
|
||||
NMVpnEditor * editor;
|
||||
NMVpnEditor *editor;
|
||||
gs_free char *module_path = NULL;
|
||||
gs_free char *dirname = NULL;
|
||||
Dl_info plugin_info;
|
||||
|
@ -79,7 +79,7 @@ nm_vpn_plugin_utils_load_editor(const char * module_name,
|
|||
NULL);
|
||||
} else {
|
||||
gpointer factory;
|
||||
void * dl_module;
|
||||
void *dl_module;
|
||||
|
||||
dl_module = dlopen(module_path, RTLD_LAZY | RTLD_LOCAL);
|
||||
if (!dl_module) {
|
||||
|
|
|
@ -10,16 +10,16 @@
|
|||
|
||||
typedef NMVpnEditor *(NMVpnPluginUtilsEditorFactory) (gpointer factory,
|
||||
NMVpnEditorPlugin *editor_plugin,
|
||||
NMConnection * connection,
|
||||
NMConnection *connection,
|
||||
gpointer user_data,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
NMVpnEditor *nm_vpn_plugin_utils_load_editor(const char * module_name,
|
||||
const char * factory_name,
|
||||
NMVpnEditor *nm_vpn_plugin_utils_load_editor(const char *module_name,
|
||||
const char *factory_name,
|
||||
NMVpnPluginUtilsEditorFactory editor_factory,
|
||||
NMVpnEditorPlugin * editor_plugin,
|
||||
NMConnection * connection,
|
||||
NMVpnEditorPlugin *editor_plugin,
|
||||
NMConnection *connection,
|
||||
gpointer user_data,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
#endif /* __NM_VPN_PLUGIN_UTILS_H__ */
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
const char *
|
||||
nm_utils_get_shared_wifi_permission(NMConnection *connection)
|
||||
{
|
||||
NMSettingWireless * s_wifi;
|
||||
NMSettingWireless *s_wifi;
|
||||
NMSettingWirelessSecurity *s_wsec;
|
||||
const char * method;
|
||||
const char *method;
|
||||
|
||||
method = nm_utils_get_ip_config_method(connection, AF_INET);
|
||||
if (!nm_streq(method, NM_SETTING_IP4_CONFIG_METHOD_SHARED))
|
||||
|
@ -67,8 +67,8 @@ nm_utils_get_shared_wifi_permission(NMConnection *connection)
|
|||
|
||||
static char *
|
||||
get_new_connection_name(NMConnection *const *existing_connections,
|
||||
const char * preferred,
|
||||
const char * fallback_prefix)
|
||||
const char *preferred,
|
||||
const char *fallback_prefix)
|
||||
{
|
||||
gs_free const char **existing_names = NULL;
|
||||
guint i, existing_len = 0;
|
||||
|
@ -80,7 +80,7 @@ get_new_connection_name(NMConnection *const *existing_connections,
|
|||
existing_names = g_new(const char *, existing_len);
|
||||
for (i = 0; i < existing_len; i++) {
|
||||
NMConnection *candidate;
|
||||
const char * id;
|
||||
const char *id;
|
||||
|
||||
candidate = existing_connections[i];
|
||||
nm_assert(NM_IS_CONNECTION(candidate));
|
||||
|
@ -122,9 +122,9 @@ get_new_connection_name(NMConnection *const *existing_connections,
|
|||
}
|
||||
|
||||
static char *
|
||||
get_new_connection_ifname(NMPlatform * platform,
|
||||
get_new_connection_ifname(NMPlatform *platform,
|
||||
NMConnection *const *existing_connections,
|
||||
const char * prefix)
|
||||
const char *prefix)
|
||||
{
|
||||
guint i, j;
|
||||
|
||||
|
@ -154,8 +154,8 @@ const char *
|
|||
nm_utils_get_ip_config_method(NMConnection *connection, int addr_family)
|
||||
{
|
||||
NMSettingConnection *s_con;
|
||||
NMSettingIPConfig * s_ip;
|
||||
const char * method;
|
||||
NMSettingIPConfig *s_ip;
|
||||
const char *method;
|
||||
|
||||
s_con = nm_connection_get_setting_connection(connection);
|
||||
|
||||
|
@ -185,9 +185,9 @@ nm_utils_get_ip_config_method(NMConnection *connection, int addr_family)
|
|||
gboolean
|
||||
nm_utils_connection_has_default_route(NMConnection *connection,
|
||||
int addr_family,
|
||||
gboolean * out_is_never_default)
|
||||
gboolean *out_is_never_default)
|
||||
{
|
||||
const char * method;
|
||||
const char *method;
|
||||
NMSettingIPConfig *s_ip;
|
||||
gboolean is_never_default = FALSE;
|
||||
gboolean has_default_route = FALSE;
|
||||
|
@ -230,8 +230,8 @@ out:
|
|||
|
||||
void
|
||||
nm_utils_ppp_ip_methods_enabled(NMConnection *connection,
|
||||
gboolean * out_ip4_enabled,
|
||||
gboolean * out_ip6_enabled)
|
||||
gboolean *out_ip4_enabled,
|
||||
gboolean *out_ip6_enabled)
|
||||
{
|
||||
NM_SET_OUT(out_ip4_enabled,
|
||||
nm_streq0(nm_utils_get_ip_config_method(connection, AF_INET),
|
||||
|
@ -244,23 +244,23 @@ nm_utils_ppp_ip_methods_enabled(NMConnection *connection,
|
|||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
_nm_utils_complete_generic_with_params(NMPlatform * platform,
|
||||
NMConnection * connection,
|
||||
const char * ctype,
|
||||
_nm_utils_complete_generic_with_params(NMPlatform *platform,
|
||||
NMConnection *connection,
|
||||
const char *ctype,
|
||||
NMConnection *const *existing_connections,
|
||||
const char * preferred_id,
|
||||
const char * fallback_id_prefix,
|
||||
const char * ifname_prefix,
|
||||
const char * ifname,
|
||||
const char *preferred_id,
|
||||
const char *fallback_id_prefix,
|
||||
const char *ifname_prefix,
|
||||
const char *ifname,
|
||||
...)
|
||||
{
|
||||
NMSettingConnection *s_con;
|
||||
char * id;
|
||||
char * generated_ifname;
|
||||
NMSettingConnection *s_con;
|
||||
char *id;
|
||||
char *generated_ifname;
|
||||
gs_unref_hashtable GHashTable *parameters = NULL;
|
||||
va_list ap;
|
||||
const char * p_val;
|
||||
const char * p_key;
|
||||
const char *p_val;
|
||||
const char *p_key;
|
||||
|
||||
g_assert(fallback_id_prefix);
|
||||
g_return_if_fail(ifname_prefix == NULL || ifname == NULL);
|
||||
|
@ -340,8 +340,8 @@ remove_from_hash(GHashTable *s_hash, GHashTable *p_hash, const char *s_name, con
|
|||
static gboolean
|
||||
check_ip6_method(NMConnection *orig, NMConnection *candidate, GHashTable *settings)
|
||||
{
|
||||
GHashTable * props;
|
||||
const char * orig_ip6_method, *candidate_ip6_method;
|
||||
GHashTable *props;
|
||||
const char *orig_ip6_method, *candidate_ip6_method;
|
||||
NMSettingIPConfig *candidate_ip6;
|
||||
gboolean allow = FALSE;
|
||||
|
||||
|
@ -431,16 +431,16 @@ route_ptr_compare(const void *a, const void *b, gpointer metric)
|
|||
static gboolean
|
||||
check_ip_routes(NMConnection *orig,
|
||||
NMConnection *candidate,
|
||||
GHashTable * settings,
|
||||
GHashTable *settings,
|
||||
gint64 default_metric,
|
||||
gboolean v4)
|
||||
{
|
||||
gs_free NMIPRoute **routes1 = NULL;
|
||||
NMIPRoute ** routes2;
|
||||
NMSettingIPConfig * s_ip1, *s_ip2;
|
||||
NMIPRoute **routes2;
|
||||
NMSettingIPConfig *s_ip1, *s_ip2;
|
||||
gint64 m;
|
||||
const char * s_name;
|
||||
GHashTable * props;
|
||||
const char *s_name;
|
||||
GHashTable *props;
|
||||
guint i, i1, i2, num1, num2;
|
||||
const guint8 PLEN = v4 ? 32 : 128;
|
||||
|
||||
|
@ -509,11 +509,11 @@ check_ip_routes(NMConnection *orig,
|
|||
static gboolean
|
||||
check_ip4_method(NMConnection *orig,
|
||||
NMConnection *candidate,
|
||||
GHashTable * settings,
|
||||
GHashTable *settings,
|
||||
gboolean device_has_carrier)
|
||||
{
|
||||
GHashTable * props;
|
||||
const char * orig_ip4_method, *candidate_ip4_method;
|
||||
GHashTable *props;
|
||||
const char *orig_ip4_method, *candidate_ip4_method;
|
||||
NMSettingIPConfig *candidate_ip4;
|
||||
|
||||
props = check_property_in_hash(settings,
|
||||
|
@ -547,8 +547,8 @@ check_ip4_method(NMConnection *orig,
|
|||
static gboolean
|
||||
check_connection_interface_name(NMConnection *orig, NMConnection *candidate, GHashTable *settings)
|
||||
{
|
||||
GHashTable * props;
|
||||
const char * orig_ifname, *cand_ifname;
|
||||
GHashTable *props;
|
||||
const char *orig_ifname, *cand_ifname;
|
||||
NMSettingConnection *s_con_orig, *s_con_cand;
|
||||
|
||||
props = check_property_in_hash(settings,
|
||||
|
@ -576,8 +576,8 @@ check_connection_interface_name(NMConnection *orig, NMConnection *candidate, GHa
|
|||
static gboolean
|
||||
check_connection_mac_address(NMConnection *orig, NMConnection *candidate, GHashTable *settings)
|
||||
{
|
||||
GHashTable * props;
|
||||
const char * orig_mac = NULL, *cand_mac = NULL;
|
||||
GHashTable *props;
|
||||
const char *orig_mac = NULL, *cand_mac = NULL;
|
||||
NMSettingWired *s_wired_orig, *s_wired_cand;
|
||||
|
||||
props = check_property_in_hash(settings,
|
||||
|
@ -608,10 +608,10 @@ check_connection_mac_address(NMConnection *orig, NMConnection *candidate, GHashT
|
|||
static gboolean
|
||||
check_connection_infiniband_mac_address(NMConnection *orig,
|
||||
NMConnection *candidate,
|
||||
GHashTable * settings)
|
||||
GHashTable *settings)
|
||||
{
|
||||
GHashTable * props;
|
||||
const char * orig_mac = NULL, *cand_mac = NULL;
|
||||
GHashTable *props;
|
||||
const char *orig_mac = NULL, *cand_mac = NULL;
|
||||
NMSettingInfiniband *s_infiniband_orig, *s_infiniband_cand;
|
||||
|
||||
props = check_property_in_hash(settings,
|
||||
|
@ -642,10 +642,10 @@ check_connection_infiniband_mac_address(NMConnection *orig,
|
|||
static gboolean
|
||||
check_connection_cloned_mac_address(NMConnection *orig,
|
||||
NMConnection *candidate,
|
||||
GHashTable * settings)
|
||||
GHashTable *settings)
|
||||
{
|
||||
GHashTable * props;
|
||||
const char * orig_mac = NULL, *cand_mac = NULL;
|
||||
GHashTable *props;
|
||||
const char *orig_mac = NULL, *cand_mac = NULL;
|
||||
NMSettingWired *s_wired_orig, *s_wired_cand;
|
||||
|
||||
props = check_property_in_hash(settings,
|
||||
|
@ -682,7 +682,7 @@ check_connection_cloned_mac_address(NMConnection *orig,
|
|||
static gboolean
|
||||
check_connection_s390_props(NMConnection *orig, NMConnection *candidate, GHashTable *settings)
|
||||
{
|
||||
GHashTable * props1, *props2, *props3;
|
||||
GHashTable *props1, *props2, *props3;
|
||||
NMSettingWired *s_wired_orig, *s_wired_cand;
|
||||
|
||||
props1 = check_property_in_hash(settings,
|
||||
|
@ -704,7 +704,7 @@ check_connection_s390_props(NMConnection *orig, NMConnection *candidate, GHashTa
|
|||
s_wired_cand = nm_connection_get_setting_wired(candidate);
|
||||
if (!s_wired_orig && s_wired_cand) {
|
||||
const char *const *subchans = nm_setting_wired_get_s390_subchannels(s_wired_cand);
|
||||
const char * nettype = nm_setting_wired_get_s390_nettype(s_wired_cand);
|
||||
const char *nettype = nm_setting_wired_get_s390_nettype(s_wired_cand);
|
||||
guint32 num_options = nm_setting_wired_get_num_s390_options(s_wired_cand);
|
||||
|
||||
if ((!subchans || !*subchans) && !nettype && num_options == 0) {
|
||||
|
@ -729,7 +729,7 @@ check_connection_s390_props(NMConnection *orig, NMConnection *candidate, GHashTa
|
|||
static NMConnection *
|
||||
check_possible_match(NMConnection *orig,
|
||||
NMConnection *candidate,
|
||||
GHashTable * settings,
|
||||
GHashTable *settings,
|
||||
gboolean device_has_carrier,
|
||||
gint64 default_v4_metric,
|
||||
gint64 default_v6_metric)
|
||||
|
@ -795,8 +795,8 @@ check_possible_match(NMConnection *orig,
|
|||
* matches well enough.
|
||||
*/
|
||||
NMConnection *
|
||||
nm_utils_match_connection(NMConnection *const * connections,
|
||||
NMConnection * original,
|
||||
nm_utils_match_connection(NMConnection *const *connections,
|
||||
NMConnection *original,
|
||||
gboolean indicated,
|
||||
gboolean device_has_carrier,
|
||||
gint64 default_v4_metric,
|
||||
|
@ -811,7 +811,7 @@ nm_utils_match_connection(NMConnection *const * connections,
|
|||
|
||||
for (; *connections; connections++) {
|
||||
NMConnection *candidate = *connections;
|
||||
GHashTable * diffs = NULL;
|
||||
GHashTable *diffs = NULL;
|
||||
|
||||
nm_assert(NM_IS_CONNECTION(candidate));
|
||||
|
||||
|
@ -851,7 +851,7 @@ nm_utils_match_connection(NMConnection *const * connections,
|
|||
}
|
||||
|
||||
if (!best_match && nm_logging_enabled(LOGL_DEBUG, LOGD_CORE)) {
|
||||
GString * diff_string;
|
||||
GString *diff_string;
|
||||
GHashTableIter s_iter, p_iter;
|
||||
gpointer setting_name, setting;
|
||||
gpointer property_name, value;
|
||||
|
@ -894,9 +894,9 @@ nm_utils_match_connection(NMConnection *const * connections,
|
|||
|
||||
int
|
||||
nm_match_spec_device_by_pllink(const NMPlatformLink *pllink,
|
||||
const char * match_device_type,
|
||||
const char * match_dhcp_plugin,
|
||||
const GSList * specs,
|
||||
const char *match_device_type,
|
||||
const char *match_dhcp_plugin,
|
||||
const GSList *specs,
|
||||
int no_match_value)
|
||||
{
|
||||
NMMatchSpecMatchType m;
|
||||
|
@ -987,7 +987,7 @@ nm_ip_routing_rule_to_platform(const NMIPRoutingRule *rule, NMPlatformRoutingRul
|
|||
struct _NMShutdownWaitObjHandle {
|
||||
CList lst;
|
||||
gpointer watched_obj;
|
||||
char * msg_reason;
|
||||
char *msg_reason;
|
||||
bool free_msg_reason : 1;
|
||||
bool is_cancellable : 1;
|
||||
};
|
||||
|
@ -1060,7 +1060,7 @@ _shutdown_waitobj_cb(gpointer user_data, GObject *where_the_object_was)
|
|||
NMShutdownWaitObjHandle *
|
||||
nm_shutdown_wait_obj_register_full(gpointer watched_obj,
|
||||
NMShutdownWaitType wait_type,
|
||||
char * msg_reason,
|
||||
char *msg_reason,
|
||||
gboolean free_msg_reason)
|
||||
{
|
||||
NMShutdownWaitObjHandle *handle;
|
||||
|
@ -1180,8 +1180,8 @@ nm_utils_qdiscs_from_tc_setting(NMPlatform *platform, NMSettingTCConfig *s_tc, i
|
|||
qdiscs = g_ptr_array_new_full(nqdiscs, (GDestroyNotify) nmp_object_unref);
|
||||
|
||||
for (i = 0; i < nqdiscs; i++) {
|
||||
NMTCQdisc * s_qdisc = nm_setting_tc_config_get_qdisc(s_tc, i);
|
||||
NMPObject * q = nmp_object_new(NMP_OBJECT_TYPE_QDISC, NULL);
|
||||
NMTCQdisc *s_qdisc = nm_setting_tc_config_get_qdisc(s_tc, i);
|
||||
NMPObject *q = nmp_object_new(NMP_OBJECT_TYPE_QDISC, NULL);
|
||||
NMPlatformQdisc *qdisc = NMP_OBJECT_CAST_QDISC(q);
|
||||
|
||||
qdisc->ifindex = ip_ifindex;
|
||||
|
@ -1254,9 +1254,9 @@ nm_utils_tfilters_from_tc_setting(NMPlatform *platform, NMSettingTCConfig *s_tc,
|
|||
tfilters = g_ptr_array_new_full(ntfilters, (GDestroyNotify) nmp_object_unref);
|
||||
|
||||
for (i = 0; i < ntfilters; i++) {
|
||||
NMTCTfilter * s_tfilter = nm_setting_tc_config_get_tfilter(s_tc, i);
|
||||
NMTCAction * action;
|
||||
NMPObject * t = nmp_object_new(NMP_OBJECT_TYPE_TFILTER, NULL);
|
||||
NMTCTfilter *s_tfilter = nm_setting_tc_config_get_tfilter(s_tc, i);
|
||||
NMTCAction *action;
|
||||
NMPObject *t = nmp_object_new(NMP_OBJECT_TYPE_TFILTER, NULL);
|
||||
NMPlatformTfilter *tfilter = NMP_OBJECT_CAST_TFILTER(t);
|
||||
|
||||
tfilter->ifindex = ip_ifindex;
|
||||
|
@ -1312,11 +1312,11 @@ nm_utils_tfilters_from_tc_setting(NMPlatform *platform, NMSettingTCConfig *s_tc,
|
|||
|
||||
void
|
||||
nm_utils_ip_route_attribute_to_platform(int addr_family,
|
||||
NMIPRoute * s_route,
|
||||
NMIPRoute *s_route,
|
||||
NMPlatformIPRoute *r,
|
||||
gint64 route_table)
|
||||
{
|
||||
GVariant * variant;
|
||||
GVariant *variant;
|
||||
guint32 table;
|
||||
NMIPAddr addr;
|
||||
NMPlatformIP4Route *r4 = (NMPlatformIP4Route *) r;
|
||||
|
@ -1422,9 +1422,9 @@ nm_utils_ip_route_attribute_to_platform(int addr_family,
|
|||
void
|
||||
nm_utils_ip_addresses_to_dbus(int addr_family,
|
||||
const NMDedupMultiHeadEntry *head_entry,
|
||||
const NMPObject * best_default_route,
|
||||
GVariant ** out_address_data,
|
||||
GVariant ** out_addresses)
|
||||
const NMPObject *best_default_route,
|
||||
GVariant **out_address_data,
|
||||
GVariant **out_addresses)
|
||||
{
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
GVariantBuilder builder_data;
|
||||
|
@ -1536,8 +1536,8 @@ out:
|
|||
void
|
||||
nm_utils_ip_routes_to_dbus(int addr_family,
|
||||
const NMDedupMultiHeadEntry *head_entry,
|
||||
GVariant ** out_route_data,
|
||||
GVariant ** out_routes)
|
||||
GVariant **out_route_data,
|
||||
GVariant **out_routes)
|
||||
{
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
NMDedupMultiIter iter;
|
||||
|
@ -1659,14 +1659,14 @@ nm_utils_platform_capture_ip_setting(NMPlatform *platform,
|
|||
int ifindex,
|
||||
gboolean maybe_ipv6_disabled)
|
||||
{
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
gs_unref_object NMSettingIPConfig *s_ip = NULL;
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
gs_unref_object NMSettingIPConfig *s_ip = NULL;
|
||||
NMPLookup lookup;
|
||||
NMDedupMultiIter iter;
|
||||
const NMPObject * obj;
|
||||
const char * method = NULL;
|
||||
const NMPObject *obj;
|
||||
const char *method = NULL;
|
||||
char sbuf[NM_UTILS_INET_ADDRSTRLEN];
|
||||
const NMPlatformIPXRoute * best_default_route = NULL;
|
||||
const NMPlatformIPXRoute *best_default_route = NULL;
|
||||
|
||||
s_ip =
|
||||
NM_SETTING_IP_CONFIG(IS_IPv4 ? nm_setting_ip4_config_new() : nm_setting_ip6_config_new());
|
||||
|
@ -1682,8 +1682,8 @@ nm_utils_platform_capture_ip_setting(NMPlatform *platform,
|
|||
|
||||
nmp_lookup_init_object(&lookup, NMP_OBJECT_TYPE_IP_ADDRESS(IS_IPv4), ifindex);
|
||||
nm_platform_iter_obj_for_each (&iter, platform, &lookup, &obj) {
|
||||
const NMPlatformIPXAddress *address = NMP_OBJECT_CAST_IPX_ADDRESS(obj);
|
||||
nm_auto_unref_ip_address NMIPAddress *s_addr = NULL;
|
||||
const NMPlatformIPXAddress *address = NMP_OBJECT_CAST_IPX_ADDRESS(obj);
|
||||
nm_auto_unref_ip_address NMIPAddress *s_addr = NULL;
|
||||
|
||||
if (!IS_IPv4) {
|
||||
/* Ignore link-local address. */
|
||||
|
@ -1736,7 +1736,7 @@ nm_utils_platform_capture_ip_setting(NMPlatform *platform,
|
|||
|
||||
nmp_lookup_init_object(&lookup, NMP_OBJECT_TYPE_IP_ROUTE(IS_IPv4), ifindex);
|
||||
nm_platform_iter_obj_for_each (&iter, platform, &lookup, &obj) {
|
||||
const NMPlatformIPXRoute *route = NMP_OBJECT_CAST_IPX_ROUTE(obj);
|
||||
const NMPlatformIPXRoute *route = NMP_OBJECT_CAST_IPX_ROUTE(obj);
|
||||
nm_auto_unref_ip_route NMIPRoute *s_route = NULL;
|
||||
|
||||
if (!IS_IPv4) {
|
||||
|
|
|
@ -20,17 +20,17 @@ const char *nm_utils_get_ip_config_method(NMConnection *connection, int addr_fam
|
|||
const char *nm_utils_get_shared_wifi_permission(NMConnection *connection);
|
||||
|
||||
void nm_utils_ppp_ip_methods_enabled(NMConnection *connection,
|
||||
gboolean * out_ip4_enabled,
|
||||
gboolean * out_ip6_enabled);
|
||||
gboolean *out_ip4_enabled,
|
||||
gboolean *out_ip6_enabled);
|
||||
|
||||
void _nm_utils_complete_generic_with_params(NMPlatform * platform,
|
||||
NMConnection * connection,
|
||||
const char * ctype,
|
||||
void _nm_utils_complete_generic_with_params(NMPlatform *platform,
|
||||
NMConnection *connection,
|
||||
const char *ctype,
|
||||
NMConnection *const *existing_connections,
|
||||
const char * preferred_id,
|
||||
const char * fallback_id_prefix,
|
||||
const char * ifname_prefix,
|
||||
const char * ifname,
|
||||
const char *preferred_id,
|
||||
const char *fallback_id_prefix,
|
||||
const char *ifname_prefix,
|
||||
const char *ifname,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
#define nm_utils_complete_generic_with_params(platform, \
|
||||
|
@ -54,14 +54,14 @@ void _nm_utils_complete_generic_with_params(NMPlatform * platform,
|
|||
NULL)
|
||||
|
||||
static inline void
|
||||
nm_utils_complete_generic(NMPlatform * platform,
|
||||
NMConnection * connection,
|
||||
const char * ctype,
|
||||
nm_utils_complete_generic(NMPlatform *platform,
|
||||
NMConnection *connection,
|
||||
const char *ctype,
|
||||
NMConnection *const *existing_connections,
|
||||
const char * preferred_id,
|
||||
const char * fallback_id_prefix,
|
||||
const char * ifname_prefix,
|
||||
const char * ifname,
|
||||
const char *preferred_id,
|
||||
const char *fallback_id_prefix,
|
||||
const char *ifname_prefix,
|
||||
const char *ifname,
|
||||
gboolean default_enable_ipv6)
|
||||
{
|
||||
nm_utils_complete_generic_with_params(platform,
|
||||
|
@ -80,8 +80,8 @@ nm_utils_complete_generic(NMPlatform * platform,
|
|||
|
||||
typedef gboolean(NMUtilsMatchFilterFunc)(NMConnection *connection, gpointer user_data);
|
||||
|
||||
NMConnection *nm_utils_match_connection(NMConnection *const * connections,
|
||||
NMConnection * original,
|
||||
NMConnection *nm_utils_match_connection(NMConnection *const *connections,
|
||||
NMConnection *original,
|
||||
gboolean indicated,
|
||||
gboolean device_has_carrier,
|
||||
gint64 default_v4_metric,
|
||||
|
@ -90,9 +90,9 @@ NMConnection *nm_utils_match_connection(NMConnection *const * connections,
|
|||
gpointer match_filter_data);
|
||||
|
||||
int nm_match_spec_device_by_pllink(const NMPlatformLink *pllink,
|
||||
const char * match_device_type,
|
||||
const char * match_dhcp_plugin,
|
||||
const GSList * specs,
|
||||
const char *match_device_type,
|
||||
const char *match_dhcp_plugin,
|
||||
const GSList *specs,
|
||||
int no_match_value);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -140,12 +140,12 @@ typedef struct _NMShutdownWaitObjHandle NMShutdownWaitObjHandle;
|
|||
|
||||
NMShutdownWaitObjHandle *nm_shutdown_wait_obj_register_full(gpointer watched_obj,
|
||||
NMShutdownWaitType wait_type,
|
||||
char * msg_reason,
|
||||
char *msg_reason,
|
||||
gboolean free_msg_reason);
|
||||
|
||||
static inline NMShutdownWaitObjHandle *
|
||||
nm_shutdown_wait_obj_register_object_full(gpointer watched_obj,
|
||||
char * msg_reason,
|
||||
char *msg_reason,
|
||||
gboolean free_msg_reason)
|
||||
{
|
||||
return nm_shutdown_wait_obj_register_full(watched_obj,
|
||||
|
@ -171,7 +171,7 @@ nm_shutdown_wait_obj_register_handle_full(char *msg_reason, gboolean free_msg_re
|
|||
|
||||
static inline NMShutdownWaitObjHandle *
|
||||
nm_shutdown_wait_obj_register_cancellable_full(GCancellable *watched_obj,
|
||||
char * msg_reason,
|
||||
char *msg_reason,
|
||||
gboolean free_msg_reason)
|
||||
{
|
||||
return nm_shutdown_wait_obj_register_full(watched_obj,
|
||||
|
@ -197,20 +197,20 @@ GPtrArray *
|
|||
nm_utils_tfilters_from_tc_setting(NMPlatform *platform, NMSettingTCConfig *s_tc, int ip_ifindex);
|
||||
|
||||
void nm_utils_ip_route_attribute_to_platform(int addr_family,
|
||||
NMIPRoute * s_route,
|
||||
NMIPRoute *s_route,
|
||||
NMPlatformIPRoute *r,
|
||||
gint64 route_table);
|
||||
|
||||
void nm_utils_ip_addresses_to_dbus(int addr_family,
|
||||
const NMDedupMultiHeadEntry *head_entry,
|
||||
const NMPObject * best_default_route,
|
||||
GVariant ** out_address_data,
|
||||
GVariant ** out_addresses);
|
||||
const NMPObject *best_default_route,
|
||||
GVariant **out_address_data,
|
||||
GVariant **out_addresses);
|
||||
|
||||
void nm_utils_ip_routes_to_dbus(int addr_family,
|
||||
const NMDedupMultiHeadEntry *head_entry,
|
||||
GVariant ** out_route_data,
|
||||
GVariant ** out_routes);
|
||||
GVariant **out_route_data,
|
||||
GVariant **out_routes);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
typedef struct {
|
||||
NMUdevClient *udev_client;
|
||||
GSList * devices;
|
||||
GSList *devices;
|
||||
} NMAtmManagerPrivate;
|
||||
|
||||
typedef struct {
|
||||
|
@ -51,7 +51,7 @@ NM_DEVICE_FACTORY_DECLARE_TYPES(
|
|||
NM_DEVICE_FACTORY_DECLARE_SETTING_TYPES(NM_SETTING_ADSL_SETTING_NAME));
|
||||
|
||||
G_MODULE_EXPORT NMDeviceFactory *
|
||||
nm_device_factory_create(GError **error)
|
||||
nm_device_factory_create(GError **error)
|
||||
{
|
||||
return g_object_new(NM_TYPE_ATM_MANAGER, NULL);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ static gboolean
|
|||
dev_get_attrs(struct udev_device *udev_device, const char **out_path, char **out_driver)
|
||||
{
|
||||
struct udev_device *parent = NULL;
|
||||
const char * driver, *path;
|
||||
const char *driver, *path;
|
||||
|
||||
g_return_val_if_fail(udev_device != NULL, FALSE);
|
||||
g_return_val_if_fail(out_path != NULL, FALSE);
|
||||
|
@ -91,7 +91,7 @@ dev_get_attrs(struct udev_device *udev_device, const char **out_path, char **out
|
|||
static void
|
||||
device_destroyed(gpointer user_data, GObject *dead)
|
||||
{
|
||||
NMAtmManager * self = NM_ATM_MANAGER(user_data);
|
||||
NMAtmManager *self = NM_ATM_MANAGER(user_data);
|
||||
NMAtmManagerPrivate *priv = NM_ATM_MANAGER_GET_PRIVATE(self);
|
||||
|
||||
priv->devices = g_slist_remove(priv->devices, dead);
|
||||
|
@ -101,11 +101,11 @@ static void
|
|||
adsl_add(NMAtmManager *self, struct udev_device *udev_device)
|
||||
{
|
||||
NMAtmManagerPrivate *priv = NM_ATM_MANAGER_GET_PRIVATE(self);
|
||||
const char * ifname, *sysfs_path = NULL;
|
||||
char * driver = NULL;
|
||||
gs_free char * atm_index_path = NULL;
|
||||
const char *ifname, *sysfs_path = NULL;
|
||||
char *driver = NULL;
|
||||
gs_free char *atm_index_path = NULL;
|
||||
int atm_index;
|
||||
NMDevice * device;
|
||||
NMDevice *device;
|
||||
|
||||
g_return_if_fail(udev_device != NULL);
|
||||
|
||||
|
@ -153,8 +153,8 @@ static void
|
|||
adsl_remove(NMAtmManager *self, struct udev_device *udev_device)
|
||||
{
|
||||
NMAtmManagerPrivate *priv = NM_ATM_MANAGER_GET_PRIVATE(self);
|
||||
const char * iface = udev_device_get_sysname(udev_device);
|
||||
GSList * iter;
|
||||
const char *iface = udev_device_get_sysname(udev_device);
|
||||
GSList *iter;
|
||||
|
||||
nm_log_dbg(LOGD_PLATFORM, "(%s): removing ATM device", iface);
|
||||
|
||||
|
@ -177,9 +177,9 @@ adsl_remove(NMAtmManager *self, struct udev_device *udev_device)
|
|||
static void
|
||||
start(NMDeviceFactory *factory)
|
||||
{
|
||||
NMAtmManager * self = NM_ATM_MANAGER(factory);
|
||||
NMAtmManagerPrivate * priv = NM_ATM_MANAGER_GET_PRIVATE(self);
|
||||
struct udev_enumerate * enumerate;
|
||||
NMAtmManager *self = NM_ATM_MANAGER(factory);
|
||||
NMAtmManagerPrivate *priv = NM_ATM_MANAGER_GET_PRIVATE(self);
|
||||
struct udev_enumerate *enumerate;
|
||||
struct udev_list_entry *devices;
|
||||
|
||||
enumerate = nm_udev_client_enumerate_new(priv->udev_client);
|
||||
|
@ -203,10 +203,10 @@ static void
|
|||
handle_uevent(NMUdevClient *client, struct udev_device *device, gpointer user_data)
|
||||
{
|
||||
NMAtmManager *self = NM_ATM_MANAGER(user_data);
|
||||
const char * subsys;
|
||||
const char * ifindex;
|
||||
const char *subsys;
|
||||
const char *ifindex;
|
||||
guint64 seqnum;
|
||||
const char * action;
|
||||
const char *action;
|
||||
|
||||
action = udev_device_get_action(device);
|
||||
|
||||
|
@ -245,9 +245,9 @@ nm_atm_manager_init(NMAtmManager *self)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMAtmManager * self = NM_ATM_MANAGER(object);
|
||||
NMAtmManager *self = NM_ATM_MANAGER(object);
|
||||
NMAtmManagerPrivate *priv = NM_ATM_MANAGER_GET_PRIVATE(self);
|
||||
GSList * iter;
|
||||
GSList *iter;
|
||||
|
||||
for (iter = priv->devices; iter; iter = iter->next)
|
||||
g_object_weak_unref(G_OBJECT(iter->data), device_destroyed, self);
|
||||
|
@ -261,7 +261,7 @@ dispose(GObject *object)
|
|||
static void
|
||||
nm_atm_manager_class_init(NMAtmManagerClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDeviceFactoryClass *factory_class = NM_DEVICE_FACTORY_CLASS(klass);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef struct {
|
|||
/* RFC 2684 bridging (PPPoE over ATM) */
|
||||
int brfd;
|
||||
int nas_ifindex;
|
||||
char * nas_ifname;
|
||||
char *nas_ifname;
|
||||
GSource *nas_update_source;
|
||||
guint nas_update_count;
|
||||
} NMDeviceAdslPrivate;
|
||||
|
@ -70,7 +70,7 @@ static gboolean
|
|||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMSettingAdsl *s_adsl;
|
||||
const char * protocol;
|
||||
const char *protocol;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_adsl_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -91,11 +91,11 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingAdsl *s_adsl;
|
||||
|
||||
|
@ -124,12 +124,12 @@ complete_connection(NMDevice * device,
|
|||
static gboolean
|
||||
br2684_assign_vcc(NMDeviceAdsl *self, NMSettingAdsl *s_adsl)
|
||||
{
|
||||
NMDeviceAdslPrivate * priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
struct sockaddr_atmpvc addr;
|
||||
struct atm_backend_br2684 be;
|
||||
struct atm_qos qos;
|
||||
int errsv, err, bufsize = 8192;
|
||||
const char * encapsulation;
|
||||
const char *encapsulation;
|
||||
gboolean is_llc;
|
||||
|
||||
g_return_val_if_fail(priv->brfd == -1, FALSE);
|
||||
|
@ -214,18 +214,18 @@ error:
|
|||
}
|
||||
|
||||
static void
|
||||
link_changed_cb(NMPlatform * platform,
|
||||
link_changed_cb(NMPlatform *platform,
|
||||
int obj_type_i,
|
||||
int ifindex,
|
||||
NMPlatformLink *info,
|
||||
int change_type_i,
|
||||
NMDeviceAdsl * self)
|
||||
NMDeviceAdsl *self)
|
||||
{
|
||||
const NMPlatformSignalChangeType change_type = change_type_i;
|
||||
|
||||
if (change_type == NM_PLATFORM_SIGNAL_REMOVED) {
|
||||
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
|
||||
/* This only gets called for PPPoE connections and "nas" interfaces */
|
||||
|
||||
|
@ -243,8 +243,8 @@ static gboolean
|
|||
pppoe_vcc_config(NMDeviceAdsl *self)
|
||||
{
|
||||
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMSettingAdsl * s_adsl;
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMSettingAdsl *s_adsl;
|
||||
|
||||
s_adsl = nm_device_get_applied_setting(device, NM_TYPE_SETTING_ADSL);
|
||||
|
||||
|
@ -271,9 +271,9 @@ pppoe_vcc_config(NMDeviceAdsl *self)
|
|||
static gboolean
|
||||
nas_update_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceAdsl * self = NM_DEVICE_ADSL(user_data);
|
||||
NMDeviceAdsl *self = NM_DEVICE_ADSL(user_data);
|
||||
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
|
||||
nm_assert(priv->nas_ifname);
|
||||
|
||||
|
@ -316,7 +316,7 @@ nas_update_timeout_cb(gpointer user_data)
|
|||
static gboolean
|
||||
br2684_create_iface(NMDeviceAdsl *self)
|
||||
{
|
||||
NMDeviceAdslPrivate * priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
struct atm_newif_br2684 ni;
|
||||
nm_auto_close int fd = -1;
|
||||
int err;
|
||||
|
@ -377,7 +377,7 @@ _ppp_mgr_cleanup(NMDeviceAdsl *self)
|
|||
static void
|
||||
_ppp_mgr_stage3_maybe_ready(NMDeviceAdsl *self)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
int IS_IPv4;
|
||||
|
||||
|
@ -398,7 +398,7 @@ static void
|
|||
_ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data, gpointer user_data)
|
||||
{
|
||||
NMDeviceAdsl *self = NM_DEVICE_ADSL(user_data);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState device_state;
|
||||
|
||||
if (callback_data->callback_type != NM_PPP_MGR_CALLBACK_TYPE_STATE_CHANGED)
|
||||
|
@ -414,8 +414,8 @@ _ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data,
|
|||
|
||||
if (device_state < NM_DEVICE_STATE_IP_CONFIG) {
|
||||
if (callback_data->data.state >= NM_PPP_MGR_STATE_HAVE_IFINDEX) {
|
||||
gs_free char *old_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char *old_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
if (!nm_device_take_over_link(device, callback_data->data.ifindex, &old_name, &error)) {
|
||||
_LOGW(LOGD_DEVICE | LOGD_PPP,
|
||||
|
@ -445,15 +445,15 @@ _ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data,
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceAdsl * self = NM_DEVICE_ADSL(device);
|
||||
NMDeviceAdsl *self = NM_DEVICE_ADSL(device);
|
||||
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
|
||||
if (!priv->ppp_mgr) {
|
||||
gs_free_error GError *error = NULL;
|
||||
NMSettingAdsl * s_adsl;
|
||||
const char * protocol;
|
||||
NMActRequest * req;
|
||||
const char * ppp_iface;
|
||||
NMSettingAdsl *s_adsl;
|
||||
const char *protocol;
|
||||
NMActRequest *req;
|
||||
const char *ppp_iface;
|
||||
|
||||
req = nm_device_get_act_request(device);
|
||||
g_return_val_if_fail(req, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
@ -520,7 +520,7 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
static void
|
||||
act_stage3_ip_config(NMDevice *device, int addr_family)
|
||||
{
|
||||
NMDeviceAdsl * self = NM_DEVICE_ADSL(device);
|
||||
NMDeviceAdsl *self = NM_DEVICE_ADSL(device);
|
||||
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
NMPppMgrState ppp_state;
|
||||
|
||||
|
@ -577,7 +577,7 @@ carrier_update_cb(gpointer user_data)
|
|||
{
|
||||
NMDeviceAdsl *self = NM_DEVICE_ADSL(user_data);
|
||||
int carrier;
|
||||
char * path;
|
||||
char *path;
|
||||
|
||||
path = g_strdup_printf("/sys/class/atm/%s/carrier",
|
||||
NM_ASSERT_VALID_PATH_COMPONENT(nm_device_get_iface(NM_DEVICE(self))));
|
||||
|
@ -632,7 +632,7 @@ nm_device_adsl_init(NMDeviceAdsl *self)
|
|||
static void
|
||||
constructed(GObject *object)
|
||||
{
|
||||
NMDeviceAdsl * self = NM_DEVICE_ADSL(object);
|
||||
NMDeviceAdsl *self = NM_DEVICE_ADSL(object);
|
||||
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE(self);
|
||||
|
||||
G_OBJECT_CLASS(nm_device_adsl_parent_class)->constructed(object);
|
||||
|
@ -686,9 +686,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_adsl = {
|
|||
static void
|
||||
nm_device_adsl_class_init(NMDeviceAdslClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->constructed = constructed;
|
||||
object_class->dispose = dispose;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#define _NM_BT_CAPABILITY_SUPPORTED (NM_BT_CAPABILITY_NAP | _NM_BT_CAPABILITY_SUPPORTED_DUN)
|
||||
|
||||
typedef struct {
|
||||
const char * bdaddr;
|
||||
const char *bdaddr;
|
||||
CList lst_head;
|
||||
NMBluetoothCapabilities bt_type : 8;
|
||||
char bdaddr_data[];
|
||||
|
@ -46,24 +46,24 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
NMSettingsConnection *sett_conn;
|
||||
ConnDataHead * cdata_hd;
|
||||
ConnDataHead *cdata_hd;
|
||||
CList lst;
|
||||
} ConnDataElem;
|
||||
|
||||
typedef struct {
|
||||
GCancellable * ext_cancellable;
|
||||
GCancellable * int_cancellable;
|
||||
GCancellable *ext_cancellable;
|
||||
GCancellable *int_cancellable;
|
||||
NMBtVTableRegisterCallback callback;
|
||||
gpointer callback_user_data;
|
||||
gulong ext_cancelled_id;
|
||||
} NetworkServerRegisterReqData;
|
||||
|
||||
typedef struct {
|
||||
GCancellable * ext_cancellable;
|
||||
GCancellable * int_cancellable;
|
||||
GCancellable *ext_cancellable;
|
||||
GCancellable *int_cancellable;
|
||||
NMBluezManagerConnectCb callback;
|
||||
gpointer callback_user_data;
|
||||
char * device_name;
|
||||
char *device_name;
|
||||
gulong ext_cancelled_id;
|
||||
guint timeout_id;
|
||||
guint timeout_wait_connect_id;
|
||||
|
@ -97,16 +97,16 @@ typedef struct {
|
|||
|
||||
struct {
|
||||
CList lst;
|
||||
char * adapter_address;
|
||||
NMDevice * device_br;
|
||||
char *adapter_address;
|
||||
NMDevice *device_br;
|
||||
NetworkServerRegisterReqData *r_req_data;
|
||||
} x_network_server;
|
||||
|
||||
struct {
|
||||
NMSettingsConnection *panu_connection;
|
||||
NMDeviceBt * device_bt;
|
||||
NMDeviceBt *device_bt;
|
||||
DeviceConnectReqData *c_req_data;
|
||||
NMBluez5DunContext * connect_dun_context;
|
||||
NMBluez5DunContext *connect_dun_context;
|
||||
gulong device_bt_signal_id;
|
||||
} x_device;
|
||||
|
||||
|
@ -142,7 +142,7 @@ typedef struct {
|
|||
} BzDBusObj;
|
||||
|
||||
typedef struct {
|
||||
NMManager * manager;
|
||||
NMManager *manager;
|
||||
NMSettings *settings;
|
||||
|
||||
GDBusConnection *dbus_connection;
|
||||
|
@ -194,7 +194,7 @@ NM_DEVICE_FACTORY_DECLARE_TYPES(NM_DEVICE_FACTORY_DECLARE_LINK_TYPES(
|
|||
NM_LINK_TYPE_BNEP) NM_DEVICE_FACTORY_DECLARE_SETTING_TYPES(NM_SETTING_BLUETOOTH_SETTING_NAME))
|
||||
|
||||
G_MODULE_EXPORT NMDeviceFactory *
|
||||
nm_device_factory_create(GError **error)
|
||||
nm_device_factory_create(GError **error)
|
||||
{
|
||||
return g_object_new(NM_TYPE_BLUEZ_MANAGER, NULL);
|
||||
}
|
||||
|
@ -214,8 +214,8 @@ convert_uuids_to_capabilities(const char *const *strv)
|
|||
if (strv) {
|
||||
for (; strv[0]; strv++) {
|
||||
gs_free char *s_part1 = NULL;
|
||||
const char * str = strv[0];
|
||||
const char * s;
|
||||
const char *str = strv[0];
|
||||
const char *s;
|
||||
|
||||
s = strchr(str, '-');
|
||||
if (!s)
|
||||
|
@ -245,8 +245,8 @@ static void _connect_disconnect(NMBluezManager *self, BzDBusObj *bzobj, cons
|
|||
static gboolean _bzobjs_network_server_is_usable(const BzDBusObj *bzobj, gboolean require_powered);
|
||||
static gboolean _bzobjs_is_dead(const BzDBusObj *bzobj);
|
||||
static gboolean _bzobjs_device_is_usable(const BzDBusObj *bzobj,
|
||||
BzDBusObj ** out_adapter_bzobj,
|
||||
gboolean * out_create_panu_connection);
|
||||
BzDBusObj **out_adapter_bzobj,
|
||||
gboolean *out_create_panu_connection);
|
||||
static gboolean _bzobjs_adapter_is_usable_for_device(const BzDBusObj *bzobj);
|
||||
static ConnDataHead *
|
||||
_conn_track_find_head(NMBluezManager *self, NMBluetoothCapabilities bt_type, const char *bdaddr);
|
||||
|
@ -293,9 +293,9 @@ _network_server_register_req_data_complete(NetworkServerRegisterReqData *r_req_d
|
|||
|
||||
static void
|
||||
_device_connect_req_data_complete(DeviceConnectReqData *c_req_data,
|
||||
NMBluezManager * self,
|
||||
const char * device_name,
|
||||
GError * error)
|
||||
NMBluezManager *self,
|
||||
const char *device_name,
|
||||
GError *error)
|
||||
{
|
||||
nm_assert((!!device_name) != (!!error));
|
||||
|
||||
|
@ -371,7 +371,7 @@ _bz_dbus_obj_free(BzDBusObj *bzobj)
|
|||
static const char *
|
||||
_bzobj_to_string(const BzDBusObj *bzobj, char *buf, gsize len)
|
||||
{
|
||||
char * buf0 = buf;
|
||||
char *buf0 = buf;
|
||||
const char *prefix = "";
|
||||
gboolean device_is_usable;
|
||||
gboolean create_panu_connection = FALSE;
|
||||
|
@ -591,7 +591,7 @@ static BzDBusObj *
|
|||
_bzobjs_add(NMBluezManager *self, const char *object_path)
|
||||
{
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
BzDBusObj * bzobj;
|
||||
BzDBusObj *bzobj;
|
||||
|
||||
bzobj = _bz_dbus_obj_new(self, object_path);
|
||||
if (!g_hash_table_add(priv->bzobjs, bzobj))
|
||||
|
@ -642,14 +642,14 @@ _bzobjs_adapter_is_usable_for_device(const BzDBusObj *bzobj)
|
|||
|
||||
static gboolean
|
||||
_bzobjs_device_is_usable(const BzDBusObj *bzobj,
|
||||
BzDBusObj ** out_adapter_bzobj,
|
||||
gboolean * out_create_panu_connection)
|
||||
BzDBusObj **out_adapter_bzobj,
|
||||
gboolean *out_create_panu_connection)
|
||||
{
|
||||
NMBluezManager * self;
|
||||
NMBluezManager *self;
|
||||
NMBluezManagerPrivate *priv;
|
||||
gboolean usable_dun = FALSE;
|
||||
gboolean usable_nap = FALSE;
|
||||
BzDBusObj * bzobj_adapter;
|
||||
BzDBusObj *bzobj_adapter;
|
||||
gboolean create_panu_connection = FALSE;
|
||||
|
||||
if (!bzobj->d_has_device_iface
|
||||
|
@ -805,14 +805,14 @@ _conn_track_find_elem(NMBluezManager *self, NMSettingsConnection *sett_conn)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
_conn_track_is_relevant_connection(NMConnection * connection,
|
||||
_conn_track_is_relevant_connection(NMConnection *connection,
|
||||
NMBluetoothCapabilities *out_bt_type,
|
||||
const char ** out_bdaddr)
|
||||
const char **out_bdaddr)
|
||||
{
|
||||
NMSettingBluetooth * s_bt;
|
||||
NMSettingBluetooth *s_bt;
|
||||
NMBluetoothCapabilities bt_type;
|
||||
const char * bdaddr;
|
||||
const char * b_type;
|
||||
const char *bdaddr;
|
||||
const char *b_type;
|
||||
|
||||
s_bt = nm_connection_get_setting_bluetooth(connection);
|
||||
if (!s_bt)
|
||||
|
@ -840,9 +840,9 @@ _conn_track_is_relevant_connection(NMConnection * connection,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
_conn_track_is_relevant_sett_conn(NMSettingsConnection * sett_conn,
|
||||
_conn_track_is_relevant_sett_conn(NMSettingsConnection *sett_conn,
|
||||
NMBluetoothCapabilities *out_bt_type,
|
||||
const char ** out_bdaddr)
|
||||
const char **out_bdaddr)
|
||||
{
|
||||
NMConnection *connection;
|
||||
|
||||
|
@ -854,25 +854,25 @@ _conn_track_is_relevant_sett_conn(NMSettingsConnection * sett_conn,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
_conn_track_is_relevant_for_sett_conn(NMSettingsConnection * sett_conn,
|
||||
_conn_track_is_relevant_for_sett_conn(NMSettingsConnection *sett_conn,
|
||||
NMBluetoothCapabilities bt_type,
|
||||
const char * bdaddr)
|
||||
const char *bdaddr)
|
||||
{
|
||||
NMBluetoothCapabilities x_bt_type;
|
||||
const char * x_bdaddr;
|
||||
const char *x_bdaddr;
|
||||
|
||||
return bdaddr && _conn_track_is_relevant_sett_conn(sett_conn, &x_bt_type, &x_bdaddr)
|
||||
&& x_bt_type == bt_type && nm_streq(x_bdaddr, bdaddr);
|
||||
}
|
||||
|
||||
static void
|
||||
_conn_track_schedule_notify(NMBluezManager * self,
|
||||
_conn_track_schedule_notify(NMBluezManager *self,
|
||||
NMBluetoothCapabilities bt_type,
|
||||
const char * bdaddr)
|
||||
const char *bdaddr)
|
||||
{
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
GHashTableIter iter;
|
||||
BzDBusObj * bzobj;
|
||||
BzDBusObj *bzobj;
|
||||
|
||||
g_hash_table_iter_init(&iter, priv->bzobjs);
|
||||
while (g_hash_table_iter_next(&iter, (gpointer *) &bzobj, NULL)) {
|
||||
|
@ -885,19 +885,19 @@ _conn_track_schedule_notify(NMBluezManager * self,
|
|||
}
|
||||
|
||||
static void
|
||||
_conn_track_update(NMBluezManager * self,
|
||||
_conn_track_update(NMBluezManager *self,
|
||||
NMSettingsConnection *sett_conn,
|
||||
gboolean track,
|
||||
gboolean * out_changed,
|
||||
gboolean * out_changed_usable,
|
||||
ConnDataElem ** out_conn_data_elem)
|
||||
gboolean *out_changed,
|
||||
gboolean *out_changed_usable,
|
||||
ConnDataElem **out_conn_data_elem)
|
||||
{
|
||||
NMBluezManagerPrivate * priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
ConnDataHead * cdata_hd;
|
||||
ConnDataElem * cdata_el;
|
||||
ConnDataElem * cdata_el_remove = NULL;
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
ConnDataHead *cdata_hd;
|
||||
ConnDataElem *cdata_el;
|
||||
ConnDataElem *cdata_el_remove = NULL;
|
||||
NMBluetoothCapabilities bt_type;
|
||||
const char * bdaddr;
|
||||
const char *bdaddr;
|
||||
gboolean changed = FALSE;
|
||||
gboolean changed_usable = FALSE;
|
||||
char sbuf_cap[100];
|
||||
|
@ -946,7 +946,7 @@ _conn_track_update(NMBluezManager * self,
|
|||
out_remove:
|
||||
if (cdata_el_remove) {
|
||||
GHashTableIter iter;
|
||||
BzDBusObj * bzobj;
|
||||
BzDBusObj *bzobj;
|
||||
|
||||
_LOGT("connection: untrack for %s, %s: %s (%s)",
|
||||
nm_bluetooth_capability_to_string(cdata_el_remove->cdata_hd->bt_type,
|
||||
|
@ -989,10 +989,10 @@ cp_connection_added(NMSettings *settings, NMSettingsConnection *sett_conn, NMBlu
|
|||
}
|
||||
|
||||
static void
|
||||
cp_connection_updated(NMSettings * settings,
|
||||
cp_connection_updated(NMSettings *settings,
|
||||
NMSettingsConnection *sett_conn,
|
||||
guint update_reason_u,
|
||||
NMBluezManager * self)
|
||||
NMBluezManager *self)
|
||||
{
|
||||
_conn_track_update(self, sett_conn, TRUE, NULL, NULL, NULL);
|
||||
}
|
||||
|
@ -1032,8 +1032,8 @@ _network_server_find_has_device(NMBluezManagerPrivate *priv, NMDevice *device)
|
|||
|
||||
static BzDBusObj *
|
||||
_network_server_find_available(NMBluezManagerPrivate *priv,
|
||||
const char * addr,
|
||||
NMDevice * device_accept_busy)
|
||||
const char *addr,
|
||||
NMDevice *device_accept_busy)
|
||||
{
|
||||
BzDBusObj *bzobj;
|
||||
|
||||
|
@ -1052,10 +1052,10 @@ _network_server_find_available(NMBluezManagerPrivate *priv,
|
|||
|
||||
static gboolean
|
||||
_network_server_vt_is_available(const NMBtVTableNetworkServer *vtable,
|
||||
const char * addr,
|
||||
NMDevice * device_accept_busy)
|
||||
const char *addr,
|
||||
NMDevice *device_accept_busy)
|
||||
{
|
||||
NMBluezManager * self = _network_server_get_bluez_manager(vtable);
|
||||
NMBluezManager *self = _network_server_get_bluez_manager(vtable);
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
|
||||
return !!_network_server_find_available(priv, addr, device_accept_busy);
|
||||
|
@ -1064,9 +1064,9 @@ _network_server_vt_is_available(const NMBtVTableNetworkServer *vtable,
|
|||
static void
|
||||
_network_server_register_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
gs_unref_variant GVariant *ret = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
BzDBusObj * bzobj;
|
||||
gs_unref_variant GVariant *ret = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
BzDBusObj *bzobj;
|
||||
|
||||
ret = g_dbus_connection_call_finish(G_DBUS_CONNECTION(source_object), res, &error);
|
||||
if (!ret && nm_utils_error_is_cancelled(error))
|
||||
|
@ -1092,18 +1092,18 @@ _network_server_register_cancelled_cb(GCancellable *cancellable, BzDBusObj *bzob
|
|||
|
||||
static gboolean
|
||||
_network_server_vt_register_bridge(const NMBtVTableNetworkServer *vtable,
|
||||
const char * addr,
|
||||
NMDevice * device,
|
||||
GCancellable * cancellable,
|
||||
const char *addr,
|
||||
NMDevice *device,
|
||||
GCancellable *cancellable,
|
||||
NMBtVTableRegisterCallback callback,
|
||||
gpointer callback_user_data,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMBluezManager * self = _network_server_get_bluez_manager(vtable);
|
||||
NMBluezManagerPrivate * priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
NMBluezManager *self = _network_server_get_bluez_manager(vtable);
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
NetworkServerRegisterReqData *r_req_data;
|
||||
BzDBusObj * bzobj;
|
||||
const char * ifname;
|
||||
BzDBusObj *bzobj;
|
||||
const char *ifname;
|
||||
|
||||
g_return_val_if_fail(NM_IS_DEVICE(device), FALSE);
|
||||
g_return_val_if_fail(G_IS_CANCELLABLE(cancellable), FALSE);
|
||||
|
@ -1174,8 +1174,8 @@ _network_server_vt_register_bridge(const NMBtVTableNetworkServer *vtable,
|
|||
static void
|
||||
_network_server_unregister_bridge_complete_on_idle_cb(gpointer user_data, GCancellable *cancellable)
|
||||
{
|
||||
gs_free_error GError * error = NULL;
|
||||
gs_free char * reason = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char *reason = NULL;
|
||||
NetworkServerRegisterReqData *r_req_data;
|
||||
|
||||
nm_utils_user_data_unpack(user_data, &r_req_data, &reason);
|
||||
|
@ -1190,9 +1190,9 @@ _network_server_unregister_bridge_complete_on_idle_cb(gpointer user_data, GCance
|
|||
static void
|
||||
_network_server_unregister_bridge(NMBluezManager *self, BzDBusObj *bzobj, const char *reason)
|
||||
{
|
||||
NMBluezManagerPrivate * priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
_nm_unused gs_unref_object NMDevice *device = NULL;
|
||||
NetworkServerRegisterReqData * r_req_data;
|
||||
NetworkServerRegisterReqData *r_req_data;
|
||||
|
||||
nm_assert(NM_IS_DEVICE(bzobj->x_network_server.device_br));
|
||||
|
||||
|
@ -1242,9 +1242,9 @@ _network_server_unregister_bridge(NMBluezManager *self, BzDBusObj *bzobj, const
|
|||
static gboolean
|
||||
_network_server_vt_unregister_bridge(const NMBtVTableNetworkServer *vtable, NMDevice *device)
|
||||
{
|
||||
NMBluezManager * self = _network_server_get_bluez_manager(vtable);
|
||||
NMBluezManager *self = _network_server_get_bluez_manager(vtable);
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
BzDBusObj * bzobj;
|
||||
BzDBusObj *bzobj;
|
||||
|
||||
g_return_val_if_fail(NM_IS_DEVICE(device), FALSE);
|
||||
|
||||
|
@ -1258,7 +1258,7 @@ _network_server_vt_unregister_bridge(const NMBtVTableNetworkServer *vtable, NMDe
|
|||
static void
|
||||
_network_server_process_change(BzDBusObj *bzobj, gboolean *out_emit_device_availability_changed)
|
||||
{
|
||||
NMBluezManager * self = bzobj->self;
|
||||
NMBluezManager *self = bzobj->self;
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
gboolean network_server_is_usable;
|
||||
gboolean emit_device_availability_changed = FALSE;
|
||||
|
@ -1303,13 +1303,13 @@ _network_server_process_change(BzDBusObj *bzobj, gboolean *out_emit_device_avail
|
|||
static void
|
||||
_conn_create_panu_connection(NMBluezManager *self, BzDBusObj *bzobj)
|
||||
{
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
gs_unref_object NMConnection *connection = NULL;
|
||||
NMSettingsConnection * added;
|
||||
NMSetting * setting;
|
||||
gs_free char * id = NULL;
|
||||
NMSettingsConnection *added;
|
||||
NMSetting *setting;
|
||||
gs_free char *id = NULL;
|
||||
char uuid[37];
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
nm_uuid_generate_random_str_arr(uuid);
|
||||
id = g_strdup_printf(_("%s Network"), bzobj->d_device.name);
|
||||
|
@ -1398,7 +1398,7 @@ _device_state_changed_cb(NMDevice *device,
|
|||
static void
|
||||
_device_process_change(BzDBusObj *bzobj)
|
||||
{
|
||||
NMBluezManager *self = bzobj->self;
|
||||
NMBluezManager *self = bzobj->self;
|
||||
gs_unref_object NMDeviceBt *device_added = NULL;
|
||||
gs_unref_object NMDeviceBt *device_deleted = NULL;
|
||||
gboolean device_is_usable;
|
||||
|
@ -1513,7 +1513,7 @@ static void
|
|||
_process_change_idle_all(NMBluezManager *self, gboolean *out_emit_device_availability_changed)
|
||||
{
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
BzDBusObj * bzobj;
|
||||
BzDBusObj *bzobj;
|
||||
|
||||
while (
|
||||
(bzobj =
|
||||
|
@ -1537,7 +1537,7 @@ _process_change_idle_all(NMBluezManager *self, gboolean *out_emit_device_availab
|
|||
static gboolean
|
||||
_process_change_idle_cb(gpointer user_data)
|
||||
{
|
||||
NMBluezManager * self = user_data;
|
||||
NMBluezManager *self = user_data;
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
gboolean emit_device_availability_changed = FALSE;
|
||||
|
||||
|
@ -1622,7 +1622,7 @@ _dbus_process_changes(NMBluezManager *self, BzDBusObj *bzobj, const char *log_re
|
|||
|
||||
if (recheck_devices_for_adapter) {
|
||||
GHashTableIter iter;
|
||||
BzDBusObj * bzobj2;
|
||||
BzDBusObj *bzobj2;
|
||||
|
||||
/* we got a change to the availability of an adapter. We might need to recheck
|
||||
* all devices that use this adapter... */
|
||||
|
@ -1651,17 +1651,17 @@ _dbus_process_changes(NMBluezManager *self, BzDBusObj *bzobj, const char *log_re
|
|||
NM_BLUEZ5_NETWORK_SERVER_INTERFACE)
|
||||
|
||||
static gboolean
|
||||
_dbus_handle_properties_changed(NMBluezManager * self,
|
||||
const char * object_path,
|
||||
const char * interface_name,
|
||||
GVariant * changed_properties,
|
||||
_dbus_handle_properties_changed(NMBluezManager *self,
|
||||
const char *object_path,
|
||||
const char *interface_name,
|
||||
GVariant *changed_properties,
|
||||
const char *const *invalidated_properties,
|
||||
BzDBusObj ** inout_bzobj)
|
||||
BzDBusObj **inout_bzobj)
|
||||
{
|
||||
BzDBusObj * bzobj = NULL;
|
||||
BzDBusObj *bzobj = NULL;
|
||||
gboolean changed = FALSE;
|
||||
const char * property_name;
|
||||
GVariant * property_value;
|
||||
const char *property_name;
|
||||
GVariant *property_value;
|
||||
GVariantIter iter_prop;
|
||||
gsize i;
|
||||
|
||||
|
@ -1933,14 +1933,14 @@ _dbus_handle_properties_changed(NMBluezManager * self,
|
|||
|
||||
static void
|
||||
_dbus_handle_interface_added(NMBluezManager *self,
|
||||
const char * object_path,
|
||||
GVariant * ifaces,
|
||||
const char *object_path,
|
||||
GVariant *ifaces,
|
||||
gboolean initial_get_managed_objects)
|
||||
{
|
||||
BzDBusObj * bzobj = NULL;
|
||||
BzDBusObj *bzobj = NULL;
|
||||
gboolean changed = FALSE;
|
||||
const char * interface_name;
|
||||
GVariant * changed_properties;
|
||||
const char *interface_name;
|
||||
GVariant *changed_properties;
|
||||
GVariantIter iter_ifaces;
|
||||
|
||||
nm_assert(g_variant_is_of_type(ifaces, G_VARIANT_TYPE("a{sa{sv}}")));
|
||||
|
@ -1966,9 +1966,9 @@ _dbus_handle_interface_added(NMBluezManager *self,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
_dbus_handle_interface_removed(NMBluezManager * self,
|
||||
const char * object_path,
|
||||
BzDBusObj ** inout_bzobj,
|
||||
_dbus_handle_interface_removed(NMBluezManager *self,
|
||||
const char *object_path,
|
||||
BzDBusObj **inout_bzobj,
|
||||
const char *const *removed_interfaces)
|
||||
{
|
||||
gboolean changed = FALSE;
|
||||
|
@ -2056,16 +2056,16 @@ _dbus_handle_interface_removed(NMBluezManager * self,
|
|||
|
||||
static void
|
||||
_dbus_managed_objects_changed_cb(GDBusConnection *connection,
|
||||
const char * sender_name,
|
||||
const char * arg_object_path,
|
||||
const char * interface_name,
|
||||
const char * signal_name,
|
||||
GVariant * parameters,
|
||||
const char *sender_name,
|
||||
const char *arg_object_path,
|
||||
const char *interface_name,
|
||||
const char *signal_name,
|
||||
GVariant *parameters,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMBluezManager * self = user_data;
|
||||
NMBluezManager *self = user_data;
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
BzDBusObj * bzobj = NULL;
|
||||
BzDBusObj *bzobj = NULL;
|
||||
gboolean changed;
|
||||
|
||||
nm_assert(nm_streq0(interface_name, DBUS_INTERFACE_OBJECT_MANAGER));
|
||||
|
@ -2077,7 +2077,7 @@ _dbus_managed_objects_changed_cb(GDBusConnection *connection,
|
|||
|
||||
if (nm_streq(signal_name, "InterfacesAdded")) {
|
||||
gs_unref_variant GVariant *interfaces_and_properties = NULL;
|
||||
const char * object_path;
|
||||
const char *object_path;
|
||||
|
||||
if (!g_variant_is_of_type(parameters, G_VARIANT_TYPE("(oa{sa{sv}})")))
|
||||
return;
|
||||
|
@ -2090,7 +2090,7 @@ _dbus_managed_objects_changed_cb(GDBusConnection *connection,
|
|||
|
||||
if (nm_streq(signal_name, "InterfacesRemoved")) {
|
||||
gs_free const char **interfaces = NULL;
|
||||
const char * object_path;
|
||||
const char *object_path;
|
||||
|
||||
if (!g_variant_is_of_type(parameters, G_VARIANT_TYPE("(oas)")))
|
||||
return;
|
||||
|
@ -2106,19 +2106,19 @@ _dbus_managed_objects_changed_cb(GDBusConnection *connection,
|
|||
|
||||
static void
|
||||
_dbus_properties_changed_cb(GDBusConnection *connection,
|
||||
const char * sender_name,
|
||||
const char * object_path,
|
||||
const char * signal_interface_name,
|
||||
const char * signal_name,
|
||||
GVariant * parameters,
|
||||
const char *sender_name,
|
||||
const char *object_path,
|
||||
const char *signal_interface_name,
|
||||
const char *signal_name,
|
||||
GVariant *parameters,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMBluezManager * self = user_data;
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
const char * interface_name;
|
||||
NMBluezManager *self = user_data;
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
const char *interface_name;
|
||||
gs_unref_variant GVariant *changed_properties = NULL;
|
||||
gs_free const char ** invalidated_properties = NULL;
|
||||
BzDBusObj * bzobj = NULL;
|
||||
gs_free const char **invalidated_properties = NULL;
|
||||
BzDBusObj *bzobj = NULL;
|
||||
|
||||
if (priv->get_managed_objects_cancellable) {
|
||||
/* we still wait for the initial GetManagedObjects(). Ignore the event. */
|
||||
|
@ -2146,11 +2146,11 @@ _dbus_properties_changed_cb(GDBusConnection *connection,
|
|||
static void
|
||||
_dbus_get_managed_objects_cb(GVariant *result, GError *error, gpointer user_data)
|
||||
{
|
||||
NMBluezManager * self;
|
||||
NMBluezManager *self;
|
||||
NMBluezManagerPrivate *priv;
|
||||
GVariantIter iter;
|
||||
const char * object_path;
|
||||
GVariant * ifaces;
|
||||
const char *object_path;
|
||||
GVariant *ifaces;
|
||||
|
||||
if (!result && nm_utils_error_is_cancelled(error))
|
||||
return;
|
||||
|
@ -2184,7 +2184,7 @@ _cleanup_for_name_owner(NMBluezManager *self)
|
|||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
gboolean emit_device_availability_changed = FALSE;
|
||||
GHashTableIter iter;
|
||||
BzDBusObj * bzobj;
|
||||
BzDBusObj *bzobj;
|
||||
gboolean first = TRUE;
|
||||
|
||||
nm_clear_g_cancellable(&priv->get_managed_objects_cancellable);
|
||||
|
@ -2217,7 +2217,7 @@ static void
|
|||
name_owner_changed(NMBluezManager *self, const char *owner)
|
||||
{
|
||||
_nm_unused gs_unref_object NMBluezManager *self_keep_alive = g_object_ref(self);
|
||||
NMBluezManagerPrivate * priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
|
||||
owner = nm_str_not_empty(owner);
|
||||
|
||||
|
@ -2270,15 +2270,15 @@ name_owner_changed(NMBluezManager *self, const char *owner)
|
|||
|
||||
static void
|
||||
name_owner_changed_cb(GDBusConnection *connection,
|
||||
const char * sender_name,
|
||||
const char * object_path,
|
||||
const char * interface_name,
|
||||
const char * signal_name,
|
||||
GVariant * parameters,
|
||||
const char *sender_name,
|
||||
const char *object_path,
|
||||
const char *interface_name,
|
||||
const char *signal_name,
|
||||
GVariant *parameters,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMBluezManager *self = user_data;
|
||||
const char * new_owner;
|
||||
const char *new_owner;
|
||||
|
||||
if (!g_variant_is_of_type(parameters, G_VARIANT_TYPE("(sss)")))
|
||||
return;
|
||||
|
@ -2321,8 +2321,8 @@ _cleanup_all(NMBluezManager *self)
|
|||
static void
|
||||
start(NMDeviceFactory *factory)
|
||||
{
|
||||
NMBluezManager * self;
|
||||
NMBluezManagerPrivate * priv;
|
||||
NMBluezManager *self;
|
||||
NMBluezManagerPrivate *priv;
|
||||
NMSettingsConnection *const *sett_conns;
|
||||
guint n_sett_conns;
|
||||
guint i;
|
||||
|
@ -2378,12 +2378,12 @@ start(NMDeviceFactory *factory)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
_connect_returned(NMBluezManager * self,
|
||||
BzDBusObj * bzobj,
|
||||
_connect_returned(NMBluezManager *self,
|
||||
BzDBusObj *bzobj,
|
||||
NMBluetoothCapabilities bt_type,
|
||||
const char * device_name,
|
||||
NMBluez5DunContext * dun_context,
|
||||
GError * error)
|
||||
const char *device_name,
|
||||
NMBluez5DunContext *dun_context,
|
||||
GError *error)
|
||||
{
|
||||
char sbuf_cap[100];
|
||||
|
||||
|
@ -2449,8 +2449,8 @@ _connect_dun_notify_tty_hangup_cb(NMBluez5DunContext *context, gpointer user_dat
|
|||
|
||||
static void
|
||||
_connect_dun_step2_cb(NMBluez5DunContext *context,
|
||||
const char * rfcomm_dev,
|
||||
GError * error,
|
||||
const char *rfcomm_dev,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
BzDBusObj *bzobj;
|
||||
|
@ -2491,10 +2491,10 @@ _connect_dun_step2_cb(NMBluez5DunContext *context,
|
|||
static void
|
||||
_connect_dun_step1_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
gs_unref_variant GVariant *ret = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
BzDBusObj * bzobj_adapter;
|
||||
BzDBusObj * bzobj;
|
||||
gs_unref_variant GVariant *ret = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
BzDBusObj *bzobj_adapter;
|
||||
BzDBusObj *bzobj;
|
||||
|
||||
ret = g_dbus_connection_call_finish(G_DBUS_CONNECTION(source_object), res, &error);
|
||||
|
||||
|
@ -2537,9 +2537,9 @@ static void
|
|||
_connect_nap_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
gs_unref_variant GVariant *ret = NULL;
|
||||
const char * network_iface_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
BzDBusObj * bzobj;
|
||||
const char *network_iface_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
BzDBusObj *bzobj;
|
||||
|
||||
ret = g_dbus_connection_call_finish(G_DBUS_CONNECTION(source_object), res, &error);
|
||||
|
||||
|
@ -2584,7 +2584,7 @@ static void
|
|||
_connect_disconnect(NMBluezManager *self, BzDBusObj *bzobj, const char *reason)
|
||||
{
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
DeviceConnectReqData * c_req_data;
|
||||
DeviceConnectReqData *c_req_data;
|
||||
char sbuf_cap[100];
|
||||
gboolean bt_type;
|
||||
|
||||
|
@ -2655,19 +2655,19 @@ _connect_disconnect(NMBluezManager *self, BzDBusObj *bzobj, const char *reason)
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_bluez_manager_connect(NMBluezManager * self,
|
||||
const char * object_path,
|
||||
nm_bluez_manager_connect(NMBluezManager *self,
|
||||
const char *object_path,
|
||||
NMBluetoothCapabilities connection_bt_type,
|
||||
int timeout_msec,
|
||||
GCancellable * cancellable,
|
||||
GCancellable *cancellable,
|
||||
NMBluezManagerConnectCb callback,
|
||||
gpointer callback_user_data,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
gs_unref_object GCancellable *int_cancellable = NULL;
|
||||
DeviceConnectReqData * c_req_data;
|
||||
NMBluezManagerPrivate * priv;
|
||||
BzDBusObj * bzobj;
|
||||
DeviceConnectReqData *c_req_data;
|
||||
NMBluezManagerPrivate *priv;
|
||||
BzDBusObj *bzobj;
|
||||
char sbuf_cap[100];
|
||||
|
||||
g_return_val_if_fail(NM_IS_BLUEZ_MANAGER(self), FALSE);
|
||||
|
@ -2781,11 +2781,11 @@ nm_bluez_manager_disconnect(NMBluezManager *self, const char *object_path)
|
|||
/*****************************************************************************/
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
*out_ignore = TRUE;
|
||||
g_return_val_if_fail(plink->type == NM_LINK_TYPE_BNEP, NULL);
|
||||
|
@ -2845,7 +2845,7 @@ nm_bluez_manager_init(NMBluezManager *self)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMBluezManager * self = NM_BLUEZ_MANAGER(object);
|
||||
NMBluezManager *self = NM_BLUEZ_MANAGER(object);
|
||||
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
|
||||
|
||||
/* FIXME(shutdown): we need a nm_device_factory_stop() hook to first unregister all
|
||||
|
@ -2876,7 +2876,7 @@ dispose(GObject *object)
|
|||
static void
|
||||
nm_bluez_manager_class_init(NMBluezManagerClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDeviceFactoryClass *factory_class = NM_DEVICE_FACTORY_CLASS(klass);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
|
|
@ -24,18 +24,18 @@ GType nm_bluez_manager_get_type(void);
|
|||
typedef void (*NMBluezManagerConnectCb)(
|
||||
NMBluezManager *self,
|
||||
gboolean is_completed /* or else is early notification with DUN path */,
|
||||
const char * device_name,
|
||||
GError * error,
|
||||
const char *device_name,
|
||||
GError *error,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean nm_bluez_manager_connect(NMBluezManager * self,
|
||||
const char * object_path,
|
||||
gboolean nm_bluez_manager_connect(NMBluezManager *self,
|
||||
const char *object_path,
|
||||
NMBluetoothCapabilities connection_bt_type,
|
||||
int timeout_msec,
|
||||
GCancellable * cancellable,
|
||||
GCancellable *cancellable,
|
||||
NMBluezManagerConnectCb callback,
|
||||
gpointer callback_user_data,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
void nm_bluez_manager_disconnect(NMBluezManager *self, const char *object_path);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
GCancellable * cancellable;
|
||||
GCancellable *cancellable;
|
||||
NMBluez5DunConnectCb callback;
|
||||
gpointer callback_user_data;
|
||||
|
||||
|
@ -265,10 +265,10 @@ _connect_create_rfcomm(NMBluez5DunContext *context)
|
|||
static gboolean
|
||||
_connect_socket_connect_cb(int fd, GIOCondition condition, gpointer user_data)
|
||||
{
|
||||
NMBluez5DunContext *context = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
int errsv = 0;
|
||||
socklen_t slen = sizeof(errsv);
|
||||
NMBluez5DunContext *context = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
int errsv = 0;
|
||||
socklen_t slen = sizeof(errsv);
|
||||
int r;
|
||||
|
||||
nm_clear_g_source_inst(&context->cdat->source);
|
||||
|
@ -415,7 +415,7 @@ _connect_sdp_search_cb(uint8_t type, uint16_t status, uint8_t *rsp, size_t size,
|
|||
do {
|
||||
sdp_record_t *rec;
|
||||
int recsize = 0;
|
||||
sdp_list_t * protos;
|
||||
sdp_list_t *protos;
|
||||
|
||||
rec = sdp_extract_pdu(rsp, bytesleft, &recsize);
|
||||
if (!rec)
|
||||
|
@ -454,8 +454,8 @@ _connect_sdp_search_cb(uint8_t type, uint16_t status, uint8_t *rsp, size_t size,
|
|||
static gboolean
|
||||
_connect_sdp_search_io_cb(int fd, GIOCondition condition, gpointer user_data)
|
||||
{
|
||||
NMBluez5DunContext *context = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMBluez5DunContext *context = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
int errsv;
|
||||
|
||||
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
|
||||
|
@ -505,8 +505,8 @@ _connect_sdp_search_io_cb(int fd, GIOCondition condition, gpointer user_data)
|
|||
static gboolean
|
||||
_connect_sdp_session_start_on_idle_cb(gpointer user_data)
|
||||
{
|
||||
NMBluez5DunContext *context = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMBluez5DunContext *context = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
nm_clear_g_source_inst(&context->cdat->source);
|
||||
|
||||
|
@ -521,15 +521,15 @@ _connect_sdp_session_start_on_idle_cb(gpointer user_data)
|
|||
static gboolean
|
||||
_connect_sdp_io_cb(int fd, GIOCondition condition, gpointer user_data)
|
||||
{
|
||||
NMBluez5DunContext *context = user_data;
|
||||
sdp_list_t * search;
|
||||
sdp_list_t * attrs;
|
||||
uuid_t svclass;
|
||||
uint16_t attr;
|
||||
int errsv;
|
||||
int fd_err = 0;
|
||||
int r;
|
||||
socklen_t len = sizeof(fd_err);
|
||||
NMBluez5DunContext *context = user_data;
|
||||
sdp_list_t *search;
|
||||
sdp_list_t *attrs;
|
||||
uuid_t svclass;
|
||||
uint16_t attr;
|
||||
int errsv;
|
||||
int fd_err = 0;
|
||||
int r;
|
||||
socklen_t len = sizeof(fd_err);
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
nm_clear_g_source_inst(&context->cdat->source);
|
||||
|
@ -657,17 +657,17 @@ _connect_sdp_session_start(NMBluez5DunContext *context, GError **error)
|
|||
/*****************************************************************************/
|
||||
|
||||
gboolean
|
||||
nm_bluez5_dun_connect(const char * adapter,
|
||||
const char * remote,
|
||||
GCancellable * cancellable,
|
||||
nm_bluez5_dun_connect(const char *adapter,
|
||||
const char *remote,
|
||||
GCancellable *cancellable,
|
||||
NMBluez5DunConnectCb callback,
|
||||
gpointer callback_user_data,
|
||||
NMBluez5DunNotifyTtyHangupCb notify_tty_hangup_cb,
|
||||
gpointer notify_tty_hangup_user_data,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
nm_auto_free_context NMBluez5DunContext *context = NULL;
|
||||
ConnectData * cdat;
|
||||
ConnectData *cdat;
|
||||
gsize src_l;
|
||||
gsize dst_l;
|
||||
|
||||
|
|
|
@ -11,20 +11,20 @@ typedef struct _NMBluez5DunContext NMBluez5DunContext;
|
|||
#if WITH_BLUEZ5_DUN
|
||||
|
||||
typedef void (*NMBluez5DunConnectCb)(NMBluez5DunContext *context,
|
||||
const char * rfcomm_dev,
|
||||
GError * error,
|
||||
const char *rfcomm_dev,
|
||||
GError *error,
|
||||
gpointer user_data);
|
||||
|
||||
typedef void (*NMBluez5DunNotifyTtyHangupCb)(NMBluez5DunContext *context, gpointer user_data);
|
||||
|
||||
gboolean nm_bluez5_dun_connect(const char * adapter,
|
||||
const char * remote,
|
||||
GCancellable * cancellable,
|
||||
gboolean nm_bluez5_dun_connect(const char *adapter,
|
||||
const char *remote,
|
||||
GCancellable *cancellable,
|
||||
NMBluez5DunConnectCb callback,
|
||||
gpointer callback_user_data,
|
||||
NMBluez5DunNotifyTtyHangupCb notify_tty_hangup_cb,
|
||||
gpointer notify_tty_hangup_user_data,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
void nm_bluez5_dun_disconnect(NMBluez5DunContext *context);
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ static NMBluetoothCapabilities
|
|||
get_connection_bt_type(NMConnection *connection)
|
||||
{
|
||||
NMSettingBluetooth *s_bt;
|
||||
const char * bt_type;
|
||||
const char *bt_type;
|
||||
|
||||
s_bt = nm_connection_get_setting_bluetooth(connection);
|
||||
|
||||
|
@ -132,10 +132,10 @@ get_connection_bt_type(NMConnection *connection)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
get_connection_bt_type_check(NMDeviceBt * self,
|
||||
NMConnection * connection,
|
||||
get_connection_bt_type_check(NMDeviceBt *self,
|
||||
NMConnection *connection,
|
||||
NMBluetoothCapabilities *out_bt_type,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMBluetoothCapabilities bt_type;
|
||||
|
||||
|
@ -169,8 +169,8 @@ get_generic_capabilities(NMDevice *device)
|
|||
static gboolean
|
||||
can_auto_connect(NMDevice *device, NMSettingsConnection *sett_conn, char **specific_object)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(device);
|
||||
NMDeviceBtPrivate * priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(device);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
NMBluetoothCapabilities bt_type;
|
||||
|
||||
nm_assert(!specific_object || !*specific_object);
|
||||
|
@ -194,10 +194,10 @@ can_auto_connect(NMDevice *device, NMSettingsConnection *sett_conn, char **speci
|
|||
static gboolean
|
||||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(device);
|
||||
NMDeviceBtPrivate * priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(device);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
NMSettingBluetooth *s_bt;
|
||||
const char * bdaddr;
|
||||
const char *bdaddr;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_bt_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -226,14 +226,14 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
check_connection_available(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
check_connection_available(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDeviceCheckConAvailableFlags flags,
|
||||
const char * specific_object,
|
||||
GError ** error)
|
||||
const char *specific_object,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(device);
|
||||
NMDeviceBtPrivate * priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(device);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
NMBluetoothCapabilities bt_type;
|
||||
|
||||
if (!get_connection_bt_type_check(self, connection, &bt_type, error))
|
||||
|
@ -250,23 +250,23 @@ check_connection_available(NMDevice * device,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceBtPrivate * priv = NM_DEVICE_BT_GET_PRIVATE(device);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(device);
|
||||
NMSettingBluetooth *s_bt;
|
||||
const char * setting_bdaddr;
|
||||
const char * ctype;
|
||||
const char *setting_bdaddr;
|
||||
const char *ctype;
|
||||
gboolean is_dun = FALSE;
|
||||
gboolean is_pan = FALSE;
|
||||
NMSettingGsm * s_gsm;
|
||||
NMSettingCdma * s_cdma;
|
||||
NMSettingSerial * s_serial;
|
||||
NMSettingPpp * s_ppp;
|
||||
const char * fallback_prefix = NULL, *preferred = NULL;
|
||||
NMSettingGsm *s_gsm;
|
||||
NMSettingCdma *s_cdma;
|
||||
NMSettingSerial *s_serial;
|
||||
NMSettingPpp *s_ppp;
|
||||
const char *fallback_prefix = NULL, *preferred = NULL;
|
||||
|
||||
s_gsm = nm_connection_get_setting_gsm(connection);
|
||||
s_cdma = nm_connection_get_setting_cdma(connection);
|
||||
|
@ -423,7 +423,7 @@ ppp_stats(NMModem *modem, guint i_in_bytes, guint i_out_bytes, gpointer user_dat
|
|||
static void
|
||||
ppp_failed(NMModem *modem, guint i_reason, gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceStateReason reason = i_reason;
|
||||
|
||||
nm_device_state_changed(device, NM_DEVICE_STATE_FAILED, reason);
|
||||
|
@ -446,7 +446,7 @@ modem_auth_requested(NMModem *modem, gpointer user_data)
|
|||
static void
|
||||
modem_auth_result(NMModem *modem, GError *error, gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(device);
|
||||
|
||||
g_return_if_fail(nm_device_get_state(device) == NM_DEVICE_STATE_NEED_AUTH);
|
||||
|
@ -463,8 +463,8 @@ modem_auth_result(NMModem *modem, GError *error, gpointer user_data)
|
|||
static void
|
||||
modem_prepare_result(NMModem *modem, gboolean success, guint i_reason, gpointer user_data)
|
||||
{
|
||||
NMDeviceBt * self = user_data;
|
||||
NMDeviceBtPrivate * priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
NMDeviceBt *self = user_data;
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
NMDeviceStateReason reason = i_reason;
|
||||
NMDeviceState state;
|
||||
|
||||
|
@ -493,7 +493,7 @@ modem_prepare_result(NMModem *modem, gboolean success, guint i_reason, gpointer
|
|||
}
|
||||
|
||||
static void
|
||||
device_state_changed(NMDevice * device,
|
||||
device_state_changed(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
|
@ -512,18 +512,18 @@ device_state_changed(NMDevice * device,
|
|||
}
|
||||
|
||||
static void
|
||||
modem_new_config(NMModem * modem,
|
||||
modem_new_config(NMModem *modem,
|
||||
int addr_family,
|
||||
const NML3ConfigData * l3cd,
|
||||
const NML3ConfigData *l3cd,
|
||||
gboolean do_auto,
|
||||
const NMUtilsIPv6IfaceId *iid,
|
||||
int failure_reason_i,
|
||||
GError * error,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(user_data);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
|
||||
g_return_if_fail(nm_device_devip_get_state(device, addr_family) == NM_DEVICE_IP_STATE_PENDING);
|
||||
|
||||
|
@ -582,7 +582,7 @@ modem_state_cb(NMModem *modem, int new_state_i, int old_state_i, gpointer user_d
|
|||
{
|
||||
NMModemState new_state = new_state_i;
|
||||
NMModemState old_state = old_state_i;
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceState dev_state = nm_device_get_state(device);
|
||||
|
||||
if (new_state <= NM_MODEM_STATE_DISABLING && old_state > NM_MODEM_STATE_DISABLING) {
|
||||
|
@ -611,7 +611,7 @@ modem_state_cb(NMModem *modem, int new_state_i, int old_state_i, gpointer user_d
|
|||
static void
|
||||
modem_removed_cb(NMModem *modem, gpointer user_data)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(user_data);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(user_data);
|
||||
NMDeviceState state;
|
||||
|
||||
state = nm_device_get_state(NM_DEVICE(self));
|
||||
|
@ -629,7 +629,7 @@ static gboolean
|
|||
modem_try_claim(NMDeviceBt *self, NMModem *modem)
|
||||
{
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
gs_free char * rfcomm_base_name = NULL;
|
||||
gs_free char *rfcomm_base_name = NULL;
|
||||
NMDeviceState state;
|
||||
|
||||
if (priv->modem) {
|
||||
|
@ -683,7 +683,7 @@ modem_try_claim(NMDeviceBt *self, NMModem *modem)
|
|||
static void
|
||||
mm_modem_added_cb(NMModemManager *manager, NMModem *modem, gpointer user_data)
|
||||
{
|
||||
NMDeviceBt * self = user_data;
|
||||
NMDeviceBt *self = user_data;
|
||||
NMDeviceBtPrivate *priv;
|
||||
|
||||
if (!modem_try_claim(user_data, modem))
|
||||
|
@ -723,7 +723,7 @@ _nm_device_bt_notify_set_connected(NMDeviceBt *self, gboolean connected)
|
|||
static gboolean
|
||||
connect_watch_link_idle_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceBt * self = user_data;
|
||||
NMDeviceBt *self = user_data;
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
int ifindex;
|
||||
|
||||
|
@ -744,15 +744,15 @@ connect_watch_link_idle_cb(gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
connect_watch_link_cb(NMPlatform * platform,
|
||||
connect_watch_link_cb(NMPlatform *platform,
|
||||
int obj_type_i,
|
||||
int ifindex,
|
||||
NMPlatformLink *info,
|
||||
int change_type_i,
|
||||
NMDevice * self)
|
||||
NMDevice *self)
|
||||
{
|
||||
const NMPlatformSignalChangeType change_type = change_type_i;
|
||||
NMDeviceBtPrivate * priv;
|
||||
NMDeviceBtPrivate *priv;
|
||||
|
||||
/* bluez doesn't notify us when the connection disconnects.
|
||||
* Neither does NMManager (or NMDevice) tell us when the ip-ifindex goes away.
|
||||
|
@ -768,7 +768,7 @@ connect_watch_link_cb(NMPlatform * platform,
|
|||
static gboolean
|
||||
connect_wait_modem_timeout(gpointer user_data)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(user_data);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(user_data);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
|
||||
/* since this timeout is longer than the connect timeout, we must have already
|
||||
|
@ -792,11 +792,11 @@ connect_wait_modem_timeout(gpointer user_data)
|
|||
static void
|
||||
connect_bz_cb(NMBluezManager *bz_mgr,
|
||||
gboolean is_complete,
|
||||
const char * device_name,
|
||||
GError * error,
|
||||
const char *device_name,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceBt * self;
|
||||
NMDeviceBt *self;
|
||||
NMDeviceBtPrivate *priv;
|
||||
char sbuf[100];
|
||||
|
||||
|
@ -884,10 +884,10 @@ connect_bz_cb(NMBluezManager *bz_mgr,
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(device);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(device);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
gs_free_error GError *error = NULL;
|
||||
NMConnection * connection;
|
||||
NMConnection *connection;
|
||||
|
||||
connection = nm_device_get_applied_connection(device);
|
||||
g_return_val_if_fail(connection, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
@ -967,7 +967,7 @@ act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(device);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(device);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
|
||||
if (priv->connect_bt_type != NM_BT_CAPABILITY_DUN)
|
||||
|
@ -1035,10 +1035,10 @@ _nm_device_bt_notify_removed(NMDeviceBt *self)
|
|||
/*****************************************************************************/
|
||||
|
||||
gboolean
|
||||
_nm_device_bt_for_same_device(NMDeviceBt * self,
|
||||
const char * dbus_path,
|
||||
const char * bdaddr,
|
||||
const char * name,
|
||||
_nm_device_bt_for_same_device(NMDeviceBt *self,
|
||||
const char *dbus_path,
|
||||
const char *bdaddr,
|
||||
const char *name,
|
||||
NMBluetoothCapabilities capabilities)
|
||||
{
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
|
@ -1067,7 +1067,7 @@ _nm_device_bt_notify_set_name(NMDeviceBt *self, const char *name)
|
|||
static gboolean
|
||||
is_available(NMDevice *dev, NMDeviceCheckDevAvailableFlags flags)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(dev);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(dev);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
|
||||
/* PAN doesn't need ModemManager, so devices that support it are always available */
|
||||
|
@ -1171,7 +1171,7 @@ nm_device_bt_init(NMDeviceBt *self)
|
|||
static void
|
||||
constructed(GObject *object)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(object);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(object);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
|
||||
G_OBJECT_CLASS(nm_device_bt_parent_class)->constructed(object);
|
||||
|
@ -1194,10 +1194,10 @@ constructed(GObject *object)
|
|||
}
|
||||
|
||||
NMDeviceBt *
|
||||
nm_device_bt_new(NMBluezManager * bz_mgr,
|
||||
const char * dbus_path,
|
||||
const char * bdaddr,
|
||||
const char * name,
|
||||
nm_device_bt_new(NMBluezManager *bz_mgr,
|
||||
const char *dbus_path,
|
||||
const char *bdaddr,
|
||||
const char *name,
|
||||
NMBluetoothCapabilities capabilities)
|
||||
{
|
||||
g_return_val_if_fail(NM_IS_BLUEZ_MANAGER(bz_mgr), NULL);
|
||||
|
@ -1235,7 +1235,7 @@ nm_device_bt_new(NMBluezManager * bz_mgr,
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceBt * self = NM_DEVICE_BT(object);
|
||||
NMDeviceBt *self = NM_DEVICE_BT(object);
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_signal_handler(nm_device_get_platform(NM_DEVICE(self)),
|
||||
|
@ -1290,9 +1290,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_bluetooth = {
|
|||
static void
|
||||
nm_device_bt_class_init(NMDeviceBtClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->constructed = constructed;
|
||||
object_class->get_property = get_property;
|
||||
|
|
|
@ -33,15 +33,15 @@ GType nm_device_bt_get_type(void);
|
|||
struct _NMBluezManager;
|
||||
|
||||
NMDeviceBt *nm_device_bt_new(struct _NMBluezManager *bz_mgr,
|
||||
const char * dbus_path,
|
||||
const char * bdaddr,
|
||||
const char * name,
|
||||
const char *dbus_path,
|
||||
const char *bdaddr,
|
||||
const char *name,
|
||||
NMBluetoothCapabilities capabilities);
|
||||
|
||||
gboolean _nm_device_bt_for_same_device(NMDeviceBt * device,
|
||||
const char * dbus_path,
|
||||
const char * bdaddr,
|
||||
const char * name,
|
||||
gboolean _nm_device_bt_for_same_device(NMDeviceBt *device,
|
||||
const char *dbus_path,
|
||||
const char *bdaddr,
|
||||
const char *name,
|
||||
NMBluetoothCapabilities capabilities);
|
||||
|
||||
NMBluetoothCapabilities nm_device_bt_get_capabilities(NMDeviceBt *device);
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
struct {
|
||||
int argc;
|
||||
const char *const *argv;
|
||||
const char * argv_cmd;
|
||||
GMainLoop * loop;
|
||||
const char *argv_cmd;
|
||||
GMainLoop *loop;
|
||||
} gl;
|
||||
|
||||
typedef struct _MainCmdInfo {
|
||||
|
@ -38,7 +38,7 @@ typedef struct _MainCmdInfo {
|
|||
|
||||
typedef struct {
|
||||
NMBluez5DunContext *dun_context;
|
||||
GCancellable * cancellable;
|
||||
GCancellable *cancellable;
|
||||
guint timeout_id;
|
||||
guint sig_term_id;
|
||||
guint sig_int_id;
|
||||
|
@ -46,8 +46,8 @@ typedef struct {
|
|||
|
||||
static void
|
||||
_dun_connect_cb(NMBluez5DunContext *context,
|
||||
const char * rfcomm_dev,
|
||||
GError * error,
|
||||
const char *rfcomm_dev,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
DunConnectData *dun_connect_data = user_data;
|
||||
|
@ -118,10 +118,10 @@ do_dun_connect(const MainCmdInfo *main_cmd_info)
|
|||
{
|
||||
#if WITH_BLUEZ5_DUN
|
||||
gs_unref_object GCancellable *cancellable = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
const char * adapter;
|
||||
const char * remote;
|
||||
DunConnectData dun_connect_data = {};
|
||||
gs_free_error GError *error = NULL;
|
||||
const char *adapter;
|
||||
const char *remote;
|
||||
DunConnectData dun_connect_data = {};
|
||||
|
||||
if (gl.argc < 4) {
|
||||
_LOGE("missing arguments \"adapter\" and \"remote\"");
|
||||
|
|
|
@ -41,7 +41,7 @@ G_DEFINE_TYPE(NMDevice6Lowpan, nm_device_6lowpan, NM_TYPE_DEVICE)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
parent_state_changed(NMDevice * parent,
|
||||
parent_state_changed(NMDevice *parent,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason,
|
||||
|
@ -62,7 +62,7 @@ parent_changed_notify(NMDevice *device,
|
|||
int new_ifindex,
|
||||
NMDevice *new_parent)
|
||||
{
|
||||
NMDevice6Lowpan * self = NM_DEVICE_6LOWPAN(device);
|
||||
NMDevice6Lowpan *self = NM_DEVICE_6LOWPAN(device);
|
||||
NMDevice6LowpanPrivate *priv = NM_DEVICE_6LOWPAN_GET_PRIVATE(self);
|
||||
|
||||
NM_DEVICE_CLASS(nm_device_6lowpan_parent_class)
|
||||
|
@ -95,13 +95,13 @@ parent_changed_notify(NMDevice *device,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMSetting6Lowpan *s_6lowpan;
|
||||
int parent_ifindex;
|
||||
int r;
|
||||
|
@ -175,11 +175,11 @@ is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSetting6Lowpan *s_6lowpan;
|
||||
|
||||
|
@ -249,7 +249,7 @@ static void
|
|||
nm_device_6lowpan_class_init(NMDevice6LowpanClass *klass)
|
||||
{
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS(&interface_info_device_6lowpan);
|
||||
|
||||
|
@ -275,11 +275,11 @@ nm_device_6lowpan_class_init(NMDevice6LowpanClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_6LOWPAN_DEVICE_FACTORY, NM6LowpanDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_6LOWPAN,
|
||||
NM_DEVICE_IFACE,
|
||||
|
@ -310,7 +310,7 @@ static char *
|
|||
get_connection_iface(NMDeviceFactory *factory, NMConnection *connection, const char *parent_iface)
|
||||
{
|
||||
NMSetting6Lowpan *s_6lowpan;
|
||||
const char * ifname;
|
||||
const char *ifname;
|
||||
|
||||
g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_6LOWPAN_SETTING_NAME), NULL);
|
||||
|
||||
|
|
|
@ -74,11 +74,11 @@ get_generic_capabilities(NMDevice *dev)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
nm_utils_complete_generic(nm_device_get_platform(device),
|
||||
connection,
|
||||
|
@ -162,18 +162,18 @@ ignore_option(NMSettingBond *s_bond, const char *option, const char *value)
|
|||
static void
|
||||
update_connection(NMDevice *device, NMConnection *connection)
|
||||
{
|
||||
NMDeviceBond * self = NM_DEVICE_BOND(device);
|
||||
NMDeviceBond *self = NM_DEVICE_BOND(device);
|
||||
NMSettingBond *s_bond = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_BOND);
|
||||
int ifindex = nm_device_get_ifindex(device);
|
||||
NMBondMode mode = NM_BOND_MODE_UNKNOWN;
|
||||
const char ** options;
|
||||
const char **options;
|
||||
|
||||
/* Read bond options from sysfs and update the Bond setting to match */
|
||||
options = nm_setting_bond_get_valid_options(NULL);
|
||||
for (; options[0]; options++) {
|
||||
const char * option = options[0];
|
||||
const char *option = options[0];
|
||||
gs_free char *value = NULL;
|
||||
char * p;
|
||||
char *p;
|
||||
|
||||
if (NM_IN_STRSET(option, NM_SETTING_BOND_OPTION_ACTIVE_SLAVE))
|
||||
continue;
|
||||
|
@ -215,15 +215,15 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
controller_update_port_connection(NMDevice * self,
|
||||
NMDevice * port,
|
||||
controller_update_port_connection(NMDevice *self,
|
||||
NMDevice *port,
|
||||
NMConnection *connection,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingBondPort *s_port;
|
||||
int ifindex_port = nm_device_get_ifindex(port);
|
||||
uint queue_id = NM_BOND_PORT_QUEUE_ID_DEF;
|
||||
gs_free char * queue_id_str = NULL;
|
||||
gs_free char *queue_id_str = NULL;
|
||||
|
||||
g_return_val_if_fail(ifindex_port > 0, FALSE);
|
||||
|
||||
|
@ -251,8 +251,8 @@ static void
|
|||
set_arp_targets(NMDevice *device, const char *cur_arp_ip_target, const char *new_arp_ip_target)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *free_list = NULL;
|
||||
gs_free const char ** cur_strv = NULL;
|
||||
gs_free const char ** new_strv = NULL;
|
||||
gs_free const char **cur_strv = NULL;
|
||||
gs_free const char **new_strv = NULL;
|
||||
gsize cur_len;
|
||||
gsize new_len;
|
||||
gsize i;
|
||||
|
@ -310,7 +310,7 @@ static void
|
|||
set_bond_attr_or_default(NMDevice *device, NMSettingBond *s_bond, const char *opt)
|
||||
{
|
||||
NMDeviceBond *self = NM_DEVICE_BOND(device);
|
||||
const char * value;
|
||||
const char *value;
|
||||
|
||||
value = nm_setting_bond_get_option_or_default(s_bond, opt);
|
||||
if (!value) {
|
||||
|
@ -352,11 +352,11 @@ set_bond_arp_ip_targets(NMDevice *device, NMSettingBond *s_bond)
|
|||
static gboolean
|
||||
apply_bonding_config(NMDeviceBond *self)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMSettingBond *s_bond;
|
||||
NMBondMode mode;
|
||||
const char * mode_str;
|
||||
gs_free char * device_bond_mode = NULL;
|
||||
const char *mode_str;
|
||||
gs_free char *device_bond_mode = NULL;
|
||||
|
||||
s_bond = nm_device_get_applied_setting(device, NM_TYPE_SETTING_BOND);
|
||||
g_return_val_if_fail(s_bond, FALSE);
|
||||
|
@ -386,7 +386,7 @@ apply_bonding_config(NMDeviceBond *self)
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceBond * self = NM_DEVICE_BOND(device);
|
||||
NMDeviceBond *self = NM_DEVICE_BOND(device);
|
||||
NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS;
|
||||
|
||||
/* Interface must be down to set bond options */
|
||||
|
@ -427,7 +427,7 @@ commit_port_options(NMDevice *bond_device, NMDevice *port, NMSettingBondPort *s_
|
|||
static gboolean
|
||||
enslave_slave(NMDevice *device, NMDevice *port, NMConnection *connection, gboolean configure)
|
||||
{
|
||||
NMDeviceBond * self = NM_DEVICE_BOND(device);
|
||||
NMDeviceBond *self = NM_DEVICE_BOND(device);
|
||||
NMSettingBondPort *s_port;
|
||||
|
||||
nm_device_master_check_slave_physical_port(device, port, LOGD_BOND);
|
||||
|
@ -478,9 +478,9 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean configure)
|
|||
_LOGD(LOGD_BOND, "bond slave %s is already released", nm_device_get_ip_iface(slave));
|
||||
|
||||
if (configure) {
|
||||
NMConnection * applied;
|
||||
NMConnection *applied;
|
||||
NMSettingWired *s_wired;
|
||||
const char * cloned_mac;
|
||||
const char *cloned_mac;
|
||||
|
||||
address = g_strdup(nm_device_get_hw_address(device));
|
||||
|
||||
|
@ -523,11 +523,11 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean configure)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
int r;
|
||||
|
@ -549,12 +549,12 @@ create_and_realize(NMDevice * device,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
can_reapply_change(NMDevice * device,
|
||||
can_reapply_change(NMDevice *device,
|
||||
const char *setting_name,
|
||||
NMSetting * s_old,
|
||||
NMSetting * s_new,
|
||||
NMSetting *s_old,
|
||||
NMSetting *s_new,
|
||||
GHashTable *diffs,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceClass *device_class;
|
||||
|
||||
|
@ -562,7 +562,7 @@ can_reapply_change(NMDevice * device,
|
|||
if (nm_streq(setting_name, NM_SETTING_BOND_SETTING_NAME)) {
|
||||
NMSettingBond *s_a = NM_SETTING_BOND(s_old);
|
||||
NMSettingBond *s_b = NM_SETTING_BOND(s_new);
|
||||
const char ** option_list;
|
||||
const char **option_list;
|
||||
|
||||
if (!nm_device_hash_check_invalid_keys(diffs,
|
||||
NM_SETTING_BOND_SETTING_NAME,
|
||||
|
@ -601,9 +601,9 @@ can_reapply_change(NMDevice * device,
|
|||
static void
|
||||
reapply_connection(NMDevice *device, NMConnection *con_old, NMConnection *con_new)
|
||||
{
|
||||
NMDeviceBond * self = NM_DEVICE_BOND(device);
|
||||
NMDeviceBond *self = NM_DEVICE_BOND(device);
|
||||
NMSettingBond *s_bond;
|
||||
const char * value;
|
||||
const char *value;
|
||||
NMBondMode mode;
|
||||
|
||||
NM_DEVICE_CLASS(nm_device_bond_parent_class)->reapply_connection(device, con_old, con_new);
|
||||
|
@ -645,7 +645,7 @@ static void
|
|||
nm_device_bond_class_init(NMDeviceBondClass *klass)
|
||||
{
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS(&interface_info_device_bond);
|
||||
|
||||
|
@ -676,11 +676,11 @@ nm_device_bond_class_init(NMDeviceBondClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_BOND_DEVICE_FACTORY, NMBondDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_BOND,
|
||||
NM_DEVICE_IFACE,
|
||||
|
|
|
@ -48,13 +48,13 @@ get_generic_capabilities(NMDevice *dev)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
check_connection_available(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
check_connection_available(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDeviceCheckConAvailableFlags flags,
|
||||
const char * specific_object,
|
||||
GError ** error)
|
||||
const char *specific_object,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceBridge * self = NM_DEVICE_BRIDGE(device);
|
||||
NMDeviceBridge *self = NM_DEVICE_BRIDGE(device);
|
||||
NMSettingBluetooth *s_bt;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_bridge_parent_class)
|
||||
|
@ -97,7 +97,7 @@ static gboolean
|
|||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMSettingBridge *s_bridge;
|
||||
const char * mac_address;
|
||||
const char *mac_address;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_bridge_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -140,11 +140,11 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
nm_utils_complete_generic(nm_device_get_platform(device),
|
||||
connection,
|
||||
|
@ -290,8 +290,8 @@ typedef struct {
|
|||
|
||||
#define OPTION(_name, _sysname, ...) \
|
||||
{ \
|
||||
.name = ""_name \
|
||||
"", \
|
||||
.name = ""_name \
|
||||
"", \
|
||||
.sysname = ""_sysname \
|
||||
"", \
|
||||
__VA_ARGS__ \
|
||||
|
@ -432,8 +432,8 @@ commit_option(NMDevice *device, NMSetting *setting, const Option *option, gboole
|
|||
{
|
||||
int ifindex = nm_device_get_ifindex(device);
|
||||
nm_auto_unset_gvalue GValue val = G_VALUE_INIT;
|
||||
GParamSpec * pspec;
|
||||
const char * value;
|
||||
GParamSpec *pspec;
|
||||
const char *value;
|
||||
char value_buf[100];
|
||||
|
||||
if (slave)
|
||||
|
@ -521,7 +521,7 @@ static const NMPlatformBridgeVlan **
|
|||
setting_vlans_to_platform(GPtrArray *array)
|
||||
{
|
||||
NMPlatformBridgeVlan **arr;
|
||||
NMPlatformBridgeVlan * p_data;
|
||||
NMPlatformBridgeVlan *p_data;
|
||||
guint i;
|
||||
|
||||
if (!array || !array->len)
|
||||
|
@ -553,8 +553,8 @@ setting_vlans_to_platform(GPtrArray *array)
|
|||
static void
|
||||
commit_slave_options(NMDevice *device, NMSettingBridgePort *setting)
|
||||
{
|
||||
const Option * option;
|
||||
NMSetting * s;
|
||||
const Option *option;
|
||||
NMSetting *s;
|
||||
gs_unref_object NMSetting *s_clear = NULL;
|
||||
|
||||
if (setting)
|
||||
|
@ -569,11 +569,11 @@ commit_slave_options(NMDevice *device, NMSettingBridgePort *setting)
|
|||
static void
|
||||
update_connection(NMDevice *device, NMConnection *connection)
|
||||
{
|
||||
NMDeviceBridge * self = NM_DEVICE_BRIDGE(device);
|
||||
NMDeviceBridge *self = NM_DEVICE_BRIDGE(device);
|
||||
NMSettingBridge *s_bridge = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_BRIDGE);
|
||||
int ifindex = nm_device_get_ifindex(device);
|
||||
const Option * option;
|
||||
gs_free char * stp = NULL;
|
||||
const Option *option;
|
||||
gs_free char *stp = NULL;
|
||||
int stp_value;
|
||||
|
||||
option = master_options;
|
||||
|
@ -589,8 +589,8 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
|
||||
for (; option->name; option++) {
|
||||
nm_auto_unset_gvalue GValue value = G_VALUE_INIT;
|
||||
gs_free char * str = NULL;
|
||||
GParamSpec * pspec;
|
||||
gs_free char *str = NULL;
|
||||
GParamSpec *pspec;
|
||||
|
||||
str = nm_platform_sysctl_master_get_option(nm_device_get_platform(device),
|
||||
ifindex,
|
||||
|
@ -664,17 +664,17 @@ out:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
master_update_slave_connection(NMDevice * device,
|
||||
NMDevice * slave,
|
||||
master_update_slave_connection(NMDevice *device,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceBridge * self = NM_DEVICE_BRIDGE(device);
|
||||
NMDeviceBridge *self = NM_DEVICE_BRIDGE(device);
|
||||
NMSettingConnection *s_con;
|
||||
NMSettingBridgePort *s_port;
|
||||
int ifindex_slave = nm_device_get_ifindex(slave);
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
const Option * option;
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
const Option *option;
|
||||
|
||||
g_return_val_if_fail(ifindex_slave > 0, FALSE);
|
||||
|
||||
|
@ -720,14 +720,14 @@ master_update_slave_connection(NMDevice * device,
|
|||
static gboolean
|
||||
bridge_set_vlan_options(NMDevice *device, NMSettingBridge *s_bridge)
|
||||
{
|
||||
NMDeviceBridge * self = NM_DEVICE_BRIDGE(device);
|
||||
gconstpointer hwaddr;
|
||||
size_t length;
|
||||
gboolean enabled;
|
||||
guint16 pvid;
|
||||
NMPlatform * plat;
|
||||
int ifindex;
|
||||
gs_unref_ptrarray GPtrArray *vlans = NULL;
|
||||
NMDeviceBridge *self = NM_DEVICE_BRIDGE(device);
|
||||
gconstpointer hwaddr;
|
||||
size_t length;
|
||||
gboolean enabled;
|
||||
guint16 pvid;
|
||||
NMPlatform *plat;
|
||||
int ifindex;
|
||||
gs_unref_ptrarray GPtrArray *vlans = NULL;
|
||||
gs_free const NMPlatformBridgeVlan **plat_vlans = NULL;
|
||||
|
||||
if (self->vlan_configured)
|
||||
|
@ -795,7 +795,7 @@ static NMActStageReturn
|
|||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMConnection *connection;
|
||||
NMSetting * s_bridge;
|
||||
NMSetting *s_bridge;
|
||||
const Option *option;
|
||||
|
||||
connection = nm_device_get_applied_connection(device);
|
||||
|
@ -859,9 +859,9 @@ _nm_device_bridge_notify_unregister_bt_nap(NMDevice *device, const char *reason)
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceBridge * self = NM_DEVICE_BRIDGE(device);
|
||||
NMConnection * connection;
|
||||
NMSettingBluetooth *s_bt;
|
||||
NMDeviceBridge *self = NM_DEVICE_BRIDGE(device);
|
||||
NMConnection *connection;
|
||||
NMSettingBluetooth *s_bt;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
connection = nm_device_get_applied_connection(device);
|
||||
|
@ -921,9 +921,9 @@ deactivate(NMDevice *device)
|
|||
static gboolean
|
||||
enslave_slave(NMDevice *device, NMDevice *slave, NMConnection *connection, gboolean configure)
|
||||
{
|
||||
NMDeviceBridge * self = NM_DEVICE_BRIDGE(device);
|
||||
NMConnection * master_connection;
|
||||
NMSettingBridge * s_bridge;
|
||||
NMDeviceBridge *self = NM_DEVICE_BRIDGE(device);
|
||||
NMConnection *master_connection;
|
||||
NMSettingBridge *s_bridge;
|
||||
NMSettingBridgePort *s_port;
|
||||
|
||||
if (configure) {
|
||||
|
@ -942,7 +942,7 @@ enslave_slave(NMDevice *device, NMDevice *slave, NMConnection *connection, gbool
|
|||
|
||||
if (nm_setting_bridge_get_vlan_filtering(s_bridge)) {
|
||||
gs_free const NMPlatformBridgeVlan **plat_vlans = NULL;
|
||||
gs_unref_ptrarray GPtrArray *vlans = NULL;
|
||||
gs_unref_ptrarray GPtrArray *vlans = NULL;
|
||||
|
||||
if (s_port)
|
||||
g_object_get(s_port, NM_SETTING_BRIDGE_PORT_VLANS, &vlans, NULL);
|
||||
|
@ -1007,17 +1007,17 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean configure)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingWired * s_wired;
|
||||
NMSettingBridge * s_bridge;
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
const char * hwaddr;
|
||||
gs_free char * hwaddr_cloned = NULL;
|
||||
NMSettingWired *s_wired;
|
||||
NMSettingBridge *s_bridge;
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
const char *hwaddr;
|
||||
gs_free char *hwaddr_cloned = NULL;
|
||||
guint8 mac_address[_NM_UTILS_HWADDR_LEN_MAX];
|
||||
NMPlatformLnkBridge props;
|
||||
int r;
|
||||
|
@ -1136,7 +1136,7 @@ static void
|
|||
nm_device_bridge_class_init(NMDeviceBridgeClass *klass)
|
||||
{
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS(&interface_info_device_bridge);
|
||||
|
||||
|
@ -1170,11 +1170,11 @@ nm_device_bridge_class_init(NMDeviceBridgeClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_BRIDGE_DEVICE_FACTORY, NMBridgeDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_BRIDGE,
|
||||
NM_DEVICE_IFACE,
|
||||
|
|
|
@ -42,11 +42,11 @@ get_generic_capabilities(NMDevice *dev)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
nm_utils_complete_generic_with_params(nm_device_get_platform(device),
|
||||
connection,
|
||||
|
@ -69,13 +69,13 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMSettingDummy *s_dummy;
|
||||
int r;
|
||||
|
||||
|
@ -116,7 +116,7 @@ static void
|
|||
nm_device_dummy_class_init(NMDeviceDummyClass *klass)
|
||||
{
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS(&interface_info_device_dummy);
|
||||
|
||||
|
@ -139,11 +139,11 @@ nm_device_dummy_class_init(NMDeviceDummyClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_DUMMY_DEVICE_FACTORY, NMDummyDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_DUMMY,
|
||||
NM_DEVICE_IFACE,
|
||||
|
|
|
@ -65,21 +65,21 @@ typedef enum {
|
|||
|
||||
typedef struct _NMDeviceEthernetPrivate {
|
||||
/* s390 */
|
||||
char * subchan1;
|
||||
char * subchan2;
|
||||
char * subchan3;
|
||||
char * subchannels; /* Composite used for checking unmanaged specs */
|
||||
char ** subchannels_dbus; /* Array exported on D-Bus */
|
||||
char * s390_nettype;
|
||||
char *subchan1;
|
||||
char *subchan2;
|
||||
char *subchan3;
|
||||
char *subchannels; /* Composite used for checking unmanaged specs */
|
||||
char **subchannels_dbus; /* Array exported on D-Bus */
|
||||
char *s390_nettype;
|
||||
GHashTable *s390_options;
|
||||
|
||||
guint32 speed;
|
||||
gulong carrier_id;
|
||||
|
||||
struct {
|
||||
NMSupplicantManager * mgr;
|
||||
NMSupplicantManager *mgr;
|
||||
NMSupplMgrCreateIfaceHandle *create_handle;
|
||||
NMSupplicantInterface * iface;
|
||||
NMSupplicantInterface *iface;
|
||||
|
||||
gulong iface_state_id;
|
||||
gulong auth_state_id;
|
||||
|
@ -96,7 +96,7 @@ typedef struct _NMDeviceEthernetPrivate {
|
|||
|
||||
struct {
|
||||
NMPppMgr *ppp_mgr;
|
||||
GSource * wait_source;
|
||||
GSource *wait_source;
|
||||
gint64 last_pppoe_time_msec;
|
||||
} ppp_data;
|
||||
|
||||
|
@ -152,12 +152,12 @@ static void
|
|||
_update_s390_subchannels(NMDeviceEthernet *self)
|
||||
{
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
struct udev_device * dev = NULL;
|
||||
struct udev_device * parent = NULL;
|
||||
const char * parent_path, *item;
|
||||
struct udev_device *dev = NULL;
|
||||
struct udev_device *parent = NULL;
|
||||
const char *parent_path, *item;
|
||||
int ifindex;
|
||||
GDir * dir;
|
||||
GError * error = NULL;
|
||||
GDir *dir;
|
||||
GError *error = NULL;
|
||||
|
||||
if (priv->subchannels) {
|
||||
/* only read the subchannels once. For one, we don't expect them to change
|
||||
|
@ -253,7 +253,7 @@ _update_s390_subchannels(NMDeviceEthernet *self)
|
|||
}
|
||||
|
||||
static void
|
||||
device_state_changed(NMDevice * device,
|
||||
device_state_changed(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
|
@ -308,7 +308,7 @@ static gboolean
|
|||
match_subchans(NMDeviceEthernet *self, NMSettingWired *s_wired, gboolean *try_mac)
|
||||
{
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
const char *const * subchans;
|
||||
const char *const *subchans;
|
||||
guint32 num1, num2;
|
||||
int i;
|
||||
|
||||
|
@ -347,7 +347,7 @@ static gboolean
|
|||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMSettingWired * s_wired;
|
||||
NMSettingWired *s_wired;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_ethernet_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -365,7 +365,7 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
if (s_wired) {
|
||||
const char * mac, *perm_hw_addr;
|
||||
const char *mac, *perm_hw_addr;
|
||||
gboolean try_mac = TRUE;
|
||||
const char *const *mac_blacklist;
|
||||
int i;
|
||||
|
@ -440,8 +440,8 @@ supplicant_interface_release(NMDeviceEthernet *self)
|
|||
|
||||
static void
|
||||
supplicant_auth_state_changed(NMSupplicantInterface *iface,
|
||||
GParamSpec * pspec,
|
||||
NMDeviceEthernet * self)
|
||||
GParamSpec *pspec,
|
||||
NMDeviceEthernet *self)
|
||||
{
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMSupplicantAuthState state;
|
||||
|
@ -469,7 +469,7 @@ static void
|
|||
wired_auth_cond_fail(NMDeviceEthernet *self, NMDeviceStateReason reason)
|
||||
{
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
|
||||
if (!wired_auth_is_optional(self)) {
|
||||
supplicant_interface_release(self);
|
||||
|
@ -494,14 +494,14 @@ wired_auth_cond_fail(NMDeviceEthernet *self, NMDeviceStateReason reason)
|
|||
}
|
||||
|
||||
static void
|
||||
wired_secrets_cb(NMActRequest * req,
|
||||
wired_secrets_cb(NMActRequest *req,
|
||||
NMActRequestGetSecretsCallId *call_id,
|
||||
NMSettingsConnection * connection,
|
||||
GError * error,
|
||||
NMSettingsConnection *connection,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceEthernet * self = user_data;
|
||||
NMDevice * device = user_data;
|
||||
NMDeviceEthernet *self = user_data;
|
||||
NMDevice *device = user_data;
|
||||
NMDeviceEthernetPrivate *priv;
|
||||
|
||||
g_return_if_fail(NM_IS_DEVICE_ETHERNET(self));
|
||||
|
@ -541,12 +541,12 @@ wired_secrets_cancel(NMDeviceEthernet *self)
|
|||
}
|
||||
|
||||
static void
|
||||
wired_secrets_get_secrets(NMDeviceEthernet * self,
|
||||
const char * setting_name,
|
||||
wired_secrets_get_secrets(NMDeviceEthernet *self,
|
||||
const char *setting_name,
|
||||
NMSecretAgentGetSecretsFlags flags)
|
||||
{
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMActRequest * req;
|
||||
NMActRequest *req;
|
||||
|
||||
wired_secrets_cancel(self);
|
||||
|
||||
|
@ -561,12 +561,12 @@ wired_secrets_get_secrets(NMDeviceEthernet * self,
|
|||
static gboolean
|
||||
supplicant_lnk_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMActRequest * req;
|
||||
NMConnection * applied_connection;
|
||||
const char * setting_name;
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMActRequest *req;
|
||||
NMConnection *applied_connection;
|
||||
const char *setting_name;
|
||||
|
||||
priv->supplicant.lnk_timeout_id = 0;
|
||||
|
||||
|
@ -613,10 +613,10 @@ time_out:
|
|||
static NMSupplicantConfig *
|
||||
build_supplicant_config(NMDeviceEthernet *self, GError **error)
|
||||
{
|
||||
const char * con_uuid;
|
||||
const char *con_uuid;
|
||||
NMSupplicantConfig *config = NULL;
|
||||
NMSetting8021x * security;
|
||||
NMConnection * connection;
|
||||
NMSetting8021x *security;
|
||||
NMConnection *connection;
|
||||
guint32 mtu;
|
||||
|
||||
connection = nm_device_get_applied_connection(NM_DEVICE(self));
|
||||
|
@ -667,7 +667,7 @@ supplicant_iface_state_is_completed(NMDeviceEthernet *self, NMSupplicantInterfac
|
|||
static void
|
||||
supplicant_iface_assoc_cb(NMSupplicantInterface *iface, GError *error, gpointer user_data)
|
||||
{
|
||||
NMDeviceEthernet * self;
|
||||
NMDeviceEthernet *self;
|
||||
NMDeviceEthernetPrivate *priv;
|
||||
|
||||
if (nm_utils_error_is_cancelled_or_disposing(error))
|
||||
|
@ -695,9 +695,9 @@ supplicant_iface_assoc_cb(NMSupplicantInterface *iface, GError *error, gpointer
|
|||
static gboolean
|
||||
supplicant_iface_start(NMDeviceEthernet *self)
|
||||
{
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
gs_unref_object NMSupplicantConfig *config = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
config = build_supplicant_config(self, &error);
|
||||
if (!config) {
|
||||
|
@ -723,8 +723,8 @@ supplicant_iface_state_cb(NMSupplicantInterface *iface,
|
|||
int disconnect_reason,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernetPrivate * priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMSupplicantInterfaceState new_state = new_state_i;
|
||||
NMSupplicantInterfaceState old_state = old_state_i;
|
||||
|
||||
|
@ -753,7 +753,7 @@ supplicant_iface_state_cb(NMSupplicantInterface *iface,
|
|||
static gboolean
|
||||
handle_auth_or_fail(NMDeviceEthernet *self, NMActRequest *req, gboolean new_secrets)
|
||||
{
|
||||
const char * setting_name;
|
||||
const char *setting_name;
|
||||
NMConnection *applied_connection;
|
||||
|
||||
if (!nm_device_auth_retries_try_next(NM_DEVICE(self)))
|
||||
|
@ -792,11 +792,11 @@ handle_auth_or_fail(NMDeviceEthernet *self, NMActRequest *req, gboolean new_secr
|
|||
static gboolean
|
||||
supplicant_connection_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMActRequest * req;
|
||||
NMSettingsConnection * connection;
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMActRequest *req;
|
||||
NMSettingsConnection *connection;
|
||||
guint64 timestamp = 0;
|
||||
gboolean new_secrets = TRUE;
|
||||
|
||||
|
@ -836,13 +836,13 @@ supplicant_connection_timeout_cb(gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
supplicant_interface_create_cb(NMSupplicantManager * supplicant_manager,
|
||||
supplicant_interface_create_cb(NMSupplicantManager *supplicant_manager,
|
||||
NMSupplMgrCreateIfaceHandle *handle,
|
||||
NMSupplicantInterface * iface,
|
||||
GError * error,
|
||||
NMSupplicantInterface *iface,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceEthernet * self;
|
||||
NMDeviceEthernet *self;
|
||||
NMDeviceEthernetPrivate *priv;
|
||||
guint timeout;
|
||||
|
||||
|
@ -897,9 +897,9 @@ link_duplex_to_platform(const char *duplex)
|
|||
static void
|
||||
link_negotiation_set(NMDevice *device)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMSettingWired * s_wired;
|
||||
NMSettingWired *s_wired;
|
||||
gboolean autoneg = TRUE;
|
||||
gboolean link_autoneg;
|
||||
NMPlatformLinkDuplexType duplex = NM_PLATFORM_LINK_DUPLEX_UNKNOWN;
|
||||
|
@ -969,7 +969,7 @@ link_negotiation_set(NMDevice *device)
|
|||
static gboolean
|
||||
pppoe_reconnect_delay(gpointer user_data)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_source_inst(&priv->ppp_data.wait_source);
|
||||
|
@ -982,7 +982,7 @@ pppoe_reconnect_delay(gpointer user_data)
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
|
||||
if (nm_device_sys_iface_state_is_external_or_assume(device)) {
|
||||
|
@ -1044,9 +1044,9 @@ static NMActStageReturn
|
|||
supplicant_check_secrets_needed(NMDeviceEthernet *self, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMConnection * connection;
|
||||
NMSetting8021x * security;
|
||||
const char * setting_name;
|
||||
NMConnection *connection;
|
||||
NMSetting8021x *security;
|
||||
const char *setting_name;
|
||||
|
||||
connection = nm_device_get_applied_connection(NM_DEVICE(self));
|
||||
g_return_val_if_fail(connection, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
@ -1123,7 +1123,7 @@ _ppp_mgr_cleanup(NMDeviceEthernet *self)
|
|||
static void
|
||||
_ppp_mgr_stage3_maybe_ready(NMDeviceEthernet *self)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
int IS_IPv4;
|
||||
|
||||
|
@ -1144,7 +1144,7 @@ static void
|
|||
_ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data, gpointer user_data)
|
||||
{
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState device_state;
|
||||
|
||||
if (callback_data->callback_type != NM_PPP_MGR_CALLBACK_TYPE_STATE_CHANGED)
|
||||
|
@ -1160,8 +1160,8 @@ _ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data,
|
|||
|
||||
if (device_state < NM_DEVICE_STATE_IP_CONFIG) {
|
||||
if (callback_data->data.state >= NM_PPP_MGR_STATE_HAVE_IFINDEX) {
|
||||
gs_free char *old_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char *old_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
if (!nm_device_take_over_link(device, callback_data->data.ifindex, &old_name, &error)) {
|
||||
_LOGW(LOGD_DEVICE | LOGD_PPP,
|
||||
|
@ -1193,9 +1193,9 @@ static void dcb_state(NMDevice *device, gboolean timeout);
|
|||
static gboolean
|
||||
dcb_carrier_timeout(gpointer user_data)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(user_data);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
|
||||
g_return_val_if_fail(nm_device_get_state(device) == NM_DEVICE_STATE_CONFIG, G_SOURCE_REMOVE);
|
||||
|
||||
|
@ -1210,10 +1210,10 @@ dcb_carrier_timeout(gpointer user_data)
|
|||
static gboolean
|
||||
dcb_configure(NMDevice *device)
|
||||
{
|
||||
NMDeviceEthernet * self = (NMDeviceEthernet *) device;
|
||||
NMDeviceEthernet *self = (NMDeviceEthernet *) device;
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMSettingDcb * s_dcb;
|
||||
GError * error = NULL;
|
||||
NMSettingDcb *s_dcb;
|
||||
GError *error = NULL;
|
||||
|
||||
nm_clear_g_source(&priv->dcb_timeout_id);
|
||||
|
||||
|
@ -1239,9 +1239,9 @@ dcb_configure(NMDevice *device)
|
|||
static gboolean
|
||||
dcb_enable(NMDevice *device)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
nm_clear_g_source(&priv->dcb_timeout_id);
|
||||
if (!nm_dcb_enable(nm_device_get_iface(device), TRUE, &error)) {
|
||||
|
@ -1266,7 +1266,7 @@ dcb_enable(NMDevice *device)
|
|||
static void
|
||||
dcb_state(NMDevice *device, gboolean timeout)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
gboolean carrier;
|
||||
|
||||
|
@ -1345,8 +1345,8 @@ static gboolean
|
|||
wake_on_lan_enable(NMDevice *device)
|
||||
{
|
||||
NMSettingWiredWakeOnLan wol;
|
||||
NMSettingWired * s_wired;
|
||||
const char * password = NULL;
|
||||
NMSettingWired *s_wired;
|
||||
const char *password = NULL;
|
||||
|
||||
s_wired = nm_device_get_applied_setting(device, NM_TYPE_SETTING_WIRED);
|
||||
|
||||
|
@ -1387,13 +1387,13 @@ found:
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMConnection * connection;
|
||||
NMSettingConnection * s_con;
|
||||
const char * connection_type;
|
||||
NMSettingDcb * s_dcb;
|
||||
NMActRequest * req;
|
||||
NMConnection *connection;
|
||||
NMSettingConnection *s_con;
|
||||
const char *connection_type;
|
||||
NMSettingDcb *s_dcb;
|
||||
NMActRequest *req;
|
||||
|
||||
connection = nm_device_get_applied_connection(device);
|
||||
g_return_val_if_fail(connection, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
@ -1409,8 +1409,8 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
if (nm_streq(connection_type, NM_SETTING_PPPOE_SETTING_NAME)) {
|
||||
if (!priv->ppp_data.ppp_mgr) {
|
||||
gs_free_error GError *error = NULL;
|
||||
NMSettingPppoe * s_pppoe;
|
||||
NMSettingPpp * s_ppp;
|
||||
NMSettingPppoe *s_pppoe;
|
||||
NMSettingPpp *s_ppp;
|
||||
|
||||
s_ppp = nm_device_get_applied_setting(device, NM_TYPE_SETTING_PPP);
|
||||
if (s_ppp) {
|
||||
|
@ -1533,7 +1533,7 @@ get_configured_mtu(NMDevice *device, NMDeviceMtuSource *out_source, gboolean *ou
|
|||
static void
|
||||
act_stage3_ip_config(NMDevice *device, int addr_family)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMPppMgrState ppp_state;
|
||||
|
||||
|
@ -1555,10 +1555,10 @@ act_stage3_ip_config(NMDevice *device, int addr_family)
|
|||
static void
|
||||
deactivate(NMDevice *device)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
NMSettingDcb * s_dcb;
|
||||
GError * error = NULL;
|
||||
NMSettingDcb *s_dcb;
|
||||
GError *error = NULL;
|
||||
int ifindex;
|
||||
|
||||
nm_clear_g_source_inst(&priv->ppp_data.wait_source);
|
||||
|
@ -1607,19 +1607,19 @@ deactivate(NMDevice *device)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingWired *s_wired;
|
||||
NMSettingPppoe *s_pppoe;
|
||||
|
||||
if (nm_streq0(nm_connection_get_connection_type(connection), NM_SETTING_VETH_SETTING_NAME)) {
|
||||
NMSettingVeth *s_veth;
|
||||
const char * peer_name = NULL;
|
||||
const char * con_peer_name = NULL;
|
||||
const char *peer_name = NULL;
|
||||
const char *con_peer_name = NULL;
|
||||
int ifindex;
|
||||
|
||||
nm_utils_complete_generic(nm_device_get_platform(device),
|
||||
|
@ -1696,16 +1696,16 @@ complete_connection(NMDevice * device,
|
|||
static NMConnection *
|
||||
new_default_connection(NMDevice *self)
|
||||
{
|
||||
NMConnection * connection;
|
||||
NMSettingsConnection *const *connections;
|
||||
NMSetting * setting;
|
||||
NMConnection *connection;
|
||||
NMSettingsConnection *const *connections;
|
||||
NMSetting *setting;
|
||||
gs_unref_hashtable GHashTable *existing_ids = NULL;
|
||||
struct udev_device * dev;
|
||||
const char * perm_hw_addr;
|
||||
const char * iface;
|
||||
const char * uprop = "0";
|
||||
gs_free char * defname = NULL;
|
||||
gs_free char * uuid = NULL;
|
||||
struct udev_device *dev;
|
||||
const char *perm_hw_addr;
|
||||
const char *iface;
|
||||
const char *uprop = "0";
|
||||
gs_free char *defname = NULL;
|
||||
gs_free char *uuid = NULL;
|
||||
guint i, n_connections;
|
||||
|
||||
perm_hw_addr = nm_device_get_permanent_hw_address(self);
|
||||
|
@ -1791,12 +1791,12 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(device);
|
||||
NMSettingWired *s_wired = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_WIRED);
|
||||
gboolean perm_hw_addr_is_fake;
|
||||
const char * perm_hw_addr;
|
||||
const char * mac = nm_device_get_hw_address(device);
|
||||
const char * mac_prop = NM_SETTING_WIRED_MAC_ADDRESS;
|
||||
const char *perm_hw_addr;
|
||||
const char *mac = nm_device_get_hw_address(device);
|
||||
const char *mac_prop = NM_SETTING_WIRED_MAC_ADDRESS;
|
||||
GHashTableIter iter;
|
||||
const char * key;
|
||||
const char * value;
|
||||
const char *key;
|
||||
const char *value;
|
||||
|
||||
g_object_set(nm_connection_get_setting_connection(connection),
|
||||
NM_SETTING_CONNECTION_TYPE,
|
||||
|
@ -1836,7 +1836,7 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
static void
|
||||
link_speed_update(NMDevice *device)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
guint32 speed;
|
||||
|
||||
|
@ -1857,7 +1857,7 @@ link_speed_update(NMDevice *device)
|
|||
static void
|
||||
carrier_changed_notify(NMDevice *device, gboolean carrier)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(device);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
|
||||
if (priv->dcb_handle_carrier_changes) {
|
||||
|
@ -1893,12 +1893,12 @@ is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
can_reapply_change(NMDevice * device,
|
||||
can_reapply_change(NMDevice *device,
|
||||
const char *setting_name,
|
||||
NMSetting * s_old,
|
||||
NMSetting * s_new,
|
||||
NMSetting *s_old,
|
||||
NMSetting *s_new,
|
||||
GHashTable *diffs,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceClass *device_class;
|
||||
|
||||
|
@ -1939,7 +1939,7 @@ reapply_connection(NMDevice *device, NMConnection *con_old, NMConnection *con_ne
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(object);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(object);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
|
||||
wired_secrets_cancel(self);
|
||||
|
@ -1958,7 +1958,7 @@ dispose(GObject *object)
|
|||
static void
|
||||
finalize(GObject *object)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(object);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(object);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
|
||||
g_clear_object(&priv->supplicant.mgr);
|
||||
|
@ -1976,7 +1976,7 @@ finalize(GObject *object)
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceEthernet * self = NM_DEVICE_ETHERNET(object);
|
||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET(object);
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -2020,9 +2020,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_wired = {
|
|||
static void
|
||||
nm_device_ethernet_class_init(NMDeviceEthernetClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
g_type_class_add_private(object_class, sizeof(NMDeviceEthernetPrivate));
|
||||
|
||||
|
@ -2083,11 +2083,11 @@ nm_device_ethernet_class_init(NMDeviceEthernetClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_ETHERNET_DEVICE_FACTORY, NMEthernetDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_ETHERNET,
|
||||
NM_DEVICE_IFACE,
|
||||
|
@ -2104,7 +2104,7 @@ create_device(NMDeviceFactory * factory,
|
|||
static gboolean
|
||||
match_connection(NMDeviceFactory *factory, NMConnection *connection)
|
||||
{
|
||||
const char * type = nm_connection_get_connection_type(connection);
|
||||
const char *type = nm_connection_get_connection_type(connection);
|
||||
NMSettingPppoe *s_pppoe;
|
||||
|
||||
if (nm_streq(type, NM_SETTING_WIRED_SETTING_NAME))
|
||||
|
|
|
@ -29,8 +29,8 @@ G_DEFINE_ABSTRACT_TYPE(NMDeviceFactory, nm_device_factory, G_TYPE_OBJECT)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
nm_device_factory_get_supported_types(NMDeviceFactory * factory,
|
||||
const NMLinkType ** out_link_types,
|
||||
nm_device_factory_get_supported_types(NMDeviceFactory *factory,
|
||||
const NMLinkType **out_link_types,
|
||||
const char *const **out_setting_types)
|
||||
{
|
||||
g_return_if_fail(NM_IS_DEVICE_FACTORY(factory));
|
||||
|
@ -50,15 +50,15 @@ nm_device_factory_start(NMDeviceFactory *factory)
|
|||
}
|
||||
|
||||
NMDevice *
|
||||
nm_device_factory_create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
nm_device_factory_create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore,
|
||||
GError ** error)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceFactoryClass *klass;
|
||||
NMDevice * device;
|
||||
NMDevice *device;
|
||||
gboolean ignore = FALSE;
|
||||
|
||||
g_return_val_if_fail(factory, NULL);
|
||||
|
@ -121,12 +121,12 @@ nm_device_factory_get_connection_parent(NMDeviceFactory *factory, NMConnection *
|
|||
|
||||
char *
|
||||
nm_device_factory_get_connection_iface(NMDeviceFactory *factory,
|
||||
NMConnection * connection,
|
||||
const char * parent_iface,
|
||||
GError ** error)
|
||||
NMConnection *connection,
|
||||
const char *parent_iface,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceFactoryClass *klass;
|
||||
char * ifname;
|
||||
char *ifname;
|
||||
|
||||
g_return_val_if_fail(factory != NULL, NULL);
|
||||
g_return_val_if_fail(connection != NULL, NULL);
|
||||
|
@ -196,9 +196,9 @@ NMDeviceFactory *
|
|||
nm_device_factory_manager_find_factory_for_connection(NMConnection *connection)
|
||||
{
|
||||
NMDeviceFactoryClass *klass;
|
||||
NMDeviceFactory * factory;
|
||||
const char * type;
|
||||
GSList * list;
|
||||
NMDeviceFactory *factory;
|
||||
const char *type;
|
||||
GSList *list;
|
||||
|
||||
g_return_val_if_fail(factories_by_setting, NULL);
|
||||
|
||||
|
@ -221,7 +221,7 @@ nm_device_factory_manager_for_each_factory(NMDeviceFactoryManagerFactoryFunc cal
|
|||
{
|
||||
GHashTableIter iter;
|
||||
NMDeviceFactory *factory;
|
||||
GSList * list_iter, *list = NULL;
|
||||
GSList *list_iter, *list = NULL;
|
||||
|
||||
if (factories_by_link) {
|
||||
g_hash_table_iter_init(&iter, factories_by_link);
|
||||
|
@ -248,14 +248,14 @@ nm_device_factory_manager_for_each_factory(NMDeviceFactoryManagerFactoryFunc cal
|
|||
}
|
||||
|
||||
static gboolean
|
||||
_add_factory(NMDeviceFactory * factory,
|
||||
const char * path,
|
||||
_add_factory(NMDeviceFactory *factory,
|
||||
const char *path,
|
||||
NMDeviceFactoryManagerFactoryFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
const NMLinkType * link_types = NULL;
|
||||
const NMLinkType *link_types = NULL;
|
||||
const char *const *setting_types = NULL;
|
||||
GSList * list, *list2;
|
||||
GSList *list, *list2;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail(factories_by_link, FALSE);
|
||||
|
@ -312,22 +312,22 @@ factories_list_unref(GSList *list)
|
|||
}
|
||||
|
||||
static void
|
||||
load_factories_from_dir(const char * dirname,
|
||||
load_factories_from_dir(const char *dirname,
|
||||
NMDeviceFactoryManagerFactoryFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceFactory *factory;
|
||||
GError * error = NULL;
|
||||
char ** path, **paths;
|
||||
GError *error = NULL;
|
||||
char **path, **paths;
|
||||
|
||||
paths = nm_utils_read_plugin_paths(dirname, PLUGIN_PREFIX);
|
||||
if (!paths)
|
||||
return;
|
||||
|
||||
for (path = paths; *path; path++) {
|
||||
GModule * plugin;
|
||||
GModule *plugin;
|
||||
NMDeviceFactoryCreateFunc create_func;
|
||||
const char * item;
|
||||
const char *item;
|
||||
|
||||
item = strrchr(*path, '/');
|
||||
g_assert(item);
|
||||
|
|
|
@ -45,8 +45,8 @@ typedef struct {
|
|||
* Returns the #NMLinkType and #NMSetting names that this plugin
|
||||
* supports. This function MUST be implemented.
|
||||
*/
|
||||
void (*get_supported_types)(NMDeviceFactory * factory,
|
||||
const NMLinkType ** out_link_types,
|
||||
void (*get_supported_types)(NMDeviceFactory *factory,
|
||||
const NMLinkType **out_link_types,
|
||||
const char *const **out_setting_types);
|
||||
|
||||
/**
|
||||
|
@ -91,8 +91,8 @@ typedef struct {
|
|||
* Returns: the interface name, or %NULL
|
||||
*/
|
||||
char *(*get_connection_iface)(NMDeviceFactory *factory,
|
||||
NMConnection * connection,
|
||||
const char * parent_iface);
|
||||
NMConnection *connection,
|
||||
const char *parent_iface);
|
||||
|
||||
/**
|
||||
* create_device:
|
||||
|
@ -112,11 +112,11 @@ typedef struct {
|
|||
*
|
||||
* Returns: the new unrealized #NMDevice, or %NULL
|
||||
*/
|
||||
NMDevice *(*create_device)(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
NMDevice *(*create_device)(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore);
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore);
|
||||
|
||||
} NMDeviceFactoryClass;
|
||||
|
||||
|
@ -143,21 +143,21 @@ typedef NMDeviceFactory *(*NMDeviceFactoryCreateFunc)(GError **error);
|
|||
/*****************************************************************************/
|
||||
|
||||
const char *nm_device_factory_get_connection_parent(NMDeviceFactory *factory,
|
||||
NMConnection * connection);
|
||||
NMConnection *connection);
|
||||
|
||||
char *nm_device_factory_get_connection_iface(NMDeviceFactory *factory,
|
||||
NMConnection * connection,
|
||||
const char * parent_iface,
|
||||
GError ** error);
|
||||
NMConnection *connection,
|
||||
const char *parent_iface,
|
||||
GError **error);
|
||||
|
||||
void nm_device_factory_start(NMDeviceFactory *factory);
|
||||
|
||||
NMDevice *nm_device_factory_create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
NMDevice *nm_device_factory_create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore,
|
||||
GError ** error);
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore,
|
||||
GError **error);
|
||||
|
||||
#define NM_DEVICE_FACTORY_DECLARE_LINK_TYPES(...) \
|
||||
{ \
|
||||
|
@ -171,14 +171,14 @@ NMDevice *nm_device_factory_create_device(NMDeviceFactory * factory,
|
|||
}
|
||||
|
||||
#define NM_DEVICE_FACTORY_DECLARE_TYPES(...) \
|
||||
static void get_supported_types(NMDeviceFactory * factory, \
|
||||
const NMLinkType ** out_link_types, \
|
||||
static void get_supported_types(NMDeviceFactory *factory, \
|
||||
const NMLinkType **out_link_types, \
|
||||
const char *const **out_setting_types) \
|
||||
{ \
|
||||
static NMLinkType const _link_types_null[1] = {NM_LINK_TYPE_NONE}; \
|
||||
static const char *const _setting_types_null[1] = {NULL}; \
|
||||
\
|
||||
const NMLinkType * _link_types = _link_types_null; \
|
||||
const NMLinkType *_link_types = _link_types_null; \
|
||||
const char *const *_setting_types = _setting_types_null; \
|
||||
\
|
||||
{ \
|
||||
|
|
|
@ -58,7 +58,7 @@ get_type_description(NMDevice *device)
|
|||
static void
|
||||
realize_start_notify(NMDevice *device, const NMPlatformLink *plink)
|
||||
{
|
||||
NMDeviceGeneric * self = NM_DEVICE_GENERIC(device);
|
||||
NMDeviceGeneric *self = NM_DEVICE_GENERIC(device);
|
||||
NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE(self);
|
||||
int ifindex;
|
||||
|
||||
|
@ -112,7 +112,7 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceGeneric * self = NM_DEVICE_GENERIC(object);
|
||||
NMDeviceGeneric *self = NM_DEVICE_GENERIC(object);
|
||||
NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -128,7 +128,7 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||
static void
|
||||
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceGeneric * self = NM_DEVICE_GENERIC(object);
|
||||
NMDeviceGeneric *self = NM_DEVICE_GENERIC(object);
|
||||
NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -180,7 +180,7 @@ nm_device_generic_new(const NMPlatformLink *plink, gboolean nm_plugin_missing)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceGeneric * self = NM_DEVICE_GENERIC(object);
|
||||
NMDeviceGeneric *self = NM_DEVICE_GENERIC(object);
|
||||
NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_free(&priv->type_description);
|
||||
|
@ -202,9 +202,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_generic = {
|
|||
static void
|
||||
nm_device_generic_class_init(NMDeviceGenericClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->constructor = constructor;
|
||||
object_class->dispose = dispose;
|
||||
|
|
|
@ -63,7 +63,7 @@ act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
nm_auto_close int dirfd = -1;
|
||||
NMSettingInfiniband *s_infiniband;
|
||||
char ifname_verified[IFNAMSIZ];
|
||||
const char * transport_mode;
|
||||
const char *transport_mode;
|
||||
gboolean ok;
|
||||
|
||||
s_infiniband = nm_device_get_applied_setting(device, NM_TYPE_SETTING_INFINIBAND);
|
||||
|
@ -138,11 +138,11 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingInfiniband *s_infiniband;
|
||||
|
||||
|
@ -196,12 +196,12 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
can_reapply_change(NMDevice * device,
|
||||
can_reapply_change(NMDevice *device,
|
||||
const char *setting_name,
|
||||
NMSetting * s_old,
|
||||
NMSetting * s_new,
|
||||
NMSetting *s_old,
|
||||
NMSetting *s_new,
|
||||
GHashTable *diffs,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceClass *device_class;
|
||||
|
||||
|
@ -218,14 +218,14 @@ can_reapply_change(NMDevice * device,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceInfinibandPrivate *priv = NM_DEVICE_INFINIBAND_GET_PRIVATE(device);
|
||||
NMSettingInfiniband * s_infiniband;
|
||||
NMSettingInfiniband *s_infiniband;
|
||||
int r;
|
||||
|
||||
s_infiniband = nm_connection_get_setting_infiniband(connection);
|
||||
|
@ -366,9 +366,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_infiniband = {
|
|||
static void
|
||||
nm_device_infiniband_class_init(NMDeviceInfinibandClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
object_class->set_property = set_property;
|
||||
|
@ -409,11 +409,11 @@ nm_device_infiniband_class_init(NMDeviceInfinibandClass *klass)
|
|||
NMInfinibandDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
gboolean is_partition = FALSE;
|
||||
|
||||
|
|
|
@ -43,14 +43,14 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMDeviceIPTunnel,
|
|||
|
||||
typedef struct {
|
||||
NMIPTunnelMode mode;
|
||||
char * local;
|
||||
char * remote;
|
||||
char *local;
|
||||
char *remote;
|
||||
guint8 ttl;
|
||||
guint8 tos;
|
||||
gboolean path_mtu_discovery;
|
||||
int addr_family;
|
||||
char * input_key;
|
||||
char * output_key;
|
||||
char *input_key;
|
||||
char *output_key;
|
||||
guint8 encap_limit;
|
||||
guint32 flow_label;
|
||||
NMIPTunnelFlags flags;
|
||||
|
@ -152,7 +152,7 @@ address_set(int addr_family, char **p_addr, const NMIPAddr *addr_new)
|
|||
static void
|
||||
update_properties_from_ifindex(NMDevice *device, int ifindex)
|
||||
{
|
||||
NMDeviceIPTunnel * self = NM_DEVICE_IP_TUNNEL(device);
|
||||
NMDeviceIPTunnel *self = NM_DEVICE_IP_TUNNEL(device);
|
||||
NMDeviceIPTunnelPrivate *priv = NM_DEVICE_IP_TUNNEL_GET_PRIVATE(self);
|
||||
int parent_ifindex = 0;
|
||||
NMIPAddr local = NM_IP_ADDR_INIT;
|
||||
|
@ -163,7 +163,7 @@ update_properties_from_ifindex(NMDevice *device, int ifindex)
|
|||
gboolean pmtud = FALSE;
|
||||
guint32 flow_label = 0;
|
||||
NMIPTunnelFlags flags = NM_IP_TUNNEL_FLAG_NONE;
|
||||
char * key;
|
||||
char *key;
|
||||
|
||||
if (ifindex <= 0) {
|
||||
clear:
|
||||
|
@ -272,7 +272,7 @@ clear:
|
|||
NM_IP_TUNNEL_MODE_IP6GRE,
|
||||
NM_IP_TUNNEL_MODE_IP6GRETAP)) {
|
||||
const NMPlatformLnkIp6Tnl *lnk;
|
||||
NMPlatform * plat = nm_device_get_platform(device);
|
||||
NMPlatform *plat = nm_device_get_platform(device);
|
||||
|
||||
if (priv->mode == NM_IP_TUNNEL_MODE_IP6GRE)
|
||||
lnk = nm_platform_link_get_lnk_ip6gre(plat, ifindex, NULL);
|
||||
|
@ -383,11 +383,11 @@ link_changed(NMDevice *device, const NMPlatformLink *pllink)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingIPTunnel *s_ip_tunnel;
|
||||
|
||||
|
@ -416,9 +416,9 @@ complete_connection(NMDevice * device,
|
|||
static void
|
||||
update_connection(NMDevice *device, NMConnection *connection)
|
||||
{
|
||||
NMDeviceIPTunnel * self = NM_DEVICE_IP_TUNNEL(device);
|
||||
NMDeviceIPTunnel *self = NM_DEVICE_IP_TUNNEL(device);
|
||||
NMDeviceIPTunnelPrivate *priv = NM_DEVICE_IP_TUNNEL_GET_PRIVATE(self);
|
||||
NMSettingIPTunnel * s_ip_tunnel =
|
||||
NMSettingIPTunnel *s_ip_tunnel =
|
||||
_nm_connection_ensure_setting(connection, NM_TYPE_SETTING_IP_TUNNEL);
|
||||
|
||||
if (nm_setting_ip_tunnel_get_mode(s_ip_tunnel) != priv->mode)
|
||||
|
@ -490,10 +490,10 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
static gboolean
|
||||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceIPTunnel * self = NM_DEVICE_IP_TUNNEL(device);
|
||||
NMDeviceIPTunnel *self = NM_DEVICE_IP_TUNNEL(device);
|
||||
NMDeviceIPTunnelPrivate *priv = NM_DEVICE_IP_TUNNEL_GET_PRIVATE(self);
|
||||
NMSettingIPTunnel * s_ip_tunnel;
|
||||
const char * parent;
|
||||
NMSettingIPTunnel *s_ip_tunnel;
|
||||
const char *parent;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_ip_tunnel_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -642,23 +642,23 @@ tunnel_mode_to_link_type(NMIPTunnelMode tunnel_mode)
|
|||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
NMSettingIPTunnel * s_ip_tunnel;
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMSettingIPTunnel *s_ip_tunnel;
|
||||
NMPlatformLnkGre lnk_gre = {};
|
||||
NMPlatformLnkSit lnk_sit = {};
|
||||
NMPlatformLnkIpIp lnk_ipip = {};
|
||||
NMPlatformLnkIp6Tnl lnk_ip6tnl = {};
|
||||
const char * str;
|
||||
const char *str;
|
||||
gint64 val;
|
||||
NMIPTunnelMode mode;
|
||||
int r;
|
||||
gs_free char * hwaddr = NULL;
|
||||
gs_free char *hwaddr = NULL;
|
||||
guint8 mac_address[ETH_ALEN];
|
||||
gboolean mac_address_valid = FALSE;
|
||||
|
||||
|
@ -908,12 +908,12 @@ unrealize_notify(NMDevice *device)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
can_reapply_change(NMDevice * device,
|
||||
can_reapply_change(NMDevice *device,
|
||||
const char *setting_name,
|
||||
NMSetting * s_old,
|
||||
NMSetting * s_new,
|
||||
NMSetting *s_old,
|
||||
NMSetting *s_new,
|
||||
GHashTable *diffs,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceClass *device_class;
|
||||
|
||||
|
@ -933,7 +933,7 @@ can_reapply_change(NMDevice * device,
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceIPTunnel * self = NM_DEVICE_IP_TUNNEL(device);
|
||||
NMDeviceIPTunnel *self = NM_DEVICE_IP_TUNNEL(device);
|
||||
NMDeviceIPTunnelPrivate *priv = NM_DEVICE_IP_TUNNEL_GET_PRIVATE(self);
|
||||
|
||||
if (_nm_ip_tunnel_mode_is_layer2(priv->mode)
|
||||
|
@ -1032,7 +1032,7 @@ constructed(GObject *object)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceIPTunnel * self = NM_DEVICE_IP_TUNNEL(object);
|
||||
NMDeviceIPTunnel *self = NM_DEVICE_IP_TUNNEL(object);
|
||||
NMDeviceIPTunnelPrivate *priv = NM_DEVICE_IP_TUNNEL_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_free(&priv->local);
|
||||
|
@ -1078,9 +1078,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_ip_tunnel = {
|
|||
static void
|
||||
nm_device_ip_tunnel_class_init(NMDeviceIPTunnelClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->constructed = constructed;
|
||||
object_class->dispose = dispose;
|
||||
|
@ -1202,11 +1202,11 @@ nm_device_ip_tunnel_class_init(NMDeviceIPTunnelClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_IP_TUNNEL_DEVICE_FACTORY, NMIPTunnelDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
NMSettingIPTunnel *s_ip_tunnel;
|
||||
NMIPTunnelMode mode;
|
||||
|
@ -1255,7 +1255,7 @@ get_connection_parent(NMDeviceFactory *factory, NMConnection *connection)
|
|||
static char *
|
||||
get_connection_iface(NMDeviceFactory *factory, NMConnection *connection, const char *parent_iface)
|
||||
{
|
||||
const char * ifname;
|
||||
const char *ifname;
|
||||
NMSettingIPTunnel *s_ip_tunnel;
|
||||
|
||||
g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_IP_TUNNEL_SETTING_NAME),
|
||||
|
|
|
@ -49,9 +49,9 @@ typedef struct {
|
|||
gulong parent_mtu_id;
|
||||
|
||||
struct {
|
||||
NMSupplicantManager * mgr;
|
||||
NMSupplicantManager *mgr;
|
||||
NMSupplMgrCreateIfaceHandle *create_handle;
|
||||
NMSupplicantInterface * iface;
|
||||
NMSupplicantInterface *iface;
|
||||
|
||||
gulong iface_state_id;
|
||||
|
||||
|
@ -92,7 +92,7 @@ static NM_UTILS_LOOKUP_STR_DEFINE(validation_mode_to_string,
|
|||
NM_UTILS_LOOKUP_STR_ITEM(2, "strict"), );
|
||||
|
||||
static void
|
||||
parent_state_changed(NMDevice * parent,
|
||||
parent_state_changed(NMDevice *parent,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason,
|
||||
|
@ -126,7 +126,7 @@ parent_changed_notify(NMDevice *device,
|
|||
int new_ifindex,
|
||||
NMDevice *new_parent)
|
||||
{
|
||||
NMDeviceMacsec * self = NM_DEVICE_MACSEC(device);
|
||||
NMDeviceMacsec *self = NM_DEVICE_MACSEC(device);
|
||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
|
||||
NM_DEVICE_CLASS(nm_device_macsec_parent_class)
|
||||
|
@ -166,9 +166,9 @@ parent_changed_notify(NMDevice *device,
|
|||
static void
|
||||
update_properties(NMDevice *device)
|
||||
{
|
||||
NMDeviceMacsec * self;
|
||||
NMDeviceMacsecPrivate * priv;
|
||||
const NMPlatformLink * plink = NULL;
|
||||
NMDeviceMacsec *self;
|
||||
NMDeviceMacsecPrivate *priv;
|
||||
const NMPlatformLink *plink = NULL;
|
||||
const NMPlatformLnkMacsec *props = NULL;
|
||||
int ifindex;
|
||||
|
||||
|
@ -220,10 +220,10 @@ static NMSupplicantConfig *
|
|||
build_supplicant_config(NMDeviceMacsec *self, GError **error)
|
||||
{
|
||||
gs_unref_object NMSupplicantConfig *config = NULL;
|
||||
NMSettingMacsec * s_macsec;
|
||||
NMSetting8021x * s_8021x;
|
||||
NMConnection * connection;
|
||||
const char * con_uuid;
|
||||
NMSettingMacsec *s_macsec;
|
||||
NMSetting8021x *s_8021x;
|
||||
NMConnection *connection;
|
||||
const char *con_uuid;
|
||||
guint32 mtu;
|
||||
|
||||
connection = nm_device_get_applied_connection(NM_DEVICE(self));
|
||||
|
@ -275,14 +275,14 @@ supplicant_interface_release(NMDeviceMacsec *self)
|
|||
}
|
||||
|
||||
static void
|
||||
macsec_secrets_cb(NMActRequest * req,
|
||||
macsec_secrets_cb(NMActRequest *req,
|
||||
NMActRequestGetSecretsCallId *call_id,
|
||||
NMSettingsConnection * connection,
|
||||
GError * error,
|
||||
NMSettingsConnection *connection,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceMacsec * self = NM_DEVICE_MACSEC(user_data);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceMacsec *self = NM_DEVICE_MACSEC(user_data);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceMacsecPrivate *priv;
|
||||
|
||||
g_return_if_fail(NM_IS_DEVICE_MACSEC(self));
|
||||
|
@ -321,12 +321,12 @@ macsec_secrets_cancel(NMDeviceMacsec *self)
|
|||
}
|
||||
|
||||
static void
|
||||
macsec_secrets_get_secrets(NMDeviceMacsec * self,
|
||||
const char * setting_name,
|
||||
macsec_secrets_get_secrets(NMDeviceMacsec *self,
|
||||
const char *setting_name,
|
||||
NMSecretAgentGetSecretsFlags flags)
|
||||
{
|
||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
NMActRequest * req;
|
||||
NMActRequest *req;
|
||||
|
||||
macsec_secrets_cancel(self);
|
||||
|
||||
|
@ -341,12 +341,12 @@ macsec_secrets_get_secrets(NMDeviceMacsec * self,
|
|||
static gboolean
|
||||
supplicant_lnk_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceMacsec * self = NM_DEVICE_MACSEC(user_data);
|
||||
NMDeviceMacsec *self = NM_DEVICE_MACSEC(user_data);
|
||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
NMDevice * dev = NM_DEVICE(self);
|
||||
NMActRequest * req;
|
||||
NMConnection * applied_connection;
|
||||
const char * setting_name;
|
||||
NMDevice *dev = NM_DEVICE(self);
|
||||
NMActRequest *req;
|
||||
NMConnection *applied_connection;
|
||||
const char *setting_name;
|
||||
|
||||
priv->supplicant.lnk_timeout_id = 0;
|
||||
|
||||
|
@ -422,7 +422,7 @@ supplicant_iface_state_is_completed(NMDeviceMacsec *self, NMSupplicantInterfaceS
|
|||
static void
|
||||
supplicant_iface_assoc_cb(NMSupplicantInterface *iface, GError *error, gpointer user_data)
|
||||
{
|
||||
NMDeviceMacsec * self;
|
||||
NMDeviceMacsec *self;
|
||||
NMDeviceMacsecPrivate *priv;
|
||||
|
||||
if (nm_utils_error_is_cancelled_or_disposing(error))
|
||||
|
@ -450,9 +450,9 @@ supplicant_iface_assoc_cb(NMSupplicantInterface *iface, GError *error, gpointer
|
|||
static gboolean
|
||||
supplicant_iface_start(NMDeviceMacsec *self)
|
||||
{
|
||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
gs_unref_object NMSupplicantConfig *config = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
config = build_supplicant_config(self, &error);
|
||||
if (!config) {
|
||||
|
@ -476,8 +476,8 @@ supplicant_iface_state_cb(NMSupplicantInterface *iface,
|
|||
int disconnect_reason,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceMacsec * self = NM_DEVICE_MACSEC(user_data);
|
||||
NMDeviceMacsecPrivate * priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
NMDeviceMacsec *self = NM_DEVICE_MACSEC(user_data);
|
||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
NMSupplicantInterfaceState new_state = new_state_i;
|
||||
NMSupplicantInterfaceState old_state = old_state_i;
|
||||
|
||||
|
@ -506,7 +506,7 @@ supplicant_iface_state_cb(NMSupplicantInterface *iface,
|
|||
static gboolean
|
||||
handle_auth_or_fail(NMDeviceMacsec *self, NMActRequest *req, gboolean new_secrets)
|
||||
{
|
||||
const char * setting_name;
|
||||
const char *setting_name;
|
||||
NMConnection *applied_connection;
|
||||
|
||||
if (!nm_device_auth_retries_try_next(NM_DEVICE(self)))
|
||||
|
@ -536,11 +536,11 @@ handle_auth_or_fail(NMDeviceMacsec *self, NMActRequest *req, gboolean new_secret
|
|||
static gboolean
|
||||
supplicant_connection_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceMacsec * self = NM_DEVICE_MACSEC(user_data);
|
||||
NMDeviceMacsec *self = NM_DEVICE_MACSEC(user_data);
|
||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMActRequest * req;
|
||||
NMSettingsConnection * connection;
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMActRequest *req;
|
||||
NMSettingsConnection *connection;
|
||||
guint64 timestamp = 0;
|
||||
gboolean new_secrets = TRUE;
|
||||
|
||||
|
@ -585,13 +585,13 @@ supplicant_connection_timeout_cb(gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
supplicant_interface_create_cb(NMSupplicantManager * supplicant_manager,
|
||||
supplicant_interface_create_cb(NMSupplicantManager *supplicant_manager,
|
||||
NMSupplMgrCreateIfaceHandle *handle,
|
||||
NMSupplicantInterface * iface,
|
||||
GError * error,
|
||||
NMSupplicantInterface *iface,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceMacsec * self;
|
||||
NMDeviceMacsec *self;
|
||||
NMDeviceMacsecPrivate *priv;
|
||||
guint timeout;
|
||||
|
||||
|
@ -633,11 +633,11 @@ supplicant_interface_create_cb(NMSupplicantManager * supplicant_manager,
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceMacsec * self = NM_DEVICE_MACSEC(device);
|
||||
NMDeviceMacsec *self = NM_DEVICE_MACSEC(device);
|
||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
NMConnection * connection;
|
||||
NMDevice * parent;
|
||||
const char * setting_name;
|
||||
NMConnection *connection;
|
||||
NMDevice *parent;
|
||||
const char *setting_name;
|
||||
int ifindex;
|
||||
|
||||
connection = nm_device_get_applied_connection(NM_DEVICE(self));
|
||||
|
@ -712,17 +712,17 @@ is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
NMSettingMacsec * s_macsec;
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMSettingMacsec *s_macsec;
|
||||
NMPlatformLnkMacsec lnk = {};
|
||||
int parent_ifindex;
|
||||
const char * hw_addr;
|
||||
const char *hw_addr;
|
||||
union {
|
||||
struct {
|
||||
guint8 mac[6];
|
||||
|
@ -789,7 +789,7 @@ link_changed(NMDevice *device, const NMPlatformLink *pllink)
|
|||
}
|
||||
|
||||
static void
|
||||
device_state_changed(NMDevice * device,
|
||||
device_state_changed(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
|
@ -803,7 +803,7 @@ device_state_changed(NMDevice * device,
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceMacsec * self = NM_DEVICE_MACSEC(object);
|
||||
NMDeviceMacsec *self = NM_DEVICE_MACSEC(object);
|
||||
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -905,9 +905,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_macsec = {
|
|||
static void
|
||||
nm_device_macsec_class_init(NMDeviceMacsecClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
object_class->dispose = dispose;
|
||||
|
@ -1015,11 +1015,11 @@ nm_device_macsec_class_init(NMDeviceMacsecClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_MACSEC_DEVICE_FACTORY, NMMacsecDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_MACSEC,
|
||||
NM_DEVICE_IFACE,
|
||||
|
@ -1037,8 +1037,8 @@ static const char *
|
|||
get_connection_parent(NMDeviceFactory *factory, NMConnection *connection)
|
||||
{
|
||||
NMSettingMacsec *s_macsec;
|
||||
NMSettingWired * s_wired;
|
||||
const char * parent = NULL;
|
||||
NMSettingWired *s_wired;
|
||||
const char *parent = NULL;
|
||||
|
||||
g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_MACSEC_SETTING_NAME), NULL);
|
||||
|
||||
|
@ -1061,7 +1061,7 @@ static char *
|
|||
get_connection_iface(NMDeviceFactory *factory, NMConnection *connection, const char *parent_iface)
|
||||
{
|
||||
NMSettingMacsec *s_macsec;
|
||||
const char * ifname;
|
||||
const char *ifname;
|
||||
|
||||
g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_MACSEC_SETTING_NAME), NULL);
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ platform_mode_to_string(guint mode)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
parent_state_changed(NMDevice * parent,
|
||||
parent_state_changed(NMDevice *parent,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason,
|
||||
|
@ -137,7 +137,7 @@ parent_changed_notify(NMDevice *device,
|
|||
int new_ifindex,
|
||||
NMDevice *new_parent)
|
||||
{
|
||||
NMDeviceMacvlan * self = NM_DEVICE_MACVLAN(device);
|
||||
NMDeviceMacvlan *self = NM_DEVICE_MACVLAN(device);
|
||||
NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE(self);
|
||||
|
||||
NM_DEVICE_CLASS(nm_device_macvlan_parent_class)
|
||||
|
@ -177,11 +177,11 @@ parent_changed_notify(NMDevice *device,
|
|||
static void
|
||||
update_properties(NMDevice *device)
|
||||
{
|
||||
NMDeviceMacvlan * self = NM_DEVICE_MACVLAN(device);
|
||||
NMDeviceMacvlanPrivate * priv = NM_DEVICE_MACVLAN_GET_PRIVATE(self);
|
||||
GObject * object = G_OBJECT(device);
|
||||
NMDeviceMacvlan *self = NM_DEVICE_MACVLAN(device);
|
||||
NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE(self);
|
||||
GObject *object = G_OBJECT(device);
|
||||
const NMPlatformLnkMacvlan *props;
|
||||
const NMPlatformLink * plink;
|
||||
const NMPlatformLink *plink;
|
||||
|
||||
if (priv->props.tap)
|
||||
props = nm_platform_link_get_lnk_macvtap(nm_device_get_platform(device),
|
||||
|
@ -227,14 +227,14 @@ link_changed(NMDevice *device, const NMPlatformLink *pllink)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
NMSettingMacvlan * s_macvlan;
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMSettingMacvlan *s_macvlan;
|
||||
NMPlatformLnkMacvlan lnk = {};
|
||||
int parent_ifindex;
|
||||
int r;
|
||||
|
@ -311,8 +311,8 @@ static gboolean
|
|||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE(device);
|
||||
NMSettingMacvlan * s_macvlan;
|
||||
const char * parent = NULL;
|
||||
NMSettingMacvlan *s_macvlan;
|
||||
const char *parent = NULL;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_macvlan_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -373,11 +373,11 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingMacvlan *s_macvlan;
|
||||
|
||||
|
@ -420,7 +420,7 @@ static void
|
|||
update_connection(NMDevice *device, NMConnection *connection)
|
||||
{
|
||||
NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE(device);
|
||||
NMSettingMacvlan * s_macvlan =
|
||||
NMSettingMacvlan *s_macvlan =
|
||||
_nm_connection_ensure_setting(connection, NM_TYPE_SETTING_MACVLAN);
|
||||
int new_mode;
|
||||
|
||||
|
@ -510,9 +510,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_macvlan = {
|
|||
static void
|
||||
nm_device_macvlan_class_init(NMDeviceMacvlanClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
#if NM_MORE_ASSERTS
|
||||
object_class->dispose = dispose;
|
||||
|
@ -569,11 +569,11 @@ nm_device_macvlan_class_init(NMDeviceMacvlanClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_MACVLAN_DEVICE_FACTORY, NMMacvlanDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
NMSettingMacvlan *s_macvlan;
|
||||
NMLinkType link_type;
|
||||
|
@ -608,8 +608,8 @@ static const char *
|
|||
get_connection_parent(NMDeviceFactory *factory, NMConnection *connection)
|
||||
{
|
||||
NMSettingMacvlan *s_macvlan;
|
||||
NMSettingWired * s_wired;
|
||||
const char * parent = NULL;
|
||||
NMSettingWired *s_wired;
|
||||
const char *parent = NULL;
|
||||
|
||||
g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_MACVLAN_SETTING_NAME), NULL);
|
||||
|
||||
|
@ -632,7 +632,7 @@ static char *
|
|||
get_connection_iface(NMDeviceFactory *factory, NMConnection *connection, const char *parent_iface)
|
||||
{
|
||||
NMSettingMacvlan *s_macvlan;
|
||||
const char * ifname;
|
||||
const char *ifname;
|
||||
|
||||
g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_MACVLAN_SETTING_NAME), NULL);
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ _ppp_mgr_cleanup(NMDevicePpp *self)
|
|||
static void
|
||||
_ppp_mgr_stage3_maybe_ready(NMDevicePpp *self)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDevicePppPrivate *priv = NM_DEVICE_PPP_GET_PRIVATE(self);
|
||||
int IS_IPv4;
|
||||
|
||||
|
@ -80,8 +80,8 @@ _ppp_mgr_stage3_maybe_ready(NMDevicePpp *self)
|
|||
static void
|
||||
_ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data, gpointer user_data)
|
||||
{
|
||||
NMDevicePpp * self = NM_DEVICE_PPP(user_data);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevicePpp *self = NM_DEVICE_PPP(user_data);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState device_state;
|
||||
|
||||
if (callback_data->callback_type != NM_PPP_MGR_CALLBACK_TYPE_STATE_CHANGED)
|
||||
|
@ -97,8 +97,8 @@ _ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data,
|
|||
|
||||
if (device_state < NM_DEVICE_STATE_IP_CONFIG) {
|
||||
if (callback_data->data.state >= NM_PPP_MGR_STATE_HAVE_IFINDEX) {
|
||||
gs_free char *old_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char *old_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
if (!nm_device_take_over_link(device, callback_data->data.ifindex, &old_name, &error)) {
|
||||
_LOGW(LOGD_DEVICE | LOGD_PPP,
|
||||
|
@ -148,10 +148,10 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDevicePpp * self = NM_DEVICE_PPP(device);
|
||||
NMDevicePpp *self = NM_DEVICE_PPP(device);
|
||||
NMDevicePppPrivate *priv = NM_DEVICE_PPP_GET_PRIVATE(self);
|
||||
NMSettingPppoe * s_pppoe;
|
||||
NMActRequest * req;
|
||||
NMSettingPppoe *s_pppoe;
|
||||
NMActRequest *req;
|
||||
|
||||
if (!priv->ppp_mgr) {
|
||||
gs_free_error GError *error = NULL;
|
||||
|
@ -191,7 +191,7 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
static void
|
||||
act_stage3_ip_config(NMDevice *device, int addr_family)
|
||||
{
|
||||
NMDevicePpp * self = NM_DEVICE_PPP(device);
|
||||
NMDevicePpp *self = NM_DEVICE_PPP(device);
|
||||
NMDevicePppPrivate *priv = NM_DEVICE_PPP_GET_PRIVATE(self);
|
||||
NMPppMgrState ppp_state;
|
||||
|
||||
|
@ -229,11 +229,11 @@ get_ip_method_auto(NMDevice *device, int addr_family)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
int parent_ifindex;
|
||||
|
||||
|
@ -286,9 +286,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_ppp = {
|
|||
static void
|
||||
nm_device_ppp_class_init(NMDevicePppClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
||||
|
@ -314,11 +314,11 @@ nm_device_ppp_class_init(NMDevicePppClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_PPP_DEVICE_FACTORY, NMPppDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_PPP,
|
||||
NM_DEVICE_IFACE,
|
||||
|
|
|
@ -43,7 +43,7 @@ void nm_device_take_down(NMDevice *self, gboolean block);
|
|||
|
||||
gboolean nm_device_take_over_link(NMDevice *self, int ifindex, char **old_name, GError **error);
|
||||
|
||||
gboolean nm_device_hw_addr_set(NMDevice * device,
|
||||
gboolean nm_device_hw_addr_set(NMDevice *device,
|
||||
const char *addr,
|
||||
const char *detail,
|
||||
gboolean set_permanent);
|
||||
|
@ -66,7 +66,7 @@ void nm_device_master_release_slaves(NMDevice *self);
|
|||
void nm_device_set_carrier(NMDevice *self, gboolean carrier);
|
||||
|
||||
void nm_device_queue_recheck_assume(NMDevice *device);
|
||||
void nm_device_queue_recheck_available(NMDevice * device,
|
||||
void nm_device_queue_recheck_available(NMDevice *device,
|
||||
NMDeviceStateReason available_reason,
|
||||
NMDeviceStateReason unavailable_reason);
|
||||
|
||||
|
@ -74,14 +74,14 @@ gboolean nm_device_hw_addr_is_explict(NMDevice *device);
|
|||
|
||||
NMDeviceIPState nm_device_devip_get_state(NMDevice *self, int addr_family);
|
||||
|
||||
void nm_device_devip_set_state_full(NMDevice * self,
|
||||
void nm_device_devip_set_state_full(NMDevice *self,
|
||||
int addr_family,
|
||||
NMDeviceIPState ip_state,
|
||||
const NML3ConfigData *l3cd,
|
||||
NMDeviceStateReason failed_reason);
|
||||
|
||||
static inline void
|
||||
nm_device_devip_set_state(NMDevice * self,
|
||||
nm_device_devip_set_state(NMDevice *self,
|
||||
int addr_family,
|
||||
NMDeviceIPState ip_state,
|
||||
const NML3ConfigData *l3cd)
|
||||
|
@ -104,14 +104,14 @@ nm_device_devip_set_failed(NMDevice *self, int addr_family, NMDeviceStateReason
|
|||
nm_device_devip_set_state_full(self, addr_family, NM_DEVICE_IP_STATE_FAILED, NULL, reason);
|
||||
}
|
||||
|
||||
gboolean nm_device_sysctl_ip_conf_set(NMDevice * self,
|
||||
gboolean nm_device_sysctl_ip_conf_set(NMDevice *self,
|
||||
int addr_family,
|
||||
const char *property,
|
||||
const char *value);
|
||||
|
||||
NML3ConfigData *nm_device_create_l3_config_data(NMDevice *self, NMIPConfigSource source);
|
||||
|
||||
const NML3ConfigData *nm_device_create_l3_config_data_from_connection(NMDevice * self,
|
||||
const NML3ConfigData *nm_device_create_l3_config_data_from_connection(NMDevice *self,
|
||||
NMConnection *connection);
|
||||
|
||||
void nm_device_ip_method_dhcp4_start(NMDevice *self);
|
||||
|
@ -120,21 +120,21 @@ void nm_device_ip_method_autoconf6_start(NMDevice *self);
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
gint64 nm_device_get_configured_mtu_from_connection_default(NMDevice * self,
|
||||
gint64 nm_device_get_configured_mtu_from_connection_default(NMDevice *self,
|
||||
const char *property_name,
|
||||
guint32 max_mtu);
|
||||
|
||||
guint32 nm_device_get_configured_mtu_from_connection(NMDevice * device,
|
||||
guint32 nm_device_get_configured_mtu_from_connection(NMDevice *device,
|
||||
GType setting_type,
|
||||
NMDeviceMtuSource *out_source);
|
||||
|
||||
guint32 nm_device_get_configured_mtu_for_wired(NMDevice * self,
|
||||
guint32 nm_device_get_configured_mtu_for_wired(NMDevice *self,
|
||||
NMDeviceMtuSource *out_source,
|
||||
gboolean * out_force);
|
||||
gboolean *out_force);
|
||||
|
||||
guint32 nm_device_get_configured_mtu_wired_parent(NMDevice * self,
|
||||
guint32 nm_device_get_configured_mtu_wired_parent(NMDevice *self,
|
||||
NMDeviceMtuSource *out_source,
|
||||
gboolean * out_force);
|
||||
gboolean *out_force);
|
||||
|
||||
void nm_device_commit_mtu(NMDevice *self);
|
||||
|
||||
|
@ -150,26 +150,26 @@ void nm_device_commit_mtu(NMDevice *self);
|
|||
_types; \
|
||||
}))
|
||||
|
||||
gboolean _nm_device_hash_check_invalid_keys(GHashTable * hash,
|
||||
const char * setting_name,
|
||||
GError ** error,
|
||||
gboolean _nm_device_hash_check_invalid_keys(GHashTable *hash,
|
||||
const char *setting_name,
|
||||
GError **error,
|
||||
const char *const *whitelist);
|
||||
#define nm_device_hash_check_invalid_keys(hash, setting_name, error, ...) \
|
||||
_nm_device_hash_check_invalid_keys(hash, setting_name, error, NM_MAKE_STRV(__VA_ARGS__))
|
||||
|
||||
gboolean nm_device_match_parent(NMDevice *device, const char *parent);
|
||||
gboolean nm_device_match_parent_hwaddr(NMDevice * device,
|
||||
gboolean nm_device_match_parent_hwaddr(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
gboolean fail_if_no_hwaddr);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void nm_device_auth_request(NMDevice * self,
|
||||
GDBusMethodInvocation * context,
|
||||
NMConnection * connection,
|
||||
const char * permission,
|
||||
void nm_device_auth_request(NMDevice *self,
|
||||
GDBusMethodInvocation *context,
|
||||
NMConnection *connection,
|
||||
const char *permission,
|
||||
gboolean allow_interaction,
|
||||
GCancellable * cancellable,
|
||||
GCancellable *cancellable,
|
||||
NMManagerDeviceAuthRequestFunc callback,
|
||||
gpointer user_data);
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ G_DEFINE_TYPE(NMDeviceTun, nm_device_tun, NM_TYPE_DEVICE)
|
|||
static void
|
||||
update_properties_from_struct(NMDeviceTun *self, const NMPlatformLnkTun *props)
|
||||
{
|
||||
NMDeviceTunPrivate * priv = NM_DEVICE_TUN_GET_PRIVATE(self);
|
||||
NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE(self);
|
||||
const NMPlatformLnkTun props0 = {};
|
||||
|
||||
if (!props) {
|
||||
|
@ -128,11 +128,11 @@ link_changed(NMDevice *device, const NMPlatformLink *pllink)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingTun *s_tun;
|
||||
|
||||
|
@ -161,12 +161,12 @@ complete_connection(NMDevice * device,
|
|||
static void
|
||||
update_connection(NMDevice *device, NMConnection *connection)
|
||||
{
|
||||
NMDeviceTun * self = NM_DEVICE_TUN(device);
|
||||
NMDeviceTun *self = NM_DEVICE_TUN(device);
|
||||
NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE(self);
|
||||
NMSettingTun * s_tun;
|
||||
NMSettingTun *s_tun;
|
||||
NMSettingTunMode mode;
|
||||
char s_buf[100];
|
||||
const char * str;
|
||||
const char *str;
|
||||
|
||||
/* Note: since we read tun properties from sysctl for older kernels,
|
||||
* we don't get proper change notifications. Make sure that all our
|
||||
|
@ -216,15 +216,15 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMPlatformLnkTun props = {};
|
||||
NMSettingTun * s_tun;
|
||||
NMSettingTun *s_tun;
|
||||
gint64 owner;
|
||||
gint64 group;
|
||||
int r;
|
||||
|
@ -286,10 +286,10 @@ _same_og(const char *str, gboolean og_valid, guint32 og_num)
|
|||
static gboolean
|
||||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceTun * self = NM_DEVICE_TUN(device);
|
||||
NMDeviceTun *self = NM_DEVICE_TUN(device);
|
||||
NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE(self);
|
||||
NMSettingTunMode mode;
|
||||
NMSettingTun * s_tun;
|
||||
NMSettingTun *s_tun;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_tun_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -360,7 +360,7 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceTun * self = NM_DEVICE_TUN(device);
|
||||
NMDeviceTun *self = NM_DEVICE_TUN(device);
|
||||
NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE(self);
|
||||
|
||||
if (priv->props.type == IFF_TUN) {
|
||||
|
@ -389,9 +389,9 @@ unrealize_notify(NMDevice *device)
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceTun * self = NM_DEVICE_TUN(object);
|
||||
NMDeviceTun *self = NM_DEVICE_TUN(object);
|
||||
NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE(self);
|
||||
const char * s;
|
||||
const char *s;
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_OWNER:
|
||||
|
@ -457,9 +457,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_tun = {
|
|||
static void
|
||||
nm_device_tun_class_init(NMDeviceTunClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
|
||||
|
@ -530,11 +530,11 @@ nm_device_tun_class_init(NMDeviceTunClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_TUN_DEVICE_FACTORY, NMTunDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
g_return_val_if_fail(!plink || plink->type == NM_LINK_TYPE_TUN, NULL);
|
||||
g_return_val_if_fail(!connection
|
||||
|
|
|
@ -165,7 +165,7 @@ typedef struct {
|
|||
int addr_family;
|
||||
NMIPAddr address;
|
||||
gulong cancellable_id;
|
||||
GTask * task;
|
||||
GTask *task;
|
||||
NMDnsSystemdResolvedResolveHandle *resolved_handle;
|
||||
} ResolveAddrInfo;
|
||||
|
||||
|
@ -218,9 +218,9 @@ resolve_addr_complete(ResolveAddrInfo *info, char *hostname_take, GError *error_
|
|||
static void
|
||||
resolve_addr_helper_cb(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
ResolveAddrInfo *info = user_data;
|
||||
ResolveAddrInfo *info = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char * output = NULL;
|
||||
gs_free char *output = NULL;
|
||||
|
||||
output = nm_utils_spawn_helper_finish(result, &error);
|
||||
if (nm_utils_error_is_cancelled(error))
|
||||
|
@ -245,12 +245,12 @@ resolve_addr_spawn_helper(ResolveAddrInfo *info)
|
|||
}
|
||||
|
||||
static void
|
||||
resolve_addr_resolved_cb(NMDnsSystemdResolved * resolved,
|
||||
NMDnsSystemdResolvedResolveHandle * handle,
|
||||
resolve_addr_resolved_cb(NMDnsSystemdResolved *resolved,
|
||||
NMDnsSystemdResolvedResolveHandle *handle,
|
||||
const NMDnsSystemdResolvedAddressResult *names,
|
||||
guint names_len,
|
||||
guint64 flags,
|
||||
GError * error,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
ResolveAddrInfo *info = user_data;
|
||||
|
@ -300,7 +300,7 @@ static void
|
|||
resolve_addr_cancelled(GObject *object, gpointer user_data)
|
||||
{
|
||||
ResolveAddrInfo *info = user_data;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
nm_clear_g_signal_handler(g_task_get_cancellable(info->task), &info->cancellable_id);
|
||||
nm_clear_pointer(&info->resolved_handle, nm_dns_systemd_resolved_resolve_cancel);
|
||||
|
@ -311,11 +311,11 @@ resolve_addr_cancelled(GObject *object, gpointer user_data)
|
|||
void
|
||||
nm_device_resolve_address(int addr_family,
|
||||
gconstpointer address,
|
||||
GCancellable * cancellable,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer cb_data)
|
||||
{
|
||||
ResolveAddrInfo * info;
|
||||
ResolveAddrInfo *info;
|
||||
NMDnsSystemdResolved *resolved;
|
||||
|
||||
info = g_new(ResolveAddrInfo, 1);
|
||||
|
|
|
@ -86,7 +86,7 @@ const char *nm_device_ip_state_to_string(NMDeviceIPState ip_state);
|
|||
|
||||
void nm_device_resolve_address(int addr_family,
|
||||
gconstpointer address,
|
||||
GCancellable * cancellable,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer cb_data);
|
||||
|
||||
|
|
|
@ -75,13 +75,13 @@ link_changed(NMDevice *device, const NMPlatformLink *pllink)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMSettingVeth *s_veth;
|
||||
int r;
|
||||
|
||||
|
@ -143,7 +143,7 @@ static void
|
|||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceVeth *self = NM_DEVICE_VETH(object);
|
||||
NMDevice * peer;
|
||||
NMDevice *peer;
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PEER:
|
||||
|
@ -168,9 +168,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_veth = {
|
|||
static void
|
||||
nm_device_veth_class_init(NMDeviceVethClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
|
||||
|
@ -201,11 +201,11 @@ nm_device_veth_class_init(NMDeviceVethClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_VETH_DEVICE_FACTORY, NMVethDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_VETH,
|
||||
NM_DEVICE_IFACE,
|
||||
|
|
|
@ -54,7 +54,7 @@ G_DEFINE_TYPE(NMDeviceVlan, nm_device_vlan, NM_TYPE_DEVICE)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
parent_state_changed(NMDevice * parent,
|
||||
parent_state_changed(NMDevice *parent,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason,
|
||||
|
@ -84,11 +84,11 @@ parent_mtu_maybe_changed(NMDevice *parent, GParamSpec *pspec, gpointer user_data
|
|||
static void
|
||||
parent_hwaddr_maybe_changed(NMDevice *parent, GParamSpec *pspec, gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceVlan *self = NM_DEVICE_VLAN(device);
|
||||
NMConnection *connection;
|
||||
const char * old_mac;
|
||||
const char * new_mac;
|
||||
const char *old_mac;
|
||||
const char *new_mac;
|
||||
|
||||
/* Never touch assumed devices */
|
||||
if (nm_device_sys_iface_state_is_external_or_assume(device))
|
||||
|
@ -126,7 +126,7 @@ parent_changed_notify(NMDevice *device,
|
|||
int new_ifindex,
|
||||
NMDevice *new_parent)
|
||||
{
|
||||
NMDeviceVlan * self = NM_DEVICE_VLAN(device);
|
||||
NMDeviceVlan *self = NM_DEVICE_VLAN(device);
|
||||
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE(self);
|
||||
|
||||
NM_DEVICE_CLASS(nm_device_vlan_parent_class)
|
||||
|
@ -175,8 +175,8 @@ parent_changed_notify(NMDevice *device,
|
|||
static void
|
||||
update_properties(NMDevice *device)
|
||||
{
|
||||
NMDeviceVlanPrivate * priv;
|
||||
const NMPlatformLink * plink = NULL;
|
||||
NMDeviceVlanPrivate *priv;
|
||||
const NMPlatformLink *plink = NULL;
|
||||
const NMPlatformLnkVlan *plnk = NULL;
|
||||
int ifindex;
|
||||
int parent_ifindex = 0;
|
||||
|
@ -215,15 +215,15 @@ link_changed(NMDevice *device, const NMPlatformLink *pllink)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE(device);
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
NMSettingVlan * s_vlan;
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMSettingVlan *s_vlan;
|
||||
int parent_ifindex;
|
||||
guint vlan_id;
|
||||
int r;
|
||||
|
@ -291,7 +291,7 @@ create_and_realize(NMDevice * device,
|
|||
static void
|
||||
unrealize_notify(NMDevice *device)
|
||||
{
|
||||
NMDeviceVlan * self = NM_DEVICE_VLAN(device);
|
||||
NMDeviceVlan *self = NM_DEVICE_VLAN(device);
|
||||
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE(self);
|
||||
|
||||
NM_DEVICE_CLASS(nm_device_vlan_parent_class)->unrealize_notify(device);
|
||||
|
@ -327,8 +327,8 @@ static gboolean
|
|||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE(device);
|
||||
NMSettingVlan * s_vlan;
|
||||
const char * parent;
|
||||
NMSettingVlan *s_vlan;
|
||||
const char *parent;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_vlan_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -368,11 +368,11 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
check_connection_available(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
check_connection_available(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDeviceCheckConAvailableFlags flags,
|
||||
const char * specific_object,
|
||||
GError ** error)
|
||||
const char *specific_object,
|
||||
GError **error)
|
||||
{
|
||||
if (!nm_device_is_real(device))
|
||||
return TRUE;
|
||||
|
@ -382,11 +382,11 @@ check_connection_available(NMDevice * device,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingVlan *s_vlan;
|
||||
|
||||
|
@ -428,11 +428,11 @@ complete_connection(NMDevice * device,
|
|||
static void
|
||||
update_connection(NMDevice *device, NMConnection *connection)
|
||||
{
|
||||
NMDeviceVlanPrivate * priv = NM_DEVICE_VLAN_GET_PRIVATE(device);
|
||||
NMSettingVlan * s_vlan = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_VLAN);
|
||||
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE(device);
|
||||
NMSettingVlan *s_vlan = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_VLAN);
|
||||
int ifindex = nm_device_get_ifindex(device);
|
||||
const NMPlatformLink *plink;
|
||||
const NMPObject * polnk;
|
||||
const NMPObject *polnk;
|
||||
guint vlan_id;
|
||||
_NMVlanFlags vlan_flags;
|
||||
|
||||
|
@ -478,7 +478,7 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDevice * parent_device;
|
||||
NMDevice *parent_device;
|
||||
NMSettingVlan *s_vlan;
|
||||
|
||||
/* Change MAC address to parent's one if needed */
|
||||
|
@ -549,9 +549,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_vlan = {
|
|||
static void
|
||||
nm_device_vlan_class_init(NMDeviceVlanClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
|
||||
|
@ -595,11 +595,11 @@ nm_device_vlan_class_init(NMDeviceVlanClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_VLAN_DEVICE_FACTORY, NMVlanDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_VLAN,
|
||||
NM_DEVICE_IFACE,
|
||||
|
@ -618,9 +618,9 @@ create_device(NMDeviceFactory * factory,
|
|||
static const char *
|
||||
get_connection_parent(NMDeviceFactory *factory, NMConnection *connection)
|
||||
{
|
||||
NMSettingVlan * s_vlan;
|
||||
NMSettingVlan *s_vlan;
|
||||
NMSettingWired *s_wired;
|
||||
const char * parent = NULL;
|
||||
const char *parent = NULL;
|
||||
|
||||
g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_VLAN_SETTING_NAME), NULL);
|
||||
|
||||
|
@ -642,7 +642,7 @@ get_connection_parent(NMDeviceFactory *factory, NMConnection *connection)
|
|||
static char *
|
||||
get_connection_iface(NMDeviceFactory *factory, NMConnection *connection, const char *parent_iface)
|
||||
{
|
||||
const char * ifname;
|
||||
const char *ifname;
|
||||
NMSettingVlan *s_vlan;
|
||||
|
||||
g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_VLAN_SETTING_NAME), NULL);
|
||||
|
|
|
@ -44,7 +44,7 @@ static void
|
|||
do_update_properties(NMDeviceVrf *self, const NMPlatformLnkVrf *props)
|
||||
{
|
||||
NMDeviceVrfPrivate *priv = NM_DEVICE_VRF_GET_PRIVATE(self);
|
||||
GObject * object = G_OBJECT(self);
|
||||
GObject *object = G_OBJECT(self);
|
||||
NMPlatformLnkVrf props_null;
|
||||
|
||||
if (!props) {
|
||||
|
@ -72,7 +72,7 @@ do_update_properties(NMDeviceVrf *self, const NMPlatformLnkVrf *props)
|
|||
static void
|
||||
update_properties(NMDevice *device)
|
||||
{
|
||||
NMDeviceVrf * self = NM_DEVICE_VRF(device);
|
||||
NMDeviceVrf *self = NM_DEVICE_VRF(device);
|
||||
const NMPlatformLnkVrf *props;
|
||||
|
||||
props = nm_platform_link_get_lnk_vrf(nm_device_get_platform(device),
|
||||
|
@ -110,15 +110,15 @@ unrealize_notify(NMDevice *device)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMPlatformLnkVrf props = {};
|
||||
NMSettingVrf * s_vrf;
|
||||
NMSettingVrf *s_vrf;
|
||||
int r;
|
||||
|
||||
s_vrf = _nm_connection_get_setting(connection, NM_TYPE_SETTING_VRF);
|
||||
|
@ -145,7 +145,7 @@ static gboolean
|
|||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceVrfPrivate *priv = NM_DEVICE_VRF_GET_PRIVATE(device);
|
||||
NMSettingVrf * s_vrf;
|
||||
NMSettingVrf *s_vrf;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_vrf_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -166,11 +166,11 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingVrf *s_vrf;
|
||||
|
||||
|
@ -200,7 +200,7 @@ static void
|
|||
update_connection(NMDevice *device, NMConnection *connection)
|
||||
{
|
||||
NMDeviceVrfPrivate *priv = NM_DEVICE_VRF_GET_PRIVATE(device);
|
||||
NMSettingVrf * s_vrf = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_VRF);
|
||||
NMSettingVrf *s_vrf = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_VRF);
|
||||
|
||||
if (priv->props.table != nm_setting_vrf_get_table(s_vrf))
|
||||
g_object_set(G_OBJECT(s_vrf), NM_SETTING_VRF_TABLE, priv->props.table, NULL);
|
||||
|
@ -211,7 +211,7 @@ enslave_slave(NMDevice *device, NMDevice *slave, NMConnection *connection, gbool
|
|||
{
|
||||
NMDeviceVrf *self = NM_DEVICE_VRF(device);
|
||||
gboolean success = TRUE;
|
||||
const char * slave_iface = nm_device_get_ip_iface(slave);
|
||||
const char *slave_iface = nm_device_get_ip_iface(slave);
|
||||
|
||||
nm_device_master_check_slave_physical_port(device, slave, LOGD_DEVICE);
|
||||
|
||||
|
@ -303,9 +303,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_vrf = {
|
|||
static void
|
||||
nm_device_vrf_class_init(NMDeviceVrfClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
|
||||
|
@ -344,11 +344,11 @@ nm_device_vrf_class_init(NMDeviceVrfClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_VRF_DEVICE_FACTORY, NMVrfDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_VRF,
|
||||
NM_DEVICE_IFACE,
|
||||
|
|
|
@ -64,9 +64,9 @@ G_DEFINE_TYPE(NMDeviceVxlan, nm_device_vxlan, NM_TYPE_DEVICE)
|
|||
static void
|
||||
update_properties(NMDevice *device)
|
||||
{
|
||||
NMDeviceVxlan * self = NM_DEVICE_VXLAN(device);
|
||||
NMDeviceVxlanPrivate * priv = NM_DEVICE_VXLAN_GET_PRIVATE(self);
|
||||
GObject * object = G_OBJECT(device);
|
||||
NMDeviceVxlan *self = NM_DEVICE_VXLAN(device);
|
||||
NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE(self);
|
||||
GObject *object = G_OBJECT(device);
|
||||
const NMPlatformLnkVxlan *props;
|
||||
|
||||
props = nm_platform_link_get_lnk_vxlan(nm_device_get_platform(device),
|
||||
|
@ -139,7 +139,7 @@ link_changed(NMDevice *device, const NMPlatformLink *pllink)
|
|||
static void
|
||||
unrealize_notify(NMDevice *device)
|
||||
{
|
||||
NMDeviceVxlan * self = NM_DEVICE_VXLAN(device);
|
||||
NMDeviceVxlan *self = NM_DEVICE_VXLAN(device);
|
||||
NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE(self);
|
||||
guint i;
|
||||
|
||||
|
@ -152,16 +152,16 @@ unrealize_notify(NMDevice *device)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
NMPlatformLnkVxlan props = {};
|
||||
NMSettingVxlan * s_vxlan;
|
||||
const char * str;
|
||||
NMSettingVxlan *s_vxlan;
|
||||
const char *str;
|
||||
int r;
|
||||
|
||||
s_vxlan = nm_connection_get_setting_vxlan(connection);
|
||||
|
@ -241,8 +241,8 @@ static gboolean
|
|||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE(device);
|
||||
NMSettingVxlan * s_vxlan;
|
||||
const char * parent;
|
||||
NMSettingVxlan *s_vxlan;
|
||||
const char *parent;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_vxlan_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -366,11 +366,11 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingVxlan *s_vxlan;
|
||||
|
||||
|
@ -604,9 +604,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_vxlan = {
|
|||
static void
|
||||
nm_device_vxlan_class_init(NMDeviceVxlanClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
|
||||
|
@ -744,11 +744,11 @@ nm_device_vxlan_class_init(NMDeviceVxlanClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_VXLAN_DEVICE_FACTORY, NMVxlanDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_VXLAN,
|
||||
NM_DEVICE_IFACE,
|
||||
|
@ -778,7 +778,7 @@ get_connection_parent(NMDeviceFactory *factory, NMConnection *connection)
|
|||
static char *
|
||||
get_connection_iface(NMDeviceFactory *factory, NMConnection *connection, const char *parent_iface)
|
||||
{
|
||||
const char * ifname;
|
||||
const char *ifname;
|
||||
NMSettingVxlan *s_vxlan;
|
||||
|
||||
g_return_val_if_fail(nm_connection_is_type(connection, NM_SETTING_VXLAN_SETTING_NAME), NULL);
|
||||
|
|
|
@ -179,9 +179,9 @@ static NM_UTILS_LOOKUP_STR_DEFINE(_link_config_mode_to_string,
|
|||
|
||||
static void
|
||||
_auto_default_route_get_enabled(NMSettingWireGuard *s_wg,
|
||||
NMConnection * connection,
|
||||
gboolean * out_enabled_v4,
|
||||
gboolean * out_enabled_v6)
|
||||
NMConnection *connection,
|
||||
gboolean *out_enabled_v4,
|
||||
gboolean *out_enabled_v6)
|
||||
{
|
||||
NMTernary enabled_v4;
|
||||
NMTernary enabled_v6;
|
||||
|
@ -327,7 +327,7 @@ static void
|
|||
_auto_default_route_init(NMDeviceWireGuard *self)
|
||||
{
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
NMConnection * connection;
|
||||
NMConnection *connection;
|
||||
gboolean enabled_v4 = FALSE;
|
||||
gboolean enabled_v6 = FALSE;
|
||||
gboolean refreshing_only;
|
||||
|
@ -380,12 +380,12 @@ _auto_default_route_init(NMDeviceWireGuard *self)
|
|||
static GPtrArray *
|
||||
get_extra_rules(NMDevice *device)
|
||||
{
|
||||
NMDeviceWireGuard * self = NM_DEVICE_WIREGUARD(device);
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
NMDeviceWireGuard *self = NM_DEVICE_WIREGUARD(device);
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
gs_unref_ptrarray GPtrArray *extra_rules = NULL;
|
||||
guint32 priority = 0;
|
||||
int is_ipv4;
|
||||
NMConnection * connection;
|
||||
NMConnection *connection;
|
||||
|
||||
_auto_default_route_init(self);
|
||||
|
||||
|
@ -457,7 +457,7 @@ get_extra_rules(NMDevice *device)
|
|||
static guint32
|
||||
coerce_route_table(NMDevice *device, int addr_family, guint32 route_table, gboolean is_user_config)
|
||||
{
|
||||
NMDeviceWireGuard * self = NM_DEVICE_WIREGUARD(device);
|
||||
NMDeviceWireGuard *self = NM_DEVICE_WIREGUARD(device);
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
gboolean auto_default_route_enabled;
|
||||
|
||||
|
@ -581,7 +581,7 @@ static PeerData *
|
|||
_peers_add(NMDeviceWireGuard *self, NMWireGuardPeer *peer)
|
||||
{
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
PeerData * peer_data;
|
||||
PeerData *peer_data;
|
||||
|
||||
nm_assert(peer);
|
||||
nm_assert(nm_wireguard_peer_is_sealed(peer));
|
||||
|
@ -606,9 +606,9 @@ _peers_add(NMDeviceWireGuard *self, NMWireGuardPeer *peer)
|
|||
static gboolean
|
||||
_peers_resolve_retry_timeout(gpointer user_data)
|
||||
{
|
||||
NMDeviceWireGuard * self = user_data;
|
||||
NMDeviceWireGuard *self = user_data;
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
PeerData * peer_data;
|
||||
PeerData *peer_data;
|
||||
gint64 now;
|
||||
gint64 next;
|
||||
|
||||
|
@ -684,7 +684,7 @@ _peers_resolve_retry_reschedule(NMDeviceWireGuard *self, gint64 new_next_try_at_
|
|||
|
||||
static void
|
||||
_peers_resolve_retry_reschedule_for_peer(NMDeviceWireGuard *self,
|
||||
PeerData * peer_data,
|
||||
PeerData *peer_data,
|
||||
gint64 retry_in_msec)
|
||||
{
|
||||
nm_assert(retry_in_msec >= 0);
|
||||
|
@ -726,16 +726,16 @@ _peers_retry_in_msec(PeerData *peer_data, gboolean after_failure)
|
|||
static void
|
||||
_peers_resolve_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMDeviceWireGuard * self;
|
||||
NMDeviceWireGuard *self;
|
||||
NMDeviceWireGuardPrivate *priv;
|
||||
PeerData * peer_data;
|
||||
gs_free_error GError *resolv_error = NULL;
|
||||
GList * list;
|
||||
gboolean changed;
|
||||
NMSockAddrUnion sockaddr;
|
||||
gint64 retry_in_msec;
|
||||
char s_sockaddr[100];
|
||||
char s_retry[100];
|
||||
PeerData *peer_data;
|
||||
gs_free_error GError *resolv_error = NULL;
|
||||
GList *list;
|
||||
gboolean changed;
|
||||
NMSockAddrUnion sockaddr;
|
||||
gint64 retry_in_msec;
|
||||
char s_sockaddr[100];
|
||||
char s_retry[100];
|
||||
|
||||
list = g_resolver_lookup_by_name_finish(G_RESOLVER(source_object), res, &resolv_error);
|
||||
|
||||
|
@ -783,7 +783,7 @@ _peers_resolve_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
|||
GList *iter;
|
||||
|
||||
for (iter = list; iter; iter = iter->next) {
|
||||
GInetAddress * a = iter->data;
|
||||
GInetAddress *a = iter->data;
|
||||
NMSockAddrUnion sockaddr_tmp;
|
||||
NMSockAddrUnion *s;
|
||||
|
||||
|
@ -875,9 +875,9 @@ _peers_resolve_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
|||
static void
|
||||
_peers_resolve_start(NMDeviceWireGuard *self, PeerData *peer_data)
|
||||
{
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
gs_unref_object GResolver *resolver = NULL;
|
||||
const char * host;
|
||||
const char *host;
|
||||
|
||||
resolver = g_resolver_get_default();
|
||||
|
||||
|
@ -914,7 +914,7 @@ static void
|
|||
_peers_resolve_reresolve_all(NMDeviceWireGuard *self)
|
||||
{
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
PeerData * peer_data;
|
||||
PeerData *peer_data;
|
||||
|
||||
c_list_for_each_entry (peer_data, &priv->lst_peers_head, lst_peers) {
|
||||
if (peer_data->ep_resolv.cancellable) {
|
||||
|
@ -932,13 +932,13 @@ _peers_resolve_reresolve_all(NMDeviceWireGuard *self)
|
|||
|
||||
static gboolean
|
||||
_peers_update(NMDeviceWireGuard *self,
|
||||
PeerData * peer_data,
|
||||
NMWireGuardPeer * peer,
|
||||
PeerData *peer_data,
|
||||
NMWireGuardPeer *peer,
|
||||
gboolean force_update)
|
||||
{
|
||||
nm_auto_unref_wgpeer NMWireGuardPeer *old_peer = NULL;
|
||||
NMSockAddrEndpoint * old_endpoint;
|
||||
NMSockAddrEndpoint * endpoint;
|
||||
NMSockAddrEndpoint *old_endpoint;
|
||||
NMSockAddrEndpoint *endpoint;
|
||||
gboolean endpoint_changed = FALSE;
|
||||
gboolean changed;
|
||||
NMSockAddrUnion sockaddr;
|
||||
|
@ -1019,7 +1019,7 @@ static void
|
|||
_peers_remove_all(NMDeviceWireGuard *self)
|
||||
{
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
PeerData * peer_data;
|
||||
PeerData *peer_data;
|
||||
|
||||
while ((peer_data = c_list_first_entry(&priv->lst_peers_head, PeerData, lst_peers)))
|
||||
_peers_remove(self, peer_data);
|
||||
|
@ -1029,8 +1029,8 @@ static void
|
|||
_peers_update_all(NMDeviceWireGuard *self, NMSettingWireGuard *s_wg, gboolean *out_peers_removed)
|
||||
{
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
PeerData * peer_data_safe;
|
||||
PeerData * peer_data;
|
||||
PeerData *peer_data_safe;
|
||||
PeerData *peer_data;
|
||||
guint i, n;
|
||||
gboolean peers_removed = FALSE;
|
||||
|
||||
|
@ -1062,22 +1062,22 @@ _peers_update_all(NMDeviceWireGuard *self, NMSettingWireGuard *s_wg, gboolean *o
|
|||
}
|
||||
|
||||
static void
|
||||
_peers_get_platform_list(NMDeviceWireGuardPrivate * priv,
|
||||
_peers_get_platform_list(NMDeviceWireGuardPrivate *priv,
|
||||
LinkConfigMode config_mode,
|
||||
NMPWireGuardPeer ** out_peers,
|
||||
NMPWireGuardPeer **out_peers,
|
||||
NMPlatformWireGuardChangePeerFlags **out_peer_flags,
|
||||
guint * out_len,
|
||||
GArray ** out_allowed_ips_data)
|
||||
guint *out_len,
|
||||
GArray **out_allowed_ips_data)
|
||||
{
|
||||
gs_free NMPWireGuardPeer *plpeers = NULL;
|
||||
gs_free NMPWireGuardPeer *plpeers = NULL;
|
||||
gs_free NMPlatformWireGuardChangePeerFlags *plpeer_flags = NULL;
|
||||
gs_unref_array GArray *allowed_ips = NULL;
|
||||
PeerData * peer_data;
|
||||
guint i_good;
|
||||
guint n_aip;
|
||||
guint i_aip;
|
||||
guint len;
|
||||
guint i;
|
||||
gs_unref_array GArray *allowed_ips = NULL;
|
||||
PeerData *peer_data;
|
||||
guint i_good;
|
||||
guint n_aip;
|
||||
guint i_aip;
|
||||
guint len;
|
||||
guint i;
|
||||
|
||||
nm_assert(out_peers && !*out_peers);
|
||||
nm_assert(out_peer_flags && !*out_peer_flags);
|
||||
|
@ -1097,7 +1097,7 @@ _peers_get_platform_list(NMDeviceWireGuardPrivate * priv,
|
|||
i_good = 0;
|
||||
c_list_for_each_entry (peer_data, &priv->lst_peers_head, lst_peers) {
|
||||
NMPlatformWireGuardChangePeerFlags *plf = &plpeer_flags[i_good];
|
||||
NMPWireGuardPeer * plp = &plpeers[i_good];
|
||||
NMPWireGuardPeer *plp = &plpeers[i_good];
|
||||
NMSettingSecretFlags psk_secret_flags;
|
||||
|
||||
if (!nm_utils_base64secret_decode(nm_wireguard_peer_get_public_key(peer_data->peer),
|
||||
|
@ -1212,9 +1212,9 @@ skip:
|
|||
static void
|
||||
update_properties(NMDevice *device)
|
||||
{
|
||||
NMDeviceWireGuard * self;
|
||||
NMDeviceWireGuardPrivate * priv;
|
||||
const NMPlatformLink * plink;
|
||||
NMDeviceWireGuard *self;
|
||||
NMDeviceWireGuardPrivate *priv;
|
||||
const NMPlatformLink *plink;
|
||||
const NMPlatformLnkWireGuard *props = NULL;
|
||||
int ifindex;
|
||||
|
||||
|
@ -1274,11 +1274,11 @@ get_generic_capabilities(NMDevice *dev)
|
|||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
int r;
|
||||
|
@ -1313,14 +1313,14 @@ _secrets_cancel(NMDeviceWireGuard *self)
|
|||
}
|
||||
|
||||
static void
|
||||
_secrets_cb(NMActRequest * req,
|
||||
_secrets_cb(NMActRequest *req,
|
||||
NMActRequestGetSecretsCallId *call_id,
|
||||
NMSettingsConnection * connection,
|
||||
GError * error,
|
||||
NMSettingsConnection *connection,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceWireGuard * self = NM_DEVICE_WIREGUARD(user_data);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceWireGuard *self = NM_DEVICE_WIREGUARD(user_data);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceWireGuardPrivate *priv;
|
||||
|
||||
g_return_if_fail(NM_IS_DEVICE_WIREGUARD(self));
|
||||
|
@ -1349,13 +1349,13 @@ _secrets_cb(NMActRequest * req,
|
|||
}
|
||||
|
||||
static void
|
||||
_secrets_get_secrets(NMDeviceWireGuard * self,
|
||||
const char * setting_name,
|
||||
_secrets_get_secrets(NMDeviceWireGuard *self,
|
||||
const char *setting_name,
|
||||
NMSecretAgentGetSecretsFlags flags,
|
||||
const char *const * hints)
|
||||
const char *const *hints)
|
||||
{
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
NMActRequest * req;
|
||||
NMActRequest *req;
|
||||
|
||||
_secrets_cancel(self);
|
||||
|
||||
|
@ -1370,8 +1370,8 @@ _secrets_get_secrets(NMDeviceWireGuard * self,
|
|||
static NMActStageReturn
|
||||
_secrets_handle_auth_or_fail(NMDeviceWireGuard *self, NMActRequest *req, gboolean new_secrets)
|
||||
{
|
||||
NMConnection * applied_connection;
|
||||
const char * setting_name;
|
||||
NMConnection *applied_connection;
|
||||
const char *setting_name;
|
||||
gs_unref_ptrarray GPtrArray *hints = NULL;
|
||||
|
||||
if (!nm_device_auth_retries_try_next(NM_DEVICE(self)))
|
||||
|
@ -1416,22 +1416,22 @@ _dns_config_changed(NMDnsManager *dns_manager, NMDeviceWireGuard *self)
|
|||
/*****************************************************************************/
|
||||
|
||||
static NMActStageReturn
|
||||
link_config(NMDeviceWireGuard * self,
|
||||
const char * reason,
|
||||
link_config(NMDeviceWireGuard *self,
|
||||
const char *reason,
|
||||
LinkConfigMode config_mode,
|
||||
NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceWireGuardPrivate * priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
nm_auto_bzero_secret_ptr NMSecretPtr wg_lnk_clear_private_key = NM_SECRET_PTR_INIT();
|
||||
NMSettingWireGuard * s_wg;
|
||||
NMConnection * connection;
|
||||
NMActStageReturn ret;
|
||||
gs_unref_array GArray *allowed_ips_data = NULL;
|
||||
NMPlatformLnkWireGuard wg_lnk;
|
||||
gs_free NMPWireGuardPeer *plpeers = NULL;
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
nm_auto_bzero_secret_ptr NMSecretPtr wg_lnk_clear_private_key = NM_SECRET_PTR_INIT();
|
||||
NMSettingWireGuard *s_wg;
|
||||
NMConnection *connection;
|
||||
NMActStageReturn ret;
|
||||
gs_unref_array GArray *allowed_ips_data = NULL;
|
||||
NMPlatformLnkWireGuard wg_lnk;
|
||||
gs_free NMPWireGuardPeer *plpeers = NULL;
|
||||
gs_free NMPlatformWireGuardChangePeerFlags *plpeer_flags = NULL;
|
||||
guint plpeers_len = 0;
|
||||
const char * setting_name;
|
||||
const char *setting_name;
|
||||
gboolean peers_removed;
|
||||
NMPlatformWireGuardChangeFlags wg_change_flags;
|
||||
int ifindex;
|
||||
|
@ -1584,7 +1584,7 @@ link_config_delayed_resolver_cb(gpointer user_data)
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceWireGuard * self = NM_DEVICE_WIREGUARD(device);
|
||||
NMDeviceWireGuard *self = NM_DEVICE_WIREGUARD(device);
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
NMDeviceSysIfaceState sys_iface_state;
|
||||
NMDeviceStateReason failure_reason;
|
||||
|
@ -1629,10 +1629,10 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
static const NML3ConfigData *
|
||||
_get_dev2_ip_config(NMDeviceWireGuard *self, int addr_family)
|
||||
{
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
|
||||
NMConnection * connection;
|
||||
NMSettingWireGuard * s_wg;
|
||||
NMConnection *connection;
|
||||
NMSettingWireGuard *s_wg;
|
||||
guint n_peers;
|
||||
guint i;
|
||||
int ip_ifindex;
|
||||
|
@ -1694,7 +1694,7 @@ _get_dev2_ip_config(NMDeviceWireGuard *self, int addr_family)
|
|||
for (j = 0; j < n_aips; j++) {
|
||||
NMPlatformIPXRoute rt;
|
||||
NMIPAddr addrbin;
|
||||
const char * aip;
|
||||
const char *aip;
|
||||
gboolean valid;
|
||||
int prefix;
|
||||
guint32 rtable_coerced;
|
||||
|
@ -1815,7 +1815,7 @@ _device_cleanup(NMDeviceWireGuard *self)
|
|||
}
|
||||
|
||||
static void
|
||||
device_state_changed(NMDevice * device,
|
||||
device_state_changed(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
|
@ -1829,12 +1829,12 @@ device_state_changed(NMDevice * device,
|
|||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
can_reapply_change(NMDevice * device,
|
||||
can_reapply_change(NMDevice *device,
|
||||
const char *setting_name,
|
||||
NMSetting * s_old,
|
||||
NMSetting * s_new,
|
||||
NMSetting *s_old,
|
||||
NMSetting *s_new,
|
||||
GHashTable *diffs,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
if (nm_streq(setting_name, NM_SETTING_WIREGUARD_SETTING_NAME)) {
|
||||
/* Most, but not all WireGuard settings can be reapplied. Whitelist.
|
||||
|
@ -1860,7 +1860,7 @@ can_reapply_change(NMDevice * device,
|
|||
static void
|
||||
reapply_connection(NMDevice *device, NMConnection *con_old, NMConnection *con_new)
|
||||
{
|
||||
NMDeviceWireGuard * self = NM_DEVICE_WIREGUARD(device);
|
||||
NMDeviceWireGuard *self = NM_DEVICE_WIREGUARD(device);
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
NMDeviceState state = nm_device_get_state(device);
|
||||
|
||||
|
@ -1890,7 +1890,7 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
{
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(device);
|
||||
NMSettingWireGuard *s_wg = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_WIREGUARD);
|
||||
const NMPObject * obj_wg;
|
||||
const NMPObject *obj_wg;
|
||||
const NMPObjectLnkWireGuard *olnk_wg;
|
||||
guint i;
|
||||
|
||||
|
@ -1911,7 +1911,7 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
|
||||
for (i = 0; i < olnk_wg->peers_len; i++) {
|
||||
nm_auto_unref_wgpeer NMWireGuardPeer *peer = NULL;
|
||||
const NMPWireGuardPeer * ppeer = &olnk_wg->peers[i];
|
||||
const NMPWireGuardPeer *ppeer = &olnk_wg->peers[i];
|
||||
|
||||
peer = nm_wireguard_peer_new();
|
||||
|
||||
|
@ -1926,7 +1926,7 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceWireGuard * self = NM_DEVICE_WIREGUARD(object);
|
||||
NMDeviceWireGuard *self = NM_DEVICE_WIREGUARD(object);
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -1971,7 +1971,7 @@ dispose(GObject *object)
|
|||
static void
|
||||
finalize(GObject *object)
|
||||
{
|
||||
NMDeviceWireGuard * self = NM_DEVICE_WIREGUARD(object);
|
||||
NMDeviceWireGuard *self = NM_DEVICE_WIREGUARD(object);
|
||||
NMDeviceWireGuardPrivate *priv = NM_DEVICE_WIREGUARD_GET_PRIVATE(self);
|
||||
|
||||
nm_explicit_bzero(priv->lnk_curr.private_key, sizeof(priv->lnk_curr.private_key));
|
||||
|
@ -2004,9 +2004,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_wireguard = {
|
|||
static void
|
||||
nm_device_wireguard_class_init(NMDeviceWireGuardClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
object_class->dispose = dispose;
|
||||
|
@ -2066,11 +2066,11 @@ nm_device_wireguard_class_init(NMDeviceWireGuardClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_WIREGUARD_DEVICE_FACTORY, NMWireGuardDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_WIREGUARD,
|
||||
NM_DEVICE_IFACE,
|
||||
|
|
|
@ -38,11 +38,11 @@ G_DEFINE_TYPE(NMDeviceWpan, nm_device_wpan, NM_TYPE_DEVICE)
|
|||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingWpan *s_wpan;
|
||||
|
||||
|
@ -78,7 +78,7 @@ static gboolean
|
|||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMSettingWpan *s_wpan;
|
||||
const char * mac, *hw_addr;
|
||||
const char *mac, *hw_addr;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_wpan_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -103,17 +103,17 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceWpan * self = NM_DEVICE_WPAN(device);
|
||||
NMSettingWpan * s_wpan;
|
||||
NMPlatform * platform;
|
||||
NMDeviceWpan *self = NM_DEVICE_WPAN(device);
|
||||
NMSettingWpan *s_wpan;
|
||||
NMPlatform *platform;
|
||||
guint16 pan_id;
|
||||
guint16 short_address;
|
||||
gint16 page, channel;
|
||||
int ifindex;
|
||||
const guint8 * hwaddr;
|
||||
const guint8 *hwaddr;
|
||||
gsize hwaddr_len = 0;
|
||||
const NMPlatformLink *lowpan_plink;
|
||||
NMDevice * lowpan_device = NULL;
|
||||
NMDevice *lowpan_device = NULL;
|
||||
NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE;
|
||||
|
||||
platform = nm_device_get_platform(device);
|
||||
|
@ -202,7 +202,7 @@ static const NMDBusInterfaceInfoExtended interface_info_device_wpan = {
|
|||
static void
|
||||
nm_device_wpan_class_init(NMDeviceWpanClass *klass)
|
||||
{
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
|
||||
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS(&interface_info_device_wpan);
|
||||
|
@ -224,11 +224,11 @@ nm_device_wpan_class_init(NMDeviceWpanClass *klass)
|
|||
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_WPAN_DEVICE_FACTORY, NMWpanDeviceFactory))
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return g_object_new(NM_TYPE_DEVICE_WPAN,
|
||||
NM_DEVICE_IFACE,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -170,7 +170,7 @@ typedef struct _NMDeviceClass {
|
|||
NMDBusObjectClass parent;
|
||||
|
||||
struct _NMDeviceClass *default_type_description_klass;
|
||||
const char * default_type_description;
|
||||
const char *default_type_description;
|
||||
|
||||
const char *connection_type_supported;
|
||||
|
||||
|
@ -209,7 +209,7 @@ typedef struct _NMDeviceClass {
|
|||
|
||||
bool can_reapply_change_ovs_external_ids : 1;
|
||||
|
||||
void (*state_changed)(NMDevice * device,
|
||||
void (*state_changed)(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason);
|
||||
|
@ -233,11 +233,11 @@ typedef struct _NMDeviceClass {
|
|||
*
|
||||
* Returns: %TRUE on success, %FALSE on error
|
||||
*/
|
||||
gboolean (*create_and_realize)(NMDevice * self,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
gboolean (*create_and_realize)(NMDevice *self,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
/**
|
||||
* realize_start_notify():
|
||||
|
@ -295,13 +295,13 @@ typedef struct _NMDeviceClass {
|
|||
* which emits NM_DEVICE_RECHECK_AUTO_ACTIVATE signal. */
|
||||
gboolean (*get_autoconnect_allowed)(NMDevice *self);
|
||||
|
||||
gboolean (*can_auto_connect)(NMDevice * self,
|
||||
gboolean (*can_auto_connect)(NMDevice *self,
|
||||
NMSettingsConnection *sett_conn,
|
||||
char ** specific_object);
|
||||
char **specific_object);
|
||||
|
||||
guint32 (*get_configured_mtu)(NMDevice * self,
|
||||
guint32 (*get_configured_mtu)(NMDevice *self,
|
||||
NMDeviceMtuSource *out_source,
|
||||
gboolean * out_force);
|
||||
gboolean *out_force);
|
||||
|
||||
/* allow the subclass to overwrite the routing table. This is mainly useful
|
||||
* to change from partial mode (route-table=0) to full-sync mode (route-table=254). */
|
||||
|
@ -316,9 +316,9 @@ typedef struct _NMDeviceClass {
|
|||
* only the devices type and characteristics. Does not use any live
|
||||
* network information like Wi-Fi scan lists etc.
|
||||
*/
|
||||
gboolean (*check_connection_compatible)(NMDevice * self,
|
||||
gboolean (*check_connection_compatible)(NMDevice *self,
|
||||
NMConnection *connection,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
/* Checks whether the connection is likely available to be activated,
|
||||
* including any live network information like scan lists. The connection
|
||||
|
@ -331,17 +331,17 @@ typedef struct _NMDeviceClass {
|
|||
*
|
||||
* Specifying @specific_object can only reduce the availability of a connection.
|
||||
*/
|
||||
gboolean (*check_connection_available)(NMDevice * self,
|
||||
NMConnection * connection,
|
||||
gboolean (*check_connection_available)(NMDevice *self,
|
||||
NMConnection *connection,
|
||||
NMDeviceCheckConAvailableFlags flags,
|
||||
const char * specific_object,
|
||||
GError ** error);
|
||||
const char *specific_object,
|
||||
GError **error);
|
||||
|
||||
gboolean (*complete_connection)(NMDevice * self,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
gboolean (*complete_connection)(NMDevice *self,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
NMActStageReturn (*act_stage1_prepare)(NMDevice *self, NMDeviceStateReason *out_failure_reason);
|
||||
NMActStageReturn (*act_stage2_config)(NMDevice *self, NMDeviceStateReason *out_failure_reason);
|
||||
|
@ -351,8 +351,8 @@ typedef struct _NMDeviceClass {
|
|||
const char *(*get_ip_method_auto)(NMDevice *self, int addr_family);
|
||||
|
||||
/* Async deactivating (in the DEACTIVATING phase) */
|
||||
void (*deactivate_async)(NMDevice * self,
|
||||
GCancellable * cancellable,
|
||||
void (*deactivate_async)(NMDevice *self,
|
||||
GCancellable *cancellable,
|
||||
NMDeviceDeactivateCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
|
@ -368,13 +368,13 @@ typedef struct _NMDeviceClass {
|
|||
/* Update the connection with currently configured L2 settings */
|
||||
void (*update_connection)(NMDevice *device, NMConnection *connection);
|
||||
|
||||
gboolean (*master_update_slave_connection)(NMDevice * self,
|
||||
NMDevice * slave,
|
||||
gboolean (*master_update_slave_connection)(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
gboolean (*enslave_slave)(NMDevice * self,
|
||||
NMDevice * slave,
|
||||
gboolean (*enslave_slave)(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
gboolean configure);
|
||||
|
||||
|
@ -392,12 +392,12 @@ typedef struct _NMDeviceClass {
|
|||
|
||||
gboolean (*unmanaged_on_quit)(NMDevice *self);
|
||||
|
||||
gboolean (*can_reapply_change)(NMDevice * self,
|
||||
gboolean (*can_reapply_change)(NMDevice *self,
|
||||
const char *setting_name,
|
||||
NMSetting * s_old,
|
||||
NMSetting * s_new,
|
||||
NMSetting *s_old,
|
||||
NMSetting *s_new,
|
||||
GHashTable *diffs,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
void (*reapply_connection)(NMDevice *self, NMConnection *con_old, NMConnection *con_new);
|
||||
|
||||
|
@ -416,8 +416,8 @@ typedef struct _NMDeviceClass {
|
|||
GType nm_device_get_type(void);
|
||||
|
||||
struct _NMDedupMultiIndex *nm_device_get_multi_index(NMDevice *self);
|
||||
NMNetns * nm_device_get_netns(NMDevice *self);
|
||||
NMPlatform * nm_device_get_platform(NMDevice *self);
|
||||
NMNetns *nm_device_get_netns(NMDevice *self);
|
||||
NMPlatform *nm_device_get_platform(NMDevice *self);
|
||||
|
||||
const char *nm_device_get_udi(NMDevice *dev);
|
||||
const char *nm_device_get_iface(NMDevice *dev);
|
||||
|
@ -433,13 +433,13 @@ _nm_device_get_iface(NMDevice *device)
|
|||
int nm_device_get_ifindex(NMDevice *dev);
|
||||
gboolean nm_device_is_software(NMDevice *dev);
|
||||
gboolean nm_device_is_real(NMDevice *dev);
|
||||
const char * nm_device_get_ip_iface(NMDevice *dev);
|
||||
const char * nm_device_get_ip_iface_from_platform(NMDevice *dev);
|
||||
const char *nm_device_get_ip_iface(NMDevice *dev);
|
||||
const char *nm_device_get_ip_iface_from_platform(NMDevice *dev);
|
||||
int nm_device_get_ip_ifindex(const NMDevice *dev);
|
||||
const char * nm_device_get_driver(NMDevice *dev);
|
||||
const char * nm_device_get_driver_version(NMDevice *dev);
|
||||
const char * nm_device_get_type_desc(NMDevice *dev);
|
||||
const char * nm_device_get_type_description(NMDevice *dev);
|
||||
const char *nm_device_get_driver(NMDevice *dev);
|
||||
const char *nm_device_get_driver_version(NMDevice *dev);
|
||||
const char *nm_device_get_type_desc(NMDevice *dev);
|
||||
const char *nm_device_get_type_description(NMDevice *dev);
|
||||
NMDeviceType nm_device_get_device_type(NMDevice *dev);
|
||||
NMLinkType nm_device_get_link_type(NMDevice *dev);
|
||||
NMMetered nm_device_get_metered(NMDevice *dev);
|
||||
|
@ -471,7 +471,7 @@ gboolean nm_device_parent_notify_changed(NMDevice *self,
|
|||
NMDevice *change_candidate,
|
||||
gboolean device_removed);
|
||||
|
||||
const char *nm_device_parent_find_for_connection(NMDevice * self,
|
||||
const char *nm_device_parent_find_for_connection(NMDevice *self,
|
||||
const char *current_setting_parent);
|
||||
|
||||
/* Master */
|
||||
|
@ -480,11 +480,11 @@ gboolean nm_device_is_master(NMDevice *dev);
|
|||
/* Slave */
|
||||
NMDevice *nm_device_get_master(NMDevice *dev);
|
||||
|
||||
NMActRequest * nm_device_get_act_request(NMDevice *dev);
|
||||
NMSettingsConnection * nm_device_get_settings_connection(NMDevice *dev);
|
||||
NMConnection * nm_device_get_settings_connection_get_connection(NMDevice *self);
|
||||
NMConnection * nm_device_get_applied_connection(NMDevice *dev);
|
||||
gboolean nm_device_has_unmodified_applied_connection(NMDevice * self,
|
||||
NMActRequest *nm_device_get_act_request(NMDevice *dev);
|
||||
NMSettingsConnection *nm_device_get_settings_connection(NMDevice *dev);
|
||||
NMConnection *nm_device_get_settings_connection_get_connection(NMDevice *self);
|
||||
NMConnection *nm_device_get_applied_connection(NMDevice *dev);
|
||||
gboolean nm_device_has_unmodified_applied_connection(NMDevice *self,
|
||||
NMSettingCompareFlags compare_flags);
|
||||
NMActivationStateFlags nm_device_get_activation_state_flags(NMDevice *self);
|
||||
|
||||
|
@ -500,21 +500,21 @@ gboolean nm_device_has_carrier(NMDevice *dev);
|
|||
NMConnection *nm_device_generate_connection(NMDevice *self,
|
||||
NMDevice *master,
|
||||
gboolean *out_maybe_later,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
gboolean nm_device_master_update_slave_connection(NMDevice * master,
|
||||
NMDevice * slave,
|
||||
gboolean nm_device_master_update_slave_connection(NMDevice *master,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
gboolean
|
||||
nm_device_can_auto_connect(NMDevice *self, NMSettingsConnection *sett_conn, char **specific_object);
|
||||
|
||||
gboolean nm_device_complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
gboolean nm_device_complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
gboolean
|
||||
nm_device_check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error);
|
||||
|
@ -613,11 +613,11 @@ gboolean nm_device_get_managed(NMDevice *device, gboolean for_user_reque
|
|||
NMUnmanagedFlags nm_device_get_unmanaged_mask(NMDevice *device, NMUnmanagedFlags flag);
|
||||
NMUnmanagedFlags nm_device_get_unmanaged_flags(NMDevice *device, NMUnmanagedFlags flag);
|
||||
void nm_device_set_unmanaged_flags(NMDevice *device, NMUnmanagedFlags flags, NMUnmanFlagOp set_op);
|
||||
void nm_device_set_unmanaged_by_flags(NMDevice * device,
|
||||
void nm_device_set_unmanaged_by_flags(NMDevice *device,
|
||||
NMUnmanagedFlags flags,
|
||||
NMUnmanFlagOp set_op,
|
||||
NMDeviceStateReason reason);
|
||||
void nm_device_set_unmanaged_by_flags_queue(NMDevice * self,
|
||||
void nm_device_set_unmanaged_by_flags_queue(NMDevice *self,
|
||||
NMUnmanagedFlags flags,
|
||||
NMUnmanFlagOp set_op,
|
||||
NMDeviceStateReason reason);
|
||||
|
@ -634,26 +634,26 @@ gboolean nm_device_has_capability(NMDevice *self, NMDeviceCapabilities caps);
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
void nm_device_assume_state_get(NMDevice * self,
|
||||
gboolean * out_assume_state_guess_assume,
|
||||
void nm_device_assume_state_get(NMDevice *self,
|
||||
gboolean *out_assume_state_guess_assume,
|
||||
const char **out_assume_state_connection_uuid);
|
||||
void nm_device_assume_state_reset(NMDevice *self);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
gboolean nm_device_realize_start(NMDevice * device,
|
||||
gboolean nm_device_realize_start(NMDevice *device,
|
||||
const NMPlatformLink *plink,
|
||||
gboolean assume_state_guess_assume,
|
||||
const char * assume_state_connection_uuid,
|
||||
const char *assume_state_connection_uuid,
|
||||
gboolean set_nm_owned,
|
||||
NMUnmanFlagOp unmanaged_user_explicit,
|
||||
gboolean * out_compatible,
|
||||
GError ** error);
|
||||
gboolean *out_compatible,
|
||||
GError **error);
|
||||
void nm_device_realize_finish(NMDevice *self, const NMPlatformLink *plink);
|
||||
gboolean nm_device_create_and_realize(NMDevice * self,
|
||||
gboolean nm_device_create_and_realize(NMDevice *self,
|
||||
NMConnection *connection,
|
||||
NMDevice * parent,
|
||||
GError ** error);
|
||||
NMDevice *parent,
|
||||
GError **error);
|
||||
gboolean nm_device_unrealize(NMDevice *device, gboolean remove_resources, GError **error);
|
||||
|
||||
void nm_device_update_from_platform_link(NMDevice *self, const NMPlatformLink *plink);
|
||||
|
@ -679,7 +679,7 @@ typedef enum {
|
|||
NMDeviceAutoconnectBlockedFlags
|
||||
nm_device_autoconnect_blocked_get(NMDevice *device, NMDeviceAutoconnectBlockedFlags mask);
|
||||
|
||||
void nm_device_autoconnect_blocked_set_full(NMDevice * device,
|
||||
void nm_device_autoconnect_blocked_set_full(NMDevice *device,
|
||||
NMDeviceAutoconnectBlockedFlags mask,
|
||||
NMDeviceAutoconnectBlockedFlags values);
|
||||
|
||||
|
@ -710,7 +710,7 @@ void nm_device_queue_state(NMDevice *self, NMDeviceState state, NMDeviceStateRea
|
|||
|
||||
gboolean nm_device_get_firmware_missing(NMDevice *self);
|
||||
|
||||
void nm_device_disconnect_active_connection(NMActiveConnection * active,
|
||||
void nm_device_disconnect_active_connection(NMActiveConnection *active,
|
||||
NMDeviceStateReason device_reason,
|
||||
NMActiveConnectionStateReason active_reason);
|
||||
|
||||
|
@ -733,11 +733,11 @@ nm_device_has_pending_action(NMDevice *device)
|
|||
NMSettingsConnection *
|
||||
nm_device_get_best_connection(NMDevice *device, const char *specific_object, GError **error);
|
||||
|
||||
gboolean nm_device_check_connection_available(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
gboolean nm_device_check_connection_available(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDeviceCheckConAvailableFlags flags,
|
||||
const char * specific_object,
|
||||
GError ** error);
|
||||
const char *specific_object,
|
||||
GError **error);
|
||||
|
||||
void nm_device_notify_availability_maybe_changed(NMDevice *self);
|
||||
|
||||
|
@ -761,24 +761,24 @@ guint nm_device_get_supplicant_timeout(NMDevice *self);
|
|||
|
||||
gboolean nm_device_auth_retries_try_next(NMDevice *self);
|
||||
|
||||
gboolean nm_device_hw_addr_get_cloned(NMDevice * self,
|
||||
gboolean nm_device_hw_addr_get_cloned(NMDevice *self,
|
||||
NMConnection *connection,
|
||||
gboolean is_wifi,
|
||||
char ** hwaddr,
|
||||
gboolean * preserve,
|
||||
GError ** error);
|
||||
char **hwaddr,
|
||||
gboolean *preserve,
|
||||
GError **error);
|
||||
|
||||
typedef struct _NMDeviceConnectivityHandle NMDeviceConnectivityHandle;
|
||||
|
||||
typedef void (*NMDeviceConnectivityCallback)(NMDevice * self,
|
||||
typedef void (*NMDeviceConnectivityCallback)(NMDevice *self,
|
||||
NMDeviceConnectivityHandle *handle,
|
||||
NMConnectivityState state,
|
||||
GError * error,
|
||||
GError *error,
|
||||
gpointer user_data);
|
||||
|
||||
void nm_device_check_connectivity_update_interval(NMDevice *self);
|
||||
|
||||
NMDeviceConnectivityHandle *nm_device_check_connectivity(NMDevice * self,
|
||||
NMDeviceConnectivityHandle *nm_device_check_connectivity(NMDevice *self,
|
||||
int addr_family,
|
||||
NMDeviceConnectivityCallback callback,
|
||||
gpointer user_data);
|
||||
|
@ -793,16 +793,16 @@ typedef void (*NMBtVTableRegisterCallback)(GError *error, gpointer user_data);
|
|||
|
||||
struct _NMBtVTableNetworkServer {
|
||||
gboolean (*is_available)(const NMBtVTableNetworkServer *vtable,
|
||||
const char * addr,
|
||||
NMDevice * device_accept_busy);
|
||||
const char *addr,
|
||||
NMDevice *device_accept_busy);
|
||||
|
||||
gboolean (*register_bridge)(const NMBtVTableNetworkServer *vtable,
|
||||
const char * addr,
|
||||
NMDevice * device,
|
||||
GCancellable * cancellable,
|
||||
const char *addr,
|
||||
NMDevice *device,
|
||||
GCancellable *cancellable,
|
||||
NMBtVTableRegisterCallback callback,
|
||||
gpointer callback_user_data,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
gboolean (*unregister_bridge)(const NMBtVTableNetworkServer *vtable, NMDevice *device);
|
||||
};
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
struct _NMLldpListener {
|
||||
sd_lldp_rx *lldp_handle;
|
||||
GHashTable *lldp_neighbors;
|
||||
GVariant * variant;
|
||||
GVariant *variant;
|
||||
|
||||
NMLldpListenerNotify notify_callback;
|
||||
gpointer notify_user_data;
|
||||
|
@ -49,10 +49,10 @@ struct _NMLldpListener {
|
|||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
GVariant * variant;
|
||||
GVariant *variant;
|
||||
sd_lldp_neighbor *neighbor_sd;
|
||||
char * chassis_id;
|
||||
char * port_id;
|
||||
char *chassis_id;
|
||||
char *port_id;
|
||||
guint8 chassis_id_type;
|
||||
guint8 port_id_type;
|
||||
} LldpNeighbor;
|
||||
|
@ -112,12 +112,12 @@ lldp_neighbor_get_raw(LldpNeighbor *neigh, const guint8 **out_raw_data, gsize *o
|
|||
|
||||
static gboolean
|
||||
lldp_neighbor_id_get(struct sd_lldp_neighbor *neighbor_sd,
|
||||
guint8 * out_chassis_id_type,
|
||||
const guint8 ** out_chassis_id,
|
||||
gsize * out_chassis_id_len,
|
||||
guint8 * out_port_id_type,
|
||||
const guint8 ** out_port_id,
|
||||
gsize * out_port_id_len)
|
||||
guint8 *out_chassis_id_type,
|
||||
const guint8 **out_chassis_id,
|
||||
gsize *out_chassis_id_len,
|
||||
guint8 *out_port_id_type,
|
||||
const guint8 **out_port_id,
|
||||
gsize *out_port_id_len)
|
||||
{
|
||||
int r;
|
||||
|
||||
|
@ -144,8 +144,8 @@ lldp_neighbor_id_hash(gconstpointer ptr)
|
|||
const LldpNeighbor *neigh = ptr;
|
||||
guint8 chassis_id_type;
|
||||
guint8 port_id_type;
|
||||
const guint8 * chassis_id;
|
||||
const guint8 * port_id;
|
||||
const guint8 *chassis_id;
|
||||
const guint8 *port_id;
|
||||
gsize chassis_id_len;
|
||||
gsize port_id_len;
|
||||
NMHashState h;
|
||||
|
@ -270,9 +270,9 @@ parse_management_address_tlv(const uint8_t *data, gsize len)
|
|||
{
|
||||
GVariantBuilder builder;
|
||||
gsize addr_len;
|
||||
const guint8 * v_object_id_arr;
|
||||
const guint8 *v_object_id_arr;
|
||||
gsize v_object_id_len;
|
||||
const guint8 * v_address_arr;
|
||||
const guint8 *v_address_arr;
|
||||
gsize v_address_len;
|
||||
guint32 v_interface_number;
|
||||
guint32 v_interface_number_subtype;
|
||||
|
@ -393,7 +393,7 @@ format_string(const guint8 *data, gsize len, gboolean allow_trim, char **out_to_
|
|||
static char *
|
||||
format_string_cp(const guint8 *data, gsize len, gboolean allow_trim)
|
||||
{
|
||||
char * s_free = NULL;
|
||||
char *s_free = NULL;
|
||||
const char *s;
|
||||
|
||||
s = format_string(data, len, allow_trim, &s_free);
|
||||
|
@ -482,11 +482,11 @@ lldp_neighbor_to_variant(LldpNeighbor *neigh)
|
|||
{
|
||||
struct ether_addr destination_address;
|
||||
GVariantBuilder builder;
|
||||
const char * str;
|
||||
const guint8 * raw_data;
|
||||
const char *str;
|
||||
const guint8 *raw_data;
|
||||
gsize raw_len;
|
||||
uint16_t u16;
|
||||
uint8_t * data8;
|
||||
uint8_t *data8;
|
||||
gsize len;
|
||||
int r;
|
||||
|
||||
|
@ -537,19 +537,19 @@ lldp_neighbor_to_variant(LldpNeighbor *neigh)
|
|||
else {
|
||||
gboolean v_management_addresses_has = FALSE;
|
||||
GVariantBuilder v_management_addresses;
|
||||
GVariant * v_ieee_802_1_pvid = NULL;
|
||||
GVariant * v_ieee_802_1_ppvid = NULL;
|
||||
GVariant * v_ieee_802_1_ppvid_flags = NULL;
|
||||
GVariant *v_ieee_802_1_pvid = NULL;
|
||||
GVariant *v_ieee_802_1_ppvid = NULL;
|
||||
GVariant *v_ieee_802_1_ppvid_flags = NULL;
|
||||
GVariantBuilder v_ieee_802_1_ppvids;
|
||||
GVariant * v_ieee_802_1_vid = NULL;
|
||||
GVariant * v_ieee_802_1_vlan_name = NULL;
|
||||
GVariant *v_ieee_802_1_vid = NULL;
|
||||
GVariant *v_ieee_802_1_vlan_name = NULL;
|
||||
GVariantBuilder v_ieee_802_1_vlans;
|
||||
GVariant * v_ieee_802_3_mac_phy_conf = NULL;
|
||||
GVariant * v_ieee_802_3_power_via_mdi = NULL;
|
||||
GVariant * v_ieee_802_3_max_frame_size = NULL;
|
||||
GVariant * v_mud_url = NULL;
|
||||
GVariant *v_ieee_802_3_mac_phy_conf = NULL;
|
||||
GVariant *v_ieee_802_3_power_via_mdi = NULL;
|
||||
GVariant *v_ieee_802_3_max_frame_size = NULL;
|
||||
GVariant *v_mud_url = NULL;
|
||||
GVariantBuilder tmp_builder;
|
||||
GVariant * tmp_variant;
|
||||
GVariant *tmp_variant;
|
||||
|
||||
do {
|
||||
guint8 oui[3];
|
||||
|
@ -636,7 +636,7 @@ lldp_neighbor_to_variant(LldpNeighbor *neigh)
|
|||
case SD_LLDP_OUI_802_1_SUBTYPE_VLAN_NAME:
|
||||
{
|
||||
gs_free char *name_to_free = NULL;
|
||||
const char * name;
|
||||
const char *name;
|
||||
guint32 vid;
|
||||
gsize l;
|
||||
|
||||
|
@ -716,7 +716,7 @@ lldp_neighbor_to_variant(LldpNeighbor *neigh)
|
|||
case SD_LLDP_OUI_IANA_SUBTYPE_MUD:
|
||||
if (!v_mud_url) {
|
||||
gs_free char *s_free = NULL;
|
||||
const char * s;
|
||||
const char *s;
|
||||
|
||||
s = format_string(data8, len, TRUE, &s_free);
|
||||
if (s)
|
||||
|
@ -778,8 +778,8 @@ GVariant *
|
|||
nmtst_lldp_parse_from_raw(const guint8 *raw_data, gsize raw_len)
|
||||
{
|
||||
nm_auto(sd_lldp_neighbor_unrefp) sd_lldp_neighbor *neighbor_sd = NULL;
|
||||
nm_auto(lldp_neighbor_freep) LldpNeighbor * neigh = NULL;
|
||||
GVariant * variant;
|
||||
nm_auto(lldp_neighbor_freep) LldpNeighbor *neigh = NULL;
|
||||
GVariant *variant;
|
||||
int r;
|
||||
|
||||
g_assert(raw_data);
|
||||
|
@ -846,7 +846,7 @@ static void
|
|||
process_lldp_neighbor(NMLldpListener *self, sd_lldp_neighbor *neighbor_sd, gboolean remove)
|
||||
{
|
||||
nm_auto(lldp_neighbor_freep) LldpNeighbor *neigh = NULL;
|
||||
LldpNeighbor * neigh_old;
|
||||
LldpNeighbor *neigh_old;
|
||||
|
||||
nm_assert(self);
|
||||
nm_assert(self->lldp_handle);
|
||||
|
@ -933,10 +933,10 @@ NMLldpListener *
|
|||
nm_lldp_listener_new(int ifindex,
|
||||
NMLldpListenerNotify notify_callback,
|
||||
gpointer notify_user_data,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMLldpListener *self = NULL;
|
||||
sd_lldp_rx * lldp_handle;
|
||||
sd_lldp_rx *lldp_handle;
|
||||
int r;
|
||||
|
||||
g_return_val_if_fail(ifindex > 0, FALSE);
|
||||
|
|
|
@ -13,7 +13,7 @@ typedef void (*NMLldpListenerNotify)(NMLldpListener *self, gpointer user_data);
|
|||
NMLldpListener *nm_lldp_listener_new(int ifindex,
|
||||
NMLldpListenerNotify notify_callback,
|
||||
gpointer notify_user_data,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
void nm_lldp_listener_destroy(NMLldpListener *self);
|
||||
|
||||
int nm_lldp_listener_get_ifindex(NMLldpListener *self);
|
||||
|
|
|
@ -42,11 +42,11 @@ get_type_description(NMDevice *device)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
/* The actual backing resources will be created on enslavement by the port
|
||||
* when it can identify the port and the bridge. */
|
||||
|
@ -144,7 +144,7 @@ static void
|
|||
nm_device_ovs_bridge_class_init(NMDeviceOvsBridgeClass *klass)
|
||||
{
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS(&interface_info_device_ovs_bridge);
|
||||
|
||||
|
|
|
@ -49,11 +49,11 @@ get_type_description(NMDevice *device)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
/* The actual backing resources will be created once an interface is
|
||||
* added to a port of ours, since there can be neither an empty port nor
|
||||
|
@ -71,7 +71,7 @@ get_generic_capabilities(NMDevice *device)
|
|||
static gboolean
|
||||
is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
||||
{
|
||||
NMDeviceOvsInterface * self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterface *self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE(self);
|
||||
|
||||
return nm_ovsdb_is_ready(priv->ovsdb);
|
||||
|
@ -80,7 +80,7 @@ is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
|||
static gboolean
|
||||
can_auto_connect(NMDevice *device, NMSettingsConnection *sett_conn, char **specific_object)
|
||||
{
|
||||
NMDeviceOvsInterface * self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterface *self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE(self);
|
||||
|
||||
return nm_ovsdb_is_ready(priv->ovsdb);
|
||||
|
@ -154,7 +154,7 @@ _is_internal_interface(NMDevice *device)
|
|||
static void
|
||||
set_platform_mtu_cb(GError *error, gpointer user_data)
|
||||
{
|
||||
NMDevice * device = user_data;
|
||||
NMDevice *device = user_data;
|
||||
NMDeviceOvsInterface *self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
|
||||
if (error && !g_error_matches(error, NM_UTILS_ERROR, NM_UTILS_ERROR_CANCELLED_DISPOSING)) {
|
||||
|
@ -170,7 +170,7 @@ set_platform_mtu_cb(GError *error, gpointer user_data)
|
|||
static gboolean
|
||||
set_platform_mtu(NMDevice *device, guint32 mtu)
|
||||
{
|
||||
NMDeviceOvsInterface * self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterface *self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE(self);
|
||||
|
||||
/*
|
||||
|
@ -202,7 +202,7 @@ ready_for_ip_config(NMDevice *device)
|
|||
static void
|
||||
act_stage3_ip_config(NMDevice *device, int addr_family)
|
||||
{
|
||||
NMDeviceOvsInterface * self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterface *self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE(self);
|
||||
|
||||
if (!_is_internal_interface(device)) {
|
||||
|
@ -241,15 +241,15 @@ can_unmanaged_external_down(NMDevice *self)
|
|||
static void
|
||||
deactivate(NMDevice *device)
|
||||
{
|
||||
NMDeviceOvsInterface * self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterface *self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE(self);
|
||||
|
||||
priv->waiting_for_interface = FALSE;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
NMDeviceOvsInterface * self;
|
||||
GCancellable * cancellable;
|
||||
NMDeviceOvsInterface *self;
|
||||
GCancellable *cancellable;
|
||||
NMDeviceDeactivateCallback callback;
|
||||
gpointer callback_user_data;
|
||||
gulong link_changed_id;
|
||||
|
@ -275,14 +275,14 @@ deactivate_invoke_cb(DeactivateData *data, GError *error)
|
|||
}
|
||||
|
||||
static void
|
||||
deactivate_link_changed_cb(NMPlatform * platform,
|
||||
deactivate_link_changed_cb(NMPlatform *platform,
|
||||
int obj_type_i,
|
||||
int ifindex,
|
||||
NMPlatformLink *info,
|
||||
int change_type_i,
|
||||
DeactivateData *data)
|
||||
{
|
||||
NMDeviceOvsInterface * self = data->self;
|
||||
NMDeviceOvsInterface *self = data->self;
|
||||
const NMPlatformSignalChangeType change_type = change_type_i;
|
||||
|
||||
if (change_type == NM_PLATFORM_SIGNAL_REMOVED
|
||||
|
@ -297,7 +297,7 @@ deactivate_link_changed_cb(NMPlatform * platform,
|
|||
static gboolean
|
||||
deactivate_link_timeout(gpointer user_data)
|
||||
{
|
||||
DeactivateData * data = user_data;
|
||||
DeactivateData *data = user_data;
|
||||
NMDeviceOvsInterface *self = data->self;
|
||||
|
||||
_LOGT(LOGD_DEVICE, "deactivate: timeout waiting link removal");
|
||||
|
@ -317,7 +317,7 @@ deactivate_cancelled_cb(GCancellable *cancellable, gpointer user_data)
|
|||
static void
|
||||
deactivate_cb_on_idle(gpointer user_data, GCancellable *cancellable)
|
||||
{
|
||||
DeactivateData *data = user_data;
|
||||
DeactivateData *data = user_data;
|
||||
gs_free_error GError *cancelled_error = NULL;
|
||||
|
||||
g_cancellable_set_error_if_cancelled(data->cancellable, &cancelled_error);
|
||||
|
@ -325,14 +325,14 @@ deactivate_cb_on_idle(gpointer user_data, GCancellable *cancellable)
|
|||
}
|
||||
|
||||
static void
|
||||
deactivate_async(NMDevice * device,
|
||||
GCancellable * cancellable,
|
||||
deactivate_async(NMDevice *device,
|
||||
GCancellable *cancellable,
|
||||
NMDeviceDeactivateCallback callback,
|
||||
gpointer callback_user_data)
|
||||
{
|
||||
NMDeviceOvsInterface * self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterface *self = NM_DEVICE_OVS_INTERFACE(device);
|
||||
NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE(self);
|
||||
DeactivateData * data;
|
||||
DeactivateData *data;
|
||||
|
||||
_LOGT(LOGD_CORE, "deactivate: start async");
|
||||
|
||||
|
@ -419,7 +419,7 @@ nm_device_ovs_interface_init(NMDeviceOvsInterface *self)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceOvsInterface * self = NM_DEVICE_OVS_INTERFACE(object);
|
||||
NMDeviceOvsInterface *self = NM_DEVICE_OVS_INTERFACE(object);
|
||||
NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE(self);
|
||||
|
||||
if (priv->ovsdb) {
|
||||
|
@ -437,9 +437,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_ovs_interface = {
|
|||
static void
|
||||
nm_device_ovs_interface_class_init(NMDeviceOvsInterfaceClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
||||
|
|
|
@ -41,11 +41,11 @@ get_type_description(NMDevice *device)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
/* The port will be added to ovsdb when an interface is enslaved,
|
||||
* because there's no such thing like an empty port. */
|
||||
|
@ -90,10 +90,10 @@ add_iface_cb(GError *error, gpointer user_data)
|
|||
static gboolean
|
||||
enslave_slave(NMDevice *device, NMDevice *slave, NMConnection *connection, gboolean configure)
|
||||
{
|
||||
NMDeviceOvsPort * self = NM_DEVICE_OVS_PORT(device);
|
||||
NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device);
|
||||
NMActiveConnection *ac_port = NULL;
|
||||
NMActiveConnection *ac_bridge = NULL;
|
||||
NMDevice * bridge_device;
|
||||
NMDevice *bridge_device;
|
||||
|
||||
if (!configure)
|
||||
return TRUE;
|
||||
|
@ -177,7 +177,7 @@ static void
|
|||
nm_device_ovs_port_class_init(NMDeviceOvsPortClass *klass)
|
||||
{
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS(&interface_info_device_ovs_port);
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ NM_DEVICE_FACTORY_DECLARE_TYPES(
|
|||
NM_SETTING_OVS_PORT_SETTING_NAME))
|
||||
|
||||
G_MODULE_EXPORT NMDeviceFactory *
|
||||
nm_device_factory_create(GError **error)
|
||||
nm_device_factory_create(GError **error)
|
||||
{
|
||||
nm_manager_set_capability(NM_MANAGER_GET, NM_CAPABILITY_OVS);
|
||||
return g_object_new(NM_TYPE_OVS_FACTORY, NULL);
|
||||
|
@ -106,14 +106,14 @@ new_device_from_type(const char *name, NMDeviceType device_type)
|
|||
}
|
||||
|
||||
static void
|
||||
ovsdb_device_added(NMOvsdb * ovsdb,
|
||||
const char * name,
|
||||
ovsdb_device_added(NMOvsdb *ovsdb,
|
||||
const char *name,
|
||||
guint device_type_i,
|
||||
const char * subtype,
|
||||
const char *subtype,
|
||||
NMDeviceFactory *self)
|
||||
{
|
||||
const NMDeviceType device_type = device_type_i;
|
||||
NMDevice * device;
|
||||
NMDevice *device;
|
||||
|
||||
if (device_type == NM_DEVICE_TYPE_OVS_INTERFACE
|
||||
&& !NM_IN_STRSET(subtype, "internal", "patch")) {
|
||||
|
@ -133,14 +133,14 @@ ovsdb_device_added(NMOvsdb * ovsdb,
|
|||
}
|
||||
|
||||
static void
|
||||
ovsdb_device_removed(NMOvsdb * ovsdb,
|
||||
const char * name,
|
||||
ovsdb_device_removed(NMOvsdb *ovsdb,
|
||||
const char *name,
|
||||
guint device_type_i,
|
||||
const char * subtype,
|
||||
const char *subtype,
|
||||
NMDeviceFactory *self)
|
||||
{
|
||||
const NMDeviceType device_type = device_type_i;
|
||||
NMDevice * device = NULL;
|
||||
NMDevice *device = NULL;
|
||||
NMDeviceState device_state;
|
||||
gboolean is_system_interface = FALSE;
|
||||
|
||||
|
@ -149,8 +149,8 @@ ovsdb_device_removed(NMOvsdb * ovsdb,
|
|||
return;
|
||||
|
||||
if (device_type == NM_DEVICE_TYPE_OVS_INTERFACE && nm_streq0(subtype, "system")) {
|
||||
NMDevice * d;
|
||||
const CList * list;
|
||||
NMDevice *d;
|
||||
const CList *list;
|
||||
NMSettingOvsInterface *s_ovs_int;
|
||||
|
||||
/* The device associated to an OVS system interface can be of
|
||||
|
@ -192,16 +192,16 @@ ovsdb_device_removed(NMOvsdb * ovsdb,
|
|||
}
|
||||
|
||||
static void
|
||||
ovsdb_interface_failed(NMOvsdb * ovsdb,
|
||||
const char * name,
|
||||
const char * connection_uuid,
|
||||
const char * error,
|
||||
ovsdb_interface_failed(NMOvsdb *ovsdb,
|
||||
const char *name,
|
||||
const char *connection_uuid,
|
||||
const char *error,
|
||||
NMDeviceFactory *self)
|
||||
{
|
||||
NMDevice * device = NULL;
|
||||
NMSettingsConnection * connection = NULL;
|
||||
NMConnection * c;
|
||||
const char * type;
|
||||
NMDevice *device = NULL;
|
||||
NMSettingsConnection *connection = NULL;
|
||||
NMConnection *c;
|
||||
const char *type;
|
||||
NMSettingOvsInterface *s_ovs_int;
|
||||
gboolean is_patch = FALSE;
|
||||
gboolean ignore;
|
||||
|
@ -271,14 +271,14 @@ start(NMDeviceFactory *self)
|
|||
}
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * self,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *self,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
NMDeviceType device_type = NM_DEVICE_TYPE_UNKNOWN;
|
||||
const char * connection_type = NULL;
|
||||
const char *connection_type = NULL;
|
||||
|
||||
if (g_strcmp0(iface, "ovs-system") == 0) {
|
||||
*out_ignore = TRUE;
|
||||
|
|
|
@ -30,34 +30,34 @@
|
|||
#endif
|
||||
|
||||
typedef struct {
|
||||
char * port_uuid;
|
||||
char * name;
|
||||
char * connection_uuid;
|
||||
char *port_uuid;
|
||||
char *name;
|
||||
char *connection_uuid;
|
||||
GPtrArray *interfaces; /* interface uuids */
|
||||
GArray * external_ids;
|
||||
GArray *external_ids;
|
||||
} OpenvswitchPort;
|
||||
|
||||
typedef struct {
|
||||
char * bridge_uuid;
|
||||
char * name;
|
||||
char * connection_uuid;
|
||||
char *bridge_uuid;
|
||||
char *name;
|
||||
char *connection_uuid;
|
||||
GPtrArray *ports; /* port uuids */
|
||||
GArray * external_ids;
|
||||
GArray *external_ids;
|
||||
} OpenvswitchBridge;
|
||||
|
||||
typedef struct {
|
||||
char * interface_uuid;
|
||||
char * name;
|
||||
char * type;
|
||||
char * connection_uuid;
|
||||
char *interface_uuid;
|
||||
char *name;
|
||||
char *type;
|
||||
char *connection_uuid;
|
||||
GArray *external_ids;
|
||||
} OpenvswitchInterface;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef void (*OvsdbMethodCallback)(NMOvsdb *self,
|
||||
json_t * response,
|
||||
GError * error,
|
||||
json_t *response,
|
||||
GError *error,
|
||||
gpointer user_data);
|
||||
|
||||
typedef enum {
|
||||
|
@ -77,27 +77,27 @@ typedef union {
|
|||
NMConnection *bridge;
|
||||
NMConnection *port;
|
||||
NMConnection *interface;
|
||||
NMDevice * bridge_device;
|
||||
NMDevice * interface_device;
|
||||
NMDevice *bridge_device;
|
||||
NMDevice *interface_device;
|
||||
} add_interface;
|
||||
struct {
|
||||
char *ifname;
|
||||
} del_interface;
|
||||
struct {
|
||||
char * ifname;
|
||||
char *ifname;
|
||||
guint32 mtu;
|
||||
} set_interface_mtu;
|
||||
struct {
|
||||
NMDeviceType device_type;
|
||||
char * ifname;
|
||||
char * connection_uuid;
|
||||
GHashTable * exid_old;
|
||||
GHashTable * exid_new;
|
||||
char *ifname;
|
||||
char *connection_uuid;
|
||||
GHashTable *exid_old;
|
||||
GHashTable *exid_new;
|
||||
} set_external_ids;
|
||||
} OvsdbMethodPayload;
|
||||
|
||||
typedef struct {
|
||||
NMOvsdb * self;
|
||||
NMOvsdb *self;
|
||||
CList calls_lst;
|
||||
guint64 call_id;
|
||||
OvsdbCommand command;
|
||||
|
@ -120,11 +120,11 @@ static guint signals[LAST_SIGNAL] = {0};
|
|||
|
||||
typedef struct {
|
||||
GSocketConnection *conn;
|
||||
GCancellable * conn_cancellable;
|
||||
GCancellable *conn_cancellable;
|
||||
char buf[4096]; /* Input buffer */
|
||||
size_t bufp; /* Last decoded byte in the input buffer. */
|
||||
GString * input; /* JSON stream waiting for decoding. */
|
||||
GString * output; /* JSON stream to be sent. */
|
||||
GString *input; /* JSON stream waiting for decoding. */
|
||||
GString *output; /* JSON stream to be sent. */
|
||||
guint64 call_id_counter;
|
||||
|
||||
CList calls_lst_head;
|
||||
|
@ -132,7 +132,7 @@ typedef struct {
|
|||
GHashTable *interfaces; /* interface uuid => OpenvswitchInterface */
|
||||
GHashTable *ports; /* port uuid => OpenvswitchPort */
|
||||
GHashTable *bridges; /* bridge uuid => OpenvswitchBridge */
|
||||
char * db_uuid;
|
||||
char *db_uuid;
|
||||
guint num_failures;
|
||||
guint num_pending_deletions;
|
||||
bool ready : 1;
|
||||
|
@ -328,25 +328,25 @@ _free_interface(OpenvswitchInterface *ovs_interface)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
_signal_emit_device_added(NMOvsdb * self,
|
||||
const char * name,
|
||||
_signal_emit_device_added(NMOvsdb *self,
|
||||
const char *name,
|
||||
NMDeviceType device_type,
|
||||
const char * device_subtype)
|
||||
const char *device_subtype)
|
||||
{
|
||||
g_signal_emit(self, signals[DEVICE_ADDED], 0, name, (guint) device_type, device_subtype);
|
||||
}
|
||||
|
||||
static void
|
||||
_signal_emit_device_removed(NMOvsdb * self,
|
||||
const char * name,
|
||||
_signal_emit_device_removed(NMOvsdb *self,
|
||||
const char *name,
|
||||
NMDeviceType device_type,
|
||||
const char * device_subtype)
|
||||
const char *device_subtype)
|
||||
{
|
||||
g_signal_emit(self, signals[DEVICE_REMOVED], 0, name, (guint) device_type, device_subtype);
|
||||
}
|
||||
|
||||
static void
|
||||
_signal_emit_interface_failed(NMOvsdb * self,
|
||||
_signal_emit_interface_failed(NMOvsdb *self,
|
||||
const char *name,
|
||||
const char *connection_uuid,
|
||||
const char *error)
|
||||
|
@ -363,14 +363,14 @@ _signal_emit_interface_failed(NMOvsdb * self,
|
|||
* there's no command pending completion.
|
||||
*/
|
||||
static void
|
||||
ovsdb_call_method(NMOvsdb * self,
|
||||
ovsdb_call_method(NMOvsdb *self,
|
||||
OvsdbMethodCallback callback,
|
||||
gpointer user_data,
|
||||
gboolean add_first,
|
||||
OvsdbCommand command,
|
||||
const OvsdbMethodPayload *payload)
|
||||
{
|
||||
NMOvsdbPrivate * priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
OvsdbMethodCall *call;
|
||||
|
||||
/* Ensure we're not unsynchronized before we queue the method call. */
|
||||
|
@ -653,11 +653,11 @@ _set_port_interfaces(json_t *params, const char *ifname, json_t *new_interfaces)
|
|||
static json_t *
|
||||
_j_create_external_ids_array_new(NMConnection *connection)
|
||||
{
|
||||
json_t * array;
|
||||
const char *const * external_ids = NULL;
|
||||
json_t *array;
|
||||
const char *const *external_ids = NULL;
|
||||
guint n_external_ids = 0;
|
||||
guint i;
|
||||
const char * uuid;
|
||||
const char *uuid;
|
||||
NMSettingOvsExternalIDs *s_exid;
|
||||
|
||||
nm_assert(NM_IS_CONNECTION(connection));
|
||||
|
@ -688,10 +688,10 @@ _j_create_external_ids_array_update(const char *connection_uuid,
|
|||
GHashTable *exid_new)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
json_t * mutations;
|
||||
json_t * array;
|
||||
const char * key;
|
||||
const char * val;
|
||||
json_t *mutations;
|
||||
json_t *array;
|
||||
const char *key;
|
||||
const char *val;
|
||||
|
||||
nm_assert(connection_uuid);
|
||||
|
||||
|
@ -744,17 +744,17 @@ _j_create_external_ids_array_update(const char *connection_uuid,
|
|||
* Returns an commands that adds new interface from a given connection.
|
||||
*/
|
||||
static void
|
||||
_insert_interface(json_t * params,
|
||||
_insert_interface(json_t *params,
|
||||
NMConnection *interface,
|
||||
NMDevice * interface_device,
|
||||
const char * cloned_mac)
|
||||
NMDevice *interface_device,
|
||||
const char *cloned_mac)
|
||||
{
|
||||
const char * type = NULL;
|
||||
const char *type = NULL;
|
||||
NMSettingOvsInterface *s_ovs_iface;
|
||||
NMSettingOvsDpdk * s_ovs_dpdk;
|
||||
NMSettingOvsPatch * s_ovs_patch;
|
||||
json_t * options = json_array();
|
||||
json_t * row;
|
||||
NMSettingOvsDpdk *s_ovs_dpdk;
|
||||
NMSettingOvsPatch *s_ovs_patch;
|
||||
json_t *options = json_array();
|
||||
json_t *row;
|
||||
guint32 mtu = 0;
|
||||
|
||||
s_ovs_iface = nm_connection_get_setting_ovs_interface(interface);
|
||||
|
@ -825,13 +825,13 @@ static void
|
|||
_insert_port(json_t *params, NMConnection *port, json_t *new_interfaces)
|
||||
{
|
||||
NMSettingOvsPort *s_ovs_port;
|
||||
const char * vlan_mode = NULL;
|
||||
const char *vlan_mode = NULL;
|
||||
guint tag = 0;
|
||||
const char * lacp = NULL;
|
||||
const char * bond_mode = NULL;
|
||||
const char *lacp = NULL;
|
||||
const char *bond_mode = NULL;
|
||||
guint bond_updelay = 0;
|
||||
guint bond_downdelay = 0;
|
||||
json_t * row;
|
||||
json_t *row;
|
||||
|
||||
s_ovs_port = nm_connection_get_setting_ovs_port(port);
|
||||
|
||||
|
@ -882,19 +882,19 @@ _insert_port(json_t *params, NMConnection *port, json_t *new_interfaces)
|
|||
* Returns an commands that adds new bridge from a given connection.
|
||||
*/
|
||||
static void
|
||||
_insert_bridge(json_t * params,
|
||||
_insert_bridge(json_t *params,
|
||||
NMConnection *bridge,
|
||||
NMDevice * bridge_device,
|
||||
json_t * new_ports,
|
||||
const char * cloned_mac)
|
||||
NMDevice *bridge_device,
|
||||
json_t *new_ports,
|
||||
const char *cloned_mac)
|
||||
{
|
||||
NMSettingOvsBridge *s_ovs_bridge;
|
||||
const char * fail_mode = NULL;
|
||||
const char *fail_mode = NULL;
|
||||
gboolean mcast_snooping_enable = FALSE;
|
||||
gboolean rstp_enable = FALSE;
|
||||
gboolean stp_enable = FALSE;
|
||||
const char * datapath_type = NULL;
|
||||
json_t * row;
|
||||
const char *datapath_type = NULL;
|
||||
json_t *row;
|
||||
|
||||
s_ovs_bridge = nm_connection_get_setting_ovs_bridge(bridge);
|
||||
|
||||
|
@ -974,24 +974,24 @@ _inc_next_cfg(const char *db_uuid)
|
|||
* a parent @port and @bridge if needed.
|
||||
*/
|
||||
static void
|
||||
_add_interface(NMOvsdb * self,
|
||||
json_t * params,
|
||||
_add_interface(NMOvsdb *self,
|
||||
json_t *params,
|
||||
NMConnection *bridge,
|
||||
NMConnection *port,
|
||||
NMConnection *interface,
|
||||
NMDevice * bridge_device,
|
||||
NMDevice * interface_device)
|
||||
NMDevice *bridge_device,
|
||||
NMDevice *interface_device)
|
||||
{
|
||||
NMOvsdbPrivate * priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
GHashTableIter iter;
|
||||
const char * port_uuid;
|
||||
const char * interface_uuid;
|
||||
const char * bridge_name;
|
||||
const char * port_name;
|
||||
const char * interface_name;
|
||||
OpenvswitchBridge * ovs_bridge = NULL;
|
||||
OpenvswitchPort * ovs_port = NULL;
|
||||
OpenvswitchInterface *ovs_interface = NULL;
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
GHashTableIter iter;
|
||||
const char *port_uuid;
|
||||
const char *interface_uuid;
|
||||
const char *bridge_name;
|
||||
const char *port_name;
|
||||
const char *interface_name;
|
||||
OpenvswitchBridge *ovs_bridge = NULL;
|
||||
OpenvswitchPort *ovs_port = NULL;
|
||||
OpenvswitchInterface *ovs_interface = NULL;
|
||||
nm_auto_decref_json json_t *bridges = NULL;
|
||||
nm_auto_decref_json json_t *new_bridges = NULL;
|
||||
nm_auto_decref_json json_t *ports = NULL;
|
||||
|
@ -1000,9 +1000,9 @@ _add_interface(NMOvsdb * self,
|
|||
nm_auto_decref_json json_t *new_interfaces = NULL;
|
||||
gboolean has_interface = FALSE;
|
||||
gboolean interface_is_local;
|
||||
gs_free char * bridge_cloned_mac = NULL;
|
||||
gs_free char * interface_cloned_mac = NULL;
|
||||
GError * error = NULL;
|
||||
gs_free char *bridge_cloned_mac = NULL;
|
||||
gs_free char *interface_cloned_mac = NULL;
|
||||
GError *error = NULL;
|
||||
int pi;
|
||||
int ii;
|
||||
|
||||
|
@ -1159,13 +1159,13 @@ _add_interface(NMOvsdb * self,
|
|||
static void
|
||||
_delete_interface(NMOvsdb *self, json_t *params, const char *ifname)
|
||||
{
|
||||
NMOvsdbPrivate * priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
GHashTableIter iter;
|
||||
char * port_uuid;
|
||||
char * interface_uuid;
|
||||
OpenvswitchBridge * ovs_bridge;
|
||||
OpenvswitchPort * ovs_port;
|
||||
OpenvswitchInterface *ovs_interface;
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
GHashTableIter iter;
|
||||
char *port_uuid;
|
||||
char *interface_uuid;
|
||||
OpenvswitchBridge *ovs_bridge;
|
||||
OpenvswitchPort *ovs_port;
|
||||
OpenvswitchInterface *ovs_interface;
|
||||
nm_auto_decref_json json_t *bridges = NULL;
|
||||
nm_auto_decref_json json_t *new_bridges = NULL;
|
||||
gboolean bridges_changed;
|
||||
|
@ -1269,9 +1269,9 @@ _delete_interface(NMOvsdb *self, json_t *params, const char *ifname)
|
|||
static void
|
||||
ovsdb_next_command(NMOvsdb *self)
|
||||
{
|
||||
NMOvsdbPrivate * priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
OvsdbMethodCall * call;
|
||||
char * cmd;
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
OvsdbMethodCall *call;
|
||||
char *cmd;
|
||||
nm_auto_decref_json json_t *msg = NULL;
|
||||
|
||||
if (!priv->conn)
|
||||
|
@ -1417,9 +1417,9 @@ static void
|
|||
_uuids_to_array_inplace(GPtrArray *array, const json_t *items)
|
||||
{
|
||||
const char *key;
|
||||
json_t * value;
|
||||
json_t *value;
|
||||
size_t index = 0;
|
||||
json_t * set_value;
|
||||
json_t *set_value;
|
||||
size_t set_index;
|
||||
|
||||
while (index < json_array_size(items)) {
|
||||
|
@ -1472,8 +1472,8 @@ _external_ids_extract(json_t *external_ids, GArray **out_array, const char **out
|
|||
array = json_array_get(external_ids, 1);
|
||||
|
||||
json_array_foreach (array, index, value) {
|
||||
const char * key = json_string_value(json_array_get(value, 0));
|
||||
const char * val = json_string_value(json_array_get(value, 1));
|
||||
const char *key = json_string_value(json_array_get(value, 0));
|
||||
const char *val = json_string_value(json_array_get(value, 1));
|
||||
NMUtilsNamedValue *v;
|
||||
|
||||
if (!key || !val)
|
||||
|
@ -1556,20 +1556,20 @@ static void
|
|||
ovsdb_got_update(NMOvsdb *self, json_t *msg)
|
||||
{
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
json_t * ovs = NULL;
|
||||
json_t * bridge = NULL;
|
||||
json_t * port = NULL;
|
||||
json_t * interface = NULL;
|
||||
json_t * items;
|
||||
json_t * external_ids;
|
||||
json_t *ovs = NULL;
|
||||
json_t *bridge = NULL;
|
||||
json_t *port = NULL;
|
||||
json_t *interface = NULL;
|
||||
json_t *items;
|
||||
json_t *external_ids;
|
||||
json_error_t json_error = {
|
||||
0,
|
||||
};
|
||||
void * iter;
|
||||
void *iter;
|
||||
const char *name;
|
||||
const char *key;
|
||||
const char *type;
|
||||
json_t * value;
|
||||
json_t *value;
|
||||
|
||||
if (json_unpack_ex(msg,
|
||||
&json_error,
|
||||
|
@ -1599,10 +1599,10 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
|
|||
}
|
||||
|
||||
json_object_foreach (interface, key, value) {
|
||||
OpenvswitchInterface *ovs_interface;
|
||||
OpenvswitchInterface *ovs_interface;
|
||||
gs_unref_array GArray *external_ids_arr = NULL;
|
||||
const char * connection_uuid = NULL;
|
||||
json_t * error = NULL;
|
||||
const char *connection_uuid = NULL;
|
||||
json_t *error = NULL;
|
||||
int r;
|
||||
|
||||
r = json_unpack(value,
|
||||
|
@ -1723,10 +1723,10 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
|
|||
|
||||
json_object_foreach (port, key, value) {
|
||||
gs_unref_ptrarray GPtrArray *interfaces = NULL;
|
||||
OpenvswitchPort * ovs_port;
|
||||
gs_unref_array GArray *external_ids_arr = NULL;
|
||||
const char * connection_uuid = NULL;
|
||||
int r;
|
||||
OpenvswitchPort *ovs_port;
|
||||
gs_unref_array GArray *external_ids_arr = NULL;
|
||||
const char *connection_uuid = NULL;
|
||||
int r;
|
||||
|
||||
r = json_unpack(value,
|
||||
"{s:{s:s, s:o, s:o}}",
|
||||
|
@ -1824,10 +1824,10 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
|
|||
|
||||
json_object_foreach (bridge, key, value) {
|
||||
gs_unref_ptrarray GPtrArray *ports = NULL;
|
||||
OpenvswitchBridge * ovs_bridge;
|
||||
gs_unref_array GArray *external_ids_arr = NULL;
|
||||
const char * connection_uuid = NULL;
|
||||
int r;
|
||||
OpenvswitchBridge *ovs_bridge;
|
||||
gs_unref_array GArray *external_ids_arr = NULL;
|
||||
const char *connection_uuid = NULL;
|
||||
int r;
|
||||
|
||||
r = json_unpack(value,
|
||||
"{s:{s:s, s:o, s:o}}",
|
||||
|
@ -1937,9 +1937,9 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
|
|||
static void
|
||||
ovsdb_got_echo(NMOvsdb *self, json_int_t id, json_t *data)
|
||||
{
|
||||
NMOvsdbPrivate * priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
nm_auto_decref_json json_t *msg = NULL;
|
||||
char * reply;
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
nm_auto_decref_json json_t *msg = NULL;
|
||||
char *reply;
|
||||
gboolean output_was_empty;
|
||||
|
||||
output_was_empty = priv->output->len == 0;
|
||||
|
@ -1966,12 +1966,12 @@ ovsdb_got_msg(NMOvsdb *self, json_t *msg)
|
|||
json_error_t json_error = {
|
||||
0,
|
||||
};
|
||||
json_t * json_id = NULL;
|
||||
json_t *json_id = NULL;
|
||||
json_int_t id = (json_int_t) -1;
|
||||
const char *method = NULL;
|
||||
json_t * params = NULL;
|
||||
json_t * result = NULL;
|
||||
json_t * error = NULL;
|
||||
json_t *params = NULL;
|
||||
json_t *result = NULL;
|
||||
json_t *error = NULL;
|
||||
|
||||
if (json_unpack_ex(msg,
|
||||
&json_error,
|
||||
|
@ -2017,9 +2017,9 @@ ovsdb_got_msg(NMOvsdb *self, json_t *msg)
|
|||
}
|
||||
|
||||
if (id >= 0) {
|
||||
OvsdbMethodCall *call;
|
||||
OvsdbMethodCall *call;
|
||||
gs_free_error GError *local = NULL;
|
||||
gs_free char * msg_as_str = NULL;
|
||||
gs_free char *msg_as_str = NULL;
|
||||
|
||||
/* This is a response to a method call. */
|
||||
if (c_list_is_empty(&priv->calls_lst_head)) {
|
||||
|
@ -2075,7 +2075,7 @@ ovsdb_got_msg(NMOvsdb *self, json_t *msg)
|
|||
static size_t
|
||||
_json_callback(void *buffer, size_t buflen, void *user_data)
|
||||
{
|
||||
NMOvsdb * self = NM_OVSDB(user_data);
|
||||
NMOvsdb *self = NM_OVSDB(user_data);
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
|
||||
if (priv->bufp == priv->input->len) {
|
||||
|
@ -2099,12 +2099,12 @@ _json_callback(void *buffer, size_t buflen, void *user_data)
|
|||
static void
|
||||
ovsdb_read_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMOvsdb * self = NM_OVSDB(user_data);
|
||||
NMOvsdb *self = NM_OVSDB(user_data);
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
GInputStream * stream = G_INPUT_STREAM(source_object);
|
||||
GError * error = NULL;
|
||||
GInputStream *stream = G_INPUT_STREAM(source_object);
|
||||
GError *error = NULL;
|
||||
gssize size;
|
||||
json_t * msg;
|
||||
json_t *msg;
|
||||
json_error_t json_error = {
|
||||
0,
|
||||
};
|
||||
|
@ -2157,10 +2157,10 @@ ovsdb_read(NMOvsdb *self)
|
|||
static void
|
||||
ovsdb_write_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
GOutputStream * stream = G_OUTPUT_STREAM(source_object);
|
||||
NMOvsdb * self = NM_OVSDB(user_data);
|
||||
GOutputStream *stream = G_OUTPUT_STREAM(source_object);
|
||||
NMOvsdb *self = NM_OVSDB(user_data);
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
gssize size;
|
||||
|
||||
size = g_output_stream_write_finish(stream, res, &error);
|
||||
|
@ -2185,7 +2185,7 @@ static void
|
|||
ovsdb_write(NMOvsdb *self)
|
||||
{
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
GOutputStream * stream;
|
||||
GOutputStream *stream;
|
||||
|
||||
if (!priv->output->len)
|
||||
return;
|
||||
|
@ -2218,7 +2218,7 @@ ovsdb_write(NMOvsdb *self)
|
|||
static void
|
||||
ovsdb_disconnect(NMOvsdb *self, gboolean retry, gboolean is_disposing)
|
||||
{
|
||||
NMOvsdbPrivate * priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
OvsdbMethodCall *call;
|
||||
|
||||
nm_assert(!retry || !is_disposing);
|
||||
|
@ -2275,8 +2275,8 @@ _check_ready(NMOvsdb *self)
|
|||
static void
|
||||
_del_initial_iface_cb(GError *error, gpointer user_data)
|
||||
{
|
||||
NMOvsdb * self;
|
||||
gs_free char * ifname = NULL;
|
||||
NMOvsdb *self;
|
||||
gs_free char *ifname = NULL;
|
||||
NMOvsdbPrivate *priv;
|
||||
|
||||
nm_utils_user_data_unpack(user_data, &self, &ifname);
|
||||
|
@ -2302,9 +2302,9 @@ _del_initial_iface_cb(GError *error, gpointer user_data)
|
|||
static void
|
||||
ovsdb_cleanup_initial_interfaces(NMOvsdb *self)
|
||||
{
|
||||
NMOvsdbPrivate * priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
const OpenvswitchInterface *interface;
|
||||
NMUtilsUserData * data;
|
||||
NMUtilsUserData *data;
|
||||
GHashTableIter iter;
|
||||
|
||||
if (priv->ready || priv->num_pending_deletions != 0)
|
||||
|
@ -2349,9 +2349,9 @@ _monitor_bridges_cb(NMOvsdb *self, json_t *result, GError *error, gpointer user_
|
|||
static void
|
||||
_ovsdb_connect_complete_with_fd(NMOvsdb *self, int fd_take)
|
||||
{
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
gs_unref_object GSocket *socket = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
socket = g_socket_new_from_fd(nm_steal_fd(&fd_take), &error);
|
||||
if (!socket) {
|
||||
|
@ -2371,7 +2371,7 @@ static void
|
|||
_ovsdb_connect_sudo_cb(int fd_take, GError *error, gpointer user_data)
|
||||
{
|
||||
nm_auto_close int fd = fd_take;
|
||||
NMOvsdb * self;
|
||||
NMOvsdb *self;
|
||||
|
||||
if (nm_utils_error_is_cancelled(error))
|
||||
return;
|
||||
|
@ -2391,9 +2391,9 @@ _ovsdb_connect_sudo_cb(int fd_take, GError *error, gpointer user_data)
|
|||
static void
|
||||
_ovsdb_connect_idle(gpointer user_data, GCancellable *cancellable)
|
||||
{
|
||||
NMOvsdb * self;
|
||||
NMOvsdbPrivate * priv;
|
||||
nm_auto_close int fd = -1;
|
||||
NMOvsdb *self;
|
||||
NMOvsdbPrivate *priv;
|
||||
nm_auto_close int fd = -1;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
if (g_cancellable_is_cancelled(cancellable))
|
||||
|
@ -2465,11 +2465,11 @@ typedef struct {
|
|||
static void
|
||||
_transact_cb(NMOvsdb *self, json_t *result, GError *error, gpointer user_data)
|
||||
{
|
||||
OvsdbCall * call = user_data;
|
||||
OvsdbCall *call = user_data;
|
||||
const char *err;
|
||||
const char *err_details;
|
||||
size_t index;
|
||||
json_t * value;
|
||||
json_t *value;
|
||||
|
||||
if (error)
|
||||
goto out;
|
||||
|
@ -2513,12 +2513,12 @@ nm_ovsdb_is_ready(NMOvsdb *self)
|
|||
}
|
||||
|
||||
void
|
||||
nm_ovsdb_add_interface(NMOvsdb * self,
|
||||
NMConnection * bridge,
|
||||
NMConnection * port,
|
||||
NMConnection * interface,
|
||||
NMDevice * bridge_device,
|
||||
NMDevice * interface_device,
|
||||
nm_ovsdb_add_interface(NMOvsdb *self,
|
||||
NMConnection *bridge,
|
||||
NMConnection *port,
|
||||
NMConnection *interface,
|
||||
NMDevice *bridge_device,
|
||||
NMDevice *interface_device,
|
||||
NMOvsdbCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@ -2535,8 +2535,8 @@ nm_ovsdb_add_interface(NMOvsdb * self,
|
|||
}
|
||||
|
||||
void
|
||||
nm_ovsdb_del_interface(NMOvsdb * self,
|
||||
const char * ifname,
|
||||
nm_ovsdb_del_interface(NMOvsdb *self,
|
||||
const char *ifname,
|
||||
NMOvsdbCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@ -2549,8 +2549,8 @@ nm_ovsdb_del_interface(NMOvsdb * self,
|
|||
}
|
||||
|
||||
void
|
||||
nm_ovsdb_set_interface_mtu(NMOvsdb * self,
|
||||
const char * ifname,
|
||||
nm_ovsdb_set_interface_mtu(NMOvsdb *self,
|
||||
const char *ifname,
|
||||
guint32 mtu,
|
||||
NMOvsdbCallback callback,
|
||||
gpointer user_data)
|
||||
|
@ -2564,10 +2564,10 @@ nm_ovsdb_set_interface_mtu(NMOvsdb * self,
|
|||
}
|
||||
|
||||
void
|
||||
nm_ovsdb_set_external_ids(NMOvsdb * self,
|
||||
nm_ovsdb_set_external_ids(NMOvsdb *self,
|
||||
NMDeviceType device_type,
|
||||
const char * ifname,
|
||||
const char * connection_uuid,
|
||||
const char *ifname,
|
||||
const char *connection_uuid,
|
||||
NMSettingOvsExternalIDs *s_exid_old,
|
||||
NMSettingOvsExternalIDs *s_exid_new)
|
||||
{
|
||||
|
@ -2615,7 +2615,7 @@ nm_ovsdb_init(NMOvsdb *self)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMOvsdb * self = NM_OVSDB(object);
|
||||
NMOvsdb *self = NM_OVSDB(object);
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
|
||||
ovsdb_disconnect(self, FALSE, TRUE);
|
||||
|
|
|
@ -27,32 +27,32 @@ NMOvsdb *nm_ovsdb_get(void);
|
|||
|
||||
GType nm_ovsdb_get_type(void);
|
||||
|
||||
void nm_ovsdb_add_interface(NMOvsdb * self,
|
||||
NMConnection * bridge,
|
||||
NMConnection * port,
|
||||
NMConnection * interface,
|
||||
NMDevice * bridge_device,
|
||||
NMDevice * interface_device,
|
||||
void nm_ovsdb_add_interface(NMOvsdb *self,
|
||||
NMConnection *bridge,
|
||||
NMConnection *port,
|
||||
NMConnection *interface,
|
||||
NMDevice *bridge_device,
|
||||
NMDevice *interface_device,
|
||||
NMOvsdbCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
void nm_ovsdb_del_interface(NMOvsdb * self,
|
||||
const char * ifname,
|
||||
void nm_ovsdb_del_interface(NMOvsdb *self,
|
||||
const char *ifname,
|
||||
NMOvsdbCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
void nm_ovsdb_set_interface_mtu(NMOvsdb * self,
|
||||
const char * ifname,
|
||||
void nm_ovsdb_set_interface_mtu(NMOvsdb *self,
|
||||
const char *ifname,
|
||||
guint32 mtu,
|
||||
NMOvsdbCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
struct _NMSettingOvsExternalIDs;
|
||||
|
||||
void nm_ovsdb_set_external_ids(NMOvsdb * self,
|
||||
void nm_ovsdb_set_external_ids(NMOvsdb *self,
|
||||
NMDeviceType device_type,
|
||||
const char * ifname,
|
||||
const char * connection_uuid,
|
||||
const char *ifname,
|
||||
const char *connection_uuid,
|
||||
struct _NMSettingOvsExternalIDs *s_exid_old,
|
||||
struct _NMSettingOvsExternalIDs *s_exid_new);
|
||||
|
||||
|
|
|
@ -33,15 +33,15 @@
|
|||
NM_GOBJECT_PROPERTIES_DEFINE(NMDeviceTeam, PROP_CONFIG, );
|
||||
|
||||
typedef struct {
|
||||
struct teamdctl * tdc;
|
||||
char * config;
|
||||
struct teamdctl *tdc;
|
||||
char *config;
|
||||
GPid teamd_pid;
|
||||
guint teamd_process_watch;
|
||||
guint teamd_timeout;
|
||||
guint teamd_read_timeout;
|
||||
guint teamd_dbus_watch;
|
||||
bool kill_in_progress : 1;
|
||||
GFileMonitor * usock_monitor;
|
||||
GFileMonitor *usock_monitor;
|
||||
NMDeviceStageState stage1_state : 3;
|
||||
} NMDeviceTeamPrivate;
|
||||
|
||||
|
@ -72,11 +72,11 @@ get_generic_capabilities(NMDevice *device)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
nm_utils_complete_generic(nm_device_get_platform(device),
|
||||
connection,
|
||||
|
@ -96,7 +96,7 @@ complete_connection(NMDevice * device,
|
|||
static gboolean
|
||||
ensure_teamd_connection(NMDevice *device)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
int err;
|
||||
|
||||
|
@ -125,7 +125,7 @@ static gboolean
|
|||
teamd_read_config(NMDeviceTeam *self)
|
||||
{
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
const char * config = NULL;
|
||||
const char *config = NULL;
|
||||
int err;
|
||||
|
||||
if (priv->tdc) {
|
||||
|
@ -150,7 +150,7 @@ teamd_read_config(NMDeviceTeam *self)
|
|||
static gboolean
|
||||
teamd_read_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceTeam * self = user_data;
|
||||
NMDeviceTeam *self = user_data;
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
|
||||
priv->teamd_read_timeout = 0;
|
||||
|
@ -161,10 +161,10 @@ teamd_read_timeout_cb(gpointer user_data)
|
|||
static void
|
||||
update_connection(NMDevice *device, NMConnection *connection)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(device);
|
||||
NMSettingTeam * s_team = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_TEAM);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(device);
|
||||
NMSettingTeam *s_team = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_TEAM);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
struct teamdctl * tdc = priv->tdc;
|
||||
struct teamdctl *tdc = priv->tdc;
|
||||
|
||||
/* Read the configuration only if not already set */
|
||||
if (!priv->config && ensure_teamd_connection(device))
|
||||
|
@ -183,18 +183,18 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
master_update_slave_connection(NMDevice * self,
|
||||
NMDevice * slave,
|
||||
master_update_slave_connection(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingTeamPort *s_port;
|
||||
char * port_config = NULL;
|
||||
char *port_config = NULL;
|
||||
int err = 0;
|
||||
struct teamdctl * tdc;
|
||||
const char * team_port_config = NULL;
|
||||
const char * iface = nm_device_get_iface(self);
|
||||
const char * iface_slave = nm_device_get_iface(slave);
|
||||
struct teamdctl *tdc;
|
||||
const char *team_port_config = NULL;
|
||||
const char *iface = nm_device_get_iface(self);
|
||||
const char *iface_slave = nm_device_get_iface(slave);
|
||||
|
||||
tdc = teamdctl_alloc();
|
||||
if (!tdc) {
|
||||
|
@ -259,7 +259,7 @@ static void
|
|||
teamd_kill_cb(pid_t pid, gboolean success, int child_status, void *user_data)
|
||||
{
|
||||
gs_unref_object NMDeviceTeam *self = user_data;
|
||||
NMDeviceTeamPrivate * priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
|
||||
priv->kill_in_progress = FALSE;
|
||||
|
||||
|
@ -307,8 +307,8 @@ teamd_cleanup(NMDeviceTeam *self, gboolean free_tdc)
|
|||
static gboolean
|
||||
teamd_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(user_data);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(user_data);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
|
||||
g_return_val_if_fail(priv->teamd_timeout, FALSE);
|
||||
|
@ -342,7 +342,7 @@ static void
|
|||
teamd_ready(NMDeviceTeam *self)
|
||||
{
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
gboolean success;
|
||||
|
||||
if (priv->kill_in_progress) {
|
||||
|
@ -381,7 +381,7 @@ teamd_ready(NMDeviceTeam *self)
|
|||
static void
|
||||
teamd_gone(NMDeviceTeam *self)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState state;
|
||||
|
||||
teamd_cleanup(self, TRUE);
|
||||
|
@ -399,11 +399,11 @@ teamd_gone(NMDeviceTeam *self)
|
|||
|
||||
static void
|
||||
teamd_dbus_appeared(GDBusConnection *connection,
|
||||
const char * name,
|
||||
const char * name_owner,
|
||||
const char *name,
|
||||
const char *name_owner,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(user_data);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(user_data);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
|
||||
g_return_if_fail(priv->teamd_dbus_watch);
|
||||
|
@ -451,7 +451,7 @@ teamd_dbus_appeared(GDBusConnection *connection,
|
|||
static void
|
||||
teamd_dbus_vanished(GDBusConnection *dbus_connection, const char *name, gpointer user_data)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(user_data);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(user_data);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
|
||||
g_return_if_fail(priv->teamd_dbus_watch);
|
||||
|
@ -471,9 +471,9 @@ teamd_dbus_vanished(GDBusConnection *dbus_connection, const char *name, gpointer
|
|||
}
|
||||
|
||||
static void
|
||||
monitor_changed_cb(GFileMonitor * monitor,
|
||||
GFile * file,
|
||||
GFile * other_file,
|
||||
monitor_changed_cb(GFileMonitor *monitor,
|
||||
GFile *file,
|
||||
GFile *other_file,
|
||||
GFileMonitorEvent event_type,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@ -495,9 +495,9 @@ monitor_changed_cb(GFileMonitor * monitor,
|
|||
static void
|
||||
teamd_process_watch_cb(GPid pid, int status, gpointer user_data)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(user_data);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(user_data);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState state = nm_device_get_state(device);
|
||||
|
||||
g_return_if_fail(priv->teamd_process_watch);
|
||||
|
@ -545,8 +545,8 @@ static gboolean
|
|||
teamd_kill(NMDeviceTeam *self, const char *teamd_binary, GError **error)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *argv = NULL;
|
||||
gs_free char * tmp_str = NULL;
|
||||
gs_free const char ** envp = NULL;
|
||||
gs_free char *tmp_str = NULL;
|
||||
gs_free const char **envp = NULL;
|
||||
|
||||
if (!teamd_binary) {
|
||||
teamd_binary = nm_utils_find_helper("teamd", NULL, error);
|
||||
|
@ -581,18 +581,18 @@ teamd_kill(NMDeviceTeam *self, const char *teamd_binary, GError **error)
|
|||
static gboolean
|
||||
teamd_start(NMDeviceTeam *self)
|
||||
{
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
const char * iface = nm_device_get_ip_iface(NM_DEVICE(self));
|
||||
NMConnection * connection;
|
||||
gs_unref_ptrarray GPtrArray *argv = NULL;
|
||||
gs_free_error GError * error = NULL;
|
||||
gs_free char * tmp_str = NULL;
|
||||
const char * teamd_binary;
|
||||
const char * config;
|
||||
nm_auto_free const char *config_free = NULL;
|
||||
NMSettingTeam * s_team;
|
||||
gs_free char * cloned_mac = NULL;
|
||||
gs_free const char ** envp = NULL;
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
const char *iface = nm_device_get_ip_iface(NM_DEVICE(self));
|
||||
NMConnection *connection;
|
||||
gs_unref_ptrarray GPtrArray *argv = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char *tmp_str = NULL;
|
||||
const char *teamd_binary;
|
||||
const char *config;
|
||||
nm_auto_free const char *config_free = NULL;
|
||||
NMSettingTeam *s_team;
|
||||
gs_free char *cloned_mac = NULL;
|
||||
gs_free const char **envp = NULL;
|
||||
|
||||
connection = nm_device_get_applied_connection(NM_DEVICE(self));
|
||||
|
||||
|
@ -639,7 +639,7 @@ teamd_start(NMDeviceTeam *self)
|
|||
}
|
||||
|
||||
if (cloned_mac) {
|
||||
json_t * json, *hwaddr;
|
||||
json_t *json, *hwaddr;
|
||||
json_error_t jerror;
|
||||
|
||||
/* Inject the hwaddr property into the JSON configuration.
|
||||
|
@ -706,11 +706,11 @@ teamd_start(NMDeviceTeam *self)
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
gs_free_error GError *error = NULL;
|
||||
NMSettingTeam * s_team;
|
||||
const char * cfg;
|
||||
NMSettingTeam *s_team;
|
||||
const char *cfg;
|
||||
|
||||
if (nm_device_sys_iface_state_is_external(device))
|
||||
return NM_ACT_STAGE_RETURN_SUCCESS;
|
||||
|
@ -773,7 +773,7 @@ act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
static void
|
||||
deactivate(NMDevice *device)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
|
||||
priv->stage1_state = NM_DEVICE_STAGE_STATE_INIT;
|
||||
|
@ -793,11 +793,11 @@ deactivate(NMDevice *device)
|
|||
static gboolean
|
||||
enslave_slave(NMDevice *device, NMDevice *slave, NMConnection *connection, gboolean configure)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
gboolean success = TRUE;
|
||||
const char * slave_iface = nm_device_get_ip_iface(slave);
|
||||
NMSettingTeamPort * s_team_port;
|
||||
const char *slave_iface = nm_device_get_ip_iface(slave);
|
||||
NMSettingTeamPort *s_team_port;
|
||||
|
||||
nm_device_master_check_slave_physical_port(device, slave, LOGD_TEAM);
|
||||
|
||||
|
@ -851,10 +851,10 @@ enslave_slave(NMDevice *device, NMDevice *slave, NMConnection *connection, gbool
|
|||
static void
|
||||
release_slave(NMDevice *device, NMDevice *slave, gboolean configure)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(device);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
gboolean do_release, success;
|
||||
NMSettingTeamPort * s_port;
|
||||
NMSettingTeamPort *s_port;
|
||||
int ifindex_slave;
|
||||
int ifindex;
|
||||
|
||||
|
@ -901,11 +901,11 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean configure)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
create_and_realize(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
NMDevice * parent,
|
||||
create_and_realize(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDevice *parent,
|
||||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char *iface = nm_device_get_iface(device);
|
||||
int r;
|
||||
|
@ -953,11 +953,11 @@ nm_device_team_init(NMDeviceTeam *self)
|
|||
static void
|
||||
constructed(GObject *object)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(object);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(device);
|
||||
gs_free char * tmp_str = NULL;
|
||||
gs_unref_object GFile *file = NULL;
|
||||
GError * error;
|
||||
NMDevice *device = NM_DEVICE(object);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(device);
|
||||
gs_free char *tmp_str = NULL;
|
||||
gs_unref_object GFile *file = NULL;
|
||||
GError *error;
|
||||
|
||||
G_OBJECT_CLASS(nm_device_team_parent_class)->constructed(object);
|
||||
|
||||
|
@ -1005,7 +1005,7 @@ nm_device_team_new(const char *iface)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceTeam * self = NM_DEVICE_TEAM(object);
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(object);
|
||||
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self);
|
||||
|
||||
if (priv->teamd_dbus_watch) {
|
||||
|
@ -1039,9 +1039,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_team = {
|
|||
static void
|
||||
nm_device_team_class_init(NMDeviceTeamClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->constructed = constructed;
|
||||
object_class->dispose = dispose;
|
||||
|
|
|
@ -43,7 +43,7 @@ NM_DEVICE_FACTORY_DECLARE_TYPES(NM_DEVICE_FACTORY_DECLARE_LINK_TYPES(
|
|||
NM_LINK_TYPE_TEAM) NM_DEVICE_FACTORY_DECLARE_SETTING_TYPES(NM_SETTING_TEAM_SETTING_NAME))
|
||||
|
||||
G_MODULE_EXPORT NMDeviceFactory *
|
||||
nm_device_factory_create(GError **error)
|
||||
nm_device_factory_create(GError **error)
|
||||
{
|
||||
nm_manager_set_capability(NM_MANAGER_GET, NM_CAPABILITY_TEAM);
|
||||
return g_object_new(NM_TYPE_TEAM_FACTORY, NULL);
|
||||
|
@ -52,11 +52,11 @@ G_MODULE_EXPORT NMDeviceFactory *
|
|||
/*****************************************************************************/
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
return nm_device_team_new(iface);
|
||||
}
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
static GVariant *
|
||||
get_lldp_neighbor(GVariant * neighbors,
|
||||
get_lldp_neighbor(GVariant *neighbors,
|
||||
int chassis_id_type,
|
||||
const char *chassis_id,
|
||||
int port_id_type,
|
||||
const char *port_id)
|
||||
{
|
||||
GVariantIter iter;
|
||||
GVariant * variant;
|
||||
GVariant * result = NULL;
|
||||
GVariant *variant;
|
||||
GVariant *result = NULL;
|
||||
|
||||
nmtst_assert_variant_is_of_type(neighbors, G_VARIANT_TYPE("aa{sv}"));
|
||||
|
||||
|
@ -81,15 +81,15 @@ typedef struct {
|
|||
typedef struct {
|
||||
gsize frame_len;
|
||||
const uint8_t *frame;
|
||||
const char * as_variant;
|
||||
const char *as_variant;
|
||||
} TestRecvFrame;
|
||||
|
||||
#define TEST_RECV_FRAME_DEFINE(name, _as_variant, ...) \
|
||||
static const guint8 _##name##_v[] = {__VA_ARGS__}; \
|
||||
static const TestRecvFrame name = { \
|
||||
.as_variant = _as_variant, \
|
||||
.frame_len = sizeof(_##name##_v), \
|
||||
.frame = _##name##_v, \
|
||||
.as_variant = _as_variant, \
|
||||
.frame_len = sizeof(_##name##_v), \
|
||||
.frame = _##name##_v, \
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
@ -183,7 +183,7 @@ TEST_RECV_FRAME_DEFINE(
|
|||
static void
|
||||
_test_recv_data0_check_do(GMainLoop *loop, NMLldpListener *listener, const TestRecvFrame *frame)
|
||||
{
|
||||
GVariant * neighbors, *attr;
|
||||
GVariant *neighbors, *attr;
|
||||
gs_unref_variant GVariant *neighbor = NULL;
|
||||
|
||||
neighbors = nm_lldp_listener_get_neighbors(listener);
|
||||
|
@ -537,10 +537,10 @@ TEST_RECV_FRAME_DEFINE(
|
|||
static void
|
||||
_test_recv_data1_check(GMainLoop *loop, NMLldpListener *listener, TestRecvCallbackInfo *info)
|
||||
{
|
||||
GVariant * neighbors, *attr, *child;
|
||||
GVariant *neighbors, *attr, *child;
|
||||
gs_unref_variant GVariant *neighbor = NULL;
|
||||
guint v_uint = 0;
|
||||
const char * v_str = NULL;
|
||||
const char *v_str = NULL;
|
||||
|
||||
neighbors = nm_lldp_listener_get_neighbors(listener);
|
||||
nmtst_assert_variant_is_of_type(neighbors, G_VARIANT_TYPE("aa{sv}"));
|
||||
|
@ -868,12 +868,12 @@ lldp_neighbors_changed(NMLldpListener *lldp_listener, gpointer user_data)
|
|||
static void
|
||||
test_recv(TestRecvFixture *fixture, gconstpointer user_data)
|
||||
{
|
||||
const TestRecvData * data = user_data;
|
||||
NMLldpListener * listener;
|
||||
GMainLoop * loop;
|
||||
const TestRecvData *data = user_data;
|
||||
NMLldpListener *listener;
|
||||
GMainLoop *loop;
|
||||
TestRecvCallbackInfo info = {};
|
||||
gsize i_frames;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
guint sd_id;
|
||||
|
||||
if (fixture->ifindex == 0) {
|
||||
|
@ -918,10 +918,10 @@ _test_recv_fixture_teardown(TestRecvFixture *fixture, gconstpointer user_data)
|
|||
static void
|
||||
test_parse_frames(gconstpointer test_data)
|
||||
{
|
||||
const TestRecvFrame *frame = test_data;
|
||||
const TestRecvFrame *frame = test_data;
|
||||
gs_unref_variant GVariant *v_neighbor = NULL;
|
||||
gs_unref_variant GVariant *attr = NULL;
|
||||
gs_free char * as_variant = NULL;
|
||||
gs_free char *as_variant = NULL;
|
||||
|
||||
v_neighbor = nmtst_lldp_parse_from_raw(frame->frame, frame->frame_len);
|
||||
g_assert(v_neighbor);
|
||||
|
|
|
@ -48,14 +48,14 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMDeviceIwd,
|
|||
PROP_LAST_SCAN, );
|
||||
|
||||
typedef struct {
|
||||
GDBusObject * dbus_obj;
|
||||
GDBusProxy * dbus_device_proxy;
|
||||
GDBusProxy * dbus_station_proxy;
|
||||
GDBusProxy * dbus_ap_proxy;
|
||||
GDBusProxy * dbus_adhoc_proxy;
|
||||
GDBusObject *dbus_obj;
|
||||
GDBusProxy *dbus_device_proxy;
|
||||
GDBusProxy *dbus_station_proxy;
|
||||
GDBusProxy *dbus_ap_proxy;
|
||||
GDBusProxy *dbus_adhoc_proxy;
|
||||
CList aps_lst_head;
|
||||
NMWifiAP * current_ap;
|
||||
GCancellable * cancellable;
|
||||
NMWifiAP *current_ap;
|
||||
GCancellable *cancellable;
|
||||
_NMDeviceWifiCapabilities capabilities;
|
||||
NMActRequestGetSecretsCallId *wifi_secrets_id;
|
||||
guint periodic_scan_id;
|
||||
|
@ -74,8 +74,8 @@ typedef struct {
|
|||
uint32_t ap_id;
|
||||
guint32 rate;
|
||||
NMEtherAddr current_ap_bssid;
|
||||
GDBusMethodInvocation * pending_agent_request;
|
||||
NMActiveConnection * assumed_ac;
|
||||
GDBusMethodInvocation *pending_agent_request;
|
||||
NMActiveConnection *assumed_ac;
|
||||
guint assumed_ac_timeout;
|
||||
} NMDeviceIwdPrivate;
|
||||
|
||||
|
@ -120,7 +120,7 @@ _ap_dump(NMDeviceIwd *self, NMLogLevel log_level, const NMWifiAP *ap, const char
|
|||
static void
|
||||
ap_add_remove(NMDeviceIwd *self,
|
||||
gboolean is_adding, /* or else is removing */
|
||||
NMWifiAP * ap,
|
||||
NMWifiAP *ap,
|
||||
gboolean recheck_available_connections)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
|
@ -156,7 +156,7 @@ static void
|
|||
set_current_ap(NMDeviceIwd *self, NMWifiAP *new_ap, gboolean recheck_available_connections)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv;
|
||||
NMWifiAP * old_ap;
|
||||
NMWifiAP *old_ap;
|
||||
|
||||
g_return_if_fail(NM_IS_DEVICE_IWD(self));
|
||||
|
||||
|
@ -186,7 +186,7 @@ static void
|
|||
remove_all_aps(NMDeviceIwd *self)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMWifiAP * ap, *ap_safe;
|
||||
NMWifiAP *ap, *ap_safe;
|
||||
|
||||
if (c_list_is_empty(&priv->aps_lst_head))
|
||||
return;
|
||||
|
@ -219,20 +219,20 @@ ap_security_flags_from_network_type(const char *type)
|
|||
|
||||
static NMWifiAP *
|
||||
ap_from_network(NMDeviceIwd *self,
|
||||
GDBusProxy * network,
|
||||
GDBusProxy *network,
|
||||
NMRefString *bss_path,
|
||||
gint64 last_seen_msec,
|
||||
int16_t signal)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
gs_unref_variant GVariant *name_value = NULL;
|
||||
gs_unref_variant GVariant *type_value = NULL;
|
||||
const char * name;
|
||||
const char * type;
|
||||
const char *name;
|
||||
const char *type;
|
||||
uint32_t ap_id;
|
||||
gs_unref_bytes GBytes *ssid = NULL;
|
||||
NMWifiAP * ap;
|
||||
NMSupplicantBssInfo bss_info;
|
||||
gs_unref_bytes GBytes *ssid = NULL;
|
||||
NMWifiAP *ap;
|
||||
NMSupplicantBssInfo bss_info;
|
||||
|
||||
g_return_val_if_fail(network, NULL);
|
||||
|
||||
|
@ -284,14 +284,14 @@ ap_from_network(NMDeviceIwd *self,
|
|||
|
||||
static void
|
||||
insert_ap_from_network(NMDeviceIwd *self,
|
||||
GHashTable * aps,
|
||||
const char * path,
|
||||
GHashTable *aps,
|
||||
const char *path,
|
||||
gint64 last_seen_msec,
|
||||
int16_t signal)
|
||||
{
|
||||
gs_unref_object GDBusProxy *network_proxy = NULL;
|
||||
nm_auto_ref_string NMRefString *bss_path = nm_ref_string_new(path);
|
||||
NMWifiAP * ap;
|
||||
gs_unref_object GDBusProxy *network_proxy = NULL;
|
||||
nm_auto_ref_string NMRefString *bss_path = nm_ref_string_new(path);
|
||||
NMWifiAP *ap;
|
||||
|
||||
if (g_hash_table_lookup(aps, bss_path)) {
|
||||
_LOGD(LOGD_WIFI, "Duplicate network at %s", path);
|
||||
|
@ -311,16 +311,16 @@ insert_ap_from_network(NMDeviceIwd *self,
|
|||
static void
|
||||
get_ordered_networks_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = user_data;
|
||||
NMDeviceIwdPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
GVariantIter * networks;
|
||||
const char * path;
|
||||
int16_t signal;
|
||||
NMWifiAP * ap, *ap_safe, *new_ap;
|
||||
gboolean changed;
|
||||
GHashTableIter ap_iter;
|
||||
NMDeviceIwd *self = user_data;
|
||||
NMDeviceIwdPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
GVariantIter *networks;
|
||||
const char *path;
|
||||
int16_t signal;
|
||||
NMWifiAP *ap, *ap_safe, *new_ap;
|
||||
gboolean changed;
|
||||
GHashTableIter ap_iter;
|
||||
gs_unref_hashtable GHashTable *new_aps = NULL;
|
||||
gint64 last_seen_msec;
|
||||
|
||||
|
@ -421,7 +421,7 @@ periodic_update(NMDeviceIwd *self)
|
|||
int percent;
|
||||
NMEtherAddr bssid;
|
||||
gboolean ap_changed = FALSE;
|
||||
NMPlatform * platform;
|
||||
NMPlatform *platform;
|
||||
|
||||
ifindex = nm_device_get_ifindex(NM_DEVICE(self));
|
||||
if (ifindex <= 0)
|
||||
|
@ -528,8 +528,8 @@ cleanup_association_attempt(NMDeviceIwd *self, gboolean disconnect)
|
|||
}
|
||||
|
||||
static void
|
||||
reset_mode(NMDeviceIwd * self,
|
||||
GCancellable * cancellable,
|
||||
reset_mode(NMDeviceIwd *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@ -575,7 +575,7 @@ get_variant_state(GVariant *v)
|
|||
static void
|
||||
deactivate(NMDevice *device)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
|
||||
if (!priv->dbus_obj)
|
||||
|
@ -608,8 +608,8 @@ disconnect_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
|||
gs_unref_object NMDeviceIwd *self = NULL;
|
||||
NMDeviceDeactivateCallback callback;
|
||||
gpointer callback_user_data;
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
nm_utils_user_data_unpack(user_data, &self, &callback, &callback_user_data);
|
||||
|
||||
|
@ -623,7 +623,7 @@ disconnect_cb_on_idle(gpointer user_data, GCancellable *cancellable)
|
|||
gs_unref_object NMDeviceIwd *self = NULL;
|
||||
NMDeviceDeactivateCallback callback;
|
||||
gpointer callback_user_data;
|
||||
gs_free_error GError *cancelled_error = NULL;
|
||||
gs_free_error GError *cancelled_error = NULL;
|
||||
|
||||
nm_utils_user_data_unpack(user_data, &self, &callback, &callback_user_data);
|
||||
|
||||
|
@ -632,12 +632,12 @@ disconnect_cb_on_idle(gpointer user_data, GCancellable *cancellable)
|
|||
}
|
||||
|
||||
static void
|
||||
deactivate_async(NMDevice * device,
|
||||
GCancellable * cancellable,
|
||||
deactivate_async(NMDevice *device,
|
||||
GCancellable *cancellable,
|
||||
NMDeviceDeactivateCallback callback,
|
||||
gpointer callback_user_data)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
gpointer user_data;
|
||||
|
||||
|
@ -676,7 +676,7 @@ static gboolean
|
|||
is_connection_known_network(NMConnection *connection)
|
||||
{
|
||||
NMIwdNetworkSecurity security;
|
||||
gs_free char * ssid = NULL;
|
||||
gs_free char *ssid = NULL;
|
||||
|
||||
if (!nm_wifi_connection_get_iwd_ssid_and_security(connection, &ssid, &security))
|
||||
return FALSE;
|
||||
|
@ -688,7 +688,7 @@ static gboolean
|
|||
is_ap_known_network(NMWifiAP *ap)
|
||||
{
|
||||
gs_unref_object GDBusProxy *network_proxy = NULL;
|
||||
gs_unref_variant GVariant *known_network = NULL;
|
||||
gs_unref_variant GVariant *known_network = NULL;
|
||||
|
||||
network_proxy =
|
||||
nm_iwd_manager_get_dbus_interface(nm_iwd_manager_get(),
|
||||
|
@ -704,17 +704,17 @@ is_ap_known_network(NMWifiAP *ap)
|
|||
static gboolean
|
||||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate * priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMSettingWireless * s_wireless;
|
||||
const char * mac;
|
||||
const char *const * mac_blacklist;
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMSettingWireless *s_wireless;
|
||||
const char *mac;
|
||||
const char *const *mac_blacklist;
|
||||
int i;
|
||||
const char * perm_hw_addr;
|
||||
const char * mode;
|
||||
const char *perm_hw_addr;
|
||||
const char *mode;
|
||||
NMIwdNetworkSecurity security;
|
||||
GBytes * ssid;
|
||||
const guint8 * ssid_bytes;
|
||||
GBytes *ssid;
|
||||
const guint8 *ssid_bytes;
|
||||
gsize ssid_len;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_iwd_parent_class)
|
||||
|
@ -860,17 +860,17 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
check_connection_available(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
check_connection_available(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDeviceCheckConAvailableFlags flags,
|
||||
const char * specific_object,
|
||||
GError ** error)
|
||||
const char *specific_object,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate * priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMSettingWireless * s_wifi;
|
||||
const char * mode;
|
||||
NMWifiAP * ap = NULL;
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMSettingWireless *s_wifi;
|
||||
const char *mode;
|
||||
NMWifiAP *ap = NULL;
|
||||
NMIwdNetworkSecurity security;
|
||||
|
||||
s_wifi = nm_connection_get_setting_wireless(connection);
|
||||
|
@ -952,20 +952,20 @@ iwd_ssid_to_str(const GBytes *ssid)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMSettingWireless * s_wifi;
|
||||
gs_free char * ssid_utf8 = NULL;
|
||||
NMWifiAP * ap;
|
||||
GBytes * ssid = NULL;
|
||||
NMSettingWireless *s_wifi;
|
||||
gs_free char *ssid_utf8 = NULL;
|
||||
NMWifiAP *ap;
|
||||
GBytes *ssid = NULL;
|
||||
gboolean hidden = FALSE;
|
||||
const char * mode;
|
||||
const char *mode;
|
||||
|
||||
s_wifi = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_WIRELESS);
|
||||
|
||||
|
@ -1059,7 +1059,7 @@ complete_connection(NMDevice * device,
|
|||
static gboolean
|
||||
is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDeviceState state = nm_device_get_state(device);
|
||||
|
||||
|
@ -1088,12 +1088,12 @@ get_autoconnect_allowed(NMDevice *device)
|
|||
static gboolean
|
||||
can_auto_connect(NMDevice *device, NMSettingsConnection *sett_conn, char **specific_object)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMConnection * connection;
|
||||
NMSettingWireless * s_wifi;
|
||||
NMWifiAP * ap;
|
||||
const char * mode;
|
||||
NMConnection *connection;
|
||||
NMSettingWireless *s_wifi;
|
||||
NMWifiAP *ap;
|
||||
const char *mode;
|
||||
guint64 timestamp = 0;
|
||||
|
||||
nm_assert(!specific_object || !*specific_object);
|
||||
|
@ -1141,10 +1141,10 @@ _nm_device_iwd_get_aps(NMDeviceIwd *self)
|
|||
static void
|
||||
scan_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = user_data;
|
||||
NMDeviceIwdPrivate *priv;
|
||||
NMDeviceIwd *self = user_data;
|
||||
NMDeviceIwdPrivate *priv;
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
variant = g_dbus_proxy_call_finish(G_DBUS_PROXY(source), res, &error);
|
||||
if (!variant && nm_utils_error_is_cancelled(error))
|
||||
|
@ -1165,14 +1165,14 @@ scan_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
dbus_request_scan_cb(NMDevice * device,
|
||||
dbus_request_scan_cb(NMDevice *device,
|
||||
GDBusMethodInvocation *context,
|
||||
NMAuthSubject * subject,
|
||||
GError * error,
|
||||
NMAuthSubject *subject,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv;
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv;
|
||||
gs_unref_variant GVariant *scan_options = user_data;
|
||||
|
||||
if (error) {
|
||||
|
@ -1229,7 +1229,7 @@ void
|
|||
_nm_device_iwd_request_scan(NMDeviceIwd *self, GVariant *options, GDBusMethodInvocation *invocation)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
|
||||
if (!priv->can_scan) {
|
||||
g_dbus_method_invocation_return_error_literal(invocation,
|
||||
|
@ -1283,7 +1283,7 @@ static const char *
|
|||
get_agent_request_network_path(GDBusMethodInvocation *invocation)
|
||||
{
|
||||
const char *method_name = g_dbus_method_invocation_get_method_name(invocation);
|
||||
GVariant * params = g_dbus_method_invocation_get_parameters(invocation);
|
||||
GVariant *params = g_dbus_method_invocation_get_parameters(invocation);
|
||||
const char *network_path = NULL;
|
||||
|
||||
if (nm_streq(method_name, "RequestPassphrase"))
|
||||
|
@ -1308,17 +1308,17 @@ get_agent_request_network_path(GDBusMethodInvocation *invocation)
|
|||
* Return TRUE in either case, return FALSE if an error is detected.
|
||||
*/
|
||||
static gboolean
|
||||
try_reply_agent_request(NMDeviceIwd * self,
|
||||
NMConnection * connection,
|
||||
try_reply_agent_request(NMDeviceIwd *self,
|
||||
NMConnection *connection,
|
||||
GDBusMethodInvocation *invocation,
|
||||
gboolean allow_existing,
|
||||
const char ** setting_name,
|
||||
const char ** setting_key,
|
||||
gboolean * replied)
|
||||
const char **setting_name,
|
||||
const char **setting_key,
|
||||
gboolean *replied)
|
||||
{
|
||||
const char * method_name = g_dbus_method_invocation_get_method_name(invocation);
|
||||
const char *method_name = g_dbus_method_invocation_get_method_name(invocation);
|
||||
NMSettingWirelessSecurity *s_wireless_sec;
|
||||
NMSetting8021x * s_8021x;
|
||||
NMSetting8021x *s_8021x;
|
||||
|
||||
s_wireless_sec = nm_connection_get_setting_wireless_security(connection);
|
||||
s_8021x = nm_connection_get_setting_802_1x(connection);
|
||||
|
@ -1418,7 +1418,7 @@ try_reply_agent_request(NMDeviceIwd * self,
|
|||
static gboolean
|
||||
assumed_ac_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = user_data;
|
||||
NMDeviceIwd *self = user_data;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
|
||||
nm_assert(priv->assumed_ac);
|
||||
|
@ -1434,30 +1434,30 @@ assumed_ac_timeout_cb(gpointer user_data)
|
|||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void wifi_secrets_get_one(NMDeviceIwd * self,
|
||||
const char * setting_name,
|
||||
static void wifi_secrets_get_one(NMDeviceIwd *self,
|
||||
const char *setting_name,
|
||||
NMSecretAgentGetSecretsFlags flags,
|
||||
const char * setting_key,
|
||||
GDBusMethodInvocation * invocation);
|
||||
const char *setting_key,
|
||||
GDBusMethodInvocation *invocation);
|
||||
|
||||
static void
|
||||
wifi_secrets_cb(NMActRequest * req,
|
||||
wifi_secrets_cb(NMActRequest *req,
|
||||
NMActRequestGetSecretsCallId *call_id,
|
||||
NMSettingsConnection * s_connection,
|
||||
GError * error,
|
||||
NMSettingsConnection *s_connection,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self;
|
||||
NMDeviceIwdPrivate * priv;
|
||||
NMDevice * device;
|
||||
GDBusMethodInvocation * invocation;
|
||||
const char * setting_name;
|
||||
const char * setting_key;
|
||||
NMDeviceIwd *self;
|
||||
NMDeviceIwdPrivate *priv;
|
||||
NMDevice *device;
|
||||
GDBusMethodInvocation *invocation;
|
||||
const char *setting_name;
|
||||
const char *setting_key;
|
||||
gboolean replied;
|
||||
NMSecretAgentGetSecretsFlags get_secret_flags =
|
||||
NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION;
|
||||
NMIwdNetworkSecurity security;
|
||||
NMConnection * connection;
|
||||
NMConnection *connection;
|
||||
|
||||
nm_utils_user_data_unpack(user_data, &self, &invocation);
|
||||
|
||||
|
@ -1550,14 +1550,14 @@ secrets_error:
|
|||
}
|
||||
|
||||
static void
|
||||
wifi_secrets_get_one(NMDeviceIwd * self,
|
||||
const char * setting_name,
|
||||
wifi_secrets_get_one(NMDeviceIwd *self,
|
||||
const char *setting_name,
|
||||
NMSecretAgentGetSecretsFlags flags,
|
||||
const char * setting_key,
|
||||
GDBusMethodInvocation * invocation)
|
||||
const char *setting_key,
|
||||
GDBusMethodInvocation *invocation)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMActRequest * req;
|
||||
NMActRequest *req;
|
||||
|
||||
wifi_secrets_cancel(self);
|
||||
|
||||
|
@ -1576,16 +1576,16 @@ wifi_secrets_get_one(NMDeviceIwd * self,
|
|||
static void
|
||||
network_connect_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = user_data;
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDeviceIwd *self = user_data;
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMConnection * connection;
|
||||
gs_free char * ssid = NULL;
|
||||
NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED;
|
||||
GVariant * value;
|
||||
gboolean disconnect;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMConnection *connection;
|
||||
gs_free char *ssid = NULL;
|
||||
NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED;
|
||||
GVariant *value;
|
||||
gboolean disconnect;
|
||||
|
||||
disconnect = !priv->iwd_autoconnect
|
||||
|| nm_device_autoconnect_blocked_get(device, NM_DEVICE_AUTOCONNECT_BLOCKED_ALL);
|
||||
|
@ -1667,10 +1667,10 @@ failed:
|
|||
static void
|
||||
act_failed_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = user_data;
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceIwd *self = user_data;
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
variant = g_dbus_proxy_call_finish(G_DBUS_PROXY(source), res, &error);
|
||||
if (!variant && nm_utils_error_is_cancelled(error))
|
||||
|
@ -1689,12 +1689,12 @@ act_failed_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
|||
static void
|
||||
act_start_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = user_data;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceIwd *self = user_data;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char * ssid = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char *ssid = NULL;
|
||||
|
||||
variant = g_dbus_proxy_call_finish(G_DBUS_PROXY(source), res, &error);
|
||||
if (!variant) {
|
||||
|
@ -1736,12 +1736,12 @@ error:
|
|||
static void
|
||||
act_check_interface(NMDeviceIwd *self)
|
||||
{
|
||||
NMDeviceIwdPrivate * priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMSettingWireless * s_wireless;
|
||||
GDBusProxy * proxy = NULL;
|
||||
gs_free char * ssid = NULL;
|
||||
const char * mode;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMSettingWireless *s_wireless;
|
||||
GDBusProxy *proxy = NULL;
|
||||
gs_free char *ssid = NULL;
|
||||
const char *mode;
|
||||
NMIwdNetworkSecurity security;
|
||||
|
||||
if (!priv->act_mode_switch)
|
||||
|
@ -1780,7 +1780,7 @@ act_check_interface(NMDeviceIwd *self)
|
|||
self);
|
||||
} else if (security == NM_IWD_NETWORK_SECURITY_PSK) {
|
||||
NMSettingWirelessSecurity *s_wireless_sec;
|
||||
const char * psk;
|
||||
const char *psk;
|
||||
|
||||
s_wireless_sec = (NMSettingWirelessSecurity *) nm_device_get_applied_setting(
|
||||
device,
|
||||
|
@ -1813,11 +1813,11 @@ failed:
|
|||
static void
|
||||
act_set_mode_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = user_data;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceIwd *self = user_data;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
variant = g_dbus_proxy_call_finish(G_DBUS_PROXY(source), res, &error);
|
||||
if (!variant) {
|
||||
|
@ -1848,10 +1848,10 @@ static void
|
|||
act_set_mode(NMDeviceIwd *self)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
const char * iwd_mode;
|
||||
const char * mode;
|
||||
NMSettingWireless * s_wireless;
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
const char *iwd_mode;
|
||||
const char *mode;
|
||||
NMSettingWireless *s_wireless;
|
||||
|
||||
s_wireless =
|
||||
(NMSettingWireless *) nm_device_get_applied_setting(device, NM_TYPE_SETTING_WIRELESS);
|
||||
|
@ -1880,15 +1880,15 @@ act_set_mode(NMDeviceIwd *self)
|
|||
}
|
||||
|
||||
static void
|
||||
act_psk_cb(NMActRequest * req,
|
||||
act_psk_cb(NMActRequest *req,
|
||||
NMActRequestGetSecretsCallId *call_id,
|
||||
NMSettingsConnection * s_connection,
|
||||
GError * error,
|
||||
NMSettingsConnection *s_connection,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = user_data;
|
||||
NMDeviceIwd *self = user_data;
|
||||
NMDeviceIwdPrivate *priv;
|
||||
NMDevice * device;
|
||||
NMDevice *device;
|
||||
|
||||
if (nm_utils_error_is_cancelled(error))
|
||||
return;
|
||||
|
@ -1944,7 +1944,7 @@ static NMWifiAP *
|
|||
find_ap_by_supplicant_path(NMDeviceIwd *self, const NMRefString *path)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMWifiAP * tmp;
|
||||
NMWifiAP *tmp;
|
||||
|
||||
c_list_for_each_entry (tmp, &priv->aps_lst_head, aps_lst)
|
||||
if (nm_wifi_ap_get_supplicant_path(tmp) == path)
|
||||
|
@ -1956,7 +1956,7 @@ find_ap_by_supplicant_path(NMDeviceIwd *self, const NMRefString *path)
|
|||
static void
|
||||
assumed_connection_state_changed(NMActiveConnection *active, GParamSpec *pspec, NMDeviceIwd *self)
|
||||
{
|
||||
NMSettingsConnection * sett_conn = nm_active_connection_get_settings_connection(active);
|
||||
NMSettingsConnection *sett_conn = nm_active_connection_get_settings_connection(active);
|
||||
NMActiveConnectionState state = nm_active_connection_get_state(active);
|
||||
|
||||
/* Delete the temporary connection created for an external IWD connection
|
||||
|
@ -1983,10 +1983,10 @@ assumed_connection_state_changed(NMActiveConnection *active, GParamSpec *pspec,
|
|||
|
||||
static void
|
||||
assumed_connection_state_changed_before_managed(NMActiveConnection *active,
|
||||
GParamSpec * pspec,
|
||||
NMDeviceIwd * self)
|
||||
GParamSpec *pspec,
|
||||
NMDeviceIwd *self)
|
||||
{
|
||||
NMDeviceIwdPrivate * priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMActiveConnectionState state = nm_active_connection_get_state(active);
|
||||
gboolean disconnect;
|
||||
|
||||
|
@ -2020,11 +2020,11 @@ assumed_connection_state_changed_before_managed(NMActiveConnection *active,
|
|||
static void
|
||||
assume_connection(NMDeviceIwd *self, NMWifiAP *ap)
|
||||
{
|
||||
NMDeviceIwdPrivate * priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMSettingsConnection *sett_conn;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMSettingsConnection *sett_conn;
|
||||
gs_unref_object NMAuthSubject *subject = NULL;
|
||||
NMActiveConnection * ac;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMActiveConnection *ac;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
/* We can use the .update_connection / nm_device_emit_recheck_assume
|
||||
* API but we can also pass an assumed/external activation type
|
||||
|
@ -2104,7 +2104,7 @@ static void
|
|||
assumed_connection_progress_to_ip_config(NMDeviceIwd *self, gboolean was_postponed)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState dev_state = nm_device_get_state(device);
|
||||
|
||||
wifi_secrets_cancel(self);
|
||||
|
@ -2133,11 +2133,11 @@ assumed_connection_progress_to_ip_config(NMDeviceIwd *self, gboolean was_postpon
|
|||
static void
|
||||
initial_check_assume(NMDeviceIwd *self)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
const char * network_path_str;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
const char *network_path_str;
|
||||
nm_auto_ref_string NMRefString *network_path = NULL;
|
||||
NMWifiAP * ap = NULL;
|
||||
gs_unref_variant GVariant *state_value =
|
||||
NMWifiAP *ap = NULL;
|
||||
gs_unref_variant GVariant *state_value =
|
||||
g_dbus_proxy_get_cached_property(priv->dbus_station_proxy, "State");
|
||||
gs_unref_variant GVariant *cn_value =
|
||||
g_dbus_proxy_get_cached_property(priv->dbus_station_proxy, "ConnectedNetwork");
|
||||
|
@ -2174,15 +2174,15 @@ initial_check_assume(NMDeviceIwd *self)
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMWifiAP * ap = NULL;
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMWifiAP *ap = NULL;
|
||||
gs_unref_object NMWifiAP *ap_fake = NULL;
|
||||
NMActRequest * req;
|
||||
NMConnection * connection;
|
||||
NMSettingWireless * s_wireless;
|
||||
const char * mode;
|
||||
const char * ap_path;
|
||||
NMActRequest *req;
|
||||
NMConnection *connection;
|
||||
NMSettingWireless *s_wireless;
|
||||
const char *mode;
|
||||
const char *ap_path;
|
||||
|
||||
req = nm_device_get_act_request(device);
|
||||
g_return_val_if_fail(req, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
@ -2246,12 +2246,12 @@ add_new:
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMActRequest * req;
|
||||
NMConnection * connection;
|
||||
NMSettingWireless * s_wireless;
|
||||
const char * mode;
|
||||
NMActRequest *req;
|
||||
NMConnection *connection;
|
||||
NMSettingWireless *s_wireless;
|
||||
const char *mode;
|
||||
|
||||
req = nm_device_get_act_request(device);
|
||||
connection = nm_act_request_get_applied_connection(req);
|
||||
|
@ -2262,8 +2262,8 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
|
||||
if (NM_IN_STRSET(mode, NULL, NM_SETTING_WIRELESS_MODE_INFRA)) {
|
||||
gs_unref_object GDBusProxy *network_proxy = NULL;
|
||||
NMWifiAP * ap = priv->current_ap;
|
||||
NMSettingWirelessSecurity * s_wireless_sec;
|
||||
NMWifiAP *ap = priv->current_ap;
|
||||
NMSettingWirelessSecurity *s_wireless_sec;
|
||||
|
||||
if (!ap) {
|
||||
NM_SET_OUT(out_failure_reason, NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED);
|
||||
|
@ -2432,7 +2432,7 @@ get_configured_mtu(NMDevice *device, NMDeviceMtuSource *out_source, gboolean *ou
|
|||
static gboolean
|
||||
periodic_scan_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd * self = user_data;
|
||||
NMDeviceIwd *self = user_data;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
|
||||
priv->periodic_scan_id = 0;
|
||||
|
@ -2503,15 +2503,15 @@ set_can_scan(NMDeviceIwd *self, gboolean can_scan)
|
|||
}
|
||||
|
||||
static void
|
||||
device_state_changed(NMDevice * device,
|
||||
device_state_changed(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMSettingWireless * s_wireless;
|
||||
const char * mode;
|
||||
NMSettingWireless *s_wireless;
|
||||
const char *mode;
|
||||
|
||||
switch (new_state) {
|
||||
case NM_DEVICE_STATE_UNMANAGED:
|
||||
|
@ -2559,7 +2559,7 @@ get_enabled(NMDevice *device)
|
|||
static void
|
||||
set_enabled(NMDevice *device, gboolean enabled)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(device);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDeviceState state;
|
||||
|
||||
|
@ -2596,12 +2596,12 @@ set_enabled(NMDevice *device, gboolean enabled)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
can_reapply_change(NMDevice * device,
|
||||
can_reapply_change(NMDevice *device,
|
||||
const char *setting_name,
|
||||
NMSetting * s_old,
|
||||
NMSetting * s_new,
|
||||
NMSetting *s_old,
|
||||
NMSetting *s_new,
|
||||
GHashTable *diffs,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceClass *device_class;
|
||||
|
||||
|
@ -2624,9 +2624,9 @@ can_reapply_change(NMDevice * device,
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(object);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(object);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
const char ** list;
|
||||
const char **list;
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_MODE:
|
||||
|
@ -2673,18 +2673,18 @@ static void
|
|||
state_changed(NMDeviceIwd *self, const char *new_state)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState dev_state = nm_device_get_state(device);
|
||||
gboolean nm_connection = priv->current_ap || priv->assumed_ac;
|
||||
gboolean iwd_connection = FALSE;
|
||||
NMWifiAP * ap = NULL;
|
||||
NMWifiAP *ap = NULL;
|
||||
gboolean can_connect = priv->nm_autoconnect;
|
||||
|
||||
_LOGI(LOGD_DEVICE | LOGD_WIFI, "new IWD device state is %s", new_state);
|
||||
|
||||
if (NM_IN_STRSET(new_state, "connecting", "connected", "roaming")) {
|
||||
gs_unref_variant GVariant *value = NULL;
|
||||
const char * network_path_str;
|
||||
gs_unref_variant GVariant *value = NULL;
|
||||
const char *network_path_str;
|
||||
nm_auto_ref_string NMRefString *network_path = NULL;
|
||||
|
||||
value = g_dbus_proxy_get_cached_property(priv->dbus_station_proxy, "ConnectedNetwork");
|
||||
|
@ -2855,12 +2855,12 @@ scanning_changed(NMDeviceIwd *self, gboolean new_scanning)
|
|||
|
||||
static void
|
||||
station_properties_changed(GDBusProxy *proxy,
|
||||
GVariant * changed_properties,
|
||||
GVariant *changed_properties,
|
||||
GStrv invalidate_properties,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceIwd *self = user_data;
|
||||
const char * new_str;
|
||||
const char *new_str;
|
||||
gboolean new_bool;
|
||||
|
||||
if (g_variant_lookup(changed_properties, "State", "&s", &new_str))
|
||||
|
@ -2872,7 +2872,7 @@ station_properties_changed(GDBusProxy *proxy,
|
|||
|
||||
static void
|
||||
ap_adhoc_properties_changed(GDBusProxy *proxy,
|
||||
GVariant * changed_properties,
|
||||
GVariant *changed_properties,
|
||||
GStrv invalidate_properties,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@ -2889,7 +2889,7 @@ static void
|
|||
powered_changed(NMDeviceIwd *self, gboolean new_powered)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
GDBusInterface * interface;
|
||||
GDBusInterface *interface;
|
||||
|
||||
nm_device_queue_recheck_available(NM_DEVICE(self),
|
||||
NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE,
|
||||
|
@ -3004,7 +3004,7 @@ powered_changed(NMDeviceIwd *self, gboolean new_powered)
|
|||
|
||||
static void
|
||||
device_properties_changed(GDBusProxy *proxy,
|
||||
GVariant * changed_properties,
|
||||
GVariant *changed_properties,
|
||||
GStrv invalidate_properties,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@ -3016,11 +3016,11 @@ device_properties_changed(GDBusProxy *proxy,
|
|||
}
|
||||
|
||||
static void
|
||||
config_changed(NMConfig * config,
|
||||
NMConfigData * config_data,
|
||||
config_changed(NMConfig *config,
|
||||
NMConfigData *config_data,
|
||||
NMConfigChangeFlags changes,
|
||||
NMConfigData * old_data,
|
||||
NMDeviceIwd * self)
|
||||
NMConfigData *old_data,
|
||||
NMDeviceIwd *self)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
gboolean old_iwd_ac = priv->iwd_autoconnect;
|
||||
|
@ -3048,12 +3048,12 @@ config_changed(NMConfig * config,
|
|||
void
|
||||
nm_device_iwd_set_dbus_object(NMDeviceIwd *self, GDBusObject *object)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
GDBusInterface * interface;
|
||||
gs_unref_variant GVariant *value = NULL;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
GDBusInterface *interface;
|
||||
gs_unref_variant GVariant *value = NULL;
|
||||
gs_unref_object GDBusProxy *adapter_proxy = NULL;
|
||||
GVariantIter * iter;
|
||||
const char * mode;
|
||||
GVariantIter *iter;
|
||||
const char *mode;
|
||||
gboolean powered;
|
||||
_NMDeviceWifiCapabilities capabilities;
|
||||
|
||||
|
@ -3159,18 +3159,18 @@ error:
|
|||
gboolean
|
||||
nm_device_iwd_agent_query(NMDeviceIwd *self, GDBusMethodInvocation *invocation)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceIwdPrivate * priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDeviceState state = nm_device_get_state(device);
|
||||
const char * setting_name;
|
||||
const char * setting_key;
|
||||
const char *setting_name;
|
||||
const char *setting_key;
|
||||
gboolean replied;
|
||||
NMWifiAP * ap;
|
||||
NMWifiAP *ap;
|
||||
gboolean allow_existing = FALSE;
|
||||
NMSecretAgentGetSecretsFlags get_secret_flags =
|
||||
NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION;
|
||||
NMIwdNetworkSecurity security;
|
||||
NMConnection * connection;
|
||||
NMIwdNetworkSecurity security;
|
||||
NMConnection *connection;
|
||||
nm_auto_ref_string NMRefString *network_path = NULL;
|
||||
|
||||
if (!invocation) {
|
||||
|
@ -3324,9 +3324,9 @@ nm_device_iwd_agent_query(NMDeviceIwd *self, GDBusMethodInvocation *invocation)
|
|||
void
|
||||
nm_device_iwd_network_add_remove(NMDeviceIwd *self, GDBusProxy *network, bool add)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMWifiAP * ap = NULL;
|
||||
bool recheck;
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMWifiAP *ap = NULL;
|
||||
bool recheck;
|
||||
nm_auto_ref_string NMRefString *bss_path = NULL;
|
||||
|
||||
bss_path = nm_ref_string_new(g_dbus_proxy_get_object_path(network));
|
||||
|
@ -3371,7 +3371,7 @@ nm_device_iwd_network_add_remove(NMDeviceIwd *self, GDBusProxy *network, bool ad
|
|||
static void
|
||||
autoconnect_changed(NMDevice *device, GParamSpec *pspec, NMDeviceIwd *self)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
gs_unref_variant GVariant *value = NULL;
|
||||
|
||||
/* Note IWD normally remains in "disconnected" during a secret request
|
||||
|
@ -3434,7 +3434,7 @@ nm_device_iwd_new(const char *iface)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceIwd * self = NM_DEVICE_IWD(object);
|
||||
NMDeviceIwd *self = NM_DEVICE_IWD(object);
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_cancellable(&priv->cancellable);
|
||||
|
@ -3450,9 +3450,9 @@ dispose(GObject *object)
|
|||
static void
|
||||
nm_device_iwd_class_init(NMDeviceIwdClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
object_class->dispose = dispose;
|
||||
|
|
|
@ -40,8 +40,8 @@ gboolean nm_device_iwd_agent_query(NMDeviceIwd *device, GDBusMethodInvocation *i
|
|||
|
||||
const CList *_nm_device_iwd_get_aps(NMDeviceIwd *self);
|
||||
|
||||
void _nm_device_iwd_request_scan(NMDeviceIwd * self,
|
||||
GVariant * options,
|
||||
void _nm_device_iwd_request_scan(NMDeviceIwd *self,
|
||||
GVariant *options,
|
||||
GDBusMethodInvocation *invocation);
|
||||
|
||||
void nm_device_iwd_network_add_remove(NMDeviceIwd *device, GDBusProxy *network, bool add);
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
NM_GOBJECT_PROPERTIES_DEFINE(NMDeviceOlpcMesh, PROP_COMPANION, PROP_ACTIVE_CHANNEL, );
|
||||
|
||||
typedef struct {
|
||||
NMDevice * companion;
|
||||
NMDevice *companion;
|
||||
NMManager *manager;
|
||||
bool stage1_waiting : 1;
|
||||
} NMDeviceOlpcMeshPrivate;
|
||||
|
@ -63,7 +63,7 @@ G_DEFINE_TYPE(NMDeviceOlpcMesh, nm_device_olpc_mesh, NM_TYPE_DEVICE)
|
|||
static gboolean
|
||||
get_autoconnect_allowed(NMDevice *device)
|
||||
{
|
||||
NMDeviceOlpcMesh * self = NM_DEVICE_OLPC_MESH(device);
|
||||
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH(device);
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
|
||||
/* We can't even connect if we don't have a companion yet. */
|
||||
|
@ -81,11 +81,11 @@ get_autoconnect_allowed(NMDevice *device)
|
|||
#define DEFAULT_SSID "olpc-mesh"
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingOlpcMesh *s_mesh;
|
||||
|
||||
|
@ -133,7 +133,7 @@ get_dhcp_anycast_address(NMDevice *device)
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceOlpcMesh * self = NM_DEVICE_OLPC_MESH(device);
|
||||
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH(device);
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
|
||||
/* disconnect companion device, if it is connected */
|
||||
|
@ -183,9 +183,9 @@ _mesh_set_channel(NMDeviceOlpcMesh *self, guint32 channel)
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceOlpcMesh * self = NM_DEVICE_OLPC_MESH(device);
|
||||
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH(device);
|
||||
NMSettingOlpcMesh *s_mesh;
|
||||
GBytes * ssid;
|
||||
GBytes *ssid;
|
||||
gboolean success;
|
||||
|
||||
s_mesh = nm_device_get_applied_setting(device, NM_TYPE_SETTING_OLPC_MESH);
|
||||
|
@ -243,7 +243,7 @@ companion_cleanup(NMDeviceOlpcMesh *self)
|
|||
static void
|
||||
companion_notify_cb(NMDeviceWifi *companion, GParamSpec *pspec, gpointer user_data)
|
||||
{
|
||||
NMDeviceOlpcMesh * self = NM_DEVICE_OLPC_MESH(user_data);
|
||||
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH(user_data);
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
|
||||
nm_assert(NM_IS_DEVICE_WIFI(companion));
|
||||
|
@ -260,7 +260,7 @@ companion_notify_cb(NMDeviceWifi *companion, GParamSpec *pspec, gpointer user_da
|
|||
|
||||
/* disconnect from mesh if someone starts using the companion */
|
||||
static void
|
||||
companion_state_changed_cb(NMDeviceWifi * companion,
|
||||
companion_state_changed_cb(NMDeviceWifi *companion,
|
||||
NMDeviceState state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason,
|
||||
|
@ -299,7 +299,7 @@ static gboolean
|
|||
check_companion(NMDeviceOlpcMesh *self, NMDevice *other)
|
||||
{
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
const char * my_addr, *their_addr;
|
||||
const char *my_addr, *their_addr;
|
||||
|
||||
if (!NM_IS_DEVICE_WIFI(other))
|
||||
return FALSE;
|
||||
|
@ -337,7 +337,7 @@ check_companion(NMDeviceOlpcMesh *self, NMDevice *other)
|
|||
static void
|
||||
device_added_cb(NMManager *manager, NMDevice *other, gpointer user_data)
|
||||
{
|
||||
NMDeviceOlpcMesh * self = NM_DEVICE_OLPC_MESH(user_data);
|
||||
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH(user_data);
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
|
||||
if (!priv->companion && check_companion(self, other)) {
|
||||
|
@ -363,8 +363,8 @@ static void
|
|||
find_companion(NMDeviceOlpcMesh *self)
|
||||
{
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
const CList * tmp_lst;
|
||||
NMDevice * candidate;
|
||||
const CList *tmp_lst;
|
||||
NMDevice *candidate;
|
||||
|
||||
if (priv->companion)
|
||||
return;
|
||||
|
@ -386,12 +386,12 @@ find_companion(NMDeviceOlpcMesh *self)
|
|||
}
|
||||
|
||||
static void
|
||||
state_changed(NMDevice * device,
|
||||
state_changed(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
{
|
||||
NMDeviceOlpcMesh * self = NM_DEVICE_OLPC_MESH(device);
|
||||
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH(device);
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
|
||||
if (new_state == NM_DEVICE_STATE_UNAVAILABLE)
|
||||
|
@ -422,8 +422,8 @@ get_dhcp_timeout_for_device(NMDevice *device, int addr_family)
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceOlpcMesh * self = NM_DEVICE_OLPC_MESH(object);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH(object);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -450,7 +450,7 @@ nm_device_olpc_mesh_init(NMDeviceOlpcMesh *self)
|
|||
static void
|
||||
constructed(GObject *object)
|
||||
{
|
||||
NMDeviceOlpcMesh * self = NM_DEVICE_OLPC_MESH(object);
|
||||
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH(object);
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
|
||||
G_OBJECT_CLASS(nm_device_olpc_mesh_parent_class)->constructed(object);
|
||||
|
@ -479,7 +479,7 @@ nm_device_olpc_mesh_new(const char *iface)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceOlpcMesh * self = NM_DEVICE_OLPC_MESH(object);
|
||||
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH(object);
|
||||
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE(self);
|
||||
|
||||
companion_cleanup(self);
|
||||
|
@ -510,9 +510,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_olpc_mesh = {
|
|||
static void
|
||||
nm_device_olpc_mesh_class_init(NMDeviceOlpcMeshClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->constructed = constructed;
|
||||
object_class->get_property = get_property;
|
||||
|
|
|
@ -82,10 +82,10 @@ static void supplicant_interfaces_release(NMDeviceWifiP2P *self, gboolean set_is
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
_peer_dump(NMDeviceWifiP2P * self,
|
||||
_peer_dump(NMDeviceWifiP2P *self,
|
||||
NMLogLevel log_level,
|
||||
const NMWifiP2PPeer *peer,
|
||||
const char * prefix,
|
||||
const char *prefix,
|
||||
gint32 now_s)
|
||||
{
|
||||
char buf[1024];
|
||||
|
@ -100,7 +100,7 @@ _peer_dump(NMDeviceWifiP2P * self,
|
|||
static gboolean
|
||||
peer_list_dump(gpointer user_data)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
|
||||
priv->peer_dump_id = 0;
|
||||
|
@ -153,10 +153,10 @@ static gboolean
|
|||
check_connection_peer_joined(NMDeviceWifiP2P *device)
|
||||
{
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(device);
|
||||
NMConnection * conn = nm_device_get_applied_connection(NM_DEVICE(device));
|
||||
NMWifiP2PPeer * peer;
|
||||
const char * group;
|
||||
const char *const * groups;
|
||||
NMConnection *conn = nm_device_get_applied_connection(NM_DEVICE(device));
|
||||
NMWifiP2PPeer *peer;
|
||||
const char *group;
|
||||
const char *const *groups;
|
||||
|
||||
if (!conn || !priv->group_iface)
|
||||
return FALSE;
|
||||
|
@ -182,8 +182,8 @@ check_connection_peer_joined(NMDeviceWifiP2P *device)
|
|||
static gboolean
|
||||
disconnect_on_connection_peer_missing_cb(gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
|
||||
_LOGW(LOGD_WIFI, "Peer requested in connection is missing for too long, failing connection.");
|
||||
|
@ -222,8 +222,8 @@ update_disconnect_on_connection_peer_missing(NMDeviceWifiP2P *self)
|
|||
static gboolean
|
||||
is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2PPrivate * priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
NMSupplicantInterfaceState supplicant_state;
|
||||
|
||||
if (!priv->mgmt_iface)
|
||||
|
@ -251,17 +251,17 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(device);
|
||||
gs_free char * setting_name = NULL;
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(device);
|
||||
gs_free char *setting_name = NULL;
|
||||
NMSettingWifiP2P *s_wifi_p2p;
|
||||
NMWifiP2PPeer * peer;
|
||||
const char * setting_peer;
|
||||
NMWifiP2PPeer *peer;
|
||||
const char *setting_peer;
|
||||
|
||||
s_wifi_p2p =
|
||||
NM_SETTING_WIFI_P2P(nm_connection_get_setting(connection, NM_TYPE_SETTING_WIFI_P2P));
|
||||
|
@ -329,8 +329,8 @@ complete_connection(NMDevice * device,
|
|||
static gboolean
|
||||
supplicant_find_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
|
||||
priv->find_peer_timeout_id = 0;
|
||||
|
@ -351,11 +351,11 @@ supplicant_find_timeout_cb(gpointer user_data)
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
NMConnection * connection;
|
||||
NMSettingWifiP2P * s_wifi_p2p;
|
||||
NMWifiP2PPeer * peer;
|
||||
NMConnection *connection;
|
||||
NMSettingWifiP2P *s_wifi_p2p;
|
||||
NMWifiP2PPeer *peer;
|
||||
|
||||
if (!priv->mgmt_iface) {
|
||||
NM_SET_OUT(out_failure_reason, NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED);
|
||||
|
@ -393,8 +393,8 @@ act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
static gboolean
|
||||
supplicant_connection_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
|
||||
priv->sup_timeout_id = 0;
|
||||
|
@ -415,12 +415,12 @@ supplicant_connection_timeout_cb(gpointer user_data)
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
NMConnection * connection;
|
||||
NMSettingWifiP2P * s_wifi_p2p;
|
||||
NMWifiP2PPeer * peer;
|
||||
GBytes * wfd_ies;
|
||||
NMConnection *connection;
|
||||
NMSettingWifiP2P *s_wifi_p2p;
|
||||
NMWifiP2PPeer *peer;
|
||||
GBytes *wfd_ies;
|
||||
|
||||
if (nm_clear_g_source(&priv->find_peer_timeout_id))
|
||||
nm_assert_not_reached();
|
||||
|
@ -469,7 +469,7 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
|
||||
static void
|
||||
emit_signal_p2p_peer_add_remove(NMDeviceWifiP2P *device,
|
||||
NMWifiP2PPeer * peer,
|
||||
NMWifiP2PPeer *peer,
|
||||
gboolean is_added /* or else is_removed */)
|
||||
{
|
||||
nm_dbus_object_emit_signal(NM_DBUS_OBJECT(device),
|
||||
|
@ -483,10 +483,10 @@ emit_signal_p2p_peer_add_remove(NMDeviceWifiP2P *device,
|
|||
static void
|
||||
peer_add_remove(NMDeviceWifiP2P *self,
|
||||
gboolean is_adding, /* or else removing */
|
||||
NMWifiP2PPeer * peer,
|
||||
NMWifiP2PPeer *peer,
|
||||
gboolean recheck_available_connections)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
|
||||
if (is_adding) {
|
||||
|
@ -539,7 +539,7 @@ static void
|
|||
remove_all_peers(NMDeviceWifiP2P *self)
|
||||
{
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
NMWifiP2PPeer * peer;
|
||||
NMWifiP2PPeer *peer;
|
||||
|
||||
if (c_list_is_empty(&priv->peers_lst_head))
|
||||
return;
|
||||
|
@ -558,8 +558,8 @@ act_stage3_ip_config(NMDevice *device, int addr_family)
|
|||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(device);
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
gboolean indicate_addressing_running;
|
||||
NMConnection * connection;
|
||||
const char * method;
|
||||
NMConnection *connection;
|
||||
const char *method;
|
||||
|
||||
connection = nm_device_get_applied_connection(device);
|
||||
|
||||
|
@ -574,7 +574,7 @@ act_stage3_ip_config(NMDevice *device, int addr_family)
|
|||
if (nm_supplicant_interface_get_p2p_assigned_addr(priv->group_iface, &addr, &plen)) {
|
||||
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
|
||||
NMPlatformIP4Address address = {
|
||||
.addr_source = NM_IP_CONFIG_SOURCE_DHCP,
|
||||
.addr_source = NM_IP_CONFIG_SOURCE_DHCP,
|
||||
};
|
||||
|
||||
nm_platform_ip4_address_set_addr(&address, addr, plen);
|
||||
|
@ -606,7 +606,7 @@ act_stage3_ip_config(NMDevice *device, int addr_family)
|
|||
static void
|
||||
deactivate(NMDevice *device)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(device);
|
||||
int ifindex = nm_device_get_ip_ifindex(device);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
|
||||
|
@ -637,7 +637,7 @@ get_configured_mtu(NMDevice *device, NMDeviceMtuSource *out_source, gboolean *ou
|
|||
static const char *
|
||||
get_auto_ip_config_method(NMDevice *device, int addr_family)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
|
||||
if (addr_family == AF_INET && priv->group_iface
|
||||
|
@ -670,8 +670,8 @@ supplicant_iface_state_cb(NMSupplicantInterface *iface,
|
|||
int disconnect_reason,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMSupplicantInterfaceState new_state = new_state_i;
|
||||
NMSupplicantInterfaceState old_state = old_state_i;
|
||||
|
||||
|
@ -699,12 +699,12 @@ supplicant_iface_state_cb(NMSupplicantInterface *iface,
|
|||
|
||||
static void
|
||||
supplicant_iface_peer_changed_cb(NMSupplicantInterface *iface,
|
||||
NMSupplicantPeerInfo * peer_info,
|
||||
NMSupplicantPeerInfo *peer_info,
|
||||
gboolean is_present,
|
||||
NMDeviceWifiP2P * self)
|
||||
NMDeviceWifiP2P *self)
|
||||
{
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
NMWifiP2PPeer * found_peer;
|
||||
NMWifiP2PPeer *found_peer;
|
||||
|
||||
found_peer =
|
||||
nm_wifi_p2p_peers_find_by_supplicant_path(&priv->peers_lst_head, peer_info->peer_path->str);
|
||||
|
@ -781,7 +781,7 @@ supplicant_group_iface_state_cb(NMSupplicantInterface *iface,
|
|||
int disconnect_reason,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
NMSupplicantInterfaceState new_state = new_state_i;
|
||||
NMSupplicantInterfaceState old_state = old_state_i;
|
||||
|
||||
|
@ -807,8 +807,8 @@ supplicant_group_iface_state_cb(NMSupplicantInterface *iface,
|
|||
|
||||
static void
|
||||
supplicant_group_iface_group_finished_cb(NMSupplicantInterface *iface,
|
||||
const char * iface_path,
|
||||
void * user_data)
|
||||
const char *iface_path,
|
||||
void *user_data)
|
||||
{
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
|
||||
|
@ -821,8 +821,8 @@ supplicant_group_iface_group_finished_cb(NMSupplicantInterface *iface,
|
|||
|
||||
static void
|
||||
supplicant_iface_group_joined_updated_cb(NMSupplicantInterface *iface,
|
||||
GParamSpec * pspec,
|
||||
void * user_data)
|
||||
GParamSpec *pspec,
|
||||
void *user_data)
|
||||
{
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(user_data);
|
||||
|
||||
|
@ -832,9 +832,9 @@ supplicant_iface_group_joined_updated_cb(NMSupplicantInterface *iface,
|
|||
static void
|
||||
supplicant_iface_group_started_cb(NMSupplicantInterface *iface,
|
||||
NMSupplicantInterface *group_iface,
|
||||
NMDeviceWifiP2P * self)
|
||||
NMDeviceWifiP2P *self)
|
||||
{
|
||||
NMDeviceWifiP2PPrivate * priv;
|
||||
NMDeviceWifiP2PPrivate *priv;
|
||||
NMSupplicantInterfaceState state;
|
||||
|
||||
g_return_if_fail(self);
|
||||
|
@ -918,12 +918,12 @@ supplicant_interfaces_release(NMDeviceWifiP2P *self, gboolean set_is_waiting)
|
|||
}
|
||||
|
||||
static void
|
||||
device_state_changed(NMDevice * device,
|
||||
device_state_changed(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(device);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
|
||||
update_disconnect_on_connection_peer_missing(self);
|
||||
|
@ -979,19 +979,19 @@ device_state_changed(NMDevice * device,
|
|||
}
|
||||
|
||||
static void
|
||||
impl_device_wifi_p2p_start_find(NMDBusObject * obj,
|
||||
impl_device_wifi_p2p_start_find(NMDBusObject *obj,
|
||||
const NMDBusInterfaceInfoExtended *interface_info,
|
||||
const NMDBusMethodInfoExtended * method_info,
|
||||
GDBusConnection * connection,
|
||||
const char * sender,
|
||||
GDBusMethodInvocation * invocation,
|
||||
GVariant * parameters)
|
||||
const NMDBusMethodInfoExtended *method_info,
|
||||
GDBusConnection *connection,
|
||||
const char *sender,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *parameters)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(obj);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(obj);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
gs_unref_variant GVariant *options = NULL;
|
||||
const char * opts_key;
|
||||
GVariant * opts_val;
|
||||
const char *opts_key;
|
||||
GVariant *opts_val;
|
||||
GVariantIter iter;
|
||||
gint32 timeout = 30;
|
||||
|
||||
|
@ -1047,15 +1047,15 @@ impl_device_wifi_p2p_start_find(NMDBusObject * obj,
|
|||
}
|
||||
|
||||
static void
|
||||
impl_device_wifi_p2p_stop_find(NMDBusObject * obj,
|
||||
impl_device_wifi_p2p_stop_find(NMDBusObject *obj,
|
||||
const NMDBusInterfaceInfoExtended *interface_info,
|
||||
const NMDBusMethodInfoExtended * method_info,
|
||||
GDBusConnection * connection,
|
||||
const char * sender,
|
||||
GDBusMethodInvocation * invocation,
|
||||
GVariant * parameters)
|
||||
const NMDBusMethodInfoExtended *method_info,
|
||||
GDBusConnection *connection,
|
||||
const char *sender,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *parameters)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(obj);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(obj);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
|
||||
if (!priv->mgmt_iface) {
|
||||
|
@ -1179,9 +1179,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_wifi_p2p = {
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(object);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(object);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(self);
|
||||
const char ** list;
|
||||
const char **list;
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PEERS:
|
||||
|
@ -1236,7 +1236,7 @@ nm_device_wifi_p2p_new(const char *iface)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceWifiP2P * self = NM_DEVICE_WIFI_P2P(object);
|
||||
NMDeviceWifiP2P *self = NM_DEVICE_WIFI_P2P(object);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(object);
|
||||
|
||||
g_clear_object(&priv->sup_mgr);
|
||||
|
@ -1249,7 +1249,7 @@ dispose(GObject *object)
|
|||
static void
|
||||
finalize(GObject *object)
|
||||
{
|
||||
NMDeviceWifiP2P * peer = NM_DEVICE_WIFI_P2P(object);
|
||||
NMDeviceWifiP2P *peer = NM_DEVICE_WIFI_P2P(object);
|
||||
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE(peer);
|
||||
|
||||
nm_assert(c_list_is_empty(&priv->peers_lst_head));
|
||||
|
@ -1260,9 +1260,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_device_wifi_p2p_class_init(NMDeviceWifiP2PClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->constructed = constructed;
|
||||
object_class->get_property = get_property;
|
||||
|
|
|
@ -94,9 +94,9 @@ typedef struct {
|
|||
|
||||
NMActRequestGetSecretsCallId *wifi_secrets_id;
|
||||
|
||||
NMSupplicantManager * sup_mgr;
|
||||
NMSupplicantManager *sup_mgr;
|
||||
NMSupplMgrCreateIfaceHandle *sup_create_handle;
|
||||
NMSupplicantInterface * sup_iface;
|
||||
NMSupplicantInterface *sup_iface;
|
||||
|
||||
gint64 scan_last_complete_msec;
|
||||
gint64 scan_periodic_next_msec;
|
||||
|
@ -161,7 +161,7 @@ static void supplicant_iface_state_down(NMDeviceWifi *self);
|
|||
|
||||
static void cleanup_association_attempt(NMDeviceWifi *self, gboolean disconnect);
|
||||
|
||||
static void supplicant_iface_state(NMDeviceWifi * self,
|
||||
static void supplicant_iface_state(NMDeviceWifi *self,
|
||||
NMSupplicantInterfaceState new_state,
|
||||
NMSupplicantInterfaceState old_state,
|
||||
int disconnect_reason,
|
||||
|
@ -174,27 +174,27 @@ static void supplicant_iface_state_cb(NMSupplicantInterface *iface,
|
|||
gpointer user_data);
|
||||
|
||||
static void supplicant_iface_bss_changed_cb(NMSupplicantInterface *iface,
|
||||
NMSupplicantBssInfo * bss_info,
|
||||
NMSupplicantBssInfo *bss_info,
|
||||
gboolean is_present,
|
||||
NMDeviceWifi * self);
|
||||
NMDeviceWifi *self);
|
||||
|
||||
static void supplicant_iface_wps_credentials_cb(NMSupplicantInterface *iface,
|
||||
GVariant * credentials,
|
||||
NMDeviceWifi * self);
|
||||
GVariant *credentials,
|
||||
NMDeviceWifi *self);
|
||||
|
||||
static void supplicant_iface_notify_current_bss(NMSupplicantInterface *iface,
|
||||
GParamSpec * pspec,
|
||||
NMDeviceWifi * self);
|
||||
GParamSpec *pspec,
|
||||
NMDeviceWifi *self);
|
||||
|
||||
static void supplicant_iface_notify_p2p_available(NMSupplicantInterface *iface,
|
||||
GParamSpec * pspec,
|
||||
NMDeviceWifi * self);
|
||||
GParamSpec *pspec,
|
||||
NMDeviceWifi *self);
|
||||
|
||||
static void periodic_update(NMDeviceWifi *self);
|
||||
|
||||
static void ap_add_remove(NMDeviceWifi *self,
|
||||
gboolean is_adding,
|
||||
NMWifiAP * ap,
|
||||
NMWifiAP *ap,
|
||||
gboolean recheck_available_connections);
|
||||
|
||||
static void _hw_addr_set_scanning(NMDeviceWifi *self, gboolean do_reset);
|
||||
|
@ -291,7 +291,7 @@ static GPtrArray *
|
|||
_scan_request_ssids_fetch(NMDeviceWifiPrivate *priv, gint64 now_msec)
|
||||
{
|
||||
ScanRequestSsidData *srs_data;
|
||||
GPtrArray * ssids;
|
||||
GPtrArray *ssids;
|
||||
guint len;
|
||||
|
||||
_scan_request_ssids_remove_all(priv, now_msec, G_MAXUINT);
|
||||
|
@ -332,7 +332,7 @@ _scan_request_ssids_track(NMDeviceWifiPrivate *priv, const GPtrArray *ssids)
|
|||
c_list_splice(&old_lst_head, &priv->scan_request_ssids_lst_head);
|
||||
|
||||
for (i = 0; i < ssids->len; i++) {
|
||||
GBytes * ssid = ssids->pdata[i];
|
||||
GBytes *ssid = ssids->pdata[i];
|
||||
ScanRequestSsidData *d;
|
||||
|
||||
G_STATIC_ASSERT_EXPR(G_STRUCT_OFFSET(ScanRequestSsidData, ssid) == 0);
|
||||
|
@ -365,7 +365,7 @@ nm_device_wifi_scanning_prohibited_track(NMDeviceWifi *self,
|
|||
gboolean temporarily_prohibited)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv;
|
||||
NMCListElem * elem;
|
||||
NMCListElem *elem;
|
||||
|
||||
g_return_if_fail(NM_IS_DEVICE_WIFI(self));
|
||||
nm_assert(tag);
|
||||
|
@ -411,10 +411,10 @@ _indicate_addressing_running_reset(NMDeviceWifi *self)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
_ap_dump(NMDeviceWifi * self,
|
||||
_ap_dump(NMDeviceWifi *self,
|
||||
NMLogLevel log_level,
|
||||
const NMWifiAP *ap,
|
||||
const char * prefix,
|
||||
const char *prefix,
|
||||
gint64 now_msec)
|
||||
{
|
||||
char buf[1024];
|
||||
|
@ -547,8 +547,8 @@ _scan_notify_allowed(NMDeviceWifi *self, NMTernary do_kickoff)
|
|||
|
||||
static void
|
||||
supplicant_iface_notify_scanning_cb(NMSupplicantInterface *iface,
|
||||
GParamSpec * pspec,
|
||||
NMDeviceWifi * self)
|
||||
GParamSpec *pspec,
|
||||
NMDeviceWifi *self)
|
||||
{
|
||||
_scan_notify_is_scanning(self);
|
||||
}
|
||||
|
@ -566,13 +566,13 @@ unmanaged_on_quit(NMDevice *self)
|
|||
}
|
||||
|
||||
static void
|
||||
supplicant_interface_acquire_cb(NMSupplicantManager * supplicant_manager,
|
||||
supplicant_interface_acquire_cb(NMSupplicantManager *supplicant_manager,
|
||||
NMSupplMgrCreateIfaceHandle *handle,
|
||||
NMSupplicantInterface * iface,
|
||||
GError * error,
|
||||
NMSupplicantInterface *iface,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi * self = user_data;
|
||||
NMDeviceWifi *self = user_data;
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
if (nm_utils_error_is_cancelled(error))
|
||||
|
@ -711,7 +711,7 @@ static void
|
|||
set_current_ap(NMDeviceWifi *self, NMWifiAP *new_ap, gboolean recheck_available_connections)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv;
|
||||
NMWifiAP * old_ap;
|
||||
NMWifiAP *old_ap;
|
||||
|
||||
g_return_if_fail(NM_IS_DEVICE_WIFI(self));
|
||||
|
||||
|
@ -807,7 +807,7 @@ periodic_update_cb(gpointer user_data)
|
|||
static void
|
||||
ap_add_remove(NMDeviceWifi *self,
|
||||
gboolean is_adding, /* or else removing */
|
||||
NMWifiAP * ap,
|
||||
NMWifiAP *ap,
|
||||
gboolean recheck_available_connections)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
@ -848,7 +848,7 @@ static void
|
|||
remove_all_aps(NMDeviceWifi *self)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMWifiAP * ap;
|
||||
NMWifiAP *ap;
|
||||
|
||||
if (c_list_is_empty(&priv->aps_lst_head))
|
||||
return;
|
||||
|
@ -864,7 +864,7 @@ remove_all_aps(NMDeviceWifi *self)
|
|||
static gboolean
|
||||
wake_on_wlan_restore(NMDeviceWifi *self)
|
||||
{
|
||||
NMDeviceWifiPrivate * priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
_NMSettingWirelessWakeOnWLan w;
|
||||
|
||||
w = priv->wowlan_restore;
|
||||
|
@ -896,7 +896,7 @@ disconnect_cb_on_idle(gpointer user_data, GCancellable *cancellable)
|
|||
gs_unref_object NMDeviceWifi *self = NULL;
|
||||
NMDeviceDeactivateCallback callback;
|
||||
gpointer callback_user_data;
|
||||
gs_free_error GError *cancelled_error = NULL;
|
||||
gs_free_error GError *cancelled_error = NULL;
|
||||
|
||||
nm_utils_user_data_unpack(user_data, &self, &callback, &callback_user_data);
|
||||
|
||||
|
@ -905,12 +905,12 @@ disconnect_cb_on_idle(gpointer user_data, GCancellable *cancellable)
|
|||
}
|
||||
|
||||
static void
|
||||
deactivate_async(NMDevice * device,
|
||||
GCancellable * cancellable,
|
||||
deactivate_async(NMDevice *device,
|
||||
GCancellable *cancellable,
|
||||
NMDeviceDeactivateCallback callback,
|
||||
gpointer callback_user_data)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
gpointer user_data;
|
||||
|
||||
|
@ -934,7 +934,7 @@ deactivate_async(NMDevice * device,
|
|||
static void
|
||||
deactivate(NMDevice *device)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
int ifindex = nm_device_get_ifindex(device);
|
||||
|
||||
|
@ -978,14 +978,14 @@ deactivate_reset_hw_addr(NMDevice *device)
|
|||
static gboolean
|
||||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMSettingWireless * s_wireless;
|
||||
const char * mac;
|
||||
const char *const * mac_blacklist;
|
||||
NMSettingWireless *s_wireless;
|
||||
const char *mac;
|
||||
const char *const *mac_blacklist;
|
||||
int i;
|
||||
const char * mode;
|
||||
const char * perm_hw_addr;
|
||||
const char *mode;
|
||||
const char *perm_hw_addr;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_wifi_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
@ -1078,16 +1078,16 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
check_connection_available(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
check_connection_available(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDeviceCheckConAvailableFlags flags,
|
||||
const char * specific_object,
|
||||
GError ** error)
|
||||
const char *specific_object,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMSettingWireless * s_wifi;
|
||||
const char * mode;
|
||||
NMSettingWireless *s_wifi;
|
||||
const char *mode;
|
||||
|
||||
s_wifi = nm_connection_get_setting_wireless(connection);
|
||||
g_return_val_if_fail(s_wifi, FALSE);
|
||||
|
@ -1146,21 +1146,21 @@ check_connection_available(NMDevice * device,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMSettingWireless * s_wifi;
|
||||
gs_free char * ssid_utf8 = NULL;
|
||||
NMWifiAP * ap;
|
||||
GBytes * ssid = NULL;
|
||||
GBytes * setting_ssid = NULL;
|
||||
NMSettingWireless *s_wifi;
|
||||
gs_free char *ssid_utf8 = NULL;
|
||||
NMWifiAP *ap;
|
||||
GBytes *ssid = NULL;
|
||||
GBytes *setting_ssid = NULL;
|
||||
gboolean hidden = FALSE;
|
||||
const char * mode;
|
||||
const char *mode;
|
||||
|
||||
s_wifi = nm_connection_get_setting_wireless(connection);
|
||||
|
||||
|
@ -1281,8 +1281,8 @@ complete_connection(NMDevice * device,
|
|||
static gboolean
|
||||
is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate * priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMSupplicantInterfaceState supplicant_state;
|
||||
|
||||
if (!priv->enabled)
|
||||
|
@ -1308,12 +1308,12 @@ get_autoconnect_allowed(NMDevice *device)
|
|||
static gboolean
|
||||
can_auto_connect(NMDevice *device, NMSettingsConnection *sett_conn, char **specific_object)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMConnection * connection;
|
||||
NMSettingWireless * s_wifi;
|
||||
NMWifiAP * ap;
|
||||
const char * method6, *mode;
|
||||
NMConnection *connection;
|
||||
NMSettingWireless *s_wifi;
|
||||
NMWifiAP *ap;
|
||||
const char *method6, *mode;
|
||||
gboolean auto4, auto6;
|
||||
|
||||
nm_assert(!specific_object || !*specific_object);
|
||||
|
@ -1361,7 +1361,7 @@ _nm_device_wifi_get_aps(NMDeviceWifi *self)
|
|||
static void
|
||||
_hw_addr_set_scanning(NMDeviceWifi *self, gboolean do_reset)
|
||||
{
|
||||
NMDevice * device = (NMDevice *) self;
|
||||
NMDevice *device = (NMDevice *) self;
|
||||
NMDeviceWifiPrivate *priv;
|
||||
guint32 now;
|
||||
gboolean randomize;
|
||||
|
@ -1397,7 +1397,7 @@ _hw_addr_set_scanning(NMDeviceWifi *self, gboolean do_reset)
|
|||
|
||||
if (now >= priv->hw_addr_scan_expire) {
|
||||
gs_free char *hw_addr_scan = NULL;
|
||||
const char * generate_mac_address_mask;
|
||||
const char *generate_mac_address_mask;
|
||||
|
||||
/* the random MAC address for scanning expires after a while.
|
||||
*
|
||||
|
@ -1444,7 +1444,7 @@ ssids_options_to_ptrarray(GVariant *value, GError **error)
|
|||
for (i = 0; i < num_ssids; i++) {
|
||||
gs_unref_variant GVariant *v = NULL;
|
||||
gsize len;
|
||||
const guint8 * bytes;
|
||||
const guint8 *bytes;
|
||||
|
||||
v = g_variant_get_child_value(value, i);
|
||||
bytes = g_variant_get_fixed_array(v, &len, sizeof(guint8));
|
||||
|
@ -1471,14 +1471,14 @@ nmtst_ssids_options_to_ptrarray(GVariant *value, GError **error)
|
|||
}
|
||||
|
||||
static void
|
||||
dbus_request_scan_cb(NMDevice * device,
|
||||
dbus_request_scan_cb(NMDevice *device,
|
||||
GDBusMethodInvocation *context,
|
||||
NMAuthSubject * subject,
|
||||
GError * error,
|
||||
NMAuthSubject *subject,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
gs_unref_ptrarray GPtrArray *ssids = user_data;
|
||||
|
||||
if (error) {
|
||||
|
@ -1493,13 +1493,13 @@ dbus_request_scan_cb(NMDevice * device,
|
|||
}
|
||||
|
||||
void
|
||||
_nm_device_wifi_request_scan(NMDeviceWifi * self,
|
||||
GVariant * options,
|
||||
_nm_device_wifi_request_scan(NMDeviceWifi *self,
|
||||
GVariant *options,
|
||||
GDBusMethodInvocation *invocation)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
gs_unref_ptrarray GPtrArray *ssids = NULL;
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
gs_unref_ptrarray GPtrArray *ssids = NULL;
|
||||
|
||||
if (options) {
|
||||
gs_unref_variant GVariant *val = g_variant_lookup_value(options, "ssids", NULL);
|
||||
|
@ -1545,7 +1545,7 @@ _nm_device_wifi_request_scan(NMDeviceWifi * self,
|
|||
static gboolean
|
||||
hidden_filter_func(NMSettings *settings, NMSettingsConnection *set_con, gpointer user_data)
|
||||
{
|
||||
NMConnection * connection = nm_settings_connection_get_connection(set_con);
|
||||
NMConnection *connection = nm_settings_connection_get_connection(set_con);
|
||||
NMSettingWireless *s_wifi;
|
||||
|
||||
if (!nm_connection_is_type(connection, NM_SETTING_WIRELESS_SETTING_NAME))
|
||||
|
@ -1561,12 +1561,12 @@ hidden_filter_func(NMSettings *settings, NMSettingsConnection *set_con, gpointer
|
|||
static GPtrArray *
|
||||
_scan_request_ssids_build_hidden(NMDeviceWifi *self,
|
||||
gint64 now_msec,
|
||||
gboolean * out_has_hidden_profiles)
|
||||
gboolean *out_has_hidden_profiles)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
guint max_scan_ssids = nm_supplicant_interface_get_max_scan_ssids(priv->sup_iface);
|
||||
guint max_scan_ssids = nm_supplicant_interface_get_max_scan_ssids(priv->sup_iface);
|
||||
gs_free NMSettingsConnection **connections = NULL;
|
||||
gs_unref_ptrarray GPtrArray *ssids = NULL;
|
||||
gs_unref_ptrarray GPtrArray *ssids = NULL;
|
||||
gs_unref_hashtable GHashTable *unique_ssids = NULL;
|
||||
guint connections_len;
|
||||
guint n_hidden;
|
||||
|
@ -1624,7 +1624,7 @@ _scan_request_ssids_build_hidden(NMDeviceWifi *self,
|
|||
n_hidden = 0;
|
||||
for (i = 0; i < connections_len; i++) {
|
||||
NMSettingWireless *s_wifi;
|
||||
GBytes * ssid;
|
||||
GBytes *ssid;
|
||||
|
||||
if (ssids->len >= max_scan_ssids)
|
||||
break;
|
||||
|
@ -1653,7 +1653,7 @@ _scan_request_ssids_build_hidden(NMDeviceWifi *self,
|
|||
static gboolean
|
||||
_scan_request_delay_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi * self = user_data;
|
||||
NMDeviceWifi *self = user_data;
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_source_inst(&priv->scan_request_delay_source);
|
||||
|
@ -1666,10 +1666,10 @@ _scan_request_delay_cb(gpointer user_data)
|
|||
|
||||
static void
|
||||
_scan_supplicant_request_scan_cb(NMSupplicantInterface *supp_iface,
|
||||
GCancellable * cancellable,
|
||||
GCancellable *cancellable,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi * self;
|
||||
NMDeviceWifi *self;
|
||||
NMDeviceWifiPrivate *priv;
|
||||
|
||||
if (g_cancellable_is_cancelled(cancellable))
|
||||
|
@ -1696,7 +1696,7 @@ _scan_supplicant_request_scan_cb(NMSupplicantInterface *supp_iface,
|
|||
static gboolean
|
||||
_scan_kickoff_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi * self = user_data;
|
||||
NMDeviceWifi *self = user_data;
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
priv->scan_kickoff_timeout_id = 0;
|
||||
|
@ -1707,7 +1707,7 @@ _scan_kickoff_timeout_cb(gpointer user_data)
|
|||
static void
|
||||
_scan_kickoff(NMDeviceWifi *self)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
gs_unref_ptrarray GPtrArray *ssids = NULL;
|
||||
gboolean is_explict = FALSE;
|
||||
NMDeviceState device_state;
|
||||
|
@ -1882,7 +1882,7 @@ _scan_kickoff(NMDeviceWifi *self)
|
|||
static gboolean
|
||||
ap_list_dump(gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(user_data);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(user_data);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
priv->ap_dump_id = 0;
|
||||
|
@ -1920,7 +1920,7 @@ schedule_ap_list_dump(NMDeviceWifi *self)
|
|||
static void
|
||||
try_fill_ssid_for_hidden_ap(NMDeviceWifi *self, NMWifiAP *ap)
|
||||
{
|
||||
const char * bssid;
|
||||
const char *bssid;
|
||||
NMSettingsConnection *const *connections;
|
||||
guint i;
|
||||
|
||||
|
@ -1934,7 +1934,7 @@ try_fill_ssid_for_hidden_ap(NMDeviceWifi *self, NMWifiAP *ap)
|
|||
connections = nm_settings_get_connections(nm_device_get_settings((NMDevice *) self), NULL);
|
||||
for (i = 0; connections[i]; i++) {
|
||||
NMSettingsConnection *sett_conn = connections[i];
|
||||
NMSettingWireless * s_wifi;
|
||||
NMSettingWireless *s_wifi;
|
||||
|
||||
if (!nm_settings_connection_has_seen_bssid(sett_conn, bssid))
|
||||
continue;
|
||||
|
@ -1950,13 +1950,13 @@ try_fill_ssid_for_hidden_ap(NMDeviceWifi *self, NMWifiAP *ap)
|
|||
|
||||
static void
|
||||
supplicant_iface_bss_changed_cb(NMSupplicantInterface *iface,
|
||||
NMSupplicantBssInfo * bss_info,
|
||||
NMSupplicantBssInfo *bss_info,
|
||||
gboolean is_present,
|
||||
NMDeviceWifi * self)
|
||||
NMDeviceWifi *self)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMWifiAP * found_ap;
|
||||
GBytes * ssid;
|
||||
NMWifiAP *found_ap;
|
||||
GBytes *ssid;
|
||||
|
||||
found_ap = g_hash_table_lookup(priv->aps_idx_by_supplicant_path, bss_info->bss_path);
|
||||
|
||||
|
@ -2049,14 +2049,14 @@ cleanup_supplicant_failures(NMDeviceWifi *self)
|
|||
}
|
||||
|
||||
static void
|
||||
wifi_secrets_cb(NMActRequest * req,
|
||||
wifi_secrets_cb(NMActRequest *req,
|
||||
NMActRequestGetSecretsCallId *call_id,
|
||||
NMSettingsConnection * connection,
|
||||
GError * error,
|
||||
NMSettingsConnection *connection,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMDevice * device = user_data;
|
||||
NMDeviceWifi * self = user_data;
|
||||
NMDevice *device = user_data;
|
||||
NMDeviceWifi *self = user_data;
|
||||
NMDeviceWifiPrivate *priv;
|
||||
|
||||
g_return_if_fail(NM_IS_DEVICE_WIFI(self));
|
||||
|
@ -2123,15 +2123,15 @@ wifi_secrets_cancel(NMDeviceWifi *self)
|
|||
|
||||
static void
|
||||
supplicant_iface_wps_credentials_cb(NMSupplicantInterface *iface,
|
||||
GVariant * credentials,
|
||||
NMDeviceWifi * self)
|
||||
GVariant *credentials,
|
||||
NMDeviceWifi *self)
|
||||
{
|
||||
NMActRequest * req;
|
||||
NMActRequest *req;
|
||||
gs_unref_variant GVariant *val_key = NULL;
|
||||
gs_unref_variant GVariant *secrets = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
const char * array;
|
||||
gsize psk_len = 0;
|
||||
gs_free_error GError *error = NULL;
|
||||
const char *array;
|
||||
gsize psk_len = 0;
|
||||
|
||||
if (nm_device_get_state(NM_DEVICE(self)) != NM_DEVICE_STATE_NEED_AUTH) {
|
||||
_LOGI(LOGD_DEVICE | LOGD_WIFI, "WPS: The connection can't be updated with credentials");
|
||||
|
@ -2184,7 +2184,7 @@ supplicant_iface_wps_credentials_cb(NMSupplicantInterface *iface,
|
|||
static gboolean
|
||||
wps_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(user_data);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(user_data);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
priv->wps_timeout_id = 0;
|
||||
|
@ -2199,12 +2199,12 @@ wps_timeout_cb(gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
wifi_secrets_get_secrets(NMDeviceWifi * self,
|
||||
const char * setting_name,
|
||||
wifi_secrets_get_secrets(NMDeviceWifi *self,
|
||||
const char *setting_name,
|
||||
NMSecretAgentGetSecretsFlags flags)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMActRequest * req;
|
||||
NMActRequest *req;
|
||||
|
||||
wifi_secrets_cancel(self);
|
||||
|
||||
|
@ -2225,8 +2225,8 @@ wifi_secrets_get_secrets(NMDeviceWifi * self,
|
|||
static gboolean
|
||||
link_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
_LOGW(LOGD_WIFI, "link timed out.");
|
||||
|
@ -2250,14 +2250,14 @@ link_timeout_cb(gpointer user_data)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
need_new_8021x_secrets(NMDeviceWifi * self,
|
||||
need_new_8021x_secrets(NMDeviceWifi *self,
|
||||
NMSupplicantInterfaceState old_state,
|
||||
const char ** setting_name)
|
||||
const char **setting_name)
|
||||
{
|
||||
NMSetting8021x * s_8021x;
|
||||
NMSetting8021x *s_8021x;
|
||||
NMSettingWirelessSecurity *s_wsec;
|
||||
NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
|
||||
NMConnection * connection;
|
||||
NMConnection *connection;
|
||||
|
||||
g_return_val_if_fail(setting_name, FALSE);
|
||||
|
||||
|
@ -2305,14 +2305,14 @@ need_new_8021x_secrets(NMDeviceWifi * self,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
need_new_wpa_psk(NMDeviceWifi * self,
|
||||
need_new_wpa_psk(NMDeviceWifi *self,
|
||||
NMSupplicantInterfaceState old_state,
|
||||
int disconnect_reason,
|
||||
const char ** setting_name)
|
||||
const char **setting_name)
|
||||
{
|
||||
NMSettingWirelessSecurity *s_wsec;
|
||||
NMConnection * connection;
|
||||
const char * key_mgmt = NULL;
|
||||
NMConnection *connection;
|
||||
const char *key_mgmt = NULL;
|
||||
|
||||
g_return_val_if_fail(setting_name, FALSE);
|
||||
|
||||
|
@ -2347,14 +2347,14 @@ need_new_wpa_psk(NMDeviceWifi * self,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
handle_8021x_or_psk_auth_fail(NMDeviceWifi * self,
|
||||
handle_8021x_or_psk_auth_fail(NMDeviceWifi *self,
|
||||
NMSupplicantInterfaceState new_state,
|
||||
NMSupplicantInterfaceState old_state,
|
||||
int disconnect_reason)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMActRequest *req;
|
||||
const char * setting_name = NULL;
|
||||
const char *setting_name = NULL;
|
||||
gboolean handled = FALSE;
|
||||
|
||||
g_return_val_if_fail(new_state == NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED, FALSE);
|
||||
|
@ -2386,8 +2386,8 @@ handle_8021x_or_psk_auth_fail(NMDeviceWifi * self,
|
|||
static gboolean
|
||||
reacquire_interface_cb(gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
priv->reacquire_iface_id = 0;
|
||||
|
@ -2405,7 +2405,7 @@ static void
|
|||
supplicant_iface_state_down(NMDeviceWifi *self)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
|
||||
nm_device_queue_recheck_available(device,
|
||||
NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE,
|
||||
|
@ -2425,14 +2425,14 @@ supplicant_iface_state_down(NMDeviceWifi *self)
|
|||
}
|
||||
|
||||
static void
|
||||
supplicant_iface_state(NMDeviceWifi * self,
|
||||
supplicant_iface_state(NMDeviceWifi *self,
|
||||
NMSupplicantInterfaceState new_state,
|
||||
NMSupplicantInterfaceState old_state,
|
||||
int disconnect_reason,
|
||||
gboolean is_real_signal)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceState devstate;
|
||||
gboolean scanning;
|
||||
gboolean scan_changed;
|
||||
|
@ -2479,8 +2479,8 @@ supplicant_iface_state(NMDeviceWifi * self,
|
|||
*/
|
||||
if (devstate == NM_DEVICE_STATE_CONFIG) {
|
||||
NMSettingWireless *s_wifi;
|
||||
GBytes * ssid;
|
||||
gs_free char * ssid_str = NULL;
|
||||
GBytes *ssid;
|
||||
gs_free char *ssid_str = NULL;
|
||||
|
||||
s_wifi = nm_device_get_applied_setting(NM_DEVICE(self), NM_TYPE_SETTING_WIRELESS);
|
||||
|
||||
|
@ -2556,7 +2556,7 @@ static void
|
|||
supplicant_iface_assoc_cb(NMSupplicantInterface *iface, GError *error, gpointer user_data)
|
||||
{
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(user_data);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
|
||||
if (error && !nm_utils_error_is_cancelled_or_disposing(error)
|
||||
&& nm_device_is_activating(device)) {
|
||||
|
@ -2569,23 +2569,23 @@ supplicant_iface_assoc_cb(NMSupplicantInterface *iface, GError *error, gpointer
|
|||
|
||||
static void
|
||||
supplicant_iface_notify_current_bss(NMSupplicantInterface *iface,
|
||||
GParamSpec * pspec,
|
||||
NMDeviceWifi * self)
|
||||
GParamSpec *pspec,
|
||||
NMDeviceWifi *self)
|
||||
{
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMRefString * current_bss;
|
||||
NMWifiAP * new_ap = NULL;
|
||||
NMActRequest * req;
|
||||
NMRefString *current_bss;
|
||||
NMWifiAP *new_ap = NULL;
|
||||
NMActRequest *req;
|
||||
|
||||
current_bss = nm_supplicant_interface_get_current_bss(iface);
|
||||
if (current_bss)
|
||||
new_ap = g_hash_table_lookup(priv->aps_idx_by_supplicant_path, current_bss);
|
||||
|
||||
if (new_ap != priv->current_ap) {
|
||||
const char * new_bssid = NULL;
|
||||
GBytes * new_ssid = NULL;
|
||||
const char * old_bssid = NULL;
|
||||
GBytes * old_ssid = NULL;
|
||||
const char *new_bssid = NULL;
|
||||
GBytes *new_ssid = NULL;
|
||||
const char *old_bssid = NULL;
|
||||
GBytes *old_ssid = NULL;
|
||||
gs_free char *new_ssid_s = NULL;
|
||||
gs_free char *old_ssid_s = NULL;
|
||||
|
||||
|
@ -2682,8 +2682,8 @@ recheck_p2p_availability(NMDeviceWifi *self)
|
|||
|
||||
static void
|
||||
supplicant_iface_notify_p2p_available(NMSupplicantInterface *iface,
|
||||
GParamSpec * pspec,
|
||||
NMDeviceWifi * self)
|
||||
GParamSpec *pspec,
|
||||
NMDeviceWifi *self)
|
||||
{
|
||||
if (nm_supplicant_interface_get_state(iface) > NM_SUPPLICANT_INTERFACE_STATE_STARTING)
|
||||
recheck_p2p_availability(self);
|
||||
|
@ -2692,14 +2692,14 @@ supplicant_iface_notify_p2p_available(NMSupplicantInterface *iface,
|
|||
static gboolean
|
||||
handle_auth_or_fail(NMDeviceWifi *self, NMActRequest *req, gboolean new_secrets)
|
||||
{
|
||||
NMDeviceWifiPrivate * priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
const char * setting_name;
|
||||
NMConnection * applied_connection;
|
||||
NMSettingWirelessSecurity * s_wsec;
|
||||
const char * bssid = NULL;
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
const char *setting_name;
|
||||
NMConnection *applied_connection;
|
||||
NMSettingWirelessSecurity *s_wsec;
|
||||
const char *bssid = NULL;
|
||||
NM80211ApFlags ap_flags;
|
||||
NMSettingWirelessSecurityWpsMethod wps_method;
|
||||
const char * type;
|
||||
const char *type;
|
||||
NMSecretAgentGetSecretsFlags get_secret_flags =
|
||||
NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION;
|
||||
|
||||
|
@ -2777,11 +2777,11 @@ handle_auth_or_fail(NMDeviceWifi *self, NMActRequest *req, gboolean new_secrets)
|
|||
static gboolean
|
||||
supplicant_connection_timeout_cb(gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(user_data);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMActRequest * req;
|
||||
NMConnection * connection;
|
||||
NMActRequest *req;
|
||||
NMConnection *connection;
|
||||
|
||||
cleanup_association_attempt(self, TRUE);
|
||||
|
||||
|
@ -2857,12 +2857,12 @@ static NMSupplicantConfig *
|
|||
build_supplicant_config(NMDeviceWifi *self,
|
||||
NMConnection *connection,
|
||||
guint32 fixed_freq,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceWifiPrivate * priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMSupplicantConfig * config = NULL;
|
||||
NMSettingWireless * s_wireless;
|
||||
NMSettingWirelessSecurity * s_wireless_sec;
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMSupplicantConfig *config = NULL;
|
||||
NMSettingWireless *s_wireless;
|
||||
NMSettingWirelessSecurity *s_wireless_sec;
|
||||
NMSettingWirelessSecurityPmf pmf;
|
||||
NMSettingWirelessSecurityFils fils;
|
||||
NMTernary ap_isolation;
|
||||
|
@ -2905,7 +2905,7 @@ build_supplicant_config(NMDeviceWifi *self,
|
|||
s_wireless_sec = nm_connection_get_setting_wireless_security(connection);
|
||||
if (s_wireless_sec) {
|
||||
NMSetting8021x *s_8021x;
|
||||
const char * con_uuid = nm_connection_get_uuid(connection);
|
||||
const char *con_uuid = nm_connection_get_uuid(connection);
|
||||
guint32 mtu = nm_platform_link_get_mtu(nm_device_get_platform(NM_DEVICE(self)),
|
||||
nm_device_get_ifindex(NM_DEVICE(self)));
|
||||
|
||||
|
@ -2966,10 +2966,10 @@ error:
|
|||
static gboolean
|
||||
wake_on_wlan_enable(NMDeviceWifi *self)
|
||||
{
|
||||
NMDeviceWifiPrivate * priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMSettingWirelessWakeOnWLan wowl;
|
||||
_NMSettingWirelessWakeOnWLan wowl2;
|
||||
NMSettingWireless * s_wireless;
|
||||
NMSettingWireless *s_wireless;
|
||||
|
||||
s_wireless = nm_device_get_applied_setting(NM_DEVICE(self), NM_TYPE_SETTING_WIRELESS);
|
||||
if (s_wireless) {
|
||||
|
@ -3020,15 +3020,15 @@ found:
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMWifiAP * ap = NULL;
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMWifiAP *ap = NULL;
|
||||
gs_unref_object NMWifiAP *ap_fake = NULL;
|
||||
NMActRequest * req;
|
||||
NMConnection * connection;
|
||||
NMSettingWireless * s_wireless;
|
||||
const char * mode;
|
||||
const char * ap_path;
|
||||
NMActRequest *req;
|
||||
NMConnection *connection;
|
||||
NMSettingWireless *s_wireless;
|
||||
const char *mode;
|
||||
const char *ap_path;
|
||||
|
||||
req = nm_device_get_act_request(NM_DEVICE(self));
|
||||
g_return_val_if_fail(req, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
@ -3103,8 +3103,8 @@ act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
static void
|
||||
ensure_hotspot_frequency(NMDeviceWifi *self, NMSettingWireless *s_wifi, NMWifiAP *ap)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
const char * band = nm_setting_wireless_get_band(s_wifi);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
const char *band = nm_setting_wireless_get_band(s_wifi);
|
||||
const guint32 a_freqs[] = {5180, 5200, 5220, 5745, 5765, 5785, 5805, 0};
|
||||
const guint32 bg_freqs[] = {2412, 2437, 2462, 2472, 0};
|
||||
guint32 freq = 0;
|
||||
|
@ -3133,8 +3133,8 @@ ensure_hotspot_frequency(NMDeviceWifi *self, NMSettingWireless *s_wifi, NMWifiAP
|
|||
static void
|
||||
set_powersave(NMDevice *device)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMSettingWireless * s_wireless;
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMSettingWireless *s_wireless;
|
||||
NMSettingWirelessPowersave val;
|
||||
|
||||
s_wireless = nm_device_get_applied_setting(device, NM_TYPE_SETTING_WIRELESS);
|
||||
|
@ -3164,20 +3164,20 @@ set_powersave(NMDevice *device)
|
|||
static NMActStageReturn
|
||||
act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
gs_unref_object NMSupplicantConfig *config = NULL;
|
||||
_NM80211Mode ap_mode;
|
||||
NMActRequest * req;
|
||||
NMWifiAP * ap;
|
||||
NMConnection * connection;
|
||||
const char * setting_name;
|
||||
NMSettingWireless * s_wireless;
|
||||
GError * error = NULL;
|
||||
NMActRequest *req;
|
||||
NMWifiAP *ap;
|
||||
NMConnection *connection;
|
||||
const char *setting_name;
|
||||
NMSettingWireless *s_wireless;
|
||||
GError *error = NULL;
|
||||
guint timeout;
|
||||
NMActRequest * request;
|
||||
NMActiveConnection * master_ac;
|
||||
NMDevice * master;
|
||||
NMActRequest *request;
|
||||
NMActiveConnection *master_ac;
|
||||
NMDevice *master;
|
||||
|
||||
nm_clear_g_source(&priv->sup_timeout_id);
|
||||
nm_clear_g_source(&priv->link_timeout_id);
|
||||
|
@ -3282,9 +3282,9 @@ out_fail:
|
|||
static void
|
||||
act_stage3_ip_config(NMDevice *device, int addr_family)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
const char * method;
|
||||
const char *method;
|
||||
gboolean indicate_addressing_running;
|
||||
|
||||
if (priv->addressing_running_indicated)
|
||||
|
@ -3322,10 +3322,10 @@ get_configured_mtu(NMDevice *device, NMDeviceMtuSource *out_source, gboolean *ou
|
|||
static void
|
||||
activation_success_handler(NMDevice *device)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
int ifindex = nm_device_get_ifindex(device);
|
||||
NMActRequest * req;
|
||||
NMActRequest *req;
|
||||
|
||||
req = nm_device_get_act_request(device);
|
||||
g_assert(req);
|
||||
|
@ -3385,12 +3385,12 @@ activation_success_handler(NMDevice *device)
|
|||
}
|
||||
|
||||
static void
|
||||
device_state_changed(NMDevice * device,
|
||||
device_state_changed(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
gboolean clear_aps = FALSE;
|
||||
|
||||
|
@ -3459,7 +3459,7 @@ get_enabled(NMDevice *device)
|
|||
static void
|
||||
set_enabled(NMDevice *device, gboolean enabled)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMDeviceState state;
|
||||
|
||||
|
@ -3513,19 +3513,19 @@ set_enabled(NMDevice *device, gboolean enabled)
|
|||
static gboolean
|
||||
get_guessed_metered(NMDevice *device)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
return priv->current_ap && nm_wifi_ap_get_metered(priv->current_ap);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
can_reapply_change(NMDevice * device,
|
||||
can_reapply_change(NMDevice *device,
|
||||
const char *setting_name,
|
||||
NMSetting * s_old,
|
||||
NMSetting * s_new,
|
||||
NMSetting *s_old,
|
||||
NMSetting *s_new,
|
||||
GHashTable *diffs,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceClass *device_class;
|
||||
|
||||
|
@ -3563,9 +3563,9 @@ reapply_connection(NMDevice *device, NMConnection *con_old, NMConnection *con_ne
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
const char ** list;
|
||||
const char **list;
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_MODE:
|
||||
|
@ -3604,7 +3604,7 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||
static void
|
||||
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMDeviceWifi * device = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifi *device = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(device);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -3639,7 +3639,7 @@ nm_device_wifi_init(NMDeviceWifi *self)
|
|||
static void
|
||||
constructed(GObject *object)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
G_OBJECT_CLASS(nm_device_wifi_parent_class)->constructed(object);
|
||||
|
@ -3673,7 +3673,7 @@ nm_device_wifi_new(const char *iface, _NMDeviceWifiCapabilities capabilities)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
nm_assert(c_list_is_empty(&priv->scanning_prohibited_lst_head));
|
||||
|
@ -3702,7 +3702,7 @@ dispose(GObject *object)
|
|||
static void
|
||||
finalize(GObject *object)
|
||||
{
|
||||
NMDeviceWifi * self = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(object);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
|
||||
nm_assert(c_list_is_empty(&priv->aps_lst_head));
|
||||
|
@ -3716,9 +3716,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_device_wifi_class_init(NMDeviceWifiClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->constructed = constructed;
|
||||
object_class->get_property = get_property;
|
||||
|
|
|
@ -37,8 +37,8 @@ NMDevice *nm_device_wifi_new(const char *iface, _NMDeviceWifiCapabilities capabi
|
|||
|
||||
const CList *_nm_device_wifi_get_aps(NMDeviceWifi *self);
|
||||
|
||||
void _nm_device_wifi_request_scan(NMDeviceWifi * self,
|
||||
GVariant * options,
|
||||
void _nm_device_wifi_request_scan(NMDeviceWifi *self,
|
||||
GVariant *options,
|
||||
GDBusMethodInvocation *invocation);
|
||||
|
||||
GPtrArray *nmtst_ssids_options_to_ptrarray(GVariant *value, GError **error);
|
||||
|
|
|
@ -26,29 +26,29 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
const char * name;
|
||||
const char *name;
|
||||
NMIwdNetworkSecurity security;
|
||||
char buf[0];
|
||||
} KnownNetworkId;
|
||||
|
||||
typedef struct {
|
||||
GDBusProxy * known_network;
|
||||
GDBusProxy *known_network;
|
||||
NMSettingsConnection *mirror_connection;
|
||||
const KnownNetworkId *id;
|
||||
} KnownNetworkData;
|
||||
|
||||
typedef struct {
|
||||
NMManager * manager;
|
||||
NMSettings * settings;
|
||||
GCancellable * cancellable;
|
||||
NMManager *manager;
|
||||
NMSettings *settings;
|
||||
GCancellable *cancellable;
|
||||
gboolean running;
|
||||
GDBusObjectManager *object_manager;
|
||||
guint agent_id;
|
||||
char * agent_path;
|
||||
GHashTable * known_networks;
|
||||
NMDeviceIwd * last_agent_call_device;
|
||||
char * last_state_dir;
|
||||
char * warned_state_dir;
|
||||
char *agent_path;
|
||||
GHashTable *known_networks;
|
||||
NMDeviceIwd *last_agent_call_device;
|
||||
char *last_state_dir;
|
||||
char *warned_state_dir;
|
||||
} NMIwdManagerPrivate;
|
||||
|
||||
struct _NMIwdManager {
|
||||
|
@ -98,7 +98,7 @@ G_DEFINE_TYPE(NMIwdManager, nm_iwd_manager, G_TYPE_OBJECT)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void mirror_connection_take_and_delete(NMSettingsConnection *sett_conn,
|
||||
KnownNetworkData * data);
|
||||
KnownNetworkData *data);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
@ -146,10 +146,10 @@ get_property_bool(GDBusProxy *proxy, const char *property, gboolean default_val)
|
|||
static NMDeviceIwd *
|
||||
get_device_from_network(NMIwdManager *self, GDBusProxy *network)
|
||||
{
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
const char * ifname;
|
||||
const char * device_path;
|
||||
NMDevice * device;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
const char *ifname;
|
||||
const char *device_path;
|
||||
NMDevice *device;
|
||||
gs_unref_object GDBusInterface *device_obj = NULL;
|
||||
|
||||
/* Try not to rely on the path of the Device being a prefix of the
|
||||
|
@ -182,21 +182,21 @@ get_device_from_network(NMIwdManager *self, GDBusProxy *network)
|
|||
}
|
||||
|
||||
static void
|
||||
agent_dbus_method_cb(GDBusConnection * connection,
|
||||
const char * sender,
|
||||
const char * object_path,
|
||||
const char * interface_name,
|
||||
const char * method_name,
|
||||
GVariant * parameters,
|
||||
agent_dbus_method_cb(GDBusConnection *connection,
|
||||
const char *sender,
|
||||
const char *object_path,
|
||||
const char *interface_name,
|
||||
const char *method_name,
|
||||
GVariant *parameters,
|
||||
GDBusMethodInvocation *invocation,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
const char * network_path;
|
||||
NMDeviceIwd * device;
|
||||
gs_free char * name_owner = NULL;
|
||||
gs_unref_object GDBusInterface *network = NULL;
|
||||
NMIwdManager *self = user_data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
const char *network_path;
|
||||
NMDeviceIwd *device;
|
||||
gs_free char *name_owner = NULL;
|
||||
gs_unref_object GDBusInterface *network = NULL;
|
||||
|
||||
/* Be paranoid and check the sender address */
|
||||
name_owner = g_dbus_object_manager_client_get_name_owner(
|
||||
|
@ -315,7 +315,7 @@ static void
|
|||
register_agent(NMIwdManager *self)
|
||||
{
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
GDBusInterface * agent_manager;
|
||||
GDBusInterface *agent_manager;
|
||||
|
||||
agent_manager = g_dbus_object_manager_get_interface(priv->object_manager,
|
||||
"/net/connman/iwd", /* IWD 1.0+ */
|
||||
|
@ -388,9 +388,9 @@ static void
|
|||
set_device_dbus_object(NMIwdManager *self, GDBusProxy *proxy, GDBusObject *object)
|
||||
{
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
const char * ifname;
|
||||
const char *ifname;
|
||||
int ifindex;
|
||||
NMDevice * device;
|
||||
NMDevice *device;
|
||||
int errsv;
|
||||
|
||||
ifname = get_property_string_or_null(proxy, "Name");
|
||||
|
@ -423,7 +423,7 @@ static void
|
|||
known_network_update_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
variant = g_dbus_proxy_call_finish(G_DBUS_PROXY(source), res, &error);
|
||||
if (!variant) {
|
||||
|
@ -436,13 +436,13 @@ known_network_update_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
iwd_config_write(GKeyFile * config,
|
||||
const char * filepath,
|
||||
iwd_config_write(GKeyFile *config,
|
||||
const char *filepath,
|
||||
const struct timespec *mtime,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
gsize length;
|
||||
gs_free char * data = g_key_file_to_data(config, &length, NULL);
|
||||
gs_free char *data = g_key_file_to_data(config, &length, NULL);
|
||||
struct timespec times[2] = {{.tv_nsec = UTIME_OMIT}, *mtime};
|
||||
|
||||
/* Atomically write or replace the file with the right permission bits
|
||||
|
@ -458,7 +458,7 @@ static const char *
|
|||
get_config_path(NMIwdManager *self)
|
||||
{
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
const char * path;
|
||||
const char *path;
|
||||
|
||||
path = nm_config_data_get_iwd_config_path(NM_CONFIG_GET_DATA);
|
||||
if (path && path[0] == '\0') {
|
||||
|
@ -489,26 +489,26 @@ get_config_path(NMIwdManager *self)
|
|||
}
|
||||
|
||||
static void
|
||||
sett_conn_changed(NMSettingsConnection * sett_conn,
|
||||
sett_conn_changed(NMSettingsConnection *sett_conn,
|
||||
guint update_reason,
|
||||
const KnownNetworkData *data)
|
||||
{
|
||||
NMSettingsConnectionIntFlags flags;
|
||||
NMConnection * conn = nm_settings_connection_get_connection(sett_conn);
|
||||
NMSettingConnection * s_conn = nm_connection_get_setting_connection(conn);
|
||||
NMSettingWireless * s_wifi = nm_connection_get_setting_wireless(conn);
|
||||
NMSettingsConnectionIntFlags flags;
|
||||
NMConnection *conn = nm_settings_connection_get_connection(sett_conn);
|
||||
NMSettingConnection *s_conn = nm_connection_get_setting_connection(conn);
|
||||
NMSettingWireless *s_wifi = nm_connection_get_setting_wireless(conn);
|
||||
nm_auto_unref_keyfile GKeyFile *iwd_config = NULL;
|
||||
const char * iwd_dir;
|
||||
gs_free char * filename = NULL;
|
||||
gs_free char * full_path = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMIwdNetworkSecurity security;
|
||||
GBytes * ssid;
|
||||
const guint8 * ssid_data;
|
||||
gsize ssid_len;
|
||||
gboolean removed;
|
||||
GStatBuf statbuf;
|
||||
gboolean have_mtime;
|
||||
const char *iwd_dir;
|
||||
gs_free char *filename = NULL;
|
||||
gs_free char *full_path = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMIwdNetworkSecurity security;
|
||||
GBytes *ssid;
|
||||
const guint8 *ssid_data;
|
||||
gsize ssid_len;
|
||||
gboolean removed;
|
||||
GStatBuf statbuf;
|
||||
gboolean have_mtime;
|
||||
|
||||
nm_assert(sett_conn == data->mirror_connection);
|
||||
|
||||
|
@ -660,24 +660,24 @@ sett_conn_changed(NMSettingsConnection * sett_conn,
|
|||
* from the user.
|
||||
*/
|
||||
static NMSettingsConnection *
|
||||
mirror_connection(NMIwdManager * self,
|
||||
mirror_connection(NMIwdManager *self,
|
||||
const KnownNetworkId *id,
|
||||
gboolean create_new,
|
||||
GDBusProxy * known_network)
|
||||
GDBusProxy *known_network)
|
||||
{
|
||||
NMIwdManagerPrivate * priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
NMSettingsConnection *const *iter;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
NMSettingsConnection *const *iter;
|
||||
gs_unref_object NMConnection *connection = NULL;
|
||||
NMSettingsConnection * settings_connection = NULL;
|
||||
NMSettingsConnection *settings_connection = NULL;
|
||||
char uuid[37];
|
||||
NMSetting * setting;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_bytes GBytes *new_ssid = NULL;
|
||||
gsize ssid_len = strlen(id->name);
|
||||
gboolean autoconnectable = TRUE;
|
||||
gboolean hidden = FALSE;
|
||||
gboolean exact_match = TRUE;
|
||||
const char * key_mgmt = NULL;
|
||||
NMSetting *setting;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_bytes GBytes *new_ssid = NULL;
|
||||
gsize ssid_len = strlen(id->name);
|
||||
gboolean autoconnectable = TRUE;
|
||||
gboolean hidden = FALSE;
|
||||
gboolean exact_match = TRUE;
|
||||
const char *key_mgmt = NULL;
|
||||
|
||||
if (known_network) {
|
||||
autoconnectable = get_property_bool(known_network, "AutoConnect", TRUE);
|
||||
|
@ -686,10 +686,10 @@ mirror_connection(NMIwdManager * self,
|
|||
|
||||
for (iter = nm_settings_get_connections(priv->settings, NULL); *iter; iter++) {
|
||||
NMSettingsConnection *sett_conn = *iter;
|
||||
NMConnection * conn = nm_settings_connection_get_connection(sett_conn);
|
||||
NMConnection *conn = nm_settings_connection_get_connection(sett_conn);
|
||||
NMIwdNetworkSecurity security;
|
||||
NMSettingWireless * s_wifi;
|
||||
const guint8 * ssid_bytes;
|
||||
NMSettingWireless *s_wifi;
|
||||
const guint8 *ssid_bytes;
|
||||
gsize ssid_len2;
|
||||
|
||||
if (!nm_wifi_connection_get_iwd_ssid_and_security(conn, NULL, &security))
|
||||
|
@ -770,7 +770,7 @@ mirror_connection(NMIwdManager * self,
|
|||
if (NM_FLAGS_HAS(flags, NM_SETTINGS_CONNECTION_INT_FLAGS_NM_GENERATED)) {
|
||||
NMConnection *tmp_conn = nm_settings_connection_get_connection(settings_connection);
|
||||
NMSettingConnection *s_conn = nm_connection_get_setting_connection(tmp_conn);
|
||||
NMSettingWireless * s_wifi = nm_connection_get_setting_wireless(tmp_conn);
|
||||
NMSettingWireless *s_wifi = nm_connection_get_setting_wireless(tmp_conn);
|
||||
|
||||
g_object_set(G_OBJECT(s_conn),
|
||||
NM_SETTING_CONNECTION_AUTOCONNECT,
|
||||
|
@ -912,14 +912,14 @@ mirror_connection_take_and_delete(NMSettingsConnection *sett_conn, KnownNetworkD
|
|||
|
||||
static void
|
||||
interface_added(GDBusObjectManager *object_manager,
|
||||
GDBusObject * object,
|
||||
GDBusInterface * interface,
|
||||
GDBusObject *object,
|
||||
GDBusInterface *interface,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMIwdManager *self = user_data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
GDBusProxy * proxy;
|
||||
const char * iface_name;
|
||||
GDBusProxy *proxy;
|
||||
const char *iface_name;
|
||||
|
||||
if (!priv->running)
|
||||
return;
|
||||
|
@ -935,11 +935,11 @@ interface_added(GDBusObjectManager *object_manager,
|
|||
}
|
||||
|
||||
if (nm_streq(iface_name, NM_IWD_KNOWN_NETWORK_INTERFACE)) {
|
||||
KnownNetworkId * id;
|
||||
KnownNetworkId * orig_id;
|
||||
KnownNetworkData * data;
|
||||
KnownNetworkId *id;
|
||||
KnownNetworkId *orig_id;
|
||||
KnownNetworkData *data;
|
||||
NMIwdNetworkSecurity security;
|
||||
const char * type_str, *name;
|
||||
const char *type_str, *name;
|
||||
NMSettingsConnection *sett_conn = NULL;
|
||||
|
||||
type_str = get_property_string_or_null(proxy, "Type");
|
||||
|
@ -1002,14 +1002,14 @@ interface_added(GDBusObjectManager *object_manager,
|
|||
|
||||
static void
|
||||
interface_removed(GDBusObjectManager *object_manager,
|
||||
GDBusObject * object,
|
||||
GDBusInterface * interface,
|
||||
GDBusObject *object,
|
||||
GDBusInterface *interface,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMIwdManager *self = user_data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
GDBusProxy * proxy;
|
||||
const char * iface_name;
|
||||
GDBusProxy *proxy;
|
||||
const char *iface_name;
|
||||
|
||||
g_return_if_fail(G_IS_DBUS_PROXY(interface));
|
||||
|
||||
|
@ -1023,7 +1023,7 @@ interface_removed(GDBusObjectManager *object_manager,
|
|||
|
||||
if (nm_streq(iface_name, NM_IWD_KNOWN_NETWORK_INTERFACE)) {
|
||||
KnownNetworkId id;
|
||||
const char * type_str;
|
||||
const char *type_str;
|
||||
|
||||
type_str = get_property_string_or_null(proxy, "Type");
|
||||
id.name = get_property_string_or_null(proxy, "Name");
|
||||
|
@ -1088,19 +1088,19 @@ object_removed(GDBusObjectManager *object_manager, GDBusObject *object, gpointer
|
|||
static void
|
||||
connection_removed(NMSettings *settings, NMSettingsConnection *sett_conn, gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMIwdManagerPrivate * priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
NMConnection * conn = nm_settings_connection_get_connection(sett_conn);
|
||||
NMSettingWireless * s_wireless;
|
||||
KnownNetworkData * data;
|
||||
NMIwdManager *self = user_data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
NMConnection *conn = nm_settings_connection_get_connection(sett_conn);
|
||||
NMSettingWireless *s_wireless;
|
||||
KnownNetworkData *data;
|
||||
KnownNetworkId id;
|
||||
char ssid_buf[33];
|
||||
const guint8 * ssid_bytes;
|
||||
const guint8 *ssid_bytes;
|
||||
gsize ssid_len;
|
||||
NMSettingsConnection *new_mirror_conn;
|
||||
const char * iwd_dir;
|
||||
gs_free char * filename = NULL;
|
||||
gs_free char * full_path = NULL;
|
||||
const char *iwd_dir;
|
||||
gs_free char *filename = NULL;
|
||||
gs_free char *full_path = NULL;
|
||||
|
||||
if (!nm_wifi_connection_get_iwd_ssid_and_security(conn, NULL, &id.security))
|
||||
return;
|
||||
|
@ -1170,13 +1170,13 @@ try_delete_file:
|
|||
static void
|
||||
connection_added(NMSettings *settings, NMSettingsConnection *sett_conn, gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMConnection * conn = nm_settings_connection_get_connection(sett_conn);
|
||||
NMSettingConnection *s_conn = nm_connection_get_setting_connection(conn);
|
||||
const char * iwd_dir;
|
||||
gs_free char * filename = NULL;
|
||||
gs_free char * full_path = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMIwdManager *self = user_data;
|
||||
NMConnection *conn = nm_settings_connection_get_connection(sett_conn);
|
||||
NMSettingConnection *s_conn = nm_connection_get_setting_connection(conn);
|
||||
const char *iwd_dir;
|
||||
gs_free char *filename = NULL;
|
||||
gs_free char *full_path = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
nm_auto_unref_keyfile GKeyFile *iwd_config = NULL;
|
||||
NMSettingsConnectionIntFlags flags;
|
||||
|
||||
|
@ -1259,7 +1259,7 @@ release_object_manager(NMIwdManager *self)
|
|||
g_signal_handlers_disconnect_by_data(priv->object_manager, self);
|
||||
|
||||
if (priv->agent_id) {
|
||||
GDBusConnection * agent_connection;
|
||||
GDBusConnection *agent_connection;
|
||||
GDBusObjectManagerClient *omc = G_DBUS_OBJECT_MANAGER_CLIENT(priv->object_manager);
|
||||
|
||||
agent_connection = g_dbus_object_manager_client_get_connection(omc);
|
||||
|
@ -1281,9 +1281,9 @@ static void prepare_object_manager(NMIwdManager *self);
|
|||
static void
|
||||
name_owner_changed(GObject *object, GParamSpec *pspec, gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMIwdManager *self = user_data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
GDBusObjectManager * object_manager = G_DBUS_OBJECT_MANAGER(object);
|
||||
GDBusObjectManager *object_manager = G_DBUS_OBJECT_MANAGER(object);
|
||||
|
||||
nm_assert(object_manager == priv->object_manager);
|
||||
|
||||
|
@ -1292,7 +1292,7 @@ name_owner_changed(GObject *object, GParamSpec *pspec, gpointer user_data)
|
|||
prepare_object_manager(self);
|
||||
} else {
|
||||
const CList *tmp_lst;
|
||||
NMDevice * device;
|
||||
NMDevice *device;
|
||||
|
||||
if (!priv->running)
|
||||
return;
|
||||
|
@ -1310,9 +1310,9 @@ name_owner_changed(GObject *object, GParamSpec *pspec, gpointer user_data)
|
|||
static void
|
||||
device_added(NMManager *manager, NMDevice *device, gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMIwdManager *self = user_data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
GList * objects, *iter;
|
||||
GList *objects, *iter;
|
||||
|
||||
if (!NM_IS_DEVICE_IWD(device))
|
||||
return;
|
||||
|
@ -1331,7 +1331,7 @@ device_added(NMManager *manager, NMDevice *device, gpointer user_data)
|
|||
objects = g_dbus_object_manager_get_objects(priv->object_manager);
|
||||
|
||||
for (iter = objects; iter; iter = iter->next) {
|
||||
GDBusObject * object = G_DBUS_OBJECT(iter->data);
|
||||
GDBusObject *object = G_DBUS_OBJECT(iter->data);
|
||||
gs_unref_object GDBusInterface *interface = NULL;
|
||||
|
||||
interface = g_dbus_object_get_interface(object, NM_IWD_NETWORK_INTERFACE);
|
||||
|
@ -1343,9 +1343,9 @@ device_added(NMManager *manager, NMDevice *device, gpointer user_data)
|
|||
}
|
||||
|
||||
for (iter = objects; iter; iter = iter->next) {
|
||||
GDBusObject * object = G_DBUS_OBJECT(iter->data);
|
||||
GDBusObject *object = G_DBUS_OBJECT(iter->data);
|
||||
gs_unref_object GDBusInterface *interface = NULL;
|
||||
const char * obj_ifname;
|
||||
const char *obj_ifname;
|
||||
|
||||
interface = g_dbus_object_get_interface(object, NM_IWD_DEVICE_INTERFACE);
|
||||
obj_ifname = get_property_string_or_null((GDBusProxy *) interface, "Name");
|
||||
|
@ -1363,7 +1363,7 @@ device_added(NMManager *manager, NMDevice *device, gpointer user_data)
|
|||
static void
|
||||
device_removed(NMManager *manager, NMDevice *device, gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMIwdManager *self = user_data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
|
||||
if (!NM_IS_DEVICE_IWD(device))
|
||||
|
@ -1431,13 +1431,13 @@ object_compare_interfaces(gconstpointer a, gconstpointer b)
|
|||
static void
|
||||
get_daemon_info_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMIwdManagerPrivate *priv;
|
||||
NMIwdManager *self = user_data;
|
||||
NMIwdManagerPrivate *priv;
|
||||
gs_unref_variant GVariant *properties = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
GVariantIter * properties_iter;
|
||||
const char * key;
|
||||
GVariant * value;
|
||||
gs_free_error GError *error = NULL;
|
||||
GVariantIter *properties_iter;
|
||||
const char *key;
|
||||
GVariant *value;
|
||||
|
||||
properties = g_dbus_proxy_call_finish(G_DBUS_PROXY(source), res, &error);
|
||||
if (!properties) {
|
||||
|
@ -1481,11 +1481,11 @@ next:
|
|||
static void
|
||||
got_object_manager(GObject *object, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMIwdManager * self = user_data;
|
||||
NMIwdManager *self = user_data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
GError * error = NULL;
|
||||
GDBusObjectManager * object_manager;
|
||||
GDBusConnection * connection;
|
||||
GError *error = NULL;
|
||||
GDBusObjectManager *object_manager;
|
||||
GDBusConnection *connection;
|
||||
|
||||
object_manager = g_dbus_object_manager_client_new_for_bus_finish(result, &error);
|
||||
if (object_manager == NULL) {
|
||||
|
@ -1515,7 +1515,7 @@ got_object_manager(GObject *object, GAsyncResult *result, gpointer user_data)
|
|||
}
|
||||
|
||||
if (_om_has_name_owner(object_manager)) {
|
||||
GList * objects, *iter;
|
||||
GList *objects, *iter;
|
||||
gs_unref_object GDBusInterface *daemon = NULL;
|
||||
|
||||
priv->running = true;
|
||||
|
@ -1587,11 +1587,11 @@ nm_iwd_manager_is_known_network(NMIwdManager *self, const char *name, NMIwdNetwo
|
|||
NMSettingsConnection *
|
||||
nm_iwd_manager_get_ap_mirror_connection(NMIwdManager *self, NMWifiAP *ap)
|
||||
{
|
||||
NMIwdManagerPrivate * priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
KnownNetworkData * data;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
KnownNetworkData *data;
|
||||
char name_buf[33];
|
||||
KnownNetworkId kn_id = {name_buf, NM_IWD_NETWORK_SECURITY_OPEN};
|
||||
const guint8 * ssid_bytes;
|
||||
const guint8 *ssid_bytes;
|
||||
gsize ssid_len;
|
||||
NM80211ApFlags flags = nm_wifi_ap_get_flags(ap);
|
||||
NM80211ApSecurityFlags sec_flags = nm_wifi_ap_get_wpa_flags(ap) | nm_wifi_ap_get_rsn_flags(ap);
|
||||
|
@ -1629,7 +1629,7 @@ GDBusProxy *
|
|||
nm_iwd_manager_get_dbus_interface(NMIwdManager *self, const char *path, const char *name)
|
||||
{
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
GDBusInterface * interface;
|
||||
GDBusInterface *interface;
|
||||
|
||||
if (!priv->object_manager)
|
||||
return NULL;
|
||||
|
@ -1691,7 +1691,7 @@ nm_iwd_manager_init(NMIwdManager *self)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMIwdManager * self = (NMIwdManager *) object;
|
||||
NMIwdManager *self = (NMIwdManager *) object;
|
||||
NMIwdManagerPrivate *priv = NM_IWD_MANAGER_GET_PRIVATE(self);
|
||||
|
||||
release_object_manager(self);
|
||||
|
|
|
@ -42,8 +42,8 @@ GType nm_iwd_manager_get_type(void);
|
|||
|
||||
NMIwdManager *nm_iwd_manager_get(void);
|
||||
|
||||
gboolean nm_iwd_manager_is_known_network(NMIwdManager * self,
|
||||
const char * name,
|
||||
gboolean nm_iwd_manager_is_known_network(NMIwdManager *self,
|
||||
const char *name,
|
||||
NMIwdNetworkSecurity security);
|
||||
|
||||
NMSettingsConnection *nm_iwd_manager_get_ap_mirror_connection(NMIwdManager *self, NMWifiAP *ap);
|
||||
|
|
|
@ -41,8 +41,8 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMWifiAP,
|
|||
|
||||
struct _NMWifiAPPrivate {
|
||||
/* Scanned or cached values */
|
||||
GBytes * ssid;
|
||||
char * address;
|
||||
GBytes *ssid;
|
||||
char *address;
|
||||
_NM80211Mode mode;
|
||||
guint8 strength;
|
||||
guint32 freq; /* Frequency in MHz; ie 2412 (== 2.412 GHz) */
|
||||
|
@ -430,7 +430,7 @@ has_proto(NMSettingWirelessSecurity *sec, const char *proto)
|
|||
static void
|
||||
add_pair_ciphers(NMWifiAP *ap, NMSettingWirelessSecurity *sec)
|
||||
{
|
||||
NMWifiAPPrivate * priv = NM_WIFI_AP_GET_PRIVATE(ap);
|
||||
NMWifiAPPrivate *priv = NM_WIFI_AP_GET_PRIVATE(ap);
|
||||
guint32 num = nm_setting_wireless_security_get_num_pairwise(sec);
|
||||
NM80211ApSecurityFlags flags = NM_802_11_AP_SEC_NONE;
|
||||
guint32 i;
|
||||
|
@ -458,7 +458,7 @@ add_pair_ciphers(NMWifiAP *ap, NMSettingWirelessSecurity *sec)
|
|||
static void
|
||||
add_group_ciphers(NMWifiAP *ap, NMSettingWirelessSecurity *sec)
|
||||
{
|
||||
NMWifiAPPrivate * priv = NM_WIFI_AP_GET_PRIVATE(ap);
|
||||
NMWifiAPPrivate *priv = NM_WIFI_AP_GET_PRIVATE(ap);
|
||||
guint32 num = nm_setting_wireless_security_get_num_groups(sec);
|
||||
NM80211ApSecurityFlags flags = NM_802_11_AP_SEC_NONE;
|
||||
guint32 i;
|
||||
|
@ -491,10 +491,10 @@ const char *
|
|||
nm_wifi_ap_to_string(const NMWifiAP *self, char *str_buf, gulong buf_len, gint64 now_msec)
|
||||
{
|
||||
const NMWifiAPPrivate *priv;
|
||||
const char * supplicant_id = "-";
|
||||
const char * export_path;
|
||||
const char *supplicant_id = "-";
|
||||
const char *export_path;
|
||||
guint32 chan;
|
||||
gs_free char * ssid_to_free = NULL;
|
||||
gs_free char *ssid_to_free = NULL;
|
||||
char str_buf_ts[100];
|
||||
|
||||
g_return_val_if_fail(NM_IS_WIFI_AP(self), NULL);
|
||||
|
@ -558,13 +558,13 @@ freq_to_band(guint32 freq)
|
|||
gboolean
|
||||
nm_wifi_ap_check_compatible(NMWifiAP *self, NMConnection *connection)
|
||||
{
|
||||
NMWifiAPPrivate * priv;
|
||||
NMSettingWireless * s_wireless;
|
||||
NMWifiAPPrivate *priv;
|
||||
NMSettingWireless *s_wireless;
|
||||
NMSettingWirelessSecurity *s_wireless_sec;
|
||||
GBytes * ssid;
|
||||
const char * mode;
|
||||
const char * band;
|
||||
const char * bssid;
|
||||
GBytes *ssid;
|
||||
const char *mode;
|
||||
const char *band;
|
||||
const char *bssid;
|
||||
guint32 channel;
|
||||
|
||||
g_return_val_if_fail(NM_IS_WIFI_AP(self), FALSE);
|
||||
|
@ -629,10 +629,10 @@ nm_wifi_ap_check_compatible(NMWifiAP *self, NMConnection *connection)
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_wifi_ap_complete_connection(NMWifiAP * self,
|
||||
nm_wifi_ap_complete_connection(NMWifiAP *self,
|
||||
NMConnection *connection,
|
||||
gboolean lock_bssid,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMWifiAPPrivate *priv = NM_WIFI_AP_GET_PRIVATE(self);
|
||||
|
||||
|
@ -655,7 +655,7 @@ nm_wifi_ap_complete_connection(NMWifiAP * self,
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMWifiAP * self = NM_WIFI_AP(object);
|
||||
NMWifiAP *self = NM_WIFI_AP(object);
|
||||
NMWifiAPPrivate *priv = NM_WIFI_AP_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -734,11 +734,11 @@ nm_wifi_ap_new_from_properties(const NMSupplicantBssInfo *bss_info)
|
|||
NMWifiAP *
|
||||
nm_wifi_ap_new_fake_from_connection(NMConnection *connection)
|
||||
{
|
||||
NMWifiAP * ap;
|
||||
NMWifiAPPrivate * priv;
|
||||
NMSettingWireless * s_wireless;
|
||||
NMWifiAP *ap;
|
||||
NMWifiAPPrivate *priv;
|
||||
NMSettingWireless *s_wireless;
|
||||
NMSettingWirelessSecurity *s_wireless_sec;
|
||||
const char * mode, *band, *key_mgmt;
|
||||
const char *mode, *band, *key_mgmt;
|
||||
guint32 channel;
|
||||
NM80211ApSecurityFlags flags;
|
||||
gboolean psk = FALSE, eap = FALSE, adhoc = FALSE;
|
||||
|
@ -845,7 +845,7 @@ error:
|
|||
static void
|
||||
finalize(GObject *object)
|
||||
{
|
||||
NMWifiAP * self = NM_WIFI_AP(object);
|
||||
NMWifiAP *self = NM_WIFI_AP(object);
|
||||
NMWifiAPPrivate *priv = NM_WIFI_AP_GET_PRIVATE(self);
|
||||
|
||||
nm_assert(!self->wifi_device);
|
||||
|
@ -890,7 +890,7 @@ nm_wifi_ap_class_init(NMWifiAPClass *ap_class)
|
|||
| NM_802_11_AP_SEC_KEY_MGMT_SAE | NM_802_11_AP_SEC_KEY_MGMT_OWE \
|
||||
| NM_802_11_AP_SEC_KEY_MGMT_OWE_TM | NM_802_11_AP_SEC_KEY_MGMT_EAP_SUITE_B_192)
|
||||
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(ap_class);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(ap_class);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(ap_class);
|
||||
|
||||
g_type_class_add_private(object_class, sizeof(NMWifiAPPrivate));
|
||||
|
@ -987,10 +987,10 @@ nm_wifi_ap_class_init(NMWifiAPClass *ap_class)
|
|||
const char **
|
||||
nm_wifi_aps_get_paths(const CList *aps_lst_head, gboolean include_without_ssid)
|
||||
{
|
||||
NMWifiAP * ap;
|
||||
NMWifiAP *ap;
|
||||
gsize i, n;
|
||||
const char **list;
|
||||
const char * path;
|
||||
const char *path;
|
||||
|
||||
n = c_list_length(aps_lst_head);
|
||||
list = g_new(const char *, n + 1);
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
|
||||
typedef struct {
|
||||
NMDBusObject parent;
|
||||
NMDevice * wifi_device;
|
||||
NMDevice *wifi_device;
|
||||
CList aps_lst;
|
||||
NMRefString * _supplicant_path;
|
||||
NMRefString *_supplicant_path;
|
||||
struct _NMWifiAPPrivate *_priv;
|
||||
} NMWifiAP;
|
||||
|
||||
|
@ -47,15 +47,15 @@ GType nm_wifi_ap_get_type(void);
|
|||
NMWifiAP *nm_wifi_ap_new_from_properties(const struct _NMSupplicantBssInfo *bss_info);
|
||||
NMWifiAP *nm_wifi_ap_new_fake_from_connection(NMConnection *connection);
|
||||
|
||||
gboolean nm_wifi_ap_update_from_properties(NMWifiAP * ap,
|
||||
gboolean nm_wifi_ap_update_from_properties(NMWifiAP *ap,
|
||||
const struct _NMSupplicantBssInfo *bss_info);
|
||||
|
||||
gboolean nm_wifi_ap_check_compatible(NMWifiAP *self, NMConnection *connection);
|
||||
|
||||
gboolean nm_wifi_ap_complete_connection(NMWifiAP * self,
|
||||
gboolean nm_wifi_ap_complete_connection(NMWifiAP *self,
|
||||
NMConnection *connection,
|
||||
gboolean lock_bssid,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
static inline NMRefString *
|
||||
nm_wifi_ap_get_supplicant_path(NMWifiAP *ap)
|
||||
|
@ -65,9 +65,9 @@ nm_wifi_ap_get_supplicant_path(NMWifiAP *ap)
|
|||
return ap->_supplicant_path;
|
||||
}
|
||||
|
||||
GBytes * nm_wifi_ap_get_ssid(const NMWifiAP *ap);
|
||||
GBytes *nm_wifi_ap_get_ssid(const NMWifiAP *ap);
|
||||
gboolean nm_wifi_ap_set_ssid(NMWifiAP *ap, GBytes *ssid);
|
||||
const char * nm_wifi_ap_get_address(const NMWifiAP *ap);
|
||||
const char *nm_wifi_ap_get_address(const NMWifiAP *ap);
|
||||
gboolean nm_wifi_ap_set_address(NMWifiAP *ap, const char *addr);
|
||||
gboolean nm_wifi_ap_set_address_bin(NMWifiAP *ap, const NMEtherAddr *addr);
|
||||
_NM80211Mode nm_wifi_ap_get_mode(NMWifiAP *ap);
|
||||
|
|
|
@ -56,17 +56,17 @@ _dispatch_request_scan(NMDevice *device, GVariant *options, GDBusMethodInvocatio
|
|||
}
|
||||
|
||||
static void
|
||||
impl_device_wifi_get_access_points(NMDBusObject * obj,
|
||||
impl_device_wifi_get_access_points(NMDBusObject *obj,
|
||||
const NMDBusInterfaceInfoExtended *interface_info,
|
||||
const NMDBusMethodInfoExtended * method_info,
|
||||
GDBusConnection * connection,
|
||||
const char * sender,
|
||||
GDBusMethodInvocation * invocation,
|
||||
GVariant * parameters)
|
||||
const NMDBusMethodInfoExtended *method_info,
|
||||
GDBusConnection *connection,
|
||||
const char *sender,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *parameters)
|
||||
{
|
||||
gs_free const char **list = NULL;
|
||||
GVariant * v;
|
||||
const CList * all_aps;
|
||||
GVariant *v;
|
||||
const CList *all_aps;
|
||||
|
||||
/* NOTE: this handler is called both for NMDevicwWifi and NMDeviceIwd. */
|
||||
|
||||
|
@ -77,17 +77,17 @@ impl_device_wifi_get_access_points(NMDBusObject * obj,
|
|||
}
|
||||
|
||||
static void
|
||||
impl_device_wifi_get_all_access_points(NMDBusObject * obj,
|
||||
impl_device_wifi_get_all_access_points(NMDBusObject *obj,
|
||||
const NMDBusInterfaceInfoExtended *interface_info,
|
||||
const NMDBusMethodInfoExtended * method_info,
|
||||
GDBusConnection * connection,
|
||||
const char * sender,
|
||||
GDBusMethodInvocation * invocation,
|
||||
GVariant * parameters)
|
||||
const NMDBusMethodInfoExtended *method_info,
|
||||
GDBusConnection *connection,
|
||||
const char *sender,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *parameters)
|
||||
{
|
||||
gs_free const char **list = NULL;
|
||||
GVariant * v;
|
||||
const CList * all_aps;
|
||||
GVariant *v;
|
||||
const CList *all_aps;
|
||||
|
||||
/* NOTE: this handler is called both for NMDevicwWifi and NMDeviceIwd. */
|
||||
|
||||
|
@ -98,13 +98,13 @@ impl_device_wifi_get_all_access_points(NMDBusObject * obj,
|
|||
}
|
||||
|
||||
static void
|
||||
impl_device_wifi_request_scan(NMDBusObject * obj,
|
||||
impl_device_wifi_request_scan(NMDBusObject *obj,
|
||||
const NMDBusInterfaceInfoExtended *interface_info,
|
||||
const NMDBusMethodInfoExtended * method_info,
|
||||
GDBusConnection * connection,
|
||||
const char * sender,
|
||||
GDBusMethodInvocation * invocation,
|
||||
GVariant * parameters)
|
||||
const NMDBusMethodInfoExtended *method_info,
|
||||
GDBusConnection *connection,
|
||||
const char *sender,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *parameters)
|
||||
{
|
||||
gs_unref_variant GVariant *options = NULL;
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ NM_DEVICE_FACTORY_DECLARE_TYPES(
|
|||
NM_SETTING_OLPC_MESH_SETTING_NAME))
|
||||
|
||||
G_MODULE_EXPORT NMDeviceFactory *
|
||||
nm_device_factory_create(GError **error)
|
||||
nm_device_factory_create(GError **error)
|
||||
{
|
||||
return g_object_new(NM_TYPE_WIFI_FACTORY, NULL);
|
||||
}
|
||||
|
@ -68,14 +68,14 @@ p2p_device_created(NMDeviceWifi *device, NMDeviceWifiP2P *p2p_device, NMDeviceFa
|
|||
}
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
gs_free char *backend_free = NULL;
|
||||
const char * backend;
|
||||
const char *backend;
|
||||
|
||||
g_return_val_if_fail(iface != NULL, NULL);
|
||||
g_return_val_if_fail(plink != NULL, NULL);
|
||||
|
@ -98,7 +98,7 @@ create_device(NMDeviceFactory * factory,
|
|||
NM_PRINT_FMT_QUOTE_STRING(backend),
|
||||
WITH_IWD ? " (iwd support enabled)" : "");
|
||||
if (!backend || !g_ascii_strcasecmp(backend, "wpa_supplicant")) {
|
||||
NMDevice * device;
|
||||
NMDevice *device;
|
||||
_NMDeviceWifiCapabilities capabilities;
|
||||
_NM80211Mode mode;
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@ const char **
|
|||
nm_wifi_p2p_peers_get_paths(const CList *peers_lst_head)
|
||||
{
|
||||
NMWifiP2PPeer *peer;
|
||||
const char ** list;
|
||||
const char * path;
|
||||
const char **list;
|
||||
const char *path;
|
||||
gsize i, n;
|
||||
|
||||
n = c_list_length(peers_lst_head);
|
||||
|
@ -261,7 +261,7 @@ nm_wifi_p2p_peer_get_wfd_ies(const NMWifiP2PPeer *peer)
|
|||
gboolean
|
||||
nm_wifi_p2p_peer_set_wfd_ies(NMWifiP2PPeer *peer, GBytes *wfd_ies)
|
||||
{
|
||||
NMWifiP2PPeerPrivate *priv;
|
||||
NMWifiP2PPeerPrivate *priv;
|
||||
gs_unref_bytes GBytes *wfd_ies_old = NULL;
|
||||
|
||||
g_return_val_if_fail(NM_IS_WIFI_P2P_PEER(peer), FALSE);
|
||||
|
@ -423,8 +423,8 @@ const char *
|
|||
nm_wifi_p2p_peer_to_string(const NMWifiP2PPeer *self, char *str_buf, gsize buf_len, gint32 now_s)
|
||||
{
|
||||
const NMWifiP2PPeerPrivate *priv;
|
||||
const char * supplicant_id = "-";
|
||||
const char * export_path;
|
||||
const char *supplicant_id = "-";
|
||||
const char *export_path;
|
||||
|
||||
g_return_val_if_fail(NM_IS_WIFI_P2P_PEER(self), NULL);
|
||||
|
||||
|
@ -461,8 +461,8 @@ gboolean
|
|||
nm_wifi_p2p_peer_check_compatible(NMWifiP2PPeer *self, NMConnection *connection)
|
||||
{
|
||||
NMWifiP2PPeerPrivate *priv;
|
||||
NMSettingWifiP2P * s_wifi_p2p;
|
||||
const char * hwaddr;
|
||||
NMSettingWifiP2P *s_wifi_p2p;
|
||||
const char *hwaddr;
|
||||
|
||||
g_return_val_if_fail(NM_IS_WIFI_P2P_PEER(self), FALSE);
|
||||
g_return_val_if_fail(NM_IS_CONNECTION(connection), FALSE);
|
||||
|
@ -486,7 +486,7 @@ nm_wifi_p2p_peer_check_compatible(NMWifiP2PPeer *self, NMConnection *connection)
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMWifiP2PPeer * self = NM_WIFI_P2P_PEER(object);
|
||||
NMWifiP2PPeer *self = NM_WIFI_P2P_PEER(object);
|
||||
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -562,7 +562,7 @@ nm_wifi_p2p_peer_new_from_properties(const NMSupplicantPeerInfo *peer_info)
|
|||
static void
|
||||
finalize(GObject *object)
|
||||
{
|
||||
NMWifiP2PPeer * self = NM_WIFI_P2P_PEER(object);
|
||||
NMWifiP2PPeer *self = NM_WIFI_P2P_PEER(object);
|
||||
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE(self);
|
||||
|
||||
nm_assert(!self->wifi_device);
|
||||
|
@ -613,7 +613,7 @@ static const NMDBusInterfaceInfoExtended interface_info_p2p_peer = {
|
|||
static void
|
||||
nm_wifi_p2p_peer_class_init(NMWifiP2PPeerClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
|
||||
g_type_class_add_private(object_class, sizeof(NMWifiP2PPeerPrivate));
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
typedef struct {
|
||||
NMDBusObject parent;
|
||||
NMDevice * wifi_device;
|
||||
NMDevice *wifi_device;
|
||||
CList peers_lst;
|
||||
struct _NMWifiP2PPeerPrivate *_priv;
|
||||
} NMWifiP2PPeer;
|
||||
|
@ -46,7 +46,7 @@ GType nm_wifi_p2p_peer_get_type(void);
|
|||
|
||||
NMWifiP2PPeer *nm_wifi_p2p_peer_new_from_properties(const struct _NMSupplicantPeerInfo *peer_info);
|
||||
|
||||
gboolean nm_wifi_p2p_peer_update_from_properties(NMWifiP2PPeer * peer,
|
||||
gboolean nm_wifi_p2p_peer_update_from_properties(NMWifiP2PPeer *peer,
|
||||
const struct _NMSupplicantPeerInfo *peer_info);
|
||||
|
||||
gboolean nm_wifi_p2p_peer_check_compatible(NMWifiP2PPeer *self, NMConnection *connection);
|
||||
|
@ -64,12 +64,12 @@ gboolean nm_wifi_p2p_peer_set_model_number(NMWifiP2PPeer *peer, const char *n
|
|||
const char *nm_wifi_p2p_peer_get_serial(const NMWifiP2PPeer *peer);
|
||||
gboolean nm_wifi_p2p_peer_set_serial(NMWifiP2PPeer *peer, const char *serial);
|
||||
|
||||
GBytes * nm_wifi_p2p_peer_get_wfd_ies(const NMWifiP2PPeer *peer);
|
||||
GBytes *nm_wifi_p2p_peer_get_wfd_ies(const NMWifiP2PPeer *peer);
|
||||
gboolean nm_wifi_p2p_peer_set_wfd_ies(NMWifiP2PPeer *peer, GBytes *bytes);
|
||||
|
||||
const char *const *nm_wifi_p2p_peer_get_groups(const NMWifiP2PPeer *peer);
|
||||
|
||||
const char * nm_wifi_p2p_peer_get_address(const NMWifiP2PPeer *peer);
|
||||
const char *nm_wifi_p2p_peer_get_address(const NMWifiP2PPeer *peer);
|
||||
gboolean nm_wifi_p2p_peer_set_address(NMWifiP2PPeer *peer, const char *addr);
|
||||
gint8 nm_wifi_p2p_peer_get_strength(NMWifiP2PPeer *peer);
|
||||
gboolean nm_wifi_p2p_peer_set_strength(NMWifiP2PPeer *peer, gint8 strength);
|
||||
|
@ -80,11 +80,11 @@ nm_wifi_p2p_peer_to_string(const NMWifiP2PPeer *self, char *str_buf, gsize buf_l
|
|||
|
||||
const char **nm_wifi_p2p_peers_get_paths(const CList *peers_lst_head);
|
||||
|
||||
NMWifiP2PPeer *nm_wifi_p2p_peers_find_first_compatible(const CList * peers_lst_head,
|
||||
NMWifiP2PPeer *nm_wifi_p2p_peers_find_first_compatible(const CList *peers_lst_head,
|
||||
NMConnection *connection);
|
||||
|
||||
NMWifiP2PPeer *nm_wifi_p2p_peers_find_by_supplicant_path(const CList *peers_lst_head,
|
||||
const char * path);
|
||||
const char *path);
|
||||
|
||||
NMWifiP2PPeer *nm_wifi_p2p_peer_lookup_for_device(NMDevice *device, const char *exported_path);
|
||||
|
||||
|
|
|
@ -41,9 +41,9 @@ verify_no_wep(NMSettingWirelessSecurity *s_wsec, const char *tag, GError **error
|
|||
|
||||
static gboolean
|
||||
verify_leap(NMSettingWirelessSecurity *s_wsec,
|
||||
NMSetting8021x * s_8021x,
|
||||
NMSetting8021x *s_8021x,
|
||||
gboolean adhoc,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char *key_mgmt, *auth_alg, *leap_username;
|
||||
|
||||
|
@ -224,9 +224,9 @@ verify_no_wpa(NMSettingWirelessSecurity *s_wsec, const char *tag, GError **error
|
|||
|
||||
static gboolean
|
||||
verify_dynamic_wep(NMSettingWirelessSecurity *s_wsec,
|
||||
NMSetting8021x * s_8021x,
|
||||
NMSetting8021x *s_8021x,
|
||||
gboolean adhoc,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char *key_mgmt, *auth_alg, *leap_username;
|
||||
|
||||
|
@ -303,11 +303,11 @@ verify_dynamic_wep(NMSettingWirelessSecurity *s_wsec,
|
|||
|
||||
static gboolean
|
||||
verify_wpa_psk(NMSettingWirelessSecurity *s_wsec,
|
||||
NMSetting8021x * s_8021x,
|
||||
NMSetting8021x *s_8021x,
|
||||
gboolean adhoc,
|
||||
guint32 wpa_flags,
|
||||
guint32 rsn_flags,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char *key_mgmt, *auth_alg;
|
||||
|
||||
|
@ -400,10 +400,10 @@ verify_wpa_psk(NMSettingWirelessSecurity *s_wsec,
|
|||
|
||||
static gboolean
|
||||
verify_wpa_eap(NMSettingWirelessSecurity *s_wsec,
|
||||
NMSetting8021x * s_8021x,
|
||||
NMSetting8021x *s_8021x,
|
||||
guint32 wpa_flags,
|
||||
guint32 rsn_flags,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char *key_mgmt, *auth_alg;
|
||||
gboolean is_wpa_eap = FALSE;
|
||||
|
@ -465,9 +465,9 @@ verify_wpa_eap(NMSettingWirelessSecurity *s_wsec,
|
|||
|
||||
static gboolean
|
||||
verify_adhoc(NMSettingWirelessSecurity *s_wsec,
|
||||
NMSetting8021x * s_8021x,
|
||||
NMSetting8021x *s_8021x,
|
||||
gboolean adhoc,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
const char *key_mgmt = NULL, *leap_username = NULL, *auth_alg = NULL;
|
||||
|
||||
|
@ -529,8 +529,8 @@ verify_adhoc(NMSettingWirelessSecurity *s_wsec,
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_wifi_utils_complete_connection(GBytes * ap_ssid,
|
||||
const char * bssid,
|
||||
nm_wifi_utils_complete_connection(GBytes *ap_ssid,
|
||||
const char *bssid,
|
||||
_NM80211Mode ap_mode,
|
||||
guint32 ap_freq,
|
||||
guint32 ap_flags,
|
||||
|
@ -538,13 +538,13 @@ nm_wifi_utils_complete_connection(GBytes * ap_ssid,
|
|||
guint32 ap_rsn_flags,
|
||||
NMConnection *connection,
|
||||
gboolean lock_bssid,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMSettingWireless * s_wifi;
|
||||
NMSettingWireless *s_wifi;
|
||||
NMSettingWirelessSecurity *s_wsec;
|
||||
NMSetting8021x * s_8021x;
|
||||
GBytes * ssid;
|
||||
const char * mode, *key_mgmt, *auth_alg, *leap_username;
|
||||
NMSetting8021x *s_8021x;
|
||||
GBytes *ssid;
|
||||
const char *mode, *key_mgmt, *auth_alg, *leap_username;
|
||||
gboolean adhoc = FALSE;
|
||||
gboolean mesh = FALSE;
|
||||
|
||||
|
@ -892,20 +892,20 @@ nm_wifi_utils_is_manf_default_ssid(GBytes *ssid)
|
|||
|
||||
/* To be used for connections where the SSID has been validated before */
|
||||
gboolean
|
||||
nm_wifi_connection_get_iwd_ssid_and_security(NMConnection * connection,
|
||||
char ** ssid,
|
||||
nm_wifi_connection_get_iwd_ssid_and_security(NMConnection *connection,
|
||||
char **ssid,
|
||||
NMIwdNetworkSecurity *security)
|
||||
{
|
||||
NMSettingWireless * s_wireless;
|
||||
NMSettingWireless *s_wireless;
|
||||
NMSettingWirelessSecurity *s_wireless_sec;
|
||||
const char * key_mgmt = NULL;
|
||||
const char *key_mgmt = NULL;
|
||||
|
||||
s_wireless = nm_connection_get_setting_wireless(connection);
|
||||
if (!s_wireless)
|
||||
return FALSE;
|
||||
|
||||
if (ssid) {
|
||||
GBytes * bytes = nm_setting_wireless_get_ssid(s_wireless);
|
||||
GBytes *bytes = nm_setting_wireless_get_ssid(s_wireless);
|
||||
gsize ssid_len;
|
||||
const char *ssid_str = (const char *) g_bytes_get_data(bytes, &ssid_len);
|
||||
|
||||
|
@ -947,7 +947,7 @@ nm_wifi_connection_get_iwd_ssid_and_security(NMConnection * connection,
|
|||
* @ssid_len can be -1 instead of actual SSID length.
|
||||
*/
|
||||
char *
|
||||
nm_wifi_utils_get_iwd_config_filename(const char * ssid,
|
||||
nm_wifi_utils_get_iwd_config_filename(const char *ssid,
|
||||
gssize ssid_len,
|
||||
NMIwdNetworkSecurity security)
|
||||
{
|
||||
|
@ -995,10 +995,10 @@ static gboolean
|
|||
psk_setting_to_iwd_config(GKeyFile *file, NMSettingWirelessSecurity *s_wsec, GError **error)
|
||||
{
|
||||
NMSettingSecretFlags psk_flags = nm_setting_wireless_security_get_psk_flags(s_wsec);
|
||||
const char * psk = nm_setting_wireless_security_get_psk(s_wsec);
|
||||
const char *psk = nm_setting_wireless_security_get_psk(s_wsec);
|
||||
gsize psk_len;
|
||||
guint8 buffer[32];
|
||||
const char * key_mgmt = nm_setting_wireless_security_get_key_mgmt(s_wsec);
|
||||
const char *key_mgmt = nm_setting_wireless_security_get_key_mgmt(s_wsec);
|
||||
|
||||
if (!psk || NM_FLAGS_ANY(psk_flags, SECRETS_DONT_STORE_FLAGS)) {
|
||||
if (NM_FLAGS_ANY(psk_flags, SECRETS_DONT_STORE_FLAGS)) {
|
||||
|
@ -1029,11 +1029,11 @@ psk_setting_to_iwd_config(GKeyFile *file, NMSettingWirelessSecurity *s_wsec, GEr
|
|||
}
|
||||
|
||||
static gboolean
|
||||
eap_certs_to_iwd_config(GKeyFile * file,
|
||||
eap_certs_to_iwd_config(GKeyFile *file,
|
||||
NMSetting8021x *s_8021x,
|
||||
bool phase2,
|
||||
char * iwd_prefix,
|
||||
GError ** error)
|
||||
char *iwd_prefix,
|
||||
GError **error)
|
||||
{
|
||||
NMSetting8021xCKScheme ca_cert_scheme =
|
||||
phase2 ? nm_setting_802_1x_get_phase2_ca_cert_scheme(s_8021x)
|
||||
|
@ -1043,13 +1043,13 @@ eap_certs_to_iwd_config(GKeyFile * file,
|
|||
: nm_setting_802_1x_get_client_cert_scheme(s_8021x);
|
||||
NMSetting8021xCKScheme key_scheme;
|
||||
NMSettingSecretFlags key_password_flags;
|
||||
const char * ca_path = phase2 ? nm_setting_802_1x_get_phase2_ca_path(s_8021x)
|
||||
const char *ca_path = phase2 ? nm_setting_802_1x_get_phase2_ca_path(s_8021x)
|
||||
: nm_setting_802_1x_get_ca_path(s_8021x);
|
||||
const char * cert_path;
|
||||
const char * key_path = NULL;
|
||||
const char * key_password;
|
||||
const char * domain_suffix_match;
|
||||
const char * domain_match;
|
||||
const char *cert_path;
|
||||
const char *key_path = NULL;
|
||||
const char *key_password;
|
||||
const char *domain_suffix_match;
|
||||
const char *domain_match;
|
||||
char setting_buf[128];
|
||||
|
||||
/* TODO: should check that all certificates and the key are RSA */
|
||||
|
@ -1220,7 +1220,7 @@ private_key_done:
|
|||
: nm_setting_802_1x_get_domain_match(s_8021x);
|
||||
|
||||
if (domain_suffix_match || domain_match) {
|
||||
GString * s = g_string_sized_new(128);
|
||||
GString *s = g_string_sized_new(128);
|
||||
const char *ptr;
|
||||
const char *end;
|
||||
|
||||
|
@ -1287,13 +1287,13 @@ eap_optional_identity_to_iwd_config(GKeyFile *file, const char *iwd_prefix, cons
|
|||
}
|
||||
|
||||
static gboolean
|
||||
eap_optional_password_to_iwd_config(GKeyFile * file,
|
||||
const char * iwd_prefix,
|
||||
eap_optional_password_to_iwd_config(GKeyFile *file,
|
||||
const char *iwd_prefix,
|
||||
NMSetting8021x *s_8021x,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
char setting_buf[128];
|
||||
const char * password = nm_setting_802_1x_get_password(s_8021x);
|
||||
const char *password = nm_setting_802_1x_get_password(s_8021x);
|
||||
NMSettingSecretFlags flags = nm_setting_802_1x_get_password_flags(s_8021x);
|
||||
|
||||
if (!password && nm_setting_802_1x_get_password_raw(s_8021x)) {
|
||||
|
@ -1347,12 +1347,12 @@ eap_phase1_identity_to_iwd_config(GKeyFile *file, const char *iwd_prefix, NMSett
|
|||
}
|
||||
|
||||
static gboolean
|
||||
eap_method_config_to_iwd_config(GKeyFile * file,
|
||||
eap_method_config_to_iwd_config(GKeyFile *file,
|
||||
NMSetting8021x *s_8021x,
|
||||
gboolean phase2,
|
||||
const char * method,
|
||||
const char * iwd_prefix,
|
||||
GError ** error)
|
||||
const char *method,
|
||||
const char *iwd_prefix,
|
||||
GError **error)
|
||||
{
|
||||
char prefix_buf[128];
|
||||
|
||||
|
@ -1677,18 +1677,18 @@ ip6_config_to_iwd_config(GKeyFile *file, NMSettingIPConfig *s_ip, GError **error
|
|||
|
||||
GKeyFile *
|
||||
nm_wifi_utils_connection_to_iwd_config(NMConnection *connection,
|
||||
char ** out_filename,
|
||||
GError ** error)
|
||||
char **out_filename,
|
||||
GError **error)
|
||||
{
|
||||
NMSettingConnection * s_conn = nm_connection_get_setting_connection(connection);
|
||||
NMSettingWireless * s_wifi = nm_connection_get_setting_wireless(connection);
|
||||
GBytes * ssid;
|
||||
const guint8 * ssid_data;
|
||||
gsize ssid_len;
|
||||
NMIwdNetworkSecurity security;
|
||||
const char * cloned_mac_addr;
|
||||
gs_free char * comment = NULL;
|
||||
nm_auto_unref_keyfile GKeyFile *file = NULL;
|
||||
NMSettingConnection *s_conn = nm_connection_get_setting_connection(connection);
|
||||
NMSettingWireless *s_wifi = nm_connection_get_setting_wireless(connection);
|
||||
GBytes *ssid;
|
||||
const guint8 *ssid_data;
|
||||
gsize ssid_len;
|
||||
NMIwdNetworkSecurity security;
|
||||
const char *cloned_mac_addr;
|
||||
gs_free char *comment = NULL;
|
||||
nm_auto_unref_keyfile GKeyFile *file = NULL;
|
||||
|
||||
if (!s_conn || !s_wifi
|
||||
|| !nm_streq(nm_setting_connection_get_connection_type(s_conn),
|
||||
|
|
|
@ -20,8 +20,8 @@ typedef enum {
|
|||
NM_IWD_NETWORK_SECURITY_8021X,
|
||||
} NMIwdNetworkSecurity;
|
||||
|
||||
gboolean nm_wifi_utils_complete_connection(GBytes * ssid,
|
||||
const char * bssid,
|
||||
gboolean nm_wifi_utils_complete_connection(GBytes *ssid,
|
||||
const char *bssid,
|
||||
_NM80211Mode mode,
|
||||
guint32 ap_freq,
|
||||
guint32 flags,
|
||||
|
@ -29,14 +29,14 @@ gboolean nm_wifi_utils_complete_connection(GBytes * ssid,
|
|||
guint32 rsn_flags,
|
||||
NMConnection *connection,
|
||||
gboolean lock_bssid,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
gboolean nm_wifi_utils_is_manf_default_ssid(GBytes *ssid);
|
||||
|
||||
gboolean nm_wifi_connection_get_iwd_ssid_and_security(NMConnection * connection,
|
||||
char ** ssid,
|
||||
gboolean nm_wifi_connection_get_iwd_ssid_and_security(NMConnection *connection,
|
||||
char **ssid,
|
||||
NMIwdNetworkSecurity *security);
|
||||
char * nm_wifi_utils_get_iwd_config_filename(const char * ssid,
|
||||
char *nm_wifi_utils_get_iwd_config_filename(const char *ssid,
|
||||
gssize ssid_len,
|
||||
NMIwdNetworkSecurity security);
|
||||
|
||||
|
|
|
@ -47,18 +47,18 @@
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(const char * ssid,
|
||||
const char * bssid,
|
||||
complete_connection(const char *ssid,
|
||||
const char *bssid,
|
||||
_NM80211Mode mode,
|
||||
guint32 flags,
|
||||
guint32 wpa_flags,
|
||||
guint32 rsn_flags,
|
||||
gboolean lock_bssid,
|
||||
NMConnection *src,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
gs_unref_bytes GBytes *ssid_b = NULL;
|
||||
NMSettingWireless * s_wifi;
|
||||
NMSettingWireless *s_wifi;
|
||||
|
||||
/* Add a wifi setting if one doesn't exist */
|
||||
s_wifi = nm_connection_get_setting_wireless(src);
|
||||
|
@ -91,8 +91,8 @@ static void
|
|||
set_items(NMSetting *setting, const KeyData *items)
|
||||
{
|
||||
const KeyData *item;
|
||||
GParamSpec * pspec;
|
||||
GBytes * tmp;
|
||||
GParamSpec *pspec;
|
||||
GBytes *tmp;
|
||||
|
||||
for (item = items; item && item->key; item++) {
|
||||
g_assert(item->key);
|
||||
|
@ -199,9 +199,9 @@ fill_8021x(NMConnection *connection, const KeyData items[])
|
|||
static NMConnection *
|
||||
create_basic(const char *ssid, const char *bssid, _NM80211Mode mode)
|
||||
{
|
||||
NMConnection * connection;
|
||||
NMConnection *connection;
|
||||
NMSettingWireless *s_wifi = NULL;
|
||||
GBytes * tmp;
|
||||
GBytes *tmp;
|
||||
|
||||
connection = nm_simple_connection_new();
|
||||
|
||||
|
@ -233,10 +233,10 @@ static void
|
|||
test_lock_bssid(void)
|
||||
{
|
||||
NMConnection *src, *expected;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char * ssid = "blahblah";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const char *ssid = "blahblah";
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
src = nm_simple_connection_new();
|
||||
success = complete_connection(ssid,
|
||||
|
@ -261,10 +261,10 @@ static void
|
|||
test_open_ap_empty_connection(void)
|
||||
{
|
||||
NMConnection *src, *expected;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char * ssid = "blahblah";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const char *ssid = "blahblah";
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that an empty source connection is correctly filled with the
|
||||
* SSID and Infra modes of the given AP details.
|
||||
|
@ -293,11 +293,11 @@ static void
|
|||
test_open_ap_leap_connection_1(gconstpointer add_wifi)
|
||||
{
|
||||
NMConnection *src;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, "Bill Smith", 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that a basic connection filled with a LEAP username is
|
||||
* rejected when completion is attempted with an open AP. LEAP requires
|
||||
|
@ -330,10 +330,10 @@ static void
|
|||
test_open_ap_leap_connection_2(void)
|
||||
{
|
||||
NMConnection *src;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0}, {NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that a basic connection specifying IEEE8021x security (ie, Dynamic
|
||||
* WEP or LEAP) is rejected when completion is attempted with an open AP.
|
||||
|
@ -364,14 +364,14 @@ static void
|
|||
test_open_ap_wep_connection(gconstpointer add_wifi)
|
||||
{
|
||||
NMConnection *src;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_wsec[] = {
|
||||
{NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, "11111111111111111111111111", 0},
|
||||
{NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, NULL, 0},
|
||||
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that a static WEP connection is rejected when completion is
|
||||
* attempted with an open AP.
|
||||
|
@ -399,8 +399,8 @@ test_open_ap_wep_connection(gconstpointer add_wifi)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
test_ap_wpa_psk_connection_base(const char * key_mgmt,
|
||||
const char * auth_alg,
|
||||
test_ap_wpa_psk_connection_base(const char *key_mgmt,
|
||||
const char *auth_alg,
|
||||
guint32 flags,
|
||||
guint32 wpa_flags,
|
||||
guint32 rsn_flags,
|
||||
|
@ -409,8 +409,8 @@ test_ap_wpa_psk_connection_base(const char * key_mgmt,
|
|||
NMConnection *expected)
|
||||
{
|
||||
NMConnection *src;
|
||||
const char * ssid = "blahblah";
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *ssid = "blahblah";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData exp_wifi[] = {{NM_SETTING_WIRELESS_SSID, ssid, 0},
|
||||
{NM_SETTING_WIRELESS_MODE, "infrastructure", 0},
|
||||
{NULL}};
|
||||
|
@ -419,7 +419,7 @@ test_ap_wpa_psk_connection_base(const char * key_mgmt,
|
|||
{NM_SETTING_WIRELESS_SECURITY_PSK, "asdfasdfasdfasdfasdfafs", 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
src = nm_simple_connection_new();
|
||||
if (add_wifi)
|
||||
|
@ -538,13 +538,13 @@ test_ap_wpa_eap_connection_base(const char *key_mgmt,
|
|||
guint error_code)
|
||||
{
|
||||
NMConnection *src;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_empty[] = {{NULL}};
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, key_mgmt, 0},
|
||||
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, auth_alg, 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
src = nm_simple_connection_new();
|
||||
if (add_wifi)
|
||||
|
@ -738,11 +738,11 @@ static void
|
|||
test_priv_ap_empty_connection(void)
|
||||
{
|
||||
NMConnection *src, *expected;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char * ssid = "blahblah";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const char *ssid = "blahblah";
|
||||
const KeyData exp_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", 0}, {NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that an empty connection is completed to a valid Static WEP
|
||||
* connection when completed with an AP with the Privacy bit set.
|
||||
|
@ -774,9 +774,9 @@ static void
|
|||
test_priv_ap_leap_connection_1(gconstpointer add_wifi)
|
||||
{
|
||||
NMConnection *src, *expected;
|
||||
const char * ssid = "blahblah";
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char * leap_username = "Bill Smith";
|
||||
const char *ssid = "blahblah";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const char *leap_username = "Bill Smith";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
|
||||
{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, leap_username, 0},
|
||||
{NULL}};
|
||||
|
@ -785,7 +785,7 @@ test_priv_ap_leap_connection_1(gconstpointer add_wifi)
|
|||
{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, leap_username, 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that an minimal LEAP connection specifying only key management and
|
||||
* the LEAP username is completed to a full LEAP connection when completed
|
||||
|
@ -823,12 +823,12 @@ static void
|
|||
test_priv_ap_leap_connection_2(void)
|
||||
{
|
||||
NMConnection *src;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
|
||||
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "leap", 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that an minimal LEAP connection specifying only key management and
|
||||
* the LEAP auth alg is completed to a full LEAP connection when completed
|
||||
|
@ -859,8 +859,8 @@ static void
|
|||
test_priv_ap_dynamic_wep_1(void)
|
||||
{
|
||||
NMConnection *src, *expected;
|
||||
const char * ssid = "blahblah";
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *ssid = "blahblah";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
|
||||
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
|
||||
{NULL}};
|
||||
|
@ -872,7 +872,7 @@ test_priv_ap_dynamic_wep_1(void)
|
|||
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that an minimal Dynamic WEP connection specifying key management,
|
||||
* the auth algorithm, and valid 802.1x setting is completed to a valid
|
||||
|
@ -909,8 +909,8 @@ static void
|
|||
test_priv_ap_dynamic_wep_2(void)
|
||||
{
|
||||
NMConnection *src, *expected;
|
||||
const char * ssid = "blahblah";
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *ssid = "blahblah";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0}, {NULL}};
|
||||
const KeyData both_8021x[] = {{NM_SETTING_802_1X_EAP, "peap", 0},
|
||||
{NM_SETTING_802_1X_IDENTITY, "Bill Smith", 0},
|
||||
|
@ -920,7 +920,7 @@ test_priv_ap_dynamic_wep_2(void)
|
|||
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that an minimal Dynamic WEP connection specifying only the auth
|
||||
* algorithm and a valid 802.1x setting is completed to a valid Dynamic
|
||||
|
@ -957,14 +957,14 @@ static void
|
|||
test_priv_ap_dynamic_wep_3(void)
|
||||
{
|
||||
NMConnection *src;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "shared", 0}, {NULL}};
|
||||
const KeyData src_8021x[] = {{NM_SETTING_802_1X_EAP, "peap", 0},
|
||||
{NM_SETTING_802_1X_IDENTITY, "Bill Smith", 0},
|
||||
{NM_SETTING_802_1X_PHASE2_AUTH, "mschapv2", 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Ensure that a basic connection specifying 'shared' auth and an 802.1x
|
||||
* setting is rejected, as 802.1x is incompatible with 'shared' auth.
|
||||
|
@ -1086,13 +1086,13 @@ test_wpa_ap_empty_connection(gconstpointer data)
|
|||
{
|
||||
guint idx = GPOINTER_TO_UINT(data);
|
||||
NMConnection *src, *expected;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char * ssid = "blahblah";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const char *ssid = "blahblah";
|
||||
const KeyData exp_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", 0},
|
||||
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that a basic WPA-PSK connection specifying just key management and
|
||||
* the auth algorithm is completed successfully when given an AP with WPA
|
||||
|
@ -1126,14 +1126,14 @@ test_wpa_ap_leap_connection_1(gconstpointer data)
|
|||
{
|
||||
guint idx = GPOINTER_TO_UINT(data);
|
||||
NMConnection *src;
|
||||
const char * ssid = "blahblah";
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char * leap_username = "Bill Smith";
|
||||
const char *ssid = "blahblah";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const char *leap_username = "Bill Smith";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
|
||||
{NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, leap_username, 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that completion of a LEAP connection with a WPA-enabled AP is
|
||||
* rejected since WPA APs (usually) do not support LEAP.
|
||||
|
@ -1164,12 +1164,12 @@ test_wpa_ap_leap_connection_2(gconstpointer data)
|
|||
{
|
||||
guint idx = GPOINTER_TO_UINT(data);
|
||||
NMConnection *src;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0},
|
||||
{NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "leap", 0},
|
||||
{NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that completion of a LEAP connection with a WPA-enabled AP is
|
||||
* rejected since WPA APs (usually) do not support LEAP.
|
||||
|
@ -1200,10 +1200,10 @@ test_wpa_ap_dynamic_wep_connection(gconstpointer data)
|
|||
{
|
||||
guint idx = GPOINTER_TO_UINT(data);
|
||||
NMConnection *src;
|
||||
const char * bssid = "01:02:03:04:05:06";
|
||||
const char *bssid = "01:02:03:04:05:06";
|
||||
const KeyData src_wsec[] = {{NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", 0}, {NULL}};
|
||||
gboolean success;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Test that completion of a Dynamic WEP connection with a WPA-enabled AP is
|
||||
* rejected since WPA APs (usually) do not support Dynamic WEP.
|
||||
|
@ -1409,12 +1409,12 @@ test_strength_all(void)
|
|||
static void
|
||||
do_test_ssids_options_to_ptrarray(const char *const *ssids)
|
||||
{
|
||||
GVariantBuilder builder;
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
GVariantBuilder builder;
|
||||
gs_unref_variant GVariant *variant = NULL;
|
||||
gs_unref_ptrarray GPtrArray *ssids_arr = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gsize len;
|
||||
gsize i;
|
||||
gs_free_error GError *error = NULL;
|
||||
gsize len;
|
||||
gsize i;
|
||||
|
||||
g_assert(ssids);
|
||||
|
||||
|
@ -1443,7 +1443,7 @@ do_test_ssids_options_to_ptrarray(const char *const *ssids)
|
|||
g_assert_cmpint(len, ==, ssids_arr->len);
|
||||
for (i = 0; i < len; i++) {
|
||||
const char *ssid = ssids[i];
|
||||
GBytes * bytes = ssids_arr->pdata[i];
|
||||
GBytes *bytes = ssids_arr->pdata[i];
|
||||
|
||||
g_assert(nm_g_bytes_equal_mem(bytes, ssid, strlen(ssid)));
|
||||
}
|
||||
|
|
|
@ -30,13 +30,13 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMDeviceModem,
|
|||
PROP_APN, );
|
||||
|
||||
typedef struct {
|
||||
NMModem * modem;
|
||||
NMModem *modem;
|
||||
NMDeviceModemCapabilities caps;
|
||||
NMDeviceModemCapabilities current_caps;
|
||||
NMUtilsIPv6IfaceId iid;
|
||||
char * device_id;
|
||||
char * operator_code;
|
||||
char * apn;
|
||||
char *device_id;
|
||||
char *operator_code;
|
||||
char *apn;
|
||||
bool rf_enabled : 1;
|
||||
NMDeviceStageState stage1_state : 3;
|
||||
NMDeviceStageState stage2_state : 3;
|
||||
|
@ -61,7 +61,7 @@ G_DEFINE_TYPE(NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE)
|
|||
static void
|
||||
ppp_failed(NMModem *modem, guint i_reason, gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceStateReason reason = i_reason;
|
||||
|
||||
nm_device_state_changed(device, NM_DEVICE_STATE_FAILED, reason);
|
||||
|
@ -70,9 +70,9 @@ ppp_failed(NMModem *modem, guint i_reason, gpointer user_data)
|
|||
static void
|
||||
modem_prepare_result(NMModem *modem, gboolean success, guint i_reason, gpointer user_data)
|
||||
{
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(user_data);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(user_data);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
NMDeviceStateReason reason = i_reason;
|
||||
|
||||
if (nm_device_get_state(device) != NM_DEVICE_STATE_PREPARE
|
||||
|
@ -141,7 +141,7 @@ modem_auth_requested(NMModem *modem, gpointer user_data)
|
|||
static void
|
||||
modem_auth_result(NMModem *modem, GError *error, gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(device);
|
||||
|
||||
g_return_if_fail(nm_device_get_state(device) == NM_DEVICE_STATE_NEED_AUTH);
|
||||
|
@ -156,19 +156,19 @@ modem_auth_result(NMModem *modem, GError *error, gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
modem_new_config(NMModem * modem,
|
||||
modem_new_config(NMModem *modem,
|
||||
int addr_family,
|
||||
const NML3ConfigData * l3cd,
|
||||
const NML3ConfigData *l3cd,
|
||||
gboolean do_auto,
|
||||
const NMUtilsIPv6IfaceId *iid,
|
||||
int failure_reason_i,
|
||||
GError * error,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(user_data);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(user_data);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
NMDevice * device = NM_DEVICE(self);
|
||||
NMDevice *device = NM_DEVICE(self);
|
||||
|
||||
g_return_if_fail(nm_device_devip_get_state(device, addr_family) == NM_DEVICE_IP_STATE_PENDING);
|
||||
|
||||
|
@ -194,8 +194,8 @@ modem_new_config(NMModem * modem,
|
|||
static void
|
||||
ip_ifindex_changed_cb(NMModem *modem, GParamSpec *pspec, gpointer user_data)
|
||||
{
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(device);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
|
||||
if (!nm_device_is_activating(device))
|
||||
|
@ -223,9 +223,9 @@ ip_ifindex_changed_cb(NMModem *modem, GParamSpec *pspec, gpointer user_data)
|
|||
static void
|
||||
operator_code_changed_cb(NMModem *modem, GParamSpec *pspec, gpointer user_data)
|
||||
{
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(user_data);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(user_data);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
const char * operator_code = nm_modem_get_operator_code(modem);
|
||||
const char *operator_code = nm_modem_get_operator_code(modem);
|
||||
|
||||
if (g_strcmp0(priv->operator_code, operator_code) != 0) {
|
||||
g_free(priv->operator_code);
|
||||
|
@ -237,9 +237,9 @@ operator_code_changed_cb(NMModem *modem, GParamSpec *pspec, gpointer user_data)
|
|||
static void
|
||||
apn_changed_cb(NMModem *modem, GParamSpec *pspec, gpointer user_data)
|
||||
{
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(user_data);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(user_data);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
const char * apn = nm_modem_get_apn(modem);
|
||||
const char *apn = nm_modem_get_apn(modem);
|
||||
|
||||
if (g_strcmp0(priv->apn, apn) != 0) {
|
||||
g_free(priv->apn);
|
||||
|
@ -259,7 +259,7 @@ modem_state_cb(NMModem *modem, int new_state_i, int old_state_i, gpointer user_d
|
|||
{
|
||||
NMModemState new_state = new_state_i;
|
||||
NMModemState old_state = old_state_i;
|
||||
NMDevice * device = NM_DEVICE(user_data);
|
||||
NMDevice *device = NM_DEVICE(user_data);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(device);
|
||||
NMDeviceState dev_state = nm_device_get_state(device);
|
||||
|
||||
|
@ -331,12 +331,12 @@ owns_iface(NMDevice *device, const char *iface)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
device_state_changed(NMDevice * device,
|
||||
device_state_changed(NMDevice *device,
|
||||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason)
|
||||
{
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
|
||||
g_return_if_fail(priv->modem);
|
||||
|
@ -398,13 +398,13 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
|
||||
static gboolean
|
||||
check_connection_available(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
check_connection_available(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
NMDeviceCheckConAvailableFlags flags,
|
||||
const char * specific_object,
|
||||
GError ** error)
|
||||
const char *specific_object,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
NMModemState state;
|
||||
|
||||
|
@ -443,11 +443,11 @@ check_connection_available(NMDevice * device,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMDevice * device,
|
||||
NMConnection * connection,
|
||||
const char * specific_object,
|
||||
complete_connection(NMDevice *device,
|
||||
NMConnection *connection,
|
||||
const char *specific_object,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(device);
|
||||
|
||||
|
@ -473,7 +473,7 @@ deactivate(NMDevice *device)
|
|||
static void
|
||||
modem_deactivate_async_cb(NMModem *modem, GError *error, gpointer user_data)
|
||||
{
|
||||
gs_unref_object NMDevice * self = NULL;
|
||||
gs_unref_object NMDevice *self = NULL;
|
||||
NMDeviceDeactivateCallback callback;
|
||||
gpointer callback_user_data;
|
||||
|
||||
|
@ -482,8 +482,8 @@ modem_deactivate_async_cb(NMModem *modem, GError *error, gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
deactivate_async(NMDevice * self,
|
||||
GCancellable * cancellable,
|
||||
deactivate_async(NMDevice *self,
|
||||
GCancellable *cancellable,
|
||||
NMDeviceDeactivateCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@ -503,7 +503,7 @@ static NMActStageReturn
|
|||
act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(device);
|
||||
NMActRequest * req;
|
||||
NMActRequest *req;
|
||||
|
||||
req = nm_device_get_act_request(device);
|
||||
g_return_val_if_fail(req, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
@ -552,7 +552,7 @@ act_stage3_ip_config(NMDevice *device, int addr_family)
|
|||
static gboolean
|
||||
get_ip_iface_identifier(NMDevice *device, NMUtilsIPv6IfaceId *out_iid)
|
||||
{
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
|
||||
g_return_val_if_fail(priv->modem, FALSE);
|
||||
|
@ -579,7 +579,7 @@ get_enabled(NMDevice *device)
|
|||
static void
|
||||
set_enabled(NMDevice *device, gboolean enabled)
|
||||
{
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
|
||||
/* Called only by the Manager in response to rfkill switch changes or
|
||||
|
@ -600,7 +600,7 @@ set_enabled(NMDevice *device, gboolean enabled)
|
|||
static gboolean
|
||||
is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
||||
{
|
||||
NMDeviceModem * self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM(device);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE(self);
|
||||
NMModemState modem_state;
|
||||
|
||||
|
@ -806,9 +806,9 @@ static const NMDBusInterfaceInfoExtended interface_info_device_modem = {
|
|||
static void
|
||||
nm_device_modem_class_init(NMDeviceModemClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS(klass);
|
||||
NMDeviceClass * device_class = NM_DEVICE_CLASS(klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS(klass);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
object_class->get_property = get_property;
|
||||
|
|
|
@ -61,13 +61,13 @@ typedef struct {
|
|||
ConnectStep step;
|
||||
|
||||
MMModemCapability caps;
|
||||
NMConnection * connection;
|
||||
GCancellable * cancellable;
|
||||
NMConnection *connection;
|
||||
GCancellable *cancellable;
|
||||
MMSimpleConnectProperties *connect_properties;
|
||||
GArray * ip_types;
|
||||
GArray *ip_types;
|
||||
guint ip_types_i;
|
||||
guint ip_type_tries;
|
||||
GError * first_error;
|
||||
GError *first_error;
|
||||
} ConnectContext;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -78,15 +78,15 @@ typedef struct {
|
|||
/* The modem object from dbus */
|
||||
MMObject *modem_object;
|
||||
/* Per-interface objects */
|
||||
MMModem * modem_iface;
|
||||
MMModem3gpp * modem_3gpp_iface;
|
||||
MMModem *modem_iface;
|
||||
MMModem3gpp *modem_3gpp_iface;
|
||||
MMModemSimple *simple_iface;
|
||||
MMSim * sim_iface;
|
||||
MMSim *sim_iface;
|
||||
|
||||
/* Connection setup */
|
||||
ConnectContext *ctx;
|
||||
|
||||
MMBearer * bearer;
|
||||
MMBearer *bearer;
|
||||
MMBearerIpConfig *ipv4_config;
|
||||
MMBearerIpConfig *ipv6_config;
|
||||
|
||||
|
@ -119,7 +119,7 @@ G_DEFINE_TYPE(NMModemBroadband, nm_modem_broadband, NM_TYPE_MODEM)
|
|||
if (nm_logging_enabled(_level, (_NMLOG_DOMAIN))) { \
|
||||
NMModemBroadband *const __self = (self); \
|
||||
char __prefix_name[128]; \
|
||||
const char * __uid; \
|
||||
const char *__uid; \
|
||||
\
|
||||
_nm_log(_level, \
|
||||
(_NMLOG_DOMAIN), \
|
||||
|
@ -195,11 +195,11 @@ translate_mm_error(NMModemBroadband *self, GError *error)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
get_capabilities(NMModem * _self,
|
||||
get_capabilities(NMModem *_self,
|
||||
NMDeviceModemCapabilities *modem_caps,
|
||||
NMDeviceModemCapabilities *current_caps)
|
||||
{
|
||||
NMModemBroadband * self = NM_MODEM_BROADBAND(_self);
|
||||
NMModemBroadband *self = NM_MODEM_BROADBAND(_self);
|
||||
MMModemCapability all_supported = MM_MODEM_CAPABILITY_NONE;
|
||||
MMModemCapability *supported;
|
||||
guint n_supported;
|
||||
|
@ -223,7 +223,7 @@ get_capabilities(NMModem * _self,
|
|||
static gboolean
|
||||
owns_port(NMModem *_self, const char *iface)
|
||||
{
|
||||
NMModemBroadband * self = NM_MODEM_BROADBAND(_self);
|
||||
NMModemBroadband *self = NM_MODEM_BROADBAND(_self);
|
||||
const MMModemPortInfo *ports = NULL;
|
||||
guint n_ports = 0, i;
|
||||
|
||||
|
@ -274,7 +274,7 @@ create_cdma_connect_properties(NMConnection *connection)
|
|||
#if !MM_CHECK_VERSION(1, 9, 1)
|
||||
{
|
||||
NMSettingCdma *setting;
|
||||
const char * str;
|
||||
const char *str;
|
||||
|
||||
setting = nm_connection_get_setting_cdma(connection);
|
||||
str = nm_setting_cdma_get_number(setting);
|
||||
|
@ -288,14 +288,14 @@ create_cdma_connect_properties(NMConnection *connection)
|
|||
|
||||
static MMSimpleConnectProperties *
|
||||
create_gsm_connect_properties(NMConnection *connection,
|
||||
const char * apn,
|
||||
const char * username,
|
||||
const char * password)
|
||||
const char *apn,
|
||||
const char *username,
|
||||
const char *password)
|
||||
{
|
||||
NMSettingGsm * setting;
|
||||
NMSettingPpp * s_ppp;
|
||||
NMSettingGsm *setting;
|
||||
NMSettingPpp *s_ppp;
|
||||
MMSimpleConnectProperties *properties;
|
||||
const char * str;
|
||||
const char *str;
|
||||
|
||||
setting = nm_connection_get_setting_gsm(connection);
|
||||
|
||||
|
@ -365,11 +365,11 @@ static void connect_context_step(NMModemBroadband *self);
|
|||
static void
|
||||
connect_ready(MMModemSimple *simple_iface, GAsyncResult *res, NMModemBroadband *self)
|
||||
{
|
||||
ConnectContext *ctx;
|
||||
GError * error = NULL;
|
||||
NMModemIPMethod ip4_method = NM_MODEM_IP_METHOD_UNKNOWN;
|
||||
NMModemIPMethod ip6_method = NM_MODEM_IP_METHOD_UNKNOWN;
|
||||
gs_unref_object MMBearer *bearer = NULL;
|
||||
ConnectContext *ctx;
|
||||
GError *error = NULL;
|
||||
NMModemIPMethod ip4_method = NM_MODEM_IP_METHOD_UNKNOWN;
|
||||
NMModemIPMethod ip6_method = NM_MODEM_IP_METHOD_UNKNOWN;
|
||||
gs_unref_object MMBearer *bearer = NULL;
|
||||
|
||||
bearer = mm_modem_simple_connect_finish(simple_iface, res, &error);
|
||||
|
||||
|
@ -476,18 +476,18 @@ send_pin_ready(MMSim *sim, GAsyncResult *result, NMModemBroadband *self)
|
|||
}
|
||||
|
||||
static void
|
||||
find_gsm_apn_cb(const char * apn,
|
||||
const char * username,
|
||||
const char * password,
|
||||
const char * gateway,
|
||||
const char * auth_method,
|
||||
find_gsm_apn_cb(const char *apn,
|
||||
const char *username,
|
||||
const char *password,
|
||||
const char *gateway,
|
||||
const char *auth_method,
|
||||
const GSList *dns,
|
||||
GError * error,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMModemBroadband * self = user_data;
|
||||
NMModemBroadband *self = user_data;
|
||||
NMModemBroadbandPrivate *priv = NM_MODEM_BROADBAND_GET_PRIVATE(self);
|
||||
ConnectContext * ctx = priv->ctx;
|
||||
ConnectContext *ctx = priv->ctx;
|
||||
|
||||
if (error) {
|
||||
_LOGW("failed to connect '%s': APN not found: %s",
|
||||
|
@ -510,14 +510,14 @@ static gboolean
|
|||
try_create_connect_properties(NMModemBroadband *self)
|
||||
{
|
||||
NMModemBroadbandPrivate *priv = NM_MODEM_BROADBAND_GET_PRIVATE(self);
|
||||
ConnectContext * ctx = priv->ctx;
|
||||
ConnectContext *ctx = priv->ctx;
|
||||
|
||||
if (MODEM_CAPS_3GPP(ctx->caps)) {
|
||||
NMSettingGsm *s_gsm = nm_connection_get_setting_gsm(ctx->connection);
|
||||
|
||||
if (!s_gsm || nm_setting_gsm_get_auto_config(s_gsm)) {
|
||||
gs_unref_object MMModem3gpp *modem_3gpp = NULL;
|
||||
const char * network_id = NULL;
|
||||
const char *network_id = NULL;
|
||||
|
||||
s_gsm = nm_connection_get_setting_gsm(ctx->connection);
|
||||
if (s_gsm)
|
||||
|
@ -586,7 +586,7 @@ connect_context_step(NMModemBroadband *self)
|
|||
if (MODEM_CAPS_3GPP(ctx->caps)
|
||||
&& mm_modem_get_unlock_required(self->_priv.modem_iface) == MM_MODEM_LOCK_SIM_PIN) {
|
||||
NMSettingGsm *s_gsm = nm_connection_get_setting_gsm(ctx->connection);
|
||||
const char * pin = nm_setting_gsm_get_pin(s_gsm);
|
||||
const char *pin = nm_setting_gsm_get_pin(s_gsm);
|
||||
|
||||
/* If we have a PIN already, send it. If we don't, get it. */
|
||||
if (pin) {
|
||||
|
@ -694,8 +694,8 @@ connect_context_step(NMModemBroadband *self)
|
|||
}
|
||||
|
||||
static NMActStageReturn
|
||||
modem_act_stage1_prepare(NMModem * _self,
|
||||
NMConnection * connection,
|
||||
modem_act_stage1_prepare(NMModem *_self,
|
||||
NMConnection *connection,
|
||||
NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMModemBroadband *self = NM_MODEM_BROADBAND(_self);
|
||||
|
@ -768,15 +768,15 @@ check_connection_compatible_with_modem(NMModem *_self, NMConnection *connection,
|
|||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
complete_connection(NMModem * modem,
|
||||
const char * iface,
|
||||
NMConnection * connection,
|
||||
complete_connection(NMModem *modem,
|
||||
const char *iface,
|
||||
NMConnection *connection,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMModemBroadband *self = NM_MODEM_BROADBAND(modem);
|
||||
MMModemCapability modem_caps;
|
||||
NMSettingPpp * s_ppp;
|
||||
NMSettingPpp *s_ppp;
|
||||
|
||||
modem_caps = mm_modem_get_current_capabilities(self->_priv.modem_iface);
|
||||
|
||||
|
@ -856,7 +856,7 @@ complete_connection(NMModem * modem,
|
|||
static gboolean
|
||||
get_user_pass(NMModem *modem, NMConnection *connection, const char **user, const char **pass)
|
||||
{
|
||||
NMSettingGsm * s_gsm;
|
||||
NMSettingGsm *s_gsm;
|
||||
NMSettingCdma *s_cdma;
|
||||
|
||||
s_gsm = nm_connection_get_setting_gsm(connection);
|
||||
|
@ -958,19 +958,19 @@ set_mm_enabled(NMModem *_self, gboolean enabled)
|
|||
static void
|
||||
stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_method)
|
||||
{
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
NMModemBroadband * self = NM_MODEM_BROADBAND(modem);
|
||||
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
NMModemBroadband *self = NM_MODEM_BROADBAND(modem);
|
||||
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
|
||||
char sbuf[sizeof(_nm_utils_to_string_buffer)];
|
||||
gs_free_error GError * error = NULL;
|
||||
const char * data_port;
|
||||
const char * address_string;
|
||||
const char ** dns;
|
||||
guint i;
|
||||
gboolean do_auto = FALSE;
|
||||
int ifindex;
|
||||
NMUtilsIPv6IfaceId iid_data;
|
||||
const NMUtilsIPv6IfaceId *iid = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
const char *data_port;
|
||||
const char *address_string;
|
||||
const char **dns;
|
||||
guint i;
|
||||
gboolean do_auto = FALSE;
|
||||
int ifindex;
|
||||
NMUtilsIPv6IfaceId iid_data;
|
||||
const NMUtilsIPv6IfaceId *iid = NULL;
|
||||
|
||||
if (IS_IPv4) {
|
||||
g_return_if_fail(self->_priv.ipv4_config);
|
||||
|
@ -990,7 +990,7 @@ stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_metho
|
|||
NMPlatformIP4Address address;
|
||||
NMPlatformIP4Route route;
|
||||
guint32 mtu_n;
|
||||
const char * gw_string;
|
||||
const char *gw_string;
|
||||
|
||||
_LOGI("IPv4 static configuration:");
|
||||
|
||||
|
@ -1201,10 +1201,10 @@ out:
|
|||
/* Disconnect */
|
||||
|
||||
typedef struct {
|
||||
NMModemBroadband * self;
|
||||
NMModemBroadband *self;
|
||||
_NMModemDisconnectCallback callback;
|
||||
gpointer callback_user_data;
|
||||
GCancellable * cancellable;
|
||||
GCancellable *cancellable;
|
||||
gboolean warn;
|
||||
} DisconnectContext;
|
||||
|
||||
|
@ -1221,7 +1221,7 @@ disconnect_context_complete(DisconnectContext *ctx, GError *error)
|
|||
static void
|
||||
disconnect_context_complete_on_idle(gpointer user_data, GCancellable *cancellable)
|
||||
{
|
||||
DisconnectContext *ctx = user_data;
|
||||
DisconnectContext *ctx = user_data;
|
||||
gs_free_error GError *cancelled_error = NULL;
|
||||
|
||||
g_cancellable_set_error_if_cancelled(cancellable, &cancelled_error);
|
||||
|
@ -1231,9 +1231,9 @@ disconnect_context_complete_on_idle(gpointer user_data, GCancellable *cancellabl
|
|||
static void
|
||||
simple_disconnect_ready(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
MMModemSimple * modem_iface = MM_MODEM_SIMPLE(source_object);
|
||||
DisconnectContext *ctx = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
MMModemSimple *modem_iface = MM_MODEM_SIMPLE(source_object);
|
||||
DisconnectContext *ctx = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
if (!mm_modem_simple_disconnect_finish(modem_iface, res, &error)) {
|
||||
if (ctx->warn && !g_error_matches(error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN)) {
|
||||
|
@ -1247,13 +1247,13 @@ simple_disconnect_ready(GObject *source_object, GAsyncResult *res, gpointer user
|
|||
}
|
||||
|
||||
static void
|
||||
disconnect(NMModem * modem,
|
||||
disconnect(NMModem *modem,
|
||||
gboolean warn,
|
||||
GCancellable * cancellable,
|
||||
GCancellable *cancellable,
|
||||
_NMModemDisconnectCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMModemBroadband * self = NM_MODEM_BROADBAND(modem);
|
||||
NMModemBroadband *self = NM_MODEM_BROADBAND(modem);
|
||||
DisconnectContext *ctx;
|
||||
|
||||
connect_context_clear(self);
|
||||
|
@ -1330,11 +1330,11 @@ mm_state_to_nm(MMModemState mm_state)
|
|||
}
|
||||
|
||||
static void
|
||||
modem_state_changed(MMModem * modem,
|
||||
modem_state_changed(MMModem *modem,
|
||||
MMModemState old_state,
|
||||
MMModemState new_state,
|
||||
MMModemStateChangeReason reason,
|
||||
NMModemBroadband * self)
|
||||
NMModemBroadband *self)
|
||||
{
|
||||
/* After the SIM is unlocked MM1 will move the device to INITIALIZING which
|
||||
* is an unavailable state. That makes state handling confusing here, so
|
||||
|
@ -1372,7 +1372,7 @@ static void
|
|||
get_sim_ready(MMModem *modem, GAsyncResult *res, NMModemBroadband *self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
MMSim * new_sim;
|
||||
MMSim *new_sim;
|
||||
|
||||
new_sim = mm_modem_get_sim_finish(modem, res, &error);
|
||||
if (new_sim != self->_priv.sim_iface) {
|
||||
|
@ -1506,12 +1506,12 @@ nm_modem_broadband_init(NMModemBroadband *self)
|
|||
NMModem *
|
||||
nm_modem_broadband_new(GObject *object, GError **error)
|
||||
{
|
||||
MMObject * modem_object;
|
||||
MMModem * modem_iface;
|
||||
MMModem3gpp * modem_3gpp_iface;
|
||||
MMObject *modem_object;
|
||||
MMModem *modem_iface;
|
||||
MMModem3gpp *modem_3gpp_iface;
|
||||
const char *const *drivers;
|
||||
const char * operator_code = NULL;
|
||||
gs_free char * driver = NULL;
|
||||
const char *operator_code = NULL;
|
||||
gs_free char *driver = NULL;
|
||||
|
||||
g_return_val_if_fail(MM_IS_OBJECT(object), NULL);
|
||||
modem_object = MM_OBJECT(object);
|
||||
|
@ -1555,7 +1555,7 @@ nm_modem_broadband_new(GObject *object, GError **error)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMModemBroadband * self = NM_MODEM_BROADBAND(object);
|
||||
NMModemBroadband *self = NM_MODEM_BROADBAND(object);
|
||||
NMModemBroadbandPrivate *priv = NM_MODEM_BROADBAND_GET_PRIVATE(self);
|
||||
|
||||
connect_context_clear(self);
|
||||
|
|
|
@ -45,7 +45,7 @@ typedef struct {
|
|||
GCancellable *main_cancellable;
|
||||
|
||||
struct {
|
||||
MMManager * manager;
|
||||
MMManager *manager;
|
||||
GCancellable *poke_cancellable;
|
||||
gulong handle_name_owner_changed_id;
|
||||
gulong handle_object_added_id;
|
||||
|
@ -61,15 +61,15 @@ typedef struct {
|
|||
LOG_AVAILABLE_NO,
|
||||
} log_available : 3;
|
||||
|
||||
GDBusProxy * proxy;
|
||||
GDBusProxy *proxy;
|
||||
GCancellable *proxy_cancellable;
|
||||
guint proxy_ref_count;
|
||||
char * proxy_name_owner;
|
||||
char *proxy_name_owner;
|
||||
} modm;
|
||||
|
||||
#if WITH_OFONO
|
||||
struct {
|
||||
GDBusProxy * proxy;
|
||||
GDBusProxy *proxy;
|
||||
GCancellable *cancellable;
|
||||
} ofono;
|
||||
#endif
|
||||
|
@ -111,7 +111,7 @@ static void
|
|||
handle_new_modem(NMModemManager *self, NMModem *modem)
|
||||
{
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
const char * path;
|
||||
const char *path;
|
||||
|
||||
path = nm_modem_get_path(modem);
|
||||
if (g_hash_table_lookup(priv->modems, path)) {
|
||||
|
@ -163,10 +163,10 @@ static void
|
|||
modm_handle_object_added(MMManager *modem_manager, MMObject *modem_object, NMModemManager *self)
|
||||
{
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
const char * path;
|
||||
MMModem * modem_iface;
|
||||
NMModem * modem;
|
||||
GError * error = NULL;
|
||||
const char *path;
|
||||
MMModem *modem_iface;
|
||||
NMModem *modem;
|
||||
GError *error = NULL;
|
||||
|
||||
/* Ensure we don't have the same modem already */
|
||||
path = mm_object_get_path(modem_object);
|
||||
|
@ -201,8 +201,8 @@ static void
|
|||
modm_handle_object_removed(MMManager *manager, MMObject *modem_object, NMModemManager *self)
|
||||
{
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
NMModem * modem;
|
||||
const char * path;
|
||||
NMModem *modem;
|
||||
const char *path;
|
||||
|
||||
path = mm_object_get_path(modem_object);
|
||||
modem = (NMModem *) g_hash_table_lookup(priv->modems, path);
|
||||
|
@ -217,7 +217,7 @@ static void
|
|||
modm_manager_available(NMModemManager *self)
|
||||
{
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
GList * modems, *l;
|
||||
GList *modems, *l;
|
||||
|
||||
if (priv->modm.log_available != LOG_AVAILABLE_YES) {
|
||||
_LOGI("ModemManager %savailable", priv->modm.log_available ? "now " : "");
|
||||
|
@ -235,7 +235,7 @@ static void
|
|||
modm_handle_name_owner_changed(MMManager *modem_manager, GParamSpec *pspec, NMModemManager *self)
|
||||
{
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
char * name_owner;
|
||||
char *name_owner;
|
||||
|
||||
/* Quit poking, if any */
|
||||
nm_clear_g_source(&priv->modm.relaunch_id);
|
||||
|
@ -273,9 +273,9 @@ modm_handle_name_owner_changed(MMManager *modem_manager, GParamSpec *pspec, NMMo
|
|||
static void
|
||||
modm_manager_poke_cb(GObject *connection, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMModemManager * self;
|
||||
NMModemManagerPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMModemManager *self;
|
||||
NMModemManagerPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *result = NULL;
|
||||
|
||||
result = g_dbus_connection_call_finish(G_DBUS_CONNECTION(connection), res, &error);
|
||||
|
@ -327,7 +327,7 @@ static void
|
|||
modm_manager_check_name_owner(NMModemManager *self)
|
||||
{
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
gs_free char * name_owner = NULL;
|
||||
gs_free char *name_owner = NULL;
|
||||
|
||||
name_owner = g_dbus_object_manager_client_get_name_owner(
|
||||
G_DBUS_OBJECT_MANAGER_CLIENT(priv->modm.manager));
|
||||
|
@ -344,10 +344,10 @@ modm_manager_check_name_owner(NMModemManager *self)
|
|||
static void
|
||||
modm_manager_new_cb(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMModemManager * self;
|
||||
NMModemManager *self;
|
||||
NMModemManagerPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
MMManager * modem_manager;
|
||||
gs_free_error GError *error = NULL;
|
||||
MMManager *modem_manager;
|
||||
|
||||
modem_manager = mm_manager_new_finish(res, &error);
|
||||
if (!modem_manager && g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -445,7 +445,7 @@ static void
|
|||
modm_proxy_name_owner_reset(NMModemManager *self)
|
||||
{
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
char * name = NULL;
|
||||
char *name = NULL;
|
||||
|
||||
if (priv->modm.proxy)
|
||||
name = g_dbus_proxy_get_name_owner(priv->modm.proxy);
|
||||
|
@ -469,10 +469,10 @@ modm_proxy_name_owner_changed_cb(GObject *object, GParamSpec *pspec, gpointer us
|
|||
static void
|
||||
modm_proxy_new_cb(GObject *source_object, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemManager * self;
|
||||
NMModemManager *self;
|
||||
NMModemManagerPrivate *priv;
|
||||
GDBusProxy * proxy;
|
||||
gs_free_error GError *error = NULL;
|
||||
GDBusProxy *proxy;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
proxy = g_dbus_proxy_new_for_bus_finish(result, &error);
|
||||
if (!proxy && g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -567,7 +567,7 @@ static void
|
|||
ofono_create_modem(NMModemManager *self, const char *path)
|
||||
{
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
NMModem * modem = NULL;
|
||||
NMModem *modem = NULL;
|
||||
|
||||
/* Ensure duplicate modems aren't created. Because we're not using the
|
||||
* ObjectManager interface there's a race during oFono startup where we
|
||||
|
@ -585,15 +585,15 @@ ofono_create_modem(NMModemManager *self, const char *path)
|
|||
|
||||
static void
|
||||
ofono_signal_cb(GDBusProxy *proxy,
|
||||
char * sender_name,
|
||||
char * signal_name,
|
||||
GVariant * parameters,
|
||||
char *sender_name,
|
||||
char *signal_name,
|
||||
GVariant *parameters,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMModemManager * self = NM_MODEM_MANAGER(user_data);
|
||||
NMModemManager *self = NM_MODEM_MANAGER(user_data);
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
char * object_path;
|
||||
NMModem * modem;
|
||||
char *object_path;
|
||||
NMModem *modem;
|
||||
|
||||
if (g_strcmp0(signal_name, "ModemAdded") == 0) {
|
||||
g_variant_get(parameters, "(oa{sv})", &object_path, NULL);
|
||||
|
@ -619,12 +619,12 @@ ofono_signal_cb(GDBusProxy *proxy,
|
|||
static void
|
||||
ofono_enumerate_devices_done(GObject *proxy, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMModemManager * self;
|
||||
NMModemManager *self;
|
||||
NMModemManagerPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
GVariant * results;
|
||||
GVariantIter * iter;
|
||||
const char * path;
|
||||
gs_free_error GError *error = NULL;
|
||||
GVariant *results;
|
||||
GVariantIter *iter;
|
||||
const char *path;
|
||||
|
||||
results = g_dbus_proxy_call_finish(G_DBUS_PROXY(proxy), res, &error);
|
||||
if (!results && g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -651,7 +651,7 @@ static void
|
|||
ofono_check_name_owner(NMModemManager *self, gboolean first_invocation)
|
||||
{
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
gs_free char * name_owner = NULL;
|
||||
gs_free char *name_owner = NULL;
|
||||
|
||||
name_owner = g_dbus_proxy_get_name_owner(G_DBUS_PROXY(priv->ofono.proxy));
|
||||
if (name_owner) {
|
||||
|
@ -670,7 +670,7 @@ ofono_check_name_owner(NMModemManager *self, gboolean first_invocation)
|
|||
self);
|
||||
} else {
|
||||
GHashTableIter iter;
|
||||
NMModem * modem;
|
||||
NMModem *modem;
|
||||
|
||||
_LOGI("oFono is %savailable", first_invocation ? "not " : "no longer ");
|
||||
|
||||
|
@ -694,10 +694,10 @@ ofono_name_owner_changed(GDBusProxy *ofono_proxy, GParamSpec *pspec, NMModemMana
|
|||
static void
|
||||
ofono_proxy_new_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMModemManager * self;
|
||||
NMModemManager *self;
|
||||
NMModemManagerPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
GDBusProxy * proxy;
|
||||
gs_free_error GError *error = NULL;
|
||||
GDBusProxy *proxy;
|
||||
|
||||
proxy = g_dbus_proxy_new_finish(res, &error);
|
||||
if (!proxy && g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -752,10 +752,10 @@ ofono_init_proxy(NMModemManager *self)
|
|||
static void
|
||||
bus_get_ready(GObject *source, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
NMModemManager * self;
|
||||
NMModemManager *self;
|
||||
NMModemManagerPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
GDBusConnection * connection;
|
||||
gs_free_error GError *error = NULL;
|
||||
GDBusConnection *connection;
|
||||
|
||||
connection = g_bus_get_finish(res, &error);
|
||||
if (!connection && g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -782,7 +782,7 @@ bus_get_ready(GObject *source, GAsyncResult *res, gpointer user_data)
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMModemManager * self = NM_MODEM_MANAGER(object);
|
||||
NMModemManager *self = NM_MODEM_MANAGER(object);
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -812,7 +812,7 @@ nm_modem_manager_init(NMModemManager *self)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMModemManager * self = NM_MODEM_MANAGER(object);
|
||||
NMModemManager *self = NM_MODEM_MANAGER(object);
|
||||
NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_cancellable(&priv->main_cancellable);
|
||||
|
|
|
@ -75,7 +75,7 @@ G_DEFINE_TYPE(NMModemOfono, nm_modem_ofono, NM_TYPE_MODEM)
|
|||
if (nm_logging_enabled(_level, (_NMLOG_DOMAIN))) { \
|
||||
NMModemOfono *const __self = (self); \
|
||||
char __prefix_name[128]; \
|
||||
const char * __uid; \
|
||||
const char *__uid; \
|
||||
\
|
||||
_nm_log(_level, \
|
||||
(_NMLOG_DOMAIN), \
|
||||
|
@ -97,7 +97,7 @@ G_DEFINE_TYPE(NMModemOfono, nm_modem_ofono, NM_TYPE_MODEM)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
get_capabilities(NMModem * _self,
|
||||
get_capabilities(NMModem *_self,
|
||||
NMDeviceModemCapabilities *modem_caps,
|
||||
NMDeviceModemCapabilities *current_caps)
|
||||
{
|
||||
|
@ -112,7 +112,7 @@ update_modem_state(NMModemOfono *self)
|
|||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
NMModemState state = nm_modem_get_state(NM_MODEM(self));
|
||||
NMModemState new_state = NM_MODEM_STATE_DISABLED;
|
||||
const char * reason = NULL;
|
||||
const char *reason = NULL;
|
||||
|
||||
_LOGI("'Attached': %s 'Online': %s 'IMSI': %s",
|
||||
priv->gprs_attached ? "true" : "false",
|
||||
|
@ -137,10 +137,10 @@ update_modem_state(NMModemOfono *self)
|
|||
|
||||
/* Disconnect */
|
||||
typedef struct {
|
||||
NMModemOfono * self;
|
||||
NMModemOfono *self;
|
||||
_NMModemDisconnectCallback callback;
|
||||
gpointer callback_user_data;
|
||||
GCancellable * cancellable;
|
||||
GCancellable *cancellable;
|
||||
gboolean warn;
|
||||
} DisconnectContext;
|
||||
|
||||
|
@ -157,7 +157,7 @@ disconnect_context_complete(DisconnectContext *ctx, GError *error)
|
|||
static void
|
||||
disconnect_context_complete_on_idle(gpointer user_data, GCancellable *cancellable)
|
||||
{
|
||||
DisconnectContext *ctx = user_data;
|
||||
DisconnectContext *ctx = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
if (!g_cancellable_set_error_if_cancelled(cancellable, &error)) {
|
||||
|
@ -172,10 +172,10 @@ disconnect_context_complete_on_idle(gpointer user_data, GCancellable *cancellabl
|
|||
static void
|
||||
disconnect_done(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
DisconnectContext *ctx = user_data;
|
||||
NMModemOfono * self = ctx->self;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *v = NULL;
|
||||
DisconnectContext *ctx = user_data;
|
||||
NMModemOfono *self = ctx->self;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *v = NULL;
|
||||
|
||||
v = g_dbus_proxy_call_finish(G_DBUS_PROXY(source), result, &error);
|
||||
if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
||||
|
@ -193,15 +193,15 @@ disconnect_done(GObject *source, GAsyncResult *result, gpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
disconnect(NMModem * modem,
|
||||
disconnect(NMModem *modem,
|
||||
gboolean warn,
|
||||
GCancellable * cancellable,
|
||||
GCancellable *cancellable,
|
||||
_NMModemDisconnectCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
DisconnectContext * ctx;
|
||||
DisconnectContext *ctx;
|
||||
NMModemState state = nm_modem_get_state(NM_MODEM(self));
|
||||
|
||||
_LOGD("warn: %s modem_state: %s", warn ? "TRUE" : "FALSE", nm_modem_state_to_string(state));
|
||||
|
@ -235,7 +235,7 @@ disconnect(NMModem * modem,
|
|||
static void
|
||||
deactivate_cleanup(NMModem *modem, NMDevice *device, gboolean stop_ppp_manager)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
|
||||
/* TODO: cancel SimpleConnect() if any */
|
||||
|
@ -249,9 +249,9 @@ deactivate_cleanup(NMModem *modem, NMDevice *device, gboolean stop_ppp_manager)
|
|||
static gboolean
|
||||
check_connection_compatible_with_modem(NMModem *modem, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
const char * id;
|
||||
const char *id;
|
||||
|
||||
if (!_nm_connection_check_main_setting(connection, NM_SETTING_GSM_SETTING_NAME, NULL)) {
|
||||
nm_utils_error_set(error,
|
||||
|
@ -290,7 +290,7 @@ check_connection_compatible_with_modem(NMModem *modem, NMConnection *connection,
|
|||
static void
|
||||
handle_sim_property(GDBusProxy *proxy, const char *property, GVariant *v, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(user_data);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(user_data);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
|
||||
if (g_strcmp0(property, "SubscriberIdentity") == 0 && VARIANT_IS_OF_TYPE_STRING(v)) {
|
||||
|
@ -324,14 +324,14 @@ sim_property_changed(GDBusProxy *proxy, const char *property, GVariant *v, gpoin
|
|||
static void
|
||||
sim_get_properties_done(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMModemOfono *self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *v_properties = NULL;
|
||||
gs_unref_variant GVariant *v_dict = NULL;
|
||||
gs_unref_variant GVariant *v = NULL;
|
||||
GVariantIter i;
|
||||
const char * property;
|
||||
const char *property;
|
||||
|
||||
v_properties =
|
||||
_nm_dbus_proxy_call_finish(G_DBUS_PROXY(source), result, G_VARIANT_TYPE("(a{sv})"), &error);
|
||||
|
@ -377,10 +377,10 @@ sim_get_properties_done(GObject *source, GAsyncResult *result, gpointer user_dat
|
|||
static void
|
||||
_sim_proxy_new_cb(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
NMModemOfono *self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
GDBusProxy * proxy;
|
||||
GDBusProxy *proxy;
|
||||
|
||||
proxy = g_dbus_proxy_new_for_bus_finish(result, &error);
|
||||
if (!proxy && g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -451,7 +451,7 @@ handle_sim_iface(NMModemOfono *self, gboolean found)
|
|||
static void
|
||||
handle_connman_property(GDBusProxy *proxy, const char *property, GVariant *v, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(user_data);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(user_data);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
|
||||
if (g_strcmp0(property, "Attached") == 0 && VARIANT_IS_OF_TYPE_BOOLEAN(v)) {
|
||||
|
@ -483,14 +483,14 @@ connman_property_changed(GDBusProxy *proxy, const char *property, GVariant *v, g
|
|||
static void
|
||||
connman_get_properties_done(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMModemOfono *self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *v_properties = NULL;
|
||||
gs_unref_variant GVariant *v_dict = NULL;
|
||||
gs_unref_variant GVariant *v = NULL;
|
||||
GVariantIter i;
|
||||
const char * property;
|
||||
const char *property;
|
||||
|
||||
v_properties =
|
||||
_nm_dbus_proxy_call_finish(G_DBUS_PROXY(source), result, G_VARIANT_TYPE("(a{sv})"), &error);
|
||||
|
@ -528,10 +528,10 @@ connman_get_properties_done(GObject *source, GAsyncResult *result, gpointer user
|
|||
static void
|
||||
_connman_proxy_new_cb(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
NMModemOfono *self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
GDBusProxy * proxy;
|
||||
GDBusProxy *proxy;
|
||||
|
||||
proxy = g_dbus_proxy_new_for_bus_finish(result, &error);
|
||||
if (!proxy && g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -606,7 +606,7 @@ handle_connman_iface(NMModemOfono *self, gboolean found)
|
|||
static void
|
||||
handle_modem_property(GDBusProxy *proxy, const char *property, GVariant *v, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(user_data);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(user_data);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
|
||||
if ((g_strcmp0(property, "Online") == 0) && VARIANT_IS_OF_TYPE_BOOLEAN(v)) {
|
||||
|
@ -655,14 +655,14 @@ modem_property_changed(GDBusProxy *proxy, const char *property, GVariant *v, gpo
|
|||
static void
|
||||
modem_get_properties_done(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMModemOfono *self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *v_properties = NULL;
|
||||
gs_unref_variant GVariant *v_dict = NULL;
|
||||
GVariant * v;
|
||||
GVariant *v;
|
||||
GVariantIter i;
|
||||
const char * property;
|
||||
const char *property;
|
||||
|
||||
v_properties =
|
||||
_nm_dbus_proxy_call_finish(G_DBUS_PROXY(source), result, G_VARIANT_TYPE("(a{sv})"), &error);
|
||||
|
@ -704,10 +704,10 @@ modem_get_properties_done(GObject *source, GAsyncResult *result, gpointer user_d
|
|||
static void
|
||||
stage1_prepare_done(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *v = NULL;
|
||||
NMModemOfono *self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *v = NULL;
|
||||
|
||||
v = g_dbus_proxy_call_finish(G_DBUS_PROXY(source), result, &error);
|
||||
if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -732,17 +732,17 @@ stage1_prepare_done(GObject *source, GAsyncResult *result, gpointer user_data)
|
|||
static void
|
||||
handle_settings(GVariant *v_dict, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(user_data);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(user_data);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
char sbuf[sizeof(_nm_utils_to_string_buffer)];
|
||||
NMPlatformIP4Address address;
|
||||
gboolean ret = FALSE;
|
||||
const char * interface;
|
||||
const char * s;
|
||||
const char ** array;
|
||||
const char *interface;
|
||||
const char *s;
|
||||
const char **array;
|
||||
guint32 address_network, gateway_network;
|
||||
int ifindex;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
//_LOGD("PropertyChanged: %s", property);
|
||||
|
||||
|
@ -894,7 +894,7 @@ out:
|
|||
static void
|
||||
context_property_changed(GDBusProxy *proxy, const char *property, GVariant *v, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(user_data);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(user_data);
|
||||
gs_unref_variant GVariant *v_dict = NULL;
|
||||
|
||||
_LOGD("PropertyChanged: %s", property);
|
||||
|
@ -916,8 +916,8 @@ context_property_changed(GDBusProxy *proxy, const char *property, GVariant *v, g
|
|||
static void
|
||||
stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_method)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
_LOGD("IP4 config is done; setting modem_state -> CONNECTED");
|
||||
|
@ -947,9 +947,9 @@ out:
|
|||
static void
|
||||
context_properties_cb(GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMModemOfono *self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *properties = NULL;
|
||||
gs_unref_variant GVariant *settings = NULL;
|
||||
gs_unref_variant GVariant *v_dict = NULL;
|
||||
|
@ -1013,10 +1013,10 @@ error:
|
|||
static void
|
||||
context_proxy_new_cb(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
NMModemOfono *self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
GDBusProxy * proxy;
|
||||
GDBusProxy *proxy;
|
||||
|
||||
proxy = g_dbus_proxy_new_for_bus_finish(result, &error);
|
||||
if (!proxy || g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -1087,8 +1087,8 @@ static GHashTable *
|
|||
create_connect_properties(NMConnection *connection)
|
||||
{
|
||||
NMSettingGsm *setting;
|
||||
GHashTable * properties;
|
||||
const char * str;
|
||||
GHashTable *properties;
|
||||
const char *str;
|
||||
|
||||
setting = nm_connection_get_setting_gsm(connection);
|
||||
properties = g_hash_table_new(nm_str_hash, g_str_equal);
|
||||
|
@ -1109,14 +1109,14 @@ create_connect_properties(NMConnection *connection)
|
|||
}
|
||||
|
||||
static NMActStageReturn
|
||||
modem_act_stage1_prepare(NMModem * modem,
|
||||
NMConnection * connection,
|
||||
modem_act_stage1_prepare(NMModem *modem,
|
||||
NMConnection *connection,
|
||||
NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(modem);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
const char * context_id;
|
||||
char ** id = NULL;
|
||||
const char *context_id;
|
||||
char **id = NULL;
|
||||
|
||||
context_id = nm_connection_get_id(connection);
|
||||
id = g_strsplit(context_id, "/", 0);
|
||||
|
@ -1155,10 +1155,10 @@ modem_act_stage1_prepare(NMModem * modem,
|
|||
static void
|
||||
modem_proxy_new_cb(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
NMModemOfono * self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
NMModemOfono *self;
|
||||
NMModemOfonoPrivate *priv;
|
||||
gs_free_error GError *error = NULL;
|
||||
GDBusProxy * proxy;
|
||||
GDBusProxy *proxy;
|
||||
|
||||
proxy = g_dbus_proxy_new_for_bus_finish(result, &error);
|
||||
if (!proxy && g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
|
@ -1200,7 +1200,7 @@ nm_modem_ofono_init(NMModemOfono *self)
|
|||
static void
|
||||
constructed(GObject *object)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(object);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(object);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
|
||||
priv->modem_proxy_cancellable = g_cancellable_new();
|
||||
|
@ -1251,7 +1251,7 @@ nm_modem_ofono_new(const char *path)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMModemOfono * self = NM_MODEM_OFONO(object);
|
||||
NMModemOfono *self = NM_MODEM_OFONO(object);
|
||||
NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_cancellable(&priv->modem_proxy_cancellable);
|
||||
|
|
|
@ -72,18 +72,18 @@ typedef struct _NMModemPrivate {
|
|||
NMModemIPMethod ip6_method;
|
||||
NMModemState state;
|
||||
NMModemState prev_state; /* revert to this state if enable/disable fails */
|
||||
char * device_id;
|
||||
char * sim_id;
|
||||
char *device_id;
|
||||
char *sim_id;
|
||||
NMModemIPType ip_types;
|
||||
char * sim_operator_id;
|
||||
char * operator_code;
|
||||
char * apn;
|
||||
char *sim_operator_id;
|
||||
char *operator_code;
|
||||
char *apn;
|
||||
|
||||
NMPPPManager *ppp_manager;
|
||||
NMPppMgr * ppp_mgr;
|
||||
NMPppMgr *ppp_mgr;
|
||||
|
||||
NMActRequest * act_req;
|
||||
NMDevice * device;
|
||||
NMActRequest *act_req;
|
||||
NMDevice *device;
|
||||
guint32 secrets_tries;
|
||||
NMActRequestGetSecretsCallId *secrets_id;
|
||||
|
||||
|
@ -195,13 +195,13 @@ _get_platform(NMModem *self)
|
|||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
nm_modem_emit_signal_new_config(NMModem * self,
|
||||
nm_modem_emit_signal_new_config(NMModem *self,
|
||||
int addr_family,
|
||||
const NML3ConfigData * l3cd,
|
||||
const NML3ConfigData *l3cd,
|
||||
gboolean do_auto,
|
||||
const NMUtilsIPv6IfaceId *iid,
|
||||
NMDeviceStateReason failure_reason,
|
||||
GError * error)
|
||||
GError *error)
|
||||
{
|
||||
nm_assert(NM_IS_MODEM(self));
|
||||
nm_assert_addr_family(addr_family);
|
||||
|
@ -241,9 +241,9 @@ nm_modem_emit_signal_new_config(NMModem * self,
|
|||
}
|
||||
|
||||
void
|
||||
nm_modem_emit_signal_new_config_success(NMModem * self,
|
||||
nm_modem_emit_signal_new_config_success(NMModem *self,
|
||||
int addr_family,
|
||||
const NML3ConfigData * l3cd,
|
||||
const NML3ConfigData *l3cd,
|
||||
gboolean do_auto,
|
||||
const NMUtilsIPv6IfaceId *iid)
|
||||
{
|
||||
|
@ -257,10 +257,10 @@ nm_modem_emit_signal_new_config_success(NMModem * self,
|
|||
}
|
||||
|
||||
void
|
||||
nm_modem_emit_signal_new_config_failure(NMModem * self,
|
||||
nm_modem_emit_signal_new_config_failure(NMModem *self,
|
||||
int addr_family,
|
||||
NMDeviceStateReason failure_reason,
|
||||
GError * error)
|
||||
GError *error)
|
||||
{
|
||||
nm_assert(error);
|
||||
nm_modem_emit_signal_new_config(self, addr_family, NULL, FALSE, NULL, failure_reason, error);
|
||||
|
@ -461,9 +461,9 @@ build_single_ip_type_array(NMModemIPType type)
|
|||
GArray *
|
||||
nm_modem_get_connection_ip_type(NMModem *self, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMModemPrivate * priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMSettingIPConfig *s_ip4, *s_ip6;
|
||||
const char * method;
|
||||
const char *method;
|
||||
gboolean ip4 = TRUE, ip6 = TRUE;
|
||||
gboolean ip4_may_fail = TRUE, ip6_may_fail = TRUE;
|
||||
|
||||
|
@ -511,7 +511,7 @@ nm_modem_get_connection_ip_type(NMModem *self, NMConnection *connection, GError
|
|||
|
||||
if (ip4 && ip6) {
|
||||
NMModemIPType type;
|
||||
GArray * out;
|
||||
GArray *out;
|
||||
|
||||
out = g_array_sized_new(FALSE, FALSE, sizeof(NMModemIPType), 3);
|
||||
|
||||
|
@ -597,7 +597,7 @@ _ppp_mgr_cleanup(NMModem *self)
|
|||
static void
|
||||
_ppp_maybe_emit_new_config(NMModem *self, int addr_family)
|
||||
{
|
||||
NMModemPrivate * priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
const NMPppMgrIPData *ip_data;
|
||||
gboolean do_auto;
|
||||
|
@ -628,7 +628,7 @@ _ppp_maybe_emit_new_config(NMModem *self, int addr_family)
|
|||
static void
|
||||
_ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data, gpointer user_data)
|
||||
{
|
||||
NMModem * self = NM_MODEM(user_data);
|
||||
NMModem *self = NM_MODEM(user_data);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
int IS_IPv4;
|
||||
|
||||
|
@ -675,7 +675,7 @@ port_speed_is_zero(const char *port)
|
|||
{
|
||||
struct termios options;
|
||||
nm_auto_close int fd = -1;
|
||||
gs_free char * path = NULL;
|
||||
gs_free char *path = NULL;
|
||||
|
||||
nm_assert(port);
|
||||
|
||||
|
@ -702,11 +702,11 @@ port_speed_is_zero(const char *port)
|
|||
static gboolean
|
||||
_stage3_ip_config_start_on_idle(NMModem *self, int addr_family)
|
||||
{
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMModemIPMethod ip_method;
|
||||
NMConnection * connection;
|
||||
const char * method;
|
||||
const int IS_IPv4 = NM_IS_IPv4(addr_family);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMModemIPMethod ip_method;
|
||||
NMConnection *connection;
|
||||
const char *method;
|
||||
gs_free_error GError *error = NULL;
|
||||
NMDeviceStateReason failure_reason;
|
||||
|
||||
|
@ -803,10 +803,10 @@ guint32
|
|||
nm_modem_get_configured_mtu(NMDevice *self, NMDeviceMtuSource *out_source, gboolean *out_force)
|
||||
{
|
||||
NMConnection *connection;
|
||||
NMSetting * setting;
|
||||
NMSetting *setting;
|
||||
gint64 mtu_default;
|
||||
guint mtu = 0;
|
||||
const char * property_name;
|
||||
const char *property_name;
|
||||
|
||||
nm_assert(NM_IS_DEVICE(self));
|
||||
nm_assert(out_source);
|
||||
|
@ -851,13 +851,13 @@ cancel_get_secrets(NMModem *self)
|
|||
}
|
||||
|
||||
static void
|
||||
modem_secrets_cb(NMActRequest * req,
|
||||
modem_secrets_cb(NMActRequest *req,
|
||||
NMActRequestGetSecretsCallId *call_id,
|
||||
NMSettingsConnection * connection,
|
||||
GError * error,
|
||||
NMSettingsConnection *connection,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMModem * self = NM_MODEM(user_data);
|
||||
NMModem *self = NM_MODEM(user_data);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
|
||||
g_return_if_fail(call_id == priv->secrets_id);
|
||||
|
@ -877,12 +877,12 @@ modem_secrets_cb(NMActRequest * req,
|
|||
}
|
||||
|
||||
void
|
||||
nm_modem_get_secrets(NMModem * self,
|
||||
nm_modem_get_secrets(NMModem *self,
|
||||
const char *setting_name,
|
||||
gboolean request_new,
|
||||
const char *hint)
|
||||
{
|
||||
NMModemPrivate * priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMSecretAgentGetSecretsFlags flags = NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION;
|
||||
|
||||
cancel_get_secrets(self);
|
||||
|
@ -903,8 +903,8 @@ nm_modem_get_secrets(NMModem * self,
|
|||
/*****************************************************************************/
|
||||
|
||||
static NMActStageReturn
|
||||
modem_act_stage1_prepare(NMModem * modem,
|
||||
NMConnection * connection,
|
||||
modem_act_stage1_prepare(NMModem *modem,
|
||||
NMConnection *connection,
|
||||
NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NM_SET_OUT(out_failure_reason, NM_DEVICE_STATE_REASON_UNKNOWN);
|
||||
|
@ -912,16 +912,16 @@ modem_act_stage1_prepare(NMModem * modem,
|
|||
}
|
||||
|
||||
NMActStageReturn
|
||||
nm_modem_act_stage1_prepare(NMModem * self,
|
||||
NMActRequest * req,
|
||||
nm_modem_act_stage1_prepare(NMModem *self,
|
||||
NMActRequest *req,
|
||||
NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMModemPrivate * priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
gs_unref_ptrarray GPtrArray *hints = NULL;
|
||||
const char * setting_name = NULL;
|
||||
const char *setting_name = NULL;
|
||||
NMSecretAgentGetSecretsFlags flags = NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION;
|
||||
NMConnection * connection;
|
||||
NMDevice * device;
|
||||
NMConnection *connection;
|
||||
NMDevice *device;
|
||||
|
||||
g_return_val_if_fail(NM_IS_ACT_REQUEST(req), NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
||||
|
@ -985,11 +985,11 @@ nm_modem_act_stage2_config(NMModem *self, NMDevice *device, NMDeviceStateReason
|
|||
(priv->ip4_method == NM_MODEM_IP_METHOD_PPP || priv->ip6_method == NM_MODEM_IP_METHOD_PPP);
|
||||
|
||||
if (needs_ppp && !priv->ppp_mgr) {
|
||||
const char * ppp_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
const char *ppp_name = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
guint ip_timeout;
|
||||
guint baud_override;
|
||||
NMActRequest * req;
|
||||
NMActRequest *req;
|
||||
|
||||
req = nm_device_get_act_request(device);
|
||||
g_return_val_if_fail(req, NM_ACT_STAGE_RETURN_FAILURE);
|
||||
|
@ -1061,7 +1061,7 @@ nm_modem_check_connection_compatible(NMModem *self, NMConnection *connection, GE
|
|||
|
||||
if (nm_streq0(nm_connection_get_connection_type(connection), NM_SETTING_GSM_SETTING_NAME)) {
|
||||
NMSettingGsm *s_gsm;
|
||||
const char * str;
|
||||
const char *str;
|
||||
|
||||
s_gsm = _nm_connection_check_main_setting(connection, NM_SETTING_GSM_SETTING_NAME, error);
|
||||
if (!s_gsm)
|
||||
|
@ -1115,11 +1115,11 @@ nm_modem_check_connection_compatible(NMModem *self, NMConnection *connection, GE
|
|||
/*****************************************************************************/
|
||||
|
||||
gboolean
|
||||
nm_modem_complete_connection(NMModem * self,
|
||||
const char * iface,
|
||||
NMConnection * connection,
|
||||
nm_modem_complete_connection(NMModem *self,
|
||||
const char *iface,
|
||||
NMConnection *connection,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMModemClass *klass;
|
||||
|
||||
|
@ -1192,9 +1192,9 @@ deactivate_cleanup(NMModem *self, NMDevice *device, gboolean stop_ppp_manager)
|
|||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
NMModem * self;
|
||||
NMDevice * device;
|
||||
GCancellable * cancellable;
|
||||
NMModem *self;
|
||||
NMDevice *device;
|
||||
GCancellable *cancellable;
|
||||
NMModemDeactivateCallback callback;
|
||||
gpointer callback_user_data;
|
||||
} DeactivateContext;
|
||||
|
@ -1232,7 +1232,7 @@ _deactivate_call_disconnect(DeactivateContext *ctx)
|
|||
}
|
||||
|
||||
static void
|
||||
_deactivate_ppp_manager_stop_cb(NMPPPManager * ppp_manager,
|
||||
_deactivate_ppp_manager_stop_cb(NMPPPManager *ppp_manager,
|
||||
NMPPPManagerStopHandle *handle,
|
||||
gboolean was_cancelled,
|
||||
gpointer user_data)
|
||||
|
@ -1255,15 +1255,15 @@ _deactivate_ppp_manager_stop_cb(NMPPPManager * ppp_manager,
|
|||
}
|
||||
|
||||
void
|
||||
nm_modem_deactivate_async(NMModem * self,
|
||||
NMDevice * device,
|
||||
GCancellable * cancellable,
|
||||
nm_modem_deactivate_async(NMModem *self,
|
||||
NMDevice *device,
|
||||
GCancellable *cancellable,
|
||||
NMModemDeactivateCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMModemPrivate * priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
DeactivateContext *ctx;
|
||||
NMPPPManager * ppp_manager;
|
||||
NMPPPManager *ppp_manager;
|
||||
|
||||
g_return_if_fail(NM_IS_MODEM(self));
|
||||
g_return_if_fail(NM_IS_DEVICE(device));
|
||||
|
@ -1407,13 +1407,13 @@ _set_ip_ifindex(NMModem *self, int ifindex)
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_modem_set_data_port(NMModem * self,
|
||||
NMPlatform * platform,
|
||||
const char * data_port,
|
||||
nm_modem_set_data_port(NMModem *self,
|
||||
NMPlatform *platform,
|
||||
const char *data_port,
|
||||
NMModemIPMethod ip4_method,
|
||||
NMModemIPMethod ip6_method,
|
||||
guint timeout,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMModemPrivate *priv;
|
||||
gboolean is_ppp;
|
||||
|
@ -1499,8 +1499,8 @@ nm_modem_set_data_port(NMModem * self,
|
|||
gboolean
|
||||
nm_modem_owns_port(NMModem *self, const char *iface)
|
||||
{
|
||||
NMModemPrivate * priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMPlatform * platform;
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
NMPlatform *platform;
|
||||
const NMPlatformLink *plink;
|
||||
|
||||
g_return_val_if_fail(iface != NULL, FALSE);
|
||||
|
@ -1526,7 +1526,7 @@ nm_modem_owns_port(NMModem *self, const char *iface)
|
|||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
nm_modem_get_capabilities(NMModem * self,
|
||||
nm_modem_get_capabilities(NMModem *self,
|
||||
NMDeviceModemCapabilities *modem_caps,
|
||||
NMDeviceModemCapabilities *current_caps)
|
||||
{
|
||||
|
@ -1566,7 +1566,7 @@ _nm_modem_set_apn(NMModem *self, const char *apn)
|
|||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMModem * self = NM_MODEM(object);
|
||||
NMModem *self = NM_MODEM(object);
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(self);
|
||||
|
||||
switch (prop_id) {
|
||||
|
@ -1616,7 +1616,7 @@ static void
|
|||
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
NMModemPrivate *priv = NM_MODEM_GET_PRIVATE(object);
|
||||
const char * s;
|
||||
const char *s;
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PATH:
|
||||
|
|
|
@ -100,36 +100,36 @@ typedef void (*_NMModemDisconnectCallback)(NMModem *modem, GError *error, gpoint
|
|||
typedef struct {
|
||||
GObjectClass parent;
|
||||
|
||||
void (*get_capabilities)(NMModem * self,
|
||||
void (*get_capabilities)(NMModem *self,
|
||||
NMDeviceModemCapabilities *modem_caps,
|
||||
NMDeviceModemCapabilities *current_caps);
|
||||
|
||||
gboolean (*get_user_pass)(NMModem * modem,
|
||||
gboolean (*get_user_pass)(NMModem *modem,
|
||||
NMConnection *connection,
|
||||
const char ** user,
|
||||
const char ** pass);
|
||||
const char **user,
|
||||
const char **pass);
|
||||
|
||||
gboolean (*check_connection_compatible_with_modem)(NMModem * modem,
|
||||
gboolean (*check_connection_compatible_with_modem)(NMModem *modem,
|
||||
NMConnection *connection,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
gboolean (*complete_connection)(NMModem * modem,
|
||||
const char * iface,
|
||||
NMConnection * connection,
|
||||
gboolean (*complete_connection)(NMModem *modem,
|
||||
const char *iface,
|
||||
NMConnection *connection,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
NMActStageReturn (*modem_act_stage1_prepare)(NMModem * modem,
|
||||
NMConnection * connection,
|
||||
NMActStageReturn (*modem_act_stage1_prepare)(NMModem *modem,
|
||||
NMConnection *connection,
|
||||
NMDeviceStateReason *out_failure_reason);
|
||||
|
||||
void (*stage3_ip_config_start)(NMModem *self, int addr_family, NMModemIPMethod method);
|
||||
|
||||
void (*set_mm_enabled)(NMModem *self, gboolean enabled);
|
||||
|
||||
void (*disconnect)(NMModem * self,
|
||||
void (*disconnect)(NMModem *self,
|
||||
gboolean warn,
|
||||
GCancellable * cancellable,
|
||||
GCancellable *cancellable,
|
||||
_NMModemDisconnectCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
|
@ -155,40 +155,40 @@ const char *nm_modem_get_sim_operator_id(NMModem *modem);
|
|||
const char *nm_modem_get_operator_code(NMModem *modem);
|
||||
const char *nm_modem_get_apn(NMModem *modem);
|
||||
|
||||
gboolean nm_modem_set_data_port(NMModem * self,
|
||||
NMPlatform * platform,
|
||||
const char * data_port,
|
||||
gboolean nm_modem_set_data_port(NMModem *self,
|
||||
NMPlatform *platform,
|
||||
const char *data_port,
|
||||
NMModemIPMethod ip4_method,
|
||||
NMModemIPMethod ip6_method,
|
||||
guint timeout,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
gboolean nm_modem_owns_port(NMModem *modem, const char *iface);
|
||||
|
||||
void nm_modem_get_capabilities(NMModem * self,
|
||||
void nm_modem_get_capabilities(NMModem *self,
|
||||
NMDeviceModemCapabilities *modem_caps,
|
||||
NMDeviceModemCapabilities *current_caps);
|
||||
|
||||
gboolean
|
||||
nm_modem_check_connection_compatible(NMModem *self, NMConnection *connection, GError **error);
|
||||
|
||||
gboolean nm_modem_complete_connection(NMModem * self,
|
||||
const char * iface,
|
||||
NMConnection * connection,
|
||||
gboolean nm_modem_complete_connection(NMModem *self,
|
||||
const char *iface,
|
||||
NMConnection *connection,
|
||||
NMConnection *const *existing_connections,
|
||||
GError ** error);
|
||||
GError **error);
|
||||
|
||||
NMActStageReturn nm_modem_act_stage1_prepare(NMModem * modem,
|
||||
NMActRequest * req,
|
||||
NMActStageReturn nm_modem_act_stage1_prepare(NMModem *modem,
|
||||
NMActRequest *req,
|
||||
NMDeviceStateReason *out_failure_reason);
|
||||
|
||||
NMActStageReturn nm_modem_act_stage2_config(NMModem * self,
|
||||
NMDevice * device,
|
||||
NMActStageReturn nm_modem_act_stage2_config(NMModem *self,
|
||||
NMDevice *device,
|
||||
NMDeviceStateReason *out_failure_reason);
|
||||
|
||||
gboolean nm_modem_stage3_ip_config_start(NMModem *self, int addr_family, NMDevice *device);
|
||||
|
||||
void nm_modem_get_secrets(NMModem * modem,
|
||||
void nm_modem_get_secrets(NMModem *modem,
|
||||
const char *setting_name,
|
||||
gboolean request_new,
|
||||
const char *hint);
|
||||
|
@ -197,9 +197,9 @@ void nm_modem_deactivate(NMModem *modem, NMDevice *device);
|
|||
|
||||
typedef void (*NMModemDeactivateCallback)(NMModem *self, GError *error, gpointer user_data);
|
||||
|
||||
void nm_modem_deactivate_async(NMModem * self,
|
||||
NMDevice * device,
|
||||
GCancellable * cancellable,
|
||||
void nm_modem_deactivate_async(NMModem *self,
|
||||
NMDevice *device,
|
||||
GCancellable *cancellable,
|
||||
NMModemDeactivateCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
|
@ -211,7 +211,7 @@ void nm_modem_set_mm_enabled(NMModem *self, gboolean enabled);
|
|||
NMModemState nm_modem_get_state(NMModem *self);
|
||||
void nm_modem_set_state(NMModem *self, NMModemState new_state, const char *reason);
|
||||
void nm_modem_set_prev_state(NMModem *self, const char *reason);
|
||||
const char * nm_modem_state_to_string(NMModemState state);
|
||||
const char *nm_modem_state_to_string(NMModemState state);
|
||||
|
||||
NMModemIPType nm_modem_get_supported_ip_types(NMModem *self);
|
||||
|
||||
|
@ -228,22 +228,22 @@ GArray *nm_modem_get_connection_ip_type(NMModem *self, NMConnection *connection,
|
|||
|
||||
/* For subclasses */
|
||||
|
||||
void nm_modem_emit_signal_new_config(NMModem * self,
|
||||
void nm_modem_emit_signal_new_config(NMModem *self,
|
||||
int addr_family,
|
||||
const NML3ConfigData * l3cd,
|
||||
const NML3ConfigData *l3cd,
|
||||
gboolean do_slaac,
|
||||
const NMUtilsIPv6IfaceId *iid,
|
||||
NMDeviceStateReason failure_reason,
|
||||
GError * error);
|
||||
void nm_modem_emit_signal_new_config_success(NMModem * self,
|
||||
GError *error);
|
||||
void nm_modem_emit_signal_new_config_success(NMModem *self,
|
||||
int addr_family,
|
||||
const NML3ConfigData * l3cd,
|
||||
const NML3ConfigData *l3cd,
|
||||
gboolean do_auto,
|
||||
const NMUtilsIPv6IfaceId *iid);
|
||||
void nm_modem_emit_signal_new_config_failure(NMModem * self,
|
||||
void nm_modem_emit_signal_new_config_failure(NMModem *self,
|
||||
int addr_family,
|
||||
NMDeviceStateReason failure_reason,
|
||||
GError * error);
|
||||
GError *error);
|
||||
|
||||
const char *nm_modem_ip_type_to_string(NMModemIPType ip_type);
|
||||
|
||||
|
|
|
@ -22,33 +22,33 @@ typedef enum {
|
|||
} ParseContextState;
|
||||
|
||||
typedef struct {
|
||||
char * mccmnc;
|
||||
char *mccmnc;
|
||||
NMServiceProvidersGsmApnCallback callback;
|
||||
gpointer user_data;
|
||||
GCancellable * cancellable;
|
||||
GMarkupParseContext * ctx;
|
||||
GCancellable *cancellable;
|
||||
GMarkupParseContext *ctx;
|
||||
char buffer[4096];
|
||||
|
||||
char * text_buffer;
|
||||
char *text_buffer;
|
||||
ParseContextState state;
|
||||
|
||||
gboolean mccmnc_matched;
|
||||
gboolean found_internet_apn;
|
||||
char * apn;
|
||||
char * username;
|
||||
char * password;
|
||||
char * gateway;
|
||||
char * auth_method;
|
||||
GSList * dns;
|
||||
char *apn;
|
||||
char *username;
|
||||
char *password;
|
||||
char *gateway;
|
||||
char *auth_method;
|
||||
GSList *dns;
|
||||
} ParseContext;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
parser_toplevel_start(ParseContext *parse_context,
|
||||
const char * name,
|
||||
const char ** attribute_names,
|
||||
const char ** attribute_values)
|
||||
const char *name,
|
||||
const char **attribute_names,
|
||||
const char **attribute_values)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -72,9 +72,9 @@ parser_toplevel_start(ParseContext *parse_context,
|
|||
|
||||
static void
|
||||
parser_country_start(ParseContext *parse_context,
|
||||
const char * name,
|
||||
const char ** attribute_names,
|
||||
const char ** attribute_values)
|
||||
const char *name,
|
||||
const char **attribute_names,
|
||||
const char **attribute_values)
|
||||
{
|
||||
if (strcmp(name, "provider") == 0)
|
||||
parse_context->state = PARSER_PROVIDER;
|
||||
|
@ -82,9 +82,9 @@ parser_country_start(ParseContext *parse_context,
|
|||
|
||||
static void
|
||||
parser_provider_start(ParseContext *parse_context,
|
||||
const char * name,
|
||||
const char ** attribute_names,
|
||||
const char ** attribute_values)
|
||||
const char *name,
|
||||
const char **attribute_names,
|
||||
const char **attribute_values)
|
||||
{
|
||||
parse_context->mccmnc_matched = FALSE;
|
||||
if (strcmp(name, "gsm") == 0)
|
||||
|
@ -95,9 +95,9 @@ parser_provider_start(ParseContext *parse_context,
|
|||
|
||||
static void
|
||||
parser_gsm_start(ParseContext *parse_context,
|
||||
const char * name,
|
||||
const char ** attribute_names,
|
||||
const char ** attribute_values)
|
||||
const char *name,
|
||||
const char **attribute_names,
|
||||
const char **attribute_values)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -140,9 +140,9 @@ parser_gsm_start(ParseContext *parse_context,
|
|||
|
||||
static void
|
||||
parser_gsm_apn_start(ParseContext *parse_context,
|
||||
const char * name,
|
||||
const char ** attribute_names,
|
||||
const char ** attribute_values)
|
||||
const char *name,
|
||||
const char **attribute_names,
|
||||
const char **attribute_values)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -167,11 +167,11 @@ parser_gsm_apn_start(ParseContext *parse_context,
|
|||
|
||||
static void
|
||||
parser_start_element(GMarkupParseContext *context,
|
||||
const char * element_name,
|
||||
const char ** attribute_names,
|
||||
const char ** attribute_values,
|
||||
const char *element_name,
|
||||
const char **attribute_names,
|
||||
const char **attribute_values,
|
||||
gpointer user_data,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
ParseContext *parse_context = user_data;
|
||||
|
||||
|
@ -265,9 +265,9 @@ parser_cdma_end(ParseContext *parse_context, const char *name)
|
|||
|
||||
static void
|
||||
parser_end_element(GMarkupParseContext *context,
|
||||
const char * element_name,
|
||||
const char *element_name,
|
||||
gpointer user_data,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
ParseContext *parse_context = user_data;
|
||||
|
||||
|
@ -298,10 +298,10 @@ parser_end_element(GMarkupParseContext *context,
|
|||
|
||||
static void
|
||||
parser_text(GMarkupParseContext *context,
|
||||
const char * text,
|
||||
const char *text,
|
||||
gsize text_len,
|
||||
gpointer user_data,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
ParseContext *parse_context = user_data;
|
||||
|
||||
|
@ -360,7 +360,7 @@ stream_read_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
|||
GInputStream *stream = G_INPUT_STREAM(source_object);
|
||||
ParseContext *parse_context = user_data;
|
||||
gssize len;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
len = g_input_stream_read_finish(stream, res, &error);
|
||||
if (len == -1) {
|
||||
|
@ -411,9 +411,9 @@ read_next_chunk(GInputStream *stream, ParseContext *parse_context)
|
|||
static void
|
||||
file_read_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
GFile * file = G_FILE(source_object);
|
||||
ParseContext * parse_context = user_data;
|
||||
GFileInputStream *stream;
|
||||
GFile *file = G_FILE(source_object);
|
||||
ParseContext *parse_context = user_data;
|
||||
GFileInputStream *stream;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
stream = g_file_read_finish(file, res, &error);
|
||||
|
@ -431,13 +431,13 @@ file_read_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
|||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
nm_service_providers_find_gsm_apn(const char * service_providers,
|
||||
const char * mccmnc,
|
||||
GCancellable * cancellable,
|
||||
nm_service_providers_find_gsm_apn(const char *service_providers,
|
||||
const char *mccmnc,
|
||||
GCancellable *cancellable,
|
||||
NMServiceProvidersGsmApnCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GFile * file;
|
||||
GFile *file;
|
||||
ParseContext *parse_context;
|
||||
|
||||
parse_context = g_slice_new0(ParseContext);
|
||||
|
|
|
@ -6,18 +6,18 @@
|
|||
#ifndef __NETWORKMANAGER_SERVICE_PROVIDERS_H__
|
||||
#define __NETWORKMANAGER_SERVICE_PROVIDERS_H__
|
||||
|
||||
typedef void (*NMServiceProvidersGsmApnCallback)(const char * apn,
|
||||
const char * username,
|
||||
const char * password,
|
||||
const char * gateway,
|
||||
const char * auth_method,
|
||||
typedef void (*NMServiceProvidersGsmApnCallback)(const char *apn,
|
||||
const char *username,
|
||||
const char *password,
|
||||
const char *gateway,
|
||||
const char *auth_method,
|
||||
const GSList *dns,
|
||||
GError * error,
|
||||
GError *error,
|
||||
gpointer user_data);
|
||||
|
||||
void nm_service_providers_find_gsm_apn(const char * service_providers,
|
||||
const char * mccmnc,
|
||||
GCancellable * cancellable,
|
||||
void nm_service_providers_find_gsm_apn(const char *service_providers,
|
||||
const char *mccmnc,
|
||||
GCancellable *cancellable,
|
||||
NMServiceProvidersGsmApnCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ NM_DEVICE_FACTORY_DECLARE_TYPES(NM_DEVICE_FACTORY_DECLARE_LINK_TYPES(
|
|||
NM_SETTING_CDMA_SETTING_NAME))
|
||||
|
||||
G_MODULE_EXPORT NMDeviceFactory *
|
||||
nm_device_factory_create(GError **error)
|
||||
nm_device_factory_create(GError **error)
|
||||
{
|
||||
return g_object_new(NM_TYPE_WWAN_FACTORY, NULL);
|
||||
}
|
||||
|
@ -62,9 +62,9 @@ G_MODULE_EXPORT NMDeviceFactory *
|
|||
static void
|
||||
modem_added_cb(NMModemManager *manager, NMModem *modem, gpointer user_data)
|
||||
{
|
||||
NMWwanFactory * self = NM_WWAN_FACTORY(user_data);
|
||||
NMWwanFactory *self = NM_WWAN_FACTORY(user_data);
|
||||
gs_unref_object NMDevice *device = NULL;
|
||||
const char * driver;
|
||||
const char *driver;
|
||||
|
||||
if (nm_modem_is_claimed(modem))
|
||||
return;
|
||||
|
@ -89,11 +89,11 @@ modem_added_cb(NMModemManager *manager, NMModem *modem, gpointer user_data)
|
|||
}
|
||||
|
||||
static NMDevice *
|
||||
create_device(NMDeviceFactory * factory,
|
||||
const char * iface,
|
||||
create_device(NMDeviceFactory *factory,
|
||||
const char *iface,
|
||||
const NMPlatformLink *plink,
|
||||
NMConnection * connection,
|
||||
gboolean * out_ignore)
|
||||
NMConnection *connection,
|
||||
gboolean *out_ignore)
|
||||
{
|
||||
g_return_val_if_fail(plink, NULL);
|
||||
g_return_val_if_fail(plink->type == NM_LINK_TYPE_WWAN_NET, NULL);
|
||||
|
@ -104,7 +104,7 @@ create_device(NMDeviceFactory * factory,
|
|||
static void
|
||||
start(NMDeviceFactory *factory)
|
||||
{
|
||||
NMWwanFactory * self = NM_WWAN_FACTORY(factory);
|
||||
NMWwanFactory *self = NM_WWAN_FACTORY(factory);
|
||||
NMWwanFactoryPrivate *priv = NM_WWAN_FACTORY_GET_PRIVATE(self);
|
||||
|
||||
priv->mm = g_object_ref(nm_modem_manager_get());
|
||||
|
@ -121,7 +121,7 @@ nm_wwan_factory_init(NMWwanFactory *self)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMWwanFactory * self = NM_WWAN_FACTORY(object);
|
||||
NMWwanFactory *self = NM_WWAN_FACTORY(object);
|
||||
NMWwanFactoryPrivate *priv = NM_WWAN_FACTORY_GET_PRIVATE(self);
|
||||
|
||||
if (priv->mm)
|
||||
|
@ -135,7 +135,7 @@ dispose(GObject *object)
|
|||
static void
|
||||
nm_wwan_factory_class_init(NMWwanFactoryClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
NMDeviceFactoryClass *factory_class = NM_DEVICE_FACTORY_CLASS(klass);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
#include "nm-test-utils-core.h"
|
||||
|
||||
static void
|
||||
test_positive_cb(const char * apn,
|
||||
const char * username,
|
||||
const char * password,
|
||||
const char * gateway,
|
||||
const char * auth_method,
|
||||
test_positive_cb(const char *apn,
|
||||
const char *username,
|
||||
const char *password,
|
||||
const char *gateway,
|
||||
const char *auth_method,
|
||||
const GSList *dns,
|
||||
GError * error,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
GMainLoop *loop = user_data;
|
||||
|
@ -55,13 +55,13 @@ test_positive(void)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
test_negative_cb(const char * apn,
|
||||
const char * username,
|
||||
const char * password,
|
||||
const char * gateway,
|
||||
const char * auth_method,
|
||||
test_negative_cb(const char *apn,
|
||||
const char *username,
|
||||
const char *password,
|
||||
const char *gateway,
|
||||
const char *auth_method,
|
||||
const GSList *dns,
|
||||
GError * error,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
GMainLoop *loop = user_data;
|
||||
|
@ -88,13 +88,13 @@ test_negative(void)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
test_nonexistent_cb(const char * apn,
|
||||
const char * username,
|
||||
const char * password,
|
||||
const char * gateway,
|
||||
const char * auth_method,
|
||||
test_nonexistent_cb(const char *apn,
|
||||
const char *username,
|
||||
const char *password,
|
||||
const char *gateway,
|
||||
const char *auth_method,
|
||||
const GSList *dns,
|
||||
GError * error,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
GMainLoop *loop = user_data;
|
||||
|
|
|
@ -39,8 +39,8 @@ _nm_dhcp_client_get_domain(NMDhcpClient *self)
|
|||
* expensive to determine the correct value then what we could
|
||||
* safe. */ \
|
||||
if (nm_logging_enabled(_level, _NMLOG_DOMAIN)) { \
|
||||
NMDhcpClient * _self = (NMDhcpClient *) (self); \
|
||||
const char * __ifname = _self ? nm_dhcp_client_get_iface(_self) : NULL; \
|
||||
NMDhcpClient *_self = (NMDhcpClient *) (self); \
|
||||
const char *__ifname = _self ? nm_dhcp_client_get_iface(_self) : NULL; \
|
||||
const NMLogDomain _domain = _nm_dhcp_client_get_domain(_self); \
|
||||
\
|
||||
nm_log(_level, \
|
||||
|
|
|
@ -41,14 +41,14 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMDhcpClient, PROP_CONFIG, );
|
|||
typedef struct _NMDhcpClientPrivate {
|
||||
NMDhcpClientConfig config;
|
||||
const NML3ConfigData *l3cd;
|
||||
GSource * no_lease_timeout_source;
|
||||
GSource * ipv6_lladdr_timeout_source;
|
||||
GSource *no_lease_timeout_source;
|
||||
GSource *ipv6_lladdr_timeout_source;
|
||||
pid_t pid;
|
||||
guint watch_id;
|
||||
NMDhcpState state;
|
||||
bool iaid_explicit : 1;
|
||||
bool is_stopped : 1;
|
||||
GBytes * effective_client_id;
|
||||
GBytes *effective_client_id;
|
||||
} NMDhcpClientPrivate;
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE(NMDhcpClient, nm_dhcp_client, G_TYPE_OBJECT)
|
||||
|
@ -209,7 +209,7 @@ stop(NMDhcpClient *self, gboolean release)
|
|||
static gboolean
|
||||
_no_lease_timeout(gpointer user_data)
|
||||
{
|
||||
NMDhcpClient * self = user_data;
|
||||
NMDhcpClient *self = user_data;
|
||||
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_source_inst(&priv->no_lease_timeout_source);
|
||||
|
@ -251,9 +251,9 @@ schedule_no_lease_timeout(NMDhcpClient *self)
|
|||
void
|
||||
nm_dhcp_client_set_state(NMDhcpClient *self, NMDhcpState new_state, const NML3ConfigData *l3cd)
|
||||
{
|
||||
NMDhcpClientPrivate * priv = NM_DHCP_CLIENT_GET_PRIVATE(self);
|
||||
GHashTable * options;
|
||||
const int IS_IPv4 = NM_IS_IPv4(priv->config.addr_family);
|
||||
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE(self);
|
||||
GHashTable *options;
|
||||
const int IS_IPv4 = NM_IS_IPv4(priv->config.addr_family);
|
||||
nm_auto_unref_l3cd const NML3ConfigData *l3cd_merged = NULL;
|
||||
|
||||
g_return_if_fail(NM_IS_DHCP_CLIENT(self));
|
||||
|
@ -364,9 +364,9 @@ nm_dhcp_client_set_state(NMDhcpClient *self, NMDhcpState new_state, const NML3Co
|
|||
static void
|
||||
daemon_watch_cb(GPid pid, int status, gpointer user_data)
|
||||
{
|
||||
NMDhcpClient * self = NM_DHCP_CLIENT(user_data);
|
||||
NMDhcpClient *self = NM_DHCP_CLIENT(user_data);
|
||||
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE(self);
|
||||
gs_free char * desc = NULL;
|
||||
gs_free char *desc = NULL;
|
||||
|
||||
g_return_if_fail(priv->watch_id);
|
||||
priv->watch_id = 0;
|
||||
|
@ -477,7 +477,7 @@ get_duid(NMDhcpClient *self)
|
|||
static gboolean
|
||||
ipv6_lladdr_timeout(gpointer user_data)
|
||||
{
|
||||
NMDhcpClient * self = user_data;
|
||||
NMDhcpClient *self = user_data;
|
||||
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE(self);
|
||||
|
||||
nm_clear_g_source_inst(&priv->ipv6_lladdr_timeout_source);
|
||||
|
@ -495,10 +495,10 @@ static const NMPlatformIP6Address *
|
|||
ipv6_lladdr_find(NMDhcpClient *self)
|
||||
{
|
||||
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE(self);
|
||||
NML3Cfg * l3cfg;
|
||||
NML3Cfg *l3cfg;
|
||||
NMPLookup lookup;
|
||||
NMDedupMultiIter iter;
|
||||
const NMPObject * obj;
|
||||
const NMPObject *obj;
|
||||
|
||||
l3cfg = priv->config.l3cfg;
|
||||
nmp_lookup_init_object(&lookup, NMP_OBJECT_TYPE_IP6_ADDRESS, nm_l3cfg_get_ifindex(l3cfg));
|
||||
|
@ -525,7 +525,7 @@ l3_cfg_notify_cb(NML3Cfg *l3cfg, const NML3ConfigNotifyData *notify_data, NMDhcp
|
|||
|
||||
if (notify_data->notify_type == NM_L3_CONFIG_NOTIFY_TYPE_PLATFORM_CHANGE_ON_IDLE) {
|
||||
const NMPlatformIP6Address *addr;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
addr = ipv6_lladdr_find(self);
|
||||
if (addr) {
|
||||
|
@ -549,8 +549,8 @@ l3_cfg_notify_cb(NML3Cfg *l3cfg, const NML3ConfigNotifyData *notify_data, NMDhcp
|
|||
gboolean
|
||||
nm_dhcp_client_start_ip6(NMDhcpClient *self, GError **error)
|
||||
{
|
||||
NMDhcpClientPrivate *priv;
|
||||
gs_unref_bytes GBytes * own_client_id = NULL;
|
||||
NMDhcpClientPrivate *priv;
|
||||
gs_unref_bytes GBytes *own_client_id = NULL;
|
||||
const NMPlatformIP6Address *addr;
|
||||
|
||||
g_return_val_if_fail(NM_IS_DHCP_CLIENT(self), FALSE);
|
||||
|
@ -588,7 +588,7 @@ nm_dhcp_client_stop_existing(const char *pid_file, const char *binary_name)
|
|||
{
|
||||
guint64 start_time;
|
||||
pid_t pid, ppid;
|
||||
const char * exe;
|
||||
const char *exe;
|
||||
char proc_path[NM_STRLEN("/proc/%lu/cmdline") + 100];
|
||||
gs_free char *pid_contents = NULL, *proc_contents = NULL;
|
||||
|
||||
|
@ -678,10 +678,10 @@ bytearray_variant_to_string(NMDhcpClient *self, GVariant *value, const char *key
|
|||
{
|
||||
const guint8 *array;
|
||||
gsize length;
|
||||
GString * str;
|
||||
GString *str;
|
||||
int i;
|
||||
unsigned char c;
|
||||
char * converted = NULL;
|
||||
char *converted = NULL;
|
||||
|
||||
g_return_val_if_fail(value != NULL, NULL);
|
||||
|
||||
|
@ -758,7 +758,7 @@ maybe_add_option(NMDhcpClient *self, GHashTable *hash, const char *key, GVariant
|
|||
*/
|
||||
if ((priv_opt_num = label_is_unknown_xyz(key)) > 0) {
|
||||
gs_free guint8 *check_val = NULL;
|
||||
char * hex_str = NULL;
|
||||
char *hex_str = NULL;
|
||||
gsize len;
|
||||
|
||||
/* dhclient passes values from dhcp private options in its own "string" format:
|
||||
|
@ -794,14 +794,14 @@ nm_dhcp_client_emit_ipv6_prefix_delegated(NMDhcpClient *self, const NMPlatformIP
|
|||
|
||||
gboolean
|
||||
nm_dhcp_client_handle_event(gpointer unused,
|
||||
const char * iface,
|
||||
const char *iface,
|
||||
int pid,
|
||||
GVariant * options,
|
||||
const char * reason,
|
||||
GVariant *options,
|
||||
const char *reason,
|
||||
NMDhcpClient *self)
|
||||
{
|
||||
NMDhcpClientPrivate * priv;
|
||||
guint32 new_state;
|
||||
NMDhcpClientPrivate *priv;
|
||||
guint32 new_state;
|
||||
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
|
||||
NMPlatformIP6Address prefix = {
|
||||
0,
|
||||
|
@ -833,8 +833,8 @@ nm_dhcp_client_handle_event(gpointer unused,
|
|||
if (NM_IN_SET(new_state, NM_DHCP_STATE_BOUND, NM_DHCP_STATE_EXTENDED)) {
|
||||
gs_unref_hashtable GHashTable *str_options = NULL;
|
||||
GVariantIter iter;
|
||||
const char * name;
|
||||
GVariant * value;
|
||||
const char *name;
|
||||
GVariant *value;
|
||||
|
||||
/* Copy options */
|
||||
str_options = g_hash_table_new_full(nm_str_hash, g_str_equal, g_free, g_free);
|
||||
|
@ -956,7 +956,7 @@ config_init(NMDhcpClientConfig *config, const NMDhcpClientConfig *src)
|
|||
}
|
||||
|
||||
if (!config->hostname && config->send_hostname) {
|
||||
const char * hostname;
|
||||
const char *hostname;
|
||||
gs_free char *hostname_tmp = NULL;
|
||||
|
||||
hostname = nm_hostname_manager_get_hostname(nm_hostname_manager_get());
|
||||
|
@ -1086,7 +1086,7 @@ nm_dhcp_client_init(NMDhcpClient *self)
|
|||
static void
|
||||
dispose(GObject *object)
|
||||
{
|
||||
NMDhcpClient * self = NM_DHCP_CLIENT(object);
|
||||
NMDhcpClient *self = NM_DHCP_CLIENT(object);
|
||||
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE(self);
|
||||
|
||||
nm_dhcp_client_stop(self, FALSE);
|
||||
|
@ -1102,7 +1102,7 @@ dispose(GObject *object)
|
|||
static void
|
||||
finalize(GObject *object)
|
||||
{
|
||||
NMDhcpClient * self = NM_DHCP_CLIENT(object);
|
||||
NMDhcpClient *self = NM_DHCP_CLIENT(object);
|
||||
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE(self);
|
||||
|
||||
config_clear(&priv->config);
|
||||
|
|
|
@ -271,19 +271,19 @@ void
|
|||
nm_dhcp_client_set_state(NMDhcpClient *self, NMDhcpState new_state, const NML3ConfigData *l3cd);
|
||||
|
||||
gboolean nm_dhcp_client_handle_event(gpointer unused,
|
||||
const char * iface,
|
||||
const char *iface,
|
||||
int pid,
|
||||
GVariant * options,
|
||||
const char * reason,
|
||||
GVariant *options,
|
||||
const char *reason,
|
||||
NMDhcpClient *self);
|
||||
|
||||
void nm_dhcp_client_emit_ipv6_prefix_delegated(NMDhcpClient * self,
|
||||
void nm_dhcp_client_emit_ipv6_prefix_delegated(NMDhcpClient *self,
|
||||
const NMPlatformIP6Address *prefix);
|
||||
|
||||
gboolean nm_dhcp_client_server_id_is_rejected(NMDhcpClient *self, gconstpointer addr);
|
||||
|
||||
int nm_dhcp_client_get_addr_family(NMDhcpClient *self);
|
||||
const char * nm_dhcp_client_get_iface(NMDhcpClient *self);
|
||||
const char *nm_dhcp_client_get_iface(NMDhcpClient *self);
|
||||
NMDedupMultiIndex *nm_dhcp_client_get_multi_idx(NMDhcpClient *self);
|
||||
int nm_dhcp_client_get_ifindex(NMDhcpClient *self);
|
||||
|
||||
|
|
|
@ -97,9 +97,9 @@ grab_request_options(GPtrArray *store, const char *line)
|
|||
}
|
||||
|
||||
static void
|
||||
add_ip4_config(GString * str,
|
||||
GBytes * client_id,
|
||||
const char * hostname,
|
||||
add_ip4_config(GString *str,
|
||||
GBytes *client_id,
|
||||
const char *hostname,
|
||||
gboolean use_fqdn,
|
||||
NMDhcpHostnameFlags hostname_flags)
|
||||
{
|
||||
|
@ -204,7 +204,7 @@ static GBytes *
|
|||
read_client_id(const char *str)
|
||||
{
|
||||
gs_free char *s = NULL;
|
||||
char * p;
|
||||
char *p;
|
||||
int i = 0, j = 0;
|
||||
|
||||
nm_assert(!strncmp(str, CLIENTID_TAG, NM_STRLEN(CLIENTID_TAG)));
|
||||
|
@ -258,7 +258,7 @@ static gboolean
|
|||
read_interface(const char *line, char *interface, guint size)
|
||||
{
|
||||
gs_free char *dup = g_strdup(line + NM_STRLEN("interface"));
|
||||
char * ptr = dup, *end;
|
||||
char *ptr = dup, *end;
|
||||
|
||||
while (g_ascii_isspace(*ptr))
|
||||
ptr++;
|
||||
|
@ -287,25 +287,25 @@ read_interface(const char *line, char *interface, guint size)
|
|||
}
|
||||
|
||||
char *
|
||||
nm_dhcp_dhclient_create_config(const char * interface,
|
||||
nm_dhcp_dhclient_create_config(const char *interface,
|
||||
int addr_family,
|
||||
GBytes * client_id,
|
||||
const char * anycast_address,
|
||||
const char * hostname,
|
||||
GBytes *client_id,
|
||||
const char *anycast_address,
|
||||
const char *hostname,
|
||||
guint32 timeout,
|
||||
gboolean use_fqdn,
|
||||
NMDhcpHostnameFlags hostname_flags,
|
||||
const char * mud_url,
|
||||
const char *const * reject_servers,
|
||||
const char * orig_path,
|
||||
const char * orig_contents,
|
||||
GBytes ** out_new_client_id)
|
||||
const char *mud_url,
|
||||
const char *const *reject_servers,
|
||||
const char *orig_path,
|
||||
const char *orig_contents,
|
||||
GBytes **out_new_client_id)
|
||||
{
|
||||
nm_auto_free_gstring GString *new_contents = NULL;
|
||||
gs_unref_ptrarray GPtrArray *fqdn_opts = NULL;
|
||||
gs_unref_ptrarray GPtrArray *reqs = NULL;
|
||||
gboolean reset_reqlist = FALSE;
|
||||
int i;
|
||||
nm_auto_free_gstring GString *new_contents = NULL;
|
||||
gs_unref_ptrarray GPtrArray *fqdn_opts = NULL;
|
||||
gs_unref_ptrarray GPtrArray *reqs = NULL;
|
||||
gboolean reset_reqlist = FALSE;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail(!anycast_address || nm_utils_hwaddr_valid(anycast_address, ETH_ALEN),
|
||||
NULL);
|
||||
|
@ -317,8 +317,8 @@ nm_dhcp_dhclient_create_config(const char * interface,
|
|||
reqs = g_ptr_array_new_full(5, g_free);
|
||||
|
||||
if (orig_contents) {
|
||||
gs_free const char **lines = NULL;
|
||||
gsize line_i;
|
||||
gs_free const char **lines = NULL;
|
||||
gsize line_i;
|
||||
nm_auto_free_gstring GString *blocks_stack = NULL;
|
||||
guint blocks_skip = 0;
|
||||
gboolean in_alsoreq = FALSE;
|
||||
|
@ -525,10 +525,10 @@ nm_dhcp_dhclient_create_config(const char * interface,
|
|||
char *
|
||||
nm_dhcp_dhclient_escape_duid(GBytes *duid)
|
||||
{
|
||||
char * escaped;
|
||||
char *escaped;
|
||||
const guint8 *s, *s0;
|
||||
gsize len;
|
||||
char * d;
|
||||
char *d;
|
||||
|
||||
g_return_val_if_fail(duid, NULL);
|
||||
|
||||
|
@ -562,7 +562,7 @@ isoctal(const guint8 *p)
|
|||
GBytes *
|
||||
nm_dhcp_dhclient_unescape_duid(const char *duid)
|
||||
{
|
||||
GByteArray * unescaped;
|
||||
GByteArray *unescaped;
|
||||
const guint8 *p = (const guint8 *) duid;
|
||||
guint i, len;
|
||||
guint8 octal;
|
||||
|
@ -609,7 +609,7 @@ error:
|
|||
GBytes *
|
||||
nm_dhcp_dhclient_read_duid(const char *leasefile, GError **error)
|
||||
{
|
||||
gs_free char * contents = NULL;
|
||||
gs_free char *contents = NULL;
|
||||
gs_free const char **contents_v = NULL;
|
||||
gsize i;
|
||||
|
||||
|
@ -622,7 +622,7 @@ nm_dhcp_dhclient_read_duid(const char *leasefile, GError **error)
|
|||
contents_v = nm_strsplit_set(contents, "\n\r");
|
||||
for (i = 0; contents_v && contents_v[i]; i++) {
|
||||
const char *p = nm_str_skip_leading_spaces(contents_v[i]);
|
||||
GBytes * duid;
|
||||
GBytes *duid;
|
||||
|
||||
if (!NM_STR_HAS_PREFIX(p, DUID_PREFIX))
|
||||
continue;
|
||||
|
@ -647,10 +647,10 @@ nm_dhcp_dhclient_read_duid(const char *leasefile, GError **error)
|
|||
gboolean
|
||||
nm_dhcp_dhclient_save_duid(const char *leasefile, GBytes *duid, GError **error)
|
||||
{
|
||||
gs_free char * escaped_duid = NULL;
|
||||
gs_free const char **lines = NULL;
|
||||
nm_auto_free_gstring GString *s = NULL;
|
||||
const char *const * iter;
|
||||
gs_free char *escaped_duid = NULL;
|
||||
gs_free const char **lines = NULL;
|
||||
nm_auto_free_gstring GString *s = NULL;
|
||||
const char *const *iter;
|
||||
gsize len = 0;
|
||||
|
||||
g_return_val_if_fail(leasefile != NULL, FALSE);
|
||||
|
|
|
@ -9,19 +9,19 @@
|
|||
#include "nm-setting-ip4-config.h"
|
||||
#include "nm-setting-ip6-config.h"
|
||||
|
||||
char *nm_dhcp_dhclient_create_config(const char * interface,
|
||||
char *nm_dhcp_dhclient_create_config(const char *interface,
|
||||
int addr_family,
|
||||
GBytes * client_id,
|
||||
const char * anycast_addr,
|
||||
const char * hostname,
|
||||
GBytes *client_id,
|
||||
const char *anycast_addr,
|
||||
const char *hostname,
|
||||
guint32 timeout,
|
||||
gboolean use_fqdn,
|
||||
NMDhcpHostnameFlags hostname_flags,
|
||||
const char * mud_url,
|
||||
const char *const * reject_servers,
|
||||
const char * orig_path,
|
||||
const char * orig_contents,
|
||||
GBytes ** out_new_client_id);
|
||||
const char *mud_url,
|
||||
const char *const *reject_servers,
|
||||
const char *orig_path,
|
||||
const char *orig_contents,
|
||||
GBytes **out_new_client_id);
|
||||
|
||||
char *nm_dhcp_dhclient_escape_duid(GBytes *duid);
|
||||
|
||||
|
|
|
@ -59,10 +59,10 @@ static GType nm_dhcp_dhclient_get_type(void);
|
|||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
char * conf_file;
|
||||
const char * def_leasefile;
|
||||
char * lease_file;
|
||||
char * pid_file;
|
||||
char *conf_file;
|
||||
const char *def_leasefile;
|
||||
char *lease_file;
|
||||
char *pid_file;
|
||||
NMDhcpListener *dhcp_listener;
|
||||
} NMDhcpDhclientPrivate;
|
||||
|
||||
|
@ -105,7 +105,7 @@ static char *
|
|||
get_dhclient_leasefile(int addr_family,
|
||||
const char *iface,
|
||||
const char *uuid,
|
||||
char ** out_preferred_path)
|
||||
char **out_preferred_path)
|
||||
{
|
||||
gs_free char *path = NULL;
|
||||
|
||||
|
@ -145,21 +145,21 @@ get_dhclient_leasefile(int addr_family,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
merge_dhclient_config(NMDhcpDhclient * self,
|
||||
merge_dhclient_config(NMDhcpDhclient *self,
|
||||
int addr_family,
|
||||
const char * iface,
|
||||
const char * conf_file,
|
||||
GBytes * client_id,
|
||||
const char * anycast_address,
|
||||
const char * hostname,
|
||||
const char *iface,
|
||||
const char *conf_file,
|
||||
GBytes *client_id,
|
||||
const char *anycast_address,
|
||||
const char *hostname,
|
||||
guint32 timeout,
|
||||
gboolean use_fqdn,
|
||||
NMDhcpHostnameFlags hostname_flags,
|
||||
const char * mud_url,
|
||||
const char *const * reject_servers,
|
||||
const char * orig_path,
|
||||
GBytes ** out_new_client_id,
|
||||
GError ** error)
|
||||
const char *mud_url,
|
||||
const char *const *reject_servers,
|
||||
const char *orig_path,
|
||||
GBytes **out_new_client_id,
|
||||
GError **error)
|
||||
{
|
||||
gs_free char *orig = NULL;
|
||||
gs_free char *new = NULL;
|
||||
|
@ -274,19 +274,19 @@ find_existing_config(NMDhcpDhclient *self, int addr_family, const char *iface, c
|
|||
* config file along with the NM options.
|
||||
*/
|
||||
static char *
|
||||
create_dhclient_config(NMDhcpDhclient * self,
|
||||
create_dhclient_config(NMDhcpDhclient *self,
|
||||
int addr_family,
|
||||
const char * iface,
|
||||
const char * uuid,
|
||||
GBytes * client_id,
|
||||
const char * anycast_address,
|
||||
const char * hostname,
|
||||
const char *iface,
|
||||
const char *uuid,
|
||||
GBytes *client_id,
|
||||
const char *anycast_address,
|
||||
const char *hostname,
|
||||
guint32 timeout,
|
||||
gboolean use_fqdn,
|
||||
NMDhcpHostnameFlags hostname_flags,
|
||||
const char * mud_url,
|
||||
const char *const * reject_servers,
|
||||
GBytes ** out_new_client_id)
|
||||
const char *mud_url,
|
||||
const char *const *reject_servers,
|
||||
GBytes **out_new_client_id)
|
||||
{
|
||||
gs_free char *orig = NULL;
|
||||
char *new = NULL;
|
||||
|
@ -330,27 +330,27 @@ create_dhclient_config(NMDhcpDhclient * self,
|
|||
|
||||
static gboolean
|
||||
dhclient_start(NMDhcpClient *client,
|
||||
const char * mode_opt,
|
||||
const char *mode_opt,
|
||||
gboolean release,
|
||||
pid_t * out_pid,
|
||||
GError ** error)
|
||||
pid_t *out_pid,
|
||||
GError **error)
|
||||
{
|
||||
NMDhcpDhclient * self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE(self);
|
||||
NMDhcpDhclient *self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE(self);
|
||||
gs_unref_ptrarray GPtrArray *argv = NULL;
|
||||
pid_t pid;
|
||||
gs_free_error GError * local = NULL;
|
||||
const char * iface;
|
||||
const char * uuid;
|
||||
const char * system_bus_address;
|
||||
const char * dhclient_path;
|
||||
char * binary_name;
|
||||
gs_free char * cmd_str = NULL;
|
||||
gs_free char * pid_file = NULL;
|
||||
gs_free char * system_bus_address_env = NULL;
|
||||
gs_free char * preferred_leasefile_path = NULL;
|
||||
int addr_family;
|
||||
const NMDhcpClientConfig *client_config;
|
||||
gs_free_error GError *local = NULL;
|
||||
const char *iface;
|
||||
const char *uuid;
|
||||
const char *system_bus_address;
|
||||
const char *dhclient_path;
|
||||
char *binary_name;
|
||||
gs_free char *cmd_str = NULL;
|
||||
gs_free char *pid_file = NULL;
|
||||
gs_free char *system_bus_address_env = NULL;
|
||||
gs_free char *preferred_leasefile_path = NULL;
|
||||
int addr_family;
|
||||
const NMDhcpClientConfig *client_config;
|
||||
|
||||
g_return_val_if_fail(!priv->pid_file, FALSE);
|
||||
client_config = nm_dhcp_client_get_config(client);
|
||||
|
@ -515,9 +515,9 @@ dhclient_start(NMDhcpClient *client,
|
|||
static gboolean
|
||||
ip4_start(NMDhcpClient *client, GError **error)
|
||||
{
|
||||
NMDhcpDhclient * self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE(self);
|
||||
gs_unref_bytes GBytes * new_client_id = NULL;
|
||||
NMDhcpDhclient *self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE(self);
|
||||
gs_unref_bytes GBytes *new_client_id = NULL;
|
||||
const NMDhcpClientConfig *client_config;
|
||||
|
||||
client_config = nm_dhcp_client_get_config(client);
|
||||
|
@ -552,8 +552,8 @@ ip4_start(NMDhcpClient *client, GError **error)
|
|||
static gboolean
|
||||
ip6_start(NMDhcpClient *client, const struct in6_addr *ll_addr, GError **error)
|
||||
{
|
||||
NMDhcpDhclient * self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclientPrivate * priv = NM_DHCP_DHCLIENT_GET_PRIVATE(self);
|
||||
NMDhcpDhclient *self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE(self);
|
||||
const NMDhcpClientConfig *config;
|
||||
|
||||
config = nm_dhcp_client_get_config(client);
|
||||
|
@ -587,7 +587,7 @@ ip6_start(NMDhcpClient *client, const struct in6_addr *ll_addr, GError **error)
|
|||
static void
|
||||
stop(NMDhcpClient *client, gboolean release)
|
||||
{
|
||||
NMDhcpDhclient * self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclient *self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE(self);
|
||||
int errsv;
|
||||
|
||||
|
@ -625,12 +625,12 @@ stop(NMDhcpClient *client, gboolean release)
|
|||
static GBytes *
|
||||
get_duid(NMDhcpClient *client)
|
||||
{
|
||||
NMDhcpDhclient * self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclientPrivate * priv = NM_DHCP_DHCLIENT_GET_PRIVATE(self);
|
||||
NMDhcpDhclient *self = NM_DHCP_DHCLIENT(client);
|
||||
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE(self);
|
||||
const NMDhcpClientConfig *client_config;
|
||||
GBytes * duid = NULL;
|
||||
gs_free char * leasefile = NULL;
|
||||
GError * error = NULL;
|
||||
GBytes *duid = NULL;
|
||||
gs_free char *leasefile = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
client_config = nm_dhcp_client_get_config(client);
|
||||
|
||||
|
@ -712,7 +712,7 @@ static void
|
|||
nm_dhcp_dhclient_class_init(NMDhcpDhclientClass *dhclient_class)
|
||||
{
|
||||
NMDhcpClientClass *client_class = NM_DHCP_CLIENT_CLASS(dhclient_class);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(dhclient_class);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(dhclient_class);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
||||
|
|
|
@ -34,10 +34,10 @@ static GType nm_dhcp_dhcpcanon_get_type(void);
|
|||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
char * conf_file;
|
||||
const char * def_leasefile;
|
||||
char * lease_file;
|
||||
char * pid_file;
|
||||
char *conf_file;
|
||||
const char *def_leasefile;
|
||||
char *lease_file;
|
||||
char *pid_file;
|
||||
NMDhcpListener *dhcp_listener;
|
||||
} NMDhcpDhcpcanonPrivate;
|
||||
|
||||
|
@ -65,25 +65,25 @@ nm_dhcp_dhcpcanon_get_path(void)
|
|||
|
||||
static gboolean
|
||||
dhcpcanon_start(NMDhcpClient *client,
|
||||
const char * mode_opt,
|
||||
GBytes * duid,
|
||||
const char *mode_opt,
|
||||
GBytes *duid,
|
||||
gboolean release,
|
||||
pid_t * out_pid,
|
||||
pid_t *out_pid,
|
||||
guint needed_prefixes,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
NMDhcpDhcpcanon * self = NM_DHCP_DHCPCANON(client);
|
||||
NMDhcpDhcpcanonPrivate *priv = NM_DHCP_DHCPCANON_GET_PRIVATE(self);
|
||||
NMDhcpDhcpcanon *self = NM_DHCP_DHCPCANON(client);
|
||||
NMDhcpDhcpcanonPrivate *priv = NM_DHCP_DHCPCANON_GET_PRIVATE(self);
|
||||
gs_unref_ptrarray GPtrArray *argv = NULL;
|
||||
pid_t pid;
|
||||
gs_free_error GError *local = NULL;
|
||||
const char * iface;
|
||||
const char * system_bus_address;
|
||||
const char * dhcpcanon_path;
|
||||
gs_free char * binary_name = NULL;
|
||||
gs_free char * pid_file = NULL;
|
||||
gs_free char * system_bus_address_env = NULL;
|
||||
int addr_family;
|
||||
gs_free_error GError *local = NULL;
|
||||
const char *iface;
|
||||
const char *system_bus_address;
|
||||
const char *dhcpcanon_path;
|
||||
gs_free char *binary_name = NULL;
|
||||
gs_free char *pid_file = NULL;
|
||||
gs_free char *system_bus_address_env = NULL;
|
||||
int addr_family;
|
||||
|
||||
g_return_val_if_fail(!priv->pid_file, FALSE);
|
||||
|
||||
|
@ -168,7 +168,7 @@ ip4_start(NMDhcpClient *client, GError **error)
|
|||
static void
|
||||
stop(NMDhcpClient *client, gboolean release)
|
||||
{
|
||||
NMDhcpDhcpcanon * self = NM_DHCP_DHCPCANON(client);
|
||||
NMDhcpDhcpcanon *self = NM_DHCP_DHCPCANON(client);
|
||||
NMDhcpDhcpcanonPrivate *priv = NM_DHCP_DHCPCANON_GET_PRIVATE(self);
|
||||
int errsv;
|
||||
|
||||
|
@ -222,7 +222,7 @@ static void
|
|||
nm_dhcp_dhcpcanon_class_init(NMDhcpDhcpcanonClass *dhcpcanon_class)
|
||||
{
|
||||
NMDhcpClientClass *client_class = NM_DHCP_CLIENT_CLASS(dhcpcanon_class);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(dhcpcanon_class);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(dhcpcanon_class);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
||||
|
|
|
@ -66,13 +66,13 @@ nm_dhcp_dhcpcd_get_path(void)
|
|||
static gboolean
|
||||
ip4_start(NMDhcpClient *client, GError **error)
|
||||
{
|
||||
NMDhcpDhcpcd * self = NM_DHCP_DHCPCD(client);
|
||||
const NMDhcpClientConfig *client_config;
|
||||
NMDhcpDhcpcd *self = NM_DHCP_DHCPCD(client);
|
||||
const NMDhcpClientConfig *client_config;
|
||||
gs_unref_ptrarray GPtrArray *argv = NULL;
|
||||
pid_t pid;
|
||||
GError * local;
|
||||
gs_free char * cmd_str = NULL;
|
||||
const char * dhcpcd_path;
|
||||
GError *local;
|
||||
gs_free char *cmd_str = NULL;
|
||||
const char *dhcpcd_path;
|
||||
|
||||
pid = nm_dhcp_client_get_pid(client);
|
||||
g_return_val_if_fail(pid == -1, FALSE);
|
||||
|
@ -219,7 +219,7 @@ static void
|
|||
nm_dhcp_dhcpcd_class_init(NMDhcpDhcpcdClass *dhcpcd_class)
|
||||
{
|
||||
NMDhcpClientClass *client_class = NM_DHCP_CLIENT_CLASS(dhcpcd_class);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(dhcpcd_class);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(dhcpcd_class);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
||||
|
|
|
@ -61,9 +61,9 @@ build_signal_parameters(void)
|
|||
for (environ_iter = (const char *const *) environ; *environ_iter; environ_iter++) {
|
||||
static const char *const ignore_with_prefix_list[] =
|
||||
{"PATH", "SHLVL", "_", "PWD", "dhc_dbus", NULL};
|
||||
const char * item = *environ_iter;
|
||||
gs_free char * name = NULL;
|
||||
const char * val;
|
||||
const char *item = *environ_iter;
|
||||
gs_free char *name = NULL;
|
||||
const char *val;
|
||||
const char *const *p;
|
||||
|
||||
val = strchr(item, '=');
|
||||
|
@ -119,13 +119,13 @@ int
|
|||
main(int argc, char *argv[])
|
||||
{
|
||||
gs_unref_object GDBusConnection *connection = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *parameters = NULL;
|
||||
gs_unref_variant GVariant *result = NULL;
|
||||
gboolean success = FALSE;
|
||||
guint try_count;
|
||||
gint64 time_start;
|
||||
gint64 time_end;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_unref_variant GVariant *parameters = NULL;
|
||||
gs_unref_variant GVariant *result = NULL;
|
||||
gboolean success = FALSE;
|
||||
guint try_count;
|
||||
gint64 time_start;
|
||||
gint64 time_end;
|
||||
|
||||
/* Connecting to the unix socket can fail with EAGAIN if there are too
|
||||
* many pending connections and the server can't accept them in time
|
||||
|
|
|
@ -50,7 +50,7 @@ typedef struct {
|
|||
NMDBusManager *dbus_mgr;
|
||||
gulong new_conn_id;
|
||||
gulong dis_conn_id;
|
||||
GHashTable * connections;
|
||||
GHashTable *connections;
|
||||
} NMDhcpListenerPrivate;
|
||||
|
||||
struct _NMDhcpListener {
|
||||
|
@ -98,10 +98,10 @@ NM_DEFINE_SINGLETON_GETTER(NMDhcpListener, nm_dhcp_listener_get, NM_TYPE_DHCP_LI
|
|||
static char *
|
||||
get_option(GVariant *options, const char *key)
|
||||
{
|
||||
GVariant * value;
|
||||
GVariant *value;
|
||||
const guchar *bytes, *s;
|
||||
gsize len;
|
||||
char * converted, *d;
|
||||
char *converted, *d;
|
||||
|
||||
if (!g_variant_lookup(options, key, "@ay", &value))
|
||||
return NULL;
|
||||
|
@ -130,9 +130,9 @@ get_option(GVariant *options, const char *key)
|
|||
static void
|
||||
_method_call_handle(NMDhcpListener *self, GVariant *parameters)
|
||||
{
|
||||
gs_free char * iface = NULL;
|
||||
gs_free char * pid_str = NULL;
|
||||
gs_free char * reason = NULL;
|
||||
gs_free char *iface = NULL;
|
||||
gs_free char *pid_str = NULL;
|
||||
gs_free char *reason = NULL;
|
||||
gs_unref_variant GVariant *options = NULL;
|
||||
int pid;
|
||||
gboolean handled = FALSE;
|
||||
|
@ -169,12 +169,12 @@ _method_call_handle(NMDhcpListener *self, GVariant *parameters)
|
|||
}
|
||||
|
||||
static void
|
||||
_method_call(GDBusConnection * connection,
|
||||
const char * sender,
|
||||
const char * object_path,
|
||||
const char * interface_name,
|
||||
const char * method_name,
|
||||
GVariant * parameters,
|
||||
_method_call(GDBusConnection *connection,
|
||||
const char *sender,
|
||||
const char *object_path,
|
||||
const char *interface_name,
|
||||
const char *method_name,
|
||||
GVariant *parameters,
|
||||
GDBusMethodInvocation *invocation,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@ -219,14 +219,14 @@ _dbus_connection_register_object(NMDhcpListener *self, GDBusConnection *connecti
|
|||
}
|
||||
|
||||
static void
|
||||
new_connection_cb(NMDBusManager * mgr,
|
||||
GDBusConnection * connection,
|
||||
new_connection_cb(NMDBusManager *mgr,
|
||||
GDBusConnection *connection,
|
||||
GDBusObjectManager *manager,
|
||||
NMDhcpListener * self)
|
||||
NMDhcpListener *self)
|
||||
{
|
||||
NMDhcpListenerPrivate *priv = NM_DHCP_LISTENER_GET_PRIVATE(self);
|
||||
guint registration_id;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* it is important to register the object during the new-connection signal,
|
||||
* as this avoids races with the connecting object. */
|
||||
|
|
|
@ -130,7 +130,7 @@ _client_factory_get_gtype(const NMDhcpClientFactory *client_factory, int addr_fa
|
|||
NMDhcpClient *
|
||||
nm_dhcp_manager_start_client(NMDhcpManager *self, NMDhcpClientConfig *config, GError **error)
|
||||
{
|
||||
NMDhcpManagerPrivate *priv;
|
||||
NMDhcpManagerPrivate *priv;
|
||||
gs_unref_object NMDhcpClient *client = NULL;
|
||||
gboolean success = FALSE;
|
||||
gsize hwaddr_len;
|
||||
|
@ -238,10 +238,10 @@ nmtst_dhcp_manager_unget(gpointer self)
|
|||
static void
|
||||
nm_dhcp_manager_init(NMDhcpManager *self)
|
||||
{
|
||||
NMDhcpManagerPrivate * priv = NM_DHCP_MANAGER_GET_PRIVATE(self);
|
||||
NMConfig * config = nm_config_get();
|
||||
gs_free char * client_free = NULL;
|
||||
const char * client;
|
||||
NMDhcpManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE(self);
|
||||
NMConfig *config = nm_config_get();
|
||||
gs_free char *client_free = NULL;
|
||||
const char *client;
|
||||
int i;
|
||||
const NMDhcpClientFactory *client_factory = NULL;
|
||||
|
||||
|
|
|
@ -48,11 +48,11 @@ typedef struct _NMDhcpNettoolsClass NMDhcpNettoolsClass;
|
|||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
NDhcp4Client * client;
|
||||
NDhcp4Client *client;
|
||||
NDhcp4ClientProbe *probe;
|
||||
NDhcp4ClientLease *lease;
|
||||
GSource * event_source;
|
||||
char * lease_file;
|
||||
GSource *event_source;
|
||||
char *lease_file;
|
||||
} NMDhcpNettoolsPrivate;
|
||||
|
||||
struct _NMDhcpNettools {
|
||||
|
@ -86,8 +86,8 @@ set_error_nettools(GError **error, int r, const char *message)
|
|||
static inline int
|
||||
_client_lease_query(NDhcp4ClientLease *lease,
|
||||
uint8_t option,
|
||||
const uint8_t ** datap,
|
||||
size_t * n_datap)
|
||||
const uint8_t **datap,
|
||||
size_t *n_datap)
|
||||
{
|
||||
return n_dhcp4_client_lease_query(lease, option, (guint8 **) datap, n_datap);
|
||||
}
|
||||
|
@ -100,11 +100,11 @@ _client_lease_query(NDhcp4ClientLease *lease,
|
|||
|
||||
static gboolean
|
||||
lease_option_consume_route(const uint8_t **datap,
|
||||
size_t * n_datap,
|
||||
size_t *n_datap,
|
||||
gboolean classless,
|
||||
in_addr_t * destp,
|
||||
uint8_t * plenp,
|
||||
in_addr_t * gatewayp)
|
||||
in_addr_t *destp,
|
||||
uint8_t *plenp,
|
||||
in_addr_t *gatewayp)
|
||||
{
|
||||
in_addr_t dest;
|
||||
in_addr_t gateway;
|
||||
|
@ -152,9 +152,9 @@ lease_option_consume_route(const uint8_t **datap,
|
|||
|
||||
static gboolean
|
||||
lease_parse_address(NDhcp4ClientLease *lease,
|
||||
NML3ConfigData * l3cd,
|
||||
GHashTable * options,
|
||||
GError ** error)
|
||||
NML3ConfigData *l3cd,
|
||||
GHashTable *options,
|
||||
GError **error)
|
||||
{
|
||||
struct in_addr a_address;
|
||||
in_addr_t a_netmask;
|
||||
|
@ -164,7 +164,7 @@ lease_parse_address(NDhcp4ClientLease *lease,
|
|||
guint32 a_lifetime;
|
||||
guint32 a_timestamp;
|
||||
guint64 a_expiry;
|
||||
const guint8 * l_data;
|
||||
const guint8 *l_data;
|
||||
gsize l_data_len;
|
||||
int r;
|
||||
|
||||
|
@ -272,11 +272,11 @@ lease_parse_address(NDhcp4ClientLease *lease,
|
|||
}
|
||||
|
||||
static void
|
||||
lease_parse_address_list(NDhcp4ClientLease * lease,
|
||||
NML3ConfigData * l3cd,
|
||||
lease_parse_address_list(NDhcp4ClientLease *lease,
|
||||
NML3ConfigData *l3cd,
|
||||
NMDhcpOptionDhcp4Options option,
|
||||
GHashTable * options,
|
||||
NMStrBuf * sbuf)
|
||||
GHashTable *options,
|
||||
NMStrBuf *sbuf)
|
||||
{
|
||||
const guint8 *l_data;
|
||||
gsize l_data_len;
|
||||
|
@ -325,9 +325,9 @@ lease_parse_address_list(NDhcp4ClientLease * lease,
|
|||
|
||||
static void
|
||||
lease_parse_routes(NDhcp4ClientLease *lease,
|
||||
NML3ConfigData * l3cd,
|
||||
GHashTable * options,
|
||||
NMStrBuf * sbuf)
|
||||
NML3ConfigData *l3cd,
|
||||
GHashTable *options,
|
||||
NMStrBuf *sbuf)
|
||||
{
|
||||
char dest_str[NM_UTILS_INET_ADDRSTRLEN];
|
||||
char gateway_str[NM_UTILS_INET_ADDRSTRLEN];
|
||||
|
@ -482,7 +482,7 @@ static void
|
|||
lease_parse_search_domains(NDhcp4ClientLease *lease, NML3ConfigData *l3cd, GHashTable *options)
|
||||
{
|
||||
gs_strfreev char **domains = NULL;
|
||||
const guint8 * l_data;
|
||||
const guint8 *l_data;
|
||||
gsize l_data_len;
|
||||
guint i;
|
||||
int r;
|
||||
|
@ -534,21 +534,21 @@ lease_parse_private_options(NDhcp4ClientLease *lease, GHashTable *options)
|
|||
|
||||
static NML3ConfigData *
|
||||
lease_to_ip4_config(NMDedupMultiIndex *multi_idx,
|
||||
const char * iface,
|
||||
const char *iface,
|
||||
int ifindex,
|
||||
NDhcp4ClientLease *lease,
|
||||
GError ** error)
|
||||
GError **error)
|
||||
{
|
||||
nm_auto_str_buf NMStrBuf sbuf = NM_STR_BUF_INIT(0, FALSE);
|
||||
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
|
||||
gs_unref_hashtable GHashTable *options = NULL;
|
||||
const guint8 * l_data;
|
||||
gsize l_data_len;
|
||||
const char * v_str;
|
||||
guint16 v_u16;
|
||||
in_addr_t v_inaddr;
|
||||
struct in_addr v_inaddr_s;
|
||||
int r;
|
||||
nm_auto_str_buf NMStrBuf sbuf = NM_STR_BUF_INIT(0, FALSE);
|
||||
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
|
||||
gs_unref_hashtable GHashTable *options = NULL;
|
||||
const guint8 *l_data;
|
||||
gsize l_data_len;
|
||||
const char *v_str;
|
||||
guint16 v_u16;
|
||||
in_addr_t v_inaddr;
|
||||
struct in_addr v_inaddr_s;
|
||||
int r;
|
||||
|
||||
g_return_val_if_fail(lease != NULL, NULL);
|
||||
|
||||
|
@ -667,7 +667,7 @@ lease_to_ip4_config(NMDedupMultiIndex *multi_idx,
|
|||
* Otherwise, we allow any encoding and backslash-escape the result to
|
||||
* UTF-8. */
|
||||
gs_free char *to_free = NULL;
|
||||
const char * escaped;
|
||||
const char *escaped;
|
||||
|
||||
escaped = nm_utils_buf_utf8safe_escape((char *) l_data, l_data_len, 0, &to_free);
|
||||
nm_dhcp_option_add_option(options,
|
||||
|
@ -740,7 +740,7 @@ lease_save(NMDhcpNettools *self, NDhcp4ClientLease *lease, const char *lease_fil
|
|||
struct in_addr a_address;
|
||||
nm_auto_str_buf NMStrBuf sbuf = NM_STR_BUF_INIT(NM_UTILS_GET_NEXT_REALLOC_SIZE_104, FALSE);
|
||||
char addr_str[NM_UTILS_INET_ADDRSTRLEN];
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
nm_assert(lease);
|
||||
nm_assert(lease_file);
|
||||
|
@ -761,11 +761,11 @@ lease_save(NMDhcpNettools *self, NDhcp4ClientLease *lease, const char *lease_fil
|
|||
static void
|
||||
bound4_handle(NMDhcpNettools *self, NDhcp4ClientLease *lease, gboolean extended)
|
||||
{
|
||||
NMDhcpNettoolsPrivate * priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
NMDhcpClient * client = NM_DHCP_CLIENT(self);
|
||||
const NMDhcpClientConfig *client_config;
|
||||
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
NMDhcpClient *client = NM_DHCP_CLIENT(self);
|
||||
const NMDhcpClientConfig *client_config;
|
||||
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
|
||||
GError * error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
_LOGT("lease available (%s)", extended ? "extended" : "new");
|
||||
client_config = nm_dhcp_client_get_config(client);
|
||||
|
@ -791,7 +791,7 @@ bound4_handle(NMDhcpNettools *self, NDhcp4ClientLease *lease, gboolean extended)
|
|||
static void
|
||||
dhcp4_event_handle(NMDhcpNettools *self, NDhcp4ClientEvent *event)
|
||||
{
|
||||
NMDhcpNettoolsPrivate * priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
const NMDhcpClientConfig *client_config;
|
||||
struct in_addr server_id;
|
||||
char addr_str[INET_ADDRSTRLEN];
|
||||
|
@ -861,9 +861,9 @@ dhcp4_event_handle(NMDhcpNettools *self, NDhcp4ClientEvent *event)
|
|||
static gboolean
|
||||
dhcp4_event_cb(int fd, GIOCondition condition, gpointer user_data)
|
||||
{
|
||||
NMDhcpNettools * self = user_data;
|
||||
NMDhcpNettools *self = user_data;
|
||||
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
NDhcp4ClientEvent * event;
|
||||
NDhcp4ClientEvent *event;
|
||||
int r;
|
||||
|
||||
r = n_dhcp4_client_dispatch(priv->client);
|
||||
|
@ -892,19 +892,19 @@ nettools_create(NMDhcpNettools *self, GError **error)
|
|||
{
|
||||
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
nm_auto(n_dhcp4_client_config_freep) NDhcp4ClientConfig *config = NULL;
|
||||
nm_auto(n_dhcp4_client_unrefp) NDhcp4Client * client = NULL;
|
||||
GBytes * hwaddr;
|
||||
GBytes * bcast_hwaddr;
|
||||
const uint8_t * hwaddr_arr;
|
||||
const uint8_t * bcast_hwaddr_arr;
|
||||
nm_auto(n_dhcp4_client_unrefp) NDhcp4Client *client = NULL;
|
||||
GBytes *hwaddr;
|
||||
GBytes *bcast_hwaddr;
|
||||
const uint8_t *hwaddr_arr;
|
||||
const uint8_t *bcast_hwaddr_arr;
|
||||
gsize hwaddr_len;
|
||||
gsize bcast_hwaddr_len;
|
||||
GBytes * client_id;
|
||||
gs_unref_bytes GBytes * client_id_new = NULL;
|
||||
const uint8_t * client_id_arr;
|
||||
size_t client_id_len;
|
||||
int r, fd, arp_type, transport;
|
||||
const NMDhcpClientConfig *client_config;
|
||||
GBytes *client_id;
|
||||
gs_unref_bytes GBytes *client_id_new = NULL;
|
||||
const uint8_t *client_id_arr;
|
||||
size_t client_id_len;
|
||||
int r, fd, arp_type, transport;
|
||||
const NMDhcpClientConfig *client_config;
|
||||
|
||||
client_config = nm_dhcp_client_get_config(NM_DHCP_CLIENT(self));
|
||||
|
||||
|
@ -991,7 +991,7 @@ nettools_create(NMDhcpNettools *self, GError **error)
|
|||
static gboolean
|
||||
_accept(NMDhcpClient *client, GError **error)
|
||||
{
|
||||
NMDhcpNettools * self = NM_DHCP_NETTOOLS(client);
|
||||
NMDhcpNettools *self = NM_DHCP_NETTOOLS(client);
|
||||
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
int r;
|
||||
|
||||
|
@ -1013,7 +1013,7 @@ _accept(NMDhcpClient *client, GError **error)
|
|||
static gboolean
|
||||
decline(NMDhcpClient *client, const char *error_message, GError **error)
|
||||
{
|
||||
NMDhcpNettools * self = NM_DHCP_NETTOOLS(client);
|
||||
NMDhcpNettools *self = NM_DHCP_NETTOOLS(client);
|
||||
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
int r;
|
||||
|
||||
|
@ -1052,10 +1052,10 @@ static gboolean
|
|||
ip4_start(NMDhcpClient *client, GError **error)
|
||||
{
|
||||
nm_auto(n_dhcp4_client_probe_config_freep) NDhcp4ClientProbeConfig *config = NULL;
|
||||
NMDhcpNettools * self = NM_DHCP_NETTOOLS(client);
|
||||
NMDhcpNettoolsPrivate * priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
NMDhcpNettools *self = NM_DHCP_NETTOOLS(client);
|
||||
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
const NMDhcpClientConfig *client_config;
|
||||
gs_free char * lease_file = NULL;
|
||||
gs_free char *lease_file = NULL;
|
||||
struct in_addr last_addr = {0};
|
||||
int r, i;
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ ip4_start(NMDhcpClient *client, GError **error)
|
|||
static void
|
||||
stop(NMDhcpClient *client, gboolean release)
|
||||
{
|
||||
NMDhcpNettools * self = NM_DHCP_NETTOOLS(client);
|
||||
NMDhcpNettools *self = NM_DHCP_NETTOOLS(client);
|
||||
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||
|
||||
NM_DHCP_CLIENT_CLASS(nm_dhcp_nettools_parent_class)->stop(client, release);
|
||||
|
@ -1248,7 +1248,7 @@ static void
|
|||
nm_dhcp_nettools_class_init(NMDhcpNettoolsClass *class)
|
||||
{
|
||||
NMDhcpClientClass *client_class = NM_DHCP_CLIENT_CLASS(class);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(class);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(class);
|
||||
|
||||
object_class->dispose = dispose;
|
||||
|
||||
|
|
|
@ -396,14 +396,14 @@ nm_dhcp_option_add_option(GHashTable *options, int addr_family, guint option, co
|
|||
}
|
||||
|
||||
void
|
||||
nm_dhcp_option_add_option_utf8safe_escape(GHashTable * options,
|
||||
nm_dhcp_option_add_option_utf8safe_escape(GHashTable *options,
|
||||
int addr_family,
|
||||
guint option,
|
||||
const guint8 *data,
|
||||
gsize n_data)
|
||||
{
|
||||
gs_free char *to_free = NULL;
|
||||
const char * escaped;
|
||||
const char *escaped;
|
||||
|
||||
escaped = nm_utils_buf_utf8safe_escape((char *) data,
|
||||
n_data,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue