PsiphonTunnel.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* Created by "go tool cgo" - DO NOT EDIT. */
  2. /* package command-line-arguments */
  3. /* Start of preamble from import "C" comments. */
  4. /* End of preamble from import "C" comments. */
  5. /* Start of boilerplate cgo prologue. */
  6. #line 1 "cgo-gcc-export-header-prolog"
  7. #ifndef GO_CGO_PROLOGUE_H
  8. #define GO_CGO_PROLOGUE_H
  9. typedef signed char GoInt8;
  10. typedef unsigned char GoUint8;
  11. typedef short GoInt16;
  12. typedef unsigned short GoUint16;
  13. typedef int GoInt32;
  14. typedef unsigned int GoUint32;
  15. typedef long long GoInt64;
  16. typedef unsigned long long GoUint64;
  17. typedef GoInt64 GoInt;
  18. typedef GoUint64 GoUint;
  19. typedef __SIZE_TYPE__ GoUintptr;
  20. typedef float GoFloat32;
  21. typedef double GoFloat64;
  22. typedef float _Complex GoComplex64;
  23. typedef double _Complex GoComplex128;
  24. /*
  25. static assertion to make sure the file is being used on architecture
  26. at least with matching size of GoInt.
  27. */
  28. typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
  29. typedef struct { const char *p; GoInt n; } GoString;
  30. typedef void *GoMap;
  31. typedef void *GoChan;
  32. typedef struct { void *t; void *v; } GoInterface;
  33. typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
  34. #endif
  35. /* End of boilerplate cgo prologue. */
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. // Start starts the controller and returns once either of the following has occured: an active tunnel has been
  40. // established, the timeout has elapsed before an active tunnel could be established or an error has occured.
  41. //
  42. // Start returns a StartResult object serialized as a JSON string in the form of a null-terminated buffer of C chars.
  43. // Start will return,
  44. // On success:
  45. // {
  46. // "result_code": 0,
  47. // "bootstrap_time": <time_to_establish_tunnel>,
  48. // "http_proxy_port": <http_proxy_port_num>,
  49. // "socks_proxy_port": <socks_proxy_port_num>
  50. // }
  51. //
  52. // On timeout:
  53. // {
  54. // "result_code": 1,
  55. // "error": <error message>
  56. // }
  57. //
  58. // On other error:
  59. // {
  60. // "result_code": 2,
  61. // "error": <error message>
  62. // }
  63. //
  64. // networkID should be not be blank and should follow the format specified by
  65. // https://godoc.org/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon#NetworkIDGetter.
  66. extern char* Start(GoString p0, GoString p1, GoString p2, GoInt64 p3);
  67. // Stop stops the controller if it is running and waits for it to clean up and exit.
  68. //
  69. // Stop should always be called after a successful call to Start to ensure the
  70. // controller is not left running.
  71. extern void Stop();
  72. #ifdef __cplusplus
  73. }
  74. #endif