Top |
NMSettingIPConfigNMSettingIPConfig — Abstract base class for IPv4 and IPv6 addressing, routing, and name service properties |
GBoxed ├── NMIPAddress ├── NMIPRoute ╰── NMIPRoutingRule GFlags ├── NMDhcpHostnameFlags ├── NMIPAddressCmpFlags ╰── NMIPRoutingRuleAsStringFlags
NMSettingIPConfig is the abstract base class of NMSettingIP4Config and NMSettingIP6Config, providing properties related to IP addressing, routing, and Domain Name Service.
NMIPAddress * nm_ip_address_new (int family
,const char *addr
,guint prefix
,GError **error
);
Creates a new NMIPAddress object.
family |
the IP address family ( |
|
addr |
the IP address |
|
prefix |
the address prefix length |
|
error |
location to store error, or |
NMIPAddress * nm_ip_address_new_binary (int family
,gconstpointer addr
,guint prefix
,GError **error
);
Creates a new NMIPAddress object. addr
must point to a buffer of the
correct size for family
.
family |
the IP address family ( |
|
addr |
the IP address |
|
prefix |
the address prefix length |
|
error |
location to store error, or |
void
nm_ip_address_ref (NMIPAddress *address
);
Increases the reference count of the object.
void
nm_ip_address_unref (NMIPAddress *address
);
Decreases the reference count of the object. If the reference count reaches zero, the object will be destroyed.
gboolean nm_ip_address_equal (NMIPAddress *address
,NMIPAddress *other
);
Determines if two NMIPAddress objects contain the same address and prefix (attributes are not compared).
int nm_ip_address_cmp_full (const NMIPAddress *a
,const NMIPAddress *b
,NMIPAddressCmpFlags cmp_flags
);
Note that with cmp_flags
NM_IP_ADDRESS_CMP_FLAGS_WITH_ATTRS, there
is no total order for comparing GVariant. That means, if the two addresses
only differ by their attributes, the sort order is undefined and the return
value only indicates equality.
a |
the NMIPAddress |
|
b |
the NMIPAddress to compare |
|
cmp_flags |
the NMIPAddressCmpFlags that indicate what to compare. |
0 if the two objects have the same values (according to their flags) or a integer indicating the compare order.
Since: 1.22
NMIPAddress *
nm_ip_address_dup (NMIPAddress *address
);
Creates a copy of address
a copy of address
This API was part of public headers before 1.32.0 but was erroneously not exported in the ABI. It is thus only usable since 1.32.0.
[transfer full]
Since: 1.32
int
nm_ip_address_get_family (NMIPAddress *address
);
Gets the IP address family (eg, AF_INET) property of this address object.
const char *
nm_ip_address_get_address (NMIPAddress *address
);
Gets the IP address property of this address object.
void nm_ip_address_set_address (NMIPAddress *address
,const char *addr
);
Sets the IP address property of this address object.
addr
must be a valid address of address
's family. If you aren't sure you
have a valid address, use nm_utils_ipaddr_valid()
to check it.
void nm_ip_address_get_address_binary (NMIPAddress *address
,gpointer addr
);
Gets the IP address property of this address object.
addr
must point to a buffer that is the correct size for address
's family.
[skip]
void nm_ip_address_set_address_binary (NMIPAddress *address
,gconstpointer addr
);
Sets the IP address property of this address object.
addr
must point to a buffer that is the correct size for address
's family.
[skip]
guint
nm_ip_address_get_prefix (NMIPAddress *address
);
Gets the IP address prefix (ie "24" or "30" etc) property of this address object.
void nm_ip_address_set_prefix (NMIPAddress *address
,guint prefix
);
Sets the IP address prefix property of this address object.
char **
nm_ip_address_get_attribute_names (NMIPAddress *address
);
Gets an array of attribute names defined on address
.
GVariant * nm_ip_address_get_attribute (NMIPAddress *address
,const char *name
);
Gets the value of the attribute with name name
on address
the value of the attribute with name name
on
address
, or NULL
if address
has no such attribute.
[transfer none]
void nm_ip_address_set_attribute (NMIPAddress *address
,const char *name
,GVariant *value
);
Sets or clears the named attribute on address
to the given value.
address |
the NMIPAddress |
|
name |
the name of an address attribute |
|
value |
the value. |
[transfer none][nullable] |
NMIPRoute * nm_ip_route_new (int family
,const char *dest
,guint prefix
,const char *next_hop
,gint64 metric
,GError **error
);
Creates a new NMIPRoute object.
NMIPRoute * nm_ip_route_new_binary (int family
,gconstpointer dest
,guint prefix
,gconstpointer next_hop
,gint64 metric
,GError **error
);
Creates a new NMIPRoute object. dest
and next_hop
(if non-NULL
) must
point to buffers of the correct size for family
.
void
nm_ip_route_ref (NMIPRoute *route
);
Increases the reference count of the object.
void
nm_ip_route_unref (NMIPRoute *route
);
Decreases the reference count of the object. If the reference count reaches zero, the object will be destroyed.
gboolean nm_ip_route_equal (NMIPRoute *route
,NMIPRoute *other
);
Determines if two NMIPRoute objects contain the same destination, prefix, next hop, and metric. (Attributes are not compared.)
gboolean nm_ip_route_equal_full (NMIPRoute *route
,NMIPRoute *other
,guint cmp_flags
);
Determines if two NMIPRoute objects contain the same destination, prefix, next hop, and metric.
Since: 1.10
NMIPRoute *
nm_ip_route_dup (NMIPRoute *route
);
Creates a copy of route
a copy of route
This API was part of public headers before 1.32.0 but was erroneously not exported in the ABI. It is thus only usable since 1.32.0.
[transfer full]
Since: 1.32
int
nm_ip_route_get_family (NMIPRoute *route
);
Gets the IP address family (eg, AF_INET) property of this route object.
const char *
nm_ip_route_get_dest (NMIPRoute *route
);
Gets the IP destination address property of this route object.
void nm_ip_route_set_dest (NMIPRoute *route
,const char *dest
);
Sets the destination property of this route object.
dest
must be a valid address of route
's family. If you aren't sure you
have a valid address, use nm_inet_is_valid()
to check it.
void nm_ip_route_get_dest_binary (NMIPRoute *route
,gpointer dest
);
Gets the destination property of this route object.
dest
must point to a buffer that is the correct size for route
's family.
[skip]
void nm_ip_route_set_dest_binary (NMIPRoute *route
,gconstpointer dest
);
Sets the destination property of this route object.
dest
must point to a buffer that is the correct size for route
's family.
[skip]
guint
nm_ip_route_get_prefix (NMIPRoute *route
);
Gets the IP prefix (ie "24" or "30" etc) of this route.
void nm_ip_route_set_prefix (NMIPRoute *route
,guint prefix
);
Sets the prefix property of this route object.
const char *
nm_ip_route_get_next_hop (NMIPRoute *route
);
Gets the IP address of the next hop of this route; this will be NULL
if the
route has no next hop.
void nm_ip_route_set_next_hop (NMIPRoute *route
,const char *next_hop
);
Sets the next-hop property of this route object.
next_hop
(if non-NULL
) must be a valid address of route
's family. If you
aren't sure you have a valid address, use nm_utils_ipaddr_valid()
to check
it.
gboolean nm_ip_route_get_next_hop_binary (NMIPRoute *route
,gpointer next_hop
);
Gets the next hop property of this route object.
next_hop
must point to a buffer that is the correct size for route
's family.
[skip]
void nm_ip_route_set_next_hop_binary (NMIPRoute *route
,gconstpointer next_hop
);
Sets the destination property of this route object.
next_hop
(if non-NULL
) must point to a buffer that is the correct size for
route
's family.
[skip]
gint64
nm_ip_route_get_metric (NMIPRoute *route
);
Gets the route metric property of this route object; lower values indicate "better" or more preferred routes; -1 indicates "default" (meaning NetworkManager will set it appropriately).
void nm_ip_route_set_metric (NMIPRoute *route
,gint64 metric
);
Sets the metric property of this route object.
char **
nm_ip_route_get_attribute_names (NMIPRoute *route
);
Gets an array of attribute names defined on route
.
GVariant * nm_ip_route_get_attribute (NMIPRoute *route
,const char *name
);
Gets the value of the attribute with name name
on route
the value of the attribute with name name
on
route
, or NULL
if route
has no such attribute.
[transfer none]
void nm_ip_route_set_attribute (NMIPRoute *route
,const char *name
,GVariant *value
);
Sets the named attribute on route
to the given value.
route |
the NMIPRoute |
|
name |
the name of a route attribute |
|
value |
the value. |
[transfer none][nullable] |
const NMVariantAttributeSpec *const *
nm_ip_route_get_variant_attribute_spec
(void
);
Since: 1.8
gboolean nm_ip_route_attribute_validate (const char *name
,GVariant *value
,int family
,gboolean *known
,GError **error
);
Validates a route attribute, i.e. checks that the attribute is a known one and the value is of the correct type and well-formed.
Since: 1.8
NMIPRoutingRule *
nm_ip_routing_rule_new (int addr_family
);
addr_family |
the address family of the routing rule. Must be either
|
a newly created rule instance with the provided address family. The instance is unsealed.
[transfer full]
Since: 1.18
NMIPRoutingRule *
nm_ip_routing_rule_new_clone (const NMIPRoutingRule *rule
);
Since 1.42, ref-counting of NMIPRoutingRule is thread-safe.
a newly created rule instance with
the same settings as rule
. Note that the instance will
always be unsealed.
[transfer full]
Since: 1.18
NMIPRoutingRule *
nm_ip_routing_rule_ref (NMIPRoutingRule *self
);
Increases the reference count of the instance.
the self
argument with incremented
reference count.
Since 1.42, ref-counting of NMIPRoutingRule is thread-safe.
[transfer full]
Since: 1.18
void
nm_ip_routing_rule_unref (NMIPRoutingRule *self
);
Decreases the reference count of the instance and destroys the instance if the reference count reaches zero.
Since 1.42, ref-counting of NMIPRoutingRule is thread-safe.
Since: 1.18
gboolean
nm_ip_routing_rule_is_sealed (const NMIPRoutingRule *self
);
Since: 1.18
void
nm_ip_routing_rule_seal (NMIPRoutingRule *self
);
Seals the routing rule. Afterwards, the instance can no longer be
modified, and it is a bug to call any of the accessors that would
modify the rule. If self
was already sealed, this has no effect.
Since: 1.18
int
nm_ip_routing_rule_get_addr_family (const NMIPRoutingRule *self
);
Since: 1.18
gboolean
nm_ip_routing_rule_get_invert (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_invert (NMIPRoutingRule *self
,gboolean invert
);
Since: 1.18
gint64
nm_ip_routing_rule_get_priority (const NMIPRoutingRule *self
);
the priority. A valid priority is in the range from
0 to G_MAXUINT32
. If unset, -1 is returned.
Since: 1.18
void nm_ip_routing_rule_set_priority (NMIPRoutingRule *self
,gint64 priority
);
A valid priority ranges from 0 to G_MAXUINT32
. "-1" is also allowed
to reset the priority. It is a bug calling this function with any
other value.
Since: 1.18
guint8
nm_ip_routing_rule_get_tos (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_tos (NMIPRoutingRule *self
,guint8 tos
);
Since: 1.18
guint8
nm_ip_routing_rule_get_ipproto (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_ipproto (NMIPRoutingRule *self
,guint8 ipproto
);
Since: 1.18
guint16
nm_ip_routing_rule_get_source_port_start
(const NMIPRoutingRule *self
);
Since: 1.18
guint16
nm_ip_routing_rule_get_source_port_end
(const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_source_port (NMIPRoutingRule *self
,guint16 start
,guint16 end
);
Since: 1.18
guint16
nm_ip_routing_rule_get_destination_port_start
(const NMIPRoutingRule *self
);
Since: 1.18
guint16
nm_ip_routing_rule_get_destination_port_end
(const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_destination_port (NMIPRoutingRule *self
,guint16 start
,guint16 end
);
Since: 1.18
guint32
nm_ip_routing_rule_get_fwmark (const NMIPRoutingRule *self
);
Since: 1.18
guint32
nm_ip_routing_rule_get_fwmask (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_fwmark (NMIPRoutingRule *self
,guint32 fwmark
,guint32 fwmask
);
Since: 1.18
guint8
nm_ip_routing_rule_get_from_len (const NMIPRoutingRule *self
);
Since: 1.18
const char *
nm_ip_routing_rule_get_from (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_from (NMIPRoutingRule *self
,const char *from
,guint8 len
);
Setting invalid values is accepted, but will later fail
during nm_ip_routing_rule_validate()
.
self |
the NMIPRoutingRule instance |
|
from |
the from/src address to set. The address family must match. |
[nullable] |
len |
the corresponding prefix length of the address. |
Since: 1.18
guint8
nm_ip_routing_rule_get_to_len (const NMIPRoutingRule *self
);
Since: 1.18
const char *
nm_ip_routing_rule_get_to (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_to (NMIPRoutingRule *self
,const char *to
,guint8 len
);
Setting invalid values is accepted, but will later fail
during nm_ip_routing_rule_validate()
.
self |
the NMIPRoutingRule instance |
|
to |
the to/dst address to set. The address family must match. |
[nullable] |
len |
the corresponding prefix length of the address.
If |
Since: 1.18
const char *
nm_ip_routing_rule_get_iifname (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_iifname (NMIPRoutingRule *self
,const char *iifname
);
The name supports C backslash escaping for non-UTF-8 characters.
Note that nm_ip_routing_rule_from_string()
too uses backslash
escaping when tokenizing the words by whitespace. So, in string
representation you'd get double backslashes.
self |
the NMIPRoutingRule instance. |
|
iifname |
the iifname to set or |
[nullable] |
Since: 1.18
const char *
nm_ip_routing_rule_get_oifname (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_oifname (NMIPRoutingRule *self
,const char *oifname
);
The name supports C backslash escaping for non-UTF-8 characters.
Note that nm_ip_routing_rule_from_string()
too uses backslash
escaping when tokenizing the words by whitespace. So, in string
representation you'd get double backslashes.
self |
the NMIPRoutingRule instance. |
|
oifname |
the oifname to set or |
[nullable] |
Since: 1.18
guint8
nm_ip_routing_rule_get_action (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_action (NMIPRoutingRule *self
,guint8 action
);
Note that currently only certain actions are allowed. nm_ip_routing_rule_validate()
will reject unsupported actions as invalid.
Since: 1.18
guint32
nm_ip_routing_rule_get_table (const NMIPRoutingRule *self
);
Since: 1.18
void nm_ip_routing_rule_set_table (NMIPRoutingRule *self
,guint32 table
);
Since: 1.18
gint32
nm_ip_routing_rule_get_suppress_prefixlength
(const NMIPRoutingRule *self
);
Since: 1.20
void nm_ip_routing_rule_set_suppress_prefixlength (NMIPRoutingRule *self
,gint32 suppress_prefixlength
);
self |
the NMIPRoutingRule instance |
|
suppress_prefixlength |
the suppress_prefixlength to set. The value -1 means unset. |
Since: 1.20
gboolean nm_ip_routing_rule_get_uid_range (const NMIPRoutingRule *self
,guint32 *out_range_start
,guint32 *out_range_end
);
self |
the NMIPRoutingRule instance |
|
out_range_start |
returns the start of the range or 0 if the range is not set. |
[out][optional] |
out_range_end |
returns the end of the range or 0 if the range is not set. |
[out][optional] |
TRUE
if a uid range is set.
This API was wrongly introduced in the header files for 1.32, but the symbols were not exported. The API only works since 1.34 and newer.
Since: 1.34
void nm_ip_routing_rule_set_uid_range (NMIPRoutingRule *self
,guint32 uid_range_start
,guint32 uid_range_end
);
For a valid range, start must be less or equal to end. If set to an invalid range, the range gets unset.
This API was wrongly introduced in the header files for 1.32, but the symbols were not exported. The API only works since 1.34 and newer.
self |
the NMIPRoutingRule instance |
|
uid_range_start |
the uid_range start to set. |
|
uid_range_end |
the uid_range start to set. |
Since: 1.34
int nm_ip_routing_rule_cmp (const NMIPRoutingRule *rule
,const NMIPRoutingRule *other
);
rule |
the NMIPRoutingRule instance to compare. |
[nullable] |
other |
the other NMIPRoutingRule instance to compare. |
[nullable] |
Since: 1.18
gboolean nm_ip_routing_rule_validate (const NMIPRoutingRule *self
,GError **error
);
self |
the NMIPRoutingRule instance to validate |
|
error |
the error result if validation fails. |
Since: 1.18
NMIPRoutingRule * nm_ip_routing_rule_from_string (const char *str
,NMIPRoutingRuleAsStringFlags to_string_flags
,GHashTable *extra_args
,GError **error
);
str |
the string representation to convert to an NMIPRoutingRule |
|
to_string_flags |
NMIPRoutingRuleAsStringFlags for controlling the string conversion. |
|
extra_args |
extra arguments for controlling the string conversion. Currently, not extra arguments are supported. |
[nullable] |
error |
the error reason. |
Since: 1.18
char * nm_ip_routing_rule_to_string (const NMIPRoutingRule *self
,NMIPRoutingRuleAsStringFlags to_string_flags
,GHashTable *extra_args
,GError **error
);
self |
the NMIPRoutingRule instance to convert to string. |
|
to_string_flags |
NMIPRoutingRuleAsStringFlags for controlling the string conversion. |
|
extra_args |
extra arguments for controlling the string conversion. Currently, not extra arguments are supported. |
[nullable] |
error |
the error reason. |
Since: 1.18
const char *
nm_setting_ip_config_get_method (NMSettingIPConfig *setting
);
the “method” property of the setting; see NMSettingIP4Config and NMSettingIP6Config for details of the methods available with each type.
guint
nm_setting_ip_config_get_num_dns (NMSettingIPConfig *setting
);
const char * nm_setting_ip_config_get_dns (NMSettingIPConfig *setting
,int idx
);
gboolean nm_setting_ip_config_add_dns (NMSettingIPConfig *setting
,const char *dns
);
Adds a new DNS server to the setting.
TRUE
if the DNS server was added; FALSE
if the server was already
known
Before 1.42, setting dns
to an invalid string was treated as user-error.
Now, also invalid DNS values can be set, but will be rejected later during
nm_connection_verify()
.
void nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting
,int idx
);
Removes the DNS server at index idx
.
gboolean nm_setting_ip_config_remove_dns_by_value (NMSettingIPConfig *setting
,const char *dns
);
Removes the DNS server dns
.
void
nm_setting_ip_config_clear_dns (NMSettingIPConfig *setting
);
Removes all configured DNS servers.
guint
nm_setting_ip_config_get_num_dns_searches
(NMSettingIPConfig *setting
);
const char * nm_setting_ip_config_get_dns_search (NMSettingIPConfig *setting
,int idx
);
gboolean nm_setting_ip_config_add_dns_search (NMSettingIPConfig *setting
,const char *dns_search
);
Adds a new DNS search domain to the setting.
void nm_setting_ip_config_remove_dns_search (NMSettingIPConfig *setting
,int idx
);
Removes the DNS search domain at index idx
.
gboolean nm_setting_ip_config_remove_dns_search_by_value (NMSettingIPConfig *setting
,const char *dns_search
);
Removes the DNS search domain dns_search
.
void
nm_setting_ip_config_clear_dns_searches
(NMSettingIPConfig *setting
);
Removes all configured DNS search domains.
guint
nm_setting_ip_config_get_num_dns_options
(NMSettingIPConfig *setting
);
Since: 1.2
gboolean
nm_setting_ip_config_has_dns_options (NMSettingIPConfig *setting
);
NMSettingIPConfig can have a list of dns-options. If the list is empty, there are two similar (but differentiated) states. Either the options are explicitly set to have no values, or the options are left undefined. The latter means to use a default configuration, while the former explicitly means "no-options".
Since: 1.2
const char * nm_setting_ip_config_get_dns_option (NMSettingIPConfig *setting
,guint idx
);
Since: 1.2
gboolean nm_setting_ip_config_add_dns_option (NMSettingIPConfig *setting
,const char *dns_option
);
Adds a new DNS option to the setting.
Since: 1.2
void nm_setting_ip_config_remove_dns_option (NMSettingIPConfig *setting
,int idx
);
Removes the DNS option at index idx
.
Since: 1.2
gboolean nm_setting_ip_config_remove_dns_option_by_value (NMSettingIPConfig *setting
,const char *dns_option
);
Removes the DNS option dns_option
.
Since: 1.2
void nm_setting_ip_config_clear_dns_options (NMSettingIPConfig *setting
,gboolean is_set
);
Removes all configured DNS options.
setting |
||
is_set |
the dns-options can be either empty or unset (default). Specify how to clear the options. |
Since: 1.2
int
nm_setting_ip_config_get_dns_priority (NMSettingIPConfig *setting
);
Since: 1.4
guint
nm_setting_ip_config_get_num_addresses
(NMSettingIPConfig *setting
);
NMIPAddress * nm_setting_ip_config_get_address (NMSettingIPConfig *setting
,int idx
);
gboolean nm_setting_ip_config_add_address (NMSettingIPConfig *setting
,NMIPAddress *address
);
Adds a new IP address and associated information to the setting. The given address is duplicated internally and is not changed by this function.
void nm_setting_ip_config_remove_address (NMSettingIPConfig *setting
,int idx
);
Removes the address at index idx
.
gboolean nm_setting_ip_config_remove_address_by_value (NMSettingIPConfig *setting
,NMIPAddress *address
);
Removes the address address
.
void
nm_setting_ip_config_clear_addresses (NMSettingIPConfig *setting
);
Removes all configured addresses.
const char *
nm_setting_ip_config_get_gateway (NMSettingIPConfig *setting
);
guint
nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting
);
NMIPRoute * nm_setting_ip_config_get_route (NMSettingIPConfig *setting
,int idx
);
gboolean nm_setting_ip_config_add_route (NMSettingIPConfig *setting
,NMIPRoute *route
);
Appends a new route and associated information to the setting. The
given route is duplicated internally and is not changed by this function.
If an identical route (considering attributes as well) already exists, the
route is not added and the function returns FALSE
.
Note that before 1.10, this function would not consider route attributes and not add a route that has an existing route with same dest/prefix,next_hop,metric parameters.
void nm_setting_ip_config_remove_route (NMSettingIPConfig *setting
,int idx
);
Removes the route at index idx
.
gboolean nm_setting_ip_config_remove_route_by_value (NMSettingIPConfig *setting
,NMIPRoute *route
);
Removes the first matching route that matches route
.
Note that before 1.10, this function would only compare dest/prefix,next_hop,metric
and ignore route attributes. Now, route
must match exactly.
void
nm_setting_ip_config_clear_routes (NMSettingIPConfig *setting
);
Removes all configured routes.
gint64
nm_setting_ip_config_get_route_metric (NMSettingIPConfig *setting
);
Returns the value contained in the “route-metric” property.
guint32
nm_setting_ip_config_get_route_table (NMSettingIPConfig *setting
);
Returns the value contained in the “route-table” property.
Since: 1.10
guint
nm_setting_ip_config_get_num_routing_rules
(NMSettingIPConfig *setting
);
Since: 1.18
NMIPRoutingRule * nm_setting_ip_config_get_routing_rule (NMSettingIPConfig *setting
,guint idx
);
Since: 1.18
void nm_setting_ip_config_add_routing_rule (NMSettingIPConfig *setting
,NMIPRoutingRule *routing_rule
);
Appends a new routing-rule and associated information to the setting. The given routing rules gets sealed and the reference count is incremented. The function does not check whether an identical rule already exists and always appends the rule to the end of the list.
setting |
||
routing_rule |
the NMIPRoutingRule to add. The address family of the added rule must be compatible with the setting. |
Since: 1.18
void nm_setting_ip_config_remove_routing_rule (NMSettingIPConfig *setting
,guint idx
);
Removes the routing_rule at index idx
.
Since: 1.18
void
nm_setting_ip_config_clear_routing_rules
(NMSettingIPConfig *setting
);
Removes all configured routing rules.
Since: 1.18
gboolean
nm_setting_ip_config_get_ignore_auto_routes
(NMSettingIPConfig *setting
);
Returns the value contained in the “ignore-auto-routes” property.
gboolean
nm_setting_ip_config_get_ignore_auto_dns
(NMSettingIPConfig *setting
);
Returns the value contained in the “ignore-auto-dns” property.
const char *
nm_setting_ip_config_get_dhcp_hostname
(NMSettingIPConfig *setting
);
Returns the value contained in the “dhcp-hostname” property.
gboolean
nm_setting_ip_config_get_dhcp_send_hostname
(NMSettingIPConfig *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.
gboolean
nm_setting_ip_config_get_never_default
(NMSettingIPConfig *setting
);
Returns the value contained in the “never-default” property.
gboolean
nm_setting_ip_config_get_may_fail (NMSettingIPConfig *setting
);
Returns the value contained in the “may-fail” property.
TRUE
if this connection doesn't require this type of IP
addressing to complete for the connection to succeed.
int
nm_setting_ip_config_get_dad_timeout (NMSettingIPConfig *setting
);
Since: 1.2
int
nm_setting_ip_config_get_dhcp_timeout (NMSettingIPConfig *setting
);
Returns the value contained in the “dhcp-timeout” property.
Since: 1.2
int
nm_setting_ip_config_get_required_timeout
(NMSettingIPConfig *setting
);
Returns the value contained in the “required-timeout” property.
Since: 1.34
const char *
nm_setting_ip_config_get_dhcp_iaid (NMSettingIPConfig *setting
);
Returns the value contained in the “dhcp-iaid” property.
Since: 1.42
NMDhcpHostnameFlags
nm_setting_ip_config_get_dhcp_hostname_flags
(NMSettingIPConfig *setting
);
Returns the value contained in the “dhcp-hostname-flags” property.
Since: 1.22
const char *const * nm_setting_ip_config_get_dhcp_reject_servers (NMSettingIPConfig *setting
,guint *out_len
);
A NULL
terminated array of DHCP reject servers. Even if no reject
servers are configured, this always returns a non NULL
value.
[array length=out_len zero-terminated=1][transfer none]
Since: 1.28
void nm_setting_ip_config_add_dhcp_reject_server (NMSettingIPConfig *setting
,const char *server
);
Adds a new DHCP reject server to the setting.
Since: 1.28
void nm_setting_ip_config_remove_dhcp_reject_server (NMSettingIPConfig *setting
,guint idx
);
Removes the DHCP reject server at index idx
.
Since: 1.28
void
nm_setting_ip_config_clear_dhcp_reject_servers
(NMSettingIPConfig *setting
);
Removes all configured DHCP reject servers.
Since: 1.28
NMTernary
nm_setting_ip_config_get_auto_route_ext_gw
(NMSettingIPConfig *setting
);
Since: 1.42
NMTernary
nm_setting_ip_config_get_replace_local_rule
(NMSettingIPConfig *setting
);
Since: 1.44
Compare flags for nm_ip_address_cmp_full()
.
no flags. |
||
when comparing two addresses, also consider their attributes. Warning: note that attributes are GVariants and they don't have a total order. In other words, if the address differs only by their attributes, the returned compare order is not total. In that case, the return value merely indicates equality (zero) or inequality. |
Since: 1.22
no flags selected. |
||
whether to allow parsing IPv4 addresses. |
||
whether to allow parsing
IPv6 addresses. If both |
||
if set, ensure that the rule verfies or fail. |
Since: 1.18
#define NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
#define NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname"
#define NM_SETTING_IP_CONFIG_DHCP_HOSTNAME_FLAGS "dhcp-hostname-flags"
#define NM_SETTING_IP_CONFIG_REQUIRED_TIMEOUT "required-timeout"
#define NM_SETTING_IP_CONFIG_DHCP_REJECT_SERVERS "dhcp-reject-servers"
#define NM_SETTING_IP_CONFIG_AUTO_ROUTE_EXT_GW "auto-route-ext-gw"
#define NM_SETTING_IP_CONFIG_REPLACE_LOCAL_RULE "replace-local-rule"
#define NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN "single-request-reopen"
NMDhcpHostnameFlags describe flags related to the DHCP hostname and FQDN.
no flag set. The default value from
Networkmanager global configuration is used. If such value is unset
or still zero, the DHCP request will use standard FQDN flags, i.e.
|
||
whether the server should do the A RR (FQDN-to-address) DNS updates. |
||
if set, the FQDN is encoded using canonical wire format. Otherwise it uses the deprecated ASCII encoding. This flag is allowed only for DHCPv4. |
||
when not set, request the
server to perform updates (the PTR RR and possibly the A RR
based on the |
||
when set, no FQDN flags are sent in the DHCP FQDN option. When cleared and all other FQDN flags are zero, standard FQDN flags are sent. This flag is incompatible with any other FQDN flag. |
Since: 1.22