X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fcm_gen.c;h=ab7a754e22b8983094cf2e2bd06ee9ac7a3f2e85;hb=49856df248fd976b4a9882ca4e650fc0bc3e4ee3;hp=b94ccb6ed270dd6381cff6adc5c3d12f90e11df3;hpb=aee73991f728cc127d1ed76d5a52571d916235a4;p=o-du%2Fl2.git diff --git a/src/cm/cm_gen.c b/src/cm/cm_gen.c index b94ccb6ed..ab7a754e2 100644 --- a/src/cm/cm_gen.c +++ b/src/cm/cm_gen.c @@ -73,7 +73,7 @@ /* functions in other modules */ /* public variable declarations */ -U16 gTransId = 0; +uint16_t gTransId = 0; /* private variable declarations */ @@ -97,31 +97,24 @@ U16 gTransId = 0; * */ -#ifdef ANSI -PUBLIC S16 cmPkDateTime +S16 cmPkDateTime ( DateTime *dateTime, /* date and time */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkDateTime(dateTime, mBuf) -DateTime *dateTime; /* date and time */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkDateTime) /*-- cm_gen_c_001.main_36 - added for micro seconds --*/ #ifdef SS_DATETIME_USEC - CMCHKPK(oduUnpackUInt32, dateTime->usec, mBuf); + CMCHKPK(oduPackUInt32, dateTime->usec, mBuf); #endif /*-- SS_DATETIME_USEC --*/ - CMCHKPK(oduUnpackUInt8, dateTime->tenths, mBuf); - CMCHKPK(oduUnpackUInt8, dateTime->sec, mBuf); - CMCHKPK(oduUnpackUInt8, dateTime->min, mBuf); - CMCHKPK(oduUnpackUInt8, dateTime->hour, mBuf); - CMCHKPK(oduUnpackUInt8, dateTime->year, mBuf); - CMCHKPK(oduUnpackUInt8, dateTime->day, mBuf); - CMCHKPK(oduUnpackUInt8, dateTime->month, mBuf); + CMCHKPK(oduPackUInt8, dateTime->tenths, mBuf); + CMCHKPK(oduPackUInt8, dateTime->sec, mBuf); + CMCHKPK(oduPackUInt8, dateTime->min, mBuf); + CMCHKPK(oduPackUInt8, dateTime->hour, mBuf); + CMCHKPK(oduPackUInt8, dateTime->year, mBuf); + CMCHKPK(oduPackUInt8, dateTime->day, mBuf); + CMCHKPK(oduPackUInt8, dateTime->month, mBuf); return ROK; } /* end of cmPkDateTime */ @@ -141,25 +134,18 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkDuration +S16 cmPkDuration ( Duration *duration, /* duration */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkDuration(duration, mBuf) -Duration *duration; /* duration */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkDuration) - CMCHKPK(oduUnpackUInt8, duration->tenths, mBuf); - CMCHKPK(oduUnpackUInt8, duration->secs, mBuf); - CMCHKPK(oduUnpackUInt8, duration->mins, mBuf); - CMCHKPK(oduUnpackUInt8, duration->hours, mBuf); - CMCHKPK(oduUnpackUInt8, duration->days, mBuf); + CMCHKPK(oduPackUInt8, duration->tenths, mBuf); + CMCHKPK(oduPackUInt8, duration->secs, mBuf); + CMCHKPK(oduPackUInt8, duration->mins, mBuf); + CMCHKPK(oduPackUInt8, duration->hours, mBuf); + CMCHKPK(oduPackUInt8, duration->days, mBuf); return ROK; } /* end of cmPkDuration */ @@ -178,27 +164,20 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 oduPackPointer +S16 oduPackPointer ( PTR ptr, /* pointer */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 oduPackPointer(ptr, mBuf) -PTR ptr; /* pointer */ -Buffer *mBuf; /* message buffer */ -#endif { Data pkArray[PTRSIZE]; /* array for packing */ S16 ret; /* return code */ - U16 tmp; /* temporary value */ + uint16_t tmp; /* temporary value */ #if (defined(ALPHA) || defined(BIT_64)) - U32 tmp32; + uint32_t tmp32; #endif - TRC2(oduPackPointer) ret = ROK; switch (PTRSIZE) @@ -216,17 +195,17 @@ Buffer *mBuf; /* message buffer */ case 4: #ifndef FCSPKINT /* backward compatibility, packing order */ - tmp = (U16) GetHiWord(ptr); + tmp = (uint16_t) GetHiWord(ptr); pkArray[0] = (Data) GetHiByte(tmp); pkArray[1] = (Data) GetLoByte(tmp); - tmp = (U16) GetLoWord(ptr); + tmp = (uint16_t) GetLoWord(ptr); pkArray[2] = (Data) GetHiByte(tmp); pkArray[3] = (Data) GetLoByte(tmp); #else /* forward compatibility, packing order */ - tmp = (U16) GetHiWord(ptr); + tmp = (uint16_t) GetHiWord(ptr); pkArray[3] = (Data) GetHiByte(tmp); pkArray[2] = (Data) GetLoByte(tmp); - tmp = (U16) GetLoWord(ptr); + tmp = (uint16_t) GetLoWord(ptr); pkArray[1] = (Data) GetHiByte(tmp); pkArray[0] = (Data) GetLoByte(tmp); #endif @@ -236,33 +215,33 @@ Buffer *mBuf; /* message buffer */ case 8: #if (defined(ALPHA) || defined(BIT_64)) #ifndef FCSPKINT /* backward compatibility, packing order */ - tmp32 = (U32) GetHi32Bit(ptr); - tmp = (U16) GetHiWord(tmp32); + tmp32 = (uint32_t) GetHi32Bit(ptr); + tmp = (uint16_t) GetHiWord(tmp32); pkArray[0] = (Data) GetHiByte(tmp); pkArray[1] = (Data) GetLoByte(tmp); - tmp = (U16) GetLoWord(tmp32); + tmp = (uint16_t) GetLoWord(tmp32); pkArray[2] = (Data) GetHiByte(tmp); pkArray[3] = (Data) GetLoByte(tmp); - tmp32 = (U32) GetLo32Bit(ptr); - tmp = (U16) GetHiWord(tmp32); + tmp32 = (uint32_t) GetLo32Bit(ptr); + tmp = (uint16_t) GetHiWord(tmp32); pkArray[4] = (Data) GetHiByte(tmp); pkArray[5] = (Data) GetLoByte(tmp); - tmp = (U16) GetLoWord(tmp32); + tmp = (uint16_t) GetLoWord(tmp32); pkArray[6] = (Data) GetHiByte(tmp); pkArray[7] = (Data) GetLoByte(tmp); #else /* forward compatibility, packing order */ - tmp32 = (U32) GetHi32Bit(ptr); - tmp = (U16) GetHiWord(tmp32); + tmp32 = (uint32_t) GetHi32Bit(ptr); + tmp = (uint16_t) GetHiWord(tmp32); pkArray[7] = (Data) GetHiByte(tmp); pkArray[6] = (Data) GetLoByte(tmp); - tmp = (U16) GetLoWord(tmp32); + tmp = (uint16_t) GetLoWord(tmp32); pkArray[5] = (Data) GetHiByte(tmp); pkArray[4] = (Data) GetLoByte(tmp); - tmp32 = (U32) GetLo32Bit(ptr); - tmp = (U16) GetHiWord(tmp32); + tmp32 = (uint32_t) GetLo32Bit(ptr); + tmp = (uint16_t) GetHiWord(tmp32); pkArray[3] = (Data) GetHiByte(tmp); pkArray[2] = (Data) GetLoByte(tmp); - tmp = (U16) GetLoWord(tmp32); + tmp = (uint16_t) GetLoWord(tmp32); pkArray[1] = (Data) GetHiByte(tmp); pkArray[0] = (Data) GetLoByte(tmp); #endif @@ -270,7 +249,7 @@ Buffer *mBuf; /* message buffer */ break; #endif default: - /* no support for U64 */ + /* no support for uint64_t */ ret = RFAILED; } @@ -292,19 +271,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkEntityId +S16 cmPkEntityId ( EntityId *entityId, /* entity id */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkEntityId(entityId, mBuf) -EntityId *entityId; /* entity id */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkEntityId) CMCHKPK(cmPkInst, entityId->inst, mBuf); CMCHKPK(cmPkEnt, entityId->ent, mBuf); @@ -327,19 +299,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkElmntId +S16 cmPkElmntId ( ElmntId *elmntId, /* element id */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkElmntId(elmntId, mBuf) -ElmntId *elmntId; /* element id */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkElmntId) CMCHKPK(cmPkElmntInst3, elmntId->elmntInst3, mBuf); CMCHKPK(cmPkElmntInst2, elmntId->elmntInst2, mBuf); @@ -364,19 +329,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkMemoryId +S16 cmPkMemoryId ( MemoryId *memoryId, /* memoryId */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkMemoryId(memoryId, mBuf) -MemoryId *memoryId; /* memoryId */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkMemoryId) CMCHKPK(cmPkPool, memoryId->pool, mBuf); CMCHKPK(cmPkRegion, memoryId->region, mBuf); @@ -399,21 +357,14 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkSystemId +S16 cmPkSystemId ( SystemId *systemId, /* system id */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkSystemId(systemId, mBuf) -SystemId *systemId; /* system id */ -Buffer *mBuf; /* message buffer */ -#endif { Txt *p; /* part number string */ - TRC2(cmPkSystemId) for (p = systemId->ptNmb; *p; p++); @@ -448,33 +399,26 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkProtAddr +S16 cmPkProtAddr ( ProtAddr *pAddr, /* protocol address */ Buffer *mBuf /* buffer */ ) -#else -PUBLIC S16 cmPkProtAddr(pAddr, mBuf) -ProtAddr *pAddr; /* protocol address */ -Buffer *mBuf; /* buffer */ -#endif { - U8 j; /* Index */ + uint8_t j; /* Index */ - TRC3(cmPkProtAddr) #ifdef CM_ARI2 - CMCHKPK(oduUnpackUInt32, pAddr->autoSysId, mBuf); + CMCHKPK(oduPackUInt32, pAddr->autoSysId, mBuf); CMCHKPK(oduPackBool, pAddr->autoSysIdPres, mBuf); #endif /* CM_ARI2 */ for (j = pAddr->len; j; j--) - CMCHKPK(oduUnpackUInt8, pAddr->address[j - 1], mBuf); + CMCHKPK(oduPackUInt8, pAddr->address[j - 1], mBuf); - CMCHKPK(oduUnpackUInt8, pAddr->preLen, mBuf); - CMCHKPK(oduUnpackUInt8, pAddr->len, mBuf); - CMCHKPK(oduUnpackUInt16, pAddr->protType, mBuf); + CMCHKPK(oduPackUInt8, pAddr->preLen, mBuf); + CMCHKPK(oduPackUInt8, pAddr->len, mBuf); + CMCHKPK(oduPackUInt16, pAddr->protType, mBuf); return ROK; @@ -497,23 +441,16 @@ Buffer *mBuf; /* buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkProtAddrTbl +S16 cmPkProtAddrTbl ( ProtAddrTbl *protAddr, /* protocol address table */ Buffer *mBuf /* buffer */ ) -#else -PUBLIC S16 cmPkProtAddrTbl(protAddr, mBuf) -ProtAddrTbl *protAddr; /* protocol address table */ -Buffer *mBuf; /* buffer */ -#endif { - U8 i; /* index */ - U8 j; /* Index */ + uint8_t i; /* index */ + uint8_t j; /* Index */ ProtAddr *pAddr; /* protocol Address */ - TRC3(cmPkProtAddrTbl) if (protAddr->count > MAX_PROT_ADDRS) return RFAILED; @@ -523,19 +460,19 @@ Buffer *mBuf; /* buffer */ pAddr = &(protAddr->addr[i - 1]); #ifdef CM_ARI2 - CMCHKPK(oduUnpackUInt32, pAddr->autoSysId, mBuf); + CMCHKPK(oduPackUInt32, pAddr->autoSysId, mBuf); CMCHKPK(oduPackBool, pAddr->autoSysIdPres, mBuf); #endif /* CM_ARI2 */ for (j = pAddr->len; j; j--) - CMCHKPK(oduUnpackUInt8, pAddr->address[j - 1], mBuf); + CMCHKPK(oduPackUInt8, pAddr->address[j - 1], mBuf); - CMCHKPK(oduUnpackUInt8, pAddr->preLen, mBuf); - CMCHKPK(oduUnpackUInt8, pAddr->len, mBuf); - CMCHKPK(oduUnpackUInt16, pAddr->protType, mBuf); + CMCHKPK(oduPackUInt8, pAddr->preLen, mBuf); + CMCHKPK(oduPackUInt8, pAddr->len, mBuf); + CMCHKPK(oduPackUInt16, pAddr->protType, mBuf); } - CMCHKPK(oduUnpackUInt8, protAddr->count, mBuf); + CMCHKPK(oduPackUInt8, protAddr->count, mBuf); return ROK; } /* end of cmPkProtAddrTbl */ @@ -556,31 +493,24 @@ Buffer *mBuf; /* buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkAddrs +S16 cmPkAddrs ( Addrs *addrs, /* address */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkAddrs(addrs, mBuf) -Addrs *addrs; /* address */ -Buffer *mBuf; /* message buffer */ -#endif { - U8 i; /* loop counter */ + uint8_t i; /* loop counter */ - TRC2(cmPkAddrs) if (addrs->length > ADRLEN) return RFAILED; for (i = addrs->length; i; i--) { - CMCHKPK(oduUnpackUInt8, addrs->strg[i-1], mBuf); + CMCHKPK(oduPackUInt8, addrs->strg[i-1], mBuf); } - CMCHKPK(oduUnpackUInt8, addrs->length, mBuf); + CMCHKPK(oduPackUInt8, addrs->length, mBuf); return ROK; } /* end of cmPkAddrs */ @@ -601,31 +531,24 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkShrtAddrs +S16 cmPkShrtAddrs ( ShrtAddrs *addrs, /* address */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkShrtAddrs(addrs, mBuf) -ShrtAddrs *addrs; /* address */ -Buffer *mBuf; /* message buffer */ -#endif { - U8 i; /* loop counter */ + uint8_t i; /* loop counter */ - TRC2(cmPkShrtAddrs) if (addrs->length > SHRTADRLEN) return RFAILED; for (i = addrs->length; i; i--) { - CMCHKPK(oduUnpackUInt8, addrs->strg[i-1], mBuf); + CMCHKPK(oduPackUInt8, addrs->strg[i-1], mBuf); } - CMCHKPK(oduUnpackUInt8, addrs->length, mBuf); + CMCHKPK(oduPackUInt8, addrs->length, mBuf); return ROK; } /* end of cmPkShrtAddrs */ @@ -645,26 +568,19 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkAddrMask +S16 cmPkAddrMask ( -U8 *mask, /* pointer to address mask array */ +uint8_t *mask, /* pointer to address mask array */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkAddrMask(mask, mBuf) -U8 *mask; /* pointer to address mask array */ -Buffer *mBuf; /* message buffer */ -#endif { S16 i; /* counter */ - TRC2(cmPkAddrMask) /* pack address mask */ for (i = (ADRLEN - 1); i >= 0; i--) { - CMCHKPK(oduUnpackUInt8, mask[i], mBuf); + CMCHKPK(oduPackUInt8, mask[i], mBuf); } return ROK; @@ -685,21 +601,14 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkBndCfg +S16 cmPkBndCfg ( BndCfg *bndCfg, /* bndCfg */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkBndCfg(bndCfg, mBuf) -BndCfg *bndCfg; /* bndCfg */ -Buffer *mBuf; /* message buffer */ -#endif { Txt *p; /* temporary */ - TRC2(cmPkBndCfg) CMCHKPK(cmPkSelector, bndCfg->selector, mBuf); CMCHKPK(cmPkAddrs, &bndCfg->sapAdr, mBuf); @@ -709,9 +618,9 @@ Buffer *mBuf; /* message buffer */ CMCHKPK(cmPkRegion, bndCfg->region, mBuf); CMCHKPK(cmPkInst, bndCfg->inst, mBuf); CMCHKPK(cmPkEnt, bndCfg->ent, mBuf); - CMCHKPK(oduUnpackUInt8, bndCfg->wdw, mBuf); - CMCHKPK(oduUnpackUInt8, bndCfg->flcTyp, mBuf); - CMCHKPK(oduUnpackUInt8, bndCfg->bufOwnshp, mBuf); + CMCHKPK(oduPackUInt8, bndCfg->wdw, mBuf); + CMCHKPK(oduPackUInt8, bndCfg->flcTyp, mBuf); + CMCHKPK(oduPackUInt8, bndCfg->bufOwnshp, mBuf); for (p = bndCfg->usrId; *p; p++); for (; p != bndCfg->usrId; p--); @@ -734,19 +643,12 @@ Buffer *mBuf; /* message buffer */ * File: cm_gen.c * */ -#ifdef ANSI -PUBLIC S16 cmPkPst +S16 cmPkPst ( Pst *pst, Buffer *mBuf ) -#else -PUBLIC S16 cmPkPst(pst, mBuf) -Pst *pst; -Buffer *mBuf; -#endif { - TRC2(cmPkPst) CMCHKPK(cmPkEvent, pst->event, mBuf); CMCHKPK(cmPkInst, pst->srcInst, mBuf); @@ -781,29 +683,22 @@ Buffer *mBuf; * */ -#ifdef ANSI -PUBLIC S16 cmPkElmtHdr +S16 cmPkElmtHdr ( ElmtHdr *m, /* element header */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkElmtHdr(m, mBuf) -ElmtHdr *m; /* element header */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkElmtHdr) #if (LCAMT || ATM_BISUP) - CMCHKPK(oduUnpackUInt16, m->compInd, mBuf); + CMCHKPK(oduPackUInt16, m->compInd, mBuf); #endif /* LCAMT || ATM_BISUP */ #if (LCAMT || ATM_BISUP) /* Pack action indicator field */ if (m->pres) { - CMCHKPK(oduUnpackUInt8, m->actnInd, mBuf); + CMCHKPK(oduPackUInt8, m->actnInd, mBuf); } #endif @@ -816,9 +711,9 @@ Buffer *mBuf; /* message buffer */ /* * - * Fun: cmPkTknU8 + * Fun: cmPkTknUInt8 * - * Desc: This function packs a token U8 + * Desc: This function packs a token uint8_t * * Ret: ROK - ok * @@ -828,31 +723,24 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknU8 +S16 cmPkTknUInt8 ( -TknU8 *tknU8, /* token U8 */ +TknUInt8 *tknUInt8, /* token uint8_t */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknU8(tknU8, mBuf) -TknU8 *tknU8; /* token U8 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknU8) - if (tknU8->pres) + if (tknUInt8->pres) { /* Value */ - CMCHKPK(oduUnpackUInt8, tknU8->val, mBuf); + CMCHKPK(oduPackUInt8, tknUInt8->val, mBuf); } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknU8->pres, mBuf); + CMCHKPK(oduPackUInt8, tknUInt8->pres, mBuf); return ROK; -} /* end of cmPkTknU8 */ +} /* end of cmPkTknUInt8 */ /* @@ -869,19 +757,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknS8 +S16 cmPkTknS8 ( TknS8 *tknS8, /* token S8 */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknS8(tknS8, mBuf) -TknS8 *tknS8; /* token S8 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknS8) if (tknS8->pres) { @@ -890,7 +771,7 @@ Buffer *mBuf; /* message buffer */ } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknS8->pres, mBuf); + CMCHKPK(oduPackUInt8, tknS8->pres, mBuf); return ROK; } /* end of cmPkTknS8 */ @@ -898,9 +779,9 @@ Buffer *mBuf; /* message buffer */ /* * - * Fun: cmPkTknU16 + * Fun: cmPkTknUInt16 * - * Desc: This function packs a token U16 + * Desc: This function packs a token uint16_t * * Ret: ROK - ok * @@ -910,38 +791,31 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknU16 +S16 cmPkTknUInt16 ( -TknU16 *tknU16, /* token U16 */ +TknUInt16 *tknUInt16, /* token uint16_t */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknU16(tknU16, mBuf) -TknU16 *tknU16; /* token U16 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknU16) - if (tknU16->pres) + if (tknUInt16->pres) { /* Value */ - CMCHKPK(oduUnpackUInt16, tknU16->val, mBuf); + CMCHKPK(oduPackUInt16, tknUInt16->val, mBuf); } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknU16->pres, mBuf); + CMCHKPK(oduPackUInt8, tknUInt16->pres, mBuf); return ROK; -} /* end of cmPkTknU16 */ +} /* end of cmPkTknUInt16 */ /* * - * Fun: cmPkTknU32 + * Fun: cmPkTknUInt32 * - * Desc: This function packs a token U32 + * Desc: This function packs a token uint32_t * * Ret: ROK - ok * @@ -951,31 +825,24 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknU32 +S16 cmPkTknUInt32 ( -TknU32 *tknU32, /* token U32 */ +TknUInt32 *tknUInt32, /* token uint32_t */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknU32(tknU32, mBuf) -TknU32 *tknU32; /* token U32 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknU32) - if (tknU32->pres) + if (tknUInt32->pres) { /* Value */ - CMCHKPK(oduUnpackUInt32, tknU32->val, mBuf); + CMCHKPK(oduPackUInt32, tknUInt32->val, mBuf); } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknU32->pres, mBuf); + CMCHKPK(oduPackUInt8, tknUInt32->pres, mBuf); return ROK; -} /* end of cmPkTknU32 */ +} /* end of cmPkTknUInt32 */ /* @@ -992,36 +859,29 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStr +S16 cmPkTknStr ( TknStr *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStr(tknStr, mBuf) -TknStr *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { Cntr i; /* counter */ - TRC2(cmPkTknStr) if (tknStr->pres) { /* Value */ for (i = 0; i < (S16) tknStr->len; i++) { - CMCHKPK(oduUnpackUInt8, tknStr->val[i], mBuf); + CMCHKPK(oduPackUInt8, tknStr->val[i], mBuf); } /* Length */ - CMCHKPK(oduUnpackUInt8, tknStr->len, mBuf); + CMCHKPK(oduPackUInt8, tknStr->len, mBuf); } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknStr->pres, mBuf); + CMCHKPK(oduPackUInt8, tknStr->pres, mBuf); return ROK; } /* end of cmPkTknStr */ @@ -1041,36 +901,29 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStrM +S16 cmPkTknStrM ( TknStrM *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStrM(tknStr, mBuf) -TknStrM *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { Cntr i; /* counter */ - TRC2(cmPkTknStrM) if(tknStr->pres) { /* Value */ for (i = 0; i < (S16) tknStr->len; i++) { - CMCHKPK(oduUnpackUInt8, tknStr->val[i], mBuf); + CMCHKPK(oduPackUInt8, tknStr->val[i], mBuf); } /* Length */ - CMCHKPK(oduUnpackUInt8, tknStr->len, mBuf); + CMCHKPK(oduPackUInt8, tknStr->len, mBuf); } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknStr->pres, mBuf); + CMCHKPK(oduPackUInt8, tknStr->pres, mBuf); return ROK; } /* end of cmPkTknStrM */ @@ -1090,36 +943,29 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStrS +S16 cmPkTknStrS ( TknStrS *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStrS(tknStr, mBuf) -TknStrS *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { Cntr i; /* counter */ - TRC2(cmPkTknStrS) if(tknStr->pres) { /* Value */ for (i = 0; i < (S16) tknStr->len; i++) { - CMCHKPK(oduUnpackUInt8, tknStr->val[i], mBuf); + CMCHKPK(oduPackUInt8, tknStr->val[i], mBuf); } /* Length */ - CMCHKPK(oduUnpackUInt8, tknStr->len, mBuf); + CMCHKPK(oduPackUInt8, tknStr->len, mBuf); } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknStr->pres, mBuf); + CMCHKPK(oduPackUInt8, tknStr->pres, mBuf); return ROK; } /* end of cmPkTknStrS */ @@ -1139,36 +985,29 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStrE +S16 cmPkTknStrE ( TknStrE *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStrE(tknStr, mBuf) -TknStrE *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { Cntr i; /* counter */ - TRC2(cmPkTknStrE) if(tknStr->pres) { /* Value */ for (i = 0; i < (S16) tknStr->len; i++) { - CMCHKPK(oduUnpackUInt8, tknStr->val[i], mBuf); + CMCHKPK(oduPackUInt8, tknStr->val[i], mBuf); } /* Length */ - CMCHKPK(oduUnpackUInt8, tknStr->len, mBuf); + CMCHKPK(oduPackUInt8, tknStr->len, mBuf); } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknStr->pres, mBuf); + CMCHKPK(oduPackUInt8, tknStr->pres, mBuf); return ROK; } /* end of cmPkTknStrE */ @@ -1190,25 +1029,18 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkPnNodeId +S16 cmPkPnNodeId ( PnNodeId *src, /* source PNNI Node Id */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkPnNodeId (src, mBuf) -PnNodeId *src; /* source PNNI Node Id */ -Buffer *mBuf; /* message buffer */ -#endif { S16 i; - TRC3(cmPkPnNodeId); for (i = PN_NODEID_LEN - 1; i >= 0; i--) { - CMCHKPK(oduUnpackUInt8, src->id[i], mBuf); + CMCHKPK(oduPackUInt8, src->id[i], mBuf); } return ROK; @@ -1231,19 +1063,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStr4 +S16 cmPkTknStr4 ( TknStr4 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStr4(tknStr, mBuf) -TknStr4 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknStr4) CMPKTKNSTR(tknStr, mBuf); @@ -1267,19 +1092,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStr12 +S16 cmPkTknStr12 ( TknStr12 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStr12(tknStr, mBuf) -TknStr12 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknStr12) CMPKTKNSTR(tknStr, mBuf); @@ -1302,19 +1120,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStr32 +S16 cmPkTknStr32 ( TknStr32 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStr32(tknStr, mBuf) -TknStr32 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknStr32) CMPKTKNSTR(tknStr, mBuf); @@ -1337,19 +1148,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStr64 +S16 cmPkTknStr64 ( TknStr64 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStr64(tknStr, mBuf) -TknStr64 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknStr64) CMPKTKNSTR(tknStr, mBuf); @@ -1372,19 +1176,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStr132 +S16 cmPkTknStr132 ( TknStr132 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStr132(tknStr, mBuf) -TknStr132 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknStr132) CMPKTKNSTR(tknStr, mBuf); @@ -1407,19 +1204,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknStr256 +S16 cmPkTknStr256 ( TknStr256 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknStr256(tknStr, mBuf) -TknStr256 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknStr256) CMPKTKNSTR(tknStr, mBuf); @@ -1442,40 +1232,33 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknOid +S16 cmPkTknOid ( TknOid *tknOid, /* Object Identifier token */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknOid(tknOid, mBuf) -TknOid *tknOid; /* Object Identifier token */ -Buffer *mBuf; /* message buffer */ -#endif { - U16 i; + uint16_t i; - TRC2(cmPkTknOid) if (tknOid->pres == TRUE) { /* Pack the value */ - for (i = 0; i < (U16)tknOid->len; i++) + for (i = 0; i < (uint16_t)tknOid->len; i++) { - /* cm_gen_c_001.main_33: changes for TknOid value from U16 to U32 - * with compilation flag TKNOID_U16 */ -#ifndef TKNOID_U16 - CMCHKPK(oduUnpackUInt32, tknOid->val[i], mBuf); + /* cm_gen_c_001.main_33: changes for TknOid value from uint16_t to uint32_t + * with compilation flag TKNOID_UINT16 */ +#ifndef TKNOID_UINT16 + CMCHKPK(oduPackUInt32, tknOid->val[i], mBuf); #else - CMCHKPK(oduUnpackUInt16, tknOid->val[i], mBuf); -#endif /* !TKNOID_U16 */ + CMCHKPK(oduPackUInt16, tknOid->val[i], mBuf); +#endif /* !TKNOID_UINT16 */ } /* Pack the length */ - CMCHKPK(oduUnpackUInt8, tknOid->len, mBuf); + CMCHKPK(oduPackUInt8, tknOid->len, mBuf); } /* Pack the token header */ - CMCHKPK(oduUnpackUInt8, tknOid->pres, mBuf); + CMCHKPK(oduPackUInt8, tknOid->pres, mBuf); return ROK; } /* end of cmPkTknOid */ @@ -1495,19 +1278,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknS32 +S16 cmPkTknS32 ( TknS32 *tknS32, /* token S32 */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknS32(tknS32, mBuf) -TknS32 *tknS32; /* token S32 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknS32) if (tknS32->pres) { @@ -1516,7 +1292,7 @@ Buffer *mBuf; /* message buffer */ } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknS32->pres, mBuf); + CMCHKPK(oduPackUInt8, tknS32->pres, mBuf); return ROK; } /* end of cmPkTknS32 */ @@ -1536,19 +1312,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkHeader +S16 cmPkHeader ( Header *header, /* header */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkHeader(header, mBuf) -Header *header; /* header */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkHeader) #ifdef LMINT3 CMCHKPK(cmPkMemoryId, &header->response.mem, mBuf); @@ -1559,10 +1328,10 @@ Buffer *mBuf; /* message buffer */ #endif /* LMINT3 */ CMCHKPK(cmPkElmntId, &header->elmId, mBuf); CMCHKPK(cmPkEntityId, &header->entId, mBuf); - CMCHKPK(oduUnpackUInt16, header->seqNmb, mBuf); - CMCHKPK(oduUnpackUInt8, header->version, mBuf); - CMCHKPK(oduUnpackUInt8, header->msgType, mBuf); - CMCHKPK(oduUnpackUInt16, header->msgLen, mBuf); + CMCHKPK(oduPackUInt16, header->seqNmb, mBuf); + CMCHKPK(oduPackUInt8, header->version, mBuf); + CMCHKPK(oduPackUInt8, header->msgType, mBuf); + CMCHKPK(oduPackUInt16, header->msgLen, mBuf); return ROK; } /* end of cmPkHeader */ @@ -1582,22 +1351,15 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkCmStatus +S16 cmPkCmStatus ( CmStatus *sta, /* status structure */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkCmStatus(sta, mBuf) -CmStatus *sta; /* status structure */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkCmStatus) - CMCHKPK(oduUnpackUInt16, sta->reason, mBuf); - CMCHKPK(oduUnpackUInt16, sta->status, mBuf); + CMCHKPK(oduPackUInt16, sta->reason, mBuf); + CMCHKPK(oduPackUInt16, sta->status, mBuf); return ROK; } /* end of cmPkCmStatus */ @@ -1617,23 +1379,16 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkCmAlarm +S16 cmPkCmAlarm ( CmAlarm *alarm, /* alarm structure */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkCmAlarm(alarm, mBuf) -CmAlarm *alarm; /* alarm structure */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkCmAlarm) - CMCHKPK(oduUnpackUInt16, alarm->cause, mBuf); - CMCHKPK(oduUnpackUInt16, alarm->event, mBuf); - CMCHKPK(oduUnpackUInt16, alarm->category, mBuf); + CMCHKPK(oduPackUInt16, alarm->cause, mBuf); + CMCHKPK(oduPackUInt16, alarm->event, mBuf); + CMCHKPK(oduPackUInt16, alarm->category, mBuf); CMCHKPK(cmPkDateTime, &alarm->dt, mBuf); return ROK; @@ -1654,19 +1409,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkSmCfg +S16 cmPkSmCfg ( SmCfg *smCfg, /* stack manager */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkSmCfg(smCfg, mBuf) -SmCfg *smCfg; /* stack manager */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkSmCfg) CMCHKPK(cmPkSelector, smCfg->selector, mBuf); CMCHKPK(cmPkRoute, smCfg->route, mBuf); @@ -1694,21 +1442,14 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTmrCfg +S16 cmPkTmrCfg ( TmrCfg *tmrCfg, /* timer configuration */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTmrCfg(tmrCfg, mBuf) -TmrCfg *tmrCfg; /* timer configuration */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTmrCfg) - CMCHKPK(oduUnpackUInt16, tmrCfg->val, mBuf); + CMCHKPK(oduPackUInt16, tmrCfg->val, mBuf); CMCHKPK(oduPackBool, tmrCfg->enb, mBuf); return ROK; @@ -1729,19 +1470,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkTknBuf +S16 cmPkTknBuf ( TknBuf *tknBuf, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkTknBuf(tknBuf, mBuf) -TknBuf *tknBuf; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkTknBuf) if(tknBuf->pres) { @@ -1757,7 +1491,7 @@ Buffer *mBuf; /* message buffer */ } /* Token Header */ - CMCHKPK(oduUnpackUInt8, tknBuf->pres, mBuf); + CMCHKPK(oduPackUInt8, tknBuf->pres, mBuf); return ROK; } /* end of cmPkTknBuf */ @@ -1777,19 +1511,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmPkIntf +S16 cmPkIntf ( CmIntf *intf, /* interface info */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmPkIntf(intf, mBuf) -CmIntf *intf; /* interface info */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmPkIntf) CMCHKPK(cmPkIntfId, intf->intfId, mBuf); CMCHKPK(cmPkIntfVer, intf->intfVer, mBuf); @@ -1818,31 +1545,24 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkDateTime +S16 cmUnpkDateTime ( DateTime *dateTime, /* date/time structure */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkDateTime(dateTime, mBuf) -DateTime *dateTime; /* date/time structure */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpDateTime) - CMCHKUNPK(oduPackUInt8, &dateTime->month, mBuf); - CMCHKUNPK(oduPackUInt8, &dateTime->day, mBuf); - CMCHKUNPK(oduPackUInt8, &dateTime->year, mBuf); - CMCHKUNPK(oduPackUInt8, &dateTime->hour, mBuf); - CMCHKUNPK(oduPackUInt8, &dateTime->min, mBuf); - CMCHKUNPK(oduPackUInt8, &dateTime->sec, mBuf); - CMCHKUNPK(oduPackUInt8, &dateTime->tenths, mBuf); + CMCHKUNPK(oduUnpackUInt8, &dateTime->month, mBuf); + CMCHKUNPK(oduUnpackUInt8, &dateTime->day, mBuf); + CMCHKUNPK(oduUnpackUInt8, &dateTime->year, mBuf); + CMCHKUNPK(oduUnpackUInt8, &dateTime->hour, mBuf); + CMCHKUNPK(oduUnpackUInt8, &dateTime->min, mBuf); + CMCHKUNPK(oduUnpackUInt8, &dateTime->sec, mBuf); + CMCHKUNPK(oduUnpackUInt8, &dateTime->tenths, mBuf); /*-- added for micro seconds --*/ #ifdef SS_DATETIME_USEC - CMCHKUNPK(oduPackUInt32, &dateTime->usec, mBuf); + CMCHKUNPK(oduUnpackUInt32, &dateTime->usec, mBuf); #endif /*-- SS_DATETIME_USEC --*/ return ROK; @@ -1863,25 +1583,18 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkDuration +S16 cmUnpkDuration ( Duration *duration, /* duration structure */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkDuration(duration, mBuf) -Duration *duration; /* duration structure */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpDuration) - CMCHKUNPK(oduPackUInt8, &duration->days, mBuf); - CMCHKUNPK(oduPackUInt8, &duration->hours, mBuf); - CMCHKUNPK(oduPackUInt8, &duration->mins, mBuf); - CMCHKUNPK(oduPackUInt8, &duration->secs, mBuf); - CMCHKUNPK(oduPackUInt8, &duration->tenths, mBuf); + CMCHKUNPK(oduUnpackUInt8, &duration->days, mBuf); + CMCHKUNPK(oduUnpackUInt8, &duration->hours, mBuf); + CMCHKUNPK(oduUnpackUInt8, &duration->mins, mBuf); + CMCHKUNPK(oduUnpackUInt8, &duration->secs, mBuf); + CMCHKUNPK(oduUnpackUInt8, &duration->tenths, mBuf); return ROK; } /* end of cmUnpkDuration */ @@ -1900,28 +1613,21 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 oduUnpackPointer +S16 oduUnpackPointer ( PTR *ptr, /* duration structure */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 oduUnpackPointer(ptr, mBuf) -PTR *ptr; /* duration structure */ -Buffer *mBuf; /* message buffer */ -#endif { - U16 tmp16; /* temporary value */ - U32 tmp32; /* temporary value */ - Data unpkArray[PTRSIZE]; /* unpacking array */ - S16 ret; /* return code */ + uint16_t tmp16 =0; /* temporary value */ + uint32_t tmp32 =0; /* temporary value */ + Data unpkArray[PTRSIZE]; /* unpacking array */ + S16 ret =ROK; /* return code */ #if (defined(ALPHA) || defined(BIT_64)) - U64 tmp64; + uint64_t tmp64 =0; #endif - TRC2(oduUnpackPointer) switch (PTRSIZE) { @@ -1932,11 +1638,11 @@ Buffer *mBuf; /* message buffer */ tmp16 = 0; #ifndef FCSPKINT /* backward compatibility, packing order */ - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[1]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[0]); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[1]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[0]); #else /* forward compatibility, packing order */ - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[0]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[1]); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[0]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[1]); #endif *ptr = tmp16; break; @@ -1949,19 +1655,19 @@ Buffer *mBuf; /* message buffer */ tmp16 = 0; tmp32 = 0; #ifndef FCSPKINT /* backward compatibility, packing order */ - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[3]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[2]); - tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16); - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[1]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[0]); - tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[3]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[2]); + tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[1]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[0]); + tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16); #else /* forward compatibility, packing order */ - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[0]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[1]); - tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16); - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[2]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[3]); - tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[0]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[1]); + tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[2]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[3]); + tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16); #endif *ptr = tmp32; break; @@ -1976,41 +1682,41 @@ Buffer *mBuf; /* message buffer */ tmp32 = 0; tmp64 = 0; #ifndef FCSPKINT /* backward compatibility, packing order */ - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[7]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[6]); - tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16); - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[5]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[4]); - tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16); - tmp64 = (U64) PutHi32Bit(tmp64, tmp32); - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[3]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[2]); - tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16); - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[1]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[0]); - tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16); - tmp64 = (U64) PutLo32Bit(tmp64, tmp32); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[7]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[6]); + tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[5]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[4]); + tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16); + tmp64 = (uint64_t) PutHi32Bit(tmp64, tmp32); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[3]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[2]); + tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[1]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[0]); + tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16); + tmp64 = (uint64_t) PutLo32Bit(tmp64, tmp32); #else /* forward compatibility, packing order */ - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[0]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[1]); - tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16); - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[2]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[3]); - tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16); - tmp64 = (U64) PutHi32Bit(tmp64, tmp32); - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[4]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[5]); - tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16); - tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[6]); - tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[7]); - tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16); - tmp64 = (U64) PutLo32Bit(tmp64, tmp32); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[0]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[1]); + tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[2]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[3]); + tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16); + tmp64 = (uint64_t) PutHi32Bit(tmp64, tmp32); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[4]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[5]); + tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16); + tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[6]); + tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[7]); + tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16); + tmp64 = (uint64_t) PutLo32Bit(tmp64, tmp32); #endif *ptr = tmp64; break; #endif default: - /* no support for U64 */ + /* no support for uint64_t */ ret = RFAILED; } @@ -2032,19 +1738,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkEntityId +S16 cmUnpkEntityId ( EntityId *entityId, /* entity id */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkEntityId(entityId, mBuf) -EntityId *entityId; /* entity id */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkEntityId) CMCHKUNPK(cmUnpkEnt, &entityId->ent, mBuf); CMCHKUNPK(cmUnpkInst, &entityId->inst, mBuf); @@ -2067,19 +1766,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkElmntId +S16 cmUnpkElmntId ( ElmntId *elmntId, /* element id */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkElmntId(elmntId, mBuf) -ElmntId *elmntId; /* element id */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkElmntId) CMCHKUNPK(cmUnpkElmnt, &elmntId->elmnt, mBuf); CMCHKUNPK(cmUnpkElmntInst1, &elmntId->elmntInst1, mBuf); @@ -2104,19 +1796,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkMemoryId +S16 cmUnpkMemoryId ( MemoryId *memoryId, /* memoryId */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkMemoryId(memoryId, mBuf) -MemoryId *memoryId; /* memoryId */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkMemoryId) CMCHKUNPK(cmUnpkRegion, &memoryId->region, mBuf); CMCHKUNPK(cmUnpkPool, &memoryId->pool, mBuf); @@ -2139,22 +1824,15 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkSystemId +S16 cmUnpkSystemId ( SystemId *systemId, /* system id */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkSystemId(systemId, mBuf) -SystemId *systemId; /* system id */ -Buffer *mBuf; /* message buffer */ -#endif { S16 i; /* loop counter */ MsgLen len; - TRC2(cmUnpkSystemId) CMCHKUNPK(SUnpkS16, &systemId->mVer, mBuf); CMCHKUNPK(SUnpkS16, &systemId->mRev, mBuf); @@ -2188,32 +1866,25 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkProtAddr +S16 cmUnpkProtAddr ( ProtAddr *pAddr, /* protocol address */ Buffer *mBuf /* buffer */ ) -#else -PUBLIC S16 cmUnpkProtAddr(pAddr, mBuf) -ProtAddr *pAddr; /* protocol address table */ -Buffer *mBuf; /* buffer */ -#endif { - U8 j; /* Index */ + uint8_t j; /* Index */ - TRC3(cmUnpkProtAddr) - CMCHKUNPK(oduPackUInt16, &(pAddr->protType), mBuf); - CMCHKUNPK(oduPackUInt8, &(pAddr->len), mBuf); - CMCHKUNPK(oduPackUInt8, &(pAddr->preLen), mBuf); + CMCHKUNPK(oduUnpackUInt16, &(pAddr->protType), mBuf); + CMCHKUNPK(oduUnpackUInt8, &(pAddr->len), mBuf); + CMCHKUNPK(oduUnpackUInt8, &(pAddr->preLen), mBuf); for (j =0; j < pAddr->len; j++) - CMCHKUNPK(oduPackUInt8, &pAddr->address[j], mBuf); + CMCHKUNPK(oduUnpackUInt8, &pAddr->address[j], mBuf); #ifdef CM_ARI2 CMCHKUNPK(oduUnpackBool, &(pAddr->autoSysIdPres), mBuf); - CMCHKUNPK(oduPackUInt32, &(pAddr->autoSysId), mBuf); + CMCHKUNPK(oduUnpackUInt32, &(pAddr->autoSysId), mBuf); #endif /* CM_ARI2 */ return ROK; @@ -2235,40 +1906,33 @@ Buffer *mBuf; /* buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkProtAddrTbl +S16 cmUnpkProtAddrTbl ( ProtAddrTbl *protAddr, /* protocol address table */ Buffer *mBuf /* buffer */ ) -#else -PUBLIC S16 cmUnpkProtAddrTbl(protAddr, mBuf) -ProtAddrTbl *protAddr; /* protocol address table */ -Buffer *mBuf; /* buffer */ -#endif { - U8 i; /* index */ - U8 j; /* Index */ + uint8_t i; /* index */ + uint8_t j; /* Index */ ProtAddr *pAddr; /* Protocol Address */ - TRC3(cmUnpkProtAddrTbl) - CMCHKUNPK(oduPackUInt8, &protAddr->count, mBuf); + CMCHKUNPK(oduUnpackUInt8, &protAddr->count, mBuf); for (i = 0; i < protAddr->count; i++) { pAddr = &(protAddr->addr[i]); - CMCHKUNPK(oduPackUInt16, &(pAddr->protType), mBuf); - CMCHKUNPK(oduPackUInt8, &(pAddr->len), mBuf); - CMCHKUNPK(oduPackUInt8, &(pAddr->preLen), mBuf); + CMCHKUNPK(oduUnpackUInt16, &(pAddr->protType), mBuf); + CMCHKUNPK(oduUnpackUInt8, &(pAddr->len), mBuf); + CMCHKUNPK(oduUnpackUInt8, &(pAddr->preLen), mBuf); for (j =0; j < pAddr->len; j++) - CMCHKUNPK(oduPackUInt8, &pAddr->address[j], mBuf); + CMCHKUNPK(oduUnpackUInt8, &pAddr->address[j], mBuf); #ifdef CM_ARI2 CMCHKUNPK(oduUnpackBool, &(pAddr->autoSysIdPres), mBuf); - CMCHKUNPK(oduPackUInt32, &(pAddr->autoSysId), mBuf); + CMCHKUNPK(oduUnpackUInt32, &(pAddr->autoSysId), mBuf); #endif /* CM_ARI2 */ } return ROK; @@ -2289,30 +1953,23 @@ Buffer *mBuf; /* buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkAddrs +S16 cmUnpkAddrs ( Addrs *addrs, /* address */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkAddrs(addrs, mBuf) -Addrs *addrs; /* address */ -Buffer *mBuf; /* message buffer */ -#endif { - U8 i; /* loop counter */ + uint8_t i; /* loop counter */ - TRC2(cmUnpAddrs) - CMCHKUNPK(oduPackUInt8, &addrs->length, mBuf); + CMCHKUNPK(oduUnpackUInt8, &addrs->length, mBuf); if (addrs->length > ADRLEN) return RFAILED; for(i = 0; i < addrs->length; i++) { - CMCHKUNPK(oduPackUInt8, &addrs->strg[i], mBuf); + CMCHKUNPK(oduUnpackUInt8, &addrs->strg[i], mBuf); } return ROK; @@ -2332,30 +1989,23 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkShrtAddrs +S16 cmUnpkShrtAddrs ( ShrtAddrs *addrs, /* address */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkShrtAddrs(addrs, mBuf) -ShrtAddrs *addrs; /* address */ -Buffer *mBuf; /* message buffer */ -#endif { - U8 i; /* loop counter */ + uint8_t i; /* loop counter */ - TRC2(cmUnpShrtAddrs) - CMCHKUNPK(oduPackUInt8, &addrs->length, mBuf); + CMCHKUNPK(oduUnpackUInt8, &addrs->length, mBuf); if (addrs->length > SHRTADRLEN) return RFAILED; for(i = 0; i < addrs->length; i++) { - CMCHKUNPK(oduPackUInt8, &addrs->strg[i], mBuf); + CMCHKUNPK(oduUnpackUInt8, &addrs->strg[i], mBuf); } return ROK; } /* end of cmUnpkShrtAddrs */ @@ -2375,26 +2025,19 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkAddrMask +S16 cmUnpkAddrMask ( -U8 *mask, /* pointer to address mask */ +uint8_t *mask, /* pointer to address mask */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkAddrMask(mask, mBuf) -U8 *mask; /* pointer to address mask */ -Buffer *mBuf; /* message buffer */ -#endif { S16 i; /* counter */ - TRC2(cmUnpAddrMask) /* unpack address mask */ for (i = 0; i< ADRLEN; i++) { - CMCHKUNPK(oduPackUInt8, &mask[i], mBuf); + CMCHKUNPK(oduUnpackUInt8, &mask[i], mBuf); } return ROK; } /* end of cmUnpkAddrMask */ @@ -2414,28 +2057,21 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkBndCfg +S16 cmUnpkBndCfg ( BndCfg *bndCfg, /* bndCfg */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkBndCfg(bndCfg, mBuf) -BndCfg *bndCfg; /* bndCfg */ -Buffer *mBuf; /* message buffer */ -#endif { S16 i; /* loop counter */ - TRC2(cmUnpBndCfg) for (i = 0; bndCfg->usrId[i]; i++); CMCHKUNPK(cmUnpkTxt, bndCfg->usrId+i, mBuf); - CMCHKUNPK(oduPackUInt8, &bndCfg->bufOwnshp, mBuf); - CMCHKUNPK(oduPackUInt8, &bndCfg->flcTyp, mBuf); - CMCHKUNPK(oduPackUInt8, &bndCfg->wdw, mBuf); + CMCHKUNPK(oduUnpackUInt8, &bndCfg->bufOwnshp, mBuf); + CMCHKUNPK(oduUnpackUInt8, &bndCfg->flcTyp, mBuf); + CMCHKUNPK(oduUnpackUInt8, &bndCfg->wdw, mBuf); CMCHKUNPK(cmUnpkEnt, &bndCfg->ent, mBuf); CMCHKUNPK(cmUnpkInst, &bndCfg->inst, mBuf); CMCHKUNPK(cmUnpkRegion, &bndCfg->region, mBuf); @@ -2462,19 +2098,12 @@ Buffer *mBuf; /* message buffer */ * File: cm_gen.c * */ -#ifdef ANSI -PUBLIC S16 cmUnpkPst +S16 cmUnpkPst ( Pst *pst, Buffer *mBuf ) -#else -PUBLIC S16 cmUnpkPst(pst, mBuf) -Pst *pst; -Buffer *mBuf; -#endif { - TRC2(cmUnpkPst) #ifdef TDS_ROLL_UPGRADE_SUPPORT CMCHKUNPK(cmUnpkIntfVer, &pst->intfVer, mBuf); @@ -2509,19 +2138,12 @@ Buffer *mBuf; * */ -#ifdef ANSI -PUBLIC S16 cmUnpkElmtHdr +S16 cmUnpkElmtHdr ( ElmtHdr *m, /* element header */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkElmtHdr(m, mBuf) -ElmtHdr *m; /* element header */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpElmtHdr) /* Present */ CMCHKUNPK(oduUnpackBool, &m->pres , mBuf); @@ -2530,12 +2152,12 @@ Buffer *mBuf; /* message buffer */ /* Unpack action indicator field */ if (m->pres) { - CMCHKUNPK(oduPackUInt8, &m->actnInd, mBuf); + CMCHKUNPK(oduUnpackUInt8, &m->actnInd, mBuf); } #endif #if (LCAMT || ATM_BISUP) - CMCHKUNPK(oduPackUInt16, &m->compInd, mBuf); + CMCHKUNPK(oduUnpackUInt16, &m->compInd, mBuf); #endif /* LCAMT || ATM_BISUP */ return ROK; @@ -2544,9 +2166,9 @@ Buffer *mBuf; /* message buffer */ /* * -* Fun: cmUnpkTknU8 +* Fun: cmUnpkTknUInt8 * -* Desc: This function unpacks a token U8 +* Desc: This function unpacks a token uint8_t * * Ret: ROK - ok * @@ -2556,31 +2178,24 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknU8 +S16 cmUnpkTknUInt8 ( -TknU8 *tknU8, /* token U8 */ +TknUInt8 *tknUInt8, /* token uint8_t */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknU8(tknU8, mBuf) -TknU8 *tknU8; /* token U8 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpTknU8) /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknU8->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknUInt8->pres, mBuf); - if (tknU8->pres) + if (tknUInt8->pres) { /* Value */ - CMCHKUNPK(oduPackUInt8, &tknU8->val, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknUInt8->val, mBuf); } return ROK; -} /* end of cmUnpkTknU8 */ +} /* end of cmUnpkTknUInt8 */ /* @@ -2597,22 +2212,15 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknS8 +S16 cmUnpkTknS8 ( TknS8 *tknS8, /* token S8 */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknS8(tknS8, mBuf) -TknS8 *tknS8; /* token S8 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpTknS8) /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknS8->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknS8->pres, mBuf); if (tknS8->pres) { @@ -2626,9 +2234,9 @@ Buffer *mBuf; /* message buffer */ /* * -* Fun: cmUnpkTknU16 +* Fun: cmUnpkTknUInt16 * -* Desc: This function unpacks a token U16 +* Desc: This function unpacks a token uint16_t * * Ret: ROK - ok * @@ -2638,38 +2246,31 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknU16 +S16 cmUnpkTknUInt16 ( -TknU16 *tknU16, /* token U16 */ +TknUInt16 *tknUInt16, /* token uint16_t */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknU16(tknU16, mBuf) -TknU16 *tknU16; /* token U16 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpTknU16) /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknU16->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknUInt16->pres, mBuf); - if (tknU16->pres) + if (tknUInt16->pres) { /* Value */ - CMCHKUNPK(oduPackUInt16, &tknU16->val, mBuf); + CMCHKUNPK(oduUnpackUInt16, &tknUInt16->val, mBuf); } return ROK; -} /* end of cmUnpkTknU16 */ +} /* end of cmUnpkTknUInt16 */ /* * -* Fun: cmUnpkTknU32 +* Fun: cmUnpkTknUInt32 * -* Desc: This function unpacks a token U32 +* Desc: This function unpacks a token uint32_t * * Ret: ROK - ok * @@ -2679,31 +2280,24 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknU32 +S16 cmUnpkTknUInt32 ( -TknU32 *tknU32, /* token U32 */ +TknUInt32 *tknUInt32, /* token uint32_t */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknU32(tknU32, mBuf) -TknU32 *tknU32; /* token U32 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpTknU32) /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknU32->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknUInt32->pres, mBuf); - if (tknU32->pres) + if (tknUInt32->pres) { /* Value */ - CMCHKUNPK(oduPackUInt32, &tknU32->val, mBuf); + CMCHKUNPK(oduUnpackUInt32, &tknUInt32->val, mBuf); } return ROK; -} /* end of cmUnpkTknU32 */ +} /* end of cmUnpkTknUInt32 */ /* * @@ -2719,34 +2313,27 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStr +S16 cmUnpkTknStr ( TknStr *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStr(tknStr, mBuf) -TknStr *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { Cntr i; /* counter */ - TRC2(cmUnpTknStr) /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknStr->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->pres, mBuf); if (tknStr->pres) { /* Length */ - CMCHKUNPK(oduPackUInt8, &tknStr->len, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->len, mBuf); /* Value */ for (i = (tknStr->len - 1); i >= 0; i--) { - CMCHKUNPK(oduPackUInt8, &tknStr->val[i], mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->val[i], mBuf); } } else @@ -2769,34 +2356,27 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStrM +S16 cmUnpkTknStrM ( TknStrM *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStrM(tknStr, mBuf) -TknStrM *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { Cntr i; /* counter */ - TRC2(cmUnpTknStrM) /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknStr->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->pres, mBuf); if (tknStr->pres) { /* Length */ - CMCHKUNPK(oduPackUInt8, &tknStr->len, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->len, mBuf); /* Value */ for (i = (tknStr->len - 1); i >= 0; i--) { - CMCHKUNPK(oduPackUInt8, &tknStr->val[i], mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->val[i], mBuf); } } else @@ -2820,34 +2400,27 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStrS +S16 cmUnpkTknStrS ( TknStrS *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStrS(tknStr, mBuf) -TknStrS *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { Cntr i; /* counter */ - TRC2(cmUnpTknStrS) /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknStr->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->pres, mBuf); if (tknStr->pres) { /* Length */ - CMCHKUNPK(oduPackUInt8, &tknStr->len, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->len, mBuf); /* Value */ for (i = (tknStr->len - 1); i >= 0; i--) { - CMCHKUNPK(oduPackUInt8, &tknStr->val[i], mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->val[i], mBuf); } } else @@ -2871,34 +2444,27 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStrE +S16 cmUnpkTknStrE ( TknStrE *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStrE(tknStr, mBuf) -TknStrE *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { Cntr i; /* counter */ - TRC2(cmUnpTknStrE) /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknStr->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->pres, mBuf); if (tknStr->pres) { /* Length */ - CMCHKUNPK(oduPackUInt8, &tknStr->len, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->len, mBuf); /* Value */ for (i = (tknStr->len - 1); i >= 0; i--) { - CMCHKUNPK(oduPackUInt8, &tknStr->val[i], mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknStr->val[i], mBuf); } } else @@ -2924,25 +2490,18 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkPnNodeId +S16 cmUnpkPnNodeId ( PnNodeId *dst, /* source PNNI Node Id */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkPnNodeId (dst, mBuf) -PnNodeId *dst; /* source PNNI Node Id */ -Buffer *mBuf; /* message buffer */ -#endif { S16 i; - TRC3(cmUnpkPnNodeId); for (i = 0; i < PN_NODEID_LEN; i++) { - CMCHKUNPK(oduPackUInt8, &dst->id[i], mBuf); + CMCHKUNPK(oduUnpackUInt8, &dst->id[i], mBuf); } return ROK; @@ -2965,19 +2524,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStr4 +S16 cmUnpkTknStr4 ( TknStr4 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStr4(tknStr, mBuf) -TknStr4 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkTknStr4) CMUNPKTKNSTR(tknStr, mBuf); @@ -3001,19 +2553,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStr12 +S16 cmUnpkTknStr12 ( TknStr12 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStr12(tknStr, mBuf) -TknStr12 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkTknStr12) CMUNPKTKNSTR(tknStr, mBuf); @@ -3036,19 +2581,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStr32 +S16 cmUnpkTknStr32 ( TknStr32 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStr32(tknStr, mBuf) -TknStr32 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkTknStr32) CMUNPKTKNSTR(tknStr, mBuf); @@ -3071,19 +2609,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStr64 +S16 cmUnpkTknStr64 ( TknStr64 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStr64(tknStr, mBuf) -TknStr64 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkTknStr64) CMUNPKTKNSTR(tknStr, mBuf); @@ -3106,19 +2637,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStr132 +S16 cmUnpkTknStr132 ( TknStr132 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStr132(tknStr, mBuf) -TknStr132 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkTknStr132) CMUNPKTKNSTR(tknStr, mBuf); @@ -3141,19 +2665,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknStr256 +S16 cmUnpkTknStr256 ( TknStr256 *tknStr, /* token string */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknStr256(tknStr, mBuf) -TknStr256 *tknStr; /* token string */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkTknStr256) CMUNPKTKNSTR(tknStr, mBuf); @@ -3176,40 +2693,33 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknOid +S16 cmUnpkTknOid ( TknOid *tknOid, /* Object Identifier token */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknOid(tknOid, mBuf) -TknOid *tknOid; /* Object Identifier token */ -Buffer *mBuf; /* message buffer */ -#endif { - U16 i; + uint16_t i; - TRC2(cmUnpkTknOid) /* Unpack the token header */ - CMCHKUNPK(oduPackUInt8, &tknOid->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknOid->pres, mBuf); if (tknOid->pres == TRUE) { /* Unpack the length */ - CMCHKUNPK(oduPackUInt8, &tknOid->len, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknOid->len, mBuf); /* Pack the value */ - for (i = 1; i <= (U16)tknOid->len; i++) + for (i = 1; i <= (uint16_t)tknOid->len; i++) { - /* cm_gen_c_001.main_33: changes for TknOid value from U16 to U32 - * with compilation flag TKNOID_U16 */ -#ifndef TKNOID_U16 - CMCHKUNPK(oduPackUInt32, &tknOid->val[tknOid->len - i], mBuf); + /* cm_gen_c_001.main_33: changes for TknOid value from uint16_t to uint32_t + * with compilation flag TKNOID_UINT16 */ +#ifndef TKNOID_UINT16 + CMCHKUNPK(oduUnpackUInt32, &tknOid->val[tknOid->len - i], mBuf); #else - CMCHKUNPK(oduPackUInt16, &tknOid->val[tknOid->len - i], mBuf); -#endif /* !TKNOID_U16 */ + CMCHKUNPK(oduUnpackUInt16, &tknOid->val[tknOid->len - i], mBuf); +#endif /* !TKNOID_UINT16 */ } } @@ -3231,22 +2741,15 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknS32 +S16 cmUnpkTknS32 ( TknS32 *tknS32, /* token S32 */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknS32(tknS32, mBuf) -TknS32 *tknS32; /* token S32 */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpTknS32) /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknS32->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknS32->pres, mBuf); if (tknS32->pres) { @@ -3272,24 +2775,17 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkHeader +S16 cmUnpkHeader ( Header *header, /* header structure */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkHeader(header, mBuf) -Header *header; /* header structure */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpHeader) - CMCHKUNPK(oduPackUInt16, &header->msgLen, mBuf); - CMCHKUNPK(oduPackUInt8, &header->msgType, mBuf); - CMCHKUNPK(oduPackUInt8, &header->version, mBuf); - CMCHKUNPK(oduPackUInt16, &header->seqNmb, mBuf); + CMCHKUNPK(oduUnpackUInt16, &header->msgLen, mBuf); + CMCHKUNPK(oduUnpackUInt8, &header->msgType, mBuf); + CMCHKUNPK(oduUnpackUInt8, &header->version, mBuf); + CMCHKUNPK(oduUnpackUInt16, &header->seqNmb, mBuf); CMCHKUNPK(cmUnpkEntityId, &header->entId, mBuf); CMCHKUNPK(cmUnpkElmntId, &header->elmId, mBuf); #ifdef LMINT3 @@ -3318,22 +2814,15 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkCmStatus +S16 cmUnpkCmStatus ( CmStatus *sta, /* status structure */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkCmStatus(sta, mBuf) -CmStatus *sta; /* status structure */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkCmStatus) - CMCHKUNPK(oduPackUInt16, &sta->status, mBuf); - CMCHKUNPK(oduPackUInt16, &sta->reason, mBuf); + CMCHKUNPK(oduUnpackUInt16, &sta->status, mBuf); + CMCHKUNPK(oduUnpackUInt16, &sta->reason, mBuf); return ROK; } /* end of cmUnpkCmStatus */ @@ -3353,24 +2842,17 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkCmAlarm +S16 cmUnpkCmAlarm ( CmAlarm *alarm, /* alarm structure */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkCmAlarm(alarm, mBuf) -CmAlarm *alarm; /* alarm structure */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkCmAlarm) CMCHKUNPK(cmUnpkDateTime, &alarm->dt, mBuf); - CMCHKUNPK(oduPackUInt16, &alarm->category, mBuf); - CMCHKUNPK(oduPackUInt16, &alarm->event, mBuf); - CMCHKUNPK(oduPackUInt16, &alarm->cause, mBuf); + CMCHKUNPK(oduUnpackUInt16, &alarm->category, mBuf); + CMCHKUNPK(oduUnpackUInt16, &alarm->event, mBuf); + CMCHKUNPK(oduUnpackUInt16, &alarm->cause, mBuf); return ROK; } /* end of cmUnpkCmAlarm */ @@ -3390,19 +2872,12 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkSmCfg +S16 cmUnpkSmCfg ( SmCfg *smCfg, /* stack manager */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkSmCfg(smCfg, mBuf) -SmCfg *smCfg; /* stack manager */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpSmCfg) CMCHKUNPK(cmUnpkEnt, &smCfg->ent, mBuf); CMCHKUNPK(cmUnpkInst, &smCfg->inst, mBuf); @@ -3430,22 +2905,15 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTmrCfg +S16 cmUnpkTmrCfg ( TmrCfg *tmrCfg, /* timer configuration */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTmrCfg(tmrCfg, mBuf) -TmrCfg *tmrCfg; /* timer configuration */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpTmrCfg) CMCHKUNPK(oduUnpackBool, &tmrCfg->enb, mBuf); - CMCHKUNPK(oduPackUInt16, &tmrCfg->val, mBuf); + CMCHKUNPK(oduUnpackUInt16, &tmrCfg->val, mBuf); return ROK; } /* end of cmUnpkTmrCfg */ @@ -3464,27 +2932,20 @@ Buffer *mBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkTknBuf +S16 cmUnpkTknBuf ( TknBuf *tknBuf, /* token string */ Buffer **tBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkTknBuf(tknBuf, tBuf) -TknBuf *tknBuf; /* token string */ -Buffer **tBuf; /* message buffer */ -#endif { Buffer *mBuf; - TRC2(cmUnpkTknBuf) mBuf = *tBuf; /* Token Header */ - CMCHKUNPK(oduPackUInt8, &tknBuf->pres, mBuf); + CMCHKUNPK(oduUnpackUInt8, &tknBuf->pres, mBuf); if(tknBuf->pres) { @@ -3533,19 +2994,12 @@ Buffer **tBuf; /* message buffer */ * */ -#ifdef ANSI -PUBLIC S16 cmUnpkIntf +S16 cmUnpkIntf ( CmIntf *intf, /* interface info */ Buffer *mBuf /* message buffer */ ) -#else -PUBLIC S16 cmUnpkIntf(intf, mBuf) -CmIntf *intf; /* interface info */ -Buffer *mBuf; /* message buffer */ -#endif { - TRC2(cmUnpkIntf) CMCHKUNPK(cmUnpkIntfVer, &intf->intfVer, mBuf); CMCHKUNPK(cmUnpkIntfId, &intf->intfId, mBuf); @@ -3565,7 +3019,7 @@ Buffer *mBuf; /* message buffer */ * File: cm_gen.c * */ -U16 getTransId() +uint16_t getTransId() { gTransId = (gTransId%65535) + 1; return gTransId;