84 lines
2.4 KiB
C
84 lines
2.4 KiB
C
/*
|
|
* Copyright (c) 2016 Intel Corporation.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief Network Events code public header
|
|
*/
|
|
|
|
#ifndef __NET_EVENT_H__
|
|
#define __NET_EVENT_H__
|
|
|
|
/* IPv6 Events */
|
|
#define _NET_IPV6_LAYER NET_MGMT_LAYER_L3
|
|
#define _NET_IPV6_CORE_CODE 0x600
|
|
#define _NET_EVENT_IPV6_BASE (NET_MGMT_EVENT_BIT | \
|
|
NET_MGMT_IFACE_BIT | \
|
|
NET_MGMT_LAYER(_NET_IPV6_LAYER) | \
|
|
NET_MGMT_LAYER_CODE(_NET_IPV6_CORE_CODE))
|
|
|
|
enum net_event_ipv6_cmd {
|
|
NET_EVENT_IPV6_CMD_ADDR_ADD = 0,
|
|
NET_EVENT_IPV6_CMD_ADDR_DEL,
|
|
NET_EVENT_IPV6_CMD_MADDR_ADD,
|
|
NET_EVENT_IPV6_CMD_MADDR_DEL,
|
|
NET_EVENT_IPV6_CMD_PREFIX_ADD,
|
|
NET_EVENT_IPV6_CMD_PREFIX_DEL,
|
|
};
|
|
|
|
#define NET_EVENT_IPV6_ADDR_ADD \
|
|
(_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_ADD)
|
|
|
|
#define NET_EVENT_IPV6_ADDR_DEL \
|
|
(_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_ADDR_DEL)
|
|
|
|
#define NET_EVENT_IPV6_MADDR_ADD \
|
|
(_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_ADD)
|
|
|
|
#define NET_EVENT_IPV6_MADDR_DEL \
|
|
(_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_MADDR_DEL)
|
|
|
|
#define NET_EVENT_IPV6_PREFIX_ADD \
|
|
(_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_ADD)
|
|
|
|
#define NET_EVENT_IPV6_PREFIX_DEL \
|
|
(_NET_EVENT_IPV6_BASE | NET_EVENT_IPV6_CMD_PREFIX_DEL)
|
|
|
|
#define _NET_IPV4_LAYER NET_MGMT_LAYER_L3
|
|
#define _NET_IPV4_CORE_CODE 0x400
|
|
#define _NET_EVENT_IPV4_BASE (NET_MGMT_EVENT_BIT | \
|
|
NET_MGMT_IFACE_BIT | \
|
|
NET_MGMT_LAYER(_NET_IPV4_LAYER) | \
|
|
NET_MGMT_LAYER_CODE(_NET_IPV4_CORE_CODE))
|
|
|
|
/* IPv4 Events*/
|
|
enum net_event_ipv4_cmd {
|
|
NET_EVENT_IPV4_CMD_ADDR_ADD = 0,
|
|
NET_EVENT_IPV4_CMD_ADDR_DEL,
|
|
NET_EVENT_IPV4_CMD_ROUTER_ADD,
|
|
};
|
|
|
|
#define NET_EVENT_IPV4_ADDR_ADD \
|
|
(_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_ADD)
|
|
|
|
#define NET_EVENT_IPV4_ADDR_DEL \
|
|
(_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ADDR_DEL)
|
|
|
|
#define NET_EVENT_IPV4_ROUTER_ADD \
|
|
(_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD)
|
|
|
|
#endif /* __NET_EVENT_H__ */
|