libsparklepaw
PawSD library
Loading...
Searching...
No Matches
simple.h File Reference

Simple convenient routines for common lookups. More...

#include "common.h"
#include "service.h"
#include <stdint.h>

Go to the source code of this file.

Functions

const char * sprkl_strerror (int err)
 Converts an error code generated by sprkl_fetchsvc() into a message.
int sprkl_fetchsvc (struct sprkl_service **svc, enum sprkl_sigalgo alg, uint8_t *key, uint16_t idx)
 Fetches a service by its zone key and index.

Detailed Description

Simple convenient routines for common lookups.

Function Documentation

◆ sprkl_fetchsvc()

int sprkl_fetchsvc ( struct sprkl_service ** svc,
enum sprkl_sigalgo alg,
uint8_t * key,
uint16_t idx )

Fetches a service by its zone key and index.

If successful, the service must be freed afterwards using sprkl_service_freeall().

Parameters
[out]svcResult of a successful lookup will be written here.
[in]algAlgorithm used to sign the zone.
[in]keyKey used to sign the zone. (aka zone key or zone ID)
[in]idxService index within the zone.
Returns
0 on success or otherwise an error code, which can be passed to sprkl_strerror() to get its message.