diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-09 20:21:39 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-09 20:21:39 +0000 |
commit | bab9f4b4bc0f6aa0e1377745fd216ef9874b3f27 (patch) | |
tree | 816b86525dc3e6f84a81adb0c8744b4c4798e792 /docs/man | |
parent | a96341b150898376a1b01c7fb4519e1265c599b6 (diff) |
Added new module docs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2301 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'docs/man')
68 files changed, 2713 insertions, 1346 deletions
diff --git a/docs/man/man3/Admin.3 b/docs/man/man3/Admin.3 index 885903ffb..907f3d788 100644 --- a/docs/man/man3/Admin.3 +++ b/docs/man/man3/Admin.3 @@ -1,4 +1,4 @@ -.TH "Admin" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "Admin" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -38,7 +38,7 @@ Holds /ADMIN data This class contains the admin details of the local server. It is constructed by class \fBServer\fP, and has three read-only values, Name, Email and Nick that contain the specified values for the server where the module is running. .PP -Definition at line 124 of file modules.h. +Definition at line 125 of file modules.h. .SH "Constructor & Destructor Documentation" .PP .SS "Admin::Admin (\fBstd::string\fP name, \fBstd::string\fP email, \fBstd::string\fP nick)" @@ -53,13 +53,13 @@ Definition at line 250 of file modules.cpp. .PP .SS "const \fBstd::string\fP \fBAdmin::Email\fP" .PP -Definition at line 127 of file modules.h. +Definition at line 128 of file modules.h. .SS "const \fBstd::string\fP \fBAdmin::Name\fP" .PP -Definition at line 127 of file modules.h. +Definition at line 128 of file modules.h. .SS "const \fBstd::string\fP \fBAdmin::Nick\fP" .PP -Definition at line 127 of file modules.h. +Definition at line 128 of file modules.h. .SH "Author" .PP diff --git a/docs/man/man3/BanItem.3 b/docs/man/man3/BanItem.3 index db8e92a23..4ae2aa8a1 100644 --- a/docs/man/man3/BanItem.3 +++ b/docs/man/man3/BanItem.3 @@ -1,4 +1,4 @@ -.TH "BanItem" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "BanItem" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/BoolSet.3 b/docs/man/man3/BoolSet.3 index 56bb4b095..127f01c99 100644 --- a/docs/man/man3/BoolSet.3 +++ b/docs/man/man3/BoolSet.3 @@ -1,4 +1,4 @@ -.TH "BoolSet" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "BoolSet" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -67,7 +67,7 @@ BoolSet is a utility class designed to hold eight bools in a bitmask. Use \fBBoolSet::Set\fP and \fBBoolSet::Get\fP to set and get bools in the bitmask, and Unset and Invert for special operations upon them. .PP -Definition at line 95 of file base.h. +Definition at line 104 of file base.h. .SH "Constructor & Destructor Documentation" .PP .SS "BoolSet::BoolSet ()" @@ -145,7 +145,7 @@ The Unset method unsets one value in the set. .PP .SS "char \fBBoolSet::bits\fP\fC [private]\fP" .PP -Definition at line 97 of file base.h. +Definition at line 106 of file base.h. .SH "Author" .PP diff --git a/docs/man/man3/ConfigReader.3 b/docs/man/man3/ConfigReader.3 index abbec6ef3..6edd9f6fa 100644 --- a/docs/man/man3/ConfigReader.3 +++ b/docs/man/man3/ConfigReader.3 @@ -1,4 +1,4 @@ -.TH "ConfigReader" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ConfigReader" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -84,7 +84,7 @@ Allows reading of values from configuration files This class allows a module to It may either be instantiated with one parameter or none. Constructing the class using one parameter allows you to specify a path to your own configuration file, otherwise, inspircd.conf is read. .PP -Definition at line 1121 of file modules.h. +Definition at line 1510 of file modules.h. .SH "Constructor & Destructor Documentation" .PP .SS "ConfigReader::ConfigReader ()" @@ -93,19 +93,19 @@ Default constructor. .PP This constructor initialises the ConfigReader class to read the inspircd.conf file as specified when running ./configure. .PP -Definition at line 796 of file modules.cpp. +Definition at line 834 of file modules.cpp. .PP References cache, CONF_FILE_NOT_FOUND, error, errorlog, include_stack, and readerror. .PP .nf -797 { -798 include_stack.clear(); -799 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); -800 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out); -801 this->readerror = LoadConf(CONFIG_FILE,this->cache,this->errorlog); -802 if (!this->readerror) -803 this->error = CONF_FILE_NOT_FOUND; -804 } +835 { +836 include_stack.clear(); +837 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); +838 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out); +839 this->readerror = LoadConf(CONFIG_FILE,this->cache,this->errorlog); +840 if (!this->readerror) +841 this->error = CONF_FILE_NOT_FOUND; +842 } .fi .PP .SS "ConfigReader::ConfigReader (\fBstd::string\fP filename)" @@ -114,18 +114,18 @@ Overloaded constructor. .PP This constructor initialises the ConfigReader class to read a user-specified config file .PP -Definition at line 816 of file modules.cpp. +Definition at line 854 of file modules.cpp. .PP References cache, CONF_FILE_NOT_FOUND, error, errorlog, and readerror. .PP .nf -817 { -818 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); -819 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out); -820 this->readerror = LoadConf(filename.c_str(),this->cache,this->errorlog); -821 if (!this->readerror) -822 this->error = CONF_FILE_NOT_FOUND; -823 }; +855 { +856 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); +857 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out); +858 this->readerror = LoadConf(filename.c_str(),this->cache,this->errorlog); +859 if (!this->readerror) +860 this->error = CONF_FILE_NOT_FOUND; +861 }; .fi .PP .SS "ConfigReader::~ConfigReader ()" @@ -134,17 +134,17 @@ Default destructor. .PP This method destroys the ConfigReader class. .PP -Definition at line 807 of file modules.cpp. +Definition at line 845 of file modules.cpp. .PP References cache, and errorlog. .PP .nf -808 { -809 if (this->cache) -810 delete this->cache; -811 if (this->errorlog) -812 delete this->errorlog; -813 } +846 { +847 if (this->cache) +848 delete this->cache; +849 if (this->errorlog) +850 delete this->errorlog; +851 } .fi .PP .SH "Member Function Documentation" @@ -155,41 +155,41 @@ Dumps the list of errors in a config file to an output location. .PP If bail is true, then the program will abort. If bail is false and user points to a valid user record, the error report will be spooled to the given user by means of NOTICE. if bool is false AND user is false, the error report will be spooled to all opers by means of a NOTICE to all opers. .PP -Definition at line 894 of file modules.cpp. +Definition at line 932 of file modules.cpp. .PP References errorlog, connection::fd, and userrec::nick. .PP .nf -895 { -896 if (bail) -897 { -898 printf('There were errors in your configuration:\n%s',errorlog->str().c_str()); -899 exit(0); -900 } -901 else -902 { -903 char dataline[1024]; -904 if (user) -905 { -906 WriteServ(user->fd,'NOTICE %s :There were errors in the configuration file:',user->nick); -907 while (!errorlog->eof()) -908 { -909 errorlog->getline(dataline,1024); -910 WriteServ(user->fd,'NOTICE %s :%s',user->nick,dataline); -911 } -912 } -913 else -914 { -915 WriteOpers('There were errors in the configuration file:',user->nick); -916 while (!errorlog->eof()) -917 { -918 errorlog->getline(dataline,1024); -919 WriteOpers(dataline); -920 } -921 } -922 return; -923 } -924 } +933 { +934 if (bail) +935 { +936 printf('There were errors in your configuration:\n%s',errorlog->str().c_str()); +937 exit(0); +938 } +939 else +940 { +941 char dataline[1024]; +942 if (user) +943 { +944 WriteServ(user->fd,'NOTICE %s :There were errors in the configuration file:',user->nick); +945 while (!errorlog->eof()) +946 { +947 errorlog->getline(dataline,1024); +948 WriteServ(user->fd,'NOTICE %s :%s',user->nick,dataline); +949 } +950 } +951 else +952 { +953 WriteOpers('There were errors in the configuration file:',user->nick); +954 while (!errorlog->eof()) +955 { +956 errorlog->getline(dataline,1024); +957 WriteOpers(dataline); +958 } +959 } +960 return; +961 } +962 } .fi .PP .SS "int ConfigReader::Enumerate (\fBstd::string\fP tag)" @@ -198,14 +198,14 @@ Counts the number of times a given tag appears in the config file. .PP This method counts the number of times a tag appears in a config file, for use where there are several tags of the same kind, e.g. with opers and connect types. It can be used with the index value of \fBConfigReader::ReadValue\fP to loop through all copies of a multiple instance tag. .PP -Definition at line 927 of file modules.cpp. +Definition at line 965 of file modules.cpp. .PP References cache. .PP .nf -928 { -929 return EnumConf(cache,tag.c_str()); -930 } +966 { +967 return EnumConf(cache,tag.c_str()); +968 } .fi .PP .SS "int ConfigReader::EnumerateValues (\fBstd::string\fP tag, int index)" @@ -214,14 +214,14 @@ Returns the number of items within a tag. .PP For example if the tag was <test tag='blah' data='foo'> then this function would return 2. Spaces and newlines both qualify as valid seperators between values. .PP -Definition at line 932 of file modules.cpp. +Definition at line 970 of file modules.cpp. .PP References cache. .PP .nf -933 { -934 return EnumValues(cache, tag.c_str(), index); -935 } +971 { +972 return EnumValues(cache, tag.c_str(), index); +973 } .fi .PP .SS "long ConfigReader::GetError ()" @@ -230,16 +230,16 @@ Returns the last error to occur. .PP Valid errors can be found by looking in \fBmodules.h\fP. Any nonzero value indicates an error condition. A call to \fBGetError()\fP resets the error flag back to 0. .PP -Definition at line 887 of file modules.cpp. +Definition at line 925 of file modules.cpp. .PP References error. .PP .nf -888 { -889 long olderr = this->error; -890 this->error = 0; -891 return olderr; -892 } +926 { +927 long olderr = this->error; +928 this->error = 0; +929 return olderr; +930 } .fi .PP .SS "bool ConfigReader::ReadFlag (\fBstd::string\fP tag, \fBstd::string\fP name, int index)" @@ -248,26 +248,26 @@ Retrieves a boolean value from the config file. .PP This method retrieves a boolean value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve. The values '1', 'yes' and 'true' in the config file count as true to ReadFlag, and any other value counts as false. .PP -Definition at line 841 of file modules.cpp. +Definition at line 879 of file modules.cpp. .PP References cache, CONF_VALUE_NOT_FOUND, and error. .PP .nf -842 { -843 char val[MAXBUF]; -844 char t[MAXBUF]; -845 char n[MAXBUF]; -846 strlcpy(t,tag.c_str(),MAXBUF); -847 strlcpy(n,name.c_str(),MAXBUF); -848 int res = ReadConf(cache,t,n,index,val); -849 if (!res) -850 { -851 this->error = CONF_VALUE_NOT_FOUND; -852 return false; -853 } -854 std::string s = val; -855 return ((s == 'yes') || (s == 'YES') || (s == 'true') || (s == 'TRUE') || (s == '1')); -856 } +880 { +881 char val[MAXBUF]; +882 char t[MAXBUF]; +883 char n[MAXBUF]; +884 strlcpy(t,tag.c_str(),MAXBUF); +885 strlcpy(n,name.c_str(),MAXBUF); +886 int res = ReadConf(cache,t,n,index,val); +887 if (!res) +888 { +889 this->error = CONF_VALUE_NOT_FOUND; +890 return false; +891 } +892 std::string s = val; +893 return ((s == 'yes') || (s == 'YES') || (s == 'true') || (s == 'TRUE') || (s == '1')); +894 } .fi .PP .SS "long ConfigReader::ReadInteger (\fBstd::string\fP tag, \fBstd::string\fP name, int index, bool needs_unsigned)" @@ -276,38 +276,38 @@ Retrieves an integer value from the config file. .PP This method retrieves an integer value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve. Any invalid integer values in the tag will cause the objects error value to be set, and any call to \fBGetError()\fP will return CONF_INVALID_NUMBER to be returned. needs_unsigned is set if the number must be unsigned. If a signed number is placed into a tag which is specified unsigned, 0 will be returned and \fBGetError()\fP will return CONF_NOT_UNSIGNED .PP -Definition at line 858 of file modules.cpp. +Definition at line 896 of file modules.cpp. .PP References cache, CONF_NOT_A_NUMBER, CONF_NOT_UNSIGNED, CONF_VALUE_NOT_FOUND, and error. .PP .nf -859 { -860 char val[MAXBUF]; -861 char t[MAXBUF]; -862 char n[MAXBUF]; -863 strlcpy(t,tag.c_str(),MAXBUF); -864 strlcpy(n,name.c_str(),MAXBUF); -865 int res = ReadConf(cache,t,n,index,val); -866 if (!res) -867 { -868 this->error = CONF_VALUE_NOT_FOUND; -869 return 0; -870 } -871 for (unsigned int i = 0; i < strlen(val); i++) -872 { -873 if (!isdigit(val[i])) -874 { -875 this->error = CONF_NOT_A_NUMBER; -876 return 0; -877 } -878 } -879 if ((needs_unsigned) && (atoi(val)<0)) -880 { -881 this->error = CONF_NOT_UNSIGNED; -882 return 0; -883 } -884 return atoi(val); -885 } +897 { +898 char val[MAXBUF]; +899 char t[MAXBUF]; +900 char n[MAXBUF]; +901 strlcpy(t,tag.c_str(),MAXBUF); +902 strlcpy(n,name.c_str(),MAXBUF); +903 int res = ReadConf(cache,t,n,index,val); +904 if (!res) +905 { +906 this->error = CONF_VALUE_NOT_FOUND; +907 return 0; +908 } +909 for (unsigned int i = 0; i < strlen(val); i++) +910 { +911 if (!isdigit(val[i])) +912 { +913 this->error = CONF_NOT_A_NUMBER; +914 return 0; +915 } +916 } +917 if ((needs_unsigned) && (atoi(val)<0)) +918 { +919 this->error = CONF_NOT_UNSIGNED; +920 return 0; +921 } +922 return atoi(val); +923 } .fi .PP .SS "\fBstd::string\fP ConfigReader::ReadValue (\fBstd::string\fP tag, \fBstd::string\fP name, int index)" @@ -316,25 +316,25 @@ Retrieves a value from the config file. .PP This method retrieves a value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve. .PP -Definition at line 825 of file modules.cpp. +Definition at line 863 of file modules.cpp. .PP References cache, CONF_VALUE_NOT_FOUND, and error. .PP .nf -826 { -827 char val[MAXBUF]; -828 char t[MAXBUF]; -829 char n[MAXBUF]; -830 strlcpy(t,tag.c_str(),MAXBUF); -831 strlcpy(n,name.c_str(),MAXBUF); -832 int res = ReadConf(cache,t,n,index,val); -833 if (!res) -834 { -835 this->error = CONF_VALUE_NOT_FOUND; -836 return ''; -837 } -838 return val; -839 } +864 { +865 char val[MAXBUF]; +866 char t[MAXBUF]; +867 char n[MAXBUF]; +868 strlcpy(t,tag.c_str(),MAXBUF); +869 strlcpy(n,name.c_str(),MAXBUF); +870 int res = ReadConf(cache,t,n,index,val); +871 if (!res) +872 { +873 this->error = CONF_VALUE_NOT_FOUND; +874 return ''; +875 } +876 return val; +877 } .fi .PP .SS "bool ConfigReader::Verify ()" @@ -343,14 +343,14 @@ Returns true if a config file is valid. .PP This method is partially implemented and will only return false if the config file does not exist or could not be opened. .PP -Definition at line 937 of file modules.cpp. +Definition at line 975 of file modules.cpp. .PP References readerror. .PP .nf -938 { -939 return this->readerror; -940 } +976 { +977 return this->readerror; +978 } .fi .PP .SH "Member Data Documentation" @@ -361,24 +361,24 @@ The contents of the configuration file This protected member should never be acc .PP It will contain a pointer to the configuration file data with unneeded data (such as comments) stripped from it. .PP -Definition at line 1129 of file modules.h. +Definition at line 1518 of file modules.h. .PP Referenced by ConfigReader(), Enumerate(), EnumerateValues(), ReadFlag(), ReadInteger(), ReadValue(), and ~ConfigReader(). .SS "long \fBConfigReader::error\fP\fC [protected]\fP" .PP -Definition at line 1134 of file modules.h. +Definition at line 1523 of file modules.h. .PP Referenced by ConfigReader(), GetError(), ReadFlag(), ReadInteger(), and ReadValue(). .SS "std::stringstream* \fBConfigReader::errorlog\fP\fC [protected]\fP" .PP -Definition at line 1130 of file modules.h. +Definition at line 1519 of file modules.h. .PP Referenced by ConfigReader(), DumpErrors(), and ~ConfigReader(). .SS "bool \fBConfigReader::readerror\fP\fC [protected]\fP" .PP Used to store errors. .PP -Definition at line 1133 of file modules.h. +Definition at line 1522 of file modules.h. .PP Referenced by ConfigReader(), and Verify(). diff --git a/docs/man/man3/ConnectClass.3 b/docs/man/man3/ConnectClass.3 index fe523ce7b..0d8ce0778 100644 --- a/docs/man/man3/ConnectClass.3 +++ b/docs/man/man3/ConnectClass.3 @@ -1,4 +1,4 @@ -.TH "ConnectClass" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ConnectClass" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -63,26 +63,26 @@ Inherits \fBclassbase\fP. .PP Holds information relevent to <connect allow> and <connect deny> tags in the config file. .PP -Definition at line 45 of file users.h. +Definition at line 48 of file users.h. .SH "Constructor & Destructor Documentation" .PP .SS "ConnectClass::ConnectClass ()\fC [inline]\fP" .PP -Definition at line 79 of file users.h. +Definition at line 82 of file users.h. .PP References flood, host, pass, pingtime, recvqmax, registration_timeout, sendqmax, and threshold. .PP .nf -80 { -81 registration_timeout = 0; -82 flood = 0; -83 pingtime = 0; -84 threshold = 0; -85 sendqmax = 0; -86 recvqmax = 0; -87 strlcpy(host,'',MAXBUF); -88 strlcpy(pass,'',MAXBUF); -89 } +83 { +84 registration_timeout = 0; +85 flood = 0; +86 pingtime = 0; +87 threshold = 0; +88 sendqmax = 0; +89 recvqmax = 0; +90 strlcpy(host,'',MAXBUF); +91 strlcpy(pass,'',MAXBUF); +92 } .fi .PP .SH "Member Data Documentation" @@ -91,63 +91,63 @@ References flood, host, pass, pingtime, recvqmax, registration_timeout, sendqmax .PP Number of lines in buffer before excess flood is triggered. .PP -Definition at line 56 of file users.h. +Definition at line 59 of file users.h. .PP Referenced by ConnectClass(). .SS "char \fBConnectClass::host\fP[MAXBUF]" .PP Host mask for this line. .PP -Definition at line 59 of file users.h. +Definition at line 62 of file users.h. .PP Referenced by ConnectClass(). .SS "char \fBConnectClass::pass\fP[MAXBUF]" .PP (Optional) Password for this line .PP -Definition at line 65 of file users.h. +Definition at line 68 of file users.h. .PP Referenced by ConnectClass(). .SS "int \fBConnectClass::pingtime\fP" .PP Number of seconds between pings for this line. .PP -Definition at line 62 of file users.h. +Definition at line 65 of file users.h. .PP Referenced by ConnectClass(). .SS "long \fBConnectClass::recvqmax\fP" .PP Maximum size of recvq for users in this class (bytes). .PP -Definition at line 77 of file users.h. +Definition at line 80 of file users.h. .PP Referenced by ConnectClass(). .SS "int \fBConnectClass::registration_timeout\fP" .PP Max time to register the connection in seconds. .PP -Definition at line 53 of file users.h. +Definition at line 56 of file users.h. .PP Referenced by ConnectClass(). .SS "long \fBConnectClass::sendqmax\fP" .PP Maximum size of sendq for users in this class (bytes). .PP -Definition at line 73 of file users.h. +Definition at line 76 of file users.h. .PP Referenced by ConnectClass(). .SS "int \fBConnectClass::threshold\fP" .PP Threshold value for flood disconnect. .PP -Definition at line 69 of file users.h. +Definition at line 72 of file users.h. .PP Referenced by ConnectClass(). .SS "char \fBConnectClass::type\fP" .PP Type of line, either CC_ALLOW or CC_DENY. .PP -Definition at line 50 of file users.h. +Definition at line 53 of file users.h. .SH "Author" .PP diff --git a/docs/man/man3/DNS.3 b/docs/man/man3/DNS.3 index a88a76ab1..95597b880 100644 --- a/docs/man/man3/DNS.3 +++ b/docs/man/man3/DNS.3 @@ -1,4 +1,4 @@ -.TH "DNS" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "DNS" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -42,6 +42,9 @@ DNS \- The DNS class allows fast nonblocking resolution of hostnames and ip addr .br .RI "\fIThis method returns the result of your query as a string, depending upon wether you called \fBDNS::ReverseLookup()\fP or \fBDNS::ForwardLookup\fP. \fP" .ti -1c +.RI "\fBstd::string\fP \fBGetResultIP\fP ()" +.br +.ti -1c .RI "int \fBGetFD\fP ()" .br .RI "\fIThis method returns the file handle used by the dns query socket or zero if the query is invalid for some reason, e.g. \fP" @@ -74,7 +77,7 @@ DNS \- The DNS class allows fast nonblocking resolution of hostnames and ip addr .RI "int \fBdns_getname4\fP (const in_addr *const ip)" .br .ti -1c -.RI "char * \fBdns_getresult\fP (const int \fBfd\fP)" +.RI "char * \fBdns_getresult\fP (const int fd)" .br .ti -1c .RI "in_addr * \fBdns_aton4_s\fP (const char *const ipstring, in_addr *const ip)" @@ -83,7 +86,7 @@ DNS \- The DNS class allows fast nonblocking resolution of hostnames and ip addr .RI "char * \fBdns_ntoa4_s\fP (const in_addr *const ip, char *const \fBresult\fP)" .br .ti -1c -.RI "char * \fBdns_getresult_s\fP (const int \fBfd\fP, char *const \fBresult\fP)" +.RI "char * \fBdns_getresult_s\fP (const int fd, char *const \fBresult\fP)" .br .ti -1c .RI "in_addr * \fBdns_aton4_r\fP (const char *const ipstring)" @@ -92,7 +95,7 @@ DNS \- The DNS class allows fast nonblocking resolution of hostnames and ip addr .RI "char * \fBdns_ntoa4_r\fP (const in_addr *const ip)" .br .ti -1c -.RI "char * \fBdns_getresult_r\fP (const int \fBfd\fP)" +.RI "char * \fBdns_getresult_r\fP (const int fd)" .br .in -1c .SS "Private Attributes" @@ -105,10 +108,13 @@ DNS \- The DNS class allows fast nonblocking resolution of hostnames and ip addr .RI "char * \fBresult\fP" .br .ti -1c +.RI "char \fBlocalbuf\fP [1024]" +.br +.ti -1c .RI "int \fBt\fP" .br .ti -1c -.RI "int \fBfd\fP" +.RI "int \fBmyfd\fP" .br .in -1c .SH "Detailed Description" @@ -178,6 +184,8 @@ the dns server not responding. .PP This method returns the result of your query as a string, depending upon wether you called \fBDNS::ReverseLookup()\fP or \fBDNS::ForwardLookup\fP. .PP +.SS "\fBstd::string\fP DNS::GetResultIP ()" +.PP .SS "bool DNS::HasResult ()" .PP This method will return true when the lookup is completed. @@ -195,15 +203,18 @@ This method will start the reverse lookup of an ip given in dotted decimal forma .SS "in_addr* \fBDNS::binip\fP\fC [private]\fP" .PP Definition at line 38 of file dns.h. -.SS "int \fBDNS::fd\fP\fC [private]\fP" +.SS "char \fBDNS::localbuf\fP[1024]\fC [private]\fP" +.PP +Definition at line 40 of file dns.h. +.SS "int \fBDNS::myfd\fP\fC [private]\fP" .PP -Definition at line 42 of file dns.h. +Definition at line 43 of file dns.h. .SS "char* \fBDNS::result\fP\fC [private]\fP" .PP Definition at line 39 of file dns.h. .SS "int \fBDNS::t\fP\fC [private]\fP" .PP -Definition at line 40 of file dns.h. +Definition at line 41 of file dns.h. .SH "Author" .PP diff --git a/docs/man/man3/ELine.3 b/docs/man/man3/ELine.3 index f40a92bd3..1b3b6c7a4 100644 --- a/docs/man/man3/ELine.3 +++ b/docs/man/man3/ELine.3 @@ -1,4 +1,4 @@ -.TH "ELine" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ELine" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/Event.3 b/docs/man/man3/Event.3 index 545ed1fdc..0105be0ae 100644 --- a/docs/man/man3/Event.3 +++ b/docs/man/man3/Event.3 @@ -1,4 +1,4 @@ -.TH "Event" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "Event" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -58,7 +58,7 @@ The Event class is a unicast message directed at all modules. When the class is properly instantiated it may be sent to all modules using the \fBSend()\fP method, which will trigger the OnEvent method in all modules passing the object as its parameter. .PP -Definition at line 196 of file modules.h. +Definition at line 197 of file modules.h. .SH "Constructor & Destructor Documentation" .PP .SS "Event::Event (char * anydata, \fBModule\fP * src, \fBstd::string\fP eventid)" @@ -142,7 +142,7 @@ References FOREACH_MOD. .PP This member holds a pointer to arbitary data set by the emitter of the message. .PP -Definition at line 201 of file modules.h. +Definition at line 202 of file modules.h. .PP Referenced by GetData(). .SS "\fBstd::string\fP \fBEvent::id\fP\fC [protected]\fP" @@ -151,14 +151,14 @@ The event identifier. .PP This is arbitary text which should be used to distinguish one type of event from another. .PP -Definition at line 210 of file modules.h. +Definition at line 211 of file modules.h. .PP Referenced by GetEventID(). .SS "\fBModule\fP* \fBEvent::source\fP\fC [protected]\fP" .PP This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply. .PP -Definition at line 205 of file modules.h. +Definition at line 206 of file modules.h. .PP Referenced by GetSource(). diff --git a/docs/man/man3/ExemptItem.3 b/docs/man/man3/ExemptItem.3 index 7f07d2075..17e67bdcf 100644 --- a/docs/man/man3/ExemptItem.3 +++ b/docs/man/man3/ExemptItem.3 @@ -1,4 +1,4 @@ -.TH "ExemptItem" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ExemptItem" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/ExtMode.3 b/docs/man/man3/ExtMode.3 index 6b5905f8d..e63ace10d 100644 --- a/docs/man/man3/ExtMode.3 +++ b/docs/man/man3/ExtMode.3 @@ -1,4 +1,4 @@ -.TH "ExtMode" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ExtMode" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/Extensible.3 b/docs/man/man3/Extensible.3 index 4f918482c..6c291ce75 100644 --- a/docs/man/man3/Extensible.3 +++ b/docs/man/man3/Extensible.3 @@ -1,4 +1,4 @@ -.TH "Extensible" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "Extensible" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -29,6 +29,10 @@ Inherited by \fBchanrec\fP, \fBcommand_t\fP, and \fBconnection\fP. .RI "char * \fBGetExt\fP (\fBstd::string\fP key)" .br .RI "\fIGet an extension item. \fP" +.ti -1c +.RI "void \fBGetExtList\fP (std::deque< \fBstd::string\fP > &\fBlist\fP)" +.br +.RI "\fIGet a list of all extension items names. \fP" .in -1c .SS "Private Attributes" @@ -44,7 +48,7 @@ class Extensible is the parent class of many classes such as userrec and chanrec class Extensible implements a system which allows modules to 'extend' the class by attaching data within a map associated with the object. In this way modules can store their own custom information within user objects, channel objects and server objects, without breaking other modules (this is more sensible than using a flags variable, and each module defining bits within the flag as 'theirs' as it is less prone to conflict and supports arbitary data storage). .PP -Definition at line 50 of file base.h. +Definition at line 51 of file base.h. .SH "Member Function Documentation" .PP .SS "bool Extensible::Extend (\fBstd::string\fP key, char * p)" @@ -81,6 +85,21 @@ If you provide a non-existent key name, the function returns NULL, otherwise a p .RE .PP +.SS "void Extensible::GetExtList (std::deque< \fBstd::string\fP > & list)" +.PP +Get a list of all extension items names. +.PP +\fBParameters:\fP +.RS 4 +\fIlist\fP A deque of strings to receive the list +.RE +.PP +\fBReturns:\fP +.RS 4 +This function writes a list of all extension items stored in this object by name into the given deque and returns void. +.RE +.PP + .SS "bool Extensible::Shrink (\fBstd::string\fP key)" .PP Shrink an Extensible class. @@ -104,7 +123,7 @@ Returns true on success. .PP Private data store. .PP -Definition at line 54 of file base.h. +Definition at line 55 of file base.h. .SH "Author" .PP diff --git a/docs/man/man3/FileReader.3 b/docs/man/man3/FileReader.3 index c6111fde1..09067f8f8 100644 --- a/docs/man/man3/FileReader.3 +++ b/docs/man/man3/FileReader.3 @@ -1,4 +1,4 @@ -.TH "FileReader" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "FileReader" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -57,7 +57,7 @@ Caches a text file into memory and can be used to retrieve lines from it. This class contains methods for read-only manipulation of a text file in memory. Either use the constructor type with one parameter to load a file into memory at construction, or use the LoadFile method to load a file. .PP -Definition at line 1210 of file modules.h. +Definition at line 1599 of file modules.h. .SH "Constructor & Destructor Documentation" .PP .SS "FileReader::FileReader ()" @@ -66,11 +66,11 @@ Default constructor. .PP This method does not load any file into memory, you must use the LoadFile method after constructing the class this way. .PP -Definition at line 950 of file modules.cpp. +Definition at line 988 of file modules.cpp. .PP .nf -951 { -952 } +989 { +990 } .fi .PP .SS "FileReader::FileReader (\fBstd::string\fP filename)" @@ -79,16 +79,16 @@ Secondary constructor. .PP This method initialises the class with a file loaded into it ready for GetLine and and other methods to be called. If the file could not be loaded, \fBFileReader::FileSize\fP returns 0. .PP -Definition at line 943 of file modules.cpp. +Definition at line 981 of file modules.cpp. .PP References fc. .PP .nf -944 { -945 file_cache c; -946 readfile(c,filename.c_str()); -947 this->fc = c; -948 } +982 { +983 file_cache c; +984 readfile(c,filename.c_str()); +985 this->fc = c; +986 } .fi .PP .SS "FileReader::~FileReader ()" @@ -97,11 +97,11 @@ Default destructor. .PP This deletes the memory allocated to the file. .PP -Definition at line 962 of file modules.cpp. +Definition at line 1000 of file modules.cpp. .PP .nf -963 { -964 } +1001 { +1002 } .fi .PP .SH "Member Function Documentation" @@ -110,21 +110,21 @@ Definition at line 962 of file modules.cpp. .PP Returns true if the file exists This function will return false if the file could not be opened. .PP -Definition at line 966 of file modules.cpp. +Definition at line 1004 of file modules.cpp. .PP References fc. .PP .nf -967 { -968 if (fc.size() == 0) -969 { -970 return(false); -971 } -972 else -973 { -974 return(true); -975 } -976 } +1005 { +1006 if (fc.size() == 0) +1007 { +1008 return(false); +1009 } +1010 else +1011 { +1012 return(true); +1013 } +1014 } .fi .PP .SS "int FileReader::FileSize ()" @@ -133,14 +133,14 @@ Returns the size of the file in lines. .PP This method returns the number of lines in the read file. If it is 0, no lines have been read into memory, either because the file is empty or it does not exist, or cannot be opened due to permission problems. .PP -Definition at line 985 of file modules.cpp. +Definition at line 1023 of file modules.cpp. .PP References fc. .PP .nf -986 { -987 return fc.size(); -988 } +1024 { +1025 return fc.size(); +1026 } .fi .PP .SS "\fBstd::string\fP FileReader::GetLine (int x)" @@ -149,16 +149,16 @@ Retrieve one line from the file. .PP This method retrieves one line from the text file. If an empty non-NULL string is returned, the index was out of bounds, or the line had no data on it. .PP -Definition at line 978 of file modules.cpp. +Definition at line 1016 of file modules.cpp. .PP References fc. .PP .nf -979 { -980 if ((x<0) || ((unsigned)x>fc.size())) -981 return ''; -982 return fc[x]; -983 } +1017 { +1018 if ((x<0) || ((unsigned)x>fc.size())) +1019 return ''; +1020 return fc[x]; +1021 } .fi .PP .SS "void FileReader::LoadFile (\fBstd::string\fP filename)" @@ -167,23 +167,23 @@ Used to load a file. .PP This method loads a file into the class ready for GetLine and and other methods to be called. If the file could not be loaded, \fBFileReader::FileSize\fP returns 0. .PP -Definition at line 954 of file modules.cpp. +Definition at line 992 of file modules.cpp. .PP References fc. .PP .nf -955 { -956 file_cache c; -957 readfile(c,filename.c_str()); -958 this->fc = c; -959 } +993 { +994 file_cache c; +995 readfile(c,filename.c_str()); +996 this->fc = c; +997 } .fi .PP .SH "Member Data Documentation" .PP .SS "\fBfile_cache\fP \fBFileReader::fc\fP\fC [private]\fP" .PP -Definition at line 1212 of file modules.h. +Definition at line 1601 of file modules.h. .PP Referenced by Exists(), FileReader(), FileSize(), GetLine(), and LoadFile(). diff --git a/docs/man/man3/GLine.3 b/docs/man/man3/GLine.3 index 90e78da82..a4dae91d5 100644 --- a/docs/man/man3/GLine.3 +++ b/docs/man/man3/GLine.3 @@ -1,4 +1,4 @@ -.TH "GLine" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "GLine" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/HostItem.3 b/docs/man/man3/HostItem.3 index 950a16845..873025613 100644 --- a/docs/man/man3/HostItem.3 +++ b/docs/man/man3/HostItem.3 @@ -1,4 +1,4 @@ -.TH "HostItem" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "HostItem" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/InspSocket.3 b/docs/man/man3/InspSocket.3 index a0c2e134c..1dc773958 100644 --- a/docs/man/man3/InspSocket.3 +++ b/docs/man/man3/InspSocket.3 @@ -1,4 +1,4 @@ -.TH "InspSocket" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "InspSocket" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -15,7 +15,7 @@ InspSocket \- .RI "\fBInspSocket\fP ()" .br .ti -1c -.RI "\fBInspSocket\fP (int newfd)" +.RI "\fBInspSocket\fP (int newfd, char *ip)" .br .ti -1c .RI "\fBInspSocket\fP (\fBstd::string\fP \fBhost\fP, int \fBport\fP, bool listening, unsigned long maxtime)" @@ -42,6 +42,9 @@ InspSocket \- .RI "virtual char * \fBRead\fP ()" .br .ti -1c +.RI "\fBstd::string\fP \fBGetIP\fP ()" +.br +.ti -1c .RI "virtual int \fBWrite\fP (\fBstd::string\fP data)" .br .ti -1c @@ -94,7 +97,10 @@ InspSocket \- .RI "pollfd \fBpolls\fP" .br .ti -1c -.RI "char \fBibuf\fP [1024]" +.RI "char \fBibuf\fP [16384]" +.br +.ti -1c +.RI "\fBstd::string\fP \fBIP\fP" .br .ti -1c .RI "sockaddr_in \fBclient\fP" @@ -123,327 +129,342 @@ References I_DISCONNECTED, and state. 49 } .fi .PP -.SS "InspSocket::InspSocket (int newfd)" +.SS "InspSocket::InspSocket (int newfd, char * ip)" .PP Definition at line 51 of file socket.cpp. .PP -References fd, I_CONNECTED, and state. +References fd, I_CONNECTED, IP, and state. .PP .nf 52 { 53 this->fd = newfd; 54 this->state = I_CONNECTED; -55 } +55 this->IP = ip; +56 } .fi .PP .SS "InspSocket::InspSocket (\fBstd::string\fP host, int port, bool listening, unsigned long maxtime)" .PP -Definition at line 57 of file socket.cpp. +Definition at line 58 of file socket.cpp. .PP -References addr, addy, Close(), DEBUG, fd, I_CONNECTING, I_ERR_BIND, I_ERR_CONNECT, I_ERR_SOCKET, I_ERROR, I_LISTENING, OnError(), state, timeout, and timeout_end. +References addr, addy, Close(), DEBUG, fd, I_CONNECTING, I_ERR_BIND, I_ERR_CONNECT, I_ERR_SOCKET, I_ERROR, I_LISTENING, IP, OnError(), state, timeout, and timeout_end. .PP .nf -58 { -59 if (listening) { -60 if ((this->fd = OpenTCPSocket()) == ERROR) -61 { -62 this->fd = -1; -63 this->state = I_ERROR; -64 this->OnError(I_ERR_SOCKET); -65 log(DEBUG,'OpenTCPSocket() error'); -66 return; -67 } -68 else -69 { -70 if (BindSocket(this->fd,this->client,this->server,port,(char*)host.c_str()) == ERROR) -71 { -72 this->Close(); -73 this->fd = -1; -74 this->state = I_ERROR; -75 this->OnError(I_ERR_BIND); -76 log(DEBUG,'BindSocket() error %s',strerror(errno)); -77 return; -78 } -79 else -80 { -81 this->state = I_LISTENING; -82 log(DEBUG,'New socket now in I_LISTENING state'); -83 return; -84 } -85 } -86 } else { -87 char* ip; -88 this->host = host; -89 hostent* hoste = gethostbyname(host.c_str()); -90 if (!hoste) { -91 ip = (char*)host.c_str(); -92 } else { -93 struct in_addr* ia = (in_addr*)hoste->h_addr; -94 ip = inet_ntoa(*ia); -95 } -96 -97 timeout_end = time(NULL)+maxtime; -98 timeout = false; -99 if ((this->fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) -100 { -101 this->state = I_ERROR; -102 this->OnError(I_ERR_SOCKET); -103 return; -104 } -105 this->port = port; -106 inet_aton(ip,&addy); -107 addr.sin_family = AF_INET; -108 addr.sin_addr = addy; -109 addr.sin_port = htons(this->port); -110 -111 int flags; -112 flags = fcntl(this->fd, F_GETFL, 0); -113 fcntl(this->fd, F_SETFL, flags | O_NONBLOCK); -114 -115 if(connect(this->fd, (sockaddr*)&this->addr,sizeof(this->addr)) == -1) -116 { -117 if (errno != EINPROGRESS) -118 { -119 this->Close(); -120 this->OnError(I_ERR_CONNECT); -121 this->state = I_ERROR; -122 return; -123 } -124 } -125 this->state = I_CONNECTING; -126 return; -127 } -128 } +59 { +60 if (listening) { +61 if ((this->fd = OpenTCPSocket()) == ERROR) +62 { +63 this->fd = -1; +64 this->state = I_ERROR; +65 this->OnError(I_ERR_SOCKET); +66 log(DEBUG,'OpenTCPSocket() error'); +67 return; +68 } +69 else +70 { +71 if (BindSocket(this->fd,this->client,this->server,port,(char*)host.c_str()) == ERROR) +72 { +73 this->Close(); +74 this->fd = -1; +75 this->state = I_ERROR; +76 this->OnError(I_ERR_BIND); +77 log(DEBUG,'BindSocket() error %s',strerror(errno)); +78 return; +79 } +80 else +81 { +82 this->state = I_LISTENING; +83 log(DEBUG,'New socket now in I_LISTENING state'); +84 return; +85 } +86 } +87 } else { +88 char* ip; +89 this->host = host; +90 hostent* hoste = gethostbyname(host.c_str()); +91 if (!hoste) { +92 ip = (char*)host.c_str(); +93 } else { +94 struct in_addr* ia = (in_addr*)hoste->h_addr; +95 ip = inet_ntoa(*ia); +96 } +97 +98 this->IP = ip; +99 +100 timeout_end = time(NULL)+maxtime; +101 timeout = false; +102 if ((this->fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) +103 { +104 this->state = I_ERROR; +105 this->OnError(I_ERR_SOCKET); +106 return; +107 } +108 this->port = port; +109 inet_aton(ip,&addy); +110 addr.sin_family = AF_INET; +111 addr.sin_addr = addy; +112 addr.sin_port = htons(this->port); +113 +114 int flags; +115 flags = fcntl(this->fd, F_GETFL, 0); +116 fcntl(this->fd, F_SETFL, flags | O_NONBLOCK); +117 +118 if(connect(this->fd, (sockaddr*)&this->addr,sizeof(this->addr)) == -1) +119 { +120 if (errno != EINPROGRESS) +121 { +122 this->Close(); +123 this->OnError(I_ERR_CONNECT); +124 this->state = I_ERROR; +125 return; +126 } +127 } +128 this->state = I_CONNECTING; +129 return; +130 } +131 } .fi .PP .SS "InspSocket::~InspSocket ()\fC [virtual]\fP" .PP -Definition at line 246 of file socket.cpp. +Definition at line 254 of file socket.cpp. .PP References Close(). .PP .nf -247 { -248 this->Close(); -249 } +255 { +256 this->Close(); +257 } .fi .PP .SH "Member Function Documentation" .PP .SS "void InspSocket::Close ()\fC [virtual]\fP" .PP -Definition at line 130 of file socket.cpp. +Definition at line 133 of file socket.cpp. .PP References fd, and OnClose(). .PP Referenced by InspSocket(), and ~InspSocket(). .PP .nf -131 { -132 if (this->fd != -1) -133 { -134 this->OnClose(); -135 shutdown(this->fd,2); -136 close(this->fd); -137 this->fd = -1; -138 } -139 } +134 { +135 if (this->fd != -1) +136 { +137 this->OnClose(); +138 shutdown(this->fd,2); +139 close(this->fd); +140 this->fd = -1; +141 } +142 } +.fi +.PP +.SS "\fBstd::string\fP InspSocket::GetIP ()" +.PP +Definition at line 144 of file socket.cpp. +.PP +References IP. +.PP +.nf +145 { +146 return this->IP; +147 } .fi .PP .SS "\fBInspSocketState\fP InspSocket::GetState ()" .PP -Definition at line 233 of file socket.cpp. +Definition at line 241 of file socket.cpp. .PP References state. .PP .nf -234 { -235 return this->state; -236 } +242 { +243 return this->state; +244 } .fi .PP .SS "void InspSocket::OnClose ()\fC [virtual]\fP" .PP -Definition at line 244 of file socket.cpp. +Definition at line 252 of file socket.cpp. .PP Referenced by Close(). .PP .nf -244 { return; } +252 { return; } .fi .PP .SS "bool InspSocket::OnConnected ()\fC [virtual]\fP" .PP -Definition at line 238 of file socket.cpp. +Definition at line 246 of file socket.cpp. .PP Referenced by Poll(). .PP .nf -238 { return true; } +246 { return true; } .fi .PP .SS "bool InspSocket::OnDataReady ()\fC [virtual]\fP" .PP -Definition at line 242 of file socket.cpp. +Definition at line 250 of file socket.cpp. .PP Referenced by Poll(). .PP .nf -242 { return true; } +250 { return true; } .fi .PP .SS "int InspSocket::OnDisconnect ()\fC [virtual]\fP" .PP -Definition at line 240 of file socket.cpp. +Definition at line 248 of file socket.cpp. .PP .nf -240 { return 0; } +248 { return 0; } .fi .PP .SS "void InspSocket::OnError (\fBInspSocketError\fP e)\fC [virtual]\fP" .PP -Definition at line 239 of file socket.cpp. +Definition at line 247 of file socket.cpp. .PP Referenced by InspSocket(), and Poll(). .PP .nf -239 { return; } +247 { return; } .fi .PP .SS "int InspSocket::OnIncomingConnection (int newfd, char * ip)\fC [virtual]\fP" .PP -Definition at line 241 of file socket.cpp. +Definition at line 249 of file socket.cpp. .PP Referenced by Poll(). .PP .nf -241 { return 0; } +249 { return 0; } .fi .PP .SS "void InspSocket::OnTimeout ()\fC [virtual]\fP" .PP -Definition at line 243 of file socket.cpp. +Definition at line 251 of file socket.cpp. .PP Referenced by Poll(). .PP .nf -243 { return; } +251 { return; } .fi .PP .SS "bool InspSocket::Poll ()" .PP -Definition at line 183 of file socket.cpp. +Definition at line 191 of file socket.cpp. .PP References client, fd, I_CONNECTED, I_CONNECTING, I_ERR_TIMEOUT, I_ERROR, I_LISTENING, length, OnConnected(), OnDataReady(), OnError(), OnIncomingConnection(), OnTimeout(), polls, SetState(), state, timeout, and timeout_end. .PP .nf -184 { -185 if ((time(NULL) > timeout_end) && (this->state == I_CONNECTING)) -186 { -187 // for non-listening sockets, the timeout can occur -188 // which causes termination of the connection after -189 // the given number of seconds without a successful -190 // connection. -191 this->OnTimeout(); -192 this->OnError(I_ERR_TIMEOUT); -193 timeout = true; -194 this->state = I_ERROR; -195 return false; -196 } -197 polls.fd = this->fd; -198 state == I_CONNECTING ? polls.events = POLLOUT : polls.events = POLLIN; -199 int ret = poll(&polls,1,1); -200 -201 if (ret > 0) -202 { -203 int incoming = -1; -204 -205 switch (this->state) -206 { -207 case I_CONNECTING: -208 this->SetState(I_CONNECTED); -209 return this->OnConnected(); -210 break; -211 case I_LISTENING: -212 length = sizeof (client); -213 incoming = accept (this->fd, (sockaddr*)&client,&length); -214 this->OnIncomingConnection(incoming,inet_ntoa(client.sin_addr)); -215 return true; -216 break; -217 case I_CONNECTED: -218 return this->OnDataReady(); -219 break; -220 default: -221 break; -222 } -223 } -224 return true; -225 } +192 { +193 if ((time(NULL) > timeout_end) && (this->state == I_CONNECTING)) +194 { +195 // for non-listening sockets, the timeout can occur +196 // which causes termination of the connection after +197 // the given number of seconds without a successful +198 // connection. +199 this->OnTimeout(); +200 this->OnError(I_ERR_TIMEOUT); +201 timeout = true; +202 this->state = I_ERROR; +203 return false; +204 } +205 polls.fd = this->fd; +206 state == I_CONNECTING ? polls.events = POLLOUT : polls.events = POLLIN; +207 int ret = poll(&polls,1,1); +208 +209 if (ret > 0) +210 { +211 int incoming = -1; +212 +213 switch (this->state) +214 { +215 case I_CONNECTING: +216 this->SetState(I_CONNECTED); +217 return this->OnConnected(); +218 break; +219 case I_LISTENING: +220 length = sizeof (client); +221 incoming = accept (this->fd, (sockaddr*)&client,&length); +222 this->OnIncomingConnection(incoming,inet_ntoa(client.sin_addr)); +223 return true; +224 break; +225 case I_CONNECTED: +226 return this->OnDataReady(); +227 break; +228 default: +229 break; +230 } +231 } +232 return true; +233 } .fi .PP .SS "char * InspSocket::Read ()\fC [virtual]\fP" .PP -Definition at line 141 of file socket.cpp. +Definition at line 149 of file socket.cpp. .PP References DEBUG, and ibuf. .PP .nf -142 { -143 int n = recv(this->fd,this->ibuf,sizeof(this->ibuf),0); -144 if (n > 0) -145 { -146 ibuf[n] = 0; -147 return ibuf; -148 } -149 else -150 { -151 log(DEBUG,'EOF or error on socket'); -152 return NULL; -153 } -154 } +150 { +151 int n = recv(this->fd,this->ibuf,sizeof(this->ibuf),0); +152 if (n > 0) +153 { +154 ibuf[n] = 0; +155 return ibuf; +156 } +157 else +158 { +159 log(DEBUG,'EOF or error on socket'); +160 return NULL; +161 } +162 } .fi .PP .SS "void InspSocket::SetState (\fBInspSocketState\fP s)" .PP -Definition at line 227 of file socket.cpp. +Definition at line 235 of file socket.cpp. .PP References DEBUG, and state. .PP Referenced by Poll(). .PP .nf -228 { -229 log(DEBUG,'Socket state change'); -230 this->state = s; -231 } +236 { +237 log(DEBUG,'Socket state change'); +238 this->state = s; +239 } .fi .PP .SS "int InspSocket::Write (\fBstd::string\fP data)\fC [virtual]\fP" .PP -Definition at line 160 of file socket.cpp. +Definition at line 168 of file socket.cpp. .PP .nf -161 { -162 char* d = (char*)data.c_str(); -163 unsigned int written = 0; -164 int n = 0; -165 int s = data.length(); -166 while ((written < data.length()) && (n >= 0)) -167 { -168 n = send(this->fd,d,s,0); -169 if (n > 0) -170 { -171 // If we didnt write everything, advance -172 // the pointers so that when we retry -173 // the next time around the loop, we try -174 // to write what we failed to write before. -175 written += n; -176 s -= n; -177 d += n; -178 } -179 } -180 return written; -181 } +169 { +170 char* d = (char*)data.c_str(); +171 unsigned int written = 0; +172 int n = 0; +173 int s = data.length(); +174 while ((written < data.length()) && (n >= 0)) +175 { +176 n = send(this->fd,d,s,0); +177 if (n > 0) +178 { +179 // If we didnt write everything, advance +180 // the pointers so that when we retry +181 // the next time around the loop, we try +182 // to write what we failed to write before. +183 written += n; +184 s -= n; +185 d += n; +186 } +187 } +188 return written; +189 } .fi .PP .SH "Member Data Documentation" @@ -460,7 +481,7 @@ Definition at line 38 of file socket.h. Referenced by InspSocket(). .SS "sockaddr_in \fBInspSocket::client\fP\fC [private]\fP" .PP -Definition at line 43 of file socket.h. +Definition at line 44 of file socket.h. .PP Referenced by Poll(). .SS "int \fBInspSocket::fd\fP\fC [private]\fP" @@ -471,14 +492,19 @@ Referenced by Close(), InspSocket(), and Poll(). .SS "\fBstd::string\fP \fBInspSocket::host\fP\fC [private]\fP" .PP Definition at line 34 of file socket.h. -.SS "char \fBInspSocket::ibuf\fP[1024]\fC [private]\fP" +.SS "char \fBInspSocket::ibuf\fP[16384]\fC [private]\fP" .PP Definition at line 42 of file socket.h. .PP Referenced by Read(). +.SS "\fBstd::string\fP \fBInspSocket::IP\fP\fC [private]\fP" +.PP +Definition at line 43 of file socket.h. +.PP +Referenced by GetIP(), and InspSocket(). .SS "socklen_t \fBInspSocket::length\fP\fC [private]\fP" .PP -Definition at line 45 of file socket.h. +Definition at line 46 of file socket.h. .PP Referenced by Poll(). .SS "pollfd \fBInspSocket::polls\fP\fC [private]\fP" @@ -491,7 +517,7 @@ Referenced by Poll(). Definition at line 35 of file socket.h. .SS "sockaddr_in \fBInspSocket::server\fP\fC [private]\fP" .PP -Definition at line 44 of file socket.h. +Definition at line 45 of file socket.h. .SS "\fBInspSocketState\fP \fBInspSocket::state\fP\fC [private]\fP" .PP Definition at line 36 of file socket.h. diff --git a/docs/man/man3/InviteItem.3 b/docs/man/man3/InviteItem.3 index 11c1fd0b6..03bba1468 100644 --- a/docs/man/man3/InviteItem.3 +++ b/docs/man/man3/InviteItem.3 @@ -1,4 +1,4 @@ -.TH "InviteItem" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "InviteItem" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/Invited.3 b/docs/man/man3/Invited.3 index 18e08bb8e..faf75bc02 100644 --- a/docs/man/man3/Invited.3 +++ b/docs/man/man3/Invited.3 @@ -1,4 +1,4 @@ -.TH "Invited" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "Invited" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -23,12 +23,12 @@ Inherits \fBclassbase\fP. .PP Holds a channel name to which a user has been invited. .PP -Definition at line 36 of file users.h. +Definition at line 39 of file users.h. .SH "Member Data Documentation" .PP .SS "char \fBInvited::channel\fP[CHANMAX]" .PP -Definition at line 39 of file users.h. +Definition at line 42 of file users.h. .PP Referenced by userrec::InviteTo(). diff --git a/docs/man/man3/KLine.3 b/docs/man/man3/KLine.3 index f0cbd2b59..81341d10c 100644 --- a/docs/man/man3/KLine.3 +++ b/docs/man/man3/KLine.3 @@ -1,4 +1,4 @@ -.TH "KLine" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "KLine" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/ModeParameter.3 b/docs/man/man3/ModeParameter.3 index d2740f9ed..a6388f4c3 100644 --- a/docs/man/man3/ModeParameter.3 +++ b/docs/man/man3/ModeParameter.3 @@ -1,4 +1,4 @@ -.TH "ModeParameter" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ModeParameter" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/Module.3 b/docs/man/man3/Module.3 index 335d8a5a5..e5b842580 100644 --- a/docs/man/man3/Module.3 +++ b/docs/man/man3/Module.3 @@ -1,4 +1,4 @@ -.TH "Module" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "Module" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -16,9 +16,9 @@ Inherits \fBclassbase\fP. .in +1c .ti -1c -.RI "\fBModule\fP ()" +.RI "\fBModule\fP (\fBServer\fP *Me)" .br -.RI "\fIDefault constructor creates a module class. \fP" +.RI "\fIDefault constructor Creates a module class. \fP" .ti -1c .RI "virtual \fB~Module\fP ()" .br @@ -32,7 +32,7 @@ Inherits \fBclassbase\fP. .br .RI "\fICalled when a user connects. \fP" .ti -1c -.RI "virtual void \fBOnUserQuit\fP (\fBuserrec\fP *user)" +.RI "virtual void \fBOnUserQuit\fP (\fBuserrec\fP *user, \fBstd::string\fP message)" .br .RI "\fICalled when a user quits. \fP" .ti -1c @@ -48,15 +48,7 @@ Inherits \fBclassbase\fP. .br .RI "\fICalled when a user parts a channel. \fP" .ti -1c -.RI "virtual void \fBOnPacketTransmit\fP (\fBstd::string\fP &data, \fBstd::string\fP serv)" -.br -.RI "\fICalled before a packet is transmitted across the irc network between two irc servers. \fP" -.ti -1c -.RI "virtual void \fBOnPacketReceive\fP (\fBstd::string\fP &data, \fBstd::string\fP serv)" -.br -.RI "\fICalled after a packet is received from another irc server. \fP" -.ti -1c -.RI "virtual void \fBOnRehash\fP ()" +.RI "virtual void \fBOnRehash\fP (\fBstd::string\fP parameter)" .br .RI "\fICalled on rehash. \fP" .ti -1c @@ -80,7 +72,7 @@ Inherits \fBclassbase\fP. .br .RI "\fICalled whenever a user is kicked. \fP" .ti -1c -.RI "virtual void \fBOnOper\fP (\fBuserrec\fP *user)" +.RI "virtual void \fBOnOper\fP (\fBuserrec\fP *user, \fBstd::string\fP opertype)" .br .RI "\fICalled whenever a user opers locally. \fP" .ti -1c @@ -96,6 +88,10 @@ Inherits \fBclassbase\fP. .br .RI "\fICalled whenever a user is about to invite another user into a channel, before any processing is done. \fP" .ti -1c +.RI "virtual void \fBOnUserInvite\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBchanrec\fP *channel)" +.br +.RI "\fICalled after a user has been successfully invited to a channel. \fP" +.ti -1c .RI "virtual int \fBOnUserPreMessage\fP (\fBuserrec\fP *user, void *dest, int target_type, \fBstd::string\fP &text)" .br .RI "\fICalled whenever a user is about to PRIVMSG A user or a channel, before any processing is done. \fP" @@ -108,21 +104,111 @@ Inherits \fBclassbase\fP. .br .RI "\fICalled before any nickchange, local or remote. \fP" .ti -1c -.RI "virtual void \fBOnUserPostNick\fP (\fBuserrec\fP *user, \fBstd::string\fP oldnick)" +.RI "virtual void \fBOnUserMessage\fP (\fBuserrec\fP *user, void *dest, int target_type, \fBstd::string\fP text)" .br -.RI "\fICalled after any nickchange, local or remote. \fP" +.RI "\fICalled after any PRIVMSG sent from a user. \fP" .ti -1c -.RI "virtual int \fBOnAccessCheck\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBchanrec\fP *channel, int access_type)" +.RI "virtual void \fBOnUserNotice\fP (\fBuserrec\fP *user, void *dest, int target_type, \fBstd::string\fP text)" +.br +.RI "\fICalled after any NOTICE sent from a user. \fP" +.ti -1c +.RI "virtual void \fBOnMode\fP (\fBuserrec\fP *user, void *dest, int target_type, \fBstd::string\fP text)" +.br +.RI "\fICalled after every MODE command sent from a user The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* if target_type is TYPE_CHANNEL. \fP" +.ti -1c +.RI "virtual void \fBOnGetServerDescription\fP (\fBstd::string\fP servername, \fBstd::string\fP &description)" +.br +.RI "\fIAllows modules to alter or create server descriptions Whenever a module requires a server description, for example for display in WHOIS, this function is called in all modules. \fP" +.ti -1c +.RI "virtual void \fBOnSyncUser\fP (\fBuserrec\fP *user, \fBModule\fP *proto, void *opaque)" +.br +.RI "\fIAllows modules to synchronize data which relates to users during a netburst. \fP" +.ti -1c +.RI "virtual void \fBOnSyncChannel\fP (\fBchanrec\fP *chan, \fBModule\fP *proto, void *opaque)" +.br +.RI "\fIAllows modules to synchronize data which relates to channels during a netburst. \fP" +.ti -1c +.RI "virtual void \fBOnSyncChannelMetaData\fP (\fBchanrec\fP *chan, \fBModule\fP *proto, void *opaque, \fBstd::string\fP extname)" +.br +.ti -1c +.RI "virtual void \fBOnSyncUserMetaData\fP (\fBuserrec\fP *user, \fBModule\fP *proto, void *opaque, \fBstd::string\fP extname)" .br -.RI "\fICalled before an action which requires a channel privilage check. \fP" .ti -1c -.RI "virtual \fBstring_list\fP \fBOnUserSync\fP (\fBuserrec\fP *user)" +.RI "virtual void \fBOnDecodeMetaData\fP (int target_type, void *target, \fBstd::string\fP extname, \fBstd::string\fP extdata)" .br -.RI "\fICalled during a netburst to sync user data. \fP" +.RI "\fIAllows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. \fP" .ti -1c -.RI "virtual \fBstring_list\fP \fBOnChannelSync\fP (\fBchanrec\fP *chan)" +.RI "virtual void \fBProtoSendMode\fP (void *opaque, int target_type, void *target, \fBstd::string\fP modeline)" .br -.RI "\fICalled during a netburst to sync channel data. \fP" +.RI "\fIImplemented by modules which provide the ability to link servers. \fP" +.ti -1c +.RI "virtual void \fBProtoSendMetaData\fP (void *opaque, int target_type, void *target, \fBstd::string\fP extname, \fBstd::string\fP extdata)" +.br +.RI "\fIImplemented by modules which provide the ability to link servers. \fP" +.ti -1c +.RI "virtual void \fBOnWallops\fP (\fBuserrec\fP *user, \fBstd::string\fP text)" +.br +.RI "\fICalled after every WALLOPS command. \fP" +.ti -1c +.RI "virtual void \fBOnChangeHost\fP (\fBuserrec\fP *user, \fBstd::string\fP newhost)" +.br +.RI "\fICalled whenever a user's hostname is changed. \fP" +.ti -1c +.RI "virtual void \fBOnChangeName\fP (\fBuserrec\fP *user, \fBstd::string\fP gecos)" +.br +.RI "\fICalled whenever a user's GECOS (realname) is changed. \fP" +.ti -1c +.RI "virtual void \fBOnAddGLine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)" +.br +.RI "\fICalled whenever a gline is added by a local user. \fP" +.ti -1c +.RI "virtual void \fBOnAddZLine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP ipmask)" +.br +.RI "\fICalled whenever a zline is added by a local user. \fP" +.ti -1c +.RI "virtual void \fBOnAddKLine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)" +.br +.RI "\fICalled whenever a kline is added by a local user. \fP" +.ti -1c +.RI "virtual void \fBOnAddQLine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP nickmask)" +.br +.RI "\fICalled whenever a qline is added by a local user. \fP" +.ti -1c +.RI "virtual void \fBOnAddELine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)" +.br +.RI "\fICalled whenever a eline is added by a local user. \fP" +.ti -1c +.RI "virtual void \fBOnDelGLine\fP (\fBuserrec\fP *source, \fBstd::string\fP hostmask)" +.br +.RI "\fICalled whenever a gline is deleted. \fP" +.ti -1c +.RI "virtual void \fBOnDelZLine\fP (\fBuserrec\fP *source, \fBstd::string\fP ipmask)" +.br +.RI "\fICalled whenever a zline is deleted. \fP" +.ti -1c +.RI "virtual void \fBOnDelKLine\fP (\fBuserrec\fP *source, \fBstd::string\fP hostmask)" +.br +.RI "\fICalled whenever a kline is deleted. \fP" +.ti -1c +.RI "virtual void \fBOnDelQLine\fP (\fBuserrec\fP *source, \fBstd::string\fP nickmask)" +.br +.RI "\fICalled whenever a qline is deleted. \fP" +.ti -1c +.RI "virtual void \fBOnDelELine\fP (\fBuserrec\fP *source, \fBstd::string\fP hostmask)" +.br +.RI "\fICalled whenever a eline is deleted. \fP" +.ti -1c +.RI "virtual void \fBOnCleanup\fP (int target_type, void *item)" +.br +.RI "\fICalled before your module is unloaded to clean up Extensibles. \fP" +.ti -1c +.RI "virtual void \fBOnUserPostNick\fP (\fBuserrec\fP *user, \fBstd::string\fP oldnick)" +.br +.RI "\fICalled after any nickchange, local or remote. \fP" +.ti -1c +.RI "virtual int \fBOnAccessCheck\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBchanrec\fP *channel, int access_type)" +.br +.RI "\fICalled before an action which requires a channel privilage check. \fP" .ti -1c .RI "virtual void \fBOn005Numeric\fP (\fBstd::string\fP &output)" .br @@ -132,6 +218,10 @@ Inherits \fBclassbase\fP. .br .RI "\fICalled when a client is disconnected by KILL. \fP" .ti -1c +.RI "virtual void \fBOnRemoteKill\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBstd::string\fP reason)" +.br +.RI "\fICalled when an oper wants to disconnect a remote user via KILL. \fP" +.ti -1c .RI "virtual void \fBOnLoadModule\fP (\fBModule\fP *mod, \fBstd::string\fP name)" .br .RI "\fICalled whenever a module is loaded. \fP" @@ -196,6 +286,10 @@ Inherits \fBclassbase\fP. .br .RI "\fICalled whenever a topic is changed by a local user. \fP" .ti -1c +.RI "virtual void \fBOnPostLocalTopicChange\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan, \fBstd::string\fP topic)" +.br +.RI "\fICalled whenever a local topic has been changed. \fP" +.ti -1c .RI "virtual void \fBOnEvent\fP (\fBEvent\fP *event)" .br .RI "\fICalled whenever an \fBEvent\fP class is sent to all module by another module. \fP" @@ -246,27 +340,34 @@ Base class for all InspIRCd modules This class is the base class for InspIRCd mo All modules must inherit from this class, its methods will be called when irc server events occur. class inherited from module must be instantiated by the \fBModuleFactory\fP class (see relevent section) for the plugin to be initialised. .PP -Definition at line 238 of file modules.h. +Definition at line 239 of file modules.h. .SH "Constructor & Destructor Documentation" .PP -.SS "Module::Module ()" +.SS "Module::Module (\fBServer\fP * Me)" .PP -Default constructor creates a module class. +Default constructor Creates a module class. .PP -Definition at line 306 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIMe\fP An instance of the \fBServer\fP class which can be saved for future use +.RE +.PP + +.PP +Definition at line 307 of file modules.cpp. .PP .nf -306 { } +307 { } .fi .PP .SS "Module::~Module ()\fC [virtual]\fP" .PP Default destructor destroys a module class. .PP -Definition at line 307 of file modules.cpp. +Definition at line 308 of file modules.cpp. .PP .nf -307 { } +308 { } .fi .PP .SH "Member Function Documentation" @@ -277,19 +378,26 @@ Returns the version number of a Module. .PP The method should return a \fBVersion\fP object with its version information assigned via \fBVersion::Version\fP .PP -Definition at line 319 of file modules.cpp. +Definition at line 321 of file modules.cpp. .PP References VF_VENDOR. .PP .nf -319 { return Version(1,0,0,0,VF_VENDOR); } +321 { return Version(1,0,0,0,VF_VENDOR); } .fi .PP .SS "void Module::On005Numeric (\fBstd::string\fP & output)\fC [virtual]\fP" .PP Called when a 005 numeric is about to be output. .PP -The module should modify the 005 numeric if needed to indicate its features. +The module should modify the 005 numeric if needed to indicate its features. +.PP +\fBParameters:\fP +.RS 4 +\fIoutput\fP The 005 string to be modified if neccessary. +.RE +.PP + .PP Definition at line 331 of file modules.cpp. .PP @@ -323,21 +431,50 @@ This function is called before many functions which check a users status on a ch .br AC_GENERAL_MODE (8) - a user channel mode is being changed<br> .br - Upon returning from your function you must return either ACR_DEFAULT, to indicate the module wishes to do nothing, or ACR_DENY where approprate to deny the action, and ACR_ALLOW where appropriate to allow the action. Please note that in the case of some access checks (such as AC_GENERAL_MODE) access may be denied 'upstream' causing other checks such as AC_DEOP to not be reached. Be very careful with use of the AC_GENERAL_MODE type, as it may inadvertently override the behaviour of other modules. When the access_type is AC_GENERAL_MODE, the destination of the mode will be NULL (as it has not yet been determined). + Upon returning from your function you must return either ACR_DEFAULT, to indicate the module wishes to do nothing, or ACR_DENY where approprate to deny the action, and ACR_ALLOW where appropriate to allow the action. Please note that in the case of some access checks (such as AC_GENERAL_MODE) access may be denied 'upstream' causing other checks such as AC_DEOP to not be reached. Be very careful with use of the AC_GENERAL_MODE type, as it may inadvertently override the behaviour of other modules. When the access_type is AC_GENERAL_MODE, the destination of the mode will be NULL (as it has not yet been determined). .PP -Definition at line 328 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIsource\fP The source of the access check +.br +\fIdest\fP The destination of the access check +.br +\fIchannel\fP The channel which is being checked +.br +\fIaccess_type\fP See above +.RE +.PP + +.PP +Definition at line 330 of file modules.cpp. .PP References ACR_DEFAULT. .PP .nf -328 { return ACR_DEFAULT; }; +330 { return ACR_DEFAULT; }; .fi .PP .SS "int Module::OnAddBan (\fBuserrec\fP * source, \fBchanrec\fP * channel, \fBstd::string\fP banmask)\fC [virtual]\fP" .PP Called whenever a ban is added to a channel's list. .PP -Return a non-zero value to 'eat' the mode change and prevent the ban from being added. +Return a non-zero value to 'eat' the mode change and prevent the ban from being added. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user adding the ban +.br +\fIchannel\fP The channel the ban is being added to +.br +\fIbanmask\fP The ban mask being added +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to block the ban, 0 to continue as normal +.RE +.PP + .PP Definition at line 356 of file modules.cpp. .PP @@ -345,11 +482,143 @@ Definition at line 356 of file modules.cpp. 356 { return 0; }; .fi .PP +.SS "void Module::OnAddELine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)\fC [virtual]\fP" +.PP +Called whenever a eline is added by a local user. +.PP +This method is triggered after the line is added. +.PP +\fBParameters:\fP +.RS 4 +\fIduration\fP The duration of the line in seconds +.br +\fIsource\fP The sender of the line +.br +\fIreason\fP The reason text to be displayed +.br +\fIhostmask\fP The hostmask to add +.RE +.PP + +.PP +Definition at line 382 of file modules.cpp. +.PP +.nf +382 { }; +.fi +.PP +.SS "void Module::OnAddGLine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)\fC [virtual]\fP" +.PP +Called whenever a gline is added by a local user. +.PP +This method is triggered after the line is added. +.PP +\fBParameters:\fP +.RS 4 +\fIduration\fP The duration of the line in seconds +.br +\fIsource\fP The sender of the line +.br +\fIreason\fP The reason text to be displayed +.br +\fIhostmask\fP The hostmask to add +.RE +.PP + +.PP +Definition at line 378 of file modules.cpp. +.PP +.nf +378 { }; +.fi +.PP +.SS "void Module::OnAddKLine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)\fC [virtual]\fP" +.PP +Called whenever a kline is added by a local user. +.PP +This method is triggered after the line is added. +.PP +\fBParameters:\fP +.RS 4 +\fIduration\fP The duration of the line in seconds +.br +\fIsource\fP The sender of the line +.br +\fIreason\fP The reason text to be displayed +.br +\fIhostmask\fP The hostmask to add +.RE +.PP + +.PP +Definition at line 380 of file modules.cpp. +.PP +.nf +380 { }; +.fi +.PP +.SS "void Module::OnAddQLine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP nickmask)\fC [virtual]\fP" +.PP +Called whenever a qline is added by a local user. +.PP +This method is triggered after the line is added. +.PP +\fBParameters:\fP +.RS 4 +\fIduration\fP The duration of the line in seconds +.br +\fIsource\fP The sender of the line +.br +\fIreason\fP The reason text to be displayed +.br +\fInickmask\fP The hostmask to add +.RE +.PP + +.PP +Definition at line 381 of file modules.cpp. +.PP +.nf +381 { }; +.fi +.PP +.SS "void Module::OnAddZLine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP ipmask)\fC [virtual]\fP" +.PP +Called whenever a zline is added by a local user. +.PP +This method is triggered after the line is added. +.PP +\fBParameters:\fP +.RS 4 +\fIduration\fP The duration of the line in seconds +.br +\fIsource\fP The sender of the line +.br +\fIreason\fP The reason text to be displayed +.br +\fIipmask\fP The hostmask to add +.RE +.PP + +.PP +Definition at line 379 of file modules.cpp. +.PP +.nf +379 { }; +.fi +.PP .SS "void Module::OnBackgroundTimer (time_t curtime)\fC [virtual]\fP" .PP Called once every five seconds for background processing. .PP -This timer can be used to control timed features. Its period is not accurate enough to be used as a clock, but it is gauranteed to be called at least once in any five second period, directly from the main loop of the server. +This timer can be used to control timed features. Its period is not accurate enough to be used as a clock, but it is gauranteed to be called at least once in any five second period, directly from the main loop of the server. +.PP +\fBParameters:\fP +.RS 4 +\fIcurtime\fP The current timer derived from time(2) +.RE +.PP + .PP Definition at line 335 of file modules.cpp. .PP @@ -357,11 +626,46 @@ Definition at line 335 of file modules.cpp. 335 { }; .fi .PP +.SS "void Module::OnChangeHost (\fBuserrec\fP * user, \fBstd::string\fP newhost)\fC [virtual]\fP" +.PP +Called whenever a user's hostname is changed. +.PP +This event triggers after the host has been set. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user whos host is being changed +.br +\fInewhost\fP The new hostname being set +.RE +.PP + +.PP +Definition at line 376 of file modules.cpp. +.PP +.nf +376 { }; +.fi +.PP .SS "int Module::OnChangeLocalUserGECOS (\fBuserrec\fP * user, \fBstd::string\fP newhost)\fC [virtual]\fP" .PP Called whenever a change of a local users GECOS (fullname field) is attempted. .PP -return 1 to deny the name change, or 0 to allow it. +return 1 to deny the name change, or 0 to allow it. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user whos GECOS will be changed +.br +\fInewhost\fP The new GECOS +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to deny the GECOS change, 0 to allow +.RE +.PP + .PP Definition at line 349 of file modules.cpp. .PP @@ -373,7 +677,21 @@ Definition at line 349 of file modules.cpp. .PP Called whenever a change of a local users displayed host is attempted. .PP -Return 1 to deny the host change, or 0 to allow it. +Return 1 to deny the host change, or 0 to allow it. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user whos host will be changed +.br +\fInewhost\fP The new hostname +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to deny the host change, 0 to allow +.RE +.PP + .PP Definition at line 348 of file modules.cpp. .PP @@ -381,23 +699,46 @@ Definition at line 348 of file modules.cpp. 348 { return 0; }; .fi .PP -.SS "\fBstring_list\fP Module::OnChannelSync (\fBchanrec\fP * chan)\fC [virtual]\fP" +.SS "void Module::OnChangeName (\fBuserrec\fP * user, \fBstd::string\fP gecos)\fC [virtual]\fP" .PP -Called during a netburst to sync channel data. +Called whenever a user's GECOS (realname) is changed. .PP -This is called during the netburst on a per-channel basis. You should use this call to up any special channel-related things which are implemented by your module, e.g. sending listmodes. You may return multiple commands in the string_list. +This event triggers after the name has been set. .PP -Definition at line 330 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who's GECOS is being changed +.br +\fIgecos\fP The new GECOS being set on the user +.RE +.PP + +.PP +Definition at line 377 of file modules.cpp. .PP .nf -330 { string_list empty; return empty; } +377 { }; .fi .PP .SS "int Module::OnCheckBan (\fBuserrec\fP * user, \fBchanrec\fP * chan)\fC [virtual]\fP" .PP Called whenever a user joins a channel, to determine if banlist checks should go ahead or not. .PP -This method will always be called for each join, wether or not the user actually matches a channel ban, and determines the outcome of an if statement around the whole section of ban checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. +This method will always be called for each join, wether or not the user actually matches a channel ban, and determines the outcome of an if statement around the whole section of ban checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user joining the channel +.br +\fIchan\fP The channel being joined +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to explicitly allow the join, 0 to proceed as normal +.RE +.PP + .PP Definition at line 346 of file modules.cpp. .PP @@ -409,7 +750,21 @@ Definition at line 346 of file modules.cpp. .PP Called whenever a user joins a channel, to determine if invite checks should go ahead or not. .PP -This method will always be called for each join, wether or not the channel is actually +i, and determines the outcome of an if statement around the whole section of invite checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. +This method will always be called for each join, wether or not the channel is actually +i, and determines the outcome of an if statement around the whole section of invite checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user joining the channel +.br +\fIchan\fP The channel being joined +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to explicitly allow the join, 0 to proceed as normal +.RE +.PP + .PP Definition at line 343 of file modules.cpp. .PP @@ -421,7 +776,21 @@ Definition at line 343 of file modules.cpp. .PP Called whenever a user joins a channel, to determine if key checks should go ahead or not. .PP -This method will always be called for each join, wether or not the channel is actually +k, and determines the outcome of an if statement around the whole section of key checking code. if the user specified no key, the keygiven string will be a valid but empty value. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. +This method will always be called for each join, wether or not the channel is actually +k, and determines the outcome of an if statement around the whole section of key checking code. if the user specified no key, the keygiven string will be a valid but empty value. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user joining the channel +.br +\fIchan\fP The channel being joined +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to explicitly allow the join, 0 to proceed as normal +.RE +.PP + .PP Definition at line 344 of file modules.cpp. .PP @@ -433,7 +802,21 @@ Definition at line 344 of file modules.cpp. .PP Called whenever a user joins a channel, to determine if channel limit checks should go ahead or not. .PP -This method will always be called for each join, wether or not the channel is actually +l, and determines the outcome of an if statement around the whole section of channel limit checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. +This method will always be called for each join, wether or not the channel is actually +l, and determines the outcome of an if statement around the whole section of channel limit checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user joining the channel +.br +\fIchan\fP The channel being joined +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to explicitly allow the join, 0 to proceed as normal +.RE +.PP + .PP Definition at line 345 of file modules.cpp. .PP @@ -445,7 +828,19 @@ Definition at line 345 of file modules.cpp. .PP Called to check if a user who is connecting can now be allowed to register If any modules return false for this function, the user is held in the waiting state until all modules return true. .PP -For example a module which implements ident lookups will continue to return false for a user until their ident lookup is completed. Note that the registration timeout for a user overrides these checks, if the registration timeout is reached, the user is disconnected even if modules report that the user is not ready to connect. +For example a module which implements ident lookups will continue to return false for a user until their ident lookup is completed. Note that the registration timeout for a user overrides these checks, if the registration timeout is reached, the user is disconnected even if modules report that the user is not ready to connect. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user to check +.RE +.PP +\fBReturns:\fP +.RS 4 +true to indicate readiness, false if otherwise +.RE +.PP + .PP Definition at line 338 of file modules.cpp. .PP @@ -453,11 +848,73 @@ Definition at line 338 of file modules.cpp. 338 { return true; }; .fi .PP +.SS "void Module::OnCleanup (int target_type, void * item)\fC [virtual]\fP" +.PP +Called before your module is unloaded to clean up Extensibles. +.PP +This method is called once for every user and channel on the network, so that when your module unloads it may clear up any remaining data in the form of Extensibles added using \fBExtensible::Extend()\fP. If the target_type variable is TYPE_USER, then void* item refers to a userrec*, otherwise it refers to a chanrec*. +.PP +\fBParameters:\fP +.RS 4 +\fItarget_type\fP The type of item being cleaned +.br +\fIitem\fP A pointer to the item's class +.RE +.PP + +.PP +Definition at line 388 of file modules.cpp. +.PP +.nf +388 { }; +.fi +.PP +.SS "void Module::OnDecodeMetaData (int target_type, void * target, \fBstd::string\fP extname, \fBstd::string\fP extdata)\fC [virtual]\fP" +.PP +Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. +.PP +Please see src/modules/m_swhois.cpp for a working example of how to use this method call. +.PP +\fBParameters:\fP +.RS 4 +\fItarget_type\fP The type of item to decode data for, TYPE_USER or TYPE_CHANNEL +.br +\fItarget\fP The chanrec* or userrec* that data should be added to +.br +\fIextname\fP The extension name which is being sent +.br +\fIextdata\fP The extension data, encoded at the other end by an identical module through OnSyncChannelMetaData or OnSyncUserMetaData +.RE +.PP + +.PP +Definition at line 373 of file modules.cpp. +.PP +.nf +373 { }; +.fi +.PP .SS "int Module::OnDelBan (\fBuserrec\fP * source, \fBchanrec\fP * channel, \fBstd::string\fP banmask)\fC [virtual]\fP" .PP Called whenever a ban is removed from a channel's list. .PP -Return a non-zero value to 'eat' the mode change and prevent the ban from being removed. +Return a non-zero value to 'eat' the mode change and prevent the ban from being removed. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user deleting the ban +.br +\fIchannel\fP The channel the ban is being deleted from +.br +\fIbanmask\fP The ban mask being deleted +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to block the unban, 0 to continue as normal +.RE +.PP + .PP Definition at line 357 of file modules.cpp. .PP @@ -465,11 +922,123 @@ Definition at line 357 of file modules.cpp. 357 { return 0; }; .fi .PP +.SS "void Module::OnDelELine (\fBuserrec\fP * source, \fBstd::string\fP hostmask)\fC [virtual]\fP" +.PP +Called whenever a eline is deleted. +.PP +This method is triggered after the line is deleted. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user removing the line +.br +\fIhostmask\fP The hostmask to delete +.RE +.PP + +.PP +Definition at line 387 of file modules.cpp. +.PP +.nf +387 { }; +.fi +.PP +.SS "void Module::OnDelGLine (\fBuserrec\fP * source, \fBstd::string\fP hostmask)\fC [virtual]\fP" +.PP +Called whenever a gline is deleted. +.PP +This method is triggered after the line is deleted. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user removing the line +.br +\fIhostmask\fP The hostmask to delete +.RE +.PP + +.PP +Definition at line 383 of file modules.cpp. +.PP +.nf +383 { }; +.fi +.PP +.SS "void Module::OnDelKLine (\fBuserrec\fP * source, \fBstd::string\fP hostmask)\fC [virtual]\fP" +.PP +Called whenever a kline is deleted. +.PP +This method is triggered after the line is deleted. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user removing the line +.br +\fIhostmask\fP The hostmask to delete +.RE +.PP + +.PP +Definition at line 385 of file modules.cpp. +.PP +.nf +385 { }; +.fi +.PP +.SS "void Module::OnDelQLine (\fBuserrec\fP * source, \fBstd::string\fP nickmask)\fC [virtual]\fP" +.PP +Called whenever a qline is deleted. +.PP +This method is triggered after the line is deleted. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user removing the line +.br +\fIhostmask\fP The hostmask to delete +.RE +.PP + +.PP +Definition at line 386 of file modules.cpp. +.PP +.nf +386 { }; +.fi +.PP +.SS "void Module::OnDelZLine (\fBuserrec\fP * source, \fBstd::string\fP ipmask)\fC [virtual]\fP" +.PP +Called whenever a zline is deleted. +.PP +This method is triggered after the line is deleted. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user removing the line +.br +\fIhostmask\fP The hostmask to delete +.RE +.PP + +.PP +Definition at line 384 of file modules.cpp. +.PP +.nf +384 { }; +.fi +.PP .SS "void Module::OnEvent (\fBEvent\fP * event)\fC [virtual]\fP" .PP Called whenever an \fBEvent\fP class is sent to all module by another module. .PP -Please see the documentation of \fBEvent::Send()\fP for further information. The \fBEvent\fP sent can always be assumed to be non-NULL, you should *always* check the value of \fBEvent::GetEventID()\fP before doing anything to the event data, and you should *not* change the event data in any way! +Please see the documentation of \fBEvent::Send()\fP for further information. The \fBEvent\fP sent can always be assumed to be non-NULL, you should *always* check the value of \fBEvent::GetEventID()\fP before doing anything to the event data, and you should *not* change the event data in any way! +.PP +\fBParameters:\fP +.RS 4 +\fIevent\fP The \fBEvent\fP class being received +.RE +.PP + .PP Definition at line 351 of file modules.cpp. .PP @@ -481,19 +1050,64 @@ Definition at line 351 of file modules.cpp. .PP Called whenever an extended mode is to be processed. .PP -The type parameter is MT_SERVER, MT_CLIENT or MT_CHANNEL, dependent on where the mode is being changed. mode_on is set when the mode is being set, in which case params contains a list of parameters for the mode as strings. If mode_on is false, the mode is being removed, and parameters may contain the parameters for the mode, dependent on wether they were defined when a mode handler was set up with \fBServer::AddExtendedMode\fP If the mode is a channel mode, target is a chanrec*, and if it is a user mode, target is a userrec*. You must cast this value yourself to make use of it. +The type parameter is MT_SERVER, MT_CLIENT or MT_CHANNEL, dependent on where the mode is being changed. mode_on is set when the mode is being set, in which case params contains a list of parameters for the mode as strings. If mode_on is false, the mode is being removed, and parameters may contain the parameters for the mode, dependent on wether they were defined when a mode handler was set up with \fBServer::AddExtendedMode\fP If the mode is a channel mode, target is a chanrec*, and if it is a user mode, target is a userrec*. You must cast this value yourself to make use of it. .PP -Definition at line 318 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user issuing the mode +.br +\fItarget\fP The user or channel having the mode set on them +.br +\fImodechar\fP The mode character being set +.br +\fItype\fP The type of mode (user or channel) being set +.br +\fImode_on\fP True if the mode is being set, false if it is being unset +.br +\fIparams\fP A list of parameters for any channel mode (currently supports either 0 or 1 parameters) +.RE +.PP + +.PP +Definition at line 319 of file modules.cpp. +.PP +.nf +319 { return false; } +.fi +.PP +.SS "void Module::OnGetServerDescription (\fBstd::string\fP servername, \fBstd::string\fP & description)\fC [virtual]\fP" +.PP +Allows modules to alter or create server descriptions Whenever a module requires a server description, for example for display in WHOIS, this function is called in all modules. +.PP +You may change or define the description given in \fBstd::string\fP &description. If you do, this description will be shown in the WHOIS fields. +.PP +\fBParameters:\fP +.RS 4 +\fIservername\fP The servername being searched for +.br +\fIdescription\fP Alterable server description for this server +.RE +.PP + +.PP +Definition at line 367 of file modules.cpp. .PP .nf -318 { return false; } +367 { }; .fi .PP .SS "void Module::OnGlobalConnect (\fBuserrec\fP * user)\fC [virtual]\fP" .PP Called whenever a user connects, anywhere on the network. .PP -This event is informational only. You should not change any user information in this event. To do so, use the OnUserConnect method to change the state of local users. +This event is informational only. You should not change any user information in this event. To do so, use the OnUserConnect method to change the state of local users. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who is connecting +.RE +.PP + .PP Definition at line 355 of file modules.cpp. .PP @@ -505,7 +1119,14 @@ Definition at line 355 of file modules.cpp. .PP Called whenever a user is given usermode +o, anywhere on the network. .PP -You cannot override this and prevent it from happening as it is already happened and such a task must be performed by another server. You can however bounce modes by sending servermodes out to reverse mode changes. +You cannot override this and prevent it from happening as it is already happened and such a task must be performed by another server. You can however bounce modes by sending servermodes out to reverse mode changes. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who is opering +.RE +.PP + .PP Definition at line 354 of file modules.cpp. .PP @@ -521,17 +1142,40 @@ The userrec will contain the information of the user who typed the command. Modu .PP <nick> :information here .PP -Definition at line 321 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user issuing /INFO +.RE +.PP + +.PP +Definition at line 323 of file modules.cpp. .PP .nf -321 { }; +323 { }; .fi .PP .SS "int Module::OnKill (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBstd::string\fP reason)\fC [virtual]\fP" .PP Called when a client is disconnected by KILL. .PP -If a client is killed by a server, e.g. a nickname collision or protocol error, source is NULL. Return 1 from this function to prevent the kill, and 0 from this function to allow it as normal. If you prevent the kill no output will be sent to the client, it is down to your module to generate this information. NOTE: It is NOT advisable to stop kills which originate from servers. If you do so youre risking race conditions, desyncs and worse! +If a client is killed by a server, e.g. a nickname collision or protocol error, source is NULL. Return 1 from this function to prevent the kill, and 0 from this function to allow it as normal. If you prevent the kill no output will be sent to the client, it is down to your module to generate this information. NOTE: It is NOT advisable to stop kills which originate from servers or remote users. If you do so youre risking race conditions, desyncs and worse! +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user sending the KILL +.br +\fIdest\fP The user being killed +.br +\fIreason\fP The kill reason +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to prevent the kill, 0 to allow +.RE +.PP + .PP Definition at line 332 of file modules.cpp. .PP @@ -543,7 +1187,16 @@ Definition at line 332 of file modules.cpp. .PP Called whenever a module is loaded. .PP -mod will contain a pointer to the module, and string will contain its name, for example m_widgets.so. This function is primary for dependency checking, your module may decide to enable some extra features if it sees that you have for example loaded 'm_killwidgets.so' with 'm_makewidgets.so'. It is highly recommended that modules do *NOT* bail if they cannot satisfy dependencies, but instead operate under reduced functionality, unless the dependency is absolutely neccessary (e.g. a module that extends the features of another module). +mod will contain a pointer to the module, and string will contain its name, for example m_widgets.so. This function is primary for dependency checking, your module may decide to enable some extra features if it sees that you have for example loaded 'm_killwidgets.so' with 'm_makewidgets.so'. It is highly recommended that modules do *NOT* bail if they cannot satisfy dependencies, but instead operate under reduced functionality, unless the dependency is absolutely neccessary (e.g. a module that extends the features of another module). +.PP +\fBParameters:\fP +.RS 4 +\fImod\fP A pointer to the new module +.br +\fIname\fP The new module's filename +.RE +.PP + .PP Definition at line 333 of file modules.cpp. .PP @@ -555,7 +1208,20 @@ Definition at line 333 of file modules.cpp. .PP Called whenever a topic is changed by a local user. .PP -Return 1 to deny the topic change, or 0 to allow it. +Return 1 to deny the topic change, or 0 to allow it. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user changing the topic +.br +\fIchan\fP The channels who's topic is being changed +.br +\fItopic\fP The actual topic text +.br +\fI1\fP to block the topic change, 0 to allow +.RE +.PP + .PP Definition at line 350 of file modules.cpp. .PP @@ -563,11 +1229,24 @@ Definition at line 350 of file modules.cpp. 350 { return 0; }; .fi .PP -.SS "void Module::OnOper (\fBuserrec\fP * user)\fC [virtual]\fP" +.SS "void Module::OnMode (\fBuserrec\fP * user, void * dest, int target_type, \fBstd::string\fP text)\fC [virtual]\fP" .PP -Called whenever a user opers locally. +Called after every MODE command sent from a user The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* if target_type is TYPE_CHANNEL. .PP -The userrec will contain the oper mode 'o' as this function is called after any modifications are made to the user's structure by the core. +The text variable contains the remainder of the mode string after the target, e.g. '+wsi' or '+ooo nick1 nick2 nick3'. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user sending the MODEs +.br +\fIdest\fP The target of the modes (userrec* or chanrec*) +.br +\fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) +.br +\fItext\fP The actual modes and their parameters if any +.RE +.PP + .PP Definition at line 320 of file modules.cpp. .PP @@ -575,47 +1254,99 @@ Definition at line 320 of file modules.cpp. 320 { }; .fi .PP -.SS "int Module::OnOperCompare (\fBstd::string\fP password, \fBstd::string\fP input)\fC [virtual]\fP" +.SS "void Module::OnOper (\fBuserrec\fP * user, \fBstd::string\fP opertype)\fC [virtual]\fP" .PP -Called whenever an oper password is to be compared to what a user has input. +Called whenever a user opers locally. .PP -The password field (from the config file) is in 'password' and is to be compared against 'input'. This method allows for encryption of oper passwords and much more besides. You should return a nonzero value if you want to allow the comparison or zero if you wish to do nothing. +The userrec will contain the oper mode 'o' as this function is called after any modifications are made to the user's structure by the core. .PP -Definition at line 353 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who is opering up +.br +\fIopertype\fP The opers type name +.RE +.PP + +.PP +Definition at line 322 of file modules.cpp. .PP .nf -353 { return 0; }; +322 { }; .fi .PP -.SS "void Module::OnPacketReceive (\fBstd::string\fP & data, \fBstd::string\fP serv)\fC [virtual]\fP" +.SS "int Module::OnOperCompare (\fBstd::string\fP password, \fBstd::string\fP input)\fC [virtual]\fP" .PP -Called after a packet is received from another irc server. +Called whenever an oper password is to be compared to what a user has input. .PP -This allows you to easily represent it in the correct ways to implement encryption, compression, digital signatures and anything else you may want to add. This should be regarded as a pre-processor and will be called immediately after the packet is received but before any other operations with the core of the ircd. +The password field (from the config file) is in 'password' and is to be compared against 'input'. This method allows for encryption of oper passwords and much more besides. You should return a nonzero value if you want to allow the comparison or zero if you wish to do nothing. .PP -Definition at line 314 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIpassword\fP The oper's password +.br +\fIinput\fP The password entered +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to match the passwords, 0 to do nothing +.RE +.PP + +.PP +Definition at line 353 of file modules.cpp. .PP .nf -314 { } +353 { return 0; }; .fi .PP -.SS "void Module::OnPacketTransmit (\fBstd::string\fP & data, \fBstd::string\fP serv)\fC [virtual]\fP" +.SS "void Module::OnPostLocalTopicChange (\fBuserrec\fP * user, \fBchanrec\fP * chan, \fBstd::string\fP topic)\fC [virtual]\fP" .PP -Called before a packet is transmitted across the irc network between two irc servers. +Called whenever a local topic has been changed. .PP -This allows you to easily represent it in the correct ways to implement encryption, compression, digital signatures and anything else you may want to add. This should be regarded as a pre-processor and will be called before ANY other operations within the ircd core program. +To block topic changes you must use OnLocalTopicChange instead. .PP -Definition at line 313 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user changing the topic +.br +\fIchan\fP The channels who's topic is being changed +.br +\fItopic\fP The actual topic text +.RE +.PP + +.PP +Definition at line 366 of file modules.cpp. .PP .nf -313 { } +366 { }; .fi .PP .SS "int Module::OnPreCommand (\fBstd::string\fP command, char ** parameters, int pcnt, \fBuserrec\fP * user)\fC [virtual]\fP" .PP Called whenever any command is about to be executed. .PP -This event occurs for all registered commands, wether they are registered in the core, or another module, but it will not occur for invalid commands (e.g. ones which do not exist within the command table). By returning 1 from this method you may prevent the command being executed. If you do this, no output is created by the core, and it is down to your module to produce any output neccessary. Note that unless you return 1, you should not destroy any structures (e.g. by using \fBServer::QuitUser\fP) otherwise when the command's handler function executes after your method returns, it will be passed an invalid pointer to the user object and crash!) +This event occurs for all registered commands, wether they are registered in the core, or another module, but it will not occur for invalid commands (e.g. ones which do not exist within the command table). By returning 1 from this method you may prevent the command being executed. If you do this, no output is created by the core, and it is down to your module to produce any output neccessary. Note that unless you return 1, you should not destroy any structures (e.g. by using \fBServer::QuitUser\fP) otherwise when the command's handler function executes after your method returns, it will be passed an invalid pointer to the user object and crash!) +.PP +\fBParameters:\fP +.RS 4 +\fIcommand\fP The command being executed +.br +\fIparameters\fP An array of array of characters containing the parameters for the command +.br +\fIpcnt\fP The nuimber of parameters passed to the command +.br +\fIuser\fP the user issuing the command +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to block the command, 0 to allow +.RE +.PP + .PP Definition at line 337 of file modules.cpp. .PP @@ -627,7 +1358,29 @@ Definition at line 337 of file modules.cpp. .PP Called whenever a mode character is processed. .PP -Return 1 from this function to block the mode character from being processed entirely, so that you may perform your own code instead. Note that this method allows you to override modes defined by other modes, but this is NOT RECOMMENDED! +Return 1 from this function to block the mode character from being processed entirely, so that you may perform your own code instead. Note that this method allows you to override modes defined by other modes, but this is NOT RECOMMENDED! +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who is sending the mode +.br +\fIchan\fP The channel the mode is being sent to +.br +\fImode\fP The mode character being set +.br +\fIparam\fP The parameter for the mode or an empty string +.br +\fIadding\fP true of the mode is being added, false if it is being removed +.br +\fIpcnt\fP The parameter count for the mode (0 or 1) +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to deny the mode, 0 to allow +.RE +.PP + .PP Definition at line 342 of file modules.cpp. .PP @@ -639,7 +1392,18 @@ Definition at line 342 of file modules.cpp. .PP Called immediately after any connection is accepted. .PP -This is intended for raw socket processing (e.g. modules which wrap the tcp connection within another library) and provides no information relating to a user record as the connection has not been assigned yet. There are no return values from this call as all modules get an opportunity if required to process the connection. +This is intended for raw socket processing (e.g. modules which wrap the tcp connection within another library) and provides no information relating to a user record as the connection has not been assigned yet. There are no return values from this call as all modules get an opportunity if required to process the connection. +.PP +\fBParameters:\fP +.RS 4 +\fIfd\fP The file descriptor returned from accept() +.br +\fIip\fP The IP address of the connecting user +.br +\fIlocalport\fP The local port number the user connected to +.RE +.PP + .PP Definition at line 358 of file modules.cpp. .PP @@ -651,7 +1415,14 @@ Definition at line 358 of file modules.cpp. .PP Called immediately before any socket is closed. .PP -When this event is called, shutdown() has not yet been called on the socket. +When this event is called, shutdown() has not yet been called on the socket. +.PP +\fBParameters:\fP +.RS 4 +\fIfd\fP The file descriptor of the socket prior to close() +.RE +.PP + .PP Definition at line 360 of file modules.cpp. .PP @@ -663,7 +1434,25 @@ Definition at line 360 of file modules.cpp. .PP Called immediately before any read() operation on a client socket in the core. .PP -This occurs AFTER the select() or poll() so there is always data waiting to be read when this event occurs. Your event should return 1 if it has handled the reading itself, which prevents the core just using read(). You should place any data read into buffer, up to but NOT GREATER THAN the value of count. The value of readresult must be identical to an actual result that might be returned from the read() system call, for example, number of bytes read upon success, 0 upon EOF or closed socket, and -1 for error. If your function returns a nonzero value, you MUST set readresult. +This occurs AFTER the select() or poll() so there is always data waiting to be read when this event occurs. Your event should return 1 if it has handled the reading itself, which prevents the core just using read(). You should place any data read into buffer, up to but NOT GREATER THAN the value of count. The value of readresult must be identical to an actual result that might be returned from the read() system call, for example, number of bytes read upon success, 0 upon EOF or closed socket, and -1 for error. If your function returns a nonzero value, you MUST set readresult. +.PP +\fBParameters:\fP +.RS 4 +\fIfd\fP The file descriptor of the socket +.br +\fIbuffer\fP A char* buffer being read to +.br +\fIcount\fP The size of the buffer +.br +\fIreadresult\fP The amount of characters read, or 0 +.RE +.PP +\fBReturns:\fP +.RS 4 +nonzero if the event was handled, in which case readresult must be valid on exit +.RE +.PP + .PP Definition at line 361 of file modules.cpp. .PP @@ -675,7 +1464,23 @@ Definition at line 361 of file modules.cpp. .PP Called immediately before any write() operation on a user's socket in the core. .PP -Because this event is a low level event no user information is associated with it. It is intended for use by modules which may wrap connections within another API such as SSL for example. return a non-zero result if you have handled the write operation, in which case the core will not call write(). +Because this event is a low level event no user information is associated with it. It is intended for use by modules which may wrap connections within another API such as SSL for example. return a non-zero result if you have handled the write operation, in which case the core will not call write(). +.PP +\fBParameters:\fP +.RS 4 +\fIfd\fP The file descriptor of the socket +.br +\fIbuffer\fP A char* buffer being written +.br +\fINumber\fP of characters to write +.RE +.PP +\fBReturns:\fP +.RS 4 +Number of characters actually written or 0 if you didn't handle the operation +.RE +.PP + .PP Definition at line 359 of file modules.cpp. .PP @@ -683,23 +1488,58 @@ Definition at line 359 of file modules.cpp. 359 { return 0; }; .fi .PP -.SS "void Module::OnRehash ()\fC [virtual]\fP" +.SS "void Module::OnRehash (\fBstd::string\fP parameter)\fC [virtual]\fP" .PP Called on rehash. .PP -This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. +This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it. +.PP +\fBParameters:\fP +.RS 4 +\fIparameter\fP The (optional) parameter given to REHASH from the user. +.RE +.PP + +.PP +Definition at line 316 of file modules.cpp. +.PP +.nf +316 { } +.fi +.PP +.SS "void Module::OnRemoteKill (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBstd::string\fP reason)\fC [virtual]\fP" .PP -Definition at line 315 of file modules.cpp. +Called when an oper wants to disconnect a remote user via KILL. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user sending the KILL +.br +\fIdest\fP The user being killed +.br +\fIreason\fP The kill reason +.RE +.PP + +.PP +Definition at line 364 of file modules.cpp. .PP .nf -315 { } +364 { }; .fi .PP .SS "char * Module::OnRequest (\fBRequest\fP * request)\fC [virtual]\fP" .PP Called whenever a \fBRequest\fP class is sent to your module by another module. .PP -Please see the documentation of \fBRequest::Send()\fP for further information. The \fBRequest\fP sent can always be assumed to be non-NULL, you should not change the request object or its data. Your method may return arbitary data in the char* result which the requesting module may be able to use for pre-determined purposes (e.g. the results of an SQL query, etc). +Please see the documentation of \fBRequest::Send()\fP for further information. The \fBRequest\fP sent can always be assumed to be non-NULL, you should not change the request object or its data. Your method may return arbitary data in the char* result which the requesting module may be able to use for pre-determined purposes (e.g. the results of an SQL query, etc). +.PP +\fBParameters:\fP +.RS 4 +\fIrequest\fP The \fBRequest\fP class being received +.RE +.PP + .PP Definition at line 352 of file modules.cpp. .PP @@ -713,7 +1553,18 @@ Referenced by Request::Send(). .PP Called whenever a list is needed for a listmode. .PP -For example, when a /MODE channel +b (without any other parameters) is called, if a module was handling +b this function would be called. The function can then output any lists it wishes to. Please note that all modules will see all mode characters to provide the ability to extend each other, so please only output a list if the mode character given matches the one(s) you want to handle. +For example, when a /MODE channel +b (without any other parameters) is called, if a module was handling +b this function would be called. The function can then output any lists it wishes to. Please note that all modules will see all mode characters to provide the ability to extend each other, so please only output a list if the mode character given matches the one(s) you want to handle. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user requesting the list +.br +\fIchannel\fP The channel the list is for +.br +\fImode\fP The listmode which a list is being requested on +.RE +.PP + .PP Definition at line 336 of file modules.cpp. .PP @@ -725,29 +1576,120 @@ Definition at line 336 of file modules.cpp. .PP Called when a raw command is transmitted or received. .PP -This method is the lowest level of handler available to a module. It will be called with raw data which is passing through a connected socket. If you wish, you may munge this data by changing the string parameter 'raw'. If you do this, after your function exits it will immediately be cut down to 510 characters plus a carriage return and linefeed. For INBOUND messages only (where inbound is set to true) the value of user will be the userrec of the connection sending the data. This is not possible for outbound data because the data may be being routed to multiple targets. +This method is the lowest level of handler available to a module. It will be called with raw data which is passing through a connected socket. If you wish, you may munge this data by changing the string parameter 'raw'. If you do this, after your function exits it will immediately be cut down to 510 characters plus a carriage return and linefeed. For INBOUND messages only (where inbound is set to true) the value of user will be the userrec of the connection sending the data. This is not possible for outbound data because the data may be being routed to multiple targets. .PP -Definition at line 316 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIraw\fP The raw string in RFC1459 format +.br +\fIinbound\fP A flag to indicate wether the data is coming into the daemon or going out to the user +.br +\fIuser\fP The user record sending the text, when inbound == true. +.RE +.PP + +.PP +Definition at line 317 of file modules.cpp. .PP .nf -316 { } +317 { } .fi .PP .SS "void Module::OnStats (char symbol)\fC [virtual]\fP" .PP Called on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core. .PP +\fBParameters:\fP +.RS 4 +\fIsymbol\fP the symbol provided to /STATS +.RE +.PP + +.PP Definition at line 347 of file modules.cpp. .PP .nf 347 { }; .fi .PP +.SS "void Module::OnSyncChannel (\fBchanrec\fP * chan, \fBModule\fP * proto, void * opaque)\fC [virtual]\fP" +.PP +Allows modules to synchronize data which relates to channels during a netburst. +.PP +When this function is called, it will be called from the module which implements the linking protocol. This currently is m_spanningtree.so. A pointer to this module is given in Module* proto, so that you may call its methods such as ProtoSendMode (see below). This function will be called for every user visible on your side of the burst, allowing you to for example set modes, etc. Do not use this call to synchronize data which you have stored using class \fBExtensible\fP -- There is a specialist function OnSyncUserMetaData and OnSyncChannelMetaData for this! +.PP +For a good example of how to use this function, please see src/modules/m_chanprotect.cpp +.PP +\fBParameters:\fP +.RS 4 +\fIchan\fP The channel being syncronized +.br +\fIproto\fP A pointer to the module handling network protocol +.br +\fIopaque\fP An opaque pointer set by the protocol module, should not be modified! +.RE +.PP + +.PP +Definition at line 369 of file modules.cpp. +.PP +.nf +369 { }; +.fi +.PP +.SS "void Module::OnSyncChannelMetaData (\fBchanrec\fP * chan, \fBModule\fP * proto, void * opaque, \fBstd::string\fP extname)\fC [virtual]\fP" +.PP +Definition at line 371 of file modules.cpp. +.PP +.nf +371 { }; +.fi +.PP +.SS "void Module::OnSyncUser (\fBuserrec\fP * user, \fBModule\fP * proto, void * opaque)\fC [virtual]\fP" +.PP +Allows modules to synchronize data which relates to users during a netburst. +.PP +When this function is called, it will be called from the module which implements the linking protocol. This currently is m_spanningtree.so. A pointer to this module is given in Module* proto, so that you may call its methods such as ProtoSendMode (see below). This function will be called for every user visible on your side of the burst, allowing you to for example set modes, etc. Do not use this call to synchronize data which you have stored using class \fBExtensible\fP -- There is a specialist function OnSyncUserMetaData and OnSyncChannelMetaData for this! +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user being syncronized +.br +\fIproto\fP A pointer to the module handling network protocol +.br +\fIopaque\fP An opaque pointer set by the protocol module, should not be modified! +.RE +.PP + +.PP +Definition at line 368 of file modules.cpp. +.PP +.nf +368 { }; +.fi +.PP +.SS "void Module::OnSyncUserMetaData (\fBuserrec\fP * user, \fBModule\fP * proto, void * opaque, \fBstd::string\fP extname)\fC [virtual]\fP" +.PP +Definition at line 372 of file modules.cpp. +.PP +.nf +372 { }; +.fi +.PP .SS "void Module::OnUnloadModule (\fBModule\fP * mod, \fBstd::string\fP name)\fC [virtual]\fP" .PP Called whenever a module is unloaded. .PP -mod will contain a pointer to the module, and string will contain its name, for example m_widgets.so. This function is primary for dependency checking, your module may decide to enable some extra features if it sees that you have for example loaded 'm_killwidgets.so' with 'm_makewidgets.so'. It is highly recommended that modules do *NOT* bail if they cannot satisfy dependencies, but instead operate under reduced functionality, unless the dependency is absolutely neccessary (e.g. a module that extends the features of another module). +mod will contain a pointer to the module, and string will contain its name, for example m_widgets.so. This function is primary for dependency checking, your module may decide to enable some extra features if it sees that you have for example loaded 'm_killwidgets.so' with 'm_makewidgets.so'. It is highly recommended that modules do *NOT* bail if they cannot satisfy dependencies, but instead operate under reduced functionality, unless the dependency is absolutely neccessary (e.g. a module that extends the features of another module). +.PP +\fBParameters:\fP +.RS 4 +\fImod\fP Pointer to the module being unloaded (still valid) +.br +\fIname\fP The filename of the module being unloaded +.RE +.PP + .PP Definition at line 334 of file modules.cpp. .PP @@ -759,43 +1701,102 @@ Definition at line 334 of file modules.cpp. .PP Called when a user connects. .PP -The details of the connecting user are available to you in the parameter userrec *user +The details of the connecting user are available to you in the parameter userrec *user .PP -Definition at line 308 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who is connecting +.RE +.PP + +.PP +Definition at line 309 of file modules.cpp. .PP .nf -308 { } +309 { } .fi .PP .SS "void Module::OnUserDisconnect (\fBuserrec\fP * user)\fC [virtual]\fP" .PP Called whenever a user's socket is closed. .PP -The details of the exiting user are available to you in the parameter userrec *user This event is called for all users, registered or not, as a cleanup method for modules which might assign resources to user, such as dns lookups, objects and sockets. +The details of the exiting user are available to you in the parameter userrec *user This event is called for all users, registered or not, as a cleanup method for modules which might assign resources to user, such as dns lookups, objects and sockets. .PP -Definition at line 310 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who is disconnecting +.RE +.PP + +.PP +Definition at line 311 of file modules.cpp. .PP .nf -310 { } +311 { } +.fi +.PP +.SS "void Module::OnUserInvite (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBchanrec\fP * channel)\fC [virtual]\fP" +.PP +Called after a user has been successfully invited to a channel. +.PP +You cannot prevent the invite from occuring using this function, to do that, use OnUserPreInvite instead. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user who is issuing the INVITE +.br +\fIdest\fP The user being invited +.br +\fIchannel\fP The channel the user is being invited to +.RE +.PP + +.PP +Definition at line 365 of file modules.cpp. +.PP +.nf +365 { }; .fi .PP .SS "void Module::OnUserJoin (\fBuserrec\fP * user, \fBchanrec\fP * channel)\fC [virtual]\fP" .PP Called when a user joins a channel. .PP -The details of the joining user are available to you in the parameter userrec *user, and the details of the channel they have joined is available in the variable chanrec *channel +The details of the joining user are available to you in the parameter userrec *user, and the details of the channel they have joined is available in the variable chanrec *channel .PP -Definition at line 311 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who is joining +.br +\fIchannel\fP The channel being joined +.RE +.PP + +.PP +Definition at line 312 of file modules.cpp. .PP .nf -311 { } +312 { } .fi .PP .SS "void Module::OnUserKick (\fBuserrec\fP * source, \fBuserrec\fP * user, \fBchanrec\fP * chan, \fBstd::string\fP reason)\fC [virtual]\fP" .PP Called whenever a user is kicked. .PP -If this method is called, the kick is already underway and cannot be prevented, so to prevent a kick, please use \fBModule::OnUserPreKick\fP instead of this method. +If this method is called, the kick is already underway and cannot be prevented, so to prevent a kick, please use \fBModule::OnUserPreKick\fP instead of this method. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user issuing the kick +.br +\fIuser\fP The user being kicked +.br +\fIchan\fP The channel the user is being kicked from +.br +\fIreason\fP The kick reason +.RE +.PP + .PP Definition at line 341 of file modules.cpp. .PP @@ -803,40 +1804,124 @@ Definition at line 341 of file modules.cpp. 341 { }; .fi .PP +.SS "void Module::OnUserMessage (\fBuserrec\fP * user, void * dest, int target_type, \fBstd::string\fP text)\fC [virtual]\fP" +.PP +Called after any PRIVMSG sent from a user. +.PP +The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* if target_type is TYPE_CHANNEL. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user sending the message +.br +\fIdest\fP The target of the message +.br +\fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) +.br +\fItext\fP the text being sent by the user +.RE +.PP + +.PP +Definition at line 362 of file modules.cpp. +.PP +.nf +362 { }; +.fi +.PP +.SS "void Module::OnUserNotice (\fBuserrec\fP * user, void * dest, int target_type, \fBstd::string\fP text)\fC [virtual]\fP" +.PP +Called after any NOTICE sent from a user. +.PP +The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* if target_type is TYPE_CHANNEL. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user sending the message +.br +\fIdest\fP The target of the message +.br +\fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) +.br +\fItext\fP the text being sent by the user +.RE +.PP + +.PP +Definition at line 363 of file modules.cpp. +.PP +.nf +363 { }; +.fi +.PP .SS "void Module::OnUserPart (\fBuserrec\fP * user, \fBchanrec\fP * channel)\fC [virtual]\fP" .PP Called when a user parts a channel. .PP -The details of the leaving user are available to you in the parameter userrec *user, and the details of the channel they have left is available in the variable chanrec *channel +The details of the leaving user are available to you in the parameter userrec *user, and the details of the channel they have left is available in the variable chanrec *channel .PP -Definition at line 312 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who is parting +.br +\fIchannel\fP The channel being parted +.RE +.PP + +.PP +Definition at line 313 of file modules.cpp. .PP .nf -312 { } +313 { } .fi .PP .SS "void Module::OnUserPostNick (\fBuserrec\fP * user, \fBstd::string\fP oldnick)\fC [virtual]\fP" .PP Called after any nickchange, local or remote. .PP -This can be used to track users after nickchanges have been applied. Please note that although you can see remote nickchanges through this function, you should NOT make any changes to the userrec if the user is a remote user as this may cause a desnyc. check user->server before taking any action (including returning nonzero from the method). Because this method is called after the nickchange is taken place, no return values are possible to indicate forbidding of the nick change. Use OnUserPreNick for this. +This can be used to track users after nickchanges have been applied. Please note that although you can see remote nickchanges through this function, you should NOT make any changes to the userrec if the user is a remote user as this may cause a desnyc. check user->server before taking any action (including returning nonzero from the method). Because this method is called after the nickchange is taken place, no return values are possible to indicate forbidding of the nick change. Use OnUserPreNick for this. .PP -Definition at line 327 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user changing their nick +.br +\fIoldnick\fP The old nickname of the user before the nickchange +.RE +.PP + +.PP +Definition at line 329 of file modules.cpp. .PP .nf -327 { }; +329 { }; .fi .PP .SS "int Module::OnUserPreInvite (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBchanrec\fP * channel)\fC [virtual]\fP" .PP Called whenever a user is about to invite another user into a channel, before any processing is done. .PP -Returning 1 from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter invites to channels. +Returning 1 from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter invites to channels. .PP -Definition at line 323 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIsource\fP The user who is issuing the INVITE +.br +\fIdest\fP The user being invited +.br +\fIchannel\fP The channel the user is being invited to +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to deny the invite, 0 to allow +.RE +.PP + +.PP +Definition at line 325 of file modules.cpp. .PP .nf -323 { return 0; }; +325 { return 0; }; .fi .PP .SS "int Module::OnUserPreJoin (\fBuserrec\fP * user, \fBchanrec\fP * chan, const char * cname)\fC [virtual]\fP" @@ -847,19 +1932,51 @@ Returning a value of 1 from this function stops the process immediately, causing .PP IMPORTANT NOTE! .PP -If the user joins a NEW channel which does not exist yet, OnUserPreJoin will be called BEFORE the channel record is created. This will cause chanrec* chan to be NULL. There is very little you can do in form of processing on the actual channel record at this point, however the channel NAME will still be passed in char* cname, so that you could for example implement a channel blacklist or whitelist, etc. +If the user joins a NEW channel which does not exist yet, OnUserPreJoin will be called BEFORE the channel record is created. This will cause chanrec* chan to be NULL. There is very little you can do in form of processing on the actual channel record at this point, however the channel NAME will still be passed in char* cname, so that you could for example implement a channel blacklist or whitelist, etc. .PP -Definition at line 317 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user joining the channel +.br +\fIcname\fP The channel name being joined +.RE +.PP +\fBReturns:\fP +.RS 4 +1 To prevent the join, 0 to allow it. +.RE +.PP + +.PP +Definition at line 318 of file modules.cpp. .PP .nf -317 { return 0; } +318 { return 0; } .fi .PP .SS "int Module::OnUserPreKick (\fBuserrec\fP * source, \fBuserrec\fP * user, \fBchanrec\fP * chan, \fBstd::string\fP reason)\fC [virtual]\fP" .PP Called whenever a user is about to be kicked. .PP -Returning a value of 1 from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. +Returning a value of 1 from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. +.PP +\fBParameters:\fP +.RS 4 +\fIsource\fP The user issuing the kick +.br +\fIuser\fP The user being kicked +.br +\fIchan\fP The channel the user is being kicked from +.br +\fIreason\fP The kick reason +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to prevent the kick, 0 to allow it +.RE +.PP + .PP Definition at line 340 of file modules.cpp. .PP @@ -871,55 +1988,121 @@ Definition at line 340 of file modules.cpp. .PP Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. .PP -Returning any nonzero value from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a userrec* otherwise you must cast it to a chanrec*, this is the details of where the message is destined to be sent. +Returning any nonzero value from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a userrec* otherwise you must cast it to a chanrec*, this is the details of where the message is destined to be sent. .PP -Definition at line 324 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user sending the message +.br +\fIdest\fP The target of the message (chanrec* or userrec*) +.br +\fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) +.br +\fItext\fP Changeable text being sent by the user +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to deny the NOTICE, 0 to allow it +.RE +.PP + +.PP +Definition at line 326 of file modules.cpp. .PP .nf -324 { return 0; }; +326 { return 0; }; .fi .PP .SS "int Module::OnUserPreNick (\fBuserrec\fP * user, \fBstd::string\fP newnick)\fC [virtual]\fP" .PP Called before any nickchange, local or remote. .PP -This can be used to implement Q-lines etc. Please note that although you can see remote nickchanges through this function, you should NOT make any changes to the userrec if the user is a remote user as this may cause a desnyc. check user->server before taking any action (including returning nonzero from the method). If your method returns nonzero, the nickchange is silently forbidden, and it is down to your module to generate some meaninful output. +This can be used to implement Q-lines etc. Please note that although you can see remote nickchanges through this function, you should NOT make any changes to the userrec if the user is a remote user as this may cause a desnyc. check user->server before taking any action (including returning nonzero from the method). If your method returns nonzero, the nickchange is silently forbidden, and it is down to your module to generate some meaninful output. .PP -Definition at line 326 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The username changing their nick +.br +\fInewnick\fP Their new nickname +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to deny the change, 0 to allow +.RE +.PP + +.PP +Definition at line 328 of file modules.cpp. .PP .nf -326 { return 0; }; +328 { return 0; }; .fi .PP .SS "int Module::OnUserPreNotice (\fBuserrec\fP * user, void * dest, int target_type, \fBstd::string\fP & text)\fC [virtual]\fP" .PP Called whenever a user is about to NOTICE A user or a channel, before any processing is done. .PP -Returning any nonzero value from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a userrec* otherwise you must cast it to a chanrec*, this is the details of where the message is destined to be sent. You may alter the message text as you wish before relinquishing control to the next module in the chain, and if no other modules block the text this altered form of the text will be sent out to the user and possibly to other servers. +Returning any nonzero value from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a userrec* otherwise you must cast it to a chanrec*, this is the details of where the message is destined to be sent. You may alter the message text as you wish before relinquishing control to the next module in the chain, and if no other modules block the text this altered form of the text will be sent out to the user and possibly to other servers. .PP -Definition at line 325 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user sending the message +.br +\fIdest\fP The target of the message (chanrec* or userrec*) +.br +\fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) +.br +\fItext\fP Changeable text being sent by the user +.RE +.PP +\fBReturns:\fP +.RS 4 +1 to deny the NOTICE, 0 to allow it +.RE +.PP + +.PP +Definition at line 327 of file modules.cpp. .PP .nf -325 { return 0; }; +327 { return 0; }; .fi .PP -.SS "void Module::OnUserQuit (\fBuserrec\fP * user)\fC [virtual]\fP" +.SS "void Module::OnUserQuit (\fBuserrec\fP * user, \fBstd::string\fP message)\fC [virtual]\fP" .PP Called when a user quits. .PP -The details of the exiting user are available to you in the parameter userrec *user This event is only called when the user is fully registered when they quit. To catch raw disconnections, use the OnUserDisconnect method. +The details of the exiting user are available to you in the parameter userrec *user This event is only called when the user is fully registered when they quit. To catch raw disconnections, use the OnUserDisconnect method. .PP -Definition at line 309 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user who is quitting +.br +\fImessage\fP The user's quit message +.RE +.PP + +.PP +Definition at line 310 of file modules.cpp. .PP .nf -309 { } +310 { } .fi .PP .SS "void Module::OnUserRegister (\fBuserrec\fP * user)\fC [virtual]\fP" .PP Called whenever a user is about to register their connection (e.g. .PP -before the user is sent the MOTD etc). Modules can use this method if they are performing a function which must be done before the actual connection is completed (e.g. ident lookups, dnsbl lookups, etc). Note that you should NOT delete the user record here by causing a disconnection! Use OnUserConnect for that instead. +before the user is sent the MOTD etc). Modules can use this method if they are performing a function which must be done before the actual connection is completed (e.g. ident lookups, dnsbl lookups, etc). Note that you should NOT delete the user record here by causing a disconnection! Use OnUserConnect for that instead. +.PP +\fBParameters:\fP +.RS 4 +\fIuser\fP The user registering +.RE +.PP + .PP Definition at line 339 of file modules.cpp. .PP @@ -927,28 +2110,100 @@ Definition at line 339 of file modules.cpp. 339 { }; .fi .PP -.SS "\fBstring_list\fP Module::OnUserSync (\fBuserrec\fP * user)\fC [virtual]\fP" +.SS "void Module::OnWallops (\fBuserrec\fP * user, \fBstd::string\fP text)\fC [virtual]\fP" +.PP +Called after every WALLOPS command. .PP -Called during a netburst to sync user data. +\fBParameters:\fP +.RS 4 +\fIuser\fP The user sending the WALLOPS +.br +\fItext\fP The content of the WALLOPS message +.RE .PP -This is called during the netburst on a per-user basis. You should use this call to up any special user-related things which are implemented by your module, e.g. sending listmodes. You may return multiple commands in the string_list. + .PP -Definition at line 329 of file modules.cpp. +Definition at line 375 of file modules.cpp. .PP .nf -329 { string_list empty; return empty; } +375 { }; .fi .PP .SS "void Module::OnWhois (\fBuserrec\fP * source, \fBuserrec\fP * dest)\fC [virtual]\fP" .PP Called whenever a /WHOIS is performed on a local user. .PP -The source parameter contains the details of the user who issued the WHOIS command, and the dest parameter contains the information of the user they are whoising. +The source parameter contains the details of the user who issued the WHOIS command, and the dest parameter contains the information of the user they are whoising. .PP -Definition at line 322 of file modules.cpp. +\fBParameters:\fP +.RS 4 +\fIsource\fP The user issuing the WHOIS command +.br +\fIdest\fP The user who is being WHOISed +.RE +.PP + +.PP +Definition at line 324 of file modules.cpp. .PP .nf -322 { }; +324 { }; +.fi +.PP +.SS "void Module::ProtoSendMetaData (void * opaque, int target_type, void * target, \fBstd::string\fP extname, \fBstd::string\fP extdata)\fC [virtual]\fP" +.PP +Implemented by modules which provide the ability to link servers. +.PP +These modules will implement this method, which allows metadata (extra data added to user and channel records using class \fBExtensible\fP, \fBExtensible::Extend\fP, etc) to be sent to other servers on a netburst and decoded at the other end by the same module on a different server. +.PP +More documentation to follow soon. Please see src/modules/m_swhois.cpp for example of how to use this function. +.PP +\fBParameters:\fP +.RS 4 +\fIopaque\fP An opaque pointer set by the protocol module, should not be modified! +.br +\fItarget_type\fP The type of item to decode data for, TYPE_USER or TYPE_CHANNEL +.br +\fItarget\fP The chanrec* or userrec* that metadata should be sent for +.br +\fIextname\fP The extension name to send metadata for +.br +\fIextdata\fP Encoded data for this extension name, which will be encoded at the oppsite end by an identical module using OnDecodeMetaData +.RE +.PP + +.PP +Definition at line 374 of file modules.cpp. +.PP +.nf +374 { }; +.fi +.PP +.SS "void Module::ProtoSendMode (void * opaque, int target_type, void * target, \fBstd::string\fP modeline)\fC [virtual]\fP" +.PP +Implemented by modules which provide the ability to link servers. +.PP +These modules will implement this method, which allows transparent sending of servermodes down the network link as a broadcast, without a module calling it having to know the format of the MODE command before the actual mode string. +.PP +More documentation to follow soon. Please see src/modules/m_chanprotect.cpp for examples of how to use this function. +.PP +\fBParameters:\fP +.RS 4 +\fIopaque\fP An opaque pointer set by the protocol module, should not be modified! +.br +\fItarget_type\fP The type of item to decode data for, TYPE_USER or TYPE_CHANNEL +.br +\fItarget\fP The chanrec* or userrec* that modes should be sent for +.br +\fImodeline\fP The modes and parameters to be sent +.RE +.PP + +.PP +Definition at line 370 of file modules.cpp. +.PP +.nf +370 { }; .fi .PP diff --git a/docs/man/man3/ModuleFactory.3 b/docs/man/man3/ModuleFactory.3 index 38eb2c414..07c23ad69 100644 --- a/docs/man/man3/ModuleFactory.3 +++ b/docs/man/man3/ModuleFactory.3 @@ -1,4 +1,4 @@ -.TH "ModuleFactory" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ModuleFactory" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -22,7 +22,7 @@ Inherits \fBclassbase\fP. .RI "virtual \fB~ModuleFactory\fP ()" .br .ti -1c -.RI "virtual \fBModule\fP * \fBCreateModule\fP ()=0" +.RI "virtual \fBModule\fP * \fBCreateModule\fP (\fBServer\fP *Me)=0" .br .RI "\fICreates a new module. \fP" .in -1c @@ -32,28 +32,28 @@ Instantiates classes inherited from \fBModule\fP This class creates a class inhe This is to allow for modules to create many different variants of \fBModule\fP, dependent on architecture, configuration, etc. In most cases, the simple class shown in the example module m_foobar.so will suffice for most modules. .PP -Definition at line 1265 of file modules.h. +Definition at line 1654 of file modules.h. .SH "Constructor & Destructor Documentation" .PP .SS "ModuleFactory::ModuleFactory ()\fC [inline]\fP" .PP -Definition at line 1268 of file modules.h. +Definition at line 1657 of file modules.h. .PP .nf -1268 { } +1657 { } .fi .PP .SS "virtual ModuleFactory::~ModuleFactory ()\fC [inline, virtual]\fP" .PP -Definition at line 1269 of file modules.h. +Definition at line 1658 of file modules.h. .PP .nf -1269 { } +1658 { } .fi .PP .SH "Member Function Documentation" .PP -.SS "virtual \fBModule\fP* ModuleFactory::CreateModule ()\fC [pure virtual]\fP" +.SS "virtual \fBModule\fP* ModuleFactory::CreateModule (\fBServer\fP * Me)\fC [pure virtual]\fP" .PP Creates a new module. .PP diff --git a/docs/man/man3/ModuleMessage.3 b/docs/man/man3/ModuleMessage.3 index 1aeb0a9ff..88ca58ca7 100644 --- a/docs/man/man3/ModuleMessage.3 +++ b/docs/man/man3/ModuleMessage.3 @@ -1,4 +1,4 @@ -.TH "ModuleMessage" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ModuleMessage" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -29,15 +29,15 @@ Inherited by \fBEvent\fP, and \fBRequest\fP. .PP The ModuleMessage class is the base class of \fBRequest\fP and \fBEvent\fP This class is used to represent a basic data structure which is passed between modules for safe inter-module communications. .PP -Definition at line 142 of file modules.h. +Definition at line 143 of file modules.h. .SH "Constructor & Destructor Documentation" .PP .SS "virtual ModuleMessage::~ModuleMessage ()\fC [inline, virtual]\fP" .PP -Definition at line 148 of file modules.h. +Definition at line 149 of file modules.h. .PP .nf -148 {}; +149 {}; .fi .PP .SH "Member Function Documentation" diff --git a/docs/man/man3/QLine.3 b/docs/man/man3/QLine.3 index a396146bc..f50afbdd4 100644 --- a/docs/man/man3/QLine.3 +++ b/docs/man/man3/QLine.3 @@ -1,4 +1,4 @@ -.TH "QLine" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "QLine" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/Request.3 b/docs/man/man3/Request.3 index b83cace94..bd8f3ab8f 100644 --- a/docs/man/man3/Request.3 +++ b/docs/man/man3/Request.3 @@ -1,4 +1,4 @@ -.TH "Request" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "Request" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -58,7 +58,7 @@ The Request class is a unicast message directed at a given module. When this class is properly instantiated it may be sent to a module using the \fBSend()\fP method, which will call the given module's OnRequest method with this class as its parameter. .PP -Definition at line 156 of file modules.h. +Definition at line 157 of file modules.h. .SH "Constructor & Destructor Documentation" .PP .SS "Request::Request (char * anydata, \fBModule\fP * src, \fBModule\fP * dst)" @@ -146,21 +146,21 @@ References dest, and Module::OnRequest(). .PP This member holds a pointer to arbitary data set by the emitter of the message. .PP -Definition at line 161 of file modules.h. +Definition at line 162 of file modules.h. .PP Referenced by GetData(). .SS "\fBModule\fP* \fBRequest::dest\fP\fC [protected]\fP" .PP The single destination of the Request. .PP -Definition at line 168 of file modules.h. +Definition at line 169 of file modules.h. .PP Referenced by GetDest(), and Send(). .SS "\fBModule\fP* \fBRequest::source\fP\fC [protected]\fP" .PP This is a pointer to the sender of the message, which can be used to directly trigger events, or to create a reply. .PP -Definition at line 165 of file modules.h. +Definition at line 166 of file modules.h. .PP Referenced by GetSource(). diff --git a/docs/man/man3/Server.3 b/docs/man/man3/Server.3 index 55223633d..cca17c7e4 100644 --- a/docs/man/man3/Server.3 +++ b/docs/man/man3/Server.3 @@ -1,4 +1,4 @@ -.TH "Server" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "Server" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -156,6 +156,9 @@ Inherits \fBclassbase\fP. .br .RI "\fICalls the handler for a command, either implemented by the core or by another module. \fP" .ti -1c +.RI "virtual bool \fBIsValidModuleCommand\fP (\fBstd::string\fP commandname, int pcnt, \fBuserrec\fP *user)" +.br +.ti -1c .RI "virtual void \fBChangeHost\fP (\fBuserrec\fP *user, \fBstd::string\fP host)" .br .RI "\fIChange displayed hostname of a user. \fP" @@ -239,6 +242,9 @@ Inherits \fBclassbase\fP. .RI "virtual void \fBDelSocket\fP (\fBInspSocket\fP *sock)" .br .RI "\fIDeletes a class derived from \fBInspSocket\fP from the server's socket engine. \fP" +.ti -1c +.RI "virtual void \fBRehashServer\fP ()" +.br .in -1c .SH "Detailed Description" .PP @@ -246,7 +252,7 @@ Allows server output and query functions This class contains methods which allow All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks. .PP -Definition at line 696 of file modules.h. +Definition at line 1081 of file modules.h. .SH "Constructor & Destructor Documentation" .PP .SS "Server::Server ()" @@ -255,11 +261,11 @@ Default constructor. .PP Creates a Server object. .PP -Definition at line 367 of file modules.cpp. +Definition at line 394 of file modules.cpp. .PP .nf -368 { -369 } +395 { +396 } .fi .PP .SS "Server::~Server ()\fC [virtual]\fP" @@ -268,11 +274,11 @@ Default destructor. .PP Destroys a Server object. .PP -Definition at line 371 of file modules.cpp. +Definition at line 398 of file modules.cpp. .PP .nf -372 { -373 } +399 { +400 } .fi .PP .SH "Member Function Documentation" @@ -287,14 +293,14 @@ typedef void (handlerfunc) (char**, int, userrec*); ... void \fBhandle_kill(char .PP When the command is typed, the parameters will be placed into the parameters array (similar to argv) and the parameter count will be placed into pcnt (similar to argv). There will never be any less parameters than the 'minparams' value you specified when creating the command. The *user parameter is the class of the user which caused the command to trigger, who will always have the flag you specified in 'flags' when creating the initial command. For example to create an oper only command create the commands with flags='o'. The source parameter is used for resource tracking, and should contain the name of your module (with file extension) e.g. 'm_blarp.so'. If you place the wrong identifier here, you can cause crashes if your module is unloaded. .PP -Definition at line 457 of file modules.cpp. +Definition at line 495 of file modules.cpp. .PP References createcommand(). .PP .nf -458 { -459 createcommand(cmd,f,flags,minparams,source); -460 } +496 { +497 createcommand(cmd,f,flags,minparams,source); +498 } .fi .PP .SS "void Server::AddELine (long duration, \fBstd::string\fP source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)\fC [virtual]\fP" @@ -303,14 +309,14 @@ Adds a E-line The E-line is enforced as soon as it is added. .PP The duration must be in seconds, however you can use the \fBServer::CalcDuration\fP method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. .PP -Definition at line 720 of file modules.cpp. +Definition at line 758 of file modules.cpp. .PP References add_eline(). .PP .nf -721 { -722 add_eline(duration, source.c_str(), reason.c_str(), hostmask.c_str()); -723 } +759 { +760 add_eline(duration, source.c_str(), reason.c_str(), hostmask.c_str()); +761 } .fi .PP .SS "bool Server::AddExtendedListMode (char modechar)\fC [virtual]\fP" @@ -329,17 +335,17 @@ This call is used to implement modes like +q and +a. The characteristics of thes .PP It is down to the module handling the mode to maintain state and determine what 'items' (e.g. users, or a banlist) have the mode set on them, and process the modes at the correct times, e.g. during access checks on channels, etc. When the extended mode is triggered the OnExtendedMode method will be triggered as above. Note that the target you are given will be a channel, if for example your mode is set 'on a user' (in for example +a) you must use Server::Find to locate the user the mode is operating on. Your mode handler may return 1 to handle the mode AND tell the core to display the mode change, e.g. '+aaa one two three' in the case of the mode for 'two', or it may return -1 to 'eat' the mode change, so the above example would become '+aa one three' after processing. .PP -Definition at line 625 of file modules.cpp. +Definition at line 663 of file modules.cpp. .PP References DoAddExtendedMode(), ModeMakeList(), and MT_CHANNEL. .PP .nf -626 { -627 bool res = DoAddExtendedMode(modechar,MT_CHANNEL,false,1,1); -628 if (res) -629 ModeMakeList(modechar); -630 return res; -631 } +664 { +665 bool res = DoAddExtendedMode(modechar,MT_CHANNEL,false,1,1); +666 if (res) +667 ModeMakeList(modechar); +668 return res; +669 } .fi .PP .SS "bool Server::AddExtendedMode (char modechar, int type, bool requires_oper, int params_when_on, int params_when_off)\fC [virtual]\fP" @@ -348,37 +354,37 @@ Adds an extended mode letter which is parsed by a module. .PP This allows modules to add extra mode letters, e.g. +x for hostcloak. the 'type' parameter is either MT_CHANNEL, MT_CLIENT, or MT_SERVER, to indicate wether the mode is a channel mode, a client mode, or a server mode. requires_oper is used with MT_CLIENT type modes only to indicate the mode can only be set or unset by an oper. If this is used for MT_CHANNEL type modes it is ignored. params_when_on is the number of modes to expect when the mode is turned on (for type MT_CHANNEL only), e.g. with mode +k, this would have a value of 1. the params_when_off value has a similar value to params_when_on, except it indicates the number of parameters to expect when the mode is disabled. Modes which act in a similar way to channel mode +l (e.g. require a parameter to enable, but not to disable) should use this parameter. The function returns false if the mode is unavailable, and will not attempt to allocate another character, as this will confuse users. This also means that as only one module can claim a specific mode character, the core does not need to keep track of which modules own which modes, which speeds up operation of the server. In this version, a mode can have at most one parameter, attempting to use more parameters will have undefined effects. .PP -Definition at line 597 of file modules.cpp. +Definition at line 635 of file modules.cpp. .PP References DEBUG, DoAddExtendedMode(), MT_CLIENT, and MT_SERVER. .PP .nf -598 { -599 if (((modechar >= 'A') && (modechar <= 'Z')) || ((modechar >= 'a') && (modechar <= 'z'))) -600 { -601 if (type == MT_SERVER) -602 { -603 log(DEBUG,'*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion'); -604 return false; -605 } -606 if (((params_when_on>0) || (params_when_off>0)) && (type == MT_CLIENT)) -607 { -608 log(DEBUG,'*** API ERROR *** Parameters on MT_CLIENT modes are not supported'); -609 return false; -610 } -611 if ((params_when_on>1) || (params_when_off>1)) -612 { -613 log(DEBUG,'*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported'); -614 return false; -615 } -616 return DoAddExtendedMode(modechar,type,requires_oper,params_when_on,params_when_off); -617 } -618 else -619 { -620 log(DEBUG,'*** API ERROR *** Muppet modechar detected.'); -621 } -622 return false; -623 } +636 { +637 if (((modechar >= 'A') && (modechar <= 'Z')) || ((modechar >= 'a') && (modechar <= 'z'))) +638 { +639 if (type == MT_SERVER) +640 { +641 log(DEBUG,'*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion'); +642 return false; +643 } +644 if (((params_when_on>0) || (params_when_off>0)) && (type == MT_CLIENT)) +645 { +646 log(DEBUG,'*** API ERROR *** Parameters on MT_CLIENT modes are not supported'); +647 return false; +648 } +649 if ((params_when_on>1) || (params_when_off>1)) +650 { +651 log(DEBUG,'*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported'); +652 return false; +653 } +654 return DoAddExtendedMode(modechar,type,requires_oper,params_when_on,params_when_off); +655 } +656 else +657 { +658 log(DEBUG,'*** API ERROR *** Muppet modechar detected.'); +659 } +660 return false; +661 } .fi .PP .SS "void Server::AddGLine (long duration, \fBstd::string\fP source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)\fC [virtual]\fP" @@ -387,14 +393,14 @@ Adds a G-line The G-line is propogated to all of the servers in the mesh and enf .PP The duration must be in seconds, however you can use the \fBServer::CalcDuration\fP method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. .PP -Definition at line 700 of file modules.cpp. +Definition at line 738 of file modules.cpp. .PP References add_gline(). .PP .nf -701 { -702 add_gline(duration, source.c_str(), reason.c_str(), hostmask.c_str()); -703 } +739 { +740 add_gline(duration, source.c_str(), reason.c_str(), hostmask.c_str()); +741 } .fi .PP .SS "void Server::AddKLine (long duration, \fBstd::string\fP source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)\fC [virtual]\fP" @@ -403,14 +409,14 @@ Adds a K-line The K-line is enforced as soon as it is added. .PP The duration must be in seconds, however you can use the \fBServer::CalcDuration\fP method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. .PP -Definition at line 715 of file modules.cpp. +Definition at line 753 of file modules.cpp. .PP References add_kline(). .PP .nf -716 { -717 add_kline(duration, source.c_str(), reason.c_str(), hostmask.c_str()); -718 } +754 { +755 add_kline(duration, source.c_str(), reason.c_str(), hostmask.c_str()); +756 } .fi .PP .SS "void Server::AddQLine (long duration, \fBstd::string\fP source, \fBstd::string\fP reason, \fBstd::string\fP nickname)\fC [virtual]\fP" @@ -419,28 +425,28 @@ Adds a Q-line The Q-line is propogated to all of the servers in the mesh and enf .PP The duration must be in seconds, however you can use the \fBServer::CalcDuration\fP method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. .PP -Definition at line 705 of file modules.cpp. +Definition at line 743 of file modules.cpp. .PP References add_qline(). .PP .nf -706 { -707 add_qline(duration, source.c_str(), reason.c_str(), nickname.c_str()); -708 } +744 { +745 add_qline(duration, source.c_str(), reason.c_str(), nickname.c_str()); +746 } .fi .PP .SS "void Server::AddSocket (\fBInspSocket\fP * sock)\fC [virtual]\fP" .PP Adds a class derived from \fBInspSocket\fP to the server's socket engine. .PP -Definition at line 375 of file modules.cpp. +Definition at line 402 of file modules.cpp. .PP References module_sockets. .PP .nf -376 { -377 module_sockets.push_back(sock); -378 } +403 { +404 module_sockets.push_back(sock); +405 } .fi .PP .SS "void Server::AddZLine (long duration, \fBstd::string\fP source, \fBstd::string\fP reason, \fBstd::string\fP ipaddr)\fC [virtual]\fP" @@ -449,14 +455,14 @@ Adds a Z-line The Z-line is propogated to all of the servers in the mesh and enf .PP The duration must be in seconds, however you can use the \fBServer::CalcDuration\fP method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. .PP -Definition at line 710 of file modules.cpp. +Definition at line 748 of file modules.cpp. .PP References add_zline(). .PP .nf -711 { -712 add_zline(duration, source.c_str(), reason.c_str(), ipaddr.c_str()); -713 } +749 { +750 add_zline(duration, source.c_str(), reason.c_str(), ipaddr.c_str()); +751 } .fi .PP .SS "long Server::CalcDuration (\fBstd::string\fP duration)\fC [virtual]\fP" @@ -465,14 +471,14 @@ Calculates a duration This method will take a string containing a formatted dura .PP '1w2d') and return its value as a total number of seconds. This is the same function used internally by /GLINE etc to set the ban times. .PP -Definition at line 750 of file modules.cpp. +Definition at line 788 of file modules.cpp. .PP References duration(). .PP .nf -751 { -752 return duration(delta.c_str()); -753 } +789 { +790 return duration(delta.c_str()); +791 } .fi .PP .SS "void Server::CallCommandHandler (\fBstd::string\fP commandname, char ** parameters, int pcnt, \fBuserrec\fP * user)\fC [virtual]\fP" @@ -483,12 +489,12 @@ You can use this function to trigger other commands in the ircd, such as PRIVMSG .br ) you may use them as callback identifiers. The first parameter to this method is the name of the command handler you wish to call, e.g. PRIVMSG. This will be a command handler previously registered by the core or wih \fBAddCommand()\fP. The second parameter is an array of parameters, and the third parameter is a count of parameters in the array. If you do not pass enough parameters to meet the minimum needed by the handler, the functiom will silently ignore it. The final parameter is the user executing the command handler, used for privilage checks, etc. .PP -Definition at line 447 of file modules.cpp. +Definition at line 480 of file modules.cpp. .PP .nf -448 { -449 call_handler(commandname.c_str(),parameters,pcnt,user); -450 } +481 { +482 call_handler(commandname.c_str(),parameters,pcnt,user); +483 } .fi .PP .SS "void Server::ChangeGECOS (\fBuserrec\fP * user, \fBstd::string\fP gecos)\fC [virtual]\fP" @@ -497,14 +503,14 @@ Change GECOS (fullname) of a user. .PP You should always call this method to change a user's GECOS rather than writing directly to the fullname member of userrec, as any change applied via this method will be propogated to any linked servers. .PP -Definition at line 540 of file modules.cpp. +Definition at line 578 of file modules.cpp. .PP References ChangeName(). .PP .nf -541 { -542 ChangeName(user,gecos.c_str()); -543 } +579 { +580 ChangeName(user,gecos.c_str()); +581 } .fi .PP .SS "void Server::ChangeHost (\fBuserrec\fP * user, \fBstd::string\fP host)\fC [virtual]\fP" @@ -513,14 +519,14 @@ Change displayed hostname of a user. .PP You should always call this method to change a user's host rather than writing directly to the dhost member of userrec, as any change applied via this method will be propogated to any linked servers. .PP -Definition at line 535 of file modules.cpp. +Definition at line 573 of file modules.cpp. .PP References ChangeDisplayedHost(). .PP .nf -536 { -537 ChangeDisplayedHost(user,host.c_str()); -538 } +574 { +575 ChangeDisplayedHost(user,host.c_str()); +576 } .fi .PP .SS "void Server::ChangeUserNick (\fBuserrec\fP * user, \fBstd::string\fP nickname)\fC [virtual]\fP" @@ -529,12 +535,12 @@ Forces a user nickchange. .PP This command works similarly to SVSNICK, and can be used to implement Q-lines etc. If you specify an invalid nickname, the nick change will be dropped and the target user will receive the error numeric for it. .PP -Definition at line 432 of file modules.cpp. +Definition at line 465 of file modules.cpp. .PP .nf -433 { -434 force_nickchange(user,nickname.c_str()); -435 } +466 { +467 force_nickchange(user,nickname.c_str()); +468 } .fi .PP .SS "\fBstd::string\fP Server::ChanMode (\fBuserrec\fP * User, \fBchanrec\fP * Chan)\fC [virtual]\fP" @@ -543,14 +549,14 @@ Attempts to look up a user's privilages on a channel. .PP This function will return a string containing either @, %, +, or an empty string, representing the user's privilages upon the channel you specify. .PP -Definition at line 565 of file modules.cpp. +Definition at line 603 of file modules.cpp. .PP References cmode(). .PP .nf -566 { -567 return cmode(User,Chan); -568 } +604 { +605 return cmode(User,Chan); +606 } .fi .PP .SS "bool Server::CommonChannels (\fBuserrec\fP * u1, \fBuserrec\fP * u2)\fC [virtual]\fP" @@ -559,14 +565,14 @@ Returns true if two users share a common channel. .PP This method is used internally by the NICK and QUIT commands, and the \fBServer::SendCommon\fP method. .PP -Definition at line 513 of file modules.cpp. +Definition at line 551 of file modules.cpp. .PP References common_channels(). .PP .nf -514 { -515 return (common_channels(u1,u2) != 0); -516 } +552 { +553 return (common_channels(u1,u2) != 0); +554 } .fi .PP .SS "int Server::CountUsers (\fBchanrec\fP * c)\fC [virtual]\fP" @@ -575,103 +581,103 @@ Returns a count of the number of users on a channel. .PP This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel. .PP -Definition at line 633 of file modules.cpp. +Definition at line 671 of file modules.cpp. .PP .nf -634 { -635 return usercount(c); -636 } +672 { +673 return usercount(c); +674 } .fi .PP .SS "bool Server::DelELine (\fBstd::string\fP hostmask)\fC [virtual]\fP" .PP Deletes a local E-Line. .PP -Definition at line 745 of file modules.cpp. +Definition at line 783 of file modules.cpp. .PP References del_eline(). .PP .nf -746 { -747 return del_eline(hostmask.c_str()); -748 } +784 { +785 return del_eline(hostmask.c_str()); +786 } .fi .PP .SS "bool Server::DelGLine (\fBstd::string\fP hostmask)\fC [virtual]\fP" .PP Deletes a G-Line from all servers on the mesh. .PP -Definition at line 725 of file modules.cpp. +Definition at line 763 of file modules.cpp. .PP References del_gline(). .PP .nf -726 { -727 return del_gline(hostmask.c_str()); -728 } +764 { +765 return del_gline(hostmask.c_str()); +766 } .fi .PP .SS "bool Server::DelKLine (\fBstd::string\fP hostmask)\fC [virtual]\fP" .PP Deletes a local K-Line. .PP -Definition at line 740 of file modules.cpp. +Definition at line 778 of file modules.cpp. .PP References del_kline(). .PP .nf -741 { -742 return del_kline(hostmask.c_str()); -743 } +779 { +780 return del_kline(hostmask.c_str()); +781 } .fi .PP .SS "bool Server::DelQLine (\fBstd::string\fP nickname)\fC [virtual]\fP" .PP Deletes a Q-Line from all servers on the mesh. .PP -Definition at line 730 of file modules.cpp. +Definition at line 768 of file modules.cpp. .PP References del_qline(). .PP .nf -731 { -732 return del_qline(nickname.c_str()); -733 } +769 { +770 return del_qline(nickname.c_str()); +771 } .fi .PP .SS "void Server::DelSocket (\fBInspSocket\fP * sock)\fC [virtual]\fP" .PP Deletes a class derived from \fBInspSocket\fP from the server's socket engine. .PP -Definition at line 380 of file modules.cpp. +Definition at line 413 of file modules.cpp. .PP References module_sockets. .PP .nf -381 { -382 for (std::vector<InspSocket*>::iterator a = module_sockets.begin(); a < module_sockets.end(); a++) -383 { -384 if (*a == sock) -385 { -386 module_sockets.erase(a); -387 return; -388 } -389 } -390 } +414 { +415 for (std::vector<InspSocket*>::iterator a = module_sockets.begin(); a < module_sockets.end(); a++) +416 { +417 if (*a == sock) +418 { +419 module_sockets.erase(a); +420 return; +421 } +422 } +423 } .fi .PP .SS "bool Server::DelZLine (\fBstd::string\fP ipaddr)\fC [virtual]\fP" .PP Deletes a Z-Line from all servers on the mesh. .PP -Definition at line 735 of file modules.cpp. +Definition at line 773 of file modules.cpp. .PP References del_zline(). .PP .nf -736 { -737 return del_zline(ipaddr.c_str()); -738 } +774 { +775 return del_zline(ipaddr.c_str()); +776 } .fi .PP .SS "\fBchanrec\fP * Server::FindChannel (\fBstd::string\fP channel)\fC [virtual]\fP" @@ -680,12 +686,12 @@ Attempts to look up a channel and return a pointer to it. .PP This function will return NULL if the channel does not exist. .PP -Definition at line 560 of file modules.cpp. +Definition at line 598 of file modules.cpp. .PP .nf -561 { -562 return FindChan(channel.c_str()); -563 } +599 { +600 return FindChan(channel.c_str()); +601 } .fi .PP .SS "\fBuserrec\fP * Server::FindDescriptor (int socket)\fC [virtual]\fP" @@ -694,12 +700,12 @@ Attempts to look up a nick using the file descriptor associated with that nick. .PP This function will return NULL if the file descriptor is not associated with a valid user. .PP -Definition at line 555 of file modules.cpp. +Definition at line 593 of file modules.cpp. .PP .nf -556 { -557 return (socket < 65536 ? fd_ref_table[socket] : NULL); -558 } +594 { +595 return (socket < 65536 ? fd_ref_table[socket] : NULL); +596 } .fi .PP .SS "\fBModule\fP * Server::FindModule (\fBstd::string\fP name)\fC [virtual]\fP" @@ -708,21 +714,21 @@ This function finds a module by name. .PP You must provide the filename of the module. If the module cannot be found (is not loaded) the function will return NULL. .PP -Definition at line 784 of file modules.cpp. +Definition at line 822 of file modules.cpp. .PP References MODCOUNT, module_names, and modules. .PP .nf -785 { -786 for (int i = 0; i <= MODCOUNT; i++) -787 { -788 if (module_names[i] == name) -789 { -790 return modules[i]; -791 } -792 } -793 return NULL; -794 } +823 { +824 for (int i = 0; i <= MODCOUNT; i++) +825 { +826 if (module_names[i] == name) +827 { +828 return modules[i]; +829 } +830 } +831 return NULL; +832 } .fi .PP .SS "\fBuserrec\fP * Server::FindNick (\fBstd::string\fP nick)\fC [virtual]\fP" @@ -731,12 +737,12 @@ Attempts to look up a nick and return a pointer to it. .PP This function will return NULL if the nick does not exist. .PP -Definition at line 550 of file modules.cpp. +Definition at line 588 of file modules.cpp. .PP .nf -551 { -552 return Find(nick); -553 } +589 { +590 return Find(nick); +591 } .fi .PP .SS "\fBAdmin\fP Server::GetAdmin ()\fC [virtual]\fP" @@ -745,48 +751,48 @@ Returns the information of the server as returned by the /ADMIN command. .PP See the \fBAdmin\fP class for further information of the return value. The members \fBAdmin::Nick\fP, \fBAdmin::Email\fP and \fBAdmin::Name\fP contain the information for the server where the module is loaded. .PP -Definition at line 590 of file modules.cpp. +Definition at line 628 of file modules.cpp. .PP .nf -591 { -592 return Admin(getadminname(),getadminemail(),getadminnick()); -593 } +629 { +630 return Admin(getadminname(),getadminemail(),getadminnick()); +631 } .fi .PP .SS "\fBstd::string\fP Server::GetNetworkName ()\fC [virtual]\fP" .PP Returns the network name, global to all linked servers. .PP -Definition at line 580 of file modules.cpp. +Definition at line 618 of file modules.cpp. .PP .nf -581 { -582 return getnetworkname(); -583 } +619 { +620 return getnetworkname(); +621 } .fi .PP .SS "\fBstd::string\fP Server::GetServerDescription ()\fC [virtual]\fP" .PP Returns the server description string of the local server. .PP -Definition at line 585 of file modules.cpp. +Definition at line 623 of file modules.cpp. .PP .nf -586 { -587 return getserverdesc(); -588 } +624 { +625 return getserverdesc(); +626 } .fi .PP .SS "\fBstd::string\fP Server::GetServerName ()\fC [virtual]\fP" .PP Returns the server name of the server where the module is loaded. .PP -Definition at line 575 of file modules.cpp. +Definition at line 613 of file modules.cpp. .PP .nf -576 { -577 return getservername(); -578 } +614 { +615 return getservername(); +616 } .fi .PP .SS "\fBchanuserlist\fP Server::GetUsers (\fBchanrec\fP * chan)\fC [virtual]\fP" @@ -795,22 +801,22 @@ Fetches the userlist of a channel. .PP This function must be here and not a member of userrec or chanrec due to include constraints. .PP -Definition at line 420 of file modules.cpp. +Definition at line 453 of file modules.cpp. .PP References chanrec::GetUsers(), and list. .PP .nf -421 { -422 chanuserlist userl; -423 userl.clear(); -424 std::vector<char*> *list = chan->GetUsers(); -425 for (std::vector<char*>::iterator i = list->begin(); i != list->end(); i++) -426 { -427 char* o = *i; -428 userl.push_back((userrec*)o); -429 } -430 return userl; -431 } +454 { +455 chanuserlist userl; +456 userl.clear(); +457 std::vector<char*> *list = chan->GetUsers(); +458 for (std::vector<char*>::iterator i = list->begin(); i != list->end(); i++) +459 { +460 char* o = *i; +461 userl.push_back((userrec*)o); +462 } +463 return userl; +464 } .fi .PP .SS "bool Server::IsNick (\fBstd::string\fP nick)\fC [virtual]\fP" @@ -819,14 +825,14 @@ Returns true if a nick is valid. .PP Nicks for unregistered connections will return false. .PP -Definition at line 545 of file modules.cpp. +Definition at line 583 of file modules.cpp. .PP References isnick(). .PP .nf -546 { -547 return (isnick(nick.c_str()) != 0); -548 } +584 { +585 return (isnick(nick.c_str()) != 0); +586 } .fi .PP .SS "bool Server::IsOnChannel (\fBuserrec\fP * User, \fBchanrec\fP * Chan)\fC [virtual]\fP" @@ -835,14 +841,14 @@ Checks if a user is on a channel. .PP This function will return true or false to indicate if user 'User' is on channel 'Chan'. .PP -Definition at line 570 of file modules.cpp. +Definition at line 608 of file modules.cpp. .PP References has_channel(). .PP .nf -571 { -572 return has_channel(User,Chan); -573 } +609 { +610 return has_channel(User,Chan); +611 } .fi .PP .SS "bool Server::IsUlined (\fBstd::string\fP server)\fC [virtual]\fP" @@ -851,50 +857,60 @@ Returns true if the servername you give is ulined. .PP ULined servers have extra privilages. They are allowed to change nicknames on remote servers, change modes of clients which are on remote servers and set modes of channels where there are no channel operators for that channel on the ulined server, amongst other things. Ulined server data is also broadcast across the mesh at all times as opposed to selectively messaged in the case of normal servers, as many ulined server types (such as services) do not support meshed links and must operate in this manner. .PP -Definition at line 442 of file modules.cpp. +Definition at line 475 of file modules.cpp. .PP References is_uline(). .PP .nf -443 { -444 return is_uline(server.c_str()); -445 } +476 { +477 return is_uline(server.c_str()); +478 } .fi .PP .SS "bool Server::IsValidMask (\fBstd::string\fP mask)\fC [virtual]\fP" .PP Returns true if a nick!ident string is correctly formatted, false if otherwise. .PP -Definition at line 755 of file modules.cpp. +Definition at line 793 of file modules.cpp. +.PP +.nf +794 { +795 const char* dest = mask.c_str(); +796 if (strchr(dest,'!')==0) +797 return false; +798 if (strchr(dest,'@')==0) +799 return false; +800 for (unsigned int i = 0; i < strlen(dest); i++) +801 if (dest[i] < 32) +802 return false; +803 for (unsigned int i = 0; i < strlen(dest); i++) +804 if (dest[i] > 126) +805 return false; +806 unsigned int c = 0; +807 for (unsigned int i = 0; i < strlen(dest); i++) +808 if (dest[i] == '!') +809 c++; +810 if (c>1) +811 return false; +812 c = 0; +813 for (unsigned int i = 0; i < strlen(dest); i++) +814 if (dest[i] == '@') +815 c++; +816 if (c>1) +817 return false; +818 +819 return true; +820 } +.fi +.PP +.SS "bool Server::IsValidModuleCommand (\fBstd::string\fP commandname, int pcnt, \fBuserrec\fP * user)\fC [virtual]\fP" +.PP +Definition at line 485 of file modules.cpp. .PP .nf -756 { -757 const char* dest = mask.c_str(); -758 if (strchr(dest,'!')==0) -759 return false; -760 if (strchr(dest,'@')==0) -761 return false; -762 for (unsigned int i = 0; i < strlen(dest); i++) -763 if (dest[i] < 32) -764 return false; -765 for (unsigned int i = 0; i < strlen(dest); i++) -766 if (dest[i] > 126) -767 return false; -768 unsigned int c = 0; -769 for (unsigned int i = 0; i < strlen(dest); i++) -770 if (dest[i] == '!') -771 c++; -772 if (c>1) -773 return false; -774 c = 0; -775 for (unsigned int i = 0; i < strlen(dest); i++) -776 if (dest[i] == '@') -777 c++; -778 if (c>1) -779 return false; -780 -781 return true; -782 } +486 { +487 return is_valid_cmd(commandname.c_str(), pcnt, user); +488 } .fi .PP .SS "\fBchanrec\fP * Server::JoinUserToChannel (\fBuserrec\fP * user, \fBstd::string\fP cname, \fBstd::string\fP key)\fC [virtual]\fP" @@ -903,12 +919,12 @@ Forces a user to join a channel. .PP This is similar to svsjoin and can be used to implement redirection, etc. On success, the return value is a valid pointer to a chanrec* of the channel the user was joined to. On failure, the result is NULL. .PP -Definition at line 410 of file modules.cpp. +Definition at line 443 of file modules.cpp. .PP .nf -411 { -412 return add_channel(user,cname.c_str(),key.c_str(),false); -413 } +444 { +445 return add_channel(user,cname.c_str(),key.c_str(),false); +446 } .fi .PP .SS "void Server::Log (int level, \fBstd::string\fP s)\fC [virtual]\fP" @@ -917,12 +933,12 @@ Writes a log string. .PP This method writes a line of text to the log. If the level given is lower than the level given in the configuration, this command has no effect. .PP -Definition at line 452 of file modules.cpp. +Definition at line 490 of file modules.cpp. .PP .nf -453 { -454 log(level,'%s',s.c_str()); -455 } +491 { +492 log(level,'%s',s.c_str()); +493 } .fi .PP .SS "bool Server::MatchText (\fBstd::string\fP sliteral, \fBstd::string\fP spattern)\fC [virtual]\fP" @@ -931,15 +947,15 @@ Matches text against a glob pattern. .PP Uses the ircd's internal matching function to match string against a globbing pattern, e.g. *!*@*.com Returns true if the literal successfully matches the pattern, false if otherwise. .PP -Definition at line 397 of file modules.cpp. +Definition at line 430 of file modules.cpp. .PP .nf -398 { -399 char literal[MAXBUF],pattern[MAXBUF]; -400 strlcpy(literal,sliteral.c_str(),MAXBUF); -401 strlcpy(pattern,spattern.c_str(),MAXBUF); -402 return match(literal,pattern); -403 } +431 { +432 char literal[MAXBUF],pattern[MAXBUF]; +433 strlcpy(literal,sliteral.c_str(),MAXBUF); +434 strlcpy(pattern,spattern.c_str(),MAXBUF); +435 return match(literal,pattern); +436 } .fi .PP .SS "\fBchanrec\fP * Server::PartUserFromChannel (\fBuserrec\fP * user, \fBstd::string\fP cname, \fBstd::string\fP reason)\fC [virtual]\fP" @@ -948,12 +964,12 @@ Forces a user to part a channel. .PP This is similar to svspart and can be used to implement redirection, etc. Although the return value of this function is a pointer to a channel record, the returned data is undefined and should not be read or written to. This behaviour may be changed in a future version. .PP -Definition at line 415 of file modules.cpp. +Definition at line 448 of file modules.cpp. .PP .nf -416 { -417 return del_channel(user,cname.c_str(),reason.c_str(),false); -418 } +449 { +450 return del_channel(user,cname.c_str(),reason.c_str(),false); +451 } .fi .PP .SS "bool Server::PseudoToUser (\fBuserrec\fP * alive, \fBuserrec\fP * zombie, \fBstd::string\fP message)\fC [virtual]\fP" @@ -962,39 +978,39 @@ This user takes one user, and switches their file descriptor with another user, .PP The user in 'alive' is booted off the server with the given message. The user referred to by 'zombie' should have previously been locked with Server::ZombifyUser, otherwise stale sockets and file descriptor leaks can occur. After this call, the pointer to alive will be invalid, and the pointer to zombie will be equivalent in effect to the old pointer to alive. .PP -Definition at line 670 of file modules.cpp. +Definition at line 708 of file modules.cpp. .PP References ucrec::channel, userrec::chans, userrec::ClearBuffer(), connection::fd, FD_MAGIC_NUMBER, connection::host, userrec::ident, chanrec::name, userrec::nick, chanrec::setby, chanrec::topic, and chanrec::topicset. .PP .nf -671 { -672 zombie->fd = alive->fd; -673 alive->fd = FD_MAGIC_NUMBER; -674 alive->ClearBuffer(); -675 Write(zombie->fd,':%s!%s@%s NICK %s',alive->nick,alive->ident,alive->host,zombie->nick); -676 kill_link(alive,message.c_str()); -677 fd_ref_table[zombie->fd] = zombie; -678 for (int i = 0; i != MAXCHANS; i++) -679 { -680 if (zombie->chans[i].channel != NULL) -681 { -682 if (zombie->chans[i].channel->name) -683 { -684 chanrec* Ptr = zombie->chans[i].channel; -685 WriteFrom(zombie->fd,zombie,'JOIN %s',Ptr->name); -686 if (Ptr->topicset) -687 { -688 WriteServ(zombie->fd,'332 %s %s :%s', zombie->nick, Ptr->name, Ptr->topic); -689 WriteServ(zombie->fd,'333 %s %s %s %d', zombie->nick, Ptr->name, Ptr->setby, Ptr->topicset); -690 } -691 userlist(zombie,Ptr); -692 WriteServ(zombie->fd,'366 %s %s :End of /NAMES list.', zombie->nick, Ptr->name); -693 -694 } -695 } -696 } -697 return true; -698 } +709 { +710 zombie->fd = alive->fd; +711 alive->fd = FD_MAGIC_NUMBER; +712 alive->ClearBuffer(); +713 Write(zombie->fd,':%s!%s@%s NICK %s',alive->nick,alive->ident,alive->host,zombie->nick); +714 kill_link(alive,message.c_str()); +715 fd_ref_table[zombie->fd] = zombie; +716 for (int i = 0; i != MAXCHANS; i++) +717 { +718 if (zombie->chans[i].channel != NULL) +719 { +720 if (zombie->chans[i].channel->name) +721 { +722 chanrec* Ptr = zombie->chans[i].channel; +723 WriteFrom(zombie->fd,zombie,'JOIN %s',Ptr->name); +724 if (Ptr->topicset) +725 { +726 WriteServ(zombie->fd,'332 %s %s :%s', zombie->nick, Ptr->name, Ptr->topic); +727 WriteServ(zombie->fd,'333 %s %s %s %d', zombie->nick, Ptr->name, Ptr->setby, Ptr->topicset); +728 } +729 userlist(zombie,Ptr); +730 WriteServ(zombie->fd,'366 %s %s :End of /NAMES list.', zombie->nick, Ptr->name); +731 +732 } +733 } +734 } +735 return true; +736 } .fi .PP .SS "void Server::QuitUser (\fBuserrec\fP * user, \fBstd::string\fP reason)\fC [virtual]\fP" @@ -1007,12 +1023,23 @@ WARNING! .PP Once you call this function, userrec* user will immediately become INVALID. You MUST NOT write to, or read from this pointer after calling the QuitUser method UNDER ANY CIRCUMSTANCES! The best course of action after calling this method is to immediately bail from your handler. .PP -Definition at line 437 of file modules.cpp. +Definition at line 470 of file modules.cpp. +.PP +.nf +471 { +472 kill_link(user,reason.c_str()); +473 } +.fi +.PP +.SS "void Server::RehashServer ()\fC [virtual]\fP" +.PP +Definition at line 407 of file modules.cpp. .PP .nf -438 { -439 kill_link(user,reason.c_str()); -440 } +408 { +409 WriteOpers('*** Rehashing config file'); +410 ReadConfig(false,NULL); +411 } .fi .PP .SS "void Server::Send (int Socket, \fBstd::string\fP s)\fC [virtual]\fP" @@ -1021,12 +1048,12 @@ Sends a line of text down a TCP/IP socket. .PP This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required. .PP -Definition at line 467 of file modules.cpp. +Definition at line 505 of file modules.cpp. .PP .nf -468 { -469 Write(Socket,'%s',s.c_str()); -470 } +506 { +507 Write(Socket,'%s',s.c_str()); +508 } .fi .PP .SS "void Server::SendChannel (\fBuserrec\fP * User, \fBchanrec\fP * Channel, \fBstd::string\fP s, bool IncludeSender)\fC [virtual]\fP" @@ -1035,19 +1062,19 @@ Sends text from a user to a channel (mulicast). .PP This method writes a line of text to a channel, with the given user's nick/ident /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in MODE (see RFC 1459). .PP -Definition at line 501 of file modules.cpp. +Definition at line 539 of file modules.cpp. .PP .nf -502 { -503 if (IncludeSender) -504 { -505 WriteChannel(Channel,User,'%s',s.c_str()); -506 } -507 else -508 { -509 ChanExceptSender(Channel,User,'%s',s.c_str()); -510 } -511 } +540 { +541 if (IncludeSender) +542 { +543 WriteChannel(Channel,User,'%s',s.c_str()); +544 } +545 else +546 { +547 ChanExceptSender(Channel,User,'%s',s.c_str()); +548 } +549 } .fi .PP .SS "void Server::SendChannelServerNotice (\fBstd::string\fP ServName, \fBchanrec\fP * Channel, \fBstd::string\fP text)\fC [virtual]\fP" @@ -1056,12 +1083,12 @@ Writes text to a channel, but from a server, including all. .PP This can be used to send server notices to a group of users. .PP -Definition at line 496 of file modules.cpp. +Definition at line 534 of file modules.cpp. .PP .nf -497 { -498 WriteChannelWithServ((char*)ServName.c_str(), Channel, '%s', text.c_str()); -499 } +535 { +536 WriteChannelWithServ((char*)ServName.c_str(), Channel, '%s', text.c_str()); +537 } .fi .PP .SS "void Server::SendCommon (\fBuserrec\fP * User, \fBstd::string\fP text, bool IncludeSender)\fC [virtual]\fP" @@ -1070,19 +1097,19 @@ Sends text from a user to one or more channels (mulicast). .PP This method writes a line of text to all users which share a common channel with a given user, with the user's nick/ident/host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in NICK (see RFC 1459). Otherwise, it is only sent to the other recipients, as seen in QUIT. .PP -Definition at line 518 of file modules.cpp. +Definition at line 556 of file modules.cpp. .PP .nf -519 { -520 if (IncludeSender) -521 { -522 WriteCommon(User,'%s',text.c_str()); -523 } -524 else -525 { -526 WriteCommonExcept(User,'%s',text.c_str()); -527 } -528 } +557 { +558 if (IncludeSender) +559 { +560 WriteCommon(User,'%s',text.c_str()); +561 } +562 else +563 { +564 WriteCommonExcept(User,'%s',text.c_str()); +565 } +566 } .fi .PP .SS "void Server::SendFrom (int Socket, \fBuserrec\fP * User, \fBstd::string\fP s)\fC [virtual]\fP" @@ -1091,12 +1118,12 @@ Sends text from a user to a socket. .PP This method writes a line of text to an established socket, with the given user's nick/ident /host combination prepended, as used in PRIVSG etc commands (see RFC 1459) .PP -Definition at line 477 of file modules.cpp. +Definition at line 515 of file modules.cpp. .PP .nf -478 { -479 WriteFrom(Socket,User,'%s',s.c_str()); -480 } +516 { +517 WriteFrom(Socket,User,'%s',s.c_str()); +518 } .fi .PP .SS "void Server::SendMode (char ** parameters, int pcnt, \fBuserrec\fP * user)\fC [virtual]\fP" @@ -1119,14 +1146,14 @@ Srv->SendMode(modes,3,user); .PP The modes will originate from the server where the command was issued, however responses (e.g. numerics) will be sent to the user you provide as the third parameter. You must be sure to get the number of parameters correct in the pcnt parameter otherwise you could leave your server in an unstable state! .PP -Definition at line 462 of file modules.cpp. +Definition at line 500 of file modules.cpp. .PP References server_mode(). .PP .nf -463 { -464 server_mode(parameters,pcnt,user); -465 } +501 { +502 server_mode(parameters,pcnt,user); +503 } .fi .PP .SS "void Server::SendOpers (\fBstd::string\fP s)\fC [virtual]\fP" @@ -1135,12 +1162,12 @@ Sends text to all opers. .PP This method sends a server notice to all opers with the usermode +s. .PP -Definition at line 392 of file modules.cpp. +Definition at line 425 of file modules.cpp. .PP .nf -393 { -394 WriteOpers('%s',s.c_str()); -395 } +426 { +427 WriteOpers('%s',s.c_str()); +428 } .fi .PP .SS "void Server::SendServ (int Socket, \fBstd::string\fP s)\fC [virtual]\fP" @@ -1149,12 +1176,12 @@ Sends text from the server to a socket. .PP This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459) .PP -Definition at line 472 of file modules.cpp. +Definition at line 510 of file modules.cpp. .PP .nf -473 { -474 WriteServ(Socket,'%s',s.c_str()); -475 } +511 { +512 WriteServ(Socket,'%s',s.c_str()); +513 } .fi .PP .SS "void Server::SendTo (\fBuserrec\fP * Source, \fBuserrec\fP * Dest, \fBstd::string\fP s)\fC [virtual]\fP" @@ -1171,23 +1198,23 @@ The format will become: .PP Which is useful for numerics and server notices to single users, etc. .PP -Definition at line 482 of file modules.cpp. +Definition at line 520 of file modules.cpp. .PP References connection::fd. .PP .nf -483 { -484 if (!Source) -485 { -486 // if source is NULL, then the message originates from the local server -487 Write(Dest->fd,':%s %s',this->GetServerName().c_str(),s.c_str()); -488 } -489 else -490 { -491 // otherwise it comes from the user specified -492 WriteTo(Source,Dest,'%s',s.c_str()); -493 } -494 } +521 { +522 if (!Source) +523 { +524 // if source is NULL, then the message originates from the local server +525 Write(Dest->fd,':%s %s',this->GetServerName().c_str(),s.c_str()); +526 } +527 else +528 { +529 // otherwise it comes from the user specified +530 WriteTo(Source,Dest,'%s',s.c_str()); +531 } +532 } .fi .PP .SS "void Server::SendToModeMask (\fBstd::string\fP modes, int flags, \fBstd::string\fP text)\fC [virtual]\fP" @@ -1200,12 +1227,12 @@ Serv->SendToModeMask('xi', WM_OR, 'm00'); .PP Then the text 'm00' will be sent to all users with EITHER mode x or i. Conversely if you used WM_AND, the user must have both modes set to receive the message. .PP -Definition at line 405 of file modules.cpp. +Definition at line 438 of file modules.cpp. .PP .nf -406 { -407 WriteMode(modes.c_str(),flags,'%s',text.c_str()); -408 } +439 { +440 WriteMode(modes.c_str(),flags,'%s',text.c_str()); +441 } .fi .PP .SS "void Server::SendWallops (\fBuserrec\fP * User, \fBstd::string\fP text)\fC [virtual]\fP" @@ -1214,12 +1241,12 @@ Sends a WALLOPS message. .PP This method writes a WALLOPS message to all users with the +w flag, originating from the specified user. .PP -Definition at line 530 of file modules.cpp. +Definition at line 568 of file modules.cpp. .PP .nf -531 { -532 WriteWallOps(User,false,'%s',text.c_str()); -533 } +569 { +570 WriteWallOps(User,false,'%s',text.c_str()); +571 } .fi .PP .SS "bool Server::UserToPseudo (\fBuserrec\fP * user, \fBstd::string\fP message)\fC [virtual]\fP" @@ -1228,40 +1255,40 @@ Remove a user's connection to the irc server, but leave their client in existenc .PP When you call this function, the user's file descriptor will be replaced with the value of FD_MAGIC_NUMBER and their old file descriptor will be closed. This idle client will remain until it is restored with a valid file descriptor, or is removed from IRC by an operator After this call, the pointer to user will be invalid. .PP -Definition at line 639 of file modules.cpp. +Definition at line 677 of file modules.cpp. .PP References userrec::ClearBuffer(), DEBUG, connection::fd, FD_MAGIC_NUMBER, connection::host, and userrec::ident. .PP .nf -640 { -641 unsigned int old_fd = user->fd; -642 user->fd = FD_MAGIC_NUMBER; -643 user->ClearBuffer(); -644 Write(old_fd,'ERROR :Closing link (%s@%s) [%s]',user->ident,user->host,message.c_str()); -645 #ifdef USE_KQUEUE -646 struct kevent ke; -647 EV_SET(&ke, old_fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); -648 int i = kevent(kq, &ke, 1, 0, 0, NULL); -649 if (i == -1) -650 { -651 log(DEBUG,'kqueue: Failed to remove user from queue!'); -652 } -653 #endif -654 #ifdef USE_EPOLL -655 struct epoll_event ev; -656 ev.events = EPOLLIN | EPOLLET; -657 ev.data.fd = old_fd; -658 int i = epoll_ctl(ep, EPOLL_CTL_DEL, old_fd, &ev); -659 if (i < 0) -660 { -661 log(DEBUG,'epoll: List deletion failure!'); -662 } -663 #endif -664 -665 shutdown(old_fd,2); -666 close(old_fd); -667 return true; -668 } +678 { +679 unsigned int old_fd = user->fd; +680 user->fd = FD_MAGIC_NUMBER; +681 user->ClearBuffer(); +682 Write(old_fd,'ERROR :Closing link (%s@%s) [%s]',user->ident,user->host,message.c_str()); +683 #ifdef USE_KQUEUE +684 struct kevent ke; +685 EV_SET(&ke, old_fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); +686 int i = kevent(kq, &ke, 1, 0, 0, NULL); +687 if (i == -1) +688 { +689 log(DEBUG,'kqueue: Failed to remove user from queue!'); +690 } +691 #endif +692 #ifdef USE_EPOLL +693 struct epoll_event ev; +694 ev.events = EPOLLIN | EPOLLET; +695 ev.data.fd = old_fd; +696 int i = epoll_ctl(ep, EPOLL_CTL_DEL, old_fd, &ev); +697 if (i < 0) +698 { +699 log(DEBUG,'epoll: List deletion failure!'); +700 } +701 #endif +702 +703 shutdown(old_fd,2); +704 close(old_fd); +705 return true; +706 } .fi .PP diff --git a/docs/man/man3/Version.3 b/docs/man/man3/Version.3 index 166f36369..4cc7e69ab 100644 --- a/docs/man/man3/Version.3 +++ b/docs/man/man3/Version.3 @@ -1,4 +1,4 @@ -.TH "Version" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "Version" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -44,7 +44,7 @@ Holds a module's Version information The four members (set by the constructor on A class of type Version is returned by the GetVersion method of the \fBModule\fP class. .PP -Definition at line 112 of file modules.h. +Definition at line 113 of file modules.h. .SH "Constructor & Destructor Documentation" .PP .SS "Version::Version (int major, int minor, int revision, int build, int flags)" @@ -59,19 +59,19 @@ Definition at line 246 of file modules.cpp. .PP .SS "const int \fBVersion::Build\fP" .PP -Definition at line 115 of file modules.h. +Definition at line 116 of file modules.h. .SS "const int \fBVersion::Flags\fP" .PP -Definition at line 115 of file modules.h. +Definition at line 116 of file modules.h. .SS "const int \fBVersion::Major\fP" .PP -Definition at line 115 of file modules.h. +Definition at line 116 of file modules.h. .SS "const int \fBVersion::Minor\fP" .PP -Definition at line 115 of file modules.h. +Definition at line 116 of file modules.h. .SS "const int \fBVersion::Revision\fP" .PP -Definition at line 115 of file modules.h. +Definition at line 116 of file modules.h. .SH "Author" .PP diff --git a/docs/man/man3/WhoWasUser.3 b/docs/man/man3/WhoWasUser.3 index e1fc03962..14441a78c 100644 --- a/docs/man/man3/WhoWasUser.3 +++ b/docs/man/man3/WhoWasUser.3 @@ -1,4 +1,4 @@ -.TH "WhoWasUser" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "WhoWasUser" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -39,30 +39,30 @@ WhoWasUser \- A lightweight userrec used by WHOWAS. .PP A lightweight userrec used by WHOWAS. .PP -Definition at line 325 of file users.h. +Definition at line 332 of file users.h. .SH "Member Data Documentation" .PP .SS "char \fBWhoWasUser::dhost\fP[160]" .PP -Definition at line 330 of file users.h. +Definition at line 337 of file users.h. .SS "char \fBWhoWasUser::fullname\fP[MAXGECOS+1]" .PP -Definition at line 332 of file users.h. +Definition at line 339 of file users.h. .SS "char \fBWhoWasUser::host\fP[160]" .PP -Definition at line 331 of file users.h. +Definition at line 338 of file users.h. .SS "char \fBWhoWasUser::ident\fP[IDENTMAX+1]" .PP -Definition at line 329 of file users.h. +Definition at line 336 of file users.h. .SS "char \fBWhoWasUser::nick\fP[NICKMAX]" .PP -Definition at line 328 of file users.h. +Definition at line 335 of file users.h. .SS "char \fBWhoWasUser::server\fP[256]" .PP -Definition at line 333 of file users.h. +Definition at line 340 of file users.h. .SS "time_t \fBWhoWasUser::signon\fP" .PP -Definition at line 334 of file users.h. +Definition at line 341 of file users.h. .SH "Author" .PP diff --git a/docs/man/man3/XLine.3 b/docs/man/man3/XLine.3 index f6d574d79..531448d3d 100644 --- a/docs/man/man3/XLine.3 +++ b/docs/man/man3/XLine.3 @@ -1,4 +1,4 @@ -.TH "XLine" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "XLine" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/ZLine.3 b/docs/man/man3/ZLine.3 index 9b5c0c9ae..887f4b3f7 100644 --- a/docs/man/man3/ZLine.3 +++ b/docs/man/man3/ZLine.3 @@ -1,4 +1,4 @@ -.TH "ZLine" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ZLine" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/_home_.3 b/docs/man/man3/_home_.3 index 4551c1a19..4e407fde9 100644 --- a/docs/man/man3/_home_.3 +++ b/docs/man/man3/_home_.3 @@ -1,4 +1,4 @@ -.TH "/home/ Directory Reference" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "/home/ Directory Reference" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/_home_brain_.3 b/docs/man/man3/_home_brain_.3 index 57d2400e8..de4a2293e 100644 --- a/docs/man/man3/_home_brain_.3 +++ b/docs/man/man3/_home_brain_.3 @@ -1,4 +1,4 @@ -.TH "/home/brain/ Directory Reference" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "/home/brain/ Directory Reference" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/_home_brain_inspircd-cvs_.3 b/docs/man/man3/_home_brain_inspircd-cvs_.3 index 96ae7889f..475459bfd 100644 --- a/docs/man/man3/_home_brain_inspircd-cvs_.3 +++ b/docs/man/man3/_home_brain_inspircd-cvs_.3 @@ -1,4 +1,4 @@ -.TH "/home/brain/inspircd-cvs/ Directory Reference" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "/home/brain/inspircd-cvs/ Directory Reference" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/_home_brain_inspircd-cvs_inspircd_.3 b/docs/man/man3/_home_brain_inspircd-cvs_inspircd_.3 index f1dad75d0..840161aaa 100644 --- a/docs/man/man3/_home_brain_inspircd-cvs_inspircd_.3 +++ b/docs/man/man3/_home_brain_inspircd-cvs_inspircd_.3 @@ -1,4 +1,4 @@ -.TH "/home/brain/inspircd-cvs/inspircd/ Directory Reference" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "/home/brain/inspircd-cvs/inspircd/ Directory Reference" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/_home_brain_inspircd-cvs_inspircd_include_.3 b/docs/man/man3/_home_brain_inspircd-cvs_inspircd_include_.3 index b7891755c..3f8773d1f 100644 --- a/docs/man/man3/_home_brain_inspircd-cvs_inspircd_include_.3 +++ b/docs/man/man3/_home_brain_inspircd-cvs_inspircd_include_.3 @@ -1,4 +1,4 @@ -.TH "/home/brain/inspircd-cvs/inspircd/include/ Directory Reference" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "/home/brain/inspircd-cvs/inspircd/include/ Directory Reference" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/_home_brain_inspircd-cvs_inspircd_src_.3 b/docs/man/man3/_home_brain_inspircd-cvs_inspircd_src_.3 index 868e33670..0a1c37a31 100644 --- a/docs/man/man3/_home_brain_inspircd-cvs_inspircd_src_.3 +++ b/docs/man/man3/_home_brain_inspircd-cvs_inspircd_src_.3 @@ -1,4 +1,4 @@ -.TH "/home/brain/inspircd-cvs/inspircd/src/ Directory Reference" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "/home/brain/inspircd-cvs/inspircd/src/ Directory Reference" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/base.h.3 b/docs/man/man3/base.h.3 index 293b9845c..2ccad4081 100644 --- a/docs/man/man3/base.h.3 +++ b/docs/man/man3/base.h.3 @@ -1,4 +1,4 @@ -.TH "base.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "base.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -12,6 +12,8 @@ base.h \- .br \fC#include <map>\fP .br +\fC#include <deque>\fP +.br \fC#include <string>\fP .br @@ -42,7 +44,7 @@ base.h \- .PP .SS "typedef void* \fBVoidPointer\fP" .PP -Definition at line 25 of file base.h. +Definition at line 26 of file base.h. .SH "Author" .PP Generated automatically by Doxygen for InspIRCd from the source code. diff --git a/docs/man/man3/channels.cpp.3 b/docs/man/man3/channels.cpp.3 index 41e336448..43d39173b 100644 --- a/docs/man/man3/channels.cpp.3 +++ b/docs/man/man3/channels.cpp.3 @@ -1,4 +1,4 @@ -.TH "channels.cpp" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "channels.cpp" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -221,7 +221,7 @@ Referenced by Server::GetUsers(). Definition at line 81 of file channels.cpp. .SS "int \fBMODCOUNT\fP = -1" .PP -Definition at line 994 of file modules.cpp. +Definition at line 1032 of file modules.cpp. .PP Referenced by Server::FindModule(). .SS "std::vector<\fBstd::string\fP> \fBmodule_names\fP" diff --git a/docs/man/man3/channels.h.3 b/docs/man/man3/channels.h.3 index e0158a5fa..3ea8129b0 100644 --- a/docs/man/man3/channels.h.3 +++ b/docs/man/man3/channels.h.3 @@ -1,4 +1,4 @@ -.TH "channels.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "channels.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/chanrec.3 b/docs/man/man3/chanrec.3 index 48d998e2f..35dc47ddf 100644 --- a/docs/man/man3/chanrec.3 +++ b/docs/man/man3/chanrec.3 @@ -1,4 +1,4 @@ -.TH "chanrec" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "chanrec" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/classbase.3 b/docs/man/man3/classbase.3 index cf1538044..e8000432a 100644 --- a/docs/man/man3/classbase.3 +++ b/docs/man/man3/classbase.3 @@ -1,4 +1,4 @@ -.TH "classbase" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "classbase" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -35,27 +35,27 @@ Inherited by \fBAdmin\fP, \fBConfigReader\fP, \fBConnectClass\fP, \fBExtensible\ .PP The base class for all inspircd classes. .PP -Definition at line 29 of file base.h. +Definition at line 30 of file base.h. .SH "Constructor & Destructor Documentation" .PP .SS "classbase::classbase ()\fC [inline]\fP" .PP Constructor, Sets the object's time. .PP -Definition at line 39 of file base.h. +Definition at line 40 of file base.h. .PP References age. .PP .nf -39 { age = time(NULL); } +40 { age = time(NULL); } .fi .PP .SS "classbase::~classbase ()\fC [inline]\fP" .PP -Definition at line 40 of file base.h. +Definition at line 41 of file base.h. .PP .nf -40 { } +41 { } .fi .PP .SH "Member Data Documentation" @@ -64,7 +64,7 @@ Definition at line 40 of file base.h. .PP Time that the object was instantiated (used for TS calculation etc). .PP -Definition at line 34 of file base.h. +Definition at line 35 of file base.h. .PP Referenced by classbase(). diff --git a/docs/man/man3/command_t.3 b/docs/man/man3/command_t.3 index a761b01d2..3856f66d6 100644 --- a/docs/man/man3/command_t.3 +++ b/docs/man/man3/command_t.3 @@ -1,4 +1,4 @@ -.TH "command_t" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "command_t" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/commands.h.3 b/docs/man/man3/commands.h.3 index 467911b07..643a4d95f 100644 --- a/docs/man/man3/commands.h.3 +++ b/docs/man/man3/commands.h.3 @@ -1,4 +1,4 @@ -.TH "commands.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "commands.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -188,9 +188,14 @@ commands.h \- .RI "long \fBduration\fP (const char *str)" .br .RI "\fIOther useful functions. \fP" +.ti -1c +.RI "void \fBdo_whois\fP (\fBuserrec\fP *user, \fBuserrec\fP *dest, unsigned long signon, unsigned long idle, char *nick)" +.br .in -1c .SH "Function Documentation" .PP +.SS "void do_whois (\fBuserrec\fP * user, \fBuserrec\fP * dest, unsigned long signon, unsigned long idle, char * nick)" +.PP .SS "long duration (const char * str)" .PP Other useful functions. @@ -304,7 +309,7 @@ These are the handlers for user commands. .PP Functions for u:lined servers. .PP -Referenced by Server::IsUlined(). +Referenced by userrec::HasPermission(), and Server::IsUlined(). .SH "Author" .PP Generated automatically by Doxygen for InspIRCd from the source code. diff --git a/docs/man/man3/connection.3 b/docs/man/man3/connection.3 index e243173d6..ca56a0899 100644 --- a/docs/man/man3/connection.3 +++ b/docs/man/man3/connection.3 @@ -1,4 +1,4 @@ -.TH "connection" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "connection" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/connection.h.3 b/docs/man/man3/connection.h.3 index 04af56c8c..9ddbe7517 100644 --- a/docs/man/man3/connection.h.3 +++ b/docs/man/man3/connection.h.3 @@ -1,4 +1,4 @@ -.TH "connection.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "connection.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/ctables.h.3 b/docs/man/man3/ctables.h.3 index b9fe786ed..4579fc91f 100644 --- a/docs/man/man3/ctables.h.3 +++ b/docs/man/man3/ctables.h.3 @@ -1,4 +1,4 @@ -.TH "ctables.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ctables.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/dns.h.3 b/docs/man/man3/dns.h.3 index a3c90c1c8..fd601d288 100644 --- a/docs/man/man3/dns.h.3 +++ b/docs/man/man3/dns.h.3 @@ -1,4 +1,4 @@ -.TH "dns.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "dns.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/dns_ip4list.3 b/docs/man/man3/dns_ip4list.3 index 483f4c324..e857eff47 100644 --- a/docs/man/man3/dns_ip4list.3 +++ b/docs/man/man3/dns_ip4list.3 @@ -1,4 +1,4 @@ -.TH "dns_ip4list" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "dns_ip4list" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/hashcomp.h.3 b/docs/man/man3/hashcomp.h.3 index 2e77b22f0..fc7453492 100644 --- a/docs/man/man3/hashcomp.h.3 +++ b/docs/man/man3/hashcomp.h.3 @@ -1,4 +1,4 @@ -.TH "hashcomp.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "hashcomp.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/irc.3 b/docs/man/man3/irc.3 index 5732c80f7..192b4a0ea 100644 --- a/docs/man/man3/irc.3 +++ b/docs/man/man3/irc.3 @@ -1,4 +1,4 @@ -.TH "irc" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "irc" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/irc_InAddr_HashComp.3 b/docs/man/man3/irc_InAddr_HashComp.3 index ead2429e0..e4d8d0720 100644 --- a/docs/man/man3/irc_InAddr_HashComp.3 +++ b/docs/man/man3/irc_InAddr_HashComp.3 @@ -1,4 +1,4 @@ -.TH "irc::InAddr_HashComp" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "irc::InAddr_HashComp" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/irc_StrHashComp.3 b/docs/man/man3/irc_StrHashComp.3 index 8b96cb26a..dae5027b7 100644 --- a/docs/man/man3/irc_StrHashComp.3 +++ b/docs/man/man3/irc_StrHashComp.3 @@ -1,4 +1,4 @@ -.TH "irc::StrHashComp" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "irc::StrHashComp" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/irc_irc_char_traits.3 b/docs/man/man3/irc_irc_char_traits.3 index fbc43ebdb..118de0f30 100644 --- a/docs/man/man3/irc_irc_char_traits.3 +++ b/docs/man/man3/irc_irc_char_traits.3 @@ -1,4 +1,4 @@ -.TH "irc::irc_char_traits" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "irc::irc_char_traits" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/message.h.3 b/docs/man/man3/message.h.3 index 5778a25f6..1fde59aac 100644 --- a/docs/man/man3/message.h.3 +++ b/docs/man/man3/message.h.3 @@ -1,4 +1,4 @@ -.TH "message.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "message.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/mode.h.3 b/docs/man/man3/mode.h.3 index 8a27ddae3..15a7a3541 100644 --- a/docs/man/man3/mode.h.3 +++ b/docs/man/man3/mode.h.3 @@ -1,4 +1,4 @@ -.TH "mode.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "mode.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/modules.cpp.3 b/docs/man/man3/modules.cpp.3 index 1a652c1d6..ea563e279 100644 --- a/docs/man/man3/modules.cpp.3 +++ b/docs/man/man3/modules.cpp.3 @@ -1,4 +1,4 @@ -.TH "modules.cpp" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "modules.cpp" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -474,7 +474,7 @@ Referenced by ConfigReader::ConfigReader(). Definition at line 81 of file channels.cpp. .SS "int \fBMODCOUNT\fP = -1" .PP -Definition at line 994 of file modules.cpp. +Definition at line 1032 of file modules.cpp. .SS "std::vector<\fBstd::string\fP> \fBmodule_names\fP" .PP .SS "std::vector<\fBInspSocket\fP*> \fBmodule_sockets\fP" diff --git a/docs/man/man3/modules.h.3 b/docs/man/man3/modules.h.3 index 36b65e742..c6eb1ac55 100644 --- a/docs/man/man3/modules.h.3 +++ b/docs/man/man3/modules.h.3 @@ -1,4 +1,4 @@ -.TH "modules.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "modules.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -71,6 +71,7 @@ modules.h \- .ti -1c .RI "#define \fBDEBUG\fP 10" .br +.RI "\fIlog levels \fP" .ti -1c .RI "#define \fBVERBOSE\fP 20" .br @@ -86,6 +87,7 @@ modules.h \- .ti -1c .RI "#define \fBMT_CHANNEL\fP 1" .br +.RI "\fIUsed with OnExtendedMode() method of modules. \fP" .ti -1c .RI "#define \fBMT_CLIENT\fP 2" .br @@ -95,6 +97,7 @@ modules.h \- .ti -1c .RI "#define \fBACR_DEFAULT\fP 0" .br +.RI "\fIUsed with OnAccessCheck() method of modules. \fP" .ti -1c .RI "#define \fBACR_DENY\fP 1" .br @@ -131,6 +134,7 @@ modules.h \- .ti -1c .RI "#define \fBVF_STATIC\fP 1" .br +.RI "\fIUsed to define a set of behavior bits for a module. \fP" .ti -1c .RI "#define \fBVF_VENDOR\fP 2" .br @@ -194,36 +198,38 @@ modules.h \- .PP .SS "#define AC_DEHALFOP 6" .PP -Definition at line 47 of file modules.h. +Definition at line 46 of file modules.h. .SS "#define AC_DEOP 1" .PP -Definition at line 42 of file modules.h. +Definition at line 41 of file modules.h. .SS "#define AC_DEVOICE 4" .PP -Definition at line 45 of file modules.h. +Definition at line 44 of file modules.h. .SS "#define AC_GENERAL_MODE 8" .PP -Definition at line 49 of file modules.h. +Definition at line 48 of file modules.h. .SS "#define AC_HALFOP 5" .PP -Definition at line 46 of file modules.h. +Definition at line 45 of file modules.h. .SS "#define AC_INVITE 7" .PP -Definition at line 48 of file modules.h. +Definition at line 47 of file modules.h. .SS "#define AC_KICK 0" .PP -Definition at line 41 of file modules.h. +Definition at line 40 of file modules.h. .SS "#define AC_OP 2" .PP -Definition at line 43 of file modules.h. +Definition at line 42 of file modules.h. .SS "#define AC_VOICE 3" .PP -Definition at line 44 of file modules.h. +Definition at line 43 of file modules.h. .SS "#define ACR_ALLOW 2" .PP Definition at line 39 of file modules.h. .SS "#define ACR_DEFAULT 0" .PP +Used with OnAccessCheck() method of modules. +.PP Definition at line 37 of file modules.h. .PP Referenced by Module::OnAccessCheck(). @@ -232,40 +238,42 @@ Referenced by Module::OnAccessCheck(). Definition at line 38 of file modules.h. .SS "#define CONF_FILE_NOT_FOUND 0x000200" .PP -Definition at line 1112 of file modules.h. +Definition at line 1501 of file modules.h. .PP Referenced by ConfigReader::ConfigReader(). .SS "#define CONF_NOT_A_NUMBER 0x000010" .PP -Definition at line 1109 of file modules.h. +Definition at line 1498 of file modules.h. .PP Referenced by ConfigReader::ReadInteger(). .SS "#define CONF_NOT_UNSIGNED 0x000080" .PP -Definition at line 1110 of file modules.h. +Definition at line 1499 of file modules.h. .PP Referenced by ConfigReader::ReadInteger(). .SS "#define CONF_VALUE_NOT_FOUND 0x000100" .PP -Definition at line 1111 of file modules.h. +Definition at line 1500 of file modules.h. .PP Referenced by ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), and ConfigReader::ReadValue(). .SS "#define DEBUG 10" .PP +log levels +.PP Definition at line 23 of file modules.h. .PP -Referenced by Server::AddExtendedMode(), chanrec::AddUser(), chanrec::DelUser(), userrec::HasPermission(), InspSocket::InspSocket(), chanrec::IsCustomModeSet(), InspSocket::Read(), userrec::ReadData(), userrec::RemoveInvite(), chanrec::SetCustomMode(), chanrec::SetCustomModeParam(), InspSocket::SetState(), userrec::SetWriteError(), and Server::UserToPseudo(). +Referenced by Server::AddExtendedMode(), chanrec::AddUser(), chanrec::DelUser(), InspSocket::InspSocket(), chanrec::IsCustomModeSet(), InspSocket::Read(), userrec::ReadData(), userrec::RemoveInvite(), chanrec::SetCustomMode(), chanrec::SetCustomModeParam(), InspSocket::SetState(), userrec::SetWriteError(), and Server::UserToPseudo(). .SS "#define DEFAULT 30" .PP Definition at line 25 of file modules.h. .SS "#define FD_MAGIC_NUMBER -42" .PP -Definition at line 100 of file modules.h. +Definition at line 101 of file modules.h. .PP Referenced by Server::PseudoToUser(), and Server::UserToPseudo(). .SS "#define FOREACH_MOD for (int _i = 0; _i <= \fBMODCOUNT\fP; _i++) modules[_i]->" .PP -Definition at line 80 of file modules.h. +Definition at line 81 of file modules.h. .PP Referenced by Event::Send(). .SS "#define FOREACH_RESULT(x)" @@ -284,9 +292,11 @@ Referenced by Event::Send(). } .fi .PP -Definition at line 88 of file modules.h. +Definition at line 89 of file modules.h. .SS "#define MT_CHANNEL 1" .PP +Used with OnExtendedMode() method of modules. +.PP Definition at line 31 of file modules.h. .PP Referenced by Server::AddExtendedListMode(), and ModeMakeList(). @@ -311,16 +321,18 @@ Definition at line 26 of file modules.h. Definition at line 24 of file modules.h. .SS "#define VF_COMMON 8" .PP -Definition at line 56 of file modules.h. +Definition at line 55 of file modules.h. .SS "#define VF_SERVICEPROVIDER 4" .PP -Definition at line 55 of file modules.h. +Definition at line 54 of file modules.h. .SS "#define VF_STATIC 1" .PP -Definition at line 53 of file modules.h. +Used to define a set of behavior bits for a module. +.PP +Definition at line 52 of file modules.h. .SS "#define VF_VENDOR 2" .PP -Definition at line 54 of file modules.h. +Definition at line 53 of file modules.h. .PP Referenced by Module::GetVersion(). .SH "Typedef Documentation" @@ -329,18 +341,18 @@ Referenced by Module::GetVersion(). .PP Holds a list of users in a channel. .PP -Definition at line 73 of file modules.h. +Definition at line 74 of file modules.h. .SS "typedef std::deque<\fBstd::string\fP> \fBfile_cache\fP" .PP Low level definition of a \fBFileReader\fP classes file cache area. .PP -Definition at line 68 of file modules.h. +Definition at line 65 of file modules.h. .SS "typedef DLLFactory<\fBModuleFactory\fP> \fBircd_module\fP" .PP -Definition at line 1278 of file modules.h. +Definition at line 1667 of file modules.h. .SS "typedef \fBfile_cache\fP \fBstring_list\fP" .PP -Definition at line 69 of file modules.h. +Definition at line 70 of file modules.h. .SH "Function Documentation" .PP .SS "void createcommand (char * cmd, handlerfunc f, char flags, int minparams, char * source)" diff --git a/docs/man/man3/nspace.3 b/docs/man/man3/nspace.3 index 44ac7474d..6459e68a2 100644 --- a/docs/man/man3/nspace.3 +++ b/docs/man/man3/nspace.3 @@ -1,4 +1,4 @@ -.TH "nspace" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "nspace" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/nspace_hash_ in_addr _.3 b/docs/man/man3/nspace_hash_ in_addr _.3 index c75ee4fc5..2058787ef 100644 --- a/docs/man/man3/nspace_hash_ in_addr _.3 +++ b/docs/man/man3/nspace_hash_ in_addr _.3 @@ -1,4 +1,4 @@ -.TH "nspace::hash< in_addr >" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "nspace::hash< in_addr >" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/nspace_hash_ string _.3 b/docs/man/man3/nspace_hash_ string _.3 index 8d218437a..c9cd5e252 100644 --- a/docs/man/man3/nspace_hash_ string _.3 +++ b/docs/man/man3/nspace_hash_ string _.3 @@ -1,4 +1,4 @@ -.TH "nspace::hash< string >" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "nspace::hash< string >" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/socket.cpp.3 b/docs/man/man3/socket.cpp.3 index 37e4f4a85..136a95e21 100644 --- a/docs/man/man3/socket.cpp.3 +++ b/docs/man/man3/socket.cpp.3 @@ -1,4 +1,4 @@ -.TH "socket.cpp" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "socket.cpp" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/socket.h.3 b/docs/man/man3/socket.h.3 index a41c11226..bdb68566b 100644 --- a/docs/man/man3/socket.h.3 +++ b/docs/man/man3/socket.h.3 @@ -1,4 +1,4 @@ -.TH "socket.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "socket.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/std.3 b/docs/man/man3/std.3 index e566786d7..03a3fe2ea 100644 --- a/docs/man/man3/std.3 +++ b/docs/man/man3/std.3 @@ -1,4 +1,4 @@ -.TH "std" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "std" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/std_char_traits.3 b/docs/man/man3/std_char_traits.3 index dcf736b14..6dd1f9220 100644 --- a/docs/man/man3/std_char_traits.3 +++ b/docs/man/man3/std_char_traits.3 @@ -1,4 +1,4 @@ -.TH "std::char_traits" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "std::char_traits" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/ucrec.3 b/docs/man/man3/ucrec.3 index 464b9ab48..fdf24381c 100644 --- a/docs/man/man3/ucrec.3 +++ b/docs/man/man3/ucrec.3 @@ -1,4 +1,4 @@ -.TH "ucrec" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "ucrec" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man/man3/userrec.3 b/docs/man/man3/userrec.3 index dd6cda28e..38c346b28 100644 --- a/docs/man/man3/userrec.3 +++ b/docs/man/man3/userrec.3 @@ -1,4 +1,4 @@ -.TH "userrec" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "userrec" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -19,9 +19,6 @@ Inherits \fBconnection\fP. .RI "\fBuserrec\fP ()" .br .ti -1c -.RI "virtual \fB~userrec\fP ()" -.br -.ti -1c .RI "virtual char * \fBGetFullHost\fP ()" .br .RI "\fIReturns the full displayed host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. \fP" @@ -89,6 +86,9 @@ Inherits \fBconnection\fP. .RI "void \fBCloseSocket\fP ()" .br .RI "\fIShuts down and closes the user's socket. \fP" +.ti -1c +.RI "virtual \fB~userrec\fP ()" +.br .in -1c .SS "Public Attributes" @@ -192,52 +192,53 @@ Holds all information about a user This class stores all information about a use Everything about a connection is stored here primarily, from the user's socket ID (file descriptor) through to the user's nickname and hostname. Use the Find method of the server class to locate a specific user by nickname. .PP -Definition at line 108 of file users.h. +Definition at line 111 of file users.h. .SH "Constructor & Destructor Documentation" .PP .SS "userrec::userrec ()" .PP -Definition at line 33 of file users.cpp. +Definition at line 38 of file users.cpp. .PP References awaymsg, connection::bytes_in, connection::bytes_out, ucrec::channel, chans, connection::cmds_in, connection::cmds_out, dhost, dns_done, connection::fd, flood, fullname, connection::haspassed, connection::host, ident, connection::idle_lastmsg, invites, connection::ip, connection::lastping, lines_in, modes, nick, connection::nping, oper, connection::port, recvq, connection::registered, reset_due, sendq, server, ServerName, connection::signon, TIME, timeout, and ucrec::uc_modes. .PP .nf -34 { -35 // the PROPER way to do it, AVOID bzero at *ALL* costs -36 strcpy(nick,''); -37 strcpy(ip,'127.0.0.1'); -38 timeout = 0; -39 strcpy(ident,''); -40 strcpy(host,''); -41 strcpy(dhost,''); -42 strcpy(fullname,''); -43 strcpy(modes,''); -44 server = (char*)FindServerNamePtr(ServerName); -45 strcpy(awaymsg,''); -46 strcpy(oper,''); -47 reset_due = TIME; -48 lines_in = 0; -49 fd = lastping = signon = idle_lastmsg = nping = registered = 0; -50 flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0; -51 haspassed = false; -52 dns_done = false; -53 recvq = ''; -54 sendq = ''; -55 for (int i = 0; i < MAXCHANS; i++) -56 { -57 this->chans[i].channel = NULL; -58 this->chans[i].uc_modes = 0; -59 } -60 invites.clear(); -61 } +39 { +40 // the PROPER way to do it, AVOID bzero at *ALL* costs +41 strcpy(nick,''); +42 strcpy(ip,'127.0.0.1'); +43 timeout = 0; +44 strcpy(ident,''); +45 strcpy(host,''); +46 strcpy(dhost,''); +47 strcpy(fullname,''); +48 strcpy(modes,''); +49 server = (char*)FindServerNamePtr(ServerName); +50 strcpy(awaymsg,''); +51 strcpy(oper,''); +52 reset_due = TIME; +53 lines_in = 0; +54 fd = lastping = signon = idle_lastmsg = nping = registered = 0; +55 flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0; +56 haspassed = false; +57 dns_done = false; +58 recvq = ''; +59 sendq = ''; +60 for (int i = 0; i < MAXCHANS; i++) +61 { +62 this->chans[i].channel = NULL; +63 this->chans[i].uc_modes = 0; +64 } +65 invites.clear(); +66 } .fi .PP -.SS "virtual userrec::~userrec ()\fC [inline, virtual]\fP" +.SS "userrec::~userrec ()\fC [virtual]\fP" .PP -Definition at line 221 of file users.h. +Definition at line 68 of file users.cpp. .PP .nf -221 { } +69 { +70 } .fi .PP .SH "Member Function Documentation" @@ -248,35 +249,35 @@ This method adds data to the buffer of the user. .PP The buffer can grow to any size within limits of the available memory, managed by the size of a \fBstd::string\fP, however if any individual line in the buffer grows over 600 bytes in length (which is 88 chars over the RFC-specified limit per line) then the method will return false and the text will not be inserted. .PP -Definition at line 194 of file users.cpp. +Definition at line 205 of file users.cpp. .PP References recvq, recvqmax, and SetWriteError(). .PP .nf -195 { -196 std::string b = ''; -197 for (unsigned int i = 0; i < a.length(); i++) -198 if ((a[i] != '\r') && (a[i] != '\0') && (a[i] != 7)) -199 b = b + a[i]; -200 std::stringstream stream(recvq); -201 stream << b; -202 recvq = stream.str(); -203 unsigned int i = 0; -204 // count the size of the first line in the buffer. -205 while (i < recvq.length()) -206 { -207 if (recvq[i++] == '\n') -208 break; -209 } -210 if (recvq.length() > (unsigned)this->recvqmax) -211 { -212 this->SetWriteError('RecvQ exceeded'); -213 WriteOpers('*** User %s RecvQ of %d exceeds connect class maximum of %d',this->nick,recvq.length(),this->recvqmax); -214 } -215 // return false if we've had more than 600 characters WITHOUT -216 // a carriage return (this is BAD, drop the socket) -217 return (i < 600); -218 } +206 { +207 std::string b = ''; +208 for (unsigned int i = 0; i < a.length(); i++) +209 if ((a[i] != '\r') && (a[i] != '\0') && (a[i] != 7)) +210 b = b + a[i]; +211 std::stringstream stream(recvq); +212 stream << b; +213 recvq = stream.str(); +214 unsigned int i = 0; +215 // count the size of the first line in the buffer. +216 while (i < recvq.length()) +217 { +218 if (recvq[i++] == '\n') +219 break; +220 } +221 if (recvq.length() > (unsigned)this->recvqmax) +222 { +223 this->SetWriteError('RecvQ exceeded'); +224 WriteOpers('*** User %s RecvQ of %d exceeds connect class maximum of %d',this->nick,recvq.length(),this->recvqmax); +225 } +226 // return false if we've had more than 600 characters WITHOUT +227 // a carriage return (this is BAD, drop the socket) +228 return (i < 600); +229 } .fi .PP .SS "void userrec::AddWriteBuf (\fBstd::string\fP data)" @@ -285,24 +286,24 @@ Adds to the user's write buffer. .PP You may add any amount of text up to this users sendq value, if you exceed the sendq value, \fBSetWriteError()\fP will be called to set the users error string to 'SendQ exceeded', and further buffer adds will be dropped. .PP -Definition at line 250 of file users.cpp. +Definition at line 261 of file users.cpp. .PP References sendq, sendqmax, and SetWriteError(). .PP .nf -251 { -252 if (this->GetWriteError() != '') -253 return; -254 if (sendq.length() + data.length() > (unsigned)this->sendqmax) -255 { -256 WriteOpers('*** User %s SendQ of %d exceeds connect class maximum of %d',this->nick,sendq.length() + data.length(),this->sendqmax); -257 this->SetWriteError('SendQ exceeded'); -258 return; -259 } -260 std::stringstream stream; -261 stream << sendq << data; -262 sendq = stream.str(); -263 } +262 { +263 if (this->GetWriteError() != '') +264 return; +265 if (sendq.length() + data.length() > (unsigned)this->sendqmax) +266 { +267 WriteOpers('*** User %s SendQ of %d exceeds connect class maximum of %d',this->nick,sendq.length() + data.length(),this->sendqmax); +268 this->SetWriteError('SendQ exceeded'); +269 return; +270 } +271 std::stringstream stream; +272 stream << sendq << data; +273 sendq = stream.str(); +274 } .fi .PP .SS "bool userrec::BufferIsReady ()" @@ -311,46 +312,46 @@ This method returns true if the buffer contains at least one carriage return cha .PP one complete line may be read) .PP -Definition at line 220 of file users.cpp. +Definition at line 231 of file users.cpp. .PP References recvq. .PP .nf -221 { -222 for (unsigned int i = 0; i < recvq.length(); i++) -223 if (recvq[i] == '\n') -224 return true; -225 return false; -226 } +232 { +233 for (unsigned int i = 0; i < recvq.length(); i++) +234 if (recvq[i] == '\n') +235 return true; +236 return false; +237 } .fi .PP .SS "void userrec::ClearBuffer ()" .PP This function clears the entire buffer by setting it to an empty string. .PP -Definition at line 228 of file users.cpp. +Definition at line 239 of file users.cpp. .PP References recvq. .PP Referenced by Server::PseudoToUser(), and Server::UserToPseudo(). .PP .nf -229 { -230 recvq = ''; -231 } +240 { +241 recvq = ''; +242 } .fi .PP .SS "void userrec::CloseSocket ()" .PP Shuts down and closes the user's socket. .PP -Definition at line 63 of file users.cpp. +Definition at line 72 of file users.cpp. .PP .nf -64 { -65 shutdown(this->fd,2); -66 close(this->fd); -67 } +73 { +74 shutdown(this->fd,2); +75 close(this->fd); +76 } .fi .PP .SS "void userrec::FlushWriteBuf ()" @@ -359,31 +360,31 @@ Flushes as much of the user's buffer to the file descriptor as possible. .PP This function may not always flush the entire buffer, rather instead as much of it as it possibly can. If the send() call fails to send the entire buffer, the buffer position is advanced forwards and the rest of the data sent at the next call to this method. .PP -Definition at line 266 of file users.cpp. +Definition at line 277 of file users.cpp. .PP References connection::bytes_out, connection::cmds_out, sendq, and SetWriteError(). .PP .nf -267 { -268 if (sendq.length()) -269 { -270 char* tb = (char*)this->sendq.c_str(); -271 int n_sent = write(this->fd,tb,this->sendq.length()); -272 if (n_sent == -1) -273 { -274 this->SetWriteError(strerror(errno)); -275 } -276 else -277 { -278 // advance the queue -279 tb += n_sent; -280 this->sendq = tb; -281 // update the user's stats counters -282 this->bytes_out += n_sent; -283 this->cmds_out++; -284 } -285 } -286 } +278 { +279 if (sendq.length()) +280 { +281 char* tb = (char*)this->sendq.c_str(); +282 int n_sent = write(this->fd,tb,this->sendq.length()); +283 if (n_sent == -1) +284 { +285 this->SetWriteError(strerror(errno)); +286 } +287 else +288 { +289 // advance the queue +290 tb += n_sent; +291 this->sendq = tb; +292 // update the user's stats counters +293 this->bytes_out += n_sent; +294 this->cmds_out++; +295 } +296 } +297 } .fi .PP .SS "\fBstd::string\fP userrec::GetBuffer ()" @@ -392,42 +393,42 @@ This method returns the first available string at the tail end of the buffer and .PP This means it is a one way operation in a similar way to strtok(), and multiple calls return multiple lines if they are available. The results of this function if there are no lines to be read are unknown, always use \fBBufferIsReady()\fP to check if it is ok to read the buffer before calling \fBGetBuffer()\fP. .PP -Definition at line 233 of file users.cpp. +Definition at line 244 of file users.cpp. .PP References recvq. .PP .nf -234 { -235 if (recvq == '') -236 return ''; -237 char* line = (char*)recvq.c_str(); -238 std::string ret = ''; -239 while ((*line != '\n') && (strlen(line))) -240 { -241 ret = ret + *line; -242 line++; -243 } -244 if ((*line == '\n') || (*line == '\r')) -245 line++; -246 recvq = line; -247 return ret; -248 } +245 { +246 if (recvq == '') +247 return ''; +248 char* line = (char*)recvq.c_str(); +249 std::string ret = ''; +250 while ((*line != '\n') && (strlen(line))) +251 { +252 ret = ret + *line; +253 line++; +254 } +255 if ((*line == '\n') || (*line == '\r')) +256 line++; +257 recvq = line; +258 return ret; +259 } .fi .PP .SS "char * userrec::GetFullHost ()\fC [virtual]\fP" .PP Returns the full displayed host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. .PP -Definition at line 69 of file users.cpp. +Definition at line 78 of file users.cpp. .PP References dhost, ident, and nick. .PP .nf -70 { -71 static char result[MAXBUF]; -72 snprintf(result,MAXBUF,'%s!%s@%s',nick,ident,dhost); -73 return result; -74 } +79 { +80 static char result[MAXBUF]; +81 snprintf(result,MAXBUF,'%s!%s@%s',nick,ident,dhost); +82 return result; +83 } .fi .PP .SS "char * userrec::GetFullRealHost ()\fC [virtual]\fP" @@ -436,44 +437,44 @@ Returns the full real host of the user This member function returns the hostname .PP If any form of hostname cloaking is in operation, e.g. through a module, then this method will ignore it and return the true hostname. .PP -Definition at line 87 of file users.cpp. +Definition at line 96 of file users.cpp. .PP References connection::host, ident, and nick. .PP .nf -88 { -89 static char fresult[MAXBUF]; -90 snprintf(fresult,MAXBUF,'%s!%s@%s',nick,ident,host); -91 return fresult; -92 } +97 { +98 static char fresult[MAXBUF]; +99 snprintf(fresult,MAXBUF,'%s!%s@%s',nick,ident,host); +100 return fresult; +101 } .fi .PP .SS "\fBInvitedList\fP * userrec::GetInviteList ()" .PP Returns the list of channels this user has been invited to but has not yet joined. .PP -Definition at line 108 of file users.cpp. +Definition at line 117 of file users.cpp. .PP References invites. .PP .nf -109 { -110 return &invites; -111 } +118 { +119 return &invites; +120 } .fi .PP .SS "\fBstd::string\fP userrec::GetWriteError ()" .PP Returns the write error which last occured on this connection or an empty string if none occured. .PP -Definition at line 296 of file users.cpp. +Definition at line 307 of file users.cpp. .PP References WriteError. .PP .nf -297 { -298 return this->WriteError; -299 } +308 { +309 return this->WriteError; +310 } .fi .PP .SS "bool userrec::HasPermission (char * command)" @@ -482,118 +483,120 @@ Returns true or false for if a user can execute a privilaged oper command. .PP This is done by looking up their oper type from \fBuserrec::oper\fP, then referencing this to their oper classes and checking the commands they can execute. .PP -Definition at line 142 of file users.cpp. +Definition at line 151 of file users.cpp. .PP -References config_f, and DEBUG. +References config_f, and is_uline(). .PP .nf -143 { -144 char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF]; -145 char* mycmd; -146 char* savept; -147 char* savept2; -148 -149 // are they even an oper at all? -150 if (strchr(this->modes,'o')) -151 { -152 log(DEBUG,'*** HasPermission: %s is an oper',this->nick); -153 for (int j =0; j < ConfValueEnum('type',&config_f); j++) -154 { -155 ConfValue('type','name',j,TypeName,&config_f); -156 if (!strcmp(TypeName,this->oper)) -157 { -158 log(DEBUG,'*** HasPermission: %s is an oper of type '%s'',this->nick,this->oper); -159 ConfValue('type','classes',j,Classes,&config_f); -160 char* myclass = strtok_r(Classes,' ',&savept); -161 while (myclass) -162 { -163 log(DEBUG,'*** HasPermission: checking classtype '%s'',myclass); -164 for (int k =0; k < ConfValueEnum('class',&config_f); k++) -165 { -166 ConfValue('class','name',k,ClassName,&config_f); -167 if (!strcmp(ClassName,myclass)) -168 { -169 ConfValue('class','commands',k,CommandList,&config_f); -170 log(DEBUG,'*** HasPermission: found class named %s with commands: '%s'',ClassName,CommandList); -171 -172 -173 mycmd = strtok_r(CommandList,' ',&savept2); -174 while (mycmd) -175 { -176 if (!strcasecmp(mycmd,command)) -177 { -178 log(DEBUG,'*** Command %s found, returning true',command); -179 return true; -180 } -181 mycmd = strtok_r(NULL,' ',&savept2); -182 } -183 } -184 } -185 myclass = strtok_r(NULL,' ',&savept); -186 } -187 } -188 } -189 } -190 return false; -191 } +152 { +153 char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF]; +154 char* mycmd; +155 char* savept; +156 char* savept2; +157 +158 // users on u-lined servers can completely bypass +159 // all permissions based checks. +160 // +161 // of course, if this is sent to a remote server and this +162 // server is not ulined there, then that other server +163 // silently drops the command. +164 if (is_uline(this->server)) +165 return true; +166 +167 // are they even an oper at all? +168 if (strchr(this->modes,'o')) +169 { +170 for (int j =0; j < ConfValueEnum('type',&config_f); j++) +171 { +172 ConfValue('type','name',j,TypeName,&config_f); +173 if (!strcmp(TypeName,this->oper)) +174 { +175 ConfValue('type','classes',j,Classes,&config_f); +176 char* myclass = strtok_r(Classes,' ',&savept); +177 while (myclass) +178 { +179 for (int k =0; k < ConfValueEnum('class',&config_f); k++) +180 { +181 ConfValue('class','name',k,ClassName,&config_f); +182 if (!strcmp(ClassName,myclass)) +183 { +184 ConfValue('class','commands',k,CommandList,&config_f); +185 mycmd = strtok_r(CommandList,' ',&savept2); +186 while (mycmd) +187 { +188 if ((!strcasecmp(mycmd,command)) || (*mycmd == '*')) +189 { +190 return true; +191 } +192 mycmd = strtok_r(NULL,' ',&savept2); +193 } +194 } +195 } +196 myclass = strtok_r(NULL,' ',&savept); +197 } +198 } +199 } +200 } +201 return false; +202 } .fi .PP .SS "void userrec::InviteTo (char * channel)\fC [virtual]\fP" .PP Adds a channel to a users invite list (invites them to a channel). .PP -Definition at line 113 of file users.cpp. +Definition at line 122 of file users.cpp. .PP References Invited::channel, and invites. .PP .nf -114 { -115 Invited i; -116 strlcpy(i.channel,channel,CHANMAX); -117 invites.push_back(i); -118 } +123 { +124 Invited i; +125 strlcpy(i.channel,channel,CHANMAX); +126 invites.push_back(i); +127 } .fi .PP .SS "bool userrec::IsInvited (char * channel)\fC [virtual]\fP" .PP Returns true if a user is invited to a channel. .PP -Definition at line 94 of file users.cpp. +Definition at line 103 of file users.cpp. .PP References invites. .PP .nf -95 { -96 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++) -97 { -98 if (i->channel) { -99 if (!strcasecmp(i->channel,channel)) -100 { -101 return true; -102 } -103 } -104 } -105 return false; -106 } +104 { +105 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++) +106 { +107 if (i->channel) { +108 if (!strcasecmp(i->channel,channel)) +109 { +110 return true; +111 } +112 } +113 } +114 return false; +115 } .fi .PP .SS "int userrec::ReadData (void * buffer, size_t size)" .PP Calls read() to read some data for this user using their fd. .PP -Definition at line 76 of file users.cpp. +Definition at line 85 of file users.cpp. .PP References DEBUG. .PP .nf -77 { -78 if (this->fd > -1) -79 { -80 log(DEBUG,'userrec::ReadData on fd %d',this->fd); -81 return read(this->fd, buffer, size); -82 } -83 else return 0; -84 } +86 { +87 if (this->fd > -1) +88 { +89 log(DEBUG,'userrec::ReadData on fd %d',this->fd); +90 return read(this->fd, buffer, size); +91 } +92 else return 0; +93 } .fi .PP .SS "void userrec::RemoveInvite (char * channel)\fC [virtual]\fP" @@ -602,31 +605,31 @@ Removes a channel from a users invite list. .PP This member function is called on successfully joining an invite only channel to which the user has previously been invited, to clear the invitation. .PP -Definition at line 120 of file users.cpp. +Definition at line 129 of file users.cpp. .PP References DEBUG, and invites. .PP .nf -121 { -122 log(DEBUG,'Removing invites'); -123 if (channel) -124 { -125 if (invites.size()) -126 { -127 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++) -128 { -129 if (i->channel) -130 { -131 if (!strcasecmp(i->channel,channel)) -132 { -133 invites.erase(i); -134 return; -135 } -136 } -137 } -138 } -139 } -140 } +130 { +131 log(DEBUG,'Removing invites'); +132 if (channel) +133 { +134 if (invites.size()) +135 { +136 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++) +137 { +138 if (i->channel) +139 { +140 if (!strcasecmp(i->channel,channel)) +141 { +142 invites.erase(i); +143 return; +144 } +145 } +146 } +147 } +148 } +149 } .fi .PP .SS "void userrec::SetWriteError (\fBstd::string\fP error)" @@ -635,19 +638,19 @@ Sets the write error for a connection. .PP This is done because the actual disconnect of a client may occur at an inopportune time such as half way through /LIST output. The WriteErrors of clients are checked at a more ideal time (in the mainloop) and errored clients purged. .PP -Definition at line 288 of file users.cpp. +Definition at line 299 of file users.cpp. .PP References DEBUG, and WriteError. .PP Referenced by AddBuffer(), AddWriteBuf(), and FlushWriteBuf(). .PP .nf -289 { -290 log(DEBUG,'Setting error string for %s to '%s'',this->nick,error.c_str()); -291 // don't try to set the error twice, its already set take the first string. -292 if (this->WriteError == '') -293 this->WriteError = error; -294 } +300 { +301 log(DEBUG,'Setting error string for %s to '%s'',this->nick,error.c_str()); +302 // don't try to set the error twice, its already set take the first string. +303 if (this->WriteError == '') +304 this->WriteError = error; +305 } .fi .PP .SH "Member Data Documentation" @@ -658,12 +661,12 @@ The user's away message. .PP If this string is empty, the user is not marked as away. .PP -Definition at line 155 of file users.h. +Definition at line 158 of file users.h. .PP Referenced by userrec(). .SS "\fBucrec\fP \fBuserrec::chans\fP[MAXCHANS]" .PP -Definition at line 146 of file users.h. +Definition at line 149 of file users.h. .PP Referenced by Server::PseudoToUser(), and userrec(). .SS "char \fBuserrec::dhost\fP[160]" @@ -672,28 +675,28 @@ The host displayed to non-opers (used for cloaking etc). .PP This usually matches the value of \fBuserrec::host\fP. .PP -Definition at line 131 of file users.h. +Definition at line 134 of file users.h. .PP Referenced by GetFullHost(), and userrec(). .SS "bool \fBuserrec::dns_done\fP" .PP True when \fBDNS\fP lookups are completed. .PP -Definition at line 178 of file users.h. +Definition at line 181 of file users.h. .PP Referenced by userrec(). .SS "int \fBuserrec::flood\fP" .PP Number of lines the user can place into the buffer (up to the global NetBufferSize bytes) before they are disconnected for excess flood. .PP -Definition at line 161 of file users.h. +Definition at line 164 of file users.h. .PP Referenced by userrec(). .SS "char \fBuserrec::fullname\fP[MAXGECOS+1]" .PP The users full name. .PP -Definition at line 135 of file users.h. +Definition at line 138 of file users.h. .PP Referenced by userrec(). .SS "char \fBuserrec::ident\fP[IDENTMAX+2]" @@ -702,21 +705,21 @@ The users ident reply. .PP Two characters are added to the user-defined limit to compensate for the tilde etc. .PP -Definition at line 126 of file users.h. +Definition at line 129 of file users.h. .PP Referenced by GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), userrec(), and Server::UserToPseudo(). .SS "\fBInvitedList\fP \fBuserrec::invites\fP\fC [private]\fP" .PP A list of channels the user has a pending invite to. .PP -Definition at line 114 of file users.h. +Definition at line 117 of file users.h. .PP Referenced by GetInviteList(), InviteTo(), IsInvited(), RemoveInvite(), and userrec(). .SS "int \fBuserrec::lines_in\fP" .PP Flood counters. .PP -Definition at line 203 of file users.h. +Definition at line 206 of file users.h. .PP Referenced by userrec(). .SS "char \fBuserrec::modes\fP[54]" @@ -725,7 +728,7 @@ The user's mode string. .PP This may contain any of the following RFC characters: o, w, s, i Your module may define other mode characters as it sees fit. it is limited to length 54, as there can only be a maximum of 52 user modes (26 upper, 26 lower case) a null terminating char, and an optional + character. .PP -Definition at line 144 of file users.h. +Definition at line 147 of file users.h. .PP Referenced by userrec(). .SS "char \fBuserrec::nick\fP[NICKMAX]" @@ -734,7 +737,7 @@ The users nickname. .PP An invalid nickname indicates an unregistered connection prior to the NICK command. .PP -Definition at line 121 of file users.h. +Definition at line 124 of file users.h. .PP Referenced by ConfigReader::DumpErrors(), GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), and userrec(). .SS "char \fBuserrec::oper\fP[NICKMAX]" @@ -743,7 +746,7 @@ The oper type they logged in as, if they are an oper. .PP This is used to check permissions in operclasses, so that we can say 'yay' or 'nay' to any commands they issue. The value of this is the value of a valid 'type name=' tag. .PP -Definition at line 174 of file users.h. +Definition at line 177 of file users.h. .PP Referenced by userrec(). .SS "char \fBuserrec::password\fP[MAXBUF]" @@ -752,31 +755,31 @@ Password specified by the user when they registered. .PP This is stored even if the <connect> block doesnt need a password, so that modules may check it. .PP -Definition at line 188 of file users.h. +Definition at line 191 of file users.h. .SS "unsigned int \fBuserrec::pingmax\fP" .PP Number of seconds between PINGs for this user (set from <connect:allow> tag. .PP -Definition at line 182 of file users.h. +Definition at line 185 of file users.h. .SS "\fBstd::string\fP \fBuserrec::recvq\fP" .PP User's receive queue. .PP Lines from the IRCd awaiting processing are stored here. Upgraded april 2005, old system a bit hairy. .PP -Definition at line 194 of file users.h. +Definition at line 197 of file users.h. .PP Referenced by AddBuffer(), BufferIsReady(), ClearBuffer(), GetBuffer(), and userrec(). .SS "long \fBuserrec::recvqmax\fP" .PP Maximum size this user's recvq can become. .PP -Definition at line 217 of file users.h. +Definition at line 220 of file users.h. .PP Referenced by AddBuffer(). .SS "time_t \fBuserrec::reset_due\fP" .PP -Definition at line 204 of file users.h. +Definition at line 207 of file users.h. .PP Referenced by userrec(). .SS "\fBstd::string\fP \fBuserrec::sendq\fP" @@ -785,36 +788,36 @@ User's send queue. .PP Lines waiting to be sent are stored here until their buffer is flushed. .PP -Definition at line 199 of file users.h. +Definition at line 202 of file users.h. .PP Referenced by AddWriteBuf(), FlushWriteBuf(), and userrec(). .SS "long \fBuserrec::sendqmax\fP" .PP Maximum size this user's sendq can become. .PP -Definition at line 213 of file users.h. +Definition at line 216 of file users.h. .PP Referenced by AddWriteBuf(). .SS "char* \fBuserrec::server\fP" .PP The server the user is connected to. .PP -Definition at line 150 of file users.h. +Definition at line 153 of file users.h. .PP Referenced by userrec(). .SS "long \fBuserrec::threshold\fP" .PP -Definition at line 205 of file users.h. +Definition at line 208 of file users.h. .SS "unsigned int \fBuserrec::timeout\fP" .PP Number of seconds this user is given to send USER/NICK If they do not send their details in this time limit they will be disconnected. .PP -Definition at line 167 of file users.h. +Definition at line 170 of file users.h. .PP Referenced by userrec(). .SS "\fBstd::string\fP \fBuserrec::WriteError\fP" .PP -Definition at line 209 of file users.h. +Definition at line 212 of file users.h. .PP Referenced by GetWriteError(), and SetWriteError(). diff --git a/docs/man/man3/users.cpp.3 b/docs/man/man3/users.cpp.3 index 48f8e97a8..392e603cc 100644 --- a/docs/man/man3/users.cpp.3 +++ b/docs/man/man3/users.cpp.3 @@ -1,4 +1,4 @@ -.TH "users.cpp" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "users.cpp" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -20,6 +20,8 @@ users.cpp \- .br \fC#include 'inspstring.h'\fP .br +\fC#include 'commands.h'\fP +.br \fC#include 'helperfuncs.h'\fP .br diff --git a/docs/man/man3/users.h.3 b/docs/man/man3/users.h.3 index 673e90f71..ec37125ae 100644 --- a/docs/man/man3/users.h.3 +++ b/docs/man/man3/users.h.3 @@ -1,4 +1,4 @@ -.TH "users.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "users.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -75,34 +75,34 @@ users.h \- .PP .SS "#define CC_ALLOW 0" .PP -Definition at line 31 of file users.h. +Definition at line 34 of file users.h. .SS "#define CC_DENY 1" .PP -Definition at line 32 of file users.h. +Definition at line 35 of file users.h. .SS "#define STATUS_HOP 2" .PP -Definition at line 27 of file users.h. +Definition at line 30 of file users.h. .SS "#define STATUS_NORMAL 0" .PP -Definition at line 29 of file users.h. +Definition at line 32 of file users.h. .SS "#define STATUS_OP 4" .PP -Definition at line 26 of file users.h. +Definition at line 29 of file users.h. .SS "#define STATUS_VOICE 1" .PP -Definition at line 28 of file users.h. +Definition at line 31 of file users.h. .SH "Typedef Documentation" .PP .SS "typedef std::vector<\fBConnectClass\fP> \fBClassVector\fP" .PP Holds a complete list of all allow and deny tags from the configuration file (connection classes). .PP -Definition at line 100 of file users.h. +Definition at line 103 of file users.h. .SS "typedef std::vector<\fBInvited\fP> \fBInvitedList\fP" .PP Holds a complete list of all channels to which a user has been invited and has not yet joined. .PP -Definition at line 94 of file users.h. +Definition at line 97 of file users.h. .SH "Author" .PP Generated automatically by Doxygen for InspIRCd from the source code. diff --git a/docs/man/man3/xline.h.3 b/docs/man/man3/xline.h.3 index 9b6a790a3..b2eaee5de 100644 --- a/docs/man/man3/xline.h.3 +++ b/docs/man/man3/xline.h.3 @@ -1,4 +1,4 @@ -.TH "xline.h" 3 "27 Nov 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- +.TH "xline.h" 3 "9 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -132,6 +132,9 @@ xline.h \- .RI "void \fBzline_set_creation_time\fP (char *ip, time_t create_time)" .br .ti -1c +.RI "void \fBeline_set_creation_time\fP (char *host, time_t create_time)" +.br +.ti -1c .RI "bool \fBzline_make_global\fP (const char *ipaddr)" .br .ti -1c @@ -172,6 +175,8 @@ Referenced by Server::DelQLine(). .SS "bool del_zline (const char * ipaddr)" .PP Referenced by Server::DelZLine(). +.SS "void eline_set_creation_time (char * host, time_t create_time)" +.PP .SS "void expire_lines ()" .PP .SS "void gline_set_creation_time (char * host, time_t create_time)" |