2 * Copyright (c) 2010-2011 Monthadar Al Jaberi, TerraNet AB
5 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer,
13 * without modification.
14 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
15 * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
16 * redistribution must be conditioned upon including a substantially
17 * similar Disclaimer requirement for further binary redistribution.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
23 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
24 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
25 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
28 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGES.
35 #ifndef __DEV_WTAP_MEDIUM_H__
36 #define __DEV_WTAP_MEDIUM_H__
38 #include "if_wtapvar.h"
39 #include "wtap_hal/handler.h"
42 STAILQ_ENTRY(packet) pf_list;
46 typedef STAILQ_HEAD(, packet) md_pkthead;
51 int visibility[MAX_NBR_WTAP];
52 struct stailhead *headp;
54 STAILQ_HEAD(stailhead, packet) pktbuf;
55 STAILQ_HEAD(stailhead, packet) pktbuf;
56 /* = STAILQ_HEAD_INITIALIZER(head); */
58 /* 0 means we drop packets, 1 we queue them */
60 md_pkthead md_pktbuf; /* master queue */
61 struct eventhandler *tx_handler;
62 struct timehandler *bc_handler;
65 extern void init_medium(struct wtap_medium *);
66 extern void deinit_medium(struct wtap_medium *);
67 extern void medium_open(struct wtap_medium *);
68 extern void medium_close(struct wtap_medium *);
69 extern int medium_transmit(struct wtap_medium *, int id, struct mbuf*);
70 extern struct packet *medium_get_next_packet(struct wtap_medium *);
72 #endif /* __DEV_WTAP_MEDIUM_H__ */