diff --git a/src/sflowtool.c b/src/sflowtool.c index 28293df..389f777 100644 --- a/src/sflowtool.c +++ b/src/sflowtool.c @@ -29,7 +29,6 @@ extern "C" { #include #include #include -#include #include #include "sflow.h" /* sFlow v5 */ @@ -41,6 +40,17 @@ extern "C" { #define YES 1 #define NO 0 +static uint32_t bswap_32(uint32_t n) { + return (((n & 0x000000FF)<<24) + + ((n & 0x0000FF00)<<8) + + ((n & 0x00FF0000)>>8) + + ((n & 0xFF000000)>>24)); +} + +static uint16_t bswap_16(uint16_t n) { + return ((n >> 8) | (n << 8)); +} + /* define my own IP header struct - to ease portability */ struct myiphdr {