mirror of
https://github.com/wader/fq.git
synced 2024-11-23 09:56:07 +03:00
146 lines
8.5 KiB
Go
146 lines
8.5 KiB
Go
package inet
|
|
|
|
import "github.com/wader/fq/pkg/decode"
|
|
|
|
// based on etc/services from Darwin/FreeBSD
|
|
// cat /etc/protocols | grep -v '^#' | jq -rR 'capture("(?<name>[\\w\\d-]+)\\s+(?<nr>\\d+)\\s+.*#\\s+(?<desc>.*)") | "\(.nr): {Sym: \(.name|tojson), Description: \(.desc|tojson)},"'
|
|
|
|
var ipv4ProtocolMap = decode.UToScalar{
|
|
0: {Sym: "ip", Description: "internet protocol, pseudo protocol number"},
|
|
1: {Sym: "icmp", Description: "internet control message protocol"},
|
|
2: {Sym: "igmp", Description: "internet group management protocol"},
|
|
3: {Sym: "ggp", Description: "gateway-gateway protocol"},
|
|
4: {Sym: "ipencap", Description: "IP encapsulated in IP"},
|
|
5: {Sym: "st2", Description: "ST2 datagram mode"},
|
|
6: {Sym: "tcp", Description: "transmission control protocol"},
|
|
7: {Sym: "cbt"},
|
|
8: {Sym: "egp", Description: "exterior gateway protocol"},
|
|
9: {Sym: "igp", Description: "any private interior gateway"},
|
|
10: {Sym: "bbn-rcc", Description: "BBN RCC Monitoring"},
|
|
11: {Sym: "nvp", Description: "Network Voice Protocol"},
|
|
12: {Sym: "pup", Description: "PARC universal packet protocol"},
|
|
13: {Sym: "argus", Description: "ARGUS"},
|
|
14: {Sym: "emcon", Description: "EMCON"},
|
|
15: {Sym: "xnet", Description: "Cross Net Debugger"},
|
|
16: {Sym: "chaos", Description: "Chaos"},
|
|
17: {Sym: "udp", Description: "user datagram protocol"},
|
|
18: {Sym: "mux", Description: "Multiplexing protocol"},
|
|
19: {Sym: "dcn", Description: "DCN Measurement Subsystems"},
|
|
20: {Sym: "hmp", Description: "host monitoring protocol"},
|
|
21: {Sym: "prm", Description: "packet radio measurement protocol"},
|
|
22: {Sym: "xns-idp", Description: "Xerox NS IDP"},
|
|
23: {Sym: "trunk-1", Description: "Trunk-1"},
|
|
24: {Sym: "trunk-2", Description: "Trunk-2"},
|
|
25: {Sym: "leaf-1", Description: "Leaf-1"},
|
|
26: {Sym: "leaf-2", Description: "Leaf-2"},
|
|
27: {Sym: "rdp", Description: "reliable datagram protocol"},
|
|
28: {Sym: "irtp", Description: "Internet Reliable Transaction Protocol"},
|
|
29: {Sym: "iso-tp4", Description: "ISO Transport Protocol Class 4"},
|
|
30: {Sym: "netblt", Description: "Bulk Data Transfer Protocol"},
|
|
31: {Sym: "mfe-nsp", Description: "MFE Network Services Protocol"},
|
|
32: {Sym: "merit-inp", Description: "MERIT Internodal Protocol"},
|
|
33: {Sym: "dccp", Description: "Datagram Congestion Control Protocol"},
|
|
34: {Sym: "3pc", Description: "Third Party Connect Protocol"},
|
|
35: {Sym: "idpr", Description: "Inter-Domain Policy Routing Protocol"},
|
|
36: {Sym: "xtp", Description: "Xpress Tranfer Protocol"},
|
|
37: {Sym: "ddp", Description: "Datagram Delivery Protocol"},
|
|
38: {Sym: "idpr-cmtp", Description: "IDPR Control Message Transport Proto"},
|
|
40: {Sym: "il", Description: "IL Transport Protocol"},
|
|
41: {Sym: "ipv6", Description: "ipv6"},
|
|
42: {Sym: "sdrp", Description: "Source Demand Routing Protocol"},
|
|
43: {Sym: "ipv6-route", Description: "routing header for ipv6"},
|
|
44: {Sym: "ipv6-frag", Description: "fragment header for ipv6"},
|
|
45: {Sym: "idrp", Description: "Inter-Domain Routing Protocol"},
|
|
46: {Sym: "rsvp", Description: "Resource ReSerVation Protocol"},
|
|
47: {Sym: "gre", Description: "Generic Routing Encapsulation"},
|
|
48: {Sym: "dsr", Description: "Dynamic Source Routing Protocol"},
|
|
49: {Sym: "bna", Description: "BNA"},
|
|
50: {Sym: "esp", Description: "encapsulating security payload"},
|
|
51: {Sym: "ah", Description: "authentication header"},
|
|
52: {Sym: "i-nlsp", Description: "Integrated Net Layer Security TUBA"},
|
|
53: {Sym: "swipe", Description: "IP with Encryption"},
|
|
54: {Sym: "narp", Description: "NBMA Address Resolution Protocol"},
|
|
55: {Sym: "mobile", Description: "IP Mobility"},
|
|
56: {Sym: "tlsp", Description: "Transport Layer Security Protocol"},
|
|
57: {Sym: "skip", Description: "SKIP"},
|
|
58: {Sym: "ipv6-icmp", Description: "ICMP for IPv6"},
|
|
59: {Sym: "ipv6-nonxt", Description: "no next header for ipv6"},
|
|
60: {Sym: "ipv6-opts", Description: "destination options for ipv6"},
|
|
62: {Sym: "cftp", Description: "CFTP"},
|
|
64: {Sym: "sat-expak", Description: "SATNET and Backroom EXPAK"},
|
|
65: {Sym: "kryptolan", Description: "Kryptolan"},
|
|
66: {Sym: "rvd", Description: "MIT Remote Virtual Disk Protocol"},
|
|
67: {Sym: "ippc", Description: "Internet Pluribus Packet Core"},
|
|
69: {Sym: "sat-mon", Description: "SATNET Monitoring"},
|
|
70: {Sym: "visa", Description: "VISA Protocol"},
|
|
71: {Sym: "ipcv", Description: "Internet Packet Core Utility"},
|
|
72: {Sym: "cpnx", Description: "Computer Protocol Network Executive"},
|
|
73: {Sym: "cphb", Description: "Computer Protocol Heart Beat"},
|
|
74: {Sym: "wsn", Description: "Wang Span Network"},
|
|
75: {Sym: "pvp", Description: "Packet Video Protocol"},
|
|
76: {Sym: "br-sat-mon", Description: "Backroom SATNET Monitoring"},
|
|
77: {Sym: "sun-nd", Description: "SUN ND PROTOCOL-Temporary"},
|
|
78: {Sym: "wb-mon", Description: "WIDEBAND Monitoring"},
|
|
79: {Sym: "wb-expak", Description: "WIDEBAND EXPAK"},
|
|
80: {Sym: "iso-ip", Description: "ISO Internet Protocol"},
|
|
81: {Sym: "vmtp", Description: "Versatile Message Transport"},
|
|
82: {Sym: "secure-vmtp", Description: "SECURE-VMTP"},
|
|
83: {Sym: "vines", Description: "VINES"},
|
|
84: {Sym: "ttp", Description: "TTP"},
|
|
85: {Sym: "nsfnet-igp", Description: "NSFNET-IGP"},
|
|
86: {Sym: "dgp", Description: "Dissimilar Gateway Protocol"},
|
|
87: {Sym: "tcf", Description: "TCF"},
|
|
88: {Sym: "eigrp", Description: "Enhanced Interior Routing Protocol (Cisco)"},
|
|
89: {Sym: "ospf", Description: "Open Shortest Path First IGP"},
|
|
90: {Sym: "sprite-rpc", Description: "Sprite RPC Protocol"},
|
|
91: {Sym: "larp", Description: "Locus Address Resolution Protocol"},
|
|
92: {Sym: "mtp", Description: "Multicast Transport Protocol"},
|
|
93: {Sym: "25", Description: "AX.25 Frames"},
|
|
94: {Sym: "ipip", Description: "Yet Another IP encapsulation"},
|
|
95: {Sym: "micp", Description: "Mobile Internetworking Control Pro."},
|
|
96: {Sym: "scc-sp", Description: "Semaphore Communications Sec. Pro."},
|
|
97: {Sym: "etherip", Description: "Ethernet-within-IP Encapsulation"},
|
|
98: {Sym: "encap", Description: "Yet Another IP encapsulation"},
|
|
100: {Sym: "gmtp", Description: "GMTP"},
|
|
101: {Sym: "ifmp", Description: "Ipsilon Flow Management Protocol"},
|
|
102: {Sym: "pnni", Description: "PNNI over IP"},
|
|
103: {Sym: "pim", Description: "Protocol Independent Multicast"},
|
|
104: {Sym: "aris", Description: "ARIS"},
|
|
105: {Sym: "scps", Description: "SCPS"},
|
|
106: {Sym: "qnx", Description: "QNX"},
|
|
107: {Sym: "n", Description: "Active Networks"},
|
|
108: {Sym: "ipcomp", Description: "IP Payload Compression Protocol"},
|
|
109: {Sym: "snp", Description: "Sitara Networks Protocol"},
|
|
110: {Sym: "compaq-peer", Description: "Compaq Peer Protocol"},
|
|
111: {Sym: "ipx-in-ip", Description: "IPX in IP"},
|
|
112: {Sym: "carp", Description: "Common Address Redundancy Protocol"},
|
|
113: {Sym: "pgm", Description: "PGM Reliable Transport Protocol"},
|
|
115: {Sym: "l2tp", Description: "Layer Two Tunneling Protocol"},
|
|
116: {Sym: "ddx", Description: "D-II Data Exchange"},
|
|
117: {Sym: "iatp", Description: "Interactive Agent Transfer Protocol"},
|
|
118: {Sym: "stp", Description: "Schedule Transfer Protocol"},
|
|
119: {Sym: "srp", Description: "SpectraLink Radio Protocol"},
|
|
120: {Sym: "uti", Description: "UTI"},
|
|
121: {Sym: "smp", Description: "Simple Message Protocol"},
|
|
122: {Sym: "sm", Description: "SM"},
|
|
123: {Sym: "ptp", Description: "Performance Transparency Protocol"},
|
|
124: {Sym: "isis", Description: "ISIS over IPv4"},
|
|
126: {Sym: "crtp", Description: "Combat Radio Transport Protocol"},
|
|
127: {Sym: "crudp", Description: "Combat Radio User Datagram"},
|
|
130: {Sym: "sps", Description: "Secure Packet Shield"},
|
|
131: {Sym: "pipe", Description: "Private IP Encapsulation within IP"},
|
|
132: {Sym: "sctp", Description: "Stream Control Transmission Protocol"},
|
|
133: {Sym: "fc", Description: "Fibre Channel"},
|
|
134: {Sym: "rsvp-e2e-ignore", Description: "Aggregation of RSVP for IP reservations"},
|
|
135: {Sym: "mobility-header", Description: "Mobility Support in IPv6"},
|
|
136: {Sym: "udplite", Description: "The UDP-Lite Protocol"},
|
|
137: {Sym: "mpls-in-ip", Description: "Encapsulating MPLS in IP"},
|
|
138: {Sym: "manet", Description: "MANET Protocols (RFC5498)"},
|
|
139: {Sym: "hip", Description: "Host Identity Protocol (RFC5201)"},
|
|
140: {Sym: "shim6", Description: "Shim6 Protocol (RFC5533)"},
|
|
141: {Sym: "wesp", Description: "Wrapped Encapsulating Security Payload (RFC5840)"},
|
|
142: {Sym: "rohc", Description: "Robust Header Compression (RFC5858)"},
|
|
240: {Sym: "pfsync", Description: "PF Synchronization"},
|
|
258: {Sym: "divert", Description: "Divert pseudo-protocol [non IANA]"},
|
|
}
|