|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
8805b2 |
#ifndef SOFORT_H
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
8805b2 |
#define SOFORT_H
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#include <stdint.h>
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#include <stdio.h>
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#include "sofort_api.h"
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#ifdef __cplusplus
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
extern "C" {
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
/* pre-alpha */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#ifndef SFRT_APP
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#ifndef SFRT_PRE_ALPHA
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#error libsofort: pre-alpha: ABI is not final!
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#error to use the library, please pass -DSFRT_PRE_ALPHA to the compiler.
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
/* status codes */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_OK 0x00
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_USAGE 0x01
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_BAD_OPT 0x02
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_BAD_OPT_VAL 0x03
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_IO_ERROR 0xA0
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_MAP_ERROR 0xA1
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
/* driver flags */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_DRIVER_VERBOSITY_NONE 0x0000
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_DRIVER_VERBOSITY_ERRORS 0x0001
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_DRIVER_VERBOSITY_STATUS 0x0002
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_DRIVER_VERBOSITY_USAGE 0x0004
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_DRIVER_CLONE_VECTOR 0x0008
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_DRIVER_VERSION 0x0010
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#define SFRT_DRIVER_DRY_RUN 0x0020
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
/* unit action flags */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
bbc20f |
#define SFRT_OUTPUT_NAME 0x0001 /* dummy */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
bbc20f |
#define SFRT_OUTPUT_ADDRESS 0x0002 /* dummy */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
struct sfrt_input {
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
void * addr;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
size_t size;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
};
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
struct sfrt_common_ctx {
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
uint64_t drvflags;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
uint64_t actflags;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
uint64_t fmtflags;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
bbc20f |
const char * anystring; /* dummy */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
};
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
struct sfrt_driver_ctx {
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
const char ** units;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
const char * program;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
const char * module;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
const struct sfrt_common_ctx * cctx;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
void * any;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
int status;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
int nerrors;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
};
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
struct sfrt_unit_ctx {
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
const char * const * path;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
const struct sfrt_input * map;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
const struct sfrt_common_ctx * cctx;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
void * any;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
int status;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
int nerrors;
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
};
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
/* driver api */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
4a749a |
sfrt_api int sfrt_get_driver_ctx (char ** argv, char ** envp, uint32_t flags, struct sfrt_driver_ctx **);
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
333bf0 |
sfrt_api int sfrt_create_driver_ctx (const struct sfrt_common_ctx *, struct sfrt_driver_ctx **);
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
sfrt_api void sfrt_free_driver_ctx (struct sfrt_driver_ctx *);
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
sfrt_api int sfrt_get_unit_ctx (const struct sfrt_driver_ctx *, const char * path, struct sfrt_unit_ctx **);
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
sfrt_api void sfrt_free_unit_ctx (struct sfrt_unit_ctx *);
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
sfrt_api int sfrt_map_input (int fd, const char * path, int prot, struct sfrt_input *);
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
sfrt_api int sfrt_unmap_input (struct sfrt_input *);
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
/* utility api */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
bbc20f |
sfrt_api int sfrt_output_dummy (const struct sfrt_common_ctx *, FILE *); /* dummy */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
bbc20f |
sfrt_api int sfrt_output_name (const struct sfrt_unit_ctx *, FILE *); /* dummy */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
bbc20f |
sfrt_api int sfrt_output_address (const struct sfrt_unit_ctx *, FILE *); /* dummy */
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#ifdef __cplusplus
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
}
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
|
|
![](https://seccdn.libravatar.org/avatar/010a04b188371137c95e3f06f2c34ffc76c25df631461eee33740684fe5e265f?s=16&d=retro) |
f46039 |
#endif
|