Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master e02304b39 -> 08bfd59f1


MINIFICPP-594: Add CapturePacket to Processors documentation
MINIFICPP-590: Update boolean to not keep source PCAP -- done in testing
for MINIFICPP-590 fix.

This closes #390.

Signed-off-by: Aldrin Piri <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/08bfd59f
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/08bfd59f
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/08bfd59f

Branch: refs/heads/master
Commit: 08bfd59f194070f6ccf75d9a2e291609a9423d90
Parents: e02304b
Author: Marc Parisi <[email protected]>
Authored: Tue Aug 7 10:33:28 2018 -0400
Committer: Aldrin Piri <[email protected]>
Committed: Tue Aug 7 13:23:15 2018 -0400

----------------------------------------------------------------------
 PROCESSORS.md                     | 31 +++++++++++++++++++++++++++++++
 extensions/pcap/CapturePacket.cpp |  3 +--
 2 files changed, 32 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/08bfd59f/PROCESSORS.md
----------------------------------------------------------------------
diff --git a/PROCESSORS.md b/PROCESSORS.md
index 214d2af..8efdc65 100644
--- a/PROCESSORS.md
+++ b/PROCESSORS.md
@@ -19,6 +19,7 @@
 
 - [AppendHostInfo](#appendhostinfo)
 - [ApplyTemplate](#applytemplate)
+- [CapturePacket](#capturepacket)
 - [CompressContent](#compresscontent)
 - [ConsumeMQTT](#consumemqtt)
 - [ConvertHeartBeat](#convertheartbeat)
@@ -99,6 +100,36 @@ default values, and whether a property supports the NiFi 
Expression Language.
 | - | - |
 | success | All FlowFiles are routed to this relationship. |
 
+
+## CapturePacket
+
+### Description
+
+CapturePacket captures and writes one or more packets into a PCAP file that 
will be used as the content
+of a flow file. Configuration options exist to adjust the batching of PCAP 
files. PCAP batching will 
+place a single PCAP into a flow file. A regular expression selects network 
interfaces. Bluetooth 
+network interfaces can be selected through a separate option. 
+
+### Properties
+
+In the list below, the names of required properties appear in bold. Any other
+properties (not in bold) are considered optional. The table also indicates any
+default values, and whether a property supports the NiFi Expression Language.
+
+| Name | Default Value | Allowable Values | Description |
+| - | - | - | - |
+| Base Directory | /tmp/ | | A base directory where pcap files are stored 
temporarily |
+| Batch Size | 50 |  | Number of captured packets written into a PCAP file |
+| Capture Bluetooth | false |  | Captures bluetooth interfaces if true  |
+| Network Controller | .* |  | Regular expression of the network controller(s) 
to which packet capture will be attached|
+
+### Relationships
+
+| Name | Description |
+| - | - |
+| success | All FlowFiles are routed to this relationship. |
+
+
 ## ConvertHeartBeat
 
 This Processor converts MQTT heartbeats into a JSON repreesntation.  

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/08bfd59f/extensions/pcap/CapturePacket.cpp
----------------------------------------------------------------------
diff --git a/extensions/pcap/CapturePacket.cpp 
b/extensions/pcap/CapturePacket.cpp
index f5e7127..82cf4b0 100644
--- a/extensions/pcap/CapturePacket.cpp
+++ b/extensions/pcap/CapturePacket.cpp
@@ -221,9 +221,8 @@ CapturePacket::~CapturePacket() {
 void CapturePacket::onTrigger(const std::shared_ptr<core::ProcessContext> 
&context, const std::shared_ptr<core::ProcessSession> &session) {
   CapturePacketMechanism *capture;
   if (mover->sink.try_dequeue(capture)) {
-    logger_->log_debug("Received packet capture in file %s %d", 
capture->getFile(), capture->getSize());
     auto ff = session->create();
-    session->import(capture->getFile(), ff, true, 0);
+    session->import(capture->getFile(), ff, false, 0);
     logger_->log_debug("Received packet capture in file %s %d for %s", 
capture->getFile(), capture->getSize(), 
ff->getResourceClaim()->getContentFullPath());
     session->transfer(ff, Success);
     delete capture;

Reply via email to