(no subject)

Oct 27, 2007 13:00

well, right now i m browsing linux's networking module (not the tcp/ip stack) so thought to write down the important things which i find worth remembering..

1. proto_register() - this is used to register your own protocol family to running kernel. it takes a proto structure as one of the args, which has the all socket call function pointer, which can be user defined. but it doesnt have socket() call's function pointer. it simply adds the proto structure into a global linked list named "proto" which is maintained by kernel.. cool

2. sock_register() - this is required to register you own address family, like AF_INET or AF_INET_SDP or AF_INET_TSA :D .. there can be at max 34 protocols registered in running kernel at a time :D a hard coded value, search for NPROTO :).. now this function is not doing any fancy thing, but just assigning net_proto_family type arg, which is passed in sock_register into a "net_families[ops->family]" global array. In case of tsa, it would be something like net_families[AF_INET_TSA] = ops; (wherein AF_INET_TSA is 27 :P)

i guess i need to edit this one later, i 've got a new concept and that has the higher priority than this one, so suspending this entry....
Previous post Next post
Up