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

Comparing ircd-hybrid/trunk/src/hostmask.c (file contents):
Revision 2898 by michael, Wed Jan 22 18:41:24 2014 UTC vs.
Revision 2916 by michael, Sat Jan 25 21:09:18 2014 UTC

# Line 1 | Line 1
1   /*
2 < *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 < *  hostmask.c: Code to efficiently find IP & hostmask based configs.
2 > *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (C) 2005 by the past and present ircd coders, and others.
4 > *  Copyright (c) 2001-2014 ircd-hybrid development team
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 18 | Line 17
17   *  along with this program; if not, write to the Free Software
18   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
19   *  USA
20 < *
21 < *  $Id$
20 > */
21 >
22 > /*! \file hostmask.c
23 > * \brief Code to efficiently find IP & hostmask based configs.
24 > * \version $Id$
25   */
26  
27   #include "stdinc.h"
# Line 51 | Line 53
53   * Side effects: None
54   * Comments: Called from parse_netmask
55   */
56 < /* Fixed so ::/0 (any IPv6 address) is valid
56 > /* Fixed so ::/0 (any IPv6 address) is valid
57     Also a bug in DigitParse above.
58     -Gozem 2002-07-19 gozem@linux.nu
59   */
# Line 477 | Line 479 | find_conf_by_address(const char *name, s
479        {
480          DLINK_FOREACH(ptr, atable[hash_ipv6(addr, b)].head)
481          {
482 <          arec = ptr->data;
482 >          arec = ptr->data;
483  
484            if (arec->type == (type & ~0x1) &&
485                arec->precedence > hprecv &&
# Line 485 | Line 487 | find_conf_by_address(const char *name, s
487                match_ipv6(addr, &arec->Mask.ipa.addr,
488                           arec->Mask.ipa.bits) &&
489                (type & 0x1 || !cmpfunc(arec->username, username)) &&
490 <              (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL ||
491 <               match_conf_password(password, arec->conf)))
490 >              (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL ||
491 >               match_conf_password(password, arec->conf)))
492            {
493              hprecv = arec->precedence;
494              hprec = arec->conf;
# Line 510 | Line 512 | find_conf_by_address(const char *name, s
512                match_ipv4(addr, &arec->Mask.ipa.addr,
513                           arec->Mask.ipa.bits) &&
514                (type & 0x1 || !cmpfunc(arec->username, username)) &&
515 <              (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL ||
516 <               match_conf_password(password, arec->conf)))
515 >              (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL ||
516 >               match_conf_password(password, arec->conf)))
517            {
518              hprecv = arec->precedence;
519              hprec = arec->conf;
# Line 630 | Line 632 | find_dline_conf(struct irc_ssaddr *addr,
632   }
633  
634   /* void add_conf_by_address(int, struct MaskItem *aconf)
635 < * Input:
635 > * Input:
636   * Output: None
637   * Side-effects: Adds this entry to the hash table.
638   */
# Line 737 | Line 739 | delete_one_address_conf(const char *addr
739   * Output: None
740   * Side effects: Clears out all address records in the hash table,
741   *               frees them, and frees the MaskItems if nothing references
742 < *               them, otherwise sets them as illegal.  
742 > *               them, otherwise sets them as illegal.
743   */
744   void
745   clear_out_address_conf(void)
746   {
747    unsigned int i = 0;
748    dlink_node *ptr = NULL, *ptr_next = NULL;
749 <
749 >
750    for (i = 0; i < ATABLE_SIZE; ++i)
751    {
752      DLINK_FOREACH_SAFE(ptr, ptr_next, atable[i].head)
# Line 788 | Line 790 | hostmask_send_expiration(struct AddressR
790        break;
791      default: break;
792    }
793 <  
793 >
794    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
795                         "Temporary %c-line for [%s@%s] expired", ban_type,
796                         (arec->conf->user) ? arec->conf->user : "*",

Diff Legend

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