diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-01 17:42:35 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-01 17:42:35 +0800 |
commit | 31990741fbf7dec987b8319cad65ff942dd4b957 (patch) | |
tree | 1bb5fc936192e295f85d21574d571aba3e350521 /mbbsd/stuff.c | |
parent | cd668ff9ddda02018617afa7979023984d0ba42b (diff) | |
download | pttbbs-31990741fbf7dec987b8319cad65ff942dd4b957.tar pttbbs-31990741fbf7dec987b8319cad65ff942dd4b957.tar.gz pttbbs-31990741fbf7dec987b8319cad65ff942dd4b957.tar.bz2 pttbbs-31990741fbf7dec987b8319cad65ff942dd4b957.tar.lz pttbbs-31990741fbf7dec987b8319cad65ff942dd4b957.tar.xz pttbbs-31990741fbf7dec987b8319cad65ff942dd4b957.tar.zst pttbbs-31990741fbf7dec987b8319cad65ff942dd4b957.zip |
ip/maskvictor.screen
git-svn-id: http://opensvn.csie.org/pttbbs/branches/victor.screen@2041 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r-- | mbbsd/stuff.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 8e6bc461..9f00435f 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -317,6 +317,22 @@ belong(char *filelist, char *key) return rc; } +unsigned int +ipstr2int(char *ip) +{ + unsigned int i, val = 0; + char *p = strtok(ip, "."); + val = atoi(p); + for (i = 0; i < 3; i++) { + p = strtok(NULL, "."); + val *= 256; + if (p == NULL) + continue; + val += atoi(p); + } + return val; +} + #ifndef _BBS_UTIL_C_ /* getdata_buf */ time_t gettime(int line, time_t dt, char*head) |