maadev / php-snmp

Automatically exported from code.google.com/p/php-snmp
0 stars 0 forks source link

Is not working due to some bugs #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Calling SNMP::trap() is not working

What version of the product are you using? On what operating system?
Debian, Lenny

Please provide any additional information below.
Bugs in SNMP.php

Line: 80
$trap is not exists, should be $pSnmp

Line: 91
$trapPacket is not exists, should be $snmpPacket

Proposals:
All functions shoul be part od class.
SNMPTrap is better name for class.

Impreved hexlen:
    public static function hexlen( $s ) 
    {
        $len     = strlen( $s );
        $hexlen  = self::dec2hex( $len );
        $keyByte = ""; 

        if( $len > 127 ){
          $lenBytes = strlen( $hexlen ) / 2;
          $keyByte = self::dec2hex( 0x80 + $lenBytes );
        }

        return $keyByte . $hexlen;
    }

Original issue reported on code.google.com by miloslav...@gmail.com on 2 Oct 2009 at 5:07

GoogleCodeExporter commented 9 years ago
NOTE
Right now due to many work I don't have much time to make changes and fix bugs.
If some-one wants to, mail me and I'll give you access to sources

Original comment by T.Kalapun on 11 Nov 2009 at 9:22

GoogleCodeExporter commented 9 years ago
fixed first 2 bugs
do you want to have access to source?

Original comment by T.Kalapun on 11 Nov 2009 at 9:40