Module: ngircd.git
Branch: master
Commit: 07f241ff6d3afee88d6c6b3e2ed1e195c0367c91
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=07f241ff…
Author: Alexander Barton <alex(a)barton.de>
Date: Wed Dec 29 14:10:18 2010 +0100
Enhance documentation for the WEBIRC command
---
doc/Protocol.txt | 14 ++++++++++++++
src/ngircd/irc-login.c | 10 ++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/doc/Protocol.txt b/doc/Protocol.txt
index 354b814..2b7e7b8 100644
--- a/doc/Protocol.txt
+++ b/doc/Protocol.txt
@@ -161,3 +161,17 @@ and therefore can't be omitted. The parameter <limit> must be ignored when
a channel has no user limit (the parameter <modes> doesn't list the "l"
channel mode). In this case <limit> should be "0".
+
+II.4 Update webchat/proxy client information
+
+ Command: WEBIRC
+ Parameters: <password> <username> <hostname> <ip-address>
+ Used by: unregistered clients only
+
+The WEBIRC command is used by some Web-to-IRC gateways to set the correct
+user name and host name of users instead of their own. It must be the very
+first command sent to the server, even before USER and NICK commands!
+
+The <password> must be set in the server configuration file to prevent
+unauthorized clients to fake their identity; it is an arbitrary string.
+
diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c
index 1557f18..6a97074 100644
--- a/src/ngircd/irc-login.c
+++ b/src/ngircd/irc-login.c
@@ -596,8 +596,14 @@ IRC_SERVICE(CLIENT *Client, REQUEST *Req)
/**
- * Handler for the IRC command "WEBIRC".
- * Syntax: WEBIRC <password> <username> <real-hostname> <real-IP-address>
+ * Handler for the IRC "WEBIRC" command.
+ *
+ * See doc/Protocol.txt, section II.4:
+ * "Update webchat/proxy client information".
+ *
+ * @param Client The client from which this command has been received.
+ * @param Req Request structure with prefix and all parameters.
+ * @returns CONNECTED or DISCONNECTED.
*/
GLOBAL bool
IRC_WEBIRC(CLIENT *Client, REQUEST *Req)
Module: ngircd.git
Branch: master
Commit: 4ef23df8137557cee0e657d5b05fa09c4c61c6ca
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=4ef23df8…
Author: Alexander Barton <alex(a)barton.de>
Date: Mon Dec 27 17:27:21 2010 +0100
Update and translate comments in hash.c
---
src/ngircd/hash.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/ngircd/hash.c b/src/ngircd/hash.c
index eb980d1..113133d 100644
--- a/src/ngircd/hash.c
+++ b/src/ngircd/hash.c
@@ -26,15 +26,18 @@
#include "exp.h"
#include "hash.h"
+static UINT32 jenkins_hash PARAMS((register UINT8 *k, register UINT32 length,
+ register UINT32 initval));
-static UINT32 jenkins_hash PARAMS(( register UINT8 *k, register UINT32 length, register UINT32 initval ));
-
-
+/**
+ * Calculate hash value for a given string.
+ *
+ * @param String Input string
+ * @return 32 bit hash value
+ */
GLOBAL UINT32
Hash( const char *String )
{
- /* Hash-Wert ueber String berechnen */
-
char buffer[LINE_LEN];
strlcpy(buffer, String, sizeof(buffer));
@@ -43,15 +46,15 @@ Hash( const char *String )
} /* Hash */
/*
- * Die hier verwendete Hash-Funktion stammt aus lookup2.c von Bob Jenkins
- * (URL: <http://burtleburtle.net/bob/c/lookup2.c>). Aus dem Header:
+ * This hash function originates from lookup2.c of Bob Jenkins
+ * (URL: <http://burtleburtle.net/bob/c/lookup2.c>):
* --------------------------------------------------------------------
* lookup2.c, by Bob Jenkins, December 1996, Public Domain.
* hash(), hash2(), hash3, and mix() are externally useful functions.
* Routines to test the hash are included if SELF_TEST is defined.
* You can use this free for any purpose. It has no warranty.
* --------------------------------------------------------------------
- * nicht alle seiner Funktionen werden hier genutzt.
+ * Not all of his functions are used here.
*/
#define hashsize(n) ((UINT32)1<<(n))
Module: ngircd.git
Branch: master
Commit: f3ec90f3f0e3e3b3ccfddda209ac94ba5ad92e42
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=f3ec90f3…
Author: Alexander Barton <alex(a)barton.de>
Date: Mon Dec 27 17:31:19 2010 +0100
Doxygen'ify and update comments in ngircd.{c|h}
---
src/ngircd/ngircd.c | 54 ++++++++++++++++++++++++++++++++++-----------------
src/ngircd/ngircd.h | 41 +++++++++++++++++++++++++++++---------
2 files changed, 67 insertions(+), 28 deletions(-)
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index e595caf..4b49ec6 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -67,11 +67,13 @@ static bool NGIRCd_Init PARAMS(( bool ));
/**
* The main() function of ngIRCd.
+ *
* Here all starts: this function is called by the operating system loader,
* it is the first portion of code executed of ngIRCd.
- * @param argc The number of arguments passed to ngIRCd on the command line.
- * @param argv An array containing all the arguments passed to ngIRCd.
- * @return Global exit code of ngIRCd, zero on success.
+ *
+ * @param argc The number of arguments passed to ngIRCd on the command line.
+ * @param argv An array containing all the arguments passed to ngIRCd.
+ * @return Global exit code of ngIRCd, zero on success.
*/
GLOBAL int
main( int argc, const char *argv[] )
@@ -232,7 +234,7 @@ main( int argc, const char *argv[] )
}
}
- /* Debug-Level (for IRCs "VERSION" command) */
+ /* Debug level for "VERSION" command */
NGIRCd_DebugLevel[0] = '\0';
#ifdef DEBUG
if( NGIRCd_Debug ) strcpy( NGIRCd_DebugLevel, "1" );
@@ -287,11 +289,9 @@ main( int argc, const char *argv[] )
exit(1);
}
- /*
- * create protocol and server identification.
- * The syntax used by ngIRCd in PASS commands and the extended flags
- * are described in doc/Protocol.txt
- */
+ /* Create protocol and server identification. The syntax
+ * used by ngIRCd in PASS commands and the known "extended
+ * flags" are described in doc/Protocol.txt. */
#ifdef IRCPLUS
snprintf( NGIRCd_ProtoID, sizeof NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGE_NAME, PACKAGE_VERSION, IRCPLUSFLAGS );
#ifdef ZLIB
@@ -316,11 +316,10 @@ main( int argc, const char *argv[] )
Pidfile_Delete( );
exit( 1 );
}
-
- /* Hauptschleife */
+
+ /* Main Run Loop */
Conn_Handler( );
- /* Alles abmelden */
Conn_Exit( );
Client_Exit( );
Channel_Exit( );
@@ -333,10 +332,12 @@ main( int argc, const char *argv[] )
/**
- * Generate ngIRCd "version string".
- * This string is generated once and then stored in NGIRCd_Version for
- * further usage, for example by the IRC command VERSION and the --version
- * command line switch.
+ * Generate ngIRCd "version strings".
+ *
+ * The ngIRCd version information is generated once and then stored in the
+ * NGIRCd_Version and NGIRCd_VersionAddition string variables for further
+ * usage, for example by the IRC command "VERSION" and the --version command
+ * line switch.
*/
static void
Fill_Version( void )
@@ -466,7 +467,8 @@ Pidfile_Delete( void )
/**
* Create the file containing the process ID of ngIRCd ("PID file").
- * @param pid The process ID to be stored in this file.
+ *
+ * @param pid The process ID to be stored in this file.
*/
static void
Pidfile_Create(pid_t pid)
@@ -504,6 +506,8 @@ Pidfile_Create(pid_t pid)
/**
* Redirect stdin, stdout and stderr to apropriate file handles.
+ *
+ * @param fd The file handle stdin, stdout and stderr should be redirected to.
*/
static void
Setup_FDStreams(int fd)
@@ -519,6 +523,13 @@ Setup_FDStreams(int fd)
} /* Setup_FDStreams */
+/**
+ * Get user and group ID of unprivileged "nobody" user.
+ *
+ * @param uid User ID
+ * @param gid Group ID
+ * @return true on success.
+ */
static bool
NGIRCd_getNobodyID(uid_t *uid, gid_t *gid )
{
@@ -543,7 +554,7 @@ NGIRCd_getNobodyID(uid_t *uid, gid_t *gid )
if ( !pwd->pw_uid || !pwd->pw_gid)
return false;
- *uid = pwd->pw_uid;
+ *uid = pwd->pw_uid;
*gid = pwd->pw_gid;
endpwent();
@@ -551,6 +562,13 @@ NGIRCd_getNobodyID(uid_t *uid, gid_t *gid )
} /* NGIRCd_getNobodyID */
+/**
+ * Initialize ngIRCd daemon.
+ *
+ * @param NGIRCd_NoDaemon Set to true if ngIRCd should run in the
+ * foreground and not as a daemon.
+ * @return true on success.
+ */
static bool
NGIRCd_Init( bool NGIRCd_NoDaemon )
{
diff --git a/src/ngircd/ngircd.h b/src/ngircd/ngircd.h
index 143a9ff..2efb8a9 100644
--- a/src/ngircd/ngircd.h
+++ b/src/ngircd/ngircd.h
@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001,2002 by Alexander Barton (alex(a)barton.de)
+ * Copyright (c)2001-2010 Alexander Barton (alex(a)barton.de).
*
* 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
@@ -23,31 +23,52 @@
#define C_ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
+/** UNIX timestamp of ngIRCd start */
+GLOBAL time_t NGIRCd_Start;
-GLOBAL time_t NGIRCd_Start; /* Startzeitpunkt des Daemon */
+/** ngIRCd start time as string, used for RPL_CREATED_MSG (003) */
GLOBAL char NGIRCd_StartStr[64];
+
+/** ngIRCd version number containing release number and compile-time options */
GLOBAL char NGIRCd_Version[126];
+
+/** String specifying the compile-time options and target platform */
GLOBAL char NGIRCd_VersionAddition[126];
#ifdef DEBUG
-GLOBAL bool NGIRCd_Debug; /* Debug-Modus aktivieren */
+/** Flag indicating if debug mode is active (true) or not (false) */
+GLOBAL bool NGIRCd_Debug;
#endif
#ifdef SNIFFER
-GLOBAL bool NGIRCd_Sniffer; /* Sniffer aktivieren */
+/** Flag indication if sniffer is active (true) or not (false) */
+GLOBAL bool NGIRCd_Sniffer;
#endif
-GLOBAL bool NGIRCd_Passive; /* nicht zu anderen Servern connecten */
+/**
+ * Flag indicating if NO outgoing connections should be established (true)
+ * or not (false, the default)
+ */
+GLOBAL bool NGIRCd_Passive;
-GLOBAL bool NGIRCd_SignalQuit; /* true: quit server*/
-GLOBAL bool NGIRCd_SignalRestart; /* true: restart server */
+/** Flag indicating that ngIRCd has been requested to quit (true) */
+GLOBAL bool NGIRCd_SignalQuit;
-GLOBAL char NGIRCd_DebugLevel[2]; /* Debug-Level fuer IRC_VERSION() */
+/** Flag indicating that ngIRCd has been requested to restart (true) */
+GLOBAL bool NGIRCd_SignalRestart;
-GLOBAL char NGIRCd_ConfFile[FNAME_LEN]; /* Konfigurationsdatei */
+/**
+ * Debug level for "VERSION" command, see description of numeric RPL_VERSION
+ * (351) in RFC 2812. ngIRCd sets debuglevel to 1 when the debug mode is
+ * active, and to 2 if the sniffer is running.
+ */
+GLOBAL char NGIRCd_DebugLevel[2];
-GLOBAL char NGIRCd_ProtoID[COMMAND_LEN];/* Protokoll- und Server-Identifikation */
+/** Full path and file name of current configuration file */
+GLOBAL char NGIRCd_ConfFile[FNAME_LEN];
+/** Protocol and server identification string; see doc/Protocol.txt */
+GLOBAL char NGIRCd_ProtoID[COMMAND_LEN];
#endif
Module: ngircd.git
Branch: master
Commit: 5858dc3886e492f96a42b61decdda3c1acd920a4
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=5858dc38…
Author: Alexander Barton <alex(a)barton.de>
Date: Mon Dec 27 17:37:56 2010 +0100
Doxygen'ify proc.h
---
src/ngircd/proc.h | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/ngircd/proc.h b/src/ngircd/proc.h
index bb4bceb..84b61f2 100644
--- a/src/ngircd/proc.h
+++ b/src/ngircd/proc.h
@@ -19,11 +19,14 @@
/** Process status. This struct must not be accessed directly! */
typedef struct _Proc_Stat {
- pid_t pid; /* PID of the child process or 0 if none */
- int pipe_fd; /* Pipe file descriptor or -1 if none */
+ pid_t pid; /**< PID of the child process or 0 if none */
+ int pipe_fd; /**< Pipe file descriptor or -1 if none */
} PROC_STAT;
+/** Return true if sub-process is still running */
#define Proc_InProgress(x) ((x)->pid != 0)
+
+/** Return file descriptor of pipe to sub-process (or -1 if none open) */
#define Proc_GetPipeFd(x) ((x)->pipe_fd)
GLOBAL void Proc_InitStruct PARAMS((PROC_STAT *proc));
Module: ngircd.git
Branch: master
Commit: 408cefd15d4540d340283cdfbfad62a8e432cf8e
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=408cefd1…
Author: Alexander Barton <alex(a)barton.de>
Date: Sun Dec 26 19:32:07 2010 +0100
Updated Doxygen configuration file
Removed unnecessary variables DETAILS_AT_TOP, EXTRACT_PRIVATE,
EXTRACT_LOCAL_CLASSES, added SHOW_DIRECTORIES=YES, STRIP_CODE_COMMENTS=NO,
REFERENCED_BY_RELATION=YES, REFERENCES_RELATION=YES,
HTML_DYNAMIC_SECTIONS=YES and GENERATE_DOCSET=NO; updated PREDEFINED.
---
doc/src/Doxyfile | 53 ++++++++++++++++++++++++++++++++---------------------
1 files changed, 32 insertions(+), 21 deletions(-)
diff --git a/doc/src/Doxyfile b/doc/src/Doxyfile
index 55363e1..62a219c 100644
--- a/doc/src/Doxyfile
+++ b/doc/src/Doxyfile
@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2005 Alexander Barton (alex(a)barton.de)
+# Copyright (c)2001-2010 Alexander Barton (alex(a)barton.de)
#
# 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
@@ -8,11 +8,9 @@
# (at your option) any later version.
# Please read the file COPYING, README and AUTHORS for more information.
#
-# $Id: Doxyfile,v 1.2 2005/07/23 00:48:38 alex Exp $
-#
-
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for ngIRCd.
+#
#---------------------------------------------------------------------------
# Project related configuration options
@@ -47,13 +45,6 @@ STRIP_FROM_PATH = ../..
JAVADOC_AUTOBRIEF = YES
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member
-# documentation.
-
-DETAILS_AT_TOP = NO
-
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
@@ -72,21 +63,16 @@ OPTIMIZE_OUTPUT_FOR_C = YES
EXTRACT_ALL = YES
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = YES
-
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = YES
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory
+# hierarchy in the documentation. The default is NO.
-EXTRACT_LOCAL_CLASSES = YES
+SHOW_DIRECTORIES = YES
#---------------------------------------------------------------------------
# configuration options related to the input files
@@ -116,6 +102,22 @@ RECURSIVE = YES
SOURCE_BROWSER = YES
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented
+# function all documented entities called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
#---------------------------------------------------------------------------
# Output formats
#---------------------------------------------------------------------------
@@ -128,6 +130,15 @@ GENERATE_HTML = YES
HTML_FOOTER = footer.inc.html
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports JavaScript and
+# DHTML is required (for instance Mozilla 1.0+, Firefox Netscape 6.0+,
+# Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = YES
+
+GENERATE_DOCSET = NO
GENERATE_HTMLHELP = NO
GENERATE_LATEX = NO
GENERATE_RTF = NO
@@ -148,6 +159,6 @@ GENERATE_PERLMOD = NO
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
-PREDEFINED = CONN_MODULE __client_c__
+PREDEFINED = DEBUG CONN_MODULE __client_c__
# -eof-