3
votes

Scenario : Client is sending a data and the server is receving the data from client via ethernet layer (udp). When the server receives a data from the client on the ip layer (kernel). It interrupts the kernel and kernel as to execute the data by the client, so I want to create a interrupt service function to catch the interrupt from the network service card.

I can't write kernel modules (the kernel is not open) and you have real-time in user-space for QNX. However I can write code using RTLinux (real time linux) in kernel space and with kernel modules.

Where to write a interrupt handler and how to register with kernel in linux ??

1
If you want get interrupts when some packet arrives from client, you can easily do it with pcap library.awatan
I am new doing this kind of adventure. So could you please explain more about this - where do i find the pcap library in kernel ??user3458454
Basically pcap is a user space and a very powerful library to work on all kinds of stuff on traffic received by your network card. You do not need to go in to kernel while using pcap.awatan
where can i find the pcap library ?? If i am not worng then I will add the interrupt handler in pcap - is it right ??user3458454
tcpdump.org/#latest-release for Linux and winpcap.org/install for windows. Yes you can add you handler fucntion while using pcap.awatan

1 Answers

1
votes

The easiest way for you to do that is not to register a interrupt handler, but to use an existing mechanism called Linux netfilter hooks. You can define a callback function which will be executed when a packet reaches one the netfilter chains.

Some documentation: http://www.netfilter.org/documentation/HOWTO/netfilter-hacking-HOWTO-3.html