1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2007 - 2014 Red Hat, Inc.
4 */
5
6#ifndef __NM_SETTING_IP6_CONFIG_H__
7#define __NM_SETTING_IP6_CONFIG_H__
8
9#if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION)
10#error "Only <NetworkManager.h> can be included directly."
11#endif
12
13#include "nm-setting-ip-config.h"
14
15G_BEGIN_DECLS
16
17#define NM_TYPE_SETTING_IP6_CONFIG (nm_setting_ip6_config_get_type())
18#define NM_SETTING_IP6_CONFIG(obj) \
19 (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6Config))
20#define NM_SETTING_IP6_CONFIG_CLASS(klass) \
21 (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_IP6CONFIG, NMSettingIP6ConfigClass))
22#define NM_IS_SETTING_IP6_CONFIG(obj) \
23 (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_IP6_CONFIG))
24#define NM_IS_SETTING_IP6_CONFIG_CLASS(klass) \
25 (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_IP6_CONFIG))
26#define NM_SETTING_IP6_CONFIG_GET_CLASS(obj) \
27 (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigClass))
28
29#define NM_SETTING_IP6_CONFIG_SETTING_NAME "ipv6"
30
31#define NM_SETTING_IP6_CONFIG_IP6_PRIVACY "ip6-privacy"
32
33#define NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE "addr-gen-mode"
34
35#define NM_SETTING_IP6_CONFIG_TOKEN "token"
36
37#define NM_SETTING_IP6_CONFIG_DHCP_DUID "dhcp-duid"
38
39#define NM_SETTING_IP6_CONFIG_RA_TIMEOUT "ra-timeout"
40
41#define NM_SETTING_IP6_CONFIG_MTU "mtu"
42
43#define NM_SETTING_IP6_CONFIG_DHCP_PD_HINT "dhcp-pd-hint"
44
45/**
46 * NM_SETTING_IP6_CONFIG_METHOD_IGNORE:
47 *
48 * IPv6 is not required or is handled by some other mechanism, and NetworkManager
49 * should not configure IPv6 for this connection.
50 */
51#define NM_SETTING_IP6_CONFIG_METHOD_IGNORE "ignore"
52
53/**
54 * NM_SETTING_IP6_CONFIG_METHOD_AUTO:
55 *
56 * IPv6 configuration should be automatically determined via a method appropriate
57 * for the hardware interface, ie router advertisements, DHCP, or PPP or some
58 * other device-specific manner.
59 */
60#define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto"
61
62/**
63 * NM_SETTING_IP6_CONFIG_METHOD_DHCP:
64 *
65 * IPv6 configuration should be automatically determined via DHCPv6 only and
66 * router advertisements should be ignored.
67 */
68#define NM_SETTING_IP6_CONFIG_METHOD_DHCP "dhcp"
69
70/**
71 * NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL:
72 *
73 * IPv6 configuration should be automatically configured for link-local-only
74 * operation.
75 */
76#define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local"
77
78/**
79 * NM_SETTING_IP6_CONFIG_METHOD_MANUAL:
80 *
81 * All necessary IPv6 configuration (addresses, prefix, DNS, etc) is specified
82 * in the setting's properties.
83 */
84#define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual"
85
86/**
87 * NM_SETTING_IP6_CONFIG_METHOD_SHARED:
88 *
89 * This connection specifies configuration that allows other computers to
90 * connect through it to the default network (usually the Internet). The
91 * connection's interface will be assigned a private address, and router
92 * advertisements, a caching DNS server, and Network Address Translation (NAT)
93 * functionality will be started on this connection's interface to allow other
94 * devices to connect through that interface to the default network. (not yet
95 * supported for IPv6)
96 */
97#define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared"
98
99/**
100 * NM_SETTING_IP6_CONFIG_METHOD_DISABLED:
101 *
102 * IPv6 is disabled for the connection.
103 *
104 * Since: 1.20
105 */
106#define NM_SETTING_IP6_CONFIG_METHOD_DISABLED "disabled"
107
108/**
109 * NMSettingIP6ConfigPrivacy:
110 * @NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN: unknown or no value specified
111 * @NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED: IPv6 Privacy Extensions are disabled
112 * @NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR: IPv6 Privacy Extensions
113 * are enabled, but public addresses are preferred over temporary addresses
114 * @NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR: IPv6 Privacy Extensions
115 * are enabled and temporary addresses are preferred over public addresses
116 *
117 * #NMSettingIP6ConfigPrivacy values indicate if and how IPv6 Privacy
118 * Extensions are used (RFC4941).
119 */
120typedef enum {
121 NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN = -1,
122 NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED = 0,
123 NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR = 1,
124 NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR = 2
125} NMSettingIP6ConfigPrivacy;
126
127/**
128 * NMSettingIP6ConfigAddrGenMode:
129 * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64: The Interface Identifier is derived
130 * from the interface hardware address.
131 * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY: The Interface Identifier
132 * is created by using a cryptographically secure hash of a secret host-specific
133 * key along with the connection identification and the network address as
134 * specified by RFC7217.
135 * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT_OR_EUI64: Fallback to the global
136 * default, and if unspecified use "eui64". Since: 1.40.
137 * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT: Fallback to the global
138 * default, and if unspecified use "stable-privacy". Since: 1.40.
139 *
140 * #NMSettingIP6ConfigAddrGenMode controls how the Interface Identifier for
141 * RFC4862 Stateless Address Autoconfiguration is created.
142 *
143 * Since: 1.2
144 */
145typedef enum {
146 NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64 = 0,
147 NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY = 1,
148 NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT_OR_EUI64 = 2,
149 NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT = 3,
150} NMSettingIP6ConfigAddrGenMode;
151
152typedef struct _NMSettingIP6ConfigClass NMSettingIP6ConfigClass;
153
154GType nm_setting_ip6_config_get_type(void);
155
156NMSetting *nm_setting_ip6_config_new(void);
157
158NMSettingIP6ConfigPrivacy nm_setting_ip6_config_get_ip6_privacy(NMSettingIP6Config *setting);
159NM_AVAILABLE_IN_1_2
160NMSettingIP6ConfigAddrGenMode nm_setting_ip6_config_get_addr_gen_mode(NMSettingIP6Config *setting);
161NM_AVAILABLE_IN_1_4
162const char *nm_setting_ip6_config_get_token(NMSettingIP6Config *setting);
163NM_AVAILABLE_IN_1_12
164const char *nm_setting_ip6_config_get_dhcp_duid(NMSettingIP6Config *setting);
165NM_AVAILABLE_IN_1_24
166gint32 nm_setting_ip6_config_get_ra_timeout(NMSettingIP6Config *setting);
167NM_AVAILABLE_IN_1_40
168guint32 nm_setting_ip6_config_get_mtu(NMSettingIP6Config *setting);
169NM_AVAILABLE_IN_1_44
170const char *nm_setting_ip6_config_get_dhcp_pd_hint(NMSettingIP6Config *setting);
171
172G_END_DECLS
173
174#endif /* __NM_SETTING_IP6_CONFIG_H__ */
175

source code of include/libnm/nm-setting-ip6-config.h