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