Esempio n. 1
0
        public FramePacker(NTFrameList frameList)
        {
            if (null == frameList)
            {
                throw new ArgumentNullException("framelist");
            }

            mFrameList = frameList;
        }
        /// <summary>
        /// Find all unique MAC addresses in frames
        /// </summary>
        /// <returns>List of unique MAC-IP pairs</returns>
        public static List <Tuple <String, String> > GetDevices(this NTFrameList frameList)
        {
            var frames       = frameList.ToList();
            var uniqueValues = new HashSet <Tuple <String, String> >();

            foreach (Frame frame in frames)
            {
                uniqueValues.Add(Tuple.Create(frame.SourceMac, frame.SourceIp));
                uniqueValues.Add(Tuple.Create(frame.DestinationMac, frame.DestinationIp));
            }

            return(uniqueValues.ToList());
        }
Esempio n. 3
0
 protected BaseNTParser(NetworkTraceInfo networkTrace, ApplicationState state) : base(state)
 {
     NetworkTrace = networkTrace;
     FrameList    = new NTFrameList();
 }
 /// <summary>
 /// Gets frames related to conversation
 /// </summary>
 public static List <Frame> GetConversationFrames(this NTFrameList frameList, String srcMac, String dstMac)
 {
     return(frameList.Where(item => (item.SourceMac == srcMac && item.DestinationMac == dstMac) ||
                            (item.SourceMac == dstMac && item.DestinationMac == srcMac))
            .ToList());
 }