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_net.h File Reference

Networking primitives for WSN mesh. More...

#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <net/ethernet.h>

Go to the source code of this file.

Classes

struct  mesh_hdr

Defines

#define NET_ADDR_LEN   23
#define MAC_ADDR_LEN   8
#define MESH_HEADER_SPACE

Typedefs

typedef u_int32_t seqnum_t

Functions

int reliable_net (struct _self *self)
int mesh_socket (char *ifname, unsigned int port)
ssize_t mesh_raw_send (struct _protocol *proto, int sd, void *buf, size_t len, struct sockaddr_in *to)
ssize_t mesh_send (struct _protocol *proto, int sd, void *buf, size_t len, struct sockaddr_in *to)
ssize_t mesh_recv (struct _self *self, int sd, void *buf, size_t len, struct sockaddr_in *from)
ssize_t mesh_send_nextdoor (struct _self *self, int sd, void *buf, size_t len, double angle, double dist)
ssize_t mesh_recv_nextdoor (struct _self *self, int sd, void *buf, size_t len, double *angle, double *dist)
int timed_recv (int sd, void *buf, int bytes, struct sockaddr_in *sa, int timeout)
int timed_recv_peek (int sd, void *buf, int bytes, struct sockaddr_in *sa, int timeout)
ssize_t mesh_sendmsg (char *ifname, char *ifaddr, int sd, void *buf, size_t len, struct sockaddr_in *to)
ssize_t mesh_recvmsg (int sd, void *buf, size_t len, struct sockaddr_in *from, struct msghdr *msg_header, size_t ctl_msg_size)


Detailed Description

Networking primitives for WSN mesh.

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_net.h.


Define Documentation

#define MAC_ADDR_LEN   8
 

Definition at line 47 of file mesh_net.h.

Referenced by init_self(), mesh_link_energy(), mesh_link_goodput(), mesh_link_reliability(), mesh_recvfrom_nextdoor(), mesh_sendto_nextdoor(), neighbor_address(), and neighbor_position().

#define MESH_HEADER_SPACE
 

Value:

(ETHER_HDR_LEN + sizeof(struct ip) + \
                            sizeof(struct udphdr) + sizeof(struct mesh_hdr))

Definition at line 59 of file mesh_net.h.

Referenced by mesh_ioctl().

#define NET_ADDR_LEN   23
 

Definition at line 46 of file mesh_net.h.

Referenced by consume(), init_self(), link_entry_to_rtentry(), link_to_string(), main(), mesh_raw_recvfrom(), mesh_recvfrom(), produce(), sensor_ctl(), and strength_send_mesh_discovery().


Typedef Documentation

typedef u_int32_t seqnum_t
 

Definition at line 50 of file mesh_net.h.


Function Documentation

ssize_t mesh_raw_send struct _protocol proto,
int  sd,
void *  buf,
size_t  len,
struct sockaddr_in *  to
 

Definition at line 700 of file mesh_net.c.

References _self::interface, _self::mac_addr, memcpy, mesh_sendmsg(), mesh_hdr::nack, mesh_hdr::protocol_id, mesh_hdr::raw, _protocol::sensor, mesh_hdr::seq_num, and _protocol::unique_id.

ssize_t mesh_recv struct _self self,
int  sd,
void *  buf,
size_t  len,
struct sockaddr_in *  from
 

Definition at line 763 of file mesh_net.c.

References _q::data, _self::interface, _q::len, _self::mac_addr, max_ctl_size(), MAX_SEQNUM, memcpy, mesh_recvmsg(), mesh_sendmsg(), mesh_hdr::nack, _q::port, protocol_by_id(), mesh_hdr::protocol_id, mesh_hdr::raw, _link_entry::recv_seq_num, retrieve_entry(), retrieve_msg(), and mesh_hdr::seq_num.

ssize_t mesh_recv_nextdoor struct _self self,
int  sd,
void *  buf,
size_t  len,
double *  angle,
double *  dist
 

Definition at line 841 of file mesh_net.c.

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

ssize_t mesh_recvmsg int  sd,
void *  buf,
size_t  len,
struct sockaddr_in *  from,
struct msghdr *  msg_header,
size_t  ctl_msg_size
 

Definition at line 516 of file mesh_net.c.

References analyze(), and memcpy.

Referenced by mesh_recv(), and receive_routes().

ssize_t mesh_send struct _protocol proto,
int  sd,
void *  buf,
size_t  len,
struct sockaddr_in *  to
 

Definition at line 722 of file mesh_net.c.

References add_msg(), _self::interface, _self::mac_addr, MAX_SEQNUM, memcpy, mesh_sendmsg(), mesh_hdr::nack, mesh_hdr::protocol_id, mesh_hdr::raw, retrieve_entry(), _link_entry::send_seq_num, _protocol::sensor, mesh_hdr::seq_num, and _protocol::unique_id.

ssize_t mesh_send_nextdoor struct _self self,
int  sd,
void *  buf,
size_t  len,
double  angle,
double  dist
 

Definition at line 827 of file mesh_net.c.

References _neighbor_entry::ip, and neighbor_by_position().

ssize_t mesh_sendmsg char *  ifname,
char *  ifaddr,
int  sd,
void *  buf,
size_t  len,
struct sockaddr_in *  to
 

Definition at line 463 of file mesh_net.c.

References get_current_time(), and memcpy.

Referenced by find_neighbors(), mesh_raw_send(), mesh_recv(), mesh_send(), route_discovery_done(), and send_routes().

int mesh_socket char *  ifname,
unsigned int  port
 

Definition at line 365 of file mesh_net.c.

References error.

Referenced by find_neighbors(), neighbor_discovery(), and propagate_routes().

int reliable_net struct _self self  ) 
 

Definition at line 860 of file mesh_net.c.

References avl_find_min(), avlnode::element, get_current_time(), _q::id, iterate_entries(), _protocol::iterator, min, _protocol::next, remove_msg(), _link_entry::send_queue, and _q::timeout.

Referenced by semi_reliability().

int timed_recv int  sd,
void *  buf,
int  bytes,
struct sockaddr_in *  sa,
int  timeout
 

Definition at line 579 of file mesh_net.c.

References memcpy.

Referenced by echo_statistics(), gather_statistics(), and neighbor_discovery().

int timed_recv_peek int  sd,
void *  buf,
int  bytes,
struct sockaddr_in *  sa,
int  timeout
 

Definition at line 628 of file mesh_net.c.

References memcpy.


© 2007, Los Alamos National Security, LLC.