// Search string
char* string;
char country_code[3];
+ uint32_t asn;
// Index of the AS we are looking at
unsigned int as_index;
return 0;
}
+LOC_EXPORT int loc_database_enumerator_set_asn(
+ struct loc_database_enumerator* enumerator, unsigned int asn) {
+ enumerator->asn = asn;
+
+ return 0;
+}
+
LOC_EXPORT struct loc_as* loc_database_enumerator_next_as(struct loc_database_enumerator* enumerator) {
struct loc_database* db = enumerator->db;
struct loc_as* as;
continue;
}
+ // Skip if the ASN does not match
+ if (e->asn && !loc_network_match_asn(*network, e->asn)) {
+ loc_network_unref(*network);
+ continue;
+ }
+
return 0;
}
}