diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-01-07 11:47:30 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-01-07 13:36:41 +0100 |
commit | e2982e7f6f0b624a773ec5a58885ee80fab46d34 (patch) | |
tree | 52c8e511ccaff8ef09dc3337b213273865522162 /CONTRIBUTING | |
parent | 8ab5c3a4e75a3ce8da691cd6ca6a9945082827af (diff) | |
download | tcpdump-e2982e7f6f0b624a773ec5a58885ee80fab46d34.tar.gz |
Update ND_PRINT() as a variadic macro
Diffstat (limited to 'CONTRIBUTING')
-rw-r--r-- | CONTRIBUTING | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/CONTRIBUTING b/CONTRIBUTING index 8ba41f9a..b2e3cc00 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING @@ -118,7 +118,7 @@ d) The printer may receive incomplete packet in the buffer, truncated at any For ND_TCHECK_LEN: Define : static const char tstr[] = " [|protocol]"; Define a label: trunc - Print with: ND_PRINT((ndo, "%s", tstr)); + Print with: ND_PRINT("%s", tstr); You can test the code via: sudo ./tcpdump -s snaplen [-v][v][...] -i lo # in a terminal sudo tcpreplay -i lo sample.pcap # in another terminal @@ -128,7 +128,7 @@ e) Do invalid packet checks in code: Think that your code can receive in input not only a valid packet but any arbitrary random sequence of octets (packet - built malformed originally by the sender or by a fuzz tester, - became corrupted in transit). - Print with: ND_PRINT((ndo, "%s", istr)); /* to print " (invalid)" */ + Print with: ND_PRINT("%s", istr); /* to print " (invalid)" */ f) Use 'struct tok' for indexed strings and print them with tok2str() or bittok2str() (for flags). |