--- Convert-BER-XS/XS.pm 2019/04/20 01:31:07 1.14 +++ Convert-BER-XS/XS.pm 2019/04/20 02:07:29 1.15 @@ -75,12 +75,9 @@ If is tuned for low memory and high speed, while still maintaining some level of user-friendlyness. -Currently, not much is documented, as this is an initial release to -reserve CPAN namespace, stay tuned for a few days. - =head2 ASN.1/BER/DER/... BASICS -ASN.1 is a strange language that can be sed to describe protocols and +ASN.1 is a strange language that can be used to describe protocols and data structures. It supports various mappings to JSON, XML, but most importantly, to a various binary encodings such as BER, that is the topic of this module, and is used in SNMP or LDAP for example. @@ -92,7 +89,7 @@ with just a binary blob for the actual value. This works because BER values are tagged with a type and a namespace, -and also have a flag that says whther a value consists of subvalues (is +and also have a flag that says whether a value consists of subvalues (is "constructed") or not (is "primitive"). Tags are simple integers, and ASN.1 defines a somewhat weird assortment of @@ -349,7 +346,7 @@ application-specific ones. This means that class/tag combinations not in the base set of ASN.1 are decoded into their raw octet strings. -C defines two profile variables you cna use out of the box: +C defines two profile variables you can use out of the box: =over @@ -358,8 +355,8 @@ This is the default profile, i.e. the profile that is used when no profile is specified for de-/encoding. -You cna modify it, but remember that this modifies the defaults for all -callers that rely on the defauit profile. +You can modify it, but remember that this modifies the defaults for all +callers that rely on the default profile. =item C<$Convert::BER::XS::SNMP_PROFILE> @@ -367,6 +364,7 @@ useful when de-/encoding SNMP data. Example: + $ber = ber_decode $data, $Convert::BER::XS::SNMP_PROFILE; =back @@ -389,6 +387,7 @@ values of C<$tag> will consume large amounts of memory. Example: + $profile = new Convert::BER::XS::Profile; $profile->set (ASN_APPLICATION, SNMP_COUNTER32, BER_TYPE_INT); $ber = ber_decode $data, $profile; @@ -440,13 +439,13 @@ =item C -Same as C but uses relative OID encoding: ASN.1 has this -hack of encoding the first two OID components into a single integer in a -weird attempt to save an insignificant amount of space in an otherwise -wasteful encoding, and relative OIDs are basically OIDs without this -hack. The practical difference is that the second component of an OID -can only have the values 1..40, while relative OIDs do not have this -restriction. +Same as C but uses relative object identifier +encoding: ASN.1 has this hack of encoding the first two OID components +into a single integer in a weird attempt to save an insignificant amount +of space in an otherwise wasteful encoding, and relative OIDs are +basically OIDs without this hack. The practical difference is that the +second component of an OID can only have the values 1..40, while relative +OIDs do not have this restriction. =item C @@ -464,10 +463,10 @@ =item C -Decodes/encodes a four byte string into an IOv4 dotted-quad address string -in perl. Given ther obsolete nature of this type, this is a low-effort +Decodes/encodes a four byte string into an IPv4 dotted-quad address string +in Perl. Given the obsolete nature of this type, this is a low-effort implementation that simply uses C and C-style conversion, -so it won't handle all string forms supported by C. +so it won't handle all string forms supported by C for example. =item C