-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.go
193 lines (171 loc) · 6.08 KB
/
server.go
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
package iapitracingdatacollector
import (
"context"
"fmt"
"strings"
"unicode/utf16"
dcerpc "github.com/oiweiwei/go-msrpc/dcerpc"
errors "github.com/oiweiwei/go-msrpc/dcerpc/errors"
uuid "github.com/oiweiwei/go-msrpc/midl/uuid"
idatacollector "github.com/oiweiwei/go-msrpc/msrpc/dcom/pla/idatacollector/v0"
ndr "github.com/oiweiwei/go-msrpc/ndr"
)
var (
_ = context.Background
_ = fmt.Errorf
_ = utf16.Encode
_ = strings.TrimPrefix
_ = ndr.ZeroString
_ = (*uuid.UUID)(nil)
_ = (*dcerpc.SyntaxID)(nil)
_ = (*errors.Error)(nil)
_ = idatacollector.GoPackage
)
// IApiTracingDataCollector server interface.
type APITracingDataCollectorServer interface {
// IDataCollector base class.
idatacollector.DataCollectorServer
// LogApiNamesOnly operation.
GetLogAPINamesOnly(context.Context, *GetLogAPINamesOnlyRequest) (*GetLogAPINamesOnlyResponse, error)
// LogApiNamesOnly operation.
SetLogAPINamesOnly(context.Context, *SetLogAPINamesOnlyRequest) (*SetLogAPINamesOnlyResponse, error)
// LogApisRecursively operation.
GetLogAPIsRecursively(context.Context, *GetLogAPIsRecursivelyRequest) (*GetLogAPIsRecursivelyResponse, error)
// LogApisRecursively operation.
SetLogAPIsRecursively(context.Context, *SetLogAPIsRecursivelyRequest) (*SetLogAPIsRecursivelyResponse, error)
// ExePath operation.
GetExePath(context.Context, *GetExePathRequest) (*GetExePathResponse, error)
// ExePath operation.
SetExePath(context.Context, *SetExePathRequest) (*SetExePathResponse, error)
// LogFilePath operation.
GetLogFilePath(context.Context, *GetLogFilePathRequest) (*GetLogFilePathResponse, error)
// LogFilePath operation.
SetLogFilePath(context.Context, *SetLogFilePathRequest) (*SetLogFilePathResponse, error)
// IncludeModules operation.
GetIncludeModules(context.Context, *GetIncludeModulesRequest) (*GetIncludeModulesResponse, error)
// IncludeModules operation.
SetIncludeModules(context.Context, *SetIncludeModulesRequest) (*SetIncludeModulesResponse, error)
// IncludeApis operation.
GetIncludeAPIs(context.Context, *GetIncludeAPIsRequest) (*GetIncludeAPIsResponse, error)
// IncludeApis operation.
SetIncludeAPIs(context.Context, *SetIncludeAPIsRequest) (*SetIncludeAPIsResponse, error)
// ExcludeApis operation.
GetExcludeAPIs(context.Context, *GetExcludeAPIsRequest) (*GetExcludeAPIsResponse, error)
// ExcludeApis operation.
SetExcludeAPIs(context.Context, *SetExcludeAPIsRequest) (*SetExcludeAPIsResponse, error)
}
func RegisterAPITracingDataCollectorServer(conn dcerpc.Conn, o APITracingDataCollectorServer, opts ...dcerpc.Option) {
conn.RegisterServer(NewAPITracingDataCollectorServerHandle(o), append(opts, dcerpc.WithAbstractSyntax(APITracingDataCollectorSyntaxV0_0))...)
}
func NewAPITracingDataCollectorServerHandle(o APITracingDataCollectorServer) dcerpc.ServerHandle {
return func(ctx context.Context, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
return APITracingDataCollectorServerHandle(ctx, o, opNum, r)
}
}
func APITracingDataCollectorServerHandle(ctx context.Context, o APITracingDataCollectorServer, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
if opNum < 32 {
// IDataCollector base method.
return idatacollector.DataCollectorServerHandle(ctx, o, opNum, r)
}
switch opNum {
case 32: // LogApiNamesOnly
in := &GetLogAPINamesOnlyRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetLogAPINamesOnly(ctx, in)
return resp.xxx_ToOp(ctx), err
case 33: // LogApiNamesOnly
in := &SetLogAPINamesOnlyRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.SetLogAPINamesOnly(ctx, in)
return resp.xxx_ToOp(ctx), err
case 34: // LogApisRecursively
in := &GetLogAPIsRecursivelyRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetLogAPIsRecursively(ctx, in)
return resp.xxx_ToOp(ctx), err
case 35: // LogApisRecursively
in := &SetLogAPIsRecursivelyRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.SetLogAPIsRecursively(ctx, in)
return resp.xxx_ToOp(ctx), err
case 36: // ExePath
in := &GetExePathRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetExePath(ctx, in)
return resp.xxx_ToOp(ctx), err
case 37: // ExePath
in := &SetExePathRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.SetExePath(ctx, in)
return resp.xxx_ToOp(ctx), err
case 38: // LogFilePath
in := &GetLogFilePathRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetLogFilePath(ctx, in)
return resp.xxx_ToOp(ctx), err
case 39: // LogFilePath
in := &SetLogFilePathRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.SetLogFilePath(ctx, in)
return resp.xxx_ToOp(ctx), err
case 40: // IncludeModules
in := &GetIncludeModulesRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetIncludeModules(ctx, in)
return resp.xxx_ToOp(ctx), err
case 41: // IncludeModules
in := &SetIncludeModulesRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.SetIncludeModules(ctx, in)
return resp.xxx_ToOp(ctx), err
case 42: // IncludeApis
in := &GetIncludeAPIsRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetIncludeAPIs(ctx, in)
return resp.xxx_ToOp(ctx), err
case 43: // IncludeApis
in := &SetIncludeAPIsRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.SetIncludeAPIs(ctx, in)
return resp.xxx_ToOp(ctx), err
case 44: // ExcludeApis
in := &GetExcludeAPIsRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetExcludeAPIs(ctx, in)
return resp.xxx_ToOp(ctx), err
case 45: // ExcludeApis
in := &SetExcludeAPIsRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.SetExcludeAPIs(ctx, in)
return resp.xxx_ToOp(ctx), err
}
return nil, nil
}