Networking Forums

Networking Forums > Computer Networking > Linux Networking > help on synchronizing functions in kernel 2.6

Reply
Thread Tools Display Modes

help on synchronizing functions in kernel 2.6

 
 
Giacomo
Guest
Posts: n/a

 
      06-06-2005, 08:10 PM
good morning, i'm a student at Udine's University, and i'm trying to
write (for study purposes) a firewall in userspace. I hope someone can help
me..
The rules and the engine are stored in userspace, and packets are sent
from kernel to user via netlink sockets.
Packets received from socket buffer are sent in userspace via netlink,
the program in userspace compares the packets with the rules and sends
back to kernel the response, always via netlink socket.

I'm having a problem anyway, for which i hope you can give me some hints
or and indication about where i can find some help:

ip_rcv() calls the sender function in kernel space which has the task of
sending the packet in userspace.
Then this routine should WAIT until a response comes back from userspace
program to netlink socket allocated via
netlink_kernel_create(). (Actually there is a netlink socket used for
INPUT responses, one for OUTPUT, and one for FORWARD).
When a message arrives on netlink socket from userspace, containing the
verdict, the receiving routine in kernel space sets a variable
containing the response.
Now it should WAKE UP or TELL someway to the previous function waiting
for the response to read the value containing the response of the firewall.

I tried using wait.h interface (sleep_on, wait_queues together with
wake_up()) and semaphores (sema_init, up() and down() ) but kernel goes
in panic ... a message i could read was "schedule during atomic", don't
know if it's a useful information...

I'm a newbie on writing kernel code, and I would be grateful for any
little suggestion, a possible interface to use, a keyword to search for
in internet, a possible error or thing i must be wrong...

Thanking in advance, best regards.

Giacomo Strangolino,
Udine, Italy.




--

.''`.
: :' :
`. `'
`- Debian GNU/Linux -- The power of freedom







 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Synchronizing two FTP's M Windows Networking 0 10-09-2008 10:26 AM
Synchronizing users between two windows servers Viswanath Windows Networking 5 04-18-2008 11:33 PM
synchronizing shared files Revilo Wireless Networks 3 01-21-2006 01:12 PM
Synchronizing Damon Windows Networking 8 07-29-2004 02:41 PM
Help with synchronizing files please.. Sara Windows Networking 1 10-07-2003 06:35 PM



1 2 3 4 5 6 7 8 9 10 11