From c3d8b1ca80d8a3ac714a10f0b4774d17fe004a35 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Mon, 23 Jul 2018 20:04:56 +0200 Subject: [PATCH] add 'extern "C" {}' for cplusplus in ppp headers --- src/include/netif/ppp/ccp.h | 8 ++++++++ src/include/netif/ppp/chap-new.h | 8 ++++++++ src/include/netif/ppp/ecp.h | 12 ++++++++++++ src/include/netif/ppp/eui64.h | 8 ++++++++ src/include/netif/ppp/fsm.h | 7 +++++++ src/include/netif/ppp/ipcp.h | 8 ++++++++ src/include/netif/ppp/ipv6cp.h | 8 ++++++++ src/include/netif/ppp/lcp.h | 8 ++++++++ src/include/netif/ppp/magic.h | 8 ++++++++ src/include/netif/ppp/mppe.h | 8 ++++++++ src/include/netif/ppp/ppp.h | 8 ++++++++ src/include/netif/ppp/ppp_impl.h | 8 ++++++++ src/include/netif/ppp/pppcrypt.h | 8 ++++++++ src/include/netif/ppp/pppdebug.h | 8 ++++++++ src/include/netif/ppp/pppoe.h | 8 ++++++++ src/include/netif/ppp/pppol2tp.h | 8 ++++++++ src/include/netif/ppp/pppos.h | 8 ++++++++ src/include/netif/ppp/upap.h | 8 ++++++++ src/include/netif/ppp/vj.h | 8 ++++++++ 19 files changed, 155 insertions(+) diff --git a/src/include/netif/ppp/ccp.h b/src/include/netif/ppp/ccp.h index 14dd6596..b2285228 100644 --- a/src/include/netif/ppp/ccp.h +++ b/src/include/netif/ppp/ccp.h @@ -36,6 +36,10 @@ #ifndef CCP_H #define CCP_H +#ifdef __cplusplus +extern "C" { +#endif + /* * CCP codes. */ @@ -152,5 +156,9 @@ extern const struct protent ccp_protent; void ccp_resetrequest(ppp_pcb *pcb); /* Issue a reset-request. */ +#ifdef __cplusplus +} +#endif + #endif /* CCP_H */ #endif /* PPP_SUPPORT && CCP_SUPPORT */ diff --git a/src/include/netif/ppp/chap-new.h b/src/include/netif/ppp/chap-new.h index 64eae322..2d8cd9ca 100644 --- a/src/include/netif/ppp/chap-new.h +++ b/src/include/netif/ppp/chap-new.h @@ -36,6 +36,10 @@ #include "ppp.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * CHAP packets begin with a standard header with code, id, len (2 bytes). */ @@ -188,5 +192,9 @@ extern void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_c /* Represents the CHAP protocol to the main pppd code */ extern const struct protent chap_protent; +#ifdef __cplusplus +} +#endif + #endif /* CHAP_H */ #endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/src/include/netif/ppp/ecp.h b/src/include/netif/ppp/ecp.h index 5cdce29d..d8808c3a 100644 --- a/src/include/netif/ppp/ecp.h +++ b/src/include/netif/ppp/ecp.h @@ -34,6 +34,13 @@ #include "netif/ppp/ppp_opts.h" #if PPP_SUPPORT && ECP_SUPPORT /* don't build if not configured for use in lwipopts.h */ +#ifndef ECP_H +#define ECP_H + +#ifdef __cplusplus +extern "C" { +#endif + typedef struct ecp_options { bool required; /* Is ECP required? */ unsigned enctype; /* Encryption type */ @@ -47,4 +54,9 @@ extern ecp_options ecp_hisoptions[]; extern const struct protent ecp_protent; +#ifdef __cplusplus +} +#endif + +#endif /* ECP_H */ #endif /* PPP_SUPPORT && ECP_SUPPORT */ diff --git a/src/include/netif/ppp/eui64.h b/src/include/netif/ppp/eui64.h index 20ac22ee..5adeb482 100644 --- a/src/include/netif/ppp/eui64.h +++ b/src/include/netif/ppp/eui64.h @@ -41,6 +41,10 @@ #ifndef EUI64_H #define EUI64_H +#ifdef __cplusplus +extern "C" { +#endif + /* * @todo: * @@ -90,5 +94,9 @@ typedef union char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ +#ifdef __cplusplus +} +#endif + #endif /* EUI64_H */ #endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/src/include/netif/ppp/fsm.h b/src/include/netif/ppp/fsm.h index b6915d3b..8dec700e 100644 --- a/src/include/netif/ppp/fsm.h +++ b/src/include/netif/ppp/fsm.h @@ -50,6 +50,10 @@ #include "ppp.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * Packet header = Code, id, length. */ @@ -170,6 +174,9 @@ void fsm_input(fsm *f, u_char *inpacket, int l); void fsm_protreject(fsm *f); void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen); +#ifdef __cplusplus +} +#endif #endif /* FSM_H */ #endif /* PPP_SUPPORT */ diff --git a/src/include/netif/ppp/ipcp.h b/src/include/netif/ppp/ipcp.h index 45f46b31..32fdd1c6 100644 --- a/src/include/netif/ppp/ipcp.h +++ b/src/include/netif/ppp/ipcp.h @@ -48,6 +48,10 @@ #ifndef IPCP_H #define IPCP_H +#ifdef __cplusplus +extern "C" { +#endif + /* * Options. */ @@ -122,5 +126,9 @@ char *ip_ntoa (u32_t); extern const struct protent ipcp_protent; +#ifdef __cplusplus +} +#endif + #endif /* IPCP_H */ #endif /* PPP_SUPPORT && PPP_IPV4_SUPPORT */ diff --git a/src/include/netif/ppp/ipv6cp.h b/src/include/netif/ppp/ipv6cp.h index 07d1ae31..90999738 100644 --- a/src/include/netif/ppp/ipv6cp.h +++ b/src/include/netif/ppp/ipv6cp.h @@ -146,6 +146,10 @@ #include "eui64.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * Options. */ @@ -179,5 +183,9 @@ typedef struct ipv6cp_options { extern const struct protent ipv6cp_protent; +#ifdef __cplusplus +} +#endif + #endif /* IPV6CP_H */ #endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/src/include/netif/ppp/lcp.h b/src/include/netif/ppp/lcp.h index 12e2a05f..18ad1cb2 100644 --- a/src/include/netif/ppp/lcp.h +++ b/src/include/netif/ppp/lcp.h @@ -50,6 +50,10 @@ #include "ppp.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * Options. */ @@ -167,5 +171,9 @@ extern const struct protent lcp_protent; #define DEFLOOPBACKFAIL 10 #endif /* moved to ppp_opts.h */ +#ifdef __cplusplus +} +#endif + #endif /* LCP_H */ #endif /* PPP_SUPPORT */ diff --git a/src/include/netif/ppp/magic.h b/src/include/netif/ppp/magic.h index a2a9b530..a165e18f 100644 --- a/src/include/netif/ppp/magic.h +++ b/src/include/netif/ppp/magic.h @@ -80,6 +80,10 @@ #ifndef MAGIC_H #define MAGIC_H +#ifdef __cplusplus +extern "C" { +#endif + /*********************** *** PUBLIC FUNCTIONS *** ***********************/ @@ -117,6 +121,10 @@ void magic_random_bytes(unsigned char *buf, u32_t buf_len); */ u32_t magic_pow(u8_t pow); +#ifdef __cplusplus +} +#endif + #endif /* MAGIC_H */ #endif /* PPP_SUPPORT */ diff --git a/src/include/netif/ppp/mppe.h b/src/include/netif/ppp/mppe.h index 1ae8a5d9..5de11284 100644 --- a/src/include/netif/ppp/mppe.h +++ b/src/include/netif/ppp/mppe.h @@ -41,6 +41,10 @@ #include "netif/ppp/pppcrypt.h" +#ifdef __cplusplus +extern "C" { +#endif + #define MPPE_PAD 4 /* MPPE growth per frame */ #define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ @@ -169,5 +173,9 @@ err_t mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state); err_t mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb); +#ifdef __cplusplus +} +#endif + #endif /* MPPE_H */ #endif /* PPP_SUPPORT && MPPE_SUPPORT */ diff --git a/src/include/netif/ppp/ppp.h b/src/include/netif/ppp/ppp.h index d9ea097e..3d73c365 100644 --- a/src/include/netif/ppp/ppp.h +++ b/src/include/netif/ppp/ppp.h @@ -47,6 +47,10 @@ #include "lwip/ip6_addr.h" #endif /* PPP_IPV6_SUPPORT */ +#ifdef __cplusplus +extern "C" { +#endif + /* Disable non-working or rarely used PPP feature, so rarely that we don't want to bloat ppp_opts.h with them */ #ifndef PPP_OPTIONS #define PPP_OPTIONS 0 @@ -685,6 +689,10 @@ err_t ppp_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg); #define ppp_set_netif_linkcallback(ppp, link_cb) \ netif_set_link_callback(ppp->netif, link_cb); +#ifdef __cplusplus +} +#endif + #endif /* PPP_H */ #endif /* PPP_SUPPORT */ diff --git a/src/include/netif/ppp/ppp_impl.h b/src/include/netif/ppp/ppp_impl.h index d10ea7b0..40843d5a 100644 --- a/src/include/netif/ppp/ppp_impl.h +++ b/src/include/netif/ppp/ppp_impl.h @@ -53,6 +53,10 @@ #include "ppp.h" #include "pppdebug.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * Memory used for control packets. * @@ -710,5 +714,9 @@ void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len); * 1 + PPP_IPV4_SUPPORT + PPP_IPV6_SUPPORT + CCP_SUPPORT */ +#ifdef __cplusplus +} +#endif + #endif /* PPP_SUPPORT */ #endif /* LWIP_HDR_PPP_IMPL_H */ diff --git a/src/include/netif/ppp/pppcrypt.h b/src/include/netif/ppp/pppcrypt.h index a7b2099f..c0230bbc 100644 --- a/src/include/netif/ppp/pppcrypt.h +++ b/src/include/netif/ppp/pppcrypt.h @@ -44,6 +44,10 @@ */ #include "lwip/arch.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * Map hashes and ciphers functions to PolarSSL */ @@ -131,6 +135,10 @@ void pppcrypt_56_to_64_bit_key(u_char *key, u_char *des_key); +#ifdef __cplusplus +} +#endif + #endif /* PPPCRYPT_H */ #endif /* PPP_SUPPORT */ diff --git a/src/include/netif/ppp/pppdebug.h b/src/include/netif/ppp/pppdebug.h index 7ead0459..36ee4f9b 100644 --- a/src/include/netif/ppp/pppdebug.h +++ b/src/include/netif/ppp/pppdebug.h @@ -40,6 +40,10 @@ #ifndef PPPDEBUG_H #define PPPDEBUG_H +#ifdef __cplusplus +extern "C" { +#endif + /* Trace levels. */ #define LOG_CRITICAL (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) #define LOG_ERR (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) @@ -75,6 +79,10 @@ #endif /* PPP_DEBUG */ +#ifdef __cplusplus +} +#endif + #endif /* PPPDEBUG_H */ #endif /* PPP_SUPPORT */ diff --git a/src/include/netif/ppp/pppoe.h b/src/include/netif/ppp/pppoe.h index 9f8f2892..08ab7ab5 100644 --- a/src/include/netif/ppp/pppoe.h +++ b/src/include/netif/ppp/pppoe.h @@ -76,6 +76,10 @@ #include "ppp.h" #include "lwip/etharp.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifdef PACK_STRUCT_USE_INCLUDES # include "arch/bpstruct.h" #endif @@ -174,6 +178,10 @@ ppp_pcb *pppoe_create(struct netif *pppif, void pppoe_disc_input(struct netif *netif, struct pbuf *p); void pppoe_data_input(struct netif *netif, struct pbuf *p); +#ifdef __cplusplus +} +#endif + #endif /* PPP_OE_H */ #endif /* PPP_SUPPORT && PPPOE_SUPPORT */ diff --git a/src/include/netif/ppp/pppol2tp.h b/src/include/netif/ppp/pppol2tp.h index 6c241b77..1221ca15 100644 --- a/src/include/netif/ppp/pppol2tp.h +++ b/src/include/netif/ppp/pppol2tp.h @@ -39,6 +39,10 @@ #include "ppp.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Timeout */ #define PPPOL2TP_CONTROL_TIMEOUT (5*1000) /* base for quick timeout calculation */ #define PPPOL2TP_SLOW_RETRY (60*1000) /* persistent retry interval */ @@ -197,5 +201,9 @@ ppp_pcb *pppol2tp_create(struct netif *pppif, const u8_t *secret, u8_t secret_len, ppp_link_status_cb_fn link_status_cb, void *ctx_cb); +#ifdef __cplusplus +} +#endif + #endif /* PPPOL2TP_H */ #endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */ diff --git a/src/include/netif/ppp/pppos.h b/src/include/netif/ppp/pppos.h index d924a9fc..380a965c 100644 --- a/src/include/netif/ppp/pppos.h +++ b/src/include/netif/ppp/pppos.h @@ -42,6 +42,10 @@ #include "ppp.h" #include "vj.h" +#ifdef __cplusplus +extern "C" { +#endif + /* PPP packet parser states. Current state indicates operation yet to be * completed. */ enum { @@ -114,5 +118,9 @@ void pppos_input(ppp_pcb *ppp, u8_t* data, int len); err_t pppos_input_sys(struct pbuf *p, struct netif *inp); #endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */ +#ifdef __cplusplus +} +#endif + #endif /* PPPOS_H */ #endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */ diff --git a/src/include/netif/ppp/upap.h b/src/include/netif/ppp/upap.h index 7da792ec..540d9814 100644 --- a/src/include/netif/ppp/upap.h +++ b/src/include/netif/ppp/upap.h @@ -50,6 +50,10 @@ #include "ppp.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * Packet header = Code, id, length. */ @@ -119,5 +123,9 @@ void upap_authpeer(ppp_pcb *pcb); extern const struct protent pap_protent; +#ifdef __cplusplus +} +#endif + #endif /* UPAP_H */ #endif /* PPP_SUPPORT && PAP_SUPPORT */ diff --git a/src/include/netif/ppp/vj.h b/src/include/netif/ppp/vj.h index 7f389c84..77d9976c 100644 --- a/src/include/netif/ppp/vj.h +++ b/src/include/netif/ppp/vj.h @@ -31,6 +31,10 @@ #include "lwip/ip.h" #include "lwip/priv/tcp_priv.h" +#ifdef __cplusplus +extern "C" { +#endif + #define MAX_SLOTS 16 /* must be > 2 and < 256 */ #define MAX_HDR 128 @@ -156,6 +160,10 @@ extern void vj_uncompress_err (struct vjcompress *comp); extern int vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp); extern int vj_uncompress_tcp (struct pbuf **nb, struct vjcompress *comp); +#ifdef __cplusplus +} +#endif + #endif /* VJ_H */ #endif /* PPP_SUPPORT && VJ_SUPPORT */