| Top |
NMSettingIPConfigNMSettingIPConfig — Abstract base class for IPv4 and IPv6 addressing, routing, and name service properties |
| GPtrArray * | addresses | Read / Write |
| int | dad-timeout | Read / Write |
| char * | dhcp-hostname | Read / Write |
| guint | dhcp-hostname-flags | Read / Write |
| char * | dhcp-iaid | Read / Write |
| GStrv | dhcp-reject-servers | Read / Write |
| gboolean | dhcp-send-hostname | Read / Write |
| int | dhcp-timeout | Read / Write |
| GStrv | dns | Read / Write |
| GStrv | dns-options | Read / Write |
| int | dns-priority | Read / Write |
| GStrv | dns-search | Read / Write |
| char * | gateway | Read / Write |
| gboolean | ignore-auto-dns | Read / Write |
| gboolean | ignore-auto-routes | Read / Write |
| gboolean | may-fail | Read / Write |
| char * | method | Read / Write |
| gboolean | never-default | Read / Write |
| gint64 | route-metric | Read / Write |
| guint | route-table | Read / Write |
| GPtrArray * | routes | Read / Write |
GBoxed ├── NMIPAddress ├── NMIPRoute ╰── NMIPRoutingRule GFlags ├── NMDhcpHostnameFlags ├── NMIPAddressCmpFlags ╰── NMIPRoutingRuleAsStringFlags GObject ╰── NMSetting ╰── NMSettingIPConfig ├── NMSettingIP4Config ╰── NMSettingIP6Config
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. |
NMIPAddress *
nm_ip_address_dup (NMIPAddress *address);
Creates a copy of address
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][allow-none] |
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
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_utils_ipaddr_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][allow-none] |
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);
a newly created rule instance with
the same settings as rule
. Note that the instance will
always be unsealred.
[transfer full]
Since: 1.18
NMIPRoutingRule *
nm_ip_routing_rule_ref (NMIPRoutingRule *self);
Increases the reference count of the instance. This is not thread-safe.
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. This is not 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. |
[allow-none] |
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. |
[allow-none] |
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_s