1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
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.
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.
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.
19 * Copyright 2007 - 2014 Red Hat, Inc.
20 * Copyright 2007 - 2008 Novell, Inc.
23 #ifndef NM_SETTING_IP_CONFIG_H
24 #define NM_SETTING_IP_CONFIG_H
26 #if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
27 #error "Only <NetworkManager.h> can be included directly."
30 #include "nm-setting.h"
34 typedef struct NMIPAddress NMIPAddress;
36 GType nm_ip_address_get_type (void);
38 NMIPAddress *nm_ip_address_new (int family,
42 NMIPAddress *nm_ip_address_new_binary (int family,
47 void nm_ip_address_ref (NMIPAddress *address);
48 void nm_ip_address_unref (NMIPAddress *address);
49 gboolean nm_ip_address_equal (NMIPAddress *address,
51 NMIPAddress *nm_ip_address_dup (NMIPAddress *address);
53 int nm_ip_address_get_family (NMIPAddress *address);
54 const char *nm_ip_address_get_address (NMIPAddress *address);
55 void nm_ip_address_set_address (NMIPAddress *address,
57 void nm_ip_address_get_address_binary (NMIPAddress *address,
59 void nm_ip_address_set_address_binary (NMIPAddress *address,
61 guint nm_ip_address_get_prefix (NMIPAddress *address);
62 void nm_ip_address_set_prefix (NMIPAddress *address,
65 char **nm_ip_address_get_attribute_names (NMIPAddress *address);
66 GVariant *nm_ip_address_get_attribute (NMIPAddress *address,
68 void nm_ip_address_set_attribute (NMIPAddress *address,
73 typedef struct NMIPRoute NMIPRoute;
75 GType nm_ip_route_get_type (void);
77 NMIPRoute *nm_ip_route_new (int family,
83 NMIPRoute *nm_ip_route_new_binary (int family,
86 gconstpointer next_hop,
90 void nm_ip_route_ref (NMIPRoute *route);
91 void nm_ip_route_unref (NMIPRoute *route);
92 gboolean nm_ip_route_equal (NMIPRoute *route,
94 NMIPRoute *nm_ip_route_dup (NMIPRoute *route);
96 int nm_ip_route_get_family (NMIPRoute *route);
97 const char *nm_ip_route_get_dest (NMIPRoute *route);
98 void nm_ip_route_set_dest (NMIPRoute *route,
100 void nm_ip_route_get_dest_binary (NMIPRoute *route,
102 void nm_ip_route_set_dest_binary (NMIPRoute *route,
104 guint nm_ip_route_get_prefix (NMIPRoute *route);
105 void nm_ip_route_set_prefix (NMIPRoute *route,
107 const char *nm_ip_route_get_next_hop (NMIPRoute *route);
108 void nm_ip_route_set_next_hop (NMIPRoute *route,
109 const char *next_hop);
110 gboolean nm_ip_route_get_next_hop_binary (NMIPRoute *route,
112 void nm_ip_route_set_next_hop_binary (NMIPRoute *route,
113 gconstpointer next_hop);
114 gint64 nm_ip_route_get_metric (NMIPRoute *route);
115 void nm_ip_route_set_metric (NMIPRoute *route,
118 char **nm_ip_route_get_attribute_names (NMIPRoute *route);
119 GVariant *nm_ip_route_get_attribute (NMIPRoute *route,
121 void nm_ip_route_set_attribute (NMIPRoute *route,
126 #define NM_TYPE_SETTING_IP_CONFIG (nm_setting_ip_config_get_type ())
127 #define NM_SETTING_IP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfig))
128 #define NM_SETTING_IP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_IPCONFIG, NMSettingIPConfigClass))
129 #define NM_IS_SETTING_IP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_IP_CONFIG))
130 #define NM_IS_SETTING_IP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_IP_CONFIG))
131 #define NM_SETTING_IP_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfigClass))
133 #define NM_SETTING_IP_CONFIG_DAD_TIMEOUT_MAX 30000
135 #define NM_SETTING_IP_CONFIG_METHOD "method"
136 #define NM_SETTING_IP_CONFIG_DNS "dns"
137 #define NM_SETTING_IP_CONFIG_DNS_SEARCH "dns-search"
138 #define NM_SETTING_IP_CONFIG_DNS_OPTIONS "dns-options"
139 #define NM_SETTING_IP_CONFIG_ADDRESSES "addresses"
140 #define NM_SETTING_IP_CONFIG_GATEWAY "gateway"
141 #define NM_SETTING_IP_CONFIG_ROUTES "routes"
142 #define NM_SETTING_IP_CONFIG_ROUTE_METRIC "route-metric"
143 #define NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
144 #define NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
145 #define NM_SETTING_IP_CONFIG_DHCP_HOSTNAME "dhcp-hostname"
146 #define NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname"
147 #define NM_SETTING_IP_CONFIG_NEVER_DEFAULT "never-default"
148 #define NM_SETTING_IP_CONFIG_MAY_FAIL "may-fail"
149 #define NM_SETTING_IP_CONFIG_DAD_TIMEOUT "dad-timeout"
150 #define NM_SETTING_IP_CONFIG_DHCP_TIMEOUT "dhcp-timeout"
152 #define NM_SETTING_DNS_OPTION_DEBUG "debug"
153 #define NM_SETTING_DNS_OPTION_NDOTS "ndots"
154 #define NM_SETTING_DNS_OPTION_TIMEOUT "timeout"
155 #define NM_SETTING_DNS_OPTION_ATTEMPTS "attempts"
156 #define NM_SETTING_DNS_OPTION_ROTATE "rotate"
157 #define NM_SETTING_DNS_OPTION_NO_CHECK_NAMES "no-check-names"
158 #define NM_SETTING_DNS_OPTION_INET6 "inet6"
159 #define NM_SETTING_DNS_OPTION_IP6_BYTESTRING "ip6-bytestring"
160 #define NM_SETTING_DNS_OPTION_IP6_DOTINT "ip6-dotint"
161 #define NM_SETTING_DNS_OPTION_NO_IP6_DOTINT "no-ip6-dotint"
162 #define NM_SETTING_DNS_OPTION_EDNS0 "edns0"
163 #define NM_SETTING_DNS_OPTION_SINGLE_REQUEST "single-request"
164 #define NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN "single-request-reopen"
165 #define NM_SETTING_DNS_OPTION_NO_TLD_QUERY "no-tld-query"
167 struct _NMSettingIPConfig {
172 NMSettingClass parent;
174 /* Padding for future expansion */
176 } NMSettingIPConfigClass;
178 GType nm_setting_ip_config_get_type (void);
180 const char *nm_setting_ip_config_get_method (NMSettingIPConfig *setting);
182 guint nm_setting_ip_config_get_num_dns (NMSettingIPConfig *setting);
183 const char *nm_setting_ip_config_get_dns (NMSettingIPConfig *setting,
185 gboolean nm_setting_ip_config_add_dns (NMSettingIPConfig *setting,
187 void nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting,
189 gboolean nm_setting_ip_config_remove_dns_by_value (NMSettingIPConfig *setting,
191 void nm_setting_ip_config_clear_dns (NMSettingIPConfig *setting);
193 guint nm_setting_ip_config_get_num_dns_searches (NMSettingIPConfig *setting);
194 const char *nm_setting_ip_config_get_dns_search (NMSettingIPConfig *setting,
196 gboolean nm_setting_ip_config_add_dns_search (NMSettingIPConfig *setting,
197 const char *dns_search);
198 void nm_setting_ip_config_remove_dns_search (NMSettingIPConfig *setting,
200 gboolean nm_setting_ip_config_remove_dns_search_by_value (NMSettingIPConfig *setting,
201 const char *dns_search);
202 void nm_setting_ip_config_clear_dns_searches (NMSettingIPConfig *setting);
204 guint nm_setting_ip_config_get_num_dns_options (NMSettingIPConfig *setting);
205 gboolean nm_setting_ip_config_has_dns_options (NMSettingIPConfig *setting);
206 const char *nm_setting_ip_config_get_dns_option (NMSettingIPConfig *setting,
208 gint nm_setting_ip_config_next_valid_dns_option (NMSettingIPConfig *setting,
210 gboolean nm_setting_ip_config_add_dns_option (NMSettingIPConfig *setting,
211 const char *dns_option);
212 void nm_setting_ip_config_remove_dns_option (NMSettingIPConfig *setting,
214 gboolean nm_setting_ip_config_remove_dns_option_by_value (NMSettingIPConfig *setting,
215 const char *dns_option);
216 void nm_setting_ip_config_clear_dns_options (NMSettingIPConfig *setting, gboolean is_set);
218 guint nm_setting_ip_config_get_num_addresses (NMSettingIPConfig *setting);
219 NMIPAddress *nm_setting_ip_config_get_address (NMSettingIPConfig *setting,
221 gboolean nm_setting_ip_config_add_address (NMSettingIPConfig *setting,
222 NMIPAddress *address);
223 void nm_setting_ip_config_remove_address (NMSettingIPConfig *setting,
225 gboolean nm_setting_ip_config_remove_address_by_value (NMSettingIPConfig *setting,
226 NMIPAddress *address);
227 void nm_setting_ip_config_clear_addresses (NMSettingIPConfig *setting);
229 const char *nm_setting_ip_config_get_gateway (NMSettingIPConfig *setting);
231 guint nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting);
232 NMIPRoute *nm_setting_ip_config_get_route (NMSettingIPConfig *setting,
234 gboolean nm_setting_ip_config_add_route (NMSettingIPConfig *setting,
236 void nm_setting_ip_config_remove_route (NMSettingIPConfig *setting,
238 gboolean nm_setting_ip_config_remove_route_by_value (NMSettingIPConfig *setting,
240 void nm_setting_ip_config_clear_routes (NMSettingIPConfig *setting);
242 gint64 nm_setting_ip_config_get_route_metric (NMSettingIPConfig *setting);
244 gboolean nm_setting_ip_config_get_ignore_auto_routes (NMSettingIPConfig *setting);
245 gboolean nm_setting_ip_config_get_ignore_auto_dns (NMSettingIPConfig *setting);
247 const char *nm_setting_ip_config_get_dhcp_hostname (NMSettingIPConfig *setting);
248 gboolean nm_setting_ip_config_get_dhcp_send_hostname (NMSettingIPConfig *setting);
250 gboolean nm_setting_ip_config_get_never_default (NMSettingIPConfig *setting);
251 gboolean nm_setting_ip_config_get_may_fail (NMSettingIPConfig *setting);
253 gint nm_setting_ip_config_get_dad_timeout (NMSettingIPConfig *setting);
255 gint nm_setting_ip_config_get_dhcp_timeout (NMSettingIPConfig *setting);
259 #endif /* NM_SETTING_IP_CONFIG_H */