Processing Messages.
GloMoSim gives the message to the destination’s layer/model/protocol’s event handler function:
void LayerEventHandler(GlomoNode* node, Message* msg) {
switch (msg->eventType) {
case MSG_RADIO_FromMac: {
PacketMacToRadio* MacToRadioInfo =
(PacketMacToRadio*) GLOMO_MsgReturnInfo(msg);
source = MacToRadioInfo->sourceId
…. // Process message … Add header and destination ...
GLOMO_MsgSend(node, msg, RadioDelay)