Top |
NMSettingIPConfigNMSettingIPConfig — Abstract base class for IPv4 and IPv6 addressing, routing, and name service properties |
Functions
Properties
GPtrArray * | addresses | Read / Write |
gchar * | dhcp-hostname | Read / Write |
gboolean | dhcp-send-hostname | Read / Write / Construct |
GStrv | dns | Read / Write |
GStrv | dns-search | Read / Write |
gchar * | gateway | 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 * | routes | Read / Write |
Types and Values
#define | NM_SETTING_IP_CONFIG_METHOD |
#define | NM_SETTING_IP_CONFIG_DNS |
#define | NM_SETTING_IP_CONFIG_DNS_SEARCH |
#define | NM_SETTING_IP_CONFIG_ADDRESSES |
#define | NM_SETTING_IP_CONFIG_GATEWAY |
#define | NM_SETTING_IP_CONFIG_ROUTES |
#define | NM_SETTING_IP_CONFIG_ROUTE_METRIC |
#define | NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES |
#define | NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS |
#define | NM_SETTING_IP_CONFIG_DHCP_HOSTNAME |
#define | NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME |
#define | NM_SETTING_IP_CONFIG_NEVER_DEFAULT |
#define | NM_SETTING_IP_CONFIG_MAY_FAIL |
Object Hierarchy
GBoxed ├── NMIPAddress ╰── NMIPRoute GObject ╰── NMSetting ╰── NMSettingIPConfig ├── NMSettingIP4Config ╰── NMSettingIP6Config
Description
NMSettingIPConfig is the abstract base class of NMSettingIP4Config and NMSettingIP6Config, providing properties related to IP addressing, routing, and Domain Name Service.
Functions
nm_ip_address_new ()
NMIPAddress * nm_ip_address_new (int family
,const char *addr
,guint prefix
,GError **error
);
Creates a new NMIPAddress object.
nm_ip_address_new_binary ()
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
.
nm_ip_address_ref ()
void
nm_ip_address_ref (NMIPAddress *address
);
Increases the reference count of the object.
nm_ip_address_unref ()
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.
nm_ip_address_equal ()
gboolean nm_ip_address_equal (NMIPAddress *address
,NMIPAddress *other
);
Determines if two NMIPAddress objects contain the same address and prefix (attributes are not compared).
nm_ip_address_dup ()
NMIPAddress *
nm_ip_address_dup (NMIPAddress *address
);
Creates a copy of address
nm_ip_address_get_family ()
int
nm_ip_address_get_family (NMIPAddress *address
);
Gets the IP address family (eg, AF_INET) property of this address object.
nm_ip_address_get_address ()
const char *
nm_ip_address_get_address (NMIPAddress *address
);
Gets the IP address property of this address object.
nm_ip_address_set_address ()
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.
nm_ip_address_get_address_binary ()
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.
nm_ip_address_set_address_binary ()
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.
nm_ip_address_get_prefix ()
guint
nm_ip_address_get_prefix (NMIPAddress *address
);
Gets the IP address prefix (ie "24" or "30" etc) property of this address object.
nm_ip_address_set_prefix ()
void nm_ip_address_set_prefix (NMIPAddress *address
,guint prefix
);
Sets the IP address prefix property of this address object.
nm_ip_address_get_attribute_names ()
char **
nm_ip_address_get_attribute_names (NMIPAddress *address
);
Gets an array of attribute names defined on address
.
nm_ip_address_get_attribute ()
GVariant * nm_ip_address_get_attribute (NMIPAddress *address
,const char *name
);
Gets the value of the attribute with name name
on address
nm_ip_address_set_attribute ()
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.
Parameters
address |
the NMIPAddress |
|
name |
the name of an address attribute |
|
value |
the value. |
[transfer none][allow-none] |
nm_ip_route_new ()
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.
nm_ip_route_new_binary ()
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
.
nm_ip_route_ref ()
void
nm_ip_route_ref (NMIPRoute *route
);
Increases the reference count of the object.
nm_ip_route_unref ()
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.
nm_ip_route_equal ()
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.)
nm_ip_route_get_family ()
int
nm_ip_route_get_family (NMIPRoute *route
);
Gets the IP address family (eg, AF_INET) property of this route object.
nm_ip_route_get_dest ()
const char *
nm_ip_route_get_dest (NMIPRoute *route
);
Gets the IP destination address property of this route object.
nm_ip_route_set_dest ()
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_valid()
to check it.
nm_ip_route_get_dest_binary ()
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.
nm_ip_route_set_dest_binary ()
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.
nm_ip_route_get_prefix ()
guint
nm_ip_route_get_prefix (NMIPRoute *route
);
Gets the IP prefix (ie "24" or "30" etc) of this route.
nm_ip_route_set_prefix ()
void nm_ip_route_set_prefix (NMIPRoute *route
,guint prefix
);
Sets the prefix property of this route object.
nm_ip_route_get_next_hop ()
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.
nm_ip_route_set_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.
nm_ip_route_get_next_hop_binary ()
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.
nm_ip_route_set_next_hop_binary ()
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.
nm_ip_route_get_metric ()
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).
nm_ip_route_set_metric ()
void nm_ip_route_set_metric (NMIPRoute *route
,gint64 metric
);
Sets the metric property of this route object.
nm_ip_route_get_attribute_names ()
char **
nm_ip_route_get_attribute_names (NMIPRoute *route
);
Gets an array of attribute names defined on route
.
nm_ip_route_get_attribute ()
GVariant * nm_ip_route_get_attribute (NMIPRoute *route
,const char *name
);
Gets the value of the attribute with name name
on route
nm_ip_route_set_attribute ()
void nm_ip_route_set_attribute (NMIPRoute *route
,const char *name
,GVariant *value
);
Sets the named attribute on route
to the given value.
Parameters
route |
the NMIPRoute |
|
name |
the name of a route attribute |
|
value |
the value. |
[transfer none][allow-none] |
nm_setting_ip_config_get_method ()
const char *
nm_setting_ip_config_get_method (NMSettingIPConfig *setting
);
Returns
the “method” property of the setting; see NMSettingIP4Config and NMSettingIP6Config for details of the methods available with each type.
nm_setting_ip_config_get_num_dns ()
guint
nm_setting_ip_config_get_num_dns (NMSettingIPConfig *setting
);
nm_setting_ip_config_get_dns ()
const char * nm_setting_ip_config_get_dns (NMSettingIPConfig *setting
,int i
);
nm_setting_ip_config_add_dns ()
gboolean nm_setting_ip_config_add_dns (NMSettingIPConfig *setting
,const char *dns
);
Adds a new DNS server to the setting.
nm_setting_ip_config_remove_dns ()
void nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting
,int i
);
Removes the DNS server at index i
.
nm_setting_ip_config_remove_dns_by_value ()
gboolean nm_setting_ip_config_remove_dns_by_value (NMSettingIPConfig *setting
,const char *dns
);
Removes the DNS server dns
.
nm_setting_ip_config_clear_dns ()
void
nm_setting_ip_config_clear_dns (NMSettingIPConfig *setting
);
Removes all configured DNS servers.
nm_setting_ip_config_get_num_dns_searches ()
guint
nm_setting_ip_config_get_num_dns_searches
(NMSettingIPConfig *setting
);
nm_setting_ip_config_get_dns_search ()
const char * nm_setting_ip_config_get_dns_search (NMSettingIPConfig *setting
,int i
);
nm_setting_ip_config_add_dns_search ()
gboolean nm_setting_ip_config_add_dns_search (NMSettingIPConfig *setting
,const char *dns_search
);
Adds a new DNS search domain to the setting.
nm_setting_ip_config_remove_dns_search ()
void nm_setting_ip_config_remove_dns_search (NMSettingIPConfig *setting
,int i
);
Removes the DNS search domain at index i
.
nm_setting_ip_config_remove_dns_search_by_value ()
gboolean nm_setting_ip_config_remove_dns_search_by_value (NMSettingIPConfig *setting
,const char *dns_search
);
Removes the DNS search domain dns_search
.
nm_setting_ip_config_clear_dns_searches ()
void
nm_setting_ip_config_clear_dns_searches
(NMSettingIPConfig *setting
);
Removes all configured DNS search domains.
nm_setting_ip_config_get_num_addresses ()
guint
nm_setting_ip_config_get_num_addresses
(NMSettingIPConfig *setting
);
nm_setting_ip_config_get_address ()
NMIPAddress * nm_setting_ip_config_get_address (NMSettingIPConfig *setting
,int i
);
nm_setting_ip_config_add_address ()
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.
nm_setting_ip_config_remove_address ()
void nm_setting_ip_config_remove_address (NMSettingIPConfig *setting
,int i
);
Removes the address at index i
.
nm_setting_ip_config_remove_address_by_value ()
gboolean nm_setting_ip_config_remove_address_by_value (NMSettingIPConfig *setting
,NMIPAddress *address
);
Removes the address address
.
nm_setting_ip_config_clear_addresses ()
void
nm_setting_ip_config_clear_addresses (NMSettingIPConfig *setting
);
Removes all configured addresses.
nm_setting_ip_config_get_gateway ()
const char *
nm_setting_ip_config_get_gateway (NMSettingIPConfig *setting
);
nm_setting_ip_config_get_num_routes ()
guint
nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting
);
nm_setting_ip_config_get_route ()
NMIPRoute * nm_setting_ip_config_get_route (NMSettingIPConfig *setting
,int i
);
nm_setting_ip_config_add_route ()
gboolean nm_setting_ip_config_add_route (NMSettingIPConfig *setting
,NMIPRoute *route
);
Adds a new route and associated information to the setting. The given route is duplicated internally and is not changed by this function.
nm_setting_ip_config_remove_route ()
void nm_setting_ip_config_remove_route (NMSettingIPConfig *setting
,int i
);
Removes the route at index i
.
nm_setting_ip_config_remove_route_by_value ()
gboolean nm_setting_ip_config_remove_route_by_value (NMSettingIPConfig *setting
,NMIPRoute *route
);
Removes the route route
.
nm_setting_ip_config_clear_routes ()
void
nm_setting_ip_config_clear_routes (NMSettingIPConfig *setting
);
Removes all configured routes.
nm_setting_ip_config_get_route_metric ()
gint64
nm_setting_ip_config_get_route_metric (NMSettingIPConfig *setting
);
Returns the value contained in the “route-metric” property.
Returns
the route metric that is used for routes that don't explicitly specify a metric. See “route-metric” for more details.
nm_setting_ip_config_get_ignore_auto_routes ()
gboolean
nm_setting_ip_config_get_ignore_auto_routes
(NMSettingIPConfig *setting
);
Returns the value contained in the “ignore-auto-routes” property.
nm_setting_ip_config_get_ignore_auto_dns ()
gboolean
nm_setting_ip_config_get_ignore_auto_dns
(NMSettingIPConfig *setting
);
Returns the value contained in the “ignore-auto-dns” property.
nm_setting_ip_config_get_dhcp_hostname ()
const char *
nm_setting_ip_config_get_dhcp_hostname
(NMSettingIPConfig *setting
);
Returns the value contained in the “dhcp-hostname” property.
nm_setting_ip_config_get_dhcp_send_hostname ()
gboolean
nm_setting_ip_config_get_dhcp_send_hostname
(NMSettingIPConfig *setting
);
Returns the value contained in the “dhcp-send-hostname” property.
nm_setting_ip_config_get_never_default ()
gboolean
nm_setting_ip_config_get_never_default
(NMSettingIPConfig *setting
);
Returns the value contained in the “never-default” property.
nm_setting_ip_config_get_may_fail ()
gboolean
nm_setting_ip_config_get_may_fail (NMSettingIPConfig *setting
);
Returns the value contained in the “may-fail” property.
Types and Values
NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES
#define NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME
#define NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname"
Property Details
The “dhcp-send-hostname”
property
“dhcp-send-hostname” gboolean
Flags: Read / Write / Construct
Default value: TRUE
The “ignore-auto-dns”
property
“ignore-auto-dns” gboolean
Flags: Read / Write / Construct
Default value: FALSE
The “ignore-auto-routes”
property
“ignore-auto-routes” gboolean
Flags: Read / Write / Construct
Default value: FALSE
The “never-default”
property
“never-default” gboolean
Flags: Read / Write / Construct
Default value: FALSE
The “route-metric”
property
“route-metric” gint64
Flags: Read / Write / Construct
Allowed values: [-1,4294967295]
Default value: -1