src/internet/model/ipv6-extension-header.cc
author Quincy Tse <quincy.tse@gmail.com>
Wed, 10 Aug 2011 13:09:23 -0400
changeset 7416 91df05070541
parent 7385 10beb0e53130
child 9870 6543f3876ff5
permissions -rw-r--r--
bug 1050: ISO C++ forbids variable length array
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7252
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 "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
    22
#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
    23
#include "ns3/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
    24
#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
    25
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
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
    27
{
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
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
NS_LOG_COMPONENT_DEFINE ("Ipv6ExtensionHeader");
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    31
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionHeader);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    32
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    33
TypeId Ipv6ExtensionHeader::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
    34
{
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
  static TypeId tid = TypeId ("ns3::Ipv6ExtensionHeader")
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
    .AddConstructor<Ipv6ExtensionHeader> ()
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
    .SetParent<Header> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    38
  ;
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
    39
  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
    40
}
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
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
TypeId Ipv6ExtensionHeader::GetInstanceTypeId () 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
    43
{
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
  return 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
    45
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    47
Ipv6ExtensionHeader::Ipv6ExtensionHeader ()
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5809
diff changeset
    48
  : m_nextHeader (0),
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    49
    m_length (0),
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    50
    m_data (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
    51
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    52
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    54
Ipv6ExtensionHeader::~Ipv6ExtensionHeader ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    55
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    56
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    57
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
void Ipv6ExtensionHeader::SetNextHeader (uint8_t 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
    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
  m_nextHeader = 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
    61
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    62
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    63
uint8_t Ipv6ExtensionHeader::GetNextHeader () 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
    64
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    65
  return m_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
    66
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    67
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
void Ipv6ExtensionHeader::SetLength (uint16_t length)
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
  m_length = (length >> 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
    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
uint16_t Ipv6ExtensionHeader::GetLength () 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
    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
  return (m_length + 1) << 3;
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
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
void Ipv6ExtensionHeader::Print (std::ostream &os) 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
    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
  os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength () << " )";
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    81
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    82
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    83
uint32_t Ipv6ExtensionHeader::GetSerializedSize () const
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    84
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    85
  return 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
    86
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    87
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    88
void Ipv6ExtensionHeader::Serialize (Buffer::Iterator start) 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
    89
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    90
  Buffer::Iterator i = start;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    91
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    92
  i.WriteU8 (m_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
    93
  i.WriteU8 (m_length);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    94
  i.Write (m_data.PeekData (), m_data.GetSize ());
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    95
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    96
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    97
uint32_t Ipv6ExtensionHeader::Deserialize (Buffer::Iterator start) 
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    98
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
    99
  Buffer::Iterator i = start;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   100
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   101
  m_nextHeader = i.ReadU8 ();
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   102
  m_length = i.ReadU8 ();
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   103
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   104
  uint32_t dataLength = GetLength () - 2;
7416
91df05070541 bug 1050: ISO C++ forbids variable length array
Quincy Tse <quincy.tse@gmail.com>
parents: 7385
diff changeset
   105
  uint8_t* data = new uint8_t[dataLength];
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
   106
  i.Read (data, dataLength);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   107
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   108
  if (dataLength > m_data.GetSize ())
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   109
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   110
      m_data.AddAtEnd (dataLength - m_data.GetSize ());
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   111
    }
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
   112
  else 
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   113
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   114
      m_data.RemoveAtEnd (m_data.GetSize () - dataLength);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   115
    }
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
   116
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   117
  i = m_data.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
   118
  i.Write (data, dataLength);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   119
7416
91df05070541 bug 1050: ISO C++ forbids variable length array
Quincy Tse <quincy.tse@gmail.com>
parents: 7385
diff changeset
   120
  delete[] data;
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
   121
  return 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
   122
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   123
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   124
OptionField::OptionField (uint32_t optionsOffset)
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5809
diff changeset
   125
  : m_optionData (0),
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   126
    m_optionsOffset (optionsOffset)
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   127
{
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   128
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   129
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   130
OptionField::~OptionField ()
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   131
{
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   132
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   133
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   134
uint32_t OptionField::GetSerializedSize () const
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   135
{
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   136
  return m_optionData.GetSize () + CalculatePad ((Ipv6OptionHeader::Alignment) { 8,0});
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   137
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   138
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   139
void OptionField::Serialize (Buffer::Iterator start) const
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   140
{
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   141
  start.Write (m_optionData.Begin (), m_optionData.End ());
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   142
  uint32_t fill = CalculatePad ((Ipv6OptionHeader::Alignment) { 8,0});
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   143
  NS_LOG_LOGIC ("fill with " << fill << " bytes padding");
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   144
  switch (fill)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   145
    {
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   146
    case 0: return;
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   147
    case 1: Ipv6OptionPad1Header ().Serialize (start);
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   148
      return;
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   149
    default: Ipv6OptionPadnHeader (fill).Serialize (start);
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   150
      return;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   151
    }
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   152
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   153
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   154
uint32_t OptionField::Deserialize (Buffer::Iterator start, uint32_t length)
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   155
{
7416
91df05070541 bug 1050: ISO C++ forbids variable length array
Quincy Tse <quincy.tse@gmail.com>
parents: 7385
diff changeset
   156
  uint8_t* buf = new uint8_t[length];
5805
db141a163ef3 Merge with ns-3-dev and fix doxygen.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5802
diff changeset
   157
  start.Read (buf, length);
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   158
  m_optionData = Buffer ();
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   159
  m_optionData.AddAtEnd (length);
5805
db141a163ef3 Merge with ns-3-dev and fix doxygen.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5802
diff changeset
   160
  m_optionData.Begin ().Write (buf, length);
7416
91df05070541 bug 1050: ISO C++ forbids variable length array
Quincy Tse <quincy.tse@gmail.com>
parents: 7385
diff changeset
   161
  delete[] buf;
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   162
  return length;
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   163
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   164
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   165
void OptionField::AddOption (Ipv6OptionHeader const& option)
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   166
{
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   167
  NS_LOG_FUNCTION_NOARGS ();
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   168
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   169
  uint32_t pad = CalculatePad (option.GetAlignment ());
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   170
  NS_LOG_LOGIC ("need " << pad << " bytes padding");
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   171
  switch (pad)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   172
    {
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   173
    case 0: break; //no padding needed
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   174
    case 1: AddOption (Ipv6OptionPad1Header ());
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   175
      break;
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   176
    default: AddOption (Ipv6OptionPadnHeader (pad));
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   177
      break;
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   178
    }
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   179
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   180
  m_optionData.AddAtEnd (option.GetSerializedSize ());
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   181
  Buffer::Iterator it = m_optionData.End ();
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   182
  it.Prev (option.GetSerializedSize ());
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   183
  option.Serialize (it);
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   184
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   185
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   186
uint32_t OptionField::CalculatePad (Ipv6OptionHeader::Alignment alignment) const
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   187
{
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   188
  return (alignment.offset - (m_optionData.GetSize () + m_optionsOffset)) % alignment.factor;
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   189
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   190
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   191
uint32_t OptionField::GetOptionsOffset ()
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   192
{
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   193
  return m_optionsOffset;
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   194
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   195
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   196
Buffer OptionField::GetOptionBuffer ()
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   197
{
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   198
  return m_optionData;
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   199
}
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   200
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   201
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
   202
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionHopByHopHeader);
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
TypeId Ipv6ExtensionHopByHopHeader::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
   205
{
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
  static TypeId tid = TypeId ("ns3::Ipv6ExtensionHopByHopHeader")
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
    .AddConstructor<Ipv6ExtensionHopByHopHeader> ()
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
    .SetParent<Ipv6ExtensionHeader> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   209
  ;
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
   210
  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
   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
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
TypeId Ipv6ExtensionHopByHopHeader::GetInstanceTypeId () 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
   214
{
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
  return 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
   216
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   217
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   218
Ipv6ExtensionHopByHopHeader::Ipv6ExtensionHopByHopHeader ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   219
  : OptionField (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
   220
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   221
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   222
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   223
Ipv6ExtensionHopByHopHeader::~Ipv6ExtensionHopByHopHeader ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   224
{
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
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   226
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
void Ipv6ExtensionHopByHopHeader::Print (std::ostream &os) 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
   228
{
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
  os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength () << " )";
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
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
uint32_t Ipv6ExtensionHopByHopHeader::GetSerializedSize () 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
   233
{
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   234
  return 2 + OptionField::GetSerializedSize ();
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
   235
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   236
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   237
void Ipv6ExtensionHopByHopHeader::Serialize (Buffer::Iterator start) 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
   238
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   239
  Buffer::Iterator i = start;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   240
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
  i.WriteU8 (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
   242
  i.WriteU8 ((GetLength () >> 3) - 1);
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   243
  OptionField::Serialize (i);
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
   244
}
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
uint32_t Ipv6ExtensionHopByHopHeader::Deserialize (Buffer::Iterator start) 
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
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   248
  Buffer::Iterator i = start;
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
  SetNextHeader (i.ReadU8 ());
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
  SetLength ((i.ReadU8 () + 1) << 3);
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   252
  OptionField::Deserialize (i, GetLength () - 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
   253
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
  return 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
   255
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   256
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
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionDestinationHeader);
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
TypeId Ipv6ExtensionDestinationHeader::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
   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
  static TypeId tid = TypeId ("ns3::Ipv6ExtensionDestinationHeader")
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
    .AddConstructor<Ipv6ExtensionDestinationHeader> ()
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
    .SetParent<Ipv6ExtensionHeader> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   264
  ;
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
   265
  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
   266
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   267
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
TypeId Ipv6ExtensionDestinationHeader::GetInstanceTypeId () 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
   269
{
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
  return 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
   271
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   272
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
Ipv6ExtensionDestinationHeader::Ipv6ExtensionDestinationHeader ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   274
  : OptionField (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
   275
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   276
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   277
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   278
Ipv6ExtensionDestinationHeader::~Ipv6ExtensionDestinationHeader ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   279
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   280
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   281
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   282
void Ipv6ExtensionDestinationHeader::Print (std::ostream &os) 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
   283
{
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
  os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength () << " )";
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   285
}
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
uint32_t Ipv6ExtensionDestinationHeader::GetSerializedSize () 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
   288
{
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   289
  return 2 + OptionField::GetSerializedSize ();
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
   290
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   291
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
void Ipv6ExtensionDestinationHeader::Serialize (Buffer::Iterator start) 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
   293
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   294
  Buffer::Iterator i = start;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   295
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
  i.WriteU8 (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
   297
  i.WriteU8 ((GetLength () >> 3) - 1);
5801
86b47c42316c Ipv6Extension-Option link
Fabian Mauchle <fabian.mauchle@hsr.ch>
parents: 5790
diff changeset
   298
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   299
  OptionField::Serialize (i);
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
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   301
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
uint32_t Ipv6ExtensionDestinationHeader::Deserialize (Buffer::Iterator start) 
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   303
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   304
  Buffer::Iterator i = start;
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
  SetNextHeader (i.ReadU8 ());
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   307
  SetLength ((i.ReadU8 () + 1) << 3);
5802
e93f45bb4bdf Merge with Fabian's repository.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5801
diff changeset
   308
  OptionField::Deserialize (i, GetLength () - 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
   309
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
  return 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
   311
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   312
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   313
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionFragmentHeader);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   314
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
TypeId Ipv6ExtensionFragmentHeader::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
   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
  static TypeId tid = TypeId ("ns3::Ipv6ExtensionFragmentHeader")
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
    .AddConstructor<Ipv6ExtensionFragmentHeader> ()
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
    .SetParent<Ipv6ExtensionHeader> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   320
  ;
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
   321
  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
   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
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
TypeId Ipv6ExtensionFragmentHeader::GetInstanceTypeId () 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
   325
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   326
  return 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
   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
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
Ipv6ExtensionFragmentHeader::Ipv6ExtensionFragmentHeader ()
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5809
diff changeset
   330
  : m_offset (0),
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   331
    m_identification (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
   332
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   333
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   334
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   335
Ipv6ExtensionFragmentHeader::~Ipv6ExtensionFragmentHeader ()
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
}
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
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
void Ipv6ExtensionFragmentHeader::SetOffset (uint16_t offset)
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   340
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   341
  // Clear the offset, and save the MF bit
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
  m_offset &= 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
   343
  m_offset |= offset & (~7);
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
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
uint16_t Ipv6ExtensionFragmentHeader::GetOffset () 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
   347
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   348
  return m_offset & (~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
   349
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   350
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   351
void Ipv6ExtensionFragmentHeader::SetMoreFragment (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
   352
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   353
  m_offset = moreFragment ? m_offset | 1 : m_offset & (~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
   354
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   355
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
bool Ipv6ExtensionFragmentHeader::GetMoreFragment () 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
   357
{
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
  return m_offset & 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
   359
}
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
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
void Ipv6ExtensionFragmentHeader::SetIdentification (uint32_t identification)
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
{
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
  m_identification = identification;
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   366
uint32_t Ipv6ExtensionFragmentHeader::GetIdentification () 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
   367
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   368
  return m_identification;
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
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
void Ipv6ExtensionFragmentHeader::Print (std::ostream &os) 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
   372
{
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
  os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength () 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   374
     << " offset = " << (uint32_t)GetOffset () << " MF = " << (uint32_t)GetMoreFragment () << " identification = " << (uint32_t)m_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
   375
}
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
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
uint32_t Ipv6ExtensionFragmentHeader::GetSerializedSize () 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
   378
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   379
  return 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
   380
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   381
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   382
void Ipv6ExtensionFragmentHeader::Serialize (Buffer::Iterator start) 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
   383
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   384
  Buffer::Iterator i = start;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   385
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   386
  i.WriteU8 (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
   387
  i.WriteU8 ((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
   388
  i.WriteHtonU16 (m_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
   389
  i.WriteHtonU32 (m_identification);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   390
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   392
uint32_t Ipv6ExtensionFragmentHeader::Deserialize (Buffer::Iterator start) 
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   393
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   394
  Buffer::Iterator i = start;
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
  SetNextHeader (i.ReadU8 ());
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   397
  SetLength ((i.ReadU8 () + 1) << 3);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   398
  m_offset = i.ReadNtohU16 ();
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   399
  m_identification = i.ReadNtohU32 ();
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   400
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   401
  return 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
   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
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
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionRoutingHeader);
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   406
TypeId Ipv6ExtensionRoutingHeader::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
   407
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   408
  static TypeId tid = TypeId ("ns3::Ipv6ExtensionRoutingHeader")
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   409
    .AddConstructor<Ipv6ExtensionRoutingHeader> ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   410
    .SetParent<Ipv6ExtensionHeader> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   411
  ;
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
   412
  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
   413
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   414
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   415
TypeId Ipv6ExtensionRoutingHeader::GetInstanceTypeId () 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
   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 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
   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
Ipv6ExtensionRoutingHeader::Ipv6ExtensionRoutingHeader ()
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5809
diff changeset
   421
  : m_typeRouting (0),
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   422
    m_segmentsLeft (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
   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
}
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
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
Ipv6ExtensionRoutingHeader::~Ipv6ExtensionRoutingHeader ()
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
{
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
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   430
void Ipv6ExtensionRoutingHeader::SetTypeRouting (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
   431
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   432
  m_typeRouting = 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
   433
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   435
uint8_t Ipv6ExtensionRoutingHeader::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
   436
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   437
  return m_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
   438
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   439
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
void Ipv6ExtensionRoutingHeader::SetSegmentsLeft (uint8_t 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
   441
{
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
  m_segmentsLeft = 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
   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
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
uint8_t Ipv6ExtensionRoutingHeader::GetSegmentsLeft () 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
   446
{
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
  return m_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
   448
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   450
void Ipv6ExtensionRoutingHeader::Print (std::ostream &os) 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
   451
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   452
  os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " << (uint32_t)GetLength () 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   453
     << " typeRouting = " << (uint32_t)m_typeRouting << " segmentsLeft = " << (uint32_t)m_segmentsLeft << " )";
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
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   455
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   456
uint32_t Ipv6ExtensionRoutingHeader::GetSerializedSize () 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
   457
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   458
  return 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
   459
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   460
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   461
void Ipv6ExtensionRoutingHeader::Serialize (Buffer::Iterator start) 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
   462
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   463
  Buffer::Iterator i = start;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   464
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   465
  i.WriteU8 (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
   466
  i.WriteU8 ((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
   467
  i.WriteU8 (m_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
   468
  i.WriteU8 (m_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
   469
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   470
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   471
uint32_t Ipv6ExtensionRoutingHeader::Deserialize (Buffer::Iterator start) 
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   472
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   473
  Buffer::Iterator i = start;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   474
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   475
  SetNextHeader (i.ReadU8 ());
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   476
  SetLength ((i.ReadU8 () + 1) << 3);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   477
  m_typeRouting = i.ReadU8 ();
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   478
  m_segmentsLeft = i.ReadU8 ();
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   480
  return 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
   481
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   483
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionLooseRoutingHeader);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   484
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   485
TypeId Ipv6ExtensionLooseRoutingHeader::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
   486
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   487
  static TypeId tid = TypeId ("ns3::Ipv6ExtensionLooseRoutingHeader")
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   488
    .AddConstructor<Ipv6ExtensionLooseRoutingHeader> ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   489
    .SetParent<Ipv6ExtensionRoutingHeader> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
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
  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
   492
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   493
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   494
TypeId Ipv6ExtensionLooseRoutingHeader::GetInstanceTypeId () 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
   495
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   496
  return 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
   497
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   498
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
Ipv6ExtensionLooseRoutingHeader::Ipv6ExtensionLooseRoutingHeader ()
5891
09a575cdf8db Indent correctly IPv6 code.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5809
diff changeset
   500
  : m_routersAddress (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
   501
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   502
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   503
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   504
Ipv6ExtensionLooseRoutingHeader::~Ipv6ExtensionLooseRoutingHeader ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   505
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   506
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   507
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   508
void Ipv6ExtensionLooseRoutingHeader::SetNumberAddress (uint8_t n)
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   509
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   510
  m_routersAddress.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
   511
  m_routersAddress.assign (n, Ipv6Address (""));
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   512
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   513
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   514
void Ipv6ExtensionLooseRoutingHeader::SetRoutersAddress (std::vector<Ipv6Address> routersAddress)
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
  m_routersAddress = routersAddress;
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
}
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
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
std::vector<Ipv6Address> Ipv6ExtensionLooseRoutingHeader::GetRoutersAddress () 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
   520
{
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
  return m_routersAddress;
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   524
void Ipv6ExtensionLooseRoutingHeader::SetRouterAddress (uint8_t index, Ipv6Address addr)
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
{
5790
4917b74101f0 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
   526
  m_routersAddress.at (index) = addr;
5782
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   527
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   529
Ipv6Address Ipv6ExtensionLooseRoutingHeader::GetRouterAddress (uint8_t index) 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
   530
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   531
  return m_routersAddress.at (index);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   532
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   533
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   534
void Ipv6ExtensionLooseRoutingHeader::Print (std::ostream &os) 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
   535
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   536
  os << "( nextHeader = " << (uint32_t)GetNextHeader () << " length = " <<  (uint32_t)GetLength () 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   537
     << " typeRouting = " << (uint32_t)GetTypeRouting () << " segmentsLeft = " << (uint32_t)GetSegmentsLeft () << " ";
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
   538
5790
4917b74101f0 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
   539
  for (std::vector<Ipv6Address>::const_iterator it = m_routersAddress.begin (); it != m_routersAddress.end (); it++)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   540
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   541
      os << *it << " ";
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   542
    }
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
   543
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   544
  os << " )";
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   545
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   547
uint32_t Ipv6ExtensionLooseRoutingHeader::GetSerializedSize () 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
   548
{
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
  return 8 + m_routersAddress.size () * 16;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   550
}
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
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   552
void Ipv6ExtensionLooseRoutingHeader::Serialize (Buffer::Iterator start) 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
   553
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   554
  Buffer::Iterator i = start;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   555
  uint8_t buff[16];
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   556
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   557
  i.WriteU8 (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
   558
  i.WriteU8 ((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
   559
  i.WriteU8 (GetTypeRouting ());
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   560
  i.WriteU8 (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
   561
  i.WriteU32 (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
   562
7252
c8200621e252 rerun check-style.py with uncrustify-0.58
Tom Henderson <tomh@tomh.org>
parents: 7176
diff changeset
   563
  for (VectorIpv6Address_t::const_iterator it = m_routersAddress.begin (); it != m_routersAddress.end (); it++)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   564
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   565
      it->Serialize (buff);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   566
      i.Write (buff, 16);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   567
    }
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
   568
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   569
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   570
uint32_t Ipv6ExtensionLooseRoutingHeader::Deserialize (Buffer::Iterator start) 
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   571
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   572
  Buffer::Iterator i = start;
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   573
  uint8_t buff[16];
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   574
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   575
  SetNextHeader (i.ReadU8 ());
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
  SetLength ((i.ReadU8 () + 1) << 3);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   577
  SetTypeRouting (i.ReadU8 ());
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   578
  SetSegmentsLeft (i.ReadU8 ());
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
  i.ReadU32 ();
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   580
5790
4917b74101f0 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5782
diff changeset
   581
  for (std::vector<Ipv6Address>::iterator it = m_routersAddress.begin (); it != m_routersAddress.end (); it++)
5809
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   582
    {
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   583
      i.Read (buff, 16);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   584
      it->Set (buff);
597070be3549 Coding style.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 5805
diff changeset
   585
    }
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
   586
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   587
  return 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
   588
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   589
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
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionESPHeader);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   591
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
TypeId Ipv6ExtensionESPHeader::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
   593
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   594
  static TypeId tid = TypeId ("ns3::Ipv6ExtensionESPHeader")
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   595
    .AddConstructor<Ipv6ExtensionESPHeader> ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   596
    .SetParent<Ipv6ExtensionHeader> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   597
  ;
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
   598
  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
   599
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   600
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   601
TypeId Ipv6ExtensionESPHeader::GetInstanceTypeId () 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
   602
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   603
  return 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
   604
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   605
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   606
Ipv6ExtensionESPHeader::Ipv6ExtensionESPHeader ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   607
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   608
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   609
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   610
Ipv6ExtensionESPHeader::~Ipv6ExtensionESPHeader ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   611
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   612
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   613
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   614
void Ipv6ExtensionESPHeader::Print (std::ostream &os) 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
   615
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   616
  /* TODO */
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   617
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   618
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   619
uint32_t Ipv6ExtensionESPHeader::GetSerializedSize () 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
   620
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   621
  /* TODO */
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   622
  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
   623
}
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
void Ipv6ExtensionESPHeader::Serialize (Buffer::Iterator start) 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
   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
  /* TODO */
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
uint32_t Ipv6ExtensionESPHeader::Deserialize (Buffer::Iterator start) 
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   631
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   632
  /* TODO */
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
  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
   634
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   635
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
NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionAHHeader);
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   637
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   638
TypeId Ipv6ExtensionAHHeader::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
   639
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   640
  static TypeId tid = TypeId ("ns3::Ipv6ExtensionAHHeader")
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
    .AddConstructor<Ipv6ExtensionAHHeader> ()
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
    .SetParent<Ipv6ExtensionHeader> ()
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   643
  ;
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
   644
  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
   645
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   646
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
TypeId Ipv6ExtensionAHHeader::GetInstanceTypeId () 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
   648
{
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
  return 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
   650
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   651
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
Ipv6ExtensionAHHeader::Ipv6ExtensionAHHeader ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   653
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   654
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   655
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
Ipv6ExtensionAHHeader::~Ipv6ExtensionAHHeader ()
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   657
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   658
}
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
void Ipv6ExtensionAHHeader::Print (std::ostream &os) 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
   661
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   662
  /* TODO */
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
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   664
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   665
uint32_t Ipv6ExtensionAHHeader::GetSerializedSize () 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
   666
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   667
  /* TODO */
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   668
  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
   669
}
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   670
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
void Ipv6ExtensionAHHeader::Serialize (Buffer::Iterator start) 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
   672
{
f5299c974f1b Add IPv6 extension files from old ns-3-ipv6 repository (not working yet).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents:
diff changeset
   673
  /* TODO */
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
uint32_t Ipv6ExtensionAHHeader::Deserialize (Buffer::Iterator start) 
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
  /* TODO */ 
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
  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
   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
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
} /* 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
   683