ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-BER-XS/XS.pm
(Generate patch)

Comparing Convert-BER-XS/XS.pm (file contents):
Revision 1.29 by root, Sat Apr 20 15:39:13 2019 UTC vs.
Revision 1.32 by root, Sat Apr 20 16:12:53 2019 UTC

393use Exporter qw(import); 393use Exporter qw(import);
394 394
395our $VERSION; 395our $VERSION;
396 396
397BEGIN { 397BEGIN {
398 $VERSION = 0.8; 398 $VERSION = 0.9;
399 XSLoader::load __PACKAGE__, $VERSION; 399 XSLoader::load __PACKAGE__, $VERSION;
400} 400}
401 401
402our %EXPORT_TAGS = ( 402our %EXPORT_TAGS = (
403 const_index => [qw( 403 const_index => [qw(
582C<BER_TYPE_BYTES>. When you don't want that but instead prefer a hard 582C<BER_TYPE_BYTES>. When you don't want that but instead prefer a hard
583error for some types, then C<BER_TYPE_CROAK> is for you. 583error for some types, then C<BER_TYPE_CROAK> is for you.
584 584
585=back 585=back
586 586
587=head2 Example Profile
588
589The following creates a profile suitable for SNMP - it's exactly identical
590to the C<$Convert::BER::XS::SNMP_PROFILE> profile.
591
592 our $SNMP_PROFILE = new Convert::BER::XS::Profile;
593
594 $SNMP_PROFILE->set (ASN_APPLICATION, SNMP_IPADDRESS , BER_TYPE_IPADDRESS);
595 $SNMP_PROFILE->set (ASN_APPLICATION, SNMP_COUNTER32 , BER_TYPE_INT);
596 $SNMP_PROFILE->set (ASN_APPLICATION, SNMP_UNSIGNED32, BER_TYPE_INT);
597 $SNMP_PROFILE->set (ASN_APPLICATION, SNMP_TIMETICKS , BER_TYPE_INT);
598 $SNMP_PROFILE->set (ASN_APPLICATION, SNMP_OPAQUE , BER_TYPE_IPADDRESS);
599 $SNMP_PROFILE->set (ASN_APPLICATION, SNMP_COUNTER64 , BER_TYPE_INT);
600
587=cut 601=cut
588 602
589our $DEFAULT_PROFILE = new Convert::BER::XS::Profile; 603our $DEFAULT_PROFILE = new Convert::BER::XS::Profile;
590our $SNMP_PROFILE = new Convert::BER::XS::Profile; 604
605$DEFAULT_PROFILE->_set_default;
591 606
592# additional SNMP application types 607# additional SNMP application types
608our $SNMP_PROFILE = new Convert::BER::XS::Profile;
609
593$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_IPADDRESS , BER_TYPE_IPADDRESS); 610$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_IPADDRESS , BER_TYPE_IPADDRESS);
594$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_COUNTER32 , BER_TYPE_INT); 611$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_COUNTER32 , BER_TYPE_INT);
595$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_UNSIGNED32, BER_TYPE_INT); 612$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_UNSIGNED32, BER_TYPE_INT);
596$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_TIMETICKS , BER_TYPE_INT); 613$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_TIMETICKS , BER_TYPE_INT);
597$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_OPAQUE , BER_TYPE_IPADDRESS); 614$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_OPAQUE , BER_TYPE_IPADDRESS);
598$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_COUNTER64 , BER_TYPE_INT); 615$SNMP_PROFILE->set (ASN_APPLICATION, SNMP_COUNTER64 , BER_TYPE_INT);
599 616
600$DEFAULT_PROFILE->_set_default;
601
6021; 6171;
603 618
604=head2 LIMITATIONS/NOTES 619=head2 LIMITATIONS/NOTES
605 620
606This module can only en-/decode 64 bit signed and unsigned integers, and 621This module can only en-/decode 64 bit signed and unsigned integers, and
619Constructed strings are decoded just fine, but there should be a way to 634Constructed strings are decoded just fine, but there should be a way to
620join them for convenience. 635join them for convenience.
621 636
622REAL values are not supported and will currently croak. 637REAL values are not supported and will currently croak.
623 638
639The encoder and decoder tend to accept more formats than should be
640strictly supported.
641
624This module has undergone little to no testing so far. 642This module has undergone little to no testing so far.
625 643
626=head2 ITHREADS SUPPORT 644=head2 ITHREADS SUPPORT
627 645
628This module is unlikely to work when the (officially discouraged) ithreads 646This module is unlikely to work when the (officially discouraged) ithreads

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines