src/internet-node/udp-impl.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 11 Mar 2008 13:30:12 -0700
changeset 2592 3ebf97150166
parent 2190 7f2b719b67fb
child 2834 1aab57845b07
permissions -rw-r--r--
get rid of CreateObjectWith
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
 * All rights reserved.
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 *
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * 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
     7
 * 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
     8
 * published by the Free Software Foundation;
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 *
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * 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
    11
 * 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
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 * GNU General Public License for more details.
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 *
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * 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
    16
 * 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
    17
 * 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
    18
 *
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
 */
744
0e71bc5a2646 preprocessor update
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 743
diff changeset
    21
#ifndef UDP_IMPL_H
0e71bc5a2646 preprocessor update
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 743
diff changeset
    22
#define UDP_IMPL_H
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
749
c99970fa054a i-udp.h -> udp.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 744
diff changeset
    24
#include "ns3/udp.h"
568
e1660959ecbb use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 524
diff changeset
    25
#include "ns3/ptr.h"
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
namespace ns3 {
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
742
b73f8e30c75e Udp -> UdpL4Protocol
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 739
diff changeset
    29
class UdpL4Protocol;
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
2179
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    31
/**
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    32
 * \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
    33
 * \internal
2179
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    34
 *
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    35
 * This class implements the API for UDP sockets.
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    36
 * It is a socket factory (deriving from class SocketFactory) and can
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    37
 * also hold global variables used to initialize newly created sockets, 
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    38
 * such as values that are set through the sysctl or proc interfaces in Linux.
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    39
 */
750
88b27f4950c8 IUdp -> Udp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 749
diff changeset
    40
class UdpImpl : public Udp
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
{
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
public:
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2190
diff changeset
    43
  UdpImpl ();
743
d08395dba78c IUdpImpl -> UdpImpl
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 742
diff changeset
    44
  virtual ~UdpImpl ();
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
2592
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2190
diff changeset
    46
  void SetUdp (Ptr<UdpL4Protocol> udp);
3ebf97150166 get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2190
diff changeset
    47
2179
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    48
  /**
2190
7f2b719b67fb add internal keyword to udp-impl documentation
Tom Henderson <tomh@tomh.org>
parents: 2179
diff changeset
    49
   * \brief Implements a method to create a UdpImpl-based socket and return
7f2b719b67fb add internal keyword to udp-impl documentation
Tom Henderson <tomh@tomh.org>
parents: 2179
diff changeset
    50
   * 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
    51
   * \internal
7f2b719b67fb add internal keyword to udp-impl documentation
Tom Henderson <tomh@tomh.org>
parents: 2179
diff changeset
    52
   *
2179
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    53
   * \return smart pointer to Socket
9b58bef0a7ff Doxygen the SocketFactory classes
Tom Henderson <tomh@tomh.org>
parents: 750
diff changeset
    54
   */
568
e1660959ecbb use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 524
diff changeset
    55
  virtual Ptr<Socket> CreateSocket (void);
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    56
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    57
protected:
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
  virtual void DoDispose (void);
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
private:
742
b73f8e30c75e Udp -> UdpL4Protocol
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 739
diff changeset
    60
  Ptr<UdpL4Protocol> m_udp;
519
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
};
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    62
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    63
} // namespace ns3
b045a3ab4595 define and implement IUdp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    64
744
0e71bc5a2646 preprocessor update
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 743
diff changeset
    65
#endif /* UDP_IMPL_H */