Show link_multi.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.
*
*/
#include "link/link.h"
#ifndef __LINK_MULTI_H__
#define __LINK_MULTI_H__
typedef struct _lu_multi_context lu_multi_context_t;
typedef struct _lu_multi_link lu_multi_link_t;
typedef int (*lu_multi_receive_cb_t)(lu_multi_link_t *lu_l, link_pkt_t *pkt, int data_len);
typedef void (*lu_multi_notify_cb_t)(lu_multi_context_t *lu_m, lu_multi_link_t *l);
typedef struct lu_multi_opts {
/* template options for new links */
lu_opts_t lu_opts;
/* specify a set of links: */
char *if_class; /* by interface class */
char *neighbors_list; /* comma-sep list of addl neighbors devs */
/* notification callbacks */
lu_multi_notify_cb_t new_link; /* new link opened */
lu_multi_notify_cb_t neighbor_change; /* neighbors change */
lu_multi_notify_cb_t status_notify; /* status arrived */
lu_multi_receive_cb_t receive; /* on packet arrival */
int withhold_warning; /* prevents warning about no links */
} lu_multi_opts_t;
/* opens multiple links based on link class */
int lu_open_multi(lu_multi_opts_t *opts, lu_multi_context_t **ref);
void lu_multi_destroy(lu_multi_context_t *lu);
/* multi send */
int lu_multi_send(lu_multi_context_t *lm, int interface, link_pkt_t *pkt, ssize_t data_len);
int lu_multi_get_if_id(lu_multi_context_t *lum, int interface, if_id_t *iid);
/*
* *** IMPORTANT *** don't use the underlying lu_context data pointer!
* this pointer is used internally by multi_link!
*/
/* get the link user context */
lu_context_t *lu_multi_link_get_lu(lu_multi_link_t *l);
/* get/set private data from a 'multi link' */
void *lu_multi_link_get_data(lu_multi_link_t *l);
void lu_multi_link_set_data(lu_multi_link_t *l, void *);
/* get the index, name of a multi link */
int lu_multi_link_get_index(lu_multi_link_t *l);
char *lu_multi_link_get_name(lu_multi_link_t *l);
/* get the parent context of a multi link */
lu_multi_context_t *lu_multi_link_get_parent(lu_multi_link_t *l);
void *lu_multi_get_data(lu_multi_context_t *lm);
lu_multi_link_t *lu_multi_index_link(lu_multi_context_t *lu, int index);
lu_multi_link_t *lu_multi_lookup_link(lu_multi_context_t *lu, const char *name);
/* "ARP" feature..
* returns 0 if found and ACTIVE.
* returns 1 if found but not ACTIVE.
* returns -1 if not found */
int lu_multi_if_to_node(lu_multi_context_t *lu, if_id_t if_id, node_id_t *node_id);
int lu_multi_node_to_if(lu_multi_context_t *lu, node_id_t node_id, if_id_t *if_id, int *index);
int lu_multi_link_get_conn(lu_multi_link_t *l, if_id_t if_id);
/* iterator */
lu_multi_link_t *lu_multi_links_top(lu_multi_context_t *lu);
lu_multi_link_t *lu_multi_links_next(lu_multi_link_t *ptr);
int lu_multi_links_qlen(lu_multi_context_t *lu);
#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