netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pete Kay <petedao@gmail.com>
To: Andrew Beverley <andy@andybev.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: question about libfilter_conntrack
Date: Tue, 27 Jul 2010 17:31:31 +0800	[thread overview]
Message-ID: <AANLkTi=EXoTg+eUrgxpWU73Rd-EPwHtc3V+um+4sj917@mail.gmail.com> (raw)
In-Reply-To: <20100727095224.134553gv7kfpneiw@www.simplelists.com>

Andy,

thanks alot.  It works now.

P

On Tue, Jul 27, 2010 at 4:52 PM, Andrew Beverley <andy@andybev.com> wrote:
>>>> I would like to use libfilter_conntrack to remove an entry in the
>>>> conntrack table.
>>>>
>>>> Does anyone have an example showing how to do that programmatically?
>>>
>>> There's an example in the source code, in utils/conntrack_delete.c
>>>
>> I am using the conntrack_delete example to try to delete this entry:
>> udp      17 29 src=192.168.1.56 dst=192.168.1.114 sport=16385
>> dport=26956 packets=28149 bytes=7881720 [UNREPLIED] src=192.168.1.114
>> dst=192.168.1.56 sport=26956 dport=16385 packets=0 bytes=0 mark=0
>> secmark=0 use=2
>>
>> But I am having problem doing so with the lines of code below:
>>
>>      ct = nfct_new();
>>        if (!ct) {
>>                perror("nfct_new");
>>              return 0;
>>
>>        }
>>        nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET);
>>        nfct_set_attr_u32(ct, ATTR_ORIG_IPV4_SRC,
>> inet_addr("192.168.1.56"));
>>
>>        nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_UDP);
>>      nfct_set_attr_u16(ct, ATTR_ORIG_PORT_SRC, htons(16385));
>>
>
> You need to also specify the destination IP address and port number. I think
> that as a minumum you must specify all 6 peices of information: source/dest
> IP address and port number, and the layer 3 and layer 4 protocol.
>
> Regards,
>
> Andy
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2010-07-27  9:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27  5:34 question about libfilter_conntrack Pete Kay
2010-07-27  6:12 ` Andrew Beverley
2010-07-27  7:17   ` Pete Kay
2010-07-27  8:52     ` Andrew Beverley
2010-07-27  9:31       ` Pete Kay [this message]

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='AANLkTi=EXoTg+eUrgxpWU73Rd-EPwHtc3V+um+4sj917@mail.gmail.com' \
    --to=petedao@gmail.com \
    --cc=andy@andybev.com \
    --cc=netfilter-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).