Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "common.h"
00017
00018
00019 static inline uint64_t swap64(uint64_t in)
00020 {
00021 #ifndef WORDS_BIGENDIAN
00022
00023
00024 uint64_t rv= 0;
00025 uint8_t x= 0;
00026 for(x= 0; x < 8; x++)
00027 {
00028 rv= (rv << 8) | (in & 0xff);
00029 in >>= 8;
00030 }
00031 return rv;
00032 #else
00033
00034 return in;
00035 #endif
00036 }
00037
00038 uint64_t ntohll(uint64_t value)
00039 {
00040 return swap64(value);
00041 }
00042
00043 uint64_t htonll(uint64_t value)
00044 {
00045 return swap64(value);
00046 }