]> git.ipfire.org Git - location/libloc.git/commitdiff
man: Add man pages for all loc_database_* functions
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 2 Jan 2022 14:59:07 +0000 (14:59 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 2 Jan 2022 14:59:07 +0000 (14:59 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
man/libloc.txt
man/loc_database_count_as.txt [new file with mode: 0644]
man/loc_database_get_as.txt [new file with mode: 0644]
man/loc_database_get_country.txt [new file with mode: 0644]
man/loc_database_lookup.txt [new file with mode: 0644]

index fb98f337c96f8cd727ef33fe4e7c8c75509c953f..4da2ec58a3b0136c4ff06d0891fdf5c3bbdaf130 100644 (file)
@@ -425,6 +425,10 @@ MANPAGES = \
 
 MANPAGES_3 = \
        man/libloc.3 \
+       man/loc_database_count_as.3 \
+       man/loc_database_get_as.3 \
+       man/loc_database_get_country.3 \
+       man/loc_database_lookup.3 \
        man/loc_database_new.3 \
        man/loc_get_log_priority.3 \
        man/loc_new.3 \
index fb031e7a67d19a9891ac31db59f681ba99939683..baf98c16c98b0074c27a22d8e5fa08f4480fa595 100644 (file)
@@ -22,6 +22,11 @@ See
        * link:loc_get_log_priority[3]
        * link:loc_set_log_priority[3]
        * link:loc_get_log_fn[3]
+       * link:loc_database_count_as[3]
+       * link:loc_database_get_as[3]
+       * link:loc_database_get_country[3]
+       * link:loc_database_lookup[3]
+       * link:loc_database_new[3]
 
 for more information about the functions available.
 
diff --git a/man/loc_database_count_as.txt b/man/loc_database_count_as.txt
new file mode 100644 (file)
index 0000000..4cbe151
--- /dev/null
@@ -0,0 +1,24 @@
+= loc_database_count_as(3)
+
+== Name
+
+loc_database_count_as - Return the number of ASes in the database
+
+== Synopsis
+[verse]
+
+#include <libloc/database.h>
+
+size_t loc_database_count_as(struct loc_database{empty}* db);
+
+== Description
+
+Returns the total number of ASes in the database.
+
+== See Also
+
+link:libloc[3]
+
+== Authors
+
+Michael Tremer
diff --git a/man/loc_database_get_as.txt b/man/loc_database_get_as.txt
new file mode 100644 (file)
index 0000000..e4b962f
--- /dev/null
@@ -0,0 +1,31 @@
+= loc_database_get_as(3)
+
+== Name
+
+loc_database_get_as - Fetch an AS from the database
+
+== Synopsis
+[verse]
+
+#include <libloc/database.h>
+
+int loc_database_get_as(struct loc_database{empty}* db, struct loc_as{empty}*{empty}* as,
+       uint32_t number);
+
+== Description
+
+This function retrieves an Autonomous System with the matching _number_ from the database
+and stores it in _as_.
+
+== Return Value
+
+On success, zero is returned. Otherwise non-zero is being returned and _errno_ is set
+accordingly.
+
+== See Also
+
+link:libloc[3]
+
+== Authors
+
+Michael Tremer
diff --git a/man/loc_database_get_country.txt b/man/loc_database_get_country.txt
new file mode 100644 (file)
index 0000000..b5ab8ec
--- /dev/null
@@ -0,0 +1,29 @@
+= loc_database_get_country(3)
+
+== Name
+
+loc_database_get_country - Fetch country information from the database
+
+== Synopsis
+
+#include <libloc/database.h>
+
+int loc_database_get_country(struct loc_database{empty}* db,
+       struct loc_country{empty}*{empty}* country, const char{empty}* code);
+
+== Description
+
+This function fetches information about the country with the matching _code_.
+
+== Return Value
+
+On success, zero is returned. Otherwise non-zero is being returned and _errno_ is set
+accordingly.
+
+== See Also
+
+link:libloc[3]
+
+== Authors
+
+Michael Tremer
diff --git a/man/loc_database_lookup.txt b/man/loc_database_lookup.txt
new file mode 100644 (file)
index 0000000..b6f780a
--- /dev/null
@@ -0,0 +1,37 @@
+= loc_database_lookup(3)
+
+== Name
+
+loc_database_lookup - Lookup a network from the database
+
+== Synopsis
+
+#include <libloc/database.h>
+
+int loc_database_lookup(struct loc_database{empty}* db,
+       const struct in6_addr{empty}* address, struct loc_network{empty}*{empty}* network);
+
+int loc_database_lookup_from_string(struct loc_database{empty}* db,
+       const char{empty}* string, struct loc_network{empty}*{empty}* network);
+
+== Description
+
+The lookup functions try finding a network in the database.
+
+_loc_database_lookup_ takes the IP address as _struct in6_addr_ format which can either
+be a regular IPv6 address or a mapped IPv4 address.
+
+_loc_database_lookup_string_ takes the IP address as string and will parse it automatically.
+
+== Return Value
+
+On success, zero is returned. Otherwise non-zero is being returned and _errno_ is set
+accordingly.
+
+== See Also
+
+link:libloc[3]
+
+== Authors
+
+Michael Tremer