diff options
Diffstat (limited to 'src/ecommon/ip.c')
-rw-r--r-- | src/ecommon/ip.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ecommon/ip.c b/src/ecommon/ip.c new file mode 100644 index 0000000..eb6d792 --- /dev/null +++ b/src/ecommon/ip.c @@ -0,0 +1,25 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "common/HPMi.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/socket.h" +#include "common/strlib.h" + +#include "ecommon/ip.h" + +bool checkAllowedIp(const char* const mask, const char* const ip) +{ + char buf[1000]; + + strcpy(buf, ","); + strcat(buf, ip); + strcat(buf, ","); + + return strstr(mask, buf) != NULL; +} |