Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doxygen style comments to all common ebpf headers #58

Merged
merged 12 commits into from
Apr 23, 2021
Prev Previous commit
Next Next commit
Add doxygen to ebpf_maps.h
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
  • Loading branch information
Alan-Jowett committed Apr 23, 2021
commit 6449bddb35f934ac74b31b268f707dcb8272ae37
44 changes: 44 additions & 0 deletions src/ebpf/include/ebpf_maps.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,65 @@ extern "C"

typedef struct _ebpf_core_map ebpf_map_t;

/**
* @brief Allocate a new map.
*
* @param[in] ebpf_map_definition Definition of the new map.
* @param[out] map Pointer to memory that will contain the map on success.
* @retval EBPF_ERROR_OUT_OF_RESOURCES Unable to allocate resources for this
* map.
*/
ebpf_error_code_t
ebpf_map_create(const ebpf_map_definition_t* ebpf_map_definition, ebpf_map_t** map);

/**
* @brief Get a pointer to the map definition.
*
* @param[in] map Map to get definition from.
* @return ebpf_map_definition_t* Pointer to map definition.
*/
ebpf_map_definition_t*
ebpf_map_get_definition(ebpf_map_t* map);

/**
* @brief Get a pointer to an entry in the map.
*
* @param[in] map Map to search.
* @param[in] key Key to use when searching map.
* @return uint8_t* Pointer to the value if found or NULL.
*/
uint8_t*
ebpf_map_lookup_entry(ebpf_map_t* map, const uint8_t* key);

/**
* @brief Insert or update an entry in the map.
*
* @param[in] map Map to update.
* @param[in] key Key to use when searching and updating the map.
* @param[in] value Value to insert into the map.
* @retval EBPF_ERROR_OUT_OF_RESOURCES Unable to allocate resources for this
* entry.
*/
ebpf_error_code_t
ebpf_map_update_entry(ebpf_map_t* map, const uint8_t* key, const uint8_t* value);

/**
* @brief Remove an entry from the map.
*
* @param[in] map Map to update.
* @param[in] key Key to use when searching and updating the map.
*/
ebpf_error_code_t
ebpf_map_delete_entry(ebpf_map_t* map, const uint8_t* key);

/**
* @brief Retrieve the next key from the map.
*
* @param map Map to search.
* @param previous_key Previous key or NULL.
* @param next_key Next key on success.
* @retval EBPF_ERROR_NO_MORE_KEYS Previous key is the last key in the map.
*/
ebpf_error_code_t
ebpf_map_next_key(ebpf_map_t* map, const uint8_t* previous_key, uint8_t* next_key);

Expand Down