1. Maxfwd Module

Bogdan Iancu

   FhG FOKUS

   Copyright  2003 FhG FOKUS
   Revision History
   Revision $Revision: 1.3.2.1 $ $Date: 2008/06/11 13:12:00 $
     __________________________________________________________________

   1.1. Overview
   1.2. Functions

        1.2.1. mf_process_maxfwd_header(max_value)

1.1. Overview

   The module implements all the operations regarding MaX-Forward header
   field, like adding it (if not present) or decrementing and checking the
   value of the existent one.

1.2. Functions

   Revision History
   Revision $Revision: 1.3.2.1 $ $Date: 2008/06/11 13:12:00 $

1.2.1.  mf_process_maxfwd_header(max_value)

   If no Max-Forward header is present in the received request, a header
   will be added having the original value equal with "max_value". An OK
   code is returned by the function.

   If a Max-Forward header is already present, its value will be
   decremented. If after this operation its value will be positive
   non-zero, an OK code will be returned. Otherwise (for a zero value) an
   error code will be returned. Note that an error code will be also
   returned if the SIP message couldn't be parsed or if the Max-Forward
   header's body invalid (non numerical string or negative numerical
   value).

   Meaning of the parameters is as follows:
     * max_value - Value to be added if there is no Max-Forwards header
       field in the message.

   Example 1. mx_process_maxfwd_header usage
...
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
    sl_send_reply("483","Too Many Hops");
    break;
};
...
