#include "stdinc.h"
#include "memory.h"
#include "ircd_defs.h"
#include "tools.h"
#include "s_conf.h"
#include "hostmask.h"
#include "numeric.h"
#include "send.h"
#include "irc_string.h"
Vai al codice sorgente di questo file.
Definizioni | |
#define | DigitParse(ch) |
Funzioni | |
static int | try_parse_v4_netmask (const char *, struct irc_ssaddr *, int *) |
static unsigned long | hash_ipv4 (struct irc_ssaddr *, int) |
int | parse_netmask (const char *text, struct irc_ssaddr *addr, int *b) |
int | match_ipv4 (struct irc_ssaddr *addr, struct irc_ssaddr *mask, int bits) |
void | mask_addr (struct irc_ssaddr *ip, int bits) |
void | init_host_hash (void) |
static int | hash_text (const char *start) |
static unsigned long | get_mask_hash (const char *text) |
struct AccessItem * | find_conf_by_address (const char *name, struct irc_ssaddr *addr, int type, int fam, const char *username, const char *password) |
struct AccessItem * | find_address_conf (const char *host, const char *user, struct irc_ssaddr *ip, int aftype, char *password) |
struct AccessItem * | find_gline_conf (const char *host, const char *user, struct irc_ssaddr *ip, int aftype) |
struct AccessItem * | find_kline_conf (const char *host, const char *user, struct irc_ssaddr *ip, int aftype) |
struct AccessItem * | find_dline_conf (struct irc_ssaddr *addr, int aftype) |
void | add_conf_by_address (int type, struct AccessItem *aconf) |
void | delete_one_address_conf (const char *address, struct AccessItem *aconf) |
void | clear_out_address_conf (void) |
char * | show_iline_prefix (struct Client *sptr, struct AccessItem *aconf, const char *name) |
void | report_auth (struct Client *client_p) |
void | report_Klines (struct Client *client_p, int tkline) |
Variabili | |
struct AddressRec * | atable [ATABLE_SIZE] |
#define DigitParse | ( | ch | ) |
Valore:
do { \ if (ch >= '0' && ch <= '9') \ ch = ch - '0'; \ else if (ch >= 'A' && ch <= 'F') \ ch = ch - 'A' + 10; \ else if (ch >= 'a' && ch <= 'f') \ ch = ch - 'a' + 10; \ } while(0);
Definizione alla linea 42 del file hostmask.c.
void add_conf_by_address | ( | int | type, | |
struct AccessItem * | aconf | |||
) |
Definizione alla linea 635 del file hostmask.c.
Riferimenti AddressRec::aconf, EmptyString, get_mask_hash(), hash_ipv4(), HM_IPV4, HM_IPV6, AccessItem::host, AddressRec::hostname, AddressRec::ipa, AddressRec::Mask, AddressRec::masktype, MyMalloc(), AddressRec::next, parse_netmask(), AddressRec::precedence, AddressRec::type, AccessItem::user, e AddressRec::username.
Referenziato da add_temp_line(), apply_kline(), conf_add_d_conf(), mo_dline(), e parse_csv_file().
void clear_out_address_conf | ( | void | ) |
Definizione alla linea 744 del file hostmask.c.
Riferimenti AddressRec::aconf, ATABLE_SIZE, AccessItem::clients, CONF_FLAGS_TEMPORARY, CONF_ILLEGAL, AccessItem::flags, free_access_item(), MyFree(), AddressRec::next, e AccessItem::status.
Referenziato da clear_out_old_conf().
void delete_one_address_conf | ( | const char * | address, | |
struct AccessItem * | aconf | |||
) |
Definizione alla linea 693 del file hostmask.c.
Riferimenti AddressRec::aconf, AccessItem::clients, CONF_ILLEGAL, free_access_item(), get_mask_hash(), hash_ipv4(), HM_IPV4, HM_IPV6, AddressRec::masktype, MyFree(), AddressRec::next, parse_netmask(), e AccessItem::status.
Referenziato da expire_tklines(), remove_gline_match(), remove_tdline_match(), e remove_tkline_match().
struct AccessItem* find_address_conf | ( | const char * | host, | |
const char * | user, | |||
struct irc_ssaddr * | ip, | |||
int | aftype, | |||
char * | password | |||
) | [read] |
Definizione alla linea 546 del file hostmask.c.
Riferimenti CONF_CLIENT, CONF_GLINE, CONF_KILL, find_conf_by_address(), IsConfExemptGline, e IsConfExemptKline.
Referenziato da mo_testline(), e verify_access().
struct AccessItem* find_conf_by_address | ( | const char * | name, | |
struct irc_ssaddr * | addr, | |||
int | type, | |||
int | fam, | |||
const char * | username, | |||
const char * | password | |||
) | [read] |
Definizione alla linea 440 del file hostmask.c.
Riferimenti AddressRec::aconf, hash_ipv4(), hash_text(), HM_HOST, HM_IPV4, HM_IPV6, AddressRec::hostname, AddressRec::ipa, IsNeedPassword, AddressRec::Mask, AddressRec::masktype, match(), match_conf_password(), match_ipv4(), match_ipv6(), AddressRec::next, AccessItem::passwd, AddressRec::precedence, AddressRec::type, e AddressRec::username.
Referenziato da already_placed_kline(), find_address_conf(), find_dline_conf(), find_gline_conf(), find_is_glined(), find_kline_conf(), stats_auth(), stats_klines(), e stats_tklines().
struct AccessItem* find_dline_conf | ( | struct irc_ssaddr * | addr, | |
int | aftype | |||
) | [read] |
Definizione alla linea 618 del file hostmask.c.
Riferimenti CONF_DLINE, CONF_EXEMPTDLINE, e find_conf_by_address().
Referenziato da check_conf_klines(), conf_connect_allowed(), mo_dline(), e mo_testline().
struct AccessItem* find_gline_conf | ( | const char * | host, | |
const char * | user, | |||
struct irc_ssaddr * | ip, | |||
int | aftype | |||
) | [read] |
Definizione alla linea 576 del file hostmask.c.
Riferimenti CONF_EXEMPTKLINE, CONF_GLINE, e find_conf_by_address().
Referenziato da find_gline().
struct AccessItem* find_kline_conf | ( | const char * | host, | |
const char * | user, | |||
struct irc_ssaddr * | ip, | |||
int | aftype | |||
) | [read] |
Definizione alla linea 598 del file hostmask.c.
Riferimenti CONF_EXEMPTKLINE, CONF_KILL, e find_conf_by_address().
Referenziato da find_kill().
static unsigned long get_mask_hash | ( | const char * | text | ) | [static] |
Definizione alla linea 417 del file hostmask.c.
Riferimenti hash_text(), e IsMWildChar.
Referenziato da add_conf_by_address(), e delete_one_address_conf().
static unsigned long hash_ipv4 | ( | struct irc_ssaddr * | addr, | |
int | bits | |||
) | [static] |
Definizione alla linea 349 del file hostmask.c.
Riferimenti ATABLE_SIZE.
Referenziato da add_conf_by_address(), delete_one_address_conf(), e find_conf_by_address().
static int hash_text | ( | const char * | start | ) | [static] |
Definizione alla linea 398 del file hostmask.c.
Riferimenti ATABLE_SIZE, e ToLower.
Referenziato da find_conf_by_address(), e get_mask_hash().
void init_host_hash | ( | void | ) |
void mask_addr | ( | struct irc_ssaddr * | ip, | |
int | bits | |||
) |
Definizione alla linea 301 del file hostmask.c.
Riferimenti irc_ssaddr::ss.
Referenziato da cidr_limit_reached().
int match_ipv4 | ( | struct irc_ssaddr * | addr, | |
struct irc_ssaddr * | mask, | |||
int | bits | |||
) |
Definizione alla linea 282 del file hostmask.c.
Referenziato da cidr_limit_reached(), find_bmask(), find_conf_by_address(), remove_from_cidr_check(), remove_gline_match(), remove_tdline_match(), e remove_tkline_match().
int parse_netmask | ( | const char * | text, | |
struct irc_ssaddr * | addr, | |||
int * | b | |||
) |
Definizione alla linea 240 del file hostmask.c.
Riferimenti HM_HOST, e try_parse_v4_netmask().
Referenziato da add_conf_by_address(), add_id(), already_placed_kline(), conf_add_d_conf(), delete_one_address_conf(), find_is_glined(), mo_dline(), mo_testline(), remove_gline_match(), remove_tdline_match(), e remove_tkline_match().
void report_auth | ( | struct Client * | client_p | ) |
Definizione alla linea 839 del file hostmask.c.
Riferimenti AddressRec::aconf, ATABLE_SIZE, AccessItem::class_ptr, CONF_CLIENT, ConfigFileEntry, form_str(), config_file_entry::hide_spoof_ips, AccessItem::host, IsConfDoSpoofIp, me, MyOper, ConfItem::name, Client::name, AddressRec::next, AccessItem::port, RPL_STATSILINE, sendto_one(), show_iline_prefix(), AddressRec::type, unmap_conf_item(), e AccessItem::user.
Referenziato da stats_auth().
void report_Klines | ( | struct Client * | client_p, | |
int | tkline | |||
) |
Definizione alla linea 891 del file hostmask.c.
Riferimenti AddressRec::aconf, ATABLE_SIZE, CONF_FLAGS_TEMPORARY, CONF_KILL, form_str(), AccessItem::host, IsOper, me, Client::name, AddressRec::next, AccessItem::oper_reason, AccessItem::reason, RPL_STATSKLINE, sendto_one(), AddressRec::type, e AccessItem::user.
Referenziato da stats_klines(), e stats_tklines().
char* show_iline_prefix | ( | struct Client * | sptr, | |
struct AccessItem * | aconf, | |||
const char * | name | |||
) |
Definizione alla linea 797 del file hostmask.c.
Riferimenti IsConfCanFlood, IsConfDoSpoofIp, IsConfExemptGline, IsConfExemptKline, IsConfExemptLimits, IsConfExemptResv, IsConfIdlelined, IsLimitIp, IsNeedIdentd, IsNeedPassword, IsNoMatchIp, IsNoTilde, MyOper, strlcpy(), e USERLEN.
Referenziato da report_auth(), e stats_auth().
static int try_parse_v4_netmask | ( | const char * | text, | |
struct irc_ssaddr * | addr, | |||
int * | b | |||
) | [static] |
Definizione alla linea 170 del file hostmask.c.
Riferimenti digits, HM_HOST, e HM_IPV4.
Referenziato da parse_netmask().
struct AddressRec* atable[ATABLE_SIZE] |
Definizione alla linea 335 del file hostmask.c.
Referenziato da mo_spoof(), stats_deny(), stats_exempt(), stats_glines(), e stats_tdeny().