Go to main content

STREAMS Programming Guide

Exit Print View

Updated: November 2020
 
 

Design Guidelines

Module developers must follow these guidelines:

  • If a module cannot process the message type, the message type must be passed to the next module.

  • The module that acts on an M_IOCTL message must send an M_IOCACK or M_IOCNAK message in response to the ioctl. If the module cannot process the ioctl, it must pass the M_IOCTL message to the next module. For more information, see the ioctl(2) man page.

  • Modules must not pertain to any particular driver but must be compatible with all drivers.

  • In general, modules must not require the data in an M_DATA message to follow a particular format, such as a specific alignment. This means modules can be arbitrarily pushed on top of each other in a sensible fashion. Not following this rule can limit module usability.

  • Filter modules pushed between a service user and a service provider should not alter the contents of the M_PROTO or M_PCPROTO block in messages. The contents of the data blocks can be changed, but the message boundaries must be preserved.

htonl(3XNET) and ntohl(3XNET)

The htonl() and ntohl() conversion routines follow the XNS5 publications. The functions continue to convert 32-bit quantities between network byte order and host byte order. For more information, see the ntohl(3C) and htonl(3C) man pages.