dllmain_ipsec_vista.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Copyright (C) 2013-2014 Mamadou DIOP
  2. * Copyright (C) 2013-2014 Doubango Telecom <http://www.doubango.org>
  3. *
  4. * This file is part of Open Source Doubango Framework.
  5. *
  6. * DOUBANGO is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * DOUBANGO is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with DOUBANGO.
  18. */
  19. #include "plugin_win_ipsec_vista_config.h"
  20. #include "tipsec.h"
  21. #include "tsk_plugin.h"
  22. #include "tsk_debug.h"
  23. #include <windows.h>
  24. extern const tipsec_plugin_def_t *plugin_win_ipsec_vista_plugin_def_t;
  25. PLUGIN_WIN_IPSEC_VISTA_BEGIN_DECLS /* BEGIN */
  26. PLUGIN_WIN_IPSEC_VISTA_API int __plugin_get_def_count();
  27. PLUGIN_WIN_IPSEC_VISTA_API tsk_plugin_def_type_t __plugin_get_def_type_at(int index);
  28. PLUGIN_WIN_IPSEC_VISTA_API tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index);
  29. PLUGIN_WIN_IPSEC_VISTA_API tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index);
  30. PLUGIN_WIN_IPSEC_VISTA_END_DECLS /* END */
  31. typedef enum PLUGIN_INDEX_E {
  32. PLUGIN_INDEX_WFP, // Windows Filtering platform
  33. PLUGIN_INDEX_COUNT
  34. }
  35. PLUGIN_INDEX_T;
  36. BOOL APIENTRY DllMain( HMODULE hModule,
  37. DWORD ul_reason_for_call,
  38. LPVOID lpReserved
  39. )
  40. {
  41. switch (ul_reason_for_call) {
  42. case DLL_PROCESS_ATTACH:
  43. break;
  44. case DLL_THREAD_ATTACH:
  45. break;
  46. case DLL_THREAD_DETACH:
  47. break;
  48. case DLL_PROCESS_DETACH:
  49. break;
  50. }
  51. return TRUE;
  52. }
  53. int __plugin_get_def_count()
  54. {
  55. return PLUGIN_INDEX_COUNT;
  56. }
  57. tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
  58. {
  59. switch(index) {
  60. case PLUGIN_INDEX_WFP: {
  61. return tsk_plugin_def_type_ipsec;
  62. }
  63. }
  64. TSK_DEBUG_ERROR("No plugin at index %d", index);
  65. return tsk_plugin_def_type_none;
  66. }
  67. tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
  68. {
  69. switch(index) {
  70. case PLUGIN_INDEX_WFP: {
  71. return tsk_plugin_def_media_type_all;
  72. }
  73. }
  74. TSK_DEBUG_ERROR("No plugin at index %d", index);
  75. return tsk_plugin_def_media_type_none;
  76. }
  77. tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
  78. {
  79. switch(index) {
  80. case PLUGIN_INDEX_WFP: {
  81. return plugin_win_ipsec_vista_plugin_def_t;
  82. }
  83. }
  84. TSK_DEBUG_ERROR("No plugin at index %d", index);
  85. return tsk_null;
  86. }