00001 // -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- 00002 // 00003 // Time-stamp: <2000-09-15 12:52:53 haoboy> 00004 // 00005 // Copyright (c) 2000 by the University of Southern California 00006 // All rights reserved. 00007 // 00008 // Permission to use, copy, modify, and distribute this software and its 00009 // documentation in source and binary forms for non-commercial purposes 00010 // and without fee is hereby granted, provided that the above copyright 00011 // notice appear in all copies and that both the copyright notice and 00012 // this permission notice appear in supporting documentation. and that 00013 // any documentation, advertising materials, and other materials related 00014 // to such distribution and use acknowledge that the software was 00015 // developed by the University of Southern California, Information 00016 // Sciences Institute. The name of the University may not be used to 00017 // endorse or promote products derived from this software without 00018 // specific prior written permission. 00019 // 00020 // THE UNIVERSITY OF SOUTHERN CALIFORNIA makes no representations about 00021 // the suitability of this software for any purpose. THIS SOFTWARE IS 00022 // PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, 00023 // INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 00024 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00025 // 00026 // Other copyrights might apply to parts of this software and are so 00027 // noted when applicable. 00028 // 00029 00030 #ifndef ns_parentnode_h 00031 #define ns_parentnode_h 00032 00033 #include "address.h" 00034 #include "classifier-addr.h" 00035 #include "rtmodule.h" 00036 00037 class NsObject; 00038 00039 /* Class ParentNode : from which all node types including Node, LanNode etc evolve */ 00040 00041 class ParentNode : public TclObject { 00042 public: 00043 ParentNode() : nodeid_(-1), address_(-1) {} 00044 /*virtual int command(int argc, const char*const* argv) {}*/ 00045 virtual inline int address() { return address_;} 00046 virtual inline int nodeid() { return nodeid_;} 00047 virtual void add_route (char *, NsObject *) {} 00048 virtual void delete_route (char *, NsObject *) {} 00049 virtual void set_table_size(int nn) {} 00050 virtual void set_table_size(int lev, int nn) {} 00051 protected: 00052 int nodeid_; 00053 int address_; 00054 }; 00055 00056 00057 /* LanNode: Lan implementation as a virtual node: 00058 LanNode mimics a real 00059 node and uses an address (id) from Node's address space */ 00060 00061 class LanNode : public ParentNode { 00062 public: 00063 LanNode() : ParentNode() {} 00064 virtual int command(int argc, const char*const* argv); 00065 }; 00066 00067 00068 /* AbsLanNode: 00069 It create an abstract LAN. 00070 An abstract lan is one in which the complex CSMA/CD 00071 contention mechanism is replaced by a simple DropTail 00072 queue mechanism. */ 00073 00074 class AbsLanNode : public ParentNode { 00075 public: 00076 AbsLanNode() : ParentNode() {} 00077 virtual int command(int argc, const char*const* argv); 00078 }; 00079 00080 00081 /* Node/Broadcast: used for sun's implementation of MIP; 00082 why is this version of MIP used when (CMU's) wireless 00083 version is also available?? doesn't make sense to have both; 00084 */ 00085 00086 class BroadcastNode : public ParentNode { 00087 public: 00088 BroadcastNode() : ParentNode(), classifier_(NULL) {} 00089 virtual int command(int argc, const char*const* argv); 00090 virtual void add_route (char *dst, NsObject *target); 00091 virtual void delete_route (char *dst, NsObject *nullagent); 00092 //virtual void set_table_size(int nn) {} 00093 //virtual void set_table_size(int lev, int nn) {} 00094 private: 00095 BcastAddressClassifier *classifier_; 00096 }; 00097 00098 #endif /* ---ns_lannode_h */ 00099
1.3.3