1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #3492 from BytesGalore/fib_changed_prefix_size_name

fib: changed misleading parameter name and documentation
This commit is contained in:
Lotte Steenbrink 2015-07-30 23:31:32 +02:00
commit 02f502ddab
2 changed files with 7 additions and 6 deletions

View File

@ -70,14 +70,15 @@ void fib_deinit(void);
/** /**
* @brief Registration of a routing protocol handler function * @brief Registration of a routing protocol handler function
* *
* @param[in] prefix the prefix handled by the according RP * @param[in] prefix the prefix handled by the according RP
* @param[in] prefix_size the prefix size * @param[in] prefix_addr_type_size the size of the address type used for the prefix
*
* @return 0 on success * @return 0 on success
* -ENOMEM if the entry cannot be registered (mximum registrations reached) * -ENOMEM if the entry cannot be registered (mximum registrations reached)
* -EINVAL if the prefix is NULL or the provided size is 0 * -EINVAL if the prefix is NULL or the provided size is 0
* *
*/ */
int fib_register_rp(uint8_t *prefix, size_t prefix_size); int fib_register_rp(uint8_t *prefix, size_t prefix_addr_type_size);
/** /**
* @brief Adds a new entry in the corresponding FIB table for global destination and next hop * @brief Adds a new entry in the corresponding FIB table for global destination and next hop

View File

@ -550,7 +550,7 @@ void fib_deinit(void)
mutex_unlock(&mtx_access); mutex_unlock(&mtx_access);
} }
int fib_register_rp(uint8_t *prefix, size_t prefix_size) int fib_register_rp(uint8_t *prefix, size_t prefix_addr_type_size)
{ {
mutex_lock(&mtx_access); mutex_lock(&mtx_access);
@ -559,14 +559,14 @@ int fib_register_rp(uint8_t *prefix, size_t prefix_size)
return -ENOMEM; return -ENOMEM;
} }
if ((prefix == NULL) || (prefix_size == 0)) { if ((prefix == NULL) || (prefix_addr_type_size == 0)) {
mutex_unlock(&mtx_access); mutex_unlock(&mtx_access);
return -EINVAL; return -EINVAL;
} }
if (notify_rp_pos < FIB_MAX_REGISTERED_RP) { if (notify_rp_pos < FIB_MAX_REGISTERED_RP) {
notify_rp[notify_rp_pos] = sched_active_pid; notify_rp[notify_rp_pos] = sched_active_pid;
universal_address_container_t *container = universal_address_add(prefix, prefix_size); universal_address_container_t *container = universal_address_add(prefix, prefix_addr_type_size);
prefix_rp[notify_rp_pos] = container; prefix_rp[notify_rp_pos] = container;
notify_rp_pos++; notify_rp_pos++;
} }