A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
bulk-send-application.h
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 Georgia Institute of Technology
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: George F. Riley <riley@ece.gatech.edu>
19
*/
20
21
#ifndef BULK_SEND_APPLICATION_H
22
#define BULK_SEND_APPLICATION_H
23
24
#include "ns3/address.h"
25
#include "ns3/application.h"
26
#include "ns3/event-id.h"
27
#include "ns3/ptr.h"
28
#include "ns3/traced-callback.h"
29
30
namespace
ns3 {
31
32
class
Address;
33
class
Socket;
34
50
class
BulkSendApplication
:
public
Application
51
{
52
public
:
53
static
TypeId
GetTypeId (
void
);
54
55
BulkSendApplication
();
56
57
virtual
~
BulkSendApplication
();
58
71
void
SetMaxBytes
(uint32_t maxBytes);
72
76
Ptr<Socket>
GetSocket
(
void
)
const
;
77
78
protected
:
79
virtual
void
DoDispose
(
void
);
80
private
:
81
// inherited from Application base class.
82
virtual
void
StartApplication
(
void
);
// Called at time specified by Start
83
virtual
void
StopApplication
(
void
);
// Called at time specified by Stop
84
85
void
SendData ();
86
87
Ptr<Socket>
m_socket;
// Associated socket
88
Address
m_peer;
// Peer address
89
bool
m_connected;
// True if connected
90
uint32_t m_sendSize;
// Size of data to send each time
91
uint32_t m_maxBytes;
// Limit total number of bytes sent
92
uint32_t m_totBytes;
// Total bytes sent so far
93
TypeId
m_tid;
94
TracedCallback<Ptr<const Packet>
> m_txTrace;
95
96
private
:
97
void
ConnectionSucceeded (
Ptr<Socket>
socket);
98
void
ConnectionFailed (
Ptr<Socket>
socket);
99
void
DataSend (
Ptr<Socket>
, uint32_t);
// for socket's SetSendCallback
100
void
Ignore (
Ptr<Socket>
socket);
101
};
102
103
}
// namespace ns3
104
105
#endif
/* BULK_SEND_APPLICATION_H */
ns3::Ptr< Socket >
ns3::TracedCallback
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
Definition:
traced-callback.h:43
ns3::BulkSendApplication::DoDispose
virtual void DoDispose(void)
Definition:
bulk-send-application.cc:101
ns3::Address
a polymophic address class
Definition:
address.h:86
ns3::BulkSendApplication::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
bulk-send-application.cc:152
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::BulkSendApplication
Definition:
bulk-send-application.h:50
ns3::BulkSendApplication::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
bulk-send-application.cc:111
ns3::BulkSendApplication::SetMaxBytes
void SetMaxBytes(uint32_t maxBytes)
Definition:
bulk-send-application.cc:87
ns3::BulkSendApplication::GetSocket
Ptr< Socket > GetSocket(void) const
Definition:
bulk-send-application.cc:94
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:44
src
applications
model
bulk-send-application.h
Generated on Sun Mar 16 2014 11:25:01 for ns-3 by
1.8.6