Problem: for developers working against the netinfo framework being
delivered by the pfhooks project need to be cogniscent of and develop
against the STREAMS mblk_t data structure.  This gives us no flexiblity
to transition to another data structure and limits us in how we can
use it.

The solution I'd like to start people thinking about is to introduce a
data type that is presented as a pointer to external entities and for
which we provide accessor methods.

At present that are a number of fields which the data structure needs
to have internally:

* pointer to the start of the mblk chain containing the packet;
* pointer to the mblk that contains the start of the layer 3 header;
* pointer to the layer 3 header itself.

To work with this structure, we need at least the following:

X_free()
X_resize()
X_getl#hdr()
X_copyout()
X_copyin()
X_pullup()
X_length()

For illustrative purposes, I'll describe the above in terms of the STREAMS API.

X_free() - freemsg(start of mblk_chain)
X_resize() - adjmsg() for < 0 or allocb+linkb for > 0
X_getl#hdr() - returns the pinter to the layer 3 header
X_pullup() - pullupmsg()
X_length() - msgdsize(mblk with layer 3 header)

The next two have no equivalent in STREAMS:
X_copyout() - copy data out of the packet to somewhere else
X_copyin() - copy data from somewhere else into a packet

Just to reiterate, this is not an interface aimed at internal drivers or
protocols, rather for 3rd party software that wants to attach to the stack
and receive packet events.

Comments?

Darren

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to