40 ArpCache::GetTypeId (void) |
40 ArpCache::GetTypeId (void) |
41 { |
41 { |
42 static TypeId tid = TypeId ("ns3::ArpCache") |
42 static TypeId tid = TypeId ("ns3::ArpCache") |
43 .SetParent<Object> () |
43 .SetParent<Object> () |
44 .AddAttribute ("AliveTimeout", |
44 .AddAttribute ("AliveTimeout", |
45 "When this timeout expires, the matching cache entry needs refreshing", |
45 "When this timeout expires, " |
|
46 "the matching cache entry needs refreshing", |
46 TimeValue (Seconds (120)), |
47 TimeValue (Seconds (120)), |
47 MakeTimeAccessor (&ArpCache::m_aliveTimeout), |
48 MakeTimeAccessor (&ArpCache::m_aliveTimeout), |
48 MakeTimeChecker ()) |
49 MakeTimeChecker ()) |
49 .AddAttribute ("DeadTimeout", |
50 .AddAttribute ("DeadTimeout", |
50 "When this timeout expires, a new attempt to resolve the matching entry is made", |
51 "When this timeout expires, " |
|
52 "a new attempt to resolve the matching entry is made", |
51 TimeValue (Seconds (100)), |
53 TimeValue (Seconds (100)), |
52 MakeTimeAccessor (&ArpCache::m_deadTimeout), |
54 MakeTimeAccessor (&ArpCache::m_deadTimeout), |
53 MakeTimeChecker ()) |
55 MakeTimeChecker ()) |
54 .AddAttribute ("WaitReplyTimeout", |
56 .AddAttribute ("WaitReplyTimeout", |
55 "When this timeout expires, the cache entries will be scanned and entries in WaitReply state will resend ArpRequest unless MaxRetries has been exceeded, in which case the entry is marked dead", |
57 "When this timeout expires, " |
|
58 "the cache entries will be scanned and " |
|
59 "entries in WaitReply state will resend ArpRequest " |
|
60 "unless MaxRetries has been exceeded, " |
|
61 "in which case the entry is marked dead", |
56 TimeValue (Seconds (1)), |
62 TimeValue (Seconds (1)), |
57 MakeTimeAccessor (&ArpCache::m_waitReplyTimeout), |
63 MakeTimeAccessor (&ArpCache::m_waitReplyTimeout), |
58 MakeTimeChecker ()) |
64 MakeTimeChecker ()) |
59 .AddAttribute ("MaxRetries", |
65 .AddAttribute ("MaxRetries", |
60 "Number of retransmissions of ArpRequest before marking dead", |
66 "Number of retransmissions of ArpRequest " |
|
67 "before marking dead", |
61 UintegerValue (3), |
68 UintegerValue (3), |
62 MakeUintegerAccessor (&ArpCache::m_maxRetries), |
69 MakeUintegerAccessor (&ArpCache::m_maxRetries), |
63 MakeUintegerChecker<uint32_t> ()) |
70 MakeUintegerChecker<uint32_t> ()) |
64 .AddAttribute ("PendingQueueSize", |
71 .AddAttribute ("PendingQueueSize", |
65 "The size of the queue for packets pending an arp reply.", |
72 "The size of the queue for packets pending an arp reply.", |
66 UintegerValue (3), |
73 UintegerValue (3), |
67 MakeUintegerAccessor (&ArpCache::m_pendingQueueSize), |
74 MakeUintegerAccessor (&ArpCache::m_pendingQueueSize), |
68 MakeUintegerChecker<uint32_t> ()) |
75 MakeUintegerChecker<uint32_t> ()) |
69 .AddTraceSource ("Drop", |
76 .AddTraceSource ("Drop", |
70 "Packet dropped due to ArpCache entry in WaitReply expiring.", |
77 "Packet dropped due to ArpCache entry " |
71 MakeTraceSourceAccessor (&ArpCache::m_dropTrace)) |
78 "in WaitReply expiring.", |
|
79 MakeTraceSourceAccessor (&ArpCache::m_dropTrace), |
|
80 "ns3::Packet::TracedCallback") |
72 ; |
81 ; |
73 return tid; |
82 return tid; |
74 } |
83 } |
75 |
84 |
76 ArpCache::ArpCache () |
85 ArpCache::ArpCache () |