summaryrefslogtreecommitdiff
path: root/trafgen_dev.c
AgeCommit message (Collapse)AuthorFilesLines
2017-07-17trafgen: Delegate creation of rfraw to dev_io APIVadim Kochan1-1/+34
Simplify a bit of creation rfraw device by delegating it to the dev_io API, also in case the output device is pcap file the --rfraw option sets the link type to ieee80211 radio tap. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2017-06-19trafgen: Fix output pcap file name length trimmingVadim Kochan1-1/+2
Trim output name to IFNAMSIZ only if the output is a networking device, otherwise the following error occured if output name is greater then IFNAMSIZ: $ trafgen -n 1 '{ udp() }' -o /tmp/xxxxxxxxxxxxxx.pcap No networking device or pcap file: /tmp/xxxxxxxxxx Failed to open output device Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2017-06-09trafgen: Allow to generate packets to output pcap fileVadim Kochan1-0/+258
Add trafgen_dev.c module which provides generic way of reading and writing packets to/from networking device or a pcap file. Also allow to handle output pcap file via '-o, --out, --dev' option. It might be useful in future for testing some link protocols which is not easy to capture (e.g. wlan packets) w/o having some special setup. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> [tklauser: fix whitespace issues] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>