-
Notifications
You must be signed in to change notification settings - Fork 2
/
v1.go
1772 lines (1644 loc) · 59.2 KB
/
v1.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package loctoloc
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"
dtyp "github.com/oiweiwei/go-msrpc/msrpc/dtyp"
rpcl "github.com/oiweiwei/go-msrpc/msrpc/rpcl"
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)
_ = rpcl.GoPackage
_ = dtyp.GoPackage
)
var (
// import guard
GoPackage = "rpcl"
)
var (
// Syntax UUID
LocToLocSyntaxUUID = &uuid.UUID{TimeLow: 0xe33c0cc4, TimeMid: 0x482, TimeHiAndVersion: 0x101a, ClockSeqHiAndReserved: 0xbc, ClockSeqLow: 0xc, Node: [6]uint8{0x2, 0x60, 0x8c, 0x6b, 0xa2, 0x18}}
// Syntax ID
LocToLocSyntaxV1_0 = &dcerpc.SyntaxID{IfUUID: LocToLocSyntaxUUID, IfVersionMajor: 1, IfVersionMinor: 0}
)
// LocToLoc interface.
type LocToLocClient interface {
// The I_nsi_lookup_begin method is invoked by a client locator to enumerate the binding
// information for a set of RPC servers that satisfy a given set of criteria. The Microsoft
// Interface Definition Language (MIDL) syntax of the method is specified as follows.
//
// Return Values: This method does not return any values. RPC exceptions might be thrown
// from this method.
//
// # Exceptions Thrown
//
// No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
LookupBegin(context.Context, *LookupBeginRequest, ...dcerpc.CallOption) (*LookupBeginResponse, error)
// The I_nsi_lookup_done method is invoked to free any resources associated with the
// context handle returned by a preceding call to the I_nsi_lookup_begin method. The
// MIDL syntax of this method is specified as follows.
//
// Return Values: This method does not return any values.
//
// # Exceptions Thrown
//
// No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
LookupDone(context.Context, *LookupDoneRequest, ...dcerpc.CallOption) (*LookupDoneResponse, error)
// The I_nsi_lookup_next method is invoked to continue an enumeration of binding vectors
// that satisfy the criteria specified in a call to the I_nsi_lookup_begin method. The
// number of bindings in the binding_vector is limited by the parameter binding_max_count
// specified in the call to the I_nsi_lookup_begin method. The MIDL syntax of this method
// is specified as follows.
//
// Return Values: This method does not return any values.
//
// # Exceptions Thrown
//
// No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
LookupNext(context.Context, *LookupNextRequest, ...dcerpc.CallOption) (*LookupNextResponse, error)
// The I_nsi_entry_object_inq_next method is invoked to continue an enumeration initiated
// by a previous call to the I_nsi_entry_object_inq_begin method. The MIDL syntax of
// the method is specified as follows.
//
// Return Values: This method does not return any values. RPC exceptions can be thrown
// from this method.
//
// # Exceptions Thrown
//
// No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
EntryObjectInquireNext(context.Context, *EntryObjectInquireNextRequest, ...dcerpc.CallOption) (*EntryObjectInquireNextResponse, error)
// The I_nsi_ping_locator method is invoked by the client to determine if the target
// computer is available as a master locator. The MIDL syntax of the method is specified
// as follows.
//
// Return Values: This method does not return any values.
//
// # Exceptions Thrown
//
// No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
PingLocator(context.Context, *PingLocatorRequest, ...dcerpc.CallOption) (*PingLocatorResponse, error)
// The I_nsi_entry_object_inq_done method is invoked to free any resources associated
// with the context handle returned by a preceding call to the I_nsi_entry_object_inq_begin
// method. The MIDL syntax of the method is specified as follows.
//
// Return Values: This method does not return any values. RPC exceptions can be thrown
// from this method.
//
// # Exceptions Thrown
//
// No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
EntryObjectInquireDone(context.Context, *EntryObjectInquireDoneRequest, ...dcerpc.CallOption) (*EntryObjectInquireDoneResponse, error)
// The I_nsi_entry_object_inq_begin method is invoked to enumerate the object UUIDs
// on a name service entry. The MIDL syntax of the method is specified as follows.
//
// Return Values: This method does not return any values. RPC exceptions can be thrown
// from this method.
//
// # Exceptions Thrown
//
// No exceptions are thrown beyond those thrown by the underlying RPC protocol, as specified
// in [MS-RPCE].
EntryObjectInquireBegin(context.Context, *EntryObjectInquireBeginRequest, ...dcerpc.CallOption) (*EntryObjectInquireBeginResponse, error)
// AlterContext alters the client context.
AlterContext(context.Context, ...dcerpc.Option) error
}
type xxx_DefaultLocToLocClient struct {
cc dcerpc.Conn
}
func (o *xxx_DefaultLocToLocClient) LookupBegin(ctx context.Context, in *LookupBeginRequest, opts ...dcerpc.CallOption) (*LookupBeginResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &LookupBeginResponse{}
out.xxx_FromOp(ctx, op)
return out, nil
}
func (o *xxx_DefaultLocToLocClient) LookupDone(ctx context.Context, in *LookupDoneRequest, opts ...dcerpc.CallOption) (*LookupDoneResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &LookupDoneResponse{}
out.xxx_FromOp(ctx, op)
return out, nil
}
func (o *xxx_DefaultLocToLocClient) LookupNext(ctx context.Context, in *LookupNextRequest, opts ...dcerpc.CallOption) (*LookupNextResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &LookupNextResponse{}
out.xxx_FromOp(ctx, op)
return out, nil
}
func (o *xxx_DefaultLocToLocClient) EntryObjectInquireNext(ctx context.Context, in *EntryObjectInquireNextRequest, opts ...dcerpc.CallOption) (*EntryObjectInquireNextResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &EntryObjectInquireNextResponse{}
out.xxx_FromOp(ctx, op)
return out, nil
}
func (o *xxx_DefaultLocToLocClient) PingLocator(ctx context.Context, in *PingLocatorRequest, opts ...dcerpc.CallOption) (*PingLocatorResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &PingLocatorResponse{}
out.xxx_FromOp(ctx, op)
return out, nil
}
func (o *xxx_DefaultLocToLocClient) EntryObjectInquireDone(ctx context.Context, in *EntryObjectInquireDoneRequest, opts ...dcerpc.CallOption) (*EntryObjectInquireDoneResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &EntryObjectInquireDoneResponse{}
out.xxx_FromOp(ctx, op)
return out, nil
}
func (o *xxx_DefaultLocToLocClient) EntryObjectInquireBegin(ctx context.Context, in *EntryObjectInquireBeginRequest, opts ...dcerpc.CallOption) (*EntryObjectInquireBeginResponse, error) {
op := in.xxx_ToOp(ctx)
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &EntryObjectInquireBeginResponse{}
out.xxx_FromOp(ctx, op)
return out, nil
}
func (o *xxx_DefaultLocToLocClient) AlterContext(ctx context.Context, opts ...dcerpc.Option) error {
return o.cc.AlterContext(ctx, opts...)
}
func NewLocToLocClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (LocToLocClient, error) {
cc, err := cc.Bind(ctx, append(opts, dcerpc.WithAbstractSyntax(LocToLocSyntaxV1_0))...)
if err != nil {
return nil, err
}
return &xxx_DefaultLocToLocClient{cc: cc}, nil
}
// xxx_LookupBeginOperation structure represents the I_nsi_lookup_begin operation
type xxx_LookupBeginOperation struct {
EntryNameSyntax uint32 `idl:"name:entry_name_syntax" json:"entry_name_syntax"`
EntryName string `idl:"name:entry_name" json:"entry_name"`
InterfaceID *rpcl.SyntaxID `idl:"name:interfaceid;pointer:unique" json:"interface_id"`
TransferSyntax *rpcl.SyntaxID `idl:"name:xfersyntax;pointer:unique" json:"transfer_syntax"`
ObjectUUID *dtyp.GUID `idl:"name:obj_uuid" json:"object_uuid"`
BindingMaxCount uint32 `idl:"name:binding_max_count" json:"binding_max_count"`
MaxCacheAge uint32 `idl:"name:MaxCacheAge" json:"max_cache_age"`
ImportContext *rpcl.Context `idl:"name:import_context" json:"import_context"`
Status uint16 `idl:"name:status" json:"status"`
}
func (o *xxx_LookupBeginOperation) OpNum() int { return 0 }
func (o *xxx_LookupBeginOperation) OpName() string { return "/LocToLoc/v1/I_nsi_lookup_begin" }
func (o *xxx_LookupBeginOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupBeginOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
// entry_name_syntax {in} (1:(uint32))
{
if err := w.WriteData(o.EntryNameSyntax); err != nil {
return err
}
}
// entry_name {in} (1:{string, pointer=unique, alias=STRING_T}*(1)[dim:0,string,null](wchar))
{
if o.EntryName != "" {
_ptr_entry_name := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if err := ndr.WriteUTF16NString(ctx, w, o.EntryName); err != nil {
return err
}
return nil
})
if err := w.WritePointer(&o.EntryName, _ptr_entry_name); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// interfaceid {in} (1:{pointer=unique}*(1))(2:{alias=RPC_SYNTAX_IDENTIFIER}(struct))
{
if o.InterfaceID != nil {
_ptr_interfaceid := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if o.InterfaceID != nil {
if err := o.InterfaceID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&rpcl.SyntaxID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.InterfaceID, _ptr_interfaceid); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// xfersyntax {in} (1:{pointer=unique}*(1))(2:{alias=RPC_SYNTAX_IDENTIFIER}(struct))
{
if o.TransferSyntax != nil {
_ptr_xfersyntax := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if o.TransferSyntax != nil {
if err := o.TransferSyntax.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&rpcl.SyntaxID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.TransferSyntax, _ptr_xfersyntax); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// obj_uuid {in} (1:{pointer=unique, alias=NSI_UUID_P_T}*(1))(2:{alias=GUID}(struct))
{
if o.ObjectUUID != nil {
_ptr_obj_uuid := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if o.ObjectUUID != nil {
if err := o.ObjectUUID.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dtyp.GUID{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.ObjectUUID, _ptr_obj_uuid); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// binding_max_count {in} (1:(uint32))
{
if err := w.WriteData(o.BindingMaxCount); err != nil {
return err
}
}
// MaxCacheAge {in} (1:(uint32))
{
if err := w.WriteData(o.MaxCacheAge); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupBeginOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
// entry_name_syntax {in} (1:(uint32))
{
if err := w.ReadData(&o.EntryNameSyntax); err != nil {
return err
}
}
// entry_name {in} (1:{string, pointer=unique, alias=STRING_T}*(1)[dim:0,string,null](wchar))
{
_ptr_entry_name := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if err := ndr.ReadUTF16NString(ctx, w, &o.EntryName); err != nil {
return err
}
return nil
})
_s_entry_name := func(ptr interface{}) { o.EntryName = *ptr.(*string) }
if err := w.ReadPointer(&o.EntryName, _s_entry_name, _ptr_entry_name); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// interfaceid {in} (1:{pointer=unique}*(1))(2:{alias=RPC_SYNTAX_IDENTIFIER}(struct))
{
_ptr_interfaceid := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if o.InterfaceID == nil {
o.InterfaceID = &rpcl.SyntaxID{}
}
if err := o.InterfaceID.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
})
_s_interfaceid := func(ptr interface{}) { o.InterfaceID = *ptr.(**rpcl.SyntaxID) }
if err := w.ReadPointer(&o.InterfaceID, _s_interfaceid, _ptr_interfaceid); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// xfersyntax {in} (1:{pointer=unique}*(1))(2:{alias=RPC_SYNTAX_IDENTIFIER}(struct))
{
_ptr_xfersyntax := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if o.TransferSyntax == nil {
o.TransferSyntax = &rpcl.SyntaxID{}
}
if err := o.TransferSyntax.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
})
_s_xfersyntax := func(ptr interface{}) { o.TransferSyntax = *ptr.(**rpcl.SyntaxID) }
if err := w.ReadPointer(&o.TransferSyntax, _s_xfersyntax, _ptr_xfersyntax); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// obj_uuid {in} (1:{pointer=unique, alias=NSI_UUID_P_T}*(1))(2:{alias=GUID}(struct))
{
_ptr_obj_uuid := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if o.ObjectUUID == nil {
o.ObjectUUID = &dtyp.GUID{}
}
if err := o.ObjectUUID.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
})
_s_obj_uuid := func(ptr interface{}) { o.ObjectUUID = *ptr.(**dtyp.GUID) }
if err := w.ReadPointer(&o.ObjectUUID, _s_obj_uuid, _ptr_obj_uuid); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// binding_max_count {in} (1:(uint32))
{
if err := w.ReadData(&o.BindingMaxCount); err != nil {
return err
}
}
// MaxCacheAge {in} (1:(uint32))
{
if err := w.ReadData(&o.MaxCacheAge); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupBeginOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupBeginOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// import_context {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=NSI_NS_HANDLE_T, names=ndr_context_handle}(struct))
{
if o.ImportContext != nil {
if err := o.ImportContext.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&rpcl.Context{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
}
// status {out} (1:{pointer=ref}*(1)(uint16))
{
if err := w.WriteData(o.Status); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupBeginOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// import_context {out} (1:{pointer=ref}*(1))(2:{context_handle, alias=NSI_NS_HANDLE_T, names=ndr_context_handle}(struct))
{
if o.ImportContext == nil {
o.ImportContext = &rpcl.Context{}
}
if err := o.ImportContext.UnmarshalNDR(ctx, w); err != nil {
return err
}
}
// status {out} (1:{pointer=ref}*(1)(uint16))
{
if err := w.ReadData(&o.Status); err != nil {
return err
}
}
return nil
}
// LookupBeginRequest structure represents the I_nsi_lookup_begin operation request
type LookupBeginRequest struct {
// entry_name_syntax: An identifier that represents the syntax used for entry_name.
// The value MUST be RPC_C_NS_SYNTAX_DCE.<8>
EntryNameSyntax uint32 `idl:"name:entry_name_syntax" json:"entry_name_syntax"`
// entry_name: A Unicode [UNICODE] string optionally specifying the entry name of the
// name service entry, using the syntax identified by the entry_name_syntax parameter,
// as specified in section 2.2.2. This parameter can optionally be null or an empty
// string.
EntryName string `idl:"name:entry_name" json:"entry_name"`
// interfaceid: An optional interface specification. Specified to request only bindings
// for server entries that have advertised interfaces compatible with this parameter.
// The client sets interfaceid to NULL to indicate that this parameter is not specified.
// Interface compatibility is specified in section 3.4.1.5.1.
InterfaceID *rpcl.SyntaxID `idl:"name:interfaceid;pointer:unique" json:"interface_id"`
// xfersyntax: An optional transfer syntax specification. Specified to request only
// bindings for server entries that have advertised interfaces compatible with this
// parameter. The client sets xfersyntax to NULL to indicate that this parameter is
// not specified. Interface compatibility is specified in section 3.4.1.5.1.
TransferSyntax *rpcl.SyntaxID `idl:"name:xfersyntax;pointer:unique" json:"transfer_syntax"`
// obj_uuid: An optional pointer to an object UUID specification. Specified to request
// only bindings for the server entries that export this object UUID. If the parameter
// is NULL or if it contains a null GUID, the parameter is ignored.
ObjectUUID *dtyp.GUID `idl:"name:obj_uuid" json:"object_uuid"`
// binding_max_count: The maximum number of elements allowed in the binding vector returned
// from the I_nsi_lookup_next method. If 0 is specified, an appropriate implementation-specific
// default maximum MUST be used.<9>
BindingMaxCount uint32 `idl:"name:binding_max_count" json:"binding_max_count"`
// MaxCacheAge: Specifies the maximum number of seconds that any results returned from
// a cache might have been present in the cache without being refreshed. This information
// is as specified in [C706] Part 2, Name Service Caching.
MaxCacheAge uint32 `idl:"name:MaxCacheAge" json:"max_cache_age"`
}
func (o *LookupBeginRequest) xxx_ToOp(ctx context.Context) *xxx_LookupBeginOperation {
if o == nil {
return &xxx_LookupBeginOperation{}
}
return &xxx_LookupBeginOperation{
EntryNameSyntax: o.EntryNameSyntax,
EntryName: o.EntryName,
InterfaceID: o.InterfaceID,
TransferSyntax: o.TransferSyntax,
ObjectUUID: o.ObjectUUID,
BindingMaxCount: o.BindingMaxCount,
MaxCacheAge: o.MaxCacheAge,
}
}
func (o *LookupBeginRequest) xxx_FromOp(ctx context.Context, op *xxx_LookupBeginOperation) {
if o == nil {
return
}
o.EntryNameSyntax = op.EntryNameSyntax
o.EntryName = op.EntryName
o.InterfaceID = op.InterfaceID
o.TransferSyntax = op.TransferSyntax
o.ObjectUUID = op.ObjectUUID
o.BindingMaxCount = op.BindingMaxCount
o.MaxCacheAge = op.MaxCacheAge
}
func (o *LookupBeginRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *LookupBeginRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_LookupBeginOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// LookupBeginResponse structure represents the I_nsi_lookup_begin operation response
type LookupBeginResponse struct {
// import_context: On successful completion of this method, returns a context handle
// for enumerating binding vectors by using the I_nsi_lookup_next method. This context
// handle MUST be closed by using the I_nsi_lookup_done method.
ImportContext *rpcl.Context `idl:"name:import_context" json:"import_context"`
// status: A 16-bit value that indicates the results of the method call. In case of
// success, the value MUST be NSI_S_OK. The value MUST be a nonzero value on failure.
// All failures MUST be treated identically as failure of the whole enumeration process.
Status uint16 `idl:"name:status" json:"status"`
}
func (o *LookupBeginResponse) xxx_ToOp(ctx context.Context) *xxx_LookupBeginOperation {
if o == nil {
return &xxx_LookupBeginOperation{}
}
return &xxx_LookupBeginOperation{
ImportContext: o.ImportContext,
Status: o.Status,
}
}
func (o *LookupBeginResponse) xxx_FromOp(ctx context.Context, op *xxx_LookupBeginOperation) {
if o == nil {
return
}
o.ImportContext = op.ImportContext
o.Status = op.Status
}
func (o *LookupBeginResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *LookupBeginResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_LookupBeginOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_LookupDoneOperation structure represents the I_nsi_lookup_done operation
type xxx_LookupDoneOperation struct {
ImportContext *rpcl.Context `idl:"name:import_context" json:"import_context"`
Status uint16 `idl:"name:status" json:"status"`
}
func (o *xxx_LookupDoneOperation) OpNum() int { return 1 }
func (o *xxx_LookupDoneOperation) OpName() string { return "/LocToLoc/v1/I_nsi_lookup_done" }
func (o *xxx_LookupDoneOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupDoneOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
// import_context {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=NSI_NS_HANDLE_T, names=ndr_context_handle}(struct))
{
if o.ImportContext != nil {
if err := o.ImportContext.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&rpcl.Context{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
}
return nil
}
func (o *xxx_LookupDoneOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
// import_context {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=NSI_NS_HANDLE_T, names=ndr_context_handle}(struct))
{
if o.ImportContext == nil {
o.ImportContext = &rpcl.Context{}
}
if err := o.ImportContext.UnmarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupDoneOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupDoneOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// import_context {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=NSI_NS_HANDLE_T, names=ndr_context_handle}(struct))
{
if o.ImportContext != nil {
if err := o.ImportContext.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&rpcl.Context{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
}
// status {out} (1:{pointer=ref}*(1)(uint16))
{
if err := w.WriteData(o.Status); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupDoneOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// import_context {in, out} (1:{pointer=ref}*(1))(2:{context_handle, alias=NSI_NS_HANDLE_T, names=ndr_context_handle}(struct))
{
if o.ImportContext == nil {
o.ImportContext = &rpcl.Context{}
}
if err := o.ImportContext.UnmarshalNDR(ctx, w); err != nil {
return err
}
}
// status {out} (1:{pointer=ref}*(1)(uint16))
{
if err := w.ReadData(&o.Status); err != nil {
return err
}
}
return nil
}
// LookupDoneRequest structure represents the I_nsi_lookup_done operation request
type LookupDoneRequest struct {
// import_context: A context handle returned by the server from a preceding call to
// the I_nsi_lookup_begin method. On successful completion, this parameter MUST be set
// to NULL by the server and MUST NOT be modified on failure.
ImportContext *rpcl.Context `idl:"name:import_context" json:"import_context"`
}
func (o *LookupDoneRequest) xxx_ToOp(ctx context.Context) *xxx_LookupDoneOperation {
if o == nil {
return &xxx_LookupDoneOperation{}
}
return &xxx_LookupDoneOperation{
ImportContext: o.ImportContext,
}
}
func (o *LookupDoneRequest) xxx_FromOp(ctx context.Context, op *xxx_LookupDoneOperation) {
if o == nil {
return
}
o.ImportContext = op.ImportContext
}
func (o *LookupDoneRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *LookupDoneRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_LookupDoneOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// LookupDoneResponse structure represents the I_nsi_lookup_done operation response
type LookupDoneResponse struct {
// import_context: A context handle returned by the server from a preceding call to
// the I_nsi_lookup_begin method. On successful completion, this parameter MUST be set
// to NULL by the server and MUST NOT be modified on failure.
ImportContext *rpcl.Context `idl:"name:import_context" json:"import_context"`
// status: A 16-bit value that indicates the results of the method call. In case of
// success, the value will contain NSI_S_OK, or a nonzero value on failure. All failures
// MUST be treated identically as a failure of the freeing process initiated by this
// method, but no further action is required by the caller.
Status uint16 `idl:"name:status" json:"status"`
}
func (o *LookupDoneResponse) xxx_ToOp(ctx context.Context) *xxx_LookupDoneOperation {
if o == nil {
return &xxx_LookupDoneOperation{}
}
return &xxx_LookupDoneOperation{
ImportContext: o.ImportContext,
Status: o.Status,
}
}
func (o *LookupDoneResponse) xxx_FromOp(ctx context.Context, op *xxx_LookupDoneOperation) {
if o == nil {
return
}
o.ImportContext = op.ImportContext
o.Status = op.Status
}
func (o *LookupDoneResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *LookupDoneResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_LookupDoneOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// xxx_LookupNextOperation structure represents the I_nsi_lookup_next operation
type xxx_LookupNextOperation struct {
ImportContext *rpcl.Context `idl:"name:import_context" json:"import_context"`
BindingVector *rpcl.BindingVector `idl:"name:binding_vector" json:"binding_vector"`
Status uint16 `idl:"name:status" json:"status"`
}
func (o *xxx_LookupNextOperation) OpNum() int { return 2 }
func (o *xxx_LookupNextOperation) OpName() string { return "/LocToLoc/v1/I_nsi_lookup_next" }
func (o *xxx_LookupNextOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupNextOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
// import_context {in} (1:{context_handle, alias=NSI_NS_HANDLE_T, names=ndr_context_handle}(struct))
{
if o.ImportContext != nil {
if err := o.ImportContext.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&rpcl.Context{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
}
return nil
}
func (o *xxx_LookupNextOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
// import_context {in} (1:{context_handle, alias=NSI_NS_HANDLE_T, names=ndr_context_handle}(struct))
{
if o.ImportContext == nil {
o.ImportContext = &rpcl.Context{}
}
if err := o.ImportContext.UnmarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupNextOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupNextOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// binding_vector {out} (1:{pointer=ref}*(2))(2:{pointer=unique, alias=NSI_BINDING_VECTOR_P_T}*(1))(3:{alias=NSI_BINDING_VECTOR_T}(struct))
{
if o.BindingVector != nil {
_ptr_binding_vector := ndr.MarshalNDRFunc(func(ctx context.Context, w ndr.Writer) error {
if o.BindingVector != nil {
if err := o.BindingVector.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&rpcl.BindingVector{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
return nil
})
if err := w.WritePointer(&o.BindingVector, _ptr_binding_vector); err != nil {
return err
}
} else {
if err := w.WritePointer(nil); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// status {out} (1:{pointer=ref}*(1)(uint16))
{
if err := w.WriteData(o.Status); err != nil {
return err
}
}
return nil
}
func (o *xxx_LookupNextOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// binding_vector {out} (1:{pointer=ref}*(2))(2:{pointer=unique, alias=NSI_BINDING_VECTOR_P_T}*(1))(3:{alias=NSI_BINDING_VECTOR_T}(struct))
{
_ptr_binding_vector := ndr.UnmarshalNDRFunc(func(ctx context.Context, w ndr.Reader) error {
if o.BindingVector == nil {
o.BindingVector = &rpcl.BindingVector{}
}
if err := o.BindingVector.UnmarshalNDR(ctx, w); err != nil {
return err
}
return nil
})
_s_binding_vector := func(ptr interface{}) { o.BindingVector = *ptr.(**rpcl.BindingVector) }
if err := w.ReadPointer(&o.BindingVector, _s_binding_vector, _ptr_binding_vector); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// status {out} (1:{pointer=ref}*(1)(uint16))
{
if err := w.ReadData(&o.Status); err != nil {
return err
}
}
return nil
}
// LookupNextRequest structure represents the I_nsi_lookup_next operation request
type LookupNextRequest struct {
// import_context: A context handle returned by a preceding call to the I_nsi_lookup_begin
// method.
ImportContext *rpcl.Context `idl:"name:import_context" json:"import_context"`
}
func (o *LookupNextRequest) xxx_ToOp(ctx context.Context) *xxx_LookupNextOperation {
if o == nil {
return &xxx_LookupNextOperation{}
}
return &xxx_LookupNextOperation{
ImportContext: o.ImportContext,
}
}
func (o *LookupNextRequest) xxx_FromOp(ctx context.Context, op *xxx_LookupNextOperation) {
if o == nil {
return
}
o.ImportContext = op.ImportContext
}
func (o *LookupNextRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *LookupNextRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_LookupNextOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// LookupNextResponse structure represents the I_nsi_lookup_next operation response
type LookupNextResponse struct {
// binding_vector: On successful completion, returns a vector containing bindings that
// satisfy the criteria defined in the preceding call to the I_nsi_lookup_begin method.
// The caller MUST not assume that the bindings are ordered. The client is responsible
// for freeing the memory allocated for the binding_vector. The memory allocated for
// the binding_vector does not need to be freed before subsequent calls to I_nsi_lookup_next.
BindingVector *rpcl.BindingVector `idl:"name:binding_vector" json:"binding_vector"`
// status: A 16-bit value that indicates the result of the method call. Any other values,
// except those listed as follows, MUST be treated as failures and MUST be treated identically.
// Failure is typically a serious condition (e.g., host out of memory) and SHOULD abort
// the current operation and then propagated to the higher-layer caller. In the event
// of failure, the caller SHOULD invoke I_nsi_lookup_done immediately, although it might
// fail as well.
//
// +-----------------------------------+----------------------------------------------------------------------------------+
// | | |
// | VALUE | MEANING |