diff options
author | arved <arved@FreeBSD.org> | 2005-01-14 15:49:47 +0000 |
---|---|---|
committer | arved <arved@FreeBSD.org> | 2005-01-14 15:49:47 +0000 |
commit | 7aeafb17be7bed2f7ebbd1e17774d41da9aa0b03 (patch) | |
tree | 9b09c76d8a0c13647871cb60b6955abe6575718f /net-mgmt | |
parent | a38449d7565bb607d70dc847c742e531182fbe2f (diff) | |
download | FreeBSD-ports-7aeafb17be7bed2f7ebbd1e17774d41da9aa0b03.zip FreeBSD-ports-7aeafb17be7bed2f7ebbd1e17774d41da9aa0b03.tar.gz |
Add py-yapsnmp, yet another Python SNMP module based on net-snmp library
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/py-yapsnmp/Makefile | 31 | ||||
-rw-r--r-- | net-mgmt/py-yapsnmp/distinfo | 2 | ||||
-rw-r--r-- | net-mgmt/py-yapsnmp/files/patch-configure | 11 | ||||
-rw-r--r-- | net-mgmt/py-yapsnmp/files/patch-src-snmp_api.h-patch | 247 | ||||
-rw-r--r-- | net-mgmt/py-yapsnmp/pkg-descr | 16 | ||||
-rw-r--r-- | net-mgmt/py-yapsnmp/pkg-plist | 3 |
7 files changed, 311 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index b33d589..42795d3 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -134,6 +134,7 @@ SUBDIR += py-flowtools SUBDIR += py-ipy SUBDIR += py-snmp + SUBDIR += py-yapsnmp SUBDIR += rancid SUBDIR += rate SUBDIR += remarp diff --git a/net-mgmt/py-yapsnmp/Makefile b/net-mgmt/py-yapsnmp/Makefile new file mode 100644 index 0000000..0d79437 --- /dev/null +++ b/net-mgmt/py-yapsnmp/Makefile @@ -0,0 +1,31 @@ +# New ports collection makefile for: py-yapsnmp +# Date created: 2005-01-07 +# Whom: arved +# +# $FreeBSD$ + +PORTNAME= yapsnmp +PORTVERSION= 0.7.8 +CATEGORIES= net-mgmt +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= yapsnmp +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= arved@FreeBSD.org +COMMENT= Python SNMP module based on net-snmp + +LIB_DEPENDS= netsnmp.7:${PORTSDIR}/net-mgmt/net-snmp + +USE_GMAKE= yes +USE_PYTHON= yes +USE_REINPLACE= yes +USE_LIBTOOL_VER=15 +GNU_CONFIGURE= yes +CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \ + LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib" + +post-patch: + ${REINPLACE_CMD} -e "s,-lsnmp,-lnetsnmp," \ + ${WRKSRC}/configure + +.include <bsd.port.mk> diff --git a/net-mgmt/py-yapsnmp/distinfo b/net-mgmt/py-yapsnmp/distinfo new file mode 100644 index 0000000..99ad2b9 --- /dev/null +++ b/net-mgmt/py-yapsnmp/distinfo @@ -0,0 +1,2 @@ +MD5 (yapsnmp-0.7.8.tar.gz) = 8a3e9a5b814388d7907c639105cb2365 +SIZE (yapsnmp-0.7.8.tar.gz) = 308340 diff --git a/net-mgmt/py-yapsnmp/files/patch-configure b/net-mgmt/py-yapsnmp/files/patch-configure new file mode 100644 index 0000000..e83d1a7 --- /dev/null +++ b/net-mgmt/py-yapsnmp/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig Fri Jan 7 17:13:40 2005 ++++ configure Fri Jan 7 17:13:59 2005 +@@ -9291,7 +9291,7 @@ + done + + +-for PYTHONINCPATH in python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 ++for PYTHONINCPATH in python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 + do + as_ac_Header=`echo "ac_cv_header_$PYTHONINCPATH/Python.h" | $as_tr_sh` + if eval "test \"\${$as_ac_Header+set}\" = set"; then diff --git a/net-mgmt/py-yapsnmp/files/patch-src-snmp_api.h-patch b/net-mgmt/py-yapsnmp/files/patch-src-snmp_api.h-patch new file mode 100644 index 0000000..45628c0a --- /dev/null +++ b/net-mgmt/py-yapsnmp/files/patch-src-snmp_api.h-patch @@ -0,0 +1,247 @@ +--- src/snmp_api.h-patch.orig Fri Jan 7 17:10:27 2005 ++++ src/snmp_api.h-patch Fri Jan 7 17:10:56 2005 +@@ -1,147 +1,100 @@ +-*** /usr/include/net-snmp/library/snmp_api.h 2003-11-11 08:37:07.000000000 -0800 +---- snmp_api.h 2004-03-07 15:02:18.000000000 -0800 +-*************** +-*** 82,91 **** +- +- /* +- * The actual transport domain. This SHOULD NOT BE FREE()D. +-- */ +- +- const oid *tDomain; +- size_t tDomainLen; +- +- netsnmp_variable_list *variables; +- +---- 82,91 ---- +- +- /* +- * The actual transport domain. This SHOULD NOT BE FREE()D. +- +- const oid *tDomain; +- size_t tDomainLen; +-+ */ +- +- netsnmp_variable_list *variables; +- +-*************** +-*** 152,158 **** +- /* +- * Authentication function or NULL if null authentication is used +- */ +-! u_char *(*authenticator) (u_char *, size_t *, u_char *, size_t); +- netsnmp_callback callback; /* Function to interpret incoming data */ +- /* +- * Pointer to data that the callback function may consider important +---- 152,158 ---- +- /* +- * Authentication function or NULL if null authentication is used +- */ +-! /* u_char *(*authenticator) (u_char *, size_t *, u_char *, size_t);*/ +- netsnmp_callback callback; /* Function to interpret incoming data */ +- /* +- * Pointer to data that the callback function may consider important +-*************** +-*** 384,391 **** +---- 384,393 ---- +- +- #define SNMPERR_MAX (-63) +- +-+ /* +- #define non_repeaters errstat +- #define max_repetitions errindex +-+ */ +- +- struct variable_list { +- struct variable_list *next_variable; /* NULL for last variable */ +-*************** +-*** 410,416 **** +- oid name_loc[MAX_OID_LEN]; /* 90 percentile < 24. */ +- u_char buf[40]; /* 90 percentile < 40. */ +- void *data; /* (Opaque) hook for additional data */ +-! void (*dataFreeHook)(void *); /* callback to free above */ +- int index; +- }; +- +---- 412,418 ---- +- oid name_loc[MAX_OID_LEN]; /* 90 percentile < 24. */ +- u_char buf[40]; /* 90 percentile < 40. */ +- void *data; /* (Opaque) hook for additional data */ +-! /* void (*dataFreeHook)(void *); */ /* callback to free above */ +- int index; +- }; +- +-*************** +-*** 601,608 **** +- size_t); +- int netsnmp_oid_equals(const oid *, size_t, const oid *, +- size_t); +-! int netsnmp_oid_tree_equals(const oid *, size_t, const oid *, +-! size_t); +- int netsnmp_oid_is_subtree(const oid *, size_t, const oid *, +- size_t); +- int netsnmp_oid_find_prefix(const oid * in_name1, size_t len1, +---- 603,610 ---- +- size_t); +- int netsnmp_oid_equals(const oid *, size_t, const oid *, +- size_t); +-! /* int netsnmp_oid_tree_equals(const oid *, size_t, const oid *, +-! size_t);*/ +- int netsnmp_oid_is_subtree(const oid *, size_t, const oid *, +- size_t); +- int netsnmp_oid_find_prefix(const oid * in_name1, size_t len1, +-*************** +-*** 619,629 **** +---- 621,633 ---- ++--- snmp_api.h.orig Fri Jan 7 17:06:46 2005 +++++ snmp_api.h Fri Jan 7 17:10:01 2005 ++@@ -112,10 +112,10 @@ ++ ++ /** ++ * The actual transport domain. This SHOULD NOT BE FREE()D. ++- */ ++ ++ const oid *tDomain; ++ size_t tDomainLen; +++ */ ++ ++ netsnmp_variable_list *variables; ++ ++@@ -209,7 +209,7 @@ ++ /** ++ * Authentication function or NULL if null authentication is used ++ */ ++- u_char *(*authenticator) (u_char *, size_t *, u_char *, size_t); +++ /* u_char *(*authenticator) (u_char *, size_t *, u_char *, size_t); */ ++ /** Function to interpret incoming data */ ++ netsnmp_callback callback; ++ /** ++@@ -487,8 +487,10 @@ ++ ++ #define SNMPERR_MAX (-63) ++ +++/* ++ #define non_repeaters errstat ++ #define max_repetitions errindex +++*/ ++ ++ typedef union { ++ long *integer; ++@@ -530,7 +532,7 @@ ++ /** (Opaque) hook for additional data */ ++ void *data; ++ /** callback to free above */ ++- void (*dataFreeHook)(void *); +++ /* void (*dataFreeHook)(void *); */ ++ int index; ++ }; ++ ++@@ -721,8 +723,8 @@ ++ size_t); ++ int netsnmp_oid_equals(const oid *, size_t, const oid *, ++ size_t); ++- int netsnmp_oid_tree_equals(const oid *, size_t, const oid *, ++- size_t); +++/* int netsnmp_oid_tree_equals(const oid *, size_t, const oid *, +++ size_t);*/ ++ int netsnmp_oid_is_subtree(const oid *, size_t, const oid *, ++ size_t); ++ int netsnmp_oid_find_prefix(const oid * in_name1, size_t len1, ++@@ -739,11 +741,13 @@ ++ size_t * out_length, ++ u_char * pdu_data, ++ size_t pdu_data_len); +++/* ++ 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); +-+ /* +- 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); +-+ */ +- int snmpv3_make_report(netsnmp_pdu *pdu, int error); +- int snmpv3_get_report_type(netsnmp_pdu *pdu); +- int snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, +-*************** +-*** 672,677 **** +---- 676,682 ---- +- * Extended open; fpre_parse has changed. +- */ +- +-+ /* +- netsnmp_session *snmp_open_ex(netsnmp_session *, +- int (*fpre_parse) (netsnmp_session *, +- struct +-*************** +-*** 689,694 **** +---- 694,700 ---- +- netsnmp_pdu *, u_char **, +- size_t *, size_t *), +- int (*fcheck) (u_char *, size_t)); +-+ */ +- +- /* +- * provided for backwards compatability. Don't use these functions. +-*************** +-*** 770,775 **** +---- 776,782 ---- +- * +- */ +- +-+ /* +- void *snmp_sess_add_ex(netsnmp_session *, +- struct netsnmp_transport_s *, +- int (*fpre_parse) (netsnmp_session *, +-*************** +-*** 836,841 **** +---- 843,849 ---- +- *, void *, +- size_t) +- ); +-+ */ +- +- /* +- * use return value from snmp_sess_open as void * parameter +++*/ ++ int snmpv3_make_report(netsnmp_pdu *pdu, int error); ++ int snmpv3_get_report_type(netsnmp_pdu *pdu); ++ int snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, ++@@ -793,6 +797,7 @@ ++ * Extended open; fpre_parse has changed. ++ */ ++ +++ /* ++ netsnmp_session *snmp_open_ex(netsnmp_session *, ++ int (*fpre_parse) (netsnmp_session *, ++ struct ++@@ -810,6 +815,7 @@ ++ netsnmp_pdu *, u_char **, ++ size_t *, size_t *), ++ int (*fcheck) (u_char *, size_t)); +++ */ ++ ++ /* ++ * provided for backwards compatability. Don't use these functions. ++@@ -891,6 +897,7 @@ ++ * ++ */ ++ +++ /* ++ void *snmp_sess_add_ex(netsnmp_session *, ++ struct netsnmp_transport_s *, ++ int (*fpre_parse) (netsnmp_session *, ++@@ -957,6 +964,7 @@ ++ *, void *, ++ size_t) ++ ); +++ */ ++ ++ /* ++ * use return value from snmp_sess_open as void * parameter diff --git a/net-mgmt/py-yapsnmp/pkg-descr b/net-mgmt/py-yapsnmp/pkg-descr new file mode 100644 index 0000000..855239a --- /dev/null +++ b/net-mgmt/py-yapsnmp/pkg-descr @@ -0,0 +1,16 @@ +yapsnmp is a Python SNMP module based on the net-snmp library. It's composed +of a low level interface to the library, created using SWIG, and a higher +level python module removing all the complexity out of dealing with SNMP. + +* Full MIB parsing, enabling you to use named OIDs as well as the numeric + representations; +* Support for SNMP version 1 and 2c (with 3 coming); +* Supports GET, GETNEXT, GETBULK, SET and TRAPv2 (INFORM to come), as well + as convenient "walk" and "table extraction" functions; +* Uses the Single Session API and appropriate Python interpreter releases, + rendering the module thread safe; +* Offers a very high level interface, allowing easy SNMP integration into + your code. + +WWW: http://yapsnmp.sourceforge.net/ +Author: Yves Perrenoud diff --git a/net-mgmt/py-yapsnmp/pkg-plist b/net-mgmt/py-yapsnmp/pkg-plist new file mode 100644 index 0000000..de17dab --- /dev/null +++ b/net-mgmt/py-yapsnmp/pkg-plist @@ -0,0 +1,3 @@ +%%PYTHON_SITELIBDIR%%/netsnmpc.so +%%PYTHON_SITELIBDIR%%/netsnmp.py +%%PYTHON_SITELIBDIR%%/yapsnmp.py |