OpenSS7 SS7 for the Common Man |
© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved. |
||||||||||||||||||||||||||
Home | Overview | Status | News | Documentation | Resources | About | |||||||||||||||||||||
File /code/strss7/drivers/m2ua/m2ua_msg.c#ident "@(#) $RCSfile: m2ua_msg.c,v $ $Name: $($Revision: 0.8.2.1 $) $Date: 2002/10/18 03:28:38 $" static char const ident[] = "$RCSfile: m2ua_msg.c,v $ $Name: $($Revision: 0.8.2.1 $) $Date: 2002/10/18 03:28:38 $"; /* * ------------------------------------------------------------------------- * * General purpose parameter decoder * * ------------------------------------------------------------------------- * * General purpose parameter extractor for UA messages: Given the pointer to * the parameter, this will generate a parameter array which indexes messages * of each type and provides their length. */ int m2ua_decode_parms(mblk_t * mp, m2ua_parms_t * m2ua_results) { int len; uint32_t *p = (uint32_t *) mp->b_rptr; struct parm *pp = NULL; bzero(m2ua_results, sizeof(*m2ua_results)); p += 2; /* skip header */ for (; p < (uint32_t *) mp->b_wptr && (len = UA_LENGTH(*p)) >= 4; p += (len + 3) >> 2) { int ttag, tag = ntohl(*p) >> 16; ttag = tag - UA_PARM_BASE; if (0 <= ttag && ttag <= UA_PARM_MAX) { pp = ((struct ua_parm *) m2ua_results) + ttag; goto finish_parm; } ttag = tag - M2UA_PARM_BASE; if (0 <= ttag && ttag <= M2UA_PARM_MAX) { ttag += UA_PARM_MAX + 1; pp = ((struct ua_parm *) m2ua_results) + ttag; goto finish_parm; } continue; finish_parm: pp->u.wptr = p + 1; pp->len = len; pp->val = ntohl(p[1]); } return (0); }
|
|||||||||||||||||||||||||||
OpenSS7 SS7 for the Common Man |
Home | Overview | Status | News | Documentation | Resources | About | ||||||||||||||||||||
© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved. |