comparison src/gpf/inc/pdi.h @ 0:4e78acac3d88

src/{condat,cs,gpf,nucleus}: import from Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:23:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4e78acac3d88
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul : pdi.h
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose :
18 +-----------------------------------------------------------------------------
19 */
20
21 #ifndef __PDI_H__
22 #define __PDI_H__
23
24 /*==== INCLUDES =============================================================*/
25 #include "typedefs.h"
26 #include "ccdapi.h"
27
28 /*==== CONSTANTS =============================================================*/
29 #define PD_XX 1
30 #define PD_CC 3
31 #define PD_MM 5
32 #define PD_RR 6
33 #define PD_GMM 8
34 #define PD_SMS 9
35 #define PD_SS 11
36 #define PD_SM 10
37 #define PD_TST 15
38
39 #define PDI_MAXDECODEINFOATTRIB 128
40 #define PDI_MAXDECODEINFOPRIM 128
41 #define PDI_MAXDECODEINFOENTITY 128
42 #define PDI_MAXPMEMFORMTYPE 23
43
44 #define PDI_DECODETYPE_L3PDU 0
45 #define PDI_DECODETYPE_L3PDU_N 1
46 #define PDI_DECODETYPE_SAPI 2
47 #define PDI_DECODETYPE_NOPD 3
48 #define PDI_DECODETYPE_NOPD_NOTYPE 4
49 #define PDI_DECODETYPE_NOPD_N 5
50 #define PDI_DECODETYPE_NOPD_NOTYPE_N 6
51 #define PDI_DECODETYPE_RR_SHORT 7
52 #define PDI_DECODETYPE_MAC_H 8
53 #define PDI_DECODETYPE_MAC_H_N 9
54 #define PDI_DECODETYPE_MAC_H_CHECK 10
55 #define PDI_DECODETYPE_MAC_H_N_CHECK 11
56 #define PDI_DECODETYPE_AIM 12
57 #define PDI_DECODETYPE_AIM_N 13
58 #define PDI_DECODETYPE_AIM_CHECK 14
59 #define PDI_DECODETYPE_AIM_N_CHECK 15
60
61 #define PDI_DLL_ERROR -2
62
63 /* returned decoding info */
64 typedef struct
65 {
66 UBYTE entity;
67 UBYTE dir;
68 unsigned char pd;
69 unsigned char ti;
70 T_MSGBUF *mbuf;
71 UBYTE msg_type;
72 } T_PDI_CCDMSG;
73
74 typedef int (*T_pdi_prepare_ccdmsg)(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
75
76 typedef struct
77 {
78 char type;
79 char attrib[PDI_MAXDECODEINFOATTRIB];
80 char prim[PDI_MAXDECODEINFOPRIM];
81 char entity[PDI_MAXDECODEINFOENTITY];
82 UBYTE msg_type;
83 T_pdi_prepare_ccdmsg pdi_prepare_ccdmsg;
84 char** primmbr;
85 } T_PDI_DECODEINFO;
86
87
88 /*
89 * internal context data
90 */
91 typedef short T_PDI_PdEntityTable[16];
92 typedef struct
93 {
94 T_PDI_PdEntityTable PdEntityTable;
95 T_PDI_DECODEINFO*** PrimDecodeInfo;
96
97 T_PDI_DECODEINFO *dinfo;
98 USHORT sap;
99 USHORT opc;
100 UBYTE dir;
101 USHORT pmtx;
102
103 unsigned char sapi;
104 ULONG mtypeval[PDI_MAXPMEMFORMTYPE];
105 int mtypenum;
106 UBYTE* mi_length;
107 } T_PDI_CONTEXT;
108
109 typedef struct
110 {
111 enum {PDI_NONE, PDI_CCDMSG} decodetype;
112 union _pdi
113 {
114 T_PDI_CCDMSG ccdmsg;
115 } pdi;
116 } T_PDI;
117
118
119 #if !defined (CCDDATA_PREF)
120 #if defined (_WIN32_) && defined (CCDDATA_LOAD)
121 #define CCDDATA_PREF(pdi_fun) cddl_##pdi_fun
122 #else
123 #define CCDDATA_PREF(pdi_fun) pdi_fun
124 #endif /* _WIN32_ && CCDDATA_LOAD */
125 #endif /* !CCDDATA_PREF */
126
127 /*
128 * create new default context
129 */
130 T_PDI_CONTEXT* CCDDATA_PREF(pdi_createDefContext)();
131
132 /*
133 * create new context
134 */
135 T_PDI_CONTEXT* CCDDATA_PREF(pdi_createContext)(const T_PDI_DECODEINFO *dinfop, unsigned int dicount);
136
137 /*
138 * destroy context
139 */
140 void CCDDATA_PREF(pdi_destroyContext)(T_PDI_CONTEXT *context);
141
142 /*
143 * mark the begin of a new primitive
144 */
145 void CCDDATA_PREF(pdi_startPrim)(T_PDI_CONTEXT *context, ULONG opc);
146
147 /*
148 * returns extended decode information for a given
149 * ccdedit element descriptor
150 */
151 void CCDDATA_PREF(pdi_getDecodeInfo)(T_PDI_CONTEXT *context, const char *ename,
152 char *evalue, int evlen, T_PDI *decinfo);
153
154 short CCDDATA_PREF(pdi_getEntityByPD)(const T_PDI_CONTEXT *context, unsigned char pd);
155
156 const char* CCDDATA_PREF(pdi_pd2name)(unsigned char pd);
157
158 #endif // __PDI_H__