1*86d7f5d3SJohn Marino$FreeBSD: src/sys/netgraph/NOTES,v 1.2 2001/01/06 00:46:46 julian Exp $ 2*86d7f5d3SJohn MarinoDevelopment ideas.. 3*86d7f5d3SJohn Marino 4*86d7f5d3SJohn MarinoArchie's suggestions... :-) 5*86d7f5d3SJohn Marino 6*86d7f5d3SJohn Marino - There should be a new malloc type: M_NETGRAPH 7*86d7f5d3SJohn Marino [DONE] 8*86d7f5d3SJohn Marino - all mallocs/frees now changed to use this.. JRE 9*86d7f5d3SJohn Marino - might further split them out some time. 10*86d7f5d3SJohn Marino 11*86d7f5d3SJohn Marino - Use MALLOC and FREE macros instead of direct function calls 12*86d7f5d3SJohn Marino [DONE] 13*86d7f5d3SJohn Marino - They allow conditional compilation which keeps 14*86d7f5d3SJohn Marino statistics & counters on various memory allocation 15*86d7f5d3SJohn Marino (or so it seems) 16*86d7f5d3SJohn Marino - Now tend to have NG_FREE_XX() macros. they 17*86d7f5d3SJohn Marino allow better debugging 18*86d7f5d3SJohn Marino 19*86d7f5d3SJohn Marino - In struct ng_mesg: at least make "header" into "hdr", if not 20*86d7f5d3SJohn Marino getting rid of it altogether. It doesn't seem necessary and 21*86d7f5d3SJohn Marino makes all my C code lines too long. 22*86d7f5d3SJohn Marino 23*86d7f5d3SJohn Marino - I understand.. one thought however.. consider.. 24*86d7f5d3SJohn Marino if char data[0] were not legal, so that data[1] needed to be 25*86d7f5d3SJohn Marino used instead, then the only way to get the size of the header 26*86d7f5d3SJohn Marino would be sizeof(msg.header) as sizeof(msg) would include the dummy 27*86d7f5d3SJohn Marino following bytes. this is a portability issue and I hope 28*86d7f5d3SJohn Marino it will be ported eventually :) 29*86d7f5d3SJohn Marino 30*86d7f5d3SJohn Marino - Baloney! you can use sizeof(msg) - 1 then.. or just 31*86d7f5d3SJohn Marino make it a macro, then its always portable: 32*86d7f5d3SJohn Marino 33*86d7f5d3SJohn Marino #ifdef __GNU_C__ 34*86d7f5d3SJohn Marino #define NG_MSG_HDR_SIZE (sizeof(struct ng_message)) 35*86d7f5d3SJohn Marino #else 36*86d7f5d3SJohn Marino #define NG_MSG_HDR_SIZE (sizeof(struct ng_message) - 1) 37*86d7f5d3SJohn Marino #endif 38*86d7f5d3SJohn Marino 39*86d7f5d3SJohn Marino - inertia rules :-b 40*86d7f5d3SJohn Marino 41*86d7f5d3SJohn Marino 42*86d7f5d3SJohn Marino - Have a user level program to print out and manipulate nodes, etc. 43*86d7f5d3SJohn Marino - [DONE] 44*86d7f5d3SJohn Marino see ngctl, nghook 45*86d7f5d3SJohn Marino 46*86d7f5d3SJohn Marino - "Netgraph global" flags to turn on tracing, etc. 47*86d7f5d3SJohn Marino 48*86d7f5d3SJohn Marino - ngctl needs to be rewritten using libnetgraph. Also it needs a 49*86d7f5d3SJohn Marino command to list all existing nodes (in case you don't know the 50*86d7f5d3SJohn Marino name of what you're looking for). 51*86d7f5d3SJohn Marino [DONE] 52*86d7f5d3SJohn Marino 53*86d7f5d3SJohn Marino - Need a way to get a list of ALL nodes. 54*86d7f5d3SJohn Marino [DONE] 55*86d7f5d3SJohn Marino - see NGM_LISTNODES 56*86d7f5d3SJohn Marino 57*86d7f5d3SJohn Marino - Enhance "netstat" to display all netgraph nodes -- or at least 58*86d7f5d3SJohn Marino all netgraph socket nodes. 59*86d7f5d3SJohn Marino [DONE] 60*86d7f5d3SJohn Marino 61*86d7f5d3SJohn Marino - BUG FIX: bind() on a socket should neither require nor allow a 62*86d7f5d3SJohn Marino colon character at the end of the name. Note ngctl allows you 63*86d7f5d3SJohn Marino to do it either way! 64*86d7f5d3SJohn Marino [DONE] (I think) 65*86d7f5d3SJohn Marino - bind on a control socket has been disabled 66*86d7f5d3SJohn Marino it was a bad idea. 67*86d7f5d3SJohn Marino 68*86d7f5d3SJohn Marino - Need to implement passing meta information through socket nodes 69*86d7f5d3SJohn Marino using sendmsg() and recvmsg(). 70*86d7f5d3SJohn Marino 71*86d7f5d3SJohn Marino - Stuff needing to be added to manual: 72*86d7f5d3SJohn Marino 73*86d7f5d3SJohn Marino - Awareness of SPL level, use ng_queue*() functions when necessary. 74*86d7f5d3SJohn Marino - Malloc all memory with type M_NETGRAPH. -DONE 75*86d7f5d3SJohn Marino - Write code so it can be an LKM or built into the kernel.. this means 76*86d7f5d3SJohn Marino be careful with things like #ifdef INET. 77*86d7f5d3SJohn Marino - All nodes assume that all data mbufs have the M_PKTHDR flag set! 78*86d7f5d3SJohn Marino The ng_send_data() and related functions should have an 79*86d7f5d3SJohn Marino #ifdef DIAGNOSTICS check to check this assumption for every mbuf. 80*86d7f5d3SJohn Marino -DONE with INVARIANTS. Framework should test this more. 81*86d7f5d3SJohn Marino - More generally, netgraph code should make liberal use of the 82*86d7f5d3SJohn Marino #ifdef DIAGNOSTICS definition. 83*86d7f5d3SJohn Marino -INVARIANTS. 84*86d7f5d3SJohn Marino - Since data and messages are sent functionally, programmers need 85*86d7f5d3SJohn Marino to watch out for infinite feedback loops. Should ng_base.c detect 86*86d7f5d3SJohn Marino this automatically? 87*86d7f5d3SJohn Marino - I've been thinking about this. each node could have a 'colour' 88*86d7f5d3SJohn Marino which is set to the colour of the packet as you pass through. 89*86d7f5d3SJohn Marino hitting a node already of your colour would abort. Each packet 90*86d7f5d3SJohn Marino has another (incremented) colour. 91*86d7f5d3SJohn Marino -new 'item' type can hold a hopcount... 92*86d7f5d3SJohn Marino 93*86d7f5d3SJohn MarinoNEW in 2001 94*86d7f5d3SJohn MarinoAll piggyback responses have gone away. 95*86d7f5d3SJohn Marinouse the node ID in the return address field for quick response delivery. 96*86d7f5d3SJohn Marino 97*86d7f5d3SJohn MarinoEvery node has a queue, plus there is a list of nodes that have queued work. 98*86d7f5d3SJohn MarinoExtensive use of Mutexes. Getting in shape for SMP. 99*86d7f5d3SJohn Marino 100*86d7f5d3SJohn MarinoMessages and data are deliverd in a new form. An Item now has 101*86d7f5d3SJohn Marinoall information needed to queue such a request and deliver it later, so 102*86d7f5d3SJohn Marinoit is now the basis of all data transfer since any transfer may need to 103*86d7f5d3SJohn Marinobe queued. 104