updates.
[silc.git] / apps / silcd / command.c
index ee6aa9ba50206fe2c6fdc693297f9a4cc2d5da5b..06e5b96d7717fed78c6d947714f6f5bb70300415 100644 (file)
@@ -29,11 +29,11 @@ static int silc_server_is_registered(SilcServer server,
 static void 
 silc_server_command_send_status_reply(SilcServerCommandContext cmd,
                                      SilcCommand command,
-                                     SilcCommandStatus status);
+                                     SilcStatus status);
 static void 
 silc_server_command_send_status_data(SilcServerCommandContext cmd,
                                     SilcCommand command,
-                                    SilcCommandStatus status,
+                                    SilcStatus status,
                                     SilcUInt32 arg_type,
                                     const unsigned char *arg,
                                     SilcUInt32 arg_len);
@@ -389,7 +389,7 @@ silc_server_command_pending_check(SilcServer server,
 static void 
 silc_server_command_send_status_reply(SilcServerCommandContext cmd,
                                      SilcCommand command,
-                                     SilcCommandStatus status)
+                                     SilcStatus status)
 {
   SilcBuffer buffer;
 
@@ -411,7 +411,7 @@ silc_server_command_send_status_reply(SilcServerCommandContext cmd,
 static void 
 silc_server_command_send_status_data(SilcServerCommandContext cmd,
                                     SilcCommand command,
-                                    SilcCommandStatus status,
+                                    SilcStatus status,
                                     SilcUInt32 arg_type,
                                     const unsigned char *arg,
                                     SilcUInt32 arg_len)
@@ -533,10 +533,11 @@ silc_server_command_whois_parse(SilcServerCommandContext cmd,
 
   /* Get the max count of reply messages allowed */
   tmp = silc_argument_get_arg_type(cmd->args, 2, NULL);
-  if (tmp)
-    *count = atoi(tmp);
-  else
+  if (tmp) {
+    SILC_GET32_MSB(*count, tmp);
+  } else {
     *count = 0;
+  }
 
   return TRUE;
 }
@@ -703,7 +704,7 @@ silc_server_command_whois_send_reply(SilcServerCommandContext cmd,
   int i, k, len, valid_count;
   SilcBuffer packet, idp, channels, umode_list = NULL;
   SilcClientEntry entry;
-  SilcCommandStatus status;
+  SilcStatus status;
   SilcUInt16 ident = silc_command_get_ident(cmd->payload);
   char nh[256], uh[256];
   unsigned char idle[4], mode[4];
@@ -1033,10 +1034,11 @@ silc_server_command_whowas_parse(SilcServerCommandContext cmd,
 
   /* Get the max count of reply messages allowed */
   tmp = silc_argument_get_arg_type(cmd->args, 2, NULL);
-  if (tmp)
-    *count = atoi(tmp);
-  else
+  if (tmp) {
+    SILC_GET32_MSB(*count, tmp);
+  } else {
     *count = 0;
+  }
 
   return TRUE;
 }
@@ -1095,7 +1097,7 @@ silc_server_command_whowas_send_reply(SilcServerCommandContext cmd,
   int i, k, count = 0, len;
   SilcBuffer packet, idp;
   SilcClientEntry entry = NULL;
-  SilcCommandStatus status;
+  SilcStatus status;
   SilcUInt16 ident = silc_command_get_ident(cmd->payload);
   char nh[256], uh[256];
   int valid_count;
@@ -1587,10 +1589,11 @@ silc_server_command_identify_parse(SilcServerCommandContext cmd,
   
   /* Get the max count of reply messages allowed */
   tmp = silc_argument_get_arg_type(cmd->args, 4, NULL);
-  if (tmp)
-    *count = atoi(tmp);
-  else
+  if (tmp) {
+    SILC_GET32_MSB(*count, tmp);
+  } else {
     *count = 0;
+  }
 
   return 1;
 }
@@ -1749,7 +1752,7 @@ silc_server_command_identify_send_reply(SilcServerCommandContext cmd,
   SilcServer server = cmd->server;
   int i, k, len, valid_count;
   SilcBuffer packet, idp;
-  SilcCommandStatus status;
+  SilcStatus status;
   SilcUInt16 ident = silc_command_get_ident(cmd->payload);
   char nh[256], uh[256];
   SilcSocketConnection hsock;
@@ -2100,7 +2103,7 @@ silc_server_command_list_send_reply(SilcServerCommandContext cmd,
   int i, k;
   SilcBuffer packet, idp;
   SilcChannelEntry entry;
-  SilcCommandStatus status;
+  SilcStatus status;
   SilcUInt16 ident = silc_command_get_ident(cmd->payload);
   char *topic;
   unsigned char usercount[4];