lkml.org 
[lkml]   [1999]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: how do I direct raw packages to a given socket?
Date
From
> I would like to direct packages to a given (raw) socket, depending on 
> a 16-bit (short) number in the package which indicates the
> source of the package.

That basically implies writing a small AF_FIELDBUS socket layer - it can
do just demux then the kernel will do select/poll/receive and other
grungy bits for you.

> netif_rx(skb);

Demux is expected to be done the other side. So your socket layer rx would do


if(skb->len < MINLEN || ....)
{
kfree_skb(skb);
return 0;
}

sk=fieldbus_which_socket(skb);
if(sk==NULL)
{
kfree...
..
}
skb->sk=sk;
if(sock_queue_rcv_skb(sk, skb)<0)
kfree_skb(skb);
return 0;

or similar.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.036 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site