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 'mpls()' function might be: 1) Allow to mark MPLS header as multicast via setting EtherType to 0x8848 like: mpls(mc) or mpls(mcast) 2) Add parameters for specific label values: mpls(alert) Also fixed issue with incorrect field bit-masking which uses only OR to merge specified & original value which does not allow to set 0 value, now the original value is AND-ed with reversed field mask, so the required bits are reset to 0s in original value and then OR-ed with specified value. The problem actually apperead while setting S-flag to 0 when the 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 trafgen: parser: Add syntax for MPLS header creating trafgen: man: Add description for 'mpls()' function trafgen.8 | 29 +++++++++++++++++++++++++++-- trafgen_l2.c | 32 ++++++++++++++++++++++++++++++++ trafgen_l2.h | 7 +++++++ trafgen_lexer.l | 6 ++++++ trafgen_parser.y | 29 ++++++++++++++++++++++++++++- trafgen_proto.c | 24 ++++++++++++++++++++---- trafgen_proto.h | 1 + 7 files changed, 121 insertions(+), 7 deletions(-) -- 2.6.3 -- 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...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.