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 | |
46 | /** |
47 | * NMActiveConnection: |
48 | */ |
49 | typedef struct _NMActiveConnectionClass NMActiveConnectionClass; |
50 | |
51 | GType nm_active_connection_get_type(void); |
52 | |
53 | NMRemoteConnection *nm_active_connection_get_connection(NMActiveConnection *connection); |
54 | const char *nm_active_connection_get_id(NMActiveConnection *connection); |
55 | const char *nm_active_connection_get_uuid(NMActiveConnection *connection); |
56 | const char *nm_active_connection_get_connection_type(NMActiveConnection *connection); |
57 | const char *nm_active_connection_get_specific_object_path(NMActiveConnection *connection); |
58 | const GPtrArray *nm_active_connection_get_devices(NMActiveConnection *connection); |
59 | NMActiveConnectionState nm_active_connection_get_state(NMActiveConnection *connection); |
60 | NM_AVAILABLE_IN_1_10 |
61 | NMActivationStateFlags nm_active_connection_get_state_flags(NMActiveConnection *connection); |
62 | NM_AVAILABLE_IN_1_8 |
63 | NMActiveConnectionStateReason nm_active_connection_get_state_reason(NMActiveConnection *connection); |
64 | NMDevice *nm_active_connection_get_master(NMActiveConnection *connection); |
65 | gboolean nm_active_connection_get_default(NMActiveConnection *connection); |
66 | NMIPConfig *nm_active_connection_get_ip4_config(NMActiveConnection *connection); |
67 | NMDhcpConfig *nm_active_connection_get_dhcp4_config(NMActiveConnection *connection); |
68 | gboolean nm_active_connection_get_default6(NMActiveConnection *connection); |
69 | NMIPConfig *nm_active_connection_get_ip6_config(NMActiveConnection *connection); |
70 | NMDhcpConfig *nm_active_connection_get_dhcp6_config(NMActiveConnection *connection); |
71 | gboolean nm_active_connection_get_vpn(NMActiveConnection *connection); |
72 | |
73 | G_END_DECLS |
74 | |
75 | #endif /* __NM_ACTIVE_CONNECTION_H__ */ |
76 | |