Skip to content

Commit

Permalink
[SQUASH ME] added doxy and adjusted linewidths
Browse files Browse the repository at this point in the history
  • Loading branch information
BytesGalore authored and BytesGalore committed Jan 19, 2015
1 parent f34e098 commit e7b924f
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 127 deletions.
34 changes: 17 additions & 17 deletions sys/net/include/fib/fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,16 @@ extern "C" {
* @brief RRP message content to mangle pointer and size to the address
*/
typedef struct rrp_address_msg_t {
uint8_t* address; /**< The pointer to the address */
uint8_t *address; /**< The pointer to the address */
uint8_t address_size; /**< The address size */
}rrp_address_msg_t;
} rrp_address_msg_t;

/**
* @brief message type used for notifying the RRPs
*/
#define FIB_MSG_RRP_SIGNAL (0x99)
#define FIB_MSG_RRP_SIGNAL (0x99) /**< message type for RRP notifications */

#define FIB_SUCCESS (0)
#define FIB_ERROR (-1)
#define FIB_ERROR_DESTINATION_UNREACHABLE (-2)
#define FIB_ERROR_INSUFICCIENT_OUT_SIZE (-3)
#define FIB_SUCCESS (0) /**< return value for success */
#define FIB_ERROR (-1) /**< error value for generic failure */
#define FIB_ERROR_DESTINATION_UNREACHABLE (-2) /**< error value indicating unreachable dest. */
#define FIB_ERROR_INSUFICCIENT_OUT_SIZE (-3) /**< error value for invalid output buffer size */

/**
* @brief initializes the datastructure for the entries
Expand All @@ -55,7 +52,7 @@ void fib_deinit(void);
/**
* @brief Registration of reactive routing protocol handler function
*/
void fib_register_rrp( void );
void fib_register_rrp(void);

/**
* @brief Adds a new entry in the corresponding FIB table for global destination and next hop
Expand All @@ -70,7 +67,8 @@ void fib_register_rrp( void );
* @return FIB_SUCCESS on success
* FIB_ERROR if the entry cannot be created due to unsufficient RAM
*/
int fib_table_add_entry( kernel_pid_t iface_id, uint8_t* glob_dst, size_t glob_dst_size, uint8_t* next_hop, size_t next_hop_size, uint32_t lifetime );
int fib_table_add_entry(kernel_pid_t iface_id, uint8_t *glob_dst, size_t glob_dst_size,
uint8_t *next_hop, size_t next_hop_size, uint32_t lifetime);

/**
* @brief Updates an entry in the corresponding FIB table for global destination and next hop
Expand All @@ -85,15 +83,16 @@ int fib_table_add_entry( kernel_pid_t iface_id, uint8_t* glob_dst, size_t glob_d
* @return FIB_SUCCESS on success
* FIB_ERROR if the entry cannot be updated due to unsufficient RAM
*/
int fib_table_upd_entry( kernel_pid_t iface_id, uint8_t* glob_dst, size_t glob_dst_size, uint8_t* next_hop, size_t next_hop_size, uint32_t lifetime );
int fib_table_upd_entry(kernel_pid_t iface_id, uint8_t *glob_dst, size_t glob_dst_size,
uint8_t *next_hop, size_t next_hop_size, uint32_t lifetime);

/**
* @brief removes an entry from the corresponding FIB table
*
* @param[in] glob_dst the destination address
* @param[in] glob_dst_size the destination address size
*/
void fib_table_rem_entry( uint8_t* glob_dst, size_t glob_dst_size );
void fib_table_rem_entry(uint8_t *glob_dst, size_t glob_dst_size);

/**
* @brief provides a next hop for a given destination
Expand All @@ -110,18 +109,19 @@ void fib_table_rem_entry( uint8_t* glob_dst, size_t glob_dst_size );
* all RRPs are notified before the return
* FIB_ERROR_INSUFICCIENT_OUT_SIZE if the size for the next hop address is insufficient low
*/
int fib_get_next_hop( uint8_t* glob_dst, size_t glob_dst_size, kernel_pid_t* iface_id, uint8_t* next_hop, size_t* next_hop_size );
int fib_get_next_hop(uint8_t *glob_dst, size_t glob_dst_size, kernel_pid_t *iface_id,
uint8_t *next_hop, size_t *next_hop_size);

/**
* @brief Prints the kernel_pid_t for all registered RRPs
*/
void fib_print_notify_rrp( void );
void fib_print_notify_rrp(void);

/**
* @brief Prints the content of all FIB tables
* does not print the entries
*/
void fib_print_fib_table( void );
void fib_print_fib_table(void);

#ifdef __cplusplus
}
Expand Down
23 changes: 16 additions & 7 deletions sys/net/include/fib/fib_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,23 @@
extern "C" {
#endif

/**
* @brief Container descriptor for a FIB entry
*/
typedef struct fib_entry_t {
kernel_pid_t iface_id; /**< interface ID */
uint32_t lifetime; /**< Lifetime of this entry in ms */
uint8_t global_type; /**< Unique identifier for the type of the global address */
struct universal_address_container_t* global; /**< Pointer to the shared generic address */
uint8_t next_hop_type; /**< Unique identifier for the type of the next hop address */
struct universal_address_container_t* next_hop; /**< Pointer to the shared generic address */
}fib_entry_t;
/** interface ID */
kernel_pid_t iface_id;
/** Lifetime of this entry in ms */
uint32_t lifetime;
/** Unique identifier for the type of the global address */
uint8_t global_type;
/** Pointer to the shared generic address */
struct universal_address_container_t *global;
/** Unique identifier for the type of the next hop address */
uint8_t next_hop_type;
/**< Pointer to the shared generic address */
struct universal_address_container_t *next_hop;
} fib_entry_t;

#ifdef __cplusplus
}
Expand Down
10 changes: 6 additions & 4 deletions sys/net/include/fib/universal_address.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
extern "C" {
#endif

#define UNIVERSAL_ADDRESS_SUCCESS (0)
#define UNIVERSAL_ADDRESS_ERROR_MEMORY (-1)
#define UNIVERSAL_ADDRESS_SUCCESS (0) /**< return value for success */
#define UNIVERSAL_ADDRESS_ERROR_MEMORY (-1) /**< error value for invalid output buffer size */

/**
* @brief The container descriptor used to identify a generic address entry
Expand Down Expand Up @@ -77,7 +77,8 @@ void universal_address_rem(universal_address_container_t *entry);
* @return UNIVERSAL_ADDRESS_SUCCESS if the address is copied to the addr destination
* UNIVERSAL_ADDRESS_ERROR_MEMORY if the size is unsufficient for copy
*/
int universal_address_get_address(universal_address_container_t *entry, uint8_t *addr, size_t *addr_size);
int universal_address_get_address(universal_address_container_t *entry,
uint8_t *addr, size_t *addr_size);

/**
* @brief determines if the entry equals the provided address
Expand All @@ -88,7 +89,8 @@ int universal_address_get_address(universal_address_container_t *entry, uint8_t
*
* @return 0 if the entries are equal
*/
int universal_address_compare(universal_address_container_t *entry, uint8_t *addr, size_t addr_size);
int universal_address_compare(universal_address_container_t *entry,
uint8_t *addr, size_t addr_size);

/**
* @brief Prints the content of the given entry
Expand Down
Loading

0 comments on commit e7b924f

Please sign in to comment.