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