X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Flibloc.git;a=blobdiff_plain;f=src%2Floc%2Fformat.h;h=8309d1cf66858e29ece8b9d989466c18a3cdcfc4;hp=130d0ff6b732416ad7cb9cda2bda356b0073209a;hb=4bf49d00974267b132a1c5bbc487570d10af1324;hpb=8eb67d2641d5b184bb7c955ff55dc892f2f7f3e7 diff --git a/src/loc/format.h b/src/loc/format.h index 130d0ff..8309d1c 100644 --- a/src/loc/format.h +++ b/src/loc/format.h @@ -20,8 +20,13 @@ #include #define LOC_DATABASE_MAGIC "LOCDBXX" + +#ifdef LIBLOC_PRIVATE + #define LOC_DATABASE_VERSION 0 +#define LOC_DATABASE_PAGE_SIZE 4096 + struct loc_database_magic { char magic[7]; @@ -30,21 +35,51 @@ struct loc_database_magic { }; struct loc_database_header_v0 { + // UNIX timestamp when the database was created + uint64_t created_at; + // Vendor who created the database uint32_t vendor; // Description of the database uint32_t description; + // License of the database + uint32_t license; + // Tells us where the ASes start uint32_t as_offset; uint32_t as_length; + // Tells us where the networks start + uint32_t network_data_offset; + uint32_t network_data_length; + + // Tells us where the network nodes start + uint32_t network_tree_offset; + uint32_t network_tree_length; + // Tells us where the pool starts uint32_t pool_offset; uint32_t pool_length; }; +struct loc_database_network_node_v0 { + uint32_t zero; + uint32_t one; +}; + +struct loc_database_network_v0 { + // The start address will be encoded in the tree + uint8_t prefix; + + // The country this network is located in + char country_code[2]; + + // ASN + uint32_t asn; +}; + struct loc_database_as_v0 { // The AS number uint32_t number; @@ -54,3 +89,4 @@ struct loc_database_as_v0 { }; #endif +#endif