aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/net/internal/iana
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/net/internal/iana')
-rw-r--r--vendor/golang.org/x/net/internal/iana/const.go109
-rw-r--r--vendor/golang.org/x/net/internal/iana/gen.go293
2 files changed, 76 insertions, 326 deletions
diff --git a/vendor/golang.org/x/net/internal/iana/const.go b/vendor/golang.org/x/net/internal/iana/const.go
index c9df24d..cea712f 100644
--- a/vendor/golang.org/x/net/internal/iana/const.go
+++ b/vendor/golang.org/x/net/internal/iana/const.go
@@ -1,44 +1,40 @@
// go generate gen.go
-// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
+// Code generated by the command above; DO NOT EDIT.
// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).
package iana // import "golang.org/x/net/internal/iana"
-// Differentiated Services Field Codepoints (DSCP), Updated: 2017-05-12
+// Differentiated Services Field Codepoints (DSCP), Updated: 2018-05-04
const (
- DiffServCS0 = 0x0 // CS0
- DiffServCS1 = 0x20 // CS1
- DiffServCS2 = 0x40 // CS2
- DiffServCS3 = 0x60 // CS3
- DiffServCS4 = 0x80 // CS4
- DiffServCS5 = 0xa0 // CS5
- DiffServCS6 = 0xc0 // CS6
- DiffServCS7 = 0xe0 // CS7
- DiffServAF11 = 0x28 // AF11
- DiffServAF12 = 0x30 // AF12
- DiffServAF13 = 0x38 // AF13
- DiffServAF21 = 0x48 // AF21
- DiffServAF22 = 0x50 // AF22
- DiffServAF23 = 0x58 // AF23
- DiffServAF31 = 0x68 // AF31
- DiffServAF32 = 0x70 // AF32
- DiffServAF33 = 0x78 // AF33
- DiffServAF41 = 0x88 // AF41
- DiffServAF42 = 0x90 // AF42
- DiffServAF43 = 0x98 // AF43
- DiffServEF = 0xb8 // EF
- DiffServVOICEADMIT = 0xb0 // VOICE-ADMIT
+ DiffServCS0 = 0x00 // CS0
+ DiffServCS1 = 0x20 // CS1
+ DiffServCS2 = 0x40 // CS2
+ DiffServCS3 = 0x60 // CS3
+ DiffServCS4 = 0x80 // CS4
+ DiffServCS5 = 0xa0 // CS5
+ DiffServCS6 = 0xc0 // CS6
+ DiffServCS7 = 0xe0 // CS7
+ DiffServAF11 = 0x28 // AF11
+ DiffServAF12 = 0x30 // AF12
+ DiffServAF13 = 0x38 // AF13
+ DiffServAF21 = 0x48 // AF21
+ DiffServAF22 = 0x50 // AF22
+ DiffServAF23 = 0x58 // AF23
+ DiffServAF31 = 0x68 // AF31
+ DiffServAF32 = 0x70 // AF32
+ DiffServAF33 = 0x78 // AF33
+ DiffServAF41 = 0x88 // AF41
+ DiffServAF42 = 0x90 // AF42
+ DiffServAF43 = 0x98 // AF43
+ DiffServEF = 0xb8 // EF
+ DiffServVOICEADMIT = 0xb0 // VOICE-ADMIT
+ NotECNTransport = 0x00 // Not-ECT (Not ECN-Capable Transport)
+ ECNTransport1 = 0x01 // ECT(1) (ECN-Capable Transport(1))
+ ECNTransport0 = 0x02 // ECT(0) (ECN-Capable Transport(0))
+ CongestionExperienced = 0x03 // CE (Congestion Experienced)
)
-// IPv4 TOS Byte and IPv6 Traffic Class Octet, Updated: 2001-09-06
-const (
- NotECNTransport = 0x0 // Not-ECT (Not ECN-Capable Transport)
- ECNTransport1 = 0x1 // ECT(1) (ECN-Capable Transport(1))
- ECNTransport0 = 0x2 // ECT(0) (ECN-Capable Transport(0))
- CongestionExperienced = 0x3 // CE (Congestion Experienced)
-)
-
-// Protocol Numbers, Updated: 2016-06-22
+// Protocol Numbers, Updated: 2017-10-13
const (
ProtocolIP = 0 // IPv4 encapsulation, pseudo protocol number
ProtocolHOPOPT = 0 // IPv6 Hop-by-Hop Option
@@ -178,3 +174,50 @@ const (
ProtocolROHC = 142 // Robust Header Compression
ProtocolReserved = 255 // Reserved
)
+
+// Address Family Numbers, Updated: 2018-04-02
+const (
+ AddrFamilyIPv4 = 1 // IP (IP version 4)
+ AddrFamilyIPv6 = 2 // IP6 (IP version 6)
+ AddrFamilyNSAP = 3 // NSAP
+ AddrFamilyHDLC = 4 // HDLC (8-bit multidrop)
+ AddrFamilyBBN1822 = 5 // BBN 1822
+ AddrFamily802 = 6 // 802 (includes all 802 media plus Ethernet "canonical format")
+ AddrFamilyE163 = 7 // E.163
+ AddrFamilyE164 = 8 // E.164 (SMDS, Frame Relay, ATM)
+ AddrFamilyF69 = 9 // F.69 (Telex)
+ AddrFamilyX121 = 10 // X.121 (X.25, Frame Relay)
+ AddrFamilyIPX = 11 // IPX
+ AddrFamilyAppletalk = 12 // Appletalk
+ AddrFamilyDecnetIV = 13 // Decnet IV
+ AddrFamilyBanyanVines = 14 // Banyan Vines
+ AddrFamilyE164withSubaddress = 15 // E.164 with NSAP format subaddress
+ AddrFamilyDNS = 16 // DNS (Domain Name System)
+ AddrFamilyDistinguishedName = 17 // Distinguished Name
+ AddrFamilyASNumber = 18 // AS Number
+ AddrFamilyXTPoverIPv4 = 19 // XTP over IP version 4
+ AddrFamilyXTPoverIPv6 = 20 // XTP over IP version 6
+ AddrFamilyXTPnativemodeXTP = 21 // XTP native mode XTP
+ AddrFamilyFibreChannelWorldWidePortName = 22 // Fibre Channel World-Wide Port Name
+ AddrFamilyFibreChannelWorldWideNodeName = 23 // Fibre Channel World-Wide Node Name
+ AddrFamilyGWID = 24 // GWID
+ AddrFamilyL2VPN = 25 // AFI for L2VPN information
+ AddrFamilyMPLSTPSectionEndpointID = 26 // MPLS-TP Section Endpoint Identifier
+ AddrFamilyMPLSTPLSPEndpointID = 27 // MPLS-TP LSP Endpoint Identifier
+ AddrFamilyMPLSTPPseudowireEndpointID = 28 // MPLS-TP Pseudowire Endpoint Identifier
+ AddrFamilyMTIPv4 = 29 // MT IP: Multi-Topology IP version 4
+ AddrFamilyMTIPv6 = 30 // MT IPv6: Multi-Topology IP version 6
+ AddrFamilyEIGRPCommonServiceFamily = 16384 // EIGRP Common Service Family
+ AddrFamilyEIGRPIPv4ServiceFamily = 16385 // EIGRP IPv4 Service Family
+ AddrFamilyEIGRPIPv6ServiceFamily = 16386 // EIGRP IPv6 Service Family
+ AddrFamilyLISPCanonicalAddressFormat = 16387 // LISP Canonical Address Format (LCAF)
+ AddrFamilyBGPLS = 16388 // BGP-LS
+ AddrFamily48bitMAC = 16389 // 48-bit MAC
+ AddrFamily64bitMAC = 16390 // 64-bit MAC
+ AddrFamilyOUI = 16391 // OUI
+ AddrFamilyMACFinal24bits = 16392 // MAC/24
+ AddrFamilyMACFinal40bits = 16393 // MAC/40
+ AddrFamilyIPv6Initial64bits = 16394 // IPv6/64
+ AddrFamilyRBridgePortID = 16395 // RBridge Port ID
+ AddrFamilyTRILLNickname = 16396 // TRILL Nickname
+)
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 2a5c310..0000000
--- a/vendor/golang.org/x/net/internal/iana/gen.go
+++ /dev/null
@@ -1,293 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-//go:generate go run gen.go
-
-// This program generates internet protocol constants and tables by
-// reading IANA protocol registries.
-package main
-
-import (
- "bytes"
- "encoding/xml"
- "fmt"
- "go/format"
- "io"
- "io/ioutil"
- "net/http"
- "os"
- "strconv"
- "strings"
-)
-
-var registries = []struct {
- url string
- parse func(io.Writer, io.Reader) error
-}{
- {
- "https://www.iana.org/assignments/dscp-registry/dscp-registry.xml",
- parseDSCPRegistry,
- },
- {
- "https://www.iana.org/assignments/ipv4-tos-byte/ipv4-tos-byte.xml",
- parseTOSTCByte,
- },
- {
- "https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml",
- parseProtocolNumbers,
- },
-}
-
-func main() {
- var bb bytes.Buffer
- fmt.Fprintf(&bb, "// go generate gen.go\n")
- fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n")
- fmt.Fprintf(&bb, "// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).\n")
- fmt.Fprintf(&bb, `package iana // import "golang.org/x/net/internal/iana"`+"\n\n")
- for _, r := range registries {
- resp, err := http.Get(r.url)
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- fmt.Fprintf(os.Stderr, "got HTTP status code %v for %v\n", resp.StatusCode, r.url)
- os.Exit(1)
- }
- if err := r.parse(&bb, resp.Body); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- fmt.Fprintf(&bb, "\n")
- }
- b, err := format.Source(bb.Bytes())
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- if err := ioutil.WriteFile("const.go", b, 0644); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
-
-func parseDSCPRegistry(w io.Writer, r io.Reader) error {
- dec := xml.NewDecoder(r)
- var dr dscpRegistry
- if err := dec.Decode(&dr); err != nil {
- return err
- }
- drs := dr.escape()
- fmt.Fprintf(w, "// %s, Updated: %s\n", dr.Title, dr.Updated)
- fmt.Fprintf(w, "const (\n")
- for _, dr := range drs {
- fmt.Fprintf(w, "DiffServ%s = %#x", dr.Name, dr.Value)
- fmt.Fprintf(w, "// %s\n", dr.OrigName)
- }
- fmt.Fprintf(w, ")\n")
- return nil
-}
-
-type dscpRegistry struct {
- XMLName xml.Name `xml:"registry"`
- Title string `xml:"title"`
- Updated string `xml:"updated"`
- Note string `xml:"note"`
- RegTitle string `xml:"registry>title"`
- PoolRecords []struct {
- Name string `xml:"name"`
- Space string `xml:"space"`
- } `xml:"registry>record"`
- Records []struct {
- Name string `xml:"name"`
- Space string `xml:"space"`
- } `xml:"registry>registry>record"`
-}
-
-type canonDSCPRecord struct {
- OrigName string
- Name string
- Value int
-}
-
-func (drr *dscpRegistry) escape() []canonDSCPRecord {
- drs := make([]canonDSCPRecord, len(drr.Records))
- sr := strings.NewReplacer(
- "+", "",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, dr := range drr.Records {
- s := strings.TrimSpace(dr.Name)
- drs[i].OrigName = s
- drs[i].Name = sr.Replace(s)
- n, err := strconv.ParseUint(dr.Space, 2, 8)
- if err != nil {
- continue
- }
- drs[i].Value = int(n) << 2
- }
- return drs
-}
-
-func parseTOSTCByte(w io.Writer, r io.Reader) error {
- dec := xml.NewDecoder(r)
- var ttb tosTCByte
- if err := dec.Decode(&ttb); err != nil {
- return err
- }
- trs := ttb.escape()
- fmt.Fprintf(w, "// %s, Updated: %s\n", ttb.Title, ttb.Updated)
- fmt.Fprintf(w, "const (\n")
- for _, tr := range trs {
- fmt.Fprintf(w, "%s = %#x", tr.Keyword, tr.Value)
- fmt.Fprintf(w, "// %s\n", tr.OrigKeyword)
- }
- fmt.Fprintf(w, ")\n")
- return nil
-}
-
-type tosTCByte struct {
- XMLName xml.Name `xml:"registry"`
- Title string `xml:"title"`
- Updated string `xml:"updated"`
- Note string `xml:"note"`
- RegTitle string `xml:"registry>title"`
- Records []struct {
- Binary string `xml:"binary"`
- Keyword string `xml:"keyword"`
- } `xml:"registry>record"`
-}
-
-type canonTOSTCByteRecord struct {
- OrigKeyword string
- Keyword string
- Value int
-}
-
-func (ttb *tosTCByte) escape() []canonTOSTCByteRecord {
- trs := make([]canonTOSTCByteRecord, len(ttb.Records))
- sr := strings.NewReplacer(
- "Capable", "",
- "(", "",
- ")", "",
- "+", "",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, tr := range ttb.Records {
- s := strings.TrimSpace(tr.Keyword)
- trs[i].OrigKeyword = s
- ss := strings.Split(s, " ")
- if len(ss) > 1 {
- trs[i].Keyword = strings.Join(ss[1:], " ")
- } else {
- trs[i].Keyword = ss[0]
- }
- trs[i].Keyword = sr.Replace(trs[i].Keyword)
- n, err := strconv.ParseUint(tr.Binary, 2, 8)
- if err != nil {
- continue
- }
- trs[i].Value = int(n)
- }
- return trs
-}
-
-func parseProtocolNumbers(w io.Writer, r io.Reader) error {
- dec := xml.NewDecoder(r)
- var pn protocolNumbers
- if err := dec.Decode(&pn); err != nil {
- return err
- }
- prs := pn.escape()
- prs = append([]canonProtocolRecord{{
- Name: "IP",
- Descr: "IPv4 encapsulation, pseudo protocol number",
- Value: 0,
- }}, prs...)
- fmt.Fprintf(w, "// %s, Updated: %s\n", pn.Title, pn.Updated)
- fmt.Fprintf(w, "const (\n")
- for _, pr := range prs {
- if pr.Name == "" {
- continue
- }
- fmt.Fprintf(w, "Protocol%s = %d", pr.Name, pr.Value)
- s := pr.Descr
- if s == "" {
- s = pr.OrigName
- }
- fmt.Fprintf(w, "// %s\n", s)
- }
- fmt.Fprintf(w, ")\n")
- return nil
-}
-
-type protocolNumbers struct {
- XMLName xml.Name `xml:"registry"`
- Title string `xml:"title"`
- Updated string `xml:"updated"`
- RegTitle string `xml:"registry>title"`
- Note string `xml:"registry>note"`
- Records []struct {
- Value string `xml:"value"`
- Name string `xml:"name"`
- Descr string `xml:"description"`
- } `xml:"registry>record"`
-}
-
-type canonProtocolRecord struct {
- OrigName string
- Name string
- Descr string
- Value int
-}
-
-func (pn *protocolNumbers) escape() []canonProtocolRecord {
- prs := make([]canonProtocolRecord, len(pn.Records))
- sr := strings.NewReplacer(
- "-in-", "in",
- "-within-", "within",
- "-over-", "over",
- "+", "P",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, pr := range pn.Records {
- if strings.Contains(pr.Name, "Deprecated") ||
- strings.Contains(pr.Name, "deprecated") {
- continue
- }
- prs[i].OrigName = pr.Name
- s := strings.TrimSpace(pr.Name)
- switch pr.Name {
- case "ISIS over IPv4":
- prs[i].Name = "ISIS"
- case "manet":
- prs[i].Name = "MANET"
- default:
- prs[i].Name = sr.Replace(s)
- }
- ss := strings.Split(pr.Descr, "\n")
- for i := range ss {
- ss[i] = strings.TrimSpace(ss[i])
- }
- if len(ss) > 1 {
- prs[i].Descr = strings.Join(ss, " ")
- } else {
- prs[i].Descr = ss[0]
- }
- prs[i].Value, _ = strconv.Atoi(pr.Value)
- }
- return prs
-}