Skip to content
Snippets Groups Projects
Commit 63d762f1 authored by Adam Wujek's avatar Adam Wujek :speech_balloon:
Browse files

userspace/libwr: add rtu type helpers


Add a function to verify rtu type and to convert type to string.

Signed-off-by: default avatarAdam Wujek <adam.wujek@cern.ch>
parent ccb27399
Branches
Tags
No related merge requests found
......@@ -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
*/
......
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