See also http://sourceforge.net/p/net-snmp/feature-requests/181/
This is a modified version of a patch supplied by jbree...@users.sf.net - the whitespace changes have been left out. --- include/net-snmp/library/asn1.h | 22 ++++++++++++++++++++++ include/net-snmp/library/snmp_api.h | 26 ++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/include/net-snmp/library/asn1.h b/include/net-snmp/library/asn1.h index 52ecc3b..9f7c0c4 100644 --- a/include/net-snmp/library/asn1.h +++ b/include/net-snmp/library/asn1.h @@ -177,6 +177,7 @@ SOFTWARE. #define IS_DELEGATED(x) ((x) == ASN_PRIV_DELEGATED) + NETSNMP_IMPORT int asn_check_packet(u_char *, size_t); NETSNMP_IMPORT u_char *asn_parse_int(u_char *, size_t *, u_char *, long *, @@ -198,6 +199,7 @@ SOFTWARE. const u_char *, size_t); NETSNMP_IMPORT u_char *asn_parse_header(u_char *, size_t *, u_char *); + NETSNMP_IMPORT u_char *asn_parse_sequence(u_char *, size_t *, u_char *, u_char expected_type, /* must be this type */ const char *estr); /* error message prefix */ NETSNMP_IMPORT @@ -230,16 +232,22 @@ SOFTWARE. NETSNMP_IMPORT u_char *asn_build_unsigned_int64(u_char *, size_t *, u_char, const struct counter64 *, size_t); + NETSNMP_IMPORT u_char *asn_parse_signed_int64(u_char *, size_t *, u_char *, struct counter64 *, size_t); + NETSNMP_IMPORT u_char *asn_build_signed_int64(u_char *, size_t *, u_char, const struct counter64 *, size_t); + NETSNMP_IMPORT u_char *asn_build_float(u_char *, size_t *, u_char, const float *, size_t); + NETSNMP_IMPORT u_char *asn_parse_float(u_char *, size_t *, u_char *, float *, size_t); + NETSNMP_IMPORT u_char *asn_build_double(u_char *, size_t *, u_char, const double *, size_t); + NETSNMP_IMPORT u_char *asn_parse_double(u_char *, size_t *, u_char *, double *, size_t); @@ -249,6 +257,7 @@ SOFTWARE. * Re-allocator function for below. */ + NETSNMP_IMPORT int asn_realloc(u_char **, size_t *); /* @@ -356,11 +365,13 @@ SOFTWARE. */ + NETSNMP_IMPORT int asn_realloc_rbuild_int(u_char ** pkt, size_t * pkt_len, size_t * offset, int allow_realloc, u_char type, const long *data, size_t data_size); + NETSNMP_IMPORT int asn_realloc_rbuild_string(u_char ** pkt, size_t * pkt_len, size_t * offset, @@ -369,6 +380,7 @@ SOFTWARE. const u_char * data, size_t data_size); + NETSNMP_IMPORT int asn_realloc_rbuild_unsigned_int(u_char ** pkt, size_t * pkt_len, size_t * offset, @@ -377,6 +389,7 @@ SOFTWARE. const u_long * data, size_t data_size); + NETSNMP_IMPORT int asn_realloc_rbuild_header(u_char ** pkt, size_t * pkt_len, size_t * offset, @@ -384,6 +397,7 @@ SOFTWARE. u_char type, size_t data_size); + NETSNMP_IMPORT int asn_realloc_rbuild_sequence(u_char ** pkt, size_t * pkt_len, size_t * offset, @@ -391,12 +405,14 @@ SOFTWARE. u_char type, size_t data_size); + NETSNMP_IMPORT int asn_realloc_rbuild_length(u_char ** pkt, size_t * pkt_len, size_t * offset, int allow_realloc, size_t data_size); + NETSNMP_IMPORT int asn_realloc_rbuild_objid(u_char ** pkt, size_t * pkt_len, size_t * offset, @@ -404,12 +420,14 @@ SOFTWARE. u_char type, const oid *, size_t); + NETSNMP_IMPORT int asn_realloc_rbuild_null(u_char ** pkt, size_t * pkt_len, size_t * offset, int allow_realloc, u_char type); + NETSNMP_IMPORT int asn_realloc_rbuild_bitstring(u_char ** pkt, size_t * pkt_len, size_t * offset, @@ -418,6 +436,7 @@ SOFTWARE. const u_char * data, size_t data_size); + NETSNMP_IMPORT int asn_realloc_rbuild_unsigned_int64(u_char ** pkt, size_t * pkt_len, size_t * offset, @@ -426,6 +445,7 @@ SOFTWARE. struct counter64 const *data, size_t); + NETSNMP_IMPORT int asn_realloc_rbuild_signed_int64(u_char ** pkt, size_t * pkt_len, size_t * offset, @@ -434,6 +454,7 @@ SOFTWARE. const struct counter64 *data, size_t); + NETSNMP_IMPORT int asn_realloc_rbuild_float(u_char ** pkt, size_t * pkt_len, size_t * offset, @@ -441,6 +462,7 @@ SOFTWARE. u_char type, const float *data, size_t data_size); + NETSNMP_IMPORT int asn_realloc_rbuild_double(u_char ** pkt, size_t * pkt_len, size_t * offset, diff --git a/include/net-snmp/library/snmp_api.h b/include/net-snmp/library/snmp_api.h index 6f658d5..6a05a8e 100644 --- a/include/net-snmp/library/snmp_api.h +++ b/include/net-snmp/library/snmp_api.h @@ -329,7 +329,9 @@ typedef struct request_list { #define NETSNMP_CALLBACK_OP_CONNECT 4 #define NETSNMP_CALLBACK_OP_DISCONNECT 5 + NETSNMP_IMPORT long snmp_get_next_msgid(void); + NETSNMP_IMPORT long snmp_get_next_reqid(void); NETSNMP_IMPORT long snmp_get_next_sessid(void); @@ -339,6 +341,7 @@ typedef struct request_list { NETSNMP_IMPORT int snmp_oid_compare(const oid *, size_t, const oid *, size_t); + NETSNMP_IMPORT int snmp_oid_ncompare(const oid *, size_t, const oid *, size_t, size_t); NETSNMP_IMPORT @@ -354,6 +357,7 @@ typedef struct request_list { NETSNMP_IMPORT int netsnmp_oid_equals(const oid *, size_t, const oid *, size_t); + NETSNMP_IMPORT int netsnmp_oid_tree_equals(const oid *, size_t, const oid *, size_t); NETSNMP_IMPORT @@ -364,26 +368,36 @@ typedef struct request_list { const oid * in_name2, size_t len2); NETSNMP_IMPORT void init_snmp(const char *); + + NETSNMP_IMPORT u_char *snmp_pdu_build(netsnmp_pdu *, u_char *, size_t *); #ifdef NETSNMP_USE_REVERSE_ASNENCODING + NETSNMP_IMPORT u_char *snmp_pdu_rbuild(netsnmp_pdu *, u_char *, size_t *); #endif + NETSNMP_IMPORT int snmpv3_parse(netsnmp_pdu *, u_char *, size_t *, u_char **, netsnmp_session *); + NETSNMP_IMPORT int snmpv3_packet_build(netsnmp_session *, netsnmp_pdu *pdu, u_char * packet, size_t * out_length, u_char * pdu_data, size_t pdu_data_len); + NETSNMP_IMPORT int snmpv3_packet_rbuild(netsnmp_session *, netsnmp_pdu *pdu, u_char * packet, size_t * out_length, u_char * pdu_data, size_t pdu_data_len); + NETSNMP_IMPORT int snmpv3_make_report(netsnmp_pdu *pdu, int error); + NETSNMP_IMPORT int snmpv3_get_report_type(netsnmp_pdu *pdu); + NETSNMP_IMPORT int snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length); + NETSNMP_IMPORT u_char *snmpv3_scopedPDU_parse(netsnmp_pdu *pdu, u_char * cp, size_t * length); NETSNMP_IMPORT @@ -399,14 +413,15 @@ typedef struct request_list { const char *); NETSNMP_IMPORT oid *snmp_duplicate_objid(const oid * objToCopy, size_t); - NETSNMP_IMPORT #ifndef NETSNMP_FEATURE_REMOVE_STATISTICS + NETSNMP_IMPORT u_int snmp_increment_statistic(int which); NETSNMP_IMPORT u_int snmp_increment_statistic_by(int which, int count); NETSNMP_IMPORT u_int snmp_get_statistic(int which); + NETSNMP_IMPORT void snmp_init_statistics(void); #else /* NETSNMP_FEATURE_REMOVE_STATISTICS */ @@ -417,7 +432,9 @@ typedef struct request_list { #endif + NETSNMP_IMPORT int create_user_from_session(netsnmp_session * session); + NETSNMP_IMPORT int snmpv3_probe_contextEngineID_rfc5343(void *slp, netsnmp_session *session); @@ -425,13 +442,14 @@ typedef struct request_list { * New re-allocating reverse encoding functions. */ #ifdef NETSNMP_USE_REVERSE_ASNENCODING - + NETSNMP_IMPORT int snmpv3_packet_realloc_rbuild(u_char ** pkt, size_t * pkt_len, size_t * offset, netsnmp_session * session, netsnmp_pdu *pdu, u_char * pdu_data, size_t pdu_data_len); + NETSNMP_IMPORT int snmp_pdu_realloc_rbuild(u_char ** pkt, size_t * pkt_len, size_t * offset, netsnmp_pdu *pdu); #endif @@ -478,6 +496,7 @@ struct netsnmp_transport_s; void netsnmp_sess_log_error(int priority, const char *prog_string, netsnmp_session * ss); + NETSNMP_IMPORT const char * snmp_pdu_type(int type); /* @@ -487,6 +506,7 @@ struct netsnmp_transport_s; NETSNMP_IMPORT struct netsnmp_transport_s *snmp_sess_transport(void *); + NETSNMP_IMPORT void snmp_sess_transport_set(void *, struct netsnmp_transport_s *); @@ -511,6 +531,7 @@ struct netsnmp_transport_s; * */ + NETSNMP_IMPORT void *snmp_sess_add_ex(netsnmp_session *, struct netsnmp_transport_s *, int (*fpre_parse) (netsnmp_session *, @@ -537,6 +558,7 @@ struct netsnmp_transport_s; void *, size_t)); + NETSNMP_IMPORT void *snmp_sess_add(netsnmp_session *, struct netsnmp_transport_s *, int (*fpre_parse) (netsnmp_session *, -- 2.1.2 ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders