Index: uspace/app/pcapcat/eth_parser.c
===================================================================
--- uspace/app/pcapcat/eth_parser.c	(revision caac05282f39a0eb12a799cdc11f53fa8229f95d)
+++ uspace/app/pcapcat/eth_parser.c	(revision 46e215263cd3d16caa96273a6ab8a25278514d03)
@@ -69,4 +69,20 @@
 #define BIG_END_16(buffer, idx) buffer[idx] << BYTE_SIZE | buffer[idx + 1]
 
+/** Offsets of interesting fields in packet. */
+
+#define ARP_SENDER_MAC      22
+#define ARP_SENDER_IP       28
+#define ARP_TARGET_MAC      32
+#define ARP_TARGET_IP       38
+
+#define TCP_SRC_PORT        34
+#define TCP_DST_PORT        36
+
+#define IP_HEADER_LEN       14
+#define IP_TOTAL_LEN        16
+#define IP_PROTOCOL         23
+#define IP_SRC_ADDR         26
+#define IP_DST_ADDR         30
+
 /** Read count bytes from char buffer.
  *  @param buffer       of bytes to read from.
@@ -88,9 +104,5 @@
 static void parse_arp(unsigned char *buffer, size_t size)
 {
-    size_t sender_mac_offset = 22;
-    size_t sender_ip_offset = 28;
-    size_t target_mac_offset = 32;
-    size_t target_ip_offset = 38;
-    if (size < target_ip_offset + IPV4_ADDR_SIZE) {
+    if (size < ARP_TARGET_IP + IPV4_ADDR_SIZE) {
         printf("%s %s", ARP_TEXT, MALFORMED_PACKET);
         return;
@@ -102,8 +114,8 @@
     uint8_t target_ip[IPV4_ADDR_SIZE];
 
-    read_from_buffer(buffer, sender_mac_offset, ETH_ADDR_SIZE, sender_mac);
-    read_from_buffer(buffer, sender_ip_offset, IPV4_ADDR_SIZE, sender_ip);
-    read_from_buffer(buffer, target_mac_offset, ETH_ADDR_SIZE, target_mac);
-    read_from_buffer(buffer, target_ip_offset, IPV4_ADDR_SIZE, target_ip);
+    read_from_buffer(buffer, ARP_SENDER_MAC, ETH_ADDR_SIZE, sender_mac);
+    read_from_buffer(buffer, ARP_SENDER_IP, IPV4_ADDR_SIZE, sender_ip);
+    read_from_buffer(buffer, ARP_TARGET_MAC, ETH_ADDR_SIZE, target_mac);
+    read_from_buffer(buffer, ARP_TARGET_IP, IPV4_ADDR_SIZE, target_ip);
 
     PRINT_MAC("Sender", sender_mac, ", ");
@@ -119,14 +131,11 @@
 static void parse_tcp(unsigned char *buffer, size_t size)
 {
-    size_t src_port_offset = 34;
-    size_t dst_port_offset = 36;
-
-    if (size < dst_port_offset + TCP_PORT_SIZE) {
+    if (size < TCP_DST_PORT + TCP_PORT_SIZE) {
         printf("%s %s\n", TCP_TEXT, MALFORMED_PACKET);
         return;
     }
 
-    uint16_t src_port = BIG_END_16(buffer, src_port_offset);
-    uint16_t dst_port = BIG_END_16(buffer, dst_port_offset);
+    uint16_t src_port = BIG_END_16(buffer, TCP_SRC_PORT);
+    uint16_t dst_port = BIG_END_16(buffer, TCP_DST_PORT);
     printf("      [%s] source port: %d, destination port: %d\n", TCP_TEXT, src_port, dst_port);
 }
@@ -146,22 +155,16 @@
     uint8_t dst_ip[IPV4_ADDR_SIZE];
 
-    size_t hdr_length_offset = 14;
-    size_t total_len_offset = 16;
-    size_t protocol_offset = 23;
-    size_t src_ip_offset = 26;
-    size_t dst_ip_offset = 30;
-
-    if (size < dst_ip_offset + IPV4_ADDR_SIZE) {
+    if (size < IP_DST_ADDR + IPV4_ADDR_SIZE) {
         printf("%s %s", IP_TEXT, MALFORMED_PACKET);
         return;
     }
 
-    header_length = (buffer[hdr_length_offset] & LOWER_4_BITS) * HDR_SIZE_COEF;
-    total_length = BIG_END_16(buffer, total_len_offset);
+    header_length = (buffer[IP_HEADER_LEN] & LOWER_4_BITS) * HDR_SIZE_COEF;
+    total_length = BIG_END_16(buffer, IP_TOTAL_LEN);
     payload_length = total_length - header_length;
-    ip_protocol = buffer[protocol_offset];
-
-    read_from_buffer(buffer, src_ip_offset, IPV4_ADDR_SIZE, src_ip);
-    read_from_buffer(buffer, dst_ip_offset, IPV4_ADDR_SIZE, dst_ip);
+    ip_protocol = buffer[IP_PROTOCOL];
+
+    read_from_buffer(buffer, IP_SRC_ADDR, IPV4_ADDR_SIZE, src_ip);
+    read_from_buffer(buffer, IP_DST_ADDR, IPV4_ADDR_SIZE, dst_ip);
 
     printf("%s header: %dB, payload: %dB, protocol: 0x%x, ", IP_TEXT, header_length, payload_length, ip_protocol);
@@ -250,6 +253,4 @@
         read_bytes = fread(&hdr, 1, sizeof(pcap_packet_header_t), pcap_file);
     }
-
-    fclose(pcap_file);
 }
 
Index: uspace/app/pcapcat/main.c
===================================================================
--- uspace/app/pcapcat/main.c	(revision caac05282f39a0eb12a799cdc11f53fa8229f95d)
+++ uspace/app/pcapcat/main.c	(revision 46e215263cd3d16caa96273a6ab8a25278514d03)
@@ -86,4 +86,6 @@
     parsers[parser_index].parse_file_header(&hdr);
     parsers[parser_index].parse_packets(f, packet_count, verbose_flag);
+
+    fclose(f);
     return 0;
 }
Index: uspace/app/pcapctl/main.c
===================================================================
--- uspace/app/pcapctl/main.c	(revision caac05282f39a0eb12a799cdc11f53fa8229f95d)
+++ uspace/app/pcapctl/main.c	(revision 46e215263cd3d16caa96273a6ab8a25278514d03)
@@ -115,6 +115,6 @@
 	{ "append", required_argument, 0, 'A' }, /* file as argument and ops 0 if not exist and 2 if exists */
 	{ "new", required_argument, 0, 'N' }, /* file name as argument */
-	{ "truncated", required_argument, 0, 'T' }, // truncated ops
-	{ "usb", required_argument, 0, 'U' }, //??
+	{ "truncated", required_argument, 0, 'T' }, /* file as an argument with device 0 and dump truncated packets (for debugging purposes) */
+	{ "usb", required_argument, 0, 'U' }, /* todo: dump usb packets (not fully implemnted)*/
 	{ "device", required_argument, 0, 'd' },
 	{ "list", no_argument, 0, 'l' },
@@ -148,4 +148,10 @@
 	    NAME " --list | -l \n"
 	    "\tList of devices\n"
+		NAME " --new= | -N <outfile>\n"
+		"\tStart dumping with ops - 0, on device - 0\n"
+		NAME " --append= | -A <outfile>\n"
+		"\tContinue dumping on device - 0 to already existing file\n"
+		NAME " --truncated= | -T <outfile>\n"
+		"\tStart dumping truncated packets to file on device - 0\n"
 	    NAME " --start | -r --device= | -d <device number from list> --outfile= | -o <outfile> --ops= | p <ops index>\n"
 	    "\tPackets dumped from device will be written to <outfile>\n"
Index: uspace/lib/pcap/src/pcap_dumper.c
===================================================================
--- uspace/lib/pcap/src/pcap_dumper.c	(revision caac05282f39a0eb12a799cdc11f53fa8229f95d)
+++ uspace/lib/pcap/src/pcap_dumper.c	(revision 46e215263cd3d16caa96273a6ab8a25278514d03)
@@ -227,8 +227,7 @@
 {
 	fibril_mutex_lock(&dumper->mutex);
-	errno_t rc = EOK;
 	dumper->writer.ops = &ops[index];
 	fibril_mutex_unlock(&dumper->mutex);
-	return rc;
+	return EOK;
 }
 
