All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Fangweiwei" <fangweiwei@tom.com>
To: netfilter-devel@lists.netfilter.org
	<netfilter-devel@lists.netfilter.org>
Subject: why I cann't compile the program?
Date: Tue, 25 Nov 2003 9:41:21 +0800	[thread overview]
Message-ID: <E1AOSBp-0003rO-Sc@vishnu.netfilter.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2909 bytes --]

Hello everyone!
I try to compile the following code,but it gives some msg to show something wrong?what should I do ?
------------------------------------------
/*
 * This code is GPL.
 */
#include <linux/netfilter.h>
#include <libipq.h>
#include <stdio.h>

#define BUFSIZE 2048

static void die(struct ipq_handle *h)
{
        ipq_perror("passer");
        ipq_destroy_handle(h);
        exit(1);
}

int main(int argc, char **argv)
{
        int status;
        unsigned char buf[BUFSIZE];
        struct ipq_handle *h;

        h = ipq_create_handle(0, PF_INET);
        if (!h)
                die(h);

        status = ipq_set_mode(h, IPQ_COPY_PACKET, BUFSIZE);
        if (status < 0)
                die(h);

        do{
                status = ipq_read(h, buf, BUFSIZE, 0);
                if (status < 0)
                        die(h);

                switch (ipq_message_type(buf)) {
                        case NLMSG_ERROR:
                                fprintf(stderr, "Received error message %d\n",
                                        ipq_get_msgerr(buf));
                                break;

                        case IPQM_PACKET: {
                                ipq_packet_msg_t *m = ipq_get_packet(buf);

                                status = ipq_set_verdict(h, m->packet_id,
                                                         NF_ACCEPT, 0, NULL);
                                if (status < 0)
                                        die(h);
                                break;
                        }

                        default:
                                fprintf(stderr, "Unknown message type!\n");
                                break;
                }
        } while (1);

        ipq_destroy_handle(h);
        return 0;
}

----------------------------------------------
I try to compile it using: gcc test.c
but it gives me some msg as following:

/tmp/ccYcdyBh.o: In function `die':
/tmp/ccYcdyBh.o(.text+0xf): undefined reference to `ipq_perror'
/tmp/ccYcdyBh.o(.text+0x1d): undefined reference to `ipq_destroy_handle'
/tmp/ccYcdyBh.o: In function `main':
/tmp/ccYcdyBh.o(.text+0x41): undefined reference to `ipq_create_handle'
/tmp/ccYcdyBh.o(.text+0x7b): undefined reference to `ipq_set_mode'
/tmp/ccYcdyBh.o(.text+0xb5): undefined reference to `ipq_read'
/tmp/ccYcdyBh.o(.text+0xe3): undefined reference to `ipq_message_type'
/tmp/ccYcdyBh.o(.text+0x12a): undefined reference to `ipq_get_msgerr'
/tmp/ccYcdyBh.o(.text+0x157): undefined reference to `ipq_get_packet'
/tmp/ccYcdyBh.o(.text+0x17e): undefined reference to `ipq_set_verdict'
collect2: ld returned 1 exit status

----------------------------------------------

can you help me? thanks a lot.

        Fangweiwei
        fangweiwei@tom.com
          2003-11-25

[-- Attachment #2: fox.gif --]
[-- Type: image/gif, Size: 9519 bytes --]

             reply	other threads:[~2003-11-25  1:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-25  1:41 Fangweiwei [this message]
2003-11-25  7:01 ` why I cann't compile the program? Sven Schuster

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=E1AOSBp-0003rO-Sc@vishnu.netfilter.org \
    --to=fangweiwei@tom.com \
    --cc=netfilter-devel@lists.netfilter.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.