|
|
| 29 |
MakeUintegerAccessor (&Ipv4RawSocketImpl::m_protocol), |
29 |
MakeUintegerAccessor (&Ipv4RawSocketImpl::m_protocol), |
| 30 |
MakeUintegerChecker<uint16_t> ()) |
30 |
MakeUintegerChecker<uint16_t> ()) |
| 31 |
.AddAttribute ("IcmpFilter", |
31 |
.AddAttribute ("IcmpFilter", |
| 32 |
"Any icmp header whose type field matches a bit in this filter is dropped.", |
32 |
"Any icmp header whose type field matches a bit in this filter is dropped. Type must be less than 32.", |
| 33 |
UintegerValue (0), |
33 |
UintegerValue (0), |
| 34 |
MakeUintegerAccessor (&Ipv4RawSocketImpl::m_icmpFilter), |
34 |
MakeUintegerAccessor (&Ipv4RawSocketImpl::m_icmpFilter), |
| 35 |
MakeUintegerChecker<uint32_t> ()) |
35 |
MakeUintegerChecker<uint32_t> ()) |
|
|
| 326 |
copy->PeekHeader (icmpHeader); |
326 |
copy->PeekHeader (icmpHeader); |
| 327 |
uint8_t type = icmpHeader.GetType (); |
327 |
uint8_t type = icmpHeader.GetType (); |
| 328 |
if (type < 32 && |
328 |
if (type < 32 && |
| 329 |
((1 << type) & m_icmpFilter)) |
329 |
((uint32_t(1) << type) & m_icmpFilter)) |
| 330 |
{ |
330 |
{ |
| 331 |
// filter out icmp packet. |
331 |
// filter out icmp packet. |
| 332 |
return false; |
332 |
return false; |