Skip to content

Commit

Permalink
Teach save_to_pcap to write PCap-NG files
Browse files Browse the repository at this point in the history
The PCap-NG file format is used by default by Wireshark as of
Wireshark 1.8.0 (June 2012). The main advantages of PCap-NG for
capturing via Corelatus hardware are:

   - Each packet has information about which interface it came from.

   - The capture file can include information about where the capture
     came from. This allows us to add the address of the capturing
     hardware.
  • Loading branch information
matthiasl committed Dec 15, 2013
1 parent e1d4804 commit f987124
Show file tree
Hide file tree
Showing 3 changed files with 473 additions and 186 deletions.
12 changes: 8 additions & 4 deletions c/Makefile
Expand Up @@ -55,12 +55,16 @@ ship: version.c

version.c: $(headers)
@echo "#include \"gth_apilib.h\"" > $@
@echo "const char *git_head = \""$(repo_head)"\";" >> $@
@echo "const char *build_hostname = \""$(shell hostname)"\";" >> $@
@echo "const char git_head[] = \""$(repo_head)"\";" >> $@
@echo "const char build_hostname[] = \""$(shell hostname)"\";" >> $@

%: %.c $(headers) $(common_c_files) version.c
%: %.c $(headers)

%: %.c $(common_c_files) version.c
$(CC) -Wall -g -o $@ $^ $(LIBS)

%.exe: %.c $(headers) $(common_c_files) version.c
%.exe: %.c $(headers)

%.exe: %.c $(common_c_files) version.c
$(CC_WIN32) -Wall -o $@ $^ $(LIBS_WIN32)

4 changes: 2 additions & 2 deletions c/gth_apilib.h
Expand Up @@ -91,8 +91,8 @@ typedef struct {
} GTH_api;

// For embedding the version into the object file
extern const char *git_head;
extern const char *build_hostname;
extern const char git_head[];
extern const char build_hostname[];

// Close an API connection to the GTH, cleanly.
//
Expand Down

0 comments on commit f987124

Please sign in to comment.