summaryrefslogtreecommitdiffstats
path: root/test/test_bier.py
AgeCommit message (Expand)AuthorFilesLines
2020-10-21ip: convert u32 entry_flags to vl_api_mfib_entry_flags_t on mroute APINeale Ranns1-24/+40
2019-12-14tests: changes for scapy 2.4.3 migrationsnaramre1-1/+1
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
2019-10-21bier: tests support python3Ole Troan1-1/+1
2019-06-18fib: fib api updatesNeale Ranns1-16/+22
2019-05-16tests: refactor. Replace literal constant w/ named constant.Paul Vinciguerra1-2/+4
2019-03-12FIB: path parsing, table-id not fib-index (VPP-1586)Neale Ranns1-4/+6
2019-03-11VPP-1508: Use scapy.compat to manage packet level library differences.Paul Vinciguerra1-22/+24
2019-03-11Tests: use self.assertNotIn().Paul Vinciguerra1-1/+1
2019-03-01Tests: Remove all wildcard imports.Paul Vinciguerra1-6/+6
2018-12-20Tests: Cleanup @skip decorator.Paul Vinciguerra1-8/+8
2018-09-25BIER; bi-dir to/from underlayNeale Ranns1-0/+31
2018-09-20UDP-Encap: name counters for the stats segmentNeale Ranns1-3/+3
2018-09-14BIER API and load-balancing fixesNeale Ranns1-0/+94
2018-09-11GBP Endpoint UpdatesNeale Ranns1-1/+2
2018-03-20FIB Interpose SourceNeale Ranns1-17/+24
2018-03-09MPLS Unifom modeNeale Ranns1-13/+16
2018-02-16Allow providers to override glean behaviourNeale Ranns1-1/+1
2018-02-15Revert "Allow interface types to override glean adjacency behaivour"Ole Trøan1-1/+1
2018-02-15Allow interface types to override glean adjacency behaivourNeale Ranns1-1/+1
2018-02-06BIER: fix support for longer bit-string lengthsNeale Ranns1-77/+188
2018-01-09BIER: missing endian swap for imposition object in API returnNeale Ranns1-2/+6
2018-01-09test: consolidate the multiple versions of send_and_*Neale Ranns1-15/+0
2017-12-14BIER disposition default routeNeale Ranns1-0/+25
2017-12-09BIER in non-MPLS netowrksNeale Ranns1-10/+193
2017-11-09BIERNeale Ranns1-0/+390
.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright (c) 2017 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
This module implements the VxLAN/VXLAN-GPE/NSH protocol
for the packet analyse.
"""
from scapy.all import Packet
from scapy.all import XByteField, ShortField
from scapy.all import BitField, XBitField, IntField

class VxLAN(Packet):
    """Define the vxlan protocol for the packet analysis."""
    name = "vxlan"
    fields_desc = [XByteField("flags", 0x08), BitField("reserved", 0, 24),
                   BitField("vni", 0, 24), XByteField("reserved", 0x00)]

class VxLANGPE(Packet):
    """Define the vxlan-gpe protocol for the packet analysis."""
    name = "vxlan-gpe"
    fields_desc = [XByteField("flags", 0x0c), ShortField("reserved", 0),
                   XByteField("nextproto", 0x3), BitField("vni", 0, 24),
                   XByteField("reserved", 0x0)]

class NSH(Packet):
    """Define the NSH protocol for the packet analysis."""
    name = "nsh"
    fields_desc = [XBitField("Version", 0x0, 2), XBitField("OAM", 0x0, 1),
                   XBitField("Unassigned", 0x0, 1), XBitField("TTL", 0x0, 6),
                   XBitField("length", 0x6, 6), XBitField("Unassigned", 0x0, 4),
                   XBitField("MDtype", 0x1, 4), XByteField("nextproto", 0x3),
                   IntField("nsp_nsi", 0), IntField("c1", 0),
                   IntField("c2", 0), IntField("c3", 0), IntField("c4", 0)]