summaryrefslogtreecommitdiffstats
path: root/mDNSResponder/mDNSMacOSX/BonjourTop/source/BonjourTop.h
blob: 9a678c0dacc7fa812c06a7929acce245426e99e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
//
//  BonjourTop.h
//  TestTB
//
//  Created by Terrin Eager on 9/26/12.
//
//

#ifndef __TestTB__BonjourTop__
#define __TestTB__BonjourTop__

#include <iostream>
#include <stdio.h>
#include <map>
#include <utility>

#include "bjtypes.h"
#include "bjsocket.h"
#include "LLRBTree.h"
#include "DNSFrame.h"
#include "bjStringtoStringMap.h"
#include "bjstring.h"

#include "CollectBy.h"

using namespace std;

typedef struct device_count {
    BJ_UINT64 iOS = 0;
    BJ_UINT64 OSX = 0;
    BJ_UINT64 unknownOS = 0;
    BJ_UINT64 OSXWithEDNSField = 0;
    BJ_UINT64 iOSWithEDNSField = 0;
} device_count;

class CSocketStats
{
public:
    CSocketStats();
    void Init();
    void Clear();
    BJ_UINT64 m_nFrameCount;

    BJ_UINT64 m_nQuestionOnlyFrames;
    BJ_UINT64 m_nAnswerOnlyFrames;
    BJ_UINT64 m_nQandAFrames;

    BJ_INT32 m_SampleDay;

};

class FrameCount
{
public:
    FrameCount() { count = 0;lastFrameNumber = -1;};
    void Increment(BJ_UINT64 frameNumber)
    {
        if (frameNumber != lastFrameNumber)
            count++;
        lastFrameNumber = frameNumber;

    };
    BJ_UINT64 GetValue() const {return count;};
    void Reset() { count = 0;lastFrameNumber = -1;};
    FrameCount &operator+=(const FrameCount &src) { count += src.count; return *this;};

private:
    BJ_UINT64       count;
    BJ_UINT64       lastFrameNumber;
};

////////////////
class CDeviceMap;
class CDeviceNode;

class CIPDeviceNode : public CRBNode<BJIPAddr>
{
public:
    CIPDeviceNode(BJIPAddr* pSrc) {m_Key = *pSrc; /* temp deviceOS = '?';lastQUFrame = 0;*/pDeviceNode=NULL;};
    CIPDeviceNode(){ /*deviceOS = '?';lastQUFrame = 0; */pDeviceNode=NULL;};
    ~CIPDeviceNode(){};
    inline virtual BJ_COMPARE Compare(BJIPAddr* pKey) {return m_Key.Compare(pKey);};
    inline virtual void CopyNode(CRBNode* pSrc)
    {
        m_Key.Set(((BJIPAddr*)pSrc)->Getin6_addr());
        pDeviceNode = ((CIPDeviceNode*)pSrc)->pDeviceNode;
    };
    void Init() {};
    void Clear() {};


    CDeviceNode* pDeviceNode;

};

class CIPAddrMap: public CLLRBTree<BJIPAddr,CIPDeviceNode>
{
public:
    void GetDeviceOSTypes(CIPDeviceNode* node, CIPAddrMap* pGobalMap, BJ_UINT64& iOS,BJ_UINT64& OSX,BJ_UINT64& unknowOS);
};

////////////////////
class CDeviceNode : public CRBNode<BJString>
{
public:
    CDeviceNode(BJString* pSrc) {m_Key = *pSrc; deviceOS = '?'; bOSXWithEDNSField = false; biOSWithEDNSField = false; bDuplicate = false; bIPName = false; bHasFrames = false; nCreateCount++;};
    CDeviceNode(){deviceOS = '?'; bDuplicate = false; bIPName = false;  bHasFrames = false; nCreateCount++;};
    ~CDeviceNode(){nCreateCount--;};
    inline virtual BJ_COMPARE Compare(BJString* pKey) {return m_Key.Compare(*pKey);};
    inline virtual void CopyNode(CRBNode* pSource)
    {
        m_Key = pSource->m_Key;
        deviceOS = dynamic_cast<CDeviceNode*>(pSource)->deviceOS;
        model = dynamic_cast<CDeviceNode*>(pSource)->model;
        settingService = dynamic_cast<CDeviceNode*>(pSource)->settingService;
        macAddress = dynamic_cast<CDeviceNode*>(pSource)->macAddress;
        ipAddressv4 = dynamic_cast<CDeviceNode*>(pSource)->ipAddressv4;
        ipAddressv6 = dynamic_cast<CDeviceNode*>(pSource)->ipAddressv6;
        bOSXWithEDNSField = dynamic_cast<CDeviceNode*>(pSource)->bOSXWithEDNSField;
        biOSWithEDNSField = dynamic_cast<CDeviceNode*>(pSource)->biOSWithEDNSField;
        bHasFrames = dynamic_cast<CDeviceNode*>(pSource)->bHasFrames;
    };
    inline virtual void MergeData(CDeviceNode* src)
    {
        deviceOS = src->deviceOS;
        model = src->model;
        settingService = src->settingService;
        macAddress = src->macAddress;
        bOSXWithEDNSField = src->bOSXWithEDNSField;
        biOSWithEDNSField = src->biOSWithEDNSField;

        frameTotal += src->frameTotal;
        questionFrame += src->questionFrame;
        QUFrame += src->QUFrame;
        answerFrame += src->answerFrame;
        bHasFrames |=  src->bHasFrames;
    };
    void ClearData()
    {
        frameTotal.Reset();
        questionFrame.Reset();
        QUFrame.Reset();
        answerFrame.Reset();
        bHasFrames = false;
    }
    void Init() {deviceOS = '?';};

    void Clear() {};
    char GetDeviceOS() {return deviceOS;};
    void SetDeviceOS(char t,const char* pSettingService)
    {
        BJString EDNS0 = "EDNS0 Trace";
        if (pSettingService == NULL)
            printf("SetDeviceOS: pSettingService is NULL\n");

        if (settingService != EDNS0 || EDNS0 == pSettingService)
        {
            settingService = pSettingService;;
            deviceOS = t;
        }
   //     if ( t != deviceOS && deviceOS != '?' && (deviceOS != 'b' ))
    //         printf("SetDeviceOS: %s deviceOS not equal %c by %s != %c by %s\n", m_Key.GetBuffer(),deviceOS,settingService.GetBuffer(),t,pSettingService);
    };
    void SetModel(char* pModel) {model = pModel;};
    void Export(FILE* file)
    {
        //  fprintf(hFile,"Name,IPAddress,MACAddress,OSType,Model,Method\n");
        if (m_rbRight)
            dynamic_cast<CDeviceNode*>(m_rbRight)->Export(file);

        if (!bDuplicate || frameTotal.GetValue() > 0)
        {
            fprintf(file,"\"%s\",\"%s\",\"%s\",\"%s\",%c,\"%s\",\"%s\",%llu,%llu,%llu,%llu\n",
                m_Key.GetBuffer(),
                ipAddressv4.GetString(),
                ipAddressv6.GetString(),
                macAddress.GetString(),
                deviceOS,
                model.GetBuffer()?model.GetBuffer():" ",
                (bDuplicate)?"dup":settingService.GetBuffer()?settingService.GetBuffer():" ",
                frameTotal.GetValue(),
                questionFrame.GetValue(),
                QUFrame.GetValue(),
                answerFrame.GetValue());
        }

        if (m_rbLeft)
            dynamic_cast<CDeviceNode*>(m_rbLeft)->Export(file);
    };

    BJMACAddr macAddress;
    BJIPAddr ipAddressv4;
    BJIPAddr ipAddressv6;
    BJString model;
    BJString settingService;
    bool     biOSWithEDNSField;
    bool     bOSXWithEDNSField;
    bool     bDuplicate;
    bool     bIPName;
    bool     bHasFrames;

    FrameCount frameTotal;
    FrameCount questionFrame;
    FrameCount QUFrame;
    FrameCount answerFrame;
    static int nCreateCount;

private:
    char deviceOS;
};

class CDeviceMap: public CLLRBTree<BJString,CDeviceNode>
{
public:
    void GetDeviceOSTypes(CDeviceNode *node, CDeviceMap *pGobalMap, device_count& dev_cnt);
};

//////////////
class CMACAddrNode: public CRBNode<BJMACAddr>
{
public:
    CMACAddrNode(BJMACAddr* pSrc) {m_Key.Set(pSrc->Get()); deviceOS = '?'; };
    CMACAddrNode(){deviceOS = '?';};
    ~CMACAddrNode(){};
    inline virtual BJ_COMPARE Compare(BJMACAddr* pKey) {return m_Key.Compare(pKey);};
    inline virtual void CopyNode(CRBNode* pSource)
    {
        m_Key.Set( pSource->m_Key.Get());
        deviceOS = dynamic_cast<CMACAddrNode*>(pSource)->deviceOS;
        model = dynamic_cast<CMACAddrNode*>(pSource)->model;
        method = dynamic_cast<CMACAddrNode*>(pSource)->method;
    };
    void Export(FILE* file)
    {
        if (m_rbRight)
            dynamic_cast<CMACAddrNode*>(m_rbRight)->Export(file);


        fprintf(file,"\"%s\",%c,\"%s\",\"%s\"\n",
                m_Key.GetString(),
                deviceOS,
                model.GetBuffer()?model.GetBuffer():" ",
                method.GetBuffer()?method.GetBuffer():" ");


        if (m_rbLeft)
            dynamic_cast<CMACAddrNode*>(m_rbLeft)->Export(file);
    };

    void Init() {deviceOS = '?';};
    void Clear(){};
    char deviceOS;
    BJString model;
    BJString method;

};

class CMACAddrTree: public CLLRBTree<BJMACAddr,CMACAddrNode>
{
public:

};
class CMACAddrDeviceNode: public CRBNode<BJMACAddr>
{
public:
    CMACAddrDeviceNode(BJMACAddr* pSrc) {m_Key.Set(pSrc->Get()); device = NULL; };
    CMACAddrDeviceNode(){device = NULL;};
    ~CMACAddrDeviceNode(){};
    inline virtual BJ_COMPARE Compare(BJMACAddr* pKey) {return m_Key.Compare(pKey);};
    inline virtual void CopyNode(CRBNode* pSource)
    {
        m_Key.Set( pSource->m_Key.Get());
        device = dynamic_cast<CMACAddrDeviceNode*>(pSource)->device;
    };
    void Init() {device = NULL;};
    void Clear(){};
    CDeviceNode *device;

};

class CMACDeviceMap: public CLLRBTree<BJMACAddr,CMACAddrDeviceNode>
{

};

/////////////

class CStringNode : public CRBNode<BJ_UINT64>
{
public:
    CStringNode(){Init();};
    CStringNode ( BJ_UINT64* Key) { Init(); m_Key = *Key;};
    inline virtual BJ_COMPARE Compare(BJ_UINT64* pKey)
	{

		if (m_Key < *pKey)
			return (BJ_GT);
		else if (m_Key > *pKey)
			return (BJ_LT);
		else
			return (BJ_EQUAL);
	}
    inline virtual void CopyNode(CRBNode* pSource)
	{
		CStringNode* pSrc = (CStringNode*) pSource;

		//  m_Key = pSrc->m_Key;
		m_nBytes = pSrc->m_nBytes;
		m_nFrames = pSrc->m_nFrames;
		m_nFramesiOS = pSrc->m_nFramesiOS;
		m_nFramesOSX = pSrc->m_nFramesOSX;
		m_nQuestionFrames = pSrc->m_nQuestionFrames;
		m_nQuestionFramesiOS = pSrc->m_nQuestionFramesiOS;
		m_nQuestionFramesOSX = pSrc->m_nQuestionFramesOSX;
		m_nAnswerFrames = pSrc->m_nAnswerFrames;
		m_nAnswerFramesiOS = pSrc->m_nAnswerFramesiOS;
		m_nAnswerFramesOSX = pSrc->m_nAnswerFramesOSX;
		strcpy(m_Value,pSrc->m_Value);
		m_nDeviceAskingCount = pSrc->m_nDeviceAskingCount;
		m_nDeviceAskingiOSCount = pSrc->m_nDeviceAskingiOSCount;
		m_nDeviceAskingOSXCount = pSrc->m_nDeviceAskingOSXCount;
		m_nDeviceAnsweringCount = pSrc->m_nDeviceAnsweringCount;
		m_nDeviceAnsweringiOSCount = pSrc->m_nDeviceAnsweringiOSCount;
		m_nDeviceAnsweringOSXCount = pSrc->m_nDeviceAnsweringOSXCount;
		m_nDeviceTotalCount = pSrc->m_nDeviceTotalCount;
		m_nDeviceTotaliOSCount = pSrc->m_nDeviceTotaliOSCount;
		m_nDeviceTotalOSXCount = pSrc->m_nDeviceTotalOSXCount;
		m_nWakeFrames = pSrc->m_nWakeFrames;
		m_nLastWakeFrameIndex =  pSrc->m_nLastWakeFrameIndex;
		m_nGoodbyeFrames = pSrc->m_nGoodbyeFrames;
	}

    inline void Init() {
        m_nBytes = 0;
        m_nFrames = m_nFramesiOS = m_nFramesOSX = m_nQuestionFrames = m_nQuestionFramesiOS = m_nQuestionFramesOSX = m_nAnswerFrames = m_nAnswerFramesiOS = m_nAnswerFramesOSX = 0;
        m_nLastFrameIndex = 0;
        m_nLastQueryFrameIndex = 0;
        m_nLastRespondsFrameIndex = 0;
        m_nDeviceAskingCount = m_nDeviceAskingiOSCount = m_nDeviceAskingOSXCount = 0;
        m_nDeviceAnsweringCount = m_nDeviceAnsweringiOSCount = m_nDeviceAnsweringOSXCount = 0;
        m_nDeviceTotalCount = m_nDeviceTotaliOSCount = m_nDeviceTotalOSXCount = 0;
        m_nWakeFrames = 0;
        m_nGoodbyeFrames = 0;
        m_lastQUFrameTime = 0;
    };
    inline void Clear() {};

    void UpdateOSTypeCounts(CDeviceMap* pGobalMap,CIPAddrMap *pIp2NameMap);

    void Print(bool bCursers,bool bDescendingSort,BJ_UINT32 &nIndex,BJ_UINT32 nStartIndex,BJ_UINT32 nEndIndex);
    void Export(FILE* hFile);

    //  BJ_UINT64        m_Key;
    char            m_Value[255];
    BJ_UINT64       m_nBytes;
    BJ_UINT64       m_nFrames;
    BJ_UINT64       m_nFramesiOS;
    BJ_UINT64       m_nFramesOSX;
    BJ_UINT64       m_nQuestionFrames;
    BJ_UINT64       m_nQuestionFramesiOS;
    BJ_UINT64       m_nQuestionFramesOSX;
    BJ_UINT64       m_nAnswerFrames;
    BJ_UINT64       m_nAnswerFramesiOS;
    BJ_UINT64       m_nAnswerFramesOSX;
    BJ_UINT64       m_nLastFrameIndex;
    BJ_UINT64       m_nLastQueryFrameIndex;
    BJ_UINT64       m_nLastRespondsFrameIndex;
    BJ_UINT64       m_nLastWakeFrameIndex;
    CIPAddrMap      m_DeviceAskingTree;
    BJ_UINT64       m_nDeviceAskingCount;
    BJ_UINT64       m_nDeviceAskingiOSCount;
    BJ_UINT64       m_nDeviceAskingOSXCount;
    CIPAddrMap      m_DeviceAnsweringTree;
    BJ_UINT64       m_nDeviceAnsweringCount;
    BJ_UINT64       m_nDeviceAnsweringiOSCount;
    BJ_UINT64       m_nDeviceAnsweringOSXCount;
    CIPAddrMap      m_DeviceTotalTree;
    BJ_UINT64       m_nDeviceTotalCount;
    BJ_UINT64       m_nDeviceTotaliOSCount;
    BJ_UINT64       m_nDeviceTotalOSXCount;
    BJ_UINT64       m_nWakeFrames;
    BJ_UINT64       m_lastQUFrameTime;
    BJ_UINT64       m_nGoodbyeFrames;
};

class CStringTree: public CLLRBTree<BJ_UINT64,CStringNode>
{
public:

};

///////////

class CStringShortNode: public CRBNode<BJ_UINT64>
{
public:
    CStringShortNode(BJ_UINT64* key) {Init(); m_Key = *key;};
	inline virtual BJ_COMPARE Compare(BJ_UINT64* pKey)
	{

		if (m_Key < *pKey)
			return (BJ_GT);
		else if (m_Key > *pKey)
			return (BJ_LT);
		else
			return (BJ_EQUAL);
	}

    inline virtual void CopyNode(CRBNode* pSource)
	{
		CStringShortNode* pSrc = (CStringShortNode*) pSource;

		//  m_Key = pSrc->m_Key;
		m_nBytes = pSrc->m_nBytes;
		m_nFrames = pSrc->m_nFrames;
		m_nQuestionFrames = pSrc->m_nQuestionFrames;
		m_nAnswerFrames = pSrc->m_nAnswerFrames;
		strcpy(m_Value,pSrc->m_Value);
		m_nDeviceAskingCount = pSrc->m_nDeviceAskingCount;
		m_nDeviceAnsweringCount = pSrc->m_nDeviceAnsweringCount;
		m_nDeviceTotalCount = pSrc->m_nDeviceTotalCount;
		m_nWakeFrames = pSrc->m_nWakeFrames;
		m_nLastWakeFrameIndex =  pSrc->m_nLastWakeFrameIndex;
		m_nGoodbyeFrames = pSrc->m_nGoodbyeFrames;
	}

    inline void Init() {
        m_nBytes = 0;
        m_nFrames = m_nQuestionFrames = m_nAnswerFrames = 0;
        m_nLastFrameIndex = m_nLastQueryFrameIndex = m_nLastRespondsFrameIndex = m_nLastWakeFrameIndex = 0;
        m_nDeviceAskingCount = m_nDeviceAnsweringCount = m_nDeviceTotalCount = 0;
        m_nWakeFrames = m_lastQUFrameTime = m_nGoodbyeFrames = 0;
    };
    inline void Clear(){};

    void Export(FILE* hFile);

    //  BJ_UINT64        m_Key;
    char            m_Value[255];
    BJ_UINT64       m_nBytes;
    BJ_UINT64       m_nFrames;
    BJ_UINT64       m_nQuestionFrames;
    BJ_UINT64       m_nAnswerFrames;
    BJ_UINT64       m_nLastFrameIndex;
    BJ_UINT64       m_nLastQueryFrameIndex;
    BJ_UINT64       m_nLastRespondsFrameIndex;
    BJ_UINT64       m_nLastWakeFrameIndex;
    CIPAddrMap      m_DeviceAskingTree;
    BJ_UINT64       m_nDeviceAskingCount;
    CIPAddrMap      m_DeviceAnsweringTree;
    BJ_UINT64       m_nDeviceAnsweringCount;
    CIPAddrMap      m_DeviceTotalTree;
    BJ_UINT64       m_nDeviceTotalCount;
    BJ_UINT64       m_nWakeFrames;
    BJ_UINT64       m_lastQUFrameTime;
    BJ_UINT64       m_nGoodbyeFrames;
};

class CStringShortTree: public CLLRBTree<BJ_UINT64, CStringShortNode>
{
public:
};

///////////


class CBonjourTop
{
public:
    CBonjourTop();

    void SetIPAddr(const char*);
    void LiveCapture();
    void CaptureFile();

    void PrintResults(int nSortCol, bool bSortAsc);
    void UpdateOSCounts();
    void PrintDetailResults(int nSortCol, bool bSortAsc);
    void ExportResults();
    void Reset();

    void WriteDeviceFile();
    void WriteVendorFile();

    void ProcessFrame(BJ_UINT8* pBuffer,BJ_INT32 nLength, BJ_UINT64 frameTime);
    bool Name2OSType(BJString name,CDeviceNode* device);

    void UpdateRecord(CStringTree &Cache,CDNSRecord* pDNSRecord,BJString& RecordName,BJString& ServiceName,BJ_UINT32 nBytes,bool bGoodbye);

    void UpdateShortRecordHelper(BJ_UINT32 cacheType, BJ_UINT32 tracePlatform, BJ_UINT32 traceVersion, char deviceOS, CDNSRecord* pDNSRecord,BJString& RecordName,BJString& ServiceName,BJ_UINT32 nBytes,bool bGoodbye);

    void UpdateShortRecord(CStringShortTree* Cache,CDNSRecord* pDNSRecord,BJString& RecordName,BJString& ServiceName,BJ_UINT32 nBytes,bool bGoodbye);

    void GetOSTypeFromQuery(CDNSRecord *pDNSRecord,BJString& ServiceName);
    void GetOSTypeFromRegistration(CDNSRecord *pDNSRecord,BJString& ServiceName);

    CStringNode* GetCurrentDisplayRoot(BJString &sTitle);
    void ExportPtrCache(FILE* hFile, BJString sTitle, CStringNode* pRoot);
    void ExportShortCache(FILE* hFile, BJString sTitle, map<BJString, CStringShortTree*>* myMap);
    void ExportShortCacheHelper(FILE* hFile, BJString sTitle, CStringShortNode* pRoot);

    void WindowSizeChanged();

    bool m_bCursers;
    const char* m_pTcpDumpFileName;
    const char* m_pExportFileName;
    bool window_size_changed;
    bool m_bImportExportDeviceMap;
    BJString m_DeviceFileName;

    CDNSFrame m_Frame;

#define NUM_SOCKET_STATUS   6
#define HOURS_IN_DAY        24
#define MINUTES_IN_HOUR     60

    CSocketStats m_SocketStatus[NUM_SOCKET_STATUS];

    CSocketStats m_MinSnapshot[HOURS_IN_DAY][MINUTES_IN_HOUR];

    BJ_UINT64 m_nFrameCount;
    BJ_UINT64 m_nTotalBytes;
    long m_StartTime;
    long m_EndTime;
    BJ_UINT64 m_MinAnswerCountForTruncatedFrames;
    BJ_UINT64 m_AvgAnswerCountForTruncatedFrames;
    BJ_UINT64 m_MaxAnswerCountForTruncatedFrames;

    BJIPAddr m_IPv4Addr;

    BJStringtoStringMap m_Service2AppMap;

    BJStringtoStringMap m_Service2osRegisterMap;
    BJStringtoStringMap m_Service2osBrowseMap;

    enum BJ_DISPLAY_MODE_ENUM {
        BJ_DISPLAY_APP,
        BJ_DISPLAY_APPv6,
        BJ_DISPLAY_SERVICE,
        BJ_DISPLAY_SERVICEv6,
        BJ_DISPLAY_24_MIN
    } m_CurrentDisplay ;

    BJ_INT32 m_SnapshotSeconds;

    CStringTree m_ServicePtrCache;
    CStringTree m_ApplPtrCache;

    CStringTree m_ServicePtrCacheIPv6;
    CStringTree m_ApplPtrCacheIPv6;

    map<BJString, CStringShortTree*> m_ServiceBreakdownIPv4OSX;
    map<BJString, CStringShortTree*> m_ServiceBreakdownIPv4iOS;
    map<BJString, CStringShortTree*> m_ServiceBreakdownIPv6OSX;
    map<BJString, CStringShortTree*> m_ServiceBreakdownIPv6iOS;

    map<BJString, CStringShortTree*> m_AppBreakdownIPv4OSX;
    map<BJString, CStringShortTree*> m_AppBreakdownIPv4iOS;
    map<BJString, CStringShortTree*> m_AppBreakdownIPv6OSX;
    map<BJString, CStringShortTree*> m_AppBreakdownIPv6iOS;

    CDeviceMap m_DeviceMap;

    CMACAddrTree m_MacMap;
    CIPAddrMap  m_IPtoNameMap;
    CMACDeviceMap m_MACtoDevice;
    BJStringtoStringMap SVRtoDeviceName;

    Collection m_Collection;

    BJString interfaceName;
    BJString filterApplicationName;


};

#endif /* defined(__TestTB__BonjourTop__) */