natxo has asked for the wisdom of the Perl Monks concerning the following question:
It looks like this (ldif format):
dnsRecord:: BAABAAXwAACkAAAAAAABLAAAAAAAAAAArBQEKA==
This is the format of the dnsRecord string: https://msdn.microsoft.com/en-us/library/ee898781.aspx
I am really not a Perl guru, so I would really appreciate some handholding ;-) with unpacking this. Any help greatly appreciated. I will look into perlpacktut but I am a bit over my head with it right now.
update: I have tried this:
Obviously not what I expected.my $blob = "BAABAAXwAACGAAAAAAABLAAAAAAAAAAArBQEKA=="; my ( $dataLength, # 2 bytes $type, # 2 bytes $version, # 1 byte $rank, # 1 byte $flags, # 2 bytes $serial, # 4 bytes $ttl, # 4 bytes $reserved, # 4 bytes $timestamp, # 4 bytes $data ) = unpack( 'S S C C S L N L L a*', $blob ); print $dataLength, "\n"; print "$type\n"; print "$version\n"; print "$rank\n"; print "$flags\n"; print "$serial\n"; print "$ttl\n"; print "$reserved\n"; print "$timestamp\n"; print "$data\n"; $ perl /tmp/kkk.pl 16706 16961 65 65 30552 1195589953 1094795585 1111572801 1094795596 AAAAAAAArBQEKA==
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unpack blob
by VinsWorldcom (Prior) on Jan 12, 2016 at 22:07 UTC | |
by choroba (Cardinal) on Jan 12, 2016 at 22:33 UTC | |
by VinsWorldcom (Prior) on Jan 13, 2016 at 12:53 UTC | |
by natxo (Scribe) on Jan 12, 2016 at 22:15 UTC | |
by VinsWorldcom (Prior) on Jan 13, 2016 at 13:49 UTC | |
by Tux (Canon) on Jan 13, 2016 at 14:23 UTC | |
|
Re: unpack blob
by 1nickt (Canon) on Jan 12, 2016 at 22:06 UTC | |
by natxo (Scribe) on Jan 12, 2016 at 22:09 UTC |