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

2017-06-01 Thread Vadim Kochan
It is quite tricky to set field value with a variable length (i.e. DNS query name), to make it possible the field needs to be added to header with 'len=0' in that case there will be no any payload allocation, but only while setting the field value the packet will be appended with a real length

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

2017-06-01 Thread Vadim Kochan
Add new syntax for DNS header generation via 'dns()' proto function. The fields are supported: id - 16 bit identifier qr - message is a query(0) or response(1) op|oper - specified kind of query aanswer - authoritative

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

2017-06-01 Thread Vadim Kochan
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 easy handle DNS sections which might be added on-demand, and to simplify using sub-header as

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

2017-06-01 Thread Vadim Kochan
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 easy handle DNS sections which might be added on-demand, and to simplify using sub-header as

[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

[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