2005-03-18 13:53:31

by Josef E. Galea

[permalink] [raw]
Subject: Kernel space sockets

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


2005-03-18 14:08:10

by Juergen Quade

[permalink] [raw]
Subject: Re: Kernel space sockets

On Fri, Mar 18, 2005 at 02:53:31PM +0100, Josef E. Galea wrote:
> 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.

2005-03-18 14:14:39

by Josef E. Galea

[permalink] [raw]
Subject: Re: Kernel space sockets

Juergen Quade wrote:

>On Fri, Mar 18, 2005 at 02:53:31PM +0100, Josef E. Galea wrote:
>
>
>>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.
>
>
>
Thanks :)
Josef