Skip to contentSkip to conversation

Kernel space sockets

DISCUSSION Josef E. Galea 2 participants 3 messages Mar 18, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

I'm trying to implement a UDP server in a kernel module. So far I have created the struct socket using sock_create_kern(), and used sock->ops->bind() on it. Now how do I send UDP datagrams? I looked at some code and found the function sock->ops->sendmsg() but I can't figure out where to put the destination address. I would appreciate it if someone could point me to some tutorial or sample code.

Thanks,
Josef

#1 lore raw
Quoted 8 lines · Josef E. Galea

Hi,

I'm trying to implement a UDP server in a kernel module. So far I have created the struct socket using sock_create_kern(), and used sock->ops->bind() on it. Now how do I send UDP datagrams? I looked at some code and found the function sock->ops->sendmsg() but I can't figure out where to put the destination address. I would appreciate it if someone could point me to some tutorial or sample code.

Maybe the sample code on this (german) site helps:

http://ezs.kr.hsnr.de/TreiberBuch/Artikel/index.html

Look at "Folge" 16.

Juergen.

#2 lore raw
Quoted 9 lines · Juergen Quade
Quoted 5 lines · Josef E. Galea

Hi,

I'm trying to implement a UDP server in a kernel module. So far I have created the struct socket using sock_create_kern(), and used sock->ops->bind() on it. Now how do I send UDP datagrams? I looked at some code and found the function sock->ops->sendmsg() but I can't figure out where to put the destination address. I would appreciate it if someone could point me to some tutorial or sample code.

Quoted 10 lines

Maybe the sample code on this (german) site helps:

http://ezs.kr.hsnr.de/TreiberBuch/Artikel/index.html

Look at "Folge" 16.

Juergen.

Thanks :)
Josef