Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
virtual_mgmt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_NET_VIRTUAL_MGMT_H_
13#define ZEPHYR_INCLUDE_NET_VIRTUAL_MGMT_H_
14
15#include <net/virtual.h>
16#include <net/net_mgmt.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
31#define _NET_VIRTUAL_INTERFACE_LAYER NET_MGMT_LAYER_L2
32#define _NET_VIRTUAL_INTERFACE_CODE 0x209
33#define _NET_VIRTUAL_INTERFACE_BASE \
34 (NET_MGMT_IFACE_BIT | \
35 NET_MGMT_LAYER(_NET_VIRTUAL_INTERFACE_LAYER) | \
36 NET_MGMT_LAYER_CODE(_NET_VIRTUAL_INTERFACE_CODE))
37#define _NET_VIRTUAL_INTERFACE_EVENT \
38 (_NET_VIRTUAL_INTERFACE_BASE | NET_MGMT_EVENT_BIT)
39
40struct virtual_interface_req_params {
41 sa_family_t family;
42 union {
43 struct in_addr peer4addr;
44 struct in6_addr peer6addr;
45 int mtu;
46 };
47};
48
49enum net_request_virtual_interface_cmd {
50 NET_REQUEST_VIRTUAL_INTERFACE_CMD_SET_PEER_ADDR = 1,
51 NET_REQUEST_VIRTUAL_INTERFACE_CMD_GET_PEER_ADDR,
52 NET_REQUEST_VIRTUAL_INTERFACE_CMD_SET_MTU,
53 NET_REQUEST_VIRTUAL_INTERFACE_CMD_GET_MTU,
54};
55
56#define NET_REQUEST_VIRTUAL_INTERFACE_SET_PEER_ADDRESS \
57 (_NET_VIRTUAL_INTERFACE_BASE | \
58 NET_REQUEST_VIRTUAL_INTERFACE_CMD_SET_PEER_ADDR)
59
60NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_VIRTUAL_INTERFACE_SET_PEER_ADDRESS);
61
62#define NET_REQUEST_VIRTUAL_INTERFACE_SET_MTU \
63 (_NET_VIRTUAL_INTERFACE_BASE | \
64 NET_REQUEST_VIRTUAL_INTERFACE_CMD_SET_MTU)
65
66NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_VIRTUAL_INTERFACE_SET_MTU);
67
68#define NET_REQUEST_VIRTUAL_INTERFACE_GET_PEER_ADDRESS \
69 (_NET_VIRTUAL_INTERFACE_BASE | \
70 NET_REQUEST_VIRTUAL_INTERFACE_CMD_GET_PEER_ADDR)
71
72NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_VIRTUAL_INTERFACE_GET_PEER_ADDRESS);
73
74#define NET_REQUEST_VIRTUAL_INTERFACE_GET_MTU \
75 (_NET_VIRTUAL_INTERFACE_BASE | \
76 NET_REQUEST_VIRTUAL_INTERFACE_CMD_GET_MTU)
77
78NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_VIRTUAL_INTERFACE_GET_MTU);
79
80struct net_if;
81
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* ZEPHYR_INCLUDE_NET_VIRTUAL_MGMT_H_ */
unsigned short int sa_family_t
Definition: net_ip.h:158
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
Definition: net_mgmt.h:95
Network Management API public header.
Definition: net_ip.h:139
Definition: net_ip.h:148
Network Interface structure.
Definition: net_if.h:468
Virtual Network Interface.