|
|
|
|
/home/brennan/n-sim/Vaike/linux/system-addons/networking/mesh_net.h File ReferenceNetworking 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 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(). |
Typedef Documentation
Function Documentation
ssize_t mesh_raw_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 |
|
) |
|
|
|
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 |
|
) |
|
|
ssize_t mesh_recvmsg |
( |
int |
sd, |
|
|
void * |
buf, |
|
|
size_t |
len, |
|
|
struct sockaddr_in * |
from, |
|
|
struct msghdr * |
msg_header, |
|
|
size_t |
ctl_msg_size |
|
) |
|
|
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 |
|
) |
|
|
ssize_t mesh_sendmsg |
( |
char * |
ifname, |
|
|
char * |
ifaddr, |
|
|
int |
sd, |
|
|
void * |
buf, |
|
|
size_t |
len, |
|
|
struct sockaddr_in * |
to |
|
) |
|
|
int mesh_socket |
( |
char * |
ifname, |
|
|
unsigned int |
port |
|
) |
|
|
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 |
|
) |
|
|
int timed_recv_peek |
( |
int |
sd, |
|
|
void * |
buf, |
|
|
int |
bytes, |
|
|
struct sockaddr_in * |
sa, |
|
|
int |
timeout |
|
) |
|
|
|