… | |
… | |
23 | |
23 | |
24 | #define ASN_LONG_LEN 0x80 |
24 | #define ASN_LONG_LEN 0x80 |
25 | #define ASN_EXTENSION_ID 0x1f |
25 | #define ASN_EXTENSION_ID 0x1f |
26 | #define ASN_BIT8 0x80 |
26 | #define ASN_BIT8 0x80 |
27 | |
27 | |
28 | #define BENCHMARK |
28 | //#define BENCHMARK |
29 | |
29 | |
30 | static SV *msg; |
30 | static SV *msg; |
31 | static int errflag; |
31 | static int errflag; |
32 | static U8 *buf, *cur; |
32 | static U8 *buf, *cur; |
33 | static STRLEN len, rem; |
33 | static STRLEN len, rem; |
… | |
… | |
144 | errflag = 0; |
144 | errflag = 0; |
145 | msg = SvREFCNT_inc (msg_); |
145 | msg = SvREFCNT_inc (msg_); |
146 | buf = SvPVbyte (buf_, len); |
146 | buf = SvPVbyte (buf_, len); |
147 | cur = buf; |
147 | cur = buf; |
148 | rem = len; |
148 | rem = len; |
149 | #ifdef BENCHMARK |
149 | #ifdef BENCHMARK |
150 | t1 = tstamp (); |
150 | t1 = tstamp (); |
151 | #endif |
151 | #endif |
152 | |
152 | |
153 | void |
153 | void |
154 | clr_msg () |
154 | clr_msg () |
155 | CODE: |
155 | CODE: |
156 | SvREFCNT_dec (msg); |
156 | SvREFCNT_dec (msg); |
157 | buf = cur = ""; |
157 | buf = cur = ""; |
158 | len = rem = 0; |
158 | len = rem = 0; |
159 | #ifdef BENCHMARK |
159 | #ifdef BENCHMARK |
160 | printf ("%f\n", tstamp () - t1);//D |
160 | printf ("%f\n", tstamp () - t1);//D |
161 | #endif |
161 | #endif |
162 | |
162 | |
163 | MODULE = Net::SNMP::XS PACKAGE = Net::SNMP::Message |
163 | MODULE = Net::SNMP::XS PACKAGE = Net::SNMP::Message |
164 | |
164 | |
165 | void |
165 | void |
166 | _buffer_get (SV *self, int count = -1) |
166 | _buffer_get (SV *self, int count = -1) |