A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ping-helper.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Universita' di Firenze, Italy
3 * Copyright (c) 2008-2009 Strasbourg University (original Ping6 helper)
4 * Copyright (c) 2008 INRIA (original v4Ping helper)
5 *
6 * SPDX-License-Identifier: GPL-2.0-only
7 *
8 * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
9 *
10 * Derived from original v4Ping helper (author: Mathieu Lacage)
11 * Derived from original ping6 helper (author: Sebastien Vincent)
12 */
13
14#include "ping-helper.h"
15
16namespace ns3
17{
18
20 : ApplicationHelper("ns3::Ping")
21{
22}
23
24PingHelper::PingHelper(const Address& remote, const Address& local)
25 : ApplicationHelper("ns3::Ping")
26{
27 m_factory.Set("Destination", AddressValue(remote));
28 m_factory.Set("InterfaceAddress", AddressValue(local));
29}
30
31} // namespace ns3
a polymophic address class
Definition address.h:90
A helper to make it easier to instantiate an application on a set of nodes.
ObjectFactory m_factory
Object factory.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
PingHelper()
Create a PingHelper which is used to make life easier for people wanting to use ping Applications.
Every class exported by the ns3 library is enclosed in the ns3 namespace.