Giter VIP home page Giter VIP logo

p4-wireshark-dissector's Introduction

P4 Wireshark Dissector Generator

P4 Wireshark dissector generator is a tool that allows P4 programmers to quickly generate a Wireshark dissector in Lua from the headers defined within a P4 file.

Requirements

  • P4 input file
  • P4-HLIR
  • Wireshark

Installation

To install, execute the setup script using:

sudo python setup.py install

Generating a dissector

To generate a dissector, run p4-gen-wireshark from your command line. The syntax is:

p4-gen-wireshark [-d <destination>] [-p <protocol>] <p4_source>

where:

-d <destination>
Destination file. If none given, the destination has the form
<pwd>/<p4_source>-<protocol>.lua

-p <protocol>
Protocol in P4 source file for which to build a dissector. Use instance
rather than header name (i.e. without a "_t" at the end). If none is given,
build a dissector for every protocol.

<p4_source>
P4 source file.

Using dissectors

To use your dissector with Wireshark, open a terminal window and type:

wireshark -X lua_script:<dissector>

where:

<dissector>
Is the filename of your generated dissector.

Running unit tests

You first need to install the pytest Python package. You can then run:

pytest tests/test_p4_gen.py

p4-wireshark-dissector's People

Contributors

gnikol avatar antoninbas avatar seanschoi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.