blob: 8aa0d9795ca4d266cf03e280e49cbfd11fd2c867 [file] [log] [blame]
gdtd9fd04c2003-12-19 19:20:25 +00001-*- mode: text; -*-
gdt0d7e9132005-02-23 16:20:07 +00002$Id: HACKING,v 1.16 2005/02/23 16:20:07 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
ajs5e764772004-12-03 19:03:33 +000039Please document fully the proper use of a new function in the header file
40in which it is declared. And please consult existing headers for
41documentation on how to use existing functions. In particular, please consult
42these header files:
43
44 lib/log.h logging levels and usage guidance
45 [more to be added]
46
47
gdt2934f282004-01-05 20:09:00 +000048CHANGELOG
49
50Add a ChangeLog entry whenever changing code, except for minor fixes
51to a commit (with a ChangeLog entry) within the last few days.
52
gdt18323bb2004-11-05 13:17:20 +000053Most directories have a ChangeLog file; changes to code in that
54directory should go in the per-directory ChangeLog. Global or
55structural changes should also be mentioned in the top-level
56ChangeLog.
gdt2934f282004-01-05 20:09:00 +000057
paul1f8f61a2004-11-05 23:38:20 +000058Certain directories do not contain project code, but contain project
59meta-data, eg packaging information, changes to files in these directory may
60not require the global ChangeLog to be updated (at the discretion of the
61maintainer who usually maintains that meta-data). Also, CVS meta-data such
62as cvsignore files do not require ChangeLog updates, just a sane commit
63message.
64
gdt0d7e9132005-02-23 16:20:07 +000065RELEASE PROCEDURE
66
67 Tag the repository with release tag (follow existing conventions).
68 [This enables recreating the release, and is just good CM practice.]
69
70 Check out the tag, and do a test build.
71
72 In an empty directory, do a fresh checkout with -r <release-tag>
73 [This makes the dates in the tarball be the modified dates in CVS.]
74
75 {Manually patch redhat/quagga.spec.in to remove @CONFDATE@}
76 ./configure
77 make dist
78
79If any errors occur, move tags as needed and start over from the fresh
80checkouts. Do not append to tarballs, as this has produced
81non-standards-conforming tarballs in the past.
82
gdtfbb67092004-11-15 17:29:11 +000083TOOL VERSIONS
84
85Require versions of support tools are listed in INSTALL.quagga.txt.
86Required versions should only be done with due deliberation, as it can
87cause environments to no longer be able to compile quagga.
88
gdtb7a97f82004-07-23 16:23:56 +000089SHARED LIBRARY VERSIONING
90
91[this section is at the moment just gdt's opinion]
92
93Quagga builds several shared libaries (lib/libzebra, ospfd/libospf,
94ospfclient/libsopfapiclient). These may be used by external programs,
95e.g. a new routing protocol that works with the zebra daemon, or
96ospfapi clients. The libtool info pages (node Versioning) explain
97when major and minor version numbers should be changed. These values
98are set in Makefile.am near the definition of the library. If you
99make a change that requires changing the shared library version,
100please update Makefile.am.
101
102libospf exports far more than it should, and is needed by ospfapi
103clients. Only bump libospf for changes to functions for which it is
104reasonable for a user of ospfapi to call, and please err on the side
105of not bumping.
106
107There is no support intended for installing part of zebra. The core
108library libzebra and the included daemons should always be built and
109installed together.
110
gdtd9fd04c2003-12-19 19:20:25 +0000111PATCH SUBMISSION
112
paul85cf0a02004-01-09 16:34:54 +0000113* Send a clean diff against the head of CVS in unified diff format, eg by:
hassoe69b9e42005-02-23 11:54:12 +0000114 cvs <cvs opts> diff -upwb ....
gdtd9fd04c2003-12-19 19:20:25 +0000115
116* Include ChangeLog and NEWS entries as appropriate before the patch
117 (or in it if you are 100% up to date).
118
gdt18323bb2004-11-05 13:17:20 +0000119* Include only one semantic change or group of changes per patch.
gdtd9fd04c2003-12-19 19:20:25 +0000120
paul85cf0a02004-01-09 16:34:54 +0000121* Do not make gratuitous changes to whitespace. See the w and b arguments
122 to diff.
gdtd9fd04c2003-12-19 19:20:25 +0000123
124* State on which platforms and with what daemons the patch has been
125 tested. Understand that if the set of testing locations is small,
126 and the patch might have unforeseen or hard to fix consequences that
127 there may be a call for testers on quagga-dev, and that the patch
128 may be blocked until test results appear.
129
130 If there are no users for a platform on quagga-dev who are able and
131 willing to verify -current occasionally, that platform may be
132 dropped from the "should be checked" list.
133
134PATCH APPLICATION TO CVS
135
136* Only apply patches that meet the submission guidelines.
137
138* If a patch is large (perhaps more than 100 new/changed lines), tag
139 the repository before and after the change with e.g. before-foo-fix
140 and after-foo-fix.
141
142* If the patch might break something, issue a call for testing on the
143 mailinglist.
144
paul4134ceb2004-05-13 13:38:06 +0000145* Give an appropriate commit message, eg the ChangeLog entry should suffice,
paul1f8f61a2004-11-05 23:38:20 +0000146 if it does not, then the ChangeLog entry itself needs to be corrected. The
147 commit message text should be identical to that added to the ChangeLog
148 message. (One suggestion: when commiting, use your editor to read in the
149 ChangeLog and delete all previous ChangeLogs.)
paul4134ceb2004-05-13 13:38:06 +0000150
gdtd9fd04c2003-12-19 19:20:25 +0000151* By committing a patch, you are responsible for fixing problems
152 resulting from it (or backing it out).
153
154STABLE PLATFORMS AND DAEMONS
155
156The list of platforms that should be tested follow. This is a list
157derived from what quagga is thought to run on and for which
158maintainers can test or there are people on quagga-dev who are able
159and willing to verify that -current does or does not work correctly.
160
161 BSD (Free, Net or Open, any platform) # without capabilities
162 GNU/Linux (any distribution, i386)
paul1f8f61a2004-11-05 23:38:20 +0000163 Solaris (strict alignment, any platform)
gdt18323bb2004-11-05 13:17:20 +0000164 [future: NetBSD/sparc64]
gdtd9fd04c2003-12-19 19:20:25 +0000165
166The list of daemons that are thought to be stable and that should be
167tested are:
168
169 zebra
170 bgpd
171 ripd
172 ospfd
173 ripngd
gdt1f431d22003-12-22 15:45:01 +0000174
gdt18323bb2004-11-05 13:17:20 +0000175Daemons which are in a testing phase are
176
177 ospf6d
178 isisd
ajs8035e9f2004-12-22 03:16:59 +0000179 watchquagga
gdt18323bb2004-11-05 13:17:20 +0000180
jardin9e867fe2003-12-23 08:56:18 +0000181IMPORT OR UPDATE VENDOR SPECIFIC ROUTING PROTOCOLS
182
183The source code of Quagga is based on two vendors:
184
185 zebra_org (http://www.zebra.org/)
186 isisd_sf (http://isisd.sf.net/)
187
gdt18323bb2004-11-05 13:17:20 +0000188[20041105: Is isisd.sf.netf still where isisd word is happening, or is
189the quagga repo now the canonical place? The last tarball on sf is
190two years old. --gdt]
191
jardin9e867fe2003-12-23 08:56:18 +0000192In order to import source code, the following procedure should be used:
193
194* Tag the Current Quagga CVS repository:
195
196 cvs tag import_isisd_sf_20031223
197
198* Import the source code into the Quagga's framework. You must not modified
199 this source code. It will be merged later.
200
201 cd dir_isisd
202 export CVSROOT=:pserver:LOGIN@anoncvs.quagga.net:/var/cvsroot
203 cvs import quagga/isisd isisd_sf isisd_sf_20031223
204 ---COMMENTS---
205 Vendor: [isisd_sf] Sampo's ISISd from Sourceforge
206 Tag: [isisd_sf_20031217] Current CVS release
207 ---
208
209* Update your Quagga's directory:
210
211 cd dir_quagga
212 cvs update -dP
213
214 or
215
216 cvs co -d quagga_isisd quagga
217
218* Merge the code, then commit:
219
220 cvs commit
221