diff --git a/include/net/net_event.h b/include/net/net_event.h index 4b1af1495f2..54a160f7d91 100644 --- a/include/net/net_event.h +++ b/include/net/net_event.h @@ -146,6 +146,25 @@ enum net_event_ipv4_cmd { #define NET_EVENT_IPV4_ROUTER_DEL \ (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_DEL) +/* L4 network events */ +#define _NET_L4_LAYER NET_MGMT_LAYER_L4 +#define _NET_L4_CORE_CODE 0x114 +#define _NET_EVENT_L4_BASE (NET_MGMT_EVENT_BIT | \ + NET_MGMT_IFACE_BIT | \ + NET_MGMT_LAYER(_NET_L4_LAYER) | \ + NET_MGMT_LAYER_CODE(_NET_L4_CORE_CODE)) + +enum net_event_l4_cmd { + NET_EVENT_L4_CMD_CONNECTED = 1, + NET_EVENT_L4_CMD_DISCONNECTED, +}; + +#define NET_EVENT_L4_CONNECTED \ + (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_CONNECTED) + +#define NET_EVENT_L4_DISCONNECTED \ + (_NET_EVENT_L4_BASE | NET_EVENT_L4_CMD_DISCONNECTED) + /** @endcond */ #ifdef CONFIG_NET_MGMT_EVENT_INFO diff --git a/include/net/net_mgmt.h b/include/net/net_mgmt.h index 98a0e73bc0b..c29fed733f1 100644 --- a/include/net/net_mgmt.h +++ b/include/net/net_mgmt.h @@ -68,6 +68,7 @@ struct net_if; /* Useful generic definitions */ #define NET_MGMT_LAYER_L2 1 #define NET_MGMT_LAYER_L3 2 +#define NET_MGMT_LAYER_L4 3 /** @endcond */