00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _SENSOR_MESH_H_
00036 #define _SENSOR_MESH_H_
00037
00038 #include <netinet/in.h>
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00045 int mesh_proactive_rediscover(char *protocol_name);
00046
00047 double mesh_route_reliability(char *destination);
00048 double mesh_route_goodput(char *destination);
00049 double mesh_route_energy_cost(char *destination);
00050
00051 double mesh_link_reliability(float angle, int dist);
00052 double mesh_link_goodput(float angle, int dist);
00053 double mesh_link_energy_cost(float angle, int dist);
00054
00056 ssize_t mesh_sendto(int sd, void *buf, size_t len,
00057 struct sockaddr_in *to);
00058 ssize_t mesh_recvfrom(int sd, void *buf, size_t len,
00059 struct sockaddr_in *from);
00060
00062 ssize_t mesh_raw_sendto(int sd, void *buf, size_t len,
00063 struct sockaddr_in *to);
00064 ssize_t mesh_raw_recvfrom(int sd, void *buf, size_t len,
00065 struct sockaddr_in *from);
00066
00068 ssize_t mesh_sendto_nextdoor(int sd, void *buf, size_t len,
00069 float angle, int dist);
00070 ssize_t mesh_recvfrom_nextdoor(int sd, void *buf, size_t len,
00071 float *angle, int *dist);
00072
00073 int neighbor_address(unsigned char *mac_addr,
00074 float angle, unsigned int dist);
00075 int neighbor_position(float *angle, unsigned int *dist,
00076 unsigned char *mac_addr);
00077
00078 int mesh_get_recvbuf(void);
00079 int mesh_set_recvbuf(int size);
00080 int mesh_get_sendbuf(void);
00081 int mesh_set_sendbuf(int size);
00082 int mesh_get_mtu(void);
00083 int mesh_set_mtu(int size);
00084 int mesh_get_resend_timeout(struct timeval *tv);
00085 int mesh_set_resend_timeout(struct timeval *tv);
00086
00087
00088 #ifdef __cplusplus
00089 }
00090 #endif
00091
00092 #endif // _SENSOR_MESH_H_