Skip to content

Commit 26afcb6

Browse files
jukkarkartben
authored andcommitted
net: mgmt: Central place for allocating layer specific codes
Instead of littering the source tree with hard to track layer code definitions, have a central place where to register the layer codes. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 92fa83f commit 26afcb6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

include/zephyr/net/net_mgmt.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,31 @@ struct net_if;
7676

7777
/** @endcond */
7878

79+
/** @brief Central place the definition of the layer codes (7 bit value) */
80+
enum net_mgmt_layer_code {
81+
NET_MGMT_LAYER_CODE_UNKNOWN = 0x00, /**< Unknown layer code, do not use */
82+
NET_MGMT_LAYER_CODE_IFACE = 0x01, /**< Network interface layer code */
83+
NET_MGMT_LAYER_CODE_CONN = 0x02, /**< Connectivity layer code */
84+
NET_MGMT_LAYER_CODE_IPV4 = 0x03, /**< IPv4 layer code */
85+
NET_MGMT_LAYER_CODE_IPV6 = 0x04, /**< IPv6 layer code */
86+
NET_MGMT_LAYER_CODE_L4 = 0x05, /**< L4 layer code */
87+
NET_MGMT_LAYER_CODE_COAP = 0x06, /**< CoAP layer code */
88+
NET_MGMT_LAYER_CODE_STATS = 0x07, /**< Statistics layer code */
89+
NET_MGMT_LAYER_CODE_HOSTAP = 0x08, /**< Hostap (wpa_supplicant) layer code */
90+
NET_MGMT_LAYER_CODE_ETHERNET = 0x09, /**< Ethernet layer code */
91+
NET_MGMT_LAYER_CODE_IEEE802514 = 0x0A, /**< IEEE 802.15.4 layer code */
92+
NET_MGMT_LAYER_CODE_PPP = 0x0B, /**< PPP layer code */
93+
NET_MGMT_LAYER_CODE_VIRTUAL = 0x0C, /**< Virtual network interface layer code */
94+
NET_MGMT_LAYER_CODE_WIFI = 0x0D, /**< Wi-Fi layer code */
95+
96+
/* Out of tree code can use the following userX layer codes */
97+
NET_MGMT_LAYER_CODE_USER3 = 0x7C, /**< User layer code 3 */
98+
NET_MGMT_LAYER_CODE_USER2 = 0x7D, /**< User layer code 2 */
99+
NET_MGMT_LAYER_CODE_USER1 = 0x7E, /**< User layer code 1 */
100+
101+
/* Reserved layer code for future use */
102+
NET_MGMT_LAYER_CODE_RESERVED = 0x7F /**< Reserved layer code for future use */
103+
};
79104

80105
/**
81106
* @typedef net_mgmt_request_handler_t

0 commit comments

Comments
 (0)