예제 #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);
 }
예제 #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;
 }
예제 #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++;
 }
예제 #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);
     }
 }
예제 #5
0
 public override bool ConcurrentWriter(ref ConversationKey key, ref ConversationValue src, ref ConversationValue dst)
 {
     dst = src;
     return(true);
 }
예제 #6
0
 public override void ConcurrentReader(ref ConversationKey key, ref ConversationInput input, ref ConversationValue value, ref ConversationOutput dst)
 {
     dst.Key   = key;
     dst.Value = value;
 }
예제 #7
0
 public override void SingleWriter(ref ConversationKey key, ref ConversationValue src, ref ConversationValue dst)
 {
     dst = src;
 }