#include <BasicFragmentationPolicy.h>
Implements inet::ieee80211::IFragmentationPolicy.
33 if (fragmentationThreshold < frame->getByteLength()) {
34 std::vector<int> sizes;
35 int payloadLength = 0;
38 if (dynamic_cast<Ieee80211DataFrame*>(frame)) {
39 cPacket *payload = frame->decapsulate();
40 payloadLength = payload->getByteLength();
41 headerLength = frame->getByteLength();
42 frame->encapsulate(payload);
45 headerLength = frame->getByteLength();
48 throw cRuntimeError(
"Fragmentation: frame \"%s\" too large, won't fit into %d fragments", frame->getName(),
MAX_NUM_FRAGMENTS);
50 sizes.push_back(fragmentationThreshold);
51 payloadLength -= maxFragmentPayload;
53 sizes.push_back(headerLength + payloadLength);
56 return std::vector<int>();
const short int MAX_NUM_FRAGMENTS
Definition: Ieee80211Frame_m.h:50
int fragmentationThreshold
Definition: BasicFragmentationPolicy.h:29
void inet::ieee80211::BasicFragmentationPolicy::initialize |
( |
| ) |
|
|
overrideprotectedvirtual |
int fragmentationThreshold
Definition: BasicFragmentationPolicy.h:29
int inet::ieee80211::BasicFragmentationPolicy::fragmentationThreshold = -1 |
|
protected |
The documentation for this class was generated from the following files: