ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Net-SNMP-XS/XS.pm
(Generate patch)

Comparing Net-SNMP-XS/XS.pm (file contents):
Revision 1.17 by root, Fri Dec 21 11:22:37 2018 UTC vs.
Revision 1.18 by root, Fri Apr 19 15:50:48 2019 UTC

4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use Net::SNMP::XS; 7 use Net::SNMP::XS;
8 8
9 # loading it is enough, there are no public symbols 9 # loading it is enough to speed up Net::SNMP
10
11 # experimental BER decoder
12 use Net::SNMP::XS ':ber';
13
14 # TODO
10 15
11=head1 DESCRIPTION 16=head1 DESCRIPTION
12 17
13This module tries to speed up Net::SNMP response packet decoding. 18This module tries to speed up Net::SNMP response packet decoding.
14 19
37 42
38=item REPORT PDUs are not supported 43=item REPORT PDUs are not supported
39 44
40=back 45=back
41 46
47Beginning with version 2, this module also contains a generic BER decoder,
48with lacking documentation. More to come, but this might eventually move
49to it's own module.
50
42=cut 51=cut
43 52
44package Net::SNMP::XS; 53package Net::SNMP::XS;
45 54
46use common::sense; 55use common::sense;
56
57use Exporter qw(import);
47 58
48use Net::SNMP (); 59use Net::SNMP ();
49use Net::SNMP::PDU (); 60use Net::SNMP::PDU ();
50use Net::SNMP::Message (); 61use Net::SNMP::Message ();
51use Net::SNMP::MessageProcessing (); 62use Net::SNMP::MessageProcessing ();
52 63
53our $VERSION; 64our $VERSION;
54 65
55BEGIN { 66BEGIN {
56 $VERSION = 1.33; 67 $VERSION = '2.0';
57 68
58 # this overrides many methods inside Net::SNMP and it's submodules 69 # this overrides many methods inside Net::SNMP and it's submodules
59 require XSLoader; 70 require XSLoader;
60 XSLoader::load Net::SNMP::XS, $VERSION; 71 XSLoader::load Net::SNMP::XS, $VERSION;
61} 72}
73
74our %EXPORT_TAGS = (
75 ber => [qw(
76 ber_decode
77 ber_eq ber_seq ber_i32 ber_oid
78 BER_CLASS BER_TAG BER_CONSTRUCTED BER_DATA
79 ASN_BOOLEAN ASN_INTEGER32 ASN_BIT_STRING ASN_OCTET_STRING ASN_NULL ASN_OBJECT_IDENTIFIER ASN_TAG_BER ASN_TAG_MASK
80 ASN_CONSTRUCTED ASN_UNIVERSAL ASN_APPLICATION ASN_CONTEXT ASN_PRIVATE ASN_CLASS_MASK ASN_CLASS_SHIFT
81 ASN_SEQUENCE ASN_IPADDRESS ASN_COUNTER32 ASN_UNSIGNED32 ASN_TIMETICKS ASN_OPAQUE ASN_COUNTER64
82 )],
83);
84
85our @EXPORT_OK = @{ $EXPORT_TAGS{ber} };
62 86
63package Net::SNMP::Message; 87package Net::SNMP::Message;
64 88
65Net::SNMP::XS::set_type INTEGER , \&_process_integer32; 89Net::SNMP::XS::set_type INTEGER , \&_process_integer32;
66Net::SNMP::XS::set_type OCTET_STRING , \&_process_octet_string; 90Net::SNMP::XS::set_type OCTET_STRING , \&_process_octet_string;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines