1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3 * Copyright (c) 2007-2009 Strasbourg University
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: David Gross <gdavid.devel@gmail.com>
19 */
20
21 #include "ns3/assert.h"
22 #include "ns3/log.h"
23 #include "ns3/header.h"
24 #include "ipv6-extension-header.h"
25
26 namespace ns3
27 {
28
29 NS_LOG_COMPONENT_DEFINE ("Ipv6ExtensionHeader");
30
31 NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionHeader);
32
GetTypeId()33 TypeId Ipv6ExtensionHeader::GetTypeId ()
34 {
35 static TypeId tid = TypeId ("ns3::Ipv6ExtensionHeader")
36 .AddConstructor<Ipv6ExtensionHeader> ()
37 .SetParent<Header> ()
38 .SetGroupName ("Internet")
39 ;
40 return tid;
41 }
42
GetInstanceTypeId() const43 TypeId Ipv6ExtensionHeader::GetInstanceTypeId () const
44 {
45 return GetTypeId ();
46 }
47
Ipv6ExtensionHeader()48 Ipv6ExtensionHeader::Ipv6ExtensionHeader ()
49 : m_length (0),
50 m_nextHeader (0),
51 m_data (0)
52 {
53 }
54
~Ipv6ExtensionHeader()55 Ipv6ExtensionHeader::~Ipv6ExtensionHeader ()
56 {
57 }
58
SetNextHeader(uint8_t nextHeader)59 void Ipv6ExtensionHeader::SetNextHeader (uint8_t nextHeader)
60 {
61 m_nextHeader = nextHeader;
62 }
63
GetNextHeader() const64 uint8_t Ipv6ExtensionHeader::GetNextHeader () const
65 {
66 return m_nextHeader;
67 }
68
SetLength(uint16_t length)69 void Ipv6ExtensionHeader::SetLength (uint16_t length)
70 {
71 NS_ASSERT_MSG (!(length & 0x7), "Invalid Ipv6ExtensionHeader Length, must be a multiple of 8 bytes.");
72 NS_ASSERT_MSG (length > 0, "Invalid Ipv6ExtensionHeader Length, must be greater than 0.");
73 NS_ASSERT_MSG (length < 2048, "Invalid Ipv6ExtensionHeader Length, must be a lower than 2048.");
74
75 m_length = (length >> 3) - 1;
76 }
77
GetLength() const78 uint16_t Ipv6ExtensionHeader::GetLength () const
79 {
80 return (m_length + 1) << 3;
81 }
82
Print(std::ostream & os) const83 void Ipv6ExtensionHeader::Print (std::ostream &os) const
84 {
85 os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength () << " )";
86 }
87
GetSerializedSize() const88 uint32_t Ipv6ExtensionHeader::GetSerializedSize () const
89 {
90 return 2;
91 }
92
Serialize(Buffer::Iterator start) const93 void Ipv6ExtensionHeader::Serialize (Buffer::Iterator start) const
94 {
95 Buffer::Iterator i = start;
96
97 i.WriteU8 (m_nextHeader);
98 i.WriteU8 (m_length);
99 i.Write (m_data.PeekData (), m_data.GetSize ());
100 }
101
Deserialize(Buffer::Iterator start)102 uint32_t Ipv6ExtensionHeader::Deserialize (Buffer::Iterator start)
103 {
104 Buffer::Iterator i = start;
105
106 m_nextHeader = i.ReadU8 ();
107 m_length = i.ReadU8 ();
108
109 uint32_t dataLength = GetLength () - 2;
110 uint8_t* data = new uint8_t[dataLength];
111 i.Read (data, dataLength);
112
113 if (dataLength > m_data.GetSize ())
114 {
115 m_data.AddAtEnd (dataLength - m_data.GetSize ());
116 }
117 else
118 {
119 m_data.RemoveAtEnd (m_data.GetSize () - dataLength);
120 }
121
122 i = m_data.Begin ();
123 i.Write (data, dataLength);
124
125 delete[] data;
126 return GetSerializedSize ();
127 }
128
OptionField(uint32_t optionsOffset)129 OptionField::OptionField (uint32_t optionsOffset)
130 : m_optionData (0),
131 m_optionsOffset (optionsOffset)
132 {
133 }
134
~OptionField()135 OptionField::~OptionField ()
136 {
137 }
138
GetSerializedSize() const139 uint32_t OptionField::GetSerializedSize () const
140 {
141 return m_optionData.GetSize () + CalculatePad ((Ipv6OptionHeader::Alignment) { 8,0});
142 }
143
Serialize(Buffer::Iterator start) const144 void OptionField::Serialize (Buffer::Iterator start) const
145 {
146 start.Write (m_optionData.Begin (), m_optionData.End ());
147 uint32_t fill = CalculatePad ((Ipv6OptionHeader::Alignment) { 8,0});
148 NS_LOG_LOGIC ("fill with " << fill << " bytes padding");
149 switch (fill)
150 {
151 case 0: return;
152 case 1: Ipv6OptionPad1Header ().Serialize (start);
153 return;
154 default: Ipv6OptionPadnHeader (fill).Serialize (start);
155 return;
156 }
157 }
158
Deserialize(Buffer::Iterator start,uint32_t length)159 uint32_t OptionField::Deserialize (Buffer::Iterator start, uint32_t length)
160 {
161 uint8_t* buf = new uint8_t[length];
162 start.Read (buf, length);
163 m_optionData = Buffer ();
164 m_optionData.AddAtEnd (length);
165 m_optionData.Begin ().Write (buf, length);
166 delete[] buf;
167 return length;
168 }
169
AddOption(Ipv6OptionHeader const & option)170 void OptionField::AddOption (Ipv6OptionHeader const& option)
171 {
172 NS_LOG_FUNCTION (option);
173
174 uint32_t pad = CalculatePad (option.GetAlignment ());
175 NS_LOG_LOGIC ("need " << pad << " bytes padding");
176 switch (pad)
177 {
178 case 0: break; //no padding needed
179 case 1: AddOption (Ipv6OptionPad1Header ());
180 break;
181 default: AddOption (Ipv6OptionPadnHeader (pad));
182 break;
183 }
184
185 m_optionData.AddAtEnd (option.GetSerializedSize ());
186 Buffer::Iterator it = m_optionData.End ();
187 it.Prev (option.GetSerializedSize ());
188 option.Serialize (it);
189 }
190
CalculatePad(Ipv6OptionHeader::Alignment alignment) const191 uint32_t OptionField::CalculatePad (Ipv6OptionHeader::Alignment alignment) const
192 {
193 return (alignment.offset - (m_optionData.GetSize () + m_optionsOffset)) % alignment.factor;
194 }
195
GetOptionsOffset()196 uint32_t OptionField::GetOptionsOffset ()
197 {
198 return m_optionsOffset;
199 }
200
GetOptionBuffer()201 Buffer OptionField::GetOptionBuffer ()
202 {
203 return m_optionData;
204 }
205
206
207 NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionHopByHopHeader);
208
GetTypeId()209 TypeId Ipv6ExtensionHopByHopHeader::GetTypeId ()
210 {
211 static TypeId tid = TypeId ("ns3::Ipv6ExtensionHopByHopHeader")
212 .AddConstructor<Ipv6ExtensionHopByHopHeader> ()
213 .SetParent<Ipv6ExtensionHeader> ()
214 .SetGroupName ("Internet")
215 ;
216 return tid;
217 }
218
GetInstanceTypeId() const219 TypeId Ipv6ExtensionHopByHopHeader::GetInstanceTypeId () const
220 {
221 return GetTypeId ();
222 }
223
Ipv6ExtensionHopByHopHeader()224 Ipv6ExtensionHopByHopHeader::Ipv6ExtensionHopByHopHeader ()
225 : OptionField (2)
226 {
227 }
228
~Ipv6ExtensionHopByHopHeader()229 Ipv6ExtensionHopByHopHeader::~Ipv6ExtensionHopByHopHeader ()
230 {
231 }
232
Print(std::ostream & os) const233 void Ipv6ExtensionHopByHopHeader::Print (std::ostream &os) const
234 {
235 os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength () << " )";
236 }
237
GetSerializedSize() const238 uint32_t Ipv6ExtensionHopByHopHeader::GetSerializedSize () const
239 {
240 return 2 + OptionField::GetSerializedSize ();
241 }
242
Serialize(Buffer::Iterator start) const243 void Ipv6ExtensionHopByHopHeader::Serialize (Buffer::Iterator start) const
244 {
245 Buffer::Iterator i = start;
246
247 i.WriteU8 (GetNextHeader ());
248 i.WriteU8 ((GetSerializedSize () >> 3) - 1);
249 OptionField::Serialize (i);
250 }
251
Deserialize(Buffer::Iterator start)252 uint32_t Ipv6ExtensionHopByHopHeader::Deserialize (Buffer::Iterator start)
253 {
254 Buffer::Iterator i = start;
255
256 SetNextHeader (i.ReadU8 ());
257 m_length = i.ReadU8 ();
258 OptionField::Deserialize (i, GetLength () - 2);
259
260 return GetSerializedSize ();
261 }
262
263 NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionDestinationHeader);
264
GetTypeId()265 TypeId Ipv6ExtensionDestinationHeader::GetTypeId ()
266 {
267 static TypeId tid = TypeId ("ns3::Ipv6ExtensionDestinationHeader")
268 .AddConstructor<Ipv6ExtensionDestinationHeader> ()
269 .SetParent<Ipv6ExtensionHeader> ()
270 .SetGroupName ("Internet")
271 ;
272 return tid;
273 }
274
GetInstanceTypeId() const275 TypeId Ipv6ExtensionDestinationHeader::GetInstanceTypeId () const
276 {
277 return GetTypeId ();
278 }
279
Ipv6ExtensionDestinationHeader()280 Ipv6ExtensionDestinationHeader::Ipv6ExtensionDestinationHeader ()
281 : OptionField (2)
282 {
283 }
284
~Ipv6ExtensionDestinationHeader()285 Ipv6ExtensionDestinationHeader::~Ipv6ExtensionDestinationHeader ()
286 {
287 }
288
Print(std::ostream & os) const289 void Ipv6ExtensionDestinationHeader::Print (std::ostream &os) const
290 {
291 os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength () << " )";
292 }
293
GetSerializedSize() const294 uint32_t Ipv6ExtensionDestinationHeader::GetSerializedSize () const
295 {
296 return 2 + OptionField::GetSerializedSize ();
297 }
298
Serialize(Buffer::Iterator start) const299 void Ipv6ExtensionDestinationHeader::Serialize (Buffer::Iterator start) const
300 {
301 Buffer::Iterator i = start;
302
303 i.WriteU8 (GetNextHeader ());
304 i.WriteU8 ((GetSerializedSize () >> 3) - 1);
305 OptionField::Serialize (i);
306 }
307
Deserialize(Buffer::Iterator start)308 uint32_t Ipv6ExtensionDestinationHeader::Deserialize (Buffer::Iterator start)
309 {
310 Buffer::Iterator i = start;
311
312 SetNextHeader (i.ReadU8 ());
313 m_length = i.ReadU8 ();
314 OptionField::Deserialize (i, GetLength () - 2);
315
316 return GetSerializedSize ();
317 }
318
319 NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionFragmentHeader);
320
GetTypeId()321 TypeId Ipv6ExtensionFragmentHeader::GetTypeId ()
322 {
323 static TypeId tid = TypeId ("ns3::Ipv6ExtensionFragmentHeader")
324 .AddConstructor<Ipv6ExtensionFragmentHeader> ()
325 .SetParent<Ipv6ExtensionHeader> ()
326 .SetGroupName ("Internet")
327 ;
328 return tid;
329 }
330
GetInstanceTypeId() const331 TypeId Ipv6ExtensionFragmentHeader::GetInstanceTypeId () const
332 {
333 return GetTypeId ();
334 }
335
Ipv6ExtensionFragmentHeader()336 Ipv6ExtensionFragmentHeader::Ipv6ExtensionFragmentHeader ()
337 : m_offset (0),
338 m_identification (0)
339 {
340 m_length = 0;
341 }
342
~Ipv6ExtensionFragmentHeader()343 Ipv6ExtensionFragmentHeader::~Ipv6ExtensionFragmentHeader ()
344 {
345 }
346
SetOffset(uint16_t offset)347 void Ipv6ExtensionFragmentHeader::SetOffset (uint16_t offset)
348 {
349 // Clear the offset, and save the MF bit
350 m_offset &= 1;
351 m_offset |= offset & (~7);
352 }
353
GetOffset() const354 uint16_t Ipv6ExtensionFragmentHeader::GetOffset () const
355 {
356 return m_offset & (~1);
357 }
358
SetMoreFragment(bool moreFragment)359 void Ipv6ExtensionFragmentHeader::SetMoreFragment (bool moreFragment)
360 {
361 m_offset = moreFragment ? m_offset | 1 : m_offset & (~1);
362 }
363
GetMoreFragment() const364 bool Ipv6ExtensionFragmentHeader::GetMoreFragment () const
365 {
366 return m_offset & 1;
367 }
368
SetIdentification(uint32_t identification)369 void Ipv6ExtensionFragmentHeader::SetIdentification (uint32_t identification)
370 {
371 m_identification = identification;
372 }
373
GetIdentification() const374 uint32_t Ipv6ExtensionFragmentHeader::GetIdentification () const
375 {
376 return m_identification;
377 }
378
Print(std::ostream & os) const379 void Ipv6ExtensionFragmentHeader::Print (std::ostream &os) const
380 {
381 os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength ()
382 << " offset = " << (uint32_t)GetOffset () << " MF = " << (uint32_t)GetMoreFragment () << " identification = " << (uint32_t)m_identification << " )";
383 }
384
GetSerializedSize() const385 uint32_t Ipv6ExtensionFragmentHeader::GetSerializedSize () const
386 {
387 return 8;
388 }
389
Serialize(Buffer::Iterator start) const390 void Ipv6ExtensionFragmentHeader::Serialize (Buffer::Iterator start) const
391 {
392 Buffer::Iterator i = start;
393
394 i.WriteU8 (GetNextHeader ());
395 // Fragment header does not carry an extension length
396 i.WriteU8 (0);
397 i.WriteHtonU16 (m_offset);
398 i.WriteHtonU32 (m_identification);
399 }
400
Deserialize(Buffer::Iterator start)401 uint32_t Ipv6ExtensionFragmentHeader::Deserialize (Buffer::Iterator start)
402 {
403 Buffer::Iterator i = start;
404
405 SetNextHeader (i.ReadU8 ());
406 // Fragment header does not carry an extension length
407 i.ReadU8 ();
408 m_offset = i.ReadNtohU16 ();
409 m_identification = i.ReadNtohU32 ();
410
411 return GetSerializedSize ();
412 }
413
414 NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionRoutingHeader);
415
GetTypeId()416 TypeId Ipv6ExtensionRoutingHeader::GetTypeId ()
417 {
418 static TypeId tid = TypeId ("ns3::Ipv6ExtensionRoutingHeader")
419 .AddConstructor<Ipv6ExtensionRoutingHeader> ()
420 .SetParent<Ipv6ExtensionHeader> ()
421 .SetGroupName ("Internet")
422 ;
423 return tid;
424 }
425
GetInstanceTypeId() const426 TypeId Ipv6ExtensionRoutingHeader::GetInstanceTypeId () const
427 {
428 return GetTypeId ();
429 }
430
Ipv6ExtensionRoutingHeader()431 Ipv6ExtensionRoutingHeader::Ipv6ExtensionRoutingHeader ()
432 : m_typeRouting (0),
433 m_segmentsLeft (0)
434 {
435 }
436
~Ipv6ExtensionRoutingHeader()437 Ipv6ExtensionRoutingHeader::~Ipv6ExtensionRoutingHeader ()
438 {
439 }
440
SetTypeRouting(uint8_t typeRouting)441 void Ipv6ExtensionRoutingHeader::SetTypeRouting (uint8_t typeRouting)
442 {
443 m_typeRouting = typeRouting;
444 }
445
GetTypeRouting() const446 uint8_t Ipv6ExtensionRoutingHeader::GetTypeRouting () const
447 {
448 return m_typeRouting;
449 }
450
SetSegmentsLeft(uint8_t segmentsLeft)451 void Ipv6ExtensionRoutingHeader::SetSegmentsLeft (uint8_t segmentsLeft)
452 {
453 m_segmentsLeft = segmentsLeft;
454 }
455
GetSegmentsLeft() const456 uint8_t Ipv6ExtensionRoutingHeader::GetSegmentsLeft () const
457 {
458 return m_segmentsLeft;
459 }
460
Print(std::ostream & os) const461 void Ipv6ExtensionRoutingHeader::Print (std::ostream &os) const
462 {
463 os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength ()
464 << " typeRouting = " << (uint32_t)m_typeRouting << " segmentsLeft = " << (uint32_t)m_segmentsLeft << " )";
465 }
466
GetSerializedSize() const467 uint32_t Ipv6ExtensionRoutingHeader::GetSerializedSize () const
468 {
469 return 4;
470 }
471
Serialize(Buffer::Iterator start) const472 void Ipv6ExtensionRoutingHeader::Serialize (Buffer::Iterator start) const
473 {
474 Buffer::Iterator i = start;
475
476 i.WriteU8 (GetNextHeader ());
477 i.WriteU8 (m_length);
478 i.WriteU8 (m_typeRouting);
479 i.WriteU8 (m_segmentsLeft);
480 }
481
Deserialize(Buffer::Iterator start)482 uint32_t Ipv6ExtensionRoutingHeader::Deserialize (Buffer::Iterator start)
483 {
484 Buffer::Iterator i = start;
485
486 SetNextHeader (i.ReadU8 ());
487 m_length = i.ReadU8 ();
488 m_typeRouting = i.ReadU8 ();
489 m_segmentsLeft = i.ReadU8 ();
490
491 return GetSerializedSize ();
492 }
493
494 NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionLooseRoutingHeader);
495
GetTypeId()496 TypeId Ipv6ExtensionLooseRoutingHeader::GetTypeId ()
497 {
498 static TypeId tid = TypeId ("ns3::Ipv6ExtensionLooseRoutingHeader")
499 .AddConstructor<Ipv6ExtensionLooseRoutingHeader> ()
500 .SetParent<Ipv6ExtensionRoutingHeader> ()
501 .SetGroupName ("Internet")
502 ;
503 return tid;
504 }
505
GetInstanceTypeId() const506 TypeId Ipv6ExtensionLooseRoutingHeader::GetInstanceTypeId () const
507 {
508 return GetTypeId ();
509 }
510
Ipv6ExtensionLooseRoutingHeader()511 Ipv6ExtensionLooseRoutingHeader::Ipv6ExtensionLooseRoutingHeader ()
512 : m_routersAddress (0)
513 {
514 }
515
~Ipv6ExtensionLooseRoutingHeader()516 Ipv6ExtensionLooseRoutingHeader::~Ipv6ExtensionLooseRoutingHeader ()
517 {
518 }
519
SetNumberAddress(uint8_t n)520 void Ipv6ExtensionLooseRoutingHeader::SetNumberAddress (uint8_t n)
521 {
522 m_routersAddress.clear ();
523 m_routersAddress.assign (n, Ipv6Address (""));
524 }
525
SetRoutersAddress(std::vector<Ipv6Address> routersAddress)526 void Ipv6ExtensionLooseRoutingHeader::SetRoutersAddress (std::vector<Ipv6Address> routersAddress)
527 {
528 m_routersAddress = routersAddress;
529 }
530
GetRoutersAddress() const531 std::vector<Ipv6Address> Ipv6ExtensionLooseRoutingHeader::GetRoutersAddress () const
532 {
533 return m_routersAddress;
534 }
535
SetRouterAddress(uint8_t index,Ipv6Address addr)536 void Ipv6ExtensionLooseRoutingHeader::SetRouterAddress (uint8_t index, Ipv6Address addr)
537 {
538 m_routersAddress.at (index) = addr;
539 }
540
GetRouterAddress(uint8_t index) const541 Ipv6Address Ipv6ExtensionLooseRoutingHeader::GetRouterAddress (uint8_t index) const
542 {
543 return m_routersAddress.at (index);
544 }
545
Print(std::ostream & os) const546 void Ipv6ExtensionLooseRoutingHeader::Print (std::ostream &os) const
547 {
548 os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength ()
549 << " typeRouting = " << (uint32_t)GetTypeRouting () << " segmentsLeft = " << (uint32_t)GetSegmentsLeft () << " ";
550
551 for (std::vector<Ipv6Address>::const_iterator it = m_routersAddress.begin (); it != m_routersAddress.end (); it++)
552 {
553 os << *it << " ";
554 }
555
556 os << " )";
557 }
558
GetSerializedSize() const559 uint32_t Ipv6ExtensionLooseRoutingHeader::GetSerializedSize () const
560 {
561 return 8 + m_routersAddress.size () * 16;
562 }
563
Serialize(Buffer::Iterator start) const564 void Ipv6ExtensionLooseRoutingHeader::Serialize (Buffer::Iterator start) const
565 {
566 Buffer::Iterator i = start;
567 uint8_t buff[16];
568
569 uint8_t addressNum = m_routersAddress.size ();
570
571 i.WriteU8 (GetNextHeader ());
572 i.WriteU8 (addressNum*2);
573 i.WriteU8 (GetTypeRouting ());
574 i.WriteU8 (GetSegmentsLeft ());
575 i.WriteU32 (0);
576
577 for (VectorIpv6Address_t::const_iterator it = m_routersAddress.begin (); it != m_routersAddress.end (); it++)
578 {
579 it->Serialize (buff);
580 i.Write (buff, 16);
581 }
582 }
583
Deserialize(Buffer::Iterator start)584 uint32_t Ipv6ExtensionLooseRoutingHeader::Deserialize (Buffer::Iterator start)
585 {
586 Buffer::Iterator i = start;
587 uint8_t buff[16];
588
589 SetNextHeader (i.ReadU8 ());
590 m_length = i.ReadU8 ();
591 SetTypeRouting (i.ReadU8 ());
592 SetSegmentsLeft (i.ReadU8 ());
593 i.ReadU32 ();
594
595 uint8_t addressNum = m_length / 2;
596 SetNumberAddress (addressNum);
597 for (uint8_t index = 0; index < addressNum; index++)
598 {
599 i.Read (buff, 16);
600 SetRouterAddress (index, Ipv6Address (buff));
601 }
602
603 return GetSerializedSize ();
604 }
605
606 NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionESPHeader);
607
GetTypeId()608 TypeId Ipv6ExtensionESPHeader::GetTypeId ()
609 {
610 static TypeId tid = TypeId ("ns3::Ipv6ExtensionESPHeader")
611 .AddConstructor<Ipv6ExtensionESPHeader> ()
612 .SetParent<Ipv6ExtensionHeader> ()
613 .SetGroupName ("Internet")
614 ;
615 return tid;
616 }
617
GetInstanceTypeId() const618 TypeId Ipv6ExtensionESPHeader::GetInstanceTypeId () const
619 {
620 return GetTypeId ();
621 }
622
Ipv6ExtensionESPHeader()623 Ipv6ExtensionESPHeader::Ipv6ExtensionESPHeader ()
624 {
625 }
626
~Ipv6ExtensionESPHeader()627 Ipv6ExtensionESPHeader::~Ipv6ExtensionESPHeader ()
628 {
629 }
630
Print(std::ostream & os) const631 void Ipv6ExtensionESPHeader::Print (std::ostream &os) const
632 {
633 /** \todo */
634 }
635
GetSerializedSize() const636 uint32_t Ipv6ExtensionESPHeader::GetSerializedSize () const
637 {
638 /** \todo */
639 return 0;
640 }
641
Serialize(Buffer::Iterator start) const642 void Ipv6ExtensionESPHeader::Serialize (Buffer::Iterator start) const
643 {
644 /** \todo */
645 }
646
Deserialize(Buffer::Iterator start)647 uint32_t Ipv6ExtensionESPHeader::Deserialize (Buffer::Iterator start)
648 {
649 /** \todo */
650 return 0;
651 }
652
653 NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionAHHeader);
654
GetTypeId()655 TypeId Ipv6ExtensionAHHeader::GetTypeId ()
656 {
657 static TypeId tid = TypeId ("ns3::Ipv6ExtensionAHHeader")
658 .AddConstructor<Ipv6ExtensionAHHeader> ()
659 .SetParent<Ipv6ExtensionHeader> ()
660 .SetGroupName ("Internet")
661 ;
662 return tid;
663 }
664
GetInstanceTypeId() const665 TypeId Ipv6ExtensionAHHeader::GetInstanceTypeId () const
666 {
667 return GetTypeId ();
668 }
669
Ipv6ExtensionAHHeader()670 Ipv6ExtensionAHHeader::Ipv6ExtensionAHHeader ()
671 {
672 }
673
~Ipv6ExtensionAHHeader()674 Ipv6ExtensionAHHeader::~Ipv6ExtensionAHHeader ()
675 {
676 }
677
Print(std::ostream & os) const678 void Ipv6ExtensionAHHeader::Print (std::ostream &os) const
679 {
680 /** \todo */
681 }
682
GetSerializedSize() const683 uint32_t Ipv6ExtensionAHHeader::GetSerializedSize () const
684 {
685 /** \todo */
686 return 0;
687 }
688
Serialize(Buffer::Iterator start) const689 void Ipv6ExtensionAHHeader::Serialize (Buffer::Iterator start) const
690 {
691 /** \todo */
692 }
693
Deserialize(Buffer::Iterator start)694 uint32_t Ipv6ExtensionAHHeader::Deserialize (Buffer::Iterator start)
695 {
696 /** \todo */
697 return 0;
698 }
699
700 } /* namespace ns3 */
701
702