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 TknUInt8 TknPres;
43 /* Do not remove TknBool definition. If cm_gprs.x is used then include this
44 * file before cm_gprs.x */
45 typedef TknUInt8 TknBool;
49 uint8_t pres; /* present flag */
50 uint8_t spare1; /* for alignment */
53 uint32_t spare2; /* for 64 bit alignment */
58 typedef struct tknStr8 /* token string */
60 uint8_t pres; /* present flag */
61 uint8_t len; /* length */
62 uint16_t spare1; /* for alignment */
64 uint32_t spare2; /* for 64 bit alignment */
66 uint8_t val[8]; /* string value - 4 byte alligned */
70 typedef struct tknStr16 /* token string */
72 uint8_t pres; /* present flag */
73 uint8_t len; /* length */
74 uint16_t spare1; /* for alignment */
76 uint32_t spare2; /* for 64 bit alignment */
78 uint8_t val[16]; /* string value - 4 byte alligned */
81 typedef struct tknStrOSXL
83 uint8_t pres; /* present flag */
84 uint8_t spare1; /* spare */
85 uint16_t len; /* length */
87 uint32_t spare2; /* for 64 bit alignment */
89 uint8_t *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 uint8_t pres; /* present flag */
107 uint8_t len; /* length */
108 uint16_t spare1; /* for alignment */
110 uint32_t spare2; /* for 64 bit alignment */
112 uint16_t val[4]; /* string value - 4 byte alligned */
115 /* Token TknStrBMPXL */
116 typedef struct tknStrBMPXL
118 uint8_t pres; /* present flag */
119 uint8_t spare1; /* spare */
120 uint16_t len; /* length */
122 uint32_t spare2; /* for 64 bit alignment */
124 uint16_t *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 uint8_t pres; /* present flag */
136 uint8_t len; /* length */
137 uint16_t spare1; /* for alignment */
139 uint32_t spare2; /* for 64 bit alignment */
141 uint32_t val[4]; /* string value - 4 byte alligned */
144 typedef struct tknStrUNIXL /* Universal String */
146 uint8_t pres; /* present flag */
147 uint8_t spare1; /* spare */
148 uint16_t len; /* length */
150 uint32_t spare2; /* for 64 bit alignment */
152 uint32_t *val; /* string value- 4 byte alligned */
155 /* common packing functions */
156 S16 cmPkTknPres ARGS((TknPres *tknPres, Buffer *mBuf));
157 S16 cmPkTknS16 ARGS((TknS16 *tknS16, Buffer *mBuf));
158 S16 cmPkTknBStr32 ARGS((TknBStr32 *tknbStr32, Buffer *mBuf));
159 S16 cmPkTknStr8 ARGS((TknStr8 *tknStr8, Buffer *mBuf));
160 S16 cmPkTknStr16 ARGS((TknStr16 *tknStr16, Buffer *mBuf));
161 S16 cmPkTknStrOSXL ARGS((TknStrOSXL *tknStrOSXL, Buffer *mBuf));
162 S16 cmPkTknStrBSXL ARGS((TknStrBSXL *tknStrBSXL, Buffer *mBuf));
163 S16 cmPkTknStrBMP4 ARGS((TknStrBMP4 *tknStrBMP4, Buffer *mBuf));
164 S16 cmPkTknStrBMPXL ARGS((TknStrBMPXL *tknStrBMPXL, Buffer *mBuf));
165 S16 cmPkTknStrUNI4 ARGS((TknStrUNI4 *tknStrUNI4, Buffer *mBuf));
166 S16 cmPkTknStrUNIXL ARGS((TknStrUNIXL *tknStrUNIXL, Buffer *mBuf));
170 /* common unpacking functions */
171 S16 cmUnpkTknPres ARGS((TknPres *tknPres, Buffer *mBuf));
172 S16 cmUnpkTknS16 ARGS((TknS16 *tknS16, Buffer *mBuf));
173 S16 cmUnpkTknBStr32 ARGS((TknBStr32 *tknBStr32, Buffer *mBuf));
174 S16 cmUnpkTknStr8 ARGS((TknStr8 *tknStr8, Buffer *mBuf));
175 S16 cmUnpkTknStr16 ARGS((TknStr16 *tknStr16, Buffer *mBuf));
176 S16 cmUnpkTknStrOSXL ARGS((TknStrOSXL *tknStrOSXL, Buffer *mBuf,
178 S16 cmUnpkTknStrBSXL ARGS((TknStrBSXL *tknStrBSXL, Ptr ptr,
180 S16 cmUnpkTknStrBMP4 ARGS((TknStrBMP4 *tknStrBMP4, Buffer *mBuf));
181 S16 cmUnpkTknStrBMPXL ARGS((TknStrBMPXL *tknStrBMPXL, Buffer *mBuf,
183 S16 cmUnpkTknStrUNI4 ARGS((TknStrUNI4 *tknStrUNI4, Buffer *mBuf));
184 S16 cmUnpkTknStrUNIXL ARGS((TknStrUNIXL *tknStrUNIXL, Buffer *mBuf,
190 #endif /* __cplusplus */
191 #endif /* __CMTKNSX */
194 /********************************************************************30**
197 **********************************************************************/