N-sim
Emulation and simulation of
Wireless Sensor Networks



   Home


   Project Page


   Download


   CVS



   Installation


   Configuration


   Plug-ins




 Hosted by
SourceForge.net Logo

/home/brennan/n-sim/Vaike/linux/system-addons/networking/mesh_neighbor.h File Reference

WSN mesh network routing neighbors. More...

#include <netinet/in.h>
#include "sensor_self.h"
#include "mesh_ipc.h"

Go to the source code of this file.

Classes

struct  _neighbor_entry

Defines

#define MESH_N_COMM_PORT   1010

Typedefs

typedef _neighbor_entry neighbor_entry_t

Functions

void init_n_entry (self_t *self, neighbor_entry_t *entry)
neighbor_entry_tnew_n_entry (self_t *self)
int add_n_entry (self_t *self, unsigned int id, neighbor_entry_t *entry)
int remove_n_entry (self_t *self, unsigned int id, neighbor_entry_t *entry)
neighbor_entry_tretrieve_n_entry (self_t *self, unsigned int id)
neighbor_entry_titerate_n_entries (self_t *self)
unsigned int num_n_entries (self_t *self)
void empty_n_entries (self_t *self)
int neighbor_address (self_t *self, char *addr, double bearing, double distance)
int neighbor_position (self_t *self, double *bearing, double *distance, char *addr)
neighbor_entry_tneighbor_by_position (self_t *self, double bearing, double distance)
neighbor_entry_tneighbor_by_ip (self_t *self, struct sockaddr_in *ip)
int find_neighbors (self_t *self)
int neighbor_discovery (self_t *self)


Detailed Description

WSN mesh network routing neighbors.

Revision
1.1

Original Author: Sean M. Brennan <brennan@lanl.gov>

Author
sean_m_brennan

Created: August 1, 2007

Date
2008/02/03 22:00:49

Definition in file mesh_neighbor.h.


Define Documentation

#define MESH_N_COMM_PORT   1010
 

Definition at line 43 of file mesh_neighbor.h.

Referenced by neighbor_discovery().


Typedef Documentation

typedef struct _neighbor_entry neighbor_entry_t
 

We use a currently unassigned IANA port * http://www.iana.org/assignments/port-numbers


Function Documentation

int add_n_entry self_t self,
unsigned int  id,
neighbor_entry_t entry
 

Definition at line 82 of file mesh_neighbor.c.

References avl_insert(), _self::neighbors, and _neighbor_entry::node_id.

Referenced by neighbor_discovery().

void empty_n_entries self_t self  ) 
 

Definition at line 130 of file mesh_neighbor.c.

References destroy_avltree(), iterate_n_entries(), _self::neighbors, and avltree::root.

int find_neighbors self_t self  ) 
 

Definition at line 200 of file mesh_neighbor.c.

References _self::altitude, _self::broadcast, he, HELLO_LEN, _self::interface, _self::latitude, _self::longitude, _self::mac_addr, MESH_N_DISCOVERY_PORT, mesh_sendmsg(), and mesh_socket().

Referenced by neighbor_discovery().

void init_n_entry self_t self,
neighbor_entry_t entry
 

Definition at line 65 of file mesh_neighbor.c.

References _neighbor_entry::alt, _neighbor_entry::lat, _neighbor_entry::lon, _self::mac_addr, mac_to_id(), and _neighbor_entry::node_id.

Referenced by new_n_entry().

neighbor_entry_t* iterate_n_entries self_t self  ) 
 

Definition at line 110 of file mesh_neighbor.c.

References avl_find_min(), _self::n_iter, and _self::neighbors.

Referenced by empty_n_entries(), neighbor_by_ip(), and neighbor_by_position().

int neighbor_address self_t self,
char *  addr,
double  bearing,
double  distance
 

Definition at line 172 of file mesh_neighbor.c.

References _neighbor_entry::address, MAC_ADDR_LEN, memcpy, and neighbor_by_position().

neighbor_entry_t* neighbor_by_ip self_t self,
struct sockaddr_in *  ip
 

Definition at line 158 of file mesh_neighbor.c.

References _neighbor_entry::ip, and iterate_n_entries().

Referenced by mesh_recv_nextdoor().

neighbor_entry_t* neighbor_by_position self_t self,
double  bearing,
double  distance
 

Definition at line 143 of file mesh_neighbor.c.

References _neighbor_entry::bearing, _neighbor_entry::distance, and iterate_n_entries().

Referenced by mesh_send_nextdoor(), and neighbor_address().

int neighbor_discovery self_t self  ) 
 

Definition at line 273 of file mesh_neighbor.c.

References add_n_entry(), _self::altitude, error, find_neighbors(), HELLO_INTERVAL, HELLO_LEN, _self::interface, _self::latitude, _self::longitude, mac_to_id(), memcpy, MESH_N_COMM_PORT, MESH_N_DISCOVERY_PORT, mesh_socket(), new_n_entry(), and timed_recv().

Referenced by discover_neighbors().

int neighbor_position self_t self,
double *  bearing,
double *  distance,
char *  addr
 

Definition at line 185 of file mesh_neighbor.c.

References _neighbor_entry::address, _neighbor_entry::bearing, _neighbor_entry::distance, MAC_ADDR_LEN, mac_to_id(), and retrieve_n_entry().

neighbor_entry_t* new_n_entry self_t self  ) 
 

Definition at line 74 of file mesh_neighbor.c.

References init_n_entry().

Referenced by neighbor_discovery().

unsigned int num_n_entries self_t self  ) 
 

Definition at line 124 of file mesh_neighbor.c.

References avl_size(), and _self::neighbors.

int remove_n_entry self_t self,
unsigned int  id,
neighbor_entry_t entry
 

Definition at line 94 of file mesh_neighbor.c.

References avl_delete(), and _self::neighbors.

neighbor_entry_t* retrieve_n_entry self_t self,
unsigned int  id
 

Definition at line 104 of file mesh_neighbor.c.

References avl_retrieve(), and _self::neighbors.

Referenced by neighbor_position().


© 2007, Los Alamos National Security, LLC.