#include <arpa/inet.h>
#include <assert.h>
-#include <endian.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_ENDIAN_H
+# include <endian.h>
+#endif
+
#include <loc/libloc.h>
+#include <loc/compat.h>
#include <loc/country.h>
#include <loc/network.h>
#include <loc/private.h>
dbobj->asn = htobe32(network->asn);
// Flags
- dbobj->flags = htobe32(network->flags);
+ dbobj->flags = htobe16(network->flags);
return 0;
}
return r;
// Import flags
- r = loc_network_set_flag(*network, be32toh(dbobj->flags));
+ r = loc_network_set_flag(*network, be16toh(dbobj->flags));
if (r)
return r;