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: Token Structures, required by two or more layers
29 *********************************************************************21*/
42 typedef TknU8 TknPres;
43 /* Do not remove TknBool definition. If cm_gprs.x is used then include this
44 * file before cm_gprs.x */
45 typedef TknU8 TknBool;
49 U8 pres; /* present flag */
50 U8 spare1; /* for alignment */
53 U32 spare2; /* for 64 bit alignment */
58 typedef struct tknStr8 /* token string */
60 U8 pres; /* present flag */
62 U16 spare1; /* for alignment */
64 U32 spare2; /* for 64 bit alignment */
66 U8 val[8]; /* string value - 4 byte alligned */
70 typedef struct tknStr16 /* token string */
72 U8 pres; /* present flag */
74 U16 spare1; /* for alignment */
76 U32 spare2; /* for 64 bit alignment */
78 U8 val[16]; /* string value - 4 byte alligned */
81 typedef struct tknStrOSXL
83 U8 pres; /* present flag */
84 U8 spare1; /* spare */
87 U32 spare2; /* for 64 bit alignment */
89 U8 *val; /* string value - 4 byte alligned */
92 /* Token TknBStr32 : length field indicates number of Bits present */
93 typedef TknStr4 TknBStr32;
95 /* Token TknStrBSXL : Len field indicates number of bits present */
96 typedef TknStrOSXL TknStrBSXL;
99 /*****************************************************
100 Token structure for BMP Character Strings
101 ******************************************************/
103 /* Token TknStrBMP4 */
104 typedef struct tknStrBMP4 /* token string */
106 U8 pres; /* present flag */
108 U16 spare1; /* for alignment */
110 U32 spare2; /* for 64 bit alignment */
112 U16 val[4]; /* string value - 4 byte alligned */
115 /* Token TknStrBMPXL */
116 typedef struct tknStrBMPXL
118 U8 pres; /* present flag */
119 U8 spare1; /* spare */
120 U16 len; /* length */
122 U32 spare2; /* for 64 bit alignment */
124 U16 *val; /* string value - 4 byte alligned */
128 /*****************************************************
129 Token structure for UNIVERSAL Character Strings
130 ******************************************************/
132 /* Token TknStrUNI4 */
133 typedef struct tknStrUNI4 /* token string */
135 U8 pres; /* present flag */
137 U16 spare1; /* for alignment */
139 U32 spare2; /* for 64 bit alignment */
141 U32 val[4]; /* string value - 4 byte alligned */
144 typedef struct tknStrUNIXL /* Universal String */
146 U8 pres; /* present flag */
147 U8 spare1; /* spare */
148 U16 len; /* length */
150 U32 spare2; /* for 64 bit alignment */
152 U32 *val; /* string value- 4 byte alligned */
155 /* common packing functions */
156 EXTERN S16 cmPkTknPres ARGS((TknPres *tknPres, Buffer *mBuf));
157 EXTERN S16 cmPkTknS16 ARGS((TknS16 *tknS16, Buffer *mBuf));
158 EXTERN S16 cmPkTknBStr32 ARGS((TknBStr32 *tknbStr32, Buffer *mBuf));
159 EXTERN S16 cmPkTknStr8 ARGS((TknStr8 *tknStr8, Buffer *mBuf));
160 EXTERN S16 cmPkTknStr16 ARGS((TknStr16 *tknStr16, Buffer *mBuf));
161 EXTERN S16 cmPkTknStrOSXL ARGS((TknStrOSXL *tknStrOSXL, Buffer *mBuf));
162 EXTERN S16 cmPkTknStrBSXL ARGS((TknStrBSXL *tknStrBSXL, Buffer *mBuf));
163 EXTERN S16 cmPkTknStrBMP4 ARGS((TknStrBMP4 *tknStrBMP4, Buffer *mBuf));
164 EXTERN S16 cmPkTknStrBMPXL ARGS((TknStrBMPXL *tknStrBMPXL, Buffer *mBuf));
165 EXTERN S16 cmPkTknStrUNI4 ARGS((TknStrUNI4 *tknStrUNI4, Buffer *mBuf));
166 EXTERN S16 cmPkTknStrUNIXL ARGS((TknStrUNIXL *tknStrUNIXL, Buffer *mBuf));
170 /* common unpacking functions */
171 EXTERN S16 cmUnpkTknPres ARGS((TknPres *tknPres, Buffer *mBuf));
172 EXTERN S16 cmUnpkTknS16 ARGS((TknS16 *tknS16, Buffer *mBuf));
173 EXTERN S16 cmUnpkTknBStr32 ARGS((TknBStr32 *tknBStr32, Buffer *mBuf));
174 EXTERN S16 cmUnpkTknStr8 ARGS((TknStr8 *tknStr8, Buffer *mBuf));
175 EXTERN S16 cmUnpkTknStr16 ARGS((TknStr16 *tknStr16, Buffer *mBuf));
176 EXTERN S16 cmUnpkTknStrOSXL ARGS((TknStrOSXL *tknStrOSXL, Buffer *mBuf,
178 EXTERN S16 cmUnpkTknStrBSXL ARGS((TknStrBSXL *tknStrBSXL, Ptr ptr,
180 EXTERN S16 cmUnpkTknStrBMP4 ARGS((TknStrBMP4 *tknStrBMP4, Buffer *mBuf));
181 EXTERN S16 cmUnpkTknStrBMPXL ARGS((TknStrBMPXL *tknStrBMPXL, Buffer *mBuf,
183 EXTERN S16 cmUnpkTknStrUNI4 ARGS((TknStrUNI4 *tknStrUNI4, Buffer *mBuf));
184 EXTERN S16 cmUnpkTknStrUNIXL ARGS((TknStrUNIXL *tknStrUNIXL, Buffer *mBuf,
190 #endif /* __cplusplus */
191 #endif /* __CMTKNSX */
194 /********************************************************************30**
197 **********************************************************************/