[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 <vadi...@gmail.com> --- trafgen.8 | 118 ++ 1 file changed, 118 insertions(+) diff --git a/trafgen.8 b/trafgen.8 index 6691e16..6be6f1c

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

2016-04-30 Thread Vadim Kochan
gned-off-by: Vadim Kochan <vadi...@gmail.com> --- 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..ae3f

[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 <vadi...@gmail.com> --- trafgen_lexer.l | 3 ++- trafgen_parser.y | 3 ++- 2 files changed, 4 insertions(+), 2 deletion

[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 <vadi...@gmail.com> --- 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

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

2016-04-26 Thread Vadim Kochan
to collect such dynamic info like rate. By default interval set to 0 if --dump option is selected. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- flowtop.c | 134 -- 1 file changed, 113 insertions(+), 21 deletions(-) diff

[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 <vadi...@gmail.com> --- flowtop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowtop.c b/flowtop.c index ab3459a..cbd5a33 100644 -

[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 <vadi...@gmail.com> --- flowtop.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/flowtop.c b/flowtop.c index cbd5a33..6

[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 <vadi...@gmail.com> --- ui.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ui.c b/

[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 <vadi...@gmail.com> --- flowtop.8 | 8 1 file changed, 8 insertions(+)

[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 <tklau...@distanz.ch> wrote: > On 2016-04-17 at 19:31:23 +0200, Vadim Koc

[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 <vadi...@gmail.com> --- flowtop.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/flowtop.c b/flowtop.c index 3060917..2

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

2016-04-17 Thread Vadim Kochan
in 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 <vadi...@gmail.com> --- screen.

[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 <vadi...@gmail.com> --- flowtop.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-)

[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 <vadi...@gmail.com> --- ui.c

[netsniff-ng] [PATCH v2 06/11] list: Add re-defined double-linked list API from liburcu

2016-04-17 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 <vadi...@gmail.com> --- l

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

2016-04-17 Thread Vadim Kochan
On Tue, Mar 29, 2016 at 03:38:58PM +0200, Tobias Klauser wrote: > On 2016-03-29 at 15:32:43 +0200, Vadim Kochan <vadi...@gmail.com> wrote: > > On Tue, Mar 29, 2016 at 4:23 PM, Tobias Klauser <tklau...@distanz.ch> wrote: > > > On 2016-03-23 at 22:00:44 +0100, Vadim Ko

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

2016-03-29 Thread Vadim Kochan
On Tue, Mar 29, 2016 at 4:23 PM, Tobias Klauser <tklau...@distanz.ch> wrote: > On 2016-03-23 at 22:00:44 +0100, Vadim Kochan <vadi...@gmail.com> wrote: >> Changed flows list layout to look more a top-like output >> with header and in 1 line. When -s option is specified

[netsniff-ng] [PATCH 4/5] screen: Add helpers to easy use color by name

2016-03-23 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 <vadi...@gmail.com> --- screen.

[netsniff-ng] [PATCH 0/5] flowtop: Layout change to 1-row view

2016-03-23 Thread Vadim Kochan
unit. Vadim Kochan (5): geoip: Allow to get country 3-code flowtop: Change flows layout to 1-row view flowtop: Add display option to show src info screen: Add helpers to easy use color by name flowtop: Use new colors naming & helpers flowtop.c |

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

2016-03-23 Thread Vadim Kochan
unit. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- flowtop.c | 405 ++ 1 file changed, 194 insertions(+), 211 deletions(-) diff --git a/flowtop.c b/flowtop.c index 4c15c06..8201321 100644 --- a/flowtop.c +++ b/flowtop.c @@

[netsniff-ng] [PATCH 1/5] geoip: Allow to get country 3-code

2016-03-23 Thread Vadim Kochan
Add func to get country code-3 name by IPv4/6 address Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- geoip.c | 14 ++ geoip.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/geoip.c b/geoip.c index ee654a6..917b1a7 100644 --- a/geoip.c +++ b/geoip.c @@ -339,6 +

[netsniff-ng] [PATCH 5/5] flowtop: Use new colors naming & helpers

2016-03-23 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 <vadi...@gmail.com> --- flowtop.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-)

[netsniff-ng] [PATCH 3/5] flowtop: Add display option to show src info

2016-03-23 Thread Vadim Kochan
Add 's' key option to toggle source peer info at runtime, behaviour is the same like for '-s' command line option. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- flowtop.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/flowtop.c b/flowtop.c

[netsniff-ng] Re: flowtop: Flows visual separating

2016-02-26 Thread Vadim Kochan
On Fri, Feb 26, 2016 at 10:58 AM, Tobias Klauser <tklau...@distanz.ch> wrote: > On 2016-02-25 at 17:35:56 +0100, Vadim Kochan <vadi...@gmail.com> wrote: >> On Sat, Feb 20, 2016 at 8:47 PM, Vadim Kochan <vadi...@gmail.com> wrote: >> > On Sat, Feb 20, 201

[netsniff-ng] Re: [PATCH v2 0/4] trafgen: Add MPLS header creating

2016-02-23 Thread Vadim Kochan
Thanks! So icmpv4 will appear in next version, I have patches but need to rebase them. On Tue, Feb 23, 2016 at 2:32 PM, Tobias Klauser <tklau...@distanz.ch> wrote: > On 2016-02-08 at 07:01:50 +0100, Vadim Kochan <vadi...@gmail.com> wrote: >> Add 'mpls()' function

[netsniff-ng] Re: flowtop: Flows visual separating

2016-02-20 Thread Vadim Kochan
On Sat, Feb 20, 2016 at 7:49 PM, Daniel Borkmann <borkm...@iogearbox.net> wrote: > Hi Vadim, > > thanks for looking into this, appreciate it! > > On 02/20/2016 03:28 PM, Vadim Kochan wrote: >> >> On Sat, Feb 20, 2016 at 1:25 AM, Vadim Kochan <vadi...@gmail.com

[netsniff-ng] Re: flowtop: Flows visual separating

2016-02-20 Thread Vadim Kochan
On Sat, Feb 20, 2016 at 1:25 AM, Vadim Kochan <vadi...@gmail.com> wrote: > Hi, > > I tried to come up with visual separating of printed flows as currently > its not easy to identify separate flow entry, so I did some changes and > I am not sure if it looks good so I a

Re: [netsniff-ng] netsniff-ng output file name by date

2016-02-19 Thread Vadim Kochan
t get > why? > > 2016 m. vasaris 19 d., penktadienis 01:36:41 UTC+2, Vadim Kochan rašė: >> >> Hm, well we can do similary like tcpdump does - try to strftime output >> pcap file name if -F is specified. >> >> Lets see what Tobias or Daniel may suggest. >

[netsniff-ng] [PATCH v2 3/4] trafgen: parser: Add syntax for MPLS header creating

2016-02-07 Thread Vadim Kochan
, but multicast might be set via 'eth()' function. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 7 +++ trafgen_parser.y | 34 +- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/trafgen_lexer.l b/trafgen_lexer.l index e

[netsniff-ng] [PATCH v2 1/4] trafgen: proto: Fix bad field masking

2016-02-07 Thread Vadim Kochan
alue is reset to 0s and only after OR-ed with specified shift-masked value. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_proto.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/trafgen_proto.c b/trafgen_proto.c index efa8fce..2145

[netsniff-ng] [PATCH 3/4] trafgen: parser: Add syntax for MPLS header creating

2016-02-03 Thread Vadim Kochan
, but multicast might be set via 'eth()' function. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 6 ++ trafgen_parser.y | 29 - 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/trafgen_lexer.l b/trafgen_lexer.l index e1d1a3f..5

[netsniff-ng] [PATCH 4/4] trafgen: man: Add description for 'mpls()' function

2016-02-03 Thread Vadim Kochan
Add syntax & fields description for 'mpls()' function, also: 1) add line break for VLAN header notes 2) fixed ip -> ipv4 in UDP echo example Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen.8 | 29 +++-- 1 file changed, 27 ins

[netsniff-ng] [PATCH 2/4] trafgen: l2: Add MPLS header generation

2016-02-03 Thread Vadim Kochan
Add support for MPLS header creating with fields: Label, TClass, Bottom-Stack, TTL By default S-field is set to 1 (last label), but resets to 0 if lower MPLS header is added. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_l2.c

[netsniff-ng] [PATCH 1/4] trafgen: proto: Fix bad field masking

2016-02-03 Thread Vadim Kochan
alue is reset to 0s and only after OR-ed with specified shift-masked value. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_proto.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/trafgen_proto.c b/trafgen_proto.c index efa8fce..2145

[netsniff-ng] [PATCH 0/4] trafgen: Add MPLS header creating

2016-02-03 Thread Vadim Kochan
ader was added. Small additional fixes in trafgen.8 file like: 1) Changed ip -> ipv4 in UDP Echo example 2) Add line break for VLAN section in sentence about EtherType. Vadim Kochan (4): trafgen: proto: Fix bad field masking trafgen: l2: Add MPLS header generation trafgen: parser: Add

[netsniff-ng] [PATCH 3/7] trafgen: eth: Add setting next protocol id

2016-02-01 Thread Vadim Kochan
Move setting next protocol id field from higher protocols (ARP, IPv4) to Ethernet. It makes code little more generic w/o checking each lower protocol and setting specific field id. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_l2.c | 24 +++- trafgen_l3.

[netsniff-ng] [PATCH 2/7] trafgen: proto: Add set_next_proto callback to struct proto_hdr

2016-02-01 Thread Vadim Kochan
Add set_next_proto callback to proto_hdr struct to allow lower protocol set next protocol id by enum proto_id. Extended proto_lower_default_add(...) function to take upper protocol to delegate it's id to lower protocol to set next protocol field. Signed-off-by: Vadim Kochan <vadi...@gmail.

[netsniff-ng] [PATCH 4/7] trafgen: ipv4: Add setting next protocol id

2016-02-01 Thread Vadim Kochan
Move setting lower protocol id field value from UDP & TCP protocols to IPv4 only, so lower layer will know exactly value to set in protocol id field. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_l3.c | 30 -- trafgen_l4.c | 16 ++-

[netsniff-ng] [PATCH 1/7] trafgen: proto: Simplify getting lower protocol after init

2016-02-01 Thread Vadim Kochan
Change proto_header_init(...) and proto_lower_default_add(...) functions to return struct proto_hdr * to do not call proto_current_header(...) after, so it makes more sense to get struct proto_hdr * right after initializing protocol by id. Signed-off-by: Vadim Kochan <vadi...@gmail.

[netsniff-ng] [PATCH 6/7] trafgen: parser: Add syntax for VLAN header creating

2016-02-01 Thread Vadim Kochan
. Examples: { eth(), vlan(1), ipv4() } { vlan(1, 1ad), vlan(100, pcp=3), ipv4() } Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 9 + trafgen_parser.y | 39 +++ 2 files changed, 48 insertions(+) diff

[netsniff-ng] [PATCH 7/7] trafgen: man: Add help for VLAN header function

2016-02-01 Thread Vadim Kochan
Add usage, syntax & parameters description for 'vlan()' function. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen.8 | 43 +++ 1 file changed, 43 insertions(+) diff --git a/trafgen.8 b/trafgen.8 index 207cfc5..1fe5536 100644 --- a

[netsniff-ng] Re: [PATCH 0/4] trafgen: Add IPv4 and UDP protocol generation

2016-01-31 Thread Vadim Kochan
On Fri, Jan 29, 2016 at 10:17:51AM +0100, Tobias Klauser wrote: > On 2016-01-29 at 09:05:24 +0100, Vadim Kochan <vadi...@gmail.com> wrote: > > On Fri, Jan 29, 2016 at 08:48:59AM +0100, Tobias Klauser wrote: > > > On 2016-01-28 at 23:06:23 +0100, Vadim Kochan &

[netsniff-ng] Re: [PATCH 0/4] trafgen: Add IPv4 and UDP protocol generation

2016-01-29 Thread Vadim Kochan
On Fri, Jan 29, 2016 at 08:48:59AM +0100, Tobias Klauser wrote: > On 2016-01-28 at 23:06:23 +0100, Vadim Kochan <vadi...@gmail.com> wrote: > > Reworded commit message of 12-14 patches from series: > > > > "[PATCH v3 00/16] trafgen: Add proto header generati

[netsniff-ng] [PATCH 2/4] trafgen: parser: Add syntax for IPv4 protocol generation

2016-01-28 Thread Vadim Kochan
-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 51 +++ 2 files changed, 66 insertions(+) diff --git a/trafgen_lexer.l b/trafgen_lexer.l index 5467c70..eeb252f 100644 --- a/trafgen_lexer.l

[netsniff-ng] [PATCH 3/4] trafgen: l4: Add UDP header generation logic

2016-01-28 Thread Vadim Kochan
Add trafgen_l4.c module with generation UDP header fields. UDP protocol generation logic automaticaly sets by default IPPROTO_UDP to the lower protocol (if it is IPv4), also checksum & length are calculated if it is not set by user. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --

[netsniff-ng] [PATCH 1/4] trafgen: l3: Add IPv4 header generation backend

2016-01-28 Thread Vadim Kochan
rnet protocol is initialized as default lower header. If the lower protocol is IPv4 then IPv4 protocol id is set to IP-in-IP in lower protocol header. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen/Makefile | 1 + trafgen_l3.

[netsniff-ng] [PATCH 0/4] trafgen: Add IPv4 and UDP protocol generation

2016-01-28 Thread Vadim Kochan
Reworded commit message of 12-14 patches from series: "[PATCH v3 00/16] trafgen: Add proto header generation" 1) Added parameters & default values description. 2) Functionality was not changed. Vadim Kochan (4): trafgen: l3: Add IPv4 header generation backend trafge

Re: [netsniff-ng] Synchronize file creation between netsniff-ng processes possible?

2016-01-27 Thread Vadim Kochan
issecting so I might be not aware about some usages of the tool, but as developer may be I may help you if you provide more info with some output's like: 1) How do you exactly run the tool ? 2) What do you see exactly with console output example ? 3) What you 'd like to expect exac

[netsniff-ng] Re: [PATCH v2 11/16] trafgen: parser: Add syntax to generate ARP header fields

2016-01-26 Thread Vadim Kochan
On Tue, Jan 26, 2016 at 10:25 AM, Tobias Klauser <tklau...@distanz.ch> wrote: > On 2016-01-26 at 00:11:53 +0100, Vadim Kochan <vadi...@gmail.com> wrote: >> Add syntax to generate ARP header fields: >> >> { arp(op=req, sip=1.1.1.1, smac=11:22:33:44:55:66) }

[netsniff-ng] [PATCH v3 08/16] trafgen: parser: Add syntax to generate Ethernet header

2016-01-26 Thread Vadim Kochan
-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 57 +++- 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/trafgen_lexer.l b/trafgen_lexer.l index 6c27b0c..ac4fec1

[netsniff-ng] [PATCH v3 07/16] str: Add str2mac helper function

2016-01-26 Thread Vadim Kochan
Add func for convert string to MAC address. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- str.c | 25 + str.h | 1 + 2 files changed, 26 insertions(+) diff --git a/str.c b/str.c index e4d8722..a3421b0 100644 --- a/str.c +++ b/str.c @@ -7,6 +7,7 @@ #i

[netsniff-ng] [PATCH v3 11/16] trafgen: parser: Add syntax to generate ARP header fields

2016-01-26 Thread Vadim Kochan
Add syntax to generate ARP header fields: { arp(op=req, sip=1.1.1.1, smac=11:22:33:44:55:66) } { arp() } Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 17 + trafgen_parser.y | 48 +++- 2 files c

[netsniff-ng] [PATCH v3 05/16] trafgen: proto: Add func for set device mac to field

2016-01-26 Thread Vadim Kochan
Add helper function for easy set device's MAC address to proto field which may be used by Ethernet & ARP protos generation. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_proto.c | 31 +++ trafgen_proto.h | 3 +++ 2 files changed, 34 insertion

[netsniff-ng] [PATCH v3 04/16] dev: Add func to get device's hw address

2016-01-26 Thread Vadim Kochan
Add device_hw_address func to get device's MAC address. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- dev.c | 23 +++ dev.h | 1 + 2 files changed, 24 insertions(+) diff --git a/dev.c b/dev.c index cf8d643..ad7b917 100644 --- a/dev.c +++ b/dev.c @@ -124,6 +

[netsniff-ng] [PATCH v3 06/16] trafgen: l2: Add Ethernet proto header generation

2016-01-26 Thread Vadim Kochan
Add trafgen_l2.c module for generating L2 related headers. Add Ethernet header generating. By default source MAC address is used from the specified output device. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen/Makefile | 1 + trafgen_l2.c

[netsniff-ng] [PATCH v3 03/16] trafgen: Add basic proto generation logic

2016-01-26 Thread Vadim Kochan
y craft the packet via parser. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen.c| 3 + trafgen/Makefile | 1 + trafgen_proto.c | 332 +++ trafgen_proto.h | 96 4 files changed, 432 insertions(+) creat

[netsniff-ng] [PATCH v3 14/16] trafgen: l4: Add UDP header generation logic

2016-01-26 Thread Vadim Kochan
Add trafgen_l4.c module with implementation of UDP header fields gneration. UDP proto generation logic automaticaly sets by default IPPROTO_UDP to the lower proto if it is IPv4, also cscum is calculated if it is not set by user. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- t

[netsniff-ng] [PATCH v3 15/16] trafgen: parser: Add syntax to build UDP header

2016-01-26 Thread Vadim Kochan
Added trafgen syntax to set UDP header fields: { udp(sport=111, dport=222) } Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 4 trafgen_parser.y | 29 + 2 files changed, 33 insertions(+) diff --git a/trafgen_lexer.l b/trafgen_l

[netsniff-ng] [PATCH v3 16/16] trafgen: man: Add help for Ethernet, ARP, IPv4, UDP headers

2016-01-26 Thread Vadim Kochan
Add description (basic syntax, proto header fields) for newer added proto headers: Ethernet, ARP, IPv4, UDP. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen.8 | 186 ++ 1 file changed, 186 insertions(+) diff

[netsniff-ng] [PATCH v3 10/16] trafgen: l2: Add ARP header generation logic

2016-01-26 Thread Vadim Kochan
Add ARP proto header fields generation via src mac, src ip, dst mac, dst ip & operaion. By default Ethernet proto will be initialized, and ARP Announcement request is filled. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen

[netsniff-ng] [PATCH v3 01/16] trafgen: Export set_fill func

2016-01-26 Thread Vadim Kochan
Make public set_fill func to be used by proto generation code. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_conf.h | 2 ++ trafgen_parser.y | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/trafgen_conf.h b/trafgen_conf.h index b171798..887fa3d

[netsniff-ng] [PATCH v3 12/16] trafgen: l3: Add IPv4 header generation backend

2016-01-26 Thread Vadim Kochan
roto is initialized as default underlying proto. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen/Makefile | 1 + trafgen_l3.c | 82 trafgen_l3.h | 26 ++ trafgen_proto.c | 2 ++ 4 files ch

[netsniff-ng] [PATCH v2 10/16] trafgen: l2: Add ARP header generation logic

2016-01-25 Thread Vadim Kochan
Add ARP proto header fields generation via src mac, src ip, dst mac, dst ip & operaion. By default Ethernet proto will be initialized, and ARP Announcement request is filled. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen

[netsniff-ng] [PATCH v2 16/16] trafgen: man: Add help for Ethernet, ARP, IPv4, UDP headers

2016-01-25 Thread Vadim Kochan
Add description (basic syntax, proto header fields) for newer added proto headers: Ethernet, ARP, IPv4, UDP. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen.8 | 174 ++ 1 file changed, 174 insertions(+) diff

[netsniff-ng] [PATCH v2 08/16] trafgen: parser: Add syntax to generate Ethernet header

2016-01-25 Thread Vadim Kochan
-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 57 +++- 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/trafgen_lexer.l b/trafgen_lexer.l index 6c27b0c..ac4fec1

[netsniff-ng] [PATCH v2 09/16] trafgen: proto: Add func to fill field with device ipv4 addr

2016-01-25 Thread Vadim Kochan
Add helper which fill device's ipv4 addr to the specified proto field. It will be used by such protos like ARP, IPv4, etc. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_proto.c | 32 trafgen_proto.h | 3 +++ 2 files changed, 35 insertions(+)

[netsniff-ng] [PATCH v2 14/16] trafgen: l4: Add UDP header generation logic

2016-01-25 Thread Vadim Kochan
Add trafgen_l4.c module with implementation of UDP header fields gneration. UDP proto generation logic automaticaly sets by default IPPROTO_UDP to the lower proto if it is IPv4, also cscum is calculated if it is not set by user. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- t

[netsniff-ng] [PATCH v2 02/16] trafgen: Add helper to get current packet

2016-01-25 Thread Vadim Kochan
Add current_packet() helper for getting current used packet and make it public to other modules. It will be used by proto generation logic. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_conf.h | 2 ++ trafgen_parser.y | 5 + 2 files changed, 7 insertions(+) diff

[netsniff-ng] [PATCH v2 03/16] trafgen: Add basic proto generation logic

2016-01-25 Thread Vadim Kochan
y craft the packet via parser. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen.c| 3 + trafgen/Makefile | 1 + trafgen_proto.c | 331 +++ trafgen_proto.h | 96 4 files changed, 431 insertions(+) creat

[netsniff-ng] [PATCH v2 01/16] trafgen: Export set_fill func

2016-01-25 Thread Vadim Kochan
Make public set_fill func to be used by proto generation code. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_conf.h | 2 ++ trafgen_parser.y | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/trafgen_conf.h b/trafgen_conf.h index b171798..887fa3d

[netsniff-ng] [PATCH v2 11/16] trafgen: parser: Add syntax to generate ARP header fields

2016-01-25 Thread Vadim Kochan
Add syntax to generate ARP header fields: { arp(op=req, sip=1.1.1.1, smac=11:22:33:44:55:66) } { arp() } Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 38 +- 2 files chang

[netsniff-ng] [PATCH v2 15/16] trafgen: parser: Add syntax to build UDP header

2016-01-25 Thread Vadim Kochan
Added trafgen syntax to set UDP header fields: { udp(sport=111, dport=222) } Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 4 trafgen_parser.y | 29 + 2 files changed, 33 insertions(+) diff --git a/trafgen_lexer.l b/trafgen_l

[netsniff-ng] [PATCH v2 12/16] trafgen: l3: Add IPv4 header generation backend

2016-01-25 Thread Vadim Kochan
roto is initialized as default underlying proto. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen/Makefile | 1 + trafgen_l3.c | 82 trafgen_l3.h | 26 ++ trafgen_proto.c | 2 ++ 4 files ch

[netsniff-ng] [PATCH v2 06/16] trafgen: l2: Add Ethernet proto header generation

2016-01-25 Thread Vadim Kochan
Add trafgen_l2.c module for generating L2 related headers. Add Ethernet header generating. By default source MAC address is used from the specified output device. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen/Makefile | 1 + trafgen_l2.c

[netsniff-ng] Re: [PATCH 00/13] trafgen: Add proto header generation

2016-01-25 Thread Vadim Kochan
On Mon, Jan 25, 2016 at 09:56:37AM +0100, Tobias Klauser wrote: > On 2016-01-21 at 00:19:48 +0100, Vadim Kochan <vadi...@gmail.com> wrote: > > Add new trafgen proto generation framework which allows to describe > > proto header fields and easy build the proto header by set

[netsniff-ng] Re: [PATCH 04/13] trafgen: Add basic proto generation logic

2016-01-25 Thread Vadim Kochan
On Mon, Jan 25, 2016 at 10:15:24AM +0100, Tobias Klauser wrote: > On 2016-01-21 at 00:19:52 +0100, Vadim Kochan <vadi...@gmail.com> wrote: > > Add new trafgen_proto.c module with basic proto > > header fields generation logic. > > > > Each proto must implem

[netsniff-ng] [PATCH 00/13] trafgen: Add proto header generation

2016-01-20 Thread Vadim Kochan
via fill(..) func. Currently there is no runtime invoking of proto fields description but is planned to be added in separate series. Vadim Kochan (13): trafgen: Export set_fill func trafgen: Add helper to get current packet dev: Add func to get device's hw address trafgen: Add basic p

[netsniff-ng] [PATCH 07/13] str: Add str2mac helper function

2016-01-20 Thread Vadim Kochan
Add func for convert string to MAC address. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- str.c | 25 + str.h | 1 + 2 files changed, 26 insertions(+) diff --git a/str.c b/str.c index e4d8722..aca069a 100644 --- a/str.c +++ b/str.c @@ -7,6 +7,7 @@ #i

[netsniff-ng] [PATCH 05/13] trafgen: proto: Add func for set device mac to field

2016-01-20 Thread Vadim Kochan
Add helper function for easy set device's MAC address to proto field which may be used by Ethernet & ARP protos generation. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_proto.c | 32 trafgen_proto.h | 3 +++ 2 files changed, 35 insertion

[netsniff-ng] [PATCH 02/13] trafgen: Add helper to get current packet

2016-01-20 Thread Vadim Kochan
Add current_packet() helper for getting current used packet and make it public to other modules. It will be used by proto generation logic. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_conf.h | 2 ++ trafgen_parser.y | 5 + 2 files changed, 7 insertions(+) diff

[netsniff-ng] [PATCH 12/13] trafgen: l3: Add IPv4 header generation backend

2016-01-20 Thread Vadim Kochan
roto is initialized as default underlying proto. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen/Makefile | 1 + trafgen_l3.c | 71 trafgen_l3.h | 26 + trafgen_proto.c | 2 ++ 4 files ch

[netsniff-ng] [PATCH 11/13] trafgen: parser: Add syntax to generate ARP header fields

2016-01-20 Thread Vadim Kochan
Add syntax to generate ARP header fields: { arp(op=req, sip=1.1.1.1, smac=11:22:33:44:55:66) } { arp() } Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 38 +- 2 files chang

[netsniff-ng] [PATCH 06/13] trafgen: l2: Add Ethernet proto header generation

2016-01-20 Thread Vadim Kochan
Add trafgen_l2.c module for generating L2 related headers. Add Ethernet header generating. By default source MAC address is used from the specified output device. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen/Makefile | 1 + trafgen_l2.c

[netsniff-ng] [PATCH 10/13] trafgen: l2: Add ARP header generation logic

2016-01-20 Thread Vadim Kochan
Add ARP proto header fields generation via src mac, src ip, dst mac, dst ip & operaion. By default Ethernet proto will be initialized, and ARP probe request is filled. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_l2.c | 45 +

[netsniff-ng] [PATCH 13/13] trafgen: parser: Add syntax for IPv4 proto

2016-01-20 Thread Vadim Kochan
Add syntax to specify IPv4 header fields: { ip(df, mf, frag=100, prot=0x1, ecn=2, dscp=20) } Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 51 +++ 2 files changed, 66 inse

[netsniff-ng] [PATCH 09/13] trafgen: proto: Add func to fill field with device ipv4 addr

2016-01-20 Thread Vadim Kochan
Add helper which fill device's ipv4 addr to the specified proto field. It will be used by such protos like ARP, IPv4, etc. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_proto.c | 35 +++ trafgen_proto.h | 3 +++ 2 files changed, 38 inse

[netsniff-ng] [PATCH 08/13] trafgen: parser: Add syntax to generate Ethernet header

2016-01-20 Thread Vadim Kochan
-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 57 +++- 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/trafgen_lexer.l b/trafgen_lexer.l index 6c27b0c..670b5dc

[netsniff-ng] [PATCH 0/2] trafgen: Small changes for unit parsing (gap, ring size)

2016-01-13 Thread Vadim Kochan
Small simplification of unit parsing for gap & ring size option by using strtoul for setting start of unit name instead of checking it char by char. Vadim Kochan (2): trafgen: Simplify 'gap' option unit parsing trafgen: Simplify ring size unit parsing trafgen.c

Re: [netsniff-ng] Adjusting PPS ?

2016-01-05 Thread Vadim Kochan
ps a bit in reducing your load: >> >> $ trafgen -h >> [...] >> -t|--gap Set approx. interpacket gap (s/ms/us/ns, >> def: us) >> [...] >> >>> Best Regards >>> Burak Ozalp > > Hi Burak, New "-b,--rate" option was ad

[netsniff-ng] [PATCH 1/2] flowtop: Use one func to update flow entry

2016-01-05 Thread Vadim Kochan
Seems there is no need to have 2 separate handlers for the flow updating, so use one which was used for flow refreshing. Significant change is that new entry will be not added if it was not found in the list, but such case should not happen. Signed-off-by: Vadim Kochan <vadi...@gmail.

[netsniff-ng] [PATCH 0/2] flowtop: Simplify flows dump & refreshing

2016-01-05 Thread Vadim Kochan
Use one nfct handler for flows dump, refreshing & events to make code simpler. Vadim Kochan (2): flowtop: Use one func to update flow entry flowtop: Use one nfct handle for dump & refresh flows flowtop.c | 96 ++- 1 file

[netsniff-ng] [PATCH 2/2] flowtop: Use one nfct handle for dump & refresh flows

2016-01-05 Thread Vadim Kochan
Simplify dump & flows refreshing via one nfct handle, which is enough. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- flowtop.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/flowtop.c b/flowtop.c index cc5ffa2..4c15c06 100644 --- a/flowt

[netsniff-ng] Re: [PATCH v2] trafgen: Add option to specify packets sending rate

2015-12-23 Thread Vadim Kochan
On Wed, Dec 23, 2015 at 10:31:23PM +0200, Vadim Kochan wrote: > Added -b,--rate option in units of: > > pps/B/kB/MB/kBit/Mbit/Gbit/KiB/MiB/GiB > > to specify rate at which packets will be sent. > Similary to -t,--gap option the packets will be sent > in slow mode wi

[netsniff-ng] [PATCH] trafgen: Add option to specify packets sending rate

2015-12-20 Thread Vadim Kochan
Added -b,--rate option in units of: pps/B/KB/MB/kBit/Mbit/Gbit/KiB/MiB/GiB to specify rate at which packets will be sent. Similary to -t,--gap option the packets will be sent in slow mode with 1 CPU. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen.8 | 4 ++ trafgen.c

[netsniff-ng] Re: Shell variables support in trafgen

2015-12-17 Thread Vadim Kochan
ch easier > > Thanks > Hi, I added -D option which allows to .pass C preprocessor macro/define (with combination of -p,--cpp option) and I think it can be used similary to what you requested. The changes currently are only in master branch in official repo. The same option was added for

[netsniff-ng] [PATCH 0/3] flowtop: Misc updates: filter state, refresh flag reset

2015-12-16 Thread Vadim Kochan
There are just few different changes like: 1) Show family in filter status bar 2) Show if 'Active' flows mode is selected in filter status bar 3) Reset do_refresh flag immideately if it is enabled to make able refresh flows again if this flag was changed while refreshing. Vadim

[netsniff-ng] [PATCH 3/3] flowtop: Refresh flows if filter was changed while flows loading

2015-12-16 Thread Vadim Kochan
Reset do_reload_flows flag before dump flows. It allows to change filter state more dynamically Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- flowtop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowtop.c b/flowtop.c index d90e1ee..1d438ba

[netsniff-ng] [PATCH 2/3] flowtop: Indicate if 'active' flows mode is selected

2015-12-16 Thread Vadim Kochan
Show 'Active' filter status if 'a' was pressed. Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- flowtop.c | 4 1 file changed, 4 insertions(+) diff --git a/flowtop.c b/flowtop.c index 52e4bef..d90e1ee 100644 --- a/flowtop.c +++ b/flowtop.c @@ -1146,6 +1146,7 @@ static void draw

[netsniff-ng] Re: [PATCH 1/4] netsniff-ng: nlmsg: Resolve genl family name

2015-12-16 Thread Vadim Kochan
On Tue, Dec 08, 2015 at 05:00:52PM +0100, Tobias Klauser wrote: > On 2015-11-30 at 01:05:04 +0100, Vadim Kochan <vadi...@gmail.com> wrote: > > Print name of resolved genl family name by type > > This patch does quite a bit more than the description says (i.e. the > in

<    1   2   3   4   5   6   >