0
在打开的vSwitch 2.4.0实施,我们有以下几点:转换openvswitch类型为小端
#ifdef __CHECKER__
#define OVS_BITWISE __attribute__((bitwise))
#define OVS_FORCE __attribute__((force))
#else
#define OVS_BITWISE
#define OVS_FORCE
#endif
/* The ovs_be<N> types indicate that an object is in big-endian, not
* native-endian, byte order. They are otherwise equivalent to uint<N>_t. */
typedef uint16_t OVS_BITWISE ovs_be16;
typedef struct {
ovs_be16 hi, lo;
} ovs_16aligned_be32;
我有以下变量:
ovs_16aligned_be32 srcIP;
ovs_be16 srcPort ;
我如何转换srcIP
成xxx.yyy.zzz.ttt
和srcPort
变成little-endian uint16_t
?