14
14
15
15
#include <stddef.h>
16
16
17
+ #ifndef TAILSCALE_H
18
+ #define TAILSCALE_H
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+
17
25
// tailscale is a handle onto a Tailscale server.
18
26
typedef int tailscale ;
19
27
@@ -133,8 +141,15 @@ extern int tailscale_accept(tailscale_listener listener, tailscale_conn* conn_ou
133
141
// "Sec-Tailscale: localapi" HTTP header and passing local_api_cred as
134
142
// the basic auth password.
135
143
//
144
+ // The pointers proxy_cred_out and local_api_cred_out must be non-NIL
145
+ // and point to arrays that can hold 33 bytes. The first 32 bytes are
146
+ // the credential and the final byte is a NUL terminator.
147
+ //
148
+ // If tailscale_loopback returns, then addr_our, proxy_cred_out,
149
+ // and local_api_cred_out are all NUL-terminated.
150
+ //
136
151
// Returns zero on success or -1 on error, call tailscale_errmsg for details.
137
- extern int tailscale_loopback (tailscale sd , char * addr_out , size_t addrlen , char proxy_cred_out [ static 33 ] , char local_api_cred_out [ static 33 ] );
152
+ extern int tailscale_loopback (tailscale sd , char * addr_out , size_t addrlen , char * proxy_cred_out , char * local_api_cred_out );
138
153
139
154
// tailscale_errmsg writes the details of the last error to buf.
140
155
//
@@ -145,3 +160,10 @@ extern int tailscale_loopback(tailscale sd, char* addr_out, size_t addrlen, char
145
160
// EBADF - sd is not a valid tailscale
146
161
// ERANGE - insufficient storage for buf
147
162
extern int tailscale_errmsg (tailscale sd , char * buf , size_t buflen );
163
+
164
+
165
+ #ifdef __cplusplus
166
+ }
167
+ #endif
168
+
169
+ #endif
0 commit comments