diff options
author | Tilman Keskinoz <arved@FreeBSD.org> | 2005-01-14 15:49:47 +0000 |
---|---|---|
committer | Tilman Keskinoz <arved@FreeBSD.org> | 2005-01-14 15:49:47 +0000 |
commit | 7e28f3f5c4f5ec2d0fef113e580138c2cb61731f (patch) | |
tree | ec25e9839f850362bb86fe1ed98b41eac58ea1cc /net-mgmt/py-yapsnmp | |
parent | 158a360cc9836816e73af92404c2698611d2a448 (diff) | |
download | ports-7e28f3f5c4f5ec2d0fef113e580138c2cb61731f.tar.gz ports-7e28f3f5c4f5ec2d0fef113e580138c2cb61731f.zip |
Notes
Diffstat (limited to 'net-mgmt/py-yapsnmp')
-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 |
6 files changed, 310 insertions, 0 deletions
diff --git a/net-mgmt/py-yapsnmp/Makefile b/net-mgmt/py-yapsnmp/Makefile new file mode 100644 index 000000000000..0d79437ed899 --- /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 000000000000..99ad2b919bbc --- /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 000000000000..e83d1a7065f7 --- /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 000000000000..45628c0aab06 --- /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 000000000000..855239ab8f9b --- /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 000000000000..de17dabd0362 --- /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 |