From karel.slany at nic.cz Tue Sep 10 15:18:08 2013 From: karel.slany at nic.cz (Karel Slany) Date: Tue, 10 Sep 2013 17:18:08 +0200 Subject: [ldns-users] Python rdf.data() In-Reply-To: <521E42BD.1020809@nottheoilrig.com> References: <521549A6.7030809@nottheoilrig.com> <5215D255.4090009@nlnetlabs.nl> <52160495.7010009@nic.cz> <521E42BD.1020809@nottheoilrig.com> Message-ID: <522F3830.9050102@nic.cz> Hello Jack, I apologise for the delay. I've added the functionality you wanted. Currently it is only available in the git repository (git://git.nlnetlabs.nl/ldns/). The new rdf method is called data_as_bytearray() which returns a Python bytearray containing a copy of the rdf data. A simple usage example can be found in the attachment. Best regards, K. Am 28.08.2013 20:34, schrieb Jack Bates: > Thank you Karel, I want to access certificate association data from a > TLSA RR. From C I would use ldns_rdf_data() and ldns_rdf_size(), is that > right? From Python, how do you use the return value from rdf.data()? > > The RDF is type HEX, so str(rdf) returns hex digits. I can convert them > back to bytes, but rdf.data() and rdf.size() seemed like the more direct > way to get the bytes? > > On 22/08/13 05:31 AM, Karel Slany wrote: >> Greetings, >> >> Python's ldns_rdf.data() creates a thin wrapper around the ldns C >> function ldns_rdf_data(). Function ldns_rdf_data() returns a pointer to >> an internal data field of the manipulated rdf. >> >> Actually, I don't know the actual reason why you are trying to access >> this low level structures. Manipulating them from Python can be tricky >> as you can easily end up with corrupted memory. >> >> In order to meet your desire I can add a new method ldns_rdf.data_str() >> which would return a Python string containing copy of the rdf data >> field. However, in Python3 this would be error-prone, because Python3 >> uses unicode strings. At the moment I cannot guess, whether the approach >> would be reliabe in Python3. >> >> Please give more information about the reason why you want to use >> ldns_rdf.data(). Perhaps we could think of a more convenient solution. >> >> K. >> >> Am 22.08.2013 10:56, schrieb Willem Toorop: >>> Hi Jack, >>> >>> I suspect raw access is not supported by pyldns. >>> Karel, could shed some light on this? >>> >>> -- Willem >>> >>> Op 22-08-13 01:13, Jack Bates schreef: >>>> I am working with the Python wrapper for ldns. >>>> >>>> rdf.data() returns something like >>>> >>>> >>>> and rdf.size() returns the number of bytes. How do I read the bytes? >>>> >>>> Thanks! >>>> _______________________________________________ >>>> ldns-users mailing list >>>> ldns-users at open.nlnetlabs.nl >>>> http://open.nlnetlabs.nl/mailman/listinfo/ldns-users >>> >>> _______________________________________________ >>> ldns-users mailing list >>> ldns-users at open.nlnetlabs.nl >>> http://open.nlnetlabs.nl/mailman/listinfo/ldns-users >>> -------------- next part -------------- A non-text attachment was scrubbed... Name: test_bytearray.py Type: text/x-python Size: 544 bytes Desc: not available URL: From rafiee at hpi.uni-potsdam.de Thu Sep 12 13:35:04 2013 From: rafiee at hpi.uni-potsdam.de (Rafiee, Hosnieh) Date: Thu, 12 Sep 2013 13:35:04 +0000 Subject: [ldns-users] centos 6.4 final Message-ID: <8EBBE4774B42FC45BA1143BE7F3F5A0F0E870D@MXMA2012.hpi.uni-potsdam.de> Hello, I encountered a problem during the installation of ldns on Centos 64 bits. I downloaded the latest version from repository and used the following command Autoreconfig -install ./configure Make When I use make I receive Make**** Buffer.lo error 63 Anybody knows how to solve this problem? Thanks, Best Regards, Hosnieh -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at nohats.ca Thu Sep 12 13:51:49 2013 From: paul at nohats.ca (Paul Wouters) Date: Thu, 12 Sep 2013 09:51:49 -0400 (EDT) Subject: [ldns-users] centos 6.4 final In-Reply-To: <8EBBE4774B42FC45BA1143BE7F3F5A0F0E870D@MXMA2012.hpi.uni-potsdam.de> References: <8EBBE4774B42FC45BA1143BE7F3F5A0F0E870D@MXMA2012.hpi.uni-potsdam.de> Message-ID: On Thu, 12 Sep 2013, Rafiee, Hosnieh wrote: > I encountered a problem during the installation of ldns on Centos 64 bits. ?I downloaded the latest version from repository and used the > following command > > Autoreconfig ?install > > ./configure > > Make > > When I use make I receive > > Make**** Buffer.lo ?error 63 >From the spec file of EPEL6: %prep %setup -q # To built svn snapshots # rm config.guess config.sub ltmain.sh # aclocal # libtoolize -c --install # autoreconf --install Just activate those lines. Paul