Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

LinkHandoffMgr Class Reference

#include <sathandoff.h>

Inheritance diagram for LinkHandoffMgr:

Inheritance graph
[legend]
Collaboration diagram for LinkHandoffMgr:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LinkHandoffMgr ()
void start ()
Nodenode ()
virtual int handoff ()
int command (int argc, const char *const *argv)
SatNodeget_peer (SatLinkHead *)

Protected Member Functions

SatLinkHeadget_peer_next_linkhead (SatNode *)
SatLinkHeadget_peer_linkhead (SatLinkHead *)

Protected Attributes

Nodenode_

Static Protected Attributes

RNG handoff_rng_
int handoff_randomization_ = 0

Constructor & Destructor Documentation

LinkHandoffMgr::LinkHandoffMgr  ) 
 

Definition at line 93 of file sathandoff.cc.

References handoff_randomization_.

00094 {
00095         bind_bool("handoff_randomization_", &handoff_randomization_);
00096 }


Member Function Documentation

int LinkHandoffMgr::command int  argc,
const char *const *  argv
 

Definition at line 98 of file sathandoff.cc.

References node_.

00099 {
00100         if (argc == 2) {
00101         } else if (argc == 3) {
00102                 if(strcmp(argv[1], "setnode") == 0) {
00103                         node_ = (Node*) TclObject::lookup(argv[2]);
00104                         if (node_ == 0)
00105                                 return TCL_ERROR;
00106                         return TCL_OK;
00107                 }
00108         }
00109         return (TclObject::command(argc, argv));
00110 }

SatNode * LinkHandoffMgr::get_peer SatLinkHead  ) 
 

Definition at line 161 of file sathandoff.cc.

References Phy::channel(), Phy::head(), Channel::ifhead_, Phy::nextchnl(), LinkHead::node(), and SatLinkHead::phy_tx().

Referenced by SatNode::dumpSats(), SatLinkHandoffMgr::handoff(), and TermLinkHandoffMgr::handoff().

00162 {
00163         SatChannel *schan_;
00164         Phy *remote_phy_;
00165 
00166         schan_ = (SatChannel*) slhp->phy_tx()->channel();
00167         if (schan_ == 0)
00168                 return 0; // Link is not currently connected
00169         remote_phy_ = schan_->ifhead_.lh_first; 
00170         if (remote_phy_ == 0) {
00171                 // this is not an error as far as satellite GSL endpoints
00172                 // appear to be concerned.
00173                 // Commented out for drawing GSL links in dumpSats()
00174                 // in satnode.cc
00175                 // printf("Error:  node %d's tx phy ", slhp->node()->address());
00176                 // printf("connected to channel with no receivers\n");
00177                 return 0;
00178         }
00179         if (remote_phy_->nextchnl()) {
00180                 printf("Error:  This ISL channel has more than one target\n");
00181                 return 0;
00182         }
00183         
00184         return ( (SatNode*) remote_phy_->head()->node());
00185 }

Here is the call graph for this function:

SatLinkHead * LinkHandoffMgr::get_peer_linkhead SatLinkHead  )  [protected]
 

Definition at line 133 of file sathandoff.cc.

References Node::address(), Phy::channel(), Phy::head(), Channel::ifhead_, Phy::nextchnl(), LinkHead::node(), SatLinkHead::node(), and SatLinkHead::phy_tx().

Referenced by SatLinkHandoffMgr::handoff().

00134 {
00135         SatChannel *schan_;
00136         Phy *remote_phy_;
00137         Node *remote_node_;
00138 
00139         schan_ = (SatChannel*) slhp->phy_tx()->channel();
00140         if (schan_ == 0) {
00141                 printf("Error:  get_peer_linkhead called for a non-");
00142                 printf("connected link on node %d\n", slhp->node()->address());
00143                 return 0; // Link is not currently connected
00144         }
00145         remote_phy_ = schan_->ifhead_.lh_first; 
00146         if (remote_phy_ == 0) {
00147                 printf("Error:  node %d's tx phy ", slhp->node()->address());
00148                 printf("connected to channel with no receivers\n");
00149                 return 0;
00150         }
00151         remote_node_ = remote_phy_->head()->node();
00152         if (remote_phy_->nextchnl()) {
00153                 printf("Error:  This ISL channel has more than one target\n");
00154                 return 0;
00155         }
00156         return ( (SatLinkHead*) remote_phy_->head());
00157 }

Here is the call graph for this function:

SatLinkHead * LinkHandoffMgr::get_peer_next_linkhead SatNode  )  [protected]
 

Definition at line 114 of file sathandoff.cc.

References Phy::channel(), LINK_ISL_CROSSSEAM, Node::linklisthead(), LinkHead::nextlinkhead(), SatLinkHead::phy_rx(), SatLinkHead::phy_tx(), and LinkHead::type().

Referenced by SatLinkHandoffMgr::handoff().

00115 {
00116         LinkHead* lhp;
00117         SatLinkHead* slhp;
00118         for (lhp = np->linklisthead().lh_first; lhp; 
00119             lhp = lhp->nextlinkhead() ) {
00120                 slhp = (SatLinkHead*) lhp;
00121                 if (slhp->type() == LINK_ISL_CROSSSEAM) {
00122                         if (!slhp->phy_tx()->channel() && 
00123                             !slhp->phy_rx()->channel() ) 
00124                                 return slhp;
00125                 }
00126         }
00127         printf("Error, couldn't find an empty crossseam stack for handoff\n");
00128         return 0;
00129 }

Here is the call graph for this function:

virtual int LinkHandoffMgr::handoff  )  [inline, virtual]
 

Reimplemented in SatLinkHandoffMgr, and TermLinkHandoffMgr.

Definition at line 79 of file sathandoff.h.

Referenced by start().

00079 { return 0; }

Node* LinkHandoffMgr::node void   )  [inline]
 

Definition at line 78 of file sathandoff.h.

References node_.

00078 { return node_; } // backpointer to node

void LinkHandoffMgr::start void   )  [inline]
 

Definition at line 77 of file sathandoff.h.

References handoff().

Referenced by SatNode::command().

00077 { handoff(); }

Here is the call graph for this function:


Member Data Documentation

int LinkHandoffMgr::handoff_randomization_ = 0 [static, protected]
 

Definition at line 91 of file sathandoff.cc.

Referenced by SatLinkHandoffMgr::handoff(), TermLinkHandoffMgr::handoff(), and LinkHandoffMgr().

RNG LinkHandoffMgr::handoff_rng_ [static, protected]
 

Definition at line 90 of file sathandoff.cc.

Referenced by SatLinkHandoffMgr::handoff(), and TermLinkHandoffMgr::handoff().

Node* LinkHandoffMgr::node_ [protected]
 

Definition at line 83 of file sathandoff.h.

Referenced by command(), SatLinkHandoffMgr::handoff(), TermLinkHandoffMgr::handoff(), and node().


The documentation for this class was generated from the following files:
Generated on Tue Apr 20 12:55:08 2004 for NS2.26SourcesOriginal by doxygen 1.3.3