summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/NOTES
blob: 69d8b711b9e4dd7239bf5894a09ab9882a3c0929 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
$FreeBSD$
Development ideas..

Archie's suggestions... :-)

 - There should be a new malloc type: M_NETGRAPH
	[DONE]
	- all mallocs/frees now changed to use this.. JRE
	- might further split them out some time.

 - Use MALLOC and FREE macros instead of direct function calls
	[DONE]
	- They allow conditional compilation which keeps
	  statistics & counters on various memory allocation
	  (or so it seems)

 - In struct ng_mesg: at least make "header" into "hdr", if not
   getting rid of it altogether. It doesn't seem necessary and
   makes all my C code lines too long.

	- I understand.. one thought however.. consider..
	  if char data[0] were not legal,  so that data[1] needed to be
	  used instead, then the only way to get the size of the header
	  would be sizeof(msg.header) as sizeof(msg) would include the dummy
	  following bytes. this is a portability issue and I hope
	  it will be ported eventually :)

	- Baloney! you can use sizeof(msg) - 1 then.. or just
	  make it a macro, then its always portable:

	  #ifdef __GNU_C__
	    #define NG_MSG_HDR_SIZE	(sizeof(struct ng_message))
	  #else
	    #define NG_MSG_HDR_SIZE	(sizeof(struct ng_message) - 1)
	  #endif

 - Have a user level program to print out and manipulate nodes, etc.
	- [DONE]
		see ngctl

 - "Netgraph global" flags to turn on tracing, etc.

 - ngctl needs to be rewritten using libnetgraph. Also it needs a
   command to list all existing nodes (in case you don't know the
   name of what you're looking for).
	[DONE]

 - Need a way to get a list of ALL nodes.
	[DONE]
	- see NGM_LISTNODES

 - Enhance "netstat" to display all netgraph nodes -- or at least
   all netgraph socket nodes.
	[DONE]

 - BUG FIX: bind() on a socket should neither require nor allow a
   colon character at the end of the name. Note ngctl allows you
   to do it either way!
	[DONE] (I think)

 - Need to implement passing meta information through socket nodes
   using sendmsg() and recvmsg().

 - Stuff needing to be added to manual:

   - Awareness of SPL level, use ng_queue*() functions when necessary.
   - Malloc all memory with type M_NETGRAPH.
   - Write code so it can be an LKM or built into the kernel.. this means
     be careful with things like #ifdef INET.
   - All nodes assume that all data mbufs have the M_PKTHDR flag set!
     The ng_send_data() and related functions should have an
     #ifdef DIAGNOSTICS check to check this assumption for every mbuf.
   - More generally, netgraph code should make liberal use of the
     #ifdef DIAGNOSTICS definition.
   - Since data and messages are sent functionally, programmers need
     to watch out for infinite feedback loops. Should ng_base.c detect
     this automatically?
      - I've been thinking about this. each node could have a 'colour'
	which is set to the colour of the packet as you pass through.
	hitting a node already of your colour would abort. Each packet
	has another (incremented) colour.
OpenPOWER on IntegriCloud