net: Add missing __cplusplus checks to includes

Some of the public networking include files did not had
__cplusplus checks.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2017-07-24 16:23:14 +03:00 committed by Anas Nashif
commit 68ced8035d
13 changed files with 104 additions and 0 deletions

View file

@ -13,6 +13,10 @@
#ifndef __ARP_H #ifndef __ARP_H
#define __ARP_H #define __ARP_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_NET_ARP) #if defined(CONFIG_NET_ARP)
#include <net/ethernet.h> #include <net/ethernet.h>
@ -49,4 +53,8 @@ void net_arp_init(void);
#endif /* CONFIG_NET_ARP */ #endif /* CONFIG_NET_ARP */
#ifdef __cplusplus
}
#endif
#endif /* __ARP_H */ #endif /* __ARP_H */

View file

@ -11,6 +11,10 @@
#ifndef __DHCPV4_H #ifndef __DHCPV4_H
#define __DHCPV4_H #define __DHCPV4_H
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief DHCPv4 * @brief DHCPv4
* @defgroup dhcpv4 DHCPv4 * @defgroup dhcpv4 DHCPv4
@ -68,4 +72,8 @@ const char *net_dhcpv4_state_name(enum net_dhcpv4_state state);
* @} * @}
*/ */
#ifdef __cplusplus
}
#endif
#endif /* __DHCPV4_H */ #endif /* __DHCPV4_H */

View file

@ -16,6 +16,10 @@
#include <net/net_ip.h> #include <net/net_ip.h>
#include <net/net_context.h> #include <net/net_context.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief DNS resolving library * @brief DNS resolving library
* @defgroup dns_resolve DNS Resolve Library * @defgroup dns_resolve DNS Resolve Library
@ -320,4 +324,8 @@ void dns_init_resolver(void);
#define dns_init_resolver(...) #define dns_init_resolver(...)
#endif /* CONFIG_DNS_RESOLVER */ #endif /* CONFIG_DNS_RESOLVER */
#ifdef __cplusplus
}
#endif
#endif /* _DNS_RESOLVE_H */ #endif /* _DNS_RESOLVE_H */

View file

@ -20,6 +20,10 @@
#include <net/net_pkt.h> #include <net/net_pkt.h>
#include <misc/util.h> #include <misc/util.h>
#ifdef __cplusplus
extern "C" {
#endif
#define NET_ETH_HDR(pkt) ((struct net_eth_hdr *)net_pkt_ll(pkt)) #define NET_ETH_HDR(pkt) ((struct net_eth_hdr *)net_pkt_ll(pkt))
#define NET_ETH_PTYPE_ARP 0x0806 #define NET_ETH_PTYPE_ARP 0x0806
@ -64,4 +68,8 @@ static inline bool net_eth_is_addr_multicast(struct net_eth_addr *addr)
const struct net_eth_addr *net_eth_broadcast_addr(void); const struct net_eth_addr *net_eth_broadcast_addr(void);
#ifdef __cplusplus
}
#endif
#endif /* __ETHERNET_H */ #endif /* __ETHERNET_H */

View file

@ -9,6 +9,10 @@
#include <net/net_context.h> #include <net/net_context.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_HTTPS) #if defined(CONFIG_HTTPS)
#if defined(CONFIG_MBEDTLS) #if defined(CONFIG_MBEDTLS)
#if !defined(CONFIG_MBEDTLS_CFG_FILE) #if !defined(CONFIG_MBEDTLS_CFG_FILE)
@ -1048,4 +1052,8 @@ int http_response_404(struct http_server_ctx *ctx, const char *html_payload);
#endif /* CONFIG_HTTP_SERVER */ #endif /* CONFIG_HTTP_SERVER */
#ifdef __cplusplus
}
#endif
#endif /* __HTTP_H__ */ #endif /* __HTTP_H__ */

View file

@ -15,6 +15,10 @@
#include <net/net_mgmt.h> #include <net/net_mgmt.h>
#include <crypto/cipher_structs.h> #include <crypto/cipher_structs.h>
#ifdef __cplusplus
extern "C" {
#endif
#define IEEE802154_MAX_ADDR_LENGTH 8 #define IEEE802154_MAX_ADDR_LENGTH 8
struct ieee802154_security_ctx { struct ieee802154_security_ctx {
@ -254,4 +258,8 @@ struct ieee802154_security_params {
u8_t _unused : 3; u8_t _unused : 3;
}; };
#ifdef __cplusplus
}
#endif
#endif /* __IEEE802154_H__ */ #endif /* __IEEE802154_H__ */

View file

@ -15,6 +15,10 @@
#include <device.h> #include <device.h>
#include <net/net_if.h> #include <net/net_if.h>
#ifdef __cplusplus
extern "C" {
#endif
struct ieee802154_radio_api { struct ieee802154_radio_api {
/** /**
* Mandatory to get in first position. * Mandatory to get in first position.
@ -91,4 +95,8 @@ extern enum net_verdict ieee802154_radio_handle_ack(struct net_if *iface,
*/ */
void ieee802154_init(struct net_if *iface); void ieee802154_init(struct net_if *iface);
#ifdef __cplusplus
}
#endif
#endif /* __IEEE802154_RADIO_H__ */ #endif /* __IEEE802154_RADIO_H__ */

View file

@ -10,6 +10,10 @@
#include <net/mqtt_types.h> #include <net/mqtt_types.h>
#include <net/net_context.h> #include <net/net_context.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief MQTT library * @brief MQTT library
* @defgroup mqtt MQTT library * @defgroup mqtt MQTT library
@ -418,4 +422,8 @@ int mqtt_rx_publish(struct mqtt_ctx *ctx, struct net_buf *rx);
* @} * @}
*/ */
#ifdef __cplusplus
}
#endif #endif
#endif /* _MQTT_H_ */

View file

@ -9,6 +9,10 @@
#include <zephyr/types.h> #include <zephyr/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief MQTT library * @brief MQTT library
* @defgroup mqtt MQTT library * @defgroup mqtt MQTT library
@ -86,4 +90,8 @@ struct mqtt_publish_msg {
* @} * @}
*/ */
#ifdef __cplusplus
}
#endif #endif
#endif /* _MQTT_TYPES_H_ */

View file

@ -12,6 +12,10 @@
#ifndef __NET_EVENT_H__ #ifndef __NET_EVENT_H__
#define __NET_EVENT_H__ #define __NET_EVENT_H__
#ifdef __cplusplus
extern "C" {
#endif
/* Network Interface events */ /* Network Interface events */
#define _NET_IF_LAYER NET_MGMT_LAYER_L1 #define _NET_IF_LAYER NET_MGMT_LAYER_L1
#define _NET_IF_CORE_CODE 0x001 #define _NET_IF_CORE_CODE 0x001
@ -121,4 +125,8 @@ enum net_event_ipv4_cmd {
#define NET_EVENT_IPV4_ROUTER_ADD \ #define NET_EVENT_IPV4_ROUTER_ADD \
(_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD) (_NET_EVENT_IPV4_BASE | NET_EVENT_IPV4_CMD_ROUTER_ADD)
#ifdef __cplusplus
}
#endif
#endif /* __NET_EVENT_H__ */ #endif /* __NET_EVENT_H__ */

View file

@ -12,6 +12,10 @@
#ifndef __NET_MGMT_H__ #ifndef __NET_MGMT_H__
#define __NET_MGMT_H__ #define __NET_MGMT_H__
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Network Management * @brief Network Management
* @defgroup net_mgmt Network Management * @defgroup net_mgmt Network Management
@ -264,4 +268,8 @@ static inline int net_mgmt_event_wait_on_iface(struct net_if *iface,
* @} * @}
*/ */
#ifdef __cplusplus
}
#endif
#endif /* __NET_MGMT_H__ */ #endif /* __NET_MGMT_H__ */

View file

@ -20,6 +20,10 @@
#include <misc/slist.h> #include <misc/slist.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief COAP library * @brief COAP library
* @defgroup zoap COAP Library * @defgroup zoap COAP Library
@ -811,4 +815,8 @@ u8_t *zoap_next_token(void);
* @} * @}
*/ */
#ifdef __cplusplus
}
#endif
#endif /* __ZOAP_H__ */ #endif /* __ZOAP_H__ */

View file

@ -13,6 +13,10 @@
#ifndef __LINK_FORMAT_H__ #ifndef __LINK_FORMAT_H__
#define __LINK_FORMAT_H__ #define __LINK_FORMAT_H__
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief COAP library * @brief COAP library
* @defgroup zoap COAP Library * @defgroup zoap COAP Library
@ -49,4 +53,8 @@ struct zoap_core_metadata {
* @} * @}
*/ */
#ifdef __cplusplus
}
#endif
#endif /* __LINK_FORMAT_H__ */ #endif /* __LINK_FORMAT_H__ */