ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/server.h
(Generate patch)

Comparing ircd-hybrid-8/include/s_serv.h (file contents):
Revision 1301 by michael, Sat Mar 10 21:47:17 2012 UTC vs.
Revision 1302 by michael, Wed Mar 21 17:48:54 2012 UTC

# Line 26 | Line 26
26   #define INCLUDED_serv_h
27   #include "config.h"
28  
29 /* collect ziplinks compression ratios/etc every minute */
30 #define ZIPSTATS_TIME           60
31
29   struct ConfItem;
30  
31   /*
# Line 59 | Line 56 | struct Capability
56   #define CAP_KLN         0x00000040 /* Can do KLINE message                */
57   #define CAP_GLN         0x00000080 /* Can do GLINE message                */
58   #define CAP_TS6         0x00000100 /* Can do TS6                          */
59 < #define CAP_ZIP         0x00000200 /* Can do ZIPlinks                     */
60 < #define CAP_ENC         0x00000400 /* Can do ENCrypted links              */
59 > #define __CAP_UNUSED__  0x00000200 /* UNUSED                              */
60 > #define __CAP_UNUSED___ 0x00000400 /* UNUSED                              */
61   #define CAP_KNOCK       0x00000800 /* supports KNOCK                      */
62   #define CAP_TB          0x00001000 /* supports TB                         */
63   #define CAP_UNKLN       0x00002000 /* Can do UNKLINE message              */
# Line 72 | Line 69 | struct Capability
69   #define CAP_DLN         0x00080000 /* Can do DLINE message                */
70   #define CAP_UNDLN       0x00100000 /* Can do UNDLINE message               */
71  
75 #ifdef HAVE_LIBZ
76 #define CAP_ZIP_SUPPORTED CAP_ZIP
77 #else
78 #define CAP_ZIP_SUPPORTED 0
79 #endif
80
81 #ifdef HAVE_LIBCRYPTO
82 struct EncCapability
83 {
84  const char *name; /* name of capability (cipher name)          */
85  unsigned int cap; /* mask value                                */
86  int keylen;       /* keylength (bytes)                         */
87  int cipherid;     /* ID number of cipher type (BF, IDEA, etc.) */
88 };
89
90 /*
91 * Cipher ID numbers
92 *   - DO NOT CHANGE THESE!  Otherwise you break backwards compatibility
93 *     If you wish to add a new cipher, append it to the list.  Do not
94 *     have it's value replace another.
95 */
96 #define CIPHER_BF       1
97 #define CIPHER_CAST     2
98 #define CIPHER_DES      3
99 #define CIPHER_3DES     4
100 #define CIPHER_IDEA     5
101 #define CIPHER_RC5_8    6
102 #define CIPHER_RC5_12   7
103 #define CIPHER_RC5_16   8
104
105 /* Cipher Capabilities */
106 #define CAP_ENC_BF_128          0x00000001
107 #define CAP_ENC_BF_168          0x00000002
108 #define CAP_ENC_CAST_128        0x00000004
109 #define CAP_ENC_DES_56          0x00000008
110 #define CAP_ENC_3DES_168        0x00000010
111 #define CAP_ENC_IDEA_128        0x00000020
112 #define CAP_ENC_RC5_8_128       0x00000040
113 #define CAP_ENC_RC5_12_128      0x00000080
114 #define CAP_ENC_RC5_16_128      0x00000100
115 #define CAP_ENC_ALL             0xFFFFFFFF
116
117
118 /* */
119 #ifdef HAVE_EVP_BF_CFB
120 #define USE_CIPHER_BF       1
121 /* Check for bug handling variable length blowfish keys */
122 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x00000000L
123 #define USE_CIPHER_BF_V     1
124 #else
125 #define USE_CIPHER_BF_V     0
126 #endif
127 #else
128 #define USE_CIPHER_BF_V     0
129 #define USE_CIPHER_BF       0
130 #endif
131 /* Cast */
132 #ifdef HAVE_EVP_CAST5_CFB
133 #define USE_CIPHER_CAST     1
134 #else
135 #define USE_CIPHER_CAST     0
136 #endif
137 /* DES */
138 #ifdef HAVE_EVP_DES_CFB
139 #define USE_CIPHER_DES      1
140 #else
141 #define USE_CIPHER_DES      0
142 #endif
143 /* 3DES */
144 #ifdef HAVE_EVP_DES_EDE3_CFB
145 #define USE_CIPHER_3DES     1
146 #else
147 #define USE_CIPHER_3DES     0
148 #endif
149 /* IDEA */
150 #ifdef HAVE_EVP_IDEA_CFB
151 #define USE_CIPHER_IDEA     1
152 #else
153 #define USE_CIPHER_IDEA     0
154 #endif
155 /* RC5 */
156 #ifdef HAVE_EVP_RC5_32_12_16_CFB
157 #define USE_CIPHER_RC5      1
158 #else
159 #define USE_CIPHER_RC5      0
160 #endif
161
162 /* Only enable ciphers supported by available version of OpenSSL */
163 #define CAP_ENC_MASK \
164             (((USE_CIPHER_BF   * CAP_ENC_ALL) & CAP_ENC_BF_128)         | \
165              ((USE_CIPHER_BF_V * CAP_ENC_ALL) & CAP_ENC_BF_168)         | \
166              ((USE_CIPHER_CAST * CAP_ENC_ALL) & CAP_ENC_CAST_128)       | \
167              ((USE_CIPHER_DES  * CAP_ENC_ALL) & CAP_ENC_DES_56)         | \
168              ((USE_CIPHER_3DES * CAP_ENC_ALL) & CAP_ENC_3DES_168)       | \
169              ((USE_CIPHER_IDEA * CAP_ENC_ALL) & CAP_ENC_IDEA_128)       | \
170              ((USE_CIPHER_RC5  * CAP_ENC_ALL) & CAP_ENC_RC5_8_128)      | \
171              ((USE_CIPHER_RC5  * CAP_ENC_ALL) & CAP_ENC_RC5_12_128)     | \
172              ((USE_CIPHER_RC5  * CAP_ENC_ALL) & CAP_ENC_RC5_16_128))
173
174 #define IsCapableEnc(x, cap)    ((x)->localClient->enc_caps &   (cap))
175 #define SetCapableEnc(x, cap)   ((x)->localClient->enc_caps |=  (cap))
176 #define ClearCapEnc(x, cap)     ((x)->localClient->enc_caps &= ~(cap))
177 #endif /* HAVE_LIBCRYPTO */
178
179 #define CHECK_SERVER_CRYPTLINK    1
180 #define CHECK_SERVER_NOCRYPTLINK  0
181
72   /*
73   * Capability macros.
74   */
# Line 186 | Line 76 | struct EncCapability
76   #define SetCapable(x, cap)      ((x)->localClient->caps |=  (cap))
77   #define ClearCap(x, cap)        ((x)->localClient->caps &= ~(cap))
78  
189 #define SLINKCMD_SET_ZIP_OUT_LEVEL           1       /* data */
190 #define SLINKCMD_START_ZIP_OUT               2
191 #define SLINKCMD_START_ZIP_IN                3
192 #define SLINKCMD_SET_CRYPT_IN_CIPHER         4       /* data */
193 #define SLINKCMD_SET_CRYPT_IN_KEY            5       /* data */
194 #define SLINKCMD_START_CRYPT_IN              6
195 #define SLINKCMD_SET_CRYPT_OUT_CIPHER        7       /* data */
196 #define SLINKCMD_SET_CRYPT_OUT_KEY           8       /* data */
197 #define SLINKCMD_START_CRYPT_OUT             9
198 #define SLINKCMD_INJECT_RECVQ                10      /* data */
199 #define SLINKCMD_INJECT_SENDQ                11      /* data */
200 #define SLINKCMD_INIT                        12
201 #define SLINKCMD_ZIPSTATS                    13
202
203 #define SLINKRPL_FLAG_DATA      0x0001  /* reply has data following */
204 #define SLINKRPL_ERROR          1
205 #define SLINKRPL_ZIPSTATS       2
206
207 typedef void SlinkRplHnd(unsigned int replyid, unsigned int datalen,
208                         unsigned char *data, struct Client *client_p);
209 struct SlinkRplDef
210 {
211  unsigned int replyid;
212  SlinkRplHnd *handler;
213  unsigned int flags;
214 };
215
216 extern struct SlinkRplDef slinkrpltab[];
217
79   /*
80   * Globals
81   *
# Line 224 | Line 85 | extern struct SlinkRplDef slinkrpltab[];
85   * extra argument to "PASS" takes care of checking that.  -orabidoo
86   */
87   extern struct Capability captab[];
227 #ifdef HAVE_LIBCRYPTO
228 extern struct EncCapability CipherTable[];
229 #endif
88  
89   /*
90   * return values for hunt_server()
# Line 236 | Line 94 | extern struct EncCapability CipherTable[
94   #define HUNTED_PASS     1       /* if message passed onwards successfully */
95  
96   extern int valid_servname(const char *);
97 < extern int check_server(const char *, struct Client *, int);
97 > extern int check_server(const char *, struct Client *);
98   extern int hunt_server(struct Client *, struct Client *,
99                         const char *, int, int, char **);
100   extern void add_capability(const char *, int, int);
101   extern int delete_capability(const char *);
102   extern int find_capability(const char *);
103 < extern void send_capabilities(struct Client *, struct AccessItem *, int, int);
103 > extern void send_capabilities(struct Client *, struct AccessItem *, int);
104   extern void write_links_file(void *);
105   extern void server_estab(struct Client *);
106   extern const char *show_capabilities(struct Client *);
107   extern void try_connections(void *);
250 extern void collect_zipstats(void *);
108   extern void burst_channel(struct Client *client_p, struct Channel *);
109   extern void sendnick_TS(struct Client *, struct Client *);
110   extern int serv_connect(struct AccessItem *, struct Client *);
111   extern struct Client *find_servconn_in_progress(const char *);
255 extern void cryptlink_init(struct Client *, struct ConfItem *, fde_t *);
256 extern void cryptlink_regen_key(void *);
257 extern void cryptlink_error(struct Client *, const char *,
258                            const char *, const char *);
259 extern struct EncCapability *check_cipher(struct Client *, struct AccessItem *);
112   extern struct Server *make_server(struct Client *);
261
262 /* XXX don't belong in the now gone md5, but do these belong in s_serv.c ? */
263 extern int base64_block(unsigned char **, char *, int);
264 extern int unbase64_block(unsigned char **, char *, int);
113   #endif /* INCLUDED_s_serv_h */
266

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)