00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef SIDEPORTLISTENER_H_
00040 #define SIDEPORTLISTENER_H_
00041
00042 #include <vector>
00043 #include <map>
00044 #include <iostream>
00045 #include <boost/foreach.hpp>
00046 #include "Identifiers.h"
00047 #include "CommunicationListener.h"
00048
00049 using std::cout;
00050 using std::map;
00051 using std::vector;
00052
00053 namespace ariba {
00054
00055
00056 class Node;
00057 class AribaModule;
00058 namespace overlay {
00059 class BaseOverlay;
00060 }
00061
00068 class SideportListener {
00069
00070 friend class Node;
00071 friend class AribaModule;
00072 friend class overlay::BaseOverlay;
00073
00074 public:
00075
00080 static SideportListener DEFAULT;
00081
00085 SideportListener();
00086
00090 virtual ~SideportListener();
00091
00099 string getEndpointDescription(
00100 const LinkID& link
00101 ) const;
00102
00109 string getEndpointDescription(
00110 const NodeID& node = NodeID::UNSPECIFIED
00111 ) const;
00112
00121 const NodeID& getNodeID(
00122 const LinkID& link = LinkID::UNSPECIFIED
00123 ) const;
00124
00134 vector<LinkID> getLinkIDs(
00135 const NodeID& node = NodeID::UNSPECIFIED
00136 ) const;
00137
00142 string getHtmlLinks();
00143
00148 vector<NodeID> getOverlayNeighbors(bool deep = true);
00149
00156 bool isRelayingNode(const NodeID& node);
00157
00164 bool isRelayedNode(const NodeID& node);
00165
00169 enum Protocol {
00170 undefined = 0x0,
00171 rfcomm = 0x1,
00172 ipv4 = 0x2,
00173 ipv6 = 0x3
00174 };
00175
00182 Protocol getReachabilityProtocol(const NodeID& node);
00183
00184 protected:
00185
00194 virtual void onLinkUp(
00195 const LinkID& lnk,
00196 const NodeID& local,
00197 const NodeID& remote,
00198 const SpoVNetID& spovnet
00199 );
00200
00209 virtual void onLinkDown(
00210 const LinkID& lnk,
00211 const NodeID& local,
00212 const NodeID& remote,
00213 const SpoVNetID& spovnet
00214 );
00215
00224 virtual void onLinkChanged(
00225 const LinkID& lnk,
00226 const NodeID& local,
00227 const NodeID& remote,
00228 const SpoVNetID& spovnet
00229 );
00230
00239 virtual void onLinkFail(
00240 const LinkID& lnk,
00241 const NodeID& local,
00242 const NodeID& remote,
00243 const SpoVNetID& spovnet
00244 );
00245
00246 private:
00247
00253 void configure(
00254 overlay::BaseOverlay* _overlay
00255 );
00256
00261 overlay::BaseOverlay* overlay;
00262
00263 };
00264
00265 }
00266
00267 #endif // SIDEPORTLISTENER_H_