| 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 | |
| 15 | G_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 | /** |
| 42 | * NM_SETTING_IP6_CONFIG_METHOD_IGNORE: |
| 43 | * |
| 44 | * IPv6 is not required or is handled by some other mechanism, and NetworkManager |
| 45 | * should not configure IPv6 for this connection. |
| 46 | */ |
| 47 | #define NM_SETTING_IP6_CONFIG_METHOD_IGNORE "ignore" |
| 48 | |
| 49 | /** |
| 50 | * NM_SETTING_IP6_CONFIG_METHOD_AUTO: |
| 51 | * |
| 52 | * IPv6 configuration should be automatically determined via a method appropriate |
| 53 | * for the hardware interface, ie router advertisements, DHCP, or PPP or some |
| 54 | * other device-specific manner. |
| 55 | */ |
| 56 | #define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto" |
| 57 | |
| 58 | /** |
| 59 | * NM_SETTING_IP6_CONFIG_METHOD_DHCP: |
| 60 | * |
| 61 | * IPv6 configuration should be automatically determined via DHCPv6 only and |
| 62 | * router advertisements should be ignored. |
| 63 | */ |
| 64 | #define NM_SETTING_IP6_CONFIG_METHOD_DHCP "dhcp" |
| 65 | |
| 66 | /** |
| 67 | * NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL: |
| 68 | * |
| 69 | * IPv6 configuration should be automatically configured for link-local-only |
| 70 | * operation. |
| 71 | */ |
| 72 | #define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local" |
| 73 | |
| 74 | /** |
| 75 | * NM_SETTING_IP6_CONFIG_METHOD_MANUAL: |
| 76 | * |
| 77 | * All necessary IPv6 configuration (addresses, prefix, DNS, etc) is specified |
| 78 | * in the setting's properties. |
| 79 | */ |
| 80 | #define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual" |
| 81 | |
| 82 | /** |
| 83 | * NM_SETTING_IP6_CONFIG_METHOD_SHARED: |
| 84 | * |
| 85 | * This connection specifies configuration that allows other computers to |
| 86 | * connect through it to the default network (usually the Internet). The |
| 87 | * connection's interface will be assigned a private address, and router |
| 88 | * advertisements, a caching DNS server, and Network Address Translation (NAT) |
| 89 | * functionality will be started on this connection's interface to allow other |
| 90 | * devices to connect through that interface to the default network. (not yet |
| 91 | * supported for IPv6) |
| 92 | */ |
| 93 | #define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared" |
| 94 | |
| 95 | /** |
| 96 | * NM_SETTING_IP6_CONFIG_METHOD_DISABLED: |
| 97 | * |
| 98 | * IPv6 is disabled for the connection. |
| 99 | * |
| 100 | * Since: 1.20 |
| 101 | */ |
| 102 | #define NM_SETTING_IP6_CONFIG_METHOD_DISABLED "disabled" |
| 103 | |
| 104 | /** |
| 105 | * NMSettingIP6ConfigPrivacy: |
| 106 | * @NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN: unknown or no value specified |
| 107 | * @NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED: IPv6 Privacy Extensions are disabled |
| 108 | * @NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR: IPv6 Privacy Extensions |
| 109 | * are enabled, but public addresses are preferred over temporary addresses |
| 110 | * @NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR: IPv6 Privacy Extensions |
| 111 | * are enabled and temporary addresses are preferred over public addresses |
| 112 | * |
| 113 | * #NMSettingIP6ConfigPrivacy values indicate if and how IPv6 Privacy |
| 114 | * Extensions are used (RFC4941). |
| 115 | */ |
| 116 | typedef enum { |
| 117 | NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN = -1, |
| 118 | NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED = 0, |
| 119 | NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR = 1, |
| 120 | NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR = 2 |
| 121 | } NMSettingIP6ConfigPrivacy; |
| 122 | |
| 123 | /** |
| 124 | * NMSettingIP6ConfigAddrGenMode: |
| 125 | * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64: The Interface Identifier is derived |
| 126 | * from the interface hardware address. |
| 127 | * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY: The Interface Identifier |
| 128 | * is created by using a cryptographically secure hash of a secret host-specific |
| 129 | * key along with the connection identification and the network address as |
| 130 | * specified by RFC7217. |
| 131 | * |
| 132 | * #NMSettingIP6ConfigAddrGenMode controls how the Interface Identifier for |
| 133 | * RFC4862 Stateless Address Autoconfiguration is created. |
| 134 | * |
| 135 | * Since: 1.2 |
| 136 | */ |
| 137 | typedef enum { |
| 138 | NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64 = 0, |
| 139 | NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY = 1, |
| 140 | } NMSettingIP6ConfigAddrGenMode; |
| 141 | |
| 142 | typedef struct _NMSettingIP6ConfigClass NMSettingIP6ConfigClass; |
| 143 | |
| 144 | GType nm_setting_ip6_config_get_type(void); |
| 145 | |
| 146 | NMSetting *nm_setting_ip6_config_new(void); |
| 147 | |
| 148 | NMSettingIP6ConfigPrivacy nm_setting_ip6_config_get_ip6_privacy(NMSettingIP6Config *setting); |
| 149 | NM_AVAILABLE_IN_1_2 |
| 150 | NMSettingIP6ConfigAddrGenMode nm_setting_ip6_config_get_addr_gen_mode(NMSettingIP6Config *setting); |
| 151 | NM_AVAILABLE_IN_1_4 |
| 152 | const char *nm_setting_ip6_config_get_token(NMSettingIP6Config *setting); |
| 153 | NM_AVAILABLE_IN_1_12 |
| 154 | const char *nm_setting_ip6_config_get_dhcp_duid(NMSettingIP6Config *setting); |
| 155 | NM_AVAILABLE_IN_1_24 |
| 156 | gint32 nm_setting_ip6_config_get_ra_timeout(NMSettingIP6Config *setting); |
| 157 | |
| 158 | G_END_DECLS |
| 159 | |
| 160 | #endif /* __NM_SETTING_IP6_CONFIG_H__ */ |
| 161 | |