X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fcm_tpt.c;h=8eaa945d2531d2314b2d447daf40725167418cd8;hb=49856df248fd976b4a9882ca4e650fc0bc3e4ee3;hp=3e52dbbaeb414b909a7deafcda21a55cd31b5558;hpb=5d74fef7c9fe6b65a965ceac6bfe812872dab323;p=o-du%2Fl2.git diff --git a/src/cm/cm_tpt.c b/src/cm/cm_tpt.c index 3e52dbbae..8eaa945d2 100755 --- a/src/cm/cm_tpt.c +++ b/src/cm/cm_tpt.c @@ -114,21 +114,15 @@ extern "C" { * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmIpv4TptAddr ( CmIpv4TptAddr *pkParam, /* IPv4 Address structure */ Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmIpv4TptAddr (pkParam, mBuf) -CmIpv4TptAddr *pkParam; /* IPv4 Address structure */ -Buffer *mBuf; /* message buffer */ -#endif { CMCHKPK(cmPkCmIpv4NetAddr, pkParam->address, mBuf); - CMCHKPK(oduUnpackUInt16, pkParam->port, mBuf); + CMCHKPK(oduPackUInt16, pkParam->port, mBuf); return ROK; } /* cmPkCmIpv4TptAddr */ @@ -146,25 +140,19 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmPkCmIpv6NetAddr +static S16 cmPkCmIpv6NetAddr ( -CmIpv6NetAddr *pkParam, -Buffer *mBuf /* message buffer */ +CmIpv6NetAddr *pkParam, +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmPkCmIpv6NetAddr (pkParam, mBuf) -CmIpv6NetAddr *pkParam; -Buffer *mBuf; /* message buffer */ -#endif { - U8 num; - U8 *ptr = (U8*)pkParam; + uint8_t num; + uint8_t *ptr = (uint8_t*)pkParam; for(num = 0; num < CM_IPV6ADDR_SIZE; num++) { - CMCHKPK(oduUnpackUInt8, *(ptr+num), mBuf); + CMCHKPK(oduPackUInt8, *(ptr+num), mBuf); } return ROK; @@ -184,21 +172,15 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmPkCmIpv6TptAddr +static S16 cmPkCmIpv6TptAddr ( -CmIpv6TptAddr *pkParam, /* IPv6 transport address */ -Buffer *mBuf /* message buffer */ +CmIpv6TptAddr *pkParam, /* IPv6 transport address */ +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmPkCmIpv6TptAddr (pkParam, mBuf) -CmIpv6TptAddr *pkParam; /* IPv6 transport address */ -Buffer *mBuf; /* message buffer */ -#endif { CMCHKPK(cmPkCmIpv6NetAddr, &pkParam->ipv6NetAddr, mBuf); - CMCHKPK(oduUnpackUInt16, pkParam->port, mBuf); + CMCHKPK(oduPackUInt16, pkParam->port, mBuf); return ROK; } /* cmPkCmIpv6TptAddr */ @@ -217,20 +199,14 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmNetAddrTbl ( -CmNetAddrTbl *pkParam, /* Network Address Table */ -Buffer *mBuf /* message buffer */ +CmNetAddrTbl *pkParam, /* Network Address Table */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmNetAddrTbl (pkParam, mBuf) -CmNetAddrTbl *pkParam; /* Network Address Table */ -Buffer *mBuf; /* message buffer */ -#endif { - U16 idx; /* Loop Index */ - CmNetAddr *netAddr; /* Network Address */ + uint16_t idx; /* Loop Index */ + CmNetAddr *netAddr; /* Network Address */ if (pkParam->count > CM_MAX_NET_ADDR) @@ -246,7 +222,7 @@ Buffer *mBuf; /* message buffer */ } /* Pack the total number of addresses present in the table */ - CMCHKPK(oduUnpackUInt16, pkParam->count, mBuf); + CMCHKPK(oduPackUInt16, pkParam->count, mBuf); return ROK; @@ -265,17 +241,11 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmNetAddr ( -CmNetAddr *pkParam, -Buffer *mBuf /* message buffer */ +CmNetAddr *pkParam, +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmNetAddr (pkParam, mBuf) -CmNetAddr *pkParam; -Buffer *mBuf; /* message buffer */ -#endif { switch (pkParam->type) @@ -294,7 +264,7 @@ Buffer *mBuf; /* message buffer */ default: return RFAILED; } - CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf); + CMCHKPK(oduPackUInt8, pkParam->type, mBuf); return ROK; } /* cmPkCmNetAddr */ @@ -313,17 +283,11 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmTptAddr ( -CmTptAddr *pkParam, -Buffer *mBuf /* message buffer */ +CmTptAddr *pkParam, +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmTptAddr (pkParam, mBuf) -CmTptAddr *pkParam; -Buffer *mBuf; /* message buffer */ -#endif { switch (pkParam->type) @@ -342,7 +306,7 @@ Buffer *mBuf; /* message buffer */ default: return RFAILED; } - CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf); + CMCHKPK(oduPackUInt8, pkParam->type, mBuf); return ROK; } /* cmPkCmTptAddr */ @@ -363,17 +327,11 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmTptLocalInf ( -CmTptLocalInf *pkParam, /* local interface info */ -Buffer *mBuf /* message buffer */ +CmTptLocalInf *pkParam, /* local interface info */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmTptLocalInf (pkParam, mBuf) -CmTptLocalInf *pkParam; /* local interface info */ -Buffer *mBuf; /* message buffer */ -#endif { if (pkParam->intfPrsnt == TRUE) @@ -381,10 +339,10 @@ Buffer *mBuf; /* message buffer */ /* pack the actual interface address */ CMCHKPK(cmPkCmNetAddr, &pkParam->localIfAddr, mBuf); /* pack the interface index value */ - CMCHKPK(oduUnpackUInt32, pkParam->localIf, mBuf); + CMCHKPK(oduPackUInt32, pkParam->localIf, mBuf); } /* pack the boll which indicates if valid local intf is present or not */ - CMCHKPK(oduUnpackUInt8, pkParam->intfPrsnt, mBuf); + CMCHKPK(oduPackUInt8, pkParam->intfPrsnt, mBuf); return ROK; } /* cmPkCmTptLocalInf */ #endif /* LOCAL_INTF */ @@ -404,21 +362,15 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmNetMCastInf6 ( -CmNetMCastInf6 *pkParam, /* IPv6 multicast information */ -Buffer *mBuf /* message buffer */ +CmNetMCastInf6 *pkParam, /* IPv6 multicast information */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmNetMCastInf6(pkParam, mBuf) -CmNetMCastInf6 *pkParam; /* IPv6 multicast information */ -Buffer *mBuf; /* message buffer */ -#endif { CMCHKPK(cmPkCmIpv6NetAddr, &pkParam->mCastAddr, mBuf); - CMCHKPK(oduUnpackUInt32, pkParam->localInf, mBuf); + CMCHKPK(oduPackUInt32, pkParam->localInf, mBuf); return ROK; } /* cmPkCmNetMCastInf6 */ @@ -438,17 +390,11 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmPkCmSockOpts +static S16 cmPkCmSockOpts ( -CmSockOpts *pkParam, -Buffer *mBuf /* message buffer */ +CmSockOpts *pkParam, +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmPkCmSockOpts (pkParam, mBuf) -CmSockOpts *pkParam; -Buffer *mBuf; /* message buffer */ -#endif { switch (pkParam->option) @@ -474,17 +420,17 @@ Buffer *mBuf; /* message buffer */ break; case CM_SOCKOPT_OPT_MCAST6_IF: - CMCHKPK(oduUnpackUInt32, pkParam->optVal.infId, mBuf); + CMCHKPK(oduPackUInt32, pkParam->optVal.infId, mBuf); break; #endif /* IPV6_SUPPORTED */ default: - CMCHKPK(oduUnpackUInt32, pkParam->optVal.value, mBuf); + CMCHKPK(oduPackUInt32, pkParam->optVal.value, mBuf); break; } - CMCHKPK(oduUnpackUInt32, pkParam->option, mBuf); - CMCHKPK(oduUnpackUInt32, pkParam->level, mBuf); + CMCHKPK(oduPackUInt32, pkParam->option, mBuf); + CMCHKPK(oduPackUInt32, pkParam->level, mBuf); return ROK; } /* cmPkCmSockOpts */ @@ -503,19 +449,13 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmPkCmSockParam +static S16 cmPkCmSockParam ( -CmSockParam *pkParam, -Buffer *mBuf /* message buffer */ +CmSockParam *pkParam, +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmPkCmSockParam (pkParam, mBuf) -CmSockParam *pkParam; -Buffer *mBuf; /* message buffer */ -#endif { - U32 num; + uint32_t num; if( pkParam->numOpts > CM_MAX_SOCK_OPTS) @@ -526,8 +466,8 @@ Buffer *mBuf; /* message buffer */ { CMCHKPK(cmPkCmSockOpts, &pkParam->sockOpts[num], mBuf); } - CMCHKPK(oduUnpackUInt8, pkParam->numOpts, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->listenQSize, mBuf); + CMCHKPK(oduPackUInt8, pkParam->numOpts, mBuf); + CMCHKPK(oduPackUInt8, pkParam->listenQSize, mBuf); return ROK; } /* cmPkCmSockParam */ @@ -547,19 +487,13 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmPkTlsTptParam +static S16 cmPkTlsTptParam ( -TlsTptParam *pkParam, /**/ -Buffer *mBuf /* message buffer */ +TlsTptParam *pkParam, /**/ +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmPkTlsTptParam(pkParam, mBuf) -TlsTptParam *pkParam; /**/ -Buffer *mBuf; /* message buffer */ -#endif { - U32 num; + uint32_t num; if( pkParam->numOpts > CM_MAX_SOCK_OPTS) @@ -570,8 +504,8 @@ Buffer *mBuf; /* message buffer */ { CMCHKPK(cmPkCmSockOpts, &pkParam->sockOpts[num], mBuf); } - CMCHKPK(oduUnpackUInt8, pkParam->numOpts, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->listenQSize, mBuf); + CMCHKPK(oduPackUInt8, pkParam->numOpts, mBuf); + CMCHKPK(oduPackUInt8, pkParam->listenQSize, mBuf); CMCHKPK(SPkS16, pkParam->ctxId, mBuf); return ROK; @@ -593,17 +527,11 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmTptParam ( -CmTptParam *pkParam, -Buffer *mBuf /* message buffer */ +CmTptParam *pkParam, +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmTptParam (pkParam, mBuf) -CmTptParam *pkParam; -Buffer *mBuf; /* message buffer */ -#endif { switch (pkParam->type) @@ -631,7 +559,7 @@ Buffer *mBuf; /* message buffer */ return RFAILED; } - CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf); + CMCHKPK(oduPackUInt8, pkParam->type, mBuf); return ROK; } /* cmPkCmTptParam */ @@ -656,20 +584,14 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmIpv4TptAddr ( -CmIpv4TptAddr *unpkParam, /* IPv4 Address */ -Buffer *mBuf /* message buffer */ +CmIpv4TptAddr *unpkParam, /* IPv4 Address */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmUnpkCmIpv4TptAddr (unpkParam, mBuf) -CmIpv4TptAddr *unpkParam; /* IPv4 Address */ -Buffer *mBuf; /* message buffer */ -#endif { - CMCHKUNPK(oduPackUInt16, &unpkParam->port, mBuf); + CMCHKUNPK(oduUnpackUInt16, &unpkParam->port, mBuf); CMCHKUNPK(cmUnpkCmIpv4NetAddr, &unpkParam->address, mBuf); return ROK; @@ -689,27 +611,21 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmUnpkCmIpv6NetAddr +static S16 cmUnpkCmIpv6NetAddr ( -CmIpv6NetAddr *unpkParam, /* IPv6 address */ -Buffer *mBuf /* message buffer */ +CmIpv6NetAddr *unpkParam, /* IPv6 address */ +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmUnpkCmIpv6NetAddr (unpkParam, mBuf) -CmIpv6NetAddr *unpkParam; /* IPv6 address */ -Buffer *mBuf; /* message buffer */ -#endif { - U32 num; - U8 *ptr = (U8*)unpkParam; + uint32_t num; + uint8_t *ptr = (uint8_t*)unpkParam; ptr += (CM_INET_IPV6ADDR_SIZE - 1); for(num = 0; num < CM_IPV6ADDR_SIZE; num++) { - CMCHKUNPK(oduPackUInt8, (ptr-num), mBuf); + CMCHKUNPK(oduUnpackUInt8, (ptr-num), mBuf); } return ROK; @@ -729,20 +645,14 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmUnpkCmIpv6TptAddr +static S16 cmUnpkCmIpv6TptAddr ( -CmIpv6TptAddr *unpkParam, /* IPv6 transport address */ -Buffer *mBuf /* message buffer */ +CmIpv6TptAddr *unpkParam, /* IPv6 transport address */ +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmUnpkCmIpv6TptAddr (unpkParam, mBuf) -CmIpv6TptAddr *unpkParam; /* IPv6 transport address */ -Buffer *mBuf; /* message buffer */ -#endif { - CMCHKUNPK(oduPackUInt16, &unpkParam->port, mBuf); + CMCHKUNPK(oduUnpackUInt16, &unpkParam->port, mBuf); CMCHKUNPK(cmUnpkCmIpv6NetAddr, &unpkParam->ipv6NetAddr, mBuf); return ROK; @@ -762,24 +672,17 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmNetAddrTbl ( -CmNetAddrTbl *unpkParam, /* Network Address Table */ -Buffer *mBuf /* message buffer */ +CmNetAddrTbl *unpkParam, /* Network Address Table */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmUnpkCmNetAddrTbl (unpkParam, mBuf ) -CmNetAddrTbl *unpkParam; /* Network Address Table */ -Buffer *mBuf; /* message buffer */ -#endif { - U16 idx; /* Loop Index */ - CmNetAddr *netAddr; /* Network Address */ + uint16_t idx; /* Loop Index */ + CmNetAddr *netAddr; /* Network Address */ - /* Unpack the count */ - CMCHKUNPK(oduPackUInt16, &(unpkParam->count), mBuf); + CMCHKUNPK(oduUnpackUInt16, &(unpkParam->count), mBuf); /* Unpack the addresses */ for (idx = 0; idx < unpkParam->count; idx++) @@ -808,20 +711,14 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmNetAddr ( -CmNetAddr *unpkParam, -Buffer *mBuf /* message buffer */ +CmNetAddr *unpkParam, +Buffer *mBuf /* message buffer */ ) -#else -S16 cmUnpkCmNetAddr (unpkParam, mBuf ) -CmNetAddr *unpkParam; -Buffer *mBuf; /* message buffer */ -#endif { - CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->type, mBuf); switch (unpkParam->type) { @@ -857,20 +754,14 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmTptAddr ( -CmTptAddr *unpkParam, -Buffer *mBuf /* message buffer */ +CmTptAddr *unpkParam, +Buffer *mBuf /* message buffer */ ) -#else -S16 cmUnpkCmTptAddr (unpkParam, mBuf) -CmTptAddr *unpkParam; -Buffer *mBuf; /* message buffer */ -#endif { - CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->type, mBuf); switch (unpkParam->type) { @@ -908,20 +799,14 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmNetMCastInf6 ( -CmNetMCastInf6 *unpkParam, /* IPv6 multicast information */ -Buffer *mBuf /* message buffer */ +CmNetMCastInf6 *unpkParam, /* IPv6 multicast information */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmUnpkCmNetMCastInf6(unpkParam, mBuf) -CmNetMCastInf6 *unpkParam; /* IPv6 multicast information */ -Buffer *mBuf; /* message buffer */ -#endif { - CMCHKUNPK(oduPackUInt32, &unpkParam->localInf, mBuf); + CMCHKUNPK(oduUnpackUInt32, &unpkParam->localInf, mBuf); CMCHKUNPK(cmUnpkCmIpv6NetAddr, &unpkParam->mCastAddr, mBuf); return ROK; @@ -942,21 +827,15 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmUnpkCmSockOpts +static S16 cmUnpkCmSockOpts ( -CmSockOpts *unpkParam, /* socket options */ -Buffer *mBuf /* message buffer */ +CmSockOpts *unpkParam, /* socket options */ +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmUnpkCmSockOpts (unpkParam, mBuf) -CmSockOpts *unpkParam; /* socket options */ -Buffer *mBuf; /* message buffer */ -#endif { - CMCHKUNPK(oduPackUInt32, &unpkParam->level, mBuf); - CMCHKUNPK(oduPackUInt32, &unpkParam->option, mBuf); + CMCHKUNPK(oduUnpackUInt32, &unpkParam->level, mBuf); + CMCHKUNPK(oduUnpackUInt32, &unpkParam->option, mBuf); switch (unpkParam->option) { @@ -983,12 +862,12 @@ Buffer *mBuf; /* message buffer */ break; case CM_SOCKOPT_OPT_MCAST6_IF: - CMCHKUNPK(oduPackUInt32, &unpkParam->optVal.infId, mBuf); + CMCHKUNPK(oduUnpackUInt32, &unpkParam->optVal.infId, mBuf); break; #endif /* IPV6_SUPPORTED */ default: - CMCHKUNPK(oduPackUInt32, &unpkParam->optVal.value, mBuf); + CMCHKUNPK(oduUnpackUInt32, &unpkParam->optVal.value, mBuf); break; } @@ -1009,23 +888,17 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmUnpkCmSockParam +static S16 cmUnpkCmSockParam ( -CmSockParam *unpkParam, /* socket parameters */ -Buffer *mBuf /* message buffer */ +CmSockParam *unpkParam, /* socket parameters */ +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmUnpkCmSockParam (unpkParam, mBuf) -CmSockParam *unpkParam; /* socket parameters */ -Buffer *mBuf; /* message buffer */ -#endif { - U32 num; + uint32_t num; - CMCHKUNPK(oduPackUInt8, &unpkParam->listenQSize, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->numOpts, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->listenQSize, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->numOpts, mBuf); if( unpkParam->numOpts > CM_MAX_SOCK_OPTS) { @@ -1055,24 +928,18 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI -PRIVATE S16 cmUnpkTlsTptParam +static S16 cmUnpkTlsTptParam ( -TlsTptParam *unpkParam, /* TLS parameters */ -Buffer *mBuf /* message buffer */ +TlsTptParam *unpkParam, /* TLS parameters */ +Buffer *mBuf /* message buffer */ ) -#else -PRIVATE S16 cmUnpkTlsTptParam (unpkParam, mBuf) -TlsTptParam *unpkParam; /* TLS parameters */ -Buffer *mBuf; /* message buffer */ -#endif { - U32 num; + uint32_t num; CMCHKUNPK(SUnpkS16, &unpkParam->ctxId, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->listenQSize, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->numOpts, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->listenQSize, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->numOpts, mBuf); if( unpkParam->numOpts > CM_MAX_SOCK_OPTS) { @@ -1103,20 +970,14 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmTptParam ( -CmTptParam *unpkParam, /* transport parameters */ -Buffer *mBuf /* message buffer */ +CmTptParam *unpkParam, /* transport parameters */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmUnpkCmTptParam (unpkParam, mBuf) -CmTptParam *unpkParam; /* transport parameters */ -Buffer *mBuf; /* message buffer */ -#endif { - CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->type, mBuf); switch (unpkParam->type) { @@ -1163,17 +1024,11 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmIpHdrParm ( -CmIpHdrParm *pkParam, /* IP hdr parameters */ -Buffer *mBuf /* message buffer */ +CmIpHdrParm *pkParam, /* IP hdr parameters */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmIpHdrParm (pkParam, mBuf) -CmIpHdrParm *pkParam; /* IP hdr parameters */ -Buffer *mBuf; /* message buffer */ -#endif { switch (pkParam->type) @@ -1190,10 +1045,10 @@ Buffer *mBuf; /* message buffer */ CMCHKPK(cmPkTknStr64, &pkParam->u.hdrParmIpv4.ipv4HdrOpt, mBuf); #endif /* IPV4_OPTS_SUPPORTED */ - CMCHKPK(cmPkTknU8, &pkParam->u.hdrParmIpv4.ttl, mBuf); - CMCHKPK(cmPkTknU8, &pkParam->u.hdrParmIpv4.tos, mBuf); - CMCHKPK(cmPkTknU8, &pkParam->u.hdrParmIpv4.dfBit, mBuf); - CMCHKPK(cmPkTknU8, &pkParam->u.hdrParmIpv4.proto, mBuf); + CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv4.ttl, mBuf); + CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv4.tos, mBuf); + CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv4.dfBit, mBuf); + CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv4.proto, mBuf); break; case CM_HDRPARM_IPV6: @@ -1204,14 +1059,14 @@ Buffer *mBuf; /* message buffer */ CMCHKPK(cmPkCmIpv6ExtHdr, &pkParam->u.hdrParmIpv6.ipv6ExtHdr, mBuf); #endif /* IPV6_OPTS_SUPPORTED */ CMCHKPK(cmPkCmNetAddr, &pkParam->u.hdrParmIpv6.srcAddr6, mBuf); - CMCHKPK(cmPkTknU8, &pkParam->u.hdrParmIpv6.ttl, mBuf); + CMCHKPK(cmPkTknUInt8, &pkParam->u.hdrParmIpv6.ttl, mBuf); #endif /* IPV6_SUPPORTED */ break; default: return RFAILED; } - CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf); + CMCHKPK(oduPackUInt8, pkParam->type, mBuf); return ROK; } /* End of cmPkCmIpHdrParm */ @@ -1233,17 +1088,11 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmTptLocalInf ( -CmTptLocalInf *unpkParam, /* local interface info */ -Buffer *mBuf /* message buffer */ +CmTptLocalInf *unpkParam, /* local interface info */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmUnpkCmTptLocalInf (unpkParam, mBuf) -CmTptLocalInf *unpkParam; /* local interface info */ -Buffer *mBuf; /* message buffer */ -#endif { /* first unpack the bool intfPrsnt value which is always packed */ @@ -1253,7 +1102,7 @@ Buffer *mBuf; /* message buffer */ * to get the local intf index and intf address */ if (unpkParam->intfPrsnt == TRUE) { - CMCHKUNPK(oduPackUInt32, &unpkParam->localIf, mBuf); + CMCHKUNPK(oduUnpackUInt32, &unpkParam->localIf, mBuf); CMCHKUNPK(cmUnpkCmNetAddr, &unpkParam->localIfAddr, mBuf); } return ROK; @@ -1275,17 +1124,11 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmIpv6ExtHdr ( -CmIpv6ExtHdr *pkParam, /* IPV6 extension hdrs */ -Buffer *mBuf /* message buffer */ +CmIpv6ExtHdr *pkParam, /* IPV6 extension hdrs */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmIpv6ExtHdr (pkParam, mBuf) -CmIpv6ExtHdr *pkParam; /*IPV6 extension hdrs */ -Buffer *mBuf; /* message buffer */ -#endif { /* pack first Route hdr */ @@ -1320,19 +1163,13 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmIpv6RtHdr ( -CmIpv6RtHdr *pkParam, /* IPV6 Route hdr */ -Buffer *mBuf /* message buffer */ +CmIpv6RtHdr *pkParam, /* IPV6 Route hdr */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmIpv6RtHdr (pkParam, mBuf) -CmIpv6RtHdr *pkParam; /* IPV6 Route hdr */ -Buffer *mBuf; /* message buffer */ -#endif { - U8 idx; + uint8_t idx; /* pack all IPV6 addrs in the route hdr */ @@ -1341,8 +1178,8 @@ Buffer *mBuf; /* message buffer */ CMCHKPK(cmPkCmIpv6NetAddr, &pkParam->ipv6Addrs[idx], mBuf); } /* pack reserve byte & strict/loose bit map */ - CMCHKPK(oduUnpackUInt32, pkParam->slMap, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->numAddrs, mBuf); + CMCHKPK(oduPackUInt32, pkParam->slMap, mBuf); + CMCHKPK(oduPackUInt8, pkParam->numAddrs, mBuf); return ROK; } /* end of cmPkCmIpv6RtHdr */ @@ -1362,30 +1199,23 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmIpv6RtHdr ( -CmIpv6RtHdr *unpkParam, /* IPV6 Route hdr */ -Buffer *mBuf, /* message buffer */ -Mem *memInfo /* meminfo to allocate for Route hdr */ +CmIpv6RtHdr *unpkParam, /* IPV6 Route hdr */ +Buffer *mBuf, /* message buffer */ +Mem *memInfo /* meminfo to allocate for Route hdr */ ) -#else -S16 cmUnpkCmIpv6RtHdr (unpkParam, mBuf, memInfo) -CmIpv6RtHdr *unpkParam; /* IPV6 Route hdr */ -Buffer *mBuf; /* message buffer */ -Mem *memInfo; /* meminfo to allocate for Route hdr */ -#endif { - U8 idx; /* array index */ + uint8_t idx; /* array index */ S32 retVal; /* temporary return value */ - CMCHKUNPK(oduPackUInt8, &unpkParam->numAddrs, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->numAddrs, mBuf); /* unpack reserve byte & strict/loose bit map */ - CMCHKUNPK(oduPackUInt32, &unpkParam->slMap, mBuf); + CMCHKUNPK(oduUnpackUInt32, &unpkParam->slMap, mBuf); - retVal = SGetSBuf(memInfo->region, + retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region, memInfo->pool, (Data **)&unpkParam->ipv6Addrs, (unpkParam->numAddrs * 16)); @@ -1418,19 +1248,12 @@ Mem *memInfo; /* meminfo to allocate for Route hdr */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmIpv6ExtHdr ( -CmIpv6ExtHdr *unpkParam, /* IPV6 extension hdrs */ -Buffer *mBuf, /* message buffer */ -Mem *memInfo /* meminfo to allocate for IPV6 ext hdr */ +CmIpv6ExtHdr *unpkParam, /* IPV6 extension hdrs */ +Buffer *mBuf, /* message buffer */ +Mem *memInfo /* meminfo to allocate for IPV6 ext hdr */ ) -#else -S16 cmUnpkCmIpv6ExtHdr (unpkParam, mBuf, memInfo) -CmIpv6ExtHdr *unpkParam; /* IPV6 extension hdrs */ -Buffer *mBuf; /* message buffer */ -Mem *memInfo; /* meminfo to allocate for IPV6 ext hdr */ -#endif { /* unpack HBH hdr first */ @@ -1465,26 +1288,20 @@ Mem *memInfo; /* meminfo to allocate for IPV6 ext hdr */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmIpv6DestOptsArr ( -CmIpv6DestOptsArr *pkParam, /* IPV6 Dest hdr array */ -Buffer *mBuf /* message buffer */ +CmIpv6DestOptsArr *pkParam, /* IPV6 Dest hdr array */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmIpv6DestOptsArr (pkParam, mBuf) -CmIpv6DestOptsArr *pkParam; /* IPV6 Dest hdr array */ -Buffer *mBuf; /* message buffer */ -#endif { - U8 numOptions; + uint8_t numOptions; /* pack all HBH options */ for(numOptions = 0; numOptionsnumDestOpts; numOptions++) CMCHKPK(cmPkCmIpv6DestOptsHdr, &pkParam->destOpts[numOptions], mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->numDestOpts, mBuf); + CMCHKPK(oduPackUInt8, pkParam->numDestOpts, mBuf); return ROK; } /* end of cmPkCmIpv6DestOptsArr */ @@ -1503,27 +1320,21 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmIpv6DestOptsHdr ( -CmIpv6DestOptsHdr *pkParam, /* IPV6 Dest opt */ -Buffer *mBuf /* message buffer */ +CmIpv6DestOptsHdr *pkParam, /* IPV6 Dest opt */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmIpv6DestOptsHdr (pkParam, mBuf) -CmIpv6DestOptsHdr *pkParam; /* IPV6 Dest opt */ -Buffer *mBuf; /* message buffer */ -#endif { - U8 optLen; + uint8_t optLen; for(optLen = 0; optLen < pkParam->length; optLen++) { - CMCHKPK(oduUnpackUInt8, pkParam->value[optLen], mBuf); + CMCHKPK(oduPackUInt8, pkParam->value[optLen], mBuf); } - CMCHKPK(oduUnpackUInt8, pkParam->length, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf); + CMCHKPK(oduPackUInt8, pkParam->length, mBuf); + CMCHKPK(oduPackUInt8, pkParam->type, mBuf); return ROK; } /* end of cmPkCmIpv6DestOptsHdr */ @@ -1542,30 +1353,23 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmIpv6DestOptsHdr ( -CmIpv6DestOptsHdr *unpkParam,/* IPV6 Dest Option */ -Buffer *mBuf, /* message buffer */ -Mem *memInfo /* meminfo to allocate mem for dest opt */ +CmIpv6DestOptsHdr *unpkParam,/* IPV6 Dest Option */ +Buffer *mBuf, /* message buffer */ +Mem *memInfo /* meminfo to allocate mem for dest opt */ ) -#else -S16 cmUnpkCmIpv6DestOptsHdr (unpkParam, mBuf, memInfo) -CmIpv6DestOptsHdr *unpkParam;/* IPV6 Dest Option */ -Buffer *mBuf; /* message buffer */ -Mem *memInfo; /* meminfo to allocate mem for dest opt */ -#endif { S32 retVal; /* temporary return value */ - U8 optLen; /* length of value field */ + uint8_t optLen; /* length of value field */ /* unpack type, length */ - CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->length, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->type, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->length, mBuf); /* allocate static memory to hold the unpacked values */ - retVal = SGetSBuf(memInfo->region, + retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region, memInfo->pool, (Data **)&unpkParam->value, (Size)unpkParam->length); if (retVal != ROK) @@ -1576,7 +1380,7 @@ Mem *memInfo; /* meminfo to allocate mem for dest opt */ /* unpack value fieldof this option */ for(optLen = 0; optLenlength; optLen++) { - CMCHKUNPK(oduPackUInt8, &unpkParam->value[optLen], mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->value[optLen], mBuf); } return ROK; @@ -1596,29 +1400,22 @@ Mem *memInfo; /* meminfo to allocate mem for dest opt */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmIpv6DestOptsArr ( -CmIpv6DestOptsArr *unpkParam, /* all IPV6 Destination Options */ -Buffer *mBuf, /* message buffer */ -Mem *memInfo /* meminfo to allocate mem for dest opts */ +CmIpv6DestOptsArr *unpkParam, /* all IPV6 Destination Options */ +Buffer *mBuf, /* message buffer */ +Mem *memInfo /* meminfo to allocate mem for dest opts */ ) -#else -S16 cmUnpkCmIpv6DestOptsArr (unpkParam, mBuf, memInfo) -CmIpv6DestOptsArr *unpkParam; /* all IPV6 Destination Options */ -Buffer *mBuf; /* message buffer */ -Mem *memInfo; /* meminfo to allocate mem for dest opts */ -#endif { - U8 numOptions; + uint8_t numOptions; S16 retVal; - CMCHKUNPK(oduPackUInt8, &unpkParam->numDestOpts, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->numDestOpts, mBuf); if (unpkParam->numDestOpts) { /* allocate mem to hold all dest options */ - retVal = SGetSBuf(memInfo->region, + retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region, memInfo->pool, (Data **)&unpkParam->destOpts, (unpkParam->numDestOpts * sizeof(CmIpv6DestOptsHdr))); @@ -1652,25 +1449,19 @@ Mem *memInfo; /* meminfo to allocate mem for dest opts */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmIpv6HBHHdrArr ( -CmIpv6HBHHdrArr *pkParam, /* all IPV6 HopByHop options */ -Buffer *mBuf /* message buffer */ +CmIpv6HBHHdrArr *pkParam, /* all IPV6 HopByHop options */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmIpv6HBHHdrArr (pkParam, mBuf) -CmIpv6HBHHdrArr *pkParam; /* IPV6 HopByHop options */ -Buffer *mBuf; /* message buffer */ -#endif { - U8 numOptions; + uint8_t numOptions; for(numOptions = 0; numOptionsnumHBHOpts; numOptions++) CMCHKPK(cmPkCmIpv6HBHHdr, &pkParam->hbhOpts[numOptions], mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->numHBHOpts, mBuf); + CMCHKPK(oduPackUInt8, pkParam->numHBHOpts, mBuf); return ROK; } /* end of cmPkCmIpv6HBHHdrArr */ @@ -1689,30 +1480,24 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmIpv6HBHHdr ( -CmIpv6HBHHdr *pkParam, /* individual IPV6 HBH options */ -Buffer *mBuf /* message buffer */ +CmIpv6HBHHdr *pkParam, /* individual IPV6 HBH options */ +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmIpv6HBHHdr (pkParam, mBuf) -CmIpv6HBHHdr *pkParam; /* individual IPV6 HBH options */ -Buffer *mBuf; /* message buffer */ -#endif { - U8 optLen; + uint8_t optLen; /* pack value field */ for(optLen = 0; optLenlength; optLen++) { - CMCHKPK(oduUnpackUInt8, pkParam->value[optLen], mBuf); + CMCHKPK(oduPackUInt8, pkParam->value[optLen], mBuf); } /* pack type, length fields */ - CMCHKPK(oduUnpackUInt8, pkParam->length, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf); + CMCHKPK(oduPackUInt8, pkParam->length, mBuf); + CMCHKPK(oduPackUInt8, pkParam->type, mBuf); return ROK; } /* end of cmPkCmIpv6HBHHdr */ @@ -1731,31 +1516,23 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmIpv6HBHHdr ( -CmIpv6HBHHdr *unpkParam,/* individual IPV6 HBH Option */ -Buffer *mBuf, /* message buffer */ -Mem *memInfo /* meminfo to allocate mem for HBH opt */ +CmIpv6HBHHdr *unpkParam,/* individual IPV6 HBH Option */ +Buffer *mBuf, /* message buffer */ +Mem *memInfo /* meminfo to allocate mem for HBH opt */ ) -#else -S16 cmUnpkCmIpv6HBHHdr (unpkParam, mBuf, memInfo) -CmIpv6HBHHdr *unpkParam;/* individual IPV6 HBH Option */ -Buffer *mBuf; /* message buffer */ -Mem *memInfo; /* meminfo to allocate mem for HBH opt */ -#endif { S32 retVal; /* temporary return value */ - U8 optLen; /* length of value field */ - + uint8_t optLen; /* length of value field */ - CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->length, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->type, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->length, mBuf); /* allocate static memory to hold the unpacked values */ if (unpkParam->length) { - retVal = SGetSBuf(memInfo->region, + retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region, memInfo->pool, (Data **)&unpkParam->value, (Size)unpkParam->length); if (retVal != ROK) @@ -1764,7 +1541,7 @@ Mem *memInfo; /* meminfo to allocate mem for HBH opt */ } for(optLen = 0; optLenlength; optLen++) - CMCHKUNPK(oduPackUInt8, &unpkParam->value[optLen], mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->value[optLen], mBuf); } return ROK; @@ -1784,29 +1561,22 @@ Mem *memInfo; /* meminfo to allocate mem for HBH opt */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmIpv6HBHHdrArr ( -CmIpv6HBHHdrArr *unpkParam, /* all HBH options */ -Buffer *mBuf, /* message buffer */ -Mem *memInfo /* meminfo to allocate space for HBH opt */ +CmIpv6HBHHdrArr *unpkParam, /* all HBH options */ +Buffer *mBuf, /* message buffer */ +Mem *memInfo /* meminfo to allocate space for HBH opt */ ) -#else -S16 cmUnpkCmIpv6HBHHdrArr (unpkParam, mBuf, memInfo) -CmIpv6HBHHdrArr *unpkParam; /* all HBH options */ -Buffer *mBuf; /* message buffer */ -Mem *memInfo; /* meminfo to allocate space for HBH opt */ -#endif { - U8 numOptions; + uint8_t numOptions; S16 retVal; - CMCHKUNPK(oduPackUInt8, &unpkParam->numHBHOpts, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->numHBHOpts, mBuf); if (unpkParam->numHBHOpts) { /* allocate space for all HBH options */ - retVal = SGetSBuf(memInfo->region, + retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region, memInfo->pool, (Data **)&unpkParam->hbhOpts, (unpkParam->numHBHOpts * sizeof(CmIpv6HBHHdr))); @@ -1837,7 +1607,6 @@ Mem *memInfo; /* meminfo to allocate space for HBH opt */ * File: cm_tpt.c * */ -#ifdef ANSI /* added */ #ifdef IPV6_OPTS_SUPPORTED S16 cmUnpkCmIpHdrParm @@ -1853,22 +1622,9 @@ CmIpHdrParm *unpkParam,/* ip hdr parameters */ Buffer *mBuf /* message buffer */ ) #endif /* IPV6_OPTS_SUPPORTED */ -#else -/* added */ -#ifdef IPV6_OPTS_SUPPORTED -S16 cmUnpkCmIpHdrParm (unpkParam, mBuf, memInfo) -CmIpHdrParm *unpkParam;/* ip hdr parameters */ -Buffer *mBuf; /* message buffer */ -Mem *memInfo; /* meminfo to allocate mem for ipHdrParam */ -#else -S16 cmUnpkCmIpHdrParm (unpkParam, mBuf) -CmIpHdrParm *unpkParam;/* ip hdr parameters */ -Buffer *mBuf; /* message buffer */ -#endif /* IPV6_OPTS_SUPPORTED */ -#endif { - CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->type, mBuf); switch (unpkParam->type) { @@ -1877,10 +1633,10 @@ Buffer *mBuf; /* message buffer */ break; case CM_HDRPARM_IPV4: - CMCHKUNPK(cmUnpkTknU8, &unpkParam->u.hdrParmIpv4.proto, mBuf); - CMCHKUNPK(cmUnpkTknU8, &unpkParam->u.hdrParmIpv4.dfBit, mBuf); - CMCHKUNPK(cmUnpkTknU8, &unpkParam->u.hdrParmIpv4.tos, mBuf); - CMCHKUNPK(cmUnpkTknU8, &unpkParam->u.hdrParmIpv4.ttl, mBuf); + CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv4.proto, mBuf); + CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv4.dfBit, mBuf); + CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv4.tos, mBuf); + CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv4.ttl, mBuf); #ifdef IPV4_OPTS_SUPPORTED CMCHKUNPK(cmUnpkTknStr64, &unpkParam->u.hdrParmIpv4.ipv4HdrOpt, mBuf); #endif /* IPV4_OPTS_SUPPORTED */ @@ -1888,7 +1644,7 @@ Buffer *mBuf; /* message buffer */ case CM_HDRPARM_IPV6: #ifdef IPV6_SUPPORTED - CMCHKUNPK(cmUnpkTknU8, &unpkParam->u.hdrParmIpv6.ttl, mBuf); + CMCHKUNPK(cmUnpkTknUInt8, &unpkParam->u.hdrParmIpv6.ttl, mBuf); CMCHKUNPK(cmUnpkCmNetAddr, &unpkParam->u.hdrParmIpv6.srcAddr6, mBuf); @@ -1923,17 +1679,11 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmPkCmIcmpFilter ( -CmIcmpFilter *pkParam, -Buffer *mBuf /* message buffer */ +CmIcmpFilter *pkParam, +Buffer *mBuf /* message buffer */ ) -#else -S16 cmPkCmIcmpFilter (pkParam, mBuf) -CmIcmpFilter *pkParam; -Buffer *mBuf; /* message buffer */ -#endif { /* Variable declaration */ S16 idx; @@ -1947,15 +1697,15 @@ Buffer *mBuf; /* message buffer */ case CM_ICMPVER4_FILTER: for(idx = (pkParam->u.icmpv4Filter.num-1); idx >= 0; idx--) { - CMCHKPK(oduUnpackUInt32, pkParam->u.icmpv4Filter.icmpError[idx].errCodeMask, + CMCHKPK(oduPackUInt32, pkParam->u.icmpv4Filter.icmpError[idx].errCodeMask, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.icmpError[idx].errType, + CMCHKPK(oduPackUInt8, pkParam->u.icmpv4Filter.icmpError[idx].errType, mBuf); } - CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.num, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.protocol, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.allMsg, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.icmpMsgFlag, mBuf); + CMCHKPK(oduPackUInt8, pkParam->u.icmpv4Filter.num, mBuf); + CMCHKPK(oduPackUInt8, pkParam->u.icmpv4Filter.protocol, mBuf); + CMCHKPK(oduPackUInt8, pkParam->u.icmpv4Filter.allMsg, mBuf); + CMCHKPK(oduPackUInt8, pkParam->u.icmpv4Filter.icmpMsgFlag, mBuf); break; case CM_ICMPVER6_FILTER: @@ -1964,21 +1714,21 @@ Buffer *mBuf; /* message buffer */ #ifdef IPV6_SUPPORTED for(idx = (pkParam->u.icmpv6Filter.num - 1); idx >= 0; idx--) { - CMCHKPK(oduUnpackUInt32, pkParam->u.icmpv6Filter.icmpError[idx].errCodeMask, + CMCHKPK(oduPackUInt32, pkParam->u.icmpv6Filter.icmpError[idx].errCodeMask, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv6Filter.icmpError[idx].errType, + CMCHKPK(oduPackUInt8, pkParam->u.icmpv6Filter.icmpError[idx].errType, mBuf); } - CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv6Filter.num, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.allMsg, mBuf); - CMCHKPK(oduUnpackUInt8, pkParam->u.icmpv4Filter.icmpMsgFlag, mBuf); + CMCHKPK(oduPackUInt8, pkParam->u.icmpv6Filter.num, mBuf); + CMCHKPK(oduPackUInt8, pkParam->u.icmpv4Filter.allMsg, mBuf); + CMCHKPK(oduPackUInt8, pkParam->u.icmpv4Filter.icmpMsgFlag, mBuf); #endif /* IPV6_SUPPORTED */ break; default: return RFAILED; } - CMCHKPK(oduUnpackUInt8, pkParam->type, mBuf); + CMCHKPK(oduPackUInt8, pkParam->type, mBuf); return ROK; } @@ -1997,22 +1747,16 @@ Buffer *mBuf; /* message buffer */ * File: cm_tpt.c * */ -#ifdef ANSI S16 cmUnpkCmIcmpFilter ( -CmIcmpFilter *unpkParam, -Buffer *mBuf /* message buffer */ +CmIcmpFilter *unpkParam, +Buffer *mBuf /* message buffer */ ) -#else -S16 cmUnpkCmIcmpFilter (unpkParam, mBuf) -CmIcmpFilter *unpkParam; -Buffer *mBuf; /* message buffer */ -#endif { /* Variable declaration */ S16 idx; - CMCHKUNPK(oduPackUInt8, &unpkParam->type, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->type, mBuf); switch (unpkParam->type) { @@ -2020,16 +1764,16 @@ Buffer *mBuf; /* message buffer */ break; case CM_ICMPVER4_FILTER: - CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv4Filter.icmpMsgFlag, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv4Filter.allMsg, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv4Filter.protocol, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv4Filter.num, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->u.icmpv4Filter.icmpMsgFlag, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->u.icmpv4Filter.allMsg, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->u.icmpv4Filter.protocol, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->u.icmpv4Filter.num, mBuf); for(idx = 0; idx < (unpkParam->u.icmpv4Filter.num); idx++) { - CMCHKUNPK(oduPackUInt8, + CMCHKUNPK(oduUnpackUInt8, &unpkParam->u.icmpv4Filter.icmpError[idx].errType, mBuf); - CMCHKUNPK(oduPackUInt32, + CMCHKUNPK(oduUnpackUInt32, &unpkParam->u.icmpv4Filter.icmpError[idx].errCodeMask, mBuf); } @@ -2037,15 +1781,15 @@ Buffer *mBuf; /* message buffer */ case CM_ICMPVER6_FILTER: #ifdef IPV6_SUPPORTED - CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv6Filter.icmpMsgFlag, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv6Filter.allMsg, mBuf); - CMCHKUNPK(oduPackUInt8, &unpkParam->u.icmpv6Filter.num, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->u.icmpv6Filter.icmpMsgFlag, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->u.icmpv6Filter.allMsg, mBuf); + CMCHKUNPK(oduUnpackUInt8, &unpkParam->u.icmpv6Filter.num, mBuf); for(idx = 0; idx < (unpkParam->u.icmpv6Filter.num); idx++) { - CMCHKUNPK(oduPackUInt8, + CMCHKUNPK(oduUnpackUInt8, &unpkParam->u.icmpv6Filter.icmpError[idx].errType, mBuf); - CMCHKUNPK(oduPackUInt32, + CMCHKUNPK(oduUnpackUInt32, &unpkParam->u.icmpv6Filter.icmpError[idx].errCodeMask, mBuf); }