TTEthernet Model for INET Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CTFrame.cc
Go to the documentation of this file.
1 /*
2  * CT_Frame.cc
3  *
4  * Created on: Jan 17, 2013
5  * Author: tillsteinbach
6  */
7 
8 
9 #include "CTFrame.h"
10 #include "EtherFrame_m.h"
11 
12 namespace TTEthernetModel {
13 
14 
15 unsigned short CTFrame::getCtID() const{
16  MACAddress mac = getDest();
17  uint16_t CtID = 0;
18  CtID=(mac.getAddressByte(4)<<8);
19  CtID=CtID|mac.getAddressByte(5);
20  return CtID;
21 }
22 
23 void CTFrame::setCtID(uint16_t ctID){
24  MACAddress mac = getDest();
25  mac.setAddressByte(4, ctID>>8);
26  mac.setAddressByte(5, ctID);
27  setDest(mac);
28 }
29 
30 unsigned int CTFrame::getCtMarker() const{
31  MACAddress mac = getDest();
32  uint32_t CtMarker = 0;
33  CtMarker=(mac.getAddressByte(0)<<24);
34  CtMarker=CtMarker|(mac.getAddressByte(1)<<16);
35  CtMarker=CtMarker|(mac.getAddressByte(2)<<8);
36  CtMarker=CtMarker|mac.getAddressByte(3);
37  return CtMarker;
38 }
39 
40 void CTFrame::setCtMarker(uint32_t ctMarker){
41  MACAddress mac = getDest();
42  mac.setAddressByte(0, ctMarker>>24);
43  mac.setAddressByte(1, ctMarker>>16);
44  mac.setAddressByte(2, ctMarker>>8);
45  mac.setAddressByte(3, ctMarker);
46  setDest(mac);
47 }
48 
49 
50 
51 }