src/internet/model/tcp-l4-protocol.h
author Ken Renard <kdrenard2@gmail.com>
Mon, 20 Feb 2012 14:05:07 +0100
changeset 7717 cfa1741013dd
parent 7386 2310ed220a61
child 9095 8462a1160246
permissions -rw-r--r--
Add support for IPv6 transport protocols
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Mileti? <rivanvx@gmail.com>
parents: 7176
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
     2
/*
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
     3
 * Copyright (c) 2007 Georgia Tech Research Corporation
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
     4
 *
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
     8
 *
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    13
 *
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    17
 *
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    18
 * Author: Raj Bhattacharjea <raj.b@gatech.edu>
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    19
 */
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    20
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    21
#ifndef TCP_L4_PROTOCOL_H
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    22
#define TCP_L4_PROTOCOL_H
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    23
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    24
#include <stdint.h>
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    25
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    26
#include "ns3/packet.h"
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    27
#include "ns3/ipv4-address.h"
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    28
#include "ns3/ipv6-address.h"
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    29
#include "ns3/ptr.h"
2556
b13dd6239954 get rid of DefaultValue usage in internet-node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2542
diff changeset
    30
#include "ns3/object-factory.h"
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    31
#include "ip-l4-protocol.h"
5856
7fd20c798a7d bug 742: Implementation of SO_BINDTODEVICE
Antti M?kel? <zarhan@cc.hut.fi>
parents: 4741
diff changeset
    32
#include "ns3/net-device.h"
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    33
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    34
namespace ns3 {
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    35
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    36
class Node;
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    37
class Socket;
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    38
class TcpHeader;
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4558
diff changeset
    39
class Ipv4EndPointDemux;
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    40
class Ipv6EndPointDemux;
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4558
diff changeset
    41
class Ipv4Interface;
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 6445
diff changeset
    42
class TcpSocketBase;
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4558
diff changeset
    43
class Ipv4EndPoint;
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    44
class Ipv6EndPoint;
3266
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    45
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    46
/**
3691
372f4475dc47 Doxygen for internet-stack
Tom Henderson <tomh@tomh.org>
parents: 3588
diff changeset
    47
 * \ingroup tcp
3266
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    48
 * \brief A layer between the sockets interface and IP
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    49
 * 
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    50
 * This class allocates "endpoint" objects (ns3::Ipv4EndPoint) for TCP,
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    51
 * and SHOULD checksum packets its receives from the socket layer going down
6273
8d70de29d514 spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents: 6008
diff changeset
    52
 * the stack , but currently checksumming is disabled.  It also receives 
3266
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    53
 * packets from IP, and forwards them up to the endpoints.
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    54
*/
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    55
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    56
class TcpL4Protocol : public IpL4Protocol {
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    57
public:
2498
e01570293b98 convert InternetNode to Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2224
diff changeset
    58
  static TypeId GetTypeId (void);
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    59
  static const uint8_t PROT_NUMBER;
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    60
  /**
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    61
   * \brief Constructor
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    62
   */
2498
e01570293b98 convert InternetNode to Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2224
diff changeset
    63
  TcpL4Protocol ();
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    64
  virtual ~TcpL4Protocol ();
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    65
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2556
diff changeset
    66
  void SetNode (Ptr<Node> node);
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2556
diff changeset
    67
2498
e01570293b98 convert InternetNode to Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2224
diff changeset
    68
  virtual int GetProtocolNumber (void) const;
e01570293b98 convert InternetNode to Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2224
diff changeset
    69
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    70
  /**
6768
805f5fc7f670 remove stale doxygen and comments pertaining to TCP
Tom Henderson <tomh@tomh.org>
parents: 6723
diff changeset
    71
   * \return A smart Socket pointer to a TcpSocket allocated by this instance
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    72
   * of the TCP protocol
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    73
   */
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    74
  Ptr<Socket> CreateSocket (void);
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 6445
diff changeset
    75
  Ptr<Socket> CreateSocket (TypeId socketTypeId);
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    76
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    77
  Ipv4EndPoint *Allocate (void);
2608
408589d1dfff merge with HEAD
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2592
diff changeset
    78
  Ipv4EndPoint *Allocate (Ipv4Address address);
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    79
  Ipv4EndPoint *Allocate (uint16_t port);
2608
408589d1dfff merge with HEAD
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2592
diff changeset
    80
  Ipv4EndPoint *Allocate (Ipv4Address address, uint16_t port);
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    81
  Ipv4EndPoint *Allocate (Ipv4Address localAddress, uint16_t localPort,
2608
408589d1dfff merge with HEAD
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2592
diff changeset
    82
                          Ipv4Address peerAddress, uint16_t peerPort);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    83
  Ipv6EndPoint *Allocate6 (void);
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    84
  Ipv6EndPoint *Allocate6 (Ipv6Address address);
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    85
  Ipv6EndPoint *Allocate6 (uint16_t port);
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    86
  Ipv6EndPoint *Allocate6 (Ipv6Address address, uint16_t port);
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    87
  Ipv6EndPoint *Allocate6 (Ipv6Address localAddress, uint16_t localPort,
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    88
                           Ipv6Address peerAddress, uint16_t peerPort);
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    89
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    90
  void DeAllocate (Ipv4EndPoint *endPoint);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    91
  void DeAllocate (Ipv6EndPoint *endPoint);
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    92
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    93
  /**
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    94
   * \brief Send a packet via TCP
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    95
   * \param packet The packet to send
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    96
   * \param saddr The source Ipv4Address
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    97
   * \param daddr The destination Ipv4Address
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    98
   * \param sport The source port number
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
    99
   * \param dport The destination port number
6008
aa1c297a0de2 Fix non-undocumented warnings in doxygen, also update doxygen.conf
Josh Pelkey <jpelkey@gatech.edu>
parents: 5856
diff changeset
   100
   * \param oif The output interface bound. Defaults to null (unspecified).
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   101
   */
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   102
  void Send (Ptr<Packet> packet,
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   103
             Ipv4Address saddr, Ipv4Address daddr, 
5856
7fd20c798a7d bug 742: Implementation of SO_BINDTODEVICE
Antti M?kel? <zarhan@cc.hut.fi>
parents: 4741
diff changeset
   104
             uint16_t sport, uint16_t dport, Ptr<NetDevice> oif = 0);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   105
  void Send (Ptr<Packet> packet,
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   106
             Ipv6Address saddr, Ipv6Address daddr, 
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   107
             uint16_t sport, uint16_t dport, Ptr<NetDevice> oif = 0);
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   108
  /**
6273
8d70de29d514 spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents: 6008
diff changeset
   109
   * \brief Receive a packet up the protocol stack
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   110
   * \param p The Packet to dump the contents into
6442
f380cf1aa4d8 Bug 671 add packet-info-tag.cc for IP_PKTINFO/IPV6_PKTINFO
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents: 6273
diff changeset
   111
   * \param header IPv4 Header information
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   112
   * \param incomingInterface The Ipv4Interface it was received on
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   113
   */
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   114
  virtual enum IpL4Protocol::RxStatus Receive (Ptr<Packet> p,
6442
f380cf1aa4d8 Bug 671 add packet-info-tag.cc for IP_PKTINFO/IPV6_PKTINFO
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents: 6273
diff changeset
   115
                                                 Ipv4Header const &header,
3820
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3691
diff changeset
   116
                                                 Ptr<Ipv4Interface> incomingInterface);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   117
  virtual enum IpL4Protocol::RxStatus Receive (Ptr<Packet> p,
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   118
                                                 Ipv6Address &src,
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   119
                                                 Ipv6Address &dst,
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   120
                                                 Ptr<Ipv6Interface> interface);
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   121
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   122
  // From IpL4Protocol
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   123
  virtual void SetDownTarget (IpL4Protocol::DownTargetCallback cb);
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   124
  virtual void SetDownTarget6 (IpL4Protocol::DownTargetCallback6 cb);
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   125
  // From IpL4Protocol
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   126
  virtual IpL4Protocol::DownTargetCallback GetDownTarget (void) const;
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   127
  virtual IpL4Protocol::DownTargetCallback6 GetDownTarget6 (void) const;
6723
fff5c512f345 bug 967: decouple Ipv4L4Protocols from Ipv4L3Protocol::Send() via a new callback
Tom Henderson <tomh@tomh.org>
parents: 6694
diff changeset
   128
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   129
protected:
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   130
  virtual void DoDispose (void);
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4283
diff changeset
   131
  /* 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4283
diff changeset
   132
   * This function will notify other components connected to the node that a new stack member is now connected
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4283
diff changeset
   133
   * This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4283
diff changeset
   134
   */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4283
diff changeset
   135
  virtual void NotifyNewAggregate ();
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   136
private:
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   137
  Ptr<Node> m_node;
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   138
  Ipv4EndPointDemux *m_endPoints;
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   139
  Ipv6EndPointDemux *m_endPoints6;
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 6445
diff changeset
   140
  TypeId m_rttTypeId;
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 6445
diff changeset
   141
  TypeId m_socketTypeId;
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   142
private:
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 6445
diff changeset
   143
  friend class TcpSocketBase;
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4558
diff changeset
   144
  void SendPacket (Ptr<Packet>, const TcpHeader &,
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   145
                   Ipv4Address, Ipv4Address, Ptr<NetDevice> oif = 0);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   146
  void SendPacket (Ptr<Packet>, const TcpHeader &,
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   147
                   Ipv6Address, Ipv6Address, Ptr<NetDevice> oif = 0);
4741
ae4aa2deec45 Make some copy-constructors private, remove not implemented method declarations, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 4740
diff changeset
   148
  TcpL4Protocol (const TcpL4Protocol &o);
ae4aa2deec45 Make some copy-constructors private, remove not implemented method declarations, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 4740
diff changeset
   149
  TcpL4Protocol &operator = (const TcpL4Protocol &o);
3363
33d1ca2e4ba4 bug 236: add optional support for tcp and udp checksum.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 3266
diff changeset
   150
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 6445
diff changeset
   151
  std::vector<Ptr<TcpSocketBase> > m_sockets;
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   152
  IpL4Protocol::DownTargetCallback m_downTarget;
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   153
  IpL4Protocol::DownTargetCallback6 m_downTarget6;
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   154
};
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   155
7386
2310ed220a61 standardize ns-3 namespace declaration format
Vedran Mileti? <rivanvx@gmail.com>
parents: 7385
diff changeset
   156
} // namespace ns3
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   157
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
diff changeset
   158
#endif /* TCP_L4_PROTOCOL_H */