Installation guide

6: LAN Message Filtering
DC 900-1325I 87
Next, the function strips all carriage return characters from the data. Recall that one of
the limitations on filters is that special control sequences to be detected and replaced
must be contained entirely within a buffer. Hence, the function implicitly assumes that
there is no carriage return in the data stream unless it is part of an EOL sequence. Note
that the data size is updated whenever a carriage return is removed from the data
stream.
Finally, the packet size in the ICP header is updated to reflect any deletions that
occurred.
The function that filters packets going out to the WAN (function Filter_To_WAN) per-
forms the exact opposite function. It inserts a carriage return whenever it encounters a
newline character (that is, an ASCII line feed). The first duty it performs is to check
whether the packet contains any actual user data. Again, control packets are ignored.
The next step it performs is important. Because carriage return characters are inserted
into the data, the function must be able to detect when the buffer overflows, and hence
needs to know the maximum size of the buffer space available. It issues a
tPoll call to
obtain the system configuration. The
iMaxBufSize field of the system configuration
structure contains the maximum amount of buffer space available. However, this buffer
space does not contain data alone. It also includes the Freeway header, the ICP header,
and the protocol header, so these sizes must be decremented from the total count.
Note
The filter functions are called by the message multiplexor (msg-
mux
) task, and hence execute within the context of that task. The
msgmux task has already processed its TSI configuration file and
initialized the TSI. For this reason, the filters can make TSI calls
directly without having to perform their own TSI initialization.
The function then calculates the amount of data in the packet and dumps the data to the
Freeway log file.