author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Thu, 14 Nov 2013 16:58:28 -0800 | |
changeset 10410 | 4d4eb8097fa3 |
parent 9910 | e9807cf4a7a5 |
child 10515 | 8238217cb0c3 |
permissions | -rwxr-xr-x |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7367
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
2 |
/* |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2007-2009 Strasbourg University |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
4 |
* |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
8 |
* |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
13 |
* |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
17 |
* |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
18 |
* Author: David Gross <gdavid.devel@gmail.com> |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
19 |
*/ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
20 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
21 |
#include <list> |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
22 |
#include <ctime> |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
23 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
24 |
#include "ns3/log.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
25 |
#include "ns3/assert.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
26 |
#include "ns3/uinteger.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
27 |
#include "ns3/object-vector.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
28 |
#include "ns3/ipv6-address.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
29 |
#include "ns3/ipv6-header.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
30 |
#include "ns3/ipv6-l3-protocol.h" |
5793
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
31 |
#include "ns3/ipv6-static-routing.h" |
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
32 |
#include "ns3/ipv6-list-routing.h" |
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
33 |
#include "ns3/ipv6-route.h" |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
34 |
#include "ns3/trace-source-accessor.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
35 |
#include "icmpv6-l4-protocol.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
36 |
#include "ipv6-extension-demux.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
37 |
#include "ipv6-extension.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
38 |
#include "ipv6-extension-header.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
39 |
#include "ipv6-option-demux.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
40 |
#include "ipv6-option.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
41 |
#include "udp-header.h" |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
42 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
43 |
NS_LOG_COMPONENT_DEFINE ("Ipv6Extension"); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
44 |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
45 |
namespace ns3 { |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
46 |
|
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
47 |
NS_OBJECT_ENSURE_REGISTERED (Ipv6Extension) |
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
48 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
49 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
50 |
TypeId Ipv6Extension::GetTypeId () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
51 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
52 |
static TypeId tid = TypeId ("ns3::Ipv6Extension") |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
53 |
.SetParent<Object> () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
54 |
.AddAttribute ("ExtensionNumber", "The IPv6 extension number.", |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
55 |
UintegerValue (0), |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
56 |
MakeUintegerAccessor (&Ipv6Extension::GetExtensionNumber), |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
57 |
MakeUintegerChecker<uint8_t> ()) |
9910
e9807cf4a7a5
IPv6 manual
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9870
diff
changeset
|
58 |
.AddTraceSource ("Drop", "Drop IPv6 packet", |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
59 |
MakeTraceSourceAccessor (&Ipv6Extension::m_dropTrace)) |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
60 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
61 |
return tid; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
62 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
63 |
|
8977
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
64 |
Ipv6Extension::Ipv6Extension () |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
65 |
{ |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
66 |
NS_LOG_FUNCTION_NOARGS (); |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
67 |
|
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
68 |
m_uvar = CreateObject<UniformRandomVariable> (); |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
69 |
} |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
70 |
|
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
71 |
Ipv6Extension::~Ipv6Extension () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
72 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
73 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
74 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
75 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
76 |
void Ipv6Extension::SetNode (Ptr<Node> node) |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
77 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
78 |
NS_LOG_FUNCTION (this << node); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
79 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
80 |
m_node = node; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
81 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
82 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
83 |
Ptr<Node> Ipv6Extension::GetNode () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
84 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
85 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
86 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
87 |
return m_node; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
88 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
89 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
90 |
uint8_t Ipv6Extension::ProcessOptions (Ptr<Packet>& packet, uint8_t offset, uint8_t length, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool& isDropped) |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
91 |
{ |
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
92 |
NS_LOG_FUNCTION (this << packet << offset << length << ipv6Header << dst << nextHeader << isDropped); |
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
93 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
94 |
// For ICMPv6 Error packets |
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
95 |
Ptr<Packet> malformedPacket = packet->Copy (); |
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
96 |
malformedPacket->AddHeader (ipv6Header); |
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
97 |
Ptr<Icmpv6L4Protocol> icmpv6 = GetNode ()->GetObject<Ipv6L3Protocol> ()->GetIcmpv6 (); |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
98 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
99 |
Ptr<Packet> p = packet->Copy (); |
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
100 |
p->RemoveAtStart (offset); |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
101 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
102 |
Ptr<Ipv6OptionDemux> ipv6OptionDemux = GetNode ()->GetObject<Ipv6OptionDemux> (); |
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
103 |
Ptr<Ipv6Option> ipv6Option; |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
104 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
105 |
uint8_t processedSize = 0; |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
106 |
uint32_t size = p->GetSize (); |
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
107 |
uint8_t *data = new uint8_t[size]; |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
108 |
p->CopyData (data, size); |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
109 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
110 |
uint8_t optionType = 0; |
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
111 |
uint8_t optionLength = 0; |
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
112 |
|
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
113 |
while (length > processedSize && !isDropped) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
114 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
115 |
optionType = *(data + processedSize); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
116 |
ipv6Option = ipv6OptionDemux->GetOption (optionType); |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
117 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
118 |
if (ipv6Option == 0) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
119 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
120 |
optionType >>= 6; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
121 |
switch (optionType) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
122 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
123 |
case 0: |
5862
8f126818f691
Bug 770: IPv6 size calculation for unknown options is wrong.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5810
diff
changeset
|
124 |
optionLength = *(data + processedSize + 1) + 2; |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
125 |
break; |
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
126 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
127 |
case 1: |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
128 |
NS_LOG_LOGIC ("Unknown Option. Drop!"); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
129 |
m_dropTrace (packet); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
130 |
optionLength = 0; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
131 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
132 |
break; |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
133 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
134 |
case 2: |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
135 |
NS_LOG_LOGIC ("Unknown Option. Drop!"); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
136 |
icmpv6->SendErrorParameterError (malformedPacket, ipv6Header.GetSourceAddress (), Icmpv6Header::ICMPV6_UNKNOWN_OPTION, offset + processedSize); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
137 |
m_dropTrace (packet); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
138 |
optionLength = 0; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
139 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
140 |
break; |
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
141 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
142 |
case 3: |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
143 |
NS_LOG_LOGIC ("Unknown Option. Drop!"); |
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
144 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
145 |
if (!ipv6Header.GetDestinationAddress ().IsMulticast ()) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
146 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
147 |
icmpv6->SendErrorParameterError (malformedPacket, ipv6Header.GetSourceAddress (), Icmpv6Header::ICMPV6_UNKNOWN_OPTION, offset + processedSize); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
148 |
m_dropTrace (packet); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
149 |
optionLength = 0; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
150 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
151 |
break; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
152 |
} |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
153 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
154 |
m_dropTrace (packet); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
155 |
optionLength = 0; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
156 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
157 |
break; |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
158 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
159 |
default: |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
160 |
break; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
161 |
} |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
162 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
163 |
} |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
164 |
else |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
165 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
166 |
optionLength = ipv6Option->Process (packet, offset + processedSize, ipv6Header, isDropped); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
167 |
} |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
168 |
|
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
169 |
processedSize += optionLength; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
170 |
p->RemoveAtStart (optionLength); |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
171 |
} |
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
172 |
|
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
173 |
delete [] data; |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
174 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
175 |
return processedSize; |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
176 |
} |
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
177 |
|
8977
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
178 |
int64_t |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
179 |
Ipv6Extension::AssignStreams (int64_t stream) |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
180 |
{ |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
181 |
NS_LOG_FUNCTION (this << stream); |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
182 |
m_uvar->SetStream (stream); |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
183 |
return 1; |
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
184 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
185 |
|
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
186 |
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionHopByHop) |
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
187 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
188 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
189 |
TypeId Ipv6ExtensionHopByHop::GetTypeId () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
190 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
191 |
static TypeId tid = TypeId ("ns3::Ipv6ExtensionHopByHop") |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
192 |
.SetParent<Ipv6Extension> () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
193 |
.AddConstructor<Ipv6ExtensionHopByHop> () |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
194 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
195 |
return tid; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
196 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
197 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
198 |
Ipv6ExtensionHopByHop::Ipv6ExtensionHopByHop () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
199 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
200 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
201 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
202 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
203 |
Ipv6ExtensionHopByHop::~Ipv6ExtensionHopByHop () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
204 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
205 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
206 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
207 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
208 |
uint8_t Ipv6ExtensionHopByHop::GetExtensionNumber () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
209 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
210 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
211 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
212 |
return EXT_NUMBER; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
213 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
214 |
|
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
215 |
uint8_t Ipv6ExtensionHopByHop::Process (Ptr<Packet>& packet, uint8_t offset, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool& isDropped) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
216 |
{ |
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
217 |
NS_LOG_FUNCTION (this << packet << offset << ipv6Header << dst << nextHeader << isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
218 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
219 |
Ptr<Packet> p = packet->Copy (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
220 |
p->RemoveAtStart (offset); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
221 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
222 |
Ipv6ExtensionHopByHopHeader hopbyhopHeader; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
223 |
p->RemoveHeader (hopbyhopHeader); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
224 |
if (nextHeader) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
225 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
226 |
*nextHeader = hopbyhopHeader.GetNextHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
227 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
228 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
229 |
uint8_t processedSize = hopbyhopHeader.GetOptionsOffset (); |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
230 |
offset += processedSize; |
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
231 |
uint8_t length = hopbyhopHeader.GetLength () - hopbyhopHeader.GetOptionsOffset (); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
232 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
233 |
processedSize += ProcessOptions (packet, offset, length, ipv6Header, dst, nextHeader, isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
234 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
235 |
return processedSize; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
236 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
237 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
238 |
|
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
239 |
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionDestination) |
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
240 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
241 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
242 |
TypeId Ipv6ExtensionDestination::GetTypeId () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
243 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
244 |
static TypeId tid = TypeId ("ns3::Ipv6ExtensionDestination") |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
245 |
.SetParent<Ipv6Extension> () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
246 |
.AddConstructor<Ipv6ExtensionDestination> () |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
247 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
248 |
return tid; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
249 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
250 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
251 |
Ipv6ExtensionDestination::Ipv6ExtensionDestination () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
252 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
253 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
254 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
255 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
256 |
Ipv6ExtensionDestination::~Ipv6ExtensionDestination () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
257 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
258 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
259 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
260 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
261 |
uint8_t Ipv6ExtensionDestination::GetExtensionNumber () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
262 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
263 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
264 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
265 |
return EXT_NUMBER; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
266 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
267 |
|
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
268 |
uint8_t Ipv6ExtensionDestination::Process (Ptr<Packet>& packet, uint8_t offset, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool& isDropped) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
269 |
{ |
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
270 |
NS_LOG_FUNCTION (this << packet << offset << ipv6Header << dst << nextHeader << isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
271 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
272 |
Ptr<Packet> p = packet->Copy (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
273 |
p->RemoveAtStart (offset); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
274 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
275 |
Ipv6ExtensionDestinationHeader destinationHeader; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
276 |
p->RemoveHeader (destinationHeader); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
277 |
if (nextHeader) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
278 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
279 |
*nextHeader = destinationHeader.GetNextHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
280 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
281 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
282 |
uint8_t processedSize = destinationHeader.GetOptionsOffset (); |
5801
86b47c42316c
Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents:
5793
diff
changeset
|
283 |
offset += processedSize; |
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
284 |
uint8_t length = destinationHeader.GetLength () - destinationHeader.GetOptionsOffset (); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
285 |
|
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
286 |
processedSize += ProcessOptions (packet, offset, length, ipv6Header, dst, nextHeader, isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
287 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
288 |
return processedSize; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
289 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
290 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
291 |
|
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
292 |
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionFragment) |
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
293 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
294 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
295 |
TypeId Ipv6ExtensionFragment::GetTypeId () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
296 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
297 |
static TypeId tid = TypeId ("ns3::Ipv6ExtensionFragment") |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
298 |
.SetParent<Ipv6Extension> () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
299 |
.AddConstructor<Ipv6ExtensionFragment> () |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
300 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
301 |
return tid; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
302 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
303 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
304 |
Ipv6ExtensionFragment::Ipv6ExtensionFragment () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
305 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
306 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
307 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
308 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
309 |
Ipv6ExtensionFragment::~Ipv6ExtensionFragment () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
310 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
311 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
312 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
313 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
314 |
void Ipv6ExtensionFragment::DoDispose () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
315 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
316 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
317 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
318 |
for (MapFragments_t::iterator it = m_fragments.begin (); it != m_fragments.end (); it++) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
319 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
320 |
it->second = 0; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
321 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
322 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
323 |
m_fragments.clear (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
324 |
Ipv6Extension::DoDispose (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
325 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
326 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
327 |
uint8_t Ipv6ExtensionFragment::GetExtensionNumber () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
328 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
329 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
330 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
331 |
return EXT_NUMBER; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
332 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
333 |
|
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
334 |
uint8_t Ipv6ExtensionFragment::Process (Ptr<Packet>& packet, uint8_t offset, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool& isDropped) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
335 |
{ |
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
336 |
NS_LOG_FUNCTION (this << packet << offset << ipv6Header << dst << nextHeader << isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
337 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
338 |
Ptr<Packet> p = packet->Copy (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
339 |
p->RemoveAtStart (offset); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
340 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
341 |
Ipv6ExtensionFragmentHeader fragmentHeader; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
342 |
p->RemoveHeader (fragmentHeader); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
343 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
344 |
if (nextHeader) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
345 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
346 |
*nextHeader = fragmentHeader.GetNextHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
347 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
348 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
349 |
bool moreFragment = fragmentHeader.GetMoreFragment (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
350 |
uint16_t fragmentOffset = fragmentHeader.GetOffset (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
351 |
uint32_t identification = fragmentHeader.GetIdentification (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
352 |
Ipv6Address src = ipv6Header.GetSourceAddress (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
353 |
|
9813
16f65595bdf8
imported patch make_pair.patch
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9784
diff
changeset
|
354 |
std::pair<Ipv6Address, uint32_t> fragmentsId = std::pair<Ipv6Address, uint32_t> (src, identification); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
355 |
Ptr<Fragments> fragments; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
356 |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
357 |
Ipv6Header ipHeader = ipv6Header; |
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
358 |
ipHeader.SetNextHeader (fragmentHeader.GetNextHeader ()); |
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
359 |
|
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
360 |
MapFragments_t::iterator it = m_fragments.find (fragmentsId); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
361 |
if (it == m_fragments.end ()) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
362 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
363 |
fragments = Create<Fragments> (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
364 |
m_fragments.insert (std::make_pair (fragmentsId, fragments)); |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
365 |
EventId timeout = Simulator::Schedule (Seconds (60), |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
366 |
&Ipv6ExtensionFragment::HandleFragmentsTimeout, this, |
8793
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
367 |
fragmentsId, ipHeader); |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
368 |
fragments->SetTimeoutEventId (timeout); |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
369 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
370 |
else |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
371 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
372 |
fragments = it->second; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
373 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
374 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
375 |
if (fragmentOffset == 0) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
376 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
377 |
Ptr<Packet> unfragmentablePart = packet->Copy (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
378 |
unfragmentablePart->RemoveAtEnd (packet->GetSize () - offset); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
379 |
fragments->SetUnfragmentablePart (unfragmentablePart); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
380 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
381 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
382 |
fragments->AddFragment (p, fragmentOffset, moreFragment); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
383 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
384 |
if (fragments->IsEntire ()) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
385 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
386 |
packet = fragments->GetPacket (); |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
387 |
fragments->CancelTimeout (); |
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
388 |
m_fragments.erase (fragmentsId); |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
389 |
isDropped = false; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
390 |
} |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
391 |
else |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
392 |
{ |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
393 |
// the fragment is not "dropped", but Ipv6L3Protocol::LocalDeliver must stop processing it. |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
394 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
395 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
396 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
397 |
return 0; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
398 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
399 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
400 |
void Ipv6ExtensionFragment::GetFragments (Ptr<Packet> packet, uint32_t maxFragmentSize, std::list<Ptr<Packet> >& listFragments) |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
401 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
402 |
Ptr<Packet> p = packet->Copy (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
403 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
404 |
Ipv6Header ipv6Header; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
405 |
p->RemoveHeader (ipv6Header); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
406 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
407 |
uint8_t nextHeader = ipv6Header.GetNextHeader (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
408 |
uint8_t ipv6HeaderSize = ipv6Header.GetSerializedSize (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
409 |
|
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
410 |
uint8_t type; |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
411 |
p->CopyData (&type, sizeof(type)); |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
412 |
|
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
413 |
bool moreHeader = true; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
414 |
if (!(nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP || nextHeader == Ipv6Header::IPV6_EXT_ROUTING |
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
415 |
|| (nextHeader == Ipv6Header::IPV6_EXT_DESTINATION && type == Ipv6Header::IPV6_EXT_ROUTING))) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
416 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
417 |
moreHeader = false; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
418 |
ipv6Header.SetNextHeader (Ipv6Header::IPV6_EXT_FRAGMENTATION); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
419 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
420 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
421 |
std::list<std::pair<Ipv6ExtensionHeader *, uint8_t> > unfragmentablePart; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
422 |
uint32_t unfragmentablePartSize = 0; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
423 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
424 |
Ptr<Ipv6ExtensionDemux> extensionDemux = GetNode ()->GetObject<Ipv6ExtensionDemux> (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
425 |
Ptr<Ipv6Extension> extension = extensionDemux->GetExtension (nextHeader); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
426 |
uint8_t extensionHeaderLength; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
427 |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
428 |
while (moreHeader) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
429 |
{ |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
430 |
if (nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
431 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
432 |
Ipv6ExtensionHopByHopHeader *hopbyhopHeader = new Ipv6ExtensionHopByHopHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
433 |
p->RemoveHeader (*hopbyhopHeader); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
434 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
435 |
nextHeader = hopbyhopHeader->GetNextHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
436 |
extensionHeaderLength = hopbyhopHeader->GetLength (); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
437 |
|
6552 | 438 |
uint8_t type; |
439 |
p->CopyData (&type, sizeof(type)); |
|
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
440 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
441 |
if (!(nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP || nextHeader == Ipv6Header::IPV6_EXT_ROUTING |
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
442 |
|| (nextHeader == Ipv6Header::IPV6_EXT_DESTINATION && type == Ipv6Header::IPV6_EXT_ROUTING))) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
443 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
444 |
moreHeader = false; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
445 |
hopbyhopHeader->SetNextHeader (Ipv6Header::IPV6_EXT_FRAGMENTATION); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
446 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
447 |
|
9813
16f65595bdf8
imported patch make_pair.patch
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9784
diff
changeset
|
448 |
unfragmentablePart.push_back (std::pair<Ipv6ExtensionHeader *, uint8_t> (hopbyhopHeader, Ipv6Header::IPV6_EXT_HOP_BY_HOP)); |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
449 |
unfragmentablePartSize += extensionHeaderLength; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
450 |
} |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
451 |
else if (nextHeader == Ipv6Header::IPV6_EXT_ROUTING) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
452 |
{ |
6552 | 453 |
uint8_t buf[2]; |
454 |
p->CopyData (buf, sizeof(buf)); |
|
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
455 |
uint8_t numberAddress = buf[1] / 2; |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
456 |
Ipv6ExtensionLooseRoutingHeader *routingHeader = new Ipv6ExtensionLooseRoutingHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
457 |
routingHeader->SetNumberAddress (numberAddress); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
458 |
p->RemoveHeader (*routingHeader); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
459 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
460 |
nextHeader = routingHeader->GetNextHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
461 |
extensionHeaderLength = routingHeader->GetLength (); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
462 |
|
6552 | 463 |
uint8_t type; |
464 |
p->CopyData (&type, sizeof(type)); |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
465 |
if (!(nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP || nextHeader == Ipv6Header::IPV6_EXT_ROUTING |
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
466 |
|| (nextHeader == Ipv6Header::IPV6_EXT_DESTINATION && type == Ipv6Header::IPV6_EXT_ROUTING))) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
467 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
468 |
moreHeader = false; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
469 |
routingHeader->SetNextHeader (Ipv6Header::IPV6_EXT_FRAGMENTATION); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
470 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
471 |
|
9813
16f65595bdf8
imported patch make_pair.patch
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9784
diff
changeset
|
472 |
unfragmentablePart.push_back (std::pair<Ipv6ExtensionHeader *, uint8_t> (routingHeader, Ipv6Header::IPV6_EXT_ROUTING)); |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
473 |
unfragmentablePartSize += extensionHeaderLength; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
474 |
} |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
475 |
else if (nextHeader == Ipv6Header::IPV6_EXT_DESTINATION) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
476 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
477 |
Ipv6ExtensionDestinationHeader *destinationHeader = new Ipv6ExtensionDestinationHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
478 |
p->RemoveHeader (*destinationHeader); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
479 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
480 |
nextHeader = destinationHeader->GetNextHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
481 |
extensionHeaderLength = destinationHeader->GetLength (); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
482 |
|
6552 | 483 |
uint8_t type; |
484 |
p->CopyData (&type, sizeof(type)); |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
485 |
if (!(nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP || nextHeader == Ipv6Header::IPV6_EXT_ROUTING |
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
486 |
|| (nextHeader == Ipv6Header::IPV6_EXT_DESTINATION && type == Ipv6Header::IPV6_EXT_ROUTING))) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
487 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
488 |
moreHeader = false; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
489 |
destinationHeader->SetNextHeader (Ipv6Header::IPV6_EXT_FRAGMENTATION); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
490 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
491 |
|
9813
16f65595bdf8
imported patch make_pair.patch
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9784
diff
changeset
|
492 |
unfragmentablePart.push_back (std::pair<Ipv6ExtensionHeader *, uint8_t> (destinationHeader, Ipv6Header::IPV6_EXT_DESTINATION)); |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
493 |
unfragmentablePartSize += extensionHeaderLength; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
494 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
495 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
496 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
497 |
Ipv6ExtensionFragmentHeader fragmentHeader; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
498 |
uint8_t fragmentHeaderSize = fragmentHeader.GetSerializedSize (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
499 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
500 |
uint32_t maxFragmentablePartSize = maxFragmentSize - ipv6HeaderSize - unfragmentablePartSize - fragmentHeaderSize; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
501 |
uint32_t currentFragmentablePartSize = 0; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
502 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
503 |
bool moreFragment = true; |
8977
2bd04c7f5010
Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
8793
diff
changeset
|
504 |
uint32_t identification = (uint32_t) m_uvar->GetValue (0, (uint32_t)-1); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
505 |
uint16_t offset = 0; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
506 |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
507 |
do |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
508 |
{ |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
509 |
if (p->GetSize () > offset + maxFragmentablePartSize) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
510 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
511 |
moreFragment = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
512 |
currentFragmentablePartSize = maxFragmentablePartSize; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
513 |
} |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
514 |
else |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
515 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
516 |
moreFragment = false; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
517 |
currentFragmentablePartSize = p->GetSize () - offset; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
518 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
519 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
520 |
currentFragmentablePartSize -= currentFragmentablePartSize % 8; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
521 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
522 |
fragmentHeader.SetNextHeader (nextHeader); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
523 |
fragmentHeader.SetLength (currentFragmentablePartSize); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
524 |
fragmentHeader.SetOffset (offset); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
525 |
fragmentHeader.SetMoreFragment (moreFragment); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
526 |
fragmentHeader.SetIdentification (identification); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
527 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
528 |
Ptr<Packet> fragment = p->CreateFragment (offset, currentFragmentablePartSize); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
529 |
offset += currentFragmentablePartSize; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
530 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
531 |
fragment->AddHeader (fragmentHeader); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
532 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
533 |
for (std::list<std::pair<Ipv6ExtensionHeader *, uint8_t> >::iterator it = unfragmentablePart.begin (); it != unfragmentablePart.end (); it++) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
534 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
535 |
if (it->second == Ipv6Header::IPV6_EXT_HOP_BY_HOP) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
536 |
{ |
9784
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
537 |
Ipv6ExtensionHopByHopHeader * p = |
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
538 |
dynamic_cast<Ipv6ExtensionHopByHopHeader *> (it->first); |
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
539 |
NS_ASSERT (p != 0); |
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
540 |
fragment->AddHeader (*p); |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
541 |
} |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
542 |
else if (it->second == Ipv6Header::IPV6_EXT_ROUTING) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
543 |
{ |
9784
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
544 |
Ipv6ExtensionLooseRoutingHeader * p = |
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
545 |
dynamic_cast<Ipv6ExtensionLooseRoutingHeader *> (it->first); |
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
546 |
NS_ASSERT (p != 0); |
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
547 |
fragment->AddHeader (*p); |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
548 |
} |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
549 |
else if (it->second == Ipv6Header::IPV6_EXT_DESTINATION) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
550 |
{ |
9784
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
551 |
Ipv6ExtensionDestinationHeader * p = |
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
552 |
dynamic_cast<Ipv6ExtensionDestinationHeader *> (it->first); |
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
553 |
NS_ASSERT (p != 0); |
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8977
diff
changeset
|
554 |
fragment->AddHeader (*p); |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
555 |
} |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
556 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
557 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
558 |
ipv6Header.SetPayloadLength (fragment->GetSize ()); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
559 |
fragment->AddHeader (ipv6Header); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
560 |
|
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
561 |
std::ostringstream oss; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
562 |
fragment->Print (oss); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
563 |
listFragments.push_back (fragment); |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
564 |
} |
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
565 |
while (moreFragment); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
566 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
567 |
for (std::list<std::pair<Ipv6ExtensionHeader *, uint8_t> >::iterator it = unfragmentablePart.begin (); it != unfragmentablePart.end (); it++) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
568 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
569 |
delete it->first; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
570 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
571 |
|
5790
4917b74101f0
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5789
diff
changeset
|
572 |
unfragmentablePart.clear (); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
573 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
574 |
|
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
575 |
|
8793
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
576 |
void Ipv6ExtensionFragment::HandleFragmentsTimeout (std::pair<Ipv6Address, uint32_t> fragmentsId, |
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
577 |
Ipv6Header & ipHeader) |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
578 |
{ |
8793
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
579 |
Ptr<Fragments> fragments; |
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
580 |
|
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
581 |
MapFragments_t::iterator it = m_fragments.find (fragmentsId); |
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
582 |
NS_ASSERT_MSG(it != m_fragments.end (), "IPv6 Fragment timeout reached for non-existent fragment"); |
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
583 |
fragments = it->second; |
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
584 |
|
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
585 |
Ptr<Packet> packet = fragments->GetPartialPacket (); |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
586 |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
587 |
packet->AddHeader (ipHeader); |
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
588 |
|
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
589 |
// if we have at least 8 bytes, we can send an ICMP. |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
590 |
if ( packet->GetSize () > 8 ) |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
591 |
{ |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
592 |
Ptr<Icmpv6L4Protocol> icmp = GetNode ()->GetObject<Icmpv6L4Protocol> (); |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
593 |
icmp->SendErrorTimeExceeded (packet, ipHeader.GetSourceAddress (), Icmpv6Header::ICMPV6_FRAGTIME); |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
594 |
} |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
595 |
m_dropTrace (packet); |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
596 |
|
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
597 |
// clear the buffers |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
598 |
m_fragments.erase (fragmentsId); |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
599 |
} |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
600 |
|
5805
db141a163ef3
Merge with ns-3-dev and fix doxygen.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5802
diff
changeset
|
601 |
Ipv6ExtensionFragment::Fragments::Fragments () |
5891
09a575cdf8db
Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5862
diff
changeset
|
602 |
: m_moreFragment (0) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
603 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
604 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
605 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
606 |
Ipv6ExtensionFragment::Fragments::~Fragments () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
607 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
608 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
609 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
610 |
void Ipv6ExtensionFragment::Fragments::AddFragment (Ptr<Packet> fragment, uint16_t fragmentOffset, bool moreFragment) |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
611 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
612 |
std::list<std::pair<Ptr<Packet>, uint16_t> >::iterator it; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
613 |
|
8793
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
614 |
for (it = m_packetFragments.begin (); it != m_packetFragments.end (); it++) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
615 |
{ |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
616 |
if (it->second > fragmentOffset) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
617 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
618 |
break; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
619 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
620 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
621 |
|
8793
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
622 |
if (it == m_packetFragments.end ()) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
623 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
624 |
m_moreFragment = moreFragment; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
625 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
626 |
|
9813
16f65595bdf8
imported patch make_pair.patch
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
9784
diff
changeset
|
627 |
m_packetFragments.insert (it, std::pair<Ptr<Packet>, uint16_t> (fragment, fragmentOffset)); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
628 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
629 |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
630 |
void Ipv6ExtensionFragment::Fragments::SetUnfragmentablePart (Ptr<Packet> unfragmentablePart) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
631 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
632 |
m_unfragmentable = unfragmentablePart; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
633 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
634 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
635 |
bool Ipv6ExtensionFragment::Fragments::IsEntire () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
636 |
{ |
8793
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
637 |
bool ret = !m_moreFragment && m_packetFragments.size () > 0; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
638 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
639 |
if (ret) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
640 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
641 |
uint16_t lastEndOffset = 0; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
642 |
|
8793
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
643 |
for (std::list<std::pair<Ptr<Packet>, uint16_t> >::const_iterator it = m_packetFragments.begin (); it != m_packetFragments.end (); it++) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
644 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
645 |
if (lastEndOffset != it->second) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
646 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
647 |
ret = false; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
648 |
break; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
649 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
650 |
|
6552 | 651 |
lastEndOffset += it->first->GetSize (); |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
652 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
653 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
654 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
655 |
return ret; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
656 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
657 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
658 |
Ptr<Packet> Ipv6ExtensionFragment::Fragments::GetPacket () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
659 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
660 |
Ptr<Packet> p = m_unfragmentable->Copy (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
661 |
|
8793
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
662 |
for (std::list<std::pair<Ptr<Packet>, uint16_t> >::const_iterator it = m_packetFragments.begin (); it != m_packetFragments.end (); it++) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
663 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
664 |
p->AddAtEnd (it->first); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
665 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
666 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
667 |
return p; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
668 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
669 |
|
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
670 |
Ptr<Packet> Ipv6ExtensionFragment::Fragments::GetPartialPacket () const |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
671 |
{ |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
672 |
Ptr<Packet> p; |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
673 |
|
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
674 |
if ( m_unfragmentable ) |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
675 |
{ |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
676 |
p = m_unfragmentable->Copy (); |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
677 |
} |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
678 |
else |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
679 |
{ |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
680 |
return p; |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
681 |
} |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
682 |
|
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
683 |
uint16_t lastEndOffset = 0; |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
684 |
|
8793
9c59d55abcce
Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7790
diff
changeset
|
685 |
for (std::list<std::pair<Ptr<Packet>, uint16_t> >::const_iterator it = m_packetFragments.begin (); it != m_packetFragments.end (); it++) |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
686 |
{ |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
687 |
if (lastEndOffset != it->second) |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
688 |
{ |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
689 |
break; |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
690 |
} |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
691 |
p->AddAtEnd (it->first); |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
692 |
lastEndOffset += it->first->GetSize (); |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
693 |
} |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
694 |
|
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
695 |
return p; |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
696 |
} |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
697 |
|
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
698 |
void Ipv6ExtensionFragment::Fragments::SetTimeoutEventId (EventId event) |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
699 |
{ |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
700 |
m_timeoutEventId = event; |
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
701 |
return; |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
702 |
} |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
703 |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
704 |
void Ipv6ExtensionFragment::Fragments::CancelTimeout () |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
705 |
{ |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
706 |
m_timeoutEventId.Cancel (); |
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
707 |
return; |
7367
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
708 |
} |
cbd400202eb1
IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
7256
diff
changeset
|
709 |
|
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
710 |
|
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
711 |
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionRouting) |
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
712 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
713 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
714 |
TypeId Ipv6ExtensionRouting::GetTypeId () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
715 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
716 |
static TypeId tid = TypeId ("ns3::Ipv6ExtensionRouting") |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
717 |
.SetParent<Ipv6Extension> () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
718 |
.AddConstructor<Ipv6ExtensionRouting> () |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
719 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
720 |
return tid; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
721 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
722 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
723 |
Ipv6ExtensionRouting::Ipv6ExtensionRouting () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
724 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
725 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
726 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
727 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
728 |
Ipv6ExtensionRouting::~Ipv6ExtensionRouting () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
729 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
730 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
731 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
732 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
733 |
uint8_t Ipv6ExtensionRouting::GetExtensionNumber () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
734 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
735 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
736 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
737 |
return EXT_NUMBER; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
738 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
739 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
740 |
uint8_t Ipv6ExtensionRouting::GetTypeRouting () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
741 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
742 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
743 |
return 0; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
744 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
745 |
|
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
746 |
uint8_t Ipv6ExtensionRouting::Process (Ptr<Packet>& packet, uint8_t offset, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool& isDropped) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
747 |
{ |
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
748 |
NS_LOG_FUNCTION (this << packet << offset << ipv6Header << dst << nextHeader << isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
749 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
750 |
// For ICMPv6 Error Packets |
5790
4917b74101f0
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5789
diff
changeset
|
751 |
Ptr<Packet> malformedPacket = packet->Copy (); |
4917b74101f0
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5789
diff
changeset
|
752 |
malformedPacket->AddHeader (ipv6Header); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
753 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
754 |
Ptr<Packet> p = packet->Copy (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
755 |
p->RemoveAtStart (offset); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
756 |
|
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
757 |
uint8_t buf[4]; |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
758 |
packet->CopyData (buf, sizeof(buf)); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
759 |
|
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
760 |
uint8_t routingNextHeader = buf[0]; |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
761 |
uint8_t routingLength = buf[1]; |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
762 |
uint8_t routingTypeRouting = buf[2]; |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
763 |
uint8_t routingSegmentsLeft = buf[3]; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
764 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
765 |
if (nextHeader) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
766 |
{ |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
767 |
*nextHeader = routingNextHeader; |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
768 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
769 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
770 |
Ptr<Icmpv6L4Protocol> icmpv6 = GetNode ()->GetObject<Ipv6L3Protocol> ()->GetIcmpv6 (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
771 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
772 |
Ptr<Ipv6ExtensionRoutingDemux> ipv6ExtensionRoutingDemux = GetNode ()->GetObject<Ipv6ExtensionRoutingDemux> (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
773 |
Ptr<Ipv6ExtensionRouting> ipv6ExtensionRouting = ipv6ExtensionRoutingDemux->GetExtensionRouting (routingTypeRouting); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
774 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
775 |
if (ipv6ExtensionRouting == 0) |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
776 |
{ |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
777 |
if (routingSegmentsLeft == 0) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
778 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
779 |
isDropped = false; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
780 |
} |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
781 |
else |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
782 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
783 |
NS_LOG_LOGIC ("Malformed header. Drop!"); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
784 |
|
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
785 |
icmpv6->SendErrorParameterError (malformedPacket, ipv6Header.GetSourceAddress (), Icmpv6Header::ICMPV6_MALFORMED_HEADER, offset + 1); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
786 |
m_dropTrace (packet); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
787 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
788 |
} |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
789 |
|
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
790 |
return routingLength; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
791 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
792 |
|
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
793 |
return ipv6ExtensionRouting->Process (packet, offset, ipv6Header, dst, (uint8_t *)0, isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
794 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
795 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
796 |
|
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
797 |
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionRoutingDemux) |
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
798 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
799 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
800 |
TypeId Ipv6ExtensionRoutingDemux::GetTypeId () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
801 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
802 |
static TypeId tid = TypeId ("ns3::Ipv6ExtensionRoutingDemux") |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
803 |
.SetParent<Object> () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
804 |
.AddAttribute ("Routing Extensions", "The set of IPv6 Routing extensions registered with this demux.", |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
805 |
ObjectVectorValue (), |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
806 |
MakeObjectVectorAccessor (&Ipv6ExtensionRoutingDemux::m_extensionsRouting), |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
807 |
MakeObjectVectorChecker<Ipv6ExtensionRouting> ()) |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
808 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
809 |
return tid; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
810 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
811 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
812 |
Ipv6ExtensionRoutingDemux::Ipv6ExtensionRoutingDemux () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
813 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
814 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
815 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
816 |
Ipv6ExtensionRoutingDemux::~Ipv6ExtensionRoutingDemux () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
817 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
818 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
819 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
820 |
void Ipv6ExtensionRoutingDemux::DoDispose () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
821 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
822 |
for (Ipv6ExtensionRoutingList_t::iterator it = m_extensionsRouting.begin (); it != m_extensionsRouting.end (); it++) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
823 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
824 |
(*it)->Dispose (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
825 |
*it = 0; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
826 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
827 |
m_extensionsRouting.clear (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
828 |
m_node = 0; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
829 |
Object::DoDispose (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
830 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
831 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
832 |
void Ipv6ExtensionRoutingDemux::SetNode (Ptr<Node> node) |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
833 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
834 |
m_node = node; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
835 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
836 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
837 |
void Ipv6ExtensionRoutingDemux::Insert (Ptr<Ipv6ExtensionRouting> extensionRouting) |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
838 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
839 |
m_extensionsRouting.push_back (extensionRouting); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
840 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
841 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
842 |
Ptr<Ipv6ExtensionRouting> Ipv6ExtensionRoutingDemux::GetExtensionRouting (uint8_t typeRouting) |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
843 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
844 |
for (Ipv6ExtensionRoutingList_t::iterator i = m_extensionsRouting.begin (); i != m_extensionsRouting.end (); i++) |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
845 |
{ |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
846 |
if ((*i)->GetTypeRouting () == typeRouting) |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
847 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
848 |
return *i; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
849 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
850 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
851 |
return 0; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
852 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
853 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
854 |
void Ipv6ExtensionRoutingDemux::Remove (Ptr<Ipv6ExtensionRouting> extensionRouting) |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
855 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
856 |
m_extensionsRouting.remove (extensionRouting); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
857 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
858 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
859 |
|
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
860 |
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionLooseRouting) |
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
861 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
862 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
863 |
TypeId Ipv6ExtensionLooseRouting::GetTypeId () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
864 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
865 |
static TypeId tid = TypeId ("ns3::Ipv6ExtensionLooseRouting") |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
866 |
.SetParent<Ipv6ExtensionRouting> () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
867 |
.AddConstructor<Ipv6ExtensionLooseRouting> () |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
868 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
869 |
return tid; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
870 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
871 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
872 |
Ipv6ExtensionLooseRouting::Ipv6ExtensionLooseRouting () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
873 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
874 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
875 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
876 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
877 |
Ipv6ExtensionLooseRouting::~Ipv6ExtensionLooseRouting () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
878 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
879 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
880 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
881 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
882 |
uint8_t Ipv6ExtensionLooseRouting::GetTypeRouting () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
883 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
884 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
885 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
886 |
return TYPE_ROUTING; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
887 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
888 |
|
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
889 |
uint8_t Ipv6ExtensionLooseRouting::Process (Ptr<Packet>& packet, uint8_t offset, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool& isDropped) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
890 |
{ |
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
891 |
NS_LOG_FUNCTION (this << packet << offset << ipv6Header << dst << nextHeader << isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
892 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
893 |
// For ICMPv6 Error packets |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
894 |
Ptr<Packet> malformedPacket = packet->Copy (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
895 |
malformedPacket->AddHeader (ipv6Header); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
896 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
897 |
Ptr<Packet> p = packet->Copy (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
898 |
p->RemoveAtStart (offset); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
899 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
900 |
// Copy IPv6 Header : ipv6Header -> ipv6header |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
901 |
Buffer tmp; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
902 |
tmp.AddAtStart (ipv6Header.GetSerializedSize ()); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
903 |
Buffer::Iterator it = tmp.Begin (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
904 |
Ipv6Header ipv6header; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
905 |
ipv6Header.Serialize (it); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
906 |
ipv6header.Deserialize (it); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
907 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
908 |
// Get the number of routers' address field |
6549
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
909 |
uint8_t buf[2]; |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
910 |
p->CopyData (buf, sizeof(buf)); |
487146fc889e
get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents:
5891
diff
changeset
|
911 |
uint8_t numberAddress = buf[1] / 2; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
912 |
Ipv6ExtensionLooseRoutingHeader routingHeader; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
913 |
routingHeader.SetNumberAddress (numberAddress); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
914 |
p->RemoveHeader (routingHeader); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
915 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
916 |
if (nextHeader) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
917 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
918 |
*nextHeader = routingHeader.GetNextHeader (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
919 |
} |
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
920 |
|
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
921 |
Ptr<Icmpv6L4Protocol> icmpv6 = GetNode ()->GetObject<Ipv6L3Protocol> ()->GetIcmpv6 (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
922 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
923 |
Ipv6Address srcAddress = ipv6header.GetSourceAddress (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
924 |
Ipv6Address destAddress = ipv6header.GetDestinationAddress (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
925 |
uint8_t hopLimit = ipv6header.GetHopLimit (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
926 |
uint8_t segmentsLeft = routingHeader.GetSegmentsLeft (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
927 |
uint8_t length = (routingHeader.GetLength () >> 3) - 1; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
928 |
uint8_t nbAddress = length / 2; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
929 |
uint8_t nextAddressIndex; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
930 |
Ipv6Address nextAddress; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
931 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
932 |
if (segmentsLeft == 0) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
933 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
934 |
isDropped = false; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
935 |
return routingHeader.GetSerializedSize (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
936 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
937 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
938 |
if (length % 2 != 0) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
939 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
940 |
NS_LOG_LOGIC ("Malformed header. Drop!"); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
941 |
icmpv6->SendErrorParameterError (malformedPacket, srcAddress, Icmpv6Header::ICMPV6_MALFORMED_HEADER, offset + 1); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
942 |
m_dropTrace (packet); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
943 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
944 |
return routingHeader.GetSerializedSize (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
945 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
946 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
947 |
if (segmentsLeft > nbAddress) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
948 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
949 |
NS_LOG_LOGIC ("Malformed header. Drop!"); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
950 |
icmpv6->SendErrorParameterError (malformedPacket, srcAddress, Icmpv6Header::ICMPV6_MALFORMED_HEADER, offset + 3); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
951 |
m_dropTrace (packet); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
952 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
953 |
return routingHeader.GetSerializedSize (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
954 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
955 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
956 |
routingHeader.SetSegmentsLeft (segmentsLeft - 1); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
957 |
nextAddressIndex = nbAddress - segmentsLeft; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
958 |
nextAddress = routingHeader.GetRouterAddress (nextAddressIndex); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
959 |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
960 |
if (nextAddress.IsMulticast () || destAddress.IsMulticast ()) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
961 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
962 |
m_dropTrace (packet); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
963 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
964 |
return routingHeader.GetSerializedSize (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
965 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
966 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
967 |
routingHeader.SetRouterAddress (nextAddressIndex, destAddress); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
968 |
ipv6header.SetDestinationAddress (nextAddress); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
969 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
970 |
if (hopLimit <= 1) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
971 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
972 |
NS_LOG_LOGIC ("Time Exceeded : Hop Limit <= 1. Drop!"); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
973 |
icmpv6->SendErrorTimeExceeded (malformedPacket, srcAddress, Icmpv6Header::ICMPV6_HOPLIMIT); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
974 |
m_dropTrace (packet); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
975 |
isDropped = true; |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
976 |
return routingHeader.GetSerializedSize (); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
977 |
} |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
978 |
|
5790
4917b74101f0
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5789
diff
changeset
|
979 |
routingHeader.SetLength (88); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
980 |
ipv6header.SetHopLimit (hopLimit - 1); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
981 |
p->AddHeader (routingHeader); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
982 |
|
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
983 |
/* short-circuiting routing stuff |
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
984 |
* |
5796 | 985 |
* If we process this option, |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
986 |
* the packet was for us so we resend it to |
5796 | 987 |
* the new destination (modified in the header above). |
5793
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
988 |
*/ |
5802
e93f45bb4bdf
Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
diff
changeset
|
989 |
|
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
990 |
Ptr<Ipv6L3Protocol> ipv6 = GetNode ()->GetObject<Ipv6L3Protocol> (); |
5793
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
991 |
Ptr<Ipv6RoutingProtocol> ipv6rp = ipv6->GetRoutingProtocol (); |
5800
082bd197b99a
Use RouteOutput instead of getting Ipv6StaticRouting and call LookupStatic.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5796
diff
changeset
|
992 |
Socket::SocketErrno err; |
082bd197b99a
Use RouteOutput instead of getting Ipv6StaticRouting and call LookupStatic.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5796
diff
changeset
|
993 |
NS_ASSERT (ipv6rp); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
994 |
|
5800
082bd197b99a
Use RouteOutput instead of getting Ipv6StaticRouting and call LookupStatic.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5796
diff
changeset
|
995 |
Ptr<Ipv6Route> rtentry = ipv6rp->RouteOutput (p, ipv6header, 0, err); |
5793
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
996 |
|
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
997 |
if (rtentry) |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
998 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
999 |
/* we know a route exists so send packet now */ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
1000 |
ipv6->SendRealOut (rtentry, p, ipv6header); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
1001 |
} |
5793
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
1002 |
else |
5809
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
1003 |
{ |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
1004 |
NS_LOG_INFO ("No route for next router"); |
597070be3549
Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5805
diff
changeset
|
1005 |
} |
5793
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
1006 |
|
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
1007 |
/* as we directly send packet, mark it as dropped */ |
7790
47d6d575412c
Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7385
diff
changeset
|
1008 |
isDropped = true; |
5793
da33f0c8ade4
Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5790
diff
changeset
|
1009 |
|
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1010 |
return routingHeader.GetSerializedSize (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1011 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1012 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1013 |
|
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
1014 |
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionESP) |
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
1015 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1016 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1017 |
TypeId Ipv6ExtensionESP::GetTypeId () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1018 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1019 |
static TypeId tid = TypeId ("ns3::Ipv6ExtensionESP") |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1020 |
.SetParent<Ipv6Extension> () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1021 |
.AddConstructor<Ipv6ExtensionESP> () |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
1022 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1023 |
return tid; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1024 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1025 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1026 |
Ipv6ExtensionESP::Ipv6ExtensionESP () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1027 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1028 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1029 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1030 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1031 |
Ipv6ExtensionESP::~Ipv6ExtensionESP () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1032 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1033 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1034 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1035 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1036 |
uint8_t Ipv6ExtensionESP::GetExtensionNumber () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1037 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1038 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1039 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1040 |
return EXT_NUMBER; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1041 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1042 |
|
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
1043 |
uint8_t Ipv6ExtensionESP::Process (Ptr<Packet>& packet, uint8_t offset, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool& isDropped) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1044 |
{ |
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
1045 |
NS_LOG_FUNCTION (this << packet << offset << ipv6Header << dst << nextHeader << isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1046 |
|
9870
6543f3876ff5
[Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9813
diff
changeset
|
1047 |
/** \todo */ |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1048 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1049 |
return 0; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1050 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1051 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1052 |
|
10410
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
1053 |
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionAH) |
4d4eb8097fa3
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9910
diff
changeset
|
1054 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1055 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1056 |
TypeId Ipv6ExtensionAH::GetTypeId () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1057 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1058 |
static TypeId tid = TypeId ("ns3::Ipv6ExtensionAH") |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1059 |
.SetParent<Ipv6Extension> () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1060 |
.AddConstructor<Ipv6ExtensionAH> () |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
1061 |
; |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1062 |
return tid; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1063 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1064 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1065 |
Ipv6ExtensionAH::Ipv6ExtensionAH () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1066 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1067 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1068 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1069 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1070 |
Ipv6ExtensionAH::~Ipv6ExtensionAH () |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1071 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1072 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1073 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1074 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1075 |
uint8_t Ipv6ExtensionAH::GetExtensionNumber () const |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1076 |
{ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1077 |
NS_LOG_FUNCTION_NOARGS (); |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1078 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1079 |
return EXT_NUMBER; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1080 |
} |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1081 |
|
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
1082 |
uint8_t Ipv6ExtensionAH::Process (Ptr<Packet>& packet, uint8_t offset, Ipv6Header const& ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool& isDropped) |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1083 |
{ |
5784
512909f442f7
More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
5782
diff
changeset
|
1084 |
NS_LOG_FUNCTION (this << packet << offset << ipv6Header << dst << nextHeader << isDropped); |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1085 |
|
9870
6543f3876ff5
[Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9813
diff
changeset
|
1086 |
/** \todo */ |
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1087 |
|
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1088 |
return true; |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1089 |
} |
5785
5d433b13a9c1
IPv6 Fragmentation support.
Sebastien Vincent <sebastien.vincent@turnserver.org>
parents:
5784
diff
changeset
|
1090 |
|
5782
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1091 |
} /* namespace ns3 */ |
f5299c974f1b
Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff
changeset
|
1092 |