Show link_parse.h syntax highlighted
/*
*
* Copyright (c) 2004 The Regents of the University of California. All
* rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Neither the name of the University nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* link_parse.h -- Header for defining packet parsing code
*
* $Id: link_parse.h,v 1.5 2005/01/04 18:19:09 girod Exp $
*/
#include <link/link_headers.h>
#ifndef __LINK_PARSE_H__
#define __LINK_PARSE_H__
/*
* Packet unparse functions
*/
char *dump_ssync_log_cmd(uint8_t cmd);
void dump_ssync_flowid(buf_t *buf, flow_id_t *fid);
int dump_ssync(buf_t *buf, link_pkt_t *pkt, char *data_start,
int data_len, char *prefix, flow_id_t *fid);
char *ssync_flowid_to_str(flow_id_t *fid);
/*
* retrans2 iterator
*/
typedef struct ssync_msg_iter {
/* current message */
char *msg;
int garbage; /* if there was junk at the end.. */
uint8_t command;
uint8_t flow_index;
cl_index_t target;
uint8_t length;
if_id_t if_addr; /* set by the ADDR mapping segments */
flow_entry_t curr_flow; /* set by the FLOW mapping segments */
log_seqno_t seqno;
uint8_t list_index;
uint8_t nack_list_index;
log_seqno_t nack_seqno;
uint16_t nack_count;
uint nack_init:2;
uint valid:1;
uint inc_next:1;
/******
* private
*/
uint nack_cont:1;
ssync_retx2_nack_ctrl_t nack_cmd;
char *data;
int remain;
char *orig;
int orig_len;
uint8_t last_set_length;
int MTU;
buf_t *grow_pkt;
char *last_nack_ctrl;
int header_orig_len;
/* current address map */
if_id_t addr_map[256];
flow_entry_t flow_map[256];
} ssync_msg_iter_t;
ssync_msg_iter_t *ssync_msg_iter_new(char *data, int data_len, int MTU);
void ssync_msg_iter_destroy(ssync_msg_iter_t *iter);
void ssync_msg_iter_top(ssync_msg_iter_t *iter);
int ssync_msg_iter_valid(ssync_msg_iter_t *iter);
void ssync_msg_iter_next(ssync_msg_iter_t *iter);
void ssync_msg_iter_init_msg(ssync_msg_iter_t *iter, int opcode, buf_t *header);
/* length < 0 ==> not set or use last */
int ssync_msg_iter_append_msg(ssync_msg_iter_t *iter,
uint8_t command, uint8_t flow_index, cl_index_t target,
uint8_t list_index, log_seqno_t seqno,
int nack_init, uint16_t nack_count,
char *msg, uint8_t length);
int ssync_msg_iter_maybe_addr_map(ssync_msg_iter_t *iter,
cl_index_t *target, if_id_t if_id);
int ssync_msg_iter_maybe_flow_map(ssync_msg_iter_t *iter,
uint8_t *flow_index, flow_id_t *flow, int hops);
buf_t *ssync_msg_iter_finalize_msg(ssync_msg_iter_t *iter);
int ssync_msg_iter_get_len(ssync_msg_iter_t *iter);
#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
conntest.h
connview.h
libmacinfo.h
link.h
link.run
link_headers.h
link_ioctls.h
link_multi.h
link_parse.h
link_pass.h
link_structs.h
linkstats.h
lqe.h
neighbor.h
neighbor_structs.h