|
|
|
|
/home/brennan/n-sim/Vaike/linux/system-addons/networking/mesh_neighbor.c File ReferenceWSN mesh network neighbors. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/route.h>
#include <errno.h>
#include <syslog.h>
#include <netdb.h>
#include <math.h>
#include "mesh_neighbor.h"
#include "sensor_self.h"
Go to the source code of this file.
|
Defines |
#define | MESH_N_DISCOVERY_PORT 652 |
#define | HELLO_LEN ((sizeof(double)*3) + 32) |
#define | HELLO_INTERVAL 180 |
Functions |
unsigned int | mac_to_id (char *addr) |
void | init_n_entry (self_t *self, neighbor_entry_t *entry) |
neighbor_entry_t * | new_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_t * | retrieve_n_entry (self_t *self, unsigned int id) |
neighbor_entry_t * | iterate_n_entries (self_t *self) |
unsigned int | num_n_entries (self_t *self) |
void | empty_n_entries (self_t *self) |
neighbor_entry_t * | neighbor_by_position (self_t *self, double bearing, double distance) |
neighbor_entry_t * | neighbor_by_ip (self_t *self, struct sockaddr_in *ip) |
int | neighbor_address (self_t *self, char *addr, double bearing, double distance) |
int | neighbor_position (self_t *self, double *bearing, double *distance, char *addr) |
int | find_neighbors (self_t *self) |
int | neighbor_discovery (self_t *self) |
Detailed Description
WSN mesh network 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:48
Definition in file mesh_neighbor.c.
Define Documentation
#define HELLO_INTERVAL 180 |
|
#define HELLO_LEN ((sizeof(double)*3) + 32) |
|
#define MESH_N_DISCOVERY_PORT 652 |
|
Function Documentation
void empty_n_entries |
( |
self_t * |
self |
) |
|
|
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(). |
unsigned int mac_to_id |
( |
char * |
addr |
) |
|
|
int neighbor_address |
( |
self_t * |
self, |
|
|
char * |
addr, |
|
|
double |
bearing, |
|
|
double |
distance |
|
) |
|
|
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 |
|
) |
|
|
unsigned int num_n_entries |
( |
self_t * |
self |
) |
|
|
|