[netsniff-ng] Re: [PATCH v3 3/3] configure: Add option to compile tools without libnl dependency

2016-08-08 Thread Vadim Kochan
On Mon, Aug 8, 2016 at 5:24 PM, Tobias Klauser wrote: > On 2016-08-06 at 11:59:05 +0200, Vadim Kochan wrote: >> On Sat, Aug 6, 2016 at 12:41 PM, Tobias Klauser wrote: >> > On 2016-08-05 at 22:51:54 +0200, Vadim Kochan wrote: >> >> Hm, >> >> &

[netsniff-ng] trafgen: Would be it useful to have pktgen support ?

2016-08-07 Thread Vadim Kochan
ll be possible to generate only via protocol header functions because with it we have all field metadata. Also when dynamic fields series will be applied it may be possible also convert them to pktgen's rand/inc commands. But again let me know if it might be useful. Regards, Vadim Kocha

[netsniff-ng] Re: [PATCH v3 3/3] configure: Add option to compile tools without libnl dependency

2016-08-06 Thread Vadim Kochan
On Sat, Aug 6, 2016 at 12:41 PM, Tobias Klauser wrote: > On 2016-08-05 at 22:51:54 +0200, Vadim Kochan wrote: >> Hm, >> >> My version was to keep current strict dependency on libnl by default, >> so if there is no libnl then >> netsniff-ng & trafgen will

[netsniff-ng] Re: [PATCH 06/15] trafgen: proto: Randomize proto field at runtime

2016-08-05 Thread Vadim Kochan
On Fri, Aug 05, 2016 at 09:26:24AM +0200, Tobias Klauser wrote: > On 2016-07-26 at 21:35:11 +0200, Vadim Kochan wrote: > > Add dynamic proto field function which can generate > > random value in specified range (default 0 - MAX_UINT32). > > > >

[netsniff-ng] Re: [PATCH 13/15] trafgen: parser: Add support of 'dinc' function for proto fields

2016-08-05 Thread Vadim Kochan
On Wed, Aug 03, 2016 at 04:32:06PM +0200, Tobias Klauser wrote: > On 2016-07-26 at 21:35:18 +0200, Vadim Kochan wrote: > > Add 'dinc()' function in 'field_expr' rules to be used for dynamically > > incrementing of any specified field: > > > > SYNTA

[netsniff-ng] Re: [PATCH 05/15] trafgen: proto: Increment proto field at runtime

2016-08-05 Thread Vadim Kochan
On Wed, Aug 03, 2016 at 04:27:14PM +0200, Tobias Klauser wrote: > On 2016-07-26 at 21:35:10 +0200, Vadim Kochan wrote: > > Extended 'struct packet_dyn' with proto fields which has > > dynamically changing values at runtime. > > > > Implement incrementing of

[netsniff-ng] Re: [PATCH v3 3/3] configure: Add option to compile tools without libnl dependency

2016-08-05 Thread Vadim Kochan
s no libnl then netsniff-ng & trafgen will be added to build list, and will be compiled w/o libnl dependency.. So does --disable-libnl makes sense ? Regards, Vadim Kochan On Fri, Aug 5, 2016 at 12:31 PM, Vadim Kochan wrote: > Sorry for that copy'n'paste ... > > On Fri, Aug

[netsniff-ng] Re: [PATCH 10/15] trafgen: udp: Update csum at runtime if needed

2016-08-05 Thread Vadim Kochan
On Fri, Aug 5, 2016 at 3:26 PM, Tobias Klauser wrote: > On 2016-07-26 at 21:35:15 +0200, Vadim Kochan wrote: >> Update UDP csum field at runtime if: >> >> 1) UDP field was changed. >> >> 2) IPv4/6 source/destination addresses were changed >>

[netsniff-ng] Re: [PATCH v3 3/3] configure: Add option to compile tools without libnl dependency

2016-08-05 Thread Vadim Kochan
Sorry for that copy'n'paste ... On Fri, Aug 5, 2016 at 12:29 PM, Tobias Klauser wrote: > On 2016-08-04 at 18:30:20 +0200, Vadim Kochan wrote: >> Add command line parsing function which allows to compile tools >> (trafgen, netsniff-ng) without libnl-xxx libraries. >

[netsniff-ng] [PATCH v3 2/3] netsniff-ng: Allow compile without libnl

2016-08-04 Thread Vadim Kochan
messages will be sniffed the noop dissector will be used. Signed-off-by: Vadim Kochan --- dissector.h | 4 ++-- dissector_netlink.c | 4 dissector_netlink.h | 4 dissector_sll.c | 5 - netsniff-ng/Makefile | 27 +-- 5 files changed, 31

[netsniff-ng] [PATCH v3 0/3] build: Allow compile trafgen & netsniff-ng without libnl

2016-08-04 Thread Vadim Kochan
quot;configure" options handler code 3) Print "[DISABLED]" if --disable-libnl option choosed when checking libnl 4) Skip compilation part in "configure" script for libnl if it is disabled 5) Added build test with --disabled-libnl in travis script Vadim Kochan (

[netsniff-ng] [PATCH v3 1/3] trafgen: Allow to compile without libnl

2016-08-04 Thread Vadim Kochan
trafgen uses libnl only to inject mac80211 frames but it might be not needed in some embedded or switch environments, so lets make possible to disable this feature. In case if --rfraw option will be used - user will get the panic message. Signed-off-by: Vadim Kochan --- mac80211.c | 1

[netsniff-ng] [PATCH v3 3/3] configure: Add option to compile tools without libnl dependency

2016-08-04 Thread Vadim Kochan
Add command line parsing function which allows to compile tools (trafgen, netsniff-ng) without libnl-xxx libraries. Option --disable-libnl sets CONFIG_LIBNL=0 which means compile tools without libnl dependencies. Signed-off-by: Vadim Kochan --- .travis.yml | 1 + configure | 25

[netsniff-ng] Re: [PATCH v2 0/3] build: Allow compile trafgen & netsniff-ng without libnl

2016-08-04 Thread Vadim Kochan
On Thu, Aug 4, 2016 at 12:19 PM, Tobias Klauser wrote: > On 2016-08-03 at 10:58:00 +0200, Vadim Kochan wrote: >> It might be useful only if to compile trafgen or netsniff-ng in environment >> (or manually w/o needs for rfraw) where is no needed libnl (embedded/switch >> ser

[netsniff-ng] Re: [PATCH v2 1/3] configure: Add option to compile tools without libnl dependency

2016-08-03 Thread Vadim Kochan
Ehh, too fast I need to avoid libnl compilation testing if CONFIG_LIBNL=0, will resend it, sorry ... On Wed, Aug 3, 2016 at 11:58 AM, Vadim Kochan wrote: > Add command line parsing function which allows to compile tools > (trafgen, netsniff-ng) without libnl-xxx libraries. >

[netsniff-ng] [PATCH v2 0/3] build: Allow compile trafgen & netsniff-ng without libnl

2016-08-03 Thread Vadim Kochan
commits to be "configure" related changes 1st 2) Changed CONFIG_NO_LIBNL -> CONFIG_LIBNL 3) Changed "configure" option --no-libnl -> --disable-libnl Tested on the VM Linux setup with and without libnl packages. Vadim Kochan (3): configure: Add option to comp

[netsniff-ng] [PATCH v2 3/3] netsniff-ng: Allow compile without libnl

2016-08-03 Thread Vadim Kochan
messages will be sniffed the noop dissector will be used. Signed-off-by: Vadim Kochan --- dissector.h | 4 ++-- dissector_netlink.c | 4 dissector_netlink.h | 4 dissector_sll.c | 5 - netsniff-ng/Makefile | 27 +-- 5 files changed, 31

[netsniff-ng] [PATCH v2 1/3] configure: Add option to compile tools without libnl dependency

2016-08-03 Thread Vadim Kochan
Add command line parsing function which allows to compile tools (trafgen, netsniff-ng) without libnl-xxx libraries. Option --disable-libnl sets CONFIG_LIBNL=0 which means compile tools without libnl dependencies. Signed-off-by: Vadim Kochan --- configure | 47

[netsniff-ng] [PATCH v2 2/3] trafgen: Allow to compile without libnl

2016-08-03 Thread Vadim Kochan
trafgen uses libnl only to inject mac80211 frames but it might be not needed in some embedded or switch environments, so lets make possible to disable this feature. In case if --rfraw option will be used - user will get the panic message. Signed-off-by: Vadim Kochan --- mac80211.c | 1

[netsniff-ng] Re: [PATCH 1/3] trafgen: Allow to compile without libnl

2016-08-03 Thread Vadim Kochan
OK, thank you! On Wed, Aug 3, 2016 at 10:34 AM, Tobias Klauser wrote: > On 2016-08-02 at 22:17:41 +0200, Vadim Kochan wrote: >> On Tue, Aug 2, 2016 at 11:23 AM, Tobias Klauser wrote: >> > On 2016-07-31 at 23:13:16 +0200, Vadim Kochan wrote: >> >> trafgen uses

[netsniff-ng] Re: [PATCH 04/15] trafgen: proto: Force field id to be index in array

2016-08-02 Thread Vadim Kochan
Yes, bug_on(x) is good point, so I am expecting you will continue review the rest patches ? Thanks, On Tue, Aug 2, 2016 at 6:50 PM, Tobias Klauser wrote: > On 2016-07-26 at 21:35:09 +0200, Vadim Kochan wrote: >> Usually proto fields array is sorted in the same order as related enum,

[netsniff-ng] Re: [PATCH 1/3] trafgen: Allow to compile without libnl

2016-08-02 Thread Vadim Kochan
On Tue, Aug 2, 2016 at 11:23 AM, Tobias Klauser wrote: > On 2016-07-31 at 23:13:16 +0200, Vadim Kochan wrote: >> trafgen uses libnl only to inject mac80211 frames but >> it might be not needed in some embedded or switch environments, >> so lets make possible to disable t

[netsniff-ng] [PATCH 2/3] netsniff-ng: Allow compile without libnl

2016-07-31 Thread Vadim Kochan
netlink messages will be sniffed the noop will be used. Signed-off-by: Vadim Kochan --- dissector.h | 4 ++-- dissector_netlink.c | 4 dissector_netlink.h | 4 dissector_sll.c | 5 - netsniff-ng/Makefile | 27 +-- 5 files changed, 31

[netsniff-ng] [PATCH 1/3] trafgen: Allow to compile without libnl

2016-07-31 Thread Vadim Kochan
trafgen uses libnl only to inject mac80211 frames but it might be not needed in some embedded or switch environments, so lets make possible to disable this feature. In case if --rfraw option will be used - user will get the panic message. Signed-off-by: Vadim Kochan --- mac80211.c | 1

[netsniff-ng] [PATCH 3/3] configure: Add option to compile tools without libnl dependency

2016-07-31 Thread Vadim Kochan
Add command line parsing function which allows to compile tools (trafgen, netsniff-ng) without libnl-xxx libraries. Option --no-libnl sets CONFIG_NO_LIBNL=1. Signed-off-by: Vadim Kochan --- configure | 52 +--- 1 file changed, 49 insertions

[netsniff-ng] [PATCH 0/3] build: Allow compile trafgen & netsniff-ng without libnl

2016-07-31 Thread Vadim Kochan
lmsg dissecting. For example netsniff-ng might be used just for sniffing, and trafgen - send packets to wired network only. Therefor added --no-libnl option in ./confiure script which sets make option & CPP definition which are used to ignore libnl- related code/modules/libraries. Vadim Kochan (3):

[netsniff-ng] Re: [PATCH 00/15] trafgen: Support dinc & drnd for proto fields

2016-07-27 Thread Vadim Kochan
series or after it will be applied. Regards, Vadim Kochan On Tue, Jul 26, 2016 at 10:35 PM, Vadim Kochan wrote: > Implemented 'dinc' and 'drnd' functions to be used for proto fields, > and generate values at runtime. Parsing of proto field values > for unified to make

[netsniff-ng] [PATCH 12/15] trafgen: parser: Unify proto field value parsing

2016-07-26 Thread Vadim Kochan
Changed parsing logic of field value expression to be more generic. Such approach will allow to easy extend field value expression to support dynamic field functions. Signed-off-by: Vadim Kochan --- trafgen_parser.y | 358 +-- trafgen_proto.c

[netsniff-ng] [PATCH 07/15] trafgen: ipv4: Update csum at runtime if needed

2016-07-26 Thread Vadim Kochan
Handle 'field_changed' callback to check if IPv4 csum is needed to be recalculated, if so - update it on 'packet_update' event. Added 'is_csum_valid' to proto_hdr struct to check if csum needs to be updated. Signed-off-by: Vadim Koc

[netsniff-ng] [PATCH 09/15] trafgen: icmpv6: Update csum at runtime if needed

2016-07-26 Thread Vadim Kochan
Use same function to calculate csum for packet_update and for packet_finish events. Allow update csum if one of the ICMPv6 fields was changed. Signed-off-by: Vadim Kochan --- trafgen_l4.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a

[netsniff-ng] [PATCH 15/15] trafgen: man: Add description for 'dinc' and 'drnd' field functions

2016-07-26 Thread Vadim Kochan
Add explanation about 'drnd' and 'dinc' functions which might be used for proto field functions. Signed-off-by: Vadim Kochan --- trafgen.8 | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/trafgen.8 b/trafgen.8 index c95

[netsniff-ng] [PATCH 08/15] trafgen: icmpv4: Update csum at runtime if needed

2016-07-26 Thread Vadim Kochan
Update csum if any of ICMPv4 field was chaned. Signed-off-by: Vadim Kochan --- trafgen_l4.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/trafgen_l4.c b/trafgen_l4.c index 79c5914..19ebb37 100644 --- a/trafgen_l4.c +++ b/trafgen_l4.c @@ -156,25

[netsniff-ng] [PATCH 11/15] trafgen: tcp: Update csum at runtime if it needed

2016-07-26 Thread Vadim Kochan
Update TCP checksum field if any TCP of fields was changed. Use same checksum update function on 'packet_finish' and 'header update'. Set 'is_csum_valid = false' if lower IPv4/IPv6 pseudo header was changed. Signed-off-by: Vadim Kochan --- trafgen_l3.

[netsniff-ng] [PATCH 13/15] trafgen: parser: Add support of 'dinc' function for proto fields

2016-07-26 Thread Vadim Kochan
Add 'dinc()' function in 'field_expr' rules to be used for dynamically incrementing of any specified field: SYNTAX := dinc() | dinc(inc) | dinc(min, max) | dinc(inc, min, max) EXAMPLES: { udp(sport=dinc() } { udp(sport=dinc(1) } { udp(sport=dinc(5, 100, 125) }

[netsniff-ng] [PATCH 14/15] trafgen: parser: Add 'drnd()' function for proto fields

2016-07-26 Thread Vadim Kochan
Add syntax for specify dynamic random function for proto field: drnd() | drnd(min, max) EXAMPLE: { udp(sport=drnd()) } { udp(sport=drnd(1000, 2000)) } Signed-off-by: Vadim Kochan --- trafgen_parser.y | 9 + 1 file changed, 9 insertions(+) diff --git a/trafgen_parser.y b

[netsniff-ng] [PATCH 10/15] trafgen: udp: Update csum at runtime if needed

2016-07-26 Thread Vadim Kochan
header faster, the reason is that this function is used for updating UDP csum. Signed-off-by: Vadim Kochan --- trafgen_l3.c| 18 ++ trafgen_l4.c| 37 + trafgen_proto.c | 36 +++- trafgen_proto.h | 2

[netsniff-ng] [PATCH 06/15] trafgen: proto: Randomize proto field at runtime

2016-07-26 Thread Vadim Kochan
Add dynamic proto field function which can generate random value in specified range (default 0 - MAX_UINT32). Signed-off-by: Vadim Kochan --- trafgen_proto.c | 29 + trafgen_proto.h | 1 + 2 files changed, 30 insertions(+) diff --git a/trafgen_proto.c b

[netsniff-ng] [PATCH 03/15] trafgen: proto: Move proto headers into packet

2016-07-26 Thread Vadim Kochan
Till now headers were used only for packet creation at compile time only, which does not allow to handle dynamic fields update at runtime. It needs that proto_hdr entries will be not freed after compile is done. Signed-off-by: Vadim Kochan --- trafgen_conf.h | 6 ++ trafgen_parser.y | 17

[netsniff-ng] [PATCH 02/15] trafgen: proto: Reference to packet from proto_hdr struct

2016-07-26 Thread Vadim Kochan
Using of current_packet() is not relevant for dynamically updated fields so lets keep packet index in proto_hdr struct. Signed-off-by: Vadim Kochan --- trafgen_conf.h | 2 ++ trafgen_parser.y | 10 ++ trafgen_proto.c | 13 +++-- trafgen_proto.h | 4 4 files changed

[netsniff-ng] [PATCH 01/15] trafgen: Move applying dynamic elements to function

2016-07-26 Thread Vadim Kochan
Same code for applying dynamic elements is used in both places for slow & fast path modes, lets move them into one inlined function. Signed-off-by: Vadim Kochan --- trafgen.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/trafgen.c b/trafg

[netsniff-ng] [PATCH 04/15] trafgen: proto: Force field id to be index in array

2016-07-26 Thread Vadim Kochan
Usually proto fields array is sorted in the same order as related enum, so id may be used as index for faster lookup, it will make csum field calculation little faster at runtime. Signed-off-by: Vadim Kochan --- trafgen_l3.h| 4 ++-- trafgen_proto.c | 8 +--- 2 files changed, 3

[netsniff-ng] [PATCH 00/15] trafgen: Support dinc & drnd for proto fields

2016-07-26 Thread Vadim Kochan
ield lookup logic to make field set/get operations a little bit faster by using field id as index in the array, as usually fields are defined regarding its index. Example: { eth(sa=11:22:33:44:55:66, sa=dinc()), udp(sp=drnd(), dp=drnd()) } Vadim Kochan (15): trafgen: Move applying dynamic

[netsniff-ng] [PATCH 05/15] trafgen: proto: Increment proto field at runtime

2016-07-26 Thread Vadim Kochan
proto header know when to apply final proto header changes at runtime (csum update). Signed-off-by: Vadim Kochan --- trafgen.c | 9 ++ trafgen_conf.h | 7 trafgen_proto.c | 99 + trafgen_proto.h | 26 +++ 4 fi

[netsniff-ng] [PATCH 2/2] trafgen: udp: Do not use 'len' field when calculate csum

2016-07-16 Thread Vadim Kochan
Do not use user specified LEN field for csum calculation which is quite dangerous. Signed-off-by: Vadim Kochan --- trafgen_l4.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/trafgen_l4.c b/trafgen_l4.c index c109675..79c5914 100644 --- a/trafgen_l4.c +++ b/trafgen_l4.c @@ -44,8 +44,6

[netsniff-ng] [PATCH 1/2] trafgen: ipv4: Do not use 'ihl' field when calculate csum

2016-07-16 Thread Vadim Kochan
It is totally wrong to use user specified IHL field for csum calculation which might lead to unexpectable cases. So use new 'hdr->len' field which is calculated automatically after when header is built. Signed-off-by: Vadim Kochan --- trafgen_l3.c| 4 +--- trafge

[netsniff-ng] [PATCH 0/2] trafgen: Avoid to use user defined fields for csum

2016-07-16 Thread Vadim Kochan
It is dangerous to use such fields like 'ihl' and 'len' when calculate csum for IPv4 & UDP headers because these fields are set from user. Instead - use program calculated values. Vadim Kochan (2): trafgen: ipv4: Do not use 'ihl' field when calculate csum tr

[netsniff-ng] [PATCH] trafgen: ipv4: Set default proto as ipv6-in-ipv4 for ipv6()

2016-07-15 Thread Vadim Kochan
Set default ip proto field to IPPROTO_IPV6(41) if the higher protocol was specified as ipv6(). Signed-off-by: Vadim Kochan --- trafgen_l3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trafgen_l3.c b/trafgen_l3.c index ae3f136..012321f 100644 --- a/trafgen_l3.c +++ b/trafgen_l3.c

[netsniff-ng] Re: [PATCH] trafgen: l3: ipv4: Set default proto=0x41 for ipv6()

2016-07-15 Thread Vadim Kochan
On Fri, Jul 15, 2016 at 11:11 PM, Vadim Kochan wrote: > Set default ip proto field to IPPROTO_IPV6(0x41) if the higher protocol > was specified as ipv6(). > > Signed-off-by: Vadim Kochan > --- > trafgen_l3.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/

[netsniff-ng] [PATCH] trafgen: l3: ipv4: Set default proto=0x41 for ipv6()

2016-07-15 Thread Vadim Kochan
Set default ip proto field to IPPROTO_IPV6(0x41) if the higher protocol was specified as ipv6(). Signed-off-by: Vadim Kochan --- trafgen_l3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trafgen_l3.c b/trafgen_l3.c index ae3f136..012321f 100644 --- a/trafgen_l3.c +++ b/trafgen_l3.c

[netsniff-ng] [PATCH v2 0/3] trafgen: Implement ICMPv4 packet creation - part #2

2016-07-12 Thread Vadim Kochan
quot; sign 2) Removed keywords with special icmpv4 message type parameters except MTU & Address. Vadim Kochan (3): trafgen: l3: Add creating ICMPv4 header trafgen: parser: Add function to build ICMPv4 header trafgen: man: Add description for icmpv4() function trafgen

[netsniff-ng] [PATCH v2 1/3] trafgen: l3: Add creating ICMPv4 header

2016-07-12 Thread Vadim Kochan
Signed-off-by: Vadim Kochan --- trafgen_l3.c| 3 +++ trafgen_l4.c| 42 ++ trafgen_l4.h| 10 ++ trafgen_proto.h | 1 + 4 files changed, 56 insertions(+) diff --git a/trafgen_l3.c b/trafgen_l3.c index cbdbe6c..ae3f136 100644 --- a/traf

[netsniff-ng] [PATCH v2 3/3] trafgen: man: Add description for icmpv4() function

2016-07-12 Thread Vadim Kochan
Add description icmpv4() function parameters with few examples. Signed-off-by: Vadim Kochan --- trafgen.8 | 44 1 file changed, 44 insertions(+) diff --git a/trafgen.8 b/trafgen.8 index b011276..e654770 100644 --- a/trafgen.8 +++ b/trafgen.8

[netsniff-ng] [PATCH v2 2/3] trafgen: parser: Add function to build ICMPv4 header

2016-07-12 Thread Vadim Kochan
0) seq Set sequence field (default 0) idSet identifier field (default 0) addr Set redirect address (default 0) Example: Send Ping request: { icmpv4(echorequest, seq=1, id=1326) } Signed-off-by: Vadim Kochan --- trafgen_lexer.l | 6 ++ trafgen_par

[netsniff-ng] Re: [PATCH 5/6] trafgen: parser: Add function to build ICMPv4 header

2016-07-11 Thread Vadim Kochan
On Mon, Jul 11, 2016 at 11:10 AM, Tobias Klauser wrote: > On 2016-04-30 at 16:39:19 +0200, Vadim Kochan wrote: >> Add 'icmpv4()' function to create ICMPv4 header. >> >> Parameters suported: >> >> type Set type field (default 0: Echo reply)

[netsniff-ng] Re: [PATCH] netsniff-ng: Create out pcap only if first packet passed

2016-06-29 Thread Vadim Kochan
On Mon, May 16, 2016 at 7:58 PM, Vadim Kochan wrote: > If all packets did not pass the filter then output pcap > file will be created with pcap header, which might be not what user > expect - to see only interested pcap files. > > Signed-off-by: Vadim Kochan > --- >

[netsniff-ng] Re: [PATCH 0/6] trafgen: Implement ICMPv4 packet creation

2016-06-29 Thread Vadim Kochan
Hi Tobias, On Sat, Apr 30, 2016 at 6:01 PM, Tobias Klauser wrote: > Hi Vadim > > Thanks for the series. I'll be travelling for a while starting tomorrow, > so it will probably take a while until I get to review the patches. > > Thanks > Tobias Will you look on this series ? Regards, -- You r

[netsniff-ng] Re: [PATCH] netsniff-ng: pcap_io: Print unsupported magic number

2016-06-22 Thread Vadim Kochan
Hi Tobias, On Wed, Jun 22, 2016 at 10:25 AM, Tobias Klauser wrote: > On 2016-05-16 at 19:32:46 +0200, Vadim Kochan wrote: >> It might be more understandable to print unsupported >> pcap magic number in hexadecimal format. >> >> Signed-off-by: Vadim Kochan > > A

[netsniff-ng] [PATCH] netsniff-ng: pcap_io: Print unsupported magic number

2016-05-16 Thread Vadim Kochan
It might be more understandable to print unsupported pcap magic number in hexadecimal format. Signed-off-by: Vadim Kochan --- pcap_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcap_io.h b/pcap_io.h index 5056e58..4e41362 100644 --- a/pcap_io.h +++ b/pcap_io.h

[netsniff-ng] [PATCH] netsniff-ng: Create out pcap only if first packet passed

2016-05-16 Thread Vadim Kochan
If all packets did not pass the filter then output pcap file will be created with pcap header, which might be not what user expect - to see only interested pcap files. Signed-off-by: Vadim Kochan --- netsniff-ng.c | 33 + 1 file changed, 21 insertions(+), 12

[netsniff-ng] [PATCH 2/6] trafgen: parser: Replace 'mtype' by 'type'

2016-04-30 Thread Vadim Kochan
After splitting etype & type to different tokens it is possible to use 'type' for ICMP type field which is used by RFC. Signed-off-by: Vadim Kochan --- trafgen.8| 4 ++-- trafgen_lexer.l | 1 - trafgen_parser.y | 8 3 files changed, 6 insertions(+), 7 deletions(

[netsniff-ng] [PATCH 6/6] trafgen: man: Add description for icmpv4() function

2016-04-30 Thread Vadim Kochan
Add description icmpv4() function parameters with few examples. Signed-off-by: Vadim Kochan --- trafgen.8 | 118 ++ 1 file changed, 118 insertions(+) diff --git a/trafgen.8 b/trafgen.8 index 6691e16..6be6f1c 100644 --- a/trafgen.8

[netsniff-ng] [PATCH 3/6] trafgen: parser: Split echorequest & echoreply with "-"

2016-04-30 Thread Vadim Kochan
Change echorequest to echo-request, and echoreply to echo-reply which looks more readable. Signed-off-by: Vadim Kochan --- trafgen.8 | 6 +++--- trafgen_lexer.l | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/trafgen.8 b/trafgen.8 index b011276..6691e16 100644

[netsniff-ng] [PATCH 0/6] trafgen: Implement ICMPv4 packet creation

2016-04-30 Thread Vadim Kochan
-tos-redirect ttl-timeout frag-timeout Vadim Kochan (6): trafgen: parser: Split [e]type to separate keywords trafgen: parser: Replace 'mtype' by 'type' trafgen: parser: Split echorequest & echoreply with "-" trafgen: l3: Add creating ICMPv4 header

[netsniff-ng] [PATCH 4/6] trafgen: l3: Add creating ICMPv4 header

2016-04-30 Thread Vadim Kochan
ddress Signed-off-by: Vadim Kochan --- trafgen_l3.c| 3 +++ trafgen_l4.c| 42 ++ trafgen_l4.h| 10 ++ trafgen_proto.h | 1 + 4 files changed, 56 insertions(+) diff --git a/trafgen_l3.c b/trafgen_l3.c index cbdbe6c..ae3f136 100644 ---

[netsniff-ng] [PATCH 1/6] trafgen: parser: Split [e]type to separate keywords

2016-04-30 Thread Vadim Kochan
Split [e]etype to separate 'type' & 'etype' keywords, the reason is that 'type' might be used in other protocol headers (e.g. ICMP). Signed-off-by: Vadim Kochan --- trafgen_lexer.l | 3 ++- trafgen_parser.y | 3 ++- 2 files changed, 4 insertions(+), 2 deletion

[netsniff-ng] [PATCH 5/6] trafgen: parser: Add function to build ICMPv4 header

2016-04-30 Thread Vadim Kochan
meout Set 'TTL expired in transit' message type frag-timeoutSet 'Fragment reassembly time exceeded' message type Examples: a) Send Ping request: { icmpv4(echo-request, seq=1, id=1326) } b) Send ICMPv4 &#

[netsniff-ng] Re: flowtop: How should be src info printed in stdout dump mode

2016-04-26 Thread Vadim Kochan
On Tue, Apr 26, 2016 at 12:00 PM, Tobias Klauser wrote: > On 2016-04-26 at 10:47:18 +0200, Vadim Kochan wrote: >> On Tue, Apr 26, 2016 at 10:30:19AM +0200, Tobias Klauser wrote: >> > On 2016-04-25 at 16:55:53 +0200, Vadim Kochan wrote: >> > > On Mon, Apr 25, 20

[netsniff-ng] Re: flowtop: How should be src info printed in stdout dump mode

2016-04-26 Thread Vadim Kochan
On Tue, Apr 26, 2016 at 10:30:19AM +0200, Tobias Klauser wrote: > On 2016-04-25 at 16:55:53 +0200, Vadim Kochan wrote: > > On Mon, Apr 25, 2016 at 11:21:57AM +0200, Tobias Klauser wrote: > > > On 2016-04-22 at 23:53:01 +0200, Vadim Kochan wrote: > > > > Hi, > &

[netsniff-ng] [PATCH 3/8] ui: Print "*" for empty or NULL column values

2016-04-26 Thread Vadim Kochan
It is better to fill the empty columns for visualization, so its easier identify the whole line. Signed-off-by: Vadim Kochan --- ui.c | 18 +- ui.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ui.c b/ui.c index cfa1471..9f0a0e0 100644 --- a/ui.c +++ b

[netsniff-ng] [PATCH 8/8] flowtop: man: Add description for -d,--dump option

2016-04-26 Thread Vadim Kochan
Add short description for -d,--dump option, and also update description for -t,--interval option which might be used together with -d option. Signed-off-by: Vadim Kochan --- flowtop.8 | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/flowtop.8 b/flowtop.8 index

[netsniff-ng] [PATCH 4/8] flowtop: Print "-->" before dst peer in src mode

2016-04-26 Thread Vadim Kochan
"-->" allows to better separate src & dst peers. Signed-off-by: Vadim Kochan --- flowtop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowtop.c b/flowtop.c index 20b3c25..ab3459a 100644 --- a/flowtop.c +++ b/flowtop.c @@ -1020,6 +1020,8 @@ static void draw_flow_

[netsniff-ng] [PATCH 0/8] flowtop: Dump flows to stdout

2016-04-26 Thread Vadim Kochan
able was changed to be more generic used in both curses & stdout modes, I think it would be good to make it generate CSV/JSON format in similar usage. Vadim Kochan (8): ui: Use custom print function ui: Allow to use stdout or curses UI output mode ui: Print "*" for empty or

[netsniff-ng] [PATCH 7/8] flowtop: Add command-line option to dump flows to stdout

2016-04-26 Thread Vadim Kochan
ut only for delay to collect such dynamic info like rate. By default interval set to 0 if --dump option is selected. Signed-off-by: Vadim Kochan --- flowtop.c | 134 -- 1 file changed, 113 insertions(+), 21 deletions(-) diff --git a/f

[netsniff-ng] [PATCH 2/8] ui: Allow to use stdout or curses UI output mode

2016-04-26 Thread Vadim Kochan
It allows to initialize UI with specific output type and use same functionality for the output. Signed-off-by: Vadim Kochan --- ui.c | 52 +++- ui.h | 7 +++ 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/ui.c b/ui.c index

[netsniff-ng] [PATCH 5/8] flowtop: Remove unused args in draw_flow_entry(...)

2016-04-26 Thread Vadim Kochan
Remove unused "screen" & "line" arguments in draw_flow_entry(...) function. Signed-off-by: Vadim Kochan --- flowtop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowtop.c b/flowtop.c index ab3459a..cbd5a33 100644 --- a/flowtop.c +++ b/fl

[netsniff-ng] [PATCH 6/8] flowtop: Move curses drawing to separate function

2016-04-26 Thread Vadim Kochan
Move curses related drawing to separate function. Similary there will be stdout drawing function. Signed-off-by: Vadim Kochan --- flowtop.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/flowtop.c b/flowtop.c index cbd5a33..65a8ad4 100644 --- a/flowtop.c

[netsniff-ng] [PATCH 1/8] ui: Use custom print function

2016-04-26 Thread Vadim Kochan
Use custom defined ui_print_yx macro to print text to screen. This is just small preparation to unify printing in STDOUT & CURSES modes. Signed-off-by: Vadim Kochan --- ui.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ui.c b/ui.c index 46062d4..bc9

[netsniff-ng] Re: flowtop: How should be src info printed in stdout dump mode

2016-04-25 Thread Vadim Kochan
On Mon, Apr 25, 2016 at 11:21:57AM +0200, Tobias Klauser wrote: > On 2016-04-22 at 23:53:01 +0200, Vadim Kochan wrote: > > Hi, > > > > I am thinking about to add dump of flows to stdout. It seems OK if > > to use similar table format like in curses mode by default,

[netsniff-ng] flowtop: How should be src info printed in stdout dump mode

2016-04-22 Thread Vadim Kochan
his is just for external text processing. Also may be it would be useful to print empty columns with "*" or "-" it will be more visually readable (probably in curses mode too) and also be processed by awk. Regards, Vadim Kochan -- You received this message because you are s

[netsniff-ng] [PATCH] flowtop: man: Add how-to activate conntrack by modprobe

2016-04-21 Thread Vadim Kochan
Add another tip how to activate conntrack mechanism by loading required kernel modules via modprobe. This info might be used to make these modules load automatically at startup. Signed-off-by: Vadim Kochan --- flowtop.8 | 8 1 file changed, 8 insertions(+) diff --git a/flowtop.8 b

[netsniff-ng] [PATCH] flowtop: Fix compilation error when build without geoip

2016-04-21 Thread Vadim Kochan
Config file. Fixes: f61f39d (geoip: Allow to get country 3-code) Reported-by: Daniel Borkmann Signed-off-by: Vadim Kochan --- geoip.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/geoip.h b/geoip.h index 0cbd619..5d5c221 100644 --- a/geoip.h +++ b/geoip.h @@ -104,6 +104,16

[netsniff-ng] [PATCH v3 6/6] flowtop: Simplify flows refresh delay

2016-04-21 Thread Vadim Kochan
Simplify screen refresh logic by removing tricky delay logic which freezes a little key pressing. Signed-off-by: Vadim Kochan --- flowtop.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/flowtop.c b/flowtop.c index 3628d39..20b3c25 100644 --- a

[netsniff-ng] [PATCH v3 4/6] ui: Print empty rows when clear table

2016-04-21 Thread Vadim Kochan
Fill table with empty rows while clearing. It will allow to get rid of clear() & refresh() each time before print the flows list. Signed-off-by: Vadim Kochan --- ui.c | 12 ui.h | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ui.c b/ui.c index 80b

[netsniff-ng] [PATCH v3 0/6] flowtop: Layout change to 1-row view (part #2)

2016-04-21 Thread Vadim Kochan
Linux naming. 3) Get rid of clear & refresh screen each time while flows printing. Vadim Kochan (6): list: Add re-defined double-linked list API from liburcu ui: Implement UI table for flows printing flowtop: Use new UI table API for draw flows list ui: Print empty rows when c

[netsniff-ng] [PATCH v3 2/6] ui: Implement UI table for flows printing

2016-04-21 Thread Vadim Kochan
Add new module ui.c which is responsible to render different kinds of UI widgets - tables, etc. Implemented generic API for print table-like list of elements. This table API might be used for print flows in curses or text mode. Signed-off-by: Vadim Kochan --- ui.c | 141

[netsniff-ng] [PATCH v3 3/6] flowtop: Use new UI table API for draw flows list

2016-04-21 Thread Vadim Kochan
Used new UI table API for flows printing to make it more generic. Also it will allow to have same code to dump flows in text mode. Signed-off-by: Vadim Kochan --- flowtop.c| 245 +++ flowtop/Makefile | 1 + 2 files changed, 141

[netsniff-ng] [PATCH v3 5/6] flowtop: Get rid of clear() & refresh() calls

2016-04-21 Thread Vadim Kochan
Don't use refresh() & clear() as we draw entire screen and flows table will be filled with empty rows. Signed-off-by: Vadim Kochan --- flowtop.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/flowtop.c b/flowtop.c index 32459aa..3628d39 100644 --- a/

[netsniff-ng] [PATCH v3 1/6] list: Add re-defined double-linked list API from liburcu

2016-04-21 Thread Vadim Kochan
Add definitions for list structure & functions without cds_/CDS_ prefix. The purpose of this change is to use such linked-list in sorting or ordering some kind of items (e.g. flowtop - flows, columns). Signed-off-by: Vadim Kochan --- list.h | 39 +++ 1

[netsniff-ng] Re: [PATCH v2 07/11] ui: Implement UI table for flows printing

2016-04-21 Thread Vadim Kochan
On Thu, Apr 21, 2016 at 2:53 PM, Tobias Klauser wrote: > On 2016-04-17 at 19:31:30 +0200, Vadim Kochan wrote: >> Add new module ui.c which is responsible to render >> different kinds of UI widgets - tables, etc. >> >> Implemented generic API for print table-like list

[netsniff-ng] Re: [PATCH v2 00/11] flowtop: Layout change to 1-row view

2016-04-21 Thread Vadim Kochan
You can still review the rest patches except last 2 ones, in case if you catch some issues, so I will include them in v3 series, if it is OK for you. Thanks, On Thu, Apr 21, 2016 at 12:52 PM, Tobias Klauser wrote: > On 2016-04-17 at 19:31:23 +0200, Vadim Kochan wrote: >> Changed f

[netsniff-ng] Re: [PATCH v2 10/11] flowtop: Get rid of clear() & refresh() calls

2016-04-21 Thread Vadim Kochan
On Sun, Apr 17, 2016 at 8:31 PM, Vadim Kochan wrote: > Don't use refresh() & clear() as we draw entire screen > and flows table will be filled with empty rows. > > Signed-off-by: Vadim Kochan > --- > flowtop.c | 11 --- > 1 file changed, 4 insertions(+), 7

[netsniff-ng] Re: [PATCH 2/5] flowtop: Change flows layout to 1-row view

2016-04-19 Thread Vadim Kochan
On Sun, Apr 17, 2016 at 6:24 PM, Tobias Klauser wrote: > On 2016-04-17 at 09:06:35 +0200, Vadim Kochan wrote: >> Hi, >> >> I prepared new series for flowtop, I changed state names to this: >> >> static const char *cons

[netsniff-ng] [PATCH v2 10/11] flowtop: Get rid of clear() & refresh() calls

2016-04-17 Thread Vadim Kochan
Don't use refresh() & clear() as we draw entire screen and flows table will be filled with empty rows. Signed-off-by: Vadim Kochan --- flowtop.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/flowtop.c b/flowtop.c index 32459aa..3060917 100644 --- a/

[netsniff-ng] [PATCH v2 11/11] flowtop: Simplify flows refresh delay

2016-04-17 Thread Vadim Kochan
Simplify screen refresh logic by removing tricky delay logic which freezes a little key pressing. Signed-off-by: Vadim Kochan --- flowtop.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/flowtop.c b/flowtop.c index 3060917..2077fdb 100644 --- a

[netsniff-ng] [PATCH v2 09/11] ui: Print empty rows when clear table

2016-04-17 Thread Vadim Kochan
Fill table with empty rows while clearing. It will allow to get rid of clear() & refresh() each time before print the flows list. Signed-off-by: Vadim Kochan --- ui.c | 18 ++ ui.h | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ui.c b/ui.c i

[netsniff-ng] [PATCH v2 08/11] flowtop: Use new UI table API for draw flows list

2016-04-17 Thread Vadim Kochan
Used new UI table API for flows printing to make it more generic. Also it will allow to have same code to dump flows in text mode. Signed-off-by: Vadim Kochan --- flowtop.c| 245 +++ flowtop/Makefile | 1 + 2 files changed, 141

[netsniff-ng] [PATCH v2 00/11] flowtop: Layout change to 1-row view

2016-04-17 Thread Vadim Kochan
table style. Add new UI module with generic table API. 2) Add Linux-like list API used from liburcu but with redefinitions to the Linux naming. 3) Get rid of clear & refresh screen each time while flows printing. Vadim Kochan (11): geoip: Allow to get country 3-

[netsniff-ng] [PATCH v2 04/11] screen: Add helpers to easy use color by name

2016-04-17 Thread Vadim Kochan
Added macros which allow easy specify color pair like: INIT_COLOR(YELLOW, BLACK); COLOR(YELLOW, BLACK); COLOR_ON(YELLOW, BLACK); by calculating pair id via generic formula. Added shorter color names via new enum. Signed-off-by: Vadim Kochan --- screen.h | 17 + 1

[netsniff-ng] [PATCH v2 05/11] flowtop: Use new colors naming & helpers

2016-04-17 Thread Vadim Kochan
Use new colors definitions via enum variables instead of numbers which helps to undrerstand better which kind of color is used. Signed-off-by: Vadim Kochan --- flowtop.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/flowtop.c b

[netsniff-ng] [PATCH v2 07/11] ui: Implement UI table for flows printing

2016-04-17 Thread Vadim Kochan
Add new module ui.c which is responsible to render different kinds of UI widgets - tables, etc. Implemented generic API for print table-like list of elements. This table API might be used for print flows in curses or text mode. Signed-off-by: Vadim Kochan --- ui.c | 142

<    1   2   3   4   5   6   7   8   >