[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 --- list.h | 39 +++ 1

[netsniff-ng] [PATCH v2 01/11] geoip: Allow to get country 3-code

2016-04-17 Thread Vadim Kochan
Add func to get country code-3 name by IPv4/6 address Signed-off-by: Vadim Kochan --- 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 +339,20 @@ const char

[netsniff-ng] [PATCH v2 03/11] flowtop: Add display option to show src info

2016-04-17 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 --- flowtop.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/flowtop.c b/flowtop.c in

[netsniff-ng] [PATCH v2 02/11] flowtop: Change flows layout to 1-row view

2016-04-17 Thread Vadim Kochan
unit. Signed-off-by: Vadim Kochan --- flowtop.c | 391 ++ 1 file changed, 191 insertions(+), 200 deletions(-) diff --git a/flowtop.c b/flowtop.c index 4c15c06..119e2f9 100644 --- a/flowtop.c +++ b/flowtop.c @@ -62,6 +62,7 @@ struct

[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 wrote: > > On Tue, Mar 29, 2016 at 4:23 PM, Tobias Klauser wrote: > > > On 2016-03-23 at 22:00:44 +0100, Vadim Kochan wrote: > > >> Changed flows list

[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 wrote: > On 2016-03-23 at 22:00:44 +0100, Vadim Kochan wrote: >> Changed flows list layout to look more a top-like output >> with header and in 1 line. When -s option is specified >> then layout changes to 2 lines view in

[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 --- screen.h | 17 + 1

[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 --- 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 @@ -62,6 +62,7 @@ struct

[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 --- 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 +339,20 @@ const char

[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 --- flowtop.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/flowtop.c b

[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 --- flowtop.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/flowtop.c b/flowtop.c in

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

2016-03-09 Thread Vadim Kochan
a 2015 0:17:13 UTC+1 Vadim Kochan napísal(-a): >> >> 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 slo

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

2016-02-27 Thread Vadim Kochan
Ehh sorry, GMail destroyed my ASCII example, but I hope you got the idea - in case of -s option - print src & dst info with same columns (DEST, GEO, BYTES, RATE, TIME) but on the neighbor lines. On Sat, Feb 27, 2016 at 11:43 PM, Vadim Kochan wrote: > On Fri, Feb 26, 2016 at 11:09 AM

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

2016-02-26 Thread Vadim Kochan
On Fri, Feb 26, 2016 at 10:58 AM, Tobias Klauser wrote: > On 2016-02-25 at 17:35:56 +0100, Vadim Kochan wrote: >> On Sat, Feb 20, 2016 at 8:47 PM, Vadim Kochan wrote: >> > On Sat, Feb 20, 2016 at 7:49 PM, Daniel Borkmann >> > wrote: >> >> Hi Vadim, &

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

2016-02-25 Thread Vadim Kochan
On Sat, Feb 20, 2016 at 8:47 PM, Vadim Kochan wrote: > On Sat, Feb 20, 2016 at 7:49 PM, Daniel Borkmann > wrote: >> Hi Vadim, >> >> thanks for looking into this, appreciate it! >> >> On 02/20/2016 03:28 PM, Vadim Kochan wrote: >>> >>>

[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 wrote: > On 2016-02-08 at 07:01:50 +0100, Vadim Kochan wrote: >> Add 'mpls()' function to create MPLS header with fields: >> >>

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

2016-02-20 Thread Vadim Kochan
On Sat, Feb 20, 2016 at 7:49 PM, Daniel Borkmann 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 wrote: >>> >>> Hi, >>> &g

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

2016-02-20 Thread Vadim Kochan
On Sat, Feb 20, 2016 at 1:25 AM, Vadim Kochan 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 atached the screenshot. > >

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

2016-02-19 Thread Vadim Kochan
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. >> &

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

2016-02-18 Thread Vadim Kochan
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. Regards, Vadim Kochan On Thu, Feb 18, 2016 at 10:51 PM, and wrote: > Yes, sort of that: i need that every pcap file get name, which sho

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

2016-02-18 Thread Vadim Kochan
;)".pcap -s -F > 10s > > just one file, or multiple files (with prefix option) but without > changing time variable: > > sudo netsniff-ng -i ethx -o /destination/ -P "$(date +'%Y%m%d_%H%M')"_ -s -F > 10s > > > > > For tcpdump works: &

Re: [netsniff-ng] Capture every n packets

2016-02-18 Thread Vadim Kochan
t it can be implemented for 1 process-only in the while(...) loop when reading mmap-ed frames from kernel by checking sniffed number of packets ? For the fan-out group processes it seems like it needs to check each N packet on the kernel side (eBPF might help ?) ? It would be good to hear comments fr

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

2016-02-18 Thread Vadim Kochan
/"$(date +'%Y%m%d_%H%M')".pcap -n 100 And I got the pcap file under /tmp: /tmp/20160218_1251.pcap May be I did not understand your problem ? Regards, Vadim Kochan -- You received this message because you are subscribed to the Google Groups "netsniff-ng"

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

2016-02-07 Thread Vadim Kochan
orted, but multicast might be set via 'eth()' function. Signed-off-by: Vadim Kochan --- 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 e1d1a3f..

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

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

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

2016-02-07 Thread Vadim Kochan
he lower MPLS header 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. v2: Add 'exp' parameter which is the same as 'tc|tclass'. Vadim Koch

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

2016-02-07 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 --- trafgen.8 | 29 +++-- 1 file changed, 27 insertions(+), 2 d

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

2016-02-07 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 --- trafgen_l2.c| 32 trafgen_l2.h| 7

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

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

[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 --- trafgen_l2.c| 32 trafgen_l2.h| 7

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

2016-02-03 Thread Vadim Kochan
he lower MPLS header 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

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

2016-02-03 Thread Vadim Kochan
orted, but multicast might be set via 'eth()' function. Signed-off-by: Vadim Kochan --- 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..

[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 --- trafgen.8 | 29 +++-- 1 file changed, 27 insertions(+), 2 d

[netsniff-ng] trafgen: Automatic padding for Ethernet header

2016-02-02 Thread Vadim Kochan
this, but may be it would be better to do it automatically to be sure that packet will be sent successfully. But if Linux guarantee such padding then it is not needed at all. Regards, Vadim Kochan -- You received this message because you are subscribed to the Google Groups "netsniff-ng&qu

[netsniff-ng] Re: [PATCH 0/7] trafgen: Add VLAN header creating

2016-02-02 Thread Vadim Kochan
On Tue, Feb 2, 2016 at 6:20 PM, Vadim Kochan wrote: > On Tue, Feb 2, 2016 at 5:54 PM, Tobias Klauser wrote: >> On 2016-02-01 at 18:01:34 +0100, Vadim Kochan wrote: >>> Add 'vlan()' function for creating VLAN header 802.1q or 802.1ad. >>> There is

[netsniff-ng] Re: [PATCH 0/7] trafgen: Add VLAN header creating

2016-02-02 Thread Vadim Kochan
On Tue, Feb 2, 2016 at 5:54 PM, Tobias Klauser wrote: > On 2016-02-01 at 18:01:34 +0100, Vadim Kochan wrote: >> Add 'vlan()' function for creating VLAN header 802.1q or 802.1ad. >> There is a tricky change which changes struct proto_field.offset >> uint16_t ->

[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 --- trafgen_l2.c | 4

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

2016-02-01 Thread Vadim Kochan
7;id' parameter. Examples: { eth(), vlan(1), ipv4() } { vlan(1, 1ad), vlan(100, pcp=3), ipv4() } Signed-off-by: Vadim Kochan --- trafgen_lexer.l | 9 + trafgen_parser.y | 39 +++ 2 files changed, 48 insertions(+) diff --git

[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 --- trafgen

[netsniff-ng] [PATCH 0/7] trafgen: Add VLAN header creating

2016-02-01 Thread Vadim Kochan
er type field. Additionally series has changes for simplify setting correct upper protocol id by lower layer by delegating this to the lower protocol. So upper protocol specifies it's proto_id to the lower protocol which decides which field & value to set. Vadim Kochan (7): trafgen: proto: Simplify

[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 --- trafgen_l2.c | 24 +++- trafgen_l3.c | 4 +--- 2 files

[netsniff-ng] [PATCH 5/7] trafgen: l2: Add VLAN header generation

2016-02-01 Thread Vadim Kochan
Add generation of VLAN header with supported fields: TPID, DEI/CFI, PCP, VID Changed struct proto_field.offset uint16_t -> int16_t to make TPID offset -2 to point to ether type. Signed-off-by: Vadim Kochan --- trafgen_l2.c|

[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 --- trafgen_l3.c | 30 -- trafgen_l4.c | 16 ++-- 2 files changed

[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 --- trafgen.8 | 43 +++ 1 file changed, 43 insertions(+) diff --git a/trafgen.8 b/trafgen.8 index 207cfc5..1fe5536 100644 --- a/trafgen.8 +

[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 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 wrote: > > > > Reworded c

[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 wrote: > > Reworded commit message of 12-14 patches from series: > > > > "[PATCH v3 00/16] trafgen: Add proto header generation" > > >

[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 --- trafgen/Makefile | 1 + trafgen_l3.c | 82 trafgen_

[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

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

2016-01-28 Thread Vadim Kochan
ksum field (calculated automatically) Example (Echo request): { udp(dport=7) } Signed-off-by: Vadim Kochan --- trafgen_lexer.l | 4 trafgen_parser.y | 29 + 2 files changed, 33 insertions(+) diff --git a/trafgen_lexer.l b/trafgen_lexer.l index eeb252f..5601

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

2016-01-28 Thread Vadim Kochan
Signed-off-by: Vadim Kochan --- 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 +++ b/trafg

[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 --- trafgen/Makefile

Re: [netsniff-ng] Replay pcap file on Xenomai kernel in real time

2016-01-27 Thread Vadim Kochan
ified output device like: { ip(saddr=2.2.2.2) } should change each packet with only IPv4 src address with checksum re-calculation. Not sure if it might be really useful. Regards, Vadim Kochan -- You received this message because you are subscribed to the Google Groups "netsniff

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

2016-01-27 Thread Vadim Kochan
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 exactly (probably wi

[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 --- trafgen/Makefile | 1 + trafgen_l3.c | 82 trafgen_l3.h | 26 ++ trafgen_proto.c | 2 ++ 4 files changed, 111 insertions(+) create

[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 --- trafgen_lexer.l | 4 trafgen_parser.y | 29 + 2 files changed, 33 insertions(+) diff --git a/trafgen_lexer.l b/trafgen_lexer.l index e6007f7

[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 --- trafgen.8 | 186 ++ 1 file changed, 186 insertions(+) diff --git a/trafgen.8 b/trafgen.8

[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 --- trafgen/Makefile | 1

[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 --- trafgen_proto.c | 31 +++ trafgen_proto.h | 3 +++ 2 files changed, 34 insertions(+) dif

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

2016-01-26 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 --- trafgen_conf.h | 2 ++ trafgen_parser.y | 5 + 2 files changed, 7 insertions(+) diff --git a/trafgen_conf.h b

[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 --- trafgen/Makefile | 1 + trafgen_l2.c | 32 trafgen_l2.h

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

2016-01-26 Thread Vadim Kochan
aft the packet via parser. Signed-off-by: Vadim Kochan --- trafgen.c| 3 + trafgen/Makefile | 1 + trafgen_proto.c | 332 +++ trafgen_proto.h | 96 4 files changed, 432 insertions(+) create mode 100644 trafgen_

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

2016-01-26 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 --- trafgen_proto.c | 32 trafgen_proto.h | 3 +++ 2 files changed, 35 insertions(+) diff --

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

2016-01-26 Thread Vadim Kochan
Add syntax to specify IPv4 header fields: { ip4(df, mf, frag=100, prot=0x1, ecn=2, dscp=20) } Signed-off-by: Vadim Kochan --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 51 +++ 2 files changed, 66 insertions(+) diff --git a

[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 --- trafgen_l2.c | 52 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 --- 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 100644 --- a/trafgen_conf.h +++ b

[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 --- 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 @@ #include #include #include

[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 --- trafgen_lexer.l | 17 + trafgen_parser.y | 48 +++- 2 files changed, 64 insertions(+), 1

[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 --- 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 +124,29 @@ int device_ad

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

2016-01-26 Thread Vadim Kochan
: Vadim Kochan --- 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 100644 --- a/trafgen_lexer.l +++ b

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

2016-01-26 Thread Vadim Kochan
cified 8) Allow "oper" to be specified as ARP oper field. 9) Changed ARP params usage in trafgen.8 10) Replaced invalid UDP DNS example by UDP Echo in trafgen.8 - just to have some valid example. DNS example can be added when DNS header params will be implemented.

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

2016-01-26 Thread Vadim Kochan
On Tue, Jan 26, 2016 at 10:35 AM, Tobias Klauser wrote: > On 2016-01-26 at 00:11:57 +0100, Vadim Kochan wrote: >> Added trafgen syntax to set UDP header fields: >> >> { udp(sport=111, dport=222) } >> >> Signed-off-by: Vadim Kochan >> --- >> tr

[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 wrote: > On 2016-01-26 at 00:11:53 +0100, Vadim Kochan wrote: >> Add syntax to generate ARP header fields: >> >> { arp(op=req, sip=1.1.1.1, smac=11:22:33:44:55:66) } >> { arp() } >&g

[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 --- trafgen_l2.c | 52 trafgen_

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

2016-01-25 Thread Vadim Kochan
Add syntax to specify IPv4 header fields: { ip4(df, mf, frag=100, prot=0x1, ecn=2, dscp=20) } Signed-off-by: Vadim Kochan --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 51 +++ 2 files changed, 66 insertions(+) diff --git a

[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 --- trafgen.8 | 174 ++ 1 file changed, 174 insertions(+) diff --git a/trafgen.8 b/trafgen.8

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

2016-01-25 Thread Vadim Kochan
: Vadim Kochan --- 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 100644 --- a/trafgen_lexer.l +++ b

[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 --- trafgen_proto.c | 32 trafgen_proto.h | 3 +++ 2 files changed, 35 insertions(+) diff --

[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 --- trafgen/Makefile | 1 + trafgen_l2.c | 32 trafgen_l2.h

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

2016-01-25 Thread Vadim Kochan
Add func for convert string to MAC address. Signed-off-by: Vadim Kochan --- 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 @@ #include #include #include

[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 --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 38 +- 2 files changed, 52 insertions(+), 1 deletion

[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 --- trafgen_lexer.l | 4 trafgen_parser.y | 29 + 2 files changed, 33 insertions(+) diff --git a/trafgen_lexer.l b/trafgen_lexer.l index 26876b4

[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 --- trafgen/Makefile | 1 + trafgen_l3.c | 82 trafgen_l3.h | 26 ++ trafgen_proto.c | 2 ++ 4 files changed, 111 insertions(+) create

[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 --- trafgen/Makefile | 1

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

2016-01-25 Thread Vadim Kochan
4 length field name to "length". Vadim Kochan (16): trafgen: Export set_fill func trafgen: Add helper to get current packet trafgen: Add basic proto generation logic dev: Add func to get device's hw address trafgen: proto: Add func for set device mac to field trafgen: l2: Add E

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

2016-01-25 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 --- trafgen_proto.c | 31 +++ trafgen_proto.h | 3 +++ 2 files changed, 34 insertions(+) dif

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

2016-01-25 Thread Vadim Kochan
Add device_hw_address func to get device's MAC address. Signed-off-by: Vadim Kochan --- 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 +124,29 @@ int device_ad

[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 --- trafgen_conf.h | 2 ++ trafgen_parser.y | 5 + 2 files changed, 7 insertions(+) diff --git a/trafgen_conf.h b

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

2016-01-25 Thread Vadim Kochan
aft the packet via parser. Signed-off-by: Vadim Kochan --- trafgen.c| 3 + trafgen/Makefile | 1 + trafgen_proto.c | 331 +++ trafgen_proto.h | 96 4 files changed, 431 insertions(+) create mode 100644 trafgen_

[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 --- 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 100644 --- a/trafgen_conf.h +++ b

[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 wrote: > > Add new trafgen_proto.c module with basic proto > > header fields generation logic. > > > > Each proto must implement proto_gen struct and re

[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 wrote: > > Add new trafgen proto generation framework which allows to describe > > proto header fields and easy build the proto header by set/get proto > >

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

2016-01-22 Thread Vadim Kochan
On Thu, Jan 21, 2016 at 1:19 AM, Vadim Kochan wrote: > Add new trafgen_proto.c module with basic proto > header fields generation logic. > > Each proto must implement proto_gen struct and register it > to the global proto list. > > Proto header consist from set of fields, a

[netsniff-ng] [PATCH] netsniff-ng: arp: Print HW & proto addresses

2016-01-21 Thread Vadim Kochan
In case if HW type is Ethernet and proto is IPv4 then print sender/target MAC & IP addresses. Signed-off-by: Vadim Kochan --- proto_arp.c | 44 1 file changed, 44 insertions(+) diff --git a/proto_arp.c b/proto_arp.c index 9121223..9f2a4e0 10

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

2016-01-21 Thread Vadim Kochan
On Thu, Jan 21, 2016 at 01:19:58AM +0200, Vadim Kochan wrote: > 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 Koch

[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 --- trafgen_conf.h | 2 ++ trafgen_parser.y | 5 + 2 files changed, 7 insertions(+) diff --git a/trafgen_conf.h b

[netsniff-ng] [PATCH 03/13] dev: Add func to get device's hw address

2016-01-20 Thread Vadim Kochan
Add device_hw_address func to get device's MAC address. Signed-off-by: Vadim Kochan --- 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 +124,29 @@ int device_ad

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

2016-01-20 Thread Vadim Kochan
Make public set_fill func to be used by proto generation code. Signed-off-by: Vadim Kochan --- 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 100644 --- a/trafgen_conf.h +++ b

[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 --- trafgen_lexer.l | 15 +++ trafgen_parser.y | 38 +- 2 files changed, 52 insertions(+), 1 deletion

[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 --- trafgen_proto.c | 35 +++ trafgen_proto.h | 3 +++ 2 files changed, 38 insertions(+) diff --

<    1   2   3   4   5   6   7   8   >