src/helper/udp-echo-helper.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 12 Jun 2009 13:44:19 -0700
changeset 4560 2f106fd728ab
parent 4140 6bbf05bf4826
child 4577 84c133267507
permissions -rw-r--r--
Remove static routing dependencies in code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2833
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
     2
/*
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
     3
 * Copyright (c) 2008 INRIA
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
     4
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
     7
 * published by the Free Software Foundation;
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
     8
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    12
 * GNU General Public License for more details.
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    13
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    14
 * You should have received a copy of the GNU General Public License
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    15
 * along with this program; if not, write to the Free Software
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    17
 *
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
f3474fd850b2 add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2767
diff changeset
    19
 */
2767
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
#ifndef UDP_ECHO_HELPER_H
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
#define UDP_ECHO_HELPER_H
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
#include <stdint.h>
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include "application-container.h"
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include "node-container.h"
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
#include "ns3/object-factory.h"
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
#include "ns3/ipv4-address.h"
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
namespace ns3 {
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
class UdpEchoServerHelper
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
{
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
public:
3382
d5f8e5fae1c6 fix bug 234 which changes required methods on helpers to constructor parameters. Update tutorial content to reflect. Change RemoteIpv4 attribute to RemoteAddress.
Craig Dowell <craigdo@ee.washington.edu>
parents: 2965
diff changeset
    34
  UdpEchoServerHelper (uint16_t port);
d5f8e5fae1c6 fix bug 234 which changes required methods on helpers to constructor parameters. Update tutorial content to reflect. Change RemoteIpv4 attribute to RemoteAddress.
Craig Dowell <craigdo@ee.washington.edu>
parents: 2965
diff changeset
    35
d5f8e5fae1c6 fix bug 234 which changes required methods on helpers to constructor parameters. Update tutorial content to reflect. Change RemoteIpv4 attribute to RemoteAddress.
Craig Dowell <craigdo@ee.washington.edu>
parents: 2965
diff changeset
    36
  void SetAttribute (std::string name, const AttributeValue &value);
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    37
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    38
  ApplicationContainer Install (Ptr<Node> node) const;
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
    39
  ApplicationContainer Install (std::string nodeName) const;
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    40
  ApplicationContainer Install (NodeContainer c) const;
3382
d5f8e5fae1c6 fix bug 234 which changes required methods on helpers to constructor parameters. Update tutorial content to reflect. Change RemoteIpv4 attribute to RemoteAddress.
Craig Dowell <craigdo@ee.washington.edu>
parents: 2965
diff changeset
    41
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    42
private:
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    43
  Ptr<Application> InstallPriv (Ptr<Node> node) const;
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    44
3382
d5f8e5fae1c6 fix bug 234 which changes required methods on helpers to constructor parameters. Update tutorial content to reflect. Change RemoteIpv4 attribute to RemoteAddress.
Craig Dowell <craigdo@ee.washington.edu>
parents: 2965
diff changeset
    45
  ObjectFactory m_factory;
2767
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    46
};
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    47
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
class UdpEchoClientHelper
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    49
{
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    50
public:
3382
d5f8e5fae1c6 fix bug 234 which changes required methods on helpers to constructor parameters. Update tutorial content to reflect. Change RemoteIpv4 attribute to RemoteAddress.
Craig Dowell <craigdo@ee.washington.edu>
parents: 2965
diff changeset
    51
  UdpEchoClientHelper (Ipv4Address ip, uint16_t port);
2767
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    52
3382
d5f8e5fae1c6 fix bug 234 which changes required methods on helpers to constructor parameters. Update tutorial content to reflect. Change RemoteIpv4 attribute to RemoteAddress.
Craig Dowell <craigdo@ee.washington.edu>
parents: 2965
diff changeset
    53
  void SetAttribute (std::string name, const AttributeValue &value);
d5f8e5fae1c6 fix bug 234 which changes required methods on helpers to constructor parameters. Update tutorial content to reflect. Change RemoteIpv4 attribute to RemoteAddress.
Craig Dowell <craigdo@ee.washington.edu>
parents: 2965
diff changeset
    54
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    55
  ApplicationContainer Install (Ptr<Node> node) const;
4140
6bbf05bf4826 Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents: 3848
diff changeset
    56
  ApplicationContainer Install (std::string nodeName) const;
3848
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    57
  ApplicationContainer Install (NodeContainer c) const;
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    58
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    59
private:
affd0834debc address bug 393 (need to overload Install methods for python)
Craig Dowell <craigdo@ee.washington.edu>
parents: 3382
diff changeset
    60
  Ptr<Application> InstallPriv (Ptr<Node> node) const;
2767
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
  ObjectFactory m_factory;
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    62
};
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    63
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    64
} // namespace ns3
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    65
c934b4adb8d5 helper for UdpEcho client and server
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    66
#endif /* UDP_ECHO_HELPER_H */