You are here: SwitchKit® Development Environment Programmer’s Guide > 11 Programming Tips & Examples > Parsing of AIBs

Parsing of AIBs

Description

Upon receiving a message that contains an AIB, such as XL_DS0StatusChange, it is possible to get the Span and Channel by using the sk_getAIB* routines.

Code Example

int genericHandler(SK_Event *evt, void *tag) {

MsgStruct *msg = evt->IncomingMsg;

SK_MSG_SWITCH(msg) {

/* Print info about any DS0 status change */

CASE_DS0StatusChange(ds0) {

printf("DS0 Stat Change, Span:%d, Chan:%d,

Stat:%d, Purge:%X\n",

sk_getAIBSpan(ds0->AddrInfo),

sk_getAIBChannel(ds0->AddrInfo),

ds0->ChannelStatus,

ds0->PurgeStatus);

return OK;

}

CASE_default {

printf("Unknown message\n");

return OK;

}

} SK_END_SWITCH;

}

See Address Information Block.
Range of channels provided by T1 or E1 transmission service. A physical span is a group of channels taking up a single physical wire. A logical span is a group of channels taking up less than a single logical wire, or carried over more than one physical wire.