Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

tvb_get_letohs() or tvb_get_bits16() is not working properly on ubuntu(little endian machine)

Hi,

we are migrating one of the existing plugin code from wireshark 1x to wireshark 2x. we have used tvb_get_ntohs() in existing code but it looks like it is invalid in 2x so tried to replace it with tvb_get_bits16/tvb_get_letohs() but it is not able to read 2 bytes of data properly.

ex: dissect()
case NRACH_INDICATION: {
//length = tvb_get_ntohs(tvb, offset ); // this is 1x code length = tvb_get_bits16(tvb, offset, 16, ENC_LITTLE_ENDIAN); or length = tvb_get_letohs(tvb, offset ); } }

please let me know the issue of the above api calls.

tvb_get_letohs() or tvb_get_bits16() is not working properly on ubuntu(little endian machine)

Hi,

we are migrating one of the existing plugin code from wireshark 1x to wireshark 2x. we have used tvb_get_ntohs() in existing code but it looks like it is invalid in 2x so tried to replace it with tvb_get_bits16/tvb_get_letohs() tvb_ge\t_bits16/tvb_get_letohs() but it is not able to read 2 bytes of data properly.

ex: ex:

dissect() 
case NRACH_INDICATION: { {
//length = tvb_get_ntohs(tvb, offset ); // this is 1x code length = tvb_get_bits16(tvb, offset, 16, ENC_LITTLE_ENDIAN); or length = tvb_get_letohs(tvb, offset ); }

}

please let me know the issue of the above api calls.

tvb_get_letohs() or tvb_get_bits16() is not working properly on ubuntu(little endian machine)

Hi,

we are migrating one of the existing plugin code from wireshark 1x to wireshark 2x. we have used tvb_get_ntohs() in existing code but it looks like it is invalid in 2x so tried to replace it with tvb_ge\t_bits16/tvb_get_letohs() tvb_get_bits16/tvb_get_letohs() but it is not able to read 2 bytes of data properly.

ex:

dissect()      
 case NRACH_INDICATION:
        {      
                //length = tvb_get_ntohs(tvb, offset ); // this is 1x code
                   length = tvb_get_bits16(tvb, offset, 16, ENC_LITTLE_ENDIAN); or length = tvb_get_letohs(tvb, offset );
        }

}

please let me know the issue of the above api calls.

tvb_get_letohs() or tvb_get_bits16() is not working properly on ubuntu(little endian machine)

Hi,

we are migrating one of the existing plugin code from wireshark 1x to wireshark 2x. we have used tvb_get_ntohs() in existing code but it looks like it is invalid in 2x so tried to replace it with tvb_get_bits16/tvb_get_letohs() but it is not able to read 2 bytes of data properly.

ex:

dissect()      
 case NRACH_INDICATION:
  case NRACH_INDICATION:
    {      
         //length = tvb_get_ntohs(tvb, offset ); // this is 1x code
          length = tvb_get_bits16(tvb, offset, 16, ENC_LITTLE_ENDIAN); or length = tvb_get_letohs(tvb, offset );
     }
}

}

please let me know the issue of the above api calls.