• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

oga's tools


Commit MetaInfo

修訂8ba463f2beffb044d026eced36626c8ed2596fe2 (tree)
時間2014-01-12 09:24:21
作者oga <hyperoga@gmai...>
Commiteroga

Log Message

14/01/12 V0.30 check CIDR

Change Summary

差異

--- a/class.c
+++ b/class.c
@@ -1,8 +1,9 @@
11 /*
22 * class : IP アドレスクラスチェック
33 *
4- * 97/09/09 by oga
5- * 13/12/08 support private check
4+ * 97/09/09 V0.10 by oga
5+ * 13/12/08 V0.20 support private check
6+ * 14/01/12 V0.30 check CIDR
67 */
78 #include <stdio.h>
89 #include <stdlib.h>
@@ -18,6 +19,7 @@
1819 #define CHECK_C 0xc0
1920
2021 #define PRIVATE "(private)"
22+#define CIDR "(CIDR)" /* V0.30-A */
2123
2224
2325 main(a,b)
@@ -51,7 +53,12 @@ char *b[];
5153 }
5254 if ((ad & CLASS_C) == CHECK_C) {
5355 if (ad == 192 && ad2 == 168) private = PRIVATE;
56+ if (ad >= 194 && ad <= 207) private = CIDR; /* V0.30-A */
5457 printf("%s is class C address %s\n", b[1], private);
5558 }
5659 return 0;
5760 }
61+
62+/* vim:ts=4:sw=4:
63+ */
64+