class LandmarkAgent : public Agent


Inheritance:


Public Fields

int adverts_type_
Option to indicate whether updates are to be flooded, unicast or suppressed when no changes occur as in a hard-state based scheme
int be_random_
Randomness/MAC/logging parameters set to 1 on initialization
int cache_
Tag cache info set to 1 to enable caching
int debug_
Debug flags
int global_lm_
Option to indicate whether there is a global LM. We dont need a global LM for all the query direction schemes
nsaddr_t global_lm_id_
ID and level of global LM that this node sees
int global_lm_level_
int highest_level_
My highest level in the hierarchy (note
PriQueue* ll_queue
link level output queue
compr_taglist* mobile_tags_
Pointer to tags that have moved within this sensor's range while the sensor was dead
double mobility_period_
int myaddr_
My address...
int* nbrs_
MobileNode* node_
Mobile node to which agent is attached; Used to get position information
int node_dead_
Indicates whether the node that the agent is attached to is alive or not
int num_cached_items_
int num_demotion_msgs_
int num_nbrs_
int num_resched_
used in rescheduling timers
ParentChildrenList* parent_children_list_
that a LM can be at multiple levels) List of parent and children nodes for each level I'm at. Methods to add and remove parent, child information from this list.
double promo_start_time_
Time when the promotion timer was started
double promo_timeout_
Promotion timeout. Same for all levels.
double promo_timeout_decr_
Amount by which promotion timer is
PromotionTimer* promo_timer_
Promotion timer stuff Promotion timer object
int promo_timer_running_
decr when another LM's adverts is heard indicates that promotion timer is running
int qry_debug_
RecentMsgRecord* recent_demotion_msgs_
Store a record of recent forwarded demotion msgs
RNG* rn_
Random number generator
int seqno_
Sequence number to advertise with...
Event* tag_advt_event_
TagAdvtHandler* tag_advt_handler_
TagCache* tag_cache_
tags_database* tag_dbase_
Pointer to global tag database
TagMobilityHandler* tag_mobility_
Tag mobility stuff
Event* tag_mobility_event_
RNG* tag_rng_
double total_wait_time_
other LM hierarchy messages total time the node has spent in wait state
Trace* tracetarget_
Trace target
double update_period_
Update period info
double update_timeout_
int wait_state_
used to indicate that the node is waiting to receive

Public Methods

virtual void AddMobileTag(void *mobile_tag)
void Addparent(const nsaddr_t parent, int level)
void Addpotentialchild(const nsaddr_t child, int level)
compr_taglist* aggregate_taginfo(compr_taglist *unagg_tags, int agg_level, int *num_tags)
compr_taglist* aggregate_tags(compr_taglist *unagg_tags, int agg_level, int *num_tags)
void assign_lmaddress(int64_t *lmaddr, int num_lm_addrs, int root_level)
Assign landmark addresses to children
int CheckDemotionMsg(nsaddr_t id, int level, int origin_time)
virtual int command(int argc, const char * const * argv)
int compare_tag_lists(compr_taglist *tag_list1, int num_tags1, compr_taglist *tag_list2, int num_tags2)
virtual void ForwardPacket(Packet *p)
virtual void GenerateReHashMsg(int64_t lm_addr, double net_change_time)
void get_nbrinfo()
Prints neighbour information for this node
virtual nsaddr_t get_next_hop(nsaddr_t dst, int next_hop_level)
inline double jitter(double max, int be_random_)
LandmarkAgent()
virtual Packet* makeUpdate(ParentChildrenList *pcl, int pkt_type, int action)
pkt_type is one of HIER_ADVS, OBJECT_ADVS, HIER_AND_OBJECT_ADVS action is one of DEMOTION, PERIODIC_ADVERTS, UNICAST_ADVERT_CHILD, UNICAST_ADVERT_PARENT, GLOBAL_ADVERT (from root LM) and QUERY_PKT
virtual void MoveTags()
virtual void periodic_callback(Event *e, int level)
method to send periodic advts
virtual void ProcessHierUpdate(Packet *p)
int radius(int level)
returns the LM radius for the specified level
inline double random_timer(double max, int be_random_)
void recv(Packet *p, Handler *)
NodeIDList* search_tag(int obj_name, int prev_hop_level, int next_hop_level, nsaddr_t last_hop_id, int *num_dst)
void SendChangedTagListUpdate(int our_tag_changed, int level)
void startUp()
Starts off the hierarchy construction protocol
virtual void stop()
Resets the agent state
void trace(char* fmt, ...)
Tracing stuff

Private Fields

friend class LMPeriodicAdvtHandler
friend class ParentChildrenList
friend class PromotionTimer

Inherited from Agent:

Public Fields

Agent instvar agent_port_
Agent instvar dst_addr_
Agent instvar dst_port_
Agent instvar namTrace_
Agent instvar tg_

Public Methods

inline nsaddr_t& addr()
Agent instproc attach-app {s_type}
Agent instproc attach-source {s_type}
Agent instproc attach-tbf { tbf }
Agent instproc attach-trace { file }
virtual void attachApp(Application* app)
virtual void close()
Agent instproc connect d
virtual void connect(nsaddr_t dst)
inline nsaddr_t& daddr()
inline nsaddr_t& dport()
Agent instproc dst-port {}
Agent instproc init args
virtual void listen()
inline nsaddr_t& port()
Agent instproc port {}
void send(Packet* p, Handler* h)
virtual void send(int nbytes)
virtual void send(int sz, AppData *data)
virtual void sendmsg(int sz, AppData*, const char* flags = 0)
virtual void sendmsg(int nbytes, const char *flags = 0)
virtual void sendto(int sz, AppData*, const char* flags = 0)
virtual void sendto(int nbytes, const char* flags, nsaddr_t dst)
Agent instproc set args
void set_pkttype(packet_t pkttype)
virtual int& size()
virtual void timeout(int tno)
Agent instproc traffic-source agent

Protected Fields

Application* app_
Tcl_Channel channel_
int class_
int defttl_
ns_addr_t dst_
int fid_
int flags_
ns_addr_t here_
int off_ip_
OldValue* oldValueList_
int prio_
int size_
char* traceName_
packet_t type_
static int uidcnt_

Protected Methods

void addAgentTrace(const char *name)
Packet* allocpkt(int)
Packet* allocpkt()
virtual int delay_bind_dispatch(const char *varName, const char *localName, TclObject *tracer)
virtual void delay_bind_init_all()
void deleteAgentTrace()
void dumpTracedVars()
virtual void idle()
void initpkt(Packet*)
void insertOldValue(TracedVar *v, const char *value)
OldValue* lookupOldValue(TracedVar *v)
void monitorAgentTrace()
virtual void recvBytes(int bytes)

Private Methods

void flushAVar(TracedVar *v)

Inherited from Connector:

Public Methods

virtual void drop(Packet* p)
inline NsObject* target()

Protected Fields

NsObject* drop_
NsObject* target_

Protected Methods

virtual void drop(Packet* p, const char *s)

Inherited from NsObject:

Public Methods

virtual void debug(const char *fmt, ...)
int isdebug()

Protected Fields

int off_cmn_
int off_flags_

Protected Methods

void handle(Event*)
virtual void reset()

Inherited from Handler:


Documentation

friend class LMPeriodicAdvtHandler

friend class PromotionTimer

friend class ParentChildrenList

LandmarkAgent()

virtual int command(int argc, const char * const * argv)

PromotionTimer* promo_timer_
Promotion timer stuff Promotion timer object

double promo_start_time_
Time when the promotion timer was started

double promo_timeout_
Promotion timeout. Same for all levels.

double promo_timeout_decr_
Amount by which promotion timer is

int promo_timer_running_
decr when another LM's adverts is heard indicates that promotion timer is running

void startUp()
Starts off the hierarchy construction protocol

virtual void stop()
Resets the agent state

int seqno_
Sequence number to advertise with...

int myaddr_
My address...

virtual void periodic_callback(Event *e, int level)
method to send periodic advts

int highest_level_
My highest level in the hierarchy (note

ParentChildrenList* parent_children_list_
that a LM can be at multiple levels) List of parent and children nodes for each level I'm at. Methods to add and remove parent, child information from this list.

void Addparent(const nsaddr_t parent, int level)

void Addpotentialchild(const nsaddr_t child, int level)

virtual Packet* makeUpdate(ParentChildrenList *pcl, int pkt_type, int action)
pkt_type is one of HIER_ADVS, OBJECT_ADVS, HIER_AND_OBJECT_ADVS action is one of DEMOTION, PERIODIC_ADVERTS, UNICAST_ADVERT_CHILD, UNICAST_ADVERT_PARENT, GLOBAL_ADVERT (from root LM) and QUERY_PKT

int radius(int level)
returns the LM radius for the specified level

PriQueue* ll_queue
link level output queue

void recv(Packet *p, Handler *)

virtual void ProcessHierUpdate(Packet *p)

virtual void ForwardPacket(Packet *p)

void get_nbrinfo()
Prints neighbour information for this node

RecentMsgRecord* recent_demotion_msgs_
Store a record of recent forwarded demotion msgs

int num_demotion_msgs_

int CheckDemotionMsg(nsaddr_t id, int level, int origin_time)

void trace(char* fmt, ...)
Tracing stuff

Trace* tracetarget_
Trace target

void assign_lmaddress(int64_t *lmaddr, int num_lm_addrs, int root_level)
Assign landmark addresses to children

tags_database* tag_dbase_
Pointer to global tag database

compr_taglist* aggregate_taginfo(compr_taglist *unagg_tags, int agg_level, int *num_tags)

compr_taglist* aggregate_tags(compr_taglist *unagg_tags, int agg_level, int *num_tags)

NodeIDList* search_tag(int obj_name, int prev_hop_level, int next_hop_level, nsaddr_t last_hop_id, int *num_dst)

virtual nsaddr_t get_next_hop(nsaddr_t dst, int next_hop_level)

MobileNode* node_
Mobile node to which agent is attached; Used to get position information

int be_random_
Randomness/MAC/logging parameters set to 1 on initialization

int num_resched_
used in rescheduling timers

int wait_state_
used to indicate that the node is waiting to receive

double total_wait_time_
other LM hierarchy messages total time the node has spent in wait state

int debug_
Debug flags

int qry_debug_

int cache_
Tag cache info set to 1 to enable caching

TagCache* tag_cache_

int num_cached_items_

double update_period_
Update period info

double update_timeout_

int adverts_type_
Option to indicate whether updates are to be flooded, unicast or suppressed when no changes occur as in a hard-state based scheme

int global_lm_
Option to indicate whether there is a global LM. We dont need a global LM for all the query direction schemes

nsaddr_t global_lm_id_
ID and level of global LM that this node sees

int global_lm_level_

int node_dead_
Indicates whether the node that the agent is attached to is alive or not

RNG* rn_
Random number generator

inline double jitter(double max, int be_random_)

inline double random_timer(double max, int be_random_)

virtual void GenerateReHashMsg(int64_t lm_addr, double net_change_time)

int num_nbrs_

int* nbrs_

TagMobilityHandler* tag_mobility_
Tag mobility stuff

Event* tag_mobility_event_

double mobility_period_

virtual void MoveTags()

virtual void AddMobileTag(void *mobile_tag)

compr_taglist* mobile_tags_
Pointer to tags that have moved within this sensor's range while the sensor was dead

TagAdvtHandler* tag_advt_handler_

Event* tag_advt_event_

RNG* tag_rng_

void SendChangedTagListUpdate(int our_tag_changed, int level)

int compare_tag_lists(compr_taglist *tag_list1, int num_tags1, compr_taglist *tag_list2, int num_tags2)


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

Adapted for the NS documentation page

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de