1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2007 - 2014 Red Hat, Inc.
4 * Copyright (C) 2007 - 2008 Novell, Inc.
5 */
6
7#ifndef __NM_SETTING_IP4_CONFIG_H__
8#define __NM_SETTING_IP4_CONFIG_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-setting-ip-config.h"
15
16G_BEGIN_DECLS
17
18#define NM_TYPE_SETTING_IP4_CONFIG (nm_setting_ip4_config_get_type())
19#define NM_SETTING_IP4_CONFIG(obj) \
20 (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4Config))
21#define NM_SETTING_IP4_CONFIG_CLASS(klass) \
22 (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_IP4CONFIG, NMSettingIP4ConfigClass))
23#define NM_IS_SETTING_IP4_CONFIG(obj) \
24 (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_IP4_CONFIG))
25#define NM_IS_SETTING_IP4_CONFIG_CLASS(klass) \
26 (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_IP4_CONFIG))
27#define NM_SETTING_IP4_CONFIG_GET_CLASS(obj) \
28 (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4ConfigClass))
29
30#define NM_SETTING_IP4_CONFIG_SETTING_NAME "ipv4"
31
32#define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id"
33#define NM_SETTING_IP4_CONFIG_DHCP_FQDN "dhcp-fqdn"
34#define NM_SETTING_IP4_CONFIG_DHCP_VENDOR_CLASS_IDENTIFIER "dhcp-vendor-class-identifier"
35#define NM_SETTING_IP4_CONFIG_LINK_LOCAL "link-local"
36
37/**
38 * NM_SETTING_IP4_CONFIG_METHOD_AUTO:
39 *
40 * IPv4 configuration should be automatically determined via a method appropriate
41 * for the hardware interface, ie DHCP or PPP or some other device-specific
42 * manner.
43 */
44#define NM_SETTING_IP4_CONFIG_METHOD_AUTO "auto"
45
46/**
47 * NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL:
48 *
49 * IPv4 configuration should be automatically configured for link-local-only
50 * operation.
51 */
52#define NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL "link-local"
53
54/**
55 * NM_SETTING_IP4_CONFIG_METHOD_MANUAL:
56 *
57 * All necessary IPv4 configuration (addresses, prefix, DNS, etc) is specified
58 * in the setting's properties.
59 */
60#define NM_SETTING_IP4_CONFIG_METHOD_MANUAL "manual"
61
62/**
63 * NM_SETTING_IP4_CONFIG_METHOD_SHARED:
64 *
65 * This connection specifies configuration that allows other computers to
66 * connect through it to the default network (usually the Internet). The
67 * connection's interface will be assigned a private address, and a DHCP server,
68 * caching DNS server, and Network Address Translation (NAT) functionality will
69 * be started on this connection's interface to allow other devices to connect
70 * through that interface to the default network.
71 */
72#define NM_SETTING_IP4_CONFIG_METHOD_SHARED "shared"
73
74/**
75 * NM_SETTING_IP4_CONFIG_METHOD_DISABLED:
76 *
77 * This connection does not use or require IPv4 address and it should be disabled.
78 */
79#define NM_SETTING_IP4_CONFIG_METHOD_DISABLED "disabled"
80
81/**
82 * NMSettingIP4LinkLocal:
83 * @NM_SETTING_IP4_LL_DEFAULT: Allow fallback to a globally configured default. If unspecified,
84 * fallback to "auto". Note that if "ipv4.method" is "disabled", this always implies link-local
85 * addresses disabled too.
86 * @NM_SETTING_IP4_LL_AUTO: Special value which enables LL if "ipv4.method" is set to
87 * "link-local".
88 * @NM_SETTING_IP4_LL_DISABLED: Disable IPv4 link-local protocol.
89 * @NM_SETTING_IP4_LL_ENABLED: Enable the IPv4 link-local protocol regardless what other protocols
90 * such as DHCP or manually assigned IP addresses might be active.
91 *
92 * #NMSettingIP4LinkLocal values indicate whether IPv4 link-local address protocol should be enabled.
93 *
94 * Since: 1.40
95 */
96typedef enum {
97 NM_SETTING_IP4_LL_DEFAULT = 0,
98 NM_SETTING_IP4_LL_AUTO = 1,
99 NM_SETTING_IP4_LL_DISABLED = 2,
100 NM_SETTING_IP4_LL_ENABLED = 3,
101} NMSettingIP4LinkLocal;
102
103typedef struct _NMSettingIP4ConfigClass NMSettingIP4ConfigClass;
104
105GType nm_setting_ip4_config_get_type(void);
106
107NMSetting *nm_setting_ip4_config_new(void);
108
109const char *nm_setting_ip4_config_get_dhcp_client_id(NMSettingIP4Config *setting);
110NM_AVAILABLE_IN_1_2
111const char *nm_setting_ip4_config_get_dhcp_fqdn(NMSettingIP4Config *setting);
112
113NM_AVAILABLE_IN_1_28
114const char *nm_setting_ip4_config_get_dhcp_vendor_class_identifier(NMSettingIP4Config *setting);
115
116NM_AVAILABLE_IN_1_42
117NMSettingIP4LinkLocal nm_setting_ip4_config_get_link_local(NMSettingIP4Config *setting);
118
119G_END_DECLS
120
121#endif /* __NM_SETTING_IP4_CONFIG_H__ */
122

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