Wireshark-dev: Re: [Wireshark-dev] how to use wireshark source code?
From: Peter Wu <[email protected]>
Date: Thu, 27 Mar 2014 10:10:40 +0100
Hi,

On Thursday 27 March 2014 17:05:08 我想不无聊 wrote:
> I add a file named peformance.h under wireshark  main directory,
> 
> 
> peformance.h

spelling error here (and below), it should be "performance".

> #include <glib.h>
> 
> 
> typedef struct peformance_s
> {
> 	gfloat time[100];
>       	gfloat delay[100];
> 	guint32 packetSize[100];
> 	guint32 payload;
> 	guint32 index;
> 	guint32 temp_size;
> 	gfloat temp_time;
> }peformance;
> extern peformance* peformance_test;
> 
> 
> 
> then I modify the /epan/dissectors/packet-ieee80211.c,
> #include "../../peformance.h"
> 
> 
> then define the struct variable,
> peformance pef_test;
> peformance * peformance_test=&pef_test;
> 
> 
> peformance_test->index=0;
> 
> when i execute "sudo make", it occurs to me one error ,below is the error information:

You should not run the compilation as root. Just "make" is fine.
To fix up this mistake, change the ownership of the object files to your user.

> packet-ieee80211.c:94:30: error: ../../peformance.h: No such file or directory

This is a clear hint.

> packet-ieee80211.c:149: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pef_test'
> packet-ieee80211.c:150: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
> packet-ieee80211.c:153: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token

The top-level directory is already in the headers search path. Just drop the
../..:

   #include "performance.h"

Kind regards,
Peter