#include <stdio.h>
#include "NotifierConsts.h"
Functions | |
const char * | notificationCategoryName (int category) |
void | printNotificationBanner (int category, cPolymorphic *details) |
const char* notificationCategoryName | ( | int | category | ) |
Utility function
00024 { 00025 const char *s; 00026 static char buf[8]; 00027 switch (category) 00028 { 00029 case NF_HOSTPOSITION_UPDATED: return "POS"; 00030 case NF_NODE_FAILURE: return "FAILURE"; 00031 case NF_NODE_RECOVERY: return "RECOVERY"; 00032 00033 case NF_RADIOSTATE_CHANGED: return "RADIO-STATE"; 00034 case NF_RADIO_CHANNEL_CHANGED: return "RADIO-CHANNEL"; 00035 case NF_PP_TX_BEGIN: return "TX-BEG"; 00036 case NF_PP_TX_END: return "TX-END"; 00037 case NF_PP_RX_END: return "RX-END"; 00038 case NF_L2_Q_DROP: return "DROP"; 00039 case NF_MAC_BECAME_IDLE: return "MAC-IDLE"; 00040 case NF_L2_BEACON_LOST: return "BEACON-LOST"; 00041 case NF_L2_ASSOCIATED: return "ASSOCIATED"; 00042 00043 case NF_INTERFACE_STATE_CHANGED: return "IFACE"; 00044 case NF_INTERFACE_CONFIG_CHANGED: return "IFACE-CFG"; 00045 00046 case NF_IPv4_INTERFACECONFIG_CHANGED: return "IPv4-CFG"; 00047 case NF_IPv4_ROUTINGTABLE_CHANGED: return "ROUTINGTABLE"; 00048 00049 case NF_IPv6_INTERFACECONFIG_CHANGED: return "IPv6-CFG"; 00050 case NF_IPv6_ROUTINGTABLE_CHANGED: return "IPv6-ROUTINGTABLE"; 00051 case NF_IPv6_HANDOVER_OCCURRED: return "IPv6-HANDOVER"; 00052 00053 case NF_OVERLAY_NODE_LEAVE: return "NODE-LEAVE"; 00054 default: sprintf(buf, "%d", category); s = buf; 00055 } 00056 return s; 00057 }
void printNotificationBanner | ( | int | category, | |
cPolymorphic * | details | |||
) |
Utility function
00060 { 00061 EV << "** Notification at T=" << simulation.simTime() 00062 << " to " << simulation.contextModule()->fullPath() << ": " 00063 << notificationCategoryName(category) << " " 00064 << (details ? details->info() : "") << "\n"; 00065 }