@@ -667,6 +667,9 @@ public static void ParseWFPFrame(byte[] b, int offset, NetworkTrace t, FrameData
667667 ushort DPort = utility . B2UInt16 ( b , offset + 2 ) ;
668668 ConversationData c = t . GetIPV4Conversation ( sourceIP , SPort , destIP , DPort ) ; // adds conversation if new
669669
670+ // Is the Frame from Client or Server? This may be reversed later in ReverseBackwardConversations.
671+ if ( sourceIP == c . sourceIP && SPort == c . sourcePort ) f . isFromClient = true ;
672+
670673 //
671674 // What: Determine whether the TCP client port has rolled around and is re-used and this should be a new conversation
672675 //
@@ -711,9 +714,6 @@ public static void ParseWFPFrame(byte[] b, int offset, NetworkTrace t, FrameData
711714 }
712715 f . conversation = c ;
713716 c . AddFrame ( f , t ) ; // optionally add to the NetworkTrace frames collection, too
714-
715- // Is the Frame from Client or Server? This may be reversed later in ReverseBackwardConversations.
716- if ( sourceIP == c . sourceIP ) f . isFromClient = true ;
717717 }
718718
719719 ParseNextProtocol ( NextProtocol , b , offset , t , f ) ;
@@ -723,13 +723,13 @@ public static void ParseWFPFrame(byte[] b, int offset, NetworkTrace t, FrameData
723723 case 60021 : // WFP MessageV6
724724 case 60022 : // WFP Message2V6
725725 {
726- ulong sourceIPHi = utility . B2UInt64 ( b , offset ) ; offset += 4 ;
727- ulong sourceIPLo = utility . B2UInt64 ( b , offset ) ; offset += 4 ;
728- ulong destIPHi = utility . B2UInt64 ( b , offset ) ; offset += 4 ;
729- ulong destIPLo = utility . B2UInt64 ( b , offset ) ; offset += 4 ;
726+ ulong sourceIPHi = utility . B2UInt64 ( b , offset ) ; offset += 8 ;
727+ ulong sourceIPLo = utility . B2UInt64 ( b , offset ) ; offset += 8 ;
728+ ulong destIPHi = utility . B2UInt64 ( b , offset ) ; offset += 8 ;
729+ ulong destIPLo = utility . B2UInt64 ( b , offset ) ; offset += 8 ;
730730 byte NextProtocol = b [ offset ] ; offset ++ ; // TCP = 6 UDP = 0x11 (17)
731731 if ( eventID == 60022 ) offset += 8 ; // bypass FlowContext field in the Message2V4 record
732- short payloadLength = ( short ) utility . B2UInt16 ( b , offset ) ; offset += 2 ;
732+ short payloadLength = ( short ) utility . ReadUInt16 ( b , offset ) ; offset += 2 ;
733733
734734 // determine the last element of b[] that contains IP64 data - also the last byte of TCP payload - ethernet may extend beyond this
735735 if ( payloadLength == 0 )
@@ -747,6 +747,9 @@ public static void ParseWFPFrame(byte[] b, int offset, NetworkTrace t, FrameData
747747 ushort DPort = utility . B2UInt16 ( b , offset + 2 ) ;
748748 ConversationData c = t . GetIPV6Conversation ( sourceIPHi , sourceIPLo , SPort , destIPHi , destIPLo , DPort ) ; // adds conversation if new
749749
750+ // Is the Frame from Client or Server? This may be reversed later in ReverseBackwardConversations.
751+ if ( sourceIPHi == c . sourceIPHi && sourceIPLo == c . sourceIPLo && SPort == c . sourcePort ) f . isFromClient = true ;
752+
750753 //
751754 // What: Determine whether the TCP client port has rolled around and is re-used and this should be a new conversation
752755 //
@@ -791,9 +794,6 @@ public static void ParseWFPFrame(byte[] b, int offset, NetworkTrace t, FrameData
791794 }
792795 f . conversation = c ;
793796 c . AddFrame ( f , t ) ; // optionally add to the NetworkTrace frames collection, too
794-
795- // Is the Frame from Client or Server? This may be reversed later in ReverseBackwardConversations.
796- if ( sourceIPHi == c . sourceIPHi && sourceIPLo == c . sourceIPLo ) f . isFromClient = true ;
797797 }
798798
799799 ParseNextProtocol ( NextProtocol , b , offset , t , f ) ;
@@ -1200,6 +1200,9 @@ public static void ParseIPV4Frame(byte[] b, int offset, NetworkTrace t, FrameDat
12001200 DPort = utility . B2UInt16 ( b , offset + HeaderLength + 2 ) ;
12011201 ConversationData c = t . GetIPV4Conversation ( sourceIP , SPort , destIP , DPort ) ; // adds conversation if new
12021202
1203+ // Is the Frame from Client or Server? This may be reversed later in ReverseBackwardConversations.
1204+ if ( sourceIP == c . sourceIP && SPort == c . sourcePort ) f . isFromClient = true ;
1205+
12031206 //
12041207 // Purpose: Do not record duplicate frames unless it has a PktmonData record associated with it
12051208 //
@@ -1219,7 +1222,7 @@ public static void ParseIPV4Frame(byte[] b, int offset, NetworkTrace t, FrameDat
12191222
12201223 int backCount = 0 ;
12211224
1222- if ( f . pktmon == null ) // we want to see the pktmon trace points
1225+ if ( f . pktmon == null ) // we want to avoid the pktmon trace points
12231226 {
12241227 for ( int j = c . frames . Count - 1 ; j >= 0 ; j -- ) // look in descending order for the same Packet ID number
12251228 {
@@ -1282,8 +1285,6 @@ public static void ParseIPV4Frame(byte[] b, int offset, NetworkTrace t, FrameDat
12821285 f . conversation = c ;
12831286 c . AddFrame ( f , t ) ; // optionally add to the NetworkTrace frames collection, too
12841287
1285- // Is the Frame from Client or Server? This may be reversed later in ReverseBackwardConversations.
1286- if ( sourceIP == c . sourceIP ) f . isFromClient = true ;
12871288 }
12881289
12891290 ParseNextProtocol ( NextProtocol , b , offset + HeaderLength , t , f ) ;
@@ -1346,6 +1347,10 @@ public static void ParseIPV6Frame(byte[] b, int offset, NetworkTrace t, FrameDat
13461347 SPort = utility . B2UInt16 ( b , offset + HeaderLength ) ;
13471348 DPort = utility . B2UInt16 ( b , offset + HeaderLength + 2 ) ;
13481349 ConversationData c = t . GetIPV6Conversation ( sourceIPHi , sourceIPLo , SPort , destIPHi , destIPLo , DPort ) ;
1350+
1351+ //Is the Frame from Client or Server?
1352+ if ( sourceIPHi == c . sourceIPHi && sourceIPLo == c . sourceIPLo && SPort == c . sourcePort ) f . isFromClient = true ;
1353+
13491354 //
13501355 // Determine whether the TCP client port has rolled around and this should be a new conversation
13511356 //
@@ -1384,10 +1389,6 @@ public static void ParseIPV6Frame(byte[] b, int offset, NetworkTrace t, FrameDat
13841389 }
13851390 f . conversation = c ;
13861391 c . AddFrame ( f , t ) ;
1387-
1388- //Is the Frame from Client or Server?
1389- if ( sourceIPHi == c . sourceIPHi && sourceIPLo == c . sourceIPLo )
1390- f . isFromClient = true ;
13911392 }
13921393
13931394 ParseNextProtocol ( NextProtocol , b , offset + HeaderLength , t , f ) ;
0 commit comments