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

Append incoming packets to an sc_packet_list.

Detailed Description

This node provides a simple way to get packet buffers out of the SolarCapture node graph, and is typically used with an unmanaged thread. It is often used when writing code to adapt the SolarCapture API to another API, or embed SolarCapture in an application.

After allocating an instance of this node, the application must initialise sc_append_to_list::append_to so that it points to an initialised sc_packet_list. Here is an example:

sc_node_alloc_named(&node, attr, thread, "sc_append_to_list", NULL, NULL, 0);
struct sc_append_to_list* atl = node->nd_private;
struct sc_packet_list my_packet_list;
sc_packet_list_init(&my_packet_list);
atl->append_to = &my_packet_list;

Packet buffers delivered in this way should eventually be returned to SolarCapture by forwarding them through one of this node's output links, or through its free_link:

sc_forward_list2(atl->free_link, &my_packet_list);
sc_packet_list_init(&my_packet_list);