Wireshark使用pletohs将unsigned char转换为unsigned short,如何理解此代码?

时间:2019-03-25 02:42:20

标签: wireshark

我正在阅读wireshark源代码,但是我听不懂这段代码:

typedef unsigned short guint16;
typedef unsigned char guint8;
#define pletohs(p)  ((guint16)                       \                                                                                                                                                                                      
                     ((guint16)*((const guint8 *)(p)+1)<<8|  \
                      (guint16)*((const guint8 *)(p)+0)<<0))
const guint8 *ptr;
pletohs(ptr);    

pletohs是如何工作的?

0 个答案:

没有答案