summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-04-11docs: install: update mausezahn locationDaniel Borkmann1-1/+1
It is accessable e.g. through: git pull git://repo.or.cz/netsniff-ng-old.git with-mausezahn Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-11build: currently do not copy docs to shared docsDaniel Borkmann1-7/+0
Maybe in short term future, before the next release, we will think about putting the README file for users into DOCDIRE, since the rest is not really interesting for users, but probably only for developers. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-11docs: readme: add steps to verify a Git releaseDaniel Borkmann1-15/+16
We should only put the things here that are interesting for users, thus, add steps to verify a release from the Workflow document. [1] http://pub.netsniff-ng.org/docs/Workflow Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-11docs: move some of them to the root directoryDaniel Borkmann10-762/+31
Lets move CodingStyle, SubmittingPatches, and Sponsors into the root directory of netsniff-ng and remove the Documentation folder. Some of those files are quite bloated, and most of these things should be in the man-pages anyway. They should be the only big sources of documentation, nothing else. The rest is currently put here: http://pub.netsniff-ng.org/docs/ Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-11man: netsniff-ng: include known bug from docsDaniel Borkmann1-0/+48
Add the known bug from Documentation/KnownIssues into the man page so that at some point in time, we can remove this document and maintain that stuff within the man page. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-11netsniff-ng: mlock: only lock current and future pages when rootDaniel Borkmann1-2/+4
When we're still root, we tell the kernel to lock/protect all current and future pages in memory so that they will not be swapped out in case the system uses up too much. Now when we do xzmalloc_aligned(), it calls internally posix_memalign() that can call mmap(2), thus we will get an EAGAIN as errno, since we're not root anymore and since we wanted to touch sth. that belongs to root. Nasty. Fix this up by only protecting these pages when we do not use -u/-g. Reported-by: Doug Burks <doug.burks@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-11trafgen: parser: fix regression on last pkt elementDaniel Borkmann1-2/+7
Jon Schipp reported that a arbitrary packet config such as ... { "MyPacket", "MyPacket", "MyPacket", "MyPacket", "MyPacket", "MyPacket", "MyPacket", "MyPacket", } ... doesn't work anymore, although it used to work. This regression was introduced by commit f9591eebe40c ("trafgen: lexer/parser: fix cpu() selection and whitespacing"). Reported-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-11man: netsniff-ng: Do some wordsmithingTobias Klauser1-5/+5
Fix wording and phrasing in some of the usage examples. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-04-11man: netsniff-ng: Fix typo of 'privileges'Tobias Klauser1-2/+2
Replace 'priviledges' by 'privileges'. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-04-11man: netsniff-ng: Fix a typoTobias Klauser1-1/+1
Replace 'networkoing' by 'networking'. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-04-09pcap_io: introduce init_once helper that is called with priviledgesDaniel Borkmann5-7/+23
When using netsniff-ng with dropping priviledges, we have to introduce another pcap helper function that is called once before we drop the priviledges. In this function we have to invoke the disc I/O scheduler policy, because it needs priviledges. Otherwise netsniff-ng will fail with "Failed to set io prio for pid" on startup, since we're not root anymore. Reported-by: Doug Burks <doug.burks@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-09trafgen: do not care if device is running yetDaniel Borkmann1-2/+0
E.g. when executing trafgen on tap devices, trafgen will complain that it is not up and running although it was brought up. Remove this usability restriction and let the kernel decide if it may send the packets or not. Reported-by: Aimal Khan <aimal.khan98@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-08man: ifpps: add bugs sectionDaniel Borkmann1-0/+6
Add a section of known bugs/todos for bpfc. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-08man: finish netsniff-ng man pageDaniel Borkmann1-29/+163
Fill in the rest of the gaps for this man page. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-08man: netsniff-ng: add description paragraph and some optionsDaniel Borkmann1-3/+84
This patch continues on the netsniff-ng man page. It adds a program description and documents some options, not yet all. More to come. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-08man: netsniff-ng: finish usage examples and add filter examplesDaniel Borkmann1-7/+80
The usage examples are good so far. Most of the things one needs to know. Also, add a short howto on how to use bpfc filtering or pcap-like high-level filters. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-08man: start netsniff-ng.8 man pageDaniel Borkmann1-0/+157
Not yet finished, but it already contains some useful example descriptions and notes for tuning. More to come very soon. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-07man: finish bpfc man pageDaniel Borkmann1-0/+199
This patch adds BPF architecture and instruction description with supported Linux extensions. Also, essential bpfc examples are given. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-06man: man page updates for bpfc, curvetunDaniel Borkmann2-0/+317
These are the writings so far. For sure they are not yet finished, so I will push updates for both of them as soon as possible, but for now this is a first version people can start to read. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-06netsniff-ng: also capture if NIC is currently downDaniel Borkmann1-5/+0
There is actually no reason why netsniff-ng should fail if the NIC is down at startup. We still can setup everything and already capture at the time it goes up. This might be useful when replugging cables on servers, for instance. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-04-05man: add ifpps.8 man pageDaniel Borkmann1-0/+99
Finally I found some time and started writing man pages. This is a first one in a series of man pages for all tools. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-30make: also credit involved people in mail messageDaniel Borkmann1-0/+4
Still untested, since we did not yet tag a release, but for now, also credit all involved people in a particular release. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-30make: when mrproper, also remove Git tree unrelated filesDaniel Borkmann1-0/+2
When we really clean up everything, also remove crap files that do not belong to the Git tree. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-28ring: purge timer before we unmap tx ring buffersDaniel Borkmann5-4/+44
If we unmap TX ring buffers and still have timer shots that trigger the kernel to traverse the TX_RING, it can send out random crap in some situations. Prevent this by destroying the timer and flush the TX_RING first in wait mode. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-27trafgen: parser: do not enforce whitesapceDaniel Borkmann1-3/+3
Do not enforce whitespace at the beginning or end of a packet configuration, there's no reason to do so. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-27trafgen: lexer: return if no needle foundDaniel Borkmann1-4/+5
Also return if no needle has been found in the shell code haystack. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-26trafgen: update help descriptionDaniel Borkmann2-1/+2
After commit f9591eebe40c (trafgen: lexer/parser: fix cpu() selection and whitespacing), we also need to fixup the help description, so that users start using the cpu(X-Y) notation instead. Also, reintroduce the alias csum16 for csumip. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-25trafgen: parser: add possibility for negative numbersDaniel Borkmann1-0/+2
The previous commit reduced it, so now we allow it within cX() containers in order to negate a result, if someone needs that. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-25trafgen: lexer/parser: fix cpu() selection and whitespacingDaniel Borkmann2-4/+14
It looks unintuitive when once needs to write cpu(0:3), so also allow cpu(0-3). Then it's quite stupid to enforce whitespace after the double colon before the curley braces open. So make this rather optional here. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-22trafgen: fix bug in packet schedulingDaniel Borkmann1-16/+22
When having a config like cpu(1): {...}, and one runs it with -n1, trafgen behaves buggy, I also noted that in other situations. Fix this by letting the loop also return on CPU state RES, and do not perform this stupid magic in the main routine. So far it seems to work now after some basic tests I did. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-19ring: first unmap, then destroy ring bufferDaniel Borkmann2-8/+6
In both, the RX_RING and TX_RING we need to unmap first and then destroy the buffer, otherwise, we get a device or resource busy. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-19bpfc: filter: add poff ancillary operationDaniel Borkmann3-1/+14
In preparation for [1], add the #poff operation, so that users can dynamically truncate packets on the payload start offset. This is useful for several reasons: privacy, speed, ... Example for bpfc: ld #poff ret a [1] http://thread.gmane.org/gmane.linux.network/262512 Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-19curvetun: Only close() file descriptor if openTobias Klauser1-3/+3
Only attempt to close the file descriptor in error cases where it is actually open. This was discovered by the coverity scanner. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-03-19flowtop: Omit return value in flow_entry_get_sain{4,6}_obj()Tobias Klauser1-10/+6
The return value is never used by the callers, so we don't need to return anything. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-03-17nacl scripts: include common header and rename build_nacl.shDaniel Borkmann5-15/+24
Add a uniform header comment to the two scripts as present in other scripts in this repository as well. Also rename build_nacl.sh into nacl_build.sh to stay conform in naming. For this, also update all mentions of build_nacl.sh to nacl_build.sh. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16dissector_fuzz: minor: add header file descriptionDaniel Borkmann1-2/+13
Add a missing header file description as present in other scripts, for example. Also credit Stefan for his help. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16trafgen: add csumicmp for ICMP checksum calculationDaniel Borkmann1-0/+2
Both, the IP and ICMP checksums use the same algorithm from RFC1071. Thus, it's enough if we give csumip an alias to csumicmp, so that it can be used in trafgen packet configurations. It's calculated from the ICMP header + data, with value 0 for this field. Suggested-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16bpfc: support different output formatsDaniel Borkmann2-22/+80
Add different bpf opcode pretty printer to support a variety of output formats for netsniff-ng, xt_bpf, tcpdump, C-like and make future integration of formats easier. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16docs: AUTHORS: add Peter Stuge for his commitDaniel Borkmann1-0/+1
Since we list all authors for their contributions in the AUTHORS, add Peter Stuge for his improvement on the build system. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16build: respect PREFIX_STRING on config file locationsDaniel Borkmann5-12/+14
When setting a prefix from the build system, also pass this through the hard coded strings for config file locations in the toolkit, so that the installed files (which use PREFIX) can be properly found. Suggested-by: Peter Stuge <peter@stuge.se> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16ring: don't care if we cannot active hw timestampingDaniel Borkmann1-13/+8
Hw timestaming is currently done, if we have the header file from the kernel available. If it fails, we currently bail out, which is bullshit. Just returning is enough, since some users might have the header available, but not a NIC supporting hw timestaming. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16ifpps: remove state from enum, since never usedDaniel Borkmann1-2/+1
We do not assign or use this particular state, so just remove it from the enum. We continue anyway in the while loop in that case. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16hash: simplify code and fix whitespacingDaniel Borkmann1-4/+30
Make whitespacing more uniform to coding conventions and also simplify some fubar if + xfree combinations by using free only. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16misc: remove dead/unreachable code from switch statementsDaniel Borkmann3-6/+0
Remove various unreachable sections from the switch statements. This was detected by the coverty scanner. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16flowtop: rcu: omit rcu_assign_pointerDaniel Borkmann1-4/+3
If the new pointer is NULL anyway, this results in a constant expression during compile time (NULL != NULL) where a barrier is left out. Thus, it will have no different effect using rcu_assign_pointer() than assigning it directly. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16xutils: check various return valuesDaniel Borkmann1-14/+35
Check various setsockopt return values and exit accordingly if some of them just fuck up. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16ring: check return value of setsockoptDaniel Borkmann2-4/+14
If something screws up, which is rather unlikely, but if it happens, let the user know. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16netsniff-ng: if we cannot get intermediate pcap statistics, panicDaniel Borkmann1-1/+5
Before we do calculations on statistics, check if we really got them. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16netsniff-ng trafgen: check return value of pull_and_flush_ringDaniel Borkmann2-2/+24
Let us check the return value when the timer triggers a TX flush request to the kernel. However, ignore the case of BADFS and NOBUFS. The socket could already have been closed before the timer triggers in the first case, and in the second, we just let the next timer continue processing if currently the buffer space is exhausted. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-16astraceroute: fix getnameinfo argumentsDaniel Borkmann1-4/+4
Coverty detected a misuse of the getnameinfo API, thus, we need to fix the length parameter. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>