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