All of lore.kernel.org
 help / color / mirror / Atom feed
From: Italo Valcy <italo@dcc.ufba.br>
To: netfilter@vger.kernel.org
Subject: Gcc error trying to use nf_conntrack->id (dereferencing pointer to incomplete type)
Date: Sat, 16 Oct 2010 16:19:43 -0300	[thread overview]
Message-ID: <4CB9FACF.7060407@dcc.ufba.br> (raw)

-----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-----

             reply	other threads:[~2010-10-16 19:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-16 19:19 Italo Valcy [this message]
2010-10-16 20:30 ` Gcc error trying to use nf_conntrack->id (dereferencing pointer to incomplete type) Italo Valcy
2010-10-16 21:17 ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CB9FACF.7060407@dcc.ufba.br \
    --to=italo@dcc.ufba.br \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.