58 auto firstFrame = frames->at(0);
59 auto tid = firstFrame->getTid();
60 auto toDS = firstFrame->getToDS();
61 auto fromDS = firstFrame->getFromDS();
62 auto ra = firstFrame->getReceiverAddress();
63 auto ta = firstFrame->getTransmitterAddress();
64 auto aMsdu =
new Ieee80211AMsdu();
66 aMsdu->setSubframesArraySize(frames->size());
67 for (
int i = 0; i < (int)frames->size(); i++)
69 Ieee80211MsduSubframe msduSubframe;
70 auto dataFrame = frames->at(i);
72 auto msdu = dataFrame->decapsulate();
73 if (
auto dataFrameWithSnap = dynamic_cast<Ieee80211DataFrameWithSNAP*>(dataFrame)) {
76 msduSubframe.setEtherType(dataFrameWithSnap->getEtherType());
80 msduSubframe.setEtherType(-1);
83 msduSubframe.encapsulate(msdu);
84 aMsdu->setSubframes(i, msduSubframe);
85 aMsdu->getSubframes(i).setName(dataFrame->getName());
88 aMsdu->setByteLength(aMsduLength);
92 auto aggregatedDataFrame =
new Ieee80211DataFrame(
"A-MSDU");
94 aggregatedDataFrame->setToDS(toDS);
95 aggregatedDataFrame->setFromDS(fromDS);
96 aggregatedDataFrame->setAMsduPresent(
true);
97 aggregatedDataFrame->setTransmitterAddress(ta);
98 aggregatedDataFrame->setReceiverAddress(ra);
99 aggregatedDataFrame->setTid(tid);
100 aggregatedDataFrame->encapsulate(aMsdu);
102 return aggregatedDataFrame;
Definition: Ieee80211Frame_m.h:117
virtual void setSubframeAddress(Ieee80211MsduSubframe *subframe, Ieee80211DataFrame *frame)
Definition: MsduAggregation.cc:25
const unsigned int LENGTH_A_MSDU_SUBFRAME_HEADER
Definition: Ieee80211Frame_m.h:51
const unsigned int SNAP_HEADER_BYTES
Definition: Ieee80211Frame_m.h:49