Re: Parsing a Section of Binary String Data!
- From: "zoltan" <zoltan.jose@xxxxxxxxx>
- Date: 21 Mar 2006 23:20:03 -0800
dotnetdotcn@xxxxxxx wrote:
zoltan wrote:
Hi,look at this:
The scenario is like this :
struct ns_rr {
const u_char* rdata;
};
The rdata field contains some fields such as :
char * flags;
char * services;
char * regexp;
char * replacement;
I want to parse the rdata section and obtain the individual string
fields as shown above. Can anyone suggest an efficient method? Are
these strings terminiated by '\0' within the rdata section?
Thanks and Regards,
Timmy Jose.
struct ns_rr * a;
puts(a->rdata->flags);
The problem is this :
ns_rr is the Standard type which is used to store the data.
I know that the various fields ( flag, services etc) are in the rdata
member. So to extract them, I define my own structure like this :
struct NAPTR
{
char * flags;
char * services;
char * regexp;
char * replacement;
};
So the compiler has no idea that there is a field called "flags" inside
the rdata member!!! That is the trouble... Any ideas?
.
- Follow-Ups:
- Re: Parsing a Section of Binary String Data!
- From: Nick Keighley
- Re: Parsing a Section of Binary String Data!
- References:
- Parsing a Section of Binary String Data!
- From: zoltan
- Re: Parsing a Section of Binary String Data!
- From: dotnetdotcn
- Parsing a Section of Binary String Data!
- Prev by Date: Re: good ebook links
- Next by Date: Re: reversing a byte
- Previous by thread: Re: Parsing a Section of Binary String Data!
- Next by thread: Re: Parsing a Section of Binary String Data!
- Index(es):
Relevant Pages
|
|