cc_SndFrame( ) sends a frame to the data link layer
258
!
! !
!
Example
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include “srllib.h”
#include “dtilib.h”
#include “cclib.h”
/* Global variables */
typedef long int (*EVTHDLRTYP)( );
.
.
.
void InitSndFrameBlk (L2_BLK *l2_blk_ptr)
{
l2_blk_ptr -> length = 13; /* 13 bytes of data */
l2_blk_ptr -> data [0] = 0x08; /* Protocol discriminator */
l2_blk_ptr -> data [1] = 0x02; /* CRN length - 2 bytes */
l2_blk_ptr -> data [2] = 0x03; /* CRN = 8003 */
l2_blk_ptr -> data [3] = 0x80;
l2_blk_ptr -> data [4] = 0x6e; /* msg type = NOTIFY */
/* The first IE */
l2_blk_ptr -> data [5] = 0x27; /* IE type = 27 (NOTIFY) */
l2_blk_ptr -> data [6] = 0x01; /* The length of NOTIFY */
l2_blk_ptr -> data [7] = 0xF1; /* Notify indication */
/* The second IE */
l2_blk_ptr -> data [8] = 0x76; /* IE type = 76 (REDIRECTION) */
l2_blk_ptr -> data [9] = 0x03; /* length of redirection */
l2_blk_ptr -> data [10] = 0x01; /* unknown type and E164 plan */
l2_blk_ptr -> data [11] = 0x03; /* network provides presentation */
l2_blk_ptr -> data [12] = 0x8D; /* reason = transfer */
}
int evt_hdlr( )
{
int ldev = sr_getevtdev( );
unsigned long *ev_datap = (unsigned long *)sr_getevtdatap( );
int len = sr_getevtlen( );
int rc = 0;
L2_BLK l2_blk;
InitSndFrameBlk (&l2_blk); /* prepare for the message */
if ((rc = cc_SndFrame(ldev, &l2_blk) )!=0)
{
printf(“Error in cc_SndFrame, rc = %x\n”, rc);
}
else
.
.
.
.
.
}