Hi... What's the utility in the kernel of the structs sock and socket? I known they are important... Is there any document about these structs? Thanks! :-) -- Fernando Barreto Mestrando em Ciencia da Computacao fbarreto@inf.ufsc.br fbarreto_br@yahoo.com -- On Sat, 21 Apr 2001, Matti Aarnio wrote: > On Fri, Apr 20, 2001 at 02:15:23PM -0300, Fernando Barreto wrote: > > Hi... > > > > I'm working to do a new network stack... I can now receive my > > packets throught the wire without any problems, but: How can I transfer > > one packet that arrived to one process? And how can I block the process > > until the data arrive to the device driver, or until the data become > > already transmited? > > Is there anywhere in the kernel that can I find this > > implementation? > > > net/core/dev.c > net/ipv4/ -- lots -- > > Follow the call of netif_rx() at the ethernet card RX path > INSIDE THE INTERRUPT CONTEXT. See how it puts things into some > queue, and triggers a BH instance, and returns away. > > Triggered BH is actually net_rx_action(), which continues with > processing of the packet -- doing diversions, fastroute, > bridging, and finally looking up the Ethernet content TYPE > field (first 2 bytes of the frame after the MAC addresses). > When a matching one is found, associated protocol processing > receiver function is called. > > See at first how IPv4 does init itself by registering different > levels of protocols. Then observe the processing path of for > example UDP frames. > > I wonder what "data already transmitted" means ? > Shall the caller stop until the remote end acks having received > the data ? Or is there some flow-control and kernel side buffering ? > (Ever heard of TCP of the IP suite ?) > > Whatever, the answer is most likely used deep inside the TCP, and > UDP codes of IPv4 protocol family. > > > > I'm thinking to mask one sys_call of the system to do that... Is > > it the better way? > > Definitely. Register your protocol as AF_XYZ with numeric value > that is not presently in use. Make it "just another socket > protocol family." > > > Thanks for any help... > > :-) > > /Matti Aarnio > - > : send the line "unsubscribe linux-net" in > the body of a message to majordomo@vger.kernel.org > - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org