X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Floc%2Fformat.h;h=3679828d1a9d4cbd04a31bf06c5f19c8b9f1af0b;hb=f4fef543d41fc013c820d1bc981725487d5a3a64;hp=c590a6447aa594f4639eaa3d355f29d50147f223;hpb=39a55353998bb8b854e0ad4ad4a31357aaf69b25;p=people%2Fms%2Flibloc.git diff --git a/src/loc/format.h b/src/loc/format.h index c590a64..3679828 100644 --- a/src/loc/format.h +++ b/src/loc/format.h @@ -25,6 +25,9 @@ #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 { @@ -59,9 +62,16 @@ struct loc_database_header_v0 { 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 { @@ -79,6 +89,12 @@ struct loc_database_network_v0 { // ASN uint32_t asn; + + // Flags + uint16_t flags; + + // Reserved + char padding[2]; }; struct loc_database_as_v0 { @@ -89,5 +105,13 @@ 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