Index: uspace/app/pcapctl/main.c
===================================================================
--- uspace/app/pcapctl/main.c	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/app/pcapctl/main.c	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -52,5 +52,9 @@
 	}
 
-	pcapctl_dump_start(name, sess);
+	rc = pcapctl_dump_start(name, sess);
+	if (rc != EOK)
+	{
+		printf("Starting the dumping was not successful.\n");
+	}
 	pcapctl_dump_close(sess);
 	return EOK;
@@ -64,5 +68,27 @@
 		return 1;
 	}
-	pcapctl_dump_stop(sess);
+	rc = pcapctl_dump_stop(sess);
+	if (rc != EOK)
+	{
+		printf("Stoping the dumping was not successful.\n");
+	}
+	pcapctl_dump_close(sess);
+	return EOK;
+}
+
+static errno_t set_dumper_ops(int *dev_number, const char *name)
+{
+	pcapctl_sess_t *sess = NULL;
+	errno_t rc = pcapctl_dump_open(dev_number, &sess);
+	if (rc != EOK)
+	{
+		return rc;
+	}
+
+	rc = pcapctl_dump_set_ops(name, sess);
+	if (rc != EOK)
+	{
+		printf("Setting dumper ops was not successful.\n");
+	}
 	pcapctl_dump_close(sess);
 	return EOK;
@@ -84,4 +110,5 @@
 	{ "start", no_argument, 0, 'r' },
 	{ "stop", no_argument, 0, 't' },
+	{ "ops", required_argument, 0, 'o' },
 	{ 0, 0, 0, 0 }
 };
@@ -106,6 +133,8 @@
 	bool start = false;
 	bool stop = false;
+	bool set_ops = false;
 	int dev_number = -1;
 	const char *output_file_name = "";
+	const char *ops_name = "";
 	int idx = 0;
 	int ret = 0;
@@ -142,4 +171,8 @@
 			stop = true;
 			break;
+		case 'o':
+			set_ops = true;
+			ops_name = optarg;
+			break;
 		}
 	}
@@ -154,4 +187,8 @@
 		stop_dumping(&dev_number);
 	}
+	else if (set_ops)
+	{
+		set_dumper_ops(&dev_number, ops_name);
+	}
 	return 0;
 }
Index: uspace/lib/nic/include/nic.h
===================================================================
--- uspace/lib/nic/include/nic.h	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/lib/nic/include/nic.h	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -44,5 +44,5 @@
 #include <device/hw_res_parsed.h>
 #include <ops/nic.h>
-#include <pcap_iface.h>
+#include <pcap_dumper.h>
 
 #define DEVICE_CATEGORY_NIC "nic"
Index: uspace/lib/nic/src/nic_driver.c
===================================================================
--- uspace/lib/nic/src/nic_driver.c	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/lib/nic/src/nic_driver.c	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -562,5 +562,5 @@
 		fibril_rwlock_write_unlock(&nic_data->stats_lock);
 	}
-	pcapdump_packet(nic_get_pcap_iface(nic_data), frame->data, frame->size);
+	//pcapdump_packet(nic_get_pcap_iface(nic_data), frame->data, frame->size);
 	nic_release_frame(nic_data, frame);
 }
Index: uspace/lib/nic/src/nic_impl.c
===================================================================
--- uspace/lib/nic/src/nic_impl.c	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/lib/nic/src/nic_impl.c	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -180,5 +180,5 @@
 		return EBUSY;
 	}
-	//pcapdump_packet(nic_get_pcap_iface(nic_data), data, size);
+	pcapdump_packet(nic_get_pcap_iface(nic_data), data, size);
 	nic_data->send_frame(nic_data, data, size);
 	fibril_rwlock_read_unlock(&nic_data->main_lock);
Index: uspace/lib/pcap/include/pcap_dumper.h
===================================================================
--- uspace/lib/pcap/include/pcap_dumper.h	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
+++ uspace/lib/pcap/include/pcap_dumper.h	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2023 Nataliia Korop
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libpcap
+ * @{
+ */
+/** @file pcap interface
+ */
+
+#ifndef PCAP_IFACE_H_
+#define PCAP_IFACE_H_
+
+#include <errno.h>
+#include <fibril_synch.h>
+#include "pcap.h"
+
+typedef struct pcap_dumper {
+	fibril_mutex_t mutex;
+	bool to_dump;
+	pcap_writer_t writer;
+} pcap_dumper_t;
+
+extern void pcap_dumper_stop(struct pcap_dumper *);
+extern errno_t pcap_dumper_init(pcap_dumper_t *);
+extern errno_t pcap_dumper_set_ops(struct pcap_dumper *, const char *);
+extern errno_t pcap_dumper_start(struct pcap_dumper *, const char *);
+extern void pcap_dumper_add_packet(struct pcap_dumper *, const void *data, size_t size);
+
+#endif
+/** @}
+ */
Index: pace/lib/pcap/include/pcap_iface.h
===================================================================
--- uspace/lib/pcap/include/pcap_iface.h	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*
- * Copyright (c) 2023 Nataliia Korop
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libpcap
- * @{
- */
-/** @file pcap interface
- */
-
-#ifndef PCAP_IFACE_H_
-#define PCAP_IFACE_H_
-
-#include <errno.h>
-#include <fibril_synch.h>
-#include "pcap.h"
-
-typedef struct pcap_dumper {
-	fibril_mutex_t mutex;
-	bool to_dump;
-	pcap_writer_t writer;
-} pcap_dumper_t;
-
-extern void pcap_dumper_stop(struct pcap_dumper *);
-extern errno_t pcap_dumper_init(pcap_dumper_t *);
-
-// v ramci init jeste linktype prg
-//set snaplen taky lze pridavat prg
-
-extern errno_t pcap_dumper_start(struct pcap_dumper *, const char *);
-extern void pcap_dumper_add_packet(struct pcap_dumper *, const void *data, size_t size);
-
-#endif
-/** @}
- */
Index: uspace/lib/pcap/include/pcapctl_dump.h
===================================================================
--- uspace/lib/pcap/include/pcapctl_dump.h	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/lib/pcap/include/pcapctl_dump.h	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -49,7 +49,8 @@
 } pcapctl_sess_t;
 
-extern errno_t pcapctl_dump_open(int *, pcapctl_sess_t **rsess);
-extern errno_t pcapctl_dump_close(pcapctl_sess_t *sess);
+extern errno_t pcapctl_dump_open(int *, pcapctl_sess_t **);
+extern errno_t pcapctl_dump_close(pcapctl_sess_t *);
 extern errno_t pcapctl_dump_start(const char *, pcapctl_sess_t *);
+extern errno_t pcapctl_dump_set_ops(const char *, pcapctl_sess_t *);
 extern errno_t pcapctl_dump_stop(pcapctl_sess_t *);
 extern errno_t pcapctl_list(void);
Index: uspace/lib/pcap/include/pcapdump_iface.h
===================================================================
--- uspace/lib/pcap/include/pcapdump_iface.h	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/lib/pcap/include/pcapdump_iface.h	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -40,10 +40,11 @@
 
 #include <errno.h>
-#include "pcap_iface.h"
+#include "pcap_dumper.h"
 
 typedef enum {
 	PCAP_CONTROL_SET_START = IPC_FIRST_USER_METHOD,
 	PCAP_CONTROL_SET_STOP,
-	PCAP_CONTROL_GET_NAME
+	PCAP_CONTROL_GET_NAME,
+	PCAP_CONTROL_SET_OPS,
 } pcap_request_t;
 
Index: uspace/lib/pcap/meson.build
===================================================================
--- uspace/lib/pcap/meson.build	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/lib/pcap/meson.build	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -29,5 +29,5 @@
 src = files(
     'src/pcap.c',
-    'src/pcap_iface.c',
+    'src/pcap_dumper.c',
     'src/pcapdump_iface.c',
     'src/pcapctl_dump.c',
Index: uspace/lib/pcap/src/pcap.c
===================================================================
--- uspace/lib/pcap/src/pcap.c	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/lib/pcap/src/pcap.c	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -72,6 +72,5 @@
 void pcap_writer_add_packet(pcap_writer_t *writer, const void *captured_packet, size_t size)
 {
-	if (!writer->data)
-		return;
+
 	pcap_packet_header_t pcap_packet;
 	pcap_set_time(&pcap_packet);
Index: uspace/lib/pcap/src/pcap_dumper.c
===================================================================
--- uspace/lib/pcap/src/pcap_dumper.c	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
+++ uspace/lib/pcap/src/pcap_dumper.c	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2023 Nataliia Korop
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libpcap
+ * @{
+ */
+/** @file
+ *  @brief pcap inteface: Dumping interface for the device which packets we want to dump
+ */
+
+#include <errno.h>
+#include <str.h>
+#include "pcap_dumper.h"
+
+static size_t pcap_file_w32(pcap_writer_t *writer, uint32_t data)
+{
+	return fwrite(&data, 1, 4, (FILE *)writer->data);
+}
+
+static size_t pcap_file_w16(pcap_writer_t *writer, uint16_t data)
+{
+	return fwrite(&data, 1, 2, (FILE *)writer->data);
+}
+
+static size_t pcap_file_wbuffer(pcap_writer_t *writer, const void *data, size_t size)
+{
+	assert(writer->data);
+	return fwrite(data, 1, size, (FILE *)writer->data);
+}
+
+static void pcap_file_close(pcap_writer_t *writer)
+{
+	fclose((FILE *)writer->data);
+	writer->data = NULL;
+}
+
+static pcap_writer_ops_t file_ops = {
+
+	.write_u32 = &pcap_file_w32,
+	.write_u16 = &pcap_file_w16,
+	.write_buffer = &pcap_file_wbuffer,
+	.close = &pcap_file_close
+};
+
+static size_t pcap_short_file_w32(pcap_writer_t *writer, uint32_t data)
+{
+	return fwrite(&data, 1, 4, (FILE *)writer->data);
+}
+
+static size_t pcap_short_file_w16(pcap_writer_t *writer, uint16_t data)
+{
+	return fwrite(&data, 1, 2, (FILE *)writer->data);
+}
+
+static size_t pcap_short_file_wbuffer(pcap_writer_t *writer, const void *data, size_t size)
+{
+	return fwrite(data, 1, size<60?size:60, (FILE *)writer->data);
+}
+
+static void pcap_short_file_close(pcap_writer_t *writer)
+{
+	fclose((FILE *)writer->data);
+}
+
+static pcap_writer_ops_t short_file_ops = {
+	.write_u32 = &pcap_short_file_w32,
+	.write_u16 = &pcap_short_file_w16,
+	.write_buffer = &pcap_short_file_wbuffer,
+	.close = &pcap_short_file_close
+
+};
+
+errno_t pcap_dumper_start(struct pcap_dumper *dumper, const char *name)
+{
+	fibril_mutex_lock(&dumper->mutex);
+
+	/** When try to start when already started, close current and starts new */
+	if (dumper->to_dump) {
+		pcap_dumper_stop(dumper);
+	}
+	errno_t rc = pcap_writer_to_file_init(&dumper->writer, name);
+	if (rc == EOK) {
+		dumper->to_dump = true;
+	} else {
+		printf("Failed creating pcap dumper: %s", str_error(rc));
+	}
+	fibril_mutex_unlock(&dumper->mutex);
+	return rc;
+}
+
+errno_t pcap_dumper_set_ops(struct pcap_dumper *dumper, const char *name)
+{
+	fibril_mutex_lock(&dumper->mutex);
+	errno_t rc = EOK;
+	if (!str_cmp(name, "short_file"))
+	{
+		dumper->writer.ops = &short_file_ops;
+	}
+	else if (!str_cmp(name, "full_file"))
+	{
+		dumper->writer.ops = &file_ops;
+	}
+	else
+	{
+		rc = EINVAL;
+	}
+	fibril_mutex_unlock(&dumper->mutex);
+	return rc;
+}
+
+
+void pcap_dumper_add_packet(struct pcap_dumper *dumper, const void *data, size_t size)
+{
+	fibril_mutex_lock(&dumper->mutex);
+
+	if (!dumper->to_dump) {
+		fibril_mutex_unlock(&dumper->mutex);
+		return;
+	}
+
+	pcap_writer_add_packet(&dumper->writer, data, size);
+	fibril_mutex_unlock(&dumper->mutex);
+}
+
+void pcap_dumper_stop(struct pcap_dumper *dumper)
+{
+	fibril_mutex_lock(&dumper->mutex);
+
+	/** If want to stop, when already stopped, do nothing */
+	if (!dumper->to_dump) {
+		fibril_mutex_unlock(&dumper->mutex);
+		return;
+	}
+	dumper->to_dump = false;
+	dumper->writer.ops->close(&dumper->writer);
+	fibril_mutex_unlock(&dumper->mutex);
+}
+
+/** Initialize interface for dumping packets
+ *
+ * @param dumper Device dumping interface
+ *
+ */
+errno_t pcap_dumper_init(pcap_dumper_t *dumper)
+{
+	fibril_mutex_initialize(&dumper->mutex);
+	dumper->to_dump = false;
+	dumper->writer.ops = NULL;
+	return EOK;
+}
+
+/** @}
+ */
Index: pace/lib/pcap/src/pcap_iface.c
===================================================================
--- uspace/lib/pcap/src/pcap_iface.c	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ 	(revision )
@@ -1,156 +1,0 @@
-/*
- * Copyright (c) 2023 Nataliia Korop
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libpcap
- * @{
- */
-/** @file
- *  @brief pcap inteface: Dumping interface for the device which packets we want to dump
- */
-
-#include <errno.h>
-#include "pcap_iface.h"
-
-static size_t pcap_file_w32(pcap_writer_t *writer, uint32_t data)
-{
-	return fwrite(&data, 1, 4, (FILE *)writer->data);
-}
-
-static size_t pcap_file_w16(pcap_writer_t *writer, uint16_t data)
-{
-	return fwrite(&data, 1, 2, (FILE *)writer->data);
-}
-
-static size_t pcap_file_wbuffer(pcap_writer_t *writer, const void *data, size_t size)
-{
-	return fwrite(data, 1, size, (FILE *)writer->data);
-}
-
-static void pcap_file_close(pcap_writer_t *writer)
-{
-	fclose((FILE *)writer->data);
-}
-
-static pcap_writer_ops_t file_ops = {
-
-	.write_u32 = &pcap_file_w32,
-	.write_u16 = &pcap_file_w16,
-	.write_buffer = &pcap_file_wbuffer,
-	.close = &pcap_file_close
-};
-
-// static size_t pcap_short_file_w32(pcap_writer_t *writer, uint32_t data)
-// {
-// 	return fwrite(&data, 1, 4, (FILE *)writer->data);
-// }
-
-// static size_t pcap_short_file_w16(pcap_writer_t *writer, uint16_t data)
-// {
-// 	return fwrite(&data, 1, 2, (FILE *)writer->data);
-// }
-
-// static size_t pcap_short_file_wbuffer(pcap_writer_t *writer, const void *data, size_t size)
-// {
-// 	return fwrite(data, 1, size<60?size:60, (FILE *)writer->data);
-// }
-
-// static void pcap_short_file_close(pcap_writer_t *writer)
-// {
-// 	fclose((FILE *)writer->data);
-// }
-
-// static pcap_writer_ops_t short_file_ops = {
-// 	.write_u32 = &pcap_short_file_w32,
-// 	.write_u16 = &pcap_short_file_w16,
-// 	.write_buffer = &pcap_short_file_wbuffer,
-// 	.close = &pcap_short_file_close
-
-// };
-
-errno_t pcap_dumper_start(struct pcap_dumper *dumper, const char *name)
-{
-	fibril_mutex_lock(&dumper->mutex);
-
-	/** When try to start when already started, close current and starts new */
-	if (dumper->to_dump == true) {
-		pcap_dumper_stop(dumper);
-	}
-	errno_t rc = pcap_writer_to_file_init(&dumper->writer, name);
-	if (rc == EOK) {
-		dumper->to_dump = true;
-	} else {
-		printf("Failed creating pcap dumper: %s", str_error(rc));
-	}
-	fibril_mutex_unlock(&dumper->mutex);
-	return rc;
-}
-
-//udelat globalni
-void pcap_dumper_add_packet(struct pcap_dumper *dumper, const void *data, size_t size)
-{
-	fibril_mutex_lock(&dumper->mutex);
-
-	if (dumper->writer.data == NULL || !dumper->to_dump) {
-		fibril_mutex_unlock(&dumper->mutex);
-		return;
-	}
-	pcap_writer_add_packet(&dumper->writer, data, size);
-	fibril_mutex_unlock(&dumper->mutex);
-}
-
-//udelt globalni
-void pcap_dumper_stop(struct pcap_dumper *dumper)
-{
-	fibril_mutex_lock(&dumper->mutex);
-
-	/** If want to stop, when already stopped, do nothing */
-	if (dumper->to_dump == false) {
-		fibril_mutex_unlock(&dumper->mutex);
-		return;
-	}
-	dumper->to_dump = false;
-	dumper->writer.ops->close(&dumper->writer);
-	dumper->writer.data = NULL;
-	fibril_mutex_unlock(&dumper->mutex);
-}
-
-/** Initialize interface for dumping packets
- *
- * @param dumper Device dumping interface
- *
- */
-errno_t pcap_dumper_init(pcap_dumper_t *dumper)
-{
-	fibril_mutex_initialize(&dumper->mutex);
-	dumper->to_dump = false;
-	dumper->writer.ops = &file_ops;
-	return EOK;
-}
-
-/** @}
- */
Index: uspace/lib/pcap/src/pcapctl_dump.c
===================================================================
--- uspace/lib/pcap/src/pcapctl_dump.c	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/lib/pcap/src/pcapctl_dump.c	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -198,5 +198,5 @@
 	aid_t req = async_send_0(exch, PCAP_CONTROL_SET_START, NULL);
 
-	rc = async_data_write_start(exch, (const void *)name, size);
+	rc = async_data_write_start(exch, name, size);
 
 	pcapctl_dump_exchange_end(exch);
@@ -227,4 +227,26 @@
 }
 
+errno_t pcapctl_dump_set_ops(const char *ops_name, pcapctl_sess_t *sess)
+{
+	errno_t rc;
+	async_exch_t *exch = async_exchange_begin(sess->sess);
+
+	size_t size = str_size(ops_name);
+	aid_t req = async_send_0(exch, PCAP_CONTROL_SET_OPS, NULL);
+
+	rc = async_data_write_start(exch, ops_name, size);
+
+	pcapctl_dump_exchange_end(exch);
+
+	if (rc != EOK) {
+		async_forget(req);
+		return rc;
+	}
+
+	errno_t retval;
+	async_wait_for(req, &retval);
+	return retval;
+}
+
 /** @}
  */
Index: uspace/lib/pcap/src/pcapdump_iface.c
===================================================================
--- uspace/lib/pcap/src/pcapdump_iface.c	(revision f08447b8647b2eb26f43e7993e08f77113274783)
+++ uspace/lib/pcap/src/pcapdump_iface.c	(revision 1d14090b705fa4005fba453cbb74488c510827cc)
@@ -70,4 +70,25 @@
 }
 
+static void pcapdump_set_ops_srv(ipc_call_t *icall, pcap_dumper_t *dumper)
+{
+	char *data;
+	size_t size;
+	errno_t rc = async_data_write_accept((void **) &data, true, 0, 0, 0, &size);
+	if (rc != EOK) {
+		async_answer_0(icall, rc);
+		return;
+	}
+
+	assert(str_length(data) == size && "Data were damaged during transmission.\n");
+
+	rc = pcap_dumper_set_ops(dumper, (const char *)data);
+	free(data);
+	if (rc != EOK) {
+		//TODO what?
+	}
+	async_answer_0(icall, EOK);
+
+}
+
 void pcapdump_conn(ipc_call_t *icall, void *arg)
 {
@@ -94,4 +115,7 @@
 		case PCAP_CONTROL_SET_STOP:
 			pcapdump_stop_srv(&call, dumper);
+			break;
+		case PCAP_CONTROL_SET_OPS:
+			pcapdump_set_ops_srv(&call, dumper);
 			break;
 		default:
