[Oisf-devel] Decoding Problem [ One byte Missing ]
Prabhakaran Kasinathan
prabhakaran1989 at gmail.com
Wed Jul 25 11:18:41 UTC 2012
Dear Developer's,
I have been working in decoding the IEEE802154 packets and 6LoWPAN packets.
It took some time to understand the decoding functionality. Pls Help!
Now my problem is,
One byte is missing when i try to separate the structure like ( uint16_t ,
uint8_t,*here next 8 bit is missing,* uint16_t ...) it jumps to the next 16
bit and next 16 bit and soo on! What is the problem here?
whereas it works correctly either if i use ( uint16_t , uint8_t
,uint8_t,uint16_t ,uint16_t , and so.... ) or ( uint16_t ,uint16_t
,uint16_t ,uint16_t , ... ) . I couldn't understand this.
*Details :*
The current Header of IEEE802154 packet.
octects 2 1 2 2 2
| FCF | Seq no | Dst Pan | Dst Add | Src Add | remaining data
Hex : 61 88 d9 *22* 00 01 00 64 00 e0 ... Data... [ *the byte 22 is
missing when i print the hole order ]*
My Structure Declarations
*typedef struct Ieee802154Hdr_ {*
* uint16_t ieee802154_fcf;*
* uint8_t ieee802154_seq;*
* uint16_t ieee802154_dstpan;*
* uint16_t ieee802154_dstadd;*
* uint16_t ieee802154_srcadd;*
*} Ieee802154Hdr;*
SCLogInfo("\n Length %d ieee FCF: %x | ieee seq %x | DstPan %04x |
Dstadd %04X | SrcAdd
%04x",len,ntohs(p->ieeeh->ieee802154_fcf),ntohs(p->ieeeh->ieee802154_seq),ntohs(p->ieeeh->ieee802154_dstpan),ntohs(p->ieeeh->ieee802154_dstadd),ntohs(p->ieeeh->ieee802154_srcadd));
*
*
*Output is:*
Length 26 ieee FCF: 6188 | ieee seq d9 | DstPan 0001 | Dstadd 0064 |
SrcAdd 00e0
*it should
be 0022 0001 0064*
Note: If I use the (uint16_t) continuously, I get the bytes correctly. How
to overcome this problem.
*Question 2: *
How to use the SCLogDebug and Printf lines to get printed in console? Since
I couldn't find that. I started using SCLogInfo to print and debug the
error's.
--
Best Regards,
Prabhakaran Kasinathan
+39 3279720502
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openinfosecfoundation.org/pipermail/oisf-devel/attachments/20120725/189454cf/attachment-0002.html>
More information about the Oisf-devel
mailing list