Commit Diff


commit - e5cdd61fe3d78fa976836192dbca64874160a493
commit + 9f74c0ff075dc67e068b8c2da0c069b6c622e436
blob - c104a75b8fbb8ced91c1e0c4eee50e3a96f2f096
blob + e5c48b750349158f382850a497a5bc8e40e33411
--- src/ngircd/client.h
+++ src/ngircd/client.h
@@ -17,19 +17,20 @@
  * Client management (header)
  */
 
-#define CLIENT_UNKNOWN 1		/* connection of unknown type */
-#define CLIENT_GOTPASS 2		/* client did send PASS */
-#define CLIENT_GOTNICK 4		/* client did send NICK */
-#define CLIENT_GOTUSER 8		/* client did send USER */
-#define CLIENT_USER 16			/* client is an IRC user */
-#define CLIENT_SERVER 32		/* client is a server */
-#define CLIENT_SERVICE 64		/* client is a service */
-#define CLIENT_UNKNOWNSERVER 128	/* unregistered server connection */
-#define CLIENT_GOTPASS_2813 256		/* client did send PASS, RFC 2813 style */
+#define CLIENT_UNKNOWN		0x0001	/* connection of unknown type */
+#define CLIENT_GOTPASS		0x0002	/* client did send PASS */
+#define CLIENT_GOTNICK		0x0004	/* client did send NICK */
+#define CLIENT_GOTUSER		0x0008	/* client did send USER */
+#define CLIENT_USER		0x0010	/* client is an IRC user */
+#define CLIENT_SERVER		0x0020	/* client is a server */
+#define CLIENT_SERVICE		0x0040	/* client is a service */
+#define CLIENT_UNKNOWNSERVER	0x0080	/* unregistered server connection */
+#define CLIENT_GOTPASS_2813	0x0100	/* client did send PASS, RFC 2813 style */
 #ifndef STRICT_RFC
-# define CLIENT_WAITAUTHPING 512	/* waiting for AUTH PONG from client */
+# define CLIENT_WAITAUTHPING	0x0200	/* waiting for AUTH PONG from client */
 #endif
-#define CLIENT_WAITCAPEND 1024		/* waiting for "CAP END" command */
+#define CLIENT_WAITCAPEND	0x0400	/* waiting for "CAP END" command */
+#define CLIENT_ANY		0xFFFF
 
 #define CLIENT_TYPE int
 
blob - e5eaa6ee3ff9ad6771f13668664fe1c3b5b6ead8
blob + 68aa945fa3eb8be1cfb28afcf8832f23ed3772a8
--- src/ngircd/parse.c
+++ src/ngircd/parse.c
@@ -62,11 +62,11 @@ static COMMAND My_Commands[] =
 {
 	{ "ADMIN", IRC_ADMIN, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "AWAY", IRC_AWAY, CLIENT_USER, 0, 0, 0 },
-	{ "CAP", IRC_CAP, 0xFFFF, 0, 0, 0 },
+	{ "CAP", IRC_CAP, CLIENT_ANY, 0, 0, 0 },
 	{ "CONNECT", IRC_CONNECT, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "DIE", IRC_DIE, CLIENT_USER, 0, 0, 0 },
 	{ "DISCONNECT", IRC_DISCONNECT, CLIENT_USER, 0, 0, 0 },
-	{ "ERROR", IRC_ERROR, 0xFFFF, 0, 0, 0 },
+	{ "ERROR", IRC_ERROR, CLIENT_ANY, 0, 0, 0 },
 	{ "GLINE", IRC_xLINE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "HELP", IRC_HELP, CLIENT_USER, 0, 0, 0 },
 	{ "INFO", IRC_INFO, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
@@ -83,20 +83,20 @@ static COMMAND My_Commands[] =
 	{ "MODE", IRC_MODE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "MOTD", IRC_MOTD, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "NAMES", IRC_NAMES, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
-	{ "NICK", IRC_NICK, 0xFFFF, 0, 0, 0 },
+	{ "NICK", IRC_NICK, CLIENT_ANY, 0, 0, 0 },
 	{ "NJOIN", IRC_NJOIN, CLIENT_SERVER, 0, 0, 0 },
-	{ "NOTICE", IRC_NOTICE, 0xFFFF, 0, 0, 0 },
+	{ "NOTICE", IRC_NOTICE, CLIENT_ANY, 0, 0, 0 },
 	{ "OPER", IRC_OPER, CLIENT_USER, 0, 0, 0 },
 	{ "PART", IRC_PART, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
-	{ "PASS", IRC_PASS, 0xFFFF, 0, 0, 0 },
-	{ "PING", IRC_PING, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
-	{ "PONG", IRC_PONG, 0xFFFF, 0, 0, 0 },
+	{ "PASS", IRC_PASS, CLIENT_ANY, 0, 0, 0 },
+	{ "PING", IRC_PING, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
+	{ "PONG", IRC_PONG, CLIENT_ANY, 0, 0, 0 },
 	{ "PRIVMSG", IRC_PRIVMSG, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
-	{ "QUIT", IRC_QUIT, 0xFFFF, 0, 0, 0 },
+	{ "QUIT", IRC_QUIT, CLIENT_ANY, 0, 0, 0 },
 	{ "REHASH", IRC_REHASH, CLIENT_USER, 0, 0, 0 },
 	{ "RESTART", IRC_RESTART, CLIENT_USER, 0, 0, 0 },
-	{ "SERVER", IRC_SERVER, 0xFFFF, 0, 0, 0 },
-	{ "SERVICE", IRC_SERVICE, 0xFFFF, 0, 0, 0 },
+	{ "SERVER", IRC_SERVER, CLIENT_ANY, 0, 0, 0 },
+	{ "SERVICE", IRC_SERVICE, CLIENT_ANY, 0, 0, 0 },
 	{ "SERVLIST", IRC_SERVLIST, CLIENT_USER, 0, 0, 0 },
 	{ "SQUERY", IRC_SQUERY, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "SQUIT", IRC_SQUIT, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
@@ -106,7 +106,7 @@ static COMMAND My_Commands[] =
 	{ "TIME", IRC_TIME, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "TOPIC", IRC_TOPIC, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "TRACE", IRC_TRACE, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
-	{ "USER", IRC_USER, 0xFFFF, 0, 0, 0 },
+	{ "USER", IRC_USER, CLIENT_ANY, 0, 0, 0 },
 	{ "USERHOST", IRC_USERHOST, CLIENT_USER, 0, 0, 0 },
 	{ "USERS", IRC_USERS, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },
 	{ "VERSION", IRC_VERSION, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 },