summaryrefslogtreecommitdiffstats
path: root/mbbsd/stuff.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-09-03 15:16:41 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-09-03 15:16:41 +0800
commite28f24a0c49768114d42cefa33ff79235b937d48 (patch)
tree64debb3969bccc0e35a0486651eed5dc141903a9 /mbbsd/stuff.c
parent478ea9614468014b20f9c5d500f7b802c10f9f78 (diff)
downloadpttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar
pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.gz
pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.bz2
pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.lz
pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.xz
pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.zst
pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.zip
domain_name_query is changed to cidr format
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2176 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r--mbbsd/stuff.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index 8d70566d..d35be51b 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -317,6 +317,26 @@ belong(char *filelist, char *key)
return rc;
}
+unsigned int
+ipstr2int(char *ip)
+{
+ unsigned int i, val = 0;
+ char buf[32];
+ char *nil, *p;
+ strcpy(buf, ip);
+ p = buf;
+ for (i = 0; i < 4; i++) {
+ nil = strchr(p, '.');
+ if (nil != NULL)
+ *nil = 0;
+ val *= 256;
+ val += atoi(p);
+ if (nil != NULL)
+ p = nil + 1;
+ }
+ return val;
+}
+
#ifndef _BBS_UTIL_C_ /* getdata_buf */
time_t
gettime(int line, time_t dt, char*head)