7#include "vxlansetting.h"
8#include "vxlansetting_p.h"
12NetworkManager::VxlanSettingPrivate::VxlanSettingPrivate()
13 : name(NM_SETTING_VXLAN_SETTING_NAME)
15 , destinationPort(8472)
30NetworkManager::VxlanSetting::VxlanSetting()
31 : Setting(Setting::Vxlan)
32 , d_ptr(new VxlanSettingPrivate())
38 , d_ptr(new VxlanSettingPrivate())
40 setAgeing(other->ageing());
41 setDestinationPort(other->destinationPort());
43 setL2Miss(other->l2Miss());
44 setL3Miss(other->l3Miss());
45 setLearning(other->learning());
46 setLimit(other->limit());
47 setLocal(other->local());
48 setParent(other->parent());
49 setProxy(other->proxy());
50 setRemote(other->remote());
52 setSourcePortMax(other->sourcePortMax());
53 setSourcePortMin(other->sourcePortMin());
58NetworkManager::VxlanSetting::~VxlanSetting()
70void NetworkManager::VxlanSetting::setAgeing(quint32 ageing)
77quint32 NetworkManager::VxlanSetting::ageing()
const
79 Q_D(
const VxlanSetting);
84void NetworkManager::VxlanSetting::setDestinationPort(quint32 port)
88 d->destinationPort = port;
91quint32 NetworkManager::VxlanSetting::destinationPort()
const
93 Q_D(
const VxlanSetting);
95 return d->destinationPort;
98void NetworkManager::VxlanSetting::setId(quint32
id)
105quint32 NetworkManager::VxlanSetting::id()
const
107 Q_D(
const VxlanSetting);
112void NetworkManager::VxlanSetting::setL2Miss(
bool enable)
119bool NetworkManager::VxlanSetting::l2Miss()
const
121 Q_D(
const VxlanSetting);
126void NetworkManager::VxlanSetting::setL3Miss(
bool enable)
133bool NetworkManager::VxlanSetting::l3Miss()
const
135 Q_D(
const VxlanSetting);
140void NetworkManager::VxlanSetting::setLearning(
bool enable)
144 d->learning = enable;
147bool NetworkManager::VxlanSetting::learning()
const
149 Q_D(
const VxlanSetting);
154void NetworkManager::VxlanSetting::setLimit(quint32 limit)
161quint32 NetworkManager::VxlanSetting::limit()
const
163 Q_D(
const VxlanSetting);
168void NetworkManager::VxlanSetting::setLocal(
QString local)
175QString NetworkManager::VxlanSetting::local()
const
177 Q_D(
const VxlanSetting);
182void NetworkManager::VxlanSetting::setParent(
QString parent)
189QString NetworkManager::VxlanSetting::parent()
const
191 Q_D(
const VxlanSetting);
196void NetworkManager::VxlanSetting::setProxy(
bool enable)
203bool NetworkManager::VxlanSetting::proxy()
const
205 Q_D(
const VxlanSetting);
210void NetworkManager::VxlanSetting::setRemote(
QString remote)
217QString NetworkManager::VxlanSetting::remote()
const
219 Q_D(
const VxlanSetting);
224void NetworkManager::VxlanSetting::setRsc(
bool enable)
231bool NetworkManager::VxlanSetting::rsc()
const
233 Q_D(
const VxlanSetting);
238void NetworkManager::VxlanSetting::setSourcePortMax(quint32 maxPort)
242 d->sourcePortMax = maxPort;
245quint32 NetworkManager::VxlanSetting::sourcePortMax()
const
247 Q_D(
const VxlanSetting);
249 return d->sourcePortMax;
252void NetworkManager::VxlanSetting::setSourcePortMin(quint32 minPort)
256 d->sourcePortMin = minPort;
259quint32 NetworkManager::VxlanSetting::sourcePortMin()
const
261 Q_D(
const VxlanSetting);
263 return d->sourcePortMin;
266void NetworkManager::VxlanSetting::setTos(quint32 tos)
273quint32 NetworkManager::VxlanSetting::tos()
const
275 Q_D(
const VxlanSetting);
280void NetworkManager::VxlanSetting::setTtl(quint32 ttl)
287quint32 NetworkManager::VxlanSetting::ttl()
const
289 Q_D(
const VxlanSetting);
295 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_AGEING))) {
296 setAgeing(setting.value(
QLatin1String(NM_SETTING_VXLAN_AGEING)).toUInt());
299 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_DESTINATION_PORT))) {
300 setDestinationPort(setting.value(
QLatin1String(NM_SETTING_VXLAN_DESTINATION_PORT)).toUInt());
304 setId(setting.value(
QLatin1String(NM_SETTING_VXLAN_ID)).toUInt());
307 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_L2_MISS))) {
308 setL2Miss(setting.value(
QLatin1String(NM_SETTING_VXLAN_L2_MISS)).toBool());
311 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_L3_MISS))) {
312 setL3Miss(setting.value(
QLatin1String(NM_SETTING_VXLAN_L3_MISS)).toBool());
315 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_LEARNING))) {
316 setLearning(setting.value(
QLatin1String(NM_SETTING_VXLAN_LEARNING)).toBool());
319 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_LIMIT))) {
320 setLimit(setting.value(
QLatin1String(NM_SETTING_VXLAN_LIMIT)).toUInt());
323 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_LOCAL))) {
324 setLocal(setting.value(
QLatin1String(NM_SETTING_VXLAN_LOCAL)).toString());
327 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_PARENT))) {
328 setParent(setting.value(
QLatin1String(NM_SETTING_VXLAN_PARENT)).toString());
331 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_PROXY))) {
332 setProxy(setting.value(
QLatin1String(NM_SETTING_VXLAN_PROXY)).toBool());
335 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_REMOTE))) {
336 setRemote(setting.value(
QLatin1String(NM_SETTING_VXLAN_REMOTE)).toString());
340 setRsc(setting.value(
QLatin1String(NM_SETTING_VXLAN_RSC)).toBool());
343 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_SOURCE_PORT_MAX))) {
344 setSourcePortMax(setting.value(
QLatin1String(NM_SETTING_VXLAN_SOURCE_PORT_MAX)).toUInt());
347 if (setting.contains(
QLatin1String(NM_SETTING_VXLAN_SOURCE_PORT_MIN))) {
348 setSourcePortMin(setting.value(
QLatin1String(NM_SETTING_VXLAN_SOURCE_PORT_MIN)).toUInt());
352 setTos(setting.value(
QLatin1String(NM_SETTING_VXLAN_TOS)).toUInt());
356 setTtl(setting.value(
QLatin1String(NM_SETTING_VXLAN_TTL)).toUInt());
364 if (ageing() != 32) {
365 setting.insert(
QLatin1String(NM_SETTING_VXLAN_AGEING), ageing());
368 if (destinationPort() != 8472) {
369 setting.insert(
QLatin1String(NM_SETTING_VXLAN_DESTINATION_PORT), destinationPort());
377 setting.insert(
QLatin1String(NM_SETTING_VXLAN_L2_MISS), l2Miss());
381 setting.insert(
QLatin1String(NM_SETTING_VXLAN_L3_MISS), l3Miss());
385 setting.insert(
QLatin1String(NM_SETTING_VXLAN_LEARNING), learning());
389 setting.insert(
QLatin1String(NM_SETTING_VXLAN_LIMIT), limit());
392 if (!local().isEmpty()) {
393 setting.insert(
QLatin1String(NM_SETTING_VXLAN_LOCAL), local());
396 if (!parent().isEmpty()) {
397 setting.insert(
QLatin1String(NM_SETTING_VXLAN_PARENT), parent());
401 setting.insert(
QLatin1String(NM_SETTING_VXLAN_PROXY), proxy());
404 if (!remote().isEmpty()) {
405 setting.insert(
QLatin1String(NM_SETTING_VXLAN_REMOTE), remote());
412 if (sourcePortMax()) {
413 setting.insert(
QLatin1String(NM_SETTING_VXLAN_SOURCE_PORT_MAX), sourcePortMax());
416 if (sourcePortMin()) {
417 setting.insert(
QLatin1String(NM_SETTING_VXLAN_SOURCE_PORT_MIN), sourcePortMin());
433 dbg.
nospace() <<
"type: " << setting.typeAsString(setting.type()) <<
'\n';
434 dbg.
nospace() <<
"initialized: " << !setting.isNull() <<
'\n';
436 dbg.
nospace() << NM_SETTING_VXLAN_AGEING <<
": " << setting.ageing() <<
'\n';
437 dbg.
nospace() << NM_SETTING_VXLAN_DESTINATION_PORT <<
": " << setting.destinationPort() <<
'\n';
438 dbg.
nospace() << NM_SETTING_VXLAN_ID <<
": " << setting.id() <<
'\n';
439 dbg.
nospace() << NM_SETTING_VXLAN_L2_MISS <<
": " << setting.l2Miss() <<
'\n';
440 dbg.
nospace() << NM_SETTING_VXLAN_L3_MISS <<
": " << setting.l3Miss() <<
'\n';
441 dbg.
nospace() << NM_SETTING_VXLAN_LEARNING <<
": " << setting.learning() <<
'\n';
442 dbg.
nospace() << NM_SETTING_VXLAN_LIMIT <<
": " << setting.limit() <<
'\n';
443 dbg.
nospace() << NM_SETTING_VXLAN_LOCAL <<
": " << setting.local() <<
'\n';
444 dbg.
nospace() << NM_SETTING_VXLAN_PARENT <<
": " << setting.parent() <<
'\n';
445 dbg.
nospace() << NM_SETTING_VXLAN_PROXY <<
": " << setting.proxy() <<
'\n';
446 dbg.
nospace() << NM_SETTING_VXLAN_REMOTE <<
": " << setting.remote() <<
'\n';
447 dbg.
nospace() << NM_SETTING_VXLAN_RSC <<
": " << setting.rsc() <<
'\n';
448 dbg.
nospace() << NM_SETTING_VXLAN_SOURCE_PORT_MAX <<
": " << setting.sourcePortMax() <<
'\n';
449 dbg.
nospace() << NM_SETTING_VXLAN_SOURCE_PORT_MIN <<
": " << setting.sourcePortMin() <<
'\n';
450 dbg.
nospace() << NM_SETTING_VXLAN_TOS <<
": " << setting.tos() <<
'\n';
451 dbg.
nospace() << NM_SETTING_VXLAN_TTL <<
": " << setting.ttl() <<
'\n';
Represents vxlan setting.
void fromMap(const QVariantMap &setting) override
Must be reimplemented, default implementation does nothing.
QVariantMap toMap() const override
Must be reimplemented, default implementationd does nothing.
QString name() const override
Must be reimplemented, default implementationd does nothing.