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

Linux Cross Reference
cvs/emstar/link/include/neighbor_structs.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 for talking to the neighbor service
 34  *
 35  * $Id: neighbor_structs.h,v 1.2 2004-10-26 18:46:15 girod Exp $
 36  */
 37 
 38 #ifndef __NEIGHBOR_STRUCTS_H__
 39 #define __NEIGHBOR_STRUCTS_H__
 40 
 41 
 42 /* States that a neighbor can be in */
 43 typedef enum {
 44   NB_UNKNOWN = 0,       /* Initial state (you should never see this) */
 45   SELF = 1,             /* Nodes have entries for themselves */
 46   ASYMMETRIC = 2,       /* We hear them; they can't hear us */
 47   ACTIVE = 3,           /* We hear them and they hear us */
 48   DEAD = 4,             /* Was active and has since timed out */
 49 } neighbor_state_t;
 50 
 51 /*
 52  * State about a particular neighbor -- The information that is
 53  * exported to users of the daemon
 54  */
 55 typedef struct neighbor {
 56   node_id_t node_id;          /* Neighbor's node ID */
 57   if_id_t if_id;              /* Neighbor's network interface ID */
 58   loc_t loc;                  /* Neighbor's claimed location */
 59   uint8_t interface;          /* interface index */
 60   neighbor_state_t state:8;   /* state: ACTIVE, DEAD, etc. */
 61   uint16_t pad;               /* alignment pad */
 62   conn_t conn_from;           /* percentage (%) of packets successfully
 63                                  RECEIVED from this neighbor (IN) */
 64   conn_t conn_to;             /* percentage (%) of packets successfully
 65                                  SENT to this neighbor (OUT) */
 66   int period;                 /* Neighbor's claimed HB period (ms) */
 67   struct timeval last_heard;  /* Time we last heard from this neigh */
 68   struct timeval last_ack;    /* Time we sent the last pkt that the
 69                                  neighbor reported having received */
 70 } neighbor_t;
 71 
 72 #endif /* __NEIGHBOR_STRUCTS_H__ */
 73 

~ [ 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.