al_network.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /**
  2. * Copyright(c) 2011 Sunmedia Technologies - All Rights Reserved.
  3. *
  4. * @file al_network.h
  5. *
  6. * The interface to init, uninit and manipulate network.
  7. *
  8. * @brief Gives the functionalities for quering as well as manipulating
  9. * the database on network related data.
  10. *
  11. * @note .
  12. */
  13. #ifndef __AL_NETWORK_DBMERGE_H__
  14. #define __AL_NETWORK_DBMERGE_H__
  15. #include "al_basictypes.h"
  16. #include "al_database.h"
  17. #ifdef __cplusplus
  18. extern "C"{
  19. #endif
  20. /****************************************************
  21. * Enumeration definition
  22. ****************************************************//**
  23. * @addtogroup EnumDef Enumeration definition
  24. * @{
  25. ********************************************************/
  26. /**
  27. * @brief Enumeration of search field.<br>
  28. */
  29. typedef enum
  30. {
  31. AL_NET_SEARCHFIELD_NETID = 1 << 1,
  32. } AL_Network_ESearchField_t;
  33. /****************************************************
  34. * Structure definition
  35. ****************************************************//**
  36. * @}
  37. * @addtogroup StructDef Structure definition
  38. * @{
  39. ********************************************************/
  40. /**
  41. * @brief Structure for searching network.<br>
  42. */
  43. typedef struct
  44. {
  45. AL_DB_EDBType_t eDBType;
  46. AL_Network_ESearchField_t eSearchField;
  47. al_uint16 u16NetId;
  48. } AL_Network_SearchKey_t;
  49. /****************************************************
  50. * API definition - Internal Operation
  51. ****************************************************//**
  52. * @}
  53. * @addtogroup InterAPI Internal Interface
  54. * @{
  55. ********************************************************/
  56. /**
  57. * @brief Initialize network component.
  58. *
  59. * The implementation may perform appropriate network initialisation when this
  60. * call is made, if required.
  61. *
  62. * @note
  63. * 1.This API must be called before any network-related function is called; <br>
  64. * 2.Must be called once successfully, and still return success when called again.
  65. *
  66. * @param eDBType [in]Select one or more database to initialize network component.
  67. *
  68. * @return
  69. * #AL_SUCCESS indicates success,
  70. * On failure, #AL_FAILURE is returned.
  71. */
  72. AL_Return_t AI_Network_Init(
  73. AL_DB_EDBType_t eDBType);
  74. /**
  75. * @brief Terminate network commponent.
  76. *
  77. * The implementation may perform appropriate network termination when this
  78. * call is made, if required.
  79. *
  80. * @note
  81. * 1.This API must be called after any network-related function is called; <br>
  82. * 2.Must be called once successfully, and still return success when called again.
  83. *
  84. * @param eDBType [in]Select one or more database to terminate network component.
  85. *
  86. * @return
  87. * #AL_SUCCESS indicates success,
  88. * On failure, #AL_FAILURE is returned.
  89. */
  90. AL_Return_t AI_Network_Term(
  91. AL_DB_EDBType_t eDBType);
  92. /****************************************************
  93. * API definition - Network Operation
  94. ****************************************************//**
  95. * @}
  96. * @addtogroup COMAPI Component APIs
  97. * @{
  98. ********************************************************/
  99. /**
  100. * @brief Match network by specified search field.
  101. *
  102. * @note Refers to the prototype #AL_DB_RecordMatchFunc.
  103. *
  104. * @param param [in]Search key, type: #AL_Network_SearchKey_t.
  105. * @param pRec [in]Network Info.
  106. *
  107. * @return
  108. * #AL_SUCCESS indicates success,
  109. * On failure, #AL_FAILURE is returned.
  110. */
  111. al_bool AL_Network_MatchRecBySearchKey(al_void *param, al_void const*pRec);
  112. /****************************************************//**
  113. * @}
  114. ********************************************************/
  115. #ifdef __cplusplus
  116. }
  117. #endif /* __cplusplus */
  118. #endif /* __AL_NETWORK_H__ */