cfbbce8f91
Resolves: #650219
197 lines
6.3 KiB
Diff
197 lines
6.3 KiB
Diff
commit a566ddb17d58fcd7def877583882dfd455793b5c
|
|
Author: magfr <magfr@06827809-a52a-0410-b366-d66718629ded>
|
|
Date: Tue Oct 12 05:35:33 2010 +0000
|
|
|
|
CHANGES: snmplib: Correct the extern "C" declarations to be consistent. Remove commented out code.
|
|
|
|
|
|
git-svn-id: https://net-snmp.svn.sourceforge.net/svnroot/net-snmp/trunk@19414 06827809-a52a-0410-b366-d66718629ded
|
|
|
|
diff --git a/net-snmp/include/net-snmp/library/snmp_api.h b/net-snmp/include/net-snmp/library/snmp_api.h
|
|
index bf5e010..5ef1eb7 100644
|
|
--- a/net-snmp/include/net-snmp/library/snmp_api.h
|
|
+++ b/net-snmp/include/net-snmp/library/snmp_api.h
|
|
@@ -115,10 +115,6 @@ typedef struct request_list {
|
|
#endif
|
|
#define SNMP_DEFAULT_PRIV_PROTOLEN USM_LENGTH_OID_TRANSFORM
|
|
|
|
-/* Moved to output_api.h
|
|
- NETSNMP_IMPORT const char *snmp_api_errstring(int);
|
|
- NETSNMP_IMPORT void snmp_perror(const char *);
|
|
- */
|
|
NETSNMP_IMPORT void snmp_set_detail(const char *);
|
|
|
|
#define SNMP_MAX_MSG_SIZE 1472 /* ethernet MTU minus IP/UDP header */
|
|
@@ -459,19 +455,10 @@ struct netsnmp_transport_s;
|
|
int snmp_get_do_debugging(void);
|
|
|
|
|
|
-/* Moved to output_api.h
|
|
- NETSNMP_IMPORT
|
|
- void snmp_sess_error(void *, int *, int *, char **);
|
|
- */
|
|
NETSNMP_IMPORT
|
|
void netsnmp_sess_log_error(int priority,
|
|
const char *prog_string,
|
|
netsnmp_session * ss);
|
|
-/* Moved to output_api.h
|
|
- NETSNMP_IMPORT
|
|
- void snmp_sess_perror(const char *prog_string,
|
|
- netsnmp_session * ss);
|
|
- */
|
|
const char * snmp_pdu_type(int type);
|
|
|
|
/*
|
|
diff --git a/net-snmp/include/net-snmp/library/snmp_client.h b/net-snmp/include/net-snmp/library/snmp_client.h
|
|
index 0de5bb9..c023253 100644
|
|
--- a/net-snmp/include/net-snmp/library/snmp_client.h
|
|
+++ b/net-snmp/include/net-snmp/library/snmp_client.h
|
|
@@ -80,10 +80,6 @@ extern "C" {
|
|
NETSNMP_IMPORT
|
|
int snmp_clone_var(netsnmp_variable_list *,
|
|
netsnmp_variable_list *);
|
|
-/* Moved to output_api.h
|
|
- NETSNMP_IMPORT
|
|
- const char *snmp_errstring(int);
|
|
- */
|
|
NETSNMP_IMPORT
|
|
int snmp_synch_response_cb(netsnmp_session *,
|
|
netsnmp_pdu *, netsnmp_pdu **,
|
|
diff --git a/net-snmp/include/net-snmp/library/snmp_debug.h b/net-snmp/include/net-snmp/library/snmp_debug.h
|
|
index 24de1c4..2984520 100644
|
|
--- a/net-snmp/include/net-snmp/library/snmp_debug.h
|
|
+++ b/net-snmp/include/net-snmp/library/snmp_debug.h
|
|
@@ -201,9 +201,17 @@ extern "C" {
|
|
/*****************************************************************/
|
|
#endif /* NETSNMP_NO_DEBUGGING */
|
|
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
/* Public macros moved to top-level API header file */
|
|
#include <net-snmp/output_api.h>
|
|
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
void snmp_debug_init(void);
|
|
|
|
#define MAX_DEBUG_TOKENS 256
|
|
diff --git a/net-snmp/include/net-snmp/library/snmp_logging.h b/net-snmp/include/net-snmp/library/snmp_logging.h
|
|
index cbc576f..1d7921b 100644
|
|
--- a/net-snmp/include/net-snmp/library/snmp_logging.h
|
|
+++ b/net-snmp/include/net-snmp/library/snmp_logging.h
|
|
@@ -1,10 +1,6 @@
|
|
#ifndef SNMP_LOGGING_H
|
|
#define SNMP_LOGGING_H
|
|
|
|
-#ifdef __cplusplus
|
|
-extern "C" {
|
|
-#endif
|
|
-
|
|
#include <net-snmp/types.h>
|
|
#include <net-snmp/output_api.h>
|
|
|
|
@@ -14,6 +10,10 @@ extern "C" {
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
#ifndef LOG_ERR
|
|
#define LOG_EMERG 0 /* system is unusable */
|
|
#define LOG_ALERT 1 /* action must be taken immediately */
|
|
@@ -43,21 +43,12 @@ extern "C" {
|
|
} while(0)
|
|
|
|
void init_snmp_logging(void);
|
|
-/* Moved to output_api.h
|
|
- void shutdown_snmp_logging(void);
|
|
- NETSNMP_IMPORT
|
|
- int snmp_get_do_logging(void);
|
|
- */
|
|
NETSNMP_IMPORT
|
|
void snmp_disable_syslog(void);
|
|
void snmp_disable_filelog(void);
|
|
NETSNMP_IMPORT
|
|
void snmp_disable_stderrlog(void);
|
|
void snmp_disable_calllog(void);
|
|
-/* Moved to output_api.h
|
|
- NETSNMP_IMPORT
|
|
- void snmp_disable_log(void);
|
|
- */
|
|
NETSNMP_IMPORT
|
|
void snmp_enable_syslog(void);
|
|
NETSNMP_IMPORT
|
|
@@ -73,31 +64,6 @@ extern "C" {
|
|
NETSNMP_IMPORT
|
|
int snmp_stderrlog_status(void);
|
|
|
|
-/* Moved to output_api.h
|
|
-#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
|
|
- NETSNMP_IMPORT
|
|
- int snmp_log(int priority, const char *format, ...);
|
|
-#else
|
|
- NETSNMP_IMPORT
|
|
- int snmp_log(int priority, const char *format, ...)
|
|
- __attribute__ ((__format__ (__printf__, 2, 3)));
|
|
-#endif
|
|
- int snmp_vlog(int priority, const char *format,
|
|
- va_list ap);
|
|
- */
|
|
-
|
|
- /*
|
|
- * 0 - successful message formatting
|
|
- * -1 - Could not format log-string
|
|
- * -2 - Could not allocate memory for log-message
|
|
- * -3 - Log-message too long!
|
|
- */
|
|
-
|
|
-/* Moved to output_api.h
|
|
- NETSNMP_IMPORT
|
|
- void snmp_log_perror(const char *s);
|
|
- */
|
|
-
|
|
|
|
#define NETSNMP_LOGHANDLER_STDOUT 1
|
|
#define NETSNMP_LOGHANDLER_STDERR 2
|
|
diff --git a/net-snmp/include/net-snmp/output_api.h b/net-snmp/include/net-snmp/output_api.h
|
|
index 8627841..b55def5 100644
|
|
--- a/net-snmp/include/net-snmp/output_api.h
|
|
+++ b/net-snmp/include/net-snmp/output_api.h
|
|
@@ -9,6 +9,10 @@
|
|
#include <net-snmp/types.h>
|
|
#include <stdarg.h> /* for va_list */
|
|
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
/* Error reporting */
|
|
NETSNMP_IMPORT
|
|
void snmp_error(netsnmp_session *sess, int *clib_errorno,
|
|
@@ -21,7 +25,7 @@
|
|
const char *snmp_api_errstring(int snmp_errorno); /* library errors */
|
|
NETSNMP_IMPORT
|
|
const char *snmp_errstring(int snmp_errorno); /* protocol errors */
|
|
-
|
|
+
|
|
NETSNMP_IMPORT
|
|
void snmp_perror(const char *msg); /* for parsing errors only */
|
|
|
|
@@ -137,6 +141,10 @@
|
|
* Hence they are listed here:
|
|
*/
|
|
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
#include <net-snmp/library/snmp_api.h>
|
|
#include <net-snmp/library/snmp_client.h>
|
|
#include <net-snmp/library/snmp_debug.h>
|