z/OS Communications Server: IP Programmer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


smfi_replacebody

z/OS Communications Server: IP Programmer's Guide and Reference
SC27-3659-02

#include <libmilter/mfapi.h>
int smfi_replacebody(
	     SMFICTX *ctx,
	     unsigned char *bodyp,
	     int bodylen
);

smfi_replacebody description

The smfi_replacebody API replaces the body of the current message. It is called only from xxfi_eom and can be called more than once. If it is called multiple times, subsequent calls result in data being appended to the new body.

smfi_replacebody parameters

ctx
Opaque context structure.
bodyp
A pointer to the start of the new body data, which does not have to be null-terminated. If bodyp is NULL, it is treated as having length equal to 0. Body data should be in CR/LF form.
bodylen
The number of data bytes bodyp points to.

smfi_replacebody result

smfi_replacebody fails and returns MI_FAILURE if any of the following conditions occur:
  • bodyp is equal to NULL and bodylen is greater than 0.
  • Changing the body in the current connection state is not valid.
  • A network error occurs.
  • SMFIF_CHGBODY was not set when smfi_register was called.

Otherwise, it will return MI_SUCCESS.

Notes:
  1. Becuase the message body can be very large, setting SMFIF_CHGBODY might significantly affect filter performance.
  2. If a filter sets SMFIF_CHGBODY but does not call smfi_replacebody, the original body remains unchanged.
  3. Filter order is important for smfi_replacebody; later filters see the new body contents created by previous filters.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014