1 /*
2 *
3 * Copyright (c) 2005 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 * libmacinfo.h:
34 * Library code that intercepts low-level MAC info, caches it for
35 * lookup, and passes it to timesync
36 *
37 * $Id: libmacinfo.h,v 1.2 2005-08-28 18:29:30 girod Exp $
38 */
39
40 #ifndef __LIBMACINFO_H__
41 #define __LIBMACINFO_H__
42
43 typedef struct macinfo macinfo_t;
44
45 typedef struct macinfo_opts {
46 char *iface;
47 char *device;
48 void (*unblock_notify)(macinfo_t *);
49 void (*send_receipt)(macinfo_t *, link_pkt_t *);
50 int no_sync;
51 void *private_data;
52 } macinfo_opts_t;
53
54
55 /*
56 * if you're NOT using macinfo timestamps in your link driver,
57 * you can use this function to set the if_rcv_time to CPU time
58 */
59 void macinfo_set_rcv_time(link_pkt_t *link_pkt, struct timeval *rcv_time);
60
61 int macinfo_process_message(macinfo_t *m, link_pkt_t *pkt);
62
63 /* returns flags value if there is room */
64 /* returns 0 if no room */
65 int macinfo_request_receipt(macinfo_t *m, link_pkt_t *pkt);
66
67 int macinfo_init(macinfo_opts_t *opts, int *argc, char **argv, macinfo_t **ref);
68 void macinfo_destroy(macinfo_t *m);
69
70 /* access private data field */
71 void *macinfo_data(macinfo_t *m);
72
73 #endif
74
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.