2019-09-10 11:19:01 +02:00
|
|
|
// SPDX-License-Identifier: LGPL-2.1+
|
2014-09-16 16:42:46 -04:00
|
|
|
/*
|
2019-10-01 09:20:35 +02:00
|
|
|
* Copyright (C) 2007 - 2014 Red Hat, Inc.
|
|
|
|
|
* Copyright (C) 2007 - 2008 Novell, Inc.
|
2014-09-16 16:42:46 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef NM_SETTING_IP_CONFIG_H
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_H
|
|
|
|
|
|
|
|
|
|
#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
|
|
|
|
|
#error "Only <NetworkManager.h> can be included directly."
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "nm-setting.h"
|
2017-02-15 15:06:24 +01:00
|
|
|
#include "nm-utils.h"
|
2014-09-16 16:42:46 -04:00
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
2017-12-11 14:06:10 +01:00
|
|
|
#define NM_IP_ADDRESS_ATTRIBUTE_LABEL "label"
|
|
|
|
|
|
2014-09-16 16:42:46 -04:00
|
|
|
typedef struct NMIPAddress NMIPAddress;
|
|
|
|
|
|
|
|
|
|
GType nm_ip_address_get_type (void);
|
|
|
|
|
|
|
|
|
|
NMIPAddress *nm_ip_address_new (int family,
|
|
|
|
|
const char *addr,
|
|
|
|
|
guint prefix,
|
|
|
|
|
GError **error);
|
|
|
|
|
NMIPAddress *nm_ip_address_new_binary (int family,
|
|
|
|
|
gconstpointer addr,
|
|
|
|
|
guint prefix,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
|
|
|
|
void nm_ip_address_ref (NMIPAddress *address);
|
|
|
|
|
void nm_ip_address_unref (NMIPAddress *address);
|
|
|
|
|
gboolean nm_ip_address_equal (NMIPAddress *address,
|
|
|
|
|
NMIPAddress *other);
|
|
|
|
|
NMIPAddress *nm_ip_address_dup (NMIPAddress *address);
|
|
|
|
|
|
|
|
|
|
int nm_ip_address_get_family (NMIPAddress *address);
|
|
|
|
|
const char *nm_ip_address_get_address (NMIPAddress *address);
|
|
|
|
|
void nm_ip_address_set_address (NMIPAddress *address,
|
|
|
|
|
const char *addr);
|
|
|
|
|
void nm_ip_address_get_address_binary (NMIPAddress *address,
|
|
|
|
|
gpointer addr);
|
|
|
|
|
void nm_ip_address_set_address_binary (NMIPAddress *address,
|
|
|
|
|
gconstpointer addr);
|
|
|
|
|
guint nm_ip_address_get_prefix (NMIPAddress *address);
|
|
|
|
|
void nm_ip_address_set_prefix (NMIPAddress *address,
|
|
|
|
|
guint prefix);
|
|
|
|
|
|
2014-09-16 16:38:04 -04:00
|
|
|
char **nm_ip_address_get_attribute_names (NMIPAddress *address);
|
|
|
|
|
GVariant *nm_ip_address_get_attribute (NMIPAddress *address,
|
|
|
|
|
const char *name);
|
|
|
|
|
void nm_ip_address_set_attribute (NMIPAddress *address,
|
|
|
|
|
const char *name,
|
|
|
|
|
GVariant *value);
|
|
|
|
|
|
2014-09-16 16:42:46 -04:00
|
|
|
typedef struct NMIPRoute NMIPRoute;
|
|
|
|
|
|
|
|
|
|
GType nm_ip_route_get_type (void);
|
|
|
|
|
|
|
|
|
|
NMIPRoute *nm_ip_route_new (int family,
|
|
|
|
|
const char *dest,
|
|
|
|
|
guint prefix,
|
|
|
|
|
const char *next_hop,
|
2014-11-04 15:48:48 -05:00
|
|
|
gint64 metric,
|
2014-09-16 16:42:46 -04:00
|
|
|
GError **error);
|
|
|
|
|
NMIPRoute *nm_ip_route_new_binary (int family,
|
|
|
|
|
gconstpointer dest,
|
|
|
|
|
guint prefix,
|
|
|
|
|
gconstpointer next_hop,
|
2014-11-04 15:48:48 -05:00
|
|
|
gint64 metric,
|
2014-09-16 16:42:46 -04:00
|
|
|
GError **error);
|
|
|
|
|
|
|
|
|
|
void nm_ip_route_ref (NMIPRoute *route);
|
|
|
|
|
void nm_ip_route_unref (NMIPRoute *route);
|
|
|
|
|
gboolean nm_ip_route_equal (NMIPRoute *route,
|
|
|
|
|
NMIPRoute *other);
|
2017-09-27 12:40:43 +02:00
|
|
|
|
2019-02-16 14:51:09 +01:00
|
|
|
enum { /*< flags >*/
|
2017-09-27 12:40:43 +02:00
|
|
|
NM_IP_ROUTE_EQUAL_CMP_FLAGS_NONE = 0,
|
2019-02-16 14:51:09 +01:00
|
|
|
NM_IP_ROUTE_EQUAL_CMP_FLAGS_WITH_ATTRS = 0x1,
|
2017-09-27 12:40:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_10
|
|
|
|
|
gboolean nm_ip_route_equal_full (NMIPRoute *route,
|
|
|
|
|
NMIPRoute *other,
|
|
|
|
|
guint cmp_flags);
|
|
|
|
|
|
2014-09-16 16:42:46 -04:00
|
|
|
NMIPRoute *nm_ip_route_dup (NMIPRoute *route);
|
|
|
|
|
|
|
|
|
|
int nm_ip_route_get_family (NMIPRoute *route);
|
|
|
|
|
const char *nm_ip_route_get_dest (NMIPRoute *route);
|
|
|
|
|
void nm_ip_route_set_dest (NMIPRoute *route,
|
|
|
|
|
const char *dest);
|
|
|
|
|
void nm_ip_route_get_dest_binary (NMIPRoute *route,
|
|
|
|
|
gpointer dest);
|
|
|
|
|
void nm_ip_route_set_dest_binary (NMIPRoute *route,
|
|
|
|
|
gconstpointer dest);
|
|
|
|
|
guint nm_ip_route_get_prefix (NMIPRoute *route);
|
|
|
|
|
void nm_ip_route_set_prefix (NMIPRoute *route,
|
|
|
|
|
guint prefix);
|
|
|
|
|
const char *nm_ip_route_get_next_hop (NMIPRoute *route);
|
|
|
|
|
void nm_ip_route_set_next_hop (NMIPRoute *route,
|
|
|
|
|
const char *next_hop);
|
|
|
|
|
gboolean nm_ip_route_get_next_hop_binary (NMIPRoute *route,
|
|
|
|
|
gpointer next_hop);
|
|
|
|
|
void nm_ip_route_set_next_hop_binary (NMIPRoute *route,
|
|
|
|
|
gconstpointer next_hop);
|
2014-11-04 15:48:48 -05:00
|
|
|
gint64 nm_ip_route_get_metric (NMIPRoute *route);
|
2014-09-16 16:42:46 -04:00
|
|
|
void nm_ip_route_set_metric (NMIPRoute *route,
|
2014-11-04 15:48:48 -05:00
|
|
|
gint64 metric);
|
2014-09-16 16:42:46 -04:00
|
|
|
|
2014-09-16 16:38:04 -04:00
|
|
|
char **nm_ip_route_get_attribute_names (NMIPRoute *route);
|
|
|
|
|
GVariant *nm_ip_route_get_attribute (NMIPRoute *route,
|
|
|
|
|
const char *name);
|
|
|
|
|
void nm_ip_route_set_attribute (NMIPRoute *route,
|
|
|
|
|
const char *name,
|
|
|
|
|
GVariant *value);
|
2017-02-15 15:06:24 +01:00
|
|
|
NM_AVAILABLE_IN_1_8
|
|
|
|
|
const NMVariantAttributeSpec *const *nm_ip_route_get_variant_attribute_spec (void);
|
|
|
|
|
NM_AVAILABLE_IN_1_8
|
|
|
|
|
gboolean nm_ip_route_attribute_validate (const char *name,
|
|
|
|
|
GVariant *value,
|
|
|
|
|
int family,
|
|
|
|
|
gboolean *known,
|
|
|
|
|
GError **error);
|
2014-09-16 16:38:04 -04:00
|
|
|
|
2017-02-15 15:06:24 +01:00
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_CWND "cwnd"
|
2019-11-27 13:13:48 +01:00
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_FROM "from"
|
2017-02-15 15:06:24 +01:00
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_INITCWND "initcwnd"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_INITRWND "initrwnd"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_LOCK_CWND "lock-cwnd"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_LOCK_INITCWND "lock-initcwnd"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_LOCK_INITRWND "lock-initrwnd"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_LOCK_MTU "lock-mtu"
|
2019-11-27 13:13:48 +01:00
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_LOCK_WINDOW "lock-window"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_MTU "mtu"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_ONLINK "onlink"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_SRC "src"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_TABLE "table"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_TOS "tos"
|
|
|
|
|
#define NM_IP_ROUTE_ATTRIBUTE_WINDOW "window"
|
2014-10-19 17:30:10 -04:00
|
|
|
|
2019-03-13 09:18:49 +01:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
typedef struct NMIPRoutingRule NMIPRoutingRule;
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
GType nm_ip_routing_rule_get_type (void);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
NMIPRoutingRule *nm_ip_routing_rule_new (int addr_family);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
NMIPRoutingRule *nm_ip_routing_rule_new_clone (const NMIPRoutingRule *rule);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
NMIPRoutingRule *nm_ip_routing_rule_ref (NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_unref (NMIPRoutingRule *self);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
gboolean nm_ip_routing_rule_is_sealed (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_seal (NMIPRoutingRule *self);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
int nm_ip_routing_rule_get_addr_family (const NMIPRoutingRule *self);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
gboolean nm_ip_routing_rule_get_invert (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_invert (NMIPRoutingRule *self, gboolean invert);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
gint64 nm_ip_routing_rule_get_priority (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_priority (NMIPRoutingRule *self, gint64 priority);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint8 nm_ip_routing_rule_get_tos (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_tos (NMIPRoutingRule *self, guint8 tos);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint8 nm_ip_routing_rule_get_ipproto (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_ipproto (NMIPRoutingRule *self, guint8 ipproto);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint16 nm_ip_routing_rule_get_source_port_start (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint16 nm_ip_routing_rule_get_source_port_end (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_source_port (NMIPRoutingRule *self, guint16 start, guint16 end);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint16 nm_ip_routing_rule_get_destination_port_start (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint16 nm_ip_routing_rule_get_destination_port_end (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_destination_port (NMIPRoutingRule *self, guint16 start, guint16 end);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint32 nm_ip_routing_rule_get_fwmark (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint32 nm_ip_routing_rule_get_fwmask (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_fwmark (NMIPRoutingRule *self, guint32 fwmark, guint32 fwmask);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint8 nm_ip_routing_rule_get_from_len (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
const char *nm_ip_routing_rule_get_from (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_from (NMIPRoutingRule *self,
|
|
|
|
|
const char *from,
|
|
|
|
|
guint8 len);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint8 nm_ip_routing_rule_get_to_len (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
const char *nm_ip_routing_rule_get_to (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_to (NMIPRoutingRule *self,
|
|
|
|
|
const char *to,
|
|
|
|
|
guint8 len);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
const char *nm_ip_routing_rule_get_iifname (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_iifname (NMIPRoutingRule *self, const char *iifname);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
const char *nm_ip_routing_rule_get_oifname (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_oifname (NMIPRoutingRule *self, const char *oifname);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint8 nm_ip_routing_rule_get_action (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_action (NMIPRoutingRule *self, guint8 action);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint32 nm_ip_routing_rule_get_table (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_ip_routing_rule_set_table (NMIPRoutingRule *self, guint32 table);
|
|
|
|
|
|
2019-07-11 18:54:48 +02:00
|
|
|
NM_AVAILABLE_IN_1_20
|
|
|
|
|
gint32 nm_ip_routing_rule_get_suppress_prefixlength (const NMIPRoutingRule *self);
|
|
|
|
|
NM_AVAILABLE_IN_1_20
|
|
|
|
|
void nm_ip_routing_rule_set_suppress_prefixlength (NMIPRoutingRule *self, gint32 suppress_prefixlength);
|
|
|
|
|
|
2019-03-13 09:18:49 +01:00
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
int nm_ip_routing_rule_cmp (const NMIPRoutingRule *rule,
|
|
|
|
|
const NMIPRoutingRule *other);
|
|
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
gboolean nm_ip_routing_rule_validate (const NMIPRoutingRule *self,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMIPRoutingRuleAsStringFlags:
|
|
|
|
|
* @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_NONE: no flags selected.
|
|
|
|
|
* @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET: whether to allow parsing
|
|
|
|
|
* IPv4 addresses.
|
|
|
|
|
* @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET6: whether to allow parsing
|
|
|
|
|
* IPv6 addresses. If both @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET and
|
|
|
|
|
* @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET6 are unset, it's the same
|
|
|
|
|
* as setting them both.
|
|
|
|
|
* @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_VALIDATE: if set, ensure that the
|
|
|
|
|
* rule verfies or fail.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.18
|
|
|
|
|
*/
|
|
|
|
|
typedef enum { /*< flags >*/
|
|
|
|
|
NM_IP_ROUTING_RULE_AS_STRING_FLAGS_NONE = 0,
|
|
|
|
|
|
|
|
|
|
NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET = 0x1,
|
|
|
|
|
NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET6 = 0x2,
|
|
|
|
|
NM_IP_ROUTING_RULE_AS_STRING_FLAGS_VALIDATE = 0x4,
|
|
|
|
|
} NMIPRoutingRuleAsStringFlags;
|
|
|
|
|
|
2019-04-21 12:42:38 +02:00
|
|
|
NM_AVAILABLE_IN_1_18
|
2019-03-13 09:18:49 +01:00
|
|
|
NMIPRoutingRule *nm_ip_routing_rule_from_string (const char *str,
|
|
|
|
|
NMIPRoutingRuleAsStringFlags to_string_flags,
|
|
|
|
|
GHashTable *extra_args,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
2019-04-21 12:42:38 +02:00
|
|
|
NM_AVAILABLE_IN_1_18
|
2019-03-13 09:18:49 +01:00
|
|
|
char *nm_ip_routing_rule_to_string (const NMIPRoutingRule *self,
|
|
|
|
|
NMIPRoutingRuleAsStringFlags to_string_flags,
|
|
|
|
|
GHashTable *extra_args,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2014-10-19 17:30:10 -04:00
|
|
|
#define NM_TYPE_SETTING_IP_CONFIG (nm_setting_ip_config_get_type ())
|
|
|
|
|
#define NM_SETTING_IP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfig))
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_IPCONFIG, NMSettingIPConfigClass))
|
|
|
|
|
#define NM_IS_SETTING_IP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_IP_CONFIG))
|
|
|
|
|
#define NM_IS_SETTING_IP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_IP_CONFIG))
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfigClass))
|
|
|
|
|
|
2015-09-07 18:00:10 +02:00
|
|
|
#define NM_SETTING_IP_CONFIG_DAD_TIMEOUT_MAX 30000
|
|
|
|
|
|
2014-10-19 17:30:10 -04:00
|
|
|
#define NM_SETTING_IP_CONFIG_METHOD "method"
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_DNS "dns"
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_DNS_SEARCH "dns-search"
|
2015-03-26 08:57:02 +01:00
|
|
|
#define NM_SETTING_IP_CONFIG_DNS_OPTIONS "dns-options"
|
2016-04-23 15:57:04 +02:00
|
|
|
#define NM_SETTING_IP_CONFIG_DNS_PRIORITY "dns-priority"
|
2014-10-19 17:30:10 -04:00
|
|
|
#define NM_SETTING_IP_CONFIG_ADDRESSES "addresses"
|
2014-10-20 21:30:56 -04:00
|
|
|
#define NM_SETTING_IP_CONFIG_GATEWAY "gateway"
|
2014-10-19 17:30:10 -04:00
|
|
|
#define NM_SETTING_IP_CONFIG_ROUTES "routes"
|
2014-08-27 19:57:24 +02:00
|
|
|
#define NM_SETTING_IP_CONFIG_ROUTE_METRIC "route-metric"
|
all: rework configuring route table support by adding "route-table" setting
We added "ipv4.route-table-sync" and "ipv6.route-table-sync" to not change
behavior for users that configured policy routing outside of NetworkManager,
for example, via a dispatcher script. Users had to explicitly opt-in
for NetworkManager to fully manage all routing tables.
These settings were awkward. Replace them with new settings "ipv4.route-table"
and "ipv6.route-table". Note that this commit breaks API/ABI on the unstable
development branch by removing recently added API.
As before, a connection will have no route-table set by default. This
has the meaning that policy-routing is not enabled and only the main table
will be fully synced. Once the user sets a table, we recognize that and
NetworkManager manages all routing tables.
The new route-table setting has other important uses: analog to
"ipv4.route-metric", it is the default that applies to all routes.
Currently it only works for static routes, not DHCP, SLAAC,
default-route, etc. That will be implemented later.
For static routes, each route still can explicitly set a table, and
overwrite the per-connection setting in "ipv4.route-table" and
"ipv6.route-table".
2017-09-28 08:40:41 +02:00
|
|
|
#define NM_SETTING_IP_CONFIG_ROUTE_TABLE "route-table"
|
2014-10-19 17:30:10 -04:00
|
|
|
#define NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_DHCP_HOSTNAME "dhcp-hostname"
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname"
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_NEVER_DEFAULT "never-default"
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_MAY_FAIL "may-fail"
|
2015-09-07 18:00:10 +02:00
|
|
|
#define NM_SETTING_IP_CONFIG_DAD_TIMEOUT "dad-timeout"
|
2016-02-03 11:12:07 +01:00
|
|
|
#define NM_SETTING_IP_CONFIG_DHCP_TIMEOUT "dhcp-timeout"
|
2019-10-15 10:27:10 +02:00
|
|
|
#define NM_SETTING_IP_CONFIG_DHCP_IAID "dhcp-iaid"
|
2014-10-19 17:30:10 -04:00
|
|
|
|
2019-03-14 12:04:21 +01:00
|
|
|
/* these are not real GObject properties. */
|
|
|
|
|
#define NM_SETTING_IP_CONFIG_ROUTING_RULES "routing-rules"
|
|
|
|
|
|
2015-03-26 08:57:02 +01:00
|
|
|
#define NM_SETTING_DNS_OPTION_DEBUG "debug"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_NDOTS "ndots"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_TIMEOUT "timeout"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_ATTEMPTS "attempts"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_ROTATE "rotate"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_NO_CHECK_NAMES "no-check-names"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_INET6 "inet6"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_IP6_BYTESTRING "ip6-bytestring"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_IP6_DOTINT "ip6-dotint"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_NO_IP6_DOTINT "no-ip6-dotint"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_EDNS0 "edns0"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_SINGLE_REQUEST "single-request"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN "single-request-reopen"
|
|
|
|
|
#define NM_SETTING_DNS_OPTION_NO_TLD_QUERY "no-tld-query"
|
2016-04-03 23:08:38 +02:00
|
|
|
#define NM_SETTING_DNS_OPTION_USE_VC "use-vc"
|
2015-03-26 08:57:02 +01:00
|
|
|
|
2016-05-05 09:36:32 +02:00
|
|
|
/**
|
|
|
|
|
* NMSettingIPConfig:
|
|
|
|
|
*/
|
2014-10-19 17:30:10 -04:00
|
|
|
struct _NMSettingIPConfig {
|
|
|
|
|
NMSetting parent;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
NMSettingClass parent;
|
|
|
|
|
|
|
|
|
|
/* Padding for future expansion */
|
|
|
|
|
gpointer padding[8];
|
|
|
|
|
} NMSettingIPConfigClass;
|
|
|
|
|
|
|
|
|
|
GType nm_setting_ip_config_get_type (void);
|
|
|
|
|
|
|
|
|
|
const char *nm_setting_ip_config_get_method (NMSettingIPConfig *setting);
|
|
|
|
|
|
|
|
|
|
guint nm_setting_ip_config_get_num_dns (NMSettingIPConfig *setting);
|
|
|
|
|
const char *nm_setting_ip_config_get_dns (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
int idx);
|
2014-10-19 17:30:10 -04:00
|
|
|
gboolean nm_setting_ip_config_add_dns (NMSettingIPConfig *setting,
|
|
|
|
|
const char *dns);
|
|
|
|
|
void nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
int idx);
|
2014-10-19 17:30:10 -04:00
|
|
|
gboolean nm_setting_ip_config_remove_dns_by_value (NMSettingIPConfig *setting,
|
|
|
|
|
const char *dns);
|
|
|
|
|
void nm_setting_ip_config_clear_dns (NMSettingIPConfig *setting);
|
|
|
|
|
|
|
|
|
|
guint nm_setting_ip_config_get_num_dns_searches (NMSettingIPConfig *setting);
|
|
|
|
|
const char *nm_setting_ip_config_get_dns_search (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
int idx);
|
2014-10-19 17:30:10 -04:00
|
|
|
gboolean nm_setting_ip_config_add_dns_search (NMSettingIPConfig *setting,
|
|
|
|
|
const char *dns_search);
|
|
|
|
|
void nm_setting_ip_config_remove_dns_search (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
int idx);
|
2014-10-19 17:30:10 -04:00
|
|
|
gboolean nm_setting_ip_config_remove_dns_search_by_value (NMSettingIPConfig *setting,
|
|
|
|
|
const char *dns_search);
|
|
|
|
|
void nm_setting_ip_config_clear_dns_searches (NMSettingIPConfig *setting);
|
|
|
|
|
|
2015-03-26 08:57:02 +01:00
|
|
|
guint nm_setting_ip_config_get_num_dns_options (NMSettingIPConfig *setting);
|
2015-05-20 13:19:35 +02:00
|
|
|
gboolean nm_setting_ip_config_has_dns_options (NMSettingIPConfig *setting);
|
2015-03-26 08:57:02 +01:00
|
|
|
const char *nm_setting_ip_config_get_dns_option (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
guint idx);
|
all: don't use gchar/gshort/gint/glong but C types
We commonly don't use the glib typedefs for char/short/int/long,
but their C types directly.
$ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l
587
$ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l
21114
One could argue that using the glib typedefs is preferable in
public API (of our glib based libnm library) or where it clearly
is related to glib, like during
g_object_set (obj, PROPERTY, (gint) value, NULL);
However, that argument does not seem strong, because in practice we don't
follow that argument today, and seldomly use the glib typedefs.
Also, the style guide for this would be hard to formalize, because
"using them where clearly related to a glib" is a very loose suggestion.
Also note that glib typedefs will always just be typedefs of the
underlying C types. There is no danger of glib changing the meaning
of these typedefs (because that would be a major API break of glib).
A simple style guide is instead: don't use these typedefs.
No manual actions, I only ran the bash script:
FILES=($(git ls-files '*.[hc]'))
sed -i \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\> /\1 /g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \
"${FILES[@]}"
2018-07-11 07:40:19 +02:00
|
|
|
int nm_setting_ip_config_next_valid_dns_option (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
guint idx);
|
2015-03-26 08:57:02 +01:00
|
|
|
gboolean nm_setting_ip_config_add_dns_option (NMSettingIPConfig *setting,
|
|
|
|
|
const char *dns_option);
|
|
|
|
|
void nm_setting_ip_config_remove_dns_option (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
int idx);
|
2015-03-26 08:57:02 +01:00
|
|
|
gboolean nm_setting_ip_config_remove_dns_option_by_value (NMSettingIPConfig *setting,
|
|
|
|
|
const char *dns_option);
|
2015-05-20 13:19:35 +02:00
|
|
|
void nm_setting_ip_config_clear_dns_options (NMSettingIPConfig *setting, gboolean is_set);
|
2015-03-26 08:57:02 +01:00
|
|
|
|
2016-04-23 15:57:04 +02:00
|
|
|
NM_AVAILABLE_IN_1_4
|
all: don't use gchar/gshort/gint/glong but C types
We commonly don't use the glib typedefs for char/short/int/long,
but their C types directly.
$ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l
587
$ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l
21114
One could argue that using the glib typedefs is preferable in
public API (of our glib based libnm library) or where it clearly
is related to glib, like during
g_object_set (obj, PROPERTY, (gint) value, NULL);
However, that argument does not seem strong, because in practice we don't
follow that argument today, and seldomly use the glib typedefs.
Also, the style guide for this would be hard to formalize, because
"using them where clearly related to a glib" is a very loose suggestion.
Also note that glib typedefs will always just be typedefs of the
underlying C types. There is no danger of glib changing the meaning
of these typedefs (because that would be a major API break of glib).
A simple style guide is instead: don't use these typedefs.
No manual actions, I only ran the bash script:
FILES=($(git ls-files '*.[hc]'))
sed -i \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\> /\1 /g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \
"${FILES[@]}"
2018-07-11 07:40:19 +02:00
|
|
|
int nm_setting_ip_config_get_dns_priority (NMSettingIPConfig *setting);
|
2016-04-23 15:57:04 +02:00
|
|
|
|
2014-10-19 17:30:10 -04:00
|
|
|
guint nm_setting_ip_config_get_num_addresses (NMSettingIPConfig *setting);
|
|
|
|
|
NMIPAddress *nm_setting_ip_config_get_address (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
int idx);
|
2014-10-19 17:30:10 -04:00
|
|
|
gboolean nm_setting_ip_config_add_address (NMSettingIPConfig *setting,
|
|
|
|
|
NMIPAddress *address);
|
|
|
|
|
void nm_setting_ip_config_remove_address (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
int idx);
|
2014-10-19 17:30:10 -04:00
|
|
|
gboolean nm_setting_ip_config_remove_address_by_value (NMSettingIPConfig *setting,
|
|
|
|
|
NMIPAddress *address);
|
|
|
|
|
void nm_setting_ip_config_clear_addresses (NMSettingIPConfig *setting);
|
|
|
|
|
|
2014-10-20 21:30:56 -04:00
|
|
|
const char *nm_setting_ip_config_get_gateway (NMSettingIPConfig *setting);
|
|
|
|
|
|
2014-10-19 17:30:10 -04:00
|
|
|
guint nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting);
|
|
|
|
|
NMIPRoute *nm_setting_ip_config_get_route (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
int idx);
|
2014-10-19 17:30:10 -04:00
|
|
|
gboolean nm_setting_ip_config_add_route (NMSettingIPConfig *setting,
|
|
|
|
|
NMIPRoute *route);
|
|
|
|
|
void nm_setting_ip_config_remove_route (NMSettingIPConfig *setting,
|
2015-04-22 16:59:47 +02:00
|
|
|
int idx);
|
2014-10-19 17:30:10 -04:00
|
|
|
gboolean nm_setting_ip_config_remove_route_by_value (NMSettingIPConfig *setting,
|
|
|
|
|
NMIPRoute *route);
|
|
|
|
|
void nm_setting_ip_config_clear_routes (NMSettingIPConfig *setting);
|
|
|
|
|
|
2014-08-27 19:57:24 +02:00
|
|
|
gint64 nm_setting_ip_config_get_route_metric (NMSettingIPConfig *setting);
|
|
|
|
|
|
all: rework configuring route table support by adding "route-table" setting
We added "ipv4.route-table-sync" and "ipv6.route-table-sync" to not change
behavior for users that configured policy routing outside of NetworkManager,
for example, via a dispatcher script. Users had to explicitly opt-in
for NetworkManager to fully manage all routing tables.
These settings were awkward. Replace them with new settings "ipv4.route-table"
and "ipv6.route-table". Note that this commit breaks API/ABI on the unstable
development branch by removing recently added API.
As before, a connection will have no route-table set by default. This
has the meaning that policy-routing is not enabled and only the main table
will be fully synced. Once the user sets a table, we recognize that and
NetworkManager manages all routing tables.
The new route-table setting has other important uses: analog to
"ipv4.route-metric", it is the default that applies to all routes.
Currently it only works for static routes, not DHCP, SLAAC,
default-route, etc. That will be implemented later.
For static routes, each route still can explicitly set a table, and
overwrite the per-connection setting in "ipv4.route-table" and
"ipv6.route-table".
2017-09-28 08:40:41 +02:00
|
|
|
NM_AVAILABLE_IN_1_10
|
|
|
|
|
guint32 nm_setting_ip_config_get_route_table (NMSettingIPConfig *setting);
|
|
|
|
|
|
2019-03-14 12:04:21 +01:00
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
guint nm_setting_ip_config_get_num_routing_rules (NMSettingIPConfig *setting);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
NMIPRoutingRule *nm_setting_ip_config_get_routing_rule (NMSettingIPConfig *setting,
|
|
|
|
|
guint idx);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_setting_ip_config_add_routing_rule (NMSettingIPConfig *setting,
|
|
|
|
|
NMIPRoutingRule *routing_rule);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_setting_ip_config_remove_routing_rule (NMSettingIPConfig *setting,
|
|
|
|
|
guint idx);
|
|
|
|
|
NM_AVAILABLE_IN_1_18
|
|
|
|
|
void nm_setting_ip_config_clear_routing_rules (NMSettingIPConfig *setting);
|
|
|
|
|
|
2014-10-19 17:30:10 -04:00
|
|
|
gboolean nm_setting_ip_config_get_ignore_auto_routes (NMSettingIPConfig *setting);
|
|
|
|
|
gboolean nm_setting_ip_config_get_ignore_auto_dns (NMSettingIPConfig *setting);
|
|
|
|
|
|
|
|
|
|
const char *nm_setting_ip_config_get_dhcp_hostname (NMSettingIPConfig *setting);
|
|
|
|
|
gboolean nm_setting_ip_config_get_dhcp_send_hostname (NMSettingIPConfig *setting);
|
|
|
|
|
|
|
|
|
|
gboolean nm_setting_ip_config_get_never_default (NMSettingIPConfig *setting);
|
|
|
|
|
gboolean nm_setting_ip_config_get_may_fail (NMSettingIPConfig *setting);
|
2015-09-07 18:00:10 +02:00
|
|
|
NM_AVAILABLE_IN_1_2
|
all: don't use gchar/gshort/gint/glong but C types
We commonly don't use the glib typedefs for char/short/int/long,
but their C types directly.
$ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l
587
$ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l
21114
One could argue that using the glib typedefs is preferable in
public API (of our glib based libnm library) or where it clearly
is related to glib, like during
g_object_set (obj, PROPERTY, (gint) value, NULL);
However, that argument does not seem strong, because in practice we don't
follow that argument today, and seldomly use the glib typedefs.
Also, the style guide for this would be hard to formalize, because
"using them where clearly related to a glib" is a very loose suggestion.
Also note that glib typedefs will always just be typedefs of the
underlying C types. There is no danger of glib changing the meaning
of these typedefs (because that would be a major API break of glib).
A simple style guide is instead: don't use these typedefs.
No manual actions, I only ran the bash script:
FILES=($(git ls-files '*.[hc]'))
sed -i \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\> /\1 /g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \
"${FILES[@]}"
2018-07-11 07:40:19 +02:00
|
|
|
int nm_setting_ip_config_get_dad_timeout (NMSettingIPConfig *setting);
|
2016-02-03 11:12:07 +01:00
|
|
|
NM_AVAILABLE_IN_1_2
|
all: don't use gchar/gshort/gint/glong but C types
We commonly don't use the glib typedefs for char/short/int/long,
but their C types directly.
$ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l
587
$ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l
21114
One could argue that using the glib typedefs is preferable in
public API (of our glib based libnm library) or where it clearly
is related to glib, like during
g_object_set (obj, PROPERTY, (gint) value, NULL);
However, that argument does not seem strong, because in practice we don't
follow that argument today, and seldomly use the glib typedefs.
Also, the style guide for this would be hard to formalize, because
"using them where clearly related to a glib" is a very loose suggestion.
Also note that glib typedefs will always just be typedefs of the
underlying C types. There is no danger of glib changing the meaning
of these typedefs (because that would be a major API break of glib).
A simple style guide is instead: don't use these typedefs.
No manual actions, I only ran the bash script:
FILES=($(git ls-files '*.[hc]'))
sed -i \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\> /\1 /g' \
-e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \
"${FILES[@]}"
2018-07-11 07:40:19 +02:00
|
|
|
int nm_setting_ip_config_get_dhcp_timeout (NMSettingIPConfig *setting);
|
2019-10-15 10:27:10 +02:00
|
|
|
NM_AVAILABLE_IN_1_22
|
|
|
|
|
const char *nm_setting_ip_config_get_dhcp_iaid (NMSettingIPConfig *setting);
|
2014-10-19 17:30:10 -04:00
|
|
|
|
2014-09-16 16:42:46 -04:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif /* NM_SETTING_IP_CONFIG_H */
|