1 /***********************************************************************
3 * Copyright (c) 2006-2007 Broadcom Corporation
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License, version 2, as published by
10 # the Free Software Foundation (the "GPL").
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
23 # A copy of the GPL is available at http://www.broadcom.com/licenses/GPLv2.php, or by
24 # writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 # Boston, MA 02111-1307, USA.
28 ************************************************************************/
33 #include <unistd.h> /* for getopt */
34 #include <stdio.h> /* for snprintf */
35 #include <stdint.h> /* for the various integer types */
36 #include <stdlib.h> /* for NULL */
37 #include <string.h> /* for strlen, strncpy */
38 #include <ctype.h> /* for isdigit */
39 #include <syslog.h> /* for syslog */
40 #include <stdarg.h> /* for va_list */
41 #include "cms_params.h"
44 * \brief Various commonly used, but OS dependent definitions are defined here.
46 * This file is for Linux.
49 #ifndef NUMBER_TYPES_ALREADY_DEFINED
50 #define NUMBER_TYPES_ALREADY_DEFINED
52 /** Unsigned 64 bit integer.
53 * This data type was introduced in TR-106 Issue 1, Admendment 2, Sept. 2008
55 typedef uint64_t UINT64;
57 /** Signed 64 bit integer.
58 * This data type was introduced in TR-106 Issue 1, Admendment 2, Sept. 2008
60 typedef int64_t SINT64;
62 /** Unsigned 32 bit integer. */
63 typedef uint32_t UINT32;
65 /** Signed 32 bit integer. */
66 typedef int32_t SINT32;
68 /** Unsigned 16 bit integer. */
69 typedef uint16_t UINT16;
71 /** Signed 16 bit integer. */
72 typedef int16_t SINT16;
74 /** Unsigned 8 bit integer. */
75 typedef uint8_t UINT8;
77 /** Signed 8 bit integer. */
80 #endif /* NUMBER_TYPES_ALREADY_DEFINED */
83 #ifndef BOOL_TYPE_ALREADY_DEFINED
84 #define BOOL_TYPE_ALREADY_DEFINED
86 /**Boolean type; use 1 byte only, possible values are TRUE(1) or FALSE(0) only.
88 * TRUE/FALSE defined in cms.h
90 typedef uint8_t UBOOL8;
92 #endif /* BOOL_TYPE_ALREADY_DEFINED */
95 /** Base64 encoded string representation of binary data.
97 * This is to support TR69 data types.
99 typedef char * BASE64;
102 /** Hex encoded string representation of binary data.
103 * This data type was introduced in TR-106 Issue 1, Admendment 2, Sept. 2008
105 * This is to support TR69 data types.
107 typedef char * HEXBINARY;
110 /** String representation of date and time.
112 * This is to support TR69 data types.
114 typedef char * DATETIME;
117 /** Invalid file descriptor number */
118 #define CMS_INVALID_FD (-1)
121 /** Invalid process id.
123 * Management entities should not need to use this constant. It is used
124 * by OS dependent code in the OAL layer. But I put this constant here
125 * to make it easier to find.
127 #define CMS_INVALID_PID 0
130 /** A number to identify a MdmObject (but not the specific instance of
133 * MdmObjectId's are defined in mdm_oid.h.
135 typedef UINT16 MdmObjectId;
138 /** A structure to keep track of instance information.
140 * External callers can treat this as an opaque handle.
141 * Note the instance array must be of type UINT32 because
142 * the instance id's are constantly increasing, so we
143 * cannot save space by defining instance to be
144 * an array of UINT8's.
148 UINT8 currentDepth; /**< next index in the instance array
149 * to fill. 0 means empty. */
150 UINT32 instance[MAX_MDM_INSTANCE_DEPTH];/**< Array of instance id's. */
155 #endif /* __OS_DEFS_H__ */