SSL_inject_net_dgram.pod 1.8 KB

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