libloc is the library that reads, writes and verifies the IPFire Location Database. These are the manual pages of its programs and of its C API. Pages that document more than one function are listed with all of them; their man pages can be opened under any of those names.

Programs

location(1)

Look up addresses, export networks for firewalls, and keep the database up to date.

location-importer(1)

Build the database from the Regional Internet Registries and other sources.

Getting Started

libloc(3)

What the library does, a quickstart, and how references, errors and threads work.

Python and Lua

python-location(3)

The Python module: look up addresses, list networks, verify and write databases.

lua-location(3)

The Lua module: look up addresses, list networks, and verify databases.

Contexts and Logging

loc_new(3)

Create a new libloc context: loc_new(), loc_ref(), loc_unref().

loc_set_log_callback(3)

Set a callback for log messages.

loc_set_log_priority(3)

Set the log level of a context.

loc_get_log_priority(3)

Fetch the log level of a context.

loc_set_log_fn(3)

Deprecated, and has no effect. Use loc_set_log_callback() instead.

Databases

loc_database_new(3)

Open a database, and read what it says about itself: loc_database_new(), loc_database_open(), loc_database_ref(), loc_database_unref(), loc_database_created_at(), loc_database_get_vendor(), loc_database_get_description(), loc_database_get_license().

loc_database_lookup(3)

Look up the network of an address: loc_database_lookup(), loc_database_lookup_from_string().

loc_database_get_as(3)

Fetch an Autonomous System.

loc_database_count_as(3)

Return the number of Autonomous Systems.

loc_database_get_country(3)

Fetch a country.

loc_database_verify(3)

Check the signature of a database.

loc_database_reload(3)

Read the database again after it has been updated: loc_database_reload(), loc_database_set_reload_interval().

loc_discover_latest_version(3)

Find out in the DNS when the latest database has been published.

Walking Through a Database

loc_database_enumerator_new(3)

Walk through all networks, Autonomous Systems or countries: loc_database_enumerator_new(), loc_database_enumerator_ref(), loc_database_enumerator_unref(), loc_database_enumerator_next_network(), loc_database_enumerator_next_as(), loc_database_enumerator_next_country().

loc_database_enumerator_set_string(3)

Choose what an enumerator returns: loc_database_enumerator_set_string(), loc_database_enumerator_set_countries(), loc_database_enumerator_get_countries(), loc_database_enumerator_set_asns(), loc_database_enumerator_get_asns(), loc_database_enumerator_set_flag(), loc_database_enumerator_set_family().

Networks

loc_network_new(3)

Create networks: loc_network_new(), loc_network_new_from_string(), loc_network_ref(), loc_network_unref(), loc_network_str(), loc_network_address_family(), loc_network_prefix().

loc_network_get_first_address(3)

The addresses of a network: loc_network_get_first_address(), loc_network_get_last_address(), loc_network_format_first_address(), loc_network_format_last_address(), loc_network_reverse_pointer().

loc_network_get_asn(3)

What is known about a network: loc_network_get_asn(), loc_network_set_asn(), loc_network_get_country_code(), loc_network_set_country_code(), loc_network_matches_country_code(), loc_network_has_flag(), loc_network_set_flag().

loc_network_cmp(3)

Compare networks and take them apart: loc_network_cmp(), loc_network_matches_address(), loc_network_overlaps(), loc_network_is_subnet(), loc_network_subnets(), loc_network_exclude(), loc_network_exclude_list().

loc_network_list_new(3)

A sorted list of networks: loc_network_list_new(), loc_network_list_ref(), loc_network_list_unref(), loc_network_list_size(), loc_network_list_empty(), loc_network_list_clear(), loc_network_list_get(), loc_network_list_contains(), loc_network_list_dump().

loc_network_list_push(3)

Add networks to a list and take them off again: loc_network_list_push(), loc_network_list_pop(), loc_network_list_pop_first(), loc_network_list_merge().

Autonomous Systems

loc_as_new(3)

Autonomous Systems: loc_as_new(), loc_as_ref(), loc_as_unref(), loc_as_get_number(), loc_as_get_name(), loc_as_set_name(), loc_as_cmp().

loc_as_list_new(3)

A list of Autonomous Systems: loc_as_list_new(), loc_as_list_ref(), loc_as_list_unref(), loc_as_list_size(), loc_as_list_empty(), loc_as_list_clear(), loc_as_list_get(), loc_as_list_sort().

loc_as_list_append(3)

Add Autonomous Systems to a list, and find them on it: loc_as_list_append(), loc_as_list_contains(), loc_as_list_contains_number().

Countries

loc_country_new(3)

Countries: loc_country_new(), loc_country_ref(), loc_country_unref(), loc_country_get_code(), loc_country_get_name(), loc_country_set_name(), loc_country_get_continent_code(), loc_country_set_continent_code(), loc_country_cmp().

loc_country_code_is_valid(3)

Check country codes: loc_country_code_is_valid(), loc_country_special_code_to_flag().

loc_country_list_new(3)

A list of countries: loc_country_list_new(), loc_country_list_ref(), loc_country_list_unref(), loc_country_list_size(), loc_country_list_empty(), loc_country_list_clear(), loc_country_list_get(), loc_country_list_sort().

loc_country_list_append(3)

Add countries to a list, and find them on it: loc_country_list_append(), loc_country_list_contains(), loc_country_list_contains_code().

Writing a Database

loc_writer_new(3)

Create a database: loc_writer_new(), loc_writer_ref(), loc_writer_unref(), loc_writer_add_as(), loc_writer_add_network(), loc_writer_add_country(), loc_writer_write().

loc_writer_set_vendor(3)

Describe a database: loc_writer_set_vendor(), loc_writer_get_vendor(), loc_writer_set_description(), loc_writer_get_description(), loc_writer_set_license(), loc_writer_get_license().