1 /******************************************************************************
3 * Copyright (c) 2020 ICT/CAS.
5 * Licensed under the O-RAN Software License, Version 1.0 (the "Software 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 * https://www.o-ran.org/software
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.
17 *******************************************************************************/
21 #include "vos_sys_diff.h"
31 #define VOS_NAME_MAX_LENGTH 128 /* VOS有名字的对象的名字的最大长度. */
38 #define VOS_ERROR (-1)
44 #define VOS_PACKED __attribute__((packed))
46 typedef struct VOS_MAC_addr_s{
47 unsigned char addr[6];
48 }VOS_PACKED VOS_MAC_addr_t;
50 typedef struct VOS_IPv4_addr_s{
52 }VOS_PACKED VOS_IPv4_addr_t;
54 typedef struct VOS_IPv6_addr_s{
55 unsigned char addr[16];
56 }VOS_PACKED VOS_IPv6_addr_t;
63 typedef unsigned char UCHAR;
66 typedef unsigned short USHORT;
70 typedef unsigned int UINT;
73 typedef unsigned long ULONG;
75 typedef unsigned char BYTE;
76 typedef unsigned short WORD;
77 typedef unsigned long DWORD;
82 typedef const char *LPCSTR;
83 typedef unsigned long *PULONG;
86 typedef void *VOS_HANDLE;
90 typedef unsigned char UINT8;
93 typedef unsigned short UINT16;
96 typedef unsigned int UINT32;
99 typedef unsigned long UINT64;
104 #define NULL (__null)
106 #if !defined(__cplusplus) && 0
107 #define NULL ((void*)0)
114 #if defined (OS_LINUX)
118 typedef double DOUBLE;
123 typedef unsigned short *PUSHORT;
128 typedef unsigned char *PUCHAR;
134 typedef FLOAT *PFLOAT;
154 typedef BYTE *LPBYTE;
174 typedef WORD *LPWORD;
179 typedef long *LPLONG;
184 typedef DWORD *PDWORD;
189 typedef DWORD *LPDWORD;
194 typedef void *LPVOID;
199 typedef const void *LPCVOID;
204 typedef unsigned int *PUINT;
207 /* Types use for passing & returning polymorphic values */
210 typedef unsigned int WPARAM;
220 typedef LONG LRESULT;
224 #ifndef HAVE_LONGLONG
225 #define HAVE_LONGLONG
226 typedef long long LONGLONG;
229 #ifndef HAVE_ULONGLONG
230 #define HAVE_ULONGLONG
231 typedef unsigned long long ULONGLONG;
234 #ifndef HAVE_longlong
235 #define HAVE_longlong
236 typedef long long longlong;
239 #ifndef HAVE_ulonglong
240 #define HAVE_ulonglong
241 typedef unsigned long long ulonglong;
248 #define __const__ const
249 #define __signed__ signed
250 #define __const__ const
255 #define VOS_ERR_OUT VOS_Printf("error! %s(%u),%s\r\n",__FILE__,__LINE__,__func__)
256 #define VOS_VAL_OUT(a) VOS_Printf("\r\n var(%s),value(%d),%s(%u),%s\r\n",(#a),(a),__FILE__,__LINE__,__func__)
257 #define VOS_VAL_OUT_U(a) VOS_Printf("\r\n var(%s),value(%u),%s(%u),%s\r\n",(#a),(a),__FILE__,__LINE__,__func__)
258 #define VOS_STR_OUT(a) VOS_Printf("\r\n %s,%s(%u),%s\r\n",(a),__FILE__,__LINE__,__func__)
262 #define __VOS_RESIDUE( _n, _2_exp ) (((_n)<<(32-(_2_exp)))>>(32-(_2_exp)))
265 #define __VOS_QUOTIENT( _n, _2_exp ) ((_n)>>(_2_exp))
268 #define __VOS_INTZERO( _n, _2_exp ) (__VOS_QUOTIENT( _n, _2_exp )<<(_2_exp))
271 #define __VOS_INTINCR( _n, _2_exp ) \
272 ((__VOS_QUOTIENT( _n, _2_exp ) + (0==__VOS_QUOTIENT( __VOS_RESIDUE( _n, _2_exp ), _2_exp ))?0:1)<<(_2_exp))
277 #define CL_LIB_AF_INET6 10
278 #define CL_LIB_AF_INET 2
285 /** IPv6 addr structure */
295 #define VOS_SNMP_DateAndTime_SIZE 8
296 typedef struct VOS_SNMP_DateAndTime_s{
297 CHAR DateAndTime[VOS_SNMP_DateAndTime_SIZE];
298 }VOS_SNMP_DateAndTime_t;
305 #endif /*_VOS_TYPES_H_*/