diff options
author | Simon Pasquier <spasquie@redhat.com> | 2019-09-12 17:55:41 +0200 |
---|---|---|
committer | Simon Pasquier <spasquie@redhat.com> | 2019-09-16 10:58:07 +0200 |
commit | a99ef58c4b7783e17576b8106e6825daabe26e10 (patch) | |
tree | 7eb0e8b9f7c8c652ee349531aba158f43140dfd1 | |
parent | e6f7dfaa503cb4297f1b3b0fdcafcc5324cae74f (diff) | |
download | prometheus_node_collector-a99ef58c4b7783e17576b8106e6825daabe26e10.tar.bz2 prometheus_node_collector-a99ef58c4b7783e17576b8106e6825daabe26e10.tar.xz prometheus_node_collector-a99ef58c4b7783e17576b8106e6825daabe26e10.zip |
Fix go.mod and vendor/
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
35 files changed, 10 insertions, 5919 deletions
@@ -24,3 +24,5 @@ require ( | |||
24 | golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 | 24 | golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 |
25 | gopkg.in/alecthomas/kingpin.v2 v2.2.6 | 25 | gopkg.in/alecthomas/kingpin.v2 v2.2.6 |
26 | ) | 26 | ) |
27 | |||
28 | go 1.13 | ||
diff --git a/vendor/golang.org/x/net/internal/iana/gen.go b/vendor/golang.org/x/net/internal/iana/gen.go deleted file mode 100644 index 2a7661c..0000000 --- a/vendor/golang.org/x/net/internal/iana/gen.go +++ /dev/null | |||
@@ -1,383 +0,0 @@ | |||
1 | // Copyright 2013 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | //go:generate go run gen.go | ||
8 | |||
9 | // This program generates internet protocol constants and tables by | ||
10 | // reading IANA protocol registries. | ||
11 | package main | ||
12 | |||
13 | import ( | ||
14 | "bytes" | ||
15 | "encoding/xml" | ||
16 | "fmt" | ||
17 | "go/format" | ||
18 | "io" | ||
19 | "io/ioutil" | ||
20 | "net/http" | ||
21 | "os" | ||
22 | "strconv" | ||
23 | "strings" | ||
24 | ) | ||
25 | |||
26 | var registries = []struct { | ||
27 | url string | ||
28 | parse func(io.Writer, io.Reader) error | ||
29 | }{ | ||
30 | { | ||
31 | "https://www.iana.org/assignments/dscp-registry/dscp-registry.xml", | ||
32 | parseDSCPRegistry, | ||
33 | }, | ||
34 | { | ||
35 | "https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml", | ||
36 | parseProtocolNumbers, | ||
37 | }, | ||
38 | { | ||
39 | "https://www.iana.org/assignments/address-family-numbers/address-family-numbers.xml", | ||
40 | parseAddrFamilyNumbers, | ||
41 | }, | ||
42 | } | ||
43 | |||
44 | func main() { | ||
45 | var bb bytes.Buffer | ||
46 | fmt.Fprintf(&bb, "// go generate gen.go\n") | ||
47 | fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n") | ||
48 | fmt.Fprintf(&bb, "// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).\n") | ||
49 | fmt.Fprintf(&bb, `package iana // import "golang.org/x/net/internal/iana"`+"\n\n") | ||
50 | for _, r := range registries { | ||
51 | resp, err := http.Get(r.url) | ||
52 | if err != nil { | ||
53 | fmt.Fprintln(os.Stderr, err) | ||
54 | os.Exit(1) | ||
55 | } | ||
56 | defer resp.Body.Close() | ||
57 | if resp.StatusCode != http.StatusOK { | ||
58 | fmt.Fprintf(os.Stderr, "got HTTP status code %v for %v\n", resp.StatusCode, r.url) | ||
59 | os.Exit(1) | ||
60 | } | ||
61 | if err := r.parse(&bb, resp.Body); err != nil { | ||
62 | fmt.Fprintln(os.Stderr, err) | ||
63 | os.Exit(1) | ||
64 | } | ||
65 | fmt.Fprintf(&bb, "\n") | ||
66 | } | ||
67 | b, err := format.Source(bb.Bytes()) | ||
68 | if err != nil { | ||
69 | fmt.Fprintln(os.Stderr, err) | ||
70 | os.Exit(1) | ||
71 | } | ||
72 | if err := ioutil.WriteFile("const.go", b, 0644); err != nil { | ||
73 | fmt.Fprintln(os.Stderr, err) | ||
74 | os.Exit(1) | ||
75 | } | ||
76 | } | ||
77 | |||
78 | func parseDSCPRegistry(w io.Writer, r io.Reader) error { | ||
79 | dec := xml.NewDecoder(r) | ||
80 | var dr dscpRegistry | ||
81 | if err := dec.Decode(&dr); err != nil { | ||
82 | return err | ||
83 | } | ||
84 | fmt.Fprintf(w, "// %s, Updated: %s\n", dr.Title, dr.Updated) | ||
85 | fmt.Fprintf(w, "const (\n") | ||
86 | for _, dr := range dr.escapeDSCP() { | ||
87 | fmt.Fprintf(w, "DiffServ%s = %#02x", dr.Name, dr.Value) | ||
88 | fmt.Fprintf(w, "// %s\n", dr.OrigName) | ||
89 | } | ||
90 | for _, er := range dr.escapeECN() { | ||
91 | fmt.Fprintf(w, "%s = %#02x", er.Descr, er.Value) | ||
92 | fmt.Fprintf(w, "// %s\n", er.OrigDescr) | ||
93 | } | ||
94 | fmt.Fprintf(w, ")\n") | ||
95 | return nil | ||
96 | } | ||
97 | |||
98 | type dscpRegistry struct { | ||
99 | XMLName xml.Name `xml:"registry"` | ||
100 | Title string `xml:"title"` | ||
101 | Updated string `xml:"updated"` | ||
102 | Note string `xml:"note"` | ||
103 | Registries []struct { | ||
104 | Title string `xml:"title"` | ||
105 | Registries []struct { | ||
106 | Title string `xml:"title"` | ||
107 | Records []struct { | ||
108 | Name string `xml:"name"` | ||
109 | Space string `xml:"space"` | ||
110 | } `xml:"record"` | ||
111 | } `xml:"registry"` | ||
112 | Records []struct { | ||
113 | Value string `xml:"value"` | ||
114 | Descr string `xml:"description"` | ||
115 | } `xml:"record"` | ||
116 | } `xml:"registry"` | ||
117 | } | ||
118 | |||
119 | type canonDSCPRecord struct { | ||
120 | OrigName string | ||
121 | Name string | ||
122 | Value int | ||
123 | } | ||
124 | |||
125 | func (drr *dscpRegistry) escapeDSCP() []canonDSCPRecord { | ||
126 | var drs []canonDSCPRecord | ||
127 | for _, preg := range drr.Registries { | ||
128 | if !strings.Contains(preg.Title, "Differentiated Services Field Codepoints") { | ||
129 | continue | ||
130 | } | ||
131 | for _, reg := range preg.Registries { | ||
132 | if !strings.Contains(reg.Title, "Pool 1 Codepoints") { | ||
133 | continue | ||
134 | } | ||
135 | drs = make([]canonDSCPRecord, len(reg.Records)) | ||
136 | sr := strings.NewReplacer( | ||
137 | "+", "", | ||
138 | "-", "", | ||
139 | "/", "", | ||
140 | ".", "", | ||
141 | " ", "", | ||
142 | ) | ||
143 | for i, dr := range reg.Records { | ||
144 | s := strings.TrimSpace(dr.Name) | ||
145 | drs[i].OrigName = s | ||
146 | drs[i].Name = sr.Replace(s) | ||
147 | n, err := strconv.ParseUint(dr.Space, 2, 8) | ||
148 | if err != nil { | ||
149 | continue | ||
150 | } | ||
151 | drs[i].Value = int(n) << 2 | ||
152 | } | ||
153 | } | ||
154 | } | ||
155 | return drs | ||
156 | } | ||
157 | |||
158 | type canonECNRecord struct { | ||
159 | OrigDescr string | ||
160 | Descr string | ||
161 | Value int | ||
162 | } | ||
163 | |||
164 | func (drr *dscpRegistry) escapeECN() []canonECNRecord { | ||
165 | var ers []canonECNRecord | ||
166 | for _, reg := range drr.Registries { | ||
167 | if !strings.Contains(reg.Title, "ECN Field") { | ||
168 | continue | ||
169 | } | ||
170 | ers = make([]canonECNRecord, len(reg.Records)) | ||
171 | sr := strings.NewReplacer( | ||
172 | "Capable", "", | ||
173 | "Not-ECT", "", | ||
174 | "ECT(1)", "", | ||
175 | "ECT(0)", "", | ||
176 | "CE", "", | ||
177 | "(", "", | ||
178 | ")", "", | ||
179 | "+", "", | ||
180 | "-", "", | ||
181 | "/", "", | ||
182 | ".", "", | ||
183 | " ", "", | ||
184 | ) | ||
185 | for i, er := range reg.Records { | ||
186 | s := strings.TrimSpace(er.Descr) | ||
187 | ers[i].OrigDescr = s | ||
188 | ss := strings.Split(s, " ") | ||
189 | if len(ss) > 1 { | ||
190 | ers[i].Descr = strings.Join(ss[1:], " ") | ||
191 | } else { | ||
192 | ers[i].Descr = ss[0] | ||
193 | } | ||
194 | ers[i].Descr = sr.Replace(er.Descr) | ||
195 | n, err := strconv.ParseUint(er.Value, 2, 8) | ||
196 | if err != nil { | ||
197 | continue | ||
198 | } | ||
199 | ers[i].Value = int(n) | ||
200 | } | ||
201 | } | ||
202 | return ers | ||
203 | } | ||
204 | |||
205 | func parseProtocolNumbers(w io.Writer, r io.Reader) error { | ||
206 | dec := xml.NewDecoder(r) | ||
207 | var pn protocolNumbers | ||
208 | if err := dec.Decode(&pn); err != nil { | ||
209 | return err | ||
210 | } | ||
211 | prs := pn.escape() | ||
212 | prs = append([]canonProtocolRecord{{ | ||
213 | Name: "IP", | ||
214 | Descr: "IPv4 encapsulation, pseudo protocol number", | ||
215 | Value: 0, | ||
216 | }}, prs...) | ||
217 | fmt.Fprintf(w, "// %s, Updated: %s\n", pn.Title, pn.Updated) | ||
218 | fmt.Fprintf(w, "const (\n") | ||
219 | for _, pr := range prs { | ||
220 | if pr.Name == "" { | ||
221 | continue | ||
222 | } | ||
223 | fmt.Fprintf(w, "Protocol%s = %d", pr.Name, pr.Value) | ||
224 | s := pr.Descr | ||
225 | if s == "" { | ||
226 | s = pr.OrigName | ||
227 | } | ||
228 | fmt.Fprintf(w, "// %s\n", s) | ||
229 | } | ||
230 | fmt.Fprintf(w, ")\n") | ||
231 | return nil | ||
232 | } | ||
233 | |||
234 | type protocolNumbers struct { | ||
235 | XMLName xml.Name `xml:"registry"` | ||
236 | Title string `xml:"title"` | ||
237 | Updated string `xml:"updated"` | ||
238 | RegTitle string `xml:"registry>title"` | ||
239 | Note string `xml:"registry>note"` | ||
240 | Records []struct { | ||
241 | Value string `xml:"value"` | ||
242 | Name string `xml:"name"` | ||
243 | Descr string `xml:"description"` | ||
244 | } `xml:"registry>record"` | ||
245 | } | ||
246 | |||
247 | type canonProtocolRecord struct { | ||
248 | OrigName string | ||
249 | Name string | ||
250 | Descr string | ||
251 | Value int | ||
252 | } | ||
253 | |||
254 | func (pn *protocolNumbers) escape() []canonProtocolRecord { | ||
255 | prs := make([]canonProtocolRecord, len(pn.Records)) | ||
256 | sr := strings.NewReplacer( | ||
257 | "-in-", "in", | ||
258 | "-within-", "within", | ||
259 | "-over-", "over", | ||
260 | "+", "P", | ||
261 | "-", "", | ||
262 | "/", "", | ||
263 | ".", "", | ||
264 | " ", "", | ||
265 | ) | ||
266 | for i, pr := range pn.Records { | ||
267 | if strings.Contains(pr.Name, "Deprecated") || | ||
268 | strings.Contains(pr.Name, "deprecated") { | ||
269 | continue | ||
270 | } | ||
271 | prs[i].OrigName = pr.Name | ||
272 | s := strings.TrimSpace(pr.Name) | ||
273 | switch pr.Name { | ||
274 | case "ISIS over IPv4": | ||
275 | prs[i].Name = "ISIS" | ||
276 | case "manet": | ||
277 | prs[i].Name = "MANET" | ||
278 | default: | ||
279 | prs[i].Name = sr.Replace(s) | ||
280 | } | ||
281 | ss := strings.Split(pr.Descr, "\n") | ||
282 | for i := range ss { | ||
283 | ss[i] = strings.TrimSpace(ss[i]) | ||
284 | } | ||
285 | if len(ss) > 1 { | ||
286 | prs[i].Descr = strings.Join(ss, " ") | ||
287 | } else { | ||
288 | prs[i].Descr = ss[0] | ||
289 | } | ||
290 | prs[i].Value, _ = strconv.Atoi(pr.Value) | ||
291 | } | ||
292 | return prs | ||
293 | } | ||
294 | |||
295 | func parseAddrFamilyNumbers(w io.Writer, r io.Reader) error { | ||
296 | dec := xml.NewDecoder(r) | ||
297 | var afn addrFamilylNumbers | ||
298 | if err := dec.Decode(&afn); err != nil { | ||
299 | return err | ||
300 | } | ||
301 | afrs := afn.escape() | ||
302 | fmt.Fprintf(w, "// %s, Updated: %s\n", afn.Title, afn.Updated) | ||
303 | fmt.Fprintf(w, "const (\n") | ||
304 | for _, afr := range afrs { | ||
305 | if afr.Name == "" { | ||
306 | continue | ||
307 | } | ||
308 | fmt.Fprintf(w, "AddrFamily%s = %d", afr.Name, afr.Value) | ||
309 | fmt.Fprintf(w, "// %s\n", afr.Descr) | ||
310 | } | ||
311 | fmt.Fprintf(w, ")\n") | ||
312 | return nil | ||
313 | } | ||
314 | |||
315 | type addrFamilylNumbers struct { | ||
316 | XMLName xml.Name `xml:"registry"` | ||
317 | Title string `xml:"title"` | ||
318 | Updated string `xml:"updated"` | ||
319 | RegTitle string `xml:"registry>title"` | ||
320 | Note string `xml:"registry>note"` | ||
321 | Records []struct { | ||
322 | Value string `xml:"value"` | ||
323 | Descr string `xml:"description"` | ||
324 | } `xml:"registry>record"` | ||
325 | } | ||
326 | |||
327 | type canonAddrFamilyRecord struct { | ||
328 | Name string | ||
329 | Descr string | ||
330 | Value int | ||
331 | } | ||
332 | |||
333 | func (afn *addrFamilylNumbers) escape() []canonAddrFamilyRecord { | ||
334 | afrs := make([]canonAddrFamilyRecord, len(afn.Records)) | ||
335 | sr := strings.NewReplacer( | ||
336 | "IP version 4", "IPv4", | ||
337 | "IP version 6", "IPv6", | ||
338 | "Identifier", "ID", | ||
339 | "-", "", | ||
340 | "-", "", | ||
341 | "/", "", | ||
342 | ".", "", | ||
343 | " ", "", | ||
344 | ) | ||
345 | for i, afr := range afn.Records { | ||
346 | if strings.Contains(afr.Descr, "Unassigned") || | ||
347 | strings.Contains(afr.Descr, "Reserved") { | ||
348 | continue | ||
349 | } | ||
350 | afrs[i].Descr = afr.Descr | ||
351 | s := strings.TrimSpace(afr.Descr) | ||
352 | switch s { | ||
353 | case "IP (IP version 4)": | ||
354 | afrs[i].Name = "IPv4" | ||
355 | case "IP6 (IP version 6)": | ||
356 | afrs[i].Name = "IPv6" | ||
357 | case "AFI for L2VPN information": | ||
358 | afrs[i].Name = "L2VPN" | ||
359 | case "E.164 with NSAP format subaddress": | ||
360 | afrs[i].Name = "E164withSubaddress" | ||
361 | case "MT IP: Multi-Topology IP version 4": | ||
362 | afrs[i].Name = "MTIPv4" | ||
363 | case "MAC/24": | ||
364 | afrs[i].Name = "MACFinal24bits" | ||
365 | case "MAC/40": | ||
366 | afrs[i].Name = "MACFinal40bits" | ||
367 | case "IPv6/64": | ||
368 | afrs[i].Name = "IPv6Initial64bits" | ||
369 | default: | ||
370 | n := strings.Index(s, "(") | ||
371 | if n > 0 { | ||
372 | s = s[:n] | ||
373 | } | ||
374 | n = strings.Index(s, ":") | ||
375 | if n > 0 { | ||
376 | s = s[:n] | ||
377 | } | ||
378 | afrs[i].Name = sr.Replace(s) | ||
379 | } | ||
380 | afrs[i].Value, _ = strconv.Atoi(afr.Value) | ||
381 | } | ||
382 | return afrs | ||
383 | } | ||
diff --git a/vendor/golang.org/x/net/internal/socket/defs_aix.go b/vendor/golang.org/x/net/internal/socket/defs_aix.go deleted file mode 100644 index c9d05b2..0000000 --- a/vendor/golang.org/x/net/internal/socket/defs_aix.go +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | // Copyright 2019 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
9 | |||
10 | package socket | ||
11 | |||
12 | /* | ||
13 | #include <sys/socket.h> | ||
14 | |||
15 | #include <netinet/in.h> | ||
16 | */ | ||
17 | import "C" | ||
18 | |||
19 | type iovec C.struct_iovec | ||
20 | |||
21 | type msghdr C.struct_msghdr | ||
22 | |||
23 | type mmsghdr C.struct_mmsghdr | ||
24 | |||
25 | type cmsghdr C.struct_cmsghdr | ||
26 | |||
27 | type sockaddrInet C.struct_sockaddr_in | ||
28 | |||
29 | type sockaddrInet6 C.struct_sockaddr_in6 | ||
30 | |||
31 | const ( | ||
32 | sizeofIovec = C.sizeof_struct_iovec | ||
33 | sizeofMsghdr = C.sizeof_struct_msghdr | ||
34 | sizeofMmsghdr = C.sizeof_struct_mmsghdr | ||
35 | sizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
36 | |||
37 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
38 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
39 | ) | ||
diff --git a/vendor/golang.org/x/net/internal/socket/defs_darwin.go b/vendor/golang.org/x/net/internal/socket/defs_darwin.go deleted file mode 100644 index b780bc6..0000000 --- a/vendor/golang.org/x/net/internal/socket/defs_darwin.go +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | // Copyright 2017 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
9 | |||
10 | package socket | ||
11 | |||
12 | /* | ||
13 | #include <sys/socket.h> | ||
14 | |||
15 | #include <netinet/in.h> | ||
16 | */ | ||
17 | import "C" | ||
18 | |||
19 | type iovec C.struct_iovec | ||
20 | |||
21 | type msghdr C.struct_msghdr | ||
22 | |||
23 | type cmsghdr C.struct_cmsghdr | ||
24 | |||
25 | type sockaddrInet C.struct_sockaddr_in | ||
26 | |||
27 | type sockaddrInet6 C.struct_sockaddr_in6 | ||
28 | |||
29 | const ( | ||
30 | sizeofIovec = C.sizeof_struct_iovec | ||
31 | sizeofMsghdr = C.sizeof_struct_msghdr | ||
32 | sizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
33 | |||
34 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
35 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
36 | ) | ||
diff --git a/vendor/golang.org/x/net/internal/socket/defs_dragonfly.go b/vendor/golang.org/x/net/internal/socket/defs_dragonfly.go deleted file mode 100644 index b780bc6..0000000 --- a/vendor/golang.org/x/net/internal/socket/defs_dragonfly.go +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | // Copyright 2017 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
9 | |||
10 | package socket | ||
11 | |||
12 | /* | ||
13 | #include <sys/socket.h> | ||
14 | |||
15 | #include <netinet/in.h> | ||
16 | */ | ||
17 | import "C" | ||
18 | |||
19 | type iovec C.struct_iovec | ||
20 | |||
21 | type msghdr C.struct_msghdr | ||
22 | |||
23 | type cmsghdr C.struct_cmsghdr | ||
24 | |||
25 | type sockaddrInet C.struct_sockaddr_in | ||
26 | |||
27 | type sockaddrInet6 C.struct_sockaddr_in6 | ||
28 | |||
29 | const ( | ||
30 | sizeofIovec = C.sizeof_struct_iovec | ||
31 | sizeofMsghdr = C.sizeof_struct_msghdr | ||
32 | sizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
33 | |||
34 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
35 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
36 | ) | ||
diff --git a/vendor/golang.org/x/net/internal/socket/defs_freebsd.go b/vendor/golang.org/x/net/internal/socket/defs_freebsd.go deleted file mode 100644 index b780bc6..0000000 --- a/vendor/golang.org/x/net/internal/socket/defs_freebsd.go +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | // Copyright 2017 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
9 | |||
10 | package socket | ||
11 | |||
12 | /* | ||
13 | #include <sys/socket.h> | ||
14 | |||
15 | #include <netinet/in.h> | ||
16 | */ | ||
17 | import "C" | ||
18 | |||
19 | type iovec C.struct_iovec | ||
20 | |||
21 | type msghdr C.struct_msghdr | ||
22 | |||
23 | type cmsghdr C.struct_cmsghdr | ||
24 | |||
25 | type sockaddrInet C.struct_sockaddr_in | ||
26 | |||
27 | type sockaddrInet6 C.struct_sockaddr_in6 | ||
28 | |||
29 | const ( | ||
30 | sizeofIovec = C.sizeof_struct_iovec | ||
31 | sizeofMsghdr = C.sizeof_struct_msghdr | ||
32 | sizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
33 | |||
34 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
35 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
36 | ) | ||
diff --git a/vendor/golang.org/x/net/internal/socket/defs_linux.go b/vendor/golang.org/x/net/internal/socket/defs_linux.go deleted file mode 100644 index 6c5c11d..0000000 --- a/vendor/golang.org/x/net/internal/socket/defs_linux.go +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | // Copyright 2017 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
9 | |||
10 | package socket | ||
11 | |||
12 | /* | ||
13 | #include <linux/in.h> | ||
14 | #include <linux/in6.h> | ||
15 | |||
16 | #define _GNU_SOURCE | ||
17 | #include <sys/socket.h> | ||
18 | */ | ||
19 | import "C" | ||
20 | |||
21 | type iovec C.struct_iovec | ||
22 | |||
23 | type msghdr C.struct_msghdr | ||
24 | |||
25 | type mmsghdr C.struct_mmsghdr | ||
26 | |||
27 | type cmsghdr C.struct_cmsghdr | ||
28 | |||
29 | type sockaddrInet C.struct_sockaddr_in | ||
30 | |||
31 | type sockaddrInet6 C.struct_sockaddr_in6 | ||
32 | |||
33 | const ( | ||
34 | sizeofIovec = C.sizeof_struct_iovec | ||
35 | sizeofMsghdr = C.sizeof_struct_msghdr | ||
36 | sizeofMmsghdr = C.sizeof_struct_mmsghdr | ||
37 | sizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
38 | |||
39 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
40 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
41 | ) | ||
diff --git a/vendor/golang.org/x/net/internal/socket/defs_netbsd.go b/vendor/golang.org/x/net/internal/socket/defs_netbsd.go deleted file mode 100644 index 3d3b776..0000000 --- a/vendor/golang.org/x/net/internal/socket/defs_netbsd.go +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | // Copyright 2017 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
9 | |||
10 | package socket | ||
11 | |||
12 | /* | ||
13 | #include <sys/socket.h> | ||
14 | |||
15 | #include <netinet/in.h> | ||
16 | */ | ||
17 | import "C" | ||
18 | |||
19 | type iovec C.struct_iovec | ||
20 | |||
21 | type msghdr C.struct_msghdr | ||
22 | |||
23 | type mmsghdr C.struct_mmsghdr | ||
24 | |||
25 | type cmsghdr C.struct_cmsghdr | ||
26 | |||
27 | type sockaddrInet C.struct_sockaddr_in | ||
28 | |||
29 | type sockaddrInet6 C.struct_sockaddr_in6 | ||
30 | |||
31 | const ( | ||
32 | sizeofIovec = C.sizeof_struct_iovec | ||
33 | sizeofMsghdr = C.sizeof_struct_msghdr | ||
34 | sizeofMmsghdr = C.sizeof_struct_mmsghdr | ||
35 | sizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
36 | |||
37 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
38 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
39 | ) | ||
diff --git a/vendor/golang.org/x/net/internal/socket/defs_openbsd.go b/vendor/golang.org/x/net/internal/socket/defs_openbsd.go deleted file mode 100644 index b780bc6..0000000 --- a/vendor/golang.org/x/net/internal/socket/defs_openbsd.go +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | // Copyright 2017 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
9 | |||
10 | package socket | ||
11 | |||
12 | /* | ||
13 | #include <sys/socket.h> | ||
14 | |||
15 | #include <netinet/in.h> | ||
16 | */ | ||
17 | import "C" | ||
18 | |||
19 | type iovec C.struct_iovec | ||
20 | |||
21 | type msghdr C.struct_msghdr | ||
22 | |||
23 | type cmsghdr C.struct_cmsghdr | ||
24 | |||
25 | type sockaddrInet C.struct_sockaddr_in | ||
26 | |||
27 | type sockaddrInet6 C.struct_sockaddr_in6 | ||
28 | |||
29 | const ( | ||
30 | sizeofIovec = C.sizeof_struct_iovec | ||
31 | sizeofMsghdr = C.sizeof_struct_msghdr | ||
32 | sizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
33 | |||
34 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
35 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
36 | ) | ||
diff --git a/vendor/golang.org/x/net/internal/socket/defs_solaris.go b/vendor/golang.org/x/net/internal/socket/defs_solaris.go deleted file mode 100644 index b780bc6..0000000 --- a/vendor/golang.org/x/net/internal/socket/defs_solaris.go +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | // Copyright 2017 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
9 | |||
10 | package socket | ||
11 | |||
12 | /* | ||
13 | #include <sys/socket.h> | ||
14 | |||
15 | #include <netinet/in.h> | ||
16 | */ | ||
17 | import "C" | ||
18 | |||
19 | type iovec C.struct_iovec | ||
20 | |||
21 | type msghdr C.struct_msghdr | ||
22 | |||
23 | type cmsghdr C.struct_cmsghdr | ||
24 | |||
25 | type sockaddrInet C.struct_sockaddr_in | ||
26 | |||
27 | type sockaddrInet6 C.struct_sockaddr_in6 | ||
28 | |||
29 | const ( | ||
30 | sizeofIovec = C.sizeof_struct_iovec | ||
31 | sizeofMsghdr = C.sizeof_struct_msghdr | ||
32 | sizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
33 | |||
34 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
35 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
36 | ) | ||
diff --git a/vendor/golang.org/x/net/ipv4/defs_aix.go b/vendor/golang.org/x/net/ipv4/defs_aix.go deleted file mode 100644 index 0f37211..0000000 --- a/vendor/golang.org/x/net/ipv4/defs_aix.go +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | // Copyright 2019 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | |||
9 | package ipv4 | ||
10 | |||
11 | /* | ||
12 | #include <netinet/in.h> | ||
13 | */ | ||
14 | import "C" | ||
15 | |||
16 | const ( | ||
17 | sysIP_OPTIONS = C.IP_OPTIONS | ||
18 | sysIP_HDRINCL = C.IP_HDRINCL | ||
19 | sysIP_TOS = C.IP_TOS | ||
20 | sysIP_TTL = C.IP_TTL | ||
21 | sysIP_RECVOPTS = C.IP_RECVOPTS | ||
22 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS | ||
23 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR | ||
24 | sysIP_RETOPTS = C.IP_RETOPTS | ||
25 | // IP_RECVIF is defined on AIX but doesn't work. | ||
26 | // IP_RECVINTERFACE must be used instead. | ||
27 | sysIP_RECVIF = C.IP_RECVINTERFACE | ||
28 | sysIP_RECVTTL = C.IP_RECVTTL | ||
29 | |||
30 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF | ||
31 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL | ||
32 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP | ||
33 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP | ||
34 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP | ||
35 | |||
36 | sizeofIPMreq = C.sizeof_struct_ip_mreq | ||
37 | ) | ||
38 | |||
39 | type ipMreq C.struct_ip_mreq | ||
diff --git a/vendor/golang.org/x/net/ipv4/defs_darwin.go b/vendor/golang.org/x/net/ipv4/defs_darwin.go deleted file mode 100644 index c8f2e05..0000000 --- a/vendor/golang.org/x/net/ipv4/defs_darwin.go +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | // Copyright 2014 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | |||
9 | package ipv4 | ||
10 | |||
11 | /* | ||
12 | #include <sys/socket.h> | ||
13 | |||
14 | #include <netinet/in.h> | ||
15 | */ | ||
16 | import "C" | ||
17 | |||
18 | const ( | ||
19 | sysIP_OPTIONS = C.IP_OPTIONS | ||
20 | sysIP_HDRINCL = C.IP_HDRINCL | ||
21 | sysIP_TOS = C.IP_TOS | ||
22 | sysIP_TTL = C.IP_TTL | ||
23 | sysIP_RECVOPTS = C.IP_RECVOPTS | ||
24 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS | ||
25 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR | ||
26 | sysIP_RETOPTS = C.IP_RETOPTS | ||
27 | sysIP_RECVIF = C.IP_RECVIF | ||
28 | sysIP_STRIPHDR = C.IP_STRIPHDR | ||
29 | sysIP_RECVTTL = C.IP_RECVTTL | ||
30 | sysIP_BOUND_IF = C.IP_BOUND_IF | ||
31 | sysIP_PKTINFO = C.IP_PKTINFO | ||
32 | sysIP_RECVPKTINFO = C.IP_RECVPKTINFO | ||
33 | |||
34 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF | ||
35 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL | ||
36 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP | ||
37 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP | ||
38 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP | ||
39 | sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF | ||
40 | sysIP_MULTICAST_IFINDEX = C.IP_MULTICAST_IFINDEX | ||
41 | sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP | ||
42 | sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP | ||
43 | sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE | ||
44 | sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE | ||
45 | sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP | ||
46 | sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP | ||
47 | sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP | ||
48 | sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP | ||
49 | sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE | ||
50 | sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE | ||
51 | |||
52 | sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage | ||
53 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
54 | sizeofInetPktinfo = C.sizeof_struct_in_pktinfo | ||
55 | |||
56 | sizeofIPMreq = C.sizeof_struct_ip_mreq | ||
57 | sizeofIPMreqn = C.sizeof_struct_ip_mreqn | ||
58 | sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source | ||
59 | sizeofGroupReq = C.sizeof_struct_group_req | ||
60 | sizeofGroupSourceReq = C.sizeof_struct_group_source_req | ||
61 | ) | ||
62 | |||
63 | type sockaddrStorage C.struct_sockaddr_storage | ||
64 | |||
65 | type sockaddrInet C.struct_sockaddr_in | ||
66 | |||
67 | type inetPktinfo C.struct_in_pktinfo | ||
68 | |||
69 | type ipMreq C.struct_ip_mreq | ||
70 | |||
71 | type ipMreqn C.struct_ip_mreqn | ||
72 | |||
73 | type ipMreqSource C.struct_ip_mreq_source | ||
74 | |||
75 | type groupReq C.struct_group_req | ||
76 | |||
77 | type groupSourceReq C.struct_group_source_req | ||
diff --git a/vendor/golang.org/x/net/ipv4/defs_dragonfly.go b/vendor/golang.org/x/net/ipv4/defs_dragonfly.go deleted file mode 100644 index f30544e..0000000 --- a/vendor/golang.org/x/net/ipv4/defs_dragonfly.go +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | // Copyright 2014 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | |||
9 | package ipv4 | ||
10 | |||
11 | /* | ||
12 | #include <netinet/in.h> | ||
13 | */ | ||
14 | import "C" | ||
15 | |||
16 | const ( | ||
17 | sysIP_OPTIONS = C.IP_OPTIONS | ||
18 | sysIP_HDRINCL = C.IP_HDRINCL | ||
19 | sysIP_TOS = C.IP_TOS | ||
20 | sysIP_TTL = C.IP_TTL | ||
21 | sysIP_RECVOPTS = C.IP_RECVOPTS | ||
22 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS | ||
23 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR | ||
24 | sysIP_RETOPTS = C.IP_RETOPTS | ||
25 | sysIP_RECVIF = C.IP_RECVIF | ||
26 | sysIP_RECVTTL = C.IP_RECVTTL | ||
27 | |||
28 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF | ||
29 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL | ||
30 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP | ||
31 | sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF | ||
32 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP | ||
33 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP | ||
34 | |||
35 | sizeofIPMreq = C.sizeof_struct_ip_mreq | ||
36 | ) | ||
37 | |||
38 | type ipMreq C.struct_ip_mreq | ||
diff --git a/vendor/golang.org/x/net/ipv4/defs_freebsd.go b/vendor/golang.org/x/net/ipv4/defs_freebsd.go deleted file mode 100644 index 4dd57d8..0000000 --- a/vendor/golang.org/x/net/ipv4/defs_freebsd.go +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | // Copyright 2014 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | |||
9 | package ipv4 | ||
10 | |||
11 | /* | ||
12 | #include <sys/socket.h> | ||
13 | |||
14 | #include <netinet/in.h> | ||
15 | */ | ||
16 | import "C" | ||
17 | |||
18 | const ( | ||
19 | sysIP_OPTIONS = C.IP_OPTIONS | ||
20 | sysIP_HDRINCL = C.IP_HDRINCL | ||
21 | sysIP_TOS = C.IP_TOS | ||
22 | sysIP_TTL = C.IP_TTL | ||
23 | sysIP_RECVOPTS = C.IP_RECVOPTS | ||
24 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS | ||
25 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR | ||
26 | sysIP_SENDSRCADDR = C.IP_SENDSRCADDR | ||
27 | sysIP_RETOPTS = C.IP_RETOPTS | ||
28 | sysIP_RECVIF = C.IP_RECVIF | ||
29 | sysIP_ONESBCAST = C.IP_ONESBCAST | ||
30 | sysIP_BINDANY = C.IP_BINDANY | ||
31 | sysIP_RECVTTL = C.IP_RECVTTL | ||
32 | sysIP_MINTTL = C.IP_MINTTL | ||
33 | sysIP_DONTFRAG = C.IP_DONTFRAG | ||
34 | sysIP_RECVTOS = C.IP_RECVTOS | ||
35 | |||
36 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF | ||
37 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL | ||
38 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP | ||
39 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP | ||
40 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP | ||
41 | sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF | ||
42 | sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP | ||
43 | sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP | ||
44 | sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE | ||
45 | sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE | ||
46 | sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP | ||
47 | sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP | ||
48 | sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP | ||
49 | sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP | ||
50 | sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE | ||
51 | sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE | ||
52 | |||
53 | sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage | ||
54 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
55 | |||
56 | sizeofIPMreq = C.sizeof_struct_ip_mreq | ||
57 | sizeofIPMreqn = C.sizeof_struct_ip_mreqn | ||
58 | sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source | ||
59 | sizeofGroupReq = C.sizeof_struct_group_req | ||
60 | sizeofGroupSourceReq = C.sizeof_struct_group_source_req | ||
61 | ) | ||
62 | |||
63 | type sockaddrStorage C.struct_sockaddr_storage | ||
64 | |||
65 | type sockaddrInet C.struct_sockaddr_in | ||
66 | |||
67 | type ipMreq C.struct_ip_mreq | ||
68 | |||
69 | type ipMreqn C.struct_ip_mreqn | ||
70 | |||
71 | type ipMreqSource C.struct_ip_mreq_source | ||
72 | |||
73 | type groupReq C.struct_group_req | ||
74 | |||
75 | type groupSourceReq C.struct_group_source_req | ||
diff --git a/vendor/golang.org/x/net/ipv4/defs_linux.go b/vendor/golang.org/x/net/ipv4/defs_linux.go deleted file mode 100644 index beb1107..0000000 --- a/vendor/golang.org/x/net/ipv4/defs_linux.go +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | // Copyright 2014 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | |||
9 | package ipv4 | ||
10 | |||
11 | /* | ||
12 | #include <time.h> | ||
13 | |||
14 | #include <linux/errqueue.h> | ||
15 | #include <linux/icmp.h> | ||
16 | #include <linux/in.h> | ||
17 | #include <linux/filter.h> | ||
18 | #include <sys/socket.h> | ||
19 | */ | ||
20 | import "C" | ||
21 | |||
22 | const ( | ||
23 | sysIP_TOS = C.IP_TOS | ||
24 | sysIP_TTL = C.IP_TTL | ||
25 | sysIP_HDRINCL = C.IP_HDRINCL | ||
26 | sysIP_OPTIONS = C.IP_OPTIONS | ||
27 | sysIP_ROUTER_ALERT = C.IP_ROUTER_ALERT | ||
28 | sysIP_RECVOPTS = C.IP_RECVOPTS | ||
29 | sysIP_RETOPTS = C.IP_RETOPTS | ||
30 | sysIP_PKTINFO = C.IP_PKTINFO | ||
31 | sysIP_PKTOPTIONS = C.IP_PKTOPTIONS | ||
32 | sysIP_MTU_DISCOVER = C.IP_MTU_DISCOVER | ||
33 | sysIP_RECVERR = C.IP_RECVERR | ||
34 | sysIP_RECVTTL = C.IP_RECVTTL | ||
35 | sysIP_RECVTOS = C.IP_RECVTOS | ||
36 | sysIP_MTU = C.IP_MTU | ||
37 | sysIP_FREEBIND = C.IP_FREEBIND | ||
38 | sysIP_TRANSPARENT = C.IP_TRANSPARENT | ||
39 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS | ||
40 | sysIP_ORIGDSTADDR = C.IP_ORIGDSTADDR | ||
41 | sysIP_RECVORIGDSTADDR = C.IP_RECVORIGDSTADDR | ||
42 | sysIP_MINTTL = C.IP_MINTTL | ||
43 | sysIP_NODEFRAG = C.IP_NODEFRAG | ||
44 | sysIP_UNICAST_IF = C.IP_UNICAST_IF | ||
45 | |||
46 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF | ||
47 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL | ||
48 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP | ||
49 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP | ||
50 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP | ||
51 | sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE | ||
52 | sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE | ||
53 | sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP | ||
54 | sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP | ||
55 | sysIP_MSFILTER = C.IP_MSFILTER | ||
56 | sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP | ||
57 | sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP | ||
58 | sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP | ||
59 | sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP | ||
60 | sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE | ||
61 | sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE | ||
62 | sysMCAST_MSFILTER = C.MCAST_MSFILTER | ||
63 | sysIP_MULTICAST_ALL = C.IP_MULTICAST_ALL | ||
64 | |||
65 | //sysIP_PMTUDISC_DONT = C.IP_PMTUDISC_DONT | ||
66 | //sysIP_PMTUDISC_WANT = C.IP_PMTUDISC_WANT | ||
67 | //sysIP_PMTUDISC_DO = C.IP_PMTUDISC_DO | ||
68 | //sysIP_PMTUDISC_PROBE = C.IP_PMTUDISC_PROBE | ||
69 | //sysIP_PMTUDISC_INTERFACE = C.IP_PMTUDISC_INTERFACE | ||
70 | //sysIP_PMTUDISC_OMIT = C.IP_PMTUDISC_OMIT | ||
71 | |||
72 | sysICMP_FILTER = C.ICMP_FILTER | ||
73 | |||
74 | sysSO_EE_ORIGIN_NONE = C.SO_EE_ORIGIN_NONE | ||
75 | sysSO_EE_ORIGIN_LOCAL = C.SO_EE_ORIGIN_LOCAL | ||
76 | sysSO_EE_ORIGIN_ICMP = C.SO_EE_ORIGIN_ICMP | ||
77 | sysSO_EE_ORIGIN_ICMP6 = C.SO_EE_ORIGIN_ICMP6 | ||
78 | sysSO_EE_ORIGIN_TXSTATUS = C.SO_EE_ORIGIN_TXSTATUS | ||
79 | sysSO_EE_ORIGIN_TIMESTAMPING = C.SO_EE_ORIGIN_TIMESTAMPING | ||
80 | |||
81 | sysSOL_SOCKET = C.SOL_SOCKET | ||
82 | sysSO_ATTACH_FILTER = C.SO_ATTACH_FILTER | ||
83 | |||
84 | sizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage | ||
85 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
86 | sizeofInetPktinfo = C.sizeof_struct_in_pktinfo | ||
87 | sizeofSockExtendedErr = C.sizeof_struct_sock_extended_err | ||
88 | |||
89 | sizeofIPMreq = C.sizeof_struct_ip_mreq | ||
90 | sizeofIPMreqn = C.sizeof_struct_ip_mreqn | ||
91 | sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source | ||
92 | sizeofGroupReq = C.sizeof_struct_group_req | ||
93 | sizeofGroupSourceReq = C.sizeof_struct_group_source_req | ||
94 | |||
95 | sizeofICMPFilter = C.sizeof_struct_icmp_filter | ||
96 | |||
97 | sizeofSockFprog = C.sizeof_struct_sock_fprog | ||
98 | ) | ||
99 | |||
100 | type kernelSockaddrStorage C.struct___kernel_sockaddr_storage | ||
101 | |||
102 | type sockaddrInet C.struct_sockaddr_in | ||
103 | |||
104 | type inetPktinfo C.struct_in_pktinfo | ||
105 | |||
106 | type sockExtendedErr C.struct_sock_extended_err | ||
107 | |||
108 | type ipMreq C.struct_ip_mreq | ||
109 | |||
110 | type ipMreqn C.struct_ip_mreqn | ||
111 | |||
112 | type ipMreqSource C.struct_ip_mreq_source | ||
113 | |||
114 | type groupReq C.struct_group_req | ||
115 | |||
116 | type groupSourceReq C.struct_group_source_req | ||
117 | |||
118 | type icmpFilter C.struct_icmp_filter | ||
119 | |||
120 | type sockFProg C.struct_sock_fprog | ||
121 | |||
122 | type sockFilter C.struct_sock_filter | ||
diff --git a/vendor/golang.org/x/net/ipv4/defs_netbsd.go b/vendor/golang.org/x/net/ipv4/defs_netbsd.go deleted file mode 100644 index 8f8af1b..0000000 --- a/vendor/golang.org/x/net/ipv4/defs_netbsd.go +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | // Copyright 2014 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | |||
9 | package ipv4 | ||
10 | |||
11 | /* | ||
12 | #include <netinet/in.h> | ||
13 | */ | ||
14 | import "C" | ||
15 | |||
16 | const ( | ||
17 | sysIP_OPTIONS = C.IP_OPTIONS | ||
18 | sysIP_HDRINCL = C.IP_HDRINCL | ||
19 | sysIP_TOS = C.IP_TOS | ||
20 | sysIP_TTL = C.IP_TTL | ||
21 | sysIP_RECVOPTS = C.IP_RECVOPTS | ||
22 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS | ||
23 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR | ||
24 | sysIP_RETOPTS = C.IP_RETOPTS | ||
25 | sysIP_RECVIF = C.IP_RECVIF | ||
26 | sysIP_RECVTTL = C.IP_RECVTTL | ||
27 | |||
28 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF | ||
29 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL | ||
30 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP | ||
31 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP | ||
32 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP | ||
33 | |||
34 | sizeofIPMreq = C.sizeof_struct_ip_mreq | ||
35 | ) | ||
36 | |||
37 | type ipMreq C.struct_ip_mreq | ||
diff --git a/vendor/golang.org/x/net/ipv4/defs_openbsd.go b/vendor/golang.org/x/net/ipv4/defs_openbsd.go deleted file mode 100644 index 8f8af1b..0000000 --- a/vendor/golang.org/x/net/ipv4/defs_openbsd.go +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | // Copyright 2014 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | |||
9 | package ipv4 | ||
10 | |||
11 | /* | ||
12 | #include <netinet/in.h> | ||
13 | */ | ||
14 | import "C" | ||
15 | |||
16 | const ( | ||
17 | sysIP_OPTIONS = C.IP_OPTIONS | ||
18 | sysIP_HDRINCL = C.IP_HDRINCL | ||
19 | sysIP_TOS = C.IP_TOS | ||
20 | sysIP_TTL = C.IP_TTL | ||
21 | sysIP_RECVOPTS = C.IP_RECVOPTS | ||
22 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS | ||
23 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR | ||
24 | sysIP_RETOPTS = C.IP_RETOPTS | ||
25 | sysIP_RECVIF = C.IP_RECVIF | ||
26 | sysIP_RECVTTL = C.IP_RECVTTL | ||
27 | |||
28 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF | ||
29 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL | ||
30 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP | ||
31 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP | ||
32 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP | ||
33 | |||
34 | sizeofIPMreq = C.sizeof_struct_ip_mreq | ||
35 | ) | ||
36 | |||
37 | type ipMreq C.struct_ip_mreq | ||
diff --git a/vendor/golang.org/x/net/ipv4/defs_solaris.go b/vendor/golang.org/x/net/ipv4/defs_solaris.go deleted file mode 100644 index aeb33e9..0000000 --- a/vendor/golang.org/x/net/ipv4/defs_solaris.go +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | // Copyright 2014 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
8 | |||
9 | package ipv4 | ||
10 | |||
11 | /* | ||
12 | #include <sys/socket.h> | ||
13 | |||
14 | #include <netinet/in.h> | ||
15 | */ | ||
16 | import "C" | ||
17 | |||
18 | const ( | ||
19 | sysIP_OPTIONS = C.IP_OPTIONS | ||
20 | sysIP_HDRINCL = C.IP_HDRINCL | ||
21 | sysIP_TOS = C.IP_TOS | ||
22 | sysIP_TTL = C.IP_TTL | ||
23 | sysIP_RECVOPTS = C.IP_RECVOPTS | ||
24 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS | ||
25 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR | ||
26 | sysIP_RETOPTS = C.IP_RETOPTS | ||
27 | sysIP_RECVIF = C.IP_RECVIF | ||
28 | sysIP_RECVSLLA = C.IP_RECVSLLA | ||
29 | sysIP_RECVTTL = C.IP_RECVTTL | ||
30 | |||
31 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF | ||
32 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL | ||
33 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP | ||
34 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP | ||
35 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP | ||
36 | sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE | ||
37 | sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE | ||
38 | sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP | ||
39 | sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP | ||
40 | sysIP_NEXTHOP = C.IP_NEXTHOP | ||
41 | |||
42 | sysIP_PKTINFO = C.IP_PKTINFO | ||
43 | sysIP_RECVPKTINFO = C.IP_RECVPKTINFO | ||
44 | sysIP_DONTFRAG = C.IP_DONTFRAG | ||
45 | |||
46 | sysIP_BOUND_IF = C.IP_BOUND_IF | ||
47 | sysIP_UNSPEC_SRC = C.IP_UNSPEC_SRC | ||
48 | sysIP_BROADCAST_TTL = C.IP_BROADCAST_TTL | ||
49 | sysIP_DHCPINIT_IF = C.IP_DHCPINIT_IF | ||
50 | |||
51 | sysIP_REUSEADDR = C.IP_REUSEADDR | ||
52 | sysIP_DONTROUTE = C.IP_DONTROUTE | ||
53 | sysIP_BROADCAST = C.IP_BROADCAST | ||
54 | |||
55 | sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP | ||
56 | sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP | ||
57 | sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE | ||
58 | sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE | ||
59 | sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP | ||
60 | sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP | ||
61 | |||
62 | sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage | ||
63 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in | ||
64 | sizeofInetPktinfo = C.sizeof_struct_in_pktinfo | ||
65 | |||
66 | sizeofIPMreq = C.sizeof_struct_ip_mreq | ||
67 | sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source | ||
68 | sizeofGroupReq = C.sizeof_struct_group_req | ||
69 | sizeofGroupSourceReq = C.sizeof_struct_group_source_req | ||
70 | ) | ||
71 | |||
72 | type sockaddrStorage C.struct_sockaddr_storage | ||
73 | |||
74 | type sockaddrInet C.struct_sockaddr_in | ||
75 | |||
76 | type inetPktinfo C.struct_in_pktinfo | ||
77 | |||
78 | type ipMreq C.struct_ip_mreq | ||
79 | |||
80 | type ipMreqSource C.struct_ip_mreq_source | ||
81 | |||
82 | type groupReq C.struct_group_req | ||
83 | |||
84 | type groupSourceReq C.struct_group_source_req | ||
diff --git a/vendor/golang.org/x/net/ipv4/gen.go b/vendor/golang.org/x/net/ipv4/gen.go deleted file mode 100644 index 1bb1737..0000000 --- a/vendor/golang.org/x/net/ipv4/gen.go +++ /dev/null | |||
@@ -1,199 +0,0 @@ | |||
1 | // Copyright 2013 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | //go:generate go run gen.go | ||
8 | |||
9 | // This program generates system adaptation constants and types, | ||
10 | // internet protocol constants and tables by reading template files | ||
11 | // and IANA protocol registries. | ||
12 | package main | ||
13 | |||
14 | import ( | ||
15 | "bytes" | ||
16 | "encoding/xml" | ||
17 | "fmt" | ||
18 | "go/format" | ||
19 | "io" | ||
20 | "io/ioutil" | ||
21 | "net/http" | ||
22 | "os" | ||
23 | "os/exec" | ||
24 | "runtime" | ||
25 | "strconv" | ||
26 | "strings" | ||
27 | ) | ||
28 | |||
29 | func main() { | ||
30 | if err := genzsys(); err != nil { | ||
31 | fmt.Fprintln(os.Stderr, err) | ||
32 | os.Exit(1) | ||
33 | } | ||
34 | if err := geniana(); err != nil { | ||
35 | fmt.Fprintln(os.Stderr, err) | ||
36 | os.Exit(1) | ||
37 | } | ||
38 | } | ||
39 | |||
40 | func genzsys() error { | ||
41 | defs := "defs_" + runtime.GOOS + ".go" | ||
42 | f, err := os.Open(defs) | ||
43 | if err != nil { | ||
44 | if os.IsNotExist(err) { | ||
45 | return nil | ||
46 | } | ||
47 | return err | ||
48 | } | ||
49 | f.Close() | ||
50 | cmd := exec.Command("go", "tool", "cgo", "-godefs", defs) | ||
51 | b, err := cmd.Output() | ||
52 | if err != nil { | ||
53 | return err | ||
54 | } | ||
55 | b, err = format.Source(b) | ||
56 | if err != nil { | ||
57 | return err | ||
58 | } | ||
59 | zsys := "zsys_" + runtime.GOOS + ".go" | ||
60 | switch runtime.GOOS { | ||
61 | case "freebsd", "linux": | ||
62 | zsys = "zsys_" + runtime.GOOS + "_" + runtime.GOARCH + ".go" | ||
63 | } | ||
64 | if err := ioutil.WriteFile(zsys, b, 0644); err != nil { | ||
65 | return err | ||
66 | } | ||
67 | return nil | ||
68 | } | ||
69 | |||
70 | var registries = []struct { | ||
71 | url string | ||
72 | parse func(io.Writer, io.Reader) error | ||
73 | }{ | ||
74 | { | ||
75 | "https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xml", | ||
76 | parseICMPv4Parameters, | ||
77 | }, | ||
78 | } | ||
79 | |||
80 | func geniana() error { | ||
81 | var bb bytes.Buffer | ||
82 | fmt.Fprintf(&bb, "// go generate gen.go\n") | ||
83 | fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n") | ||
84 | fmt.Fprintf(&bb, "package ipv4\n\n") | ||
85 | for _, r := range registries { | ||
86 | resp, err := http.Get(r.url) | ||
87 | if err != nil { | ||
88 | return err | ||
89 | } | ||
90 | defer resp.Body.Close() | ||
91 | if resp.StatusCode != http.StatusOK { | ||
92 | return fmt.Errorf("got HTTP status code %v for %v\n", resp.StatusCode, r.url) | ||
93 | } | ||
94 | if err := r.parse(&bb, resp.Body); err != nil { | ||
95 | return err | ||
96 | } | ||
97 | fmt.Fprintf(&bb, "\n") | ||
98 | } | ||
99 | b, err := format.Source(bb.Bytes()) | ||
100 | if err != nil { | ||
101 | return err | ||
102 | } | ||
103 | if err := ioutil.WriteFile("iana.go", b, 0644); err != nil { | ||
104 | return err | ||
105 | } | ||
106 | return nil | ||
107 | } | ||
108 | |||
109 | func parseICMPv4Parameters(w io.Writer, r io.Reader) error { | ||
110 | dec := xml.NewDecoder(r) | ||
111 | var icp icmpv4Parameters | ||
112 | if err := dec.Decode(&icp); err != nil { | ||
113 | return err | ||
114 | } | ||
115 | prs := icp.escape() | ||
116 | fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated) | ||
117 | fmt.Fprintf(w, "const (\n") | ||
118 | for _, pr := range prs { | ||
119 | if pr.Descr == "" { | ||
120 | continue | ||
121 | } | ||
122 | fmt.Fprintf(w, "ICMPType%s ICMPType = %d", pr.Descr, pr.Value) | ||
123 | fmt.Fprintf(w, "// %s\n", pr.OrigDescr) | ||
124 | } | ||
125 | fmt.Fprintf(w, ")\n\n") | ||
126 | fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated) | ||
127 | fmt.Fprintf(w, "var icmpTypes = map[ICMPType]string{\n") | ||
128 | for _, pr := range prs { | ||
129 | if pr.Descr == "" { | ||
130 | continue | ||
131 | } | ||
132 | fmt.Fprintf(w, "%d: %q,\n", pr.Value, strings.ToLower(pr.OrigDescr)) | ||
133 | } | ||
134 | fmt.Fprintf(w, "}\n") | ||
135 | return nil | ||
136 | } | ||
137 | |||
138 | type icmpv4Parameters struct { | ||
139 | XMLName xml.Name `xml:"registry"` | ||
140 | Title string `xml:"title"` | ||
141 | Updated string `xml:"updated"` | ||
142 | Registries []struct { | ||
143 | Title string `xml:"title"` | ||
144 | Records []struct { | ||
145 | Value string `xml:"value"` | ||
146 | Descr string `xml:"description"` | ||
147 | } `xml:"record"` | ||
148 | } `xml:"registry"` | ||
149 | } | ||
150 | |||
151 | type canonICMPv4ParamRecord struct { | ||
152 | OrigDescr string | ||
153 | Descr string | ||
154 | Value int | ||
155 | } | ||
156 | |||
157 | func (icp *icmpv4Parameters) escape() []canonICMPv4ParamRecord { | ||
158 | id := -1 | ||
159 | for i, r := range icp.Registries { | ||
160 | if strings.Contains(r.Title, "Type") || strings.Contains(r.Title, "type") { | ||
161 | id = i | ||
162 | break | ||
163 | } | ||
164 | } | ||
165 | if id < 0 { | ||
166 | return nil | ||
167 | } | ||
168 | prs := make([]canonICMPv4ParamRecord, len(icp.Registries[id].Records)) | ||
169 | sr := strings.NewReplacer( | ||
170 | "Messages", "", | ||
171 | "Message", "", | ||
172 | "ICMP", "", | ||
173 | "+", "P", | ||
174 | "-", "", | ||
175 | "/", "", | ||
176 | ".", "", | ||
177 | " ", "", | ||
178 | ) | ||
179 | for i, pr := range icp.Registries[id].Records { | ||
180 | if strings.Contains(pr.Descr, "Reserved") || | ||
181 | strings.Contains(pr.Descr, "Unassigned") || | ||
182 | strings.Contains(pr.Descr, "Deprecated") || | ||
183 | strings.Contains(pr.Descr, "Experiment") || | ||
184 | strings.Contains(pr.Descr, "experiment") { | ||
185 | continue | ||
186 | } | ||
187 | ss := strings.Split(pr.Descr, "\n") | ||
188 | if len(ss) > 1 { | ||
189 | prs[i].Descr = strings.Join(ss, " ") | ||
190 | } else { | ||
191 | prs[i].Descr = ss[0] | ||
192 | } | ||
193 | s := strings.TrimSpace(prs[i].Descr) | ||
194 | prs[i].OrigDescr = s | ||
195 | prs[i].Descr = sr.Replace(s) | ||
196 | prs[i].Value, _ = strconv.Atoi(pr.Value) | ||
197 | } | ||
198 | return prs | ||
199 | } | ||
diff --git a/vendor/golang.org/x/sys/unix/mkasm_darwin.go b/vendor/golang.org/x/sys/unix/mkasm_darwin.go deleted file mode 100644 index 4548b99..0000000 --- a/vendor/golang.org/x/sys/unix/mkasm_darwin.go +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | // Copyright 2018 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go. | ||
8 | //This program must be run after mksyscall.go. | ||
9 | package main | ||
10 | |||
11 | import ( | ||
12 | "bytes" | ||
13 | "fmt" | ||
14 | "io/ioutil" | ||
15 | "log" | ||
16 | "os" | ||
17 | "strings" | ||
18 | ) | ||
19 | |||
20 | func main() { | ||
21 | in1, err := ioutil.ReadFile("syscall_darwin.go") | ||
22 | if err != nil { | ||
23 | log.Fatalf("can't open syscall_darwin.go: %s", err) | ||
24 | } | ||
25 | arch := os.Args[1] | ||
26 | in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch)) | ||
27 | if err != nil { | ||
28 | log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err) | ||
29 | } | ||
30 | in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch)) | ||
31 | if err != nil { | ||
32 | log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err) | ||
33 | } | ||
34 | in := string(in1) + string(in2) + string(in3) | ||
35 | |||
36 | trampolines := map[string]bool{} | ||
37 | |||
38 | var out bytes.Buffer | ||
39 | |||
40 | fmt.Fprintf(&out, "// go run mkasm_darwin.go %s\n", strings.Join(os.Args[1:], " ")) | ||
41 | fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n") | ||
42 | fmt.Fprintf(&out, "\n") | ||
43 | fmt.Fprintf(&out, "// +build go1.12\n") | ||
44 | fmt.Fprintf(&out, "\n") | ||
45 | fmt.Fprintf(&out, "#include \"textflag.h\"\n") | ||
46 | for _, line := range strings.Split(in, "\n") { | ||
47 | if !strings.HasPrefix(line, "func ") || !strings.HasSuffix(line, "_trampoline()") { | ||
48 | continue | ||
49 | } | ||
50 | fn := line[5 : len(line)-13] | ||
51 | if !trampolines[fn] { | ||
52 | trampolines[fn] = true | ||
53 | fmt.Fprintf(&out, "TEXT ·%s_trampoline(SB),NOSPLIT,$0-0\n", fn) | ||
54 | fmt.Fprintf(&out, "\tJMP\t%s(SB)\n", fn) | ||
55 | } | ||
56 | } | ||
57 | err = ioutil.WriteFile(fmt.Sprintf("zsyscall_darwin_%s.s", arch), out.Bytes(), 0644) | ||
58 | if err != nil { | ||
59 | log.Fatalf("can't write zsyscall_darwin_%s.s: %s", arch, err) | ||
60 | } | ||
61 | } | ||
diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go deleted file mode 100644 index eb43320..0000000 --- a/vendor/golang.org/x/sys/unix/mkpost.go +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | // Copyright 2016 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // mkpost processes the output of cgo -godefs to | ||
8 | // modify the generated types. It is used to clean up | ||
9 | // the sys API in an architecture specific manner. | ||
10 | // | ||
11 | // mkpost is run after cgo -godefs; see README.md. | ||
12 | package main | ||
13 | |||
14 | import ( | ||
15 | "bytes" | ||
16 | "fmt" | ||
17 | "go/format" | ||
18 | "io/ioutil" | ||
19 | "log" | ||
20 | "os" | ||
21 | "regexp" | ||
22 | ) | ||
23 | |||
24 | func main() { | ||
25 | // Get the OS and architecture (using GOARCH_TARGET if it exists) | ||
26 | goos := os.Getenv("GOOS") | ||
27 | goarch := os.Getenv("GOARCH_TARGET") | ||
28 | if goarch == "" { | ||
29 | goarch = os.Getenv("GOARCH") | ||
30 | } | ||
31 | // Check that we are using the Docker-based build system if we should be. | ||
32 | if goos == "linux" { | ||
33 | if os.Getenv("GOLANG_SYS_BUILD") != "docker" { | ||
34 | os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n") | ||
35 | os.Stderr.WriteString("See README.md\n") | ||
36 | os.Exit(1) | ||
37 | } | ||
38 | } | ||
39 | |||
40 | b, err := ioutil.ReadAll(os.Stdin) | ||
41 | if err != nil { | ||
42 | log.Fatal(err) | ||
43 | } | ||
44 | |||
45 | if goos == "aix" { | ||
46 | // Replace type of Atim, Mtim and Ctim by Timespec in Stat_t | ||
47 | // to avoid having both StTimespec and Timespec. | ||
48 | sttimespec := regexp.MustCompile(`_Ctype_struct_st_timespec`) | ||
49 | b = sttimespec.ReplaceAll(b, []byte("Timespec")) | ||
50 | } | ||
51 | |||
52 | // Intentionally export __val fields in Fsid and Sigset_t | ||
53 | valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__(bits|val)(\s+\S+\s+)}`) | ||
54 | b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$4}")) | ||
55 | |||
56 | // Intentionally export __fds_bits field in FdSet | ||
57 | fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`) | ||
58 | b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}")) | ||
59 | |||
60 | // If we have empty Ptrace structs, we should delete them. Only s390x emits | ||
61 | // nonempty Ptrace structs. | ||
62 | ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`) | ||
63 | b = ptraceRexexp.ReplaceAll(b, nil) | ||
64 | |||
65 | // Replace the control_regs union with a blank identifier for now. | ||
66 | controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`) | ||
67 | b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64")) | ||
68 | |||
69 | // Remove fields that are added by glibc | ||
70 | // Note that this is unstable as the identifers are private. | ||
71 | removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`) | ||
72 | b = removeFieldsRegex.ReplaceAll(b, []byte("_")) | ||
73 | |||
74 | // Convert [65]int8 to [65]byte in Utsname members to simplify | ||
75 | // conversion to string; see golang.org/issue/20753 | ||
76 | convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`) | ||
77 | b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte")) | ||
78 | |||
79 | // Convert [1024]int8 to [1024]byte in Ptmget members | ||
80 | convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`) | ||
81 | b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte")) | ||
82 | |||
83 | // Remove spare fields (e.g. in Statx_t) | ||
84 | spareFieldsRegex := regexp.MustCompile(`X__spare\S*`) | ||
85 | b = spareFieldsRegex.ReplaceAll(b, []byte("_")) | ||
86 | |||
87 | // Remove cgo padding fields | ||
88 | removePaddingFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`) | ||
89 | b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_")) | ||
90 | |||
91 | // Remove padding, hidden, or unused fields | ||
92 | removeFieldsRegex = regexp.MustCompile(`\b(X_\S+|Padding)`) | ||
93 | b = removeFieldsRegex.ReplaceAll(b, []byte("_")) | ||
94 | |||
95 | // Remove the first line of warning from cgo | ||
96 | b = b[bytes.IndexByte(b, '\n')+1:] | ||
97 | // Modify the command in the header to include: | ||
98 | // mkpost, our own warning, and a build tag. | ||
99 | replacement := fmt.Sprintf(`$1 | go run mkpost.go | ||
100 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
101 | |||
102 | // +build %s,%s`, goarch, goos) | ||
103 | cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`) | ||
104 | b = cgoCommandRegex.ReplaceAll(b, []byte(replacement)) | ||
105 | |||
106 | // Rename Stat_t time fields | ||
107 | if goos == "freebsd" && goarch == "386" { | ||
108 | // Hide Stat_t.[AMCB]tim_ext fields | ||
109 | renameStatTimeExtFieldsRegex := regexp.MustCompile(`[AMCB]tim_ext`) | ||
110 | b = renameStatTimeExtFieldsRegex.ReplaceAll(b, []byte("_")) | ||
111 | } | ||
112 | renameStatTimeFieldsRegex := regexp.MustCompile(`([AMCB])(?:irth)?time?(?:spec)?\s+(Timespec|StTimespec)`) | ||
113 | b = renameStatTimeFieldsRegex.ReplaceAll(b, []byte("${1}tim ${2}")) | ||
114 | |||
115 | // gofmt | ||
116 | b, err = format.Source(b) | ||
117 | if err != nil { | ||
118 | log.Fatal(err) | ||
119 | } | ||
120 | |||
121 | os.Stdout.Write(b) | ||
122 | } | ||
diff --git a/vendor/golang.org/x/sys/unix/mksyscall.go b/vendor/golang.org/x/sys/unix/mksyscall.go deleted file mode 100644 index e4af942..0000000 --- a/vendor/golang.org/x/sys/unix/mksyscall.go +++ /dev/null | |||
@@ -1,407 +0,0 @@ | |||
1 | // Copyright 2018 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | This program reads a file containing function prototypes | ||
9 | (like syscall_darwin.go) and generates system call bodies. | ||
10 | The prototypes are marked by lines beginning with "//sys" | ||
11 | and read like func declarations if //sys is replaced by func, but: | ||
12 | * The parameter lists must give a name for each argument. | ||
13 | This includes return parameters. | ||
14 | * The parameter lists must give a type for each argument: | ||
15 | the (x, y, z int) shorthand is not allowed. | ||
16 | * If the return parameter is an error number, it must be named errno. | ||
17 | |||
18 | A line beginning with //sysnb is like //sys, except that the | ||
19 | goroutine will not be suspended during the execution of the system | ||
20 | call. This must only be used for system calls which can never | ||
21 | block, as otherwise the system call could cause all goroutines to | ||
22 | hang. | ||
23 | */ | ||
24 | package main | ||
25 | |||
26 | import ( | ||
27 | "bufio" | ||
28 | "flag" | ||
29 | "fmt" | ||
30 | "os" | ||
31 | "regexp" | ||
32 | "strings" | ||
33 | ) | ||
34 | |||
35 | var ( | ||
36 | b32 = flag.Bool("b32", false, "32bit big-endian") | ||
37 | l32 = flag.Bool("l32", false, "32bit little-endian") | ||
38 | plan9 = flag.Bool("plan9", false, "plan9") | ||
39 | openbsd = flag.Bool("openbsd", false, "openbsd") | ||
40 | netbsd = flag.Bool("netbsd", false, "netbsd") | ||
41 | dragonfly = flag.Bool("dragonfly", false, "dragonfly") | ||
42 | arm = flag.Bool("arm", false, "arm") // 64-bit value should use (even, odd)-pair | ||
43 | tags = flag.String("tags", "", "build tags") | ||
44 | filename = flag.String("output", "", "output file name (standard output if omitted)") | ||
45 | ) | ||
46 | |||
47 | // cmdLine returns this programs's commandline arguments | ||
48 | func cmdLine() string { | ||
49 | return "go run mksyscall.go " + strings.Join(os.Args[1:], " ") | ||
50 | } | ||
51 | |||
52 | // buildTags returns build tags | ||
53 | func buildTags() string { | ||
54 | return *tags | ||
55 | } | ||
56 | |||
57 | // Param is function parameter | ||
58 | type Param struct { | ||
59 | Name string | ||
60 | Type string | ||
61 | } | ||
62 | |||
63 | // usage prints the program usage | ||
64 | func usage() { | ||
65 | fmt.Fprintf(os.Stderr, "usage: go run mksyscall.go [-b32 | -l32] [-tags x,y] [file ...]\n") | ||
66 | os.Exit(1) | ||
67 | } | ||
68 | |||
69 | // parseParamList parses parameter list and returns a slice of parameters | ||
70 | func parseParamList(list string) []string { | ||
71 | list = strings.TrimSpace(list) | ||
72 | if list == "" { | ||
73 | return []string{} | ||
74 | } | ||
75 | return regexp.MustCompile(`\s*,\s*`).Split(list, -1) | ||
76 | } | ||
77 | |||
78 | // parseParam splits a parameter into name and type | ||
79 | func parseParam(p string) Param { | ||
80 | ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) | ||
81 | if ps == nil { | ||
82 | fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) | ||
83 | os.Exit(1) | ||
84 | } | ||
85 | return Param{ps[1], ps[2]} | ||
86 | } | ||
87 | |||
88 | func main() { | ||
89 | // Get the OS and architecture (using GOARCH_TARGET if it exists) | ||
90 | goos := os.Getenv("GOOS") | ||
91 | if goos == "" { | ||
92 | fmt.Fprintln(os.Stderr, "GOOS not defined in environment") | ||
93 | os.Exit(1) | ||
94 | } | ||
95 | goarch := os.Getenv("GOARCH_TARGET") | ||
96 | if goarch == "" { | ||
97 | goarch = os.Getenv("GOARCH") | ||
98 | } | ||
99 | |||
100 | // Check that we are using the Docker-based build system if we should | ||
101 | if goos == "linux" { | ||
102 | if os.Getenv("GOLANG_SYS_BUILD") != "docker" { | ||
103 | fmt.Fprintf(os.Stderr, "In the Docker-based build system, mksyscall should not be called directly.\n") | ||
104 | fmt.Fprintf(os.Stderr, "See README.md\n") | ||
105 | os.Exit(1) | ||
106 | } | ||
107 | } | ||
108 | |||
109 | flag.Usage = usage | ||
110 | flag.Parse() | ||
111 | if len(flag.Args()) <= 0 { | ||
112 | fmt.Fprintf(os.Stderr, "no files to parse provided\n") | ||
113 | usage() | ||
114 | } | ||
115 | |||
116 | endianness := "" | ||
117 | if *b32 { | ||
118 | endianness = "big-endian" | ||
119 | } else if *l32 { | ||
120 | endianness = "little-endian" | ||
121 | } | ||
122 | |||
123 | libc := false | ||
124 | if goos == "darwin" && strings.Contains(buildTags(), ",go1.12") { | ||
125 | libc = true | ||
126 | } | ||
127 | trampolines := map[string]bool{} | ||
128 | |||
129 | text := "" | ||
130 | for _, path := range flag.Args() { | ||
131 | file, err := os.Open(path) | ||
132 | if err != nil { | ||
133 | fmt.Fprintf(os.Stderr, err.Error()) | ||
134 | os.Exit(1) | ||
135 | } | ||
136 | s := bufio.NewScanner(file) | ||
137 | for s.Scan() { | ||
138 | t := s.Text() | ||
139 | t = strings.TrimSpace(t) | ||
140 | t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) | ||
141 | nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) | ||
142 | if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { | ||
143 | continue | ||
144 | } | ||
145 | |||
146 | // Line must be of the form | ||
147 | // func Open(path string, mode int, perm int) (fd int, errno error) | ||
148 | // Split into name, in params, out params. | ||
149 | f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$`).FindStringSubmatch(t) | ||
150 | if f == nil { | ||
151 | fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) | ||
152 | os.Exit(1) | ||
153 | } | ||
154 | funct, inps, outps, sysname := f[2], f[3], f[4], f[5] | ||
155 | |||
156 | // ClockGettime doesn't have a syscall number on Darwin, only generate libc wrappers. | ||
157 | if goos == "darwin" && !libc && funct == "ClockGettime" { | ||
158 | continue | ||
159 | } | ||
160 | |||
161 | // Split argument lists on comma. | ||
162 | in := parseParamList(inps) | ||
163 | out := parseParamList(outps) | ||
164 | |||
165 | // Try in vain to keep people from editing this file. | ||
166 | // The theory is that they jump into the middle of the file | ||
167 | // without reading the header. | ||
168 | text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" | ||
169 | |||
170 | // Go function header. | ||
171 | outDecl := "" | ||
172 | if len(out) > 0 { | ||
173 | outDecl = fmt.Sprintf(" (%s)", strings.Join(out, ", ")) | ||
174 | } | ||
175 | text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outDecl) | ||
176 | |||
177 | // Check if err return available | ||
178 | errvar := "" | ||
179 | for _, param := range out { | ||
180 | p := parseParam(param) | ||
181 | if p.Type == "error" { | ||
182 | errvar = p.Name | ||
183 | break | ||
184 | } | ||
185 | } | ||
186 | |||
187 | // Prepare arguments to Syscall. | ||
188 | var args []string | ||
189 | n := 0 | ||
190 | for _, param := range in { | ||
191 | p := parseParam(param) | ||
192 | if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { | ||
193 | args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))") | ||
194 | } else if p.Type == "string" && errvar != "" { | ||
195 | text += fmt.Sprintf("\tvar _p%d *byte\n", n) | ||
196 | text += fmt.Sprintf("\t_p%d, %s = BytePtrFromString(%s)\n", n, errvar, p.Name) | ||
197 | text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) | ||
198 | args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) | ||
199 | n++ | ||
200 | } else if p.Type == "string" { | ||
201 | fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") | ||
202 | text += fmt.Sprintf("\tvar _p%d *byte\n", n) | ||
203 | text += fmt.Sprintf("\t_p%d, _ = BytePtrFromString(%s)\n", n, p.Name) | ||
204 | args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) | ||
205 | n++ | ||
206 | } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { | ||
207 | // Convert slice into pointer, length. | ||
208 | // Have to be careful not to take address of &a[0] if len == 0: | ||
209 | // pass dummy pointer in that case. | ||
210 | // Used to pass nil, but some OSes or simulators reject write(fd, nil, 0). | ||
211 | text += fmt.Sprintf("\tvar _p%d unsafe.Pointer\n", n) | ||
212 | text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = unsafe.Pointer(&%s[0])\n\t}", p.Name, n, p.Name) | ||
213 | text += fmt.Sprintf(" else {\n\t\t_p%d = unsafe.Pointer(&_zero)\n\t}\n", n) | ||
214 | args = append(args, fmt.Sprintf("uintptr(_p%d)", n), fmt.Sprintf("uintptr(len(%s))", p.Name)) | ||
215 | n++ | ||
216 | } else if p.Type == "int64" && (*openbsd || *netbsd) { | ||
217 | args = append(args, "0") | ||
218 | if endianness == "big-endian" { | ||
219 | args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) | ||
220 | } else if endianness == "little-endian" { | ||
221 | args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) | ||
222 | } else { | ||
223 | args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
224 | } | ||
225 | } else if p.Type == "int64" && *dragonfly { | ||
226 | if regexp.MustCompile(`^(?i)extp(read|write)`).FindStringSubmatch(funct) == nil { | ||
227 | args = append(args, "0") | ||
228 | } | ||
229 | if endianness == "big-endian" { | ||
230 | args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) | ||
231 | } else if endianness == "little-endian" { | ||
232 | args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) | ||
233 | } else { | ||
234 | args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
235 | } | ||
236 | } else if (p.Type == "int64" || p.Type == "uint64") && endianness != "" { | ||
237 | if len(args)%2 == 1 && *arm { | ||
238 | // arm abi specifies 64-bit argument uses | ||
239 | // (even, odd) pair | ||
240 | args = append(args, "0") | ||
241 | } | ||
242 | if endianness == "big-endian" { | ||
243 | args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) | ||
244 | } else { | ||
245 | args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) | ||
246 | } | ||
247 | } else { | ||
248 | args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
249 | } | ||
250 | } | ||
251 | |||
252 | // Determine which form to use; pad args with zeros. | ||
253 | asm := "Syscall" | ||
254 | if nonblock != nil { | ||
255 | if errvar == "" && goos == "linux" { | ||
256 | asm = "RawSyscallNoError" | ||
257 | } else { | ||
258 | asm = "RawSyscall" | ||
259 | } | ||
260 | } else { | ||
261 | if errvar == "" && goos == "linux" { | ||
262 | asm = "SyscallNoError" | ||
263 | } | ||
264 | } | ||
265 | if len(args) <= 3 { | ||
266 | for len(args) < 3 { | ||
267 | args = append(args, "0") | ||
268 | } | ||
269 | } else if len(args) <= 6 { | ||
270 | asm += "6" | ||
271 | for len(args) < 6 { | ||
272 | args = append(args, "0") | ||
273 | } | ||
274 | } else if len(args) <= 9 { | ||
275 | asm += "9" | ||
276 | for len(args) < 9 { | ||
277 | args = append(args, "0") | ||
278 | } | ||
279 | } else { | ||
280 | fmt.Fprintf(os.Stderr, "%s:%s too many arguments to system call\n", path, funct) | ||
281 | } | ||
282 | |||
283 | // System call number. | ||
284 | if sysname == "" { | ||
285 | sysname = "SYS_" + funct | ||
286 | sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) | ||
287 | sysname = strings.ToUpper(sysname) | ||
288 | } | ||
289 | |||
290 | var libcFn string | ||
291 | if libc { | ||
292 | asm = "syscall_" + strings.ToLower(asm[:1]) + asm[1:] // internal syscall call | ||
293 | sysname = strings.TrimPrefix(sysname, "SYS_") // remove SYS_ | ||
294 | sysname = strings.ToLower(sysname) // lowercase | ||
295 | if sysname == "getdirentries64" { | ||
296 | // Special case - libSystem name and | ||
297 | // raw syscall name don't match. | ||
298 | sysname = "__getdirentries64" | ||
299 | } | ||
300 | libcFn = sysname | ||
301 | sysname = "funcPC(libc_" + sysname + "_trampoline)" | ||
302 | } | ||
303 | |||
304 | // Actual call. | ||
305 | arglist := strings.Join(args, ", ") | ||
306 | call := fmt.Sprintf("%s(%s, %s)", asm, sysname, arglist) | ||
307 | |||
308 | // Assign return values. | ||
309 | body := "" | ||
310 | ret := []string{"_", "_", "_"} | ||
311 | doErrno := false | ||
312 | for i := 0; i < len(out); i++ { | ||
313 | p := parseParam(out[i]) | ||
314 | reg := "" | ||
315 | if p.Name == "err" && !*plan9 { | ||
316 | reg = "e1" | ||
317 | ret[2] = reg | ||
318 | doErrno = true | ||
319 | } else if p.Name == "err" && *plan9 { | ||
320 | ret[0] = "r0" | ||
321 | ret[2] = "e1" | ||
322 | break | ||
323 | } else { | ||
324 | reg = fmt.Sprintf("r%d", i) | ||
325 | ret[i] = reg | ||
326 | } | ||
327 | if p.Type == "bool" { | ||
328 | reg = fmt.Sprintf("%s != 0", reg) | ||
329 | } | ||
330 | if p.Type == "int64" && endianness != "" { | ||
331 | // 64-bit number in r1:r0 or r0:r1. | ||
332 | if i+2 > len(out) { | ||
333 | fmt.Fprintf(os.Stderr, "%s:%s not enough registers for int64 return\n", path, funct) | ||
334 | } | ||
335 | if endianness == "big-endian" { | ||
336 | reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1) | ||
337 | } else { | ||
338 | reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i) | ||
339 | } | ||
340 | ret[i] = fmt.Sprintf("r%d", i) | ||
341 | ret[i+1] = fmt.Sprintf("r%d", i+1) | ||
342 | } | ||
343 | if reg != "e1" || *plan9 { | ||
344 | body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) | ||
345 | } | ||
346 | } | ||
347 | if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" { | ||
348 | text += fmt.Sprintf("\t%s\n", call) | ||
349 | } else { | ||
350 | if errvar == "" && goos == "linux" { | ||
351 | // raw syscall without error on Linux, see golang.org/issue/22924 | ||
352 | text += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], call) | ||
353 | } else { | ||
354 | text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call) | ||
355 | } | ||
356 | } | ||
357 | text += body | ||
358 | |||
359 | if *plan9 && ret[2] == "e1" { | ||
360 | text += "\tif int32(r0) == -1 {\n" | ||
361 | text += "\t\terr = e1\n" | ||
362 | text += "\t}\n" | ||
363 | } else if doErrno { | ||
364 | text += "\tif e1 != 0 {\n" | ||
365 | text += "\t\terr = errnoErr(e1)\n" | ||
366 | text += "\t}\n" | ||
367 | } | ||
368 | text += "\treturn\n" | ||
369 | text += "}\n\n" | ||
370 | |||
371 | if libc && !trampolines[libcFn] { | ||
372 | // some system calls share a trampoline, like read and readlen. | ||
373 | trampolines[libcFn] = true | ||
374 | // Declare assembly trampoline. | ||
375 | text += fmt.Sprintf("func libc_%s_trampoline()\n", libcFn) | ||
376 | // Assembly trampoline calls the libc_* function, which this magic | ||
377 | // redirects to use the function from libSystem. | ||
378 | text += fmt.Sprintf("//go:linkname libc_%s libc_%s\n", libcFn, libcFn) | ||
379 | text += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"/usr/lib/libSystem.B.dylib\"\n", libcFn, libcFn) | ||
380 | text += "\n" | ||
381 | } | ||
382 | } | ||
383 | if err := s.Err(); err != nil { | ||
384 | fmt.Fprintf(os.Stderr, err.Error()) | ||
385 | os.Exit(1) | ||
386 | } | ||
387 | file.Close() | ||
388 | } | ||
389 | fmt.Printf(srcTemplate, cmdLine(), buildTags(), text) | ||
390 | } | ||
391 | |||
392 | const srcTemplate = `// %s | ||
393 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
394 | |||
395 | // +build %s | ||
396 | |||
397 | package unix | ||
398 | |||
399 | import ( | ||
400 | "syscall" | ||
401 | "unsafe" | ||
402 | ) | ||
403 | |||
404 | var _ syscall.Errno | ||
405 | |||
406 | %s | ||
407 | ` | ||
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go deleted file mode 100644 index 3be3cdf..0000000 --- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go +++ /dev/null | |||
@@ -1,415 +0,0 @@ | |||
1 | // Copyright 2019 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | This program reads a file containing function prototypes | ||
9 | (like syscall_aix.go) and generates system call bodies. | ||
10 | The prototypes are marked by lines beginning with "//sys" | ||
11 | and read like func declarations if //sys is replaced by func, but: | ||
12 | * The parameter lists must give a name for each argument. | ||
13 | This includes return parameters. | ||
14 | * The parameter lists must give a type for each argument: | ||
15 | the (x, y, z int) shorthand is not allowed. | ||
16 | * If the return parameter is an error number, it must be named err. | ||
17 | * If go func name needs to be different than its libc name, | ||
18 | * or the function is not in libc, name could be specified | ||
19 | * at the end, after "=" sign, like | ||
20 | //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt | ||
21 | */ | ||
22 | package main | ||
23 | |||
24 | import ( | ||
25 | "bufio" | ||
26 | "flag" | ||
27 | "fmt" | ||
28 | "os" | ||
29 | "regexp" | ||
30 | "strings" | ||
31 | ) | ||
32 | |||
33 | var ( | ||
34 | b32 = flag.Bool("b32", false, "32bit big-endian") | ||
35 | l32 = flag.Bool("l32", false, "32bit little-endian") | ||
36 | aix = flag.Bool("aix", false, "aix") | ||
37 | tags = flag.String("tags", "", "build tags") | ||
38 | ) | ||
39 | |||
40 | // cmdLine returns this programs's commandline arguments | ||
41 | func cmdLine() string { | ||
42 | return "go run mksyscall_aix_ppc.go " + strings.Join(os.Args[1:], " ") | ||
43 | } | ||
44 | |||
45 | // buildTags returns build tags | ||
46 | func buildTags() string { | ||
47 | return *tags | ||
48 | } | ||
49 | |||
50 | // Param is function parameter | ||
51 | type Param struct { | ||
52 | Name string | ||
53 | Type string | ||
54 | } | ||
55 | |||
56 | // usage prints the program usage | ||
57 | func usage() { | ||
58 | fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc.go [-b32 | -l32] [-tags x,y] [file ...]\n") | ||
59 | os.Exit(1) | ||
60 | } | ||
61 | |||
62 | // parseParamList parses parameter list and returns a slice of parameters | ||
63 | func parseParamList(list string) []string { | ||
64 | list = strings.TrimSpace(list) | ||
65 | if list == "" { | ||
66 | return []string{} | ||
67 | } | ||
68 | return regexp.MustCompile(`\s*,\s*`).Split(list, -1) | ||
69 | } | ||
70 | |||
71 | // parseParam splits a parameter into name and type | ||
72 | func parseParam(p string) Param { | ||
73 | ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) | ||
74 | if ps == nil { | ||
75 | fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) | ||
76 | os.Exit(1) | ||
77 | } | ||
78 | return Param{ps[1], ps[2]} | ||
79 | } | ||
80 | |||
81 | func main() { | ||
82 | flag.Usage = usage | ||
83 | flag.Parse() | ||
84 | if len(flag.Args()) <= 0 { | ||
85 | fmt.Fprintf(os.Stderr, "no files to parse provided\n") | ||
86 | usage() | ||
87 | } | ||
88 | |||
89 | endianness := "" | ||
90 | if *b32 { | ||
91 | endianness = "big-endian" | ||
92 | } else if *l32 { | ||
93 | endianness = "little-endian" | ||
94 | } | ||
95 | |||
96 | pack := "" | ||
97 | text := "" | ||
98 | cExtern := "/*\n#include <stdint.h>\n#include <stddef.h>\n" | ||
99 | for _, path := range flag.Args() { | ||
100 | file, err := os.Open(path) | ||
101 | if err != nil { | ||
102 | fmt.Fprintf(os.Stderr, err.Error()) | ||
103 | os.Exit(1) | ||
104 | } | ||
105 | s := bufio.NewScanner(file) | ||
106 | for s.Scan() { | ||
107 | t := s.Text() | ||
108 | t = strings.TrimSpace(t) | ||
109 | t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) | ||
110 | if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { | ||
111 | pack = p[1] | ||
112 | } | ||
113 | nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) | ||
114 | if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { | ||
115 | continue | ||
116 | } | ||
117 | |||
118 | // Line must be of the form | ||
119 | // func Open(path string, mode int, perm int) (fd int, err error) | ||
120 | // Split into name, in params, out params. | ||
121 | f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) | ||
122 | if f == nil { | ||
123 | fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) | ||
124 | os.Exit(1) | ||
125 | } | ||
126 | funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] | ||
127 | |||
128 | // Split argument lists on comma. | ||
129 | in := parseParamList(inps) | ||
130 | out := parseParamList(outps) | ||
131 | |||
132 | inps = strings.Join(in, ", ") | ||
133 | outps = strings.Join(out, ", ") | ||
134 | |||
135 | // Try in vain to keep people from editing this file. | ||
136 | // The theory is that they jump into the middle of the file | ||
137 | // without reading the header. | ||
138 | text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" | ||
139 | |||
140 | // Check if value return, err return available | ||
141 | errvar := "" | ||
142 | retvar := "" | ||
143 | rettype := "" | ||
144 | for _, param := range out { | ||
145 | p := parseParam(param) | ||
146 | if p.Type == "error" { | ||
147 | errvar = p.Name | ||
148 | } else { | ||
149 | retvar = p.Name | ||
150 | rettype = p.Type | ||
151 | } | ||
152 | } | ||
153 | |||
154 | // System call name. | ||
155 | if sysname == "" { | ||
156 | sysname = funct | ||
157 | } | ||
158 | sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) | ||
159 | sysname = strings.ToLower(sysname) // All libc functions are lowercase. | ||
160 | |||
161 | cRettype := "" | ||
162 | if rettype == "unsafe.Pointer" { | ||
163 | cRettype = "uintptr_t" | ||
164 | } else if rettype == "uintptr" { | ||
165 | cRettype = "uintptr_t" | ||
166 | } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil { | ||
167 | cRettype = "uintptr_t" | ||
168 | } else if rettype == "int" { | ||
169 | cRettype = "int" | ||
170 | } else if rettype == "int32" { | ||
171 | cRettype = "int" | ||
172 | } else if rettype == "int64" { | ||
173 | cRettype = "long long" | ||
174 | } else if rettype == "uint32" { | ||
175 | cRettype = "unsigned int" | ||
176 | } else if rettype == "uint64" { | ||
177 | cRettype = "unsigned long long" | ||
178 | } else { | ||
179 | cRettype = "int" | ||
180 | } | ||
181 | if sysname == "exit" { | ||
182 | cRettype = "void" | ||
183 | } | ||
184 | |||
185 | // Change p.Types to c | ||
186 | var cIn []string | ||
187 | for _, param := range in { | ||
188 | p := parseParam(param) | ||
189 | if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { | ||
190 | cIn = append(cIn, "uintptr_t") | ||
191 | } else if p.Type == "string" { | ||
192 | cIn = append(cIn, "uintptr_t") | ||
193 | } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { | ||
194 | cIn = append(cIn, "uintptr_t", "size_t") | ||
195 | } else if p.Type == "unsafe.Pointer" { | ||
196 | cIn = append(cIn, "uintptr_t") | ||
197 | } else if p.Type == "uintptr" { | ||
198 | cIn = append(cIn, "uintptr_t") | ||
199 | } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { | ||
200 | cIn = append(cIn, "uintptr_t") | ||
201 | } else if p.Type == "int" { | ||
202 | cIn = append(cIn, "int") | ||
203 | } else if p.Type == "int32" { | ||
204 | cIn = append(cIn, "int") | ||
205 | } else if p.Type == "int64" { | ||
206 | cIn = append(cIn, "long long") | ||
207 | } else if p.Type == "uint32" { | ||
208 | cIn = append(cIn, "unsigned int") | ||
209 | } else if p.Type == "uint64" { | ||
210 | cIn = append(cIn, "unsigned long long") | ||
211 | } else { | ||
212 | cIn = append(cIn, "int") | ||
213 | } | ||
214 | } | ||
215 | |||
216 | if funct != "fcntl" && funct != "FcntlInt" && funct != "readlen" && funct != "writelen" { | ||
217 | if sysname == "select" { | ||
218 | // select is a keyword of Go. Its name is | ||
219 | // changed to c_select. | ||
220 | cExtern += "#define c_select select\n" | ||
221 | } | ||
222 | // Imports of system calls from libc | ||
223 | cExtern += fmt.Sprintf("%s %s", cRettype, sysname) | ||
224 | cIn := strings.Join(cIn, ", ") | ||
225 | cExtern += fmt.Sprintf("(%s);\n", cIn) | ||
226 | } | ||
227 | |||
228 | // So file name. | ||
229 | if *aix { | ||
230 | if modname == "" { | ||
231 | modname = "libc.a/shr_64.o" | ||
232 | } else { | ||
233 | fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct) | ||
234 | os.Exit(1) | ||
235 | } | ||
236 | } | ||
237 | |||
238 | strconvfunc := "C.CString" | ||
239 | |||
240 | // Go function header. | ||
241 | if outps != "" { | ||
242 | outps = fmt.Sprintf(" (%s)", outps) | ||
243 | } | ||
244 | if text != "" { | ||
245 | text += "\n" | ||
246 | } | ||
247 | |||
248 | text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps) | ||
249 | |||
250 | // Prepare arguments to Syscall. | ||
251 | var args []string | ||
252 | n := 0 | ||
253 | argN := 0 | ||
254 | for _, param := range in { | ||
255 | p := parseParam(param) | ||
256 | if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { | ||
257 | args = append(args, "C.uintptr_t(uintptr(unsafe.Pointer("+p.Name+")))") | ||
258 | } else if p.Type == "string" && errvar != "" { | ||
259 | text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name) | ||
260 | args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n)) | ||
261 | n++ | ||
262 | } else if p.Type == "string" { | ||
263 | fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") | ||
264 | text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name) | ||
265 | args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n)) | ||
266 | n++ | ||
267 | } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil { | ||
268 | // Convert slice into pointer, length. | ||
269 | // Have to be careful not to take address of &a[0] if len == 0: | ||
270 | // pass nil in that case. | ||
271 | text += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1]) | ||
272 | text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) | ||
273 | args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(unsafe.Pointer(_p%d)))", n)) | ||
274 | n++ | ||
275 | text += fmt.Sprintf("\tvar _p%d int\n", n) | ||
276 | text += fmt.Sprintf("\t_p%d = len(%s)\n", n, p.Name) | ||
277 | args = append(args, fmt.Sprintf("C.size_t(_p%d)", n)) | ||
278 | n++ | ||
279 | } else if p.Type == "int64" && endianness != "" { | ||
280 | if endianness == "big-endian" { | ||
281 | args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) | ||
282 | } else { | ||
283 | args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) | ||
284 | } | ||
285 | n++ | ||
286 | } else if p.Type == "bool" { | ||
287 | text += fmt.Sprintf("\tvar _p%d uint32\n", n) | ||
288 | text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n) | ||
289 | args = append(args, fmt.Sprintf("_p%d", n)) | ||
290 | } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { | ||
291 | args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name)) | ||
292 | } else if p.Type == "unsafe.Pointer" { | ||
293 | args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name)) | ||
294 | } else if p.Type == "int" { | ||
295 | if (argN == 2) && ((funct == "readlen") || (funct == "writelen")) { | ||
296 | args = append(args, fmt.Sprintf("C.size_t(%s)", p.Name)) | ||
297 | } else if argN == 0 && funct == "fcntl" { | ||
298 | args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) | ||
299 | } else if (argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt")) { | ||
300 | args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) | ||
301 | } else { | ||
302 | args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) | ||
303 | } | ||
304 | } else if p.Type == "int32" { | ||
305 | args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) | ||
306 | } else if p.Type == "int64" { | ||
307 | args = append(args, fmt.Sprintf("C.longlong(%s)", p.Name)) | ||
308 | } else if p.Type == "uint32" { | ||
309 | args = append(args, fmt.Sprintf("C.uint(%s)", p.Name)) | ||
310 | } else if p.Type == "uint64" { | ||
311 | args = append(args, fmt.Sprintf("C.ulonglong(%s)", p.Name)) | ||
312 | } else if p.Type == "uintptr" { | ||
313 | args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) | ||
314 | } else { | ||
315 | args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) | ||
316 | } | ||
317 | argN++ | ||
318 | } | ||
319 | |||
320 | // Actual call. | ||
321 | arglist := strings.Join(args, ", ") | ||
322 | call := "" | ||
323 | if sysname == "exit" { | ||
324 | if errvar != "" { | ||
325 | call += "er :=" | ||
326 | } else { | ||
327 | call += "" | ||
328 | } | ||
329 | } else if errvar != "" { | ||
330 | call += "r0,er :=" | ||
331 | } else if retvar != "" { | ||
332 | call += "r0,_ :=" | ||
333 | } else { | ||
334 | call += "" | ||
335 | } | ||
336 | if sysname == "select" { | ||
337 | // select is a keyword of Go. Its name is | ||
338 | // changed to c_select. | ||
339 | call += fmt.Sprintf("C.c_%s(%s)", sysname, arglist) | ||
340 | } else { | ||
341 | call += fmt.Sprintf("C.%s(%s)", sysname, arglist) | ||
342 | } | ||
343 | |||
344 | // Assign return values. | ||
345 | body := "" | ||
346 | for i := 0; i < len(out); i++ { | ||
347 | p := parseParam(out[i]) | ||
348 | reg := "" | ||
349 | if p.Name == "err" { | ||
350 | reg = "e1" | ||
351 | } else { | ||
352 | reg = "r0" | ||
353 | } | ||
354 | if reg != "e1" { | ||
355 | body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) | ||
356 | } | ||
357 | } | ||
358 | |||
359 | // verify return | ||
360 | if sysname != "exit" && errvar != "" { | ||
361 | if regexp.MustCompile(`^uintptr`).FindStringSubmatch(cRettype) != nil { | ||
362 | body += "\tif (uintptr(r0) ==^uintptr(0) && er != nil) {\n" | ||
363 | body += fmt.Sprintf("\t\t%s = er\n", errvar) | ||
364 | body += "\t}\n" | ||
365 | } else { | ||
366 | body += "\tif (r0 ==-1 && er != nil) {\n" | ||
367 | body += fmt.Sprintf("\t\t%s = er\n", errvar) | ||
368 | body += "\t}\n" | ||
369 | } | ||
370 | } else if errvar != "" { | ||
371 | body += "\tif (er != nil) {\n" | ||
372 | body += fmt.Sprintf("\t\t%s = er\n", errvar) | ||
373 | body += "\t}\n" | ||
374 | } | ||
375 | |||
376 | text += fmt.Sprintf("\t%s\n", call) | ||
377 | text += body | ||
378 | |||
379 | text += "\treturn\n" | ||
380 | text += "}\n" | ||
381 | } | ||
382 | if err := s.Err(); err != nil { | ||
383 | fmt.Fprintf(os.Stderr, err.Error()) | ||
384 | os.Exit(1) | ||
385 | } | ||
386 | file.Close() | ||
387 | } | ||
388 | imp := "" | ||
389 | if pack != "unix" { | ||
390 | imp = "import \"golang.org/x/sys/unix\"\n" | ||
391 | |||
392 | } | ||
393 | fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, cExtern, imp, text) | ||
394 | } | ||
395 | |||
396 | const srcTemplate = `// %s | ||
397 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
398 | |||
399 | // +build %s | ||
400 | |||
401 | package %s | ||
402 | |||
403 | |||
404 | %s | ||
405 | */ | ||
406 | import "C" | ||
407 | import ( | ||
408 | "unsafe" | ||
409 | ) | ||
410 | |||
411 | |||
412 | %s | ||
413 | |||
414 | %s | ||
415 | ` | ||
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go deleted file mode 100644 index c960099..0000000 --- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go +++ /dev/null | |||
@@ -1,614 +0,0 @@ | |||
1 | // Copyright 2019 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | This program reads a file containing function prototypes | ||
9 | (like syscall_aix.go) and generates system call bodies. | ||
10 | The prototypes are marked by lines beginning with "//sys" | ||
11 | and read like func declarations if //sys is replaced by func, but: | ||
12 | * The parameter lists must give a name for each argument. | ||
13 | This includes return parameters. | ||
14 | * The parameter lists must give a type for each argument: | ||
15 | the (x, y, z int) shorthand is not allowed. | ||
16 | * If the return parameter is an error number, it must be named err. | ||
17 | * If go func name needs to be different than its libc name, | ||
18 | * or the function is not in libc, name could be specified | ||
19 | * at the end, after "=" sign, like | ||
20 | //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt | ||
21 | |||
22 | |||
23 | This program will generate three files and handle both gc and gccgo implementation: | ||
24 | - zsyscall_aix_ppc64.go: the common part of each implementation (error handler, pointer creation) | ||
25 | - zsyscall_aix_ppc64_gc.go: gc part with //go_cgo_import_dynamic and a call to syscall6 | ||
26 | - zsyscall_aix_ppc64_gccgo.go: gccgo part with C function and conversion to C type. | ||
27 | |||
28 | The generated code looks like this | ||
29 | |||
30 | zsyscall_aix_ppc64.go | ||
31 | func asyscall(...) (n int, err error) { | ||
32 | // Pointer Creation | ||
33 | r1, e1 := callasyscall(...) | ||
34 | // Type Conversion | ||
35 | // Error Handler | ||
36 | return | ||
37 | } | ||
38 | |||
39 | zsyscall_aix_ppc64_gc.go | ||
40 | //go:cgo_import_dynamic libc_asyscall asyscall "libc.a/shr_64.o" | ||
41 | //go:linkname libc_asyscall libc_asyscall | ||
42 | var asyscall syscallFunc | ||
43 | |||
44 | func callasyscall(...) (r1 uintptr, e1 Errno) { | ||
45 | r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_asyscall)), "nb_args", ... ) | ||
46 | return | ||
47 | } | ||
48 | |||
49 | zsyscall_aix_ppc64_ggcgo.go | ||
50 | |||
51 | // int asyscall(...) | ||
52 | |||
53 | import "C" | ||
54 | |||
55 | func callasyscall(...) (r1 uintptr, e1 Errno) { | ||
56 | r1 = uintptr(C.asyscall(...)) | ||
57 | e1 = syscall.GetErrno() | ||
58 | return | ||
59 | } | ||
60 | */ | ||
61 | |||
62 | package main | ||
63 | |||
64 | import ( | ||
65 | "bufio" | ||
66 | "flag" | ||
67 | "fmt" | ||
68 | "io/ioutil" | ||
69 | "os" | ||
70 | "regexp" | ||
71 | "strings" | ||
72 | ) | ||
73 | |||
74 | var ( | ||
75 | b32 = flag.Bool("b32", false, "32bit big-endian") | ||
76 | l32 = flag.Bool("l32", false, "32bit little-endian") | ||
77 | aix = flag.Bool("aix", false, "aix") | ||
78 | tags = flag.String("tags", "", "build tags") | ||
79 | ) | ||
80 | |||
81 | // cmdLine returns this programs's commandline arguments | ||
82 | func cmdLine() string { | ||
83 | return "go run mksyscall_aix_ppc64.go " + strings.Join(os.Args[1:], " ") | ||
84 | } | ||
85 | |||
86 | // buildTags returns build tags | ||
87 | func buildTags() string { | ||
88 | return *tags | ||
89 | } | ||
90 | |||
91 | // Param is function parameter | ||
92 | type Param struct { | ||
93 | Name string | ||
94 | Type string | ||
95 | } | ||
96 | |||
97 | // usage prints the program usage | ||
98 | func usage() { | ||
99 | fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc64.go [-b32 | -l32] [-tags x,y] [file ...]\n") | ||
100 | os.Exit(1) | ||
101 | } | ||
102 | |||
103 | // parseParamList parses parameter list and returns a slice of parameters | ||
104 | func parseParamList(list string) []string { | ||
105 | list = strings.TrimSpace(list) | ||
106 | if list == "" { | ||
107 | return []string{} | ||
108 | } | ||
109 | return regexp.MustCompile(`\s*,\s*`).Split(list, -1) | ||
110 | } | ||
111 | |||
112 | // parseParam splits a parameter into name and type | ||
113 | func parseParam(p string) Param { | ||
114 | ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) | ||
115 | if ps == nil { | ||
116 | fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) | ||
117 | os.Exit(1) | ||
118 | } | ||
119 | return Param{ps[1], ps[2]} | ||
120 | } | ||
121 | |||
122 | func main() { | ||
123 | flag.Usage = usage | ||
124 | flag.Parse() | ||
125 | if len(flag.Args()) <= 0 { | ||
126 | fmt.Fprintf(os.Stderr, "no files to parse provided\n") | ||
127 | usage() | ||
128 | } | ||
129 | |||
130 | endianness := "" | ||
131 | if *b32 { | ||
132 | endianness = "big-endian" | ||
133 | } else if *l32 { | ||
134 | endianness = "little-endian" | ||
135 | } | ||
136 | |||
137 | pack := "" | ||
138 | // GCCGO | ||
139 | textgccgo := "" | ||
140 | cExtern := "/*\n#include <stdint.h>\n" | ||
141 | // GC | ||
142 | textgc := "" | ||
143 | dynimports := "" | ||
144 | linknames := "" | ||
145 | var vars []string | ||
146 | // COMMON | ||
147 | textcommon := "" | ||
148 | for _, path := range flag.Args() { | ||
149 | file, err := os.Open(path) | ||
150 | if err != nil { | ||
151 | fmt.Fprintf(os.Stderr, err.Error()) | ||
152 | os.Exit(1) | ||
153 | } | ||
154 | s := bufio.NewScanner(file) | ||
155 | for s.Scan() { | ||
156 | t := s.Text() | ||
157 | t = strings.TrimSpace(t) | ||
158 | t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) | ||
159 | if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { | ||
160 | pack = p[1] | ||
161 | } | ||
162 | nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) | ||
163 | if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { | ||
164 | continue | ||
165 | } | ||
166 | |||
167 | // Line must be of the form | ||
168 | // func Open(path string, mode int, perm int) (fd int, err error) | ||
169 | // Split into name, in params, out params. | ||
170 | f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) | ||
171 | if f == nil { | ||
172 | fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) | ||
173 | os.Exit(1) | ||
174 | } | ||
175 | funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] | ||
176 | |||
177 | // Split argument lists on comma. | ||
178 | in := parseParamList(inps) | ||
179 | out := parseParamList(outps) | ||
180 | |||
181 | inps = strings.Join(in, ", ") | ||
182 | outps = strings.Join(out, ", ") | ||
183 | |||
184 | if sysname == "" { | ||
185 | sysname = funct | ||
186 | } | ||
187 | |||
188 | onlyCommon := false | ||
189 | if funct == "readlen" || funct == "writelen" || funct == "FcntlInt" || funct == "FcntlFlock" { | ||
190 | // This function call another syscall which is already implemented. | ||
191 | // Therefore, the gc and gccgo part must not be generated. | ||
192 | onlyCommon = true | ||
193 | } | ||
194 | |||
195 | // Try in vain to keep people from editing this file. | ||
196 | // The theory is that they jump into the middle of the file | ||
197 | // without reading the header. | ||
198 | |||
199 | textcommon += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" | ||
200 | if !onlyCommon { | ||
201 | textgccgo += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" | ||
202 | textgc += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" | ||
203 | } | ||
204 | |||
205 | // Check if value return, err return available | ||
206 | errvar := "" | ||
207 | rettype := "" | ||
208 | for _, param := range out { | ||
209 | p := parseParam(param) | ||
210 | if p.Type == "error" { | ||
211 | errvar = p.Name | ||
212 | } else { | ||
213 | rettype = p.Type | ||
214 | } | ||
215 | } | ||
216 | |||
217 | sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) | ||
218 | sysname = strings.ToLower(sysname) // All libc functions are lowercase. | ||
219 | |||
220 | // GCCGO Prototype return type | ||
221 | cRettype := "" | ||
222 | if rettype == "unsafe.Pointer" { | ||
223 | cRettype = "uintptr_t" | ||
224 | } else if rettype == "uintptr" { | ||
225 | cRettype = "uintptr_t" | ||
226 | } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil { | ||
227 | cRettype = "uintptr_t" | ||
228 | } else if rettype == "int" { | ||
229 | cRettype = "int" | ||
230 | } else if rettype == "int32" { | ||
231 | cRettype = "int" | ||
232 | } else if rettype == "int64" { | ||
233 | cRettype = "long long" | ||
234 | } else if rettype == "uint32" { | ||
235 | cRettype = "unsigned int" | ||
236 | } else if rettype == "uint64" { | ||
237 | cRettype = "unsigned long long" | ||
238 | } else { | ||
239 | cRettype = "int" | ||
240 | } | ||
241 | if sysname == "exit" { | ||
242 | cRettype = "void" | ||
243 | } | ||
244 | |||
245 | // GCCGO Prototype arguments type | ||
246 | var cIn []string | ||
247 | for i, param := range in { | ||
248 | p := parseParam(param) | ||
249 | if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { | ||
250 | cIn = append(cIn, "uintptr_t") | ||
251 | } else if p.Type == "string" { | ||
252 | cIn = append(cIn, "uintptr_t") | ||
253 | } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { | ||
254 | cIn = append(cIn, "uintptr_t", "size_t") | ||
255 | } else if p.Type == "unsafe.Pointer" { | ||
256 | cIn = append(cIn, "uintptr_t") | ||
257 | } else if p.Type == "uintptr" { | ||
258 | cIn = append(cIn, "uintptr_t") | ||
259 | } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { | ||
260 | cIn = append(cIn, "uintptr_t") | ||
261 | } else if p.Type == "int" { | ||
262 | if (i == 0 || i == 2) && funct == "fcntl" { | ||
263 | // These fcntl arguments needs to be uintptr to be able to call FcntlInt and FcntlFlock | ||
264 | cIn = append(cIn, "uintptr_t") | ||
265 | } else { | ||
266 | cIn = append(cIn, "int") | ||
267 | } | ||
268 | |||
269 | } else if p.Type == "int32" { | ||
270 | cIn = append(cIn, "int") | ||
271 | } else if p.Type == "int64" { | ||
272 | cIn = append(cIn, "long long") | ||
273 | } else if p.Type == "uint32" { | ||
274 | cIn = append(cIn, "unsigned int") | ||
275 | } else if p.Type == "uint64" { | ||
276 | cIn = append(cIn, "unsigned long long") | ||
277 | } else { | ||
278 | cIn = append(cIn, "int") | ||
279 | } | ||
280 | } | ||
281 | |||
282 | if !onlyCommon { | ||
283 | // GCCGO Prototype Generation | ||
284 | // Imports of system calls from libc | ||
285 | if sysname == "select" { | ||
286 | // select is a keyword of Go. Its name is | ||
287 | // changed to c_select. | ||
288 | cExtern += "#define c_select select\n" | ||
289 | } | ||
290 | cExtern += fmt.Sprintf("%s %s", cRettype, sysname) | ||
291 | cIn := strings.Join(cIn, ", ") | ||
292 | cExtern += fmt.Sprintf("(%s);\n", cIn) | ||
293 | } | ||
294 | // GC Library name | ||
295 | if modname == "" { | ||
296 | modname = "libc.a/shr_64.o" | ||
297 | } else { | ||
298 | fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct) | ||
299 | os.Exit(1) | ||
300 | } | ||
301 | sysvarname := fmt.Sprintf("libc_%s", sysname) | ||
302 | |||
303 | if !onlyCommon { | ||
304 | // GC Runtime import of function to allow cross-platform builds. | ||
305 | dynimports += fmt.Sprintf("//go:cgo_import_dynamic %s %s \"%s\"\n", sysvarname, sysname, modname) | ||
306 | // GC Link symbol to proc address variable. | ||
307 | linknames += fmt.Sprintf("//go:linkname %s %s\n", sysvarname, sysvarname) | ||
308 | // GC Library proc address variable. | ||
309 | vars = append(vars, sysvarname) | ||
310 | } | ||
311 | |||
312 | strconvfunc := "BytePtrFromString" | ||
313 | strconvtype := "*byte" | ||
314 | |||
315 | // Go function header. | ||
316 | if outps != "" { | ||
317 | outps = fmt.Sprintf(" (%s)", outps) | ||
318 | } | ||
319 | if textcommon != "" { | ||
320 | textcommon += "\n" | ||
321 | } | ||
322 | |||
323 | textcommon += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps) | ||
324 | |||
325 | // Prepare arguments tocall. | ||
326 | var argscommon []string // Arguments in the common part | ||
327 | var argscall []string // Arguments for call prototype | ||
328 | var argsgc []string // Arguments for gc call (with syscall6) | ||
329 | var argsgccgo []string // Arguments for gccgo call (with C.name_of_syscall) | ||
330 | n := 0 | ||
331 | argN := 0 | ||
332 | for _, param := range in { | ||
333 | p := parseParam(param) | ||
334 | if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { | ||
335 | argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(%s))", p.Name)) | ||
336 | argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) | ||
337 | argsgc = append(argsgc, p.Name) | ||
338 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) | ||
339 | } else if p.Type == "string" && errvar != "" { | ||
340 | textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) | ||
341 | textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) | ||
342 | textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) | ||
343 | |||
344 | argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) | ||
345 | argscall = append(argscall, fmt.Sprintf("_p%d uintptr ", n)) | ||
346 | argsgc = append(argsgc, fmt.Sprintf("_p%d", n)) | ||
347 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n)) | ||
348 | n++ | ||
349 | } else if p.Type == "string" { | ||
350 | fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") | ||
351 | textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) | ||
352 | textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) | ||
353 | textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) | ||
354 | |||
355 | argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) | ||
356 | argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n)) | ||
357 | argsgc = append(argsgc, fmt.Sprintf("_p%d", n)) | ||
358 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n)) | ||
359 | n++ | ||
360 | } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil { | ||
361 | // Convert slice into pointer, length. | ||
362 | // Have to be careful not to take address of &a[0] if len == 0: | ||
363 | // pass nil in that case. | ||
364 | textcommon += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1]) | ||
365 | textcommon += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) | ||
366 | argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("len(%s)", p.Name)) | ||
367 | argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n), fmt.Sprintf("_lenp%d int", n)) | ||
368 | argsgc = append(argsgc, fmt.Sprintf("_p%d", n), fmt.Sprintf("uintptr(_lenp%d)", n)) | ||
369 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n), fmt.Sprintf("C.size_t(_lenp%d)", n)) | ||
370 | n++ | ||
371 | } else if p.Type == "int64" && endianness != "" { | ||
372 | fmt.Fprintf(os.Stderr, path+":"+funct+" uses int64 with 32 bits mode. Case not yet implemented\n") | ||
373 | } else if p.Type == "bool" { | ||
374 | fmt.Fprintf(os.Stderr, path+":"+funct+" uses bool. Case not yet implemented\n") | ||
375 | } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil || p.Type == "unsafe.Pointer" { | ||
376 | argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
377 | argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) | ||
378 | argsgc = append(argsgc, p.Name) | ||
379 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) | ||
380 | } else if p.Type == "int" { | ||
381 | if (argN == 0 || argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt") || (funct == "FcntlFlock")) { | ||
382 | // These fcntl arguments need to be uintptr to be able to call FcntlInt and FcntlFlock | ||
383 | argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
384 | argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) | ||
385 | argsgc = append(argsgc, p.Name) | ||
386 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) | ||
387 | |||
388 | } else { | ||
389 | argscommon = append(argscommon, p.Name) | ||
390 | argscall = append(argscall, fmt.Sprintf("%s int", p.Name)) | ||
391 | argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
392 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) | ||
393 | } | ||
394 | } else if p.Type == "int32" { | ||
395 | argscommon = append(argscommon, p.Name) | ||
396 | argscall = append(argscall, fmt.Sprintf("%s int32", p.Name)) | ||
397 | argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
398 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) | ||
399 | } else if p.Type == "int64" { | ||
400 | argscommon = append(argscommon, p.Name) | ||
401 | argscall = append(argscall, fmt.Sprintf("%s int64", p.Name)) | ||
402 | argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
403 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.longlong(%s)", p.Name)) | ||
404 | } else if p.Type == "uint32" { | ||
405 | argscommon = append(argscommon, p.Name) | ||
406 | argscall = append(argscall, fmt.Sprintf("%s uint32", p.Name)) | ||
407 | argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
408 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.uint(%s)", p.Name)) | ||
409 | } else if p.Type == "uint64" { | ||
410 | argscommon = append(argscommon, p.Name) | ||
411 | argscall = append(argscall, fmt.Sprintf("%s uint64", p.Name)) | ||
412 | argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
413 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.ulonglong(%s)", p.Name)) | ||
414 | } else if p.Type == "uintptr" { | ||
415 | argscommon = append(argscommon, p.Name) | ||
416 | argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) | ||
417 | argsgc = append(argsgc, p.Name) | ||
418 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) | ||
419 | } else { | ||
420 | argscommon = append(argscommon, fmt.Sprintf("int(%s)", p.Name)) | ||
421 | argscall = append(argscall, fmt.Sprintf("%s int", p.Name)) | ||
422 | argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
423 | argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) | ||
424 | } | ||
425 | argN++ | ||
426 | } | ||
427 | nargs := len(argsgc) | ||
428 | |||
429 | // COMMON function generation | ||
430 | argscommonlist := strings.Join(argscommon, ", ") | ||
431 | callcommon := fmt.Sprintf("call%s(%s)", sysname, argscommonlist) | ||
432 | ret := []string{"_", "_"} | ||
433 | body := "" | ||
434 | doErrno := false | ||
435 | for i := 0; i < len(out); i++ { | ||
436 | p := parseParam(out[i]) | ||
437 | reg := "" | ||
438 | if p.Name == "err" { | ||
439 | reg = "e1" | ||
440 | ret[1] = reg | ||
441 | doErrno = true | ||
442 | } else { | ||
443 | reg = "r0" | ||
444 | ret[0] = reg | ||
445 | } | ||
446 | if p.Type == "bool" { | ||
447 | reg = fmt.Sprintf("%s != 0", reg) | ||
448 | } | ||
449 | if reg != "e1" { | ||
450 | body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) | ||
451 | } | ||
452 | } | ||
453 | if ret[0] == "_" && ret[1] == "_" { | ||
454 | textcommon += fmt.Sprintf("\t%s\n", callcommon) | ||
455 | } else { | ||
456 | textcommon += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], callcommon) | ||
457 | } | ||
458 | textcommon += body | ||
459 | |||
460 | if doErrno { | ||
461 | textcommon += "\tif e1 != 0 {\n" | ||
462 | textcommon += "\t\terr = errnoErr(e1)\n" | ||
463 | textcommon += "\t}\n" | ||
464 | } | ||
465 | textcommon += "\treturn\n" | ||
466 | textcommon += "}\n" | ||
467 | |||
468 | if onlyCommon { | ||
469 | continue | ||
470 | } | ||
471 | |||
472 | // CALL Prototype | ||
473 | callProto := fmt.Sprintf("func call%s(%s) (r1 uintptr, e1 Errno) {\n", sysname, strings.Join(argscall, ", ")) | ||
474 | |||
475 | // GC function generation | ||
476 | asm := "syscall6" | ||
477 | if nonblock != nil { | ||
478 | asm = "rawSyscall6" | ||
479 | } | ||
480 | |||
481 | if len(argsgc) <= 6 { | ||
482 | for len(argsgc) < 6 { | ||
483 | argsgc = append(argsgc, "0") | ||
484 | } | ||
485 | } else { | ||
486 | fmt.Fprintf(os.Stderr, "%s: too many arguments to system call", funct) | ||
487 | os.Exit(1) | ||
488 | } | ||
489 | argsgclist := strings.Join(argsgc, ", ") | ||
490 | callgc := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, argsgclist) | ||
491 | |||
492 | textgc += callProto | ||
493 | textgc += fmt.Sprintf("\tr1, _, e1 = %s\n", callgc) | ||
494 | textgc += "\treturn\n}\n" | ||
495 | |||
496 | // GCCGO function generation | ||
497 | argsgccgolist := strings.Join(argsgccgo, ", ") | ||
498 | var callgccgo string | ||
499 | if sysname == "select" { | ||
500 | // select is a keyword of Go. Its name is | ||
501 | // changed to c_select. | ||
502 | callgccgo = fmt.Sprintf("C.c_%s(%s)", sysname, argsgccgolist) | ||
503 | } else { | ||
504 | callgccgo = fmt.Sprintf("C.%s(%s)", sysname, argsgccgolist) | ||
505 | } | ||
506 | textgccgo += callProto | ||
507 | textgccgo += fmt.Sprintf("\tr1 = uintptr(%s)\n", callgccgo) | ||
508 | textgccgo += "\te1 = syscall.GetErrno()\n" | ||
509 | textgccgo += "\treturn\n}\n" | ||
510 | } | ||
511 | if err := s.Err(); err != nil { | ||
512 | fmt.Fprintf(os.Stderr, err.Error()) | ||
513 | os.Exit(1) | ||
514 | } | ||
515 | file.Close() | ||
516 | } | ||
517 | imp := "" | ||
518 | if pack != "unix" { | ||
519 | imp = "import \"golang.org/x/sys/unix\"\n" | ||
520 | |||
521 | } | ||
522 | |||
523 | // Print zsyscall_aix_ppc64.go | ||
524 | err := ioutil.WriteFile("zsyscall_aix_ppc64.go", | ||
525 | []byte(fmt.Sprintf(srcTemplate1, cmdLine(), buildTags(), pack, imp, textcommon)), | ||
526 | 0644) | ||
527 | if err != nil { | ||
528 | fmt.Fprintf(os.Stderr, err.Error()) | ||
529 | os.Exit(1) | ||
530 | } | ||
531 | |||
532 | // Print zsyscall_aix_ppc64_gc.go | ||
533 | vardecls := "\t" + strings.Join(vars, ",\n\t") | ||
534 | vardecls += " syscallFunc" | ||
535 | err = ioutil.WriteFile("zsyscall_aix_ppc64_gc.go", | ||
536 | []byte(fmt.Sprintf(srcTemplate2, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, textgc)), | ||
537 | 0644) | ||
538 | if err != nil { | ||
539 | fmt.Fprintf(os.Stderr, err.Error()) | ||
540 | os.Exit(1) | ||
541 | } | ||
542 | |||
543 | // Print zsyscall_aix_ppc64_gccgo.go | ||
544 | err = ioutil.WriteFile("zsyscall_aix_ppc64_gccgo.go", | ||
545 | []byte(fmt.Sprintf(srcTemplate3, cmdLine(), buildTags(), pack, cExtern, imp, textgccgo)), | ||
546 | 0644) | ||
547 | if err != nil { | ||
548 | fmt.Fprintf(os.Stderr, err.Error()) | ||
549 | os.Exit(1) | ||
550 | } | ||
551 | } | ||
552 | |||
553 | const srcTemplate1 = `// %s | ||
554 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
555 | |||
556 | // +build %s | ||
557 | |||
558 | package %s | ||
559 | |||
560 | import ( | ||
561 | "unsafe" | ||
562 | ) | ||
563 | |||
564 | |||
565 | %s | ||
566 | |||
567 | %s | ||
568 | ` | ||
569 | const srcTemplate2 = `// %s | ||
570 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
571 | |||
572 | // +build %s | ||
573 | // +build !gccgo | ||
574 | |||
575 | package %s | ||
576 | |||
577 | import ( | ||
578 | "unsafe" | ||
579 | ) | ||
580 | %s | ||
581 | %s | ||
582 | %s | ||
583 | type syscallFunc uintptr | ||
584 | |||
585 | var ( | ||
586 | %s | ||
587 | ) | ||
588 | |||
589 | // Implemented in runtime/syscall_aix.go. | ||
590 | func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) | ||
591 | func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) | ||
592 | |||
593 | %s | ||
594 | ` | ||
595 | const srcTemplate3 = `// %s | ||
596 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
597 | |||
598 | // +build %s | ||
599 | // +build gccgo | ||
600 | |||
601 | package %s | ||
602 | |||
603 | %s | ||
604 | */ | ||
605 | import "C" | ||
606 | import ( | ||
607 | "syscall" | ||
608 | ) | ||
609 | |||
610 | |||
611 | %s | ||
612 | |||
613 | %s | ||
614 | ` | ||
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go b/vendor/golang.org/x/sys/unix/mksyscall_solaris.go deleted file mode 100644 index 3d86473..0000000 --- a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go +++ /dev/null | |||
@@ -1,335 +0,0 @@ | |||
1 | // Copyright 2019 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | This program reads a file containing function prototypes | ||
9 | (like syscall_solaris.go) and generates system call bodies. | ||
10 | The prototypes are marked by lines beginning with "//sys" | ||
11 | and read like func declarations if //sys is replaced by func, but: | ||
12 | * The parameter lists must give a name for each argument. | ||
13 | This includes return parameters. | ||
14 | * The parameter lists must give a type for each argument: | ||
15 | the (x, y, z int) shorthand is not allowed. | ||
16 | * If the return parameter is an error number, it must be named err. | ||
17 | * If go func name needs to be different than its libc name, | ||
18 | * or the function is not in libc, name could be specified | ||
19 | * at the end, after "=" sign, like | ||
20 | //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt | ||
21 | */ | ||
22 | |||
23 | package main | ||
24 | |||
25 | import ( | ||
26 | "bufio" | ||
27 | "flag" | ||
28 | "fmt" | ||
29 | "os" | ||
30 | "regexp" | ||
31 | "strings" | ||
32 | ) | ||
33 | |||
34 | var ( | ||
35 | b32 = flag.Bool("b32", false, "32bit big-endian") | ||
36 | l32 = flag.Bool("l32", false, "32bit little-endian") | ||
37 | tags = flag.String("tags", "", "build tags") | ||
38 | ) | ||
39 | |||
40 | // cmdLine returns this programs's commandline arguments | ||
41 | func cmdLine() string { | ||
42 | return "go run mksyscall_solaris.go " + strings.Join(os.Args[1:], " ") | ||
43 | } | ||
44 | |||
45 | // buildTags returns build tags | ||
46 | func buildTags() string { | ||
47 | return *tags | ||
48 | } | ||
49 | |||
50 | // Param is function parameter | ||
51 | type Param struct { | ||
52 | Name string | ||
53 | Type string | ||
54 | } | ||
55 | |||
56 | // usage prints the program usage | ||
57 | func usage() { | ||
58 | fmt.Fprintf(os.Stderr, "usage: go run mksyscall_solaris.go [-b32 | -l32] [-tags x,y] [file ...]\n") | ||
59 | os.Exit(1) | ||
60 | } | ||
61 | |||
62 | // parseParamList parses parameter list and returns a slice of parameters | ||
63 | func parseParamList(list string) []string { | ||
64 | list = strings.TrimSpace(list) | ||
65 | if list == "" { | ||
66 | return []string{} | ||
67 | } | ||
68 | return regexp.MustCompile(`\s*,\s*`).Split(list, -1) | ||
69 | } | ||
70 | |||
71 | // parseParam splits a parameter into name and type | ||
72 | func parseParam(p string) Param { | ||
73 | ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) | ||
74 | if ps == nil { | ||
75 | fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) | ||
76 | os.Exit(1) | ||
77 | } | ||
78 | return Param{ps[1], ps[2]} | ||
79 | } | ||
80 | |||
81 | func main() { | ||
82 | flag.Usage = usage | ||
83 | flag.Parse() | ||
84 | if len(flag.Args()) <= 0 { | ||
85 | fmt.Fprintf(os.Stderr, "no files to parse provided\n") | ||
86 | usage() | ||
87 | } | ||
88 | |||
89 | endianness := "" | ||
90 | if *b32 { | ||
91 | endianness = "big-endian" | ||
92 | } else if *l32 { | ||
93 | endianness = "little-endian" | ||
94 | } | ||
95 | |||
96 | pack := "" | ||
97 | text := "" | ||
98 | dynimports := "" | ||
99 | linknames := "" | ||
100 | var vars []string | ||
101 | for _, path := range flag.Args() { | ||
102 | file, err := os.Open(path) | ||
103 | if err != nil { | ||
104 | fmt.Fprintf(os.Stderr, err.Error()) | ||
105 | os.Exit(1) | ||
106 | } | ||
107 | s := bufio.NewScanner(file) | ||
108 | for s.Scan() { | ||
109 | t := s.Text() | ||
110 | t = strings.TrimSpace(t) | ||
111 | t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) | ||
112 | if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { | ||
113 | pack = p[1] | ||
114 | } | ||
115 | nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) | ||
116 | if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { | ||
117 | continue | ||
118 | } | ||
119 | |||
120 | // Line must be of the form | ||
121 | // func Open(path string, mode int, perm int) (fd int, err error) | ||
122 | // Split into name, in params, out params. | ||
123 | f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) | ||
124 | if f == nil { | ||
125 | fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) | ||
126 | os.Exit(1) | ||
127 | } | ||
128 | funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] | ||
129 | |||
130 | // Split argument lists on comma. | ||
131 | in := parseParamList(inps) | ||
132 | out := parseParamList(outps) | ||
133 | |||
134 | inps = strings.Join(in, ", ") | ||
135 | outps = strings.Join(out, ", ") | ||
136 | |||
137 | // Try in vain to keep people from editing this file. | ||
138 | // The theory is that they jump into the middle of the file | ||
139 | // without reading the header. | ||
140 | text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" | ||
141 | |||
142 | // So file name. | ||
143 | if modname == "" { | ||
144 | modname = "libc" | ||
145 | } | ||
146 | |||
147 | // System call name. | ||
148 | if sysname == "" { | ||
149 | sysname = funct | ||
150 | } | ||
151 | |||
152 | // System call pointer variable name. | ||
153 | sysvarname := fmt.Sprintf("proc%s", sysname) | ||
154 | |||
155 | strconvfunc := "BytePtrFromString" | ||
156 | strconvtype := "*byte" | ||
157 | |||
158 | sysname = strings.ToLower(sysname) // All libc functions are lowercase. | ||
159 | |||
160 | // Runtime import of function to allow cross-platform builds. | ||
161 | dynimports += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"%s.so\"\n", sysname, sysname, modname) | ||
162 | // Link symbol to proc address variable. | ||
163 | linknames += fmt.Sprintf("//go:linkname %s libc_%s\n", sysvarname, sysname) | ||
164 | // Library proc address variable. | ||
165 | vars = append(vars, sysvarname) | ||
166 | |||
167 | // Go function header. | ||
168 | outlist := strings.Join(out, ", ") | ||
169 | if outlist != "" { | ||
170 | outlist = fmt.Sprintf(" (%s)", outlist) | ||
171 | } | ||
172 | if text != "" { | ||
173 | text += "\n" | ||
174 | } | ||
175 | text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outlist) | ||
176 | |||
177 | // Check if err return available | ||
178 | errvar := "" | ||
179 | for _, param := range out { | ||
180 | p := parseParam(param) | ||
181 | if p.Type == "error" { | ||
182 | errvar = p.Name | ||
183 | continue | ||
184 | } | ||
185 | } | ||
186 | |||
187 | // Prepare arguments to Syscall. | ||
188 | var args []string | ||
189 | n := 0 | ||
190 | for _, param := range in { | ||
191 | p := parseParam(param) | ||
192 | if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { | ||
193 | args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))") | ||
194 | } else if p.Type == "string" && errvar != "" { | ||
195 | text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) | ||
196 | text += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) | ||
197 | text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) | ||
198 | args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) | ||
199 | n++ | ||
200 | } else if p.Type == "string" { | ||
201 | fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") | ||
202 | text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) | ||
203 | text += fmt.Sprintf("\t_p%d, _ = %s(%s)\n", n, strconvfunc, p.Name) | ||
204 | args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) | ||
205 | n++ | ||
206 | } else if s := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); s != nil { | ||
207 | // Convert slice into pointer, length. | ||
208 | // Have to be careful not to take address of &a[0] if len == 0: | ||
209 | // pass nil in that case. | ||
210 | text += fmt.Sprintf("\tvar _p%d *%s\n", n, s[1]) | ||
211 | text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) | ||
212 | args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("uintptr(len(%s))", p.Name)) | ||
213 | n++ | ||
214 | } else if p.Type == "int64" && endianness != "" { | ||
215 | if endianness == "big-endian" { | ||
216 | args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) | ||
217 | } else { | ||
218 | args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) | ||
219 | } | ||
220 | } else if p.Type == "bool" { | ||
221 | text += fmt.Sprintf("\tvar _p%d uint32\n", n) | ||
222 | text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n) | ||
223 | args = append(args, fmt.Sprintf("uintptr(_p%d)", n)) | ||
224 | n++ | ||
225 | } else { | ||
226 | args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) | ||
227 | } | ||
228 | } | ||
229 | nargs := len(args) | ||
230 | |||
231 | // Determine which form to use; pad args with zeros. | ||
232 | asm := "sysvicall6" | ||
233 | if nonblock != nil { | ||
234 | asm = "rawSysvicall6" | ||
235 | } | ||
236 | if len(args) <= 6 { | ||
237 | for len(args) < 6 { | ||
238 | args = append(args, "0") | ||
239 | } | ||
240 | } else { | ||
241 | fmt.Fprintf(os.Stderr, "%s: too many arguments to system call\n", path) | ||
242 | os.Exit(1) | ||
243 | } | ||
244 | |||
245 | // Actual call. | ||
246 | arglist := strings.Join(args, ", ") | ||
247 | call := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, arglist) | ||
248 | |||
249 | // Assign return values. | ||
250 | body := "" | ||
251 | ret := []string{"_", "_", "_"} | ||
252 | doErrno := false | ||
253 | for i := 0; i < len(out); i++ { | ||
254 | p := parseParam(out[i]) | ||
255 | reg := "" | ||
256 | if p.Name == "err" { | ||
257 | reg = "e1" | ||
258 | ret[2] = reg | ||
259 | doErrno = true | ||
260 | } else { | ||
261 | reg = fmt.Sprintf("r%d", i) | ||
262 | ret[i] = reg | ||
263 | } | ||
264 | if p.Type == "bool" { | ||
265 | reg = fmt.Sprintf("%d != 0", reg) | ||
266 | } | ||
267 | if p.Type == "int64" && endianness != "" { | ||
268 | // 64-bit number in r1:r0 or r0:r1. | ||
269 | if i+2 > len(out) { | ||
270 | fmt.Fprintf(os.Stderr, "%s: not enough registers for int64 return\n", path) | ||
271 | os.Exit(1) | ||
272 | } | ||
273 | if endianness == "big-endian" { | ||
274 | reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1) | ||
275 | } else { | ||
276 | reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i) | ||
277 | } | ||
278 | ret[i] = fmt.Sprintf("r%d", i) | ||
279 | ret[i+1] = fmt.Sprintf("r%d", i+1) | ||
280 | } | ||
281 | if reg != "e1" { | ||
282 | body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) | ||
283 | } | ||
284 | } | ||
285 | if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" { | ||
286 | text += fmt.Sprintf("\t%s\n", call) | ||
287 | } else { | ||
288 | text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call) | ||
289 | } | ||
290 | text += body | ||
291 | |||
292 | if doErrno { | ||
293 | text += "\tif e1 != 0 {\n" | ||
294 | text += "\t\terr = e1\n" | ||
295 | text += "\t}\n" | ||
296 | } | ||
297 | text += "\treturn\n" | ||
298 | text += "}\n" | ||
299 | } | ||
300 | if err := s.Err(); err != nil { | ||
301 | fmt.Fprintf(os.Stderr, err.Error()) | ||
302 | os.Exit(1) | ||
303 | } | ||
304 | file.Close() | ||
305 | } | ||
306 | imp := "" | ||
307 | if pack != "unix" { | ||
308 | imp = "import \"golang.org/x/sys/unix\"\n" | ||
309 | |||
310 | } | ||
311 | vardecls := "\t" + strings.Join(vars, ",\n\t") | ||
312 | vardecls += " syscallFunc" | ||
313 | fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, text) | ||
314 | } | ||
315 | |||
316 | const srcTemplate = `// %s | ||
317 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
318 | |||
319 | // +build %s | ||
320 | |||
321 | package %s | ||
322 | |||
323 | import ( | ||
324 | "syscall" | ||
325 | "unsafe" | ||
326 | ) | ||
327 | %s | ||
328 | %s | ||
329 | %s | ||
330 | var ( | ||
331 | %s | ||
332 | ) | ||
333 | |||
334 | %s | ||
335 | ` | ||
diff --git a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go b/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go deleted file mode 100644 index b6b4099..0000000 --- a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go +++ /dev/null | |||
@@ -1,355 +0,0 @@ | |||
1 | // Copyright 2019 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // Parse the header files for OpenBSD and generate a Go usable sysctl MIB. | ||
8 | // | ||
9 | // Build a MIB with each entry being an array containing the level, type and | ||
10 | // a hash that will contain additional entries if the current entry is a node. | ||
11 | // We then walk this MIB and create a flattened sysctl name to OID hash. | ||
12 | |||
13 | package main | ||
14 | |||
15 | import ( | ||
16 | "bufio" | ||
17 | "fmt" | ||
18 | "os" | ||
19 | "path/filepath" | ||
20 | "regexp" | ||
21 | "sort" | ||
22 | "strings" | ||
23 | ) | ||
24 | |||
25 | var ( | ||
26 | goos, goarch string | ||
27 | ) | ||
28 | |||
29 | // cmdLine returns this programs's commandline arguments. | ||
30 | func cmdLine() string { | ||
31 | return "go run mksysctl_openbsd.go " + strings.Join(os.Args[1:], " ") | ||
32 | } | ||
33 | |||
34 | // buildTags returns build tags. | ||
35 | func buildTags() string { | ||
36 | return fmt.Sprintf("%s,%s", goarch, goos) | ||
37 | } | ||
38 | |||
39 | // reMatch performs regular expression match and stores the substring slice to value pointed by m. | ||
40 | func reMatch(re *regexp.Regexp, str string, m *[]string) bool { | ||
41 | *m = re.FindStringSubmatch(str) | ||
42 | if *m != nil { | ||
43 | return true | ||
44 | } | ||
45 | return false | ||
46 | } | ||
47 | |||
48 | type nodeElement struct { | ||
49 | n int | ||
50 | t string | ||
51 | pE *map[string]nodeElement | ||
52 | } | ||
53 | |||
54 | var ( | ||
55 | debugEnabled bool | ||
56 | mib map[string]nodeElement | ||
57 | node *map[string]nodeElement | ||
58 | nodeMap map[string]string | ||
59 | sysCtl []string | ||
60 | ) | ||
61 | |||
62 | var ( | ||
63 | ctlNames1RE = regexp.MustCompile(`^#define\s+(CTL_NAMES)\s+{`) | ||
64 | ctlNames2RE = regexp.MustCompile(`^#define\s+(CTL_(.*)_NAMES)\s+{`) | ||
65 | ctlNames3RE = regexp.MustCompile(`^#define\s+((.*)CTL_NAMES)\s+{`) | ||
66 | netInetRE = regexp.MustCompile(`^netinet/`) | ||
67 | netInet6RE = regexp.MustCompile(`^netinet6/`) | ||
68 | netRE = regexp.MustCompile(`^net/`) | ||
69 | bracesRE = regexp.MustCompile(`{.*}`) | ||
70 | ctlTypeRE = regexp.MustCompile(`{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}`) | ||
71 | fsNetKernRE = regexp.MustCompile(`^(fs|net|kern)_`) | ||
72 | ) | ||
73 | |||
74 | func debug(s string) { | ||
75 | if debugEnabled { | ||
76 | fmt.Fprintln(os.Stderr, s) | ||
77 | } | ||
78 | } | ||
79 | |||
80 | // Walk the MIB and build a sysctl name to OID mapping. | ||
81 | func buildSysctl(pNode *map[string]nodeElement, name string, oid []int) { | ||
82 | lNode := pNode // local copy of pointer to node | ||
83 | var keys []string | ||
84 | for k := range *lNode { | ||
85 | keys = append(keys, k) | ||
86 | } | ||
87 | sort.Strings(keys) | ||
88 | |||
89 | for _, key := range keys { | ||
90 | nodename := name | ||
91 | if name != "" { | ||
92 | nodename += "." | ||
93 | } | ||
94 | nodename += key | ||
95 | |||
96 | nodeoid := append(oid, (*pNode)[key].n) | ||
97 | |||
98 | if (*pNode)[key].t == `CTLTYPE_NODE` { | ||
99 | if _, ok := nodeMap[nodename]; ok { | ||
100 | lNode = &mib | ||
101 | ctlName := nodeMap[nodename] | ||
102 | for _, part := range strings.Split(ctlName, ".") { | ||
103 | lNode = ((*lNode)[part]).pE | ||
104 | } | ||
105 | } else { | ||
106 | lNode = (*pNode)[key].pE | ||
107 | } | ||
108 | buildSysctl(lNode, nodename, nodeoid) | ||
109 | } else if (*pNode)[key].t != "" { | ||
110 | oidStr := []string{} | ||
111 | for j := range nodeoid { | ||
112 | oidStr = append(oidStr, fmt.Sprintf("%d", nodeoid[j])) | ||
113 | } | ||
114 | text := "\t{ \"" + nodename + "\", []_C_int{ " + strings.Join(oidStr, ", ") + " } }, \n" | ||
115 | sysCtl = append(sysCtl, text) | ||
116 | } | ||
117 | } | ||
118 | } | ||
119 | |||
120 | func main() { | ||
121 | // Get the OS (using GOOS_TARGET if it exist) | ||
122 | goos = os.Getenv("GOOS_TARGET") | ||
123 | if goos == "" { | ||
124 | goos = os.Getenv("GOOS") | ||
125 | } | ||
126 | // Get the architecture (using GOARCH_TARGET if it exists) | ||
127 | goarch = os.Getenv("GOARCH_TARGET") | ||
128 | if goarch == "" { | ||
129 | goarch = os.Getenv("GOARCH") | ||
130 | } | ||
131 | // Check if GOOS and GOARCH environment variables are defined | ||
132 | if goarch == "" || goos == "" { | ||
133 | fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n") | ||
134 | os.Exit(1) | ||
135 | } | ||
136 | |||
137 | mib = make(map[string]nodeElement) | ||
138 | headers := [...]string{ | ||
139 | `sys/sysctl.h`, | ||
140 | `sys/socket.h`, | ||
141 | `sys/tty.h`, | ||
142 | `sys/malloc.h`, | ||
143 | `sys/mount.h`, | ||
144 | `sys/namei.h`, | ||
145 | `sys/sem.h`, | ||
146 | `sys/shm.h`, | ||
147 | `sys/vmmeter.h`, | ||
148 | `uvm/uvmexp.h`, | ||
149 | `uvm/uvm_param.h`, | ||
150 | `uvm/uvm_swap_encrypt.h`, | ||
151 | `ddb/db_var.h`, | ||
152 | `net/if.h`, | ||
153 | `net/if_pfsync.h`, | ||
154 | `net/pipex.h`, | ||
155 | `netinet/in.h`, | ||
156 | `netinet/icmp_var.h`, | ||
157 | `netinet/igmp_var.h`, | ||
158 | `netinet/ip_ah.h`, | ||
159 | `netinet/ip_carp.h`, | ||
160 | `netinet/ip_divert.h`, | ||
161 | `netinet/ip_esp.h`, | ||
162 | `netinet/ip_ether.h`, | ||
163 | `netinet/ip_gre.h`, | ||
164 | `netinet/ip_ipcomp.h`, | ||
165 | `netinet/ip_ipip.h`, | ||
166 | `netinet/pim_var.h`, | ||
167 | `netinet/tcp_var.h`, | ||
168 | `netinet/udp_var.h`, | ||
169 | `netinet6/in6.h`, | ||
170 | `netinet6/ip6_divert.h`, | ||
171 | `netinet6/pim6_var.h`, | ||
172 | `netinet/icmp6.h`, | ||
173 | `netmpls/mpls.h`, | ||
174 | } | ||
175 | |||
176 | ctls := [...]string{ | ||
177 | `kern`, | ||
178 | `vm`, | ||
179 | `fs`, | ||
180 | `net`, | ||
181 | //debug /* Special handling required */ | ||
182 | `hw`, | ||
183 | //machdep /* Arch specific */ | ||
184 | `user`, | ||
185 | `ddb`, | ||
186 | //vfs /* Special handling required */ | ||
187 | `fs.posix`, | ||
188 | `kern.forkstat`, | ||
189 | `kern.intrcnt`, | ||
190 | `kern.malloc`, | ||
191 | `kern.nchstats`, | ||
192 | `kern.seminfo`, | ||
193 | `kern.shminfo`, | ||
194 | `kern.timecounter`, | ||
195 | `kern.tty`, | ||
196 | `kern.watchdog`, | ||
197 | `net.bpf`, | ||
198 | `net.ifq`, | ||
199 | `net.inet`, | ||
200 | `net.inet.ah`, | ||
201 | `net.inet.carp`, | ||
202 | `net.inet.divert`, | ||
203 | `net.inet.esp`, | ||
204 | `net.inet.etherip`, | ||
205 | `net.inet.gre`, | ||
206 | `net.inet.icmp`, | ||
207 | `net.inet.igmp`, | ||
208 | `net.inet.ip`, | ||
209 | `net.inet.ip.ifq`, | ||
210 | `net.inet.ipcomp`, | ||
211 | `net.inet.ipip`, | ||
212 | `net.inet.mobileip`, | ||
213 | `net.inet.pfsync`, | ||
214 | `net.inet.pim`, | ||
215 | `net.inet.tcp`, | ||
216 | `net.inet.udp`, | ||
217 | `net.inet6`, | ||
218 | `net.inet6.divert`, | ||
219 | `net.inet6.ip6`, | ||
220 | `net.inet6.icmp6`, | ||
221 | `net.inet6.pim6`, | ||
222 | `net.inet6.tcp6`, | ||
223 | `net.inet6.udp6`, | ||
224 | `net.mpls`, | ||
225 | `net.mpls.ifq`, | ||
226 | `net.key`, | ||
227 | `net.pflow`, | ||
228 | `net.pfsync`, | ||
229 | `net.pipex`, | ||
230 | `net.rt`, | ||
231 | `vm.swapencrypt`, | ||
232 | //vfsgenctl /* Special handling required */ | ||
233 | } | ||
234 | |||
235 | // Node name "fixups" | ||
236 | ctlMap := map[string]string{ | ||
237 | "ipproto": "net.inet", | ||
238 | "net.inet.ipproto": "net.inet", | ||
239 | "net.inet6.ipv6proto": "net.inet6", | ||
240 | "net.inet6.ipv6": "net.inet6.ip6", | ||
241 | "net.inet.icmpv6": "net.inet6.icmp6", | ||
242 | "net.inet6.divert6": "net.inet6.divert", | ||
243 | "net.inet6.tcp6": "net.inet.tcp", | ||
244 | "net.inet6.udp6": "net.inet.udp", | ||
245 | "mpls": "net.mpls", | ||
246 | "swpenc": "vm.swapencrypt", | ||
247 | } | ||
248 | |||
249 | // Node mappings | ||
250 | nodeMap = map[string]string{ | ||
251 | "net.inet.ip.ifq": "net.ifq", | ||
252 | "net.inet.pfsync": "net.pfsync", | ||
253 | "net.mpls.ifq": "net.ifq", | ||
254 | } | ||
255 | |||
256 | mCtls := make(map[string]bool) | ||
257 | for _, ctl := range ctls { | ||
258 | mCtls[ctl] = true | ||
259 | } | ||
260 | |||
261 | for _, header := range headers { | ||
262 | debug("Processing " + header) | ||
263 | file, err := os.Open(filepath.Join("/usr/include", header)) | ||
264 | if err != nil { | ||
265 | fmt.Fprintf(os.Stderr, "%v\n", err) | ||
266 | os.Exit(1) | ||
267 | } | ||
268 | s := bufio.NewScanner(file) | ||
269 | for s.Scan() { | ||
270 | var sub []string | ||
271 | if reMatch(ctlNames1RE, s.Text(), &sub) || | ||
272 | reMatch(ctlNames2RE, s.Text(), &sub) || | ||
273 | reMatch(ctlNames3RE, s.Text(), &sub) { | ||
274 | if sub[1] == `CTL_NAMES` { | ||
275 | // Top level. | ||
276 | node = &mib | ||
277 | } else { | ||
278 | // Node. | ||
279 | nodename := strings.ToLower(sub[2]) | ||
280 | ctlName := "" | ||
281 | if reMatch(netInetRE, header, &sub) { | ||
282 | ctlName = "net.inet." + nodename | ||
283 | } else if reMatch(netInet6RE, header, &sub) { | ||
284 | ctlName = "net.inet6." + nodename | ||
285 | } else if reMatch(netRE, header, &sub) { | ||
286 | ctlName = "net." + nodename | ||
287 | } else { | ||
288 | ctlName = nodename | ||
289 | ctlName = fsNetKernRE.ReplaceAllString(ctlName, `$1.`) | ||
290 | } | ||
291 | |||
292 | if val, ok := ctlMap[ctlName]; ok { | ||
293 | ctlName = val | ||
294 | } | ||
295 | if _, ok := mCtls[ctlName]; !ok { | ||
296 | debug("Ignoring " + ctlName + "...") | ||
297 | continue | ||
298 | } | ||
299 | |||
300 | // Walk down from the top of the MIB. | ||
301 | node = &mib | ||
302 | for _, part := range strings.Split(ctlName, ".") { | ||
303 | if _, ok := (*node)[part]; !ok { | ||
304 | debug("Missing node " + part) | ||
305 | (*node)[part] = nodeElement{n: 0, t: "", pE: &map[string]nodeElement{}} | ||
306 | } | ||
307 | node = (*node)[part].pE | ||
308 | } | ||
309 | } | ||
310 | |||
311 | // Populate current node with entries. | ||
312 | i := -1 | ||
313 | for !strings.HasPrefix(s.Text(), "}") { | ||
314 | s.Scan() | ||
315 | if reMatch(bracesRE, s.Text(), &sub) { | ||
316 | i++ | ||
317 | } | ||
318 | if !reMatch(ctlTypeRE, s.Text(), &sub) { | ||
319 | continue | ||
320 | } | ||
321 | (*node)[sub[1]] = nodeElement{n: i, t: sub[2], pE: &map[string]nodeElement{}} | ||
322 | } | ||
323 | } | ||
324 | } | ||
325 | err = s.Err() | ||
326 | if err != nil { | ||
327 | fmt.Fprintf(os.Stderr, "%v\n", err) | ||
328 | os.Exit(1) | ||
329 | } | ||
330 | file.Close() | ||
331 | } | ||
332 | buildSysctl(&mib, "", []int{}) | ||
333 | |||
334 | sort.Strings(sysCtl) | ||
335 | text := strings.Join(sysCtl, "") | ||
336 | |||
337 | fmt.Printf(srcTemplate, cmdLine(), buildTags(), text) | ||
338 | } | ||
339 | |||
340 | const srcTemplate = `// %s | ||
341 | // Code generated by the command above; DO NOT EDIT. | ||
342 | |||
343 | // +build %s | ||
344 | |||
345 | package unix | ||
346 | |||
347 | type mibentry struct { | ||
348 | ctlname string | ||
349 | ctloid []_C_int | ||
350 | } | ||
351 | |||
352 | var sysctlMib = []mibentry { | ||
353 | %s | ||
354 | } | ||
355 | ` | ||
diff --git a/vendor/golang.org/x/sys/unix/mksysnum.go b/vendor/golang.org/x/sys/unix/mksysnum.go deleted file mode 100644 index baa6ecd..0000000 --- a/vendor/golang.org/x/sys/unix/mksysnum.go +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | // Copyright 2018 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | // Generate system call table for DragonFly, NetBSD, | ||
8 | // FreeBSD, OpenBSD or Darwin from master list | ||
9 | // (for example, /usr/src/sys/kern/syscalls.master or | ||
10 | // sys/syscall.h). | ||
11 | package main | ||
12 | |||
13 | import ( | ||
14 | "bufio" | ||
15 | "fmt" | ||
16 | "io" | ||
17 | "io/ioutil" | ||
18 | "net/http" | ||
19 | "os" | ||
20 | "regexp" | ||
21 | "strings" | ||
22 | ) | ||
23 | |||
24 | var ( | ||
25 | goos, goarch string | ||
26 | ) | ||
27 | |||
28 | // cmdLine returns this programs's commandline arguments | ||
29 | func cmdLine() string { | ||
30 | return "go run mksysnum.go " + strings.Join(os.Args[1:], " ") | ||
31 | } | ||
32 | |||
33 | // buildTags returns build tags | ||
34 | func buildTags() string { | ||
35 | return fmt.Sprintf("%s,%s", goarch, goos) | ||
36 | } | ||
37 | |||
38 | func checkErr(err error) { | ||
39 | if err != nil { | ||
40 | fmt.Fprintf(os.Stderr, "%v\n", err) | ||
41 | os.Exit(1) | ||
42 | } | ||
43 | } | ||
44 | |||
45 | // source string and substring slice for regexp | ||
46 | type re struct { | ||
47 | str string // source string | ||
48 | sub []string // matched sub-string | ||
49 | } | ||
50 | |||
51 | // Match performs regular expression match | ||
52 | func (r *re) Match(exp string) bool { | ||
53 | r.sub = regexp.MustCompile(exp).FindStringSubmatch(r.str) | ||
54 | if r.sub != nil { | ||
55 | return true | ||
56 | } | ||
57 | return false | ||
58 | } | ||
59 | |||
60 | // fetchFile fetches a text file from URL | ||
61 | func fetchFile(URL string) io.Reader { | ||
62 | resp, err := http.Get(URL) | ||
63 | checkErr(err) | ||
64 | defer resp.Body.Close() | ||
65 | body, err := ioutil.ReadAll(resp.Body) | ||
66 | checkErr(err) | ||
67 | return strings.NewReader(string(body)) | ||
68 | } | ||
69 | |||
70 | // readFile reads a text file from path | ||
71 | func readFile(path string) io.Reader { | ||
72 | file, err := os.Open(os.Args[1]) | ||
73 | checkErr(err) | ||
74 | return file | ||
75 | } | ||
76 | |||
77 | func format(name, num, proto string) string { | ||
78 | name = strings.ToUpper(name) | ||
79 | // There are multiple entries for enosys and nosys, so comment them out. | ||
80 | nm := re{str: name} | ||
81 | if nm.Match(`^SYS_E?NOSYS$`) { | ||
82 | name = fmt.Sprintf("// %s", name) | ||
83 | } | ||
84 | if name == `SYS_SYS_EXIT` { | ||
85 | name = `SYS_EXIT` | ||
86 | } | ||
87 | return fmt.Sprintf(" %s = %s; // %s\n", name, num, proto) | ||
88 | } | ||
89 | |||
90 | func main() { | ||
91 | // Get the OS (using GOOS_TARGET if it exist) | ||
92 | goos = os.Getenv("GOOS_TARGET") | ||
93 | if goos == "" { | ||
94 | goos = os.Getenv("GOOS") | ||
95 | } | ||
96 | // Get the architecture (using GOARCH_TARGET if it exists) | ||
97 | goarch = os.Getenv("GOARCH_TARGET") | ||
98 | if goarch == "" { | ||
99 | goarch = os.Getenv("GOARCH") | ||
100 | } | ||
101 | // Check if GOOS and GOARCH environment variables are defined | ||
102 | if goarch == "" || goos == "" { | ||
103 | fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n") | ||
104 | os.Exit(1) | ||
105 | } | ||
106 | |||
107 | file := strings.TrimSpace(os.Args[1]) | ||
108 | var syscalls io.Reader | ||
109 | if strings.HasPrefix(file, "https://") || strings.HasPrefix(file, "http://") { | ||
110 | // Download syscalls.master file | ||
111 | syscalls = fetchFile(file) | ||
112 | } else { | ||
113 | syscalls = readFile(file) | ||
114 | } | ||
115 | |||
116 | var text, line string | ||
117 | s := bufio.NewScanner(syscalls) | ||
118 | for s.Scan() { | ||
119 | t := re{str: line} | ||
120 | if t.Match(`^(.*)\\$`) { | ||
121 | // Handle continuation | ||
122 | line = t.sub[1] | ||
123 | line += strings.TrimLeft(s.Text(), " \t") | ||
124 | } else { | ||
125 | // New line | ||
126 | line = s.Text() | ||
127 | } | ||
128 | t = re{str: line} | ||
129 | if t.Match(`\\$`) { | ||
130 | continue | ||
131 | } | ||
132 | t = re{str: line} | ||
133 | |||
134 | switch goos { | ||
135 | case "dragonfly": | ||
136 | if t.Match(`^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$`) { | ||
137 | num, proto := t.sub[1], t.sub[2] | ||
138 | name := fmt.Sprintf("SYS_%s", t.sub[3]) | ||
139 | text += format(name, num, proto) | ||
140 | } | ||
141 | case "freebsd": | ||
142 | if t.Match(`^([0-9]+)\s+\S+\s+(?:(?:NO)?STD|COMPAT10)\s+({ \S+\s+(\w+).*)$`) { | ||
143 | num, proto := t.sub[1], t.sub[2] | ||
144 | name := fmt.Sprintf("SYS_%s", t.sub[3]) | ||
145 | text += format(name, num, proto) | ||
146 | } | ||
147 | case "openbsd": | ||
148 | if t.Match(`^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$`) { | ||
149 | num, proto, name := t.sub[1], t.sub[3], t.sub[4] | ||
150 | text += format(name, num, proto) | ||
151 | } | ||
152 | case "netbsd": | ||
153 | if t.Match(`^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$`) { | ||
154 | num, proto, compat := t.sub[1], t.sub[6], t.sub[8] | ||
155 | name := t.sub[7] + "_" + t.sub[9] | ||
156 | if t.sub[11] != "" { | ||
157 | name = t.sub[7] + "_" + t.sub[11] | ||
158 | } | ||
159 | name = strings.ToUpper(name) | ||
160 | if compat == "" || compat == "13" || compat == "30" || compat == "50" { | ||
161 | text += fmt.Sprintf(" %s = %s; // %s\n", name, num, proto) | ||
162 | } | ||
163 | } | ||
164 | case "darwin": | ||
165 | if t.Match(`^#define\s+SYS_(\w+)\s+([0-9]+)`) { | ||
166 | name, num := t.sub[1], t.sub[2] | ||
167 | name = strings.ToUpper(name) | ||
168 | text += fmt.Sprintf(" SYS_%s = %s;\n", name, num) | ||
169 | } | ||
170 | default: | ||
171 | fmt.Fprintf(os.Stderr, "unrecognized GOOS=%s\n", goos) | ||
172 | os.Exit(1) | ||
173 | |||
174 | } | ||
175 | } | ||
176 | err := s.Err() | ||
177 | checkErr(err) | ||
178 | |||
179 | fmt.Printf(template, cmdLine(), buildTags(), text) | ||
180 | } | ||
181 | |||
182 | const template = `// %s | ||
183 | // Code generated by the command above; see README.md. DO NOT EDIT. | ||
184 | |||
185 | // +build %s | ||
186 | |||
187 | package unix | ||
188 | |||
189 | const( | ||
190 | %s)` | ||
diff --git a/vendor/golang.org/x/sys/unix/types_aix.go b/vendor/golang.org/x/sys/unix/types_aix.go deleted file mode 100644 index 40d2bee..0000000 --- a/vendor/golang.org/x/sys/unix/types_aix.go +++ /dev/null | |||
@@ -1,237 +0,0 @@ | |||
1 | // Copyright 2018 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | // +build aix | ||
7 | |||
8 | /* | ||
9 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh | ||
10 | */ | ||
11 | |||
12 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
13 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
14 | |||
15 | package unix | ||
16 | |||
17 | /* | ||
18 | #include <sys/types.h> | ||
19 | #include <sys/time.h> | ||
20 | #include <sys/limits.h> | ||
21 | #include <sys/un.h> | ||
22 | #include <utime.h> | ||
23 | #include <sys/utsname.h> | ||
24 | #include <sys/poll.h> | ||
25 | #include <sys/resource.h> | ||
26 | #include <sys/stat.h> | ||
27 | #include <sys/statfs.h> | ||
28 | #include <sys/termio.h> | ||
29 | #include <sys/ioctl.h> | ||
30 | |||
31 | #include <termios.h> | ||
32 | |||
33 | #include <net/if.h> | ||
34 | #include <net/if_dl.h> | ||
35 | #include <netinet/in.h> | ||
36 | #include <netinet/icmp6.h> | ||
37 | |||
38 | |||
39 | #include <dirent.h> | ||
40 | #include <fcntl.h> | ||
41 | |||
42 | enum { | ||
43 | sizeofPtr = sizeof(void*), | ||
44 | }; | ||
45 | |||
46 | union sockaddr_all { | ||
47 | struct sockaddr s1; // this one gets used for fields | ||
48 | struct sockaddr_in s2; // these pad it out | ||
49 | struct sockaddr_in6 s3; | ||
50 | struct sockaddr_un s4; | ||
51 | struct sockaddr_dl s5; | ||
52 | }; | ||
53 | |||
54 | struct sockaddr_any { | ||
55 | struct sockaddr addr; | ||
56 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; | ||
57 | }; | ||
58 | |||
59 | */ | ||
60 | import "C" | ||
61 | |||
62 | // Machine characteristics | ||
63 | |||
64 | const ( | ||
65 | SizeofPtr = C.sizeofPtr | ||
66 | SizeofShort = C.sizeof_short | ||
67 | SizeofInt = C.sizeof_int | ||
68 | SizeofLong = C.sizeof_long | ||
69 | SizeofLongLong = C.sizeof_longlong | ||
70 | PathMax = C.PATH_MAX | ||
71 | ) | ||
72 | |||
73 | // Basic types | ||
74 | |||
75 | type ( | ||
76 | _C_short C.short | ||
77 | _C_int C.int | ||
78 | _C_long C.long | ||
79 | _C_long_long C.longlong | ||
80 | ) | ||
81 | |||
82 | type off64 C.off64_t | ||
83 | type off C.off_t | ||
84 | type Mode_t C.mode_t | ||
85 | |||
86 | // Time | ||
87 | |||
88 | type Timespec C.struct_timespec | ||
89 | |||
90 | type Timeval C.struct_timeval | ||
91 | |||
92 | type Timeval32 C.struct_timeval32 | ||
93 | |||
94 | type Timex C.struct_timex | ||
95 | |||
96 | type Time_t C.time_t | ||
97 | |||
98 | type Tms C.struct_tms | ||
99 | |||
100 | type Utimbuf C.struct_utimbuf | ||
101 | |||
102 | type Timezone C.struct_timezone | ||
103 | |||
104 | // Processes | ||
105 | |||
106 | type Rusage C.struct_rusage | ||
107 | |||
108 | type Rlimit C.struct_rlimit64 | ||
109 | |||
110 | type Pid_t C.pid_t | ||
111 | |||
112 | type _Gid_t C.gid_t | ||
113 | |||
114 | type dev_t C.dev_t | ||
115 | |||
116 | // Files | ||
117 | |||
118 | type Stat_t C.struct_stat | ||
119 | |||
120 | type StatxTimestamp C.struct_statx_timestamp | ||
121 | |||
122 | type Statx_t C.struct_statx | ||
123 | |||
124 | type Dirent C.struct_dirent | ||
125 | |||
126 | // Sockets | ||
127 | |||
128 | type RawSockaddrInet4 C.struct_sockaddr_in | ||
129 | |||
130 | type RawSockaddrInet6 C.struct_sockaddr_in6 | ||
131 | |||
132 | type RawSockaddrUnix C.struct_sockaddr_un | ||
133 | |||
134 | type RawSockaddrDatalink C.struct_sockaddr_dl | ||
135 | |||
136 | type RawSockaddr C.struct_sockaddr | ||
137 | |||
138 | type RawSockaddrAny C.struct_sockaddr_any | ||
139 | |||
140 | type _Socklen C.socklen_t | ||
141 | |||
142 | type Cmsghdr C.struct_cmsghdr | ||
143 | |||
144 | type ICMPv6Filter C.struct_icmp6_filter | ||
145 | |||
146 | type Iovec C.struct_iovec | ||
147 | |||
148 | type IPMreq C.struct_ip_mreq | ||
149 | |||
150 | type IPv6Mreq C.struct_ipv6_mreq | ||
151 | |||
152 | type IPv6MTUInfo C.struct_ip6_mtuinfo | ||
153 | |||
154 | type Linger C.struct_linger | ||
155 | |||
156 | type Msghdr C.struct_msghdr | ||
157 | |||
158 | const ( | ||
159 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in | ||
160 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
161 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any | ||
162 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un | ||
163 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl | ||
164 | SizeofLinger = C.sizeof_struct_linger | ||
165 | SizeofIPMreq = C.sizeof_struct_ip_mreq | ||
166 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq | ||
167 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo | ||
168 | SizeofMsghdr = C.sizeof_struct_msghdr | ||
169 | SizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
170 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter | ||
171 | ) | ||
172 | |||
173 | // Routing and interface messages | ||
174 | |||
175 | const ( | ||
176 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr | ||
177 | ) | ||
178 | |||
179 | type IfMsgHdr C.struct_if_msghdr | ||
180 | |||
181 | // Misc | ||
182 | |||
183 | type FdSet C.fd_set | ||
184 | |||
185 | type Utsname C.struct_utsname | ||
186 | |||
187 | type Ustat_t C.struct_ustat | ||
188 | |||
189 | type Sigset_t C.sigset_t | ||
190 | |||
191 | const ( | ||
192 | AT_FDCWD = C.AT_FDCWD | ||
193 | AT_REMOVEDIR = C.AT_REMOVEDIR | ||
194 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW | ||
195 | ) | ||
196 | |||
197 | // Terminal handling | ||
198 | |||
199 | type Termios C.struct_termios | ||
200 | |||
201 | type Termio C.struct_termio | ||
202 | |||
203 | type Winsize C.struct_winsize | ||
204 | |||
205 | //poll | ||
206 | |||
207 | type PollFd struct { | ||
208 | Fd int32 | ||
209 | Events uint16 | ||
210 | Revents uint16 | ||
211 | } | ||
212 | |||
213 | const ( | ||
214 | POLLERR = C.POLLERR | ||
215 | POLLHUP = C.POLLHUP | ||
216 | POLLIN = C.POLLIN | ||
217 | POLLNVAL = C.POLLNVAL | ||
218 | POLLOUT = C.POLLOUT | ||
219 | POLLPRI = C.POLLPRI | ||
220 | POLLRDBAND = C.POLLRDBAND | ||
221 | POLLRDNORM = C.POLLRDNORM | ||
222 | POLLWRBAND = C.POLLWRBAND | ||
223 | POLLWRNORM = C.POLLWRNORM | ||
224 | ) | ||
225 | |||
226 | //flock_t | ||
227 | |||
228 | type Flock_t C.struct_flock64 | ||
229 | |||
230 | // Statfs | ||
231 | |||
232 | type Fsid_t C.struct_fsid_t | ||
233 | type Fsid64_t C.struct_fsid64_t | ||
234 | |||
235 | type Statfs_t C.struct_statfs | ||
236 | |||
237 | const RNDGETENTCNT = 0x80045200 | ||
diff --git a/vendor/golang.org/x/sys/unix/types_darwin.go b/vendor/golang.org/x/sys/unix/types_darwin.go deleted file mode 100644 index 155c2e6..0000000 --- a/vendor/golang.org/x/sys/unix/types_darwin.go +++ /dev/null | |||
@@ -1,283 +0,0 @@ | |||
1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | Input to cgo -godefs. See README.md | ||
9 | */ | ||
10 | |||
11 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
13 | |||
14 | package unix | ||
15 | |||
16 | /* | ||
17 | #define __DARWIN_UNIX03 0 | ||
18 | #define KERNEL | ||
19 | #define _DARWIN_USE_64_BIT_INODE | ||
20 | #include <dirent.h> | ||
21 | #include <fcntl.h> | ||
22 | #include <poll.h> | ||
23 | #include <signal.h> | ||
24 | #include <termios.h> | ||
25 | #include <unistd.h> | ||
26 | #include <mach/mach.h> | ||
27 | #include <mach/message.h> | ||
28 | #include <sys/event.h> | ||
29 | #include <sys/mman.h> | ||
30 | #include <sys/mount.h> | ||
31 | #include <sys/param.h> | ||
32 | #include <sys/ptrace.h> | ||
33 | #include <sys/resource.h> | ||
34 | #include <sys/select.h> | ||
35 | #include <sys/signal.h> | ||
36 | #include <sys/socket.h> | ||
37 | #include <sys/stat.h> | ||
38 | #include <sys/time.h> | ||
39 | #include <sys/types.h> | ||
40 | #include <sys/uio.h> | ||
41 | #include <sys/un.h> | ||
42 | #include <sys/utsname.h> | ||
43 | #include <sys/wait.h> | ||
44 | #include <net/bpf.h> | ||
45 | #include <net/if.h> | ||
46 | #include <net/if_dl.h> | ||
47 | #include <net/if_var.h> | ||
48 | #include <net/route.h> | ||
49 | #include <netinet/in.h> | ||
50 | #include <netinet/icmp6.h> | ||
51 | #include <netinet/tcp.h> | ||
52 | |||
53 | enum { | ||
54 | sizeofPtr = sizeof(void*), | ||
55 | }; | ||
56 | |||
57 | union sockaddr_all { | ||
58 | struct sockaddr s1; // this one gets used for fields | ||
59 | struct sockaddr_in s2; // these pad it out | ||
60 | struct sockaddr_in6 s3; | ||
61 | struct sockaddr_un s4; | ||
62 | struct sockaddr_dl s5; | ||
63 | }; | ||
64 | |||
65 | struct sockaddr_any { | ||
66 | struct sockaddr addr; | ||
67 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; | ||
68 | }; | ||
69 | |||
70 | */ | ||
71 | import "C" | ||
72 | |||
73 | // Machine characteristics | ||
74 | |||
75 | const ( | ||
76 | SizeofPtr = C.sizeofPtr | ||
77 | SizeofShort = C.sizeof_short | ||
78 | SizeofInt = C.sizeof_int | ||
79 | SizeofLong = C.sizeof_long | ||
80 | SizeofLongLong = C.sizeof_longlong | ||
81 | ) | ||
82 | |||
83 | // Basic types | ||
84 | |||
85 | type ( | ||
86 | _C_short C.short | ||
87 | _C_int C.int | ||
88 | _C_long C.long | ||
89 | _C_long_long C.longlong | ||
90 | ) | ||
91 | |||
92 | // Time | ||
93 | |||
94 | type Timespec C.struct_timespec | ||
95 | |||
96 | type Timeval C.struct_timeval | ||
97 | |||
98 | type Timeval32 C.struct_timeval32 | ||
99 | |||
100 | // Processes | ||
101 | |||
102 | type Rusage C.struct_rusage | ||
103 | |||
104 | type Rlimit C.struct_rlimit | ||
105 | |||
106 | type _Gid_t C.gid_t | ||
107 | |||
108 | // Files | ||
109 | |||
110 | type Stat_t C.struct_stat64 | ||
111 | |||
112 | type Statfs_t C.struct_statfs64 | ||
113 | |||
114 | type Flock_t C.struct_flock | ||
115 | |||
116 | type Fstore_t C.struct_fstore | ||
117 | |||
118 | type Radvisory_t C.struct_radvisory | ||
119 | |||
120 | type Fbootstraptransfer_t C.struct_fbootstraptransfer | ||
121 | |||
122 | type Log2phys_t C.struct_log2phys | ||
123 | |||
124 | type Fsid C.struct_fsid | ||
125 | |||
126 | type Dirent C.struct_dirent | ||
127 | |||
128 | // Sockets | ||
129 | |||
130 | type RawSockaddrInet4 C.struct_sockaddr_in | ||
131 | |||
132 | type RawSockaddrInet6 C.struct_sockaddr_in6 | ||
133 | |||
134 | type RawSockaddrUnix C.struct_sockaddr_un | ||
135 | |||
136 | type RawSockaddrDatalink C.struct_sockaddr_dl | ||
137 | |||
138 | type RawSockaddr C.struct_sockaddr | ||
139 | |||
140 | type RawSockaddrAny C.struct_sockaddr_any | ||
141 | |||
142 | type _Socklen C.socklen_t | ||
143 | |||
144 | type Linger C.struct_linger | ||
145 | |||
146 | type Iovec C.struct_iovec | ||
147 | |||
148 | type IPMreq C.struct_ip_mreq | ||
149 | |||
150 | type IPv6Mreq C.struct_ipv6_mreq | ||
151 | |||
152 | type Msghdr C.struct_msghdr | ||
153 | |||
154 | type Cmsghdr C.struct_cmsghdr | ||
155 | |||
156 | type Inet4Pktinfo C.struct_in_pktinfo | ||
157 | |||
158 | type Inet6Pktinfo C.struct_in6_pktinfo | ||
159 | |||
160 | type IPv6MTUInfo C.struct_ip6_mtuinfo | ||
161 | |||
162 | type ICMPv6Filter C.struct_icmp6_filter | ||
163 | |||
164 | const ( | ||
165 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in | ||
166 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
167 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any | ||
168 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un | ||
169 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl | ||
170 | SizeofLinger = C.sizeof_struct_linger | ||
171 | SizeofIPMreq = C.sizeof_struct_ip_mreq | ||
172 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq | ||
173 | SizeofMsghdr = C.sizeof_struct_msghdr | ||
174 | SizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
175 | SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo | ||
176 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo | ||
177 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo | ||
178 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter | ||
179 | ) | ||
180 | |||
181 | // Ptrace requests | ||
182 | |||
183 | const ( | ||
184 | PTRACE_TRACEME = C.PT_TRACE_ME | ||
185 | PTRACE_CONT = C.PT_CONTINUE | ||
186 | PTRACE_KILL = C.PT_KILL | ||
187 | ) | ||
188 | |||
189 | // Events (kqueue, kevent) | ||
190 | |||
191 | type Kevent_t C.struct_kevent | ||
192 | |||
193 | // Select | ||
194 | |||
195 | type FdSet C.fd_set | ||
196 | |||
197 | // Routing and interface messages | ||
198 | |||
199 | const ( | ||
200 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr | ||
201 | SizeofIfData = C.sizeof_struct_if_data | ||
202 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr | ||
203 | SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr | ||
204 | SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2 | ||
205 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr | ||
206 | SizeofRtMetrics = C.sizeof_struct_rt_metrics | ||
207 | ) | ||
208 | |||
209 | type IfMsghdr C.struct_if_msghdr | ||
210 | |||
211 | type IfData C.struct_if_data | ||
212 | |||
213 | type IfaMsghdr C.struct_ifa_msghdr | ||
214 | |||
215 | type IfmaMsghdr C.struct_ifma_msghdr | ||
216 | |||
217 | type IfmaMsghdr2 C.struct_ifma_msghdr2 | ||
218 | |||
219 | type RtMsghdr C.struct_rt_msghdr | ||
220 | |||
221 | type RtMetrics C.struct_rt_metrics | ||
222 | |||
223 | // Berkeley packet filter | ||
224 | |||
225 | const ( | ||
226 | SizeofBpfVersion = C.sizeof_struct_bpf_version | ||
227 | SizeofBpfStat = C.sizeof_struct_bpf_stat | ||
228 | SizeofBpfProgram = C.sizeof_struct_bpf_program | ||
229 | SizeofBpfInsn = C.sizeof_struct_bpf_insn | ||
230 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr | ||
231 | ) | ||
232 | |||
233 | type BpfVersion C.struct_bpf_version | ||
234 | |||
235 | type BpfStat C.struct_bpf_stat | ||
236 | |||
237 | type BpfProgram C.struct_bpf_program | ||
238 | |||
239 | type BpfInsn C.struct_bpf_insn | ||
240 | |||
241 | type BpfHdr C.struct_bpf_hdr | ||
242 | |||
243 | // Terminal handling | ||
244 | |||
245 | type Termios C.struct_termios | ||
246 | |||
247 | type Winsize C.struct_winsize | ||
248 | |||
249 | // fchmodat-like syscalls. | ||
250 | |||
251 | const ( | ||
252 | AT_FDCWD = C.AT_FDCWD | ||
253 | AT_REMOVEDIR = C.AT_REMOVEDIR | ||
254 | AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW | ||
255 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW | ||
256 | ) | ||
257 | |||
258 | // poll | ||
259 | |||
260 | type PollFd C.struct_pollfd | ||
261 | |||
262 | const ( | ||
263 | POLLERR = C.POLLERR | ||
264 | POLLHUP = C.POLLHUP | ||
265 | POLLIN = C.POLLIN | ||
266 | POLLNVAL = C.POLLNVAL | ||
267 | POLLOUT = C.POLLOUT | ||
268 | POLLPRI = C.POLLPRI | ||
269 | POLLRDBAND = C.POLLRDBAND | ||
270 | POLLRDNORM = C.POLLRDNORM | ||
271 | POLLWRBAND = C.POLLWRBAND | ||
272 | POLLWRNORM = C.POLLWRNORM | ||
273 | ) | ||
274 | |||
275 | // uname | ||
276 | |||
277 | type Utsname C.struct_utsname | ||
278 | |||
279 | // Clockinfo | ||
280 | |||
281 | const SizeofClockinfo = C.sizeof_struct_clockinfo | ||
282 | |||
283 | type Clockinfo C.struct_clockinfo | ||
diff --git a/vendor/golang.org/x/sys/unix/types_dragonfly.go b/vendor/golang.org/x/sys/unix/types_dragonfly.go deleted file mode 100644 index 3365dd7..0000000 --- a/vendor/golang.org/x/sys/unix/types_dragonfly.go +++ /dev/null | |||
@@ -1,263 +0,0 @@ | |||
1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | Input to cgo -godefs. See README.md | ||
9 | */ | ||
10 | |||
11 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
13 | |||
14 | package unix | ||
15 | |||
16 | /* | ||
17 | #define KERNEL | ||
18 | #include <dirent.h> | ||
19 | #include <fcntl.h> | ||
20 | #include <poll.h> | ||
21 | #include <signal.h> | ||
22 | #include <termios.h> | ||
23 | #include <stdio.h> | ||
24 | #include <unistd.h> | ||
25 | #include <sys/event.h> | ||
26 | #include <sys/mman.h> | ||
27 | #include <sys/mount.h> | ||
28 | #include <sys/param.h> | ||
29 | #include <sys/ptrace.h> | ||
30 | #include <sys/resource.h> | ||
31 | #include <sys/select.h> | ||
32 | #include <sys/signal.h> | ||
33 | #include <sys/socket.h> | ||
34 | #include <sys/stat.h> | ||
35 | #include <sys/time.h> | ||
36 | #include <sys/types.h> | ||
37 | #include <sys/un.h> | ||
38 | #include <sys/utsname.h> | ||
39 | #include <sys/wait.h> | ||
40 | #include <net/bpf.h> | ||
41 | #include <net/if.h> | ||
42 | #include <net/if_dl.h> | ||
43 | #include <net/route.h> | ||
44 | #include <netinet/in.h> | ||
45 | #include <netinet/icmp6.h> | ||
46 | #include <netinet/tcp.h> | ||
47 | |||
48 | enum { | ||
49 | sizeofPtr = sizeof(void*), | ||
50 | }; | ||
51 | |||
52 | union sockaddr_all { | ||
53 | struct sockaddr s1; // this one gets used for fields | ||
54 | struct sockaddr_in s2; // these pad it out | ||
55 | struct sockaddr_in6 s3; | ||
56 | struct sockaddr_un s4; | ||
57 | struct sockaddr_dl s5; | ||
58 | }; | ||
59 | |||
60 | struct sockaddr_any { | ||
61 | struct sockaddr addr; | ||
62 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; | ||
63 | }; | ||
64 | |||
65 | */ | ||
66 | import "C" | ||
67 | |||
68 | // Machine characteristics | ||
69 | |||
70 | const ( | ||
71 | SizeofPtr = C.sizeofPtr | ||
72 | SizeofShort = C.sizeof_short | ||
73 | SizeofInt = C.sizeof_int | ||
74 | SizeofLong = C.sizeof_long | ||
75 | SizeofLongLong = C.sizeof_longlong | ||
76 | ) | ||
77 | |||
78 | // Basic types | ||
79 | |||
80 | type ( | ||
81 | _C_short C.short | ||
82 | _C_int C.int | ||
83 | _C_long C.long | ||
84 | _C_long_long C.longlong | ||
85 | ) | ||
86 | |||
87 | // Time | ||
88 | |||
89 | type Timespec C.struct_timespec | ||
90 | |||
91 | type Timeval C.struct_timeval | ||
92 | |||
93 | // Processes | ||
94 | |||
95 | type Rusage C.struct_rusage | ||
96 | |||
97 | type Rlimit C.struct_rlimit | ||
98 | |||
99 | type _Gid_t C.gid_t | ||
100 | |||
101 | // Files | ||
102 | |||
103 | type Stat_t C.struct_stat | ||
104 | |||
105 | type Statfs_t C.struct_statfs | ||
106 | |||
107 | type Flock_t C.struct_flock | ||
108 | |||
109 | type Dirent C.struct_dirent | ||
110 | |||
111 | type Fsid C.struct_fsid | ||
112 | |||
113 | // File system limits | ||
114 | |||
115 | const ( | ||
116 | PathMax = C.PATH_MAX | ||
117 | ) | ||
118 | |||
119 | // Sockets | ||
120 | |||
121 | type RawSockaddrInet4 C.struct_sockaddr_in | ||
122 | |||
123 | type RawSockaddrInet6 C.struct_sockaddr_in6 | ||
124 | |||
125 | type RawSockaddrUnix C.struct_sockaddr_un | ||
126 | |||
127 | type RawSockaddrDatalink C.struct_sockaddr_dl | ||
128 | |||
129 | type RawSockaddr C.struct_sockaddr | ||
130 | |||
131 | type RawSockaddrAny C.struct_sockaddr_any | ||
132 | |||
133 | type _Socklen C.socklen_t | ||
134 | |||
135 | type Linger C.struct_linger | ||
136 | |||
137 | type Iovec C.struct_iovec | ||
138 | |||
139 | type IPMreq C.struct_ip_mreq | ||
140 | |||
141 | type IPv6Mreq C.struct_ipv6_mreq | ||
142 | |||
143 | type Msghdr C.struct_msghdr | ||
144 | |||
145 | type Cmsghdr C.struct_cmsghdr | ||
146 | |||
147 | type Inet6Pktinfo C.struct_in6_pktinfo | ||
148 | |||
149 | type IPv6MTUInfo C.struct_ip6_mtuinfo | ||
150 | |||
151 | type ICMPv6Filter C.struct_icmp6_filter | ||
152 | |||
153 | const ( | ||
154 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in | ||
155 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
156 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any | ||
157 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un | ||
158 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl | ||
159 | SizeofLinger = C.sizeof_struct_linger | ||
160 | SizeofIPMreq = C.sizeof_struct_ip_mreq | ||
161 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq | ||
162 | SizeofMsghdr = C.sizeof_struct_msghdr | ||
163 | SizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
164 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo | ||
165 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo | ||
166 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter | ||
167 | ) | ||
168 | |||
169 | // Ptrace requests | ||
170 | |||
171 | const ( | ||
172 | PTRACE_TRACEME = C.PT_TRACE_ME | ||
173 | PTRACE_CONT = C.PT_CONTINUE | ||
174 | PTRACE_KILL = C.PT_KILL | ||
175 | ) | ||
176 | |||
177 | // Events (kqueue, kevent) | ||
178 | |||
179 | type Kevent_t C.struct_kevent | ||
180 | |||
181 | // Select | ||
182 | |||
183 | type FdSet C.fd_set | ||
184 | |||
185 | // Routing and interface messages | ||
186 | |||
187 | const ( | ||
188 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr | ||
189 | SizeofIfData = C.sizeof_struct_if_data | ||
190 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr | ||
191 | SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr | ||
192 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr | ||
193 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr | ||
194 | SizeofRtMetrics = C.sizeof_struct_rt_metrics | ||
195 | ) | ||
196 | |||
197 | type IfMsghdr C.struct_if_msghdr | ||
198 | |||
199 | type IfData C.struct_if_data | ||
200 | |||
201 | type IfaMsghdr C.struct_ifa_msghdr | ||
202 | |||
203 | type IfmaMsghdr C.struct_ifma_msghdr | ||
204 | |||
205 | type IfAnnounceMsghdr C.struct_if_announcemsghdr | ||
206 | |||
207 | type RtMsghdr C.struct_rt_msghdr | ||
208 | |||
209 | type RtMetrics C.struct_rt_metrics | ||
210 | |||
211 | // Berkeley packet filter | ||
212 | |||
213 | const ( | ||
214 | SizeofBpfVersion = C.sizeof_struct_bpf_version | ||
215 | SizeofBpfStat = C.sizeof_struct_bpf_stat | ||
216 | SizeofBpfProgram = C.sizeof_struct_bpf_program | ||
217 | SizeofBpfInsn = C.sizeof_struct_bpf_insn | ||
218 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr | ||
219 | ) | ||
220 | |||
221 | type BpfVersion C.struct_bpf_version | ||
222 | |||
223 | type BpfStat C.struct_bpf_stat | ||
224 | |||
225 | type BpfProgram C.struct_bpf_program | ||
226 | |||
227 | type BpfInsn C.struct_bpf_insn | ||
228 | |||
229 | type BpfHdr C.struct_bpf_hdr | ||
230 | |||
231 | // Terminal handling | ||
232 | |||
233 | type Termios C.struct_termios | ||
234 | |||
235 | type Winsize C.struct_winsize | ||
236 | |||
237 | // fchmodat-like syscalls. | ||
238 | |||
239 | const ( | ||
240 | AT_FDCWD = C.AT_FDCWD | ||
241 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW | ||
242 | ) | ||
243 | |||
244 | // poll | ||
245 | |||
246 | type PollFd C.struct_pollfd | ||
247 | |||
248 | const ( | ||
249 | POLLERR = C.POLLERR | ||
250 | POLLHUP = C.POLLHUP | ||
251 | POLLIN = C.POLLIN | ||
252 | POLLNVAL = C.POLLNVAL | ||
253 | POLLOUT = C.POLLOUT | ||
254 | POLLPRI = C.POLLPRI | ||
255 | POLLRDBAND = C.POLLRDBAND | ||
256 | POLLRDNORM = C.POLLRDNORM | ||
257 | POLLWRBAND = C.POLLWRBAND | ||
258 | POLLWRNORM = C.POLLWRNORM | ||
259 | ) | ||
260 | |||
261 | // Uname | ||
262 | |||
263 | type Utsname C.struct_utsname | ||
diff --git a/vendor/golang.org/x/sys/unix/types_freebsd.go b/vendor/golang.org/x/sys/unix/types_freebsd.go deleted file mode 100644 index a121dc3..0000000 --- a/vendor/golang.org/x/sys/unix/types_freebsd.go +++ /dev/null | |||
@@ -1,400 +0,0 @@ | |||
1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | Input to cgo -godefs. See README.md | ||
9 | */ | ||
10 | |||
11 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
13 | |||
14 | package unix | ||
15 | |||
16 | /* | ||
17 | #define _WANT_FREEBSD11_STAT 1 | ||
18 | #define _WANT_FREEBSD11_STATFS 1 | ||
19 | #define _WANT_FREEBSD11_DIRENT 1 | ||
20 | #define _WANT_FREEBSD11_KEVENT 1 | ||
21 | |||
22 | #include <dirent.h> | ||
23 | #include <fcntl.h> | ||
24 | #include <poll.h> | ||
25 | #include <signal.h> | ||
26 | #include <termios.h> | ||
27 | #include <stdio.h> | ||
28 | #include <unistd.h> | ||
29 | #include <sys/capsicum.h> | ||
30 | #include <sys/event.h> | ||
31 | #include <sys/mman.h> | ||
32 | #include <sys/mount.h> | ||
33 | #include <sys/param.h> | ||
34 | #include <sys/ptrace.h> | ||
35 | #include <sys/resource.h> | ||
36 | #include <sys/select.h> | ||
37 | #include <sys/signal.h> | ||
38 | #include <sys/socket.h> | ||
39 | #include <sys/stat.h> | ||
40 | #include <sys/time.h> | ||
41 | #include <sys/types.h> | ||
42 | #include <sys/un.h> | ||
43 | #include <sys/utsname.h> | ||
44 | #include <sys/wait.h> | ||
45 | #include <net/bpf.h> | ||
46 | #include <net/if.h> | ||
47 | #include <net/if_dl.h> | ||
48 | #include <net/route.h> | ||
49 | #include <netinet/in.h> | ||
50 | #include <netinet/icmp6.h> | ||
51 | #include <netinet/tcp.h> | ||
52 | |||
53 | enum { | ||
54 | sizeofPtr = sizeof(void*), | ||
55 | }; | ||
56 | |||
57 | union sockaddr_all { | ||
58 | struct sockaddr s1; // this one gets used for fields | ||
59 | struct sockaddr_in s2; // these pad it out | ||
60 | struct sockaddr_in6 s3; | ||
61 | struct sockaddr_un s4; | ||
62 | struct sockaddr_dl s5; | ||
63 | }; | ||
64 | |||
65 | struct sockaddr_any { | ||
66 | struct sockaddr addr; | ||
67 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; | ||
68 | }; | ||
69 | |||
70 | // This structure is a duplicate of if_data on FreeBSD 8-STABLE. | ||
71 | // See /usr/include/net/if.h. | ||
72 | struct if_data8 { | ||
73 | u_char ifi_type; | ||
74 | u_char ifi_physical; | ||
75 | u_char ifi_addrlen; | ||
76 | u_char ifi_hdrlen; | ||
77 | u_char ifi_link_state; | ||
78 | u_char ifi_spare_char1; | ||
79 | u_char ifi_spare_char2; | ||
80 | u_char ifi_datalen; | ||
81 | u_long ifi_mtu; | ||
82 | u_long ifi_metric; | ||
83 | u_long ifi_baudrate; | ||
84 | u_long ifi_ipackets; | ||
85 | u_long ifi_ierrors; | ||
86 | u_long ifi_opackets; | ||
87 | u_long ifi_oerrors; | ||
88 | u_long ifi_collisions; | ||
89 | u_long ifi_ibytes; | ||
90 | u_long ifi_obytes; | ||
91 | u_long ifi_imcasts; | ||
92 | u_long ifi_omcasts; | ||
93 | u_long ifi_iqdrops; | ||
94 | u_long ifi_noproto; | ||
95 | u_long ifi_hwassist; | ||
96 | // FIXME: these are now unions, so maybe need to change definitions? | ||
97 | #undef ifi_epoch | ||
98 | time_t ifi_epoch; | ||
99 | #undef ifi_lastchange | ||
100 | struct timeval ifi_lastchange; | ||
101 | }; | ||
102 | |||
103 | // This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE. | ||
104 | // See /usr/include/net/if.h. | ||
105 | struct if_msghdr8 { | ||
106 | u_short ifm_msglen; | ||
107 | u_char ifm_version; | ||
108 | u_char ifm_type; | ||
109 | int ifm_addrs; | ||
110 | int ifm_flags; | ||
111 | u_short ifm_index; | ||
112 | struct if_data8 ifm_data; | ||
113 | }; | ||
114 | */ | ||
115 | import "C" | ||
116 | |||
117 | // Machine characteristics | ||
118 | |||
119 | const ( | ||
120 | SizeofPtr = C.sizeofPtr | ||
121 | SizeofShort = C.sizeof_short | ||
122 | SizeofInt = C.sizeof_int | ||
123 | SizeofLong = C.sizeof_long | ||
124 | SizeofLongLong = C.sizeof_longlong | ||
125 | ) | ||
126 | |||
127 | // Basic types | ||
128 | |||
129 | type ( | ||
130 | _C_short C.short | ||
131 | _C_int C.int | ||
132 | _C_long C.long | ||
133 | _C_long_long C.longlong | ||
134 | ) | ||
135 | |||
136 | // Time | ||
137 | |||
138 | type Timespec C.struct_timespec | ||
139 | |||
140 | type Timeval C.struct_timeval | ||
141 | |||
142 | // Processes | ||
143 | |||
144 | type Rusage C.struct_rusage | ||
145 | |||
146 | type Rlimit C.struct_rlimit | ||
147 | |||
148 | type _Gid_t C.gid_t | ||
149 | |||
150 | // Files | ||
151 | |||
152 | const ( | ||
153 | _statfsVersion = C.STATFS_VERSION | ||
154 | _dirblksiz = C.DIRBLKSIZ | ||
155 | ) | ||
156 | |||
157 | type Stat_t C.struct_stat | ||
158 | |||
159 | type stat_freebsd11_t C.struct_freebsd11_stat | ||
160 | |||
161 | type Statfs_t C.struct_statfs | ||
162 | |||
163 | type statfs_freebsd11_t C.struct_freebsd11_statfs | ||
164 | |||
165 | type Flock_t C.struct_flock | ||
166 | |||
167 | type Dirent C.struct_dirent | ||
168 | |||
169 | type dirent_freebsd11 C.struct_freebsd11_dirent | ||
170 | |||
171 | type Fsid C.struct_fsid | ||
172 | |||
173 | // File system limits | ||
174 | |||
175 | const ( | ||
176 | PathMax = C.PATH_MAX | ||
177 | ) | ||
178 | |||
179 | // Advice to Fadvise | ||
180 | |||
181 | const ( | ||
182 | FADV_NORMAL = C.POSIX_FADV_NORMAL | ||
183 | FADV_RANDOM = C.POSIX_FADV_RANDOM | ||
184 | FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL | ||
185 | FADV_WILLNEED = C.POSIX_FADV_WILLNEED | ||
186 | FADV_DONTNEED = C.POSIX_FADV_DONTNEED | ||
187 | FADV_NOREUSE = C.POSIX_FADV_NOREUSE | ||
188 | ) | ||
189 | |||
190 | // Sockets | ||
191 | |||
192 | type RawSockaddrInet4 C.struct_sockaddr_in | ||
193 | |||
194 | type RawSockaddrInet6 C.struct_sockaddr_in6 | ||
195 | |||
196 | type RawSockaddrUnix C.struct_sockaddr_un | ||
197 | |||
198 | type RawSockaddrDatalink C.struct_sockaddr_dl | ||
199 | |||
200 | type RawSockaddr C.struct_sockaddr | ||
201 | |||
202 | type RawSockaddrAny C.struct_sockaddr_any | ||
203 | |||
204 | type _Socklen C.socklen_t | ||
205 | |||
206 | type Linger C.struct_linger | ||
207 | |||
208 | type Iovec C.struct_iovec | ||
209 | |||
210 | type IPMreq C.struct_ip_mreq | ||
211 | |||
212 | type IPMreqn C.struct_ip_mreqn | ||
213 | |||
214 | type IPv6Mreq C.struct_ipv6_mreq | ||
215 | |||
216 | type Msghdr C.struct_msghdr | ||
217 | |||
218 | type Cmsghdr C.struct_cmsghdr | ||
219 | |||
220 | type Inet6Pktinfo C.struct_in6_pktinfo | ||
221 | |||
222 | type IPv6MTUInfo C.struct_ip6_mtuinfo | ||
223 | |||
224 | type ICMPv6Filter C.struct_icmp6_filter | ||
225 | |||
226 | const ( | ||
227 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in | ||
228 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
229 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any | ||
230 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un | ||
231 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl | ||
232 | SizeofLinger = C.sizeof_struct_linger | ||
233 | SizeofIPMreq = C.sizeof_struct_ip_mreq | ||
234 | SizeofIPMreqn = C.sizeof_struct_ip_mreqn | ||
235 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq | ||
236 | SizeofMsghdr = C.sizeof_struct_msghdr | ||
237 | SizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
238 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo | ||
239 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo | ||
240 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter | ||
241 | ) | ||
242 | |||
243 | // Ptrace requests | ||
244 | |||
245 | const ( | ||
246 | PTRACE_ATTACH = C.PT_ATTACH | ||
247 | PTRACE_CONT = C.PT_CONTINUE | ||
248 | PTRACE_DETACH = C.PT_DETACH | ||
249 | PTRACE_GETFPREGS = C.PT_GETFPREGS | ||
250 | PTRACE_GETFSBASE = C.PT_GETFSBASE | ||
251 | PTRACE_GETLWPLIST = C.PT_GETLWPLIST | ||
252 | PTRACE_GETNUMLWPS = C.PT_GETNUMLWPS | ||
253 | PTRACE_GETREGS = C.PT_GETREGS | ||
254 | PTRACE_GETXSTATE = C.PT_GETXSTATE | ||
255 | PTRACE_IO = C.PT_IO | ||
256 | PTRACE_KILL = C.PT_KILL | ||
257 | PTRACE_LWPEVENTS = C.PT_LWP_EVENTS | ||
258 | PTRACE_LWPINFO = C.PT_LWPINFO | ||
259 | PTRACE_SETFPREGS = C.PT_SETFPREGS | ||
260 | PTRACE_SETREGS = C.PT_SETREGS | ||
261 | PTRACE_SINGLESTEP = C.PT_STEP | ||
262 | PTRACE_TRACEME = C.PT_TRACE_ME | ||
263 | ) | ||
264 | |||
265 | const ( | ||
266 | PIOD_READ_D = C.PIOD_READ_D | ||
267 | PIOD_WRITE_D = C.PIOD_WRITE_D | ||
268 | PIOD_READ_I = C.PIOD_READ_I | ||
269 | PIOD_WRITE_I = C.PIOD_WRITE_I | ||
270 | ) | ||
271 | |||
272 | const ( | ||
273 | PL_FLAG_BORN = C.PL_FLAG_BORN | ||
274 | PL_FLAG_EXITED = C.PL_FLAG_EXITED | ||
275 | PL_FLAG_SI = C.PL_FLAG_SI | ||
276 | ) | ||
277 | |||
278 | const ( | ||
279 | TRAP_BRKPT = C.TRAP_BRKPT | ||
280 | TRAP_TRACE = C.TRAP_TRACE | ||
281 | ) | ||
282 | |||
283 | type PtraceLwpInfoStruct C.struct_ptrace_lwpinfo | ||
284 | |||
285 | type __Siginfo C.struct___siginfo | ||
286 | |||
287 | type Sigset_t C.sigset_t | ||
288 | |||
289 | type Reg C.struct_reg | ||
290 | |||
291 | type FpReg C.struct_fpreg | ||
292 | |||
293 | type PtraceIoDesc C.struct_ptrace_io_desc | ||
294 | |||
295 | // Events (kqueue, kevent) | ||
296 | |||
297 | type Kevent_t C.struct_kevent_freebsd11 | ||
298 | |||
299 | // Select | ||
300 | |||
301 | type FdSet C.fd_set | ||
302 | |||
303 | // Routing and interface messages | ||
304 | |||
305 | const ( | ||
306 | sizeofIfMsghdr = C.sizeof_struct_if_msghdr | ||
307 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr8 | ||
308 | sizeofIfData = C.sizeof_struct_if_data | ||
309 | SizeofIfData = C.sizeof_struct_if_data8 | ||
310 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr | ||
311 | SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr | ||
312 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr | ||
313 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr | ||
314 | SizeofRtMetrics = C.sizeof_struct_rt_metrics | ||
315 | ) | ||
316 | |||
317 | type ifMsghdr C.struct_if_msghdr | ||
318 | |||
319 | type IfMsghdr C.struct_if_msghdr8 | ||
320 | |||
321 | type ifData C.struct_if_data | ||
322 | |||
323 | type IfData C.struct_if_data8 | ||
324 | |||
325 | type IfaMsghdr C.struct_ifa_msghdr | ||
326 | |||
327 | type IfmaMsghdr C.struct_ifma_msghdr | ||
328 | |||
329 | type IfAnnounceMsghdr C.struct_if_announcemsghdr | ||
330 | |||
331 | type RtMsghdr C.struct_rt_msghdr | ||
332 | |||
333 | type RtMetrics C.struct_rt_metrics | ||
334 | |||
335 | // Berkeley packet filter | ||
336 | |||
337 | const ( | ||
338 | SizeofBpfVersion = C.sizeof_struct_bpf_version | ||
339 | SizeofBpfStat = C.sizeof_struct_bpf_stat | ||
340 | SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf | ||
341 | SizeofBpfProgram = C.sizeof_struct_bpf_program | ||
342 | SizeofBpfInsn = C.sizeof_struct_bpf_insn | ||
343 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr | ||
344 | SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header | ||
345 | ) | ||
346 | |||
347 | type BpfVersion C.struct_bpf_version | ||
348 | |||
349 | type BpfStat C.struct_bpf_stat | ||
350 | |||
351 | type BpfZbuf C.struct_bpf_zbuf | ||
352 | |||
353 | type BpfProgram C.struct_bpf_program | ||
354 | |||
355 | type BpfInsn C.struct_bpf_insn | ||
356 | |||
357 | type BpfHdr C.struct_bpf_hdr | ||
358 | |||
359 | type BpfZbufHeader C.struct_bpf_zbuf_header | ||
360 | |||
361 | // Terminal handling | ||
362 | |||
363 | type Termios C.struct_termios | ||
364 | |||
365 | type Winsize C.struct_winsize | ||
366 | |||
367 | // fchmodat-like syscalls. | ||
368 | |||
369 | const ( | ||
370 | AT_FDCWD = C.AT_FDCWD | ||
371 | AT_REMOVEDIR = C.AT_REMOVEDIR | ||
372 | AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW | ||
373 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW | ||
374 | ) | ||
375 | |||
376 | // poll | ||
377 | |||
378 | type PollFd C.struct_pollfd | ||
379 | |||
380 | const ( | ||
381 | POLLERR = C.POLLERR | ||
382 | POLLHUP = C.POLLHUP | ||
383 | POLLIN = C.POLLIN | ||
384 | POLLINIGNEOF = C.POLLINIGNEOF | ||
385 | POLLNVAL = C.POLLNVAL | ||
386 | POLLOUT = C.POLLOUT | ||
387 | POLLPRI = C.POLLPRI | ||
388 | POLLRDBAND = C.POLLRDBAND | ||
389 | POLLRDNORM = C.POLLRDNORM | ||
390 | POLLWRBAND = C.POLLWRBAND | ||
391 | POLLWRNORM = C.POLLWRNORM | ||
392 | ) | ||
393 | |||
394 | // Capabilities | ||
395 | |||
396 | type CapRights C.struct_cap_rights | ||
397 | |||
398 | // Uname | ||
399 | |||
400 | type Utsname C.struct_utsname | ||
diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_netbsd.go deleted file mode 100644 index 4a96d72..0000000 --- a/vendor/golang.org/x/sys/unix/types_netbsd.go +++ /dev/null | |||
@@ -1,290 +0,0 @@ | |||
1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | Input to cgo -godefs. See README.md | ||
9 | */ | ||
10 | |||
11 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
13 | |||
14 | package unix | ||
15 | |||
16 | /* | ||
17 | #define KERNEL | ||
18 | #include <dirent.h> | ||
19 | #include <fcntl.h> | ||
20 | #include <poll.h> | ||
21 | #include <signal.h> | ||
22 | #include <termios.h> | ||
23 | #include <stdio.h> | ||
24 | #include <unistd.h> | ||
25 | #include <sys/param.h> | ||
26 | #include <sys/types.h> | ||
27 | #include <sys/event.h> | ||
28 | #include <sys/mman.h> | ||
29 | #include <sys/mount.h> | ||
30 | #include <sys/ptrace.h> | ||
31 | #include <sys/resource.h> | ||
32 | #include <sys/select.h> | ||
33 | #include <sys/signal.h> | ||
34 | #include <sys/socket.h> | ||
35 | #include <sys/stat.h> | ||
36 | #include <sys/sysctl.h> | ||
37 | #include <sys/time.h> | ||
38 | #include <sys/uio.h> | ||
39 | #include <sys/un.h> | ||
40 | #include <sys/utsname.h> | ||
41 | #include <sys/wait.h> | ||
42 | #include <net/bpf.h> | ||
43 | #include <net/if.h> | ||
44 | #include <net/if_dl.h> | ||
45 | #include <net/route.h> | ||
46 | #include <netinet/in.h> | ||
47 | #include <netinet/icmp6.h> | ||
48 | #include <netinet/tcp.h> | ||
49 | |||
50 | enum { | ||
51 | sizeofPtr = sizeof(void*), | ||
52 | }; | ||
53 | |||
54 | union sockaddr_all { | ||
55 | struct sockaddr s1; // this one gets used for fields | ||
56 | struct sockaddr_in s2; // these pad it out | ||
57 | struct sockaddr_in6 s3; | ||
58 | struct sockaddr_un s4; | ||
59 | struct sockaddr_dl s5; | ||
60 | }; | ||
61 | |||
62 | struct sockaddr_any { | ||
63 | struct sockaddr addr; | ||
64 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; | ||
65 | }; | ||
66 | |||
67 | */ | ||
68 | import "C" | ||
69 | |||
70 | // Machine characteristics | ||
71 | |||
72 | const ( | ||
73 | SizeofPtr = C.sizeofPtr | ||
74 | SizeofShort = C.sizeof_short | ||
75 | SizeofInt = C.sizeof_int | ||
76 | SizeofLong = C.sizeof_long | ||
77 | SizeofLongLong = C.sizeof_longlong | ||
78 | ) | ||
79 | |||
80 | // Basic types | ||
81 | |||
82 | type ( | ||
83 | _C_short C.short | ||
84 | _C_int C.int | ||
85 | _C_long C.long | ||
86 | _C_long_long C.longlong | ||
87 | ) | ||
88 | |||
89 | // Time | ||
90 | |||
91 | type Timespec C.struct_timespec | ||
92 | |||
93 | type Timeval C.struct_timeval | ||
94 | |||
95 | // Processes | ||
96 | |||
97 | type Rusage C.struct_rusage | ||
98 | |||
99 | type Rlimit C.struct_rlimit | ||
100 | |||
101 | type _Gid_t C.gid_t | ||
102 | |||
103 | // Files | ||
104 | |||
105 | type Stat_t C.struct_stat | ||
106 | |||
107 | type Statfs_t C.struct_statfs | ||
108 | |||
109 | type Flock_t C.struct_flock | ||
110 | |||
111 | type Dirent C.struct_dirent | ||
112 | |||
113 | type Fsid C.fsid_t | ||
114 | |||
115 | // File system limits | ||
116 | |||
117 | const ( | ||
118 | PathMax = C.PATH_MAX | ||
119 | ) | ||
120 | |||
121 | // Advice to Fadvise | ||
122 | |||
123 | const ( | ||
124 | FADV_NORMAL = C.POSIX_FADV_NORMAL | ||
125 | FADV_RANDOM = C.POSIX_FADV_RANDOM | ||
126 | FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL | ||
127 | FADV_WILLNEED = C.POSIX_FADV_WILLNEED | ||
128 | FADV_DONTNEED = C.POSIX_FADV_DONTNEED | ||
129 | FADV_NOREUSE = C.POSIX_FADV_NOREUSE | ||
130 | ) | ||
131 | |||
132 | // Sockets | ||
133 | |||
134 | type RawSockaddrInet4 C.struct_sockaddr_in | ||
135 | |||
136 | type RawSockaddrInet6 C.struct_sockaddr_in6 | ||
137 | |||
138 | type RawSockaddrUnix C.struct_sockaddr_un | ||
139 | |||
140 | type RawSockaddrDatalink C.struct_sockaddr_dl | ||
141 | |||
142 | type RawSockaddr C.struct_sockaddr | ||
143 | |||
144 | type RawSockaddrAny C.struct_sockaddr_any | ||
145 | |||
146 | type _Socklen C.socklen_t | ||
147 | |||
148 | type Linger C.struct_linger | ||
149 | |||
150 | type Iovec C.struct_iovec | ||
151 | |||
152 | type IPMreq C.struct_ip_mreq | ||
153 | |||
154 | type IPv6Mreq C.struct_ipv6_mreq | ||
155 | |||
156 | type Msghdr C.struct_msghdr | ||
157 | |||
158 | type Cmsghdr C.struct_cmsghdr | ||
159 | |||
160 | type Inet6Pktinfo C.struct_in6_pktinfo | ||
161 | |||
162 | type IPv6MTUInfo C.struct_ip6_mtuinfo | ||
163 | |||
164 | type ICMPv6Filter C.struct_icmp6_filter | ||
165 | |||
166 | const ( | ||
167 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in | ||
168 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
169 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any | ||
170 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un | ||
171 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl | ||
172 | SizeofLinger = C.sizeof_struct_linger | ||
173 | SizeofIPMreq = C.sizeof_struct_ip_mreq | ||
174 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq | ||
175 | SizeofMsghdr = C.sizeof_struct_msghdr | ||
176 | SizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
177 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo | ||
178 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo | ||
179 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter | ||
180 | ) | ||
181 | |||
182 | // Ptrace requests | ||
183 | |||
184 | const ( | ||
185 | PTRACE_TRACEME = C.PT_TRACE_ME | ||
186 | PTRACE_CONT = C.PT_CONTINUE | ||
187 | PTRACE_KILL = C.PT_KILL | ||
188 | ) | ||
189 | |||
190 | // Events (kqueue, kevent) | ||
191 | |||
192 | type Kevent_t C.struct_kevent | ||
193 | |||
194 | // Select | ||
195 | |||
196 | type FdSet C.fd_set | ||
197 | |||
198 | // Routing and interface messages | ||
199 | |||
200 | const ( | ||
201 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr | ||
202 | SizeofIfData = C.sizeof_struct_if_data | ||
203 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr | ||
204 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr | ||
205 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr | ||
206 | SizeofRtMetrics = C.sizeof_struct_rt_metrics | ||
207 | ) | ||
208 | |||
209 | type IfMsghdr C.struct_if_msghdr | ||
210 | |||
211 | type IfData C.struct_if_data | ||
212 | |||
213 | type IfaMsghdr C.struct_ifa_msghdr | ||
214 | |||
215 | type IfAnnounceMsghdr C.struct_if_announcemsghdr | ||
216 | |||
217 | type RtMsghdr C.struct_rt_msghdr | ||
218 | |||
219 | type RtMetrics C.struct_rt_metrics | ||
220 | |||
221 | type Mclpool C.struct_mclpool | ||
222 | |||
223 | // Berkeley packet filter | ||
224 | |||
225 | const ( | ||
226 | SizeofBpfVersion = C.sizeof_struct_bpf_version | ||
227 | SizeofBpfStat = C.sizeof_struct_bpf_stat | ||
228 | SizeofBpfProgram = C.sizeof_struct_bpf_program | ||
229 | SizeofBpfInsn = C.sizeof_struct_bpf_insn | ||
230 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr | ||
231 | ) | ||
232 | |||
233 | type BpfVersion C.struct_bpf_version | ||
234 | |||
235 | type BpfStat C.struct_bpf_stat | ||
236 | |||
237 | type BpfProgram C.struct_bpf_program | ||
238 | |||
239 | type BpfInsn C.struct_bpf_insn | ||
240 | |||
241 | type BpfHdr C.struct_bpf_hdr | ||
242 | |||
243 | type BpfTimeval C.struct_bpf_timeval | ||
244 | |||
245 | // Terminal handling | ||
246 | |||
247 | type Termios C.struct_termios | ||
248 | |||
249 | type Winsize C.struct_winsize | ||
250 | |||
251 | type Ptmget C.struct_ptmget | ||
252 | |||
253 | // fchmodat-like syscalls. | ||
254 | |||
255 | const ( | ||
256 | AT_FDCWD = C.AT_FDCWD | ||
257 | AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW | ||
258 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW | ||
259 | ) | ||
260 | |||
261 | // poll | ||
262 | |||
263 | type PollFd C.struct_pollfd | ||
264 | |||
265 | const ( | ||
266 | POLLERR = C.POLLERR | ||
267 | POLLHUP = C.POLLHUP | ||
268 | POLLIN = C.POLLIN | ||
269 | POLLNVAL = C.POLLNVAL | ||
270 | POLLOUT = C.POLLOUT | ||
271 | POLLPRI = C.POLLPRI | ||
272 | POLLRDBAND = C.POLLRDBAND | ||
273 | POLLRDNORM = C.POLLRDNORM | ||
274 | POLLWRBAND = C.POLLWRBAND | ||
275 | POLLWRNORM = C.POLLWRNORM | ||
276 | ) | ||
277 | |||
278 | // Sysctl | ||
279 | |||
280 | type Sysctlnode C.struct_sysctlnode | ||
281 | |||
282 | // Uname | ||
283 | |||
284 | type Utsname C.struct_utsname | ||
285 | |||
286 | // Clockinfo | ||
287 | |||
288 | const SizeofClockinfo = C.sizeof_struct_clockinfo | ||
289 | |||
290 | type Clockinfo C.struct_clockinfo | ||
diff --git a/vendor/golang.org/x/sys/unix/types_openbsd.go b/vendor/golang.org/x/sys/unix/types_openbsd.go deleted file mode 100644 index 775cb57..0000000 --- a/vendor/golang.org/x/sys/unix/types_openbsd.go +++ /dev/null | |||
@@ -1,283 +0,0 @@ | |||
1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | Input to cgo -godefs. See README.md | ||
9 | */ | ||
10 | |||
11 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
13 | |||
14 | package unix | ||
15 | |||
16 | /* | ||
17 | #define KERNEL | ||
18 | #include <dirent.h> | ||
19 | #include <fcntl.h> | ||
20 | #include <poll.h> | ||
21 | #include <signal.h> | ||
22 | #include <termios.h> | ||
23 | #include <stdio.h> | ||
24 | #include <unistd.h> | ||
25 | #include <sys/param.h> | ||
26 | #include <sys/types.h> | ||
27 | #include <sys/event.h> | ||
28 | #include <sys/mman.h> | ||
29 | #include <sys/mount.h> | ||
30 | #include <sys/ptrace.h> | ||
31 | #include <sys/resource.h> | ||
32 | #include <sys/select.h> | ||
33 | #include <sys/signal.h> | ||
34 | #include <sys/socket.h> | ||
35 | #include <sys/stat.h> | ||
36 | #include <sys/time.h> | ||
37 | #include <sys/uio.h> | ||
38 | #include <sys/un.h> | ||
39 | #include <sys/utsname.h> | ||
40 | #include <sys/wait.h> | ||
41 | #include <uvm/uvmexp.h> | ||
42 | #include <net/bpf.h> | ||
43 | #include <net/if.h> | ||
44 | #include <net/if_dl.h> | ||
45 | #include <net/route.h> | ||
46 | #include <netinet/in.h> | ||
47 | #include <netinet/icmp6.h> | ||
48 | #include <netinet/tcp.h> | ||
49 | |||
50 | enum { | ||
51 | sizeofPtr = sizeof(void*), | ||
52 | }; | ||
53 | |||
54 | union sockaddr_all { | ||
55 | struct sockaddr s1; // this one gets used for fields | ||
56 | struct sockaddr_in s2; // these pad it out | ||
57 | struct sockaddr_in6 s3; | ||
58 | struct sockaddr_un s4; | ||
59 | struct sockaddr_dl s5; | ||
60 | }; | ||
61 | |||
62 | struct sockaddr_any { | ||
63 | struct sockaddr addr; | ||
64 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; | ||
65 | }; | ||
66 | |||
67 | */ | ||
68 | import "C" | ||
69 | |||
70 | // Machine characteristics | ||
71 | |||
72 | const ( | ||
73 | SizeofPtr = C.sizeofPtr | ||
74 | SizeofShort = C.sizeof_short | ||
75 | SizeofInt = C.sizeof_int | ||
76 | SizeofLong = C.sizeof_long | ||
77 | SizeofLongLong = C.sizeof_longlong | ||
78 | ) | ||
79 | |||
80 | // Basic types | ||
81 | |||
82 | type ( | ||
83 | _C_short C.short | ||
84 | _C_int C.int | ||
85 | _C_long C.long | ||
86 | _C_long_long C.longlong | ||
87 | ) | ||
88 | |||
89 | // Time | ||
90 | |||
91 | type Timespec C.struct_timespec | ||
92 | |||
93 | type Timeval C.struct_timeval | ||
94 | |||
95 | // Processes | ||
96 | |||
97 | type Rusage C.struct_rusage | ||
98 | |||
99 | type Rlimit C.struct_rlimit | ||
100 | |||
101 | type _Gid_t C.gid_t | ||
102 | |||
103 | // Files | ||
104 | |||
105 | type Stat_t C.struct_stat | ||
106 | |||
107 | type Statfs_t C.struct_statfs | ||
108 | |||
109 | type Flock_t C.struct_flock | ||
110 | |||
111 | type Dirent C.struct_dirent | ||
112 | |||
113 | type Fsid C.fsid_t | ||
114 | |||
115 | // File system limits | ||
116 | |||
117 | const ( | ||
118 | PathMax = C.PATH_MAX | ||
119 | ) | ||
120 | |||
121 | // Sockets | ||
122 | |||
123 | type RawSockaddrInet4 C.struct_sockaddr_in | ||
124 | |||
125 | type RawSockaddrInet6 C.struct_sockaddr_in6 | ||
126 | |||
127 | type RawSockaddrUnix C.struct_sockaddr_un | ||
128 | |||
129 | type RawSockaddrDatalink C.struct_sockaddr_dl | ||
130 | |||
131 | type RawSockaddr C.struct_sockaddr | ||
132 | |||
133 | type RawSockaddrAny C.struct_sockaddr_any | ||
134 | |||
135 | type _Socklen C.socklen_t | ||
136 | |||
137 | type Linger C.struct_linger | ||
138 | |||
139 | type Iovec C.struct_iovec | ||
140 | |||
141 | type IPMreq C.struct_ip_mreq | ||
142 | |||
143 | type IPv6Mreq C.struct_ipv6_mreq | ||
144 | |||
145 | type Msghdr C.struct_msghdr | ||
146 | |||
147 | type Cmsghdr C.struct_cmsghdr | ||
148 | |||
149 | type Inet6Pktinfo C.struct_in6_pktinfo | ||
150 | |||
151 | type IPv6MTUInfo C.struct_ip6_mtuinfo | ||
152 | |||
153 | type ICMPv6Filter C.struct_icmp6_filter | ||
154 | |||
155 | const ( | ||
156 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in | ||
157 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
158 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any | ||
159 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un | ||
160 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl | ||
161 | SizeofLinger = C.sizeof_struct_linger | ||
162 | SizeofIPMreq = C.sizeof_struct_ip_mreq | ||
163 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq | ||
164 | SizeofMsghdr = C.sizeof_struct_msghdr | ||
165 | SizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
166 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo | ||
167 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo | ||
168 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter | ||
169 | ) | ||
170 | |||
171 | // Ptrace requests | ||
172 | |||
173 | const ( | ||
174 | PTRACE_TRACEME = C.PT_TRACE_ME | ||
175 | PTRACE_CONT = C.PT_CONTINUE | ||
176 | PTRACE_KILL = C.PT_KILL | ||
177 | ) | ||
178 | |||
179 | // Events (kqueue, kevent) | ||
180 | |||
181 | type Kevent_t C.struct_kevent | ||
182 | |||
183 | // Select | ||
184 | |||
185 | type FdSet C.fd_set | ||
186 | |||
187 | // Routing and interface messages | ||
188 | |||
189 | const ( | ||
190 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr | ||
191 | SizeofIfData = C.sizeof_struct_if_data | ||
192 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr | ||
193 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr | ||
194 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr | ||
195 | SizeofRtMetrics = C.sizeof_struct_rt_metrics | ||
196 | ) | ||
197 | |||
198 | type IfMsghdr C.struct_if_msghdr | ||
199 | |||
200 | type IfData C.struct_if_data | ||
201 | |||
202 | type IfaMsghdr C.struct_ifa_msghdr | ||
203 | |||
204 | type IfAnnounceMsghdr C.struct_if_announcemsghdr | ||
205 | |||
206 | type RtMsghdr C.struct_rt_msghdr | ||
207 | |||
208 | type RtMetrics C.struct_rt_metrics | ||
209 | |||
210 | type Mclpool C.struct_mclpool | ||
211 | |||
212 | // Berkeley packet filter | ||
213 | |||
214 | const ( | ||
215 | SizeofBpfVersion = C.sizeof_struct_bpf_version | ||
216 | SizeofBpfStat = C.sizeof_struct_bpf_stat | ||
217 | SizeofBpfProgram = C.sizeof_struct_bpf_program | ||
218 | SizeofBpfInsn = C.sizeof_struct_bpf_insn | ||
219 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr | ||
220 | ) | ||
221 | |||
222 | type BpfVersion C.struct_bpf_version | ||
223 | |||
224 | type BpfStat C.struct_bpf_stat | ||
225 | |||
226 | type BpfProgram C.struct_bpf_program | ||
227 | |||
228 | type BpfInsn C.struct_bpf_insn | ||
229 | |||
230 | type BpfHdr C.struct_bpf_hdr | ||
231 | |||
232 | type BpfTimeval C.struct_bpf_timeval | ||
233 | |||
234 | // Terminal handling | ||
235 | |||
236 | type Termios C.struct_termios | ||
237 | |||
238 | type Winsize C.struct_winsize | ||
239 | |||
240 | // fchmodat-like syscalls. | ||
241 | |||
242 | const ( | ||
243 | AT_FDCWD = C.AT_FDCWD | ||
244 | AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW | ||
245 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW | ||
246 | ) | ||
247 | |||
248 | // poll | ||
249 | |||
250 | type PollFd C.struct_pollfd | ||
251 | |||
252 | const ( | ||
253 | POLLERR = C.POLLERR | ||
254 | POLLHUP = C.POLLHUP | ||
255 | POLLIN = C.POLLIN | ||
256 | POLLNVAL = C.POLLNVAL | ||
257 | POLLOUT = C.POLLOUT | ||
258 | POLLPRI = C.POLLPRI | ||
259 | POLLRDBAND = C.POLLRDBAND | ||
260 | POLLRDNORM = C.POLLRDNORM | ||
261 | POLLWRBAND = C.POLLWRBAND | ||
262 | POLLWRNORM = C.POLLWRNORM | ||
263 | ) | ||
264 | |||
265 | // Signal Sets | ||
266 | |||
267 | type Sigset_t C.sigset_t | ||
268 | |||
269 | // Uname | ||
270 | |||
271 | type Utsname C.struct_utsname | ||
272 | |||
273 | // Uvmexp | ||
274 | |||
275 | const SizeofUvmexp = C.sizeof_struct_uvmexp | ||
276 | |||
277 | type Uvmexp C.struct_uvmexp | ||
278 | |||
279 | // Clockinfo | ||
280 | |||
281 | const SizeofClockinfo = C.sizeof_struct_clockinfo | ||
282 | |||
283 | type Clockinfo C.struct_clockinfo | ||
diff --git a/vendor/golang.org/x/sys/unix/types_solaris.go b/vendor/golang.org/x/sys/unix/types_solaris.go deleted file mode 100644 index 2b716f9..0000000 --- a/vendor/golang.org/x/sys/unix/types_solaris.go +++ /dev/null | |||
@@ -1,266 +0,0 @@ | |||
1 | // Copyright 2009 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | // +build ignore | ||
6 | |||
7 | /* | ||
8 | Input to cgo -godefs. See README.md | ||
9 | */ | ||
10 | |||
11 | // +godefs map struct_in_addr [4]byte /* in_addr */ | ||
12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ | ||
13 | |||
14 | package unix | ||
15 | |||
16 | /* | ||
17 | #define KERNEL | ||
18 | // These defines ensure that builds done on newer versions of Solaris are | ||
19 | // backwards-compatible with older versions of Solaris and | ||
20 | // OpenSolaris-based derivatives. | ||
21 | #define __USE_SUNOS_SOCKETS__ // msghdr | ||
22 | #define __USE_LEGACY_PROTOTYPES__ // iovec | ||
23 | #include <dirent.h> | ||
24 | #include <fcntl.h> | ||
25 | #include <netdb.h> | ||
26 | #include <limits.h> | ||
27 | #include <poll.h> | ||
28 | #include <signal.h> | ||
29 | #include <termios.h> | ||
30 | #include <termio.h> | ||
31 | #include <stdio.h> | ||
32 | #include <unistd.h> | ||
33 | #include <sys/mman.h> | ||
34 | #include <sys/mount.h> | ||
35 | #include <sys/param.h> | ||
36 | #include <sys/resource.h> | ||
37 | #include <sys/select.h> | ||
38 | #include <sys/signal.h> | ||
39 | #include <sys/socket.h> | ||
40 | #include <sys/stat.h> | ||
41 | #include <sys/statvfs.h> | ||
42 | #include <sys/time.h> | ||
43 | #include <sys/times.h> | ||
44 | #include <sys/types.h> | ||
45 | #include <sys/utsname.h> | ||
46 | #include <sys/un.h> | ||
47 | #include <sys/wait.h> | ||
48 | #include <net/bpf.h> | ||
49 | #include <net/if.h> | ||
50 | #include <net/if_dl.h> | ||
51 | #include <net/route.h> | ||
52 | #include <netinet/in.h> | ||
53 | #include <netinet/icmp6.h> | ||
54 | #include <netinet/tcp.h> | ||
55 | #include <ustat.h> | ||
56 | #include <utime.h> | ||
57 | |||
58 | enum { | ||
59 | sizeofPtr = sizeof(void*), | ||
60 | }; | ||
61 | |||
62 | union sockaddr_all { | ||
63 | struct sockaddr s1; // this one gets used for fields | ||
64 | struct sockaddr_in s2; // these pad it out | ||
65 | struct sockaddr_in6 s3; | ||
66 | struct sockaddr_un s4; | ||
67 | struct sockaddr_dl s5; | ||
68 | }; | ||
69 | |||
70 | struct sockaddr_any { | ||
71 | struct sockaddr addr; | ||
72 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; | ||
73 | }; | ||
74 | |||
75 | */ | ||
76 | import "C" | ||
77 | |||
78 | // Machine characteristics | ||
79 | |||
80 | const ( | ||
81 | SizeofPtr = C.sizeofPtr | ||
82 | SizeofShort = C.sizeof_short | ||
83 | SizeofInt = C.sizeof_int | ||
84 | SizeofLong = C.sizeof_long | ||
85 | SizeofLongLong = C.sizeof_longlong | ||
86 | PathMax = C.PATH_MAX | ||
87 | MaxHostNameLen = C.MAXHOSTNAMELEN | ||
88 | ) | ||
89 | |||
90 | // Basic types | ||
91 | |||
92 | type ( | ||
93 | _C_short C.short | ||
94 | _C_int C.int | ||
95 | _C_long C.long | ||
96 | _C_long_long C.longlong | ||
97 | ) | ||
98 | |||
99 | // Time | ||
100 | |||
101 | type Timespec C.struct_timespec | ||
102 | |||
103 | type Timeval C.struct_timeval | ||
104 | |||
105 | type Timeval32 C.struct_timeval32 | ||
106 | |||
107 | type Tms C.struct_tms | ||
108 | |||
109 | type Utimbuf C.struct_utimbuf | ||
110 | |||
111 | // Processes | ||
112 | |||
113 | type Rusage C.struct_rusage | ||
114 | |||
115 | type Rlimit C.struct_rlimit | ||
116 | |||
117 | type _Gid_t C.gid_t | ||
118 | |||
119 | // Files | ||
120 | |||
121 | type Stat_t C.struct_stat | ||
122 | |||
123 | type Flock_t C.struct_flock | ||
124 | |||
125 | type Dirent C.struct_dirent | ||
126 | |||
127 | // Filesystems | ||
128 | |||
129 | type _Fsblkcnt_t C.fsblkcnt_t | ||
130 | |||
131 | type Statvfs_t C.struct_statvfs | ||
132 | |||
133 | // Sockets | ||
134 | |||
135 | type RawSockaddrInet4 C.struct_sockaddr_in | ||
136 | |||
137 | type RawSockaddrInet6 C.struct_sockaddr_in6 | ||
138 | |||
139 | type RawSockaddrUnix C.struct_sockaddr_un | ||
140 | |||
141 | type RawSockaddrDatalink C.struct_sockaddr_dl | ||
142 | |||
143 | type RawSockaddr C.struct_sockaddr | ||
144 | |||
145 | type RawSockaddrAny C.struct_sockaddr_any | ||
146 | |||
147 | type _Socklen C.socklen_t | ||
148 | |||
149 | type Linger C.struct_linger | ||
150 | |||
151 | type Iovec C.struct_iovec | ||
152 | |||
153 | type IPMreq C.struct_ip_mreq | ||
154 | |||
155 | type IPv6Mreq C.struct_ipv6_mreq | ||
156 | |||
157 | type Msghdr C.struct_msghdr | ||
158 | |||
159 | type Cmsghdr C.struct_cmsghdr | ||
160 | |||
161 | type Inet6Pktinfo C.struct_in6_pktinfo | ||
162 | |||
163 | type IPv6MTUInfo C.struct_ip6_mtuinfo | ||
164 | |||
165 | type ICMPv6Filter C.struct_icmp6_filter | ||
166 | |||
167 | const ( | ||
168 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in | ||
169 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 | ||
170 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any | ||
171 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un | ||
172 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl | ||
173 | SizeofLinger = C.sizeof_struct_linger | ||
174 | SizeofIPMreq = C.sizeof_struct_ip_mreq | ||
175 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq | ||
176 | SizeofMsghdr = C.sizeof_struct_msghdr | ||
177 | SizeofCmsghdr = C.sizeof_struct_cmsghdr | ||
178 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo | ||
179 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo | ||
180 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter | ||
181 | ) | ||
182 | |||
183 | // Select | ||
184 | |||
185 | type FdSet C.fd_set | ||
186 | |||
187 | // Misc | ||
188 | |||
189 | type Utsname C.struct_utsname | ||
190 | |||
191 | type Ustat_t C.struct_ustat | ||
192 | |||
193 | const ( | ||
194 | AT_FDCWD = C.AT_FDCWD | ||
195 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW | ||
196 | AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW | ||
197 | AT_REMOVEDIR = C.AT_REMOVEDIR | ||
198 | AT_EACCESS = C.AT_EACCESS | ||
199 | ) | ||
200 | |||
201 | // Routing and interface messages | ||
202 | |||
203 | const ( | ||
204 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr | ||
205 | SizeofIfData = C.sizeof_struct_if_data | ||
206 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr | ||
207 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr | ||
208 | SizeofRtMetrics = C.sizeof_struct_rt_metrics | ||
209 | ) | ||
210 | |||
211 | type IfMsghdr C.struct_if_msghdr | ||
212 | |||
213 | type IfData C.struct_if_data | ||
214 | |||
215 | type IfaMsghdr C.struct_ifa_msghdr | ||
216 | |||
217 | type RtMsghdr C.struct_rt_msghdr | ||
218 | |||
219 | type RtMetrics C.struct_rt_metrics | ||
220 | |||
221 | // Berkeley packet filter | ||
222 | |||
223 | const ( | ||
224 | SizeofBpfVersion = C.sizeof_struct_bpf_version | ||
225 | SizeofBpfStat = C.sizeof_struct_bpf_stat | ||
226 | SizeofBpfProgram = C.sizeof_struct_bpf_program | ||
227 | SizeofBpfInsn = C.sizeof_struct_bpf_insn | ||
228 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr | ||
229 | ) | ||
230 | |||
231 | type BpfVersion C.struct_bpf_version | ||
232 | |||
233 | type BpfStat C.struct_bpf_stat | ||
234 | |||
235 | type BpfProgram C.struct_bpf_program | ||
236 | |||
237 | type BpfInsn C.struct_bpf_insn | ||
238 | |||
239 | type BpfTimeval C.struct_bpf_timeval | ||
240 | |||
241 | type BpfHdr C.struct_bpf_hdr | ||
242 | |||
243 | // Terminal handling | ||
244 | |||
245 | type Termios C.struct_termios | ||
246 | |||
247 | type Termio C.struct_termio | ||
248 | |||
249 | type Winsize C.struct_winsize | ||
250 | |||
251 | // poll | ||
252 | |||
253 | type PollFd C.struct_pollfd | ||
254 | |||
255 | const ( | ||
256 | POLLERR = C.POLLERR | ||
257 | POLLHUP = C.POLLHUP | ||
258 | POLLIN = C.POLLIN | ||
259 | POLLNVAL = C.POLLNVAL | ||
260 | POLLOUT = C.POLLOUT | ||
261 | POLLPRI = C.POLLPRI | ||
262 | POLLRDBAND = C.POLLRDBAND | ||
263 | POLLRDNORM = C.POLLRDNORM | ||
264 | POLLWRBAND = C.POLLWRBAND | ||
265 | POLLWRNORM = C.POLLWRNORM | ||
266 | ) | ||
diff --git a/vendor/modules.txt b/vendor/modules.txt index 4d377cc..7cf21f7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt | |||
@@ -35,24 +35,24 @@ github.com/mdlayher/wifi | |||
35 | github.com/mdlayher/wifi/internal/nl80211 | 35 | github.com/mdlayher/wifi/internal/nl80211 |
36 | # github.com/prometheus/client_golang v1.0.0 | 36 | # github.com/prometheus/client_golang v1.0.0 |
37 | github.com/prometheus/client_golang/prometheus | 37 | github.com/prometheus/client_golang/prometheus |
38 | github.com/prometheus/client_golang/prometheus/promhttp | ||
39 | github.com/prometheus/client_golang/prometheus/internal | 38 | github.com/prometheus/client_golang/prometheus/internal |
39 | github.com/prometheus/client_golang/prometheus/promhttp | ||
40 | # github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 | 40 | # github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 |
41 | github.com/prometheus/client_model/go | 41 | github.com/prometheus/client_model/go |
42 | # github.com/prometheus/common v0.4.1 | 42 | # github.com/prometheus/common v0.4.1 |
43 | github.com/prometheus/common/log | ||
44 | github.com/prometheus/common/version | ||
45 | github.com/prometheus/common/expfmt | 43 | github.com/prometheus/common/expfmt |
46 | github.com/prometheus/common/model | ||
47 | github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg | 44 | github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg |
45 | github.com/prometheus/common/log | ||
46 | github.com/prometheus/common/model | ||
47 | github.com/prometheus/common/version | ||
48 | # github.com/prometheus/procfs v0.0.5 | 48 | # github.com/prometheus/procfs v0.0.5 |
49 | github.com/prometheus/procfs | 49 | github.com/prometheus/procfs |
50 | github.com/prometheus/procfs/bcache | 50 | github.com/prometheus/procfs/bcache |
51 | github.com/prometheus/procfs/internal/fs | ||
52 | github.com/prometheus/procfs/internal/util | ||
51 | github.com/prometheus/procfs/nfs | 53 | github.com/prometheus/procfs/nfs |
52 | github.com/prometheus/procfs/sysfs | 54 | github.com/prometheus/procfs/sysfs |
53 | github.com/prometheus/procfs/xfs | 55 | github.com/prometheus/procfs/xfs |
54 | github.com/prometheus/procfs/internal/fs | ||
55 | github.com/prometheus/procfs/internal/util | ||
56 | # github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 | 56 | # github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 |
57 | github.com/siebenmann/go-kstat | 57 | github.com/siebenmann/go-kstat |
58 | # github.com/sirupsen/logrus v1.4.2 | 58 | # github.com/sirupsen/logrus v1.4.2 |
@@ -64,16 +64,16 @@ go.uber.org/atomic | |||
64 | # go.uber.org/multierr v1.1.0 | 64 | # go.uber.org/multierr v1.1.0 |
65 | go.uber.org/multierr | 65 | go.uber.org/multierr |
66 | # golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 | 66 | # golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 |
67 | golang.org/x/net/ipv4 | ||
68 | golang.org/x/net/bpf | 67 | golang.org/x/net/bpf |
69 | golang.org/x/net/internal/iana | 68 | golang.org/x/net/internal/iana |
70 | golang.org/x/net/internal/socket | 69 | golang.org/x/net/internal/socket |
70 | golang.org/x/net/ipv4 | ||
71 | # golang.org/x/sync v0.0.0-20190423024810-112230192c58 | 71 | # golang.org/x/sync v0.0.0-20190423024810-112230192c58 |
72 | golang.org/x/sync/errgroup | 72 | golang.org/x/sync/errgroup |
73 | # golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 | 73 | # golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 |
74 | golang.org/x/sys/unix | 74 | golang.org/x/sys/unix |
75 | golang.org/x/sys/windows | 75 | golang.org/x/sys/windows |
76 | golang.org/x/sys/windows/svc/eventlog | ||
77 | golang.org/x/sys/windows/registry | 76 | golang.org/x/sys/windows/registry |
77 | golang.org/x/sys/windows/svc/eventlog | ||
78 | # gopkg.in/alecthomas/kingpin.v2 v2.2.6 | 78 | # gopkg.in/alecthomas/kingpin.v2 v2.2.6 |
79 | gopkg.in/alecthomas/kingpin.v2 | 79 | gopkg.in/alecthomas/kingpin.v2 |