1
/* Code generated by cmd/cgo; DO NOT EDIT. */
2

            
3
/* package github.com/cilium/proxy/proxylib */
4

            
5

            
6
#line 1 "cgo-builtin-export-prolog"
7

            
8
#include <stddef.h>
9

            
10
#ifndef GO_CGO_EXPORT_PROLOGUE_H
11
#define GO_CGO_EXPORT_PROLOGUE_H
12

            
13
#ifndef GO_CGO_GOSTRING_TYPEDEF
14
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
15
#endif
16

            
17
#endif
18

            
19
/* Start of preamble from import "C" comments.  */
20

            
21

            
22
#line 9 "proxylib.go"
23

            
24
#include "types.h"
25

            
26
#line 1 "cgo-generated-wrapper"
27

            
28

            
29
/* End of preamble from import "C" comments.  */
30

            
31

            
32
/* Start of boilerplate cgo prologue.  */
33
#line 1 "cgo-gcc-export-header-prolog"
34

            
35
#ifndef GO_CGO_PROLOGUE_H
36
#define GO_CGO_PROLOGUE_H
37

            
38
typedef signed char GoInt8;
39
typedef unsigned char GoUint8;
40
typedef short GoInt16;
41
typedef unsigned short GoUint16;
42
typedef int GoInt32;
43
typedef unsigned int GoUint32;
44
typedef long long GoInt64;
45
typedef unsigned long long GoUint64;
46
typedef GoInt64 GoInt;
47
typedef GoUint64 GoUint;
48
typedef size_t GoUintptr;
49
typedef float GoFloat32;
50
typedef double GoFloat64;
51
#ifdef _MSC_VER
52
#include <complex.h>
53
typedef _Fcomplex GoComplex64;
54
typedef _Dcomplex GoComplex128;
55
#else
56
typedef float _Complex GoComplex64;
57
typedef double _Complex GoComplex128;
58
#endif
59

            
60
/*
61
  static assertion to make sure the file is being used on architecture
62
  at least with matching size of GoInt.
63
*/
64
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
65

            
66
#ifndef GO_CGO_GOSTRING_TYPEDEF
67
typedef _GoString_ GoString;
68
#endif
69
typedef void *GoMap;
70
typedef void *GoChan;
71
typedef struct { void *t; void *v; } GoInterface;
72
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
73

            
74
#endif
75

            
76
/* End of boilerplate cgo prologue.  */
77

            
78
#ifdef __cplusplus
79
extern "C" {
80
#endif
81

            
82

            
83
// OnNewConnection is used to register a new connection of protocol 'proto'.
84
// Note that the 'origBuf' and replyBuf' type '*[]byte' corresponds to 'InjectBuf' type, but due to
85
// cgo export restrictions we can't use the go type in the prototype.
86
//
87
extern FilterResult OnNewConnection(GoUint64 instanceId, GoString proto, GoUint64 connectionId, GoUint8 ingress, GoUint32 srcId, GoUint32 dstId, GoString srcAddr, GoString dstAddr, GoString policyName, GoSlice* origBuf, GoSlice* replyBuf);
88

            
89
// Each connection is assumed to be called from a single thread, so accessing connection metadata
90
// does not need protection.
91
//
92
// OnData gets all the unparsed data the datapath has received so far. The data is provided to the parser
93
// associated with the connection, and the parser is expected to find if the data frame contains enough data
94
// to make a PASS/DROP decision for the whole data frame. Note that the whole data frame need not be received,
95
// if the decision including the length of the data frame in bytes can be determined based on the beginning of
96
// the data frame only (e.g., headers including the length of the data frame). The parser returns a decision
97
// with the number of bytes on which the decision applies. If more data is available, then the parser will be
98
// called again with the remaining data. Parser needs to return MORE if a decision can't be made with
99
// the available data, including the minimum number of additional bytes that is needed before the parser is
100
// called again.
101
//
102
// The parser can also inject at arbitrary points in the data stream. This is indecated by an INJECT operation
103
// with the number of bytes to be injected. The actual bytes to be injected are provided via an Inject()
104
// callback prior to returning the INJECT operation. The Inject() callback operates on a limited size buffer
105
// provided by the datapath, and multiple INJECT operations may be needed to inject large amounts of data.
106
// Since we get the data on one direction at a time, any frames to be injected in the reverse direction
107
// are placed in the reverse direction buffer, from where the datapath injects the data before calling
108
// us again for the reverse direction input.
109
//
110
extern FilterResult OnData(GoUint64 connectionId, GoUint8 reply, GoUint8 endStream, GoSlice* data, GoSlice* filterOps);
111

            
112
// Make this more general connection event callback
113
//
114
extern void Close(GoUint64 connectionId);
115

            
116
// OpenModule is called before any other APIs.
117
// Called concurrently by different filter instances.
118
// Returns a library instance ID that must be passed to all other API calls.
119
// Calls with the same parameters will return the same instance.
120
// Zero return value indicates an error.
121
//
122
extern GoUint64 OpenModule(GoSlice params, GoUint8 debug);
123
extern void CloseModule(GoUint64 id);
124

            
125
#ifdef __cplusplus
126
}
127
#endif