]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/loc/network.h
Implement search through the network tree
[people/ms/libloc.git] / src / loc / network.h
index be5b3775ea177aa22b0dda380351d34cc04c8b2f..63f4bfa81ab3e2e3f483bc51786eafd94cc667e1 100644 (file)
@@ -30,16 +30,20 @@ int loc_network_new_from_string(struct loc_ctx* ctx, struct loc_network** networ
 struct loc_network* loc_network_ref(struct loc_network* network);
 struct loc_network* loc_network_unref(struct loc_network* network);
 char* loc_network_str(struct loc_network* network);
+int loc_network_match_address(struct loc_network* network, const struct in6_addr* address);
 
 const char* loc_network_get_country_code(struct loc_network* network);
 int loc_network_set_country_code(struct loc_network* network, const char* country_code);
+int loc_network_match_country_code(struct loc_network* network, const char* country_code);
 
 uint32_t loc_network_get_asn(struct loc_network* network);
 int loc_network_set_asn(struct loc_network* network, uint32_t asn);
 
+#ifdef LIBLOC_PRIVATE
+
 int loc_network_to_database_v0(struct loc_network* network, struct loc_database_network_v0* dbobj);
 int loc_network_new_from_database_v0(struct loc_ctx* ctx, struct loc_network** network,
-               struct in6_addr* address, const struct loc_database_network_v0* dbobj);
+               struct in6_addr* address, unsigned int prefix, const struct loc_database_network_v0* dbobj);
 
 struct loc_network_tree;
 int loc_network_tree_new(struct loc_ctx* ctx, struct loc_network_tree** tree);
@@ -63,3 +67,4 @@ int loc_network_tree_node_is_leaf(struct loc_network_tree_node* node);
 struct loc_network* loc_network_tree_node_get_network(struct loc_network_tree_node* node);
 
 #endif
+#endif