This repository has been archived by the owner on Jan 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
iphlpapi.go
1250 lines (1133 loc) · 40.9 KB
/
iphlpapi.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
// This file was automatically generated by https://github.com/kbinani/win/blob/generator/internal/cmd/gen/gen.go
// go run internal/cmd/gen/gen.go
// +build windows
package win
import (
"syscall"
"unsafe"
)
var (
// Library
libiphlpapi uintptr
// Functions
addIPAddress uintptr
cancelIPChangeNotify uintptr
createIpForwardEntry uintptr
createIpNetEntry uintptr
createPersistentTcpPortReservation uintptr
createPersistentUdpPortReservation uintptr
createProxyArpEntry uintptr
deleteIPAddress uintptr
deleteIpForwardEntry uintptr
deleteIpNetEntry uintptr
deletePersistentTcpPortReservation uintptr
deletePersistentUdpPortReservation uintptr
deleteProxyArpEntry uintptr
disableMediaSense uintptr
enableRouter uintptr
flushIpNetTable uintptr
getAdapterIndex uintptr
getAdapterOrderMap uintptr
getAdaptersAddresses uintptr
getAdaptersInfo uintptr
getBestInterface uintptr
getBestInterfaceEx uintptr
getBestRoute uintptr
getExtendedTcpTable uintptr
getExtendedUdpTable uintptr
getFriendlyIfIndex uintptr
getIcmpStatistics uintptr
getIcmpStatisticsEx uintptr
getIfEntry uintptr
getIfTable uintptr
getInterfaceInfo uintptr
getIpAddrTable uintptr
getIpErrorString uintptr
getIpForwardTable uintptr
getIpNetTable uintptr
getIpStatistics uintptr
getIpStatisticsEx uintptr
getNetworkParams uintptr
getNumberOfInterfaces uintptr
getOwnerModuleFromTcp6Entry uintptr
getOwnerModuleFromTcpEntry uintptr
getOwnerModuleFromUdp6Entry uintptr
getOwnerModuleFromUdpEntry uintptr
getPerAdapterInfo uintptr
getPerTcp6ConnectionEStats uintptr
getPerTcpConnectionEStats uintptr
getRTTAndHopCount uintptr
getTcp6Table uintptr
getTcp6Table2 uintptr
getTcpStatistics uintptr
getTcpStatisticsEx uintptr
getTcpTable uintptr
getTcpTable2 uintptr
getUdp6Table uintptr
getUdpStatistics uintptr
getUdpStatisticsEx uintptr
getUdpTable uintptr
getUniDirectionalAdapterInfo uintptr
icmp6CreateFile uintptr
icmp6ParseReplies uintptr
icmp6SendEcho2 uintptr
icmpCloseHandle uintptr
icmpCreateFile uintptr
icmpParseReplies uintptr
icmpSendEcho uintptr
icmpSendEcho2 uintptr
ipReleaseAddress uintptr
ipRenewAddress uintptr
lookupPersistentTcpPortReservation uintptr
lookupPersistentUdpPortReservation uintptr
nhpAllocateAndGetInterfaceInfoFromStack uintptr
notifyAddrChange uintptr
notifyRouteChange uintptr
parseNetworkString uintptr
resolveNeighbor uintptr
restoreMediaSense uintptr
sendARP uintptr
setIfEntry uintptr
setIpForwardEntry uintptr
setIpNetEntry uintptr
setIpStatistics uintptr
setIpStatisticsEx uintptr
setIpTTL uintptr
setPerTcp6ConnectionEStats uintptr
setPerTcpConnectionEStats uintptr
setTcpEntry uintptr
unenableRouter uintptr
allocateAndGetIfTableFromStack uintptr
allocateAndGetIpAddrTableFromStack uintptr
allocateAndGetIpForwardTableFromStack uintptr
allocateAndGetIpNetTableFromStack uintptr
allocateAndGetTcpTableFromStack uintptr
allocateAndGetUdpTableFromStack uintptr
cancelMibChangeNotify2 uintptr
convertInterfaceGuidToLuid uintptr
convertInterfaceIndexToLuid uintptr
convertInterfaceLuidToGuid uintptr
convertInterfaceLuidToIndex uintptr
convertInterfaceLuidToName uintptr
convertInterfaceNameToLuid uintptr
createSortedAddressPairs uintptr
freeMibTable uintptr
getIfEntry2 uintptr
getIfTable2 uintptr
icmpSendEcho2Ex uintptr
notifyIpInterfaceChange uintptr
pfBindInterfaceToIPAddress uintptr
pfCreateInterface uintptr
pfDeleteInterface uintptr
pfUnBindInterface uintptr
)
func init() {
// Library
libiphlpapi = doLoadLibrary("iphlpapi.dll")
// Functions
addIPAddress = doGetProcAddress(libiphlpapi, "AddIPAddress")
cancelIPChangeNotify = doGetProcAddress(libiphlpapi, "CancelIPChangeNotify")
createIpForwardEntry = doGetProcAddress(libiphlpapi, "CreateIpForwardEntry")
createIpNetEntry = doGetProcAddress(libiphlpapi, "CreateIpNetEntry")
createPersistentTcpPortReservation = doGetProcAddress(libiphlpapi, "CreatePersistentTcpPortReservation")
createPersistentUdpPortReservation = doGetProcAddress(libiphlpapi, "CreatePersistentUdpPortReservation")
createProxyArpEntry = doGetProcAddress(libiphlpapi, "CreateProxyArpEntry")
deleteIPAddress = doGetProcAddress(libiphlpapi, "DeleteIPAddress")
deleteIpForwardEntry = doGetProcAddress(libiphlpapi, "DeleteIpForwardEntry")
deleteIpNetEntry = doGetProcAddress(libiphlpapi, "DeleteIpNetEntry")
deletePersistentTcpPortReservation = doGetProcAddress(libiphlpapi, "DeletePersistentTcpPortReservation")
deletePersistentUdpPortReservation = doGetProcAddress(libiphlpapi, "DeletePersistentUdpPortReservation")
deleteProxyArpEntry = doGetProcAddress(libiphlpapi, "DeleteProxyArpEntry")
disableMediaSense = doGetProcAddress(libiphlpapi, "DisableMediaSense")
enableRouter = doGetProcAddress(libiphlpapi, "EnableRouter")
flushIpNetTable = doGetProcAddress(libiphlpapi, "FlushIpNetTable")
getAdapterIndex = doGetProcAddress(libiphlpapi, "GetAdapterIndex")
getAdapterOrderMap = doGetProcAddress(libiphlpapi, "GetAdapterOrderMap")
getAdaptersAddresses = doGetProcAddress(libiphlpapi, "GetAdaptersAddresses")
getAdaptersInfo = doGetProcAddress(libiphlpapi, "GetAdaptersInfo")
getBestInterface = doGetProcAddress(libiphlpapi, "GetBestInterface")
getBestInterfaceEx = doGetProcAddress(libiphlpapi, "GetBestInterfaceEx")
getBestRoute = doGetProcAddress(libiphlpapi, "GetBestRoute")
getExtendedTcpTable = doGetProcAddress(libiphlpapi, "GetExtendedTcpTable")
getExtendedUdpTable = doGetProcAddress(libiphlpapi, "GetExtendedUdpTable")
getFriendlyIfIndex = doGetProcAddress(libiphlpapi, "GetFriendlyIfIndex")
getIcmpStatistics = doGetProcAddress(libiphlpapi, "GetIcmpStatistics")
getIcmpStatisticsEx = doGetProcAddress(libiphlpapi, "GetIcmpStatisticsEx")
getIfEntry = doGetProcAddress(libiphlpapi, "GetIfEntry")
getIfTable = doGetProcAddress(libiphlpapi, "GetIfTable")
getInterfaceInfo = doGetProcAddress(libiphlpapi, "GetInterfaceInfo")
getIpAddrTable = doGetProcAddress(libiphlpapi, "GetIpAddrTable")
getIpErrorString = doGetProcAddress(libiphlpapi, "GetIpErrorString")
getIpForwardTable = doGetProcAddress(libiphlpapi, "GetIpForwardTable")
getIpNetTable = doGetProcAddress(libiphlpapi, "GetIpNetTable")
getIpStatistics = doGetProcAddress(libiphlpapi, "GetIpStatistics")
getIpStatisticsEx = doGetProcAddress(libiphlpapi, "GetIpStatisticsEx")
getNetworkParams = doGetProcAddress(libiphlpapi, "GetNetworkParams")
getNumberOfInterfaces = doGetProcAddress(libiphlpapi, "GetNumberOfInterfaces")
getOwnerModuleFromTcp6Entry = doGetProcAddress(libiphlpapi, "GetOwnerModuleFromTcp6Entry")
getOwnerModuleFromTcpEntry = doGetProcAddress(libiphlpapi, "GetOwnerModuleFromTcpEntry")
getOwnerModuleFromUdp6Entry = doGetProcAddress(libiphlpapi, "GetOwnerModuleFromUdp6Entry")
getOwnerModuleFromUdpEntry = doGetProcAddress(libiphlpapi, "GetOwnerModuleFromUdpEntry")
getPerAdapterInfo = doGetProcAddress(libiphlpapi, "GetPerAdapterInfo")
getPerTcp6ConnectionEStats = doGetProcAddress(libiphlpapi, "GetPerTcp6ConnectionEStats")
getPerTcpConnectionEStats = doGetProcAddress(libiphlpapi, "GetPerTcpConnectionEStats")
getRTTAndHopCount = doGetProcAddress(libiphlpapi, "GetRTTAndHopCount")
getTcp6Table = doGetProcAddress(libiphlpapi, "GetTcp6Table")
getTcp6Table2 = doGetProcAddress(libiphlpapi, "GetTcp6Table2")
getTcpStatistics = doGetProcAddress(libiphlpapi, "GetTcpStatistics")
getTcpStatisticsEx = doGetProcAddress(libiphlpapi, "GetTcpStatisticsEx")
getTcpTable = doGetProcAddress(libiphlpapi, "GetTcpTable")
getTcpTable2 = doGetProcAddress(libiphlpapi, "GetTcpTable2")
getUdp6Table = doGetProcAddress(libiphlpapi, "GetUdp6Table")
getUdpStatistics = doGetProcAddress(libiphlpapi, "GetUdpStatistics")
getUdpStatisticsEx = doGetProcAddress(libiphlpapi, "GetUdpStatisticsEx")
getUdpTable = doGetProcAddress(libiphlpapi, "GetUdpTable")
getUniDirectionalAdapterInfo = doGetProcAddress(libiphlpapi, "GetUniDirectionalAdapterInfo")
icmp6CreateFile = doGetProcAddress(libiphlpapi, "Icmp6CreateFile")
icmp6ParseReplies = doGetProcAddress(libiphlpapi, "Icmp6ParseReplies")
icmp6SendEcho2 = doGetProcAddress(libiphlpapi, "Icmp6SendEcho2")
icmpCloseHandle = doGetProcAddress(libiphlpapi, "IcmpCloseHandle")
icmpCreateFile = doGetProcAddress(libiphlpapi, "IcmpCreateFile")
icmpParseReplies = doGetProcAddress(libiphlpapi, "IcmpParseReplies")
icmpSendEcho = doGetProcAddress(libiphlpapi, "IcmpSendEcho")
icmpSendEcho2 = doGetProcAddress(libiphlpapi, "IcmpSendEcho2")
ipReleaseAddress = doGetProcAddress(libiphlpapi, "IpReleaseAddress")
ipRenewAddress = doGetProcAddress(libiphlpapi, "IpRenewAddress")
lookupPersistentTcpPortReservation = doGetProcAddress(libiphlpapi, "LookupPersistentTcpPortReservation")
lookupPersistentUdpPortReservation = doGetProcAddress(libiphlpapi, "LookupPersistentUdpPortReservation")
nhpAllocateAndGetInterfaceInfoFromStack = doGetProcAddress(libiphlpapi, "NhpAllocateAndGetInterfaceInfoFromStack")
notifyAddrChange = doGetProcAddress(libiphlpapi, "NotifyAddrChange")
notifyRouteChange = doGetProcAddress(libiphlpapi, "NotifyRouteChange")
parseNetworkString = doGetProcAddress(libiphlpapi, "ParseNetworkString")
resolveNeighbor = doGetProcAddress(libiphlpapi, "ResolveNeighbor")
restoreMediaSense = doGetProcAddress(libiphlpapi, "RestoreMediaSense")
sendARP = doGetProcAddress(libiphlpapi, "SendARP")
setIfEntry = doGetProcAddress(libiphlpapi, "SetIfEntry")
setIpForwardEntry = doGetProcAddress(libiphlpapi, "SetIpForwardEntry")
setIpNetEntry = doGetProcAddress(libiphlpapi, "SetIpNetEntry")
setIpStatistics = doGetProcAddress(libiphlpapi, "SetIpStatistics")
setIpStatisticsEx = doGetProcAddress(libiphlpapi, "SetIpStatisticsEx")
setIpTTL = doGetProcAddress(libiphlpapi, "SetIpTTL")
setPerTcp6ConnectionEStats = doGetProcAddress(libiphlpapi, "SetPerTcp6ConnectionEStats")
setPerTcpConnectionEStats = doGetProcAddress(libiphlpapi, "SetPerTcpConnectionEStats")
setTcpEntry = doGetProcAddress(libiphlpapi, "SetTcpEntry")
unenableRouter = doGetProcAddress(libiphlpapi, "UnenableRouter")
allocateAndGetIfTableFromStack = doGetProcAddress(libiphlpapi, "AllocateAndGetIfTableFromStack")
allocateAndGetIpAddrTableFromStack = doGetProcAddress(libiphlpapi, "AllocateAndGetIpAddrTableFromStack")
allocateAndGetIpForwardTableFromStack = doGetProcAddress(libiphlpapi, "AllocateAndGetIpForwardTableFromStack")
allocateAndGetIpNetTableFromStack = doGetProcAddress(libiphlpapi, "AllocateAndGetIpNetTableFromStack")
allocateAndGetTcpTableFromStack = doGetProcAddress(libiphlpapi, "AllocateAndGetTcpTableFromStack")
allocateAndGetUdpTableFromStack = doGetProcAddress(libiphlpapi, "AllocateAndGetUdpTableFromStack")
cancelMibChangeNotify2 = doGetProcAddress(libiphlpapi, "CancelMibChangeNotify2")
convertInterfaceGuidToLuid = doGetProcAddress(libiphlpapi, "ConvertInterfaceGuidToLuid")
convertInterfaceIndexToLuid = doGetProcAddress(libiphlpapi, "ConvertInterfaceIndexToLuid")
convertInterfaceLuidToGuid = doGetProcAddress(libiphlpapi, "ConvertInterfaceLuidToGuid")
convertInterfaceLuidToIndex = doGetProcAddress(libiphlpapi, "ConvertInterfaceLuidToIndex")
convertInterfaceLuidToName = doGetProcAddress(libiphlpapi, "ConvertInterfaceLuidToNameW")
convertInterfaceNameToLuid = doGetProcAddress(libiphlpapi, "ConvertInterfaceNameToLuidW")
createSortedAddressPairs = doGetProcAddress(libiphlpapi, "CreateSortedAddressPairs")
freeMibTable = doGetProcAddress(libiphlpapi, "FreeMibTable")
getIfEntry2 = doGetProcAddress(libiphlpapi, "GetIfEntry2")
getIfTable2 = doGetProcAddress(libiphlpapi, "GetIfTable2")
icmpSendEcho2Ex = doGetProcAddress(libiphlpapi, "IcmpSendEcho2Ex")
notifyIpInterfaceChange = doGetProcAddress(libiphlpapi, "NotifyIpInterfaceChange")
pfBindInterfaceToIPAddress = doGetProcAddress(libiphlpapi, "PfBindInterfaceToIPAddress")
pfCreateInterface = doGetProcAddress(libiphlpapi, "PfCreateInterface")
pfDeleteInterface = doGetProcAddress(libiphlpapi, "PfDeleteInterface")
pfUnBindInterface = doGetProcAddress(libiphlpapi, "PfUnBindInterface")
}
func AddIPAddress(address IPAddr, ipMask IPMask, ifIndex DWORD, nTEContext *uint32, nTEInstance *uint32) DWORD {
ret1 := syscall6(addIPAddress, 5,
uintptr(address),
uintptr(ipMask),
uintptr(ifIndex),
uintptr(unsafe.Pointer(nTEContext)),
uintptr(unsafe.Pointer(nTEInstance)),
0)
return DWORD(ret1)
}
func CancelIPChangeNotify(notifyOverlapped *OVERLAPPED) bool {
ret1 := syscall3(cancelIPChangeNotify, 1,
uintptr(unsafe.Pointer(notifyOverlapped)),
0,
0)
return ret1 != 0
}
func CreateIpForwardEntry(pRoute PMIB_IPFORWARDROW) DWORD {
ret1 := syscall3(createIpForwardEntry, 1,
uintptr(unsafe.Pointer(pRoute)),
0,
0)
return DWORD(ret1)
}
func CreateIpNetEntry(pArpEntry PMIB_IPNETROW) DWORD {
ret1 := syscall3(createIpNetEntry, 1,
uintptr(unsafe.Pointer(pArpEntry)),
0,
0)
return DWORD(ret1)
}
func CreatePersistentTcpPortReservation(startPort USHORT, numberOfPorts USHORT, token PULONG64) ULONG {
ret1 := syscall3(createPersistentTcpPortReservation, 3,
uintptr(startPort),
uintptr(numberOfPorts),
uintptr(unsafe.Pointer(token)))
return ULONG(ret1)
}
func CreatePersistentUdpPortReservation(startPort USHORT, numberOfPorts USHORT, token PULONG64) ULONG {
ret1 := syscall3(createPersistentUdpPortReservation, 3,
uintptr(startPort),
uintptr(numberOfPorts),
uintptr(unsafe.Pointer(token)))
return ULONG(ret1)
}
func CreateProxyArpEntry(dwAddress DWORD, dwMask DWORD, dwIfIndex DWORD) DWORD {
ret1 := syscall3(createProxyArpEntry, 3,
uintptr(dwAddress),
uintptr(dwMask),
uintptr(dwIfIndex))
return DWORD(ret1)
}
func DeleteIPAddress(nTEContext ULONG) DWORD {
ret1 := syscall3(deleteIPAddress, 1,
uintptr(nTEContext),
0,
0)
return DWORD(ret1)
}
func DeleteIpForwardEntry(pRoute PMIB_IPFORWARDROW) DWORD {
ret1 := syscall3(deleteIpForwardEntry, 1,
uintptr(unsafe.Pointer(pRoute)),
0,
0)
return DWORD(ret1)
}
func DeleteIpNetEntry(pArpEntry PMIB_IPNETROW) DWORD {
ret1 := syscall3(deleteIpNetEntry, 1,
uintptr(unsafe.Pointer(pArpEntry)),
0,
0)
return DWORD(ret1)
}
func DeletePersistentTcpPortReservation(startPort USHORT, numberOfPorts USHORT) ULONG {
ret1 := syscall3(deletePersistentTcpPortReservation, 2,
uintptr(startPort),
uintptr(numberOfPorts),
0)
return ULONG(ret1)
}
func DeletePersistentUdpPortReservation(startPort USHORT, numberOfPorts USHORT) ULONG {
ret1 := syscall3(deletePersistentUdpPortReservation, 2,
uintptr(startPort),
uintptr(numberOfPorts),
0)
return ULONG(ret1)
}
func DeleteProxyArpEntry(dwAddress DWORD, dwMask DWORD, dwIfIndex DWORD) DWORD {
ret1 := syscall3(deleteProxyArpEntry, 3,
uintptr(dwAddress),
uintptr(dwMask),
uintptr(dwIfIndex))
return DWORD(ret1)
}
func DisableMediaSense(pHandle *HANDLE, pOverLapped *OVERLAPPED) DWORD {
ret1 := syscall3(disableMediaSense, 2,
uintptr(unsafe.Pointer(pHandle)),
uintptr(unsafe.Pointer(pOverLapped)),
0)
return DWORD(ret1)
}
func EnableRouter(pHandle *HANDLE, pOverlapped *OVERLAPPED) DWORD {
ret1 := syscall3(enableRouter, 2,
uintptr(unsafe.Pointer(pHandle)),
uintptr(unsafe.Pointer(pOverlapped)),
0)
return DWORD(ret1)
}
func FlushIpNetTable(dwIfIndex DWORD) DWORD {
ret1 := syscall3(flushIpNetTable, 1,
uintptr(dwIfIndex),
0,
0)
return DWORD(ret1)
}
func GetAdapterIndex(adapterName LPWSTR, ifIndex *uint32) DWORD {
ret1 := syscall3(getAdapterIndex, 2,
uintptr(unsafe.Pointer(adapterName)),
uintptr(unsafe.Pointer(ifIndex)),
0)
return DWORD(ret1)
}
func GetAdapterOrderMap() PIP_ADAPTER_ORDER_MAP {
ret1 := syscall3(getAdapterOrderMap, 0,
0,
0,
0)
return (PIP_ADAPTER_ORDER_MAP)(unsafe.Pointer(ret1))
}
func GetAdaptersAddresses(family ULONG, flags ULONG, reserved uintptr, adapterAddresses PIP_ADAPTER_ADDRESSES, sizePointer *uint32) ULONG {
ret1 := syscall6(getAdaptersAddresses, 5,
uintptr(family),
uintptr(flags),
reserved,
uintptr(unsafe.Pointer(adapterAddresses)),
uintptr(unsafe.Pointer(sizePointer)),
0)
return ULONG(ret1)
}
func GetAdaptersInfo(adapterInfo PIP_ADAPTER_INFO, sizePointer *uint32) ULONG {
ret1 := syscall3(getAdaptersInfo, 2,
uintptr(unsafe.Pointer(adapterInfo)),
uintptr(unsafe.Pointer(sizePointer)),
0)
return ULONG(ret1)
}
func GetBestInterface(dwDestAddr IPAddr, pdwBestIfIndex *DWORD) DWORD {
ret1 := syscall3(getBestInterface, 2,
uintptr(dwDestAddr),
uintptr(unsafe.Pointer(pdwBestIfIndex)),
0)
return DWORD(ret1)
}
func GetBestInterfaceEx(pDestAddr *Sockaddr, pdwBestIfIndex *DWORD) DWORD {
ret1 := syscall3(getBestInterfaceEx, 2,
uintptr(unsafe.Pointer(pDestAddr)),
uintptr(unsafe.Pointer(pdwBestIfIndex)),
0)
return DWORD(ret1)
}
func GetBestRoute(dwDestAddr DWORD, dwSourceAddr DWORD, pBestRoute PMIB_IPFORWARDROW) DWORD {
ret1 := syscall3(getBestRoute, 3,
uintptr(dwDestAddr),
uintptr(dwSourceAddr),
uintptr(unsafe.Pointer(pBestRoute)))
return DWORD(ret1)
}
func GetExtendedTcpTable(pTcpTable uintptr, pdwSize *DWORD, bOrder bool, ulAf ULONG, tableClass TCP_TABLE_CLASS, reserved ULONG) DWORD {
ret1 := syscall6(getExtendedTcpTable, 6,
pTcpTable,
uintptr(unsafe.Pointer(pdwSize)),
getUintptrFromBool(bOrder),
uintptr(ulAf),
uintptr(tableClass),
uintptr(reserved))
return DWORD(ret1)
}
func GetExtendedUdpTable(pUdpTable uintptr, pdwSize *DWORD, bOrder bool, ulAf ULONG, tableClass UDP_TABLE_CLASS, reserved ULONG) DWORD {
ret1 := syscall6(getExtendedUdpTable, 6,
pUdpTable,
uintptr(unsafe.Pointer(pdwSize)),
getUintptrFromBool(bOrder),
uintptr(ulAf),
uintptr(tableClass),
uintptr(reserved))
return DWORD(ret1)
}
func GetFriendlyIfIndex(ifIndex DWORD) DWORD {
ret1 := syscall3(getFriendlyIfIndex, 1,
uintptr(ifIndex),
0,
0)
return DWORD(ret1)
}
func GetIcmpStatistics(statistics PMIB_ICMP) ULONG {
ret1 := syscall3(getIcmpStatistics, 1,
uintptr(unsafe.Pointer(statistics)),
0,
0)
return ULONG(ret1)
}
func GetIcmpStatisticsEx(statistics PMIB_ICMP_EX, family ULONG) ULONG {
ret1 := syscall3(getIcmpStatisticsEx, 2,
uintptr(unsafe.Pointer(statistics)),
uintptr(family),
0)
return ULONG(ret1)
}
func GetIfEntry(pIfRow PMIB_IFROW) DWORD {
ret1 := syscall3(getIfEntry, 1,
uintptr(unsafe.Pointer(pIfRow)),
0,
0)
return DWORD(ret1)
}
func GetIfTable(pIfTable PMIB_IFTABLE, pdwSize *uint32, bOrder bool) DWORD {
ret1 := syscall3(getIfTable, 3,
uintptr(unsafe.Pointer(pIfTable)),
uintptr(unsafe.Pointer(pdwSize)),
getUintptrFromBool(bOrder))
return DWORD(ret1)
}
func GetInterfaceInfo(pIfTable PIP_INTERFACE_INFO, dwOutBufLen *uint32) DWORD {
ret1 := syscall3(getInterfaceInfo, 2,
uintptr(unsafe.Pointer(pIfTable)),
uintptr(unsafe.Pointer(dwOutBufLen)),
0)
return DWORD(ret1)
}
func GetIpAddrTable(pIpAddrTable PMIB_IPADDRTABLE, pdwSize *uint32, bOrder bool) DWORD {
ret1 := syscall3(getIpAddrTable, 3,
uintptr(unsafe.Pointer(pIpAddrTable)),
uintptr(unsafe.Pointer(pdwSize)),
getUintptrFromBool(bOrder))
return DWORD(ret1)
}
func GetIpErrorString(errorCode IP_STATUS, buffer PWSTR, size *DWORD) DWORD {
ret1 := syscall3(getIpErrorString, 3,
uintptr(errorCode),
uintptr(unsafe.Pointer(buffer)),
uintptr(unsafe.Pointer(size)))
return DWORD(ret1)
}
func GetIpForwardTable(pIpForwardTable PMIB_IPFORWARDTABLE, pdwSize *uint32, bOrder bool) DWORD {
ret1 := syscall3(getIpForwardTable, 3,
uintptr(unsafe.Pointer(pIpForwardTable)),
uintptr(unsafe.Pointer(pdwSize)),
getUintptrFromBool(bOrder))
return DWORD(ret1)
}
func GetIpNetTable(ipNetTable PMIB_IPNETTABLE, sizePointer *uint32, order bool) ULONG {
ret1 := syscall3(getIpNetTable, 3,
uintptr(unsafe.Pointer(ipNetTable)),
uintptr(unsafe.Pointer(sizePointer)),
getUintptrFromBool(order))
return ULONG(ret1)
}
func GetIpStatistics(statistics PMIB_IPSTATS) ULONG {
ret1 := syscall3(getIpStatistics, 1,
uintptr(unsafe.Pointer(statistics)),
0,
0)
return ULONG(ret1)
}
func GetIpStatisticsEx(statistics PMIB_IPSTATS, family ULONG) ULONG {
ret1 := syscall3(getIpStatisticsEx, 2,
uintptr(unsafe.Pointer(statistics)),
uintptr(family),
0)
return ULONG(ret1)
}
func GetNetworkParams(pFixedInfo PFIXED_INFO, pOutBufLen *uint32) DWORD {
ret1 := syscall3(getNetworkParams, 2,
uintptr(unsafe.Pointer(pFixedInfo)),
uintptr(unsafe.Pointer(pOutBufLen)),
0)
return DWORD(ret1)
}
func GetNumberOfInterfaces(pdwNumIf *DWORD) DWORD {
ret1 := syscall3(getNumberOfInterfaces, 1,
uintptr(unsafe.Pointer(pdwNumIf)),
0,
0)
return DWORD(ret1)
}
func GetOwnerModuleFromTcp6Entry(pTcpEntry PMIB_TCP6ROW_OWNER_MODULE, class TCPIP_OWNER_MODULE_INFO_CLASS, pBuffer uintptr, pdwSize *DWORD) DWORD {
ret1 := syscall6(getOwnerModuleFromTcp6Entry, 4,
uintptr(unsafe.Pointer(pTcpEntry)),
uintptr(class),
pBuffer,
uintptr(unsafe.Pointer(pdwSize)),
0,
0)
return DWORD(ret1)
}
func GetOwnerModuleFromTcpEntry(pTcpEntry PMIB_TCPROW_OWNER_MODULE, class TCPIP_OWNER_MODULE_INFO_CLASS, pBuffer uintptr, pdwSize *DWORD) DWORD {
ret1 := syscall6(getOwnerModuleFromTcpEntry, 4,
uintptr(unsafe.Pointer(pTcpEntry)),
uintptr(class),
pBuffer,
uintptr(unsafe.Pointer(pdwSize)),
0,
0)
return DWORD(ret1)
}
func GetOwnerModuleFromUdp6Entry(pUdpEntry PMIB_UDP6ROW_OWNER_MODULE, class TCPIP_OWNER_MODULE_INFO_CLASS, pBuffer uintptr, pdwSize *DWORD) DWORD {
ret1 := syscall6(getOwnerModuleFromUdp6Entry, 4,
uintptr(unsafe.Pointer(pUdpEntry)),
uintptr(class),
pBuffer,
uintptr(unsafe.Pointer(pdwSize)),
0,
0)
return DWORD(ret1)
}
func GetOwnerModuleFromUdpEntry(pUdpEntry PMIB_UDPROW_OWNER_MODULE, class TCPIP_OWNER_MODULE_INFO_CLASS, pBuffer uintptr, pdwSize *DWORD) DWORD {
ret1 := syscall6(getOwnerModuleFromUdpEntry, 4,
uintptr(unsafe.Pointer(pUdpEntry)),
uintptr(class),
pBuffer,
uintptr(unsafe.Pointer(pdwSize)),
0,
0)
return DWORD(ret1)
}
func GetPerAdapterInfo(ifIndex ULONG, pPerAdapterInfo PIP_PER_ADAPTER_INFO, pOutBufLen *uint32) DWORD {
ret1 := syscall3(getPerAdapterInfo, 3,
uintptr(ifIndex),
uintptr(unsafe.Pointer(pPerAdapterInfo)),
uintptr(unsafe.Pointer(pOutBufLen)))
return DWORD(ret1)
}
func GetPerTcp6ConnectionEStats(row PMIB_TCP6ROW, estatsType TCP_ESTATS_TYPE, rw PUCHAR, rwVersion ULONG, rwSize ULONG, ros PUCHAR, rosVersion ULONG, rosSize ULONG, rod PUCHAR, rodVersion ULONG, rodSize ULONG) ULONG {
ret1 := syscall12(getPerTcp6ConnectionEStats, 11,
uintptr(unsafe.Pointer(row)),
uintptr(estatsType),
uintptr(unsafe.Pointer(rw)),
uintptr(rwVersion),
uintptr(rwSize),
uintptr(unsafe.Pointer(ros)),
uintptr(rosVersion),
uintptr(rosSize),
uintptr(unsafe.Pointer(rod)),
uintptr(rodVersion),
uintptr(rodSize),
0)
return ULONG(ret1)
}
func GetPerTcpConnectionEStats(row PMIB_TCPROW, estatsType TCP_ESTATS_TYPE, rw PUCHAR, rwVersion ULONG, rwSize ULONG, ros PUCHAR, rosVersion ULONG, rosSize ULONG, rod PUCHAR, rodVersion ULONG, rodSize ULONG) ULONG {
ret1 := syscall12(getPerTcpConnectionEStats, 11,
uintptr(unsafe.Pointer(row)),
uintptr(estatsType),
uintptr(unsafe.Pointer(rw)),
uintptr(rwVersion),
uintptr(rwSize),
uintptr(unsafe.Pointer(ros)),
uintptr(rosVersion),
uintptr(rosSize),
uintptr(unsafe.Pointer(rod)),
uintptr(rodVersion),
uintptr(rodSize),
0)
return ULONG(ret1)
}
func GetRTTAndHopCount(destIpAddress IPAddr, hopCount *uint32, maxHops ULONG, rTT *uint32) bool {
ret1 := syscall6(getRTTAndHopCount, 4,
uintptr(destIpAddress),
uintptr(unsafe.Pointer(hopCount)),
uintptr(maxHops),
uintptr(unsafe.Pointer(rTT)),
0,
0)
return ret1 != 0
}
func GetTcp6Table(tcpTable PMIB_TCP6TABLE, sizePointer *uint32, order bool) ULONG {
ret1 := syscall3(getTcp6Table, 3,
uintptr(unsafe.Pointer(tcpTable)),
uintptr(unsafe.Pointer(sizePointer)),
getUintptrFromBool(order))
return ULONG(ret1)
}
func GetTcp6Table2(tcpTable PMIB_TCP6TABLE2, sizePointer *uint32, order bool) ULONG {
ret1 := syscall3(getTcp6Table2, 3,
uintptr(unsafe.Pointer(tcpTable)),
uintptr(unsafe.Pointer(sizePointer)),
getUintptrFromBool(order))
return ULONG(ret1)
}
func GetTcpStatistics(statistics PMIB_TCPSTATS) ULONG {
ret1 := syscall3(getTcpStatistics, 1,
uintptr(unsafe.Pointer(statistics)),
0,
0)
return ULONG(ret1)
}
func GetTcpStatisticsEx(statistics PMIB_TCPSTATS, family ULONG) ULONG {
ret1 := syscall3(getTcpStatisticsEx, 2,
uintptr(unsafe.Pointer(statistics)),
uintptr(family),
0)
return ULONG(ret1)
}
func GetTcpTable(tcpTable PMIB_TCPTABLE, sizePointer *uint32, order bool) ULONG {
ret1 := syscall3(getTcpTable, 3,
uintptr(unsafe.Pointer(tcpTable)),
uintptr(unsafe.Pointer(sizePointer)),
getUintptrFromBool(order))
return ULONG(ret1)
}
func GetTcpTable2(tcpTable PMIB_TCPTABLE2, sizePointer *uint32, order bool) ULONG {
ret1 := syscall3(getTcpTable2, 3,
uintptr(unsafe.Pointer(tcpTable)),
uintptr(unsafe.Pointer(sizePointer)),
getUintptrFromBool(order))
return ULONG(ret1)
}
func GetUdp6Table(udp6Table PMIB_UDP6TABLE, sizePointer *uint32, order bool) ULONG {
ret1 := syscall3(getUdp6Table, 3,
uintptr(unsafe.Pointer(udp6Table)),
uintptr(unsafe.Pointer(sizePointer)),
getUintptrFromBool(order))
return ULONG(ret1)
}
func GetUdpStatistics(stats PMIB_UDPSTATS) ULONG {
ret1 := syscall3(getUdpStatistics, 1,
uintptr(unsafe.Pointer(stats)),
0,
0)
return ULONG(ret1)
}
func GetUdpStatisticsEx(statistics PMIB_UDPSTATS, family ULONG) ULONG {
ret1 := syscall3(getUdpStatisticsEx, 2,
uintptr(unsafe.Pointer(statistics)),
uintptr(family),
0)
return ULONG(ret1)
}
func GetUdpTable(udpTable PMIB_UDPTABLE, sizePointer *uint32, order bool) ULONG {
ret1 := syscall3(getUdpTable, 3,
uintptr(unsafe.Pointer(udpTable)),
uintptr(unsafe.Pointer(sizePointer)),
getUintptrFromBool(order))
return ULONG(ret1)
}
func GetUniDirectionalAdapterInfo(pIPIfInfo PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS, dwOutBufLen *uint32) DWORD {
ret1 := syscall3(getUniDirectionalAdapterInfo, 2,
uintptr(unsafe.Pointer(pIPIfInfo)),
uintptr(unsafe.Pointer(dwOutBufLen)),
0)
return DWORD(ret1)
}
func Icmp6CreateFile() HANDLE {
ret1 := syscall3(icmp6CreateFile, 0,
0,
0,
0)
return HANDLE(ret1)
}
func Icmp6ParseReplies(replyBuffer LPVOID, replySize DWORD) DWORD {
ret1 := syscall3(icmp6ParseReplies, 2,
uintptr(unsafe.Pointer(replyBuffer)),
uintptr(replySize),
0)
return DWORD(ret1)
}
func Icmp6SendEcho2(icmpHandle HANDLE, event HANDLE, apcRoutine PIO_APC_ROUTINE, apcContext uintptr, sourceAddress *SOCKADDR_IN6_LH, destinationAddress *SOCKADDR_IN6_LH, requestData LPVOID, requestSize WORD, requestOptions PIP_OPTION_INFORMATION, replyBuffer LPVOID, replySize DWORD, timeout DWORD) DWORD {
apcRoutineCallback := syscall.NewCallback(apcRoutine)
ret1 := syscall12(icmp6SendEcho2, 12,
uintptr(icmpHandle),
uintptr(event),
apcRoutineCallback,
apcContext,
uintptr(unsafe.Pointer(sourceAddress)),
uintptr(unsafe.Pointer(destinationAddress)),
uintptr(unsafe.Pointer(requestData)),
uintptr(requestSize),
uintptr(unsafe.Pointer(requestOptions)),
uintptr(unsafe.Pointer(replyBuffer)),
uintptr(replySize),
uintptr(timeout))
return DWORD(ret1)
}
func IcmpCloseHandle(icmpHandle HANDLE) bool {
ret1 := syscall3(icmpCloseHandle, 1,
uintptr(icmpHandle),
0,
0)
return ret1 != 0
}
func IcmpCreateFile() HANDLE {
ret1 := syscall3(icmpCreateFile, 0,
0,
0,
0)
return HANDLE(ret1)
}
func IcmpParseReplies(replyBuffer LPVOID, replySize DWORD) DWORD {
ret1 := syscall3(icmpParseReplies, 2,
uintptr(unsafe.Pointer(replyBuffer)),
uintptr(replySize),
0)
return DWORD(ret1)
}
func IcmpSendEcho(icmpHandle HANDLE, destinationAddress IPAddr, requestData LPVOID, requestSize WORD, requestOptions PIP_OPTION_INFORMATION, replyBuffer LPVOID, replySize DWORD, timeout DWORD) DWORD {
ret1 := syscall9(icmpSendEcho, 8,
uintptr(icmpHandle),
uintptr(destinationAddress),
uintptr(unsafe.Pointer(requestData)),
uintptr(requestSize),
uintptr(unsafe.Pointer(requestOptions)),
uintptr(unsafe.Pointer(replyBuffer)),
uintptr(replySize),
uintptr(timeout),
0)
return DWORD(ret1)
}
func IcmpSendEcho2(icmpHandle HANDLE, event HANDLE, apcRoutine PIO_APC_ROUTINE, apcContext uintptr, destinationAddress IPAddr, requestData LPVOID, requestSize WORD, requestOptions PIP_OPTION_INFORMATION, replyBuffer LPVOID, replySize DWORD, timeout DWORD) DWORD {
apcRoutineCallback := syscall.NewCallback(apcRoutine)
ret1 := syscall12(icmpSendEcho2, 11,
uintptr(icmpHandle),
uintptr(event),
apcRoutineCallback,
apcContext,
uintptr(destinationAddress),
uintptr(unsafe.Pointer(requestData)),
uintptr(requestSize),
uintptr(unsafe.Pointer(requestOptions)),
uintptr(unsafe.Pointer(replyBuffer)),
uintptr(replySize),
uintptr(timeout),
0)
return DWORD(ret1)
}
func IpReleaseAddress(adapterInfo PIP_ADAPTER_INDEX_MAP) DWORD {
ret1 := syscall3(ipReleaseAddress, 1,
uintptr(unsafe.Pointer(adapterInfo)),
0,
0)
return DWORD(ret1)
}
func IpRenewAddress(adapterInfo PIP_ADAPTER_INDEX_MAP) DWORD {
ret1 := syscall3(ipRenewAddress, 1,
uintptr(unsafe.Pointer(adapterInfo)),
0,
0)
return DWORD(ret1)
}
func LookupPersistentTcpPortReservation(startPort USHORT, numberOfPorts USHORT, token PULONG64) ULONG {
ret1 := syscall3(lookupPersistentTcpPortReservation, 3,
uintptr(startPort),
uintptr(numberOfPorts),
uintptr(unsafe.Pointer(token)))
return ULONG(ret1)
}
func LookupPersistentUdpPortReservation(startPort USHORT, numberOfPorts USHORT, token PULONG64) ULONG {
ret1 := syscall3(lookupPersistentUdpPortReservation, 3,
uintptr(startPort),
uintptr(numberOfPorts),
uintptr(unsafe.Pointer(token)))
return ULONG(ret1)
}
func NhpAllocateAndGetInterfaceInfoFromStack(ppTable **IP_INTERFACE_NAME_INFO, pdwCount *DWORD, bOrder bool, hHeap HANDLE, dwFlags DWORD) DWORD {
ret1 := syscall6(nhpAllocateAndGetInterfaceInfoFromStack, 5,
uintptr(unsafe.Pointer(ppTable)),
uintptr(unsafe.Pointer(pdwCount)),
getUintptrFromBool(bOrder),
uintptr(hHeap),
uintptr(dwFlags),
0)
return DWORD(ret1)
}
func NotifyAddrChange(handle *HANDLE, overlapped *OVERLAPPED) DWORD {
ret1 := syscall3(notifyAddrChange, 2,
uintptr(unsafe.Pointer(handle)),
uintptr(unsafe.Pointer(overlapped)),
0)
return DWORD(ret1)
}
func NotifyRouteChange(handle *HANDLE, overlapped *OVERLAPPED) DWORD {
ret1 := syscall3(notifyRouteChange, 2,
uintptr(unsafe.Pointer(handle)),
uintptr(unsafe.Pointer(overlapped)),
0)
return DWORD(ret1)
}
func ParseNetworkString(networkString /*const*/ *WCHAR, types DWORD, addressInfo PNET_ADDRESS_INFO, portNumber *USHORT, prefixLength *byte) DWORD {
ret1 := syscall6(parseNetworkString, 5,
uintptr(unsafe.Pointer(networkString)),
uintptr(types),
uintptr(unsafe.Pointer(addressInfo)),
uintptr(unsafe.Pointer(portNumber)),
uintptr(unsafe.Pointer(prefixLength)),
0)
return DWORD(ret1)
}
func ResolveNeighbor(networkAddress *SOCKADDR, physicalAddress uintptr, physicalAddressLength *uint32) ULONG {
ret1 := syscall3(resolveNeighbor, 3,
uintptr(unsafe.Pointer(networkAddress)),
physicalAddress,
uintptr(unsafe.Pointer(physicalAddressLength)))
return ULONG(ret1)
}
func RestoreMediaSense(pOverlapped *OVERLAPPED, lpdwEnableCount *uint32) DWORD {
ret1 := syscall3(restoreMediaSense, 2,
uintptr(unsafe.Pointer(pOverlapped)),
uintptr(unsafe.Pointer(lpdwEnableCount)),
0)
return DWORD(ret1)
}
func SendARP(destIP IPAddr, srcIP IPAddr, pMacAddr uintptr, phyAddrLen *uint32) DWORD {
ret1 := syscall6(sendARP, 4,
uintptr(destIP),
uintptr(srcIP),
pMacAddr,
uintptr(unsafe.Pointer(phyAddrLen)),
0,
0)
return DWORD(ret1)
}
func SetIfEntry(pIfRow PMIB_IFROW) DWORD {
ret1 := syscall3(setIfEntry, 1,
uintptr(unsafe.Pointer(pIfRow)),
0,
0)
return DWORD(ret1)
}
func SetIpForwardEntry(pRoute PMIB_IPFORWARDROW) DWORD {
ret1 := syscall3(setIpForwardEntry, 1,
uintptr(unsafe.Pointer(pRoute)),
0,
0)
return DWORD(ret1)
}
func SetIpNetEntry(pArpEntry PMIB_IPNETROW) DWORD {
ret1 := syscall3(setIpNetEntry, 1,
uintptr(unsafe.Pointer(pArpEntry)),
0,
0)
return DWORD(ret1)
}
func SetIpStatistics(pIpStats PMIB_IPSTATS) DWORD {
ret1 := syscall3(setIpStatistics, 1,
uintptr(unsafe.Pointer(pIpStats)),
0,
0)
return DWORD(ret1)
}
func SetIpStatisticsEx(statistics PMIB_IPSTATS, family ULONG) ULONG {
ret1 := syscall3(setIpStatisticsEx, 2,
uintptr(unsafe.Pointer(statistics)),
uintptr(family),
0)
return ULONG(ret1)
}
func SetIpTTL(nTTL UINT) DWORD {
ret1 := syscall3(setIpTTL, 1,
uintptr(nTTL),
0,
0)
return DWORD(ret1)
}
func SetPerTcp6ConnectionEStats(row PMIB_TCP6ROW, estatsType TCP_ESTATS_TYPE, rw PUCHAR, rwVersion ULONG, rwSize ULONG, offset ULONG) ULONG {
ret1 := syscall6(setPerTcp6ConnectionEStats, 6,
uintptr(unsafe.Pointer(row)),
uintptr(estatsType),
uintptr(unsafe.Pointer(rw)),
uintptr(rwVersion),
uintptr(rwSize),
uintptr(offset))
return ULONG(ret1)
}