sniffer.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* sniffer.h
  2. *
  3. * Copyright (C) 2006-2015 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL. (formerly known as CyaSSL)
  6. *
  7. * wolfSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  20. */
  21. #ifndef WOLFSSL_SNIFFER_H
  22. #define WOLFSSL_SNIFFER_H
  23. #include <wolfssl/wolfcrypt/settings.h>
  24. #ifdef _WIN32
  25. #ifdef SSL_SNIFFER_EXPORTS
  26. #define SSL_SNIFFER_API __declspec(dllexport)
  27. #else
  28. #define SSL_SNIFFER_API __declspec(dllimport)
  29. #endif
  30. #else
  31. #define SSL_SNIFFER_API
  32. #endif /* _WIN32 */
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /* @param typeK: (formerly keyType) was shadowing a global declaration in
  37. * wolfssl/wolfcrypt/asn.h line 175
  38. */
  39. WOLFSSL_API
  40. SSL_SNIFFER_API int ssl_SetPrivateKey(const char* address, int port,
  41. const char* keyFile, int typeK,
  42. const char* password, char* error);
  43. WOLFSSL_API
  44. SSL_SNIFFER_API int ssl_SetNamedPrivateKey(const char* name,
  45. const char* address, int port,
  46. const char* keyFile, int typeK,
  47. const char* password, char* error);
  48. WOLFSSL_API
  49. SSL_SNIFFER_API int ssl_DecodePacket(const unsigned char* packet, int length,
  50. unsigned char** data, char* error);
  51. WOLFSSL_API
  52. SSL_SNIFFER_API int ssl_FreeDecodeBuffer(unsigned char** data, char* error);
  53. WOLFSSL_API
  54. SSL_SNIFFER_API int ssl_Trace(const char* traceFile, char* error);
  55. WOLFSSL_API
  56. SSL_SNIFFER_API int ssl_EnableRecovery(int onOff, int maxMemory, char* error);
  57. WOLFSSL_API
  58. SSL_SNIFFER_API int ssl_GetSessionStats(unsigned int* active,
  59. unsigned int* total,
  60. unsigned int* peak,
  61. unsigned int* maxSessions,
  62. unsigned int* missedData,
  63. unsigned int* reassemblyMemory,
  64. char* error);
  65. WOLFSSL_API void ssl_InitSniffer(void);
  66. WOLFSSL_API void ssl_FreeSniffer(void);
  67. /* ssl_SetPrivateKey typeKs */
  68. enum {
  69. FILETYPE_PEM = 1,
  70. FILETYPE_DER = 2,
  71. };
  72. #ifdef __cplusplus
  73. } /* extern "C" */
  74. #endif
  75. #endif /* wolfSSL_SNIFFER_H */