| 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 | /* |
| 3 | * Copyright (C) 2007 - 2014 Red Hat, Inc. |
| 4 | * Copyright (C) 2008 Novell, Inc. |
| 5 | */ |
| 6 | |
| 7 | #ifndef __NM_ACTIVE_CONNECTION_H__ |
| 8 | #define __NM_ACTIVE_CONNECTION_H__ |
| 9 | |
| 10 | #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) |
| 11 | #error "Only <NetworkManager.h> can be included directly." |
| 12 | #endif |
| 13 | |
| 14 | #include "nm-object.h" |
| 15 | |
| 16 | G_BEGIN_DECLS |
| 17 | |
| 18 | #define NM_TYPE_ACTIVE_CONNECTION (nm_active_connection_get_type()) |
| 19 | #define NM_ACTIVE_CONNECTION(obj) \ |
| 20 | (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnection)) |
| 21 | #define NM_ACTIVE_CONNECTION_CLASS(klass) \ |
| 22 | (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionClass)) |
| 23 | #define NM_IS_ACTIVE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_ACTIVE_CONNECTION)) |
| 24 | #define NM_IS_ACTIVE_CONNECTION_CLASS(klass) \ |
| 25 | (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_ACTIVE_CONNECTION)) |
| 26 | #define NM_ACTIVE_CONNECTION_GET_CLASS(obj) \ |
| 27 | (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionClass)) |
| 28 | |
| 29 | #define NM_ACTIVE_CONNECTION_CONNECTION "connection" |
| 30 | #define NM_ACTIVE_CONNECTION_ID "id" |
| 31 | #define NM_ACTIVE_CONNECTION_UUID "uuid" |
| 32 | #define NM_ACTIVE_CONNECTION_TYPE "type" |
| 33 | #define NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT_PATH "specific-object-path" |
| 34 | #define NM_ACTIVE_CONNECTION_DEVICES "devices" |
| 35 | #define NM_ACTIVE_CONNECTION_STATE "state" |
| 36 | #define NM_ACTIVE_CONNECTION_STATE_FLAGS "state-flags" |
| 37 | #define NM_ACTIVE_CONNECTION_DEFAULT "default" |
| 38 | #define NM_ACTIVE_CONNECTION_IP4_CONFIG "ip4-config" |
| 39 | #define NM_ACTIVE_CONNECTION_DHCP4_CONFIG "dhcp4-config" |
| 40 | #define NM_ACTIVE_CONNECTION_DEFAULT6 "default6" |
| 41 | #define NM_ACTIVE_CONNECTION_IP6_CONFIG "ip6-config" |
| 42 | #define NM_ACTIVE_CONNECTION_DHCP6_CONFIG "dhcp6-config" |
| 43 | #define NM_ACTIVE_CONNECTION_VPN "vpn" |
| 44 | #define NM_ACTIVE_CONNECTION_MASTER "master" |
| 45 | #define NM_ACTIVE_CONNECTION_CONTROLLER "controller" |
| 46 | |
| 47 | /** |
| 48 | * NMActiveConnection: |
| 49 | */ |
| 50 | typedef struct _NMActiveConnection NMActiveConnection; |
| 51 | typedef struct _NMActiveConnectionClass NMActiveConnectionClass; |
| 52 | |
| 53 | GType nm_active_connection_get_type(void); |
| 54 | |
| 55 | NMRemoteConnection *nm_active_connection_get_connection(NMActiveConnection *connection); |
| 56 | const char *nm_active_connection_get_id(NMActiveConnection *connection); |
| 57 | const char *nm_active_connection_get_uuid(NMActiveConnection *connection); |
| 58 | const char *nm_active_connection_get_connection_type(NMActiveConnection *connection); |
| 59 | const char *nm_active_connection_get_specific_object_path(NMActiveConnection *connection); |
| 60 | const GPtrArray *nm_active_connection_get_devices(NMActiveConnection *connection); |
| 61 | NMActiveConnectionState nm_active_connection_get_state(NMActiveConnection *connection); |
| 62 | NM_AVAILABLE_IN_1_10 |
| 63 | NMActivationStateFlags nm_active_connection_get_state_flags(NMActiveConnection *connection); |
| 64 | NM_AVAILABLE_IN_1_8 |
| 65 | NMActiveConnectionStateReason nm_active_connection_get_state_reason(NMActiveConnection *connection); |
| 66 | |
| 67 | struct _NMDevice; |
| 68 | |
| 69 | _NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_44 |
| 70 | struct _NMDevice *nm_active_connection_get_master(NMActiveConnection *connection); |
| 71 | NM_AVAILABLE_IN_1_44 |
| 72 | struct _NMDevice *nm_active_connection_get_controller(NMActiveConnection *connection); |
| 73 | |
| 74 | gboolean nm_active_connection_get_default(NMActiveConnection *connection); |
| 75 | NMIPConfig *nm_active_connection_get_ip4_config(NMActiveConnection *connection); |
| 76 | NMDhcpConfig *nm_active_connection_get_dhcp4_config(NMActiveConnection *connection); |
| 77 | gboolean nm_active_connection_get_default6(NMActiveConnection *connection); |
| 78 | NMIPConfig *nm_active_connection_get_ip6_config(NMActiveConnection *connection); |
| 79 | NMDhcpConfig *nm_active_connection_get_dhcp6_config(NMActiveConnection *connection); |
| 80 | gboolean nm_active_connection_get_vpn(NMActiveConnection *connection); |
| 81 | |
| 82 | G_END_DECLS |
| 83 | |
| 84 | #endif /* __NM_ACTIVE_CONNECTION_H__ */ |
| 85 | |