NotifierConsts.h

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2005 Andras Varga
00003 //
00004 // This program is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public License
00006 // as published by the Free Software Foundation; either version 2
00007 // of the License, or (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public License
00015 // along with this program; if not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 
00019 #ifndef __INET_NOTIFIERCONSTS_H
00020 #define __INET_NOTIFIERCONSTS_H
00021 
00022 #include "INETDefs.h"
00023 
00024 
00028 // TODO consider: use allocated IDs, like: const int NF_FOO = registerCategory("FOO");
00029 // or maybe use structs and dynamic_cast? so we can have a hierarchy of notifications
00030 // TODO document associated notification detail structs
00031 enum
00032 {
00033     // admin
00034     NF_SUBSCRIBERLIST_CHANGED,
00035 
00036     // - host
00037     NF_HOSTPOSITION_UPDATED,
00038     NF_NODE_FAILURE,
00039     NF_NODE_RECOVERY,
00040 
00041     // - layer 1 (physical)
00042     NF_RADIOSTATE_CHANGED,
00043     NF_RADIO_CHANNEL_CHANGED,
00044 
00045     // - layer 2 (data-link)
00046     //XXX generalize constants (remove "PP"?) - could be used by 80211 and ethernet as well
00047     // they generally carry TxNotifDetails as "details" to identify the interface and the frame
00048     NF_PP_TX_BEGIN,   // point-to-point transmission begins (currently PPP)
00049     NF_PP_TX_END,     // point-to-point transmission ends (currently PPP)
00050     NF_PP_RX_END,     // point-to-point reception ends (currently PPP)
00051     NF_TX_ACKED,      // transmitted frame got acked (currently Ieee80211)
00052     NF_L2_Q_DROP,
00053     NF_MAC_BECAME_IDLE,
00054     NF_L2_BEACON_LOST,   // missed several consecutive beacons (currently Ieee80211)
00055     NF_L2_ASSOCIATED,    // successfully associated with an AP (currently Ieee80211)
00056 
00057     // - layer 3 (network)
00058     NF_INTERFACE_CREATED,
00059     NF_INTERFACE_DELETED,
00060     NF_INTERFACE_STATE_CHANGED,
00061     NF_INTERFACE_CONFIG_CHANGED,
00062     NF_INTERFACE_IPv4CONFIG_CHANGED,
00063     NF_INTERFACE_IPv6CONFIG_CHANGED,
00064     NF_TED_CHANGED,
00065 
00066     // layer 3 - IPv4
00067     NF_IPv4_ROUTE_ADDED,
00068     NF_IPv4_ROUTE_DELETED,
00069     NF_IPv6_ROUTE_ADDED,
00070     NF_IPv6_ROUTE_DELETED,
00071 
00072     // layer 3 - IPv6
00073     NF_IPv6_HANDOVER_OCCURRED,
00074 
00075     // - layer 4 (transport)
00076     //...
00077 
00078     // - layer 7 - OverSim
00079     NF_OVERLAY_TRANSPORTADDRESS_CHANGED,  // OverSim
00080     NF_OVERLAY_NODE_GRACEFUL_LEAVE,       // OverSim
00081     NF_OVERLAY_NODE_LEAVE,                // OverSim
00082 
00083 
00084     // - layer 7 (application)
00085     //...
00086 };
00087 
00091 const char *notificationCategoryName(int category);
00092 
00096 void printNotificationBanner(int category, const cPolymorphic *details);
00097 
00098 #endif
00099 
00100 
00101 
00102