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

2016-02-03 Thread Tobias Klauser
Hi Vadim On 2016-02-02 at 20:26:34 +0100, Vadim Kochan wrote: > I am thinking if it is OK to add automatic padding for Ethernet frames > by filling 0s if packet len is less than 64 bytes ? I don't think this is needed. Users might want to send explicitly send less than 64 bytes on purpose (i.e.

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

2016-02-03 Thread Tobias Klauser
On 2016-02-02 at 17:27:26 +0100, Vadim Kochan wrote: > 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.

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

2016-02-03 Thread Vadim Kochan
Add 'mpls()' function to create MPLS header with fields: Label, TClass, Bottom-Stack, TTL By default EtherType is set to MPLS Unicast (0x8847). Added man changes as well. By default bottom-stack (S-flag) is set to 1 but resets to 0 after the lower MPLS was added. As future extensions for 'mpl

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

2016-02-03 Thread Vadim Kochan
Add 'mpls()' function for creating MPLS header with parameters: lbl|label MPLS label lastIndicates the last label on MPLS stack tc|tclass Traffic Class ttl TTL (Time To Live) Currently only unicast MPLS is supported, but multicas

[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 deletions(-) diff --gi

[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 1/4] trafgen: proto: Fix bad field masking

2016-02-03 Thread Vadim Kochan
Current logic does OR of existing field value & shift-masked specified value, which is not enough as 0s bits from the specified value will be not set (be cause of OR), so fixed it by reseting original field value by AND with reverted field mask, in otherwords - bits part of original field value is