1Information for Netatalk Developers
2===================================
3
4For basic installation instructions, see the INSTALL file.
5
6Netatalk is an implementation of "AFP over TCP".
7Netatalk also support the AppleTalk Protocol Suite for legacy Macs.
8The current release contains support for EtherTalk Phase I and II, 
9DDP, RTMP, NBP, ZIP, AEP, ATP, PAP, ASP, AFP and DSI.
10The complete stack looks like this on a BSD-derived system:
11
12    AFP                          AFP
13     |                            |
14    ASP    PAP                   DSI
15      \   /                       |
16       ATP RTMP NBP ZIP AEP       |
17        |    |   |   |   |        |
18   -+---------------------------------------------------+- (kernel boundary)
19    |                    Socket                         |
20    +-----------------------+------------+--------------+
21    |                       |     TCP    |    UDP       |
22    |          DDP          +------------+--------------+
23    |                       |           IP              |
24    +-----------------------+---------------------------+
25    |                Network-Interface                  |
26    +---------------------------------------------------+
27
28DSI is a session layer used to carry AFP over TCP.
29DDP is in the kernel.  "atalkd" implements RTMP, NBP, ZIP, and AEP.  It
30is the AppleTalk equivalent of Unix "routed".  There is also a
31client-stub library for NBP.  ATP and ASP are implemented as
32libraries.  "papd" allows Macs to spool to "lpd", and "pap" allows Unix
33machines to print to AppleTalk connected printers.  "psf" is a
34PostScript printer filter for "lpd", designed to use "pap".  "psorder"
35is a PostScript reverser, called by "psf" to reverse pages printed to
36face-up stacking printers.  "afpd" provides Macs with an interface to
37the Unix file system.  Refer to the appropriate man pages for
38operational information.
39
40
41Compilation
42===========
43   The `configure' shell script attempts to guess correct values for
44various system-dependent variables used during compilation.  It uses
45those values to create a `Makefile' in each directory of the package.
46It may also create one or more `.h' files containing system-dependent
47definitions.  Finally, it creates a shell script `config.status' that
48you can run in the future to recreate the current configuration, a file
49`config.cache' that saves the results of its tests to speed up
50reconfiguring, and a file `config.log' containing compiler output
51(useful mainly for debugging `configure').
52
53   If you need to do unusual things to compile the package, please try
54to figure out how `configure' could check whether to do them, and mail
55diffs or instructions to the address given in the `README' so they can
56be considered for the next release.  If at some point `config.cache'
57contains results you don't want to keep, you may remove or edit it.
58
59   The file `configure.in' is used to create `configure' by a program
60called `autoconf'.  You only need `configure.in' if you want to change
61it or regenerate `configure' using a newer version of `autoconf'.
62
63
64Tools for Developers
65====================
661. Libtool
67Libtool encapsulates the platform specific dependencies for the
68creation of libraries. It determines if the local platform can support
69shared libraries or if it only supports static libraries.
70
71Netatalk currently requires libtool 1.4 or higher (1.4b for OpenBSD).
72If you are using Tru64 you must apply the following patch to the file
73acinclude.m4 (normally found in /usr/share/libtool/libltdl).
74
75--- acinclude.m4.old	Tue Nov 20 15:30:23 2001
76+++ acinclude.m4	Tue Nov 20 15:31:54 2001
77@@ -2226,6 +2226,7 @@
78 
79 osf3* | osf4* | osf5*)
80   version_type=osf
81+  need_lib_prefix=no
82   need_version=no
83   soname_spec='${libname}${release}.so'
84   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
85
86Documentation: http://www.gnu.org/software/libtool/
87Program: (see the GNU mirrors) /gnu/libtool/libtool-1.4.tar.gz
88
892. GNU m4
90GNU m4 is an implementation of the Unix macro processor. It reads
91stdin and copies to stdout expanding defined macros as it processes
92the text.
93
94Documentation: http://www.gnu.org/software/m4/
95Program: (see the GNU mirrors) /gnu/m4/m4-1.4.tar.gz
96
973. Autoconf
98Autoconf is a package of m4 macros that produce shell scripts to
99configure source code packages.
100
101Documentation: http://www.gnu.org/software/autoconf/
102Program: (see the GNU mirrors) /gnu/autoconf/autoconf-2.52.tar.gz
103
1044. Automake
105Automake is a tool that generates  'Makefile.in' files.
106
107Documentation: http://www.gnu.org/software/automake/
108Program: (see the GNU mirrors) /gnu/automake/automake-1.5.tar.gz
109
110Optional
111========
1125. OpenSSL and/or Libgcrypt
113The OpenSSL Project is a collaborative effort to develop a robust,
114commercial-grade, full-featured, and Open Source toolkit implementing
115the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
116v1) protocols as well as a full-strength general purpose cryptography
117library.
118This is required to enable DHX login support.
119
120Get everything at http://www.openssl.org/ 
121
122The Libgcrypt is a general purpose cryptographic library based on
123the code from GnuPG.
124This is required to enable DHX2 login support.
125
126Get everything at http://directory.fsf.org/project/libgcrypt/
127
1286. TCP Wrappers 
129Wietse Venema's network logger, also known as TCPD or LOG_TCP. These
130programs log the client host name of incoming telnet, ftp, rsh,
131rlogin, finger etc. requests. Security options are: access control per
132host, domain and/or service; detection of host name spoofing or host
133address spoofing; booby traps to implement an early-warning system.
134TCP Wrappers can be gotten at ftp://ftp.porcupine.org/pub/security/
135Netatalk uses TCP Wrappers to authorize host access when using
136afpovertcp. It should be noted that if DDP is in use, the connection
137will still be allowed as TCP Wrappers do not impact DDP connections.
138
1397. PAM (Pluggable Authentication Modules) 
140PAM provides a flexible mechanism for authenticating
141users. PAM was invented by SUN Microsystems.
142
143Author: Andrew Morgan <morgan@linux.kernel.org>
144
145Linux-PAM is a suite of shared libraries that enable the local system
146administrator to choose how applications authenticate users.
147You can get the Linux PAM documentation and sources from
148http://www.kernel.org/pub/linux/libs/pam/
149Netatalk also supports other standard PAM implementations such as OpenPAM.
150
1518. Berkeley DB
152Berkeley DB is a programmatic toolkit that provides fast, reliable,
153scalable, and mission-critical database support to software
154developers. BDB can downloaded from
155http://www.oracle.com/database/berkeley-db/index.html
156Netatalk's CNID database uses the library and header files from BDB.
157Currently, Netatalk supports BDB 4.6 and later.
158
159Error checking and logging
160==========================
161We wan't rigid error checking and concise log messages. This often leads
162to signifant code bloat where the relevant function call is buried in error
163checking and logging statements.
164In order to alleviate error checking and code readability, we provide a set
165of error checking macros in <atalk/errchk.h>. These macros compare the return
166value of statements againt 0, NULL, -1 (and maybe more, check it out).
167Every macro comes in four flavours: EC_CHECK, EC_CHECK_LOG, EC_CHECK_LOG_ERR
168and EC_CHECK_CUSTOM:
169- EC_CHECK just checks the CHECK
170- EC_CHECK_LOG additionally logs the stringified function call.
171- EC_CHECK_LOG_ERR allows specifying the return value
172- EC_CHECK_CUSTOM allows custom actions
173The macros EC_CHECK* unconditionally jump to a cleanup label where the
174neccessary cleanup can be done alongside controlling the return value.
175EC_CHECK_CUSTOM doesn't do that, so an extra "goto EC_CLEANUP" may be
176performed as appropiate.
177
178Example:
179- stat() without EC macro:
180  static int func(const char *name) {
181    int ret = 0;
182    ...
183    if ((ret = stat(name, &some_struct_stat)) != 0) {
184      LOG(...);
185      ret = -1; /* often needed to explicitly set the error indicating return value */
186      goto cleanup;
187    }
188
189    return ret;
190
191  cleanup:
192    ...
193    return ret;
194  }
195
196- stat() with EC macro:
197  static int func(const char *name) {
198    EC_INIT; /* expands to int ret = 0; */
199
200    char *uppername = NULL
201    EC_NULL(uppername = strdup(name));
202    EC_ZERO(strtoupper(uppername));
203
204    EC_ZERO(stat(uppername, &some_struct_stat)); /* expands to complete if block from above */
205
206    EC_STATUS(0);
207
208EC_CLEANUP:
209    if (uppername) free(uppername);
210    EC_EXIT;
211  }
212
213A boileplate function template is:
214
215int func(void)
216{
217    EC_INIT;
218
219    ...your code here...
220
221    EC_STATUS(0);
222
223EC_CLEANUP:
224    EC_EXIT;
225}
226