Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
dummy.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
13#ifndef ZEPHYR_INCLUDE_NET_DUMMY_H_
14#define ZEPHYR_INCLUDE_NET_DUMMY_H_
15
16#include <zephyr/net/net_if.h>
17#include <zephyr/net/net_pkt.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
31struct dummy_api {
36 struct net_if_api iface_api;
37
39 int (*send)(const struct device *dev, struct net_pkt *pkt);
40
45 enum net_verdict (*recv)(struct net_if *iface, struct net_pkt *pkt);
46
48 int (*start)(const struct device *dev);
49
51 int (*stop)(const struct device *dev);
52};
53
54/* Make sure that the network interface API is properly setup inside
55 * dummy API struct (it is the first one).
56 */
57BUILD_ASSERT(offsetof(struct dummy_api, iface_api) == 0);
58
59#ifdef __cplusplus
60}
61#endif
62
67#endif /* ZEPHYR_INCLUDE_NET_DUMMY_H_ */
net_verdict
Net Verdict.
Definition net_core.h:100
Public API for network interface.
Network packet buffer descriptor API.
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
Dummy L2 API operations.
Definition dummy.h:31
int(* stop)(const struct device *dev)
Stop the device.
Definition dummy.h:51
enum net_verdict(* recv)(struct net_if *iface, struct net_pkt *pkt)
Receive a network packet (only limited use for this, for example receiving capturing packets and post...
Definition dummy.h:45
int(* send)(const struct device *dev, struct net_pkt *pkt)
Send a network packet.
Definition dummy.h:39
int(* start)(const struct device *dev)
Start the device.
Definition dummy.h:48
struct net_if_api iface_api
The net_if_api must be placed in first position in this struct so that we are compatible with network...
Definition dummy.h:36
Network Interface structure.
Definition net_if.h:678
Network packet.
Definition net_pkt.h:67