Skip to contentSkip to conversation

lib ipq

DISCUSSION Unix User 2 participants 3 messages Dec 23, 2004 – Jun 22, 2005

lore
Share & tools
lore

Unix User

author
#0 lore raw

hi all
I use the lib ipq. I want to know how one can make the difference between an outgoing and incoming packets with the lib ipq . I queued incoming and outgoing packets .
thanks ;)

author
#1 lore raw

hi all
I use the lib ipq. I want to know how one can make the difference between an outgoing and incoming packets with the lib ipq . I queued incoming and outgoing packets .
i use the packet information to look at the tcp/ip headers and check the ip addresses to see if it is incoming or outgoing but it doesnt work if the localhost send a packet at his self (ex : source adress: 127.0.0.1 , dest adress: 127.0.0.1).

how can i make the difference ?

sorry for my bad english :)

#2 lore raw

You could probably mark the packet using the nfmark field of the skb.

If you are doing this with iptables, use the -j MARK target to do this; something
ala this:
iptables -A OUTPUT -t mangle -i eth0 -j MARK --set-mark 42

Make sure you do this before you queue the packet to userspace.

Regards,
Christian Theil Have.

If you need to do this from userspace with iptables probably

Quoted 14 lines · Unix User

hi all
I use the lib ipq. I want to know how one can make the difference between an outgoing and incoming packets with the lib ipq . I queued incoming and outgoing packets .
i use the packet information to look at the tcp/ip headers and check the ip addresses to see if it is incoming or outgoing but it doesnt work if the localhost send a packet at his self (ex : source adress: 127.0.0.1 , dest adress: 127.0.0.1).

how can i make the difference ?

sorry for my bad english :)