author | Craig Dowell <craigdo@ee.washington.edu> |
Wed, 29 Oct 2008 11:18:39 -0700 | |
changeset 3820 | c04ecfdce1ef |
parent 3130 | 881cc06cd651 |
child 4472 | e20a31541404 |
permissions | -rw-r--r-- |
3129 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2007 INRIA |
|
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
|
19 |
*/ |
|
20 |
||
21 |
#include "ns3/object.h" |
|
22 |
#include "ns3/log.h" |
|
23 |
#include "ns3/uinteger.h" |
|
3820 | 24 |
#include "ns3/boolean.h" |
3129 | 25 |
#include "ns3/trace-source-accessor.h" |
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
26 |
#include "udp-socket.h" |
3129 | 27 |
|
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
28 |
NS_LOG_COMPONENT_DEFINE ("UdpSocket"); |
3129 | 29 |
|
30 |
namespace ns3 { |
|
31 |
||
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
32 |
NS_OBJECT_ENSURE_REGISTERED (UdpSocket); |
3129 | 33 |
|
34 |
TypeId |
|
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
35 |
UdpSocket::GetTypeId (void) |
3129 | 36 |
{ |
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
37 |
static TypeId tid = TypeId ("ns3::UdpSocket") |
3129 | 38 |
.SetParent<Socket> () |
39 |
.AddAttribute ("RcvBufSize", |
|
40 |
"UdpSocket maximum receive buffer size (bytes)", |
|
41 |
UintegerValue (0xffffffffl), |
|
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
42 |
MakeUintegerAccessor (&UdpSocket::GetRcvBufSize, |
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
43 |
&UdpSocket::SetRcvBufSize), |
3129 | 44 |
MakeUintegerChecker<uint32_t> ()) |
45 |
.AddAttribute ("IpTtl", |
|
46 |
"socket-specific TTL for unicast IP packets (if non-zero)", |
|
47 |
UintegerValue (0), |
|
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
48 |
MakeUintegerAccessor (&UdpSocket::GetIpTtl, |
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
49 |
&UdpSocket::SetIpTtl), |
3129 | 50 |
MakeUintegerChecker<uint32_t> ()) |
51 |
.AddAttribute ("IpMulticastTtl", |
|
52 |
"socket-specific TTL for multicast IP packets (if non-zero)", |
|
53 |
UintegerValue (0), |
|
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
54 |
MakeUintegerAccessor (&UdpSocket::GetIpMulticastTtl, |
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
55 |
&UdpSocket::SetIpMulticastTtl), |
3129 | 56 |
MakeUintegerChecker<uint32_t> ()) |
3820 | 57 |
.AddAttribute ("MtuDiscover", "If enabled, every outgoing ip packet will have the DF flag set.", |
58 |
BooleanValue (false), |
|
59 |
MakeBooleanAccessor (&UdpSocket::SetMtuDiscover, |
|
60 |
&UdpSocket::GetMtuDiscover), |
|
61 |
MakeBooleanChecker ()) |
|
3129 | 62 |
; |
63 |
return tid; |
|
64 |
} |
|
65 |
||
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
66 |
UdpSocket::UdpSocket () |
3129 | 67 |
{ |
68 |
NS_LOG_FUNCTION_NOARGS (); |
|
69 |
} |
|
70 |
||
3130
881cc06cd651
rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents:
3129
diff
changeset
|
71 |
UdpSocket::~UdpSocket () |
3129 | 72 |
{ |
73 |
NS_LOG_FUNCTION_NOARGS (); |
|
74 |
} |
|
75 |
||
76 |
}; // namespace ns3 |