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.13 by root, Thu Sep 18 02:58:42 2014 UTC

22 22
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
28=item only leading dots for oids are supported
29 27
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
54use Net::SNMP::PDU (); 52use Net::SNMP::PDU ();
55use Net::SNMP::Message (); 53use Net::SNMP::Message ();
56use Net::SNMP::MessageProcessing (); 54use Net::SNMP::MessageProcessing ();
57 55
58our $VERSION; 56our $VERSION;
59our $old_prepare;
60 57
61BEGIN { 58BEGIN {
62 $VERSION = '0.02'; 59 $VERSION = 1.3;
63 60
64 $old_prepare = \&Net::SNMP::MessageProcessing::prepare_data_elements; 61 # this overrides many methods inside Net::SNMP and it's submodules
65
66 # this overrides many methods inside
67 require XSLoader; 62 require XSLoader;
68 XSLoader::load Net::SNMP::XS, $VERSION; 63 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} 64}
78 65
79package Net::SNMP::Message; 66package Net::SNMP::Message;
80 67
81Net::SNMP::XS::set_type INTEGER , \&_process_integer32; 68Net::SNMP::XS::set_type INTEGER , \&_process_integer32;
102Net::SNMP::XS::set_type SNMPV2_TRAP , \&_process_v2_trap; 89Net::SNMP::XS::set_type SNMPV2_TRAP , \&_process_v2_trap;
103Net::SNMP::XS::set_type REPORT , \&_process_report; 90Net::SNMP::XS::set_type REPORT , \&_process_report;
104 91
105package Net::SNMP::PDU; 92package Net::SNMP::PDU;
106 93
107# var_bind_list hardcodes oid_lext_sort. *sigh* 94# var_bind_list hardcodes oid_lex_sort. *sigh*
108# we copy it 1:1, except for using oid_lex_sort. 95# we copy it 1:1, except for using oid_lex_sort.
109 96
110sub var_bind_list 97sub var_bind_list
111{ 98{
112 my ($this, $vbl, $types) = @_; 99 my ($this, $vbl, $types) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines