Esempio n. 1
0
 public override void CopyUpdater(ref ConversationKey key, ref ConversationInput input, ref ConversationValue oldValue, ref ConversationValue newValue)
 {
     newValue = new ConversationValue(oldValue.FrameAddresses.Length * 2)
     {
         FrameCount  = oldValue.FrameCount,
         ForwardFlow = oldValue.ForwardFlow,
         ReverseFlow = oldValue.ReverseFlow,
     };
     Array.Copy(oldValue.FrameAddresses, newValue.FrameAddresses, oldValue.FrameCount);
     UpdateEntry(ref key, ref input, ref newValue);
 }
Esempio n. 2
0
 public override bool InPlaceUpdater(ref ConversationKey key, ref ConversationInput input, ref ConversationValue value)
 {
     if (value.FrameCount < value.FrameAddresses.Length)
     {
         UpdateEntry(ref key, ref input, ref value);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 3
0
 private void UpdateEntry(ref ConversationKey key, ref ConversationInput input, ref ConversationValue value)
 {
     if (Equals(key.FlowKey, input.FrameKey))
     {
         UpdateFlow(ref input, ref value.ForwardFlow);
     }
     else
     {
         UpdateFlow(ref input, ref value.ReverseFlow);
     }
     value.FrameAddresses[value.FrameCount] = input.FrameAddress;
     value.FrameCount++;
 }
Esempio n. 4
0
 public override void InitialUpdater(ref ConversationKey key, ref ConversationInput input, ref ConversationValue value)
 {
     value = new ConversationValue(32)
     {
         FrameCount  = 1,
         ForwardFlow = new FlowValue
         {
             FirstSeen = input.FrameTicks,
             LastSeen  = input.FrameTicks,
             Packets   = 1,
             Octets    = (ulong)input.FrameSize
         }
     };
     value.FrameAddresses[0] = input.FrameAddress;
 }
Esempio n. 5
0
 public override bool ConcurrentWriter(ref ConversationKey key, ref ConversationValue src, ref ConversationValue dst)
 {
     dst = src;
     return(true);
 }
Esempio n. 6
0
 public override void ConcurrentReader(ref ConversationKey key, ref ConversationInput input, ref ConversationValue value, ref ConversationOutput dst)
 {
     dst.Key   = key;
     dst.Value = value;
 }
Esempio n. 7
0
 public override void SingleWriter(ref ConversationKey key, ref ConversationValue src, ref ConversationValue dst)
 {
     dst = src;
 }