1FIDO_DEV_INFO_MANIFES... BSD Library Functions Manual FIDO_DEV_INFO_MANIFES...
2

NAME

4     fido_dev_info_manifest, fido_dev_info_new, fido_dev_info_free,
5     fido_dev_info_ptr, fido_dev_info_path, fido_dev_info_product,
6     fido_dev_info_vendor, fido_dev_info_manufacturer_string,
7     fido_dev_info_product_string — FIDO 2 device discovery functions
8

SYNOPSIS

10     #include <fido.h>
11
12     int
13     fido_dev_info_manifest(fido_dev_info_t *devlist, size_t ilen,
14         size_t *olen);
15
16     fido_dev_info_t *
17     fido_dev_info_new(size_t n);
18
19     void
20     fido_dev_info_free(fido_dev_info_t **devlist_p, size_t n);
21
22     const fido_dev_info_t *
23     fido_dev_info_ptr(const fido_dev_info_t *devlist, size_t i);
24
25     const char *
26     fido_dev_info_path(const fido_dev_info_t *di);
27
28     int16_t
29     fido_dev_info_product(const fido_dev_info_t *di);
30
31     int16_t
32     fido_dev_info_vendor(const fido_dev_info_t *di);
33
34     const char *
35     fido_dev_info_manufacturer_string(const fido_dev_info_t *di);
36
37     const char *
38     fido_dev_info_product_string(const fido_dev_info_t *di);
39

DESCRIPTION

41     The fido_dev_info_manifest() function fills devlist with up to ilen FIDO
42     devices found by the underlying operating system.  Currently only USB HID
43     devices are supported.  The number of discovered devices is returned in
44     olen, where olen is an addressable pointer.
45
46     The fido_dev_info_new() function returns a pointer to a newly allocated,
47     empty device list with n available slots.  If memory is not available,
48     NULL is returned.
49
50     The fido_dev_info_free() function releases the memory backing *devlist_p,
51     where *devlist_p must have been previously allocated by
52     fido_dev_info_new().  The number n of allocated slots must also be pro‐
53     vided.  On return, *devlist_p is set to NULL.  Either devlist_p or
54     *devlist_p may be NULL, in which case fido_dev_info_free() is a NOP.
55
56     The fido_dev_info_ptr() function returns a pointer to slot number i of
57     devlist.  It is the caller's responsibility to ensure that i is bounded.
58     Please note that the first slot has index 0.
59
60     The fido_dev_info_path() returns the filesystem path or subsystem-spe‐
61     cific identification string of di.
62
63     The fido_dev_info_product() function returns the product ID of di.
64
65     The fido_dev_info_vendor() function returns the vendor ID of di.
66
67     The fido_dev_info_manufacturer_string() function returns the manufacturer
68     string of di.
69
70     The fido_dev_info_product_string() function returns the product string of
71     di.
72
73     An example of how to use the functions described in this document can be
74     found in the examples/manifest.c file shipped with libfido2.
75

RETURN VALUES

77     The fido_dev_info_manifest() function always returns FIDO_OK.  If a dis‐
78     covery error occurs, the olen pointer is set to 0.
79
80     The pointers returned by fido_dev_info_ptr(), fido_dev_info_path(),
81     fido_dev_info_manufacturer_string(), and fido_dev_info_product_string()
82     are guaranteed to exist until fido_dev_info_free() is called on the cor‐
83     responding device list.
84
85BSD                              May 10, 2020                              BSD
Impressum