Skip to content

Instantly share code, notes, and snippets.

@jeffbrl
Created January 5, 2015 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffbrl/9bc210b245e9868e8b88 to your computer and use it in GitHub Desktop.
Save jeffbrl/9bc210b245e9868e8b88 to your computer and use it in GitHub Desktop.
First Example for Snabbswitch Getting Started Guide - sprayer.lua
#!/usr/bin/env snabbswitch
local app = require("core.app")
local config = require("core.config")
local pcap = require("apps.pcap.pcap")
local link = require("core.link")
local RawSocket = require("apps.socket.raw")
local c = config.new()
config.app(c, "capture", pcap.PcapReader, "input.pcap")
config.app(c, "sprayer", RawSocket, "eth0")
config.link(c, "capture.output -> sprayer.rx")
app.configure(c)
app.main({duration=1})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment