imv_agent_if.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Copyright (C) 2013 Andreas Steffen
  3. * HSR Hochschule fuer Technik Rapperswil
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. * for more details.
  14. */
  15. /**
  16. * @defgroup imv_agent_if_t imv_agent_if
  17. * @{ @ingroup imv_os
  18. */
  19. #ifndef IMV_AGENT_IF_H_
  20. #define IMV_AGENT_IF_H_
  21. #include <tncifimv.h>
  22. #include <library.h>
  23. typedef struct imv_agent_if_t imv_agent_if_t;
  24. /**
  25. * IF-IMV interface for IMV agents
  26. */
  27. struct imv_agent_if_t {
  28. /**
  29. * Implements the TNC_IMV_ProvideBindFunction function of the IMV
  30. *
  31. * @param bind_function Function offered by the TNCS
  32. * @return TNC result code
  33. */
  34. TNC_Result (*bind_functions)(imv_agent_if_t *this,
  35. TNC_TNCS_BindFunctionPointer bind_function);
  36. /**
  37. * Implements the TNC_IMV_NotifyConnectionChange() function of the IMV
  38. *
  39. * @param id Network connection ID assigned by TNCS
  40. * @param new_state New connection state to be set
  41. * @return TNC result code
  42. */
  43. TNC_Result (*notify_connection_change)(imv_agent_if_t *this,
  44. TNC_ConnectionID id,
  45. TNC_ConnectionState new_state);
  46. /**
  47. * Implements the TNC_IMV_ReceiveMessage() function of the IMV
  48. *
  49. * @param id Network connection ID assigned by TNCS
  50. * @param msg_type PA-TNC message type
  51. * @param msg Received message
  52. * @return TNC result code
  53. */
  54. TNC_Result (*receive_message)(imv_agent_if_t *this, TNC_ConnectionID id,
  55. TNC_MessageType msg_type, chunk_t msg);
  56. /**
  57. * Implements the TNC_IMV_ReceiveMessageLong() function of the IMV
  58. *
  59. * @param id Network connection ID assigned by TNCS
  60. * @param src_imc_id ID of source IMC
  61. * @param dst_imv_id ID of destination IMV
  62. * @param msg_vid Vendor ID of message type
  63. * @param msg_subtype PA-TNC message subtype
  64. * @param msg Received message
  65. * @return TNC result code
  66. */
  67. TNC_Result (*receive_message_long)(imv_agent_if_t *this,
  68. TNC_ConnectionID id,
  69. TNC_UInt32 src_imc_id,
  70. TNC_UInt32 dst_imv_id,
  71. TNC_VendorID msg_vid,
  72. TNC_MessageSubtype msg_subtype,
  73. chunk_t msg);
  74. /**
  75. * Implements the TNC_IMV_BatchEnding() function of the IMV
  76. *
  77. * @param id Network connection ID assigned by TNCS
  78. * @return TNC result code
  79. */
  80. TNC_Result (*batch_ending)(imv_agent_if_t *this, TNC_ConnectionID id);
  81. /**
  82. * Implements the TNC_IMV_SolicitRecommendation() function of the IMV
  83. *
  84. * @param id Network connection ID assigned by TNCS
  85. * @return TNC result code
  86. */
  87. TNC_Result (*solicit_recommendation)(imv_agent_if_t *this,
  88. TNC_ConnectionID id);
  89. /**
  90. * Destroys an imv_agent_if_t object
  91. */
  92. void (*destroy)(imv_agent_if_t *this);
  93. };
  94. /**
  95. * Constructor template
  96. */
  97. typedef imv_agent_if_t* (*imv_agent_create_t)(const char* name, TNC_IMVID id,
  98. TNC_Version *actual_version);
  99. #endif /** IMV_AGENT_IF_H_ @}*/