src/internet-stack/udp-socket-factory-impl.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 09 Jun 2008 15:40:22 -0700
changeset 3260 8c0ab08144e6
parent 3126 src/internet-node/udp-socket-factory-impl.h@68d35477a842
child 3691 372f4475dc47
permissions -rw-r--r--
bug 186: internet-node directory must be renamed to internet-stack
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2007 INRIA
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 *
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 *
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 */
3126
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    20
#ifndef UDP_SOCKET_FACTORY_IMPL_H
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    21
#define UDP_SOCKET_FACTORY_IMPL_H
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
3125
d2d8a36cfd23 s/ns3::Udp/ns3::UdpSocketFactory
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    23
#include "ns3/udp-socket-factory.h"
568
e1660959ecbb use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 524
diff changeset
    24
#include "ns3/ptr.h"
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
namespace ns3 {
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
742
b73f8e30c75e Udp -> UdpL4Protocol
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 739
diff changeset
    28
class UdpL4Protocol;
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
2179
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    30
/**
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    31
 * \brief Object to create UDP socket instances 
2190
7f2b719b67fb add internal keyword to udp-impl documentation
Tom Henderson <tomh@tomh.org>
parents: 2179
diff changeset
    32
 * \internal
2179
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    33
 *
3126
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    34
 * This class implements the API for creating UDP sockets.
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    35
 * It is a socket factory (deriving from class SocketFactory).
2179
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    36
 */
3126
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    37
class UdpSocketFactoryImpl : public UdpSocketFactory
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    38
{
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
public:
3126
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    40
  UdpSocketFactoryImpl ();
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    41
  virtual ~UdpSocketFactoryImpl ();
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2190
diff changeset
    43
  void SetUdp (Ptr<UdpL4Protocol> udp);
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2190
diff changeset
    44
2179
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    45
  /**
3126
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    46
   * \brief Implements a method to create a Udp-based socket and return
2190
7f2b719b67fb add internal keyword to udp-impl documentation
Tom Henderson <tomh@tomh.org>
parents: 2179
diff changeset
    47
   * a base class smart pointer to the socket.
7f2b719b67fb add internal keyword to udp-impl documentation
Tom Henderson <tomh@tomh.org>
parents: 2179
diff changeset
    48
   * \internal
7f2b719b67fb add internal keyword to udp-impl documentation
Tom Henderson <tomh@tomh.org>
parents: 2179
diff changeset
    49
   *
2179
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    50
   * \return smart pointer to Socket
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    51
   */
568
e1660959ecbb use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 524
diff changeset
    52
  virtual Ptr<Socket> CreateSocket (void);
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    53
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
protected:
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    55
  virtual void DoDispose (void);
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    56
private:
742
b73f8e30c75e Udp -> UdpL4Protocol
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 739
diff changeset
    57
  Ptr<UdpL4Protocol> m_udp;
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
};
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
} // namespace ns3
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
3126
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
    62
#endif /* UDP_SOCKET_FACTORY_IMPL_H */