#define LOC_DATABASE_VERSION 0
+#define STR(x) #x
+#define LOC_DATABASE_DOMAIN_LATEST(version) "_latest._v" STR(version) ".location.ipfire.org"
+
#define LOC_DATABASE_PAGE_SIZE 4096
struct loc_database_magic {
uint32_t network_tree_offset;
uint32_t network_tree_length;
+ // Tells us where the countries start
+ uint32_t countries_offset;
+ uint32_t countries_length;
+
// Tells us where the pool starts
uint32_t pool_offset;
uint32_t pool_length;
+
+ // Add some padding for future extensions
+ char padding[32];
};
struct loc_database_network_node_v0 {
// ASN
uint32_t asn;
+
+ // Flags
+ uint16_t flags;
+
+ // Reserved
+ char padding[2];
};
struct loc_database_as_v0 {
uint32_t name;
};
+struct loc_database_country_v0 {
+ char code[2];
+ char continent_code[2];
+
+ // Name in the string pool
+ uint32_t name;
+};
+
#endif
#endif