]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/BonjourTop/source/Frame.h
mDNSResponder-878.1.1.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / BonjourTop / source / Frame.h
1 //
2 // Frame.h
3 // TestTB
4 //
5 // Created by Terrin Eager on 1/19/13.
6 //
7 //
8
9 #ifndef __TestTB__Frame__
10 #define __TestTB__Frame__
11
12 #include "bjtypes.h"
13 #include "bjIPAddr.h"
14 #include "bjMACAddr.h"
15
16 class Frame
17 {
18 public:
19 void Set(BJ_UINT8* data,BJ_UINT32 len,BJ_UINT64 t);
20 BJ_UINT8* GetEthernetStart();
21 BJ_UINT8* GetIPStart();
22 BJ_UINT8* GetUDPStart();
23 BJ_UINT8* GetBonjourStart();
24
25 BJIPAddr* GetSrcIPAddr();
26 BJIPAddr* GetDestIPAddr();
27
28 BJMACAddr* GetSrcMACAddr();
29 BJMACAddr* GetDestMACAddr();
30
31 int m_bCurrentFrameIPversion;
32
33 BJ_UINT64 GetTime(){ return frameTime; };
34
35 enum BJ_DATALINKTYPE {
36 BJ_DLT_EN10MB = 1,
37 BJ_DLT_IEEE802_11=105
38 };
39
40 void SetDatalinkType (BJ_DATALINKTYPE datalinkType);
41 private:
42
43 BJ_UINT32 GetLinklayerHeaderLength();
44
45 //Get the header length of the current 802.11 frame.
46 BJ_UINT32 Get80211HeaderLength();
47
48 BJ_UINT8* frameData;
49 BJ_UINT32 length;
50
51 BJIPAddr sourceIPAddr;
52 BJIPAddr destIPAddr;
53
54 BJMACAddr sourceMACAddr;
55 BJMACAddr destMACAddr;
56
57 BJ_UINT64 frameTime; // in microseconds
58
59
60 BJ_DATALINKTYPE m_datalinkType = BJ_DLT_EN10MB;
61
62
63 };
64
65
66 #endif /* defined(__TestTB__Frame__) */