Ethereal-dev: [Ethereal-dev] error compiling ethereal

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date: Thu, 30 Sep 2004 14:17:20 +0100
I write a small test code to include a tap in the packet-tns.c
Here's my tap: (tap-tnstest.c)

/******************** Begin File ************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>

#include <string.h>
#include "epan/packet_info.h"
#include "tap.h"
#include <epan/dissectors/packet-tns.h>
#include "register.h"

static int
tnstest_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, void *data)
{
  return 1;
  
}

static void
tnstest_draw(void *tapdata)
{
  printf("======================================================\n");
  printf("\n\nTesting tap...\n\n");
  printf("======================================================\n");
}

static void
tnstest_init()
{
  GString *error_string;
  
  error_string = register_tap_listener("tns", NULL, NULL, NULL, tnstest_packet, tnstest_draw);
  if (!error_string)
    printf("bahhh");
  else
    printf("behhh");
  
}

void
register_tap_listener_tnstest(void)
{
  register_ethereal_tap("tns,test,", tnstest_init);
}
/********************* end file ***********************/

I've put in packet-tns.c this lines:
#include "tap.h"
static int tns_tap = -1;
tns_tap = register_tap("tns"); /* this in the end of the function proto_register_tns() */

I've put tap-tnstest.c in the higher level Makefile and Makefile.in in the section TETHEREAL_TAP_SRC.

When I run make, it throws this error:

tethereal-tap-register.o(.text+0x64): In function `register_all_tap_listeners':
/home/pedro/ethereal-0.10.6/tethereal-tap-register.c:41: undefined reference to `register_tap_listener_tnstest'

In tethereal-tap-register.c I have the line:
extern void register_tap_listener_tnstest (void);
    register_tap_listener_tnstest ();

I think that I follow all the steps, but still throwing that error...
Any Help?

thnks 


________________________________________________________________________________
Um acesso à internet com anti-vírus, bloqueador de janelas e caixa de correio com 21 MB?
IOL. Tem tudo para ser mais simples.
Saiba como instalar: http://www.iol.pt/correio/rodape.php?dst=0409231