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