blob: fa5ac1ace14212975016f0b9cdb753321a696bac [file] [log] [blame]
gdtd9fd04c2003-12-19 19:20:25 +00001-*- mode: text; -*-
gdt697877e2004-11-15 19:23:47 +00002$Id: HACKING,v 1.12 2004/11/15 19:23:47 gdt Exp $
gdtd9fd04c2003-12-19 19:20:25 +00003
4GUIDELINES FOR HACKING ON QUAGGA
5
gdtd9fd04c2003-12-19 19:20:25 +00006[this is a draft in progress]
7
hasso863076d2004-09-01 20:13:23 +00008GNU coding standards apply. Indentation follows the result of
9invoking GNU indent (as of 2.2.8a) with no arguments. Note that this
10uses tabs instead of spaces where possible for leading whitespace, and
11assumes that tabs are every 8 columns. Do not attempt to redefine the
12location of tab stops. Note also that some indentation does not
13follow GNU style. This is a historical accident, and we generally
14only clean up whitespace when code is unmaintainable due to whitespace
15issues, as fewer changes from zebra lead to easier merges.
16
17For GNU emacs, use indentation style "gnu".
18
19For Vim, use the following lines (note that tabs are at 8, and that
20softtabstop sets the indentation level):
21
22set tabstop=8
23set softtabstop=2
24set shiftwidth=2
25set noexpandtab
gdtd9fd04c2003-12-19 19:20:25 +000026
gdt2934f282004-01-05 20:09:00 +000027Be particularly careful not to break platforms/protocols that you
28cannot test.
29
30New code should have good comments, and changes to existing code
31should in many cases upgrade the comments when necessary for a
32reviewer to conclude that the change has no unintended consequences.
33
gdt697877e2004-11-15 19:23:47 +000034Each file in CVS should have the RCS keyword Id, somewhere very near
35the top, commented out appropriately for the file type. Just add
36<dollar>Id:<dollar>, replacing <dollar> with $. See line 2 of HACKING
37for an example; on checkout :$ is expanded to include the value.
38
gdt2934f282004-01-05 20:09:00 +000039CHANGELOG
40
41Add a ChangeLog entry whenever changing code, except for minor fixes
42to a commit (with a ChangeLog entry) within the last few days.
43
gdt18323bb2004-11-05 13:17:20 +000044Most directories have a ChangeLog file; changes to code in that
45directory should go in the per-directory ChangeLog. Global or
46structural changes should also be mentioned in the top-level
47ChangeLog.
gdt2934f282004-01-05 20:09:00 +000048
paul1f8f61a2004-11-05 23:38:20 +000049Certain directories do not contain project code, but contain project
50meta-data, eg packaging information, changes to files in these directory may
51not require the global ChangeLog to be updated (at the discretion of the
52maintainer who usually maintains that meta-data). Also, CVS meta-data such
53as cvsignore files do not require ChangeLog updates, just a sane commit
54message.
55
gdtfbb67092004-11-15 17:29:11 +000056TOOL VERSIONS
57
58Require versions of support tools are listed in INSTALL.quagga.txt.
59Required versions should only be done with due deliberation, as it can
60cause environments to no longer be able to compile quagga.
61
gdtb7a97f82004-07-23 16:23:56 +000062SHARED LIBRARY VERSIONING
63
64[this section is at the moment just gdt's opinion]
65
66Quagga builds several shared libaries (lib/libzebra, ospfd/libospf,
67ospfclient/libsopfapiclient). These may be used by external programs,
68e.g. a new routing protocol that works with the zebra daemon, or
69ospfapi clients. The libtool info pages (node Versioning) explain
70when major and minor version numbers should be changed. These values
71are set in Makefile.am near the definition of the library. If you
72make a change that requires changing the shared library version,
73please update Makefile.am.
74
75libospf exports far more than it should, and is needed by ospfapi
76clients. Only bump libospf for changes to functions for which it is
77reasonable for a user of ospfapi to call, and please err on the side
78of not bumping.
79
80There is no support intended for installing part of zebra. The core
81library libzebra and the included daemons should always be built and
82installed together.
83
gdtd9fd04c2003-12-19 19:20:25 +000084PATCH SUBMISSION
85
paul85cf0a02004-01-09 16:34:54 +000086* Send a clean diff against the head of CVS in unified diff format, eg by:
87 cvs <cvs opts> diff -uwb ....
gdtd9fd04c2003-12-19 19:20:25 +000088
89* Include ChangeLog and NEWS entries as appropriate before the patch
90 (or in it if you are 100% up to date).
91
gdt18323bb2004-11-05 13:17:20 +000092* Include only one semantic change or group of changes per patch.
gdtd9fd04c2003-12-19 19:20:25 +000093
paul85cf0a02004-01-09 16:34:54 +000094* Do not make gratuitous changes to whitespace. See the w and b arguments
95 to diff.
gdtd9fd04c2003-12-19 19:20:25 +000096
97* State on which platforms and with what daemons the patch has been
98 tested. Understand that if the set of testing locations is small,
99 and the patch might have unforeseen or hard to fix consequences that
100 there may be a call for testers on quagga-dev, and that the patch
101 may be blocked until test results appear.
102
103 If there are no users for a platform on quagga-dev who are able and
104 willing to verify -current occasionally, that platform may be
105 dropped from the "should be checked" list.
106
107PATCH APPLICATION TO CVS
108
109* Only apply patches that meet the submission guidelines.
110
111* If a patch is large (perhaps more than 100 new/changed lines), tag
112 the repository before and after the change with e.g. before-foo-fix
113 and after-foo-fix.
114
115* If the patch might break something, issue a call for testing on the
116 mailinglist.
117
paul4134ceb2004-05-13 13:38:06 +0000118* Give an appropriate commit message, eg the ChangeLog entry should suffice,
paul1f8f61a2004-11-05 23:38:20 +0000119 if it does not, then the ChangeLog entry itself needs to be corrected. The
120 commit message text should be identical to that added to the ChangeLog
121 message. (One suggestion: when commiting, use your editor to read in the
122 ChangeLog and delete all previous ChangeLogs.)
paul4134ceb2004-05-13 13:38:06 +0000123
gdtd9fd04c2003-12-19 19:20:25 +0000124* By committing a patch, you are responsible for fixing problems
125 resulting from it (or backing it out).
126
127STABLE PLATFORMS AND DAEMONS
128
129The list of platforms that should be tested follow. This is a list
130derived from what quagga is thought to run on and for which
131maintainers can test or there are people on quagga-dev who are able
132and willing to verify that -current does or does not work correctly.
133
134 BSD (Free, Net or Open, any platform) # without capabilities
135 GNU/Linux (any distribution, i386)
paul1f8f61a2004-11-05 23:38:20 +0000136 Solaris (strict alignment, any platform)
gdt18323bb2004-11-05 13:17:20 +0000137 [future: NetBSD/sparc64]
gdtd9fd04c2003-12-19 19:20:25 +0000138
139The list of daemons that are thought to be stable and that should be
140tested are:
141
142 zebra
143 bgpd
144 ripd
145 ospfd
146 ripngd
gdt1f431d22003-12-22 15:45:01 +0000147
gdt18323bb2004-11-05 13:17:20 +0000148Daemons which are in a testing phase are
149
150 ospf6d
151 isisd
152
jardin9e867fe2003-12-23 08:56:18 +0000153IMPORT OR UPDATE VENDOR SPECIFIC ROUTING PROTOCOLS
154
155The source code of Quagga is based on two vendors:
156
157 zebra_org (http://www.zebra.org/)
158 isisd_sf (http://isisd.sf.net/)
159
gdt18323bb2004-11-05 13:17:20 +0000160[20041105: Is isisd.sf.netf still where isisd word is happening, or is
161the quagga repo now the canonical place? The last tarball on sf is
162two years old. --gdt]
163
jardin9e867fe2003-12-23 08:56:18 +0000164In order to import source code, the following procedure should be used:
165
166* Tag the Current Quagga CVS repository:
167
168 cvs tag import_isisd_sf_20031223
169
170* Import the source code into the Quagga's framework. You must not modified
171 this source code. It will be merged later.
172
173 cd dir_isisd
174 export CVSROOT=:pserver:LOGIN@anoncvs.quagga.net:/var/cvsroot
175 cvs import quagga/isisd isisd_sf isisd_sf_20031223
176 ---COMMENTS---
177 Vendor: [isisd_sf] Sampo's ISISd from Sourceforge
178 Tag: [isisd_sf_20031217] Current CVS release
179 ---
180
181* Update your Quagga's directory:
182
183 cd dir_quagga
184 cvs update -dP
185
186 or
187
188 cvs co -d quagga_isisd quagga
189
190* Merge the code, then commit:
191
192 cvs commit
193