Coverage Report

Created: 2026-12-01 06:10

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/PcapPlusPlus/Packet++/src/VrrpLayer.cpp
Line
Count
Source
1
0
#define LOG_MODULE PacketLogModuleVrrpLayer
2
3
#include "SystemUtils.h"
4
#include "PacketUtils.h"
5
#include "Logger.h"
6
#include "EndianPortable.h"
7
#include "IPv4Layer.h"
8
#include "PayloadLayer.h"
9
#include "VrrpLayer.h"
10
#include <algorithm>
11
12
namespace pcpp
13
{
14
15
  constexpr uint8_t VrrpPriorityStop = 0;       ///< priority to stop
16
  constexpr uint8_t VrrpPriorityDefault = 100;  ///< default priority
17
  constexpr uint8_t VrrpPriorityOwner = 255;    ///< priority of the IP owner
18
19
  constexpr uint8_t VrrpPacketFixedLength = 8;
20
  constexpr uint8_t VrrpPacketMaxIpAddressCount = 255;
21
22
  constexpr uint8_t VrrpVersion2 = 2;
23
  constexpr uint8_t VrrpVersion3 = 3;
24
25
  // -------- Class VrrpLayer -----------------
26
27
  VrrpLayer::VrrpLayer(ProtocolType subProtocol, uint8_t virtualRouterId, uint8_t priority)
28
0
  {
29
0
    allocData(VrrpPacketFixedLength);
30
0
    m_Protocol = subProtocol;
31
0
    m_AddressType = IPAddress::IPv4AddressType;
32
0
    auto vrrpHeader = getVrrpHeader();
33
0
    if (subProtocol == VRRPv2)
34
0
    {
35
0
      vrrpHeader->version = VrrpVersion2;
36
0
    }
37
0
    else if (subProtocol == VRRPv3)
38
0
    {
39
0
      vrrpHeader->version = VrrpVersion3;
40
0
    }
41
0
    vrrpHeader->type = static_cast<uint8_t>(VrrpType::VrrpType_Advertisement);
42
0
    setVirtualRouterID(virtualRouterId);
43
0
    setPriority(priority);
44
0
  }
45
46
  ProtocolType VrrpLayer::getVersionFromData(uint8_t* data, size_t dataLen)
47
0
  {
48
0
    if (!data || dataLen <= VrrpPacketFixedLength)
49
0
    {
50
0
      return UnknownProtocol;
51
0
    }
52
53
0
    auto* vrrpPacketCommon = (vrrp_header*)data;
54
0
    uint8_t version = vrrpPacketCommon->version;
55
0
    switch (version)
56
0
    {
57
0
    case VrrpVersion2:
58
0
      return VRRPv2;
59
0
    case VrrpVersion3:
60
0
      return VRRPv3;
61
0
    default:
62
0
      return UnknownProtocol;
63
0
    }
64
0
  }
65
66
  void VrrpLayer::computeCalculateFields()
67
0
  {
68
    // calculate and fill the checksum to packet
69
0
    calculateAndSetChecksum();
70
0
  }
71
72
  uint8_t VrrpLayer::getIPAddressLen() const
73
0
  {
74
0
    if (getAddressType() == IPAddress::IPv4AddressType)
75
0
    {
76
0
      return 4;
77
0
    }
78
79
0
    return 16;
80
0
  }
81
82
  bool VrrpLayer::isChecksumCorrect() const
83
0
  {
84
0
    auto vrrpHeader = getVrrpHeader();
85
0
    if (vrrpHeader == nullptr)
86
0
    {
87
0
      return false;
88
0
    }
89
90
0
    return (calculateChecksum() == be16toh(vrrpHeader->checksum));
91
0
  }
92
93
  VrrpLayer::VrrpPriority VrrpLayer::getPriorityAsEnum() const
94
0
  {
95
0
    switch (getVrrpHeader()->priority)
96
0
    {
97
0
    case VrrpPriorityDefault:
98
0
      return VrrpLayer::VrrpPriority::Default;
99
100
0
    case VrrpPriorityStop:
101
0
      return VrrpLayer::VrrpPriority::Stop;
102
103
0
    case VrrpPriorityOwner:
104
0
      return VrrpLayer::VrrpPriority::Owner;
105
106
0
    default:
107
0
      return VrrpLayer::VrrpPriority::Other;
108
0
    }
109
0
  }
110
111
  std::string VrrpLayer::toString() const
112
0
  {
113
0
    return "VRRP v" + std::to_string(getVersion()) +
114
0
           " Layer, virtual router ID: " + std::to_string(getVirtualRouterID()) +
115
0
           ", IP address count: " + std::to_string(getIPAddressesCount());
116
0
  }
117
118
  uint8_t VrrpLayer::getVersion() const
119
0
  {
120
0
    return getVrrpHeader()->version;
121
0
  }
122
123
  VrrpLayer::VrrpType VrrpLayer::getType() const
124
0
  {
125
0
    if (getVrrpHeader()->type == VrrpType_Advertisement)
126
0
    {
127
0
      return VrrpType_Advertisement;
128
0
    }
129
130
0
    return VrrpType_Unknown;
131
0
  }
132
133
  uint8_t VrrpLayer::getVirtualRouterID() const
134
0
  {
135
0
    return getVrrpHeader()->vrId;
136
0
  }
137
138
  void VrrpLayer::setVirtualRouterID(uint8_t virtualRouterID)
139
0
  {
140
0
    getVrrpHeader()->vrId = virtualRouterID;
141
0
  }
142
143
  uint8_t VrrpLayer::getPriority() const
144
0
  {
145
0
    return getVrrpHeader()->priority;
146
0
  }
147
148
  void VrrpLayer::setPriority(uint8_t priority)
149
0
  {
150
0
    getVrrpHeader()->priority = priority;
151
0
  }
152
153
  uint16_t VrrpLayer::getChecksum() const
154
0
  {
155
0
    return be16toh(getVrrpHeader()->checksum);
156
0
  }
157
158
  void VrrpLayer::calculateAndSetChecksum()
159
0
  {
160
0
    getVrrpHeader()->checksum = htobe16(calculateChecksum());
161
0
  }
162
163
  uint8_t VrrpLayer::getIPAddressesCount() const
164
0
  {
165
0
    return getVrrpHeader()->ipAddrCount;
166
0
  }
167
168
  std::vector<IPAddress> VrrpLayer::getIPAddresses() const
169
0
  {
170
0
    std::vector<IPAddress> ipAddressesVec;
171
0
    auto ipAddressesPtr = getFirstIPAddressPtr();
172
0
    while (ipAddressesPtr != nullptr)
173
0
    {
174
0
      IPAddress ipAddress = getIPAddressFromData(ipAddressesPtr);
175
0
      ipAddressesVec.push_back(ipAddress);
176
0
      ipAddressesPtr = getNextIPAddressPtr(ipAddressesPtr);
177
0
    }
178
179
0
    return ipAddressesVec;
180
0
  }
181
182
  uint8_t* VrrpLayer::getFirstIPAddressPtr() const
183
0
  {
184
0
    size_t ipAddressLen = getIPAddressLen();
185
186
    // check if there are virtual IP address at all
187
0
    if (getHeaderLen() <= VrrpPacketFixedLength + ipAddressLen)
188
0
    {
189
0
      return nullptr;
190
0
    }
191
192
0
    return (m_Data + VrrpPacketFixedLength);
193
0
  }
194
195
  uint8_t* VrrpLayer::getNextIPAddressPtr(const uint8_t* ipAddressPtr) const
196
0
  {
197
0
    if (ipAddressPtr == nullptr)
198
0
    {
199
0
      return nullptr;
200
0
    }
201
202
0
    size_t ipAddressLen = getIPAddressLen();
203
0
    size_t nextOffset = static_cast<size_t>(ipAddressPtr - m_Data) + ipAddressLen;
204
205
    // The next virtual IP address must fit entirely inside the layer. Checking only that the current
206
    // address ends inside it leaves a trailing partial address reachable, which the caller then reads
207
    // in full and runs past the end of the buffer.
208
0
    if (nextOffset + ipAddressLen > getHeaderLen())
209
0
    {
210
0
      return nullptr;
211
0
    }
212
213
0
    return (m_Data + nextOffset);
214
0
  }
215
216
  bool VrrpLayer::addIPAddressesAt(const std::vector<IPAddress>& ipAddresses, int offset)
217
0
  {
218
0
    if (offset > (int)getHeaderLen())
219
0
    {
220
0
      PCPP_LOG_ERROR("Cannot add virtual IP address offset(" << offset << ") is out of layer bounds");
221
0
      return false;
222
0
    }
223
224
0
    if (std::any_of(ipAddresses.begin(), ipAddresses.end(),
225
0
                    [this](const IPAddress& a) { return !isIPAddressValid(a); }))
226
0
    {
227
0
      PCPP_LOG_ERROR("Cannot add virtual IP address, for IP address is invalid.");
228
0
      return false;
229
0
    }
230
231
0
    if (getIPAddressesCount() + ipAddresses.size() > VrrpPacketMaxIpAddressCount)
232
0
    {
233
0
      PCPP_LOG_ERROR("Cannot add virtual IP address, for virtual IP address has already exceed maximum.");
234
0
      return false;
235
0
    }
236
237
0
    size_t ipAddrLen = getIPAddressLen();
238
0
    size_t ipAddressesLen = ipAddrLen * ipAddresses.size();
239
0
    if (ipAddressesLen == 0)
240
0
    {
241
0
      return true;
242
0
    }
243
244
0
    if (!extendLayer(offset, ipAddressesLen))
245
0
    {
246
0
      PCPP_LOG_ERROR("Cannot add virtual IP address, cannot extend layer");
247
0
      return false;
248
0
    }
249
250
0
    size_t ipAddrOffset = 0;
251
0
    uint8_t* newIpAddresses = getData() + offset;
252
0
    for (auto const& ipAddress : ipAddresses)
253
0
    {
254
0
      copyIPAddressToData(newIpAddresses + ipAddrOffset, ipAddress);
255
0
      ipAddrOffset += ipAddrLen;
256
0
    }
257
258
0
    getVrrpHeader()->ipAddrCount = getIPAddressesCount() + ipAddresses.size();
259
260
0
    return true;
261
0
  }
262
263
  bool VrrpLayer::addIPAddresses(const std::vector<IPAddress>& ipAddresses)
264
0
  {
265
0
    return addIPAddressesAt(ipAddresses, (int)getHeaderLen());
266
0
  }
267
268
  bool VrrpLayer::addIPAddress(const IPAddress& ipAddress)
269
0
  {
270
0
    std::vector<IPAddress> ipAddresses;
271
0
    ipAddresses.push_back(ipAddress);
272
273
0
    return addIPAddressesAt(ipAddresses, (int)getHeaderLen());
274
0
  }
275
276
  bool VrrpLayer::removeIPAddressAtIndex(int index)
277
0
  {
278
0
    int ipAddressCount = (int)getIPAddressesCount();
279
280
0
    if (index < 0 || index >= ipAddressCount)
281
0
    {
282
0
      PCPP_LOG_ERROR("Cannot remove virtual IP address, index " << index << " is out of bounds");
283
0
      return false;
284
0
    }
285
286
0
    size_t ipAddressLen = getIPAddressLen();
287
288
0
    size_t offset = VrrpPacketFixedLength;
289
0
    auto curIpAddressPtr = getFirstIPAddressPtr();
290
0
    for (int i = 0; i < index; i++)
291
0
    {
292
0
      if (curIpAddressPtr == nullptr)
293
0
      {
294
0
        PCPP_LOG_ERROR("Cannot remove virtual IP address at index "
295
0
                       << index << ", cannot find virtual IP address at index " << i);
296
0
        return false;
297
0
      }
298
299
0
      offset += ipAddressLen;
300
0
      curIpAddressPtr = getNextIPAddressPtr(curIpAddressPtr);
301
0
    }
302
303
0
    if (!shortenLayer((int)offset, ipAddressLen))
304
0
    {
305
0
      PCPP_LOG_ERROR("Cannot remove virtual IP address at index " << index << ", cannot shorted layer");
306
0
      return false;
307
0
    }
308
309
0
    getVrrpHeader()->ipAddrCount = ipAddressCount - 1;
310
311
0
    return true;
312
0
  }
313
314
  bool VrrpLayer::removeAllIPAddresses()
315
0
  {
316
0
    size_t offset = VrrpPacketFixedLength;
317
0
    size_t packetLen = getHeaderLen();
318
0
    if (packetLen <= offset)
319
0
    {
320
0
      return false;
321
0
    }
322
323
0
    if (!shortenLayer((int)offset, packetLen - offset))
324
0
    {
325
0
      PCPP_LOG_ERROR("Cannot remove all virtual IP address(es), cannot shorted layer");
326
0
      return false;
327
0
    }
328
329
0
    getVrrpHeader()->ipAddrCount = 0;
330
331
0
    return true;
332
0
  }
333
334
  void VrrpLayer::copyIPAddressToData(uint8_t* data, const IPAddress& ipAddress) const
335
0
  {
336
0
    size_t ipAddressLen = getIPAddressLen();
337
338
0
    if (ipAddress.isIPv4())
339
0
    {
340
0
      memcpy(data, ipAddress.getIPv4().toBytes(), ipAddressLen);
341
0
    }
342
0
    else if (ipAddress.isIPv6())
343
0
    {
344
0
      memcpy(data, ipAddress.getIPv6().toBytes(), ipAddressLen);
345
0
    }
346
0
  }
347
348
  IPAddress VrrpLayer::getIPAddressFromData(uint8_t* data) const
349
0
  {
350
0
    if (getAddressType() == IPAddress::IPv4AddressType)
351
0
    {
352
0
      return IPv4Address(*reinterpret_cast<const uint32_t*>(data));
353
0
    }
354
355
0
    return IPv6Address(data);
356
0
  }
357
358
  bool VrrpLayer::isIPAddressValid(const IPAddress& ipAddress) const
359
0
  {
360
0
    if (ipAddress.isIPv6() && (getProtocol() != VRRPv3))
361
0
    {
362
0
      PCPP_LOG_ERROR("Only VRRPv3 support IPv6 virtual address");
363
0
      return false;
364
0
    }
365
0
    if (ipAddress.getType() != getAddressType())
366
0
    {
367
0
      PCPP_LOG_ERROR("IP address version is not equal to layer's");
368
0
      return false;
369
0
    }
370
371
0
    return true;
372
0
  }
373
374
  IPAddress::AddressType VrrpLayer::getAddressType() const
375
0
  {
376
0
    return m_AddressType;
377
0
  }
378
379
  void VrrpLayer::setAddressType(IPAddress::AddressType addressType)
380
0
  {
381
0
    m_AddressType = addressType;
382
0
  }
383
384
  constexpr const char* vrrpTypeToString(VrrpLayer::VrrpType type)
385
0
  {
386
0
    if (type == VrrpLayer::VrrpType_Advertisement)
387
0
    {
388
0
      return "Advertisement";
389
0
    }
390
391
0
    return "Unknown";
392
0
  }
393
394
  static constexpr const char* vrrpPriorityToString(VrrpLayer::VrrpPriority priority)
395
0
  {
396
0
    switch (priority)
397
0
    {
398
0
    case VrrpLayer::Default:
399
0
      return "Default";
400
0
    case VrrpLayer::Stop:
401
0
      return "Stop";
402
0
    case VrrpLayer::Owner:
403
0
      return "Owner";
404
0
    default:
405
0
      return "Other";
406
0
    }
407
0
  }
408
409
  const FieldDescriptor VrrpLayer::SerializedFields::Type{ Layer::SerializedFields::MaxID + 1, "type" };
410
  const FieldDescriptor VrrpLayer::SerializedFields::VirtualRouterID{ Layer::SerializedFields::MaxID + 2,
411
                                                                    "virtualRouterID" };
412
  const FieldDescriptor VrrpLayer::SerializedFields::Priority{ Layer::SerializedFields::MaxID + 3, "priority" };
413
  const FieldDescriptor VrrpLayer::SerializedFields::PriorityValue{ Layer::SerializedFields::MaxID + 4,
414
                                                                  "priorityValue" };
415
  const FieldDescriptor VrrpLayer::SerializedFields::Checksum{ Layer::SerializedFields::MaxID + 5, "checksum" };
416
  const FieldDescriptor VrrpLayer::SerializedFields::IPAddresses{ Layer::SerializedFields::MaxID + 6, "ipAddresses" };
417
  const FieldDescriptor VrrpLayer::SerializedFields::IPAddress{ 0, "ipAddress" };
418
419
  void VrrpLayer::serializeLayer(ObjectScope& serializer) const
420
0
  {
421
0
    serializer.writeField(SerializedFields::Type, vrrpTypeToString(getType()));
422
0
    serializer.writeField(SerializedFields::VirtualRouterID, getVirtualRouterID());
423
0
    serializer.writeField(SerializedFields::Priority, vrrpPriorityToString(getPriorityAsEnum()));
424
0
    serializer.writeField(SerializedFields::PriorityValue, getPriority());
425
0
    serializer.writeHexField(SerializedFields::Checksum, getChecksum());
426
0
    serializeVrrpLayer(serializer);
427
0
    {
428
0
      auto ipAddressArray = serializer.writeArray(SerializedFields::IPAddresses);
429
0
      auto ipAddresses = getIPAddresses();
430
0
      for (const auto ipAddress : ipAddresses)
431
0
      {
432
0
        ipAddressArray.writeField(SerializedFields::IPAddress, ipAddress.toString());
433
0
      }
434
0
    }
435
0
  }
436
437
  // -------- Class Vrrpv2Layer -----------------
438
439
  VrrpV2Layer::VrrpV2Layer(uint8_t virtualRouterId, uint8_t priority, uint8_t advInt, uint8_t authType)
440
0
      : VrrpLayer(VRRPv2, virtualRouterId, priority)
441
0
  {
442
0
    setAdvInt(advInt);
443
0
    setAuthType(authType);
444
0
  }
445
446
  VrrpV2Layer::VrrpAuthType VrrpV2Layer::getAuthTypeAsEnum() const
447
0
  {
448
0
    auto authType = getAuthType();
449
0
    if (authType > 3)
450
0
    {
451
0
      return VrrpAuthType::Other;
452
0
    }
453
454
0
    return static_cast<VrrpAuthType>(authType);
455
0
  }
456
457
  uint8_t VrrpV2Layer::getAdvInt() const
458
0
  {
459
0
    uint16_t authAdvInt = getVrrpHeader()->authTypeAdvInt;
460
0
    auto authAdvIntPtr = reinterpret_cast<vrrpv2_auth_adv*>(&authAdvInt);
461
0
    return authAdvIntPtr->advInt;
462
0
  }
463
464
  void VrrpV2Layer::setAdvInt(uint8_t advInt)
465
0
  {
466
0
    auto authAdvIntPtr = reinterpret_cast<vrrpv2_auth_adv*>(&getVrrpHeader()->authTypeAdvInt);
467
0
    authAdvIntPtr->advInt = advInt;
468
0
  }
469
470
  uint8_t VrrpV2Layer::getAuthType() const
471
0
  {
472
0
    uint16_t authAdvInt = getVrrpHeader()->authTypeAdvInt;
473
0
    auto* authAdvIntPtr = reinterpret_cast<vrrpv2_auth_adv*>(&authAdvInt);
474
0
    return authAdvIntPtr->authType;
475
0
  }
476
477
  void VrrpV2Layer::setAuthType(uint8_t authType)
478
0
  {
479
0
    auto authAdvIntPtr = reinterpret_cast<vrrpv2_auth_adv*>(&getVrrpHeader()->authTypeAdvInt);
480
0
    authAdvIntPtr->authType = authType;
481
0
  }
482
483
  uint16_t VrrpV2Layer::calculateChecksum() const
484
0
  {
485
0
    if ((getData() == nullptr) || (getDataLen() == 0))
486
0
    {
487
0
      return 0;
488
0
    }
489
490
0
    auto vrrpHeader = getVrrpHeader();
491
0
    ScalarBuffer<const uint16_t> buffer = {};
492
0
    buffer.buffer = reinterpret_cast<const uint16_t*>(vrrpHeader);
493
0
    buffer.len = getHeaderLen();
494
495
0
    uint16_t currChecksumValue = vrrpHeader->checksum;
496
0
    vrrpHeader->checksum = 0;
497
0
    uint16_t checksum = computeChecksum(&buffer, 1);
498
0
    vrrpHeader->checksum = currChecksumValue;
499
500
0
    return checksum;
501
0
  }
502
503
  static constexpr const char* authTypeToString(VrrpV2Layer::VrrpAuthType authType)
504
0
  {
505
0
    switch (authType)
506
0
    {
507
0
    case VrrpV2Layer::VrrpAuthType::NoAuthentication:
508
0
      return "NoAuthentication";
509
0
    case VrrpV2Layer::VrrpAuthType::SimpleTextPassword:
510
0
      return "SimpleTextPassword";
511
0
    case VrrpV2Layer::VrrpAuthType::IPAuthenticationHeader:
512
0
      return "IPAuthenticationHeader";
513
0
    case VrrpV2Layer::VrrpAuthType::MD5:
514
0
      return "MD5";
515
0
    default:
516
0
      return "Other";
517
0
    }
518
0
  }
519
520
  const FieldDescriptor VrrpV2Layer::SerializedFields::AdvInt{ VrrpLayer::SerializedFields::MaxID + 1, "advInt" };
521
  const FieldDescriptor VrrpV2Layer::SerializedFields::AuthType{ VrrpLayer::SerializedFields::MaxID + 2, "authType" };
522
523
  void VrrpV2Layer::serializeVrrpLayer(ObjectScope& serializer) const
524
0
  {
525
0
    serializer.writeField(SerializedFields::AdvInt, getAdvInt());
526
0
    serializer.writeField(SerializedFields::AuthType, authTypeToString(getAuthTypeAsEnum()));
527
0
  }
528
529
  // -------- Class Vrrpv3Layer -----------------
530
531
  VrrpV3Layer::VrrpV3Layer(IPAddress::AddressType addressType, uint8_t virtualRouterId, uint8_t priority,
532
                           uint16_t maxAdvInt)
533
0
      : VrrpLayer(VRRPv3, virtualRouterId, priority)
534
0
  {
535
0
    setAddressType(addressType);
536
0
    setMaxAdvInt(maxAdvInt);
537
0
  }
538
539
  uint16_t VrrpV3Layer::getMaxAdvInt() const
540
0
  {
541
0
    uint16_t authAdvInt = getVrrpHeader()->authTypeAdvInt;
542
0
    auto rsvdAdv = reinterpret_cast<vrrpv3_rsvd_adv*>(&authAdvInt);
543
0
    return be16toh(rsvdAdv->maxAdvInt);
544
0
  }
545
546
  void VrrpV3Layer::setMaxAdvInt(uint16_t maxAdvInt)
547
0
  {
548
0
    if (maxAdvInt > 0xfff)
549
0
    {
550
0
      throw std::invalid_argument("maxAdvInt must not exceed 12 bits length");
551
0
    }
552
0
    auto rsvdAdv = reinterpret_cast<vrrpv3_rsvd_adv*>(&getVrrpHeader()->authTypeAdvInt);
553
0
    rsvdAdv->maxAdvInt = htobe16(maxAdvInt);
554
0
  }
555
556
  uint16_t VrrpV3Layer::calculateChecksum() const
557
0
  {
558
0
    auto* ipLayer = getAttachedPacket()->getLayerOfType<pcpp::IPLayer>();
559
0
    if (ipLayer == nullptr)
560
0
    {
561
0
      PCPP_LOG_ERROR("Calculate checksum failed, for can not get IPLayer" << "");
562
0
      return 0;
563
0
    }
564
565
0
    auto vrrpHeader = getVrrpHeader();
566
0
    uint16_t currChecksumValue = vrrpHeader->checksum;
567
0
    vrrpHeader->checksum = 0;
568
569
0
    pcpp::IPAddress srcIPAddr = ipLayer->getSrcIPAddress();
570
0
    pcpp::IPAddress dstIPAddr = ipLayer->getDstIPAddress();
571
0
    uint16_t checksum;
572
0
    if (getAddressType() == IPAddress::IPv4AddressType)
573
0
    {
574
0
      checksum = computePseudoHdrChecksum(reinterpret_cast<const uint8_t*>(vrrpHeader), getDataLen(),
575
0
                                          PACKETPP_IPPROTO_VRRP, srcIPAddr.getIPv4(), dstIPAddr.getIPv4());
576
0
    }
577
0
    else
578
0
    {
579
0
      checksum = computePseudoHdrChecksum(reinterpret_cast<const uint8_t*>(vrrpHeader), getDataLen(),
580
0
                                          PACKETPP_IPPROTO_VRRP, srcIPAddr.getIPv6(), dstIPAddr.getIPv6());
581
0
    }
582
583
0
    vrrpHeader->checksum = currChecksumValue;
584
585
0
    return checksum;
586
0
  }
587
588
  const FieldDescriptor VrrpV3Layer::SerializedFields::MaxAdvInt{ VrrpLayer::SerializedFields::MaxID + 1,
589
                                                                "maxAdvInt" };
590
591
  void VrrpV3Layer::serializeVrrpLayer(ObjectScope& serializer) const
592
0
  {
593
0
    serializer.writeField(SerializedFields::MaxAdvInt, getMaxAdvInt());
594
0
  }
595
}  // namespace pcpp