impl the search by string

This commit is contained in:
lion 2022-06-27 18:37:31 +08:00
parent f5d0c216c2
commit 080942fc68
1 changed files with 8 additions and 2 deletions

View File

@ -54,8 +54,14 @@ XDB_PUBLIC(int) xdb_search(unsigned int ip, char *buffer) {
return 0;
}
XDB_PUBLIC(int) xdb_search_by_string(const char *ip, char *buffer) {
return 0;
XDB_PUBLIC(int) xdb_search_by_string(const char *str_ip, char *buffer) {
unsigned int ip = 0;
int errcode = check_ip(str_ip, &ip);
if (errcode != 0) {
return 10 + errcode;
} else {
return xdb_search(ip, buffer);
}
}
// get unsigned long (4bytes) from a specified buffer start from the specified offset