summary refs log tree commit diff
path: root/libnm-core/nm-setting-ip-config.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2019-12-18 18:29:24 +0100
committerMichael Biebl <biebl@debian.org>2019-12-18 18:29:24 +0100
commit28028b26b3371756811e95d894f709f4b1207c00 (patch)
tree6fe7316fd743b51042db47601a8ef8814b3134ac /libnm-core/nm-setting-ip-config.h
parente22609983008e1a669196ad64ba3a59ae8c76e0d (diff)
New upstream version 1.22.0 upstream/1.22.0
Diffstat (limited to 'libnm-core/nm-setting-ip-config.h')
-rw-r--r--libnm-core/nm-setting-ip-config.h141
1 files changed, 98 insertions, 43 deletions
diff --git a/libnm-core/nm-setting-ip-config.h b/libnm-core/nm-setting-ip-config.h
index 4a522367..ef3671c4 100644
--- a/libnm-core/nm-setting-ip-config.h
+++ b/libnm-core/nm-setting-ip-config.h
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: LGPL-2.1+
 /*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2014 Red Hat, Inc.
- * Copyright 2007 - 2008 Novell, Inc.
+ * Copyright (C) 2007 - 2014 Red Hat, Inc.
+ * Copyright (C) 2007 - 2008 Novell, Inc.
  */
 
 #ifndef NM_SETTING_IP_CONFIG_H
@@ -32,6 +18,24 @@ G_BEGIN_DECLS
 
 #define NM_IP_ADDRESS_ATTRIBUTE_LABEL        "label"
 
+/**
+ * NMIPAddressCmpFlags:
+ * @NM_IP_ADDRESS_CMP_FLAGS_NONE: no flags.
+ * @NM_IP_ADDRESS_CMP_FLAGS_WITH_ATTRS: 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.
+ *
+ * Compare flags for nm_ip_address_cmp_full().
+ *
+ * Since: 1.22
+ */
+typedef enum { /*< flags >*/
+	NM_IP_ADDRESS_CMP_FLAGS_NONE       = 0,
+	NM_IP_ADDRESS_CMP_FLAGS_WITH_ATTRS = 0x1,
+} NMIPAddressCmpFlags;
+
 typedef struct NMIPAddress NMIPAddress;
 
 GType        nm_ip_address_get_type            (void);
@@ -49,6 +53,10 @@ void         nm_ip_address_ref                 (NMIPAddress *address);
 void         nm_ip_address_unref               (NMIPAddress *address);
 gboolean     nm_ip_address_equal               (NMIPAddress *address,
                                                 NMIPAddress *other);
+NM_AVAILABLE_IN_1_22
+int          nm_ip_address_cmp_full            (const NMIPAddress *a,
+                                                const NMIPAddress *b,
+                                                NMIPAddressCmpFlags cmp_flags);
 NMIPAddress *nm_ip_address_dup                 (NMIPAddress *address);
 
 int          nm_ip_address_get_family          (NMIPAddress *address);
@@ -141,21 +149,22 @@ gboolean     nm_ip_route_attribute_validate  (const char *name,
                                               gboolean *known,
                                               GError **error);
 
-#define NM_IP_ROUTE_ATTRIBUTE_TABLE          "table"
-#define NM_IP_ROUTE_ATTRIBUTE_SRC            "src"
-#define NM_IP_ROUTE_ATTRIBUTE_FROM           "from"
-#define NM_IP_ROUTE_ATTRIBUTE_TOS            "tos"
-#define NM_IP_ROUTE_ATTRIBUTE_ONLINK         "onlink"
-#define NM_IP_ROUTE_ATTRIBUTE_WINDOW         "window"
 #define NM_IP_ROUTE_ATTRIBUTE_CWND           "cwnd"
+#define NM_IP_ROUTE_ATTRIBUTE_FROM           "from"
 #define NM_IP_ROUTE_ATTRIBUTE_INITCWND       "initcwnd"
 #define NM_IP_ROUTE_ATTRIBUTE_INITRWND       "initrwnd"
-#define NM_IP_ROUTE_ATTRIBUTE_MTU            "mtu"
-#define NM_IP_ROUTE_ATTRIBUTE_LOCK_WINDOW    "lock-window"
 #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"
+#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_SCOPE          "scope"
+#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"
 
 /*****************************************************************************/
 
@@ -320,24 +329,26 @@ char *nm_ip_routing_rule_to_string (const NMIPRoutingRule *self,
 
 #define NM_SETTING_IP_CONFIG_DAD_TIMEOUT_MAX     30000
 
-#define NM_SETTING_IP_CONFIG_METHOD             "method"
-#define NM_SETTING_IP_CONFIG_DNS                "dns"
-#define NM_SETTING_IP_CONFIG_DNS_SEARCH         "dns-search"
-#define NM_SETTING_IP_CONFIG_DNS_OPTIONS        "dns-options"
-#define NM_SETTING_IP_CONFIG_DNS_PRIORITY       "dns-priority"
-#define NM_SETTING_IP_CONFIG_ADDRESSES          "addresses"
-#define NM_SETTING_IP_CONFIG_GATEWAY            "gateway"
-#define NM_SETTING_IP_CONFIG_ROUTES             "routes"
-#define NM_SETTING_IP_CONFIG_ROUTE_METRIC       "route-metric"
-#define NM_SETTING_IP_CONFIG_ROUTE_TABLE        "route-table"
-#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"
-#define NM_SETTING_IP_CONFIG_DAD_TIMEOUT        "dad-timeout"
-#define NM_SETTING_IP_CONFIG_DHCP_TIMEOUT       "dhcp-timeout"
+#define NM_SETTING_IP_CONFIG_METHOD              "method"
+#define NM_SETTING_IP_CONFIG_DNS                 "dns"
+#define NM_SETTING_IP_CONFIG_DNS_SEARCH          "dns-search"
+#define NM_SETTING_IP_CONFIG_DNS_OPTIONS         "dns-options"
+#define NM_SETTING_IP_CONFIG_DNS_PRIORITY        "dns-priority"
+#define NM_SETTING_IP_CONFIG_ADDRESSES           "addresses"
+#define NM_SETTING_IP_CONFIG_GATEWAY             "gateway"
+#define NM_SETTING_IP_CONFIG_ROUTES              "routes"
+#define NM_SETTING_IP_CONFIG_ROUTE_METRIC        "route-metric"
+#define NM_SETTING_IP_CONFIG_ROUTE_TABLE         "route-table"
+#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_DHCP_HOSTNAME_FLAGS "dhcp-hostname-flags"
+#define NM_SETTING_IP_CONFIG_NEVER_DEFAULT       "never-default"
+#define NM_SETTING_IP_CONFIG_MAY_FAIL            "may-fail"
+#define NM_SETTING_IP_CONFIG_DAD_TIMEOUT         "dad-timeout"
+#define NM_SETTING_IP_CONFIG_DHCP_TIMEOUT        "dhcp-timeout"
+#define NM_SETTING_IP_CONFIG_DHCP_IAID           "dhcp-iaid"
 
 /* these are not real GObject properties. */
 #define NM_SETTING_IP_CONFIG_ROUTING_RULES      "routing-rules"
@@ -372,6 +383,45 @@ typedef struct {
 	gpointer padding[8];
 } NMSettingIPConfigClass;
 
+/**
+ * NMDhcpHostnameFlags:
+ * @NM_DHCP_HOSTNAME_FLAG_NONE: 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.
+ *   %NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE and
+ *   %NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED for IPv4 and
+ *   %NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE for IPv6.
+ * @NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE: whether the server should
+ *   do the A RR (FQDN-to-address) DNS updates.
+ * @NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED: if set, the FQDN is encoded
+ *   using canonical wire format. Otherwise it uses the deprecated
+ *   ASCII encoding. This flag is allowed only for DHCPv4.
+ * @NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE: when not set, request the
+ *   server to perform updates (the PTR RR and possibly the A RR
+ *   based on the %NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE flag). If
+ *   this is set, the %NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE flag
+ *   should be cleared.
+ * @NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS: 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.
+ *
+ * #NMDhcpHostnameFlags describe flags related to the DHCP hostname and
+ * FQDN.
+ *
+ * Since: 1.22
+ */
+typedef enum { /*< flags >*/
+	NM_DHCP_HOSTNAME_FLAG_NONE             = 0x0,
+
+	NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE = 0x1,
+	NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED     = 0x2,
+	NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE   = 0x4,
+
+	NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS = 0x8,
+
+} NMDhcpHostnameFlags;
+
 GType nm_setting_ip_config_get_type (void);
 
 const char   *nm_setting_ip_config_get_method                 (NMSettingIPConfig *setting);
@@ -470,6 +520,11 @@ NM_AVAILABLE_IN_1_2
 int           nm_setting_ip_config_get_dad_timeout            (NMSettingIPConfig *setting);
 NM_AVAILABLE_IN_1_2
 int           nm_setting_ip_config_get_dhcp_timeout           (NMSettingIPConfig *setting);
+NM_AVAILABLE_IN_1_22
+const char   *nm_setting_ip_config_get_dhcp_iaid              (NMSettingIPConfig *setting);
+
+NM_AVAILABLE_IN_1_22
+NMDhcpHostnameFlags nm_setting_ip_config_get_dhcp_hostname_flags (NMSettingIPConfig *setting);
 
 G_END_DECLS