74 |
|
|
75 |
|
static void check_pings_list(dlink_list *); |
76 |
|
static void check_unknowns_list(void); |
77 |
< |
static void ban_them(struct Client *, struct ConfItem *); |
77 |
> |
static void ban_them(struct Client *, struct MaskItem *); |
78 |
|
|
79 |
|
|
80 |
|
/* init_client() |
254 |
|
if (!IsRegistered(client_p)) |
255 |
|
ping = CONNECTTIMEOUT, pingwarn = 0; |
256 |
|
else |
257 |
< |
ping = get_client_ping(client_p, &pingwarn); |
257 |
> |
ping = get_client_ping(&client_p->localClient->confs, &pingwarn); |
258 |
|
|
259 |
|
if (ping < CurrentTime - client_p->localClient->lasttime) |
260 |
|
{ |
352 |
|
check_conf_klines(void) |
353 |
|
{ |
354 |
|
struct Client *client_p = NULL; /* current local client_p being examined */ |
355 |
< |
struct AccessItem *aconf = NULL; |
356 |
< |
struct ConfItem *conf = NULL; |
355 |
> |
struct MaskItem *conf = NULL; |
356 |
|
dlink_node *ptr, *next_ptr; |
357 |
|
|
358 |
|
DLINK_FOREACH_SAFE(ptr, next_ptr, local_client_list.head) |
364 |
|
if (IsDead(client_p) || !IsClient(client_p)) |
365 |
|
continue; |
366 |
|
|
367 |
< |
/* if there is a returned struct ConfItem then kill it */ |
369 |
< |
if ((aconf = find_dline_conf(&client_p->localClient->ip, |
367 |
> |
if ((conf = find_dline_conf(&client_p->localClient->ip, |
368 |
|
client_p->localClient->aftype)) != NULL) |
369 |
|
{ |
370 |
< |
if (aconf->status & CONF_EXEMPTDLINE) |
370 |
> |
if (conf->status & CONF_EXEMPT) |
371 |
|
continue; |
372 |
|
|
375 |
– |
conf = unmap_conf_item(aconf); |
373 |
|
ban_them(client_p, conf); |
374 |
|
continue; /* and go examine next fd/client_p */ |
375 |
|
} |
376 |
|
|
377 |
< |
if (ConfigFileEntry.glines && (aconf = find_gline(client_p))) |
377 |
> |
if (ConfigFileEntry.glines && (conf = find_gline(client_p))) |
378 |
|
{ |
379 |
|
if (IsExemptKline(client_p) || |
380 |
|
IsExemptGline(client_p)) |
385 |
|
continue; |
386 |
|
} |
387 |
|
|
391 |
– |
conf = unmap_conf_item(aconf); |
388 |
|
ban_them(client_p, conf); |
389 |
|
/* and go examine next fd/client_p */ |
390 |
|
continue; |
391 |
|
} |
392 |
|
|
393 |
< |
if ((aconf = find_kill(client_p)) != NULL) |
393 |
> |
if ((conf = find_kill(client_p)) != NULL) |
394 |
|
{ |
399 |
– |
|
400 |
– |
/* if there is a returned struct AccessItem.. then kill it */ |
395 |
|
if (IsExemptKline(client_p)) |
396 |
|
{ |
397 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
400 |
|
continue; |
401 |
|
} |
402 |
|
|
409 |
– |
conf = unmap_conf_item(aconf); |
403 |
|
ban_them(client_p, conf); |
404 |
|
continue; |
405 |
|
} |
406 |
|
|
407 |
< |
/* if there is a returned struct MatchItem then kill it */ |
415 |
< |
if ((conf = find_matching_name_conf(XLINE_TYPE, client_p->info, |
407 |
> |
if ((conf = find_matching_name_conf(CONF_XLINE, client_p->info, |
408 |
|
NULL, NULL, 0)) != NULL || |
409 |
< |
(conf = find_matching_name_conf(RXLINE_TYPE, client_p->info, |
409 |
> |
(conf = find_matching_name_conf(CONF_RXLINE, client_p->info, |
410 |
|
NULL, NULL, 0)) != NULL) |
411 |
|
{ |
412 |
|
ban_them(client_p, conf); |
419 |
|
{ |
420 |
|
client_p = ptr->data; |
421 |
|
|
422 |
< |
if ((aconf = find_dline_conf(&client_p->localClient->ip, |
423 |
< |
client_p->localClient->aftype))) |
422 |
> |
if ((conf = find_dline_conf(&client_p->localClient->ip, |
423 |
> |
client_p->localClient->aftype))) |
424 |
|
{ |
425 |
< |
if (aconf->status & CONF_EXEMPTDLINE) |
425 |
> |
if (conf->status & CONF_EXEMPT) |
426 |
|
continue; |
427 |
|
|
428 |
|
exit_client(client_p, &me, "D-lined"); |
434 |
|
* ban_them |
435 |
|
* |
436 |
|
* inputs - pointer to client to ban |
437 |
< |
* - pointer to ConfItem |
437 |
> |
* - pointer to MaskItem |
438 |
|
* output - NONE |
439 |
|
* side effects - given client_p is banned |
440 |
|
*/ |
441 |
|
static void |
442 |
< |
ban_them(struct Client *client_p, struct ConfItem *conf) |
442 |
> |
ban_them(struct Client *client_p, struct MaskItem *conf) |
443 |
|
{ |
444 |
|
const char *user_reason = NULL; /* What is sent to user */ |
453 |
– |
struct AccessItem *aconf = NULL; |
454 |
– |
struct MatchItem *xconf = NULL; |
445 |
|
const char *type_string = NULL; |
446 |
|
const char dline_string[] = "D-line"; |
447 |
|
const char kline_string[] = "K-line"; |
450 |
|
|
451 |
|
switch (conf->type) |
452 |
|
{ |
453 |
< |
case RKLINE_TYPE: |
454 |
< |
case KLINE_TYPE: |
453 |
> |
case CONF_RKLINE: |
454 |
> |
case CONF_KLINE: |
455 |
|
type_string = kline_string; |
466 |
– |
aconf = map_to_conf(conf); |
456 |
|
break; |
457 |
< |
case DLINE_TYPE: |
457 |
> |
case CONF_DLINE: |
458 |
|
type_string = dline_string; |
470 |
– |
aconf = map_to_conf(conf); |
459 |
|
break; |
460 |
< |
case GLINE_TYPE: |
460 |
> |
case CONF_GLINE: |
461 |
|
type_string = gline_string; |
474 |
– |
aconf = map_to_conf(conf); |
462 |
|
break; |
463 |
< |
case RXLINE_TYPE: |
464 |
< |
case XLINE_TYPE: |
463 |
> |
case CONF_RXLINE: |
464 |
> |
case CONF_XLINE: |
465 |
|
type_string = xline_string; |
466 |
< |
xconf = map_to_conf(conf); |
480 |
< |
++xconf->count; |
466 |
> |
++conf->count; |
467 |
|
break; |
468 |
|
default: |
469 |
|
assert(0); |
470 |
|
break; |
471 |
|
} |
472 |
|
|
473 |
< |
if (aconf != NULL) |
488 |
< |
user_reason = aconf->reason ? aconf->reason : type_string; |
489 |
< |
if (xconf != NULL) |
490 |
< |
user_reason = xconf->reason ? xconf->reason : type_string; |
473 |
> |
user_reason = conf->reason ? conf->reason : type_string; |
474 |
|
|
475 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s active for %s", |
476 |
|
type_string, get_client_name(client_p, HIDE_IP)); |