device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-core / nm-setting-ip6-config.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
3 /*
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301 USA.
18  *
19  * Copyright 2007 - 2014 Red Hat, Inc.
20  */
21
22 #ifndef __NM_SETTING_IP6_CONFIG_H__
23 #define __NM_SETTING_IP6_CONFIG_H__
24
25 #if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
26 #error "Only <NetworkManager.h> can be included directly."
27 #endif
28
29 #include "nm-setting-ip-config.h"
30
31 G_BEGIN_DECLS
32
33 #define NM_TYPE_SETTING_IP6_CONFIG            (nm_setting_ip6_config_get_type ())
34 #define NM_SETTING_IP6_CONFIG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6Config))
35 #define NM_SETTING_IP6_CONFIG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_IP6CONFIG, NMSettingIP6ConfigClass))
36 #define NM_IS_SETTING_IP6_CONFIG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_IP6_CONFIG))
37 #define NM_IS_SETTING_IP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_IP6_CONFIG))
38 #define NM_SETTING_IP6_CONFIG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigClass))
39
40 #define NM_SETTING_IP6_CONFIG_SETTING_NAME "ipv6"
41
42 #define NM_SETTING_IP6_CONFIG_IP6_PRIVACY "ip6-privacy"
43
44 #define NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE "addr-gen-mode"
45
46 /**
47  * NM_SETTING_IP6_CONFIG_METHOD_IGNORE:
48  *
49  * IPv6 is not required or is handled by some other mechanism, and NetworkManager
50  * should not configure IPv6 for this connection.
51  */
52 #define NM_SETTING_IP6_CONFIG_METHOD_IGNORE     "ignore"
53
54 /**
55  * NM_SETTING_IP6_CONFIG_METHOD_AUTO:
56  *
57  * IPv6 configuration should be automatically determined via a method appropriate
58  * for the hardware interface, ie router advertisements, DHCP, or PPP or some
59  * other device-specific manner.
60  */
61 #define NM_SETTING_IP6_CONFIG_METHOD_AUTO       "auto"
62
63 /**
64  * NM_SETTING_IP6_CONFIG_METHOD_DHCP:
65  *
66  * IPv6 configuration should be automatically determined via DHCPv6 only and
67  * router advertisements should be ignored.
68  */
69 #define NM_SETTING_IP6_CONFIG_METHOD_DHCP       "dhcp"
70
71 /**
72  * NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL:
73  *
74  * IPv6 configuration should be automatically configured for link-local-only
75  * operation.
76  */
77 #define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local"
78
79 /**
80  * NM_SETTING_IP6_CONFIG_METHOD_MANUAL:
81  *
82  * All necessary IPv6 configuration (addresses, prefix, DNS, etc) is specified
83  * in the setting's properties.
84  */
85 #define NM_SETTING_IP6_CONFIG_METHOD_MANUAL     "manual"
86
87 /**
88  * NM_SETTING_IP6_CONFIG_METHOD_SHARED:
89  *
90  * This connection specifies configuration that allows other computers to
91  * connect through it to the default network (usually the Internet).  The
92  * connection's interface will be assigned a private address, and router
93  * advertisements, a caching DNS server, and Network Address Translation (NAT)
94  * functionality will be started on this connection's interface to allow other
95  * devices to connect through that interface to the default network. (not yet
96  * supported for IPv6)
97  */
98 #define NM_SETTING_IP6_CONFIG_METHOD_SHARED     "shared"
99
100 /**
101  * NMSettingIP6ConfigPrivacy:
102  * @NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN: unknown or no value specified
103  * @NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED: IPv6 Privacy Extensions are disabled
104  * @NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR: IPv6 Privacy Extensions
105  * are enabled, but public addresses are preferred over temporary addresses
106  * @NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR: IPv6 Privacy Extensions
107  * are enabled and temporary addresses are preferred over public addresses
108  *
109  * #NMSettingIP6ConfigPrivacy values indicate if and how IPv6 Privacy
110  * Extensions are used (RFC4941).
111  */
112 typedef enum {
113         NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN = -1,
114         NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED = 0,
115         NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR = 1,
116         NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR = 2
117 } NMSettingIP6ConfigPrivacy;
118
119 /**
120  * NMSettingIP6ConfigAddrGenMode:
121  * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64: The Interface Identifier is derived
122  * from the interface hardware address.
123  * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY: The Interface Identifier
124  * is created by using a cryptographically secure hash of a secret host-specific
125  * key along with the connection identification and the network address as
126  * specified by RFC7217.
127  *
128  * #NMSettingIP6ConfigAddrGenMode controls how the the Interface Identifier for
129  * RFC4862 Stateless Address Autoconfiguration is created.
130  *
131  * Since: 1.2
132  */
133 typedef enum {
134         NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64 = 0,
135         NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY = 1,
136 } NMSettingIP6ConfigAddrGenMode;
137
138 struct _NMSettingIP6Config {
139         NMSettingIPConfig parent;
140 };
141
142 typedef struct {
143         NMSettingIPConfigClass parent;
144
145         /*< private >*/
146         gpointer padding[4];
147 } NMSettingIP6ConfigClass;
148
149 GType nm_setting_ip6_config_get_type (void);
150
151 NMSetting *nm_setting_ip6_config_new (void);
152
153 NMSettingIP6ConfigPrivacy nm_setting_ip6_config_get_ip6_privacy (NMSettingIP6Config *setting);
154 NM_AVAILABLE_IN_1_2
155 NMSettingIP6ConfigAddrGenMode nm_setting_ip6_config_get_addr_gen_mode (NMSettingIP6Config *setting);
156
157 G_END_DECLS
158
159 #endif /* __NM_SETTING_IP6_CONFIG_H__ */