… | |
… | |
8 | |
8 | |
9 | my $ber = ber_decode $buf, $Convert::BER::XS::SNMP_PROFILE |
9 | my $ber = ber_decode $buf, $Convert::BER::XS::SNMP_PROFILE |
10 | or die "unable to decode SNMP message"; |
10 | or die "unable to decode SNMP message"; |
11 | |
11 | |
12 | # The above results in a data structure consisting of |
12 | # The above results in a data structure consisting of |
13 | # (class, tag, flags, data) |
13 | # (class, tag, flags, data) |
14 | # tuples. Below is such a message, SNMPv1 trap |
14 | # tuples. Below is such a message, SNMPv1 trap |
15 | # with a Cisco mac change notification. |
15 | # with a Cisco mac change notification. |
16 | # Did you know that Cisco is in the news almost |
16 | # Did you know that Cisco is in the news almost |
17 | # every week because of some backdoor password |
17 | # every week because of some backdoor password |
18 | # or other extremely stupid security bug? |
18 | # or other extremely stupid security bug? |
… | |
… | |
641 | |
641 | |
642 | Returns the BER type mapped to the given C<$class>/C<$tag> combination. |
642 | Returns the BER type mapped to the given C<$class>/C<$tag> combination. |
643 | |
643 | |
644 | =back |
644 | =back |
645 | |
645 | |
646 | =head2 BER TYPES |
646 | =head2 BER Types |
647 | |
647 | |
648 | This lists the predefined BER types - you can map any C<CLASS>/C<TAG> |
648 | This lists the predefined BER types. BER types are formatters used |
649 | combination to any C<BER_TYPE_*>. |
649 | internally to format and encode BER values. You can assign any C<BER_TYPE> |
|
|
650 | to any C<CLASS>/C<TAG> combination tgo change how that tag is decoded or |
|
|
651 | encoded. |
650 | |
652 | |
651 | =over |
653 | =over |
652 | |
654 | |
653 | =item C<BER_TYPE_BYTES> |
655 | =item C<BER_TYPE_BYTES> |
654 | |
656 | |
… | |
… | |
737 | $SNMP_PROFILE->set (ASN_APPLICATION, SNMP_COUNTER64 , BER_TYPE_INT); |
739 | $SNMP_PROFILE->set (ASN_APPLICATION, SNMP_COUNTER64 , BER_TYPE_INT); |
738 | |
740 | |
739 | =head2 LIMITATIONS/NOTES |
741 | =head2 LIMITATIONS/NOTES |
740 | |
742 | |
741 | This module can only en-/decode 64 bit signed and unsigned integers, and |
743 | This module can only en-/decode 64 bit signed and unsigned integers, and |
742 | only when your perl supports those. |
744 | only when your perl supports those. So no UUID OIDs for now (unless you |
|
|
745 | map the C<OBJECT IDENTIFIER> tag to something other than C<BER_TYPE_OID>). |
743 | |
746 | |
744 | This module does not generally care about ranges, i.e. it will happily |
747 | This module does not generally care about ranges, i.e. it will happily |
745 | de-/encode 64 bit integers into an C<ASN_INTEGER> value, or a negative |
748 | de-/encode 64 bit integers into an C<ASN_INTEGER> value, or a negative |
746 | number into an C<SNMP_COUNTER64>. |
749 | number into an C<SNMP_COUNTER64>. |
747 | |
750 | |
748 | OBJECT IDENTIFIEERs cannot have unlimited length, although the limit is |
751 | OBJECT IDENTIFIEERs cannot have unlimited length, although the limit is |
749 | much larger than e.g. the one imposed by SNMP or other protocols,a nd is |
752 | much larger than e.g. the one imposed by SNMP or other protocols, and is |
750 | about 4kB. |
753 | about 4kB. |
751 | |
754 | |
752 | Indefinite length encoding is not supported. |
755 | Indefinite length encoding is not supported. |
753 | |
756 | |
754 | Constructed strings are decoded just fine, but there should be a way to |
757 | Constructed strings are decoded just fine, but there should be a way to |
755 | join them for convenience. |
758 | join them for convenience. |
756 | |
759 | |
757 | REAL values are not supported and will currently croak. |
760 | REAL values are not supported and will currently croak. |
758 | |
761 | |
759 | The encoder and decoder tend to accept more formats than should be |
762 | The encoder and decoder tend to accept more formats than should be |
760 | strictly supported. |
763 | strictly supported - security sensitive applications are strongly advised |
|
|
764 | to review the code first. |
761 | |
765 | |
762 | This module has undergone little to no testing so far. |
766 | This module has undergone little to no testing so far. |
763 | |
767 | |
764 | =head2 ITHREADS SUPPORT |
768 | =head2 ITHREADS SUPPORT |
765 | |
769 | |