src/internet/model/udp-socket-impl.h
author Ken Renard <kdrenard2@gmail.com>
Mon, 20 Feb 2012 14:05:07 +0100
changeset 7717 cfa1741013dd
parent 7386 2310ed220a61
child 7747 53a26ce38807
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: 7256
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2007 INRIA
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 *
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 *
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 */
3130
881cc06cd651 rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents: 3129
diff changeset
    20
#ifndef UDP_SOCKET_IMPL_H
881cc06cd651 rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents: 3129
diff changeset
    21
#define UDP_SOCKET_IMPL_H
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
#include <stdint.h>
3097
1b1661bbfa33 Plumb in socket receive pull model, in parallel to existing Receive framework
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    24
#include <queue>
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include "ns3/callback.h"
3105
682950a37ea6 Add GetTxBuffer; add some socket options; make limited UDP receive buffer functional
Tom Henderson <tomh@tomh.org>
parents: 3104
diff changeset
    26
#include "ns3/traced-callback.h"
524
082ffdd8fbd7 move code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 520
diff changeset
    27
#include "ns3/socket.h"
557
927a5bb6432a convert UdpSocket and Udp to Ptr<Node>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 524
diff changeset
    28
#include "ns3/ptr.h"
1162
10f9613bd9be convert Socket to use Address class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 742
diff changeset
    29
#include "ns3/ipv4-address.h"
3130
881cc06cd651 rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents: 3129
diff changeset
    30
#include "ns3/udp-socket.h"
6442
f380cf1aa4d8 Bug 671 add packet-info-tag.cc for IP_PKTINFO/IPV6_PKTINFO
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents: 6439
diff changeset
    31
#include "ns3/ipv4-interface.h"
3820
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3778
diff changeset
    32
#include "icmpv4.h"
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
namespace ns3 {
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
495
a839408950b9 rework the socket/udp layer to remove the Ipv4EndPointDemux template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 487
diff changeset
    36
class Ipv4EndPoint;
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    37
class Ipv6EndPoint;
728
95c426b1cb60 rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 607
diff changeset
    38
class Node;
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
class Packet;
742
b73f8e30c75e Udp -> UdpL4Protocol
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
    40
class UdpL4Protocol;
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
3266
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    42
/**
3691
372f4475dc47 Doxygen for internet-stack
Tom Henderson <tomh@tomh.org>
parents: 3272
diff changeset
    43
 * \ingroup udp
3266
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    44
 * \brief A sockets interface to UDP
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    45
 * 
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    46
 * This class subclasses ns3::UdpSocket, and provides a socket interface
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    47
 * to ns3's implementation of UDP.
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    48
 */
1ae7df5cf87b Update the internet-stack documentation
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 3260
diff changeset
    49
3130
881cc06cd651 rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents: 3129
diff changeset
    50
class UdpSocketImpl : public UdpSocket
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    51
{
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    52
public:
3105
682950a37ea6 Add GetTxBuffer; add some socket options; make limited UDP receive buffer functional
Tom Henderson <tomh@tomh.org>
parents: 3104
diff changeset
    53
  static TypeId GetTypeId (void);
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
  /**
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    55
   * Create an unbound udp socket.
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    56
   */
3130
881cc06cd651 rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents: 3129
diff changeset
    57
  UdpSocketImpl ();
881cc06cd651 rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents: 3129
diff changeset
    58
  virtual ~UdpSocketImpl ();
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1866
diff changeset
    60
  void SetNode (Ptr<Node> node);
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1866
diff changeset
    61
  void SetUdp (Ptr<UdpL4Protocol> udp);
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1866
diff changeset
    62
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    63
  virtual enum SocketErrno GetErrno (void) const;
6689
e2de571e920a Implement Socket::GetSocketType
Josh Pelkey <jpelkey@gatech.edu>
parents: 6448
diff changeset
    64
  virtual enum SocketType GetSocketType (void) const;
728
95c426b1cb60 rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 607
diff changeset
    65
  virtual Ptr<Node> GetNode (void) const;
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    66
  virtual int Bind (void);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    67
  virtual int Bind6 (void);
1162
10f9613bd9be convert Socket to use Address class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 742
diff changeset
    68
  virtual int Bind (const Address &address);
1264
577875bb5a65 split callback registration from socket operations in socket.h API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1186
diff changeset
    69
  virtual int Close (void);
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    70
  virtual int ShutdownSend (void);
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    71
  virtual int ShutdownRecv (void);
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7176
diff changeset
    72
  virtual int Connect (const Address &address);
3772
f0d8608ab155 Remove queue limit from listen
Craig Dowell <craigdo@ee.washington.edu>
parents: 3691
diff changeset
    73
  virtual int Listen (void);
3105
682950a37ea6 Add GetTxBuffer; add some socket options; make limited UDP receive buffer functional
Tom Henderson <tomh@tomh.org>
parents: 3104
diff changeset
    74
  virtual uint32_t GetTxAvailable (void) const;
3269
448134601b03 RecvFrom() expansion, add flags parameter to some Send calls
Tom Henderson <tomh@tomh.org>
parents: 3213
diff changeset
    75
  virtual int Send (Ptr<Packet> p, uint32_t flags);
448134601b03 RecvFrom() expansion, add flags parameter to some Send calls
Tom Henderson <tomh@tomh.org>
parents: 3213
diff changeset
    76
  virtual int SendTo (Ptr<Packet> p, uint32_t flags, const Address &address);
448134601b03 RecvFrom() expansion, add flags parameter to some Send calls
Tom Henderson <tomh@tomh.org>
parents: 3213
diff changeset
    77
  virtual uint32_t GetRxAvailable (void) const;
3097
1b1661bbfa33 Plumb in socket receive pull model, in parallel to existing Receive framework
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    78
  virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags);
3269
448134601b03 RecvFrom() expansion, add flags parameter to some Send calls
Tom Henderson <tomh@tomh.org>
parents: 3213
diff changeset
    79
  virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags,
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    80
                                Address &fromAddress);
3778
78c4c41557f3 Liu's GetSockName patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3772
diff changeset
    81
  virtual int GetSockName (Address &address) const; 
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    82
  virtual int MulticastJoinGroup (uint32_t interfaceIndex, const Address &groupAddress);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    83
  virtual int MulticastLeaveGroup (uint32_t interfaceIndex, const Address &groupAddress);
5856
7fd20c798a7d bug 742: Implementation of SO_BINDTODEVICE
Antti M?kel? <zarhan@cc.hut.fi>
parents: 4472
diff changeset
    84
  virtual void BindToNetDevice (Ptr<NetDevice> netdevice);
6448
184a509cc71d Still Bug 943: fix UdpSocketImpl::GetAllowBroadcast, let Socket::SetAllowBroadcast return a bool indicating success/failure, instead of a fatal error.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6442
diff changeset
    85
  virtual bool SetAllowBroadcast (bool allowBroadcast);
6437
c11291f51d57 Bug 943 - Add a SO_BROADCAST socket option
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 5971
diff changeset
    86
  virtual bool GetAllowBroadcast () const;
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    87
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3130
diff changeset
    88
private:
3127
f5971b43ee58 Add attributes to new abstract base class for UdpSocket
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    89
  // Attributes set through UdpSocket base class 
f5971b43ee58 Add attributes to new abstract base class for UdpSocket
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    90
  virtual void SetRcvBufSize (uint32_t size);
f5971b43ee58 Add attributes to new abstract base class for UdpSocket
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    91
  virtual uint32_t GetRcvBufSize (void) const;
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    92
  virtual void SetIpTtl (uint8_t ipTtl);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    93
  virtual uint8_t GetIpTtl (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    94
  virtual void SetIpMulticastTtl (uint8_t ipTtl);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    95
  virtual uint8_t GetIpMulticastTtl (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    96
  virtual void SetIpMulticastIf (int32_t ipIf);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    97
  virtual int32_t GetIpMulticastIf (void) const;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    98
  virtual void SetIpMulticastLoop (bool loop);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
    99
  virtual bool GetIpMulticastLoop (void) const;
3820
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3778
diff changeset
   100
  virtual void SetMtuDiscover (bool discover);
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3778
diff changeset
   101
  virtual bool GetMtuDiscover (void) const;
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3778
diff changeset
   102
3127
f5971b43ee58 Add attributes to new abstract base class for UdpSocket
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
   103
3125
d2d8a36cfd23 s/ns3::Udp/ns3::UdpSocketFactory
Tom Henderson <tomh@tomh.org>
parents: 3124
diff changeset
   104
  friend class UdpSocketFactory;
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   105
  // invoked by Udp class
495
a839408950b9 rework the socket/udp layer to remove the Ipv4EndPointDemux template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 487
diff changeset
   106
  int FinishBind (void);
6442
f380cf1aa4d8 Bug 671 add packet-info-tag.cc for IP_PKTINFO/IPV6_PKTINFO
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents: 6439
diff changeset
   107
  void ForwardUp (Ptr<Packet> p, Ipv4Header header, uint16_t port, 
f380cf1aa4d8 Bug 671 add packet-info-tag.cc for IP_PKTINFO/IPV6_PKTINFO
Hajime Tazaki <tazaki@sfc.wide.ad.jp>
parents: 6439
diff changeset
   108
                  Ptr<Ipv4Interface> incomingInterface);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   109
  void ForwardUp6 (Ptr<Packet> p, Ipv6Address saddr, Ipv6Address daddr, uint16_t port);
496
894c8380d57b use Dispose more extensively
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 495
diff changeset
   110
  void Destroy (void);
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1317
diff changeset
   111
  int DoSend (Ptr<Packet> p);
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1317
diff changeset
   112
  int DoSendTo (Ptr<Packet> p, const Address &daddr);
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1317
diff changeset
   113
  int DoSendTo (Ptr<Packet> p, Ipv4Address daddr, uint16_t dport);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   114
  int DoSendTo (Ptr<Packet> p, Ipv6Address daddr, uint16_t dport);
3820
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3778
diff changeset
   115
  void ForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, 
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3778
diff changeset
   116
                    uint8_t icmpType, uint8_t icmpCode,
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3778
diff changeset
   117
                    uint32_t icmpInfo);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   118
  void ForwardIcmp6 (Ipv6Address icmpSource, uint8_t icmpTtl, 
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   119
                     uint8_t icmpType, uint8_t icmpCode,
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   120
                     uint32_t icmpInfo);
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   121
495
a839408950b9 rework the socket/udp layer to remove the Ipv4EndPointDemux template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 487
diff changeset
   122
  Ipv4EndPoint *m_endPoint;
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   123
  Ipv6EndPoint *m_endPoint6;
728
95c426b1cb60 rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 607
diff changeset
   124
  Ptr<Node> m_node;
742
b73f8e30c75e Udp -> UdpL4Protocol
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
   125
  Ptr<UdpL4Protocol> m_udp;
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   126
  Address m_defaultAddress;
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   127
  uint16_t m_defaultPort;
3105
682950a37ea6 Add GetTxBuffer; add some socket options; make limited UDP receive buffer functional
Tom Henderson <tomh@tomh.org>
parents: 3104
diff changeset
   128
  TracedCallback<Ptr<const Packet> > m_dropTrace;
682950a37ea6 Add GetTxBuffer; add some socket options; make limited UDP receive buffer functional
Tom Henderson <tomh@tomh.org>
parents: 3104
diff changeset
   129
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   130
  enum SocketErrno m_errno;
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   131
  bool m_shutdownSend;
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   132
  bool m_shutdownRecv;
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   133
  bool m_connected;
6439
958a299f1100 Enforce the AllowBroadcast socket option for UDP sockets
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6437
diff changeset
   134
  bool m_allowBroadcast;
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   135
3097
1b1661bbfa33 Plumb in socket receive pull model, in parallel to existing Receive framework
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
   136
  std::queue<Ptr<Packet> > m_deliveryQueue;
3104
24d9d9aa0977 Implement GetRxAvailable ()
Tom Henderson <tomh@tomh.org>
parents: 3097
diff changeset
   137
  uint32_t m_rxAvailable;
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   138
3127
f5971b43ee58 Add attributes to new abstract base class for UdpSocket
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
   139
  // Socket attributes
3123
fae57a467d54 undo SocketDefaults class; plumb in new UdpSocket option attributes
Tom Henderson <tomh@tomh.org>
parents: 3120
diff changeset
   140
  uint32_t m_rcvBufSize;
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
   141
  uint8_t m_ipTtl;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
   142
  uint8_t m_ipMulticastTtl;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
   143
  int32_t m_ipMulticastIf;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4281
diff changeset
   144
  bool m_ipMulticastLoop;
3820
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3778
diff changeset
   145
  bool m_mtuDiscover;
c04ecfdce1ef apply icmp patch
Craig Dowell <craigdo@ee.washington.edu>
parents: 3778
diff changeset
   146
  Callback<void, Ipv4Address,uint8_t,uint8_t,uint8_t,uint32_t> m_icmpCallback;
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   147
  Callback<void, Ipv6Address,uint8_t,uint8_t,uint8_t,uint32_t> m_icmpCallback6;
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   148
};
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   149
7386
2310ed220a61 standardize ns-3 namespace declaration format
Vedran Mileti? <rivanvx@gmail.com>
parents: 7385
diff changeset
   150
} // namespace ns3
453
ddbb935800d8 remove DatagramSocket, use Socket base class for UdpSocket subclass.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   151
3130
881cc06cd651 rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents: 3129
diff changeset
   152
#endif /* UDP_SOCKET_IMPL_H */