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