00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "ns3/object.h"
00022 #include "ns3/log.h"
00023 #include "ns3/uinteger.h"
00024 #include "ns3/boolean.h"
00025 #include "ns3/trace-source-accessor.h"
00026 #include "udp-socket.h"
00027
00028 NS_LOG_COMPONENT_DEFINE ("UdpSocket");
00029
00030 namespace ns3 {
00031
00032 NS_OBJECT_ENSURE_REGISTERED (UdpSocket);
00033
00034 TypeId
00035 UdpSocket::GetTypeId (void)
00036 {
00037 static TypeId tid = TypeId ("ns3::UdpSocket")
00038 .SetParent<Socket> ()
00039 .AddAttribute ("RcvBufSize",
00040 "UdpSocket maximum receive buffer size (bytes)",
00041 UintegerValue (0xffffffffl),
00042 MakeUintegerAccessor (&UdpSocket::GetRcvBufSize,
00043 &UdpSocket::SetRcvBufSize),
00044 MakeUintegerChecker<uint32_t> ())
00045 .AddAttribute ("IpTtl",
00046 "socket-specific TTL for unicast IP packets (if non-zero)",
00047 UintegerValue (0),
00048 MakeUintegerAccessor (&UdpSocket::GetIpTtl,
00049 &UdpSocket::SetIpTtl),
00050 MakeUintegerChecker<uint32_t> ())
00051 .AddAttribute ("IpMulticastTtl",
00052 "socket-specific TTL for multicast IP packets (if non-zero)",
00053 UintegerValue (0),
00054 MakeUintegerAccessor (&UdpSocket::GetIpMulticastTtl,
00055 &UdpSocket::SetIpMulticastTtl),
00056 MakeUintegerChecker<uint32_t> ())
00057 .AddAttribute ("MtuDiscover", "If enabled, every outgoing ip packet will have the DF flag set.",
00058 BooleanValue (false),
00059 MakeBooleanAccessor (&UdpSocket::SetMtuDiscover,
00060 &UdpSocket::GetMtuDiscover),
00061 MakeBooleanChecker ())
00062 ;
00063 return tid;
00064 }
00065
00066 UdpSocket::UdpSocket ()
00067 {
00068 NS_LOG_FUNCTION_NOARGS ();
00069 }
00070
00071 UdpSocket::~UdpSocket ()
00072 {
00073 NS_LOG_FUNCTION_NOARGS ();
00074 }
00075
00076 };