Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.unix.programmer > #8264
| From | spud@potato.field |
|---|---|
| Newsgroups | comp.unix.programmer |
| Subject | Re: Resolver API question |
| Date | 2016-03-29 15:52 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <nde8b4$1emg$1@gioia.aioe.org> (permalink) |
| References | <nddn6b$eqk$1@gioia.aioe.org> <barmar-AF2BB6.11350029032016@88-209-239-213.giganet.hu> |
On Tue, 29 Mar 2016 11:35:00 -0400 Barry Margolin <barmar@alum.mit.edu> wrote: >In article <nddn6b$eqk$1@gioia.aioe.org>, spud@potato.field wrote: > >> I'm trying to decode the rdata field returned in a resource record by the >> ns_parserr() function. eg: >> >> ns_parserr(&msg,ns_s_an,i,&r_rec); >> rdata = ns_rr_rdata(r_rec); >> >> However the ns_name_uncompress() function only seems to work with rdata in >NS >> records and using it on other types either produces garbage or an error but >> the >> rdata pointer still cannot be printed out directly. >> >> Does anyone know how to translate it for A and MX records? I know I could >use >> ns_sprintferr() and then parse the output string but thats a bit ugly. There >> must be an nicer way. > >There's no name in the rdata of an A record, it just has an IP address, >which is in binary. And for an MX record you have to skip over the >priority field to get to the server name. I'm presuming that priority field is a subfield of the rdata field in the resource record because its not a field defined in the ns_rr structure? -- Spud
Back to comp.unix.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Resolver API question spud@potato.field - 2016-03-29 10:59 +0000
Re: Resolver API question Barry Margolin <barmar@alum.mit.edu> - 2016-03-29 11:35 -0400
Re: Resolver API question spud@potato.field - 2016-03-29 15:52 +0000
Re: Resolver API question Rainer Weikusat <rweikusat@talktalk.net> - 2016-03-30 15:54 +0100
csiph-web