Ejemplo 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);
 }
Ejemplo n.º 2
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;
 }
Ejemplo 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++;
 }
Ejemplo n.º 4
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);
     }
 }
Ejemplo n.º 5
0
 public override bool ConcurrentWriter(ref ConversationKey key, ref ConversationValue src, ref ConversationValue dst)
 {
     dst = src;
     return(true);
 }
Ejemplo 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;
 }
Ejemplo n.º 7
0
 public override void SingleWriter(ref ConversationKey key, ref ConversationValue src, ref ConversationValue dst)
 {
     dst = src;
 }