author | Pavel Boyko <boyko@iitp.ru> |
Fri, 03 Jul 2009 12:02:30 +0400 | |
changeset 5102 | 0bb1dd1c301d |
parent 5001 | 8d4a10415c7f |
permissions | -rw-r--r-- |
1497 | 1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright 2007 University of Washington |
|
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 |
||
19 |
#ifndef __UDP_ECHO_SERVER_H__ |
|
20 |
#define __UDP_ECHO_SERVER_H__ |
|
21 |
||
22 |
#include "ns3/application.h" |
|
23 |
#include "ns3/event-id.h" |
|
24 |
#include "ns3/ptr.h" |
|
2764
51aaeee97290
fix missing includes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2494
diff
changeset
|
25 |
#include "ns3/address.h" |
1497 | 26 |
|
27 |
namespace ns3 { |
|
28 |
||
29 |
class Socket; |
|
30 |
class Packet; |
|
31 |
||
2962
39f72ca0ba8e
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2764
diff
changeset
|
32 |
/** |
3264 | 33 |
* \ingroup applications |
34 |
* \defgroup udpecho UdpEcho |
|
35 |
*/ |
|
36 |
||
37 |
/** |
|
38 |
* \ingroup udpecho |
|
2962
39f72ca0ba8e
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2764
diff
changeset
|
39 |
* \brief A Udp Echo server |
39f72ca0ba8e
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2764
diff
changeset
|
40 |
* |
39f72ca0ba8e
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2764
diff
changeset
|
41 |
* Every packet received is sent back. |
39f72ca0ba8e
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2764
diff
changeset
|
42 |
*/ |
1497 | 43 |
class UdpEchoServer : public Application |
44 |
{ |
|
45 |
public: |
|
2494
1c69ea12779c
port Applications to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1866
diff
changeset
|
46 |
static TypeId GetTypeId (void); |
1c69ea12779c
port Applications to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1866
diff
changeset
|
47 |
UdpEchoServer (); |
1497 | 48 |
virtual ~UdpEchoServer (); |
49 |
||
50 |
protected: |
|
51 |
virtual void DoDispose (void); |
|
52 |
||
53 |
private: |
|
54 |
||
55 |
virtual void StartApplication (void); |
|
56 |
virtual void StopApplication (void); |
|
57 |
||
3098
d384d52f8f6e
Cut over UDP applications to use the new receive API
Tom Henderson <tomh@tomh.org>
parents:
2962
diff
changeset
|
58 |
void HandleRead (Ptr<Socket> socket); |
1497 | 59 |
|
1500
895ed42278d3
finish up basic echo apps
Craig Dowell <craigdo@ee.washington.edu>
parents:
1497
diff
changeset
|
60 |
uint16_t m_port; |
1497 | 61 |
Ptr<Socket> m_socket; |
1500
895ed42278d3
finish up basic echo apps
Craig Dowell <craigdo@ee.washington.edu>
parents:
1497
diff
changeset
|
62 |
Address m_local; |
1497 | 63 |
}; |
64 |
||
65 |
} // namespace ns3 |
|
66 |
||
67 |
#endif // __UDP_ECHO_SERVER_H__ |
|
68 |