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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program 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
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
18 */
19
20#ifndef IPV6_ADDRESS_H
21#define IPV6_ADDRESS_H
22
23#include "ipv4-address.h"
24#include "mac8-address.h"
25
26#include "ns3/address.h"
27#include "ns3/attribute-helper.h"
28
29#include <cstring>
30#include <ostream>
31#include <stdint.h>
32
33namespace ns3
34{
35
36class Ipv6Prefix;
37class Mac16Address;
38class Mac48Address;
39class Mac64Address;
40
41/**
42 * \ingroup address
43 * \class Ipv6Address
44 * \brief Describes an IPv6 address.
45 * \see Ipv6Prefix
46 * \see attribute_Ipv6Address
47 */
49{
50 public:
51 /**
52 * \brief Default constructor.
53 */
55
56 /**
57 * \brief Constructs an Ipv6Address by parsing the input C-string.
58 * \param address the C-string containing the IPv6 address (e.g. 2001:660:4701::1).
59 */
60 Ipv6Address(const char* address);
61
62 /**
63 * \brief Constructs an Ipv6Address by using the input 16 bytes.
64 * \param address the 128-bit address
65 * \warning the parameter must point on a 16 bytes integer array!
66 */
67 Ipv6Address(uint8_t address[16]);
68
69 /**
70 * \brief Copy constructor.
71 * \param addr Ipv6Address object
72 */
73 Ipv6Address(const Ipv6Address& addr);
74
75 /**
76 * \brief Copy constructor.
77 * \param addr Ipv6Address pointer
78 */
79 Ipv6Address(const Ipv6Address* addr);
80
81 /**
82 * \brief Destructor.
83 */
85
86 /**
87 * \brief Sets an Ipv6Address by parsing the input C-string.
88 * \param address the C-string containing the IPv6 address (e.g. 2001:660:4701::1).
89 */
90 void Set(const char* address);
91
92 /**
93 * \brief Set an Ipv6Address by using the input 16 bytes.
94 *
95 * \param address the 128-bit address
96 * \warning the parameter must point on a 16 bytes integer array!
97 */
98 void Set(uint8_t address[16]);
99
100 /**
101 * \brief Serialize this address to a 16-byte buffer.
102 * \param buf the output buffer to which this address gets overwritten with this
103 * Ipv6Address
104 */
105 void Serialize(uint8_t buf[16]) const;
106
107 /**
108 * \brief Deserialize this address.
109 * \param buf buffer to read address from
110 * \return an Ipv6Address
111 */
112 static Ipv6Address Deserialize(const uint8_t buf[16]);
113
114 /**
115 * \brief Make the solicited IPv6 address.
116 * \param addr the IPv6 address
117 * \return Solicited IPv6 address
118 */
120
121 /**
122 * \brief Make the Ipv4-mapped IPv6 address.
123 * \param addr the IPv4 address
124 * \return Ipv4-mapped IPv6 address
125 */
127
128 /**
129 * \brief Return the Ipv4 address.
130 * \return Ipv4 address
131 */
133
134 /**
135 * \brief Make the autoconfigured IPv6 address from a Mac address.
136 *
137 * Actually the MAC supported are: Mac8, Mac16, Mac48, and Mac64.
138 *
139 * \param addr the MAC address.
140 * \param prefix the IPv6 prefix
141 * \return autoconfigured IPv6 address
142 */
144
145 /**
146 * \brief Make the autoconfigured IPv6 address from a Mac address.
147 *
148 * Actually the MAC supported are: Mac8, Mac16, Mac48, and Mac64.
149 *
150 * \param addr the MAC address.
151 * \param prefix the IPv6 prefix
152 * \return autoconfigured IPv6 address
153 */
154
156
157 /**
158 * \brief Make the autoconfigured IPv6 address with Mac16Address.
159 *
160 * The EUI-64 scheme used is based on the \RFC{4944}.
161 *
162 * \param addr the MAC address (16 bits).
163 * \param prefix the IPv6 prefix
164 * \return autoconfigured IPv6 address
165 */
167
168 /**
169 * \brief Make the autoconfigured IPv6 address with Mac48Address.
170 *
171 * The EUI-64 scheme used is based on \RFC{2464}.
172 *
173 * \param addr the MAC address (48 bits).
174 * \param prefix the IPv6 prefix
175 * \return autoconfigured IPv6 address
176 */
178
179 /**
180 * \brief Make the autoconfigured IPv6 address with Mac64Address.
181 * \param addr the MAC address (64 bits).
182 * \param prefix the IPv6 prefix
183 * \return autoconfigured IPv6 address
184 */
186
187 /**
188 * \brief Make the autoconfigured IPv6 address with Mac8Address.
189 *
190 * The EUI-64 scheme used is loosely based on the \RFC{2464}.
191 *
192 * \param addr the Mac8Address address (8 bits).
193 * \param prefix the IPv6 prefix
194 * \return autoconfigured IPv6 address
195 */
197
198 /**
199 * \brief Make the autoconfigured link-local IPv6 address from a Mac address.
200 *
201 * Actually the MAC supported are: Mac8, Mac16, Mac48, and Mac64.
202 *
203 * \param mac the MAC address.
204 * \return autoconfigured link-local IPv6 address
205 */
207
208 /**
209 * \brief Make the autoconfigured link-local IPv6 address with Mac16Address.
210 *
211 * The EUI-64 scheme used is based on the \RFC{4944}.
212 *
213 * \param mac the MAC address (16 bits).
214 * \return autoconfigured link-local IPv6 address
215 */
217
218 /**
219 * \brief Make the autoconfigured link-local IPv6 address with Mac48Address.
220 *
221 * The EUI-64 scheme used is based on \RFC{2464}.
222 *
223 * \param mac the MAC address (48 bits).
224 * \return autoconfigured link-local IPv6 address
225 */
227
228 /**
229 * \brief Make the autoconfigured link-local IPv6 address with Mac64Address.
230 * \param mac the MAC address (64 bits).
231 * \return autoconfigured link-local IPv6 address
232 */
234
235 /**
236 * \brief Make the autoconfigured link-local IPv6 address with Mac8Address.
237 *
238 * The EUI-64 scheme used is loosely based on the \RFC{2464}.
239 *
240 * \param mac the MAC address (8 bits).
241 * \return autoconfigured link-local IPv6 address
242 */
244
245 /**
246 * \brief Print this address to the given output stream.
247 *
248 * The print format is in the typical "2001:660:4701::1".
249 * \param os the output stream to which this Ipv6Address is printed
250 */
251 void Print(std::ostream& os) const;
252
253 /**
254 * \brief If the IPv6 address is localhost (::1).
255 * \return true if localhost, false otherwise
256 */
257 bool IsLocalhost() const;
258
259 /**
260 * \brief If the IPv6 address is multicast (ff00::/8).
261 * \return true if multicast, false otherwise
262 */
263 bool IsMulticast() const;
264
265 /**
266 * \brief If the IPv6 address is link-local multicast (ff02::/16).
267 * \return true if link-local multicast, false otherwise
268 */
269 bool IsLinkLocalMulticast() const;
270
271 /**
272 * \brief If the IPv6 address is "all nodes multicast" (ff02::1/8).
273 * \return true if "all nodes multicast", false otherwise
274 */
275 bool IsAllNodesMulticast() const;
276
277 /**
278 * \brief If the IPv6 address is "all routers multicast" (ff02::2/8).
279 * \return true if "all routers multicast", false otherwise
280 */
281 bool IsAllRoutersMulticast() const;
282
283 /**
284 * \brief If the IPv6 address is a link-local address (fe80::/64).
285 * \return true if the address is link-local, false otherwise
286 */
287 bool IsLinkLocal() const;
288
289 /**
290 * \brief If the IPv6 address is a Solicited multicast address.
291 * \return true if it is, false otherwise
292 */
293 bool IsSolicitedMulticast() const;
294
295 /**
296 * \brief If the IPv6 address is the "Any" address.
297 * \return true if it is, false otherwise
298 */
299 bool IsAny() const;
300
301 /**
302 * \brief If the IPv6 address is a documentation address (2001:DB8::/32).
303 * \return true if the address is documentation, false otherwise
304 */
305 bool IsDocumentation() const;
306
307 /**
308 * \brief Compares an address and a prefix.
309 * \param prefix the prefix to compare with
310 * \return true if the address has the given prefix
311 */
312 bool HasPrefix(const Ipv6Prefix& prefix) const;
313
314 /**
315 * \brief Combine this address with a prefix.
316 * \param prefix a IPv6 prefix
317 * \return an IPv6 address that is this address combined
318 * (bitwise AND) with a prefix, yielding an IPv6 network address.
319 */
320 Ipv6Address CombinePrefix(const Ipv6Prefix& prefix) const;
321
322 /**
323 * \brief If the Address matches the type.
324 * \param address other address
325 * \return true if the type matches, false otherwise
326 */
327 static bool IsMatchingType(const Address& address);
328
329 /**
330 * \brief If the address is an IPv4-mapped address
331 * \return true if address is an IPv4-mapped address, otherwise false.
332 */
333 bool IsIpv4MappedAddress() const;
334
335 /**
336 * \brief Convert to Address object
337 */
338 operator Address() const;
339
340 /**
341 * \brief Convert the Address object into an Ipv6Address ones.
342 * \param address address to convert
343 * \return an Ipv6Address
344 */
345 static Ipv6Address ConvertFrom(const Address& address);
346
347 /**
348 * \brief convert the IPv6Address object to an Address object.
349 * \return the Address object corresponding to this object.
350 */
351 Address ConvertTo() const;
352
353 /**
354 * \return true if address is initialized (i.e., set to something), false otherwise
355 */
356 bool IsInitialized() const;
357
358 /**
359 * \brief Get the 0 (::) Ipv6Address.
360 * \return the :: Ipv6Address representation
361 */
362 static Ipv6Address GetZero();
363
364 /**
365 * \brief Get the "any" (::) Ipv6Address.
366 * \return the "any" (::) Ipv6Address
367 */
368 static Ipv6Address GetAny();
369
370 /**
371 * \brief Get the "all nodes multicast" address.
372 * \return the "ff02::2/8" Ipv6Address representation
373 */
375
376 /**
377 * \brief Get the "all routers multicast" address.
378 * \return the "ff02::2/8" Ipv6Address representation
379 */
381
382 /**
383 * \brief Get the "all hosts multicast" address.
384 * \return the "ff02::3/8" Ipv6Address representation
385 */
387
388 /**
389 * \brief Get the loopback address.
390 * \return the "::1/128" Ipv6Address representation.
391 */
392 static Ipv6Address GetLoopback();
393
394 /**
395 * \brief Get the "all-1" IPv6 address (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff).
396 * \return all-1 Ipv6Address representation
397 */
398 static Ipv6Address GetOnes();
399
400 /**
401 * \brief Get the bytes corresponding to the address.
402 * \param buf buffer to store the data
403 */
404 void GetBytes(uint8_t buf[16]) const;
405
406 private:
407 /**
408 * \brief Return the Type of address.
409 * \return type of address
410 */
411 static uint8_t GetType();
412
413 /**
414 * \brief The address representation on 128 bits (16 bytes).
415 */
416 uint8_t m_address[16];
417 bool m_initialized; //!< IPv6 address has been explicitly initialized to a valid value.
418
419 /**
420 * \brief Equal to operator.
421 *
422 * \param a the first operand.
423 * \param b the first operand.
424 * \returns true if the operands are equal.
425 */
426 friend bool operator==(const Ipv6Address& a, const Ipv6Address& b);
427
428 /**
429 * \brief Not equal to operator.
430 *
431 * \param a the first operand.
432 * \param b the first operand.
433 * \returns true if the operands are not equal.
434 */
435 friend bool operator!=(const Ipv6Address& a, const Ipv6Address& b);
436
437 /**
438 * \brief Less than to operator.
439 *
440 * \param a the first operand.
441 * \param b the first operand.
442 * \returns true if the first operand is less than the second.
443 */
444 friend bool operator<(const Ipv6Address& a, const Ipv6Address& b);
445};
446
447/**
448 * \ingroup address
449 * \class Ipv6Prefix
450 * \brief Describes an IPv6 prefix. It is just a bitmask like Ipv4Mask.
451 * \see Ipv6Address
452 * \see attribute_Ipv6Prefix
453 */
455{
456 public:
457 /**
458 * \brief Default constructor.
459 */
460 Ipv6Prefix();
461
462 /**
463 * \brief Constructs an Ipv6Prefix by using the input 16 bytes.
464 *
465 * The prefix length is calculated as the minimum prefix length, i.e.,
466 * 2001:db8:cafe:: will have a 47 bit prefix length.
467 *
468 * \param prefix the 128-bit prefix
469 */
470 Ipv6Prefix(uint8_t prefix[16]);
471
472 /**
473 * \brief Constructs an Ipv6Prefix by using the input string.
474 *
475 * The prefix length is calculated as the minimum prefix length, i.e.,
476 * 2001:db8:cafe:: will have a 47 bit prefix length.
477 *
478 * \param prefix the 128-bit prefix
479 */
480 Ipv6Prefix(const char* prefix);
481
482 /**
483 * \brief Constructs an Ipv6Prefix by using the input 16 bytes.
484 * \param prefix the 128-bit prefix
485 * \param prefixLength the prefix length
486 */
487 Ipv6Prefix(uint8_t prefix[16], uint8_t prefixLength);
488
489 /**
490 * \brief Constructs an Ipv6Prefix by using the input string.
491 * \param prefix the 128-bit prefix
492 * \param prefixLength the prefix length
493 */
494 Ipv6Prefix(const char* prefix, uint8_t prefixLength);
495
496 /**
497 * \brief Constructs an Ipv6Prefix by using the input number of bits.
498 * \param prefix number of bits of the prefix (0 - 128)
499 * \note A valid number of bits is between 0 and 128).
500 */
501 Ipv6Prefix(uint8_t prefix);
502
503 /**
504 * \brief Copy constructor.
505 * \param prefix Ipv6Prefix object
506 */
507 Ipv6Prefix(const Ipv6Prefix& prefix);
508
509 /**
510 * \brief Copy constructor.
511 * \param prefix Ipv6Prefix pointer
512 */
513 Ipv6Prefix(const Ipv6Prefix* prefix);
514
515 /**
516 * \brief Destructor.
517 */
518 ~Ipv6Prefix();
519
520 /**
521 * \brief If the Address match the type.
522 * \param a a first address
523 * \param b a second address
524 * \return true if the type match, false otherwise
525 */
526 bool IsMatch(Ipv6Address a, Ipv6Address b) const;
527
528 /**
529 * \brief Get the bytes corresponding to the prefix.
530 * \param buf buffer to store the data
531 */
532 void GetBytes(uint8_t buf[16]) const;
533
534 /**
535 * \brief Convert the Prefix into an IPv6 Address.
536 * \return an IPv6 address representing the prefix
537 */
539
540 /**
541 * \brief Get prefix length.
542 * \return prefix length
543 */
544 uint8_t GetPrefixLength() const;
545
546 /**
547 * \brief Set prefix length.
548 * \param prefixLength the prefix length
549 */
550 void SetPrefixLength(uint8_t prefixLength);
551
552 /**
553 * \brief Get the minimum prefix length, i.e., 128 - the length of the largest sequence
554 * trailing zeroes.
555 * \return minimum prefix length
556 */
557 uint8_t GetMinimumPrefixLength() const;
558
559 /**
560 * \brief Print this address to the given output stream.
561 *
562 * The print format is in the typical "2001:660:4701::1".
563 * \param os the output stream to which this Ipv6Address is printed
564 */
565 void Print(std::ostream& os) const;
566
567 /**
568 * \brief Get the loopback prefix ( /128).
569 * \return a Ipv6Prefix corresponding to loopback prefix
570 */
571 static Ipv6Prefix GetLoopback();
572
573 /**
574 * \brief Get the "all-1" IPv6 mask (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff).
575 * \return /128 Ipv6Prefix representation
576 */
577 static Ipv6Prefix GetOnes();
578
579 /**
580 * \brief Get the zero prefix ( /0).
581 * \return an Ipv6Prefix
582 */
583 static Ipv6Prefix GetZero();
584
585 private:
586 /**
587 * \brief The prefix representation.
588 */
589 uint8_t m_prefix[16];
590
591 /**
592 * \brief The prefix length.
593 */
595
596 /**
597 * \brief Equal to operator.
598 *
599 * \param a the first operand
600 * \param b the first operand
601 * \returns true if the operands are equal
602 */
603 friend bool operator==(const Ipv6Prefix& a, const Ipv6Prefix& b);
604
605 /**
606 * \brief Not equal to operator.
607 *
608 * \param a the first operand
609 * \param b the first operand
610 * \returns true if the operands are not equal
611 */
612 friend bool operator!=(const Ipv6Prefix& a, const Ipv6Prefix& b);
613};
614
617
618/**
619 * \brief Stream insertion operator.
620 *
621 * \param os the reference to the output stream
622 * \param address the Ipv6Address
623 * \returns the reference to the output stream
624 */
625std::ostream& operator<<(std::ostream& os, const Ipv6Address& address);
626
627/**
628 * \brief Stream insertion operator.
629 *
630 * \param os the reference to the output stream
631 * \param prefix the Ipv6Prefix
632 * \returns the reference to the output stream
633 */
634std::ostream& operator<<(std::ostream& os, const Ipv6Prefix& prefix);
635
636/**
637 * \brief Stream extraction operator.
638 *
639 * \param is the reference to the input stream
640 * \param address the Ipv6Address
641 * \returns the reference to the input stream
642 */
643std::istream& operator>>(std::istream& is, Ipv6Address& address);
644
645/**
646 * \brief Stream extraction operator.
647 *
648 * \param is the reference to the input stream
649 * \param prefix the Ipv6Prefix
650 * \returns the reference to the input stream
651 */
652std::istream& operator>>(std::istream& is, Ipv6Prefix& prefix);
653
654inline bool
656{
657 return !std::memcmp(a.m_address, b.m_address, 16);
658}
659
660inline bool
662{
663 return std::memcmp(a.m_address, b.m_address, 16);
664}
665
666inline bool
667operator<(const Ipv6Address& a, const Ipv6Address& b)
668{
669 return std::memcmp(a.m_address, b.m_address, 16) < 0;
670}
671
672inline bool
674{
675 return !std::memcmp(a.m_prefix, b.m_prefix, 16);
676}
677
678inline bool
680{
681 return std::memcmp(a.m_prefix, b.m_prefix, 16);
682}
683
684/**
685 * \class Ipv6AddressHash
686 * \brief Hash function class for IPv6 addresses.
687 */
689{
690 public:
691 /**
692 * \brief Returns the hash of an IPv6 address.
693 * \param x IPv6 address to hash
694 * \returns the hash of the address
695 */
696 size_t operator()(const Ipv6Address& x) const;
697};
698
699} /* namespace ns3 */
700
701#endif /* IPV6_ADDRESS_H */
a polymophic address class
Definition: address.h:101
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
Hash function class for IPv6 addresses.
Definition: ipv6-address.h:689
size_t operator()(const Ipv6Address &x) const
Returns the hash of an IPv6 address.
Describes an IPv6 address.
Definition: ipv6-address.h:49
static uint8_t GetType()
Return the Type of address.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
friend bool operator!=(const Ipv6Address &a, const Ipv6Address &b)
Not equal to operator.
Definition: ipv6-address.h:661
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.
friend bool operator==(const Ipv6Address &a, const Ipv6Address &b)
Equal to operator.
Definition: ipv6-address.h:655
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.
bool IsAllNodesMulticast() const
If the IPv6 address is "all nodes multicast" (ff02::1/8).
bool IsLinkLocalMulticast() const
If the IPv6 address is link-local multicast (ff02::/16).
friend bool operator<(const Ipv6Address &a, const Ipv6Address &b)
Less than to operator.
Definition: ipv6-address.h:667
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.
~Ipv6Address()
Destructor.
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.
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.
Ipv6Address()
Default constructor.
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).
bool m_initialized
IPv6 address has been explicitly initialized to a valid value.
Definition: ipv6-address.h:417
uint8_t m_address[16]
The address representation on 128 bits (16 bytes).
Definition: ipv6-address.h:416
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.
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.
Definition: ipv6-address.h:455
uint8_t m_prefixLength
The prefix length.
Definition: ipv6-address.h:594
static Ipv6Prefix GetLoopback()
Get the loopback prefix ( /128).
~Ipv6Prefix()
Destructor.
uint8_t m_prefix[16]
The prefix representation.
Definition: ipv6-address.h:589
friend bool operator==(const Ipv6Prefix &a, const Ipv6Prefix &b)
Equal to operator.
Definition: ipv6-address.h:673
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.
static Ipv6Prefix GetZero()
Get the zero prefix ( /0).
bool IsMatch(Ipv6Address a, Ipv6Address b) const
If the Address match the type.
static Ipv6Prefix GetOnes()
Get the "all-1" IPv6 mask (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff).
friend bool operator!=(const Ipv6Prefix &a, const Ipv6Prefix &b)
Not equal to operator.
Definition: ipv6-address.h:679
void SetPrefixLength(uint8_t prefixLength)
Set prefix length.
Ipv6Prefix()
Default constructor.
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.
Definition: mac16-address.h:44
an EUI-48 address
Definition: mac48-address.h:46
an EUI-64 address
Definition: mac64-address.h:46
A class used for addressing MAC8 MAC's.
Definition: mac8-address.h:44
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
Definition: callback.h:680
bool operator==(const EventId &a, const EventId &b)
Definition: event-id.h:157
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:159
std::istream & operator>>(std::istream &is, Angles &a)
Definition: angles.cc:183
bool operator<(const EventId &a, const EventId &b)
Definition: event-id.h:170