41 { |
41 { |
42 static TypeId tid = TypeId ("ns3::PacketSink") |
42 static TypeId tid = TypeId ("ns3::PacketSink") |
43 .SetParent<Application> () |
43 .SetParent<Application> () |
44 .AddConstructor<PacketSink> () |
44 .AddConstructor<PacketSink> () |
45 .AddAttribute ("Local", "The Address on which to Bind the rx socket.", |
45 .AddAttribute ("Local", "The Address on which to Bind the rx socket.", |
46 Address (), |
46 AddressValue (), |
47 MakeAddressAccessor (&PacketSink::m_local), |
47 MakeAddressAccessor (&PacketSink::m_local), |
48 MakeAddressChecker ()) |
48 MakeAddressChecker ()) |
49 .AddAttribute ("Protocol", "The type id of the protocol to use for the rx socket.", |
49 .AddAttribute ("Protocol", "The type id of the protocol to use for the rx socket.", |
50 Udp::GetTypeId (), |
50 TypeIdValue (Udp::GetTypeId ()), |
51 MakeTypeIdAccessor (&PacketSink::m_tid), |
51 MakeTypeIdAccessor (&PacketSink::m_tid), |
52 MakeTypeIdChecker ()) |
52 MakeTypeIdChecker ()) |
53 .AddTraceSource ("Rx", "A packet has been received", |
53 .AddTraceSource ("Rx", "A packet has been received", |
54 MakeTraceSourceAccessor (&PacketSink::m_rxTrace)) |
54 MakeTraceSourceAccessor (&PacketSink::m_rxTrace)) |
55 ; |
55 ; |