device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm / nm-device-vxlan.c
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the
15  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  * Boston, MA 02110-1301 USA.
17  *
18  * Copyright 2015 Red Hat, Inc.
19  */
20
21 #include "nm-default.h"
22
23 #include <string.h>
24
25 #include "nm-setting-connection.h"
26 #include "nm-setting-vxlan.h"
27 #include "nm-utils.h"
28
29 #include "nm-device-vxlan.h"
30 #include "nm-device-private.h"
31 #include "nm-object-private.h"
32
33 G_DEFINE_TYPE (NMDeviceVxlan, nm_device_vxlan, NM_TYPE_DEVICE)
34
35 #define NM_DEVICE_VXLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_VXLAN, NMDeviceVxlanPrivate))
36
37 typedef struct {
38         NMDevice *parent;
39         char *hw_address;
40         gboolean carrier;
41         guint id;
42         char *group;
43         char *local;
44         guint src_port_min;
45         guint src_port_max;
46         guint dst_port;
47         guint tos;
48         guint ttl;
49         guint limit;
50         gboolean learning;
51         guint ageing;
52         gboolean proxy;
53         gboolean rsc;
54         gboolean l2miss;
55         gboolean l3miss;
56 } NMDeviceVxlanPrivate;
57
58 enum {
59         PROP_0,
60         PROP_HW_ADDRESS,
61         PROP_CARRIER,
62         PROP_PARENT,
63         PROP_ID,
64         PROP_GROUP,
65         PROP_LOCAL,
66         PROP_TOS,
67         PROP_TTL,
68         PROP_LIMIT,
69         PROP_LEARNING,
70         PROP_AGEING,
71         PROP_DST_PORT,
72         PROP_SRC_PORT_MIN,
73         PROP_SRC_PORT_MAX,
74         PROP_PROXY,
75         PROP_RSC,
76         PROP_L2MISS,
77         PROP_L3MISS,
78
79         LAST_PROP
80 };
81
82 /**
83  * nm_device_vxlan_get_hw_address:
84  * @device: a #NMDeviceVxlan
85  *
86  * Gets the hardware (MAC) address of the #NMDeviceVxlan
87  *
88  * Returns: the hardware address. This is the internal string used by the
89  * device, and must not be modified.
90  *
91  * Since: 1.2
92  **/
93 const char *
94 nm_device_vxlan_get_hw_address (NMDeviceVxlan *device)
95 {
96         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL);
97
98         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->hw_address;
99 }
100
101 /**
102  * nm_device_vxlan_get_carrier:
103  * @device: a #NMDeviceVxlan
104  *
105  * Whether the device has carrier.
106  *
107  * Returns: %TRUE if the device has carrier.
108  *
109  * Since: 1.2
110  **/
111 gboolean
112 nm_device_vxlan_get_carrier (NMDeviceVxlan *device)
113 {
114         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE);
115
116         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->carrier;
117 }
118
119 /**
120  * nm_device_vxlan_get_parent:
121  * @device: a #NMDeviceVxlan
122  *
123  * Returns: (transfer none): the device's parent device
124  *
125  * Since: 1.2
126  **/
127 NMDevice *
128 nm_device_vxlan_get_parent (NMDeviceVxlan *device)
129 {
130         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL);
131
132         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->parent;
133 }
134
135 /**
136  * nm_device_vxlan_get_id:
137  * @device: a #NMDeviceVxlan
138  *
139  * Returns: the device's VXLAN ID.
140  *
141  * Since: 1.2
142  **/
143 guint
144 nm_device_vxlan_get_id (NMDeviceVxlan *device)
145 {
146         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0);
147
148         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->id;
149 }
150
151 /**
152  * nm_device_vxlan_get_group:
153  * @device: a #NMDeviceVxlan
154  *
155  * Returns: The unicast destination IP address or the multicast
156  * IP address joined
157  *
158  * Since: 1.2
159  **/
160 const char *
161 nm_device_vxlan_get_group (NMDeviceVxlan *device)
162 {
163         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL);
164
165         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->group;
166 }
167
168 /**
169  * nm_device_vxlan_get_local:
170  * @device: a #NMDeviceVxlan
171  *
172  * Returns: the source IP address to use in outgoing packets
173  *
174  * Since: 1.2
175  **/
176 const char *
177 nm_device_vxlan_get_local (NMDeviceVxlan *device)
178 {
179         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL);
180
181         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->local;
182 }
183
184 /**
185  * nm_device_vxlan_get_src_port_min:
186  * @device: a #NMDeviceVxlan
187  *
188  * Returns: the minimum UDP source port
189  *
190  * Since: 1.2
191  **/
192 guint
193 nm_device_vxlan_get_src_port_min (NMDeviceVxlan *device)
194 {
195         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0);
196
197         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->src_port_min;
198 }
199
200 /**
201  * nm_device_vxlan_get_src_port_max:
202  * @device: a #NMDeviceVxlan
203  *
204  * Returns:  the maximum UDP source port
205  *
206  * Since: 1.2
207  **/
208 guint
209 nm_device_vxlan_get_src_port_max (NMDeviceVxlan *device)
210 {
211         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0);
212
213         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->src_port_max;
214 }
215
216 /**
217  * nm_device_vxlan_get_dst_port:
218  * @device: a #NMDeviceVxlan
219  *
220  * Returns: the UDP destination port
221  *
222  * Since: 1.2
223  **/
224 guint
225 nm_device_vxlan_get_dst_port (NMDeviceVxlan *device)
226 {
227         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0);
228
229         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->dst_port;
230 }
231
232 /**
233  * nm_device_vxlan_get_learning:
234  * @device: a #NMDeviceVxlan
235  *
236  * Returns: whether address learning is enabled
237  *
238  * Since: 1.2
239  **/
240 gboolean
241 nm_device_vxlan_get_learning (NMDeviceVxlan *device)
242 {
243         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE);
244
245         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->learning;
246 }
247
248 /**
249  * nm_device_vxlan_get_ageing:
250  * @device: a #NMDeviceVxlan
251  *
252  * Returns: the lifetime in seconds of FDB entries learnt by the kernel
253  *
254  * Since: 1.2
255  **/
256 guint
257 nm_device_vxlan_get_ageing (NMDeviceVxlan *device)
258 {
259         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0);
260
261         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->ageing;
262 }
263
264 /**
265  * nm_device_vxlan_get_tos:
266  * @device: a #NMDeviceVxlan
267  *
268  * Returns: the TOS value to use in outgoing packets
269  *
270  * Since: 1.2
271  **/
272 guint
273 nm_device_vxlan_get_tos (NMDeviceVxlan *device)
274 {
275         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0);
276
277         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->tos;
278 }
279
280 /**
281  * nm_device_vxlan_get_ttl:
282  * @device: a #NMDeviceVxlan
283  *
284  * Returns: the time-to-live value to use in outgoing packets
285  *
286  * Since: 1.2
287  **/
288 guint
289 nm_device_vxlan_get_ttl (NMDeviceVxlan *device)
290 {
291         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0);
292
293         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->ttl;
294 }
295
296 /**
297  * nm_device_vxlan_get_limit:
298  * @device: a #NMDeviceVxlan
299  *
300  * Returns: the maximum number of entries that can be added to the
301  * forwarding table
302  *
303  * Since: 1.2
304  **/
305 guint
306 nm_device_vxlan_get_limit (NMDeviceVxlan *device)
307 {
308         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0);
309
310         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->limit;
311 }
312
313 /**
314  * nm_device_vxlan_get_proxy:
315  * @device: a #NMDeviceVxlan
316  *
317  * Returns: whether ARP proxy is turned on
318  *
319  * Since: 1.2
320  **/
321 gboolean
322 nm_device_vxlan_get_proxy (NMDeviceVxlan *device)
323 {
324         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE);
325
326         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->proxy;
327 }
328
329 /**
330  * nm_device_vxlan_get_rsc:
331  * @device: a #NMDeviceVxlan
332  *
333  * Returns: whether route short circuit is turned on
334  *
335  * Since: 1.2
336  **/
337 gboolean
338 nm_device_vxlan_get_rsc (NMDeviceVxlan *device)
339 {
340         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE);
341
342         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->rsc;
343 }
344
345 /**
346  * nm_device_vxlan_get_l2miss:
347  * @device: a #NMDeviceVxlan
348  *
349  * Returns: whether netlink LL ADDR miss notifications are generated
350  *
351  * Since: 1.2
352  **/
353 gboolean
354 nm_device_vxlan_get_l2miss (NMDeviceVxlan *device)
355 {
356         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE);
357
358         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->l2miss;
359 }
360
361 /**
362  * nm_device_vxlan_get_l3miss:
363  * @device: a #NMDeviceVxlan
364  *
365  * Returns: wether netlink IP ADDR miss notifications are generated
366  *
367  * Since: 1.2
368  **/
369 gboolean
370 nm_device_vxlan_get_l3miss (NMDeviceVxlan *device)
371 {
372         g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE);
373
374         return NM_DEVICE_VXLAN_GET_PRIVATE (device)->l3miss;
375 }
376
377 static gboolean
378 connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
379 {
380         NMSettingVxlan *s_vxlan;
381
382         if (!NM_DEVICE_CLASS (nm_device_vxlan_parent_class)->connection_compatible (device, connection, error))
383                 return FALSE;
384
385         if (!nm_connection_is_type (connection, NM_SETTING_VXLAN_SETTING_NAME)) {
386                 g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
387                                      _("The connection was not a VXLAN connection."));
388                 return FALSE;
389         }
390
391         s_vxlan = nm_connection_get_setting_vxlan (connection);
392         if (nm_setting_vxlan_get_id (s_vxlan) != nm_device_vxlan_get_id (NM_DEVICE_VXLAN (device))) {
393                 g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
394                                      _("The VXLAN identifiers of the device and the connection didn't match."));
395                 return FALSE;
396         }
397
398         return TRUE;
399 }
400
401 static GType
402 get_setting_type (NMDevice *device)
403 {
404         return NM_TYPE_SETTING_VXLAN;
405 }
406
407 static const char *
408 get_hw_address (NMDevice *device)
409 {
410         return nm_device_vxlan_get_hw_address (NM_DEVICE_VXLAN (device));
411 }
412
413 /***********************************************************/
414
415 static void
416 nm_device_vxlan_init (NMDeviceVxlan *device)
417 {
418         _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_VXLAN);
419 }
420
421 static void
422 init_dbus (NMObject *object)
423 {
424         NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE (object);
425         const NMPropertiesInfo property_info[] = {
426                 { NM_DEVICE_VXLAN_HW_ADDRESS,   &priv->hw_address },
427                 { NM_DEVICE_VXLAN_CARRIER,      &priv->carrier },
428                 { NM_DEVICE_VXLAN_PARENT,       &priv->parent, NULL, NM_TYPE_DEVICE },
429                 { NM_DEVICE_VXLAN_ID,           &priv->id },
430                 { NM_DEVICE_VXLAN_GROUP,        &priv->group },
431                 { NM_DEVICE_VXLAN_LOCAL,        &priv->local },
432                 { NM_DEVICE_VXLAN_SRC_PORT_MIN, &priv->src_port_min },
433                 { NM_DEVICE_VXLAN_SRC_PORT_MAX, &priv->src_port_max },
434                 { NM_DEVICE_VXLAN_DST_PORT,     &priv->dst_port },
435                 { NM_DEVICE_VXLAN_TOS,          &priv->tos },
436                 { NM_DEVICE_VXLAN_TTL,          &priv->ttl },
437                 { NM_DEVICE_VXLAN_LIMIT,        &priv->limit },
438                 { NM_DEVICE_VXLAN_LEARNING,     &priv->learning },
439                 { NM_DEVICE_VXLAN_AGEING,       &priv->ageing },
440                 { NM_DEVICE_VXLAN_PROXY,        &priv->proxy },
441                 { NM_DEVICE_VXLAN_RSC,          &priv->rsc },
442                 { NM_DEVICE_VXLAN_L2MISS,       &priv->l2miss },
443                 { NM_DEVICE_VXLAN_L3MISS,       &priv->l3miss },
444                 { NULL },
445         };
446
447         NM_OBJECT_CLASS (nm_device_vxlan_parent_class)->init_dbus (object);
448
449         _nm_object_register_properties (object,
450                                         NM_DBUS_INTERFACE_DEVICE_VXLAN,
451                                         property_info);
452 }
453
454 static void
455 finalize (GObject *object)
456 {
457         NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE (object);
458
459         g_free (priv->hw_address);
460         g_clear_object (&priv->parent);
461
462         G_OBJECT_CLASS (nm_device_vxlan_parent_class)->finalize (object);
463 }
464
465 static void
466 get_property (GObject *object,
467               guint prop_id,
468               GValue *value,
469               GParamSpec *pspec)
470 {
471         NMDeviceVxlan *device = NM_DEVICE_VXLAN (object);
472
473         switch (prop_id) {
474         case PROP_HW_ADDRESS:
475                 g_value_set_string (value, nm_device_vxlan_get_hw_address (device));
476                 break;
477         case PROP_CARRIER:
478                 g_value_set_boolean (value, nm_device_vxlan_get_carrier (device));
479                 break;
480         case PROP_PARENT:
481                 g_value_set_object (value, nm_device_vxlan_get_parent (device));
482                 break;
483         case PROP_ID:
484                 g_value_set_uint (value, nm_device_vxlan_get_id (device));
485                 break;
486         case PROP_GROUP:
487                 g_value_set_string (value, nm_device_vxlan_get_group (device));
488                 break;
489         case PROP_LOCAL:
490                 g_value_set_string (value, nm_device_vxlan_get_local (device));
491                 break;
492         case PROP_TOS:
493                 g_value_set_uint (value, nm_device_vxlan_get_tos (device));
494                 break;
495         case PROP_TTL:
496                 g_value_set_uint (value, nm_device_vxlan_get_ttl (device));
497                 break;
498         case PROP_LIMIT:
499                 g_value_set_uint (value, nm_device_vxlan_get_limit (device));
500                 break;
501         case PROP_LEARNING:
502                 g_value_set_boolean (value, nm_device_vxlan_get_learning (device));
503                 break;
504         case PROP_AGEING:
505                 g_value_set_uint (value, nm_device_vxlan_get_ageing (device));
506                 break;
507         case PROP_DST_PORT:
508                 g_value_set_uint (value, nm_device_vxlan_get_dst_port (device));
509                 break;
510         case PROP_SRC_PORT_MIN:
511                 g_value_set_uint (value, nm_device_vxlan_get_src_port_min (device));
512                 break;
513         case PROP_SRC_PORT_MAX:
514                 g_value_set_uint (value, nm_device_vxlan_get_src_port_max (device));
515                 break;
516         case PROP_PROXY:
517                 g_value_set_boolean (value, nm_device_vxlan_get_proxy (device));
518                 break;
519         case PROP_RSC:
520                 g_value_set_boolean (value, nm_device_vxlan_get_rsc (device));
521                 break;
522         case PROP_L2MISS:
523                 g_value_set_boolean (value, nm_device_vxlan_get_l2miss (device));
524                 break;
525         case PROP_L3MISS:
526                 g_value_set_boolean (value, nm_device_vxlan_get_l3miss (device));
527                 break;
528         default:
529                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
530                 break;
531         }
532 }
533
534 static void
535 nm_device_vxlan_class_init (NMDeviceVxlanClass *vxlan_class)
536 {
537         GObjectClass *object_class = G_OBJECT_CLASS (vxlan_class);
538         NMObjectClass *nm_object_class = NM_OBJECT_CLASS (vxlan_class);
539         NMDeviceClass *device_class = NM_DEVICE_CLASS (vxlan_class);
540
541         g_type_class_add_private (vxlan_class, sizeof (NMDeviceVxlanPrivate));
542
543         _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_VXLAN);
544
545         /* virtual methods */
546         object_class->finalize = finalize;
547         object_class->get_property = get_property;
548
549         nm_object_class->init_dbus = init_dbus;
550
551         device_class->connection_compatible = connection_compatible;
552         device_class->get_setting_type = get_setting_type;
553         device_class->get_hw_address = get_hw_address;
554
555         /* properties */
556
557         /**
558          * NMDeviceVxlan:hw-address:
559          *
560          * The hardware (MAC) address of the device.
561          *
562          * Since: 1.2
563          **/
564         g_object_class_install_property
565                 (object_class, PROP_HW_ADDRESS,
566                  g_param_spec_string (NM_DEVICE_VXLAN_HW_ADDRESS, "", "",
567                                       NULL,
568                                       G_PARAM_READABLE |
569                                       G_PARAM_STATIC_STRINGS));
570
571         /**
572          * NMDeviceVxlan:carrier:
573          *
574          * Whether the device has carrier.
575          *
576          * Since: 1.2
577          **/
578         g_object_class_install_property
579                 (object_class, PROP_CARRIER,
580                  g_param_spec_boolean (NM_DEVICE_VXLAN_CARRIER, "", "",
581                                        FALSE,
582                                        G_PARAM_READABLE |
583                                        G_PARAM_STATIC_STRINGS));
584
585         /**
586          * NMDeviceVxlan:parent:
587          *
588          * The devices's parent device.
589          *
590          * Since: 1.2
591          **/
592         g_object_class_install_property
593             (object_class, PROP_PARENT,
594              g_param_spec_object (NM_DEVICE_VXLAN_PARENT, "", "",
595                                   NM_TYPE_DEVICE,
596                                   G_PARAM_READABLE |
597                                   G_PARAM_STATIC_STRINGS));
598
599         /**
600          * NMDeviceVxlan:id:
601          *
602          * The device's VXLAN ID.
603          *
604          * Since: 1.2
605          **/
606         g_object_class_install_property
607                 (object_class, PROP_ID,
608                  g_param_spec_uint (NM_DEVICE_VXLAN_ID, "", "",
609                                     0, (1 << 24) - 1, 0,
610                                     G_PARAM_READABLE |
611                                     G_PARAM_STATIC_STRINGS));
612
613         /**
614          * NMDeviceVxlan:group:
615          *
616          * The unicast destination IP address used in outgoing packets when the
617          * destination link layer address is not known in the VXLAN device
618          * forwarding database or the multicast IP address joined.
619          *
620          * Since: 1.2
621          */
622         g_object_class_install_property
623                 (object_class, PROP_GROUP,
624                  g_param_spec_string (NM_DEVICE_VXLAN_GROUP, "", "",
625                                       NULL,
626                                       G_PARAM_READABLE |
627                                       G_PARAM_STATIC_STRINGS));
628
629         /**
630          * NMDeviceVxlan:local:
631          *
632          * The source IP address to use in outgoing packets.
633          *
634          * Since: 1.2
635          */
636         g_object_class_install_property
637                 (object_class, PROP_LOCAL,
638                  g_param_spec_string (NM_DEVICE_VXLAN_LOCAL, "", "",
639                                       NULL,
640                                       G_PARAM_READABLE |
641                                       G_PARAM_STATIC_STRINGS));
642
643         /**
644          * NMDeviceVxlan:tos:
645          *
646          * The TOS value to use in outgoing packets.
647          *
648          * Since: 1.2
649          */
650         g_object_class_install_property
651                 (object_class, PROP_TOS,
652                  g_param_spec_uchar (NM_DEVICE_VXLAN_TOS, "", "",
653                                      0, 255, 0,
654                                      G_PARAM_READABLE |
655                                      G_PARAM_STATIC_STRINGS));
656
657         /**
658          * NMDeviceVxlan:ttl:
659          *
660          * The time-to-live value to use in outgoing packets.
661          *
662          * Since: 1.2
663          */
664         g_object_class_install_property
665                 (object_class, PROP_TTL,
666                  g_param_spec_uchar (NM_DEVICE_VXLAN_TTL, "", "",
667                                      0, 255, 0,
668                                      G_PARAM_READABLE |
669                                      G_PARAM_STATIC_STRINGS));
670
671         /**
672          * NMDeviceVxlan:learning:
673          *
674          * Whether unknown source link layer addresses and IP addresses are entered
675          * into the VXLAN device forwarding database.
676          *
677          * Since: 1.2
678          */
679         g_object_class_install_property
680                 (object_class, PROP_LEARNING,
681                  g_param_spec_boolean (NM_DEVICE_VXLAN_LEARNING, "", "",
682                                        TRUE,
683                                        G_PARAM_READABLE |
684                                        G_PARAM_STATIC_STRINGS));
685
686         /**
687          * NMDeviceVxlan:ageing:
688          *
689          * The lifetime in seconds of FDB entries learnt by the kernel.
690          *
691          * Since: 1.2
692          */
693         g_object_class_install_property
694                 (object_class, PROP_AGEING,
695                  g_param_spec_uint (NM_DEVICE_VXLAN_AGEING, "", "",
696                                     0, G_MAXUINT32, 0,
697                                     G_PARAM_READABLE |
698                                     G_PARAM_STATIC_STRINGS));
699
700         /**
701          * NMDeviceVxlan:limit:
702          *
703          * The maximum number of entries that can be added to the forwarding table.
704          *
705          * Since: 1.2
706          */
707         g_object_class_install_property
708                 (object_class, PROP_LIMIT,
709                  g_param_spec_uint (NM_DEVICE_VXLAN_LIMIT, "", "",
710                                     0, G_MAXUINT32, 0,
711                                     G_PARAM_READABLE |
712                                     G_PARAM_STATIC_STRINGS));
713
714         /**
715          * NMDeviceVxlan:dst-port:
716          *
717          * The UDP destination port used to communicate with the remote VXLAN tunnel
718          * endpoint.
719          *
720          * Since: 1.2
721          */
722         g_object_class_install_property
723                 (object_class, PROP_DST_PORT,
724                  g_param_spec_uint (NM_DEVICE_VXLAN_DST_PORT, "", "",
725                                     0, 65535, 0,
726                                     G_PARAM_READABLE |
727                                     G_PARAM_STATIC_STRINGS));
728
729         /**
730          * NMDeviceVxlan:src-port-min:
731          *
732          * The minimum UDP source port used to communicate with the remote VXLAN
733          * tunnel endpoint.
734          *
735          * Since: 1.2
736          */
737         g_object_class_install_property
738                 (object_class, PROP_SRC_PORT_MIN,
739                  g_param_spec_uint (NM_DEVICE_VXLAN_SRC_PORT_MIN, "", "",
740                                     0, 65535, 0,
741                                     G_PARAM_READABLE |
742                                     G_PARAM_STATIC_STRINGS));
743
744         /**
745          * NMDeviceVxlan:src-port-max:
746          *
747          * The maximum UDP source port used to communicate with the remote VXLAN
748          * tunnel endpoint.
749          *
750          * Since: 1.2
751          */
752         g_object_class_install_property
753                 (object_class, PROP_SRC_PORT_MAX,
754                  g_param_spec_uint (NM_DEVICE_VXLAN_SRC_PORT_MAX, "", "",
755                                     0, 65535, 0,
756                                     G_PARAM_READABLE |
757                                     G_PARAM_STATIC_STRINGS));
758
759         /**
760          * NMDeviceVxlan:proxy:
761          *
762          * Whether ARP proxy is turned on.
763          *
764          * Since: 1.2
765          */
766         g_object_class_install_property
767                 (object_class, PROP_PROXY,
768                  g_param_spec_boolean (NM_DEVICE_VXLAN_PROXY, "", "",
769                                        FALSE,
770                                        G_PARAM_READABLE |
771                                        G_PARAM_STATIC_STRINGS));
772
773         /**
774          * NMDeviceVxlan:rsc:
775          *
776          * Whether route short circuit is turned on.
777          *
778          * Since: 1.2
779          */
780         g_object_class_install_property
781                 (object_class, PROP_RSC,
782                  g_param_spec_boolean (NM_DEVICE_VXLAN_RSC, "", "",
783                                        FALSE,
784                                        G_PARAM_READABLE |
785                                        G_PARAM_STATIC_STRINGS));
786
787         /**
788          * NMDeviceVxlan:l2miss:
789          *
790          * Whether netlink LL ADDR miss notifications are generated.
791          *
792          * Since: 1.2
793          */
794         g_object_class_install_property
795                 (object_class, PROP_L2MISS,
796                  g_param_spec_boolean (NM_DEVICE_VXLAN_L2MISS, "", "",
797                                        FALSE,
798                                        G_PARAM_READABLE |
799                                        G_PARAM_STATIC_STRINGS));
800
801         /**
802          * NMDeviceVxlan:l3miss:
803          *
804          * Whether netlink IP ADDR miss notifications are generated.
805          *
806          * Since: 1.2
807          */
808         g_object_class_install_property
809                 (object_class, PROP_L3MISS,
810                  g_param_spec_boolean (NM_DEVICE_VXLAN_L3MISS, "", "",
811                                        FALSE,
812                                        G_PARAM_READABLE |
813                                        G_PARAM_STATIC_STRINGS));
814 }