186d7f5d3SJohn Marino$FreeBSD: src/sys/netgraph/NOTES,v 1.2 2001/01/06 00:46:46 julian Exp $ 286d7f5d3SJohn MarinoDevelopment ideas.. 386d7f5d3SJohn Marino 486d7f5d3SJohn MarinoArchie's suggestions... :-) 586d7f5d3SJohn Marino 686d7f5d3SJohn Marino - There should be a new malloc type: M_NETGRAPH 786d7f5d3SJohn Marino [DONE] 886d7f5d3SJohn Marino - all mallocs/frees now changed to use this.. JRE 986d7f5d3SJohn Marino - might further split them out some time. 1086d7f5d3SJohn Marino 1186d7f5d3SJohn Marino - Use MALLOC and FREE macros instead of direct function calls 1286d7f5d3SJohn Marino [DONE] 1386d7f5d3SJohn Marino - They allow conditional compilation which keeps 1486d7f5d3SJohn Marino statistics & counters on various memory allocation 1586d7f5d3SJohn Marino (or so it seems) 1686d7f5d3SJohn Marino - Now tend to have NG_FREE_XX() macros. they 1786d7f5d3SJohn Marino allow better debugging 1886d7f5d3SJohn Marino 1986d7f5d3SJohn Marino - In struct ng_mesg: at least make "header" into "hdr", if not 2086d7f5d3SJohn Marino getting rid of it altogether. It doesn't seem necessary and 2186d7f5d3SJohn Marino makes all my C code lines too long. 2286d7f5d3SJohn Marino 2386d7f5d3SJohn Marino - I understand.. one thought however.. consider.. 2486d7f5d3SJohn Marino if char data[0] were not legal, so that data[1] needed to be 2586d7f5d3SJohn Marino used instead, then the only way to get the size of the header 2686d7f5d3SJohn Marino would be sizeof(msg.header) as sizeof(msg) would include the dummy 2786d7f5d3SJohn Marino following bytes. this is a portability issue and I hope 2886d7f5d3SJohn Marino it will be ported eventually :) 2986d7f5d3SJohn Marino 3086d7f5d3SJohn Marino - Baloney! you can use sizeof(msg) - 1 then.. or just 3186d7f5d3SJohn Marino make it a macro, then its always portable: 3286d7f5d3SJohn Marino 3386d7f5d3SJohn Marino #ifdef __GNU_C__ 3486d7f5d3SJohn Marino #define NG_MSG_HDR_SIZE (sizeof(struct ng_message)) 3586d7f5d3SJohn Marino #else 3686d7f5d3SJohn Marino #define NG_MSG_HDR_SIZE (sizeof(struct ng_message) - 1) 3786d7f5d3SJohn Marino #endif 3886d7f5d3SJohn Marino 3986d7f5d3SJohn Marino - inertia rules :-b 4086d7f5d3SJohn Marino 4186d7f5d3SJohn Marino 4286d7f5d3SJohn Marino - Have a user level program to print out and manipulate nodes, etc. 4386d7f5d3SJohn Marino - [DONE] 4486d7f5d3SJohn Marino see ngctl, nghook 4586d7f5d3SJohn Marino 4686d7f5d3SJohn Marino - "Netgraph global" flags to turn on tracing, etc. 4786d7f5d3SJohn Marino 4886d7f5d3SJohn Marino - ngctl needs to be rewritten using libnetgraph. Also it needs a 4986d7f5d3SJohn Marino command to list all existing nodes (in case you don't know the 5086d7f5d3SJohn Marino name of what you're looking for). 5186d7f5d3SJohn Marino [DONE] 5286d7f5d3SJohn Marino 5386d7f5d3SJohn Marino - Need a way to get a list of ALL nodes. 5486d7f5d3SJohn Marino [DONE] 5586d7f5d3SJohn Marino - see NGM_LISTNODES 5686d7f5d3SJohn Marino 5786d7f5d3SJohn Marino - Enhance "netstat" to display all netgraph nodes -- or at least 5886d7f5d3SJohn Marino all netgraph socket nodes. 5986d7f5d3SJohn Marino [DONE] 6086d7f5d3SJohn Marino 6186d7f5d3SJohn Marino - BUG FIX: bind() on a socket should neither require nor allow a 6286d7f5d3SJohn Marino colon character at the end of the name. Note ngctl allows you 6386d7f5d3SJohn Marino to do it either way! 6486d7f5d3SJohn Marino [DONE] (I think) 6586d7f5d3SJohn Marino - bind on a control socket has been disabled 6686d7f5d3SJohn Marino it was a bad idea. 6786d7f5d3SJohn Marino 6886d7f5d3SJohn Marino - Need to implement passing meta information through socket nodes 6986d7f5d3SJohn Marino using sendmsg() and recvmsg(). 7086d7f5d3SJohn Marino 7186d7f5d3SJohn Marino - Stuff needing to be added to manual: 7286d7f5d3SJohn Marino 7386d7f5d3SJohn Marino - Awareness of SPL level, use ng_queue*() functions when necessary. 7486d7f5d3SJohn Marino - Malloc all memory with type M_NETGRAPH. -DONE 7586d7f5d3SJohn Marino - Write code so it can be an LKM or built into the kernel.. this means 7686d7f5d3SJohn Marino be careful with things like #ifdef INET. 7786d7f5d3SJohn Marino - All nodes assume that all data mbufs have the M_PKTHDR flag set! 7886d7f5d3SJohn Marino The ng_send_data() and related functions should have an 7986d7f5d3SJohn Marino #ifdef DIAGNOSTICS check to check this assumption for every mbuf. 8086d7f5d3SJohn Marino -DONE with INVARIANTS. Framework should test this more. 8186d7f5d3SJohn Marino - More generally, netgraph code should make liberal use of the 8286d7f5d3SJohn Marino #ifdef DIAGNOSTICS definition. 8386d7f5d3SJohn Marino -INVARIANTS. 8486d7f5d3SJohn Marino - Since data and messages are sent functionally, programmers need 8586d7f5d3SJohn Marino to watch out for infinite feedback loops. Should ng_base.c detect 8686d7f5d3SJohn Marino this automatically? 8786d7f5d3SJohn Marino - I've been thinking about this. each node could have a 'colour' 8886d7f5d3SJohn Marino which is set to the colour of the packet as you pass through. 8986d7f5d3SJohn Marino hitting a node already of your colour would abort. Each packet 9086d7f5d3SJohn Marino has another (incremented) colour. 9186d7f5d3SJohn Marino -new 'item' type can hold a hopcount... 9286d7f5d3SJohn Marino 9386d7f5d3SJohn MarinoNEW in 2001 9486d7f5d3SJohn MarinoAll piggyback responses have gone away. 9586d7f5d3SJohn Marinouse the node ID in the return address field for quick response delivery. 9686d7f5d3SJohn Marino 9786d7f5d3SJohn MarinoEvery node has a queue, plus there is a list of nodes that have queued work. 9886d7f5d3SJohn MarinoExtensive use of Mutexes. Getting in shape for SMP. 9986d7f5d3SJohn Marino 10086d7f5d3SJohn MarinoMessages and data are deliverd in a new form. An Item now has 10186d7f5d3SJohn Marinoall information needed to queue such a request and deliver it later, so 10286d7f5d3SJohn Marinoit is now the basis of all data transfer since any transfer may need to 10386d7f5d3SJohn Marinobe queued. 104