xref: /freebsd/crypto/openssl/doc/man3/OSSL_DISPATCH.pod (revision ccfd87fe2ac0e2e6aeb1911a7d7cce6712a8564f)
1=pod
2
3=head1 NAME
4
5OSSL_DISPATCH - OpenSSL Core type to define a dispatchable function table
6
7=head1 SYNOPSIS
8
9 #include <openssl/core.h>
10
11 typedef struct ossl_dispatch_st OSSL_DISPATCH;
12 struct ossl_dispatch_st {
13     int function_id;
14     void (*function)(void);
15 };
16
17=head1 DESCRIPTION
18
19This type is a tuple of function identity and function pointer.
20Arrays of this type are passed between the OpenSSL libraries and the
21providers to describe what functionality one side provides to the other.
22
23Arrays of this type must be terminated with a tuple having function identity
24zero and function pointer NULL.
25
26=head2 B<OSSL_DISPATCH> fields
27
28=over 4
29
30=item I<function_id>
31
32OpenSSL defined function identity of the implemented function.
33
34=item I<function>
35
36Pointer to the implemented function itself.  Despite the generic definition
37of this field, the implemented function it points to must have a function
38signature that corresponds to the I<function_id>
39
40=back
41
42Available function identities and corresponding function signatures are
43defined in L<openssl-core_dispatch.h(7)>.
44Furthermore, the chosen function identities and associated function
45signature must be chosen specifically for the operation that it's intended
46for, as determined by the intended L<OSSL_ALGORITHM(3)> array.
47
48Any function identity not recognised by the recipient of this type
49will be ignored.
50This ensures that providers built with one OpenSSL version in mind
51will work together with any other OpenSSL version that supports this
52mechanism.
53
54=begin comment RETURN VALUES doesn't make sense for a manual that only
55describes a type, but document checkers still want that section, and
56to have more than just the section title.
57
58=head1 RETURN VALUES
59
60txt
61
62=end comment
63
64=head1 SEE ALSO
65
66L<crypto(7)>, L<openssl-core_dispatch.h(7)>, L<OSSL_ALGORITHM(3)>
67
68=head1 HISTORY
69
70B<OSSL_DISPATCH> was added in OpenSSL 3.0.
71
72=head1 COPYRIGHT
73
74Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
75
76Licensed under the Apache License 2.0 (the "License").  You may not use
77this file except in compliance with the License.  You can obtain a copy
78in the file LICENSE in the source distribution or at
79L<https://www.openssl.org/source/license.html>.
80
81=cut
82