Code Monkey home page Code Monkey logo

tzsp2pcap's Introduction

tzsp2pcap

Introduction

This is a simple utility to listen for TaZmen Sniffer Protocol (TZSP) packets and output the contents on stdout in pcap format. It has only been lightly tested with Mikrotik RouterOS products, and may need alterations to work with other devices.

Example usage

tzsp2pcap -f | wireshark -k -i -
tzsp2pcap -o "file.pcap" -C 1000000 # rotate file every 1MB (file.pcap.1, file.pcap.2, etc)
tzsp2pcap -o "file_%s.pcap" -G 10 # create new file every 10 seconds (file_UNIXTIMESTAMP.pcap)
tzsp2pcap -o "file.pcap" -C 1000000 -z gzip # rotate file every 1MB and gzip it (file.pcap.1.gz, file.pcap.2.gz, etc)

tzsp2pcap's People

Contributors

chrisandreae avatar edmondas avatar thefloweringash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tzsp2pcap's Issues

Compiling on Centos7

Hi,

When compiling on stock Centos7 pcap will complain about unknown types u_int, u_short, u_char etc.

Adding "-D_GNU_SOURCE" to the CFLAGS in Makefile solves the issue and the app compiles clean.

Fixes for compile inside CYGWIN

Hi,

This good piece of code can be compiled for Windows (Cygwin), and also in other platforms with small changes in the Makefile:

# Configurable variables
CFLAGS = -g -D_GNU_SOURCE -Wall -Wextra -pedantic -O2

tzsp2pcap: tzsp2pcap.c
    cc -std=c99 -o $@ $(CFLAGS) $(LDFLAGS) $< -lwpcap

.PHONY: clean all

all: tzsp2pcap

clean:
    rm -f tzsp2pcap

(Note: use '-lwpcap' for linking with WPCAP.DLL; and '-lpcap' for any other platform).

I hope someone commits this change, and share a binary version for Windows. ;)

malformed packets

I'm no coder in C so bare with me.

                if (hdr->version == 1 &&
                    hdr->type == TZSP_TYPE_RECEIVED_TAG_LIST)
                {

is looking for a header type of TZSP_TYPE_RECEIVED_TAG_LIST(0). However, the TZSP my router stream is sending (using rsniffer), hdr->type is END(1). As such, it just prints "packet format not understood".

The rsniffer TZSP stream works perfectly in wireshark, so not sure if the issue is with tzsp2pcap, rsniffer or wireshark.

I've supplied a sample tzsp.pcap.
tzsp.zip

feature request: add input file options

I already have recorded PCAP file and want select packets to UDP port 37008 and de-encapsulate from TZSP.
Could you add option ti specify PCAP file as input.

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.