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_IP_CONFIG_H
8#define NM_SETTING_IP_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.h"
15#include "nm-utils.h"
16
17G_BEGIN_DECLS
18
19#define NM_IP_ADDRESS_ATTRIBUTE_LABEL "label"
20
21/**
22 * NMIPAddressCmpFlags:
23 * @NM_IP_ADDRESS_CMP_FLAGS_NONE: no flags.
24 * @NM_IP_ADDRESS_CMP_FLAGS_WITH_ATTRS: when comparing two addresses,
25 * also consider their attributes. Warning: note that attributes are GVariants
26 * and they don't have a total order. In other words, if the address differs only
27 * by their attributes, the returned compare order is not total. In that case,
28 * the return value merely indicates equality (zero) or inequality.
29 *
30 * Compare flags for nm_ip_address_cmp_full().
31 *
32 * Since: 1.22
33 */
34typedef enum { /*< flags >*/
35 NM_IP_ADDRESS_CMP_FLAGS_NONE = 0,
36 NM_IP_ADDRESS_CMP_FLAGS_WITH_ATTRS = 0x1,
37} NMIPAddressCmpFlags;
38
39typedef struct NMIPAddress NMIPAddress;
40
41GType nm_ip_address_get_type(void);
42
43NMIPAddress *nm_ip_address_new(int family, const char *addr, guint prefix, GError **error);
44NMIPAddress *nm_ip_address_new_binary(int family, gconstpointer addr, guint prefix, GError **error);
45
46void nm_ip_address_ref(NMIPAddress *address);
47void nm_ip_address_unref(NMIPAddress *address);
48gboolean nm_ip_address_equal(NMIPAddress *address, NMIPAddress *other);
49NM_AVAILABLE_IN_1_22
50int
51nm_ip_address_cmp_full(const NMIPAddress *a, const NMIPAddress *b, NMIPAddressCmpFlags cmp_flags);
52
53NM_AVAILABLE_IN_1_32
54NMIPAddress *nm_ip_address_dup(NMIPAddress *address);
55
56int nm_ip_address_get_family(NMIPAddress *address);
57const char *nm_ip_address_get_address(NMIPAddress *address);
58void nm_ip_address_set_address(NMIPAddress *address, const char *addr);
59void nm_ip_address_get_address_binary(NMIPAddress *address, gpointer addr);
60void nm_ip_address_set_address_binary(NMIPAddress *address, gconstpointer addr);
61guint nm_ip_address_get_prefix(NMIPAddress *address);
62void nm_ip_address_set_prefix(NMIPAddress *address, guint prefix);
63
64char **nm_ip_address_get_attribute_names(NMIPAddress *address);
65GVariant *nm_ip_address_get_attribute(NMIPAddress *address, const char *name);
66void nm_ip_address_set_attribute(NMIPAddress *address, const char *name, GVariant *value);
67
68typedef struct NMIPRoute NMIPRoute;
69
70GType nm_ip_route_get_type(void);
71
72NMIPRoute *nm_ip_route_new(int family,
73 const char *dest,
74 guint prefix,
75 const char *next_hop,
76 gint64 metric,
77 GError **error);
78NMIPRoute *nm_ip_route_new_binary(int family,
79 gconstpointer dest,
80 guint prefix,
81 gconstpointer next_hop,
82 gint64 metric,
83 GError **error);
84
85void nm_ip_route_ref(NMIPRoute *route);
86void nm_ip_route_unref(NMIPRoute *route);
87gboolean nm_ip_route_equal(NMIPRoute *route, NMIPRoute *other);
88
89enum { /*< flags >*/
90 NM_IP_ROUTE_EQUAL_CMP_FLAGS_NONE = 0,
91 NM_IP_ROUTE_EQUAL_CMP_FLAGS_WITH_ATTRS = 0x1,
92};
93
94NM_AVAILABLE_IN_1_10
95gboolean nm_ip_route_equal_full(NMIPRoute *route, NMIPRoute *other, guint cmp_flags);
96
97NM_AVAILABLE_IN_1_32
98NMIPRoute *nm_ip_route_dup(NMIPRoute *route);
99
100int nm_ip_route_get_family(NMIPRoute *route);
101const char *nm_ip_route_get_dest(NMIPRoute *route);
102void nm_ip_route_set_dest(NMIPRoute *route, const char *dest);
103void nm_ip_route_get_dest_binary(NMIPRoute *route, gpointer dest);
104void nm_ip_route_set_dest_binary(NMIPRoute *route, gconstpointer dest);
105guint nm_ip_route_get_prefix(NMIPRoute *route);
106void nm_ip_route_set_prefix(NMIPRoute *route, guint prefix);
107const char *nm_ip_route_get_next_hop(NMIPRoute *route);
108void nm_ip_route_set_next_hop(NMIPRoute *route, const char *next_hop);
109gboolean nm_ip_route_get_next_hop_binary(NMIPRoute *route, gpointer next_hop);
110void nm_ip_route_set_next_hop_binary(NMIPRoute *route, gconstpointer next_hop);
111gint64 nm_ip_route_get_metric(NMIPRoute *route);
112void nm_ip_route_set_metric(NMIPRoute *route, gint64 metric);
113
114char **nm_ip_route_get_attribute_names(NMIPRoute *route);
115GVariant *nm_ip_route_get_attribute(NMIPRoute *route, const char *name);
116void nm_ip_route_set_attribute(NMIPRoute *route, const char *name, GVariant *value);
117NM_AVAILABLE_IN_1_8
118const NMVariantAttributeSpec *const *nm_ip_route_get_variant_attribute_spec(void);
119NM_AVAILABLE_IN_1_8
120gboolean nm_ip_route_attribute_validate(const char *name,
121 GVariant *value,
122 int family,
123 gboolean *known,
124 GError **error);
125
126#define NM_IP_ROUTE_ATTRIBUTE_CWND "cwnd"
127#define NM_IP_ROUTE_ATTRIBUTE_FROM "from"
128#define NM_IP_ROUTE_ATTRIBUTE_INITCWND "initcwnd"
129#define NM_IP_ROUTE_ATTRIBUTE_INITRWND "initrwnd"
130#define NM_IP_ROUTE_ATTRIBUTE_LOCK_CWND "lock-cwnd"
131#define NM_IP_ROUTE_ATTRIBUTE_LOCK_INITCWND "lock-initcwnd"
132#define NM_IP_ROUTE_ATTRIBUTE_LOCK_INITRWND "lock-initrwnd"
133#define NM_IP_ROUTE_ATTRIBUTE_LOCK_MTU "lock-mtu"
134#define NM_IP_ROUTE_ATTRIBUTE_LOCK_WINDOW "lock-window"
135#define NM_IP_ROUTE_ATTRIBUTE_MTU "mtu"
136#define NM_IP_ROUTE_ATTRIBUTE_ONLINK "onlink"
137#define NM_IP_ROUTE_ATTRIBUTE_SCOPE "scope"
138#define NM_IP_ROUTE_ATTRIBUTE_SRC "src"
139#define NM_IP_ROUTE_ATTRIBUTE_TABLE "table"
140#define NM_IP_ROUTE_ATTRIBUTE_TOS "tos"
141#define NM_IP_ROUTE_ATTRIBUTE_TYPE "type"
142#define NM_IP_ROUTE_ATTRIBUTE_WINDOW "window"
143
144/*****************************************************************************/
145
146typedef struct NMIPRoutingRule NMIPRoutingRule;
147
148NM_AVAILABLE_IN_1_18
149GType nm_ip_routing_rule_get_type(void);
150
151NM_AVAILABLE_IN_1_18
152NMIPRoutingRule *nm_ip_routing_rule_new(int addr_family);
153
154NM_AVAILABLE_IN_1_18
155NMIPRoutingRule *nm_ip_routing_rule_new_clone(const NMIPRoutingRule *rule);
156
157NM_AVAILABLE_IN_1_18
158NMIPRoutingRule *nm_ip_routing_rule_ref(NMIPRoutingRule *self);
159NM_AVAILABLE_IN_1_18
160void nm_ip_routing_rule_unref(NMIPRoutingRule *self);
161
162NM_AVAILABLE_IN_1_18
163gboolean nm_ip_routing_rule_is_sealed(const NMIPRoutingRule *self);
164NM_AVAILABLE_IN_1_18
165void nm_ip_routing_rule_seal(NMIPRoutingRule *self);
166
167NM_AVAILABLE_IN_1_18
168int nm_ip_routing_rule_get_addr_family(const NMIPRoutingRule *self);
169
170NM_AVAILABLE_IN_1_18
171gboolean nm_ip_routing_rule_get_invert(const NMIPRoutingRule *self);
172NM_AVAILABLE_IN_1_18
173void nm_ip_routing_rule_set_invert(NMIPRoutingRule *self, gboolean invert);
174
175NM_AVAILABLE_IN_1_18
176gint64 nm_ip_routing_rule_get_priority(const NMIPRoutingRule *self);
177NM_AVAILABLE_IN_1_18
178void nm_ip_routing_rule_set_priority(NMIPRoutingRule *self, gint64 priority);
179
180NM_AVAILABLE_IN_1_18
181guint8 nm_ip_routing_rule_get_tos(const NMIPRoutingRule *self);
182NM_AVAILABLE_IN_1_18
183void nm_ip_routing_rule_set_tos(NMIPRoutingRule *self, guint8 tos);
184
185NM_AVAILABLE_IN_1_18
186guint8 nm_ip_routing_rule_get_ipproto(const NMIPRoutingRule *self);
187NM_AVAILABLE_IN_1_18
188void nm_ip_routing_rule_set_ipproto(NMIPRoutingRule *self, guint8 ipproto);
189
190NM_AVAILABLE_IN_1_18
191guint16 nm_ip_routing_rule_get_source_port_start(const NMIPRoutingRule *self);
192NM_AVAILABLE_IN_1_18
193guint16 nm_ip_routing_rule_get_source_port_end(const NMIPRoutingRule *self);
194NM_AVAILABLE_IN_1_18
195void nm_ip_routing_rule_set_source_port(NMIPRoutingRule *self, guint16 start, guint16 end);
196
197NM_AVAILABLE_IN_1_18
198guint16 nm_ip_routing_rule_get_destination_port_start(const NMIPRoutingRule *self);
199NM_AVAILABLE_IN_1_18
200guint16 nm_ip_routing_rule_get_destination_port_end(const NMIPRoutingRule *self);
201NM_AVAILABLE_IN_1_18
202void nm_ip_routing_rule_set_destination_port(NMIPRoutingRule *self, guint16 start, guint16 end);
203
204NM_AVAILABLE_IN_1_18
205guint32 nm_ip_routing_rule_get_fwmark(const NMIPRoutingRule *self);
206NM_AVAILABLE_IN_1_18
207guint32 nm_ip_routing_rule_get_fwmask(const NMIPRoutingRule *self);
208NM_AVAILABLE_IN_1_18
209void nm_ip_routing_rule_set_fwmark(NMIPRoutingRule *self, guint32 fwmark, guint32 fwmask);
210
211NM_AVAILABLE_IN_1_18
212guint8 nm_ip_routing_rule_get_from_len(const NMIPRoutingRule *self);
213NM_AVAILABLE_IN_1_18
214const char *nm_ip_routing_rule_get_from(const NMIPRoutingRule *self);
215NM_AVAILABLE_IN_1_18
216void nm_ip_routing_rule_set_from(NMIPRoutingRule *self, const char *from, guint8 len);
217
218NM_AVAILABLE_IN_1_18
219guint8 nm_ip_routing_rule_get_to_len(const NMIPRoutingRule *self);
220NM_AVAILABLE_IN_1_18
221const char *nm_ip_routing_rule_get_to(const NMIPRoutingRule *self);
222NM_AVAILABLE_IN_1_18
223void nm_ip_routing_rule_set_to(NMIPRoutingRule *self, const char *to, guint8 len);
224
225NM_AVAILABLE_IN_1_18
226const char *nm_ip_routing_rule_get_iifname(const NMIPRoutingRule *self);
227NM_AVAILABLE_IN_1_18
228void nm_ip_routing_rule_set_iifname(NMIPRoutingRule *self, const char *iifname);
229
230NM_AVAILABLE_IN_1_18
231const char *nm_ip_routing_rule_get_oifname(const NMIPRoutingRule *self);
232NM_AVAILABLE_IN_1_18
233void nm_ip_routing_rule_set_oifname(NMIPRoutingRule *self, const char *oifname);
234
235NM_AVAILABLE_IN_1_18
236guint8 nm_ip_routing_rule_get_action(const NMIPRoutingRule *self);
237NM_AVAILABLE_IN_1_18
238void nm_ip_routing_rule_set_action(NMIPRoutingRule *self, guint8 action);
239
240NM_AVAILABLE_IN_1_18
241guint32 nm_ip_routing_rule_get_table(const NMIPRoutingRule *self);
242NM_AVAILABLE_IN_1_18
243void nm_ip_routing_rule_set_table(NMIPRoutingRule *self, guint32 table);
244
245NM_AVAILABLE_IN_1_20
246gint32 nm_ip_routing_rule_get_suppress_prefixlength(const NMIPRoutingRule *self);
247NM_AVAILABLE_IN_1_20
248void nm_ip_routing_rule_set_suppress_prefixlength(NMIPRoutingRule *self,
249 gint32 suppress_prefixlength);
250
251NM_AVAILABLE_IN_1_34
252gboolean nm_ip_routing_rule_get_uid_range(const NMIPRoutingRule *self,
253 guint32 *out_range_start,
254 guint32 *out_range_end);
255NM_AVAILABLE_IN_1_34
256void nm_ip_routing_rule_set_uid_range(NMIPRoutingRule *self,
257 guint32 uid_range_start,
258 guint32 uid_range_end);
259
260NM_AVAILABLE_IN_1_18
261int nm_ip_routing_rule_cmp(const NMIPRoutingRule *rule, const NMIPRoutingRule *other);
262
263NM_AVAILABLE_IN_1_18
264gboolean nm_ip_routing_rule_validate(const NMIPRoutingRule *self, GError **error);
265
266/**
267 * NMIPRoutingRuleAsStringFlags:
268 * @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_NONE: no flags selected.
269 * @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET: whether to allow parsing
270 * IPv4 addresses.
271 * @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET6: whether to allow parsing
272 * IPv6 addresses. If both @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET and
273 * @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET6 are unset, it's the same
274 * as setting them both.
275 * @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_VALIDATE: if set, ensure that the
276 * rule verfies or fail.
277 *
278 * Since: 1.18
279 */
280typedef enum { /*< flags >*/
281 NM_IP_ROUTING_RULE_AS_STRING_FLAGS_NONE = 0,
282
283 NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET = 0x1,
284 NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET6 = 0x2,
285 NM_IP_ROUTING_RULE_AS_STRING_FLAGS_VALIDATE = 0x4,
286} NMIPRoutingRuleAsStringFlags;
287
288NM_AVAILABLE_IN_1_18
289NMIPRoutingRule *nm_ip_routing_rule_from_string(const char *str,
290 NMIPRoutingRuleAsStringFlags to_string_flags,
291 GHashTable *extra_args,
292 GError **error);
293
294NM_AVAILABLE_IN_1_18
295char *nm_ip_routing_rule_to_string(const NMIPRoutingRule *self,
296 NMIPRoutingRuleAsStringFlags to_string_flags,
297 GHashTable *extra_args,
298 GError **error);
299
300/*****************************************************************************/
301
302#define NM_TYPE_SETTING_IP_CONFIG (nm_setting_ip_config_get_type())
303#define NM_SETTING_IP_CONFIG(obj) \
304 (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfig))
305#define NM_SETTING_IP_CONFIG_CLASS(klass) \
306 (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfigClass))
307#define NM_IS_SETTING_IP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_IP_CONFIG))
308#define NM_IS_SETTING_IP_CONFIG_CLASS(klass) \
309 (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_IP_CONFIG))
310#define NM_SETTING_IP_CONFIG_GET_CLASS(obj) \
311 (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfigClass))
312
313#define NM_SETTING_IP_CONFIG_DAD_TIMEOUT_MAX 30000
314
315#define NM_SETTING_IP_CONFIG_METHOD "method"
316#define NM_SETTING_IP_CONFIG_DNS "dns"
317#define NM_SETTING_IP_CONFIG_DNS_SEARCH "dns-search"
318#define NM_SETTING_IP_CONFIG_DNS_OPTIONS "dns-options"
319#define NM_SETTING_IP_CONFIG_DNS_PRIORITY "dns-priority"
320#define NM_SETTING_IP_CONFIG_ADDRESSES "addresses"
321#define NM_SETTING_IP_CONFIG_GATEWAY "gateway"
322#define NM_SETTING_IP_CONFIG_ROUTES "routes"
323#define NM_SETTING_IP_CONFIG_ROUTE_METRIC "route-metric"
324#define NM_SETTING_IP_CONFIG_ROUTE_TABLE "route-table"
325#define NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
326#define NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
327#define NM_SETTING_IP_CONFIG_DHCP_HOSTNAME "dhcp-hostname"
328#define NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname"
329#define NM_SETTING_IP_CONFIG_DHCP_HOSTNAME_FLAGS "dhcp-hostname-flags"
330#define NM_SETTING_IP_CONFIG_NEVER_DEFAULT "never-default"
331#define NM_SETTING_IP_CONFIG_MAY_FAIL "may-fail"
332#define NM_SETTING_IP_CONFIG_DAD_TIMEOUT "dad-timeout"
333#define NM_SETTING_IP_CONFIG_DHCP_TIMEOUT "dhcp-timeout"
334#define NM_SETTING_IP_CONFIG_REQUIRED_TIMEOUT "required-timeout"
335#define NM_SETTING_IP_CONFIG_DHCP_IAID "dhcp-iaid"
336#define NM_SETTING_IP_CONFIG_DHCP_REJECT_SERVERS "dhcp-reject-servers"
337
338/* these are not real GObject properties. */
339#define NM_SETTING_IP_CONFIG_ROUTING_RULES "routing-rules"
340
341#define NM_SETTING_DNS_OPTION_DEBUG "debug"
342#define NM_SETTING_DNS_OPTION_NDOTS "ndots"
343#define NM_SETTING_DNS_OPTION_TIMEOUT "timeout"
344#define NM_SETTING_DNS_OPTION_ATTEMPTS "attempts"
345#define NM_SETTING_DNS_OPTION_ROTATE "rotate"
346#define NM_SETTING_DNS_OPTION_NO_CHECK_NAMES "no-check-names"
347#define NM_SETTING_DNS_OPTION_INET6 "inet6"
348#define NM_SETTING_DNS_OPTION_IP6_BYTESTRING "ip6-bytestring"
349#define NM_SETTING_DNS_OPTION_IP6_DOTINT "ip6-dotint"
350#define NM_SETTING_DNS_OPTION_NO_IP6_DOTINT "no-ip6-dotint"
351#define NM_SETTING_DNS_OPTION_EDNS0 "edns0"
352#define NM_SETTING_DNS_OPTION_SINGLE_REQUEST "single-request"
353#define NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN "single-request-reopen"
354#define NM_SETTING_DNS_OPTION_NO_TLD_QUERY "no-tld-query"
355#define NM_SETTING_DNS_OPTION_USE_VC "use-vc"
356#define NM_SETTING_DNS_OPTION_NO_RELOAD "no-reload"
357#define NM_SETTING_DNS_OPTION_TRUST_AD "trust-ad"
358
359typedef struct _NMSettingIPConfigClass NMSettingIPConfigClass;
360
361/**
362 * NMDhcpHostnameFlags:
363 * @NM_DHCP_HOSTNAME_FLAG_NONE: no flag set. The default value from
364 * Networkmanager global configuration is used. If such value is unset
365 * or still zero, the DHCP request will use standard FQDN flags, i.e.
366 * %NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE and
367 * %NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED for IPv4 and
368 * %NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE for IPv6.
369 * @NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE: whether the server should
370 * do the A RR (FQDN-to-address) DNS updates.
371 * @NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED: if set, the FQDN is encoded
372 * using canonical wire format. Otherwise it uses the deprecated
373 * ASCII encoding. This flag is allowed only for DHCPv4.
374 * @NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE: when not set, request the
375 * server to perform updates (the PTR RR and possibly the A RR
376 * based on the %NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE flag). If
377 * this is set, the %NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE flag
378 * should be cleared.
379 * @NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS: when set, no FQDN flags are
380 * sent in the DHCP FQDN option. When cleared and all other FQDN
381 * flags are zero, standard FQDN flags are sent. This flag is
382 * incompatible with any other FQDN flag.
383 *
384 * #NMDhcpHostnameFlags describe flags related to the DHCP hostname and
385 * FQDN.
386 *
387 * Since: 1.22
388 */
389typedef enum { /*< flags >*/
390 NM_DHCP_HOSTNAME_FLAG_NONE = 0x0,
391
392 NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE = 0x1,
393 NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED = 0x2,
394 NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE = 0x4,
395
396 NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS = 0x8,
397
398} NMDhcpHostnameFlags;
399
400GType nm_setting_ip_config_get_type(void);
401
402const char *nm_setting_ip_config_get_method(NMSettingIPConfig *setting);
403
404guint nm_setting_ip_config_get_num_dns(NMSettingIPConfig *setting);
405const char *nm_setting_ip_config_get_dns(NMSettingIPConfig *setting, int idx);
406gboolean nm_setting_ip_config_add_dns(NMSettingIPConfig *setting, const char *dns);
407void nm_setting_ip_config_remove_dns(NMSettingIPConfig *setting, int idx);
408gboolean nm_setting_ip_config_remove_dns_by_value(NMSettingIPConfig *setting, const char *dns);
409void nm_setting_ip_config_clear_dns(NMSettingIPConfig *setting);
410
411guint nm_setting_ip_config_get_num_dns_searches(NMSettingIPConfig *setting);
412const char *nm_setting_ip_config_get_dns_search(NMSettingIPConfig *setting, int idx);
413gboolean nm_setting_ip_config_add_dns_search(NMSettingIPConfig *setting, const char *dns_search);
414void nm_setting_ip_config_remove_dns_search(NMSettingIPConfig *setting, int idx);
415gboolean nm_setting_ip_config_remove_dns_search_by_value(NMSettingIPConfig *setting,
416 const char *dns_search);
417void nm_setting_ip_config_clear_dns_searches(NMSettingIPConfig *setting);
418
419guint nm_setting_ip_config_get_num_dns_options(NMSettingIPConfig *setting);
420gboolean nm_setting_ip_config_has_dns_options(NMSettingIPConfig *setting);
421const char *nm_setting_ip_config_get_dns_option(NMSettingIPConfig *setting, guint idx);
422gboolean nm_setting_ip_config_add_dns_option(NMSettingIPConfig *setting, const char *dns_option);
423void nm_setting_ip_config_remove_dns_option(NMSettingIPConfig *setting, int idx);
424gboolean nm_setting_ip_config_remove_dns_option_by_value(NMSettingIPConfig *setting,
425 const char *dns_option);
426void nm_setting_ip_config_clear_dns_options(NMSettingIPConfig *setting, gboolean is_set);
427
428NM_AVAILABLE_IN_1_4
429int nm_setting_ip_config_get_dns_priority(NMSettingIPConfig *setting);
430
431guint nm_setting_ip_config_get_num_addresses(NMSettingIPConfig *setting);
432NMIPAddress *nm_setting_ip_config_get_address(NMSettingIPConfig *setting, int idx);
433gboolean nm_setting_ip_config_add_address(NMSettingIPConfig *setting, NMIPAddress *address);
434void nm_setting_ip_config_remove_address(NMSettingIPConfig *setting, int idx);
435gboolean nm_setting_ip_config_remove_address_by_value(NMSettingIPConfig *setting,
436 NMIPAddress *address);
437void nm_setting_ip_config_clear_addresses(NMSettingIPConfig *setting);
438
439const char *nm_setting_ip_config_get_gateway(NMSettingIPConfig *setting);
440
441guint nm_setting_ip_config_get_num_routes(NMSettingIPConfig *setting);
442NMIPRoute *nm_setting_ip_config_get_route(NMSettingIPConfig *setting, int idx);
443gboolean nm_setting_ip_config_add_route(NMSettingIPConfig *setting, NMIPRoute *route);
444void nm_setting_ip_config_remove_route(NMSettingIPConfig *setting, int idx);
445gboolean nm_setting_ip_config_remove_route_by_value(NMSettingIPConfig *setting, NMIPRoute *route);
446void nm_setting_ip_config_clear_routes(NMSettingIPConfig *setting);
447
448gint64 nm_setting_ip_config_get_route_metric(NMSettingIPConfig *setting);
449
450NM_AVAILABLE_IN_1_10
451guint32 nm_setting_ip_config_get_route_table(NMSettingIPConfig *setting);
452
453NM_AVAILABLE_IN_1_18
454guint nm_setting_ip_config_get_num_routing_rules(NMSettingIPConfig *setting);
455NM_AVAILABLE_IN_1_18
456NMIPRoutingRule *nm_setting_ip_config_get_routing_rule(NMSettingIPConfig *setting, guint idx);
457NM_AVAILABLE_IN_1_18
458void nm_setting_ip_config_add_routing_rule(NMSettingIPConfig *setting,
459 NMIPRoutingRule *routing_rule);
460NM_AVAILABLE_IN_1_18
461void nm_setting_ip_config_remove_routing_rule(NMSettingIPConfig *setting, guint idx);
462NM_AVAILABLE_IN_1_18
463void nm_setting_ip_config_clear_routing_rules(NMSettingIPConfig *setting);
464
465gboolean nm_setting_ip_config_get_ignore_auto_routes(NMSettingIPConfig *setting);
466gboolean nm_setting_ip_config_get_ignore_auto_dns(NMSettingIPConfig *setting);
467
468const char *nm_setting_ip_config_get_dhcp_hostname(NMSettingIPConfig *setting);
469gboolean nm_setting_ip_config_get_dhcp_send_hostname(NMSettingIPConfig *setting);
470
471gboolean nm_setting_ip_config_get_never_default(NMSettingIPConfig *setting);
472gboolean nm_setting_ip_config_get_may_fail(NMSettingIPConfig *setting);
473NM_AVAILABLE_IN_1_2
474int nm_setting_ip_config_get_dad_timeout(NMSettingIPConfig *setting);
475NM_AVAILABLE_IN_1_2
476int nm_setting_ip_config_get_dhcp_timeout(NMSettingIPConfig *setting);
477NM_AVAILABLE_IN_1_34
478int nm_setting_ip_config_get_required_timeout(NMSettingIPConfig *setting);
479NM_AVAILABLE_IN_1_22
480const char *nm_setting_ip_config_get_dhcp_iaid(NMSettingIPConfig *setting);
481
482NM_AVAILABLE_IN_1_22
483NMDhcpHostnameFlags nm_setting_ip_config_get_dhcp_hostname_flags(NMSettingIPConfig *setting);
484
485NM_AVAILABLE_IN_1_28
486const char *const *nm_setting_ip_config_get_dhcp_reject_servers(NMSettingIPConfig *setting,
487 guint *out_len);
488NM_AVAILABLE_IN_1_28
489void nm_setting_ip_config_add_dhcp_reject_server(NMSettingIPConfig *setting, const char *server);
490NM_AVAILABLE_IN_1_28
491void nm_setting_ip_config_remove_dhcp_reject_server(NMSettingIPConfig *setting, guint idx);
492NM_AVAILABLE_IN_1_28
493void nm_setting_ip_config_clear_dhcp_reject_servers(NMSettingIPConfig *setting);
494
495G_END_DECLS
496
497#endif /* NM_SETTING_IP_CONFIG_H */
498

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