Skip to contentSkip to conversation

register callback for special packet types like udp and icmp?

DISCUSSION Thomas Mader 2 participants 2 messages Apr 11, 2008 netfilter

lore
Share & tools
lore
#0 lore raw

Hello,

is there a way to define callback (match) functions for special packet types like udp and icmp? I would like to have a match function which only reacts on udp and icmp packets. Is this possible in a kernelspace module and/or in a libnetfilter_queue daemon and how?

thanks in advance,
Thomas

#1 lore raw
Quoted 6 lines · Thomas Mader

Hello,

is there a way to define callback (match) functions for special packet types like udp and icmp? I would like to have a match function which only reacts on udp and icmp packets. Is this possible in a kernelspace module and/or in a libnetfilter_queue daemon and how?

Both would work. For kernel modules, it's as simple as specifying .proto = IPPROTO_UDP or IPPROTO_ICMP, see
http://jengelh.medozas.de/documents/Netfilter_Modules.pdf