src/internet/model/ipv6-extension.cc
author Tommaso Pecorella <tommaso.pecorella@unifi.it>
Mon, 17 Mar 2014 19:43:11 +0100
changeset 10669 46c9391bc38b
parent 10652 dc18deba4502
child 10968 2d29fee2b7b8
permissions -rwxr-xr-x
Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10515
diff changeset
    47
NS_OBJECT_ENSURE_REGISTERED (Ipv6Extension);
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
    48
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
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
    50
{
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
  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
    52
    .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
    53
    .AddAttribute ("ExtensionNumber", "The IPv6 extension number.",
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
    54
                   UintegerValue (0),
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
    55
                   MakeUintegerAccessor (&Ipv6Extension::GetExtensionNumber),
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
    56
                   MakeUintegerChecker<uint8_t> ())
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    57
  ;
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
    58
  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
    59
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    60
8977
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
    61
Ipv6Extension::Ipv6Extension ()
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
    62
{
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
    63
  NS_LOG_FUNCTION_NOARGS ();
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
    64
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
    65
  m_uvar = CreateObject<UniformRandomVariable> ();
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
    66
}
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
    67
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
    68
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
    69
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    70
  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
    71
}
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
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
    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
  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
    76
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
  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
    78
}
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
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
    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
  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
    83
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
  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
    85
}
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
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
    87
uint8_t Ipv6Extension::ProcessOptions (Ptr<Packet>& packet,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
    88
                                       uint8_t offset,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
    89
                                       uint8_t length,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
    90
                                       Ipv6Header const& ipv6Header,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
    91
                                       Ipv6Address dst,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
    92
                                       uint8_t *nextHeader,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
    93
                                       bool& stopProcessing,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
    94
                                       bool& isDropped,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
    95
                                       Ipv6L3Protocol::DropReason& dropReason)
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
    96
{
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
    97
  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
    98
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
    99
  // For ICMPv6 Error packets
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   100
  Ptr<Packet> malformedPacket = packet->Copy ();
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   101
  malformedPacket->AddHeader (ipv6Header);
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   102
  Ptr<Icmpv6L4Protocol> icmpv6 = GetNode ()->GetObject<Ipv6L3Protocol> ()->GetIcmpv6 ();
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   103
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   104
  Ptr<Packet> p = packet->Copy ();
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   105
  p->RemoveAtStart (offset);
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   106
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   107
  Ptr<Ipv6OptionDemux> ipv6OptionDemux = GetNode ()->GetObject<Ipv6OptionDemux> ();
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   108
  Ptr<Ipv6Option> ipv6Option;
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   109
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   110
  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
   111
  uint32_t size = p->GetSize ();
6549
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   112
  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
   113
  p->CopyData (data, size);
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   114
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   115
  uint8_t optionType = 0;
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   116
  uint8_t optionLength = 0;
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   117
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   118
  while (length > processedSize && !isDropped)
5809
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 = *(data + processedSize);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   121
      ipv6Option = ipv6OptionDemux->GetOption (optionType);
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   122
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   123
      if (ipv6Option == 0)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   124
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   125
          optionType >>= 6;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   126
          switch (optionType)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   127
            {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   128
            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
   129
              optionLength = *(data + processedSize + 1) + 2;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   130
              break;
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   131
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   132
            case 1:
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   133
              NS_LOG_LOGIC ("Unknown Option. Drop!");
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   134
              optionLength = 0;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   135
              isDropped = true;
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   136
              stopProcessing = true;
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   137
              dropReason = Ipv6L3Protocol::DROP_UNKNOWN_OPTION;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   138
              break;
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   139
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   140
            case 2:
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   141
              NS_LOG_LOGIC ("Unknown Option. Drop!");
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   142
              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
   143
              optionLength = 0;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   144
              isDropped = true;
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   145
              stopProcessing = true;
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   146
              dropReason = Ipv6L3Protocol::DROP_UNKNOWN_OPTION;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   147
              break;
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   148
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   149
            case 3:
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   150
              NS_LOG_LOGIC ("Unknown Option. Drop!");
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   151
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   152
              if (!ipv6Header.GetDestinationAddress ().IsMulticast ())
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   153
                {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   154
                  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
   155
                }
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   156
              optionLength = 0;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   157
              isDropped = true;
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   158
              stopProcessing = true;
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   159
              dropReason = Ipv6L3Protocol::DROP_UNKNOWN_OPTION;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   160
              break;
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   161
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   162
            default:
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   163
              break;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   164
            }
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   165
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   166
        }
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   167
      else
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
          optionLength = ipv6Option->Process (packet, offset + processedSize, ipv6Header, isDropped);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   170
        }
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   171
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   172
      processedSize += optionLength;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   173
      p->RemoveAtStart (optionLength);
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   174
    }
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   175
6549
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   176
  delete [] data;
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   177
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   178
  return processedSize;
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   179
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   180
8977
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
   181
int64_t
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
   182
Ipv6Extension::AssignStreams (int64_t stream)
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
   183
{
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
   184
  NS_LOG_FUNCTION (this << stream);
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
   185
  m_uvar->SetStream (stream);
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
   186
  return 1;
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
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
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10515
diff changeset
   189
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionHopByHop);
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
   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
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
   192
{
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
  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
   194
    .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
   195
    .AddConstructor<Ipv6ExtensionHopByHop> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   196
  ;
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
   197
  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
   198
}
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
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
   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
  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
   203
}
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
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
   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
  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
   208
}
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
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
   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
  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
   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
  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
   215
}
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
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   217
uint8_t Ipv6ExtensionHopByHop::Process (Ptr<Packet>& packet,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   218
                                        uint8_t offset,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   219
                                        Ipv6Header const& ipv6Header,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   220
                                        Ipv6Address dst,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   221
                                        uint8_t *nextHeader,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   222
                                        bool& stopProcessing,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   223
                                        bool& isDropped,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   224
                                        Ipv6L3Protocol::DropReason& dropReason)
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
   225
{
5784
512909f442f7 More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
   226
  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
   227
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
  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
   229
  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
   230
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   231
  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
   232
  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
   233
  if (nextHeader)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   234
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   235
      *nextHeader = hopbyhopHeader.GetNextHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   236
    }
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
   237
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   238
  uint8_t processedSize = hopbyhopHeader.GetOptionsOffset ();
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   239
  offset += processedSize;
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   240
  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
   241
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   242
  processedSize += ProcessOptions (packet, offset, length, ipv6Header, dst, nextHeader, stopProcessing, isDropped, dropReason);
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
   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
  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
   245
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   247
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10515
diff changeset
   248
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionDestination);
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
   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
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
   251
{
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
  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
   253
    .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
   254
    .AddConstructor<Ipv6ExtensionDestination> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   255
  ;
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
   256
  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
   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
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
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
   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
  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
   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
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
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
   265
{
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
  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
   267
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   268
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
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
   270
{
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
  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
   272
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
  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
   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
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   276
uint8_t Ipv6ExtensionDestination::Process (Ptr<Packet>& packet,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   277
                                           uint8_t offset,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   278
                                           Ipv6Header const& ipv6Header,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   279
                                           Ipv6Address dst,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   280
                                           uint8_t *nextHeader,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   281
                                           bool& stopProcessing,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   282
                                           bool& isDropped,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   283
                                           Ipv6L3Protocol::DropReason& dropReason)
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
   284
{
5784
512909f442f7 More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
   285
  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
   286
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
  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
   288
  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
   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
  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
   291
  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
   292
  if (nextHeader)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   293
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   294
      *nextHeader = destinationHeader.GetNextHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   295
    }
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
   296
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   297
  uint8_t processedSize = destinationHeader.GetOptionsOffset ();
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5793
diff changeset
   298
  offset += processedSize;
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   299
  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
   300
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   301
  processedSize += ProcessOptions (packet, offset, length, ipv6Header, dst, nextHeader, stopProcessing, isDropped, dropReason);
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
   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
  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
   304
}
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
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10515
diff changeset
   307
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionFragment);
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
   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
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
   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
  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
   312
    .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
   313
    .AddConstructor<Ipv6ExtensionFragment> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   314
  ;
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
   315
  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
   316
}
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
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
   319
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   320
  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
   321
}
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
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
   324
{
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
  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
   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
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
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
   329
{
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
  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
   331
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
  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
   333
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   334
      it->second = 0;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   335
    }
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
   336
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
  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
   338
  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
   339
}
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
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
   342
{
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
  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
   344
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   345
  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
   346
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   347
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   348
uint8_t Ipv6ExtensionFragment::Process (Ptr<Packet>& packet,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   349
                                        uint8_t offset,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   350
                                        Ipv6Header const& ipv6Header,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   351
                                        Ipv6Address dst,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   352
                                        uint8_t *nextHeader,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   353
                                        bool& stopProcessing,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   354
                                        bool& isDropped,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   355
                                        Ipv6L3Protocol::DropReason& dropReason)
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
   356
{
5784
512909f442f7 More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
   357
  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
   358
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   359
  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
   360
  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
   361
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   362
  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
   363
  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
   364
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   365
  if (nextHeader)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   366
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   367
      *nextHeader = fragmentHeader.GetNextHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   368
    }
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
   369
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
  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
   371
  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
   372
  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
   373
  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
   374
9813
16f65595bdf8 imported patch make_pair.patch
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9784
diff changeset
   375
  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
   376
  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
   377
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   378
  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
   379
  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
   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
  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
   382
  if (it == m_fragments.end ())
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   383
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   384
      fragments = Create<Fragments> ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   385
      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
   386
      EventId timeout = Simulator::Schedule (Seconds (60),
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   387
                                             &Ipv6ExtensionFragment::HandleFragmentsTimeout, this,
8793
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   388
                                             fragmentsId, ipHeader);
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   389
      fragments->SetTimeoutEventId (timeout);
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   390
    }
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
   391
  else
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   392
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   393
      fragments = it->second;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   394
    }
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
   395
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
  if (fragmentOffset == 0)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   397
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   398
      Ptr<Packet> unfragmentablePart = packet->Copy ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   399
      unfragmentablePart->RemoveAtEnd (packet->GetSize () - offset);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   400
      fragments->SetUnfragmentablePart (unfragmentablePart);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   401
    }
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
   402
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
  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
   404
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
  if (fragments->IsEntire ())
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   406
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   407
      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
   408
      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
   409
      m_fragments.erase (fragmentsId);
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   410
      stopProcessing = false;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   411
    }
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   412
  else
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   413
    {
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   414
      stopProcessing = true;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   415
    }
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
   416
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   417
  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
   418
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   419
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
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
   421
{
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
  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
   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
  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
   425
  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
   426
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
  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
   428
  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
   429
6549
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   430
  uint8_t type;
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   431
  p->CopyData (&type, sizeof(type));
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   432
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
   433
  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
   434
  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
   435
        || (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
   436
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   437
      moreHeader = false;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   438
      ipv6Header.SetNextHeader (Ipv6Header::IPV6_EXT_FRAGMENTATION);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   439
    }
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
   440
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   441
  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
   442
  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
   443
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   444
  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
   445
  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
   446
  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
   447
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   448
  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
   449
    {
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   450
      if (nextHeader == Ipv6Header::IPV6_EXT_HOP_BY_HOP)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   451
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   452
          Ipv6ExtensionHopByHopHeader *hopbyhopHeader = new Ipv6ExtensionHopByHopHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   453
          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
   454
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   455
          nextHeader = hopbyhopHeader->GetNextHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   456
          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
   457
6552
e1a18247fa9c fix some indentation
Andrey Mazo <mazo@iitp.ru>
parents: 6549
diff changeset
   458
          uint8_t type;
e1a18247fa9c fix some indentation
Andrey Mazo <mazo@iitp.ru>
parents: 6549
diff changeset
   459
          p->CopyData (&type, sizeof(type));
6549
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   460
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   461
          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
   462
                || (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
   463
            {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   464
              moreHeader = false;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   465
              hopbyhopHeader->SetNextHeader (Ipv6Header::IPV6_EXT_FRAGMENTATION);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   466
            }
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
   467
9813
16f65595bdf8 imported patch make_pair.patch
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9784
diff changeset
   468
          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
   469
          unfragmentablePartSize += extensionHeaderLength;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   470
        }
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   471
      else if (nextHeader == Ipv6Header::IPV6_EXT_ROUTING)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   472
        {
6552
e1a18247fa9c fix some indentation
Andrey Mazo <mazo@iitp.ru>
parents: 6549
diff changeset
   473
          uint8_t buf[2];
e1a18247fa9c fix some indentation
Andrey Mazo <mazo@iitp.ru>
parents: 6549
diff changeset
   474
          p->CopyData (buf, sizeof(buf));
6549
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   475
          uint8_t numberAddress = buf[1] / 2;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   476
          Ipv6ExtensionLooseRoutingHeader *routingHeader = new Ipv6ExtensionLooseRoutingHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   477
          routingHeader->SetNumberAddress (numberAddress);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   478
          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
   479
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   480
          nextHeader = routingHeader->GetNextHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   481
          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
   482
6552
e1a18247fa9c fix some indentation
Andrey Mazo <mazo@iitp.ru>
parents: 6549
diff changeset
   483
          uint8_t type;
e1a18247fa9c fix some indentation
Andrey Mazo <mazo@iitp.ru>
parents: 6549
diff changeset
   484
          p->CopyData (&type, sizeof(type));
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
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
              routingHeader->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> (routingHeader, Ipv6Header::IPV6_EXT_ROUTING));
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
        }
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   495
      else if (nextHeader == Ipv6Header::IPV6_EXT_DESTINATION)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   496
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   497
          Ipv6ExtensionDestinationHeader *destinationHeader = new Ipv6ExtensionDestinationHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   498
          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
   499
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   500
          nextHeader = destinationHeader->GetNextHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   501
          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
   502
6552
e1a18247fa9c fix some indentation
Andrey Mazo <mazo@iitp.ru>
parents: 6549
diff changeset
   503
          uint8_t type;
e1a18247fa9c fix some indentation
Andrey Mazo <mazo@iitp.ru>
parents: 6549
diff changeset
   504
          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
   505
          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
   506
                || (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
   507
            {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   508
              moreHeader = false;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   509
              destinationHeader->SetNextHeader (Ipv6Header::IPV6_EXT_FRAGMENTATION);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   510
            }
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
   511
9813
16f65595bdf8 imported patch make_pair.patch
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9784
diff changeset
   512
          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
   513
          unfragmentablePartSize += extensionHeaderLength;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   514
        }
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
   515
    }
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   516
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   517
  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
   518
  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
   519
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   520
  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
   521
  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
   522
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   523
  bool moreFragment = true;
8977
2bd04c7f5010 Replace src/internet usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8793
diff changeset
   524
  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
   525
  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
   526
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   527
  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
   528
    {
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   529
      if (p->GetSize () > offset + maxFragmentablePartSize)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   530
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   531
          moreFragment = true;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   532
          currentFragmentablePartSize = maxFragmentablePartSize;
10515
8238217cb0c3 Bug 1814 - IPv6 Packets with length not multiple of 8 bytes are fragmented incorrectly.
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10410
diff changeset
   533
          currentFragmentablePartSize -= currentFragmentablePartSize % 8;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   534
        }
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   535
      else
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   536
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   537
          moreFragment = false;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   538
          currentFragmentablePartSize = p->GetSize () - offset;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   539
        }
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
   540
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   541
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   542
      fragmentHeader.SetNextHeader (nextHeader);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   543
      fragmentHeader.SetOffset (offset);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   544
      fragmentHeader.SetMoreFragment (moreFragment);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   545
      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
   546
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   547
      Ptr<Packet> fragment = p->CreateFragment (offset, currentFragmentablePartSize);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   548
      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
   549
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   550
      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
   551
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   552
      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
   553
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   554
          if (it->second == Ipv6Header::IPV6_EXT_HOP_BY_HOP)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   555
            {
9784
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   556
              Ipv6ExtensionHopByHopHeader * p =
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   557
                dynamic_cast<Ipv6ExtensionHopByHopHeader *> (it->first);
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   558
              NS_ASSERT (p != 0);
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   559
              fragment->AddHeader (*p);
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   560
            }
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   561
          else if (it->second == Ipv6Header::IPV6_EXT_ROUTING)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   562
            {
9784
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   563
              Ipv6ExtensionLooseRoutingHeader * p =
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   564
                dynamic_cast<Ipv6ExtensionLooseRoutingHeader *> (it->first);
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   565
              NS_ASSERT (p != 0);
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   566
              fragment->AddHeader (*p);
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   567
            }
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   568
          else if (it->second == Ipv6Header::IPV6_EXT_DESTINATION)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   569
            {
9784
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   570
              Ipv6ExtensionDestinationHeader * p =
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   571
                dynamic_cast<Ipv6ExtensionDestinationHeader *> (it->first);
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   572
              NS_ASSERT (p != 0);
740a983ed25b [Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8977
diff changeset
   573
              fragment->AddHeader (*p);
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   574
            }
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   575
        }
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
   576
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   577
      ipv6Header.SetPayloadLength (fragment->GetSize ());
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   578
      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
   579
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   580
      std::ostringstream oss;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   581
      fragment->Print (oss);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   582
      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
   583
    }
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   584
  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
   585
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   586
  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
   587
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   588
      delete it->first;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   589
    }
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
   590
5790
4917b74101f0 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5789
diff changeset
   591
  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
   592
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   593
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   594
8793
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   595
void Ipv6ExtensionFragment::HandleFragmentsTimeout (std::pair<Ipv6Address, uint32_t> fragmentsId,
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   596
                                                    Ipv6Header ipHeader)
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   597
{
8793
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   598
  Ptr<Fragments> fragments;
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   599
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   600
  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
   601
  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
   602
  fragments = it->second;
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   603
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   604
  Ptr<Packet> packet = fragments->GetPartialPacket ();
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   605
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   606
  // 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
   607
  if ( packet->GetSize () > 8 )
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   608
    {
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   609
      Ptr<Packet> p = packet->Copy ();
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   610
      p->AddHeader (ipHeader);
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   611
      Ptr<Icmpv6L4Protocol> icmp = GetNode ()->GetObject<Icmpv6L4Protocol> ();
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   612
      icmp->SendErrorTimeExceeded (p, ipHeader.GetSourceAddress (), Icmpv6Header::ICMPV6_FRAGTIME);
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   613
    }
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   614
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   615
  Ptr<Ipv6L3Protocol> ipL3 = GetNode ()->GetObject<Ipv6L3Protocol> ();
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   616
  ipL3->ReportDrop (ipHeader, packet, Ipv6L3Protocol::DROP_FRAGMENT_TIMEOUT);
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   617
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   618
  // 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
   619
  m_fragments.erase (fragmentsId);
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   620
}
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   621
5805
db141a163ef3 Merge with ns-3-dev and fix doxygen.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5802
diff changeset
   622
Ipv6ExtensionFragment::Fragments::Fragments ()
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5862
diff changeset
   623
  : 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
   624
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   625
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   627
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
   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
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   630
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
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
   632
{
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
  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
   634
8793
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   635
  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
   636
    {
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   637
      if (it->second > fragmentOffset)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   638
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   639
          break;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   640
        }
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
   641
    }
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
  if (it == m_packetFragments.end ())
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
      m_moreFragment = moreFragment;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   646
    }
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
   647
9813
16f65595bdf8 imported patch make_pair.patch
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9784
diff changeset
   648
  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
   649
}
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
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   651
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
   652
{
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
  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
   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
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
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
   657
{
8793
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   658
  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
   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
  if (ret)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   661
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   662
      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
   663
8793
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   664
      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
   665
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   666
          if (lastEndOffset != it->second)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   667
            {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   668
              ret = false;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   669
              break;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   670
            }
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
   671
6552
e1a18247fa9c fix some indentation
Andrey Mazo <mazo@iitp.ru>
parents: 6549
diff changeset
   672
          lastEndOffset += it->first->GetSize ();
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   673
        }
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
   674
    }
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   675
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   676
  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
   677
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   678
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   679
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
   680
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   681
  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
   682
8793
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   683
  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
   684
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   685
      p->AddAtEnd (it->first);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   686
    }
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
   687
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   688
  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
   689
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   690
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   691
Ptr<Packet> Ipv6ExtensionFragment::Fragments::GetPartialPacket () const
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   692
{
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   693
  Ptr<Packet> p;
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
  if ( m_unfragmentable )
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
      p = m_unfragmentable->Copy ();
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   698
    }
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   699
  else
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   700
    {
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   701
      return p;
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
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   704
  uint16_t lastEndOffset = 0;
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   705
8793
9c59d55abcce Bug 1422 - Fix memory leak in IPv6 fragmentation
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7790
diff changeset
   706
  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
   707
    {
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   708
      if (lastEndOffset != it->second)
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   709
        {
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   710
          break;
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   711
        }
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   712
      p->AddAtEnd (it->first);
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   713
      lastEndOffset += it->first->GetSize ();
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   714
    }
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   715
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   716
  return p;
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   717
}
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   718
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   719
void Ipv6ExtensionFragment::Fragments::SetTimeoutEventId (EventId event)
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   720
{
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   721
  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
   722
  return;
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   723
}
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   724
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   725
void Ipv6ExtensionFragment::Fragments::CancelTimeout ()
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   726
{
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   727
  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
   728
  return;
7367
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   729
}
cbd400202eb1 IPv6 fragmentation enhancements
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7256
diff changeset
   730
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
   731
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10515
diff changeset
   732
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionRouting);
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
   733
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
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
   735
{
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
  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
   737
    .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
   738
    .AddConstructor<Ipv6ExtensionRouting> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   739
  ;
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
   740
  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
   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
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
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
   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
  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
   746
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   748
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
   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
  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
   751
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   752
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
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
   754
{
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
  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
   756
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   757
  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
   758
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   760
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
   761
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   762
  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
   763
  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
   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
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   766
uint8_t Ipv6ExtensionRouting::Process (Ptr<Packet>& packet,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   767
                                       uint8_t offset,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   768
                                       Ipv6Header const& ipv6Header,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   769
                                       Ipv6Address dst,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   770
                                       uint8_t *nextHeader,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   771
                                       bool& stopProcessing,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   772
                                       bool& isDropped,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   773
                                       Ipv6L3Protocol::DropReason& dropReason)
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
   774
{
5784
512909f442f7 More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
   775
  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
   776
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   777
  // For ICMPv6 Error Packets
5790
4917b74101f0 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5789
diff changeset
   778
  Ptr<Packet> malformedPacket = packet->Copy ();
4917b74101f0 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5789
diff changeset
   779
  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
   780
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   781
  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
   782
  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
   783
6549
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   784
  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
   785
  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
   786
6549
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   787
  uint8_t routingNextHeader = buf[0];
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   788
  uint8_t routingLength = buf[1];
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   789
  uint8_t routingTypeRouting = buf[2];
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   790
  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
   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
  if (nextHeader)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   793
    {
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   794
      *nextHeader = routingNextHeader;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   795
    }
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
   796
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   797
  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
   798
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
  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
   800
  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
   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
  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
   803
    {
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   804
      if (routingSegmentsLeft == 0)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   805
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   806
          isDropped = false;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   807
        }
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   808
      else
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   809
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   810
          NS_LOG_LOGIC ("Malformed header. Drop!");
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   811
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   812
          icmpv6->SendErrorParameterError (malformedPacket, ipv6Header.GetSourceAddress (), Icmpv6Header::ICMPV6_MALFORMED_HEADER, offset + 1);
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   813
          dropReason = Ipv6L3Protocol::DROP_MALFORMED_HEADER;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   814
          isDropped = true;
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   815
          stopProcessing = true;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   816
        }
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   817
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   818
      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
   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
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   821
  return ipv6ExtensionRouting->Process (packet, offset, ipv6Header, dst, (uint8_t *)0, stopProcessing, isDropped, dropReason);
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
   822
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   823
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   824
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10515
diff changeset
   825
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionRoutingDemux);
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
   826
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
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
   828
{
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
  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
   830
    .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
   831
    .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
   832
                   ObjectVectorValue (),
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   833
                   MakeObjectVectorAccessor (&Ipv6ExtensionRoutingDemux::m_extensionsRouting),
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   834
                   MakeObjectVectorChecker<Ipv6ExtensionRouting> ())
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   835
  ;
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
   836
  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
   837
}
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
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
   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
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
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
   844
{
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
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   846
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   847
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
   848
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   849
  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
   850
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   851
      (*it)->Dispose ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   852
      *it = 0;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   853
    }
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
   854
  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
   855
  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
   856
  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
   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
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
   860
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   861
  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
   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
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
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
   865
{
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
  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
   867
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   868
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
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
   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
  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
   872
    {
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   873
      if ((*i)->GetTypeRouting () == typeRouting)
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   874
        {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   875
          return *i;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   876
        }
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
   877
    }
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
  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
   879
}
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
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
   882
{
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
  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
   884
}
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
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10515
diff changeset
   887
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionLooseRouting);
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
   888
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   889
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
   890
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   891
  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
   892
    .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
   893
    .AddConstructor<Ipv6ExtensionLooseRouting> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   894
  ;
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
   895
  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
   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
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
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
   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
  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
   901
}
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
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
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
   904
{
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
  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
   906
}
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
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
   909
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   910
  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
   911
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
  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
   913
}
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
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   915
uint8_t Ipv6ExtensionLooseRouting::Process (Ptr<Packet>& packet,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   916
                                            uint8_t offset,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   917
                                            Ipv6Header const& ipv6Header,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   918
                                            Ipv6Address dst,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   919
                                            uint8_t *nextHeader,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   920
                                            bool& stopProcessing,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   921
                                            bool& isDropped,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   922
                                            Ipv6L3Protocol::DropReason& dropReason)
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
   923
{
5784
512909f442f7 More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
   924
  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
   925
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
  // 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
   927
  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
   928
  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
   929
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
  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
   931
  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
   932
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   933
  // 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
   934
  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
   935
  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
   936
  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
   937
  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
   938
  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
   939
  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
   940
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   941
  // 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
   942
  uint8_t buf[2];
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   943
  p->CopyData (buf, sizeof(buf));
487146fc889e get rid of about a zillion PeekData
Craig Dowell <craigdo@ee.washington.edu>
parents: 5891
diff changeset
   944
  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
   945
  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
   946
  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
   947
  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
   948
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   949
  if (nextHeader)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   950
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   951
      *nextHeader = routingHeader.GetNextHeader ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   952
    }
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
   953
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
   954
  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
   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
  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
   957
  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
   958
  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
   959
  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
   960
  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
   961
  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
   962
  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
   963
  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
   964
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   965
  if (segmentsLeft == 0)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   966
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   967
      isDropped = false;
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   968
      return routingHeader.GetSerializedSize ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   969
    }
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
   970
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   971
  if (length % 2 != 0)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   972
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   973
      NS_LOG_LOGIC ("Malformed header. Drop!");
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   974
      icmpv6->SendErrorParameterError (malformedPacket, srcAddress, Icmpv6Header::ICMPV6_MALFORMED_HEADER, offset + 1);
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   975
      dropReason = Ipv6L3Protocol::DROP_MALFORMED_HEADER;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   976
      isDropped = true;
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   977
      stopProcessing = true;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   978
      return routingHeader.GetSerializedSize ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   979
    }
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
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
  if (segmentsLeft > nbAddress)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   982
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   983
      NS_LOG_LOGIC ("Malformed header. Drop!");
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   984
      icmpv6->SendErrorParameterError (malformedPacket, srcAddress, Icmpv6Header::ICMPV6_MALFORMED_HEADER, offset + 3);
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   985
      dropReason = Ipv6L3Protocol::DROP_MALFORMED_HEADER;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   986
      isDropped = true;
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   987
      stopProcessing = true;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   988
      return routingHeader.GetSerializedSize ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   991
  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
   992
  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
   993
  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
   994
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
   995
  if (nextAddress.IsMulticast () || destAddress.IsMulticast ())
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   996
    {
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   997
      dropReason = Ipv6L3Protocol::DROP_MALFORMED_HEADER;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   998
      isDropped = true;
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
   999
      stopProcessing = true;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1000
      return routingHeader.GetSerializedSize ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1001
    }
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
  1002
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1003
  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
  1004
  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
  1005
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1006
  if (hopLimit <= 1)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1007
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1008
      NS_LOG_LOGIC ("Time Exceeded : Hop Limit <= 1. Drop!");
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1009
      icmpv6->SendErrorTimeExceeded (malformedPacket, srcAddress, Icmpv6Header::ICMPV6_HOPLIMIT);
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1010
      dropReason = Ipv6L3Protocol::DROP_MALFORMED_HEADER;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1011
      isDropped = true;
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1012
      stopProcessing = true;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1013
      return routingHeader.GetSerializedSize ();
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1014
    }
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
  1015
5790
4917b74101f0 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5789
diff changeset
  1016
  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
  1017
  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
  1018
  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
  1019
7790
47d6d575412c Bug 1362 - ICMPv6 does not forward ICMPs to upper layers
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7385
diff changeset
  1020
  /* 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
  1021
   *
5796
cd4576c14476 Update.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5793
diff changeset
  1022
   * 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
  1023
   * the packet was for us so we resend it to
5796
cd4576c14476 Update.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5793
diff changeset
  1024
   * 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
  1025
   */
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5800 5801
diff changeset
  1026
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
  1027
  Ptr<Ipv6L3Protocol> ipv6 = GetNode ()->GetObject<Ipv6L3Protocol> ();
5793
da33f0c8ade4 Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5790
diff changeset
  1028
  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
  1029
  Socket::SocketErrno err;
082bd197b99a Use RouteOutput instead of getting Ipv6StaticRouting and call LookupStatic.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5796
diff changeset
  1030
  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
  1031
5800
082bd197b99a Use RouteOutput instead of getting Ipv6StaticRouting and call LookupStatic.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5796
diff changeset
  1032
  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
  1033
da33f0c8ade4 Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5790
diff changeset
  1034
  if (rtentry)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1035
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1036
      /* we know a route exists so send packet now */
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1037
      ipv6->SendRealOut (rtentry, p, ipv6header);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1038
    }
5793
da33f0c8ade4 Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5790
diff changeset
  1039
  else
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1040
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1041
      NS_LOG_INFO ("No route for next router");
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
  1042
    }
5793
da33f0c8ade4 Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5790
diff changeset
  1043
da33f0c8ade4 Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5790
diff changeset
  1044
  /* 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
  1045
  isDropped = true;
5793
da33f0c8ade4 Routing type 0 support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5790
diff changeset
  1046
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
  1047
  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
  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
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
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10515
diff changeset
  1051
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionESP);
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
  1052
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1053
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
  1054
{
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
  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
  1056
    .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
  1057
    .AddConstructor<Ipv6ExtensionESP> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
  1058
  ;
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
  1059
  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
  1060
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1061
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
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
  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
  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
  1065
}
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
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
  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
  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
  1070
}
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
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
  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
  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
  1075
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
  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
  1077
}
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
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1079
uint8_t Ipv6ExtensionESP::Process (Ptr<Packet>& packet,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1080
                                   uint8_t offset,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1081
                                   Ipv6Header const& ipv6Header,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1082
                                   Ipv6Address dst,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1083
                                   uint8_t *nextHeader,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1084
                                   bool& stopProcessing,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1085
                                   bool& isDropped,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1086
                                   Ipv6L3Protocol::DropReason& dropReason)
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
{
5784
512909f442f7 More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
  1088
  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
  1089
9870
6543f3876ff5 [Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9813
diff changeset
  1090
  /** \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
  1091
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
  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
  1093
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1094
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1095
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10515
diff changeset
  1096
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionAH);
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
  1097
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1098
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
  1099
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1100
  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
  1101
    .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
  1102
    .AddConstructor<Ipv6ExtensionAH> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
  1103
  ;
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
  1104
  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
  1105
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1106
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1107
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
  1108
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1109
  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
  1110
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1111
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1112
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
  1113
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1114
  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
  1115
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1116
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1117
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
  1118
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1119
  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
  1120
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1121
  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
  1122
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1123
10669
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1124
uint8_t Ipv6ExtensionAH::Process (Ptr<Packet>& packet,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1125
                                  uint8_t offset,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1126
                                  Ipv6Header const& ipv6Header,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1127
                                  Ipv6Address dst,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1128
                                  uint8_t *nextHeader,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1129
                                  bool& stopProcessing,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1130
                                  bool& isDropped,
46c9391bc38b Bug 1843 - IPv6 extensions dropped packets do not fire L3 drop trace
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10652
diff changeset
  1131
                                  Ipv6L3Protocol::DropReason& dropReason)
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
  1132
{
5784
512909f442f7 More on IPv6 extensions support.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
  1133
  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
  1134
9870
6543f3876ff5 [Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9813
diff changeset
  1135
  /** \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
  1136
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
  1137
  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
  1138
}
5785
5d433b13a9c1 IPv6 Fragmentation support.
Sebastien Vincent <sebastien.vincent@turnserver.org>
parents: 5784
diff changeset
  1139
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
  1140
} /* 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
  1141