forked from devsisters/goquic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
go_functions.c
117 lines (91 loc) · 5.09 KB
/
go_functions.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include "go_functions.h"
#include <stddef.h>
#include <stdint.h>
#include <inttypes.h>
#include "_cgo_export.h"
void WriteToUDP_C(int64_t go_writer, void* peer_ip, size_t peer_ip_sz, uint16_t peer_port, void* buffer, size_t buf_len) {
WriteToUDP(go_writer, peer_ip, peer_ip_sz, peer_port, buffer, buf_len);
}
void WriteToUDPClient_C(int64_t go_writer, void* peer_ip, size_t peer_ip_sz, uint16_t peer_port, void* buffer, size_t buf_len) {
WriteToUDPClient(go_writer, peer_ip, peer_ip_sz, peer_port, buffer, buf_len);
}
int64_t CreateGoSession_C(int64_t go_quic_dispatcher, void* quic_server_session) {
return CreateGoSession(go_quic_dispatcher, quic_server_session);
}
void DeleteGoSession_C(int64_t go_quic_dispatcher, int64_t go_quic_server_session) {
DeleteGoSession(go_quic_dispatcher, go_quic_server_session);
}
int GetProof_C(int64_t go_proof_source, void* server_ip, size_t server_ip_sz, char* hostname, size_t hostname_sz, char* server_config, size_t server_config_sz, int ecdsa_ok, char **out_signature, size_t *out_signature_sz) {
return GetProof(go_proof_source, server_ip, server_ip_sz, hostname, hostname_sz, server_config, server_config_sz, ecdsa_ok, out_signature, out_signature_sz);
}
int64_t CreateIncomingDynamicStream_C(int64_t go_quic_server_session, uint32_t id, void* go_quic_simple_server_stream_go_wrapper) {
return CreateIncomingDynamicStream(go_quic_server_session, id, go_quic_simple_server_stream_go_wrapper);
}
void UnregisterQuicServerStreamFromSession_C(int64_t go_stream) {
UnregisterQuicServerStreamFromSession(go_stream);
}
void UnregisterQuicClientStreamFromSession_C(int64_t go_stream) {
UnregisterQuicClientStreamFromSession(go_stream);
}
int64_t CreateGoQuicAlarm_C(void* go_quic_alarm_go_wrapper, void* clock, int64_t task_runner) {
return CreateGoQuicAlarm(go_quic_alarm_go_wrapper, clock, task_runner);
}
void GoQuicAlarmSetImpl_C(int64_t go_quic_alarm, int64_t deadline) {
GoQuicAlarmSetImpl(go_quic_alarm, deadline);
}
void GoQuicAlarmCancelImpl_C(int64_t go_quic_alarm) {
GoQuicAlarmCancelImpl(go_quic_alarm);
}
void GoQuicAlarmDestroy_C(int64_t go_quic_alarm) {
GoQuicAlarmDestroy(go_quic_alarm);
}
void GoQuicSpdyClientStreamOnInitialHeadersComplete_C(int64_t go_quic_spdy_client_stream, const char *data, uint32_t data_len) {
GoQuicSpdyClientStreamOnInitialHeadersComplete(go_quic_spdy_client_stream, (void *)data, data_len);
}
void GoQuicSpdyClientStreamOnTrailingHeadersComplete_C(int64_t go_quic_spdy_client_stream, const char *data, uint32_t data_len) {
GoQuicSpdyClientStreamOnTrailingHeadersComplete(go_quic_spdy_client_stream, (void *)data, data_len);
}
void GoQuicSpdyClientStreamOnDataAvailable_C(int64_t go_quic_spdy_client_stream, const char *data, uint32_t data_len, int is_closed) {
GoQuicSpdyClientStreamOnDataAvailable(go_quic_spdy_client_stream, (void *)data, data_len, is_closed);
}
void GoQuicSpdyClientStreamOnClose_C(int64_t go_quic_spdy_client_stream) {
GoQuicSpdyClientStreamOnClose(go_quic_spdy_client_stream);
}
void GoQuicSimpleServerStreamOnInitialHeadersComplete_C(int64_t go_quic_simple_server_stream, const char *data, uint32_t data_len) {
GoQuicSimpleServerStreamOnInitialHeadersComplete(go_quic_simple_server_stream, (void *)data, data_len);
}
void GoQuicSimpleServerStreamOnTrailingHeadersComplete_C(int64_t go_quic_simple_server_stream, const char *data, uint32_t data_len) { GoQuicSimpleServerStreamOnTrailingHeadersComplete(go_quic_simple_server_stream, (void *)data, data_len);
}
void GoQuicSimpleServerStreamOnDataAvailable_C(int64_t go_quic_simple_server_stream, const char *data, uint32_t data_len, int is_closed) {
GoQuicSimpleServerStreamOnDataAvailable(go_quic_simple_server_stream, (void *)data, data_len, is_closed);
}
void GoQuicSimpleServerStreamOnClose_C(int64_t go_quic_simple_server_stream) {
GoQuicSimpleServerStreamOnClose(go_quic_simple_server_stream);
}
int64_t NewProofVerifyJob_C(int64_t go_proof_verifier, const char* hostname, size_t hostname_len, const char* server_config, size_t server_config_len, const char* cert_sct, size_t cert_sct_len, const char* signature, size_t signature_len) {
return NewProofVerifyJob(go_proof_verifier, (void *)hostname, hostname_len, (void *)server_config, server_config_len, (void *)cert_sct, cert_sct_len, (void *)signature, signature_len);
}
void ProofVerifyJobAddCert_C(int64_t job, const char* cert, size_t cert_len) {
ProofVerifyJobAddCert(job, (void *)cert, cert_len);
}
int ProofVerifyJobVerifyProof_C(int64_t job) {
return ProofVerifyJobVerifyProof(job);
}
void ReleaseClientWriter_C(int64_t go_client_writer) {
ReleaseClientWriter(go_client_writer);
}
void ReleaseServerWriter_C(int64_t go_server_writer) {
ReleaseServerWriter(go_server_writer);
}
void ReleaseQuicDispatcher_C(int64_t go_quic_dispatcher) {
ReleaseQuicDispatcher(go_quic_dispatcher);
}
void ReleaseTaskRunner_C(int64_t go_task_runner) {
ReleaseTaskRunner(go_task_runner);
}
void ReleaseProofVerifier_C(int64_t go_proof_verifier) {
ReleaseProofVerifier(go_proof_verifier);
}
void ReleaseProofSource_C(int64_t go_proof_source) {
ReleaseProofSource(go_proof_source);
}