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/m3ua/m3ua_msg.c#ident "@(#) $RCSfile: m3ua_msg.c,v $ $Name: $($Revision: 0.8.2.1 $) $Date: 2002/10/18 03:27:42 $" static char const ident[] = "$RCSfile: m3ua_msg.c,v $ $Name: $($Revision: 0.8.2.1 $) $Date: 2002/10/18 03:27:42 $"; /* * ------------------------------------------------------------------------- * * 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 m3ua_decode_parms(mp, m3ua_results) mblk_t *mp; m3ua_parms_t *m3ua_results; { int len; uint32_t *p = (uint32_t *) mp->b_rptr; struct parm *pp = NULL; bzero(m3ua_results, sizeof(*m3ua_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 *) (m3ua_results)) + ttag; goto finish_parm; } ttag = tag - M3UA_PARM_BASE; if (0 <= ttag && ttag <= M3UA_PARM_MAX) { ttag += UA_PARM_MAX + 1; pp = ((struct ua_parm *) (m3ua_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. |