netatalk  4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
FPSpotlightRPC.c File Reference
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "afpcmd.h"
#include "afphelper.h"
#include "testhelper.h"

Macros

#define PAG_CORPUS_SMALL   50
#define PAG_CORPUS_PAGED   250
#define PAG_PREFIX_530   "paginate530-f-"
#define PAG_PREFIX_531   "paginate531-p-"
#define PAG_DIR_SMALL   "pagtest_small"
#define PAG_DIR_PAGED   "pagtest_paged"

Functions

static int pag_create_dir_get_did (uint16_t vol, uint32_t parent_did, char *name)
 Create a directory and return its DID.
STATIC void test547 ()
STATIC void test548 ()
STATIC void test560 ()
STATIC void test561 ()
STATIC void test562 ()
void FPSpotlightRPC_test ()

Macro Definition Documentation

◆ PAG_CORPUS_PAGED

#define PAG_CORPUS_PAGED   250

◆ PAG_CORPUS_SMALL

#define PAG_CORPUS_SMALL   50

◆ PAG_DIR_PAGED

#define PAG_DIR_PAGED   "pagtest_paged"

◆ PAG_DIR_SMALL

#define PAG_DIR_SMALL   "pagtest_small"

◆ PAG_PREFIX_530

#define PAG_PREFIX_530   "paginate530-f-"

◆ PAG_PREFIX_531

#define PAG_PREFIX_531   "paginate531-p-"

Function Documentation

◆ FPSpotlightRPC_test()

void FPSpotlightRPC_test ( )

◆ pag_create_dir_get_did()

int pag_create_dir_get_did ( uint16_t vol,
uint32_t parent_did,
char * name )
static

Create a directory and return its DID.

Convention reminder: in the testsuite, FPCreate* / FPOpen* helpers return the new DID (NETWORK byte order, treated as int) on success and 0 on failure — they do NOT return AFP error codes.

AFPCreateDir extracts the new DID from dsi->commands with a straight memcpy (no byte swap). The returned value is therefore the on-the-wire NETWORK-byte-order CNID stored as int. It must be passed straight back to FPCreateFile()/FPOpenDir() without an ntohl() — those helpers will memcpy it onto the next request's wire as-is. Applying ntohl() here would silently corrupt the DID.

Returns
the network-byte-order new DID on success, 0 on error

◆ test547()

STATIC void test547 ( )

◆ test548()

STATIC void test548 ( )

◆ test560()

STATIC void test560 ( )

◆ test561()

STATIC void test561 ( )

◆ test562()

STATIC void test562 ( )