]> git.ozlabs.org Git - ppp.git/commitdiff
Adding 'extern "C" {' and '}' declarations to exported header files
authorEivind Næss <eivnaes@yahoo.com>
Sat, 4 Mar 2023 05:47:11 +0000 (05:47 +0000)
committerEivind Næss <eivnaes@yahoo.com>
Fri, 17 Mar 2023 14:18:53 +0000 (14:18 +0000)
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
19 files changed:
pppd/cbcp.h
pppd/ccp.h
pppd/chap.h
pppd/chap_ms.h
pppd/crypto.h
pppd/crypto_ms.h
pppd/ecp.h
pppd/eui64.h
pppd/fsm.h
pppd/ipcp.h
pppd/ipv6cp.h
pppd/lcp.h
pppd/magic.h
pppd/mppe.h
pppd/multilink.h
pppd/options.h
pppd/pppd.h
pppd/session.h
pppd/upap.h

index e317caea9562ae6a4066f080d65d145096d74db9..4bd106be6b9fe30004ce14c796138053b165d5ee 100644 (file)
  * 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
index 3f00056f49f5cf59cacced730aaa607380972f73..d60cdca8bcc180895e212769152eaefd1e39505f 100644 (file)
 
 #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
index e693fc91e8a95b3108c2504513d0ffbeae14c75b..21373bdbb07e8d83fc6a7908a7663c03d1ce8a2b 100644 (file)
 
 #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
index e5f4c28828b75679126ec2f3d13438db20876f55..b3fdae61571d0fa954c7dd3b361b4fc1d60abd41 100644 (file)
 
 #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 */
index af85179c90f7c36492120a97ac0e5ffa7fce0040..c559d0c45993f3a6af351e1edad58104adee0fa2 100644 (file)
 #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
index e9a039cbf055e9e87131847bf13a4e1a0f757ec7..38111fdf70701e07036158d11ce825d8317e4fb9 100644 (file)
 
 #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 */
index 5a0df4d1468120fdf53f01ebb74a6c8e76ed43fa..975d79b876a7c8ca71d72340d717a7e1acb6d5ca 100644 (file)
 
 #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
index f809342cb76e1428e4da2757e7384665fc723790..c24733d1248ac16b372926178f0206d341311ec6 100644 (file)
 
 #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 */
index 071b844448aa59ba2bc44c9b01ee90f8735f6198..50f75e69a2741880890f32020dcd8b202cf34af4 100644 (file)
 
 #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
index 97b5e6b1da04140ca00499c0ec1bb11956752a48..b3f6e28d06d1c761d93b9f71f891bf2e7cc865ff 100644 (file)
 
 #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 */
index d6e626e716a829da73ca2335578f4eb9d961fb23..3be5885abbda926c42b0c2a50aee2d4c4e589ac6 100644 (file)
 
 #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
index 4cb77c8f57724739e02f296400eb801414f03995..bdf18d03eadc7007a9e663fd6a0d54c944b6f61d 100644 (file)
 
 #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
index 70e4ce528238390da2367aab47b01a3e075fe9b4..68cbf9be24d395d92cb53610c0e410d6623df3f3 100644 (file)
 
 #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
index 9292fe8dd623cd8bd599b4710816a3bd80160ef9..32fcb207b92ee793ed45db3fa9bfd0d6ee81cfd7 100644 (file)
 
 #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
index e4639bb62e861156c2eb3da5d48dad264895824a..acf448a09713763f73e248c8ac0a7d47c6a4e9d2 100644 (file)
 
 #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
index 61d2bab2f2f1f44596ed5dfde531345989c2bcf7..564a851963da7854748196678cc4ea0b4b6dab05 100644 (file)
 #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
index 9861ebc99ffe7fcff00a9859a43f58479ed0ca51..ed50f9b3557b60751711af17780bae6365057266 100644 (file)
 
 #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 */
index 0b91a03e5d62e5c921540c4fb92862e44b08b41a..499549ce03f62120183fc5823c98e8337a08e4d3 100644 (file)
 
 #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
index 061f60e3d130e5c2f673be96384ad6f5badbd4df..c86e520195262af8bedb6b782fa87c4f9d891052 100644 (file)
 
 #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