X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=GPL%2Ftraffic_scripts%2Fvxlan.py;h=25d2d60ed839ff3a7b19f1a9b5bb569b3130e254;hb=9d14c2d71ce85fe95aa9a2321738abb25d032b0c;hp=985784d6f5728e05dde7442fb9a4fd95fe6952e3;hpb=a5eed81d7d04e0d23186781a79031f392b432ce8;p=csit.git diff --git a/GPL/traffic_scripts/vxlan.py b/GPL/traffic_scripts/vxlan.py index 985784d6f5..25d2d60ed8 100644 --- a/GPL/traffic_scripts/vxlan.py +++ b/GPL/traffic_scripts/vxlan.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # @@ -12,7 +12,8 @@ # # Note: If this file is linked with Scapy, which is GPLv2+, your use of it # must be under GPLv2+. If at any point in the future it is no longer linked -# with Scapy (or other GPLv2+ licensed software), you are free to choose Apache 2. +# with Scapy (or other GPLv2+ licensed software), you are free to choose +# Apache 2. # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -20,6 +21,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Traffic script for vxlan verification.""" + from scapy.fields import BitField, XByteField, X3BytesField from scapy.layers.inet import UDP from scapy.layers.l2 import Ether @@ -27,6 +30,8 @@ from scapy.packet import Packet, bind_layers class VXLAN(Packet): + """Custom scapy layer override for VXLAN.""" + name = u"VXLAN" fields_desc = [ BitField(u"flags", 0x08000000, 32), @@ -37,5 +42,6 @@ class VXLAN(Packet): def mysummary(self): return self.sprintf(f"VXLAN (vni={VXLAN.vni})") + bind_layers(UDP, VXLAN, dport=4789) bind_layers(VXLAN, Ether)