Integration doc for containers and systemd
[tlspool] / lib / swig-tlspool.i
1 /* Generic declarations of libtlspool for swig
2  *
3  * We use swig to generate wrappers for Python.
4  *
5  * We also include the generated result in the Git repository for TLS Pool,
6  * so there is no requirement to install Swig unless you run "make veryclean"
7  * instead of the usual "make clean".
8  *
9  * From: Rick van Rein <rick@openfortress.nl>
10  */
11
12
13 %{
14
15 #include <tlspool/starttls.h>
16 #include <tlspool/commands.h>
17
18 %}
19
20
21 // by default, export nothing (we rename most anyway)
22
23 %ignore "";
24
25
26 // welcome flags and tags
27
28 %rename("%(strip:[TLSPOOL_])s") "";
29 %rename("%s", regexpmatch$name="^PIOC_") "";
30 %rename("%s", regexpmatch$name="^PIOF_") "";
31
32
33 // basic data types -- retyping a few parameters in SWIG-understandable terms
34
35 %apply unsigned char  { uint8_t  }
36 %apply unsigned short { uint16_t }
37 %apply unsigned int   { uint32_t }
38 %apply          short {  int16_t }
39
40 %inline{
41
42         typedef char identity_t [128];
43
44         typedef uint8_t ctlkey_t [16];
45
46         typedef char service_t [16];
47
48         typedef struct {
49                 int tlserrno;
50                 char message [128];
51         } error_data;
52
53         typedef struct {
54                 char YYYYMMDD_producer [8+128]; // when & who?
55                 uint32_t facilities;            // PIOF_FACILITY_xxx
56         } ping_data;
57
58         typedef struct {
59                 uint32_t flags;
60                 uint32_t local;
61                 uint8_t ipproto;
62                 uint16_t streamid;
63                 identity_t localid;
64                 identity_t remoteid;
65                 ctlkey_t ctlkey;
66                 service_t service;
67                 uint32_t timeout;
68         } starttls_data;
69
70         typedef struct {
71                 uint32_t flags;
72                 ctlkey_t ctlkey;
73                 identity_t name;
74         } control_data;
75
76         typedef struct {
77                 int16_t in1_len, in2_len, prng_len;
78                 uint8_t buffer [350];
79         } prng_data;
80
81         typedef union {
82                 int unix_socket;
83         } socket_data;
84
85 };
86
87
88 // helper fun
89
90 //IF ANY//
91
92
93 // libtlspool.so
94
95 int tlspool_pid (char *opt_pidfile);
96
97 pool_handle_t tlspool_open_poolhandle (char *path);
98
99 int tlspool_ping (ping_data *pingdata);
100
101 int tlspool_starttls (int cryptfd, starttls_data *tlsdata,
102                         void *privdata,
103                         // int (*namedconnect) (starttls_t *tlsdata,void *privdata));
104                         void *swig_null_callback);
105
106 int tlspool_control_detach (ctlkey_t ctlkey);
107
108 int tlspool_control_reattach (ctlkey_t ctlkey);
109
110 int tlspool_prng (char *label, char *opt_ctxvalue,
111                 uint16_t prng_len, uint8_t *prng_buf,
112                 ctlkey_t ctlkey);
113
114 char *tlspool_configvar (char *cfgfile, char *varname);
115
116
117 // libtlspool_pinentry.c
118 //
119 // NOT MAPPED -- callbacks are not part of SWIG's powers
120
121 //NOTMAPPED// %rename(pin_service) tlspool_pin_service;
122 //NOTMAPPED// // int tlspool_pin_service (char *path, uint32_t regflags, int responsetimeout_usec, void (*cb) (struct pioc_pinentry *entry, void *data), void *data);
123
124
125
126 // libtlspool_lidentry.c
127 //
128 // NOT MAPPED -- callbacks are not part of SWIG's powers
129
130 //NOTMAPPED// %rename(localid_service) tlspool_localid_service;
131 //NOTMAPPED// // int tlspool_localid_service (char *path, uint32_t regflags, int responsetimeout, char * (*cb) (lidentry_t *entry, void *data), void *data);
132
133