summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEivind Næss <eivnaes@yahoo.com>2023-03-04 05:47:11 +0000
committerEivind Næss <eivnaes@yahoo.com>2023-03-17 14:18:53 +0000
commit4f3e40659fcccce45068473ae94cfead18260c77 (patch)
treee2abfad7e92176f1c2da5a93bcb63ad57c1294cd
parent827e4952d6bcc8dd9c8fdda54a509e5b59685c34 (diff)
downloadppp-4f3e40659fcccce45068473ae94cfead18260c77.tar.gz
Adding 'extern "C" {' and '}' declarations to exported header files
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
-rw-r--r--pppd/cbcp.h13
-rw-r--r--pppd/ccp.h8
-rw-r--r--pppd/chap.h8
-rw-r--r--pppd/chap_ms.h8
-rw-r--r--pppd/crypto.h8
-rw-r--r--pppd/crypto_ms.h8
-rw-r--r--pppd/ecp.h8
-rw-r--r--pppd/eui64.h8
-rw-r--r--pppd/fsm.h9
-rw-r--r--pppd/ipcp.h8
-rw-r--r--pppd/ipv6cp.h8
-rw-r--r--pppd/lcp.h10
-rw-r--r--pppd/magic.h8
-rw-r--r--pppd/mppe.h10
-rw-r--r--pppd/multilink.h9
-rw-r--r--pppd/options.h9
-rw-r--r--pppd/pppd.h8
-rw-r--r--pppd/session.h8
-rw-r--r--pppd/upap.h9
19 files changed, 162 insertions, 3 deletions
diff --git a/pppd/cbcp.h b/pppd/cbcp.h
index e317cae..4bd106b 100644
--- a/pppd/cbcp.h
+++ b/pppd/cbcp.h
@@ -30,11 +30,15 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef CBCP_H
-#define CBCP_H
+#ifndef PPP_CBCP_H
+#define PPP_CBCP_H
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct cbcp_state {
int us_unit; /* Interface unit number */
u_char us_id; /* Current id */
@@ -57,4 +61,9 @@ extern struct protent cbcp_protent;
#define CB_CONF_USER 2
#define CB_CONF_ADMIN 3
#define CB_CONF_LIST 4
+
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_CBCP_H
diff --git a/pppd/ccp.h b/pppd/ccp.h
index 3f00056..d60cdca 100644
--- a/pppd/ccp.h
+++ b/pppd/ccp.h
@@ -34,6 +34,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct ccp_options {
bool bsd_compress; /* do BSD Compress? */
bool deflate; /* do Deflate? */
@@ -55,4 +59,8 @@ extern ccp_options ccp_hisoptions[];
extern struct protent ccp_protent;
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_CCP_H
diff --git a/pppd/chap.h b/pppd/chap.h
index e693fc9..21373bd 100644
--- a/pppd/chap.h
+++ b/pppd/chap.h
@@ -33,6 +33,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* CHAP packets begin with a standard header with code, id, len (2 bytes).
*/
@@ -165,4 +169,8 @@ extern void chap_auth_with_peer(int unit, char *our_name, int digest_code);
/* Represents the CHAP protocol to the main pppd code */
extern struct protent chap_protent;
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_CHAP_NEW_H
diff --git a/pppd/chap_ms.h b/pppd/chap_ms.h
index e5f4c28..b3fdae6 100644
--- a/pppd/chap_ms.h
+++ b/pppd/chap_ms.h
@@ -35,6 +35,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */
#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */
@@ -95,4 +99,8 @@ void GenerateAuthenticatorResponse(unsigned char *PasswordHashHash,
void chapms_init(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_CHAPMS_H */
diff --git a/pppd/crypto.h b/pppd/crypto.h
index af85179..c559d0c 100644
--- a/pppd/crypto.h
+++ b/pppd/crypto.h
@@ -30,6 +30,10 @@
#ifndef PPP_CRYPTO_H
#define PPP_CRYPTO_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef MD5_DIGEST_LENGTH
#define MD5_DIGEST_LENGTH 16
#endif
@@ -152,4 +156,8 @@ int PPP_crypto_init();
*/
int PPP_crypto_deinit();
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_CRYPTO_H
diff --git a/pppd/crypto_ms.h b/pppd/crypto_ms.h
index e9a039c..38111fd 100644
--- a/pppd/crypto_ms.h
+++ b/pppd/crypto_ms.h
@@ -36,6 +36,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* This is the DES encrypt functions as described by RFC2759.
*
@@ -72,4 +76,8 @@ int DesEncrypt(const unsigned char *clear, const unsigned char *key,
int DesDecrypt(const unsigned char *cipher, const unsigned char *key,
unsigned char *clear);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_PPPCRYPT_H */
diff --git a/pppd/ecp.h b/pppd/ecp.h
index 5a0df4d..975d79b 100644
--- a/pppd/ecp.h
+++ b/pppd/ecp.h
@@ -35,6 +35,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef PPP_ECP
#define PPP_ECP 0x8053
#endif
@@ -53,4 +57,8 @@ extern ecp_options ecp_hisoptions[];
extern struct protent ecp_protent;
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_ECP_H
diff --git a/pppd/eui64.h b/pppd/eui64.h
index f809342..c24733d 100644
--- a/pppd/eui64.h
+++ b/pppd/eui64.h
@@ -38,6 +38,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(SOL2)
#include <netinet/in.h>
@@ -106,4 +110,8 @@ typedef union
char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_EUI64_H */
diff --git a/pppd/fsm.h b/pppd/fsm.h
index 071b844..50f75e6 100644
--- a/pppd/fsm.h
+++ b/pppd/fsm.h
@@ -46,12 +46,15 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Packet header = Code, id, length.
*/
#define HEADERLEN 4
-
/*
* CP (LCP, IPCP, etc.) codes.
*/
@@ -163,4 +166,8 @@ void fsm_sdata (fsm *, int, int, unsigned char *, int);
*/
extern int peer_mru[]; /* currently negotiated peer MRU (per unit) */
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_FSM_H
diff --git a/pppd/ipcp.h b/pppd/ipcp.h
index 97b5e6b..b3f6e28 100644
--- a/pppd/ipcp.h
+++ b/pppd/ipcp.h
@@ -44,6 +44,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Options.
*/
@@ -118,4 +122,8 @@ extern ip_down_hook_fn *ip_down_hook;
typedef void (ip_choose_hook_fn)(uint32_t *);
extern ip_choose_hook_fn *ip_choose_hook;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_IPCP_H */
diff --git a/pppd/ipv6cp.h b/pppd/ipv6cp.h
index d6e626e..3be5885 100644
--- a/pppd/ipv6cp.h
+++ b/pppd/ipv6cp.h
@@ -39,6 +39,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Original version, based on RFC2023 :
Copyright (c) 1995, 1996, 1997 Francis.Dupont@inria.fr, INRIA Rocquencourt,
@@ -186,4 +190,8 @@ extern ipv6_up_hook_fn *ipv6_up_hook;
typedef void (ipv6_down_hook_fn)(void);
extern ipv6_down_hook_fn *ipv6_down_hook;
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/pppd/lcp.h b/pppd/lcp.h
index 4cb77c8..bdf18d0 100644
--- a/pppd/lcp.h
+++ b/pppd/lcp.h
@@ -44,6 +44,11 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/*
* Options.
*/
@@ -144,4 +149,9 @@ extern struct protent lcp_protent;
before deciding the link is looped-back. */
#define DEFLOOPBACKFAIL 10
+
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_LCP_H
diff --git a/pppd/magic.h b/pppd/magic.h
index 70e4ce5..68cbf9b 100644
--- a/pppd/magic.h
+++ b/pppd/magic.h
@@ -44,10 +44,18 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void magic_init (void); /* Initialize the magic number generator */
u_int32_t magic (void); /* Returns the next magic number */
/* Fill buffer with random bytes */
void random_bytes (unsigned char *buf, int len);
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_MAGIC_H
diff --git a/pppd/mppe.h b/pppd/mppe.h
index 9292fe8..32fcb20 100644
--- a/pppd/mppe.h
+++ b/pppd/mppe.h
@@ -37,6 +37,11 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#define MPPE_PAD 4 /* MPPE growth per frame */
#define MPPE_MAX_KEY_SIZE 32 /* Largest key length */
#define MPPE_MAX_KEY_LEN 16 /* Largest key size accepted by the kernel */
@@ -175,4 +180,9 @@ void mppe_set_chapv2(unsigned char *PasswordHashHash,
unsigned char *NTResponse, int IsServer);
#endif // #ifdef PPP_WITH_MPPE
+
+#ifdef __cplusplus
+}
+#endif
+
#endif // #ifdef PPP_MPPE_H
diff --git a/pppd/multilink.h b/pppd/multilink.h
index e4639bb..acf448a 100644
--- a/pppd/multilink.h
+++ b/pppd/multilink.h
@@ -33,6 +33,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* values for epdisc.class
*/
@@ -109,4 +113,9 @@ static inline bool mp_master() {
}
#endif // PPP_WITH_MULTILINK
+
+#ifdef __cplusplus
+}
+#endif
+
#endif // PPP_MULTILINK_H
diff --git a/pppd/options.h b/pppd/options.h
index 61d2bab..564a851 100644
--- a/pppd/options.h
+++ b/pppd/options.h
@@ -31,6 +31,10 @@
#ifndef PPP_OPTIONS_H
#define PPP_OPTIONS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum opt_type {
o_special_noarg,
o_special,
@@ -111,4 +115,9 @@ int ppp_int_option(char *name, int *value);
/* Print an error message about an option */
void ppp_option_error(char *fmt, ...);
+
+#ifdef __cplusplus
+}
#endif
+
+#endif // PPP_OPTIONS_H
diff --git a/pppd/pppd.h b/pppd/pppd.h
index 9861ebc..ed50f9b 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -51,6 +51,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Limits
*/
@@ -560,4 +564,8 @@ extern int (*allowed_address_hook)(uint32_t addr);
extern void (*snoop_recv_hook)(unsigned char *p, int len);
extern void (*snoop_send_hook)(unsigned char *p, int len);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PPP_PPPD_H */
diff --git a/pppd/session.h b/pppd/session.h
index 0b91a03..499549c 100644
--- a/pppd/session.h
+++ b/pppd/session.h
@@ -32,6 +32,10 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define SESS_AUTH 1 /* Check User Authentication */
#define SESS_ACCT 2 /* Check Account Validity */
@@ -89,4 +93,8 @@ session_start(const int flags, const char* user, const char* passwd, const char*
void
session_end(const char* tty);
+#ifdef __cplusplus
+}
+#endif
+
#endif // PPP_SESSION_H
diff --git a/pppd/upap.h b/pppd/upap.h
index 061f60e..c86e520 100644
--- a/pppd/upap.h
+++ b/pppd/upap.h
@@ -44,6 +44,11 @@
#include "pppdconf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/*
* Packet header = Code, id, length.
*/
@@ -144,4 +149,8 @@ extern pap_logout_hook_fn *pap_logout_hook;
*/
extern pap_passwd_hook_fn *pap_passwd_hook;
+#ifdef __cplusplus
+}
+#endif
+
#endif // PPP_UPAP_H