|
| static uint64_t | spotlight_test_pack_tag (uint16_t type, uint16_t size_or_count, uint32_t val) |
| static uint32_t | spotlight_test_get_le32 (const char *buf, size_t offset) |
| static void | spotlight_test_put_le32 (uint8_t *buf, size_t offset, uint32_t val) |
| static void | spotlight_test_put_le64 (uint8_t *buf, size_t offset, uint64_t val) |
| static int | spotlight_pack_fetch_properties_rpc (char *rpcbuf) |
| static unsigned int | spotlight_send (CONN *conn, uint16_t vid, uint32_t subcmd, const uint8_t *rpc_buf, size_t rpc_len) |
| | Wrap an AFP_SPOTLIGHT_PRIVATE request and ship it on the DSI.
|
| unsigned int | FPSpotlightFetchPropertiesWithShrunkTOC (CONN *conn, uint16_t vid) |
| | Send an otherwise-valid fetchPropertiesForContext: request whose TOC tag claims no usable complex-object entries.
|
| unsigned int | FPSpotlightFetchPropertiesWithLargeTOCIndex (CONN *conn, uint16_t vid) |
| | Send a valid fetchPropertiesForContext: request whose first complex tag references a far out-of-range TOC index.
|
| unsigned int | FPSpotlightRPCWithLargeInt64Count (CONN *conn, uint16_t vid) |
| | Send the companion advisory PoC: one INT64 tag claiming a huge count.
|
| unsigned int | FPSpotlightOpen (CONN *conn, uint16_t vid, char *vol_path_out, size_t vol_path_buflen) |
| | Send SPOTLIGHT_CMD_OPEN and optionally extract the volume path.
|
| unsigned int | FPSpotlightOpenQuery (CONN *conn, uint16_t vid, const char *query_dsl, uint64_t ctx) |
| | Build and send an openQueryWithParams:forContext: Spotlight RPC.
|
| unsigned int | FPSpotlightDrainResults (CONN *conn, uint16_t vid, uint64_t ctx, int *total_results_out) |
| | Drain Spotlight query results until the server reports complete.
|
| unsigned int | FPSpotlightCloseQuery (CONN *conn, uint16_t vid, uint64_t ctx) |
| | Send a closeQueryForContext: Spotlight RPC for the given context.
|
| unsigned int FPSpotlightDrainResults |
( |
CONN * | conn, |
|
|
uint16_t | vid, |
|
|
uint64_t | ctx, |
|
|
int * | total_results_out ) |
Drain Spotlight query results until the server reports complete.
Loops fetchQueryResultsForContext: until the embedded status field is 0 (search complete) or the loop guard expires. Sums the kMDQueryResultIndices array length from each reply.
The SPOTLIGHT_CMD_RPC reply envelope has 4 leading bytes before the marshalled DALLOC_CTX (matches the server's sl_pack(reply, rbuf+4)).
| unsigned int FPSpotlightOpenQuery |
( |
CONN * | conn, |
|
|
uint16_t | vid, |
|
|
const char * | query_dsl, |
|
|
uint64_t | ctx ) |
Build and send an openQueryWithParams:forContext: Spotlight RPC.
Mirrors sl_rpc_openQuery's expectations exactly. The outer DALLOC_CTX holds one sl_array_t (outer_array) with two children: [0] args : sl_array_t with three elements [0] = "openQueryWithParams:forContext:" (char *) [1] = ctx1 (uint64_t) [2] = ctx2 (uint64_t) [1] params : sl_dict_t — key/value pairs (kMDQueryString → DSL, kMDAttributeArray → sl_array_t, kMDScopeArray → char *)
Stack-local scalars use dalloc_add_copy so the value is memcpy'd into a freshly-talloc'd chunk; dalloc_add only captures a pointer.
Both ctx values are needed because sl_rpc_openQuery dereferences both via dalloc_get(query, "DALLOC_CTX", 0, "DALLOC_CTX", 0, "uint64_t", 1) and "uint64_t", 2.
| unsigned int spotlight_send |
( |
CONN * | conn, |
|
|
uint16_t | vid, |
|
|
uint32_t | subcmd, |
|
|
const uint8_t * | rpc_buf, |
|
|
size_t | rpc_len ) |
|
static |
Wrap an AFP_SPOTLIGHT_PRIVATE request and ship it on the DSI.
Builds the 24-byte SPOTLIGHT_PRIVATE envelope (cmd byte, vid, reserved, subcmd, reserved, padding) and appends rpc_buf, then sends and receives the reply via the existing my_dsi_* helpers.