Mtp3InitNSapCfg

Initializes the provided NSAP configuration structure MTP3NSapCfg with default values and the specified link type.

Prototype

MTP3_STATUS Mtp3InitNSapCfg ( MTP3NSapCfg *pNSapCfg, U8 linkType)

Argument

Description

pNSapCfg

Pointer to the MTP3NSapCfg structure to be initialized:

typedef struct _MTP3NSapCfg
{
  S16 p0QLen;      /* Size of the priority 0 Q                */
  S16 p1QLen;      /* Size of the priority 1 Q                */
  S16 p2QLen;      /* Size of the priority 2 Q                */
  S16 p3QLen;      /* Size of the priority 3 Q                */
  U8  discPrior;   /* Discard priority                        */
  U8  lnkType;     /* Link type ANSI or CCITT                 */
  U8  selector;    /* Upper layer selector                    */
  U8  spare1;      /* Alignment                               */
  MemoryId mem;    /* Memory region and pool id               */
  U8  dpcLen;      /* dpc or opc length                       */
  U8  prior;       /* Priority                                */
  U8  route;       /* Route                                   */
  U8  spare2;      /* Alignment                               */
  U32 opc;         /* Default opc for UDatReq from user layer */
} MTP3NSapCfg;

See the Details section for field descriptions.

linkType

Type of link. Valid values are:

MTP3LNK_ANSI

MTP3LNK_ANSI88

MTP3LNK_CCITT

MTP3LNK_JNTT

MTP3LNK_JTTC


Return values

Return value

Description

MTP3_SUCCESS

 

MTP3_LNKTYPE

Invalid link type.


Details

This function enables an application to initialize an MTP3NSapCfg structure before calling Mtp3SetNSapCfg to set the network SAP configuration parameters. Mtp3InitNSapCfg sets the link type as specified and initializes all other fields in the MTP3NSapCfg structure to their defaults.

The pxQlen fields represent the queue length thresholds at which the internal congestion priority is raised to the next level. For example, the default for p1Qlen is 16. This value means that when the receive queue size reaches 16 messages, the internal congestion priority is raised from 0 to 1. Zero (0) is the lowest priority and 3 is the highest priority. The congestion priority in combination with the discard priority (discPrior field) are used to determine what to do with newly received messages when flow control is on.

If a newly received message has a priority less than the congestion priority and less than the discard priority, the message is discarded. Otherwise, MTP 3 attempts to queue the message, assuming buffer space exists. A discard priority of 0 means that all messages will attempt to be queued regardless of the internal congestion priority. The congestion priority is also used to notify adjacent signaling points of the level of congestion being experienced by this node so that they can re-route future messages or take other corrective actions.

Typically a pointer to an MTP3NSapCfg structure is passed to Mtp3InitNSapCfg where default values are set. After initialization, an application can override zero to all of these values and then pass the pointer to Mtp3SetNSapCfg, which sets the configuration. The default values provided by Mtp3InitNSapCfg are adequate for most applications.

The following table lists the MTP3NSapCfg fields that can be modified. All the fields in this table can be updated on subsequent calls to Mtp3SetNSapCfg. Fields that do not appear in the table are either unused or for internal use, and must not be modified.

Field

Description

p0Qlen

Receive queue length threshold at which the congestion priority is raised to 0. Valid range is 2 through 1024. Default is 0.

p1Qlen

Receive queue length threshold at which the congestion priority is raised to 1. Valid range is (p0Qlen + 2) through 1024. Default is 512.

p2Qlen

Receive queue length threshold at which the congestion priority is raised to 2. Valid range is (p1Qlen + 2) through 1024. Default is 768.

p3Qlen

Receive queue length threshold at which the congestion priority is raised to 3. Valid range is (p2Qlen + 2) through 1024. Default is 896.

discPrior

Discard priority. Valid range is 0 through 3. Default is 0. See the Details section for more information.

lnkType

Protocol variant used by this NSAP. Must be specified with the linkType parameter. Valid values are:

MTP3LNK_ANSI

MTP3LNK_ANSI88

MTP3LNK_CCITT

MTP3LNK_JNTT

MTP3LNK_JTTC

dpcLen

DPC and OPC length. Defaults based on linkType:

24 = LNK_ANSI or LNK_ANSI88

14 = LNK_CCITT

16 = LNK_JNTT or LNK_JTTC