This document describes some guidelines for people participating in lwIP development.
How to contribute to lwIPEdit
Here is a short list of suggestions to anybody working with lwIP and trying to contribute bug reports, fixes, enhancements, platform ports etc. First of all as you may already know lwIP is a volunteer project so feedback to fixes or questions might often come late. Hopefully the bug and patch tracking features of Savannah help us not lose users' input.
Source code styleEdit
- do not use tabs.
- indentation is two spaces per level (i.e. per tab).
- end debug messages with a trailing newline (\n).
- one space between keyword and opening bracket.
- no space between function and opening bracket.
- one space and no newline before opening curly braces of a block.
- closing curly brace on a single line.
- spaces surrounding assignment and comparisons.
- use current source code style as further reference.
Source code documentation styleEdit
- JavaDoc compliant and Doxygen compatible.
- Function documentation above functions in .c files, not .h files (this forces you to synchronize documentation and implementation).
- Use current documentation style as further reference.
Bug reports and patchesEdit
- Make sure you are reporting bugs or send patches against the latest sources. (From the latest release and/or the current CVS sources.)
- If you think you found a bug make sure it's not already filed in the bugtracker at Savannah.
- If you have a fix put the patch on Savannah. If it is a patch that affects both core and arch specific stuff please separate them so that the core can be applied separately while leaving the other patch 'open'. The preferred way is to NOT touch archs you can't test and let maintainers take care of them. This is a good way to see if they are used at all - the same goes for unix netifs except tapif.
- Do not file a bug and post a fix to it to the patch area. Either a bug report or a patch will be enough. If you correct an existing bug then attach the patch to the bug rather than creating a new entry in the patch area.
- Patches should be specific to a single change or to related changes. Do not mix bugfixes with spelling and other trivial fixes unless the bugfix is trivial too. Do not reorganize code and rename identifiers in the same patch you change behaviour if not necessary. A patch is easier to read and understand if it's to the point and short than if it's not to the point and long :) so the chances for it to be applied are greater. If you're dealing with a complex change you're welcome to split a large patch up into smaller individual patches to make them clearer if you wish.
- If you have ported lwIP to a platform (an OS, a uC/processor or a combination of these) and you think it could benefit others you might want discuss this on the mailing list. You can also ask for CVS access to submit and maintain your port in the contrib CVS module.