diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-25 21:09:56 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-25 21:09:56 +0000 |
commit | 4a3da8dcd051266aa6a4e6617f1d13b2e217d776 (patch) | |
tree | e7404b698115ab0bba4951cd88119fec4d54ab5c | |
parent | 74ae0f92cc73db9afda251ae32a6c4d973a96cb5 (diff) |
- Clean up all files in src/ (fixed indentation, removed whitespaces/tabs)
- Fixed copyright years
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2917 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r-- | src/channel.c | 6 | ||||
-rw-r--r-- | src/channel_mode.c | 12 | ||||
-rw-r--r-- | src/client.c | 14 | ||||
-rw-r--r-- | src/conf.c | 65 | ||||
-rw-r--r-- | src/conf_class.c | 6 | ||||
-rw-r--r-- | src/conf_db.c | 5 | ||||
-rw-r--r-- | src/conf_lexer.l | 34 | ||||
-rw-r--r-- | src/conf_parser.y | 81 | ||||
-rw-r--r-- | src/dbuf.c | 12 | ||||
-rw-r--r-- | src/event.c | 26 | ||||
-rw-r--r-- | src/fdlist.c | 18 | ||||
-rw-r--r-- | src/getopt.c | 16 | ||||
-rw-r--r-- | src/hash.c | 16 | ||||
-rw-r--r-- | src/hostmask.c | 32 | ||||
-rw-r--r-- | src/irc_res.c | 84 | ||||
-rw-r--r-- | src/irc_string.c | 25 | ||||
-rw-r--r-- | src/ircd.c | 30 | ||||
-rw-r--r-- | src/list.c | 15 | ||||
-rw-r--r-- | src/listener.c | 22 | ||||
-rw-r--r-- | src/log.c | 18 | ||||
-rw-r--r-- | src/match.c | 49 | ||||
-rw-r--r-- | src/memory.c | 11 | ||||
-rw-r--r-- | src/mempool.c | 1 | ||||
-rw-r--r-- | src/modules.c | 12 | ||||
-rw-r--r-- | src/motd.c | 6 | ||||
-rw-r--r-- | src/packet.c | 42 | ||||
-rw-r--r-- | src/parse.c | 17 | ||||
-rw-r--r-- | src/restart.c | 14 | ||||
-rw-r--r-- | src/resv.c | 14 | ||||
-rw-r--r-- | src/rsa.c | 12 | ||||
-rw-r--r-- | src/s_auth.c | 56 | ||||
-rw-r--r-- | src/s_bsd.c | 50 | ||||
-rw-r--r-- | src/s_bsd_devpoll.c | 15 | ||||
-rw-r--r-- | src/s_bsd_epoll.c | 13 | ||||
-rw-r--r-- | src/s_bsd_kqueue.c | 13 | ||||
-rw-r--r-- | src/s_bsd_poll.c | 17 | ||||
-rw-r--r-- | src/s_bsd_select.c | 13 | ||||
-rw-r--r-- | src/s_gline.c | 12 | ||||
-rw-r--r-- | src/s_misc.c | 21 | ||||
-rw-r--r-- | src/s_serv.c | 14 | ||||
-rw-r--r-- | src/s_user.c | 12 | ||||
-rw-r--r-- | src/send.c | 20 | ||||
-rw-r--r-- | src/whowas.c | 12 |
43 files changed, 542 insertions, 441 deletions
diff --git a/src/channel.c b/src/channel.c index d422688..b7b17e5 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1,7 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ #include "irc_string.h" #include "ircd.h" #include "numeric.h" -#include "s_serv.h" /* captab */ +#include "s_serv.h" #include "s_user.h" #include "send.h" #include "event.h" diff --git a/src/channel_mode.c b/src/channel_mode.c index 98ccebf..8210f75 100644 --- a/src/channel_mode.c +++ b/src/channel_mode.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * channel_mode.c: Controls modes on channels. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2005 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file channel_mode.c + * \brief Controls modes on channels. + * \version $Id$ */ #include "stdinc.h" diff --git a/src/client.c b/src/client.c index f79685f..f8c5693 100644 --- a/src/client.c +++ b/src/client.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * client.c: Controls clients. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file client.c + * \brief Controls clients. + * \version $Id$ */ #include "stdinc.h" @@ -448,7 +450,7 @@ conf_try_ban(struct Client *client_p, struct MaskItem *conf) get_client_name(client_p, HIDE_IP), IsExemptKline(client_p) ? "k" : "g"); return; } - + type_string = gline_string; break; case CONF_XLINE: @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * conf.c: Configuration file functions. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file conf.c + * \brief Configuration file functions. + * \version $Id$ */ #include "stdinc.h" @@ -243,9 +245,9 @@ int check_client(struct Client *source_p) { int i; - + if ((i = verify_access(source_p))) - ilog(LOG_TYPE_IRCD, "Access denied: %s[%s]", + ilog(LOG_TYPE_IRCD, "Access denied: %s[%s]", source_p->name, source_p->sockhost); switch (i) @@ -269,7 +271,7 @@ check_client(struct Client *source_p) ilog(LOG_TYPE_IRCD, "Too many connections from %s.", get_client_name(source_p, SHOW_IP)); ++ServerStats.is_ref; - exit_client(source_p, &me, + exit_client(source_p, &me, "No more connections allowed in your connection class"); break; @@ -367,7 +369,7 @@ verify_access(struct Client *client_p) if (IsConfGline(conf)) sendto_one(client_p, ":%s NOTICE %s :*** G-lined", me.name, client_p->name); - sendto_one(client_p, ":%s NOTICE %s :*** Banned: %s", + sendto_one(client_p, ":%s NOTICE %s :*** Banned: %s", me.name, client_p->name, conf->reason); return BANNED_CLIENT; } @@ -584,8 +586,8 @@ hash_ip(struct irc_ssaddr *addr) uint32_t *ip = (uint32_t *)&v6->sin6_addr.s6_addr; hash = ip[0] ^ ip[3]; - hash ^= hash >> 16; - hash ^= hash >> 8; + hash ^= hash >> 16; + hash ^= hash >> 8; hash = hash & (IP_HASH_SIZE - 1); return hash; } @@ -596,7 +598,7 @@ hash_ip(struct irc_ssaddr *addr) /* count_ip_hash() * - * inputs - pointer to counter of number of ips hashed + * inputs - pointer to counter of number of ips hashed * - pointer to memory used for ip hash * output - returned via pointers input * side effects - NONE @@ -784,7 +786,7 @@ find_conf_name(dlink_list *list, const char *name, enum maskitem_type type) DLINK_FOREACH(ptr, list->head) { conf = ptr->data; - + if (conf->type == type) { if (conf->name && (irccmp(conf->name, name) == 0 || @@ -902,7 +904,7 @@ find_matching_name_conf(enum maskitem_type type, const char *name, const char *u return conf; } break; - + default: break; } @@ -939,7 +941,7 @@ find_exact_name_conf(enum maskitem_type type, const struct Client *who, const ch if (EmptyString(conf->name)) continue; - + if (irccmp(conf->name, name) == 0) { if ((user == NULL && (host == NULL))) @@ -1005,7 +1007,7 @@ find_exact_name_conf(enum maskitem_type type, const struct Client *who, const ch if (EmptyString(conf->name)) continue; - + if (name == NULL) { if (EmptyString(conf->host)) @@ -1126,7 +1128,6 @@ set_default_conf(void) ConfigServerHide.hide_server_ips = 0; ConfigServerHide.disable_remote_commands = 0; - ConfigFileEntry.service_name = xstrdup(SERVICE_NAME_DEFAULT); ConfigFileEntry.max_watch = WATCHSIZE_DEFAULT; ConfigFileEntry.cycle_on_host_change = 1; @@ -1198,7 +1199,7 @@ validate_conf(void) ConfigFileEntry.max_watch = IRCD_MAX(ConfigFileEntry.max_watch, WATCHSIZE_MIN); } -/* read_conf() +/* read_conf() * * inputs - file descriptor pointing to config file to use * output - None @@ -1302,7 +1303,7 @@ void cleanup_tklines(void *notused) { hostmask_expire_temporary(); - expire_tklines(&xconf_items); + expire_tklines(&xconf_items); expire_tklines(&nresv_items); expire_tklines(&cresv_items); } @@ -1420,7 +1421,7 @@ get_oper_name(const struct Client *client_p) } } - /* Probably should assert here for now. If there is an oper out there + /* Probably should assert here for now. If there is an oper out there * with no oper{} conf attached, it would be good for us to know... */ assert(0); /* Oper without oper conf! */ @@ -1451,7 +1452,7 @@ read_conf_files(int cold) FIXME: The full path is in conffilenamebuf first time since we dont know anything else - - Gozem 2002-07-21 + - Gozem 2002-07-21 */ strlcpy(conffilebuf, filename, sizeof(conffilebuf)); @@ -1525,7 +1526,7 @@ clear_out_old_conf(void) /* We only need to free anything allocated by yyparse() here. * Resetting structs, etc, is taken care of by set_default_conf(). */ - + for (; *iterator != NULL; iterator++) { DLINK_FOREACH_SAFE(ptr, next_ptr, (*iterator)->head) @@ -1612,12 +1613,12 @@ clear_out_old_conf(void) * * inputs - pointer to config item * output - NONE - * side effects - Add a class pointer to a conf + * side effects - Add a class pointer to a conf */ void conf_add_class_to_conf(struct MaskItem *conf, const char *class_name) { - if (class_name == NULL) + if (class_name == NULL) { conf->class = class_default; @@ -1684,7 +1685,7 @@ conf_error_report(const char *msg) /* * valid_tkline() - * + * * inputs - pointer to ascii string to check * - whether the specified time is in seconds or minutes * output - -1 not enough parameters @@ -1709,19 +1710,19 @@ valid_tkline(const char *data, const int minutes) } /* - * In the degenerate case where oper does a /quote kline 0 user@host :reason + * In the degenerate case where oper does a /quote kline 0 user@host :reason * i.e. they specifically use 0, I am going to return 1 instead * as a return value of non-zero is used to flag it as a temporary kline */ if (result == 0) result = 1; - /* + /* * If the incoming time is in seconds convert it to minutes for the purpose * of this calculation */ if (!minutes) - result = result / 60; + result = result / 60; if (result > MAX_TDKLINE_TIME) result = MAX_TDKLINE_TIME; @@ -1831,7 +1832,7 @@ valid_wild_card(struct Client *source_p, int warn, int count, ...) * - parse_flags bit map of things to test * - pointer to user or string to parse into * - pointer to host or NULL to parse into if non NULL - * - pointer to optional tkline time or NULL + * - pointer to optional tkline time or NULL * - pointer to target_server to parse into if non NULL * - pointer to reason to parse into * @@ -1899,7 +1900,7 @@ parse_aline(const char *cmd, struct Client *source_p, *up_p = user; *h_p = host; } - + parc--; parv++; @@ -2021,14 +2022,14 @@ find_user_host(struct Client *source_p, char *user_host_or_nick, luser[1] = '\0'; strlcpy(lhost, user_host_or_nick, HOSTLEN*4 + 1); } - + return 1; } else { /* Try to find user@host mask from nick */ /* Okay to use source_p as the first param, because source_p == client_p */ - if ((target_p = + if ((target_p = find_chasing(source_p, user_host_or_nick, NULL)) == NULL) return 0; diff --git a/src/conf_class.c b/src/conf_class.c index 3a5804c..6ea26e6 100644 --- a/src/conf_class.c +++ b/src/conf_class.c @@ -1,7 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ * USA */ -/*! \file +/*! \file conf_class.c * \brief Configuration managment for class{} blocks * \version $Id$ */ diff --git a/src/conf_db.c b/src/conf_db.c index cbf1770..9f5af76 100644 --- a/src/conf_db.c +++ b/src/conf_db.c @@ -1,8 +1,8 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * * Copyright (C) 1996-2009 by Andrew Church <achurch@achurch.org> - * Copyright (C) 2012 by the Hybrid Development Team. + * Copyright (c) 2012-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ * \version $Id$ */ + #include "stdinc.h" #include "conf_db.h" #include "memory.h" diff --git a/src/conf_lexer.l b/src/conf_lexer.l index 5d44df9..875959d 100644 --- a/src/conf_lexer.l +++ b/src/conf_lexer.l @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * conf_lexer.l: Scans the ircd configuration file for tokens. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file ircd_lexer.l + * \brief Scans the ircd configuration file for tokens. + * \version $Id$ */ %option case-insensitive @@ -38,7 +40,7 @@ #define YY_FATAL_ERROR(msg) conf_yy_fatal_error(msg) #define YY_INPUT(buf,result,max_size) \ if (!(result = conf_yy_input(buf, max_size))) \ - YY_FATAL_ERROR("input in flex scanner failed"); + YY_FATAL_ERROR("input in flex scanner failed"); #define MAX_INCLUDE_DEPTH 10 @@ -77,9 +79,9 @@ include \.include{WS}(\<.*\>|\".*\") %% {include} { cinclude(); } -"/*" { ccomment(); } +"/*" { ccomment(); } -\n.* { strlcpy(linebuf, yytext+1, sizeof(linebuf)); ++lineno; yyless(1); } +\n.* { strlcpy(linebuf, yytext+1, sizeof(linebuf)); ++lineno; yyless(1); } {WS} ; {COMMENT} ; @@ -101,9 +103,9 @@ include \.include{WS}(\<.*\>|\".*\") int i,j; yylval.string[yyleng-2] = '\0'; /* remove close - * quote + * quote */ - + for (j=i=0 ;yylval.string[i] != '\0'; i++,j++) { if (yylval.string[i] != '\\') @@ -113,7 +115,7 @@ include \.include{WS}(\<.*\>|\".*\") else { i++; - if (yylval.string[i] == '\0') /* XXX + if (yylval.string[i] == '\0') /* XXX * should not * happen */ @@ -338,7 +340,7 @@ unresv { return T_UNRESV; } unxline { return T_UNXLINE; } use_egd { return USE_EGD; } use_logging { return USE_LOGGING; } -user { return USER; } +user { return USER; } vhost { return VHOST; } vhost6 { return VHOST6; } wallop { return T_WALLOP; } @@ -412,7 +414,7 @@ ccomment(void) YY_FATAL_ERROR("EOF in comment"); /* XXX hack alert this disables * the stupid unused function warning - * gcc generates + * gcc generates */ if (1 == 0) yy_fatal_error("EOF in comment"); @@ -435,7 +437,7 @@ cinclude(void) /* log(L_NOTICE, "got include %s!", c); */ - /* do stacking and co. */ + /* do stacking and co. */ if (include_stack_ptr >= MAX_INCLUDE_DEPTH) ilog(LOG_TYPE_IRCD, "Includes nested too deep in %s", p); else @@ -449,7 +451,7 @@ cinclude(void) snprintf(filenamebuf, sizeof(filenamebuf), "%s/%s", ETCPATH, p); tmp_fbfile_in = fopen(filenamebuf, "r"); - + if (tmp_fbfile_in == NULL) { ilog(LOG_TYPE_IRCD, "Unable to read configuration file '%s': %s", @@ -492,7 +494,7 @@ ieof(void) yy_delete_buffer(YY_CURRENT_BUFFER); lineno = lineno_stack[include_stack_ptr]; conf_parser_ctx.conf_file = inc_fbfile_in[include_stack_ptr]; - strlcpy(conffilebuf, conffile_stack[include_stack_ptr], sizeof(conffilebuf)); + strlcpy(conffilebuf, conffile_stack[include_stack_ptr], sizeof(conffilebuf)); yy_switch_to_buffer(include_stack[include_stack_ptr]); return 0; diff --git a/src/conf_parser.y b/src/conf_parser.y index ae05fd5..c11e3b4 100644 --- a/src/conf_parser.y +++ b/src/conf_parser.y @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * conf_parser.y: Parses the ircd configuration file. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2005 by the past and present ircd coders, and others. + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,10 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ */ +/*! \file conf_parser.y + * \brief Parses the ircd configuration file. + * \version $Id$ + */ + + %{ #define YY_NO_UNPUT @@ -367,7 +370,7 @@ reset_block_state(void) %type <number> sizespec_ %% -conf: +conf: | conf conf_item ; @@ -375,7 +378,7 @@ conf_item: admin_entry | logging_entry | oper_entry | channel_entry - | class_entry + | class_entry | listen_entry | auth_entry | serverinfo_entry @@ -513,7 +516,7 @@ server_method_type_item: T_SSLV3 serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';' { #ifdef HAVE_LIBCRYPTO - if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) + if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) { if (!ServerInfo.rsa_private_key_file) { @@ -646,7 +649,7 @@ serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';' #endif }; -serverinfo_name: NAME '=' QSTRING ';' +serverinfo_name: NAME '=' QSTRING ';' { /* this isn't rehashable */ if (conf_parser_ctx.pass == 2 && !ServerInfo.name) @@ -661,7 +664,7 @@ serverinfo_name: NAME '=' QSTRING ';' } }; -serverinfo_sid: IRCD_SID '=' QSTRING ';' +serverinfo_sid: IRCD_SID '=' QSTRING ';' { /* this isn't rehashable */ if (conf_parser_ctx.pass == 2 && !ServerInfo.sid) @@ -835,7 +838,7 @@ serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';' ServerInfo.max_topic_length = $3; }; -serverinfo_hub: HUB '=' TBOOL ';' +serverinfo_hub: HUB '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ServerInfo.hub = yylval.number; @@ -850,7 +853,7 @@ admin_items: admin_items admin_item | admin_item; admin_item: admin_name | admin_description | admin_email | error ';' ; -admin_name: NAME '=' QSTRING ';' +admin_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; @@ -880,7 +883,7 @@ admin_description: DESCRIPTION '=' QSTRING ';' /*************************************************************************** * motd section ***************************************************************************/ -motd_entry: MOTD +motd_entry: MOTD { if (conf_parser_ctx.pass == 2) reset_block_state(); @@ -901,7 +904,7 @@ motd_entry: MOTD motd_items: motd_items motd_item | motd_item; motd_item: motd_mask | motd_file | error ';' ; -motd_mask: MASK '=' QSTRING ';' +motd_mask: MASK '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); @@ -1013,7 +1016,7 @@ logging_file_type_item: USER /*************************************************************************** * section oper ***************************************************************************/ -oper_entry: OPERATOR +oper_entry: OPERATOR { if (conf_parser_ctx.pass != 2) break; @@ -1438,7 +1441,7 @@ class_item: class_name | class_flags | error ';' ; -class_name: NAME '=' QSTRING ';' +class_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 1) strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); @@ -1678,7 +1681,7 @@ auth_entry: IRCD_AUTH conf_add_class_to_conf(conf, block_state.class.buf); add_conf_by_address(CONF_CLIENT, conf); } -}; +}; auth_items: auth_items auth_item | auth_item; auth_item: auth_user | auth_passwd | auth_class | auth_flags | @@ -1763,7 +1766,7 @@ auth_flags_item: SPOOF_NOTICE block_state.flags.value |= CONF_FLAGS_NEED_PASSWORD; }; -auth_spoof: SPOOF '=' QSTRING ';' +auth_spoof: SPOOF '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; @@ -2046,7 +2049,7 @@ cluster_type_item: KLINE /*************************************************************************** * section connect ***************************************************************************/ -connect_entry: CONNECT +connect_entry: CONNECT { if (conf_parser_ctx.pass != 2) @@ -2124,7 +2127,7 @@ connect_item: connect_name | connect_host | connect_vhost | connect_ssl_certificate_fingerprint | connect_aftype | connect_port | connect_ssl_cipher_list | connect_flags | connect_hub_mask | connect_leaf_mask | - connect_class | connect_encrypted | + connect_class | connect_encrypted | error ';' ; connect_name: NAME '=' QSTRING ';' @@ -2133,18 +2136,18 @@ connect_name: NAME '=' QSTRING ';' strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); }; -connect_host: HOST '=' QSTRING ';' +connect_host: HOST '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf)); }; -connect_vhost: VHOST '=' QSTRING ';' +connect_vhost: VHOST '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf)); }; - + connect_send_password: SEND_PASSWORD '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) @@ -2222,13 +2225,13 @@ connect_encrypted: ENCRYPTED '=' TBOOL ';' } }; -connect_hub_mask: HUB_MASK '=' QSTRING ';' +connect_hub_mask: HUB_MASK '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.hub.list); }; -connect_leaf_mask: LEAF_MASK '=' QSTRING ';' +connect_leaf_mask: LEAF_MASK '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.leaf.list); @@ -2279,7 +2282,7 @@ kill_entry: KILL else conf->reason = xstrdup(CONF_NOREASON); add_conf_by_address(CONF_KLINE, conf); -}; +}; kill_items: kill_items kill_item | kill_item; kill_item: kill_user | kill_reason | error; @@ -2304,7 +2307,7 @@ kill_user: USER '=' QSTRING ';' } }; -kill_reason: REASON '=' QSTRING ';' +kill_reason: REASON '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); @@ -2313,7 +2316,7 @@ kill_reason: REASON '=' QSTRING ';' /*************************************************************************** * section deny ***************************************************************************/ -deny_entry: DENY +deny_entry: DENY { if (conf_parser_ctx.pass == 2) reset_block_state(); @@ -2338,7 +2341,7 @@ deny_entry: DENY conf->reason = xstrdup(CONF_NOREASON); add_conf_by_address(CONF_DLINE, conf); } -}; +}; deny_items: deny_items deny_item | deny_item; deny_item: deny_ip | deny_reason | error; @@ -2349,7 +2352,7 @@ deny_ip: IP '=' QSTRING ';' strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); }; -deny_reason: REASON '=' QSTRING ';' +deny_reason: REASON '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); @@ -2406,13 +2409,13 @@ gecos_entry: GECOS gecos_items: gecos_items gecos_item | gecos_item; gecos_item: gecos_name | gecos_reason | error; -gecos_name: NAME '=' QSTRING ';' +gecos_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); }; -gecos_reason: REASON '=' QSTRING ';' +gecos_reason: REASON '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); @@ -2446,7 +2449,7 @@ general_item: general_hide_spoof_ips | general_ignore_bogus_ts | general_min_nonwildcard | general_min_nonwildcard_simple | general_throttle_time | general_havent_read_conf | general_ping_cookie | - general_disable_auth | + general_disable_auth | general_tkline_expire_notices | general_gline_enable | general_gline_duration | general_gline_request_duration | general_gline_min_cidr | @@ -2528,7 +2531,7 @@ general_anti_nick_flood: ANTI_NICK_FLOOD '=' TBOOL ';' general_max_nick_time: MAX_NICK_TIME '=' timespec ';' { - ConfigFileEntry.max_nick_time = $3; + ConfigFileEntry.max_nick_time = $3; }; general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';' @@ -2638,7 +2641,7 @@ general_short_motd: SHORT_MOTD '=' TBOOL ';' { ConfigFileEntry.short_motd = yylval.number; }; - + general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';' { ConfigFileEntry.no_oper_flood = yylval.number; @@ -2773,13 +2776,13 @@ umode_oitem: T_BOTS ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT; }; -general_oper_only_umodes: OPER_ONLY_UMODES +general_oper_only_umodes: OPER_ONLY_UMODES { ConfigFileEntry.oper_only_umodes = 0; } '=' umode_items ';' ; umode_items: umode_items ',' umode_item | umode_item; -umode_item: T_BOTS +umode_item: T_BOTS { ConfigFileEntry.oper_only_umodes |= UMODE_BOTS; } | T_CCONN @@ -2792,7 +2795,7 @@ umode_item: T_BOTS { ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG; } | T_FULL -{ +{ ConfigFileEntry.oper_only_umodes |= UMODE_FULL; } | T_SKILL { @@ -2944,7 +2947,7 @@ serverhide_entry: SERVERHIDE '{' serverhide_items '}' ';'; serverhide_items: serverhide_items serverhide_item | serverhide_item; -serverhide_item: serverhide_flatten_links | serverhide_disable_remote_commands | +serverhide_item: serverhide_flatten_links | serverhide_disable_remote_commands | serverhide_hide_servers | serverhide_hide_services | serverhide_links_delay | @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * dbuf.c: Supports dynamic data buffers. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file dbuf.c + * \brief Supports dynamic data buffers. + * \version $Id$ */ #include "stdinc.h" diff --git a/src/event.c b/src/event.c index c2110e4..3b93077 100644 --- a/src/event.c +++ b/src/event.c @@ -2,8 +2,8 @@ * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * event.c: Event functions. * - * Copyright (C) 1998-2000 Regents of the University of California - * Copyright (C) 2001-2002 Hybrid Development Team + * Copyright (c) 1998-2000 Regents of the University of California + * Copyright (c) 2000-2014 ircd-hybrid development team * * Code borrowed from the squid web cache by Adrian Chadd. * Original header: @@ -78,7 +78,7 @@ void eventAdd(const char *name, EVH *func, void *arg, time_t when) { int i; - + /* find first inactive index, or use next index */ for (i = 0; i < MAX_EVENTS; i++) { @@ -88,11 +88,11 @@ eventAdd(const char *name, EVH *func, void *arg, time_t when) event_table[i].name = name; event_table[i].arg = arg; event_table[i].when = CurrentTime + when; - event_table[i].frequency = when; + event_table[i].frequency = when; event_table[i].active = 1; if ((event_table[i].when < event_time_min) || (event_time_min == -1)) - event_time_min = event_table[i].when; + event_time_min = event_table[i].when; return; } @@ -122,7 +122,7 @@ eventDelete(EVH *func, void *arg) event_table[i].active = 0; } -/* +/* * void eventAddIsh(const char *name, EVH *func, void *arg, time_t delta_isa) * * Input: Name of event, function to call, arguments to pass, and frequency @@ -173,7 +173,7 @@ eventRun(void) /* * time_t eventNextTime(void) - * + * * Input: None * Output: Specifies the next time eventRun() should be run * Side Effects: None @@ -192,7 +192,7 @@ eventNextTime(void) } } - return(event_time_min); + return event_time_min; } /* @@ -200,7 +200,7 @@ eventNextTime(void) * * Input: None * Output: None - * Side Effects: Initializes the event system. + * Side Effects: Initializes the event system. */ void eventInit(void) @@ -222,14 +222,13 @@ eventFind(EVH *func, void *arg) int i; for (i = 0; i < MAX_EVENTS; i++) - { if ((event_table[i].func == func) && (event_table[i].arg == arg) && event_table[i].active) - return(i); + return i; } - return(-1); + return -1; } /* @@ -266,7 +265,7 @@ show_events(struct Client *source_p) sendto_one(source_p, ":%s %d %s : %-28s %-4d seconds", me.name, RPL_STATSDEBUG, source_p->name, event_table[i].name, - (int)(event_table[i].when - CurrentTime)); + (int)(event_table[i].when - CurrentTime)); } } } @@ -292,4 +291,3 @@ set_back_events(time_t by) event_table[i].when = 0; } } - diff --git a/src/fdlist.c b/src/fdlist.c index 4c1dd82..8dfbd2f 100644 --- a/src/fdlist.c +++ b/src/fdlist.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * fdlist.c: Maintains a list of file descriptors. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file fdlist.c + * \brief Maintains a list of file descriptors. + * \version $Id$ */ #include "stdinc.h" @@ -76,7 +78,7 @@ fdlist_init(void) static inline unsigned int hash_fd(int fd) { - return (((unsigned) fd) % FD_HASH_SIZE); + return ((unsigned int)fd) % FD_HASH_SIZE; } fde_t * @@ -87,11 +89,11 @@ lookup_fd(int fd) while (F) { if (F->fd == fd) - return (F); + return F; F = F->hnext; } - return (NULL); + return NULL; } /* Called to open a given filedescriptor */ diff --git a/src/getopt.c b/src/getopt.c index 5b863d3..f7ce7c8 100644 --- a/src/getopt.c +++ b/src/getopt.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * getopt.c: Uses getopt to fetch the command line options. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2001-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file getopt.c + * \brief Uses getopt to fetch the command line options. + * \version $Id$ */ #include "stdinc.h" @@ -65,7 +67,7 @@ parseargs(int *argc, char ***argv, struct lgetopt *opts) (*argv)[0]++; /* search through our argument list, and see if it matches */ - for (i = 0; opts[i].opt; i++) + for (i = 0; opts[i].opt; i++) { if (!strcmp(opts[i].opt, (*argv)[0])) { @@ -85,7 +87,7 @@ parseargs(int *argc, char ***argv, struct lgetopt *opts) OPTCHAR, opts[i].opt); usage((*argv)[0], opts); } - + *((int *)opts[i].argloc) = atoi((*argv)[1]); (*argc)--; (*argv)++; @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * hash.c: Maintains hashtables. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file hash.c + * \brief Hash table management. + * \version $Id$ */ #include "stdinc.h" @@ -50,7 +52,7 @@ static unsigned int hashf_xor_key = 0; /* The actual hash tables, They MUST be of the same HASHSIZE, variable * size tables could be supported but the rehash routine should also - * rebuild the transformation maps, I kept the tables of equal size + * rebuild the transformation maps, I kept the tables of equal size * so that I can use one hash function. */ static struct Client *idTable[HASHSIZE]; @@ -391,7 +393,7 @@ hash_find_server(const char *name) * * inputs - pointer to name * output - NONE - * side effects - New semantics: finds a channel whose name is 'name', + * side effects - New semantics: finds a channel whose name is 'name', * if can't find one returns NULL, if can find it moves * it to the top of the list and returns it. */ diff --git a/src/hostmask.c b/src/hostmask.c index 888ec5d..d830929 100644 --- a/src/hostmask.c +++ b/src/hostmask.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * hostmask.c: Code to efficiently find IP & hostmask based configs. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2005 by the past and present ircd coders, and others. + * Copyright (c) 2001-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file hostmask.c + * \brief Code to efficiently find IP & hostmask based configs. + * \version $Id$ */ #include "stdinc.h" @@ -51,7 +53,7 @@ * Side effects: None * Comments: Called from parse_netmask */ -/* Fixed so ::/0 (any IPv6 address) is valid +/* Fixed so ::/0 (any IPv6 address) is valid Also a bug in DigitParse above. -Gozem 2002-07-19 gozem@linux.nu */ @@ -477,7 +479,7 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ { DLINK_FOREACH(ptr, atable[hash_ipv6(addr, b)].head) { - arec = ptr->data; + arec = ptr->data; if (arec->type == (type & ~0x1) && arec->precedence > hprecv && @@ -485,8 +487,8 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ match_ipv6(addr, &arec->Mask.ipa.addr, arec->Mask.ipa.bits) && (type & 0x1 || !cmpfunc(arec->username, username)) && - (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || - match_conf_password(password, arec->conf))) + (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || + match_conf_password(password, arec->conf))) { hprecv = arec->precedence; hprec = arec->conf; @@ -510,8 +512,8 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ match_ipv4(addr, &arec->Mask.ipa.addr, arec->Mask.ipa.bits) && (type & 0x1 || !cmpfunc(arec->username, username)) && - (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || - match_conf_password(password, arec->conf))) + (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || + match_conf_password(password, arec->conf))) { hprecv = arec->precedence; hprec = arec->conf; @@ -630,7 +632,7 @@ find_dline_conf(struct irc_ssaddr *addr, int aftype) } /* void add_conf_by_address(int, struct MaskItem *aconf) - * Input: + * Input: * Output: None * Side-effects: Adds this entry to the hash table. */ @@ -737,14 +739,14 @@ delete_one_address_conf(const char *address, struct MaskItem *conf) * Output: None * Side effects: Clears out all address records in the hash table, * frees them, and frees the MaskItems if nothing references - * them, otherwise sets them as illegal. + * them, otherwise sets them as illegal. */ void clear_out_address_conf(void) { unsigned int i = 0; dlink_node *ptr = NULL, *ptr_next = NULL; - + for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH_SAFE(ptr, ptr_next, atable[i].head) @@ -788,7 +790,7 @@ hostmask_send_expiration(struct AddressRec *arec) break; default: break; } - + sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Temporary %c-line for [%s@%s] expired", ban_type, (arec->conf->user) ? arec->conf->user : "*", diff --git a/src/irc_res.c b/src/irc_res.c index c7577c3..241cba4 100644 --- a/src/irc_res.c +++ b/src/irc_res.c @@ -1,4 +1,30 @@ /* + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) + * + * Copyright (c) 1997-2014 ircd-hybrid development team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +/*! \file irc_res.c + * \brief ircd resolver functions + * \version $Id$ + */ + +/* * A rewrite of Darren Reeds original res.c As there is nothing * left of Darrens original code, this is now licensed by the hybrid group. * (Well, some of the function names are the same, and bits of the structs..) @@ -14,7 +40,7 @@ * --Bleep (Thomas Helvey <tomh@inxpress.net>) * * This was all needlessly complicated for irc. Simplified. No more hostent - * All we really care about is the IP -> hostname mappings. Thats all. + * All we really care about is the IP -> hostname mappings. Thats all. * * Apr 28, 2003 --cryogen and Dianora */ @@ -38,7 +64,7 @@ #include "irc_reslib.h" #if (CHAR_BIT != 8) -#error this code needs to be able to address individual octets +#error this code needs to be able to address individual octets #endif static PF res_readreply; @@ -58,7 +84,7 @@ static PF res_readreply; #define RDLENGTH_SIZE (size_t)2 #define ANSWER_FIXED_SIZE (TYPE_SIZE + CLASS_SIZE + TTL_SIZE + RDLENGTH_SIZE) -typedef enum +typedef enum { REQ_IDLE, /* We're doing not much at all */ REQ_PTR, /* Looking up a PTR */ @@ -69,7 +95,7 @@ typedef enum REQ_CNAME /* We got a CNAME in response, we better get a real answer next */ } request_state; -struct reslist +struct reslist { dlink_node node; int id; @@ -118,14 +144,14 @@ static struct reslist *find_id(int); * revised for ircd, cryogen(stu) may03 */ static int -res_ourserver(const struct irc_ssaddr *inp) +res_ourserver(const struct irc_ssaddr *inp) { #ifdef IPV6 const struct sockaddr_in6 *v6; const struct sockaddr_in6 *v6in = (const struct sockaddr_in6 *)inp; #endif const struct sockaddr_in *v4; - const struct sockaddr_in *v4in = (const struct sockaddr_in *)inp; + const struct sockaddr_in *v4in = (const struct sockaddr_in *)inp; int ns; for (ns = 0; ns < irc_nscount; ++ns) @@ -166,7 +192,7 @@ res_ourserver(const struct irc_ssaddr *inp) } /* - * timeout_query_list - Remove queries from the list which have been + * timeout_query_list - Remove queries from the list which have been * there too long without being resolved. */ static time_t @@ -260,8 +286,8 @@ restart_resolver(void) } /* - * rem_request - remove a request from the list. - * This must also free any memory that has been allocated for + * rem_request - remove a request from the list. + * This must also free any memory that has been allocated for * temporary storage of DNS results. */ static void @@ -295,7 +321,7 @@ make_request(dns_callback_fnc callback, void *ctx) } /* - * delete_resolver_queries - cleanup outstanding queries + * delete_resolver_queries - cleanup outstanding queries * for which there no longer exist clients or conf lines. */ void @@ -316,7 +342,7 @@ delete_resolver_queries(const void *vptr) * send_res_msg - sends msg to all nameservers found in the "_res" structure. * This should reflect /etc/resolv.conf. We will get responses * which arent needed but is easier than checking to see if nameserver - * isnt present. Returns number of messages successfully sent to + * isnt present. Returns number of messages successfully sent to * nameservers or -1 if no successful sends. */ static int @@ -334,9 +360,9 @@ send_res_msg(const char *msg, int len, int rcount) for (i = 0; i < max_queries; i++) { - if (sendto(ResolverFileDescriptor.fd, msg, len, 0, - (struct sockaddr*)&(irc_nsaddr_list[i]), - irc_nsaddr_list[i].ss_len) == len) + if (sendto(ResolverFileDescriptor.fd, msg, len, 0, + (struct sockaddr*)&(irc_nsaddr_list[i]), + irc_nsaddr_list[i].ss_len) == len) ++sent; } @@ -362,7 +388,7 @@ find_id(int id) return NULL; } -/* +/* * gethost_byname_type - get host address from name * */ @@ -494,7 +520,7 @@ query_name(const char *name, int query_class, int type, memset(buf, 0, sizeof(buf)); - if ((request_len = irc_res_mkquery(name, query_class, type, + if ((request_len = irc_res_mkquery(name, query_class, type, (unsigned char *)buf, sizeof(buf))) > 0) { HEADER *header = (HEADER *)buf; @@ -603,8 +629,8 @@ proc_answer(struct reslist *request, HEADER *header, char *buf, char *eob) rd_length = irc_ns_get16(current); current += RDLENGTH_SIZE; - /* - * Wait to set request->type until we verify this structure + /* + * Wait to set request->type until we verify this structure */ switch (type) { @@ -651,9 +677,9 @@ proc_answer(struct reslist *request, HEADER *header, char *buf, char *eob) strlcpy(request->name, hostbuf, HOSTLEN + 1); return 1; break; - case T_CNAME: /* first check we already havent started looking + case T_CNAME: /* first check we already havent started looking into a cname */ - if (request->type != T_PTR) + if (request->type != T_PTR) return 0; if (request->state == REQ_CNAME) @@ -669,7 +695,7 @@ proc_answer(struct reslist *request, HEADER *header, char *buf, char *eob) request->state = REQ_CNAME; current += rd_length; break; - + default: /* XXX I'd rather just throw away the entire bogus thing * but its possible its just a broken nameserver with still @@ -690,13 +716,13 @@ static void res_readreply(fde_t *fd, void *data) { char buf[sizeof(HEADER) + MAXPACKET] - /* Sparc and alpha need 16bit-alignment for accessing header->id - * (which is uint16_t). Because of the header = (HEADER*) buf; + /* Sparc and alpha need 16bit-alignment for accessing header->id + * (which is uint16_t). Because of the header = (HEADER*) buf; * lateron, this is neeeded. --FaUl */ -#if defined(__sparc__) || defined(__alpha__) +#if defined(__sparc__) || defined(__alpha__) __attribute__((aligned (16))) -#endif +#endif ; HEADER *header; struct reslist *request = NULL; @@ -751,7 +777,7 @@ res_readreply(fde_t *fd, void *data) #ifdef IPV6 else { - /* + /* * If we havent already tried this, and we're looking up AAAA, try A * now */ @@ -767,7 +793,7 @@ res_readreply(fde_t *fd, void *data) } /* - * If this fails there was an error decoding the received packet, + * If this fails there was an error decoding the received packet, * try it again and hope it works the next time. */ if (proc_answer(request, header, buf, buf + rc)) @@ -787,7 +813,7 @@ res_readreply(fde_t *fd, void *data) /* * Lookup the 'authoritative' name that we were given for the - * ip#. + * ip#. * */ #ifdef IPV6 @@ -831,6 +857,6 @@ report_dns_servers(struct Client *source_p) irc_nsaddr_list[i].ss_len, ipaddr, sizeof(ipaddr), NULL, 0, NI_NUMERICHOST); sendto_one(source_p, form_str(RPL_STATSALINE), - me.name, source_p->name, ipaddr); + me.name, source_p->name, ipaddr); } } diff --git a/src/irc_string.c b/src/irc_string.c index 1dd1ba7..3ad8f93 100644 --- a/src/irc_string.c +++ b/src/irc_string.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * irc_string.c: IRC string functions. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file irc_string.c + * \brief IRC string functions. + * \version $Id$ */ #include "config.h" @@ -56,7 +58,7 @@ has_wildcards(const char *str) * might break things in other places...) * * - * Thu Nov 24 18:22:48 1986 + * Thu Nov 24 18:22:48 1986 */ const char * myctime(time_t value) @@ -98,7 +100,6 @@ strip_tabs(char *dest, const char *src, size_t len) * */ #ifndef HAVE_STRTOK_R - char * strtoken(char** save, char* str, const char* fs) { @@ -150,7 +151,7 @@ libio_basename(const char *path) /* * strlcat and strlcpy were ripped from openssh 2.5.1p2 - * They had the following Copyright info: + * They had the following Copyright info: * * * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> @@ -161,9 +162,9 @@ libio_basename(const char *path) * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * @@ -178,7 +179,7 @@ libio_basename(const char *path) * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + #ifndef HAVE_STRLCAT size_t strlcat(char *dst, const char *src, size_t siz) @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * ircd.c: Starts up and runs the ircd. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file ircd.c + * \brief Starts up and runs the ircd. + * \version $Id$ */ #include "stdinc.h" @@ -139,25 +141,25 @@ make_daemon(void) static int printVersion = 0; static struct lgetopt myopts[] = { - {"configfile", &ConfigFileEntry.configfile, + {"configfile", &ConfigFileEntry.configfile, STRING, "File to use for ircd.conf"}, {"glinefile", &ConfigFileEntry.glinefile, STRING, "File to use for gline database"}, - {"klinefile", &ConfigFileEntry.klinefile, + {"klinefile", &ConfigFileEntry.klinefile, STRING, "File to use for kline database"}, {"dlinefile", &ConfigFileEntry.dlinefile, STRING, "File to use for dline database"}, - {"xlinefile", &ConfigFileEntry.xlinefile, + {"xlinefile", &ConfigFileEntry.xlinefile, STRING, "File to use for xline database"}, {"resvfile", &ConfigFileEntry.resvfile, STRING, "File to use for resv database"}, - {"logfile", &logFileName, + {"logfile", &logFileName, STRING, "File to use for ircd.log"}, {"pidfile", &pidFileName, STRING, "File to use for process ID"}, - {"foreground", &server_state.foreground, + {"foreground", &server_state.foreground, YESNO, "Run in foreground (don't detach)"}, - {"version", &printVersion, + {"version", &printVersion, YESNO, "Print version and exit"}, {"help", NULL, USAGE, "Print this text"}, {NULL, NULL, STRING, NULL}, @@ -201,7 +203,7 @@ io_loop(void) { /* * Maybe we want a flags word? - * ie. if (REHASHED_KLINES(global_flags)) + * ie. if (REHASHED_KLINES(global_flags)) * SET_REHASHED_KLINES(global_flags) * CLEAR_REHASHED_KLINES(global_flags) * @@ -254,7 +256,7 @@ io_loop(void) * * inputs - none * output - none - * side effects - This sets all global set options needed + * side effects - This sets all global set options needed */ static void initialize_global_set_options(void) @@ -592,7 +594,7 @@ main(int argc, char *argv[]) hash_add_id(&me); hash_add_client(&me); - + /* add ourselves to global_serv_list */ dlinkAdd(&me, make_dlink_node(), &global_serv_list); @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * list.c: Various assorted functions for various structures. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,14 +17,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file list.c + * \brief Maintains doubly-linked lists. + * \version $Id$ */ #include "stdinc.h" #include "list.h" #include "mempool.h" + static mp_pool_t *dnode_pool; @@ -60,7 +63,7 @@ make_dlink_node(void) * * inputs - pointer to dlink_node * output - NONE - * side effects - free given dlink_node + * side effects - free given dlink_node */ void free_dlink_node(dlink_node *ptr) diff --git a/src/listener.c b/src/listener.c index 9b4d681..3dea831 100644 --- a/src/listener.c +++ b/src/listener.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * listener.c: Listens on a port. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1999-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file listener.c + * \brief Implementation for handling listening sockets. + * \version $Id$ */ #include "stdinc.h" @@ -81,7 +83,7 @@ get_listener_name(const struct Listener *const listener) * output - none * side effects - send port listing to a client */ -void +void show_ports(struct Client *source_p) { char buf[IRCD_BUFSIZE]; @@ -135,7 +137,7 @@ show_ports(struct Client *source_p) #define HYBRID_SOMAXCONN SOMAXCONN #endif -static int +static int inetport(struct Listener *listener) { struct irc_ssaddr lsin; @@ -225,7 +227,7 @@ find_listener(int port, struct irc_ssaddr *addr) * vhost_ip - if non-null must contain a valid IP address string in * the format "255.255.255.255" */ -void +void add_listener(int port, const char *vhost_ip, unsigned int flags) { struct Listener *listener; @@ -343,7 +345,7 @@ close_listener(struct Listener *listener) /* * close_listeners - close and free all listeners that are not being used */ -void +void close_listeners(void) { dlink_node *ptr = NULL, *next_ptr = NULL; @@ -356,7 +358,7 @@ close_listeners(void) #define TOOFAST_WARNING "ERROR :Trying to reconnect too fast.\r\n" #define DLINE_WARNING "ERROR :You have been D-lined.\r\n" -static void +static void accept_connection(fde_t *pfd, void *data) { static time_t last_oper_notice = 0; @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * log.c: Logger functions. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,12 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ */ -#include "stdinc.h" +/*! \file log.c + * \brief Logger functions. + * \version $Id$ + */ +#include "stdinc.h" #include "log.h" #include "irc_string.h" #include "ircd.h" @@ -31,7 +32,8 @@ #include "s_misc.h" -static struct { +static struct +{ char path[HYB_PATH_MAX + 1]; size_t size; FILE *file; @@ -89,7 +91,7 @@ log_exceed_size(unsigned int type) return (size_t)sb.st_size > log_type_table[type].size; } -static void +static void log_write(enum log_type type, const char *message) { char buf[IRCD_BUFSIZE]; diff --git a/src/match.c b/src/match.c index dc94acf..d405499 100644 --- a/src/match.c +++ b/src/match.c @@ -1,23 +1,27 @@ -/************************************************************************ - * IRC - Internet Relay Chat, src/match.c - * Copyright (C) 1990 Jarkko Oikarinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 1, or (at your option) - * any later version. +/* + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Copyright (c) 1997-2014 ircd-hybrid development team * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * $Id$ + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +/*! \file match.c + * \brief Functions to match/compare strings. + * \version $Id$ */ #include "stdinc.h" @@ -190,7 +194,7 @@ irccmp(const char *s1, const char *s2) assert(s1 != NULL); assert(s2 != NULL); - + for (; ToUpper(*str1) == ToUpper(*str2); ++str1, ++str2) if (*str1 == '\0') return 0; @@ -218,7 +222,8 @@ ircncmp(const char *s1, const char *s2, size_t n) return 1; } -const unsigned char ToLowerTab[] = { +const unsigned char ToLowerTab[] = +{ 0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, @@ -253,7 +258,8 @@ const unsigned char ToLowerTab[] = { 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -const unsigned char ToUpperTab[] = { +const unsigned char ToUpperTab[] = +{ 0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, @@ -285,7 +291,7 @@ const unsigned char ToUpperTab[] = { 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, - 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff + 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; /* @@ -294,7 +300,8 @@ const unsigned char ToUpperTab[] = { * NOTE: RFC 1459 sez: anything but a ^G, comma, or space is allowed * for channel names */ -const unsigned int CharAttrs[] = { +const unsigned int CharAttrs[] = +{ /* 0 */ CNTRL_C, /* 1 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 2 */ CNTRL_C|CHAN_C|NONEOS_C, diff --git a/src/memory.c b/src/memory.c index 0e6ce5f..e7ecefa 100644 --- a/src/memory.c +++ b/src/memory.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * memory.c: Memory utilities. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,10 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ */ +/*! \file memory.c + * \brief Memory utilities. + * \version $Id$ + */ #include "stdinc.h" #include "ircd_defs.h" diff --git a/src/mempool.c b/src/mempool.c index b861562..bd62e49 100644 --- a/src/mempool.c +++ b/src/mempool.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2007-2012, The Tor Project, Inc. + * Copyright (c) 2012-2014 ircd-hybrid development team * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/src/modules.c b/src/modules.c index 37b0151..3b5bed0 100644 --- a/src/modules.c +++ b/src/modules.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * modules.c: A module loader. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file modules.c + * \brief A module loader. + * \version $Id$ */ #include "ltdl.h" @@ -1,8 +1,8 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2000 Kevin L. Mitchell <klmitch@mit.edu> - * Copyright (C) 2013 by the Hybrid Development Team. + * Copyright (c) 2000 Kevin L. Mitchell <klmitch@mit.edu> + * Copyright (c) 2013-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/packet.c b/src/packet.c index 82c0a17..c31a616 100644 --- a/src/packet.c +++ b/src/packet.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * packet.c: Packet handlers. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,9 +17,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ */ + +/*! \file packet.c + * \brief Packet handlers. + * \version $Id$ + */ + #include "stdinc.h" #include "list.h" #include "s_bsd.h" @@ -116,7 +119,7 @@ extract_one_line(struct dbuf_queue *qptr, char *buffer) */ static void parse_client_queued(struct Client *client_p) -{ +{ int dolen = 0; int checkflood = 1; struct LocalUser *lclient_p = client_p->localClient; @@ -125,10 +128,10 @@ parse_client_queued(struct Client *client_p) { int i = 0; - for(;;) + for (; ;) { if (IsDefunct(client_p)) - return; + return; /* rate unknown clients at MAX_FLOOD per loop */ if (i >= MAX_FLOOD) @@ -136,7 +139,7 @@ parse_client_queued(struct Client *client_p) dolen = extract_one_line(&lclient_p->buf_recvq, readBuf); if (dolen == 0) - break; + break; client_dopacket(client_p, readBuf, dolen); i++; @@ -176,10 +179,10 @@ parse_client_queued(struct Client *client_p) * messages in this loop, we simply drop out of the loop prematurely. * -- adrian */ - for (;;) + for (; ;) { if (IsDefunct(client_p)) - break; + break; /* This flood protection works as follows: * @@ -199,7 +202,7 @@ parse_client_queued(struct Client *client_p) if(lclient_p->sent_parsed >= lclient_p->allow_read) break; } - + /* allow opers 4 times the amount of messages as users. why 4? * why not. :) --fl_ */ @@ -246,7 +249,7 @@ flood_recalc(fde_t *fd, void *data) { struct Client *client_p = data; struct LocalUser *lclient_p = client_p->localClient; - + /* allow a bursting client their allocation per second, allow * a client whos flooding an extra 2 per second */ @@ -254,12 +257,12 @@ flood_recalc(fde_t *fd, void *data) lclient_p->sent_parsed -= 2; else lclient_p->sent_parsed = 0; - + if (lclient_p->sent_parsed < 0) lclient_p->sent_parsed = 0; - + parse_client_queued(client_p); - + /* And now, try flushing .. */ if (!IsDead(client_p)) { @@ -285,7 +288,8 @@ read_packet(fde_t *fd, void *data) * I personally think it makes the code too hairy to make sane. * -- adrian */ - do { + do + { #ifdef HAVE_LIBCRYPTO if (fd->ssl) { @@ -379,13 +383,13 @@ read_packet(fde_t *fd, void *data) static void client_dopacket(struct Client *client_p, char *buffer, size_t length) { - /* + /* * Update messages received */ ++me.localClient->recv.messages; ++client_p->localClient->recv.messages; - /* + /* * Update bytes received */ client_p->localClient->recv.bytes += length; diff --git a/src/parse.c b/src/parse.c index 82175de..54ac137 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * parse.c: The message parser. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file parse.c + * \brief The message parser. + * \version $Id$ */ #include "stdinc.h" @@ -37,6 +39,7 @@ #include "s_user.h" #include "s_serv.h" + /* * (based on orabidoo's parser code) * @@ -51,7 +54,7 @@ * 't' points -> [MessageTree *] 'r' -> [MessageTree *] -> 'i' * -> [MessageTree *] -> [MessageTree *] -> 'e' and matches * - * 'i' -> [MessageTree *] -> 'e' and matches + * 'i' -> [MessageTree *] -> 'e' and matches * * BUGS (Limitations!) * @@ -210,7 +213,7 @@ parse(struct Client *client_p, char *pbuffer, char *bufend) if ((msg_ptr = find_command(ch)) == NULL) { - /* + /* * Note: Give error message *only* to recognized * persons. It's a nightmare situation to have * two programs sending "Unknown command"'s or diff --git a/src/restart.c b/src/restart.c index eb46fff..4701e6f 100644 --- a/src/restart.c +++ b/src/restart.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * restart.c: Functions to allow the ircd to restart. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file restart.c + * \brief Functions to allow the ircd to restart. + * \version $Id$ */ #include "stdinc.h" @@ -30,7 +32,7 @@ #include "irc_string.h" #include "send.h" #include "log.h" -#include "client.h" /* for UMODE_ALL */ +#include "client.h" #include "memory.h" #include "conf_db.h" @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * resv.c: Functions to reserve(jupe) a nick/channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2001-2002 Hybrid Development Team + * Copyright (c) 2001-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,15 +17,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file resv.c + * \brief Functions to reserve(jupe) a nick/channel. + * \version $Id$ */ #include "stdinc.h" #include "list.h" #include "ircd.h" #include "send.h" -#include "client.h" +#include "client.h" #include "memory.h" #include "numeric.h" #include "resv.h" @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * rsa.c: Functions for use with RSA public key cryptography. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file rsa.c + * \brief Functions for use with RSA public key cryptography. + * \version $Id$ */ #include "stdinc.h" diff --git a/src/s_auth.c b/src/s_auth.c index af6defb..157e9b0 100644 --- a/src/s_auth.c +++ b/src/s_auth.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_auth.c: Functions for querying a users ident. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_auth.c + * \brief Functions for querying a users ident. + * \version $Id$ */ /* @@ -52,7 +54,8 @@ #include "mempool.h" -static const char *HeaderMessages[] = { +static const char *HeaderMessages[] = +{ ":%s NOTICE AUTH :*** Looking up your hostname...", ":%s NOTICE AUTH :*** Found your hostname", ":%s NOTICE AUTH :*** Couldn't look up your hostname", @@ -63,7 +66,8 @@ static const char *HeaderMessages[] = { ":%s NOTICE AUTH :*** Your hostname is too long, ignoring hostname" }; -enum { +enum +{ REPORT_DO_DNS, REPORT_FIN_DNS, REPORT_FAIL_DNS, @@ -142,7 +146,7 @@ release_auth_client(struct AuthRequest *auth) read_packet(&client->localClient->fd, client); } - + /* * auth_dns_callback - called when resolver query finishes * if the query resulted in a successful search, name will contain @@ -190,7 +194,7 @@ auth_dns_callback(void *vptr, const struct irc_ssaddr *addr, const char *name) if (good && strlen(name) <= HOSTLEN) { strlcpy(auth->client->host, name, - sizeof(auth->client->host)); + sizeof(auth->client->host)); sendheader(auth->client, REPORT_FIN_DNS); } else if (strlen(name) > HOSTLEN) @@ -220,7 +224,7 @@ auth_error(struct AuthRequest *auth) } /* - * start_auth_query - Flag the client to show that an attempt to + * start_auth_query - Flag the client to show that an attempt to * contact the ident server on * the client's host. The connect and subsequently the socket are all put * into 'non-blocking' mode. Should the connect or any later phase of the @@ -242,8 +246,8 @@ start_auth_query(struct AuthRequest *auth) if (comm_open(&auth->fd, auth->client->localClient->ip.ss.ss_family, SOCK_STREAM, 0, "ident") == -1) { - report_error(L_ALL, "creating auth stream socket %s:%s", - get_client_name(auth->client, SHOW_IP), errno); + report_error(L_ALL, "creating auth stream socket %s:%s", + get_client_name(auth->client, SHOW_IP), errno); ilog(LOG_TYPE_IRCD, "Unable to create auth socket for %s", get_client_name(auth->client, SHOW_IP)); ++ServerStats.is_abad; @@ -252,7 +256,7 @@ start_auth_query(struct AuthRequest *auth) sendheader(auth->client, REPORT_DO_ID); - /* + /* * get the local address of the client and bind to that to * make the auth request. This used to be done only for * ifdef VIRTUAL_HOST, but needs to be done for all clients @@ -274,16 +278,16 @@ start_auth_query(struct AuthRequest *auth) #endif localaddr.ss_port = htons(0); - comm_connect_tcp(&auth->fd, auth->client->sockhost, 113, - (struct sockaddr *)&localaddr, localaddr.ss_len, auth_connect_callback, - auth, auth->client->localClient->ip.ss.ss_family, + comm_connect_tcp(&auth->fd, auth->client->sockhost, 113, + (struct sockaddr *)&localaddr, localaddr.ss_len, auth_connect_callback, + auth, auth->client->localClient->ip.ss.ss_family, GlobalSetOptions.ident_timeout); return 1; /* We suceed here for now */ } /* * GetValidIdent - parse ident query reply from identd server - * + * * Inputs - pointer to ident buf * Output - NULL if no valid ident found, otherwise pointer to name * Side effects - @@ -316,7 +320,7 @@ GetValidIdent(char *buf) /* All this to get rid of a sscanf() fun. */ remotePortString = buf; - + if ((colon1Ptr = strchr(remotePortString,':')) == NULL) return 0; *colon1Ptr = '\0'; @@ -326,7 +330,7 @@ GetValidIdent(char *buf) return 0; *colon2Ptr = '\0'; colon2Ptr++; - + if ((commaPtr = strchr(remotePortString, ',')) == NULL) return 0; *commaPtr = '\0'; @@ -334,7 +338,7 @@ GetValidIdent(char *buf) if ((remp = atoi(remotePortString)) == 0) return 0; - + if ((locp = atoi(commaPtr)) == 0) return 0; @@ -350,13 +354,13 @@ GetValidIdent(char *buf) } /* - * start_auth + * start_auth * * inputs - pointer to client to auth * output - NONE * side effects - starts auth (identd) and dns queries for a client */ -void +void start_auth(struct Client *client) { struct AuthRequest *auth = NULL; @@ -396,7 +400,7 @@ timeout_auth_queries_event(void *notused) continue; if (IsDoingAuth(auth)) - { + { ++ServerStats.is_abad; fd_close(&auth->fd); ClearAuth(auth); @@ -475,7 +479,7 @@ auth_connect_callback(fde_t *fd, int error, void *data) us.ss_len = ulen; them.ss_len = tlen; #endif - + snprintf(authbuf, sizeof(authbuf), "%u , %u\r\n", tport, uport); if (send(fd->fd, authbuf, strlen(authbuf), 0) == -1) @@ -488,7 +492,7 @@ auth_connect_callback(fde_t *fd, int error, void *data) } /* - * read_auth_reply - read the reply (if any) from the ident server + * read_auth_reply - read the reply (if any) from the ident server * we connected to. * We only give it one shot, if the reply isn't good the first time * fail the authentication entirely. --Bleep @@ -575,7 +579,7 @@ read_auth_reply(fde_t *fd, void *data) /* * delete_auth() */ -void +void delete_auth(struct AuthRequest *auth) { if (IsDNSPending(auth)) diff --git a/src/s_bsd.c b/src/s_bsd.c index 5efb317..cace7a5 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_bsd.c: Network functions. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_bsd.c + * \brief Network functions. + * \version $Id$ */ #include "stdinc.h" @@ -104,7 +106,7 @@ get_sockerr(int fd) } /* - * report_error - report an error from an errno. + * report_error - report an error from an errno. * Record error to log and also send a copy to all *LOCAL* opers online. * * text is a *format* string for outputing error. It must @@ -118,12 +120,12 @@ get_sockerr(int fd) * Cannot use perror() within daemon. stderr is closed in * ircd and cannot be used. And, worse yet, it might have * been reassigned to a normal connection... - * + * * Actually stderr is still there IFF ircd was run with -s --Rodder */ void -report_error(int level, const char* text, const char* who, int error) +report_error(int level, const char* text, const char* who, int error) { who = (who) ? who : ""; @@ -219,7 +221,7 @@ close_connection(struct Client *client_p) dbuf_clear(&client_p->localClient->buf_sendq); dbuf_clear(&client_p->localClient->buf_recvq); - + MyFree(client_p->localClient->passwd); detach_conf(client_p, CONF_CLIENT|CONF_OPER|CONF_SERVER); client_p->from = NULL; /* ...this should catch them! >:) --msa */ @@ -248,17 +250,17 @@ ssl_handshake(int fd, struct Client *client_p) { case SSL_ERROR_WANT_WRITE: comm_setselect(&client_p->localClient->fd, COMM_SELECT_WRITE, - (PF *) ssl_handshake, client_p, 30); + (PF *)ssl_handshake, client_p, 30); return; case SSL_ERROR_WANT_READ: comm_setselect(&client_p->localClient->fd, COMM_SELECT_READ, - (PF *) ssl_handshake, client_p, 30); + (PF *)ssl_handshake, client_p, 30); return; default: exit_client(client_p, client_p, "Error during SSL handshake"); - return; + return; } } @@ -294,7 +296,7 @@ ssl_handshake(int fd, struct Client *client_p) #endif /* - * add_connection - creates a client which has just connected to us on + * add_connection - creates a client which has just connected to us on * the given fd. The sockhost field is initialized with the ip# of the host. * An unique id is calculated now, in case it is needed for auth. * The client is sent to the auth module for verification, and not put in @@ -307,7 +309,7 @@ add_connection(struct Listener *listener, struct irc_ssaddr *irn, int fd) fd_open(&new_client->localClient->fd, fd, 1, (listener->flags & LISTENER_SSL) ? - "Incoming SSL connection" : "Incoming connection"); + "Incoming SSL connection" : "Incoming connection"); /* * copy address to 'sockhost' as a string, copy it to host too @@ -316,7 +318,7 @@ add_connection(struct Listener *listener, struct irc_ssaddr *irn, int fd) memcpy(&new_client->localClient->ip, irn, sizeof(struct irc_ssaddr)); getnameinfo((struct sockaddr *)&new_client->localClient->ip, - new_client->localClient->ip.ss_len, new_client->sockhost, + new_client->localClient->ip.ss_len, new_client->sockhost, sizeof(new_client->sockhost), NULL, 0, NI_NUMERICHOST); new_client->localClient->aftype = new_client->localClient->ip.ss.ss_family; @@ -416,7 +418,7 @@ comm_settimeout(fde_t *fd, time_t timeout, PF *callback, void *cbdata) * flush functions, and when comm_close() is implemented correctly * with close functions, we _actually_ don't call comm_close() here .. * -- originally Adrian's notes - * comm_close() is replaced with fd_close() in fdlist.c + * comm_close() is replaced with fd_close() in fdlist.c */ void comm_setflush(fde_t *fd, time_t timeout, PF *callback, void *cbdata) @@ -508,7 +510,7 @@ comm_connect_tcp(fde_t *fd, const char *host, unsigned short port, * -- adrian */ if ((clocal != NULL) && (bind(fd->fd, clocal, socklen) < 0)) - { + { /* Failure, call the callback with COMM_ERR_BIND */ comm_connect_callback(fd, COMM_ERR_BIND); /* ... and quit */ @@ -605,7 +607,7 @@ comm_connect_dns_callback(void *vptr, const struct irc_ssaddr *addr, const char /* Copy over the DNS reply info so we can use it in the connect() */ /* * Note we don't fudge the refcount here, because we aren't keeping - * the DNS record around, and the DNS cache is gone anyway.. + * the DNS record around, and the DNS cache is gone anyway.. * -- adrian */ memcpy(&F->connect.hostaddr, addr, addr->ss_len); @@ -636,7 +638,7 @@ comm_connect_tryconnect(fde_t *fd, void *notused) return; /* Try the connect() */ - retval = connect(fd->fd, (struct sockaddr *) &fd->connect.hostaddr, + retval = connect(fd->fd, (struct sockaddr *) &fd->connect.hostaddr, fd->connect.hostaddr.ss_len); /* Error? */ @@ -749,11 +751,11 @@ comm_accept(struct Listener *lptr, struct irc_ssaddr *pn) return newfd; } -/* +/* * remove_ipv6_mapping() - Removes IPv4-In-IPv6 mapping from an address * OSes with IPv6 mapping listening on both * AF_INET and AF_INET6 map AF_INET connections inside AF_INET6 structures - * + * */ #ifdef IPV6 void @@ -763,7 +765,7 @@ remove_ipv6_mapping(struct irc_ssaddr *addr) { if (IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)addr)->sin6_addr)) { - struct sockaddr_in6 v6; + struct sockaddr_in6 v6; struct sockaddr_in *v4 = (struct sockaddr_in *)addr; memcpy(&v6, addr, sizeof(v6)); @@ -773,10 +775,10 @@ remove_ipv6_mapping(struct irc_ssaddr *addr) addr->ss.ss_family = AF_INET; addr->ss_len = sizeof(struct sockaddr_in); } - else + else addr->ss_len = sizeof(struct sockaddr_in6); } else addr->ss_len = sizeof(struct sockaddr_in); -} +} #endif diff --git a/src/s_bsd_devpoll.c b/src/s_bsd_devpoll.c index 866b9b3..85b69a3 100644 --- a/src/s_bsd_devpoll.c +++ b/src/s_bsd_devpoll.c @@ -1,9 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_bsd_devpoll.c: /dev/poll compatible network routines. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Originally by Adrian Chadd <adrian@creative.net.au> - * Copyright (C) 2002 Hybrid Development Team + * Copyright (c) 2001-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_bsd_devpoll.c + * \brief /dev/poll compatible network routines. + * \version $Id$ */ #include "stdinc.h" @@ -179,7 +180,7 @@ comm_select(void) if ((dopoll.dp_fds[i].revents & POLLOUT)) { - if ((hdl = F->write_handler) != NULL) + if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; hdl(F, F->write_data); diff --git a/src/s_bsd_epoll.c b/src/s_bsd_epoll.c index 09c0f69..285f840 100644 --- a/src/s_bsd_epoll.c +++ b/src/s_bsd_epoll.c @@ -1,9 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_bsd_epoll.c: Linux epoll() compatible network routines. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002-2005 Hybrid Development Team - * Based also on work of Adrian Chadd, Aaron Sethman and others. + * Copyright (c) 2005-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_bsd_epoll.c + * \brief Linux epoll() compatible network routines. + * \version $Id$ */ #include "stdinc.h" diff --git a/src/s_bsd_kqueue.c b/src/s_bsd_kqueue.c index 5d8dbed..ab04b0f 100644 --- a/src/s_bsd_kqueue.c +++ b/src/s_bsd_kqueue.c @@ -1,9 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_bsd_kqueue.c: FreeBSD kqueue compatible network routines. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Originally by Adrian Chadd <adrian@creative.net.au> - * Copyright (C) 2005 Hybrid Development Team + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_bsd_kqueue.c + * \brief kqueue() compatible network routines. + * \version $Id$ */ #include "stdinc.h" diff --git a/src/s_bsd_poll.c b/src/s_bsd_poll.c index f33af38..cd0bf0c 100644 --- a/src/s_bsd_poll.c +++ b/src/s_bsd_poll.c @@ -1,9 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_bsd_poll.c: POSIX poll() compatible network routines. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Originally by Adrian Chadd <adrian@creative.net.au> - * Copyright (C) 2002 Hybrid Development Team + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_bsd_poll.c + * \brief POSIX poll() compatible network routines. + * \version $Id$ */ #include "stdinc.h" @@ -93,7 +94,7 @@ poll_findslot(void) void comm_setselect(fde_t *F, unsigned int type, PF *handler, void *client_data, time_t timeout) -{ +{ int new_events; if ((type & COMM_SELECT_READ)) @@ -147,7 +148,7 @@ comm_setselect(fde_t *F, unsigned int type, PF *handler, F->evcache = new_events; } } - + /* * comm_select * diff --git a/src/s_bsd_select.c b/src/s_bsd_select.c index 7aa4e30..c797d8d 100644 --- a/src/s_bsd_select.c +++ b/src/s_bsd_select.c @@ -1,9 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_bsd_select.c: select() compatible network routines. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Originally by Adrian Chadd <adrian@creative.net.au> - * Copyright (C) 2002 Hybrid Development Team + * Copyright (c) 2000-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_bsd_select.c + * \brief select() compatible network routines. + * \version $Id$ */ #include "stdinc.h" diff --git a/src/s_gline.c b/src/s_gline.c index c6f7c00..0d788b4 100644 --- a/src/s_gline.c +++ b/src/s_gline.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_gline.c: GLine global ban functions. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_gline.c + * \brief GLine global ban functions. + * \version $Id$ */ #include "stdinc.h" diff --git a/src/s_misc.c b/src/s_misc.c index 818d93d..005fac8 100644 --- a/src/s_misc.c +++ b/src/s_misc.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_misc.c: Yet another miscellaneous functions file. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_misc.c + * \brief Yet another miscellaneous functions file. + * \version $Id$ */ #include "stdinc.h" @@ -51,14 +53,14 @@ static const char *const weekdays[] = }; const char * -date(time_t lclock) +date(time_t lclock) { static char buf[80], plus; struct tm *lt, *gm; struct tm gmbuf; int minswest; - if (!lclock) + if (!lclock) lclock = CurrentTime; gm = gmtime(&lclock); memcpy(&gmbuf, gm, sizeof(gmbuf)); @@ -103,9 +105,9 @@ smalldate(time_t lclock) gm = gmtime(&lclock); memcpy(&gmbuf, gm, sizeof(gmbuf)); - gm = &gmbuf; + gm = &gmbuf; lt = localtime(&lclock); - + snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d", lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min); @@ -124,7 +126,6 @@ ssl_get_cipher(const SSL *ssl) snprintf(buffer, sizeof(buffer), "%s %s-%d", SSL_get_version(ssl), SSL_get_cipher(ssl), bits); - return buffer; } #endif diff --git a/src/s_serv.c b/src/s_serv.c index 2c0de47..9e3cb1d 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_serv.c: Server related functions. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2005 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_serv.c + * \brief Server related functions. + * \version $Id$ */ #include "stdinc.h" @@ -49,7 +51,7 @@ #include "s_user.h" #include "send.h" #include "memory.h" -#include "channel.h" /* chcap_usage_counts stuff...*/ +#include "channel.h" #include "parse.h" #define MIN_CONN_FREQ 300 diff --git a/src/s_user.c b/src/s_user.c index ff77ce1..2b0503e 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * s_user.c: User related functions. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file s_user.c + * \brief User related functions. + * \version $Id$ */ #include "stdinc.h" @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * send.c: Functions for sending messages. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file send.c + * \brief Functions for sending messages. + * \version $Id$ */ #include "stdinc.h" @@ -125,7 +127,7 @@ send_message(struct Client *to, char *buf, int len) * output - none * side effects - Despite the function name, this only sends to directly * connected clients. - * + * */ static void send_message_remote(struct Client *to, struct Client *from, @@ -417,7 +419,7 @@ sendto_channel_butone(struct Client *one, struct Client *from, } /* sendto_server() - * + * * inputs - pointer to client to NOT send to * - pointer to channel * - caps or'd together which must ALL be present @@ -428,7 +430,7 @@ sendto_channel_butone(struct Client *one, struct Client *from, * side effects - Send a message to all connected servers, except the * client 'one' (if non-NULL), as long as the servers * support ALL capabs in 'caps', and NO capabs in 'nocaps'. - * + * * This function was written in an attempt to merge together the other * billion sendto_*serv*() functions, which sprung up with capabs, * lazylinks, uids, etc. @@ -476,7 +478,7 @@ sendto_server(struct Client *one, * - pattern to send * output - NONE * side effects - Sends a message to all people on local server who are - * in same channel with user. + * in same channel with user. * used by m_nick.c and exit_one_client. */ void diff --git a/src/whowas.c b/src/whowas.c index 7e0b288..0a7a50b 100644 --- a/src/whowas.c +++ b/src/whowas.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * whowas.c: WHOWAS user cache. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2005 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file whowas.c + * \brief WHOWAS user cache. + * \version $Id$ */ #include "stdinc.h" |