[netsniff-ng] Re: about trafgen configuration file dinc question

2019-07-24 Thread Vadim Kochan
Weican Liu > > > Looks like it needs to be implemented. Regards, Vadim Kochan -- You received this message because you are subscribed to the Google Groups "netsniff-ng" group. To unsubscribe from this group and stop receiving emails from it, send an email to netsniff-ng+unsubscr.

Re: [netsniff-ng] Trafgen & mz

2018-04-13 Thread Vadim Kochan
; Hi Jack! Thank you for suggestions and report! Regarding trafgen -b option you mean that is would be better if the packets delay was better normalized regarding the rate ? Regards, Vadim Kochan -- You received this message because you are subscribed to the Google Groups "netsniff-ng&

[netsniff-ng] Re: [PATCH] flowtop: Fix use-after-free on filter reload

2017-12-29 Thread Vadim Kochan
On Tue, Dec 19, 2017 at 12:30 PM, Tobias Klauser wrote: > On 2017-12-19 at 11:24:40 +0100, Vadim Kochan wrote: > > May it possible that you tried flowtop compiled without the fix ? > > No, I made sure to have the patch applied and recompiled flowtop. I can > still quite reli

[netsniff-ng] Re: [PATCH] flowtop: Fix use-after-free on filter reload

2017-12-19 Thread Vadim Kochan
May it possible that you tried flowtop compiled without the fix ? On Tue, Dec 19, 2017 at 12:18 PM, Vadim Kochan wrote: > Thats really strange, because before this patch I really easy triggered > the issue, but > now I cant. > > On Tue, Dec 19, 2017 at 11:12 AM, Tobias Klauser &

[netsniff-ng] Re: [PATCH] flowtop: Fix use-after-free on filter reload

2017-12-19 Thread Vadim Kochan
Thats really strange, because before this patch I really easy triggered the issue, but now I cant. On Tue, Dec 19, 2017 at 11:12 AM, Tobias Klauser wrote: > On 2017-12-18 at 23:38:18 +0100, Vadim Kochan wrote: > > There is missing logic which removes flown entry from > > relat

[netsniff-ng] [PATCH] flowtop: Fix use-after-free on filter reload

2017-12-18 Thread Vadim Kochan
ff-by: Vadim Kochan --- flowtop.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/flowtop.c b/flowtop.c index 8b69d65..7de4d11 100644 --- a/flowtop.c +++ b/flowtop.c @@ -470,20 +470,24 @@ static struct flow_entry *flow_list_find_id(struct flow

Re: [netsniff-ng] Re: Trafgen: Warning: Out of Memory

2017-12-18 Thread Vadim Kochan
Hi Chandra, Sorry for the late response ! Would you please provide commands which did you use ? Thanks! On Tue, Dec 5, 2017 at 1:26 PM, wrote: > while running trafgen commands , i am getting segmentation fault (cpre > dump). > > can someone please guide me to move further ? > > Thanks, > Chan

[netsniff-ng] [PATCH] flowtop: Use RCU flow deletion from process entry

2017-12-17 Thread Vadim Kochan
Use cds_list_del_rcu for safer deletion flow from the process flow list to prevent possible use-after-free by UI thread when it is refreshing the processes. It may fix the #183 issue. Signed-off-by: Vadim Kochan --- flowtop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

Re: [netsniff-ng] Re: [ANNOUNCE] Preparing for netsniff-ng release v0.6.4

2017-12-14 Thread Vadim Kochan
if its possible. Regards, Vadim Kochan On Thu, Dec 14, 2017 at 2:47 PM, Tobias Klauser wrote: > On 2017-12-11 at 09:08:15 +0100, Tobias Klauser > wrote: > > On 2017-12-08 at 18:30:24 +0100, Vadim Kochan wrote: > > > Hi All, > > > > > > I just noticed ther

Re: [netsniff-ng] Re: [ANNOUNCE] Preparing for netsniff-ng release v0.6.4

2017-12-08 Thread Vadim Kochan
Hi All, I just noticed there some bug reports, I will look on them on weekend, I assume it is better to wait with release unless isues will be fixed ? Regards, Vadim On Fri, Dec 8, 2017 at 6:57 PM, @mandarg wrote: > On Friday, October 20, 2017 at 9:29:28 AM UTC-4, Tobias Klauser wrote: > > The

Re: [netsniff-ng] Re: Cannot get /GeoIP.dat.gz from mirrors!

2017-11-22 Thread Vadim Kochan
Hi Lupe, Which version do you use ? Regards, Vadim Kochan On Wed, Nov 22, 2017 at 8:43 PM, Lupe Villalpando < lupe.villalpa...@yardi.com> wrote: > this is the command i am running > > astraceroute -i eth0 -N -S -H netsniff-ng.org > > > -- &g

[netsniff-ng] Re: [PATCH] trafgen: fix packet socket initialization with multiple CPUs

2017-09-14 Thread Vadim Kochan
Thanks Paolo! Shame on me, I did not test it properly :( On Wed, Sep 13, 2017 at 6:54 PM, Paolo Abeni wrote: > The commit 78c13b71e196 ("trafgen: Allow to generate packets > to output pcap file") introduced a regression when output is > a network device and multiple CPU are in use: the packet >

[netsniff-ng] [PATCH v2 0/3] trafgen: Add dump of proto headers into *.cfg format

2017-07-29 Thread Vadim Kochan
ated packet. Before dump the default ETH_PROTO fields are applied as first header and then next proto_hdr is identified via .get_next_proto(...) callback. Meanwhile only eth, arp, vlan, ip4, udp, & tcp protos can be dissected into *.cfg format. v2: 1) Missed local patch Vadim Kochan (3):

[netsniff-ng] [PATCH v2 2/3] trafgen: dev_io: Change read/write to specify struct packet *

2017-07-29 Thread Vadim Kochan
Refactor dev_io_ops read & write to specify struct packet *, it may simplify a bit a caller logic. And it allow to keep required members within one struct packet object. Signed-off-by: Vadim Kochan --- trafgen.c| 25 - trafgen_conf.h | 2 +- trafgen_d

[netsniff-ng] [PATCH v2 1/3] trafgen: Get packet from proto_hdr if possible

2017-07-29 Thread Vadim Kochan
allocated packet. Signed-off-by: Vadim Kochan --- trafgen_l3.c| 4 ++-- trafgen_l4.c| 4 ++-- trafgen_proto.c | 10 -- trafgen_proto.h | 3 +++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/trafgen_l3.c b/trafgen_l3.c index 7199b89..48790e5 100644 --- a/trafgen_l3.c

[netsniff-ng] [PATCH v2 3/3] trafgen: Dump proto headers in *.cfg format

2017-07-29 Thread Vadim Kochan
f-by: Vadim Kochan --- trafgen.8| 4 +- trafgen.c| 54 ++-- trafgen/Makefile | 1 + trafgen_conf.h | 2 + trafgen_dev.c| 36 +++- trafgen_dev.h| 4 +- trafgen_dump.c | 258 +++ trafgen_dump.h |

[netsniff-ng] [PATCH 0/3] trafgen: Add dump of proto headers into *.cfg format

2017-07-29 Thread Vadim Kochan
ated packet. Before dump the default ETH_PROTO fields are applied as first header and then next proto_hdr is identified via .get_next_proto(...) callback. Meanwhile only eth, arp, vlan, ip4, udp, & tcp protos can be dissected into *.cfg format. Vadim Kochan (3): trafgen: Get packet from prot

[netsniff-ng] [PATCH 3/3] trafgen: Dump proto headers in *.cfg format

2017-07-29 Thread Vadim Kochan
f-by: Vadim Kochan --- trafgen.8| 4 +- trafgen.c| 54 ++-- trafgen/Makefile | 1 + trafgen_conf.h | 2 + trafgen_dev.c| 36 +++- trafgen_dev.h| 4 +- trafgen_dump.c | 256 +++ trafgen_dump.h |

[netsniff-ng] [PATCH 1/3] trafgen: Get packet from proto_hdr if possible

2017-07-29 Thread Vadim Kochan
allocated packet. Signed-off-by: Vadim Kochan --- trafgen_l3.c| 4 ++-- trafgen_l4.c| 4 ++-- trafgen_proto.c | 10 -- trafgen_proto.h | 3 +++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/trafgen_l3.c b/trafgen_l3.c index 7199b89..48790e5 100644 --- a/trafgen_l3.c

[netsniff-ng] [PATCH 2/3] trafgen: dev_io: Change read/write to specify struct packet *

2017-07-29 Thread Vadim Kochan
Refactor dev_io_ops read & write to specify struct packet *, it may simplify a bit a caller logic. And it allow to keep required members within one struct packet object. Signed-off-by: Vadim Kochan --- trafgen.c| 25 - trafgen_conf.h | 2 +- trafgen_d

Re: [netsniff-ng] Segmentation fault of mausezahn

2017-07-24 Thread Vadim Kochan
Hi Zhouyang Jia, Your fix looks reasonable. Would you please send patch in git-format (you can look at SubmittingPatches file), or send a pull request ? Thanks, Vadim Kochan On Mon, Jul 24, 2017 at 5:08 PM, Zhouyang Jia wrote: > Hi, > > I'm new to netsniff-ng and I find that

[netsniff-ng] [PATCH v2] trafgen: Delegate creation of rfraw to dev_io API

2017-07-16 Thread Vadim Kochan
Simplify a bit of creation rfraw device by delegating it to the dev_io API, also in case the output device is pcap file the --rfraw option sets the link type to ieee80211 radio tap. Signed-off-by: Vadim Kochan --- trafgen.8 | 3 ++- trafgen.c | 25

[netsniff-ng] [PATCH] trafgen: Delegate creation of rfraw to dev_io API

2017-06-12 Thread Vadim Kochan
Simplify a bit of creation rfraw device by delegating it to the dev_io API, also in case the output device is pcap file the --rfraw option sets the link type to ieee80211 radio tap. Signed-off-by: Vadim Kochan --- trafgen.8 | 3 ++- trafgen.c | 25

[netsniff-ng] [PATCH v2] trafgen: Fix output pcap file name length trimming

2017-06-12 Thread Vadim Kochan
Trim output name to IFNAMSIZ only if the output is a networking device, otherwise the following error occured if output name is greater then IFNAMSIZ: ~/src/netsniff-ng$ trafgen -n 1 '{ udp() }' -o /tmp/xx.pcap No networking device or pcap file: /tmp/xx

[netsniff-ng] Re: [PATCH] trafgen: Fix output pcap file name length trimming

2017-06-12 Thread Vadim Kochan
On Mon, Jun 12, 2017 at 11:38 PM, Vadim Kochan wrote: > Trim output name to IFNAMSIZ only if the output is a networking device, > otherwise the following error occured if output name is greater then > IFNAMSIZ: > > ~/src/netsniff-ng$ trafgen -n 1 '{ udp() }' -o &

[netsniff-ng] [PATCH] trafgen: Fix output pcap file name length trimming

2017-06-12 Thread Vadim Kochan
Trim output name to IFNAMSIZ only if the output is a networking device, otherwise the following error occured if output name is greater then IFNAMSIZ: ~/src/netsniff-ng$ trafgen -n 1 '{ udp() }' -o /tmp/xx.pcap No networking device or pcap file: /tmp/xx

[netsniff-ng] [PATCH v2] trafgen: Allow to generate packets to output pcap file

2017-06-07 Thread Vadim Kochan
(e.g. wlan packets) w/o having some special setup. Signed-off-by: Vadim Kochan --- v2: 1) Fixed "Failed ..." -> "Failed to ..." error messages 2) Fixed indentation in dev_io struct at pcap_magic field 3) Removed not needed dev_net_close function 4) Removed spac

[netsniff-ng] [PATCH] trafgen: Allow to generate packets to output pcap file

2017-06-06 Thread Vadim Kochan
(e.g. wlan packets) w/o having some special setup. Signed-off-by: Vadim Kochan --- trafgen.8| 5 +- trafgen.c| 102 + trafgen/Makefile | 1 + trafgen_dev.c| 263 +++ trafgen_dev.h| 49 +++

[netsniff-ng] [PATCH] flowtop: Move out stats fields from flow & proc entry

2017-06-01 Thread Vadim Kochan
Move rate, bytes & pkts stats fields from flow & proc entry to separate flow_stat struct. Signed-off-by: Vadim Kochan --- flowtop.c | 82 +++ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/flowtop.c b/flowtop

[netsniff-ng] [PATCH 3/4] trafgen: l7: Add DNS header generation API

2017-06-01 Thread Vadim Kochan
ired order. Actually there are only 2 proto_hdr's which describes 4 DNS sections - query & rrecord, because rrecord covers another 3 - answer, auhority, additional which have the same layout. Signed-off-by: Vadim Kochan --- trafgen/Makefile | 1 + trafgen_l4.

[netsniff-ng] [PATCH 0/4] Add DNS proto header support

2017-06-01 Thread Vadim Kochan
ans(name="www.google.com", addr(1.2.3.4))) } { dns(qr=1, ans(name="www.google.com", addr(1::))) } RFC -> PATCH: 1) Removed empty lines after 'break' in switch blocks 2) Use xmemdupz instead malloc + memcpy 3) Squash commit with 'len' parame

[netsniff-ng] [PATCH 4/4] trafgen: parser: Add syntax to generate DNS header

2017-06-01 Thread Vadim Kochan
ng) type - 12 EXAMPLES: { dns(qr=1, auth(name="ns1", ns("ns1.org")), ans(name="www.google.com", cname("google.com")), auth(name="aa", ns("bb")), qry(name="www.google.com")) }

[netsniff-ng] [PATCH 2/4] str: Add function for converting string into DNS name

2017-06-01 Thread Vadim Kochan
Add str2fqdn for converting hostname string into DNS name notation: www..yy.com -> 3www42yy3com0 Returned string must be freed after use by the caller. Signed-off-by: Vadim Kochan --- str.c | 37 + str.h | 1 + 2 files changed, 38 inserti

[netsniff-ng] [PATCH 1/4] trafgen: proto: Allow to set field with variable length

2017-06-01 Thread Vadim Kochan
eal length bytes and after the field needs to be relocated to the right place. Also add 'len' parameter to *_set_bytes(...) functoins to have better control over it. Signed-off-by: Vadim Kochan --- trafgen_l2.c | 6 ++-- trafgen_parser.y | 4 +-- tr

[netsniff-ng] [PATCH] flowtop: Improve and unify up/down scrolling

2017-05-27 Thread Vadim Kochan
is handled by ui part. Signed-off-by: Vadim Kochan --- flowtop.c | 166 -- ui.c | 70 +- ui.h | 13 + 3 files changed, 157 insertions(+), 92 deletions(-) diff --git a/flowtop.c b/flowtop.c index

Re: [netsniff-ng] read 802.1q tags fine, fails to write 802.1q tags to save file

2017-05-19 Thread Vadim Kochan
e, Looks like you are talking when vlan is offloaded ? So netsniff-ng takes this info from kernel control message, and I did not put it into pcap because I decided to keep original packet in pcap file. But may be this is time to change this ? Looks like it is expectable to see the VLAN within pcap e

[netsniff-ng] [PATCH] trafgen: parser: Use proto_field_set_xxx where it is possible

2017-05-13 Thread Vadim Kochan
Use proto_field_set_xxx(field, ...) instead of proto_hdr_field_set_xxx(hdr, fid, ...) to be more generic and do not depent on 'hdr' variable. Signed-off-by: Vadim Kochan --- trafgen_parser.y | 13 ++--- trafgen_proto.c | 5 + trafgen_proto.h | 1 + 3 files c

[netsniff-ng] Re: [RFC 6/7] trafgen: l7: Add DNS header generation API

2017-03-14 Thread Vadim Kochan
On Tue, Mar 14, 2017 at 12:21 PM, Tobias Klauser wrote: > On 2017-01-30 at 09:33:29 +0100, Vadim Kochan wrote: >> Add trafgen_l7.c module with DNS proto header generation with >> support of filling DNS query/answer/authority/additional sections >> as sub headers. >> &

[netsniff-ng] Re: [RFC 0/7] Add DNS proto header support

2017-02-21 Thread Vadim Kochan
On Mon, Jan 30, 2017 at 10:33 AM, Vadim Kochan wrote: > Add trafgen_l7.c module with DNS proto header generation with > support of filling DNS query/answer/authority/additional sections > as sub headers. > > Introcuded new concept as 'sub header' which is needed to e

[netsniff-ng] Re: [RFC 4/7] trafgen: parser: Use proto_field_set_xxx where it is possible

2017-02-13 Thread Vadim Kochan
On Mon, Feb 13, 2017 at 11:18 AM, Tobias Klauser wrote: > On 2017-01-30 at 09:33:27 +0100, Vadim Kochan wrote: >> Use proto_field_set_xxx(field, ...) instead of >> proto_hdr_field_set_xxx(hdr, fid, ...) to be more generic and do not >> depent on 'hdr' variable. &g

[netsniff-ng] Re: [RFC 2/7] trafgen: proto: Add 'len' parameter to *_set_bytes(...) functions

2017-02-09 Thread Vadim Kochan
On Thu, Feb 9, 2017 at 1:02 PM, Tobias Klauser wrote: > On 2017-01-30 at 09:33:25 +0100, Vadim Kochan wrote: >> Add 'len' parameter to *_set_bytes(...) functoins to have better >> control over it. > > While this is certainly a good idea (and you are also going to

[netsniff-ng] [PATCH v2 1/3] pcap_io: Add function to get packet timestamp

2017-02-07 Thread Vadim Kochan
Add pcap_get_tstamp(...) function to get packet's timestamp considering different packet types & bytes order. Signed-off-by: Vadim Kochan --- pcap_io.h | 53 + 1 file changed, 53 insertions(+) diff --git a/pcap_io.h b/pcap_io.h inde

[netsniff-ng] [PATCH v2 3/3] trafgen: man: Add description with pcap file for -i, --in option

2017-02-07 Thread Vadim Kochan
Update -i, --in option with pcap file as input parameter. Signed-off-by: Vadim Kochan --- trafgen.8 | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trafgen.8 b/trafgen.8 index e09b7a0..fd9788a 100644 --- a/trafgen.8 +++ b/trafgen.8 @@ -66,10 +66,13 @@ given scenario

[netsniff-ng] [PATCH v2 0/3] trafgen: Send packets from pcap file

2017-02-07 Thread Vadim Kochan
k if input pcap file was specified. 3) Replace strcmp("0", ...) to 'if (!rate)' BTW, shaper still works at usec minimum time precision so I did not convert it to nsec yet, but I plan to do it in future patches if it is OK. Vadim Kochan (3): pcap_io: Add function to ge

[netsniff-ng] [PATCH v2 2/3] trafgen: Allow send packets from pcap file

2017-02-07 Thread Vadim Kochan
Add ability to send packets from pcap file if it has ".pcap" extension via "-i,--in" option. By default packet sending is delayed considering original packets timestamps if no rate or delay is specified via -b/-t options. Signed-off-by: Vadim Kochan --- tr

[netsniff-ng] [PATCH v2] trafgen: l3: Make possible to send frames via tun device

2017-02-06 Thread Vadim Kochan
tun interface does not have Ethernet header so lets push Ethernet header only if device supports this. Signed-off-by: Vadim Kochan --- trafgen_l3.c| 15 --- trafgen_proto.c | 5 + trafgen_proto.h | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a

[netsniff-ng] [PATCH] geoip: Fix memory leak when using GeoIPRecord

2017-02-04 Thread Vadim Kochan
d to also free obtained city/region in netsniff-ng, astraceroute & flowtop tools. Fixes: #169 Signed-off-by: Vadim Kochan --- astraceroute.c | 10 - flowtop.c | 4 +- geoip.c| 114 + geoip.h| 8 ++-- prot

[netsniff-ng] Re: [PATCH] trafgen: l3: Make possible to send frames via tun device

2017-02-01 Thread Vadim Kochan
On Thu, Feb 2, 2017 at 6:37 AM, Vadim Kochan wrote: > tun interface does not have Ethernet header so lets push Ethernet > header only if device supports this. > > Signed-off-by: Vadim Kochan > --- > dev.c | 18 ++ > dev.h | 4 &g

[netsniff-ng] [PATCH] trafgen: l3: Make possible to send frames via tun device

2017-02-01 Thread Vadim Kochan
tun interface does not have Ethernet header so lets push Ethernet header only if device supports this. Signed-off-by: Vadim Kochan --- dev.c | 18 ++ dev.h | 4 trafgen_l3.c| 15 --- trafgen_proto.c | 5 + trafgen_proto.h | 2 ++ 5

[netsniff-ng] [PATCH 2/3] trafgen: Allow send packets from pcap file

2017-01-31 Thread Vadim Kochan
Add ability to send packets from pcap file if it has ".pcap" extension via "-i,--in" option. By default packet sending is delayed considering original packets timestamps if no rate or delay is specified via -b/-t options. Signed-off-by: Vadim Kochan --- tr

[netsniff-ng] [PATCH 3/3] trafgen: man: Add description with pcap file for -i, --in option

2017-01-31 Thread Vadim Kochan
Update -i, --in option with pcap file as input parameter. Signed-off-by: Vadim Kochan --- trafgen.8 | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trafgen.8 b/trafgen.8 index e09b7a0..fd9788a 100644 --- a/trafgen.8 +++ b/trafgen.8 @@ -66,10 +66,13 @@ given scenario

[netsniff-ng] [PATCH 1/3] pcap_io: Add function to get packet timestamp

2017-01-31 Thread Vadim Kochan
Add pcap_get_tstamp(...) function to get packet's timestamp considering different packet types & bytes order. Signed-off-by: Vadim Kochan --- pcap_io.h | 53 + 1 file changed, 53 insertions(+) diff --git a/pcap_io.h b/pcap_io.h inde

[netsniff-ng] [PATCH 0/3] trafgen: Send packets from pcap file

2017-01-31 Thread Vadim Kochan
Allow to send packets at specified rate from ".pcap" file which might be speified via -i,--in options. By default packets will be send at original rate considering packet's timestamp. Vadim Kochan (3): pcap_io: Add function to get packet timestamp trafgen: Allow send packets

Re: [netsniff-ng] Mausezahn - virtual nic "unknown physical layer type"

2017-01-31 Thread Vadim Kochan
BTW I did grep over the kernel and looks like it might the 'tun' device. On Tue, Jan 31, 2017 at 12:38 PM, Vadim Kochan wrote: > On Tue, Jan 31, 2017 at 12:36 PM, Vadim Kochan wrote: >> On Tue, Jan 31, 2017 at 12:47 AM, Jojonix1-Web wrote: >>> Hello dear netsniff

Re: [netsniff-ng] Mausezahn - virtual nic "unknown physical layer type"

2017-01-31 Thread Vadim Kochan
On Tue, Jan 31, 2017 at 12:36 PM, Vadim Kochan wrote: > On Tue, Jan 31, 2017 at 12:47 AM, Jojonix1-Web wrote: >> Hello dear netsniff team >> >> >> >> My name is Jonathan, I am an IT specialist from Germany and I have some >> difficulties with Mausezahn. &g

Re: [netsniff-ng] Mausezahn - virtual nic "unknown physical layer type"

2017-01-31 Thread Vadim Kochan
; For more options, visit https://groups.google.com/d/optout. Hi Jonathan, 1st thing which comes to mind is that the link type of this interface is "none" or "void", and libnet can't handle it. Could you please give some details about this interface with 'ip link' an

[netsniff-ng] [RFC 7/7] trafgen: parser: Add syntax to generate DNS header

2017-01-30 Thread Vadim Kochan
ng) type - 12 EXAMPLES: { dns(qr=1, auth(name="ns1", ns("ns1.org")), ans(name="www.google.com", cname("google.com")), auth(name="aa", ns("bb")), qry(name="www.google.com")) }

[netsniff-ng] [RFC 6/7] trafgen: l7: Add DNS header generation API

2017-01-30 Thread Vadim Kochan
ired order. Actually there are only 2 proto_hdr's which describes 4 DNS sections - query & rrecord, because rrecord covers another 3 - answer, auhority, additional which have the same layout. Signed-off-by: Vadim Kochan --- trafgen/Makefile | 1 + trafgen_l4

[netsniff-ng] [RFC 4/7] trafgen: parser: Use proto_field_set_xxx where it is possible

2017-01-30 Thread Vadim Kochan
Use proto_field_set_xxx(field, ...) instead of proto_hdr_field_set_xxx(hdr, fid, ...) to be more generic and do not depent on 'hdr' variable. Signed-off-by: Vadim Kochan --- trafgen_parser.y | 13 ++--- trafgen_proto.c | 5 + trafgen_proto.h | 1 + 3 files c

[netsniff-ng] [RFC 1/7] trafgen: parser: Rename bytes -> mac

2017-01-30 Thread Vadim Kochan
Rename token member to as it is used only for MAC address parsing, for dynamic sized bytes array we have an . Signed-off-by: Vadim Kochan --- trafgen_lexer.l | 2 +- trafgen_parser.y | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/trafgen_lexer.l b

[netsniff-ng] [RFC 0/7] Add DNS proto header support

2017-01-30 Thread Vadim Kochan
type - 12 EXAMPLES: { dns(qr=1, auth(name="ns1", ns("ns1.org")), ans(name="www.google.com", cname("google.com")), auth(name="aa", ns("bb")), qry(name="www.google.com")) } { dns(qr=1,

[netsniff-ng] [RFC 3/7] trafgen: proto: Allow to set field with variable length

2017-01-30 Thread Vadim Kochan
eal length bytes and after the field needs to be relocated to the right place. Signed-off-by: Vadim Kochan --- trafgen_proto.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/trafgen_proto.c b/trafgen_proto.c index 0530032..83a6a7e 10

[netsniff-ng] [RFC 2/7] trafgen: proto: Add 'len' parameter to *_set_bytes(...) functions

2017-01-30 Thread Vadim Kochan
Add 'len' parameter to *_set_bytes(...) functoins to have better control over it. Signed-off-by: Vadim Kochan --- trafgen_l2.c | 6 +++--- trafgen_parser.y | 4 ++-- trafgen_proto.c | 48 trafgen_proto.h | 4 ++-- 4 files c

[netsniff-ng] [RFC 5/7] str: Add function for converting string into DNS name

2017-01-30 Thread Vadim Kochan
Add str2fqdn for converting hostname string into DNS name notation: www..yy.com -> 3www42yy3com0 Returned string must be freed after use by the caller. Signed-off-by: Vadim Kochan --- str.c | 37 + str.h | 1 + 2 files changed, 38 inserti

[netsniff-ng] Re: [PATCH] trafgen: l3: Fix checksum for UDP/TCP protos

2017-01-25 Thread Vadim Kochan
On Wed, Jan 25, 2017 at 2:24 PM, Tobias Klauser wrote: > On 2017-01-23 at 22:49:22 +0100, Vadim Kochan wrote: >> While fixing the issue with getting of IPv4 address from device, >> the setting of default src IPv4/IPv6 addresses was moved from >> hdr->header_i

[netsniff-ng] [PATCH] trafgen: l3: Fix checksum for UDP/TCP protos

2017-01-23 Thread Vadim Kochan
d5142c8. Fixes: c4e07d5142c8 ("trafgen: l3: Support interface without IP address") Signed-off-by: Vadim Kochan --- trafgen_l3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trafgen_l3.c b/trafgen_l3.c index 4d67f58..70aefb9 100644 --- a/trafgen_l3.c +++ b/trafgen_l3.c

[netsniff-ng] [PATCH v2 2/2] flowtop: Add process UI tab entry

2017-01-18 Thread Vadim Kochan
flows related to it (flows_count is 0), if the process exists then dst & src rates info is zeroed and summed from the all related flows which are in the proc_entry->flows list. The bytes & pkts amount info is collected during all the time process exists. Signed-off-by: Vadim Kochan ---

[netsniff-ng] [PATCH v2 1/2] flowtop: Add tab control to switch between tables

2017-01-18 Thread Vadim Kochan
-compat.h header. Signed-off-by: Vadim Kochan --- flowtop.c | 26 +-- ui.c | 97 -- ui.h | 34 +-- urcu-list-compat.h | 21 4 files changed, 171 insertions(+), 7 deletions

[netsniff-ng] [PATCH v2 0/2] flowtop: Add UI tab control for process stats

2017-01-18 Thread Vadim Kochan
. 4) In flow_entry_find_process(...) use proc_entry->name member instead of local procname string. 5) Rename proc_exist -> proc_exists 6) Rename proc_entry.procnnum -> pid 7) Rename proc_entry.procname -> name Vadim Kochan (2): flowtop: Add tab control to switch between tables

[netsniff-ng] [PATCH 1/2] flowtop: Add tab control to switch between tables

2017-01-18 Thread Vadim Kochan
. Signed-off-by: Vadim Kochan --- flowtop.c | 26 +++-- list.h| 19 + ui.c | 95 ++- ui.h | 30 4 files changed, 166 insertions(+), 4 deletions(-) create mode 100644 list.h diff

[netsniff-ng] [PATCH 0/2] flowtop: Add UI tab control for process stats

2017-01-18 Thread Vadim Kochan
ains just missing cds_list_{next,prev,last}_entry functions which are needed for navigation over UI tab entries. Vadim Kochan (2): flowtop: Add tab control to switch between tables flowtop: Add process UI tab entry flowtop.c |

[netsniff-ng] [PATCH 2/2] flowtop: Add process UI tab entry

2017-01-18 Thread Vadim Kochan
Add process UI tab entry to show flows statistics per pid. Also changed flow_entry which now has pointer to new struct proc_entry object which contains process related info. On each 1 second refresh proc_entry is checked if it exists by checking /proc/ path, and is deleted if there is no any flow

[netsniff-ng] Re: list: Remove cds_list_* wrappers

2017-01-17 Thread Vadim Kochan
On Tue, Jan 17, 2017 at 5:30 PM, Vadim Kochan wrote: > Hi Tobias, > > Just some thoughts from me regarding this commit, if the below > can make a sense. > > In case if list_head (now cds_list_head) will be used by other modules > and lets imagine that we will get rid of li

[netsniff-ng] Re: list: Remove cds_list_* wrappers

2017-01-17 Thread Vadim Kochan
have copy-paste cds_* API from urcu or have a wrappers for it, so may be it is better to have generic name w/o cds_ prefix ? Regards, Vadim Kochan -- You received this message because you are subscribed to the Google Groups "netsniff-ng" group. To unsubscribe from this group and stop

[netsniff-ng] Re: flowtop: Example of UI tabs interface

2017-01-13 Thread Vadim Kochan
On Fri, Jan 13, 2017 at 3:07 PM, Daniel Borkmann wrote: > On 01/13/2017 02:02 PM, Vadim Kochan wrote: >> >> Hi, >> >> I tried to extend flowtop UI to have some aggregated info via tabbed >> panel interface. >> Currently there is only 1 new "Proce

[netsniff-ng] Re: [PATCH] flowtop: Replace single linked list by list_head from list.h

2017-01-13 Thread Vadim Kochan
On Thu, Jan 12, 2017 at 5:20 PM, Tobias Klauser wrote: > On 2017-01-12 at 15:54:31 +0100, Vadim Kochan wrote: >> On Thu, Jan 12, 2017 at 4:28 PM, Tobias Klauser wrote: > [...] >> >> enum flow_direction { >> >> @@ -355,15 +357,15 @@ static inline struct flow_

[netsniff-ng] [PATCH v2] flowtop: Replace single linked list by list_head from list.h

2017-01-13 Thread Vadim Kochan
(...) therefor no need to use nfct_clone(n). Signed-off-by: Vadim Kochan --- v2: 1) Use call_rcu(...) instead of custom free list & synchronize_rcu() 2) Removed locking.h include after get rid of spinlock_xxx usage. 3) Return NFCT_CB_STOLEN status to manually do nfct_destroy(n) for

[netsniff-ng] [PATCH] flowtop: Replace single linked list by list_head from list.h

2017-01-12 Thread Vadim Kochan
(...) therefor no need to use nfct_clone(n). Signed-off-by: Vadim Kochan --- flowtop.c | 148 -- 1 file changed, 47 insertions(+), 101 deletions(-) diff --git a/flowtop.c b/flowtop.c index f48f5c8..3cee0ec 100644 --- a/flowtop.c +++ b/flowtop.c

[netsniff-ng] Re: [PATCH] flowtop: Replace single linked list by list_head from list.h

2017-01-12 Thread Vadim Kochan
On Thu, Jan 12, 2017 at 5:20 PM, Tobias Klauser wrote: > On 2017-01-12 at 15:54:31 +0100, Vadim Kochan wrote: >> On Thu, Jan 12, 2017 at 4:28 PM, Tobias Klauser wrote: > [...] >> >> enum flow_direction { >> >> @@ -355,15 +357,15 @@ static inline struct flow_

[netsniff-ng] Re: [PATCH] flowtop: Replace single linked list by list_head from list.h

2017-01-12 Thread Vadim Kochan
you maybe have a quick look? > > On 2017-01-09 at 07:26:07 +0100, Vadim Kochan wrote: >> list.h provides generic Linux-like linked list API which also supports >> RCU list operations. >> >> Also additionally was removed the spinlock which is not needed for >>

[netsniff-ng] Re: [PATCH 0/4] Introduce new pcap io API for pcap r/w accesses

2017-01-12 Thread Vadim Kochan
On Wed, Dec 14, 2016 at 11:33 PM, Vadim Kochan wrote: > On Wed, Dec 14, 2016 at 11:26 PM, Tobias Klauser wrote: >> On 2016-12-12 at 22:09:52 +0100, Vadim Kochan wrote: >>> Add new pcap io API to make pcap read/write accesses more >>> simpler and generic. Added pcap_i

[netsniff-ng] [PATCH] flowtop: Replace single linked list by list_head from list.h

2017-01-08 Thread Vadim Kochan
. Because of full RCU support now flows are freed after grace-period via calling synchronize_rcu() and these removed-and-ready-to-free entries are kept in separate struct list_head. Signed-off-by: Vadim Kochan --- flowtop.c | 121 +++--- 1 file

[netsniff-ng] Re: New trafgen syntax and some ICMP examples

2017-01-05 Thread Vadim Kochan
On Thu, Jan 05, 2017 at 04:00:36PM +0100, Jesper Dangaard Brouer wrote: > Hi Vadim, > > I just noticed the new trafgen syntax, I really like it. > > I was playing with testing the kernels ICMP handling code and > validating some change to the icmp rate-limiting, and wrote an trafgen > conf for ge

[netsniff-ng] [PATCH] flowtop: Minimize delay via halfdelay(1) function

2017-01-02 Thread Vadim Kochan
Use halfdelay(1) to poll keyboard input with delay in 1 tenth of second and get rid of custom usleep(...) using. With this approach (it is also used in htop tool) the key events are more sensitive to user inputs. Signed-off-by: Vadim Kochan --- flowtop.c | 3 +-- 1 file changed, 1 insertion

Re: [netsniff-ng] trafgen cfg: automatically padding dynamic values to sizes larger than 1 octet

2016-12-21 Thread Vadim Kochan
92.169.1.1) < lo 54 1482265603s.917127151ns #6 [ IPv4 Addr (127.0.0.1 => 192.170.1.1) As you see you need to 1st set initial field value and then set this field with dynamic function at specific offset, we will try to implement some better short alternative syntax. Let

[netsniff-ng] [PATCH v3] man: trafgen: Add short description about field offset using

2016-12-21 Thread Vadim Kochan
Add short note about field offset syntax with an example. Signed-off-by: Vadim Kochan --- v2: Change commit messages and man file that field offset expression is used with function expression, and added validation for it in trafgen parser. v3: Add some examples with new field

[netsniff-ng] Re: [PATCH v2 6/7] trafgen: parser: Allow to set function at field offset

2016-12-21 Thread Vadim Kochan
On Wed, Dec 21, 2016 at 10:17:17AM +0100, Tobias Klauser wrote: > On 2016-12-20 at 22:10:54 +0100, Vadim Kochan wrote: > > On Tue, Dec 20, 2016 at 12:33:47PM +0100, Tobias Klauser wrote: > > > On 2016-12-18 at 10:52:49 +0100, Vadim Kochan wrote: > > > > Ex

[netsniff-ng] Re: [PATCH v2 6/7] trafgen: parser: Allow to set function at field offset

2016-12-20 Thread Vadim Kochan
On Tue, Dec 20, 2016 at 12:33:47PM +0100, Tobias Klauser wrote: > On 2016-12-18 at 10:52:49 +0100, Vadim Kochan wrote: > > Extend proto field expression to: > > > > proto_field[{index}:{len}] = {func} > > I like the idea behind this very much, but I'm n

[netsniff-ng] [PATCH v2 2/7] trafgen: proto: Change __proto_field_set_bytes(...) to take field

2016-12-18 Thread Vadim Kochan
Change __proto_field_set_bytes(...) function to take struct proto_field instead of do looup by hdr & fid. It is needed to able use this function with some custom modified struct proto_field (len, pkt_offset). Signed-off-by: Vadim Kochan --- trafgen_proto.c

[netsniff-ng] [PATCH v2 4/7] trafgen: proto: Add proto field only setters/getters

2016-12-18 Thread Vadim Kochan
Add proto_field_xxx functions to set/get value via specified proto_field only. It is good to have such API in case if application needs to set/get value for some custom proto_field instance. Signed-off-by: Vadim Kochan --- trafgen_proto.c | 46

[netsniff-ng] [PATCH v2 6/7] trafgen: parser: Allow to set function at field offset

2016-12-18 Thread Vadim Kochan
piece of header. Signed-off-by: Vadim Kochan --- trafgen_parser.y | 168 +++ trafgen_proto.c | 27 - trafgen_proto.h | 8 ++- 3 files changed, 136 insertions(+), 67 deletions(-) diff --git a/trafgen_parser.y b/trafgen_parser.y index

[netsniff-ng] [PATCH v2 7/7] man: trafgen: Add short description about field offset using

2016-12-18 Thread Vadim Kochan
Add short note about field offset syntax with an example. Signed-off-by: Vadim Kochan --- trafgen.8 | 25 + 1 file changed, 25 insertions(+) diff --git a/trafgen.8 b/trafgen.8 index 62716bb..d669c2a 100644 --- a/trafgen.8 +++ b/trafgen.8 @@ -329,6 +329,31 @@ Example of

[netsniff-ng] [PATCH v2 3/7] trafgen: proto: Rename proto_field_xxx -> proto_hdr_field_xxx

2016-12-18 Thread Vadim Kochan
proto_field. Signed-off-by: Vadim Kochan --- trafgen_l2.c | 44 - trafgen_l3.c | 24 +- trafgen_l4.c | 28 +-- trafgen_parser.y | 64 - trafgen_proto.c | 144 --- trafgen_proto.h

[netsniff-ng] [PATCH v2 5/7] trafgen: parser: Parse IPv6 address by strict match pattern

2016-12-18 Thread Vadim Kochan
Used IPv6 pattern from nftables project to match valid only IPv6 address to do not mess with MAC or other syntax patterns with ':' symbol. Signed-off-by: Vadim Kochan --- trafgen_lexer.l | 51 +++ trafgen_parser.y | 2 +- 2 files c

[netsniff-ng] [PATCH v2 0/7] trafgen: Allow set proto field function at specific offset

2016-12-18 Thread Vadim Kochan
nd added validation for it in trafgen parser. Vadim Kochan (7): trafgen: parser: Rename field_expr -> field_value_expr rule trafgen: proto: Change __proto_field_set_bytes(...) to take field trafgen: proto: Rename proto_field_xxx -> proto_hdr_field_xxx trafgen: proto: Add proto field only s

[netsniff-ng] [PATCH v2 1/7] trafgen: parser: Rename field_expr -> field_value_expr rule

2016-12-18 Thread Vadim Kochan
Rename field_expr rule to field_value_expr to indicate the rule relates to field value part in case if there will be added field_expr rule to describe field expression syntax. Signed-off-by: Vadim Kochan --- trafgen_parser.y | 30 +++--- 1 file changed, 15 insertions

[netsniff-ng] Re: [PATCH 0/7] trafgen: Allow set proto field value at specific offset

2016-12-18 Thread Vadim Kochan
On Sat, Dec 17, 2016 at 4:37 PM, Vadim Kochan wrote: > Extend field expression with the following syntax: > > [] | [:] > > which allows to specify value or function at specified offset relative to the > field's offset within a header. > > The trick to implem

[netsniff-ng] [PATCH v4] flowtop: Move & refactor walk_processes(...) to proc.c

2016-12-17 Thread Vadim Kochan
Add proc_find_by_inode(...) in proc.c which finds pid by inode & gets processe's command line and use it in the flowtop.c instead of walk_processes(...). Signed-off-by: Vadim Kochan --- v2: 1) Remove sys/stat.h & dirent.h from flowtop.c includes. 2) Add static to __match

[netsniff-ng] [PATCH 2/7] trafgen: proto: Change __proto_field_set_bytes(...) to take field

2016-12-17 Thread Vadim Kochan
Change __proto_field_set_bytes(...) function to take struct proto_field instead of do looup by hdr & fid. It is needed to able use this function with some custom modified struct proto_field (len, pkt_offset). Signed-off-by: Vadim Kochan --- trafgen_proto.c

[netsniff-ng] [PATCH 0/7] trafgen: Allow set proto field value at specific offset

2016-12-17 Thread Vadim Kochan
llows to specify different functions for the same field and with different offsets. Vadim Kochan (7): trafgen: parser: Rename field_expr -> field_value_expr rule trafgen: proto: Change __proto_field_set_bytes(...) to take field trafgen: proto: Rename proto_field_xxx -> proto_hdr_field

  1   2   3   4   5   6   7   8   >