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.8 by root, Sat Apr 11 06:24:18 2009 UTC vs.
Revision 1.16 by root, Fri Dec 21 11:21:06 2018 UTC

23=over 4 23=over 4
24 24
25=item overriding internal functions might cause the module to 25=item overriding internal functions might cause the module to
26malfunction with future versions of Net::SNMP 26malfunction with future versions of Net::SNMP
27 27
28=item only leading dots for oids are supported
29
30=item error messages will be simpler/different 28=item error messages will be simpler/different
31 29
32=item translation will be ignored (all values will be delivered "raw") 30=item translation will be ignored (all values will be delivered "raw")
33 31
34=item a moderately modern (>= C99) C compiler is required 32=item a moderately modern (>= C99) C compiler is required
43 41
44=cut 42=cut
45 43
46package Net::SNMP::XS; 44package Net::SNMP::XS;
47 45
48use strict qw(vars subs); 46use common::sense;
49no warnings;
50
51use Guard;
52 47
53use Net::SNMP (); 48use Net::SNMP ();
54use Net::SNMP::PDU (); 49use Net::SNMP::PDU ();
55use Net::SNMP::Message (); 50use Net::SNMP::Message ();
56use Net::SNMP::MessageProcessing (); 51use Net::SNMP::MessageProcessing ();
57 52
58our $VERSION; 53our $VERSION;
59our $old_prepare;
60 54
61BEGIN { 55BEGIN {
62 $VERSION = '0.02'; 56 $VERSION = 1.32;
63 57
64 $old_prepare = \&Net::SNMP::MessageProcessing::prepare_data_elements; 58 # this overrides many methods inside Net::SNMP and it's submodules
65
66 # this overrides many methods inside
67 require XSLoader; 59 require XSLoader;
68 XSLoader::load Net::SNMP::XS, $VERSION; 60 XSLoader::load Net::SNMP::XS, $VERSION;
69}
70
71sub Net::SNMP::MessageProcessing::prepare_data_elements {
72 my ($self, $msg) = @_;
73
74 set_msg $msg, $msg->{_buffer};
75 scope_guard \&clr_msg;
76 &$old_prepare
77} 61}
78 62
79package Net::SNMP::Message; 63package Net::SNMP::Message;
80 64
81Net::SNMP::XS::set_type INTEGER , \&_process_integer32; 65Net::SNMP::XS::set_type INTEGER , \&_process_integer32;
102Net::SNMP::XS::set_type SNMPV2_TRAP , \&_process_v2_trap; 86Net::SNMP::XS::set_type SNMPV2_TRAP , \&_process_v2_trap;
103Net::SNMP::XS::set_type REPORT , \&_process_report; 87Net::SNMP::XS::set_type REPORT , \&_process_report;
104 88
105package Net::SNMP::PDU; 89package Net::SNMP::PDU;
106 90
107# var_bind_list hardcodes oid_lext_sort. *sigh* 91# var_bind_list hardcodes oid_lex_sort. *sigh*
108# we copy it 1:1, except for using oid_lex_sort. 92# we copy it 1:1, except for using oid_lex_sort.
109 93
110sub var_bind_list 94sub var_bind_list
111{ 95{
112 my ($this, $vbl, $types) = @_; 96 my ($this, $vbl, $types) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines