diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2016-02-08 08:01:53 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-02-23 13:23:53 +0100 |
commit | d1dfc01a4068e3c15a1195f804448a9a3dee5b2b (patch) | |
tree | e0043241653c749215c52db74ed14b96b01abc50 /trafgen_lexer.l | |
parent | 116835ed0d245f3e73173f2f2057265827416ce6 (diff) |
trafgen: parser: Add syntax for MPLS header creating
Add 'mpls()' function for creating MPLS header with parameters:
lbl|label MPLS label
last Indicates the last label on MPLS stack
tc|tclass|exp Traffic Class (TC)
ttl TTL (Time To Live)
Currently only unicast MPLS is supported, but multicast might be set
via 'eth()' function.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_lexer.l')
-rw-r--r-- | trafgen_lexer.l | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/trafgen_lexer.l b/trafgen_lexer.l index e1d1a3f..3c624f8 100644 --- a/trafgen_lexer.l +++ b/trafgen_lexer.l @@ -120,6 +120,12 @@ ip4_addr ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+) "1ad" { return K_1AD; } "1q" { return K_1Q; } + /* MPLS (Multi Protocol Label Switching) */ +"lbl"|"label" { return K_LABEL; } +"last" { return K_LAST; } +"tc"|"tclass" { return K_TC; } +"exp" { return K_EXP; } + /* ARP */ "sha"|"smac" { return K_SHA; } "spa"|"sip" { return K_SPA; } @@ -167,6 +173,7 @@ ip4_addr ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+) "eth" { return K_ETH; } "vlan" { return K_VLAN; } +"mpls" { return K_MPLS; } "arp" { return K_ARP; } "ip4"|"ipv4" { return K_IP4; } "udp" { return K_UDP; } |