--- /dev/null
+/*
+ * Network Monitoring Module
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * 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.
+ *
+ */
+
+/**
+
+ * This file declares functions for ARPing.
+ *
+ * @file inm-icmp-ping.h
+ * @author Jiung Yu (jiung.yu@samsung.com)
+ * @version 0.1
+ */
+#ifndef __INM_ICMP_PING_H__
+#define __INM_ICMP_PING_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ INM_ICMP_PING_ERROR_NONE = 0,
+ INM_ICMP_PING_ERROR_NOT_INITIALIZED,
+ INM_ICMP_PING_ERROR_INVALID_PARAM,
+ INM_ICMP_PING_ERROR_OPERATION_FAILED,
+ INM_ICMP_PING_ERROR_IN_PROGRESS,
+
+} inm_icmp_ping_error_e;
+
+typedef void (*icmp_ping_callback) (gboolean found, gchar *ip, gpointer user_data);
+
+int inm_icmp_ping_init();
+int inm_icmp_ping_deinit();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __INM_ICMP_H__ */
+
--- /dev/null
+/*
+ * Network Monitoring Module
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * 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.
+ *
+ */
+
+/**
+ * This file implements ICMP functions.
+ *
+ * @file inm-icmp.c
+ * @author Jiung Yu (jiung.yu@samsung.com)
+ * @version 0.1
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <errno.h>
+
+#include <glib.h>
+
+#include "inm-manager-log.h"
+#include "inm-util.h"
+#include "inm-icmp-ping.h"
+
+typedef struct {
+ gboolean in_progress;
+
+ guint user_timeout;
+ guint interval;
+ gint count;
+ gint received;
+
+ guint icmp_user_timer_source_id;
+ guint icmp_interval_timer_source_id;
+
+ gchar *target_ip;
+
+ icmp_ping_callback cb;
+ gpointer cb_user_data;
+} icmp_ping_data_s;
+
+GData *icmp_ping_dl;
+gboolean icmp_ping_init;
+
+#define DEFAULT_INTERVAL 1
+#define DEFAULT_TIMEOUT 0
+#define DEFAULT_COUNT 10
+
+#define RET_ERR_IF_NOT_INIT()\
+ do {\
+ if (!icmp_ping_init) {\
+ __INM_FUNC_EXIT__;\
+ return INM_ICMP_ERROR_NOT_INITIALIZED;\
+ }\
+ } while (0)
+#define RET_ERR_IF_DATA_NOT_FOUND(ping_data)\
+ do {\
+ if (!(ping_data)) {\
+ INM_LOGI("ping_data not found");\
+ __INM_FUNC_EXIT__;\
+ return INM_ICMP_ERROR_OPERATION_FAILED;\
+ }\
+ } while (0)
+
+int inm_icmp_ping_init()
+{
+ gint ret = INM_ICMP_PING_ERROR_NONE;
+
+ __INM_FUNC_ENTER__;
+
+ icmp_ping_init = TRUE;
+ g_datalist_init(&(icmp_ping_dl));
+
+ __INM_FUNC_EXIT__;
+ return ret;
+}
+
+int inm_icmp_ping_deinit()
+{
+ gint ret = INM_ICMP_PING_ERROR_NONE;
+
+ __INM_FUNC_ENTER__;
+
+ if (!icmp_ping_init)
+ return INM_ICMP_PING_ERROR_NOT_INITIALIZED;
+
+ icmp_ping_init = FALSE;
+ g_datalist_clear(&(icmp_ping_dl));
+
+ __INM_FUNC_EXIT__;
+ return ret;
+}