Deleted Added
full compact
CONTRIBUTING (313537) CONTRIBUTING (327234)
1Some Information for Contributors
2---------------------------------
3You want to contribute to Tcpdump, Thanks!
4Please, read these lines.
5
1Some Information for Contributors
2---------------------------------
3You want to contribute to Tcpdump, Thanks!
4Please, read these lines.
5
6
7How to report bugs and other problems
8-------------------------------------
9To report a security issue (segfault, buffer overflow, infinite loop, arbitrary
10code execution etc) please send an e-mail to security@tcpdump.org, do not use
11the bug tracker!
12
13To report a non-security problem (failure to compile, incorrect output in the
14protocol printout, missing support for a particular protocol etc) please check
15first that it reproduces with the latest stable release of tcpdump and the latest
16stable release of libpcap. If it does, please check that the problem reproduces
17with the current git master branch of tcpdump and the current git master branch of
18libpcap. If it does (and it is not a security-related problem, otherwise see
19above), please navigate to https://github.com/the-tcpdump-group/tcpdump/issues
20and check if the problem has already been reported. If it has not, please open
21a new issue and provide the following details:
22
23* tcpdump and libpcap version (tcpdump --version)
24* operating system name and version and any other details that may be relevant
25 (uname -a, compiler name and version, CPU type etc.)
26* configure flags if any were used
27* statement of the problem
28* steps to reproduce
29
30Please note that if you know exactly how to solve the problem and the solution
31would not be too intrusive, it would be best to contribute some development time
32and open a pull request instead as discussed below.
33
34Still not sure how to do? Feel free to [subscribe](http://www.tcpdump.org/#mailing-lists)
35to the mailing list tcpdump-workers@lists.tcpdump.org and ask!
36
37
38How to add new code and to update existing code
39-----------------------------------------------
40
410) Check that there isn't a pull request already opened for the changes you
42 intend to make.
43
61) Fork the Tcpdump repository on GitHub from
7 https://github.com/the-tcpdump-group/tcpdump
8 (See https://help.github.com/articles/fork-a-repo/)
9
102) Setup an optional Travis-CI build
11 You can setup a travis build for your fork. So, you can test your changes
12 on Linux and OSX before sending pull requests.
13 (See http://docs.travis-ci.com/user/getting-started/)
14
441) Fork the Tcpdump repository on GitHub from
45 https://github.com/the-tcpdump-group/tcpdump
46 (See https://help.github.com/articles/fork-a-repo/)
47
482) Setup an optional Travis-CI build
49 You can setup a travis build for your fork. So, you can test your changes
50 on Linux and OSX before sending pull requests.
51 (See http://docs.travis-ci.com/user/getting-started/)
52
153) Clone your repository
533) Setup your git working copy
16 git clone https://github.com/<username>/tcpdump.git
54 git clone https://github.com/<username>/tcpdump.git
55 cd tcpdump
56 git remote add upstream https://github.com/the-tcpdump-group/tcpdump
57 git fetch upstream
17
184) Do a 'touch .devel' in your working directory.
19 Currently, the effect is
20 a) add (via configure, in Makefile) some warnings options ( -Wall
21 -Wmissing-prototypes -Wstrict-prototypes, ...) to the compiler if it
22 supports these options,
23 b) have the Makefile support "make depend" and the configure script run it.
24

--- 17 unchanged lines hidden (view full) ---

42 (cd tests && ../tcpdump -n -r sample.pcap tcpdump-options > sample.out)
43
44 It is often useful to have test outputs with different verbosity levels
45 (none, -v, -vv, -vvv, etc.) depending on the code.
46
477) Test with 'make check'
48 Don't send a pull request if 'make check' gives failed tests.
49
58
594) Do a 'touch .devel' in your working directory.
60 Currently, the effect is
61 a) add (via configure, in Makefile) some warnings options ( -Wall
62 -Wmissing-prototypes -Wstrict-prototypes, ...) to the compiler if it
63 supports these options,
64 b) have the Makefile support "make depend" and the configure script run it.
65

--- 17 unchanged lines hidden (view full) ---

83 (cd tests && ../tcpdump -n -r sample.pcap tcpdump-options > sample.out)
84
85 It is often useful to have test outputs with different verbosity levels
86 (none, -v, -vv, -vvv, etc.) depending on the code.
87
887) Test with 'make check'
89 Don't send a pull request if 'make check' gives failed tests.
90
508) Rebase your commits against upstream/master
51 (To keep linearity)
918) Try to rebase your commits to keep the history simple.
92 git rebase upstream/master
93 (If the rebase fails and you cannot resolve, issue "git rebase --abort"
94 and ask for help in the pull request comment.)
52
95
539) Initiate and send a pull request
969) Once 100% happy, put your work into your forked repository.
97 git push
98
9910) Initiate and send a pull request
54 (See https://help.github.com/articles/using-pull-requests/)
55
100 (See https://help.github.com/articles/using-pull-requests/)
101
56Some remarks
57------------
102
103Code style and generic remarks
104------------------------------
58a) A thorough reading of some other printers code is useful.
59
60b) Put the normative reference if any as comments (RFC, etc.).
61
105a) A thorough reading of some other printers code is useful.
106
107b) Put the normative reference if any as comments (RFC, etc.).
108
62c) Put the format of packets/headers/options as comments.
109c) Put the format of packets/headers/options as comments if there is no
110 published normative reference.
63
64d) The printer may receive incomplete packet in the buffer, truncated at any
65 random position, for example by capturing with '-s size' option.
66 Thus use ND_TTEST, ND_TTEST2, ND_TCHECK or ND_TCHECK2 for bound checking.
67 For ND_TCHECK2:
68 Define : static const char tstr[] = " [|protocol]";
69 Define a label: trunc
70 Print with: ND_PRINT((ndo, "%s", tstr));

--- 33 unchanged lines hidden ---
111
112d) The printer may receive incomplete packet in the buffer, truncated at any
113 random position, for example by capturing with '-s size' option.
114 Thus use ND_TTEST, ND_TTEST2, ND_TCHECK or ND_TCHECK2 for bound checking.
115 For ND_TCHECK2:
116 Define : static const char tstr[] = " [|protocol]";
117 Define a label: trunc
118 Print with: ND_PRINT((ndo, "%s", tstr));

--- 33 unchanged lines hidden ---