1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /********************************************************************20**
25 Desc: defines , required by cm_tkns.c and cm_tkns.h
29 *********************************************************************21*/
36 #define cmPkTknPres(x, mBuf) cmPkTknUInt8(x, mBuf)
38 #define cmUnpkTknPres(x, mBuf) cmUnpkTknUInt8(x, mBuf)
41 /* packing and unpacking for token bit strings */
43 #define CMPKTKNBSTR(tknStr, mBuf) \
50 if (tknStr->len % 8) \
51 len = (tknStr->len/8 ) + 1; \
53 len = (tknStr->len/8 ); \
56 for (i = 0; i < (S16) len; i++) \
58 CMCHKPK(oduUnpackUInt8, tknStr->val[i], mBuf); \
62 CMCHKPK(oduUnpackUInt8, tknStr->len, mBuf); \
66 CMCHKPK(oduUnpackUInt8, tknStr->pres, mBuf); \
69 #define CMUNPKTKNBSTR(tknStr, mBuf) \
75 CMCHKUNPK(oduPackUInt8, &tknStr->pres, mBuf); \
80 CMCHKUNPK(oduPackUInt8, &tknStr->len, mBuf); \
82 if (tknStr->len % 8) \
83 len = (tknStr->len/8 ) + 1; \
85 len = (tknStr->len/8 ); \
88 for (i = 1; i <= (S16) len; i++) \
90 CMCHKUNPK(oduPackUInt8, &tknStr->val[len - i], mBuf); \
96 #endif /* __CMTKNSH */
99 /********************************************************************30**
102 **********************************************************************/