Top | ![]() |
![]() |
![]() |
![]() |
NMSettingIP4ConfigNMSettingIP4Config — Describes IPv4 addressing, routing, and name service properties |
GPtrArray_GArray_guint__ * | addresses | Read / Write |
gchar * | dhcp-client-id | Read / Write |
gchar * | dhcp-hostname | Read / Write |
gboolean | dhcp-send-hostname | Read / Write / Construct |
guint | dhcp-timeout | Read / Write |
GArray_guint_ * | dns | Read / Write |
GSList_gchararray_ * | dns-search | Read / Write |
gboolean | ignore-auto-dns | Read / Write / Construct |
gboolean | ignore-auto-routes | Read / Write / Construct |
gboolean | may-fail | Read / Write / Construct |
gchar * | method | Read / Write |
gboolean | never-default | Read / Write / Construct |
gint64 | route-metric | Read / Write / Construct |
GPtrArray_GArray_guint__ * | routes | Read / Write |
#define | NM_SETTING_IP4_CONFIG_SETTING_NAME |
enum | NMSettingIP4ConfigError |
#define | NM_SETTING_IP4_CONFIG_ERROR |
#define | NM_SETTING_IP4_CONFIG_METHOD |
#define | NM_SETTING_IP4_CONFIG_DNS |
#define | NM_SETTING_IP4_CONFIG_DNS_SEARCH |
#define | NM_SETTING_IP4_CONFIG_ADDRESSES |
#define | NM_SETTING_IP4_CONFIG_ROUTES |
#define | NM_SETTING_IP4_CONFIG_ROUTE_METRIC |
#define | NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES |
#define | NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS |
#define | NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID |
#define | NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME |
#define | NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME |
#define | NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT |
#define | NM_SETTING_IP4_CONFIG_NEVER_DEFAULT |
#define | NM_SETTING_IP4_CONFIG_MAY_FAIL |
#define | NM_SETTING_IP4_CONFIG_METHOD_AUTO |
#define | NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL |
#define | NM_SETTING_IP4_CONFIG_METHOD_MANUAL |
#define | NM_SETTING_IP4_CONFIG_METHOD_SHARED |
#define | NM_SETTING_IP4_CONFIG_METHOD_DISABLED |
GBoxed ├── NMIP4Address ╰── NMIP4Route GEnum ╰── NMSettingIP4ConfigError GObject ╰── NMSetting ╰── NMSettingIP4Config
The NMSettingIP4Config object is a NMSetting subclass that describes properties related to IPv4 addressing, routing, and Domain Name Service
GQuark
nm_setting_ip4_config_error_quark (void
);
Registers an error quark for NMSettingIP4Config if necessary.
NMIP4Address *
nm_ip4_address_new (void
);
Creates and returns a new NMIP4Address object.
NMIP4Address *
nm_ip4_address_dup (NMIP4Address *source
);
Copies a given NMIP4Address object and returns the copy.
void
nm_ip4_address_ref (NMIP4Address *address
);
Increases the reference count of the object.
void
nm_ip4_address_unref (NMIP4Address *address
);
Decreases the reference count of the object. If the reference count reaches zero, the object will be destroyed.
gboolean nm_ip4_address_compare (NMIP4Address *address
,NMIP4Address *other
);
Determines if two NMIP4Address objects contain the same values.
guint32
nm_ip4_address_get_address (NMIP4Address *address
);
Gets the IPv4 address property of this address object.
void nm_ip4_address_set_address (NMIP4Address *address
,guint32 addr
);
Sets the IPv4 address property of this object.
guint32
nm_ip4_address_get_prefix (NMIP4Address *address
);
Gets the IPv4 address prefix (ie "24" or "30" etc) property of this address object.
void nm_ip4_address_set_prefix (NMIP4Address *address
,guint32 prefix
);
Sets the IPv4 address prefix.
guint32
nm_ip4_address_get_gateway (NMIP4Address *address
);
Gets the IPv4 default gateway property of this address object.
void nm_ip4_address_set_gateway (NMIP4Address *address
,guint32 gateway
);
Sets the IPv4 default gateway property of this address object.
NMIP4Route *
nm_ip4_route_new (void
);
Creates and returns a new NMIP4Route object.
NMIP4Route *
nm_ip4_route_dup (NMIP4Route *source
);
Copies a given NMIP4Route object and returns the copy.
void
nm_ip4_route_ref (NMIP4Route *route
);
Increases the reference count of the object.
void
nm_ip4_route_unref (NMIP4Route *route
);
Decreases the reference count of the object. If the reference count reaches zero, the object will be destroyed.
gboolean nm_ip4_route_compare (NMIP4Route *route
,NMIP4Route *other
);
Determines if two NMIP4Route objects contain the same values.
guint32
nm_ip4_route_get_dest (NMIP4Route *route
);
Gets the IPv4 destination address property of this route object.
void nm_ip4_route_set_dest (NMIP4Route *route
,guint32 dest
);
Sets the IPv4 destination address property of this route object.
guint32
nm_ip4_route_get_prefix (NMIP4Route *route
);
Gets the IPv4 prefix (ie "24" or "30" etc) of this route.
void nm_ip4_route_set_prefix (NMIP4Route *route
,guint32 prefix
);
Sets the IPv4 prefix of this route.
guint32
nm_ip4_route_get_next_hop (NMIP4Route *route
);
Gets the IPv4 address of the next hop of this route.
void nm_ip4_route_set_next_hop (NMIP4Route *route
,guint32 next_hop
);
Sets the IPv4 address of the next hop of this route.
guint32
nm_ip4_route_get_metric (NMIP4Route *route
);
Gets the route metric property of this route object; lower values indicate "better" or more preferred routes.
void nm_ip4_route_set_metric (NMIP4Route *route
,guint32 metric
);
Sets the route metric property of this route object; lower values indicate "better" or more preferred routes.
NMSetting *
nm_setting_ip4_config_new (void
);
Creates a new NMSettingIP4Config object with default values.
const char *
nm_setting_ip4_config_get_method (NMSettingIP4Config *setting
);
guint32
nm_setting_ip4_config_get_num_dns (NMSettingIP4Config *setting
);
guint32 nm_setting_ip4_config_get_dns (NMSettingIP4Config *setting
,guint32 i
);
gboolean nm_setting_ip4_config_add_dns (NMSettingIP4Config *setting
,guint32 dns
);
Adds a new DNS server to the setting.
void nm_setting_ip4_config_remove_dns (NMSettingIP4Config *setting
,guint32 i
);
Removes the DNS server at index i
.
gboolean nm_setting_ip4_config_remove_dns_by_value (NMSettingIP4Config *setting
,guint32 dns
);
Removes the DNS server dns
.
Since: 0.9.10
void
nm_setting_ip4_config_clear_dns (NMSettingIP4Config *setting
);
Removes all configured DNS servers.
guint32
nm_setting_ip4_config_get_num_dns_searches
(NMSettingIP4Config *setting
);
const char * nm_setting_ip4_config_get_dns_search (NMSettingIP4Config *setting
,guint32 i
);
gboolean nm_setting_ip4_config_add_dns_search (NMSettingIP4Config *setting
,const char *dns_search
);
Adds a new DNS search domain to the setting.
void nm_setting_ip4_config_remove_dns_search (NMSettingIP4Config *setting
,guint32 i
);
Removes the DNS search domain at index i
.
gboolean nm_setting_ip4_config_remove_dns_search_by_value (NMSettingIP4Config *setting
,const char *dns_search
);
Removes the DNS search domain dns_search
.
void
nm_setting_ip4_config_clear_dns_searches
(NMSettingIP4Config *setting
);
Removes all configured DNS search domains.
guint32
nm_setting_ip4_config_get_num_addresses
(NMSettingIP4Config *setting
);
NMIP4Address * nm_setting_ip4_config_get_address (NMSettingIP4Config *setting
,guint32 i
);
gboolean nm_setting_ip4_config_add_address (NMSettingIP4Config *setting
,NMIP4Address *address
);
Adds a new IPv4 address and associated information to the setting. The given address is duplicated internally and is not changed by this function.
void nm_setting_ip4_config_remove_address (NMSettingIP4Config *setting
,guint32 i
);
Removes the address at index i
.
gboolean nm_setting_ip4_config_remove_address_by_value (NMSettingIP4Config *setting
,NMIP4Address *address
);
Removes the address address
.
Since: 0.9.10
void
nm_setting_ip4_config_clear_addresses (NMSettingIP4Config *setting
);
Removes all configured addresses.
guint32
nm_setting_ip4_config_get_num_routes (NMSettingIP4Config *setting
);
NMIP4Route * nm_setting_ip4_config_get_route (NMSettingIP4Config *setting
,guint32 i
);
gboolean nm_setting_ip4_config_add_route (NMSettingIP4Config *setting
,NMIP4Route *route
);
Adds a new IPv4 route and associated information to the setting. The given route is duplicated internally and is not changed by this function.
void nm_setting_ip4_config_remove_route (NMSettingIP4Config *setting
,guint32 i
);
Removes the route at index i
.
gboolean nm_setting_ip4_config_remove_route_by_value (NMSettingIP4Config *setting
,NMIP4Route *route
);
Removes the route route
.
Since: 0.9.10
void
nm_setting_ip4_config_clear_routes (NMSettingIP4Config *setting
);
Removes all configured routes.
gint64
nm_setting_ip4_config_get_route_metric
(NMSettingIP4Config *setting
);
Returns the value contained in the “route-metric” property.
the route metric that is used for IPv4 routes that don't explicitly specify a metric. See “route-metric” for more details.
Since: 1.0
gboolean
nm_setting_ip4_config_get_ignore_auto_routes
(NMSettingIP4Config *setting
);
Returns the value contained in the “ignore-auto-routes” property.
gboolean
nm_setting_ip4_config_get_ignore_auto_dns
(NMSettingIP4Config *setting
);
Returns the value contained in the “ignore-auto-dns” property.
const char *
nm_setting_ip4_config_get_dhcp_client_id
(NMSettingIP4Config *setting
);
Returns the value contained in the “dhcp-client-id” property.
gboolean
nm_setting_ip4_config_get_dhcp_send_hostname
(NMSettingIP4Config *setting
);
Returns the value contained in the “dhcp-send-hostname” property.
TRUE
if NetworkManager should send the machine hostname to the
DHCP server when requesting addresses to allow the server to automatically
update DNS information for this machine.
const char *
nm_setting_ip4_config_get_dhcp_hostname
(NMSettingIP4Config *setting
);
Returns the value contained in the “dhcp-hostname” property.
int
nm_setting_ip4_config_get_dhcp_timeout
(NMSettingIP4Config *setting
);
Returns the value contained in the “dhcp-timeout” property.
gboolean
nm_setting_ip4_config_get_never_default
(NMSettingIP4Config *setting
);
Returns the value contained in the “never-default” property.
gboolean
nm_setting_ip4_config_get_may_fail (NMSettingIP4Config *setting
);
Returns the value contained in the “may-fail” property.
TRUE
if this connection doesn't require IPv4 addressing to complete
for the connection to succeed.
#define NM_SETTING_IP4_CONFIG_ERROR nm_setting_ip4_config_error_quark ()
#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
#define NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname"
#define NM_SETTING_IP4_CONFIG_METHOD_AUTO "auto"
IPv4 configuration should be automatically determined via a method appropriate for the hardware interface, ie DHCP or PPP or some other device-specific manner.
#define NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL "link-local"
IPv4 configuration should be automatically configured for link-local-only operation.
#define NM_SETTING_IP4_CONFIG_METHOD_MANUAL "manual"
All necessary IPv4 configuration (addresses, prefix, DNS, etc) is specified in the setting's properties.
#define NM_SETTING_IP4_CONFIG_METHOD_SHARED "shared"
This connection specifies configuration that allows other computers to connect through it to the default network (usually the Internet). The connection's interface will be assigned a private address, and a DHCP server, caching DNS server, and Network Address Translation (NAT) functionality will be started on this connection's interface to allow other devices to connect through that interface to the default network.
“addresses”
property “addresses” GPtrArray_GArray_guint__ *
Array of IPv4 address structures. Each IPv4 address structure is composed of 3 32-bit values; the first being the IPv4 address (network byte order), the second the prefix (1 - 32), and last the IPv4 gateway (network byte order). The gateway may be left as 0 if no gateway exists for that subnet. For the "auto" method, given IP addresses are appended to those returned by automatic configuration. Addresses cannot be used with the "shared", "link-local", or "disabled" methods as addressing is either automatic or disabled with these methods.
Flags: Read / Write
“dhcp-client-id”
property“dhcp-client-id” gchar *
A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options.
Flags: Read / Write
Default value: NULL
“dhcp-hostname”
property“dhcp-hostname” gchar *
If the “dhcp-send-hostname” property is TRUE
, then the
specified name will be sent to the DHCP server when acquiring a lease.
Flags: Read / Write
Default value: NULL
“dhcp-send-hostname”
property“dhcp-send-hostname” gboolean
If TRUE
, a hostname is sent to the DHCP server when acquiring a lease.
Some DHCP servers use this hostname to update DNS databases, essentially
providing a static hostname for the computer. If the
“dhcp-hostname” property is empty and this property is
TRUE
, the current persistent hostname of the computer is sent.
Flags: Read / Write / Construct
Default value: TRUE
“dhcp-timeout”
property“dhcp-timeout” guint
Number of seconds after which the unfinished DHCP transaction fails or zero for default.
Flags: Read / Write
Default value: 0
“dns”
property “dns” GArray_guint_ *
List of DNS servers (network byte order). For the "auto" method, these DNS servers are appended to those (if any) returned by automatic configuration. DNS servers cannot be used with the "shared", "link-local", or "disabled" methods as there is no upstream network. In all other methods, these DNS servers are used as the only DNS servers for this connection.
Flags: Read / Write
“dns-search”
property “dns-search” GSList_gchararray_ *
List of DNS search domains. For the "auto" method, these search domains are appended to those returned by automatic configuration. Search domains cannot be used with the "shared", "link-local", or "disabled" methods as there is no upstream network. In all other methods, these search domains are used as the only search domains for this connection.
Flags: Read / Write
“ignore-auto-dns”
property“ignore-auto-dns” gboolean
When the method is set to "auto" and this property to TRUE
,
automatically configured nameservers and search domains are ignored and
only nameservers and search domains specified in the
“dns” and “dns-search” properties, if
any, are used.
Flags: Read / Write / Construct
Default value: FALSE
“ignore-auto-routes”
property“ignore-auto-routes” gboolean
When the method is set to "auto" and this property to TRUE
,
automatically configured routes are ignored and only routes specified in
the “routes” property, if any, are used.
Flags: Read / Write / Construct
Default value: FALSE
“may-fail”
property“may-fail” gboolean
If TRUE
, allow overall network configuration to proceed even if IPv4
configuration times out. Note that at least one IP configuration must
succeed or overall network configuration will still fail. For example,
in IPv6-only networks, setting this property to TRUE
allows the overall
network configuration to succeed if IPv4 configuration fails but IPv6
configuration completes successfully.
Flags: Read / Write / Construct
Default value: TRUE
“method”
property“method” gchar *
IPv4 configuration method. If "auto" is specified then the appropriate automatic method (DHCP, PPP, etc) is used for the interface and most other properties can be left unset. If "link-local" is specified, then a link-local address in the 169.254/16 range will be assigned to the interface. If "manual" is specified, static IP addressing is used and at least one IP address must be given in the "addresses" property. If "shared" is specified (indicating that this connection will provide network access to other computers) then the interface is assigned an address in the 10.42.x.1/24 range and a DHCP and forwarding DNS server are started, and the interface is NAT-ed to the current default network connection. "disabled" means IPv4 will not be used on this connection. This property must be set.
Flags: Read / Write
Default value: NULL
“never-default”
property“never-default” gboolean
If TRUE
, this connection will never be the default IPv4 connection,
meaning it will never be assigned the default route by NetworkManager.
Flags: Read / Write / Construct
Default value: FALSE
“route-metric”
property“route-metric” gint64
The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. As the linux kernel accepts zero (0) as a valid metric, zero is a valid value.
Flags: Read / Write / Construct
Allowed values: [-1,4294967295]
Default value: -1
Since: 1.0
“routes”
property “routes” GPtrArray_GArray_guint__ *
Array of IPv4 route structures. Each IPv4 route structure is composed of 4 32-bit values; the first being the destination IPv4 network or address (network byte order), the second the destination network or address prefix (1 - 32), the third being the next-hop (network byte order) if any, and the fourth being the route metric. For the "auto" method, given IP routes are appended to those returned by automatic configuration. Routes cannot be used with the "shared", "link-local", or "disabled" methods because there is no upstream network.
Flags: Read / Write