xref: /openssl/doc/man3/SSL_inject_net_dgram.pod (revision f8503ede)
1=pod
2
3=head1 NAME
4
5SSL_inject_net_dgram - inject a datagram as though received from the network
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_inject_net_dgram(SSL *s, const unsigned char *buf,
12                          size_t buf_len,
13                          const BIO_ADDR *peer,
14                          const BIO_ADDR *local);
15
16=head1 DESCRIPTION
17
18This function can be used to inject a datagram payload to a QUIC connection SSL
19object. The payload is processed as though it was received from the network.
20This function can be used for debugging purposes or to allow datagrams to be fed
21to QUIC from alternative sources.
22
23I<buf> is required and must point to a datagram payload to inject. I<buf_len> is
24the length of the buffer in bytes. The buffer is copied and need not remain
25valid after this function returns.
26
27I<peer> and I<local> are optional values pointing to B<BIO_ADDR> structures
28describing the remote and local UDP endpoint addresses for the packet. Though
29the injected packet was not actually received from the network directly by
30OpenSSL, the packet will be processed as though the received datagram had the
31given addresses.
32
33=head1 RETURN VALUES
34
35Returns 1 on success or 0 on failure. This function always fails if called
36on a SSL object which is not a QUIC connection SSL object.
37
38=head1 SEE ALSO
39
40L<OSSL_QUIC_client_method(3)>, L<SSL_handle_events(3)>, L<SSL_set_blocking_mode(3)>
41
42=head1 HISTORY
43
44The function SSL_inject_net_dgram() was added in OpenSSL 3.2.
45
46=head1 COPYRIGHT
47
48Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
49
50Licensed under the Apache License 2.0 (the "License").  You may not use
51this file except in compliance with the License.  You can obtain a copy
52in the file LICENSE in the source distribution or at
53L<https://www.openssl.org/source/license.html>.
54
55=cut
56