Commit 63d762f1 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/libwr: add rtu type helpers

Add a function to verify rtu type and to convert type to string.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent ccb27399
......@@ -25,6 +25,32 @@ struct rtu_addr {
#define RTU_ENTRY_TYPE_DYNAMIC 1
#define RTU_ENTRY_TYPE_STATIC 0
/* helper to verify correctness of a rtu type */
static inline int rtu_check_type(int type)
{
switch (type) {
case RTU_ENTRY_TYPE_DYNAMIC:
case RTU_ENTRY_TYPE_STATIC:
/* type ok */
return 0;
default:
return -1;
}
}
static inline char *rtu_type_to_str(int type)
{
switch (type) {
case RTU_ENTRY_TYPE_DYNAMIC:
return "DYNAMIC";
case RTU_ENTRY_TYPE_STATIC:
return "STATIC";
default:
return "Unknown";
}
}
/**
* \brief RTU Filtering Database Entry Object
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment