1 /*
2  * Copyright (c) 2018 Intel Corporation.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 
8 #ifndef ZEPHYR_INCLUDE_NET_DUMMY_H_
9 #define ZEPHYR_INCLUDE_NET_DUMMY_H_
10 
11 #include <zephyr/net/net_if.h>
12 #include <zephyr/net/net_pkt.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /**
19  * @brief Dummy L2/driver support functions
20  * @defgroup dummy Dummy L2/driver Support Functions
21  * @ingroup networking
22  * @{
23  */
24 
25 struct dummy_api {
26 	/**
27 	 * The net_if_api must be placed in first position in this
28 	 * struct so that we are compatible with network interface API.
29 	 */
30 	struct net_if_api iface_api;
31 
32 	/** Send a network packet */
33 	int (*send)(const struct device *dev, struct net_pkt *pkt);
34 };
35 
36 /* Make sure that the network interface API is properly setup inside
37  * dummy API struct (it is the first one).
38  */
39 BUILD_ASSERT(offsetof(struct dummy_api, iface_api) == 0);
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 /**
46  * @}
47  */
48 
49 #endif /* ZEPHYR_INCLUDE_NET_DUMMY_H_ */
50