blob: c60f31ca7e478180287305b3da57d342c685a881 [file] [log] [blame]
gdtd9fd04c2003-12-19 19:20:25 +00001-*- mode: text; -*-
2
gdt18323bb2004-11-05 13:17:20 +00003$Id: HACKING,v 1.9 2004/11/05 13:17:20 gdt Exp $
gdtd9fd04c2003-12-19 19:20:25 +00004
5GUIDELINES FOR HACKING ON QUAGGA
6
gdtd9fd04c2003-12-19 19:20:25 +00007[this is a draft in progress]
8
hasso863076d2004-09-01 20:13:23 +00009GNU coding standards apply. Indentation follows the result of
10invoking GNU indent (as of 2.2.8a) with no arguments. Note that this
11uses tabs instead of spaces where possible for leading whitespace, and
12assumes that tabs are every 8 columns. Do not attempt to redefine the
13location of tab stops. Note also that some indentation does not
14follow GNU style. This is a historical accident, and we generally
15only clean up whitespace when code is unmaintainable due to whitespace
16issues, as fewer changes from zebra lead to easier merges.
17
18For GNU emacs, use indentation style "gnu".
19
20For Vim, use the following lines (note that tabs are at 8, and that
21softtabstop sets the indentation level):
22
23set tabstop=8
24set softtabstop=2
25set shiftwidth=2
26set noexpandtab
gdtd9fd04c2003-12-19 19:20:25 +000027
gdt2934f282004-01-05 20:09:00 +000028Be particularly careful not to break platforms/protocols that you
29cannot test.
30
31New code should have good comments, and changes to existing code
32should in many cases upgrade the comments when necessary for a
33reviewer to conclude that the change has no unintended consequences.
34
35CHANGELOG
36
37Add a ChangeLog entry whenever changing code, except for minor fixes
38to a commit (with a ChangeLog entry) within the last few days.
39
gdt18323bb2004-11-05 13:17:20 +000040Most directories have a ChangeLog file; changes to code in that
41directory should go in the per-directory ChangeLog. Global or
42structural changes should also be mentioned in the top-level
43ChangeLog.
gdt2934f282004-01-05 20:09:00 +000044
gdtb7a97f82004-07-23 16:23:56 +000045SHARED LIBRARY VERSIONING
46
47[this section is at the moment just gdt's opinion]
48
49Quagga builds several shared libaries (lib/libzebra, ospfd/libospf,
50ospfclient/libsopfapiclient). These may be used by external programs,
51e.g. a new routing protocol that works with the zebra daemon, or
52ospfapi clients. The libtool info pages (node Versioning) explain
53when major and minor version numbers should be changed. These values
54are set in Makefile.am near the definition of the library. If you
55make a change that requires changing the shared library version,
56please update Makefile.am.
57
58libospf exports far more than it should, and is needed by ospfapi
59clients. Only bump libospf for changes to functions for which it is
60reasonable for a user of ospfapi to call, and please err on the side
61of not bumping.
62
63There is no support intended for installing part of zebra. The core
64library libzebra and the included daemons should always be built and
65installed together.
66
gdtd9fd04c2003-12-19 19:20:25 +000067PATCH SUBMISSION
68
paul85cf0a02004-01-09 16:34:54 +000069* Send a clean diff against the head of CVS in unified diff format, eg by:
70 cvs <cvs opts> diff -uwb ....
gdtd9fd04c2003-12-19 19:20:25 +000071
72* Include ChangeLog and NEWS entries as appropriate before the patch
73 (or in it if you are 100% up to date).
74
gdt18323bb2004-11-05 13:17:20 +000075* Include only one semantic change or group of changes per patch.
gdtd9fd04c2003-12-19 19:20:25 +000076
paul85cf0a02004-01-09 16:34:54 +000077* Do not make gratuitous changes to whitespace. See the w and b arguments
78 to diff.
gdtd9fd04c2003-12-19 19:20:25 +000079
80* State on which platforms and with what daemons the patch has been
81 tested. Understand that if the set of testing locations is small,
82 and the patch might have unforeseen or hard to fix consequences that
83 there may be a call for testers on quagga-dev, and that the patch
84 may be blocked until test results appear.
85
86 If there are no users for a platform on quagga-dev who are able and
87 willing to verify -current occasionally, that platform may be
88 dropped from the "should be checked" list.
89
90PATCH APPLICATION TO CVS
91
92* Only apply patches that meet the submission guidelines.
93
94* If a patch is large (perhaps more than 100 new/changed lines), tag
95 the repository before and after the change with e.g. before-foo-fix
96 and after-foo-fix.
97
98* If the patch might break something, issue a call for testing on the
99 mailinglist.
100
paul4134ceb2004-05-13 13:38:06 +0000101* Give an appropriate commit message, eg the ChangeLog entry should suffice,
102 if it does not, then the ChangeLog entry itself needs to be corrected.
103
gdtd9fd04c2003-12-19 19:20:25 +0000104* By committing a patch, you are responsible for fixing problems
105 resulting from it (or backing it out).
106
107STABLE PLATFORMS AND DAEMONS
108
109The list of platforms that should be tested follow. This is a list
110derived from what quagga is thought to run on and for which
111maintainers can test or there are people on quagga-dev who are able
112and willing to verify that -current does or does not work correctly.
113
114 BSD (Free, Net or Open, any platform) # without capabilities
115 GNU/Linux (any distribution, i386)
gdt18323bb2004-11-05 13:17:20 +0000116 Solaris with 64-bit processor (strict alignment, not ILP32)
117 [future: NetBSD/sparc64]
gdtd9fd04c2003-12-19 19:20:25 +0000118
119The list of daemons that are thought to be stable and that should be
120tested are:
121
122 zebra
123 bgpd
124 ripd
125 ospfd
126 ripngd
gdt1f431d22003-12-22 15:45:01 +0000127
gdt18323bb2004-11-05 13:17:20 +0000128Daemons which are in a testing phase are
129
130 ospf6d
131 isisd
132
jardin9e867fe2003-12-23 08:56:18 +0000133IMPORT OR UPDATE VENDOR SPECIFIC ROUTING PROTOCOLS
134
135The source code of Quagga is based on two vendors:
136
137 zebra_org (http://www.zebra.org/)
138 isisd_sf (http://isisd.sf.net/)
139
gdt18323bb2004-11-05 13:17:20 +0000140[20041105: Is isisd.sf.netf still where isisd word is happening, or is
141the quagga repo now the canonical place? The last tarball on sf is
142two years old. --gdt]
143
jardin9e867fe2003-12-23 08:56:18 +0000144In order to import source code, the following procedure should be used:
145
146* Tag the Current Quagga CVS repository:
147
148 cvs tag import_isisd_sf_20031223
149
150* Import the source code into the Quagga's framework. You must not modified
151 this source code. It will be merged later.
152
153 cd dir_isisd
154 export CVSROOT=:pserver:LOGIN@anoncvs.quagga.net:/var/cvsroot
155 cvs import quagga/isisd isisd_sf isisd_sf_20031223
156 ---COMMENTS---
157 Vendor: [isisd_sf] Sampo's ISISd from Sourceforge
158 Tag: [isisd_sf_20031217] Current CVS release
159 ---
160
161* Update your Quagga's directory:
162
163 cd dir_quagga
164 cvs update -dP
165
166 or
167
168 cvs co -d quagga_isisd quagga
169
170* Merge the code, then commit:
171
172 cvs commit
173