This repository has been archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
nl_interface_offload_rod_flags.go
76 lines (59 loc) · 1.77 KB
/
nl_interface_offload_rod_flags.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
/* SPDX-License-Identifier: MIT
*
* Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
*/
package winipcfg
import "fmt"
type NlInterfaceOffloadRodFlags struct {
NlChecksumSupported bool
NlOptionsSupported bool
TlDatagramChecksumSupported bool
TlStreamChecksumSupported bool
TlStreamOptionsSupported bool
FastPathCompatible bool
TlLargeSendOffloadSupported bool
TlGiantSendOffloadSupported bool
}
func (iorf *NlInterfaceOffloadRodFlags) toWtNlInterfaceOffloadRod() wtNlInterfaceOffloadRodByte {
result := wtNlInterfaceOffloadRodByte(0)
if iorf.NlChecksumSupported {
result |= nlChecksumSupported
}
if iorf.NlOptionsSupported {
result |= nlOptionsSupported
}
if iorf.TlDatagramChecksumSupported {
result |= tlDatagramChecksumSupported
}
if iorf.TlStreamChecksumSupported {
result |= tlStreamChecksumSupported
}
if iorf.TlStreamOptionsSupported {
result |= tlStreamOptionsSupported
}
if iorf.FastPathCompatible {
result |= fastPathCompatible
}
if iorf.TlLargeSendOffloadSupported {
result |= tlLargeSendOffloadSupported
}
if iorf.TlGiantSendOffloadSupported {
result |= tlGiantSendOffloadSupported
}
return result
}
func (iorf *NlInterfaceOffloadRodFlags) String() string {
if iorf == nil {
return "<nil>"
}
return fmt.Sprintf(`NlChecksumSupported: %v
NlOptionsSupported: %v
TlDatagramChecksumSupported: %v
TlStreamChecksumSupported: %v
TlStreamOptionsSupported: %v
FastPathCompatible: %v
TlLargeSendOffloadSupported: %v
TlGiantSendOffloadSupported: %v`, iorf.NlChecksumSupported, iorf.NlOptionsSupported, iorf.TlDatagramChecksumSupported,
iorf.TlStreamChecksumSupported, iorf.TlStreamOptionsSupported, iorf.FastPathCompatible,
iorf.TlLargeSendOffloadSupported, iorf.TlGiantSendOffloadSupported)
}