~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
cvs/emstar/link/include/linkstats.h


  1 /*
  2  *
  3  * Copyright (c) 2003 The Regents of the University of California.  All 
  4  * rights reserved.
  5  *
  6  * Redistribution and use in source and binary forms, with or without
  7  * modification, are permitted provided that the following conditions
  8  * are met:
  9  *
 10  * - Redistributions of source code must retain the above copyright
 11  *   notice, this list of conditions and the following disclaimer.
 12  *
 13  * - Neither the name of the University nor the names of its
 14  *   contributors may be used to endorse or promote products derived
 15  *   from this software without specific prior written permission.
 16  *
 17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
 18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 19  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 20  * PARTICULAR  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
 21  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 25  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 27  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28  *
 29  */
 30  
 31 
 32 /*
 33  * Structs and interface definitions for talking to the linkstats
 34  * service
 35  *
 36  * $Id: linkstats.h,v 1.6 2004-07-20 00:18:45 fabio Exp $
 37  */
 38 
 39 #ifndef __LINKSTATS_H__
 40 #define __LINKSTATS_H__
 41 
 42 #include "libdev/glib_dev.h"
 43 #include "link/link.h"
 44 
 45 /*
 46  * State about a particular neighbor -- The information that is
 47  * exported to users of the daemon
 48  */
 49 typedef struct neigh {
 50   if_id_t if_id;                /* Neighbor's interface ID */
 51   conn_t conn_in;               /* Neighbor's incoming conn value */
 52   struct timeval last_heard;    /* Last time heard from this neighbor */
 53 } neigh_t;
 54 
 55 
 56 /*
 57  * These function calls are used by your application to set up a
 58  * connection to the linkstats service.
 59  */
 60 
 61 /* Callback to be activated when a new neighborlist is available.
 62  * This is malloced memory that YOU are responsible for freeing. */
 63 typedef gint (*new_info_cb_t)(neigh_t *nb_list, int count, void *data);
 64 
 65 typedef struct linkstats_opts {
 66   char *link_name;        /* the link we want the neighbors stats of */
 67   new_info_cb_t new_info; /* callback for new neighborlists */
 68   void *data;             /* user data */
 69 } linkstats_opts_t;
 70 
 71 
 72 /* start linkstats notification */
 73 int g_linkstats(linkstats_opts_t *linkstats_opts, status_client_context_t **ref);
 74 
 75 #endif /* __NEIGHBOR_H__ */
 76 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.