typecasting



Hi all,

i am receiving a buffer from network...
there are n number of options in buffer type char*
each option contain thr fields of fixed size.
1)type
2)length
3)value

example->

struct authProt
{
uint8_t type;
uint8_t length;
uint16_t authprot;

};

have created a char array of pointers to point to all these n
options.
char *options[n];
then how to decode each field of an option.

all comments are welcome....

.



Relevant Pages

  • Re: typecasting
    ... there are n number of options in buffer type char* ... have created a char array of pointers to point to all these n ... struct authProt auth; ... Adjust for the endianness of the incoming data (you do not need to worry about the endianness of the receiving machine doing it this way). ...
    (comp.lang.c)
  • Re: typecasting
    ... there are n number of options in buffer type char* ... each option contain thr fields of fixed size. ... int type; ... struct authProt auth; ...
    (comp.lang.c)