Hello All,
I have the following doubt:
Currently both the ipv4/ipv6 headers are such that they donot result in any padding. So it allows us to typecast the input stream to the ipv4/ipv6 header c structures. But don't you feel that this code is error prone ?
int Comp::getfield(uint8* pInPktStream)
{
int swStreamType = -1;
// examine the compressible chain of subheaders
if(getVersion(*pInPktStream) == IP_VERSION_IPv4)
{
// IPv4
st_ipv4* poIp = (st_ipv4*) pInPktStream;
:
:
}
Don;t you feel
st_ipv4* poIp = (st_ipv4*) pInPktStream;
blindly typecasting will result to problems ?