1 $FreeBSD: src/sys/netgraph/NOTES,v 1.1 1999/10/21 09:05:51 julian Exp $
2 $DragonFly: src/sys/netgraph/NOTES,v 1.2 2003/06/17 04:28:49 dillon Exp $
5 Archie's suggestions... :-)
7 - There should be a new malloc type: M_NETGRAPH
9 - all mallocs/frees now changed to use this.. JRE
10 - might further split them out some time.
12 - Use MALLOC and FREE macros instead of direct function calls
14 - They allow conditional compilation which keeps
15 statistics & counters on various memory allocation
18 - In struct ng_mesg: at least make "header" into "hdr", if not
19 getting rid of it altogether. It doesn't seem necessary and
20 makes all my C code lines too long.
22 - I understand.. one thought however.. consider..
23 if char data[0] were not legal, so that data[1] needed to be
24 used instead, then the only way to get the size of the header
25 would be sizeof(msg.header) as sizeof(msg) would include the dummy
26 following bytes. this is a portability issue and I hope
27 it will be ported eventually :)
29 - Baloney! you can use sizeof(msg) - 1 then.. or just
30 make it a macro, then its always portable:
33 #define NG_MSG_HDR_SIZE (sizeof(struct ng_message))
35 #define NG_MSG_HDR_SIZE (sizeof(struct ng_message) - 1)
38 - Have a user level program to print out and manipulate nodes, etc.
42 - "Netgraph global" flags to turn on tracing, etc.
44 - ngctl needs to be rewritten using libnetgraph. Also it needs a
45 command to list all existing nodes (in case you don't know the
46 name of what you're looking for).
49 - Need a way to get a list of ALL nodes.
53 - Enhance "netstat" to display all netgraph nodes -- or at least
54 all netgraph socket nodes.
57 - BUG FIX: bind() on a socket should neither require nor allow a
58 colon character at the end of the name. Note ngctl allows you
62 - Need to implement passing meta information through socket nodes
63 using sendmsg() and recvmsg().
65 - Stuff needing to be added to manual:
67 - Awareness of SPL level, use ng_queue*() functions when necessary.
68 - Malloc all memory with type M_NETGRAPH.
69 - Write code so it can be an LKM or built into the kernel.. this means
70 be careful with things like #ifdef INET.
71 - All nodes assume that all data mbufs have the M_PKTHDR flag set!
72 The ng_send_data() and related functions should have an
73 #ifdef DIAGNOSTICS check to check this assumption for every mbuf.
74 - More generally, netgraph code should make liberal use of the
75 #ifdef DIAGNOSTICS definition.
76 - Since data and messages are sent functionally, programmers need
77 to watch out for infinite feedback loops. Should ng_base.c detect
79 - I've been thinking about this. each node could have a 'colour'
80 which is set to the colour of the packet as you pass through.
81 hitting a node already of your colour would abort. Each packet
82 has another (incremented) colour.