8c2952457
김태훈
응용 프로그램 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
#ifndef _IPC_CALL_H_
#define _IPC_CALL_H_
#define IPC_CALL_UDS_NAME_FORMAT "/tmp/ipc_%03ld.uds"
#define IPC_CALL_PACKET_HEADER_LEN (16)
#define IPC_CALL_BUF_LEN (4096-IPC_CALL_PACKET_HEADER_LEN)
#define IPC_CALL_TIMEOUT_UNLIMIT 0xffffffff
typedef void (*ipc_call_func_t)(unsigned long src_id, unsigned long msg_type, void *buf, int len );
typedef struct {
unsigned long dst_id;
unsigned long src_id;
unsigned long msg_type;
unsigned long size;
char buf[IPC_CALL_BUF_LEN];
} ipc_call_packet_t;
#define IPC_CALL_OK 0
#define IPC_CALL_E_AGAIN -1
#define IPC_CALL_E_TIME_OUT -2
#define IPC_CALL_E_BUSY -3
#define IPC_CALL_E_NO_ID -4
#define IPC_CALL_E_EMPTY -5
#define IPC_CALL_GET_GROUP(x) (((x)>>16)&0xFFFF)
#define IPC_CALL_GET_PORT(x) (((x)>> 0)&0xFFFF)
#define IPC_CALL_METHOD_FABIND 0
#define IPC_CALL_METHOD_UDS 1
#define IPC_CALL_METHOD_UDP 2
#define IPC_CALL_METHOD_NONE -1
#define IPC_CALL_MSG_TYPE_BIN 0
#define IPC_CALL_MSG_TYPE_XML 1
#define IPC_CALL_MSG_TYPE_ASC 2
#define IPC_CALL_LEVEL_DEFAULT 0
#define IPC_CALL_TIMEOUT_DEFAULT 1000
#ifdef __cplusplus
extern "C" {
#endif
int ipc_call_create ( unsigned long id );
int ipc_call_free ( unsigned long id );
int ipc_call_method ( unsigned long method );
int ipc_call_level ( unsigned long level );
int ipc_call_level_default ( unsigned long level );
int ipc_call_timeout ( unsigned long msec );
int ipc_call_timeout_default( unsigned long msec );
int ipc_call_on_read ( ipc_call_func_t *func );
int ipc_call_read ( void *buf, int len );
int ipc_call_send ( unsigned long dest, void *buf, int len, unsigned long msg_type );
int ipc_call_send_xml ( unsigned long dest, char *buf, int len );
int ipc_call_send_asc ( unsigned long dest, char *buf, int len );
int ipc_call_rpc ( unsigned long dest, void *tbuf, int tlen , void *rbuf, int rlen );
int ipc_call_rpc_xml ( unsigned long dest, void *tbuf, int tlen , void *rbuf, int rlen );
int ipc_call_rpc_asc ( unsigned long dest, void *tbuf, int tlen , void *rbuf, int rlen );
#ifdef __cplusplus
}
#endif
#endif
|