The SILC Project

source navigation ]
identifier search ]
freetext search ]
file search ]

silc/lib/silccore/silcstatus.h

  1 /*
  2 
  3   silcstatus.h
  4 
  5   Author: Pekka Riikonen <priikone@silcnet.org>
  6 
  7   Copyright (C) 2002 - 2007 Pekka Riikonen
  8 
  9   This program is free software; you can redistribute it and/or modify
 10   it under the terms of the GNU General Public License as published by
 11   the Free Software Foundation; version 2 of the License.
 12 
 13   This program is distributed in the hope that it will be useful,
 14   but WITHOUT ANY WARRANTY; without even the implied warranty of
 15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16   GNU General Public License for more details.
 17 
 18 */
 19 
 20 /****h* silccore/SILC Status Types
 21  *
 22  * DESCRIPTION
 23  *
 24  * This header includes the SILC Status Types that are used with
 25  * command replies and with notify packets.  With command reply packets
 26  * they indicate whether error occurred during procesing of the command
 27  * and indicate the error type.  With notify type they always indicate
 28  * which error occurred.  Both command reply and notify type share the
 29  * same status types.
 30  *
 31  ***/
 32 
 33 #ifndef SILCSTATUS_H
 34 #define SILCSTATUS_H
 35 
 36 /****d* silccore/StatusTypes/SilcStatus
 37  *
 38  * NAME
 39  *
 40  *    typedef SilcUInt8 SilcStatus
 41  *
 42  * DESCRIPTION
 43  *
 44  *    The SilcStatus type definition and the status defines.  The
 45  *    server returns a status in each Command Payload indicating
 46  *    the status of the command.  The server can also return this
 47  *    inside SILC_NOTIFY_TYPE_ERROR notify type.
 48  *
 49  * SOURCE
 50  */
 51 typedef SilcUInt8 SilcStatus;
 52 
 53 /* Command Status messages */
 54 #define SILC_STATUS_OK                      0
 55 #define SILC_STATUS_LIST_START              1
 56 #define SILC_STATUS_LIST_ITEM               2
 57 #define SILC_STATUS_LIST_END                3
 58 #define SILC_STATUS_ERR_NO_SUCH_NICK        10
 59 #define SILC_STATUS_ERR_NO_SUCH_CHANNEL     11
 60 #define SILC_STATUS_ERR_NO_SUCH_SERVER      12
 61 #define SILC_STATUS_ERR_INCOMPLETE_INFORMATION    13
 62 #define SILC_STATUS_ERR_NO_RECIPIENT        14
 63 #define SILC_STATUS_ERR_UNKNOWN_COMMAND     15
 64 #define SILC_STATUS_ERR_WILDCARDS           16
 65 #define SILC_STATUS_ERR_NO_CLIENT_ID        17
 66 #define SILC_STATUS_ERR_NO_CHANNEL_ID       18
 67 #define SILC_STATUS_ERR_NO_SERVER_ID        19
 68 #define SILC_STATUS_ERR_BAD_CLIENT_ID       20
 69 #define SILC_STATUS_ERR_BAD_CHANNEL_ID      21
 70 #define SILC_STATUS_ERR_NO_SUCH_CLIENT_ID   22
 71 #define SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID  23
 72 #define SILC_STATUS_ERR_NICKNAME_IN_USE     24
 73 #define SILC_STATUS_ERR_NOT_ON_CHANNEL      25
 74 #define SILC_STATUS_ERR_USER_NOT_ON_CHANNEL 26
 75 #define SILC_STATUS_ERR_USER_ON_CHANNEL     27
 76 #define SILC_STATUS_ERR_NOT_REGISTERED      28
 77 #define SILC_STATUS_ERR_NOT_ENOUGH_PARAMS   29
 78 #define SILC_STATUS_ERR_TOO_MANY_PARAMS     30
 79 #define SILC_STATUS_ERR_PERM_DENIED         31
 80 #define SILC_STATUS_ERR_BANNED_FROM_SERVER  32
 81 #define SILC_STATUS_ERR_BAD_PASSWORD        33
 82 #define SILC_STATUS_ERR_CHANNEL_IS_FULL     34
 83 #define SILC_STATUS_ERR_NOT_INVITED         35
 84 #define SILC_STATUS_ERR_BANNED_FROM_CHANNEL 36
 85 #define SILC_STATUS_ERR_UNKNOWN_MODE        37
 86 #define SILC_STATUS_ERR_NOT_YOU             38
 87 #define SILC_STATUS_ERR_NO_CHANNEL_PRIV     39
 88 #define SILC_STATUS_ERR_NO_CHANNEL_FOPRIV   40
 89 #define SILC_STATUS_ERR_NO_SERVER_PRIV      41
 90 #define SILC_STATUS_ERR_NO_ROUTER_PRIV      42
 91 #define SILC_STATUS_ERR_BAD_NICKNAME        43
 92 #define SILC_STATUS_ERR_BAD_CHANNEL         44
 93 #define SILC_STATUS_ERR_AUTH_FAILED         45
 94 #define SILC_STATUS_ERR_UNKNOWN_ALGORITHM   46
 95 #define SILC_STATUS_ERR_NO_SUCH_SERVER_ID   47
 96 #define SILC_STATUS_ERR_RESOURCE_LIMIT      48
 97 #define SILC_STATUS_ERR_NO_SUCH_SERVICE     49
 98 #define SILC_STATUS_ERR_NOT_AUTHENTICATED   50
 99 #define SILC_STATUS_ERR_BAD_SERVER_ID       51
100 #define SILC_STATUS_ERR_KEY_EXCHANGE_FAILED 52
101 #define SILC_STATUS_ERR_BAD_VERSION         53
102 #define SILC_STATUS_ERR_TIMEDOUT            54
103 #define SILC_STATUS_ERR_UNSUPPORTED_PUBLIC_KEY    55
104 #define SILC_STATUS_ERR_OPERATION_ALLOWED   56
105 #define SILC_STATUS_ERR_BAD_SERVER          57
106 #define SILC_STATUS_ERR_BAD_USERNAME        58
107 #define SILC_STATUS_ERR_NO_SUCH_PUBLIC_KEY  59
108 /***/
109 
110 #define SILC_STATUS_IS_ERROR(status) (status >= SILC_STATUS_ERR_NO_SUCH_NICK)
111 
112 /****f* silccore/SilcStatusTypes/silc_status_get_args
113  *
114  * SYNOPSIS
115  *
116  *    SilcUInt32 silc_status_get_args(SilcStatus status,
117  *                                    SilcArgumentPayload args,
118  *                                    void **ret_arg1, **ret_arg2);
119  *
120  * DESCRIPTION
121  *
122  *    Parses and returns the arguments from the `args' by the status type
123  *    indicated by `status'.  Returns the number of arguments (0, 1 or 2)
124  *    parsed.  The caller must free with silc_free the returned arguments.
125  *
126  ***/
127 SilcUInt32 silc_status_get_args(SilcStatus status,
128                                 SilcArgumentPayload args,
129                                 void **ret_arg1, void **ret_arg2);
130 
131 
132 #endif /* SILCSTATUS_H */
133 

This page was automatically generated by the LXR engine.
Free-text search provided by Glimpse