ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/core/m_server.c
Revision: 1474
Committed: Sun Jul 22 14:44:07 2012 UTC (14 years, 2 months ago) by michael
Content type: text/x-csrc
Original Path: ircd-hybrid-8/modules/core/m_server.c
File size: 21378 byte(s)
Log Message:
- removed &localchannels

File Contents

# User Rev Content
1 adx 30 /*
2     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3     * m_server.c: Introduces a server.
4     *
5     * Copyright (C) 2002 by the past and present ircd coders, and others.
6     *
7     * This program is free software; you can redistribute it and/or modify
8     * it under the terms of the GNU General Public License as published by
9     * the Free Software Foundation; either version 2 of the License, or
10     * (at your option) any later version.
11     *
12     * This program is distributed in the hope that it will be useful,
13     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     * GNU General Public License for more details.
16     *
17     * You should have received a copy of the GNU General Public License
18     * along with this program; if not, write to the Free Software
19     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20     * USA
21     *
22 knight 31 * $Id$
23 adx 30 */
24    
25     #include "stdinc.h"
26 michael 1011 #include "list.h"
27 adx 30 #include "client.h" /* client struct */
28     #include "event.h"
29     #include "hash.h" /* add_to_client_hash_table */
30     #include "irc_string.h"
31     #include "ircd.h" /* me */
32     #include "numeric.h" /* ERR_xxx */
33 michael 1309 #include "conf.h" /* struct AccessItem */
34     #include "log.h" /* log level defines */
35 michael 1118 #include "s_serv.h" /* server_estab, check_server */
36     #include "s_user.h"
37 adx 30 #include "send.h" /* sendto_one */
38     #include "parse.h"
39     #include "modules.h"
40    
41    
42     static void set_server_gecos(struct Client *, char *);
43    
44     /* mr_server()
45     * parv[0] = sender prefix
46     * parv[1] = servername
47     * parv[2] = serverinfo/hopcount
48     * parv[3] = serverinfo
49     */
50     static void
51     mr_server(struct Client *client_p, struct Client *source_p,
52     int parc, char *parv[])
53     {
54     char info[REALLEN + 1];
55     char *name;
56     struct Client *target_p;
57     int hop;
58    
59 michael 1178 if (EmptyString(parv[3]))
60 adx 30 {
61     sendto_one(client_p, "ERROR :No servername");
62     exit_client(client_p, client_p, "Wrong number of args");
63     return;
64     }
65    
66     name = parv[1];
67     hop = atoi(parv[2]);
68     strlcpy(info, parv[3], sizeof(info));
69    
70 michael 1118 /*
71     * Reject a direct nonTS server connection if we're TS_ONLY -orabidoo
72 adx 30 */
73     if (!DoesTS(client_p))
74     {
75 michael 1118 sendto_realops_flags(UMODE_ALL, L_ADMIN,
76     "Unauthorized server connection attempt from %s: Non-TS server "
77     "for server %s", get_client_name(client_p, HIDE_IP), name);
78     sendto_realops_flags(UMODE_ALL, L_OPER,
79     "Unauthorized server connection attempt from %s: Non-TS server "
80     "for server %s", get_client_name(client_p, MASK_IP), name);
81 adx 30 exit_client(client_p, client_p, "Non-TS server");
82     return;
83     }
84    
85 michael 1118 if (!valid_servname(name))
86 adx 30 {
87 michael 1118 sendto_realops_flags(UMODE_ALL, L_ADMIN,
88     "Unauthorized server connection attempt from %s: Bogus server name "
89     "for server %s", get_client_name(client_p, HIDE_IP), name);
90     sendto_realops_flags(UMODE_ALL, L_OPER,
91     "Unauthorized server connection attempt from %s: Bogus server name "
92     "for server %s", get_client_name(client_p, MASK_IP), name);
93 adx 30 exit_client(client_p, client_p, "Bogus server name");
94     return;
95     }
96    
97     /* Now we just have to call check_server and everything should
98     * be check for us... -A1kmm.
99     */
100 michael 1302 switch (check_server(name, client_p))
101 adx 30 {
102     case -1:
103     if (ConfigFileEntry.warn_no_nline)
104     {
105     sendto_realops_flags(UMODE_ALL, L_ADMIN,
106     "Unauthorized server connection attempt from %s: No entry for "
107     "servername %s", get_client_name(client_p, HIDE_IP), name);
108    
109     sendto_realops_flags(UMODE_ALL, L_OPER,
110     "Unauthorized server connection attempt from %s: No entry for "
111     "servername %s", get_client_name(client_p, MASK_IP), name);
112     }
113    
114     exit_client(client_p, client_p, "Invalid servername.");
115     return;
116     /* NOT REACHED */
117     break;
118    
119     case -2:
120     sendto_realops_flags(UMODE_ALL, L_ADMIN,
121     "Unauthorized server connection attempt from %s: Bad password "
122     "for server %s", get_client_name(client_p, HIDE_IP), name);
123    
124     sendto_realops_flags(UMODE_ALL, L_OPER,
125     "Unauthorized server connection attempt from %s: Bad password "
126     "for server %s", get_client_name(client_p, MASK_IP), name);
127    
128     exit_client(client_p, client_p, "Invalid password.");
129     return;
130     /* NOT REACHED */
131     break;
132    
133     case -3:
134     sendto_realops_flags(UMODE_ALL, L_ADMIN,
135     "Unauthorized server connection attempt from %s: Invalid host "
136     "for server %s", get_client_name(client_p, HIDE_IP), name);
137    
138     sendto_realops_flags(UMODE_ALL, L_OPER,
139     "Unauthorized server connection attempt from %s: Invalid host "
140     "for server %s", get_client_name(client_p, MASK_IP), name);
141    
142     exit_client(client_p, client_p, "Invalid host.");
143     return;
144     /* NOT REACHED */
145     break;
146     }
147    
148 michael 1115 if ((client_p->id[0] && (target_p = hash_find_id(client_p->id)))
149 michael 1169 || (target_p = hash_find_server(name)))
150 adx 30 {
151     /* This link is trying feed me a server that I already have
152     * access through another path -- multiple paths not accepted
153     * currently, kill this link immediately!!
154     *
155     * Rather than KILL the link which introduced it, KILL the
156     * youngest of the two links. -avalon
157     *
158     * Definitely don't do that here. This is from an unregistered
159     * connect - A1kmm.
160     */
161     sendto_realops_flags(UMODE_ALL, L_ADMIN,
162     "Attempt to re-introduce server %s SID %s from %s",
163     name, client_p->id,
164     get_client_name(client_p, HIDE_IP));
165     sendto_realops_flags(UMODE_ALL, L_OPER,
166     "Attempt to re-introduce server %s SID %s from %s",
167     name, client_p->id,
168     get_client_name(client_p, MASK_IP));
169     sendto_one(client_p, "ERROR :Server ID already exists.");
170     exit_client(client_p, client_p, "Server ID Exists");
171     return;
172     }
173    
174     /* XXX If somehow there is a connect in progress and
175     * a connect comes in with same name toss the pending one,
176     * but only if it's not the same client! - Dianora
177     */
178     if ((target_p = find_servconn_in_progress(name)))
179     if (target_p != client_p)
180     exit_client(target_p, &me, "Overridden");
181    
182     /* if we are connecting (Handshake), we already have the name from the
183     * connect{} block in client_p->name
184     */
185     strlcpy(client_p->name, name, sizeof(client_p->name));
186     set_server_gecos(client_p, info);
187     client_p->hopcount = hop;
188     server_estab(client_p);
189     }
190    
191     /* ms_server()
192     * parv[0] = sender prefix
193     * parv[1] = servername
194     * parv[2] = serverinfo/hopcount
195     * parv[3] = serverinfo
196     */
197     static void
198     ms_server(struct Client *client_p, struct Client *source_p,
199     int parc, char *parv[])
200     {
201     char info[REALLEN + 1];
202     char *name;
203     struct Client *target_p;
204 michael 1383 struct AccessItem *aconf;
205 adx 30 int hop;
206     int hlined = 0;
207     int llined = 0;
208 michael 1321 dlink_node *ptr = NULL;
209 adx 30
210     /* Just to be sure -A1kmm. */
211     if (!IsServer(source_p))
212     return;
213    
214 michael 1178 if (EmptyString(parv[3]))
215 adx 30 {
216     sendto_one(client_p, "ERROR :No servername");
217     return;
218     }
219    
220     name = parv[1];
221     hop = atoi(parv[2]);
222     strlcpy(info, parv[3], sizeof(info));
223    
224 michael 1118 if (!valid_servname(name))
225 adx 30 {
226 michael 1118 sendto_realops_flags(UMODE_ALL, L_ADMIN,
227     "Link %s introduced server with bogus server name %s",
228     get_client_name(client_p, SHOW_IP), name);
229     sendto_realops_flags(UMODE_ALL, L_OPER,
230     "Link %s introduced server with bogus server name %s",
231     get_client_name(client_p, MASK_IP), name);
232     sendto_one(client_p, "ERROR :Bogus server name introduced");
233     exit_client(client_p, &me, "Bogus server name intoduced");
234     return;
235     }
236    
237 michael 1169 if ((target_p = hash_find_server(name)))
238 michael 1118 {
239 adx 30 /* This link is trying feed me a server that I already have
240     * access through another path -- multiple paths not accepted
241     * currently, kill this link immediately!!
242     *
243     * Rather than KILL the link which introduced it, KILL the
244     * youngest of the two links. -avalon
245     *
246     * I think that we should exit the link itself, not the introducer,
247     * and we should always exit the most recently received(i.e. the
248     * one we are receiving this SERVER for. -A1kmm
249     *
250     * You *cant* do this, if you link somewhere, it bursts you a server
251     * that already exists, then sends you a client burst, you squit the
252     * server, but you keep getting the burst of clients on a server that
253     * doesnt exist, although ircd can handle it, its not a realistic
254     * solution.. --fl_
255     */
256     /* It is behind a host-masked server. Completely ignore the
257     * server message(don't propagate or we will delink from whoever
258     * we propagate to). -A1kmm
259     */
260     if (irccmp(target_p->name, name) && target_p->from == client_p)
261     return;
262    
263     sendto_one(client_p, "ERROR :Server %s already exists", name);
264     sendto_realops_flags(UMODE_ALL, L_ADMIN,
265     "Link %s cancelled, server %s already exists",
266     get_client_name(client_p, SHOW_IP), name);
267     sendto_realops_flags(UMODE_ALL, L_OPER,
268     "Link %s cancelled, server %s already exists",
269     client_p->name, name);
270     exit_client(client_p, &me, "Server Exists");
271     return;
272     }
273    
274     /* XXX If somehow there is a connect in progress and
275     * a connect comes in with same name toss the pending one,
276     * but only if it's not the same client! - Dianora
277     */
278     if ((target_p = find_servconn_in_progress(name)))
279     if (target_p != client_p)
280     exit_client(target_p, &me, "Overridden");
281    
282 michael 1385 aconf = map_to_conf(client_p->localClient->confs.head->data);
283 michael 1383
284 adx 30 /* See if the newly found server is behind a guaranteed
285     * leaf. If so, close the link.
286     */
287 michael 1383 DLINK_FOREACH(ptr, aconf->leaf_list.head)
288     if (match(ptr->data, name))
289     ++llined;
290 adx 30
291 michael 1383 DLINK_FOREACH(ptr, aconf->hub_list.head)
292     if (match(ptr->data, name))
293     ++hlined;
294 michael 1118
295 adx 30 /* Ok, this way this works is
296     *
297     * A server can have a CONF_HUB allowing it to introduce servers
298     * behind it.
299     *
300     * connect {
301     * name = "irc.bighub.net";
302     * hub_mask="*";
303     * ...
304     *
305     * That would allow "irc.bighub.net" to introduce anything it wanted..
306     *
307     * However
308     *
309     * connect {
310     * name = "irc.somehub.fi";
311     * hub_mask="*";
312     * leaf_mask="*.edu";
313     *...
314     * Would allow this server in finland to hub anything but
315     * .edu's
316     */
317    
318 michael 885 /* Ok, check client_p can hub the new server */
319     if (!hlined)
320 adx 30 {
321     /* OOOPs nope can't HUB */
322     sendto_realops_flags(UMODE_ALL, L_ADMIN, "Non-Hub link %s introduced %s.",
323     get_client_name(client_p, HIDE_IP), name);
324     sendto_realops_flags(UMODE_ALL, L_OPER, "Non-Hub link %s introduced %s.",
325     get_client_name(client_p, MASK_IP), name);
326     exit_client(source_p, &me, "No matching hub_mask.");
327     return;
328     }
329    
330     /* Check for the new server being leafed behind this HUB */
331     if (llined)
332     {
333     /* OOOPs nope can't HUB this leaf */
334     sendto_realops_flags(UMODE_ALL, L_ADMIN,
335     "Link %s introduced leafed server %s.",
336     get_client_name(client_p, HIDE_IP), name);
337     sendto_realops_flags(UMODE_ALL, L_OPER,
338     "Link %s introduced leafed server %s.",
339 michael 1118 get_client_name(client_p, MASK_IP), name);
340     /* If it is new, we are probably misconfigured, so split the
341     * non-hub server introducing this. Otherwise, split the new
342     * server. -A1kmm.
343     */
344     /* wastes too much bandwidth, generates too many errors on
345     * larger networks, dont bother. --fl_
346     */
347     exit_client(client_p, &me, "Leafed Server.");
348     return;
349 adx 30 }
350    
351     target_p = make_client(client_p);
352     make_server(target_p);
353     target_p->hopcount = hop;
354 michael 1118 target_p->servptr = source_p;
355 adx 30
356     strlcpy(target_p->name, name, sizeof(target_p->name));
357    
358     set_server_gecos(target_p, info);
359     SetServer(target_p);
360    
361 michael 1219 if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(SERVICE_TYPE, target_p->name, NULL, NULL, 0))
362     AddFlag(target_p, FLAGS_SERVICE);
363 michael 1157
364 michael 1118 dlinkAdd(target_p, &target_p->node, &global_client_list);
365     dlinkAdd(target_p, make_dlink_node(), &global_serv_list);
366     dlinkAdd(target_p, &target_p->lnode, &target_p->servptr->serv->server_list);
367 adx 30
368     hash_add_client(target_p);
369    
370 michael 1474 sendto_server(client_p, NOCAPS, NOCAPS, ":%s SERVER %s %d :%s%s",
371 michael 1239 source_p->name, target_p->name, hop + 1,
372     IsHidden(target_p) ? "(H) " : "", target_p->info);
373 adx 30
374     sendto_realops_flags(UMODE_EXTERNAL, L_ALL,
375 michael 1118 "Server %s being introduced by %s",
376 adx 30 target_p->name, source_p->name);
377     }
378    
379     /* ms_sid()
380     * parv[0] = sender prefix
381     * parv[1] = servername
382     * parv[2] = serverinfo/hopcount
383     * parv[3] = sid of new server
384     * parv[4] = serverinfo
385     */
386     static void
387     ms_sid(struct Client *client_p, struct Client *source_p,
388     int parc, char *parv[])
389     {
390     char info[REALLEN + 1];
391     struct Client *target_p;
392 michael 1383 struct AccessItem *aconf = NULL;
393 adx 30 int hlined = 0;
394     int llined = 0;
395 michael 1321 dlink_node *ptr = NULL;
396 adx 30 int hop;
397    
398     /* Just to be sure -A1kmm. */
399     if (!IsServer(source_p))
400     return;
401    
402 michael 1178 if (EmptyString(parv[4]))
403 michael 1118 {
404     sendto_one(client_p, "ERROR :No servername");
405     return;
406     }
407 adx 30
408 michael 1118 hop = atoi(parv[2]);
409     strlcpy(info, parv[4], sizeof(info));
410    
411     if (!valid_servname(parv[1]))
412     {
413     sendto_realops_flags(UMODE_ALL, L_ADMIN,
414     "Link %s introduced server with bogus server name %s",
415     get_client_name(client_p, SHOW_IP), parv[1]);
416     sendto_realops_flags(UMODE_ALL, L_OPER,
417     "Link %s introduced server with bogus server name %s",
418     get_client_name(client_p, MASK_IP), parv[1]);
419     sendto_one(client_p, "ERROR :Bogus server name introduced");
420     exit_client(client_p, &me, "Bogus server name intoduced");
421     return;
422     }
423    
424     if (!valid_sid(parv[3]))
425     {
426     sendto_realops_flags(UMODE_ALL, L_ADMIN,
427     "Link %s introduced server with bogus server ID %s",
428     get_client_name(client_p, SHOW_IP), parv[3]);
429     sendto_realops_flags(UMODE_ALL, L_OPER,
430     "Link %s introduced server with bogus server ID %s",
431     get_client_name(client_p, MASK_IP), parv[3]);
432     sendto_one(client_p, "ERROR :Bogus server ID introduced");
433     exit_client(client_p, &me, "Bogus server ID intoduced");
434     return;
435     }
436    
437 adx 30 /* collision on SID? */
438 michael 1118 if ((target_p = hash_find_id(parv[3])))
439 adx 30 {
440 michael 1118 sendto_one(client_p, "ERROR :SID %s already exists", parv[3]);
441 adx 30 sendto_realops_flags(UMODE_ALL, L_ADMIN,
442     "Link %s cancelled, SID %s already exists",
443 michael 1118 get_client_name(client_p, SHOW_IP), parv[3]);
444 adx 30 sendto_realops_flags(UMODE_ALL, L_OPER,
445     "Link %s cancelled, SID %s already exists",
446 michael 1118 client_p->name, parv[3]);
447 adx 30 exit_client(client_p, &me, "Server Exists");
448     return;
449     }
450    
451     /* collision on name? */
452 michael 1169 if ((target_p = hash_find_server(parv[1])))
453 adx 30 {
454 michael 1118 sendto_one(client_p, "ERROR :Server %s already exists", parv[1]);
455 adx 30 sendto_realops_flags(UMODE_ALL, L_ADMIN,
456     "Link %s cancelled, server %s already exists",
457 michael 1118 get_client_name(client_p, SHOW_IP), parv[1]);
458 adx 30 sendto_realops_flags(UMODE_ALL, L_OPER,
459     "Link %s cancelled, server %s already exists",
460 michael 1118 client_p->name, parv[1]);
461 adx 30 exit_client(client_p, &me, "Server Exists");
462     return;
463     }
464    
465     /* XXX If somehow there is a connect in progress and
466     * a connect comes in with same name toss the pending one,
467     * but only if it's not the same client! - Dianora
468     */
469 michael 1118 if ((target_p = find_servconn_in_progress(parv[1])))
470 adx 30 if (target_p != client_p)
471     exit_client(target_p, &me, "Overridden");
472    
473 michael 1385 aconf = map_to_conf(client_p->localClient->confs.head->data);
474 michael 1384
475 adx 30 /* See if the newly found server is behind a guaranteed
476     * leaf. If so, close the link.
477     */
478 michael 1383 DLINK_FOREACH(ptr, aconf->leaf_list.head)
479     if (match(ptr->data, parv[1]))
480     ++llined;
481 adx 30
482 michael 1383 DLINK_FOREACH(ptr, aconf->hub_list.head)
483     if (match(ptr->data, parv[1]))
484     ++hlined;
485 michael 1118
486 adx 30
487     /* Ok, this way this works is
488     *
489     * A server can have a CONF_HUB allowing it to introduce servers
490     * behind it.
491     *
492     * connect {
493     * name = "irc.bighub.net";
494     * hub_mask="*";
495     * ...
496     *
497     * That would allow "irc.bighub.net" to introduce anything it wanted..
498     *
499     * However
500     *
501     * connect {
502     * name = "irc.somehub.fi";
503     * hub_mask="*";
504     * leaf_mask="*.edu";
505     *...
506     * Would allow this server in finland to hub anything but
507     * .edu's
508     */
509    
510     /* Ok, check client_p can hub the new server, and make sure it's not a LL */
511 michael 885 if (!hlined)
512 adx 30 {
513     /* OOOPs nope can't HUB */
514     sendto_realops_flags(UMODE_ALL, L_ADMIN, "Non-Hub link %s introduced %s.",
515 michael 1118 get_client_name(client_p, SHOW_IP), parv[1]);
516 adx 30 sendto_realops_flags(UMODE_ALL, L_OPER, "Non-Hub link %s introduced %s.",
517 michael 1118 get_client_name(client_p, MASK_IP), parv[1]);
518 adx 30 exit_client(source_p, &me, "No matching hub_mask.");
519     return;
520     }
521    
522     /* Check for the new server being leafed behind this HUB */
523     if (llined)
524     {
525     /* OOOPs nope can't HUB this leaf */
526     sendto_realops_flags(UMODE_ALL, L_ADMIN,
527     "Link %s introduced leafed server %s.",
528 michael 1118 get_client_name(client_p, SHOW_IP), parv[1]);
529 adx 30 sendto_realops_flags(UMODE_ALL, L_OPER,
530     "Link %s introduced leafed server %s.",
531 michael 1118 get_client_name(client_p, MASK_IP), parv[1]);
532 adx 30 exit_client(client_p, &me, "Leafed Server.");
533     return;
534     }
535    
536     target_p = make_client(client_p);
537     make_server(target_p);
538     target_p->hopcount = hop;
539 michael 1118 target_p->servptr = source_p;
540 adx 30
541 michael 1118 strlcpy(target_p->name, parv[1], sizeof(target_p->name));
542     strlcpy(target_p->id, parv[3], sizeof(target_p->id));
543 adx 30
544     set_server_gecos(target_p, info);
545     SetServer(target_p);
546    
547 michael 1219 if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(SERVICE_TYPE, target_p->name, NULL, NULL, 0))
548     AddFlag(target_p, FLAGS_SERVICE);
549 michael 1157
550 michael 1118 dlinkAdd(target_p, &target_p->node, &global_client_list);
551     dlinkAdd(target_p, make_dlink_node(), &global_serv_list);
552     dlinkAdd(target_p, &target_p->lnode, &target_p->servptr->serv->server_list);
553 adx 30
554     hash_add_client(target_p);
555     hash_add_id(target_p);
556    
557 michael 1474 sendto_server(client_p, CAP_TS6, NOCAPS, ":%s SID %s %d %s :%s%s",
558 michael 1239 ID_or_name(source_p, client_p), target_p->name, hop + 1,
559     IsHidden(target_p) ? "(H) " : "", target_p->info);
560 michael 1474 sendto_server(client_p, NOCAPS, CAP_TS6, ":%s SERVER %s %d :%s%s",
561 michael 1239 source_p->name, target_p->name, hop + 1,
562     IsHidden(target_p) ? "(H) " : "", target_p->info);
563 adx 30
564     sendto_realops_flags(UMODE_EXTERNAL, L_ALL,
565 michael 1118 "Server %s being introduced by %s",
566 adx 30 target_p->name, source_p->name);
567     }
568    
569     /* set_server_gecos()
570     *
571     * input - pointer to client
572     * output - NONE
573     * side effects - servers gecos field is set
574     */
575     static void
576     set_server_gecos(struct Client *client_p, char *info)
577     {
578     /* check the info for [IP] */
579     if (info[0])
580     {
581     char *p;
582     char *s;
583     char *t;
584    
585     s = info;
586    
587     /* we should only check the first word for an ip */
588     if ((p = strchr(s, ' ')) != NULL)
589     *p = '\0';
590    
591     /* check for a ] which would symbolise an [IP] */
592     if ((t = strchr(s, ']')) != NULL)
593     {
594     /* set s to after the first space */
595     if (p)
596     s = ++p;
597     else
598     s = NULL;
599     }
600     /* no ], put the space back */
601     else if (p)
602     *p = ' ';
603    
604     /* p may have been set to a trailing space, so check s exists and that
605     * it isnt \0 */
606     if (s && (*s != '\0'))
607     {
608     /* a space? if not (H) could be the last part of info.. */
609     if ((p = strchr(s, ' ')))
610     *p = '\0';
611    
612     /* check for (H) which is a hidden server */
613     if (!strcmp(s, "(H)"))
614     {
615     SetHidden(client_p);
616    
617     /* if there was no space.. theres nothing to set info to */
618     if (p)
619     s = ++p;
620     else
621     s = NULL;
622     }
623     else if (p)
624     *p = ' ';
625    
626     /* if there was a trailing space, s could point to \0, so check */
627     if (s && (*s != '\0'))
628     strlcpy(client_p->info, s, sizeof(client_p->info));
629     else
630     strlcpy(client_p->info, "(Unknown Location)", sizeof(client_p->info));
631     }
632     else
633     strlcpy(client_p->info, "(Unknown Location)", sizeof(client_p->info));
634     }
635     else
636     strlcpy(client_p->info, "(Unknown Location)", sizeof(client_p->info));
637     }
638 michael 1230
639     static struct Message server_msgtab = {
640     "SERVER", 0, 0, 4, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0,
641     {mr_server, m_registered, ms_server, m_ignore, m_registered, m_ignore}
642     };
643    
644     static struct Message sid_msgtab = {
645     "SID", 0, 0, 5, MAXPARA, MFLG_SLOW, 0,
646     {rfc1459_command_send_error, m_ignore, ms_sid, m_ignore, m_ignore, m_ignore}
647     };
648    
649     static void
650     module_init(void)
651     {
652     mod_add_cmd(&sid_msgtab);
653     mod_add_cmd(&server_msgtab);
654     }
655    
656     static void
657     module_exit(void)
658     {
659     mod_del_cmd(&sid_msgtab);
660     mod_del_cmd(&server_msgtab);
661     }
662    
663     struct module module_entry = {
664     .node = { NULL, NULL, NULL },
665     .name = NULL,
666     .version = "$Revision$",
667     .handle = NULL,
668     .modinit = module_init,
669     .modexit = module_exit,
670     .flags = MODULE_FLAG_CORE
671     };

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision