|
|
| 119 |
case UDP_PROT_NUMBER: |
119 |
case UDP_PROT_NUMBER: |
| 120 |
{ |
120 |
{ |
| 121 |
UdpHeader udpHeader; |
121 |
UdpHeader udpHeader; |
|
|
122 |
if (ipPayload->GetSize () < udpHeader.GetSerializedSize ()) |
| 123 |
{ |
| 124 |
// the packet doesn't carry enough bytes |
| 125 |
return false; |
| 126 |
} |
| 122 |
ipPayload->PeekHeader (udpHeader); |
127 |
ipPayload->PeekHeader (udpHeader); |
| 123 |
tuple.sourcePort = udpHeader.GetSourcePort (); |
128 |
tuple.sourcePort = udpHeader.GetSourcePort (); |
| 124 |
tuple.destinationPort = udpHeader.GetDestinationPort (); |
129 |
tuple.destinationPort = udpHeader.GetDestinationPort (); |
|
|
| 128 |
case TCP_PROT_NUMBER: |
133 |
case TCP_PROT_NUMBER: |
| 129 |
{ |
134 |
{ |
| 130 |
TcpHeader tcpHeader; |
135 |
TcpHeader tcpHeader; |
|
|
136 |
if (ipPayload->GetSize () < tcpHeader.GetSerializedSize ()) |
| 137 |
{ |
| 138 |
// the packet doesn't carry enough bytes |
| 139 |
return false; |
| 140 |
} |
| 131 |
ipPayload->PeekHeader (tcpHeader); |
141 |
ipPayload->PeekHeader (tcpHeader); |
| 132 |
tuple.sourcePort = tcpHeader.GetSourcePort (); |
142 |
tuple.sourcePort = tcpHeader.GetSourcePort (); |
| 133 |
tuple.destinationPort = tcpHeader.GetDestinationPort (); |
143 |
tuple.destinationPort = tcpHeader.GetDestinationPort (); |