ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/vendor/ircservices-5.1.24/docs/tech/9.html
Revision: 3389
Committed: Fri Apr 25 14:12:15 2014 UTC (12 years, 2 months ago) by michael
Content type: text/html
File size: 54265 byte(s)
Log Message:
- Imported ircservices-5.1.24

File Contents

# User Rev Content
1 michael 3389 <?xml version="1.0" encoding="ISO-8859-1"?>
2     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11-strict.dtd">
3     <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4     <head>
5     <meta http-equiv="Content-Style-Type" content="text/css"/>
6     <style type="text/css">@import "style.css";</style>
7     <title>IRC Services Technical Reference Manual - 9. The database conversion tool</title>
8     </head>
9    
10     <body>
11     <h1 class="title" id="top">IRC Services Technical Reference Manual</h1>
12    
13     <h2 class="section-title">9. The database conversion tool</h2>
14    
15     <p class="section-toc">
16     9-1. <a href="#s1">Purpose and usage</a>
17     <br/>9-2. <a href="#s2">Structure</a>
18     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-2-1. <a href="#s2-1">The main program</a>
19     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-2-2. <a href="#s2-2">Format handlers</a>
20     <br/>9-2. <a href="#s2">Supported database formats</a>
21     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-3-1. <a href="#s3-1"><tt>convert-cygnus.c</tt> (Cygnus)</a>
22     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-3-2. <a href="#s3-2"><tt>convert-epona.c</tt> (Epona, Anope)</a>
23     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-3-3. <a href="#s3-3"><tt>convert-hybserv.c</tt> (HybServ)</a>
24     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-3-4. <a href="#s3-4"><tt>convert-magick.c</tt> (Magick, Wrecked)</a>
25     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-3-5. <a href="#s3-5"><tt>convert-ptlink.c</tt> (PTlink)</a>
26     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-3-6. <a href="#s3-6"><tt>convert-sirv.c</tt> (Sirv, Auspice, Bolivia)</a>
27     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-3-7. <a href="#s3-7"><tt>convert-trircd.c</tt> (trircd)</a>
28     <br/>&nbsp;&nbsp;&nbsp;&nbsp;9-3-8. <a href="#s3-8"><tt>convert-ver8.c</tt> (Daylight, IRCS)</a>
29     </p>
30    
31     <p class="backlink"><a href="8.html">Previous section: Other modules</a> |
32     <a href="index.html">Table of Contents</a> |
33     <a href="10.html">Next section: Compilation</a></p>
34    
35     <!------------------------------------------------------------------------>
36     <hr/>
37    
38     <h3 class="subsection-title" id="s1">9-1. Purpose and usage</h3>
39    
40     <p>The database conversion tool <tt>convert-db</tt> is designed to allow
41     users of other Services-like programs to migrate data stored with the other
42     program into Services. This program serves as an adjunct to the main
43     <tt>ircservices</tt> executable, reading in database files produced by
44     foreign programs and writing out an XML file that can then be imported into
45     Services with the <tt>misc/xml-import</tt> module (see
46     <a href="8.html#s4-2">section 8-4-2</a>).</p>
47    
48     <p>More information (from a user's point of view) can be found in
49     <a href="../5.html#3">section 5-3 of the user's manual</a>.</p>
50    
51     <p>As a historical note, this tool was introduced in version 4.1 of
52     Services as <tt>import-db</tt>, and overwrote the existing Services
53     databases with the imported data. This behavior was changed for version
54     5.0, both to dissociate the tool from the particular database format used
55     by Services (which was still limited to the old binary format at the time,
56     though implementation of a new format was planned) and to allow merging of
57     data rather than simple overwriting. The tool's name was also changed to
58     <tt>convert-db</tt> at this time to reflect the fact that it no longer
59     performed the actual importing.</p>
60    
61     <p class="backlink"><a href="#top">Back to top</a></p>
62    
63     <!------------------------------------------------------------------------>
64     <hr/>
65    
66     <h3 class="subsection-title" id="s2">9-2. Structure</h3>
67    
68     <p>The <tt>convert-db</tt> tool can be divided into two main parts: the
69     <i>main program</i>, which calls out to individual formats' probe and load
70     routines, sanity-checks the loaded data, and writes out the XML data; and
71     the <i>format handlers</i>, which process data produced by particular
72     programs.</p>
73    
74     <p>All source code for <tt>convert-db</tt>, with the exception of code
75     borrowed from the main program, is located in the <tt>tools</tt>
76     directory.</p>
77    
78     <p class="backlink"><a href="#top">Back to top</a></p>
79    
80    
81     <h4 class="subsubsection-title" id="s2-1">9-2-1. The main program</h4>
82    
83     <p>The overall database conversion processing is performed in the
84     <tt>convert-db.c</tt> source file. The <tt>main()</tt> routine performs
85     the following functions:</p>
86    
87     <ul>
88    
89     <li class="spaced">Initializes variables and processes command-line
90     parameters.</li>
91    
92     <li class="spaced">Checks that the database file directory given on the
93     command line is accessible, and expands the pathname to an absolute path if
94     the specified path is relative.</li>
95    
96     <li class="spaced">If no database type was given on the command line, calls
97     each format handler's <tt>check()</tt> function, which determines whether
98     the files contained in the specified directory are of that particular
99     format. The first format found is used (if no format is found, the program
100     aborts).</li>
101    
102     <li class="spaced">Calls the selected format's <tt>load()</tt> function to
103     load the databases.</li>
104    
105     <li class="spaced">Performs sanity checks on the loaded data (via the
106     <tt>sanity_checks()</tt> function), to ensure that erroneous data is not
107     output.</li>
108    
109     <li class="spaced">Calls <tt>xml_export()</tt> (from the
110     <tt>misc/xml-export</tt> module, linked into the final program) to write
111     the XML data to standard output.</li>
112    
113     </ul>
114    
115     <p><tt>convert-db.c</tt> also links in <tt>compat.c</tt> and <tt>misc.c</tt>
116     from the core code, making all of their functions available to format
117     handlers, and implements several other utility functions, including simple
118     versions of some core functions:</p>
119    
120     <ul>
121     <li class="spaced"><tt>smalloc()</tt>, <tt>scalloc()</tt>,
122     <tt>srealloc()</tt>, and <tt>sstrdup()</tt> from
123     <tt>memory.c</tt>;</li>
124     <li class="spaced"><tt>init_password()</tt> and <tt>clear_password()</tt>
125     from <tt>encrypt.c</tt>;</li>
126     <li class="spaced"><tt>makenick()</tt> from NickServ and <tt>makechan()</tt>
127     from ChanServ to initialize and add nicknames and channels to the
128     database;</li>
129     <li class="spaced"><tt>open_db_ver()</tt> to open an old-Services-style
130     database file and check its version number;</li>
131     <li class="spaced"><tt>get_nickgroupinfo_by_nick()</tt> to retrieve a
132     <tt>NickGroupInfo</tt> structure directly from a nickname;</li>
133     <li class="spaced"><tt>set_os_priv()</tt> to set the <tt>os_priv</tt>
134     nickname group field for a nickname without having to first
135     retrieve the <tt>NickGroupInfo</tt>; and</li>
136     <li class="spaced"><tt>convert_acclev()</tt>, to convert pre-Services 5.0
137     channel access levels to levels used by the current version.</li>
138     </ul>
139    
140     <p>The nickname, channel, and other databases themselves are implemented as
141     simple linked lists, since efficiency is not seen to be a significant
142     concern for <tt>convert-db</tt>. Also, since the program exits immediately
143     after writing out the converted data, no special effort is made to keep
144     track of or free allocated memory; it is assumed that the operating system
145     or library cleanup code will take care of freeing resources.</p>
146    
147     <p class="backlink"><a href="#top">Back to top</a></p>
148    
149    
150     <h4 class="subsubsection-title" id="s2-2">9-2-2. Format handlers</h4>
151    
152     <p>Format handlers perform the bulk of the conversion work. Each format is
153     defined by a <tt>DBTypeInfo</tt> structure containing an identifying string
154     for the format (used to match against the <tt>+<i>program-name</i></tt>
155     command-line option), a <tt>check()</tt> routine which determines whether
156     a given directory contains databases in the format, and a <tt>load()</tt>
157     routine which loads databases from a given directory. The list of
158     available formats is hard-coded as a list of external structure variable
159     names in <tt>convert-db.h</tt>, which is used in <tt>convert-db.c</tt> to
160     initialize an array of formats. The structures and routine implementations
161     themselves are stored in separate source files (see <a href="#s3">section
162     9-3</a> below).</p>
163    
164     <p>The <tt>check()</tt> routine takes a single parameters, <tt>const char
165     *<i>dir</i></tt>, the path to the directory to be checked. The routine
166     should check to see if a database in a recognized format is contained in
167     that directory; if so, the routine should return a string describing the
168     database format (usually the name, and version if known, of the program
169     that created it), which will then be displayed to the user. If no
170     recognized database is found, the routine should return <tt>NULL</tt>.</p>
171    
172     <p style="margin-bottom: 0">The <tt>load()</tt> routine takes four
173     parameters:</p>
174    
175     <ul style="margin-top: 0">
176     <li><tt>const char *<i>dir</i></tt>: The directory to load data from.</li>
177     <li><tt>int <i>verbose</i></tt>: Whether the <tt>-v</tt> (verbose) flag
178     was passed to <tt>convert-db</tt>.</li>
179     <li><tt>int <i>ac</i>, char **<i>av</i></tt>: Any unrecognized
180     command-line options. <tt>ac</tt> is the number of options, and
181     <tt>av[]</tt> is an array of pointers to the option strings, with
182     <tt>av[0]</tt> pointing to the program name as for
183     <tt>main()</tt>.</li>
184     </ul>
185    
186     <p>The command-line option array is passed in addition to the source
187     directory and verbosity flag to allow individual database loaders to
188     implement their own options. For example, the Cygnus database takes
189     advantage of this to add options for timezone handling.</p>
190    
191     <p>The <tt>load()</tt> routine is assumed to succeed; if an error occurs
192     that prevents the data from being loaded properly, the routine should
193     simply call <tt>exit(1)</tt> to abort the program.</p>
194    
195     <p>Additionally, the file read/write utilities from
196     <tt>modules/database/fileutil.c</tt> (see <a href="6.html#s5-1">section
197     6-5-1</a>) are linked into <tt>convert-db</tt> and can be used by the
198     <tt>check()</tt> and <tt>load()</tt> routines.</p>
199    
200     <p class="backlink"><a href="#top">Back to top</a></p>
201    
202     <!------------------------------------------------------------------------>
203     <hr/>
204    
205     <h3 class="subsection-title" id="s3">9-3. Supported database formats</h3>
206    
207     <p><tt>convert-db</tt> supports loading data from a total of 13 different
208     programs. The data loading code is in the various <tt>convert-*.c</tt>
209     files, one file for each distinct format (several programs use similar
210     database formats and therefore share code). Each of these files is
211     discussed below.</p>
212    
213     <p>In general, each format's <tt>load()</tt> routine is implemented as a
214     function which calls subfunctions for each file to be loaded. Since most
215     of the programs are based on old versions of Services, the contents of the
216     files correspond fairly well with Services itself.</p>
217    
218     <p>Where binary database files include fixed-length buffers, the lengths of
219     those buffers are assumed to be the same as those in the distributed source
220     code, with no changes to any configuration settings. For example, most
221     IRC service programs default to a nickname buffer size of 32 bytes, and
222     <tt>convert-db</tt> assumes that that value has not been changed by the
223     user.</p>
224    
225     <p class="backlink"><a href="#top">Back to top</a></p>
226    
227    
228     <h4 class="subsubsection-title" id="s3-1">9-3-1. <tt>convert-cygnus.c</tt> (Cygnus)</h4>
229    
230     <p>Cygnus is an IRC service program based on an old version of Services;
231     development seems to have stopped as of the writing of this manual. Unlike
232     the other programs supported by <tt>convert-db</tt>, Cygnus stores its
233     databases in plain text files, with each line containing a two-character
234     field identifier and one or more values, all separated by spaces. As such,
235     the data processing is somewhat more complex than for other databse
236     formats, particularly for numeric values, which must be checked for
237     syntactic validity as well as range. The following utility routines and
238     macros are used by the various loading functions:</p>
239    
240     <ul>
241    
242     <li class="spaced"><b><tt>cyg_strtok_remaining()</tt></b> returns the
243     remainder of the string currently being processed by <tt>strtok()</tt> with
244     any leading whitespace removed, like <tt>strtok_remaining()</tt> from
245     <tt>misc.c</tt> in the core code; in addition, any trailing newline (CR or
246     LF) is removed.</li>
247    
248     <li class="spaced"><b><tt>CVT_TIME(<i>var</i>, <i>str</i>, <i>errfmt</i>,
249     ...)</tt></b> attempts to convert the string in <tt><i>str</i></tt> to a
250     <tt>time_t</tt> value. If the conversion succeeds, the value is stored in
251     <tt><i>var</i></tt>, which must be an lvalue; if it fails (because the
252     string does not represent a valid integer&mdash;range checks are not
253     performed), <tt><i>var</i></tt> is set to the current time, and the error
254     message in <tt><i>errfmt</i></tt>, along with any additional parameters,
255     are printed to standard error.</li>
256    
257     <li class="spaced"><b><tt>CVT_TIME_0(<i>var</i>, <i>str</i>, <i>errfmt</i>,
258     ...)</tt></b> does the same thing as <tt>CVT_TIME()</tt>, but defaults to
259     zero rather than the current time when the string is invalid.</li>
260    
261     </ul>
262    
263     <p>Cygnus also supports storing time zone information with each nickname,
264     like NickServ <tt>SET TIMEZONE</tt> in Services; however, rather than
265     storing the actual time offset, Cygnus stores an index into a table whose
266     contents are controlled by a configuration file. The default list of
267     time zone offsets is included in the <tt>default_timezones[]</tt> array,
268     but since users may have modified the time zone configuration, the
269     command-line option <tt>-tzfile=<i>filename</i></tt> is checked for by the
270     <tt>load()</tt> function, allowing the user to specify their configuration
271     file, which is then loaded and used in place of the default list;
272     <tt>-no-timezones</tt> (which causes all time zone data to be discarded) is
273     also supported as a fallback in case time zone importing results in
274     incorrect data.</p>
275    
276     <p>Cygnus does not have a "default" value, like <tt>MEMOMAX_DEFAULT</tt> in
277     Services, for the memo limit field, but instead stores the actual value of
278     the default limit at the time the nickname is registered. As a result,
279     these values will remain constant in Services even if the
280     <tt>MSMaxMemos</tt> configuration setting is changed. To work around this,
281     the <tt>-reset-memo-limits</tt> command-line option is checked for, and if
282     present, all memo limits are reset to <tt>MEMOMAX_DEFAULT</tt>.</p>
283    
284     <p>The data files are as follows:</p>
285    
286     <ul>
287    
288     <li class="spaced"><b><tt>nickserv.db</tt>:</b> Nickname database. The
289     file contains three file-level fields:
290     <dl>
291     <dt class="cygnus">NV <i>version</i></dt>
292     <dd>File version. This field is always the first line in the file.
293     The version number is 3 in Cygnus 0.2.0.</dd>
294     <dt class="cygnus">SS <i>stamp</i></dt>
295     <dd>Previous servicestamp value. Cygnus stores this value in the
296     database, allowing it to ensure (assuming the database is not
297     modified) that servicestamp values are not reused even if the
298     program is restarted. Services does not save this value, so it is
299     ignored.</dd>
300     <dt class="cygnus">DE <i>nick-count</i> <i>link-count</i> <i>memo-count</i></dt>
301     <dd>"Database end". Included as the last line in the file, and
302     contains counts of nicknames, links, and memos stored in the
303     database. These can be used to double-check that all data was
304     loaded correctly.</dd>
305     </dl>
306    
307     <p>All other fields are subfields of a nickname record (a nickname group
308     record, in Services terminology):</p>
309    
310     <dl>
311     <dt class="cygnus">NI <i>nickname</i> <i>password</i>
312     <i>time-registered</i> <i>last-seen</i> <i>last-timestamp</i>
313     <i>last-servicestamp</i> <i>flags</i> <i>memo-limit</i>
314     <i>timezone-index</i> <i>key</i> <i>last-usermask</i>
315     <i>last-realname</i></dt>
316     <dd>Begins a nickname record; all subsequent fields until the next
317     <tt>NI</tt> or the end of the file correspond to this nickname.
318     Most of the fields are self-explanatory, with times recorded as
319     integers using ordinary Unix <tt>time()</tt> values. If the
320     <tt><i>nickname</i></tt> too long to fit in a
321     <tt>NICKMAX</tt>-character buffer, it is truncated with a warning.
322     The <tt><i>last-timestamp</i></tt> field is not saved by Services,
323     and is thus ignored; the <tt><i>last-servicestamp</i></tt> field
324     will not have any relevance to servicestamps assigned by Services,
325     and is likewise discarded. <tt><i>timezone-index</i></tt> is an
326     index into a table of time zone offset values (see the discussion
327     of time zones above). The <tt><i>key</i></tt> is the equivalent of
328     the authentication code used by the <tt>nickserv/mail-auth</tt>
329     module, and is used to set the nickgroup's <tt>authcode</tt> field,
330     so that authentication codes stored with nicknames will continue to
331     be valid; the code is assumed to be for a new registration, unless
332     we find out otherwise later on. If the <tt>NI</tt> line does not
333     match the above format or the nickname already exists, the entire
334     nickname record is discarded.</dd>
335    
336     <dt class="cygnus">AC <i>mask</i></dt>
337     <dd>An access mask for the current nickname.</dd>
338    
339     <dt class="cygnus">LN <i>nickname-1</i> <i>nickname-2</i>...</dt>
340     <dd>The list of subnicks (linked nicks) for the current nickname.
341     These are added to the current nickname group's nick list, with a
342     new <tt>NickInfo</tt> structure created for each subnick. As width
343     <tt>NI</tt> processing, nicknames that do not fit in a
344     <tt>NICKMAX</tt>-character buffer are truncated with a warning, and
345     nicknames that collide with already-existing nicks are discarded.
346     In theory, any number of nicknames can be included in a single
347     <tt>LN</tt> line, but Cygnus (version 0.2.0, at least) uses a
348     2048-byte line buffer when writing the databases; this routine uses
349     a 4096-byte buffer, so there should be no truncation problems.</dd>
350    
351     <dt class="cygnus">MO <i>num</i> <i>flags</i> <i>time</i>
352     <i>sender</i> <i>text</i></dt>
353     <dd>A memo for the current nickname. The <tt><i>text</i></tt>
354     parameter may include spaces.</dd>
355    
356     <dt class="cygnus">FW <i>nickname</i></dt>
357     <dd>The nickname to which memos to this nick should be forwarded.
358     Services does not support forwarding memos to another nickname, so
359     this field is ignored.</dd>
360    
361     <dt class="cygnus">FR <i>reason</i></dt>
362     <dd>Freeze (suspension) reason for the nickname.</dd>
363    
364     <dt class="cygnus">EM <i>address</i></dt>
365     <dd>E-mail address for the nickname.</dd>
366    
367     <dt class="cygnus">TE <i>address</i></dt>
368     <dd>An E-mail address which has been set with <tt>SET EMAIL</tt>
369     but not yet authenticated. If this field is found, then the
370     nickname's authentication reason is set to
371     <tt>NICKAUTH_SET_EMAIL</tt>, and a new authentication code is
372     generated if one does not already exist (perhaps because of a
373     corrupt database file). The E-mail address given in the
374     <tt>EM</tt> field is moved to <tt>NickGroupInfo.last_email</tt>
375     as well.</dd>
376    
377     <dt class="cygnus">UR <i>address</i></dt>
378     <dd>URL for the nickname.</dd>
379    
380     <dt class="cygnus">UN <i>address</i></dt>
381     <dd>User information field for the nickname (instant messenger
382     UIN); ignored.</dd>
383    
384     <dt class="cygnus">NA <i>address</i></dt>
385     <dd>User information field for the nickname (real name);
386     ignored.</dd>
387    
388     <dt class="cygnus">AG <i>address</i></dt>
389     <dd>User information field for the nickname (age); ignored.</dd>
390    
391     <dt class="cygnus">SX <i>address</i></dt>
392     <dd>User information field for the nickname (sex); ignored.</dd>
393    
394     <dt class="cygnus">LO <i>address</i></dt>
395     <dd>User information field for the nickname (location);
396     ignored.</dd>
397     </dl>
398     </li>
399    
400     <li class="spaced"><b><tt>chanserv.db</tt>:</b> Channel database. As with
401     <tt>nickserv.db</tt>, the file begins with a version field (<tt>CV</tt> in
402     this case; the supported version is 3) and ends with a <tt>DE</tt> field
403     containing a channel count. There is also a <tt>VF</tt> field (taking two
404     parameters, a channel name and time value) listing channels which have been
405     registered but not verified, but since Services does not implement such a
406     verification system, these records are ignored. Channel records are stored
407     on multiple lines:
408    
409     <dl>
410     <dt class="cygnus">CI <i>channel</i> <i>founder</i> <i>password</i>
411     <i>time-registered</i> <i>last-used</i> <i>flags</i>
412     <i>mlock-on</i> <i>mlock-off</i> <i>topic-lock</i>
413     <i>memo-level</i> <i>key</i></dt>
414     <dd>Begins a channel record. The channel name is truncated to fit
415     in a <tt>CHANMAX</tt>-character buffer, if necessary. The channel
416     is discarded if the <tt>CI</tt> line is invalid, if another channel
417     with the same name already exists, or if the founder is not a
418     registered nickname. The mode lock parameters
419     <tt><i>mlock-on</i></tt> and <tt><i>mlock-off</i></tt> are mode
420     bitmasks, which are converted to mode strings based on the Cygnus
421     mode flag constants. The <tt><i>topiclock</i></tt> and
422     <tt><i>memolevel</i></tt> parameters are access levels required
423     for setting the topic and receiving channel memos, respectively,
424     using the same system as channel access entries (see below), with
425     zero indicating that the feature is disabled. In Services,
426     topic-lock is an on/off setting, so the <tt>TOPICLOCK</tt> channel
427     flag is set if <tt><i>topiclock</i></tt> is nonzero; the
428     <tt><i>memolevel</i></tt> value is translated directly to the
429     <tt>CA_MEMO</tt> privilege level. Services does not require
430     authentication for channels, so the <tt><i>key</i></tt> parameter
431     is ignored.</dd>
432    
433     <dt class="cygnus">CA <i>nick-or-mask</i> <i>level</i></dt>
434     <dd>Channel access entry. Cygnus, like versions of Services before
435     3.0.0, allows both nicknames and usermasks on channel access lists;
436     any access entry that does not correspond to a registered nickname
437     is therefore discarded. Cygnus uses a simple XOP-based access
438     system, with five levels:
439     <ul>
440     <li>1: VOP</li>
441     <li>2: HOP</li>
442     <li>3: AOP</li>
443     <li>4: SOP</li>
444     <li>5: Founder</li>
445     </ul>
446     These values are translated to the corresponding <tt>ACCLEV_*</tt>
447     constants.</dd>
448    
449     <dt class="cygnus">AK <i>mask</i> <i>setter</i> <i>time</i>
450     <i>reason</i></dt>
451     <dd>Channel autokick entry. The setter nickname is truncated
452     (silently) if necessary.</dd>
453    
454     <dt class="cygnus">SU <i>nickname</i></dt>
455     <dd>Channel successor. Ignored if the nickname is not registered
456     or is in the same nickname group as the founder.</dd>
457    
458     <dt class="cygnus">GR <i>text</i></dt>
459     <dd>Channel greeting (entry message). <tt><i>text</i></tt> may
460     contain spaced.</dd>
461    
462     <dt class="cygnus">UR <i>url</i></dt>
463     <dd>Channel URL.</dd>
464    
465     <dt class="cygnus">CT <i>setter</i> <i>time</i> <i>topic</i></dt>
466     <dd>Channel topic, along with the nickname of the topic setter and
467     the time the topic was set.</dd>
468    
469     <dt class="cygnus">KY <i>key</i></dt>
470     <dd>Channel key locked with <tt>MLOCK</tt>. Ignored if mode
471     <tt>+k</tt> is not locked on.</dd>
472    
473     <dt class="cygnus">LM <i>limit</i></dt>
474     <dd>Channel limit locked with <tt>MLOCK</tt>. Ignored if not a
475     valid limit value, or if mode <tt>+l</tt> is not locked on.</dd>
476    
477     <dt class="cygnus">FL <i>value</i></dt>
478     <dd>Channel flood setting locked with <tt>MLOCK</tt>. Ignored if
479     mode <tt>+f</tt> is not locked on.</dd>
480    
481     <dt class="cygnus">LK <i>link</i></dt>
482     <dd>Channel link locked with <tt>MLOCK</tt>. Ignored if mode
483     <tt>+L</tt> is not locked on.</dd>
484     </dl>
485     </li>
486    
487     <li><b><tt>rootserv.db</tt>:</b> Contains global data, analogous to the
488     OperServ and related databases in Services. Data is stored with one full
489     record per line, as follows:
490    
491     <dl>
492     <dt class="cygnus">AK <i>mask</i> <i>setter</i> <i>is-realname</i>
493     <i>set-at</i> <i>expires</i> <i>reason</i></dt>
494     <dd>An autokill or SGline record; the numeric field
495     <tt><i>is-realname</i></tt> determines the record type (nonzero for
496     an SGline, zero for an autokill). <tt><i>reason</i></tt> may
497     contain spaces.</dd>
498    
499     <dt class="cygnus">TR <i>mask</i> <i>limit</i></dt>
500     <dd>A session exception with a defined user limit (a "trigger" in
501     Cygnus terminology).</dd>
502    
503     <dt class="cygnus">EX <i>mask</i></dt>
504     <dd>A session exception with no user limit.</dd>
505    
506     <dt class="cygnus">NW <i>time</i></dt>
507     <dd>The last time the <tt>RESETNEWS</tt> command was called.
508     Cygnus implements news as a simple text file, shown to users only
509     if the user's last read-news time is earlier than this timestamp.
510     Ignored.</dd>
511    
512     <dt class="cygnus">RS <i>max-uptime</i></dt>
513     <dd>The longest amount of time Cygnus has remained running, in
514     seconds. Services does not store this information, so this field
515     is ignored.</dd>
516     </dl>
517     </li>
518    
519     <li class="spaced"><b><tt>web.db</tt>:</b> Contains a summary of all data,
520     intended for use by external programs. Apparently serves a purpose similar
521     to the XML export functionality in Services. This file is ignored.</li>
522    
523     </ul>
524    
525     <p class="backlink"><a href="#top">Back to top</a></p>
526    
527    
528     <h4 class="subsubsection-title" id="s3-2">9-3-2. <tt>convert-epona.c</tt> (Epona, Anope)</h4>
529    
530     <p>Epona IRC Services is an IRC service program based on Services 4.3.3;
531     development has been intermittent since the release of Epona 1.4 in 2001.
532     Anope Services was forked from Epona 1.4.14, and has been developed more
533     actively. Both use a database format similar to the Services 4.3 format;
534     however, rather than a single format version number for all files,
535     individual version numbers are used for each file. (As noted in the user
536     manual, versions of Anope since 1.7.11 also support storing databases in a
537     MySQL database; access to such databases is not supported by the
538     <tt>convert-db</tt> tool.)</p>
539    
540     <p>Epona and Anope use a "nick core plus nick aliases" concept for
541     registered nicknames, in which most nickname data is stored with a single
542     "core" nick and other nicknames can "aliased" to the same settings (the
543     redesigned nickname linking system in Services 5.0 was based on this
544     concept). Other data is structured similarly to Services, and conversion
545     is fairly straightforward.</p>
546    
547     <p>Anope supports a number of IRC servers; unfortunately, the flag values
548     used in the channel mode lock fields stored in the database vary between
549     IRC servers (though given the vast range of channel modes present in
550     various servers, this is probably unavoidable). In order to interpret the
551     mode flags correctly, the converter allows a "<tt>-ircd=</tt>" option to
552     be passed on the command line. The parameter to this option selects the
553     IRC server type to be used for interpreting channel modes. If no
554     <tt>-ircd</tt> option is given, the converter only converts the eight basic
555     channel modes (<tt>i</tt>, <tt>k</tt>, <tt>l</tt>, <tt>m</tt>, <tt>n</tt>,
556     <tt>p</tt>, <tt>s</tt>, <tt>t</tt>), which share the same flag values
557     across all IRC server types.</p>
558    
559     <p>Since Anope 1.7.18, administrators can select one of several encryption
560     modules, similar to how encryption was handled in Services 5.0. This
561     method shares the same shortcoming present in Services 5.0, however, which
562     is that a particular password's encryption status cannot be determined from
563     the data itself. To work around this problem, the converter accepts a
564     command-line option "<tt>-encryption=</tt>" to select the type of
565     encryption used for passwords in the databases. If this option is given,
566     the "encrypted" flag on nickname cores and channels is ignored, and all
567     passwords are assumed to use the given encryption type; otherwise, the
568     "encrypted" flag selects between MD5 encryption and no encryption. (For
569     forward compatilibity, <tt>sha1</tt> is accepted to indicate SHA-1
570     encryption, but Services will not be able to check such passwords without a
571     third-party module implementing the SHA-1 hash.)</p>
572    
573     <p>The Epona/Anope database files are:</p>
574    
575     <ul>
576    
577     <li class="spaced"><b><tt>nick.db</tt>:</b> Contains nickname data.
578     Nickname cores are stored in a format similar to that in Services 4.x,
579     followed by nickname aliases in a condensed format. Unlike Services, Epona
580     and Anope store nicknames and passwords as strings rather than buffers
581     (with the exception of the memo sender field, which is stored as a buffer
582     of default size 32 bytes); there seems to have been a bug in some versions
583     of Epona that could result in a <tt>NULL</tt> string being saved in the
584     password field, and this is checked for by the load routine. Additional
585     fields stored with nickname cores include:
586     <ul>
587     <li><tt>greet</tt>: A greeting message sent from NickServ to the
588     user upon logon. Ignored.</li>
589     <li><tt>icq</tt>: The user's ICQ number. Ignored.</li>
590     </ul>
591     Nickname aliases include the same fields as are stored in the
592     <tt>NickInfo</tt> structure. Since nickname cores are stored using the
593     "display name" (main nickname) rather than a separate ID value,
594     <tt>convert-db</tt> first looks up the nickname read from the database,
595     and only creates a new <tt>NickInfo</tt> if the nickname does not already
596     exist.
597     </li>
598    
599     <li class="spaced"><b><tt>chan.db</tt>:</b> Contains channel data.
600     Additional fields stored with channels include:
601     <ul>
602     <li><tt>forbidby</tt>: The nickname of the user who forbade the
603     channel. Ignored.</li>
604     <li><tt>forbidreason</tt>: The reason given for the channel
605     forbid. Ignored.</li>
606     <li><tt>bantype</tt>: Selects among different method of creating a
607     ban mask when banning a user from a channel. Ignored.</li>
608     <li>Several BotServ-related fields, all ignored.</li>
609     </ul>
610     The major difficulty in importing Epona/Anope channel data is that the
611     meaning of the bitmask values used in the channel mode lock varies
612     depending on the particular IRC server being used. Since this information
613     is not stored in the databases, <tt>convert-db</tt> defaults to only
614     importing the eight basic channel modes, which have consistent flag values
615     across all IRC server types: <tt>+i</tt>, <tt>+k</tt>, <tt>+l</tt>,
616     <tt>+m</tt>, <tt>+n</tt>, <tt>+p</tt>, <tt>+s</tt>, and <tt>+t</tt>. To
617     import other modes, the user must specify the appropriate
618     <tt>-ircd=<i>type</i></tt> option on the <tt>convert-db</tt> command line;
619     the argument to this option is used to look up an IRC server type (the
620     <tt>IRCD_*</tt> enum defined at the top of the file), which is then used as
621     an index into the <tt>epona_cmode_index[]</tt> array of arrays to process
622     nonstandard mode flag values. Note that there is not a one-to-one
623     correspondence between IRC server type names (taken from the Anope 1.7
624     protocol module names) and <tt>IRCD_*</tt> constants; protocols using the
625     same mode flag values are combined into a single flag list. (In hindsight,
626     this is probably an unnecessary optimization.)
627     </li>
628    
629     <li class="spaced"><b><tt>oper.db</tt>:</b> Contains OperServ-related data,
630     both basic data such as maximum user count and lists of autokills and
631     S-lines. Some versions of Epona and Anope also store information about
632     detected proxy hosts, but this data was removed during the development of
633     Anope 1.7 without changing the file version number.</li>
634    
635     <li class="spaced"><b><tt>exception.db</tt>:</b> Contains session exception
636     data.</li>
637    
638     <li class="spaced"><b><tt>news.db</tt>:</b> Contains news item data.</li>
639    
640     <li class="spaced"><b><tt>autoop.db</tt>:</b> Contains nickname auto-op
641     settings. Ignored.</li>
642    
643     <li class="spaced"><b><tt>bot.db</tt>:</b> Contains data for the
644     Epona/Anope BotServ pseudoclient. Ignored.</li>
645    
646     <li class="spaced"><b><tt>hosts.db</tt>:</b> Contains data for the
647     Anope 1.5+ HostServ pseudoclient. Ignored.</li>
648    
649     <li class="spaced"><b><tt>hs_request.db</tt>:</b> Contains data for the
650     Anope 1.5+ HostServ pseudoclient. Ignored.</li>
651    
652     <li class="spaced"><b><tt>os_info.db</tt>:</b> Contains IRC operator
653     information strings for nicknames and channels (Anope 1.7.9+ only).
654     Ignored.</li>
655    
656     <li class="spaced"><b><tt>prenick.db</tt>:</b> Contains data on requested
657     but not yet confirmed nicknames in Anope's two-step registration process
658     (Anope 1.5+ only). Since Anope uses an alphanumeric code that cannot be
659     stored in the <tt>NickGroupInfo.authcode</tt> numeric field, this data is
660     currently ignored.</li>
661    
662     </ul>
663    
664     <p class="backlink"><a href="#top">Back to top</a></p>
665    
666    
667     <h4 class="subsubsection-title" id="s3-3">9-3-3. <tt>convert-hybserv.c</tt> (HybServ)</h4>
668    
669     <p>HybServ is an IRC service program designed from scratch for networks
670     using the IRCD-Hybrid IRC server. After version 1.6, development changed
671     hands and the program was renamed HybServ2, but as they share a common
672     codebase, "HybServ" is used to refer to both in this documentation.
673     Several modified versions of HybServ have also been seen.</p>
674    
675     <p>Like Cygnus, HybServ writes its databases to text files. The format is
676     similar to IRC commands, with a record or field identifier followed by an
677     arbitrary number of space-separated parameters, and with a leading colon
678     indicating a parameter that continues to the end of the line (including
679     spaces). The first line of each file begins with "<tt>; Hybserv</tt>",
680     which is used by the <tt>check()</tt> routine to check for the existence of
681     HybServ databases.</p>
682    
683     <p>HybServ allows passwords to be encrypted, using the Unix
684     <tt>crypt()</tt> function; however, encryption status is not stored in the
685     databases themselves, so the command-line option <tt>-crypt</tt> must be
686     given to <tt>convert-db</tt> to make it treat passwords as encrypted.</p>
687    
688     <ul>
689    
690     <li class="spaced"><b><tt>nick.db</tt>:</b> Contains nickname data.
691     Each nickname record begins with a line that has the nickname itself as the
692     first token on the line; subsequent fields for that record begin with the
693     two characters "<tt>-&gt;</tt>" followed by a field name. The fields are:
694     <dl>
695     <dt><tt><i>nickname</i> <i>flags</i> <i>time-registered</i>
696     <i>last-seen</i></tt></dt>
697     <dd>Begins a new nickname record.</dd>
698     <dt><tt>-&gt;PASS <i>password</i></tt></dt>
699     <dd>The nickname's password.</dd>
700     <dt><tt>-&gt;PERMPASS <i>password</i></tt></dt>
701     <dd>A "permanent password" for the nickname (only present in some
702     modified versions of HybServ); ignored.</dd>
703     <dt><tt>-&gt;FORBIDBY <i>nickname</i></tt></dt>
704     <dd>The nickname of the user who forbade this nick; ignored.</dd>
705     <dt><tt>-&gt;FORBIDREASON <i>reason</i></tt></dt>
706     <dd>The reason for the nickname forbid; ignored. (This field is
707     called <tt>FREASON</tt> in some modified versions of HybServ.)</dd>
708     <dt><tt>-&gt;FTIME <i>time</i></tt></dt>
709     <dd>The time at which the nickname was forbidden (only present in
710     some modified versions of HybServ); ignored.</dd>
711     <dt><tt>-&gt;EMAIL <i>address</i></tt></dt>
712     <dd>E-mail address for the nickname.</dd>
713     <dt><tt>-&gt;URL <i>url</i></tt></dt>
714     <dd>URL for the nickname.</dd>
715     <dt><tt>-&gt;GSM <i>string</i></tt>
716     <br/><tt>-&gt;PHONE <i>string</i></tt>
717     <br/><tt>-&gt;UIN <i>string</i></tt>
718     <br/><tt>-&gt;ICQ <i>string</i></tt></dt>
719     <dd>Various user information fields for the nickname; ignored.
720     (<tt>ICQ</tt> is only present in some modified versions of
721     HybServ.)</dd>
722     <dt><tt>-&gt;LANG <i>language</i></tt></dt>
723     <dd>Believed to identify the language selected by the user (only
724     present in some modified versions of HybServ); ignored due to a
725     lack of data to correlate values with languages.</dd>
726     <dt><tt>-&gt;LASTUH <i>user</i> <i>host</i></tt></dt>
727     <dd>The last-seen usermask for the nickname, with user and hostname
728     as separate tokens.</dd>
729     <dt><tt>-&gt;LASTQMSG <i>message</i></tt></dt>
730     <dd>The last quit message used by the nickname.</dd>
731     <dt><tt>-&gt;HOST <i>usermask</i></tt></dt>
732     <dd>A hostmask (access) entry for the nickname.</dd>
733     <dt><tt>-&gt;LINK <i>master-nick</i></tt></dt>
734     <dd>Indicates that this nickname is linked to another, and gives
735     the parent (master) nickname. Master nicknames are always written
736     before the nicknames that link to them.</dd>
737     </dl>
738     </li>
739    
740     <li class="spaced"><b><tt>chan.db</tt>:</b> Contains channel data.
741     <dl>
742     <dt><tt><i>channel</i> <i>flags</i> <i>time-registered</i>
743     <i>last-used</i></tt></dt>
744     <dd>Begins a new channel record.</dd>
745     <dt><tt>-&gt;FNDR <i>nickname</i></tt></dt>
746     <dd>The channel founder's nickname.</dd>
747     <dt><tt>-&gt;SUCCESSOR <i>nickname</i></tt></dt>
748     <dd>The channel successor's nickname.</dd>
749     <dt><tt>-&gt;PASS <i>password</i></tt></dt>
750     <dd>The channel's founder password.</dd>
751     <dt><tt>-&gt;PERMPASS <i>password</i></tt></dt>
752     <dd>A "permanent password" for the channel (only present in some
753     modified versions of HybServ); ignored.</dd>
754     <dt><tt>-&gt;ACCESS <i>nickname</i> <i>level</i></tt></dt>
755     <dd>An access entry for the channel. Levels are adjusted so that
756     users have close to the same privileges as they did in HybServ
757     (assuming default HybServ privilege settings), but as there is not
758     a one-to-one match between levels and privileges, some users will
759     end up with more or less privileges than they had previously (see
760     under HybServ in <a href="../5.html#3">section 5-3</a> of the
761     user's manual).</dd>
762     <dt><tt>-&gt;AKICK <i>mask</i> <i>reason</i></tt></dt>
763     <dd>An autokick entry for the channel.</dd>
764     <dt><tt>-&gt;ALVL <i>level...</i></tt></dt>
765     <dd>Privilege access levels for the channel (all on one line);
766     ignored.</dd>
767     <dt><tt>-&gt;TOPIC <i>topic</i></tt></dt>
768     <dd>Saved topic for the channel. Since the topic setter and time
769     are not saved, they are set to "<tt>&lt;unknown&gt;</tt>" and the
770     current time, respectively, in the XML output.</dd>
771     <dt><tt>-&gt;MON <i>mode-mask</i></tt></dt>
772     <dd>Modes locked on for the channel, as a combination of numeric
773     flags.</dd>
774     <dt><tt>-&gt;MOFF <i>mode-mask</i></tt></dt>
775     <dd>Modes locked off for the channel, as a combination of numeric
776     flags.</dd>
777     <dt><tt>-&gt;KEY <i>key</i></tt></dt>
778     <dd>Locked key for the channel.</dd>
779     <dt><tt>-&gt;LIMIT <i>limit</i></tt></dt>
780     <dd>Locked limit for the channel.</dd>
781     <dt><tt>-&gt;FORWARD <i>string</i></tt></dt>
782     <dd>Presumed to be a forwarding channel for when the channel
783     reaches its user limit (<tt>+l</tt>), and stored as the channel
784     link parameter accordingly, but as the IRC server with which this
785     is used (Dancer IRCd) appears to be defunct, I am not certain of
786     this interpretation.</dd>
787     <dt><tt>-&gt;ENTRYMSG <i>message</i></tt></dt>
788     <dd>Entry message for the channel.</dd>
789     <dt><tt>-&gt;EMAIL <i>address</i></tt></dt>
790     <dd>E-mail address for the channel.</dd>
791     <dt><tt>-&gt;URL <i>url</i></tt></dt>
792     <dd>URL for the channel.</dd>
793     </dl>
794     </li>
795    
796     <li class="spaced"><b><tt>memo.db</tt>:</b> Contains memo data. The data
797     is organized by nickname, with each memo on a single line:
798     <dl>
799     <dt><tt><i>nickname</i></tt></dt>
800     <dd>Begins a group of memos, and identifies the nickname to which
801     the memos belong.</dd>
802     <dt><tt>-&gt;TEXT <i>sender</i> <i>time</i> <i>flags</i>
803     <i>text</i></tt></dt>
804     <dd>Data for a single memo.</dd>
805     </dl>
806     </li>
807    
808     <li class="spaced"><b><tt>stat.db</tt>:</b> Contains the following
809     network-wide statistics:
810     <dl>
811     <dt><tt>-&gt;USERS <i>maxusers</i> <i>maxusers-time</i></tt></dt>
812     <dd>The maximum number of users seen on the network, and the time
813     at which the maximum was reached. Used to set the corresponding
814     OperServ data.</dd>
815     <dt><tt>-&gt;OPERS <i>maxopers</i> <i>maxopers-time</i></tt></dt>
816     <dd>The maximum number of IRC oprators seen on the network, and the
817     time at which the maximum was reached. Ignored.</dd>
818     <dt><tt>-&gt;OPERS <i>maxopers</i> <i>maxopers-time</i></tt></dt>
819     <dd>The maximum number of IRC oprators seen on the network, and the
820     time at which the maximum was reached. Ignored.</dd>
821     <dt><tt>-&gt;OPERS <i>maxopers</i> <i>maxopers-time</i></tt></dt>
822     <dd>The maximum number of IRC oprators seen on the network, and the
823     time at which the maximum was reached. Ignored.</dd>
824     </dl>
825     </li>
826    
827     <li class="spaced"><b><tt>oper.db</tt>:</b> Seems to contain a list of
828     current user modes set on online users. Ignored.</li>
829    
830     <li class="spaced"><b><tt>ignore.db</tt>:</b> Contains OperServ ignore
831     data. Services does not store this data to disk, so this file is ignored.</li>
832    
833     <li class="spaced"><b><tt>seen.db</tt>:</b> Data for SeenServ; ignored.</li>
834    
835     </ul>
836    
837     <p class="backlink"><a href="#top">Back to top</a></p>
838    
839    
840     <h4 class="subsubsection-title" id="s3-4">9-3-4. <tt>convert-magick.c</tt> (Magick, Wrecked)</h4>
841    
842     <p>Magick IRC Services is an IRC service program based on a very old
843     version of Services, and WreckedNet IRC Services is a modified version of
844     Magick; both seem to be defunct as of the writing of this manual.</p>
845    
846     <p>The databases used by these programs are similar to the format used by
847     Services before machine-independence was introduced in version 4.0: rather
848     than writing each variable in a consistent way, they simply dump the
849     structures to disk as is. As such, <tt>convert-db</tt> assumes that the
850     databases are being loaded on the same machine that produced them;
851     attempting to read the databases on a different architecture (and in some
852     cases, on the same architecture using a different compiler) will likely
853     fail.</p>
854    
855     <p>Magick and Wrecked support nickname and channel suspensions via flags,
856     but do not record any other suspension information, so default values are
857     filled in. These programs also support a hierarchical system of nickname
858     links, and these are resolved into nickname groups after all nicknames are
859     read in.</p>
860    
861     <p>The data files used by Magick and Wrecked are as follows:</p>
862    
863     <ul>
864     <li class="spaced"><b><tt>nick.db</tt></b>: Contains nickname data.</li>
865     <li class="spaced"><b><tt>chan.db</tt></b>: Contains channel data.</li>
866     <li class="spaced"><b><tt>memo.db</tt></b>: Contains memo data.</li>
867     <li class="spaced"><b><tt>news.db</tt></b>: Contains channel news data;
868     ignored.</li>
869     <li class="spaced"><b><tt>sop.db</tt></b>: Contains the Services
870     operator list (Services operators in Magick and Wrecked are
871     equivalent to Services administrators in Services, and are imported
872     as such).</li>
873     <li class="spaced"><b><tt>akill.db</tt></b>: Contains autokill data.</li>
874     <li class="spaced"><b><tt>clone.db</tt></b>: Contains session exception
875     data.</li>
876     <li class="spaced"><b><tt>message.db</tt></b>: Contains network message
877     data (imported as news items).</li>
878     </ul>
879    
880     <p class="backlink"><a href="#top">Back to top</a></p>
881    
882    
883     <h4 class="subsubsection-title" id="s3-5">9-3-5. <tt>convert-ptlink.c</tt> (PTlink)</h4>
884    
885     <p>PTlink Services is an IRC service program designed specifically for the
886     PTlink IRC server. It appears to be based on a fairly old version of
887     Services, and uses a similar data file format. (Another, apparently
888     separately developed, program called PTlink IRC Services has recently
889     appeared; it uses MySQL for database storage, and is not supported by
890     <tt>convert-db</tt>.)</p>
891    
892     <p>PTlink stores the encryption method used for passwords with the
893     corresponding nickname or channel, a significant improvement over Services'
894     method (at the time) of using a single method for the entire database.
895     <tt>convert-db</tt> reads the encryption method and includes it in the XML
896     output; however, the "JP2" method used in PTlink is not available in
897     Services, and any passwords encrypted with this method, or with an unknown
898     method, are reset to the corresponding nick or channel name with no
899     encryption (a warning is printed in this case).</p>
900    
901     <p>PTlink also stores record counts in the nickname and channel databases,
902     similar to Cygnus, for the purpose of ensuring that the data is loaded
903     correctly; however, there have apparently been bugs in some versions of
904     PTlink that caused valid databases to have a mismatch between this value
905     and the number of records actually recorded. <tt>convert-db</tt> still
906     checks the value, but the warning message on mismatch includes a note about
907     this issue.</p>
908    
909     <p>The following data files are used by PTlink (some only by more recent
910     versions):</p>
911    
912     <ul>
913    
914     <li class="spaced"><b><tt>nick.db</tt></b>: Contains nickname and memo
915     data. Suspension status is stored as a flag, without setter, time, or
916     expiration. PTlink stores the following additional data, currently
917     ignored:
918     <ul>
919     <li><tt>icq_number</tt>: ICQ user number, as a string.</li>
920     <li><tt>location</tt>: User's location. </li>
921     <li><tt>last_identify</tt>: Last time the nickname was identified
922     for. PTlink updates the "last seen" time regardless of
923     authentication status, and uses this field instead to record use
924     by an authenticated user. To maintain user-interface
925     compatibility, we keep the old last-seen time, even though we treat
926     it differently, rather than use this time.</li>
927     <li><tt>last_email_request</tt>: Last time the <tt>SET EMAIL</tt>
928     command was used. Services only records this in memory, not on
929     disk.</li>
930     <li><tt>birth_date</tt>: Presumably intended to allow the user to
931     record their birth date (stored as a numeric time value), but this
932     field appears to be unused in recent versions of PTlink.</li>
933     <li><tt>news_mask</tt>: NewsServ-related options.</li>
934     <li><tt>news_status</tt>: Presumably NewsServ-related, but appears
935     to be unused in recent versions of PTlink.</li>
936     <li><tt>notes</tt>: These seem to be a sort of memo-to-self
937     feature; they could potentially be imported as memos.</li>
938     </ul>
939     As of data file version 10, PTlink did away with the legacy zero byte
940     used to terminate a record chain for a single hash table entry, simply
941     storing a sequence of records.
942     </li>
943    
944     <li class="spaced"><b><tt>chan.db</tt></b>: Contains channel data. This
945     file does not have a version 10, and the hash chain terminator bytes are
946     always present; the hash table size was increased from 256 to 65536 in
947     data file version 9. PTlink stores the following additional data,
948     currently ignored:
949     <ul>
950     <li><tt>maxusers</tt>: Maximum number of users seen on the
951     channel.</li>
952     <li><tt>maxtime</tt>: Time when the maximum number of users on the
953     channel was reached.</li>
954     <li><tt>drop_time</tt>: Time when the channel was dropped with a
955     DROP command. Only present if the 0x1000 (<tt>CI_DROPPED</tt>)
956     flag is set. Used by the PTlink "delayed drop" system.</li>
957     <li><tt>memos</tt>: PTlink supports channel memos (like old
958     versions of Services), which are discarded.</li>
959     </ul>
960     </li>
961    
962     <li class="spaced"><b><tt>oper.db</tt></b>: Contains the list of Services
963     administrators and operators, and the network-wide maximum user count and
964     time of maximum.</li>
965    
966     <li class="spaced"><b><tt>akill.db</tt></b>: Contains autokill data.</li>
967    
968     <li class="spaced"><b><tt>sqline.db</tt></b>: Contains SQline data.</li>
969    
970     <li class="spaced"><b><tt>sxline.db</tt></b>: Contains SXline data (what
971     Services calls SGlines).</li>
972    
973     <li class="spaced"><b><tt>news.db</tt></b>: Contains news data.</li>
974    
975     <li class="spaced"><b><tt>newsserv.db</tt></b>: Contains NewsServ data;
976     ignored.</li>
977    
978     <li class="spaced"><b><tt>bots.db</tt></b>: Contains bot data; ignored.</li>
979    
980     <li class="spaced"><b><tt>vline.db</tt></b>: Contains SVline data (S-lines
981     for blocking certain DCC filenames); ignored.</li>
982    
983     <li class="spaced"><b><tt>vlink.db</tt></b>: Contains VLINK data (a feature
984     in recent versions of the PTlink IRC server); ignored.</li>
985    
986     </ul>
987    
988     <p class="backlink"><a href="#top">Back to top</a></p>
989    
990    
991     <h4 class="subsubsection-title" id="s3-6">9-3-6. <tt>convert-sirv.c</tt> (Sirv, Auspice, Bolivia)</h4>
992    
993     <p>SirvNET Services is an IRC service program designed for use on SirvNET.
994     Earlier versions were based on an old version of Services; version 3.0.0
995     was a complete rewrite, and development is actively continuing. Since
996     version 3.0.0, Sirv requires a MySQL database to operate, and apparently
997     has no way to export its data to ordinary files; thus, Sirv databases are
998     only supported through version 2.9.0.</p>
999    
1000     <p>Auspice is an IRC service program that appears to have been based on an
1001     old version of Sirv, and was designed for UnrealIRCd networks. Development
1002     status is unclear.</p>
1003    
1004     <p>Bolivia IRC Services is an IRC service program that also appears to have
1005     been based on Sirv, and developed for a particular network. The program
1006     appears to be defunct as of the writing of this manual.</p>
1007    
1008     <p>All three of these programs share the same overall file format, so they
1009     have been grouped in the same file despite fairly significant differences
1010     in the details to avoid code repetition. The base format seems to be that
1011     from Services 3.x, before machine-independence was introduced.</p>
1012    
1013     <p>The database files are as follows:</p>
1014    
1015     <ul>
1016    
1017     <li class="spaced"><b><tt>nick.db</tt>:</b> Nickname data. All three
1018     programs share a common base nickname data structure (the <tt>oldni</tt>
1019     variable), and each has its own additions to the structure. (As a side
1020     note, Bolivia's extra data structure, consisting entirely of padding, is
1021     not written to disk due to a missing comment terminator in the structure
1022     definition.) The common load routine then loads string data for the
1023     appropriate database type and initializes NickInfo and NickGroupInfo
1024     structures for the loaded data. Bolivia has a flag for nickname
1025     suspensions, and if it is set, dummy suspension data is created for the
1026     nickname group. Auspice has a nick linking system, similar to the
1027     hierarchical system introduced in Services 4.0, indicated by a nickname
1028     flag; if the flag is set, the <tt>last_usermask</tt> field contains the
1029     parent nickname. These links are resolved into nickname groups after all
1030     nicknames have been loaded.</li>
1031    
1032     <li class="spaced"><b><tt>chan.db</tt>:</b> Channel data. As with the
1033     nickname database, all three programs share a common base structure&mdash;with
1034     the exception of mode lock data, which is stored as <tt>short</tt> numeric
1035     values in Sirv and Bolivia but 64-byte string buffers in Auspice. The
1036     routine first reads the initial part of the common structure
1037     (<tt>oldci</tt>), then reads either two shorts or two 64-byte buffers for
1038     the mode lock data, then reads the latter part of the common structure
1039     (<tt>oldci2</tt>). This can theoretically cause alignment problems due to
1040     the mode lock variables not being part of the structure, but no such
1041     problems have yet been reported. The Sirv and Bolivia formats are similar,
1042     but Auspice also includes:
1043     <ul>
1044     <li>Channel successors.</li>
1045     <li>A record of who added a channel access entry (also present in
1046     recent versions of Sirv).</li>
1047     <li><tt>TIMEOP</tt> entries on the access list: users who only get
1048     channel operator privileges at certain times. These are
1049     discarded.</li>
1050     <li>Channel news data.</li>
1051     <li>Channel "bad word" data.</li>
1052     </ul>
1053     </li>
1054    
1055     <li class="spaced"><b><tt>memo.db</tt>:</b> Memo data. All three programs
1056     use the same format here, with the exception that Auspice has a flag for
1057     marking memos to be saved; this flag is used (inverted) to set the "may
1058     expire" flag in imported memos.</li>
1059    
1060     <li class="spaced"><b><tt>os_sop.db</tt> (Sirv only):</b> Services operator
1061     list. Consists of a count followed by a list of strings.</li>
1062    
1063     <li class="spaced"><b><tt>os_sa.db</tt> (Sirv only):</b> Services
1064     administrator list. Consists of a count followed by a list of strings.</li>
1065    
1066     <li class="spaced"><b><tt>admin.db</tt> (Auspice only):</b> Services
1067     administrator/operator list. Stored like the nickname and channel
1068     databases, with a series of entries each preceded by a nonzero byte,
1069     followed by a zero byte, for each hash table entry. Auspice keeps a fair
1070     amount of information for each record in this table, but since Services
1071     does not record such information, only the status flag is used to set the
1072     nickname's OperServ privilege level (<tt>ngi->os_priv</tt>).</li>
1073    
1074     <li class="spaced"><b><tt>akill.db</tt>:</b> Autokill list. All three
1075     programs share the same straightforward format.</li>
1076    
1077     <li class="spaced"><b><tt>trigger.db</tt>:</b> Trigger (session exception)
1078     list. All three programs share the same straightforward format.</li>
1079    
1080     <li class="spaced"><b><tt>gline.db</tt>, <tt>qline.db</tt>,
1081     <tt>zline.db</tt> (Bolivia only):</b> S-line data. These files use simple
1082     arrays of strings preceded by a count.</li>
1083    
1084     </ul>
1085    
1086     <p class="backlink"><a href="#top">Back to top</a></p>
1087    
1088    
1089     <h4 class="subsubsection-title" id="s3-7">9-3-7. <tt>convert-trircd.c</tt> (trircd)</h4>
1090    
1091     <p>trircd IRC Services is a fork of Services 4.5.36 developed for the
1092     tr-ircd IRC server, and has been discontinued since support for tr-ircd was
1093     added to Services. The data files are essentially the same as those in
1094     Services 4.5.36, with the addition of the following data files:</p>
1095    
1096     <ul>
1097    
1098     <li class="spaced"><b><tt>ajoin.db</tt>:</b> Nickname-related extension
1099     data for each registered nickname, including:
1100     <ul>
1101     <li>Autojoin list.</li>
1102     <li>Forbidder nickname and reason for forbidden nicknames.</li>
1103     <li>E-mail address authentication status.</li>
1104     <li>Memo ignore list.</li>
1105     <li>Nickname information string.</li>
1106     <li>Memo expiration data (ignored).</li>
1107     </ul>
1108     </li>
1109    
1110     <li class="spaced"><b><tt>cforbid.db</tt>:</b> Channel-related extension
1111     data for each registered channel, including:
1112     <ul>
1113     <li>Forbidder nickname and reason for forbidden channels.</li>
1114     <li>Time added, last used time, and expiration time for autokick
1115     entries (expiration times are not supported for autokicks and are
1116     ignored).</li>
1117     <li>Last used time for access entries (ignored).</li>
1118     </ul>
1119     </li>
1120    
1121     <li class="spaced"><b><tt>exclude.db</tt>:</b> Autokill exclusion data,
1122     stored in the same format as autokill data.</li>
1123    
1124     <li class="spaced"><b><tt>sgline.db</tt>, <tt>sqline.db</tt>,
1125     <tt>szline.db</tt>:</b> S-line data, stored in the same format as autokill
1126     data.</li>
1127    
1128     </ul>
1129    
1130     <p class="backlink"><a href="#top">Back to top</a></p>
1131    
1132    
1133     <h4 class="subsubsection-title" id="s3-8">9-3-8. <tt>convert-ver8.c</tt> (Daylight, IRCS)</h4>
1134    
1135     <p>Daylight is a fork of Services 4.3.3 developed for the UnrealIRCd IRC
1136     server, and has been discontinued since support for Unreal was added to
1137     Services. IRCS is a fork of Services 4.0.5 developed for Undernet (ircu)
1138     IRC servers, and appears to be defunct as of the writing of this manual.
1139     Both use a data format essentially unchanged from that in the original
1140     Services versions; the data file format at that time was version 8, hence
1141     the source file name "<tt>convert-ver8.c</tt>".</p>
1142    
1143     <p>The Daylight database format is almost completely unchanged from the
1144     original version 8, with the exception of an extra channel flag
1145     <tt>CI_XMANAGEMENT</tt> which is ignored.</p>
1146    
1147     <p>The IRCS database format uses a channel name buffer size of 204 bytes
1148     and a password size of 16 bytes. Services defaults to a maximum channel
1149     name buffer size of 64 bytes, and will truncate (with a warning) any
1150     channel name that is too long to fit in the buffer. IRCS also uses five
1151     OperServ privilege levels instead of two, and users on the extra lists
1152     ("senior", "junior", and "helper") are moved onto either the admin or the
1153     oper list depending on appropriate privileges.</p>
1154    
1155     <p>IRCS adds one data file to the base Services set: <tt>gline.db</tt>,
1156     containing "G-line" (autokill) data.</p>
1157    
1158     <p class="backlink"><a href="#top">Back to top</a></p>
1159    
1160     <!------------------------------------------------------------------------>
1161     <hr/>
1162    
1163     <p class="backlink"><a href="8.html">Previous section: Other modules</a> |
1164     <a href="index.html">Table of Contents</a> |
1165     <a href="10.html">Next section: Compilation</a></p>
1166    
1167     </body>
1168     </html>