1 /* ex: set tabstop=2 expandtab shiftwidth=2 softtabstop=2: */
2 /*
3 *
4 * Copyright (c) 2003 The Regents of the University of California. All
5 * rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * - Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 *
14 * - Neither the name of the University nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
22 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 */
31
32 /*
33 *
34 * Author: Nithya Ramanthan
35 *
36 */
37
38
39 #include <sympathy.h>
40
41 /* Sympathy's packet device to interface with other components */
42 int sympathy_send_info(lp_context_t *lp, link_pkt_t *link_pkt,
43 int data_len, int loop_needed)
44 {
45 lp_receive(lp, link_pkt, data_len);
46 return 0;
47 }
48
49 int main(int argc, char** argv)
50 {
51 emrun_opts_t emrun_opts = {
52 silent: 1
53 };
54
55 /* generic initialization common to all programs */
56 misc_init(&argc, argv, CVSTAG);
57
58 /* Open packet device to exchange information and export component info */
59 {
60 lp_opts_t lopts = {
61 opts: {
62 name: SYMPATHY_STATS_DEVICE
63 },
64 send: sympathy_send_info,
65 no_auto_mtu_check: 1,
66 };
67 if ((lp_register(&lopts, NULL)) < 0) {
68 elog(LOG_ERR,"Unable to open link-device: %s: %m\n",
69 lopts.opts.name);
70 return -1;
71 }
72 }
73
74 emrun_init(&emrun_opts);
75 g_main();
76 elog_g(LOG_CRIT, "event loop terminated abnormally!");
77 return 0;
78 }
79
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.