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.11 by root, Thu Jul 29 02:52:07 2010 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 strict qw(vars subs); 55use common::sense;
47no warnings;
48 56
49use Guard; 57use Exporter qw(import);
50 58
51use Net::SNMP (); 59use Net::SNMP ();
52use Net::SNMP::PDU (); 60use Net::SNMP::PDU ();
53use Net::SNMP::Message (); 61use Net::SNMP::Message ();
54use Net::SNMP::MessageProcessing (); 62use Net::SNMP::MessageProcessing ();
55 63
56our $VERSION; 64our $VERSION;
57 65
58BEGIN { 66BEGIN {
59 $VERSION = '1.1'; 67 $VERSION = '2.0';
60 68
61 # this overrides many methods inside Net::SNMP and it's submodules 69 # this overrides many methods inside Net::SNMP and it's submodules
62 require XSLoader; 70 require XSLoader;
63 XSLoader::load Net::SNMP::XS, $VERSION; 71 XSLoader::load Net::SNMP::XS, $VERSION;
64} 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} };
65 86
66package Net::SNMP::Message; 87package Net::SNMP::Message;
67 88
68Net::SNMP::XS::set_type INTEGER , \&_process_integer32; 89Net::SNMP::XS::set_type INTEGER , \&_process_integer32;
69Net::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