Show reflect.h syntax highlighted
#ifndef __REFLECT_H__
#define __REFLECT_H__
#include "libmisc/misc.h"
#include "link/link.h"
#include "libdev/query_dev.h"
#define PKT_TYPE_REFLECT PKT_TYPE_USER(2)
#define REFLECT_QUERY_DEV_GET sim_path("/dev/reflect/get")
#define REFLECT_QUERY_DEV_SET sim_path("/dev/reflect/set")
/*
* If you update this, then you should also update
* reflect_pkt_names
*/
typedef enum
{
REFLECT_PKT_TYPE_ZERO = 0, // Do not use
REFLECT_PKT_TYPE_BLOCK_HAVE,
REFLECT_PKT_TYPE_SINK_STATUS,
REFLECT_PKT_TYPE_ACK_ARRAY,
REFLECT_PKT_TYPE_NEIGHBOR_LIST
}
reflect_pkt_type_t;
/*
* This makes it easy to translate reflect_pkt_type_t
* values into strings.
*/
char * reflect_pkt_names[] =
{
"ZERO",
"BLOCK_HAVE",
"SINK_STATUS",
"ACK_ARRAY",
"NEIGHBOR_LIST"
};
/*
* Sequence number struct that I use in various places.
*/
typedef struct
{
uint32_t sec;
uint32_t usec;
uint32_t increment;
}
reflect_seq_no_t;
/*
* This can serve as a UID for flooded messages and blocks.
*/
typedef struct
{
uint32_t node_id; // Originating node
reflect_seq_no_t seq_no;
}
block_uid_t;
/*
* Container for various state information.
*/
typedef struct
{
uint32_t type; // reflect_pkt_type_t
uint32_t node_id; // originating node ID
reflect_seq_no_t seq_no; // sequence number
uint32_t data_bytes;
char data[0];
}
reflect_pkt_t;
/*
* Block-have data structure. Indicates the blocks that currently
* reside on a node.
*
* Data points to an array of bundleserver_uid_t;
*/
typedef struct
{
uint32_t byte_length;
char data[0];
}
reflect_block_have_t;
typedef struct
{
GSList * block_have_list; // List of all block_have packets
query_context_t * query_dev_get_ref;
query_context_t * query_dev_set_ref;
}
reflect_state_t;
#endif
See more files for this project here
EmStar is a software system for developing and deploying wireless sensor networks involving Linux-based platforms. As the wireless sensor network community has attempted to deploy more complex designs---large-scale, long-lived systems that need self-organization and adaptivity---a number of difficult software design issues have arisen. Advances in software design have not kept pace with the capabilities of hardware. This is because designing for an adaptive, efficient, and useful sensor network has turned out to be surprisingly complex and difficult. EmStar is a Linux-based software framework, whose goal is to dramatically reduce this complexity, enabling work to be shared and reused, and simplifying and speeding the design of new sensor network applications.
Project homepage:
http://cvs.cens.ucla.edu/emstar/
Programming language(s): C,Shell Script
License: other
TODO
bundleserver.c
bundleserver_i.h
reflect.h
reflect_extras.c
reflect_extras.h
reflect_main.c
state_info.c
state_info.h