Linux Netfilter discussions
 help / color / mirror / Atom feed
* Gcc error trying to use nf_conntrack->id (dereferencing pointer to incomplete type)
@ 2010-10-16 19:19 Italo Valcy
  2010-10-16 20:30 ` Italo Valcy
  2010-10-16 21:17 ` Jan Engelhardt
  0 siblings, 2 replies; 3+ messages in thread
From: Italo Valcy @ 2010-10-16 19:19 UTC (permalink / raw)
  To: netfilter

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi guys,

I'm trying to use 'id' field of nf_conntrack struct but I'm getting the
following error: "dereferencing pointer to incomplete type".

For example, I've tried to modify conntrack-0.9.6 to print this 'id'
field when "Display a real-time event log":

- ------------------
diff --git a/conntrack-0.9.6/src/conntrack.c
b/conntrack-0.9.6/src/conntrack.c
index 82ff544..8b74564 100644
- --- a/conntrack.c
+++ b/conntrack.c
@@ -603,7 +603,7 @@ static int event_cb(enum nf_conntrack_msg_type type,
        }

        nfct_snprintf(buf, 1024, ct, type, output_type, output_flags);
- -       printf("%s\n", buf);
+       printf("%s id=%u\n", buf, ct->id);
        fflush(stdout);

        return NFCT_CB_CONTINUE;
- ------------------

And tried to compile with gcc 4.3:

- -------------------------
gcc -DPACKAGE_NAME=\"conntrack-tools\"
- -DPACKAGE_TARNAME=\"conntrack-tools\" -DPACKAGE_VERSION=\"0.9.6\"
- -DPACKAGE_STRING=\"conntrack-tools\ 0.9.6\"
- -DPACKAGE_BUGREPORT=\"pablo@netfilter.org\"
- -DPACKAGE=\"conntrack-tools\" -DVERSION=\"0.9.6\" -DSTDC_HEADERS=1
- -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
- -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
- -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
- -DYYTEXT_POINTER=1 -DHAVE_LINUX_CAPABILITY_H=1 -DHAVE_LIBNFNETLINK=1
- -DHAVE_LIBNETFILTER_CONNTRACK=1 -DHAVE_ARPA_INET_H=1 -DHAVE_INET_PTON=1
- -DHAVE_INET_PTON_IPV6=1 -I.  -I../include   -std=gnu99 -W -Wall -Werror
- -Wmissing-prototypes -Wwrite-strings -Wcast-qual -Wfloat-equal -Wshadow
- -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return
- -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline
- -Wstrict-prototypes -Wundef -Wno-unused-parameter -g -O2   -MT
conntrack.o -MD -MP -MF .deps/conntrack.Tpo -c -o conntrack.o conntrack.c
conntrack.c: In function ‘event_cb’:
conntrack.c:606: error: dereferencing pointer to incomplete type
make: ** [conntrack.o] Erro 1
- -------------------------

My gcc version:

~$ gcc --version
gcc (Debian 4.3.2-1.1) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Please, any ideas about what I'm doing wrong?

Thanks for any help!


- -- 
Saudações,

Italo Valcy :: http://wiki.dcc.ufba.br/~ItaloValcy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky5+s8ACgkQfidLqjN6RNHnsQCfVXWpecEHf07HJItjye4tNFyB
RXcAoJuxpwsrlpy3EbaFrm7VjIgl5myu
=sPwU
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Gcc error trying to use nf_conntrack->id (dereferencing pointer to incomplete type)
  2010-10-16 19:19 Gcc error trying to use nf_conntrack->id (dereferencing pointer to incomplete type) Italo Valcy
@ 2010-10-16 20:30 ` Italo Valcy
  2010-10-16 21:17 ` Jan Engelhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Italo Valcy @ 2010-10-16 20:30 UTC (permalink / raw)
  To: netfilter

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi guys,

Em 16-10-2010 16:19, Italo Valcy escreveu:
> 
> I'm trying to use 'id' field of nf_conntrack struct but I'm getting the
> following error: "dereferencing pointer to incomplete type".

Forget about: I'll use nfct_get_attr_u32()

Thanks.


- -- 
Saudações,

Italo Valcy :: http://wiki.dcc.ufba.br/~ItaloValcy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky6C4AACgkQfidLqjN6RNHL2gCeJWejnQS4i+2kUD8FTyUgFx0U
xO4AoJErwOZWOeefQvwFZMc09C3fh/3O
=T65x
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Gcc error trying to use nf_conntrack->id (dereferencing pointer to incomplete type)
  2010-10-16 19:19 Gcc error trying to use nf_conntrack->id (dereferencing pointer to incomplete type) Italo Valcy
  2010-10-16 20:30 ` Italo Valcy
@ 2010-10-16 21:17 ` Jan Engelhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2010-10-16 21:17 UTC (permalink / raw)
  To: Italo Valcy; +Cc: netfilter


On Saturday 2010-10-16 21:19, Italo Valcy wrote:

>I'm trying to use 'id' field of nf_conntrack struct but I'm getting the
>following error: "dereferencing pointer to incomplete type".
>
>For example, I've tried to modify conntrack-0.9.6 to print this 'id'
>field when "Display a real-time event log":

Unrelated to your issue though, it is usually wise to work with the most
recently released tarball.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-16 21:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-16 19:19 Gcc error trying to use nf_conntrack->id (dereferencing pointer to incomplete type) Italo Valcy
2010-10-16 20:30 ` Italo Valcy
2010-10-16 21:17 ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox