![]() |
SolarCapture C Bindings User Guide
SF-115721-CD
Issue 3
|
sc_pkt_predicate: Interface for testing properties of packets. More...
Data Structures | |
| struct | sc_pkt_predicate |
| A packet predicate object. More... | |
Typedefs | |
| typedef int( | sc_pkt_predicate_test_fn )(struct sc_pkt_predicate *, struct sc_packet *) |
| A packet predicate test function. It should return 1 (true), or 0 (false). | |
Functions | |
| int | sc_pkt_predicate_alloc (struct sc_pkt_predicate **pred_out, int private_bytes) |
| Allocate a packet predicate object. More... | |
| struct sc_object * | sc_pkt_predicate_to_object (struct sc_pkt_predicate *pred) |
| Convert a sc_pkt_predicate into a sc_object. More... | |
| struct sc_pkt_predicate * | sc_pkt_predicate_from_object (struct sc_object *obj) |
| Convert a sc_object into a sc_pkt_predicate. More... | |
Variables | |
| struct sc_pkt_predicate | __attribute__ |
sc_pkt_predicate: Interface for testing properties of packets.
| int sc_pkt_predicate_alloc | ( | struct sc_pkt_predicate ** | pred_out, |
| int | private_bytes | ||
| ) |
Allocate a packet predicate object.
| pred_out | On success the allocated sc_pkt_predicate object. |
| private_bytes | Size of private memory area wanted. |
Packet predicates are used to test packets against some criteria. The test function should return true (1) or false (0).
If private_bytes is non-zero then pred_private is initialised with a pointer to a region of memory of size private_bytes. The pred_private field may be used by the implementation to hold state.
| struct sc_pkt_predicate* sc_pkt_predicate_from_object | ( | struct sc_object * | obj | ) |
Convert a sc_object into a sc_pkt_predicate.
| obj | An sc_object instance or NULL |
obj is NULL otherwise the converted sc_pkt_predicate. | struct sc_object* sc_pkt_predicate_to_object | ( | struct sc_pkt_predicate * | pred | ) |
Convert a sc_pkt_predicate into a sc_object.
| pred | An sc_pkt_predicate instance or NULL |
pred is NULL otherwise the converted sc_object.