Add a function to get all pcap loop
[platform/core/connectivity/stc-manager.git] / src / stc-manager-plugin-pcap.c
index 395031c..dc96424 100755 (executable)
@@ -118,8 +118,8 @@ int stc_plugin_pcap_find_alldevs(void)
        return stc_plugin->find_alldevs();
 }
 
-int stc_plugin_pcap_register_loop_pcap(const char *ifname,
-                       int group)
+int stc_plugin_pcap_register_loop(const char *ifname,
+                       int nflog_group)
 {
        if (!stc_plugin_enabled) {
                if (STC_DEBUG_LOG)
@@ -133,11 +133,11 @@ int stc_plugin_pcap_register_loop_pcap(const char *ifname,
                return STC_ERROR_UNINITIALIZED;
        }
 
-       return stc_plugin->register_loop_pcap(ifname, group);
+       return stc_plugin->register_loop(ifname, nflog_group);
 }
 
-int stc_plugin_pcap_unregister_loop_pcap(const char *ifname,
-                       int group)
+int stc_plugin_pcap_unregister_loop(const char *ifname,
+                       int nflog_group)
 {
        if (!stc_plugin_enabled) {
                if (STC_DEBUG_LOG)
@@ -151,6 +151,23 @@ int stc_plugin_pcap_unregister_loop_pcap(const char *ifname,
                return STC_ERROR_UNINITIALIZED;
        }
 
-       return stc_plugin->unregister_loop_pcap(ifname, group);
+       return stc_plugin->unregister_loop(ifname, nflog_group);
+}
+
+int stc_plugin_pcap_get_all_loop(GVariantBuilder *builder)
+{
+       if (!stc_plugin_enabled) {
+               if (STC_DEBUG_LOG)
+                       STC_LOGE("Plugin wasn't enabled");
+               return STC_ERROR_UNINITIALIZED;
+       }
+
+       if (!stc_plugin) {
+               if (STC_DEBUG_LOG)
+                       STC_LOGE("Plugin wasn't loaded");
+               return STC_ERROR_UNINITIALIZED;
+       }
+
+       return stc_plugin->get_all_loop(builder);
 }
 //LCOV_EXCL_STOP