summaryrefslogtreecommitdiff
path: root/src/adaptor_util.h
blob: a763c3af9cfb461b2ce386b0a687be25eab3c992 (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
/**
 * @file        adaptor_api.h
 * @brief       API interface server

 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
 * This software is the confidential and proprietary information
 * of Samsung Electronics, Inc. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Samsung.
 */

#ifndef __ADAPTOR_UTIL_H__
#define __ADAPTOR_UTIL_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "sa_types.h"

	typedef enum {
		SA_START_LAUNCHER_SVC = 0,	/**< start launcher service */
		SA_RESTART_DOCKERD,			/**< restart docker engine */
		SA_STOP_DOCKERD,			/**< stop docker engine */
		SA_CMD_UNKNOWN
	} sa_interface_cmd_e;

/**
 * @fn        void *setting_main_thread(void *pv)
 * @brief     send message to launcher with predefined command
 * @param     sa_interface_cmd_e cmd - command
 * @return    return if connection is completed succefully ( 0:success, -1 : fail)
 */
	int send_message_to_launcher(sa_interface_cmd_e cmd);

/**
 * @fn        int CLI_command(char *cmd, int fgetOutput, char *ret_buf)
 * @brief     This function to run command for daemon
 * @param     *cmd   [in] command to run
 * @param     fgetoutput   [in] flag to get ouput of the command
 * @param     * ret_buf   [in] output of the command
 * @return    int   return of function
 */
	int CLI_command(char *cmd, int fgetoutput, char **ret_buf);

#ifdef __cplusplus
}
#endif
#endif							/* __ADAPTOR_UTIL_H__ */