SolarCapture C Bindings User Guide  SF-115721-CD
Issue 3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sc_pcap_packer Node Reference

A node that packs incoming packets into buffers that are ready to be written to a pcap file.

Detailed Description

A node that packs incoming packets into buffers that are ready to be written to a pcap file.

Arguments

Argument Optional? Default Type Description
snap Yes SC_PARAM_INT Bytes of frame data to store. If unset or zero, use the "snap" attribute, else at least 16KiB if the attribute is not set.
rotate_seconds Yes 0 SC_PARAM_INT If nonzero, a new capture file is created after the given number of seconds.
rotate_file_size Yes 0 SC_PARAM_INT If nonzero, a new capture file is created whenever the previous file exceeds the given size in bytes.
format Yes "pcap" SC_PARAM_STR File format. Set to "pcap-ns" for nano-second PCAP format or "pcap" for the default format that uses microseconds.
on_error Yes "exit" SC_PARAM_STR Set behaviour for errors. Can be one of "exit", "abort", "message" and "silent".
discard_mask Yes 0 SC_PARAM_INT Mask with packed stream packets to discard. Bits in the mask that take effect are SC_CSUM_ERROR and SC_CRC_ERROR. Not that this argument will have no effect on packets not in packed stream format.
filename No SC_PARAM_STR Template for filename. This is used to generate filenames for the initial and post-rotation files. The filename may include a time format defined by strftime(3). If the filename includes the string '$i' then it is replaced by an incrementing index.

Named Input Links

Input links may be named, in which case the packets are forwarded to a matching named output link.

Output Links

Link Description
"" Packed buffers in pcap format are sent out on this link.
"#input" Packets from all inputs are forwarded to this link.
NAME If NAME matches the name of an input link, then input packets are forwarded to the corresponding output link.

Exposed Statistics

Statistics exposed by the sc_pcap_packer node.

Name Type Data Type Description
pcap_bytes uint64_t byte_count Sum of bytes of encapsulated data send to output.
buffer_low uint64_t ev_count Number of times the pool of buffers has run out.