| 1 |
#ifndef _CANL_H |
| 2 |
#define _CANL_H |
| 3 |
#include <sys/time.h> |
| 4 |
#include <sys/socket.h> |
| 5 |
#include <gssapi.h> /* for the OID structs */ |
| 6 |
|
| 7 |
#ifdef __cplusplus |
| 8 |
extern "C" { |
| 9 |
#endif |
| 10 |
|
| 11 |
#ifndef CANL_CALLCONV |
| 12 |
#define CANL_CALLCONV |
| 13 |
#endif |
| 14 |
|
| 15 |
typedef void *canl_io_handler; |
| 16 |
typedef void *canl_ctx; |
| 17 |
typedef void *canl_principal; |
| 18 |
|
| 19 |
typedef unsigned long canl_err_code; |
| 20 |
|
| 21 |
typedef char (*canl_password_callback)(canl_ctx cc, void *userdata); |
| 22 |
|
| 23 |
canl_ctx CANL_CALLCONV |
| 24 |
canl_create_ctx(); |
| 25 |
|
| 26 |
void CANL_CALLCONV |
| 27 |
canl_free_ctx(canl_ctx cc); |
| 28 |
|
| 29 |
canl_err_code CANL_CALLCONV |
| 30 |
canl_create_io_handler(canl_ctx cc, canl_io_handler *io); |
| 31 |
|
| 32 |
canl_err_code CANL_CALLCONV |
| 33 |
canl_io_connect(canl_ctx cc, canl_io_handler io, const char *host, |
| 34 |
const char *service, int port, gss_OID_set auth_mechs, |
| 35 |
int flags, canl_principal *peer, struct timeval *timeout); |
| 36 |
|
| 37 |
canl_err_code CANL_CALLCONV |
| 38 |
canl_io_accept(canl_ctx cc, canl_io_handler io, int fd, struct sockaddr s_addr, |
| 39 |
int flags, canl_principal *peer, struct timeval *timeout); |
| 40 |
|
| 41 |
size_t CANL_CALLCONV |
| 42 |
canl_io_read(canl_ctx cc, canl_io_handler io, void *buffer, |
| 43 |
size_t size, struct timeval *timeout); |
| 44 |
|
| 45 |
size_t CANL_CALLCONV |
| 46 |
canl_io_write(canl_ctx cc, canl_io_handler io, void *buffer, |
| 47 |
size_t size, struct timeval *timeout); |
| 48 |
|
| 49 |
canl_err_code CANL_CALLCONV |
| 50 |
canl_get_error_code(canl_ctx cc); |
| 51 |
|
| 52 |
char * CANL_CALLCONV |
| 53 |
canl_get_error_message(canl_ctx); |
| 54 |
|
| 55 |
canl_err_code CANL_CALLCONV |
| 56 |
canl_io_close(canl_ctx cc, canl_io_handler io); |
| 57 |
|
| 58 |
canl_err_code CANL_CALLCONV |
| 59 |
canl_io_destroy(canl_ctx cc, canl_io_handler io); |
| 60 |
|
| 61 |
canl_err_code CANL_CALLCONV |
| 62 |
canl_princ_name(canl_ctx, const canl_principal, char **); |
| 63 |
|
| 64 |
canl_err_code CANL_CALLCONV |
| 65 |
canl_princ_mech(canl_ctx, const canl_principal, gss_OID *); |
| 66 |
|
| 67 |
void CANL_CALLCONV |
| 68 |
canl_princ_free(canl_ctx, canl_principal); |
| 69 |
|
| 70 |
char * CANL_CALLCONV |
| 71 |
canl_mech2str(canl_ctx, gss_OID); |
| 72 |
|
| 73 |
const gss_OID_desc * CANL_CALLCONV |
| 74 |
canl_str2mech(canl_ctx, const char mech); |
| 75 |
|
| 76 |
canl_err_code CANL_CALLCONV |
| 77 |
canl_ctx_set_pkcs11_lib(canl_ctx, const char *); |
| 78 |
|
| 79 |
canl_err_code CANL_CALLCONV |
| 80 |
canl_ctx_set_pkcs11_init_args(canl_ctx, const char *); |
| 81 |
|
| 82 |
#ifdef __cplusplus |
| 83 |
} |
| 84 |
#endif |
| 85 |
|
| 86 |
#endif |