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

2016-02-07 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|exp Traffic Class (TC) ttl TTL (Time To Live) Currently only unicast MPLS is supported, but

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

2016-02-07 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