<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.darenet.org/skins/common/feed.css?12"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>IRCu readme.crules - Revision history</title>
		<link>http://wiki.darenet.org/index.php?title=IRCu_readme.crules&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.1</generator>
		<lastBuildDate>Sun, 05 Apr 2026 21:14:13 GMT</lastBuildDate>
		<item>
			<title>Secretagent:&amp;#32;IRCu readme.crule moved to IRCu readme.crules</title>
			<link>http://wiki.darenet.org/index.php?title=IRCu_readme.crules&amp;diff=2245&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;a href=&quot;/index.php?title=IRCu_readme.crule&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;IRCu readme.crule (page does not exist)&quot;&gt;IRCu readme.crule&lt;/a&gt; moved to &lt;a href=&quot;/IRCu_readme.crules&quot; title=&quot;IRCu readme.crules&quot;&gt;IRCu readme.crules&lt;/a&gt;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:36, 25 April 2008&lt;/td&gt;
		&lt;/tr&gt;
		&lt;!-- diff generator: internal 2026-04-05 20:52:17 --&gt;

&lt;!-- diff cache key wiki:diff:version:1.11a:oldid:2244:newid:2245 --&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 25 Apr 2008 03:36:08 GMT</pubDate>			<dc:creator>Secretagent</dc:creator>			<comments>http://wiki.darenet.org/Talk:IRCu_readme.crules</comments>		</item>
		<item>
			<title>Secretagent:&amp;#32;New page: &lt;pre&gt;SmartRoute Rule based connects Draft 4 - Aug 19, 1994 by Tony Vencill  Rule based connects allow an admin to specify under what conditions a connect should not be allowed.  If no rule...</title>
			<link>http://wiki.darenet.org/index.php?title=IRCu_readme.crules&amp;diff=2244&amp;oldid=prev</link>
			<description>&lt;p&gt;New page: &amp;lt;pre&amp;gt;SmartRoute Rule based connects Draft 4 - Aug 19, 1994 by Tony Vencill  Rule based connects allow an admin to specify under what conditions a connect should not be allowed.  If no rule...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;SmartRoute&lt;br /&gt;
Rule based connects&lt;br /&gt;
Draft 4 - Aug 19, 1994&lt;br /&gt;
by Tony Vencill&lt;br /&gt;
&lt;br /&gt;
Rule based connects allow an admin to specify under what conditions&lt;br /&gt;
a connect should not be allowed.  If no rules are specified for a&lt;br /&gt;
given C and/or N line it will be allowed under any condition.&lt;br /&gt;
&lt;br /&gt;
A rule may consist of any legal combination of the following functions&lt;br /&gt;
and operators.&lt;br /&gt;
&lt;br /&gt;
Functions&lt;br /&gt;
---------&lt;br /&gt;
connected(targetmask)     - true if a server other than that processing&lt;br /&gt;
                            the rule is connected that matches the&lt;br /&gt;
                            target mask&lt;br /&gt;
directcon(targetmask)     - true if a server other than that processing&lt;br /&gt;
                            the rule is directly connected that matches&lt;br /&gt;
                            the target mask&lt;br /&gt;
via(viamask, targetmask)  - true if a server other than that processing&lt;br /&gt;
                            the rule matches the target mask and is&lt;br /&gt;
                            connected via a directly connected server&lt;br /&gt;
                            that matches the via mask&lt;br /&gt;
directop()                - true if an oper is directly connected&lt;br /&gt;
&lt;br /&gt;
Unary operators&lt;br /&gt;
---------------&lt;br /&gt;
!    eg: !argument        - true if the argument is false&lt;br /&gt;
&lt;br /&gt;
Binary operartors&lt;br /&gt;
-----------------&lt;br /&gt;
&amp;amp;&amp;amp;   eg: arg1&amp;amp;&amp;amp;arg2       - true if arg1 and arg2 are both true&lt;br /&gt;
||   eg: arg1||arg2       - true if arg1, arg2, or both are true&lt;br /&gt;
&lt;br /&gt;
Parenthesis () are allowed for grouping arguments, but if no parenthesis&lt;br /&gt;
are included, &amp;amp;&amp;amp; will take precedence over ||, ! will take precedence&lt;br /&gt;
over both &amp;amp;&amp;amp; and ||, and the function will be evaluated from left to&lt;br /&gt;
right.  White space in a rule is ignored.  Invalid characters in a rule&lt;br /&gt;
will lead to the rule being ignored.&lt;br /&gt;
&lt;br /&gt;
Examples&lt;br /&gt;
--------&lt;br /&gt;
&lt;br /&gt;
A simple example of a connect rule might be:&lt;br /&gt;
&lt;br /&gt;
connected(*eu.under*)&lt;br /&gt;
&lt;br /&gt;
This might be used in a US undernet server for a Europe CN pair to&lt;br /&gt;
insure that a second Europe link is not allowed if one US-EU link&lt;br /&gt;
already exists.  Note that on the undernet, US server names are&lt;br /&gt;
city.state.us.undernet.org and Europe server names are&lt;br /&gt;
city.country.eu.undernet.org.&lt;br /&gt;
&lt;br /&gt;
A more interesting example might be:&lt;br /&gt;
&lt;br /&gt;
connected(*eu.under*) &amp;amp;&amp;amp; &lt;br /&gt;
  ( !direct(*eu.under*) || via(manhat*, *eu.under*) )&lt;br /&gt;
&lt;br /&gt;
Imagine the Boston undernet server uses this rule on its Europe CN&lt;br /&gt;
pairs.  This says that if a Europe server is already connected, a&lt;br /&gt;
Boston-Europe connect will not be allowed.  It also says that if a&lt;br /&gt;
Europe server does already exist and Boston is not directly connected&lt;br /&gt;
to one or more Europe servers or Manhattan is, the Boston-Europe&lt;br /&gt;
connect will not be allowed.  This has the effect of allowing multiple&lt;br /&gt;
US-EU links but attempting to limit these links to one server (ie:&lt;br /&gt;
Boston will not initiate its first Europe link if another server is&lt;br /&gt;
already linking Europe).  This rule will also prefer to let Manhattan&lt;br /&gt;
handle the US-EU link by disallowing Boston-Europe links if a Europe&lt;br /&gt;
server is already linked to Manhattan.&lt;br /&gt;
&lt;br /&gt;
A example of the remaining function, directop(), is:&lt;br /&gt;
&lt;br /&gt;
connected(*eu.under*) || directop()&lt;br /&gt;
&lt;br /&gt;
If this line is used on Boston for the Paderborn CN pair, it will allow&lt;br /&gt;
connects to Paderborn only if another Europe server is not already&lt;br /&gt;
connected and there is not an oper on Boston.  If this rule is&lt;br /&gt;
overrideable (ie: is applied only to autoconnects as described below),&lt;br /&gt;
then it will disallow Boston autoconnects to Paderborn while a Boston&lt;br /&gt;
oper is online, but allow oper-initiated connects to Paderborn under any&lt;br /&gt;
circumstance.  This directop() function could be used to invoke less&lt;br /&gt;
prefered routes only when an oper is not present to handle routing, or&lt;br /&gt;
conversly to allow use of less preferable routes only when an oper is&lt;br /&gt;
present to monitor their performance.&lt;br /&gt;
&lt;br /&gt;
ircd.conf entries&lt;br /&gt;
-----------------&lt;br /&gt;
&lt;br /&gt;
A rule is listed in the ircd.conf file using a D or d line (which can&lt;br /&gt;
be thought of as a &amp;quot;disallow&amp;quot; line).  D lines will apply to all oper&lt;br /&gt;
and server originated connects, while d lines will apply only to&lt;br /&gt;
autoconnects (ie: they are overrideable by opers).  The formats are:&lt;br /&gt;
&lt;br /&gt;
D:targetmask::rule&lt;br /&gt;
d:targetmask::rule&lt;br /&gt;
&lt;br /&gt;
Remember that newlines are not allowed in conf lines.  Two examples&lt;br /&gt;
(from above) are:&lt;br /&gt;
&lt;br /&gt;
D:*eu.under*::connected(*eu.under*)&lt;br /&gt;
d:*eu.under*::connected(*eu.under*) || directop()&lt;br /&gt;
&lt;br /&gt;
Connects originating from other servers will be checked against and&lt;br /&gt;
matching D lines, while matching d lines will be ignored as it will not&lt;br /&gt;
be clear whether or not the connection attempt is oper initiated.&lt;br /&gt;
&lt;br /&gt;
Checking and viewing rules&lt;br /&gt;
--------------------------&lt;br /&gt;
&lt;br /&gt;
The chkconf program that comes with the servers has been modified to&lt;br /&gt;
also check your connect rules.  If running in debug mode, parsing errors&lt;br /&gt;
will show up at debug level 8.  To view rules online, &amp;quot;/stats d&amp;quot; can be&lt;br /&gt;
used to see all rules and &amp;quot;/stats D&amp;quot; can be used to view those rules&lt;br /&gt;
which affect oper initiated connects and accepts.&lt;br /&gt;
&lt;br /&gt;
Processing and storage&lt;br /&gt;
----------------------&lt;br /&gt;
&lt;br /&gt;
The rules are parsed when the conf file is read and transformed into a&lt;br /&gt;
more efficiently computed form, then all applicable rules are&lt;br /&gt;
evaluated each time a connect command is given or an autoconnect is&lt;br /&gt;
due.  If more than one applicable rule is given, only one need&lt;br /&gt;
evaluate to true for the connect to be allowed (ie: the rules are ored&lt;br /&gt;
together).  Note that conditions that exist when the connect is&lt;br /&gt;
initiated might differ from conditions when the link is established.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;/div&gt;</description>
			<pubDate>Fri, 25 Apr 2008 03:35:45 GMT</pubDate>			<dc:creator>Secretagent</dc:creator>			<comments>http://wiki.darenet.org/Talk:IRCu_readme.crules</comments>		</item>
	</channel>
</rss>