A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ipv6-address.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007-2008 Louis Pasteur University
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
7 */
8
9#ifndef IPV6_ADDRESS_H
10#define IPV6_ADDRESS_H
11
12#include "ipv4-address.h"
13#include "mac8-address.h"
14
15#include "ns3/address.h"
16#include "ns3/attribute-helper.h"
17#include "ns3/deprecated.h"
18
19#include <array>
20#include <compare>
21#include <cstring>
22#include <optional>
23#include <ostream>
24#include <stdint.h>
25
26namespace ns3
27{
28
29class Ipv6Prefix;
30class Mac16Address;
31class Mac48Address;
32class Mac64Address;
33
34/**
35 * @ingroup address
36 * @class Ipv6Address
37 * @brief Describes an IPv6 address.
38 * @see Ipv6Prefix
39 * @see attribute_Ipv6Address
40 */
42{
43 public:
44 /**
45 * @brief Default constructor.
46 */
47 Ipv6Address() = default;
48
49 /**
50 * @brief Constructs an Ipv6Address by parsing the input C-string.
51 * @param address the C-string containing the IPv6 address (e.g. 2001:db8:f00d:cafe::1).
52 */
53 Ipv6Address(const char* address);
54
55 /**
56 * @brief Checks if the string contains an Ipv6Address
57 *
58 * Input address is in format:
59 * \c 2001:db8:f00d:cafe::1
60 *
61 * Note: the function uses ``inet_pton`` internally.
62 *
63 * @see Address::CheckCompatible hich has a similar name but which
64 * instead checks the underlying type and length embedded in the Address.
65 *
66 * @param addressStr string containing the address as described above
67 * @return true if the string can be parsed as an IPv6 address
68 */
69 static bool CheckCompatible(const std::string& addressStr);
70
71 /**
72 * @brief Constructs an Ipv6Address by using the input 16 bytes.
73 * @param address the 128-bit address
74 * @warning the parameter must point on a 16 bytes integer array!
75 */
76 Ipv6Address(uint8_t address[16]);
77
78 /**
79 * @brief Sets an Ipv6Address by parsing the input C-string.
80 * @param address the C-string containing the IPv6 address (e.g. 2001:db8:f00d:cafe::1).
81 */
82 void Set(const char* address);
83
84 /**
85 * @brief Set an Ipv6Address by using the input 16 bytes.
86 *
87 * @param address the 128-bit address
88 * @warning the parameter must point on a 16 bytes integer array!
89 */
90 void Set(uint8_t address[16]);
91
92 /**
93 * @brief Serialize this address to a 16-byte buffer.
94 * @param buf the output buffer to which this address gets overwritten with this
95 * Ipv6Address
96 */
97 void Serialize(uint8_t buf[16]) const;
98
99 /**
100 * @brief Deserialize this address.
101 * @param buf buffer to read address from
102 * @return an Ipv6Address
103 */
104 static Ipv6Address Deserialize(const uint8_t buf[16]);
105
106 /**
107 * @brief Make the solicited IPv6 address.
108 * @param addr the IPv6 address
109 * @return Solicited IPv6 address
110 */
112
113 /**
114 * @brief Make the Ipv4-mapped IPv6 address.
115 * @param addr the IPv4 address
116 * @return Ipv4-mapped IPv6 address
117 */
119
120 /**
121 * @brief Return the Ipv4 address.
122 * @return Ipv4 address
123 */
125
126 /**
127 * @brief Make the autoconfigured IPv6 address from a Mac address.
128 *
129 * Actually the MAC supported are: Mac8, Mac16, Mac48, and Mac64.
130 *
131 * @param addr the MAC address.
132 * @param prefix the IPv6 prefix
133 * @return autoconfigured IPv6 address
134 */
136
137 /**
138 * @brief Make the autoconfigured IPv6 address from a Mac address.
139 *
140 * Actually the MAC supported are: Mac8, Mac16, Mac48, and Mac64.
141 *
142 * @param addr the MAC address.
143 * @param prefix the IPv6 prefix
144 * @return autoconfigured IPv6 address
145 */
146
148
149 /**
150 * @brief Make the autoconfigured IPv6 address with Mac16Address.
151 *
152 * The EUI-64 scheme used is based on the \RFC{4944}.
153 *
154 * @param addr the MAC address (16 bits).
155 * @param prefix the IPv6 prefix
156 * @return autoconfigured IPv6 address
157 */
159
160 /**
161 * @brief Make the autoconfigured IPv6 address with Mac48Address.
162 *
163 * The EUI-64 scheme used is based on \RFC{2464}.
164 *
165 * @param addr the MAC address (48 bits).
166 * @param prefix the IPv6 prefix
167 * @return autoconfigured IPv6 address
168 */
170
171 /**
172 * @brief Make the autoconfigured IPv6 address with Mac64Address.
173 * @param addr the MAC address (64 bits).
174 * @param prefix the IPv6 prefix
175 * @return autoconfigured IPv6 address
176 */
178
179 /**
180 * @brief Make the autoconfigured IPv6 address with Mac8Address.
181 *
182 * The EUI-64 scheme used is loosely based on the \RFC{2464}.
183 *
184 * @param addr the Mac8Address address (8 bits).
185 * @param prefix the IPv6 prefix
186 * @return autoconfigured IPv6 address
187 */
189
190 /**
191 * @brief Make the autoconfigured link-local IPv6 address from a Mac address.
192 *
193 * Actually the MAC supported are: Mac8, Mac16, Mac48, and Mac64.
194 *
195 * @param mac the MAC address.
196 * @return autoconfigured link-local IPv6 address
197 */
199
200 /**
201 * @brief Make the autoconfigured link-local IPv6 address with Mac16Address.
202 *
203 * The EUI-64 scheme used is based on the \RFC{4944}.
204 *
205 * @param mac the MAC address (16 bits).
206 * @return autoconfigured link-local IPv6 address
207 */
209
210 /**
211 * @brief Make the autoconfigured link-local IPv6 address with Mac48Address.
212 *
213 * The EUI-64 scheme used is based on \RFC{2464}.
214 *
215 * @param mac the MAC address (48 bits).
216 * @return autoconfigured link-local IPv6 address
217 */
219
220 /**
221 * @brief Make the autoconfigured link-local IPv6 address with Mac64Address.
222 * @param mac the MAC address (64 bits).
223 * @return autoconfigured link-local IPv6 address
224 */
226
227 /**
228 * @brief Make the autoconfigured link-local IPv6 address with Mac8Address.
229 *
230 * The EUI-64 scheme used is loosely based on the \RFC{2464}.
231 *
232 * @param mac the MAC address (8 bits).
233 * @return autoconfigured link-local IPv6 address
234 */
236
237 /**
238 * @brief Print this address to the given output stream.
239 *
240 * The print format is in the typical "2001:660:4701::1".
241 * @param os the output stream to which this Ipv6Address is printed
242 */
243 void Print(std::ostream& os) const;
244
245 /**
246 * @brief If the IPv6 address is localhost (::1).
247 * @return true if localhost, false otherwise
248 */
249 bool IsLocalhost() const;
250
251 /**
252 * @brief If the IPv6 address is multicast (ff00::/8).
253 * @return true if multicast, false otherwise
254 */
255 bool IsMulticast() const;
256
257 /**
258 * @brief If the IPv6 address is link-local multicast (ff02::/16).
259 * @return true if link-local multicast, false otherwise
260 */
261 bool IsLinkLocalMulticast() const;
262
263 /**
264 * @brief If the IPv6 address is "all nodes multicast" (ff02::1/8).
265 * @return true if "all nodes multicast", false otherwise
266 */
267 bool IsAllNodesMulticast() const;
268
269 /**
270 * @brief If the IPv6 address is "all routers multicast" (ff02::2/8).
271 * @return true if "all routers multicast", false otherwise
272 */
273 bool IsAllRoutersMulticast() const;
274
275 /**
276 * @brief If the IPv6 address is a link-local address (fe80::/64).
277 * @return true if the address is link-local, false otherwise
278 */
279 bool IsLinkLocal() const;
280
281 /**
282 * @brief If the IPv6 address is a Solicited multicast address.
283 * @return true if it is, false otherwise
284 */
285 bool IsSolicitedMulticast() const;
286
287 /**
288 * @brief If the IPv6 address is the "Any" address.
289 * @return true if it is, false otherwise
290 */
291 bool IsAny() const;
292
293 /**
294 * @brief If the IPv6 address is a documentation address (2001:DB8::/32).
295 * @return true if the address is documentation, false otherwise
296 */
297 bool IsDocumentation() const;
298
299 /**
300 * @brief Compares an address and a prefix.
301 * @param prefix the prefix to compare with
302 * @return true if the address has the given prefix
303 */
304 bool HasPrefix(const Ipv6Prefix& prefix) const;
305
306 /**
307 * @brief Combine this address with a prefix.
308 * @param prefix a IPv6 prefix
309 * @return an IPv6 address that is this address combined
310 * (bitwise AND) with a prefix, yielding an IPv6 network address.
311 */
312 Ipv6Address CombinePrefix(const Ipv6Prefix& prefix) const;
313
314 /**
315 * @brief If the Address matches the type.
316 * @param address other address
317 * @return true if the type matches, false otherwise
318 */
319 static bool IsMatchingType(const Address& address);
320
321 /**
322 * @brief If the address is an IPv4-mapped address
323 * @return true if address is an IPv4-mapped address, otherwise false.
324 */
325 bool IsIpv4MappedAddress() const;
326
327 /**
328 * @brief Convert to Address object
329 */
330 operator Address() const;
331
332 /**
333 * @brief Convert the Address object into an Ipv6Address ones.
334 * @param address address to convert
335 * @return an Ipv6Address
336 */
337 static Ipv6Address ConvertFrom(const Address& address);
338
339 /**
340 * @brief convert the IPv6Address object to an Address object.
341 * @return the Address object corresponding to this object.
342 */
343 Address ConvertTo() const;
344
345 /**
346 * @return true if address is initialized (i.e., set to something), false otherwise
347 */
348 NS_DEPRECATED_3_47("Use IsAny or std::optional")
349 bool IsInitialized() const;
350
351 /**
352 * @brief Get the 0 (::) Ipv6Address.
353 * @return the :: Ipv6Address representation
354 */
355 static Ipv6Address GetZero();
356
357 /**
358 * @brief Get the "any" (::) Ipv6Address.
359 * @return the "any" (::) Ipv6Address
360 */
361 static Ipv6Address GetAny();
362
363 /**
364 * @brief Get the "all nodes multicast" address.
365 * @return the "ff02::2/8" Ipv6Address representation
366 */
368
369 /**
370 * @brief Get the "all routers multicast" address.
371 * @return the "ff02::2/8" Ipv6Address representation
372 */
374
375 /**
376 * @brief Get the "all hosts multicast" address.
377 * @return the "ff02::3/8" Ipv6Address representation
378 */
380
381 /**
382 * @brief Get the loopback address.
383 * @return the "::1/128" Ipv6Address representation.
384 */
385 static Ipv6Address GetLoopback();
386
387 /**
388 * @brief Get the "all-1" IPv6 address (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff).
389 * @return all-1 Ipv6Address representation
390 */
391 static Ipv6Address GetOnes();
392
393 /**
394 * @brief Get the bytes corresponding to the address.
395 * @param buf buffer to store the data
396 */
397 void GetBytes(uint8_t buf[16]) const;
398
399 /**
400 * @brief Get the address hash.
401 * @return the address hash
402 */
403 uint32_t GetHash() const;
404
405 /**
406 * @brief Three-way comparison operator.
407 *
408 * @param other the other address to compare with
409 * @returns comparison result
410 */
411 inline std::strong_ordering operator<=>(const Ipv6Address& other) const
412 {
413 return m_address <=> other.m_address;
414 }
415
416 /**
417 * @brief Equal to operator.
418 *
419 * @param other the other address to compare with
420 * @returns true if the operands are equal.
421 */
422 inline bool operator==(const Ipv6Address& other) const
423 {
424 return m_address == other.m_address;
425 }
426
427 private:
428 /**
429 * @brief Mix hash keys in-place for lookuphash
430 *
431 * @param a first word of the hash key
432 * @param b second word of the hash key
433 * @param c third word of the hash key
434 */
435 static void MixHashKey(uint32_t& a, uint32_t& b, uint32_t& c);
436
437 /**
438 * @brief Generate and return a hash key.
439 * @return hash
440 * @note Adapted from Jens Jakobsen implementation (chillispot).
441 */
442 uint32_t GenerateHash() const;
443
444 /**
445 * @brief Return the Type of address.
446 * @return type of address
447 */
448 static uint8_t GetType();
449
450 /**
451 * @brief The address representation on 128 bits (16 bytes).
452 */
453 std::array<uint8_t, 16> m_address{};
454
455 /**
456 * @brief address hash.
457 */
458 mutable std::optional<uint32_t> m_hash;
459};
460
461/**
462 * @ingroup address
463 * @class Ipv6Prefix
464 * @brief Describes an IPv6 prefix. It is just a bitmask like Ipv4Mask.
465 * @see Ipv6Address
466 * @see attribute_Ipv6Prefix
467 */
469{
470 public:
471 /**
472 * @brief Default constructor.
473 *
474 * The default prefix is empty, corresponding to /0
475 */
476 Ipv6Prefix() = default;
477
478 /**
479 * @brief Constructs an Ipv6Prefix by using the input 16 bytes.
480 *
481 * The prefix length is calculated as the minimum prefix length, i.e.,
482 * 2001:db8:cafe:: will have a 47 bit prefix length (0xE is 0b1110).
483 *
484 * @param prefix the 128-bit prefix
485 */
486 Ipv6Prefix(uint8_t prefix[16]);
487
488 /**
489 * @brief Constructs an Ipv6Prefix by using the input string.
490 *
491 * The prefix length is calculated as the minimum prefix length, i.e.,
492 * 2001:db8:cafe:: will have a 47 bit prefix length.
493 *
494 * @param prefix the 128-bit prefix
495 */
496 Ipv6Prefix(const char* prefix);
497
498 /**
499 * @brief Constructs an Ipv6Prefix by using the input 16 bytes.
500 * @param prefix the 128-bit prefix
501 * @param prefixLength the prefix length
502 */
503 Ipv6Prefix(uint8_t prefix[16], uint8_t prefixLength);
504
505 /**
506 * @brief Constructs an Ipv6Prefix by using the input string.
507 * @param prefix the 128-bit prefix
508 * @param prefixLength the prefix length
509 */
510 Ipv6Prefix(const char* prefix, uint8_t prefixLength);
511
512 /**
513 * @brief Constructs an Ipv6Prefix by using the input number of bits.
514 * @param prefix number of bits of the prefix (0 - 128)
515 * @note A valid number of bits is between 0 and 128).
516 */
517 Ipv6Prefix(uint8_t prefix);
518
519 /**
520 * @brief Check whether two addresses have the same bits in the prefix
521 * portion of their addresses.
522 *
523 * If the prefix length is 0, this method will return true regardless
524 * of the two address argument values. If the prefix length is 128,
525 * this method will require that the two address arguments are the same.
526 *
527 * @param a first address to compare
528 * @param b second address to compare
529 * @return true if both addresses are equal in their masked bits,
530 * corresponding to the prefix length.
531 */
532 bool IsMatch(Ipv6Address a, Ipv6Address b) const;
533
534 /**
535 * @brief Get the bytes corresponding to the prefix.
536 * @param buf buffer to store the data
537 */
538 void GetBytes(uint8_t buf[16]) const;
539
540 /**
541 * @brief Convert the Prefix into an IPv6 Address.
542 * @return an IPv6 address representing the prefix
543 */
545
546 /**
547 * @brief Get prefix length.
548 * @return prefix length
549 */
550 uint8_t GetPrefixLength() const;
551
552 /**
553 * @brief Set prefix length.
554 * @param prefixLength the prefix length
555 */
556 void SetPrefixLength(uint8_t prefixLength);
557
558 /**
559 * @brief Get the minimum prefix length, i.e., 128 - the length of the largest sequence
560 * trailing zeroes.
561 * @return minimum prefix length
562 */
563 uint8_t GetMinimumPrefixLength() const;
564
565 /**
566 * @brief Print this address to the given output stream.
567 *
568 * The print format is in the typical "2001:660:4701::1".
569 * @param os the output stream to which this Ipv6Address is printed
570 */
571 void Print(std::ostream& os) const;
572
573 /**
574 * @brief Get the loopback prefix ( /128).
575 * @return a Ipv6Prefix corresponding to loopback prefix
576 */
577 static Ipv6Prefix GetLoopback();
578
579 /**
580 * @brief Get the "all-1" IPv6 mask (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff).
581 * @return /128 Ipv6Prefix representation
582 */
583 static Ipv6Prefix GetOnes();
584
585 /**
586 * @brief Get the zero prefix ( /0).
587 * @return an Ipv6Prefix
588 */
589 static Ipv6Prefix GetZero();
590
591 /**
592 * @brief Three-way comparison operator.
593 *
594 * @param other the other prefix to compare with
595 * @returns comparison result
596 */
597 std::strong_ordering operator<=>(const Ipv6Prefix& other) const = default;
598
599 private:
600 /**
601 * @brief The prefix representation.
602 */
603 std::array<uint8_t, 16> m_prefix{};
604
605 /**
606 * @brief The prefix length.
607 */
608 uint8_t m_prefixLength{0};
609};
610
613
614/**
615 * @brief Stream insertion operator.
616 *
617 * @param os the reference to the output stream
618 * @param address the Ipv6Address
619 * @returns the reference to the output stream
620 */
621std::ostream& operator<<(std::ostream& os, const Ipv6Address& address);
622
623/**
624 * @brief Stream insertion operator.
625 *
626 * @param os the reference to the output stream
627 * @param prefix the Ipv6Prefix
628 * @returns the reference to the output stream
629 */
630std::ostream& operator<<(std::ostream& os, const Ipv6Prefix& prefix);
631
632/**
633 * @brief Stream extraction operator.
634 *
635 * @param is the reference to the input stream
636 * @param address the Ipv6Address
637 * @returns the reference to the input stream
638 */
639std::istream& operator>>(std::istream& is, Ipv6Address& address);
640
641/**
642 * @brief Stream extraction operator.
643 *
644 * @param is the reference to the input stream
645 * @param prefix the Ipv6Prefix
646 * @returns the reference to the input stream
647 */
648std::istream& operator>>(std::istream& is, Ipv6Prefix& prefix);
649
650/**
651 * @class Ipv6AddressHash
652 * @brief Hash function class for IPv6 addresses.
653 */
654class NS_DEPRECATED_3_47("Unnecessary thanks to std::hash specialization, remove") Ipv6AddressHash
655{
656 public:
657 /**
658 * @brief Returns the hash of an IPv6 address.
659 * @param x IPv6 address to hash
660 * @returns the hash of the address
661 */
662 size_t operator()(const Ipv6Address& x) const;
663};
664
665} /* namespace ns3 */
666
667namespace std
668{
669
670/**
671 * @brief Hash function class for IPv6 addresses.
672 */
673template <>
674struct hash<ns3::Ipv6Address>
675{
676 /**
677 * @brief Returns the hash of an IPv6 address.
678 * @param addr IPv6 address to hash
679 * @returns the hash of the address
680 */
681 size_t operator()(const ns3::Ipv6Address& addr) const
682 {
683 return addr.GetHash();
684 }
685};
686} // namespace std
687
688#endif /* IPV6_ADDRESS_H */
cairo_uint64_t x
_cairo_uint_96by64_32x64_divrem:
a polymophic address class
Definition address.h:114
Ipv4 addresses are stored in host order in this class.
Hash function class for IPv6 addresses.
size_t operator()(const Ipv6Address &x) const
Returns the hash of an IPv6 address.
Describes an IPv6 address.
static uint8_t GetType()
Return the Type of address.
uint32_t GetHash() const
Get the address hash.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
bool HasPrefix(const Ipv6Prefix &prefix) const
Compares an address and a prefix.
bool IsSolicitedMulticast() const
If the IPv6 address is a Solicited multicast address.
static Ipv6Address GetAllNodesMulticast()
Get the "all nodes multicast" address.
void Print(std::ostream &os) const
Print this address to the given output stream.
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address.
static void MixHashKey(uint32_t &a, uint32_t &b, uint32_t &c)
Mix hash keys in-place for lookuphash.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
bool IsDocumentation() const
If the IPv6 address is a documentation address (2001:DB8::/32).
static Ipv6Address GetAllHostsMulticast()
Get the "all hosts multicast" address.
Ipv6Address()=default
Default constructor.
bool IsAllNodesMulticast() const
If the IPv6 address is "all nodes multicast" (ff02::1/8).
static bool CheckCompatible(const std::string &addressStr)
Checks if the string contains an Ipv6Address.
bool IsLinkLocalMulticast() const
If the IPv6 address is link-local multicast (ff02::/16).
static Ipv6Address Deserialize(const uint8_t buf[16])
Deserialize this address.
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
static Ipv6Address MakeAutoconfiguredAddress(Address addr, Ipv6Address prefix)
Make the autoconfigured IPv6 address from a Mac address.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
void GetBytes(uint8_t buf[16]) const
Get the bytes corresponding to the address.
bool IsIpv4MappedAddress() const
If the address is an IPv4-mapped address.
bool operator==(const Ipv6Address &other) const
Equal to operator.
void Set(const char *address)
Sets an Ipv6Address by parsing the input C-string.
void Serialize(uint8_t buf[16]) const
Serialize this address to a 16-byte buffer.
std::optional< uint32_t > m_hash
address hash.
std::array< uint8_t, 16 > m_address
The address representation on 128 bits (16 bytes).
Address ConvertTo() const
convert the IPv6Address object to an Address object.
bool IsAny() const
If the IPv6 address is the "Any" address.
static Ipv6Address GetAllRoutersMulticast()
Get the "all routers multicast" address.
bool IsLocalhost() const
If the IPv6 address is localhost (::1).
static Ipv6Address ConvertFrom(const Address &address)
Convert the Address object into an Ipv6Address ones.
bool IsInitialized() const
static Ipv6Address GetOnes()
Get the "all-1" IPv6 address (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff).
static Ipv6Address MakeAutoconfiguredLinkLocalAddress(Address mac)
Make the autoconfigured link-local IPv6 address from a Mac address.
Ipv4Address GetIpv4MappedAddress() const
Return the Ipv4 address.
static bool IsMatchingType(const Address &address)
If the Address matches the type.
static Ipv6Address MakeIpv4MappedAddress(Ipv4Address addr)
Make the Ipv4-mapped IPv6 address.
uint32_t GenerateHash() const
Generate and return a hash key.
static Ipv6Address GetLoopback()
Get the loopback address.
Ipv6Address CombinePrefix(const Ipv6Prefix &prefix) const
Combine this address with a prefix.
bool IsAllRoutersMulticast() const
If the IPv6 address is "all routers multicast" (ff02::2/8).
Describes an IPv6 prefix.
uint8_t m_prefixLength
The prefix length.
std::array< uint8_t, 16 > m_prefix
The prefix representation.
static Ipv6Prefix GetLoopback()
Get the loopback prefix ( /128).
std::strong_ordering operator<=>(const Ipv6Prefix &other) const =default
Three-way comparison operator.
void Print(std::ostream &os) const
Print this address to the given output stream.
uint8_t GetPrefixLength() const
Get prefix length.
Ipv6Address ConvertToIpv6Address() const
Convert the Prefix into an IPv6 Address.
Ipv6Prefix()=default
Default constructor.
static Ipv6Prefix GetZero()
Get the zero prefix ( /0).
bool IsMatch(Ipv6Address a, Ipv6Address b) const
Check whether two addresses have the same bits in the prefix portion of their addresses.
static Ipv6Prefix GetOnes()
Get the "all-1" IPv6 mask (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff).
void SetPrefixLength(uint8_t prefixLength)
Set prefix length.
uint8_t GetMinimumPrefixLength() const
Get the minimum prefix length, i.e., 128 - the length of the largest sequence trailing zeroes.
void GetBytes(uint8_t buf[16]) const
Get the bytes corresponding to the prefix.
This class can contain 16 bit addresses.
an EUI-48 address
an EUI-64 address
A class used for addressing MAC8 MAC's.
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type.
#define NS_DEPRECATED_3_47(msg)
Tag for things deprecated in version ns-3.47.
Definition deprecated.h:91
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
std::istream & operator>>(std::istream &is, Angles &a)
Definition angles.cc:172
STL namespace.
size_t operator()(const ns3::Ipv6Address &addr) const
Returns the hash of an IPv6 address.