Add tcp_length
This commit is contained in:
parent
64109ce917
commit
b795374efb
2 changed files with 3 additions and 2 deletions
|
@ -79,6 +79,7 @@ struct headers {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct metadata {
|
struct metadata {
|
||||||
|
bit<16> tcp_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -23,7 +23,7 @@ parser MyParser(packet_in packet,
|
||||||
|
|
||||||
state ipv4 {
|
state ipv4 {
|
||||||
packet.extract(hdr.ipv4);
|
packet.extract(hdr.ipv4);
|
||||||
meta.tcpLength = hdr.ipv4.totalLen - 16w20;
|
meta.tcp_length = hdr.ipv4.totalLen - 16w20;
|
||||||
|
|
||||||
transition select(hdr.ipv4.protocol){
|
transition select(hdr.ipv4.protocol){
|
||||||
TYPE_TCP: tcp;
|
TYPE_TCP: tcp;
|
||||||
|
@ -33,7 +33,7 @@ parser MyParser(packet_in packet,
|
||||||
|
|
||||||
state ipv6 {
|
state ipv6 {
|
||||||
packet.extract(hdr.ipv6);
|
packet.extract(hdr.ipv6);
|
||||||
meta.tcpLength = hdr.ipv6.payload_length;
|
meta.tcp_length = hdr.ipv6.payload_length;
|
||||||
|
|
||||||
transition select(hdr.ipv6.next_header){
|
transition select(hdr.ipv6.next_header){
|
||||||
TYPE_TCP: tcp;
|
TYPE_TCP: tcp;
|
||||||
|
|
Loading…
Reference in a new issue