DummyPRFileDesc.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @file DummyPRFileDesc.h
  3. * @author Ambroz Bizjak <ambrop7@gmail.com>
  4. *
  5. * @section LICENSE
  6. *
  7. * This file is part of BadVPN.
  8. *
  9. * BadVPN is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2
  11. * as published by the Free Software Foundation.
  12. *
  13. * BadVPN is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. *
  22. * @section DESCRIPTION
  23. *
  24. * Dummy NSPR file descriptor (PRFileDesc).
  25. * Used for creating a model SSL file descriptor to cache various stuff
  26. * to improve performance.
  27. */
  28. #ifndef BADVPN_NSPRSUPPORT_DUMMYPRFILEDESC_H
  29. #define BADVPN_NSPRSUPPORT_DUMMYPRFILEDESC_H
  30. #include <prio.h>
  31. #include <misc/debug.h>
  32. extern PRDescIdentity dummyprfiledesc_identity;
  33. /**
  34. * Globally initialize the dummy NSPR file descriptor backend.
  35. * Must not have been called successfully.
  36. *
  37. * @return 1 on success, 0 on failure
  38. */
  39. int DummyPRFileDesc_GlobalInit (void) WARN_UNUSED;
  40. /**
  41. * Creates a dummy NSPR file descriptor.
  42. * {@link DummyPRFileDesc_GlobalInit} must have been done.
  43. *
  44. * @param prfd uninitialized PRFileDesc structure
  45. */
  46. void DummyPRFileDesc_Create (PRFileDesc *prfd);
  47. #endif