summaryrefslogtreecommitdiff
path: root/include/service-adapter/sa_command_internal.h
blob: 707d2e93d7678fc6f89268fb03e82b58e90e9078 (plain)
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
/*
 * oma-ds-agent
 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 *   @SA_Command_Internal.h
 *   @version									0.1
 *   @brief										This file is the header file that structure which is available in SA is defined
 *													Command (Alert, Results, Sync, Put, Get, Map, Add, Replace, Delete)
 *													Status
 */

#ifndef SA_COMMAND_INTERNAL_H_
#define SA_COMMAND_INTERNAL_H_

#include "service-adapter/sa_define.h"
#include "common/common_define.h"

typedef struct {
	alert_type_e type;
	anchor_s *anchor;
	char *content_type;
	unsigned int max_obj_size;
} command_alert_private_s;

typedef struct {
	unsigned int num_changed;
	int max_obj_size;
	int has_num_changed;
	mem_s *mem;
} command_sync_private_s;

typedef struct {
	char *type;
	item_s *item;
} command_access_private_s;

typedef struct {
	GList *items;
	change_type_e type;
} command_change_private_s;

typedef struct {
	GList *items;
} command_map_private_s;

typedef struct {
	unsigned int msg_ref;
	unsigned int cmd_ref;
	location_s *target_ref;
	char *type;
	item_s *item;
} command_results_private_s;

typedef union {
	command_alert_private_s alert;
	command_sync_private_s sync;
	command_access_private_s access;	/*put or get */
	command_change_private_s change;
	command_map_private_s map;
	command_results_private_s results;
} command_private_u;

struct command {
	int ref_count;
	command_type_e type;
	unsigned int cmd_id;
	unsigned int msg_id;
	command_private_u private;
	location_s *source;
	location_s *target;
	cred_s *cred;
	int no_resp;
};

struct status {
	unsigned int cmd_id;
	unsigned int msg_ref;
	unsigned int cmd_ref;
	command_type_e type;
	char *data;
	location_s *source_ref;
	location_s *target_ref;
	cred_s *cred;
	chal_s *chal;
	item_s *item;
};

#endif				/* SA_COMMAND_INTERNAL_H_ */