Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for compile inside CYGWIN #1

Open
lars18th opened this issue Jun 23, 2016 · 2 comments
Open

Fixes for compile inside CYGWIN #1

lars18th opened this issue Jun 23, 2016 · 2 comments

Comments

@lars18th
Copy link

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. ;)

@lars18th
Copy link
Author

Hi,

Another patch for Cygwin...

When you use the parameter "-f" (flush each packet), a stackdump is produced.
The problem is with the call to the flush function.

So, one alternative is use this code:

        if (flush_every_packet) {
//          if (fflush(pcap_dumper_file) != 0) {
            if (pcap_dump_flush(pcap_dumper) != 0) {
                perror("fflush");
                break;
            }
        }

I hope this patch is also commited! ;)

@lars18th
Copy link
Author

Hi,

If you need the BINARY version of "tzsp2pcap.exe" (Windows), you can download it from here:
http://www.sendspace.com/file/ofp875

I suggest to add this version to the "Release" section.

Note: If you like to execute Wireshark in Windows WITHOUT installing winpcap, running the capture process in another computer that sends packets in TZSP format (like a Mikrotik router), then you now can use:

tzsp2pcap -f | Wireshark.exe -ki -

Happy sniffing!

thefloweringash added a commit that referenced this issue May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant