Home > Archive > Unix Programming > January 2008 > network packet composition - definition in XML?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
network packet composition - definition in XML?
|
|
| Lars Uffmann 2008-01-08, 8:10 am |
| Hey everyone!
I mean to create a tool that will read a packet directly from the
network and extract the data from it. Namely CCSDS packets, which have a
few preceeding headers, the lowest level one being the tcp/ip
information. I've successfully managed to implement my first
network-based "Hello World!"-application with the implemented socket
library (C++). Now I was wondring in which format best to define the
packet composition, so my tool knows where to read which variable, and
how many times. In the past, I've done format definitions in XML because
I like the readability with text editors for config files, easy editing
and easy access via domxml library (that was in php).
Plus, the nesting of xml tagsd will allow for definition of which subset
in a packet is part of what element. And an xml attribute would allow
for easy definition of repeated occurrences of the same data structure
in a packet. Something along the lines of
<xml>
<firstheader>
<fhAttrib1 />
<fhAttrib2 />
<fhAttrib3 />
<secondheader> <!-- this might be conditional depending on an
attribute of the firstheader, thus a subset of firstheader -->
<shAttrib1 />
<shAttrib2 />
<subset1 repeats="5">
<ss1data1 />
<ss1data2 />
<ss1data3 />
</subset1>
</secondheader>
</firstheader>
</xml>
Now my question is - is there already a good approach for such packet
composition definitions, and where do I find it? I don't wanna invent
the wheel again ;)
And if anyone has a good xml parsing library for C++, I'd be happy if
you could direct me to that!
Best Regards,
Lars Uffmann
| |
| Barry Margolin 2008-01-09, 4:32 am |
| In article <5uh2c4F1i3pp2U1@mid.dfncis.de>,
Lars Uffmann <aral@nurfuerspam.de> wrote:
> Now my question is - is there already a good approach for such packet
> composition definitions, and where do I find it? I don't wanna invent
> the wheel again ;)
I suspect Wireshark already has something like this, to make it easy to
implement packet decoders.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
| |
| Lars Uffmann 2008-01-09, 4:32 am |
| Barry Margolin wrote:
> I suspect Wireshark already has something like this, to make it easy to
> implement packet decoders.
Thanks for the keyword, Barry :) I'm reading myself through the
wireshark FAQ and About sections now, to see if it fits my needs (namely
to decode & encode some specific CCSDS packets to/from program variables).
--
Best Regards,
Lars
| |
|
| On 8 Gen, 11:41, Lars Uffmann <a...@nurfuerspam.de> wrote:
> Hey everyone!
>
> I mean to create a tool that will read a packet directly from the
> network and extract the data from it. Namely CCSDS packets, which have a
> few preceeding headers, the lowest level one being the tcp/ip
> information. I've successfully managed to implement my first
> network-based "Hello World!"-application with the implemented socket
> library (C++). Now I was wondring in which format best to define the
> packet composition, so my tool knows where to read which variable, and
> how many times. In the past, I've done format definitions in XML because
> I like the readability with text editors for config files, easy editing
> and easy access via domxml library (that was in php).
>
> Plus, the nesting of xml tagsd will allow for definition of which subset
> in a packet is part of what element. And an xml attribute would allow
> for easy definition of repeated occurrences of the same data structure
> in a packet. Something along the lines of
>
> <xml>
> =A0 =A0 <firstheader>
> =A0 =A0 =A0 =A0<fhAttrib1 />
> =A0 =A0 =A0 =A0<fhAttrib2 />
> =A0 =A0 =A0 =A0<fhAttrib3 />
> =A0 =A0 =A0 =A0<secondheader> =A0<!-- this might be conditional depending =
on an
> attribute of the firstheader, thus a subset of firstheader -->
> =A0 =A0 =A0 =A0 =A0 <shAttrib1 />
> =A0 =A0 =A0 =A0 =A0 <shAttrib2 />
> =A0 =A0 =A0 =A0 =A0 <subset1 repeats=3D"5">
> =A0 =A0 =A0 =A0 =A0 =A0 =A0<ss1data1 />
> =A0 =A0 =A0 =A0 =A0 =A0 =A0<ss1data2 />
> =A0 =A0 =A0 =A0 =A0 =A0 =A0<ss1data3 />
> =A0 =A0 =A0 =A0 =A0 </subset1>
> =A0 =A0 =A0 =A0</secondheader>
> =A0 =A0 </firstheader>
> </xml>
>
> Now my question is - is there already a good approach for such packet
> composition definitions, and where do I find it? I don't wanna invent
> the wheel again ;)
>
> And if anyone has a good xml parsing library for C++, I'd be happy if
> you could direct me to that!
>
> Best Regards,
>
> =A0 =A0 Lars Uffmann
Could the SML helps you ?
http://www.interfacecontrol.com/sml/Sml/SML_MMM.1.5.pdf
F.
| |
| Lars Uffmann 2008-01-28, 4:33 am |
| Hey Fabrizio :)
Fab <fabrizio.nospam@nospam.nospam> wrote:
> Could the SML helps you ?
> http://www.interfacecontrol.com/sml/Sml/SML_MMM.1.5.pdf
Definitely! Especially considering that I was wanting to define
telemetry packets composition for my applications.
Thanks, that was really helpful!
Best Regards,
Lars
|
|
|
|
|