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 lqe
34 * service
35 *
36 * $Id: lqe.h,v 1.1 2005-01-26 01:24:18 cerpa Exp $
37 */
38
39 #ifndef __LQE_H__
40 #define __LQE_H__
41
42 #include "libdev/glib_dev.h"
43 #include "link/link.h"
44
45 /* maximum number of sources in the system (this should be allocated
46 * dynamically at some point in time)
47 */
48 #define MAX_SRC 110
49
50 /*
51 * State about a particular neighbor -- The information that is
52 * exported to users of the daemon
53 */
54 typedef struct neigh {
55 if_id_t if_id; /* Neighbor's interface ID */
56 conn_t conn_in[MAX_SRC]; /* Neighbor's incoming conn value based
57 on the source */
58 struct timeval last_heard; /* Last time heard from this neighbor */
59 } neigh_t;
60
61
62 /*
63 * These function calls are used by your application to set up a
64 * connection to the lqe service.
65 */
66
67 /* Callback to be activated when a new neighborlist is available.
68 * This is malloced memory that YOU are responsible for freeing. */
69 typedef gint (*new_info_cb_t)(neigh_t *nb_list, int count, void *data);
70
71 typedef struct lqe_opts {
72 char *link_name; /* the link we want the neighbors stats of */
73 new_info_cb_t new_info; /* callback for new neighborlists */
74 void *data; /* user data */
75 } lqe_opts_t;
76
77
78 /* start lqe notification */
79 int g_lqe(lqe_opts_t *lqe_opts, status_client_context_t **ref);
80
81 #endif /* __LQE_H__ */
82
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.