diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..9c0ba151 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/.idea +/build + +.DS_Store +/protologbeat +/protologbeat.test +protologbeat.local.yml +*.pyc diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..63a07012 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,43 @@ +sudo: required +dist: trusty +services: + - docker + +language: go + +go: + - 1.6 + +os: + - linux + - osx + +env: + matrix: + - TARGETS="check" + - TARGETS="testsuite" + + global: + # Cross-compile for amd64 only to speed up testing. + - GOX_FLAGS="-arch amd64" + +addons: + apt: + packages: + - python-virtualenv + +before_install: + # Redo the travis setup but with the elastic/libbeat path. This is needed so the package path is correct + - mkdir -p $HOME/gopath/src/github.com/harfordfive/protologbeat/ + - rsync -az ${TRAVIS_BUILD_DIR}/ $HOME/gopath/src/github.com/harfordfive/protologbeat/ + - export TRAVIS_BUILD_DIR=$HOME/gopath/src/github.com/harfordfive/protologbeat/ + - cd $HOME/gopath/src/github.com/harfordfive/protologbeat/ + +install: + - true + +script: + - make $TARGETS + +after_success: + # Copy full.cov to coverage.txt because codecov.io requires this file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..e69de29b diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..6222bd3e --- /dev/null +++ b/Makefile @@ -0,0 +1,46 @@ +BEATNAME=protologbeat +BEAT_DIR=github.com/harfordfive/protologbeat +SYSTEM_TESTS=false +TEST_ENVIRONMENT=false +ES_BEATS?=./vendor/github.com/elastic/beats +GOPACKAGES=$(shell glide novendor) +PREFIX?=. +NOTICE_FILE=NOTICE + +# Path to the libbeat Makefile +-include $(ES_BEATS)/libbeat/scripts/Makefile + +# Initial beat setup +.PHONY: setup +setup: copy-vendor + make update + +# Copy beats into vendor directory +.PHONY: copy-vendor +copy-vendor: + mkdir -p vendor/github.com/elastic/ + cp -R ${GOPATH}/src/github.com/elastic/beats vendor/github.com/elastic/ + rm -rf vendor/github.com/elastic/beats/.git + +.PHONY: git-init +git-init: + git init + git add README.md CONTRIBUTING.md + git commit -m "Initial commit" + git add LICENSE + git commit -m "Add the LICENSE" + git add .gitignore + git commit -m "Add git settings" + git add . + git reset -- .travis.yml + git commit -m "Add protologbeat" + git add .travis.yml + git commit -m "Add Travis CI" + +# This is called by the beats packer before building starts +.PHONY: before-build +before-build: + +# Collects all dependencies and then calls update +.PHONY: collect +collect: diff --git a/README.md b/README.md new file mode 100644 index 00000000..d9525743 --- /dev/null +++ b/README.md @@ -0,0 +1,159 @@ +# Protologbeat + +## Description + +This application is intended as a replacement for [udplogbeat](https://github.com/hartfordfive/udplogbeat). Although quite similar, it does have some improvements and allows you to start up via either UDP or TCP. It can act accept plain-text or JSON logs and also act as a syslog destination replacement. + +Ensure that this folder is at the following location: +`${GOPATH}/github.com/harfordfive` + +## Getting Started with Protologbeat + +### Configuration Options + +- `protologbeat.port` : The UDP port on which the process will listen (Default = 5000) +- `protologbeat.max_message_size` : The maximum accepted message size (Default = 4096) +- `protologbeat.json_mode`: Enable logging of only JSON formated messages (Default = false) +- `protolog.merge_fields_to_root` : When **json_mode** enabled, wether to merge parsed fields to the root level. (Default = false) +- `protologbeat.default_es_log_type`: Elasticsearch type to assign to an event if one isn't specified (Default: protologbeat) +- `protologbeat.enable_syslog_format_only` : Boolean value indicating if only syslog messages should be accepted. (Default = false) +- `protologbeat.enable_json_validation` : Boolean value indicating if JSON schema validation should be applied for `json` format messages (Default = false) +- `protologbeat.validate_all_json_types` : When json_mode enabled, indicates if ALL types must have a schema specified. Log entries with types that have no schema will not be published. (Default = false) +- `protologbeat.json_document_type_schema` : A hash consisting of the Elasticsearch type as the key, and the absolute local schema file path as the value. + +### Configuration Example + +The following are examples of configuration blocks for the `protologbeat` section. + +1. [Configuration](_sample/config1.yml) block for plain-text logging +2. [Configuration](_sample/config2.yml) block that enforces JSON schema only for indicated Elasticsearch types +3. [Configuration](_sample/config4.yml) block that enforces JSON schema for all Elasticsearch types +4. [Configuration](_sample/config3.yml) block for a syslog replacement, with custom ES type of 'myapp' + +JSON schemas can be automatically generated from an object here: http://jsonschema.net/. You can also view the [email_contact](_samples/email_contact.json) and [stock_item](_samples/stock_item.json) schemas as examples. + +#### Considerations + +- If you intend on using this as a drop-in replacement to logging with Rsyslog, this method will not persist your data to a file on disk. +- If protologbeat is down for any given reason, messages sent to the configured UDP port will never be processed or sent to your ELK cluster. +- If you need 100% guarantee each message will be delivered at least once, this may not be the best solution for you. +- If some potential loss of log events is acceptable for you, than this may be a reasonable solution for you. +- This application is intended for scenarios where your application can log to protologbeat running on the same physical host. It's discouraged to use this for cross-server/cross-region/cross-datacenter logging. +- The current date/time is automatically added to each log entry once it is received by protologbeat. +- Considering this could log data with any type of fields, it's suggested that you add your necessary field names and types to the [protologbeat.template-es2x.json](protologbeat.template-es2x.json) or [protologbeat.template.json](protologbeat.template.json) (*ES 5.x*) index templates. + +### Sample Clients + +Please see the `_samples/` directory for examples of clients in various languages. + + +### Requirements + +* [Golang](https://golang.org/dl/) 1.7 + +### Init Project +To get running with Protologbeat and also install the +dependencies, run the following command: + +``` +make setup +``` + +It will create a clean git history for each major step. Note that you can always rewrite the history if you wish before pushing your changes. + +To push Protologbeat in the git repository, run the following commands: + +``` +git remote set-url origin https://github.com/harfordfive/protologbeat +git push origin master +``` + +For further development, check out the [beat developer guide](https://www.elastic.co/guide/en/beats/libbeat/current/new-beat.html). + +### Build + +To build the binary for Protologbeat run the command below. This will generate a binary +in the same directory with the name protologbeat. + +``` +make +``` + + +### Run + +To run Protologbeat with debugging output enabled, run: + +``` +./protologbeat -c protologbeat.yml -e -d "*" +``` + + +### Test + +To test Protologbeat, run the following command: + +``` +make testsuite +``` + +alternatively: +``` +make unit-tests +make system-tests +make integration-tests +make coverage-report +``` + +The test coverage is reported in the folder `./build/coverage/` + +### Update + +Each beat has a template for the mapping in elasticsearch and a documentation for the fields +which is automatically generated based on `etc/fields.yml`. +To generate etc/protologbeat.template.json and etc/protologbeat.asciidoc + +``` +make update +``` + + +### Cleanup + +To clean Protologbeat source code, run the following commands: + +``` +make fmt +make simplify +``` + +To clean up the build directory and generated artifacts, run: + +``` +make clean +``` + + +### Clone + +To clone Protologbeat from the git repository, run the following commands: + +``` +mkdir -p ${GOPATH}/github.com/harfordfive +cd ${GOPATH}/github.com/harfordfive +git clone https://github.com/harfordfive/protologbeat +``` + + +For further development, check out the [beat developer guide](https://www.elastic.co/guide/en/beats/libbeat/current/new-beat.html). + + +## Packaging + +The beat frameworks provides tools to crosscompile and package your beat for different platforms. This requires [docker](https://www.docker.com/) and vendoring as described above. To build packages of your beat, run the following command: + +``` +make package +``` + +This will fetch and create all images required for the build process. The hole process to finish can take several minutes. diff --git a/_meta/beat.yml b/_meta/beat.yml new file mode 100644 index 00000000..9c3208f6 --- /dev/null +++ b/_meta/beat.yml @@ -0,0 +1,7 @@ +################### Protologbeat Configuration Example ######################### + +############################# Protologbeat ###################################### + +protologbeat: + # Defines how often an event is sent to the output + period: 1s diff --git a/_meta/fields.yml b/_meta/fields.yml new file mode 100644 index 00000000..dc6634f7 --- /dev/null +++ b/_meta/fields.yml @@ -0,0 +1,9 @@ +- key: protologbeat + title: protologbeat + description: + fields: + - name: counter + type: long + required: true + description: > + PLEASE UPDATE DOCUMENTATION diff --git a/_meta/kibana/index-pattern/protologbeat.json b/_meta/kibana/index-pattern/protologbeat.json new file mode 100644 index 00000000..95993133 --- /dev/null +++ b/_meta/kibana/index-pattern/protologbeat.json @@ -0,0 +1,6 @@ +{ + "fields": "[{\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"beat.name\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"beat.hostname\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"beat.version\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"@timestamp\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"date\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"tags\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"fields\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.provider\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.instance_id\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.machine_type\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.availability_zone\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.project_id\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.region\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"counter\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"number\", \"scripted\": false}]", + "fieldFormatMap": "{\"@timestamp\": {\"id\": \"date\"}}", + "timeFieldName": "@timestamp", + "title": "protologbeat-*" +} \ No newline at end of file diff --git a/_samples/config1.yml b/_samples/config1.yml new file mode 100644 index 00000000..8b4ef10e --- /dev/null +++ b/_samples/config1.yml @@ -0,0 +1,3 @@ +protologbeat: + port: 6000 + max_message_size: 4096 \ No newline at end of file diff --git a/_samples/config2.yml b/_samples/config2.yml new file mode 100644 index 00000000..4b63ebd2 --- /dev/null +++ b/_samples/config2.yml @@ -0,0 +1,9 @@ +protologbeat: + port: 6000 + max_message_size: 2048 + default_es_log_type: protologbeat + merge_fields_to_root: true + enable_json_validation: true + json_schema: + email_contact: "/etc/protologbeat/app1_schema.json" + stock_item: "/etc/protologbeat/app2_schema.json" \ No newline at end of file diff --git a/_samples/config3.yml b/_samples/config3.yml new file mode 100644 index 00000000..2857f095 --- /dev/null +++ b/_samples/config3.yml @@ -0,0 +1,5 @@ +protologbeat: + port: 6000 + max_message_size: 2048 + default_es_log_type: myapp + enable_syslog_format_only: true \ No newline at end of file diff --git a/_samples/config4.yml b/_samples/config4.yml new file mode 100644 index 00000000..50d6d680 --- /dev/null +++ b/_samples/config4.yml @@ -0,0 +1,10 @@ +protologbeat: + port: 6000 + max_message_size: 2048 + default_es_log_type: protologbeat + merge_fields_to_root: true + enable_json_validation: true + validate_all_json_types: true + json_schema: + email_contact: "/etc/protologbeat/app1_schema.json" + stock_item: "/etc/protologbeat/app2_schema.json" \ No newline at end of file diff --git a/_samples/email_contact.json b/_samples/email_contact.json new file mode 100644 index 00000000..e025fe3f --- /dev/null +++ b/_samples/email_contact.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "object", + "properties": { + "first": { + "type": "string" + }, + "last": { + "type": "string" + } + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/_samples/logger.lua b/_samples/logger.lua new file mode 100644 index 00000000..b8ed7a2b --- /dev/null +++ b/_samples/logger.lua @@ -0,0 +1,42 @@ +Logger = {} +Logger.__index = Logger + +function Logger.init(host,port,proto,format) + local sock = require("socket") + local json = require("cjson") + local lgr = {} -- our new object + setmetatable(lgr, Logger) -- make Account handle lookup + + if proto == "tcp" then + lgr.socket = sock.tcp() -- initialize our object + else + lgr.socket = sock.udp() + end + lgr.socket:settimeout(0) + lgr.host = host + lgr.port = port + if lgr.format == 'json' then + lgr.format = 'json' + else + lgr.format = 'plain' + end + return lgr +end + +function Logger:sendMsg(msg) + local payload + if self.format == 'json' then + payload = self.json.encode(msg) + else + payload = msg + end + self.socket:sendto(payload, self.host, self.port) +end + +-- Start logger client to send plain-text formated message to protologbeat listening on UDP host/port +logger = Logger.init('127.0.0.1', 6000, "udp", "plain") +logger:sendMsg('This is a sample message sent from the Lua logger.') + +-- Start logger client to send json formated message to protologbeat listening on TCP host/port +--logger = Logger.init('127.0.0.1', 6000, "tcp", "json") +--logger:sendMsg({type = 'lua_app_json', message = 'This is a sample message sent from the Lua logger.', log_level = 'INFO'}) diff --git a/_samples/logger.php b/_samples/logger.php new file mode 100644 index 00000000..a55f90f1 --- /dev/null +++ b/_samples/logger.php @@ -0,0 +1,77 @@ +socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP))) { + $errorcode = socket_last_error(); + $errormsg = socket_strerror($errorcode); + die("Couldn't create UDP socket: [$errorcode] $errormsg \n"); + } + $this->proto = 'udp'; + } else { + if(!($this->socket = socket_create(AF_INET, SOCK_STREAM, 0))) { + $errorcode = socket_last_error(); + $errormsg = socket_strerror($errorcode); + die("Couldn't create TCP socket: [$errorcode] $errormsg \n"); + } + $this->proto = 'tcp'; + $res = socket_connect($this->socket, $host, $port); + } + $this->host = $host; + $this->port = $port; + $this->format = ( in_array($format, ['plain','json']) ? $format : 'plain' ); + } + + public function setDebug() { + $this->debug = true; + } + + public function sendMsg($msg) { + $payload = ($this->format == 'json' ? json_encode($msg) : $msg); + if ($this->debug) { + echo sprintf("Logging msg via %s %s:%d: %s\n", strtoupper($this->proto), $this->host, $this->port, $payload); + } + if ($this->proto == 'udp') { + socket_sendto($this->socket, $payload, strlen($payload), 0, $this->host, $this->port); + } else { + socket_write($this->socket, $payload, strlen($payload)); + } + } + + public function __destruct() { + if ($this->debug) { + echo "Closing socket...\n"; + } + socket_close($this->socket); + } + } + + + # Start a logger to accept default plain text messages over UDP + $logger = new Logger('127.0.0.1', 6000); + //$logger->setDebug(); // Uncomment for debugging + $logger->sendMsg('This is a test plain text message from my test application'); + + # Start a logger to accept default plain text messages over TCP + /* + $logger = new Logger('127.0.0.1', 6000, 'tcp', 'json'); + //$logger->setDebug(); // Uncomment for debugging + $logger->sendMsg( + array( + 'type' => 'php_app_json', + 'message' => 'This is a test message from the PHP logger', + 'service' => 'payments', + 'log_level' => 'INFO' + ) + ); + */ +?> \ No newline at end of file diff --git a/_samples/logger.py b/_samples/logger.py new file mode 100644 index 00000000..f54db5ba --- /dev/null +++ b/_samples/logger.py @@ -0,0 +1,46 @@ + +import socket +import json + +''' +Sample logging client that writes to the local instance of protologbeat listening on the configured host/port/protocol. +''' + +class Logger: + + def __init__(self, host='127.0.0.1', port=5000, proto='udp', format='plain'): + self.host = host + self.port = port + if proto == 'udp': + self.proto = 'udp' + self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + else: + self.proto = 'tcp' + self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # TCP + self.format = format + if self.format not in ['plain','json']: + self.format = 'plain' + self.debug = False + print("Creating instance of logger via {} on {}:{}".format(self.proto, self.host, self.port)) + + def enable_debug(self): + self.debug = True + + def send_message(self, msg): + if self.format == 'json': + payload = json.dumps(msg) + else: + payload = msg + if self.debug: + print("Sending message: {}".format(payload.encode('utf-8'))) + self.socket.sendto(payload.encode('utf-8'), (self.host, self.port)) + + +# Initializing udp connection and sending a plaintext message +l = Logger('127.0.0.1', 6000) +l.enable_debug() +l.send_message('This is a sample plaintext message to be sent via udp') + +# Initializing tcp connection and sending a json-encoded message +#l = Logger('127.0.0.1', 6000, 'tcp', 'json') +#l.send_message({'message': 'This is a JSON encoded message', 'type': 'python_app_json', 'application': 'my_app', 'log_level': 'INFO'}) diff --git a/_samples/stock_item.json b/_samples/stock_item.json new file mode 100644 index 00000000..81388032 --- /dev/null +++ b/_samples/stock_item.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "item": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "price": { + "type": "integer" + }, + "stock_count": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/beater/protologbeat.go b/beater/protologbeat.go new file mode 100644 index 00000000..c4e75952 --- /dev/null +++ b/beater/protologbeat.go @@ -0,0 +1,76 @@ +package beater + +import ( + "fmt" + + "github.com/elastic/beats/libbeat/beat" + "github.com/elastic/beats/libbeat/common" + "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/libbeat/publisher" + + "github.com/hartfordfive/protologbeat/config" + "github.com/hartfordfive/protologbeat/protolog" +) + +type Protologbeat struct { + done chan struct{} + config config.Config + client publisher.Client + logListener *protolog.LogListener +} + +// Creates beater +func New(b *beat.Beat, cfg *common.Config) (beat.Beater, error) { + config := config.DefaultConfig + if err := cfg.Unpack(&config); err != nil { + return nil, fmt.Errorf("Error reading config file: %v", err) + } + + bt := &Protologbeat{ + done: make(chan struct{}), + config: config, + logListener: protolog.NewLogListener(config), + } + + return bt, nil +} + +func (bt *Protologbeat) Run(b *beat.Beat) error { + logp.Info("protologbeat is running! Hit CTRL-C to stop it.") + + bt.client = b.Publisher.Connect() + + logEntriesRecieved := make(chan common.MapStr, 100000) + logEntriesErrors := make(chan bool, 1) + + go func(logs chan common.MapStr, errs chan bool) { + bt.logListener.Start(logs, errs) + }(logEntriesRecieved, logEntriesErrors) + + var event common.MapStr + + for { + select { + case <-bt.done: + return nil + case <-logEntriesErrors: + return nil + case event = <-logEntriesRecieved: + if event == nil { + return nil + } + if _, ok := event["type"]; !ok { + event["type"] = bt.config.DefaultEsLogType + } + bt.client.PublishEvent(event) + logp.Info("Event sent") + } + } + +} + +func (bt *Protologbeat) Stop() { + bt.client.Close() + close(bt.done) + bt.logListener.Shutdown() +} diff --git a/build-bin.sh b/build-bin.sh new file mode 100755 index 00000000..a5c48a07 --- /dev/null +++ b/build-bin.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +if [ "$1" == "" ]; then + echo "Usage: ./build-bin [VERSION]" + exit 1 +fi + +BEAT_NAME="protologbeat" +VERSION=$1 +ARCH=amd64 + +for OS in linux darwin windows; do + echo "Building ${BEAT_NAME} v${VERSION} for ${OS}/${ARCH}..." + GOOS=$OS GOARCH=$ARCH go build -ldflags "-s -w -X main.build_date=`date +%Y-%m-%d` -X main.version=${VERSION} -X main.commit_hash=`git rev-parse --verify HEAD`" -o ${BEAT_NAME}-${VERSION}-${OS}-x86_64 + + zip ${BEAT_NAME}-${VERSION}-${OS}-x86_64.zip ${BEAT_NAME}-${VERSION}-${OS}-x86_64 && mv ${BEAT_NAME}-${VERSION}-${OS}-x86_64.zip bin/ + tar -cvzf ${BEAT_NAME}-${VERSION}-${OS}-x86_64.tar.gz ${BEAT_NAME}-${VERSION}-${OS}-x86_64 && mv ${BEAT_NAME}-${VERSION}-${OS}-x86_64.tar.gz bin/ + rm ${BEAT_NAME}-${VERSION}-${OS}-x86_64 +done + diff --git a/config/config.go b/config/config.go new file mode 100644 index 00000000..5276c0d3 --- /dev/null +++ b/config/config.go @@ -0,0 +1,37 @@ +// Config is put into a different package to prevent cyclic imports in case +// it is needed in several locations + +package config + +import "time" + +type Config struct { + Period time.Duration `config:"period"` + Address string `config:"address"` + Port int `config:"port"` + Protocol string `config:"protocol"` + MaxMsgSize int `config:"max_msg_size"` + JsonMode bool `config:"json_mode"` + DefaultEsLogType string `config:"default_es_log_type"` + MergeFieldsToRoot bool `config:"merge_fields_to_root"` + EnableSyslogFormatOnly bool `config:"enable_syslog_format_only"` + EnableJsonValidation bool `config:"enable_json_validation"` + ValidateAllJSONTypes bool `config:"validate_all_json_types"` + JsonSchema map[string]string `config:"json_schema"` + Debug bool `config:"debug"` +} + +var DefaultConfig = Config{ + Period: 5 * time.Second, + Address: "127.0.0.1", + Port: 5000, + Protocol: "udp", + MaxMsgSize: 4096, + JsonMode: false, + DefaultEsLogType: "protologbeat", + MergeFieldsToRoot: false, + EnableSyslogFormatOnly: false, + EnableJsonValidation: false, + ValidateAllJSONTypes: false, + Debug: false, +} diff --git a/config/config_test.go b/config/config_test.go new file mode 100644 index 00000000..d177de3a --- /dev/null +++ b/config/config_test.go @@ -0,0 +1,3 @@ +// +build !integration + +package config diff --git a/docs/fields.asciidoc b/docs/fields.asciidoc new file mode 100644 index 00000000..4e295c24 --- /dev/null +++ b/docs/fields.asciidoc @@ -0,0 +1,139 @@ + +//// +This file is generated! See _meta/fields.yml and scripts/generate_field_docs.py +//// + +[[exported-fields]] += Exported Fields + +[partintro] + +-- +This document describes the fields that are exported by Protologbeat. They are +grouped in the following categories: + +* <> +* <> +* <> + +-- +[[exported-fields-beat]] +== Beat Fields + +Contains common beat fields available in all event types. + + + +[float] +=== beat.name + +The name of the Beat sending the log messages. If the Beat name is set in the configuration file, then that value is used. If it is not set, the hostname is used. To set the Beat name, use the `name` option in the configuration file. + + +[float] +=== beat.hostname + +The hostname as returned by the operating system on which the Beat is running. + + +[float] +=== beat.version + +The version of the beat that generated this event. + + +[float] +=== @timestamp + +type: date + +example: August 26th 2016, 12:35:53.332 + +format: date + +required: True + +The timestamp when the event log record was generated. + + +[float] +=== tags + +Arbitrary tags that can be set per Beat and per transaction type. + + +[float] +=== fields + +type: dict + +Contains user configurable fields. + + +[[exported-fields-cloud]] +== Cloud Provider Metadata Fields + +Metadata from cloud providers added by the add_cloud_metadata processor. + + + +[float] +=== meta.cloud.provider + +example: ec2 + +Name of the cloud provider. Possible values are ec2, gce, or digitalocean. + + +[float] +=== meta.cloud.instance_id + +Instance ID of the host machine. + + +[float] +=== meta.cloud.machine_type + +example: t2.medium + +Machine type of the host machine. + + +[float] +=== meta.cloud.availability_zone + +example: us-east-1c + +Availability zone in which this host is running. + + +[float] +=== meta.cloud.project_id + +example: project-x + +Name of the project in Google Cloud. + + +[float] +=== meta.cloud.region + +Region in which this host is running. + + +[[exported-fields-protologbeat]] +== protologbeat Fields + +None + + +[float] +=== counter + +type: long + +required: True + +PLEASE UPDATE DOCUMENTATION + + diff --git a/docs/index.asciidoc b/docs/index.asciidoc new file mode 100644 index 00000000..83ca9411 --- /dev/null +++ b/docs/index.asciidoc @@ -0,0 +1,5 @@ += Protologbeat Docs + +Welcome to the Protologbeat documentation. + + diff --git a/main.go b/main.go new file mode 100644 index 00000000..01b427d2 --- /dev/null +++ b/main.go @@ -0,0 +1,16 @@ +package main + +import ( + "os" + + "github.com/elastic/beats/libbeat/beat" + + "github.com/hartfordfive/protologbeat/beater" +) + +func main() { + err := beat.Run("protologbeat", "", beater.New) + if err != nil { + os.Exit(1) + } +} diff --git a/main_test.go b/main_test.go new file mode 100644 index 00000000..751a9321 --- /dev/null +++ b/main_test.go @@ -0,0 +1,22 @@ +package main + +// This file is mandatory as otherwise the protologbeat.test binary is not generated correctly. + +import ( + "flag" + "testing" +) + +var systemTest *bool + +func init() { + systemTest = flag.Bool("systemTest", false, "Set to true when running system tests") +} + +// Test started when the test binary is started. Only calls main. +func TestSystem(t *testing.T) { + + if *systemTest { + main() + } +} diff --git a/protolog/loglistener.go b/protolog/loglistener.go new file mode 100644 index 00000000..deead53e --- /dev/null +++ b/protolog/loglistener.go @@ -0,0 +1,205 @@ +package protolog + +import ( + "fmt" + "net" + "strings" + "time" + + "github.com/elastic/beats/libbeat/common" + "github.com/elastic/beats/libbeat/logp" + + "github.com/hartfordfive/protologbeat/config" + "github.com/pquerna/ffjson/ffjson" + "github.com/xeipuuv/gojsonschema" +) + +type LogListener struct { + config config.Config + jsonSchema map[string]gojsonschema.JSONLoader + logEntriesRecieved chan common.MapStr + logEntriesError chan bool +} + +func NewLogListener(cfg config.Config) *LogListener { + ll := &LogListener{ + config: cfg, + } + if ll.config.EnableJsonValidation { + ll.jsonSchema = map[string]gojsonschema.JSONLoader{} + for name, path := range ll.config.JsonSchema { + logp.Info("Loading JSON schema %s from %s", name, path) + schemaLoader := gojsonschema.NewReferenceLoader("file://" + path) + ds := schemaLoader + ll.jsonSchema[name] = ds + } + } + return ll +} + +func (ll *LogListener) Start(logEntriesRecieved chan common.MapStr, logEntriesError chan bool) { + + ll.logEntriesRecieved = logEntriesRecieved + ll.logEntriesError = logEntriesError + + address := fmt.Sprintf("%s:%d", ll.config.Address, ll.config.Port) + + if ll.config.Protocol == "tcp" { + ll.startTCP(ll.config.Protocol, address) + } else { + ll.startUDP(ll.config.Protocol, address) + } + +} + +func (ll *LogListener) startTCP(proto string, address string) { + + l, err := net.Listen(proto, address) + + if err != nil { + logp.Err("Error listening on % socket via %s: %v", ll.config.Protocol, address, err.Error()) + ll.logEntriesError <- true + return + } + defer l.Close() + + logp.Info("Now listening for logs via %s on %s", ll.config.Protocol, address) + + for { + conn, err := l.Accept() + if err != nil { + logp.Err("Error accepting log event: %v", err.Error()) + continue + } + + go func() { + buffer := make([]byte, ll.config.MaxMsgSize) + length, err := conn.Read(buffer) + if err != nil { + e, ok := err.(net.Error) + if ok && e.Timeout() { + logp.Err("Timeout reading from socket: %v", err) + ll.logEntriesError <- true + return + } + } + go ll.processMessage(buffer, length) + }() + } +} + +func (ll *LogListener) startUDP(proto string, address string) { + l, err := net.ListenPacket(proto, address) + + if err != nil { + logp.Err("Error listening on % socket via %s: %v", ll.config.Protocol, address, err.Error()) + ll.logEntriesError <- true + return + } + defer l.Close() + + logp.Info("Now listening for logs via %s on %s", ll.config.Protocol, address) + buffer := make([]byte, ll.config.MaxMsgSize) + + for { + length, _, err := l.ReadFrom(buffer) + if err != nil { + logp.Err("Error reading from buffer: %v", err.Error()) + continue + } + go ll.processMessage(buffer, length) + } +} + +func (ll *LogListener) Shutdown() { + close(ll.logEntriesError) + close(ll.logEntriesRecieved) +} + +func (ll *LogListener) processMessage(buffer []byte, length int) { + + if length == 0 { + return + } + + logData := strings.TrimSpace(string(buffer[:length])) + if logData == "" { + logp.Err("Event is empty") + return + } + event := common.MapStr{} + + if ll.config.EnableSyslogFormatOnly { + msg, facility, severity, err := GetSyslogMsgDetails(logData) + if err == nil { + event["facility"] = facility + event["severity"] = severity + event["message"] = msg + } + } else if ll.config.JsonMode { + if ll.config.MergeFieldsToRoot { + if err := ffjson.Unmarshal([]byte(logData), &event); err != nil { + logp.Err("Could not parse JSON: %v", err) + event["message"] = logData + event["tags"] = []string{"_protologbeat_json_parse_failure"} + goto PreSend + } + } else { + event = common.MapStr{} + nestedData := common.MapStr{} + if err := ffjson.Unmarshal([]byte(logData), &nestedData); err != nil { + logp.Err("Could not parse JSON: %v", err) + event["message"] = logData + event["tags"] = []string{"_protologbeat_json_parse_failure"} + goto PreSend + } else { + event["log"] = nestedData + } + } + + schemaSet := false + hasType := false + if _, ok := event["type"]; ok { + hasType = true + } + + if hasType { + _, schemaSet = ll.jsonSchema[event["type"].(string)] + } + + if ll.config.ValidateAllJSONTypes && !schemaSet { + if ll.config.Debug && hasType { + logp.Err("Log entry of type '%s' has no JSON schema set.", event["type"].(string)) + } else if ll.config.Debug { + logp.Err("Log entry has no type.") + } + return + } + + if ll.config.EnableJsonValidation && schemaSet { + + result, err := gojsonschema.Validate(ll.jsonSchema[event["type"].(string)], gojsonschema.NewStringLoader(logData)) + if err != nil { + if ll.config.Debug { + logp.Err("Error with JSON object: %s", err.Error()) + } + return + } + + if !result.Valid() { + if ll.config.Debug { + logp.Err("Log entry does not match specified schema for type '%s'. (Note: ensure you have 'type' field (string) at the root level in your schema)", event["type"].(string)) + } + return + } + } + + } else { + event["message"] = logData + } + +PreSend: + event["@timestamp"] = common.Time(time.Now()) + + ll.logEntriesRecieved <- event +} diff --git a/protolog/syslog.go b/protolog/syslog.go new file mode 100644 index 00000000..c011d18a --- /dev/null +++ b/protolog/syslog.go @@ -0,0 +1,111 @@ +package protolog + +import ( + "errors" + "math" + "regexp" + "strconv" +) + +const ( + SyslogFacilityKernel = iota + SyslogFacilityUser + SyslogFacilityMail + SyslogFacilitySystemDaemons + SyslogFacilitySecurityAuth + SyslogFacilityInternalSyslogd + SyslogFacilityLinePrinter + SyslogFacilityNetworkNews + SyslogFacilityUUCP + SyslogFacilityClockDaemon + SyslogFacilitySecurityAuth2 + SyslogFacilityFTP + SyslogFacilityNTP + SyslogFacilityLogAudit + SyslogFacilityLogAlert + SyslogFacilityClockDaemon2 + SyslogFacilityLocal0 + SyslogFacilityLocal1 + SyslogFacilityLocal2 + SyslogFacilityLocal3 + SyslogFacilityLocal4 + SyslogFacilityLocal5 + SyslogFacilityLocal6 + SyslogFacilityLocal7 +) + +const ( + SyslogSeverityEmergency = iota + SyslogSeverityAlert + SyslogSeverityCritical + SyslogSeverityError + SyslogSeverityWarning + SyslogSeverityNotice + SyslogSeverityInformational + SyslogSeverityDebug +) + +// SyslogFacilityString is a map containing the textual equivalence of a given facility number +var SyslogFacilityString = map[int]string{ + SyslogFacilityKernel: "kernel", + SyslogFacilityUser: "user", + SyslogFacilityMail: "mail", + SyslogFacilitySystemDaemons: "system daemons", + SyslogFacilitySecurityAuth: "security/auth", + SyslogFacilityInternalSyslogd: "internal syslogd", + SyslogFacilityLinePrinter: "line printer", + SyslogFacilityNetworkNews: "network news", + SyslogFacilityUUCP: "uucp", + SyslogFacilityClockDaemon: "clock daemon", + SyslogFacilitySecurityAuth2: "security/auth", + SyslogFacilityFTP: "ftp", + SyslogFacilityNTP: "ntp", + SyslogFacilityLogAudit: "log audit", + SyslogFacilityLogAlert: "log alert", + SyslogFacilityClockDaemon2: "clock daemon", + SyslogFacilityLocal0: "local0", + SyslogFacilityLocal1: "local1", + SyslogFacilityLocal2: "local2", + SyslogFacilityLocal3: "local3", + SyslogFacilityLocal4: "local4", + SyslogFacilityLocal5: "local5", + SyslogFacilityLocal6: "local6", + SyslogFacilityLocal7: "local7", +} + +// SyslogSeverityString is a map containing the textual equivalence of a given severity number +var SyslogSeverityString = map[int]string{ + SyslogSeverityEmergency: "emergency", + SyslogSeverityAlert: "alert", + SyslogSeverityCritical: "critical", + SyslogSeverityError: "error", + SyslogSeverityWarning: "warning", + SyslogSeverityNotice: "notice", + SyslogSeverityInformational: "informational", + SyslogSeverityDebug: "debug", +} + +/* + The Priority value is calculated by first multiplying the Facility + number by 8 and then adding the numerical value of the Severity. + + Source: https://tools.ietf.org/html/rfc5424 [Page 10] +*/ + +// GetSyslogMsgDetails returns the facility and severity of a valid syslog message +func GetSyslogMsgDetails(syslogMsg string) (string, string, string, error) { + + re := regexp.MustCompile(`^<([0-9]{1,3})>(.*)`) + matches := re.FindStringSubmatch(syslogMsg) + if len(matches) < 3 { + return "", "", "", errors.New("Could not extract syslog priority from message") + } + priorityNum, err := strconv.Atoi(matches[1]) + if err != nil { + return "", "", "", nil + } + severity := int(math.Mod(float64(priorityNum), 8.0)) + facility := (priorityNum - severity) / 8 + return matches[2], SyslogFacilityString[facility], SyslogSeverityString[severity], nil + +} diff --git a/protologbeat.full.yml b/protologbeat.full.yml new file mode 100644 index 00000000..eac755a8 --- /dev/null +++ b/protologbeat.full.yml @@ -0,0 +1,631 @@ +################### Protologbeat Configuration Example ######################### + +############################# Protologbeat ###################################### + +protologbeat: + # Address on which the process will listen + address: "127.0.0.1" + + # Port on which the process will listen + #port: 5000 + + # Protocol on which to listen + #protocol: udp + + # Maxium message size in bytes + #max_msg_size: 4096 + + # Enable accepting on JSON formated messages + #json_mode: true + + # Default elasticsearch type to use if no type is present in the message + #default_es_log_type: protologbeat + + # Wether to place the parsed json data at the root level or nested in a 'log' object + #merge_fields_to_root: true + + # Set process to only act as a syslog message reciever + #enable_syslog_format_only: true + + # Enable json validation with schemas + #enable_json_validation: false + + # Enforce json validation for ALL types being logged + #validate_all_json_types: false + + # List of elasticsarch types and their json schema + #json_schema: + # email_contact: "/path/to/schema1.json" + # stock_item: "/path/to/schema2.json" + + # Enable additional debugging messages + #debug: true + +#================================ General ====================================== + +# The name of the shipper that publishes the network data. It can be used to group +# all the transactions sent by a single shipper in the web interface. +# If this options is not defined, the hostname is used. +#name: + +# The tags of the shipper are included in their own field with each +# transaction published. Tags make it easy to group servers by different +# logical properties. +#tags: ["service-X", "web-tier"] + +# Optional fields that you can specify to add additional information to the +# output. Fields can be scalar values, arrays, dictionaries, or any nested +# combination of these. +#fields: +# env: staging + +# If this option is set to true, the custom fields are stored as top-level +# fields in the output document instead of being grouped under a fields +# sub-dictionary. Default is false. +#fields_under_root: false + +# Internal queue size for single events in processing pipeline +#queue_size: 1000 + +# The internal queue size for bulk events in the processing pipeline. +# Do not modify this value. +#bulk_queue_size: 0 + +# Sets the maximum number of CPUs that can be executing simultaneously. The +# default is the number of logical CPUs available in the system. +#max_procs: + +#================================ Processors =================================== + +# Processors are used to reduce the number of fields in the exported event or to +# enhance the event with external metadata. This section defines a list of +# processors that are applied one by one and the first one receives the initial +# event: +# +# event -> filter1 -> event1 -> filter2 ->event2 ... +# +# The supported processors are drop_fields, drop_event, include_fields, and +# add_cloud_metadata. +# +# For example, you can use the following processors to keep the fields that +# contain CPU load percentages, but remove the fields that contain CPU ticks +# values: +# +#processors: +#- include_fields: +# fields: ["cpu"] +#- drop_fields: +# fields: ["cpu.user", "cpu.system"] +# +# The following example drops the events that have the HTTP response code 200: +# +#processors: +#- drop_event: +# when: +# equals: +# http.code: 200 +# +# The following example enriches each event with metadata from the cloud +# provider about the host machine. It works on EC2, GCE, and DigitalOcean. +# +#processors: +#- add_cloud_metadata: +# + +#================================ Outputs ====================================== + +# Configure what outputs to use when sending the data collected by the beat. +# Multiple outputs may be used. + +#-------------------------- Elasticsearch output ------------------------------- +output.elasticsearch: + # Boolean flag to enable or disable the output module. + #enabled: true + + # Array of hosts to connect to. + # Scheme and port can be left out and will be set to the default (http and 9200) + # In case you specify and additional path, the scheme is required: http://localhost:9200/path + # IPv6 addresses should always be defined as: https://[2001:db8::1]:9200 + hosts: ["localhost:9200"] + + # Set gzip compression level. + #compression_level: 0 + + # Optional protocol and basic auth credentials. + #protocol: "https" + #username: "elastic" + #password: "changeme" + + # Dictionary of HTTP parameters to pass within the url with index operations. + #parameters: + #param1: value1 + #param2: value2 + + # Number of workers per Elasticsearch host. + #worker: 1 + + # Optional index name. The default is "protologbeat" plus date + # and generates [protologbeat-]YYYY.MM.DD keys. + #index: "protologbeat-%{+yyyy.MM.dd}" + + # Optional ingest node pipeline. By default no pipeline will be used. + #pipeline: "" + + # Optional HTTP Path + #path: "/elasticsearch" + + # Proxy server url + #proxy_url: http://proxy:3128 + + # The number of times a particular Elasticsearch index operation is attempted. If + # the indexing operation doesn't succeed after this many retries, the events are + # dropped. The default is 3. + #max_retries: 3 + + # The maximum number of events to bulk in a single Elasticsearch bulk API index request. + # The default is 50. + #bulk_max_size: 50 + + # Configure http request timeout before failing an request to Elasticsearch. + #timeout: 90 + + # The number of seconds to wait for new events between two bulk API index requests. + # If `bulk_max_size` is reached before this interval expires, addition bulk index + # requests are made. + #flush_interval: 1s + + # A template is used to set the mapping in Elasticsearch + # By default template loading is enabled and the template is loaded. + # These settings can be adjusted to load your own template or overwrite existing ones. + + # Set to false to disable template loading. + #template.enabled: true + + # Template name. By default the template name is protologbeat. + #template.name: "protologbeat" + + # Path to template file + #template.path: "${path.config}/protologbeat.template.json" + + # Overwrite existing template + #template.overwrite: false + + # If set to true, protologbeat checks the Elasticsearch version at connect time, and if it + # is 2.x, it loads the file specified by the template.versions.2x.path setting. The + # default is true. + #template.versions.2x.enabled: true + + # Path to the Elasticsearch 2.x version of the template file. + #template.versions.2x.path: "${path.config}/protologbeat.template-es2x.json" + + # Use SSL settings for HTTPS. Default is true. + #ssl.enabled: true + + # Configure SSL verification mode. If `none` is configured, all server hosts + # and certificates will be accepted. In this mode, SSL based connections are + # susceptible to man-in-the-middle attacks. Use only for testing. Default is + # `full`. + #ssl.verification_mode: full + + # List of supported/valid TLS versions. By default all TLS versions 1.0 up to + # 1.2 are enabled. + #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2] + + # SSL configuration. By default is off. + # List of root certificates for HTTPS server verifications + #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"] + + # Certificate for SSL client authentication + #ssl.certificate: "/etc/pki/client/cert.pem" + + # Client Certificate Key + #ssl.key: "/etc/pki/client/cert.key" + + # Optional passphrase for decrypting the Certificate Key. + #ssl.key_passphrase: '' + + # Configure cipher suites to be used for SSL connections + #ssl.cipher_suites: [] + + # Configure curve types for ECDHE based cipher suites + #ssl.curve_types: [] + + +#----------------------------- Logstash output --------------------------------- +#output.logstash: + # Boolean flag to enable or disable the output module. + #enabled: true + + # The Logstash hosts + #hosts: ["localhost:5044"] + + # Number of workers per Logstash host. + #worker: 1 + + # Set gzip compression level. + #compression_level: 3 + + # Optional load balance the events between the Logstash hosts + #loadbalance: true + + # Number of batches to be send asynchronously to logstash while processing + # new batches. + #pipelining: 0 + + # Optional index name. The default index name is set to name of the beat + # in all lowercase. + #index: 'protologbeat' + + # SOCKS5 proxy server URL + #proxy_url: socks5://user:password@socks5-server:2233 + + # Resolve names locally when using a proxy server. Defaults to false. + #proxy_use_local_resolver: false + + # Enable SSL support. SSL is automatically enabled, if any SSL setting is set. + #ssl.enabled: true + + # Configure SSL verification mode. If `none` is configured, all server hosts + # and certificates will be accepted. In this mode, SSL based connections are + # susceptible to man-in-the-middle attacks. Use only for testing. Default is + # `full`. + #ssl.verification_mode: full + + # List of supported/valid TLS versions. By default all TLS versions 1.0 up to + # 1.2 are enabled. + #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2] + + # Optional SSL configuration options. SSL is off by default. + # List of root certificates for HTTPS server verifications + #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"] + + # Certificate for SSL client authentication + #ssl.certificate: "/etc/pki/client/cert.pem" + + # Client Certificate Key + #ssl.key: "/etc/pki/client/cert.key" + + # Optional passphrase for decrypting the Certificate Key. + #ssl.key_passphrase: '' + + # Configure cipher suites to be used for SSL connections + #ssl.cipher_suites: [] + + # Configure curve types for ECDHE based cipher suites + #ssl.curve_types: [] + +#------------------------------- Kafka output ---------------------------------- +#output.kafka: + # Boolean flag to enable or disable the output module. + #enabled: true + + # The list of Kafka broker addresses from where to fetch the cluster metadata. + # The cluster metadata contain the actual Kafka brokers events are published + # to. + #hosts: ["localhost:9092"] + + # The Kafka topic used for produced events. The setting can be a format string + # using any event field. To set the topic from document type use `%{[type]}`. + #topic: beats + + # The Kafka event key setting. Use format string to create unique event key. + # By default no event key will be generated. + #key: '' + + # The Kafka event partitioning strategy. Default hashing strategy is `hash` + # using the `output.kafka.key` setting or randomly distributes events if + # `output.kafka.key` is not configured. + #partition.hash: + # If enabled, events will only be published to partitions with reachable + # leaders. Default is false. + #reachable_only: false + + # Configure alternative event field names used to compute the hash value. + # If empty `output.kafka.key` setting will be used. + # Default value is empty list. + #hash: [] + + # Authentication details. Password is required if username is set. + #username: '' + #password: '' + + # Kafka version protologbeat is assumed to run against. Defaults to the oldest + # supported stable version (currently version 0.8.2.0) + #version: 0.8.2 + + # Metadata update configuration. Metadata do contain leader information + # deciding which broker to use when publishing. + #metadata: + # Max metadata request retry attempts when cluster is in middle of leader + # election. Defaults to 3 retries. + #retry.max: 3 + + # Waiting time between retries during leader elections. Default is 250ms. + #retry.backoff: 250ms + + # Refresh metadata interval. Defaults to every 10 minutes. + #refresh_frequency: 10m + + # The number of concurrent load-balanced Kafka output workers. + #worker: 1 + + # The number of times to retry publishing an event after a publishing failure. + # After the specified number of retries, the events are typically dropped. + # Some Beats, such as Filebeat, ignore the max_retries setting and retry until + # all events are published. Set max_retries to a value less than 0 to retry + # until all events are published. The default is 3. + #max_retries: 3 + + # The maximum number of events to bulk in a single Kafka request. The default + # is 2048. + #bulk_max_size: 2048 + + # The number of seconds to wait for responses from the Kafka brokers before + # timing out. The default is 30s. + #timeout: 30s + + # The maximum duration a broker will wait for number of required ACKs. The + # default is 10s. + #broker_timeout: 10s + + # The number of messages buffered for each Kafka broker. The default is 256. + #channel_buffer_size: 256 + + # The keep-alive period for an active network connection. If 0s, keep-alives + # are disabled. The default is 0 seconds. + #keep_alive: 0 + + # Sets the output compression codec. Must be one of none, snappy and gzip. The + # default is gzip. + #compression: gzip + + # The maximum permitted size of JSON-encoded messages. Bigger messages will be + # dropped. The default value is 1000000 (bytes). This value should be equal to + # or less than the broker's message.max.bytes. + #max_message_bytes: 1000000 + + # The ACK reliability level required from broker. 0=no response, 1=wait for + # local commit, -1=wait for all replicas to commit. The default is 1. Note: + # If set to 0, no ACKs are returned by Kafka. Messages might be lost silently + # on error. + #required_acks: 1 + + # The number of seconds to wait for new events between two producer API calls. + #flush_interval: 1s + + # The configurable ClientID used for logging, debugging, and auditing + # purposes. The default is "beats". + #client_id: beats + + # Enable SSL support. SSL is automatically enabled, if any SSL setting is set. + #ssl.enabled: true + + # Optional SSL configuration options. SSL is off by default. + # List of root certificates for HTTPS server verifications + #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"] + + # Configure SSL verification mode. If `none` is configured, all server hosts + # and certificates will be accepted. In this mode, SSL based connections are + # susceptible to man-in-the-middle attacks. Use only for testing. Default is + # `full`. + #ssl.verification_mode: full + + # List of supported/valid TLS versions. By default all TLS versions 1.0 up to + # 1.2 are enabled. + #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2] + + # Certificate for SSL client authentication + #ssl.certificate: "/etc/pki/client/cert.pem" + + # Client Certificate Key + #ssl.key: "/etc/pki/client/cert.key" + + # Optional passphrase for decrypting the Certificate Key. + #ssl.key_passphrase: '' + + # Configure cipher suites to be used for SSL connections + #ssl.cipher_suites: [] + + # Configure curve types for ECDHE based cipher suites + #ssl.curve_types: [] + +#------------------------------- Redis output ---------------------------------- +#output.redis: + # Boolean flag to enable or disable the output module. + #enabled: true + + # The list of Redis servers to connect to. If load balancing is enabled, the + # events are distributed to the servers in the list. If one server becomes + # unreachable, the events are distributed to the reachable servers only. + #hosts: ["localhost:6379"] + + # The Redis port to use if hosts does not contain a port number. The default + # is 6379. + #port: 6379 + + # The name of the Redis list or channel the events are published to. The + # default is protologbeat. + #key: protologbeat + + # The password to authenticate with. The default is no authentication. + #password: + + # The Redis database number where the events are published. The default is 0. + #db: 0 + + # The Redis data type to use for publishing events. If the data type is list, + # the Redis RPUSH command is used. If the data type is channel, the Redis + # PUBLISH command is used. The default value is list. + #datatype: list + + # The number of workers to use for each host configured to publish events to + # Redis. Use this setting along with the loadbalance option. For example, if + # you have 2 hosts and 3 workers, in total 6 workers are started (3 for each + # host). + #worker: 1 + + # If set to true and multiple hosts or workers are configured, the output + # plugin load balances published events onto all Redis hosts. If set to false, + # the output plugin sends all events to only one host (determined at random) + # and will switch to another host if the currently selected one becomes + # unreachable. The default value is true. + #loadbalance: true + + # The Redis connection timeout in seconds. The default is 5 seconds. + #timeout: 5s + + # The number of times to retry publishing an event after a publishing failure. + # After the specified number of retries, the events are typically dropped. + # Some Beats, such as Filebeat, ignore the max_retries setting and retry until + # all events are published. Set max_retries to a value less than 0 to retry + # until all events are published. The default is 3. + #max_retries: 3 + + # The maximum number of events to bulk in a single Redis request or pipeline. + # The default is 2048. + #bulk_max_size: 2048 + + # The URL of the SOCKS5 proxy to use when connecting to the Redis servers. The + # value must be a URL with a scheme of socks5://. + #proxy_url: + + # This option determines whether Redis hostnames are resolved locally when + # using a proxy. The default value is false, which means that name resolution + # occurs on the proxy server. + #proxy_use_local_resolver: false + + # Enable SSL support. SSL is automatically enabled, if any SSL setting is set. + #ssl.enabled: true + + # Configure SSL verification mode. If `none` is configured, all server hosts + # and certificates will be accepted. In this mode, SSL based connections are + # susceptible to man-in-the-middle attacks. Use only for testing. Default is + # `full`. + #ssl.verification_mode: full + + # List of supported/valid TLS versions. By default all TLS versions 1.0 up to + # 1.2 are enabled. + #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2] + + # Optional SSL configuration options. SSL is off by default. + # List of root certificates for HTTPS server verifications + #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"] + + # Certificate for SSL client authentication + #ssl.certificate: "/etc/pki/client/cert.pem" + + # Client Certificate Key + #ssl.key: "/etc/pki/client/cert.key" + + # Optional passphrase for decrypting the Certificate Key. + #ssl.key_passphrase: '' + + # Configure cipher suites to be used for SSL connections + #ssl.cipher_suites: [] + + # Configure curve types for ECDHE based cipher suites + #ssl.curve_types: [] + + +#------------------------------- File output ----------------------------------- +#output.file: + # Boolean flag to enable or disable the output module. + #enabled: true + + # Path to the directory where to save the generated files. The option is + # mandatory. + #path: "/tmp/protologbeat" + + # Name of the generated files. The default is `protologbeat` and it generates + # files: `protologbeat`, `protologbeat.1`, `protologbeat.2`, etc. + #filename: protologbeat + + # Maximum size in kilobytes of each file. When this size is reached, and on + # every protologbeat restart, the files are rotated. The default value is 10240 + # kB. + #rotate_every_kb: 10000 + + # Maximum number of files under path. When this number of files is reached, + # the oldest file is deleted and the rest are shifted from last to first. The + # default is 7 files. + #number_of_files: 7 + + +#----------------------------- Console output --------------------------------- +#output.console: + # Boolean flag to enable or disable the output module. + #enabled: true + + # Pretty print json event + #pretty: false + +#================================= Paths ====================================== + +# The home path for the protologbeat installation. This is the default base path +# for all other path settings and for miscellaneous files that come with the +# distribution (for example, the sample dashboards). +# If not set by a CLI flag or in the configuration file, the default for the +# home path is the location of the binary. +#path.home: + +# The configuration path for the protologbeat installation. This is the default +# base path for configuration files, including the main YAML configuration file +# and the Elasticsearch template file. If not set by a CLI flag or in the +# configuration file, the default for the configuration path is the home path. +#path.config: ${path.home} + +# The data path for the protologbeat installation. This is the default base path +# for all the files in which protologbeat needs to store its data. If not set by a +# CLI flag or in the configuration file, the default for the data path is a data +# subdirectory inside the home path. +#path.data: ${path.home}/data + +# The logs path for a protologbeat installation. This is the default location for +# the Beat's log files. If not set by a CLI flag or in the configuration file, +# the default for the logs path is a logs subdirectory inside the home path. +#path.logs: ${path.home}/logs + +#================================ Logging ====================================== +# There are three options for the log output: syslog, file, stderr. +# Under Windows systems, the log files are per default sent to the file output, +# under all other system per default to syslog. + +# Sets log level. The default log level is info. +# Available log levels are: critical, error, warning, info, debug +#logging.level: info + +# Enable debug output for selected components. To enable all selectors use ["*"] +# Other available selectors are "beat", "publish", "service" +# Multiple selectors can be chained. +#logging.selectors: [ ] + +# Send all logging output to syslog. The default is false. +#logging.to_syslog: true + +# If enabled, protologbeat periodically logs its internal metrics that have changed +# in the last period. For each metric that changed, the delta from the value at +# the beginning of the period is logged. Also, the total values for +# all non-zero internal metrics are logged on shutdown. The default is true. +#logging.metrics.enabled: true + +# The period after which to log the internal metrics. The default is 30s. +#logging.metrics.period: 30s + +# Logging to rotating files files. Set logging.to_files to false to disable logging to +# files. +logging.to_files: true +logging.files: + # Configure the path where the logs are written. The default is the logs directory + # under the home path (the binary location). + #path: /var/log/protologbeat + + # The name of the files where the logs are written to. + #name: protologbeat + + # Configure log file size limit. If limit is reached, log file will be + # automatically rotated + #rotateeverybytes: 10485760 # = 10MB + + # Number of rotated log files to keep. Oldest files will be deleted first. + #keepfiles: 7 + diff --git a/protologbeat.template-es2x.json b/protologbeat.template-es2x.json new file mode 100644 index 00000000..fc15a995 --- /dev/null +++ b/protologbeat.template-es2x.json @@ -0,0 +1,101 @@ +{ + "mappings": { + "_default_": { + "_all": { + "norms": { + "enabled": false + } + }, + "_meta": { + "version": "5.2.3" + }, + "dynamic_templates": [ + { + "strings_as_keyword": { + "mapping": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "@timestamp": { + "type": "date" + }, + "beat": { + "properties": { + "hostname": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + }, + "name": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + }, + "version": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + } + } + }, + "counter": { + "type": "long" + }, + "meta": { + "properties": { + "cloud": { + "properties": { + "availability_zone": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + }, + "instance_id": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + }, + "machine_type": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + }, + "project_id": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + }, + "provider": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + }, + "region": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + } + } + } + } + }, + "tags": { + "ignore_above": 1024, + "index": "not_analyzed", + "type": "string" + } + } + } + }, + "order": 0, + "settings": { + "index.refresh_interval": "5s" + }, + "template": "protologbeat-*" +} \ No newline at end of file diff --git a/protologbeat.template.json b/protologbeat.template.json new file mode 100644 index 00000000..81b1e28a --- /dev/null +++ b/protologbeat.template.json @@ -0,0 +1,86 @@ +{ + "mappings": { + "_default_": { + "_all": { + "norms": false + }, + "_meta": { + "version": "5.2.3" + }, + "dynamic_templates": [ + { + "strings_as_keyword": { + "mapping": { + "ignore_above": 1024, + "type": "keyword" + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "@timestamp": { + "type": "date" + }, + "beat": { + "properties": { + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "meta": { + "properties": { + "cloud": { + "properties": { + "availability_zone": { + "ignore_above": 1024, + "type": "keyword" + }, + "instance_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "machine_type": { + "ignore_above": 1024, + "type": "keyword" + }, + "project_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "provider": { + "ignore_above": 1024, + "type": "keyword" + }, + "region": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "tags": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + }, + "order": 0, + "settings": { + "index.mapping.total_fields.limit": 10000, + "index.refresh_interval": "5s" + }, + "template": "protologbeat-*" +} \ No newline at end of file diff --git a/protologbeat.yml b/protologbeat.yml new file mode 100644 index 00000000..e4a76e32 --- /dev/null +++ b/protologbeat.yml @@ -0,0 +1,76 @@ +################### Protologbeat Configuration Example ######################### + +############################# Protologbeat ###################################### + +protologbeat: + address: "127.0.0.1" + port: 6000 + protocol: udp + max_msg_size: 4096 + json_mode: true + default_es_log_type: protologbeat + merge_fields_to_root: true + enable_syslog_format_only: false + enable_json_validation: false + validate_all_json_types: false + json_schema: + email_contact: "/usr/local/go/src/github.com/hartfordfive/protologbeat/_samples/app1_schema.json" + stock_item: "/usr/local/go/src/github.com/hartfordfive/protologbeat/_samples/app2_schema.json" + debug: true + + +#================================ General ===================================== + +# The name of the shipper that publishes the network data. It can be used to group +# all the transactions sent by a single shipper in the web interface. +#name: + +# The tags of the shipper are included in their own field with each +# transaction published. +#tags: ["service-X", "web-tier"] + +# Optional fields that you can specify to add additional information to the +# output. +#fields: +# env: staging + +#================================ Outputs ===================================== + +# Configure what outputs to use when sending the data collected by the beat. +# Multiple outputs may be used. + +#-------------------------- Elasticsearch output ------------------------------ +output.elasticsearch: + # Array of hosts to connect to. + hosts: ["localhost:9200"] + + # Optional protocol and basic auth credentials. + #protocol: "https" + #username: "elastic" + #password: "changeme" + +#----------------------------- Logstash output -------------------------------- +#output.logstash: + # The Logstash hosts + #hosts: ["localhost:5044"] + + # Optional SSL. By default is off. + # List of root certificates for HTTPS server verifications + #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"] + + # Certificate for SSL client authentication + #ssl.certificate: "/etc/pki/client/cert.pem" + + # Client Certificate Key + #ssl.key: "/etc/pki/client/cert.key" + +#================================ Logging ===================================== + +# Sets log level. The default log level is info. +# Available log levels are: critical, error, warning, info, debug +#logging.level: debug + +# At debug level, you can selectively enable logging only for some components. +# To enable all selectors use ["*"]. Examples of other selectors are "beat", +# "publish", "service". +#logging.selectors: ["*"] diff --git a/tests/system/config/protologbeat.yml.j2 b/tests/system/config/protologbeat.yml.j2 new file mode 100644 index 00000000..49b55ed0 --- /dev/null +++ b/tests/system/config/protologbeat.yml.j2 @@ -0,0 +1,78 @@ +################### Beat Configuration ######################### + + + +############################# Output ########################################## + +# Configure what outputs to use when sending the data collected by the beat. +# You can enable one or multiple outputs by setting enabled option to true. +output: + + ### File as output + file: + # Enabling file output + enabled: true + + # Path to the directory where to save the generated files. The option is mandatory. + path: {{ output_file_path|default(beat.working_dir + "/output") }} + + + # Name of the generated files. The default is `protologbeat` and it generates + # files: `protologbeat`, `protologbeat.1`, `protologbeat.2`, etc. + filename: "{{ output_file_filename|default("protologbeat") }}" + + # Maximum size in kilobytes of each file. When this size is reached, the files are + # rotated. The default value is 10 MB. + #rotate_every_kb: 10000 + + # Maximum number of files under path. When this number of files is reached, the + # oldest file is deleted and the rest are shifted from last to first. The default + # is 7 files. + #number_of_files: 7 + + + +############################# Beat ######################################### + +# The name of the shipper that publishes the network data. It can be used to group +# all the transactions sent by a single shipper in the web interface. +# If this options is not defined, the hostname is used. +#name: + +# The tags of the shipper are included in their own field with each +# transaction published. Tags make it easy to group servers by different +# logical properties. +#tags: ["service-X", "web-tier"] + + + +############################# Logging ######################################### + +#logging: + # Send all logging output to syslog. On Windows default is false, otherwise + # default is true. + #to_syslog: true + + # Write all logging output to files. Beats automatically rotate files if configurable + # limit is reached. + #to_files: false + + # Enable debug output for selected components. + #selectors: [] + + # Set log level + #level: error + + #files: + # The directory where the log files will written to. + #path: /var/log/protologbeat + + # The name of the files where the logs are written to. + #name: protologbeat + + # Configure log file size limit. If limit is reached, log file will be + # automatically rotated + #rotateeverybytes: 10485760 # = 10MB + + # Number of rotated log files to keep. Oldest files will be deleted first. + #keepfiles: 7 diff --git a/tests/system/protologbeat.py b/tests/system/protologbeat.py new file mode 100644 index 00000000..c83d4596 --- /dev/null +++ b/tests/system/protologbeat.py @@ -0,0 +1,11 @@ +import sys +sys.path.append('../../vendor/github.com/elastic/beats/libbeat/tests/system') +from beat.beat import TestCase + +class BaseTest(TestCase): + + @classmethod + def setUpClass(self): + self.beat_name = "protologbeat" + self.build_path = "../../build/system-tests/" + self.beat_path = "../../protologbeat.test" diff --git a/tests/system/requirements.txt b/tests/system/requirements.txt new file mode 100644 index 00000000..e69de29b diff --git a/tests/system/test_base.py b/tests/system/test_base.py new file mode 100644 index 00000000..78a65b18 --- /dev/null +++ b/tests/system/test_base.py @@ -0,0 +1,19 @@ +from protologbeat import BaseTest + +import os + + +class Test(BaseTest): + + def test_base(self): + """ + Basic test with exiting Protologbeat normally + """ + self.render_config_template( + path=os.path.abspath(self.working_dir) + "/log/*" + ) + + protologbeat_proc = self.start_beat() + self.wait_until( lambda: self.log_contains("protologbeat is running")) + exit_code = protologbeat_proc.kill_and_wait() + assert exit_code == 0 diff --git a/vendor/github.com/davecgh/go-spew/.travis.yml b/vendor/github.com/davecgh/go-spew/.travis.yml new file mode 100644 index 00000000..984e0736 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/.travis.yml @@ -0,0 +1,14 @@ +language: go +go: + - 1.5.4 + - 1.6.3 + - 1.7 +install: + - go get -v golang.org/x/tools/cmd/cover +script: + - go test -v -tags=safe ./spew + - go test -v -tags=testcgo ./spew -covermode=count -coverprofile=profile.cov +after_success: + - go get -v github.com/mattn/goveralls + - export PATH=$PATH:$HOME/gopath/bin + - goveralls -coverprofile=profile.cov -service=travis-ci diff --git a/vendor/github.com/davecgh/go-spew/LICENSE b/vendor/github.com/davecgh/go-spew/LICENSE new file mode 100644 index 00000000..c8364161 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2012-2016 Dave Collins + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/github.com/davecgh/go-spew/README.md b/vendor/github.com/davecgh/go-spew/README.md new file mode 100644 index 00000000..26243044 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/README.md @@ -0,0 +1,205 @@ +go-spew +======= + +[![Build Status](https://img.shields.io/travis/davecgh/go-spew.svg)] +(https://travis-ci.org/davecgh/go-spew) [![ISC License] +(http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) [![Coverage Status] +(https://img.shields.io/coveralls/davecgh/go-spew.svg)] +(https://coveralls.io/r/davecgh/go-spew?branch=master) + + +Go-spew implements a deep pretty printer for Go data structures to aid in +debugging. A comprehensive suite of tests with 100% test coverage is provided +to ensure proper functionality. See `test_coverage.txt` for the gocov coverage +report. Go-spew is licensed under the liberal ISC license, so it may be used in +open source or commercial projects. + +If you're interested in reading about how this package came to life and some +of the challenges involved in providing a deep pretty printer, there is a blog +post about it +[here](https://web.archive.org/web/20160304013555/https://blog.cyphertite.com/go-spew-a-journey-into-dumping-go-data-structures/). + +## Documentation + +[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)] +(http://godoc.org/github.com/davecgh/go-spew/spew) + +Full `go doc` style documentation for the project can be viewed online without +installing this package by using the excellent GoDoc site here: +http://godoc.org/github.com/davecgh/go-spew/spew + +You can also view the documentation locally once the package is installed with +the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to +http://localhost:6060/pkg/github.com/davecgh/go-spew/spew + +## Installation + +```bash +$ go get -u github.com/davecgh/go-spew/spew +``` + +## Quick Start + +Add this import line to the file you're working in: + +```Go +import "github.com/davecgh/go-spew/spew" +``` + +To dump a variable with full newlines, indentation, type, and pointer +information use Dump, Fdump, or Sdump: + +```Go +spew.Dump(myVar1, myVar2, ...) +spew.Fdump(someWriter, myVar1, myVar2, ...) +str := spew.Sdump(myVar1, myVar2, ...) +``` + +Alternatively, if you would prefer to use format strings with a compacted inline +printing style, use the convenience wrappers Printf, Fprintf, etc with %v (most +compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types +and pointer addresses): + +```Go +spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) +spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) +spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) +spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) +``` + +## Debugging a Web Application Example + +Here is an example of how you can use `spew.Sdump()` to help debug a web application. Please be sure to wrap your output using the `html.EscapeString()` function for safety reasons. You should also only use this debugging technique in a development environment, never in production. + +```Go +package main + +import ( + "fmt" + "html" + "net/http" + + "github.com/davecgh/go-spew/spew" +) + +func handler(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/html") + fmt.Fprintf(w, "Hi there, %s!", r.URL.Path[1:]) + fmt.Fprintf(w, "") +} + +func main() { + http.HandleFunc("/", handler) + http.ListenAndServe(":8080", nil) +} +``` + +## Sample Dump Output + +``` +(main.Foo) { + unexportedField: (*main.Bar)(0xf84002e210)({ + flag: (main.Flag) flagTwo, + data: (uintptr) + }), + ExportedField: (map[interface {}]interface {}) { + (string) "one": (bool) true + } +} +([]uint8) { + 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | + 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| + 00000020 31 32 |12| +} +``` + +## Sample Formatter Output + +Double pointer to a uint8: +``` + %v: <**>5 + %+v: <**>(0xf8400420d0->0xf8400420c8)5 + %#v: (**uint8)5 + %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 +``` + +Pointer to circular struct with a uint8 field and a pointer to itself: +``` + %v: <*>{1 <*>} + %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)} + %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)} + %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)} +``` + +## Configuration Options + +Configuration of spew is handled by fields in the ConfigState type. For +convenience, all of the top-level functions use a global state available via the +spew.Config global. + +It is also possible to create a ConfigState instance that provides methods +equivalent to the top-level functions. This allows concurrent configuration +options. See the ConfigState documentation for more details. + +``` +* Indent + String to use for each indentation level for Dump functions. + It is a single space by default. A popular alternative is "\t". + +* MaxDepth + Maximum number of levels to descend into nested data structures. + There is no limit by default. + +* DisableMethods + Disables invocation of error and Stringer interface methods. + Method invocation is enabled by default. + +* DisablePointerMethods + Disables invocation of error and Stringer interface methods on types + which only accept pointer receivers from non-pointer variables. This option + relies on access to the unsafe package, so it will not have any effect when + running in environments without access to the unsafe package such as Google + App Engine or with the "safe" build tag specified. + Pointer method invocation is enabled by default. + +* DisablePointerAddresses + DisablePointerAddresses specifies whether to disable the printing of + pointer addresses. This is useful when diffing data structures in tests. + +* DisableCapacities + DisableCapacities specifies whether to disable the printing of capacities + for arrays, slices, maps and channels. This is useful when diffing data + structures in tests. + +* ContinueOnMethod + Enables recursion into types after invoking error and Stringer interface + methods. Recursion after method invocation is disabled by default. + +* SortKeys + Specifies map keys should be sorted before being printed. Use + this to have a more deterministic, diffable output. Note that + only native types (bool, int, uint, floats, uintptr and string) + and types which implement error or Stringer interfaces are supported, + with other types sorted according to the reflect.Value.String() output + which guarantees display stability. Natural map order is used by + default. + +* SpewKeys + SpewKeys specifies that, as a last resort attempt, map keys should be + spewed to strings and sorted by those strings. This is only considered + if SortKeys is true. + +``` + +## Unsafe Package Dependency + +This package relies on the unsafe package to perform some of the more advanced +features, however it also supports a "limited" mode which allows it to work in +environments where the unsafe package is not available. By default, it will +operate in this mode on Google App Engine and when compiled with GopherJS. The +"safe" build tag may also be specified to force the package to build without +using the unsafe package. + +## License + +Go-spew is licensed under the [copyfree](http://copyfree.org) ISC License. diff --git a/vendor/github.com/davecgh/go-spew/cov_report.sh b/vendor/github.com/davecgh/go-spew/cov_report.sh new file mode 100644 index 00000000..9579497e --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/cov_report.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# This script uses gocov to generate a test coverage report. +# The gocov tool my be obtained with the following command: +# go get github.com/axw/gocov/gocov +# +# It will be installed to $GOPATH/bin, so ensure that location is in your $PATH. + +# Check for gocov. +if ! type gocov >/dev/null 2>&1; then + echo >&2 "This script requires the gocov tool." + echo >&2 "You may obtain it with the following command:" + echo >&2 "go get github.com/axw/gocov/gocov" + exit 1 +fi + +# Only run the cgo tests if gcc is installed. +if type gcc >/dev/null 2>&1; then + (cd spew && gocov test -tags testcgo | gocov report) +else + (cd spew && gocov test | gocov report) +fi diff --git a/vendor/github.com/davecgh/go-spew/spew/bypass.go b/vendor/github.com/davecgh/go-spew/spew/bypass.go new file mode 100644 index 00000000..8a4a6589 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/bypass.go @@ -0,0 +1,152 @@ +// Copyright (c) 2015-2016 Dave Collins +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when the code is not running on Google App Engine, compiled by GopherJS, and +// "-tags safe" is not added to the go build command line. The "disableunsafe" +// tag is deprecated and thus should not be used. +// +build !js,!appengine,!safe,!disableunsafe + +package spew + +import ( + "reflect" + "unsafe" +) + +const ( + // UnsafeDisabled is a build-time constant which specifies whether or + // not access to the unsafe package is available. + UnsafeDisabled = false + + // ptrSize is the size of a pointer on the current arch. + ptrSize = unsafe.Sizeof((*byte)(nil)) +) + +var ( + // offsetPtr, offsetScalar, and offsetFlag are the offsets for the + // internal reflect.Value fields. These values are valid before golang + // commit ecccf07e7f9d which changed the format. The are also valid + // after commit 82f48826c6c7 which changed the format again to mirror + // the original format. Code in the init function updates these offsets + // as necessary. + offsetPtr = uintptr(ptrSize) + offsetScalar = uintptr(0) + offsetFlag = uintptr(ptrSize * 2) + + // flagKindWidth and flagKindShift indicate various bits that the + // reflect package uses internally to track kind information. + // + // flagRO indicates whether or not the value field of a reflect.Value is + // read-only. + // + // flagIndir indicates whether the value field of a reflect.Value is + // the actual data or a pointer to the data. + // + // These values are valid before golang commit 90a7c3c86944 which + // changed their positions. Code in the init function updates these + // flags as necessary. + flagKindWidth = uintptr(5) + flagKindShift = uintptr(flagKindWidth - 1) + flagRO = uintptr(1 << 0) + flagIndir = uintptr(1 << 1) +) + +func init() { + // Older versions of reflect.Value stored small integers directly in the + // ptr field (which is named val in the older versions). Versions + // between commits ecccf07e7f9d and 82f48826c6c7 added a new field named + // scalar for this purpose which unfortunately came before the flag + // field, so the offset of the flag field is different for those + // versions. + // + // This code constructs a new reflect.Value from a known small integer + // and checks if the size of the reflect.Value struct indicates it has + // the scalar field. When it does, the offsets are updated accordingly. + vv := reflect.ValueOf(0xf00) + if unsafe.Sizeof(vv) == (ptrSize * 4) { + offsetScalar = ptrSize * 2 + offsetFlag = ptrSize * 3 + } + + // Commit 90a7c3c86944 changed the flag positions such that the low + // order bits are the kind. This code extracts the kind from the flags + // field and ensures it's the correct type. When it's not, the flag + // order has been changed to the newer format, so the flags are updated + // accordingly. + upf := unsafe.Pointer(uintptr(unsafe.Pointer(&vv)) + offsetFlag) + upfv := *(*uintptr)(upf) + flagKindMask := uintptr((1<>flagKindShift != uintptr(reflect.Int) { + flagKindShift = 0 + flagRO = 1 << 5 + flagIndir = 1 << 6 + + // Commit adf9b30e5594 modified the flags to separate the + // flagRO flag into two bits which specifies whether or not the + // field is embedded. This causes flagIndir to move over a bit + // and means that flagRO is the combination of either of the + // original flagRO bit and the new bit. + // + // This code detects the change by extracting what used to be + // the indirect bit to ensure it's set. When it's not, the flag + // order has been changed to the newer format, so the flags are + // updated accordingly. + if upfv&flagIndir == 0 { + flagRO = 3 << 5 + flagIndir = 1 << 7 + } + } +} + +// unsafeReflectValue converts the passed reflect.Value into a one that bypasses +// the typical safety restrictions preventing access to unaddressable and +// unexported data. It works by digging the raw pointer to the underlying +// value out of the protected value and generating a new unprotected (unsafe) +// reflect.Value to it. +// +// This allows us to check for implementations of the Stringer and error +// interfaces to be used for pretty printing ordinarily unaddressable and +// inaccessible values such as unexported struct fields. +func unsafeReflectValue(v reflect.Value) (rv reflect.Value) { + indirects := 1 + vt := v.Type() + upv := unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetPtr) + rvf := *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetFlag)) + if rvf&flagIndir != 0 { + vt = reflect.PtrTo(v.Type()) + indirects++ + } else if offsetScalar != 0 { + // The value is in the scalar field when it's not one of the + // reference types. + switch vt.Kind() { + case reflect.Uintptr: + case reflect.Chan: + case reflect.Func: + case reflect.Map: + case reflect.Ptr: + case reflect.UnsafePointer: + default: + upv = unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + + offsetScalar) + } + } + + pv := reflect.NewAt(vt, upv) + rv = pv + for i := 0; i < indirects; i++ { + rv = rv.Elem() + } + return rv +} diff --git a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go new file mode 100644 index 00000000..1fe3cf3d --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go @@ -0,0 +1,38 @@ +// Copyright (c) 2015-2016 Dave Collins +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when the code is running on Google App Engine, compiled by GopherJS, or +// "-tags safe" is added to the go build command line. The "disableunsafe" +// tag is deprecated and thus should not be used. +// +build js appengine safe disableunsafe + +package spew + +import "reflect" + +const ( + // UnsafeDisabled is a build-time constant which specifies whether or + // not access to the unsafe package is available. + UnsafeDisabled = true +) + +// unsafeReflectValue typically converts the passed reflect.Value into a one +// that bypasses the typical safety restrictions preventing access to +// unaddressable and unexported data. However, doing this relies on access to +// the unsafe package. This is a stub version which simply returns the passed +// reflect.Value when the unsafe package is not available. +func unsafeReflectValue(v reflect.Value) reflect.Value { + return v +} diff --git a/vendor/github.com/davecgh/go-spew/spew/common.go b/vendor/github.com/davecgh/go-spew/spew/common.go new file mode 100644 index 00000000..7c519ff4 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/common.go @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "fmt" + "io" + "reflect" + "sort" + "strconv" +) + +// Some constants in the form of bytes to avoid string overhead. This mirrors +// the technique used in the fmt package. +var ( + panicBytes = []byte("(PANIC=") + plusBytes = []byte("+") + iBytes = []byte("i") + trueBytes = []byte("true") + falseBytes = []byte("false") + interfaceBytes = []byte("(interface {})") + commaNewlineBytes = []byte(",\n") + newlineBytes = []byte("\n") + openBraceBytes = []byte("{") + openBraceNewlineBytes = []byte("{\n") + closeBraceBytes = []byte("}") + asteriskBytes = []byte("*") + colonBytes = []byte(":") + colonSpaceBytes = []byte(": ") + openParenBytes = []byte("(") + closeParenBytes = []byte(")") + spaceBytes = []byte(" ") + pointerChainBytes = []byte("->") + nilAngleBytes = []byte("") + maxNewlineBytes = []byte("\n") + maxShortBytes = []byte("") + circularBytes = []byte("") + circularShortBytes = []byte("") + invalidAngleBytes = []byte("") + openBracketBytes = []byte("[") + closeBracketBytes = []byte("]") + percentBytes = []byte("%") + precisionBytes = []byte(".") + openAngleBytes = []byte("<") + closeAngleBytes = []byte(">") + openMapBytes = []byte("map[") + closeMapBytes = []byte("]") + lenEqualsBytes = []byte("len=") + capEqualsBytes = []byte("cap=") +) + +// hexDigits is used to map a decimal value to a hex digit. +var hexDigits = "0123456789abcdef" + +// catchPanic handles any panics that might occur during the handleMethods +// calls. +func catchPanic(w io.Writer, v reflect.Value) { + if err := recover(); err != nil { + w.Write(panicBytes) + fmt.Fprintf(w, "%v", err) + w.Write(closeParenBytes) + } +} + +// handleMethods attempts to call the Error and String methods on the underlying +// type the passed reflect.Value represents and outputes the result to Writer w. +// +// It handles panics in any called methods by catching and displaying the error +// as the formatted value. +func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) { + // We need an interface to check if the type implements the error or + // Stringer interface. However, the reflect package won't give us an + // interface on certain things like unexported struct fields in order + // to enforce visibility rules. We use unsafe, when it's available, + // to bypass these restrictions since this package does not mutate the + // values. + if !v.CanInterface() { + if UnsafeDisabled { + return false + } + + v = unsafeReflectValue(v) + } + + // Choose whether or not to do error and Stringer interface lookups against + // the base type or a pointer to the base type depending on settings. + // Technically calling one of these methods with a pointer receiver can + // mutate the value, however, types which choose to satisify an error or + // Stringer interface with a pointer receiver should not be mutating their + // state inside these interface methods. + if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() { + v = unsafeReflectValue(v) + } + if v.CanAddr() { + v = v.Addr() + } + + // Is it an error or Stringer? + switch iface := v.Interface().(type) { + case error: + defer catchPanic(w, v) + if cs.ContinueOnMethod { + w.Write(openParenBytes) + w.Write([]byte(iface.Error())) + w.Write(closeParenBytes) + w.Write(spaceBytes) + return false + } + + w.Write([]byte(iface.Error())) + return true + + case fmt.Stringer: + defer catchPanic(w, v) + if cs.ContinueOnMethod { + w.Write(openParenBytes) + w.Write([]byte(iface.String())) + w.Write(closeParenBytes) + w.Write(spaceBytes) + return false + } + w.Write([]byte(iface.String())) + return true + } + return false +} + +// printBool outputs a boolean value as true or false to Writer w. +func printBool(w io.Writer, val bool) { + if val { + w.Write(trueBytes) + } else { + w.Write(falseBytes) + } +} + +// printInt outputs a signed integer value to Writer w. +func printInt(w io.Writer, val int64, base int) { + w.Write([]byte(strconv.FormatInt(val, base))) +} + +// printUint outputs an unsigned integer value to Writer w. +func printUint(w io.Writer, val uint64, base int) { + w.Write([]byte(strconv.FormatUint(val, base))) +} + +// printFloat outputs a floating point value using the specified precision, +// which is expected to be 32 or 64bit, to Writer w. +func printFloat(w io.Writer, val float64, precision int) { + w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision))) +} + +// printComplex outputs a complex value using the specified float precision +// for the real and imaginary parts to Writer w. +func printComplex(w io.Writer, c complex128, floatPrecision int) { + r := real(c) + w.Write(openParenBytes) + w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision))) + i := imag(c) + if i >= 0 { + w.Write(plusBytes) + } + w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision))) + w.Write(iBytes) + w.Write(closeParenBytes) +} + +// printHexPtr outputs a uintptr formatted as hexidecimal with a leading '0x' +// prefix to Writer w. +func printHexPtr(w io.Writer, p uintptr) { + // Null pointer. + num := uint64(p) + if num == 0 { + w.Write(nilAngleBytes) + return + } + + // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix + buf := make([]byte, 18) + + // It's simpler to construct the hex string right to left. + base := uint64(16) + i := len(buf) - 1 + for num >= base { + buf[i] = hexDigits[num%base] + num /= base + i-- + } + buf[i] = hexDigits[num] + + // Add '0x' prefix. + i-- + buf[i] = 'x' + i-- + buf[i] = '0' + + // Strip unused leading bytes. + buf = buf[i:] + w.Write(buf) +} + +// valuesSorter implements sort.Interface to allow a slice of reflect.Value +// elements to be sorted. +type valuesSorter struct { + values []reflect.Value + strings []string // either nil or same len and values + cs *ConfigState +} + +// newValuesSorter initializes a valuesSorter instance, which holds a set of +// surrogate keys on which the data should be sorted. It uses flags in +// ConfigState to decide if and how to populate those surrogate keys. +func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface { + vs := &valuesSorter{values: values, cs: cs} + if canSortSimply(vs.values[0].Kind()) { + return vs + } + if !cs.DisableMethods { + vs.strings = make([]string, len(values)) + for i := range vs.values { + b := bytes.Buffer{} + if !handleMethods(cs, &b, vs.values[i]) { + vs.strings = nil + break + } + vs.strings[i] = b.String() + } + } + if vs.strings == nil && cs.SpewKeys { + vs.strings = make([]string, len(values)) + for i := range vs.values { + vs.strings[i] = Sprintf("%#v", vs.values[i].Interface()) + } + } + return vs +} + +// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted +// directly, or whether it should be considered for sorting by surrogate keys +// (if the ConfigState allows it). +func canSortSimply(kind reflect.Kind) bool { + // This switch parallels valueSortLess, except for the default case. + switch kind { + case reflect.Bool: + return true + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + return true + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + return true + case reflect.Float32, reflect.Float64: + return true + case reflect.String: + return true + case reflect.Uintptr: + return true + case reflect.Array: + return true + } + return false +} + +// Len returns the number of values in the slice. It is part of the +// sort.Interface implementation. +func (s *valuesSorter) Len() int { + return len(s.values) +} + +// Swap swaps the values at the passed indices. It is part of the +// sort.Interface implementation. +func (s *valuesSorter) Swap(i, j int) { + s.values[i], s.values[j] = s.values[j], s.values[i] + if s.strings != nil { + s.strings[i], s.strings[j] = s.strings[j], s.strings[i] + } +} + +// valueSortLess returns whether the first value should sort before the second +// value. It is used by valueSorter.Less as part of the sort.Interface +// implementation. +func valueSortLess(a, b reflect.Value) bool { + switch a.Kind() { + case reflect.Bool: + return !a.Bool() && b.Bool() + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + return a.Int() < b.Int() + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + return a.Uint() < b.Uint() + case reflect.Float32, reflect.Float64: + return a.Float() < b.Float() + case reflect.String: + return a.String() < b.String() + case reflect.Uintptr: + return a.Uint() < b.Uint() + case reflect.Array: + // Compare the contents of both arrays. + l := a.Len() + for i := 0; i < l; i++ { + av := a.Index(i) + bv := b.Index(i) + if av.Interface() == bv.Interface() { + continue + } + return valueSortLess(av, bv) + } + } + return a.String() < b.String() +} + +// Less returns whether the value at index i should sort before the +// value at index j. It is part of the sort.Interface implementation. +func (s *valuesSorter) Less(i, j int) bool { + if s.strings == nil { + return valueSortLess(s.values[i], s.values[j]) + } + return s.strings[i] < s.strings[j] +} + +// sortValues is a sort function that handles both native types and any type that +// can be converted to error or Stringer. Other inputs are sorted according to +// their Value.String() value to ensure display stability. +func sortValues(values []reflect.Value, cs *ConfigState) { + if len(values) == 0 { + return + } + sort.Sort(newValuesSorter(values, cs)) +} diff --git a/vendor/github.com/davecgh/go-spew/spew/common_test.go b/vendor/github.com/davecgh/go-spew/spew/common_test.go new file mode 100644 index 00000000..0f5ce47d --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/common_test.go @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew_test + +import ( + "fmt" + "reflect" + "testing" + + "github.com/davecgh/go-spew/spew" +) + +// custom type to test Stinger interface on non-pointer receiver. +type stringer string + +// String implements the Stringer interface for testing invocation of custom +// stringers on types with non-pointer receivers. +func (s stringer) String() string { + return "stringer " + string(s) +} + +// custom type to test Stinger interface on pointer receiver. +type pstringer string + +// String implements the Stringer interface for testing invocation of custom +// stringers on types with only pointer receivers. +func (s *pstringer) String() string { + return "stringer " + string(*s) +} + +// xref1 and xref2 are cross referencing structs for testing circular reference +// detection. +type xref1 struct { + ps2 *xref2 +} +type xref2 struct { + ps1 *xref1 +} + +// indirCir1, indirCir2, and indirCir3 are used to generate an indirect circular +// reference for testing detection. +type indirCir1 struct { + ps2 *indirCir2 +} +type indirCir2 struct { + ps3 *indirCir3 +} +type indirCir3 struct { + ps1 *indirCir1 +} + +// embed is used to test embedded structures. +type embed struct { + a string +} + +// embedwrap is used to test embedded structures. +type embedwrap struct { + *embed + e *embed +} + +// panicer is used to intentionally cause a panic for testing spew properly +// handles them +type panicer int + +func (p panicer) String() string { + panic("test panic") +} + +// customError is used to test custom error interface invocation. +type customError int + +func (e customError) Error() string { + return fmt.Sprintf("error: %d", int(e)) +} + +// stringizeWants converts a slice of wanted test output into a format suitable +// for a test error message. +func stringizeWants(wants []string) string { + s := "" + for i, want := range wants { + if i > 0 { + s += fmt.Sprintf("want%d: %s", i+1, want) + } else { + s += "want: " + want + } + } + return s +} + +// testFailed returns whether or not a test failed by checking if the result +// of the test is in the slice of wanted strings. +func testFailed(result string, wants []string) bool { + for _, want := range wants { + if result == want { + return false + } + } + return true +} + +type sortableStruct struct { + x int +} + +func (ss sortableStruct) String() string { + return fmt.Sprintf("ss.%d", ss.x) +} + +type unsortableStruct struct { + x int +} + +type sortTestCase struct { + input []reflect.Value + expected []reflect.Value +} + +func helpTestSortValues(tests []sortTestCase, cs *spew.ConfigState, t *testing.T) { + getInterfaces := func(values []reflect.Value) []interface{} { + interfaces := []interface{}{} + for _, v := range values { + interfaces = append(interfaces, v.Interface()) + } + return interfaces + } + + for _, test := range tests { + spew.SortValues(test.input, cs) + // reflect.DeepEqual cannot really make sense of reflect.Value, + // probably because of all the pointer tricks. For instance, + // v(2.0) != v(2.0) on a 32-bits system. Turn them into interface{} + // instead. + input := getInterfaces(test.input) + expected := getInterfaces(test.expected) + if !reflect.DeepEqual(input, expected) { + t.Errorf("Sort mismatch:\n %v != %v", input, expected) + } + } +} + +// TestSortValues ensures the sort functionality for relect.Value based sorting +// works as intended. +func TestSortValues(t *testing.T) { + v := reflect.ValueOf + + a := v("a") + b := v("b") + c := v("c") + embedA := v(embed{"a"}) + embedB := v(embed{"b"}) + embedC := v(embed{"c"}) + tests := []sortTestCase{ + // No values. + { + []reflect.Value{}, + []reflect.Value{}, + }, + // Bools. + { + []reflect.Value{v(false), v(true), v(false)}, + []reflect.Value{v(false), v(false), v(true)}, + }, + // Ints. + { + []reflect.Value{v(2), v(1), v(3)}, + []reflect.Value{v(1), v(2), v(3)}, + }, + // Uints. + { + []reflect.Value{v(uint8(2)), v(uint8(1)), v(uint8(3))}, + []reflect.Value{v(uint8(1)), v(uint8(2)), v(uint8(3))}, + }, + // Floats. + { + []reflect.Value{v(2.0), v(1.0), v(3.0)}, + []reflect.Value{v(1.0), v(2.0), v(3.0)}, + }, + // Strings. + { + []reflect.Value{b, a, c}, + []reflect.Value{a, b, c}, + }, + // Array + { + []reflect.Value{v([3]int{3, 2, 1}), v([3]int{1, 3, 2}), v([3]int{1, 2, 3})}, + []reflect.Value{v([3]int{1, 2, 3}), v([3]int{1, 3, 2}), v([3]int{3, 2, 1})}, + }, + // Uintptrs. + { + []reflect.Value{v(uintptr(2)), v(uintptr(1)), v(uintptr(3))}, + []reflect.Value{v(uintptr(1)), v(uintptr(2)), v(uintptr(3))}, + }, + // SortableStructs. + { + // Note: not sorted - DisableMethods is set. + []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})}, + []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})}, + }, + // UnsortableStructs. + { + // Note: not sorted - SpewKeys is false. + []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, + []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, + }, + // Invalid. + { + []reflect.Value{embedB, embedA, embedC}, + []reflect.Value{embedB, embedA, embedC}, + }, + } + cs := spew.ConfigState{DisableMethods: true, SpewKeys: false} + helpTestSortValues(tests, &cs, t) +} + +// TestSortValuesWithMethods ensures the sort functionality for relect.Value +// based sorting works as intended when using string methods. +func TestSortValuesWithMethods(t *testing.T) { + v := reflect.ValueOf + + a := v("a") + b := v("b") + c := v("c") + tests := []sortTestCase{ + // Ints. + { + []reflect.Value{v(2), v(1), v(3)}, + []reflect.Value{v(1), v(2), v(3)}, + }, + // Strings. + { + []reflect.Value{b, a, c}, + []reflect.Value{a, b, c}, + }, + // SortableStructs. + { + []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})}, + []reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})}, + }, + // UnsortableStructs. + { + // Note: not sorted - SpewKeys is false. + []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, + []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, + }, + } + cs := spew.ConfigState{DisableMethods: false, SpewKeys: false} + helpTestSortValues(tests, &cs, t) +} + +// TestSortValuesWithSpew ensures the sort functionality for relect.Value +// based sorting works as intended when using spew to stringify keys. +func TestSortValuesWithSpew(t *testing.T) { + v := reflect.ValueOf + + a := v("a") + b := v("b") + c := v("c") + tests := []sortTestCase{ + // Ints. + { + []reflect.Value{v(2), v(1), v(3)}, + []reflect.Value{v(1), v(2), v(3)}, + }, + // Strings. + { + []reflect.Value{b, a, c}, + []reflect.Value{a, b, c}, + }, + // SortableStructs. + { + []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})}, + []reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})}, + }, + // UnsortableStructs. + { + []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, + []reflect.Value{v(unsortableStruct{1}), v(unsortableStruct{2}), v(unsortableStruct{3})}, + }, + } + cs := spew.ConfigState{DisableMethods: true, SpewKeys: true} + helpTestSortValues(tests, &cs, t) +} diff --git a/vendor/github.com/davecgh/go-spew/spew/config.go b/vendor/github.com/davecgh/go-spew/spew/config.go new file mode 100644 index 00000000..2e3d22f3 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/config.go @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "fmt" + "io" + "os" +) + +// ConfigState houses the configuration options used by spew to format and +// display values. There is a global instance, Config, that is used to control +// all top-level Formatter and Dump functionality. Each ConfigState instance +// provides methods equivalent to the top-level functions. +// +// The zero value for ConfigState provides no indentation. You would typically +// want to set it to a space or a tab. +// +// Alternatively, you can use NewDefaultConfig to get a ConfigState instance +// with default settings. See the documentation of NewDefaultConfig for default +// values. +type ConfigState struct { + // Indent specifies the string to use for each indentation level. The + // global config instance that all top-level functions use set this to a + // single space by default. If you would like more indentation, you might + // set this to a tab with "\t" or perhaps two spaces with " ". + Indent string + + // MaxDepth controls the maximum number of levels to descend into nested + // data structures. The default, 0, means there is no limit. + // + // NOTE: Circular data structures are properly detected, so it is not + // necessary to set this value unless you specifically want to limit deeply + // nested data structures. + MaxDepth int + + // DisableMethods specifies whether or not error and Stringer interfaces are + // invoked for types that implement them. + DisableMethods bool + + // DisablePointerMethods specifies whether or not to check for and invoke + // error and Stringer interfaces on types which only accept a pointer + // receiver when the current type is not a pointer. + // + // NOTE: This might be an unsafe action since calling one of these methods + // with a pointer receiver could technically mutate the value, however, + // in practice, types which choose to satisify an error or Stringer + // interface with a pointer receiver should not be mutating their state + // inside these interface methods. As a result, this option relies on + // access to the unsafe package, so it will not have any effect when + // running in environments without access to the unsafe package such as + // Google App Engine or with the "safe" build tag specified. + DisablePointerMethods bool + + // DisablePointerAddresses specifies whether to disable the printing of + // pointer addresses. This is useful when diffing data structures in tests. + DisablePointerAddresses bool + + // DisableCapacities specifies whether to disable the printing of capacities + // for arrays, slices, maps and channels. This is useful when diffing + // data structures in tests. + DisableCapacities bool + + // ContinueOnMethod specifies whether or not recursion should continue once + // a custom error or Stringer interface is invoked. The default, false, + // means it will print the results of invoking the custom error or Stringer + // interface and return immediately instead of continuing to recurse into + // the internals of the data type. + // + // NOTE: This flag does not have any effect if method invocation is disabled + // via the DisableMethods or DisablePointerMethods options. + ContinueOnMethod bool + + // SortKeys specifies map keys should be sorted before being printed. Use + // this to have a more deterministic, diffable output. Note that only + // native types (bool, int, uint, floats, uintptr and string) and types + // that support the error or Stringer interfaces (if methods are + // enabled) are supported, with other types sorted according to the + // reflect.Value.String() output which guarantees display stability. + SortKeys bool + + // SpewKeys specifies that, as a last resort attempt, map keys should + // be spewed to strings and sorted by those strings. This is only + // considered if SortKeys is true. + SpewKeys bool +} + +// Config is the active configuration of the top-level functions. +// The configuration can be changed by modifying the contents of spew.Config. +var Config = ConfigState{Indent: " "} + +// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the formatted string as a value that satisfies error. See NewFormatter +// for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) { + return fmt.Errorf(format, c.convertArgs(a)...) +} + +// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprint(w, c.convertArgs(a)...) +} + +// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { + return fmt.Fprintf(w, format, c.convertArgs(a)...) +} + +// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it +// passed with a Formatter interface returned by c.NewFormatter. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprintln(w, c.convertArgs(a)...) +} + +// Print is a wrapper for fmt.Print that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Print(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Print(a ...interface{}) (n int, err error) { + return fmt.Print(c.convertArgs(a)...) +} + +// Printf is a wrapper for fmt.Printf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) { + return fmt.Printf(format, c.convertArgs(a)...) +} + +// Println is a wrapper for fmt.Println that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Println(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Println(a ...interface{}) (n int, err error) { + return fmt.Println(c.convertArgs(a)...) +} + +// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Sprint(a ...interface{}) string { + return fmt.Sprint(c.convertArgs(a)...) +} + +// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Sprintf(format string, a ...interface{}) string { + return fmt.Sprintf(format, c.convertArgs(a)...) +} + +// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it +// were passed with a Formatter interface returned by c.NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Sprintln(a ...interface{}) string { + return fmt.Sprintln(c.convertArgs(a)...) +} + +/* +NewFormatter returns a custom formatter that satisfies the fmt.Formatter +interface. As a result, it integrates cleanly with standard fmt package +printing functions. The formatter is useful for inline printing of smaller data +types similar to the standard %v format specifier. + +The custom formatter only responds to the %v (most compact), %+v (adds pointer +addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb +combinations. Any other verbs such as %x and %q will be sent to the the +standard fmt package for formatting. In addition, the custom formatter ignores +the width and precision arguments (however they will still work on the format +specifiers not handled by the custom formatter). + +Typically this function shouldn't be called directly. It is much easier to make +use of the custom formatter by calling one of the convenience functions such as +c.Printf, c.Println, or c.Printf. +*/ +func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter { + return newFormatter(c, v) +} + +// Fdump formats and displays the passed arguments to io.Writer w. It formats +// exactly the same as Dump. +func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) { + fdump(c, w, a...) +} + +/* +Dump displays the passed parameters to standard out with newlines, customizable +indentation, and additional debug information such as complete types and all +pointer addresses used to indirect to the final value. It provides the +following features over the built-in printing facilities provided by the fmt +package: + + * Pointers are dereferenced and followed + * Circular data structures are detected and handled properly + * Custom Stringer/error interfaces are optionally invoked, including + on unexported types + * Custom types which only implement the Stringer/error interfaces via + a pointer receiver are optionally invoked when passing non-pointer + variables + * Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output + +The configuration options are controlled by modifying the public members +of c. See ConfigState for options documentation. + +See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to +get the formatted result as a string. +*/ +func (c *ConfigState) Dump(a ...interface{}) { + fdump(c, os.Stdout, a...) +} + +// Sdump returns a string with the passed arguments formatted exactly the same +// as Dump. +func (c *ConfigState) Sdump(a ...interface{}) string { + var buf bytes.Buffer + fdump(c, &buf, a...) + return buf.String() +} + +// convertArgs accepts a slice of arguments and returns a slice of the same +// length with each argument converted to a spew Formatter interface using +// the ConfigState associated with s. +func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) { + formatters = make([]interface{}, len(args)) + for index, arg := range args { + formatters[index] = newFormatter(c, arg) + } + return formatters +} + +// NewDefaultConfig returns a ConfigState with the following default settings. +// +// Indent: " " +// MaxDepth: 0 +// DisableMethods: false +// DisablePointerMethods: false +// ContinueOnMethod: false +// SortKeys: false +func NewDefaultConfig() *ConfigState { + return &ConfigState{Indent: " "} +} diff --git a/vendor/github.com/davecgh/go-spew/spew/doc.go b/vendor/github.com/davecgh/go-spew/spew/doc.go new file mode 100644 index 00000000..aacaac6f --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/doc.go @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* +Package spew implements a deep pretty printer for Go data structures to aid in +debugging. + +A quick overview of the additional features spew provides over the built-in +printing facilities for Go data types are as follows: + + * Pointers are dereferenced and followed + * Circular data structures are detected and handled properly + * Custom Stringer/error interfaces are optionally invoked, including + on unexported types + * Custom types which only implement the Stringer/error interfaces via + a pointer receiver are optionally invoked when passing non-pointer + variables + * Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output (only when using + Dump style) + +There are two different approaches spew allows for dumping Go data structures: + + * Dump style which prints with newlines, customizable indentation, + and additional debug information such as types and all pointer addresses + used to indirect to the final value + * A custom Formatter interface that integrates cleanly with the standard fmt + package and replaces %v, %+v, %#v, and %#+v to provide inline printing + similar to the default %v while providing the additional functionality + outlined above and passing unsupported format verbs such as %x and %q + along to fmt + +Quick Start + +This section demonstrates how to quickly get started with spew. See the +sections below for further details on formatting and configuration options. + +To dump a variable with full newlines, indentation, type, and pointer +information use Dump, Fdump, or Sdump: + spew.Dump(myVar1, myVar2, ...) + spew.Fdump(someWriter, myVar1, myVar2, ...) + str := spew.Sdump(myVar1, myVar2, ...) + +Alternatively, if you would prefer to use format strings with a compacted inline +printing style, use the convenience wrappers Printf, Fprintf, etc with +%v (most compact), %+v (adds pointer addresses), %#v (adds types), or +%#+v (adds types and pointer addresses): + spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + +Configuration Options + +Configuration of spew is handled by fields in the ConfigState type. For +convenience, all of the top-level functions use a global state available +via the spew.Config global. + +It is also possible to create a ConfigState instance that provides methods +equivalent to the top-level functions. This allows concurrent configuration +options. See the ConfigState documentation for more details. + +The following configuration options are available: + * Indent + String to use for each indentation level for Dump functions. + It is a single space by default. A popular alternative is "\t". + + * MaxDepth + Maximum number of levels to descend into nested data structures. + There is no limit by default. + + * DisableMethods + Disables invocation of error and Stringer interface methods. + Method invocation is enabled by default. + + * DisablePointerMethods + Disables invocation of error and Stringer interface methods on types + which only accept pointer receivers from non-pointer variables. + Pointer method invocation is enabled by default. + + * DisablePointerAddresses + DisablePointerAddresses specifies whether to disable the printing of + pointer addresses. This is useful when diffing data structures in tests. + + * DisableCapacities + DisableCapacities specifies whether to disable the printing of + capacities for arrays, slices, maps and channels. This is useful when + diffing data structures in tests. + + * ContinueOnMethod + Enables recursion into types after invoking error and Stringer interface + methods. Recursion after method invocation is disabled by default. + + * SortKeys + Specifies map keys should be sorted before being printed. Use + this to have a more deterministic, diffable output. Note that + only native types (bool, int, uint, floats, uintptr and string) + and types which implement error or Stringer interfaces are + supported with other types sorted according to the + reflect.Value.String() output which guarantees display + stability. Natural map order is used by default. + + * SpewKeys + Specifies that, as a last resort attempt, map keys should be + spewed to strings and sorted by those strings. This is only + considered if SortKeys is true. + +Dump Usage + +Simply call spew.Dump with a list of variables you want to dump: + + spew.Dump(myVar1, myVar2, ...) + +You may also call spew.Fdump if you would prefer to output to an arbitrary +io.Writer. For example, to dump to standard error: + + spew.Fdump(os.Stderr, myVar1, myVar2, ...) + +A third option is to call spew.Sdump to get the formatted output as a string: + + str := spew.Sdump(myVar1, myVar2, ...) + +Sample Dump Output + +See the Dump example for details on the setup of the types and variables being +shown here. + + (main.Foo) { + unexportedField: (*main.Bar)(0xf84002e210)({ + flag: (main.Flag) flagTwo, + data: (uintptr) + }), + ExportedField: (map[interface {}]interface {}) (len=1) { + (string) (len=3) "one": (bool) true + } + } + +Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C +command as shown. + ([]uint8) (len=32 cap=32) { + 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | + 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| + 00000020 31 32 |12| + } + +Custom Formatter + +Spew provides a custom formatter that implements the fmt.Formatter interface +so that it integrates cleanly with standard fmt package printing functions. The +formatter is useful for inline printing of smaller data types similar to the +standard %v format specifier. + +The custom formatter only responds to the %v (most compact), %+v (adds pointer +addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb +combinations. Any other verbs such as %x and %q will be sent to the the +standard fmt package for formatting. In addition, the custom formatter ignores +the width and precision arguments (however they will still work on the format +specifiers not handled by the custom formatter). + +Custom Formatter Usage + +The simplest way to make use of the spew custom formatter is to call one of the +convenience functions such as spew.Printf, spew.Println, or spew.Printf. The +functions have syntax you are most likely already familiar with: + + spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + spew.Println(myVar, myVar2) + spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + +See the Index for the full list convenience functions. + +Sample Formatter Output + +Double pointer to a uint8: + %v: <**>5 + %+v: <**>(0xf8400420d0->0xf8400420c8)5 + %#v: (**uint8)5 + %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 + +Pointer to circular struct with a uint8 field and a pointer to itself: + %v: <*>{1 <*>} + %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)} + %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)} + %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)} + +See the Printf example for details on the setup of variables being shown +here. + +Errors + +Since it is possible for custom Stringer/error interfaces to panic, spew +detects them and handles them internally by printing the panic information +inline with the output. Since spew is intended to provide deep pretty printing +capabilities on structures, it intentionally does not return any errors. +*/ +package spew diff --git a/vendor/github.com/davecgh/go-spew/spew/dump.go b/vendor/github.com/davecgh/go-spew/spew/dump.go new file mode 100644 index 00000000..df1d582a --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/dump.go @@ -0,0 +1,509 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "encoding/hex" + "fmt" + "io" + "os" + "reflect" + "regexp" + "strconv" + "strings" +) + +var ( + // uint8Type is a reflect.Type representing a uint8. It is used to + // convert cgo types to uint8 slices for hexdumping. + uint8Type = reflect.TypeOf(uint8(0)) + + // cCharRE is a regular expression that matches a cgo char. + // It is used to detect character arrays to hexdump them. + cCharRE = regexp.MustCompile("^.*\\._Ctype_char$") + + // cUnsignedCharRE is a regular expression that matches a cgo unsigned + // char. It is used to detect unsigned character arrays to hexdump + // them. + cUnsignedCharRE = regexp.MustCompile("^.*\\._Ctype_unsignedchar$") + + // cUint8tCharRE is a regular expression that matches a cgo uint8_t. + // It is used to detect uint8_t arrays to hexdump them. + cUint8tCharRE = regexp.MustCompile("^.*\\._Ctype_uint8_t$") +) + +// dumpState contains information about the state of a dump operation. +type dumpState struct { + w io.Writer + depth int + pointers map[uintptr]int + ignoreNextType bool + ignoreNextIndent bool + cs *ConfigState +} + +// indent performs indentation according to the depth level and cs.Indent +// option. +func (d *dumpState) indent() { + if d.ignoreNextIndent { + d.ignoreNextIndent = false + return + } + d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth)) +} + +// unpackValue returns values inside of non-nil interfaces when possible. +// This is useful for data types like structs, arrays, slices, and maps which +// can contain varying types packed inside an interface. +func (d *dumpState) unpackValue(v reflect.Value) reflect.Value { + if v.Kind() == reflect.Interface && !v.IsNil() { + v = v.Elem() + } + return v +} + +// dumpPtr handles formatting of pointers by indirecting them as necessary. +func (d *dumpState) dumpPtr(v reflect.Value) { + // Remove pointers at or below the current depth from map used to detect + // circular refs. + for k, depth := range d.pointers { + if depth >= d.depth { + delete(d.pointers, k) + } + } + + // Keep list of all dereferenced pointers to show later. + pointerChain := make([]uintptr, 0) + + // Figure out how many levels of indirection there are by dereferencing + // pointers and unpacking interfaces down the chain while detecting circular + // references. + nilFound := false + cycleFound := false + indirects := 0 + ve := v + for ve.Kind() == reflect.Ptr { + if ve.IsNil() { + nilFound = true + break + } + indirects++ + addr := ve.Pointer() + pointerChain = append(pointerChain, addr) + if pd, ok := d.pointers[addr]; ok && pd < d.depth { + cycleFound = true + indirects-- + break + } + d.pointers[addr] = d.depth + + ve = ve.Elem() + if ve.Kind() == reflect.Interface { + if ve.IsNil() { + nilFound = true + break + } + ve = ve.Elem() + } + } + + // Display type information. + d.w.Write(openParenBytes) + d.w.Write(bytes.Repeat(asteriskBytes, indirects)) + d.w.Write([]byte(ve.Type().String())) + d.w.Write(closeParenBytes) + + // Display pointer information. + if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 { + d.w.Write(openParenBytes) + for i, addr := range pointerChain { + if i > 0 { + d.w.Write(pointerChainBytes) + } + printHexPtr(d.w, addr) + } + d.w.Write(closeParenBytes) + } + + // Display dereferenced value. + d.w.Write(openParenBytes) + switch { + case nilFound == true: + d.w.Write(nilAngleBytes) + + case cycleFound == true: + d.w.Write(circularBytes) + + default: + d.ignoreNextType = true + d.dump(ve) + } + d.w.Write(closeParenBytes) +} + +// dumpSlice handles formatting of arrays and slices. Byte (uint8 under +// reflection) arrays and slices are dumped in hexdump -C fashion. +func (d *dumpState) dumpSlice(v reflect.Value) { + // Determine whether this type should be hex dumped or not. Also, + // for types which should be hexdumped, try to use the underlying data + // first, then fall back to trying to convert them to a uint8 slice. + var buf []uint8 + doConvert := false + doHexDump := false + numEntries := v.Len() + if numEntries > 0 { + vt := v.Index(0).Type() + vts := vt.String() + switch { + // C types that need to be converted. + case cCharRE.MatchString(vts): + fallthrough + case cUnsignedCharRE.MatchString(vts): + fallthrough + case cUint8tCharRE.MatchString(vts): + doConvert = true + + // Try to use existing uint8 slices and fall back to converting + // and copying if that fails. + case vt.Kind() == reflect.Uint8: + // We need an addressable interface to convert the type + // to a byte slice. However, the reflect package won't + // give us an interface on certain things like + // unexported struct fields in order to enforce + // visibility rules. We use unsafe, when available, to + // bypass these restrictions since this package does not + // mutate the values. + vs := v + if !vs.CanInterface() || !vs.CanAddr() { + vs = unsafeReflectValue(vs) + } + if !UnsafeDisabled { + vs = vs.Slice(0, numEntries) + + // Use the existing uint8 slice if it can be + // type asserted. + iface := vs.Interface() + if slice, ok := iface.([]uint8); ok { + buf = slice + doHexDump = true + break + } + } + + // The underlying data needs to be converted if it can't + // be type asserted to a uint8 slice. + doConvert = true + } + + // Copy and convert the underlying type if needed. + if doConvert && vt.ConvertibleTo(uint8Type) { + // Convert and copy each element into a uint8 byte + // slice. + buf = make([]uint8, numEntries) + for i := 0; i < numEntries; i++ { + vv := v.Index(i) + buf[i] = uint8(vv.Convert(uint8Type).Uint()) + } + doHexDump = true + } + } + + // Hexdump the entire slice as needed. + if doHexDump { + indent := strings.Repeat(d.cs.Indent, d.depth) + str := indent + hex.Dump(buf) + str = strings.Replace(str, "\n", "\n"+indent, -1) + str = strings.TrimRight(str, d.cs.Indent) + d.w.Write([]byte(str)) + return + } + + // Recursively call dump for each item. + for i := 0; i < numEntries; i++ { + d.dump(d.unpackValue(v.Index(i))) + if i < (numEntries - 1) { + d.w.Write(commaNewlineBytes) + } else { + d.w.Write(newlineBytes) + } + } +} + +// dump is the main workhorse for dumping a value. It uses the passed reflect +// value to figure out what kind of object we are dealing with and formats it +// appropriately. It is a recursive function, however circular data structures +// are detected and handled properly. +func (d *dumpState) dump(v reflect.Value) { + // Handle invalid reflect values immediately. + kind := v.Kind() + if kind == reflect.Invalid { + d.w.Write(invalidAngleBytes) + return + } + + // Handle pointers specially. + if kind == reflect.Ptr { + d.indent() + d.dumpPtr(v) + return + } + + // Print type information unless already handled elsewhere. + if !d.ignoreNextType { + d.indent() + d.w.Write(openParenBytes) + d.w.Write([]byte(v.Type().String())) + d.w.Write(closeParenBytes) + d.w.Write(spaceBytes) + } + d.ignoreNextType = false + + // Display length and capacity if the built-in len and cap functions + // work with the value's kind and the len/cap itself is non-zero. + valueLen, valueCap := 0, 0 + switch v.Kind() { + case reflect.Array, reflect.Slice, reflect.Chan: + valueLen, valueCap = v.Len(), v.Cap() + case reflect.Map, reflect.String: + valueLen = v.Len() + } + if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 { + d.w.Write(openParenBytes) + if valueLen != 0 { + d.w.Write(lenEqualsBytes) + printInt(d.w, int64(valueLen), 10) + } + if !d.cs.DisableCapacities && valueCap != 0 { + if valueLen != 0 { + d.w.Write(spaceBytes) + } + d.w.Write(capEqualsBytes) + printInt(d.w, int64(valueCap), 10) + } + d.w.Write(closeParenBytes) + d.w.Write(spaceBytes) + } + + // Call Stringer/error interfaces if they exist and the handle methods flag + // is enabled + if !d.cs.DisableMethods { + if (kind != reflect.Invalid) && (kind != reflect.Interface) { + if handled := handleMethods(d.cs, d.w, v); handled { + return + } + } + } + + switch kind { + case reflect.Invalid: + // Do nothing. We should never get here since invalid has already + // been handled above. + + case reflect.Bool: + printBool(d.w, v.Bool()) + + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + printInt(d.w, v.Int(), 10) + + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + printUint(d.w, v.Uint(), 10) + + case reflect.Float32: + printFloat(d.w, v.Float(), 32) + + case reflect.Float64: + printFloat(d.w, v.Float(), 64) + + case reflect.Complex64: + printComplex(d.w, v.Complex(), 32) + + case reflect.Complex128: + printComplex(d.w, v.Complex(), 64) + + case reflect.Slice: + if v.IsNil() { + d.w.Write(nilAngleBytes) + break + } + fallthrough + + case reflect.Array: + d.w.Write(openBraceNewlineBytes) + d.depth++ + if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { + d.indent() + d.w.Write(maxNewlineBytes) + } else { + d.dumpSlice(v) + } + d.depth-- + d.indent() + d.w.Write(closeBraceBytes) + + case reflect.String: + d.w.Write([]byte(strconv.Quote(v.String()))) + + case reflect.Interface: + // The only time we should get here is for nil interfaces due to + // unpackValue calls. + if v.IsNil() { + d.w.Write(nilAngleBytes) + } + + case reflect.Ptr: + // Do nothing. We should never get here since pointers have already + // been handled above. + + case reflect.Map: + // nil maps should be indicated as different than empty maps + if v.IsNil() { + d.w.Write(nilAngleBytes) + break + } + + d.w.Write(openBraceNewlineBytes) + d.depth++ + if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { + d.indent() + d.w.Write(maxNewlineBytes) + } else { + numEntries := v.Len() + keys := v.MapKeys() + if d.cs.SortKeys { + sortValues(keys, d.cs) + } + for i, key := range keys { + d.dump(d.unpackValue(key)) + d.w.Write(colonSpaceBytes) + d.ignoreNextIndent = true + d.dump(d.unpackValue(v.MapIndex(key))) + if i < (numEntries - 1) { + d.w.Write(commaNewlineBytes) + } else { + d.w.Write(newlineBytes) + } + } + } + d.depth-- + d.indent() + d.w.Write(closeBraceBytes) + + case reflect.Struct: + d.w.Write(openBraceNewlineBytes) + d.depth++ + if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { + d.indent() + d.w.Write(maxNewlineBytes) + } else { + vt := v.Type() + numFields := v.NumField() + for i := 0; i < numFields; i++ { + d.indent() + vtf := vt.Field(i) + d.w.Write([]byte(vtf.Name)) + d.w.Write(colonSpaceBytes) + d.ignoreNextIndent = true + d.dump(d.unpackValue(v.Field(i))) + if i < (numFields - 1) { + d.w.Write(commaNewlineBytes) + } else { + d.w.Write(newlineBytes) + } + } + } + d.depth-- + d.indent() + d.w.Write(closeBraceBytes) + + case reflect.Uintptr: + printHexPtr(d.w, uintptr(v.Uint())) + + case reflect.UnsafePointer, reflect.Chan, reflect.Func: + printHexPtr(d.w, v.Pointer()) + + // There were not any other types at the time this code was written, but + // fall back to letting the default fmt package handle it in case any new + // types are added. + default: + if v.CanInterface() { + fmt.Fprintf(d.w, "%v", v.Interface()) + } else { + fmt.Fprintf(d.w, "%v", v.String()) + } + } +} + +// fdump is a helper function to consolidate the logic from the various public +// methods which take varying writers and config states. +func fdump(cs *ConfigState, w io.Writer, a ...interface{}) { + for _, arg := range a { + if arg == nil { + w.Write(interfaceBytes) + w.Write(spaceBytes) + w.Write(nilAngleBytes) + w.Write(newlineBytes) + continue + } + + d := dumpState{w: w, cs: cs} + d.pointers = make(map[uintptr]int) + d.dump(reflect.ValueOf(arg)) + d.w.Write(newlineBytes) + } +} + +// Fdump formats and displays the passed arguments to io.Writer w. It formats +// exactly the same as Dump. +func Fdump(w io.Writer, a ...interface{}) { + fdump(&Config, w, a...) +} + +// Sdump returns a string with the passed arguments formatted exactly the same +// as Dump. +func Sdump(a ...interface{}) string { + var buf bytes.Buffer + fdump(&Config, &buf, a...) + return buf.String() +} + +/* +Dump displays the passed parameters to standard out with newlines, customizable +indentation, and additional debug information such as complete types and all +pointer addresses used to indirect to the final value. It provides the +following features over the built-in printing facilities provided by the fmt +package: + + * Pointers are dereferenced and followed + * Circular data structures are detected and handled properly + * Custom Stringer/error interfaces are optionally invoked, including + on unexported types + * Custom types which only implement the Stringer/error interfaces via + a pointer receiver are optionally invoked when passing non-pointer + variables + * Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output + +The configuration options are controlled by an exported package global, +spew.Config. See ConfigState for options documentation. + +See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to +get the formatted result as a string. +*/ +func Dump(a ...interface{}) { + fdump(&Config, os.Stdout, a...) +} diff --git a/vendor/github.com/davecgh/go-spew/spew/dump_test.go b/vendor/github.com/davecgh/go-spew/spew/dump_test.go new file mode 100644 index 00000000..5aad9c7a --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/dump_test.go @@ -0,0 +1,1042 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* +Test Summary: +NOTE: For each test, a nil pointer, a single pointer and double pointer to the +base test element are also tested to ensure proper indirection across all types. + +- Max int8, int16, int32, int64, int +- Max uint8, uint16, uint32, uint64, uint +- Boolean true and false +- Standard complex64 and complex128 +- Array containing standard ints +- Array containing type with custom formatter on pointer receiver only +- Array containing interfaces +- Array containing bytes +- Slice containing standard float32 values +- Slice containing type with custom formatter on pointer receiver only +- Slice containing interfaces +- Slice containing bytes +- Nil slice +- Standard string +- Nil interface +- Sub-interface +- Map with string keys and int vals +- Map with custom formatter type on pointer receiver only keys and vals +- Map with interface keys and values +- Map with nil interface value +- Struct with primitives +- Struct that contains another struct +- Struct that contains custom type with Stringer pointer interface via both + exported and unexported fields +- Struct that contains embedded struct and field to same struct +- Uintptr to 0 (null pointer) +- Uintptr address of real variable +- Unsafe.Pointer to 0 (null pointer) +- Unsafe.Pointer to address of real variable +- Nil channel +- Standard int channel +- Function with no params and no returns +- Function with param and no returns +- Function with multiple params and multiple returns +- Struct that is circular through self referencing +- Structs that are circular through cross referencing +- Structs that are indirectly circular +- Type that panics in its Stringer interface +*/ + +package spew_test + +import ( + "bytes" + "fmt" + "testing" + "unsafe" + + "github.com/davecgh/go-spew/spew" +) + +// dumpTest is used to describe a test to be performed against the Dump method. +type dumpTest struct { + in interface{} + wants []string +} + +// dumpTests houses all of the tests to be performed against the Dump method. +var dumpTests = make([]dumpTest, 0) + +// addDumpTest is a helper method to append the passed input and desired result +// to dumpTests +func addDumpTest(in interface{}, wants ...string) { + test := dumpTest{in, wants} + dumpTests = append(dumpTests, test) +} + +func addIntDumpTests() { + // Max int8. + v := int8(127) + nv := (*int8)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "int8" + vs := "127" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Max int16. + v2 := int16(32767) + nv2 := (*int16)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "int16" + v2s := "32767" + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") + addDumpTest(nv2, "(*"+v2t+")()\n") + + // Max int32. + v3 := int32(2147483647) + nv3 := (*int32)(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "int32" + v3s := "2147483647" + addDumpTest(v3, "("+v3t+") "+v3s+"\n") + addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") + addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") + addDumpTest(nv3, "(*"+v3t+")()\n") + + // Max int64. + v4 := int64(9223372036854775807) + nv4 := (*int64)(nil) + pv4 := &v4 + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "int64" + v4s := "9223372036854775807" + addDumpTest(v4, "("+v4t+") "+v4s+"\n") + addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") + addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") + addDumpTest(nv4, "(*"+v4t+")()\n") + + // Max int. + v5 := int(2147483647) + nv5 := (*int)(nil) + pv5 := &v5 + v5Addr := fmt.Sprintf("%p", pv5) + pv5Addr := fmt.Sprintf("%p", &pv5) + v5t := "int" + v5s := "2147483647" + addDumpTest(v5, "("+v5t+") "+v5s+"\n") + addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n") + addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n") + addDumpTest(nv5, "(*"+v5t+")()\n") +} + +func addUintDumpTests() { + // Max uint8. + v := uint8(255) + nv := (*uint8)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "uint8" + vs := "255" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Max uint16. + v2 := uint16(65535) + nv2 := (*uint16)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "uint16" + v2s := "65535" + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") + addDumpTest(nv2, "(*"+v2t+")()\n") + + // Max uint32. + v3 := uint32(4294967295) + nv3 := (*uint32)(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "uint32" + v3s := "4294967295" + addDumpTest(v3, "("+v3t+") "+v3s+"\n") + addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") + addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") + addDumpTest(nv3, "(*"+v3t+")()\n") + + // Max uint64. + v4 := uint64(18446744073709551615) + nv4 := (*uint64)(nil) + pv4 := &v4 + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "uint64" + v4s := "18446744073709551615" + addDumpTest(v4, "("+v4t+") "+v4s+"\n") + addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") + addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") + addDumpTest(nv4, "(*"+v4t+")()\n") + + // Max uint. + v5 := uint(4294967295) + nv5 := (*uint)(nil) + pv5 := &v5 + v5Addr := fmt.Sprintf("%p", pv5) + pv5Addr := fmt.Sprintf("%p", &pv5) + v5t := "uint" + v5s := "4294967295" + addDumpTest(v5, "("+v5t+") "+v5s+"\n") + addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n") + addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n") + addDumpTest(nv5, "(*"+v5t+")()\n") +} + +func addBoolDumpTests() { + // Boolean true. + v := bool(true) + nv := (*bool)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "bool" + vs := "true" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Boolean false. + v2 := bool(false) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "bool" + v2s := "false" + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") +} + +func addFloatDumpTests() { + // Standard float32. + v := float32(3.1415) + nv := (*float32)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "float32" + vs := "3.1415" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Standard float64. + v2 := float64(3.1415926) + nv2 := (*float64)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "float64" + v2s := "3.1415926" + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") + addDumpTest(nv2, "(*"+v2t+")()\n") +} + +func addComplexDumpTests() { + // Standard complex64. + v := complex(float32(6), -2) + nv := (*complex64)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "complex64" + vs := "(6-2i)" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Standard complex128. + v2 := complex(float64(-6), 2) + nv2 := (*complex128)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "complex128" + v2s := "(-6+2i)" + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") + addDumpTest(nv2, "(*"+v2t+")()\n") +} + +func addArrayDumpTests() { + // Array containing standard ints. + v := [3]int{1, 2, 3} + vLen := fmt.Sprintf("%d", len(v)) + vCap := fmt.Sprintf("%d", cap(v)) + nv := (*[3]int)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "int" + vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 1,\n (" + + vt + ") 2,\n (" + vt + ") 3\n}" + addDumpTest(v, "([3]"+vt+") "+vs+"\n") + addDumpTest(pv, "(*[3]"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**[3]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*[3]"+vt+")()\n") + + // Array containing type with custom formatter on pointer receiver only. + v2i0 := pstringer("1") + v2i1 := pstringer("2") + v2i2 := pstringer("3") + v2 := [3]pstringer{v2i0, v2i1, v2i2} + v2i0Len := fmt.Sprintf("%d", len(v2i0)) + v2i1Len := fmt.Sprintf("%d", len(v2i1)) + v2i2Len := fmt.Sprintf("%d", len(v2i2)) + v2Len := fmt.Sprintf("%d", len(v2)) + v2Cap := fmt.Sprintf("%d", cap(v2)) + nv2 := (*[3]pstringer)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "spew_test.pstringer" + v2sp := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + + ") (len=" + v2i0Len + ") stringer 1,\n (" + v2t + + ") (len=" + v2i1Len + ") stringer 2,\n (" + v2t + + ") (len=" + v2i2Len + ") " + "stringer 3\n}" + v2s := v2sp + if spew.UnsafeDisabled { + v2s = "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + + ") (len=" + v2i0Len + ") \"1\",\n (" + v2t + ") (len=" + + v2i1Len + ") \"2\",\n (" + v2t + ") (len=" + v2i2Len + + ") " + "\"3\"\n}" + } + addDumpTest(v2, "([3]"+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*[3]"+v2t+")("+v2Addr+")("+v2sp+")\n") + addDumpTest(&pv2, "(**[3]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2sp+")\n") + addDumpTest(nv2, "(*[3]"+v2t+")()\n") + + // Array containing interfaces. + v3i0 := "one" + v3 := [3]interface{}{v3i0, int(2), uint(3)} + v3i0Len := fmt.Sprintf("%d", len(v3i0)) + v3Len := fmt.Sprintf("%d", len(v3)) + v3Cap := fmt.Sprintf("%d", cap(v3)) + nv3 := (*[3]interface{})(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "[3]interface {}" + v3t2 := "string" + v3t3 := "int" + v3t4 := "uint" + v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " + + "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" + + v3t4 + ") 3\n}" + addDumpTest(v3, "("+v3t+") "+v3s+"\n") + addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") + addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") + addDumpTest(nv3, "(*"+v3t+")()\n") + + // Array containing bytes. + v4 := [34]byte{ + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, + } + v4Len := fmt.Sprintf("%d", len(v4)) + v4Cap := fmt.Sprintf("%d", cap(v4)) + nv4 := (*[34]byte)(nil) + pv4 := &v4 + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "[34]uint8" + v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " + + "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" + + " |............... |\n" + + " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" + + " |!\"#$%&'()*+,-./0|\n" + + " 00000020 31 32 " + + " |12|\n}" + addDumpTest(v4, "("+v4t+") "+v4s+"\n") + addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") + addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") + addDumpTest(nv4, "(*"+v4t+")()\n") +} + +func addSliceDumpTests() { + // Slice containing standard float32 values. + v := []float32{3.14, 6.28, 12.56} + vLen := fmt.Sprintf("%d", len(v)) + vCap := fmt.Sprintf("%d", cap(v)) + nv := (*[]float32)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "float32" + vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 3.14,\n (" + + vt + ") 6.28,\n (" + vt + ") 12.56\n}" + addDumpTest(v, "([]"+vt+") "+vs+"\n") + addDumpTest(pv, "(*[]"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**[]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*[]"+vt+")()\n") + + // Slice containing type with custom formatter on pointer receiver only. + v2i0 := pstringer("1") + v2i1 := pstringer("2") + v2i2 := pstringer("3") + v2 := []pstringer{v2i0, v2i1, v2i2} + v2i0Len := fmt.Sprintf("%d", len(v2i0)) + v2i1Len := fmt.Sprintf("%d", len(v2i1)) + v2i2Len := fmt.Sprintf("%d", len(v2i2)) + v2Len := fmt.Sprintf("%d", len(v2)) + v2Cap := fmt.Sprintf("%d", cap(v2)) + nv2 := (*[]pstringer)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "spew_test.pstringer" + v2s := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + ") (len=" + + v2i0Len + ") stringer 1,\n (" + v2t + ") (len=" + v2i1Len + + ") stringer 2,\n (" + v2t + ") (len=" + v2i2Len + ") " + + "stringer 3\n}" + addDumpTest(v2, "([]"+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*[]"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**[]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") + addDumpTest(nv2, "(*[]"+v2t+")()\n") + + // Slice containing interfaces. + v3i0 := "one" + v3 := []interface{}{v3i0, int(2), uint(3), nil} + v3i0Len := fmt.Sprintf("%d", len(v3i0)) + v3Len := fmt.Sprintf("%d", len(v3)) + v3Cap := fmt.Sprintf("%d", cap(v3)) + nv3 := (*[]interface{})(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "[]interface {}" + v3t2 := "string" + v3t3 := "int" + v3t4 := "uint" + v3t5 := "interface {}" + v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " + + "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" + + v3t4 + ") 3,\n (" + v3t5 + ") \n}" + addDumpTest(v3, "("+v3t+") "+v3s+"\n") + addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") + addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") + addDumpTest(nv3, "(*"+v3t+")()\n") + + // Slice containing bytes. + v4 := []byte{ + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, + } + v4Len := fmt.Sprintf("%d", len(v4)) + v4Cap := fmt.Sprintf("%d", cap(v4)) + nv4 := (*[]byte)(nil) + pv4 := &v4 + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "[]uint8" + v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " + + "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" + + " |............... |\n" + + " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" + + " |!\"#$%&'()*+,-./0|\n" + + " 00000020 31 32 " + + " |12|\n}" + addDumpTest(v4, "("+v4t+") "+v4s+"\n") + addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") + addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") + addDumpTest(nv4, "(*"+v4t+")()\n") + + // Nil slice. + v5 := []int(nil) + nv5 := (*[]int)(nil) + pv5 := &v5 + v5Addr := fmt.Sprintf("%p", pv5) + pv5Addr := fmt.Sprintf("%p", &pv5) + v5t := "[]int" + v5s := "" + addDumpTest(v5, "("+v5t+") "+v5s+"\n") + addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n") + addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n") + addDumpTest(nv5, "(*"+v5t+")()\n") +} + +func addStringDumpTests() { + // Standard string. + v := "test" + vLen := fmt.Sprintf("%d", len(v)) + nv := (*string)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "string" + vs := "(len=" + vLen + ") \"test\"" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") +} + +func addInterfaceDumpTests() { + // Nil interface. + var v interface{} + nv := (*interface{})(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "interface {}" + vs := "" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Sub-interface. + v2 := interface{}(uint16(65535)) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "uint16" + v2s := "65535" + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") +} + +func addMapDumpTests() { + // Map with string keys and int vals. + k := "one" + kk := "two" + m := map[string]int{k: 1, kk: 2} + klen := fmt.Sprintf("%d", len(k)) // not kLen to shut golint up + kkLen := fmt.Sprintf("%d", len(kk)) + mLen := fmt.Sprintf("%d", len(m)) + nilMap := map[string]int(nil) + nm := (*map[string]int)(nil) + pm := &m + mAddr := fmt.Sprintf("%p", pm) + pmAddr := fmt.Sprintf("%p", &pm) + mt := "map[string]int" + mt1 := "string" + mt2 := "int" + ms := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + klen + ") " + + "\"one\": (" + mt2 + ") 1,\n (" + mt1 + ") (len=" + kkLen + + ") \"two\": (" + mt2 + ") 2\n}" + ms2 := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + kkLen + ") " + + "\"two\": (" + mt2 + ") 2,\n (" + mt1 + ") (len=" + klen + + ") \"one\": (" + mt2 + ") 1\n}" + addDumpTest(m, "("+mt+") "+ms+"\n", "("+mt+") "+ms2+"\n") + addDumpTest(pm, "(*"+mt+")("+mAddr+")("+ms+")\n", + "(*"+mt+")("+mAddr+")("+ms2+")\n") + addDumpTest(&pm, "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms+")\n", + "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms2+")\n") + addDumpTest(nm, "(*"+mt+")()\n") + addDumpTest(nilMap, "("+mt+") \n") + + // Map with custom formatter type on pointer receiver only keys and vals. + k2 := pstringer("one") + v2 := pstringer("1") + m2 := map[pstringer]pstringer{k2: v2} + k2Len := fmt.Sprintf("%d", len(k2)) + v2Len := fmt.Sprintf("%d", len(v2)) + m2Len := fmt.Sprintf("%d", len(m2)) + nilMap2 := map[pstringer]pstringer(nil) + nm2 := (*map[pstringer]pstringer)(nil) + pm2 := &m2 + m2Addr := fmt.Sprintf("%p", pm2) + pm2Addr := fmt.Sprintf("%p", &pm2) + m2t := "map[spew_test.pstringer]spew_test.pstringer" + m2t1 := "spew_test.pstringer" + m2t2 := "spew_test.pstringer" + m2s := "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len + ") " + + "stringer one: (" + m2t2 + ") (len=" + v2Len + ") stringer 1\n}" + if spew.UnsafeDisabled { + m2s = "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len + + ") " + "\"one\": (" + m2t2 + ") (len=" + v2Len + + ") \"1\"\n}" + } + addDumpTest(m2, "("+m2t+") "+m2s+"\n") + addDumpTest(pm2, "(*"+m2t+")("+m2Addr+")("+m2s+")\n") + addDumpTest(&pm2, "(**"+m2t+")("+pm2Addr+"->"+m2Addr+")("+m2s+")\n") + addDumpTest(nm2, "(*"+m2t+")()\n") + addDumpTest(nilMap2, "("+m2t+") \n") + + // Map with interface keys and values. + k3 := "one" + k3Len := fmt.Sprintf("%d", len(k3)) + m3 := map[interface{}]interface{}{k3: 1} + m3Len := fmt.Sprintf("%d", len(m3)) + nilMap3 := map[interface{}]interface{}(nil) + nm3 := (*map[interface{}]interface{})(nil) + pm3 := &m3 + m3Addr := fmt.Sprintf("%p", pm3) + pm3Addr := fmt.Sprintf("%p", &pm3) + m3t := "map[interface {}]interface {}" + m3t1 := "string" + m3t2 := "int" + m3s := "(len=" + m3Len + ") {\n (" + m3t1 + ") (len=" + k3Len + ") " + + "\"one\": (" + m3t2 + ") 1\n}" + addDumpTest(m3, "("+m3t+") "+m3s+"\n") + addDumpTest(pm3, "(*"+m3t+")("+m3Addr+")("+m3s+")\n") + addDumpTest(&pm3, "(**"+m3t+")("+pm3Addr+"->"+m3Addr+")("+m3s+")\n") + addDumpTest(nm3, "(*"+m3t+")()\n") + addDumpTest(nilMap3, "("+m3t+") \n") + + // Map with nil interface value. + k4 := "nil" + k4Len := fmt.Sprintf("%d", len(k4)) + m4 := map[string]interface{}{k4: nil} + m4Len := fmt.Sprintf("%d", len(m4)) + nilMap4 := map[string]interface{}(nil) + nm4 := (*map[string]interface{})(nil) + pm4 := &m4 + m4Addr := fmt.Sprintf("%p", pm4) + pm4Addr := fmt.Sprintf("%p", &pm4) + m4t := "map[string]interface {}" + m4t1 := "string" + m4t2 := "interface {}" + m4s := "(len=" + m4Len + ") {\n (" + m4t1 + ") (len=" + k4Len + ")" + + " \"nil\": (" + m4t2 + ") \n}" + addDumpTest(m4, "("+m4t+") "+m4s+"\n") + addDumpTest(pm4, "(*"+m4t+")("+m4Addr+")("+m4s+")\n") + addDumpTest(&pm4, "(**"+m4t+")("+pm4Addr+"->"+m4Addr+")("+m4s+")\n") + addDumpTest(nm4, "(*"+m4t+")()\n") + addDumpTest(nilMap4, "("+m4t+") \n") +} + +func addStructDumpTests() { + // Struct with primitives. + type s1 struct { + a int8 + b uint8 + } + v := s1{127, 255} + nv := (*s1)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "spew_test.s1" + vt2 := "int8" + vt3 := "uint8" + vs := "{\n a: (" + vt2 + ") 127,\n b: (" + vt3 + ") 255\n}" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Struct that contains another struct. + type s2 struct { + s1 s1 + b bool + } + v2 := s2{s1{127, 255}, true} + nv2 := (*s2)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "spew_test.s2" + v2t2 := "spew_test.s1" + v2t3 := "int8" + v2t4 := "uint8" + v2t5 := "bool" + v2s := "{\n s1: (" + v2t2 + ") {\n a: (" + v2t3 + ") 127,\n b: (" + + v2t4 + ") 255\n },\n b: (" + v2t5 + ") true\n}" + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") + addDumpTest(nv2, "(*"+v2t+")()\n") + + // Struct that contains custom type with Stringer pointer interface via both + // exported and unexported fields. + type s3 struct { + s pstringer + S pstringer + } + v3 := s3{"test", "test2"} + nv3 := (*s3)(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "spew_test.s3" + v3t2 := "spew_test.pstringer" + v3s := "{\n s: (" + v3t2 + ") (len=4) stringer test,\n S: (" + v3t2 + + ") (len=5) stringer test2\n}" + v3sp := v3s + if spew.UnsafeDisabled { + v3s = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" + + v3t2 + ") (len=5) \"test2\"\n}" + v3sp = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" + + v3t2 + ") (len=5) stringer test2\n}" + } + addDumpTest(v3, "("+v3t+") "+v3s+"\n") + addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3sp+")\n") + addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3sp+")\n") + addDumpTest(nv3, "(*"+v3t+")()\n") + + // Struct that contains embedded struct and field to same struct. + e := embed{"embedstr"} + eLen := fmt.Sprintf("%d", len("embedstr")) + v4 := embedwrap{embed: &e, e: &e} + nv4 := (*embedwrap)(nil) + pv4 := &v4 + eAddr := fmt.Sprintf("%p", &e) + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "spew_test.embedwrap" + v4t2 := "spew_test.embed" + v4t3 := "string" + v4s := "{\n embed: (*" + v4t2 + ")(" + eAddr + ")({\n a: (" + v4t3 + + ") (len=" + eLen + ") \"embedstr\"\n }),\n e: (*" + v4t2 + + ")(" + eAddr + ")({\n a: (" + v4t3 + ") (len=" + eLen + ")" + + " \"embedstr\"\n })\n}" + addDumpTest(v4, "("+v4t+") "+v4s+"\n") + addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") + addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") + addDumpTest(nv4, "(*"+v4t+")()\n") +} + +func addUintptrDumpTests() { + // Null pointer. + v := uintptr(0) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "uintptr" + vs := "" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + + // Address of real variable. + i := 1 + v2 := uintptr(unsafe.Pointer(&i)) + nv2 := (*uintptr)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "uintptr" + v2s := fmt.Sprintf("%p", &i) + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") + addDumpTest(nv2, "(*"+v2t+")()\n") +} + +func addUnsafePointerDumpTests() { + // Null pointer. + v := unsafe.Pointer(uintptr(0)) + nv := (*unsafe.Pointer)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "unsafe.Pointer" + vs := "" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Address of real variable. + i := 1 + v2 := unsafe.Pointer(&i) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "unsafe.Pointer" + v2s := fmt.Sprintf("%p", &i) + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") + addDumpTest(nv, "(*"+vt+")()\n") +} + +func addChanDumpTests() { + // Nil channel. + var v chan int + pv := &v + nv := (*chan int)(nil) + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "chan int" + vs := "" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Real channel. + v2 := make(chan int) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "chan int" + v2s := fmt.Sprintf("%p", v2) + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") +} + +func addFuncDumpTests() { + // Function with no params and no returns. + v := addIntDumpTests + nv := (*func())(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "func()" + vs := fmt.Sprintf("%p", v) + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") + + // Function with param and no returns. + v2 := TestDump + nv2 := (*func(*testing.T))(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "func(*testing.T)" + v2s := fmt.Sprintf("%p", v2) + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") + addDumpTest(nv2, "(*"+v2t+")()\n") + + // Function with multiple params and multiple returns. + var v3 = func(i int, s string) (b bool, err error) { + return true, nil + } + nv3 := (*func(int, string) (bool, error))(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "func(int, string) (bool, error)" + v3s := fmt.Sprintf("%p", v3) + addDumpTest(v3, "("+v3t+") "+v3s+"\n") + addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") + addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") + addDumpTest(nv3, "(*"+v3t+")()\n") +} + +func addCircularDumpTests() { + // Struct that is circular through self referencing. + type circular struct { + c *circular + } + v := circular{nil} + v.c = &v + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "spew_test.circular" + vs := "{\n c: (*" + vt + ")(" + vAddr + ")({\n c: (*" + vt + ")(" + + vAddr + ")()\n })\n}" + vs2 := "{\n c: (*" + vt + ")(" + vAddr + ")()\n}" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs2+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs2+")\n") + + // Structs that are circular through cross referencing. + v2 := xref1{nil} + ts2 := xref2{&v2} + v2.ps2 = &ts2 + pv2 := &v2 + ts2Addr := fmt.Sprintf("%p", &ts2) + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "spew_test.xref1" + v2t2 := "spew_test.xref2" + v2s := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t + + ")(" + v2Addr + ")({\n ps2: (*" + v2t2 + ")(" + ts2Addr + + ")()\n })\n })\n}" + v2s2 := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t + + ")(" + v2Addr + ")()\n })\n}" + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s2+")\n") + addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s2+")\n") + + // Structs that are indirectly circular. + v3 := indirCir1{nil} + tic2 := indirCir2{nil} + tic3 := indirCir3{&v3} + tic2.ps3 = &tic3 + v3.ps2 = &tic2 + pv3 := &v3 + tic2Addr := fmt.Sprintf("%p", &tic2) + tic3Addr := fmt.Sprintf("%p", &tic3) + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "spew_test.indirCir1" + v3t2 := "spew_test.indirCir2" + v3t3 := "spew_test.indirCir3" + v3s := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 + + ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr + + ")({\n ps2: (*" + v3t2 + ")(" + tic2Addr + + ")()\n })\n })\n })\n}" + v3s2 := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 + + ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr + + ")()\n })\n })\n}" + addDumpTest(v3, "("+v3t+") "+v3s+"\n") + addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s2+")\n") + addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s2+")\n") +} + +func addPanicDumpTests() { + // Type that panics in its Stringer interface. + v := panicer(127) + nv := (*panicer)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "spew_test.panicer" + vs := "(PANIC=test panic)127" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") +} + +func addErrorDumpTests() { + // Type that has a custom Error interface. + v := customError(127) + nv := (*customError)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "spew_test.customError" + vs := "error: 127" + addDumpTest(v, "("+vt+") "+vs+"\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") + addDumpTest(nv, "(*"+vt+")()\n") +} + +// TestDump executes all of the tests described by dumpTests. +func TestDump(t *testing.T) { + // Setup tests. + addIntDumpTests() + addUintDumpTests() + addBoolDumpTests() + addFloatDumpTests() + addComplexDumpTests() + addArrayDumpTests() + addSliceDumpTests() + addStringDumpTests() + addInterfaceDumpTests() + addMapDumpTests() + addStructDumpTests() + addUintptrDumpTests() + addUnsafePointerDumpTests() + addChanDumpTests() + addFuncDumpTests() + addCircularDumpTests() + addPanicDumpTests() + addErrorDumpTests() + addCgoDumpTests() + + t.Logf("Running %d tests", len(dumpTests)) + for i, test := range dumpTests { + buf := new(bytes.Buffer) + spew.Fdump(buf, test.in) + s := buf.String() + if testFailed(s, test.wants) { + t.Errorf("Dump #%d\n got: %s %s", i, s, stringizeWants(test.wants)) + continue + } + } +} + +func TestDumpSortedKeys(t *testing.T) { + cfg := spew.ConfigState{SortKeys: true} + s := cfg.Sdump(map[int]string{1: "1", 3: "3", 2: "2"}) + expected := "(map[int]string) (len=3) {\n(int) 1: (string) (len=1) " + + "\"1\",\n(int) 2: (string) (len=1) \"2\",\n(int) 3: (string) " + + "(len=1) \"3\"\n" + + "}\n" + if s != expected { + t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) + } + + s = cfg.Sdump(map[stringer]int{"1": 1, "3": 3, "2": 2}) + expected = "(map[spew_test.stringer]int) (len=3) {\n" + + "(spew_test.stringer) (len=1) stringer 1: (int) 1,\n" + + "(spew_test.stringer) (len=1) stringer 2: (int) 2,\n" + + "(spew_test.stringer) (len=1) stringer 3: (int) 3\n" + + "}\n" + if s != expected { + t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) + } + + s = cfg.Sdump(map[pstringer]int{pstringer("1"): 1, pstringer("3"): 3, pstringer("2"): 2}) + expected = "(map[spew_test.pstringer]int) (len=3) {\n" + + "(spew_test.pstringer) (len=1) stringer 1: (int) 1,\n" + + "(spew_test.pstringer) (len=1) stringer 2: (int) 2,\n" + + "(spew_test.pstringer) (len=1) stringer 3: (int) 3\n" + + "}\n" + if spew.UnsafeDisabled { + expected = "(map[spew_test.pstringer]int) (len=3) {\n" + + "(spew_test.pstringer) (len=1) \"1\": (int) 1,\n" + + "(spew_test.pstringer) (len=1) \"2\": (int) 2,\n" + + "(spew_test.pstringer) (len=1) \"3\": (int) 3\n" + + "}\n" + } + if s != expected { + t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) + } + + s = cfg.Sdump(map[customError]int{customError(1): 1, customError(3): 3, customError(2): 2}) + expected = "(map[spew_test.customError]int) (len=3) {\n" + + "(spew_test.customError) error: 1: (int) 1,\n" + + "(spew_test.customError) error: 2: (int) 2,\n" + + "(spew_test.customError) error: 3: (int) 3\n" + + "}\n" + if s != expected { + t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) + } + +} diff --git a/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go b/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go new file mode 100644 index 00000000..6ab18080 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go @@ -0,0 +1,99 @@ +// Copyright (c) 2013-2016 Dave Collins +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when both cgo is supported and "-tags testcgo" is added to the go test +// command line. This means the cgo tests are only added (and hence run) when +// specifially requested. This configuration is used because spew itself +// does not require cgo to run even though it does handle certain cgo types +// specially. Rather than forcing all clients to require cgo and an external +// C compiler just to run the tests, this scheme makes them optional. +// +build cgo,testcgo + +package spew_test + +import ( + "fmt" + + "github.com/davecgh/go-spew/spew/testdata" +) + +func addCgoDumpTests() { + // C char pointer. + v := testdata.GetCgoCharPointer() + nv := testdata.GetCgoNullCharPointer() + pv := &v + vcAddr := fmt.Sprintf("%p", v) + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "*testdata._Ctype_char" + vs := "116" + addDumpTest(v, "("+vt+")("+vcAddr+")("+vs+")\n") + addDumpTest(pv, "(*"+vt+")("+vAddr+"->"+vcAddr+")("+vs+")\n") + addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+"->"+vcAddr+")("+vs+")\n") + addDumpTest(nv, "("+vt+")()\n") + + // C char array. + v2, v2l, v2c := testdata.GetCgoCharArray() + v2Len := fmt.Sprintf("%d", v2l) + v2Cap := fmt.Sprintf("%d", v2c) + v2t := "[6]testdata._Ctype_char" + v2s := "(len=" + v2Len + " cap=" + v2Cap + ") " + + "{\n 00000000 74 65 73 74 32 00 " + + " |test2.|\n}" + addDumpTest(v2, "("+v2t+") "+v2s+"\n") + + // C unsigned char array. + v3, v3l, v3c := testdata.GetCgoUnsignedCharArray() + v3Len := fmt.Sprintf("%d", v3l) + v3Cap := fmt.Sprintf("%d", v3c) + v3t := "[6]testdata._Ctype_unsignedchar" + v3t2 := "[6]testdata._Ctype_uchar" + v3s := "(len=" + v3Len + " cap=" + v3Cap + ") " + + "{\n 00000000 74 65 73 74 33 00 " + + " |test3.|\n}" + addDumpTest(v3, "("+v3t+") "+v3s+"\n", "("+v3t2+") "+v3s+"\n") + + // C signed char array. + v4, v4l, v4c := testdata.GetCgoSignedCharArray() + v4Len := fmt.Sprintf("%d", v4l) + v4Cap := fmt.Sprintf("%d", v4c) + v4t := "[6]testdata._Ctype_schar" + v4t2 := "testdata._Ctype_schar" + v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " + + "{\n (" + v4t2 + ") 116,\n (" + v4t2 + ") 101,\n (" + v4t2 + + ") 115,\n (" + v4t2 + ") 116,\n (" + v4t2 + ") 52,\n (" + v4t2 + + ") 0\n}" + addDumpTest(v4, "("+v4t+") "+v4s+"\n") + + // C uint8_t array. + v5, v5l, v5c := testdata.GetCgoUint8tArray() + v5Len := fmt.Sprintf("%d", v5l) + v5Cap := fmt.Sprintf("%d", v5c) + v5t := "[6]testdata._Ctype_uint8_t" + v5s := "(len=" + v5Len + " cap=" + v5Cap + ") " + + "{\n 00000000 74 65 73 74 35 00 " + + " |test5.|\n}" + addDumpTest(v5, "("+v5t+") "+v5s+"\n") + + // C typedefed unsigned char array. + v6, v6l, v6c := testdata.GetCgoTypdefedUnsignedCharArray() + v6Len := fmt.Sprintf("%d", v6l) + v6Cap := fmt.Sprintf("%d", v6c) + v6t := "[6]testdata._Ctype_custom_uchar_t" + v6s := "(len=" + v6Len + " cap=" + v6Cap + ") " + + "{\n 00000000 74 65 73 74 36 00 " + + " |test6.|\n}" + addDumpTest(v6, "("+v6t+") "+v6s+"\n") +} diff --git a/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go b/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go new file mode 100644 index 00000000..52a0971f --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go @@ -0,0 +1,26 @@ +// Copyright (c) 2013 Dave Collins +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when either cgo is not supported or "-tags testcgo" is not added to the go +// test command line. This file intentionally does not setup any cgo tests in +// this scenario. +// +build !cgo !testcgo + +package spew_test + +func addCgoDumpTests() { + // Don't add any tests for cgo since this file is only compiled when + // there should not be any cgo tests. +} diff --git a/vendor/github.com/davecgh/go-spew/spew/example_test.go b/vendor/github.com/davecgh/go-spew/spew/example_test.go new file mode 100644 index 00000000..c6ec8c6d --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/example_test.go @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew_test + +import ( + "fmt" + + "github.com/davecgh/go-spew/spew" +) + +type Flag int + +const ( + flagOne Flag = iota + flagTwo +) + +var flagStrings = map[Flag]string{ + flagOne: "flagOne", + flagTwo: "flagTwo", +} + +func (f Flag) String() string { + if s, ok := flagStrings[f]; ok { + return s + } + return fmt.Sprintf("Unknown flag (%d)", int(f)) +} + +type Bar struct { + data uintptr +} + +type Foo struct { + unexportedField Bar + ExportedField map[interface{}]interface{} +} + +// This example demonstrates how to use Dump to dump variables to stdout. +func ExampleDump() { + // The following package level declarations are assumed for this example: + /* + type Flag int + + const ( + flagOne Flag = iota + flagTwo + ) + + var flagStrings = map[Flag]string{ + flagOne: "flagOne", + flagTwo: "flagTwo", + } + + func (f Flag) String() string { + if s, ok := flagStrings[f]; ok { + return s + } + return fmt.Sprintf("Unknown flag (%d)", int(f)) + } + + type Bar struct { + data uintptr + } + + type Foo struct { + unexportedField Bar + ExportedField map[interface{}]interface{} + } + */ + + // Setup some sample data structures for the example. + bar := Bar{uintptr(0)} + s1 := Foo{bar, map[interface{}]interface{}{"one": true}} + f := Flag(5) + b := []byte{ + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, + } + + // Dump! + spew.Dump(s1, f, b) + + // Output: + // (spew_test.Foo) { + // unexportedField: (spew_test.Bar) { + // data: (uintptr) + // }, + // ExportedField: (map[interface {}]interface {}) (len=1) { + // (string) (len=3) "one": (bool) true + // } + // } + // (spew_test.Flag) Unknown flag (5) + // ([]uint8) (len=34 cap=34) { + // 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | + // 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| + // 00000020 31 32 |12| + // } + // +} + +// This example demonstrates how to use Printf to display a variable with a +// format string and inline formatting. +func ExamplePrintf() { + // Create a double pointer to a uint 8. + ui8 := uint8(5) + pui8 := &ui8 + ppui8 := &pui8 + + // Create a circular data type. + type circular struct { + ui8 uint8 + c *circular + } + c := circular{ui8: 1} + c.c = &c + + // Print! + spew.Printf("ppui8: %v\n", ppui8) + spew.Printf("circular: %v\n", c) + + // Output: + // ppui8: <**>5 + // circular: {1 <*>{1 <*>}} +} + +// This example demonstrates how to use a ConfigState. +func ExampleConfigState() { + // Modify the indent level of the ConfigState only. The global + // configuration is not modified. + scs := spew.ConfigState{Indent: "\t"} + + // Output using the ConfigState instance. + v := map[string]int{"one": 1} + scs.Printf("v: %v\n", v) + scs.Dump(v) + + // Output: + // v: map[one:1] + // (map[string]int) (len=1) { + // (string) (len=3) "one": (int) 1 + // } +} + +// This example demonstrates how to use ConfigState.Dump to dump variables to +// stdout +func ExampleConfigState_Dump() { + // See the top-level Dump example for details on the types used in this + // example. + + // Create two ConfigState instances with different indentation. + scs := spew.ConfigState{Indent: "\t"} + scs2 := spew.ConfigState{Indent: " "} + + // Setup some sample data structures for the example. + bar := Bar{uintptr(0)} + s1 := Foo{bar, map[interface{}]interface{}{"one": true}} + + // Dump using the ConfigState instances. + scs.Dump(s1) + scs2.Dump(s1) + + // Output: + // (spew_test.Foo) { + // unexportedField: (spew_test.Bar) { + // data: (uintptr) + // }, + // ExportedField: (map[interface {}]interface {}) (len=1) { + // (string) (len=3) "one": (bool) true + // } + // } + // (spew_test.Foo) { + // unexportedField: (spew_test.Bar) { + // data: (uintptr) + // }, + // ExportedField: (map[interface {}]interface {}) (len=1) { + // (string) (len=3) "one": (bool) true + // } + // } + // +} + +// This example demonstrates how to use ConfigState.Printf to display a variable +// with a format string and inline formatting. +func ExampleConfigState_Printf() { + // See the top-level Dump example for details on the types used in this + // example. + + // Create two ConfigState instances and modify the method handling of the + // first ConfigState only. + scs := spew.NewDefaultConfig() + scs2 := spew.NewDefaultConfig() + scs.DisableMethods = true + + // Alternatively + // scs := spew.ConfigState{Indent: " ", DisableMethods: true} + // scs2 := spew.ConfigState{Indent: " "} + + // This is of type Flag which implements a Stringer and has raw value 1. + f := flagTwo + + // Dump using the ConfigState instances. + scs.Printf("f: %v\n", f) + scs2.Printf("f: %v\n", f) + + // Output: + // f: 1 + // f: flagTwo +} diff --git a/vendor/github.com/davecgh/go-spew/spew/format.go b/vendor/github.com/davecgh/go-spew/spew/format.go new file mode 100644 index 00000000..c49875ba --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/format.go @@ -0,0 +1,419 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "fmt" + "reflect" + "strconv" + "strings" +) + +// supportedFlags is a list of all the character flags supported by fmt package. +const supportedFlags = "0-+# " + +// formatState implements the fmt.Formatter interface and contains information +// about the state of a formatting operation. The NewFormatter function can +// be used to get a new Formatter which can be used directly as arguments +// in standard fmt package printing calls. +type formatState struct { + value interface{} + fs fmt.State + depth int + pointers map[uintptr]int + ignoreNextType bool + cs *ConfigState +} + +// buildDefaultFormat recreates the original format string without precision +// and width information to pass in to fmt.Sprintf in the case of an +// unrecognized type. Unless new types are added to the language, this +// function won't ever be called. +func (f *formatState) buildDefaultFormat() (format string) { + buf := bytes.NewBuffer(percentBytes) + + for _, flag := range supportedFlags { + if f.fs.Flag(int(flag)) { + buf.WriteRune(flag) + } + } + + buf.WriteRune('v') + + format = buf.String() + return format +} + +// constructOrigFormat recreates the original format string including precision +// and width information to pass along to the standard fmt package. This allows +// automatic deferral of all format strings this package doesn't support. +func (f *formatState) constructOrigFormat(verb rune) (format string) { + buf := bytes.NewBuffer(percentBytes) + + for _, flag := range supportedFlags { + if f.fs.Flag(int(flag)) { + buf.WriteRune(flag) + } + } + + if width, ok := f.fs.Width(); ok { + buf.WriteString(strconv.Itoa(width)) + } + + if precision, ok := f.fs.Precision(); ok { + buf.Write(precisionBytes) + buf.WriteString(strconv.Itoa(precision)) + } + + buf.WriteRune(verb) + + format = buf.String() + return format +} + +// unpackValue returns values inside of non-nil interfaces when possible and +// ensures that types for values which have been unpacked from an interface +// are displayed when the show types flag is also set. +// This is useful for data types like structs, arrays, slices, and maps which +// can contain varying types packed inside an interface. +func (f *formatState) unpackValue(v reflect.Value) reflect.Value { + if v.Kind() == reflect.Interface { + f.ignoreNextType = false + if !v.IsNil() { + v = v.Elem() + } + } + return v +} + +// formatPtr handles formatting of pointers by indirecting them as necessary. +func (f *formatState) formatPtr(v reflect.Value) { + // Display nil if top level pointer is nil. + showTypes := f.fs.Flag('#') + if v.IsNil() && (!showTypes || f.ignoreNextType) { + f.fs.Write(nilAngleBytes) + return + } + + // Remove pointers at or below the current depth from map used to detect + // circular refs. + for k, depth := range f.pointers { + if depth >= f.depth { + delete(f.pointers, k) + } + } + + // Keep list of all dereferenced pointers to possibly show later. + pointerChain := make([]uintptr, 0) + + // Figure out how many levels of indirection there are by derferencing + // pointers and unpacking interfaces down the chain while detecting circular + // references. + nilFound := false + cycleFound := false + indirects := 0 + ve := v + for ve.Kind() == reflect.Ptr { + if ve.IsNil() { + nilFound = true + break + } + indirects++ + addr := ve.Pointer() + pointerChain = append(pointerChain, addr) + if pd, ok := f.pointers[addr]; ok && pd < f.depth { + cycleFound = true + indirects-- + break + } + f.pointers[addr] = f.depth + + ve = ve.Elem() + if ve.Kind() == reflect.Interface { + if ve.IsNil() { + nilFound = true + break + } + ve = ve.Elem() + } + } + + // Display type or indirection level depending on flags. + if showTypes && !f.ignoreNextType { + f.fs.Write(openParenBytes) + f.fs.Write(bytes.Repeat(asteriskBytes, indirects)) + f.fs.Write([]byte(ve.Type().String())) + f.fs.Write(closeParenBytes) + } else { + if nilFound || cycleFound { + indirects += strings.Count(ve.Type().String(), "*") + } + f.fs.Write(openAngleBytes) + f.fs.Write([]byte(strings.Repeat("*", indirects))) + f.fs.Write(closeAngleBytes) + } + + // Display pointer information depending on flags. + if f.fs.Flag('+') && (len(pointerChain) > 0) { + f.fs.Write(openParenBytes) + for i, addr := range pointerChain { + if i > 0 { + f.fs.Write(pointerChainBytes) + } + printHexPtr(f.fs, addr) + } + f.fs.Write(closeParenBytes) + } + + // Display dereferenced value. + switch { + case nilFound == true: + f.fs.Write(nilAngleBytes) + + case cycleFound == true: + f.fs.Write(circularShortBytes) + + default: + f.ignoreNextType = true + f.format(ve) + } +} + +// format is the main workhorse for providing the Formatter interface. It +// uses the passed reflect value to figure out what kind of object we are +// dealing with and formats it appropriately. It is a recursive function, +// however circular data structures are detected and handled properly. +func (f *formatState) format(v reflect.Value) { + // Handle invalid reflect values immediately. + kind := v.Kind() + if kind == reflect.Invalid { + f.fs.Write(invalidAngleBytes) + return + } + + // Handle pointers specially. + if kind == reflect.Ptr { + f.formatPtr(v) + return + } + + // Print type information unless already handled elsewhere. + if !f.ignoreNextType && f.fs.Flag('#') { + f.fs.Write(openParenBytes) + f.fs.Write([]byte(v.Type().String())) + f.fs.Write(closeParenBytes) + } + f.ignoreNextType = false + + // Call Stringer/error interfaces if they exist and the handle methods + // flag is enabled. + if !f.cs.DisableMethods { + if (kind != reflect.Invalid) && (kind != reflect.Interface) { + if handled := handleMethods(f.cs, f.fs, v); handled { + return + } + } + } + + switch kind { + case reflect.Invalid: + // Do nothing. We should never get here since invalid has already + // been handled above. + + case reflect.Bool: + printBool(f.fs, v.Bool()) + + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + printInt(f.fs, v.Int(), 10) + + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + printUint(f.fs, v.Uint(), 10) + + case reflect.Float32: + printFloat(f.fs, v.Float(), 32) + + case reflect.Float64: + printFloat(f.fs, v.Float(), 64) + + case reflect.Complex64: + printComplex(f.fs, v.Complex(), 32) + + case reflect.Complex128: + printComplex(f.fs, v.Complex(), 64) + + case reflect.Slice: + if v.IsNil() { + f.fs.Write(nilAngleBytes) + break + } + fallthrough + + case reflect.Array: + f.fs.Write(openBracketBytes) + f.depth++ + if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { + f.fs.Write(maxShortBytes) + } else { + numEntries := v.Len() + for i := 0; i < numEntries; i++ { + if i > 0 { + f.fs.Write(spaceBytes) + } + f.ignoreNextType = true + f.format(f.unpackValue(v.Index(i))) + } + } + f.depth-- + f.fs.Write(closeBracketBytes) + + case reflect.String: + f.fs.Write([]byte(v.String())) + + case reflect.Interface: + // The only time we should get here is for nil interfaces due to + // unpackValue calls. + if v.IsNil() { + f.fs.Write(nilAngleBytes) + } + + case reflect.Ptr: + // Do nothing. We should never get here since pointers have already + // been handled above. + + case reflect.Map: + // nil maps should be indicated as different than empty maps + if v.IsNil() { + f.fs.Write(nilAngleBytes) + break + } + + f.fs.Write(openMapBytes) + f.depth++ + if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { + f.fs.Write(maxShortBytes) + } else { + keys := v.MapKeys() + if f.cs.SortKeys { + sortValues(keys, f.cs) + } + for i, key := range keys { + if i > 0 { + f.fs.Write(spaceBytes) + } + f.ignoreNextType = true + f.format(f.unpackValue(key)) + f.fs.Write(colonBytes) + f.ignoreNextType = true + f.format(f.unpackValue(v.MapIndex(key))) + } + } + f.depth-- + f.fs.Write(closeMapBytes) + + case reflect.Struct: + numFields := v.NumField() + f.fs.Write(openBraceBytes) + f.depth++ + if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { + f.fs.Write(maxShortBytes) + } else { + vt := v.Type() + for i := 0; i < numFields; i++ { + if i > 0 { + f.fs.Write(spaceBytes) + } + vtf := vt.Field(i) + if f.fs.Flag('+') || f.fs.Flag('#') { + f.fs.Write([]byte(vtf.Name)) + f.fs.Write(colonBytes) + } + f.format(f.unpackValue(v.Field(i))) + } + } + f.depth-- + f.fs.Write(closeBraceBytes) + + case reflect.Uintptr: + printHexPtr(f.fs, uintptr(v.Uint())) + + case reflect.UnsafePointer, reflect.Chan, reflect.Func: + printHexPtr(f.fs, v.Pointer()) + + // There were not any other types at the time this code was written, but + // fall back to letting the default fmt package handle it if any get added. + default: + format := f.buildDefaultFormat() + if v.CanInterface() { + fmt.Fprintf(f.fs, format, v.Interface()) + } else { + fmt.Fprintf(f.fs, format, v.String()) + } + } +} + +// Format satisfies the fmt.Formatter interface. See NewFormatter for usage +// details. +func (f *formatState) Format(fs fmt.State, verb rune) { + f.fs = fs + + // Use standard formatting for verbs that are not v. + if verb != 'v' { + format := f.constructOrigFormat(verb) + fmt.Fprintf(fs, format, f.value) + return + } + + if f.value == nil { + if fs.Flag('#') { + fs.Write(interfaceBytes) + } + fs.Write(nilAngleBytes) + return + } + + f.format(reflect.ValueOf(f.value)) +} + +// newFormatter is a helper function to consolidate the logic from the various +// public methods which take varying config states. +func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter { + fs := &formatState{value: v, cs: cs} + fs.pointers = make(map[uintptr]int) + return fs +} + +/* +NewFormatter returns a custom formatter that satisfies the fmt.Formatter +interface. As a result, it integrates cleanly with standard fmt package +printing functions. The formatter is useful for inline printing of smaller data +types similar to the standard %v format specifier. + +The custom formatter only responds to the %v (most compact), %+v (adds pointer +addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb +combinations. Any other verbs such as %x and %q will be sent to the the +standard fmt package for formatting. In addition, the custom formatter ignores +the width and precision arguments (however they will still work on the format +specifiers not handled by the custom formatter). + +Typically this function shouldn't be called directly. It is much easier to make +use of the custom formatter by calling one of the convenience functions such as +Printf, Println, or Fprintf. +*/ +func NewFormatter(v interface{}) fmt.Formatter { + return newFormatter(&Config, v) +} diff --git a/vendor/github.com/davecgh/go-spew/spew/format_test.go b/vendor/github.com/davecgh/go-spew/spew/format_test.go new file mode 100644 index 00000000..f9b93abe --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/format_test.go @@ -0,0 +1,1558 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* +Test Summary: +NOTE: For each test, a nil pointer, a single pointer and double pointer to the +base test element are also tested to ensure proper indirection across all types. + +- Max int8, int16, int32, int64, int +- Max uint8, uint16, uint32, uint64, uint +- Boolean true and false +- Standard complex64 and complex128 +- Array containing standard ints +- Array containing type with custom formatter on pointer receiver only +- Array containing interfaces +- Slice containing standard float32 values +- Slice containing type with custom formatter on pointer receiver only +- Slice containing interfaces +- Nil slice +- Standard string +- Nil interface +- Sub-interface +- Map with string keys and int vals +- Map with custom formatter type on pointer receiver only keys and vals +- Map with interface keys and values +- Map with nil interface value +- Struct with primitives +- Struct that contains another struct +- Struct that contains custom type with Stringer pointer interface via both + exported and unexported fields +- Struct that contains embedded struct and field to same struct +- Uintptr to 0 (null pointer) +- Uintptr address of real variable +- Unsafe.Pointer to 0 (null pointer) +- Unsafe.Pointer to address of real variable +- Nil channel +- Standard int channel +- Function with no params and no returns +- Function with param and no returns +- Function with multiple params and multiple returns +- Struct that is circular through self referencing +- Structs that are circular through cross referencing +- Structs that are indirectly circular +- Type that panics in its Stringer interface +- Type that has a custom Error interface +- %x passthrough with uint +- %#x passthrough with uint +- %f passthrough with precision +- %f passthrough with width and precision +- %d passthrough with width +- %q passthrough with string +*/ + +package spew_test + +import ( + "bytes" + "fmt" + "testing" + "unsafe" + + "github.com/davecgh/go-spew/spew" +) + +// formatterTest is used to describe a test to be performed against NewFormatter. +type formatterTest struct { + format string + in interface{} + wants []string +} + +// formatterTests houses all of the tests to be performed against NewFormatter. +var formatterTests = make([]formatterTest, 0) + +// addFormatterTest is a helper method to append the passed input and desired +// result to formatterTests. +func addFormatterTest(format string, in interface{}, wants ...string) { + test := formatterTest{format, in, wants} + formatterTests = append(formatterTests, test) +} + +func addIntFormatterTests() { + // Max int8. + v := int8(127) + nv := (*int8)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "int8" + vs := "127" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Max int16. + v2 := int16(32767) + nv2 := (*int16)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "int16" + v2s := "32767" + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%v", nv2, "") + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") + + // Max int32. + v3 := int32(2147483647) + nv3 := (*int32)(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "int32" + v3s := "2147483647" + addFormatterTest("%v", v3, v3s) + addFormatterTest("%v", pv3, "<*>"+v3s) + addFormatterTest("%v", &pv3, "<**>"+v3s) + addFormatterTest("%v", nv3, "") + addFormatterTest("%+v", v3, v3s) + addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) + addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%#v", v3, "("+v3t+")"+v3s) + addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s) + addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s) + addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") + addFormatterTest("%#+v", v3, "("+v3t+")"+v3s) + addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s) + addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s) + addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") + + // Max int64. + v4 := int64(9223372036854775807) + nv4 := (*int64)(nil) + pv4 := &v4 + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "int64" + v4s := "9223372036854775807" + addFormatterTest("%v", v4, v4s) + addFormatterTest("%v", pv4, "<*>"+v4s) + addFormatterTest("%v", &pv4, "<**>"+v4s) + addFormatterTest("%v", nv4, "") + addFormatterTest("%+v", v4, v4s) + addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s) + addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s) + addFormatterTest("%+v", nv4, "") + addFormatterTest("%#v", v4, "("+v4t+")"+v4s) + addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s) + addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s) + addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") + addFormatterTest("%#+v", v4, "("+v4t+")"+v4s) + addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s) + addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s) + addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") + + // Max int. + v5 := int(2147483647) + nv5 := (*int)(nil) + pv5 := &v5 + v5Addr := fmt.Sprintf("%p", pv5) + pv5Addr := fmt.Sprintf("%p", &pv5) + v5t := "int" + v5s := "2147483647" + addFormatterTest("%v", v5, v5s) + addFormatterTest("%v", pv5, "<*>"+v5s) + addFormatterTest("%v", &pv5, "<**>"+v5s) + addFormatterTest("%v", nv5, "") + addFormatterTest("%+v", v5, v5s) + addFormatterTest("%+v", pv5, "<*>("+v5Addr+")"+v5s) + addFormatterTest("%+v", &pv5, "<**>("+pv5Addr+"->"+v5Addr+")"+v5s) + addFormatterTest("%+v", nv5, "") + addFormatterTest("%#v", v5, "("+v5t+")"+v5s) + addFormatterTest("%#v", pv5, "(*"+v5t+")"+v5s) + addFormatterTest("%#v", &pv5, "(**"+v5t+")"+v5s) + addFormatterTest("%#v", nv5, "(*"+v5t+")"+"") + addFormatterTest("%#+v", v5, "("+v5t+")"+v5s) + addFormatterTest("%#+v", pv5, "(*"+v5t+")("+v5Addr+")"+v5s) + addFormatterTest("%#+v", &pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")"+v5s) + addFormatterTest("%#+v", nv5, "(*"+v5t+")"+"") +} + +func addUintFormatterTests() { + // Max uint8. + v := uint8(255) + nv := (*uint8)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "uint8" + vs := "255" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Max uint16. + v2 := uint16(65535) + nv2 := (*uint16)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "uint16" + v2s := "65535" + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%v", nv2, "") + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") + + // Max uint32. + v3 := uint32(4294967295) + nv3 := (*uint32)(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "uint32" + v3s := "4294967295" + addFormatterTest("%v", v3, v3s) + addFormatterTest("%v", pv3, "<*>"+v3s) + addFormatterTest("%v", &pv3, "<**>"+v3s) + addFormatterTest("%v", nv3, "") + addFormatterTest("%+v", v3, v3s) + addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) + addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%#v", v3, "("+v3t+")"+v3s) + addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s) + addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s) + addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") + addFormatterTest("%#+v", v3, "("+v3t+")"+v3s) + addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s) + addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s) + addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") + + // Max uint64. + v4 := uint64(18446744073709551615) + nv4 := (*uint64)(nil) + pv4 := &v4 + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "uint64" + v4s := "18446744073709551615" + addFormatterTest("%v", v4, v4s) + addFormatterTest("%v", pv4, "<*>"+v4s) + addFormatterTest("%v", &pv4, "<**>"+v4s) + addFormatterTest("%v", nv4, "") + addFormatterTest("%+v", v4, v4s) + addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s) + addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s) + addFormatterTest("%+v", nv4, "") + addFormatterTest("%#v", v4, "("+v4t+")"+v4s) + addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s) + addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s) + addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") + addFormatterTest("%#+v", v4, "("+v4t+")"+v4s) + addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s) + addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s) + addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") + + // Max uint. + v5 := uint(4294967295) + nv5 := (*uint)(nil) + pv5 := &v5 + v5Addr := fmt.Sprintf("%p", pv5) + pv5Addr := fmt.Sprintf("%p", &pv5) + v5t := "uint" + v5s := "4294967295" + addFormatterTest("%v", v5, v5s) + addFormatterTest("%v", pv5, "<*>"+v5s) + addFormatterTest("%v", &pv5, "<**>"+v5s) + addFormatterTest("%v", nv5, "") + addFormatterTest("%+v", v5, v5s) + addFormatterTest("%+v", pv5, "<*>("+v5Addr+")"+v5s) + addFormatterTest("%+v", &pv5, "<**>("+pv5Addr+"->"+v5Addr+")"+v5s) + addFormatterTest("%+v", nv5, "") + addFormatterTest("%#v", v5, "("+v5t+")"+v5s) + addFormatterTest("%#v", pv5, "(*"+v5t+")"+v5s) + addFormatterTest("%#v", &pv5, "(**"+v5t+")"+v5s) + addFormatterTest("%#v", nv5, "(*"+v5t+")"+"") + addFormatterTest("%#+v", v5, "("+v5t+")"+v5s) + addFormatterTest("%#+v", pv5, "(*"+v5t+")("+v5Addr+")"+v5s) + addFormatterTest("%#+v", &pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")"+v5s) + addFormatterTest("%#v", nv5, "(*"+v5t+")"+"") +} + +func addBoolFormatterTests() { + // Boolean true. + v := bool(true) + nv := (*bool)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "bool" + vs := "true" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Boolean false. + v2 := bool(false) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "bool" + v2s := "false" + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) +} + +func addFloatFormatterTests() { + // Standard float32. + v := float32(3.1415) + nv := (*float32)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "float32" + vs := "3.1415" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Standard float64. + v2 := float64(3.1415926) + nv2 := (*float64)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "float64" + v2s := "3.1415926" + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") +} + +func addComplexFormatterTests() { + // Standard complex64. + v := complex(float32(6), -2) + nv := (*complex64)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "complex64" + vs := "(6-2i)" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Standard complex128. + v2 := complex(float64(-6), 2) + nv2 := (*complex128)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "complex128" + v2s := "(-6+2i)" + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") +} + +func addArrayFormatterTests() { + // Array containing standard ints. + v := [3]int{1, 2, 3} + nv := (*[3]int)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "[3]int" + vs := "[1 2 3]" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Array containing type with custom formatter on pointer receiver only. + v2 := [3]pstringer{"1", "2", "3"} + nv2 := (*[3]pstringer)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "[3]spew_test.pstringer" + v2sp := "[stringer 1 stringer 2 stringer 3]" + v2s := v2sp + if spew.UnsafeDisabled { + v2s = "[1 2 3]" + } + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2sp) + addFormatterTest("%v", &pv2, "<**>"+v2sp) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2sp) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2sp) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2sp) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2sp) + addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2sp) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2sp) + addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") + + // Array containing interfaces. + v3 := [3]interface{}{"one", int(2), uint(3)} + nv3 := (*[3]interface{})(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "[3]interface {}" + v3t2 := "string" + v3t3 := "int" + v3t4 := "uint" + v3s := "[one 2 3]" + v3s2 := "[(" + v3t2 + ")one (" + v3t3 + ")2 (" + v3t4 + ")3]" + addFormatterTest("%v", v3, v3s) + addFormatterTest("%v", pv3, "<*>"+v3s) + addFormatterTest("%v", &pv3, "<**>"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%+v", v3, v3s) + addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) + addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%#v", v3, "("+v3t+")"+v3s2) + addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2) + addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2) + addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") + addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2) + addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2) + addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2) + addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") +} + +func addSliceFormatterTests() { + // Slice containing standard float32 values. + v := []float32{3.14, 6.28, 12.56} + nv := (*[]float32)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "[]float32" + vs := "[3.14 6.28 12.56]" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Slice containing type with custom formatter on pointer receiver only. + v2 := []pstringer{"1", "2", "3"} + nv2 := (*[]pstringer)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "[]spew_test.pstringer" + v2s := "[stringer 1 stringer 2 stringer 3]" + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") + + // Slice containing interfaces. + v3 := []interface{}{"one", int(2), uint(3), nil} + nv3 := (*[]interface{})(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "[]interface {}" + v3t2 := "string" + v3t3 := "int" + v3t4 := "uint" + v3t5 := "interface {}" + v3s := "[one 2 3 ]" + v3s2 := "[(" + v3t2 + ")one (" + v3t3 + ")2 (" + v3t4 + ")3 (" + v3t5 + + ")]" + addFormatterTest("%v", v3, v3s) + addFormatterTest("%v", pv3, "<*>"+v3s) + addFormatterTest("%v", &pv3, "<**>"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%+v", v3, v3s) + addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) + addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%#v", v3, "("+v3t+")"+v3s2) + addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2) + addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2) + addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") + addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2) + addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2) + addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2) + addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") + + // Nil slice. + var v4 []int + nv4 := (*[]int)(nil) + pv4 := &v4 + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "[]int" + v4s := "" + addFormatterTest("%v", v4, v4s) + addFormatterTest("%v", pv4, "<*>"+v4s) + addFormatterTest("%v", &pv4, "<**>"+v4s) + addFormatterTest("%+v", nv4, "") + addFormatterTest("%+v", v4, v4s) + addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s) + addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s) + addFormatterTest("%+v", nv4, "") + addFormatterTest("%#v", v4, "("+v4t+")"+v4s) + addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s) + addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s) + addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") + addFormatterTest("%#+v", v4, "("+v4t+")"+v4s) + addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s) + addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s) + addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") +} + +func addStringFormatterTests() { + // Standard string. + v := "test" + nv := (*string)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "string" + vs := "test" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") +} + +func addInterfaceFormatterTests() { + // Nil interface. + var v interface{} + nv := (*interface{})(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "interface {}" + vs := "" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Sub-interface. + v2 := interface{}(uint16(65535)) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "uint16" + v2s := "65535" + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) +} + +func addMapFormatterTests() { + // Map with string keys and int vals. + v := map[string]int{"one": 1, "two": 2} + nilMap := map[string]int(nil) + nv := (*map[string]int)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "map[string]int" + vs := "map[one:1 two:2]" + vs2 := "map[two:2 one:1]" + addFormatterTest("%v", v, vs, vs2) + addFormatterTest("%v", pv, "<*>"+vs, "<*>"+vs2) + addFormatterTest("%v", &pv, "<**>"+vs, "<**>"+vs2) + addFormatterTest("%+v", nilMap, "") + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs, vs2) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs, "<*>("+vAddr+")"+vs2) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs, + "<**>("+pvAddr+"->"+vAddr+")"+vs2) + addFormatterTest("%+v", nilMap, "") + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs, "("+vt+")"+vs2) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs, "(*"+vt+")"+vs2) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs, "(**"+vt+")"+vs2) + addFormatterTest("%#v", nilMap, "("+vt+")"+"") + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs, "("+vt+")"+vs2) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs, + "(*"+vt+")("+vAddr+")"+vs2) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs, + "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs2) + addFormatterTest("%#+v", nilMap, "("+vt+")"+"") + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Map with custom formatter type on pointer receiver only keys and vals. + v2 := map[pstringer]pstringer{"one": "1"} + nv2 := (*map[pstringer]pstringer)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "map[spew_test.pstringer]spew_test.pstringer" + v2s := "map[stringer one:stringer 1]" + if spew.UnsafeDisabled { + v2s = "map[one:1]" + } + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") + + // Map with interface keys and values. + v3 := map[interface{}]interface{}{"one": 1} + nv3 := (*map[interface{}]interface{})(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "map[interface {}]interface {}" + v3t1 := "string" + v3t2 := "int" + v3s := "map[one:1]" + v3s2 := "map[(" + v3t1 + ")one:(" + v3t2 + ")1]" + addFormatterTest("%v", v3, v3s) + addFormatterTest("%v", pv3, "<*>"+v3s) + addFormatterTest("%v", &pv3, "<**>"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%+v", v3, v3s) + addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) + addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%#v", v3, "("+v3t+")"+v3s2) + addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2) + addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2) + addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") + addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2) + addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2) + addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2) + addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") + + // Map with nil interface value + v4 := map[string]interface{}{"nil": nil} + nv4 := (*map[string]interface{})(nil) + pv4 := &v4 + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "map[string]interface {}" + v4t1 := "interface {}" + v4s := "map[nil:]" + v4s2 := "map[nil:(" + v4t1 + ")]" + addFormatterTest("%v", v4, v4s) + addFormatterTest("%v", pv4, "<*>"+v4s) + addFormatterTest("%v", &pv4, "<**>"+v4s) + addFormatterTest("%+v", nv4, "") + addFormatterTest("%+v", v4, v4s) + addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s) + addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s) + addFormatterTest("%+v", nv4, "") + addFormatterTest("%#v", v4, "("+v4t+")"+v4s2) + addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s2) + addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s2) + addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") + addFormatterTest("%#+v", v4, "("+v4t+")"+v4s2) + addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s2) + addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s2) + addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") +} + +func addStructFormatterTests() { + // Struct with primitives. + type s1 struct { + a int8 + b uint8 + } + v := s1{127, 255} + nv := (*s1)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "spew_test.s1" + vt2 := "int8" + vt3 := "uint8" + vs := "{127 255}" + vs2 := "{a:127 b:255}" + vs3 := "{a:(" + vt2 + ")127 b:(" + vt3 + ")255}" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs2) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs2) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs2) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs3) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs3) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs3) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs3) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs3) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs3) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Struct that contains another struct. + type s2 struct { + s1 s1 + b bool + } + v2 := s2{s1{127, 255}, true} + nv2 := (*s2)(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "spew_test.s2" + v2t2 := "spew_test.s1" + v2t3 := "int8" + v2t4 := "uint8" + v2t5 := "bool" + v2s := "{{127 255} true}" + v2s2 := "{s1:{a:127 b:255} b:true}" + v2s3 := "{s1:(" + v2t2 + "){a:(" + v2t3 + ")127 b:(" + v2t4 + ")255} b:(" + + v2t5 + ")true}" + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%+v", v2, v2s2) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s2) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s2) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%#v", v2, "("+v2t+")"+v2s3) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s3) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s3) + addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s3) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s3) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s3) + addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") + + // Struct that contains custom type with Stringer pointer interface via both + // exported and unexported fields. + type s3 struct { + s pstringer + S pstringer + } + v3 := s3{"test", "test2"} + nv3 := (*s3)(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "spew_test.s3" + v3t2 := "spew_test.pstringer" + v3s := "{stringer test stringer test2}" + v3sp := v3s + v3s2 := "{s:stringer test S:stringer test2}" + v3s2p := v3s2 + v3s3 := "{s:(" + v3t2 + ")stringer test S:(" + v3t2 + ")stringer test2}" + v3s3p := v3s3 + if spew.UnsafeDisabled { + v3s = "{test test2}" + v3sp = "{test stringer test2}" + v3s2 = "{s:test S:test2}" + v3s2p = "{s:test S:stringer test2}" + v3s3 = "{s:(" + v3t2 + ")test S:(" + v3t2 + ")test2}" + v3s3p = "{s:(" + v3t2 + ")test S:(" + v3t2 + ")stringer test2}" + } + addFormatterTest("%v", v3, v3s) + addFormatterTest("%v", pv3, "<*>"+v3sp) + addFormatterTest("%v", &pv3, "<**>"+v3sp) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%+v", v3, v3s2) + addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s2p) + addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s2p) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%#v", v3, "("+v3t+")"+v3s3) + addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s3p) + addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s3p) + addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") + addFormatterTest("%#+v", v3, "("+v3t+")"+v3s3) + addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s3p) + addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s3p) + addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") + + // Struct that contains embedded struct and field to same struct. + e := embed{"embedstr"} + v4 := embedwrap{embed: &e, e: &e} + nv4 := (*embedwrap)(nil) + pv4 := &v4 + eAddr := fmt.Sprintf("%p", &e) + v4Addr := fmt.Sprintf("%p", pv4) + pv4Addr := fmt.Sprintf("%p", &pv4) + v4t := "spew_test.embedwrap" + v4t2 := "spew_test.embed" + v4t3 := "string" + v4s := "{<*>{embedstr} <*>{embedstr}}" + v4s2 := "{embed:<*>(" + eAddr + "){a:embedstr} e:<*>(" + eAddr + + "){a:embedstr}}" + v4s3 := "{embed:(*" + v4t2 + "){a:(" + v4t3 + ")embedstr} e:(*" + v4t2 + + "){a:(" + v4t3 + ")embedstr}}" + v4s4 := "{embed:(*" + v4t2 + ")(" + eAddr + "){a:(" + v4t3 + + ")embedstr} e:(*" + v4t2 + ")(" + eAddr + "){a:(" + v4t3 + ")embedstr}}" + addFormatterTest("%v", v4, v4s) + addFormatterTest("%v", pv4, "<*>"+v4s) + addFormatterTest("%v", &pv4, "<**>"+v4s) + addFormatterTest("%+v", nv4, "") + addFormatterTest("%+v", v4, v4s2) + addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s2) + addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s2) + addFormatterTest("%+v", nv4, "") + addFormatterTest("%#v", v4, "("+v4t+")"+v4s3) + addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s3) + addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s3) + addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") + addFormatterTest("%#+v", v4, "("+v4t+")"+v4s4) + addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s4) + addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s4) + addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") +} + +func addUintptrFormatterTests() { + // Null pointer. + v := uintptr(0) + nv := (*uintptr)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "uintptr" + vs := "" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Address of real variable. + i := 1 + v2 := uintptr(unsafe.Pointer(&i)) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "uintptr" + v2s := fmt.Sprintf("%p", &i) + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) +} + +func addUnsafePointerFormatterTests() { + // Null pointer. + v := unsafe.Pointer(uintptr(0)) + nv := (*unsafe.Pointer)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "unsafe.Pointer" + vs := "" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Address of real variable. + i := 1 + v2 := unsafe.Pointer(&i) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "unsafe.Pointer" + v2s := fmt.Sprintf("%p", &i) + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) +} + +func addChanFormatterTests() { + // Nil channel. + var v chan int + pv := &v + nv := (*chan int)(nil) + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "chan int" + vs := "" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Real channel. + v2 := make(chan int) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "chan int" + v2s := fmt.Sprintf("%p", v2) + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) +} + +func addFuncFormatterTests() { + // Function with no params and no returns. + v := addIntFormatterTests + nv := (*func())(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "func()" + vs := fmt.Sprintf("%p", v) + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") + + // Function with param and no returns. + v2 := TestFormatter + nv2 := (*func(*testing.T))(nil) + pv2 := &v2 + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "func(*testing.T)" + v2s := fmt.Sprintf("%p", v2) + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s) + addFormatterTest("%v", &pv2, "<**>"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%+v", v2, v2s) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%+v", nv2, "") + addFormatterTest("%#v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) + addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) + addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") + + // Function with multiple params and multiple returns. + var v3 = func(i int, s string) (b bool, err error) { + return true, nil + } + nv3 := (*func(int, string) (bool, error))(nil) + pv3 := &v3 + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "func(int, string) (bool, error)" + v3s := fmt.Sprintf("%p", v3) + addFormatterTest("%v", v3, v3s) + addFormatterTest("%v", pv3, "<*>"+v3s) + addFormatterTest("%v", &pv3, "<**>"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%+v", v3, v3s) + addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) + addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) + addFormatterTest("%+v", nv3, "") + addFormatterTest("%#v", v3, "("+v3t+")"+v3s) + addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s) + addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s) + addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") + addFormatterTest("%#+v", v3, "("+v3t+")"+v3s) + addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s) + addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s) + addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") +} + +func addCircularFormatterTests() { + // Struct that is circular through self referencing. + type circular struct { + c *circular + } + v := circular{nil} + v.c = &v + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "spew_test.circular" + vs := "{<*>{<*>}}" + vs2 := "{<*>}" + vs3 := "{c:<*>(" + vAddr + "){c:<*>(" + vAddr + ")}}" + vs4 := "{c:<*>(" + vAddr + ")}" + vs5 := "{c:(*" + vt + "){c:(*" + vt + ")}}" + vs6 := "{c:(*" + vt + ")}" + vs7 := "{c:(*" + vt + ")(" + vAddr + "){c:(*" + vt + ")(" + vAddr + + ")}}" + vs8 := "{c:(*" + vt + ")(" + vAddr + ")}" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs2) + addFormatterTest("%v", &pv, "<**>"+vs2) + addFormatterTest("%+v", v, vs3) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs4) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs4) + addFormatterTest("%#v", v, "("+vt+")"+vs5) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs6) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs6) + addFormatterTest("%#+v", v, "("+vt+")"+vs7) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs8) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs8) + + // Structs that are circular through cross referencing. + v2 := xref1{nil} + ts2 := xref2{&v2} + v2.ps2 = &ts2 + pv2 := &v2 + ts2Addr := fmt.Sprintf("%p", &ts2) + v2Addr := fmt.Sprintf("%p", pv2) + pv2Addr := fmt.Sprintf("%p", &pv2) + v2t := "spew_test.xref1" + v2t2 := "spew_test.xref2" + v2s := "{<*>{<*>{<*>}}}" + v2s2 := "{<*>{<*>}}" + v2s3 := "{ps2:<*>(" + ts2Addr + "){ps1:<*>(" + v2Addr + "){ps2:<*>(" + + ts2Addr + ")}}}" + v2s4 := "{ps2:<*>(" + ts2Addr + "){ps1:<*>(" + v2Addr + ")}}" + v2s5 := "{ps2:(*" + v2t2 + "){ps1:(*" + v2t + "){ps2:(*" + v2t2 + + ")}}}" + v2s6 := "{ps2:(*" + v2t2 + "){ps1:(*" + v2t + ")}}" + v2s7 := "{ps2:(*" + v2t2 + ")(" + ts2Addr + "){ps1:(*" + v2t + + ")(" + v2Addr + "){ps2:(*" + v2t2 + ")(" + ts2Addr + + ")}}}" + v2s8 := "{ps2:(*" + v2t2 + ")(" + ts2Addr + "){ps1:(*" + v2t + + ")(" + v2Addr + ")}}" + addFormatterTest("%v", v2, v2s) + addFormatterTest("%v", pv2, "<*>"+v2s2) + addFormatterTest("%v", &pv2, "<**>"+v2s2) + addFormatterTest("%+v", v2, v2s3) + addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s4) + addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s4) + addFormatterTest("%#v", v2, "("+v2t+")"+v2s5) + addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s6) + addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s6) + addFormatterTest("%#+v", v2, "("+v2t+")"+v2s7) + addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s8) + addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s8) + + // Structs that are indirectly circular. + v3 := indirCir1{nil} + tic2 := indirCir2{nil} + tic3 := indirCir3{&v3} + tic2.ps3 = &tic3 + v3.ps2 = &tic2 + pv3 := &v3 + tic2Addr := fmt.Sprintf("%p", &tic2) + tic3Addr := fmt.Sprintf("%p", &tic3) + v3Addr := fmt.Sprintf("%p", pv3) + pv3Addr := fmt.Sprintf("%p", &pv3) + v3t := "spew_test.indirCir1" + v3t2 := "spew_test.indirCir2" + v3t3 := "spew_test.indirCir3" + v3s := "{<*>{<*>{<*>{<*>}}}}" + v3s2 := "{<*>{<*>{<*>}}}" + v3s3 := "{ps2:<*>(" + tic2Addr + "){ps3:<*>(" + tic3Addr + "){ps1:<*>(" + + v3Addr + "){ps2:<*>(" + tic2Addr + ")}}}}" + v3s4 := "{ps2:<*>(" + tic2Addr + "){ps3:<*>(" + tic3Addr + "){ps1:<*>(" + + v3Addr + ")}}}" + v3s5 := "{ps2:(*" + v3t2 + "){ps3:(*" + v3t3 + "){ps1:(*" + v3t + + "){ps2:(*" + v3t2 + ")}}}}" + v3s6 := "{ps2:(*" + v3t2 + "){ps3:(*" + v3t3 + "){ps1:(*" + v3t + + ")}}}" + v3s7 := "{ps2:(*" + v3t2 + ")(" + tic2Addr + "){ps3:(*" + v3t3 + ")(" + + tic3Addr + "){ps1:(*" + v3t + ")(" + v3Addr + "){ps2:(*" + v3t2 + + ")(" + tic2Addr + ")}}}}" + v3s8 := "{ps2:(*" + v3t2 + ")(" + tic2Addr + "){ps3:(*" + v3t3 + ")(" + + tic3Addr + "){ps1:(*" + v3t + ")(" + v3Addr + ")}}}" + addFormatterTest("%v", v3, v3s) + addFormatterTest("%v", pv3, "<*>"+v3s2) + addFormatterTest("%v", &pv3, "<**>"+v3s2) + addFormatterTest("%+v", v3, v3s3) + addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s4) + addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s4) + addFormatterTest("%#v", v3, "("+v3t+")"+v3s5) + addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s6) + addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s6) + addFormatterTest("%#+v", v3, "("+v3t+")"+v3s7) + addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s8) + addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s8) +} + +func addPanicFormatterTests() { + // Type that panics in its Stringer interface. + v := panicer(127) + nv := (*panicer)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "spew_test.panicer" + vs := "(PANIC=test panic)127" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") +} + +func addErrorFormatterTests() { + // Type that has a custom Error interface. + v := customError(127) + nv := (*customError)(nil) + pv := &v + vAddr := fmt.Sprintf("%p", pv) + pvAddr := fmt.Sprintf("%p", &pv) + vt := "spew_test.customError" + vs := "error: 127" + addFormatterTest("%v", v, vs) + addFormatterTest("%v", pv, "<*>"+vs) + addFormatterTest("%v", &pv, "<**>"+vs) + addFormatterTest("%v", nv, "") + addFormatterTest("%+v", v, vs) + addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) + addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%+v", nv, "") + addFormatterTest("%#v", v, "("+vt+")"+vs) + addFormatterTest("%#v", pv, "(*"+vt+")"+vs) + addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) + addFormatterTest("%#v", nv, "(*"+vt+")"+"") + addFormatterTest("%#+v", v, "("+vt+")"+vs) + addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) + addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) + addFormatterTest("%#+v", nv, "(*"+vt+")"+"") +} + +func addPassthroughFormatterTests() { + // %x passthrough with uint. + v := uint(4294967295) + pv := &v + vAddr := fmt.Sprintf("%x", pv) + pvAddr := fmt.Sprintf("%x", &pv) + vs := "ffffffff" + addFormatterTest("%x", v, vs) + addFormatterTest("%x", pv, vAddr) + addFormatterTest("%x", &pv, pvAddr) + + // %#x passthrough with uint. + v2 := int(2147483647) + pv2 := &v2 + v2Addr := fmt.Sprintf("%#x", pv2) + pv2Addr := fmt.Sprintf("%#x", &pv2) + v2s := "0x7fffffff" + addFormatterTest("%#x", v2, v2s) + addFormatterTest("%#x", pv2, v2Addr) + addFormatterTest("%#x", &pv2, pv2Addr) + + // %f passthrough with precision. + addFormatterTest("%.2f", 3.1415, "3.14") + addFormatterTest("%.3f", 3.1415, "3.142") + addFormatterTest("%.4f", 3.1415, "3.1415") + + // %f passthrough with width and precision. + addFormatterTest("%5.2f", 3.1415, " 3.14") + addFormatterTest("%6.3f", 3.1415, " 3.142") + addFormatterTest("%7.4f", 3.1415, " 3.1415") + + // %d passthrough with width. + addFormatterTest("%3d", 127, "127") + addFormatterTest("%4d", 127, " 127") + addFormatterTest("%5d", 127, " 127") + + // %q passthrough with string. + addFormatterTest("%q", "test", "\"test\"") +} + +// TestFormatter executes all of the tests described by formatterTests. +func TestFormatter(t *testing.T) { + // Setup tests. + addIntFormatterTests() + addUintFormatterTests() + addBoolFormatterTests() + addFloatFormatterTests() + addComplexFormatterTests() + addArrayFormatterTests() + addSliceFormatterTests() + addStringFormatterTests() + addInterfaceFormatterTests() + addMapFormatterTests() + addStructFormatterTests() + addUintptrFormatterTests() + addUnsafePointerFormatterTests() + addChanFormatterTests() + addFuncFormatterTests() + addCircularFormatterTests() + addPanicFormatterTests() + addErrorFormatterTests() + addPassthroughFormatterTests() + + t.Logf("Running %d tests", len(formatterTests)) + for i, test := range formatterTests { + buf := new(bytes.Buffer) + spew.Fprintf(buf, test.format, test.in) + s := buf.String() + if testFailed(s, test.wants) { + t.Errorf("Formatter #%d format: %s got: %s %s", i, test.format, s, + stringizeWants(test.wants)) + continue + } + } +} + +type testStruct struct { + x int +} + +func (ts testStruct) String() string { + return fmt.Sprintf("ts.%d", ts.x) +} + +type testStructP struct { + x int +} + +func (ts *testStructP) String() string { + return fmt.Sprintf("ts.%d", ts.x) +} + +func TestPrintSortedKeys(t *testing.T) { + cfg := spew.ConfigState{SortKeys: true} + s := cfg.Sprint(map[int]string{1: "1", 3: "3", 2: "2"}) + expected := "map[1:1 2:2 3:3]" + if s != expected { + t.Errorf("Sorted keys mismatch 1:\n %v %v", s, expected) + } + + s = cfg.Sprint(map[stringer]int{"1": 1, "3": 3, "2": 2}) + expected = "map[stringer 1:1 stringer 2:2 stringer 3:3]" + if s != expected { + t.Errorf("Sorted keys mismatch 2:\n %v %v", s, expected) + } + + s = cfg.Sprint(map[pstringer]int{pstringer("1"): 1, pstringer("3"): 3, pstringer("2"): 2}) + expected = "map[stringer 1:1 stringer 2:2 stringer 3:3]" + if spew.UnsafeDisabled { + expected = "map[1:1 2:2 3:3]" + } + if s != expected { + t.Errorf("Sorted keys mismatch 3:\n %v %v", s, expected) + } + + s = cfg.Sprint(map[testStruct]int{testStruct{1}: 1, testStruct{3}: 3, testStruct{2}: 2}) + expected = "map[ts.1:1 ts.2:2 ts.3:3]" + if s != expected { + t.Errorf("Sorted keys mismatch 4:\n %v %v", s, expected) + } + + if !spew.UnsafeDisabled { + s = cfg.Sprint(map[testStructP]int{testStructP{1}: 1, testStructP{3}: 3, testStructP{2}: 2}) + expected = "map[ts.1:1 ts.2:2 ts.3:3]" + if s != expected { + t.Errorf("Sorted keys mismatch 5:\n %v %v", s, expected) + } + } + + s = cfg.Sprint(map[customError]int{customError(1): 1, customError(3): 3, customError(2): 2}) + expected = "map[error: 1:1 error: 2:2 error: 3:3]" + if s != expected { + t.Errorf("Sorted keys mismatch 6:\n %v %v", s, expected) + } +} diff --git a/vendor/github.com/davecgh/go-spew/spew/internal_test.go b/vendor/github.com/davecgh/go-spew/spew/internal_test.go new file mode 100644 index 00000000..20a9cfef --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/internal_test.go @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* +This test file is part of the spew package rather than than the spew_test +package because it needs access to internals to properly test certain cases +which are not possible via the public interface since they should never happen. +*/ + +package spew + +import ( + "bytes" + "reflect" + "testing" +) + +// dummyFmtState implements a fake fmt.State to use for testing invalid +// reflect.Value handling. This is necessary because the fmt package catches +// invalid values before invoking the formatter on them. +type dummyFmtState struct { + bytes.Buffer +} + +func (dfs *dummyFmtState) Flag(f int) bool { + if f == int('+') { + return true + } + return false +} + +func (dfs *dummyFmtState) Precision() (int, bool) { + return 0, false +} + +func (dfs *dummyFmtState) Width() (int, bool) { + return 0, false +} + +// TestInvalidReflectValue ensures the dump and formatter code handles an +// invalid reflect value properly. This needs access to internal state since it +// should never happen in real code and therefore can't be tested via the public +// API. +func TestInvalidReflectValue(t *testing.T) { + i := 1 + + // Dump invalid reflect value. + v := new(reflect.Value) + buf := new(bytes.Buffer) + d := dumpState{w: buf, cs: &Config} + d.dump(*v) + s := buf.String() + want := "" + if s != want { + t.Errorf("InvalidReflectValue #%d\n got: %s want: %s", i, s, want) + } + i++ + + // Formatter invalid reflect value. + buf2 := new(dummyFmtState) + f := formatState{value: *v, cs: &Config, fs: buf2} + f.format(*v) + s = buf2.String() + want = "" + if s != want { + t.Errorf("InvalidReflectValue #%d got: %s want: %s", i, s, want) + } +} + +// SortValues makes the internal sortValues function available to the test +// package. +func SortValues(values []reflect.Value, cs *ConfigState) { + sortValues(values, cs) +} diff --git a/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go b/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go new file mode 100644 index 00000000..a0c612ec --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go @@ -0,0 +1,102 @@ +// Copyright (c) 2013-2016 Dave Collins + +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. + +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when the code is not running on Google App Engine, compiled by GopherJS, and +// "-tags safe" is not added to the go build command line. The "disableunsafe" +// tag is deprecated and thus should not be used. +// +build !js,!appengine,!safe,!disableunsafe + +/* +This test file is part of the spew package rather than than the spew_test +package because it needs access to internals to properly test certain cases +which are not possible via the public interface since they should never happen. +*/ + +package spew + +import ( + "bytes" + "reflect" + "testing" + "unsafe" +) + +// changeKind uses unsafe to intentionally change the kind of a reflect.Value to +// the maximum kind value which does not exist. This is needed to test the +// fallback code which punts to the standard fmt library for new types that +// might get added to the language. +func changeKind(v *reflect.Value, readOnly bool) { + rvf := (*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + offsetFlag)) + *rvf = *rvf | ((1< + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "fmt" + "io" +) + +// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the formatted string as a value that satisfies error. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Errorf(format string, a ...interface{}) (err error) { + return fmt.Errorf(format, convertArgs(a)...) +} + +// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b)) +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprint(w, convertArgs(a)...) +} + +// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { + return fmt.Fprintf(w, format, convertArgs(a)...) +} + +// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it +// passed with a default Formatter interface returned by NewFormatter. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b)) +func Fprintln(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprintln(w, convertArgs(a)...) +} + +// Print is a wrapper for fmt.Print that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b)) +func Print(a ...interface{}) (n int, err error) { + return fmt.Print(convertArgs(a)...) +} + +// Printf is a wrapper for fmt.Printf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Printf(format string, a ...interface{}) (n int, err error) { + return fmt.Printf(format, convertArgs(a)...) +} + +// Println is a wrapper for fmt.Println that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b)) +func Println(a ...interface{}) (n int, err error) { + return fmt.Println(convertArgs(a)...) +} + +// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b)) +func Sprint(a ...interface{}) string { + return fmt.Sprint(convertArgs(a)...) +} + +// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Sprintf(format string, a ...interface{}) string { + return fmt.Sprintf(format, convertArgs(a)...) +} + +// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it +// were passed with a default Formatter interface returned by NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b)) +func Sprintln(a ...interface{}) string { + return fmt.Sprintln(convertArgs(a)...) +} + +// convertArgs accepts a slice of arguments and returns a slice of the same +// length with each argument converted to a default spew Formatter interface. +func convertArgs(args []interface{}) (formatters []interface{}) { + formatters = make([]interface{}, len(args)) + for index, arg := range args { + formatters[index] = NewFormatter(arg) + } + return formatters +} diff --git a/vendor/github.com/davecgh/go-spew/spew/spew_test.go b/vendor/github.com/davecgh/go-spew/spew/spew_test.go new file mode 100644 index 00000000..b70466c6 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/spew_test.go @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2013-2016 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew_test + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "testing" + + "github.com/davecgh/go-spew/spew" +) + +// spewFunc is used to identify which public function of the spew package or +// ConfigState a test applies to. +type spewFunc int + +const ( + fCSFdump spewFunc = iota + fCSFprint + fCSFprintf + fCSFprintln + fCSPrint + fCSPrintln + fCSSdump + fCSSprint + fCSSprintf + fCSSprintln + fCSErrorf + fCSNewFormatter + fErrorf + fFprint + fFprintln + fPrint + fPrintln + fSdump + fSprint + fSprintf + fSprintln +) + +// Map of spewFunc values to names for pretty printing. +var spewFuncStrings = map[spewFunc]string{ + fCSFdump: "ConfigState.Fdump", + fCSFprint: "ConfigState.Fprint", + fCSFprintf: "ConfigState.Fprintf", + fCSFprintln: "ConfigState.Fprintln", + fCSSdump: "ConfigState.Sdump", + fCSPrint: "ConfigState.Print", + fCSPrintln: "ConfigState.Println", + fCSSprint: "ConfigState.Sprint", + fCSSprintf: "ConfigState.Sprintf", + fCSSprintln: "ConfigState.Sprintln", + fCSErrorf: "ConfigState.Errorf", + fCSNewFormatter: "ConfigState.NewFormatter", + fErrorf: "spew.Errorf", + fFprint: "spew.Fprint", + fFprintln: "spew.Fprintln", + fPrint: "spew.Print", + fPrintln: "spew.Println", + fSdump: "spew.Sdump", + fSprint: "spew.Sprint", + fSprintf: "spew.Sprintf", + fSprintln: "spew.Sprintln", +} + +func (f spewFunc) String() string { + if s, ok := spewFuncStrings[f]; ok { + return s + } + return fmt.Sprintf("Unknown spewFunc (%d)", int(f)) +} + +// spewTest is used to describe a test to be performed against the public +// functions of the spew package or ConfigState. +type spewTest struct { + cs *spew.ConfigState + f spewFunc + format string + in interface{} + want string +} + +// spewTests houses the tests to be performed against the public functions of +// the spew package and ConfigState. +// +// These tests are only intended to ensure the public functions are exercised +// and are intentionally not exhaustive of types. The exhaustive type +// tests are handled in the dump and format tests. +var spewTests []spewTest + +// redirStdout is a helper function to return the standard output from f as a +// byte slice. +func redirStdout(f func()) ([]byte, error) { + tempFile, err := ioutil.TempFile("", "ss-test") + if err != nil { + return nil, err + } + fileName := tempFile.Name() + defer os.Remove(fileName) // Ignore error + + origStdout := os.Stdout + os.Stdout = tempFile + f() + os.Stdout = origStdout + tempFile.Close() + + return ioutil.ReadFile(fileName) +} + +func initSpewTests() { + // Config states with various settings. + scsDefault := spew.NewDefaultConfig() + scsNoMethods := &spew.ConfigState{Indent: " ", DisableMethods: true} + scsNoPmethods := &spew.ConfigState{Indent: " ", DisablePointerMethods: true} + scsMaxDepth := &spew.ConfigState{Indent: " ", MaxDepth: 1} + scsContinue := &spew.ConfigState{Indent: " ", ContinueOnMethod: true} + scsNoPtrAddr := &spew.ConfigState{DisablePointerAddresses: true} + scsNoCap := &spew.ConfigState{DisableCapacities: true} + + // Variables for tests on types which implement Stringer interface with and + // without a pointer receiver. + ts := stringer("test") + tps := pstringer("test") + + type ptrTester struct { + s *struct{} + } + tptr := &ptrTester{s: &struct{}{}} + + // depthTester is used to test max depth handling for structs, array, slices + // and maps. + type depthTester struct { + ic indirCir1 + arr [1]string + slice []string + m map[string]int + } + dt := depthTester{indirCir1{nil}, [1]string{"arr"}, []string{"slice"}, + map[string]int{"one": 1}} + + // Variable for tests on types which implement error interface. + te := customError(10) + + spewTests = []spewTest{ + {scsDefault, fCSFdump, "", int8(127), "(int8) 127\n"}, + {scsDefault, fCSFprint, "", int16(32767), "32767"}, + {scsDefault, fCSFprintf, "%v", int32(2147483647), "2147483647"}, + {scsDefault, fCSFprintln, "", int(2147483647), "2147483647\n"}, + {scsDefault, fCSPrint, "", int64(9223372036854775807), "9223372036854775807"}, + {scsDefault, fCSPrintln, "", uint8(255), "255\n"}, + {scsDefault, fCSSdump, "", uint8(64), "(uint8) 64\n"}, + {scsDefault, fCSSprint, "", complex(1, 2), "(1+2i)"}, + {scsDefault, fCSSprintf, "%v", complex(float32(3), 4), "(3+4i)"}, + {scsDefault, fCSSprintln, "", complex(float64(5), 6), "(5+6i)\n"}, + {scsDefault, fCSErrorf, "%#v", uint16(65535), "(uint16)65535"}, + {scsDefault, fCSNewFormatter, "%v", uint32(4294967295), "4294967295"}, + {scsDefault, fErrorf, "%v", uint64(18446744073709551615), "18446744073709551615"}, + {scsDefault, fFprint, "", float32(3.14), "3.14"}, + {scsDefault, fFprintln, "", float64(6.28), "6.28\n"}, + {scsDefault, fPrint, "", true, "true"}, + {scsDefault, fPrintln, "", false, "false\n"}, + {scsDefault, fSdump, "", complex(-10, -20), "(complex128) (-10-20i)\n"}, + {scsDefault, fSprint, "", complex(-1, -2), "(-1-2i)"}, + {scsDefault, fSprintf, "%v", complex(float32(-3), -4), "(-3-4i)"}, + {scsDefault, fSprintln, "", complex(float64(-5), -6), "(-5-6i)\n"}, + {scsNoMethods, fCSFprint, "", ts, "test"}, + {scsNoMethods, fCSFprint, "", &ts, "<*>test"}, + {scsNoMethods, fCSFprint, "", tps, "test"}, + {scsNoMethods, fCSFprint, "", &tps, "<*>test"}, + {scsNoPmethods, fCSFprint, "", ts, "stringer test"}, + {scsNoPmethods, fCSFprint, "", &ts, "<*>stringer test"}, + {scsNoPmethods, fCSFprint, "", tps, "test"}, + {scsNoPmethods, fCSFprint, "", &tps, "<*>stringer test"}, + {scsMaxDepth, fCSFprint, "", dt, "{{} [] [] map[]}"}, + {scsMaxDepth, fCSFdump, "", dt, "(spew_test.depthTester) {\n" + + " ic: (spew_test.indirCir1) {\n \n },\n" + + " arr: ([1]string) (len=1 cap=1) {\n \n },\n" + + " slice: ([]string) (len=1 cap=1) {\n \n },\n" + + " m: (map[string]int) (len=1) {\n \n }\n}\n"}, + {scsContinue, fCSFprint, "", ts, "(stringer test) test"}, + {scsContinue, fCSFdump, "", ts, "(spew_test.stringer) " + + "(len=4) (stringer test) \"test\"\n"}, + {scsContinue, fCSFprint, "", te, "(error: 10) 10"}, + {scsContinue, fCSFdump, "", te, "(spew_test.customError) " + + "(error: 10) 10\n"}, + {scsNoPtrAddr, fCSFprint, "", tptr, "<*>{<*>{}}"}, + {scsNoPtrAddr, fCSSdump, "", tptr, "(*spew_test.ptrTester)({\ns: (*struct {})({\n})\n})\n"}, + {scsNoCap, fCSSdump, "", make([]string, 0, 10), "([]string) {\n}\n"}, + {scsNoCap, fCSSdump, "", make([]string, 1, 10), "([]string) (len=1) {\n(string) \"\"\n}\n"}, + } +} + +// TestSpew executes all of the tests described by spewTests. +func TestSpew(t *testing.T) { + initSpewTests() + + t.Logf("Running %d tests", len(spewTests)) + for i, test := range spewTests { + buf := new(bytes.Buffer) + switch test.f { + case fCSFdump: + test.cs.Fdump(buf, test.in) + + case fCSFprint: + test.cs.Fprint(buf, test.in) + + case fCSFprintf: + test.cs.Fprintf(buf, test.format, test.in) + + case fCSFprintln: + test.cs.Fprintln(buf, test.in) + + case fCSPrint: + b, err := redirStdout(func() { test.cs.Print(test.in) }) + if err != nil { + t.Errorf("%v #%d %v", test.f, i, err) + continue + } + buf.Write(b) + + case fCSPrintln: + b, err := redirStdout(func() { test.cs.Println(test.in) }) + if err != nil { + t.Errorf("%v #%d %v", test.f, i, err) + continue + } + buf.Write(b) + + case fCSSdump: + str := test.cs.Sdump(test.in) + buf.WriteString(str) + + case fCSSprint: + str := test.cs.Sprint(test.in) + buf.WriteString(str) + + case fCSSprintf: + str := test.cs.Sprintf(test.format, test.in) + buf.WriteString(str) + + case fCSSprintln: + str := test.cs.Sprintln(test.in) + buf.WriteString(str) + + case fCSErrorf: + err := test.cs.Errorf(test.format, test.in) + buf.WriteString(err.Error()) + + case fCSNewFormatter: + fmt.Fprintf(buf, test.format, test.cs.NewFormatter(test.in)) + + case fErrorf: + err := spew.Errorf(test.format, test.in) + buf.WriteString(err.Error()) + + case fFprint: + spew.Fprint(buf, test.in) + + case fFprintln: + spew.Fprintln(buf, test.in) + + case fPrint: + b, err := redirStdout(func() { spew.Print(test.in) }) + if err != nil { + t.Errorf("%v #%d %v", test.f, i, err) + continue + } + buf.Write(b) + + case fPrintln: + b, err := redirStdout(func() { spew.Println(test.in) }) + if err != nil { + t.Errorf("%v #%d %v", test.f, i, err) + continue + } + buf.Write(b) + + case fSdump: + str := spew.Sdump(test.in) + buf.WriteString(str) + + case fSprint: + str := spew.Sprint(test.in) + buf.WriteString(str) + + case fSprintf: + str := spew.Sprintf(test.format, test.in) + buf.WriteString(str) + + case fSprintln: + str := spew.Sprintln(test.in) + buf.WriteString(str) + + default: + t.Errorf("%v #%d unrecognized function", test.f, i) + continue + } + s := buf.String() + if test.want != s { + t.Errorf("ConfigState #%d\n got: %s want: %s", i, s, test.want) + continue + } + } +} diff --git a/vendor/github.com/davecgh/go-spew/spew/testdata/dumpcgo.go b/vendor/github.com/davecgh/go-spew/spew/testdata/dumpcgo.go new file mode 100644 index 00000000..5c87dd45 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/spew/testdata/dumpcgo.go @@ -0,0 +1,82 @@ +// Copyright (c) 2013 Dave Collins +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when both cgo is supported and "-tags testcgo" is added to the go test +// command line. This code should really only be in the dumpcgo_test.go file, +// but unfortunately Go will not allow cgo in test files, so this is a +// workaround to allow cgo types to be tested. This configuration is used +// because spew itself does not require cgo to run even though it does handle +// certain cgo types specially. Rather than forcing all clients to require cgo +// and an external C compiler just to run the tests, this scheme makes them +// optional. +// +build cgo,testcgo + +package testdata + +/* +#include +typedef unsigned char custom_uchar_t; + +char *ncp = 0; +char *cp = "test"; +char ca[6] = {'t', 'e', 's', 't', '2', '\0'}; +unsigned char uca[6] = {'t', 'e', 's', 't', '3', '\0'}; +signed char sca[6] = {'t', 'e', 's', 't', '4', '\0'}; +uint8_t ui8ta[6] = {'t', 'e', 's', 't', '5', '\0'}; +custom_uchar_t tuca[6] = {'t', 'e', 's', 't', '6', '\0'}; +*/ +import "C" + +// GetCgoNullCharPointer returns a null char pointer via cgo. This is only +// used for tests. +func GetCgoNullCharPointer() interface{} { + return C.ncp +} + +// GetCgoCharPointer returns a char pointer via cgo. This is only used for +// tests. +func GetCgoCharPointer() interface{} { + return C.cp +} + +// GetCgoCharArray returns a char array via cgo and the array's len and cap. +// This is only used for tests. +func GetCgoCharArray() (interface{}, int, int) { + return C.ca, len(C.ca), cap(C.ca) +} + +// GetCgoUnsignedCharArray returns an unsigned char array via cgo and the +// array's len and cap. This is only used for tests. +func GetCgoUnsignedCharArray() (interface{}, int, int) { + return C.uca, len(C.uca), cap(C.uca) +} + +// GetCgoSignedCharArray returns a signed char array via cgo and the array's len +// and cap. This is only used for tests. +func GetCgoSignedCharArray() (interface{}, int, int) { + return C.sca, len(C.sca), cap(C.sca) +} + +// GetCgoUint8tArray returns a uint8_t array via cgo and the array's len and +// cap. This is only used for tests. +func GetCgoUint8tArray() (interface{}, int, int) { + return C.ui8ta, len(C.ui8ta), cap(C.ui8ta) +} + +// GetCgoTypdefedUnsignedCharArray returns a typedefed unsigned char array via +// cgo and the array's len and cap. This is only used for tests. +func GetCgoTypdefedUnsignedCharArray() (interface{}, int, int) { + return C.tuca, len(C.tuca), cap(C.tuca) +} diff --git a/vendor/github.com/davecgh/go-spew/test_coverage.txt b/vendor/github.com/davecgh/go-spew/test_coverage.txt new file mode 100644 index 00000000..2cd087a2 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/test_coverage.txt @@ -0,0 +1,61 @@ + +github.com/davecgh/go-spew/spew/dump.go dumpState.dump 100.00% (88/88) +github.com/davecgh/go-spew/spew/format.go formatState.format 100.00% (82/82) +github.com/davecgh/go-spew/spew/format.go formatState.formatPtr 100.00% (52/52) +github.com/davecgh/go-spew/spew/dump.go dumpState.dumpPtr 100.00% (44/44) +github.com/davecgh/go-spew/spew/dump.go dumpState.dumpSlice 100.00% (39/39) +github.com/davecgh/go-spew/spew/common.go handleMethods 100.00% (30/30) +github.com/davecgh/go-spew/spew/common.go printHexPtr 100.00% (18/18) +github.com/davecgh/go-spew/spew/common.go unsafeReflectValue 100.00% (13/13) +github.com/davecgh/go-spew/spew/format.go formatState.constructOrigFormat 100.00% (12/12) +github.com/davecgh/go-spew/spew/dump.go fdump 100.00% (11/11) +github.com/davecgh/go-spew/spew/format.go formatState.Format 100.00% (11/11) +github.com/davecgh/go-spew/spew/common.go init 100.00% (10/10) +github.com/davecgh/go-spew/spew/common.go printComplex 100.00% (9/9) +github.com/davecgh/go-spew/spew/common.go valuesSorter.Less 100.00% (8/8) +github.com/davecgh/go-spew/spew/format.go formatState.buildDefaultFormat 100.00% (7/7) +github.com/davecgh/go-spew/spew/format.go formatState.unpackValue 100.00% (5/5) +github.com/davecgh/go-spew/spew/dump.go dumpState.indent 100.00% (4/4) +github.com/davecgh/go-spew/spew/common.go catchPanic 100.00% (4/4) +github.com/davecgh/go-spew/spew/config.go ConfigState.convertArgs 100.00% (4/4) +github.com/davecgh/go-spew/spew/spew.go convertArgs 100.00% (4/4) +github.com/davecgh/go-spew/spew/format.go newFormatter 100.00% (3/3) +github.com/davecgh/go-spew/spew/dump.go Sdump 100.00% (3/3) +github.com/davecgh/go-spew/spew/common.go printBool 100.00% (3/3) +github.com/davecgh/go-spew/spew/common.go sortValues 100.00% (3/3) +github.com/davecgh/go-spew/spew/config.go ConfigState.Sdump 100.00% (3/3) +github.com/davecgh/go-spew/spew/dump.go dumpState.unpackValue 100.00% (3/3) +github.com/davecgh/go-spew/spew/spew.go Printf 100.00% (1/1) +github.com/davecgh/go-spew/spew/spew.go Println 100.00% (1/1) +github.com/davecgh/go-spew/spew/spew.go Sprint 100.00% (1/1) +github.com/davecgh/go-spew/spew/spew.go Sprintf 100.00% (1/1) +github.com/davecgh/go-spew/spew/spew.go Sprintln 100.00% (1/1) +github.com/davecgh/go-spew/spew/common.go printFloat 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go NewDefaultConfig 100.00% (1/1) +github.com/davecgh/go-spew/spew/common.go printInt 100.00% (1/1) +github.com/davecgh/go-spew/spew/common.go printUint 100.00% (1/1) +github.com/davecgh/go-spew/spew/common.go valuesSorter.Len 100.00% (1/1) +github.com/davecgh/go-spew/spew/common.go valuesSorter.Swap 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Errorf 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Fprint 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Fprintf 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Fprintln 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Print 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Printf 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Println 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Sprint 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Sprintf 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Sprintln 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.NewFormatter 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Fdump 100.00% (1/1) +github.com/davecgh/go-spew/spew/config.go ConfigState.Dump 100.00% (1/1) +github.com/davecgh/go-spew/spew/dump.go Fdump 100.00% (1/1) +github.com/davecgh/go-spew/spew/dump.go Dump 100.00% (1/1) +github.com/davecgh/go-spew/spew/spew.go Fprintln 100.00% (1/1) +github.com/davecgh/go-spew/spew/format.go NewFormatter 100.00% (1/1) +github.com/davecgh/go-spew/spew/spew.go Errorf 100.00% (1/1) +github.com/davecgh/go-spew/spew/spew.go Fprint 100.00% (1/1) +github.com/davecgh/go-spew/spew/spew.go Fprintf 100.00% (1/1) +github.com/davecgh/go-spew/spew/spew.go Print 100.00% (1/1) +github.com/davecgh/go-spew/spew ------------------------------- 100.00% (505/505) + diff --git a/vendor/github.com/elastic/beats/.appveyor.yml b/vendor/github.com/elastic/beats/.appveyor.yml new file mode 100644 index 00000000..04e6b737 --- /dev/null +++ b/vendor/github.com/elastic/beats/.appveyor.yml @@ -0,0 +1,107 @@ +# Version format +version: "{build}" + +# Operating system (build VM template) +os: Windows Server 2012 R2 + +# Environment variables +environment: + GOROOT: c:\go1.7.4 + GOPATH: c:\gopath + PYWIN_DL: https://beats-files.s3.amazonaws.com/deps/pywin32-220.win32-py2.7.exe + matrix: + - PROJ: github.com\elastic\beats\metricbeat + BEAT: metricbeat + - PROJ: github.com\elastic\beats\filebeat + BEAT: filebeat + - PROJ: github.com\elastic\beats\winlogbeat + BEAT: winlogbeat + +# Custom clone folder (variables are not expanded here). +clone_folder: c:\gopath\src\github.com\elastic\beats + +# Cache mingw install until appveyor.yml is modified. +cache: +- C:\ProgramData\chocolatey\bin -> .appveyor.yml +- C:\ProgramData\chocolatey\lib -> .appveyor.yml +- C:\go1.7.4 -> .appveyor.yml +- C:\tools\mingw64 -> .appveyor.yml +- C:\pywin_inst.exe -> .appveyor.yml + +# Scripts that run after cloning repository +install: + - ps: c:\gopath\src\github.com\elastic\beats\libbeat\scripts\install-go.ps1 -version 1.7.4 + - set PATH=%GOROOT%\bin;%PATH% + # AppVeyor installed mingw is 32-bit only. + - ps: >- + if(!(Test-Path "C:\tools\mingw64\bin\gcc.exe")) { + cinst mingw > mingw-install.txt + Push-AppveyorArtifact mingw-install.txt + } + - set PATH=C:\tools\mingw64\bin;%GOROOT%\bin;%PATH% + - set PATH=%GOPATH%\bin;%PATH% + - go install github.com/elastic/beats/vendor/github.com/pierrre/gotestcover + - go version + - go env + # Download the PyWin32 installer if it is not cached. + - ps: >- + if(!(Test-Path "C:\pywin_inst.exe")) { + (new-object net.webclient).DownloadFile("$env:PYWIN_DL", 'C:/pywin_inst.exe') + } + - set PYTHONPATH=C:\Python27 + - set PATH=%PYTHONPATH%;%PYTHONPATH%\Scripts;%PATH% + - python --version + - pip install jinja2 nose nose-timer PyYAML redis elasticsearch + - easy_install C:/pywin_inst.exe + +# To run your custom scripts instead of automatic MSBuild +build_script: + # Compile + - appveyor AddCompilationMessage "Starting Compile" + - ps: cd $env:BEAT + - go build + - appveyor AddCompilationMessage "Compile Success" -FileName "%BEAT%.exe" + +# To run your custom scripts instead of automatic tests +test_script: + # Unit tests + - ps: Add-AppveyorTest "Unit Tests" -Outcome Running + - mkdir build\coverage + - gotestcover -race -coverprofile=build/coverage/integration.cov github.com/elastic/beats/%BEAT%/... + - ps: Update-AppveyorTest "Unit Tests" -Outcome Passed + # System tests + - ps: Add-AppveyorTest "System tests" -Outcome Running + - go test -race -c -cover -covermode=atomic -coverpkg ./... + - ps: | + if ($env:BEAT -eq "metricbeat") { + cp .\_meta\fields.common.yml .\_meta\fields.generated.yml + python .\scripts\fields_collector.py | out-file -append -encoding UTF8 -filepath .\_meta\fields.generated.yml + } + - ps: cd tests/system + - nosetests --with-timer + - ps: Update-AppveyorTest "System tests" -Outcome Passed + +after_test: + - ps: cd $env:GOPATH\src\$env:PROJ + - python ..\dev-tools\aggregate_coverage.py -o build\coverage\system.cov .\build\system-tests\run + - python ..\dev-tools\aggregate_coverage.py -o build\coverage\full.cov .\build\coverage + - go tool cover -html=build\coverage\full.cov -o build\coverage\full.html + - ps: Push-AppveyorArtifact build\coverage\full.cov + - ps: Push-AppveyorArtifact build\coverage\full.html + # Upload coverage report. + - "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%" + - pip install codecov + - ps: cd $env:GOPATH\src\github.com\elastic\beats + - codecov -X gcov -f "%BEAT%\build\coverage\full.cov" + +# Executes for both successful and failed builds +on_finish: + - ps: cd $env:GOPATH\src\$env:PROJ + - 7z a -r system-tests-output.zip build\system-tests\run + - ps: Push-AppveyorArtifact system-tests-output.zip + +# To disable deployment +deploy: off + +# Notifications should only be setup using the AppVeyor UI so that +# forks can be created without inheriting the settings. diff --git a/vendor/github.com/elastic/beats/.editorconfig b/vendor/github.com/elastic/beats/.editorconfig new file mode 100644 index 00000000..a92dc218 --- /dev/null +++ b/vendor/github.com/elastic/beats/.editorconfig @@ -0,0 +1,27 @@ +# See: http://editorconfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.json] +indent_size = 4 +indent_style = space + +[*.py] +indent_style = space +indent_size = 4 + +[*.yml] +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[Vagrantfile] +indent_size = 2 +indent_style = space diff --git a/vendor/github.com/elastic/beats/.gitattributes b/vendor/github.com/elastic/beats/.gitattributes new file mode 100644 index 00000000..f02f9636 --- /dev/null +++ b/vendor/github.com/elastic/beats/.gitattributes @@ -0,0 +1,6 @@ +CHANGELOG.md merge=union +CHANGELOG.asciidoc merge=union + +# Keep these file types as CRLF (Windows). +*.bat text eol=crlf +*.cmd text eol=crlf diff --git a/vendor/github.com/elastic/beats/.github/ISSUE_TEMPLATE.md b/vendor/github.com/elastic/beats/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..94bb8777 --- /dev/null +++ b/vendor/github.com/elastic/beats/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,11 @@ +Please post all questions and issues on https://discuss.elastic.co/c/beats +before opening a Github Issue. Your questions will reach a wider audience there, +and if we confirm that there is a bug, then you can open a new issue. + +For security vulnerabilities please only send reports to security@elastic.co. +See https://www.elastic.co/community/security for more information. + +For confirmed bugs, please report: +- Version: +- Operating System: +- Steps to Reproduce: diff --git a/vendor/github.com/elastic/beats/.gitignore b/vendor/github.com/elastic/beats/.gitignore new file mode 100644 index 00000000..9dab3a98 --- /dev/null +++ b/vendor/github.com/elastic/beats/.gitignore @@ -0,0 +1,28 @@ +# Directories +/.vagrant +/.idea +/build +/*/data +/*/logs +/*/_meta/kibana/index-pattern + +# Files +.DS_Store +/glide.lock +/beats.iml +*.dev.yml +*.generated.yml + +# Editor swap files +*.swp +*.swo +*.swn + +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so +*.exe +*.test +*.prof +*.pyc diff --git a/vendor/github.com/elastic/beats/.travis.yml b/vendor/github.com/elastic/beats/.travis.yml new file mode 100644 index 00000000..2fe10844 --- /dev/null +++ b/vendor/github.com/elastic/beats/.travis.yml @@ -0,0 +1,114 @@ +sudo: required +dist: trusty +services: + - docker + +language: go + +# Make sure project can also be built on travis for clones of the repo +go_import_path: github.com/elastic/beats + +env: + global: + # Cross-compile for amd64 only to speed up testing. + - GOX_FLAGS="-arch amd64" + - DOCKER_COMPOSE_VERSION: 1.9.0 + - &go_version 1.7.4 + +matrix: + include: + # General checks + - os: linux + env: TARGETS="check" + go: *go_version + + # Filebeat + - os: linux + env: TARGETS="-C filebeat testsuite" + go: *go_version + - os: osx + env: TARGETS="TEST_ENVIRONMENT=0 -C filebeat testsuite" + go: *go_version + + # Heartbeat + - os: linux + env: TARGETS="-C heartbeat testsuite" + go: *go_version + - os: osx + env: TARGETS="TEST_ENVIRONMENT=0 -C heartbeat testsuite" + go: *go_version + + # Libbeat + - os: linux + env: TARGETS="-C libbeat testsuite" + go: *go_version + - os: linux + env: TARGETS="-C libbeat crosscompile" + go: *go_version + + # Metricbeat + - os: linux + env: TARGETS="-C metricbeat testsuite" + go: *go_version + - os: osx + env: TARGETS="TEST_ENVIRONMENT=0 -C metricbeat testsuite" + go: *go_version + - os: linux + env: TARGETS="-C metricbeat crosscompile" + go: *go_version + + # Packetbeat + - os: linux + env: TARGETS="-C packetbeat testsuite" + go: *go_version + + # Winlogbeat + - os: linux + env: TARGETS="-C winlogbeat crosscompile" + go: *go_version + + # Dashboards + - os: linux + env: TARGETS="-C libbeat/dashboards" + go: *go_version + + # Generators + - os: linux + env: TARGETS="-C generate/metricbeat/metricset test" + go: *go_version + - os: linux + env: TARGETS="-C generate/beat test" + go: *go_version + +addons: + apt: + packages: + - python-virtualenv + - libpcap-dev + - geoip-database + +before_install: + # Docker-compose installation + - sudo rm /usr/local/bin/docker-compose || true + - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose + - chmod +x docker-compose + - sudo mv docker-compose /usr/local/bin + +# Skips installations step +install: true + +script: + - make $TARGETS + +notifications: + slack: + rooms: + secure: "e25J5puEA31dOooTI4T+K+zrTs8XeWIGq2cgmiPt9u/g7eqWeQj1UJnVsr8GOu1RPDyuJZJHXqfrvuOYJTdHzXbwjD0JTbwwVVZMkkZW2SWZHG46HCXPiucjWXEr3hXJKBJDDpIx6VxrN7r17dejv1biQ8QuEFZfiB1H8kbH/ho=" + +after_success: + # Copy full.cov to coverage.txt because codecov.io requires this file + - test -f filebeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f filebeat/build/coverage/full.cov + - test -f heartbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f heartbeat/build/coverage/full.cov + - test -f libbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f libbeat/build/coverage/full.cov + - test -f metricbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f metricbeat/build/coverage/full.cov + - test -f packetbeat/build/coverage/full.cov && bash <(curl -s https://codecov.io/bash) -f packetbeat/build/coverage/full.cov diff --git a/vendor/github.com/elastic/beats/CHANGELOG.asciidoc b/vendor/github.com/elastic/beats/CHANGELOG.asciidoc new file mode 100644 index 00000000..669125cd --- /dev/null +++ b/vendor/github.com/elastic/beats/CHANGELOG.asciidoc @@ -0,0 +1,1378 @@ + +// Use these for links to issue and pulls. Note issues and pulls redirect one to +// each other on Github, so don't worry too much on using the right prefix. +:issue: https://github.com/elastic/beats/issues/ +:pull: https://github.com/elastic/beats/pull/ + +//////////////////////////////////////////////////////////// +// Template, add newest changes here + +=== Beats version HEAD +https://github.com/elastic/beats/compare/v5.2.0...master[Check the HEAD diff] + +==== Breaking changes + +*Affecting all Beats* + +*Filebeat* + +*Heartbeat* + +*Metricbeat* + +*Packetbeat* + +*Winlogbeat* + +==== Bugfixes + +*Affecting all Beats* + +*Filebeat* + +*Heartbeat* + +*Metricbeat* + +*Packetbeat* + +*Winlogbeat* + +==== Added + +*Affecting all Beats* + +*Heartbeat* + +*Metricbeat* + +*Filebeat* + +*Packetbeat* + +*Winlogbeat* + +==== Deprecated + +*Affecting all Beats* + +*Filebeat* + +*Heartbeat* + +*Metricbeat* + +*Packetbeat* + +*Winlogbeat* + +//////////////////////////////////////////////////////////// + +[[release-notes-5.2.2]] +=== Beats version 5.2.2 +https://github.com/elastic/beats/compare/v5.2.1...v5.2.2[View commits] + +*Metricbeat* + +- Fix bug docker module hanging when docker container killed. {issue}3610[3610] +- Set timeout to period instead of 1s by default as documented. {pull}3612[3612] + +[[release-notes-5.2.1]] +=== Beats version 5.2.1 +https://github.com/elastic/beats/compare/v5.2.0...v5.2.1[View commits] + +==== Bugfixes + +*Metricbeat* + +- Fix go routine leak in docker module. {pull}3492[3492] + +*Packetbeat* + +- Fix error in the NFS sample dashboard. {pull}3548[3548] + +*Winlogbeat* + +- Fix error in the Winlogbeat sample dashboard. {pull}3548[3548] + + +[[release-notes-5.2.0]] +=== Beats version 5.2.0 +https://github.com/elastic/beats/compare/v5.1.2...v5.2.0[View commits] + +==== Bugfixes + +*Affecting all Beats* + +- Fix overwriting explicit empty config sections. {issue}2918[2918] + +*Filebeat* + +- Fix alignment issue were Filebeat compiled with Go 1.7.4 was crashing on 32 bits system. {issue}3273[3273] + +*Metricbeat* + +- Fix service times-out at startup. {pull}3056[3056] +- Kafka module case sensitive host name matching. {pull}3193[3193] +- Fix interface conversion panic in couchbase module {pull}3272[3272] + +*Packetbeat* + +- Fix issue where some Cassandra visualizations were showing data from all protocols. {issue}3314[3314] + +==== Added + +*Affecting all Beats* + +- Add support for passing list and dictionary settings via -E flag. +- Support for parsing list and dictionary setting from environment variables. +- Added new flags to import_dashboards (-cacert, -cert, -key, -insecure). {pull}3139[3139] {pull}3163[3163] +- The limit for the number of fields is increased via the mapping template. {pull}3275[3275] +- Updated to Go 1.7.4. {pull}3277[3277] +- Added a NOTICE file containing the notices and licenses of the dependencies. {pull}3334[3334]. + +*Heartbeat* + +- First release, containing monitors for ICMP, TCP, and HTTP. + +*Filebeat* + +- Add enabled config option to prospectors. {pull}3157[3157] +- Add target option for decoded_json_field. {pull}3169[3169] + +*Metricbeat* + +- Kafka module broker matching enhancements. {pull}3129[3129] +- Add a couchbase module with metricsets for node, cluster and bucket. {pull}3081[3081] +- Export number of cores for CPU module. {pull}3192[3192] +- Experimental Prometheus module. {pull}3202[3202] +- Add system socket module that reports all TCP sockets. {pull}3246[3246] +- Kafka consumer groups metricset. {pull}3240[3240] + +*Winlogbeat* + +- Reduced amount of memory allocated while reading event log records. {pull}3113[3113] {pull}3118[3118] + +[[release-notes-5.1.2]] +=== Beats version 5.1.2 +https://github.com/elastic/beats/compare/v5.1.1...v5.1.2[View commits] + +==== Bugfixes + +*Filebeat* + +- Fix registry migration issue from old states where files were only harvested after second restart. {pull}3322[3322] + +*Packetbeat* + +- Fix error on importing dashboards due to colons in the Cassandra dashboard. {issue}3140[3140] +- Fix error on importing dashboards due to the wrong type for the geo_point fields. {pull}3147[3147] + +*Winlogbeat* + +- Fix for "The array bounds are invalid" error when reading large events. {issue}3076[3076] + + +[[release-notes-5.1.1]] +=== Beats version 5.1.1 +https://github.com/elastic/beats/compare/v5.0.2...v5.1.1[View commits] + +==== Breaking changes + +*Metricbeat* + +- Change data structure of experimental haproxy module. {pull}3003[3003] + +*Filebeat* + +- If a file is falling under `ignore_older` during startup, offset is now set to end of file instead of 0. + With the previous logic the whole file was sent in case a line was added and it was inconsistent with + files which were harvested previously. {pull}2907[2907] +- `tail_files` is now only applied on the first scan and not for all new files. {pull}2932[2932] + +==== Bugfixes + +*Affecting all Beats* + +- Fix empty benign errors logged by processor actions. {pull}3046[3046] + +*Metricbeat* + +- Calculate the fsstat values per mounting point, and not filesystem. {pull}2777[2777] + +==== Added + +*Affecting all Beats* + +- Add add_cloud_metadata processor for collecting cloud provider metadata. {pull}2728[2728] +- Added decode_json_fields processor for decoding fields containing JSON strings. {pull}2605[2605] + +*Metricbeat* + +- Add experimental Docker module. Provided by Ingensi and @douaejeouit based on dockbeat. +- Add a sample Redis Kibana dashboard. {pull}2916[2916] +- Add support for MongoDB 3.4 and WiredTiger metrics. {pull}2999[2999] +- Add experimental kafka module with partition metricset. {pull}2969[2969] +- Add raw config option for mysql/status metricset. {pull}3001[3001] +- Add command fileds for mysql/status metricset. {pull}3251[3251] + +*Filebeat* + +- Add command line option `-once` to run Filebeat only once and then close. {pull}2456[2456] +- Only load matching states into prospector to improve state handling {pull}2840[2840] +- Reset all states ttl on startup to make sure it is overwritten by new config {pull}2840[2840] +- Persist all states for files which fall under `ignore_older` to have consistent behaviour {pull}2859[2859] +- Improve shutdown behaviour with large number of files. {pull}3035[3035] + +*Winlogbeat* + +- Add `event_logs.batch_read_size` configuration option. {pull}2641[2641] + +[[release-notes-5.1.0]] +=== Beats version 5.1.0 (skipped) + +Version 5.1.0 doesn't exist because, for a short period of time, the Elastic +Yum and Apt repositories included unreleased binaries labeled 5.1.0. To avoid +confusion and upgrade issues for the people that have installed these without +realizing, we decided to skip the 5.1.0 version and release 5.1.1 instead. + +[[release-notes-5.0.2]] +=== Beats version 5.0.2 +https://github.com/elastic/beats/compare/v5.0.1...v5.0.2[View commits] + +==== Bugfixes + +*Metricbeat* + +- Fix the `password` option in the MongoDB module. {pull}2995[2995] + + +[[release-notes-5.0.1]] +=== Beats version 5.0.1 +https://github.com/elastic/beats/compare/v5.0.0...v5.0.1[View commits] + +==== Bugfixes + +*Metricbeat* + +- Fix `system.process.start_time` on Windows. {pull}2848[2848] +- Fix `system.process.ppid` on Windows. {issue}2860[2860] +- Fix system process metricset for Windows XP and 2003. `cmdline` will be unavailable. {issue}1704[1704] +- Fix access denied issues in system process metricset by enabling SeDebugPrivilege on Windows. {issue}1897[1897] +- Fix system diskio metricset for Windows XP and 2003. {issue}2885[2885] + +*Packetbeat* + +- Fix 'index out of bounds' bug in Packetbeat DNS protocol plugin. {issue}2872[2872] + +*Filebeat* + +- Fix registry cleanup issue when files falling under ignore_older after restart. {issue}2818[2818] + + +==== Added + +*Metricbeat* + +- Add username and password config options to the PostgreSQL module. {pull}2889[2890] +- Add username and password config options to the MongoDB module. {pull}2889[2889] +- Add system core metricset for Windows. {pull}2883[2883] + +*Packetbeat* + +- Define `client_geoip.location` as geo_point in the mappings to be used by the GeoIP processor in the Ingest Node pipeline. + {pull}2795[2795] + +*Filebeat* + +- Stop Filebeat on registrar loading error. {pull}2868[2868] + + +include::libbeat/docs/release-notes/5.0.0.asciidoc[] + +[[release-notes-5.0.0-ga]] +=== Beats version 5.0.0-GA +https://github.com/elastic/beats/compare/v5.0.0-rc1...v5.0.0[View commits] + +The list below covers the changes between 5.0.0-rc1 and 5.0.0 GA only. + +==== Bugfixes + +*Affecting all Beats* + +- Fix kafka output re-trying batches with too large events. {issue}2735[2735] +- Fix kafka output protocol error if `version: 0.10` is configured. {issue}2651[2651] +- Fix kafka output connection closed by broker on SASL/PLAIN. {issue}2717[2717] + +*Metricbeat* + +- Fix high CPU usage on macOS when encountering processes with long command lines. {issue}2747[2747] +- Fix high value of `system.memory.actual.free` and `system.memory.actual.used`. {issue}2653[2653] +- Change several `OpenProcess` calls on Windows to request the lowest possible access provilege. {issue}1897[1897] +- Fix system.memory.actual.free high value on Windows. {issue}2653[2653] + +*Filebeat* + +- Fix issue when clean_removed and clean_inactive were used together that states were not directly removed from the registry. +- Fix issue where upgrading a 1.x registry file resulted in duplicate state entries. {pull}2792[2792] + +==== Added + +*Affecting all Beats* + +- Add beat.version fields to all events. + +[[release-notes-5.0.0-rc1]] +=== Beats version 5.0.0-rc1 +https://github.com/elastic/beats/compare/v5.0.0-beta1...v5.0.0-rc1[View commits] + +==== Breaking changes + +*Affecting all Beats* + +- A dynamic mapping rule is added to the default Elasticsearch template to treat strings as keywords by default. {pull}2688[2688] + +==== Bugfixes + +*Affecting all Beats* + +- Make sure Beats sent always float values when they are defined as float by sending 5.00000 instead of 5. {pull}2627[2627] +- Fix ignoring all fields from drop_fields in case the first field is unknown. {pull}2685[2685] +- Fix dynamic configuration int/uint to float type conversion. {pull}2698[2698] +- Fix primitive types conversion if values are read from environment variables. {pull}2698[2698] + +*Metricbeat* + +- Fix default configuration file on Windows to not enabled the `load` metricset. {pull}2632[2632] + +*Packetbeat* + +- Fix the `bpf_filter` setting. {issue}2660[2660] + +*Filebeat* + +- Fix input buffer on encoding problem. {pull}2416[2416] + +==== Deprecated + +*Affecting all Beats* + +- Setting `port` has been deprecated in Redis and Logstash outputs. {pull}2620[2620] + + +[[release-notes-5.0.0-beta1]] +=== Beats version 5.0.0-beta1 +https://github.com/elastic/beats/compare/v5.0.0-alpha5...v5.0.0-beta1[View commits] + +==== Breaking changes + +*Affecting all Beats* + +- Change Elasticsearch output index configuration to be based on format strings. If index has been configured, no date will be appended anymore to the index name. {pull}2119[2119] +- Replace `output.kafka.use_type` by `output.kafka.topic` accepting a format string. {pull}2188[2188] +- If the path specified by the `-c` flag is not absolute and `-path.config` is not specified, it + is considered relative to the current working directory. {pull}2245[2245] +- rename `tls` configurations section to `ssl`. {pull}2330[2330] +- rename `certificate_key` configuration to `key`. {pull}2330[2330] +- replace `tls.insecure` with `ssl.verification_mode` setting. {pull}2330[2330] +- replace `tls.min/max_version` with `ssl.supported_protocols` setting requiring full protocol name. {pull}2330[2330] + +*Metricbeat* + +- Change field type system.process.cpu.start_time from keyword to date. {issue}1565[1565] +- redis/info metricset fields were renamed up according to the naming conventions. + +*Packetbeat* + +- Group HTTP fields under `http.request` and `http.response` {pull}2167[2167] +- Export `http.request.body` and `http.response.body` when configured under `include_body_for` {pull}2167[2167] +- Move `ignore_outgoing` config to `packetbeat.ignore_outgoing` {pull}2393[2393] + +*Filebeat* + +- Set close_inactive default to 5 minutes (was 1 hour before) +- Set clean_removed and close_removed to true by default + +==== Bugfixes + +*Affecting all Beats* + +- Fix logstash output handles error twice when asynchronous sending fails. {pull}2441[2441] +- Fix Elasticsearch structured error response parsing error. {issue}2229[2229] +- Fixed the run script to allow the overriding of the configuration file. {issue}2171[2171] +- Fix logstash output crash if no hosts are configured. {issue}2325[2325] +- Fix array value support in -E CLI flag. {pull}2521[2521] +- Fix merging array values if -c CLI flag is used multiple times. {pull}2521[2521] +- Fix beats failing to start due to invalid duplicate key error in configuration file. {pull}2521[2521] +- Fix panic on non writable logging directory. {pull}2571[2571] + +*Metricbeat* + +- Fix module filters to work properly with drop_event filter. {issue}2249[2249] + +*Packetbeat* + +- Fix mapping for some Packetbeat flow metrics that were not marked as being longs. {issue}2177[2177] +- Fix handling of messages larger than the maximum message size (10MB). {pull}2470[2470] + +*Filebeat* + +- Fix processor failure in Filebeat when using regex, contain, or equals with the message field. {issue}2178[2178] +- Fix async publisher sending empty events {pull}2455[2455] +- Fix potential issue with multiple harvester per file on large file numbers or slow output {pull}2541[2541] + +*Winlogbeat* + +- Fix corrupt registry file that occurs on power loss by disabling file write caching. {issue}2313[2313] + +==== Added + +*Affecting all Beats* + +- Add script to generate the Kibana index-pattern from fields.yml. {pull}2122[2122] +- Enhance Redis output key selection based on format string. {pull}2169[2169] +- Configurable Redis `keys` using filters and format strings. {pull}2169[2169] +- Add format string support to `output.kafka.topic`. {pull}2188[2188] +- Add `output.kafka.topics` for more advanced kafka topic selection per event. {pull}2188[2188] +- Add support for Kafka 0.10. {pull}2190[2190] +- Add SASL/PLAIN authentication support to kafka output. {pull}2190[2190] +- Make Kafka metadata update configurable. {pull}2190[2190] +- Add Kafka version setting (optional) enabling kafka broker version support. {pull}2190[2190] +- Add Kafka message timestamp if at least version 0.10 is configured. {pull}2190[2190] +- Add configurable Kafka event key setting. {pull}2284[2284] +- Add settings for configuring the kafka partitioning strategy. {pull}2284[2284] +- Add partitioner settings `reachable_only` to ignore partitions not reachable by network. {pull}2284[2284] +- Enhance contains condition to work on fields that are arrays of strings. {issue}2237[2237] +- Lookup the configuration file relative to the `-path.config` CLI flag. {pull}2245[2245] +- Re-write import_dashboards.sh in Golang. {pull}2155[2155] +- Update to Go 1.7. {pull}2306[2306] +- Log total non-zero internal metrics on shutdown. {pull}2349[2349] +- Add support for encrypted private key files by introducing `ssl.key_passphrase` setting. {pull}2330[2330] +- Add experimental symlink support with `symlinks` config {pull}2478[2478] +- Improve validation of registry file on startup. + +*Metricbeat* + +- Use the new scaled_float Elasticsearch type for the percentage values. {pull}2156[2156] +- Add experimental cgroup metrics to the system/process MetricSet. {pull}2184[2184] +- Added a PostgreSQL module. {pull}2253[2253] +- Improve mapping by converting half_float to scaled_float and integers to long. {pull}2430[2430] +- Add experimental haproxy module. {pull}2384[2384] +- Add Kibana dashboard for cgroups data {pull}2555[2555] + +*Packetbeat* + +- Add Cassandra protocol analyzer to Packetbeat. {pull}1959[1959] +- Match connections with IPv6 addresses to processes {pull}2254[2254] +- Add IP address to -devices command output {pull}2327[2327] +- Add configuration option for the maximum message size. Used to be hard-coded to 10 MB. {pull}2470[2470] + +*Filebeat* + +- Introduce close_timeout harvester options {issue}1926[1926] +- Strip BOM from first message in case of BOM files {issue}2351[2351] +- Add harvester_limit option {pull}2417[2417] + +==== Deprecated + +*Affecting all Beats* + +- Topology map is deprecated. This applies to the settings: refresh_topology_freq, topology_expire, save_topology, host_topology, password_topology, db_topology. + + +[[release-notes-5.0.0-alpha5]] +=== Beats version 5.0.0-alpha5 +https://github.com/elastic/beats/compare/v5.0.0-alpha4...v5.0.0-alpha5[View commits] + +==== Breaking changes + +*Affecting all Beats* + +- Rename the `filters` section to `processors`. {pull}1944[1944] +- Introduce the condition with `when` in the processor configuration. {pull}1949[1949] +- The Elasticsearch template is now loaded by default. {pull}1993[1993] +- The Redis output `index` setting is renamed to `key`. `index` still works but it's deprecated. {pull}2077[2077] +- The undocumented file output `index` setting was removed. Use `filename` instead. {pull}2077[2077] + +*Metricbeat* + +- Create a separate metricSet for load under the system module and remove load information from CPU stats. {pull}2101[2101] +- Add `system.load.norm.1`, `system.load.norm.5` and `system.load.norm.15`. {pull}2101[2101] +- Add threads fields to mysql module. {pull}2484[2484] + +*Packetbeat* + +- Set `enabled` ` in `packetbeat.protocols.icmp` configuration to `true` by default. {pull}1988[1988] + +==== Bugfixes + +*Affecting all Beats* + +- Fix sync publisher `PublishEvents` return value if client is closed concurrently. {pull}2046[2046] + +*Metricbeat* + +- Do not send zero values when no value was present in the source. {issue}1972[1972] + +*Filebeat* + +- Fix potential data loss between Filebeat restarts, reporting unpublished lines as published. {issue}2041[2041] +- Fix open file handler issue. {issue}2028[2028] {pull}2020[2020] +- Fix filtering of JSON events when using integers in conditions. {issue}2038[2038] + +*Winlogbeat* + +- Fix potential data loss between Winlogbeat restarts, reporting unpublished lines as published. {issue}2041[2041] + +==== Added + +*Affecting all Beats* + +- Periodically log internal metrics. {pull}1955[1955] +- Add enabled setting to all output modules. {pull}1987[1987] +- Command line flag `-c` can be used multiple times. {pull}1985[1985] +- Add OR/AND/NOT to the condition associated with the processors. {pull}1983[1983] +- Add `-E` CLI flag for overwriting single config options via command line. {pull}1986[1986] +- Choose the mapping template file based on the Elasticsearch version. {pull}1993[1993] +- Check stdout being available when console output is configured. {issue}2035[2035] + +*Metricbeat* + +- Add pgid field to process information. {pull} 2021[2021] + +*Packetbeat* + +- Add enabled setting to Packetbeat protocols. {pull}1988[1988] +- Add enabled setting to Packetbeat network flows configuration. {pull}1988[1988] + +*Filebeat* + +- Introduce `close_removed` and `close_renamed` harvester options. {issue}1600[1600] +- Introduce `close_eof` harvester option. {issue}1600[1600] +- Add `clean_removed` and `clean_inactive` config option. {issue}1600[1600] + +==== Deprecated + +*Filebeat* + +- Deprecate `close_older` option and replace it with `close_inactive`. {issue}2051[2051] +- Deprecate `force_close_files` option and replace it with `close_removed` and `close_renamed`. {issue}1600[1600] + +[[release-notes-5.0.0-alpha4]] +=== Beats version 5.0.0-alpha4 +https://github.com/elastic/beats/compare/v5.0.0-alpha3...v5.0.0-alpha4[View commits] + +==== Breaking changes + +*Affecting all Beats* + +- The topology_expire option of the Elasticserach output was removed. {pull}1907[1907] + +*Filebeat* + +- Stop following symlink. Symlinks are now ignored: {pull}1686[1686] + +==== Bugfixes + +*Affecting all Beats* + +- Reset backoff factor on partial ACK. {issue}1803[1803] +- Fix beats load balancer deadlock if max_retries: -1 or publish_async is enabled in filebeat. {issue}1829[1829] +- Fix logstash output with pipelining mode enabled not reconnecting. {issue}1876[1876] +- Empty configuration sections become merge-able with variables containing full path. {pull}1900[1900] +- Fix error message about required fields missing not printing the missing field name. {pull}1900[1900] + +*Metricbeat* + +- Fix the CPU values returned for each core. {issue}1863[1863] + +*Packetbeat* + +- Add missing nil-check to memcached GapInStream handler. {issue}1162[1162] +- Fix NFSv4 Operation returning the first found first-class operation available in compound requests. {pull}1821[1821] +- Fix TCP overlapping segments not being handled correctly. {pull}1898[1898] + +*Winlogbeat* + +- Fix issue with rendering forwarded event log records. {pull}1891[1891] + +==== Added + +*Affecting all Beats* + +- Improve error message if compiling regular expression from config files fails. {pull}1900[1900] +- Compression support in the Elasticsearch output. {pull}1835[1835] + +*Metricbeat* + +- Add MongoDB module. {pull}1837[1837] + + +[[release-notes-5.0.0-alpha3]] +=== Beats version 5.0.0-alpha3 +https://github.com/elastic/beats/compare/v5.0.0-alpha2...v5.0.0-alpha3[View commits] + +==== Breaking changes + +*Affecting all Beats* + +- All configuration settings under `shipper:` are moved to be top level configuration settings. I.e. + `shipper.name:` becomes `name:` in the configuration file. {pull}1570[1570] + +*Topbeat* + +- Topbeat is replaced by Metricbeat. + +*Filebeat* + +- The state for files which fall under ignore_older is not stored anymore. This has the consequence, that if a file which fell under ignore_older is updated, the whole file will be crawled. + +==== Bugfixes + +*Winlogbeat* + +- Adding missing argument to the "Stop processing" log message. {pull}1590[1590] + +==== Added + +*Affecting all Beats* + +- Add conditions to generic filtering. {pull}1623[1623] + +*Metricbeat* + +- First public release, containing the following modules: apache, mysql, nginx, redis, system, and zookeeper. + +*Filebeat* + +- The registry format was changed to an array instead of dict. The migration to the new format will happen automatically at the first startup. {pull}1703[1703] + +==== Deprecated + +*Affecting all Beats* + +- The support for doing GeoIP lookups is deprecated and will be removed in version 6.0. {pull}1601[1601] + + +[[release-notes-5.0.0-alpha2]] +=== Beats version 5.0.0-alpha2 +https://github.com/elastic/beats/compare/v5.0.0-alpha1...v5.0.0-alpha2[View commits] + +==== Breaking changes + +*Affecting all Beats* + +- On DEB/RPM installations, the binary files are now found under `/usr/share/{{beat_name}}/bin`, not in `/usr/bin`. {pull}1385[1385] +- The logs are written by default to self rotating files, instead of syslog. {pull}1371[1371] +- Remove deprecated `host` option from elasticsearch, logstash and redis outputs. {pull}1474[1474] + +*Packetbeat* + +- Configuration of redis topology support changed. {pull}1353[1353] +- Move all Packetbeat configuration options under the packetbeat namespace {issue}1417[1417] + +*Filebeat* + +- Default location for the registry file was changed to be `data/registry` from the binary directory, + rather than `.filebeat` in the current working directory. This affects installations for zip/tar.gz/source, + the location for DEB and RPM packages stays the same. {pull}1373[1373] + +==== Bugfixes + +*Affecting all Beats* + +- Drain response buffers when pipelining is used by Redis output. {pull}1353[1353] +- Unterminated environment variable expressions in config files will now cause an error {pull}1389[1389] +- Fix issue with the automatic template loading when Elasticsearch is not available on Beat start. {issue}1321[1321] +- Fix bug affecting -cpuprofile, -memprofile, and -httpprof CLI flags {pull}1415[1415] +- Fix race when multiple outputs access the same event with logstash output manipulating event {issue}1410[1410] {pull}1428[1428] +- Seed random number generator using crypto.rand package. {pull}1503{1503] +- Fix beats hanging in -configtest {issue}1213[1213] +- Fix kafka log message output {pull}1516[1516] + +*Filebeat* + +- Improvements in registrar dealing with file rotation. {pull}1281[1281] +- Fix issue with JSON decoding where `@timestamp` or `type` keys with the wrong type could cause Filebeat + to crash. {issue}1378[1378] +- Fix issue with JSON decoding where values having `null` as values could crash Filebeat. {issue}1466[1466] +- Multiline reader normalizing newline to use `\n`. {pull}1552[1552] + +*Winlogbeat* + +- Fix panic when reading messages larger than 32K characters on Windows XP and 2003. {pull}1498[1498] +- Fix panic that occurs when reading a large events on Windows Vista and newer. {pull}1499[1499] + +==== Added + +*Affecting all Beats* + +- Add support for TLS to Redis output. {pull}1353[1353] +- Add SOCKS5 proxy support to Redis output. {pull}1353[1353] +- Failover and load balancing support in redis output. {pull}1353[1353] +- Multiple-worker per host support for redis output. {pull}1353[1353] +- Added ability to escape `${x}` in config files to avoid environment variable expansion {pull}1389[1389] +- Configuration options and CLI flags for setting the home, data and config paths. {pull}1373[1373] +- Configuration options and CLI flags for setting the default logs path. {pull}1437[1437] +- Update to Go 1.6.2 {pull}1447[1447] +- Add Elasticsearch template files compatible with Elasticsearch 2.x. {pull}1501[1501] +- Add scripts for managing the dashboards of a single Beat {pull}1359[1359] + +*Packetbeat* + +- Fix compile issues for OpenBSD. {pull}1347[1347] + +*Topbeat* + +- Updated elastic/gosigar version so Topbeat can compile on OpenBSD. {pull}1403[1403] + + +[[release-notes-5.0.0-alpha1]] +=== Beats version 5.0.0-alpha1 +https://github.com/elastic/beats/compare/v1.2.0...v5.0.0-alpha1[View commits] + +==== Breaking changes + +*libbeat* + +- Run function to start a Beat now returns an error instead of directly exiting. {pull}771[771] +- The method signature of HandleFlags() was changed to allow returning an error {pull}1249[1249] +- Require braces for environment variable expansion in config files {pull}1304[1304] + +*Packetbeat* + +- Rename output fields in the dns package. Former flag `recursion_allowed` becomes `recursion_available`. {pull}803[803] + Former SOA field `ttl` becomes `minimum`. {pull}803[803] +- The fully qualified domain names which are part of output fields values of the dns package now terminate with a dot. {pull}803[803] +- Remove the count field from the exported event {pull}1210[1210] + +*Topbeat* + +- Rename `proc.cpu.user_p` with `proc.cpu.total_p` as it includes CPU time spent in kernel space {pull}631[631] +- Remove `count` field from the exported fields {pull}1207[1207] +- Rename `input` top level config option to `topbeat` + +*Filebeat* + +- Scalar values in used in the `fields` configuration setting are no longer automatically converted to strings. {pull}1092[1092] +- Count field was removed from event as not used in filebeat {issue}778[778] + +*Winlogbeat* + +- The `message_inserts` field was replaced with the `event_data` field {issue}1053[1053] +- The `category` field was renamed to `task` to better align with the Windows Event Log API naming {issue}1053[1053] +- Remove the count field from the exported event {pull}1218[1218] + + +==== Bugfixes + +*Affecting all Beats* + +- Logstash output will not retry events that are not JSON-encodable {pull}927[927] + +*Packetbeat* + +- Create a proper BPF filter when ICMP is the only enabled protocol {issue}757[757] +- Check column length in pgsql parser. {issue}565[565] +- Harden pgsql parser. {issue}565[565] + +*Topbeat* + +- Fix issue with `cpu.system_p` being greater than 1 on Windows {pull}1128[1128] + +*Filebeat* + +- Stop filebeat if started without any prospectors defined or empty prospectors {pull}644[644] {pull}647[647] +- Improve shutdown of crawler and prospector to wait for clean completion {pull}720[720] +- Omit `fields` from Filebeat events when null {issue}899[899] + +*Winlogbeat* + +==== Added + +*Affecting all Beats* + +- Update builds to Golang version 1.6 +- Add option to Elasticsearch output to pass http parameters in index operations {issue}805[805] +- Improve Logstash and Elasticsearch backoff behavior. {pull}927[927] +- Add experimental Kafka output. {pull}942[942] +- Add config file option to configure GOMAXPROCS. {pull}969[969] +- Improve shutdown handling in libbeat. {pull}1075[1075] +- Add `fields` and `fields_under_root` options under the `shipper` configuration {pull}1092[1092] +- Add the ability to use a SOCKS5 proxy with the Logstash output {issue}823[823] +- The `-configtest` flag will now print "Config OK" to stdout on success {pull}1249[1249] + +*Packetbeat* + +- Change the DNS library used throughout the dns package to github.com/miekg/dns. {pull}803[803] +- Add support for NFS v3 and v4. {pull}1231[1231] +- Add support for EDNS and DNSSEC. {pull}1292[1292] + +*Topbeat* + +- Add `username` to processes {pull}845[845] + +*Filebeat* + +- Add the ability to set a list of tags for each prospector {pull}1092[1092] +- Add JSON decoding support {pull}1143[1143] + + +*Winlogbeat* + +- Add caching of event metadata handles and the system render context for the wineventlog API {pull}888[888] +- Improve config validation by checking for unknown top-level YAML keys. {pull}1100[1100] +- Add the ability to set tags, fields, and fields_under_root as options for each event log {pull}1092[1092] +- Add additional data to the events published by Winlogbeat. The new fields are `activity_id`, +`event_data`, `keywords`, `opcode`, `process_id`, `provider_guid`, `related_activity_id`, +`task`, `thread_id`, `user_data`, and `version`. {issue}1053[1053] +- Add `event_id`, `level`, and `provider` configuration options for filtering events {pull}1218[1218] +- Add `include_xml` configuration option for including the raw XML with the event {pull}1218[1218] + +==== Known issues +* All Beats can hang or panic on shutdown if the next server in the pipeline (e.g. Elasticsearch or Logstash) is + not reachable. {issue}1319[1319] +* When running the Beats as a service on Windows, you need to manually load the Elasticsearch mapping + template. {issue}1315[1315] +* The ES template automatic load doesn't work if Elasticsearch is not available when the Beat is starting. {issue}1321[1321] + +[[release-notes-1.3.1]] +=== Beats version 1.3.1 +https://github.com/elastic/beats/compare/v1.3.0...v1.3.1[View commits] + +==== Bugfixes + +*Filebeat* + +- Fix a concurrent bug on filebeat startup with a large number of prospectors defined. {pull}2509[2509] + +*Packetbeat* + +- Fix description for the -I CLI flag. {pull}2480[2480] + +*Winlogbeat* + +- Fix corrupt registry file that occurs on power loss by disabling file write caching. {issue}2313[2313] + +[[release-notes-1.3.0]] +=== Beats version 1.3.0 +https://github.com/elastic/beats/compare/v1.2.3...v1.3.0[View commits] + +==== Deprecated + +*Filebeat* + +- Undocumented support for following symlinks is deprecated. Filebeat will not follow symlinks in version 5.0. {pull}1767[1767] + +==== Bugfixes + +*Affecting all Beats* + +- Fix beats load balancer deadlock if `max_retries: -1` or `publish_async` is enabled in filebeat. {issue}1829[1829] +- Fix output modes backoff counter reset. {issue}1803[1803] {pull}1814[1814] {pull}1818[1818] +- Set logstash output default bulk_max_size to 2048. {issue}1662[1662] +- Seed random number generator using crypto.rand package. {pull}1503[1503] +- Check stdout being available when console output is configured. {issue}2063[2063] + +*Packetbeat* + +- Add missing nil-check to memcached GapInStream handler. {issue}1162[1162] +- Fix NFSv4 Operation returning the first found first-class operation available in compound requests. {pull}1821[1821] +- Fix TCP overlapping segments not being handled correctly. {pull}1917[1917] + +==== Added + +*Affecting all Beats* + +- Updated to Go 1.7 + + +[[release-notes-1.2.3]] +=== Beats version 1.2.3 +https://github.com/elastic/beats/compare/v1.2.2...v1.2.3[View commits] + +==== Bugfixes + +*Topbeat* + +- Fix high CPU usage when using filtering under Windows. {pull}1598[1598] + +*Filebeat* + +- Fix rotation issue with ignore_older. {issue}1528[1528] + +*Winlogbeat* + +- Fix panic when reading messages larger than 32K characters on Windows XP and 2003. {pull}1498[1498] + +==== Added + +*Filebeat* + +- Prevent file opening for files which reached ignore_older. {pull}1649[1649] + + +[[release-notes-1.2.2]] +=== Beats version 1.2.2 +https://github.com/elastic/beats/compare/v1.2.0...v1.2.2[View commits] + +==== Bugfixes + +*Affecting all Beats* + +- Fix race when multiple outputs access the same event with Logstash output manipulating event. {issue}1410[1410] +- Fix go-daemon (supervisor used in init scripts) hanging when executed over SSH. {issue}1394[1394] + +*Filebeat* + +- Improvements in registrar dealing with file rotation. {issue}1281[1281] + + +[[release-notes-1.2.1]] +=== Beats version 1.2.1 +https://github.com/elastic/beats/compare/v1.2.0...v1.2.1[View commits] + +==== Breaking changes + +*Affecting all Beats* + +- Require braces for environment variable expansion in config files {pull}1304[1304] +- Removed deprecation warning for the Redis output. {pull}1282[1282] + +*Topbeat* + +- Fixed name of the setting `stats.proc` to `stats.process` in the default configuration file. {pull}1343[1343] +- Fix issue with cpu.system_p being greater than 1 on Windows {pull}1128[1128] + +==== Added + +*Topbeat* + +- Add username to processes {pull}845[845] + + +[[release-notes-1.2.0]] +=== Beats version 1.2.0 +https://github.com/elastic/beats/compare/v1.1.2...v1.2.0[View commits] + +==== Breaking changes + +*Filebeat* + +- Default config for ignore_older is now infinite instead of 24h, means ignore_older is disabled by default. Use close_older to only close file handlers. + +==== Bugfixes + +*Packetbeat* + +- Split real_ip_header value when it contains multiple IPs {pull}1241[1241] + +*Winlogbeat* + +- Fix invalid `event_id` on Windows XP and Windows 2003 {pull}1227[1227] + +==== Added + +*Affecting all Beats* + +- Add ability to override configuration settings using environment variables {issue}114[114] +- Libbeat now always exits through a single exit method for proper cleanup and control {pull}736[736] +- Add ability to create Elasticsearch mapping on startup {pull}639[639] + +*Topbeat* + +- Add the command line used to start processes {issue}533[533] + +*Filebeat* + +- Add close_older configuration option to complete ignore_older https://github.com/elastic/filebeat/issues/181[181] + +[[release-notes-1.1.2]] +=== Beats version 1.1.2 +https://github.com/elastic/beats/compare/v1.1.1...v1.1.2[View commits] + +==== Bugfixes + +*Filebeat* + +- Fix registrar bug for rotated files {pull}1010[1010] + + +[[release-notes-1.1.1]] +=== Beats version 1.1.1 +https://github.com/elastic/beats/compare/v1.1.0...v1.1.1[View commits] + +==== Bugfixes + +*Affecting all Beats* + +- Fix logstash output loop hanging in infinite loop on too many output errors. {pull}944[944] +- Fix critical bug in filebeat and winlogbeat potentially dropping events. {pull}953[953] + +[[release-notes-1.1.0]] +=== Beats version 1.1.0 +https://github.com/elastic/beats/compare/v1.0.1...v1.1.0[View commits] + +==== Bugfixes + +*Affecting all Beats* + +- Fix logging issue with file based output where newlines could be misplaced + during concurrent logging {pull}650[650] +- Reduce memory usage by separate queue sizes for single events and bulk events. {pull}649[649] {issue}516[516] +- Set default default bulk_max_size value to 2048 {pull}628[628] + +*Packetbeat* + +- Fix setting direction to out and use its value to decide when dropping events if ignore_outgoing is enabled {pull}557[557] +- Fix logging issue with file-based output where newlines could be misplaced + during concurrent logging {pull}650[650] +- Reduce memory usage by having separate queue sizes for single events and bulk events. {pull}649[649] {issue}516[516] +- Set default bulk_max_size value to 2048 {pull}628[628] +- Fix logstash window size of 1 not increasing. {pull}598[598] + +*Packetbeat* + +- Fix the condition that determines whether the direction of the transaction is set to "outgoing". Packetbeat uses the + direction field to determine which transactions to drop when dropping outgoing transactions. {pull}557[557] +- Allow PF_RING sniffer type to be configured using pf_ring or pfring {pull}671[671] + +*Filebeat* + +- Set spool_size default value to 2048 {pull}628[628] + +==== Added + +*Affecting all Beats* + +- Add include_fields and drop_fields as part of generic filtering {pull}1120[1120] +- Make logstash output compression level configurable. {pull}630[630] +- Some publisher options refactoring in libbeat {pull}684[684] +- Move event preprocessor applying GeoIP to packetbeat {pull}772[772] + +*Packetbeat* + +- Add support for capturing DNS over TCP network traffic. {pull}486[486] {pull}554[554] + +*Topbeat* + +- Group all CPU usage per core statistics and export them optionally if cpu_per_core is configured {pull}496[496] + +*Filebeat* + +- Add multiline support for combining multiple related lines into one event. {issue}461[461] +- Add `exclude_lines` and `include_lines` options for regexp based line filtering. {pull}430[430] +- Add `exclude_files` configuration option. {pull}563[563] +- Add experimental option to enable filebeat publisher pipeline to operate asynchonrously {pull}782[782] + +*Winlogbeat* + +- First public release of Winlogbeat + +[[release-notes-1.0.1]] +=== Beats version 1.0.1 +https://github.com/elastic/beats/compare/v1.0.0...v1.0.1[Check 1.0.1 diff] + +==== Bugfixes + +*Filebeat* + +- Fix force_close_files in case renamed file appeared very fast. https://github.com/elastic/filebeat/pull/302[302] + +*Packetbeat* + +- Improve MongoDB message correlation. {issue}377[377] +- Improve redis parser performance. {issue}442[422] +- Fix panic on nil in redis protocol parser. {issue}384[384] +- Fix errors redis parser when messages are split in multiple TCP segments. {issue}402[402] +- Fix errors in redis parser when length prefixed strings contain sequences of CRLF. {issue}#402[402] +- Fix errors in redis parser when dealing with nested arrays. {issue}402[402] + +[[release-notes-1.0.0]] +=== Beats version 1.0.0 +https://github.com/elastic/beats/compare/1.0.0-rc2...1.0.0[Check 1.0.0 diff] + +==== Breaking changes + +*Topbeat* + +- Change proc type to process #138 + + +==== Bugfixes + +*Affecting all Beats* + +- Fix random panic on shutdown by calling shutdown handler only once. elastic/filebeat#204 +- Fix credentials are not send when pinging an elasticsearch host. elastic/fileabeat#287 + +*Filebeat* + +- Fix problem that harvesters stopped reading after some time and filebeat stopped processing events #257 +- Fix line truncating by internal buffers being reused by accident #258 +- Set default ignore_older to 24 hours #282 + + + + +[[release-notes-1.0.0-rc2]] +=== Beats version 1.0.0-rc2 +https://github.com/elastic/beats/compare/1.0.0-rc1...1.0.0-rc2[Check 1.0.0-rc2 +diff] + +==== Breaking changes + +*Affecting all Beats* + +- The `shipper` output field is renamed to `beat.name`. #285 +- Use of `enabled` as a configuration option for outputs (elasticsearch, + logstash, etc.) has been removed. #264 +- Use of `disabled` as a configuration option for tls has been removed. #264 +- The `-test` command line flag was renamed to `-configtest`. #264 +- Disable geoip by default. To enable it uncomment in config file. #305 + + +*Filebeat* + +- Removed utf-16be-bom encoding support. Support will be added with fix for #205 +- Rename force_close_windows_files to force_close_files and make it available for all platforms. + + +==== Bugfixes + +*Affecting all Beats* + +- Disable logging to stderr after configuration phase. #276 +- Set the default file logging path when not set in config. #275 +- Fix bug silently dropping records based on current window size. elastic/filebeat#226 +- Fix direction field in published events. #300 +- Fix elasticsearch structured errors breaking error handling. #309 + +*Packetbeat* + +- Packetbeat will now exit if a configuration error is detected. #357 +- Fixed an issue handling DNS requests containing no questions. #369 + +*Topbeat* + +- Fix leak of Windows handles. #98 +- Fix memory leak of process information. #104 + +*Filebeat* + +- Filebeat will now exit if a configuration error is detected. #198 +- Fix to enable prospector to harvest existing files that are modified. #199 +- Improve line reading and encoding to better keep track of file offsets based + on encoding. #224 +- Set input_type by default to "log" + + +==== Added + +*Affecting all Beats* + +- Added `beat.hostname` to contain the hostname where the Beat is running on as + returned by the operating system. #285 +- Added timestamp for file logging. #291 + +*Filebeat* + +- Handling end of line under windows was improved #233 + + + +[[release-notes-1.0.0-rc1]] +=== Beats version 1.0.0-rc1 +https://github.com/elastic/beats/compare/1.0.0-beta4...1.0.0-rc1[Check +1.0.0-rc1 diff] + +==== Breaking changes + +*Affecting all Beats* + +- Rename timestamp field with @timestamp. #237 + +*Packetbeat* + +- Rename timestamp field with @timestamp. #343 + +*Topbeat* + +- Rename timestamp field with @timestamp for a better integration with +Logstash. #80 + +*Filebeat* + +- Rename the timestamp field with @timestamp #168 +- Rename tail_on_rotate prospector config to tail_files +- Removal of line field in event. Line number was not correct and does not add value. #217 + + +==== Bugfixes + +*Affecting all Beats* + +- Use stderr for console log output. #219 +- Handle empty event array in publisher. #207 +- Respect '*' debug selector in IsDebug. #226 (elastic/packetbeat#339) +- Limit number of workers for Elasticsearch output. elastic/packetbeat#226 +- On Windows, remove service related error message when running in the console. #242 +- Fix waitRetry no configured in single output mode configuration. elastic/filebeat#144 +- Use http as the default scheme in the elasticsearch hosts #253 +- Respect max bulk size if bulk publisher (collector) is disabled or sync flag is set. +- Always evaluate status code from Elasticsearch responses when indexing events. #192 +- Use bulk_max_size configuration option instead of bulk_size. #256 +- Fix max_retries=0 (no retries) configuration option. #266 +- Filename used for file based logging now defaults to beat name. #267 + +*Packetbeat* + +- Close file descriptors used to monitor processes. #337 +- Remove old RPM spec file. It moved to elastic/beats-packer. #334 + +*Topbeat* + +- Don't wait for one period until shutdown #75 + +*Filebeat* + +- Omit 'fields' from event JSON when null. #126 +- Make offset and line value of type long in elasticsearch template to prevent overflow. #140 +- Fix locking files for writing behaviour. #156 +- Introduce 'document_type' config option per prospector to define document type + for event stored in elasticsearch. #133 +- Add 'input_type' field to published events reporting the prospector type being used. #133 +- Fix high CPU usage when not connected to Elasticsearch or Logstash. #144 +- Fix issue that files were not crawled anymore when encoding was set to something other then plain. #182 + + +==== Added + +*Affecting all Beats* + +- Add Console output plugin. #218 +- Add timestamp to log messages #245 +- Send @metadata.beat to Logstash instead of @metadata.index to prevent + possible name clashes and give user full control over index name used for + Elasticsearch +- Add logging messages for bulk publishing in case of error #229 +- Add option to configure number of parallel workers publishing to Elasticsearch + or Logstash. +- Set default bulk size for Elasticsearch output to 50. +- Set default http timeout for Elasticsearch to 90s. +- Improve publish retry if sync flag is set by retrying only up to max bulk size + events instead of all events to be published. + +*Filebeat* + +- Introduction of backoff, backoff_factor, max_backoff, partial_line_waiting, force_close_windows_files + config variables to make crawling more configurable. +- All Godeps dependencies were updated to master on 2015-10-21 [#122] +- Set default value for ignore_older config to 10 minutes. #164 +- Added the fields_under_root setting to optionally store the custom fields top +level in the output dictionary. #188 +- Add more encodings by using x/text/encodings/htmlindex package to select + encoding by name. + + + + +[[release-notes-1.0.0-beta4]] +=== Beats version 1.0.0-beta4 +https://github.com/elastic/beats/compare/1.0.0-beta3...1.0.0-beta4[Check +1.0.0-beta4 diff] + + +==== Breaking changes + +*Affecting all Beats* + +- Update tls config options naming from dash to underline #162 +- Feature/output modes: Introduction of PublishEvent(s) to be used by beats #118 #115 + +*Packetbeat* + +- Renamed http module config file option 'strip_authorization' to 'redact_authorization' +- Save_topology is set to false by default +- Rename elasticsearch index to [packetbeat-]YYYY.MM.DD + +*Topbeat* + +- Percentage fields (e.g user_p) are exported as a float between 0 and 1 #34 + + +==== Bugfixes + +*Affecting all Beats* + +- Determine Elasticsearch index for an event based on UTC time #81 +- Fixing ES output's defaultDeadTimeout so that it is 60 seconds #103 +- ES outputer: fix timestamp conversion #91 +- Fix TLS insecure config option #239 +- ES outputer: check bulk API per item status code for retransmit on failure. + +*Packetbeat* + +- Support for lower-case header names when redacting http authorization headers +- Redact proxy-authorization if redact-authorization is set +- Fix some multithreading issues #203 +- Fix negative response time #216 +- Fix memcache TCP connection being nil after dropping stream data. #299 +- Add missing DNS protocol configuration to documentation #269 + +*Topbeat* + +- Don't divide the reported memory by an extra 1024 #60 + + +==== Added + +*Affecting all Beats* + +- Add logstash output plugin #151 +- Integration tests for Beat -> Logstash -> Elasticsearch added #195 #188 #168 #137 #128 #112 +- Large updates and improvements to the documentation +- Add direction field to publisher output to indicate inbound/outbound transactions #150 +- Add tls configuration support to elasticsearch and logstash outputers #139 +- All external dependencies were updated to the latest version. Update to Golang 1.5.1 #162 +- Guarantee ES index is based in UTC time zone #164 +- Cache: optional per element timeout #144 +- Make it possible to set hosts in different ways. #135 +- Expose more TLS config options #124 +- Use the Beat name in the default configuration file path #99 + +*Packetbeat* + +- add [.editorconfig file](http://editorconfig.org/) +- add (experimental/unsupported?) saltstack files +- Sample config file cleanup +- Moved common documentation to [libbeat repository](https://github.com/elastic/libbeat) +- Update build to go 1.5.1 +- Adding device descriptions to the -device output. +- Generate coverage for system tests +- Move go-daemon dependency to beats-packer +- Rename integration tests to system tests +- Made the `-devices` option more user friendly in case `sudo` is not used. + Issue #296. +- Publish expired DNS transactions #301 +- Update protocol guide to libbeat changes +- Add protocol registration to new protocol guide +- Make transaction timeouts configurable #300 +- Add direction field to the exported fields #317 + +*Topbeat* + +- Document fields in a standardized format (etc/fields.yml) #34 +- Updated to use new libbeat Publisher #37 #41 +- Update to go 1.5.1 #43 +- Updated configuration files with comments for all options #65 +- Documentation improvements + + +==== Deprecated + +*Affecting all Beats* + +- Redis output was deprecated #169 #145 +- Host and port configuration options are deprecated. They are replaced by the hosts + configuration option. #141 diff --git a/vendor/github.com/elastic/beats/CONTRIBUTING.md b/vendor/github.com/elastic/beats/CONTRIBUTING.md new file mode 100644 index 00000000..270b2448 --- /dev/null +++ b/vendor/github.com/elastic/beats/CONTRIBUTING.md @@ -0,0 +1,116 @@ +Please post all questions and issues first on +[https://discuss.elastic.co/c/beats](https://discuss.elastic.co/c/beats) +before opening a Github Issue. + +# Contributing to Beats + +The Beats are open source and we love to receive contributions from our +community — you! + +There are many ways to contribute, from writing tutorials or blog posts, +improving the documentation, submitting bug reports and feature requests or +writing code for implementing a whole new protocol. + +If you have a bugfix or new feature that you would like to contribute, please +start by opening a topic on the [forums](https://discuss.elastic.co/c/beats). +It may be that somebody is already working on it, or that there are particular +issues that you should know about before implementing the change. + +We enjoy working with contributors to get their code accepted. There are many +approaches to fixing a problem and it is important to find the best approach +before writing too much code. + +The process for contributing to any of the Elastic repositories is similar. + +## Contribution Steps + +1. Please make sure you have signed our [Contributor License + Agreement](https://www.elastic.co/contributor-agreement/). We are not + asking you to assign copyright to us, but to give us the right to distribute + your code without restriction. We ask this of all contributors in order to + assure our users of the origin and continuing existence of the code. You + only need to sign the CLA once. +2. Send a pull request! Push your changes to your fork of the repository and + [submit a pull + request](https://help.github.com/articles/using-pull-requests). In the pull + request, describe what your changes do and mention any bugs/issues related + to the pull request. + + +## Adding a new Beat + +If you want to create a new Beat, please read our [developer +guide](https://www.elastic.co/guide/en/beats/libbeat/current/new-beat.html). +You don't need to submit the code to this repository. Most new Beats start in +their own repository and just make use of the libbeat packages. After you have +a working Beat that you'd like to share with others, open a PR to add it to our +list of [community +Beats](https://github.com/elastic/beats/blob/master/libbeat/docs/communitybeats.asciidoc). + +## Setting up your dev environment + +The Beats are Go programs, so install the latest version of +[golang](http://golang.org/) if you don't have it already. The current Go version +used for development is Golang 1.7.4. + +The location where you clone is important. Please clone under the source +directory of your `GOPATH`. If you don't have `GOPATH` already set, you can +simply set it to your home directory (`export GOPATH=$HOME`). + + $ mkdir -p $GOPATH/src/github.com/elastic + $ cd $GOPATH/src/github.com/elastic + $ git clone https://github.com/elastic/beats.git + +Then you can compile a particular Beat by using the Makefile. For example, for +Packetbeat: + + $ cd beats/packetbeat + $ make + +Some of the Beats might have extra development requirements, in which case you'll find a +CONTRIBUTING.md file in the Beat directory. + +## Update scripts + +The Beats use a variety of scripts based on Python to generate configuration files +and documentation. The command used for this is: + + $ make update + +This command has the following dependencies: + +* Python >=2.7.9 +* [virtualenv](https://virtualenv.pypa.io/en/latest/) for Python + +Virtualenv can be installed with the command `easy_install virtualenv` or `pip install virtualenv`. +More details can be found [here](https://virtualenv.pypa.io/en/latest/installation.html). + + +## Testing + +You can run the whole testsuite with the following command: + + $ make testsuite + +Running the testsuite has the following requirements: + +* Python >=2.7.9 +* Docker >=1.10.0 +* Docker-compose >= 1.8.0 + + +## Documentation + +The documentation for each Beat is located under {beatname}/docs and is based on asciidoc. After changing the docs, +you should verify that the docs are still building to avoid breaking the automated docs build. To build the docs run +`make docs`. If you want to preview the docs for a specific Beat, run `make docs-preview` +inside the folder for the Beat. This will automatically open your browser with the docs for preview. + + +## Dependencies + +To manage the `vendor/` folder we use +[glide](https://github.com/Masterminds/glide), which uses +[glide.yaml](glide.yaml) as a manifest file for the dependencies. Please see +the glide documentation on how to add or update vendored dependencies. + diff --git a/vendor/github.com/elastic/beats/Dockerfile b/vendor/github.com/elastic/beats/Dockerfile new file mode 100644 index 00000000..22d24f42 --- /dev/null +++ b/vendor/github.com/elastic/beats/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:1.7.4 +MAINTAINER Nicolas Ruflin + +RUN set -x && \ + apt-get update && \ + apt-get install -y netcat && \ + apt-get clean + +COPY libbeat/scripts/docker-entrypoint.sh /entrypoint.sh + +RUN mkdir -p /etc/pki/tls/certs +COPY testing/environments/docker/logstash/pki/tls/certs/logstash.crt /etc/pki/tls/certs/logstash.crt + +# Create a copy of the repository inside the container. +COPY . /go/src/github.com/elastic/beats/ diff --git a/vendor/github.com/elastic/beats/LICENSE b/vendor/github.com/elastic/beats/LICENSE new file mode 100644 index 00000000..43976b73 --- /dev/null +++ b/vendor/github.com/elastic/beats/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2012–2016 Elasticsearch + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/vendor/github.com/elastic/beats/Makefile b/vendor/github.com/elastic/beats/Makefile new file mode 100644 index 00000000..e4194460 --- /dev/null +++ b/vendor/github.com/elastic/beats/Makefile @@ -0,0 +1,121 @@ + +BUILD_DIR=build +COVERAGE_DIR=${BUILD_DIR}/coverage +BEATS=packetbeat filebeat winlogbeat metricbeat heartbeat +PROJECTS=libbeat ${BEATS} +PROJECTS_ENV=libbeat filebeat metricbeat +SNAPSHOT?=yes + +# Runs complete testsuites (unit, system, integration) for all beats with coverage and race detection. +# Also it builds the docs and the generators +.PHONY: testsuite +testsuite: + $(foreach var,$(PROJECTS),$(MAKE) -C $(var) testsuite || exit 1;) + #$(MAKE) -C generate test + +stop-environments: + $(foreach var,$(PROJECTS_ENV),$(MAKE) -C $(var) stop-environment || exit 0;) + +# Runs unit and system tests without coverage and race detection. +.PHONY: test +test: + $(foreach var,$(PROJECTS),$(MAKE) -C $(var) test || exit 1;) + +# Runs unit tests without coverage and race detection. +.PHONY: unit +unit: + $(foreach var,$(PROJECTS),$(MAKE) -C $(var) unit || exit 1;) + +.PHONY: coverage-report +coverage-report: + mkdir -p ${COVERAGE_DIR} + # Writes atomic mode on top of file + echo 'mode: atomic' > ./${COVERAGE_DIR}/full.cov + # Collects all coverage files and skips top line with mode + -tail -q -n +2 ./filebeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov + -tail -q -n +2 ./packetbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov + -tail -q -n +2 ./winlogbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov + -tail -q -n +2 ./libbeat/${COVERAGE_DIR}/*.cov >> ./${COVERAGE_DIR}/full.cov + go tool cover -html=./${COVERAGE_DIR}/full.cov -o ${COVERAGE_DIR}/full.html + +.PHONY: update +update: + $(MAKE) -C libbeat collect + $(foreach var,$(BEATS),$(MAKE) -C $(var) update || exit 1;) + +.PHONY: clean +clean: + rm -rf build + $(foreach var,$(PROJECTS),$(MAKE) -C $(var) clean || exit 1;) + $(MAKE) -C generate clean + +# Cleans up the vendor directory from unnecessary files +# This should always be run after updating the dependencies +.PHONY: clean-vendor +clean-vendor: + sh scripts/clean_vendor.sh + +.PHONY: check +check: + $(foreach var,$(PROJECTS),$(MAKE) -C $(var) check || exit 1;) + # Validate that all updates were commited + $(MAKE) update + git update-index --refresh + git diff-index --exit-code HEAD -- + +.PHONY: fmt +fmt: + $(foreach var,$(PROJECTS),$(MAKE) -C $(var) fmt || exit 1;) + +.PHONY: simplify +simplify: + $(foreach var,$(PROJECTS),$(MAKE) -C $(var) simplify || exit 1;) + +# Collects all dashboards and generates dashboard folder for https://github.com/elastic/beats-dashboards/tree/master/dashboards +.PHONY: beats-dashboards +beats-dashboards: + mkdir -p build/dashboards + $(foreach var,$(BEATS),cp -r $(var)/_meta/kibana/ build/dashboards/$(var) || exit 1;) + +# Builds the documents for each beat +.PHONY: docs +docs: + sh libbeat/scripts/build_docs.sh ${PROJECTS} + +.PHONY: package +package: update beats-dashboards + $(foreach var,$(BEATS),SNAPSHOT=$(SNAPSHOT) $(MAKE) -C $(var) package || exit 1;) + + # build the dashboards package + echo "Start building the dashboards package" + mkdir -p build/upload/ + BUILD_DIR=${shell pwd}/build SNAPSHOT=$(SNAPSHOT) $(MAKE) -C dev-tools/packer package-dashboards ${shell pwd}/build/upload/build_id.txt + mv build/upload build/dashboards-upload + + # Copy build files over to top build directory + mkdir -p build/upload/ + $(foreach var,$(BEATS),cp -r $(var)/build/upload/ build/upload/$(var) || exit 1;) + cp -r build/dashboards-upload build/upload/dashboards + +# Upload nightly builds to S3 +.PHONY: upload-nightlies-s3 +upload-nightlies-s3: all + aws s3 cp --recursive --acl public-read build/upload s3://beats-nightlies + +# Run after building to sign packages and publish to APT and YUM repos. +.PHONY: package-upload +upload-package: + $(MAKE) -C dev-tools/packer deb-rpm-s3 + # You must export AWS_ACCESS_KEY= and export AWS_SECRET_KEY= + # before running this make target. + dev-tools/packer/docker/deb-rpm-s3/deb-rpm-s3.sh + +.PHONY: release-upload +upload-release: + aws s3 cp --recursive --acl public-read build/upload s3://download.elasticsearch.org/beats/ + +.PHONY: notice +notice: + python dev-tools/generate_notice.py . + + diff --git a/vendor/github.com/elastic/beats/NOTICE b/vendor/github.com/elastic/beats/NOTICE new file mode 100644 index 00000000..6f7de24c --- /dev/null +++ b/vendor/github.com/elastic/beats/NOTICE @@ -0,0 +1,1483 @@ +Elastic Beats +Copyright 2014-2017 Elasticsearch BV + +This product includes software developed by The Apache Software +Foundation (http://www.apache.org/). + +========================================================================== +Third party libraries used by the Beats project: +========================================================================== + + +-------------------------------------------------------------------- +github.com/andrewkroh/sys +-------------------------------------------------------------------- +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/armon/go-socks5 +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2014 Armon Dadgar + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------- +github.com/davecgh/go-spew +-------------------------------------------------------------------- +Copyright (c) 2012-2013 Dave Collins + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +-------------------------------------------------------------------- +github.com/dustin/go-humanize +-------------------------------------------------------------------- +Copyright (c) 2005-2008 Dustin Sallings + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + +-------------------------------------------------------------------- +github.com/eapache/go-resiliency +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2014 Evan Huus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +-------------------------------------------------------------------- +github.com/eapache/go-xerial-snappy +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2016 Evan Huus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +-------------------------------------------------------------------- +github.com/eapache/queue +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2014 Evan Huus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------- +github.com/elastic/go-lumber +-------------------------------------------------------------------- +Apache License + + +-------------------------------------------------------------------- +github.com/elastic/go-ucfg +-------------------------------------------------------------------- +Apache License + + +-------------------------------------------------------------------- +github.com/elastic/gosigar +-------------------------------------------------------------------- +Apache License + +-------NOTICE----- +Copyright (c) [2009-2011] VMware, Inc. All Rights Reserved. + +This product is licensed to you under the Apache License, Version 2.0 (the "License"). +You may not use this product except in compliance with the License. + +This product includes a number of subcomponents with +separate copyright notices and license terms. Your use of these +subcomponents is subject to the terms and conditions of the +subcomponent's license, as noted in the LICENSE file. +-------------------------------------------------------------------- +github.com/elastic/procfs +-------------------------------------------------------------------- +Apache License + +-------NOTICE----- +procfs provides functions to retrieve system, kernel and process +metrics from the pseudo-filesystem proc. + +Copyright 2014-2015 The Prometheus Authors + +This product includes software developed at +SoundCloud Ltd. (http://soundcloud.com/). + +-------------------------------------------------------------------- +github.com/garyburd/redigo +-------------------------------------------------------------------- +Apache License + + +-------------------------------------------------------------------- +github.com/gocarina/gocsv +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Picques + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------- +github.com/golang/snappy +-------------------------------------------------------------------- +Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/joeshaw/multierror +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2014 Joe Shaw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------------------------------------------------------- +github.com/klauspost/compress +-------------------------------------------------------------------- +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/klauspost/cpuid +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2015 Klaus Post + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +-------------------------------------------------------------------- +github.com/klauspost/crc32 +-------------------------------------------------------------------- +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2015 Klaus Post + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/miekg/dns +-------------------------------------------------------------------- +Extensions of the original work are copyright (c) 2011 Miek Gieben + +As this is fork of the official Go code the same license applies: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------- +github.com/mitchellh/mapstructure +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2013 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------------------------------------------------------- +github.com/nranchev/go-libGeoIP +-------------------------------------------------------------------- +Copyright (c) 2010, Nikola Ranchev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/pierrec/lz4 +-------------------------------------------------------------------- +Copyright (c) 2015, Pierre Curto +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of xxHash nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------- +github.com/pierrec/xxHash +-------------------------------------------------------------------- +Copyright (c) 2014, Pierre Curto +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of xxHash nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------- +github.com/pierrre/gotestcover +-------------------------------------------------------------------- +Copyright (C) 2015 Pierre Durand + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------- +github.com/pkg/errors +-------------------------------------------------------------------- +Copyright (c) 2015, Dave Cheney +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------- +github.com/pmezard/go-difflib +-------------------------------------------------------------------- +Copyright (c) 2013, Patrick Mezard +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + The names of its contributors may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/rcrowley/go-metrics +-------------------------------------------------------------------- +Copyright 2012 Richard Crowley. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +THIS SOFTWARE IS PROVIDED BY RICHARD CROWLEY ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL RICHARD CROWLEY OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation +are those of the authors and should not be interpreted as representing +official policies, either expressed or implied, of Richard Crowley. + +-------------------------------------------------------------------- +github.com/samuel/go-thrift +-------------------------------------------------------------------- +Copyright (c) 2012, Samuel Stauffer +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of the author nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/satori/go.uuid +-------------------------------------------------------------------- +Copyright (C) 2013-2016 by Maxim Bublis + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------- +github.com/shirou/gopsutil +-------------------------------------------------------------------- +gopsutil is distributed under BSD license reproduced below. + +Copyright (c) 2014, WAKAYAMA Shirou +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the gopsutil authors nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/StackExchange/wmi +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2013 Stack Exchange + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------- +github.com/stretchr/objx +-------------------------------------------------------------------- +objx - by Mat Ryer and Tyler Bunnell + +The MIT License (MIT) + +Copyright (c) 2014 Stretchr, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +-------------------------------------------------------------------- +github.com/stretchr/testify +-------------------------------------------------------------------- +Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell + +Please consider promoting this project if you find it useful. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------- +github.com/tsg/gopacket +-------------------------------------------------------------------- +Copyright (c) 2012 Google, Inc. All rights reserved. +Copyright (c) 2009-2011 Andreas Krennmair. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Andreas Krennmair, Google, nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +golang.org/x/net +-------------------------------------------------------------------- +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +golang.org/x/sys +-------------------------------------------------------------------- +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +golang.org/x/text +-------------------------------------------------------------------- +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +gopkg.in/mgo.v2/bson +-------------------------------------------------------------------- +BSON library for Go + +Copyright (c) 2010-2012 - Gustavo Niemeyer + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/mitchellh/hashstructure +-------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) 2016 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------------------------------------------------------- +github.com/fsouza/go-dockerclient +-------------------------------------------------------------------- +Copyright (c) 2016, go-dockerclient authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/go-sql-driver/mysql +-------------------------------------------------------------------- +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + +-------------------------------------------------------------------- +github.com/lib/pq +-------------------------------------------------------------------- +Copyright (c) 2011-2013, 'pq' Contributors +Portions Copyright (C) 2011 Blake Mizerany + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------- +github.com/davecgh/go-spew +-------------------------------------------------------------------- +Copyright (c) 2012-2013 Dave Collins + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +-------------------------------------------------------------------- +github.com/pmezard/go-difflib +-------------------------------------------------------------------- +Copyright (c) 2013, Patrick Mezard +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + The names of its contributors may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +github.com/stretchr/objx +-------------------------------------------------------------------- +objx - by Mat Ryer and Tyler Bunnell + +The MIT License (MIT) + +Copyright (c) 2014 Stretchr, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/elastic/beats/README.md b/vendor/github.com/elastic/beats/README.md new file mode 100644 index 00000000..a5a8f909 --- /dev/null +++ b/vendor/github.com/elastic/beats/README.md @@ -0,0 +1,76 @@ +[![Travis](https://travis-ci.org/elastic/beats.svg?branch=master)](https://travis-ci.org/elastic/beats) +[![AppVeyor](https://ci.appveyor.com/api/projects/status/p7y92i6pp2v7vnrd/branch/master?svg=true)](https://ci.appveyor.com/project/elastic-beats/beats/branch/master) +[![GoReportCard](http://goreportcard.com/badge/elastic/beats)](http://goreportcard.com/report/elastic/beats) +[![codecov.io](https://codecov.io/github/elastic/beats/coverage.svg?branch=master)](https://codecov.io/github/elastic/beats?branch=master) + +# Beats - The Lightweight Shippers of the Elastic Stack + +The [Beats](https://www.elastic.co/products/beats) are lightweight data +shippers, written in Go, that you install on your servers to capture all sorts +of operational data (think of logs, metrics, or network packet data). The Beats +send the operational data to Elasticsearch, either directly or via Logstash, so +it can be visualized with Kibana. + +By "lightweight", we mean that Beats have a small installation footprint, use +limited system resources, and have no runtime dependencies. + +This repository contains +[libbeat](https://github.com/elastic/beats/tree/master/libbeat), our Go +framework for creating Beats, and all the officially supported Beats: + +Beat | Description +--- | --- +[Filebeat](https://github.com/elastic/beats/tree/master/filebeat) | Tails and ships log files +[Metricbeat](https://github.com/elastic/beats/tree/master/metricbeat) | Fetches sets of metrics from the operating system and services +[Packetbeat](https://github.com/elastic/beats/tree/master/packetbeat) | Monitors the network and applications by sniffing packets +[Winlogbeat](https://github.com/elastic/beats/tree/master/winlogbeat) | Fetches and ships Windows Event logs + +In addition to the above Beats, which are officially supported by +[Elastic](elastic.co), the +community has created a set of other Beats that make use of libbeat but live +outside of this Github repository. We maintain a list of community Beats +[here](https://www.elastic.co/guide/en/beats/libbeat/master/community-beats.html). + +## Documentation and Getting Started + +You can find the documentation and getting started guides for each of the Beats +on the [elastic.co site](https://www.elastic.co/guide/): + +* [Beats platform](https://www.elastic.co/guide/en/beats/libbeat/current/index.html) +* [Filebeat](https://www.elastic.co/guide/en/beats/filebeat/current/index.html) +* [Metricbeat](https://www.elastic.co/guide/en/beats/metricbeat/current/index.html) +* [Packetbeat](https://www.elastic.co/guide/en/beats/packetbeat/current/index.html) +* [Winlogbeat](https://www.elastic.co/guide/en/beats/winlogbeat/current/index.html) + + +## Getting Help + +If you need help or hit an issue, please start by opening a topic on our +[discuss forums](https://discuss.elastic.co/c/beats). Please note that we +reserve GitHub tickets for confirmed bugs and enhancement requests. + +## Downloads + +You can download pre-compiled Beats binaries, as well as packages for the +supported platforms, from [this page](https://www.elastic.co/downloads/beats). + +## Contributing + +We'd love working with you! You can help make the Beats better in many ways: +report issues, help us reproduce issues, fix bugs, add functionality, or even +create your own Beat. + +Please start by reading our [CONTRIBUTING](CONTRIBUTING.md) file. + +If you are creating a new Beat, you don't need to submit the code to this +repository. You can simply start working in a new repository and make use of +the libbeat packages, by following our [developer +guide](https://www.elastic.co/guide/en/beats/libbeat/master/new-beat.html). +After you have a working prototype, open a pull request to add your Beat to the +list of [community +Beats](https://github.com/elastic/beats/blob/master/libbeat/docs/communitybeats.asciidoc). + +## Building Beats from the Source + +See our [CONTRIBUTING](CONTRIBUTING.md) file for information about setting up your dev +environment to build Beats from the source. diff --git a/vendor/github.com/elastic/beats/Vagrantfile b/vendor/github.com/elastic/beats/Vagrantfile new file mode 100644 index 00000000..d13d52a0 --- /dev/null +++ b/vendor/github.com/elastic/beats/Vagrantfile @@ -0,0 +1,115 @@ +### Documentation +# This is a Vagrantfile for Beats development. +# +# Boxes +# ===== +# +# win2012 +# ------- +# This box is used as a Windows development and testing environment for Beats. +# +# Usage and Features: +# - Two users exist: Administartor and Vagrant. Both have the password: vagrant +# - Use 'vagrant ssh' to open a Windows command prompt. +# - Use 'vagrant rdp' to open a Windows Remote Deskop session. Mac users must +# install the Microsoft Remote Desktop Client from the App Store. +# - There is a desktop shortcut labeled "Beats Shell" that opens a command prompt +# to C:\Gopath\src\github.com\elastic\beats where the code is mounted. +# +# solaris +# ------------------- +# - Use gmake instead of make. +# +# freebsd and openbsd +# ------------------- +# - Use gmake instead of make. +# - Folder syncing doesn't work well. Consider copying the files into the box or +# cloning the project inside the box. + +# Provisioning for Windows PowerShell +$winPsProvision = <\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n

+#errors +Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. +Line: 1 Col: 20 Unexpected end tag (strong) in table context caused voodoo mode. +Line: 1 Col: 20 End tag (strong) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 24 Unexpected end tag (b) in table context caused voodoo mode. +Line: 1 Col: 24 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 29 Unexpected end tag (em) in table context caused voodoo mode. +Line: 1 Col: 29 End tag (em) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 33 Unexpected end tag (i) in table context caused voodoo mode. +Line: 1 Col: 33 End tag (i) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 37 Unexpected end tag (u) in table context caused voodoo mode. +Line: 1 Col: 37 End tag (u) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 46 Unexpected end tag (strike) in table context caused voodoo mode. +Line: 1 Col: 46 End tag (strike) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 50 Unexpected end tag (s) in table context caused voodoo mode. +Line: 1 Col: 50 End tag (s) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 58 Unexpected end tag (blink) in table context caused voodoo mode. +Line: 1 Col: 58 Unexpected end tag (blink). Ignored. +Line: 1 Col: 63 Unexpected end tag (tt) in table context caused voodoo mode. +Line: 1 Col: 63 End tag (tt) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 69 Unexpected end tag (pre) in table context caused voodoo mode. +Line: 1 Col: 69 End tag (pre) seen too early. Expected other end tag. +Line: 1 Col: 75 Unexpected end tag (big) in table context caused voodoo mode. +Line: 1 Col: 75 End tag (big) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 83 Unexpected end tag (small) in table context caused voodoo mode. +Line: 1 Col: 83 End tag (small) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 90 Unexpected end tag (font) in table context caused voodoo mode. +Line: 1 Col: 90 End tag (font) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 99 Unexpected end tag (select) in table context caused voodoo mode. +Line: 1 Col: 99 Unexpected end tag (select). Ignored. +Line: 1 Col: 104 Unexpected end tag (h1) in table context caused voodoo mode. +Line: 1 Col: 104 End tag (h1) seen too early. Expected other end tag. +Line: 1 Col: 109 Unexpected end tag (h2) in table context caused voodoo mode. +Line: 1 Col: 109 End tag (h2) seen too early. Expected other end tag. +Line: 1 Col: 114 Unexpected end tag (h3) in table context caused voodoo mode. +Line: 1 Col: 114 End tag (h3) seen too early. Expected other end tag. +Line: 1 Col: 119 Unexpected end tag (h4) in table context caused voodoo mode. +Line: 1 Col: 119 End tag (h4) seen too early. Expected other end tag. +Line: 1 Col: 124 Unexpected end tag (h5) in table context caused voodoo mode. +Line: 1 Col: 124 End tag (h5) seen too early. Expected other end tag. +Line: 1 Col: 129 Unexpected end tag (h6) in table context caused voodoo mode. +Line: 1 Col: 129 End tag (h6) seen too early. Expected other end tag. +Line: 1 Col: 136 Unexpected end tag (body) in the table row phase. Ignored. +Line: 1 Col: 141 Unexpected end tag (br) in table context caused voodoo mode. +Line: 1 Col: 141 Unexpected end tag (br). Treated as br element. +Line: 1 Col: 145 Unexpected end tag (a) in table context caused voodoo mode. +Line: 1 Col: 145 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 151 Unexpected end tag (img) in table context caused voodoo mode. +Line: 1 Col: 151 This element (img) has no end tag. +Line: 1 Col: 159 Unexpected end tag (title) in table context caused voodoo mode. +Line: 1 Col: 159 Unexpected end tag (title). Ignored. +Line: 1 Col: 166 Unexpected end tag (span) in table context caused voodoo mode. +Line: 1 Col: 166 Unexpected end tag (span). Ignored. +Line: 1 Col: 174 Unexpected end tag (style) in table context caused voodoo mode. +Line: 1 Col: 174 Unexpected end tag (style). Ignored. +Line: 1 Col: 183 Unexpected end tag (script) in table context caused voodoo mode. +Line: 1 Col: 183 Unexpected end tag (script). Ignored. +Line: 1 Col: 196 Unexpected end tag (th). Ignored. +Line: 1 Col: 201 Unexpected end tag (td). Ignored. +Line: 1 Col: 206 Unexpected end tag (tr). Ignored. +Line: 1 Col: 214 This element (frame) has no end tag. +Line: 1 Col: 221 This element (area) has no end tag. +Line: 1 Col: 228 Unexpected end tag (link). Ignored. +Line: 1 Col: 236 This element (param) has no end tag. +Line: 1 Col: 241 This element (hr) has no end tag. +Line: 1 Col: 249 This element (input) has no end tag. +Line: 1 Col: 255 Unexpected end tag (col). Ignored. +Line: 1 Col: 262 Unexpected end tag (base). Ignored. +Line: 1 Col: 269 Unexpected end tag (meta). Ignored. +Line: 1 Col: 280 This element (basefont) has no end tag. +Line: 1 Col: 290 This element (bgsound) has no end tag. +Line: 1 Col: 298 This element (embed) has no end tag. +Line: 1 Col: 307 This element (spacer) has no end tag. +Line: 1 Col: 311 Unexpected end tag (p). Ignored. +Line: 1 Col: 316 End tag (dd) seen too early. Expected other end tag. +Line: 1 Col: 321 End tag (dt) seen too early. Expected other end tag. +Line: 1 Col: 331 Unexpected end tag (caption). Ignored. +Line: 1 Col: 342 Unexpected end tag (colgroup). Ignored. +Line: 1 Col: 350 Unexpected end tag (tbody). Ignored. +Line: 1 Col: 358 Unexpected end tag (tfoot). Ignored. +Line: 1 Col: 366 Unexpected end tag (thead). Ignored. +Line: 1 Col: 376 End tag (address) seen too early. Expected other end tag. +Line: 1 Col: 389 End tag (blockquote) seen too early. Expected other end tag. +Line: 1 Col: 398 End tag (center) seen too early. Expected other end tag. +Line: 1 Col: 404 Unexpected end tag (dir). Ignored. +Line: 1 Col: 410 End tag (div) seen too early. Expected other end tag. +Line: 1 Col: 415 End tag (dl) seen too early. Expected other end tag. +Line: 1 Col: 426 End tag (fieldset) seen too early. Expected other end tag. +Line: 1 Col: 436 End tag (listing) seen too early. Expected other end tag. +Line: 1 Col: 443 End tag (menu) seen too early. Expected other end tag. +Line: 1 Col: 448 End tag (ol) seen too early. Expected other end tag. +Line: 1 Col: 453 End tag (ul) seen too early. Expected other end tag. +Line: 1 Col: 458 End tag (li) seen too early. Expected other end tag. +Line: 1 Col: 465 End tag (nobr) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 471 This element (wbr) has no end tag. +Line: 1 Col: 487 End tag (button) seen too early. Expected other end tag. +Line: 1 Col: 497 End tag (marquee) seen too early. Expected other end tag. +Line: 1 Col: 506 End tag (object) seen too early. Expected other end tag. +Line: 1 Col: 524 Unexpected end tag (html). Ignored. +Line: 1 Col: 524 Unexpected end tag (frameset). Ignored. +Line: 1 Col: 531 Unexpected end tag (head). Ignored. +Line: 1 Col: 540 Unexpected end tag (iframe). Ignored. +Line: 1 Col: 548 This element (image) has no end tag. +Line: 1 Col: 558 This element (isindex) has no end tag. +Line: 1 Col: 568 Unexpected end tag (noembed). Ignored. +Line: 1 Col: 579 Unexpected end tag (noframes). Ignored. +Line: 1 Col: 590 Unexpected end tag (noscript). Ignored. +Line: 1 Col: 601 Unexpected end tag (optgroup). Ignored. +Line: 1 Col: 610 Unexpected end tag (option). Ignored. +Line: 1 Col: 622 Unexpected end tag (plaintext). Ignored. +Line: 1 Col: 633 Unexpected end tag (textarea). Ignored. +#document +| +| +| +|
+|
\r\n
\r\n
\r\n\r\n\r\n\r\n uint64(size)/fileHeaderLen { + return fmt.Errorf("archive/zip: TOC declares impossible %d files in %d byte zip", end.directoryRecords, size) + } + z.r = r + z.File = make([]*File, 0, end.directoryRecords) + z.Comment = end.comment + rs := io.NewSectionReader(r, 0, size) + if _, err = rs.Seek(int64(end.directoryOffset), os.SEEK_SET); err != nil { + return err + } + buf := bufio.NewReader(rs) + + // The count of files inside a zip is truncated to fit in a uint16. + // Gloss over this by reading headers until we encounter + // a bad one, and then only report a ErrFormat or UnexpectedEOF if + // the file count modulo 65536 is incorrect. + for { + f := &File{zip: z, zipr: r, zipsize: size} + err = readDirectoryHeader(f, buf) + if err == ErrFormat || err == io.ErrUnexpectedEOF { + break + } + if err != nil { + return err + } + z.File = append(z.File, f) + } + if uint16(len(z.File)) != uint16(end.directoryRecords) { // only compare 16 bits here + // Return the readDirectoryHeader error if we read + // the wrong number of directory entries. + return err + } + return nil +} + +// RegisterDecompressor registers or overrides a custom decompressor for a +// specific method ID. If a decompressor for a given method is not found, +// Reader will default to looking up the decompressor at the package level. +// +// Must not be called concurrently with Open on any Files in the Reader. +func (z *Reader) RegisterDecompressor(method uint16, dcomp Decompressor) { + if z.decompressors == nil { + z.decompressors = make(map[uint16]Decompressor) + } + z.decompressors[method] = dcomp +} + +func (z *Reader) decompressor(method uint16) Decompressor { + dcomp := z.decompressors[method] + if dcomp == nil { + dcomp = decompressor(method) + } + return dcomp +} + +// Close closes the Zip file, rendering it unusable for I/O. +func (rc *ReadCloser) Close() error { + return rc.f.Close() +} + +// DataOffset returns the offset of the file's possibly-compressed +// data, relative to the beginning of the zip file. +// +// Most callers should instead use Open, which transparently +// decompresses data and verifies checksums. +func (f *File) DataOffset() (offset int64, err error) { + bodyOffset, err := f.findBodyOffset() + if err != nil { + return + } + return f.headerOffset + bodyOffset, nil +} + +// Open returns a ReadCloser that provides access to the File's contents. +// Multiple files may be read concurrently. +func (f *File) Open() (rc io.ReadCloser, err error) { + bodyOffset, err := f.findBodyOffset() + if err != nil { + return + } + size := int64(f.CompressedSize64) + r := io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset, size) + dcomp := f.zip.decompressor(f.Method) + if dcomp == nil { + err = ErrAlgorithm + return + } + rc = dcomp(r) + var desr io.Reader + if f.hasDataDescriptor() { + desr = io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset+size, dataDescriptorLen) + } + rc = &checksumReader{ + rc: rc, + hash: crc32.NewIEEE(), + f: f, + desr: desr, + } + return +} + +type checksumReader struct { + rc io.ReadCloser + hash hash.Hash32 + nread uint64 // number of bytes read so far + f *File + desr io.Reader // if non-nil, where to read the data descriptor + err error // sticky error +} + +func (r *checksumReader) Read(b []byte) (n int, err error) { + if r.err != nil { + return 0, r.err + } + n, err = r.rc.Read(b) + r.hash.Write(b[:n]) + r.nread += uint64(n) + if err == nil { + return + } + if err == io.EOF { + if r.nread != r.f.UncompressedSize64 { + return 0, io.ErrUnexpectedEOF + } + if r.desr != nil { + if err1 := readDataDescriptor(r.desr, r.f); err1 != nil { + if err1 == io.EOF { + err = io.ErrUnexpectedEOF + } else { + err = err1 + } + } else if r.hash.Sum32() != r.f.CRC32 { + err = ErrChecksum + } + } else { + // If there's not a data descriptor, we still compare + // the CRC32 of what we've read against the file header + // or TOC's CRC32, if it seems like it was set. + if r.f.CRC32 != 0 && r.hash.Sum32() != r.f.CRC32 { + err = ErrChecksum + } + } + } + r.err = err + return +} + +func (r *checksumReader) Close() error { return r.rc.Close() } + +// findBodyOffset does the minimum work to verify the file has a header +// and returns the file body offset. +func (f *File) findBodyOffset() (int64, error) { + var buf [fileHeaderLen]byte + if _, err := f.zipr.ReadAt(buf[:], f.headerOffset); err != nil { + return 0, err + } + b := readBuf(buf[:]) + if sig := b.uint32(); sig != fileHeaderSignature { + return 0, ErrFormat + } + b = b[22:] // skip over most of the header + filenameLen := int(b.uint16()) + extraLen := int(b.uint16()) + return int64(fileHeaderLen + filenameLen + extraLen), nil +} + +// readDirectoryHeader attempts to read a directory header from r. +// It returns io.ErrUnexpectedEOF if it cannot read a complete header, +// and ErrFormat if it doesn't find a valid header signature. +func readDirectoryHeader(f *File, r io.Reader) error { + var buf [directoryHeaderLen]byte + if _, err := io.ReadFull(r, buf[:]); err != nil { + return err + } + b := readBuf(buf[:]) + if sig := b.uint32(); sig != directoryHeaderSignature { + return ErrFormat + } + f.CreatorVersion = b.uint16() + f.ReaderVersion = b.uint16() + f.Flags = b.uint16() + f.Method = b.uint16() + f.ModifiedTime = b.uint16() + f.ModifiedDate = b.uint16() + f.CRC32 = b.uint32() + f.CompressedSize = b.uint32() + f.UncompressedSize = b.uint32() + f.CompressedSize64 = uint64(f.CompressedSize) + f.UncompressedSize64 = uint64(f.UncompressedSize) + filenameLen := int(b.uint16()) + extraLen := int(b.uint16()) + commentLen := int(b.uint16()) + b = b[4:] // skipped start disk number and internal attributes (2x uint16) + f.ExternalAttrs = b.uint32() + f.headerOffset = int64(b.uint32()) + d := make([]byte, filenameLen+extraLen+commentLen) + if _, err := io.ReadFull(r, d); err != nil { + return err + } + f.Name = string(d[:filenameLen]) + f.Extra = d[filenameLen : filenameLen+extraLen] + f.Comment = string(d[filenameLen+extraLen:]) + + needUSize := f.UncompressedSize == ^uint32(0) + needCSize := f.CompressedSize == ^uint32(0) + needHeaderOffset := f.headerOffset == int64(^uint32(0)) + + if len(f.Extra) > 0 { + // Best effort to find what we need. + // Other zip authors might not even follow the basic format, + // and we'll just ignore the Extra content in that case. + b := readBuf(f.Extra) + for len(b) >= 4 { // need at least tag and size + tag := b.uint16() + size := b.uint16() + if int(size) > len(b) { + break + } + if tag == zip64ExtraId { + // update directory values from the zip64 extra block. + // They should only be consulted if the sizes read earlier + // are maxed out. + // See golang.org/issue/13367. + eb := readBuf(b[:size]) + + if needUSize { + needUSize = false + if len(eb) < 8 { + return ErrFormat + } + f.UncompressedSize64 = eb.uint64() + } + if needCSize { + needCSize = false + if len(eb) < 8 { + return ErrFormat + } + f.CompressedSize64 = eb.uint64() + } + if needHeaderOffset { + needHeaderOffset = false + if len(eb) < 8 { + return ErrFormat + } + f.headerOffset = int64(eb.uint64()) + } + break + } + b = b[size:] + } + } + + if needUSize || needCSize || needHeaderOffset { + return ErrFormat + } + + return nil +} + +func readDataDescriptor(r io.Reader, f *File) error { + var buf [dataDescriptorLen]byte + + // The spec says: "Although not originally assigned a + // signature, the value 0x08074b50 has commonly been adopted + // as a signature value for the data descriptor record. + // Implementers should be aware that ZIP files may be + // encountered with or without this signature marking data + // descriptors and should account for either case when reading + // ZIP files to ensure compatibility." + // + // dataDescriptorLen includes the size of the signature but + // first read just those 4 bytes to see if it exists. + if _, err := io.ReadFull(r, buf[:4]); err != nil { + return err + } + off := 0 + maybeSig := readBuf(buf[:4]) + if maybeSig.uint32() != dataDescriptorSignature { + // No data descriptor signature. Keep these four + // bytes. + off += 4 + } + if _, err := io.ReadFull(r, buf[off:12]); err != nil { + return err + } + b := readBuf(buf[:12]) + if b.uint32() != f.CRC32 { + return ErrChecksum + } + + // The two sizes that follow here can be either 32 bits or 64 bits + // but the spec is not very clear on this and different + // interpretations has been made causing incompatibilities. We + // already have the sizes from the central directory so we can + // just ignore these. + + return nil +} + +func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, err error) { + // look for directoryEndSignature in the last 1k, then in the last 65k + var buf []byte + var directoryEndOffset int64 + for i, bLen := range []int64{1024, 65 * 1024} { + if bLen > size { + bLen = size + } + buf = make([]byte, int(bLen)) + if _, err := r.ReadAt(buf, size-bLen); err != nil && err != io.EOF { + return nil, err + } + if p := findSignatureInBlock(buf); p >= 0 { + buf = buf[p:] + directoryEndOffset = size - bLen + int64(p) + break + } + if i == 1 || bLen == size { + return nil, ErrFormat + } + } + + // read header into struct + b := readBuf(buf[4:]) // skip signature + d := &directoryEnd{ + diskNbr: uint32(b.uint16()), + dirDiskNbr: uint32(b.uint16()), + dirRecordsThisDisk: uint64(b.uint16()), + directoryRecords: uint64(b.uint16()), + directorySize: uint64(b.uint32()), + directoryOffset: uint64(b.uint32()), + commentLen: b.uint16(), + } + l := int(d.commentLen) + if l > len(b) { + return nil, errors.New("zip: invalid comment length") + } + d.comment = string(b[:l]) + + // These values mean that the file can be a zip64 file + if d.directoryRecords == 0xffff || d.directorySize == 0xffff || d.directoryOffset == 0xffffffff { + p, err := findDirectory64End(r, directoryEndOffset) + if err == nil && p >= 0 { + err = readDirectory64End(r, p, d) + } + if err != nil { + return nil, err + } + } + // Make sure directoryOffset points to somewhere in our file. + if o := int64(d.directoryOffset); o < 0 || o >= size { + return nil, ErrFormat + } + return d, nil +} + +// findDirectory64End tries to read the zip64 locator just before the +// directory end and returns the offset of the zip64 directory end if +// found. +func findDirectory64End(r io.ReaderAt, directoryEndOffset int64) (int64, error) { + locOffset := directoryEndOffset - directory64LocLen + if locOffset < 0 { + return -1, nil // no need to look for a header outside the file + } + buf := make([]byte, directory64LocLen) + if _, err := r.ReadAt(buf, locOffset); err != nil { + return -1, err + } + b := readBuf(buf) + if sig := b.uint32(); sig != directory64LocSignature { + return -1, nil + } + if b.uint32() != 0 { // number of the disk with the start of the zip64 end of central directory + return -1, nil // the file is not a valid zip64-file + } + p := b.uint64() // relative offset of the zip64 end of central directory record + if b.uint32() != 1 { // total number of disks + return -1, nil // the file is not a valid zip64-file + } + return int64(p), nil +} + +// readDirectory64End reads the zip64 directory end and updates the +// directory end with the zip64 directory end values. +func readDirectory64End(r io.ReaderAt, offset int64, d *directoryEnd) (err error) { + buf := make([]byte, directory64EndLen) + if _, err := r.ReadAt(buf, offset); err != nil { + return err + } + + b := readBuf(buf) + if sig := b.uint32(); sig != directory64EndSignature { + return ErrFormat + } + + b = b[12:] // skip dir size, version and version needed (uint64 + 2x uint16) + d.diskNbr = b.uint32() // number of this disk + d.dirDiskNbr = b.uint32() // number of the disk with the start of the central directory + d.dirRecordsThisDisk = b.uint64() // total number of entries in the central directory on this disk + d.directoryRecords = b.uint64() // total number of entries in the central directory + d.directorySize = b.uint64() // size of the central directory + d.directoryOffset = b.uint64() // offset of start of central directory with respect to the starting disk number + + return nil +} + +func findSignatureInBlock(b []byte) int { + for i := len(b) - directoryEndLen; i >= 0; i-- { + // defined from directoryEndSignature in struct.go + if b[i] == 'P' && b[i+1] == 'K' && b[i+2] == 0x05 && b[i+3] == 0x06 { + // n is length of comment + n := int(b[i+directoryEndLen-2]) | int(b[i+directoryEndLen-1])<<8 + if n+directoryEndLen+i <= len(b) { + return i + } + } + } + return -1 +} + +type readBuf []byte + +func (b *readBuf) uint16() uint16 { + v := binary.LittleEndian.Uint16(*b) + *b = (*b)[2:] + return v +} + +func (b *readBuf) uint32() uint32 { + v := binary.LittleEndian.Uint32(*b) + *b = (*b)[4:] + return v +} + +func (b *readBuf) uint64() uint64 { + v := binary.LittleEndian.Uint64(*b) + *b = (*b)[8:] + return v +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/register.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/register.go new file mode 100644 index 00000000..90b582d0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/register.go @@ -0,0 +1,111 @@ +// Copyright 2010 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. + +package zip + +import ( + "errors" + "io" + "io/ioutil" + "sync" + + "github.com/klauspost/compress/flate" +) + +// A Compressor returns a compressing writer, writing to the +// provided writer. On Close, any pending data should be flushed. +type Compressor func(io.Writer) (io.WriteCloser, error) + +// Decompressor is a function that wraps a Reader with a decompressing Reader. +// The decompressed ReadCloser is returned to callers who open files from +// within the archive. These callers are responsible for closing this reader +// when they're finished reading. +type Decompressor func(io.Reader) io.ReadCloser + +var flateWriterPool sync.Pool + +func newFlateWriter(w io.Writer) io.WriteCloser { + fw, ok := flateWriterPool.Get().(*flate.Writer) + if ok { + fw.Reset(w) + } else { + fw, _ = flate.NewWriter(w, 5) + } + return &pooledFlateWriter{fw: fw} +} + +type pooledFlateWriter struct { + mu sync.Mutex // guards Close and Write + fw *flate.Writer +} + +func (w *pooledFlateWriter) Write(p []byte) (n int, err error) { + w.mu.Lock() + defer w.mu.Unlock() + if w.fw == nil { + return 0, errors.New("Write after Close") + } + return w.fw.Write(p) +} + +func (w *pooledFlateWriter) Close() error { + w.mu.Lock() + defer w.mu.Unlock() + var err error + if w.fw != nil { + err = w.fw.Close() + flateWriterPool.Put(w.fw) + w.fw = nil + } + return err +} + +var ( + mu sync.RWMutex // guards compressor and decompressor maps + + compressors = map[uint16]Compressor{ + Store: func(w io.Writer) (io.WriteCloser, error) { return &nopCloser{w}, nil }, + Deflate: func(w io.Writer) (io.WriteCloser, error) { return newFlateWriter(w), nil }, + } + + decompressors = map[uint16]Decompressor{ + Store: ioutil.NopCloser, + Deflate: flate.NewReader, + } +) + +// RegisterDecompressor allows custom decompressors for a specified method ID. +func RegisterDecompressor(method uint16, d Decompressor) { + mu.Lock() + defer mu.Unlock() + + if _, ok := decompressors[method]; ok { + panic("decompressor already registered") + } + decompressors[method] = d +} + +// RegisterCompressor registers custom compressors for a specified method ID. +// The common methods Store and Deflate are built in. +func RegisterCompressor(method uint16, comp Compressor) { + mu.Lock() + defer mu.Unlock() + + if _, ok := compressors[method]; ok { + panic("compressor already registered") + } + compressors[method] = comp +} + +func compressor(method uint16) Compressor { + mu.RLock() + defer mu.RUnlock() + return compressors[method] +} + +func decompressor(method uint16) Decompressor { + mu.RLock() + defer mu.RUnlock() + return decompressors[method] +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/struct.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/struct.go new file mode 100644 index 00000000..5ee4f88f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/struct.go @@ -0,0 +1,313 @@ +// Copyright 2010 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. + +/* +Package zip provides support for reading and writing ZIP archives. + +See: http://www.pkware.com/documents/casestudies/APPNOTE.TXT + +This package does not support disk spanning. + +A note about ZIP64: + +To be backwards compatible the FileHeader has both 32 and 64 bit Size +fields. The 64 bit fields will always contain the correct value and +for normal archives both fields will be the same. For files requiring +the ZIP64 format the 32 bit fields will be 0xffffffff and the 64 bit +fields must be used instead. +*/ +package zip + +import ( + "os" + "path" + "time" +) + +// Compression methods. +const ( + Store uint16 = 0 + Deflate uint16 = 8 +) + +const ( + fileHeaderSignature = 0x04034b50 + directoryHeaderSignature = 0x02014b50 + directoryEndSignature = 0x06054b50 + directory64LocSignature = 0x07064b50 + directory64EndSignature = 0x06064b50 + dataDescriptorSignature = 0x08074b50 // de-facto standard; required by OS X Finder + fileHeaderLen = 30 // + filename + extra + directoryHeaderLen = 46 // + filename + extra + comment + directoryEndLen = 22 // + comment + dataDescriptorLen = 16 // four uint32: descriptor signature, crc32, compressed size, size + dataDescriptor64Len = 24 // descriptor with 8 byte sizes + directory64LocLen = 20 // + directory64EndLen = 56 // + extra + + // Constants for the first byte in CreatorVersion + creatorFAT = 0 + creatorUnix = 3 + creatorNTFS = 11 + creatorVFAT = 14 + creatorMacOSX = 19 + + // version numbers + zipVersion20 = 20 // 2.0 + zipVersion45 = 45 // 4.5 (reads and writes zip64 archives) + + // limits for non zip64 files + uint16max = (1 << 16) - 1 + uint32max = (1 << 32) - 1 + + // extra header id's + zip64ExtraId = 0x0001 // zip64 Extended Information Extra Field +) + +// FileHeader describes a file within a zip file. +// See the zip spec for details. +type FileHeader struct { + // Name is the name of the file. + // It must be a relative path: it must not start with a drive + // letter (e.g. C:) or leading slash, and only forward slashes + // are allowed. + Name string + + CreatorVersion uint16 + ReaderVersion uint16 + Flags uint16 + Method uint16 + ModifiedTime uint16 // MS-DOS time + ModifiedDate uint16 // MS-DOS date + CRC32 uint32 + CompressedSize uint32 // Deprecated: Use CompressedSize64 instead. + UncompressedSize uint32 // Deprecated: Use UncompressedSize64 instead. + CompressedSize64 uint64 + UncompressedSize64 uint64 + Extra []byte + ExternalAttrs uint32 // Meaning depends on CreatorVersion + Comment string +} + +// FileInfo returns an os.FileInfo for the FileHeader. +func (h *FileHeader) FileInfo() os.FileInfo { + return headerFileInfo{h} +} + +// headerFileInfo implements os.FileInfo. +type headerFileInfo struct { + fh *FileHeader +} + +func (fi headerFileInfo) Name() string { return path.Base(fi.fh.Name) } +func (fi headerFileInfo) Size() int64 { + if fi.fh.UncompressedSize64 > 0 { + return int64(fi.fh.UncompressedSize64) + } + return int64(fi.fh.UncompressedSize) +} +func (fi headerFileInfo) IsDir() bool { return fi.Mode().IsDir() } +func (fi headerFileInfo) ModTime() time.Time { return fi.fh.ModTime() } +func (fi headerFileInfo) Mode() os.FileMode { return fi.fh.Mode() } +func (fi headerFileInfo) Sys() interface{} { return fi.fh } + +// FileInfoHeader creates a partially-populated FileHeader from an +// os.FileInfo. +// Because os.FileInfo's Name method returns only the base name of +// the file it describes, it may be necessary to modify the Name field +// of the returned header to provide the full path name of the file. +func FileInfoHeader(fi os.FileInfo) (*FileHeader, error) { + size := fi.Size() + fh := &FileHeader{ + Name: fi.Name(), + UncompressedSize64: uint64(size), + } + fh.SetModTime(fi.ModTime()) + fh.SetMode(fi.Mode()) + if fh.UncompressedSize64 > uint32max { + fh.UncompressedSize = uint32max + } else { + fh.UncompressedSize = uint32(fh.UncompressedSize64) + } + return fh, nil +} + +type directoryEnd struct { + diskNbr uint32 // unused + dirDiskNbr uint32 // unused + dirRecordsThisDisk uint64 // unused + directoryRecords uint64 + directorySize uint64 + directoryOffset uint64 // relative to file + commentLen uint16 + comment string +} + +// msDosTimeToTime converts an MS-DOS date and time into a time.Time. +// The resolution is 2s. +// See: http://msdn.microsoft.com/en-us/library/ms724247(v=VS.85).aspx +func msDosTimeToTime(dosDate, dosTime uint16) time.Time { + return time.Date( + // date bits 0-4: day of month; 5-8: month; 9-15: years since 1980 + int(dosDate>>9+1980), + time.Month(dosDate>>5&0xf), + int(dosDate&0x1f), + + // time bits 0-4: second/2; 5-10: minute; 11-15: hour + int(dosTime>>11), + int(dosTime>>5&0x3f), + int(dosTime&0x1f*2), + 0, // nanoseconds + + time.UTC, + ) +} + +// timeToMsDosTime converts a time.Time to an MS-DOS date and time. +// The resolution is 2s. +// See: http://msdn.microsoft.com/en-us/library/ms724274(v=VS.85).aspx +func timeToMsDosTime(t time.Time) (fDate uint16, fTime uint16) { + t = t.In(time.UTC) + fDate = uint16(t.Day() + int(t.Month())<<5 + (t.Year()-1980)<<9) + fTime = uint16(t.Second()/2 + t.Minute()<<5 + t.Hour()<<11) + return +} + +// ModTime returns the modification time in UTC. +// The resolution is 2s. +func (h *FileHeader) ModTime() time.Time { + return msDosTimeToTime(h.ModifiedDate, h.ModifiedTime) +} + +// SetModTime sets the ModifiedTime and ModifiedDate fields to the given time in UTC. +// The resolution is 2s. +func (h *FileHeader) SetModTime(t time.Time) { + h.ModifiedDate, h.ModifiedTime = timeToMsDosTime(t) +} + +const ( + // Unix constants. The specification doesn't mention them, + // but these seem to be the values agreed on by tools. + s_IFMT = 0xf000 + s_IFSOCK = 0xc000 + s_IFLNK = 0xa000 + s_IFREG = 0x8000 + s_IFBLK = 0x6000 + s_IFDIR = 0x4000 + s_IFCHR = 0x2000 + s_IFIFO = 0x1000 + s_ISUID = 0x800 + s_ISGID = 0x400 + s_ISVTX = 0x200 + + msdosDir = 0x10 + msdosReadOnly = 0x01 +) + +// Mode returns the permission and mode bits for the FileHeader. +func (h *FileHeader) Mode() (mode os.FileMode) { + switch h.CreatorVersion >> 8 { + case creatorUnix, creatorMacOSX: + mode = unixModeToFileMode(h.ExternalAttrs >> 16) + case creatorNTFS, creatorVFAT, creatorFAT: + mode = msdosModeToFileMode(h.ExternalAttrs) + } + if len(h.Name) > 0 && h.Name[len(h.Name)-1] == '/' { + mode |= os.ModeDir + } + return mode +} + +// SetMode changes the permission and mode bits for the FileHeader. +func (h *FileHeader) SetMode(mode os.FileMode) { + h.CreatorVersion = h.CreatorVersion&0xff | creatorUnix<<8 + h.ExternalAttrs = fileModeToUnixMode(mode) << 16 + + // set MSDOS attributes too, as the original zip does. + if mode&os.ModeDir != 0 { + h.ExternalAttrs |= msdosDir + } + if mode&0200 == 0 { + h.ExternalAttrs |= msdosReadOnly + } +} + +// isZip64 reports whether the file size exceeds the 32 bit limit +func (fh *FileHeader) isZip64() bool { + return fh.CompressedSize64 >= uint32max || fh.UncompressedSize64 >= uint32max +} + +func msdosModeToFileMode(m uint32) (mode os.FileMode) { + if m&msdosDir != 0 { + mode = os.ModeDir | 0777 + } else { + mode = 0666 + } + if m&msdosReadOnly != 0 { + mode &^= 0222 + } + return mode +} + +func fileModeToUnixMode(mode os.FileMode) uint32 { + var m uint32 + switch mode & os.ModeType { + default: + m = s_IFREG + case os.ModeDir: + m = s_IFDIR + case os.ModeSymlink: + m = s_IFLNK + case os.ModeNamedPipe: + m = s_IFIFO + case os.ModeSocket: + m = s_IFSOCK + case os.ModeDevice: + if mode&os.ModeCharDevice != 0 { + m = s_IFCHR + } else { + m = s_IFBLK + } + } + if mode&os.ModeSetuid != 0 { + m |= s_ISUID + } + if mode&os.ModeSetgid != 0 { + m |= s_ISGID + } + if mode&os.ModeSticky != 0 { + m |= s_ISVTX + } + return m | uint32(mode&0777) +} + +func unixModeToFileMode(m uint32) os.FileMode { + mode := os.FileMode(m & 0777) + switch m & s_IFMT { + case s_IFBLK: + mode |= os.ModeDevice + case s_IFCHR: + mode |= os.ModeDevice | os.ModeCharDevice + case s_IFDIR: + mode |= os.ModeDir + case s_IFIFO: + mode |= os.ModeNamedPipe + case s_IFLNK: + mode |= os.ModeSymlink + case s_IFREG: + // nothing to do + case s_IFSOCK: + mode |= os.ModeSocket + } + if m&s_ISGID != 0 { + mode |= os.ModeSetgid + } + if m&s_ISUID != 0 { + mode |= os.ModeSetuid + } + if m&s_ISVTX != 0 { + mode |= os.ModeSticky + } + return mode +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/crc32-not-streamed.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/crc32-not-streamed.zip new file mode 100644 index 00000000..f268d887 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/crc32-not-streamed.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/dd.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/dd.zip new file mode 100644 index 00000000..e53378b0 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/dd.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/go-no-datadesc-sig.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/go-no-datadesc-sig.zip new file mode 100644 index 00000000..c3d593f4 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/go-no-datadesc-sig.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/go-with-datadesc-sig.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/go-with-datadesc-sig.zip new file mode 100644 index 00000000..bcfe121b Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/go-with-datadesc-sig.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/gophercolor16x16.png b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/gophercolor16x16.png new file mode 100644 index 00000000..48854ff3 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/gophercolor16x16.png differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/readme.notzip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/readme.notzip new file mode 100644 index 00000000..06668c4c Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/readme.notzip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/readme.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/readme.zip new file mode 100644 index 00000000..db3bb900 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/readme.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/symlink.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/symlink.zip new file mode 100644 index 00000000..af846938 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/symlink.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/test-trailing-junk.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/test-trailing-junk.zip new file mode 100644 index 00000000..42281b4e Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/test-trailing-junk.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/test.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/test.zip new file mode 100644 index 00000000..03890c05 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/test.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/unix.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/unix.zip new file mode 100644 index 00000000..ce1a981b Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/unix.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/winxp.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/winxp.zip new file mode 100644 index 00000000..3919322f Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/winxp.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/zip64-2.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/zip64-2.zip new file mode 100644 index 00000000..f844e353 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/zip64-2.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/zip64.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/zip64.zip new file mode 100644 index 00000000..a2ee1fa3 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/testdata/zip64.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/writer.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/writer.go new file mode 100644 index 00000000..58439586 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zip/writer.go @@ -0,0 +1,393 @@ +// Copyright 2011 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. + +package zip + +import ( + "bufio" + "encoding/binary" + "errors" + "hash" + "io" + + "github.com/klauspost/crc32" +) + +// TODO(adg): support zip file comments + +// Writer implements a zip file writer. +type Writer struct { + cw *countWriter + dir []*header + last *fileWriter + closed bool + compressors map[uint16]Compressor +} + +type header struct { + *FileHeader + offset uint64 +} + +// NewWriter returns a new Writer writing a zip file to w. +func NewWriter(w io.Writer) *Writer { + return &Writer{cw: &countWriter{w: bufio.NewWriter(w)}} +} + +// SetOffset sets the offset of the beginning of the zip data within the +// underlying writer. It should be used when the zip data is appended to an +// existing file, such as a binary executable. +// It must be called before any data is written. +func (w *Writer) SetOffset(n int64) { + if w.cw.count != 0 { + panic("zip: SetOffset called after data was written") + } + w.cw.count = n +} + +// Flush flushes any buffered data to the underlying writer. +// Calling Flush is not normally necessary; calling Close is sufficient. +func (w *Writer) Flush() error { + return w.cw.w.(*bufio.Writer).Flush() +} + +// Close finishes writing the zip file by writing the central directory. +// It does not (and can not) close the underlying writer. +func (w *Writer) Close() error { + if w.last != nil && !w.last.closed { + if err := w.last.close(); err != nil { + return err + } + w.last = nil + } + if w.closed { + return errors.New("zip: writer closed twice") + } + w.closed = true + + // write central directory + start := w.cw.count + for _, h := range w.dir { + var buf [directoryHeaderLen]byte + b := writeBuf(buf[:]) + b.uint32(uint32(directoryHeaderSignature)) + b.uint16(h.CreatorVersion) + b.uint16(h.ReaderVersion) + b.uint16(h.Flags) + b.uint16(h.Method) + b.uint16(h.ModifiedTime) + b.uint16(h.ModifiedDate) + b.uint32(h.CRC32) + if h.isZip64() || h.offset >= uint32max { + // the file needs a zip64 header. store maxint in both + // 32 bit size fields (and offset later) to signal that the + // zip64 extra header should be used. + b.uint32(uint32max) // compressed size + b.uint32(uint32max) // uncompressed size + + // append a zip64 extra block to Extra + var buf [28]byte // 2x uint16 + 3x uint64 + eb := writeBuf(buf[:]) + eb.uint16(zip64ExtraId) + eb.uint16(24) // size = 3x uint64 + eb.uint64(h.UncompressedSize64) + eb.uint64(h.CompressedSize64) + eb.uint64(h.offset) + h.Extra = append(h.Extra, buf[:]...) + } else { + b.uint32(h.CompressedSize) + b.uint32(h.UncompressedSize) + } + b.uint16(uint16(len(h.Name))) + b.uint16(uint16(len(h.Extra))) + b.uint16(uint16(len(h.Comment))) + b = b[4:] // skip disk number start and internal file attr (2x uint16) + b.uint32(h.ExternalAttrs) + if h.offset > uint32max { + b.uint32(uint32max) + } else { + b.uint32(uint32(h.offset)) + } + if _, err := w.cw.Write(buf[:]); err != nil { + return err + } + if _, err := io.WriteString(w.cw, h.Name); err != nil { + return err + } + if _, err := w.cw.Write(h.Extra); err != nil { + return err + } + if _, err := io.WriteString(w.cw, h.Comment); err != nil { + return err + } + } + end := w.cw.count + + records := uint64(len(w.dir)) + size := uint64(end - start) + offset := uint64(start) + + if records > uint16max || size > uint32max || offset > uint32max { + var buf [directory64EndLen + directory64LocLen]byte + b := writeBuf(buf[:]) + + // zip64 end of central directory record + b.uint32(directory64EndSignature) + b.uint64(directory64EndLen - 12) // length minus signature (uint32) and length fields (uint64) + b.uint16(zipVersion45) // version made by + b.uint16(zipVersion45) // version needed to extract + b.uint32(0) // number of this disk + b.uint32(0) // number of the disk with the start of the central directory + b.uint64(records) // total number of entries in the central directory on this disk + b.uint64(records) // total number of entries in the central directory + b.uint64(size) // size of the central directory + b.uint64(offset) // offset of start of central directory with respect to the starting disk number + + // zip64 end of central directory locator + b.uint32(directory64LocSignature) + b.uint32(0) // number of the disk with the start of the zip64 end of central directory + b.uint64(uint64(end)) // relative offset of the zip64 end of central directory record + b.uint32(1) // total number of disks + + if _, err := w.cw.Write(buf[:]); err != nil { + return err + } + + // store max values in the regular end record to signal that + // that the zip64 values should be used instead + records = uint16max + size = uint32max + offset = uint32max + } + + // write end record + var buf [directoryEndLen]byte + b := writeBuf(buf[:]) + b.uint32(uint32(directoryEndSignature)) + b = b[4:] // skip over disk number and first disk number (2x uint16) + b.uint16(uint16(records)) // number of entries this disk + b.uint16(uint16(records)) // number of entries total + b.uint32(uint32(size)) // size of directory + b.uint32(uint32(offset)) // start of directory + // skipped size of comment (always zero) + if _, err := w.cw.Write(buf[:]); err != nil { + return err + } + + return w.cw.w.(*bufio.Writer).Flush() +} + +// Create adds a file to the zip file using the provided name. +// It returns a Writer to which the file contents should be written. +// The name must be a relative path: it must not start with a drive +// letter (e.g. C:) or leading slash, and only forward slashes are +// allowed. +// The file's contents must be written to the io.Writer before the next +// call to Create, CreateHeader, or Close. +func (w *Writer) Create(name string) (io.Writer, error) { + header := &FileHeader{ + Name: name, + Method: Deflate, + } + return w.CreateHeader(header) +} + +// CreateHeader adds a file to the zip file using the provided FileHeader +// for the file metadata. +// It returns a Writer to which the file contents should be written. +// +// The file's contents must be written to the io.Writer before the next +// call to Create, CreateHeader, or Close. The provided FileHeader fh +// must not be modified after a call to CreateHeader. +func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) { + if w.last != nil && !w.last.closed { + if err := w.last.close(); err != nil { + return nil, err + } + } + if len(w.dir) > 0 && w.dir[len(w.dir)-1].FileHeader == fh { + // See https://golang.org/issue/11144 confusion. + return nil, errors.New("archive/zip: invalid duplicate FileHeader") + } + + fh.Flags |= 0x8 // we will write a data descriptor + + fh.CreatorVersion = fh.CreatorVersion&0xff00 | zipVersion20 // preserve compatibility byte + fh.ReaderVersion = zipVersion20 + + fw := &fileWriter{ + zipw: w.cw, + compCount: &countWriter{w: w.cw}, + crc32: crc32.NewIEEE(), + } + comp := w.compressor(fh.Method) + if comp == nil { + return nil, ErrAlgorithm + } + var err error + fw.comp, err = comp(fw.compCount) + if err != nil { + return nil, err + } + fw.rawCount = &countWriter{w: fw.comp} + + h := &header{ + FileHeader: fh, + offset: uint64(w.cw.count), + } + w.dir = append(w.dir, h) + fw.header = h + + if err := writeHeader(w.cw, fh); err != nil { + return nil, err + } + + w.last = fw + return fw, nil +} + +func writeHeader(w io.Writer, h *FileHeader) error { + var buf [fileHeaderLen]byte + b := writeBuf(buf[:]) + b.uint32(uint32(fileHeaderSignature)) + b.uint16(h.ReaderVersion) + b.uint16(h.Flags) + b.uint16(h.Method) + b.uint16(h.ModifiedTime) + b.uint16(h.ModifiedDate) + b.uint32(0) // since we are writing a data descriptor crc32, + b.uint32(0) // compressed size, + b.uint32(0) // and uncompressed size should be zero + b.uint16(uint16(len(h.Name))) + b.uint16(uint16(len(h.Extra))) + if _, err := w.Write(buf[:]); err != nil { + return err + } + if _, err := io.WriteString(w, h.Name); err != nil { + return err + } + _, err := w.Write(h.Extra) + return err +} + +// RegisterCompressor registers or overrides a custom compressor for a specific +// method ID. If a compressor for a given method is not found, Writer will +// default to looking up the compressor at the package level. +func (w *Writer) RegisterCompressor(method uint16, comp Compressor) { + if w.compressors == nil { + w.compressors = make(map[uint16]Compressor) + } + w.compressors[method] = comp +} + +func (w *Writer) compressor(method uint16) Compressor { + comp := w.compressors[method] + if comp == nil { + comp = compressor(method) + } + return comp +} + +type fileWriter struct { + *header + zipw io.Writer + rawCount *countWriter + comp io.WriteCloser + compCount *countWriter + crc32 hash.Hash32 + closed bool +} + +func (w *fileWriter) Write(p []byte) (int, error) { + if w.closed { + return 0, errors.New("zip: write to closed file") + } + w.crc32.Write(p) + return w.rawCount.Write(p) +} + +func (w *fileWriter) close() error { + if w.closed { + return errors.New("zip: file closed twice") + } + w.closed = true + if err := w.comp.Close(); err != nil { + return err + } + + // update FileHeader + fh := w.header.FileHeader + fh.CRC32 = w.crc32.Sum32() + fh.CompressedSize64 = uint64(w.compCount.count) + fh.UncompressedSize64 = uint64(w.rawCount.count) + + if fh.isZip64() { + fh.CompressedSize = uint32max + fh.UncompressedSize = uint32max + fh.ReaderVersion = zipVersion45 // requires 4.5 - File uses ZIP64 format extensions + } else { + fh.CompressedSize = uint32(fh.CompressedSize64) + fh.UncompressedSize = uint32(fh.UncompressedSize64) + } + + // Write data descriptor. This is more complicated than one would + // think, see e.g. comments in zipfile.c:putextended() and + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7073588. + // The approach here is to write 8 byte sizes if needed without + // adding a zip64 extra in the local header (too late anyway). + var buf []byte + if fh.isZip64() { + buf = make([]byte, dataDescriptor64Len) + } else { + buf = make([]byte, dataDescriptorLen) + } + b := writeBuf(buf) + b.uint32(dataDescriptorSignature) // de-facto standard, required by OS X + b.uint32(fh.CRC32) + if fh.isZip64() { + b.uint64(fh.CompressedSize64) + b.uint64(fh.UncompressedSize64) + } else { + b.uint32(fh.CompressedSize) + b.uint32(fh.UncompressedSize) + } + _, err := w.zipw.Write(buf) + return err +} + +type countWriter struct { + w io.Writer + count int64 +} + +func (w *countWriter) Write(p []byte) (int, error) { + n, err := w.w.Write(p) + w.count += int64(n) + return n, err +} + +type nopCloser struct { + io.Writer +} + +func (w nopCloser) Close() error { + return nil +} + +type writeBuf []byte + +func (b *writeBuf) uint16(v uint16) { + binary.LittleEndian.PutUint16(*b, v) + *b = (*b)[2:] +} + +func (b *writeBuf) uint32(v uint32) { + binary.LittleEndian.PutUint32(*b, v) + *b = (*b)[4:] +} + +func (b *writeBuf) uint64(v uint64) { + binary.LittleEndian.PutUint64(*b, v) + *b = (*b)[8:] +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zlib/reader.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zlib/reader.go new file mode 100644 index 00000000..74746959 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zlib/reader.go @@ -0,0 +1,162 @@ +// Copyright 2009 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. + +/* +Package zlib implements reading and writing of zlib format compressed data, +as specified in RFC 1950. + +The implementation provides filters that uncompress during reading +and compress during writing. For example, to write compressed data +to a buffer: + + var b bytes.Buffer + w := zlib.NewWriter(&b) + w.Write([]byte("hello, world\n")) + w.Close() + +and to read that data back: + + r, err := zlib.NewReader(&b) + io.Copy(os.Stdout, r) + r.Close() +*/ +package zlib + +import ( + "bufio" + "errors" + "hash" + "hash/adler32" + "io" + + "github.com/klauspost/compress/flate" +) + +const zlibDeflate = 8 + +var ( + // ErrChecksum is returned when reading ZLIB data that has an invalid checksum. + ErrChecksum = errors.New("zlib: invalid checksum") + // ErrDictionary is returned when reading ZLIB data that has an invalid dictionary. + ErrDictionary = errors.New("zlib: invalid dictionary") + // ErrHeader is returned when reading ZLIB data that has an invalid header. + ErrHeader = errors.New("zlib: invalid header") +) + +type reader struct { + r flate.Reader + decompressor io.ReadCloser + digest hash.Hash32 + err error + scratch [4]byte +} + +// Resetter resets a ReadCloser returned by NewReader or NewReaderDict to +// to switch to a new underlying Reader. This permits reusing a ReadCloser +// instead of allocating a new one. +type Resetter interface { + // Reset discards any buffered data and resets the Resetter as if it was + // newly initialized with the given reader. + Reset(r io.Reader, dict []byte) error +} + +// NewReader creates a new ReadCloser. +// Reads from the returned ReadCloser read and decompress data from r. +// The implementation buffers input and may read more data than necessary from r. +// It is the caller's responsibility to call Close on the ReadCloser when done. +// +// The ReadCloser returned by NewReader also implements Resetter. +func NewReader(r io.Reader) (io.ReadCloser, error) { + return NewReaderDict(r, nil) +} + +// NewReaderDict is like NewReader but uses a preset dictionary. +// NewReaderDict ignores the dictionary if the compressed data does not refer to it. +// If the compressed data refers to a different dictionary, NewReaderDict returns ErrDictionary. +// +// The ReadCloser returned by NewReaderDict also implements Resetter. +func NewReaderDict(r io.Reader, dict []byte) (io.ReadCloser, error) { + z := new(reader) + err := z.Reset(r, dict) + if err != nil { + return nil, err + } + return z, nil +} + +func (z *reader) Read(p []byte) (n int, err error) { + if z.err != nil { + return 0, z.err + } + if len(p) == 0 { + return 0, nil + } + + n, err = z.decompressor.Read(p) + z.digest.Write(p[0:n]) + if n != 0 || err != io.EOF { + z.err = err + return + } + + // Finished file; check checksum. + if _, err := io.ReadFull(z.r, z.scratch[0:4]); err != nil { + z.err = err + return 0, err + } + // ZLIB (RFC 1950) is big-endian, unlike GZIP (RFC 1952). + checksum := uint32(z.scratch[0])<<24 | uint32(z.scratch[1])<<16 | uint32(z.scratch[2])<<8 | uint32(z.scratch[3]) + if checksum != z.digest.Sum32() { + z.err = ErrChecksum + return 0, z.err + } + return +} + +// Calling Close does not close the wrapped io.Reader originally passed to NewReader. +func (z *reader) Close() error { + if z.err != nil { + return z.err + } + z.err = z.decompressor.Close() + return z.err +} + +func (z *reader) Reset(r io.Reader, dict []byte) error { + if fr, ok := r.(flate.Reader); ok { + z.r = fr + } else { + z.r = bufio.NewReader(r) + } + _, err := io.ReadFull(z.r, z.scratch[0:2]) + if err != nil { + return err + } + h := uint(z.scratch[0])<<8 | uint(z.scratch[1]) + if (z.scratch[0]&0x0f != zlibDeflate) || (h%31 != 0) { + return ErrHeader + } + haveDict := z.scratch[1]&0x20 != 0 + if haveDict { + _, err = io.ReadFull(z.r, z.scratch[0:4]) + if err != nil { + return err + } + checksum := uint32(z.scratch[0])<<24 | uint32(z.scratch[1])<<16 | uint32(z.scratch[2])<<8 | uint32(z.scratch[3]) + if checksum != adler32.Checksum(dict) { + return ErrDictionary + } + } + if z.decompressor == nil { + if haveDict { + z.decompressor = flate.NewReaderDict(z.r, dict) + } else { + z.decompressor = flate.NewReader(z.r) + } + } else { + z.decompressor.(flate.Resetter).Reset(z.r, dict) + } + z.digest = adler32.New() + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zlib/writer.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zlib/writer.go new file mode 100644 index 00000000..556dee21 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/compress/zlib/writer.go @@ -0,0 +1,200 @@ +// Copyright 2009 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. + +package zlib + +import ( + "fmt" + "hash" + "hash/adler32" + "io" + + "github.com/klauspost/compress/flate" +) + +// These constants are copied from the flate package, so that code that imports +// "compress/zlib" does not also have to import "compress/flate". +const ( + NoCompression = flate.NoCompression + BestSpeed = flate.BestSpeed + BestCompression = flate.BestCompression + DefaultCompression = flate.DefaultCompression + ConstantCompression = flate.ConstantCompression +) + +// A Writer takes data written to it and writes the compressed +// form of that data to an underlying writer (see NewWriter). +type Writer struct { + w io.Writer + level int + dict []byte + compressor *flate.Writer + digest hash.Hash32 + err error + scratch [4]byte + wroteHeader bool +} + +// NewWriter creates a new Writer. +// Writes to the returned Writer are compressed and written to w. +// +// It is the caller's responsibility to call Close on the WriteCloser when done. +// Writes may be buffered and not flushed until Close. +func NewWriter(w io.Writer) *Writer { + z, _ := NewWriterLevelDict(w, DefaultCompression, nil) + return z +} + +// NewWriterLevel is like NewWriter but specifies the compression level instead +// of assuming DefaultCompression. +// +// The compression level can be DefaultCompression, NoCompression, or any +// integer value between BestSpeed and BestCompression inclusive. The error +// returned will be nil if the level is valid. +func NewWriterLevel(w io.Writer, level int) (*Writer, error) { + return NewWriterLevelDict(w, level, nil) +} + +// NewWriterLevelDict is like NewWriterLevel but specifies a dictionary to +// compress with. +// +// The dictionary may be nil. If not, its contents should not be modified until +// the Writer is closed. +func NewWriterLevelDict(w io.Writer, level int, dict []byte) (*Writer, error) { + if level < ConstantCompression || level > BestCompression { + return nil, fmt.Errorf("zlib: invalid compression level: %d", level) + } + return &Writer{ + w: w, + level: level, + dict: dict, + }, nil +} + +// Reset clears the state of the Writer z such that it is equivalent to its +// initial state from NewWriterLevel or NewWriterLevelDict, but instead writing +// to w. +func (z *Writer) Reset(w io.Writer) { + z.w = w + // z.level and z.dict left unchanged. + if z.compressor != nil { + z.compressor.Reset(w) + } + if z.digest != nil { + z.digest.Reset() + } + z.err = nil + z.scratch = [4]byte{} + z.wroteHeader = false +} + +// writeHeader writes the ZLIB header. +func (z *Writer) writeHeader() (err error) { + z.wroteHeader = true + // ZLIB has a two-byte header (as documented in RFC 1950). + // The first four bits is the CINFO (compression info), which is 7 for the default deflate window size. + // The next four bits is the CM (compression method), which is 8 for deflate. + z.scratch[0] = 0x78 + // The next two bits is the FLEVEL (compression level). The four values are: + // 0=fastest, 1=fast, 2=default, 3=best. + // The next bit, FDICT, is set if a dictionary is given. + // The final five FCHECK bits form a mod-31 checksum. + switch z.level { + case -2, 0, 1: + z.scratch[1] = 0 << 6 + case 2, 3, 4, 5: + z.scratch[1] = 1 << 6 + case 6, -1: + z.scratch[1] = 2 << 6 + case 7, 8, 9: + z.scratch[1] = 3 << 6 + default: + panic("unreachable") + } + if z.dict != nil { + z.scratch[1] |= 1 << 5 + } + z.scratch[1] += uint8(31 - (uint16(z.scratch[0])<<8+uint16(z.scratch[1]))%31) + if _, err = z.w.Write(z.scratch[0:2]); err != nil { + return err + } + if z.dict != nil { + // The next four bytes are the Adler-32 checksum of the dictionary. + checksum := adler32.Checksum(z.dict) + z.scratch[0] = uint8(checksum >> 24) + z.scratch[1] = uint8(checksum >> 16) + z.scratch[2] = uint8(checksum >> 8) + z.scratch[3] = uint8(checksum >> 0) + if _, err = z.w.Write(z.scratch[0:4]); err != nil { + return err + } + } + if z.compressor == nil { + // Initialize deflater unless the Writer is being reused + // after a Reset call. + z.compressor, err = flate.NewWriterDict(z.w, z.level, z.dict) + if err != nil { + return err + } + z.digest = adler32.New() + } + return nil +} + +// Write writes a compressed form of p to the underlying io.Writer. The +// compressed bytes are not necessarily flushed until the Writer is closed or +// explicitly flushed. +func (z *Writer) Write(p []byte) (n int, err error) { + if !z.wroteHeader { + z.err = z.writeHeader() + } + if z.err != nil { + return 0, z.err + } + if len(p) == 0 { + return 0, nil + } + n, err = z.compressor.Write(p) + if err != nil { + z.err = err + return + } + z.digest.Write(p) + return +} + +// Flush flushes the Writer to its underlying io.Writer. +func (z *Writer) Flush() error { + if !z.wroteHeader { + z.err = z.writeHeader() + } + if z.err != nil { + return z.err + } + z.err = z.compressor.Flush() + return z.err +} + +// Close closes the Writer, flushing any unwritten data to the underlying +// io.Writer, but does not close the underlying io.Writer. +func (z *Writer) Close() error { + if !z.wroteHeader { + z.err = z.writeHeader() + } + if z.err != nil { + return z.err + } + z.err = z.compressor.Close() + if z.err != nil { + return z.err + } + checksum := z.digest.Sum32() + // ZLIB (RFC 1950) is big-endian, unlike GZIP (RFC 1952). + z.scratch[0] = uint8(checksum >> 24) + z.scratch[1] = uint8(checksum >> 16) + z.scratch[2] = uint8(checksum >> 8) + z.scratch[3] = uint8(checksum >> 0) + _, z.err = z.w.Write(z.scratch[0:4]) + return z.err +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/LICENSE new file mode 100644 index 00000000..5cec7ee9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Klaus Post + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/README.md b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/README.md new file mode 100644 index 00000000..b2b6bee8 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/README.md @@ -0,0 +1,145 @@ +# cpuid +Package cpuid provides information about the CPU running the current program. + +CPU features are detected on startup, and kept for fast access through the life of the application. +Currently x86 / x64 (AMD64) is supported, and no external C (cgo) code is used, which should make the library very easy to use. + +You can access the CPU information by accessing the shared CPU variable of the cpuid library. + +Package home: https://github.com/klauspost/cpuid + +[![GoDoc][1]][2] [![Build Status][3]][4] + +[1]: https://godoc.org/github.com/klauspost/cpuid?status.svg +[2]: https://godoc.org/github.com/klauspost/cpuid +[3]: https://travis-ci.org/klauspost/cpuid.svg +[4]: https://travis-ci.org/klauspost/cpuid + +# features +## CPU Instructions +* **CMOV** (i686 CMOV) +* **NX** (NX (No-Execute) bit) +* **AMD3DNOW** (AMD 3DNOW) +* **AMD3DNOWEXT** (AMD 3DNowExt) +* **MMX** (standard MMX) +* **MMXEXT** (SSE integer functions or AMD MMX ext) +* **SSE** (SSE functions) +* **SSE2** (P4 SSE functions) +* **SSE3** (Prescott SSE3 functions) +* **SSSE3** (Conroe SSSE3 functions) +* **SSE4** (Penryn SSE4.1 functions) +* **SSE4A** (AMD Barcelona microarchitecture SSE4a instructions) +* **SSE42** (Nehalem SSE4.2 functions) +* **AVX** (AVX functions) +* **AVX2** (AVX2 functions) +* **FMA3** (Intel FMA 3) +* **FMA4** (Bulldozer FMA4 functions) +* **XOP** (Bulldozer XOP functions) +* **F16C** (Half-precision floating-point conversion) +* **BMI1** (Bit Manipulation Instruction Set 1) +* **BMI2** (Bit Manipulation Instruction Set 2) +* **TBM** (AMD Trailing Bit Manipulation) +* **LZCNT** (LZCNT instruction) +* **POPCNT** (POPCNT instruction) +* **AESNI** (Advanced Encryption Standard New Instructions) +* **CLMUL** (Carry-less Multiplication) +* **HTT** (Hyperthreading (enabled)) +* **HLE** (Hardware Lock Elision) +* **RTM** (Restricted Transactional Memory) +* **RDRAND** (RDRAND instruction is available) +* **RDSEED** (RDSEED instruction is available) +* **ADX** (Intel ADX (Multi-Precision Add-Carry Instruction Extensions)) +* **SHA** (Intel SHA Extensions) +* **AVX512F** (AVX-512 Foundation) +* **AVX512DQ** (AVX-512 Doubleword and Quadword Instructions) +* **AVX512IFMA** (AVX-512 Integer Fused Multiply-Add Instructions) +* **AVX512PF** (AVX-512 Prefetch Instructions) +* **AVX512ER** (AVX-512 Exponential and Reciprocal Instructions) +* **AVX512CD** (AVX-512 Conflict Detection Instructions) +* **AVX512BW** (AVX-512 Byte and Word Instructions) +* **AVX512VL** (AVX-512 Vector Length Extensions) +* **AVX512VBMI** (AVX-512 Vector Bit Manipulation Instructions) +* **MPX** (Intel MPX (Memory Protection Extensions)) +* **ERMS** (Enhanced REP MOVSB/STOSB) +* **RDTSCP** (RDTSCP Instruction) +* **CX16** (CMPXCHG16B Instruction) +* **SGX** (Software Guard Extensions, with activation details) + +## Performance +* **RDTSCP()** Returns current cycle count. Can be used for benchmarking. +* **SSE2SLOW** (SSE2 is supported, but usually not faster) +* **SSE3SLOW** (SSE3 is supported, but usually not faster) +* **ATOM** (Atom processor, some SSSE3 instructions are slower) +* **Cache line** (Probable size of a cache line). +* **L1, L2, L3 Cache size** on newer Intel/AMD CPUs. + +## Cpu Vendor/VM +* **Intel** +* **AMD** +* **VIA** +* **Transmeta** +* **NSC** +* **KVM** (Kernel-based Virtual Machine) +* **MSVM** (Microsoft Hyper-V or Windows Virtual PC) +* **VMware** +* **XenHVM** + +# installing + +```go get github.com/klauspost/cpuid``` + +# example + +```Go +package main + +import ( + "fmt" + "github.com/klauspost/cpuid" +) + +func main() { + // Print basic CPU information: + fmt.Println("Name:", cpuid.CPU.BrandName) + fmt.Println("PhysicalCores:", cpuid.CPU.PhysicalCores) + fmt.Println("ThreadsPerCore:", cpuid.CPU.ThreadsPerCore) + fmt.Println("LogicalCores:", cpuid.CPU.LogicalCores) + fmt.Println("Family", cpuid.CPU.Family, "Model:", cpuid.CPU.Model) + fmt.Println("Features:", cpuid.CPU.Features) + fmt.Println("Cacheline bytes:", cpuid.CPU.CacheLine) + fmt.Println("L1 Data Cache:", cpuid.CPU.Cache.L1D, "bytes") + fmt.Println("L1 Instruction Cache:", cpuid.CPU.Cache.L1D, "bytes") + fmt.Println("L2 Cache:", cpuid.CPU.Cache.L2, "bytes") + fmt.Println("L3 Cache:", cpuid.CPU.Cache.L3, "bytes") + + // Test if we have a specific feature: + if cpuid.CPU.SSE() { + fmt.Println("We have Streaming SIMD Extensions") + } +} +``` + +Sample output: +``` +>go run main.go +Name: Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz +PhysicalCores: 2 +ThreadsPerCore: 2 +LogicalCores: 4 +Family 6 Model: 42 +Features: CMOV,MMX,MMXEXT,SSE,SSE2,SSE3,SSSE3,SSE4.1,SSE4.2,AVX,AESNI,CLMUL +Cacheline bytes: 64 +We have Streaming SIMD Extensions +``` + +# private package + +In the "private" folder you can find an autogenerated version of the library you can include in your own packages. + +For this purpose all exports are removed, and functions and constants are lowercased. + +This is not a recommended way of using the library, but provided for convenience, if it is difficult for you to use external packages. + +# license + +This code is published under an MIT license. See LICENSE file for more information. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/cpuid.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/cpuid.go new file mode 100644 index 00000000..9230ca56 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/cpuid.go @@ -0,0 +1,1022 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// Package cpuid provides information about the CPU running the current program. +// +// CPU features are detected on startup, and kept for fast access through the life of the application. +// Currently x86 / x64 (AMD64) is supported. +// +// You can access the CPU information by accessing the shared CPU variable of the cpuid library. +// +// Package home: https://github.com/klauspost/cpuid +package cpuid + +import "strings" + +// Vendor is a representation of a CPU vendor. +type Vendor int + +const ( + Other Vendor = iota + Intel + AMD + VIA + Transmeta + NSC + KVM // Kernel-based Virtual Machine + MSVM // Microsoft Hyper-V or Windows Virtual PC + VMware + XenHVM +) + +const ( + CMOV = 1 << iota // i686 CMOV + NX // NX (No-Execute) bit + AMD3DNOW // AMD 3DNOW + AMD3DNOWEXT // AMD 3DNowExt + MMX // standard MMX + MMXEXT // SSE integer functions or AMD MMX ext + SSE // SSE functions + SSE2 // P4 SSE functions + SSE3 // Prescott SSE3 functions + SSSE3 // Conroe SSSE3 functions + SSE4 // Penryn SSE4.1 functions + SSE4A // AMD Barcelona microarchitecture SSE4a instructions + SSE42 // Nehalem SSE4.2 functions + AVX // AVX functions + AVX2 // AVX2 functions + FMA3 // Intel FMA 3 + FMA4 // Bulldozer FMA4 functions + XOP // Bulldozer XOP functions + F16C // Half-precision floating-point conversion + BMI1 // Bit Manipulation Instruction Set 1 + BMI2 // Bit Manipulation Instruction Set 2 + TBM // AMD Trailing Bit Manipulation + LZCNT // LZCNT instruction + POPCNT // POPCNT instruction + AESNI // Advanced Encryption Standard New Instructions + CLMUL // Carry-less Multiplication + HTT // Hyperthreading (enabled) + HLE // Hardware Lock Elision + RTM // Restricted Transactional Memory + RDRAND // RDRAND instruction is available + RDSEED // RDSEED instruction is available + ADX // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) + SHA // Intel SHA Extensions + AVX512F // AVX-512 Foundation + AVX512DQ // AVX-512 Doubleword and Quadword Instructions + AVX512IFMA // AVX-512 Integer Fused Multiply-Add Instructions + AVX512PF // AVX-512 Prefetch Instructions + AVX512ER // AVX-512 Exponential and Reciprocal Instructions + AVX512CD // AVX-512 Conflict Detection Instructions + AVX512BW // AVX-512 Byte and Word Instructions + AVX512VL // AVX-512 Vector Length Extensions + AVX512VBMI // AVX-512 Vector Bit Manipulation Instructions + MPX // Intel MPX (Memory Protection Extensions) + ERMS // Enhanced REP MOVSB/STOSB + RDTSCP // RDTSCP Instruction + CX16 // CMPXCHG16B Instruction + SGX // Software Guard Extensions + + // Performance indicators + SSE2SLOW // SSE2 is supported, but usually not faster + SSE3SLOW // SSE3 is supported, but usually not faster + ATOM // Atom processor, some SSSE3 instructions are slower +) + +var flagNames = map[Flags]string{ + CMOV: "CMOV", // i686 CMOV + NX: "NX", // NX (No-Execute) bit + AMD3DNOW: "AMD3DNOW", // AMD 3DNOW + AMD3DNOWEXT: "AMD3DNOWEXT", // AMD 3DNowExt + MMX: "MMX", // Standard MMX + MMXEXT: "MMXEXT", // SSE integer functions or AMD MMX ext + SSE: "SSE", // SSE functions + SSE2: "SSE2", // P4 SSE2 functions + SSE3: "SSE3", // Prescott SSE3 functions + SSSE3: "SSSE3", // Conroe SSSE3 functions + SSE4: "SSE4.1", // Penryn SSE4.1 functions + SSE4A: "SSE4A", // AMD Barcelona microarchitecture SSE4a instructions + SSE42: "SSE4.2", // Nehalem SSE4.2 functions + AVX: "AVX", // AVX functions + AVX2: "AVX2", // AVX functions + FMA3: "FMA3", // Intel FMA 3 + FMA4: "FMA4", // Bulldozer FMA4 functions + XOP: "XOP", // Bulldozer XOP functions + F16C: "F16C", // Half-precision floating-point conversion + BMI1: "BMI1", // Bit Manipulation Instruction Set 1 + BMI2: "BMI2", // Bit Manipulation Instruction Set 2 + TBM: "TBM", // AMD Trailing Bit Manipulation + LZCNT: "LZCNT", // LZCNT instruction + POPCNT: "POPCNT", // POPCNT instruction + AESNI: "AESNI", // Advanced Encryption Standard New Instructions + CLMUL: "CLMUL", // Carry-less Multiplication + HTT: "HTT", // Hyperthreading (enabled) + HLE: "HLE", // Hardware Lock Elision + RTM: "RTM", // Restricted Transactional Memory + RDRAND: "RDRAND", // RDRAND instruction is available + RDSEED: "RDSEED", // RDSEED instruction is available + ADX: "ADX", // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) + SHA: "SHA", // Intel SHA Extensions + AVX512F: "AVX512F", // AVX-512 Foundation + AVX512DQ: "AVX512DQ", // AVX-512 Doubleword and Quadword Instructions + AVX512IFMA: "AVX512IFMA", // AVX-512 Integer Fused Multiply-Add Instructions + AVX512PF: "AVX512PF", // AVX-512 Prefetch Instructions + AVX512ER: "AVX512ER", // AVX-512 Exponential and Reciprocal Instructions + AVX512CD: "AVX512CD", // AVX-512 Conflict Detection Instructions + AVX512BW: "AVX512BW", // AVX-512 Byte and Word Instructions + AVX512VL: "AVX512VL", // AVX-512 Vector Length Extensions + AVX512VBMI: "AVX512VBMI", // AVX-512 Vector Bit Manipulation Instructions + MPX: "MPX", // Intel MPX (Memory Protection Extensions) + ERMS: "ERMS", // Enhanced REP MOVSB/STOSB + RDTSCP: "RDTSCP", // RDTSCP Instruction + CX16: "CX16", // CMPXCHG16B Instruction + SGX: "SGX", // Software Guard Extensions + + // Performance indicators + SSE2SLOW: "SSE2SLOW", // SSE2 supported, but usually not faster + SSE3SLOW: "SSE3SLOW", // SSE3 supported, but usually not faster + ATOM: "ATOM", // Atom processor, some SSSE3 instructions are slower + +} + +// CPUInfo contains information about the detected system CPU. +type CPUInfo struct { + BrandName string // Brand name reported by the CPU + VendorID Vendor // Comparable CPU vendor ID + Features Flags // Features of the CPU + PhysicalCores int // Number of physical processor cores in your CPU. Will be 0 if undetectable. + ThreadsPerCore int // Number of threads per physical core. Will be 1 if undetectable. + LogicalCores int // Number of physical cores times threads that can run on each core through the use of hyperthreading. Will be 0 if undetectable. + Family int // CPU family number + Model int // CPU model number + CacheLine int // Cache line size in bytes. Will be 0 if undetectable. + Cache struct { + L1I int // L1 Instruction Cache (per core or shared). Will be -1 if undetected + L1D int // L1 Data Cache (per core or shared). Will be -1 if undetected + L2 int // L2 Cache (per core or shared). Will be -1 if undetected + L3 int // L3 Instruction Cache (per core or shared). Will be -1 if undetected + } + SGX SGXSupport + maxFunc uint32 + maxExFunc uint32 +} + +var cpuid func(op uint32) (eax, ebx, ecx, edx uint32) +var cpuidex func(op, op2 uint32) (eax, ebx, ecx, edx uint32) +var xgetbv func(index uint32) (eax, edx uint32) +var rdtscpAsm func() (eax, ebx, ecx, edx uint32) + +// CPU contains information about the CPU as detected on startup, +// or when Detect last was called. +// +// Use this as the primary entry point to you data, +// this way queries are +var CPU CPUInfo + +func init() { + initCPU() + Detect() +} + +// Detect will re-detect current CPU info. +// This will replace the content of the exported CPU variable. +// +// Unless you expect the CPU to change while you are running your program +// you should not need to call this function. +// If you call this, you must ensure that no other goroutine is accessing the +// exported CPU variable. +func Detect() { + CPU.maxFunc = maxFunctionID() + CPU.maxExFunc = maxExtendedFunction() + CPU.BrandName = brandName() + CPU.CacheLine = cacheLine() + CPU.Family, CPU.Model = familyModel() + CPU.Features = support() + CPU.SGX = sgx(CPU.Features&SGX != 0) + CPU.ThreadsPerCore = threadsPerCore() + CPU.LogicalCores = logicalCores() + CPU.PhysicalCores = physicalCores() + CPU.VendorID = vendorID() + CPU.cacheSize() +} + +// Generated here: http://play.golang.org/p/BxFH2Gdc0G + +// Cmov indicates support of CMOV instructions +func (c CPUInfo) Cmov() bool { + return c.Features&CMOV != 0 +} + +// Amd3dnow indicates support of AMD 3DNOW! instructions +func (c CPUInfo) Amd3dnow() bool { + return c.Features&AMD3DNOW != 0 +} + +// Amd3dnowExt indicates support of AMD 3DNOW! Extended instructions +func (c CPUInfo) Amd3dnowExt() bool { + return c.Features&AMD3DNOWEXT != 0 +} + +// MMX indicates support of MMX instructions +func (c CPUInfo) MMX() bool { + return c.Features&MMX != 0 +} + +// MMXExt indicates support of MMXEXT instructions +// (SSE integer functions or AMD MMX ext) +func (c CPUInfo) MMXExt() bool { + return c.Features&MMXEXT != 0 +} + +// SSE indicates support of SSE instructions +func (c CPUInfo) SSE() bool { + return c.Features&SSE != 0 +} + +// SSE2 indicates support of SSE 2 instructions +func (c CPUInfo) SSE2() bool { + return c.Features&SSE2 != 0 +} + +// SSE3 indicates support of SSE 3 instructions +func (c CPUInfo) SSE3() bool { + return c.Features&SSE3 != 0 +} + +// SSSE3 indicates support of SSSE 3 instructions +func (c CPUInfo) SSSE3() bool { + return c.Features&SSSE3 != 0 +} + +// SSE4 indicates support of SSE 4 (also called SSE 4.1) instructions +func (c CPUInfo) SSE4() bool { + return c.Features&SSE4 != 0 +} + +// SSE42 indicates support of SSE4.2 instructions +func (c CPUInfo) SSE42() bool { + return c.Features&SSE42 != 0 +} + +// AVX indicates support of AVX instructions +// and operating system support of AVX instructions +func (c CPUInfo) AVX() bool { + return c.Features&AVX != 0 +} + +// AVX2 indicates support of AVX2 instructions +func (c CPUInfo) AVX2() bool { + return c.Features&AVX2 != 0 +} + +// FMA3 indicates support of FMA3 instructions +func (c CPUInfo) FMA3() bool { + return c.Features&FMA3 != 0 +} + +// FMA4 indicates support of FMA4 instructions +func (c CPUInfo) FMA4() bool { + return c.Features&FMA4 != 0 +} + +// XOP indicates support of XOP instructions +func (c CPUInfo) XOP() bool { + return c.Features&XOP != 0 +} + +// F16C indicates support of F16C instructions +func (c CPUInfo) F16C() bool { + return c.Features&F16C != 0 +} + +// BMI1 indicates support of BMI1 instructions +func (c CPUInfo) BMI1() bool { + return c.Features&BMI1 != 0 +} + +// BMI2 indicates support of BMI2 instructions +func (c CPUInfo) BMI2() bool { + return c.Features&BMI2 != 0 +} + +// TBM indicates support of TBM instructions +// (AMD Trailing Bit Manipulation) +func (c CPUInfo) TBM() bool { + return c.Features&TBM != 0 +} + +// Lzcnt indicates support of LZCNT instruction +func (c CPUInfo) Lzcnt() bool { + return c.Features&LZCNT != 0 +} + +// Popcnt indicates support of POPCNT instruction +func (c CPUInfo) Popcnt() bool { + return c.Features&POPCNT != 0 +} + +// HTT indicates the processor has Hyperthreading enabled +func (c CPUInfo) HTT() bool { + return c.Features&HTT != 0 +} + +// SSE2Slow indicates that SSE2 may be slow on this processor +func (c CPUInfo) SSE2Slow() bool { + return c.Features&SSE2SLOW != 0 +} + +// SSE3Slow indicates that SSE3 may be slow on this processor +func (c CPUInfo) SSE3Slow() bool { + return c.Features&SSE3SLOW != 0 +} + +// AesNi indicates support of AES-NI instructions +// (Advanced Encryption Standard New Instructions) +func (c CPUInfo) AesNi() bool { + return c.Features&AESNI != 0 +} + +// Clmul indicates support of CLMUL instructions +// (Carry-less Multiplication) +func (c CPUInfo) Clmul() bool { + return c.Features&CLMUL != 0 +} + +// NX indicates support of NX (No-Execute) bit +func (c CPUInfo) NX() bool { + return c.Features&NX != 0 +} + +// SSE4A indicates support of AMD Barcelona microarchitecture SSE4a instructions +func (c CPUInfo) SSE4A() bool { + return c.Features&SSE4A != 0 +} + +// HLE indicates support of Hardware Lock Elision +func (c CPUInfo) HLE() bool { + return c.Features&HLE != 0 +} + +// RTM indicates support of Restricted Transactional Memory +func (c CPUInfo) RTM() bool { + return c.Features&RTM != 0 +} + +// Rdrand indicates support of RDRAND instruction is available +func (c CPUInfo) Rdrand() bool { + return c.Features&RDRAND != 0 +} + +// Rdseed indicates support of RDSEED instruction is available +func (c CPUInfo) Rdseed() bool { + return c.Features&RDSEED != 0 +} + +// ADX indicates support of Intel ADX (Multi-Precision Add-Carry Instruction Extensions) +func (c CPUInfo) ADX() bool { + return c.Features&ADX != 0 +} + +// SHA indicates support of Intel SHA Extensions +func (c CPUInfo) SHA() bool { + return c.Features&SHA != 0 +} + +// AVX512F indicates support of AVX-512 Foundation +func (c CPUInfo) AVX512F() bool { + return c.Features&AVX512F != 0 +} + +// AVX512DQ indicates support of AVX-512 Doubleword and Quadword Instructions +func (c CPUInfo) AVX512DQ() bool { + return c.Features&AVX512DQ != 0 +} + +// AVX512IFMA indicates support of AVX-512 Integer Fused Multiply-Add Instructions +func (c CPUInfo) AVX512IFMA() bool { + return c.Features&AVX512IFMA != 0 +} + +// AVX512PF indicates support of AVX-512 Prefetch Instructions +func (c CPUInfo) AVX512PF() bool { + return c.Features&AVX512PF != 0 +} + +// AVX512ER indicates support of AVX-512 Exponential and Reciprocal Instructions +func (c CPUInfo) AVX512ER() bool { + return c.Features&AVX512ER != 0 +} + +// AVX512CD indicates support of AVX-512 Conflict Detection Instructions +func (c CPUInfo) AVX512CD() bool { + return c.Features&AVX512CD != 0 +} + +// AVX512BW indicates support of AVX-512 Byte and Word Instructions +func (c CPUInfo) AVX512BW() bool { + return c.Features&AVX512BW != 0 +} + +// AVX512VL indicates support of AVX-512 Vector Length Extensions +func (c CPUInfo) AVX512VL() bool { + return c.Features&AVX512VL != 0 +} + +// AVX512VBMI indicates support of AVX-512 Vector Bit Manipulation Instructions +func (c CPUInfo) AVX512VBMI() bool { + return c.Features&AVX512VBMI != 0 +} + +// MPX indicates support of Intel MPX (Memory Protection Extensions) +func (c CPUInfo) MPX() bool { + return c.Features&MPX != 0 +} + +// ERMS indicates support of Enhanced REP MOVSB/STOSB +func (c CPUInfo) ERMS() bool { + return c.Features&ERMS != 0 +} + +func (c CPUInfo) RDTSCP() bool { + return c.Features&RDTSCP != 0 +} + +func (c CPUInfo) CX16() bool { + return c.Features&CX16 != 0 +} + +// Atom indicates an Atom processor +func (c CPUInfo) Atom() bool { + return c.Features&ATOM != 0 +} + +// Intel returns true if vendor is recognized as Intel +func (c CPUInfo) Intel() bool { + return c.VendorID == Intel +} + +// AMD returns true if vendor is recognized as AMD +func (c CPUInfo) AMD() bool { + return c.VendorID == AMD +} + +// Transmeta returns true if vendor is recognized as Transmeta +func (c CPUInfo) Transmeta() bool { + return c.VendorID == Transmeta +} + +// NSC returns true if vendor is recognized as National Semiconductor +func (c CPUInfo) NSC() bool { + return c.VendorID == NSC +} + +// VIA returns true if vendor is recognized as VIA +func (c CPUInfo) VIA() bool { + return c.VendorID == VIA +} + +// RTCounter returns the 64-bit time-stamp counter +// Uses the RDTSCP instruction. The value 0 is returned +// if the CPU does not support the instruction. +func (c CPUInfo) RTCounter() uint64 { + if !c.RDTSCP() { + return 0 + } + a, _, _, d := rdtscpAsm() + return uint64(a) | (uint64(d) << 32) +} + +// Ia32TscAux returns the IA32_TSC_AUX part of the RDTSCP. +// This variable is OS dependent, but on Linux contains information +// about the current cpu/core the code is running on. +// If the RDTSCP instruction isn't supported on the CPU, the value 0 is returned. +func (c CPUInfo) Ia32TscAux() uint32 { + if !c.RDTSCP() { + return 0 + } + _, _, ecx, _ := rdtscpAsm() + return ecx +} + +// LogicalCPU will return the Logical CPU the code is currently executing on. +// This is likely to change when the OS re-schedules the running thread +// to another CPU. +// If the current core cannot be detected, -1 will be returned. +func (c CPUInfo) LogicalCPU() int { + if c.maxFunc < 1 { + return -1 + } + _, ebx, _, _ := cpuid(1) + return int(ebx >> 24) +} + +// VM Will return true if the cpu id indicates we are in +// a virtual machine. This is only a hint, and will very likely +// have many false negatives. +func (c CPUInfo) VM() bool { + switch c.VendorID { + case MSVM, KVM, VMware, XenHVM: + return true + } + return false +} + +// Flags contains detected cpu features and caracteristics +type Flags uint64 + +// String returns a string representation of the detected +// CPU features. +func (f Flags) String() string { + return strings.Join(f.Strings(), ",") +} + +// Strings returns and array of the detected features. +func (f Flags) Strings() []string { + s := support() + r := make([]string, 0, 20) + for i := uint(0); i < 64; i++ { + key := Flags(1 << i) + val := flagNames[key] + if s&key != 0 { + r = append(r, val) + } + } + return r +} + +func maxExtendedFunction() uint32 { + eax, _, _, _ := cpuid(0x80000000) + return eax +} + +func maxFunctionID() uint32 { + a, _, _, _ := cpuid(0) + return a +} + +func brandName() string { + if maxExtendedFunction() >= 0x80000004 { + v := make([]uint32, 0, 48) + for i := uint32(0); i < 3; i++ { + a, b, c, d := cpuid(0x80000002 + i) + v = append(v, a, b, c, d) + } + return strings.Trim(string(valAsString(v...)), " ") + } + return "unknown" +} + +func threadsPerCore() int { + mfi := maxFunctionID() + if mfi < 0x4 || vendorID() != Intel { + return 1 + } + + if mfi < 0xb { + _, b, _, d := cpuid(1) + if (d & (1 << 28)) != 0 { + // v will contain logical core count + v := (b >> 16) & 255 + if v > 1 { + a4, _, _, _ := cpuid(4) + // physical cores + v2 := (a4 >> 26) + 1 + if v2 > 0 { + return int(v) / int(v2) + } + } + } + return 1 + } + _, b, _, _ := cpuidex(0xb, 0) + if b&0xffff == 0 { + return 1 + } + return int(b & 0xffff) +} + +func logicalCores() int { + mfi := maxFunctionID() + switch vendorID() { + case Intel: + // Use this on old Intel processors + if mfi < 0xb { + if mfi < 1 { + return 0 + } + // CPUID.1:EBX[23:16] represents the maximum number of addressable IDs (initial APIC ID) + // that can be assigned to logical processors in a physical package. + // The value may not be the same as the number of logical processors that are present in the hardware of a physical package. + _, ebx, _, _ := cpuid(1) + logical := (ebx >> 16) & 0xff + return int(logical) + } + _, b, _, _ := cpuidex(0xb, 1) + return int(b & 0xffff) + case AMD: + _, b, _, _ := cpuid(1) + return int((b >> 16) & 0xff) + default: + return 0 + } +} + +func familyModel() (int, int) { + if maxFunctionID() < 0x1 { + return 0, 0 + } + eax, _, _, _ := cpuid(1) + family := ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff) + model := ((eax >> 4) & 0xf) + ((eax >> 12) & 0xf0) + return int(family), int(model) +} + +func physicalCores() int { + switch vendorID() { + case Intel: + return logicalCores() / threadsPerCore() + case AMD: + if maxExtendedFunction() >= 0x80000008 { + _, _, c, _ := cpuid(0x80000008) + return int(c&0xff) + 1 + } + } + return 0 +} + +// Except from http://en.wikipedia.org/wiki/CPUID#EAX.3D0:_Get_vendor_ID +var vendorMapping = map[string]Vendor{ + "AMDisbetter!": AMD, + "AuthenticAMD": AMD, + "CentaurHauls": VIA, + "GenuineIntel": Intel, + "TransmetaCPU": Transmeta, + "GenuineTMx86": Transmeta, + "Geode by NSC": NSC, + "VIA VIA VIA ": VIA, + "KVMKVMKVMKVM": KVM, + "Microsoft Hv": MSVM, + "VMwareVMware": VMware, + "XenVMMXenVMM": XenHVM, +} + +func vendorID() Vendor { + _, b, c, d := cpuid(0) + v := valAsString(b, d, c) + vend, ok := vendorMapping[string(v)] + if !ok { + return Other + } + return vend +} + +func cacheLine() int { + if maxFunctionID() < 0x1 { + return 0 + } + + _, ebx, _, _ := cpuid(1) + cache := (ebx & 0xff00) >> 5 // cflush size + if cache == 0 && maxExtendedFunction() >= 0x80000006 { + _, _, ecx, _ := cpuid(0x80000006) + cache = ecx & 0xff // cacheline size + } + // TODO: Read from Cache and TLB Information + return int(cache) +} + +func (c *CPUInfo) cacheSize() { + c.Cache.L1D = -1 + c.Cache.L1I = -1 + c.Cache.L2 = -1 + c.Cache.L3 = -1 + vendor := vendorID() + switch vendor { + case Intel: + if maxFunctionID() < 4 { + return + } + for i := uint32(0); ; i++ { + eax, ebx, ecx, _ := cpuidex(4, i) + cacheType := eax & 15 + if cacheType == 0 { + break + } + cacheLevel := (eax >> 5) & 7 + coherency := int(ebx&0xfff) + 1 + partitions := int((ebx>>12)&0x3ff) + 1 + associativity := int((ebx>>22)&0x3ff) + 1 + sets := int(ecx) + 1 + size := associativity * partitions * coherency * sets + switch cacheLevel { + case 1: + if cacheType == 1 { + // 1 = Data Cache + c.Cache.L1D = size + } else if cacheType == 2 { + // 2 = Instruction Cache + c.Cache.L1I = size + } else { + if c.Cache.L1D < 0 { + c.Cache.L1I = size + } + if c.Cache.L1I < 0 { + c.Cache.L1I = size + } + } + case 2: + c.Cache.L2 = size + case 3: + c.Cache.L3 = size + } + } + case AMD: + // Untested. + if maxExtendedFunction() < 0x80000005 { + return + } + _, _, ecx, edx := cpuid(0x80000005) + c.Cache.L1D = int(((ecx >> 24) & 0xFF) * 1024) + c.Cache.L1I = int(((edx >> 24) & 0xFF) * 1024) + + if maxExtendedFunction() < 0x80000006 { + return + } + _, _, ecx, _ = cpuid(0x80000006) + c.Cache.L2 = int(((ecx >> 16) & 0xFFFF) * 1024) + } + + return +} + +type SGXSupport struct { + Available bool + SGX1Supported bool + SGX2Supported bool + MaxEnclaveSizeNot64 int64 + MaxEnclaveSize64 int64 +} + +func sgx(available bool) (rval SGXSupport) { + rval.Available = available + + if !available { + return + } + + a, _, _, d := cpuidex(0x12, 0) + rval.SGX1Supported = a&0x01 != 0 + rval.SGX2Supported = a&0x02 != 0 + rval.MaxEnclaveSizeNot64 = 1 << (d & 0xFF) // pow 2 + rval.MaxEnclaveSize64 = 1 << ((d >> 8) & 0xFF) // pow 2 + + return +} + +func support() Flags { + mfi := maxFunctionID() + vend := vendorID() + if mfi < 0x1 { + return 0 + } + rval := uint64(0) + _, _, c, d := cpuid(1) + if (d & (1 << 15)) != 0 { + rval |= CMOV + } + if (d & (1 << 23)) != 0 { + rval |= MMX + } + if (d & (1 << 25)) != 0 { + rval |= MMXEXT + } + if (d & (1 << 25)) != 0 { + rval |= SSE + } + if (d & (1 << 26)) != 0 { + rval |= SSE2 + } + if (c & 1) != 0 { + rval |= SSE3 + } + if (c & 0x00000200) != 0 { + rval |= SSSE3 + } + if (c & 0x00080000) != 0 { + rval |= SSE4 + } + if (c & 0x00100000) != 0 { + rval |= SSE42 + } + if (c & (1 << 25)) != 0 { + rval |= AESNI + } + if (c & (1 << 1)) != 0 { + rval |= CLMUL + } + if c&(1<<23) != 0 { + rval |= POPCNT + } + if c&(1<<30) != 0 { + rval |= RDRAND + } + if c&(1<<29) != 0 { + rval |= F16C + } + if c&(1<<13) != 0 { + rval |= CX16 + } + if vend == Intel && (d&(1<<28)) != 0 && mfi >= 4 { + if threadsPerCore() > 1 { + rval |= HTT + } + } + + // Check XGETBV, OXSAVE and AVX bits + if c&(1<<26) != 0 && c&(1<<27) != 0 && c&(1<<28) != 0 { + // Check for OS support + eax, _ := xgetbv(0) + if (eax & 0x6) == 0x6 { + rval |= AVX + if (c & 0x00001000) != 0 { + rval |= FMA3 + } + } + } + + // Check AVX2, AVX2 requires OS support, but BMI1/2 don't. + if mfi >= 7 { + _, ebx, ecx, _ := cpuidex(7, 0) + if (rval&AVX) != 0 && (ebx&0x00000020) != 0 { + rval |= AVX2 + } + if (ebx & 0x00000008) != 0 { + rval |= BMI1 + if (ebx & 0x00000100) != 0 { + rval |= BMI2 + } + } + if ebx&(1<<2) != 0 { + rval |= SGX + } + if ebx&(1<<4) != 0 { + rval |= HLE + } + if ebx&(1<<9) != 0 { + rval |= ERMS + } + if ebx&(1<<11) != 0 { + rval |= RTM + } + if ebx&(1<<14) != 0 { + rval |= MPX + } + if ebx&(1<<18) != 0 { + rval |= RDSEED + } + if ebx&(1<<19) != 0 { + rval |= ADX + } + if ebx&(1<<29) != 0 { + rval |= SHA + } + + // Only detect AVX-512 features if XGETBV is supported + if c&((1<<26)|(1<<27)) == (1<<26)|(1<<27) { + // Check for OS support + eax, _ := xgetbv(0) + + // Verify that XCR0[7:5] = ‘111b’ (OPMASK state, upper 256-bit of ZMM0-ZMM15 and + // ZMM16-ZMM31 state are enabled by OS) + /// and that XCR0[2:1] = ‘11b’ (XMM state and YMM state are enabled by OS). + if (eax>>5)&7 == 7 && (eax>>1)&3 == 3 { + if ebx&(1<<16) != 0 { + rval |= AVX512F + } + if ebx&(1<<17) != 0 { + rval |= AVX512DQ + } + if ebx&(1<<21) != 0 { + rval |= AVX512IFMA + } + if ebx&(1<<26) != 0 { + rval |= AVX512PF + } + if ebx&(1<<27) != 0 { + rval |= AVX512ER + } + if ebx&(1<<28) != 0 { + rval |= AVX512CD + } + if ebx&(1<<30) != 0 { + rval |= AVX512BW + } + if ebx&(1<<31) != 0 { + rval |= AVX512VL + } + // ecx + if ecx&(1<<1) != 0 { + rval |= AVX512VBMI + } + } + } + } + + if maxExtendedFunction() >= 0x80000001 { + _, _, c, d := cpuid(0x80000001) + if (c & (1 << 5)) != 0 { + rval |= LZCNT + rval |= POPCNT + } + if (d & (1 << 31)) != 0 { + rval |= AMD3DNOW + } + if (d & (1 << 30)) != 0 { + rval |= AMD3DNOWEXT + } + if (d & (1 << 23)) != 0 { + rval |= MMX + } + if (d & (1 << 22)) != 0 { + rval |= MMXEXT + } + if (c & (1 << 6)) != 0 { + rval |= SSE4A + } + if d&(1<<20) != 0 { + rval |= NX + } + if d&(1<<27) != 0 { + rval |= RDTSCP + } + + /* Allow for selectively disabling SSE2 functions on AMD processors + with SSE2 support but not SSE4a. This includes Athlon64, some + Opteron, and some Sempron processors. MMX, SSE, or 3DNow! are faster + than SSE2 often enough to utilize this special-case flag. + AV_CPU_FLAG_SSE2 and AV_CPU_FLAG_SSE2SLOW are both set in this case + so that SSE2 is used unless explicitly disabled by checking + AV_CPU_FLAG_SSE2SLOW. */ + if vendorID() != Intel && + rval&SSE2 != 0 && (c&0x00000040) == 0 { + rval |= SSE2SLOW + } + + /* XOP and FMA4 use the AVX instruction coding scheme, so they can't be + * used unless the OS has AVX support. */ + if (rval & AVX) != 0 { + if (c & 0x00000800) != 0 { + rval |= XOP + } + if (c & 0x00010000) != 0 { + rval |= FMA4 + } + } + + if vendorID() == Intel { + family, model := familyModel() + if family == 6 && (model == 9 || model == 13 || model == 14) { + /* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and + * 6/14 (core1 "yonah") theoretically support sse2, but it's + * usually slower than mmx. */ + if (rval & SSE2) != 0 { + rval |= SSE2SLOW + } + if (rval & SSE3) != 0 { + rval |= SSE3SLOW + } + } + /* The Atom processor has SSSE3 support, which is useful in many cases, + * but sometimes the SSSE3 version is slower than the SSE2 equivalent + * on the Atom, but is generally faster on other processors supporting + * SSSE3. This flag allows for selectively disabling certain SSSE3 + * functions on the Atom. */ + if family == 6 && model == 28 { + rval |= ATOM + } + } + } + return Flags(rval) +} + +func valAsString(values ...uint32) []byte { + r := make([]byte, 4*len(values)) + for i, v := range values { + dst := r[i*4:] + dst[0] = byte(v & 0xff) + dst[1] = byte((v >> 8) & 0xff) + dst[2] = byte((v >> 16) & 0xff) + dst[3] = byte((v >> 24) & 0xff) + switch { + case dst[0] == 0: + return r[:i*4] + case dst[1] == 0: + return r[:i*4+1] + case dst[2] == 0: + return r[:i*4+2] + case dst[3] == 0: + return r[:i*4+3] + } + } + return r +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/cpuid_386.s b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/cpuid_386.s new file mode 100644 index 00000000..4d731711 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/cpuid_386.s @@ -0,0 +1,42 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// +build 386,!gccgo + +// func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) +TEXT ·asmCpuid(SB), 7, $0 + XORL CX, CX + MOVL op+0(FP), AX + CPUID + MOVL AX, eax+4(FP) + MOVL BX, ebx+8(FP) + MOVL CX, ecx+12(FP) + MOVL DX, edx+16(FP) + RET + +// func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) +TEXT ·asmCpuidex(SB), 7, $0 + MOVL op+0(FP), AX + MOVL op2+4(FP), CX + CPUID + MOVL AX, eax+8(FP) + MOVL BX, ebx+12(FP) + MOVL CX, ecx+16(FP) + MOVL DX, edx+20(FP) + RET + +// func xgetbv(index uint32) (eax, edx uint32) +TEXT ·asmXgetbv(SB), 7, $0 + MOVL index+0(FP), CX + BYTE $0x0f; BYTE $0x01; BYTE $0xd0 // XGETBV + MOVL AX, eax+4(FP) + MOVL DX, edx+8(FP) + RET + +// func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) +TEXT ·asmRdtscpAsm(SB), 7, $0 + BYTE $0x0F; BYTE $0x01; BYTE $0xF9 // RDTSCP + MOVL AX, eax+0(FP) + MOVL BX, ebx+4(FP) + MOVL CX, ecx+8(FP) + MOVL DX, edx+12(FP) + RET diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/cpuid_amd64.s b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/cpuid_amd64.s new file mode 100644 index 00000000..3c1d60e4 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/cpuid_amd64.s @@ -0,0 +1,42 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +//+build amd64,!gccgo + +// func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) +TEXT ·asmCpuid(SB), 7, $0 + XORQ CX, CX + MOVL op+0(FP), AX + CPUID + MOVL AX, eax+8(FP) + MOVL BX, ebx+12(FP) + MOVL CX, ecx+16(FP) + MOVL DX, edx+20(FP) + RET + +// func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) +TEXT ·asmCpuidex(SB), 7, $0 + MOVL op+0(FP), AX + MOVL op2+4(FP), CX + CPUID + MOVL AX, eax+8(FP) + MOVL BX, ebx+12(FP) + MOVL CX, ecx+16(FP) + MOVL DX, edx+20(FP) + RET + +// func asmXgetbv(index uint32) (eax, edx uint32) +TEXT ·asmXgetbv(SB), 7, $0 + MOVL index+0(FP), CX + BYTE $0x0f; BYTE $0x01; BYTE $0xd0 // XGETBV + MOVL AX, eax+8(FP) + MOVL DX, edx+12(FP) + RET + +// func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) +TEXT ·asmRdtscpAsm(SB), 7, $0 + BYTE $0x0F; BYTE $0x01; BYTE $0xF9 // RDTSCP + MOVL AX, eax+0(FP) + MOVL BX, ebx+4(FP) + MOVL CX, ecx+8(FP) + MOVL DX, edx+12(FP) + RET diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/detect_intel.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/detect_intel.go new file mode 100644 index 00000000..a5f04dd6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/detect_intel.go @@ -0,0 +1,17 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// +build 386,!gccgo amd64,!gccgo + +package cpuid + +func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) +func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) +func asmXgetbv(index uint32) (eax, edx uint32) +func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) + +func initCPU() { + cpuid = asmCpuid + cpuidex = asmCpuidex + xgetbv = asmXgetbv + rdtscpAsm = asmRdtscpAsm +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/detect_ref.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/detect_ref.go new file mode 100644 index 00000000..909c5d9a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/detect_ref.go @@ -0,0 +1,23 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// +build !amd64,!386 gccgo + +package cpuid + +func initCPU() { + cpuid = func(op uint32) (eax, ebx, ecx, edx uint32) { + return 0, 0, 0, 0 + } + + cpuidex = func(op, op2 uint32) (eax, ebx, ecx, edx uint32) { + return 0, 0, 0, 0 + } + + xgetbv = func(index uint32) (eax, edx uint32) { + return 0, 0 + } + + rdtscpAsm = func() (eax, ebx, ecx, edx uint32) { + return 0, 0, 0, 0 + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/generate.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/generate.go new file mode 100644 index 00000000..c060b816 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/generate.go @@ -0,0 +1,3 @@ +package cpuid + +//go:generate go run private-gen.go diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private-gen.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private-gen.go new file mode 100644 index 00000000..437333d2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private-gen.go @@ -0,0 +1,476 @@ +// +build ignore + +package main + +import ( + "bytes" + "fmt" + "go/ast" + "go/parser" + "go/printer" + "go/token" + "io" + "io/ioutil" + "log" + "os" + "reflect" + "strings" + "unicode" + "unicode/utf8" +) + +var inFiles = []string{"cpuid.go", "cpuid_test.go"} +var copyFiles = []string{"cpuid_amd64.s", "cpuid_386.s", "detect_ref.go", "detect_intel.go"} +var fileSet = token.NewFileSet() +var reWrites = []rewrite{ + initRewrite("CPUInfo -> cpuInfo"), + initRewrite("Vendor -> vendor"), + initRewrite("Flags -> flags"), + initRewrite("Detect -> detect"), + initRewrite("CPU -> cpu"), +} +var excludeNames = map[string]bool{"string": true, "join": true, "trim": true, + // cpuid_test.go + "t": true, "println": true, "logf": true, "log": true, "fatalf": true, "fatal": true, +} + +var excludePrefixes = []string{"test", "benchmark"} + +func main() { + Package := "private" + parserMode := parser.ParseComments + exported := make(map[string]rewrite) + for _, file := range inFiles { + in, err := os.Open(file) + if err != nil { + log.Fatalf("opening input", err) + } + + src, err := ioutil.ReadAll(in) + if err != nil { + log.Fatalf("reading input", err) + } + + astfile, err := parser.ParseFile(fileSet, file, src, parserMode) + if err != nil { + log.Fatalf("parsing input", err) + } + + for _, rw := range reWrites { + astfile = rw(astfile) + } + + // Inspect the AST and print all identifiers and literals. + var startDecl token.Pos + var endDecl token.Pos + ast.Inspect(astfile, func(n ast.Node) bool { + var s string + switch x := n.(type) { + case *ast.Ident: + if x.IsExported() { + t := strings.ToLower(x.Name) + for _, pre := range excludePrefixes { + if strings.HasPrefix(t, pre) { + return true + } + } + if excludeNames[t] != true { + //if x.Pos() > startDecl && x.Pos() < endDecl { + exported[x.Name] = initRewrite(x.Name + " -> " + t) + } + } + + case *ast.GenDecl: + if x.Tok == token.CONST && x.Lparen > 0 { + startDecl = x.Lparen + endDecl = x.Rparen + // fmt.Printf("Decl:%s -> %s\n", fileSet.Position(startDecl), fileSet.Position(endDecl)) + } + } + if s != "" { + fmt.Printf("%s:\t%s\n", fileSet.Position(n.Pos()), s) + } + return true + }) + + for _, rw := range exported { + astfile = rw(astfile) + } + + var buf bytes.Buffer + + printer.Fprint(&buf, fileSet, astfile) + + // Remove package documentation and insert information + s := buf.String() + ind := strings.Index(buf.String(), "\npackage cpuid") + s = s[ind:] + s = "// Generated, DO NOT EDIT,\n" + + "// but copy it to your own project and rename the package.\n" + + "// See more at http://github.com/klauspost/cpuid\n" + + s + + outputName := Package + string(os.PathSeparator) + file + + err = ioutil.WriteFile(outputName, []byte(s), 0644) + if err != nil { + log.Fatalf("writing output: %s", err) + } + log.Println("Generated", outputName) + } + + for _, file := range copyFiles { + dst := "" + if strings.HasPrefix(file, "cpuid") { + dst = Package + string(os.PathSeparator) + file + } else { + dst = Package + string(os.PathSeparator) + "cpuid_" + file + } + err := copyFile(file, dst) + if err != nil { + log.Fatalf("copying file: %s", err) + } + log.Println("Copied", dst) + } +} + +// CopyFile copies a file from src to dst. If src and dst files exist, and are +// the same, then return success. Copy the file contents from src to dst. +func copyFile(src, dst string) (err error) { + sfi, err := os.Stat(src) + if err != nil { + return + } + if !sfi.Mode().IsRegular() { + // cannot copy non-regular files (e.g., directories, + // symlinks, devices, etc.) + return fmt.Errorf("CopyFile: non-regular source file %s (%q)", sfi.Name(), sfi.Mode().String()) + } + dfi, err := os.Stat(dst) + if err != nil { + if !os.IsNotExist(err) { + return + } + } else { + if !(dfi.Mode().IsRegular()) { + return fmt.Errorf("CopyFile: non-regular destination file %s (%q)", dfi.Name(), dfi.Mode().String()) + } + if os.SameFile(sfi, dfi) { + return + } + } + err = copyFileContents(src, dst) + return +} + +// copyFileContents copies the contents of the file named src to the file named +// by dst. The file will be created if it does not already exist. If the +// destination file exists, all it's contents will be replaced by the contents +// of the source file. +func copyFileContents(src, dst string) (err error) { + in, err := os.Open(src) + if err != nil { + return + } + defer in.Close() + out, err := os.Create(dst) + if err != nil { + return + } + defer func() { + cerr := out.Close() + if err == nil { + err = cerr + } + }() + if _, err = io.Copy(out, in); err != nil { + return + } + err = out.Sync() + return +} + +type rewrite func(*ast.File) *ast.File + +// Mostly copied from gofmt +func initRewrite(rewriteRule string) rewrite { + f := strings.Split(rewriteRule, "->") + if len(f) != 2 { + fmt.Fprintf(os.Stderr, "rewrite rule must be of the form 'pattern -> replacement'\n") + os.Exit(2) + } + pattern := parseExpr(f[0], "pattern") + replace := parseExpr(f[1], "replacement") + return func(p *ast.File) *ast.File { return rewriteFile(pattern, replace, p) } +} + +// parseExpr parses s as an expression. +// It might make sense to expand this to allow statement patterns, +// but there are problems with preserving formatting and also +// with what a wildcard for a statement looks like. +func parseExpr(s, what string) ast.Expr { + x, err := parser.ParseExpr(s) + if err != nil { + fmt.Fprintf(os.Stderr, "parsing %s %s at %s\n", what, s, err) + os.Exit(2) + } + return x +} + +// Keep this function for debugging. +/* +func dump(msg string, val reflect.Value) { + fmt.Printf("%s:\n", msg) + ast.Print(fileSet, val.Interface()) + fmt.Println() +} +*/ + +// rewriteFile applies the rewrite rule 'pattern -> replace' to an entire file. +func rewriteFile(pattern, replace ast.Expr, p *ast.File) *ast.File { + cmap := ast.NewCommentMap(fileSet, p, p.Comments) + m := make(map[string]reflect.Value) + pat := reflect.ValueOf(pattern) + repl := reflect.ValueOf(replace) + + var rewriteVal func(val reflect.Value) reflect.Value + rewriteVal = func(val reflect.Value) reflect.Value { + // don't bother if val is invalid to start with + if !val.IsValid() { + return reflect.Value{} + } + for k := range m { + delete(m, k) + } + val = apply(rewriteVal, val) + if match(m, pat, val) { + val = subst(m, repl, reflect.ValueOf(val.Interface().(ast.Node).Pos())) + } + return val + } + + r := apply(rewriteVal, reflect.ValueOf(p)).Interface().(*ast.File) + r.Comments = cmap.Filter(r).Comments() // recreate comments list + return r +} + +// set is a wrapper for x.Set(y); it protects the caller from panics if x cannot be changed to y. +func set(x, y reflect.Value) { + // don't bother if x cannot be set or y is invalid + if !x.CanSet() || !y.IsValid() { + return + } + defer func() { + if x := recover(); x != nil { + if s, ok := x.(string); ok && + (strings.Contains(s, "type mismatch") || strings.Contains(s, "not assignable")) { + // x cannot be set to y - ignore this rewrite + return + } + panic(x) + } + }() + x.Set(y) +} + +// Values/types for special cases. +var ( + objectPtrNil = reflect.ValueOf((*ast.Object)(nil)) + scopePtrNil = reflect.ValueOf((*ast.Scope)(nil)) + + identType = reflect.TypeOf((*ast.Ident)(nil)) + objectPtrType = reflect.TypeOf((*ast.Object)(nil)) + positionType = reflect.TypeOf(token.NoPos) + callExprType = reflect.TypeOf((*ast.CallExpr)(nil)) + scopePtrType = reflect.TypeOf((*ast.Scope)(nil)) +) + +// apply replaces each AST field x in val with f(x), returning val. +// To avoid extra conversions, f operates on the reflect.Value form. +func apply(f func(reflect.Value) reflect.Value, val reflect.Value) reflect.Value { + if !val.IsValid() { + return reflect.Value{} + } + + // *ast.Objects introduce cycles and are likely incorrect after + // rewrite; don't follow them but replace with nil instead + if val.Type() == objectPtrType { + return objectPtrNil + } + + // similarly for scopes: they are likely incorrect after a rewrite; + // replace them with nil + if val.Type() == scopePtrType { + return scopePtrNil + } + + switch v := reflect.Indirect(val); v.Kind() { + case reflect.Slice: + for i := 0; i < v.Len(); i++ { + e := v.Index(i) + set(e, f(e)) + } + case reflect.Struct: + for i := 0; i < v.NumField(); i++ { + e := v.Field(i) + set(e, f(e)) + } + case reflect.Interface: + e := v.Elem() + set(v, f(e)) + } + return val +} + +func isWildcard(s string) bool { + rune, size := utf8.DecodeRuneInString(s) + return size == len(s) && unicode.IsLower(rune) +} + +// match returns true if pattern matches val, +// recording wildcard submatches in m. +// If m == nil, match checks whether pattern == val. +func match(m map[string]reflect.Value, pattern, val reflect.Value) bool { + // Wildcard matches any expression. If it appears multiple + // times in the pattern, it must match the same expression + // each time. + if m != nil && pattern.IsValid() && pattern.Type() == identType { + name := pattern.Interface().(*ast.Ident).Name + if isWildcard(name) && val.IsValid() { + // wildcards only match valid (non-nil) expressions. + if _, ok := val.Interface().(ast.Expr); ok && !val.IsNil() { + if old, ok := m[name]; ok { + return match(nil, old, val) + } + m[name] = val + return true + } + } + } + + // Otherwise, pattern and val must match recursively. + if !pattern.IsValid() || !val.IsValid() { + return !pattern.IsValid() && !val.IsValid() + } + if pattern.Type() != val.Type() { + return false + } + + // Special cases. + switch pattern.Type() { + case identType: + // For identifiers, only the names need to match + // (and none of the other *ast.Object information). + // This is a common case, handle it all here instead + // of recursing down any further via reflection. + p := pattern.Interface().(*ast.Ident) + v := val.Interface().(*ast.Ident) + return p == nil && v == nil || p != nil && v != nil && p.Name == v.Name + case objectPtrType, positionType: + // object pointers and token positions always match + return true + case callExprType: + // For calls, the Ellipsis fields (token.Position) must + // match since that is how f(x) and f(x...) are different. + // Check them here but fall through for the remaining fields. + p := pattern.Interface().(*ast.CallExpr) + v := val.Interface().(*ast.CallExpr) + if p.Ellipsis.IsValid() != v.Ellipsis.IsValid() { + return false + } + } + + p := reflect.Indirect(pattern) + v := reflect.Indirect(val) + if !p.IsValid() || !v.IsValid() { + return !p.IsValid() && !v.IsValid() + } + + switch p.Kind() { + case reflect.Slice: + if p.Len() != v.Len() { + return false + } + for i := 0; i < p.Len(); i++ { + if !match(m, p.Index(i), v.Index(i)) { + return false + } + } + return true + + case reflect.Struct: + for i := 0; i < p.NumField(); i++ { + if !match(m, p.Field(i), v.Field(i)) { + return false + } + } + return true + + case reflect.Interface: + return match(m, p.Elem(), v.Elem()) + } + + // Handle token integers, etc. + return p.Interface() == v.Interface() +} + +// subst returns a copy of pattern with values from m substituted in place +// of wildcards and pos used as the position of tokens from the pattern. +// if m == nil, subst returns a copy of pattern and doesn't change the line +// number information. +func subst(m map[string]reflect.Value, pattern reflect.Value, pos reflect.Value) reflect.Value { + if !pattern.IsValid() { + return reflect.Value{} + } + + // Wildcard gets replaced with map value. + if m != nil && pattern.Type() == identType { + name := pattern.Interface().(*ast.Ident).Name + if isWildcard(name) { + if old, ok := m[name]; ok { + return subst(nil, old, reflect.Value{}) + } + } + } + + if pos.IsValid() && pattern.Type() == positionType { + // use new position only if old position was valid in the first place + if old := pattern.Interface().(token.Pos); !old.IsValid() { + return pattern + } + return pos + } + + // Otherwise copy. + switch p := pattern; p.Kind() { + case reflect.Slice: + v := reflect.MakeSlice(p.Type(), p.Len(), p.Len()) + for i := 0; i < p.Len(); i++ { + v.Index(i).Set(subst(m, p.Index(i), pos)) + } + return v + + case reflect.Struct: + v := reflect.New(p.Type()).Elem() + for i := 0; i < p.NumField(); i++ { + v.Field(i).Set(subst(m, p.Field(i), pos)) + } + return v + + case reflect.Ptr: + v := reflect.New(p.Type()).Elem() + if elem := p.Elem(); elem.IsValid() { + v.Set(subst(m, elem, pos).Addr()) + } + return v + + case reflect.Interface: + v := reflect.New(p.Type()).Elem() + if elem := p.Elem(); elem.IsValid() { + v.Set(subst(m, elem, pos)) + } + return v + } + + return pattern +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/README.md b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/README.md new file mode 100644 index 00000000..57a68f88 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/README.md @@ -0,0 +1,6 @@ +# cpuid private + +This is a specially converted of the cpuid package, so it can be included in +a package without exporting anything. + +Package home: https://github.com/klauspost/cpuid diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid.go new file mode 100644 index 00000000..be99cb0b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid.go @@ -0,0 +1,987 @@ +// Generated, DO NOT EDIT, +// but copy it to your own project and rename the package. +// See more at http://github.com/klauspost/cpuid + +package cpuid + +import ( + "strings" +) + +// Vendor is a representation of a CPU vendor. +type vendor int + +const ( + other vendor = iota + intel + amd + via + transmeta + nsc + kvm // Kernel-based Virtual Machine + msvm // Microsoft Hyper-V or Windows Virtual PC + vmware + xenhvm +) + +const ( + cmov = 1 << iota // i686 CMOV + nx // NX (No-Execute) bit + amd3dnow // AMD 3DNOW + amd3dnowext // AMD 3DNowExt + mmx // standard MMX + mmxext // SSE integer functions or AMD MMX ext + sse // SSE functions + sse2 // P4 SSE functions + sse3 // Prescott SSE3 functions + ssse3 // Conroe SSSE3 functions + sse4 // Penryn SSE4.1 functions + sse4a // AMD Barcelona microarchitecture SSE4a instructions + sse42 // Nehalem SSE4.2 functions + avx // AVX functions + avx2 // AVX2 functions + fma3 // Intel FMA 3 + fma4 // Bulldozer FMA4 functions + xop // Bulldozer XOP functions + f16c // Half-precision floating-point conversion + bmi1 // Bit Manipulation Instruction Set 1 + bmi2 // Bit Manipulation Instruction Set 2 + tbm // AMD Trailing Bit Manipulation + lzcnt // LZCNT instruction + popcnt // POPCNT instruction + aesni // Advanced Encryption Standard New Instructions + clmul // Carry-less Multiplication + htt // Hyperthreading (enabled) + hle // Hardware Lock Elision + rtm // Restricted Transactional Memory + rdrand // RDRAND instruction is available + rdseed // RDSEED instruction is available + adx // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) + sha // Intel SHA Extensions + avx512f // AVX-512 Foundation + avx512dq // AVX-512 Doubleword and Quadword Instructions + avx512ifma // AVX-512 Integer Fused Multiply-Add Instructions + avx512pf // AVX-512 Prefetch Instructions + avx512er // AVX-512 Exponential and Reciprocal Instructions + avx512cd // AVX-512 Conflict Detection Instructions + avx512bw // AVX-512 Byte and Word Instructions + avx512vl // AVX-512 Vector Length Extensions + avx512vbmi // AVX-512 Vector Bit Manipulation Instructions + mpx // Intel MPX (Memory Protection Extensions) + erms // Enhanced REP MOVSB/STOSB + rdtscp // RDTSCP Instruction + cx16 // CMPXCHG16B Instruction + + // Performance indicators + sse2slow // SSE2 is supported, but usually not faster + sse3slow // SSE3 is supported, but usually not faster + atom // Atom processor, some SSSE3 instructions are slower +) + +var flagNames = map[flags]string{ + cmov: "CMOV", // i686 CMOV + nx: "NX", // NX (No-Execute) bit + amd3dnow: "AMD3DNOW", // AMD 3DNOW + amd3dnowext: "AMD3DNOWEXT", // AMD 3DNowExt + mmx: "MMX", // Standard MMX + mmxext: "MMXEXT", // SSE integer functions or AMD MMX ext + sse: "SSE", // SSE functions + sse2: "SSE2", // P4 SSE2 functions + sse3: "SSE3", // Prescott SSE3 functions + ssse3: "SSSE3", // Conroe SSSE3 functions + sse4: "SSE4.1", // Penryn SSE4.1 functions + sse4a: "SSE4A", // AMD Barcelona microarchitecture SSE4a instructions + sse42: "SSE4.2", // Nehalem SSE4.2 functions + avx: "AVX", // AVX functions + avx2: "AVX2", // AVX functions + fma3: "FMA3", // Intel FMA 3 + fma4: "FMA4", // Bulldozer FMA4 functions + xop: "XOP", // Bulldozer XOP functions + f16c: "F16C", // Half-precision floating-point conversion + bmi1: "BMI1", // Bit Manipulation Instruction Set 1 + bmi2: "BMI2", // Bit Manipulation Instruction Set 2 + tbm: "TBM", // AMD Trailing Bit Manipulation + lzcnt: "LZCNT", // LZCNT instruction + popcnt: "POPCNT", // POPCNT instruction + aesni: "AESNI", // Advanced Encryption Standard New Instructions + clmul: "CLMUL", // Carry-less Multiplication + htt: "HTT", // Hyperthreading (enabled) + hle: "HLE", // Hardware Lock Elision + rtm: "RTM", // Restricted Transactional Memory + rdrand: "RDRAND", // RDRAND instruction is available + rdseed: "RDSEED", // RDSEED instruction is available + adx: "ADX", // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) + sha: "SHA", // Intel SHA Extensions + avx512f: "AVX512F", // AVX-512 Foundation + avx512dq: "AVX512DQ", // AVX-512 Doubleword and Quadword Instructions + avx512ifma: "AVX512IFMA", // AVX-512 Integer Fused Multiply-Add Instructions + avx512pf: "AVX512PF", // AVX-512 Prefetch Instructions + avx512er: "AVX512ER", // AVX-512 Exponential and Reciprocal Instructions + avx512cd: "AVX512CD", // AVX-512 Conflict Detection Instructions + avx512bw: "AVX512BW", // AVX-512 Byte and Word Instructions + avx512vl: "AVX512VL", // AVX-512 Vector Length Extensions + avx512vbmi: "AVX512VBMI", // AVX-512 Vector Bit Manipulation Instructions + mpx: "MPX", // Intel MPX (Memory Protection Extensions) + erms: "ERMS", // Enhanced REP MOVSB/STOSB + rdtscp: "RDTSCP", // RDTSCP Instruction + cx16: "CX16", // CMPXCHG16B Instruction + + // Performance indicators + sse2slow: "SSE2SLOW", // SSE2 supported, but usually not faster + sse3slow: "SSE3SLOW", // SSE3 supported, but usually not faster + atom: "ATOM", // Atom processor, some SSSE3 instructions are slower + +} + +// CPUInfo contains information about the detected system CPU. +type cpuInfo struct { + brandname string // Brand name reported by the CPU + vendorid vendor // Comparable CPU vendor ID + features flags // Features of the CPU + physicalcores int // Number of physical processor cores in your CPU. Will be 0 if undetectable. + threadspercore int // Number of threads per physical core. Will be 1 if undetectable. + logicalcores int // Number of physical cores times threads that can run on each core through the use of hyperthreading. Will be 0 if undetectable. + family int // CPU family number + model int // CPU model number + cacheline int // Cache line size in bytes. Will be 0 if undetectable. + cache struct { + l1i int // L1 Instruction Cache (per core or shared). Will be -1 if undetected + l1d int // L1 Data Cache (per core or shared). Will be -1 if undetected + l2 int // L2 Cache (per core or shared). Will be -1 if undetected + l3 int // L3 Instruction Cache (per core or shared). Will be -1 if undetected + } + maxFunc uint32 + maxExFunc uint32 +} + +var cpuid func(op uint32) (eax, ebx, ecx, edx uint32) +var cpuidex func(op, op2 uint32) (eax, ebx, ecx, edx uint32) +var xgetbv func(index uint32) (eax, edx uint32) +var rdtscpAsm func() (eax, ebx, ecx, edx uint32) + +// CPU contains information about the CPU as detected on startup, +// or when Detect last was called. +// +// Use this as the primary entry point to you data, +// this way queries are +var cpu cpuInfo + +func init() { + initCPU() + detect() +} + +// Detect will re-detect current CPU info. +// This will replace the content of the exported CPU variable. +// +// Unless you expect the CPU to change while you are running your program +// you should not need to call this function. +// If you call this, you must ensure that no other goroutine is accessing the +// exported CPU variable. +func detect() { + cpu.maxFunc = maxFunctionID() + cpu.maxExFunc = maxExtendedFunction() + cpu.brandname = brandName() + cpu.cacheline = cacheLine() + cpu.family, cpu.model = familyModel() + cpu.features = support() + cpu.threadspercore = threadsPerCore() + cpu.logicalcores = logicalCores() + cpu.physicalcores = physicalCores() + cpu.vendorid = vendorID() + cpu.cacheSize() +} + +// Generated here: http://play.golang.org/p/BxFH2Gdc0G + +// Cmov indicates support of CMOV instructions +func (c cpuInfo) cmov() bool { + return c.features&cmov != 0 +} + +// Amd3dnow indicates support of AMD 3DNOW! instructions +func (c cpuInfo) amd3dnow() bool { + return c.features&amd3dnow != 0 +} + +// Amd3dnowExt indicates support of AMD 3DNOW! Extended instructions +func (c cpuInfo) amd3dnowext() bool { + return c.features&amd3dnowext != 0 +} + +// MMX indicates support of MMX instructions +func (c cpuInfo) mmx() bool { + return c.features&mmx != 0 +} + +// MMXExt indicates support of MMXEXT instructions +// (SSE integer functions or AMD MMX ext) +func (c cpuInfo) mmxext() bool { + return c.features&mmxext != 0 +} + +// SSE indicates support of SSE instructions +func (c cpuInfo) sse() bool { + return c.features&sse != 0 +} + +// SSE2 indicates support of SSE 2 instructions +func (c cpuInfo) sse2() bool { + return c.features&sse2 != 0 +} + +// SSE3 indicates support of SSE 3 instructions +func (c cpuInfo) sse3() bool { + return c.features&sse3 != 0 +} + +// SSSE3 indicates support of SSSE 3 instructions +func (c cpuInfo) ssse3() bool { + return c.features&ssse3 != 0 +} + +// SSE4 indicates support of SSE 4 (also called SSE 4.1) instructions +func (c cpuInfo) sse4() bool { + return c.features&sse4 != 0 +} + +// SSE42 indicates support of SSE4.2 instructions +func (c cpuInfo) sse42() bool { + return c.features&sse42 != 0 +} + +// AVX indicates support of AVX instructions +// and operating system support of AVX instructions +func (c cpuInfo) avx() bool { + return c.features&avx != 0 +} + +// AVX2 indicates support of AVX2 instructions +func (c cpuInfo) avx2() bool { + return c.features&avx2 != 0 +} + +// FMA3 indicates support of FMA3 instructions +func (c cpuInfo) fma3() bool { + return c.features&fma3 != 0 +} + +// FMA4 indicates support of FMA4 instructions +func (c cpuInfo) fma4() bool { + return c.features&fma4 != 0 +} + +// XOP indicates support of XOP instructions +func (c cpuInfo) xop() bool { + return c.features&xop != 0 +} + +// F16C indicates support of F16C instructions +func (c cpuInfo) f16c() bool { + return c.features&f16c != 0 +} + +// BMI1 indicates support of BMI1 instructions +func (c cpuInfo) bmi1() bool { + return c.features&bmi1 != 0 +} + +// BMI2 indicates support of BMI2 instructions +func (c cpuInfo) bmi2() bool { + return c.features&bmi2 != 0 +} + +// TBM indicates support of TBM instructions +// (AMD Trailing Bit Manipulation) +func (c cpuInfo) tbm() bool { + return c.features&tbm != 0 +} + +// Lzcnt indicates support of LZCNT instruction +func (c cpuInfo) lzcnt() bool { + return c.features&lzcnt != 0 +} + +// Popcnt indicates support of POPCNT instruction +func (c cpuInfo) popcnt() bool { + return c.features&popcnt != 0 +} + +// HTT indicates the processor has Hyperthreading enabled +func (c cpuInfo) htt() bool { + return c.features&htt != 0 +} + +// SSE2Slow indicates that SSE2 may be slow on this processor +func (c cpuInfo) sse2slow() bool { + return c.features&sse2slow != 0 +} + +// SSE3Slow indicates that SSE3 may be slow on this processor +func (c cpuInfo) sse3slow() bool { + return c.features&sse3slow != 0 +} + +// AesNi indicates support of AES-NI instructions +// (Advanced Encryption Standard New Instructions) +func (c cpuInfo) aesni() bool { + return c.features&aesni != 0 +} + +// Clmul indicates support of CLMUL instructions +// (Carry-less Multiplication) +func (c cpuInfo) clmul() bool { + return c.features&clmul != 0 +} + +// NX indicates support of NX (No-Execute) bit +func (c cpuInfo) nx() bool { + return c.features&nx != 0 +} + +// SSE4A indicates support of AMD Barcelona microarchitecture SSE4a instructions +func (c cpuInfo) sse4a() bool { + return c.features&sse4a != 0 +} + +// HLE indicates support of Hardware Lock Elision +func (c cpuInfo) hle() bool { + return c.features&hle != 0 +} + +// RTM indicates support of Restricted Transactional Memory +func (c cpuInfo) rtm() bool { + return c.features&rtm != 0 +} + +// Rdrand indicates support of RDRAND instruction is available +func (c cpuInfo) rdrand() bool { + return c.features&rdrand != 0 +} + +// Rdseed indicates support of RDSEED instruction is available +func (c cpuInfo) rdseed() bool { + return c.features&rdseed != 0 +} + +// ADX indicates support of Intel ADX (Multi-Precision Add-Carry Instruction Extensions) +func (c cpuInfo) adx() bool { + return c.features&adx != 0 +} + +// SHA indicates support of Intel SHA Extensions +func (c cpuInfo) sha() bool { + return c.features&sha != 0 +} + +// AVX512F indicates support of AVX-512 Foundation +func (c cpuInfo) avx512f() bool { + return c.features&avx512f != 0 +} + +// AVX512DQ indicates support of AVX-512 Doubleword and Quadword Instructions +func (c cpuInfo) avx512dq() bool { + return c.features&avx512dq != 0 +} + +// AVX512IFMA indicates support of AVX-512 Integer Fused Multiply-Add Instructions +func (c cpuInfo) avx512ifma() bool { + return c.features&avx512ifma != 0 +} + +// AVX512PF indicates support of AVX-512 Prefetch Instructions +func (c cpuInfo) avx512pf() bool { + return c.features&avx512pf != 0 +} + +// AVX512ER indicates support of AVX-512 Exponential and Reciprocal Instructions +func (c cpuInfo) avx512er() bool { + return c.features&avx512er != 0 +} + +// AVX512CD indicates support of AVX-512 Conflict Detection Instructions +func (c cpuInfo) avx512cd() bool { + return c.features&avx512cd != 0 +} + +// AVX512BW indicates support of AVX-512 Byte and Word Instructions +func (c cpuInfo) avx512bw() bool { + return c.features&avx512bw != 0 +} + +// AVX512VL indicates support of AVX-512 Vector Length Extensions +func (c cpuInfo) avx512vl() bool { + return c.features&avx512vl != 0 +} + +// AVX512VBMI indicates support of AVX-512 Vector Bit Manipulation Instructions +func (c cpuInfo) avx512vbmi() bool { + return c.features&avx512vbmi != 0 +} + +// MPX indicates support of Intel MPX (Memory Protection Extensions) +func (c cpuInfo) mpx() bool { + return c.features&mpx != 0 +} + +// ERMS indicates support of Enhanced REP MOVSB/STOSB +func (c cpuInfo) erms() bool { + return c.features&erms != 0 +} + +func (c cpuInfo) rdtscp() bool { + return c.features&rdtscp != 0 +} + +func (c cpuInfo) cx16() bool { + return c.features&cx16 != 0 +} + +// Atom indicates an Atom processor +func (c cpuInfo) atom() bool { + return c.features&atom != 0 +} + +// Intel returns true if vendor is recognized as Intel +func (c cpuInfo) intel() bool { + return c.vendorid == intel +} + +// AMD returns true if vendor is recognized as AMD +func (c cpuInfo) amd() bool { + return c.vendorid == amd +} + +// Transmeta returns true if vendor is recognized as Transmeta +func (c cpuInfo) transmeta() bool { + return c.vendorid == transmeta +} + +// NSC returns true if vendor is recognized as National Semiconductor +func (c cpuInfo) nsc() bool { + return c.vendorid == nsc +} + +// VIA returns true if vendor is recognized as VIA +func (c cpuInfo) via() bool { + return c.vendorid == via +} + +// RTCounter returns the 64-bit time-stamp counter +// Uses the RDTSCP instruction. The value 0 is returned +// if the CPU does not support the instruction. +func (c cpuInfo) rtcounter() uint64 { + if !c.rdtscp() { + return 0 + } + a, _, _, d := rdtscpAsm() + return uint64(a) | (uint64(d) << 32) +} + +// Ia32TscAux returns the IA32_TSC_AUX part of the RDTSCP. +// This variable is OS dependent, but on Linux contains information +// about the current cpu/core the code is running on. +// If the RDTSCP instruction isn't supported on the CPU, the value 0 is returned. +func (c cpuInfo) ia32tscaux() uint32 { + if !c.rdtscp() { + return 0 + } + _, _, ecx, _ := rdtscpAsm() + return ecx +} + +// LogicalCPU will return the Logical CPU the code is currently executing on. +// This is likely to change when the OS re-schedules the running thread +// to another CPU. +// If the current core cannot be detected, -1 will be returned. +func (c cpuInfo) logicalcpu() int { + if c.maxFunc < 1 { + return -1 + } + _, ebx, _, _ := cpuid(1) + return int(ebx >> 24) +} + +// VM Will return true if the cpu id indicates we are in +// a virtual machine. This is only a hint, and will very likely +// have many false negatives. +func (c cpuInfo) vm() bool { + switch c.vendorid { + case msvm, kvm, vmware, xenhvm: + return true + } + return false +} + +// Flags contains detected cpu features and caracteristics +type flags uint64 + +// String returns a string representation of the detected +// CPU features. +func (f flags) String() string { + return strings.Join(f.strings(), ",") +} + +// Strings returns and array of the detected features. +func (f flags) strings() []string { + s := support() + r := make([]string, 0, 20) + for i := uint(0); i < 64; i++ { + key := flags(1 << i) + val := flagNames[key] + if s&key != 0 { + r = append(r, val) + } + } + return r +} + +func maxExtendedFunction() uint32 { + eax, _, _, _ := cpuid(0x80000000) + return eax +} + +func maxFunctionID() uint32 { + a, _, _, _ := cpuid(0) + return a +} + +func brandName() string { + if maxExtendedFunction() >= 0x80000004 { + v := make([]uint32, 0, 48) + for i := uint32(0); i < 3; i++ { + a, b, c, d := cpuid(0x80000002 + i) + v = append(v, a, b, c, d) + } + return strings.Trim(string(valAsString(v...)), " ") + } + return "unknown" +} + +func threadsPerCore() int { + mfi := maxFunctionID() + if mfi < 0x4 || vendorID() != intel { + return 1 + } + + if mfi < 0xb { + _, b, _, d := cpuid(1) + if (d & (1 << 28)) != 0 { + // v will contain logical core count + v := (b >> 16) & 255 + if v > 1 { + a4, _, _, _ := cpuid(4) + // physical cores + v2 := (a4 >> 26) + 1 + if v2 > 0 { + return int(v) / int(v2) + } + } + } + return 1 + } + _, b, _, _ := cpuidex(0xb, 0) + if b&0xffff == 0 { + return 1 + } + return int(b & 0xffff) +} + +func logicalCores() int { + mfi := maxFunctionID() + switch vendorID() { + case intel: + // Use this on old Intel processors + if mfi < 0xb { + if mfi < 1 { + return 0 + } + // CPUID.1:EBX[23:16] represents the maximum number of addressable IDs (initial APIC ID) + // that can be assigned to logical processors in a physical package. + // The value may not be the same as the number of logical processors that are present in the hardware of a physical package. + _, ebx, _, _ := cpuid(1) + logical := (ebx >> 16) & 0xff + return int(logical) + } + _, b, _, _ := cpuidex(0xb, 1) + return int(b & 0xffff) + case amd: + _, b, _, _ := cpuid(1) + return int((b >> 16) & 0xff) + default: + return 0 + } +} + +func familyModel() (int, int) { + if maxFunctionID() < 0x1 { + return 0, 0 + } + eax, _, _, _ := cpuid(1) + family := ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff) + model := ((eax >> 4) & 0xf) + ((eax >> 12) & 0xf0) + return int(family), int(model) +} + +func physicalCores() int { + switch vendorID() { + case intel: + return logicalCores() / threadsPerCore() + case amd: + if maxExtendedFunction() >= 0x80000008 { + _, _, c, _ := cpuid(0x80000008) + return int(c&0xff) + 1 + } + } + return 0 +} + +// Except from http://en.wikipedia.org/wiki/CPUID#EAX.3D0:_Get_vendor_ID +var vendorMapping = map[string]vendor{ + "AMDisbetter!": amd, + "AuthenticAMD": amd, + "CentaurHauls": via, + "GenuineIntel": intel, + "TransmetaCPU": transmeta, + "GenuineTMx86": transmeta, + "Geode by NSC": nsc, + "VIA VIA VIA ": via, + "KVMKVMKVMKVM": kvm, + "Microsoft Hv": msvm, + "VMwareVMware": vmware, + "XenVMMXenVMM": xenhvm, +} + +func vendorID() vendor { + _, b, c, d := cpuid(0) + v := valAsString(b, d, c) + vend, ok := vendorMapping[string(v)] + if !ok { + return other + } + return vend +} + +func cacheLine() int { + if maxFunctionID() < 0x1 { + return 0 + } + + _, ebx, _, _ := cpuid(1) + cache := (ebx & 0xff00) >> 5 // cflush size + if cache == 0 && maxExtendedFunction() >= 0x80000006 { + _, _, ecx, _ := cpuid(0x80000006) + cache = ecx & 0xff // cacheline size + } + // TODO: Read from Cache and TLB Information + return int(cache) +} + +func (c *cpuInfo) cacheSize() { + c.cache.l1d = -1 + c.cache.l1i = -1 + c.cache.l2 = -1 + c.cache.l3 = -1 + vendor := vendorID() + switch vendor { + case intel: + if maxFunctionID() < 4 { + return + } + for i := uint32(0); ; i++ { + eax, ebx, ecx, _ := cpuidex(4, i) + cacheType := eax & 15 + if cacheType == 0 { + break + } + cacheLevel := (eax >> 5) & 7 + coherency := int(ebx&0xfff) + 1 + partitions := int((ebx>>12)&0x3ff) + 1 + associativity := int((ebx>>22)&0x3ff) + 1 + sets := int(ecx) + 1 + size := associativity * partitions * coherency * sets + switch cacheLevel { + case 1: + if cacheType == 1 { + // 1 = Data Cache + c.cache.l1d = size + } else if cacheType == 2 { + // 2 = Instruction Cache + c.cache.l1i = size + } else { + if c.cache.l1d < 0 { + c.cache.l1i = size + } + if c.cache.l1i < 0 { + c.cache.l1i = size + } + } + case 2: + c.cache.l2 = size + case 3: + c.cache.l3 = size + } + } + case amd: + // Untested. + if maxExtendedFunction() < 0x80000005 { + return + } + _, _, ecx, edx := cpuid(0x80000005) + c.cache.l1d = int(((ecx >> 24) & 0xFF) * 1024) + c.cache.l1i = int(((edx >> 24) & 0xFF) * 1024) + + if maxExtendedFunction() < 0x80000006 { + return + } + _, _, ecx, _ = cpuid(0x80000006) + c.cache.l2 = int(((ecx >> 16) & 0xFFFF) * 1024) + } + + return +} + +func support() flags { + mfi := maxFunctionID() + vend := vendorID() + if mfi < 0x1 { + return 0 + } + rval := uint64(0) + _, _, c, d := cpuid(1) + if (d & (1 << 15)) != 0 { + rval |= cmov + } + if (d & (1 << 23)) != 0 { + rval |= mmx + } + if (d & (1 << 25)) != 0 { + rval |= mmxext + } + if (d & (1 << 25)) != 0 { + rval |= sse + } + if (d & (1 << 26)) != 0 { + rval |= sse2 + } + if (c & 1) != 0 { + rval |= sse3 + } + if (c & 0x00000200) != 0 { + rval |= ssse3 + } + if (c & 0x00080000) != 0 { + rval |= sse4 + } + if (c & 0x00100000) != 0 { + rval |= sse42 + } + if (c & (1 << 25)) != 0 { + rval |= aesni + } + if (c & (1 << 1)) != 0 { + rval |= clmul + } + if c&(1<<23) != 0 { + rval |= popcnt + } + if c&(1<<30) != 0 { + rval |= rdrand + } + if c&(1<<29) != 0 { + rval |= f16c + } + if c&(1<<13) != 0 { + rval |= cx16 + } + if vend == intel && (d&(1<<28)) != 0 && mfi >= 4 { + if threadsPerCore() > 1 { + rval |= htt + } + } + + // Check XGETBV, OXSAVE and AVX bits + if c&(1<<26) != 0 && c&(1<<27) != 0 && c&(1<<28) != 0 { + // Check for OS support + eax, _ := xgetbv(0) + if (eax & 0x6) == 0x6 { + rval |= avx + if (c & 0x00001000) != 0 { + rval |= fma3 + } + } + } + + // Check AVX2, AVX2 requires OS support, but BMI1/2 don't. + if mfi >= 7 { + _, ebx, ecx, _ := cpuidex(7, 0) + if (rval&avx) != 0 && (ebx&0x00000020) != 0 { + rval |= avx2 + } + if (ebx & 0x00000008) != 0 { + rval |= bmi1 + if (ebx & 0x00000100) != 0 { + rval |= bmi2 + } + } + if ebx&(1<<4) != 0 { + rval |= hle + } + if ebx&(1<<9) != 0 { + rval |= erms + } + if ebx&(1<<11) != 0 { + rval |= rtm + } + if ebx&(1<<14) != 0 { + rval |= mpx + } + if ebx&(1<<18) != 0 { + rval |= rdseed + } + if ebx&(1<<19) != 0 { + rval |= adx + } + if ebx&(1<<29) != 0 { + rval |= sha + } + + // Only detect AVX-512 features if XGETBV is supported + if c&((1<<26)|(1<<27)) == (1<<26)|(1<<27) { + // Check for OS support + eax, _ := xgetbv(0) + + // Verify that XCR0[7:5] = ‘111b’ (OPMASK state, upper 256-bit of ZMM0-ZMM15 and + // ZMM16-ZMM31 state are enabled by OS) + /// and that XCR0[2:1] = ‘11b’ (XMM state and YMM state are enabled by OS). + if (eax>>5)&7 == 7 && (eax>>1)&3 == 3 { + if ebx&(1<<16) != 0 { + rval |= avx512f + } + if ebx&(1<<17) != 0 { + rval |= avx512dq + } + if ebx&(1<<21) != 0 { + rval |= avx512ifma + } + if ebx&(1<<26) != 0 { + rval |= avx512pf + } + if ebx&(1<<27) != 0 { + rval |= avx512er + } + if ebx&(1<<28) != 0 { + rval |= avx512cd + } + if ebx&(1<<30) != 0 { + rval |= avx512bw + } + if ebx&(1<<31) != 0 { + rval |= avx512vl + } + // ecx + if ecx&(1<<1) != 0 { + rval |= avx512vbmi + } + } + } + } + + if maxExtendedFunction() >= 0x80000001 { + _, _, c, d := cpuid(0x80000001) + if (c & (1 << 5)) != 0 { + rval |= lzcnt + rval |= popcnt + } + if (d & (1 << 31)) != 0 { + rval |= amd3dnow + } + if (d & (1 << 30)) != 0 { + rval |= amd3dnowext + } + if (d & (1 << 23)) != 0 { + rval |= mmx + } + if (d & (1 << 22)) != 0 { + rval |= mmxext + } + if (c & (1 << 6)) != 0 { + rval |= sse4a + } + if d&(1<<20) != 0 { + rval |= nx + } + if d&(1<<27) != 0 { + rval |= rdtscp + } + + /* Allow for selectively disabling SSE2 functions on AMD processors + with SSE2 support but not SSE4a. This includes Athlon64, some + Opteron, and some Sempron processors. MMX, SSE, or 3DNow! are faster + than SSE2 often enough to utilize this special-case flag. + AV_CPU_FLAG_SSE2 and AV_CPU_FLAG_SSE2SLOW are both set in this case + so that SSE2 is used unless explicitly disabled by checking + AV_CPU_FLAG_SSE2SLOW. */ + if vendorID() != intel && + rval&sse2 != 0 && (c&0x00000040) == 0 { + rval |= sse2slow + } + + /* XOP and FMA4 use the AVX instruction coding scheme, so they can't be + * used unless the OS has AVX support. */ + if (rval & avx) != 0 { + if (c & 0x00000800) != 0 { + rval |= xop + } + if (c & 0x00010000) != 0 { + rval |= fma4 + } + } + + if vendorID() == intel { + family, model := familyModel() + if family == 6 && (model == 9 || model == 13 || model == 14) { + /* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and + * 6/14 (core1 "yonah") theoretically support sse2, but it's + * usually slower than mmx. */ + if (rval & sse2) != 0 { + rval |= sse2slow + } + if (rval & sse3) != 0 { + rval |= sse3slow + } + } + /* The Atom processor has SSSE3 support, which is useful in many cases, + * but sometimes the SSSE3 version is slower than the SSE2 equivalent + * on the Atom, but is generally faster on other processors supporting + * SSSE3. This flag allows for selectively disabling certain SSSE3 + * functions on the Atom. */ + if family == 6 && model == 28 { + rval |= atom + } + } + } + return flags(rval) +} + +func valAsString(values ...uint32) []byte { + r := make([]byte, 4*len(values)) + for i, v := range values { + dst := r[i*4:] + dst[0] = byte(v & 0xff) + dst[1] = byte((v >> 8) & 0xff) + dst[2] = byte((v >> 16) & 0xff) + dst[3] = byte((v >> 24) & 0xff) + switch { + case dst[0] == 0: + return r[:i*4] + case dst[1] == 0: + return r[:i*4+1] + case dst[2] == 0: + return r[:i*4+2] + case dst[3] == 0: + return r[:i*4+3] + } + } + return r +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_386.s b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_386.s new file mode 100644 index 00000000..4d731711 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_386.s @@ -0,0 +1,42 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// +build 386,!gccgo + +// func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) +TEXT ·asmCpuid(SB), 7, $0 + XORL CX, CX + MOVL op+0(FP), AX + CPUID + MOVL AX, eax+4(FP) + MOVL BX, ebx+8(FP) + MOVL CX, ecx+12(FP) + MOVL DX, edx+16(FP) + RET + +// func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) +TEXT ·asmCpuidex(SB), 7, $0 + MOVL op+0(FP), AX + MOVL op2+4(FP), CX + CPUID + MOVL AX, eax+8(FP) + MOVL BX, ebx+12(FP) + MOVL CX, ecx+16(FP) + MOVL DX, edx+20(FP) + RET + +// func xgetbv(index uint32) (eax, edx uint32) +TEXT ·asmXgetbv(SB), 7, $0 + MOVL index+0(FP), CX + BYTE $0x0f; BYTE $0x01; BYTE $0xd0 // XGETBV + MOVL AX, eax+4(FP) + MOVL DX, edx+8(FP) + RET + +// func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) +TEXT ·asmRdtscpAsm(SB), 7, $0 + BYTE $0x0F; BYTE $0x01; BYTE $0xF9 // RDTSCP + MOVL AX, eax+0(FP) + MOVL BX, ebx+4(FP) + MOVL CX, ecx+8(FP) + MOVL DX, edx+12(FP) + RET diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_amd64.s b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_amd64.s new file mode 100644 index 00000000..3c1d60e4 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_amd64.s @@ -0,0 +1,42 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +//+build amd64,!gccgo + +// func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) +TEXT ·asmCpuid(SB), 7, $0 + XORQ CX, CX + MOVL op+0(FP), AX + CPUID + MOVL AX, eax+8(FP) + MOVL BX, ebx+12(FP) + MOVL CX, ecx+16(FP) + MOVL DX, edx+20(FP) + RET + +// func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) +TEXT ·asmCpuidex(SB), 7, $0 + MOVL op+0(FP), AX + MOVL op2+4(FP), CX + CPUID + MOVL AX, eax+8(FP) + MOVL BX, ebx+12(FP) + MOVL CX, ecx+16(FP) + MOVL DX, edx+20(FP) + RET + +// func asmXgetbv(index uint32) (eax, edx uint32) +TEXT ·asmXgetbv(SB), 7, $0 + MOVL index+0(FP), CX + BYTE $0x0f; BYTE $0x01; BYTE $0xd0 // XGETBV + MOVL AX, eax+8(FP) + MOVL DX, edx+12(FP) + RET + +// func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) +TEXT ·asmRdtscpAsm(SB), 7, $0 + BYTE $0x0F; BYTE $0x01; BYTE $0xF9 // RDTSCP + MOVL AX, eax+0(FP) + MOVL BX, ebx+4(FP) + MOVL CX, ecx+8(FP) + MOVL DX, edx+12(FP) + RET diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_detect_intel.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_detect_intel.go new file mode 100644 index 00000000..a5f04dd6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_detect_intel.go @@ -0,0 +1,17 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// +build 386,!gccgo amd64,!gccgo + +package cpuid + +func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) +func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) +func asmXgetbv(index uint32) (eax, edx uint32) +func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) + +func initCPU() { + cpuid = asmCpuid + cpuidex = asmCpuidex + xgetbv = asmXgetbv + rdtscpAsm = asmRdtscpAsm +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_detect_ref.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_detect_ref.go new file mode 100644 index 00000000..909c5d9a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/private/cpuid_detect_ref.go @@ -0,0 +1,23 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// +build !amd64,!386 gccgo + +package cpuid + +func initCPU() { + cpuid = func(op uint32) (eax, ebx, ecx, edx uint32) { + return 0, 0, 0, 0 + } + + cpuidex = func(op, op2 uint32) (eax, ebx, ecx, edx uint32) { + return 0, 0, 0, 0 + } + + xgetbv = func(index uint32) (eax, edx uint32) { + return 0, 0 + } + + rdtscpAsm = func() (eax, ebx, ecx, edx uint32) { + return 0, 0, 0, 0 + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/testdata/cpuid_data.zip b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/testdata/cpuid_data.zip new file mode 100644 index 00000000..509fd710 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/testdata/cpuid_data.zip differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/testdata/getall.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/testdata/getall.go new file mode 100644 index 00000000..9b51c7aa --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/cpuid/testdata/getall.go @@ -0,0 +1,77 @@ +package main + +import ( + "archive/zip" + _ "bytes" + "fmt" + "golang.org/x/net/html" + "io" + "net/http" + "os" + "strings" +) + +// Download all CPUID dumps from http://users.atw.hu/instlatx64/ +func main() { + resp, err := http.Get("http://users.atw.hu/instlatx64/?") + if err != nil { + panic(err) + } + + node, err := html.Parse(resp.Body) + if err != nil { + panic(err) + } + + file, err := os.Create("cpuid_data.zip") + if err != nil { + panic(err) + } + defer file.Close() + gw := zip.NewWriter(file) + + var f func(*html.Node) + f = func(n *html.Node) { + if n.Type == html.ElementNode && n.Data == "a" { + for _, a := range n.Attr { + if a.Key == "href" { + err := ParseURL(a.Val, gw) + if err != nil { + panic(err) + } + break + } + } + } + for c := n.FirstChild; c != nil; c = c.NextSibling { + f(c) + } + } + + f(node) + err = gw.Close() + if err != nil { + panic(err) + } +} + +func ParseURL(s string, gw *zip.Writer) error { + if strings.Contains(s, "CPUID.txt") { + fmt.Println("Adding", "http://users.atw.hu/instlatx64/"+s) + resp, err := http.Get("http://users.atw.hu/instlatx64/" + s) + if err != nil { + fmt.Println("Error getting ", s, ":", err) + } + defer resp.Body.Close() + w, err := gw.Create(s) + if err != nil { + return err + } + + _, err = io.Copy(w, resp.Body) + if err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/LICENSE new file mode 100644 index 00000000..4fd5963e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2015 Klaus Post + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/README.md b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/README.md new file mode 100644 index 00000000..440541c7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/README.md @@ -0,0 +1,84 @@ +# crc32 +CRC32 hash with x64 optimizations + +This package is a drop-in replacement for the standard library `hash/crc32` package, that features SSE 4.2 optimizations on x64 platforms, for a 10x speedup. + +[![Build Status](https://travis-ci.org/klauspost/crc32.svg?branch=master)](https://travis-ci.org/klauspost/crc32) + +# usage + +Install using `go get github.com/klauspost/crc32`. This library is based on Go 1.5 code and requires Go 1.3 or newer. + +Replace `import "hash/crc32"` with `import "github.com/klauspost/crc32"` and you are good to go. + +# changes + +* Dec 4, 2015: Uses the "slice-by-8" trick more extensively, which gives a 1.5 to 2.5x speedup if assembler is unavailable. + + +# performance + +For IEEE tables (the most common), there is approximately a factor 10 speedup with "CLMUL" (Carryless multiplication) instruction: +``` +benchmark old ns/op new ns/op delta +BenchmarkCrc32KB 99955 10258 -89.74% + +benchmark old MB/s new MB/s speedup +BenchmarkCrc32KB 327.83 3194.20 9.74x +``` + +For other tables and "CLMUL" capable machines the performance is the same as the standard library. + +Here are some detailed benchmarks, comparing to go 1.5 standard library with and without assembler enabled. + +``` +Std: Standard Go 1.5 library +Crc: Indicates IEEE type CRC. +40B: Size of each slice encoded. +NoAsm: Assembler was disabled (ie. not an AMD64 or SSE 4.2+ capable machine). +Castagnoli: Castagnoli CRC type. + +BenchmarkStdCrc40B-4 10000000 158 ns/op 252.88 MB/s +BenchmarkCrc40BNoAsm-4 20000000 105 ns/op 377.38 MB/s (slice8) +BenchmarkCrc40B-4 20000000 105 ns/op 378.77 MB/s (slice8) + +BenchmarkStdCrc1KB-4 500000 3604 ns/op 284.10 MB/s +BenchmarkCrc1KBNoAsm-4 1000000 1463 ns/op 699.79 MB/s (slice8) +BenchmarkCrc1KB-4 3000000 396 ns/op 2583.69 MB/s (asm) + +BenchmarkStdCrc8KB-4 200000 11417 ns/op 717.48 MB/s (slice8) +BenchmarkCrc8KBNoAsm-4 200000 11317 ns/op 723.85 MB/s (slice8) +BenchmarkCrc8KB-4 500000 2919 ns/op 2805.73 MB/s (asm) + +BenchmarkStdCrc32KB-4 30000 45749 ns/op 716.24 MB/s (slice8) +BenchmarkCrc32KBNoAsm-4 30000 45109 ns/op 726.42 MB/s (slice8) +BenchmarkCrc32KB-4 100000 11497 ns/op 2850.09 MB/s (asm) + +BenchmarkStdNoAsmCastagnol40B-4 10000000 161 ns/op 246.94 MB/s +BenchmarkStdCastagnoli40B-4 50000000 28.4 ns/op 1410.69 MB/s (asm) +BenchmarkCastagnoli40BNoAsm-4 20000000 100 ns/op 398.01 MB/s (slice8) +BenchmarkCastagnoli40B-4 50000000 28.2 ns/op 1419.54 MB/s (asm) + +BenchmarkStdNoAsmCastagnoli1KB-4 500000 3622 ns/op 282.67 MB/s +BenchmarkStdCastagnoli1KB-4 10000000 144 ns/op 7099.78 MB/s (asm) +BenchmarkCastagnoli1KBNoAsm-4 1000000 1475 ns/op 694.14 MB/s (slice8) +BenchmarkCastagnoli1KB-4 10000000 146 ns/op 6993.35 MB/s (asm) + +BenchmarkStdNoAsmCastagnoli8KB-4 50000 28781 ns/op 284.63 MB/s +BenchmarkStdCastagnoli8KB-4 1000000 1029 ns/op 7957.89 MB/s (asm) +BenchmarkCastagnoli8KBNoAsm-4 200000 11410 ns/op 717.94 MB/s (slice8) +BenchmarkCastagnoli8KB-4 1000000 1000 ns/op 8188.71 MB/s (asm) + +BenchmarkStdNoAsmCastagnoli32KB-4 10000 115426 ns/op 283.89 MB/s +BenchmarkStdCastagnoli32KB-4 300000 4065 ns/op 8059.13 MB/s (asm) +BenchmarkCastagnoli32KBNoAsm-4 30000 45171 ns/op 725.41 MB/s (slice8) +BenchmarkCastagnoli32KB-4 500000 4077 ns/op 8035.89 MB/s (asm) +``` + +The IEEE assembler optimizations has been submitted and will be part of the Go 1.6 standard library. + +However, the improved use of slice-by-8 has not, but will probably be submitted for Go 1.7. + +# license + +Standard Go license. Changes are Copyright (c) 2015 Klaus Post under same conditions. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32.go new file mode 100644 index 00000000..8d6ba5d3 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32.go @@ -0,0 +1,186 @@ +// Copyright 2009 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. + +// Package crc32 implements the 32-bit cyclic redundancy check, or CRC-32, +// checksum. See http://en.wikipedia.org/wiki/Cyclic_redundancy_check for +// information. +// +// Polynomials are represented in LSB-first form also known as reversed representation. +// +// See http://en.wikipedia.org/wiki/Mathematics_of_cyclic_redundancy_checks#Reversed_representations_and_reciprocal_polynomials +// for information. +package crc32 + +import ( + "hash" + "sync" +) + +// The size of a CRC-32 checksum in bytes. +const Size = 4 + +// Predefined polynomials. +const ( + // IEEE is by far and away the most common CRC-32 polynomial. + // Used by ethernet (IEEE 802.3), v.42, fddi, gzip, zip, png, ... + IEEE = 0xedb88320 + + // Castagnoli's polynomial, used in iSCSI. + // Has better error detection characteristics than IEEE. + // http://dx.doi.org/10.1109/26.231911 + Castagnoli = 0x82f63b78 + + // Koopman's polynomial. + // Also has better error detection characteristics than IEEE. + // http://dx.doi.org/10.1109/DSN.2002.1028931 + Koopman = 0xeb31d82e +) + +// Table is a 256-word table representing the polynomial for efficient processing. +type Table [256]uint32 + +// castagnoliTable points to a lazily initialized Table for the Castagnoli +// polynomial. MakeTable will always return this value when asked to make a +// Castagnoli table so we can compare against it to find when the caller is +// using this polynomial. +var castagnoliTable *Table +var castagnoliTable8 *slicing8Table +var castagnoliOnce sync.Once + +func castagnoliInit() { + castagnoliTable = makeTable(Castagnoli) + castagnoliTable8 = makeTable8(Castagnoli) +} + +// IEEETable is the table for the IEEE polynomial. +var IEEETable = makeTable(IEEE) + +// slicing8Table is array of 8 Tables +type slicing8Table [8]Table + +// ieeeTable8 is the slicing8Table for IEEE +var ieeeTable8 *slicing8Table +var ieeeTable8Once sync.Once + +// MakeTable returns a Table constructed from the specified polynomial. +// The contents of this Table must not be modified. +func MakeTable(poly uint32) *Table { + switch poly { + case IEEE: + return IEEETable + case Castagnoli: + castagnoliOnce.Do(castagnoliInit) + return castagnoliTable + } + return makeTable(poly) +} + +// makeTable returns the Table constructed from the specified polynomial. +func makeTable(poly uint32) *Table { + t := new(Table) + for i := 0; i < 256; i++ { + crc := uint32(i) + for j := 0; j < 8; j++ { + if crc&1 == 1 { + crc = (crc >> 1) ^ poly + } else { + crc >>= 1 + } + } + t[i] = crc + } + return t +} + +// makeTable8 returns slicing8Table constructed from the specified polynomial. +func makeTable8(poly uint32) *slicing8Table { + t := new(slicing8Table) + t[0] = *makeTable(poly) + for i := 0; i < 256; i++ { + crc := t[0][i] + for j := 1; j < 8; j++ { + crc = t[0][crc&0xFF] ^ (crc >> 8) + t[j][i] = crc + } + } + return t +} + +// digest represents the partial evaluation of a checksum. +type digest struct { + crc uint32 + tab *Table +} + +// New creates a new hash.Hash32 computing the CRC-32 checksum +// using the polynomial represented by the Table. +// Its Sum method will lay the value out in big-endian byte order. +func New(tab *Table) hash.Hash32 { return &digest{0, tab} } + +// NewIEEE creates a new hash.Hash32 computing the CRC-32 checksum +// using the IEEE polynomial. +// Its Sum method will lay the value out in big-endian byte order. +func NewIEEE() hash.Hash32 { return New(IEEETable) } + +func (d *digest) Size() int { return Size } + +func (d *digest) BlockSize() int { return 1 } + +func (d *digest) Reset() { d.crc = 0 } + +func update(crc uint32, tab *Table, p []byte) uint32 { + crc = ^crc + for _, v := range p { + crc = tab[byte(crc)^v] ^ (crc >> 8) + } + return ^crc +} + +// updateSlicingBy8 updates CRC using Slicing-by-8 +func updateSlicingBy8(crc uint32, tab *slicing8Table, p []byte) uint32 { + crc = ^crc + for len(p) > 8 { + crc ^= uint32(p[0]) | uint32(p[1])<<8 | uint32(p[2])<<16 | uint32(p[3])<<24 + crc = tab[0][p[7]] ^ tab[1][p[6]] ^ tab[2][p[5]] ^ tab[3][p[4]] ^ + tab[4][crc>>24] ^ tab[5][(crc>>16)&0xFF] ^ + tab[6][(crc>>8)&0xFF] ^ tab[7][crc&0xFF] + p = p[8:] + } + crc = ^crc + if len(p) == 0 { + return crc + } + return update(crc, &tab[0], p) +} + +// Update returns the result of adding the bytes in p to the crc. +func Update(crc uint32, tab *Table, p []byte) uint32 { + if tab == castagnoliTable { + return updateCastagnoli(crc, p) + } + if tab == IEEETable { + return updateIEEE(crc, p) + } + return update(crc, tab, p) +} + +func (d *digest) Write(p []byte) (n int, err error) { + d.crc = Update(d.crc, d.tab, p) + return len(p), nil +} + +func (d *digest) Sum32() uint32 { return d.crc } + +func (d *digest) Sum(in []byte) []byte { + s := d.Sum32() + return append(in, byte(s>>24), byte(s>>16), byte(s>>8), byte(s)) +} + +// Checksum returns the CRC-32 checksum of data +// using the polynomial represented by the Table. +func Checksum(data []byte, tab *Table) uint32 { return Update(0, tab, data) } + +// ChecksumIEEE returns the CRC-32 checksum of data +// using the IEEE polynomial. +func ChecksumIEEE(data []byte) uint32 { return updateIEEE(0, data) } diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64.go new file mode 100644 index 00000000..4827128e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64.go @@ -0,0 +1,62 @@ +// Copyright 2011 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 !appengine,!gccgo + +package crc32 + +// This file contains the code to call the SSE 4.2 version of the Castagnoli +// and IEEE CRC. + +// haveSSE41/haveSSE42/haveCLMUL are defined in crc_amd64.s and use +// CPUID to test for SSE 4.1, 4.2 and CLMUL support. +func haveSSE41() bool +func haveSSE42() bool +func haveCLMUL() bool + +// castagnoliSSE42 is defined in crc_amd64.s and uses the SSE4.2 CRC32 +// instruction. +//go:noescape +func castagnoliSSE42(crc uint32, p []byte) uint32 + +// ieeeCLMUL is defined in crc_amd64.s and uses the PCLMULQDQ +// instruction as well as SSE 4.1. +//go:noescape +func ieeeCLMUL(crc uint32, p []byte) uint32 + +var sse42 = haveSSE42() +var useFastIEEE = haveCLMUL() && haveSSE41() + +func updateCastagnoli(crc uint32, p []byte) uint32 { + if sse42 { + return castagnoliSSE42(crc, p) + } + // only use slicing-by-8 when input is >= 16 Bytes + if len(p) >= 16 { + return updateSlicingBy8(crc, castagnoliTable8, p) + } + return update(crc, castagnoliTable, p) +} + +func updateIEEE(crc uint32, p []byte) uint32 { + if useFastIEEE && len(p) >= 64 { + left := len(p) & 15 + do := len(p) - left + crc = ^ieeeCLMUL(^crc, p[:do]) + if left > 0 { + crc = update(crc, IEEETable, p[do:]) + } + return crc + } + + // only use slicing-by-8 when input is >= 16 Bytes + if len(p) >= 16 { + ieeeTable8Once.Do(func() { + ieeeTable8 = makeTable8(IEEE) + }) + return updateSlicingBy8(crc, ieeeTable8, p) + } + + return update(crc, IEEETable, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64.s b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64.s new file mode 100644 index 00000000..9bf05d89 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64.s @@ -0,0 +1,237 @@ +// Copyright 2011 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 gc + +#define NOSPLIT 4 +#define RODATA 8 + +// func castagnoliSSE42(crc uint32, p []byte) uint32 +TEXT ·castagnoliSSE42(SB), NOSPLIT, $0 + MOVL crc+0(FP), AX // CRC value + MOVQ p+8(FP), SI // data pointer + MOVQ p_len+16(FP), CX // len(p) + + NOTL AX + + // If there's less than 8 bytes to process, we do it byte-by-byte. + CMPQ CX, $8 + JL cleanup + + // Process individual bytes until the input is 8-byte aligned. +startup: + MOVQ SI, BX + ANDQ $7, BX + JZ aligned + + CRC32B (SI), AX + DECQ CX + INCQ SI + JMP startup + +aligned: + // The input is now 8-byte aligned and we can process 8-byte chunks. + CMPQ CX, $8 + JL cleanup + + CRC32Q (SI), AX + ADDQ $8, SI + SUBQ $8, CX + JMP aligned + +cleanup: + // We may have some bytes left over that we process one at a time. + CMPQ CX, $0 + JE done + + CRC32B (SI), AX + INCQ SI + DECQ CX + JMP cleanup + +done: + NOTL AX + MOVL AX, ret+32(FP) + RET + +// func haveSSE42() bool +TEXT ·haveSSE42(SB), NOSPLIT, $0 + XORQ AX, AX + INCL AX + CPUID + SHRQ $20, CX + ANDQ $1, CX + MOVB CX, ret+0(FP) + RET + +// func haveCLMUL() bool +TEXT ·haveCLMUL(SB), NOSPLIT, $0 + XORQ AX, AX + INCL AX + CPUID + SHRQ $1, CX + ANDQ $1, CX + MOVB CX, ret+0(FP) + RET + +// func haveSSE41() bool +TEXT ·haveSSE41(SB), NOSPLIT, $0 + XORQ AX, AX + INCL AX + CPUID + SHRQ $19, CX + ANDQ $1, CX + MOVB CX, ret+0(FP) + RET + +// CRC32 polynomial data +// +// These constants are lifted from the +// Linux kernel, since they avoid the costly +// PSHUFB 16 byte reversal proposed in the +// original Intel paper. +DATA r2r1kp<>+0(SB)/8, $0x154442bd4 +DATA r2r1kp<>+8(SB)/8, $0x1c6e41596 +DATA r4r3kp<>+0(SB)/8, $0x1751997d0 +DATA r4r3kp<>+8(SB)/8, $0x0ccaa009e +DATA rupolykp<>+0(SB)/8, $0x1db710641 +DATA rupolykp<>+8(SB)/8, $0x1f7011641 +DATA r5kp<>+0(SB)/8, $0x163cd6124 + +GLOBL r2r1kp<>(SB), RODATA, $16 +GLOBL r4r3kp<>(SB), RODATA, $16 +GLOBL rupolykp<>(SB), RODATA, $16 +GLOBL r5kp<>(SB), RODATA, $8 + +// Based on http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf +// len(p) must be at least 64, and must be a multiple of 16. + +// func ieeeCLMUL(crc uint32, p []byte) uint32 +TEXT ·ieeeCLMUL(SB), NOSPLIT, $0 + MOVL crc+0(FP), X0 // Initial CRC value + MOVQ p+8(FP), SI // data pointer + MOVQ p_len+16(FP), CX // len(p) + + MOVOU (SI), X1 + MOVOU 16(SI), X2 + MOVOU 32(SI), X3 + MOVOU 48(SI), X4 + PXOR X0, X1 + ADDQ $64, SI // buf+=64 + SUBQ $64, CX // len-=64 + CMPQ CX, $64 // Less than 64 bytes left + JB remain64 + + MOVOA r2r1kp<>+0(SB), X0 + +loopback64: + MOVOA X1, X5 + MOVOA X2, X6 + MOVOA X3, X7 + MOVOA X4, X8 + + PCLMULQDQ $0, X0, X1 + PCLMULQDQ $0, X0, X2 + PCLMULQDQ $0, X0, X3 + PCLMULQDQ $0, X0, X4 + + // Load next early + MOVOU (SI), X11 + MOVOU 16(SI), X12 + MOVOU 32(SI), X13 + MOVOU 48(SI), X14 + + PCLMULQDQ $0x11, X0, X5 + PCLMULQDQ $0x11, X0, X6 + PCLMULQDQ $0x11, X0, X7 + PCLMULQDQ $0x11, X0, X8 + + PXOR X5, X1 + PXOR X6, X2 + PXOR X7, X3 + PXOR X8, X4 + + PXOR X11, X1 + PXOR X12, X2 + PXOR X13, X3 + PXOR X14, X4 + + ADDQ $0x40, DI + ADDQ $64, SI // buf+=64 + SUBQ $64, CX // len-=64 + CMPQ CX, $64 // Less than 64 bytes left? + JGE loopback64 + + // Fold result into a single register (X1) +remain64: + MOVOA r4r3kp<>+0(SB), X0 + + MOVOA X1, X5 + PCLMULQDQ $0, X0, X1 + PCLMULQDQ $0x11, X0, X5 + PXOR X5, X1 + PXOR X2, X1 + + MOVOA X1, X5 + PCLMULQDQ $0, X0, X1 + PCLMULQDQ $0x11, X0, X5 + PXOR X5, X1 + PXOR X3, X1 + + MOVOA X1, X5 + PCLMULQDQ $0, X0, X1 + PCLMULQDQ $0x11, X0, X5 + PXOR X5, X1 + PXOR X4, X1 + + // More than 16 bytes left? + CMPQ CX, $16 + JB finish + + // Encode 16 bytes +remain16: + MOVOU (SI), X10 + MOVOA X1, X5 + PCLMULQDQ $0, X0, X1 + PCLMULQDQ $0x11, X0, X5 + PXOR X5, X1 + PXOR X10, X1 + SUBQ $16, CX + ADDQ $16, SI + CMPQ CX, $16 + JGE remain16 + +finish: + // Fold final result into 32 bits and return it + PCMPEQB X3, X3 + PCLMULQDQ $1, X1, X0 + PSRLDQ $8, X1 + PXOR X0, X1 + + MOVOA X1, X2 + MOVQ r5kp<>+0(SB), X0 + + // Creates 32 bit mask. Note that we don't care about upper half. + PSRLQ $32, X3 + + PSRLDQ $4, X2 + PAND X3, X1 + PCLMULQDQ $0, X0, X1 + PXOR X2, X1 + + MOVOA rupolykp<>+0(SB), X0 + + MOVOA X1, X2 + PAND X3, X1 + PCLMULQDQ $0x10, X0, X1 + PAND X3, X1 + PCLMULQDQ $0, X0, X1 + PXOR X2, X1 + + // PEXTRD $1, X1, AX (SSE 4.1) + BYTE $0x66; BYTE $0x0f; BYTE $0x3a + BYTE $0x16; BYTE $0xc8; BYTE $0x01 + MOVL AX, ret+32(FP) + + RET diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64p32.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64p32.go new file mode 100644 index 00000000..926473e7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64p32.go @@ -0,0 +1,40 @@ +// Copyright 2011 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 !appengine,!gccgo + +package crc32 + +// This file contains the code to call the SSE 4.2 version of the Castagnoli +// CRC. + +// haveSSE42 is defined in crc_amd64p32.s and uses CPUID to test for SSE 4.2 +// support. +func haveSSE42() bool + +// castagnoliSSE42 is defined in crc_amd64.s and uses the SSE4.2 CRC32 +// instruction. +//go:noescape +func castagnoliSSE42(crc uint32, p []byte) uint32 + +var sse42 = haveSSE42() + +func updateCastagnoli(crc uint32, p []byte) uint32 { + if sse42 { + return castagnoliSSE42(crc, p) + } + return update(crc, castagnoliTable, p) +} + +func updateIEEE(crc uint32, p []byte) uint32 { + // only use slicing-by-8 when input is >= 4KB + if len(p) >= 4096 { + ieeeTable8Once.Do(func() { + ieeeTable8 = makeTable8(IEEE) + }) + return updateSlicingBy8(crc, ieeeTable8, p) + } + + return update(crc, IEEETable, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64p32.s b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64p32.s new file mode 100644 index 00000000..a578d685 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_amd64p32.s @@ -0,0 +1,67 @@ +// Copyright 2011 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 gc + +#define NOSPLIT 4 +#define RODATA 8 + +// func castagnoliSSE42(crc uint32, p []byte) uint32 +TEXT ·castagnoliSSE42(SB), NOSPLIT, $0 + MOVL crc+0(FP), AX // CRC value + MOVL p+4(FP), SI // data pointer + MOVL p_len+8(FP), CX // len(p) + + NOTL AX + + // If there's less than 8 bytes to process, we do it byte-by-byte. + CMPQ CX, $8 + JL cleanup + + // Process individual bytes until the input is 8-byte aligned. +startup: + MOVQ SI, BX + ANDQ $7, BX + JZ aligned + + CRC32B (SI), AX + DECQ CX + INCQ SI + JMP startup + +aligned: + // The input is now 8-byte aligned and we can process 8-byte chunks. + CMPQ CX, $8 + JL cleanup + + CRC32Q (SI), AX + ADDQ $8, SI + SUBQ $8, CX + JMP aligned + +cleanup: + // We may have some bytes left over that we process one at a time. + CMPQ CX, $0 + JE done + + CRC32B (SI), AX + INCQ SI + DECQ CX + JMP cleanup + +done: + NOTL AX + MOVL AX, ret+16(FP) + RET + +// func haveSSE42() bool +TEXT ·haveSSE42(SB), NOSPLIT, $0 + XORQ AX, AX + INCL AX + CPUID + SHRQ $20, CX + ANDQ $1, CX + MOVB CX, ret+0(FP) + RET + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_generic.go b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_generic.go new file mode 100644 index 00000000..a53cf96a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/klauspost/crc32/crc32_generic.go @@ -0,0 +1,29 @@ +// Copyright 2011 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 !amd64,!amd64p32 appengine gccgo + +package crc32 + +// This file contains the generic version of updateCastagnoli which does +// slicing-by-8, or uses the fallback for very small sizes. + +func updateCastagnoli(crc uint32, p []byte) uint32 { + // only use slicing-by-8 when input is >= 16 Bytes + if len(p) >= 16 { + return updateSlicingBy8(crc, castagnoliTable8, p) + } + return update(crc, castagnoliTable, p) +} + +func updateIEEE(crc uint32, p []byte) uint32 { + // only use slicing-by-8 when input is >= 16 Bytes + if len(p) >= 16 { + ieeeTable8Once.Do(func() { + ieeeTable8 = makeTable8(IEEE) + }) + return updateSlicingBy8(crc, ieeeTable8, p) + } + return update(crc, IEEETable, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/AUTHORS b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/AUTHORS new file mode 100644 index 00000000..19656835 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/AUTHORS @@ -0,0 +1 @@ +Miek Gieben diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/CONTRIBUTORS b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/CONTRIBUTORS new file mode 100644 index 00000000..f77e8a89 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/CONTRIBUTORS @@ -0,0 +1,9 @@ +Alex A. Skinner +Andrew Tunnell-Jones +Ask Bjørn Hansen +Dave Cheney +Dusty Wilson +Marek Majkowski +Peter van Dijk +Omri Bahumi +Alex Sergeyev diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/COPYRIGHT b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/COPYRIGHT new file mode 100644 index 00000000..35702b10 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/COPYRIGHT @@ -0,0 +1,9 @@ +Copyright 2009 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. +Extensions of the original work are copyright (c) 2011 Miek Gieben + +Copyright 2011 Miek Gieben. All rights reserved. Use of this source code is +governed by a BSD-style license that can be found in the LICENSE file. + +Copyright 2014 CloudFlare. All rights reserved. Use of this source code is +governed by a BSD-style license that can be found in the LICENSE file. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/LICENSE new file mode 100644 index 00000000..5763fa7f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/LICENSE @@ -0,0 +1,32 @@ +Extensions of the original work are copyright (c) 2011 Miek Gieben + +As this is fork of the official Go code the same license applies: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/README.md b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/README.md new file mode 100644 index 00000000..83b4183e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/README.md @@ -0,0 +1,151 @@ +[![Build Status](https://travis-ci.org/miekg/dns.svg?branch=master)](https://travis-ci.org/miekg/dns) + +# Alternative (more granular) approach to a DNS library + +> Less is more. + +Complete and usable DNS library. All widely used Resource Records are +supported, including the DNSSEC types. It follows a lean and mean philosophy. +If there is stuff you should know as a DNS programmer there isn't a convenience +function for it. Server side and client side programming is supported, i.e. you +can build servers and resolvers with it. + +We try to keep the "master" branch as sane as possible and at the bleeding edge +of standards, avoiding breaking changes wherever reasonable. We support the last +two versions of Go, currently: 1.5 and 1.6. + +# Goals + +* KISS; +* Fast; +* Small API, if its easy to code in Go, don't make a function for it. + +# Users + +A not-so-up-to-date-list-that-may-be-actually-current: + +* https://cloudflare.com +* https://github.com/abh/geodns +* http://www.statdns.com/ +* http://www.dnsinspect.com/ +* https://github.com/chuangbo/jianbing-dictionary-dns +* http://www.dns-lg.com/ +* https://github.com/fcambus/rrda +* https://github.com/kenshinx/godns +* https://github.com/skynetservices/skydns +* https://github.com/hashicorp/consul +* https://github.com/DevelopersPL/godnsagent +* https://github.com/duedil-ltd/discodns +* https://github.com/StalkR/dns-reverse-proxy +* https://github.com/tianon/rawdns +* https://mesosphere.github.io/mesos-dns/ +* https://pulse.turbobytes.com/ +* https://play.google.com/store/apps/details?id=com.turbobytes.dig +* https://github.com/fcambus/statzone +* https://github.com/benschw/dns-clb-go +* https://github.com/corny/dnscheck for http://public-dns.info/ +* https://namesmith.io +* https://github.com/miekg/unbound +* https://github.com/miekg/exdns +* https://dnslookup.org +* https://github.com/looterz/grimd +* https://github.com/phamhongviet/serf-dns + +Send pull request if you want to be listed here. + +# Features + +* UDP/TCP queries, IPv4 and IPv6; +* RFC 1035 zone file parsing ($INCLUDE, $ORIGIN, $TTL and $GENERATE (for all record types) are supported; +* Fast: + * Reply speed around ~ 80K qps (faster hardware results in more qps); + * Parsing RRs ~ 100K RR/s, that's 5M records in about 50 seconds; +* Server side programming (mimicking the net/http package); +* Client side programming; +* DNSSEC: signing, validating and key generation for DSA, RSA and ECDSA; +* EDNS0, NSID, Cookies; +* AXFR/IXFR; +* TSIG, SIG(0); +* DNS over TLS: optional encrypted connection between client and server; +* DNS name compression; +* Depends only on the standard library. + +Have fun! + +Miek Gieben - 2010-2012 - + +# Building + +Building is done with the `go` tool. If you have setup your GOPATH +correctly, the following should work: + + go get github.com/miekg/dns + go build github.com/miekg/dns + +## Examples + +A short "how to use the API" is at the beginning of doc.go (this also will show +when you call `godoc github.com/miekg/dns`). + +Example programs can be found in the `github.com/miekg/exdns` repository. + +## Supported RFCs + +*all of them* + +* 103{4,5} - DNS standard +* 1348 - NSAP record (removed the record) +* 1982 - Serial Arithmetic +* 1876 - LOC record +* 1995 - IXFR +* 1996 - DNS notify +* 2136 - DNS Update (dynamic updates) +* 2181 - RRset definition - there is no RRset type though, just []RR +* 2537 - RSAMD5 DNS keys +* 2065 - DNSSEC (updated in later RFCs) +* 2671 - EDNS record +* 2782 - SRV record +* 2845 - TSIG record +* 2915 - NAPTR record +* 2929 - DNS IANA Considerations +* 3110 - RSASHA1 DNS keys +* 3225 - DO bit (DNSSEC OK) +* 340{1,2,3} - NAPTR record +* 3445 - Limiting the scope of (DNS)KEY +* 3597 - Unknown RRs +* 403{3,4,5} - DNSSEC + validation functions +* 4255 - SSHFP record +* 4343 - Case insensitivity +* 4408 - SPF record +* 4509 - SHA256 Hash in DS +* 4592 - Wildcards in the DNS +* 4635 - HMAC SHA TSIG +* 4701 - DHCID +* 4892 - id.server +* 5001 - NSID +* 5155 - NSEC3 record +* 5205 - HIP record +* 5702 - SHA2 in the DNS +* 5936 - AXFR +* 5966 - TCP implementation recommendations +* 6605 - ECDSA +* 6725 - IANA Registry Update +* 6742 - ILNP DNS +* 6840 - Clarifications and Implementation Notes for DNS Security +* 6844 - CAA record +* 6891 - EDNS0 update +* 6895 - DNS IANA considerations +* 6975 - Algorithm Understanding in DNSSEC +* 7043 - EUI48/EUI64 records +* 7314 - DNS (EDNS) EXPIRE Option +* 7553 - URI record +* 7858 - DNS over TLS: Initiation and Performance Considerations (draft) +* 7873 - Domain Name System (DNS) Cookies (draft-ietf-dnsop-cookies) +* xxxx - EDNS0 DNS Update Lease (draft) + +## Loosely based upon + +* `ldns` +* `NSD` +* `Net::DNS` +* `GRONG` diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/client.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/client.go new file mode 100644 index 00000000..1302e4e0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/client.go @@ -0,0 +1,455 @@ +package dns + +// A client implementation. + +import ( + "bytes" + "crypto/tls" + "encoding/binary" + "io" + "net" + "time" +) + +const dnsTimeout time.Duration = 2 * time.Second +const tcpIdleTimeout time.Duration = 8 * time.Second + +// A Conn represents a connection to a DNS server. +type Conn struct { + net.Conn // a net.Conn holding the connection + UDPSize uint16 // minimum receive buffer for UDP messages + TsigSecret map[string]string // secret(s) for Tsig map[], zonename must be fully qualified + rtt time.Duration + t time.Time + tsigRequestMAC string +} + +// A Client defines parameters for a DNS client. +type Client struct { + Net string // if "tcp" or "tcp-tls" (DNS over TLS) a TCP query will be initiated, otherwise an UDP one (default is "" for UDP) + UDPSize uint16 // minimum receive buffer for UDP messages + TLSConfig *tls.Config // TLS connection configuration + Timeout time.Duration // a cumulative timeout for dial, write and read, defaults to 0 (disabled) - overrides DialTimeout, ReadTimeout and WriteTimeout when non-zero + DialTimeout time.Duration // net.DialTimeout, defaults to 2 seconds - overridden by Timeout when that value is non-zero + ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections, defaults to 2 seconds - overridden by Timeout when that value is non-zero + WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections, defaults to 2 seconds - overridden by Timeout when that value is non-zero + TsigSecret map[string]string // secret(s) for Tsig map[], zonename must be fully qualified + SingleInflight bool // if true suppress multiple outstanding queries for the same Qname, Qtype and Qclass + group singleflight +} + +// Exchange performs a synchronous UDP query. It sends the message m to the address +// contained in a and waits for an reply. Exchange does not retry a failed query, nor +// will it fall back to TCP in case of truncation. +// See client.Exchange for more information on setting larger buffer sizes. +func Exchange(m *Msg, a string) (r *Msg, err error) { + var co *Conn + co, err = DialTimeout("udp", a, dnsTimeout) + if err != nil { + return nil, err + } + + defer co.Close() + + opt := m.IsEdns0() + // If EDNS0 is used use that for size. + if opt != nil && opt.UDPSize() >= MinMsgSize { + co.UDPSize = opt.UDPSize() + } + + co.SetWriteDeadline(time.Now().Add(dnsTimeout)) + if err = co.WriteMsg(m); err != nil { + return nil, err + } + + co.SetReadDeadline(time.Now().Add(dnsTimeout)) + r, err = co.ReadMsg() + if err == nil && r.Id != m.Id { + err = ErrId + } + return r, err +} + +// ExchangeConn performs a synchronous query. It sends the message m via the connection +// c and waits for a reply. The connection c is not closed by ExchangeConn. +// This function is going away, but can easily be mimicked: +// +// co := &dns.Conn{Conn: c} // c is your net.Conn +// co.WriteMsg(m) +// in, _ := co.ReadMsg() +// co.Close() +// +func ExchangeConn(c net.Conn, m *Msg) (r *Msg, err error) { + println("dns: this function is deprecated") + co := new(Conn) + co.Conn = c + if err = co.WriteMsg(m); err != nil { + return nil, err + } + r, err = co.ReadMsg() + if err == nil && r.Id != m.Id { + err = ErrId + } + return r, err +} + +// Exchange performs an synchronous query. It sends the message m to the address +// contained in a and waits for an reply. Basic use pattern with a *dns.Client: +// +// c := new(dns.Client) +// in, rtt, err := c.Exchange(message, "127.0.0.1:53") +// +// Exchange does not retry a failed query, nor will it fall back to TCP in +// case of truncation. +// It is up to the caller to create a message that allows for larger responses to be +// returned. Specifically this means adding an EDNS0 OPT RR that will advertise a larger +// buffer, see SetEdns0. Messsages without an OPT RR will fallback to the historic limit +// of 512 bytes. +func (c *Client) Exchange(m *Msg, a string) (r *Msg, rtt time.Duration, err error) { + if !c.SingleInflight { + return c.exchange(m, a) + } + // This adds a bunch of garbage, TODO(miek). + t := "nop" + if t1, ok := TypeToString[m.Question[0].Qtype]; ok { + t = t1 + } + cl := "nop" + if cl1, ok := ClassToString[m.Question[0].Qclass]; ok { + cl = cl1 + } + r, rtt, err, shared := c.group.Do(m.Question[0].Name+t+cl, func() (*Msg, time.Duration, error) { + return c.exchange(m, a) + }) + if err != nil { + return r, rtt, err + } + if shared { + return r.Copy(), rtt, nil + } + return r, rtt, nil +} + +func (c *Client) dialTimeout() time.Duration { + if c.Timeout != 0 { + return c.Timeout + } + if c.DialTimeout != 0 { + return c.DialTimeout + } + return dnsTimeout +} + +func (c *Client) readTimeout() time.Duration { + if c.ReadTimeout != 0 { + return c.ReadTimeout + } + return dnsTimeout +} + +func (c *Client) writeTimeout() time.Duration { + if c.WriteTimeout != 0 { + return c.WriteTimeout + } + return dnsTimeout +} + +func (c *Client) exchange(m *Msg, a string) (r *Msg, rtt time.Duration, err error) { + var co *Conn + network := "udp" + tls := false + + switch c.Net { + case "tcp-tls": + network = "tcp" + tls = true + case "tcp4-tls": + network = "tcp4" + tls = true + case "tcp6-tls": + network = "tcp6" + tls = true + default: + if c.Net != "" { + network = c.Net + } + } + + var deadline time.Time + if c.Timeout != 0 { + deadline = time.Now().Add(c.Timeout) + } + + if tls { + co, err = DialTimeoutWithTLS(network, a, c.TLSConfig, c.dialTimeout()) + } else { + co, err = DialTimeout(network, a, c.dialTimeout()) + } + + if err != nil { + return nil, 0, err + } + defer co.Close() + + opt := m.IsEdns0() + // If EDNS0 is used use that for size. + if opt != nil && opt.UDPSize() >= MinMsgSize { + co.UDPSize = opt.UDPSize() + } + // Otherwise use the client's configured UDP size. + if opt == nil && c.UDPSize >= MinMsgSize { + co.UDPSize = c.UDPSize + } + + co.TsigSecret = c.TsigSecret + co.SetWriteDeadline(deadlineOrTimeout(deadline, c.writeTimeout())) + if err = co.WriteMsg(m); err != nil { + return nil, 0, err + } + + co.SetReadDeadline(deadlineOrTimeout(deadline, c.readTimeout())) + r, err = co.ReadMsg() + if err == nil && r.Id != m.Id { + err = ErrId + } + return r, co.rtt, err +} + +// ReadMsg reads a message from the connection co. +// If the received message contains a TSIG record the transaction +// signature is verified. +func (co *Conn) ReadMsg() (*Msg, error) { + p, err := co.ReadMsgHeader(nil) + if err != nil { + return nil, err + } + + m := new(Msg) + if err := m.Unpack(p); err != nil { + // If ErrTruncated was returned, we still want to allow the user to use + // the message, but naively they can just check err if they don't want + // to use a truncated message + if err == ErrTruncated { + return m, err + } + return nil, err + } + if t := m.IsTsig(); t != nil { + if _, ok := co.TsigSecret[t.Hdr.Name]; !ok { + return m, ErrSecret + } + // Need to work on the original message p, as that was used to calculate the tsig. + err = TsigVerify(p, co.TsigSecret[t.Hdr.Name], co.tsigRequestMAC, false) + } + return m, err +} + +// ReadMsgHeader reads a DNS message, parses and populates hdr (when hdr is not nil). +// Returns message as a byte slice to be parsed with Msg.Unpack later on. +// Note that error handling on the message body is not possible as only the header is parsed. +func (co *Conn) ReadMsgHeader(hdr *Header) ([]byte, error) { + var ( + p []byte + n int + err error + ) + + switch t := co.Conn.(type) { + case *net.TCPConn, *tls.Conn: + r := t.(io.Reader) + + // First two bytes specify the length of the entire message. + l, err := tcpMsgLen(r) + if err != nil { + return nil, err + } + p = make([]byte, l) + n, err = tcpRead(r, p) + co.rtt = time.Since(co.t) + default: + if co.UDPSize > MinMsgSize { + p = make([]byte, co.UDPSize) + } else { + p = make([]byte, MinMsgSize) + } + n, err = co.Read(p) + co.rtt = time.Since(co.t) + } + + if err != nil { + return nil, err + } else if n < headerSize { + return nil, ErrShortRead + } + + p = p[:n] + if hdr != nil { + dh, _, err := unpackMsgHdr(p, 0) + if err != nil { + return nil, err + } + *hdr = dh + } + return p, err +} + +// tcpMsgLen is a helper func to read first two bytes of stream as uint16 packet length. +func tcpMsgLen(t io.Reader) (int, error) { + p := []byte{0, 0} + n, err := t.Read(p) + if err != nil { + return 0, err + } + if n != 2 { + return 0, ErrShortRead + } + l := binary.BigEndian.Uint16(p) + if l == 0 { + return 0, ErrShortRead + } + return int(l), nil +} + +// tcpRead calls TCPConn.Read enough times to fill allocated buffer. +func tcpRead(t io.Reader, p []byte) (int, error) { + n, err := t.Read(p) + if err != nil { + return n, err + } + for n < len(p) { + j, err := t.Read(p[n:]) + if err != nil { + return n, err + } + n += j + } + return n, err +} + +// Read implements the net.Conn read method. +func (co *Conn) Read(p []byte) (n int, err error) { + if co.Conn == nil { + return 0, ErrConnEmpty + } + if len(p) < 2 { + return 0, io.ErrShortBuffer + } + switch t := co.Conn.(type) { + case *net.TCPConn, *tls.Conn: + r := t.(io.Reader) + + l, err := tcpMsgLen(r) + if err != nil { + return 0, err + } + if l > len(p) { + return int(l), io.ErrShortBuffer + } + return tcpRead(r, p[:l]) + } + // UDP connection + n, err = co.Conn.Read(p) + if err != nil { + return n, err + } + return n, err +} + +// WriteMsg sends a message through the connection co. +// If the message m contains a TSIG record the transaction +// signature is calculated. +func (co *Conn) WriteMsg(m *Msg) (err error) { + var out []byte + if t := m.IsTsig(); t != nil { + mac := "" + if _, ok := co.TsigSecret[t.Hdr.Name]; !ok { + return ErrSecret + } + out, mac, err = TsigGenerate(m, co.TsigSecret[t.Hdr.Name], co.tsigRequestMAC, false) + // Set for the next read, although only used in zone transfers + co.tsigRequestMAC = mac + } else { + out, err = m.Pack() + } + if err != nil { + return err + } + co.t = time.Now() + if _, err = co.Write(out); err != nil { + return err + } + return nil +} + +// Write implements the net.Conn Write method. +func (co *Conn) Write(p []byte) (n int, err error) { + switch t := co.Conn.(type) { + case *net.TCPConn, *tls.Conn: + w := t.(io.Writer) + + lp := len(p) + if lp < 2 { + return 0, io.ErrShortBuffer + } + if lp > MaxMsgSize { + return 0, &Error{err: "message too large"} + } + l := make([]byte, 2, lp+2) + binary.BigEndian.PutUint16(l, uint16(lp)) + p = append(l, p...) + n, err := io.Copy(w, bytes.NewReader(p)) + return int(n), err + } + n, err = co.Conn.(*net.UDPConn).Write(p) + return n, err +} + +// Dial connects to the address on the named network. +func Dial(network, address string) (conn *Conn, err error) { + conn = new(Conn) + conn.Conn, err = net.Dial(network, address) + if err != nil { + return nil, err + } + return conn, nil +} + +// DialTimeout acts like Dial but takes a timeout. +func DialTimeout(network, address string, timeout time.Duration) (conn *Conn, err error) { + conn = new(Conn) + conn.Conn, err = net.DialTimeout(network, address, timeout) + if err != nil { + return nil, err + } + return conn, nil +} + +// DialWithTLS connects to the address on the named network with TLS. +func DialWithTLS(network, address string, tlsConfig *tls.Config) (conn *Conn, err error) { + conn = new(Conn) + conn.Conn, err = tls.Dial(network, address, tlsConfig) + if err != nil { + return nil, err + } + return conn, nil +} + +// DialTimeoutWithTLS acts like DialWithTLS but takes a timeout. +func DialTimeoutWithTLS(network, address string, tlsConfig *tls.Config, timeout time.Duration) (conn *Conn, err error) { + var dialer net.Dialer + dialer.Timeout = timeout + + conn = new(Conn) + conn.Conn, err = tls.DialWithDialer(&dialer, network, address, tlsConfig) + if err != nil { + return nil, err + } + return conn, nil +} + +func deadlineOrTimeout(deadline time.Time, timeout time.Duration) time.Time { + if deadline.IsZero() { + return time.Now().Add(timeout) + } + return deadline +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/clientconfig.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/clientconfig.go new file mode 100644 index 00000000..cfa9ad0b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/clientconfig.go @@ -0,0 +1,99 @@ +package dns + +import ( + "bufio" + "os" + "strconv" + "strings" +) + +// ClientConfig wraps the contents of the /etc/resolv.conf file. +type ClientConfig struct { + Servers []string // servers to use + Search []string // suffixes to append to local name + Port string // what port to use + Ndots int // number of dots in name to trigger absolute lookup + Timeout int // seconds before giving up on packet + Attempts int // lost packets before giving up on server, not used in the package dns +} + +// ClientConfigFromFile parses a resolv.conf(5) like file and returns +// a *ClientConfig. +func ClientConfigFromFile(resolvconf string) (*ClientConfig, error) { + file, err := os.Open(resolvconf) + if err != nil { + return nil, err + } + defer file.Close() + c := new(ClientConfig) + scanner := bufio.NewScanner(file) + c.Servers = make([]string, 0) + c.Search = make([]string, 0) + c.Port = "53" + c.Ndots = 1 + c.Timeout = 5 + c.Attempts = 2 + + for scanner.Scan() { + if err := scanner.Err(); err != nil { + return nil, err + } + line := scanner.Text() + f := strings.Fields(line) + if len(f) < 1 { + continue + } + switch f[0] { + case "nameserver": // add one name server + if len(f) > 1 { + // One more check: make sure server name is + // just an IP address. Otherwise we need DNS + // to look it up. + name := f[1] + c.Servers = append(c.Servers, name) + } + + case "domain": // set search path to just this domain + if len(f) > 1 { + c.Search = make([]string, 1) + c.Search[0] = f[1] + } else { + c.Search = make([]string, 0) + } + + case "search": // set search path to given servers + c.Search = make([]string, len(f)-1) + for i := 0; i < len(c.Search); i++ { + c.Search[i] = f[i+1] + } + + case "options": // magic options + for i := 1; i < len(f); i++ { + s := f[i] + switch { + case len(s) >= 6 && s[:6] == "ndots:": + n, _ := strconv.Atoi(s[6:]) + if n < 1 { + n = 1 + } + c.Ndots = n + case len(s) >= 8 && s[:8] == "timeout:": + n, _ := strconv.Atoi(s[8:]) + if n < 1 { + n = 1 + } + c.Timeout = n + case len(s) >= 8 && s[:9] == "attempts:": + n, _ := strconv.Atoi(s[9:]) + if n < 1 { + n = 1 + } + c.Attempts = n + case s == "rotate": + /* not imp */ + } + } + } + } + return c, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/defaults.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/defaults.go new file mode 100644 index 00000000..cf456165 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/defaults.go @@ -0,0 +1,282 @@ +package dns + +import ( + "errors" + "net" + "strconv" +) + +const hexDigit = "0123456789abcdef" + +// Everything is assumed in ClassINET. + +// SetReply creates a reply message from a request message. +func (dns *Msg) SetReply(request *Msg) *Msg { + dns.Id = request.Id + dns.RecursionDesired = request.RecursionDesired // Copy rd bit + dns.Response = true + dns.Opcode = OpcodeQuery + dns.Rcode = RcodeSuccess + if len(request.Question) > 0 { + dns.Question = make([]Question, 1) + dns.Question[0] = request.Question[0] + } + return dns +} + +// SetQuestion creates a question message, it sets the Question +// section, generates an Id and sets the RecursionDesired (RD) +// bit to true. +func (dns *Msg) SetQuestion(z string, t uint16) *Msg { + dns.Id = Id() + dns.RecursionDesired = true + dns.Question = make([]Question, 1) + dns.Question[0] = Question{z, t, ClassINET} + return dns +} + +// SetNotify creates a notify message, it sets the Question +// section, generates an Id and sets the Authoritative (AA) +// bit to true. +func (dns *Msg) SetNotify(z string) *Msg { + dns.Opcode = OpcodeNotify + dns.Authoritative = true + dns.Id = Id() + dns.Question = make([]Question, 1) + dns.Question[0] = Question{z, TypeSOA, ClassINET} + return dns +} + +// SetRcode creates an error message suitable for the request. +func (dns *Msg) SetRcode(request *Msg, rcode int) *Msg { + dns.SetReply(request) + dns.Rcode = rcode + return dns +} + +// SetRcodeFormatError creates a message with FormError set. +func (dns *Msg) SetRcodeFormatError(request *Msg) *Msg { + dns.Rcode = RcodeFormatError + dns.Opcode = OpcodeQuery + dns.Response = true + dns.Authoritative = false + dns.Id = request.Id + return dns +} + +// SetUpdate makes the message a dynamic update message. It +// sets the ZONE section to: z, TypeSOA, ClassINET. +func (dns *Msg) SetUpdate(z string) *Msg { + dns.Id = Id() + dns.Response = false + dns.Opcode = OpcodeUpdate + dns.Compress = false // BIND9 cannot handle compression + dns.Question = make([]Question, 1) + dns.Question[0] = Question{z, TypeSOA, ClassINET} + return dns +} + +// SetIxfr creates message for requesting an IXFR. +func (dns *Msg) SetIxfr(z string, serial uint32, ns, mbox string) *Msg { + dns.Id = Id() + dns.Question = make([]Question, 1) + dns.Ns = make([]RR, 1) + s := new(SOA) + s.Hdr = RR_Header{z, TypeSOA, ClassINET, defaultTtl, 0} + s.Serial = serial + s.Ns = ns + s.Mbox = mbox + dns.Question[0] = Question{z, TypeIXFR, ClassINET} + dns.Ns[0] = s + return dns +} + +// SetAxfr creates message for requesting an AXFR. +func (dns *Msg) SetAxfr(z string) *Msg { + dns.Id = Id() + dns.Question = make([]Question, 1) + dns.Question[0] = Question{z, TypeAXFR, ClassINET} + return dns +} + +// SetTsig appends a TSIG RR to the message. +// This is only a skeleton TSIG RR that is added as the last RR in the +// additional section. The Tsig is calculated when the message is being send. +func (dns *Msg) SetTsig(z, algo string, fudge, timesigned int64) *Msg { + t := new(TSIG) + t.Hdr = RR_Header{z, TypeTSIG, ClassANY, 0, 0} + t.Algorithm = algo + t.Fudge = 300 + t.TimeSigned = uint64(timesigned) + t.OrigId = dns.Id + dns.Extra = append(dns.Extra, t) + return dns +} + +// SetEdns0 appends a EDNS0 OPT RR to the message. +// TSIG should always the last RR in a message. +func (dns *Msg) SetEdns0(udpsize uint16, do bool) *Msg { + e := new(OPT) + e.Hdr.Name = "." + e.Hdr.Rrtype = TypeOPT + e.SetUDPSize(udpsize) + if do { + e.SetDo() + } + dns.Extra = append(dns.Extra, e) + return dns +} + +// IsTsig checks if the message has a TSIG record as the last record +// in the additional section. It returns the TSIG record found or nil. +func (dns *Msg) IsTsig() *TSIG { + if len(dns.Extra) > 0 { + if dns.Extra[len(dns.Extra)-1].Header().Rrtype == TypeTSIG { + return dns.Extra[len(dns.Extra)-1].(*TSIG) + } + } + return nil +} + +// IsEdns0 checks if the message has a EDNS0 (OPT) record, any EDNS0 +// record in the additional section will do. It returns the OPT record +// found or nil. +func (dns *Msg) IsEdns0() *OPT { + // EDNS0 is at the end of the additional section, start there. + // We might want to change this to *only* look at the last two + // records. So we see TSIG and/or OPT - this a slightly bigger + // change though. + for i := len(dns.Extra) - 1; i >= 0; i-- { + if dns.Extra[i].Header().Rrtype == TypeOPT { + return dns.Extra[i].(*OPT) + } + } + return nil +} + +// IsDomainName checks if s is a valid domain name, it returns the number of +// labels and true, when a domain name is valid. Note that non fully qualified +// domain name is considered valid, in this case the last label is counted in +// the number of labels. When false is returned the number of labels is not +// defined. Also note that this function is extremely liberal; almost any +// string is a valid domain name as the DNS is 8 bit protocol. It checks if each +// label fits in 63 characters, but there is no length check for the entire +// string s. I.e. a domain name longer than 255 characters is considered valid. +func IsDomainName(s string) (labels int, ok bool) { + _, labels, err := packDomainName(s, nil, 0, nil, false) + return labels, err == nil +} + +// IsSubDomain checks if child is indeed a child of the parent. If child and parent +// are the same domain true is returned as well. +func IsSubDomain(parent, child string) bool { + // Entire child is contained in parent + return CompareDomainName(parent, child) == CountLabel(parent) +} + +// IsMsg sanity checks buf and returns an error if it isn't a valid DNS packet. +// The checking is performed on the binary payload. +func IsMsg(buf []byte) error { + // Header + if len(buf) < 12 { + return errors.New("dns: bad message header") + } + // Header: Opcode + // TODO(miek): more checks here, e.g. check all header bits. + return nil +} + +// IsFqdn checks if a domain name is fully qualified. +func IsFqdn(s string) bool { + l := len(s) + if l == 0 { + return false + } + return s[l-1] == '.' +} + +// IsRRset checks if a set of RRs is a valid RRset as defined by RFC 2181. +// This means the RRs need to have the same type, name, and class. Returns true +// if the RR set is valid, otherwise false. +func IsRRset(rrset []RR) bool { + if len(rrset) == 0 { + return false + } + if len(rrset) == 1 { + return true + } + rrHeader := rrset[0].Header() + rrType := rrHeader.Rrtype + rrClass := rrHeader.Class + rrName := rrHeader.Name + + for _, rr := range rrset[1:] { + curRRHeader := rr.Header() + if curRRHeader.Rrtype != rrType || curRRHeader.Class != rrClass || curRRHeader.Name != rrName { + // Mismatch between the records, so this is not a valid rrset for + //signing/verifying + return false + } + } + + return true +} + +// Fqdn return the fully qualified domain name from s. +// If s is already fully qualified, it behaves as the identity function. +func Fqdn(s string) string { + if IsFqdn(s) { + return s + } + return s + "." +} + +// Copied from the official Go code. + +// ReverseAddr returns the in-addr.arpa. or ip6.arpa. hostname of the IP +// address suitable for reverse DNS (PTR) record lookups or an error if it fails +// to parse the IP address. +func ReverseAddr(addr string) (arpa string, err error) { + ip := net.ParseIP(addr) + if ip == nil { + return "", &Error{err: "unrecognized address: " + addr} + } + if ip.To4() != nil { + return strconv.Itoa(int(ip[15])) + "." + strconv.Itoa(int(ip[14])) + "." + strconv.Itoa(int(ip[13])) + "." + + strconv.Itoa(int(ip[12])) + ".in-addr.arpa.", nil + } + // Must be IPv6 + buf := make([]byte, 0, len(ip)*4+len("ip6.arpa.")) + // Add it, in reverse, to the buffer + for i := len(ip) - 1; i >= 0; i-- { + v := ip[i] + buf = append(buf, hexDigit[v&0xF]) + buf = append(buf, '.') + buf = append(buf, hexDigit[v>>4]) + buf = append(buf, '.') + } + // Append "ip6.arpa." and return (buf already has the final .) + buf = append(buf, "ip6.arpa."...) + return string(buf), nil +} + +// String returns the string representation for the type t. +func (t Type) String() string { + if t1, ok := TypeToString[uint16(t)]; ok { + return t1 + } + return "TYPE" + strconv.Itoa(int(t)) +} + +// String returns the string representation for the class c. +func (c Class) String() string { + if c1, ok := ClassToString[uint16(c)]; ok { + return c1 + } + return "CLASS" + strconv.Itoa(int(c)) +} + +// String returns the string representation for the name n. +func (n Name) String() string { + return sprintName(string(n)) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dns.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dns.go new file mode 100644 index 00000000..b3292287 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dns.go @@ -0,0 +1,104 @@ +package dns + +import "strconv" + +const ( + year68 = 1 << 31 // For RFC1982 (Serial Arithmetic) calculations in 32 bits. + defaultTtl = 3600 // Default internal TTL. + + DefaultMsgSize = 4096 // DefaultMsgSize is the standard default for messages larger than 512 bytes. + MinMsgSize = 512 // MinMsgSize is the minimal size of a DNS packet. + MaxMsgSize = 65535 // MaxMsgSize is the largest possible DNS packet. +) + +// Error represents a DNS error. +type Error struct{ err string } + +func (e *Error) Error() string { + if e == nil { + return "dns: " + } + return "dns: " + e.err +} + +// An RR represents a resource record. +type RR interface { + // Header returns the header of an resource record. The header contains + // everything up to the rdata. + Header() *RR_Header + // String returns the text representation of the resource record. + String() string + + // copy returns a copy of the RR + copy() RR + // len returns the length (in octets) of the uncompressed RR in wire format. + len() int + // pack packs an RR into wire format. + pack([]byte, int, map[string]int, bool) (int, error) +} + +// RR_Header is the header all DNS resource records share. +type RR_Header struct { + Name string `dns:"cdomain-name"` + Rrtype uint16 + Class uint16 + Ttl uint32 + Rdlength uint16 // Length of data after header. +} + +// Header returns itself. This is here to make RR_Header implements the RR interface. +func (h *RR_Header) Header() *RR_Header { return h } + +// Just to implement the RR interface. +func (h *RR_Header) copy() RR { return nil } + +func (h *RR_Header) copyHeader() *RR_Header { + r := new(RR_Header) + r.Name = h.Name + r.Rrtype = h.Rrtype + r.Class = h.Class + r.Ttl = h.Ttl + r.Rdlength = h.Rdlength + return r +} + +func (h *RR_Header) String() string { + var s string + + if h.Rrtype == TypeOPT { + s = ";" + // and maybe other things + } + + s += sprintName(h.Name) + "\t" + s += strconv.FormatInt(int64(h.Ttl), 10) + "\t" + s += Class(h.Class).String() + "\t" + s += Type(h.Rrtype).String() + "\t" + return s +} + +func (h *RR_Header) len() int { + l := len(h.Name) + 1 + l += 10 // rrtype(2) + class(2) + ttl(4) + rdlength(2) + return l +} + +// ToRFC3597 converts a known RR to the unknown RR representation from RFC 3597. +func (rr *RFC3597) ToRFC3597(r RR) error { + buf := make([]byte, r.len()*2) + off, err := PackRR(r, buf, 0, nil, false) + if err != nil { + return err + } + buf = buf[:off] + if int(r.Header().Rdlength) > off { + return ErrBuf + } + + rfc3597, _, err := unpackRFC3597(*r.Header(), buf, off-int(r.Header().Rdlength)) + if err != nil { + return err + } + *rr = *rfc3597.(*RFC3597) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec.go new file mode 100644 index 00000000..f5f3fbdd --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec.go @@ -0,0 +1,721 @@ +package dns + +import ( + "bytes" + "crypto" + "crypto/dsa" + "crypto/ecdsa" + "crypto/elliptic" + _ "crypto/md5" + "crypto/rand" + "crypto/rsa" + _ "crypto/sha1" + _ "crypto/sha256" + _ "crypto/sha512" + "encoding/asn1" + "encoding/binary" + "encoding/hex" + "math/big" + "sort" + "strings" + "time" +) + +// DNSSEC encryption algorithm codes. +const ( + _ uint8 = iota + RSAMD5 + DH + DSA + _ // Skip 4, RFC 6725, section 2.1 + RSASHA1 + DSANSEC3SHA1 + RSASHA1NSEC3SHA1 + RSASHA256 + _ // Skip 9, RFC 6725, section 2.1 + RSASHA512 + _ // Skip 11, RFC 6725, section 2.1 + ECCGOST + ECDSAP256SHA256 + ECDSAP384SHA384 + INDIRECT uint8 = 252 + PRIVATEDNS uint8 = 253 // Private (experimental keys) + PRIVATEOID uint8 = 254 +) + +// Map for algorithm names. +var AlgorithmToString = map[uint8]string{ + RSAMD5: "RSAMD5", + DH: "DH", + DSA: "DSA", + RSASHA1: "RSASHA1", + DSANSEC3SHA1: "DSA-NSEC3-SHA1", + RSASHA1NSEC3SHA1: "RSASHA1-NSEC3-SHA1", + RSASHA256: "RSASHA256", + RSASHA512: "RSASHA512", + ECCGOST: "ECC-GOST", + ECDSAP256SHA256: "ECDSAP256SHA256", + ECDSAP384SHA384: "ECDSAP384SHA384", + INDIRECT: "INDIRECT", + PRIVATEDNS: "PRIVATEDNS", + PRIVATEOID: "PRIVATEOID", +} + +// Map of algorithm strings. +var StringToAlgorithm = reverseInt8(AlgorithmToString) + +// Map of algorithm crypto hashes. +var AlgorithmToHash = map[uint8]crypto.Hash{ + RSAMD5: crypto.MD5, // Deprecated in RFC 6725 + RSASHA1: crypto.SHA1, + RSASHA1NSEC3SHA1: crypto.SHA1, + RSASHA256: crypto.SHA256, + ECDSAP256SHA256: crypto.SHA256, + ECDSAP384SHA384: crypto.SHA384, + RSASHA512: crypto.SHA512, +} + +// DNSSEC hashing algorithm codes. +const ( + _ uint8 = iota + SHA1 // RFC 4034 + SHA256 // RFC 4509 + GOST94 // RFC 5933 + SHA384 // Experimental + SHA512 // Experimental +) + +// Map for hash names. +var HashToString = map[uint8]string{ + SHA1: "SHA1", + SHA256: "SHA256", + GOST94: "GOST94", + SHA384: "SHA384", + SHA512: "SHA512", +} + +// Map of hash strings. +var StringToHash = reverseInt8(HashToString) + +// DNSKEY flag values. +const ( + SEP = 1 + REVOKE = 1 << 7 + ZONE = 1 << 8 +) + +// The RRSIG needs to be converted to wireformat with some of the rdata (the signature) missing. +type rrsigWireFmt struct { + TypeCovered uint16 + Algorithm uint8 + Labels uint8 + OrigTtl uint32 + Expiration uint32 + Inception uint32 + KeyTag uint16 + SignerName string `dns:"domain-name"` + /* No Signature */ +} + +// Used for converting DNSKEY's rdata to wirefmt. +type dnskeyWireFmt struct { + Flags uint16 + Protocol uint8 + Algorithm uint8 + PublicKey string `dns:"base64"` + /* Nothing is left out */ +} + +func divRoundUp(a, b int) int { + return (a + b - 1) / b +} + +// KeyTag calculates the keytag (or key-id) of the DNSKEY. +func (k *DNSKEY) KeyTag() uint16 { + if k == nil { + return 0 + } + var keytag int + switch k.Algorithm { + case RSAMD5: + // Look at the bottom two bytes of the modules, which the last + // item in the pubkey. We could do this faster by looking directly + // at the base64 values. But I'm lazy. + modulus, _ := fromBase64([]byte(k.PublicKey)) + if len(modulus) > 1 { + x := binary.BigEndian.Uint16(modulus[len(modulus)-2:]) + keytag = int(x) + } + default: + keywire := new(dnskeyWireFmt) + keywire.Flags = k.Flags + keywire.Protocol = k.Protocol + keywire.Algorithm = k.Algorithm + keywire.PublicKey = k.PublicKey + wire := make([]byte, DefaultMsgSize) + n, err := packKeyWire(keywire, wire) + if err != nil { + return 0 + } + wire = wire[:n] + for i, v := range wire { + if i&1 != 0 { + keytag += int(v) // must be larger than uint32 + } else { + keytag += int(v) << 8 + } + } + keytag += (keytag >> 16) & 0xFFFF + keytag &= 0xFFFF + } + return uint16(keytag) +} + +// ToDS converts a DNSKEY record to a DS record. +func (k *DNSKEY) ToDS(h uint8) *DS { + if k == nil { + return nil + } + ds := new(DS) + ds.Hdr.Name = k.Hdr.Name + ds.Hdr.Class = k.Hdr.Class + ds.Hdr.Rrtype = TypeDS + ds.Hdr.Ttl = k.Hdr.Ttl + ds.Algorithm = k.Algorithm + ds.DigestType = h + ds.KeyTag = k.KeyTag() + + keywire := new(dnskeyWireFmt) + keywire.Flags = k.Flags + keywire.Protocol = k.Protocol + keywire.Algorithm = k.Algorithm + keywire.PublicKey = k.PublicKey + wire := make([]byte, DefaultMsgSize) + n, err := packKeyWire(keywire, wire) + if err != nil { + return nil + } + wire = wire[:n] + + owner := make([]byte, 255) + off, err1 := PackDomainName(strings.ToLower(k.Hdr.Name), owner, 0, nil, false) + if err1 != nil { + return nil + } + owner = owner[:off] + // RFC4034: + // digest = digest_algorithm( DNSKEY owner name | DNSKEY RDATA); + // "|" denotes concatenation + // DNSKEY RDATA = Flags | Protocol | Algorithm | Public Key. + + // digest buffer + digest := append(owner, wire...) // another copy + + var hash crypto.Hash + switch h { + case SHA1: + hash = crypto.SHA1 + case SHA256: + hash = crypto.SHA256 + case SHA384: + hash = crypto.SHA384 + case SHA512: + hash = crypto.SHA512 + default: + return nil + } + + s := hash.New() + s.Write(digest) + ds.Digest = hex.EncodeToString(s.Sum(nil)) + return ds +} + +// ToCDNSKEY converts a DNSKEY record to a CDNSKEY record. +func (k *DNSKEY) ToCDNSKEY() *CDNSKEY { + c := &CDNSKEY{DNSKEY: *k} + c.Hdr = *k.Hdr.copyHeader() + c.Hdr.Rrtype = TypeCDNSKEY + return c +} + +// ToCDS converts a DS record to a CDS record. +func (d *DS) ToCDS() *CDS { + c := &CDS{DS: *d} + c.Hdr = *d.Hdr.copyHeader() + c.Hdr.Rrtype = TypeCDS + return c +} + +// Sign signs an RRSet. The signature needs to be filled in with the values: +// Inception, Expiration, KeyTag, SignerName and Algorithm. The rest is copied +// from the RRset. Sign returns a non-nill error when the signing went OK. +// There is no check if RRSet is a proper (RFC 2181) RRSet. If OrigTTL is non +// zero, it is used as-is, otherwise the TTL of the RRset is used as the +// OrigTTL. +func (rr *RRSIG) Sign(k crypto.Signer, rrset []RR) error { + if k == nil { + return ErrPrivKey + } + // s.Inception and s.Expiration may be 0 (rollover etc.), the rest must be set + if rr.KeyTag == 0 || len(rr.SignerName) == 0 || rr.Algorithm == 0 { + return ErrKey + } + + rr.Hdr.Rrtype = TypeRRSIG + rr.Hdr.Name = rrset[0].Header().Name + rr.Hdr.Class = rrset[0].Header().Class + if rr.OrigTtl == 0 { // If set don't override + rr.OrigTtl = rrset[0].Header().Ttl + } + rr.TypeCovered = rrset[0].Header().Rrtype + rr.Labels = uint8(CountLabel(rrset[0].Header().Name)) + + if strings.HasPrefix(rrset[0].Header().Name, "*") { + rr.Labels-- // wildcard, remove from label count + } + + sigwire := new(rrsigWireFmt) + sigwire.TypeCovered = rr.TypeCovered + sigwire.Algorithm = rr.Algorithm + sigwire.Labels = rr.Labels + sigwire.OrigTtl = rr.OrigTtl + sigwire.Expiration = rr.Expiration + sigwire.Inception = rr.Inception + sigwire.KeyTag = rr.KeyTag + // For signing, lowercase this name + sigwire.SignerName = strings.ToLower(rr.SignerName) + + // Create the desired binary blob + signdata := make([]byte, DefaultMsgSize) + n, err := packSigWire(sigwire, signdata) + if err != nil { + return err + } + signdata = signdata[:n] + wire, err := rawSignatureData(rrset, rr) + if err != nil { + return err + } + signdata = append(signdata, wire...) + + hash, ok := AlgorithmToHash[rr.Algorithm] + if !ok { + return ErrAlg + } + + h := hash.New() + h.Write(signdata) + + signature, err := sign(k, h.Sum(nil), hash, rr.Algorithm) + if err != nil { + return err + } + + rr.Signature = toBase64(signature) + + return nil +} + +func sign(k crypto.Signer, hashed []byte, hash crypto.Hash, alg uint8) ([]byte, error) { + signature, err := k.Sign(rand.Reader, hashed, hash) + if err != nil { + return nil, err + } + + switch alg { + case RSASHA1, RSASHA1NSEC3SHA1, RSASHA256, RSASHA512: + return signature, nil + + case ECDSAP256SHA256, ECDSAP384SHA384: + ecdsaSignature := &struct { + R, S *big.Int + }{} + if _, err := asn1.Unmarshal(signature, ecdsaSignature); err != nil { + return nil, err + } + + var intlen int + switch alg { + case ECDSAP256SHA256: + intlen = 32 + case ECDSAP384SHA384: + intlen = 48 + } + + signature := intToBytes(ecdsaSignature.R, intlen) + signature = append(signature, intToBytes(ecdsaSignature.S, intlen)...) + return signature, nil + + // There is no defined interface for what a DSA backed crypto.Signer returns + case DSA, DSANSEC3SHA1: + // t := divRoundUp(divRoundUp(p.PublicKey.Y.BitLen(), 8)-64, 8) + // signature := []byte{byte(t)} + // signature = append(signature, intToBytes(r1, 20)...) + // signature = append(signature, intToBytes(s1, 20)...) + // rr.Signature = signature + } + + return nil, ErrAlg +} + +// Verify validates an RRSet with the signature and key. This is only the +// cryptographic test, the signature validity period must be checked separately. +// This function copies the rdata of some RRs (to lowercase domain names) for the validation to work. +func (rr *RRSIG) Verify(k *DNSKEY, rrset []RR) error { + // First the easy checks + if !IsRRset(rrset) { + return ErrRRset + } + if rr.KeyTag != k.KeyTag() { + return ErrKey + } + if rr.Hdr.Class != k.Hdr.Class { + return ErrKey + } + if rr.Algorithm != k.Algorithm { + return ErrKey + } + if strings.ToLower(rr.SignerName) != strings.ToLower(k.Hdr.Name) { + return ErrKey + } + if k.Protocol != 3 { + return ErrKey + } + + // IsRRset checked that we have at least one RR and that the RRs in + // the set have consistent type, class, and name. Also check that type and + // class matches the RRSIG record. + if rrset[0].Header().Class != rr.Hdr.Class { + return ErrRRset + } + if rrset[0].Header().Rrtype != rr.TypeCovered { + return ErrRRset + } + + // RFC 4035 5.3.2. Reconstructing the Signed Data + // Copy the sig, except the rrsig data + sigwire := new(rrsigWireFmt) + sigwire.TypeCovered = rr.TypeCovered + sigwire.Algorithm = rr.Algorithm + sigwire.Labels = rr.Labels + sigwire.OrigTtl = rr.OrigTtl + sigwire.Expiration = rr.Expiration + sigwire.Inception = rr.Inception + sigwire.KeyTag = rr.KeyTag + sigwire.SignerName = strings.ToLower(rr.SignerName) + // Create the desired binary blob + signeddata := make([]byte, DefaultMsgSize) + n, err := packSigWire(sigwire, signeddata) + if err != nil { + return err + } + signeddata = signeddata[:n] + wire, err := rawSignatureData(rrset, rr) + if err != nil { + return err + } + signeddata = append(signeddata, wire...) + + sigbuf := rr.sigBuf() // Get the binary signature data + if rr.Algorithm == PRIVATEDNS { // PRIVATEOID + // TODO(miek) + // remove the domain name and assume its ours? + } + + hash, ok := AlgorithmToHash[rr.Algorithm] + if !ok { + return ErrAlg + } + + switch rr.Algorithm { + case RSASHA1, RSASHA1NSEC3SHA1, RSASHA256, RSASHA512, RSAMD5: + // TODO(mg): this can be done quicker, ie. cache the pubkey data somewhere?? + pubkey := k.publicKeyRSA() // Get the key + if pubkey == nil { + return ErrKey + } + + h := hash.New() + h.Write(signeddata) + return rsa.VerifyPKCS1v15(pubkey, hash, h.Sum(nil), sigbuf) + + case ECDSAP256SHA256, ECDSAP384SHA384: + pubkey := k.publicKeyECDSA() + if pubkey == nil { + return ErrKey + } + + // Split sigbuf into the r and s coordinates + r := new(big.Int).SetBytes(sigbuf[:len(sigbuf)/2]) + s := new(big.Int).SetBytes(sigbuf[len(sigbuf)/2:]) + + h := hash.New() + h.Write(signeddata) + if ecdsa.Verify(pubkey, h.Sum(nil), r, s) { + return nil + } + return ErrSig + + default: + return ErrAlg + } +} + +// ValidityPeriod uses RFC1982 serial arithmetic to calculate +// if a signature period is valid. If t is the zero time, the +// current time is taken other t is. Returns true if the signature +// is valid at the given time, otherwise returns false. +func (rr *RRSIG) ValidityPeriod(t time.Time) bool { + var utc int64 + if t.IsZero() { + utc = time.Now().UTC().Unix() + } else { + utc = t.UTC().Unix() + } + modi := (int64(rr.Inception) - utc) / year68 + mode := (int64(rr.Expiration) - utc) / year68 + ti := int64(rr.Inception) + (modi * year68) + te := int64(rr.Expiration) + (mode * year68) + return ti <= utc && utc <= te +} + +// Return the signatures base64 encodedig sigdata as a byte slice. +func (rr *RRSIG) sigBuf() []byte { + sigbuf, err := fromBase64([]byte(rr.Signature)) + if err != nil { + return nil + } + return sigbuf +} + +// publicKeyRSA returns the RSA public key from a DNSKEY record. +func (k *DNSKEY) publicKeyRSA() *rsa.PublicKey { + keybuf, err := fromBase64([]byte(k.PublicKey)) + if err != nil { + return nil + } + + // RFC 2537/3110, section 2. RSA Public KEY Resource Records + // Length is in the 0th byte, unless its zero, then it + // it in bytes 1 and 2 and its a 16 bit number + explen := uint16(keybuf[0]) + keyoff := 1 + if explen == 0 { + explen = uint16(keybuf[1])<<8 | uint16(keybuf[2]) + keyoff = 3 + } + pubkey := new(rsa.PublicKey) + + pubkey.N = big.NewInt(0) + shift := uint64((explen - 1) * 8) + expo := uint64(0) + for i := int(explen - 1); i > 0; i-- { + expo += uint64(keybuf[keyoff+i]) << shift + shift -= 8 + } + // Remainder + expo += uint64(keybuf[keyoff]) + if expo > 2<<31 { + // Larger expo than supported. + // println("dns: F5 primes (or larger) are not supported") + return nil + } + pubkey.E = int(expo) + + pubkey.N.SetBytes(keybuf[keyoff+int(explen):]) + return pubkey +} + +// publicKeyECDSA returns the Curve public key from the DNSKEY record. +func (k *DNSKEY) publicKeyECDSA() *ecdsa.PublicKey { + keybuf, err := fromBase64([]byte(k.PublicKey)) + if err != nil { + return nil + } + pubkey := new(ecdsa.PublicKey) + switch k.Algorithm { + case ECDSAP256SHA256: + pubkey.Curve = elliptic.P256() + if len(keybuf) != 64 { + // wrongly encoded key + return nil + } + case ECDSAP384SHA384: + pubkey.Curve = elliptic.P384() + if len(keybuf) != 96 { + // Wrongly encoded key + return nil + } + } + pubkey.X = big.NewInt(0) + pubkey.X.SetBytes(keybuf[:len(keybuf)/2]) + pubkey.Y = big.NewInt(0) + pubkey.Y.SetBytes(keybuf[len(keybuf)/2:]) + return pubkey +} + +func (k *DNSKEY) publicKeyDSA() *dsa.PublicKey { + keybuf, err := fromBase64([]byte(k.PublicKey)) + if err != nil { + return nil + } + if len(keybuf) < 22 { + return nil + } + t, keybuf := int(keybuf[0]), keybuf[1:] + size := 64 + t*8 + q, keybuf := keybuf[:20], keybuf[20:] + if len(keybuf) != 3*size { + return nil + } + p, keybuf := keybuf[:size], keybuf[size:] + g, y := keybuf[:size], keybuf[size:] + pubkey := new(dsa.PublicKey) + pubkey.Parameters.Q = big.NewInt(0).SetBytes(q) + pubkey.Parameters.P = big.NewInt(0).SetBytes(p) + pubkey.Parameters.G = big.NewInt(0).SetBytes(g) + pubkey.Y = big.NewInt(0).SetBytes(y) + return pubkey +} + +type wireSlice [][]byte + +func (p wireSlice) Len() int { return len(p) } +func (p wireSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } +func (p wireSlice) Less(i, j int) bool { + _, ioff, _ := UnpackDomainName(p[i], 0) + _, joff, _ := UnpackDomainName(p[j], 0) + return bytes.Compare(p[i][ioff+10:], p[j][joff+10:]) < 0 +} + +// Return the raw signature data. +func rawSignatureData(rrset []RR, s *RRSIG) (buf []byte, err error) { + wires := make(wireSlice, len(rrset)) + for i, r := range rrset { + r1 := r.copy() + r1.Header().Ttl = s.OrigTtl + labels := SplitDomainName(r1.Header().Name) + // 6.2. Canonical RR Form. (4) - wildcards + if len(labels) > int(s.Labels) { + // Wildcard + r1.Header().Name = "*." + strings.Join(labels[len(labels)-int(s.Labels):], ".") + "." + } + // RFC 4034: 6.2. Canonical RR Form. (2) - domain name to lowercase + r1.Header().Name = strings.ToLower(r1.Header().Name) + // 6.2. Canonical RR Form. (3) - domain rdata to lowercase. + // NS, MD, MF, CNAME, SOA, MB, MG, MR, PTR, + // HINFO, MINFO, MX, RP, AFSDB, RT, SIG, PX, NXT, NAPTR, KX, + // SRV, DNAME, A6 + // + // RFC 6840 - Clarifications and Implementation Notes for DNS Security (DNSSEC): + // Section 6.2 of [RFC4034] also erroneously lists HINFO as a record + // that needs conversion to lowercase, and twice at that. Since HINFO + // records contain no domain names, they are not subject to case + // conversion. + switch x := r1.(type) { + case *NS: + x.Ns = strings.ToLower(x.Ns) + case *CNAME: + x.Target = strings.ToLower(x.Target) + case *SOA: + x.Ns = strings.ToLower(x.Ns) + x.Mbox = strings.ToLower(x.Mbox) + case *MB: + x.Mb = strings.ToLower(x.Mb) + case *MG: + x.Mg = strings.ToLower(x.Mg) + case *MR: + x.Mr = strings.ToLower(x.Mr) + case *PTR: + x.Ptr = strings.ToLower(x.Ptr) + case *MINFO: + x.Rmail = strings.ToLower(x.Rmail) + x.Email = strings.ToLower(x.Email) + case *MX: + x.Mx = strings.ToLower(x.Mx) + case *NAPTR: + x.Replacement = strings.ToLower(x.Replacement) + case *KX: + x.Exchanger = strings.ToLower(x.Exchanger) + case *SRV: + x.Target = strings.ToLower(x.Target) + case *DNAME: + x.Target = strings.ToLower(x.Target) + } + // 6.2. Canonical RR Form. (5) - origTTL + wire := make([]byte, r1.len()+1) // +1 to be safe(r) + off, err1 := PackRR(r1, wire, 0, nil, false) + if err1 != nil { + return nil, err1 + } + wire = wire[:off] + wires[i] = wire + } + sort.Sort(wires) + for i, wire := range wires { + if i > 0 && bytes.Equal(wire, wires[i-1]) { + continue + } + buf = append(buf, wire...) + } + return buf, nil +} + +func packSigWire(sw *rrsigWireFmt, msg []byte) (int, error) { + // copied from zmsg.go RRSIG packing + off, err := packUint16(sw.TypeCovered, msg, 0) + if err != nil { + return off, err + } + off, err = packUint8(sw.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(sw.Labels, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(sw.OrigTtl, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(sw.Expiration, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(sw.Inception, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(sw.KeyTag, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(sw.SignerName, msg, off, nil, false) + if err != nil { + return off, err + } + return off, nil +} + +func packKeyWire(dw *dnskeyWireFmt, msg []byte) (int, error) { + // copied from zmsg.go DNSKEY packing + off, err := packUint16(dw.Flags, msg, 0) + if err != nil { + return off, err + } + off, err = packUint8(dw.Protocol, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(dw.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packStringBase64(dw.PublicKey, msg, off) + if err != nil { + return off, err + } + return off, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec_keygen.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec_keygen.go new file mode 100644 index 00000000..229a0793 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec_keygen.go @@ -0,0 +1,156 @@ +package dns + +import ( + "crypto" + "crypto/dsa" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/rsa" + "math/big" +) + +// Generate generates a DNSKEY of the given bit size. +// The public part is put inside the DNSKEY record. +// The Algorithm in the key must be set as this will define +// what kind of DNSKEY will be generated. +// The ECDSA algorithms imply a fixed keysize, in that case +// bits should be set to the size of the algorithm. +func (k *DNSKEY) Generate(bits int) (crypto.PrivateKey, error) { + switch k.Algorithm { + case DSA, DSANSEC3SHA1: + if bits != 1024 { + return nil, ErrKeySize + } + case RSAMD5, RSASHA1, RSASHA256, RSASHA1NSEC3SHA1: + if bits < 512 || bits > 4096 { + return nil, ErrKeySize + } + case RSASHA512: + if bits < 1024 || bits > 4096 { + return nil, ErrKeySize + } + case ECDSAP256SHA256: + if bits != 256 { + return nil, ErrKeySize + } + case ECDSAP384SHA384: + if bits != 384 { + return nil, ErrKeySize + } + } + + switch k.Algorithm { + case DSA, DSANSEC3SHA1: + params := new(dsa.Parameters) + if err := dsa.GenerateParameters(params, rand.Reader, dsa.L1024N160); err != nil { + return nil, err + } + priv := new(dsa.PrivateKey) + priv.PublicKey.Parameters = *params + err := dsa.GenerateKey(priv, rand.Reader) + if err != nil { + return nil, err + } + k.setPublicKeyDSA(params.Q, params.P, params.G, priv.PublicKey.Y) + return priv, nil + case RSAMD5, RSASHA1, RSASHA256, RSASHA512, RSASHA1NSEC3SHA1: + priv, err := rsa.GenerateKey(rand.Reader, bits) + if err != nil { + return nil, err + } + k.setPublicKeyRSA(priv.PublicKey.E, priv.PublicKey.N) + return priv, nil + case ECDSAP256SHA256, ECDSAP384SHA384: + var c elliptic.Curve + switch k.Algorithm { + case ECDSAP256SHA256: + c = elliptic.P256() + case ECDSAP384SHA384: + c = elliptic.P384() + } + priv, err := ecdsa.GenerateKey(c, rand.Reader) + if err != nil { + return nil, err + } + k.setPublicKeyECDSA(priv.PublicKey.X, priv.PublicKey.Y) + return priv, nil + default: + return nil, ErrAlg + } +} + +// Set the public key (the value E and N) +func (k *DNSKEY) setPublicKeyRSA(_E int, _N *big.Int) bool { + if _E == 0 || _N == nil { + return false + } + buf := exponentToBuf(_E) + buf = append(buf, _N.Bytes()...) + k.PublicKey = toBase64(buf) + return true +} + +// Set the public key for Elliptic Curves +func (k *DNSKEY) setPublicKeyECDSA(_X, _Y *big.Int) bool { + if _X == nil || _Y == nil { + return false + } + var intlen int + switch k.Algorithm { + case ECDSAP256SHA256: + intlen = 32 + case ECDSAP384SHA384: + intlen = 48 + } + k.PublicKey = toBase64(curveToBuf(_X, _Y, intlen)) + return true +} + +// Set the public key for DSA +func (k *DNSKEY) setPublicKeyDSA(_Q, _P, _G, _Y *big.Int) bool { + if _Q == nil || _P == nil || _G == nil || _Y == nil { + return false + } + buf := dsaToBuf(_Q, _P, _G, _Y) + k.PublicKey = toBase64(buf) + return true +} + +// Set the public key (the values E and N) for RSA +// RFC 3110: Section 2. RSA Public KEY Resource Records +func exponentToBuf(_E int) []byte { + var buf []byte + i := big.NewInt(int64(_E)) + if len(i.Bytes()) < 256 { + buf = make([]byte, 1) + buf[0] = uint8(len(i.Bytes())) + } else { + buf = make([]byte, 3) + buf[0] = 0 + buf[1] = uint8(len(i.Bytes()) >> 8) + buf[2] = uint8(len(i.Bytes())) + } + buf = append(buf, i.Bytes()...) + return buf +} + +// Set the public key for X and Y for Curve. The two +// values are just concatenated. +func curveToBuf(_X, _Y *big.Int, intlen int) []byte { + buf := intToBytes(_X, intlen) + buf = append(buf, intToBytes(_Y, intlen)...) + return buf +} + +// Set the public key for X and Y for Curve. The two +// values are just concatenated. +func dsaToBuf(_Q, _P, _G, _Y *big.Int) []byte { + t := divRoundUp(divRoundUp(_G.BitLen(), 8)-64, 8) + buf := []byte{byte(t)} + buf = append(buf, intToBytes(_Q, 20)...) + buf = append(buf, intToBytes(_P, 64+t*8)...) + buf = append(buf, intToBytes(_G, 64+t*8)...) + buf = append(buf, intToBytes(_Y, 64+t*8)...) + return buf +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec_keyscan.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec_keyscan.go new file mode 100644 index 00000000..c0b54dc7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec_keyscan.go @@ -0,0 +1,249 @@ +package dns + +import ( + "crypto" + "crypto/dsa" + "crypto/ecdsa" + "crypto/rsa" + "io" + "math/big" + "strconv" + "strings" +) + +// NewPrivateKey returns a PrivateKey by parsing the string s. +// s should be in the same form of the BIND private key files. +func (k *DNSKEY) NewPrivateKey(s string) (crypto.PrivateKey, error) { + if s[len(s)-1] != '\n' { // We need a closing newline + return k.ReadPrivateKey(strings.NewReader(s+"\n"), "") + } + return k.ReadPrivateKey(strings.NewReader(s), "") +} + +// ReadPrivateKey reads a private key from the io.Reader q. The string file is +// only used in error reporting. +// The public key must be known, because some cryptographic algorithms embed +// the public inside the privatekey. +func (k *DNSKEY) ReadPrivateKey(q io.Reader, file string) (crypto.PrivateKey, error) { + m, err := parseKey(q, file) + if m == nil { + return nil, err + } + if _, ok := m["private-key-format"]; !ok { + return nil, ErrPrivKey + } + if m["private-key-format"] != "v1.2" && m["private-key-format"] != "v1.3" { + return nil, ErrPrivKey + } + // TODO(mg): check if the pubkey matches the private key + algo, err := strconv.Atoi(strings.SplitN(m["algorithm"], " ", 2)[0]) + if err != nil { + return nil, ErrPrivKey + } + switch uint8(algo) { + case DSA: + priv, err := readPrivateKeyDSA(m) + if err != nil { + return nil, err + } + pub := k.publicKeyDSA() + if pub == nil { + return nil, ErrKey + } + priv.PublicKey = *pub + return priv, nil + case RSAMD5: + fallthrough + case RSASHA1: + fallthrough + case RSASHA1NSEC3SHA1: + fallthrough + case RSASHA256: + fallthrough + case RSASHA512: + priv, err := readPrivateKeyRSA(m) + if err != nil { + return nil, err + } + pub := k.publicKeyRSA() + if pub == nil { + return nil, ErrKey + } + priv.PublicKey = *pub + return priv, nil + case ECCGOST: + return nil, ErrPrivKey + case ECDSAP256SHA256: + fallthrough + case ECDSAP384SHA384: + priv, err := readPrivateKeyECDSA(m) + if err != nil { + return nil, err + } + pub := k.publicKeyECDSA() + if pub == nil { + return nil, ErrKey + } + priv.PublicKey = *pub + return priv, nil + default: + return nil, ErrPrivKey + } +} + +// Read a private key (file) string and create a public key. Return the private key. +func readPrivateKeyRSA(m map[string]string) (*rsa.PrivateKey, error) { + p := new(rsa.PrivateKey) + p.Primes = []*big.Int{nil, nil} + for k, v := range m { + switch k { + case "modulus", "publicexponent", "privateexponent", "prime1", "prime2": + v1, err := fromBase64([]byte(v)) + if err != nil { + return nil, err + } + switch k { + case "modulus": + p.PublicKey.N = big.NewInt(0) + p.PublicKey.N.SetBytes(v1) + case "publicexponent": + i := big.NewInt(0) + i.SetBytes(v1) + p.PublicKey.E = int(i.Int64()) // int64 should be large enough + case "privateexponent": + p.D = big.NewInt(0) + p.D.SetBytes(v1) + case "prime1": + p.Primes[0] = big.NewInt(0) + p.Primes[0].SetBytes(v1) + case "prime2": + p.Primes[1] = big.NewInt(0) + p.Primes[1].SetBytes(v1) + } + case "exponent1", "exponent2", "coefficient": + // not used in Go (yet) + case "created", "publish", "activate": + // not used in Go (yet) + } + } + return p, nil +} + +func readPrivateKeyDSA(m map[string]string) (*dsa.PrivateKey, error) { + p := new(dsa.PrivateKey) + p.X = big.NewInt(0) + for k, v := range m { + switch k { + case "private_value(x)": + v1, err := fromBase64([]byte(v)) + if err != nil { + return nil, err + } + p.X.SetBytes(v1) + case "created", "publish", "activate": + /* not used in Go (yet) */ + } + } + return p, nil +} + +func readPrivateKeyECDSA(m map[string]string) (*ecdsa.PrivateKey, error) { + p := new(ecdsa.PrivateKey) + p.D = big.NewInt(0) + // TODO: validate that the required flags are present + for k, v := range m { + switch k { + case "privatekey": + v1, err := fromBase64([]byte(v)) + if err != nil { + return nil, err + } + p.D.SetBytes(v1) + case "created", "publish", "activate": + /* not used in Go (yet) */ + } + } + return p, nil +} + +// parseKey reads a private key from r. It returns a map[string]string, +// with the key-value pairs, or an error when the file is not correct. +func parseKey(r io.Reader, file string) (map[string]string, error) { + s := scanInit(r) + m := make(map[string]string) + c := make(chan lex) + k := "" + // Start the lexer + go klexer(s, c) + for l := range c { + // It should alternate + switch l.value { + case zKey: + k = l.token + case zValue: + if k == "" { + return nil, &ParseError{file, "no private key seen", l} + } + //println("Setting", strings.ToLower(k), "to", l.token, "b") + m[strings.ToLower(k)] = l.token + k = "" + } + } + return m, nil +} + +// klexer scans the sourcefile and returns tokens on the channel c. +func klexer(s *scan, c chan lex) { + var l lex + str := "" // Hold the current read text + commt := false + key := true + x, err := s.tokenText() + defer close(c) + for err == nil { + l.column = s.position.Column + l.line = s.position.Line + switch x { + case ':': + if commt { + break + } + l.token = str + if key { + l.value = zKey + c <- l + // Next token is a space, eat it + s.tokenText() + key = false + str = "" + } else { + l.value = zValue + } + case ';': + commt = true + case '\n': + if commt { + // Reset a comment + commt = false + } + l.value = zValue + l.token = str + c <- l + str = "" + commt = false + key = true + default: + if commt { + break + } + str += string(x) + } + x, err = s.tokenText() + } + if len(str) > 0 { + // Send remainder + l.token = str + l.value = zValue + c <- l + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec_privkey.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec_privkey.go new file mode 100644 index 00000000..56f3ea93 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnssec_privkey.go @@ -0,0 +1,85 @@ +package dns + +import ( + "crypto" + "crypto/dsa" + "crypto/ecdsa" + "crypto/rsa" + "math/big" + "strconv" +) + +const format = "Private-key-format: v1.3\n" + +// PrivateKeyString converts a PrivateKey to a string. This string has the same +// format as the private-key-file of BIND9 (Private-key-format: v1.3). +// It needs some info from the key (the algorithm), so its a method of the DNSKEY +// It supports rsa.PrivateKey, ecdsa.PrivateKey and dsa.PrivateKey +func (r *DNSKEY) PrivateKeyString(p crypto.PrivateKey) string { + algorithm := strconv.Itoa(int(r.Algorithm)) + algorithm += " (" + AlgorithmToString[r.Algorithm] + ")" + + switch p := p.(type) { + case *rsa.PrivateKey: + modulus := toBase64(p.PublicKey.N.Bytes()) + e := big.NewInt(int64(p.PublicKey.E)) + publicExponent := toBase64(e.Bytes()) + privateExponent := toBase64(p.D.Bytes()) + prime1 := toBase64(p.Primes[0].Bytes()) + prime2 := toBase64(p.Primes[1].Bytes()) + // Calculate Exponent1/2 and Coefficient as per: http://en.wikipedia.org/wiki/RSA#Using_the_Chinese_remainder_algorithm + // and from: http://code.google.com/p/go/issues/detail?id=987 + one := big.NewInt(1) + p1 := big.NewInt(0).Sub(p.Primes[0], one) + q1 := big.NewInt(0).Sub(p.Primes[1], one) + exp1 := big.NewInt(0).Mod(p.D, p1) + exp2 := big.NewInt(0).Mod(p.D, q1) + coeff := big.NewInt(0).ModInverse(p.Primes[1], p.Primes[0]) + + exponent1 := toBase64(exp1.Bytes()) + exponent2 := toBase64(exp2.Bytes()) + coefficient := toBase64(coeff.Bytes()) + + return format + + "Algorithm: " + algorithm + "\n" + + "Modulus: " + modulus + "\n" + + "PublicExponent: " + publicExponent + "\n" + + "PrivateExponent: " + privateExponent + "\n" + + "Prime1: " + prime1 + "\n" + + "Prime2: " + prime2 + "\n" + + "Exponent1: " + exponent1 + "\n" + + "Exponent2: " + exponent2 + "\n" + + "Coefficient: " + coefficient + "\n" + + case *ecdsa.PrivateKey: + var intlen int + switch r.Algorithm { + case ECDSAP256SHA256: + intlen = 32 + case ECDSAP384SHA384: + intlen = 48 + } + private := toBase64(intToBytes(p.D, intlen)) + return format + + "Algorithm: " + algorithm + "\n" + + "PrivateKey: " + private + "\n" + + case *dsa.PrivateKey: + T := divRoundUp(divRoundUp(p.PublicKey.Parameters.G.BitLen(), 8)-64, 8) + prime := toBase64(intToBytes(p.PublicKey.Parameters.P, 64+T*8)) + subprime := toBase64(intToBytes(p.PublicKey.Parameters.Q, 20)) + base := toBase64(intToBytes(p.PublicKey.Parameters.G, 64+T*8)) + priv := toBase64(intToBytes(p.X, 20)) + pub := toBase64(intToBytes(p.PublicKey.Y, 64+T*8)) + return format + + "Algorithm: " + algorithm + "\n" + + "Prime(p): " + prime + "\n" + + "Subprime(q): " + subprime + "\n" + + "Base(g): " + base + "\n" + + "Private_value(x): " + priv + "\n" + + "Public_value(y): " + pub + "\n" + + default: + return "" + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnsutil/util.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnsutil/util.go new file mode 100644 index 00000000..9ed03f29 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/dnsutil/util.go @@ -0,0 +1,79 @@ +// Package dnsutil contains higher-level methods useful with the dns +// package. While package dns implements the DNS protocols itself, +// these functions are related but not directly required for protocol +// processing. They are often useful in preparing input/output of the +// functions in package dns. +package dnsutil + +import ( + "strings" + + "github.com/miekg/dns" +) + +// AddDomain adds origin to s if s is not already a FQDN. +// Note that the result may not be a FQDN. If origin does not end +// with a ".", the result won't either. +// This implements the zonefile convention (specified in RFC 1035, +// Section "5.1. Format") that "@" represents the +// apex (bare) domain. i.e. AddOrigin("@", "foo.com.") returns "foo.com.". +func AddOrigin(s, origin string) string { + // ("foo.", "origin.") -> "foo." (already a FQDN) + // ("foo", "origin.") -> "foo.origin." + // ("foo"), "origin" -> "foo.origin" + // ("@", "origin.") -> "origin." (@ represents the apex (bare) domain) + // ("", "origin.") -> "origin." (not obvious) + // ("foo", "") -> "foo" (not obvious) + + if dns.IsFqdn(s) { + return s // s is already a FQDN, no need to mess with it. + } + if len(origin) == 0 { + return s // Nothing to append. + } + if s == "@" || len(s) == 0 { + return origin // Expand apex. + } + + if origin == "." { + return s + origin // AddOrigin(s, ".") is an expensive way to add a ".". + } + + return s + "." + origin // The simple case. +} + +// TrimDomainName trims origin from s if s is a subdomain. +// This function will never return "", but returns "@" instead (@ represents the apex (bare) domain). +func TrimDomainName(s, origin string) string { + // An apex (bare) domain is always returned as "@". + // If the return value ends in a ".", the domain was not the suffix. + // origin can end in "." or not. Either way the results should be the same. + + if len(s) == 0 { + return "@" // Return the apex (@) rather than "". + } + // Someone is using TrimDomainName(s, ".") to remove a dot if it exists. + if origin == "." { + return strings.TrimSuffix(s, origin) + } + + // Dude, you aren't even if the right subdomain! + if !dns.IsSubDomain(origin, s) { + return s + } + + slabels := dns.Split(s) + olabels := dns.Split(origin) + m := dns.CompareDomainName(s, origin) + if len(olabels) == m { + if len(olabels) == len(slabels) { + return "@" // origin == s + } + if (s[0] == '.') && (len(slabels) == (len(olabels) + 1)) { + return "@" // TrimDomainName(".foo.", "foo.") + } + } + + // Return the first (len-m) labels: + return s[:slabels[len(slabels)-m]-1] +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/doc.go new file mode 100644 index 00000000..f3555e43 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/doc.go @@ -0,0 +1,251 @@ +/* +Package dns implements a full featured interface to the Domain Name System. +Server- and client-side programming is supported. +The package allows complete control over what is send out to the DNS. The package +API follows the less-is-more principle, by presenting a small, clean interface. + +The package dns supports (asynchronous) querying/replying, incoming/outgoing zone transfers, +TSIG, EDNS0, dynamic updates, notifies and DNSSEC validation/signing. +Note that domain names MUST be fully qualified, before sending them, unqualified +names in a message will result in a packing failure. + +Resource records are native types. They are not stored in wire format. +Basic usage pattern for creating a new resource record: + + r := new(dns.MX) + r.Hdr = dns.RR_Header{Name: "miek.nl.", Rrtype: dns.TypeMX, + Class: dns.ClassINET, Ttl: 3600} + r.Preference = 10 + r.Mx = "mx.miek.nl." + +Or directly from a string: + + mx, err := dns.NewRR("miek.nl. 3600 IN MX 10 mx.miek.nl.") + +Or when the default TTL (3600) and class (IN) suit you: + + mx, err := dns.NewRR("miek.nl. MX 10 mx.miek.nl.") + +Or even: + + mx, err := dns.NewRR("$ORIGIN nl.\nmiek 1H IN MX 10 mx.miek") + +In the DNS messages are exchanged, these messages contain resource +records (sets). Use pattern for creating a message: + + m := new(dns.Msg) + m.SetQuestion("miek.nl.", dns.TypeMX) + +Or when not certain if the domain name is fully qualified: + + m.SetQuestion(dns.Fqdn("miek.nl"), dns.TypeMX) + +The message m is now a message with the question section set to ask +the MX records for the miek.nl. zone. + +The following is slightly more verbose, but more flexible: + + m1 := new(dns.Msg) + m1.Id = dns.Id() + m1.RecursionDesired = true + m1.Question = make([]dns.Question, 1) + m1.Question[0] = dns.Question{"miek.nl.", dns.TypeMX, dns.ClassINET} + +After creating a message it can be send. +Basic use pattern for synchronous querying the DNS at a +server configured on 127.0.0.1 and port 53: + + c := new(dns.Client) + in, rtt, err := c.Exchange(m1, "127.0.0.1:53") + +Suppressing multiple outstanding queries (with the same question, type and +class) is as easy as setting: + + c.SingleInflight = true + +If these "advanced" features are not needed, a simple UDP query can be send, +with: + + in, err := dns.Exchange(m1, "127.0.0.1:53") + +When this functions returns you will get dns message. A dns message consists +out of four sections. +The question section: in.Question, the answer section: in.Answer, +the authority section: in.Ns and the additional section: in.Extra. + +Each of these sections (except the Question section) contain a []RR. Basic +use pattern for accessing the rdata of a TXT RR as the first RR in +the Answer section: + + if t, ok := in.Answer[0].(*dns.TXT); ok { + // do something with t.Txt + } + +Domain Name and TXT Character String Representations + +Both domain names and TXT character strings are converted to presentation +form both when unpacked and when converted to strings. + +For TXT character strings, tabs, carriage returns and line feeds will be +converted to \t, \r and \n respectively. Back slashes and quotations marks +will be escaped. Bytes below 32 and above 127 will be converted to \DDD +form. + +For domain names, in addition to the above rules brackets, periods, +spaces, semicolons and the at symbol are escaped. + +DNSSEC + +DNSSEC (DNS Security Extension) adds a layer of security to the DNS. It +uses public key cryptography to sign resource records. The +public keys are stored in DNSKEY records and the signatures in RRSIG records. + +Requesting DNSSEC information for a zone is done by adding the DO (DNSSEC OK) bit +to a request. + + m := new(dns.Msg) + m.SetEdns0(4096, true) + +Signature generation, signature verification and key generation are all supported. + +DYNAMIC UPDATES + +Dynamic updates reuses the DNS message format, but renames three of +the sections. Question is Zone, Answer is Prerequisite, Authority is +Update, only the Additional is not renamed. See RFC 2136 for the gory details. + +You can set a rather complex set of rules for the existence of absence of +certain resource records or names in a zone to specify if resource records +should be added or removed. The table from RFC 2136 supplemented with the Go +DNS function shows which functions exist to specify the prerequisites. + + 3.2.4 - Table Of Metavalues Used In Prerequisite Section + + CLASS TYPE RDATA Meaning Function + -------------------------------------------------------------- + ANY ANY empty Name is in use dns.NameUsed + ANY rrset empty RRset exists (value indep) dns.RRsetUsed + NONE ANY empty Name is not in use dns.NameNotUsed + NONE rrset empty RRset does not exist dns.RRsetNotUsed + zone rrset rr RRset exists (value dep) dns.Used + +The prerequisite section can also be left empty. +If you have decided on the prerequisites you can tell what RRs should +be added or deleted. The next table shows the options you have and +what functions to call. + + 3.4.2.6 - Table Of Metavalues Used In Update Section + + CLASS TYPE RDATA Meaning Function + --------------------------------------------------------------- + ANY ANY empty Delete all RRsets from name dns.RemoveName + ANY rrset empty Delete an RRset dns.RemoveRRset + NONE rrset rr Delete an RR from RRset dns.Remove + zone rrset rr Add to an RRset dns.Insert + +TRANSACTION SIGNATURE + +An TSIG or transaction signature adds a HMAC TSIG record to each message sent. +The supported algorithms include: HmacMD5, HmacSHA1, HmacSHA256 and HmacSHA512. + +Basic use pattern when querying with a TSIG name "axfr." (note that these key names +must be fully qualified - as they are domain names) and the base64 secret +"so6ZGir4GPAqINNh9U5c3A==": + + c := new(dns.Client) + c.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} + m := new(dns.Msg) + m.SetQuestion("miek.nl.", dns.TypeMX) + m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) + ... + // When sending the TSIG RR is calculated and filled in before sending + +When requesting an zone transfer (almost all TSIG usage is when requesting zone transfers), with +TSIG, this is the basic use pattern. In this example we request an AXFR for +miek.nl. with TSIG key named "axfr." and secret "so6ZGir4GPAqINNh9U5c3A==" +and using the server 176.58.119.54: + + t := new(dns.Transfer) + m := new(dns.Msg) + t.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} + m.SetAxfr("miek.nl.") + m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) + c, err := t.In(m, "176.58.119.54:53") + for r := range c { ... } + +You can now read the records from the transfer as they come in. Each envelope is checked with TSIG. +If something is not correct an error is returned. + +Basic use pattern validating and replying to a message that has TSIG set. + + server := &dns.Server{Addr: ":53", Net: "udp"} + server.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} + go server.ListenAndServe() + dns.HandleFunc(".", handleRequest) + + func handleRequest(w dns.ResponseWriter, r *dns.Msg) { + m := new(dns.Msg) + m.SetReply(r) + if r.IsTsig() != nil { + if w.TsigStatus() == nil { + // *Msg r has an TSIG record and it was validated + m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) + } else { + // *Msg r has an TSIG records and it was not valided + } + } + w.WriteMsg(m) + } + +PRIVATE RRS + +RFC 6895 sets aside a range of type codes for private use. This range +is 65,280 - 65,534 (0xFF00 - 0xFFFE). When experimenting with new Resource Records these +can be used, before requesting an official type code from IANA. + +see http://miek.nl/posts/2014/Sep/21/Private%20RRs%20and%20IDN%20in%20Go%20DNS/ for more +information. + +EDNS0 + +EDNS0 is an extension mechanism for the DNS defined in RFC 2671 and updated +by RFC 6891. It defines an new RR type, the OPT RR, which is then completely +abused. +Basic use pattern for creating an (empty) OPT RR: + + o := new(dns.OPT) + o.Hdr.Name = "." // MUST be the root zone, per definition. + o.Hdr.Rrtype = dns.TypeOPT + +The rdata of an OPT RR consists out of a slice of EDNS0 (RFC 6891) +interfaces. Currently only a few have been standardized: EDNS0_NSID +(RFC 5001) and EDNS0_SUBNET (draft-vandergaast-edns-client-subnet-02). Note +that these options may be combined in an OPT RR. +Basic use pattern for a server to check if (and which) options are set: + + // o is a dns.OPT + for _, s := range o.Option { + switch e := s.(type) { + case *dns.EDNS0_NSID: + // do stuff with e.Nsid + case *dns.EDNS0_SUBNET: + // access e.Family, e.Address, etc. + } + } + +SIG(0) + +From RFC 2931: + + SIG(0) provides protection for DNS transactions and requests .... + ... protection for glue records, DNS requests, protection for message headers + on requests and responses, and protection of the overall integrity of a response. + +It works like TSIG, except that SIG(0) uses public key cryptography, instead of the shared +secret approach in TSIG. +Supported algorithms: DSA, ECDSAP256SHA256, ECDSAP384SHA384, RSASHA1, RSASHA256 and +RSASHA512. + +Signing subsequent messages in multi-message sessions is not implemented. +*/ +package dns diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/edns.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/edns.go new file mode 100644 index 00000000..7a58aa9b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/edns.go @@ -0,0 +1,532 @@ +package dns + +import ( + "encoding/binary" + "encoding/hex" + "errors" + "net" + "strconv" +) + +// EDNS0 Option codes. +const ( + EDNS0LLQ = 0x1 // long lived queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01 + EDNS0UL = 0x2 // update lease draft: http://files.dns-sd.org/draft-sekar-dns-ul.txt + EDNS0NSID = 0x3 // nsid (RFC5001) + EDNS0DAU = 0x5 // DNSSEC Algorithm Understood + EDNS0DHU = 0x6 // DS Hash Understood + EDNS0N3U = 0x7 // NSEC3 Hash Understood + EDNS0SUBNET = 0x8 // client-subnet (RFC6891) + EDNS0EXPIRE = 0x9 // EDNS0 expire + EDNS0COOKIE = 0xa // EDNS0 Cookie + EDNS0SUBNETDRAFT = 0x50fa // Don't use! Use EDNS0SUBNET + EDNS0LOCALSTART = 0xFDE9 // Beginning of range reserved for local/experimental use (RFC6891) + EDNS0LOCALEND = 0xFFFE // End of range reserved for local/experimental use (RFC6891) + _DO = 1 << 15 // dnssec ok +) + +// OPT is the EDNS0 RR appended to messages to convey extra (meta) information. +// See RFC 6891. +type OPT struct { + Hdr RR_Header + Option []EDNS0 `dns:"opt"` +} + +func (rr *OPT) String() string { + s := "\n;; OPT PSEUDOSECTION:\n; EDNS: version " + strconv.Itoa(int(rr.Version())) + "; " + if rr.Do() { + s += "flags: do; " + } else { + s += "flags: ; " + } + s += "udp: " + strconv.Itoa(int(rr.UDPSize())) + + for _, o := range rr.Option { + switch o.(type) { + case *EDNS0_NSID: + s += "\n; NSID: " + o.String() + h, e := o.pack() + var r string + if e == nil { + for _, c := range h { + r += "(" + string(c) + ")" + } + s += " " + r + } + case *EDNS0_SUBNET: + s += "\n; SUBNET: " + o.String() + if o.(*EDNS0_SUBNET).DraftOption { + s += " (draft)" + } + case *EDNS0_COOKIE: + s += "\n; COOKIE: " + o.String() + case *EDNS0_UL: + s += "\n; UPDATE LEASE: " + o.String() + case *EDNS0_LLQ: + s += "\n; LONG LIVED QUERIES: " + o.String() + case *EDNS0_DAU: + s += "\n; DNSSEC ALGORITHM UNDERSTOOD: " + o.String() + case *EDNS0_DHU: + s += "\n; DS HASH UNDERSTOOD: " + o.String() + case *EDNS0_N3U: + s += "\n; NSEC3 HASH UNDERSTOOD: " + o.String() + case *EDNS0_LOCAL: + s += "\n; LOCAL OPT: " + o.String() + } + } + return s +} + +func (rr *OPT) len() int { + l := rr.Hdr.len() + for i := 0; i < len(rr.Option); i++ { + l += 4 // Account for 2-byte option code and 2-byte option length. + lo, _ := rr.Option[i].pack() + l += len(lo) + } + return l +} + +// return the old value -> delete SetVersion? + +// Version returns the EDNS version used. Only zero is defined. +func (rr *OPT) Version() uint8 { + return uint8((rr.Hdr.Ttl & 0x00FF0000) >> 16) +} + +// SetVersion sets the version of EDNS. This is usually zero. +func (rr *OPT) SetVersion(v uint8) { + rr.Hdr.Ttl = rr.Hdr.Ttl&0xFF00FFFF | (uint32(v) << 16) +} + +// ExtendedRcode returns the EDNS extended RCODE field (the upper 8 bits of the TTL). +func (rr *OPT) ExtendedRcode() int { + return int((rr.Hdr.Ttl&0xFF000000)>>24) + 15 +} + +// SetExtendedRcode sets the EDNS extended RCODE field. +func (rr *OPT) SetExtendedRcode(v uint8) { + if v < RcodeBadVers { // Smaller than 16.. Use the 4 bits you have! + return + } + rr.Hdr.Ttl = rr.Hdr.Ttl&0x00FFFFFF | (uint32(v-15) << 24) +} + +// UDPSize returns the UDP buffer size. +func (rr *OPT) UDPSize() uint16 { + return rr.Hdr.Class +} + +// SetUDPSize sets the UDP buffer size. +func (rr *OPT) SetUDPSize(size uint16) { + rr.Hdr.Class = size +} + +// Do returns the value of the DO (DNSSEC OK) bit. +func (rr *OPT) Do() bool { + return rr.Hdr.Ttl&_DO == _DO +} + +// SetDo sets the DO (DNSSEC OK) bit. +func (rr *OPT) SetDo() { + rr.Hdr.Ttl |= _DO +} + +// EDNS0 defines an EDNS0 Option. An OPT RR can have multiple options appended to it. +type EDNS0 interface { + // Option returns the option code for the option. + Option() uint16 + // pack returns the bytes of the option data. + pack() ([]byte, error) + // unpack sets the data as found in the buffer. Is also sets + // the length of the slice as the length of the option data. + unpack([]byte) error + // String returns the string representation of the option. + String() string +} + +// The nsid EDNS0 option is used to retrieve a nameserver +// identifier. When sending a request Nsid must be set to the empty string +// The identifier is an opaque string encoded as hex. +// Basic use pattern for creating an nsid option: +// +// o := new(dns.OPT) +// o.Hdr.Name = "." +// o.Hdr.Rrtype = dns.TypeOPT +// e := new(dns.EDNS0_NSID) +// e.Code = dns.EDNS0NSID +// e.Nsid = "AA" +// o.Option = append(o.Option, e) +type EDNS0_NSID struct { + Code uint16 // Always EDNS0NSID + Nsid string // This string needs to be hex encoded +} + +func (e *EDNS0_NSID) pack() ([]byte, error) { + h, err := hex.DecodeString(e.Nsid) + if err != nil { + return nil, err + } + return h, nil +} + +func (e *EDNS0_NSID) Option() uint16 { return EDNS0NSID } +func (e *EDNS0_NSID) unpack(b []byte) error { e.Nsid = hex.EncodeToString(b); return nil } +func (e *EDNS0_NSID) String() string { return string(e.Nsid) } + +// EDNS0_SUBNET is the subnet option that is used to give the remote nameserver +// an idea of where the client lives. It can then give back a different +// answer depending on the location or network topology. +// Basic use pattern for creating an subnet option: +// +// o := new(dns.OPT) +// o.Hdr.Name = "." +// o.Hdr.Rrtype = dns.TypeOPT +// e := new(dns.EDNS0_SUBNET) +// e.Code = dns.EDNS0SUBNET +// e.Family = 1 // 1 for IPv4 source address, 2 for IPv6 +// e.NetMask = 32 // 32 for IPV4, 128 for IPv6 +// e.SourceScope = 0 +// e.Address = net.ParseIP("127.0.0.1").To4() // for IPv4 +// // e.Address = net.ParseIP("2001:7b8:32a::2") // for IPV6 +// o.Option = append(o.Option, e) +// +// Note: the spec (draft-ietf-dnsop-edns-client-subnet-00) has some insane logic +// for which netmask applies to the address. This code will parse all the +// available bits when unpacking (up to optlen). When packing it will apply +// SourceNetmask. If you need more advanced logic, patches welcome and good luck. +type EDNS0_SUBNET struct { + Code uint16 // Always EDNS0SUBNET + Family uint16 // 1 for IP, 2 for IP6 + SourceNetmask uint8 + SourceScope uint8 + Address net.IP + DraftOption bool // Set to true if using the old (0x50fa) option code +} + +func (e *EDNS0_SUBNET) Option() uint16 { + if e.DraftOption { + return EDNS0SUBNETDRAFT + } + return EDNS0SUBNET +} + +func (e *EDNS0_SUBNET) pack() ([]byte, error) { + b := make([]byte, 4) + binary.BigEndian.PutUint16(b[0:], e.Family) + b[2] = e.SourceNetmask + b[3] = e.SourceScope + switch e.Family { + case 1: + if e.SourceNetmask > net.IPv4len*8 { + return nil, errors.New("dns: bad netmask") + } + if len(e.Address.To4()) != net.IPv4len { + return nil, errors.New("dns: bad address") + } + ip := e.Address.To4().Mask(net.CIDRMask(int(e.SourceNetmask), net.IPv4len*8)) + needLength := (e.SourceNetmask + 8 - 1) / 8 // division rounding up + b = append(b, ip[:needLength]...) + case 2: + if e.SourceNetmask > net.IPv6len*8 { + return nil, errors.New("dns: bad netmask") + } + if len(e.Address) != net.IPv6len { + return nil, errors.New("dns: bad address") + } + ip := e.Address.Mask(net.CIDRMask(int(e.SourceNetmask), net.IPv6len*8)) + needLength := (e.SourceNetmask + 8 - 1) / 8 // division rounding up + b = append(b, ip[:needLength]...) + default: + return nil, errors.New("dns: bad address family") + } + return b, nil +} + +func (e *EDNS0_SUBNET) unpack(b []byte) error { + if len(b) < 4 { + return ErrBuf + } + e.Family = binary.BigEndian.Uint16(b) + e.SourceNetmask = b[2] + e.SourceScope = b[3] + switch e.Family { + case 1: + if e.SourceNetmask > net.IPv4len*8 || e.SourceScope > net.IPv4len*8 { + return errors.New("dns: bad netmask") + } + addr := make([]byte, net.IPv4len) + for i := 0; i < net.IPv4len && 4+i < len(b); i++ { + addr[i] = b[4+i] + } + e.Address = net.IPv4(addr[0], addr[1], addr[2], addr[3]) + case 2: + if e.SourceNetmask > net.IPv6len*8 || e.SourceScope > net.IPv6len*8 { + return errors.New("dns: bad netmask") + } + addr := make([]byte, net.IPv6len) + for i := 0; i < net.IPv6len && 4+i < len(b); i++ { + addr[i] = b[4+i] + } + e.Address = net.IP{addr[0], addr[1], addr[2], addr[3], addr[4], + addr[5], addr[6], addr[7], addr[8], addr[9], addr[10], + addr[11], addr[12], addr[13], addr[14], addr[15]} + default: + return errors.New("dns: bad address family") + } + return nil +} + +func (e *EDNS0_SUBNET) String() (s string) { + if e.Address == nil { + s = "" + } else if e.Address.To4() != nil { + s = e.Address.String() + } else { + s = "[" + e.Address.String() + "]" + } + s += "/" + strconv.Itoa(int(e.SourceNetmask)) + "/" + strconv.Itoa(int(e.SourceScope)) + return +} + +// The Cookie EDNS0 option +// +// o := new(dns.OPT) +// o.Hdr.Name = "." +// o.Hdr.Rrtype = dns.TypeOPT +// e := new(dns.EDNS0_COOKIE) +// e.Code = dns.EDNS0COOKIE +// e.Cookie = "24a5ac.." +// o.Option = append(o.Option, e) +// +// The Cookie field consists out of a client cookie (RFC 7873 Section 4), that is +// always 8 bytes. It may then optionally be followed by the server cookie. The server +// cookie is of variable length, 8 to a maximum of 32 bytes. In other words: +// +// cCookie := o.Cookie[:16] +// sCookie := o.Cookie[16:] +// +// There is no guarantee that the Cookie string has a specific length. +type EDNS0_COOKIE struct { + Code uint16 // Always EDNS0COOKIE + Cookie string // Hex-encoded cookie data +} + +func (e *EDNS0_COOKIE) pack() ([]byte, error) { + h, err := hex.DecodeString(e.Cookie) + if err != nil { + return nil, err + } + return h, nil +} + +func (e *EDNS0_COOKIE) Option() uint16 { return EDNS0COOKIE } +func (e *EDNS0_COOKIE) unpack(b []byte) error { e.Cookie = hex.EncodeToString(b); return nil } +func (e *EDNS0_COOKIE) String() string { return e.Cookie } + +// The EDNS0_UL (Update Lease) (draft RFC) option is used to tell the server to set +// an expiration on an update RR. This is helpful for clients that cannot clean +// up after themselves. This is a draft RFC and more information can be found at +// http://files.dns-sd.org/draft-sekar-dns-ul.txt +// +// o := new(dns.OPT) +// o.Hdr.Name = "." +// o.Hdr.Rrtype = dns.TypeOPT +// e := new(dns.EDNS0_UL) +// e.Code = dns.EDNS0UL +// e.Lease = 120 // in seconds +// o.Option = append(o.Option, e) +type EDNS0_UL struct { + Code uint16 // Always EDNS0UL + Lease uint32 +} + +func (e *EDNS0_UL) Option() uint16 { return EDNS0UL } +func (e *EDNS0_UL) String() string { return strconv.FormatUint(uint64(e.Lease), 10) } + +// Copied: http://golang.org/src/pkg/net/dnsmsg.go +func (e *EDNS0_UL) pack() ([]byte, error) { + b := make([]byte, 4) + binary.BigEndian.PutUint32(b, e.Lease) + return b, nil +} + +func (e *EDNS0_UL) unpack(b []byte) error { + if len(b) < 4 { + return ErrBuf + } + e.Lease = binary.BigEndian.Uint32(b) + return nil +} + +// EDNS0_LLQ stands for Long Lived Queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01 +// Implemented for completeness, as the EDNS0 type code is assigned. +type EDNS0_LLQ struct { + Code uint16 // Always EDNS0LLQ + Version uint16 + Opcode uint16 + Error uint16 + Id uint64 + LeaseLife uint32 +} + +func (e *EDNS0_LLQ) Option() uint16 { return EDNS0LLQ } + +func (e *EDNS0_LLQ) pack() ([]byte, error) { + b := make([]byte, 18) + binary.BigEndian.PutUint16(b[0:], e.Version) + binary.BigEndian.PutUint16(b[2:], e.Opcode) + binary.BigEndian.PutUint16(b[4:], e.Error) + binary.BigEndian.PutUint64(b[6:], e.Id) + binary.BigEndian.PutUint32(b[14:], e.LeaseLife) + return b, nil +} + +func (e *EDNS0_LLQ) unpack(b []byte) error { + if len(b) < 18 { + return ErrBuf + } + e.Version = binary.BigEndian.Uint16(b[0:]) + e.Opcode = binary.BigEndian.Uint16(b[2:]) + e.Error = binary.BigEndian.Uint16(b[4:]) + e.Id = binary.BigEndian.Uint64(b[6:]) + e.LeaseLife = binary.BigEndian.Uint32(b[14:]) + return nil +} + +func (e *EDNS0_LLQ) String() string { + s := strconv.FormatUint(uint64(e.Version), 10) + " " + strconv.FormatUint(uint64(e.Opcode), 10) + + " " + strconv.FormatUint(uint64(e.Error), 10) + " " + strconv.FormatUint(uint64(e.Id), 10) + + " " + strconv.FormatUint(uint64(e.LeaseLife), 10) + return s +} + +type EDNS0_DAU struct { + Code uint16 // Always EDNS0DAU + AlgCode []uint8 +} + +func (e *EDNS0_DAU) Option() uint16 { return EDNS0DAU } +func (e *EDNS0_DAU) pack() ([]byte, error) { return e.AlgCode, nil } +func (e *EDNS0_DAU) unpack(b []byte) error { e.AlgCode = b; return nil } + +func (e *EDNS0_DAU) String() string { + s := "" + for i := 0; i < len(e.AlgCode); i++ { + if a, ok := AlgorithmToString[e.AlgCode[i]]; ok { + s += " " + a + } else { + s += " " + strconv.Itoa(int(e.AlgCode[i])) + } + } + return s +} + +type EDNS0_DHU struct { + Code uint16 // Always EDNS0DHU + AlgCode []uint8 +} + +func (e *EDNS0_DHU) Option() uint16 { return EDNS0DHU } +func (e *EDNS0_DHU) pack() ([]byte, error) { return e.AlgCode, nil } +func (e *EDNS0_DHU) unpack(b []byte) error { e.AlgCode = b; return nil } + +func (e *EDNS0_DHU) String() string { + s := "" + for i := 0; i < len(e.AlgCode); i++ { + if a, ok := HashToString[e.AlgCode[i]]; ok { + s += " " + a + } else { + s += " " + strconv.Itoa(int(e.AlgCode[i])) + } + } + return s +} + +type EDNS0_N3U struct { + Code uint16 // Always EDNS0N3U + AlgCode []uint8 +} + +func (e *EDNS0_N3U) Option() uint16 { return EDNS0N3U } +func (e *EDNS0_N3U) pack() ([]byte, error) { return e.AlgCode, nil } +func (e *EDNS0_N3U) unpack(b []byte) error { e.AlgCode = b; return nil } + +func (e *EDNS0_N3U) String() string { + // Re-use the hash map + s := "" + for i := 0; i < len(e.AlgCode); i++ { + if a, ok := HashToString[e.AlgCode[i]]; ok { + s += " " + a + } else { + s += " " + strconv.Itoa(int(e.AlgCode[i])) + } + } + return s +} + +type EDNS0_EXPIRE struct { + Code uint16 // Always EDNS0EXPIRE + Expire uint32 +} + +func (e *EDNS0_EXPIRE) Option() uint16 { return EDNS0EXPIRE } +func (e *EDNS0_EXPIRE) String() string { return strconv.FormatUint(uint64(e.Expire), 10) } + +func (e *EDNS0_EXPIRE) pack() ([]byte, error) { + b := make([]byte, 4) + b[0] = byte(e.Expire >> 24) + b[1] = byte(e.Expire >> 16) + b[2] = byte(e.Expire >> 8) + b[3] = byte(e.Expire) + return b, nil +} + +func (e *EDNS0_EXPIRE) unpack(b []byte) error { + if len(b) < 4 { + return ErrBuf + } + e.Expire = binary.BigEndian.Uint32(b) + return nil +} + +// The EDNS0_LOCAL option is used for local/experimental purposes. The option +// code is recommended to be within the range [EDNS0LOCALSTART, EDNS0LOCALEND] +// (RFC6891), although any unassigned code can actually be used. The content of +// the option is made available in Data, unaltered. +// Basic use pattern for creating a local option: +// +// o := new(dns.OPT) +// o.Hdr.Name = "." +// o.Hdr.Rrtype = dns.TypeOPT +// e := new(dns.EDNS0_LOCAL) +// e.Code = dns.EDNS0LOCALSTART +// e.Data = []byte{72, 82, 74} +// o.Option = append(o.Option, e) +type EDNS0_LOCAL struct { + Code uint16 + Data []byte +} + +func (e *EDNS0_LOCAL) Option() uint16 { return e.Code } +func (e *EDNS0_LOCAL) String() string { + return strconv.FormatInt(int64(e.Code), 10) + ":0x" + hex.EncodeToString(e.Data) +} + +func (e *EDNS0_LOCAL) pack() ([]byte, error) { + b := make([]byte, len(e.Data)) + copied := copy(b, e.Data) + if copied != len(e.Data) { + return nil, ErrBuf + } + return b, nil +} + +func (e *EDNS0_LOCAL) unpack(b []byte) error { + e.Data = make([]byte, len(b)) + copied := copy(e.Data, b) + if copied != len(b) { + return ErrBuf + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/format.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/format.go new file mode 100644 index 00000000..3f5303c2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/format.go @@ -0,0 +1,87 @@ +package dns + +import ( + "net" + "reflect" + "strconv" +) + +// NumField returns the number of rdata fields r has. +func NumField(r RR) int { + return reflect.ValueOf(r).Elem().NumField() - 1 // Remove RR_Header +} + +// Field returns the rdata field i as a string. Fields are indexed starting from 1. +// RR types that holds slice data, for instance the NSEC type bitmap will return a single +// string where the types are concatenated using a space. +// Accessing non existing fields will cause a panic. +func Field(r RR, i int) string { + if i == 0 { + return "" + } + d := reflect.ValueOf(r).Elem().Field(i) + switch k := d.Kind(); k { + case reflect.String: + return d.String() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return strconv.FormatInt(d.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return strconv.FormatUint(d.Uint(), 10) + case reflect.Slice: + switch reflect.ValueOf(r).Elem().Type().Field(i).Tag { + case `dns:"a"`: + // TODO(miek): Hmm store this as 16 bytes + if d.Len() < net.IPv6len { + return net.IPv4(byte(d.Index(0).Uint()), + byte(d.Index(1).Uint()), + byte(d.Index(2).Uint()), + byte(d.Index(3).Uint())).String() + } + return net.IPv4(byte(d.Index(12).Uint()), + byte(d.Index(13).Uint()), + byte(d.Index(14).Uint()), + byte(d.Index(15).Uint())).String() + case `dns:"aaaa"`: + return net.IP{ + byte(d.Index(0).Uint()), + byte(d.Index(1).Uint()), + byte(d.Index(2).Uint()), + byte(d.Index(3).Uint()), + byte(d.Index(4).Uint()), + byte(d.Index(5).Uint()), + byte(d.Index(6).Uint()), + byte(d.Index(7).Uint()), + byte(d.Index(8).Uint()), + byte(d.Index(9).Uint()), + byte(d.Index(10).Uint()), + byte(d.Index(11).Uint()), + byte(d.Index(12).Uint()), + byte(d.Index(13).Uint()), + byte(d.Index(14).Uint()), + byte(d.Index(15).Uint()), + }.String() + case `dns:"nsec"`: + if d.Len() == 0 { + return "" + } + s := Type(d.Index(0).Uint()).String() + for i := 1; i < d.Len(); i++ { + s += " " + Type(d.Index(i).Uint()).String() + } + return s + default: + // if it does not have a tag its a string slice + fallthrough + case `dns:"txt"`: + if d.Len() == 0 { + return "" + } + s := d.Index(0).String() + for i := 1; i < d.Len(); i++ { + s += " " + d.Index(i).String() + } + return s + } + } + return "" +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/generate.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/generate.go new file mode 100644 index 00000000..e4481a4b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/generate.go @@ -0,0 +1,159 @@ +package dns + +import ( + "bytes" + "errors" + "fmt" + "strconv" + "strings" +) + +// Parse the $GENERATE statement as used in BIND9 zones. +// See http://www.zytrax.com/books/dns/ch8/generate.html for instance. +// We are called after '$GENERATE '. After which we expect: +// * the range (12-24/2) +// * lhs (ownername) +// * [[ttl][class]] +// * type +// * rhs (rdata) +// But we are lazy here, only the range is parsed *all* occurrences +// of $ after that are interpreted. +// Any error are returned as a string value, the empty string signals +// "no error". +func generate(l lex, c chan lex, t chan *Token, o string) string { + step := 1 + if i := strings.IndexAny(l.token, "/"); i != -1 { + if i+1 == len(l.token) { + return "bad step in $GENERATE range" + } + if s, err := strconv.Atoi(l.token[i+1:]); err == nil { + if s < 0 { + return "bad step in $GENERATE range" + } + step = s + } else { + return "bad step in $GENERATE range" + } + l.token = l.token[:i] + } + sx := strings.SplitN(l.token, "-", 2) + if len(sx) != 2 { + return "bad start-stop in $GENERATE range" + } + start, err := strconv.Atoi(sx[0]) + if err != nil { + return "bad start in $GENERATE range" + } + end, err := strconv.Atoi(sx[1]) + if err != nil { + return "bad stop in $GENERATE range" + } + if end < 0 || start < 0 || end < start { + return "bad range in $GENERATE range" + } + + <-c // _BLANK + // Create a complete new string, which we then parse again. + s := "" +BuildRR: + l = <-c + if l.value != zNewline && l.value != zEOF { + s += l.token + goto BuildRR + } + for i := start; i <= end; i += step { + var ( + escape bool + dom bytes.Buffer + mod string + err error + offset int + ) + + for j := 0; j < len(s); j++ { // No 'range' because we need to jump around + switch s[j] { + case '\\': + if escape { + dom.WriteByte('\\') + escape = false + continue + } + escape = true + case '$': + mod = "%d" + offset = 0 + if escape { + dom.WriteByte('$') + escape = false + continue + } + escape = false + if j+1 >= len(s) { // End of the string + dom.WriteString(fmt.Sprintf(mod, i+offset)) + continue + } else { + if s[j+1] == '$' { + dom.WriteByte('$') + j++ + continue + } + } + // Search for { and } + if s[j+1] == '{' { // Modifier block + sep := strings.Index(s[j+2:], "}") + if sep == -1 { + return "bad modifier in $GENERATE" + } + mod, offset, err = modToPrintf(s[j+2 : j+2+sep]) + if err != nil { + return err.Error() + } + j += 2 + sep // Jump to it + } + dom.WriteString(fmt.Sprintf(mod, i+offset)) + default: + if escape { // Pretty useless here + escape = false + continue + } + dom.WriteByte(s[j]) + } + } + // Re-parse the RR and send it on the current channel t + rx, err := NewRR("$ORIGIN " + o + "\n" + dom.String()) + if err != nil { + return err.Error() + } + t <- &Token{RR: rx} + // Its more efficient to first built the rrlist and then parse it in + // one go! But is this a problem? + } + return "" +} + +// Convert a $GENERATE modifier 0,0,d to something Printf can deal with. +func modToPrintf(s string) (string, int, error) { + xs := strings.SplitN(s, ",", 3) + if len(xs) != 3 { + return "", 0, errors.New("bad modifier in $GENERATE") + } + // xs[0] is offset, xs[1] is width, xs[2] is base + if xs[2] != "o" && xs[2] != "d" && xs[2] != "x" && xs[2] != "X" { + return "", 0, errors.New("bad base in $GENERATE") + } + offset, err := strconv.Atoi(xs[0]) + if err != nil || offset > 255 { + return "", 0, errors.New("bad offset in $GENERATE") + } + width, err := strconv.Atoi(xs[1]) + if err != nil || width > 255 { + return "", offset, errors.New("bad width in $GENERATE") + } + switch { + case width < 0: + return "", offset, errors.New("bad width in $GENERATE") + case width == 0: + return "%" + xs[1] + xs[2], offset, nil + } + return "%0" + xs[1] + xs[2], offset, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/idn/code_points.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/idn/code_points.go new file mode 100644 index 00000000..129c3742 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/idn/code_points.go @@ -0,0 +1,2346 @@ +package idn + +const ( + propertyUnknown property = iota // unknown character property + propertyPVALID // allowed to be used in IDNs + propertyCONTEXTJ // invisible or problematic characters (join controls) + propertyCONTEXTO // invisible or problematic characters (others) + propertyDISALLOWED // should not be included in IDNs + propertyUNASSIGNED // code points that are not designated in the Unicode Standard +) + +// property stores the property of a code point, as described in RFC 5892, +// section 1 +type property int + +// codePoints list all code points in Unicode Character Database (UCD) Format +// according to RFC 5892, appendix B.1. Thanks to libidn2 (GNU) - +// http://www.gnu.org/software/libidn/libidn2/ +var codePoints = []struct { + start rune + end rune + state property +}{ + {0x0000, 0x002C, propertyDISALLOWED}, // ..COMMA + {0x002D, 0x0, propertyPVALID}, // HYPHEN-MINUS + {0x002E, 0x002F, propertyDISALLOWED}, // FULL STOP..SOLIDUS + {0x0030, 0x0039, propertyPVALID}, // DIGIT ZERO..DIGIT NINE + {0x003A, 0x0060, propertyDISALLOWED}, // COLON..GRAVE ACCENT + {0x0041, 0x005A, propertyPVALID}, // LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER Z + {0x0061, 0x007A, propertyPVALID}, // LATIN SMALL LETTER A..LATIN SMALL LETTER Z + {0x007B, 0x00B6, propertyDISALLOWED}, // LEFT CURLY BRACKET..PILCROW SIGN + {0x00B7, 0x0, propertyCONTEXTO}, // MIDDLE DOT + {0x00B8, 0x00DE, propertyDISALLOWED}, // CEDILLA..LATIN CAPITAL LETTER THORN + {0x00DF, 0x00F6, propertyPVALID}, // LATIN SMALL LETTER SHARP S..LATIN SMALL LETT + {0x00F7, 0x0, propertyDISALLOWED}, // DIVISION SIGN + {0x00F8, 0x00FF, propertyPVALID}, // LATIN SMALL LETTER O WITH STROKE..LATIN SMAL + {0x0100, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH MACRON + {0x0101, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH MACRON + {0x0102, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH BREVE + {0x0103, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH BREVE + {0x0104, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH OGONEK + {0x0105, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH OGONEK + {0x0106, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER C WITH ACUTE + {0x0107, 0x0, propertyPVALID}, // LATIN SMALL LETTER C WITH ACUTE + {0x0108, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER C WITH CIRCUMFLEX + {0x0109, 0x0, propertyPVALID}, // LATIN SMALL LETTER C WITH CIRCUMFLEX + {0x010A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER C WITH DOT ABOVE + {0x010B, 0x0, propertyPVALID}, // LATIN SMALL LETTER C WITH DOT ABOVE + {0x010C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER C WITH CARON + {0x010D, 0x0, propertyPVALID}, // LATIN SMALL LETTER C WITH CARON + {0x010E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER D WITH CARON + {0x010F, 0x0, propertyPVALID}, // LATIN SMALL LETTER D WITH CARON + {0x0110, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER D WITH STROKE + {0x0111, 0x0, propertyPVALID}, // LATIN SMALL LETTER D WITH STROKE + {0x0112, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH MACRON + {0x0113, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH MACRON + {0x0114, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH BREVE + {0x0115, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH BREVE + {0x0116, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH DOT ABOVE + {0x0117, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH DOT ABOVE + {0x0118, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH OGONEK + {0x0119, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH OGONEK + {0x011A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH CARON + {0x011B, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH CARON + {0x011C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER G WITH CIRCUMFLEX + {0x011D, 0x0, propertyPVALID}, // LATIN SMALL LETTER G WITH CIRCUMFLEX + {0x011E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER G WITH BREVE + {0x011F, 0x0, propertyPVALID}, // LATIN SMALL LETTER G WITH BREVE + {0x0120, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER G WITH DOT ABOVE + {0x0121, 0x0, propertyPVALID}, // LATIN SMALL LETTER G WITH DOT ABOVE + {0x0122, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER G WITH CEDILLA + {0x0123, 0x0, propertyPVALID}, // LATIN SMALL LETTER G WITH CEDILLA + {0x0124, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER H WITH CIRCUMFLEX + {0x0125, 0x0, propertyPVALID}, // LATIN SMALL LETTER H WITH CIRCUMFLEX + {0x0126, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER H WITH STROKE + {0x0127, 0x0, propertyPVALID}, // LATIN SMALL LETTER H WITH STROKE + {0x0128, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH TILDE + {0x0129, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH TILDE + {0x012A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH MACRON + {0x012B, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH MACRON + {0x012C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH BREVE + {0x012D, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH BREVE + {0x012E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH OGONEK + {0x012F, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH OGONEK + {0x0130, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH DOT ABOVE + {0x0131, 0x0, propertyPVALID}, // LATIN SMALL LETTER DOTLESS I + {0x0132, 0x0134, propertyDISALLOWED}, // LATIN CAPITAL LIGATURE IJ..LATIN CAPITAL LET + {0x0135, 0x0, propertyPVALID}, // LATIN SMALL LETTER J WITH CIRCUMFLEX + {0x0136, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER K WITH CEDILLA + {0x0137, 0x0138, propertyPVALID}, // LATIN SMALL LETTER K WITH CEDILLA..LATIN SMA + {0x0139, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH ACUTE + {0x013A, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH ACUTE + {0x013B, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH CEDILLA + {0x013C, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH CEDILLA + {0x013D, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH CARON + {0x013E, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH CARON + {0x013F, 0x0141, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH MIDDLE DOT..LATI + {0x0142, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH STROKE + {0x0143, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER N WITH ACUTE + {0x0144, 0x0, propertyPVALID}, // LATIN SMALL LETTER N WITH ACUTE + {0x0145, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER N WITH CEDILLA + {0x0146, 0x0, propertyPVALID}, // LATIN SMALL LETTER N WITH CEDILLA + {0x0147, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER N WITH CARON + {0x0148, 0x0, propertyPVALID}, // LATIN SMALL LETTER N WITH CARON + {0x0149, 0x014A, propertyDISALLOWED}, // LATIN SMALL LETTER N PRECEDED BY APOSTROPHE. + {0x014B, 0x0, propertyPVALID}, // LATIN SMALL LETTER ENG + {0x014C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH MACRON + {0x014D, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH MACRON + {0x014E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH BREVE + {0x014F, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH BREVE + {0x0150, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE + {0x0151, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH DOUBLE ACUTE + {0x0152, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LIGATURE OE + {0x0153, 0x0, propertyPVALID}, // LATIN SMALL LIGATURE OE + {0x0154, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH ACUTE + {0x0155, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH ACUTE + {0x0156, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH CEDILLA + {0x0157, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH CEDILLA + {0x0158, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH CARON + {0x0159, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH CARON + {0x015A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH ACUTE + {0x015B, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH ACUTE + {0x015C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH CIRCUMFLEX + {0x015D, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH CIRCUMFLEX + {0x015E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH CEDILLA + {0x015F, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH CEDILLA + {0x0160, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH CARON + {0x0161, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH CARON + {0x0162, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH CEDILLA + {0x0163, 0x0, propertyPVALID}, // LATIN SMALL LETTER T WITH CEDILLA + {0x0164, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH CARON + {0x0165, 0x0, propertyPVALID}, // LATIN SMALL LETTER T WITH CARON + {0x0166, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH STROKE + {0x0167, 0x0, propertyPVALID}, // LATIN SMALL LETTER T WITH STROKE + {0x0168, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH TILDE + {0x0169, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH TILDE + {0x016A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH MACRON + {0x016B, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH MACRON + {0x016C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH BREVE + {0x016D, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH BREVE + {0x016E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH RING ABOVE + {0x016F, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH RING ABOVE + {0x0170, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE + {0x0171, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH DOUBLE ACUTE + {0x0172, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH OGONEK + {0x0173, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH OGONEK + {0x0174, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER W WITH CIRCUMFLEX + {0x0175, 0x0, propertyPVALID}, // LATIN SMALL LETTER W WITH CIRCUMFLEX + {0x0176, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH CIRCUMFLEX + {0x0177, 0x0, propertyPVALID}, // LATIN SMALL LETTER Y WITH CIRCUMFLEX + {0x0178, 0x0179, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH DIAERESIS..LATIN + {0x017A, 0x0, propertyPVALID}, // LATIN SMALL LETTER Z WITH ACUTE + {0x017B, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Z WITH DOT ABOVE + {0x017C, 0x0, propertyPVALID}, // LATIN SMALL LETTER Z WITH DOT ABOVE + {0x017D, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Z WITH CARON + {0x017E, 0x0, propertyPVALID}, // LATIN SMALL LETTER Z WITH CARON + {0x017F, 0x0, propertyDISALLOWED}, // LATIN SMALL LETTER LONG S + {0x0180, 0x0, propertyPVALID}, // LATIN SMALL LETTER B WITH STROKE + {0x0181, 0x0182, propertyDISALLOWED}, // LATIN CAPITAL LETTER B WITH HOOK..LATIN CAPI + {0x0183, 0x0, propertyPVALID}, // LATIN SMALL LETTER B WITH TOPBAR + {0x0184, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER TONE SIX + {0x0185, 0x0, propertyPVALID}, // LATIN SMALL LETTER TONE SIX + {0x0186, 0x0187, propertyDISALLOWED}, // LATIN CAPITAL LETTER OPEN O..LATIN CAPITAL L + {0x0188, 0x0, propertyPVALID}, // LATIN SMALL LETTER C WITH HOOK + {0x0189, 0x018B, propertyDISALLOWED}, // LATIN CAPITAL LETTER AFRICAN D..LATIN CAPITA + {0x018C, 0x018D, propertyPVALID}, // LATIN SMALL LETTER D WITH TOPBAR..LATIN SMAL + {0x018E, 0x0191, propertyDISALLOWED}, // LATIN CAPITAL LETTER REVERSED E..LATIN CAPIT + {0x0192, 0x0, propertyPVALID}, // LATIN SMALL LETTER F WITH HOOK + {0x0193, 0x0194, propertyDISALLOWED}, // LATIN CAPITAL LETTER G WITH HOOK..LATIN CAPI + {0x0195, 0x0, propertyPVALID}, // LATIN SMALL LETTER HV + {0x0196, 0x0198, propertyDISALLOWED}, // LATIN CAPITAL LETTER IOTA..LATIN CAPITAL LET + {0x0199, 0x019B, propertyPVALID}, // LATIN SMALL LETTER K WITH HOOK..LATIN SMALL + {0x019C, 0x019D, propertyDISALLOWED}, // LATIN CAPITAL LETTER TURNED M..LATIN CAPITAL + {0x019E, 0x0, propertyPVALID}, // LATIN SMALL LETTER N WITH LONG RIGHT LEG + {0x019F, 0x01A0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH MIDDLE TILDE..LA + {0x01A1, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH HORN + {0x01A2, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER OI + {0x01A3, 0x0, propertyPVALID}, // LATIN SMALL LETTER OI + {0x01A4, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER P WITH HOOK + {0x01A5, 0x0, propertyPVALID}, // LATIN SMALL LETTER P WITH HOOK + {0x01A6, 0x01A7, propertyDISALLOWED}, // LATIN LETTER YR..LATIN CAPITAL LETTER TONE T + {0x01A8, 0x0, propertyPVALID}, // LATIN SMALL LETTER TONE TWO + {0x01A9, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER ESH + {0x01AA, 0x01AB, propertyPVALID}, // LATIN LETTER REVERSED ESH LOOP..LATIN SMALL + {0x01AC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH HOOK + {0x01AD, 0x0, propertyPVALID}, // LATIN SMALL LETTER T WITH HOOK + {0x01AE, 0x01AF, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH RETROFLEX HOOK.. + {0x01B0, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH HORN + {0x01B1, 0x01B3, propertyDISALLOWED}, // LATIN CAPITAL LETTER UPSILON..LATIN CAPITAL + {0x01B4, 0x0, propertyPVALID}, // LATIN SMALL LETTER Y WITH HOOK + {0x01B5, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Z WITH STROKE + {0x01B6, 0x0, propertyPVALID}, // LATIN SMALL LETTER Z WITH STROKE + {0x01B7, 0x01B8, propertyDISALLOWED}, // LATIN CAPITAL LETTER EZH..LATIN CAPITAL LETT + {0x01B9, 0x01BB, propertyPVALID}, // LATIN SMALL LETTER EZH REVERSED..LATIN LETTE + {0x01BC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER TONE FIVE + {0x01BD, 0x01C3, propertyPVALID}, // LATIN SMALL LETTER TONE FIVE..LATIN LETTER R + {0x01C4, 0x01CD, propertyDISALLOWED}, // LATIN CAPITAL LETTER DZ WITH CARON..LATIN CA + {0x01CE, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH CARON + {0x01CF, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH CARON + {0x01D0, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH CARON + {0x01D1, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH CARON + {0x01D2, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH CARON + {0x01D3, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH CARON + {0x01D4, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH CARON + {0x01D5, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH DIAERESIS AND MA + {0x01D6, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH DIAERESIS AND MACR + {0x01D7, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH DIAERESIS AND AC + {0x01D8, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH DIAERESIS AND ACUT + {0x01D9, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH DIAERESIS AND CA + {0x01DA, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH DIAERESIS AND CARO + {0x01DB, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH DIAERESIS AND GR + {0x01DC, 0x01DD, propertyPVALID}, // LATIN SMALL LETTER U WITH DIAERESIS AND GRAV + {0x01DE, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH DIAERESIS AND MA + {0x01DF, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH DIAERESIS AND MACR + {0x01E0, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH DOT ABOVE AND MA + {0x01E1, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH DOT ABOVE AND MACR + {0x01E2, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER AE WITH MACRON + {0x01E3, 0x0, propertyPVALID}, // LATIN SMALL LETTER AE WITH MACRON + {0x01E4, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER G WITH STROKE + {0x01E5, 0x0, propertyPVALID}, // LATIN SMALL LETTER G WITH STROKE + {0x01E6, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER G WITH CARON + {0x01E7, 0x0, propertyPVALID}, // LATIN SMALL LETTER G WITH CARON + {0x01E8, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER K WITH CARON + {0x01E9, 0x0, propertyPVALID}, // LATIN SMALL LETTER K WITH CARON + {0x01EA, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH OGONEK + {0x01EB, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH OGONEK + {0x01EC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH OGONEK AND MACRO + {0x01ED, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH OGONEK AND MACRON + {0x01EE, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER EZH WITH CARON + {0x01EF, 0x01F0, propertyPVALID}, // LATIN SMALL LETTER EZH WITH CARON..LATIN SMA + {0x01F1, 0x01F4, propertyDISALLOWED}, // LATIN CAPITAL LETTER DZ..LATIN CAPITAL LETTE + {0x01F5, 0x0, propertyPVALID}, // LATIN SMALL LETTER G WITH ACUTE + {0x01F6, 0x01F8, propertyDISALLOWED}, // LATIN CAPITAL LETTER HWAIR..LATIN CAPITAL LE + {0x01F9, 0x0, propertyPVALID}, // LATIN SMALL LETTER N WITH GRAVE + {0x01FA, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH RING ABOVE AND A + {0x01FB, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH RING ABOVE AND ACU + {0x01FC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER AE WITH ACUTE + {0x01FD, 0x0, propertyPVALID}, // LATIN SMALL LETTER AE WITH ACUTE + {0x01FE, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH STROKE AND ACUTE + {0x01FF, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH STROKE AND ACUTE + {0x0200, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH DOUBLE GRAVE + {0x0201, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH DOUBLE GRAVE + {0x0202, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH INVERTED BREVE + {0x0203, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH INVERTED BREVE + {0x0204, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH DOUBLE GRAVE + {0x0205, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH DOUBLE GRAVE + {0x0206, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH INVERTED BREVE + {0x0207, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH INVERTED BREVE + {0x0208, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH DOUBLE GRAVE + {0x0209, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH DOUBLE GRAVE + {0x020A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH INVERTED BREVE + {0x020B, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH INVERTED BREVE + {0x020C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH DOUBLE GRAVE + {0x020D, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH DOUBLE GRAVE + {0x020E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH INVERTED BREVE + {0x020F, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH INVERTED BREVE + {0x0210, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH DOUBLE GRAVE + {0x0211, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH DOUBLE GRAVE + {0x0212, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH INVERTED BREVE + {0x0213, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH INVERTED BREVE + {0x0214, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH DOUBLE GRAVE + {0x0215, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH DOUBLE GRAVE + {0x0216, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH INVERTED BREVE + {0x0217, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH INVERTED BREVE + {0x0218, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH COMMA BELOW + {0x0219, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH COMMA BELOW + {0x021A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH COMMA BELOW + {0x021B, 0x0, propertyPVALID}, // LATIN SMALL LETTER T WITH COMMA BELOW + {0x021C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER YOGH + {0x021D, 0x0, propertyPVALID}, // LATIN SMALL LETTER YOGH + {0x021E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER H WITH CARON + {0x021F, 0x0, propertyPVALID}, // LATIN SMALL LETTER H WITH CARON + {0x0220, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER N WITH LONG RIGHT LEG + {0x0221, 0x0, propertyPVALID}, // LATIN SMALL LETTER D WITH CURL + {0x0222, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER OU + {0x0223, 0x0, propertyPVALID}, // LATIN SMALL LETTER OU + {0x0224, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Z WITH HOOK + {0x0225, 0x0, propertyPVALID}, // LATIN SMALL LETTER Z WITH HOOK + {0x0226, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH DOT ABOVE + {0x0227, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH DOT ABOVE + {0x0228, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH CEDILLA + {0x0229, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH CEDILLA + {0x022A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH DIAERESIS AND MA + {0x022B, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH DIAERESIS AND MACR + {0x022C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH TILDE AND MACRON + {0x022D, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH TILDE AND MACRON + {0x022E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH DOT ABOVE + {0x022F, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH DOT ABOVE + {0x0230, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH DOT ABOVE AND MA + {0x0231, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH DOT ABOVE AND MACR + {0x0232, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH MACRON + {0x0233, 0x0239, propertyPVALID}, // LATIN SMALL LETTER Y WITH MACRON..LATIN SMAL + {0x023A, 0x023B, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH STROKE..LATIN CA + {0x023C, 0x0, propertyPVALID}, // LATIN SMALL LETTER C WITH STROKE + {0x023D, 0x023E, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH BAR..LATIN CAPIT + {0x023F, 0x0240, propertyPVALID}, // LATIN SMALL LETTER S WITH SWASH TAIL..LATIN + {0x0241, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER GLOTTAL STOP + {0x0242, 0x0, propertyPVALID}, // LATIN SMALL LETTER GLOTTAL STOP + {0x0243, 0x0246, propertyDISALLOWED}, // LATIN CAPITAL LETTER B WITH STROKE..LATIN CA + {0x0247, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH STROKE + {0x0248, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER J WITH STROKE + {0x0249, 0x0, propertyPVALID}, // LATIN SMALL LETTER J WITH STROKE + {0x024A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL + {0x024B, 0x0, propertyPVALID}, // LATIN SMALL LETTER Q WITH HOOK TAIL + {0x024C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH STROKE + {0x024D, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH STROKE + {0x024E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH STROKE + {0x024F, 0x02AF, propertyPVALID}, // LATIN SMALL LETTER Y WITH STROKE..LATIN SMAL + {0x02B0, 0x02B8, propertyDISALLOWED}, // MODIFIER LETTER SMALL H..MODIFIER LETTER SMA + {0x02B9, 0x02C1, propertyPVALID}, // MODIFIER LETTER PRIME..MODIFIER LETTER REVER + {0x02C2, 0x02C5, propertyDISALLOWED}, // MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LET + {0x02C6, 0x02D1, propertyPVALID}, // MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER + {0x02D2, 0x02EB, propertyDISALLOWED}, // MODIFIER LETTER CENTRED RIGHT HALF RING..MOD + {0x02EC, 0x0, propertyPVALID}, // MODIFIER LETTER VOICING + {0x02ED, 0x0, propertyDISALLOWED}, // MODIFIER LETTER UNASPIRATED + {0x02EE, 0x0, propertyPVALID}, // MODIFIER LETTER DOUBLE APOSTROPHE + {0x02EF, 0x02FF, propertyDISALLOWED}, // MODIFIER LETTER LOW DOWN ARROWHEAD..MODIFIER + {0x0300, 0x033F, propertyPVALID}, // COMBINING GRAVE ACCENT..COMBINING DOUBLE OVE + {0x0340, 0x0341, propertyDISALLOWED}, // COMBINING GRAVE TONE MARK..COMBINING ACUTE T + {0x0342, 0x0, propertyPVALID}, // COMBINING GREEK PERISPOMENI + {0x0343, 0x0345, propertyDISALLOWED}, // COMBINING GREEK KORONIS..COMBINING GREEK YPO + {0x0346, 0x034E, propertyPVALID}, // COMBINING BRIDGE ABOVE..COMBINING UPWARDS AR + {0x034F, 0x0, propertyDISALLOWED}, // COMBINING GRAPHEME JOINER + {0x0350, 0x036F, propertyPVALID}, // COMBINING RIGHT ARROWHEAD ABOVE..COMBINING L + {0x0370, 0x0, propertyDISALLOWED}, // GREEK CAPITAL LETTER HETA + {0x0371, 0x0, propertyPVALID}, // GREEK SMALL LETTER HETA + {0x0372, 0x0, propertyDISALLOWED}, // GREEK CAPITAL LETTER ARCHAIC SAMPI + {0x0373, 0x0, propertyPVALID}, // GREEK SMALL LETTER ARCHAIC SAMPI + {0x0374, 0x0, propertyDISALLOWED}, // GREEK NUMERAL SIGN + {0x0375, 0x0, propertyCONTEXTO}, // GREEK LOWER NUMERAL SIGN + {0x0376, 0x0, propertyDISALLOWED}, // GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA + {0x0377, 0x0, propertyPVALID}, // GREEK SMALL LETTER PAMPHYLIAN DIGAMMA + {0x0378, 0x0379, propertyUNASSIGNED}, // .. + {0x037A, 0x0, propertyDISALLOWED}, // GREEK YPOGEGRAMMENI + {0x037B, 0x037D, propertyPVALID}, // GREEK SMALL REVERSED LUNATE SIGMA SYMBOL..GR + {0x037E, 0x0, propertyDISALLOWED}, // GREEK QUESTION MARK + {0x037F, 0x0383, propertyUNASSIGNED}, // .. + {0x0384, 0x038A, propertyDISALLOWED}, // GREEK TONOS..GREEK CAPITAL LETTER IOTA WITH + {0x038B, 0x0, propertyUNASSIGNED}, // + {0x038C, 0x0, propertyDISALLOWED}, // GREEK CAPITAL LETTER OMICRON WITH TONOS + {0x038D, 0x0, propertyUNASSIGNED}, // + {0x038E, 0x038F, propertyDISALLOWED}, // GREEK CAPITAL LETTER UPSILON WITH TONOS..GRE + {0x0390, 0x0, propertyPVALID}, // GREEK SMALL LETTER IOTA WITH DIALYTIKA AND T + {0x0391, 0x03A1, propertyDISALLOWED}, // GREEK CAPITAL LETTER ALPHA..GREEK CAPITAL LE + {0x03A2, 0x0, propertyUNASSIGNED}, // + {0x03A3, 0x03AB, propertyDISALLOWED}, // GREEK CAPITAL LETTER SIGMA..GREEK CAPITAL LE + {0x03AC, 0x03CE, propertyPVALID}, // GREEK SMALL LETTER ALPHA WITH TONOS..GREEK S + {0x03CF, 0x03D6, propertyDISALLOWED}, // GREEK CAPITAL KAI SYMBOL..GREEK PI SYMBOL + {0x03D7, 0x0, propertyPVALID}, // GREEK KAI SYMBOL + {0x03D8, 0x0, propertyDISALLOWED}, // GREEK LETTER ARCHAIC KOPPA + {0x03D9, 0x0, propertyPVALID}, // GREEK SMALL LETTER ARCHAIC KOPPA + {0x03DA, 0x0, propertyDISALLOWED}, // GREEK LETTER STIGMA + {0x03DB, 0x0, propertyPVALID}, // GREEK SMALL LETTER STIGMA + {0x03DC, 0x0, propertyDISALLOWED}, // GREEK LETTER DIGAMMA + {0x03DD, 0x0, propertyPVALID}, // GREEK SMALL LETTER DIGAMMA + {0x03DE, 0x0, propertyDISALLOWED}, // GREEK LETTER KOPPA + {0x03DF, 0x0, propertyPVALID}, // GREEK SMALL LETTER KOPPA + {0x03E0, 0x0, propertyDISALLOWED}, // GREEK LETTER SAMPI + {0x03E1, 0x0, propertyPVALID}, // GREEK SMALL LETTER SAMPI + {0x03E2, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER SHEI + {0x03E3, 0x0, propertyPVALID}, // COPTIC SMALL LETTER SHEI + {0x03E4, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER FEI + {0x03E5, 0x0, propertyPVALID}, // COPTIC SMALL LETTER FEI + {0x03E6, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER KHEI + {0x03E7, 0x0, propertyPVALID}, // COPTIC SMALL LETTER KHEI + {0x03E8, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER HORI + {0x03E9, 0x0, propertyPVALID}, // COPTIC SMALL LETTER HORI + {0x03EA, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER GANGIA + {0x03EB, 0x0, propertyPVALID}, // COPTIC SMALL LETTER GANGIA + {0x03EC, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER SHIMA + {0x03ED, 0x0, propertyPVALID}, // COPTIC SMALL LETTER SHIMA + {0x03EE, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER DEI + {0x03EF, 0x0, propertyPVALID}, // COPTIC SMALL LETTER DEI + {0x03F0, 0x03F2, propertyDISALLOWED}, // GREEK KAPPA SYMBOL..GREEK LUNATE SIGMA SYMBO + {0x03F3, 0x0, propertyPVALID}, // GREEK LETTER YOT + {0x03F4, 0x03F7, propertyDISALLOWED}, // GREEK CAPITAL THETA SYMBOL..GREEK CAPITAL LE + {0x03F8, 0x0, propertyPVALID}, // GREEK SMALL LETTER SHO + {0x03F9, 0x03FA, propertyDISALLOWED}, // GREEK CAPITAL LUNATE SIGMA SYMBOL..GREEK CAP + {0x03FB, 0x03FC, propertyPVALID}, // GREEK SMALL LETTER SAN..GREEK RHO WITH STROK + {0x03FD, 0x042F, propertyDISALLOWED}, // GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL.. + {0x0430, 0x045F, propertyPVALID}, // CYRILLIC SMALL LETTER A..CYRILLIC SMALL LETT + {0x0460, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER OMEGA + {0x0461, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER OMEGA + {0x0462, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER YAT + {0x0463, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER YAT + {0x0464, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IOTIFIED E + {0x0465, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IOTIFIED E + {0x0466, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER LITTLE YUS + {0x0467, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER LITTLE YUS + {0x0468, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS + {0x0469, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS + {0x046A, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER BIG YUS + {0x046B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER BIG YUS + {0x046C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS + {0x046D, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IOTIFIED BIG YUS + {0x046E, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KSI + {0x046F, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KSI + {0x0470, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER PSI + {0x0471, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER PSI + {0x0472, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER FITA + {0x0473, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER FITA + {0x0474, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IZHITSA + {0x0475, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IZHITSA + {0x0476, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE + {0x0477, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GR + {0x0478, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER UK + {0x0479, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER UK + {0x047A, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ROUND OMEGA + {0x047B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ROUND OMEGA + {0x047C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER OMEGA WITH TITLO + {0x047D, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER OMEGA WITH TITLO + {0x047E, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER OT + {0x047F, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER OT + {0x0480, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KOPPA + {0x0481, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KOPPA + {0x0482, 0x0, propertyDISALLOWED}, // CYRILLIC THOUSANDS SIGN + {0x0483, 0x0487, propertyPVALID}, // COMBINING CYRILLIC TITLO..COMBINING CYRILLIC + {0x0488, 0x048A, propertyDISALLOWED}, // COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..C + {0x048B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER SHORT I WITH TAIL + {0x048C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER SEMISOFT SIGN + {0x048D, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER SEMISOFT SIGN + {0x048E, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ER WITH TICK + {0x048F, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ER WITH TICK + {0x0490, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER GHE WITH UPTURN + {0x0491, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER GHE WITH UPTURN + {0x0492, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER GHE WITH STROKE + {0x0493, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER GHE WITH STROKE + {0x0494, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK + {0x0495, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK + {0x0496, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER + {0x0497, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ZHE WITH DESCENDER + {0x0498, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ZE WITH DESCENDER + {0x0499, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ZE WITH DESCENDER + {0x049A, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KA WITH DESCENDER + {0x049B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KA WITH DESCENDER + {0x049C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KA WITH VERTICAL STR + {0x049D, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KA WITH VERTICAL STROK + {0x049E, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KA WITH STROKE + {0x049F, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KA WITH STROKE + {0x04A0, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER BASHKIR KA + {0x04A1, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER BASHKIR KA + {0x04A2, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER EN WITH DESCENDER + {0x04A3, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER EN WITH DESCENDER + {0x04A4, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LIGATURE EN GHE + {0x04A5, 0x0, propertyPVALID}, // CYRILLIC SMALL LIGATURE EN GHE + {0x04A6, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK + {0x04A7, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK + {0x04A8, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ABKHASIAN HA + {0x04A9, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ABKHASIAN HA + {0x04AA, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ES WITH DESCENDER + {0x04AB, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ES WITH DESCENDER + {0x04AC, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER TE WITH DESCENDER + {0x04AD, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER TE WITH DESCENDER + {0x04AE, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER STRAIGHT U + {0x04AF, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER STRAIGHT U + {0x04B0, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER STRAIGHT U WITH STRO + {0x04B1, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE + {0x04B2, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER HA WITH DESCENDER + {0x04B3, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER HA WITH DESCENDER + {0x04B4, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LIGATURE TE TSE + {0x04B5, 0x0, propertyPVALID}, // CYRILLIC SMALL LIGATURE TE TSE + {0x04B6, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER CHE WITH DESCENDER + {0x04B7, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER CHE WITH DESCENDER + {0x04B8, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER CHE WITH VERTICAL ST + {0x04B9, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER CHE WITH VERTICAL STRO + {0x04BA, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER SHHA + {0x04BB, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER SHHA + {0x04BC, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ABKHASIAN CHE + {0x04BD, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ABKHASIAN CHE + {0x04BE, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH D + {0x04BF, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DES + {0x04C0, 0x04C1, propertyDISALLOWED}, // CYRILLIC LETTER PALOCHKA..CYRILLIC CAPITAL L + {0x04C2, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ZHE WITH BREVE + {0x04C3, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KA WITH HOOK + {0x04C4, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KA WITH HOOK + {0x04C5, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER EL WITH TAIL + {0x04C6, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER EL WITH TAIL + {0x04C7, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER EN WITH HOOK + {0x04C8, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER EN WITH HOOK + {0x04C9, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER EN WITH TAIL + {0x04CA, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER EN WITH TAIL + {0x04CB, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KHAKASSIAN CHE + {0x04CC, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KHAKASSIAN CHE + {0x04CD, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER EM WITH TAIL + {0x04CE, 0x04CF, propertyPVALID}, // CYRILLIC SMALL LETTER EM WITH TAIL..CYRILLIC + {0x04D0, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER A WITH BREVE + {0x04D1, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER A WITH BREVE + {0x04D2, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER A WITH DIAERESIS + {0x04D3, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER A WITH DIAERESIS + {0x04D4, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LIGATURE A IE + {0x04D5, 0x0, propertyPVALID}, // CYRILLIC SMALL LIGATURE A IE + {0x04D6, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IE WITH BREVE + {0x04D7, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IE WITH BREVE + {0x04D8, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER SCHWA + {0x04D9, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER SCHWA + {0x04DA, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS + {0x04DB, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS + {0x04DC, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS + {0x04DD, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ZHE WITH DIAERESIS + {0x04DE, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS + {0x04DF, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ZE WITH DIAERESIS + {0x04E0, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ABKHASIAN DZE + {0x04E1, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ABKHASIAN DZE + {0x04E2, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER I WITH MACRON + {0x04E3, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER I WITH MACRON + {0x04E4, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER I WITH DIAERESIS + {0x04E5, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER I WITH DIAERESIS + {0x04E6, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER O WITH DIAERESIS + {0x04E7, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER O WITH DIAERESIS + {0x04E8, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER BARRED O + {0x04E9, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER BARRED O + {0x04EA, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER BARRED O WITH DIAERE + {0x04EB, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER BARRED O WITH DIAERESI + {0x04EC, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER E WITH DIAERESIS + {0x04ED, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER E WITH DIAERESIS + {0x04EE, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER U WITH MACRON + {0x04EF, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER U WITH MACRON + {0x04F0, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER U WITH DIAERESIS + {0x04F1, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER U WITH DIAERESIS + {0x04F2, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE + {0x04F3, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE + {0x04F4, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS + {0x04F5, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER CHE WITH DIAERESIS + {0x04F6, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER GHE WITH DESCENDER + {0x04F7, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER GHE WITH DESCENDER + {0x04F8, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS + {0x04F9, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER YERU WITH DIAERESIS + {0x04FA, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER GHE WITH STROKE AND + {0x04FB, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER GHE WITH STROKE AND HO + {0x04FC, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER HA WITH HOOK + {0x04FD, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER HA WITH HOOK + {0x04FE, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER HA WITH STROKE + {0x04FF, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER HA WITH STROKE + {0x0500, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KOMI DE + {0x0501, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KOMI DE + {0x0502, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KOMI DJE + {0x0503, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KOMI DJE + {0x0504, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KOMI ZJE + {0x0505, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KOMI ZJE + {0x0506, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KOMI DZJE + {0x0507, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KOMI DZJE + {0x0508, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KOMI LJE + {0x0509, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KOMI LJE + {0x050A, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KOMI NJE + {0x050B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KOMI NJE + {0x050C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KOMI SJE + {0x050D, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KOMI SJE + {0x050E, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER KOMI TJE + {0x050F, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER KOMI TJE + {0x0510, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER REVERSED ZE + {0x0511, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER REVERSED ZE + {0x0512, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER EL WITH HOOK + {0x0513, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER EL WITH HOOK + {0x0514, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER LHA + {0x0515, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER LHA + {0x0516, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER RHA + {0x0517, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER RHA + {0x0518, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER YAE + {0x0519, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER YAE + {0x051A, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER QA + {0x051B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER QA + {0x051C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER WE + {0x051D, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER WE + {0x051E, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ALEUT KA + {0x051F, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ALEUT KA + {0x0520, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER EL WITH MIDDLE HOOK + {0x0521, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER EL WITH MIDDLE HOOK + {0x0522, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK + {0x0523, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER EN WITH MIDDLE HOOK + {0x0524, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER PE WITH DESCENDER + {0x0525, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER PE WITH DESCENDER + {0x0526, 0x0530, propertyUNASSIGNED}, // .. + {0x0531, 0x0556, propertyDISALLOWED}, // ARMENIAN CAPITAL LETTER AYB..ARMENIAN CAPITA + {0x0557, 0x0558, propertyUNASSIGNED}, // .. + {0x0559, 0x0, propertyPVALID}, // ARMENIAN MODIFIER LETTER LEFT HALF RING + {0x055A, 0x055F, propertyDISALLOWED}, // ARMENIAN APOSTROPHE..ARMENIAN ABBREVIATION M + {0x0560, 0x0, propertyUNASSIGNED}, // + {0x0561, 0x0586, propertyPVALID}, // ARMENIAN SMALL LETTER AYB..ARMENIAN SMALL LE + {0x0587, 0x0, propertyDISALLOWED}, // ARMENIAN SMALL LIGATURE ECH YIWN + {0x0588, 0x0, propertyUNASSIGNED}, // + {0x0589, 0x058A, propertyDISALLOWED}, // ARMENIAN FULL STOP..ARMENIAN HYPHEN + {0x058B, 0x0590, propertyUNASSIGNED}, // .. + {0x0591, 0x05BD, propertyPVALID}, // HEBREW ACCENT ETNAHTA..HEBREW POINT METEG + {0x05BE, 0x0, propertyDISALLOWED}, // HEBREW PUNCTUATION MAQAF + {0x05BF, 0x0, propertyPVALID}, // HEBREW POINT RAFE + {0x05C0, 0x0, propertyDISALLOWED}, // HEBREW PUNCTUATION PASEQ + {0x05C1, 0x05C2, propertyPVALID}, // HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT + {0x05C3, 0x0, propertyDISALLOWED}, // HEBREW PUNCTUATION SOF PASUQ + {0x05C4, 0x05C5, propertyPVALID}, // HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT + {0x05C6, 0x0, propertyDISALLOWED}, // HEBREW PUNCTUATION NUN HAFUKHA + {0x05C7, 0x0, propertyPVALID}, // HEBREW POINT QAMATS QATAN + {0x05C8, 0x05CF, propertyUNASSIGNED}, // .. + {0x05D0, 0x05EA, propertyPVALID}, // HEBREW LETTER ALEF..HEBREW LETTER TAV + {0x05EB, 0x05EF, propertyUNASSIGNED}, // .. + {0x05F0, 0x05F2, propertyPVALID}, // HEBREW LIGATURE YIDDISH DOUBLE VAV..HEBREW L + {0x05F3, 0x05F4, propertyCONTEXTO}, // HEBREW PUNCTUATION GERESH..HEBREW PUNCTUATIO + {0x05F5, 0x05FF, propertyUNASSIGNED}, // .. + {0x0600, 0x0603, propertyDISALLOWED}, // ARABIC NUMBER SIGN..ARABIC SIGN SAFHA + {0x0604, 0x0605, propertyUNASSIGNED}, // .. + {0x0606, 0x060F, propertyDISALLOWED}, // ARABIC-INDIC CUBE ROOT..ARABIC SIGN MISRA + {0x0610, 0x061A, propertyPVALID}, // ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..AR + {0x061B, 0x0, propertyDISALLOWED}, // ARABIC SEMICOLON + {0x061C, 0x061D, propertyUNASSIGNED}, // .. + {0x061E, 0x061F, propertyDISALLOWED}, // ARABIC TRIPLE DOT PUNCTUATION MARK..ARABIC Q + {0x0620, 0x0, propertyUNASSIGNED}, // + {0x0621, 0x063F, propertyPVALID}, // ARABIC LETTER HAMZA..ARABIC LETTER FARSI YEH + {0x0640, 0x0, propertyDISALLOWED}, // ARABIC TATWEEL + {0x0641, 0x065E, propertyPVALID}, // ARABIC LETTER FEH..ARABIC FATHA WITH TWO DOT + {0x065F, 0x0, propertyUNASSIGNED}, // + {0x0660, 0x0669, propertyCONTEXTO}, // ARABIC-INDIC DIGIT ZERO..ARABIC-INDIC DIGIT + {0x066A, 0x066D, propertyDISALLOWED}, // ARABIC PERCENT SIGN..ARABIC FIVE POINTED STA + {0x066E, 0x0674, propertyPVALID}, // ARABIC LETTER DOTLESS BEH..ARABIC LETTER HIG + {0x0675, 0x0678, propertyDISALLOWED}, // ARABIC LETTER HIGH HAMZA ALEF..ARABIC LETTER + {0x0679, 0x06D3, propertyPVALID}, // ARABIC LETTER TTEH..ARABIC LETTER YEH BARREE + {0x06D4, 0x0, propertyDISALLOWED}, // ARABIC FULL STOP + {0x06D5, 0x06DC, propertyPVALID}, // ARABIC LETTER AE..ARABIC SMALL HIGH SEEN + {0x06DD, 0x06DE, propertyDISALLOWED}, // ARABIC END OF AYAH..ARABIC START OF RUB EL H + {0x06DF, 0x06E8, propertyPVALID}, // ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL + {0x06E9, 0x0, propertyDISALLOWED}, // ARABIC PLACE OF SAJDAH + {0x06EA, 0x06EF, propertyPVALID}, // ARABIC EMPTY CENTRE LOW STOP..ARABIC LETTER + {0x06F0, 0x06F9, propertyCONTEXTO}, // EXTENDED ARABIC-INDIC DIGIT ZERO..EXTENDED A + {0x06FA, 0x06FF, propertyPVALID}, // ARABIC LETTER SHEEN WITH DOT BELOW..ARABIC L + {0x0700, 0x070D, propertyDISALLOWED}, // SYRIAC END OF PARAGRAPH..SYRIAC HARKLEAN AST + {0x070E, 0x0, propertyUNASSIGNED}, // + {0x070F, 0x0, propertyDISALLOWED}, // SYRIAC ABBREVIATION MARK + {0x0710, 0x074A, propertyPVALID}, // SYRIAC LETTER ALAPH..SYRIAC BARREKH + {0x074B, 0x074C, propertyUNASSIGNED}, // .. + {0x074D, 0x07B1, propertyPVALID}, // SYRIAC LETTER SOGDIAN ZHAIN..THAANA LETTER N + {0x07B2, 0x07BF, propertyUNASSIGNED}, // .. + {0x07C0, 0x07F5, propertyPVALID}, // NKO DIGIT ZERO..NKO LOW TONE APOSTROPHE + {0x07F6, 0x07FA, propertyDISALLOWED}, // NKO SYMBOL OO DENNEN..NKO LAJANYALAN + {0x07FB, 0x07FF, propertyUNASSIGNED}, // .. + {0x0800, 0x082D, propertyPVALID}, // SAMARITAN LETTER ALAF..SAMARITAN MARK NEQUDA + {0x082E, 0x082F, propertyUNASSIGNED}, // .. + {0x0830, 0x083E, propertyDISALLOWED}, // SAMARITAN PUNCTUATION NEQUDAA..SAMARITAN PUN + {0x083F, 0x08FF, propertyUNASSIGNED}, // .. + {0x0900, 0x0939, propertyPVALID}, // DEVANAGARI SIGN INVERTED CANDRABINDU..DEVANA + {0x093A, 0x093B, propertyUNASSIGNED}, // .. + {0x093C, 0x094E, propertyPVALID}, // DEVANAGARI SIGN NUKTA..DEVANAGARI VOWEL SIGN + {0x094F, 0x0, propertyUNASSIGNED}, // + {0x0950, 0x0955, propertyPVALID}, // DEVANAGARI OM..DEVANAGARI VOWEL SIGN CANDRA + {0x0956, 0x0957, propertyUNASSIGNED}, // .. + {0x0958, 0x095F, propertyDISALLOWED}, // DEVANAGARI LETTER QA..DEVANAGARI LETTER YYA + {0x0960, 0x0963, propertyPVALID}, // DEVANAGARI LETTER VOCALIC RR..DEVANAGARI VOW + {0x0964, 0x0965, propertyDISALLOWED}, // DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA + {0x0966, 0x096F, propertyPVALID}, // DEVANAGARI DIGIT ZERO..DEVANAGARI DIGIT NINE + {0x0970, 0x0, propertyDISALLOWED}, // DEVANAGARI ABBREVIATION SIGN + {0x0971, 0x0972, propertyPVALID}, // DEVANAGARI SIGN HIGH SPACING DOT..DEVANAGARI + {0x0973, 0x0978, propertyUNASSIGNED}, // .. + {0x0979, 0x097F, propertyPVALID}, // DEVANAGARI LETTER ZHA..DEVANAGARI LETTER BBA + {0x0980, 0x0, propertyUNASSIGNED}, // + {0x0981, 0x0983, propertyPVALID}, // BENGALI SIGN CANDRABINDU..BENGALI SIGN VISAR + {0x0984, 0x0, propertyUNASSIGNED}, // + {0x0985, 0x098C, propertyPVALID}, // BENGALI LETTER A..BENGALI LETTER VOCALIC L + {0x098D, 0x098E, propertyUNASSIGNED}, // .. + {0x098F, 0x0990, propertyPVALID}, // BENGALI LETTER E..BENGALI LETTER AI + {0x0991, 0x0992, propertyUNASSIGNED}, // .. + {0x0993, 0x09A8, propertyPVALID}, // BENGALI LETTER O..BENGALI LETTER NA + {0x09A9, 0x0, propertyUNASSIGNED}, // + {0x09AA, 0x09B0, propertyPVALID}, // BENGALI LETTER PA..BENGALI LETTER RA + {0x09B1, 0x0, propertyUNASSIGNED}, // + {0x09B2, 0x0, propertyPVALID}, // BENGALI LETTER LA + {0x09B3, 0x09B5, propertyUNASSIGNED}, // .. + {0x09B6, 0x09B9, propertyPVALID}, // BENGALI LETTER SHA..BENGALI LETTER HA + {0x09BA, 0x09BB, propertyUNASSIGNED}, // .. + {0x09BC, 0x09C4, propertyPVALID}, // BENGALI SIGN NUKTA..BENGALI VOWEL SIGN VOCAL + {0x09C5, 0x09C6, propertyUNASSIGNED}, // .. + {0x09C7, 0x09C8, propertyPVALID}, // BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI + {0x09C9, 0x09CA, propertyUNASSIGNED}, // .. + {0x09CB, 0x09CE, propertyPVALID}, // BENGALI VOWEL SIGN O..BENGALI LETTER KHANDA + {0x09CF, 0x09D6, propertyUNASSIGNED}, // .. + {0x09D7, 0x0, propertyPVALID}, // BENGALI AU LENGTH MARK + {0x09D8, 0x09DB, propertyUNASSIGNED}, // .. + {0x09DC, 0x09DD, propertyDISALLOWED}, // BENGALI LETTER RRA..BENGALI LETTER RHA + {0x09DE, 0x0, propertyUNASSIGNED}, // + {0x09DF, 0x0, propertyDISALLOWED}, // BENGALI LETTER YYA + {0x09E0, 0x09E3, propertyPVALID}, // BENGALI LETTER VOCALIC RR..BENGALI VOWEL SIG + {0x09E4, 0x09E5, propertyUNASSIGNED}, // .. + {0x09E6, 0x09F1, propertyPVALID}, // BENGALI DIGIT ZERO..BENGALI LETTER RA WITH L + {0x09F2, 0x09FB, propertyDISALLOWED}, // BENGALI RUPEE MARK..BENGALI GANDA MARK + {0x09FC, 0x0A00, propertyUNASSIGNED}, // .. + {0x0A01, 0x0A03, propertyPVALID}, // GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN VISA + {0x0A04, 0x0, propertyUNASSIGNED}, // + {0x0A05, 0x0A0A, propertyPVALID}, // GURMUKHI LETTER A..GURMUKHI LETTER UU + {0x0A0B, 0x0A0E, propertyUNASSIGNED}, // .. + {0x0A0F, 0x0A10, propertyPVALID}, // GURMUKHI LETTER EE..GURMUKHI LETTER AI + {0x0A11, 0x0A12, propertyUNASSIGNED}, // .. + {0x0A13, 0x0A28, propertyPVALID}, // GURMUKHI LETTER OO..GURMUKHI LETTER NA + {0x0A29, 0x0, propertyUNASSIGNED}, // + {0x0A2A, 0x0A30, propertyPVALID}, // GURMUKHI LETTER PA..GURMUKHI LETTER RA + {0x0A31, 0x0, propertyUNASSIGNED}, // + {0x0A32, 0x0, propertyPVALID}, // GURMUKHI LETTER LA + {0x0A33, 0x0, propertyDISALLOWED}, // GURMUKHI LETTER LLA + {0x0A34, 0x0, propertyUNASSIGNED}, // + {0x0A35, 0x0, propertyPVALID}, // GURMUKHI LETTER VA + {0x0A36, 0x0, propertyDISALLOWED}, // GURMUKHI LETTER SHA + {0x0A37, 0x0, propertyUNASSIGNED}, // + {0x0A38, 0x0A39, propertyPVALID}, // GURMUKHI LETTER SA..GURMUKHI LETTER HA + {0x0A3A, 0x0A3B, propertyUNASSIGNED}, // .. + {0x0A3C, 0x0, propertyPVALID}, // GURMUKHI SIGN NUKTA + {0x0A3D, 0x0, propertyUNASSIGNED}, // + {0x0A3E, 0x0A42, propertyPVALID}, // GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN + {0x0A43, 0x0A46, propertyUNASSIGNED}, // .. + {0x0A47, 0x0A48, propertyPVALID}, // GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN + {0x0A49, 0x0A4A, propertyUNASSIGNED}, // .. + {0x0A4B, 0x0A4D, propertyPVALID}, // GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA + {0x0A4E, 0x0A50, propertyUNASSIGNED}, // .. + {0x0A51, 0x0, propertyPVALID}, // GURMUKHI SIGN UDAAT + {0x0A52, 0x0A58, propertyUNASSIGNED}, // .. + {0x0A59, 0x0A5B, propertyDISALLOWED}, // GURMUKHI LETTER KHHA..GURMUKHI LETTER ZA + {0x0A5C, 0x0, propertyPVALID}, // GURMUKHI LETTER RRA + {0x0A5D, 0x0, propertyUNASSIGNED}, // + {0x0A5E, 0x0, propertyDISALLOWED}, // GURMUKHI LETTER FA + {0x0A5F, 0x0A65, propertyUNASSIGNED}, // .. + {0x0A66, 0x0A75, propertyPVALID}, // GURMUKHI DIGIT ZERO..GURMUKHI SIGN YAKASH + {0x0A76, 0x0A80, propertyUNASSIGNED}, // .. + {0x0A81, 0x0A83, propertyPVALID}, // GUJARATI SIGN CANDRABINDU..GUJARATI SIGN VIS + {0x0A84, 0x0, propertyUNASSIGNED}, // + {0x0A85, 0x0A8D, propertyPVALID}, // GUJARATI LETTER A..GUJARATI VOWEL CANDRA E + {0x0A8E, 0x0, propertyUNASSIGNED}, // + {0x0A8F, 0x0A91, propertyPVALID}, // GUJARATI LETTER E..GUJARATI VOWEL CANDRA O + {0x0A92, 0x0, propertyUNASSIGNED}, // + {0x0A93, 0x0AA8, propertyPVALID}, // GUJARATI LETTER O..GUJARATI LETTER NA + {0x0AA9, 0x0, propertyUNASSIGNED}, // + {0x0AAA, 0x0AB0, propertyPVALID}, // GUJARATI LETTER PA..GUJARATI LETTER RA + {0x0AB1, 0x0, propertyUNASSIGNED}, // + {0x0AB2, 0x0AB3, propertyPVALID}, // GUJARATI LETTER LA..GUJARATI LETTER LLA + {0x0AB4, 0x0, propertyUNASSIGNED}, // + {0x0AB5, 0x0AB9, propertyPVALID}, // GUJARATI LETTER VA..GUJARATI LETTER HA + {0x0ABA, 0x0ABB, propertyUNASSIGNED}, // .. + {0x0ABC, 0x0AC5, propertyPVALID}, // GUJARATI SIGN NUKTA..GUJARATI VOWEL SIGN CAN + {0x0AC6, 0x0, propertyUNASSIGNED}, // + {0x0AC7, 0x0AC9, propertyPVALID}, // GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN C + {0x0ACA, 0x0, propertyUNASSIGNED}, // + {0x0ACB, 0x0ACD, propertyPVALID}, // GUJARATI VOWEL SIGN O..GUJARATI SIGN VIRAMA + {0x0ACE, 0x0ACF, propertyUNASSIGNED}, // .. + {0x0AD0, 0x0, propertyPVALID}, // GUJARATI OM + {0x0AD1, 0x0ADF, propertyUNASSIGNED}, // .. + {0x0AE0, 0x0AE3, propertyPVALID}, // GUJARATI LETTER VOCALIC RR..GUJARATI VOWEL S + {0x0AE4, 0x0AE5, propertyUNASSIGNED}, // .. + {0x0AE6, 0x0AEF, propertyPVALID}, // GUJARATI DIGIT ZERO..GUJARATI DIGIT NINE + {0x0AF0, 0x0, propertyUNASSIGNED}, // + {0x0AF1, 0x0, propertyDISALLOWED}, // GUJARATI RUPEE SIGN + {0x0AF2, 0x0B00, propertyUNASSIGNED}, // .. + {0x0B01, 0x0B03, propertyPVALID}, // ORIYA SIGN CANDRABINDU..ORIYA SIGN VISARGA + {0x0B04, 0x0, propertyUNASSIGNED}, // + {0x0B05, 0x0B0C, propertyPVALID}, // ORIYA LETTER A..ORIYA LETTER VOCALIC L + {0x0B0D, 0x0B0E, propertyUNASSIGNED}, // .. + {0x0B0F, 0x0B10, propertyPVALID}, // ORIYA LETTER E..ORIYA LETTER AI + {0x0B11, 0x0B12, propertyUNASSIGNED}, // .. + {0x0B13, 0x0B28, propertyPVALID}, // ORIYA LETTER O..ORIYA LETTER NA + {0x0B29, 0x0, propertyUNASSIGNED}, // + {0x0B2A, 0x0B30, propertyPVALID}, // ORIYA LETTER PA..ORIYA LETTER RA + {0x0B31, 0x0, propertyUNASSIGNED}, // + {0x0B32, 0x0B33, propertyPVALID}, // ORIYA LETTER LA..ORIYA LETTER LLA + {0x0B34, 0x0, propertyUNASSIGNED}, // + {0x0B35, 0x0B39, propertyPVALID}, // ORIYA LETTER VA..ORIYA LETTER HA + {0x0B3A, 0x0B3B, propertyUNASSIGNED}, // .. + {0x0B3C, 0x0B44, propertyPVALID}, // ORIYA SIGN NUKTA..ORIYA VOWEL SIGN VOCALIC R + {0x0B45, 0x0B46, propertyUNASSIGNED}, // .. + {0x0B47, 0x0B48, propertyPVALID}, // ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI + {0x0B49, 0x0B4A, propertyUNASSIGNED}, // .. + {0x0B4B, 0x0B4D, propertyPVALID}, // ORIYA VOWEL SIGN O..ORIYA SIGN VIRAMA + {0x0B4E, 0x0B55, propertyUNASSIGNED}, // .. + {0x0B56, 0x0B57, propertyPVALID}, // ORIYA AI LENGTH MARK..ORIYA AU LENGTH MARK + {0x0B58, 0x0B5B, propertyUNASSIGNED}, // .. + {0x0B5C, 0x0B5D, propertyDISALLOWED}, // ORIYA LETTER RRA..ORIYA LETTER RHA + {0x0B5E, 0x0, propertyUNASSIGNED}, // + {0x0B5F, 0x0B63, propertyPVALID}, // ORIYA LETTER YYA..ORIYA VOWEL SIGN VOCALIC L + {0x0B64, 0x0B65, propertyUNASSIGNED}, // .. + {0x0B66, 0x0B6F, propertyPVALID}, // ORIYA DIGIT ZERO..ORIYA DIGIT NINE + {0x0B70, 0x0, propertyDISALLOWED}, // ORIYA ISSHAR + {0x0B71, 0x0, propertyPVALID}, // ORIYA LETTER WA + {0x0B72, 0x0B81, propertyUNASSIGNED}, // .. + {0x0B82, 0x0B83, propertyPVALID}, // TAMIL SIGN ANUSVARA..TAMIL SIGN VISARGA + {0x0B84, 0x0, propertyUNASSIGNED}, // + {0x0B85, 0x0B8A, propertyPVALID}, // TAMIL LETTER A..TAMIL LETTER UU + {0x0B8B, 0x0B8D, propertyUNASSIGNED}, // .. + {0x0B8E, 0x0B90, propertyPVALID}, // TAMIL LETTER E..TAMIL LETTER AI + {0x0B91, 0x0, propertyUNASSIGNED}, // + {0x0B92, 0x0B95, propertyPVALID}, // TAMIL LETTER O..TAMIL LETTER KA + {0x0B96, 0x0B98, propertyUNASSIGNED}, // .. + {0x0B99, 0x0B9A, propertyPVALID}, // TAMIL LETTER NGA..TAMIL LETTER CA + {0x0B9B, 0x0, propertyUNASSIGNED}, // + {0x0B9C, 0x0, propertyPVALID}, // TAMIL LETTER JA + {0x0B9D, 0x0, propertyUNASSIGNED}, // + {0x0B9E, 0x0B9F, propertyPVALID}, // TAMIL LETTER NYA..TAMIL LETTER TTA + {0x0BA0, 0x0BA2, propertyUNASSIGNED}, // .. + {0x0BA3, 0x0BA4, propertyPVALID}, // TAMIL LETTER NNA..TAMIL LETTER TA + {0x0BA5, 0x0BA7, propertyUNASSIGNED}, // .. + {0x0BA8, 0x0BAA, propertyPVALID}, // TAMIL LETTER NA..TAMIL LETTER PA + {0x0BAB, 0x0BAD, propertyUNASSIGNED}, // .. + {0x0BAE, 0x0BB9, propertyPVALID}, // TAMIL LETTER MA..TAMIL LETTER HA + {0x0BBA, 0x0BBD, propertyUNASSIGNED}, // .. + {0x0BBE, 0x0BC2, propertyPVALID}, // TAMIL VOWEL SIGN AA..TAMIL VOWEL SIGN UU + {0x0BC3, 0x0BC5, propertyUNASSIGNED}, // .. + {0x0BC6, 0x0BC8, propertyPVALID}, // TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI + {0x0BC9, 0x0, propertyUNASSIGNED}, // + {0x0BCA, 0x0BCD, propertyPVALID}, // TAMIL VOWEL SIGN O..TAMIL SIGN VIRAMA + {0x0BCE, 0x0BCF, propertyUNASSIGNED}, // .. + {0x0BD0, 0x0, propertyPVALID}, // TAMIL OM + {0x0BD1, 0x0BD6, propertyUNASSIGNED}, // .. + {0x0BD7, 0x0, propertyPVALID}, // TAMIL AU LENGTH MARK + {0x0BD8, 0x0BE5, propertyUNASSIGNED}, // .. + {0x0BE6, 0x0BEF, propertyPVALID}, // TAMIL DIGIT ZERO..TAMIL DIGIT NINE + {0x0BF0, 0x0BFA, propertyDISALLOWED}, // TAMIL NUMBER TEN..TAMIL NUMBER SIGN + {0x0BFB, 0x0C00, propertyUNASSIGNED}, // .. + {0x0C01, 0x0C03, propertyPVALID}, // TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA + {0x0C04, 0x0, propertyUNASSIGNED}, // + {0x0C05, 0x0C0C, propertyPVALID}, // TELUGU LETTER A..TELUGU LETTER VOCALIC L + {0x0C0D, 0x0, propertyUNASSIGNED}, // + {0x0C0E, 0x0C10, propertyPVALID}, // TELUGU LETTER E..TELUGU LETTER AI + {0x0C11, 0x0, propertyUNASSIGNED}, // + {0x0C12, 0x0C28, propertyPVALID}, // TELUGU LETTER O..TELUGU LETTER NA + {0x0C29, 0x0, propertyUNASSIGNED}, // + {0x0C2A, 0x0C33, propertyPVALID}, // TELUGU LETTER PA..TELUGU LETTER LLA + {0x0C34, 0x0, propertyUNASSIGNED}, // + {0x0C35, 0x0C39, propertyPVALID}, // TELUGU LETTER VA..TELUGU LETTER HA + {0x0C3A, 0x0C3C, propertyUNASSIGNED}, // .. + {0x0C3D, 0x0C44, propertyPVALID}, // TELUGU SIGN AVAGRAHA..TELUGU VOWEL SIGN VOCA + {0x0C45, 0x0, propertyUNASSIGNED}, // + {0x0C46, 0x0C48, propertyPVALID}, // TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI + {0x0C49, 0x0, propertyUNASSIGNED}, // + {0x0C4A, 0x0C4D, propertyPVALID}, // TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA + {0x0C4E, 0x0C54, propertyUNASSIGNED}, // .. + {0x0C55, 0x0C56, propertyPVALID}, // TELUGU LENGTH MARK..TELUGU AI LENGTH MARK + {0x0C57, 0x0, propertyUNASSIGNED}, // + {0x0C58, 0x0C59, propertyPVALID}, // TELUGU LETTER TSA..TELUGU LETTER DZA + {0x0C5A, 0x0C5F, propertyUNASSIGNED}, // .. + {0x0C60, 0x0C63, propertyPVALID}, // TELUGU LETTER VOCALIC RR..TELUGU VOWEL SIGN + {0x0C64, 0x0C65, propertyUNASSIGNED}, // .. + {0x0C66, 0x0C6F, propertyPVALID}, // TELUGU DIGIT ZERO..TELUGU DIGIT NINE + {0x0C70, 0x0C77, propertyUNASSIGNED}, // .. + {0x0C78, 0x0C7F, propertyDISALLOWED}, // TELUGU FRACTION DIGIT ZERO FOR ODD POWERS OF + {0x0C80, 0x0C81, propertyUNASSIGNED}, // .. + {0x0C82, 0x0C83, propertyPVALID}, // KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA + {0x0C84, 0x0, propertyUNASSIGNED}, // + {0x0C85, 0x0C8C, propertyPVALID}, // KANNADA LETTER A..KANNADA LETTER VOCALIC L + {0x0C8D, 0x0, propertyUNASSIGNED}, // + {0x0C8E, 0x0C90, propertyPVALID}, // KANNADA LETTER E..KANNADA LETTER AI + {0x0C91, 0x0, propertyUNASSIGNED}, // + {0x0C92, 0x0CA8, propertyPVALID}, // KANNADA LETTER O..KANNADA LETTER NA + {0x0CA9, 0x0, propertyUNASSIGNED}, // + {0x0CAA, 0x0CB3, propertyPVALID}, // KANNADA LETTER PA..KANNADA LETTER LLA + {0x0CB4, 0x0, propertyUNASSIGNED}, // + {0x0CB5, 0x0CB9, propertyPVALID}, // KANNADA LETTER VA..KANNADA LETTER HA + {0x0CBA, 0x0CBB, propertyUNASSIGNED}, // .. + {0x0CBC, 0x0CC4, propertyPVALID}, // KANNADA SIGN NUKTA..KANNADA VOWEL SIGN VOCAL + {0x0CC5, 0x0, propertyUNASSIGNED}, // + {0x0CC6, 0x0CC8, propertyPVALID}, // KANNADA VOWEL SIGN E..KANNADA VOWEL SIGN AI + {0x0CC9, 0x0, propertyUNASSIGNED}, // + {0x0CCA, 0x0CCD, propertyPVALID}, // KANNADA VOWEL SIGN O..KANNADA SIGN VIRAMA + {0x0CCE, 0x0CD4, propertyUNASSIGNED}, // .. + {0x0CD5, 0x0CD6, propertyPVALID}, // KANNADA LENGTH MARK..KANNADA AI LENGTH MARK + {0x0CD7, 0x0CDD, propertyUNASSIGNED}, // .. + {0x0CDE, 0x0, propertyPVALID}, // KANNADA LETTER FA + {0x0CDF, 0x0, propertyUNASSIGNED}, // + {0x0CE0, 0x0CE3, propertyPVALID}, // KANNADA LETTER VOCALIC RR..KANNADA VOWEL SIG + {0x0CE4, 0x0CE5, propertyUNASSIGNED}, // .. + {0x0CE6, 0x0CEF, propertyPVALID}, // KANNADA DIGIT ZERO..KANNADA DIGIT NINE + {0x0CF0, 0x0, propertyUNASSIGNED}, // + {0x0CF1, 0x0CF2, propertyDISALLOWED}, // KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADH + {0x0CF3, 0x0D01, propertyUNASSIGNED}, // .. + {0x0D02, 0x0D03, propertyPVALID}, // MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISA + {0x0D04, 0x0, propertyUNASSIGNED}, // + {0x0D05, 0x0D0C, propertyPVALID}, // MALAYALAM LETTER A..MALAYALAM LETTER VOCALIC + {0x0D0D, 0x0, propertyUNASSIGNED}, // + {0x0D0E, 0x0D10, propertyPVALID}, // MALAYALAM LETTER E..MALAYALAM LETTER AI + {0x0D11, 0x0, propertyUNASSIGNED}, // + {0x0D12, 0x0D28, propertyPVALID}, // MALAYALAM LETTER O..MALAYALAM LETTER NA + {0x0D29, 0x0, propertyUNASSIGNED}, // + {0x0D2A, 0x0D39, propertyPVALID}, // MALAYALAM LETTER PA..MALAYALAM LETTER HA + {0x0D3A, 0x0D3C, propertyUNASSIGNED}, // .. + {0x0D3D, 0x0D44, propertyPVALID}, // MALAYALAM SIGN AVAGRAHA..MALAYALAM VOWEL SIG + {0x0D45, 0x0, propertyUNASSIGNED}, // + {0x0D46, 0x0D48, propertyPVALID}, // MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN + {0x0D49, 0x0, propertyUNASSIGNED}, // + {0x0D4A, 0x0D4D, propertyPVALID}, // MALAYALAM VOWEL SIGN O..MALAYALAM SIGN VIRAM + {0x0D4E, 0x0D56, propertyUNASSIGNED}, // .. + {0x0D57, 0x0, propertyPVALID}, // MALAYALAM AU LENGTH MARK + {0x0D58, 0x0D5F, propertyUNASSIGNED}, // .. + {0x0D60, 0x0D63, propertyPVALID}, // MALAYALAM LETTER VOCALIC RR..MALAYALAM VOWEL + {0x0D64, 0x0D65, propertyUNASSIGNED}, // .. + {0x0D66, 0x0D6F, propertyPVALID}, // MALAYALAM DIGIT ZERO..MALAYALAM DIGIT NINE + {0x0D70, 0x0D75, propertyDISALLOWED}, // MALAYALAM NUMBER TEN..MALAYALAM FRACTION THR + {0x0D76, 0x0D78, propertyUNASSIGNED}, // .. + {0x0D79, 0x0, propertyDISALLOWED}, // MALAYALAM DATE MARK + {0x0D7A, 0x0D7F, propertyPVALID}, // MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER + {0x0D80, 0x0D81, propertyUNASSIGNED}, // .. + {0x0D82, 0x0D83, propertyPVALID}, // SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARG + {0x0D84, 0x0, propertyUNASSIGNED}, // + {0x0D85, 0x0D96, propertyPVALID}, // SINHALA LETTER AYANNA..SINHALA LETTER AUYANN + {0x0D97, 0x0D99, propertyUNASSIGNED}, // .. + {0x0D9A, 0x0DB1, propertyPVALID}, // SINHALA LETTER ALPAPRAANA KAYANNA..SINHALA L + {0x0DB2, 0x0, propertyUNASSIGNED}, // + {0x0DB3, 0x0DBB, propertyPVALID}, // SINHALA LETTER SANYAKA DAYANNA..SINHALA LETT + {0x0DBC, 0x0, propertyUNASSIGNED}, // + {0x0DBD, 0x0, propertyPVALID}, // SINHALA LETTER DANTAJA LAYANNA + {0x0DBE, 0x0DBF, propertyUNASSIGNED}, // .. + {0x0DC0, 0x0DC6, propertyPVALID}, // SINHALA LETTER VAYANNA..SINHALA LETTER FAYAN + {0x0DC7, 0x0DC9, propertyUNASSIGNED}, // .. + {0x0DCA, 0x0, propertyPVALID}, // SINHALA SIGN AL-LAKUNA + {0x0DCB, 0x0DCE, propertyUNASSIGNED}, // .. + {0x0DCF, 0x0DD4, propertyPVALID}, // SINHALA VOWEL SIGN AELA-PILLA..SINHALA VOWEL + {0x0DD5, 0x0, propertyUNASSIGNED}, // + {0x0DD6, 0x0, propertyPVALID}, // SINHALA VOWEL SIGN DIGA PAA-PILLA + {0x0DD7, 0x0, propertyUNASSIGNED}, // + {0x0DD8, 0x0DDF, propertyPVALID}, // SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOW + {0x0DE0, 0x0DF1, propertyUNASSIGNED}, // .. + {0x0DF2, 0x0DF3, propertyPVALID}, // SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHAL + {0x0DF4, 0x0, propertyDISALLOWED}, // SINHALA PUNCTUATION KUNDDALIYA + {0x0DF5, 0x0E00, propertyUNASSIGNED}, // .. + {0x0E01, 0x0E32, propertyPVALID}, // THAI CHARACTER KO KAI..THAI CHARACTER SARA A + {0x0E33, 0x0, propertyDISALLOWED}, // THAI CHARACTER SARA AM + {0x0E34, 0x0E3A, propertyPVALID}, // THAI CHARACTER SARA I..THAI CHARACTER PHINTH + {0x0E3B, 0x0E3E, propertyUNASSIGNED}, // .. + {0x0E3F, 0x0, propertyDISALLOWED}, // THAI CURRENCY SYMBOL BAHT + {0x0E40, 0x0E4E, propertyPVALID}, // THAI CHARACTER SARA E..THAI CHARACTER YAMAKK + {0x0E4F, 0x0, propertyDISALLOWED}, // THAI CHARACTER FONGMAN + {0x0E50, 0x0E59, propertyPVALID}, // THAI DIGIT ZERO..THAI DIGIT NINE + {0x0E5A, 0x0E5B, propertyDISALLOWED}, // THAI CHARACTER ANGKHANKHU..THAI CHARACTER KH + {0x0E5C, 0x0E80, propertyUNASSIGNED}, // .. + {0x0E81, 0x0E82, propertyPVALID}, // LAO LETTER KO..LAO LETTER KHO SUNG + {0x0E83, 0x0, propertyUNASSIGNED}, // + {0x0E84, 0x0, propertyPVALID}, // LAO LETTER KHO TAM + {0x0E85, 0x0E86, propertyUNASSIGNED}, // .. + {0x0E87, 0x0E88, propertyPVALID}, // LAO LETTER NGO..LAO LETTER CO + {0x0E89, 0x0, propertyUNASSIGNED}, // + {0x0E8A, 0x0, propertyPVALID}, // LAO LETTER SO TAM + {0x0E8B, 0x0E8C, propertyUNASSIGNED}, // .. + {0x0E8D, 0x0, propertyPVALID}, // LAO LETTER NYO + {0x0E8E, 0x0E93, propertyUNASSIGNED}, // .. + {0x0E94, 0x0E97, propertyPVALID}, // LAO LETTER DO..LAO LETTER THO TAM + {0x0E98, 0x0, propertyUNASSIGNED}, // + {0x0E99, 0x0E9F, propertyPVALID}, // LAO LETTER NO..LAO LETTER FO SUNG + {0x0EA0, 0x0, propertyUNASSIGNED}, // + {0x0EA1, 0x0EA3, propertyPVALID}, // LAO LETTER MO..LAO LETTER LO LING + {0x0EA4, 0x0, propertyUNASSIGNED}, // + {0x0EA5, 0x0, propertyPVALID}, // LAO LETTER LO LOOT + {0x0EA6, 0x0, propertyUNASSIGNED}, // + {0x0EA7, 0x0, propertyPVALID}, // LAO LETTER WO + {0x0EA8, 0x0EA9, propertyUNASSIGNED}, // .. + {0x0EAA, 0x0EAB, propertyPVALID}, // LAO LETTER SO SUNG..LAO LETTER HO SUNG + {0x0EAC, 0x0, propertyUNASSIGNED}, // + {0x0EAD, 0x0EB2, propertyPVALID}, // LAO LETTER O..LAO VOWEL SIGN AA + {0x0EB3, 0x0, propertyDISALLOWED}, // LAO VOWEL SIGN AM + {0x0EB4, 0x0EB9, propertyPVALID}, // LAO VOWEL SIGN I..LAO VOWEL SIGN UU + {0x0EBA, 0x0, propertyUNASSIGNED}, // + {0x0EBB, 0x0EBD, propertyPVALID}, // LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN N + {0x0EBE, 0x0EBF, propertyUNASSIGNED}, // .. + {0x0EC0, 0x0EC4, propertyPVALID}, // LAO VOWEL SIGN E..LAO VOWEL SIGN AI + {0x0EC5, 0x0, propertyUNASSIGNED}, // + {0x0EC6, 0x0, propertyPVALID}, // LAO KO LA + {0x0EC7, 0x0, propertyUNASSIGNED}, // + {0x0EC8, 0x0ECD, propertyPVALID}, // LAO TONE MAI EK..LAO NIGGAHITA + {0x0ECE, 0x0ECF, propertyUNASSIGNED}, // .. + {0x0ED0, 0x0ED9, propertyPVALID}, // LAO DIGIT ZERO..LAO DIGIT NINE + {0x0EDA, 0x0EDB, propertyUNASSIGNED}, // .. + {0x0EDC, 0x0EDD, propertyDISALLOWED}, // LAO HO NO..LAO HO MO + {0x0EDE, 0x0EFF, propertyUNASSIGNED}, // .. + {0x0F00, 0x0, propertyPVALID}, // TIBETAN SYLLABLE OM + {0x0F01, 0x0F0A, propertyDISALLOWED}, // TIBETAN MARK GTER YIG MGO TRUNCATED A..TIBET + {0x0F0B, 0x0, propertyPVALID}, // TIBETAN MARK INTERSYLLABIC TSHEG + {0x0F0C, 0x0F17, propertyDISALLOWED}, // TIBETAN MARK DELIMITER TSHEG BSTAR..TIBETAN + {0x0F18, 0x0F19, propertyPVALID}, // TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN + {0x0F1A, 0x0F1F, propertyDISALLOWED}, // TIBETAN SIGN RDEL DKAR GCIG..TIBETAN SIGN RD + {0x0F20, 0x0F29, propertyPVALID}, // TIBETAN DIGIT ZERO..TIBETAN DIGIT NINE + {0x0F2A, 0x0F34, propertyDISALLOWED}, // TIBETAN DIGIT HALF ONE..TIBETAN MARK BSDUS R + {0x0F35, 0x0, propertyPVALID}, // TIBETAN MARK NGAS BZUNG NYI ZLA + {0x0F36, 0x0, propertyDISALLOWED}, // TIBETAN MARK CARET -DZUD RTAGS BZHI MIG CAN + {0x0F37, 0x0, propertyPVALID}, // TIBETAN MARK NGAS BZUNG SGOR RTAGS + {0x0F38, 0x0, propertyDISALLOWED}, // TIBETAN MARK CHE MGO + {0x0F39, 0x0, propertyPVALID}, // TIBETAN MARK TSA -PHRU + {0x0F3A, 0x0F3D, propertyDISALLOWED}, // TIBETAN MARK GUG RTAGS GYON..TIBETAN MARK AN + {0x0F3E, 0x0F42, propertyPVALID}, // TIBETAN SIGN YAR TSHES..TIBETAN LETTER GA + {0x0F43, 0x0, propertyDISALLOWED}, // TIBETAN LETTER GHA + {0x0F44, 0x0F47, propertyPVALID}, // TIBETAN LETTER NGA..TIBETAN LETTER JA + {0x0F48, 0x0, propertyUNASSIGNED}, // + {0x0F49, 0x0F4C, propertyPVALID}, // TIBETAN LETTER NYA..TIBETAN LETTER DDA + {0x0F4D, 0x0, propertyDISALLOWED}, // TIBETAN LETTER DDHA + {0x0F4E, 0x0F51, propertyPVALID}, // TIBETAN LETTER NNA..TIBETAN LETTER DA + {0x0F52, 0x0, propertyDISALLOWED}, // TIBETAN LETTER DHA + {0x0F53, 0x0F56, propertyPVALID}, // TIBETAN LETTER NA..TIBETAN LETTER BA + {0x0F57, 0x0, propertyDISALLOWED}, // TIBETAN LETTER BHA + {0x0F58, 0x0F5B, propertyPVALID}, // TIBETAN LETTER MA..TIBETAN LETTER DZA + {0x0F5C, 0x0, propertyDISALLOWED}, // TIBETAN LETTER DZHA + {0x0F5D, 0x0F68, propertyPVALID}, // TIBETAN LETTER WA..TIBETAN LETTER A + {0x0F69, 0x0, propertyDISALLOWED}, // TIBETAN LETTER KSSA + {0x0F6A, 0x0F6C, propertyPVALID}, // TIBETAN LETTER FIXED-FORM RA..TIBETAN LETTER + {0x0F6D, 0x0F70, propertyUNASSIGNED}, // .. + {0x0F71, 0x0F72, propertyPVALID}, // TIBETAN VOWEL SIGN AA..TIBETAN VOWEL SIGN I + {0x0F73, 0x0, propertyDISALLOWED}, // TIBETAN VOWEL SIGN II + {0x0F74, 0x0, propertyPVALID}, // TIBETAN VOWEL SIGN U + {0x0F75, 0x0F79, propertyDISALLOWED}, // TIBETAN VOWEL SIGN UU..TIBETAN VOWEL SIGN VO + {0x0F7A, 0x0F80, propertyPVALID}, // TIBETAN VOWEL SIGN E..TIBETAN VOWEL SIGN REV + {0x0F81, 0x0, propertyDISALLOWED}, // TIBETAN VOWEL SIGN REVERSED II + {0x0F82, 0x0F84, propertyPVALID}, // TIBETAN SIGN NYI ZLA NAA DA..TIBETAN MARK HA + {0x0F85, 0x0, propertyDISALLOWED}, // TIBETAN MARK PALUTA + {0x0F86, 0x0F8B, propertyPVALID}, // TIBETAN SIGN LCI RTAGS..TIBETAN SIGN GRU MED + {0x0F8C, 0x0F8F, propertyUNASSIGNED}, // .. + {0x0F90, 0x0F92, propertyPVALID}, // TIBETAN SUBJOINED LETTER KA..TIBETAN SUBJOIN + {0x0F93, 0x0, propertyDISALLOWED}, // TIBETAN SUBJOINED LETTER GHA + {0x0F94, 0x0F97, propertyPVALID}, // TIBETAN SUBJOINED LETTER NGA..TIBETAN SUBJOI + {0x0F98, 0x0, propertyUNASSIGNED}, // + {0x0F99, 0x0F9C, propertyPVALID}, // TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOI + {0x0F9D, 0x0, propertyDISALLOWED}, // TIBETAN SUBJOINED LETTER DDHA + {0x0F9E, 0x0FA1, propertyPVALID}, // TIBETAN SUBJOINED LETTER NNA..TIBETAN SUBJOI + {0x0FA2, 0x0, propertyDISALLOWED}, // TIBETAN SUBJOINED LETTER DHA + {0x0FA3, 0x0FA6, propertyPVALID}, // TIBETAN SUBJOINED LETTER NA..TIBETAN SUBJOIN + {0x0FA7, 0x0, propertyDISALLOWED}, // TIBETAN SUBJOINED LETTER BHA + {0x0FA8, 0x0FAB, propertyPVALID}, // TIBETAN SUBJOINED LETTER MA..TIBETAN SUBJOIN + {0x0FAC, 0x0, propertyDISALLOWED}, // TIBETAN SUBJOINED LETTER DZHA + {0x0FAD, 0x0FB8, propertyPVALID}, // TIBETAN SUBJOINED LETTER WA..TIBETAN SUBJOIN + {0x0FB9, 0x0, propertyDISALLOWED}, // TIBETAN SUBJOINED LETTER KSSA + {0x0FBA, 0x0FBC, propertyPVALID}, // TIBETAN SUBJOINED LETTER FIXED-FORM WA..TIBE + {0x0FBD, 0x0, propertyUNASSIGNED}, // + {0x0FBE, 0x0FC5, propertyDISALLOWED}, // TIBETAN KU RU KHA..TIBETAN SYMBOL RDO RJE + {0x0FC6, 0x0, propertyPVALID}, // TIBETAN SYMBOL PADMA GDAN + {0x0FC7, 0x0FCC, propertyDISALLOWED}, // TIBETAN SYMBOL RDO RJE RGYA GRAM..TIBETAN SY + {0x0FCD, 0x0, propertyUNASSIGNED}, // + {0x0FCE, 0x0FD8, propertyDISALLOWED}, // TIBETAN SIGN RDEL NAG RDEL DKAR..LEFT-FACING + {0x0FD9, 0x0FFF, propertyUNASSIGNED}, // .. + {0x1000, 0x1049, propertyPVALID}, // MYANMAR LETTER KA..MYANMAR DIGIT NINE + {0x104A, 0x104F, propertyDISALLOWED}, // MYANMAR SIGN LITTLE SECTION..MYANMAR SYMBOL + {0x1050, 0x109D, propertyPVALID}, // MYANMAR LETTER SHA..MYANMAR VOWEL SIGN AITON + {0x109E, 0x10C5, propertyDISALLOWED}, // MYANMAR SYMBOL SHAN ONE..GEORGIAN CAPITAL LE + {0x10C6, 0x10CF, propertyUNASSIGNED}, // .. + {0x10D0, 0x10FA, propertyPVALID}, // GEORGIAN LETTER AN..GEORGIAN LETTER AIN + {0x10FB, 0x10FC, propertyDISALLOWED}, // GEORGIAN PARAGRAPH SEPARATOR..MODIFIER LETTE + {0x10FD, 0x10FF, propertyUNASSIGNED}, // .. + {0x1100, 0x11FF, propertyDISALLOWED}, // HANGUL CHOSEONG KIYEOK..HANGUL JONGSEONG SSA + {0x1200, 0x1248, propertyPVALID}, // ETHIOPIC SYLLABLE HA..ETHIOPIC SYLLABLE QWA + {0x1249, 0x0, propertyUNASSIGNED}, // + {0x124A, 0x124D, propertyPVALID}, // ETHIOPIC SYLLABLE QWI..ETHIOPIC SYLLABLE QWE + {0x124E, 0x124F, propertyUNASSIGNED}, // .. + {0x1250, 0x1256, propertyPVALID}, // ETHIOPIC SYLLABLE QHA..ETHIOPIC SYLLABLE QHO + {0x1257, 0x0, propertyUNASSIGNED}, // + {0x1258, 0x0, propertyPVALID}, // ETHIOPIC SYLLABLE QHWA + {0x1259, 0x0, propertyUNASSIGNED}, // + {0x125A, 0x125D, propertyPVALID}, // ETHIOPIC SYLLABLE QHWI..ETHIOPIC SYLLABLE QH + {0x125E, 0x125F, propertyUNASSIGNED}, // .. + {0x1260, 0x1288, propertyPVALID}, // ETHIOPIC SYLLABLE BA..ETHIOPIC SYLLABLE XWA + {0x1289, 0x0, propertyUNASSIGNED}, // + {0x128A, 0x128D, propertyPVALID}, // ETHIOPIC SYLLABLE XWI..ETHIOPIC SYLLABLE XWE + {0x128E, 0x128F, propertyUNASSIGNED}, // .. + {0x1290, 0x12B0, propertyPVALID}, // ETHIOPIC SYLLABLE NA..ETHIOPIC SYLLABLE KWA + {0x12B1, 0x0, propertyUNASSIGNED}, // + {0x12B2, 0x12B5, propertyPVALID}, // ETHIOPIC SYLLABLE KWI..ETHIOPIC SYLLABLE KWE + {0x12B6, 0x12B7, propertyUNASSIGNED}, // .. + {0x12B8, 0x12BE, propertyPVALID}, // ETHIOPIC SYLLABLE KXA..ETHIOPIC SYLLABLE KXO + {0x12BF, 0x0, propertyUNASSIGNED}, // + {0x12C0, 0x0, propertyPVALID}, // ETHIOPIC SYLLABLE KXWA + {0x12C1, 0x0, propertyUNASSIGNED}, // + {0x12C2, 0x12C5, propertyPVALID}, // ETHIOPIC SYLLABLE KXWI..ETHIOPIC SYLLABLE KX + {0x12C6, 0x12C7, propertyUNASSIGNED}, // .. + {0x12C8, 0x12D6, propertyPVALID}, // ETHIOPIC SYLLABLE WA..ETHIOPIC SYLLABLE PHAR + {0x12D7, 0x0, propertyUNASSIGNED}, // + {0x12D8, 0x1310, propertyPVALID}, // ETHIOPIC SYLLABLE ZA..ETHIOPIC SYLLABLE GWA + {0x1311, 0x0, propertyUNASSIGNED}, // + {0x1312, 0x1315, propertyPVALID}, // ETHIOPIC SYLLABLE GWI..ETHIOPIC SYLLABLE GWE + {0x1316, 0x1317, propertyUNASSIGNED}, // .. + {0x1318, 0x135A, propertyPVALID}, // ETHIOPIC SYLLABLE GGA..ETHIOPIC SYLLABLE FYA + {0x135B, 0x135E, propertyUNASSIGNED}, // .. + {0x135F, 0x0, propertyPVALID}, // ETHIOPIC COMBINING GEMINATION MARK + {0x1360, 0x137C, propertyDISALLOWED}, // ETHIOPIC SECTION MARK..ETHIOPIC NUMBER TEN T + {0x137D, 0x137F, propertyUNASSIGNED}, // .. + {0x1380, 0x138F, propertyPVALID}, // ETHIOPIC SYLLABLE SEBATBEIT MWA..ETHIOPIC SY + {0x1390, 0x1399, propertyDISALLOWED}, // ETHIOPIC TONAL MARK YIZET..ETHIOPIC TONAL MA + {0x139A, 0x139F, propertyUNASSIGNED}, // .. + {0x13A0, 0x13F4, propertyPVALID}, // CHEROKEE LETTER A..CHEROKEE LETTER YV + {0x13F5, 0x13FF, propertyUNASSIGNED}, // .. + {0x1400, 0x0, propertyDISALLOWED}, // CANADIAN SYLLABICS HYPHEN + {0x1401, 0x166C, propertyPVALID}, // CANADIAN SYLLABICS E..CANADIAN SYLLABICS CAR + {0x166D, 0x166E, propertyDISALLOWED}, // CANADIAN SYLLABICS CHI SIGN..CANADIAN SYLLAB + {0x166F, 0x167F, propertyPVALID}, // CANADIAN SYLLABICS QAI..CANADIAN SYLLABICS B + {0x1680, 0x0, propertyDISALLOWED}, // OGHAM SPACE MARK + {0x1681, 0x169A, propertyPVALID}, // OGHAM LETTER BEITH..OGHAM LETTER PEITH + {0x169B, 0x169C, propertyDISALLOWED}, // OGHAM FEATHER MARK..OGHAM REVERSED FEATHER M + {0x169D, 0x169F, propertyUNASSIGNED}, // .. + {0x16A0, 0x16EA, propertyPVALID}, // RUNIC LETTER FEHU FEOH FE F..RUNIC LETTER X + {0x16EB, 0x16F0, propertyDISALLOWED}, // RUNIC SINGLE PUNCTUATION..RUNIC BELGTHOR SYM + {0x16F1, 0x16FF, propertyUNASSIGNED}, // .. + {0x1700, 0x170C, propertyPVALID}, // TAGALOG LETTER A..TAGALOG LETTER YA + {0x170D, 0x0, propertyUNASSIGNED}, // + {0x170E, 0x1714, propertyPVALID}, // TAGALOG LETTER LA..TAGALOG SIGN VIRAMA + {0x1715, 0x171F, propertyUNASSIGNED}, // .. + {0x1720, 0x1734, propertyPVALID}, // HANUNOO LETTER A..HANUNOO SIGN PAMUDPOD + {0x1735, 0x1736, propertyDISALLOWED}, // PHILIPPINE SINGLE PUNCTUATION..PHILIPPINE DO + {0x1737, 0x173F, propertyUNASSIGNED}, // .. + {0x1740, 0x1753, propertyPVALID}, // BUHID LETTER A..BUHID VOWEL SIGN U + {0x1754, 0x175F, propertyUNASSIGNED}, // .. + {0x1760, 0x176C, propertyPVALID}, // TAGBANWA LETTER A..TAGBANWA LETTER YA + {0x176D, 0x0, propertyUNASSIGNED}, // + {0x176E, 0x1770, propertyPVALID}, // TAGBANWA LETTER LA..TAGBANWA LETTER SA + {0x1771, 0x0, propertyUNASSIGNED}, // + {0x1772, 0x1773, propertyPVALID}, // TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U + {0x1774, 0x177F, propertyUNASSIGNED}, // .. + {0x1780, 0x17B3, propertyPVALID}, // KHMER LETTER KA..KHMER INDEPENDENT VOWEL QAU + {0x17B4, 0x17B5, propertyDISALLOWED}, // KHMER VOWEL INHERENT AQ..KHMER VOWEL INHEREN + {0x17B6, 0x17D3, propertyPVALID}, // KHMER VOWEL SIGN AA..KHMER SIGN BATHAMASAT + {0x17D4, 0x17D6, propertyDISALLOWED}, // KHMER SIGN KHAN..KHMER SIGN CAMNUC PII KUUH + {0x17D7, 0x0, propertyPVALID}, // KHMER SIGN LEK TOO + {0x17D8, 0x17DB, propertyDISALLOWED}, // KHMER SIGN BEYYAL..KHMER CURRENCY SYMBOL RIE + {0x17DC, 0x17DD, propertyPVALID}, // KHMER SIGN AVAKRAHASANYA..KHMER SIGN ATTHACA + {0x17DE, 0x17DF, propertyUNASSIGNED}, // .. + {0x17E0, 0x17E9, propertyPVALID}, // KHMER DIGIT ZERO..KHMER DIGIT NINE + {0x17EA, 0x17EF, propertyUNASSIGNED}, // .. + {0x17F0, 0x17F9, propertyDISALLOWED}, // KHMER SYMBOL LEK ATTAK SON..KHMER SYMBOL LEK + {0x17FA, 0x17FF, propertyUNASSIGNED}, // .. + {0x1800, 0x180E, propertyDISALLOWED}, // MONGOLIAN BIRGA..MONGOLIAN VOWEL SEPARATOR + {0x180F, 0x0, propertyUNASSIGNED}, // + {0x1810, 0x1819, propertyPVALID}, // MONGOLIAN DIGIT ZERO..MONGOLIAN DIGIT NINE + {0x181A, 0x181F, propertyUNASSIGNED}, // .. + {0x1820, 0x1877, propertyPVALID}, // MONGOLIAN LETTER A..MONGOLIAN LETTER MANCHU + {0x1878, 0x187F, propertyUNASSIGNED}, // .. + {0x1880, 0x18AA, propertyPVALID}, // MONGOLIAN LETTER ALI GALI ANUSVARA ONE..MONG + {0x18AB, 0x18AF, propertyUNASSIGNED}, // .. + {0x18B0, 0x18F5, propertyPVALID}, // CANADIAN SYLLABICS OY..CANADIAN SYLLABICS CA + {0x18F6, 0x18FF, propertyUNASSIGNED}, // .. + {0x1900, 0x191C, propertyPVALID}, // LIMBU VOWEL-CARRIER LETTER..LIMBU LETTER HA + {0x191D, 0x191F, propertyUNASSIGNED}, // .. + {0x1920, 0x192B, propertyPVALID}, // LIMBU VOWEL SIGN A..LIMBU SUBJOINED LETTER W + {0x192C, 0x192F, propertyUNASSIGNED}, // .. + {0x1930, 0x193B, propertyPVALID}, // LIMBU SMALL LETTER KA..LIMBU SIGN SA-I + {0x193C, 0x193F, propertyUNASSIGNED}, // .. + {0x1940, 0x0, propertyDISALLOWED}, // LIMBU SIGN LOO + {0x1941, 0x1943, propertyUNASSIGNED}, // .. + {0x1944, 0x1945, propertyDISALLOWED}, // LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK + {0x1946, 0x196D, propertyPVALID}, // LIMBU DIGIT ZERO..TAI LE LETTER AI + {0x196E, 0x196F, propertyUNASSIGNED}, // .. + {0x1970, 0x1974, propertyPVALID}, // TAI LE LETTER TONE-2..TAI LE LETTER TONE-6 + {0x1975, 0x197F, propertyUNASSIGNED}, // .. + {0x1980, 0x19AB, propertyPVALID}, // NEW TAI LUE LETTER HIGH QA..NEW TAI LUE LETT + {0x19AC, 0x19AF, propertyUNASSIGNED}, // .. + {0x19B0, 0x19C9, propertyPVALID}, // NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW + {0x19CA, 0x19CF, propertyUNASSIGNED}, // .. + {0x19D0, 0x19DA, propertyPVALID}, // NEW TAI LUE DIGIT ZERO..NEW TAI LUE THAM DIG + {0x19DB, 0x19DD, propertyUNASSIGNED}, // .. + {0x19DE, 0x19FF, propertyDISALLOWED}, // NEW TAI LUE SIGN LAE..KHMER SYMBOL DAP-PRAM + {0x1A00, 0x1A1B, propertyPVALID}, // BUGINESE LETTER KA..BUGINESE VOWEL SIGN AE + {0x1A1C, 0x1A1D, propertyUNASSIGNED}, // .. + {0x1A1E, 0x1A1F, propertyDISALLOWED}, // BUGINESE PALLAWA..BUGINESE END OF SECTION + {0x1A20, 0x1A5E, propertyPVALID}, // TAI THAM LETTER HIGH KA..TAI THAM CONSONANT + {0x1A5F, 0x0, propertyUNASSIGNED}, // + {0x1A60, 0x1A7C, propertyPVALID}, // TAI THAM SIGN SAKOT..TAI THAM SIGN KHUEN-LUE + {0x1A7D, 0x1A7E, propertyUNASSIGNED}, // .. + {0x1A7F, 0x1A89, propertyPVALID}, // TAI THAM COMBINING CRYPTOGRAMMIC DOT..TAI TH + {0x1A8A, 0x1A8F, propertyUNASSIGNED}, // .. + {0x1A90, 0x1A99, propertyPVALID}, // TAI THAM THAM DIGIT ZERO..TAI THAM THAM DIGI + {0x1A9A, 0x1A9F, propertyUNASSIGNED}, // .. + {0x1AA0, 0x1AA6, propertyDISALLOWED}, // TAI THAM SIGN WIANG..TAI THAM SIGN REVERSED + {0x1AA7, 0x0, propertyPVALID}, // TAI THAM SIGN MAI YAMOK + {0x1AA8, 0x1AAD, propertyDISALLOWED}, // TAI THAM SIGN KAAN..TAI THAM SIGN CAANG + {0x1AAE, 0x1AFF, propertyUNASSIGNED}, // .. + {0x1B00, 0x1B4B, propertyPVALID}, // BALINESE SIGN ULU RICEM..BALINESE LETTER ASY + {0x1B4C, 0x1B4F, propertyUNASSIGNED}, // .. + {0x1B50, 0x1B59, propertyPVALID}, // BALINESE DIGIT ZERO..BALINESE DIGIT NINE + {0x1B5A, 0x1B6A, propertyDISALLOWED}, // BALINESE PANTI..BALINESE MUSICAL SYMBOL DANG + {0x1B6B, 0x1B73, propertyPVALID}, // BALINESE MUSICAL SYMBOL COMBINING TEGEH..BAL + {0x1B74, 0x1B7C, propertyDISALLOWED}, // BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DUG. + {0x1B7D, 0x1B7F, propertyUNASSIGNED}, // .. + {0x1B80, 0x1BAA, propertyPVALID}, // SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PAMA + {0x1BAB, 0x1BAD, propertyUNASSIGNED}, // .. + {0x1BAE, 0x1BB9, propertyPVALID}, // SUNDANESE LETTER KHA..SUNDANESE DIGIT NINE + {0x1BBA, 0x1BFF, propertyUNASSIGNED}, // .. + {0x1C00, 0x1C37, propertyPVALID}, // LEPCHA LETTER KA..LEPCHA SIGN NUKTA + {0x1C38, 0x1C3A, propertyUNASSIGNED}, // .. + {0x1C3B, 0x1C3F, propertyDISALLOWED}, // LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATIO + {0x1C40, 0x1C49, propertyPVALID}, // LEPCHA DIGIT ZERO..LEPCHA DIGIT NINE + {0x1C4A, 0x1C4C, propertyUNASSIGNED}, // .. + {0x1C4D, 0x1C7D, propertyPVALID}, // LEPCHA LETTER TTA..OL CHIKI AHAD + {0x1C7E, 0x1C7F, propertyDISALLOWED}, // OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTU + {0x1C80, 0x1CCF, propertyUNASSIGNED}, // .. + {0x1CD0, 0x1CD2, propertyPVALID}, // VEDIC TONE KARSHANA..VEDIC TONE PRENKHA + {0x1CD3, 0x0, propertyDISALLOWED}, // VEDIC SIGN NIHSHVASA + {0x1CD4, 0x1CF2, propertyPVALID}, // VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC + {0x1CF3, 0x1CFF, propertyUNASSIGNED}, // .. + {0x1D00, 0x1D2B, propertyPVALID}, // LATIN LETTER SMALL CAPITAL A..CYRILLIC LETTE + {0x1D2C, 0x1D2E, propertyDISALLOWED}, // MODIFIER LETTER CAPITAL A..MODIFIER LETTER C + {0x1D2F, 0x0, propertyPVALID}, // MODIFIER LETTER CAPITAL BARRED B + {0x1D30, 0x1D3A, propertyDISALLOWED}, // MODIFIER LETTER CAPITAL D..MODIFIER LETTER C + {0x1D3B, 0x0, propertyPVALID}, // MODIFIER LETTER CAPITAL REVERSED N + {0x1D3C, 0x1D4D, propertyDISALLOWED}, // MODIFIER LETTER CAPITAL O..MODIFIER LETTER S + {0x1D4E, 0x0, propertyPVALID}, // MODIFIER LETTER SMALL TURNED I + {0x1D4F, 0x1D6A, propertyDISALLOWED}, // MODIFIER LETTER SMALL K..GREEK SUBSCRIPT SMA + {0x1D6B, 0x1D77, propertyPVALID}, // LATIN SMALL LETTER UE..LATIN SMALL LETTER TU + {0x1D78, 0x0, propertyDISALLOWED}, // MODIFIER LETTER CYRILLIC EN + {0x1D79, 0x1D9A, propertyPVALID}, // LATIN SMALL LETTER INSULAR G..LATIN SMALL LE + {0x1D9B, 0x1DBF, propertyDISALLOWED}, // MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER + {0x1DC0, 0x1DE6, propertyPVALID}, // COMBINING DOTTED GRAVE ACCENT..COMBINING LAT + {0x1DE7, 0x1DFC, propertyUNASSIGNED}, // .. + {0x1DFD, 0x1DFF, propertyPVALID}, // COMBINING ALMOST EQUAL TO BELOW..COMBINING R + {0x1E00, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH RING BELOW + {0x1E01, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH RING BELOW + {0x1E02, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER B WITH DOT ABOVE + {0x1E03, 0x0, propertyPVALID}, // LATIN SMALL LETTER B WITH DOT ABOVE + {0x1E04, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER B WITH DOT BELOW + {0x1E05, 0x0, propertyPVALID}, // LATIN SMALL LETTER B WITH DOT BELOW + {0x1E06, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER B WITH LINE BELOW + {0x1E07, 0x0, propertyPVALID}, // LATIN SMALL LETTER B WITH LINE BELOW + {0x1E08, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER C WITH CEDILLA AND ACUT + {0x1E09, 0x0, propertyPVALID}, // LATIN SMALL LETTER C WITH CEDILLA AND ACUTE + {0x1E0A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER D WITH DOT ABOVE + {0x1E0B, 0x0, propertyPVALID}, // LATIN SMALL LETTER D WITH DOT ABOVE + {0x1E0C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER D WITH DOT BELOW + {0x1E0D, 0x0, propertyPVALID}, // LATIN SMALL LETTER D WITH DOT BELOW + {0x1E0E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER D WITH LINE BELOW + {0x1E0F, 0x0, propertyPVALID}, // LATIN SMALL LETTER D WITH LINE BELOW + {0x1E10, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER D WITH CEDILLA + {0x1E11, 0x0, propertyPVALID}, // LATIN SMALL LETTER D WITH CEDILLA + {0x1E12, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW + {0x1E13, 0x0, propertyPVALID}, // LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW + {0x1E14, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH MACRON AND GRAVE + {0x1E15, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH MACRON AND GRAVE + {0x1E16, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH MACRON AND ACUTE + {0x1E17, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH MACRON AND ACUTE + {0x1E18, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW + {0x1E19, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW + {0x1E1A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH TILDE BELOW + {0x1E1B, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH TILDE BELOW + {0x1E1C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH CEDILLA AND BREV + {0x1E1D, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH CEDILLA AND BREVE + {0x1E1E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER F WITH DOT ABOVE + {0x1E1F, 0x0, propertyPVALID}, // LATIN SMALL LETTER F WITH DOT ABOVE + {0x1E20, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER G WITH MACRON + {0x1E21, 0x0, propertyPVALID}, // LATIN SMALL LETTER G WITH MACRON + {0x1E22, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER H WITH DOT ABOVE + {0x1E23, 0x0, propertyPVALID}, // LATIN SMALL LETTER H WITH DOT ABOVE + {0x1E24, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER H WITH DOT BELOW + {0x1E25, 0x0, propertyPVALID}, // LATIN SMALL LETTER H WITH DOT BELOW + {0x1E26, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER H WITH DIAERESIS + {0x1E27, 0x0, propertyPVALID}, // LATIN SMALL LETTER H WITH DIAERESIS + {0x1E28, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER H WITH CEDILLA + {0x1E29, 0x0, propertyPVALID}, // LATIN SMALL LETTER H WITH CEDILLA + {0x1E2A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER H WITH BREVE BELOW + {0x1E2B, 0x0, propertyPVALID}, // LATIN SMALL LETTER H WITH BREVE BELOW + {0x1E2C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH TILDE BELOW + {0x1E2D, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH TILDE BELOW + {0x1E2E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH DIAERESIS AND AC + {0x1E2F, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH DIAERESIS AND ACUT + {0x1E30, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER K WITH ACUTE + {0x1E31, 0x0, propertyPVALID}, // LATIN SMALL LETTER K WITH ACUTE + {0x1E32, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER K WITH DOT BELOW + {0x1E33, 0x0, propertyPVALID}, // LATIN SMALL LETTER K WITH DOT BELOW + {0x1E34, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER K WITH LINE BELOW + {0x1E35, 0x0, propertyPVALID}, // LATIN SMALL LETTER K WITH LINE BELOW + {0x1E36, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH DOT BELOW + {0x1E37, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH DOT BELOW + {0x1E38, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH DOT BELOW AND MA + {0x1E39, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH DOT BELOW AND MACR + {0x1E3A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH LINE BELOW + {0x1E3B, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH LINE BELOW + {0x1E3C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW + {0x1E3D, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW + {0x1E3E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER M WITH ACUTE + {0x1E3F, 0x0, propertyPVALID}, // LATIN SMALL LETTER M WITH ACUTE + {0x1E40, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER M WITH DOT ABOVE + {0x1E41, 0x0, propertyPVALID}, // LATIN SMALL LETTER M WITH DOT ABOVE + {0x1E42, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER M WITH DOT BELOW + {0x1E43, 0x0, propertyPVALID}, // LATIN SMALL LETTER M WITH DOT BELOW + {0x1E44, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER N WITH DOT ABOVE + {0x1E45, 0x0, propertyPVALID}, // LATIN SMALL LETTER N WITH DOT ABOVE + {0x1E46, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER N WITH DOT BELOW + {0x1E47, 0x0, propertyPVALID}, // LATIN SMALL LETTER N WITH DOT BELOW + {0x1E48, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER N WITH LINE BELOW + {0x1E49, 0x0, propertyPVALID}, // LATIN SMALL LETTER N WITH LINE BELOW + {0x1E4A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW + {0x1E4B, 0x0, propertyPVALID}, // LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW + {0x1E4C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH TILDE AND ACUTE + {0x1E4D, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH TILDE AND ACUTE + {0x1E4E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH TILDE AND DIAERE + {0x1E4F, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH TILDE AND DIAERESI + {0x1E50, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH MACRON AND GRAVE + {0x1E51, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH MACRON AND GRAVE + {0x1E52, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH MACRON AND ACUTE + {0x1E53, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH MACRON AND ACUTE + {0x1E54, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER P WITH ACUTE + {0x1E55, 0x0, propertyPVALID}, // LATIN SMALL LETTER P WITH ACUTE + {0x1E56, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER P WITH DOT ABOVE + {0x1E57, 0x0, propertyPVALID}, // LATIN SMALL LETTER P WITH DOT ABOVE + {0x1E58, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH DOT ABOVE + {0x1E59, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH DOT ABOVE + {0x1E5A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH DOT BELOW + {0x1E5B, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH DOT BELOW + {0x1E5C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH DOT BELOW AND MA + {0x1E5D, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH DOT BELOW AND MACR + {0x1E5E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R WITH LINE BELOW + {0x1E5F, 0x0, propertyPVALID}, // LATIN SMALL LETTER R WITH LINE BELOW + {0x1E60, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH DOT ABOVE + {0x1E61, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH DOT ABOVE + {0x1E62, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH DOT BELOW + {0x1E63, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH DOT BELOW + {0x1E64, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH ACUTE AND DOT AB + {0x1E65, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH ACUTE AND DOT ABOV + {0x1E66, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH CARON AND DOT AB + {0x1E67, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH CARON AND DOT ABOV + {0x1E68, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER S WITH DOT BELOW AND DO + {0x1E69, 0x0, propertyPVALID}, // LATIN SMALL LETTER S WITH DOT BELOW AND DOT + {0x1E6A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH DOT ABOVE + {0x1E6B, 0x0, propertyPVALID}, // LATIN SMALL LETTER T WITH DOT ABOVE + {0x1E6C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH DOT BELOW + {0x1E6D, 0x0, propertyPVALID}, // LATIN SMALL LETTER T WITH DOT BELOW + {0x1E6E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH LINE BELOW + {0x1E6F, 0x0, propertyPVALID}, // LATIN SMALL LETTER T WITH LINE BELOW + {0x1E70, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW + {0x1E71, 0x0, propertyPVALID}, // LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW + {0x1E72, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH DIAERESIS BELOW + {0x1E73, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH DIAERESIS BELOW + {0x1E74, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH TILDE BELOW + {0x1E75, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH TILDE BELOW + {0x1E76, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW + {0x1E77, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW + {0x1E78, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH TILDE AND ACUTE + {0x1E79, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH TILDE AND ACUTE + {0x1E7A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH MACRON AND DIAER + {0x1E7B, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH MACRON AND DIAERES + {0x1E7C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER V WITH TILDE + {0x1E7D, 0x0, propertyPVALID}, // LATIN SMALL LETTER V WITH TILDE + {0x1E7E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER V WITH DOT BELOW + {0x1E7F, 0x0, propertyPVALID}, // LATIN SMALL LETTER V WITH DOT BELOW + {0x1E80, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER W WITH GRAVE + {0x1E81, 0x0, propertyPVALID}, // LATIN SMALL LETTER W WITH GRAVE + {0x1E82, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER W WITH ACUTE + {0x1E83, 0x0, propertyPVALID}, // LATIN SMALL LETTER W WITH ACUTE + {0x1E84, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER W WITH DIAERESIS + {0x1E85, 0x0, propertyPVALID}, // LATIN SMALL LETTER W WITH DIAERESIS + {0x1E86, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER W WITH DOT ABOVE + {0x1E87, 0x0, propertyPVALID}, // LATIN SMALL LETTER W WITH DOT ABOVE + {0x1E88, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER W WITH DOT BELOW + {0x1E89, 0x0, propertyPVALID}, // LATIN SMALL LETTER W WITH DOT BELOW + {0x1E8A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER X WITH DOT ABOVE + {0x1E8B, 0x0, propertyPVALID}, // LATIN SMALL LETTER X WITH DOT ABOVE + {0x1E8C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER X WITH DIAERESIS + {0x1E8D, 0x0, propertyPVALID}, // LATIN SMALL LETTER X WITH DIAERESIS + {0x1E8E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH DOT ABOVE + {0x1E8F, 0x0, propertyPVALID}, // LATIN SMALL LETTER Y WITH DOT ABOVE + {0x1E90, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Z WITH CIRCUMFLEX + {0x1E91, 0x0, propertyPVALID}, // LATIN SMALL LETTER Z WITH CIRCUMFLEX + {0x1E92, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Z WITH DOT BELOW + {0x1E93, 0x0, propertyPVALID}, // LATIN SMALL LETTER Z WITH DOT BELOW + {0x1E94, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Z WITH LINE BELOW + {0x1E95, 0x1E99, propertyPVALID}, // LATIN SMALL LETTER Z WITH LINE BELOW..LATIN + {0x1E9A, 0x1E9B, propertyDISALLOWED}, // LATIN SMALL LETTER A WITH RIGHT HALF RING..L + {0x1E9C, 0x1E9D, propertyPVALID}, // LATIN SMALL LETTER LONG S WITH DIAGONAL STRO + {0x1E9E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER SHARP S + {0x1E9F, 0x0, propertyPVALID}, // LATIN SMALL LETTER DELTA + {0x1EA0, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH DOT BELOW + {0x1EA1, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH DOT BELOW + {0x1EA2, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH HOOK ABOVE + {0x1EA3, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH HOOK ABOVE + {0x1EA4, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND A + {0x1EA5, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACU + {0x1EA6, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND G + {0x1EA7, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRA + {0x1EA8, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND H + {0x1EA9, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOO + {0x1EAA, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND T + {0x1EAB, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND TIL + {0x1EAC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND D + {0x1EAD, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT + {0x1EAE, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH BREVE AND ACUTE + {0x1EAF, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH BREVE AND ACUTE + {0x1EB0, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH BREVE AND GRAVE + {0x1EB1, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH BREVE AND GRAVE + {0x1EB2, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH BREVE AND HOOK A + {0x1EB3, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH BREVE AND HOOK ABO + {0x1EB4, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH BREVE AND TILDE + {0x1EB5, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH BREVE AND TILDE + {0x1EB6, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER A WITH BREVE AND DOT BE + {0x1EB7, 0x0, propertyPVALID}, // LATIN SMALL LETTER A WITH BREVE AND DOT BELO + {0x1EB8, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH DOT BELOW + {0x1EB9, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH DOT BELOW + {0x1EBA, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH HOOK ABOVE + {0x1EBB, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH HOOK ABOVE + {0x1EBC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH TILDE + {0x1EBD, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH TILDE + {0x1EBE, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND A + {0x1EBF, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACU + {0x1EC0, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND G + {0x1EC1, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRA + {0x1EC2, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND H + {0x1EC3, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOO + {0x1EC4, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND T + {0x1EC5, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND TIL + {0x1EC6, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND D + {0x1EC7, 0x0, propertyPVALID}, // LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT + {0x1EC8, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH HOOK ABOVE + {0x1EC9, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH HOOK ABOVE + {0x1ECA, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER I WITH DOT BELOW + {0x1ECB, 0x0, propertyPVALID}, // LATIN SMALL LETTER I WITH DOT BELOW + {0x1ECC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH DOT BELOW + {0x1ECD, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH DOT BELOW + {0x1ECE, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH HOOK ABOVE + {0x1ECF, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH HOOK ABOVE + {0x1ED0, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND A + {0x1ED1, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACU + {0x1ED2, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND G + {0x1ED3, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRA + {0x1ED4, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND H + {0x1ED5, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOO + {0x1ED6, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND T + {0x1ED7, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND TIL + {0x1ED8, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND D + {0x1ED9, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT + {0x1EDA, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH HORN AND ACUTE + {0x1EDB, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH HORN AND ACUTE + {0x1EDC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH HORN AND GRAVE + {0x1EDD, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH HORN AND GRAVE + {0x1EDE, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH HORN AND HOOK AB + {0x1EDF, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH HORN AND HOOK ABOV + {0x1EE0, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH HORN AND TILDE + {0x1EE1, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH HORN AND TILDE + {0x1EE2, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH HORN AND DOT BEL + {0x1EE3, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH HORN AND DOT BELOW + {0x1EE4, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH DOT BELOW + {0x1EE5, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH DOT BELOW + {0x1EE6, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH HOOK ABOVE + {0x1EE7, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH HOOK ABOVE + {0x1EE8, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH HORN AND ACUTE + {0x1EE9, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH HORN AND ACUTE + {0x1EEA, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH HORN AND GRAVE + {0x1EEB, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH HORN AND GRAVE + {0x1EEC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH HORN AND HOOK AB + {0x1EED, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH HORN AND HOOK ABOV + {0x1EEE, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH HORN AND TILDE + {0x1EEF, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH HORN AND TILDE + {0x1EF0, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER U WITH HORN AND DOT BEL + {0x1EF1, 0x0, propertyPVALID}, // LATIN SMALL LETTER U WITH HORN AND DOT BELOW + {0x1EF2, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH GRAVE + {0x1EF3, 0x0, propertyPVALID}, // LATIN SMALL LETTER Y WITH GRAVE + {0x1EF4, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH DOT BELOW + {0x1EF5, 0x0, propertyPVALID}, // LATIN SMALL LETTER Y WITH DOT BELOW + {0x1EF6, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH HOOK ABOVE + {0x1EF7, 0x0, propertyPVALID}, // LATIN SMALL LETTER Y WITH HOOK ABOVE + {0x1EF8, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH TILDE + {0x1EF9, 0x0, propertyPVALID}, // LATIN SMALL LETTER Y WITH TILDE + {0x1EFA, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER MIDDLE-WELSH LL + {0x1EFB, 0x0, propertyPVALID}, // LATIN SMALL LETTER MIDDLE-WELSH LL + {0x1EFC, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER MIDDLE-WELSH V + {0x1EFD, 0x0, propertyPVALID}, // LATIN SMALL LETTER MIDDLE-WELSH V + {0x1EFE, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Y WITH LOOP + {0x1EFF, 0x1F07, propertyPVALID}, // LATIN SMALL LETTER Y WITH LOOP..GREEK SMALL + {0x1F08, 0x1F0F, propertyDISALLOWED}, // GREEK CAPITAL LETTER ALPHA WITH PSILI..GREEK + {0x1F10, 0x1F15, propertyPVALID}, // GREEK SMALL LETTER EPSILON WITH PSILI..GREEK + {0x1F16, 0x1F17, propertyUNASSIGNED}, // .. + {0x1F18, 0x1F1D, propertyDISALLOWED}, // GREEK CAPITAL LETTER EPSILON WITH PSILI..GRE + {0x1F1E, 0x1F1F, propertyUNASSIGNED}, // .. + {0x1F20, 0x1F27, propertyPVALID}, // GREEK SMALL LETTER ETA WITH PSILI..GREEK SMA + {0x1F28, 0x1F2F, propertyDISALLOWED}, // GREEK CAPITAL LETTER ETA WITH PSILI..GREEK C + {0x1F30, 0x1F37, propertyPVALID}, // GREEK SMALL LETTER IOTA WITH PSILI..GREEK SM + {0x1F38, 0x1F3F, propertyDISALLOWED}, // GREEK CAPITAL LETTER IOTA WITH PSILI..GREEK + {0x1F40, 0x1F45, propertyPVALID}, // GREEK SMALL LETTER OMICRON WITH PSILI..GREEK + {0x1F46, 0x1F47, propertyUNASSIGNED}, // .. + {0x1F48, 0x1F4D, propertyDISALLOWED}, // GREEK CAPITAL LETTER OMICRON WITH PSILI..GRE + {0x1F4E, 0x1F4F, propertyUNASSIGNED}, // .. + {0x1F50, 0x1F57, propertyPVALID}, // GREEK SMALL LETTER UPSILON WITH PSILI..GREEK + {0x1F58, 0x0, propertyUNASSIGNED}, // + {0x1F59, 0x0, propertyDISALLOWED}, // GREEK CAPITAL LETTER UPSILON WITH DASIA + {0x1F5A, 0x0, propertyUNASSIGNED}, // + {0x1F5B, 0x0, propertyDISALLOWED}, // GREEK CAPITAL LETTER UPSILON WITH DASIA AND + {0x1F5C, 0x0, propertyUNASSIGNED}, // + {0x1F5D, 0x0, propertyDISALLOWED}, // GREEK CAPITAL LETTER UPSILON WITH DASIA AND + {0x1F5E, 0x0, propertyUNASSIGNED}, // + {0x1F5F, 0x0, propertyDISALLOWED}, // GREEK CAPITAL LETTER UPSILON WITH DASIA AND + {0x1F60, 0x1F67, propertyPVALID}, // GREEK SMALL LETTER OMEGA WITH PSILI..GREEK S + {0x1F68, 0x1F6F, propertyDISALLOWED}, // GREEK CAPITAL LETTER OMEGA WITH PSILI..GREEK + {0x1F70, 0x0, propertyPVALID}, // GREEK SMALL LETTER ALPHA WITH VARIA + {0x1F71, 0x0, propertyDISALLOWED}, // GREEK SMALL LETTER ALPHA WITH OXIA + {0x1F72, 0x0, propertyPVALID}, // GREEK SMALL LETTER EPSILON WITH VARIA + {0x1F73, 0x0, propertyDISALLOWED}, // GREEK SMALL LETTER EPSILON WITH OXIA + {0x1F74, 0x0, propertyPVALID}, // GREEK SMALL LETTER ETA WITH VARIA + {0x1F75, 0x0, propertyDISALLOWED}, // GREEK SMALL LETTER ETA WITH OXIA + {0x1F76, 0x0, propertyPVALID}, // GREEK SMALL LETTER IOTA WITH VARIA + {0x1F77, 0x0, propertyDISALLOWED}, // GREEK SMALL LETTER IOTA WITH OXIA + {0x1F78, 0x0, propertyPVALID}, // GREEK SMALL LETTER OMICRON WITH VARIA + {0x1F79, 0x0, propertyDISALLOWED}, // GREEK SMALL LETTER OMICRON WITH OXIA + {0x1F7A, 0x0, propertyPVALID}, // GREEK SMALL LETTER UPSILON WITH VARIA + {0x1F7B, 0x0, propertyDISALLOWED}, // GREEK SMALL LETTER UPSILON WITH OXIA + {0x1F7C, 0x0, propertyPVALID}, // GREEK SMALL LETTER OMEGA WITH VARIA + {0x1F7D, 0x0, propertyDISALLOWED}, // GREEK SMALL LETTER OMEGA WITH OXIA + {0x1F7E, 0x1F7F, propertyUNASSIGNED}, // .. + {0x1F80, 0x1FAF, propertyDISALLOWED}, // GREEK SMALL LETTER ALPHA WITH PSILI AND YPOG + {0x1FB0, 0x1FB1, propertyPVALID}, // GREEK SMALL LETTER ALPHA WITH VRACHY..GREEK + {0x1FB2, 0x1FB4, propertyDISALLOWED}, // GREEK SMALL LETTER ALPHA WITH VARIA AND YPOG + {0x1FB5, 0x0, propertyUNASSIGNED}, // + {0x1FB6, 0x0, propertyPVALID}, // GREEK SMALL LETTER ALPHA WITH PERISPOMENI + {0x1FB7, 0x1FC4, propertyDISALLOWED}, // GREEK SMALL LETTER ALPHA WITH PERISPOMENI AN + {0x1FC5, 0x0, propertyUNASSIGNED}, // + {0x1FC6, 0x0, propertyPVALID}, // GREEK SMALL LETTER ETA WITH PERISPOMENI + {0x1FC7, 0x1FCF, propertyDISALLOWED}, // GREEK SMALL LETTER ETA WITH PERISPOMENI AND + {0x1FD0, 0x1FD2, propertyPVALID}, // GREEK SMALL LETTER IOTA WITH VRACHY..GREEK S + {0x1FD3, 0x0, propertyDISALLOWED}, // GREEK SMALL LETTER IOTA WITH DIALYTIKA AND O + {0x1FD4, 0x1FD5, propertyUNASSIGNED}, // .. + {0x1FD6, 0x1FD7, propertyPVALID}, // GREEK SMALL LETTER IOTA WITH PERISPOMENI..GR + {0x1FD8, 0x1FDB, propertyDISALLOWED}, // GREEK CAPITAL LETTER IOTA WITH VRACHY..GREEK + {0x1FDC, 0x0, propertyUNASSIGNED}, // + {0x1FDD, 0x1FDF, propertyDISALLOWED}, // GREEK DASIA AND VARIA..GREEK DASIA AND PERIS + {0x1FE0, 0x1FE2, propertyPVALID}, // GREEK SMALL LETTER UPSILON WITH VRACHY..GREE + {0x1FE3, 0x0, propertyDISALLOWED}, // GREEK SMALL LETTER UPSILON WITH DIALYTIKA AN + {0x1FE4, 0x1FE7, propertyPVALID}, // GREEK SMALL LETTER RHO WITH PSILI..GREEK SMA + {0x1FE8, 0x1FEF, propertyDISALLOWED}, // GREEK CAPITAL LETTER UPSILON WITH VRACHY..GR + {0x1FF0, 0x1FF1, propertyUNASSIGNED}, // .. + {0x1FF2, 0x1FF4, propertyDISALLOWED}, // GREEK SMALL LETTER OMEGA WITH VARIA AND YPOG + {0x1FF5, 0x0, propertyUNASSIGNED}, // + {0x1FF6, 0x0, propertyPVALID}, // GREEK SMALL LETTER OMEGA WITH PERISPOMENI + {0x1FF7, 0x1FFE, propertyDISALLOWED}, // GREEK SMALL LETTER OMEGA WITH PERISPOMENI AN + {0x1FFF, 0x0, propertyUNASSIGNED}, // + {0x2000, 0x200B, propertyDISALLOWED}, // EN QUAD..ZERO WIDTH SPACE + {0x200C, 0x200D, propertyCONTEXTJ}, // ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER + {0x200E, 0x2064, propertyDISALLOWED}, // LEFT-TO-RIGHT MARK..INVISIBLE PLUS + {0x2065, 0x2069, propertyUNASSIGNED}, // .. + {0x206A, 0x2071, propertyDISALLOWED}, // INHIBIT SYMMETRIC SWAPPING..SUPERSCRIPT LATI + {0x2072, 0x2073, propertyUNASSIGNED}, // .. + {0x2074, 0x208E, propertyDISALLOWED}, // SUPERSCRIPT FOUR..SUBSCRIPT RIGHT PARENTHESI + {0x208F, 0x0, propertyUNASSIGNED}, // + {0x2090, 0x2094, propertyDISALLOWED}, // LATIN SUBSCRIPT SMALL LETTER A..LATIN SUBSCR + {0x2095, 0x209F, propertyUNASSIGNED}, // .. + {0x20A0, 0x20B8, propertyDISALLOWED}, // EURO-CURRENCY SIGN..TENGE SIGN + {0x20B9, 0x20CF, propertyUNASSIGNED}, // .. + {0x20D0, 0x20F0, propertyDISALLOWED}, // COMBINING LEFT HARPOON ABOVE..COMBINING ASTE + {0x20F1, 0x20FF, propertyUNASSIGNED}, // .. + {0x2100, 0x214D, propertyDISALLOWED}, // ACCOUNT OF..AKTIESELSKAB + {0x214E, 0x0, propertyPVALID}, // TURNED SMALL F + {0x214F, 0x2183, propertyDISALLOWED}, // SYMBOL FOR SAMARITAN SOURCE..ROMAN NUMERAL R + {0x2184, 0x0, propertyPVALID}, // LATIN SMALL LETTER REVERSED C + {0x2185, 0x2189, propertyDISALLOWED}, // ROMAN NUMERAL SIX LATE FORM..VULGAR FRACTION + {0x218A, 0x218F, propertyUNASSIGNED}, // .. + {0x2190, 0x23E8, propertyDISALLOWED}, // LEFTWARDS ARROW..DECIMAL EXPONENT SYMBOL + {0x23E9, 0x23FF, propertyUNASSIGNED}, // .. + {0x2400, 0x2426, propertyDISALLOWED}, // SYMBOL FOR NULL..SYMBOL FOR SUBSTITUTE FORM + {0x2427, 0x243F, propertyUNASSIGNED}, // .. + {0x2440, 0x244A, propertyDISALLOWED}, // OCR HOOK..OCR DOUBLE BACKSLASH + {0x244B, 0x245F, propertyUNASSIGNED}, // .. + {0x2460, 0x26CD, propertyDISALLOWED}, // CIRCLED DIGIT ONE..DISABLED CAR + {0x26CE, 0x0, propertyUNASSIGNED}, // + {0x26CF, 0x26E1, propertyDISALLOWED}, // PICK..RESTRICTED LEFT ENTRY-2 + {0x26E2, 0x0, propertyUNASSIGNED}, // + {0x26E3, 0x0, propertyDISALLOWED}, // HEAVY CIRCLE WITH STROKE AND TWO DOTS ABOVE + {0x26E4, 0x26E7, propertyUNASSIGNED}, // .. + {0x26E8, 0x26FF, propertyDISALLOWED}, // BLACK CROSS ON SHIELD..WHITE FLAG WITH HORIZ + {0x2700, 0x0, propertyUNASSIGNED}, // + {0x2701, 0x2704, propertyDISALLOWED}, // UPPER BLADE SCISSORS..WHITE SCISSORS + {0x2705, 0x0, propertyUNASSIGNED}, // + {0x2706, 0x2709, propertyDISALLOWED}, // TELEPHONE LOCATION SIGN..ENVELOPE + {0x270A, 0x270B, propertyUNASSIGNED}, // .. + {0x270C, 0x2727, propertyDISALLOWED}, // VICTORY HAND..WHITE FOUR POINTED STAR + {0x2728, 0x0, propertyUNASSIGNED}, // + {0x2729, 0x274B, propertyDISALLOWED}, // STRESS OUTLINED WHITE STAR..HEAVY EIGHT TEAR + {0x274C, 0x0, propertyUNASSIGNED}, // + {0x274D, 0x0, propertyDISALLOWED}, // SHADOWED WHITE CIRCLE + {0x274E, 0x0, propertyUNASSIGNED}, // + {0x274F, 0x2752, propertyDISALLOWED}, // LOWER RIGHT DROP-SHADOWED WHITE SQUARE..UPPE + {0x2753, 0x2755, propertyUNASSIGNED}, // .. + {0x2756, 0x275E, propertyDISALLOWED}, // BLACK DIAMOND MINUS WHITE X..HEAVY DOUBLE CO + {0x275F, 0x2760, propertyUNASSIGNED}, // .. + {0x2761, 0x2794, propertyDISALLOWED}, // CURVED STEM PARAGRAPH SIGN ORNAMENT..HEAVY W + {0x2795, 0x2797, propertyUNASSIGNED}, // .. + {0x2798, 0x27AF, propertyDISALLOWED}, // HEAVY SOUTH EAST ARROW..NOTCHED LOWER RIGHT- + {0x27B0, 0x0, propertyUNASSIGNED}, // + {0x27B1, 0x27BE, propertyDISALLOWED}, // NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARD + {0x27BF, 0x0, propertyUNASSIGNED}, // + {0x27C0, 0x27CA, propertyDISALLOWED}, // THREE DIMENSIONAL ANGLE..VERTICAL BAR WITH H + {0x27CB, 0x0, propertyUNASSIGNED}, // + {0x27CC, 0x0, propertyDISALLOWED}, // LONG DIVISION + {0x27CD, 0x27CF, propertyUNASSIGNED}, // .. + {0x27D0, 0x2B4C, propertyDISALLOWED}, // WHITE DIAMOND WITH CENTRED DOT..RIGHTWARDS A + {0x2B4D, 0x2B4F, propertyUNASSIGNED}, // .. + {0x2B50, 0x2B59, propertyDISALLOWED}, // WHITE MEDIUM STAR..HEAVY CIRCLED SALTIRE + {0x2B5A, 0x2BFF, propertyUNASSIGNED}, // .. + {0x2C00, 0x2C2E, propertyDISALLOWED}, // GLAGOLITIC CAPITAL LETTER AZU..GLAGOLITIC CA + {0x2C2F, 0x0, propertyUNASSIGNED}, // + {0x2C30, 0x2C5E, propertyPVALID}, // GLAGOLITIC SMALL LETTER AZU..GLAGOLITIC SMAL + {0x2C5F, 0x0, propertyUNASSIGNED}, // + {0x2C60, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH DOUBLE BAR + {0x2C61, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH DOUBLE BAR + {0x2C62, 0x2C64, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH MIDDLE TILDE..LA + {0x2C65, 0x2C66, propertyPVALID}, // LATIN SMALL LETTER A WITH STROKE..LATIN SMAL + {0x2C67, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER H WITH DESCENDER + {0x2C68, 0x0, propertyPVALID}, // LATIN SMALL LETTER H WITH DESCENDER + {0x2C69, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER K WITH DESCENDER + {0x2C6A, 0x0, propertyPVALID}, // LATIN SMALL LETTER K WITH DESCENDER + {0x2C6B, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Z WITH DESCENDER + {0x2C6C, 0x0, propertyPVALID}, // LATIN SMALL LETTER Z WITH DESCENDER + {0x2C6D, 0x2C70, propertyDISALLOWED}, // LATIN CAPITAL LETTER ALPHA..LATIN CAPITAL LE + {0x2C71, 0x0, propertyPVALID}, // LATIN SMALL LETTER V WITH RIGHT HOOK + {0x2C72, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER W WITH HOOK + {0x2C73, 0x2C74, propertyPVALID}, // LATIN SMALL LETTER W WITH HOOK..LATIN SMALL + {0x2C75, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER HALF H + {0x2C76, 0x2C7B, propertyPVALID}, // LATIN SMALL LETTER HALF H..LATIN LETTER SMAL + {0x2C7C, 0x2C80, propertyDISALLOWED}, // LATIN SUBSCRIPT SMALL LETTER J..COPTIC CAPIT + {0x2C81, 0x0, propertyPVALID}, // COPTIC SMALL LETTER ALFA + {0x2C82, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER VIDA + {0x2C83, 0x0, propertyPVALID}, // COPTIC SMALL LETTER VIDA + {0x2C84, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER GAMMA + {0x2C85, 0x0, propertyPVALID}, // COPTIC SMALL LETTER GAMMA + {0x2C86, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER DALDA + {0x2C87, 0x0, propertyPVALID}, // COPTIC SMALL LETTER DALDA + {0x2C88, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER EIE + {0x2C89, 0x0, propertyPVALID}, // COPTIC SMALL LETTER EIE + {0x2C8A, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER SOU + {0x2C8B, 0x0, propertyPVALID}, // COPTIC SMALL LETTER SOU + {0x2C8C, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER ZATA + {0x2C8D, 0x0, propertyPVALID}, // COPTIC SMALL LETTER ZATA + {0x2C8E, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER HATE + {0x2C8F, 0x0, propertyPVALID}, // COPTIC SMALL LETTER HATE + {0x2C90, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER THETHE + {0x2C91, 0x0, propertyPVALID}, // COPTIC SMALL LETTER THETHE + {0x2C92, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER IAUDA + {0x2C93, 0x0, propertyPVALID}, // COPTIC SMALL LETTER IAUDA + {0x2C94, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER KAPA + {0x2C95, 0x0, propertyPVALID}, // COPTIC SMALL LETTER KAPA + {0x2C96, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER LAULA + {0x2C97, 0x0, propertyPVALID}, // COPTIC SMALL LETTER LAULA + {0x2C98, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER MI + {0x2C99, 0x0, propertyPVALID}, // COPTIC SMALL LETTER MI + {0x2C9A, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER NI + {0x2C9B, 0x0, propertyPVALID}, // COPTIC SMALL LETTER NI + {0x2C9C, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER KSI + {0x2C9D, 0x0, propertyPVALID}, // COPTIC SMALL LETTER KSI + {0x2C9E, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER O + {0x2C9F, 0x0, propertyPVALID}, // COPTIC SMALL LETTER O + {0x2CA0, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER PI + {0x2CA1, 0x0, propertyPVALID}, // COPTIC SMALL LETTER PI + {0x2CA2, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER RO + {0x2CA3, 0x0, propertyPVALID}, // COPTIC SMALL LETTER RO + {0x2CA4, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER SIMA + {0x2CA5, 0x0, propertyPVALID}, // COPTIC SMALL LETTER SIMA + {0x2CA6, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER TAU + {0x2CA7, 0x0, propertyPVALID}, // COPTIC SMALL LETTER TAU + {0x2CA8, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER UA + {0x2CA9, 0x0, propertyPVALID}, // COPTIC SMALL LETTER UA + {0x2CAA, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER FI + {0x2CAB, 0x0, propertyPVALID}, // COPTIC SMALL LETTER FI + {0x2CAC, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER KHI + {0x2CAD, 0x0, propertyPVALID}, // COPTIC SMALL LETTER KHI + {0x2CAE, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER PSI + {0x2CAF, 0x0, propertyPVALID}, // COPTIC SMALL LETTER PSI + {0x2CB0, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OOU + {0x2CB1, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OOU + {0x2CB2, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER DIALECT-P ALEF + {0x2CB3, 0x0, propertyPVALID}, // COPTIC SMALL LETTER DIALECT-P ALEF + {0x2CB4, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC AIN + {0x2CB5, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC AIN + {0x2CB6, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE + {0x2CB7, 0x0, propertyPVALID}, // COPTIC SMALL LETTER CRYPTOGRAMMIC EIE + {0x2CB8, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER DIALECT-P KAPA + {0x2CB9, 0x0, propertyPVALID}, // COPTIC SMALL LETTER DIALECT-P KAPA + {0x2CBA, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER DIALECT-P NI + {0x2CBB, 0x0, propertyPVALID}, // COPTIC SMALL LETTER DIALECT-P NI + {0x2CBC, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI + {0x2CBD, 0x0, propertyPVALID}, // COPTIC SMALL LETTER CRYPTOGRAMMIC NI + {0x2CBE, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC OOU + {0x2CBF, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC OOU + {0x2CC0, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER SAMPI + {0x2CC1, 0x0, propertyPVALID}, // COPTIC SMALL LETTER SAMPI + {0x2CC2, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER CROSSED SHEI + {0x2CC3, 0x0, propertyPVALID}, // COPTIC SMALL LETTER CROSSED SHEI + {0x2CC4, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC SHEI + {0x2CC5, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC SHEI + {0x2CC6, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC ESH + {0x2CC7, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC ESH + {0x2CC8, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER AKHMIMIC KHEI + {0x2CC9, 0x0, propertyPVALID}, // COPTIC SMALL LETTER AKHMIMIC KHEI + {0x2CCA, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER DIALECT-P HORI + {0x2CCB, 0x0, propertyPVALID}, // COPTIC SMALL LETTER DIALECT-P HORI + {0x2CCC, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC HORI + {0x2CCD, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC HORI + {0x2CCE, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC HA + {0x2CCF, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC HA + {0x2CD0, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER L-SHAPED HA + {0x2CD1, 0x0, propertyPVALID}, // COPTIC SMALL LETTER L-SHAPED HA + {0x2CD2, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC HEI + {0x2CD3, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC HEI + {0x2CD4, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC HAT + {0x2CD5, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC HAT + {0x2CD6, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC GANGIA + {0x2CD7, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC GANGIA + {0x2CD8, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC DJA + {0x2CD9, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC DJA + {0x2CDA, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD COPTIC SHIMA + {0x2CDB, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD COPTIC SHIMA + {0x2CDC, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD NUBIAN SHIMA + {0x2CDD, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD NUBIAN SHIMA + {0x2CDE, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD NUBIAN NGI + {0x2CDF, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD NUBIAN NGI + {0x2CE0, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD NUBIAN NYI + {0x2CE1, 0x0, propertyPVALID}, // COPTIC SMALL LETTER OLD NUBIAN NYI + {0x2CE2, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER OLD NUBIAN WAU + {0x2CE3, 0x2CE4, propertyPVALID}, // COPTIC SMALL LETTER OLD NUBIAN WAU..COPTIC S + {0x2CE5, 0x2CEB, propertyDISALLOWED}, // COPTIC SYMBOL MI RO..COPTIC CAPITAL LETTER C + {0x2CEC, 0x0, propertyPVALID}, // COPTIC SMALL LETTER CRYPTOGRAMMIC SHEI + {0x2CED, 0x0, propertyDISALLOWED}, // COPTIC CAPITAL LETTER CRYPTOGRAMMIC GANGIA + {0x2CEE, 0x2CF1, propertyPVALID}, // COPTIC SMALL LETTER CRYPTOGRAMMIC GANGIA..CO + {0x2CF2, 0x2CF8, propertyUNASSIGNED}, // .. + {0x2CF9, 0x2CFF, propertyDISALLOWED}, // COPTIC OLD NUBIAN FULL STOP..COPTIC MORPHOLO + {0x2D00, 0x2D25, propertyPVALID}, // GEORGIAN SMALL LETTER AN..GEORGIAN SMALL LET + {0x2D26, 0x2D2F, propertyUNASSIGNED}, // .. + {0x2D30, 0x2D65, propertyPVALID}, // TIFINAGH LETTER YA..TIFINAGH LETTER YAZZ + {0x2D66, 0x2D6E, propertyUNASSIGNED}, // .. + {0x2D6F, 0x0, propertyDISALLOWED}, // TIFINAGH MODIFIER LETTER LABIALIZATION MARK + {0x2D70, 0x2D7F, propertyUNASSIGNED}, // .. + {0x2D80, 0x2D96, propertyPVALID}, // ETHIOPIC SYLLABLE LOA..ETHIOPIC SYLLABLE GGW + {0x2D97, 0x2D9F, propertyUNASSIGNED}, // .. + {0x2DA0, 0x2DA6, propertyPVALID}, // ETHIOPIC SYLLABLE SSA..ETHIOPIC SYLLABLE SSO + {0x2DA7, 0x0, propertyUNASSIGNED}, // + {0x2DA8, 0x2DAE, propertyPVALID}, // ETHIOPIC SYLLABLE CCA..ETHIOPIC SYLLABLE CCO + {0x2DAF, 0x0, propertyUNASSIGNED}, // + {0x2DB0, 0x2DB6, propertyPVALID}, // ETHIOPIC SYLLABLE ZZA..ETHIOPIC SYLLABLE ZZO + {0x2DB7, 0x0, propertyUNASSIGNED}, // + {0x2DB8, 0x2DBE, propertyPVALID}, // ETHIOPIC SYLLABLE CCHA..ETHIOPIC SYLLABLE CC + {0x2DBF, 0x0, propertyUNASSIGNED}, // + {0x2DC0, 0x2DC6, propertyPVALID}, // ETHIOPIC SYLLABLE QYA..ETHIOPIC SYLLABLE QYO + {0x2DC7, 0x0, propertyUNASSIGNED}, // + {0x2DC8, 0x2DCE, propertyPVALID}, // ETHIOPIC SYLLABLE KYA..ETHIOPIC SYLLABLE KYO + {0x2DCF, 0x0, propertyUNASSIGNED}, // + {0x2DD0, 0x2DD6, propertyPVALID}, // ETHIOPIC SYLLABLE XYA..ETHIOPIC SYLLABLE XYO + {0x2DD7, 0x0, propertyUNASSIGNED}, // + {0x2DD8, 0x2DDE, propertyPVALID}, // ETHIOPIC SYLLABLE GYA..ETHIOPIC SYLLABLE GYO + {0x2DDF, 0x0, propertyUNASSIGNED}, // + {0x2DE0, 0x2DFF, propertyPVALID}, // COMBINING CYRILLIC LETTER BE..COMBINING CYRI + {0x2E00, 0x2E2E, propertyDISALLOWED}, // RIGHT ANGLE SUBSTITUTION MARKER..REVERSED QU + {0x2E2F, 0x0, propertyPVALID}, // VERTICAL TILDE + {0x2E30, 0x2E31, propertyDISALLOWED}, // RING POINT..WORD SEPARATOR MIDDLE DOT + {0x2E32, 0x2E7F, propertyUNASSIGNED}, // .. + {0x2E80, 0x2E99, propertyDISALLOWED}, // CJK RADICAL REPEAT..CJK RADICAL RAP + {0x2E9A, 0x0, propertyUNASSIGNED}, // + {0x2E9B, 0x2EF3, propertyDISALLOWED}, // CJK RADICAL CHOKE..CJK RADICAL C-SIMPLIFIED + {0x2EF4, 0x2EFF, propertyUNASSIGNED}, // .. + {0x2F00, 0x2FD5, propertyDISALLOWED}, // KANGXI RADICAL ONE..KANGXI RADICAL FLUTE + {0x2FD6, 0x2FEF, propertyUNASSIGNED}, // .. + {0x2FF0, 0x2FFB, propertyDISALLOWED}, // IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RI + {0x2FFC, 0x2FFF, propertyUNASSIGNED}, // .. + {0x3000, 0x3004, propertyDISALLOWED}, // IDEOGRAPHIC SPACE..JAPANESE INDUSTRIAL STAND + {0x3005, 0x3007, propertyPVALID}, // IDEOGRAPHIC ITERATION MARK..IDEOGRAPHIC NUMB + {0x3008, 0x3029, propertyDISALLOWED}, // LEFT ANGLE BRACKET..HANGZHOU NUMERAL NINE + {0x302A, 0x302D, propertyPVALID}, // IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENT + {0x302E, 0x303B, propertyDISALLOWED}, // HANGUL SINGLE DOT TONE MARK..VERTICAL IDEOGR + {0x303C, 0x0, propertyPVALID}, // MASU MARK + {0x303D, 0x303F, propertyDISALLOWED}, // PART ALTERNATION MARK..IDEOGRAPHIC HALF FILL + {0x3040, 0x0, propertyUNASSIGNED}, // + {0x3041, 0x3096, propertyPVALID}, // HIRAGANA LETTER SMALL A..HIRAGANA LETTER SMA + {0x3097, 0x3098, propertyUNASSIGNED}, // .. + {0x3099, 0x309A, propertyPVALID}, // COMBINING KATAKANA-HIRAGANA VOICED SOUND MAR + {0x309B, 0x309C, propertyDISALLOWED}, // KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKAN + {0x309D, 0x309E, propertyPVALID}, // HIRAGANA ITERATION MARK..HIRAGANA VOICED ITE + {0x309F, 0x30A0, propertyDISALLOWED}, // HIRAGANA DIGRAPH YORI..KATAKANA-HIRAGANA DOU + {0x30A1, 0x30FA, propertyPVALID}, // KATAKANA LETTER SMALL A..KATAKANA LETTER VO + {0x30FB, 0x0, propertyCONTEXTO}, // KATAKANA MIDDLE DOT + {0x30FC, 0x30FE, propertyPVALID}, // KATAKANA-HIRAGANA PROLONGED SOUND MARK..KATA + {0x30FF, 0x0, propertyDISALLOWED}, // KATAKANA DIGRAPH KOTO + {0x3100, 0x3104, propertyUNASSIGNED}, // .. + {0x3105, 0x312D, propertyPVALID}, // BOPOMOFO LETTER B..BOPOMOFO LETTER IH + {0x312E, 0x3130, propertyUNASSIGNED}, // .. + {0x3131, 0x318E, propertyDISALLOWED}, // HANGUL LETTER KIYEOK..HANGUL LETTER ARAEAE + {0x318F, 0x0, propertyUNASSIGNED}, // + {0x3190, 0x319F, propertyDISALLOWED}, // IDEOGRAPHIC ANNOTATION LINKING MARK..IDEOGRA + {0x31A0, 0x31B7, propertyPVALID}, // BOPOMOFO LETTER BU..BOPOMOFO FINAL LETTER H + {0x31B8, 0x31BF, propertyUNASSIGNED}, // .. + {0x31C0, 0x31E3, propertyDISALLOWED}, // CJK STROKE T..CJK STROKE Q + {0x31E4, 0x31EF, propertyUNASSIGNED}, // .. + {0x31F0, 0x31FF, propertyPVALID}, // KATAKANA LETTER SMALL KU..KATAKANA LETTER SM + {0x3200, 0x321E, propertyDISALLOWED}, // PARENTHESIZED HANGUL KIYEOK..PARENTHESIZED K + {0x321F, 0x0, propertyUNASSIGNED}, // + {0x3220, 0x32FE, propertyDISALLOWED}, // PARENTHESIZED IDEOGRAPH ONE..CIRCLED KATAKAN + {0x32FF, 0x0, propertyUNASSIGNED}, // + {0x3300, 0x33FF, propertyDISALLOWED}, // SQUARE APAATO..SQUARE GAL + {0x3400, 0x4DB5, propertyPVALID}, // .... + {0x4DC0, 0x4DFF, propertyDISALLOWED}, // HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM F + {0x4E00, 0x9FCB, propertyPVALID}, // .. + {0x9FCC, 0x9FFF, propertyUNASSIGNED}, // .. + {0xA000, 0xA48C, propertyPVALID}, // YI SYLLABLE IT..YI SYLLABLE YYR + {0xA48D, 0xA48F, propertyUNASSIGNED}, // .. + {0xA490, 0xA4C6, propertyDISALLOWED}, // YI RADICAL QOT..YI RADICAL KE + {0xA4C7, 0xA4CF, propertyUNASSIGNED}, // .. + {0xA4D0, 0xA4FD, propertyPVALID}, // LISU LETTER BA..LISU LETTER TONE MYA JEU + {0xA4FE, 0xA4FF, propertyDISALLOWED}, // LISU PUNCTUATION COMMA..LISU PUNCTUATION FUL + {0xA500, 0xA60C, propertyPVALID}, // VAI SYLLABLE EE..VAI SYLLABLE LENGTHENER + {0xA60D, 0xA60F, propertyDISALLOWED}, // VAI COMMA..VAI QUESTION MARK + {0xA610, 0xA62B, propertyPVALID}, // VAI SYLLABLE NDOLE FA..VAI SYLLABLE NDOLE DO + {0xA62C, 0xA63F, propertyUNASSIGNED}, // .. + {0xA640, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ZEMLYA + {0xA641, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ZEMLYA + {0xA642, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER DZELO + {0xA643, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER DZELO + {0xA644, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER REVERSED DZE + {0xA645, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER REVERSED DZE + {0xA646, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IOTA + {0xA647, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IOTA + {0xA648, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER DJERV + {0xA649, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER DJERV + {0xA64A, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER MONOGRAPH UK + {0xA64B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER MONOGRAPH UK + {0xA64C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER BROAD OMEGA + {0xA64D, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER BROAD OMEGA + {0xA64E, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER NEUTRAL YER + {0xA64F, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER NEUTRAL YER + {0xA650, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER YERU WITH BACK YER + {0xA651, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER YERU WITH BACK YER + {0xA652, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IOTIFIED YAT + {0xA653, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IOTIFIED YAT + {0xA654, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER REVERSED YU + {0xA655, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER REVERSED YU + {0xA656, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IOTIFIED A + {0xA657, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IOTIFIED A + {0xA658, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER CLOSED LITTLE YUS + {0xA659, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER CLOSED LITTLE YUS + {0xA65A, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER BLENDED YUS + {0xA65B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER BLENDED YUS + {0xA65C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER IOTIFIED CLOSED LITT + {0xA65D, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER IOTIFIED CLOSED LITTLE + {0xA65E, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER YN + {0xA65F, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER YN + {0xA660, 0xA661, propertyUNASSIGNED}, // .. + {0xA662, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER SOFT DE + {0xA663, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER SOFT DE + {0xA664, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER SOFT EL + {0xA665, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER SOFT EL + {0xA666, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER SOFT EM + {0xA667, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER SOFT EM + {0xA668, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER MONOCULAR O + {0xA669, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER MONOCULAR O + {0xA66A, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER BINOCULAR O + {0xA66B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER BINOCULAR O + {0xA66C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER DOUBLE MONOCULAR O + {0xA66D, 0xA66F, propertyPVALID}, // CYRILLIC SMALL LETTER DOUBLE MONOCULAR O..CO + {0xA670, 0xA673, propertyDISALLOWED}, // COMBINING CYRILLIC TEN MILLIONS SIGN..SLAVON + {0xA674, 0xA67B, propertyUNASSIGNED}, // .. + {0xA67C, 0xA67D, propertyPVALID}, // COMBINING CYRILLIC KAVYKA..COMBINING CYRILLI + {0xA67E, 0x0, propertyDISALLOWED}, // CYRILLIC KAVYKA + {0xA67F, 0x0, propertyPVALID}, // CYRILLIC PAYEROK + {0xA680, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER DWE + {0xA681, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER DWE + {0xA682, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER DZWE + {0xA683, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER DZWE + {0xA684, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER ZHWE + {0xA685, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER ZHWE + {0xA686, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER CCHE + {0xA687, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER CCHE + {0xA688, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER DZZE + {0xA689, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER DZZE + {0xA68A, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER TE WITH MIDDLE HOOK + {0xA68B, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER TE WITH MIDDLE HOOK + {0xA68C, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER TWE + {0xA68D, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER TWE + {0xA68E, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER TSWE + {0xA68F, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER TSWE + {0xA690, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER TSSE + {0xA691, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER TSSE + {0xA692, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER TCHE + {0xA693, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER TCHE + {0xA694, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER HWE + {0xA695, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER HWE + {0xA696, 0x0, propertyDISALLOWED}, // CYRILLIC CAPITAL LETTER SHWE + {0xA697, 0x0, propertyPVALID}, // CYRILLIC SMALL LETTER SHWE + {0xA698, 0xA69F, propertyUNASSIGNED}, // .. + {0xA6A0, 0xA6E5, propertyPVALID}, // BAMUM LETTER A..BAMUM LETTER KI + {0xA6E6, 0xA6EF, propertyDISALLOWED}, // BAMUM LETTER MO..BAMUM LETTER KOGHOM + {0xA6F0, 0xA6F1, propertyPVALID}, // BAMUM COMBINING MARK KOQNDON..BAMUM COMBININ + {0xA6F2, 0xA6F7, propertyDISALLOWED}, // BAMUM NJAEMLI..BAMUM QUESTION MARK + {0xA6F8, 0xA6FF, propertyUNASSIGNED}, // .. + {0xA700, 0xA716, propertyDISALLOWED}, // MODIFIER LETTER CHINESE TONE YIN PING..MODIF + {0xA717, 0xA71F, propertyPVALID}, // MODIFIER LETTER DOT VERTICAL BAR..MODIFIER L + {0xA720, 0xA722, propertyDISALLOWED}, // MODIFIER LETTER STRESS AND HIGH TONE..LATIN + {0xA723, 0x0, propertyPVALID}, // LATIN SMALL LETTER EGYPTOLOGICAL ALEF + {0xA724, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER EGYPTOLOGICAL AIN + {0xA725, 0x0, propertyPVALID}, // LATIN SMALL LETTER EGYPTOLOGICAL AIN + {0xA726, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER HENG + {0xA727, 0x0, propertyPVALID}, // LATIN SMALL LETTER HENG + {0xA728, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER TZ + {0xA729, 0x0, propertyPVALID}, // LATIN SMALL LETTER TZ + {0xA72A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER TRESILLO + {0xA72B, 0x0, propertyPVALID}, // LATIN SMALL LETTER TRESILLO + {0xA72C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER CUATRILLO + {0xA72D, 0x0, propertyPVALID}, // LATIN SMALL LETTER CUATRILLO + {0xA72E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER CUATRILLO WITH COMMA + {0xA72F, 0xA731, propertyPVALID}, // LATIN SMALL LETTER CUATRILLO WITH COMMA..LAT + {0xA732, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER AA + {0xA733, 0x0, propertyPVALID}, // LATIN SMALL LETTER AA + {0xA734, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER AO + {0xA735, 0x0, propertyPVALID}, // LATIN SMALL LETTER AO + {0xA736, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER AU + {0xA737, 0x0, propertyPVALID}, // LATIN SMALL LETTER AU + {0xA738, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER AV + {0xA739, 0x0, propertyPVALID}, // LATIN SMALL LETTER AV + {0xA73A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR + {0xA73B, 0x0, propertyPVALID}, // LATIN SMALL LETTER AV WITH HORIZONTAL BAR + {0xA73C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER AY + {0xA73D, 0x0, propertyPVALID}, // LATIN SMALL LETTER AY + {0xA73E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER REVERSED C WITH DOT + {0xA73F, 0x0, propertyPVALID}, // LATIN SMALL LETTER REVERSED C WITH DOT + {0xA740, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER K WITH STROKE + {0xA741, 0x0, propertyPVALID}, // LATIN SMALL LETTER K WITH STROKE + {0xA742, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER K WITH DIAGONAL STROKE + {0xA743, 0x0, propertyPVALID}, // LATIN SMALL LETTER K WITH DIAGONAL STROKE + {0xA744, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER K WITH STROKE AND DIAGO + {0xA745, 0x0, propertyPVALID}, // LATIN SMALL LETTER K WITH STROKE AND DIAGONA + {0xA746, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER BROKEN L + {0xA747, 0x0, propertyPVALID}, // LATIN SMALL LETTER BROKEN L + {0xA748, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER L WITH HIGH STROKE + {0xA749, 0x0, propertyPVALID}, // LATIN SMALL LETTER L WITH HIGH STROKE + {0xA74A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH LONG STROKE OVER + {0xA74B, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH LONG STROKE OVERLA + {0xA74C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER O WITH LOOP + {0xA74D, 0x0, propertyPVALID}, // LATIN SMALL LETTER O WITH LOOP + {0xA74E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER OO + {0xA74F, 0x0, propertyPVALID}, // LATIN SMALL LETTER OO + {0xA750, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER P WITH STROKE THROUGH D + {0xA751, 0x0, propertyPVALID}, // LATIN SMALL LETTER P WITH STROKE THROUGH DES + {0xA752, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER P WITH FLOURISH + {0xA753, 0x0, propertyPVALID}, // LATIN SMALL LETTER P WITH FLOURISH + {0xA754, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER P WITH SQUIRREL TAIL + {0xA755, 0x0, propertyPVALID}, // LATIN SMALL LETTER P WITH SQUIRREL TAIL + {0xA756, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Q WITH STROKE THROUGH D + {0xA757, 0x0, propertyPVALID}, // LATIN SMALL LETTER Q WITH STROKE THROUGH DES + {0xA758, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE + {0xA759, 0x0, propertyPVALID}, // LATIN SMALL LETTER Q WITH DIAGONAL STROKE + {0xA75A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER R ROTUNDA + {0xA75B, 0x0, propertyPVALID}, // LATIN SMALL LETTER R ROTUNDA + {0xA75C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER RUM ROTUNDA + {0xA75D, 0x0, propertyPVALID}, // LATIN SMALL LETTER RUM ROTUNDA + {0xA75E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER V WITH DIAGONAL STROKE + {0xA75F, 0x0, propertyPVALID}, // LATIN SMALL LETTER V WITH DIAGONAL STROKE + {0xA760, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER VY + {0xA761, 0x0, propertyPVALID}, // LATIN SMALL LETTER VY + {0xA762, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER VISIGOTHIC Z + {0xA763, 0x0, propertyPVALID}, // LATIN SMALL LETTER VISIGOTHIC Z + {0xA764, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER THORN WITH STROKE + {0xA765, 0x0, propertyPVALID}, // LATIN SMALL LETTER THORN WITH STROKE + {0xA766, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER THORN WITH STROKE THROU + {0xA767, 0x0, propertyPVALID}, // LATIN SMALL LETTER THORN WITH STROKE THROUGH + {0xA768, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER VEND + {0xA769, 0x0, propertyPVALID}, // LATIN SMALL LETTER VEND + {0xA76A, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER ET + {0xA76B, 0x0, propertyPVALID}, // LATIN SMALL LETTER ET + {0xA76C, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER IS + {0xA76D, 0x0, propertyPVALID}, // LATIN SMALL LETTER IS + {0xA76E, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER CON + {0xA76F, 0x0, propertyPVALID}, // LATIN SMALL LETTER CON + {0xA770, 0x0, propertyDISALLOWED}, // MODIFIER LETTER US + {0xA771, 0xA778, propertyPVALID}, // LATIN SMALL LETTER DUM..LATIN SMALL LETTER U + {0xA779, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER INSULAR D + {0xA77A, 0x0, propertyPVALID}, // LATIN SMALL LETTER INSULAR D + {0xA77B, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER INSULAR F + {0xA77C, 0x0, propertyPVALID}, // LATIN SMALL LETTER INSULAR F + {0xA77D, 0xA77E, propertyDISALLOWED}, // LATIN CAPITAL LETTER INSULAR G..LATIN CAPITA + {0xA77F, 0x0, propertyPVALID}, // LATIN SMALL LETTER TURNED INSULAR G + {0xA780, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER TURNED L + {0xA781, 0x0, propertyPVALID}, // LATIN SMALL LETTER TURNED L + {0xA782, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER INSULAR R + {0xA783, 0x0, propertyPVALID}, // LATIN SMALL LETTER INSULAR R + {0xA784, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER INSULAR S + {0xA785, 0x0, propertyPVALID}, // LATIN SMALL LETTER INSULAR S + {0xA786, 0x0, propertyDISALLOWED}, // LATIN CAPITAL LETTER INSULAR T + {0xA787, 0xA788, propertyPVALID}, // LATIN SMALL LETTER INSULAR T..MODIFIER LETTE + {0xA789, 0xA78B, propertyDISALLOWED}, // MODIFIER LETTER COLON..LATIN CAPITAL LETTER + {0xA78C, 0x0, propertyPVALID}, // LATIN SMALL LETTER SALTILLO + {0xA78D, 0xA7FA, propertyUNASSIGNED}, // .. + {0xA7FB, 0xA827, propertyPVALID}, // LATIN EPIGRAPHIC LETTER REVERSED F..SYLOTI N + {0xA828, 0xA82B, propertyDISALLOWED}, // SYLOTI NAGRI POETRY MARK-1..SYLOTI NAGRI POE + {0xA82C, 0xA82F, propertyUNASSIGNED}, // .. + {0xA830, 0xA839, propertyDISALLOWED}, // NORTH INDIC FRACTION ONE QUARTER..NORTH INDI + {0xA83A, 0xA83F, propertyUNASSIGNED}, // .. + {0xA840, 0xA873, propertyPVALID}, // PHAGS-PA LETTER KA..PHAGS-PA LETTER CANDRABI + {0xA874, 0xA877, propertyDISALLOWED}, // PHAGS-PA SINGLE HEAD MARK..PHAGS-PA MARK DOU + {0xA878, 0xA87F, propertyUNASSIGNED}, // .. + {0xA880, 0xA8C4, propertyPVALID}, // SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VI + {0xA8C5, 0xA8CD, propertyUNASSIGNED}, // .. + {0xA8CE, 0xA8CF, propertyDISALLOWED}, // SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA + {0xA8D0, 0xA8D9, propertyPVALID}, // SAURASHTRA DIGIT ZERO..SAURASHTRA DIGIT NINE + {0xA8DA, 0xA8DF, propertyUNASSIGNED}, // .. + {0xA8E0, 0xA8F7, propertyPVALID}, // COMBINING DEVANAGARI DIGIT ZERO..DEVANAGARI + {0xA8F8, 0xA8FA, propertyDISALLOWED}, // DEVANAGARI SIGN PUSHPIKA..DEVANAGARI CARET + {0xA8FB, 0x0, propertyPVALID}, // DEVANAGARI HEADSTROKE + {0xA8FC, 0xA8FF, propertyUNASSIGNED}, // .. + {0xA900, 0xA92D, propertyPVALID}, // KAYAH LI DIGIT ZERO..KAYAH LI TONE CALYA PLO + {0xA92E, 0xA92F, propertyDISALLOWED}, // KAYAH LI SIGN CWI..KAYAH LI SIGN SHYA + {0xA930, 0xA953, propertyPVALID}, // REJANG LETTER KA..REJANG VIRAMA + {0xA954, 0xA95E, propertyUNASSIGNED}, // .. + {0xA95F, 0xA97C, propertyDISALLOWED}, // REJANG SECTION MARK..HANGUL CHOSEONG SSANGYE + {0xA97D, 0xA97F, propertyUNASSIGNED}, // .. + {0xA980, 0xA9C0, propertyPVALID}, // JAVANESE SIGN PANYANGGA..JAVANESE PANGKON + {0xA9C1, 0xA9CD, propertyDISALLOWED}, // JAVANESE LEFT RERENGGAN..JAVANESE TURNED PAD + {0xA9CE, 0x0, propertyUNASSIGNED}, // + {0xA9CF, 0xA9D9, propertyPVALID}, // JAVANESE PANGRANGKEP..JAVANESE DIGIT NINE + {0xA9DA, 0xA9DD, propertyUNASSIGNED}, // .. + {0xA9DE, 0xA9DF, propertyDISALLOWED}, // JAVANESE PADA TIRTA TUMETES..JAVANESE PADA I + {0xA9E0, 0xA9FF, propertyUNASSIGNED}, // .. + {0xAA00, 0xAA36, propertyPVALID}, // CHAM LETTER A..CHAM CONSONANT SIGN WA + {0xAA37, 0xAA3F, propertyUNASSIGNED}, // .. + {0xAA40, 0xAA4D, propertyPVALID}, // CHAM LETTER FINAL K..CHAM CONSONANT SIGN FIN + {0xAA4E, 0xAA4F, propertyUNASSIGNED}, // .. + {0xAA50, 0xAA59, propertyPVALID}, // CHAM DIGIT ZERO..CHAM DIGIT NINE + {0xAA5A, 0xAA5B, propertyUNASSIGNED}, // .. + {0xAA5C, 0xAA5F, propertyDISALLOWED}, // CHAM PUNCTUATION SPIRAL..CHAM PUNCTUATION TR + {0xAA60, 0xAA76, propertyPVALID}, // MYANMAR LETTER KHAMTI GA..MYANMAR LOGOGRAM K + {0xAA77, 0xAA79, propertyDISALLOWED}, // MYANMAR SYMBOL AITON EXCLAMATION..MYANMAR SY + {0xAA7A, 0xAA7B, propertyPVALID}, // MYANMAR LETTER AITON RA..MYANMAR SIGN PAO KA + {0xAA7C, 0xAA7F, propertyUNASSIGNED}, // .. + {0xAA80, 0xAAC2, propertyPVALID}, // TAI VIET LETTER LOW KO..TAI VIET TONE MAI SO + {0xAAC3, 0xAADA, propertyUNASSIGNED}, // .. + {0xAADB, 0xAADD, propertyPVALID}, // TAI VIET SYMBOL KON..TAI VIET SYMBOL SAM + {0xAADE, 0xAADF, propertyDISALLOWED}, // TAI VIET SYMBOL HO HOI..TAI VIET SYMBOL KOI + {0xAAE0, 0xABBF, propertyUNASSIGNED}, // .. + {0xABC0, 0xABEA, propertyPVALID}, // MEETEI MAYEK LETTER KOK..MEETEI MAYEK VOWEL + {0xABEB, 0x0, propertyDISALLOWED}, // MEETEI MAYEK CHEIKHEI + {0xABEC, 0xABED, propertyPVALID}, // MEETEI MAYEK LUM IYEK..MEETEI MAYEK APUN IYE + {0xABEE, 0xABEF, propertyUNASSIGNED}, // .. + {0xABF0, 0xABF9, propertyPVALID}, // MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DIGIT + {0xABFA, 0xABFF, propertyUNASSIGNED}, // .. + {0xAC00, 0xD7A3, propertyPVALID}, // .. + {0xD7A4, 0xD7AF, propertyUNASSIGNED}, // .. + {0xD7B0, 0xD7C6, propertyDISALLOWED}, // HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARA + {0xD7C7, 0xD7CA, propertyUNASSIGNED}, // .. + {0xD7CB, 0xD7FB, propertyDISALLOWED}, // HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEO + {0xD7FC, 0xD7FF, propertyUNASSIGNED}, // .. + {0xD800, 0xFA0D, propertyDISALLOWED}, // ..CJK COMPAT + {0xFA0E, 0xFA0F, propertyPVALID}, // CJK COMPATIBILITY IDEOGRAPH-FA0E..CJK COMPAT + {0xFA10, 0x0, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-FA10 + {0xFA11, 0x0, propertyPVALID}, // CJK COMPATIBILITY IDEOGRAPH-FA11 + {0xFA12, 0x0, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-FA12 + {0xFA13, 0xFA14, propertyPVALID}, // CJK COMPATIBILITY IDEOGRAPH-FA13..CJK COMPAT + {0xFA15, 0xFA1E, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-FA15..CJK COMPAT + {0xFA1F, 0x0, propertyPVALID}, // CJK COMPATIBILITY IDEOGRAPH-FA1F + {0xFA20, 0x0, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-FA20 + {0xFA21, 0x0, propertyPVALID}, // CJK COMPATIBILITY IDEOGRAPH-FA21 + {0xFA22, 0x0, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-FA22 + {0xFA23, 0xFA24, propertyPVALID}, // CJK COMPATIBILITY IDEOGRAPH-FA23..CJK COMPAT + {0xFA25, 0xFA26, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-FA25..CJK COMPAT + {0xFA27, 0xFA29, propertyPVALID}, // CJK COMPATIBILITY IDEOGRAPH-FA27..CJK COMPAT + {0xFA2A, 0xFA2D, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-FA2A..CJK COMPAT + {0xFA2E, 0xFA2F, propertyUNASSIGNED}, // .. + {0xFA30, 0xFA6D, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-FA30..CJK COMPAT + {0xFA6E, 0xFA6F, propertyUNASSIGNED}, // .. + {0xFA70, 0xFAD9, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPAT + {0xFADA, 0xFAFF, propertyUNASSIGNED}, // .. + {0xFB00, 0xFB06, propertyDISALLOWED}, // LATIN SMALL LIGATURE FF..LATIN SMALL LIGATUR + {0xFB07, 0xFB12, propertyUNASSIGNED}, // .. + {0xFB13, 0xFB17, propertyDISALLOWED}, // ARMENIAN SMALL LIGATURE MEN NOW..ARMENIAN SM + {0xFB18, 0xFB1C, propertyUNASSIGNED}, // .. + {0xFB1D, 0x0, propertyDISALLOWED}, // HEBREW LETTER YOD WITH HIRIQ + {0xFB1E, 0x0, propertyPVALID}, // HEBREW POINT JUDEO-SPANISH VARIKA + {0xFB1F, 0xFB36, propertyDISALLOWED}, // HEBREW LIGATURE YIDDISH YOD YOD PATAH..HEBRE + {0xFB37, 0x0, propertyUNASSIGNED}, // + {0xFB38, 0xFB3C, propertyDISALLOWED}, // HEBREW LETTER TET WITH DAGESH..HEBREW LETTER + {0xFB3D, 0x0, propertyUNASSIGNED}, // + {0xFB3E, 0x0, propertyDISALLOWED}, // HEBREW LETTER MEM WITH DAGESH + {0xFB3F, 0x0, propertyUNASSIGNED}, // + {0xFB40, 0xFB41, propertyDISALLOWED}, // HEBREW LETTER NUN WITH DAGESH..HEBREW LETTER + {0xFB42, 0x0, propertyUNASSIGNED}, // + {0xFB43, 0xFB44, propertyDISALLOWED}, // HEBREW LETTER FINAL PE WITH DAGESH..HEBREW L + {0xFB45, 0x0, propertyUNASSIGNED}, // + {0xFB46, 0xFBB1, propertyDISALLOWED}, // HEBREW LETTER TSADI WITH DAGESH..ARABIC LETT + {0xFBB2, 0xFBD2, propertyUNASSIGNED}, // .. + {0xFBD3, 0xFD3F, propertyDISALLOWED}, // ARABIC LETTER NG ISOLATED FORM..ORNATE RIGHT + {0xFD40, 0xFD4F, propertyUNASSIGNED}, // .. + {0xFD50, 0xFD8F, propertyDISALLOWED}, // ARABIC LIGATURE TEH WITH JEEM WITH MEEM INIT + {0xFD90, 0xFD91, propertyUNASSIGNED}, // .. + {0xFD92, 0xFDC7, propertyDISALLOWED}, // ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INI + {0xFDC8, 0xFDCF, propertyUNASSIGNED}, // .. + {0xFDD0, 0xFDFD, propertyDISALLOWED}, // ..ARABIC LIGATURE BISMILLAH AR + {0xFDFE, 0xFDFF, propertyUNASSIGNED}, // .. + {0xFE00, 0xFE19, propertyDISALLOWED}, // VARIATION SELECTOR-1..PRESENTATION FORM FOR + {0xFE1A, 0xFE1F, propertyUNASSIGNED}, // .. + {0xFE20, 0xFE26, propertyPVALID}, // COMBINING LIGATURE LEFT HALF..COMBINING CONJ + {0xFE27, 0xFE2F, propertyUNASSIGNED}, // .. + {0xFE30, 0xFE52, propertyDISALLOWED}, // PRESENTATION FORM FOR VERTICAL TWO DOT LEADE + {0xFE53, 0x0, propertyUNASSIGNED}, // + {0xFE54, 0xFE66, propertyDISALLOWED}, // SMALL SEMICOLON..SMALL EQUALS SIGN + {0xFE67, 0x0, propertyUNASSIGNED}, // + {0xFE68, 0xFE6B, propertyDISALLOWED}, // SMALL REVERSE SOLIDUS..SMALL COMMERCIAL AT + {0xFE6C, 0xFE6F, propertyUNASSIGNED}, // .. + {0xFE70, 0xFE72, propertyDISALLOWED}, // ARABIC FATHATAN ISOLATED FORM..ARABIC DAMMAT + {0xFE73, 0x0, propertyPVALID}, // ARABIC TAIL FRAGMENT + {0xFE74, 0x0, propertyDISALLOWED}, // ARABIC KASRATAN ISOLATED FORM + {0xFE75, 0x0, propertyUNASSIGNED}, // + {0xFE76, 0xFEFC, propertyDISALLOWED}, // ARABIC FATHA ISOLATED FORM..ARABIC LIGATURE + {0xFEFD, 0xFEFE, propertyUNASSIGNED}, // .. + {0xFEFF, 0x0, propertyDISALLOWED}, // ZERO WIDTH NO-BREAK SPACE + {0xFF00, 0x0, propertyUNASSIGNED}, // + {0xFF01, 0xFFBE, propertyDISALLOWED}, // FULLWIDTH EXCLAMATION MARK..HALFWIDTH HANGUL + {0xFFBF, 0xFFC1, propertyUNASSIGNED}, // .. + {0xFFC2, 0xFFC7, propertyDISALLOWED}, // HALFWIDTH HANGUL LETTER A..HALFWIDTH HANGUL + {0xFFC8, 0xFFC9, propertyUNASSIGNED}, // .. + {0xFFCA, 0xFFCF, propertyDISALLOWED}, // HALFWIDTH HANGUL LETTER YEO..HALFWIDTH HANGU + {0xFFD0, 0xFFD1, propertyUNASSIGNED}, // .. + {0xFFD2, 0xFFD7, propertyDISALLOWED}, // HALFWIDTH HANGUL LETTER YO..HALFWIDTH HANGUL + {0xFFD8, 0xFFD9, propertyUNASSIGNED}, // .. + {0xFFDA, 0xFFDC, propertyDISALLOWED}, // HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL + {0xFFDD, 0xFFDF, propertyUNASSIGNED}, // .. + {0xFFE0, 0xFFE6, propertyDISALLOWED}, // FULLWIDTH CENT SIGN..FULLWIDTH WON SIGN + {0xFFE7, 0x0, propertyUNASSIGNED}, // + {0xFFE8, 0xFFEE, propertyDISALLOWED}, // HALFWIDTH FORMS LIGHT VERTICAL..HALFWIDTH WH + {0xFFEF, 0xFFF8, propertyUNASSIGNED}, // .. + {0xFFF9, 0xFFFF, propertyDISALLOWED}, // INTERLINEAR ANNOTATION ANCHOR.. + {0x1000D, 0x10026, propertyPVALID}, // LINEAR B SYLLABLE B036 JO..LINEAR B SYLLABLE + {0x10027, 0x0, propertyUNASSIGNED}, // + {0x10028, 0x1003A, propertyPVALID}, // LINEAR B SYLLABLE B060 RA..LINEAR B SYLLABLE + {0x1003B, 0x0, propertyUNASSIGNED}, // + {0x1003C, 0x1003D, propertyPVALID}, // LINEAR B SYLLABLE B017 ZA..LINEAR B SYLLABLE + {0x1003E, 0x0, propertyUNASSIGNED}, // + {0x1003F, 0x1004D, propertyPVALID}, // LINEAR B SYLLABLE B020 ZO..LINEAR B SYLLABLE + {0x1004E, 0x1004F, propertyUNASSIGNED}, // .. + {0x10050, 0x1005D, propertyPVALID}, // LINEAR B SYMBOL B018..LINEAR B SYMBOL B089 + {0x1005E, 0x1007F, propertyUNASSIGNED}, // .. + {0x10080, 0x100FA, propertyPVALID}, // LINEAR B IDEOGRAM B100 MAN..LINEAR B IDEOGRA + {0x100FB, 0x100FF, propertyUNASSIGNED}, // .. + {0x10100, 0x10102, propertyDISALLOWED}, // AEGEAN WORD SEPARATOR LINE..AEGEAN CHECK MAR + {0x10103, 0x10106, propertyUNASSIGNED}, // .. + {0x10107, 0x10133, propertyDISALLOWED}, // AEGEAN NUMBER ONE..AEGEAN NUMBER NINETY THOU + {0x10134, 0x10136, propertyUNASSIGNED}, // .. + {0x10137, 0x1018A, propertyDISALLOWED}, // AEGEAN WEIGHT BASE UNIT..GREEK ZERO SIGN + {0x1018B, 0x1018F, propertyUNASSIGNED}, // .. + {0x10190, 0x1019B, propertyDISALLOWED}, // ROMAN SEXTANS SIGN..ROMAN CENTURIAL SIGN + {0x1019C, 0x101CF, propertyUNASSIGNED}, // .. + {0x101D0, 0x101FC, propertyDISALLOWED}, // PHAISTOS DISC SIGN PEDESTRIAN..PHAISTOS DISC + {0x101FD, 0x0, propertyPVALID}, // PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE + {0x101FE, 0x1027F, propertyUNASSIGNED}, // .. + {0x10280, 0x1029C, propertyPVALID}, // LYCIAN LETTER A..LYCIAN LETTER X + {0x1029D, 0x1029F, propertyUNASSIGNED}, // .. + {0x102A0, 0x102D0, propertyPVALID}, // CARIAN LETTER A..CARIAN LETTER UUU3 + {0x102D1, 0x102FF, propertyUNASSIGNED}, // .. + {0x10300, 0x1031E, propertyPVALID}, // OLD ITALIC LETTER A..OLD ITALIC LETTER UU + {0x1031F, 0x0, propertyUNASSIGNED}, // + {0x10320, 0x10323, propertyDISALLOWED}, // OLD ITALIC NUMERAL ONE..OLD ITALIC NUMERAL F + {0x10324, 0x1032F, propertyUNASSIGNED}, // .. + {0x10330, 0x10340, propertyPVALID}, // GOTHIC LETTER AHSA..GOTHIC LETTER PAIRTHRA + {0x10341, 0x0, propertyDISALLOWED}, // GOTHIC LETTER NINETY + {0x10342, 0x10349, propertyPVALID}, // GOTHIC LETTER RAIDA..GOTHIC LETTER OTHAL + {0x1034A, 0x0, propertyDISALLOWED}, // GOTHIC LETTER NINE HUNDRED + {0x1034B, 0x1037F, propertyUNASSIGNED}, // .. + {0x10380, 0x1039D, propertyPVALID}, // UGARITIC LETTER ALPA..UGARITIC LETTER SSU + {0x1039E, 0x0, propertyUNASSIGNED}, // + {0x1039F, 0x0, propertyDISALLOWED}, // UGARITIC WORD DIVIDER + {0x103A0, 0x103C3, propertyPVALID}, // OLD PERSIAN SIGN A..OLD PERSIAN SIGN HA + {0x103C4, 0x103C7, propertyUNASSIGNED}, // .. + {0x103C8, 0x103CF, propertyPVALID}, // OLD PERSIAN SIGN AURAMAZDAA..OLD PERSIAN SIG + {0x103D0, 0x103D5, propertyDISALLOWED}, // OLD PERSIAN WORD DIVIDER..OLD PERSIAN NUMBER + {0x103D6, 0x103FF, propertyUNASSIGNED}, // .. + {0x10400, 0x10427, propertyDISALLOWED}, // DESERET CAPITAL LETTER LONG I..DESERET CAPIT + {0x10428, 0x1049D, propertyPVALID}, // DESERET SMALL LETTER LONG I..OSMANYA LETTER + {0x1049E, 0x1049F, propertyUNASSIGNED}, // .. + {0x104A0, 0x104A9, propertyPVALID}, // OSMANYA DIGIT ZERO..OSMANYA DIGIT NINE + {0x104AA, 0x107FF, propertyUNASSIGNED}, // .. + {0x10800, 0x10805, propertyPVALID}, // CYPRIOT SYLLABLE A..CYPRIOT SYLLABLE JA + {0x10806, 0x10807, propertyUNASSIGNED}, // .. + {0x10808, 0x0, propertyPVALID}, // CYPRIOT SYLLABLE JO + {0x10809, 0x0, propertyUNASSIGNED}, // + {0x1080A, 0x10835, propertyPVALID}, // CYPRIOT SYLLABLE KA..CYPRIOT SYLLABLE WO + {0x10836, 0x0, propertyUNASSIGNED}, // + {0x10837, 0x10838, propertyPVALID}, // CYPRIOT SYLLABLE XA..CYPRIOT SYLLABLE XE + {0x10839, 0x1083B, propertyUNASSIGNED}, // .. + {0x1083C, 0x0, propertyPVALID}, // CYPRIOT SYLLABLE ZA + {0x1083D, 0x1083E, propertyUNASSIGNED}, // .. + {0x1083F, 0x10855, propertyPVALID}, // CYPRIOT SYLLABLE ZO..IMPERIAL ARAMAIC LETTER + {0x10856, 0x0, propertyUNASSIGNED}, // + {0x10857, 0x1085F, propertyDISALLOWED}, // IMPERIAL ARAMAIC SECTION SIGN..IMPERIAL ARAM + {0x10860, 0x108FF, propertyUNASSIGNED}, // .. + {0x10900, 0x10915, propertyPVALID}, // PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU + {0x10916, 0x1091B, propertyDISALLOWED}, // PHOENICIAN NUMBER ONE..PHOENICIAN NUMBER THR + {0x1091C, 0x1091E, propertyUNASSIGNED}, // .. + {0x1091F, 0x0, propertyDISALLOWED}, // PHOENICIAN WORD SEPARATOR + {0x10920, 0x10939, propertyPVALID}, // LYDIAN LETTER A..LYDIAN LETTER C + {0x1093A, 0x1093E, propertyUNASSIGNED}, // .. + {0x1093F, 0x0, propertyDISALLOWED}, // LYDIAN TRIANGULAR MARK + {0x10940, 0x109FF, propertyUNASSIGNED}, // .. + {0x10A00, 0x10A03, propertyPVALID}, // KHAROSHTHI LETTER A..KHAROSHTHI VOWEL SIGN V + {0x10A04, 0x0, propertyUNASSIGNED}, // + {0x10A05, 0x10A06, propertyPVALID}, // KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SI + {0x10A07, 0x10A0B, propertyUNASSIGNED}, // .. + {0x10A0C, 0x10A13, propertyPVALID}, // KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI LET + {0x10A14, 0x0, propertyUNASSIGNED}, // + {0x10A15, 0x10A17, propertyPVALID}, // KHAROSHTHI LETTER CA..KHAROSHTHI LETTER JA + {0x10A18, 0x0, propertyUNASSIGNED}, // + {0x10A19, 0x10A33, propertyPVALID}, // KHAROSHTHI LETTER NYA..KHAROSHTHI LETTER TTT + {0x10A34, 0x10A37, propertyUNASSIGNED}, // .. + {0x10A38, 0x10A3A, propertyPVALID}, // KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN D + {0x10A3B, 0x10A3E, propertyUNASSIGNED}, // .. + {0x10A3F, 0x0, propertyPVALID}, // KHAROSHTHI VIRAMA + {0x10A40, 0x10A47, propertyDISALLOWED}, // KHAROSHTHI DIGIT ONE..KHAROSHTHI NUMBER ONE + {0x10A48, 0x10A4F, propertyUNASSIGNED}, // .. + {0x10A50, 0x10A58, propertyDISALLOWED}, // KHAROSHTHI PUNCTUATION DOT..KHAROSHTHI PUNCT + {0x10A59, 0x10A5F, propertyUNASSIGNED}, // .. + {0x10A60, 0x10A7C, propertyPVALID}, // OLD SOUTH ARABIAN LETTER HE..OLD SOUTH ARABI + {0x10A7D, 0x10A7F, propertyDISALLOWED}, // OLD SOUTH ARABIAN NUMBER ONE..OLD SOUTH ARAB + {0x10A80, 0x10AFF, propertyUNASSIGNED}, // .. + {0x10B00, 0x10B35, propertyPVALID}, // AVESTAN LETTER A..AVESTAN LETTER HE + {0x10B36, 0x10B38, propertyUNASSIGNED}, // .. + {0x10B39, 0x10B3F, propertyDISALLOWED}, // AVESTAN ABBREVIATION MARK..LARGE ONE RING OV + {0x10B40, 0x10B55, propertyPVALID}, // INSCRIPTIONAL PARTHIAN LETTER ALEPH..INSCRIP + {0x10B56, 0x10B57, propertyUNASSIGNED}, // .. + {0x10B58, 0x10B5F, propertyDISALLOWED}, // INSCRIPTIONAL PARTHIAN NUMBER ONE..INSCRIPTI + {0x10B60, 0x10B72, propertyPVALID}, // INSCRIPTIONAL PAHLAVI LETTER ALEPH..INSCRIPT + {0x10B73, 0x10B77, propertyUNASSIGNED}, // .. + {0x10B78, 0x10B7F, propertyDISALLOWED}, // INSCRIPTIONAL PAHLAVI NUMBER ONE..INSCRIPTIO + {0x10B80, 0x10BFF, propertyUNASSIGNED}, // .. + {0x10C00, 0x10C48, propertyPVALID}, // OLD TURKIC LETTER ORKHON A..OLD TURKIC LETTE + {0x10C49, 0x10E5F, propertyUNASSIGNED}, // .. + {0x10E60, 0x10E7E, propertyDISALLOWED}, // RUMI DIGIT ONE..RUMI FRACTION TWO THIRDS + {0x10E7F, 0x1107F, propertyUNASSIGNED}, // .. + {0x11080, 0x110BA, propertyPVALID}, // KAITHI SIGN CANDRABINDU..KAITHI SIGN NUKTA + {0x110BB, 0x110C1, propertyDISALLOWED}, // KAITHI ABBREVIATION SIGN..KAITHI DOUBLE DAND + {0x110C2, 0x11FFF, propertyUNASSIGNED}, // .. + {0x12000, 0x1236E, propertyPVALID}, // CUNEIFORM SIGN A..CUNEIFORM SIGN ZUM + {0x1236F, 0x123FF, propertyUNASSIGNED}, // .. + {0x12400, 0x12462, propertyDISALLOWED}, // CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NU + {0x12463, 0x1246F, propertyUNASSIGNED}, // .. + {0x12470, 0x12473, propertyDISALLOWED}, // CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD + {0x12474, 0x12FFF, propertyUNASSIGNED}, // .. + {0x13000, 0x1342E, propertyPVALID}, // EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYP + {0x1342F, 0x1CFFF, propertyUNASSIGNED}, // .. + {0x1D000, 0x1D0F5, propertyDISALLOWED}, // BYZANTINE MUSICAL SYMBOL PSILI..BYZANTINE MU + {0x1D0F6, 0x1D0FF, propertyUNASSIGNED}, // .. + {0x1D100, 0x1D126, propertyDISALLOWED}, // MUSICAL SYMBOL SINGLE BARLINE..MUSICAL SYMBO + {0x1D127, 0x1D128, propertyUNASSIGNED}, // .. + {0x1D129, 0x1D1DD, propertyDISALLOWED}, // MUSICAL SYMBOL MULTIPLE MEASURE REST..MUSICA + {0x1D1DE, 0x1D1FF, propertyUNASSIGNED}, // .. + {0x1D200, 0x1D245, propertyDISALLOWED}, // GREEK VOCAL NOTATION SYMBOL-1..GREEK MUSICAL + {0x1D246, 0x1D2FF, propertyUNASSIGNED}, // .. + {0x1D300, 0x1D356, propertyDISALLOWED}, // MONOGRAM FOR EARTH..TETRAGRAM FOR FOSTERING + {0x1D357, 0x1D35F, propertyUNASSIGNED}, // .. + {0x1D360, 0x1D371, propertyDISALLOWED}, // COUNTING ROD UNIT DIGIT ONE..COUNTING ROD TE + {0x1D372, 0x1D3FF, propertyUNASSIGNED}, // .. + {0x1D400, 0x1D454, propertyDISALLOWED}, // MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL IT + {0x1D455, 0x0, propertyUNASSIGNED}, // + {0x1D456, 0x1D49C, propertyDISALLOWED}, // MATHEMATICAL ITALIC SMALL I..MATHEMATICAL SC + {0x1D49D, 0x0, propertyUNASSIGNED}, // + {0x1D49E, 0x1D49F, propertyDISALLOWED}, // MATHEMATICAL SCRIPT CAPITAL C..MATHEMATICAL + {0x1D4A0, 0x1D4A1, propertyUNASSIGNED}, // .. + {0x1D4A2, 0x0, propertyDISALLOWED}, // MATHEMATICAL SCRIPT CAPITAL G + {0x1D4A3, 0x1D4A4, propertyUNASSIGNED}, // .. + {0x1D4A5, 0x1D4A6, propertyDISALLOWED}, // MATHEMATICAL SCRIPT CAPITAL J..MATHEMATICAL + {0x1D4A7, 0x1D4A8, propertyUNASSIGNED}, // .. + {0x1D4A9, 0x1D4AC, propertyDISALLOWED}, // MATHEMATICAL SCRIPT CAPITAL N..MATHEMATICAL + {0x1D4AD, 0x0, propertyUNASSIGNED}, // + {0x1D4AE, 0x1D4B9, propertyDISALLOWED}, // MATHEMATICAL SCRIPT CAPITAL S..MATHEMATICAL + {0x1D4BA, 0x0, propertyUNASSIGNED}, // + {0x1D4BB, 0x0, propertyDISALLOWED}, // MATHEMATICAL SCRIPT SMALL F + {0x1D4BC, 0x0, propertyUNASSIGNED}, // + {0x1D4BD, 0x1D4C3, propertyDISALLOWED}, // MATHEMATICAL SCRIPT SMALL H..MATHEMATICAL SC + {0x1D4C4, 0x0, propertyUNASSIGNED}, // + {0x1D4C5, 0x1D505, propertyDISALLOWED}, // MATHEMATICAL SCRIPT SMALL P..MATHEMATICAL FR + {0x1D506, 0x0, propertyUNASSIGNED}, // + {0x1D507, 0x1D50A, propertyDISALLOWED}, // MATHEMATICAL FRAKTUR CAPITAL D..MATHEMATICAL + {0x1D50B, 0x1D50C, propertyUNASSIGNED}, // .. + {0x1D50D, 0x1D514, propertyDISALLOWED}, // MATHEMATICAL FRAKTUR CAPITAL J..MATHEMATICAL + {0x1D515, 0x0, propertyUNASSIGNED}, // + {0x1D516, 0x1D51C, propertyDISALLOWED}, // MATHEMATICAL FRAKTUR CAPITAL S..MATHEMATICAL + {0x1D51D, 0x0, propertyUNASSIGNED}, // + {0x1D51E, 0x1D539, propertyDISALLOWED}, // MATHEMATICAL FRAKTUR SMALL A..MATHEMATICAL D + {0x1D53A, 0x0, propertyUNASSIGNED}, // + {0x1D53B, 0x1D53E, propertyDISALLOWED}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL D..MATHEM + {0x1D53F, 0x0, propertyUNASSIGNED}, // + {0x1D540, 0x1D544, propertyDISALLOWED}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL I..MATHEM + {0x1D545, 0x0, propertyUNASSIGNED}, // + {0x1D546, 0x0, propertyDISALLOWED}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL O + {0x1D547, 0x1D549, propertyUNASSIGNED}, // .. + {0x1D54A, 0x1D550, propertyDISALLOWED}, // MATHEMATICAL DOUBLE-STRUCK CAPITAL S..MATHEM + {0x1D551, 0x0, propertyUNASSIGNED}, // + {0x1D552, 0x1D6A5, propertyDISALLOWED}, // MATHEMATICAL DOUBLE-STRUCK SMALL A..MATHEMAT + {0x1D6A6, 0x1D6A7, propertyUNASSIGNED}, // .. + {0x1D6A8, 0x1D7CB, propertyDISALLOWED}, // MATHEMATICAL BOLD CAPITAL ALPHA..MATHEMATICA + {0x1D7CC, 0x1D7CD, propertyUNASSIGNED}, // .. + {0x1D7CE, 0x1D7FF, propertyDISALLOWED}, // MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL M + {0x1D800, 0x1EFFF, propertyUNASSIGNED}, // .. + {0x1F000, 0x1F02B, propertyDISALLOWED}, // MAHJONG TILE EAST WIND..MAHJONG TILE BACK + {0x1F02C, 0x1F02F, propertyUNASSIGNED}, // .. + {0x1F030, 0x1F093, propertyDISALLOWED}, // DOMINO TILE HORIZONTAL BACK..DOMINO TILE VER + {0x1F094, 0x1F0FF, propertyUNASSIGNED}, // .. + {0x1F100, 0x1F10A, propertyDISALLOWED}, // DIGIT ZERO FULL STOP..DIGIT NINE COMMA + {0x1F10B, 0x1F10F, propertyUNASSIGNED}, // .. + {0x1F110, 0x1F12E, propertyDISALLOWED}, // PARENTHESIZED LATIN CAPITAL LETTER A..CIRCLE + {0x1F12F, 0x1F130, propertyUNASSIGNED}, // .. + {0x1F131, 0x0, propertyDISALLOWED}, // SQUARED LATIN CAPITAL LETTER B + {0x1F132, 0x1F13C, propertyUNASSIGNED}, // .. + {0x1F13D, 0x0, propertyDISALLOWED}, // SQUARED LATIN CAPITAL LETTER N + {0x1F13E, 0x0, propertyUNASSIGNED}, // + {0x1F13F, 0x0, propertyDISALLOWED}, // SQUARED LATIN CAPITAL LETTER P + {0x1F140, 0x1F141, propertyUNASSIGNED}, // .. + {0x1F142, 0x0, propertyDISALLOWED}, // SQUARED LATIN CAPITAL LETTER S + {0x1F143, 0x1F145, propertyUNASSIGNED}, // .. + {0x1F146, 0x0, propertyDISALLOWED}, // SQUARED LATIN CAPITAL LETTER W + {0x1F147, 0x1F149, propertyUNASSIGNED}, // .. + {0x1F14A, 0x1F14E, propertyDISALLOWED}, // SQUARED HV..SQUARED PPV + {0x1F14F, 0x1F156, propertyUNASSIGNED}, // .. + {0x1F157, 0x0, propertyDISALLOWED}, // NEGATIVE CIRCLED LATIN CAPITAL LETTER H + {0x1F158, 0x1F15E, propertyUNASSIGNED}, // .. + {0x1F15F, 0x0, propertyDISALLOWED}, // NEGATIVE CIRCLED LATIN CAPITAL LETTER P + {0x1F160, 0x1F178, propertyUNASSIGNED}, // .. + {0x1F179, 0x0, propertyDISALLOWED}, // NEGATIVE SQUARED LATIN CAPITAL LETTER J + {0x1F17A, 0x0, propertyUNASSIGNED}, // + {0x1F17B, 0x1F17C, propertyDISALLOWED}, // NEGATIVE SQUARED LATIN CAPITAL LETTER L..NEG + {0x1F17D, 0x1F17E, propertyUNASSIGNED}, // .. + {0x1F17F, 0x0, propertyDISALLOWED}, // NEGATIVE SQUARED LATIN CAPITAL LETTER P + {0x1F180, 0x1F189, propertyUNASSIGNED}, // .. + {0x1F18A, 0x1F18D, propertyDISALLOWED}, // CROSSED NEGATIVE SQUARED LATIN CAPITAL LETTE + {0x1F18E, 0x1F18F, propertyUNASSIGNED}, // .. + {0x1F190, 0x0, propertyDISALLOWED}, // SQUARE DJ + {0x1F191, 0x1F1FF, propertyUNASSIGNED}, // .. + {0x1F200, 0x0, propertyDISALLOWED}, // SQUARE HIRAGANA HOKA + {0x1F201, 0x1F20F, propertyUNASSIGNED}, // .. + {0x1F210, 0x1F231, propertyDISALLOWED}, // SQUARED CJK UNIFIED IDEOGRAPH-624B..SQUARED + {0x1F232, 0x1F23F, propertyUNASSIGNED}, // .. + {0x1F240, 0x1F248, propertyDISALLOWED}, // TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRA + {0x1F249, 0x1FFFD, propertyUNASSIGNED}, // .. + {0x1FFFE, 0x1FFFF, propertyDISALLOWED}, // .. + {0x20000, 0x2A6D6, propertyPVALID}, // .... + {0x2A700, 0x2B734, propertyPVALID}, // .... + {0x2F800, 0x2FA1D, propertyDISALLOWED}, // CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPA + {0x2FA1E, 0x2FFFD, propertyUNASSIGNED}, // .. + {0x2FFFE, 0x2FFFF, propertyDISALLOWED}, // .. + {0x30000, 0x3FFFD, propertyUNASSIGNED}, // .. + {0x3FFFE, 0x3FFFF, propertyDISALLOWED}, // .. + {0x40000, 0x4FFFD, propertyUNASSIGNED}, // .. + {0x4FFFE, 0x4FFFF, propertyDISALLOWED}, // .. + {0x50000, 0x5FFFD, propertyUNASSIGNED}, // .. + {0x5FFFE, 0x5FFFF, propertyDISALLOWED}, // .. + {0x60000, 0x6FFFD, propertyUNASSIGNED}, // .. + {0x6FFFE, 0x6FFFF, propertyDISALLOWED}, // .. + {0x70000, 0x7FFFD, propertyUNASSIGNED}, // .. + {0x7FFFE, 0x7FFFF, propertyDISALLOWED}, // .. + {0x80000, 0x8FFFD, propertyUNASSIGNED}, // .. + {0x8FFFE, 0x8FFFF, propertyDISALLOWED}, // .. + {0x90000, 0x9FFFD, propertyUNASSIGNED}, // .. + {0x9FFFE, 0x9FFFF, propertyDISALLOWED}, // .. + {0xA0000, 0xAFFFD, propertyUNASSIGNED}, // .. + {0xAFFFE, 0xAFFFF, propertyDISALLOWED}, // .. + {0xB0000, 0xBFFFD, propertyUNASSIGNED}, // .. + {0xBFFFE, 0xBFFFF, propertyDISALLOWED}, // .. + {0xC0000, 0xCFFFD, propertyUNASSIGNED}, // .. + {0xCFFFE, 0xCFFFF, propertyDISALLOWED}, // .. + {0xD0000, 0xDFFFD, propertyUNASSIGNED}, // .. + {0xDFFFE, 0xDFFFF, propertyDISALLOWED}, // .. + {0xE0000, 0x0, propertyUNASSIGNED}, // + {0xE0001, 0x0, propertyDISALLOWED}, // LANGUAGE TAG + {0xE0002, 0xE001F, propertyUNASSIGNED}, // .. + {0xE0020, 0xE007F, propertyDISALLOWED}, // TAG SPACE..CANCEL TAG + {0xE0080, 0xE00FF, propertyUNASSIGNED}, // .. + {0xE0100, 0xE01EF, propertyDISALLOWED}, // VARIATION SELECTOR-17..VARIATION SELECTOR-25 + {0xE01F0, 0xEFFFD, propertyUNASSIGNED}, // .. + {0xEFFFE, 0x10FFFF, propertyDISALLOWED}, // .. +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/idn/punycode.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/idn/punycode.go new file mode 100644 index 00000000..7e5c263f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/idn/punycode.go @@ -0,0 +1,373 @@ +// Package idn implements encoding from and to punycode as speficied by RFC 3492. +package idn + +import ( + "bytes" + "strings" + "unicode" + "unicode/utf8" + + "github.com/miekg/dns" +) + +// Implementation idea from RFC itself and from from IDNA::Punycode created by +// Tatsuhiko Miyagawa and released under Perl Artistic +// License in 2002. + +const ( + _MIN rune = 1 + _MAX rune = 26 + _SKEW rune = 38 + _BASE rune = 36 + _BIAS rune = 72 + _N rune = 128 + _DAMP rune = 700 + + _DELIMITER = '-' + _PREFIX = "xn--" +) + +// ToPunycode converts unicode domain names to DNS-appropriate punycode names. +// This function will return an empty string result for domain names with +// invalid unicode strings. This function expects domain names in lowercase. +func ToPunycode(s string) string { + // Early check to see if encoding is needed. + // This will prevent making heap allocations when not needed. + if !needToPunycode(s) { + return s + } + + tokens := dns.SplitDomainName(s) + switch { + case s == "": + return "" + case tokens == nil: // s == . + return "." + case s[len(s)-1] == '.': + tokens = append(tokens, "") + } + + for i := range tokens { + t := encode([]byte(tokens[i])) + if t == nil { + return "" + } + tokens[i] = string(t) + } + return strings.Join(tokens, ".") +} + +// FromPunycode returns unicode domain name from provided punycode string. +// This function expects punycode strings in lowercase. +func FromPunycode(s string) string { + // Early check to see if decoding is needed. + // This will prevent making heap allocations when not needed. + if !needFromPunycode(s) { + return s + } + + tokens := dns.SplitDomainName(s) + switch { + case s == "": + return "" + case tokens == nil: // s == . + return "." + case s[len(s)-1] == '.': + tokens = append(tokens, "") + } + for i := range tokens { + tokens[i] = string(decode([]byte(tokens[i]))) + } + return strings.Join(tokens, ".") +} + +// digitval converts single byte into meaningful value that's used to calculate decoded unicode character. +const errdigit = 0xffff + +func digitval(code rune) rune { + switch { + case code >= 'A' && code <= 'Z': + return code - 'A' + case code >= 'a' && code <= 'z': + return code - 'a' + case code >= '0' && code <= '9': + return code - '0' + 26 + } + return errdigit +} + +// lettercode finds BASE36 byte (a-z0-9) based on calculated number. +func lettercode(digit rune) rune { + switch { + case digit >= 0 && digit <= 25: + return digit + 'a' + case digit >= 26 && digit <= 36: + return digit - 26 + '0' + } + panic("dns: not reached") +} + +// adapt calculates next bias to be used for next iteration delta. +func adapt(delta rune, numpoints int, firsttime bool) rune { + if firsttime { + delta /= _DAMP + } else { + delta /= 2 + } + + var k rune + for delta = delta + delta/rune(numpoints); delta > (_BASE-_MIN)*_MAX/2; k += _BASE { + delta /= _BASE - _MIN + } + + return k + ((_BASE-_MIN+1)*delta)/(delta+_SKEW) +} + +// next finds minimal rune (one with lowest codepoint value) that should be equal or above boundary. +func next(b []rune, boundary rune) rune { + if len(b) == 0 { + panic("dns: invalid set of runes to determine next one") + } + m := b[0] + for _, x := range b[1:] { + if x >= boundary && (m < boundary || x < m) { + m = x + } + } + return m +} + +// preprune converts unicode rune to lower case. At this time it's not +// supporting all things described in RFCs. +func preprune(r rune) rune { + if unicode.IsUpper(r) { + r = unicode.ToLower(r) + } + return r +} + +// tfunc is a function that helps calculate each character weight. +func tfunc(k, bias rune) rune { + switch { + case k <= bias: + return _MIN + case k >= bias+_MAX: + return _MAX + } + return k - bias +} + +// needToPunycode returns true for strings that require punycode encoding +// (contain unicode characters). +func needToPunycode(s string) bool { + // This function is very similar to bytes.Runes. We don't use bytes.Runes + // because it makes a heap allocation that's not needed here. + for i := 0; len(s) > 0; i++ { + r, l := utf8.DecodeRuneInString(s) + if r > 0x7f { + return true + } + s = s[l:] + } + return false +} + +// needFromPunycode returns true for strings that require punycode decoding. +func needFromPunycode(s string) bool { + if s == "." { + return false + } + + off := 0 + end := false + pl := len(_PREFIX) + sl := len(s) + + // If s starts with _PREFIX. + if sl > pl && s[off:off+pl] == _PREFIX { + return true + } + + for { + // Find the part after the next ".". + off, end = dns.NextLabel(s, off) + if end { + return false + } + // If this parts starts with _PREFIX. + if sl-off > pl && s[off:off+pl] == _PREFIX { + return true + } + } +} + +// encode transforms Unicode input bytes (that represent DNS label) into +// punycode bytestream. This function would return nil if there's an invalid +// character in the label. +func encode(input []byte) []byte { + n, bias := _N, _BIAS + + b := bytes.Runes(input) + for i := range b { + if !isValidRune(b[i]) { + return nil + } + + b[i] = preprune(b[i]) + } + + basic := make([]byte, 0, len(b)) + for _, ltr := range b { + if ltr <= 0x7f { + basic = append(basic, byte(ltr)) + } + } + basiclen := len(basic) + fulllen := len(b) + if basiclen == fulllen { + return basic + } + + var out bytes.Buffer + + out.WriteString(_PREFIX) + if basiclen > 0 { + out.Write(basic) + out.WriteByte(_DELIMITER) + } + + var ( + ltr, nextltr rune + delta, q rune // delta calculation (see rfc) + t, k, cp rune // weight and codepoint calculation + ) + + s := &bytes.Buffer{} + for h := basiclen; h < fulllen; n, delta = n+1, delta+1 { + nextltr = next(b, n) + s.Truncate(0) + s.WriteRune(nextltr) + delta, n = delta+(nextltr-n)*rune(h+1), nextltr + + for _, ltr = range b { + if ltr < n { + delta++ + } + if ltr == n { + q = delta + for k = _BASE; ; k += _BASE { + t = tfunc(k, bias) + if q < t { + break + } + cp = t + ((q - t) % (_BASE - t)) + out.WriteRune(lettercode(cp)) + q = (q - t) / (_BASE - t) + } + + out.WriteRune(lettercode(q)) + + bias = adapt(delta, h+1, h == basiclen) + h, delta = h+1, 0 + } + } + } + return out.Bytes() +} + +// decode transforms punycode input bytes (that represent DNS label) into Unicode bytestream. +func decode(b []byte) []byte { + src := b // b would move and we need to keep it + + n, bias := _N, _BIAS + if !bytes.HasPrefix(b, []byte(_PREFIX)) { + return b + } + out := make([]rune, 0, len(b)) + b = b[len(_PREFIX):] + for pos := len(b) - 1; pos >= 0; pos-- { + // only last delimiter is our interest + if b[pos] == _DELIMITER { + out = append(out, bytes.Runes(b[:pos])...) + b = b[pos+1:] // trim source string + break + } + } + if len(b) == 0 { + return src + } + var ( + i, oldi, w rune + ch byte + t, digit rune + ln int + ) + + for i = 0; len(b) > 0; i++ { + oldi, w = i, 1 + for k := _BASE; len(b) > 0; k += _BASE { + ch, b = b[0], b[1:] + digit = digitval(rune(ch)) + if digit == errdigit { + return src + } + i += digit * w + if i < 0 { + // safety check for rune overflow + return src + } + + t = tfunc(k, bias) + if digit < t { + break + } + + w *= _BASE - t + } + ln = len(out) + 1 + bias = adapt(i-oldi, ln, oldi == 0) + n += i / rune(ln) + i = i % rune(ln) + // insert + out = append(out, 0) + copy(out[i+1:], out[i:]) + out[i] = n + } + + var ret bytes.Buffer + for _, r := range out { + ret.WriteRune(r) + } + return ret.Bytes() +} + +// isValidRune checks if the character is valid. We will look for the +// character property in the code points list. For now we aren't checking special +// rules in case of contextual property +func isValidRune(r rune) bool { + return findProperty(r) == propertyPVALID +} + +// findProperty will try to check the code point property of the given +// character. It will use a binary search algorithm as we have a slice of +// ordered ranges (average case performance O(log n)) +func findProperty(r rune) property { + imin, imax := 0, len(codePoints) + + for imax >= imin { + imid := (imin + imax) / 2 + + codePoint := codePoints[imid] + if (codePoint.start == r && codePoint.end == 0) || (codePoint.start <= r && codePoint.end >= r) { + return codePoint.state + } + + if (codePoint.end > 0 && codePoint.end < r) || (codePoint.end == 0 && codePoint.start < r) { + imin = imid + 1 + } else { + imax = imid - 1 + } + } + + return propertyUnknown +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/labels.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/labels.go new file mode 100644 index 00000000..fca5c7dd --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/labels.go @@ -0,0 +1,168 @@ +package dns + +// Holds a bunch of helper functions for dealing with labels. + +// SplitDomainName splits a name string into it's labels. +// www.miek.nl. returns []string{"www", "miek", "nl"} +// .www.miek.nl. returns []string{"", "www", "miek", "nl"}, +// The root label (.) returns nil. Note that using +// strings.Split(s) will work in most cases, but does not handle +// escaped dots (\.) for instance. +// s must be a syntactically valid domain name, see IsDomainName. +func SplitDomainName(s string) (labels []string) { + if len(s) == 0 { + return nil + } + fqdnEnd := 0 // offset of the final '.' or the length of the name + idx := Split(s) + begin := 0 + if s[len(s)-1] == '.' { + fqdnEnd = len(s) - 1 + } else { + fqdnEnd = len(s) + } + + switch len(idx) { + case 0: + return nil + case 1: + // no-op + default: + end := 0 + for i := 1; i < len(idx); i++ { + end = idx[i] + labels = append(labels, s[begin:end-1]) + begin = end + } + } + + labels = append(labels, s[begin:fqdnEnd]) + return labels +} + +// CompareDomainName compares the names s1 and s2 and +// returns how many labels they have in common starting from the *right*. +// The comparison stops at the first inequality. The names are not downcased +// before the comparison. +// +// www.miek.nl. and miek.nl. have two labels in common: miek and nl +// www.miek.nl. and www.bla.nl. have one label in common: nl +// +// s1 and s2 must be syntactically valid domain names. +func CompareDomainName(s1, s2 string) (n int) { + s1 = Fqdn(s1) + s2 = Fqdn(s2) + l1 := Split(s1) + l2 := Split(s2) + + // the first check: root label + if l1 == nil || l2 == nil { + return + } + + j1 := len(l1) - 1 // end + i1 := len(l1) - 2 // start + j2 := len(l2) - 1 + i2 := len(l2) - 2 + // the second check can be done here: last/only label + // before we fall through into the for-loop below + if s1[l1[j1]:] == s2[l2[j2]:] { + n++ + } else { + return + } + for { + if i1 < 0 || i2 < 0 { + break + } + if s1[l1[i1]:l1[j1]] == s2[l2[i2]:l2[j2]] { + n++ + } else { + break + } + j1-- + i1-- + j2-- + i2-- + } + return +} + +// CountLabel counts the the number of labels in the string s. +// s must be a syntactically valid domain name. +func CountLabel(s string) (labels int) { + if s == "." { + return + } + off := 0 + end := false + for { + off, end = NextLabel(s, off) + labels++ + if end { + return + } + } +} + +// Split splits a name s into its label indexes. +// www.miek.nl. returns []int{0, 4, 9}, www.miek.nl also returns []int{0, 4, 9}. +// The root name (.) returns nil. Also see SplitDomainName. +// s must be a syntactically valid domain name. +func Split(s string) []int { + if s == "." { + return nil + } + idx := make([]int, 1, 3) + off := 0 + end := false + + for { + off, end = NextLabel(s, off) + if end { + return idx + } + idx = append(idx, off) + } +} + +// NextLabel returns the index of the start of the next label in the +// string s starting at offset. +// The bool end is true when the end of the string has been reached. +// Also see PrevLabel. +func NextLabel(s string, offset int) (i int, end bool) { + quote := false + for i = offset; i < len(s)-1; i++ { + switch s[i] { + case '\\': + quote = !quote + default: + quote = false + case '.': + if quote { + quote = !quote + continue + } + return i + 1, false + } + } + return i + 1, true +} + +// PrevLabel returns the index of the label when starting from the right and +// jumping n labels to the left. +// The bool start is true when the start of the string has been overshot. +// Also see NextLabel. +func PrevLabel(s string, n int) (i int, start bool) { + if n == 0 { + return len(s), false + } + lab := Split(s) + if lab == nil { + return 0, true + } + if n > len(lab) { + return 0, true + } + return lab[len(lab)-n], false +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/msg.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/msg.go new file mode 100644 index 00000000..ec2f7ab7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/msg.go @@ -0,0 +1,1231 @@ +// DNS packet assembly, see RFC 1035. Converting from - Unpack() - +// and to - Pack() - wire format. +// All the packers and unpackers take a (msg []byte, off int) +// and return (off1 int, ok bool). If they return ok==false, they +// also return off1==len(msg), so that the next unpacker will +// also fail. This lets us avoid checks of ok until the end of a +// packing sequence. + +package dns + +//go:generate go run msg_generate.go + +import ( + crand "crypto/rand" + "encoding/binary" + "math/big" + "math/rand" + "strconv" +) + +func init() { + // Initialize default math/rand source using crypto/rand to provide better + // security without the performance trade-off. + buf := make([]byte, 8) + _, err := crand.Read(buf) + if err != nil { + // Failed to read from cryptographic source, fallback to default initial + // seed (1) by returning early + return + } + seed := binary.BigEndian.Uint64(buf) + rand.Seed(int64(seed)) +} + +const maxCompressionOffset = 2 << 13 // We have 14 bits for the compression pointer + +var ( + ErrAlg error = &Error{err: "bad algorithm"} // ErrAlg indicates an error with the (DNSSEC) algorithm. + ErrAuth error = &Error{err: "bad authentication"} // ErrAuth indicates an error in the TSIG authentication. + ErrBuf error = &Error{err: "buffer size too small"} // ErrBuf indicates that the buffer used it too small for the message. + ErrConnEmpty error = &Error{err: "conn has no connection"} // ErrConnEmpty indicates a connection is being uses before it is initialized. + ErrExtendedRcode error = &Error{err: "bad extended rcode"} // ErrExtendedRcode ... + ErrFqdn error = &Error{err: "domain must be fully qualified"} // ErrFqdn indicates that a domain name does not have a closing dot. + ErrId error = &Error{err: "id mismatch"} // ErrId indicates there is a mismatch with the message's ID. + ErrKeyAlg error = &Error{err: "bad key algorithm"} // ErrKeyAlg indicates that the algorithm in the key is not valid. + ErrKey error = &Error{err: "bad key"} + ErrKeySize error = &Error{err: "bad key size"} + ErrNoSig error = &Error{err: "no signature found"} + ErrPrivKey error = &Error{err: "bad private key"} + ErrRcode error = &Error{err: "bad rcode"} + ErrRdata error = &Error{err: "bad rdata"} + ErrRRset error = &Error{err: "bad rrset"} + ErrSecret error = &Error{err: "no secrets defined"} + ErrShortRead error = &Error{err: "short read"} + ErrSig error = &Error{err: "bad signature"} // ErrSig indicates that a signature can not be cryptographically validated. + ErrSoa error = &Error{err: "no SOA"} // ErrSOA indicates that no SOA RR was seen when doing zone transfers. + ErrTime error = &Error{err: "bad time"} // ErrTime indicates a timing error in TSIG authentication. + ErrTruncated error = &Error{err: "failed to unpack truncated message"} // ErrTruncated indicates that we failed to unpack a truncated message. We unpacked as much as we had so Msg can still be used, if desired. +) + +// Id, by default, returns a 16 bits random number to be used as a +// message id. The random provided should be good enough. This being a +// variable the function can be reassigned to a custom function. +// For instance, to make it return a static value: +// +// dns.Id = func() uint16 { return 3 } +var Id func() uint16 = id + +// id returns a 16 bits random number to be used as a +// message id. The random provided should be good enough. +func id() uint16 { + id32 := rand.Uint32() + return uint16(id32) +} + +// MsgHdr is a a manually-unpacked version of (id, bits). +type MsgHdr struct { + Id uint16 + Response bool + Opcode int + Authoritative bool + Truncated bool + RecursionDesired bool + RecursionAvailable bool + Zero bool + AuthenticatedData bool + CheckingDisabled bool + Rcode int +} + +// Msg contains the layout of a DNS message. +type Msg struct { + MsgHdr + Compress bool `json:"-"` // If true, the message will be compressed when converted to wire format. + Question []Question // Holds the RR(s) of the question section. + Answer []RR // Holds the RR(s) of the answer section. + Ns []RR // Holds the RR(s) of the authority section. + Extra []RR // Holds the RR(s) of the additional section. +} + +// ClassToString is a maps Classes to strings for each CLASS wire type. +var ClassToString = map[uint16]string{ + ClassINET: "IN", + ClassCSNET: "CS", + ClassCHAOS: "CH", + ClassHESIOD: "HS", + ClassNONE: "NONE", + ClassANY: "ANY", +} + +// OpcodeToString maps Opcodes to strings. +var OpcodeToString = map[int]string{ + OpcodeQuery: "QUERY", + OpcodeIQuery: "IQUERY", + OpcodeStatus: "STATUS", + OpcodeNotify: "NOTIFY", + OpcodeUpdate: "UPDATE", +} + +// RcodeToString maps Rcodes to strings. +var RcodeToString = map[int]string{ + RcodeSuccess: "NOERROR", + RcodeFormatError: "FORMERR", + RcodeServerFailure: "SERVFAIL", + RcodeNameError: "NXDOMAIN", + RcodeNotImplemented: "NOTIMPL", + RcodeRefused: "REFUSED", + RcodeYXDomain: "YXDOMAIN", // See RFC 2136 + RcodeYXRrset: "YXRRSET", + RcodeNXRrset: "NXRRSET", + RcodeNotAuth: "NOTAUTH", + RcodeNotZone: "NOTZONE", + RcodeBadSig: "BADSIG", // Also known as RcodeBadVers, see RFC 6891 + // RcodeBadVers: "BADVERS", + RcodeBadKey: "BADKEY", + RcodeBadTime: "BADTIME", + RcodeBadMode: "BADMODE", + RcodeBadName: "BADNAME", + RcodeBadAlg: "BADALG", + RcodeBadTrunc: "BADTRUNC", + RcodeBadCookie: "BADCOOKIE", +} + +// Domain names are a sequence of counted strings +// split at the dots. They end with a zero-length string. + +// PackDomainName packs a domain name s into msg[off:]. +// If compression is wanted compress must be true and the compression +// map needs to hold a mapping between domain names and offsets +// pointing into msg. +func PackDomainName(s string, msg []byte, off int, compression map[string]int, compress bool) (off1 int, err error) { + off1, _, err = packDomainName(s, msg, off, compression, compress) + return +} + +func packDomainName(s string, msg []byte, off int, compression map[string]int, compress bool) (off1 int, labels int, err error) { + // special case if msg == nil + lenmsg := 256 + if msg != nil { + lenmsg = len(msg) + } + ls := len(s) + if ls == 0 { // Ok, for instance when dealing with update RR without any rdata. + return off, 0, nil + } + // If not fully qualified, error out, but only if msg == nil #ugly + switch { + case msg == nil: + if s[ls-1] != '.' { + s += "." + ls++ + } + case msg != nil: + if s[ls-1] != '.' { + return lenmsg, 0, ErrFqdn + } + } + // Each dot ends a segment of the name. + // We trade each dot byte for a length byte. + // Except for escaped dots (\.), which are normal dots. + // There is also a trailing zero. + + // Compression + nameoffset := -1 + pointer := -1 + // Emit sequence of counted strings, chopping at dots. + begin := 0 + bs := []byte(s) + roBs, bsFresh, escapedDot := s, true, false + for i := 0; i < ls; i++ { + if bs[i] == '\\' { + for j := i; j < ls-1; j++ { + bs[j] = bs[j+1] + } + ls-- + if off+1 > lenmsg { + return lenmsg, labels, ErrBuf + } + // check for \DDD + if i+2 < ls && isDigit(bs[i]) && isDigit(bs[i+1]) && isDigit(bs[i+2]) { + bs[i] = dddToByte(bs[i:]) + for j := i + 1; j < ls-2; j++ { + bs[j] = bs[j+2] + } + ls -= 2 + } else if bs[i] == 't' { + bs[i] = '\t' + } else if bs[i] == 'r' { + bs[i] = '\r' + } else if bs[i] == 'n' { + bs[i] = '\n' + } + escapedDot = bs[i] == '.' + bsFresh = false + continue + } + + if bs[i] == '.' { + if i > 0 && bs[i-1] == '.' && !escapedDot { + // two dots back to back is not legal + return lenmsg, labels, ErrRdata + } + if i-begin >= 1<<6 { // top two bits of length must be clear + return lenmsg, labels, ErrRdata + } + // off can already (we're in a loop) be bigger than len(msg) + // this happens when a name isn't fully qualified + if off+1 > lenmsg { + return lenmsg, labels, ErrBuf + } + if msg != nil { + msg[off] = byte(i - begin) + } + offset := off + off++ + for j := begin; j < i; j++ { + if off+1 > lenmsg { + return lenmsg, labels, ErrBuf + } + if msg != nil { + msg[off] = bs[j] + } + off++ + } + if compress && !bsFresh { + roBs = string(bs) + bsFresh = true + } + // Don't try to compress '.' + if compress && roBs[begin:] != "." { + if p, ok := compression[roBs[begin:]]; !ok { + // Only offsets smaller than this can be used. + if offset < maxCompressionOffset { + compression[roBs[begin:]] = offset + } + } else { + // The first hit is the longest matching dname + // keep the pointer offset we get back and store + // the offset of the current name, because that's + // where we need to insert the pointer later + + // If compress is true, we're allowed to compress this dname + if pointer == -1 && compress { + pointer = p // Where to point to + nameoffset = offset // Where to point from + break + } + } + } + labels++ + begin = i + 1 + } + escapedDot = false + } + // Root label is special + if len(bs) == 1 && bs[0] == '.' { + return off, labels, nil + } + // If we did compression and we find something add the pointer here + if pointer != -1 { + // We have two bytes (14 bits) to put the pointer in + // if msg == nil, we will never do compression + binary.BigEndian.PutUint16(msg[nameoffset:], uint16(pointer^0xC000)) + off = nameoffset + 1 + goto End + } + if msg != nil && off < len(msg) { + msg[off] = 0 + } +End: + off++ + return off, labels, nil +} + +// Unpack a domain name. +// In addition to the simple sequences of counted strings above, +// domain names are allowed to refer to strings elsewhere in the +// packet, to avoid repeating common suffixes when returning +// many entries in a single domain. The pointers are marked +// by a length byte with the top two bits set. Ignoring those +// two bits, that byte and the next give a 14 bit offset from msg[0] +// where we should pick up the trail. +// Note that if we jump elsewhere in the packet, +// we return off1 == the offset after the first pointer we found, +// which is where the next record will start. +// In theory, the pointers are only allowed to jump backward. +// We let them jump anywhere and stop jumping after a while. + +// UnpackDomainName unpacks a domain name into a string. +func UnpackDomainName(msg []byte, off int) (string, int, error) { + s := make([]byte, 0, 64) + off1 := 0 + lenmsg := len(msg) + ptr := 0 // number of pointers followed +Loop: + for { + if off >= lenmsg { + return "", lenmsg, ErrBuf + } + c := int(msg[off]) + off++ + switch c & 0xC0 { + case 0x00: + if c == 0x00 { + // end of name + break Loop + } + // literal string + if off+c > lenmsg { + return "", lenmsg, ErrBuf + } + for j := off; j < off+c; j++ { + switch b := msg[j]; b { + case '.', '(', ')', ';', ' ', '@': + fallthrough + case '"', '\\': + s = append(s, '\\', b) + case '\t': + s = append(s, '\\', 't') + case '\r': + s = append(s, '\\', 'r') + default: + if b < 32 || b >= 127 { // unprintable use \DDD + var buf [3]byte + bufs := strconv.AppendInt(buf[:0], int64(b), 10) + s = append(s, '\\') + for i := 0; i < 3-len(bufs); i++ { + s = append(s, '0') + } + for _, r := range bufs { + s = append(s, r) + } + } else { + s = append(s, b) + } + } + } + s = append(s, '.') + off += c + case 0xC0: + // pointer to somewhere else in msg. + // remember location after first ptr, + // since that's how many bytes we consumed. + // also, don't follow too many pointers -- + // maybe there's a loop. + if off >= lenmsg { + return "", lenmsg, ErrBuf + } + c1 := msg[off] + off++ + if ptr == 0 { + off1 = off + } + if ptr++; ptr > 10 { + return "", lenmsg, &Error{err: "too many compression pointers"} + } + off = (c^0xC0)<<8 | int(c1) + default: + // 0x80 and 0x40 are reserved + return "", lenmsg, ErrRdata + } + } + if ptr == 0 { + off1 = off + } + if len(s) == 0 { + s = []byte(".") + } + return string(s), off1, nil +} + +func packTxt(txt []string, msg []byte, offset int, tmp []byte) (int, error) { + if len(txt) == 0 { + if offset >= len(msg) { + return offset, ErrBuf + } + msg[offset] = 0 + return offset, nil + } + var err error + for i := range txt { + if len(txt[i]) > len(tmp) { + return offset, ErrBuf + } + offset, err = packTxtString(txt[i], msg, offset, tmp) + if err != nil { + return offset, err + } + } + return offset, nil +} + +func packTxtString(s string, msg []byte, offset int, tmp []byte) (int, error) { + lenByteOffset := offset + if offset >= len(msg) || len(s) > len(tmp) { + return offset, ErrBuf + } + offset++ + bs := tmp[:len(s)] + copy(bs, s) + for i := 0; i < len(bs); i++ { + if len(msg) <= offset { + return offset, ErrBuf + } + if bs[i] == '\\' { + i++ + if i == len(bs) { + break + } + // check for \DDD + if i+2 < len(bs) && isDigit(bs[i]) && isDigit(bs[i+1]) && isDigit(bs[i+2]) { + msg[offset] = dddToByte(bs[i:]) + i += 2 + } else if bs[i] == 't' { + msg[offset] = '\t' + } else if bs[i] == 'r' { + msg[offset] = '\r' + } else if bs[i] == 'n' { + msg[offset] = '\n' + } else { + msg[offset] = bs[i] + } + } else { + msg[offset] = bs[i] + } + offset++ + } + l := offset - lenByteOffset - 1 + if l > 255 { + return offset, &Error{err: "string exceeded 255 bytes in txt"} + } + msg[lenByteOffset] = byte(l) + return offset, nil +} + +func packOctetString(s string, msg []byte, offset int, tmp []byte) (int, error) { + if offset >= len(msg) || len(s) > len(tmp) { + return offset, ErrBuf + } + bs := tmp[:len(s)] + copy(bs, s) + for i := 0; i < len(bs); i++ { + if len(msg) <= offset { + return offset, ErrBuf + } + if bs[i] == '\\' { + i++ + if i == len(bs) { + break + } + // check for \DDD + if i+2 < len(bs) && isDigit(bs[i]) && isDigit(bs[i+1]) && isDigit(bs[i+2]) { + msg[offset] = dddToByte(bs[i:]) + i += 2 + } else { + msg[offset] = bs[i] + } + } else { + msg[offset] = bs[i] + } + offset++ + } + return offset, nil +} + +func unpackTxt(msg []byte, off0 int) (ss []string, off int, err error) { + off = off0 + var s string + for off < len(msg) && err == nil { + s, off, err = unpackTxtString(msg, off) + if err == nil { + ss = append(ss, s) + } + } + return +} + +func unpackTxtString(msg []byte, offset int) (string, int, error) { + if offset+1 > len(msg) { + return "", offset, &Error{err: "overflow unpacking txt"} + } + l := int(msg[offset]) + if offset+l+1 > len(msg) { + return "", offset, &Error{err: "overflow unpacking txt"} + } + s := make([]byte, 0, l) + for _, b := range msg[offset+1 : offset+1+l] { + switch b { + case '"', '\\': + s = append(s, '\\', b) + case '\t': + s = append(s, `\t`...) + case '\r': + s = append(s, `\r`...) + case '\n': + s = append(s, `\n`...) + default: + if b < 32 || b > 127 { // unprintable + var buf [3]byte + bufs := strconv.AppendInt(buf[:0], int64(b), 10) + s = append(s, '\\') + for i := 0; i < 3-len(bufs); i++ { + s = append(s, '0') + } + for _, r := range bufs { + s = append(s, r) + } + } else { + s = append(s, b) + } + } + } + offset += 1 + l + return string(s), offset, nil +} + +// Helpers for dealing with escaped bytes +func isDigit(b byte) bool { return b >= '0' && b <= '9' } + +func dddToByte(s []byte) byte { + return byte((s[0]-'0')*100 + (s[1]-'0')*10 + (s[2] - '0')) +} + +// Helper function for packing and unpacking +func intToBytes(i *big.Int, length int) []byte { + buf := i.Bytes() + if len(buf) < length { + b := make([]byte, length) + copy(b[length-len(buf):], buf) + return b + } + return buf +} + +// PackRR packs a resource record rr into msg[off:]. +// See PackDomainName for documentation about the compression. +func PackRR(rr RR, msg []byte, off int, compression map[string]int, compress bool) (off1 int, err error) { + if rr == nil { + return len(msg), &Error{err: "nil rr"} + } + + off1, err = rr.pack(msg, off, compression, compress) + if err != nil { + return len(msg), err + } + // TODO(miek): Not sure if this is needed? If removed we can remove rawmsg.go as well. + if rawSetRdlength(msg, off, off1) { + return off1, nil + } + return off, ErrRdata +} + +// UnpackRR unpacks msg[off:] into an RR. +func UnpackRR(msg []byte, off int) (rr RR, off1 int, err error) { + h, off, msg, err := unpackHeader(msg, off) + if err != nil { + return nil, len(msg), err + } + end := off + int(h.Rdlength) + + if fn, known := typeToUnpack[h.Rrtype]; !known { + rr, off, err = unpackRFC3597(h, msg, off) + } else { + rr, off, err = fn(h, msg, off) + } + if off != end { + return &h, end, &Error{err: "bad rdlength"} + } + return rr, off, err +} + +// unpackRRslice unpacks msg[off:] into an []RR. +// If we cannot unpack the whole array, then it will return nil +func unpackRRslice(l int, msg []byte, off int) (dst1 []RR, off1 int, err error) { + var r RR + // Optimistically make dst be the length that was sent + dst := make([]RR, 0, l) + for i := 0; i < l; i++ { + off1 := off + r, off, err = UnpackRR(msg, off) + if err != nil { + off = len(msg) + break + } + // If offset does not increase anymore, l is a lie + if off1 == off { + l = i + break + } + dst = append(dst, r) + } + if err != nil && off == len(msg) { + dst = nil + } + return dst, off, err +} + +// Convert a MsgHdr to a string, with dig-like headers: +// +//;; opcode: QUERY, status: NOERROR, id: 48404 +// +//;; flags: qr aa rd ra; +func (h *MsgHdr) String() string { + if h == nil { + return " MsgHdr" + } + + s := ";; opcode: " + OpcodeToString[h.Opcode] + s += ", status: " + RcodeToString[h.Rcode] + s += ", id: " + strconv.Itoa(int(h.Id)) + "\n" + + s += ";; flags:" + if h.Response { + s += " qr" + } + if h.Authoritative { + s += " aa" + } + if h.Truncated { + s += " tc" + } + if h.RecursionDesired { + s += " rd" + } + if h.RecursionAvailable { + s += " ra" + } + if h.Zero { // Hmm + s += " z" + } + if h.AuthenticatedData { + s += " ad" + } + if h.CheckingDisabled { + s += " cd" + } + + s += ";" + return s +} + +// Pack packs a Msg: it is converted to to wire format. +// If the dns.Compress is true the message will be in compressed wire format. +func (dns *Msg) Pack() (msg []byte, err error) { + return dns.PackBuffer(nil) +} + +// PackBuffer packs a Msg, using the given buffer buf. If buf is too small +// a new buffer is allocated. +func (dns *Msg) PackBuffer(buf []byte) (msg []byte, err error) { + // We use a similar function in tsig.go's stripTsig. + var ( + dh Header + compression map[string]int + ) + + if dns.Compress { + compression = make(map[string]int) // Compression pointer mappings + } + + if dns.Rcode < 0 || dns.Rcode > 0xFFF { + return nil, ErrRcode + } + if dns.Rcode > 0xF { + // Regular RCODE field is 4 bits + opt := dns.IsEdns0() + if opt == nil { + return nil, ErrExtendedRcode + } + opt.SetExtendedRcode(uint8(dns.Rcode >> 4)) + dns.Rcode &= 0xF + } + + // Convert convenient Msg into wire-like Header. + dh.Id = dns.Id + dh.Bits = uint16(dns.Opcode)<<11 | uint16(dns.Rcode) + if dns.Response { + dh.Bits |= _QR + } + if dns.Authoritative { + dh.Bits |= _AA + } + if dns.Truncated { + dh.Bits |= _TC + } + if dns.RecursionDesired { + dh.Bits |= _RD + } + if dns.RecursionAvailable { + dh.Bits |= _RA + } + if dns.Zero { + dh.Bits |= _Z + } + if dns.AuthenticatedData { + dh.Bits |= _AD + } + if dns.CheckingDisabled { + dh.Bits |= _CD + } + + // Prepare variable sized arrays. + question := dns.Question + answer := dns.Answer + ns := dns.Ns + extra := dns.Extra + + dh.Qdcount = uint16(len(question)) + dh.Ancount = uint16(len(answer)) + dh.Nscount = uint16(len(ns)) + dh.Arcount = uint16(len(extra)) + + // We need the uncompressed length here, because we first pack it and then compress it. + msg = buf + compress := dns.Compress + dns.Compress = false + if packLen := dns.Len() + 1; len(msg) < packLen { + msg = make([]byte, packLen) + } + dns.Compress = compress + + // Pack it in: header and then the pieces. + off := 0 + off, err = dh.pack(msg, off, compression, dns.Compress) + if err != nil { + return nil, err + } + for i := 0; i < len(question); i++ { + off, err = question[i].pack(msg, off, compression, dns.Compress) + if err != nil { + return nil, err + } + } + for i := 0; i < len(answer); i++ { + off, err = PackRR(answer[i], msg, off, compression, dns.Compress) + if err != nil { + return nil, err + } + } + for i := 0; i < len(ns); i++ { + off, err = PackRR(ns[i], msg, off, compression, dns.Compress) + if err != nil { + return nil, err + } + } + for i := 0; i < len(extra); i++ { + off, err = PackRR(extra[i], msg, off, compression, dns.Compress) + if err != nil { + return nil, err + } + } + return msg[:off], nil +} + +// Unpack unpacks a binary message to a Msg structure. +func (dns *Msg) Unpack(msg []byte) (err error) { + var ( + dh Header + off int + ) + if dh, off, err = unpackMsgHdr(msg, off); err != nil { + return err + } + if off == len(msg) { + return ErrTruncated + } + + dns.Id = dh.Id + dns.Response = (dh.Bits & _QR) != 0 + dns.Opcode = int(dh.Bits>>11) & 0xF + dns.Authoritative = (dh.Bits & _AA) != 0 + dns.Truncated = (dh.Bits & _TC) != 0 + dns.RecursionDesired = (dh.Bits & _RD) != 0 + dns.RecursionAvailable = (dh.Bits & _RA) != 0 + dns.Zero = (dh.Bits & _Z) != 0 + dns.AuthenticatedData = (dh.Bits & _AD) != 0 + dns.CheckingDisabled = (dh.Bits & _CD) != 0 + dns.Rcode = int(dh.Bits & 0xF) + + // Optimistically use the count given to us in the header + dns.Question = make([]Question, 0, int(dh.Qdcount)) + + for i := 0; i < int(dh.Qdcount); i++ { + off1 := off + var q Question + q, off, err = unpackQuestion(msg, off) + if err != nil { + // Even if Truncated is set, we only will set ErrTruncated if we + // actually got the questions + return err + } + if off1 == off { // Offset does not increase anymore, dh.Qdcount is a lie! + dh.Qdcount = uint16(i) + break + } + dns.Question = append(dns.Question, q) + } + + dns.Answer, off, err = unpackRRslice(int(dh.Ancount), msg, off) + // The header counts might have been wrong so we need to update it + dh.Ancount = uint16(len(dns.Answer)) + if err == nil { + dns.Ns, off, err = unpackRRslice(int(dh.Nscount), msg, off) + } + // The header counts might have been wrong so we need to update it + dh.Nscount = uint16(len(dns.Ns)) + if err == nil { + dns.Extra, off, err = unpackRRslice(int(dh.Arcount), msg, off) + } + // The header counts might have been wrong so we need to update it + dh.Arcount = uint16(len(dns.Extra)) + + if off != len(msg) { + // TODO(miek) make this an error? + // use PackOpt to let people tell how detailed the error reporting should be? + // println("dns: extra bytes in dns packet", off, "<", len(msg)) + } else if dns.Truncated { + // Whether we ran into a an error or not, we want to return that it + // was truncated + err = ErrTruncated + } + return err +} + +// Convert a complete message to a string with dig-like output. +func (dns *Msg) String() string { + if dns == nil { + return " MsgHdr" + } + s := dns.MsgHdr.String() + " " + s += "QUERY: " + strconv.Itoa(len(dns.Question)) + ", " + s += "ANSWER: " + strconv.Itoa(len(dns.Answer)) + ", " + s += "AUTHORITY: " + strconv.Itoa(len(dns.Ns)) + ", " + s += "ADDITIONAL: " + strconv.Itoa(len(dns.Extra)) + "\n" + if len(dns.Question) > 0 { + s += "\n;; QUESTION SECTION:\n" + for i := 0; i < len(dns.Question); i++ { + s += dns.Question[i].String() + "\n" + } + } + if len(dns.Answer) > 0 { + s += "\n;; ANSWER SECTION:\n" + for i := 0; i < len(dns.Answer); i++ { + if dns.Answer[i] != nil { + s += dns.Answer[i].String() + "\n" + } + } + } + if len(dns.Ns) > 0 { + s += "\n;; AUTHORITY SECTION:\n" + for i := 0; i < len(dns.Ns); i++ { + if dns.Ns[i] != nil { + s += dns.Ns[i].String() + "\n" + } + } + } + if len(dns.Extra) > 0 { + s += "\n;; ADDITIONAL SECTION:\n" + for i := 0; i < len(dns.Extra); i++ { + if dns.Extra[i] != nil { + s += dns.Extra[i].String() + "\n" + } + } + } + return s +} + +// Len returns the message length when in (un)compressed wire format. +// If dns.Compress is true compression it is taken into account. Len() +// is provided to be a faster way to get the size of the resulting packet, +// than packing it, measuring the size and discarding the buffer. +func (dns *Msg) Len() int { + // We always return one more than needed. + l := 12 // Message header is always 12 bytes + var compression map[string]int + if dns.Compress { + compression = make(map[string]int) + } + for i := 0; i < len(dns.Question); i++ { + l += dns.Question[i].len() + if dns.Compress { + compressionLenHelper(compression, dns.Question[i].Name) + } + } + for i := 0; i < len(dns.Answer); i++ { + if dns.Answer[i] == nil { + continue + } + l += dns.Answer[i].len() + if dns.Compress { + k, ok := compressionLenSearch(compression, dns.Answer[i].Header().Name) + if ok { + l += 1 - k + } + compressionLenHelper(compression, dns.Answer[i].Header().Name) + k, ok = compressionLenSearchType(compression, dns.Answer[i]) + if ok { + l += 1 - k + } + compressionLenHelperType(compression, dns.Answer[i]) + } + } + for i := 0; i < len(dns.Ns); i++ { + if dns.Ns[i] == nil { + continue + } + l += dns.Ns[i].len() + if dns.Compress { + k, ok := compressionLenSearch(compression, dns.Ns[i].Header().Name) + if ok { + l += 1 - k + } + compressionLenHelper(compression, dns.Ns[i].Header().Name) + k, ok = compressionLenSearchType(compression, dns.Ns[i]) + if ok { + l += 1 - k + } + compressionLenHelperType(compression, dns.Ns[i]) + } + } + for i := 0; i < len(dns.Extra); i++ { + if dns.Extra[i] == nil { + continue + } + l += dns.Extra[i].len() + if dns.Compress { + k, ok := compressionLenSearch(compression, dns.Extra[i].Header().Name) + if ok { + l += 1 - k + } + compressionLenHelper(compression, dns.Extra[i].Header().Name) + k, ok = compressionLenSearchType(compression, dns.Extra[i]) + if ok { + l += 1 - k + } + compressionLenHelperType(compression, dns.Extra[i]) + } + } + return l +} + +// Put the parts of the name in the compression map. +func compressionLenHelper(c map[string]int, s string) { + pref := "" + lbs := Split(s) + for j := len(lbs) - 1; j >= 0; j-- { + pref = s[lbs[j]:] + if _, ok := c[pref]; !ok { + c[pref] = len(pref) + } + } +} + +// Look for each part in the compression map and returns its length, +// keep on searching so we get the longest match. +func compressionLenSearch(c map[string]int, s string) (int, bool) { + off := 0 + end := false + if s == "" { // don't bork on bogus data + return 0, false + } + for { + if _, ok := c[s[off:]]; ok { + return len(s[off:]), true + } + if end { + break + } + off, end = NextLabel(s, off) + } + return 0, false +} + +// TODO(miek): should add all types, because the all can be *used* for compression. Autogenerate from msg_generate and put in zmsg.go +func compressionLenHelperType(c map[string]int, r RR) { + switch x := r.(type) { + case *NS: + compressionLenHelper(c, x.Ns) + case *MX: + compressionLenHelper(c, x.Mx) + case *CNAME: + compressionLenHelper(c, x.Target) + case *PTR: + compressionLenHelper(c, x.Ptr) + case *SOA: + compressionLenHelper(c, x.Ns) + compressionLenHelper(c, x.Mbox) + case *MB: + compressionLenHelper(c, x.Mb) + case *MG: + compressionLenHelper(c, x.Mg) + case *MR: + compressionLenHelper(c, x.Mr) + case *MF: + compressionLenHelper(c, x.Mf) + case *MD: + compressionLenHelper(c, x.Md) + case *RT: + compressionLenHelper(c, x.Host) + case *RP: + compressionLenHelper(c, x.Mbox) + compressionLenHelper(c, x.Txt) + case *MINFO: + compressionLenHelper(c, x.Rmail) + compressionLenHelper(c, x.Email) + case *AFSDB: + compressionLenHelper(c, x.Hostname) + case *SRV: + compressionLenHelper(c, x.Target) + case *NAPTR: + compressionLenHelper(c, x.Replacement) + case *RRSIG: + compressionLenHelper(c, x.SignerName) + case *NSEC: + compressionLenHelper(c, x.NextDomain) + // HIP? + } +} + +// Only search on compressing these types. +func compressionLenSearchType(c map[string]int, r RR) (int, bool) { + switch x := r.(type) { + case *NS: + return compressionLenSearch(c, x.Ns) + case *MX: + return compressionLenSearch(c, x.Mx) + case *CNAME: + return compressionLenSearch(c, x.Target) + case *DNAME: + return compressionLenSearch(c, x.Target) + case *PTR: + return compressionLenSearch(c, x.Ptr) + case *SOA: + k, ok := compressionLenSearch(c, x.Ns) + k1, ok1 := compressionLenSearch(c, x.Mbox) + if !ok && !ok1 { + return 0, false + } + return k + k1, true + case *MB: + return compressionLenSearch(c, x.Mb) + case *MG: + return compressionLenSearch(c, x.Mg) + case *MR: + return compressionLenSearch(c, x.Mr) + case *MF: + return compressionLenSearch(c, x.Mf) + case *MD: + return compressionLenSearch(c, x.Md) + case *RT: + return compressionLenSearch(c, x.Host) + case *MINFO: + k, ok := compressionLenSearch(c, x.Rmail) + k1, ok1 := compressionLenSearch(c, x.Email) + if !ok && !ok1 { + return 0, false + } + return k + k1, true + case *AFSDB: + return compressionLenSearch(c, x.Hostname) + } + return 0, false +} + +// Copy returns a new RR which is a deep-copy of r. +func Copy(r RR) RR { r1 := r.copy(); return r1 } + +// Len returns the length (in octets) of the uncompressed RR in wire format. +func Len(r RR) int { return r.len() } + +// Copy returns a new *Msg which is a deep-copy of dns. +func (dns *Msg) Copy() *Msg { return dns.CopyTo(new(Msg)) } + +// CopyTo copies the contents to the provided message using a deep-copy and returns the copy. +func (dns *Msg) CopyTo(r1 *Msg) *Msg { + r1.MsgHdr = dns.MsgHdr + r1.Compress = dns.Compress + + if len(dns.Question) > 0 { + r1.Question = make([]Question, len(dns.Question)) + copy(r1.Question, dns.Question) // TODO(miek): Question is an immutable value, ok to do a shallow-copy + } + + rrArr := make([]RR, len(dns.Answer)+len(dns.Ns)+len(dns.Extra)) + var rri int + + if len(dns.Answer) > 0 { + rrbegin := rri + for i := 0; i < len(dns.Answer); i++ { + rrArr[rri] = dns.Answer[i].copy() + rri++ + } + r1.Answer = rrArr[rrbegin:rri:rri] + } + + if len(dns.Ns) > 0 { + rrbegin := rri + for i := 0; i < len(dns.Ns); i++ { + rrArr[rri] = dns.Ns[i].copy() + rri++ + } + r1.Ns = rrArr[rrbegin:rri:rri] + } + + if len(dns.Extra) > 0 { + rrbegin := rri + for i := 0; i < len(dns.Extra); i++ { + rrArr[rri] = dns.Extra[i].copy() + rri++ + } + r1.Extra = rrArr[rrbegin:rri:rri] + } + + return r1 +} + +func (q *Question) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := PackDomainName(q.Name, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = packUint16(q.Qtype, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(q.Qclass, msg, off) + if err != nil { + return off, err + } + return off, nil +} + +func unpackQuestion(msg []byte, off int) (Question, int, error) { + var ( + q Question + err error + ) + q.Name, off, err = UnpackDomainName(msg, off) + if err != nil { + return q, off, err + } + if off == len(msg) { + return q, off, nil + } + q.Qtype, off, err = unpackUint16(msg, off) + if err != nil { + return q, off, err + } + if off == len(msg) { + return q, off, nil + } + q.Qclass, off, err = unpackUint16(msg, off) + if off == len(msg) { + return q, off, nil + } + return q, off, err +} + +func (dh *Header) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := packUint16(dh.Id, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(dh.Bits, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(dh.Qdcount, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(dh.Ancount, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(dh.Nscount, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(dh.Arcount, msg, off) + return off, err +} + +func unpackMsgHdr(msg []byte, off int) (Header, int, error) { + var ( + dh Header + err error + ) + dh.Id, off, err = unpackUint16(msg, off) + if err != nil { + return dh, off, err + } + dh.Bits, off, err = unpackUint16(msg, off) + if err != nil { + return dh, off, err + } + dh.Qdcount, off, err = unpackUint16(msg, off) + if err != nil { + return dh, off, err + } + dh.Ancount, off, err = unpackUint16(msg, off) + if err != nil { + return dh, off, err + } + dh.Nscount, off, err = unpackUint16(msg, off) + if err != nil { + return dh, off, err + } + dh.Arcount, off, err = unpackUint16(msg, off) + return dh, off, err +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/msg_generate.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/msg_generate.go new file mode 100644 index 00000000..166b3af0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/msg_generate.go @@ -0,0 +1,337 @@ +//+build ignore + +// msg_generate.go is meant to run with go generate. It will use +// go/{importer,types} to track down all the RR struct types. Then for each type +// it will generate pack/unpack methods based on the struct tags. The generated source is +// written to zmsg.go, and is meant to be checked into git. +package main + +import ( + "bytes" + "fmt" + "go/format" + "go/importer" + "go/types" + "log" + "os" + "strings" +) + +var packageHdr = ` +// *** DO NOT MODIFY *** +// AUTOGENERATED BY go generate from msg_generate.go + +package dns + +` + +// getTypeStruct will take a type and the package scope, and return the +// (innermost) struct if the type is considered a RR type (currently defined as +// those structs beginning with a RR_Header, could be redefined as implementing +// the RR interface). The bool return value indicates if embedded structs were +// resolved. +func getTypeStruct(t types.Type, scope *types.Scope) (*types.Struct, bool) { + st, ok := t.Underlying().(*types.Struct) + if !ok { + return nil, false + } + if st.Field(0).Type() == scope.Lookup("RR_Header").Type() { + return st, false + } + if st.Field(0).Anonymous() { + st, _ := getTypeStruct(st.Field(0).Type(), scope) + return st, true + } + return nil, false +} + +func main() { + // Import and type-check the package + pkg, err := importer.Default().Import("github.com/miekg/dns") + fatalIfErr(err) + scope := pkg.Scope() + + // Collect actual types (*X) + var namedTypes []string + for _, name := range scope.Names() { + o := scope.Lookup(name) + if o == nil || !o.Exported() { + continue + } + if st, _ := getTypeStruct(o.Type(), scope); st == nil { + continue + } + if name == "PrivateRR" { + continue + } + + // Check if corresponding TypeX exists + if scope.Lookup("Type"+o.Name()) == nil && o.Name() != "RFC3597" { + log.Fatalf("Constant Type%s does not exist.", o.Name()) + } + + namedTypes = append(namedTypes, o.Name()) + } + + b := &bytes.Buffer{} + b.WriteString(packageHdr) + + fmt.Fprint(b, "// pack*() functions\n\n") + for _, name := range namedTypes { + o := scope.Lookup(name) + st, _ := getTypeStruct(o.Type(), scope) + + fmt.Fprintf(b, "func (rr *%s) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) {\n", name) + fmt.Fprint(b, `off, err := rr.Hdr.pack(msg, off, compression, compress) +if err != nil { + return off, err +} +headerEnd := off +`) + for i := 1; i < st.NumFields(); i++ { + o := func(s string) { + fmt.Fprintf(b, s, st.Field(i).Name()) + fmt.Fprint(b, `if err != nil { +return off, err +} +`) + } + + if _, ok := st.Field(i).Type().(*types.Slice); ok { + switch st.Tag(i) { + case `dns:"-"`: // ignored + case `dns:"txt"`: + o("off, err = packStringTxt(rr.%s, msg, off)\n") + case `dns:"opt"`: + o("off, err = packDataOpt(rr.%s, msg, off)\n") + case `dns:"nsec"`: + o("off, err = packDataNsec(rr.%s, msg, off)\n") + case `dns:"domain-name"`: + o("off, err = packDataDomainNames(rr.%s, msg, off, compression, compress)\n") + default: + log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) + } + continue + } + + switch { + case st.Tag(i) == `dns:"-"`: // ignored + case st.Tag(i) == `dns:"cdomain-name"`: + fallthrough + case st.Tag(i) == `dns:"domain-name"`: + o("off, err = PackDomainName(rr.%s, msg, off, compression, compress)\n") + case st.Tag(i) == `dns:"a"`: + o("off, err = packDataA(rr.%s, msg, off)\n") + case st.Tag(i) == `dns:"aaaa"`: + o("off, err = packDataAAAA(rr.%s, msg, off)\n") + case st.Tag(i) == `dns:"uint48"`: + o("off, err = packUint48(rr.%s, msg, off)\n") + case st.Tag(i) == `dns:"txt"`: + o("off, err = packString(rr.%s, msg, off)\n") + + case strings.HasPrefix(st.Tag(i), `dns:"size-base32`): // size-base32 can be packed just like base32 + fallthrough + case st.Tag(i) == `dns:"base32"`: + o("off, err = packStringBase32(rr.%s, msg, off)\n") + + case strings.HasPrefix(st.Tag(i), `dns:"size-base64`): // size-base64 can be packed just like base64 + fallthrough + case st.Tag(i) == `dns:"base64"`: + o("off, err = packStringBase64(rr.%s, msg, off)\n") + + case strings.HasPrefix(st.Tag(i), `dns:"size-hex`): // size-hex can be packed just like hex + fallthrough + case st.Tag(i) == `dns:"hex"`: + o("off, err = packStringHex(rr.%s, msg, off)\n") + + case st.Tag(i) == `dns:"octet"`: + o("off, err = packStringOctet(rr.%s, msg, off)\n") + case st.Tag(i) == "": + switch st.Field(i).Type().(*types.Basic).Kind() { + case types.Uint8: + o("off, err = packUint8(rr.%s, msg, off)\n") + case types.Uint16: + o("off, err = packUint16(rr.%s, msg, off)\n") + case types.Uint32: + o("off, err = packUint32(rr.%s, msg, off)\n") + case types.Uint64: + o("off, err = packUint64(rr.%s, msg, off)\n") + case types.String: + o("off, err = packString(rr.%s, msg, off)\n") + default: + log.Fatalln(name, st.Field(i).Name()) + } + default: + log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) + } + } + // We have packed everything, only now we know the rdlength of this RR + fmt.Fprintln(b, "rr.Header().Rdlength = uint16(off- headerEnd)") + fmt.Fprintln(b, "return off, nil }\n") + } + + fmt.Fprint(b, "// unpack*() functions\n\n") + for _, name := range namedTypes { + o := scope.Lookup(name) + st, _ := getTypeStruct(o.Type(), scope) + + fmt.Fprintf(b, "func unpack%s(h RR_Header, msg []byte, off int) (RR, int, error) {\n", name) + fmt.Fprintf(b, "rr := new(%s)\n", name) + fmt.Fprint(b, "rr.Hdr = h\n") + fmt.Fprint(b, `if noRdata(h) { +return rr, off, nil + } +var err error +rdStart := off +_ = rdStart + +`) + for i := 1; i < st.NumFields(); i++ { + o := func(s string) { + fmt.Fprintf(b, s, st.Field(i).Name()) + fmt.Fprint(b, `if err != nil { +return rr, off, err +} +`) + } + + // size-* are special, because they reference a struct member we should use for the length. + if strings.HasPrefix(st.Tag(i), `dns:"size-`) { + structMember := structMember(st.Tag(i)) + structTag := structTag(st.Tag(i)) + switch structTag { + case "hex": + fmt.Fprintf(b, "rr.%s, off, err = unpackStringHex(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember) + case "base32": + fmt.Fprintf(b, "rr.%s, off, err = unpackStringBase32(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember) + case "base64": + fmt.Fprintf(b, "rr.%s, off, err = unpackStringBase64(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember) + default: + log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) + } + fmt.Fprint(b, `if err != nil { +return rr, off, err +} +`) + continue + } + + if _, ok := st.Field(i).Type().(*types.Slice); ok { + switch st.Tag(i) { + case `dns:"-"`: // ignored + case `dns:"txt"`: + o("rr.%s, off, err = unpackStringTxt(msg, off)\n") + case `dns:"opt"`: + o("rr.%s, off, err = unpackDataOpt(msg, off)\n") + case `dns:"nsec"`: + o("rr.%s, off, err = unpackDataNsec(msg, off)\n") + case `dns:"domain-name"`: + o("rr.%s, off, err = unpackDataDomainNames(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") + default: + log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) + } + continue + } + + switch st.Tag(i) { + case `dns:"-"`: // ignored + case `dns:"cdomain-name"`: + fallthrough + case `dns:"domain-name"`: + o("rr.%s, off, err = UnpackDomainName(msg, off)\n") + case `dns:"a"`: + o("rr.%s, off, err = unpackDataA(msg, off)\n") + case `dns:"aaaa"`: + o("rr.%s, off, err = unpackDataAAAA(msg, off)\n") + case `dns:"uint48"`: + o("rr.%s, off, err = unpackUint48(msg, off)\n") + case `dns:"txt"`: + o("rr.%s, off, err = unpackString(msg, off)\n") + case `dns:"base32"`: + o("rr.%s, off, err = unpackStringBase32(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") + case `dns:"base64"`: + o("rr.%s, off, err = unpackStringBase64(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") + case `dns:"hex"`: + o("rr.%s, off, err = unpackStringHex(msg, off, rdStart + int(rr.Hdr.Rdlength))\n") + case `dns:"octet"`: + o("rr.%s, off, err = unpackStringOctet(msg, off)\n") + case "": + switch st.Field(i).Type().(*types.Basic).Kind() { + case types.Uint8: + o("rr.%s, off, err = unpackUint8(msg, off)\n") + case types.Uint16: + o("rr.%s, off, err = unpackUint16(msg, off)\n") + case types.Uint32: + o("rr.%s, off, err = unpackUint32(msg, off)\n") + case types.Uint64: + o("rr.%s, off, err = unpackUint64(msg, off)\n") + case types.String: + o("rr.%s, off, err = unpackString(msg, off)\n") + default: + log.Fatalln(name, st.Field(i).Name()) + } + default: + log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) + } + // If we've hit len(msg) we return without error. + if i < st.NumFields()-1 { + fmt.Fprintf(b, `if off == len(msg) { +return rr, off, nil + } +`) + } + } + fmt.Fprintf(b, "return rr, off, err }\n\n") + } + // Generate typeToUnpack map + fmt.Fprintln(b, "var typeToUnpack = map[uint16]func(RR_Header, []byte, int) (RR, int, error){") + for _, name := range namedTypes { + if name == "RFC3597" { + continue + } + fmt.Fprintf(b, "Type%s: unpack%s,\n", name, name) + } + fmt.Fprintln(b, "}\n") + + // gofmt + res, err := format.Source(b.Bytes()) + if err != nil { + b.WriteTo(os.Stderr) + log.Fatal(err) + } + + // write result + f, err := os.Create("zmsg.go") + fatalIfErr(err) + defer f.Close() + f.Write(res) +} + +// structMember will take a tag like dns:"size-base32:SaltLength" and return the last part of this string. +func structMember(s string) string { + fields := strings.Split(s, ":") + if len(fields) == 0 { + return "" + } + f := fields[len(fields)-1] + // f should have a closing " + if len(f) > 1 { + return f[:len(f)-1] + } + return f +} + +// structTag will take a tag like dns:"size-base32:SaltLength" and return base32. +func structTag(s string) string { + fields := strings.Split(s, ":") + if len(fields) < 2 { + return "" + } + return fields[1][len("\"size-"):] +} + +func fatalIfErr(err error) { + if err != nil { + log.Fatal(err) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/msg_helpers.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/msg_helpers.go new file mode 100644 index 00000000..e7a9500c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/msg_helpers.go @@ -0,0 +1,630 @@ +package dns + +import ( + "encoding/base32" + "encoding/base64" + "encoding/binary" + "encoding/hex" + "net" + "strconv" +) + +// helper functions called from the generated zmsg.go + +// These function are named after the tag to help pack/unpack, if there is no tag it is the name +// of the type they pack/unpack (string, int, etc). We prefix all with unpackData or packData, so packDataA or +// packDataDomainName. + +func unpackDataA(msg []byte, off int) (net.IP, int, error) { + if off+net.IPv4len > len(msg) { + return nil, len(msg), &Error{err: "overflow unpacking a"} + } + a := append(make(net.IP, 0, net.IPv4len), msg[off:off+net.IPv4len]...) + off += net.IPv4len + return a, off, nil +} + +func packDataA(a net.IP, msg []byte, off int) (int, error) { + // It must be a slice of 4, even if it is 16, we encode only the first 4 + if off+net.IPv4len > len(msg) { + return len(msg), &Error{err: "overflow packing a"} + } + switch len(a) { + case net.IPv4len, net.IPv6len: + copy(msg[off:], a.To4()) + off += net.IPv4len + case 0: + // Allowed, for dynamic updates. + default: + return len(msg), &Error{err: "overflow packing a"} + } + return off, nil +} + +func unpackDataAAAA(msg []byte, off int) (net.IP, int, error) { + if off+net.IPv6len > len(msg) { + return nil, len(msg), &Error{err: "overflow unpacking aaaa"} + } + aaaa := append(make(net.IP, 0, net.IPv6len), msg[off:off+net.IPv6len]...) + off += net.IPv6len + return aaaa, off, nil +} + +func packDataAAAA(aaaa net.IP, msg []byte, off int) (int, error) { + if off+net.IPv6len > len(msg) { + return len(msg), &Error{err: "overflow packing aaaa"} + } + + switch len(aaaa) { + case net.IPv6len: + copy(msg[off:], aaaa) + off += net.IPv6len + case 0: + // Allowed, dynamic updates. + default: + return len(msg), &Error{err: "overflow packing aaaa"} + } + return off, nil +} + +// unpackHeader unpacks an RR header, returning the offset to the end of the header and a +// re-sliced msg according to the expected length of the RR. +func unpackHeader(msg []byte, off int) (rr RR_Header, off1 int, truncmsg []byte, err error) { + hdr := RR_Header{} + if off == len(msg) { + return hdr, off, msg, nil + } + + hdr.Name, off, err = UnpackDomainName(msg, off) + if err != nil { + return hdr, len(msg), msg, err + } + hdr.Rrtype, off, err = unpackUint16(msg, off) + if err != nil { + return hdr, len(msg), msg, err + } + hdr.Class, off, err = unpackUint16(msg, off) + if err != nil { + return hdr, len(msg), msg, err + } + hdr.Ttl, off, err = unpackUint32(msg, off) + if err != nil { + return hdr, len(msg), msg, err + } + hdr.Rdlength, off, err = unpackUint16(msg, off) + if err != nil { + return hdr, len(msg), msg, err + } + msg, err = truncateMsgFromRdlength(msg, off, hdr.Rdlength) + return hdr, off, msg, nil +} + +// pack packs an RR header, returning the offset to the end of the header. +// See PackDomainName for documentation about the compression. +func (hdr RR_Header) pack(msg []byte, off int, compression map[string]int, compress bool) (off1 int, err error) { + if off == len(msg) { + return off, nil + } + + off, err = PackDomainName(hdr.Name, msg, off, compression, compress) + if err != nil { + return len(msg), err + } + off, err = packUint16(hdr.Rrtype, msg, off) + if err != nil { + return len(msg), err + } + off, err = packUint16(hdr.Class, msg, off) + if err != nil { + return len(msg), err + } + off, err = packUint32(hdr.Ttl, msg, off) + if err != nil { + return len(msg), err + } + off, err = packUint16(hdr.Rdlength, msg, off) + if err != nil { + return len(msg), err + } + return off, nil +} + +// helper helper functions. + +// truncateMsgFromRdLength truncates msg to match the expected length of the RR. +// Returns an error if msg is smaller than the expected size. +func truncateMsgFromRdlength(msg []byte, off int, rdlength uint16) (truncmsg []byte, err error) { + lenrd := off + int(rdlength) + if lenrd > len(msg) { + return msg, &Error{err: "overflowing header size"} + } + return msg[:lenrd], nil +} + +func fromBase32(s []byte) (buf []byte, err error) { + buflen := base32.HexEncoding.DecodedLen(len(s)) + buf = make([]byte, buflen) + n, err := base32.HexEncoding.Decode(buf, s) + buf = buf[:n] + return +} + +func toBase32(b []byte) string { return base32.HexEncoding.EncodeToString(b) } + +func fromBase64(s []byte) (buf []byte, err error) { + buflen := base64.StdEncoding.DecodedLen(len(s)) + buf = make([]byte, buflen) + n, err := base64.StdEncoding.Decode(buf, s) + buf = buf[:n] + return +} + +func toBase64(b []byte) string { return base64.StdEncoding.EncodeToString(b) } + +// dynamicUpdate returns true if the Rdlength is zero. +func noRdata(h RR_Header) bool { return h.Rdlength == 0 } + +func unpackUint8(msg []byte, off int) (i uint8, off1 int, err error) { + if off+1 > len(msg) { + return 0, len(msg), &Error{err: "overflow unpacking uint8"} + } + return uint8(msg[off]), off + 1, nil +} + +func packUint8(i uint8, msg []byte, off int) (off1 int, err error) { + if off+1 > len(msg) { + return len(msg), &Error{err: "overflow packing uint8"} + } + msg[off] = byte(i) + return off + 1, nil +} + +func unpackUint16(msg []byte, off int) (i uint16, off1 int, err error) { + if off+2 > len(msg) { + return 0, len(msg), &Error{err: "overflow unpacking uint16"} + } + return binary.BigEndian.Uint16(msg[off:]), off + 2, nil +} + +func packUint16(i uint16, msg []byte, off int) (off1 int, err error) { + if off+2 > len(msg) { + return len(msg), &Error{err: "overflow packing uint16"} + } + binary.BigEndian.PutUint16(msg[off:], i) + return off + 2, nil +} + +func unpackUint32(msg []byte, off int) (i uint32, off1 int, err error) { + if off+4 > len(msg) { + return 0, len(msg), &Error{err: "overflow unpacking uint32"} + } + return binary.BigEndian.Uint32(msg[off:]), off + 4, nil +} + +func packUint32(i uint32, msg []byte, off int) (off1 int, err error) { + if off+4 > len(msg) { + return len(msg), &Error{err: "overflow packing uint32"} + } + binary.BigEndian.PutUint32(msg[off:], i) + return off + 4, nil +} + +func unpackUint48(msg []byte, off int) (i uint64, off1 int, err error) { + if off+6 > len(msg) { + return 0, len(msg), &Error{err: "overflow unpacking uint64 as uint48"} + } + // Used in TSIG where the last 48 bits are occupied, so for now, assume a uint48 (6 bytes) + i = (uint64(uint64(msg[off])<<40 | uint64(msg[off+1])<<32 | uint64(msg[off+2])<<24 | uint64(msg[off+3])<<16 | + uint64(msg[off+4])<<8 | uint64(msg[off+5]))) + off += 6 + return i, off, nil +} + +func packUint48(i uint64, msg []byte, off int) (off1 int, err error) { + if off+6 > len(msg) { + return len(msg), &Error{err: "overflow packing uint64 as uint48"} + } + msg[off] = byte(i >> 40) + msg[off+1] = byte(i >> 32) + msg[off+2] = byte(i >> 24) + msg[off+3] = byte(i >> 16) + msg[off+4] = byte(i >> 8) + msg[off+5] = byte(i) + off += 6 + return off, nil +} + +func unpackUint64(msg []byte, off int) (i uint64, off1 int, err error) { + if off+8 > len(msg) { + return 0, len(msg), &Error{err: "overflow unpacking uint64"} + } + return binary.BigEndian.Uint64(msg[off:]), off + 8, nil +} + +func packUint64(i uint64, msg []byte, off int) (off1 int, err error) { + if off+8 > len(msg) { + return len(msg), &Error{err: "overflow packing uint64"} + } + binary.BigEndian.PutUint64(msg[off:], i) + off += 8 + return off, nil +} + +func unpackString(msg []byte, off int) (string, int, error) { + if off+1 > len(msg) { + return "", off, &Error{err: "overflow unpacking txt"} + } + l := int(msg[off]) + if off+l+1 > len(msg) { + return "", off, &Error{err: "overflow unpacking txt"} + } + s := make([]byte, 0, l) + for _, b := range msg[off+1 : off+1+l] { + switch b { + case '"', '\\': + s = append(s, '\\', b) + case '\t', '\r', '\n': + s = append(s, b) + default: + if b < 32 || b > 127 { // unprintable + var buf [3]byte + bufs := strconv.AppendInt(buf[:0], int64(b), 10) + s = append(s, '\\') + for i := 0; i < 3-len(bufs); i++ { + s = append(s, '0') + } + for _, r := range bufs { + s = append(s, r) + } + } else { + s = append(s, b) + } + } + } + off += 1 + l + return string(s), off, nil +} + +func packString(s string, msg []byte, off int) (int, error) { + txtTmp := make([]byte, 256*4+1) + off, err := packTxtString(s, msg, off, txtTmp) + if err != nil { + return len(msg), err + } + return off, nil +} + +func unpackStringBase32(msg []byte, off, end int) (string, int, error) { + if end > len(msg) { + return "", len(msg), &Error{err: "overflow unpacking base32"} + } + s := toBase32(msg[off:end]) + return s, end, nil +} + +func packStringBase32(s string, msg []byte, off int) (int, error) { + b32, err := fromBase32([]byte(s)) + if err != nil { + return len(msg), err + } + if off+len(b32) > len(msg) { + return len(msg), &Error{err: "overflow packing base32"} + } + copy(msg[off:off+len(b32)], b32) + off += len(b32) + return off, nil +} + +func unpackStringBase64(msg []byte, off, end int) (string, int, error) { + // Rest of the RR is base64 encoded value, so we don't need an explicit length + // to be set. Thus far all RR's that have base64 encoded fields have those as their + // last one. What we do need is the end of the RR! + if end > len(msg) { + return "", len(msg), &Error{err: "overflow unpacking base64"} + } + s := toBase64(msg[off:end]) + return s, end, nil +} + +func packStringBase64(s string, msg []byte, off int) (int, error) { + b64, err := fromBase64([]byte(s)) + if err != nil { + return len(msg), err + } + if off+len(b64) > len(msg) { + return len(msg), &Error{err: "overflow packing base64"} + } + copy(msg[off:off+len(b64)], b64) + off += len(b64) + return off, nil +} + +func unpackStringHex(msg []byte, off, end int) (string, int, error) { + // Rest of the RR is hex encoded value, so we don't need an explicit length + // to be set. NSEC and TSIG have hex fields with a length field. + // What we do need is the end of the RR! + if end > len(msg) { + return "", len(msg), &Error{err: "overflow unpacking hex"} + } + + s := hex.EncodeToString(msg[off:end]) + return s, end, nil +} + +func packStringHex(s string, msg []byte, off int) (int, error) { + h, err := hex.DecodeString(s) + if err != nil { + return len(msg), err + } + if off+(len(h)) > len(msg) { + return len(msg), &Error{err: "overflow packing hex"} + } + copy(msg[off:off+len(h)], h) + off += len(h) + return off, nil +} + +func unpackStringTxt(msg []byte, off int) ([]string, int, error) { + txt, off, err := unpackTxt(msg, off) + if err != nil { + return nil, len(msg), err + } + return txt, off, nil +} + +func packStringTxt(s []string, msg []byte, off int) (int, error) { + txtTmp := make([]byte, 256*4+1) // If the whole string consists out of \DDD we need this many. + off, err := packTxt(s, msg, off, txtTmp) + if err != nil { + return len(msg), err + } + return off, nil +} + +func unpackDataOpt(msg []byte, off int) ([]EDNS0, int, error) { + var edns []EDNS0 +Option: + code := uint16(0) + if off+4 > len(msg) { + return nil, len(msg), &Error{err: "overflow unpacking opt"} + } + code = binary.BigEndian.Uint16(msg[off:]) + off += 2 + optlen := binary.BigEndian.Uint16(msg[off:]) + off += 2 + if off+int(optlen) > len(msg) { + return nil, len(msg), &Error{err: "overflow unpacking opt"} + } + switch code { + case EDNS0NSID: + e := new(EDNS0_NSID) + if err := e.unpack(msg[off : off+int(optlen)]); err != nil { + return nil, len(msg), err + } + edns = append(edns, e) + off += int(optlen) + case EDNS0SUBNET, EDNS0SUBNETDRAFT: + e := new(EDNS0_SUBNET) + if err := e.unpack(msg[off : off+int(optlen)]); err != nil { + return nil, len(msg), err + } + edns = append(edns, e) + off += int(optlen) + if code == EDNS0SUBNETDRAFT { + e.DraftOption = true + } + case EDNS0COOKIE: + e := new(EDNS0_COOKIE) + if err := e.unpack(msg[off : off+int(optlen)]); err != nil { + return nil, len(msg), err + } + edns = append(edns, e) + off += int(optlen) + case EDNS0UL: + e := new(EDNS0_UL) + if err := e.unpack(msg[off : off+int(optlen)]); err != nil { + return nil, len(msg), err + } + edns = append(edns, e) + off += int(optlen) + case EDNS0LLQ: + e := new(EDNS0_LLQ) + if err := e.unpack(msg[off : off+int(optlen)]); err != nil { + return nil, len(msg), err + } + edns = append(edns, e) + off += int(optlen) + case EDNS0DAU: + e := new(EDNS0_DAU) + if err := e.unpack(msg[off : off+int(optlen)]); err != nil { + return nil, len(msg), err + } + edns = append(edns, e) + off += int(optlen) + case EDNS0DHU: + e := new(EDNS0_DHU) + if err := e.unpack(msg[off : off+int(optlen)]); err != nil { + return nil, len(msg), err + } + edns = append(edns, e) + off += int(optlen) + case EDNS0N3U: + e := new(EDNS0_N3U) + if err := e.unpack(msg[off : off+int(optlen)]); err != nil { + return nil, len(msg), err + } + edns = append(edns, e) + off += int(optlen) + default: + e := new(EDNS0_LOCAL) + e.Code = code + if err := e.unpack(msg[off : off+int(optlen)]); err != nil { + return nil, len(msg), err + } + edns = append(edns, e) + off += int(optlen) + } + + if off < len(msg) { + goto Option + } + + return edns, off, nil +} + +func packDataOpt(options []EDNS0, msg []byte, off int) (int, error) { + for _, el := range options { + b, err := el.pack() + if err != nil || off+3 > len(msg) { + return len(msg), &Error{err: "overflow packing opt"} + } + binary.BigEndian.PutUint16(msg[off:], el.Option()) // Option code + binary.BigEndian.PutUint16(msg[off+2:], uint16(len(b))) // Length + off += 4 + if off+len(b) > len(msg) { + copy(msg[off:], b) + off = len(msg) + continue + } + // Actual data + copy(msg[off:off+len(b)], b) + off += len(b) + } + return off, nil +} + +func unpackStringOctet(msg []byte, off int) (string, int, error) { + s := string(msg[off:]) + return s, len(msg), nil +} + +func packStringOctet(s string, msg []byte, off int) (int, error) { + txtTmp := make([]byte, 256*4+1) + off, err := packOctetString(s, msg, off, txtTmp) + if err != nil { + return len(msg), err + } + return off, nil +} + +func unpackDataNsec(msg []byte, off int) ([]uint16, int, error) { + var nsec []uint16 + length, window, lastwindow := 0, 0, -1 + for off < len(msg) { + if off+2 > len(msg) { + return nsec, len(msg), &Error{err: "overflow unpacking nsecx"} + } + window = int(msg[off]) + length = int(msg[off+1]) + off += 2 + if window <= lastwindow { + // RFC 4034: Blocks are present in the NSEC RR RDATA in + // increasing numerical order. + return nsec, len(msg), &Error{err: "out of order NSEC block"} + } + if length == 0 { + // RFC 4034: Blocks with no types present MUST NOT be included. + return nsec, len(msg), &Error{err: "empty NSEC block"} + } + if length > 32 { + return nsec, len(msg), &Error{err: "NSEC block too long"} + } + if off+length > len(msg) { + return nsec, len(msg), &Error{err: "overflowing NSEC block"} + } + + // Walk the bytes in the window and extract the type bits + for j := 0; j < length; j++ { + b := msg[off+j] + // Check the bits one by one, and set the type + if b&0x80 == 0x80 { + nsec = append(nsec, uint16(window*256+j*8+0)) + } + if b&0x40 == 0x40 { + nsec = append(nsec, uint16(window*256+j*8+1)) + } + if b&0x20 == 0x20 { + nsec = append(nsec, uint16(window*256+j*8+2)) + } + if b&0x10 == 0x10 { + nsec = append(nsec, uint16(window*256+j*8+3)) + } + if b&0x8 == 0x8 { + nsec = append(nsec, uint16(window*256+j*8+4)) + } + if b&0x4 == 0x4 { + nsec = append(nsec, uint16(window*256+j*8+5)) + } + if b&0x2 == 0x2 { + nsec = append(nsec, uint16(window*256+j*8+6)) + } + if b&0x1 == 0x1 { + nsec = append(nsec, uint16(window*256+j*8+7)) + } + } + off += length + lastwindow = window + } + return nsec, off, nil +} + +func packDataNsec(bitmap []uint16, msg []byte, off int) (int, error) { + if len(bitmap) == 0 { + return off, nil + } + var lastwindow, lastlength uint16 + for j := 0; j < len(bitmap); j++ { + t := bitmap[j] + window := t / 256 + length := (t-window*256)/8 + 1 + if window > lastwindow && lastlength != 0 { // New window, jump to the new offset + off += int(lastlength) + 2 + lastlength = 0 + } + if window < lastwindow || length < lastlength { + return len(msg), &Error{err: "nsec bits out of order"} + } + if off+2+int(length) > len(msg) { + return len(msg), &Error{err: "overflow packing nsec"} + } + // Setting the window # + msg[off] = byte(window) + // Setting the octets length + msg[off+1] = byte(length) + // Setting the bit value for the type in the right octet + msg[off+1+int(length)] |= byte(1 << (7 - (t % 8))) + lastwindow, lastlength = window, length + } + off += int(lastlength) + 2 + return off, nil +} + +func unpackDataDomainNames(msg []byte, off, end int) ([]string, int, error) { + var ( + servers []string + s string + err error + ) + if end > len(msg) { + return nil, len(msg), &Error{err: "overflow unpacking domain names"} + } + for off < end { + s, off, err = UnpackDomainName(msg, off) + if err != nil { + return servers, len(msg), err + } + servers = append(servers, s) + } + return servers, off, nil +} + +func packDataDomainNames(names []string, msg []byte, off int, compression map[string]int, compress bool) (int, error) { + var err error + for j := 0; j < len(names); j++ { + off, err = PackDomainName(names[j], msg, off, compression, false && compress) + if err != nil { + return len(msg), err + } + } + return off, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/nsecx.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/nsecx.go new file mode 100644 index 00000000..6f10f3e6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/nsecx.go @@ -0,0 +1,119 @@ +package dns + +import ( + "crypto/sha1" + "hash" + "io" + "strings" +) + +type saltWireFmt struct { + Salt string `dns:"size-hex"` +} + +// HashName hashes a string (label) according to RFC 5155. It returns the hashed string in uppercase. +func HashName(label string, ha uint8, iter uint16, salt string) string { + saltwire := new(saltWireFmt) + saltwire.Salt = salt + wire := make([]byte, DefaultMsgSize) + n, err := packSaltWire(saltwire, wire) + if err != nil { + return "" + } + wire = wire[:n] + name := make([]byte, 255) + off, err := PackDomainName(strings.ToLower(label), name, 0, nil, false) + if err != nil { + return "" + } + name = name[:off] + var s hash.Hash + switch ha { + case SHA1: + s = sha1.New() + default: + return "" + } + + // k = 0 + name = append(name, wire...) + io.WriteString(s, string(name)) + nsec3 := s.Sum(nil) + // k > 0 + for k := uint16(0); k < iter; k++ { + s.Reset() + nsec3 = append(nsec3, wire...) + io.WriteString(s, string(nsec3)) + nsec3 = s.Sum(nil) + } + return toBase32(nsec3) +} + +// Denialer is an interface that should be implemented by types that are used to denial +// answers in DNSSEC. +type Denialer interface { + // Cover will check if the (unhashed) name is being covered by this NSEC or NSEC3. + Cover(name string) bool + // Match will check if the ownername matches the (unhashed) name for this NSEC3 or NSEC3. + Match(name string) bool +} + +// Cover implements the Denialer interface. +func (rr *NSEC) Cover(name string) bool { + return true +} + +// Match implements the Denialer interface. +func (rr *NSEC) Match(name string) bool { + return true +} + +// Cover implements the Denialer interface. +func (rr *NSEC3) Cover(name string) bool { + // FIXME(miek): check if the zones match + // FIXME(miek): check if we're not dealing with parent nsec3 + hname := HashName(name, rr.Hash, rr.Iterations, rr.Salt) + labels := Split(rr.Hdr.Name) + if len(labels) < 2 { + return false + } + hash := strings.ToUpper(rr.Hdr.Name[labels[0] : labels[1]-1]) // -1 to remove the dot + if hash == rr.NextDomain { + return false // empty interval + } + if hash > rr.NextDomain { // last name, points to apex + // hname > hash + // hname > rr.NextDomain + // TODO(miek) + } + if hname <= hash { + return false + } + if hname >= rr.NextDomain { + return false + } + return true +} + +// Match implements the Denialer interface. +func (rr *NSEC3) Match(name string) bool { + // FIXME(miek): Check if we are in the same zone + hname := HashName(name, rr.Hash, rr.Iterations, rr.Salt) + labels := Split(rr.Hdr.Name) + if len(labels) < 2 { + return false + } + hash := strings.ToUpper(rr.Hdr.Name[labels[0] : labels[1]-1]) // -1 to remove the . + if hash == hname { + return true + } + return false +} + +func packSaltWire(sw *saltWireFmt, msg []byte) (int, error) { + off, err := packStringHex(sw.Salt, msg, 0) + if err != nil { + return off, err + } + return off, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/privaterr.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/privaterr.go new file mode 100644 index 00000000..6b08e6e9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/privaterr.go @@ -0,0 +1,149 @@ +package dns + +import ( + "fmt" + "strings" +) + +// PrivateRdata is an interface used for implementing "Private Use" RR types, see +// RFC 6895. This allows one to experiment with new RR types, without requesting an +// official type code. Also see dns.PrivateHandle and dns.PrivateHandleRemove. +type PrivateRdata interface { + // String returns the text presentaton of the Rdata of the Private RR. + String() string + // Parse parses the Rdata of the private RR. + Parse([]string) error + // Pack is used when packing a private RR into a buffer. + Pack([]byte) (int, error) + // Unpack is used when unpacking a private RR from a buffer. + // TODO(miek): diff. signature than Pack, see edns0.go for instance. + Unpack([]byte) (int, error) + // Copy copies the Rdata. + Copy(PrivateRdata) error + // Len returns the length in octets of the Rdata. + Len() int +} + +// PrivateRR represents an RR that uses a PrivateRdata user-defined type. +// It mocks normal RRs and implements dns.RR interface. +type PrivateRR struct { + Hdr RR_Header + Data PrivateRdata +} + +func mkPrivateRR(rrtype uint16) *PrivateRR { + // Panics if RR is not an instance of PrivateRR. + rrfunc, ok := TypeToRR[rrtype] + if !ok { + panic(fmt.Sprintf("dns: invalid operation with Private RR type %d", rrtype)) + } + + anyrr := rrfunc() + switch rr := anyrr.(type) { + case *PrivateRR: + return rr + } + panic(fmt.Sprintf("dns: RR is not a PrivateRR, TypeToRR[%d] generator returned %T", rrtype, anyrr)) +} + +// Header return the RR header of r. +func (r *PrivateRR) Header() *RR_Header { return &r.Hdr } + +func (r *PrivateRR) String() string { return r.Hdr.String() + r.Data.String() } + +// Private len and copy parts to satisfy RR interface. +func (r *PrivateRR) len() int { return r.Hdr.len() + r.Data.Len() } +func (r *PrivateRR) copy() RR { + // make new RR like this: + rr := mkPrivateRR(r.Hdr.Rrtype) + newh := r.Hdr.copyHeader() + rr.Hdr = *newh + + err := r.Data.Copy(rr.Data) + if err != nil { + panic("dns: got value that could not be used to copy Private rdata") + } + return rr +} +func (r *PrivateRR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := r.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + n, err := r.Data.Pack(msg[off:]) + if err != nil { + return len(msg), err + } + off += n + r.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +// PrivateHandle registers a private resource record type. It requires +// string and numeric representation of private RR type and generator function as argument. +func PrivateHandle(rtypestr string, rtype uint16, generator func() PrivateRdata) { + rtypestr = strings.ToUpper(rtypestr) + + TypeToRR[rtype] = func() RR { return &PrivateRR{RR_Header{}, generator()} } + TypeToString[rtype] = rtypestr + StringToType[rtypestr] = rtype + + typeToUnpack[rtype] = func(h RR_Header, msg []byte, off int) (RR, int, error) { + if noRdata(h) { + return &h, off, nil + } + var err error + + rr := mkPrivateRR(h.Rrtype) + rr.Hdr = h + + off1, err := rr.Data.Unpack(msg[off:]) + off += off1 + if err != nil { + return rr, off, err + } + return rr, off, err + } + + setPrivateRR := func(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := mkPrivateRR(h.Rrtype) + rr.Hdr = h + + var l lex + text := make([]string, 0, 2) // could be 0..N elements, median is probably 1 + Fetch: + for { + // TODO(miek): we could also be returning _QUOTE, this might or might not + // be an issue (basically parsing TXT becomes hard) + switch l = <-c; l.value { + case zNewline, zEOF: + break Fetch + case zString: + text = append(text, l.token) + } + } + + err := rr.Data.Parse(text) + if err != nil { + return nil, &ParseError{f, err.Error(), l}, "" + } + + return rr, nil, "" + } + + typeToparserFunc[rtype] = parserFunc{setPrivateRR, true} +} + +// PrivateHandleRemove removes defenitions required to support private RR type. +func PrivateHandleRemove(rtype uint16) { + rtypestr, ok := TypeToString[rtype] + if ok { + delete(TypeToRR, rtype) + delete(TypeToString, rtype) + delete(typeToparserFunc, rtype) + delete(StringToType, rtypestr) + delete(typeToUnpack, rtype) + } + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/rawmsg.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/rawmsg.go new file mode 100644 index 00000000..6e21fba7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/rawmsg.go @@ -0,0 +1,49 @@ +package dns + +import "encoding/binary" + +// rawSetRdlength sets the rdlength in the header of +// the RR. The offset 'off' must be positioned at the +// start of the header of the RR, 'end' must be the +// end of the RR. +func rawSetRdlength(msg []byte, off, end int) bool { + l := len(msg) +Loop: + for { + if off+1 > l { + return false + } + c := int(msg[off]) + off++ + switch c & 0xC0 { + case 0x00: + if c == 0x00 { + // End of the domainname + break Loop + } + if off+c > l { + return false + } + off += c + + case 0xC0: + // pointer, next byte included, ends domainname + off++ + break Loop + } + } + // The domainname has been seen, we at the start of the fixed part in the header. + // Type is 2 bytes, class is 2 bytes, ttl 4 and then 2 bytes for the length. + off += 2 + 2 + 4 + if off+2 > l { + return false + } + //off+1 is the end of the header, 'end' is the end of the rr + //so 'end' - 'off+2' is the length of the rdata + rdatalen := end - (off + 2) + if rdatalen > 0xFFFF { + return false + } + binary.BigEndian.PutUint16(msg[off:], uint16(rdatalen)) + return true +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/reverse.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/reverse.go new file mode 100644 index 00000000..099dac94 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/reverse.go @@ -0,0 +1,38 @@ +package dns + +// StringToType is the reverse of TypeToString, needed for string parsing. +var StringToType = reverseInt16(TypeToString) + +// StringToClass is the reverse of ClassToString, needed for string parsing. +var StringToClass = reverseInt16(ClassToString) + +// Map of opcodes strings. +var StringToOpcode = reverseInt(OpcodeToString) + +// Map of rcodes strings. +var StringToRcode = reverseInt(RcodeToString) + +// Reverse a map +func reverseInt8(m map[uint8]string) map[string]uint8 { + n := make(map[string]uint8, len(m)) + for u, s := range m { + n[s] = u + } + return n +} + +func reverseInt16(m map[uint16]string) map[string]uint16 { + n := make(map[string]uint16, len(m)) + for u, s := range m { + n[s] = u + } + return n +} + +func reverseInt(m map[int]string) map[string]int { + n := make(map[string]int, len(m)) + for u, s := range m { + n[s] = u + } + return n +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/sanitize.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/sanitize.go new file mode 100644 index 00000000..b489f3f0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/sanitize.go @@ -0,0 +1,84 @@ +package dns + +// Dedup removes identical RRs from rrs. It preserves the original ordering. +// The lowest TTL of any duplicates is used in the remaining one. Dedup modifies +// rrs. +// m is used to store the RRs temporay. If it is nil a new map will be allocated. +func Dedup(rrs []RR, m map[string]RR) []RR { + if m == nil { + m = make(map[string]RR) + } + // Save the keys, so we don't have to call normalizedString twice. + keys := make([]*string, 0, len(rrs)) + + for _, r := range rrs { + key := normalizedString(r) + keys = append(keys, &key) + if _, ok := m[key]; ok { + // Shortest TTL wins. + if m[key].Header().Ttl > r.Header().Ttl { + m[key].Header().Ttl = r.Header().Ttl + } + continue + } + + m[key] = r + } + // If the length of the result map equals the amount of RRs we got, + // it means they were all different. We can then just return the original rrset. + if len(m) == len(rrs) { + return rrs + } + + j := 0 + for i, r := range rrs { + // If keys[i] lives in the map, we should copy and remove it. + if _, ok := m[*keys[i]]; ok { + delete(m, *keys[i]) + rrs[j] = r + j++ + } + + if len(m) == 0 { + break + } + } + + return rrs[:j] +} + +// normalizedString returns a normalized string from r. The TTL +// is removed and the domain name is lowercased. We go from this: +// DomainNameTTLCLASSTYPERDATA to: +// lowercasenameCLASSTYPE... +func normalizedString(r RR) string { + // A string Go DNS makes has: domainnameTTL... + b := []byte(r.String()) + + // find the first non-escaped tab, then another, so we capture where the TTL lives. + esc := false + ttlStart, ttlEnd := 0, 0 + for i := 0; i < len(b) && ttlEnd == 0; i++ { + switch { + case b[i] == '\\': + esc = !esc + case b[i] == '\t' && !esc: + if ttlStart == 0 { + ttlStart = i + continue + } + if ttlEnd == 0 { + ttlEnd = i + } + case b[i] >= 'A' && b[i] <= 'Z' && !esc: + b[i] += 32 + default: + esc = false + } + } + + // remove TTL. + copy(b[ttlStart:], b[ttlEnd:]) + cut := ttlEnd - ttlStart + return string(b[:len(b)-cut]) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/scan.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/scan.go new file mode 100644 index 00000000..0e83797f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/scan.go @@ -0,0 +1,974 @@ +package dns + +import ( + "io" + "log" + "os" + "strconv" + "strings" +) + +type debugging bool + +const debug debugging = false + +func (d debugging) Printf(format string, args ...interface{}) { + if d { + log.Printf(format, args...) + } +} + +const maxTok = 2048 // Largest token we can return. +const maxUint16 = 1<<16 - 1 + +// Tokinize a RFC 1035 zone file. The tokenizer will normalize it: +// * Add ownernames if they are left blank; +// * Suppress sequences of spaces; +// * Make each RR fit on one line (_NEWLINE is send as last) +// * Handle comments: ; +// * Handle braces - anywhere. +const ( + // Zonefile + zEOF = iota + zString + zBlank + zQuote + zNewline + zRrtpe + zOwner + zClass + zDirOrigin // $ORIGIN + zDirTtl // $TTL + zDirInclude // $INCLUDE + zDirGenerate // $GENERATE + + // Privatekey file + zValue + zKey + + zExpectOwnerDir // Ownername + zExpectOwnerBl // Whitespace after the ownername + zExpectAny // Expect rrtype, ttl or class + zExpectAnyNoClass // Expect rrtype or ttl + zExpectAnyNoClassBl // The whitespace after _EXPECT_ANY_NOCLASS + zExpectAnyNoTtl // Expect rrtype or class + zExpectAnyNoTtlBl // Whitespace after _EXPECT_ANY_NOTTL + zExpectRrtype // Expect rrtype + zExpectRrtypeBl // Whitespace BEFORE rrtype + zExpectRdata // The first element of the rdata + zExpectDirTtlBl // Space after directive $TTL + zExpectDirTtl // Directive $TTL + zExpectDirOriginBl // Space after directive $ORIGIN + zExpectDirOrigin // Directive $ORIGIN + zExpectDirIncludeBl // Space after directive $INCLUDE + zExpectDirInclude // Directive $INCLUDE + zExpectDirGenerate // Directive $GENERATE + zExpectDirGenerateBl // Space after directive $GENERATE +) + +// ParseError is a parsing error. It contains the parse error and the location in the io.Reader +// where the error occurred. +type ParseError struct { + file string + err string + lex lex +} + +func (e *ParseError) Error() (s string) { + if e.file != "" { + s = e.file + ": " + } + s += "dns: " + e.err + ": " + strconv.QuoteToASCII(e.lex.token) + " at line: " + + strconv.Itoa(e.lex.line) + ":" + strconv.Itoa(e.lex.column) + return +} + +type lex struct { + token string // text of the token + tokenUpper string // uppercase text of the token + length int // length of the token + err bool // when true, token text has lexer error + value uint8 // value: zString, _BLANK, etc. + line int // line in the file + column int // column in the file + torc uint16 // type or class as parsed in the lexer, we only need to look this up in the grammar + comment string // any comment text seen +} + +// Token holds the token that are returned when a zone file is parsed. +type Token struct { + // The scanned resource record when error is not nil. + RR + // When an error occurred, this has the error specifics. + Error *ParseError + // A potential comment positioned after the RR and on the same line. + Comment string +} + +// NewRR reads the RR contained in the string s. Only the first RR is +// returned. If s contains no RR, return nil with no error. The class +// defaults to IN and TTL defaults to 3600. The full zone file syntax +// like $TTL, $ORIGIN, etc. is supported. All fields of the returned +// RR are set, except RR.Header().Rdlength which is set to 0. +func NewRR(s string) (RR, error) { + if len(s) > 0 && s[len(s)-1] != '\n' { // We need a closing newline + return ReadRR(strings.NewReader(s+"\n"), "") + } + return ReadRR(strings.NewReader(s), "") +} + +// ReadRR reads the RR contained in q. +// See NewRR for more documentation. +func ReadRR(q io.Reader, filename string) (RR, error) { + r := <-parseZoneHelper(q, ".", filename, 1) + if r == nil { + return nil, nil + } + + if r.Error != nil { + return nil, r.Error + } + return r.RR, nil +} + +// ParseZone reads a RFC 1035 style zonefile from r. It returns *Tokens on the +// returned channel, which consist out the parsed RR, a potential comment or an error. +// If there is an error the RR is nil. The string file is only used +// in error reporting. The string origin is used as the initial origin, as +// if the file would start with: $ORIGIN origin . +// The directives $INCLUDE, $ORIGIN, $TTL and $GENERATE are supported. +// The channel t is closed by ParseZone when the end of r is reached. +// +// Basic usage pattern when reading from a string (z) containing the +// zone data: +// +// for x := range dns.ParseZone(strings.NewReader(z), "", "") { +// if x.Error != nil { +// // log.Println(x.Error) +// } else { +// // Do something with x.RR +// } +// } +// +// Comments specified after an RR (and on the same line!) are returned too: +// +// foo. IN A 10.0.0.1 ; this is a comment +// +// The text "; this is comment" is returned in Token.Comment. Comments inside the +// RR are discarded. Comments on a line by themselves are discarded too. +func ParseZone(r io.Reader, origin, file string) chan *Token { + return parseZoneHelper(r, origin, file, 10000) +} + +func parseZoneHelper(r io.Reader, origin, file string, chansize int) chan *Token { + t := make(chan *Token, chansize) + go parseZone(r, origin, file, t, 0) + return t +} + +func parseZone(r io.Reader, origin, f string, t chan *Token, include int) { + defer func() { + if include == 0 { + close(t) + } + }() + s := scanInit(r) + c := make(chan lex) + // Start the lexer + go zlexer(s, c) + // 6 possible beginnings of a line, _ is a space + // 0. zRRTYPE -> all omitted until the rrtype + // 1. zOwner _ zRrtype -> class/ttl omitted + // 2. zOwner _ zString _ zRrtype -> class omitted + // 3. zOwner _ zString _ zClass _ zRrtype -> ttl/class + // 4. zOwner _ zClass _ zRrtype -> ttl omitted + // 5. zOwner _ zClass _ zString _ zRrtype -> class/ttl (reversed) + // After detecting these, we know the zRrtype so we can jump to functions + // handling the rdata for each of these types. + + if origin == "" { + origin = "." + } + origin = Fqdn(origin) + if _, ok := IsDomainName(origin); !ok { + t <- &Token{Error: &ParseError{f, "bad initial origin name", lex{}}} + return + } + + st := zExpectOwnerDir // initial state + var h RR_Header + var defttl uint32 = defaultTtl + var prevName string + for l := range c { + // Lexer spotted an error already + if l.err == true { + t <- &Token{Error: &ParseError{f, l.token, l}} + return + + } + switch st { + case zExpectOwnerDir: + // We can also expect a directive, like $TTL or $ORIGIN + h.Ttl = defttl + h.Class = ClassINET + switch l.value { + case zNewline: + st = zExpectOwnerDir + case zOwner: + h.Name = l.token + if l.token[0] == '@' { + h.Name = origin + prevName = h.Name + st = zExpectOwnerBl + break + } + if h.Name[l.length-1] != '.' { + h.Name = appendOrigin(h.Name, origin) + } + _, ok := IsDomainName(l.token) + if !ok { + t <- &Token{Error: &ParseError{f, "bad owner name", l}} + return + } + prevName = h.Name + st = zExpectOwnerBl + case zDirTtl: + st = zExpectDirTtlBl + case zDirOrigin: + st = zExpectDirOriginBl + case zDirInclude: + st = zExpectDirIncludeBl + case zDirGenerate: + st = zExpectDirGenerateBl + case zRrtpe: + h.Name = prevName + h.Rrtype = l.torc + st = zExpectRdata + case zClass: + h.Name = prevName + h.Class = l.torc + st = zExpectAnyNoClassBl + case zBlank: + // Discard, can happen when there is nothing on the + // line except the RR type + case zString: + ttl, ok := stringToTtl(l.token) + if !ok { + t <- &Token{Error: &ParseError{f, "not a TTL", l}} + return + } + h.Ttl = ttl + // Don't about the defttl, we should take the $TTL value + // defttl = ttl + st = zExpectAnyNoTtlBl + + default: + t <- &Token{Error: &ParseError{f, "syntax error at beginning", l}} + return + } + case zExpectDirIncludeBl: + if l.value != zBlank { + t <- &Token{Error: &ParseError{f, "no blank after $INCLUDE-directive", l}} + return + } + st = zExpectDirInclude + case zExpectDirInclude: + if l.value != zString { + t <- &Token{Error: &ParseError{f, "expecting $INCLUDE value, not this...", l}} + return + } + neworigin := origin // There may be optionally a new origin set after the filename, if not use current one + l := <-c + switch l.value { + case zBlank: + l := <-c + if l.value == zString { + if _, ok := IsDomainName(l.token); !ok || l.length == 0 || l.err { + t <- &Token{Error: &ParseError{f, "bad origin name", l}} + return + } + // a new origin is specified. + if l.token[l.length-1] != '.' { + if origin != "." { // Prevent .. endings + neworigin = l.token + "." + origin + } else { + neworigin = l.token + origin + } + } else { + neworigin = l.token + } + } + case zNewline, zEOF: + // Ok + default: + t <- &Token{Error: &ParseError{f, "garbage after $INCLUDE", l}} + return + } + // Start with the new file + r1, e1 := os.Open(l.token) + if e1 != nil { + t <- &Token{Error: &ParseError{f, "failed to open `" + l.token + "'", l}} + return + } + if include+1 > 7 { + t <- &Token{Error: &ParseError{f, "too deeply nested $INCLUDE", l}} + return + } + parseZone(r1, l.token, neworigin, t, include+1) + st = zExpectOwnerDir + case zExpectDirTtlBl: + if l.value != zBlank { + t <- &Token{Error: &ParseError{f, "no blank after $TTL-directive", l}} + return + } + st = zExpectDirTtl + case zExpectDirTtl: + if l.value != zString { + t <- &Token{Error: &ParseError{f, "expecting $TTL value, not this...", l}} + return + } + if e, _ := slurpRemainder(c, f); e != nil { + t <- &Token{Error: e} + return + } + ttl, ok := stringToTtl(l.token) + if !ok { + t <- &Token{Error: &ParseError{f, "expecting $TTL value, not this...", l}} + return + } + defttl = ttl + st = zExpectOwnerDir + case zExpectDirOriginBl: + if l.value != zBlank { + t <- &Token{Error: &ParseError{f, "no blank after $ORIGIN-directive", l}} + return + } + st = zExpectDirOrigin + case zExpectDirOrigin: + if l.value != zString { + t <- &Token{Error: &ParseError{f, "expecting $ORIGIN value, not this...", l}} + return + } + if e, _ := slurpRemainder(c, f); e != nil { + t <- &Token{Error: e} + } + if _, ok := IsDomainName(l.token); !ok { + t <- &Token{Error: &ParseError{f, "bad origin name", l}} + return + } + if l.token[l.length-1] != '.' { + if origin != "." { // Prevent .. endings + origin = l.token + "." + origin + } else { + origin = l.token + origin + } + } else { + origin = l.token + } + st = zExpectOwnerDir + case zExpectDirGenerateBl: + if l.value != zBlank { + t <- &Token{Error: &ParseError{f, "no blank after $GENERATE-directive", l}} + return + } + st = zExpectDirGenerate + case zExpectDirGenerate: + if l.value != zString { + t <- &Token{Error: &ParseError{f, "expecting $GENERATE value, not this...", l}} + return + } + if errMsg := generate(l, c, t, origin); errMsg != "" { + t <- &Token{Error: &ParseError{f, errMsg, l}} + return + } + st = zExpectOwnerDir + case zExpectOwnerBl: + if l.value != zBlank { + t <- &Token{Error: &ParseError{f, "no blank after owner", l}} + return + } + st = zExpectAny + case zExpectAny: + switch l.value { + case zRrtpe: + h.Rrtype = l.torc + st = zExpectRdata + case zClass: + h.Class = l.torc + st = zExpectAnyNoClassBl + case zString: + ttl, ok := stringToTtl(l.token) + if !ok { + t <- &Token{Error: &ParseError{f, "not a TTL", l}} + return + } + h.Ttl = ttl + // defttl = ttl // don't set the defttl here + st = zExpectAnyNoTtlBl + default: + t <- &Token{Error: &ParseError{f, "expecting RR type, TTL or class, not this...", l}} + return + } + case zExpectAnyNoClassBl: + if l.value != zBlank { + t <- &Token{Error: &ParseError{f, "no blank before class", l}} + return + } + st = zExpectAnyNoClass + case zExpectAnyNoTtlBl: + if l.value != zBlank { + t <- &Token{Error: &ParseError{f, "no blank before TTL", l}} + return + } + st = zExpectAnyNoTtl + case zExpectAnyNoTtl: + switch l.value { + case zClass: + h.Class = l.torc + st = zExpectRrtypeBl + case zRrtpe: + h.Rrtype = l.torc + st = zExpectRdata + default: + t <- &Token{Error: &ParseError{f, "expecting RR type or class, not this...", l}} + return + } + case zExpectAnyNoClass: + switch l.value { + case zString: + ttl, ok := stringToTtl(l.token) + if !ok { + t <- &Token{Error: &ParseError{f, "not a TTL", l}} + return + } + h.Ttl = ttl + // defttl = ttl // don't set the def ttl anymore + st = zExpectRrtypeBl + case zRrtpe: + h.Rrtype = l.torc + st = zExpectRdata + default: + t <- &Token{Error: &ParseError{f, "expecting RR type or TTL, not this...", l}} + return + } + case zExpectRrtypeBl: + if l.value != zBlank { + t <- &Token{Error: &ParseError{f, "no blank before RR type", l}} + return + } + st = zExpectRrtype + case zExpectRrtype: + if l.value != zRrtpe { + t <- &Token{Error: &ParseError{f, "unknown RR type", l}} + return + } + h.Rrtype = l.torc + st = zExpectRdata + case zExpectRdata: + r, e, c1 := setRR(h, c, origin, f) + if e != nil { + // If e.lex is nil than we have encounter a unknown RR type + // in that case we substitute our current lex token + if e.lex.token == "" && e.lex.value == 0 { + e.lex = l // Uh, dirty + } + t <- &Token{Error: e} + return + } + t <- &Token{RR: r, Comment: c1} + st = zExpectOwnerDir + } + } + // If we get here, we and the h.Rrtype is still zero, we haven't parsed anything, this + // is not an error, because an empty zone file is still a zone file. +} + +// zlexer scans the sourcefile and returns tokens on the channel c. +func zlexer(s *scan, c chan lex) { + var l lex + str := make([]byte, maxTok) // Should be enough for any token + stri := 0 // Offset in str (0 means empty) + com := make([]byte, maxTok) // Hold comment text + comi := 0 + quote := false + escape := false + space := false + commt := false + rrtype := false + owner := true + brace := 0 + x, err := s.tokenText() + defer close(c) + for err == nil { + l.column = s.position.Column + l.line = s.position.Line + if stri >= maxTok { + l.token = "token length insufficient for parsing" + l.err = true + debug.Printf("[%+v]", l.token) + c <- l + return + } + if comi >= maxTok { + l.token = "comment length insufficient for parsing" + l.err = true + debug.Printf("[%+v]", l.token) + c <- l + return + } + + switch x { + case ' ', '\t': + if escape { + escape = false + str[stri] = x + stri++ + break + } + if quote { + // Inside quotes this is legal + str[stri] = x + stri++ + break + } + if commt { + com[comi] = x + comi++ + break + } + if stri == 0 { + // Space directly in the beginning, handled in the grammar + } else if owner { + // If we have a string and its the first, make it an owner + l.value = zOwner + l.token = string(str[:stri]) + l.tokenUpper = strings.ToUpper(l.token) + l.length = stri + // escape $... start with a \ not a $, so this will work + switch l.tokenUpper { + case "$TTL": + l.value = zDirTtl + case "$ORIGIN": + l.value = zDirOrigin + case "$INCLUDE": + l.value = zDirInclude + case "$GENERATE": + l.value = zDirGenerate + } + debug.Printf("[7 %+v]", l.token) + c <- l + } else { + l.value = zString + l.token = string(str[:stri]) + l.tokenUpper = strings.ToUpper(l.token) + l.length = stri + if !rrtype { + if t, ok := StringToType[l.tokenUpper]; ok { + l.value = zRrtpe + l.torc = t + rrtype = true + } else { + if strings.HasPrefix(l.tokenUpper, "TYPE") { + t, ok := typeToInt(l.token) + if !ok { + l.token = "unknown RR type" + l.err = true + c <- l + return + } + l.value = zRrtpe + l.torc = t + } + } + if t, ok := StringToClass[l.tokenUpper]; ok { + l.value = zClass + l.torc = t + } else { + if strings.HasPrefix(l.tokenUpper, "CLASS") { + t, ok := classToInt(l.token) + if !ok { + l.token = "unknown class" + l.err = true + c <- l + return + } + l.value = zClass + l.torc = t + } + } + } + debug.Printf("[6 %+v]", l.token) + c <- l + } + stri = 0 + // I reverse space stuff here + if !space && !commt { + l.value = zBlank + l.token = " " + l.length = 1 + debug.Printf("[5 %+v]", l.token) + c <- l + } + owner = false + space = true + case ';': + if escape { + escape = false + str[stri] = x + stri++ + break + } + if quote { + // Inside quotes this is legal + str[stri] = x + stri++ + break + } + if stri > 0 { + l.value = zString + l.token = string(str[:stri]) + l.length = stri + debug.Printf("[4 %+v]", l.token) + c <- l + stri = 0 + } + commt = true + com[comi] = ';' + comi++ + case '\r': + escape = false + if quote { + str[stri] = x + stri++ + break + } + // discard if outside of quotes + case '\n': + escape = false + // Escaped newline + if quote { + str[stri] = x + stri++ + break + } + // inside quotes this is legal + if commt { + // Reset a comment + commt = false + rrtype = false + stri = 0 + // If not in a brace this ends the comment AND the RR + if brace == 0 { + owner = true + owner = true + l.value = zNewline + l.token = "\n" + l.length = 1 + l.comment = string(com[:comi]) + debug.Printf("[3 %+v %+v]", l.token, l.comment) + c <- l + l.comment = "" + comi = 0 + break + } + com[comi] = ' ' // convert newline to space + comi++ + break + } + + if brace == 0 { + // If there is previous text, we should output it here + if stri != 0 { + l.value = zString + l.token = string(str[:stri]) + l.tokenUpper = strings.ToUpper(l.token) + + l.length = stri + if !rrtype { + if t, ok := StringToType[l.tokenUpper]; ok { + l.value = zRrtpe + l.torc = t + rrtype = true + } + } + debug.Printf("[2 %+v]", l.token) + c <- l + } + l.value = zNewline + l.token = "\n" + l.length = 1 + debug.Printf("[1 %+v]", l.token) + c <- l + stri = 0 + commt = false + rrtype = false + owner = true + comi = 0 + } + case '\\': + // comments do not get escaped chars, everything is copied + if commt { + com[comi] = x + comi++ + break + } + // something already escaped must be in string + if escape { + str[stri] = x + stri++ + escape = false + break + } + // something escaped outside of string gets added to string + str[stri] = x + stri++ + escape = true + case '"': + if commt { + com[comi] = x + comi++ + break + } + if escape { + str[stri] = x + stri++ + escape = false + break + } + space = false + // send previous gathered text and the quote + if stri != 0 { + l.value = zString + l.token = string(str[:stri]) + l.length = stri + + debug.Printf("[%+v]", l.token) + c <- l + stri = 0 + } + + // send quote itself as separate token + l.value = zQuote + l.token = "\"" + l.length = 1 + c <- l + quote = !quote + case '(', ')': + if commt { + com[comi] = x + comi++ + break + } + if escape { + str[stri] = x + stri++ + escape = false + break + } + if quote { + str[stri] = x + stri++ + break + } + switch x { + case ')': + brace-- + if brace < 0 { + l.token = "extra closing brace" + l.err = true + debug.Printf("[%+v]", l.token) + c <- l + return + } + case '(': + brace++ + } + default: + escape = false + if commt { + com[comi] = x + comi++ + break + } + str[stri] = x + stri++ + space = false + } + x, err = s.tokenText() + } + if stri > 0 { + // Send remainder + l.token = string(str[:stri]) + l.length = stri + l.value = zString + debug.Printf("[%+v]", l.token) + c <- l + } +} + +// Extract the class number from CLASSxx +func classToInt(token string) (uint16, bool) { + offset := 5 + if len(token) < offset+1 { + return 0, false + } + class, ok := strconv.Atoi(token[offset:]) + if ok != nil || class > maxUint16 { + return 0, false + } + return uint16(class), true +} + +// Extract the rr number from TYPExxx +func typeToInt(token string) (uint16, bool) { + offset := 4 + if len(token) < offset+1 { + return 0, false + } + typ, ok := strconv.Atoi(token[offset:]) + if ok != nil || typ > maxUint16 { + return 0, false + } + return uint16(typ), true +} + +// Parse things like 2w, 2m, etc, Return the time in seconds. +func stringToTtl(token string) (uint32, bool) { + s := uint32(0) + i := uint32(0) + for _, c := range token { + switch c { + case 's', 'S': + s += i + i = 0 + case 'm', 'M': + s += i * 60 + i = 0 + case 'h', 'H': + s += i * 60 * 60 + i = 0 + case 'd', 'D': + s += i * 60 * 60 * 24 + i = 0 + case 'w', 'W': + s += i * 60 * 60 * 24 * 7 + i = 0 + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + i *= 10 + i += uint32(c) - '0' + default: + return 0, false + } + } + return s + i, true +} + +// Parse LOC records' [.][mM] into a +// mantissa exponent format. Token should contain the entire +// string (i.e. no spaces allowed) +func stringToCm(token string) (e, m uint8, ok bool) { + if token[len(token)-1] == 'M' || token[len(token)-1] == 'm' { + token = token[0 : len(token)-1] + } + s := strings.SplitN(token, ".", 2) + var meters, cmeters, val int + var err error + switch len(s) { + case 2: + if cmeters, err = strconv.Atoi(s[1]); err != nil { + return + } + fallthrough + case 1: + if meters, err = strconv.Atoi(s[0]); err != nil { + return + } + case 0: + // huh? + return 0, 0, false + } + ok = true + if meters > 0 { + e = 2 + val = meters + } else { + e = 0 + val = cmeters + } + for val > 10 { + e++ + val /= 10 + } + if e > 9 { + ok = false + } + m = uint8(val) + return +} + +func appendOrigin(name, origin string) string { + if origin == "." { + return name + origin + } + return name + "." + origin +} + +// LOC record helper function +func locCheckNorth(token string, latitude uint32) (uint32, bool) { + switch token { + case "n", "N": + return LOC_EQUATOR + latitude, true + case "s", "S": + return LOC_EQUATOR - latitude, true + } + return latitude, false +} + +// LOC record helper function +func locCheckEast(token string, longitude uint32) (uint32, bool) { + switch token { + case "e", "E": + return LOC_EQUATOR + longitude, true + case "w", "W": + return LOC_EQUATOR - longitude, true + } + return longitude, false +} + +// "Eat" the rest of the "line". Return potential comments +func slurpRemainder(c chan lex, f string) (*ParseError, string) { + l := <-c + com := "" + switch l.value { + case zBlank: + l = <-c + com = l.comment + if l.value != zNewline && l.value != zEOF { + return &ParseError{f, "garbage after rdata", l}, "" + } + case zNewline: + com = l.comment + case zEOF: + default: + return &ParseError{f, "garbage after rdata", l}, "" + } + return nil, com +} + +// Parse a 64 bit-like ipv6 address: "0014:4fff:ff20:ee64" +// Used for NID and L64 record. +func stringToNodeID(l lex) (uint64, *ParseError) { + if len(l.token) < 19 { + return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l} + } + // There must be three colons at fixes postitions, if not its a parse error + if l.token[4] != ':' && l.token[9] != ':' && l.token[14] != ':' { + return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l} + } + s := l.token[0:4] + l.token[5:9] + l.token[10:14] + l.token[15:19] + u, err := strconv.ParseUint(s, 16, 64) + if err != nil { + return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l} + } + return u, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/scan_rr.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/scan_rr.go new file mode 100644 index 00000000..e521dc06 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/scan_rr.go @@ -0,0 +1,2143 @@ +package dns + +import ( + "encoding/base64" + "net" + "strconv" + "strings" +) + +type parserFunc struct { + // Func defines the function that parses the tokens and returns the RR + // or an error. The last string contains any comments in the line as + // they returned by the lexer as well. + Func func(h RR_Header, c chan lex, origin string, file string) (RR, *ParseError, string) + // Signals if the RR ending is of variable length, like TXT or records + // that have Hexadecimal or Base64 as their last element in the Rdata. Records + // that have a fixed ending or for instance A, AAAA, SOA and etc. + Variable bool +} + +// Parse the rdata of each rrtype. +// All data from the channel c is either zString or zBlank. +// After the rdata there may come a zBlank and then a zNewline +// or immediately a zNewline. If this is not the case we flag +// an *ParseError: garbage after rdata. +func setRR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + parserfunc, ok := typeToparserFunc[h.Rrtype] + if ok { + r, e, cm := parserfunc.Func(h, c, o, f) + if parserfunc.Variable { + return r, e, cm + } + if e != nil { + return nil, e, "" + } + e, cm = slurpRemainder(c, f) + if e != nil { + return nil, e, "" + } + return r, nil, cm + } + // RFC3957 RR (Unknown RR handling) + return setRFC3597(h, c, o, f) +} + +// A remainder of the rdata with embedded spaces, return the parsed string (sans the spaces) +// or an error +func endingToString(c chan lex, errstr, f string) (string, *ParseError, string) { + s := "" + l := <-c // zString + for l.value != zNewline && l.value != zEOF { + if l.err { + return s, &ParseError{f, errstr, l}, "" + } + switch l.value { + case zString: + s += l.token + case zBlank: // Ok + default: + return "", &ParseError{f, errstr, l}, "" + } + l = <-c + } + return s, nil, l.comment +} + +// A remainder of the rdata with embedded spaces, return the parsed string slice (sans the spaces) +// or an error +func endingToTxtSlice(c chan lex, errstr, f string) ([]string, *ParseError, string) { + // Get the remaining data until we see a zNewline + quote := false + l := <-c + var s []string + if l.err { + return s, &ParseError{f, errstr, l}, "" + } + switch l.value == zQuote { + case true: // A number of quoted string + s = make([]string, 0) + empty := true + for l.value != zNewline && l.value != zEOF { + if l.err { + return nil, &ParseError{f, errstr, l}, "" + } + switch l.value { + case zString: + empty = false + if len(l.token) > 255 { + // split up tokens that are larger than 255 into 255-chunks + sx := []string{} + p, i := 0, 255 + for { + if i <= len(l.token) { + sx = append(sx, l.token[p:i]) + } else { + sx = append(sx, l.token[p:]) + break + + } + p, i = p+255, i+255 + } + s = append(s, sx...) + break + } + + s = append(s, l.token) + case zBlank: + if quote { + // zBlank can only be seen in between txt parts. + return nil, &ParseError{f, errstr, l}, "" + } + case zQuote: + if empty && quote { + s = append(s, "") + } + quote = !quote + empty = true + default: + return nil, &ParseError{f, errstr, l}, "" + } + l = <-c + } + if quote { + return nil, &ParseError{f, errstr, l}, "" + } + case false: // Unquoted text record + s = make([]string, 1) + for l.value != zNewline && l.value != zEOF { + if l.err { + return s, &ParseError{f, errstr, l}, "" + } + s[0] += l.token + l = <-c + } + } + return s, nil, l.comment +} + +func setA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(A) + rr.Hdr = h + + l := <-c + if l.length == 0 { // Dynamic updates. + return rr, nil, "" + } + rr.A = net.ParseIP(l.token) + if rr.A == nil || l.err { + return nil, &ParseError{f, "bad A A", l}, "" + } + return rr, nil, "" +} + +func setAAAA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(AAAA) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + rr.AAAA = net.ParseIP(l.token) + if rr.AAAA == nil || l.err { + return nil, &ParseError{f, "bad AAAA AAAA", l}, "" + } + return rr, nil, "" +} + +func setNS(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(NS) + rr.Hdr = h + + l := <-c + rr.Ns = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Ns = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad NS Ns", l}, "" + } + if rr.Ns[l.length-1] != '.' { + rr.Ns = appendOrigin(rr.Ns, o) + } + return rr, nil, "" +} + +func setPTR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(PTR) + rr.Hdr = h + + l := <-c + rr.Ptr = l.token + if l.length == 0 { // dynamic update rr. + return rr, nil, "" + } + if l.token == "@" { + rr.Ptr = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad PTR Ptr", l}, "" + } + if rr.Ptr[l.length-1] != '.' { + rr.Ptr = appendOrigin(rr.Ptr, o) + } + return rr, nil, "" +} + +func setNSAPPTR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(NSAPPTR) + rr.Hdr = h + + l := <-c + rr.Ptr = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Ptr = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad NSAP-PTR Ptr", l}, "" + } + if rr.Ptr[l.length-1] != '.' { + rr.Ptr = appendOrigin(rr.Ptr, o) + } + return rr, nil, "" +} + +func setRP(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(RP) + rr.Hdr = h + + l := <-c + rr.Mbox = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Mbox = o + } else { + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad RP Mbox", l}, "" + } + if rr.Mbox[l.length-1] != '.' { + rr.Mbox = appendOrigin(rr.Mbox, o) + } + } + <-c // zBlank + l = <-c + rr.Txt = l.token + if l.token == "@" { + rr.Txt = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad RP Txt", l}, "" + } + if rr.Txt[l.length-1] != '.' { + rr.Txt = appendOrigin(rr.Txt, o) + } + return rr, nil, "" +} + +func setMR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(MR) + rr.Hdr = h + + l := <-c + rr.Mr = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Mr = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad MR Mr", l}, "" + } + if rr.Mr[l.length-1] != '.' { + rr.Mr = appendOrigin(rr.Mr, o) + } + return rr, nil, "" +} + +func setMB(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(MB) + rr.Hdr = h + + l := <-c + rr.Mb = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Mb = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad MB Mb", l}, "" + } + if rr.Mb[l.length-1] != '.' { + rr.Mb = appendOrigin(rr.Mb, o) + } + return rr, nil, "" +} + +func setMG(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(MG) + rr.Hdr = h + + l := <-c + rr.Mg = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Mg = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad MG Mg", l}, "" + } + if rr.Mg[l.length-1] != '.' { + rr.Mg = appendOrigin(rr.Mg, o) + } + return rr, nil, "" +} + +func setHINFO(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(HINFO) + rr.Hdr = h + + chunks, e, c1 := endingToTxtSlice(c, "bad HINFO Fields", f) + if e != nil { + return nil, e, c1 + } + + if ln := len(chunks); ln == 0 { + return rr, nil, "" + } else if ln == 1 { + // Can we split it? + if out := strings.Fields(chunks[0]); len(out) > 1 { + chunks = out + } else { + chunks = append(chunks, "") + } + } + + rr.Cpu = chunks[0] + rr.Os = strings.Join(chunks[1:], " ") + + return rr, nil, "" +} + +func setMINFO(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(MINFO) + rr.Hdr = h + + l := <-c + rr.Rmail = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Rmail = o + } else { + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad MINFO Rmail", l}, "" + } + if rr.Rmail[l.length-1] != '.' { + rr.Rmail = appendOrigin(rr.Rmail, o) + } + } + <-c // zBlank + l = <-c + rr.Email = l.token + if l.token == "@" { + rr.Email = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad MINFO Email", l}, "" + } + if rr.Email[l.length-1] != '.' { + rr.Email = appendOrigin(rr.Email, o) + } + return rr, nil, "" +} + +func setMF(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(MF) + rr.Hdr = h + + l := <-c + rr.Mf = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Mf = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad MF Mf", l}, "" + } + if rr.Mf[l.length-1] != '.' { + rr.Mf = appendOrigin(rr.Mf, o) + } + return rr, nil, "" +} + +func setMD(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(MD) + rr.Hdr = h + + l := <-c + rr.Md = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Md = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad MD Md", l}, "" + } + if rr.Md[l.length-1] != '.' { + rr.Md = appendOrigin(rr.Md, o) + } + return rr, nil, "" +} + +func setMX(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(MX) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad MX Pref", l}, "" + } + rr.Preference = uint16(i) + <-c // zBlank + l = <-c // zString + rr.Mx = l.token + if l.token == "@" { + rr.Mx = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad MX Mx", l}, "" + } + if rr.Mx[l.length-1] != '.' { + rr.Mx = appendOrigin(rr.Mx, o) + } + return rr, nil, "" +} + +func setRT(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(RT) + rr.Hdr = h + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil { + return nil, &ParseError{f, "bad RT Preference", l}, "" + } + rr.Preference = uint16(i) + <-c // zBlank + l = <-c // zString + rr.Host = l.token + if l.token == "@" { + rr.Host = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad RT Host", l}, "" + } + if rr.Host[l.length-1] != '.' { + rr.Host = appendOrigin(rr.Host, o) + } + return rr, nil, "" +} + +func setAFSDB(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(AFSDB) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad AFSDB Subtype", l}, "" + } + rr.Subtype = uint16(i) + <-c // zBlank + l = <-c // zString + rr.Hostname = l.token + if l.token == "@" { + rr.Hostname = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad AFSDB Hostname", l}, "" + } + if rr.Hostname[l.length-1] != '.' { + rr.Hostname = appendOrigin(rr.Hostname, o) + } + return rr, nil, "" +} + +func setX25(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(X25) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + if l.err { + return nil, &ParseError{f, "bad X25 PSDNAddress", l}, "" + } + rr.PSDNAddress = l.token + return rr, nil, "" +} + +func setKX(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(KX) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad KX Pref", l}, "" + } + rr.Preference = uint16(i) + <-c // zBlank + l = <-c // zString + rr.Exchanger = l.token + if l.token == "@" { + rr.Exchanger = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad KX Exchanger", l}, "" + } + if rr.Exchanger[l.length-1] != '.' { + rr.Exchanger = appendOrigin(rr.Exchanger, o) + } + return rr, nil, "" +} + +func setCNAME(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(CNAME) + rr.Hdr = h + + l := <-c + rr.Target = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Target = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad CNAME Target", l}, "" + } + if rr.Target[l.length-1] != '.' { + rr.Target = appendOrigin(rr.Target, o) + } + return rr, nil, "" +} + +func setDNAME(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(DNAME) + rr.Hdr = h + + l := <-c + rr.Target = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Target = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad CNAME Target", l}, "" + } + if rr.Target[l.length-1] != '.' { + rr.Target = appendOrigin(rr.Target, o) + } + return rr, nil, "" +} + +func setSOA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(SOA) + rr.Hdr = h + + l := <-c + rr.Ns = l.token + if l.length == 0 { + return rr, nil, "" + } + <-c // zBlank + if l.token == "@" { + rr.Ns = o + } else { + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad SOA Ns", l}, "" + } + if rr.Ns[l.length-1] != '.' { + rr.Ns = appendOrigin(rr.Ns, o) + } + } + + l = <-c + rr.Mbox = l.token + if l.token == "@" { + rr.Mbox = o + } else { + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad SOA Mbox", l}, "" + } + if rr.Mbox[l.length-1] != '.' { + rr.Mbox = appendOrigin(rr.Mbox, o) + } + } + <-c // zBlank + + var ( + v uint32 + ok bool + ) + for i := 0; i < 5; i++ { + l = <-c + if l.err { + return nil, &ParseError{f, "bad SOA zone parameter", l}, "" + } + if j, e := strconv.Atoi(l.token); e != nil { + if i == 0 { + // Serial should be a number + return nil, &ParseError{f, "bad SOA zone parameter", l}, "" + } + if v, ok = stringToTtl(l.token); !ok { + return nil, &ParseError{f, "bad SOA zone parameter", l}, "" + + } + } else { + v = uint32(j) + } + switch i { + case 0: + rr.Serial = v + <-c // zBlank + case 1: + rr.Refresh = v + <-c // zBlank + case 2: + rr.Retry = v + <-c // zBlank + case 3: + rr.Expire = v + <-c // zBlank + case 4: + rr.Minttl = v + } + } + return rr, nil, "" +} + +func setSRV(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(SRV) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad SRV Priority", l}, "" + } + rr.Priority = uint16(i) + <-c // zBlank + l = <-c // zString + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad SRV Weight", l}, "" + } + rr.Weight = uint16(i) + <-c // zBlank + l = <-c // zString + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad SRV Port", l}, "" + } + rr.Port = uint16(i) + <-c // zBlank + l = <-c // zString + rr.Target = l.token + if l.token == "@" { + rr.Target = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad SRV Target", l}, "" + } + if rr.Target[l.length-1] != '.' { + rr.Target = appendOrigin(rr.Target, o) + } + return rr, nil, "" +} + +func setNAPTR(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(NAPTR) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad NAPTR Order", l}, "" + } + rr.Order = uint16(i) + <-c // zBlank + l = <-c // zString + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad NAPTR Preference", l}, "" + } + rr.Preference = uint16(i) + // Flags + <-c // zBlank + l = <-c // _QUOTE + if l.value != zQuote { + return nil, &ParseError{f, "bad NAPTR Flags", l}, "" + } + l = <-c // Either String or Quote + if l.value == zString { + rr.Flags = l.token + l = <-c // _QUOTE + if l.value != zQuote { + return nil, &ParseError{f, "bad NAPTR Flags", l}, "" + } + } else if l.value == zQuote { + rr.Flags = "" + } else { + return nil, &ParseError{f, "bad NAPTR Flags", l}, "" + } + + // Service + <-c // zBlank + l = <-c // _QUOTE + if l.value != zQuote { + return nil, &ParseError{f, "bad NAPTR Service", l}, "" + } + l = <-c // Either String or Quote + if l.value == zString { + rr.Service = l.token + l = <-c // _QUOTE + if l.value != zQuote { + return nil, &ParseError{f, "bad NAPTR Service", l}, "" + } + } else if l.value == zQuote { + rr.Service = "" + } else { + return nil, &ParseError{f, "bad NAPTR Service", l}, "" + } + + // Regexp + <-c // zBlank + l = <-c // _QUOTE + if l.value != zQuote { + return nil, &ParseError{f, "bad NAPTR Regexp", l}, "" + } + l = <-c // Either String or Quote + if l.value == zString { + rr.Regexp = l.token + l = <-c // _QUOTE + if l.value != zQuote { + return nil, &ParseError{f, "bad NAPTR Regexp", l}, "" + } + } else if l.value == zQuote { + rr.Regexp = "" + } else { + return nil, &ParseError{f, "bad NAPTR Regexp", l}, "" + } + // After quote no space?? + <-c // zBlank + l = <-c // zString + rr.Replacement = l.token + if l.token == "@" { + rr.Replacement = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad NAPTR Replacement", l}, "" + } + if rr.Replacement[l.length-1] != '.' { + rr.Replacement = appendOrigin(rr.Replacement, o) + } + return rr, nil, "" +} + +func setTALINK(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(TALINK) + rr.Hdr = h + + l := <-c + rr.PreviousName = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.PreviousName = o + } else { + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad TALINK PreviousName", l}, "" + } + if rr.PreviousName[l.length-1] != '.' { + rr.PreviousName = appendOrigin(rr.PreviousName, o) + } + } + <-c // zBlank + l = <-c + rr.NextName = l.token + if l.token == "@" { + rr.NextName = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad TALINK NextName", l}, "" + } + if rr.NextName[l.length-1] != '.' { + rr.NextName = appendOrigin(rr.NextName, o) + } + return rr, nil, "" +} + +func setLOC(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(LOC) + rr.Hdr = h + // Non zero defaults for LOC record, see RFC 1876, Section 3. + rr.HorizPre = 165 // 10000 + rr.VertPre = 162 // 10 + rr.Size = 18 // 1 + ok := false + // North + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad LOC Latitude", l}, "" + } + rr.Latitude = 1000 * 60 * 60 * uint32(i) + + <-c // zBlank + // Either number, 'N' or 'S' + l = <-c + if rr.Latitude, ok = locCheckNorth(l.token, rr.Latitude); ok { + goto East + } + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad LOC Latitude minutes", l}, "" + } + rr.Latitude += 1000 * 60 * uint32(i) + + <-c // zBlank + l = <-c + if i, e := strconv.ParseFloat(l.token, 32); e != nil || l.err { + return nil, &ParseError{f, "bad LOC Latitude seconds", l}, "" + } else { + rr.Latitude += uint32(1000 * i) + } + <-c // zBlank + // Either number, 'N' or 'S' + l = <-c + if rr.Latitude, ok = locCheckNorth(l.token, rr.Latitude); ok { + goto East + } + // If still alive, flag an error + return nil, &ParseError{f, "bad LOC Latitude North/South", l}, "" + +East: + // East + <-c // zBlank + l = <-c + if i, e := strconv.Atoi(l.token); e != nil || l.err { + return nil, &ParseError{f, "bad LOC Longitude", l}, "" + } else { + rr.Longitude = 1000 * 60 * 60 * uint32(i) + } + <-c // zBlank + // Either number, 'E' or 'W' + l = <-c + if rr.Longitude, ok = locCheckEast(l.token, rr.Longitude); ok { + goto Altitude + } + if i, e := strconv.Atoi(l.token); e != nil || l.err { + return nil, &ParseError{f, "bad LOC Longitude minutes", l}, "" + } else { + rr.Longitude += 1000 * 60 * uint32(i) + } + <-c // zBlank + l = <-c + if i, e := strconv.ParseFloat(l.token, 32); e != nil || l.err { + return nil, &ParseError{f, "bad LOC Longitude seconds", l}, "" + } else { + rr.Longitude += uint32(1000 * i) + } + <-c // zBlank + // Either number, 'E' or 'W' + l = <-c + if rr.Longitude, ok = locCheckEast(l.token, rr.Longitude); ok { + goto Altitude + } + // If still alive, flag an error + return nil, &ParseError{f, "bad LOC Longitude East/West", l}, "" + +Altitude: + <-c // zBlank + l = <-c + if l.length == 0 || l.err { + return nil, &ParseError{f, "bad LOC Altitude", l}, "" + } + if l.token[len(l.token)-1] == 'M' || l.token[len(l.token)-1] == 'm' { + l.token = l.token[0 : len(l.token)-1] + } + if i, e := strconv.ParseFloat(l.token, 32); e != nil { + return nil, &ParseError{f, "bad LOC Altitude", l}, "" + } else { + rr.Altitude = uint32(i*100.0 + 10000000.0 + 0.5) + } + + // And now optionally the other values + l = <-c + count := 0 + for l.value != zNewline && l.value != zEOF { + switch l.value { + case zString: + switch count { + case 0: // Size + e, m, ok := stringToCm(l.token) + if !ok { + return nil, &ParseError{f, "bad LOC Size", l}, "" + } + rr.Size = (e & 0x0f) | (m << 4 & 0xf0) + case 1: // HorizPre + e, m, ok := stringToCm(l.token) + if !ok { + return nil, &ParseError{f, "bad LOC HorizPre", l}, "" + } + rr.HorizPre = (e & 0x0f) | (m << 4 & 0xf0) + case 2: // VertPre + e, m, ok := stringToCm(l.token) + if !ok { + return nil, &ParseError{f, "bad LOC VertPre", l}, "" + } + rr.VertPre = (e & 0x0f) | (m << 4 & 0xf0) + } + count++ + case zBlank: + // Ok + default: + return nil, &ParseError{f, "bad LOC Size, HorizPre or VertPre", l}, "" + } + l = <-c + } + return rr, nil, "" +} + +func setHIP(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(HIP) + rr.Hdr = h + + // HitLength is not represented + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad HIP PublicKeyAlgorithm", l}, "" + } + rr.PublicKeyAlgorithm = uint8(i) + <-c // zBlank + l = <-c // zString + if l.length == 0 || l.err { + return nil, &ParseError{f, "bad HIP Hit", l}, "" + } + rr.Hit = l.token // This can not contain spaces, see RFC 5205 Section 6. + rr.HitLength = uint8(len(rr.Hit)) / 2 + + <-c // zBlank + l = <-c // zString + if l.length == 0 || l.err { + return nil, &ParseError{f, "bad HIP PublicKey", l}, "" + } + rr.PublicKey = l.token // This cannot contain spaces + rr.PublicKeyLength = uint16(base64.StdEncoding.DecodedLen(len(rr.PublicKey))) + + // RendezvousServers (if any) + l = <-c + var xs []string + for l.value != zNewline && l.value != zEOF { + switch l.value { + case zString: + if l.token == "@" { + xs = append(xs, o) + l = <-c + continue + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad HIP RendezvousServers", l}, "" + } + if l.token[l.length-1] != '.' { + l.token = appendOrigin(l.token, o) + } + xs = append(xs, l.token) + case zBlank: + // Ok + default: + return nil, &ParseError{f, "bad HIP RendezvousServers", l}, "" + } + l = <-c + } + rr.RendezvousServers = xs + return rr, nil, l.comment +} + +func setCERT(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(CERT) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + if v, ok := StringToCertType[l.token]; ok { + rr.Type = v + } else if i, e := strconv.Atoi(l.token); e != nil { + return nil, &ParseError{f, "bad CERT Type", l}, "" + } else { + rr.Type = uint16(i) + } + <-c // zBlank + l = <-c // zString + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad CERT KeyTag", l}, "" + } + rr.KeyTag = uint16(i) + <-c // zBlank + l = <-c // zString + if v, ok := StringToAlgorithm[l.token]; ok { + rr.Algorithm = v + } else if i, e := strconv.Atoi(l.token); e != nil { + return nil, &ParseError{f, "bad CERT Algorithm", l}, "" + } else { + rr.Algorithm = uint8(i) + } + s, e1, c1 := endingToString(c, "bad CERT Certificate", f) + if e1 != nil { + return nil, e1, c1 + } + rr.Certificate = s + return rr, nil, c1 +} + +func setOPENPGPKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(OPENPGPKEY) + rr.Hdr = h + + s, e, c1 := endingToString(c, "bad OPENPGPKEY PublicKey", f) + if e != nil { + return nil, e, c1 + } + rr.PublicKey = s + return rr, nil, c1 +} + +func setSIG(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + r, e, s := setRRSIG(h, c, o, f) + if r != nil { + return &SIG{*r.(*RRSIG)}, e, s + } + return nil, e, s +} + +func setRRSIG(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(RRSIG) + rr.Hdr = h + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + if t, ok := StringToType[l.tokenUpper]; !ok { + if strings.HasPrefix(l.tokenUpper, "TYPE") { + t, ok = typeToInt(l.tokenUpper) + if !ok { + return nil, &ParseError{f, "bad RRSIG Typecovered", l}, "" + } + rr.TypeCovered = t + } else { + return nil, &ParseError{f, "bad RRSIG Typecovered", l}, "" + } + } else { + rr.TypeCovered = t + } + <-c // zBlank + l = <-c + i, err := strconv.Atoi(l.token) + if err != nil || l.err { + return nil, &ParseError{f, "bad RRSIG Algorithm", l}, "" + } + rr.Algorithm = uint8(i) + <-c // zBlank + l = <-c + i, err = strconv.Atoi(l.token) + if err != nil || l.err { + return nil, &ParseError{f, "bad RRSIG Labels", l}, "" + } + rr.Labels = uint8(i) + <-c // zBlank + l = <-c + i, err = strconv.Atoi(l.token) + if err != nil || l.err { + return nil, &ParseError{f, "bad RRSIG OrigTtl", l}, "" + } + rr.OrigTtl = uint32(i) + <-c // zBlank + l = <-c + if i, err := StringToTime(l.token); err != nil { + // Try to see if all numeric and use it as epoch + if i, err := strconv.ParseInt(l.token, 10, 64); err == nil { + // TODO(miek): error out on > MAX_UINT32, same below + rr.Expiration = uint32(i) + } else { + return nil, &ParseError{f, "bad RRSIG Expiration", l}, "" + } + } else { + rr.Expiration = i + } + <-c // zBlank + l = <-c + if i, err := StringToTime(l.token); err != nil { + if i, err := strconv.ParseInt(l.token, 10, 64); err == nil { + rr.Inception = uint32(i) + } else { + return nil, &ParseError{f, "bad RRSIG Inception", l}, "" + } + } else { + rr.Inception = i + } + <-c // zBlank + l = <-c + i, err = strconv.Atoi(l.token) + if err != nil || l.err { + return nil, &ParseError{f, "bad RRSIG KeyTag", l}, "" + } + rr.KeyTag = uint16(i) + <-c // zBlank + l = <-c + rr.SignerName = l.token + if l.token == "@" { + rr.SignerName = o + } else { + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad RRSIG SignerName", l}, "" + } + if rr.SignerName[l.length-1] != '.' { + rr.SignerName = appendOrigin(rr.SignerName, o) + } + } + s, e, c1 := endingToString(c, "bad RRSIG Signature", f) + if e != nil { + return nil, e, c1 + } + rr.Signature = s + return rr, nil, c1 +} + +func setNSEC(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(NSEC) + rr.Hdr = h + + l := <-c + rr.NextDomain = l.token + if l.length == 0 { + return rr, nil, l.comment + } + if l.token == "@" { + rr.NextDomain = o + } else { + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad NSEC NextDomain", l}, "" + } + if rr.NextDomain[l.length-1] != '.' { + rr.NextDomain = appendOrigin(rr.NextDomain, o) + } + } + + rr.TypeBitMap = make([]uint16, 0) + var ( + k uint16 + ok bool + ) + l = <-c + for l.value != zNewline && l.value != zEOF { + switch l.value { + case zBlank: + // Ok + case zString: + if k, ok = StringToType[l.tokenUpper]; !ok { + if k, ok = typeToInt(l.tokenUpper); !ok { + return nil, &ParseError{f, "bad NSEC TypeBitMap", l}, "" + } + } + rr.TypeBitMap = append(rr.TypeBitMap, k) + default: + return nil, &ParseError{f, "bad NSEC TypeBitMap", l}, "" + } + l = <-c + } + return rr, nil, l.comment +} + +func setNSEC3(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(NSEC3) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad NSEC3 Hash", l}, "" + } + rr.Hash = uint8(i) + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad NSEC3 Flags", l}, "" + } + rr.Flags = uint8(i) + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad NSEC3 Iterations", l}, "" + } + rr.Iterations = uint16(i) + <-c + l = <-c + if len(l.token) == 0 || l.err { + return nil, &ParseError{f, "bad NSEC3 Salt", l}, "" + } + rr.SaltLength = uint8(len(l.token)) / 2 + rr.Salt = l.token + + <-c + l = <-c + if len(l.token) == 0 || l.err { + return nil, &ParseError{f, "bad NSEC3 NextDomain", l}, "" + } + rr.HashLength = 20 // Fix for NSEC3 (sha1 160 bits) + rr.NextDomain = l.token + + rr.TypeBitMap = make([]uint16, 0) + var ( + k uint16 + ok bool + ) + l = <-c + for l.value != zNewline && l.value != zEOF { + switch l.value { + case zBlank: + // Ok + case zString: + if k, ok = StringToType[l.tokenUpper]; !ok { + if k, ok = typeToInt(l.tokenUpper); !ok { + return nil, &ParseError{f, "bad NSEC3 TypeBitMap", l}, "" + } + } + rr.TypeBitMap = append(rr.TypeBitMap, k) + default: + return nil, &ParseError{f, "bad NSEC3 TypeBitMap", l}, "" + } + l = <-c + } + return rr, nil, l.comment +} + +func setNSEC3PARAM(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(NSEC3PARAM) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad NSEC3PARAM Hash", l}, "" + } + rr.Hash = uint8(i) + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad NSEC3PARAM Flags", l}, "" + } + rr.Flags = uint8(i) + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad NSEC3PARAM Iterations", l}, "" + } + rr.Iterations = uint16(i) + <-c + l = <-c + rr.SaltLength = uint8(len(l.token)) + rr.Salt = l.token + return rr, nil, "" +} + +func setEUI48(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(EUI48) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + if l.length != 17 || l.err { + return nil, &ParseError{f, "bad EUI48 Address", l}, "" + } + addr := make([]byte, 12) + dash := 0 + for i := 0; i < 10; i += 2 { + addr[i] = l.token[i+dash] + addr[i+1] = l.token[i+1+dash] + dash++ + if l.token[i+1+dash] != '-' { + return nil, &ParseError{f, "bad EUI48 Address", l}, "" + } + } + addr[10] = l.token[15] + addr[11] = l.token[16] + + i, e := strconv.ParseUint(string(addr), 16, 48) + if e != nil { + return nil, &ParseError{f, "bad EUI48 Address", l}, "" + } + rr.Address = i + return rr, nil, "" +} + +func setEUI64(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(EUI64) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + if l.length != 23 || l.err { + return nil, &ParseError{f, "bad EUI64 Address", l}, "" + } + addr := make([]byte, 16) + dash := 0 + for i := 0; i < 14; i += 2 { + addr[i] = l.token[i+dash] + addr[i+1] = l.token[i+1+dash] + dash++ + if l.token[i+1+dash] != '-' { + return nil, &ParseError{f, "bad EUI64 Address", l}, "" + } + } + addr[14] = l.token[21] + addr[15] = l.token[22] + + i, e := strconv.ParseUint(string(addr), 16, 64) + if e != nil { + return nil, &ParseError{f, "bad EUI68 Address", l}, "" + } + rr.Address = uint64(i) + return rr, nil, "" +} + +func setSSHFP(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(SSHFP) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad SSHFP Algorithm", l}, "" + } + rr.Algorithm = uint8(i) + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad SSHFP Type", l}, "" + } + rr.Type = uint8(i) + <-c // zBlank + s, e1, c1 := endingToString(c, "bad SSHFP Fingerprint", f) + if e1 != nil { + return nil, e1, c1 + } + rr.FingerPrint = s + return rr, nil, "" +} + +func setDNSKEYs(h RR_Header, c chan lex, o, f, typ string) (RR, *ParseError, string) { + rr := new(DNSKEY) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad " + typ + " Flags", l}, "" + } + rr.Flags = uint16(i) + <-c // zBlank + l = <-c // zString + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad " + typ + " Protocol", l}, "" + } + rr.Protocol = uint8(i) + <-c // zBlank + l = <-c // zString + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad " + typ + " Algorithm", l}, "" + } + rr.Algorithm = uint8(i) + s, e1, c1 := endingToString(c, "bad "+typ+" PublicKey", f) + if e1 != nil { + return nil, e1, c1 + } + rr.PublicKey = s + return rr, nil, c1 +} + +func setKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + r, e, s := setDNSKEYs(h, c, o, f, "KEY") + if r != nil { + return &KEY{*r.(*DNSKEY)}, e, s + } + return nil, e, s +} + +func setDNSKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + r, e, s := setDNSKEYs(h, c, o, f, "DNSKEY") + return r, e, s +} + +func setCDNSKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + r, e, s := setDNSKEYs(h, c, o, f, "CDNSKEY") + if r != nil { + return &CDNSKEY{*r.(*DNSKEY)}, e, s + } + return nil, e, s +} + +func setRKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(RKEY) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad RKEY Flags", l}, "" + } + rr.Flags = uint16(i) + <-c // zBlank + l = <-c // zString + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad RKEY Protocol", l}, "" + } + rr.Protocol = uint8(i) + <-c // zBlank + l = <-c // zString + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad RKEY Algorithm", l}, "" + } + rr.Algorithm = uint8(i) + s, e1, c1 := endingToString(c, "bad RKEY PublicKey", f) + if e1 != nil { + return nil, e1, c1 + } + rr.PublicKey = s + return rr, nil, c1 +} + +func setEID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(EID) + rr.Hdr = h + s, e, c1 := endingToString(c, "bad EID Endpoint", f) + if e != nil { + return nil, e, c1 + } + rr.Endpoint = s + return rr, nil, c1 +} + +func setNIMLOC(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(NIMLOC) + rr.Hdr = h + s, e, c1 := endingToString(c, "bad NIMLOC Locator", f) + if e != nil { + return nil, e, c1 + } + rr.Locator = s + return rr, nil, c1 +} + +func setGPOS(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(GPOS) + rr.Hdr = h + l := <-c + if l.length == 0 { + return rr, nil, "" + } + _, e := strconv.ParseFloat(l.token, 64) + if e != nil || l.err { + return nil, &ParseError{f, "bad GPOS Longitude", l}, "" + } + rr.Longitude = l.token + <-c // zBlank + l = <-c + _, e = strconv.ParseFloat(l.token, 64) + if e != nil || l.err { + return nil, &ParseError{f, "bad GPOS Latitude", l}, "" + } + rr.Latitude = l.token + <-c // zBlank + l = <-c + _, e = strconv.ParseFloat(l.token, 64) + if e != nil || l.err { + return nil, &ParseError{f, "bad GPOS Altitude", l}, "" + } + rr.Altitude = l.token + return rr, nil, "" +} + +func setDSs(h RR_Header, c chan lex, o, f, typ string) (RR, *ParseError, string) { + rr := new(DS) + rr.Hdr = h + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad " + typ + " KeyTag", l}, "" + } + rr.KeyTag = uint16(i) + <-c // zBlank + l = <-c + if i, e := strconv.Atoi(l.token); e != nil { + i, ok := StringToAlgorithm[l.tokenUpper] + if !ok || l.err { + return nil, &ParseError{f, "bad " + typ + " Algorithm", l}, "" + } + rr.Algorithm = i + } else { + rr.Algorithm = uint8(i) + } + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad " + typ + " DigestType", l}, "" + } + rr.DigestType = uint8(i) + s, e1, c1 := endingToString(c, "bad "+typ+" Digest", f) + if e1 != nil { + return nil, e1, c1 + } + rr.Digest = s + return rr, nil, c1 +} + +func setDS(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + r, e, s := setDSs(h, c, o, f, "DS") + return r, e, s +} + +func setDLV(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + r, e, s := setDSs(h, c, o, f, "DLV") + if r != nil { + return &DLV{*r.(*DS)}, e, s + } + return nil, e, s +} + +func setCDS(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + r, e, s := setDSs(h, c, o, f, "CDS") + if r != nil { + return &CDS{*r.(*DS)}, e, s + } + return nil, e, s +} + +func setTA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(TA) + rr.Hdr = h + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad TA KeyTag", l}, "" + } + rr.KeyTag = uint16(i) + <-c // zBlank + l = <-c + if i, e := strconv.Atoi(l.token); e != nil { + i, ok := StringToAlgorithm[l.tokenUpper] + if !ok || l.err { + return nil, &ParseError{f, "bad TA Algorithm", l}, "" + } + rr.Algorithm = i + } else { + rr.Algorithm = uint8(i) + } + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad TA DigestType", l}, "" + } + rr.DigestType = uint8(i) + s, e, c1 := endingToString(c, "bad TA Digest", f) + if e != nil { + return nil, e.(*ParseError), c1 + } + rr.Digest = s + return rr, nil, c1 +} + +func setTLSA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(TLSA) + rr.Hdr = h + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad TLSA Usage", l}, "" + } + rr.Usage = uint8(i) + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad TLSA Selector", l}, "" + } + rr.Selector = uint8(i) + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad TLSA MatchingType", l}, "" + } + rr.MatchingType = uint8(i) + // So this needs be e2 (i.e. different than e), because...??t + s, e2, c1 := endingToString(c, "bad TLSA Certificate", f) + if e2 != nil { + return nil, e2, c1 + } + rr.Certificate = s + return rr, nil, c1 +} + +func setRFC3597(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(RFC3597) + rr.Hdr = h + l := <-c + if l.token != "\\#" { + return nil, &ParseError{f, "bad RFC3597 Rdata", l}, "" + } + <-c // zBlank + l = <-c + rdlength, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad RFC3597 Rdata ", l}, "" + } + + s, e1, c1 := endingToString(c, "bad RFC3597 Rdata", f) + if e1 != nil { + return nil, e1, c1 + } + if rdlength*2 != len(s) { + return nil, &ParseError{f, "bad RFC3597 Rdata", l}, "" + } + rr.Rdata = s + return rr, nil, c1 +} + +func setSPF(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(SPF) + rr.Hdr = h + + s, e, c1 := endingToTxtSlice(c, "bad SPF Txt", f) + if e != nil { + return nil, e, "" + } + rr.Txt = s + return rr, nil, c1 +} + +func setTXT(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(TXT) + rr.Hdr = h + + // no zBlank reading here, because all this rdata is TXT + s, e, c1 := endingToTxtSlice(c, "bad TXT Txt", f) + if e != nil { + return nil, e, "" + } + rr.Txt = s + return rr, nil, c1 +} + +// identical to setTXT +func setNINFO(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(NINFO) + rr.Hdr = h + + s, e, c1 := endingToTxtSlice(c, "bad NINFO ZSData", f) + if e != nil { + return nil, e, "" + } + rr.ZSData = s + return rr, nil, c1 +} + +func setURI(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(URI) + rr.Hdr = h + + l := <-c + if l.length == 0 { // Dynamic updates. + return rr, nil, "" + } + + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad URI Priority", l}, "" + } + rr.Priority = uint16(i) + <-c // zBlank + l = <-c + i, e = strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad URI Weight", l}, "" + } + rr.Weight = uint16(i) + + <-c // zBlank + s, err, c1 := endingToTxtSlice(c, "bad URI Target", f) + if err != nil { + return nil, err, "" + } + if len(s) > 1 { + return nil, &ParseError{f, "bad URI Target", l}, "" + } + rr.Target = s[0] + return rr, nil, c1 +} + +func setDHCID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + // awesome record to parse! + rr := new(DHCID) + rr.Hdr = h + + s, e, c1 := endingToString(c, "bad DHCID Digest", f) + if e != nil { + return nil, e, c1 + } + rr.Digest = s + return rr, nil, c1 +} + +func setNID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(NID) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad NID Preference", l}, "" + } + rr.Preference = uint16(i) + <-c // zBlank + l = <-c // zString + u, err := stringToNodeID(l) + if err != nil || l.err { + return nil, err, "" + } + rr.NodeID = u + return rr, nil, "" +} + +func setL32(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(L32) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad L32 Preference", l}, "" + } + rr.Preference = uint16(i) + <-c // zBlank + l = <-c // zString + rr.Locator32 = net.ParseIP(l.token) + if rr.Locator32 == nil || l.err { + return nil, &ParseError{f, "bad L32 Locator", l}, "" + } + return rr, nil, "" +} + +func setLP(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(LP) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad LP Preference", l}, "" + } + rr.Preference = uint16(i) + <-c // zBlank + l = <-c // zString + rr.Fqdn = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Fqdn = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad LP Fqdn", l}, "" + } + if rr.Fqdn[l.length-1] != '.' { + rr.Fqdn = appendOrigin(rr.Fqdn, o) + } + return rr, nil, "" +} + +func setL64(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(L64) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad L64 Preference", l}, "" + } + rr.Preference = uint16(i) + <-c // zBlank + l = <-c // zString + u, err := stringToNodeID(l) + if err != nil || l.err { + return nil, err, "" + } + rr.Locator64 = u + return rr, nil, "" +} + +func setUID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(UID) + rr.Hdr = h + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad UID Uid", l}, "" + } + rr.Uid = uint32(i) + return rr, nil, "" +} + +func setGID(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(GID) + rr.Hdr = h + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad GID Gid", l}, "" + } + rr.Gid = uint32(i) + return rr, nil, "" +} + +func setUINFO(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(UINFO) + rr.Hdr = h + s, e, c1 := endingToTxtSlice(c, "bad UINFO Uinfo", f) + if e != nil { + return nil, e, "" + } + rr.Uinfo = s[0] // silently discard anything above + return rr, nil, c1 +} + +func setPX(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(PX) + rr.Hdr = h + + l := <-c + if l.length == 0 { + return rr, nil, "" + } + i, e := strconv.Atoi(l.token) + if e != nil || l.err { + return nil, &ParseError{f, "bad PX Preference", l}, "" + } + rr.Preference = uint16(i) + <-c // zBlank + l = <-c // zString + rr.Map822 = l.token + if l.length == 0 { + return rr, nil, "" + } + if l.token == "@" { + rr.Map822 = o + return rr, nil, "" + } + _, ok := IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad PX Map822", l}, "" + } + if rr.Map822[l.length-1] != '.' { + rr.Map822 = appendOrigin(rr.Map822, o) + } + <-c // zBlank + l = <-c // zString + rr.Mapx400 = l.token + if l.token == "@" { + rr.Mapx400 = o + return rr, nil, "" + } + _, ok = IsDomainName(l.token) + if !ok || l.length == 0 || l.err { + return nil, &ParseError{f, "bad PX Mapx400", l}, "" + } + if rr.Mapx400[l.length-1] != '.' { + rr.Mapx400 = appendOrigin(rr.Mapx400, o) + } + return rr, nil, "" +} + +func setCAA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { + rr := new(CAA) + rr.Hdr = h + l := <-c + if l.length == 0 { + return rr, nil, l.comment + } + i, err := strconv.Atoi(l.token) + if err != nil || l.err { + return nil, &ParseError{f, "bad CAA Flag", l}, "" + } + rr.Flag = uint8(i) + + <-c // zBlank + l = <-c // zString + if l.value != zString { + return nil, &ParseError{f, "bad CAA Tag", l}, "" + } + rr.Tag = l.token + + <-c // zBlank + s, e, c1 := endingToTxtSlice(c, "bad CAA Value", f) + if e != nil { + return nil, e, "" + } + if len(s) > 1 { + return nil, &ParseError{f, "bad CAA Value", l}, "" + } + rr.Value = s[0] + return rr, nil, c1 +} + +var typeToparserFunc = map[uint16]parserFunc{ + TypeAAAA: {setAAAA, false}, + TypeAFSDB: {setAFSDB, false}, + TypeA: {setA, false}, + TypeCAA: {setCAA, true}, + TypeCDS: {setCDS, true}, + TypeCDNSKEY: {setCDNSKEY, true}, + TypeCERT: {setCERT, true}, + TypeCNAME: {setCNAME, false}, + TypeDHCID: {setDHCID, true}, + TypeDLV: {setDLV, true}, + TypeDNAME: {setDNAME, false}, + TypeKEY: {setKEY, true}, + TypeDNSKEY: {setDNSKEY, true}, + TypeDS: {setDS, true}, + TypeEID: {setEID, true}, + TypeEUI48: {setEUI48, false}, + TypeEUI64: {setEUI64, false}, + TypeGID: {setGID, false}, + TypeGPOS: {setGPOS, false}, + TypeHINFO: {setHINFO, true}, + TypeHIP: {setHIP, true}, + TypeKX: {setKX, false}, + TypeL32: {setL32, false}, + TypeL64: {setL64, false}, + TypeLOC: {setLOC, true}, + TypeLP: {setLP, false}, + TypeMB: {setMB, false}, + TypeMD: {setMD, false}, + TypeMF: {setMF, false}, + TypeMG: {setMG, false}, + TypeMINFO: {setMINFO, false}, + TypeMR: {setMR, false}, + TypeMX: {setMX, false}, + TypeNAPTR: {setNAPTR, false}, + TypeNID: {setNID, false}, + TypeNIMLOC: {setNIMLOC, true}, + TypeNINFO: {setNINFO, true}, + TypeNSAPPTR: {setNSAPPTR, false}, + TypeNSEC3PARAM: {setNSEC3PARAM, false}, + TypeNSEC3: {setNSEC3, true}, + TypeNSEC: {setNSEC, true}, + TypeNS: {setNS, false}, + TypeOPENPGPKEY: {setOPENPGPKEY, true}, + TypePTR: {setPTR, false}, + TypePX: {setPX, false}, + TypeSIG: {setSIG, true}, + TypeRKEY: {setRKEY, true}, + TypeRP: {setRP, false}, + TypeRRSIG: {setRRSIG, true}, + TypeRT: {setRT, false}, + TypeSOA: {setSOA, false}, + TypeSPF: {setSPF, true}, + TypeSRV: {setSRV, false}, + TypeSSHFP: {setSSHFP, true}, + TypeTALINK: {setTALINK, false}, + TypeTA: {setTA, true}, + TypeTLSA: {setTLSA, true}, + TypeTXT: {setTXT, true}, + TypeUID: {setUID, false}, + TypeUINFO: {setUINFO, true}, + TypeURI: {setURI, true}, + TypeX25: {setX25, false}, +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/scanner.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/scanner.go new file mode 100644 index 00000000..c29bc2f3 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/scanner.go @@ -0,0 +1,43 @@ +package dns + +// Implement a simple scanner, return a byte stream from an io reader. + +import ( + "bufio" + "io" + "text/scanner" +) + +type scan struct { + src *bufio.Reader + position scanner.Position + eof bool // Have we just seen a eof +} + +func scanInit(r io.Reader) *scan { + s := new(scan) + s.src = bufio.NewReader(r) + s.position.Line = 1 + return s +} + +// tokenText returns the next byte from the input +func (s *scan) tokenText() (byte, error) { + c, err := s.src.ReadByte() + if err != nil { + return c, err + } + // delay the newline handling until the next token is delivered, + // fixes off-by-one errors when reporting a parse error. + if s.eof == true { + s.position.Line++ + s.position.Column = 0 + s.eof = false + } + if c == '\n' { + s.eof = true + return c, nil + } + s.position.Column++ + return c, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/server.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/server.go new file mode 100644 index 00000000..2b4bff49 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/server.go @@ -0,0 +1,732 @@ +// DNS server implementation. + +package dns + +import ( + "bytes" + "crypto/tls" + "encoding/binary" + "io" + "net" + "sync" + "time" +) + +// Maximum number of TCP queries before we close the socket. +const maxTCPQueries = 128 + +// Handler is implemented by any value that implements ServeDNS. +type Handler interface { + ServeDNS(w ResponseWriter, r *Msg) +} + +// A ResponseWriter interface is used by an DNS handler to +// construct an DNS response. +type ResponseWriter interface { + // LocalAddr returns the net.Addr of the server + LocalAddr() net.Addr + // RemoteAddr returns the net.Addr of the client that sent the current request. + RemoteAddr() net.Addr + // WriteMsg writes a reply back to the client. + WriteMsg(*Msg) error + // Write writes a raw buffer back to the client. + Write([]byte) (int, error) + // Close closes the connection. + Close() error + // TsigStatus returns the status of the Tsig. + TsigStatus() error + // TsigTimersOnly sets the tsig timers only boolean. + TsigTimersOnly(bool) + // Hijack lets the caller take over the connection. + // After a call to Hijack(), the DNS package will not do anything with the connection. + Hijack() +} + +type response struct { + hijacked bool // connection has been hijacked by handler + tsigStatus error + tsigTimersOnly bool + tsigRequestMAC string + tsigSecret map[string]string // the tsig secrets + udp *net.UDPConn // i/o connection if UDP was used + tcp net.Conn // i/o connection if TCP was used + udpSession *SessionUDP // oob data to get egress interface right + remoteAddr net.Addr // address of the client + writer Writer // writer to output the raw DNS bits +} + +// ServeMux is an DNS request multiplexer. It matches the +// zone name of each incoming request against a list of +// registered patterns add calls the handler for the pattern +// that most closely matches the zone name. ServeMux is DNSSEC aware, meaning +// that queries for the DS record are redirected to the parent zone (if that +// is also registered), otherwise the child gets the query. +// ServeMux is also safe for concurrent access from multiple goroutines. +type ServeMux struct { + z map[string]Handler + m *sync.RWMutex +} + +// NewServeMux allocates and returns a new ServeMux. +func NewServeMux() *ServeMux { return &ServeMux{z: make(map[string]Handler), m: new(sync.RWMutex)} } + +// DefaultServeMux is the default ServeMux used by Serve. +var DefaultServeMux = NewServeMux() + +// The HandlerFunc type is an adapter to allow the use of +// ordinary functions as DNS handlers. If f is a function +// with the appropriate signature, HandlerFunc(f) is a +// Handler object that calls f. +type HandlerFunc func(ResponseWriter, *Msg) + +// ServeDNS calls f(w, r). +func (f HandlerFunc) ServeDNS(w ResponseWriter, r *Msg) { + f(w, r) +} + +// HandleFailed returns a HandlerFunc that returns SERVFAIL for every request it gets. +func HandleFailed(w ResponseWriter, r *Msg) { + m := new(Msg) + m.SetRcode(r, RcodeServerFailure) + // does not matter if this write fails + w.WriteMsg(m) +} + +func failedHandler() Handler { return HandlerFunc(HandleFailed) } + +// ListenAndServe Starts a server on address and network specified Invoke handler +// for incoming queries. +func ListenAndServe(addr string, network string, handler Handler) error { + server := &Server{Addr: addr, Net: network, Handler: handler} + return server.ListenAndServe() +} + +// ListenAndServeTLS acts like http.ListenAndServeTLS, more information in +// http://golang.org/pkg/net/http/#ListenAndServeTLS +func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error { + cert, err := tls.LoadX509KeyPair(certFile, keyFile) + if err != nil { + return err + } + + config := tls.Config{ + Certificates: []tls.Certificate{cert}, + } + + server := &Server{ + Addr: addr, + Net: "tcp-tls", + TLSConfig: &config, + Handler: handler, + } + + return server.ListenAndServe() +} + +// ActivateAndServe activates a server with a listener from systemd, +// l and p should not both be non-nil. +// If both l and p are not nil only p will be used. +// Invoke handler for incoming queries. +func ActivateAndServe(l net.Listener, p net.PacketConn, handler Handler) error { + server := &Server{Listener: l, PacketConn: p, Handler: handler} + return server.ActivateAndServe() +} + +func (mux *ServeMux) match(q string, t uint16) Handler { + mux.m.RLock() + defer mux.m.RUnlock() + var handler Handler + b := make([]byte, len(q)) // worst case, one label of length q + off := 0 + end := false + for { + l := len(q[off:]) + for i := 0; i < l; i++ { + b[i] = q[off+i] + if b[i] >= 'A' && b[i] <= 'Z' { + b[i] |= ('a' - 'A') + } + } + if h, ok := mux.z[string(b[:l])]; ok { // 'causes garbage, might want to change the map key + if t != TypeDS { + return h + } + // Continue for DS to see if we have a parent too, if so delegeate to the parent + handler = h + } + off, end = NextLabel(q, off) + if end { + break + } + } + // Wildcard match, if we have found nothing try the root zone as a last resort. + if h, ok := mux.z["."]; ok { + return h + } + return handler +} + +// Handle adds a handler to the ServeMux for pattern. +func (mux *ServeMux) Handle(pattern string, handler Handler) { + if pattern == "" { + panic("dns: invalid pattern " + pattern) + } + mux.m.Lock() + mux.z[Fqdn(pattern)] = handler + mux.m.Unlock() +} + +// HandleFunc adds a handler function to the ServeMux for pattern. +func (mux *ServeMux) HandleFunc(pattern string, handler func(ResponseWriter, *Msg)) { + mux.Handle(pattern, HandlerFunc(handler)) +} + +// HandleRemove deregistrars the handler specific for pattern from the ServeMux. +func (mux *ServeMux) HandleRemove(pattern string) { + if pattern == "" { + panic("dns: invalid pattern " + pattern) + } + mux.m.Lock() + delete(mux.z, Fqdn(pattern)) + mux.m.Unlock() +} + +// ServeDNS dispatches the request to the handler whose +// pattern most closely matches the request message. If DefaultServeMux +// is used the correct thing for DS queries is done: a possible parent +// is sought. +// If no handler is found a standard SERVFAIL message is returned +// If the request message does not have exactly one question in the +// question section a SERVFAIL is returned, unlesss Unsafe is true. +func (mux *ServeMux) ServeDNS(w ResponseWriter, request *Msg) { + var h Handler + if len(request.Question) < 1 { // allow more than one question + h = failedHandler() + } else { + if h = mux.match(request.Question[0].Name, request.Question[0].Qtype); h == nil { + h = failedHandler() + } + } + h.ServeDNS(w, request) +} + +// Handle registers the handler with the given pattern +// in the DefaultServeMux. The documentation for +// ServeMux explains how patterns are matched. +func Handle(pattern string, handler Handler) { DefaultServeMux.Handle(pattern, handler) } + +// HandleRemove deregisters the handle with the given pattern +// in the DefaultServeMux. +func HandleRemove(pattern string) { DefaultServeMux.HandleRemove(pattern) } + +// HandleFunc registers the handler function with the given pattern +// in the DefaultServeMux. +func HandleFunc(pattern string, handler func(ResponseWriter, *Msg)) { + DefaultServeMux.HandleFunc(pattern, handler) +} + +// Writer writes raw DNS messages; each call to Write should send an entire message. +type Writer interface { + io.Writer +} + +// Reader reads raw DNS messages; each call to ReadTCP or ReadUDP should return an entire message. +type Reader interface { + // ReadTCP reads a raw message from a TCP connection. Implementations may alter + // connection properties, for example the read-deadline. + ReadTCP(conn net.Conn, timeout time.Duration) ([]byte, error) + // ReadUDP reads a raw message from a UDP connection. Implementations may alter + // connection properties, for example the read-deadline. + ReadUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) +} + +// defaultReader is an adapter for the Server struct that implements the Reader interface +// using the readTCP and readUDP func of the embedded Server. +type defaultReader struct { + *Server +} + +func (dr *defaultReader) ReadTCP(conn net.Conn, timeout time.Duration) ([]byte, error) { + return dr.readTCP(conn, timeout) +} + +func (dr *defaultReader) ReadUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) { + return dr.readUDP(conn, timeout) +} + +// DecorateReader is a decorator hook for extending or supplanting the functionality of a Reader. +// Implementations should never return a nil Reader. +type DecorateReader func(Reader) Reader + +// DecorateWriter is a decorator hook for extending or supplanting the functionality of a Writer. +// Implementations should never return a nil Writer. +type DecorateWriter func(Writer) Writer + +// A Server defines parameters for running an DNS server. +type Server struct { + // Address to listen on, ":dns" if empty. + Addr string + // if "tcp" or "tcp-tls" (DNS over TLS) it will invoke a TCP listener, otherwise an UDP one + Net string + // TCP Listener to use, this is to aid in systemd's socket activation. + Listener net.Listener + // TLS connection configuration + TLSConfig *tls.Config + // UDP "Listener" to use, this is to aid in systemd's socket activation. + PacketConn net.PacketConn + // Handler to invoke, dns.DefaultServeMux if nil. + Handler Handler + // Default buffer size to use to read incoming UDP messages. If not set + // it defaults to MinMsgSize (512 B). + UDPSize int + // The net.Conn.SetReadTimeout value for new connections, defaults to 2 * time.Second. + ReadTimeout time.Duration + // The net.Conn.SetWriteTimeout value for new connections, defaults to 2 * time.Second. + WriteTimeout time.Duration + // TCP idle timeout for multiple queries, if nil, defaults to 8 * time.Second (RFC 5966). + IdleTimeout func() time.Duration + // Secret(s) for Tsig map[]. + TsigSecret map[string]string + // Unsafe instructs the server to disregard any sanity checks and directly hand the message to + // the handler. It will specifically not check if the query has the QR bit not set. + Unsafe bool + // If NotifyStartedFunc is set it is called once the server has started listening. + NotifyStartedFunc func() + // DecorateReader is optional, allows customization of the process that reads raw DNS messages. + DecorateReader DecorateReader + // DecorateWriter is optional, allows customization of the process that writes raw DNS messages. + DecorateWriter DecorateWriter + + // Graceful shutdown handling + + inFlight sync.WaitGroup + + lock sync.RWMutex + started bool +} + +// ListenAndServe starts a nameserver on the configured address in *Server. +func (srv *Server) ListenAndServe() error { + srv.lock.Lock() + defer srv.lock.Unlock() + if srv.started { + return &Error{err: "server already started"} + } + addr := srv.Addr + if addr == "" { + addr = ":domain" + } + if srv.UDPSize == 0 { + srv.UDPSize = MinMsgSize + } + switch srv.Net { + case "tcp", "tcp4", "tcp6": + a, err := net.ResolveTCPAddr(srv.Net, addr) + if err != nil { + return err + } + l, err := net.ListenTCP(srv.Net, a) + if err != nil { + return err + } + srv.Listener = l + srv.started = true + srv.lock.Unlock() + err = srv.serveTCP(l) + srv.lock.Lock() // to satisfy the defer at the top + return err + case "tcp-tls", "tcp4-tls", "tcp6-tls": + network := "tcp" + if srv.Net == "tcp4-tls" { + network = "tcp4" + } else if srv.Net == "tcp6" { + network = "tcp6" + } + + l, err := tls.Listen(network, addr, srv.TLSConfig) + if err != nil { + return err + } + srv.Listener = l + srv.started = true + srv.lock.Unlock() + err = srv.serveTCP(l) + srv.lock.Lock() // to satisfy the defer at the top + return err + case "udp", "udp4", "udp6": + a, err := net.ResolveUDPAddr(srv.Net, addr) + if err != nil { + return err + } + l, err := net.ListenUDP(srv.Net, a) + if err != nil { + return err + } + if e := setUDPSocketOptions(l); e != nil { + return e + } + srv.PacketConn = l + srv.started = true + srv.lock.Unlock() + err = srv.serveUDP(l) + srv.lock.Lock() // to satisfy the defer at the top + return err + } + return &Error{err: "bad network"} +} + +// ActivateAndServe starts a nameserver with the PacketConn or Listener +// configured in *Server. Its main use is to start a server from systemd. +func (srv *Server) ActivateAndServe() error { + srv.lock.Lock() + defer srv.lock.Unlock() + if srv.started { + return &Error{err: "server already started"} + } + pConn := srv.PacketConn + l := srv.Listener + if pConn != nil { + if srv.UDPSize == 0 { + srv.UDPSize = MinMsgSize + } + if t, ok := pConn.(*net.UDPConn); ok { + if e := setUDPSocketOptions(t); e != nil { + return e + } + srv.started = true + srv.lock.Unlock() + e := srv.serveUDP(t) + srv.lock.Lock() // to satisfy the defer at the top + return e + } + } + if l != nil { + srv.started = true + srv.lock.Unlock() + e := srv.serveTCP(l) + srv.lock.Lock() // to satisfy the defer at the top + return e + } + return &Error{err: "bad listeners"} +} + +// Shutdown gracefully shuts down a server. After a call to Shutdown, ListenAndServe and +// ActivateAndServe will return. All in progress queries are completed before the server +// is taken down. If the Shutdown is taking longer than the reading timeout an error +// is returned. +func (srv *Server) Shutdown() error { + srv.lock.Lock() + if !srv.started { + srv.lock.Unlock() + return &Error{err: "server not started"} + } + srv.started = false + srv.lock.Unlock() + + if srv.PacketConn != nil { + srv.PacketConn.Close() + } + if srv.Listener != nil { + srv.Listener.Close() + } + + fin := make(chan bool) + go func() { + srv.inFlight.Wait() + fin <- true + }() + + select { + case <-time.After(srv.getReadTimeout()): + return &Error{err: "server shutdown is pending"} + case <-fin: + return nil + } +} + +// getReadTimeout is a helper func to use system timeout if server did not intend to change it. +func (srv *Server) getReadTimeout() time.Duration { + rtimeout := dnsTimeout + if srv.ReadTimeout != 0 { + rtimeout = srv.ReadTimeout + } + return rtimeout +} + +// serveTCP starts a TCP listener for the server. +// Each request is handled in a separate goroutine. +func (srv *Server) serveTCP(l net.Listener) error { + defer l.Close() + + if srv.NotifyStartedFunc != nil { + srv.NotifyStartedFunc() + } + + reader := Reader(&defaultReader{srv}) + if srv.DecorateReader != nil { + reader = srv.DecorateReader(reader) + } + + handler := srv.Handler + if handler == nil { + handler = DefaultServeMux + } + rtimeout := srv.getReadTimeout() + // deadline is not used here + for { + rw, err := l.Accept() + if err != nil { + if neterr, ok := err.(net.Error); ok && neterr.Temporary() { + continue + } + return err + } + m, err := reader.ReadTCP(rw, rtimeout) + srv.lock.RLock() + if !srv.started { + srv.lock.RUnlock() + return nil + } + srv.lock.RUnlock() + if err != nil { + continue + } + srv.inFlight.Add(1) + go srv.serve(rw.RemoteAddr(), handler, m, nil, nil, rw) + } +} + +// serveUDP starts a UDP listener for the server. +// Each request is handled in a separate goroutine. +func (srv *Server) serveUDP(l *net.UDPConn) error { + defer l.Close() + + if srv.NotifyStartedFunc != nil { + srv.NotifyStartedFunc() + } + + reader := Reader(&defaultReader{srv}) + if srv.DecorateReader != nil { + reader = srv.DecorateReader(reader) + } + + handler := srv.Handler + if handler == nil { + handler = DefaultServeMux + } + rtimeout := srv.getReadTimeout() + // deadline is not used here + for { + m, s, err := reader.ReadUDP(l, rtimeout) + srv.lock.RLock() + if !srv.started { + srv.lock.RUnlock() + return nil + } + srv.lock.RUnlock() + if err != nil { + continue + } + srv.inFlight.Add(1) + go srv.serve(s.RemoteAddr(), handler, m, l, s, nil) + } +} + +// Serve a new connection. +func (srv *Server) serve(a net.Addr, h Handler, m []byte, u *net.UDPConn, s *SessionUDP, t net.Conn) { + defer srv.inFlight.Done() + + w := &response{tsigSecret: srv.TsigSecret, udp: u, tcp: t, remoteAddr: a, udpSession: s} + if srv.DecorateWriter != nil { + w.writer = srv.DecorateWriter(w) + } else { + w.writer = w + } + + q := 0 // counter for the amount of TCP queries we get + + reader := Reader(&defaultReader{srv}) + if srv.DecorateReader != nil { + reader = srv.DecorateReader(reader) + } +Redo: + req := new(Msg) + err := req.Unpack(m) + if err != nil { // Send a FormatError back + x := new(Msg) + x.SetRcodeFormatError(req) + w.WriteMsg(x) + goto Exit + } + if !srv.Unsafe && req.Response { + goto Exit + } + + w.tsigStatus = nil + if w.tsigSecret != nil { + if t := req.IsTsig(); t != nil { + secret := t.Hdr.Name + if _, ok := w.tsigSecret[secret]; !ok { + w.tsigStatus = ErrKeyAlg + } + w.tsigStatus = TsigVerify(m, w.tsigSecret[secret], "", false) + w.tsigTimersOnly = false + w.tsigRequestMAC = req.Extra[len(req.Extra)-1].(*TSIG).MAC + } + } + h.ServeDNS(w, req) // Writes back to the client + +Exit: + if w.tcp == nil { + return + } + // TODO(miek): make this number configurable? + if q > maxTCPQueries { // close socket after this many queries + w.Close() + return + } + + if w.hijacked { + return // client calls Close() + } + if u != nil { // UDP, "close" and return + w.Close() + return + } + idleTimeout := tcpIdleTimeout + if srv.IdleTimeout != nil { + idleTimeout = srv.IdleTimeout() + } + m, err = reader.ReadTCP(w.tcp, idleTimeout) + if err == nil { + q++ + goto Redo + } + w.Close() + return +} + +func (srv *Server) readTCP(conn net.Conn, timeout time.Duration) ([]byte, error) { + conn.SetReadDeadline(time.Now().Add(timeout)) + l := make([]byte, 2) + n, err := conn.Read(l) + if err != nil || n != 2 { + if err != nil { + return nil, err + } + return nil, ErrShortRead + } + length := binary.BigEndian.Uint16(l) + if length == 0 { + return nil, ErrShortRead + } + m := make([]byte, int(length)) + n, err = conn.Read(m[:int(length)]) + if err != nil || n == 0 { + if err != nil { + return nil, err + } + return nil, ErrShortRead + } + i := n + for i < int(length) { + j, err := conn.Read(m[i:int(length)]) + if err != nil { + return nil, err + } + i += j + } + n = i + m = m[:n] + return m, nil +} + +func (srv *Server) readUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) { + conn.SetReadDeadline(time.Now().Add(timeout)) + m := make([]byte, srv.UDPSize) + n, s, err := ReadFromSessionUDP(conn, m) + if err != nil || n == 0 { + if err != nil { + return nil, nil, err + } + return nil, nil, ErrShortRead + } + m = m[:n] + return m, s, nil +} + +// WriteMsg implements the ResponseWriter.WriteMsg method. +func (w *response) WriteMsg(m *Msg) (err error) { + var data []byte + if w.tsigSecret != nil { // if no secrets, dont check for the tsig (which is a longer check) + if t := m.IsTsig(); t != nil { + data, w.tsigRequestMAC, err = TsigGenerate(m, w.tsigSecret[t.Hdr.Name], w.tsigRequestMAC, w.tsigTimersOnly) + if err != nil { + return err + } + _, err = w.writer.Write(data) + return err + } + } + data, err = m.Pack() + if err != nil { + return err + } + _, err = w.writer.Write(data) + return err +} + +// Write implements the ResponseWriter.Write method. +func (w *response) Write(m []byte) (int, error) { + switch { + case w.udp != nil: + n, err := WriteToSessionUDP(w.udp, m, w.udpSession) + return n, err + case w.tcp != nil: + lm := len(m) + if lm < 2 { + return 0, io.ErrShortBuffer + } + if lm > MaxMsgSize { + return 0, &Error{err: "message too large"} + } + l := make([]byte, 2, 2+lm) + binary.BigEndian.PutUint16(l, uint16(lm)) + m = append(l, m...) + + n, err := io.Copy(w.tcp, bytes.NewReader(m)) + return int(n), err + } + panic("not reached") +} + +// LocalAddr implements the ResponseWriter.LocalAddr method. +func (w *response) LocalAddr() net.Addr { + if w.tcp != nil { + return w.tcp.LocalAddr() + } + return w.udp.LocalAddr() +} + +// RemoteAddr implements the ResponseWriter.RemoteAddr method. +func (w *response) RemoteAddr() net.Addr { return w.remoteAddr } + +// TsigStatus implements the ResponseWriter.TsigStatus method. +func (w *response) TsigStatus() error { return w.tsigStatus } + +// TsigTimersOnly implements the ResponseWriter.TsigTimersOnly method. +func (w *response) TsigTimersOnly(b bool) { w.tsigTimersOnly = b } + +// Hijack implements the ResponseWriter.Hijack method. +func (w *response) Hijack() { w.hijacked = true } + +// Close implements the ResponseWriter.Close method +func (w *response) Close() error { + // Can't close the udp conn, as that is actually the listener. + if w.tcp != nil { + e := w.tcp.Close() + w.tcp = nil + return e + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/sig0.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/sig0.go new file mode 100644 index 00000000..2dce06af --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/sig0.go @@ -0,0 +1,219 @@ +package dns + +import ( + "crypto" + "crypto/dsa" + "crypto/ecdsa" + "crypto/rsa" + "encoding/binary" + "math/big" + "strings" + "time" +) + +// Sign signs a dns.Msg. It fills the signature with the appropriate data. +// The SIG record should have the SignerName, KeyTag, Algorithm, Inception +// and Expiration set. +func (rr *SIG) Sign(k crypto.Signer, m *Msg) ([]byte, error) { + if k == nil { + return nil, ErrPrivKey + } + if rr.KeyTag == 0 || len(rr.SignerName) == 0 || rr.Algorithm == 0 { + return nil, ErrKey + } + rr.Header().Rrtype = TypeSIG + rr.Header().Class = ClassANY + rr.Header().Ttl = 0 + rr.Header().Name = "." + rr.OrigTtl = 0 + rr.TypeCovered = 0 + rr.Labels = 0 + + buf := make([]byte, m.Len()+rr.len()) + mbuf, err := m.PackBuffer(buf) + if err != nil { + return nil, err + } + if &buf[0] != &mbuf[0] { + return nil, ErrBuf + } + off, err := PackRR(rr, buf, len(mbuf), nil, false) + if err != nil { + return nil, err + } + buf = buf[:off:cap(buf)] + + hash, ok := AlgorithmToHash[rr.Algorithm] + if !ok { + return nil, ErrAlg + } + + hasher := hash.New() + // Write SIG rdata + hasher.Write(buf[len(mbuf)+1+2+2+4+2:]) + // Write message + hasher.Write(buf[:len(mbuf)]) + + signature, err := sign(k, hasher.Sum(nil), hash, rr.Algorithm) + if err != nil { + return nil, err + } + + rr.Signature = toBase64(signature) + sig := string(signature) + + buf = append(buf, sig...) + if len(buf) > int(^uint16(0)) { + return nil, ErrBuf + } + // Adjust sig data length + rdoff := len(mbuf) + 1 + 2 + 2 + 4 + rdlen := binary.BigEndian.Uint16(buf[rdoff:]) + rdlen += uint16(len(sig)) + binary.BigEndian.PutUint16(buf[rdoff:], rdlen) + // Adjust additional count + adc := binary.BigEndian.Uint16(buf[10:]) + adc++ + binary.BigEndian.PutUint16(buf[10:], adc) + return buf, nil +} + +// Verify validates the message buf using the key k. +// It's assumed that buf is a valid message from which rr was unpacked. +func (rr *SIG) Verify(k *KEY, buf []byte) error { + if k == nil { + return ErrKey + } + if rr.KeyTag == 0 || len(rr.SignerName) == 0 || rr.Algorithm == 0 { + return ErrKey + } + + var hash crypto.Hash + switch rr.Algorithm { + case DSA, RSASHA1: + hash = crypto.SHA1 + case RSASHA256, ECDSAP256SHA256: + hash = crypto.SHA256 + case ECDSAP384SHA384: + hash = crypto.SHA384 + case RSASHA512: + hash = crypto.SHA512 + default: + return ErrAlg + } + hasher := hash.New() + + buflen := len(buf) + qdc := binary.BigEndian.Uint16(buf[4:]) + anc := binary.BigEndian.Uint16(buf[6:]) + auc := binary.BigEndian.Uint16(buf[8:]) + adc := binary.BigEndian.Uint16(buf[10:]) + offset := 12 + var err error + for i := uint16(0); i < qdc && offset < buflen; i++ { + _, offset, err = UnpackDomainName(buf, offset) + if err != nil { + return err + } + // Skip past Type and Class + offset += 2 + 2 + } + for i := uint16(1); i < anc+auc+adc && offset < buflen; i++ { + _, offset, err = UnpackDomainName(buf, offset) + if err != nil { + return err + } + // Skip past Type, Class and TTL + offset += 2 + 2 + 4 + if offset+1 >= buflen { + continue + } + var rdlen uint16 + rdlen = binary.BigEndian.Uint16(buf[offset:]) + offset += 2 + offset += int(rdlen) + } + if offset >= buflen { + return &Error{err: "overflowing unpacking signed message"} + } + + // offset should be just prior to SIG + bodyend := offset + // owner name SHOULD be root + _, offset, err = UnpackDomainName(buf, offset) + if err != nil { + return err + } + // Skip Type, Class, TTL, RDLen + offset += 2 + 2 + 4 + 2 + sigstart := offset + // Skip Type Covered, Algorithm, Labels, Original TTL + offset += 2 + 1 + 1 + 4 + if offset+4+4 >= buflen { + return &Error{err: "overflow unpacking signed message"} + } + expire := binary.BigEndian.Uint32(buf[offset:]) + offset += 4 + incept := binary.BigEndian.Uint32(buf[offset:]) + offset += 4 + now := uint32(time.Now().Unix()) + if now < incept || now > expire { + return ErrTime + } + // Skip key tag + offset += 2 + var signername string + signername, offset, err = UnpackDomainName(buf, offset) + if err != nil { + return err + } + // If key has come from the DNS name compression might + // have mangled the case of the name + if strings.ToLower(signername) != strings.ToLower(k.Header().Name) { + return &Error{err: "signer name doesn't match key name"} + } + sigend := offset + hasher.Write(buf[sigstart:sigend]) + hasher.Write(buf[:10]) + hasher.Write([]byte{ + byte((adc - 1) << 8), + byte(adc - 1), + }) + hasher.Write(buf[12:bodyend]) + + hashed := hasher.Sum(nil) + sig := buf[sigend:] + switch k.Algorithm { + case DSA: + pk := k.publicKeyDSA() + sig = sig[1:] + r := big.NewInt(0) + r.SetBytes(sig[:len(sig)/2]) + s := big.NewInt(0) + s.SetBytes(sig[len(sig)/2:]) + if pk != nil { + if dsa.Verify(pk, hashed, r, s) { + return nil + } + return ErrSig + } + case RSASHA1, RSASHA256, RSASHA512: + pk := k.publicKeyRSA() + if pk != nil { + return rsa.VerifyPKCS1v15(pk, hash, hashed, sig) + } + case ECDSAP256SHA256, ECDSAP384SHA384: + pk := k.publicKeyECDSA() + r := big.NewInt(0) + r.SetBytes(sig[:len(sig)/2]) + s := big.NewInt(0) + s.SetBytes(sig[len(sig)/2:]) + if pk != nil { + if ecdsa.Verify(pk, hashed, r, s) { + return nil + } + return ErrSig + } + } + return ErrKeyAlg +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/singleinflight.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/singleinflight.go new file mode 100644 index 00000000..9573c7d0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/singleinflight.go @@ -0,0 +1,57 @@ +// 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. + +// Adapted for dns package usage by Miek Gieben. + +package dns + +import "sync" +import "time" + +// call is an in-flight or completed singleflight.Do call +type call struct { + wg sync.WaitGroup + val *Msg + rtt time.Duration + err error + dups int +} + +// singleflight represents a class of work and forms a namespace in +// which units of work can be executed with duplicate suppression. +type singleflight struct { + sync.Mutex // protects m + m map[string]*call // lazily initialized +} + +// Do executes and returns the results of the given function, making +// sure that only one execution is in-flight for a given key at a +// time. If a duplicate comes in, the duplicate caller waits for the +// original to complete and receives the same results. +// The return value shared indicates whether v was given to multiple callers. +func (g *singleflight) Do(key string, fn func() (*Msg, time.Duration, error)) (v *Msg, rtt time.Duration, err error, shared bool) { + g.Lock() + if g.m == nil { + g.m = make(map[string]*call) + } + if c, ok := g.m[key]; ok { + c.dups++ + g.Unlock() + c.wg.Wait() + return c.val, c.rtt, c.err, true + } + c := new(call) + c.wg.Add(1) + g.m[key] = c + g.Unlock() + + c.val, c.rtt, c.err = fn() + c.wg.Done() + + g.Lock() + delete(g.m, key) + g.Unlock() + + return c.val, c.rtt, c.err, c.dups > 0 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/tlsa.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/tlsa.go new file mode 100644 index 00000000..34fe6615 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/tlsa.go @@ -0,0 +1,86 @@ +package dns + +import ( + "crypto/sha256" + "crypto/sha512" + "crypto/x509" + "encoding/hex" + "errors" + "io" + "net" + "strconv" +) + +// CertificateToDANE converts a certificate to a hex string as used in the TLSA record. +func CertificateToDANE(selector, matchingType uint8, cert *x509.Certificate) (string, error) { + switch matchingType { + case 0: + switch selector { + case 0: + return hex.EncodeToString(cert.Raw), nil + case 1: + return hex.EncodeToString(cert.RawSubjectPublicKeyInfo), nil + } + case 1: + h := sha256.New() + switch selector { + case 0: + io.WriteString(h, string(cert.Raw)) + return hex.EncodeToString(h.Sum(nil)), nil + case 1: + io.WriteString(h, string(cert.RawSubjectPublicKeyInfo)) + return hex.EncodeToString(h.Sum(nil)), nil + } + case 2: + h := sha512.New() + switch selector { + case 0: + io.WriteString(h, string(cert.Raw)) + return hex.EncodeToString(h.Sum(nil)), nil + case 1: + io.WriteString(h, string(cert.RawSubjectPublicKeyInfo)) + return hex.EncodeToString(h.Sum(nil)), nil + } + } + return "", errors.New("dns: bad TLSA MatchingType or TLSA Selector") +} + +// Sign creates a TLSA record from an SSL certificate. +func (r *TLSA) Sign(usage, selector, matchingType int, cert *x509.Certificate) (err error) { + r.Hdr.Rrtype = TypeTLSA + r.Usage = uint8(usage) + r.Selector = uint8(selector) + r.MatchingType = uint8(matchingType) + + r.Certificate, err = CertificateToDANE(r.Selector, r.MatchingType, cert) + if err != nil { + return err + } + return nil +} + +// Verify verifies a TLSA record against an SSL certificate. If it is OK +// a nil error is returned. +func (r *TLSA) Verify(cert *x509.Certificate) error { + c, err := CertificateToDANE(r.Selector, r.MatchingType, cert) + if err != nil { + return err // Not also ErrSig? + } + if r.Certificate == c { + return nil + } + return ErrSig // ErrSig, really? +} + +// TLSAName returns the ownername of a TLSA resource record as per the +// rules specified in RFC 6698, Section 3. +func TLSAName(name, service, network string) (string, error) { + if !IsFqdn(name) { + return "", ErrFqdn + } + p, err := net.LookupPort(network, service) + if err != nil { + return "", err + } + return "_" + strconv.Itoa(p) + "._" + network + "." + name, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/tsig.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/tsig.go new file mode 100644 index 00000000..78365e1c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/tsig.go @@ -0,0 +1,384 @@ +package dns + +import ( + "crypto/hmac" + "crypto/md5" + "crypto/sha1" + "crypto/sha256" + "crypto/sha512" + "encoding/binary" + "encoding/hex" + "hash" + "io" + "strconv" + "strings" + "time" +) + +// HMAC hashing codes. These are transmitted as domain names. +const ( + HmacMD5 = "hmac-md5.sig-alg.reg.int." + HmacSHA1 = "hmac-sha1." + HmacSHA256 = "hmac-sha256." + HmacSHA512 = "hmac-sha512." +) + +// TSIG is the RR the holds the transaction signature of a message. +// See RFC 2845 and RFC 4635. +type TSIG struct { + Hdr RR_Header + Algorithm string `dns:"domain-name"` + TimeSigned uint64 `dns:"uint48"` + Fudge uint16 + MACSize uint16 + MAC string `dns:"size-hex:MACSize"` + OrigId uint16 + Error uint16 + OtherLen uint16 + OtherData string `dns:"size-hex:OtherLen"` +} + +// TSIG has no official presentation format, but this will suffice. + +func (rr *TSIG) String() string { + s := "\n;; TSIG PSEUDOSECTION:\n" + s += rr.Hdr.String() + + " " + rr.Algorithm + + " " + tsigTimeToString(rr.TimeSigned) + + " " + strconv.Itoa(int(rr.Fudge)) + + " " + strconv.Itoa(int(rr.MACSize)) + + " " + strings.ToUpper(rr.MAC) + + " " + strconv.Itoa(int(rr.OrigId)) + + " " + strconv.Itoa(int(rr.Error)) + // BIND prints NOERROR + " " + strconv.Itoa(int(rr.OtherLen)) + + " " + rr.OtherData + return s +} + +// The following values must be put in wireformat, so that the MAC can be calculated. +// RFC 2845, section 3.4.2. TSIG Variables. +type tsigWireFmt struct { + // From RR_Header + Name string `dns:"domain-name"` + Class uint16 + Ttl uint32 + // Rdata of the TSIG + Algorithm string `dns:"domain-name"` + TimeSigned uint64 `dns:"uint48"` + Fudge uint16 + // MACSize, MAC and OrigId excluded + Error uint16 + OtherLen uint16 + OtherData string `dns:"size-hex:OtherLen"` +} + +// If we have the MAC use this type to convert it to wiredata. Section 3.4.3. Request MAC +type macWireFmt struct { + MACSize uint16 + MAC string `dns:"size-hex:MACSize"` +} + +// 3.3. Time values used in TSIG calculations +type timerWireFmt struct { + TimeSigned uint64 `dns:"uint48"` + Fudge uint16 +} + +// TsigGenerate fills out the TSIG record attached to the message. +// The message should contain +// a "stub" TSIG RR with the algorithm, key name (owner name of the RR), +// time fudge (defaults to 300 seconds) and the current time +// The TSIG MAC is saved in that Tsig RR. +// When TsigGenerate is called for the first time requestMAC is set to the empty string and +// timersOnly is false. +// If something goes wrong an error is returned, otherwise it is nil. +func TsigGenerate(m *Msg, secret, requestMAC string, timersOnly bool) ([]byte, string, error) { + if m.IsTsig() == nil { + panic("dns: TSIG not last RR in additional") + } + // If we barf here, the caller is to blame + rawsecret, err := fromBase64([]byte(secret)) + if err != nil { + return nil, "", err + } + + rr := m.Extra[len(m.Extra)-1].(*TSIG) + m.Extra = m.Extra[0 : len(m.Extra)-1] // kill the TSIG from the msg + mbuf, err := m.Pack() + if err != nil { + return nil, "", err + } + buf := tsigBuffer(mbuf, rr, requestMAC, timersOnly) + + t := new(TSIG) + var h hash.Hash + switch strings.ToLower(rr.Algorithm) { + case HmacMD5: + h = hmac.New(md5.New, []byte(rawsecret)) + case HmacSHA1: + h = hmac.New(sha1.New, []byte(rawsecret)) + case HmacSHA256: + h = hmac.New(sha256.New, []byte(rawsecret)) + case HmacSHA512: + h = hmac.New(sha512.New, []byte(rawsecret)) + default: + return nil, "", ErrKeyAlg + } + io.WriteString(h, string(buf)) + t.MAC = hex.EncodeToString(h.Sum(nil)) + t.MACSize = uint16(len(t.MAC) / 2) // Size is half! + + t.Hdr = RR_Header{Name: rr.Hdr.Name, Rrtype: TypeTSIG, Class: ClassANY, Ttl: 0} + t.Fudge = rr.Fudge + t.TimeSigned = rr.TimeSigned + t.Algorithm = rr.Algorithm + t.OrigId = m.Id + + tbuf := make([]byte, t.len()) + if off, err := PackRR(t, tbuf, 0, nil, false); err == nil { + tbuf = tbuf[:off] // reset to actual size used + } else { + return nil, "", err + } + mbuf = append(mbuf, tbuf...) + // Update the ArCount directly in the buffer. + binary.BigEndian.PutUint16(mbuf[10:], uint16(len(m.Extra)+1)) + + return mbuf, t.MAC, nil +} + +// TsigVerify verifies the TSIG on a message. +// If the signature does not validate err contains the +// error, otherwise it is nil. +func TsigVerify(msg []byte, secret, requestMAC string, timersOnly bool) error { + rawsecret, err := fromBase64([]byte(secret)) + if err != nil { + return err + } + // Strip the TSIG from the incoming msg + stripped, tsig, err := stripTsig(msg) + if err != nil { + return err + } + + msgMAC, err := hex.DecodeString(tsig.MAC) + if err != nil { + return err + } + + buf := tsigBuffer(stripped, tsig, requestMAC, timersOnly) + + // Fudge factor works both ways. A message can arrive before it was signed because + // of clock skew. + now := uint64(time.Now().Unix()) + ti := now - tsig.TimeSigned + if now < tsig.TimeSigned { + ti = tsig.TimeSigned - now + } + if uint64(tsig.Fudge) < ti { + return ErrTime + } + + var h hash.Hash + switch strings.ToLower(tsig.Algorithm) { + case HmacMD5: + h = hmac.New(md5.New, rawsecret) + case HmacSHA1: + h = hmac.New(sha1.New, rawsecret) + case HmacSHA256: + h = hmac.New(sha256.New, rawsecret) + case HmacSHA512: + h = hmac.New(sha512.New, rawsecret) + default: + return ErrKeyAlg + } + h.Write(buf) + if !hmac.Equal(h.Sum(nil), msgMAC) { + return ErrSig + } + return nil +} + +// Create a wiredata buffer for the MAC calculation. +func tsigBuffer(msgbuf []byte, rr *TSIG, requestMAC string, timersOnly bool) []byte { + var buf []byte + if rr.TimeSigned == 0 { + rr.TimeSigned = uint64(time.Now().Unix()) + } + if rr.Fudge == 0 { + rr.Fudge = 300 // Standard (RFC) default. + } + + if requestMAC != "" { + m := new(macWireFmt) + m.MACSize = uint16(len(requestMAC) / 2) + m.MAC = requestMAC + buf = make([]byte, len(requestMAC)) // long enough + n, _ := packMacWire(m, buf) + buf = buf[:n] + } + + tsigvar := make([]byte, DefaultMsgSize) + if timersOnly { + tsig := new(timerWireFmt) + tsig.TimeSigned = rr.TimeSigned + tsig.Fudge = rr.Fudge + n, _ := packTimerWire(tsig, tsigvar) + tsigvar = tsigvar[:n] + } else { + tsig := new(tsigWireFmt) + tsig.Name = strings.ToLower(rr.Hdr.Name) + tsig.Class = ClassANY + tsig.Ttl = rr.Hdr.Ttl + tsig.Algorithm = strings.ToLower(rr.Algorithm) + tsig.TimeSigned = rr.TimeSigned + tsig.Fudge = rr.Fudge + tsig.Error = rr.Error + tsig.OtherLen = rr.OtherLen + tsig.OtherData = rr.OtherData + n, _ := packTsigWire(tsig, tsigvar) + tsigvar = tsigvar[:n] + } + + if requestMAC != "" { + x := append(buf, msgbuf...) + buf = append(x, tsigvar...) + } else { + buf = append(msgbuf, tsigvar...) + } + return buf +} + +// Strip the TSIG from the raw message. +func stripTsig(msg []byte) ([]byte, *TSIG, error) { + // Copied from msg.go's Unpack() Header, but modified. + var ( + dh Header + err error + ) + off, tsigoff := 0, 0 + + if dh, off, err = unpackMsgHdr(msg, off); err != nil { + return nil, nil, err + } + if dh.Arcount == 0 { + return nil, nil, ErrNoSig + } + + // Rcode, see msg.go Unpack() + if int(dh.Bits&0xF) == RcodeNotAuth { + return nil, nil, ErrAuth + } + + for i := 0; i < int(dh.Qdcount); i++ { + _, off, err = unpackQuestion(msg, off) + if err != nil { + return nil, nil, err + } + } + + _, off, err = unpackRRslice(int(dh.Ancount), msg, off) + if err != nil { + return nil, nil, err + } + _, off, err = unpackRRslice(int(dh.Nscount), msg, off) + if err != nil { + return nil, nil, err + } + + rr := new(TSIG) + var extra RR + for i := 0; i < int(dh.Arcount); i++ { + tsigoff = off + extra, off, err = UnpackRR(msg, off) + if err != nil { + return nil, nil, err + } + if extra.Header().Rrtype == TypeTSIG { + rr = extra.(*TSIG) + // Adjust Arcount. + arcount := binary.BigEndian.Uint16(msg[10:]) + binary.BigEndian.PutUint16(msg[10:], arcount-1) + break + } + } + if rr == nil { + return nil, nil, ErrNoSig + } + return msg[:tsigoff], rr, nil +} + +// Translate the TSIG time signed into a date. There is no +// need for RFC1982 calculations as this date is 48 bits. +func tsigTimeToString(t uint64) string { + ti := time.Unix(int64(t), 0).UTC() + return ti.Format("20060102150405") +} + +func packTsigWire(tw *tsigWireFmt, msg []byte) (int, error) { + // copied from zmsg.go TSIG packing + // RR_Header + off, err := PackDomainName(tw.Name, msg, 0, nil, false) + if err != nil { + return off, err + } + off, err = packUint16(tw.Class, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(tw.Ttl, msg, off) + if err != nil { + return off, err + } + + off, err = PackDomainName(tw.Algorithm, msg, off, nil, false) + if err != nil { + return off, err + } + off, err = packUint48(tw.TimeSigned, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(tw.Fudge, msg, off) + if err != nil { + return off, err + } + + off, err = packUint16(tw.Error, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(tw.OtherLen, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(tw.OtherData, msg, off) + if err != nil { + return off, err + } + return off, nil +} + +func packMacWire(mw *macWireFmt, msg []byte) (int, error) { + off, err := packUint16(mw.MACSize, msg, 0) + if err != nil { + return off, err + } + off, err = packStringHex(mw.MAC, msg, off) + if err != nil { + return off, err + } + return off, nil +} + +func packTimerWire(tw *timerWireFmt, msg []byte) (int, error) { + off, err := packUint48(tw.TimeSigned, msg, 0) + if err != nil { + return off, err + } + off, err = packUint16(tw.Fudge, msg, off) + if err != nil { + return off, err + } + return off, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/types.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/types.go new file mode 100644 index 00000000..e7370647 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/types.go @@ -0,0 +1,1250 @@ +package dns + +import ( + "fmt" + "net" + "strconv" + "strings" + "time" +) + +type ( + // Type is a DNS type. + Type uint16 + // Class is a DNS class. + Class uint16 + // Name is a DNS domain name. + Name string +) + +// Packet formats + +// Wire constants and supported types. +const ( + // valid RR_Header.Rrtype and Question.qtype + + TypeNone uint16 = 0 + TypeA uint16 = 1 + TypeNS uint16 = 2 + TypeMD uint16 = 3 + TypeMF uint16 = 4 + TypeCNAME uint16 = 5 + TypeSOA uint16 = 6 + TypeMB uint16 = 7 + TypeMG uint16 = 8 + TypeMR uint16 = 9 + TypeNULL uint16 = 10 + TypePTR uint16 = 12 + TypeHINFO uint16 = 13 + TypeMINFO uint16 = 14 + TypeMX uint16 = 15 + TypeTXT uint16 = 16 + TypeRP uint16 = 17 + TypeAFSDB uint16 = 18 + TypeX25 uint16 = 19 + TypeISDN uint16 = 20 + TypeRT uint16 = 21 + TypeNSAPPTR uint16 = 23 + TypeSIG uint16 = 24 + TypeKEY uint16 = 25 + TypePX uint16 = 26 + TypeGPOS uint16 = 27 + TypeAAAA uint16 = 28 + TypeLOC uint16 = 29 + TypeNXT uint16 = 30 + TypeEID uint16 = 31 + TypeNIMLOC uint16 = 32 + TypeSRV uint16 = 33 + TypeATMA uint16 = 34 + TypeNAPTR uint16 = 35 + TypeKX uint16 = 36 + TypeCERT uint16 = 37 + TypeDNAME uint16 = 39 + TypeOPT uint16 = 41 // EDNS + TypeDS uint16 = 43 + TypeSSHFP uint16 = 44 + TypeRRSIG uint16 = 46 + TypeNSEC uint16 = 47 + TypeDNSKEY uint16 = 48 + TypeDHCID uint16 = 49 + TypeNSEC3 uint16 = 50 + TypeNSEC3PARAM uint16 = 51 + TypeTLSA uint16 = 52 + TypeHIP uint16 = 55 + TypeNINFO uint16 = 56 + TypeRKEY uint16 = 57 + TypeTALINK uint16 = 58 + TypeCDS uint16 = 59 + TypeCDNSKEY uint16 = 60 + TypeOPENPGPKEY uint16 = 61 + TypeSPF uint16 = 99 + TypeUINFO uint16 = 100 + TypeUID uint16 = 101 + TypeGID uint16 = 102 + TypeUNSPEC uint16 = 103 + TypeNID uint16 = 104 + TypeL32 uint16 = 105 + TypeL64 uint16 = 106 + TypeLP uint16 = 107 + TypeEUI48 uint16 = 108 + TypeEUI64 uint16 = 109 + TypeURI uint16 = 256 + TypeCAA uint16 = 257 + + TypeTKEY uint16 = 249 + TypeTSIG uint16 = 250 + + // valid Question.Qtype only + TypeIXFR uint16 = 251 + TypeAXFR uint16 = 252 + TypeMAILB uint16 = 253 + TypeMAILA uint16 = 254 + TypeANY uint16 = 255 + + TypeTA uint16 = 32768 + TypeDLV uint16 = 32769 + TypeReserved uint16 = 65535 + + // valid Question.Qclass + ClassINET = 1 + ClassCSNET = 2 + ClassCHAOS = 3 + ClassHESIOD = 4 + ClassNONE = 254 + ClassANY = 255 + + // Message Response Codes. + RcodeSuccess = 0 + RcodeFormatError = 1 + RcodeServerFailure = 2 + RcodeNameError = 3 + RcodeNotImplemented = 4 + RcodeRefused = 5 + RcodeYXDomain = 6 + RcodeYXRrset = 7 + RcodeNXRrset = 8 + RcodeNotAuth = 9 + RcodeNotZone = 10 + RcodeBadSig = 16 // TSIG + RcodeBadVers = 16 // EDNS0 + RcodeBadKey = 17 + RcodeBadTime = 18 + RcodeBadMode = 19 // TKEY + RcodeBadName = 20 + RcodeBadAlg = 21 + RcodeBadTrunc = 22 // TSIG + RcodeBadCookie = 23 // DNS Cookies + + // Message Opcodes. There is no 3. + OpcodeQuery = 0 + OpcodeIQuery = 1 + OpcodeStatus = 2 + OpcodeNotify = 4 + OpcodeUpdate = 5 +) + +// Headers is the wire format for the DNS packet header. +type Header struct { + Id uint16 + Bits uint16 + Qdcount, Ancount, Nscount, Arcount uint16 +} + +const ( + headerSize = 12 + + // Header.Bits + _QR = 1 << 15 // query/response (response=1) + _AA = 1 << 10 // authoritative + _TC = 1 << 9 // truncated + _RD = 1 << 8 // recursion desired + _RA = 1 << 7 // recursion available + _Z = 1 << 6 // Z + _AD = 1 << 5 // authticated data + _CD = 1 << 4 // checking disabled + + LOC_EQUATOR = 1 << 31 // RFC 1876, Section 2. + LOC_PRIMEMERIDIAN = 1 << 31 // RFC 1876, Section 2. + + LOC_HOURS = 60 * 1000 + LOC_DEGREES = 60 * LOC_HOURS + + LOC_ALTITUDEBASE = 100000 +) + +// Different Certificate Types, see RFC 4398, Section 2.1 +const ( + CertPKIX = 1 + iota + CertSPKI + CertPGP + CertIPIX + CertISPKI + CertIPGP + CertACPKIX + CertIACPKIX + CertURI = 253 + CertOID = 254 +) + +// CertTypeToString converts the Cert Type to its string representation. +// See RFC 4398 and RFC 6944. +var CertTypeToString = map[uint16]string{ + CertPKIX: "PKIX", + CertSPKI: "SPKI", + CertPGP: "PGP", + CertIPIX: "IPIX", + CertISPKI: "ISPKI", + CertIPGP: "IPGP", + CertACPKIX: "ACPKIX", + CertIACPKIX: "IACPKIX", + CertURI: "URI", + CertOID: "OID", +} + +// StringToCertType is the reverseof CertTypeToString. +var StringToCertType = reverseInt16(CertTypeToString) + +//go:generate go run types_generate.go + +// Question holds a DNS question. There can be multiple questions in the +// question section of a message. Usually there is just one. +type Question struct { + Name string `dns:"cdomain-name"` // "cdomain-name" specifies encoding (and may be compressed) + Qtype uint16 + Qclass uint16 +} + +func (q *Question) len() int { + return len(q.Name) + 1 + 2 + 2 +} + +func (q *Question) String() (s string) { + // prefix with ; (as in dig) + s = ";" + sprintName(q.Name) + "\t" + s += Class(q.Qclass).String() + "\t" + s += " " + Type(q.Qtype).String() + return s +} + +// ANY is a wildcard record. See RFC 1035, Section 3.2.3. ANY +// is named "*" there. +type ANY struct { + Hdr RR_Header + // Does not have any rdata +} + +func (rr *ANY) String() string { return rr.Hdr.String() } + +type CNAME struct { + Hdr RR_Header + Target string `dns:"cdomain-name"` +} + +func (rr *CNAME) String() string { return rr.Hdr.String() + sprintName(rr.Target) } + +type HINFO struct { + Hdr RR_Header + Cpu string + Os string +} + +func (rr *HINFO) String() string { + return rr.Hdr.String() + sprintTxt([]string{rr.Cpu, rr.Os}) +} + +type MB struct { + Hdr RR_Header + Mb string `dns:"cdomain-name"` +} + +func (rr *MB) String() string { return rr.Hdr.String() + sprintName(rr.Mb) } + +type MG struct { + Hdr RR_Header + Mg string `dns:"cdomain-name"` +} + +func (rr *MG) String() string { return rr.Hdr.String() + sprintName(rr.Mg) } + +type MINFO struct { + Hdr RR_Header + Rmail string `dns:"cdomain-name"` + Email string `dns:"cdomain-name"` +} + +func (rr *MINFO) String() string { + return rr.Hdr.String() + sprintName(rr.Rmail) + " " + sprintName(rr.Email) +} + +type MR struct { + Hdr RR_Header + Mr string `dns:"cdomain-name"` +} + +func (rr *MR) String() string { + return rr.Hdr.String() + sprintName(rr.Mr) +} + +type MF struct { + Hdr RR_Header + Mf string `dns:"cdomain-name"` +} + +func (rr *MF) String() string { + return rr.Hdr.String() + sprintName(rr.Mf) +} + +type MD struct { + Hdr RR_Header + Md string `dns:"cdomain-name"` +} + +func (rr *MD) String() string { + return rr.Hdr.String() + sprintName(rr.Md) +} + +type MX struct { + Hdr RR_Header + Preference uint16 + Mx string `dns:"cdomain-name"` +} + +func (rr *MX) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Mx) +} + +type AFSDB struct { + Hdr RR_Header + Subtype uint16 + Hostname string `dns:"cdomain-name"` +} + +func (rr *AFSDB) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Subtype)) + " " + sprintName(rr.Hostname) +} + +type X25 struct { + Hdr RR_Header + PSDNAddress string +} + +func (rr *X25) String() string { + return rr.Hdr.String() + rr.PSDNAddress +} + +type RT struct { + Hdr RR_Header + Preference uint16 + Host string `dns:"cdomain-name"` +} + +func (rr *RT) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Host) +} + +type NS struct { + Hdr RR_Header + Ns string `dns:"cdomain-name"` +} + +func (rr *NS) String() string { + return rr.Hdr.String() + sprintName(rr.Ns) +} + +type PTR struct { + Hdr RR_Header + Ptr string `dns:"cdomain-name"` +} + +func (rr *PTR) String() string { + return rr.Hdr.String() + sprintName(rr.Ptr) +} + +type RP struct { + Hdr RR_Header + Mbox string `dns:"domain-name"` + Txt string `dns:"domain-name"` +} + +func (rr *RP) String() string { + return rr.Hdr.String() + rr.Mbox + " " + sprintTxt([]string{rr.Txt}) +} + +type SOA struct { + Hdr RR_Header + Ns string `dns:"cdomain-name"` + Mbox string `dns:"cdomain-name"` + Serial uint32 + Refresh uint32 + Retry uint32 + Expire uint32 + Minttl uint32 +} + +func (rr *SOA) String() string { + return rr.Hdr.String() + sprintName(rr.Ns) + " " + sprintName(rr.Mbox) + + " " + strconv.FormatInt(int64(rr.Serial), 10) + + " " + strconv.FormatInt(int64(rr.Refresh), 10) + + " " + strconv.FormatInt(int64(rr.Retry), 10) + + " " + strconv.FormatInt(int64(rr.Expire), 10) + + " " + strconv.FormatInt(int64(rr.Minttl), 10) +} + +type TXT struct { + Hdr RR_Header + Txt []string `dns:"txt"` +} + +func (rr *TXT) String() string { return rr.Hdr.String() + sprintTxt(rr.Txt) } + +func sprintName(s string) string { + src := []byte(s) + dst := make([]byte, 0, len(src)) + for i := 0; i < len(src); { + if i+1 < len(src) && src[i] == '\\' && src[i+1] == '.' { + dst = append(dst, src[i:i+2]...) + i += 2 + } else { + b, n := nextByte(src, i) + if n == 0 { + i++ // dangling back slash + } else if b == '.' { + dst = append(dst, b) + } else { + dst = appendDomainNameByte(dst, b) + } + i += n + } + } + return string(dst) +} + +func sprintTxtOctet(s string) string { + src := []byte(s) + dst := make([]byte, 0, len(src)) + dst = append(dst, '"') + for i := 0; i < len(src); { + if i+1 < len(src) && src[i] == '\\' && src[i+1] == '.' { + dst = append(dst, src[i:i+2]...) + i += 2 + } else { + b, n := nextByte(src, i) + if n == 0 { + i++ // dangling back slash + } else if b == '.' { + dst = append(dst, b) + } else { + if b < ' ' || b > '~' { + dst = appendByte(dst, b) + } else { + dst = append(dst, b) + } + } + i += n + } + } + dst = append(dst, '"') + return string(dst) +} + +func sprintTxt(txt []string) string { + var out []byte + for i, s := range txt { + if i > 0 { + out = append(out, ` "`...) + } else { + out = append(out, '"') + } + bs := []byte(s) + for j := 0; j < len(bs); { + b, n := nextByte(bs, j) + if n == 0 { + break + } + out = appendTXTStringByte(out, b) + j += n + } + out = append(out, '"') + } + return string(out) +} + +func appendDomainNameByte(s []byte, b byte) []byte { + switch b { + case '.', ' ', '\'', '@', ';', '(', ')': // additional chars to escape + return append(s, '\\', b) + } + return appendTXTStringByte(s, b) +} + +func appendTXTStringByte(s []byte, b byte) []byte { + switch b { + case '\t': + return append(s, '\\', 't') + case '\r': + return append(s, '\\', 'r') + case '\n': + return append(s, '\\', 'n') + case '"', '\\': + return append(s, '\\', b) + } + if b < ' ' || b > '~' { + return appendByte(s, b) + } + return append(s, b) +} + +func appendByte(s []byte, b byte) []byte { + var buf [3]byte + bufs := strconv.AppendInt(buf[:0], int64(b), 10) + s = append(s, '\\') + for i := 0; i < 3-len(bufs); i++ { + s = append(s, '0') + } + for _, r := range bufs { + s = append(s, r) + } + return s +} + +func nextByte(b []byte, offset int) (byte, int) { + if offset >= len(b) { + return 0, 0 + } + if b[offset] != '\\' { + // not an escape sequence + return b[offset], 1 + } + switch len(b) - offset { + case 1: // dangling escape + return 0, 0 + case 2, 3: // too short to be \ddd + default: // maybe \ddd + if isDigit(b[offset+1]) && isDigit(b[offset+2]) && isDigit(b[offset+3]) { + return dddToByte(b[offset+1:]), 4 + } + } + // not \ddd, maybe a control char + switch b[offset+1] { + case 't': + return '\t', 2 + case 'r': + return '\r', 2 + case 'n': + return '\n', 2 + default: + return b[offset+1], 2 + } +} + +type SPF struct { + Hdr RR_Header + Txt []string `dns:"txt"` +} + +func (rr *SPF) String() string { return rr.Hdr.String() + sprintTxt(rr.Txt) } + +type SRV struct { + Hdr RR_Header + Priority uint16 + Weight uint16 + Port uint16 + Target string `dns:"domain-name"` +} + +func (rr *SRV) String() string { + return rr.Hdr.String() + + strconv.Itoa(int(rr.Priority)) + " " + + strconv.Itoa(int(rr.Weight)) + " " + + strconv.Itoa(int(rr.Port)) + " " + sprintName(rr.Target) +} + +type NAPTR struct { + Hdr RR_Header + Order uint16 + Preference uint16 + Flags string + Service string + Regexp string + Replacement string `dns:"domain-name"` +} + +func (rr *NAPTR) String() string { + return rr.Hdr.String() + + strconv.Itoa(int(rr.Order)) + " " + + strconv.Itoa(int(rr.Preference)) + " " + + "\"" + rr.Flags + "\" " + + "\"" + rr.Service + "\" " + + "\"" + rr.Regexp + "\" " + + rr.Replacement +} + +// The CERT resource record, see RFC 4398. +type CERT struct { + Hdr RR_Header + Type uint16 + KeyTag uint16 + Algorithm uint8 + Certificate string `dns:"base64"` +} + +func (rr *CERT) String() string { + var ( + ok bool + certtype, algorithm string + ) + if certtype, ok = CertTypeToString[rr.Type]; !ok { + certtype = strconv.Itoa(int(rr.Type)) + } + if algorithm, ok = AlgorithmToString[rr.Algorithm]; !ok { + algorithm = strconv.Itoa(int(rr.Algorithm)) + } + return rr.Hdr.String() + certtype + + " " + strconv.Itoa(int(rr.KeyTag)) + + " " + algorithm + + " " + rr.Certificate +} + +// The DNAME resource record, see RFC 2672. +type DNAME struct { + Hdr RR_Header + Target string `dns:"domain-name"` +} + +func (rr *DNAME) String() string { + return rr.Hdr.String() + sprintName(rr.Target) +} + +type A struct { + Hdr RR_Header + A net.IP `dns:"a"` +} + +func (rr *A) String() string { + if rr.A == nil { + return rr.Hdr.String() + } + return rr.Hdr.String() + rr.A.String() +} + +type AAAA struct { + Hdr RR_Header + AAAA net.IP `dns:"aaaa"` +} + +func (rr *AAAA) String() string { + if rr.AAAA == nil { + return rr.Hdr.String() + } + return rr.Hdr.String() + rr.AAAA.String() +} + +type PX struct { + Hdr RR_Header + Preference uint16 + Map822 string `dns:"domain-name"` + Mapx400 string `dns:"domain-name"` +} + +func (rr *PX) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Map822) + " " + sprintName(rr.Mapx400) +} + +type GPOS struct { + Hdr RR_Header + Longitude string + Latitude string + Altitude string +} + +func (rr *GPOS) String() string { + return rr.Hdr.String() + rr.Longitude + " " + rr.Latitude + " " + rr.Altitude +} + +type LOC struct { + Hdr RR_Header + Version uint8 + Size uint8 + HorizPre uint8 + VertPre uint8 + Latitude uint32 + Longitude uint32 + Altitude uint32 +} + +// cmToM takes a cm value expressed in RFC1876 SIZE mantissa/exponent +// format and returns a string in m (two decimals for the cm) +func cmToM(m, e uint8) string { + if e < 2 { + if e == 1 { + m *= 10 + } + + return fmt.Sprintf("0.%02d", m) + } + + s := fmt.Sprintf("%d", m) + for e > 2 { + s += "0" + e-- + } + return s +} + +func (rr *LOC) String() string { + s := rr.Hdr.String() + + lat := rr.Latitude + ns := "N" + if lat > LOC_EQUATOR { + lat = lat - LOC_EQUATOR + } else { + ns = "S" + lat = LOC_EQUATOR - lat + } + h := lat / LOC_DEGREES + lat = lat % LOC_DEGREES + m := lat / LOC_HOURS + lat = lat % LOC_HOURS + s += fmt.Sprintf("%02d %02d %0.3f %s ", h, m, (float64(lat) / 1000), ns) + + lon := rr.Longitude + ew := "E" + if lon > LOC_PRIMEMERIDIAN { + lon = lon - LOC_PRIMEMERIDIAN + } else { + ew = "W" + lon = LOC_PRIMEMERIDIAN - lon + } + h = lon / LOC_DEGREES + lon = lon % LOC_DEGREES + m = lon / LOC_HOURS + lon = lon % LOC_HOURS + s += fmt.Sprintf("%02d %02d %0.3f %s ", h, m, (float64(lon) / 1000), ew) + + var alt = float64(rr.Altitude) / 100 + alt -= LOC_ALTITUDEBASE + if rr.Altitude%100 != 0 { + s += fmt.Sprintf("%.2fm ", alt) + } else { + s += fmt.Sprintf("%.0fm ", alt) + } + + s += cmToM((rr.Size&0xf0)>>4, rr.Size&0x0f) + "m " + s += cmToM((rr.HorizPre&0xf0)>>4, rr.HorizPre&0x0f) + "m " + s += cmToM((rr.VertPre&0xf0)>>4, rr.VertPre&0x0f) + "m" + + return s +} + +// SIG is identical to RRSIG and nowadays only used for SIG(0), RFC2931. +type SIG struct { + RRSIG +} + +type RRSIG struct { + Hdr RR_Header + TypeCovered uint16 + Algorithm uint8 + Labels uint8 + OrigTtl uint32 + Expiration uint32 + Inception uint32 + KeyTag uint16 + SignerName string `dns:"domain-name"` + Signature string `dns:"base64"` +} + +func (rr *RRSIG) String() string { + s := rr.Hdr.String() + s += Type(rr.TypeCovered).String() + s += " " + strconv.Itoa(int(rr.Algorithm)) + + " " + strconv.Itoa(int(rr.Labels)) + + " " + strconv.FormatInt(int64(rr.OrigTtl), 10) + + " " + TimeToString(rr.Expiration) + + " " + TimeToString(rr.Inception) + + " " + strconv.Itoa(int(rr.KeyTag)) + + " " + sprintName(rr.SignerName) + + " " + rr.Signature + return s +} + +type NSEC struct { + Hdr RR_Header + NextDomain string `dns:"domain-name"` + TypeBitMap []uint16 `dns:"nsec"` +} + +func (rr *NSEC) String() string { + s := rr.Hdr.String() + sprintName(rr.NextDomain) + for i := 0; i < len(rr.TypeBitMap); i++ { + s += " " + Type(rr.TypeBitMap[i]).String() + } + return s +} + +func (rr *NSEC) len() int { + l := rr.Hdr.len() + len(rr.NextDomain) + 1 + lastwindow := uint32(2 ^ 32 + 1) + for _, t := range rr.TypeBitMap { + window := t / 256 + if uint32(window) != lastwindow { + l += 1 + 32 + } + lastwindow = uint32(window) + } + return l +} + +type DLV struct { + DS +} + +type CDS struct { + DS +} + +type DS struct { + Hdr RR_Header + KeyTag uint16 + Algorithm uint8 + DigestType uint8 + Digest string `dns:"hex"` +} + +func (rr *DS) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.KeyTag)) + + " " + strconv.Itoa(int(rr.Algorithm)) + + " " + strconv.Itoa(int(rr.DigestType)) + + " " + strings.ToUpper(rr.Digest) +} + +type KX struct { + Hdr RR_Header + Preference uint16 + Exchanger string `dns:"domain-name"` +} + +func (rr *KX) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + + " " + sprintName(rr.Exchanger) +} + +type TA struct { + Hdr RR_Header + KeyTag uint16 + Algorithm uint8 + DigestType uint8 + Digest string `dns:"hex"` +} + +func (rr *TA) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.KeyTag)) + + " " + strconv.Itoa(int(rr.Algorithm)) + + " " + strconv.Itoa(int(rr.DigestType)) + + " " + strings.ToUpper(rr.Digest) +} + +type TALINK struct { + Hdr RR_Header + PreviousName string `dns:"domain-name"` + NextName string `dns:"domain-name"` +} + +func (rr *TALINK) String() string { + return rr.Hdr.String() + + sprintName(rr.PreviousName) + " " + sprintName(rr.NextName) +} + +type SSHFP struct { + Hdr RR_Header + Algorithm uint8 + Type uint8 + FingerPrint string `dns:"hex"` +} + +func (rr *SSHFP) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Algorithm)) + + " " + strconv.Itoa(int(rr.Type)) + + " " + strings.ToUpper(rr.FingerPrint) +} + +type KEY struct { + DNSKEY +} + +type CDNSKEY struct { + DNSKEY +} + +type DNSKEY struct { + Hdr RR_Header + Flags uint16 + Protocol uint8 + Algorithm uint8 + PublicKey string `dns:"base64"` +} + +func (rr *DNSKEY) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Flags)) + + " " + strconv.Itoa(int(rr.Protocol)) + + " " + strconv.Itoa(int(rr.Algorithm)) + + " " + rr.PublicKey +} + +type RKEY struct { + Hdr RR_Header + Flags uint16 + Protocol uint8 + Algorithm uint8 + PublicKey string `dns:"base64"` +} + +func (rr *RKEY) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Flags)) + + " " + strconv.Itoa(int(rr.Protocol)) + + " " + strconv.Itoa(int(rr.Algorithm)) + + " " + rr.PublicKey +} + +type NSAPPTR struct { + Hdr RR_Header + Ptr string `dns:"domain-name"` +} + +func (rr *NSAPPTR) String() string { return rr.Hdr.String() + sprintName(rr.Ptr) } + +type NSEC3 struct { + Hdr RR_Header + Hash uint8 + Flags uint8 + Iterations uint16 + SaltLength uint8 + Salt string `dns:"size-hex:SaltLength"` + HashLength uint8 + NextDomain string `dns:"size-base32:HashLength"` + TypeBitMap []uint16 `dns:"nsec"` +} + +func (rr *NSEC3) String() string { + s := rr.Hdr.String() + s += strconv.Itoa(int(rr.Hash)) + + " " + strconv.Itoa(int(rr.Flags)) + + " " + strconv.Itoa(int(rr.Iterations)) + + " " + saltToString(rr.Salt) + + " " + rr.NextDomain + for i := 0; i < len(rr.TypeBitMap); i++ { + s += " " + Type(rr.TypeBitMap[i]).String() + } + return s +} + +func (rr *NSEC3) len() int { + l := rr.Hdr.len() + 6 + len(rr.Salt)/2 + 1 + len(rr.NextDomain) + 1 + lastwindow := uint32(2 ^ 32 + 1) + for _, t := range rr.TypeBitMap { + window := t / 256 + if uint32(window) != lastwindow { + l += 1 + 32 + } + lastwindow = uint32(window) + } + return l +} + +type NSEC3PARAM struct { + Hdr RR_Header + Hash uint8 + Flags uint8 + Iterations uint16 + SaltLength uint8 + Salt string `dns:"hex"` +} + +func (rr *NSEC3PARAM) String() string { + s := rr.Hdr.String() + s += strconv.Itoa(int(rr.Hash)) + + " " + strconv.Itoa(int(rr.Flags)) + + " " + strconv.Itoa(int(rr.Iterations)) + + " " + saltToString(rr.Salt) + return s +} + +type TKEY struct { + Hdr RR_Header + Algorithm string `dns:"domain-name"` + Inception uint32 + Expiration uint32 + Mode uint16 + Error uint16 + KeySize uint16 + Key string + OtherLen uint16 + OtherData string +} + +func (rr *TKEY) String() string { + // It has no presentation format + return "" +} + +// RFC3597 represents an unknown/generic RR. +type RFC3597 struct { + Hdr RR_Header + Rdata string `dns:"hex"` +} + +func (rr *RFC3597) String() string { + // Let's call it a hack + s := rfc3597Header(rr.Hdr) + + s += "\\# " + strconv.Itoa(len(rr.Rdata)/2) + " " + rr.Rdata + return s +} + +func rfc3597Header(h RR_Header) string { + var s string + + s += sprintName(h.Name) + "\t" + s += strconv.FormatInt(int64(h.Ttl), 10) + "\t" + s += "CLASS" + strconv.Itoa(int(h.Class)) + "\t" + s += "TYPE" + strconv.Itoa(int(h.Rrtype)) + "\t" + return s +} + +type URI struct { + Hdr RR_Header + Priority uint16 + Weight uint16 + Target string `dns:"octet"` +} + +func (rr *URI) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Priority)) + + " " + strconv.Itoa(int(rr.Weight)) + " " + sprintTxtOctet(rr.Target) +} + +type DHCID struct { + Hdr RR_Header + Digest string `dns:"base64"` +} + +func (rr *DHCID) String() string { return rr.Hdr.String() + rr.Digest } + +type TLSA struct { + Hdr RR_Header + Usage uint8 + Selector uint8 + MatchingType uint8 + Certificate string `dns:"hex"` +} + +func (rr *TLSA) String() string { + return rr.Hdr.String() + + strconv.Itoa(int(rr.Usage)) + + " " + strconv.Itoa(int(rr.Selector)) + + " " + strconv.Itoa(int(rr.MatchingType)) + + " " + rr.Certificate +} + +type HIP struct { + Hdr RR_Header + HitLength uint8 + PublicKeyAlgorithm uint8 + PublicKeyLength uint16 + Hit string `dns:"size-hex:HitLength"` + PublicKey string `dns:"size-base64:PublicKeyLength"` + RendezvousServers []string `dns:"domain-name"` +} + +func (rr *HIP) String() string { + s := rr.Hdr.String() + + strconv.Itoa(int(rr.PublicKeyAlgorithm)) + + " " + rr.Hit + + " " + rr.PublicKey + for _, d := range rr.RendezvousServers { + s += " " + sprintName(d) + } + return s +} + +type NINFO struct { + Hdr RR_Header + ZSData []string `dns:"txt"` +} + +func (rr *NINFO) String() string { return rr.Hdr.String() + sprintTxt(rr.ZSData) } + +type NID struct { + Hdr RR_Header + Preference uint16 + NodeID uint64 +} + +func (rr *NID) String() string { + s := rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + node := fmt.Sprintf("%0.16x", rr.NodeID) + s += " " + node[0:4] + ":" + node[4:8] + ":" + node[8:12] + ":" + node[12:16] + return s +} + +type L32 struct { + Hdr RR_Header + Preference uint16 + Locator32 net.IP `dns:"a"` +} + +func (rr *L32) String() string { + if rr.Locator32 == nil { + return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + } + return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + + " " + rr.Locator32.String() +} + +type L64 struct { + Hdr RR_Header + Preference uint16 + Locator64 uint64 +} + +func (rr *L64) String() string { + s := rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + node := fmt.Sprintf("%0.16X", rr.Locator64) + s += " " + node[0:4] + ":" + node[4:8] + ":" + node[8:12] + ":" + node[12:16] + return s +} + +type LP struct { + Hdr RR_Header + Preference uint16 + Fqdn string `dns:"domain-name"` +} + +func (rr *LP) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Fqdn) +} + +type EUI48 struct { + Hdr RR_Header + Address uint64 `dns:"uint48"` +} + +func (rr *EUI48) String() string { return rr.Hdr.String() + euiToString(rr.Address, 48) } + +type EUI64 struct { + Hdr RR_Header + Address uint64 +} + +func (rr *EUI64) String() string { return rr.Hdr.String() + euiToString(rr.Address, 64) } + +type CAA struct { + Hdr RR_Header + Flag uint8 + Tag string + Value string `dns:"octet"` +} + +func (rr *CAA) String() string { + return rr.Hdr.String() + strconv.Itoa(int(rr.Flag)) + " " + rr.Tag + " " + sprintTxtOctet(rr.Value) +} + +type UID struct { + Hdr RR_Header + Uid uint32 +} + +func (rr *UID) String() string { return rr.Hdr.String() + strconv.FormatInt(int64(rr.Uid), 10) } + +type GID struct { + Hdr RR_Header + Gid uint32 +} + +func (rr *GID) String() string { return rr.Hdr.String() + strconv.FormatInt(int64(rr.Gid), 10) } + +type UINFO struct { + Hdr RR_Header + Uinfo string +} + +func (rr *UINFO) String() string { return rr.Hdr.String() + sprintTxt([]string{rr.Uinfo}) } + +type EID struct { + Hdr RR_Header + Endpoint string `dns:"hex"` +} + +func (rr *EID) String() string { return rr.Hdr.String() + strings.ToUpper(rr.Endpoint) } + +type NIMLOC struct { + Hdr RR_Header + Locator string `dns:"hex"` +} + +func (rr *NIMLOC) String() string { return rr.Hdr.String() + strings.ToUpper(rr.Locator) } + +type OPENPGPKEY struct { + Hdr RR_Header + PublicKey string `dns:"base64"` +} + +func (rr *OPENPGPKEY) String() string { return rr.Hdr.String() + rr.PublicKey } + +// TimeToString translates the RRSIG's incep. and expir. times to the +// string representation used when printing the record. +// It takes serial arithmetic (RFC 1982) into account. +func TimeToString(t uint32) string { + mod := ((int64(t) - time.Now().Unix()) / year68) - 1 + if mod < 0 { + mod = 0 + } + ti := time.Unix(int64(t)-(mod*year68), 0).UTC() + return ti.Format("20060102150405") +} + +// StringToTime translates the RRSIG's incep. and expir. times from +// string values like "20110403154150" to an 32 bit integer. +// It takes serial arithmetic (RFC 1982) into account. +func StringToTime(s string) (uint32, error) { + t, err := time.Parse("20060102150405", s) + if err != nil { + return 0, err + } + mod := (t.Unix() / year68) - 1 + if mod < 0 { + mod = 0 + } + return uint32(t.Unix() - (mod * year68)), nil +} + +// saltToString converts a NSECX salt to uppercase and +// returns "-" when it is empty +func saltToString(s string) string { + if len(s) == 0 { + return "-" + } + return strings.ToUpper(s) +} + +func euiToString(eui uint64, bits int) (hex string) { + switch bits { + case 64: + hex = fmt.Sprintf("%16.16x", eui) + hex = hex[0:2] + "-" + hex[2:4] + "-" + hex[4:6] + "-" + hex[6:8] + + "-" + hex[8:10] + "-" + hex[10:12] + "-" + hex[12:14] + "-" + hex[14:16] + case 48: + hex = fmt.Sprintf("%12.12x", eui) + hex = hex[0:2] + "-" + hex[2:4] + "-" + hex[4:6] + "-" + hex[6:8] + + "-" + hex[8:10] + "-" + hex[10:12] + } + return +} + +// copyIP returns a copy of ip. +func copyIP(ip net.IP) net.IP { + p := make(net.IP, len(ip)) + copy(p, ip) + return p +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/types_generate.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/types_generate.go new file mode 100644 index 00000000..bf80da32 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/types_generate.go @@ -0,0 +1,271 @@ +//+build ignore + +// types_generate.go is meant to run with go generate. It will use +// go/{importer,types} to track down all the RR struct types. Then for each type +// it will generate conversion tables (TypeToRR and TypeToString) and banal +// methods (len, Header, copy) based on the struct tags. The generated source is +// written to ztypes.go, and is meant to be checked into git. +package main + +import ( + "bytes" + "fmt" + "go/format" + "go/importer" + "go/types" + "log" + "os" + "strings" + "text/template" +) + +var skipLen = map[string]struct{}{ + "NSEC": {}, + "NSEC3": {}, + "OPT": {}, +} + +var packageHdr = ` +// *** DO NOT MODIFY *** +// AUTOGENERATED BY go generate from type_generate.go + +package dns + +import ( + "encoding/base64" + "net" +) + +` + +var TypeToRR = template.Must(template.New("TypeToRR").Parse(` +// TypeToRR is a map of constructors for each RR type. +var TypeToRR = map[uint16]func() RR{ +{{range .}}{{if ne . "RFC3597"}} Type{{.}}: func() RR { return new({{.}}) }, +{{end}}{{end}} } + +`)) + +var typeToString = template.Must(template.New("typeToString").Parse(` +// TypeToString is a map of strings for each RR type. +var TypeToString = map[uint16]string{ +{{range .}}{{if ne . "NSAPPTR"}} Type{{.}}: "{{.}}", +{{end}}{{end}} TypeNSAPPTR: "NSAP-PTR", +} + +`)) + +var headerFunc = template.Must(template.New("headerFunc").Parse(` +// Header() functions +{{range .}} func (rr *{{.}}) Header() *RR_Header { return &rr.Hdr } +{{end}} + +`)) + +// getTypeStruct will take a type and the package scope, and return the +// (innermost) struct if the type is considered a RR type (currently defined as +// those structs beginning with a RR_Header, could be redefined as implementing +// the RR interface). The bool return value indicates if embedded structs were +// resolved. +func getTypeStruct(t types.Type, scope *types.Scope) (*types.Struct, bool) { + st, ok := t.Underlying().(*types.Struct) + if !ok { + return nil, false + } + if st.Field(0).Type() == scope.Lookup("RR_Header").Type() { + return st, false + } + if st.Field(0).Anonymous() { + st, _ := getTypeStruct(st.Field(0).Type(), scope) + return st, true + } + return nil, false +} + +func main() { + // Import and type-check the package + pkg, err := importer.Default().Import("github.com/miekg/dns") + fatalIfErr(err) + scope := pkg.Scope() + + // Collect constants like TypeX + var numberedTypes []string + for _, name := range scope.Names() { + o := scope.Lookup(name) + if o == nil || !o.Exported() { + continue + } + b, ok := o.Type().(*types.Basic) + if !ok || b.Kind() != types.Uint16 { + continue + } + if !strings.HasPrefix(o.Name(), "Type") { + continue + } + name := strings.TrimPrefix(o.Name(), "Type") + if name == "PrivateRR" { + continue + } + numberedTypes = append(numberedTypes, name) + } + + // Collect actual types (*X) + var namedTypes []string + for _, name := range scope.Names() { + o := scope.Lookup(name) + if o == nil || !o.Exported() { + continue + } + if st, _ := getTypeStruct(o.Type(), scope); st == nil { + continue + } + if name == "PrivateRR" { + continue + } + + // Check if corresponding TypeX exists + if scope.Lookup("Type"+o.Name()) == nil && o.Name() != "RFC3597" { + log.Fatalf("Constant Type%s does not exist.", o.Name()) + } + + namedTypes = append(namedTypes, o.Name()) + } + + b := &bytes.Buffer{} + b.WriteString(packageHdr) + + // Generate TypeToRR + fatalIfErr(TypeToRR.Execute(b, namedTypes)) + + // Generate typeToString + fatalIfErr(typeToString.Execute(b, numberedTypes)) + + // Generate headerFunc + fatalIfErr(headerFunc.Execute(b, namedTypes)) + + // Generate len() + fmt.Fprint(b, "// len() functions\n") + for _, name := range namedTypes { + if _, ok := skipLen[name]; ok { + continue + } + o := scope.Lookup(name) + st, isEmbedded := getTypeStruct(o.Type(), scope) + if isEmbedded { + continue + } + fmt.Fprintf(b, "func (rr *%s) len() int {\n", name) + fmt.Fprintf(b, "l := rr.Hdr.len()\n") + for i := 1; i < st.NumFields(); i++ { + o := func(s string) { fmt.Fprintf(b, s, st.Field(i).Name()) } + + if _, ok := st.Field(i).Type().(*types.Slice); ok { + switch st.Tag(i) { + case `dns:"-"`: + // ignored + case `dns:"cdomain-name"`, `dns:"domain-name"`, `dns:"txt"`: + o("for _, x := range rr.%s { l += len(x) + 1 }\n") + default: + log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) + } + continue + } + + switch { + case st.Tag(i) == `dns:"-"`: + // ignored + case st.Tag(i) == `dns:"cdomain-name"`, st.Tag(i) == `dns:"domain-name"`: + o("l += len(rr.%s) + 1\n") + case st.Tag(i) == `dns:"octet"`: + o("l += len(rr.%s)\n") + case strings.HasPrefix(st.Tag(i), `dns:"size-base64`): + fallthrough + case st.Tag(i) == `dns:"base64"`: + o("l += base64.StdEncoding.DecodedLen(len(rr.%s))\n") + case strings.HasPrefix(st.Tag(i), `dns:"size-hex`): + fallthrough + case st.Tag(i) == `dns:"hex"`: + o("l += len(rr.%s)/2 + 1\n") + case st.Tag(i) == `dns:"a"`: + o("l += net.IPv4len // %s\n") + case st.Tag(i) == `dns:"aaaa"`: + o("l += net.IPv6len // %s\n") + case st.Tag(i) == `dns:"txt"`: + o("for _, t := range rr.%s { l += len(t) + 1 }\n") + case st.Tag(i) == `dns:"uint48"`: + o("l += 6 // %s\n") + case st.Tag(i) == "": + switch st.Field(i).Type().(*types.Basic).Kind() { + case types.Uint8: + o("l += 1 // %s\n") + case types.Uint16: + o("l += 2 // %s\n") + case types.Uint32: + o("l += 4 // %s\n") + case types.Uint64: + o("l += 8 // %s\n") + case types.String: + o("l += len(rr.%s) + 1\n") + default: + log.Fatalln(name, st.Field(i).Name()) + } + default: + log.Fatalln(name, st.Field(i).Name(), st.Tag(i)) + } + } + fmt.Fprintf(b, "return l }\n") + } + + // Generate copy() + fmt.Fprint(b, "// copy() functions\n") + for _, name := range namedTypes { + o := scope.Lookup(name) + st, isEmbedded := getTypeStruct(o.Type(), scope) + if isEmbedded { + continue + } + fmt.Fprintf(b, "func (rr *%s) copy() RR {\n", name) + fields := []string{"*rr.Hdr.copyHeader()"} + for i := 1; i < st.NumFields(); i++ { + f := st.Field(i).Name() + if sl, ok := st.Field(i).Type().(*types.Slice); ok { + t := sl.Underlying().String() + t = strings.TrimPrefix(t, "[]") + if strings.Contains(t, ".") { + splits := strings.Split(t, ".") + t = splits[len(splits)-1] + } + fmt.Fprintf(b, "%s := make([]%s, len(rr.%s)); copy(%s, rr.%s)\n", + f, t, f, f, f) + fields = append(fields, f) + continue + } + if st.Field(i).Type().String() == "net.IP" { + fields = append(fields, "copyIP(rr."+f+")") + continue + } + fields = append(fields, "rr."+f) + } + fmt.Fprintf(b, "return &%s{%s}\n", name, strings.Join(fields, ",")) + fmt.Fprintf(b, "}\n") + } + + // gofmt + res, err := format.Source(b.Bytes()) + if err != nil { + b.WriteTo(os.Stderr) + log.Fatal(err) + } + + // write result + f, err := os.Create("ztypes.go") + fatalIfErr(err) + defer f.Close() + f.Write(res) +} + +func fatalIfErr(err error) { + if err != nil { + log.Fatal(err) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp.go new file mode 100644 index 00000000..c79c6c88 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp.go @@ -0,0 +1,58 @@ +// +build !windows,!plan9 + +package dns + +import ( + "net" + "syscall" +) + +// SessionUDP holds the remote address and the associated +// out-of-band data. +type SessionUDP struct { + raddr *net.UDPAddr + context []byte +} + +// RemoteAddr returns the remote network address. +func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr } + +// setUDPSocketOptions sets the UDP socket options. +// This function is implemented on a per platform basis. See udp_*.go for more details +func setUDPSocketOptions(conn *net.UDPConn) error { + sa, err := getUDPSocketName(conn) + if err != nil { + return err + } + switch sa.(type) { + case *syscall.SockaddrInet6: + v6only, err := getUDPSocketOptions6Only(conn) + if err != nil { + return err + } + setUDPSocketOptions6(conn) + if !v6only { + setUDPSocketOptions4(conn) + } + case *syscall.SockaddrInet4: + setUDPSocketOptions4(conn) + } + return nil +} + +// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a +// net.UDPAddr. +func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { + oob := make([]byte, 40) + n, oobn, _, raddr, err := conn.ReadMsgUDP(b, oob) + if err != nil { + return n, nil, err + } + return n, &SessionUDP{raddr, oob[:oobn]}, err +} + +// WriteToSessionUDP acts just like net.UDPConn.WritetTo(), but uses a *SessionUDP instead of a net.Addr. +func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { + n, _, err := conn.WriteMsgUDP(b, session.context, session.raddr) + return n, err +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_linux.go new file mode 100644 index 00000000..c62d2188 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_linux.go @@ -0,0 +1,73 @@ +// +build linux + +package dns + +// See: +// * http://stackoverflow.com/questions/3062205/setting-the-source-ip-for-a-udp-socket and +// * http://blog.powerdns.com/2012/10/08/on-binding-datagram-udp-sockets-to-the-any-addresses/ +// +// Why do we need this: When listening on 0.0.0.0 with UDP so kernel decides what is the outgoing +// interface, this might not always be the correct one. This code will make sure the egress +// packet's interface matched the ingress' one. + +import ( + "net" + "syscall" +) + +// setUDPSocketOptions4 prepares the v4 socket for sessions. +func setUDPSocketOptions4(conn *net.UDPConn) error { + file, err := conn.File() + if err != nil { + return err + } + if err := syscall.SetsockoptInt(int(file.Fd()), syscall.IPPROTO_IP, syscall.IP_PKTINFO, 1); err != nil { + return err + } + // Calling File() above results in the connection becoming blocking, we must fix that. + // See https://github.com/miekg/dns/issues/279 + err = syscall.SetNonblock(int(file.Fd()), true) + if err != nil { + return err + } + return nil +} + +// setUDPSocketOptions6 prepares the v6 socket for sessions. +func setUDPSocketOptions6(conn *net.UDPConn) error { + file, err := conn.File() + if err != nil { + return err + } + if err := syscall.SetsockoptInt(int(file.Fd()), syscall.IPPROTO_IPV6, syscall.IPV6_RECVPKTINFO, 1); err != nil { + return err + } + err = syscall.SetNonblock(int(file.Fd()), true) + if err != nil { + return err + } + return nil +} + +// getUDPSocketOption6Only return true if the socket is v6 only and false when it is v4/v6 combined +// (dualstack). +func getUDPSocketOptions6Only(conn *net.UDPConn) (bool, error) { + file, err := conn.File() + if err != nil { + return false, err + } + // dual stack. See http://stackoverflow.com/questions/1618240/how-to-support-both-ipv4-and-ipv6-connections + v6only, err := syscall.GetsockoptInt(int(file.Fd()), syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY) + if err != nil { + return false, err + } + return v6only == 1, nil +} + +func getUDPSocketName(conn *net.UDPConn) (syscall.Sockaddr, error) { + file, err := conn.File() + if err != nil { + return nil, err + } + return syscall.Getsockname(int(file.Fd())) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_other.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_other.go new file mode 100644 index 00000000..d4073244 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_other.go @@ -0,0 +1,17 @@ +// +build !linux,!plan9 + +package dns + +import ( + "net" + "syscall" +) + +// These do nothing. See udp_linux.go for an example of how to implement this. + +// We tried to adhire to some kind of naming scheme. + +func setUDPSocketOptions4(conn *net.UDPConn) error { return nil } +func setUDPSocketOptions6(conn *net.UDPConn) error { return nil } +func getUDPSocketOptions6Only(conn *net.UDPConn) (bool, error) { return false, nil } +func getUDPSocketName(conn *net.UDPConn) (syscall.Sockaddr, error) { return nil, nil } diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_plan9.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_plan9.go new file mode 100644 index 00000000..b794deeb --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_plan9.go @@ -0,0 +1,34 @@ +package dns + +import ( + "net" +) + +func setUDPSocketOptions(conn *net.UDPConn) error { return nil } + +// SessionUDP holds the remote address and the associated +// out-of-band data. +type SessionUDP struct { + raddr *net.UDPAddr + context []byte +} + +// RemoteAddr returns the remote network address. +func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr } + +// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a +// net.UDPAddr. +func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { + oob := make([]byte, 40) + n, oobn, _, raddr, err := conn.ReadMsgUDP(b, oob) + if err != nil { + return n, nil, err + } + return n, &SessionUDP{raddr, oob[:oobn]}, err +} + +// WriteToSessionUDP acts just like net.UDPConn.WritetTo(), but uses a *SessionUDP instead of a net.Addr. +func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { + n, _, err := conn.WriteMsgUDP(b, session.context, session.raddr) + return n, err +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_windows.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_windows.go new file mode 100644 index 00000000..2ce4b330 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/udp_windows.go @@ -0,0 +1,34 @@ +// +build windows + +package dns + +import "net" + +type SessionUDP struct { + raddr *net.UDPAddr +} + +// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a +// net.UDPAddr. +func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { + n, raddr, err := conn.ReadFrom(b) + if err != nil { + return n, nil, err + } + session := &SessionUDP{raddr.(*net.UDPAddr)} + return n, session, err +} + +// WriteToSessionUDP acts just like net.UDPConn.WritetTo(), but uses a *SessionUDP instead of a net.Addr. +func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { + n, err := conn.WriteTo(b, session.raddr) + return n, err +} + +func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr } + +// setUDPSocketOptions sets the UDP socket options. +// This function is implemented on a per platform basis. See udp_*.go for more details +func setUDPSocketOptions(conn *net.UDPConn) error { + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/update.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/update.go new file mode 100644 index 00000000..e90c5c96 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/update.go @@ -0,0 +1,106 @@ +package dns + +// NameUsed sets the RRs in the prereq section to +// "Name is in use" RRs. RFC 2136 section 2.4.4. +func (u *Msg) NameUsed(rr []RR) { + if u.Answer == nil { + u.Answer = make([]RR, 0, len(rr)) + } + for _, r := range rr { + u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassANY}}) + } +} + +// NameNotUsed sets the RRs in the prereq section to +// "Name is in not use" RRs. RFC 2136 section 2.4.5. +func (u *Msg) NameNotUsed(rr []RR) { + if u.Answer == nil { + u.Answer = make([]RR, 0, len(rr)) + } + for _, r := range rr { + u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassNONE}}) + } +} + +// Used sets the RRs in the prereq section to +// "RRset exists (value dependent -- with rdata)" RRs. RFC 2136 section 2.4.2. +func (u *Msg) Used(rr []RR) { + if len(u.Question) == 0 { + panic("dns: empty question section") + } + if u.Answer == nil { + u.Answer = make([]RR, 0, len(rr)) + } + for _, r := range rr { + r.Header().Class = u.Question[0].Qclass + u.Answer = append(u.Answer, r) + } +} + +// RRsetUsed sets the RRs in the prereq section to +// "RRset exists (value independent -- no rdata)" RRs. RFC 2136 section 2.4.1. +func (u *Msg) RRsetUsed(rr []RR) { + if u.Answer == nil { + u.Answer = make([]RR, 0, len(rr)) + } + for _, r := range rr { + u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: r.Header().Rrtype, Class: ClassANY}}) + } +} + +// RRsetNotUsed sets the RRs in the prereq section to +// "RRset does not exist" RRs. RFC 2136 section 2.4.3. +func (u *Msg) RRsetNotUsed(rr []RR) { + if u.Answer == nil { + u.Answer = make([]RR, 0, len(rr)) + } + for _, r := range rr { + u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: r.Header().Rrtype, Class: ClassNONE}}) + } +} + +// Insert creates a dynamic update packet that adds an complete RRset, see RFC 2136 section 2.5.1. +func (u *Msg) Insert(rr []RR) { + if len(u.Question) == 0 { + panic("dns: empty question section") + } + if u.Ns == nil { + u.Ns = make([]RR, 0, len(rr)) + } + for _, r := range rr { + r.Header().Class = u.Question[0].Qclass + u.Ns = append(u.Ns, r) + } +} + +// RemoveRRset creates a dynamic update packet that deletes an RRset, see RFC 2136 section 2.5.2. +func (u *Msg) RemoveRRset(rr []RR) { + if u.Ns == nil { + u.Ns = make([]RR, 0, len(rr)) + } + for _, r := range rr { + u.Ns = append(u.Ns, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: r.Header().Rrtype, Class: ClassANY}}) + } +} + +// RemoveName creates a dynamic update packet that deletes all RRsets of a name, see RFC 2136 section 2.5.3 +func (u *Msg) RemoveName(rr []RR) { + if u.Ns == nil { + u.Ns = make([]RR, 0, len(rr)) + } + for _, r := range rr { + u.Ns = append(u.Ns, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassANY}}) + } +} + +// Remove creates a dynamic update packet deletes RR from a RRSset, see RFC 2136 section 2.5.4 +func (u *Msg) Remove(rr []RR) { + if u.Ns == nil { + u.Ns = make([]RR, 0, len(rr)) + } + for _, r := range rr { + r.Header().Class = ClassNONE + r.Header().Ttl = 0 + u.Ns = append(u.Ns, r) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/xfr.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/xfr.go new file mode 100644 index 00000000..7346deff --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/xfr.go @@ -0,0 +1,244 @@ +package dns + +import ( + "time" +) + +// Envelope is used when doing a zone transfer with a remote server. +type Envelope struct { + RR []RR // The set of RRs in the answer section of the xfr reply message. + Error error // If something went wrong, this contains the error. +} + +// A Transfer defines parameters that are used during a zone transfer. +type Transfer struct { + *Conn + DialTimeout time.Duration // net.DialTimeout, defaults to 2 seconds + ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections, defaults to 2 seconds + WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections, defaults to 2 seconds + TsigSecret map[string]string // Secret(s) for Tsig map[], zonename must be fully qualified + tsigTimersOnly bool +} + +// Think we need to away to stop the transfer + +// In performs an incoming transfer with the server in a. +// If you would like to set the source IP, or some other attribute +// of a Dialer for a Transfer, you can do so by specifying the attributes +// in the Transfer.Conn: +// +// d := net.Dialer{LocalAddr: transfer_source} +// con, err := d.Dial("tcp", master) +// dnscon := &dns.Conn{Conn:con} +// transfer = &dns.Transfer{Conn: dnscon} +// channel, err := transfer.In(message, master) +// +func (t *Transfer) In(q *Msg, a string) (env chan *Envelope, err error) { + timeout := dnsTimeout + if t.DialTimeout != 0 { + timeout = t.DialTimeout + } + if t.Conn == nil { + t.Conn, err = DialTimeout("tcp", a, timeout) + if err != nil { + return nil, err + } + } + if err := t.WriteMsg(q); err != nil { + return nil, err + } + env = make(chan *Envelope) + go func() { + if q.Question[0].Qtype == TypeAXFR { + go t.inAxfr(q.Id, env) + return + } + if q.Question[0].Qtype == TypeIXFR { + go t.inIxfr(q.Id, env) + return + } + }() + return env, nil +} + +func (t *Transfer) inAxfr(id uint16, c chan *Envelope) { + first := true + defer t.Close() + defer close(c) + timeout := dnsTimeout + if t.ReadTimeout != 0 { + timeout = t.ReadTimeout + } + for { + t.Conn.SetReadDeadline(time.Now().Add(timeout)) + in, err := t.ReadMsg() + if err != nil { + c <- &Envelope{nil, err} + return + } + if id != in.Id { + c <- &Envelope{in.Answer, ErrId} + return + } + if first { + if !isSOAFirst(in) { + c <- &Envelope{in.Answer, ErrSoa} + return + } + first = !first + // only one answer that is SOA, receive more + if len(in.Answer) == 1 { + t.tsigTimersOnly = true + c <- &Envelope{in.Answer, nil} + continue + } + } + + if !first { + t.tsigTimersOnly = true // Subsequent envelopes use this. + if isSOALast(in) { + c <- &Envelope{in.Answer, nil} + return + } + c <- &Envelope{in.Answer, nil} + } + } +} + +func (t *Transfer) inIxfr(id uint16, c chan *Envelope) { + serial := uint32(0) // The first serial seen is the current server serial + first := true + defer t.Close() + defer close(c) + timeout := dnsTimeout + if t.ReadTimeout != 0 { + timeout = t.ReadTimeout + } + for { + t.SetReadDeadline(time.Now().Add(timeout)) + in, err := t.ReadMsg() + if err != nil { + c <- &Envelope{nil, err} + return + } + if id != in.Id { + c <- &Envelope{in.Answer, ErrId} + return + } + if first { + // A single SOA RR signals "no changes" + if len(in.Answer) == 1 && isSOAFirst(in) { + c <- &Envelope{in.Answer, nil} + return + } + + // Check if the returned answer is ok + if !isSOAFirst(in) { + c <- &Envelope{in.Answer, ErrSoa} + return + } + // This serial is important + serial = in.Answer[0].(*SOA).Serial + first = !first + } + + // Now we need to check each message for SOA records, to see what we need to do + if !first { + t.tsigTimersOnly = true + // If the last record in the IXFR contains the servers' SOA, we should quit + if v, ok := in.Answer[len(in.Answer)-1].(*SOA); ok { + if v.Serial == serial { + c <- &Envelope{in.Answer, nil} + return + } + } + c <- &Envelope{in.Answer, nil} + } + } +} + +// Out performs an outgoing transfer with the client connecting in w. +// Basic use pattern: +// +// ch := make(chan *dns.Envelope) +// tr := new(dns.Transfer) +// go tr.Out(w, r, ch) +// ch <- &dns.Envelope{RR: []dns.RR{soa, rr1, rr2, rr3, soa}} +// close(ch) +// w.Hijack() +// // w.Close() // Client closes connection +// +// The server is responsible for sending the correct sequence of RRs through the +// channel ch. +func (t *Transfer) Out(w ResponseWriter, q *Msg, ch chan *Envelope) error { + for x := range ch { + r := new(Msg) + // Compress? + r.SetReply(q) + r.Authoritative = true + // assume it fits TODO(miek): fix + r.Answer = append(r.Answer, x.RR...) + if err := w.WriteMsg(r); err != nil { + return err + } + } + w.TsigTimersOnly(true) + return nil +} + +// ReadMsg reads a message from the transfer connection t. +func (t *Transfer) ReadMsg() (*Msg, error) { + m := new(Msg) + p := make([]byte, MaxMsgSize) + n, err := t.Read(p) + if err != nil && n == 0 { + return nil, err + } + p = p[:n] + if err := m.Unpack(p); err != nil { + return nil, err + } + if ts := m.IsTsig(); ts != nil && t.TsigSecret != nil { + if _, ok := t.TsigSecret[ts.Hdr.Name]; !ok { + return m, ErrSecret + } + // Need to work on the original message p, as that was used to calculate the tsig. + err = TsigVerify(p, t.TsigSecret[ts.Hdr.Name], t.tsigRequestMAC, t.tsigTimersOnly) + t.tsigRequestMAC = ts.MAC + } + return m, err +} + +// WriteMsg writes a message through the transfer connection t. +func (t *Transfer) WriteMsg(m *Msg) (err error) { + var out []byte + if ts := m.IsTsig(); ts != nil && t.TsigSecret != nil { + if _, ok := t.TsigSecret[ts.Hdr.Name]; !ok { + return ErrSecret + } + out, t.tsigRequestMAC, err = TsigGenerate(m, t.TsigSecret[ts.Hdr.Name], t.tsigRequestMAC, t.tsigTimersOnly) + } else { + out, err = m.Pack() + } + if err != nil { + return err + } + if _, err = t.Write(out); err != nil { + return err + } + return nil +} + +func isSOAFirst(in *Msg) bool { + if len(in.Answer) > 0 { + return in.Answer[0].Header().Rrtype == TypeSOA + } + return false +} + +func isSOALast(in *Msg) bool { + if len(in.Answer) > 0 { + return in.Answer[len(in.Answer)-1].Header().Rrtype == TypeSOA + } + return false +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/zmsg.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/zmsg.go new file mode 100644 index 00000000..e5f3cf29 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/zmsg.go @@ -0,0 +1,3462 @@ +// *** DO NOT MODIFY *** +// AUTOGENERATED BY go generate from msg_generate.go + +package dns + +// pack*() functions + +func (rr *A) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packDataA(rr.A, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *AAAA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packDataAAAA(rr.AAAA, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *AFSDB) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Subtype, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Hostname, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *ANY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *CAA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint8(rr.Flag, msg, off) + if err != nil { + return off, err + } + off, err = packString(rr.Tag, msg, off) + if err != nil { + return off, err + } + off, err = packStringOctet(rr.Value, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *CDNSKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Flags, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Protocol, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packStringBase64(rr.PublicKey, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *CDS) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.KeyTag, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.DigestType, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.Digest, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *CERT) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Type, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.KeyTag, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packStringBase64(rr.Certificate, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *CNAME) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Target, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *DHCID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packStringBase64(rr.Digest, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *DLV) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.KeyTag, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.DigestType, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.Digest, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *DNAME) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Target, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *DNSKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Flags, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Protocol, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packStringBase64(rr.PublicKey, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *DS) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.KeyTag, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.DigestType, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.Digest, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *EID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packStringHex(rr.Endpoint, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *EUI48) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint48(rr.Address, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *EUI64) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint64(rr.Address, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *GID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint32(rr.Gid, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *GPOS) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packString(rr.Longitude, msg, off) + if err != nil { + return off, err + } + off, err = packString(rr.Latitude, msg, off) + if err != nil { + return off, err + } + off, err = packString(rr.Altitude, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *HINFO) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packString(rr.Cpu, msg, off) + if err != nil { + return off, err + } + off, err = packString(rr.Os, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *HIP) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint8(rr.HitLength, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.PublicKeyAlgorithm, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.PublicKeyLength, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.Hit, msg, off) + if err != nil { + return off, err + } + off, err = packStringBase64(rr.PublicKey, msg, off) + if err != nil { + return off, err + } + off, err = packDataDomainNames(rr.RendezvousServers, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *KEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Flags, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Protocol, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packStringBase64(rr.PublicKey, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *KX) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Preference, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Exchanger, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *L32) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Preference, msg, off) + if err != nil { + return off, err + } + off, err = packDataA(rr.Locator32, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *L64) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Preference, msg, off) + if err != nil { + return off, err + } + off, err = packUint64(rr.Locator64, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *LOC) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint8(rr.Version, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Size, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.HorizPre, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.VertPre, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Latitude, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Longitude, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Altitude, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *LP) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Preference, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Fqdn, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *MB) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Mb, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *MD) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Md, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *MF) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Mf, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *MG) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Mg, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *MINFO) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Rmail, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Email, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *MR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Mr, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *MX) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Preference, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Mx, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *NAPTR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Order, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Preference, msg, off) + if err != nil { + return off, err + } + off, err = packString(rr.Flags, msg, off) + if err != nil { + return off, err + } + off, err = packString(rr.Service, msg, off) + if err != nil { + return off, err + } + off, err = packString(rr.Regexp, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Replacement, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *NID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Preference, msg, off) + if err != nil { + return off, err + } + off, err = packUint64(rr.NodeID, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *NIMLOC) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packStringHex(rr.Locator, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *NINFO) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packStringTxt(rr.ZSData, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *NS) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Ns, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *NSAPPTR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Ptr, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *NSEC) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.NextDomain, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = packDataNsec(rr.TypeBitMap, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *NSEC3) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint8(rr.Hash, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Flags, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Iterations, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.SaltLength, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.Salt, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.HashLength, msg, off) + if err != nil { + return off, err + } + off, err = packStringBase32(rr.NextDomain, msg, off) + if err != nil { + return off, err + } + off, err = packDataNsec(rr.TypeBitMap, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *NSEC3PARAM) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint8(rr.Hash, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Flags, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Iterations, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.SaltLength, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.Salt, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *OPENPGPKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packStringBase64(rr.PublicKey, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *OPT) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packDataOpt(rr.Option, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *PTR) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Ptr, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *PX) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Preference, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Map822, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Mapx400, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *RFC3597) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packStringHex(rr.Rdata, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *RKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Flags, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Protocol, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packStringBase64(rr.PublicKey, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *RP) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Mbox, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Txt, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *RRSIG) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.TypeCovered, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Labels, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.OrigTtl, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Expiration, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Inception, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.KeyTag, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.SignerName, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = packStringBase64(rr.Signature, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *RT) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Preference, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Host, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *SIG) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.TypeCovered, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Labels, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.OrigTtl, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Expiration, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Inception, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.KeyTag, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.SignerName, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = packStringBase64(rr.Signature, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *SOA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Ns, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Mbox, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = packUint32(rr.Serial, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Refresh, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Retry, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Expire, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Minttl, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *SPF) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packStringTxt(rr.Txt, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *SRV) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Priority, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Weight, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Port, msg, off) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.Target, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *SSHFP) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Type, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.FingerPrint, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *TA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.KeyTag, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Algorithm, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.DigestType, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.Digest, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *TALINK) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.PreviousName, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = PackDomainName(rr.NextName, msg, off, compression, compress) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *TKEY) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Algorithm, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = packUint32(rr.Inception, msg, off) + if err != nil { + return off, err + } + off, err = packUint32(rr.Expiration, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Mode, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Error, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.KeySize, msg, off) + if err != nil { + return off, err + } + off, err = packString(rr.Key, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.OtherLen, msg, off) + if err != nil { + return off, err + } + off, err = packString(rr.OtherData, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *TLSA) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint8(rr.Usage, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.Selector, msg, off) + if err != nil { + return off, err + } + off, err = packUint8(rr.MatchingType, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.Certificate, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *TSIG) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = PackDomainName(rr.Algorithm, msg, off, compression, compress) + if err != nil { + return off, err + } + off, err = packUint48(rr.TimeSigned, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Fudge, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.MACSize, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.MAC, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.OrigId, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Error, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.OtherLen, msg, off) + if err != nil { + return off, err + } + off, err = packStringHex(rr.OtherData, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *TXT) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packStringTxt(rr.Txt, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *UID) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint32(rr.Uid, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *UINFO) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packString(rr.Uinfo, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *URI) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packUint16(rr.Priority, msg, off) + if err != nil { + return off, err + } + off, err = packUint16(rr.Weight, msg, off) + if err != nil { + return off, err + } + off, err = packStringOctet(rr.Target, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +func (rr *X25) pack(msg []byte, off int, compression map[string]int, compress bool) (int, error) { + off, err := rr.Hdr.pack(msg, off, compression, compress) + if err != nil { + return off, err + } + headerEnd := off + off, err = packString(rr.PSDNAddress, msg, off) + if err != nil { + return off, err + } + rr.Header().Rdlength = uint16(off - headerEnd) + return off, nil +} + +// unpack*() functions + +func unpackA(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(A) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.A, off, err = unpackDataA(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackAAAA(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(AAAA) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.AAAA, off, err = unpackDataAAAA(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackAFSDB(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(AFSDB) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Subtype, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Hostname, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackANY(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(ANY) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + return rr, off, err +} + +func unpackCAA(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(CAA) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Flag, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Tag, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Value, off, err = unpackStringOctet(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackCDNSKEY(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(CDNSKEY) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Flags, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Protocol, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackCDS(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(CDS) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.KeyTag, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.DigestType, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackCERT(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(CERT) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Type, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.KeyTag, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Certificate, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackCNAME(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(CNAME) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Target, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackDHCID(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(DHCID) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Digest, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackDLV(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(DLV) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.KeyTag, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.DigestType, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackDNAME(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(DNAME) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Target, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackDNSKEY(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(DNSKEY) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Flags, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Protocol, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackDS(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(DS) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.KeyTag, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.DigestType, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackEID(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(EID) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Endpoint, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackEUI48(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(EUI48) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Address, off, err = unpackUint48(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackEUI64(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(EUI64) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Address, off, err = unpackUint64(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackGID(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(GID) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Gid, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackGPOS(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(GPOS) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Longitude, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Latitude, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Altitude, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackHINFO(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(HINFO) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Cpu, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Os, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackHIP(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(HIP) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.HitLength, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.PublicKeyAlgorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.PublicKeyLength, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Hit, off, err = unpackStringHex(msg, off, off+int(rr.HitLength)) + if err != nil { + return rr, off, err + } + rr.PublicKey, off, err = unpackStringBase64(msg, off, off+int(rr.PublicKeyLength)) + if err != nil { + return rr, off, err + } + rr.RendezvousServers, off, err = unpackDataDomainNames(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackKEY(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(KEY) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Flags, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Protocol, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackKX(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(KX) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Preference, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Exchanger, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackL32(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(L32) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Preference, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Locator32, off, err = unpackDataA(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackL64(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(L64) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Preference, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Locator64, off, err = unpackUint64(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackLOC(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(LOC) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Version, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Size, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.HorizPre, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.VertPre, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Latitude, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Longitude, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Altitude, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackLP(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(LP) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Preference, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Fqdn, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackMB(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(MB) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Mb, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackMD(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(MD) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Md, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackMF(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(MF) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Mf, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackMG(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(MG) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Mg, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackMINFO(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(MINFO) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Rmail, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Email, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackMR(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(MR) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Mr, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackMX(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(MX) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Preference, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Mx, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackNAPTR(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(NAPTR) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Order, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Preference, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Flags, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Service, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Regexp, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Replacement, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackNID(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(NID) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Preference, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.NodeID, off, err = unpackUint64(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackNIMLOC(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(NIMLOC) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Locator, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackNINFO(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(NINFO) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.ZSData, off, err = unpackStringTxt(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackNS(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(NS) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Ns, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackNSAPPTR(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(NSAPPTR) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Ptr, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackNSEC(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(NSEC) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.NextDomain, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.TypeBitMap, off, err = unpackDataNsec(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackNSEC3(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(NSEC3) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Hash, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Flags, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Iterations, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.SaltLength, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Salt, off, err = unpackStringHex(msg, off, off+int(rr.SaltLength)) + if err != nil { + return rr, off, err + } + rr.HashLength, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.NextDomain, off, err = unpackStringBase32(msg, off, off+int(rr.HashLength)) + if err != nil { + return rr, off, err + } + rr.TypeBitMap, off, err = unpackDataNsec(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackNSEC3PARAM(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(NSEC3PARAM) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Hash, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Flags, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Iterations, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.SaltLength, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Salt, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackOPENPGPKEY(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(OPENPGPKEY) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackOPT(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(OPT) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Option, off, err = unpackDataOpt(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackPTR(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(PTR) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Ptr, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackPX(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(PX) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Preference, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Map822, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Mapx400, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackRFC3597(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(RFC3597) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Rdata, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackRKEY(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(RKEY) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Flags, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Protocol, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackRP(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(RP) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Mbox, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Txt, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackRRSIG(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(RRSIG) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.TypeCovered, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Labels, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.OrigTtl, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Expiration, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Inception, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.KeyTag, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.SignerName, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Signature, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackRT(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(RT) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Preference, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Host, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackSIG(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(SIG) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.TypeCovered, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Labels, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.OrigTtl, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Expiration, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Inception, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.KeyTag, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.SignerName, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Signature, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackSOA(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(SOA) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Ns, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Mbox, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Serial, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Refresh, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Retry, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Expire, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Minttl, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackSPF(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(SPF) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Txt, off, err = unpackStringTxt(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackSRV(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(SRV) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Priority, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Weight, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Port, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Target, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackSSHFP(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(SSHFP) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Type, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.FingerPrint, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackTA(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(TA) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.KeyTag, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Algorithm, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.DigestType, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackTALINK(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(TALINK) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.PreviousName, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.NextName, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackTKEY(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(TKEY) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Algorithm, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Inception, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Expiration, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Mode, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Error, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.KeySize, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Key, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.OtherLen, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.OtherData, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackTLSA(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(TLSA) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Usage, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Selector, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.MatchingType, off, err = unpackUint8(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Certificate, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackTSIG(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(TSIG) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Algorithm, off, err = UnpackDomainName(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.TimeSigned, off, err = unpackUint48(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Fudge, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.MACSize, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.MAC, off, err = unpackStringHex(msg, off, off+int(rr.MACSize)) + if err != nil { + return rr, off, err + } + rr.OrigId, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Error, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.OtherLen, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.OtherData, off, err = unpackStringHex(msg, off, off+int(rr.OtherLen)) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackTXT(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(TXT) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Txt, off, err = unpackStringTxt(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackUID(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(UID) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Uid, off, err = unpackUint32(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackUINFO(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(UINFO) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Uinfo, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackURI(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(URI) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.Priority, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Weight, off, err = unpackUint16(msg, off) + if err != nil { + return rr, off, err + } + if off == len(msg) { + return rr, off, nil + } + rr.Target, off, err = unpackStringOctet(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +func unpackX25(h RR_Header, msg []byte, off int) (RR, int, error) { + rr := new(X25) + rr.Hdr = h + if noRdata(h) { + return rr, off, nil + } + var err error + rdStart := off + _ = rdStart + + rr.PSDNAddress, off, err = unpackString(msg, off) + if err != nil { + return rr, off, err + } + return rr, off, err +} + +var typeToUnpack = map[uint16]func(RR_Header, []byte, int) (RR, int, error){ + TypeA: unpackA, + TypeAAAA: unpackAAAA, + TypeAFSDB: unpackAFSDB, + TypeANY: unpackANY, + TypeCAA: unpackCAA, + TypeCDNSKEY: unpackCDNSKEY, + TypeCDS: unpackCDS, + TypeCERT: unpackCERT, + TypeCNAME: unpackCNAME, + TypeDHCID: unpackDHCID, + TypeDLV: unpackDLV, + TypeDNAME: unpackDNAME, + TypeDNSKEY: unpackDNSKEY, + TypeDS: unpackDS, + TypeEID: unpackEID, + TypeEUI48: unpackEUI48, + TypeEUI64: unpackEUI64, + TypeGID: unpackGID, + TypeGPOS: unpackGPOS, + TypeHINFO: unpackHINFO, + TypeHIP: unpackHIP, + TypeKEY: unpackKEY, + TypeKX: unpackKX, + TypeL32: unpackL32, + TypeL64: unpackL64, + TypeLOC: unpackLOC, + TypeLP: unpackLP, + TypeMB: unpackMB, + TypeMD: unpackMD, + TypeMF: unpackMF, + TypeMG: unpackMG, + TypeMINFO: unpackMINFO, + TypeMR: unpackMR, + TypeMX: unpackMX, + TypeNAPTR: unpackNAPTR, + TypeNID: unpackNID, + TypeNIMLOC: unpackNIMLOC, + TypeNINFO: unpackNINFO, + TypeNS: unpackNS, + TypeNSAPPTR: unpackNSAPPTR, + TypeNSEC: unpackNSEC, + TypeNSEC3: unpackNSEC3, + TypeNSEC3PARAM: unpackNSEC3PARAM, + TypeOPENPGPKEY: unpackOPENPGPKEY, + TypeOPT: unpackOPT, + TypePTR: unpackPTR, + TypePX: unpackPX, + TypeRKEY: unpackRKEY, + TypeRP: unpackRP, + TypeRRSIG: unpackRRSIG, + TypeRT: unpackRT, + TypeSIG: unpackSIG, + TypeSOA: unpackSOA, + TypeSPF: unpackSPF, + TypeSRV: unpackSRV, + TypeSSHFP: unpackSSHFP, + TypeTA: unpackTA, + TypeTALINK: unpackTALINK, + TypeTKEY: unpackTKEY, + TypeTLSA: unpackTLSA, + TypeTSIG: unpackTSIG, + TypeTXT: unpackTXT, + TypeUID: unpackUID, + TypeUINFO: unpackUINFO, + TypeURI: unpackURI, + TypeX25: unpackX25, +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/ztypes.go b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/ztypes.go new file mode 100644 index 00000000..a4ecbb0c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/miekg/dns/ztypes.go @@ -0,0 +1,828 @@ +// *** DO NOT MODIFY *** +// AUTOGENERATED BY go generate from type_generate.go + +package dns + +import ( + "encoding/base64" + "net" +) + +// TypeToRR is a map of constructors for each RR type. +var TypeToRR = map[uint16]func() RR{ + TypeA: func() RR { return new(A) }, + TypeAAAA: func() RR { return new(AAAA) }, + TypeAFSDB: func() RR { return new(AFSDB) }, + TypeANY: func() RR { return new(ANY) }, + TypeCAA: func() RR { return new(CAA) }, + TypeCDNSKEY: func() RR { return new(CDNSKEY) }, + TypeCDS: func() RR { return new(CDS) }, + TypeCERT: func() RR { return new(CERT) }, + TypeCNAME: func() RR { return new(CNAME) }, + TypeDHCID: func() RR { return new(DHCID) }, + TypeDLV: func() RR { return new(DLV) }, + TypeDNAME: func() RR { return new(DNAME) }, + TypeDNSKEY: func() RR { return new(DNSKEY) }, + TypeDS: func() RR { return new(DS) }, + TypeEID: func() RR { return new(EID) }, + TypeEUI48: func() RR { return new(EUI48) }, + TypeEUI64: func() RR { return new(EUI64) }, + TypeGID: func() RR { return new(GID) }, + TypeGPOS: func() RR { return new(GPOS) }, + TypeHINFO: func() RR { return new(HINFO) }, + TypeHIP: func() RR { return new(HIP) }, + TypeKEY: func() RR { return new(KEY) }, + TypeKX: func() RR { return new(KX) }, + TypeL32: func() RR { return new(L32) }, + TypeL64: func() RR { return new(L64) }, + TypeLOC: func() RR { return new(LOC) }, + TypeLP: func() RR { return new(LP) }, + TypeMB: func() RR { return new(MB) }, + TypeMD: func() RR { return new(MD) }, + TypeMF: func() RR { return new(MF) }, + TypeMG: func() RR { return new(MG) }, + TypeMINFO: func() RR { return new(MINFO) }, + TypeMR: func() RR { return new(MR) }, + TypeMX: func() RR { return new(MX) }, + TypeNAPTR: func() RR { return new(NAPTR) }, + TypeNID: func() RR { return new(NID) }, + TypeNIMLOC: func() RR { return new(NIMLOC) }, + TypeNINFO: func() RR { return new(NINFO) }, + TypeNS: func() RR { return new(NS) }, + TypeNSAPPTR: func() RR { return new(NSAPPTR) }, + TypeNSEC: func() RR { return new(NSEC) }, + TypeNSEC3: func() RR { return new(NSEC3) }, + TypeNSEC3PARAM: func() RR { return new(NSEC3PARAM) }, + TypeOPENPGPKEY: func() RR { return new(OPENPGPKEY) }, + TypeOPT: func() RR { return new(OPT) }, + TypePTR: func() RR { return new(PTR) }, + TypePX: func() RR { return new(PX) }, + TypeRKEY: func() RR { return new(RKEY) }, + TypeRP: func() RR { return new(RP) }, + TypeRRSIG: func() RR { return new(RRSIG) }, + TypeRT: func() RR { return new(RT) }, + TypeSIG: func() RR { return new(SIG) }, + TypeSOA: func() RR { return new(SOA) }, + TypeSPF: func() RR { return new(SPF) }, + TypeSRV: func() RR { return new(SRV) }, + TypeSSHFP: func() RR { return new(SSHFP) }, + TypeTA: func() RR { return new(TA) }, + TypeTALINK: func() RR { return new(TALINK) }, + TypeTKEY: func() RR { return new(TKEY) }, + TypeTLSA: func() RR { return new(TLSA) }, + TypeTSIG: func() RR { return new(TSIG) }, + TypeTXT: func() RR { return new(TXT) }, + TypeUID: func() RR { return new(UID) }, + TypeUINFO: func() RR { return new(UINFO) }, + TypeURI: func() RR { return new(URI) }, + TypeX25: func() RR { return new(X25) }, +} + +// TypeToString is a map of strings for each RR type. +var TypeToString = map[uint16]string{ + TypeA: "A", + TypeAAAA: "AAAA", + TypeAFSDB: "AFSDB", + TypeANY: "ANY", + TypeATMA: "ATMA", + TypeAXFR: "AXFR", + TypeCAA: "CAA", + TypeCDNSKEY: "CDNSKEY", + TypeCDS: "CDS", + TypeCERT: "CERT", + TypeCNAME: "CNAME", + TypeDHCID: "DHCID", + TypeDLV: "DLV", + TypeDNAME: "DNAME", + TypeDNSKEY: "DNSKEY", + TypeDS: "DS", + TypeEID: "EID", + TypeEUI48: "EUI48", + TypeEUI64: "EUI64", + TypeGID: "GID", + TypeGPOS: "GPOS", + TypeHINFO: "HINFO", + TypeHIP: "HIP", + TypeISDN: "ISDN", + TypeIXFR: "IXFR", + TypeKEY: "KEY", + TypeKX: "KX", + TypeL32: "L32", + TypeL64: "L64", + TypeLOC: "LOC", + TypeLP: "LP", + TypeMAILA: "MAILA", + TypeMAILB: "MAILB", + TypeMB: "MB", + TypeMD: "MD", + TypeMF: "MF", + TypeMG: "MG", + TypeMINFO: "MINFO", + TypeMR: "MR", + TypeMX: "MX", + TypeNAPTR: "NAPTR", + TypeNID: "NID", + TypeNIMLOC: "NIMLOC", + TypeNINFO: "NINFO", + TypeNS: "NS", + TypeNSEC: "NSEC", + TypeNSEC3: "NSEC3", + TypeNSEC3PARAM: "NSEC3PARAM", + TypeNULL: "NULL", + TypeNXT: "NXT", + TypeNone: "None", + TypeOPENPGPKEY: "OPENPGPKEY", + TypeOPT: "OPT", + TypePTR: "PTR", + TypePX: "PX", + TypeRKEY: "RKEY", + TypeRP: "RP", + TypeRRSIG: "RRSIG", + TypeRT: "RT", + TypeReserved: "Reserved", + TypeSIG: "SIG", + TypeSOA: "SOA", + TypeSPF: "SPF", + TypeSRV: "SRV", + TypeSSHFP: "SSHFP", + TypeTA: "TA", + TypeTALINK: "TALINK", + TypeTKEY: "TKEY", + TypeTLSA: "TLSA", + TypeTSIG: "TSIG", + TypeTXT: "TXT", + TypeUID: "UID", + TypeUINFO: "UINFO", + TypeUNSPEC: "UNSPEC", + TypeURI: "URI", + TypeX25: "X25", + TypeNSAPPTR: "NSAP-PTR", +} + +// Header() functions +func (rr *A) Header() *RR_Header { return &rr.Hdr } +func (rr *AAAA) Header() *RR_Header { return &rr.Hdr } +func (rr *AFSDB) Header() *RR_Header { return &rr.Hdr } +func (rr *ANY) Header() *RR_Header { return &rr.Hdr } +func (rr *CAA) Header() *RR_Header { return &rr.Hdr } +func (rr *CDNSKEY) Header() *RR_Header { return &rr.Hdr } +func (rr *CDS) Header() *RR_Header { return &rr.Hdr } +func (rr *CERT) Header() *RR_Header { return &rr.Hdr } +func (rr *CNAME) Header() *RR_Header { return &rr.Hdr } +func (rr *DHCID) Header() *RR_Header { return &rr.Hdr } +func (rr *DLV) Header() *RR_Header { return &rr.Hdr } +func (rr *DNAME) Header() *RR_Header { return &rr.Hdr } +func (rr *DNSKEY) Header() *RR_Header { return &rr.Hdr } +func (rr *DS) Header() *RR_Header { return &rr.Hdr } +func (rr *EID) Header() *RR_Header { return &rr.Hdr } +func (rr *EUI48) Header() *RR_Header { return &rr.Hdr } +func (rr *EUI64) Header() *RR_Header { return &rr.Hdr } +func (rr *GID) Header() *RR_Header { return &rr.Hdr } +func (rr *GPOS) Header() *RR_Header { return &rr.Hdr } +func (rr *HINFO) Header() *RR_Header { return &rr.Hdr } +func (rr *HIP) Header() *RR_Header { return &rr.Hdr } +func (rr *KEY) Header() *RR_Header { return &rr.Hdr } +func (rr *KX) Header() *RR_Header { return &rr.Hdr } +func (rr *L32) Header() *RR_Header { return &rr.Hdr } +func (rr *L64) Header() *RR_Header { return &rr.Hdr } +func (rr *LOC) Header() *RR_Header { return &rr.Hdr } +func (rr *LP) Header() *RR_Header { return &rr.Hdr } +func (rr *MB) Header() *RR_Header { return &rr.Hdr } +func (rr *MD) Header() *RR_Header { return &rr.Hdr } +func (rr *MF) Header() *RR_Header { return &rr.Hdr } +func (rr *MG) Header() *RR_Header { return &rr.Hdr } +func (rr *MINFO) Header() *RR_Header { return &rr.Hdr } +func (rr *MR) Header() *RR_Header { return &rr.Hdr } +func (rr *MX) Header() *RR_Header { return &rr.Hdr } +func (rr *NAPTR) Header() *RR_Header { return &rr.Hdr } +func (rr *NID) Header() *RR_Header { return &rr.Hdr } +func (rr *NIMLOC) Header() *RR_Header { return &rr.Hdr } +func (rr *NINFO) Header() *RR_Header { return &rr.Hdr } +func (rr *NS) Header() *RR_Header { return &rr.Hdr } +func (rr *NSAPPTR) Header() *RR_Header { return &rr.Hdr } +func (rr *NSEC) Header() *RR_Header { return &rr.Hdr } +func (rr *NSEC3) Header() *RR_Header { return &rr.Hdr } +func (rr *NSEC3PARAM) Header() *RR_Header { return &rr.Hdr } +func (rr *OPENPGPKEY) Header() *RR_Header { return &rr.Hdr } +func (rr *OPT) Header() *RR_Header { return &rr.Hdr } +func (rr *PTR) Header() *RR_Header { return &rr.Hdr } +func (rr *PX) Header() *RR_Header { return &rr.Hdr } +func (rr *RFC3597) Header() *RR_Header { return &rr.Hdr } +func (rr *RKEY) Header() *RR_Header { return &rr.Hdr } +func (rr *RP) Header() *RR_Header { return &rr.Hdr } +func (rr *RRSIG) Header() *RR_Header { return &rr.Hdr } +func (rr *RT) Header() *RR_Header { return &rr.Hdr } +func (rr *SIG) Header() *RR_Header { return &rr.Hdr } +func (rr *SOA) Header() *RR_Header { return &rr.Hdr } +func (rr *SPF) Header() *RR_Header { return &rr.Hdr } +func (rr *SRV) Header() *RR_Header { return &rr.Hdr } +func (rr *SSHFP) Header() *RR_Header { return &rr.Hdr } +func (rr *TA) Header() *RR_Header { return &rr.Hdr } +func (rr *TALINK) Header() *RR_Header { return &rr.Hdr } +func (rr *TKEY) Header() *RR_Header { return &rr.Hdr } +func (rr *TLSA) Header() *RR_Header { return &rr.Hdr } +func (rr *TSIG) Header() *RR_Header { return &rr.Hdr } +func (rr *TXT) Header() *RR_Header { return &rr.Hdr } +func (rr *UID) Header() *RR_Header { return &rr.Hdr } +func (rr *UINFO) Header() *RR_Header { return &rr.Hdr } +func (rr *URI) Header() *RR_Header { return &rr.Hdr } +func (rr *X25) Header() *RR_Header { return &rr.Hdr } + +// len() functions +func (rr *A) len() int { + l := rr.Hdr.len() + l += net.IPv4len // A + return l +} +func (rr *AAAA) len() int { + l := rr.Hdr.len() + l += net.IPv6len // AAAA + return l +} +func (rr *AFSDB) len() int { + l := rr.Hdr.len() + l += 2 // Subtype + l += len(rr.Hostname) + 1 + return l +} +func (rr *ANY) len() int { + l := rr.Hdr.len() + return l +} +func (rr *CAA) len() int { + l := rr.Hdr.len() + l += 1 // Flag + l += len(rr.Tag) + 1 + l += len(rr.Value) + return l +} +func (rr *CERT) len() int { + l := rr.Hdr.len() + l += 2 // Type + l += 2 // KeyTag + l += 1 // Algorithm + l += base64.StdEncoding.DecodedLen(len(rr.Certificate)) + return l +} +func (rr *CNAME) len() int { + l := rr.Hdr.len() + l += len(rr.Target) + 1 + return l +} +func (rr *DHCID) len() int { + l := rr.Hdr.len() + l += base64.StdEncoding.DecodedLen(len(rr.Digest)) + return l +} +func (rr *DNAME) len() int { + l := rr.Hdr.len() + l += len(rr.Target) + 1 + return l +} +func (rr *DNSKEY) len() int { + l := rr.Hdr.len() + l += 2 // Flags + l += 1 // Protocol + l += 1 // Algorithm + l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) + return l +} +func (rr *DS) len() int { + l := rr.Hdr.len() + l += 2 // KeyTag + l += 1 // Algorithm + l += 1 // DigestType + l += len(rr.Digest)/2 + 1 + return l +} +func (rr *EID) len() int { + l := rr.Hdr.len() + l += len(rr.Endpoint)/2 + 1 + return l +} +func (rr *EUI48) len() int { + l := rr.Hdr.len() + l += 6 // Address + return l +} +func (rr *EUI64) len() int { + l := rr.Hdr.len() + l += 8 // Address + return l +} +func (rr *GID) len() int { + l := rr.Hdr.len() + l += 4 // Gid + return l +} +func (rr *GPOS) len() int { + l := rr.Hdr.len() + l += len(rr.Longitude) + 1 + l += len(rr.Latitude) + 1 + l += len(rr.Altitude) + 1 + return l +} +func (rr *HINFO) len() int { + l := rr.Hdr.len() + l += len(rr.Cpu) + 1 + l += len(rr.Os) + 1 + return l +} +func (rr *HIP) len() int { + l := rr.Hdr.len() + l += 1 // HitLength + l += 1 // PublicKeyAlgorithm + l += 2 // PublicKeyLength + l += len(rr.Hit)/2 + 1 + l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) + for _, x := range rr.RendezvousServers { + l += len(x) + 1 + } + return l +} +func (rr *KX) len() int { + l := rr.Hdr.len() + l += 2 // Preference + l += len(rr.Exchanger) + 1 + return l +} +func (rr *L32) len() int { + l := rr.Hdr.len() + l += 2 // Preference + l += net.IPv4len // Locator32 + return l +} +func (rr *L64) len() int { + l := rr.Hdr.len() + l += 2 // Preference + l += 8 // Locator64 + return l +} +func (rr *LOC) len() int { + l := rr.Hdr.len() + l += 1 // Version + l += 1 // Size + l += 1 // HorizPre + l += 1 // VertPre + l += 4 // Latitude + l += 4 // Longitude + l += 4 // Altitude + return l +} +func (rr *LP) len() int { + l := rr.Hdr.len() + l += 2 // Preference + l += len(rr.Fqdn) + 1 + return l +} +func (rr *MB) len() int { + l := rr.Hdr.len() + l += len(rr.Mb) + 1 + return l +} +func (rr *MD) len() int { + l := rr.Hdr.len() + l += len(rr.Md) + 1 + return l +} +func (rr *MF) len() int { + l := rr.Hdr.len() + l += len(rr.Mf) + 1 + return l +} +func (rr *MG) len() int { + l := rr.Hdr.len() + l += len(rr.Mg) + 1 + return l +} +func (rr *MINFO) len() int { + l := rr.Hdr.len() + l += len(rr.Rmail) + 1 + l += len(rr.Email) + 1 + return l +} +func (rr *MR) len() int { + l := rr.Hdr.len() + l += len(rr.Mr) + 1 + return l +} +func (rr *MX) len() int { + l := rr.Hdr.len() + l += 2 // Preference + l += len(rr.Mx) + 1 + return l +} +func (rr *NAPTR) len() int { + l := rr.Hdr.len() + l += 2 // Order + l += 2 // Preference + l += len(rr.Flags) + 1 + l += len(rr.Service) + 1 + l += len(rr.Regexp) + 1 + l += len(rr.Replacement) + 1 + return l +} +func (rr *NID) len() int { + l := rr.Hdr.len() + l += 2 // Preference + l += 8 // NodeID + return l +} +func (rr *NIMLOC) len() int { + l := rr.Hdr.len() + l += len(rr.Locator)/2 + 1 + return l +} +func (rr *NINFO) len() int { + l := rr.Hdr.len() + for _, x := range rr.ZSData { + l += len(x) + 1 + } + return l +} +func (rr *NS) len() int { + l := rr.Hdr.len() + l += len(rr.Ns) + 1 + return l +} +func (rr *NSAPPTR) len() int { + l := rr.Hdr.len() + l += len(rr.Ptr) + 1 + return l +} +func (rr *NSEC3PARAM) len() int { + l := rr.Hdr.len() + l += 1 // Hash + l += 1 // Flags + l += 2 // Iterations + l += 1 // SaltLength + l += len(rr.Salt)/2 + 1 + return l +} +func (rr *OPENPGPKEY) len() int { + l := rr.Hdr.len() + l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) + return l +} +func (rr *PTR) len() int { + l := rr.Hdr.len() + l += len(rr.Ptr) + 1 + return l +} +func (rr *PX) len() int { + l := rr.Hdr.len() + l += 2 // Preference + l += len(rr.Map822) + 1 + l += len(rr.Mapx400) + 1 + return l +} +func (rr *RFC3597) len() int { + l := rr.Hdr.len() + l += len(rr.Rdata)/2 + 1 + return l +} +func (rr *RKEY) len() int { + l := rr.Hdr.len() + l += 2 // Flags + l += 1 // Protocol + l += 1 // Algorithm + l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) + return l +} +func (rr *RP) len() int { + l := rr.Hdr.len() + l += len(rr.Mbox) + 1 + l += len(rr.Txt) + 1 + return l +} +func (rr *RRSIG) len() int { + l := rr.Hdr.len() + l += 2 // TypeCovered + l += 1 // Algorithm + l += 1 // Labels + l += 4 // OrigTtl + l += 4 // Expiration + l += 4 // Inception + l += 2 // KeyTag + l += len(rr.SignerName) + 1 + l += base64.StdEncoding.DecodedLen(len(rr.Signature)) + return l +} +func (rr *RT) len() int { + l := rr.Hdr.len() + l += 2 // Preference + l += len(rr.Host) + 1 + return l +} +func (rr *SOA) len() int { + l := rr.Hdr.len() + l += len(rr.Ns) + 1 + l += len(rr.Mbox) + 1 + l += 4 // Serial + l += 4 // Refresh + l += 4 // Retry + l += 4 // Expire + l += 4 // Minttl + return l +} +func (rr *SPF) len() int { + l := rr.Hdr.len() + for _, x := range rr.Txt { + l += len(x) + 1 + } + return l +} +func (rr *SRV) len() int { + l := rr.Hdr.len() + l += 2 // Priority + l += 2 // Weight + l += 2 // Port + l += len(rr.Target) + 1 + return l +} +func (rr *SSHFP) len() int { + l := rr.Hdr.len() + l += 1 // Algorithm + l += 1 // Type + l += len(rr.FingerPrint)/2 + 1 + return l +} +func (rr *TA) len() int { + l := rr.Hdr.len() + l += 2 // KeyTag + l += 1 // Algorithm + l += 1 // DigestType + l += len(rr.Digest)/2 + 1 + return l +} +func (rr *TALINK) len() int { + l := rr.Hdr.len() + l += len(rr.PreviousName) + 1 + l += len(rr.NextName) + 1 + return l +} +func (rr *TKEY) len() int { + l := rr.Hdr.len() + l += len(rr.Algorithm) + 1 + l += 4 // Inception + l += 4 // Expiration + l += 2 // Mode + l += 2 // Error + l += 2 // KeySize + l += len(rr.Key) + 1 + l += 2 // OtherLen + l += len(rr.OtherData) + 1 + return l +} +func (rr *TLSA) len() int { + l := rr.Hdr.len() + l += 1 // Usage + l += 1 // Selector + l += 1 // MatchingType + l += len(rr.Certificate)/2 + 1 + return l +} +func (rr *TSIG) len() int { + l := rr.Hdr.len() + l += len(rr.Algorithm) + 1 + l += 6 // TimeSigned + l += 2 // Fudge + l += 2 // MACSize + l += len(rr.MAC)/2 + 1 + l += 2 // OrigId + l += 2 // Error + l += 2 // OtherLen + l += len(rr.OtherData)/2 + 1 + return l +} +func (rr *TXT) len() int { + l := rr.Hdr.len() + for _, x := range rr.Txt { + l += len(x) + 1 + } + return l +} +func (rr *UID) len() int { + l := rr.Hdr.len() + l += 4 // Uid + return l +} +func (rr *UINFO) len() int { + l := rr.Hdr.len() + l += len(rr.Uinfo) + 1 + return l +} +func (rr *URI) len() int { + l := rr.Hdr.len() + l += 2 // Priority + l += 2 // Weight + l += len(rr.Target) + return l +} +func (rr *X25) len() int { + l := rr.Hdr.len() + l += len(rr.PSDNAddress) + 1 + return l +} + +// copy() functions +func (rr *A) copy() RR { + return &A{*rr.Hdr.copyHeader(), copyIP(rr.A)} +} +func (rr *AAAA) copy() RR { + return &AAAA{*rr.Hdr.copyHeader(), copyIP(rr.AAAA)} +} +func (rr *AFSDB) copy() RR { + return &AFSDB{*rr.Hdr.copyHeader(), rr.Subtype, rr.Hostname} +} +func (rr *ANY) copy() RR { + return &ANY{*rr.Hdr.copyHeader()} +} +func (rr *CAA) copy() RR { + return &CAA{*rr.Hdr.copyHeader(), rr.Flag, rr.Tag, rr.Value} +} +func (rr *CERT) copy() RR { + return &CERT{*rr.Hdr.copyHeader(), rr.Type, rr.KeyTag, rr.Algorithm, rr.Certificate} +} +func (rr *CNAME) copy() RR { + return &CNAME{*rr.Hdr.copyHeader(), rr.Target} +} +func (rr *DHCID) copy() RR { + return &DHCID{*rr.Hdr.copyHeader(), rr.Digest} +} +func (rr *DNAME) copy() RR { + return &DNAME{*rr.Hdr.copyHeader(), rr.Target} +} +func (rr *DNSKEY) copy() RR { + return &DNSKEY{*rr.Hdr.copyHeader(), rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey} +} +func (rr *DS) copy() RR { + return &DS{*rr.Hdr.copyHeader(), rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest} +} +func (rr *EID) copy() RR { + return &EID{*rr.Hdr.copyHeader(), rr.Endpoint} +} +func (rr *EUI48) copy() RR { + return &EUI48{*rr.Hdr.copyHeader(), rr.Address} +} +func (rr *EUI64) copy() RR { + return &EUI64{*rr.Hdr.copyHeader(), rr.Address} +} +func (rr *GID) copy() RR { + return &GID{*rr.Hdr.copyHeader(), rr.Gid} +} +func (rr *GPOS) copy() RR { + return &GPOS{*rr.Hdr.copyHeader(), rr.Longitude, rr.Latitude, rr.Altitude} +} +func (rr *HINFO) copy() RR { + return &HINFO{*rr.Hdr.copyHeader(), rr.Cpu, rr.Os} +} +func (rr *HIP) copy() RR { + RendezvousServers := make([]string, len(rr.RendezvousServers)) + copy(RendezvousServers, rr.RendezvousServers) + return &HIP{*rr.Hdr.copyHeader(), rr.HitLength, rr.PublicKeyAlgorithm, rr.PublicKeyLength, rr.Hit, rr.PublicKey, RendezvousServers} +} +func (rr *KX) copy() RR { + return &KX{*rr.Hdr.copyHeader(), rr.Preference, rr.Exchanger} +} +func (rr *L32) copy() RR { + return &L32{*rr.Hdr.copyHeader(), rr.Preference, copyIP(rr.Locator32)} +} +func (rr *L64) copy() RR { + return &L64{*rr.Hdr.copyHeader(), rr.Preference, rr.Locator64} +} +func (rr *LOC) copy() RR { + return &LOC{*rr.Hdr.copyHeader(), rr.Version, rr.Size, rr.HorizPre, rr.VertPre, rr.Latitude, rr.Longitude, rr.Altitude} +} +func (rr *LP) copy() RR { + return &LP{*rr.Hdr.copyHeader(), rr.Preference, rr.Fqdn} +} +func (rr *MB) copy() RR { + return &MB{*rr.Hdr.copyHeader(), rr.Mb} +} +func (rr *MD) copy() RR { + return &MD{*rr.Hdr.copyHeader(), rr.Md} +} +func (rr *MF) copy() RR { + return &MF{*rr.Hdr.copyHeader(), rr.Mf} +} +func (rr *MG) copy() RR { + return &MG{*rr.Hdr.copyHeader(), rr.Mg} +} +func (rr *MINFO) copy() RR { + return &MINFO{*rr.Hdr.copyHeader(), rr.Rmail, rr.Email} +} +func (rr *MR) copy() RR { + return &MR{*rr.Hdr.copyHeader(), rr.Mr} +} +func (rr *MX) copy() RR { + return &MX{*rr.Hdr.copyHeader(), rr.Preference, rr.Mx} +} +func (rr *NAPTR) copy() RR { + return &NAPTR{*rr.Hdr.copyHeader(), rr.Order, rr.Preference, rr.Flags, rr.Service, rr.Regexp, rr.Replacement} +} +func (rr *NID) copy() RR { + return &NID{*rr.Hdr.copyHeader(), rr.Preference, rr.NodeID} +} +func (rr *NIMLOC) copy() RR { + return &NIMLOC{*rr.Hdr.copyHeader(), rr.Locator} +} +func (rr *NINFO) copy() RR { + ZSData := make([]string, len(rr.ZSData)) + copy(ZSData, rr.ZSData) + return &NINFO{*rr.Hdr.copyHeader(), ZSData} +} +func (rr *NS) copy() RR { + return &NS{*rr.Hdr.copyHeader(), rr.Ns} +} +func (rr *NSAPPTR) copy() RR { + return &NSAPPTR{*rr.Hdr.copyHeader(), rr.Ptr} +} +func (rr *NSEC) copy() RR { + TypeBitMap := make([]uint16, len(rr.TypeBitMap)) + copy(TypeBitMap, rr.TypeBitMap) + return &NSEC{*rr.Hdr.copyHeader(), rr.NextDomain, TypeBitMap} +} +func (rr *NSEC3) copy() RR { + TypeBitMap := make([]uint16, len(rr.TypeBitMap)) + copy(TypeBitMap, rr.TypeBitMap) + return &NSEC3{*rr.Hdr.copyHeader(), rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt, rr.HashLength, rr.NextDomain, TypeBitMap} +} +func (rr *NSEC3PARAM) copy() RR { + return &NSEC3PARAM{*rr.Hdr.copyHeader(), rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt} +} +func (rr *OPENPGPKEY) copy() RR { + return &OPENPGPKEY{*rr.Hdr.copyHeader(), rr.PublicKey} +} +func (rr *OPT) copy() RR { + Option := make([]EDNS0, len(rr.Option)) + copy(Option, rr.Option) + return &OPT{*rr.Hdr.copyHeader(), Option} +} +func (rr *PTR) copy() RR { + return &PTR{*rr.Hdr.copyHeader(), rr.Ptr} +} +func (rr *PX) copy() RR { + return &PX{*rr.Hdr.copyHeader(), rr.Preference, rr.Map822, rr.Mapx400} +} +func (rr *RFC3597) copy() RR { + return &RFC3597{*rr.Hdr.copyHeader(), rr.Rdata} +} +func (rr *RKEY) copy() RR { + return &RKEY{*rr.Hdr.copyHeader(), rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey} +} +func (rr *RP) copy() RR { + return &RP{*rr.Hdr.copyHeader(), rr.Mbox, rr.Txt} +} +func (rr *RRSIG) copy() RR { + return &RRSIG{*rr.Hdr.copyHeader(), rr.TypeCovered, rr.Algorithm, rr.Labels, rr.OrigTtl, rr.Expiration, rr.Inception, rr.KeyTag, rr.SignerName, rr.Signature} +} +func (rr *RT) copy() RR { + return &RT{*rr.Hdr.copyHeader(), rr.Preference, rr.Host} +} +func (rr *SOA) copy() RR { + return &SOA{*rr.Hdr.copyHeader(), rr.Ns, rr.Mbox, rr.Serial, rr.Refresh, rr.Retry, rr.Expire, rr.Minttl} +} +func (rr *SPF) copy() RR { + Txt := make([]string, len(rr.Txt)) + copy(Txt, rr.Txt) + return &SPF{*rr.Hdr.copyHeader(), Txt} +} +func (rr *SRV) copy() RR { + return &SRV{*rr.Hdr.copyHeader(), rr.Priority, rr.Weight, rr.Port, rr.Target} +} +func (rr *SSHFP) copy() RR { + return &SSHFP{*rr.Hdr.copyHeader(), rr.Algorithm, rr.Type, rr.FingerPrint} +} +func (rr *TA) copy() RR { + return &TA{*rr.Hdr.copyHeader(), rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest} +} +func (rr *TALINK) copy() RR { + return &TALINK{*rr.Hdr.copyHeader(), rr.PreviousName, rr.NextName} +} +func (rr *TKEY) copy() RR { + return &TKEY{*rr.Hdr.copyHeader(), rr.Algorithm, rr.Inception, rr.Expiration, rr.Mode, rr.Error, rr.KeySize, rr.Key, rr.OtherLen, rr.OtherData} +} +func (rr *TLSA) copy() RR { + return &TLSA{*rr.Hdr.copyHeader(), rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate} +} +func (rr *TSIG) copy() RR { + return &TSIG{*rr.Hdr.copyHeader(), rr.Algorithm, rr.TimeSigned, rr.Fudge, rr.MACSize, rr.MAC, rr.OrigId, rr.Error, rr.OtherLen, rr.OtherData} +} +func (rr *TXT) copy() RR { + Txt := make([]string, len(rr.Txt)) + copy(Txt, rr.Txt) + return &TXT{*rr.Hdr.copyHeader(), Txt} +} +func (rr *UID) copy() RR { + return &UID{*rr.Hdr.copyHeader(), rr.Uid} +} +func (rr *UINFO) copy() RR { + return &UINFO{*rr.Hdr.copyHeader(), rr.Uinfo} +} +func (rr *URI) copy() RR { + return &URI{*rr.Hdr.copyHeader(), rr.Priority, rr.Weight, rr.Target} +} +func (rr *X25) copy() RR { + return &X25{*rr.Hdr.copyHeader(), rr.PSDNAddress} +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/LICENSE new file mode 100644 index 00000000..f9c841a5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/README.md b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/README.md new file mode 100644 index 00000000..659d6885 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/README.md @@ -0,0 +1,46 @@ +# mapstructure + +mapstructure is a Go library for decoding generic map values to structures +and vice versa, while providing helpful error handling. + +This library is most useful when decoding values from some data stream (JSON, +Gob, etc.) where you don't _quite_ know the structure of the underlying data +until you read a part of it. You can therefore read a `map[string]interface{}` +and use this library to decode it into the proper underlying native Go +structure. + +## Installation + +Standard `go get`: + +``` +$ go get github.com/mitchellh/mapstructure +``` + +## Usage & Example + +For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/mapstructure). + +The `Decode` function has examples associated with it there. + +## But Why?! + +Go offers fantastic standard libraries for decoding formats such as JSON. +The standard method is to have a struct pre-created, and populate that struct +from the bytes of the encoded format. This is great, but the problem is if +you have configuration or an encoding that changes slightly depending on +specific fields. For example, consider this JSON: + +```json +{ + "type": "person", + "name": "Mitchell" +} +``` + +Perhaps we can't populate a specific structure without first reading +the "type" field from the JSON. We could always do two passes over the +decoding of the JSON (reading the "type" first, and the rest later). +However, it is much simpler to just decode this into a `map[string]interface{}` +structure, read the "type" key, then use something like this library +to decode it into the proper structure. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/decode_hooks.go b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/decode_hooks.go new file mode 100644 index 00000000..115ae67c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/decode_hooks.go @@ -0,0 +1,154 @@ +package mapstructure + +import ( + "errors" + "reflect" + "strconv" + "strings" + "time" +) + +// typedDecodeHook takes a raw DecodeHookFunc (an interface{}) and turns +// it into the proper DecodeHookFunc type, such as DecodeHookFuncType. +func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc { + // Create variables here so we can reference them with the reflect pkg + var f1 DecodeHookFuncType + var f2 DecodeHookFuncKind + + // Fill in the variables into this interface and the rest is done + // automatically using the reflect package. + potential := []interface{}{f1, f2} + + v := reflect.ValueOf(h) + vt := v.Type() + for _, raw := range potential { + pt := reflect.ValueOf(raw).Type() + if vt.ConvertibleTo(pt) { + return v.Convert(pt).Interface() + } + } + + return nil +} + +// DecodeHookExec executes the given decode hook. This should be used +// since it'll naturally degrade to the older backwards compatible DecodeHookFunc +// that took reflect.Kind instead of reflect.Type. +func DecodeHookExec( + raw DecodeHookFunc, + from reflect.Type, to reflect.Type, + data interface{}) (interface{}, error) { + // Build our arguments that reflect expects + argVals := make([]reflect.Value, 3) + argVals[0] = reflect.ValueOf(from) + argVals[1] = reflect.ValueOf(to) + argVals[2] = reflect.ValueOf(data) + + switch f := typedDecodeHook(raw).(type) { + case DecodeHookFuncType: + return f(from, to, data) + case DecodeHookFuncKind: + return f(from.Kind(), to.Kind(), data) + default: + return nil, errors.New("invalid decode hook signature") + } +} + +// ComposeDecodeHookFunc creates a single DecodeHookFunc that +// automatically composes multiple DecodeHookFuncs. +// +// The composed funcs are called in order, with the result of the +// previous transformation. +func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data interface{}) (interface{}, error) { + var err error + for _, f1 := range fs { + data, err = DecodeHookExec(f1, f, t, data) + if err != nil { + return nil, err + } + + // Modify the from kind to be correct with the new data + f = nil + if val := reflect.ValueOf(data); val.IsValid() { + f = val.Type() + } + } + + return data, nil + } +} + +// StringToSliceHookFunc returns a DecodeHookFunc that converts +// string to []string by splitting on the given sep. +func StringToSliceHookFunc(sep string) DecodeHookFunc { + return func( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + if f != reflect.String || t != reflect.Slice { + return data, nil + } + + raw := data.(string) + if raw == "" { + return []string{}, nil + } + + return strings.Split(raw, sep), nil + } +} + +// StringToTimeDurationHookFunc returns a DecodeHookFunc that converts +// strings to time.Duration. +func StringToTimeDurationHookFunc() DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data interface{}) (interface{}, error) { + if f.Kind() != reflect.String { + return data, nil + } + if t != reflect.TypeOf(time.Duration(5)) { + return data, nil + } + + // Convert it by parsing + return time.ParseDuration(data.(string)) + } +} + +func WeaklyTypedHook( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + dataVal := reflect.ValueOf(data) + switch t { + case reflect.String: + switch f { + case reflect.Bool: + if dataVal.Bool() { + return "1", nil + } else { + return "0", nil + } + case reflect.Float32: + return strconv.FormatFloat(dataVal.Float(), 'f', -1, 64), nil + case reflect.Int: + return strconv.FormatInt(dataVal.Int(), 10), nil + case reflect.Slice: + dataType := dataVal.Type() + elemKind := dataType.Elem().Kind() + if elemKind == reflect.Uint8 { + return string(dataVal.Interface().([]uint8)), nil + } + case reflect.Uint: + return strconv.FormatUint(dataVal.Uint(), 10), nil + } + } + + return data, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/error.go b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/error.go new file mode 100644 index 00000000..47a99e5a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/error.go @@ -0,0 +1,50 @@ +package mapstructure + +import ( + "errors" + "fmt" + "sort" + "strings" +) + +// Error implements the error interface and can represents multiple +// errors that occur in the course of a single decode. +type Error struct { + Errors []string +} + +func (e *Error) Error() string { + points := make([]string, len(e.Errors)) + for i, err := range e.Errors { + points[i] = fmt.Sprintf("* %s", err) + } + + sort.Strings(points) + return fmt.Sprintf( + "%d error(s) decoding:\n\n%s", + len(e.Errors), strings.Join(points, "\n")) +} + +// WrappedErrors implements the errwrap.Wrapper interface to make this +// return value more useful with the errwrap and go-multierror libraries. +func (e *Error) WrappedErrors() []error { + if e == nil { + return nil + } + + result := make([]error, len(e.Errors)) + for i, e := range e.Errors { + result[i] = errors.New(e) + } + + return result +} + +func appendErrors(errors []string, err error) []string { + switch e := err.(type) { + case *Error: + return append(errors, e.Errors...) + default: + return append(errors, e.Error()) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/mapstructure.go new file mode 100644 index 00000000..a554e799 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -0,0 +1,790 @@ +// The mapstructure package exposes functionality to convert an +// abitrary map[string]interface{} into a native Go structure. +// +// The Go structure can be arbitrarily complex, containing slices, +// other structs, etc. and the decoder will properly decode nested +// maps and so on into the proper structures in the native Go struct. +// See the examples to see what the decoder is capable of. +package mapstructure + +import ( + "encoding/json" + "errors" + "fmt" + "reflect" + "sort" + "strconv" + "strings" +) + +// DecodeHookFunc is the callback function that can be used for +// data transformations. See "DecodeHook" in the DecoderConfig +// struct. +// +// The type should be DecodeHookFuncType or DecodeHookFuncKind. +// Either is accepted. Types are a superset of Kinds (Types can return +// Kinds) and are generally a richer thing to use, but Kinds are simpler +// if you only need those. +// +// The reason DecodeHookFunc is multi-typed is for backwards compatibility: +// we started with Kinds and then realized Types were the better solution, +// but have a promise to not break backwards compat so we now support +// both. +type DecodeHookFunc interface{} + +type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error) +type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) + +// DecoderConfig is the configuration that is used to create a new decoder +// and allows customization of various aspects of decoding. +type DecoderConfig struct { + // DecodeHook, if set, will be called before any decoding and any + // type conversion (if WeaklyTypedInput is on). This lets you modify + // the values before they're set down onto the resulting struct. + // + // If an error is returned, the entire decode will fail with that + // error. + DecodeHook DecodeHookFunc + + // If ErrorUnused is true, then it is an error for there to exist + // keys in the original map that were unused in the decoding process + // (extra keys). + ErrorUnused bool + + // ZeroFields, if set to true, will zero fields before writing them. + // For example, a map will be emptied before decoded values are put in + // it. If this is false, a map will be merged. + ZeroFields bool + + // If WeaklyTypedInput is true, the decoder will make the following + // "weak" conversions: + // + // - bools to string (true = "1", false = "0") + // - numbers to string (base 10) + // - bools to int/uint (true = 1, false = 0) + // - strings to int/uint (base implied by prefix) + // - int to bool (true if value != 0) + // - string to bool (accepts: 1, t, T, TRUE, true, True, 0, f, F, + // FALSE, false, False. Anything else is an error) + // - empty array = empty map and vice versa + // - negative numbers to overflowed uint values (base 10) + // - slice of maps to a merged map + // + WeaklyTypedInput bool + + // Metadata is the struct that will contain extra metadata about + // the decoding. If this is nil, then no metadata will be tracked. + Metadata *Metadata + + // Result is a pointer to the struct that will contain the decoded + // value. + Result interface{} + + // The tag name that mapstructure reads for field names. This + // defaults to "mapstructure" + TagName string +} + +// A Decoder takes a raw interface value and turns it into structured +// data, keeping track of rich error information along the way in case +// anything goes wrong. Unlike the basic top-level Decode method, you can +// more finely control how the Decoder behaves using the DecoderConfig +// structure. The top-level Decode method is just a convenience that sets +// up the most basic Decoder. +type Decoder struct { + config *DecoderConfig +} + +// Metadata contains information about decoding a structure that +// is tedious or difficult to get otherwise. +type Metadata struct { + // Keys are the keys of the structure which were successfully decoded + Keys []string + + // Unused is a slice of keys that were found in the raw value but + // weren't decoded since there was no matching field in the result interface + Unused []string +} + +// Decode takes a map and uses reflection to convert it into the +// given Go native structure. val must be a pointer to a struct. +func Decode(m interface{}, rawVal interface{}) error { + config := &DecoderConfig{ + Metadata: nil, + Result: rawVal, + } + + decoder, err := NewDecoder(config) + if err != nil { + return err + } + + return decoder.Decode(m) +} + +// WeakDecode is the same as Decode but is shorthand to enable +// WeaklyTypedInput. See DecoderConfig for more info. +func WeakDecode(input, output interface{}) error { + config := &DecoderConfig{ + Metadata: nil, + Result: output, + WeaklyTypedInput: true, + } + + decoder, err := NewDecoder(config) + if err != nil { + return err + } + + return decoder.Decode(input) +} + +// NewDecoder returns a new decoder for the given configuration. Once +// a decoder has been returned, the same configuration must not be used +// again. +func NewDecoder(config *DecoderConfig) (*Decoder, error) { + val := reflect.ValueOf(config.Result) + if val.Kind() != reflect.Ptr { + return nil, errors.New("result must be a pointer") + } + + val = val.Elem() + if !val.CanAddr() { + return nil, errors.New("result must be addressable (a pointer)") + } + + if config.Metadata != nil { + if config.Metadata.Keys == nil { + config.Metadata.Keys = make([]string, 0) + } + + if config.Metadata.Unused == nil { + config.Metadata.Unused = make([]string, 0) + } + } + + if config.TagName == "" { + config.TagName = "mapstructure" + } + + result := &Decoder{ + config: config, + } + + return result, nil +} + +// Decode decodes the given raw interface to the target pointer specified +// by the configuration. +func (d *Decoder) Decode(raw interface{}) error { + return d.decode("", raw, reflect.ValueOf(d.config.Result).Elem()) +} + +// Decodes an unknown data type into a specific reflection value. +func (d *Decoder) decode(name string, data interface{}, val reflect.Value) error { + if data == nil { + // If the data is nil, then we don't set anything. + return nil + } + + dataVal := reflect.ValueOf(data) + if !dataVal.IsValid() { + // If the data value is invalid, then we just set the value + // to be the zero value. + val.Set(reflect.Zero(val.Type())) + return nil + } + + if d.config.DecodeHook != nil { + // We have a DecodeHook, so let's pre-process the data. + var err error + data, err = DecodeHookExec( + d.config.DecodeHook, + dataVal.Type(), val.Type(), data) + if err != nil { + return err + } + } + + var err error + dataKind := getKind(val) + switch dataKind { + case reflect.Bool: + err = d.decodeBool(name, data, val) + case reflect.Interface: + err = d.decodeBasic(name, data, val) + case reflect.String: + err = d.decodeString(name, data, val) + case reflect.Int: + err = d.decodeInt(name, data, val) + case reflect.Uint: + err = d.decodeUint(name, data, val) + case reflect.Float32: + err = d.decodeFloat(name, data, val) + case reflect.Struct: + err = d.decodeStruct(name, data, val) + case reflect.Map: + err = d.decodeMap(name, data, val) + case reflect.Ptr: + err = d.decodePtr(name, data, val) + case reflect.Slice: + err = d.decodeSlice(name, data, val) + default: + // If we reached this point then we weren't able to decode it + return fmt.Errorf("%s: unsupported type: %s", name, dataKind) + } + + // If we reached here, then we successfully decoded SOMETHING, so + // mark the key as used if we're tracking metadata. + if d.config.Metadata != nil && name != "" { + d.config.Metadata.Keys = append(d.config.Metadata.Keys, name) + } + + return err +} + +// This decodes a basic type (bool, int, string, etc.) and sets the +// value to "data" of that type. +func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + if !dataVal.IsValid() { + dataVal = reflect.Zero(val.Type()) + } + + dataValType := dataVal.Type() + if !dataValType.AssignableTo(val.Type()) { + return fmt.Errorf( + "'%s' expected type '%s', got '%s'", + name, val.Type(), dataValType) + } + + val.Set(dataVal) + return nil +} + +func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + + converted := true + switch { + case dataKind == reflect.String: + val.SetString(dataVal.String()) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetString("1") + } else { + val.SetString("0") + } + case dataKind == reflect.Int && d.config.WeaklyTypedInput: + val.SetString(strconv.FormatInt(dataVal.Int(), 10)) + case dataKind == reflect.Uint && d.config.WeaklyTypedInput: + val.SetString(strconv.FormatUint(dataVal.Uint(), 10)) + case dataKind == reflect.Float32 && d.config.WeaklyTypedInput: + val.SetString(strconv.FormatFloat(dataVal.Float(), 'f', -1, 64)) + case dataKind == reflect.Slice && d.config.WeaklyTypedInput: + dataType := dataVal.Type() + elemKind := dataType.Elem().Kind() + switch { + case elemKind == reflect.Uint8: + val.SetString(string(dataVal.Interface().([]uint8))) + default: + converted = false + } + default: + converted = false + } + + if !converted { + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + dataType := dataVal.Type() + + switch { + case dataKind == reflect.Int: + val.SetInt(dataVal.Int()) + case dataKind == reflect.Uint: + val.SetInt(int64(dataVal.Uint())) + case dataKind == reflect.Float32: + val.SetInt(int64(dataVal.Float())) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetInt(1) + } else { + val.SetInt(0) + } + case dataKind == reflect.String && d.config.WeaklyTypedInput: + i, err := strconv.ParseInt(dataVal.String(), 0, val.Type().Bits()) + if err == nil { + val.SetInt(i) + } else { + return fmt.Errorf("cannot parse '%s' as int: %s", name, err) + } + case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": + jn := data.(json.Number) + i, err := jn.Int64() + if err != nil { + return fmt.Errorf( + "error decoding json.Number into %s: %s", name, err) + } + val.SetInt(i) + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + + switch { + case dataKind == reflect.Int: + i := dataVal.Int() + if i < 0 && !d.config.WeaklyTypedInput { + return fmt.Errorf("cannot parse '%s', %d overflows uint", + name, i) + } + val.SetUint(uint64(i)) + case dataKind == reflect.Uint: + val.SetUint(dataVal.Uint()) + case dataKind == reflect.Float32: + f := dataVal.Float() + if f < 0 && !d.config.WeaklyTypedInput { + return fmt.Errorf("cannot parse '%s', %f overflows uint", + name, f) + } + val.SetUint(uint64(f)) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetUint(1) + } else { + val.SetUint(0) + } + case dataKind == reflect.String && d.config.WeaklyTypedInput: + i, err := strconv.ParseUint(dataVal.String(), 0, val.Type().Bits()) + if err == nil { + val.SetUint(i) + } else { + return fmt.Errorf("cannot parse '%s' as uint: %s", name, err) + } + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + + switch { + case dataKind == reflect.Bool: + val.SetBool(dataVal.Bool()) + case dataKind == reflect.Int && d.config.WeaklyTypedInput: + val.SetBool(dataVal.Int() != 0) + case dataKind == reflect.Uint && d.config.WeaklyTypedInput: + val.SetBool(dataVal.Uint() != 0) + case dataKind == reflect.Float32 && d.config.WeaklyTypedInput: + val.SetBool(dataVal.Float() != 0) + case dataKind == reflect.String && d.config.WeaklyTypedInput: + b, err := strconv.ParseBool(dataVal.String()) + if err == nil { + val.SetBool(b) + } else if dataVal.String() == "" { + val.SetBool(false) + } else { + return fmt.Errorf("cannot parse '%s' as bool: %s", name, err) + } + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + dataType := dataVal.Type() + + switch { + case dataKind == reflect.Int: + val.SetFloat(float64(dataVal.Int())) + case dataKind == reflect.Uint: + val.SetFloat(float64(dataVal.Uint())) + case dataKind == reflect.Float32: + val.SetFloat(float64(dataVal.Float())) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetFloat(1) + } else { + val.SetFloat(0) + } + case dataKind == reflect.String && d.config.WeaklyTypedInput: + f, err := strconv.ParseFloat(dataVal.String(), val.Type().Bits()) + if err == nil { + val.SetFloat(f) + } else { + return fmt.Errorf("cannot parse '%s' as float: %s", name, err) + } + case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": + jn := data.(json.Number) + i, err := jn.Float64() + if err != nil { + return fmt.Errorf( + "error decoding json.Number into %s: %s", name, err) + } + val.SetFloat(i) + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) error { + valType := val.Type() + valKeyType := valType.Key() + valElemType := valType.Elem() + + // By default we overwrite keys in the current map + valMap := val + + // If the map is nil or we're purposely zeroing fields, make a new map + if valMap.IsNil() || d.config.ZeroFields { + // Make a new map to hold our result + mapType := reflect.MapOf(valKeyType, valElemType) + valMap = reflect.MakeMap(mapType) + } + + // Check input type + dataVal := reflect.Indirect(reflect.ValueOf(data)) + if dataVal.Kind() != reflect.Map { + // In weak mode, we accept a slice of maps as an input... + if d.config.WeaklyTypedInput { + switch dataVal.Kind() { + case reflect.Array, reflect.Slice: + // Special case for BC reasons (covered by tests) + if dataVal.Len() == 0 { + val.Set(valMap) + return nil + } + + for i := 0; i < dataVal.Len(); i++ { + err := d.decode( + fmt.Sprintf("%s[%d]", name, i), + dataVal.Index(i).Interface(), val) + if err != nil { + return err + } + } + + return nil + } + } + + return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind()) + } + + // Accumulate errors + errors := make([]string, 0) + + for _, k := range dataVal.MapKeys() { + fieldName := fmt.Sprintf("%s[%s]", name, k) + + // First decode the key into the proper type + currentKey := reflect.Indirect(reflect.New(valKeyType)) + if err := d.decode(fieldName, k.Interface(), currentKey); err != nil { + errors = appendErrors(errors, err) + continue + } + + // Next decode the data into the proper type + v := dataVal.MapIndex(k).Interface() + currentVal := reflect.Indirect(reflect.New(valElemType)) + if err := d.decode(fieldName, v, currentVal); err != nil { + errors = appendErrors(errors, err) + continue + } + + valMap.SetMapIndex(currentKey, currentVal) + } + + // Set the built up map to the value + val.Set(valMap) + + // If we had errors, return those + if len(errors) > 0 { + return &Error{errors} + } + + return nil +} + +func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) error { + // Create an element of the concrete (non pointer) type and decode + // into that. Then set the value of the pointer to this type. + valType := val.Type() + valElemType := valType.Elem() + realVal := reflect.New(valElemType) + if err := d.decode(name, data, reflect.Indirect(realVal)); err != nil { + return err + } + + val.Set(realVal) + return nil +} + +func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.Indirect(reflect.ValueOf(data)) + dataValKind := dataVal.Kind() + valType := val.Type() + valElemType := valType.Elem() + sliceType := reflect.SliceOf(valElemType) + + // Check input type + if dataValKind != reflect.Array && dataValKind != reflect.Slice { + // Accept empty map instead of array/slice in weakly typed mode + if d.config.WeaklyTypedInput && dataVal.Kind() == reflect.Map && dataVal.Len() == 0 { + val.Set(reflect.MakeSlice(sliceType, 0, 0)) + return nil + } else { + return fmt.Errorf( + "'%s': source data must be an array or slice, got %s", name, dataValKind) + } + } + + // Make a new slice to hold our result, same size as the original data. + valSlice := reflect.MakeSlice(sliceType, dataVal.Len(), dataVal.Len()) + + // Accumulate any errors + errors := make([]string, 0) + + for i := 0; i < dataVal.Len(); i++ { + currentData := dataVal.Index(i).Interface() + currentField := valSlice.Index(i) + + fieldName := fmt.Sprintf("%s[%d]", name, i) + if err := d.decode(fieldName, currentData, currentField); err != nil { + errors = appendErrors(errors, err) + } + } + + // Finally, set the value to the slice we built up + val.Set(valSlice) + + // If there were errors, we return those + if len(errors) > 0 { + return &Error{errors} + } + + return nil +} + +func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.Indirect(reflect.ValueOf(data)) + + // If the type of the value to write to and the data match directly, + // then we just set it directly instead of recursing into the structure. + if dataVal.Type() == val.Type() { + val.Set(dataVal) + return nil + } + + dataValKind := dataVal.Kind() + if dataValKind != reflect.Map { + return fmt.Errorf("'%s' expected a map, got '%s'", name, dataValKind) + } + + dataValType := dataVal.Type() + if kind := dataValType.Key().Kind(); kind != reflect.String && kind != reflect.Interface { + return fmt.Errorf( + "'%s' needs a map with string keys, has '%s' keys", + name, dataValType.Key().Kind()) + } + + dataValKeys := make(map[reflect.Value]struct{}) + dataValKeysUnused := make(map[interface{}]struct{}) + for _, dataValKey := range dataVal.MapKeys() { + dataValKeys[dataValKey] = struct{}{} + dataValKeysUnused[dataValKey.Interface()] = struct{}{} + } + + errors := make([]string, 0) + + // This slice will keep track of all the structs we'll be decoding. + // There can be more than one struct if there are embedded structs + // that are squashed. + structs := make([]reflect.Value, 1, 5) + structs[0] = val + + // Compile the list of all the fields that we're going to be decoding + // from all the structs. + fields := make(map[*reflect.StructField]reflect.Value) + for len(structs) > 0 { + structVal := structs[0] + structs = structs[1:] + + structType := structVal.Type() + + for i := 0; i < structType.NumField(); i++ { + fieldType := structType.Field(i) + fieldKind := fieldType.Type.Kind() + + if fieldType.Anonymous { + if fieldKind != reflect.Struct { + errors = appendErrors(errors, + fmt.Errorf("%s: unsupported type: %s", fieldType.Name, fieldKind)) + continue + } + } + + // If "squash" is specified in the tag, we squash the field down. + squash := false + tagParts := strings.Split(fieldType.Tag.Get(d.config.TagName), ",") + for _, tag := range tagParts[1:] { + if tag == "squash" { + squash = true + break + } + } + + if squash { + if fieldKind != reflect.Struct { + errors = appendErrors(errors, + fmt.Errorf("%s: unsupported type for squash: %s", fieldType.Name, fieldKind)) + } else { + structs = append(structs, val.FieldByName(fieldType.Name)) + } + continue + } + + // Normal struct field, store it away + fields[&fieldType] = structVal.Field(i) + } + } + + for fieldType, field := range fields { + fieldName := fieldType.Name + + tagValue := fieldType.Tag.Get(d.config.TagName) + tagValue = strings.SplitN(tagValue, ",", 2)[0] + if tagValue != "" { + fieldName = tagValue + } + + rawMapKey := reflect.ValueOf(fieldName) + rawMapVal := dataVal.MapIndex(rawMapKey) + if !rawMapVal.IsValid() { + // Do a slower search by iterating over each key and + // doing case-insensitive search. + for dataValKey, _ := range dataValKeys { + mK, ok := dataValKey.Interface().(string) + if !ok { + // Not a string key + continue + } + + if strings.EqualFold(mK, fieldName) { + rawMapKey = dataValKey + rawMapVal = dataVal.MapIndex(dataValKey) + break + } + } + + if !rawMapVal.IsValid() { + // There was no matching key in the map for the value in + // the struct. Just ignore. + continue + } + } + + // Delete the key we're using from the unused map so we stop tracking + delete(dataValKeysUnused, rawMapKey.Interface()) + + if !field.IsValid() { + // This should never happen + panic("field is not valid") + } + + // If we can't set the field, then it is unexported or something, + // and we just continue onwards. + if !field.CanSet() { + continue + } + + // If the name is empty string, then we're at the root, and we + // don't dot-join the fields. + if name != "" { + fieldName = fmt.Sprintf("%s.%s", name, fieldName) + } + + if err := d.decode(fieldName, rawMapVal.Interface(), field); err != nil { + errors = appendErrors(errors, err) + } + } + + if d.config.ErrorUnused && len(dataValKeysUnused) > 0 { + keys := make([]string, 0, len(dataValKeysUnused)) + for rawKey, _ := range dataValKeysUnused { + keys = append(keys, rawKey.(string)) + } + sort.Strings(keys) + + err := fmt.Errorf("'%s' has invalid keys: %s", name, strings.Join(keys, ", ")) + errors = appendErrors(errors, err) + } + + if len(errors) > 0 { + return &Error{errors} + } + + // Add the unused keys to the list of unused keys if we're tracking metadata + if d.config.Metadata != nil { + for rawKey, _ := range dataValKeysUnused { + key := rawKey.(string) + if name != "" { + key = fmt.Sprintf("%s.%s", name, key) + } + + d.config.Metadata.Unused = append(d.config.Metadata.Unused, key) + } + } + + return nil +} + +func getKind(val reflect.Value) reflect.Kind { + kind := val.Kind() + + switch { + case kind >= reflect.Int && kind <= reflect.Int64: + return reflect.Int + case kind >= reflect.Uint && kind <= reflect.Uint64: + return reflect.Uint + case kind >= reflect.Float32 && kind <= reflect.Float64: + return reflect.Float32 + default: + return kind + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/LICENSE.txt b/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/LICENSE.txt new file mode 100644 index 00000000..5a0cb2df --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/LICENSE.txt @@ -0,0 +1,24 @@ +Copyright (c) 2010, Nikola Ranchev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/README.textile b/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/README.textile new file mode 100644 index 00000000..2e449b8a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/README.textile @@ -0,0 +1,46 @@ +h2. General Description + +p{width:500px}. This is the Go implementation of the "Maxmind":http://www.maxmind.com/app/ip-location GeoIP API. It is incomplete and work in progress the initial goal is support only two of the database types - the City Lite and Country Lite. The only supported method is loading the full db on startup into memory (memory cache). + +h3. Supported Access Methods + +* In Memory (Load(string)) + +h3. Supported Database Formats + +* Country Edition (dbType=1) +* City Edition REV 0 (dbType=6) +* City Edition REV 1 (dbType=2) + +h3. Supported Lookups + +* By IP Address (GetLocationByIP(string)) +* By IP Number (GetLocationByIPNum(uint32)) + +h3. Supported Responses + +* CountryCode string (available in all databases) +* CountryName string (available in all databases) +* City string +* Region string +* PostalCode string +* Latitude float32 +* Longitude float32 + +h3. To Do +* Implement better error handling (report the error on load and lookups) +* Better returns, country edition has only code and name (perhaps use interfaces) +* Add test cases and benchmarking +* Add support for more database formats + +h3. Build + +make (See Makefile for more details) + +h3. Example + +./example DBFILE IPADDRESS (i.e. ./example GeoIP.dat 1.1.1.1) + +h3. Usage + +Please see example.go for a complete example of how to use this library. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/example/example.go b/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/example/example.go new file mode 100644 index 00000000..8252b627 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/example/example.go @@ -0,0 +1,39 @@ +package main + +import ( + "flag" + "fmt" + "github.com/nranchev/go-libGeoIP" +) + +func main() { + flag.Parse() + + // Check the number of arguments + if flag.NArg() < 2 { + fmt.Printf("usage: main DBFILE IPADDRESS\n") + return + } + + // Set the arguments + dbFile := flag.Arg(0) + ipAddr := flag.Arg(1) + + // Load the database file, exit on failure + gi, err := libgeo.Load(dbFile) + if err != nil { + fmt.Printf("Error: %s\n", err.Error()) + return + } + + // Lookup the IP and display the details if country is found + loc := gi.GetLocationByIP(ipAddr) + if loc != nil { + fmt.Printf("Country: %s (%s)\n", loc.CountryName, loc.CountryCode) + fmt.Printf("City: %s\n", loc.City) + fmt.Printf("Region: %s\n", loc.Region) + fmt.Printf("Postal Code: %s\n", loc.PostalCode) + fmt.Printf("Latitude: %f\n", loc.Latitude) + fmt.Printf("Longitude: %f\n", loc.Longitude) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/libgeo.go b/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/libgeo.go new file mode 100644 index 00000000..4794a55b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/nranchev/go-libGeoIP/libgeo.go @@ -0,0 +1,354 @@ +/** + * libgeo.go + * + * Copyright (c) 2010, Nikola Ranchev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package libgeo + +// Dependencies +import ( + "errors" + "os" +) + +// Globals (const arrays that will be initialized inside init()) +var ( + countryCode = []string{ + "--", "AP", "EU", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", + "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", + "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", + "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CX", "CY", "CZ", + "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", + "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB", "GD", "GE", "GF", "GH", "GI", "GL", + "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", + "HT", "HU", "ID", "IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", + "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", + "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", + "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", + "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", + "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", + "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", + "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", + "TH", "TJ", "TK", "TM", "TN", "TO", "TL", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", + "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", + "YT", "RS", "ZA", "ZM", "ME", "ZW", "A1", "A2", "O1", "AX", "GG", "IM", "JE", "BL", + "MF", "BQ", "SS", "O1"} + countryName = []string{ + "N/A", "Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates", + "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", + "Netherlands Antilles", "Angola", "Antarctica", "Argentina", "American Samoa", + "Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina", + "Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", + "Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia", "Brazil", "Bahamas", + "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", "Canada", + "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the", + "Central African Republic", "Congo", "Switzerland", "Cote D'Ivoire", + "Cook Islands", "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", + "Cape Verde", "Christmas Island", "Cyprus", "Czech Republic", "Germany", + "Djibouti", "Denmark", "Dominica", "Dominican Republic", "Algeria", "Ecuador", + "Estonia", "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", + "Fiji", "Falkland Islands (Malvinas)", "Micronesia, Federated States of", + "Faroe Islands", "France", "France, Metropolitan", "Gabon", "United Kingdom", + "Grenada", "Georgia", "French Guiana", "Ghana", "Gibraltar", "Greenland", "Gambia", + "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", + "South Georgia and the South Sandwich Islands", "Guatemala", "Guam", + "Guinea-Bissau", "Guyana", "Hong Kong", "Heard Island and McDonald Islands", + "Honduras", "Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "India", + "British Indian Ocean Territory", "Iraq", "Iran, Islamic Republic of", + "Iceland", "Italy", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan", "Cambodia", + "Kiribati", "Comoros", "Saint Kitts and Nevis", + "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", + "Cayman Islands", "Kazakhstan", "Lao People's Democratic Republic", "Lebanon", + "Saint Lucia", "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", + "Luxembourg", "Latvia", "Libyan Arab Jamahiriya", "Morocco", "Monaco", + "Moldova, Republic of", "Madagascar", "Marshall Islands", + "Macedonia", "Mali", "Myanmar", "Mongolia", + "Macau", "Northern Mariana Islands", "Martinique", "Mauritania", "Montserrat", + "Malta", "Mauritius", "Maldives", "Malawi", "Mexico", "Malaysia", "Mozambique", + "Namibia", "New Caledonia", "Niger", "Norfolk Island", "Nigeria", "Nicaragua", + "Netherlands", "Norway", "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", + "Peru", "French Polynesia", "Papua New Guinea", "Philippines", "Pakistan", + "Poland", "Saint Pierre and Miquelon", "Pitcairn Islands", "Puerto Rico", + "Palestinian Territory", "Portugal", "Palau", "Paraguay", "Qatar", + "Reunion", "Romania", "Russian Federation", "Rwanda", "Saudi Arabia", + "Solomon Islands", "Seychelles", "Sudan", "Sweden", "Singapore", "Saint Helena", + "Slovenia", "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", + "Senegal", "Somalia", "Suriname", "Sao Tome and Principe", "El Salvador", + "Syrian Arab Republic", "Swaziland", "Turks and Caicos Islands", "Chad", + "French Southern Territories", "Togo", "Thailand", "Tajikistan", "Tokelau", + "Turkmenistan", "Tunisia", "Tonga", "Timor-Leste", "Turkey", "Trinidad and Tobago", + "Tuvalu", "Taiwan", "Tanzania, United Republic of", "Ukraine", "Uganda", + "United States Minor Outlying Islands", "United States", "Uruguay", "Uzbekistan", + "Holy See (Vatican City State)", "Saint Vincent and the Grenadines", + "Venezuela", "Virgin Islands, British", "Virgin Islands, U.S.", "Vietnam", + "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", "Serbia", + "South Africa", "Zambia", "Montenegro", "Zimbabwe", "Anonymous Proxy", + "Satellite Provider", "Other", "Aland Islands", "Guernsey", "Isle of Man", "Jersey", + "Saint Barthelemy", "Saint Martin", "Bonaire, Saint Eustatius and Saba", + "South Sudan", "Other"} +) + +// Constants +const ( + maxRecordLength = 4 + standardRecordLength = 3 + countryBegin = 16776960 + structureInfoMaxSize = 20 + fullRecordLength = 60 + segmentRecordLength = 3 + + // DB Types + dbCountryEdition = byte(1) + dbCityEditionRev0 = byte(6) + dbCityEditionRev1 = byte(2) +) + +// These are some structs +type GeoIP struct { + databaseSegment int // No need to make an array of size 1 + recordLength int // Set to one of the constants above + dbType byte // Store the database type + data []byte // All of the data from the DB file +} +type Location struct { + CountryCode string // If country ed. only country info is filled + CountryName string // If country ed. only country info is filled + Region string + City string + PostalCode string + Latitude float32 + Longitude float32 +} + +// Load the database file in memory, detect the db format and setup the GeoIP struct +func Load(filename string) (gi *GeoIP, err error) { + // Try to open the requested file + dbInfo, err := os.Lstat(filename) + if err != nil { + return + } + dbFile, err := os.Open(filename) + if err != nil { + return + } + + // Copy the db into memory + gi = new(GeoIP) + gi.data = make([]byte, dbInfo.Size()) + dbFile.Read(gi.data) + dbFile.Close() + + // Check the database type + gi.dbType = dbCountryEdition // Default the database to country edition + gi.databaseSegment = countryBegin // Default to country DB + gi.recordLength = standardRecordLength // Default to country DB + + // Search for the DB type headers + delim := make([]byte, 3) + for i := 0; i < structureInfoMaxSize; i++ { + delim = gi.data[len(gi.data)-i-3-1 : len(gi.data)-i-1] + if int8(delim[0]) == -1 && int8(delim[1]) == -1 && int8(delim[2]) == -1 { + gi.dbType = gi.data[len(gi.data)-i-1] + // If we detect city edition set the correct segment offset + if gi.dbType == dbCityEditionRev0 || gi.dbType == dbCityEditionRev1 { + buf := make([]byte, segmentRecordLength) + buf = gi.data[len(gi.data)-i-1+1 : len(gi.data)-i-1+4] + gi.databaseSegment = 0 + for j := 0; j < segmentRecordLength; j++ { + gi.databaseSegment += (int(buf[j]) << uint8(j*8)) + } + } + break + } + } + + // Support older formats + if gi.dbType >= 106 { + gi.dbType -= 105 + } + + // Reject unsupported formats + if gi.dbType != dbCountryEdition && gi.dbType != dbCityEditionRev0 && gi.dbType != dbCityEditionRev1 { + err = errors.New("Unsupported database format") + return + } + + return +} + +// Lookup by IP address and return location +func (gi *GeoIP) GetLocationByIP(ip string) *Location { + return gi.GetLocationByIPNum(AddrToNum(ip)) +} + +// Lookup by IP number and return location +func (gi *GeoIP) GetLocationByIPNum(ipNum uint32) *Location { + // Perform the lookup on the database to see if the record is found + offset := gi.lookupByIPNum(ipNum) + + // Check if the country was found + if gi.dbType == dbCountryEdition && offset-countryBegin == 0 || + gi.dbType != dbCountryEdition && gi.databaseSegment == offset { + return nil + } + + // Create a generic location structure + location := new(Location) + + // If the database is country + if gi.dbType == dbCountryEdition { + location.CountryCode = countryCode[offset-countryBegin] + location.CountryName = countryName[offset-countryBegin] + + return location + } + + // Find the max record length + recPointer := offset + (2*gi.recordLength-1)*gi.databaseSegment + recordEnd := recPointer + fullRecordLength + if len(gi.data)-recPointer < fullRecordLength { + recordEnd = len(gi.data) + } + + // Read the country code/name first + location.CountryCode = countryCode[gi.data[recPointer]] + location.CountryName = countryName[gi.data[recPointer]] + readLen := 1 + recPointer += 1 + + // Get the region + for readLen = 0; gi.data[recPointer+readLen] != '\000' && + recPointer+readLen < recordEnd; readLen++ { + } + if readLen != 0 { + location.Region = string(gi.data[recPointer : recPointer+readLen]) + } + recPointer += readLen + 1 + + // Get the city + for readLen = 0; gi.data[recPointer+readLen] != '\000' && + recPointer+readLen < recordEnd; readLen++ { + } + if readLen != 0 { + location.City = string(gi.data[recPointer : recPointer+readLen]) + } + recPointer += readLen + 1 + + // Get the postal code + for readLen = 0; gi.data[recPointer+readLen] != '\000' && + recPointer+readLen < recordEnd; readLen++ { + } + if readLen != 0 { + location.PostalCode = string(gi.data[recPointer : recPointer+readLen]) + } + recPointer += readLen + 1 + + // Get the latitude + coordinate := float32(0) + for j := 0; j < 3; j++ { + coordinate += float32(int32(gi.data[recPointer+j]) << uint8(j*8)) + } + location.Latitude = float32(coordinate/10000 - 180) + recPointer += 3 + + // Get the longitude + coordinate = 0 + for j := 0; j < 3; j++ { + coordinate += float32(int32(gi.data[recPointer+j]) << uint8(j*8)) + } + location.Longitude = float32(coordinate/10000 - 180) + + return location +} + +// Read the database and return record position +func (gi *GeoIP) lookupByIPNum(ip uint32) int { + buf := make([]byte, 2*maxRecordLength) + x := make([]int, 2) + offset := 0 + for depth := 31; depth >= 0; depth-- { + for i := 0; i < 2*maxRecordLength; i++ { + buf[i] = gi.data[(2*gi.recordLength*offset)+i] + } + for i := 0; i < 2; i++ { + x[i] = 0 + for j := 0; j < gi.recordLength; j++ { + var y int = int(buf[i*gi.recordLength+j]) + if y < 0 { + y += 256 + } + x[i] += (y << uint(j*8)) + } + } + if (ip & (1 << uint(depth))) > 0 { + if x[1] >= gi.databaseSegment { + return x[1] + } + offset = x[1] + } else { + if x[0] >= gi.databaseSegment { + return x[0] + } + offset = x[0] + } + } + return 0 +} + +// Convert ip address to an int representation +func AddrToNum(ip string) uint32 { + octet := uint32(0) + ipnum := uint32(0) + i := 3 + for j := 0; j < len(ip); j++ { + c := byte(ip[j]) + if c == '.' { + if octet > 255 { + return 0 + } + ipnum <<= 8 + ipnum += octet + i-- + octet = 0 + } else { + t := octet + octet <<= 3 + octet += t + octet += t + c -= '0' + if c > 9 { + return 0 + } + octet += uint32(c) + } + } + if (octet > 255) || (i != 0) { + return 0 + } + ipnum <<= 8 + return uint32(ipnum + octet) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/LICENSE new file mode 100644 index 00000000..bd899d83 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2015, Pierre Curto +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of xxHash nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/README.md b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/README.md new file mode 100644 index 00000000..dd3c9d47 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/README.md @@ -0,0 +1,31 @@ +[![godoc](https://godoc.org/github.com/pierrec/lz4?status.png)](https://godoc.org/github.com/pierrec/lz4) +[![Build Status](https://travis-ci.org/pierrec/lz4.svg?branch=master)](https://travis-ci.org/pierrec/lz4) + +# lz4 +LZ4 compression and decompression in pure Go + +## Usage + +```go +import "github.com/pierrec/lz4" +``` + +## Description + +Package lz4 implements reading and writing lz4 compressed data (a frame), +as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html, +using an io.Reader (decompression) and io.Writer (compression). +It is designed to minimize memory usage while maximizing throughput by being able to +[de]compress data concurrently. + +The Reader and the Writer support concurrent processing provided the supplied buffers are +large enough (in multiples of BlockMaxSize) and there is no block dependency. +Reader.WriteTo and Writer.ReadFrom do leverage the concurrency transparently. +The runtime.GOMAXPROCS() value is used to apply concurrency or not. + +Although the block level compression and decompression functions are exposed and are fully compatible +with the lz4 block format definition, they are low level and should not be used directly. +For a complete description of an lz4 compressed block, see: +http://fastcompression.blogspot.fr/2011/05/lz4-explained.html + +See https://github.com/Cyan4973/lz4 for the reference C implementation. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/block.go b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/block.go new file mode 100644 index 00000000..6884bccd --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/block.go @@ -0,0 +1,474 @@ +package lz4 + +import ( + "encoding/binary" + "errors" + "unsafe" +) + +// block represents a frame data block. +// Used when compressing or decompressing frame blocks concurrently. +type block struct { + compressed bool + zdata []byte // compressed data + data []byte // decompressed data + offset int // offset within the data as with block dependency the 64Kb window is prepended to it + checksum uint32 // compressed data checksum + err error // error while [de]compressing +} + +var ( + // ErrInvalidSource is returned by UncompressBlock when a compressed block is corrupted. + ErrInvalidSource = errors.New("lz4: invalid source") + // ErrShortBuffer is returned by UncompressBlock, CompressBlock or CompressBlockHC when + // the supplied buffer for [de]compression is too small. + ErrShortBuffer = errors.New("lz4: short buffer") +) + +// CompressBlockBound returns the maximum size of a given buffer of size n, when not compressible. +func CompressBlockBound(n int) int { + return n + n/255 + 16 +} + +// UncompressBlock decompresses the source buffer into the destination one, +// starting at the di index and returning the decompressed size. +// +// The destination buffer must be sized appropriately. +// +// An error is returned if the source data is invalid or the destination buffer is too small. +func UncompressBlock(src, dst []byte, di int) (int, error) { + si, sn, di0 := 0, len(src), di + if sn == 0 { + return 0, nil + } + + for { + // literals and match lengths (token) + lLen := int(src[si] >> 4) + mLen := int(src[si] & 0xF) + if si++; si == sn { + return di, ErrInvalidSource + } + + // literals + if lLen > 0 { + if lLen == 0xF { + for src[si] == 0xFF { + lLen += 0xFF + if si++; si == sn { + return di - di0, ErrInvalidSource + } + } + lLen += int(src[si]) + if si++; si == sn { + return di - di0, ErrInvalidSource + } + } + if len(dst)-di < lLen || si+lLen > sn { + return di - di0, ErrShortBuffer + } + di += copy(dst[di:], src[si:si+lLen]) + + if si += lLen; si >= sn { + return di - di0, nil + } + } + + if si += 2; si >= sn { + return di, ErrInvalidSource + } + offset := int(src[si-2]) | int(src[si-1])<<8 + if di-offset < 0 || offset == 0 { + return di - di0, ErrInvalidSource + } + + // match + if mLen == 0xF { + for src[si] == 0xFF { + mLen += 0xFF + if si++; si == sn { + return di - di0, ErrInvalidSource + } + } + mLen += int(src[si]) + if si++; si == sn { + return di - di0, ErrInvalidSource + } + } + // minimum match length is 4 + mLen += 4 + if len(dst)-di <= mLen { + return di - di0, ErrShortBuffer + } + + // copy the match (NB. match is at least 4 bytes long) + // NB. past di, copy() would write old bytes instead of + // the ones we just copied, so split the work into the largest chunk. + for ; mLen >= offset; mLen -= offset { + di += copy(dst[di:], dst[di-offset:di]) + } + di += copy(dst[di:], dst[di-offset:di-offset+mLen]) + } +} + +type hashEntry struct { + generation uint + value int +} + +// CompressBlock compresses the source buffer starting at soffet into the destination one. +// This is the fast version of LZ4 compression and also the default one. +// +// The size of the compressed data is returned. If it is 0 and no error, then the data is incompressible. +// +// An error is returned if the destination buffer is too small. +func CompressBlock(src, dst []byte, soffset int) (int, error) { + var hashTable [hashTableSize]hashEntry + return compressGenerationalBlock(src, dst, soffset, 0, hashTable[:]) +} + +// getUint32 is a despicably evil function (well, for Go!) that takes advantage +// of the machine's byte order to save some operations. This may look +// inefficient but it is significantly faster on littleEndian machines, +// which include x84, amd64, and some ARM processors. +func getUint32(b []byte) uint32 { + _ = b[3] + if isLittleEndian { + return *(*uint32)(unsafe.Pointer(&b)) + } + + return uint32(b[0]) | + uint32(b[1])<<8 | + uint32(b[2])<<16 | + uint32(b[3])<<24 +} + +func compressGenerationalBlock(src, dst []byte, soffset int, generation uint, hashTable []hashEntry) (int, error) { + sn, dn := len(src)-mfLimit, len(dst) + if sn <= 0 || dn == 0 || soffset >= sn { + return 0, nil + } + var si, di int + + // fast scan strategy: + // we only need a hash table to store the last sequences (4 bytes) + var hashShift = uint((minMatch * 8) - hashLog) + + // Initialise the hash table with the first 64Kb of the input buffer + // (used when compressing dependent blocks) + for si < soffset { + h := getUint32(src[si:]) * hasher >> hashShift + si++ + hashTable[h] = hashEntry{generation, si} + } + + anchor := si + fma := 1 << skipStrength + for si < sn-minMatch { + // hash the next 4 bytes (sequence)... + h := getUint32(src[si:]) * hasher >> hashShift + if hashTable[h].generation != generation { + hashTable[h] = hashEntry{generation, 0} + } + // -1 to separate existing entries from new ones + ref := hashTable[h].value - 1 + // ...and store the position of the hash in the hash table (+1 to compensate the -1 upon saving) + hashTable[h].value = si + 1 + // no need to check the last 3 bytes in the first literal 4 bytes as + // this guarantees that the next match, if any, is compressed with + // a lower size, since to have some compression we must have: + // ll+ml-overlap > 1 + (ll-15)/255 + (ml-4-15)/255 + 2 (uncompressed size>compressed size) + // => ll+ml>3+2*overlap => ll+ml>= 4+2*overlap + // and by definition we do have: + // ll >= 1, ml >= 4 + // => ll+ml >= 5 + // => so overlap must be 0 + + // the sequence is new, out of bound (64kb) or not valid: try next sequence + if ref < 0 || fma&(1<>winSizeLog > 0 || + src[ref] != src[si] || + src[ref+1] != src[si+1] || + src[ref+2] != src[si+2] || + src[ref+3] != src[si+3] { + // variable step: improves performance on non-compressible data + si += fma >> skipStrength + fma++ + continue + } + // match found + fma = 1 << skipStrength + lLen := si - anchor + offset := si - ref + + // encode match length part 1 + si += minMatch + mLen := si // match length has minMatch already + for si <= sn && src[si] == src[si-offset] { + si++ + } + mLen = si - mLen + if mLen < 0xF { + dst[di] = byte(mLen) + } else { + dst[di] = 0xF + } + + // encode literals length + if lLen < 0xF { + dst[di] |= byte(lLen << 4) + } else { + dst[di] |= 0xF0 + if di++; di == dn { + return di, ErrShortBuffer + } + l := lLen - 0xF + for ; l >= 0xFF; l -= 0xFF { + dst[di] = 0xFF + if di++; di == dn { + return di, ErrShortBuffer + } + } + dst[di] = byte(l) + } + if di++; di == dn { + return di, ErrShortBuffer + } + + // literals + if di+lLen >= dn { + return di, ErrShortBuffer + } + di += copy(dst[di:], src[anchor:anchor+lLen]) + anchor = si + + // encode offset + if di += 2; di >= dn { + return di, ErrShortBuffer + } + dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) + + // encode match length part 2 + if mLen >= 0xF { + for mLen -= 0xF; mLen >= 0xFF; mLen -= 0xFF { + dst[di] = 0xFF + if di++; di == dn { + return di, ErrShortBuffer + } + } + dst[di] = byte(mLen) + if di++; di == dn { + return di, ErrShortBuffer + } + } + } + + if anchor == 0 { + // incompressible + return 0, nil + } + + // last literals + lLen := len(src) - anchor + if lLen < 0xF { + dst[di] = byte(lLen << 4) + } else { + dst[di] = 0xF0 + if di++; di == dn { + return di, ErrShortBuffer + } + lLen -= 0xF + for ; lLen >= 0xFF; lLen -= 0xFF { + dst[di] = 0xFF + if di++; di == dn { + return di, ErrShortBuffer + } + } + dst[di] = byte(lLen) + } + if di++; di == dn { + return di, ErrShortBuffer + } + + // write literals + src = src[anchor:] + switch n := di + len(src); { + case n > dn: + return di, ErrShortBuffer + case n >= sn: + // incompressible + return 0, nil + } + di += copy(dst[di:], src) + return di, nil +} + +// CompressBlockHC compresses the source buffer starting at soffet into the destination one. +// CompressBlockHC compression ratio is better than CompressBlock but it is also slower. +// +// The size of the compressed data is returned. If it is 0 and no error, then the data is not compressible. +// +// An error is returned if the destination buffer is too small. +func CompressBlockHC(src, dst []byte, soffset int) (int, error) { + sn, dn := len(src)-mfLimit, len(dst) + if sn <= 0 || dn == 0 || soffset >= sn { + return 0, nil + } + var si, di int + + // Hash Chain strategy: + // we need a hash table and a chain table + // the chain table cannot contain more entries than the window size (64Kb entries) + var hashTable [1 << hashLog]int + var chainTable [winSize]int + var hashShift = uint((minMatch * 8) - hashLog) + + // Initialise the hash table with the first 64Kb of the input buffer + // (used when compressing dependent blocks) + for si < soffset { + h := binary.LittleEndian.Uint32(src[si:]) * hasher >> hashShift + chainTable[si&winMask] = hashTable[h] + si++ + hashTable[h] = si + } + + anchor := si + for si < sn-minMatch { + // hash the next 4 bytes (sequence)... + h := binary.LittleEndian.Uint32(src[si:]) * hasher >> hashShift + + // follow the chain until out of window and give the longest match + mLen := 0 + offset := 0 + for next := hashTable[h] - 1; next > 0 && next > si-winSize; next = chainTable[next&winMask] - 1 { + // the first (mLen==0) or next byte (mLen>=minMatch) at current match length must match to improve on the match length + if src[next+mLen] == src[si+mLen] { + for ml := 0; ; ml++ { + if src[next+ml] != src[si+ml] || si+ml > sn { + // found a longer match, keep its position and length + if mLen < ml && ml >= minMatch { + mLen = ml + offset = si - next + } + break + } + } + } + } + chainTable[si&winMask] = hashTable[h] + hashTable[h] = si + 1 + + // no match found + if mLen == 0 { + si++ + continue + } + + // match found + // update hash/chain tables with overlaping bytes: + // si already hashed, add everything from si+1 up to the match length + for si, ml := si+1, si+mLen; si < ml; { + h := binary.LittleEndian.Uint32(src[si:]) * hasher >> hashShift + chainTable[si&winMask] = hashTable[h] + si++ + hashTable[h] = si + } + + lLen := si - anchor + si += mLen + mLen -= minMatch // match length does not include minMatch + + if mLen < 0xF { + dst[di] = byte(mLen) + } else { + dst[di] = 0xF + } + + // encode literals length + if lLen < 0xF { + dst[di] |= byte(lLen << 4) + } else { + dst[di] |= 0xF0 + if di++; di == dn { + return di, ErrShortBuffer + } + l := lLen - 0xF + for ; l >= 0xFF; l -= 0xFF { + dst[di] = 0xFF + if di++; di == dn { + return di, ErrShortBuffer + } + } + dst[di] = byte(l) + } + if di++; di == dn { + return di, ErrShortBuffer + } + + // literals + if di+lLen >= dn { + return di, ErrShortBuffer + } + di += copy(dst[di:], src[anchor:anchor+lLen]) + anchor = si + + // encode offset + if di += 2; di >= dn { + return di, ErrShortBuffer + } + dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) + + // encode match length part 2 + if mLen >= 0xF { + for mLen -= 0xF; mLen >= 0xFF; mLen -= 0xFF { + dst[di] = 0xFF + if di++; di == dn { + return di, ErrShortBuffer + } + } + dst[di] = byte(mLen) + if di++; di == dn { + return di, ErrShortBuffer + } + } + } + + if anchor == 0 { + // incompressible + return 0, nil + } + + // last literals + lLen := len(src) - anchor + if lLen < 0xF { + dst[di] = byte(lLen << 4) + } else { + dst[di] = 0xF0 + if di++; di == dn { + return di, ErrShortBuffer + } + lLen -= 0xF + for ; lLen >= 0xFF; lLen -= 0xFF { + dst[di] = 0xFF + if di++; di == dn { + return di, ErrShortBuffer + } + } + dst[di] = byte(lLen) + } + if di++; di == dn { + return di, ErrShortBuffer + } + + // write literals + src = src[anchor:] + switch n := di + len(src); { + case n > dn: + return di, ErrShortBuffer + case n >= sn: + // incompressible + return 0, nil + } + di += copy(dst[di:], src) + return di, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/lz4.go b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/lz4.go new file mode 100644 index 00000000..46389243 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/lz4.go @@ -0,0 +1,118 @@ +// Package lz4 implements reading and writing lz4 compressed data (a frame), +// as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html, +// using an io.Reader (decompression) and io.Writer (compression). +// It is designed to minimize memory usage while maximizing throughput by being able to +// [de]compress data concurrently. +// +// The Reader and the Writer support concurrent processing provided the supplied buffers are +// large enough (in multiples of BlockMaxSize) and there is no block dependency. +// Reader.WriteTo and Writer.ReadFrom do leverage the concurrency transparently. +// The runtime.GOMAXPROCS() value is used to apply concurrency or not. +// +// Although the block level compression and decompression functions are exposed and are fully compatible +// with the lz4 block format definition, they are low level and should not be used directly. +// For a complete description of an lz4 compressed block, see: +// http://fastcompression.blogspot.fr/2011/05/lz4-explained.html +// +// See https://github.com/Cyan4973/lz4 for the reference C implementation. +package lz4 + +import ( + "hash" + "sync" + "unsafe" + + "github.com/pierrec/xxHash/xxHash32" +) + +const ( + // Extension is the LZ4 frame file name extension + Extension = ".lz4" + // Version is the LZ4 frame format version + Version = 1 + + frameMagic = uint32(0x184D2204) + frameSkipMagic = uint32(0x184D2A50) + + // The following constants are used to setup the compression algorithm. + minMatch = 4 // the minimum size of the match sequence size (4 bytes) + winSizeLog = 16 // LZ4 64Kb window size limit + winSize = 1 << winSizeLog + winMask = winSize - 1 // 64Kb window of previous data for dependent blocks + + // hashLog determines the size of the hash table used to quickly find a previous match position. + // Its value influences the compression speed and memory usage, the lower the faster, + // but at the expense of the compression ratio. + // 16 seems to be the best compromise. + hashLog = 16 + hashTableSize = 1 << hashLog + hashShift = uint((minMatch * 8) - hashLog) + + mfLimit = 8 + minMatch // The last match cannot start within the last 12 bytes. + skipStrength = 6 // variable step for fast scan + + hasher = uint32(2654435761) // prime number used to hash minMatch +) + +// map the block max size id with its value in bytes: 64Kb, 256Kb, 1Mb and 4Mb. +var bsMapID = map[byte]int{4: 64 << 10, 5: 256 << 10, 6: 1 << 20, 7: 4 << 20} +var bsMapValue = map[int]byte{} + +// Reversed. +func init() { + for i, v := range bsMapID { + bsMapValue[v] = i + } +} + +var isLittleEndian = getIsLittleEndian() + +func getIsLittleEndian() (ret bool) { + var i int = 0x1 + bs := (*[1]byte)(unsafe.Pointer(&i)) + if bs[0] == 0 { + return false + } + + return true +} + +// Header describes the various flags that can be set on a Writer or obtained from a Reader. +// The default values match those of the LZ4 frame format definition (http://fastcompression.blogspot.com/2013/04/lz4-streaming-format-final.html). +// +// NB. in a Reader, in case of concatenated frames, the Header values may change between Read() calls. +// It is the caller responsibility to check them if necessary (typically when using the Reader concurrency). +type Header struct { + BlockDependency bool // compressed blocks are dependent (one block depends on the last 64Kb of the previous one) + BlockChecksum bool // compressed blocks are checksumed + NoChecksum bool // frame checksum + BlockMaxSize int // the size of the decompressed data block (one of [64KB, 256KB, 1MB, 4MB]). Default=4MB. + Size uint64 // the frame total size. It is _not_ computed by the Writer. + HighCompression bool // use high compression (only for the Writer) + done bool // whether the descriptor was processed (Read or Write and checked) + // Removed as not supported + // Dict bool // a dictionary id is to be used + // DictID uint32 // the dictionary id read from the frame, if any. +} + +// xxhPool wraps the standard pool for xxHash items. +// Putting items back in the pool automatically resets them. +type xxhPool struct { + sync.Pool +} + +func (p *xxhPool) Get() hash.Hash32 { + return p.Pool.Get().(hash.Hash32) +} + +func (p *xxhPool) Put(h hash.Hash32) { + h.Reset() + p.Pool.Put(h) +} + +// hashPool is used by readers and writers and contains xxHash items. +var hashPool = xxhPool{ + Pool: sync.Pool{ + New: func() interface{} { return xxHash32.New(0) }, + }, +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/lz4c/main.go b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/lz4c/main.go new file mode 100644 index 00000000..048ab500 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/lz4c/main.go @@ -0,0 +1,108 @@ +// Command line utility for the lz4 package. +package main + +import ( + // "bytes" + + "flag" + "fmt" + "io" + "log" + "os" + "path" + "runtime" + "strings" + + "github.com/pierrec/lz4" +) + +func main() { + // Process command line arguments + var ( + blockMaxSizeDefault = 4 << 20 + flagStdout = flag.Bool("c", false, "output to stdout") + flagDecompress = flag.Bool("d", false, "decompress flag") + flagBlockMaxSize = flag.Int("B", blockMaxSizeDefault, "block max size [64Kb,256Kb,1Mb,4Mb]") + flagBlockDependency = flag.Bool("BD", false, "enable block dependency") + flagBlockChecksum = flag.Bool("BX", false, "enable block checksum") + flagStreamChecksum = flag.Bool("Sx", false, "disable stream checksum") + flagHighCompression = flag.Bool("9", false, "enabled high compression") + ) + flag.Usage = func() { + fmt.Fprintf(os.Stderr, "Usage:\n\t%s [arg] [input]...\n\tNo input means [de]compress stdin to stdout\n\n", os.Args[0]) + flag.PrintDefaults() + } + flag.Parse() + + // Use all CPUs + runtime.GOMAXPROCS(runtime.NumCPU()) + + zr := lz4.NewReader(nil) + zw := lz4.NewWriter(nil) + zh := lz4.Header{ + BlockDependency: *flagBlockDependency, + BlockChecksum: *flagBlockChecksum, + BlockMaxSize: *flagBlockMaxSize, + NoChecksum: *flagStreamChecksum, + HighCompression: *flagHighCompression, + } + + worker := func(in io.Reader, out io.Writer) { + if *flagDecompress { + zr.Reset(in) + if _, err := io.Copy(out, zr); err != nil { + log.Fatalf("Error while decompressing input: %v", err) + } + } else { + zw.Reset(out) + zw.Header = zh + if _, err := io.Copy(zw, in); err != nil { + log.Fatalf("Error while compressing input: %v", err) + } + if err := zw.Close(); err != nil { + log.Fatalf("Error while closing stream: %v", err) + } + } + } + + // No input means [de]compress stdin to stdout + if len(flag.Args()) == 0 { + worker(os.Stdin, os.Stdout) + os.Exit(0) + } + + // Compress or decompress all input files + for _, inputFileName := range flag.Args() { + outputFileName := path.Clean(inputFileName) + + if !*flagStdout { + if *flagDecompress { + outputFileName = strings.TrimSuffix(outputFileName, lz4.Extension) + if outputFileName == inputFileName { + log.Fatalf("Invalid output file name: same as input: %s", inputFileName) + } + } else { + outputFileName += lz4.Extension + } + } + + inputFile, err := os.Open(inputFileName) + if err != nil { + log.Fatalf("Error while opening input: %v", err) + } + + outputFile := os.Stdout + if !*flagStdout { + outputFile, err = os.Create(outputFileName) + if err != nil { + log.Fatalf("Error while opening output: %v", err) + } + } + worker(inputFile, outputFile) + + inputFile.Close() + if !*flagStdout { + outputFile.Close() + } + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/reader.go b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/reader.go new file mode 100644 index 00000000..9f7fd604 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/reader.go @@ -0,0 +1,364 @@ +package lz4 + +import ( + "encoding/binary" + "errors" + "fmt" + "hash" + "io" + "io/ioutil" + "runtime" + "sync" + "sync/atomic" +) + +// ErrInvalid is returned when the data being read is not an LZ4 archive +// (LZ4 magic number detection failed). +var ErrInvalid = errors.New("invalid lz4 data") + +// errEndOfBlock is returned by readBlock when it has reached the last block of the frame. +// It is not an error. +var errEndOfBlock = errors.New("end of block") + +// Reader implements the LZ4 frame decoder. +// The Header is set after the first call to Read(). +// The Header may change between Read() calls in case of concatenated frames. +type Reader struct { + Pos int64 // position within the source + Header + src io.Reader + checksum hash.Hash32 // frame hash + wg sync.WaitGroup // decompressing go routine wait group + data []byte // buffered decompressed data + window []byte // 64Kb decompressed data window +} + +// NewReader returns a new LZ4 frame decoder. +// No access to the underlying io.Reader is performed. +func NewReader(src io.Reader) *Reader { + return &Reader{ + src: src, + checksum: hashPool.Get(), + } +} + +// readHeader checks the frame magic number and parses the frame descriptoz. +// Skippable frames are supported even as a first frame although the LZ4 +// specifications recommends skippable frames not to be used as first frames. +func (z *Reader) readHeader(first bool) error { + defer z.checksum.Reset() + + for { + var magic uint32 + if err := binary.Read(z.src, binary.LittleEndian, &magic); err != nil { + if !first && err == io.ErrUnexpectedEOF { + return io.EOF + } + return err + } + z.Pos += 4 + if magic>>8 == frameSkipMagic>>8 { + var skipSize uint32 + if err := binary.Read(z.src, binary.LittleEndian, &skipSize); err != nil { + return err + } + z.Pos += 4 + m, err := io.CopyN(ioutil.Discard, z.src, int64(skipSize)) + z.Pos += m + if err != nil { + return err + } + continue + } + if magic != frameMagic { + return ErrInvalid + } + break + } + + // header + var buf [8]byte + if _, err := io.ReadFull(z.src, buf[:2]); err != nil { + return err + } + z.Pos += 2 + + b := buf[0] + if b>>6 != Version { + return fmt.Errorf("lz4.Read: invalid version: got %d expected %d", b>>6, Version) + } + z.BlockDependency = b>>5&1 == 0 + z.BlockChecksum = b>>4&1 > 0 + frameSize := b>>3&1 > 0 + z.NoChecksum = b>>2&1 == 0 + // z.Dict = b&1 > 0 + + bmsID := buf[1] >> 4 & 0x7 + bSize, ok := bsMapID[bmsID] + if !ok { + return fmt.Errorf("lz4.Read: invalid block max size: %d", bmsID) + } + z.BlockMaxSize = bSize + + z.checksum.Write(buf[0:2]) + + if frameSize { + if err := binary.Read(z.src, binary.LittleEndian, &z.Size); err != nil { + return err + } + z.Pos += 8 + binary.LittleEndian.PutUint64(buf[:], z.Size) + z.checksum.Write(buf[0:8]) + } + + // if z.Dict { + // if err := binary.Read(z.src, binary.LittleEndian, &z.DictID); err != nil { + // return err + // } + // z.Pos += 4 + // binary.LittleEndian.PutUint32(buf[:], z.DictID) + // z.checksum.Write(buf[0:4]) + // } + + // header checksum + if _, err := io.ReadFull(z.src, buf[:1]); err != nil { + return err + } + z.Pos++ + if h := byte(z.checksum.Sum32() >> 8 & 0xFF); h != buf[0] { + return fmt.Errorf("lz4.Read: invalid header checksum: got %v expected %v", buf[0], h) + } + + z.Header.done = true + + return nil +} + +// Read decompresses data from the underlying source into the supplied buffer. +// +// Since there can be multiple streams concatenated, Header values may +// change between calls to Read(). If that is the case, no data is actually read from +// the underlying io.Reader, to allow for potential input buffer resizing. +// +// Data is buffered if the input buffer is too small, and exhausted upon successive calls. +// +// If the buffer is large enough (typically in multiples of BlockMaxSize) and there is +// no block dependency, then the data will be decompressed concurrently based on the GOMAXPROCS value. +func (z *Reader) Read(buf []byte) (n int, err error) { + if !z.Header.done { + if err = z.readHeader(true); err != nil { + return + } + } + + if len(buf) == 0 { + return + } + + // exhaust remaining data from previous Read() + if len(z.data) > 0 { + n = copy(buf, z.data) + z.data = z.data[n:] + if len(z.data) == 0 { + z.data = nil + } + return + } + + // Break up the input buffer into BlockMaxSize blocks with at least one block. + // Then decompress into each of them concurrently if possible (no dependency). + // In case of dependency, the first block will be missing the window (except on the + // very first call), the rest will have it already since it comes from the previous block. + wbuf := buf + zn := (len(wbuf) + z.BlockMaxSize - 1) / z.BlockMaxSize + zblocks := make([]block, zn) + for zi, abort := 0, uint32(0); zi < zn && atomic.LoadUint32(&abort) == 0; zi++ { + zb := &zblocks[zi] + // last block may be too small + if len(wbuf) < z.BlockMaxSize+len(z.window) { + wbuf = make([]byte, z.BlockMaxSize+len(z.window)) + } + copy(wbuf, z.window) + if zb.err = z.readBlock(wbuf, zb); zb.err != nil { + break + } + wbuf = wbuf[z.BlockMaxSize:] + if !z.BlockDependency { + z.wg.Add(1) + go z.decompressBlock(zb, &abort) + continue + } + // cannot decompress concurrently when dealing with block dependency + z.decompressBlock(zb, nil) + // the last block may not contain enough data + if len(z.window) == 0 { + z.window = make([]byte, winSize) + } + if len(zb.data) >= winSize { + copy(z.window, zb.data[len(zb.data)-winSize:]) + } else { + copy(z.window, z.window[len(zb.data):]) + copy(z.window[len(zb.data)+1:], zb.data) + } + } + z.wg.Wait() + + // since a block size may be less then BlockMaxSize, trim the decompressed buffers + for _, zb := range zblocks { + if zb.err != nil { + if zb.err == errEndOfBlock { + return n, z.close() + } + return n, zb.err + } + bLen := len(zb.data) + if !z.NoChecksum { + z.checksum.Write(zb.data) + } + m := copy(buf[n:], zb.data) + // buffer the remaining data (this is necessarily the last block) + if m < bLen { + z.data = zb.data[m:] + } + n += m + } + + return +} + +// readBlock reads an entire frame block from the frame. +// The input buffer is the one that will receive the decompressed data. +// If the end of the frame is detected, it returns the errEndOfBlock error. +func (z *Reader) readBlock(buf []byte, b *block) error { + var bLen uint32 + if err := binary.Read(z.src, binary.LittleEndian, &bLen); err != nil { + return err + } + atomic.AddInt64(&z.Pos, 4) + + switch { + case bLen == 0: + return errEndOfBlock + case bLen&(1<<31) == 0: + b.compressed = true + b.data = buf + b.zdata = make([]byte, bLen) + default: + bLen = bLen & (1<<31 - 1) + if int(bLen) > len(buf) { + return fmt.Errorf("lz4.Read: invalid block size: %d", bLen) + } + b.data = buf[:bLen] + b.zdata = buf[:bLen] + } + if _, err := io.ReadFull(z.src, b.zdata); err != nil { + return err + } + + if z.BlockChecksum { + if err := binary.Read(z.src, binary.LittleEndian, &b.checksum); err != nil { + return err + } + xxh := hashPool.Get() + defer hashPool.Put(xxh) + xxh.Write(b.zdata) + if h := xxh.Sum32(); h != b.checksum { + return fmt.Errorf("lz4.Read: invalid block checksum: got %x expected %x", h, b.checksum) + } + } + + return nil +} + +// decompressBlock decompresses a frame block. +// In case of an error, the block err is set with it and abort is set to 1. +func (z *Reader) decompressBlock(b *block, abort *uint32) { + if abort != nil { + defer z.wg.Done() + } + if b.compressed { + n := len(z.window) + m, err := UncompressBlock(b.zdata, b.data, n) + if err != nil { + if abort != nil { + atomic.StoreUint32(abort, 1) + } + b.err = err + return + } + b.data = b.data[n : n+m] + } + atomic.AddInt64(&z.Pos, int64(len(b.data))) +} + +// close validates the frame checksum (if any) and checks the next frame (if any). +func (z *Reader) close() error { + if !z.NoChecksum { + var checksum uint32 + if err := binary.Read(z.src, binary.LittleEndian, &checksum); err != nil { + return err + } + if checksum != z.checksum.Sum32() { + return fmt.Errorf("lz4.Read: invalid frame checksum: got %x expected %x", z.checksum.Sum32(), checksum) + } + } + + // get ready for the next concatenated frame, but do not change the position + pos := z.Pos + z.Reset(z.src) + z.Pos = pos + + // since multiple frames can be concatenated, check for another one + return z.readHeader(false) +} + +// Reset discards the Reader's state and makes it equivalent to the +// result of its original state from NewReader, but reading from r instead. +// This permits reusing a Reader rather than allocating a new one. +func (z *Reader) Reset(r io.Reader) { + z.Header = Header{} + z.Pos = 0 + z.src = r + z.checksum.Reset() + z.data = nil + z.window = nil +} + +// WriteTo decompresses the data from the underlying io.Reader and writes it to the io.Writer. +// Returns the number of bytes written. +func (z *Reader) WriteTo(w io.Writer) (n int64, err error) { + cpus := runtime.GOMAXPROCS(0) + var buf []byte + + // The initial buffer being nil, the first Read will be only read the compressed frame options. + // The buffer can then be sized appropriately to support maximum concurrency decompression. + // If multiple frames are concatenated, Read() will return with no data decompressed but with + // potentially changed options. The buffer will be resized accordingly, always trying to + // maximize concurrency. + for { + nsize := 0 + // the block max size can change if multiple streams are concatenated. + // Check it after every Read(). + if z.BlockDependency { + // in case of dependency, we cannot decompress concurrently, + // so allocate the minimum buffer + window size + nsize = len(z.window) + z.BlockMaxSize + } else { + // if no dependency, allocate a buffer large enough for concurrent decompression + nsize = cpus * z.BlockMaxSize + } + if nsize != len(buf) { + buf = make([]byte, nsize) + } + + m, er := z.Read(buf) + if er != nil && er != io.EOF { + return n, er + } + m, err = w.Write(buf[:m]) + n += int64(m) + if err != nil || er == io.EOF { + return + } + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/writer.go b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/writer.go new file mode 100644 index 00000000..11082f5a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/lz4/writer.go @@ -0,0 +1,383 @@ +package lz4 + +import ( + "encoding/binary" + "fmt" + "hash" + "io" + "runtime" +) + +// Writer implements the LZ4 frame encoder. +type Writer struct { + Header + dst io.Writer + checksum hash.Hash32 // frame checksum + data []byte // data to be compressed, only used when dealing with block dependency as we need 64Kb to work with + window []byte // last 64KB of decompressed data (block dependency) + blockMaxSize buffer + + zbCompressBuf []byte // buffer for compressing lz4 blocks + writeSizeBuf []byte // four-byte slice for writing checksums and sizes in writeblock + hashTable []hashEntry + currentGeneration uint +} + +// NewWriter returns a new LZ4 frame encoder. +// No access to the underlying io.Writer is performed. +// The supplied Header is checked at the first Write. +// It is ok to change it before the first Write but then not until a Reset() is performed. +func NewWriter(dst io.Writer) *Writer { + return &Writer{ + dst: dst, + checksum: hashPool.Get(), + Header: Header{ + BlockMaxSize: 4 << 20, + }, + hashTable: make([]hashEntry, hashTableSize), + writeSizeBuf: make([]byte, 4), + } +} + +// writeHeader builds and writes the header (magic+header) to the underlying io.Writer. +func (z *Writer) writeHeader() error { + // Default to 4Mb if BlockMaxSize is not set + if z.Header.BlockMaxSize == 0 { + z.Header.BlockMaxSize = 4 << 20 + } + // the only option that need to be validated + bSize, ok := bsMapValue[z.Header.BlockMaxSize] + if !ok { + return fmt.Errorf("lz4: invalid block max size: %d", z.Header.BlockMaxSize) + } + + // magic number(4) + header(flags(2)+[Size(8)+DictID(4)]+checksum(1)) does not exceed 19 bytes + // Size and DictID are optional + var buf [19]byte + + // set the fixed size data: magic number, block max size and flags + binary.LittleEndian.PutUint32(buf[0:], frameMagic) + flg := byte(Version << 6) + if !z.Header.BlockDependency { + flg |= 1 << 5 + } + if z.Header.BlockChecksum { + flg |= 1 << 4 + } + if z.Header.Size > 0 { + flg |= 1 << 3 + } + if !z.Header.NoChecksum { + flg |= 1 << 2 + } + // if z.Header.Dict { + // flg |= 1 + // } + buf[4] = flg + buf[5] = bSize << 4 + + // current buffer size: magic(4) + flags(1) + block max size (1) + n := 6 + // optional items + if z.Header.Size > 0 { + binary.LittleEndian.PutUint64(buf[n:], z.Header.Size) + n += 8 + } + // if z.Header.Dict { + // binary.LittleEndian.PutUint32(buf[n:], z.Header.DictID) + // n += 4 + // } + + // header checksum includes the flags, block max size and optional Size and DictID + z.checksum.Write(buf[4:n]) + buf[n] = byte(z.checksum.Sum32() >> 8 & 0xFF) + z.checksum.Reset() + + // header ready, write it out + if _, err := z.dst.Write(buf[0 : n+1]); err != nil { + return err + } + z.Header.done = true + + // initialize buffers dependent on header info + z.zbCompressBuf = make([]byte, winSize+z.BlockMaxSize) + + return nil +} + +// Write compresses data from the supplied buffer into the underlying io.Writer. +// Write does not return until the data has been written. +// +// If the input buffer is large enough (typically in multiples of BlockMaxSize) +// the data will be compressed concurrently. +// +// Write never buffers any data unless in BlockDependency mode where it may +// do so until it has 64Kb of data, after which it never buffers any. +func (z *Writer) Write(buf []byte) (n int, err error) { + if !z.Header.done { + if err = z.writeHeader(); err != nil { + return + } + } + + if len(buf) == 0 { + return + } + + if !z.NoChecksum { + z.checksum.Write(buf) + } + + // with block dependency, require at least 64Kb of data to work with + // not having 64Kb only matters initially to setup the first window + bl := 0 + if z.BlockDependency && len(z.window) == 0 { + bl = len(z.data) + z.data = append(z.data, buf...) + if len(z.data) < winSize { + return len(buf), nil + } + buf = z.data + z.data = nil + } + + // Break up the input buffer into BlockMaxSize blocks, provisioning the left over block. + // Then compress into each of them concurrently if possible (no dependency). + var ( + zb block + wbuf = buf + zn = len(wbuf) / z.BlockMaxSize + zi = 0 + leftover = len(buf) % z.BlockMaxSize + ) + +loop: + for zi < zn { + if z.BlockDependency { + if zi == 0 { + // first block does not have the window + zb.data = append(z.window, wbuf[:z.BlockMaxSize]...) + zb.offset = len(z.window) + wbuf = wbuf[z.BlockMaxSize-winSize:] + } else { + // set the uncompressed data including the window from previous block + zb.data = wbuf[:z.BlockMaxSize+winSize] + zb.offset = winSize + wbuf = wbuf[z.BlockMaxSize:] + } + } else { + zb.data = wbuf[:z.BlockMaxSize] + wbuf = wbuf[z.BlockMaxSize:] + } + + goto write + } + + // left over + if leftover > 0 { + zb = block{data: wbuf} + if z.BlockDependency { + if zn == 0 { + zb.data = append(z.window, zb.data...) + zb.offset = len(z.window) + } else { + zb.offset = winSize + } + } + + leftover = 0 + goto write + } + + if z.BlockDependency { + if len(z.window) == 0 { + z.window = make([]byte, winSize) + } + // last buffer may be shorter than the window + if len(buf) >= winSize { + copy(z.window, buf[len(buf)-winSize:]) + } else { + copy(z.window, z.window[len(buf):]) + copy(z.window[len(buf)+1:], buf) + } + } + + return + +write: + zb = z.compressBlock(zb) + _, err = z.writeBlock(zb) + + written := len(zb.data) + if bl > 0 { + if written >= bl { + written -= bl + bl = 0 + } else { + bl -= written + written = 0 + } + } + + n += written + // remove the window in zb.data + if z.BlockDependency { + if zi == 0 { + n -= len(z.window) + } else { + n -= winSize + } + } + if err != nil { + return + } + zi++ + goto loop +} + +// compressBlock compresses a block. +func (z *Writer) compressBlock(zb block) block { + // compressed block size cannot exceed the input's + var ( + n int + err error + zbuf = z.zbCompressBuf + ) + if z.HighCompression { + n, err = CompressBlockHC(zb.data, zbuf, zb.offset) + } else { + n, err = compressGenerationalBlock(zb.data, zbuf, zb.offset, z.currentGeneration, z.hashTable) + z.currentGeneration++ + if z.currentGeneration == 0 { // wrapped around, reset table + z.hashTable = make([]hashEntry, hashTableSize) + } + } + + // compressible and compressed size smaller than decompressed: ok! + if err == nil && n > 0 && len(zb.zdata) < len(zb.data) { + zb.compressed = true + zb.zdata = zbuf[:n] + } else { + zb.zdata = zb.data[zb.offset:] + } + + if z.BlockChecksum { + xxh := hashPool.Get() + xxh.Write(zb.zdata) + zb.checksum = xxh.Sum32() + hashPool.Put(xxh) + } + + return zb +} + +// writeBlock writes a frame block to the underlying io.Writer (size, data). +func (z *Writer) writeBlock(zb block) (int, error) { + bLen := uint32(len(zb.zdata)) + if !zb.compressed { + bLen |= 1 << 31 + } + + n := 0 + + binary.LittleEndian.PutUint32(z.writeSizeBuf, bLen) + n, err := z.dst.Write(z.writeSizeBuf) + if err != nil { + return n, err + } + + m, err := z.dst.Write(zb.zdata) + n += m + if err != nil { + return n, err + } + + if z.BlockChecksum { + binary.LittleEndian.PutUint32(z.writeSizeBuf, zb.checksum) + m, err := z.dst.Write(z.writeSizeBuf) + n += m + + if err != nil { + return n, err + } + } + + return n, nil +} + +// Flush flushes any pending compressed data to the underlying writer. +// Flush does not return until the data has been written. +// If the underlying writer returns an error, Flush returns that error. +// +// Flush is only required when in BlockDependency mode and the total of +// data written is less than 64Kb. +func (z *Writer) Flush() error { + if len(z.data) == 0 { + return nil + } + + zb := z.compressBlock(block{data: z.data}) + if _, err := z.writeBlock(zb); err != nil { + return err + } + return nil +} + +// Close closes the Writer, flushing any unwritten data to the underlying io.Writer, but does not close the underlying io.Writer. +func (z *Writer) Close() error { + if !z.Header.done { + if err := z.writeHeader(); err != nil { + return err + } + } + + // buffered data for the block dependency window + if z.BlockDependency && len(z.data) > 0 { + zb := block{data: z.data} + if _, err := z.writeBlock(z.compressBlock(zb)); err != nil { + return err + } + } + + if err := binary.Write(z.dst, binary.LittleEndian, uint32(0)); err != nil { + return err + } + if !z.NoChecksum { + if err := binary.Write(z.dst, binary.LittleEndian, z.checksum.Sum32()); err != nil { + return err + } + } + return nil +} + +// Reset clears the state of the Writer z such that it is equivalent to its +// initial state from NewWriter, but instead writing to w. +// No access to the underlying io.Writer is performed. +func (z *Writer) Reset(w io.Writer) { + z.Header = Header{} + z.dst = w + z.checksum.Reset() + z.data = nil + z.window = nil +} + +// ReadFrom compresses the data read from the io.Reader and writes it to the underlying io.Writer. +// Returns the number of bytes read. +// It does not close the Writer. +func (z *Writer) ReadFrom(r io.Reader) (n int64, err error) { + cpus := runtime.GOMAXPROCS(0) + buf := make([]byte, cpus*z.BlockMaxSize) + for { + m, er := io.ReadFull(r, buf) + n += int64(m) + if er == nil || er == io.ErrUnexpectedEOF || er == io.EOF { + if _, err = z.Write(buf[:m]); err != nil { + return + } + if er == nil { + continue + } + return + } + return n, er + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/LICENSE new file mode 100644 index 00000000..c1418f3f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2014, Pierre Curto +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of xxHash nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/README.md b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/README.md new file mode 100644 index 00000000..aafd2843 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/README.md @@ -0,0 +1,36 @@ +[![godoc](https://godoc.org/github.com/pierrec/xxHash?status.png)](https://godoc.org/github.com/pierrec/xxHash) +[![Build Status](https://travis-ci.org/pierrec/xxHash.svg?branch=master)](https://travis-ci.org/pierrec/xxHash) + +# Pure Go implementation of xxHash (32 and 64 bits versions) + +## Synopsis + +xxHash is a very fast hashing algorithm (see the details [here](https://github.com/Cyan4973/xxHash/)). +This package implements xxHash in pure [Go](http://www.golang.com). + + +## Usage + +This package follows the hash interfaces (hash.Hash32 and hash.Hash64). + +```go + import ( + "fmt" + + "github.com/pierrec/xxHash/xxHash32" + ) + + x := xxHash32.New(0xCAFE) // hash.Hash32 + x.Write([]byte("abc")) + x.Write([]byte("def")) + fmt.Printf("%x\n", x.Sum32()) + + x.Reset() + x.Write([]byte("abc")) + fmt.Printf("%x\n", x.Sum32()) +``` + +## Command line utility + +A simple command line utility is provided to hash files content under the xxhsum directory. + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/xxHash32/xxHash32.go b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/xxHash32/xxHash32.go new file mode 100644 index 00000000..411504e4 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/xxHash32/xxHash32.go @@ -0,0 +1,205 @@ +// Package xxHash32 implements the very fast xxHash hashing algorithm (32 bits version). +// (https://github.com/Cyan4973/xxHash/) +package xxHash32 + +import "hash" + +const ( + prime32_1 = 2654435761 + prime32_2 = 2246822519 + prime32_3 = 3266489917 + prime32_4 = 668265263 + prime32_5 = 374761393 +) + +type xxHash struct { + seed uint32 + v1 uint32 + v2 uint32 + v3 uint32 + v4 uint32 + totalLen uint64 + buf [16]byte + bufused int +} + +// New returns a new Hash32 instance. +func New(seed uint32) hash.Hash32 { + xxh := &xxHash{seed: seed} + xxh.Reset() + return xxh +} + +// Sum appends the current hash to b and returns the resulting slice. +// It does not change the underlying hash state. +func (xxh xxHash) Sum(b []byte) []byte { + h32 := xxh.Sum32() + return append(b, byte(h32), byte(h32>>8), byte(h32>>16), byte(h32>>24)) +} + +// Reset resets the Hash to its initial state. +func (xxh *xxHash) Reset() { + xxh.v1 = xxh.seed + prime32_1 + prime32_2 + xxh.v2 = xxh.seed + prime32_2 + xxh.v3 = xxh.seed + xxh.v4 = xxh.seed - prime32_1 + xxh.totalLen = 0 + xxh.bufused = 0 +} + +// Size returns the number of bytes returned by Sum(). +func (xxh *xxHash) Size() int { + return 4 +} + +// BlockSize gives the minimum number of bytes accepted by Write(). +func (xxh *xxHash) BlockSize() int { + return 1 +} + +// Write adds input bytes to the Hash. +// It never returns an error. +func (xxh *xxHash) Write(input []byte) (int, error) { + n := len(input) + m := xxh.bufused + + xxh.totalLen += uint64(n) + + r := len(xxh.buf) - m + if n < r { + copy(xxh.buf[m:], input) + xxh.bufused += len(input) + return n, nil + } + + p := 0 + if m > 0 { + // some data left from previous update + copy(xxh.buf[xxh.bufused:], input[:r]) + xxh.bufused += len(input) - r + + // fast rotl(13) + p32 := xxh.v1 + (uint32(xxh.buf[p+3])<<24|uint32(xxh.buf[p+2])<<16|uint32(xxh.buf[p+1])<<8|uint32(xxh.buf[p]))*prime32_2 + xxh.v1 = (p32<<13 | p32>>19) * prime32_1 + p += 4 + p32 = xxh.v2 + (uint32(xxh.buf[p+3])<<24|uint32(xxh.buf[p+2])<<16|uint32(xxh.buf[p+1])<<8|uint32(xxh.buf[p]))*prime32_2 + xxh.v2 = (p32<<13 | p32>>19) * prime32_1 + p += 4 + p32 = xxh.v3 + (uint32(xxh.buf[p+3])<<24|uint32(xxh.buf[p+2])<<16|uint32(xxh.buf[p+1])<<8|uint32(xxh.buf[p]))*prime32_2 + xxh.v3 = (p32<<13 | p32>>19) * prime32_1 + p += 4 + p32 = xxh.v4 + (uint32(xxh.buf[p+3])<<24|uint32(xxh.buf[p+2])<<16|uint32(xxh.buf[p+1])<<8|uint32(xxh.buf[p]))*prime32_2 + xxh.v4 = (p32<<13 | p32>>19) * prime32_1 + + p = r + xxh.bufused = 0 + } + + for n := n - 16; p <= n; { + p32 := xxh.v1 + (uint32(input[p+3])<<24|uint32(input[p+2])<<16|uint32(input[p+1])<<8|uint32(input[p]))*prime32_2 + xxh.v1 = (p32<<13 | p32>>19) * prime32_1 + p += 4 + p32 = xxh.v2 + (uint32(input[p+3])<<24|uint32(input[p+2])<<16|uint32(input[p+1])<<8|uint32(input[p]))*prime32_2 + xxh.v2 = (p32<<13 | p32>>19) * prime32_1 + p += 4 + p32 = xxh.v3 + (uint32(input[p+3])<<24|uint32(input[p+2])<<16|uint32(input[p+1])<<8|uint32(input[p]))*prime32_2 + xxh.v3 = (p32<<13 | p32>>19) * prime32_1 + p += 4 + p32 = xxh.v4 + (uint32(input[p+3])<<24|uint32(input[p+2])<<16|uint32(input[p+1])<<8|uint32(input[p]))*prime32_2 + xxh.v4 = (p32<<13 | p32>>19) * prime32_1 + p += 4 + } + + copy(xxh.buf[xxh.bufused:], input[p:]) + xxh.bufused += len(input) - p + + return n, nil +} + +// Sum32 returns the 32 bits Hash value. +func (xxh *xxHash) Sum32() uint32 { + h32 := uint32(xxh.totalLen) + if xxh.totalLen >= 16 { + h32 += ((xxh.v1 << 1) | (xxh.v1 >> 31)) + + ((xxh.v2 << 7) | (xxh.v2 >> 25)) + + ((xxh.v3 << 12) | (xxh.v3 >> 20)) + + ((xxh.v4 << 18) | (xxh.v4 >> 14)) + } else { + h32 += xxh.seed + prime32_5 + } + + p := 0 + n := xxh.bufused + for n := n - 4; p <= n; p += 4 { + h32 += (uint32(xxh.buf[p+3])<<24 | uint32(xxh.buf[p+2])<<16 | uint32(xxh.buf[p+1])<<8 | uint32(xxh.buf[p])) * prime32_3 + h32 = ((h32 << 17) | (h32 >> 15)) * prime32_4 + } + for ; p < n; p++ { + h32 += uint32(xxh.buf[p]) * prime32_5 + h32 = ((h32 << 11) | (h32 >> 21)) * prime32_1 + } + + h32 ^= h32 >> 15 + h32 *= prime32_2 + h32 ^= h32 >> 13 + h32 *= prime32_3 + h32 ^= h32 >> 16 + + return h32 +} + +// Checksum returns the 32bits Hash value. +func Checksum(input []byte, seed uint32) uint32 { + n := len(input) + h32 := uint32(n) + + if n < 16 { + h32 += seed + prime32_5 + } else { + v1 := seed + prime32_1 + prime32_2 + v2 := seed + prime32_2 + v3 := seed + v4 := seed - prime32_1 + p := 0 + for p <= n-16 { + v1 += (uint32(input[p+3])<<24 | uint32(input[p+2])<<16 | uint32(input[p+1])<<8 | uint32(input[p])) * prime32_2 + v1 = (v1<<13 | v1>>19) * prime32_1 + p += 4 + v2 += (uint32(input[p+3])<<24 | uint32(input[p+2])<<16 | uint32(input[p+1])<<8 | uint32(input[p])) * prime32_2 + v2 = (v2<<13 | v2>>19) * prime32_1 + p += 4 + v3 += (uint32(input[p+3])<<24 | uint32(input[p+2])<<16 | uint32(input[p+1])<<8 | uint32(input[p])) * prime32_2 + v3 = (v3<<13 | v3>>19) * prime32_1 + p += 4 + v4 += (uint32(input[p+3])<<24 | uint32(input[p+2])<<16 | uint32(input[p+1])<<8 | uint32(input[p])) * prime32_2 + v4 = (v4<<13 | v4>>19) * prime32_1 + p += 4 + } + input = input[p:] + n -= p + h32 += ((v1 << 1) | (v1 >> 31)) + + ((v2 << 7) | (v2 >> 25)) + + ((v3 << 12) | (v3 >> 20)) + + ((v4 << 18) | (v4 >> 14)) + } + + p := 0 + for p <= n-4 { + h32 += (uint32(input[p+3])<<24 | uint32(input[p+2])<<16 | uint32(input[p+1])<<8 | uint32(input[p])) * prime32_3 + h32 = ((h32 << 17) | (h32 >> 15)) * prime32_4 + p += 4 + } + for p < n { + h32 += uint32(input[p]) * prime32_5 + h32 = ((h32 << 11) | (h32 >> 21)) * prime32_1 + p++ + } + + h32 ^= h32 >> 15 + h32 *= prime32_2 + h32 ^= h32 >> 13 + h32 *= prime32_3 + h32 ^= h32 >> 16 + + return h32 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/xxHash64/xxHash64.go b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/xxHash64/xxHash64.go new file mode 100644 index 00000000..2788e950 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/xxHash64/xxHash64.go @@ -0,0 +1,249 @@ +// Package xxHash64 implements the very fast xxHash hashing algorithm (64 bits version). +// (https://github.com/Cyan4973/xxHash/) +package xxHash64 + +import "hash" + +const ( + prime64_1 = 11400714785074694791 + prime64_2 = 14029467366897019727 + prime64_3 = 1609587929392839161 + prime64_4 = 9650029242287828579 + prime64_5 = 2870177450012600261 +) + +type xxHash struct { + seed uint64 + v1 uint64 + v2 uint64 + v3 uint64 + v4 uint64 + totalLen uint64 + buf [32]byte + bufused int +} + +// New returns a new Hash64 instance. +func New(seed uint64) hash.Hash64 { + xxh := &xxHash{seed: seed} + xxh.Reset() + return xxh +} + +// Sum appends the current hash to b and returns the resulting slice. +// It does not change the underlying hash state. +func (xxh xxHash) Sum(b []byte) []byte { + h64 := xxh.Sum64() + return append(b, byte(h64), byte(h64>>8), byte(h64>>16), byte(h64>>24), byte(h64>>32), byte(h64>>40), byte(h64>>48), byte(h64>>56)) +} + +// Reset resets the Hash to its initial state. +func (xxh *xxHash) Reset() { + xxh.v1 = xxh.seed + prime64_1 + prime64_2 + xxh.v2 = xxh.seed + prime64_2 + xxh.v3 = xxh.seed + xxh.v4 = xxh.seed - prime64_1 + xxh.totalLen = 0 + xxh.bufused = 0 +} + +// Size returns the number of bytes returned by Sum(). +func (xxh *xxHash) Size() int { + return 8 +} + +// BlockSize gives the minimum number of bytes accepted by Write(). +func (xxh *xxHash) BlockSize() int { + return 1 +} + +// Write adds input bytes to the Hash. +// It never returns an error. +func (xxh *xxHash) Write(input []byte) (int, error) { + n := len(input) + m := xxh.bufused + + xxh.totalLen += uint64(n) + + r := len(xxh.buf) - m + if n < r { + copy(xxh.buf[m:], input) + xxh.bufused += len(input) + return n, nil + } + + p := 0 + if m > 0 { + // some data left from previous update + copy(xxh.buf[xxh.bufused:], input[:r]) + xxh.bufused += len(input) - r + + // fast rotl(31) + p64 := xxh.v1 + (uint64(xxh.buf[p+7])<<56|uint64(xxh.buf[p+6])<<48|uint64(xxh.buf[p+5])<<40|uint64(xxh.buf[p+4])<<32|uint64(xxh.buf[p+3])<<24|uint64(xxh.buf[p+2])<<16|uint64(xxh.buf[p+1])<<8|uint64(xxh.buf[p]))*prime64_2 + xxh.v1 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + p64 = xxh.v2 + (uint64(xxh.buf[p+7])<<56|uint64(xxh.buf[p+6])<<48|uint64(xxh.buf[p+5])<<40|uint64(xxh.buf[p+4])<<32|uint64(xxh.buf[p+3])<<24|uint64(xxh.buf[p+2])<<16|uint64(xxh.buf[p+1])<<8|uint64(xxh.buf[p]))*prime64_2 + xxh.v2 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + p64 = xxh.v3 + (uint64(xxh.buf[p+7])<<56|uint64(xxh.buf[p+6])<<48|uint64(xxh.buf[p+5])<<40|uint64(xxh.buf[p+4])<<32|uint64(xxh.buf[p+3])<<24|uint64(xxh.buf[p+2])<<16|uint64(xxh.buf[p+1])<<8|uint64(xxh.buf[p]))*prime64_2 + xxh.v3 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + p64 = xxh.v4 + (uint64(xxh.buf[p+7])<<56|uint64(xxh.buf[p+6])<<48|uint64(xxh.buf[p+5])<<40|uint64(xxh.buf[p+4])<<32|uint64(xxh.buf[p+3])<<24|uint64(xxh.buf[p+2])<<16|uint64(xxh.buf[p+1])<<8|uint64(xxh.buf[p]))*prime64_2 + xxh.v4 = (p64<<31 | p64>>33) * prime64_1 + + p = r + xxh.bufused = 0 + } + + for n := n - 32; p <= n; { + p64 := xxh.v1 + (uint64(input[p+7])<<56|uint64(input[p+6])<<48|uint64(input[p+5])<<40|uint64(input[p+4])<<32|uint64(input[p+3])<<24|uint64(input[p+2])<<16|uint64(input[p+1])<<8|uint64(input[p]))*prime64_2 + xxh.v1 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + p64 = xxh.v2 + (uint64(input[p+7])<<56|uint64(input[p+6])<<48|uint64(input[p+5])<<40|uint64(input[p+4])<<32|uint64(input[p+3])<<24|uint64(input[p+2])<<16|uint64(input[p+1])<<8|uint64(input[p]))*prime64_2 + xxh.v2 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + p64 = xxh.v3 + (uint64(input[p+7])<<56|uint64(input[p+6])<<48|uint64(input[p+5])<<40|uint64(input[p+4])<<32|uint64(input[p+3])<<24|uint64(input[p+2])<<16|uint64(input[p+1])<<8|uint64(input[p]))*prime64_2 + xxh.v3 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + p64 = xxh.v4 + (uint64(input[p+7])<<56|uint64(input[p+6])<<48|uint64(input[p+5])<<40|uint64(input[p+4])<<32|uint64(input[p+3])<<24|uint64(input[p+2])<<16|uint64(input[p+1])<<8|uint64(input[p]))*prime64_2 + xxh.v4 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + } + + copy(xxh.buf[xxh.bufused:], input[p:]) + xxh.bufused += len(input) - p + + return n, nil +} + +// Sum64 returns the 64bits Hash value. +func (xxh *xxHash) Sum64() uint64 { + var h64 uint64 + if xxh.totalLen >= 32 { + h64 = ((xxh.v1 << 1) | (xxh.v1 >> 63)) + + ((xxh.v2 << 7) | (xxh.v2 >> 57)) + + ((xxh.v3 << 12) | (xxh.v3 >> 52)) + + ((xxh.v4 << 18) | (xxh.v4 >> 46)) + + xxh.v1 *= prime64_2 + h64 ^= ((xxh.v1 << 31) | (xxh.v1 >> 33)) * prime64_1 + h64 = h64*prime64_1 + prime64_4 + + xxh.v2 *= prime64_2 + h64 ^= ((xxh.v2 << 31) | (xxh.v2 >> 33)) * prime64_1 + h64 = h64*prime64_1 + prime64_4 + + xxh.v3 *= prime64_2 + h64 ^= ((xxh.v3 << 31) | (xxh.v3 >> 33)) * prime64_1 + h64 = h64*prime64_1 + prime64_4 + + xxh.v4 *= prime64_2 + h64 ^= ((xxh.v4 << 31) | (xxh.v4 >> 33)) * prime64_1 + h64 = h64*prime64_1 + prime64_4 + xxh.totalLen + } else { + h64 = xxh.seed + prime64_5 + xxh.totalLen + } + + p := 0 + n := xxh.bufused + for n := n - 8; p <= n; p += 8 { + p64 := (uint64(xxh.buf[p+7])<<56 | uint64(xxh.buf[p+6])<<48 | uint64(xxh.buf[p+5])<<40 | uint64(xxh.buf[p+4])<<32 | uint64(xxh.buf[p+3])<<24 | uint64(xxh.buf[p+2])<<16 | uint64(xxh.buf[p+1])<<8 | uint64(xxh.buf[p])) * prime64_2 + h64 ^= ((p64 << 31) | (p64 >> 33)) * prime64_1 + h64 = ((h64<<27)|(h64>>37))*prime64_1 + prime64_4 + } + if p+4 <= n { + h64 ^= (uint64(xxh.buf[p+3])<<24 | uint64(xxh.buf[p+2])<<16 | uint64(xxh.buf[p+1])<<8 | uint64(xxh.buf[p])) * prime64_1 + h64 = ((h64<<23)|(h64>>41))*prime64_2 + prime64_3 + p += 4 + } + for ; p < n; p++ { + h64 ^= uint64(xxh.buf[p]) * prime64_5 + h64 = ((h64 << 11) | (h64 >> 53)) * prime64_1 + } + + h64 ^= h64 >> 33 + h64 *= prime64_2 + h64 ^= h64 >> 29 + h64 *= prime64_3 + h64 ^= h64 >> 32 + + return h64 +} + +// Checksum returns the 64bits Hash value. +func Checksum(input []byte, seed uint64) uint64 { + n := len(input) + var h64 uint64 + + if n >= 32 { + v1 := seed + prime64_1 + prime64_2 + v2 := seed + prime64_2 + v3 := seed + v4 := seed - prime64_1 + p := 0 + for n := n - 32; p <= n; { + p64 := v1 + (uint64(input[p+7])<<56|uint64(input[p+6])<<48|uint64(input[p+5])<<40|uint64(input[p+4])<<32|uint64(input[p+3])<<24|uint64(input[p+2])<<16|uint64(input[p+1])<<8|uint64(input[p]))*prime64_2 + v1 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + p64 = v2 + (uint64(input[p+7])<<56|uint64(input[p+6])<<48|uint64(input[p+5])<<40|uint64(input[p+4])<<32|uint64(input[p+3])<<24|uint64(input[p+2])<<16|uint64(input[p+1])<<8|uint64(input[p]))*prime64_2 + v2 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + p64 = v3 + (uint64(input[p+7])<<56|uint64(input[p+6])<<48|uint64(input[p+5])<<40|uint64(input[p+4])<<32|uint64(input[p+3])<<24|uint64(input[p+2])<<16|uint64(input[p+1])<<8|uint64(input[p]))*prime64_2 + v3 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + p64 = v4 + (uint64(input[p+7])<<56|uint64(input[p+6])<<48|uint64(input[p+5])<<40|uint64(input[p+4])<<32|uint64(input[p+3])<<24|uint64(input[p+2])<<16|uint64(input[p+1])<<8|uint64(input[p]))*prime64_2 + v4 = (p64<<31 | p64>>33) * prime64_1 + p += 8 + } + + h64 = ((v1 << 1) | (v1 >> 63)) + + ((v2 << 7) | (v2 >> 57)) + + ((v3 << 12) | (v3 >> 52)) + + ((v4 << 18) | (v4 >> 46)) + + v1 *= prime64_2 + h64 ^= ((v1 << 31) | (v1 >> 33)) * prime64_1 + h64 = h64*prime64_1 + prime64_4 + + v2 *= prime64_2 + h64 ^= ((v2 << 31) | (v2 >> 33)) * prime64_1 + h64 = h64*prime64_1 + prime64_4 + + v3 *= prime64_2 + h64 ^= ((v3 << 31) | (v3 >> 33)) * prime64_1 + h64 = h64*prime64_1 + prime64_4 + + v4 *= prime64_2 + h64 ^= ((v4 << 31) | (v4 >> 33)) * prime64_1 + h64 = h64*prime64_1 + prime64_4 + uint64(n) + + input = input[p:] + n -= p + } else { + h64 = seed + prime64_5 + uint64(n) + } + + p := 0 + for n := n - 8; p <= n; p += 8 { + p64 := (uint64(input[p+7])<<56 | uint64(input[p+6])<<48 | uint64(input[p+5])<<40 | uint64(input[p+4])<<32 | uint64(input[p+3])<<24 | uint64(input[p+2])<<16 | uint64(input[p+1])<<8 | uint64(input[p])) * prime64_2 + h64 ^= ((p64 << 31) | (p64 >> 33)) * prime64_1 + h64 = ((h64<<27)|(h64>>37))*prime64_1 + prime64_4 + } + if p+4 <= n { + h64 ^= (uint64(input[p+3])<<24 | uint64(input[p+2])<<16 | uint64(input[p+1])<<8 | uint64(input[p])) * prime64_1 + h64 = ((h64<<23)|(h64>>41))*prime64_2 + prime64_3 + p += 4 + } + for ; p < n; p++ { + h64 ^= uint64(input[p]) * prime64_5 + h64 = ((h64 << 11) | (h64 >> 53)) * prime64_1 + } + + h64 ^= h64 >> 33 + h64 *= prime64_2 + h64 ^= h64 >> 29 + h64 *= prime64_3 + h64 ^= h64 >> 32 + + return h64 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/xxhsum/main.go b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/xxhsum/main.go new file mode 100644 index 00000000..b73158bd --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrec/xxHash/xxhsum/main.go @@ -0,0 +1,44 @@ +// Command line interface to the xxHash32 and xxHash64 packages. +// Usage: +// xxHash [-mode 0] [-seed 123] filename1 [filename2...] +// where +// mode: hash mode (0=32bits, 1=64bits) (default=1) +// seed: seed to be used (default=0) +package main + +import ( + "flag" + "fmt" + "hash" + "io" + "os" + + "github.com/pierrec/xxHash/xxHash32" + "github.com/pierrec/xxHash/xxHash64" +) + +func main() { + seed := flag.Uint64("seed", 0, "seed value") + mode := flag.Int("mode", 1, "hash mode: 0=32bits, 1=64bits") + flag.Parse() + + var xxh hash.Hash + if *mode == 0 { + xxh = xxHash32.New(uint32(*seed)) + } else { + xxh = xxHash64.New(*seed) + } + + // Process each file in sequence + for _, filename := range flag.Args() { + inputFile, err := os.Open(filename) + if err != nil { + continue + } + if _, err := io.Copy(xxh, inputFile); err == nil { + fmt.Printf("%x %s\n", xxh.Sum(nil), filename) + } + inputFile.Close() + xxh.Reset() + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/LICENSE new file mode 100755 index 00000000..210d800c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/LICENSE @@ -0,0 +1,7 @@ +Copyright (C) 2015 Pierre Durand + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/Makefile b/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/Makefile new file mode 100755 index 00000000..97e3b852 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/Makefile @@ -0,0 +1,19 @@ +#/bin/bash + +setup: + go get -u -v github.com/golang/lint/golint + go get -v -t ./... + +check: + gofmt -d . + go tool vet . + golint + +coverage: + gotestcover -coverprofile=coverage.txt github.com/pierrre/gotestcover + go tool cover -html=coverage.txt -o=coverage.html + +clean: + -rm coverage.txt + -rm coverage.html + gofmt -w . \ No newline at end of file diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/README.md b/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/README.md new file mode 100755 index 00000000..d477f35a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/README.md @@ -0,0 +1,29 @@ +# Go test cover with multiple packages support + +## Deprecated +Just use this script instead: +``` +echo 'mode: atomic' > coverage.txt && go list ./... | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp {} && tail -n +2 coverage.tmp >> coverage.txt' && rm coverage.tmp +``` +It's easier to customize, gives you better control, and doesn't require to download a third-party tool. + +The repository will remain, but I will not update it anymore. +If you want to add new features, create a new fork. + +## Features +- Coverage profile with multiple packages (`go test` doesn't support that) + +## Install +`go get github.com/pierrre/gotestcover` + +## Usage +```sh +gotestcover -coverprofile=cover.out mypackage +go tool cover -html=cover.out -o=cover.html +``` + +Run on multiple package with: +- `package1 package2` +- `package/...` + +Some `go test / build` flags are available. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/gotestcover.go b/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/gotestcover.go new file mode 100755 index 00000000..8a914b90 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pierrre/gotestcover/gotestcover.go @@ -0,0 +1,282 @@ +// Package gotestcover provides multiple packages support for Go test cover. +package main + +import ( + "bufio" + "bytes" + "flag" + "fmt" + "io/ioutil" + "os" + "os/exec" + "runtime" + "strings" + "sync" +) + +var ( + // go build + flagA bool + flagX bool + flagRace bool + flagTags string + + // go test + flagV bool + flagCount int + flagCPU string + flagParallel string + flagRun string + flagShort bool + flagTimeout string + flagCoverMode string + flagCoverProfile string + + // custom + flagParallelPackages = runtime.GOMAXPROCS(0) + + // GAE/Go + flagGoogleAppEngine bool +) + +func main() { + err := run() + if err != nil { + fmt.Println(err) + os.Exit(1) + } +} + +func run() error { + err := parseFlags() + if err != nil { + return err + } + pkgArgs, flagArgs := parseArgs() + pkgs, err := resolvePackages(pkgArgs) + if err != nil { + return err + } + cov, failed := runAllPackageTests(pkgs, flagArgs, func(out string) { + fmt.Print(out) + }) + err = writeCoverProfile(cov) + if err != nil { + return err + } + if failed { + return fmt.Errorf("test failed") + } + return nil +} + +func parseFlags() error { + flag.BoolVar(&flagA, "a", flagA, "see 'go build' help") + flag.BoolVar(&flagX, "x", flagX, "see 'go build' help") + flag.BoolVar(&flagRace, "race", flagRace, "see 'go build' help") + flag.StringVar(&flagTags, "tags", flagTags, "see 'go build' help") + + flag.BoolVar(&flagV, "v", flagV, "see 'go test' help") + flag.IntVar(&flagCount, "count", flagCount, "see 'go test' help") + flag.StringVar(&flagCPU, "cpu", flagCPU, "see 'go test' help") + flag.StringVar(&flagParallel, "parallel", flagParallel, "see 'go test' help") + flag.StringVar(&flagRun, "run", flagRun, "see 'go test' help") + flag.BoolVar(&flagShort, "short", flagShort, "see 'go test' help") + flag.StringVar(&flagTimeout, "timeout", flagTimeout, "see 'go test' help") + flag.StringVar(&flagCoverMode, "covermode", flagCoverMode, "see 'go test' help") + flag.StringVar(&flagCoverProfile, "coverprofile", flagCoverProfile, "see 'go test' help") + + flag.IntVar(&flagParallelPackages, "parallelpackages", flagParallelPackages, "Number of package test run in parallel") + + flag.BoolVar(&flagGoogleAppEngine, "gae", flagGoogleAppEngine, "Bool of Command exec in GAE/Go") + + flag.Parse() + if flagCoverProfile == "" { + return fmt.Errorf("flag coverprofile must be set") + } + if flagParallelPackages < 1 { + return fmt.Errorf("flag parallelpackages must be greater than or equal to 1") + } + return nil +} + +func parseArgs() (pkgArgs, flagArgs []string) { + args := flag.Args() + for i, a := range args { + if strings.HasPrefix(a, "-") { + return args[:i], args[i:] + } + } + return args, nil +} + +func resolvePackages(pkgArgs []string) ([]string, error) { + cmdArgs := []string{"list"} + cmdArgs = append(cmdArgs, pkgArgs...) + cmdOut, err := runGoCommand(cmdArgs...) + if err != nil { + return nil, err + } + var pkgs []string + sc := bufio.NewScanner(bytes.NewReader(cmdOut)) + for sc.Scan() { + pkgs = append(pkgs, sc.Text()) + } + return pkgs, nil +} + +func runAllPackageTests(pkgs []string, flgs []string, pf func(string)) ([]byte, bool) { + pkgch := make(chan string) + type res struct { + out string + cov []byte + err error + } + resch := make(chan res) + wg := new(sync.WaitGroup) + wg.Add(flagParallelPackages) + go func() { + for _, pkg := range pkgs { + pkgch <- pkg + } + close(pkgch) + wg.Wait() + close(resch) + }() + for i := 0; i < flagParallelPackages; i++ { + go func() { + for p := range pkgch { + out, cov, err := runPackageTests(p, flgs) + resch <- res{ + out: out, + cov: cov, + err: err, + } + } + wg.Done() + }() + } + failed := false + var cov []byte + for r := range resch { + if r.err == nil { + pf(r.out) + cov = append(cov, r.cov...) + } else { + pf(r.err.Error()) + failed = true + } + } + return cov, failed +} + +func runPackageTests(pkg string, flgs []string) (out string, cov []byte, err error) { + coverFile, err := ioutil.TempFile("", "gotestcover-") + if err != nil { + return "", nil, err + } + defer os.Remove(coverFile.Name()) + defer coverFile.Close() + var args []string + args = append(args, "test") + + if flagA { + args = append(args, "-a") + } + if flagX { + args = append(args, "-x") + } + if flagRace { + args = append(args, "-race") + } + if flagTags != "" { + args = append(args, "-tags", flagTags) + } + + if flagV { + args = append(args, "-v") + } + if flagCount != 0 { + args = append(args, "-count", fmt.Sprint(flagCount)) + } + if flagCPU != "" { + args = append(args, "-cpu", flagCPU) + } + if flagParallel != "" { + args = append(args, "-parallel", flagParallel) + } + if flagRun != "" { + args = append(args, "-run", flagRun) + } + if flagShort { + args = append(args, "-short") + } + if flagTimeout != "" { + args = append(args, "-timeout", flagTimeout) + } + args = append(args, "-cover") + if flagCoverMode != "" { + args = append(args, "-covermode", flagCoverMode) + } + args = append(args, "-coverprofile", coverFile.Name()) + + args = append(args, pkg) + + args = append(args, flgs...) + + cmdOut, err := runGoCommand(args...) + if err != nil { + return "", nil, err + } + cov, err = ioutil.ReadAll(coverFile) + if err != nil { + return "", nil, err + } + cov = removeFirstLine(cov) + return string(cmdOut), cov, nil +} + +func writeCoverProfile(cov []byte) error { + if len(cov) == 0 { + return nil + } + buf := new(bytes.Buffer) + mode := flagCoverMode + if mode == "" { + if flagRace { + mode = "atomic" + } else { + mode = "set" + } + } + fmt.Fprintf(buf, "mode: %s\n", mode) + buf.Write(cov) + return ioutil.WriteFile(flagCoverProfile, buf.Bytes(), os.FileMode(0644)) +} + +func runGoCommand(args ...string) ([]byte, error) { + goCmd := "go" + if flagGoogleAppEngine { + goCmd = "goapp" + } + cmd := exec.Command(goCmd, args...) + out, err := cmd.CombinedOutput() + if err != nil { + return nil, fmt.Errorf("command %s: %s\n%s", cmd.Args, err, out) + } + return out, nil +} + +func removeFirstLine(b []byte) []byte { + out := new(bytes.Buffer) + sc := bufio.NewScanner(bytes.NewReader(b)) + firstLine := true + for sc.Scan() { + if firstLine { + firstLine = false + continue + } + fmt.Fprintf(out, "%s\n", sc.Bytes()) + } + return out.Bytes() +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/LICENSE new file mode 100644 index 00000000..fafcaafd --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2015, Dave Cheney +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/README.md b/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/README.md new file mode 100644 index 00000000..6ea6422e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/README.md @@ -0,0 +1,50 @@ +# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) + +Package errors provides simple error handling primitives. + +The traditional error handling idiom in Go is roughly akin to +```go +if err != nil { + return err +} +``` +which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. + +## Adding context to an error + +The errors.Wrap function returns a new error that adds context to the original error. For example +```go +_, err := ioutil.ReadAll(r) +if err != nil { + return errors.Wrap(err, "read failed") +} +``` +## Retrieving the cause of an error + +Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. +```go +type causer interface { + Cause() error +} +``` +`errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: +```go +switch err := errors.Cause(err).(type) { +case *MyError: + // handle specifically +default: + // unknown error +} +``` + +[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). + +## Contributing + +We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high. + +Before proposing a change, please discuss your change by raising an issue. + +## Licence + +BSD-2-Clause diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/errors.go new file mode 100644 index 00000000..65bf7a0f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/errors.go @@ -0,0 +1,211 @@ +// Package errors provides simple error handling primitives. +// +// The traditional error handling idiom in Go is roughly akin to +// +// if err != nil { +// return err +// } +// +// which applied recursively up the call stack results in error reports +// without context or debugging information. The errors package allows +// programmers to add context to the failure path in their code in a way +// that does not destroy the original value of the error. +// +// Adding context to an error +// +// The errors.Wrap function returns a new error that adds context to the +// original error. For example +// +// _, err := ioutil.ReadAll(r) +// if err != nil { +// return errors.Wrap(err, "read failed") +// } +// +// Retrieving the cause of an error +// +// Using errors.Wrap constructs a stack of errors, adding context to the +// preceding error. Depending on the nature of the error it may be necessary +// to reverse the operation of errors.Wrap to retrieve the original error +// for inspection. Any error value which implements this interface +// +// type Causer interface { +// Cause() error +// } +// +// can be inspected by errors.Cause. errors.Cause will recursively retrieve +// the topmost error which does not implement causer, which is assumed to be +// the original cause. For example: +// +// switch err := errors.Cause(err).(type) { +// case *MyError: +// // handle specifically +// default: +// // unknown error +// } +// +// Formatted printing of errors +// +// All error values returned from this package implement fmt.Formatter and can +// be formatted by the fmt package. The following verbs are supported +// +// %s print the error. If the error has a Cause it will be +// printed recursively +// %v see %s +// %+v extended format. Each Frame of the error's StackTrace will +// be printed in detail. +// +// Retrieving the stack trace of an error or wrapper +// +// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are +// invoked. This information can be retrieved with the following interface. +// +// type StackTrace interface { +// StackTrace() errors.StackTrace +// } +// +// Where errors.StackTrace is defined as +// +// type StackTrace []Frame +// +// The Frame type represents a call site in the stacktrace. Frame supports +// the fmt.Formatter interface that can be used for printing information about +// the stacktrace of this error. For example: +// +// if err, ok := err.(StackTrace); ok { +// for _, f := range err.StackTrace() { +// fmt.Printf("%+s:%d", f) +// } +// } +// +// See the documentation for Frame.Format for more details. +package errors + +import ( + "fmt" + "io" +) + +// _error is an error implementation returned by New and Errorf +// that implements its own fmt.Formatter. +type _error struct { + msg string + *stack +} + +func (e _error) Error() string { return e.msg } + +func (e _error) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + io.WriteString(s, e.msg) + fmt.Fprintf(s, "%+v", e.StackTrace()) + return + } + fallthrough + case 's': + io.WriteString(s, e.msg) + } +} + +// New returns an error with the supplied message. +func New(message string) error { + return _error{ + message, + callers(), + } +} + +// Errorf formats according to a format specifier and returns the string +// as a value that satisfies error. +func Errorf(format string, args ...interface{}) error { + return _error{ + fmt.Sprintf(format, args...), + callers(), + } +} + +type cause struct { + cause error + msg string +} + +func (c cause) Error() string { return fmt.Sprintf("%s: %v", c.msg, c.Cause()) } +func (c cause) Cause() error { return c.cause } + +// wrapper is an error implementation returned by Wrap and Wrapf +// that implements its own fmt.Formatter. +type wrapper struct { + cause + *stack +} + +func (w wrapper) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + fmt.Fprintf(s, "%+v\n", w.Cause()) + fmt.Fprintf(s, "%+v: %s", w.StackTrace()[0], w.msg) + return + } + fallthrough + case 's': + io.WriteString(s, w.Error()) + } +} + +// Wrap returns an error annotating err with message. +// If err is nil, Wrap returns nil. +func Wrap(err error, message string) error { + if err == nil { + return nil + } + return wrapper{ + cause: cause{ + cause: err, + msg: message, + }, + stack: callers(), + } +} + +// Wrapf returns an error annotating err with the format specifier. +// If err is nil, Wrapf returns nil. +func Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return nil + } + return wrapper{ + cause: cause{ + cause: err, + msg: fmt.Sprintf(format, args...), + }, + stack: callers(), + } +} + +// Cause returns the underlying cause of the error, if possible. +// An error value has a cause if it implements the following +// interface: +// +// type Causer interface { +// Cause() error +// } +// +// If the error does not implement Cause, the original error will +// be returned. If the error is nil, nil will be returned without further +// investigation. +func Cause(err error) error { + type causer interface { + Cause() error + } + + for err != nil { + cause, ok := err.(causer) + if !ok { + break + } + err = cause.Cause() + } + return err +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/stack.go new file mode 100644 index 00000000..243a64a2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pkg/errors/stack.go @@ -0,0 +1,165 @@ +package errors + +import ( + "fmt" + "io" + "path" + "runtime" + "strings" +) + +// Frame represents a program counter inside a stack frame. +type Frame uintptr + +// pc returns the program counter for this frame; +// multiple frames may have the same PC value. +func (f Frame) pc() uintptr { return uintptr(f) - 1 } + +// file returns the full path to the file that contains the +// function for this Frame's pc. +func (f Frame) file() string { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return "unknown" + } + file, _ := fn.FileLine(f.pc()) + return file +} + +// line returns the line number of source code of the +// function for this Frame's pc. +func (f Frame) line() int { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return 0 + } + _, line := fn.FileLine(f.pc()) + return line +} + +// Format formats the frame according to the fmt.Formatter interface. +// +// %s source file +// %d source line +// %n function name +// %v equivalent to %s:%d +// +// Format accepts flags that alter the printing of some verbs, as follows: +// +// %+s path of source file relative to the compile time GOPATH +// %+v equivalent to %+s:%d +func (f Frame) Format(s fmt.State, verb rune) { + switch verb { + case 's': + switch { + case s.Flag('+'): + pc := f.pc() + fn := runtime.FuncForPC(pc) + if fn == nil { + io.WriteString(s, "unknown") + } else { + file, _ := fn.FileLine(pc) + fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file) + } + default: + io.WriteString(s, path.Base(f.file())) + } + case 'd': + fmt.Fprintf(s, "%d", f.line()) + case 'n': + name := runtime.FuncForPC(f.pc()).Name() + io.WriteString(s, funcname(name)) + case 'v': + f.Format(s, 's') + io.WriteString(s, ":") + f.Format(s, 'd') + } +} + +// StackTrace is stack of Frames from innermost (newest) to outermost (oldest). +type StackTrace []Frame + +func (st StackTrace) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + switch { + case s.Flag('+'): + for _, f := range st { + fmt.Fprintf(s, "\n%+v", f) + } + case s.Flag('#'): + fmt.Fprintf(s, "%#v", []Frame(st)) + default: + fmt.Fprintf(s, "%v", []Frame(st)) + } + case 's': + fmt.Fprintf(s, "%s", []Frame(st)) + } +} + +// stack represents a stack of program counters. +type stack []uintptr + +func (s *stack) StackTrace() StackTrace { + f := make([]Frame, len(*s)) + for i := 0; i < len(f); i++ { + f[i] = Frame((*s)[i]) + } + return f +} + +func callers() *stack { + const depth = 32 + var pcs [depth]uintptr + n := runtime.Callers(3, pcs[:]) + var st stack = pcs[0:n] + return &st +} + +// funcname removes the path prefix component of a function's name reported by func.Name(). +func funcname(name string) string { + i := strings.LastIndex(name, "/") + name = name[i+1:] + i = strings.Index(name, ".") + return name[i+1:] +} + +func trimGOPATH(name, file string) string { + // Here we want to get the source file path relative to the compile time + // GOPATH. As of Go 1.6.x there is no direct way to know the compiled + // GOPATH at runtime, but we can infer the number of path segments in the + // GOPATH. We note that fn.Name() returns the function name qualified by + // the import path, which does not include the GOPATH. Thus we can trim + // segments from the beginning of the file path until the number of path + // separators remaining is one more than the number of path separators in + // the function name. For example, given: + // + // GOPATH /home/user + // file /home/user/src/pkg/sub/file.go + // fn.Name() pkg/sub.Type.Method + // + // We want to produce: + // + // pkg/sub/file.go + // + // From this we can easily see that fn.Name() has one less path separator + // than our desired output. We count separators from the end of the file + // path until it finds two more than in the function name and then move + // one character forward to preserve the initial path segment without a + // leading separator. + const sep = "/" + goal := strings.Count(name, sep) + 2 + i := len(file) + for n := 0; n < goal; n++ { + i = strings.LastIndex(file[:i], sep) + if i == -1 { + // not enough separators found, set i so that the slice expression + // below leaves file unmodified + i = -len(sep) + break + } + } + // get back to 0 or trim the leading separator + file = file[i+len(sep):] + return file +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pmezard/go-difflib/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/pmezard/go-difflib/LICENSE new file mode 100644 index 00000000..c67dad61 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pmezard/go-difflib/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013, Patrick Mezard +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + The names of its contributors may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pmezard/go-difflib/README.md b/vendor/github.com/elastic/beats/vendor/github.com/pmezard/go-difflib/README.md new file mode 100644 index 00000000..e87f307e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pmezard/go-difflib/README.md @@ -0,0 +1,50 @@ +go-difflib +========== + +[![Build Status](https://travis-ci.org/pmezard/go-difflib.png?branch=master)](https://travis-ci.org/pmezard/go-difflib) +[![GoDoc](https://godoc.org/github.com/pmezard/go-difflib/difflib?status.svg)](https://godoc.org/github.com/pmezard/go-difflib/difflib) + +Go-difflib is a partial port of python 3 difflib package. Its main goal +was to make unified and context diff available in pure Go, mostly for +testing purposes. + +The following class and functions (and related tests) have be ported: + +* `SequenceMatcher` +* `unified_diff()` +* `context_diff()` + +## Installation + +```bash +$ go get github.com/pmezard/go-difflib/difflib +``` + +### Quick Start + +Diffs are configured with Unified (or ContextDiff) structures, and can +be output to an io.Writer or returned as a string. + +```Go +diff := UnifiedDiff{ + A: difflib.SplitLines("foo\nbar\n"), + B: difflib.SplitLines("foo\nbaz\n"), + FromFile: "Original", + ToFile: "Current", + Context: 3, +} +text, _ := GetUnifiedDiffString(diff) +fmt.Printf(text) +``` + +would output: + +``` +--- Original ++++ Current +@@ -1,3 +1,3 @@ + foo +-bar ++baz +``` + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/pmezard/go-difflib/difflib/difflib.go b/vendor/github.com/elastic/beats/vendor/github.com/pmezard/go-difflib/difflib/difflib.go new file mode 100644 index 00000000..003e99fa --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/pmezard/go-difflib/difflib/difflib.go @@ -0,0 +1,772 @@ +// Package difflib is a partial port of Python difflib module. +// +// It provides tools to compare sequences of strings and generate textual diffs. +// +// The following class and functions have been ported: +// +// - SequenceMatcher +// +// - unified_diff +// +// - context_diff +// +// Getting unified diffs was the main goal of the port. Keep in mind this code +// is mostly suitable to output text differences in a human friendly way, there +// are no guarantees generated diffs are consumable by patch(1). +package difflib + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strings" +) + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func calculateRatio(matches, length int) float64 { + if length > 0 { + return 2.0 * float64(matches) / float64(length) + } + return 1.0 +} + +type Match struct { + A int + B int + Size int +} + +type OpCode struct { + Tag byte + I1 int + I2 int + J1 int + J2 int +} + +// SequenceMatcher compares sequence of strings. The basic +// algorithm predates, and is a little fancier than, an algorithm +// published in the late 1980's by Ratcliff and Obershelp under the +// hyperbolic name "gestalt pattern matching". The basic idea is to find +// the longest contiguous matching subsequence that contains no "junk" +// elements (R-O doesn't address junk). The same idea is then applied +// recursively to the pieces of the sequences to the left and to the right +// of the matching subsequence. This does not yield minimal edit +// sequences, but does tend to yield matches that "look right" to people. +// +// SequenceMatcher tries to compute a "human-friendly diff" between two +// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the +// longest *contiguous* & junk-free matching subsequence. That's what +// catches peoples' eyes. The Windows(tm) windiff has another interesting +// notion, pairing up elements that appear uniquely in each sequence. +// That, and the method here, appear to yield more intuitive difference +// reports than does diff. This method appears to be the least vulnerable +// to synching up on blocks of "junk lines", though (like blank lines in +// ordinary text files, or maybe "

" lines in HTML files). That may be +// because this is the only method of the 3 that has a *concept* of +// "junk" . +// +// Timing: Basic R-O is cubic time worst case and quadratic time expected +// case. SequenceMatcher is quadratic time for the worst case and has +// expected-case behavior dependent in a complicated way on how many +// elements the sequences have in common; best case time is linear. +type SequenceMatcher struct { + a []string + b []string + b2j map[string][]int + IsJunk func(string) bool + autoJunk bool + bJunk map[string]struct{} + matchingBlocks []Match + fullBCount map[string]int + bPopular map[string]struct{} + opCodes []OpCode +} + +func NewMatcher(a, b []string) *SequenceMatcher { + m := SequenceMatcher{autoJunk: true} + m.SetSeqs(a, b) + return &m +} + +func NewMatcherWithJunk(a, b []string, autoJunk bool, + isJunk func(string) bool) *SequenceMatcher { + + m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk} + m.SetSeqs(a, b) + return &m +} + +// Set two sequences to be compared. +func (m *SequenceMatcher) SetSeqs(a, b []string) { + m.SetSeq1(a) + m.SetSeq2(b) +} + +// Set the first sequence to be compared. The second sequence to be compared is +// not changed. +// +// SequenceMatcher computes and caches detailed information about the second +// sequence, so if you want to compare one sequence S against many sequences, +// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other +// sequences. +// +// See also SetSeqs() and SetSeq2(). +func (m *SequenceMatcher) SetSeq1(a []string) { + if &a == &m.a { + return + } + m.a = a + m.matchingBlocks = nil + m.opCodes = nil +} + +// Set the second sequence to be compared. The first sequence to be compared is +// not changed. +func (m *SequenceMatcher) SetSeq2(b []string) { + if &b == &m.b { + return + } + m.b = b + m.matchingBlocks = nil + m.opCodes = nil + m.fullBCount = nil + m.chainB() +} + +func (m *SequenceMatcher) chainB() { + // Populate line -> index mapping + b2j := map[string][]int{} + for i, s := range m.b { + indices := b2j[s] + indices = append(indices, i) + b2j[s] = indices + } + + // Purge junk elements + m.bJunk = map[string]struct{}{} + if m.IsJunk != nil { + junk := m.bJunk + for s, _ := range b2j { + if m.IsJunk(s) { + junk[s] = struct{}{} + } + } + for s, _ := range junk { + delete(b2j, s) + } + } + + // Purge remaining popular elements + popular := map[string]struct{}{} + n := len(m.b) + if m.autoJunk && n >= 200 { + ntest := n/100 + 1 + for s, indices := range b2j { + if len(indices) > ntest { + popular[s] = struct{}{} + } + } + for s, _ := range popular { + delete(b2j, s) + } + } + m.bPopular = popular + m.b2j = b2j +} + +func (m *SequenceMatcher) isBJunk(s string) bool { + _, ok := m.bJunk[s] + return ok +} + +// Find longest matching block in a[alo:ahi] and b[blo:bhi]. +// +// If IsJunk is not defined: +// +// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where +// alo <= i <= i+k <= ahi +// blo <= j <= j+k <= bhi +// and for all (i',j',k') meeting those conditions, +// k >= k' +// i <= i' +// and if i == i', j <= j' +// +// In other words, of all maximal matching blocks, return one that +// starts earliest in a, and of all those maximal matching blocks that +// start earliest in a, return the one that starts earliest in b. +// +// If IsJunk is defined, first the longest matching block is +// determined as above, but with the additional restriction that no +// junk element appears in the block. Then that block is extended as +// far as possible by matching (only) junk elements on both sides. So +// the resulting block never matches on junk except as identical junk +// happens to be adjacent to an "interesting" match. +// +// If no blocks match, return (alo, blo, 0). +func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match { + // CAUTION: stripping common prefix or suffix would be incorrect. + // E.g., + // ab + // acab + // Longest matching block is "ab", but if common prefix is + // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so + // strip, so ends up claiming that ab is changed to acab by + // inserting "ca" in the middle. That's minimal but unintuitive: + // "it's obvious" that someone inserted "ac" at the front. + // Windiff ends up at the same place as diff, but by pairing up + // the unique 'b's and then matching the first two 'a's. + besti, bestj, bestsize := alo, blo, 0 + + // find longest junk-free match + // during an iteration of the loop, j2len[j] = length of longest + // junk-free match ending with a[i-1] and b[j] + j2len := map[int]int{} + for i := alo; i != ahi; i++ { + // look at all instances of a[i] in b; note that because + // b2j has no junk keys, the loop is skipped if a[i] is junk + newj2len := map[int]int{} + for _, j := range m.b2j[m.a[i]] { + // a[i] matches b[j] + if j < blo { + continue + } + if j >= bhi { + break + } + k := j2len[j-1] + 1 + newj2len[j] = k + if k > bestsize { + besti, bestj, bestsize = i-k+1, j-k+1, k + } + } + j2len = newj2len + } + + // Extend the best by non-junk elements on each end. In particular, + // "popular" non-junk elements aren't in b2j, which greatly speeds + // the inner loop above, but also means "the best" match so far + // doesn't contain any junk *or* popular non-junk elements. + for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + !m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + // Now that we have a wholly interesting match (albeit possibly + // empty!), we may as well suck up the matching junk on each + // side of it too. Can't think of a good reason not to, and it + // saves post-processing the (possibly considerable) expense of + // figuring out what to do with it. In the case of an empty + // interesting match, this is clearly the right thing to do, + // because no other kind of match is possible in the regions. + for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + return Match{A: besti, B: bestj, Size: bestsize} +} + +// Return list of triples describing matching subsequences. +// +// Each triple is of the form (i, j, n), and means that +// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in +// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are +// adjacent triples in the list, and the second is not the last triple in the +// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe +// adjacent equal blocks. +// +// The last triple is a dummy, (len(a), len(b), 0), and is the only +// triple with n==0. +func (m *SequenceMatcher) GetMatchingBlocks() []Match { + if m.matchingBlocks != nil { + return m.matchingBlocks + } + + var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match + matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match { + match := m.findLongestMatch(alo, ahi, blo, bhi) + i, j, k := match.A, match.B, match.Size + if match.Size > 0 { + if alo < i && blo < j { + matched = matchBlocks(alo, i, blo, j, matched) + } + matched = append(matched, match) + if i+k < ahi && j+k < bhi { + matched = matchBlocks(i+k, ahi, j+k, bhi, matched) + } + } + return matched + } + matched := matchBlocks(0, len(m.a), 0, len(m.b), nil) + + // It's possible that we have adjacent equal blocks in the + // matching_blocks list now. + nonAdjacent := []Match{} + i1, j1, k1 := 0, 0, 0 + for _, b := range matched { + // Is this block adjacent to i1, j1, k1? + i2, j2, k2 := b.A, b.B, b.Size + if i1+k1 == i2 && j1+k1 == j2 { + // Yes, so collapse them -- this just increases the length of + // the first block by the length of the second, and the first + // block so lengthened remains the block to compare against. + k1 += k2 + } else { + // Not adjacent. Remember the first block (k1==0 means it's + // the dummy we started with), and make the second block the + // new block to compare against. + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + i1, j1, k1 = i2, j2, k2 + } + } + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + + nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0}) + m.matchingBlocks = nonAdjacent + return m.matchingBlocks +} + +// Return list of 5-tuples describing how to turn a into b. +// +// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple +// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the +// tuple preceding it, and likewise for j1 == the previous j2. +// +// The tags are characters, with these meanings: +// +// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2] +// +// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case. +// +// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case. +// +// 'e' (equal): a[i1:i2] == b[j1:j2] +func (m *SequenceMatcher) GetOpCodes() []OpCode { + if m.opCodes != nil { + return m.opCodes + } + i, j := 0, 0 + matching := m.GetMatchingBlocks() + opCodes := make([]OpCode, 0, len(matching)) + for _, m := range matching { + // invariant: we've pumped out correct diffs to change + // a[:i] into b[:j], and the next matching block is + // a[ai:ai+size] == b[bj:bj+size]. So we need to pump + // out a diff to change a[i:ai] into b[j:bj], pump out + // the matching block, and move (i,j) beyond the match + ai, bj, size := m.A, m.B, m.Size + tag := byte(0) + if i < ai && j < bj { + tag = 'r' + } else if i < ai { + tag = 'd' + } else if j < bj { + tag = 'i' + } + if tag > 0 { + opCodes = append(opCodes, OpCode{tag, i, ai, j, bj}) + } + i, j = ai+size, bj+size + // the list of matching blocks is terminated by a + // sentinel with size 0 + if size > 0 { + opCodes = append(opCodes, OpCode{'e', ai, i, bj, j}) + } + } + m.opCodes = opCodes + return m.opCodes +} + +// Isolate change clusters by eliminating ranges with no changes. +// +// Return a generator of groups with up to n lines of context. +// Each group is in the same format as returned by GetOpCodes(). +func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { + if n < 0 { + n = 3 + } + codes := m.GetOpCodes() + if len(codes) == 0 { + codes = []OpCode{OpCode{'e', 0, 1, 0, 1}} + } + // Fixup leading and trailing groups if they show no changes. + if codes[0].Tag == 'e' { + c := codes[0] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2} + } + if codes[len(codes)-1].Tag == 'e' { + c := codes[len(codes)-1] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)} + } + nn := n + n + groups := [][]OpCode{} + group := []OpCode{} + for _, c := range codes { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + // End the current group and start a new one whenever + // there is a large range with no changes. + if c.Tag == 'e' && i2-i1 > nn { + group = append(group, OpCode{c.Tag, i1, min(i2, i1+n), + j1, min(j2, j1+n)}) + groups = append(groups, group) + group = []OpCode{} + i1, j1 = max(i1, i2-n), max(j1, j2-n) + } + group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) + } + if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { + groups = append(groups, group) + } + return groups +} + +// Return a measure of the sequences' similarity (float in [0,1]). +// +// Where T is the total number of elements in both sequences, and +// M is the number of matches, this is 2.0*M / T. +// Note that this is 1 if the sequences are identical, and 0 if +// they have nothing in common. +// +// .Ratio() is expensive to compute if you haven't already computed +// .GetMatchingBlocks() or .GetOpCodes(), in which case you may +// want to try .QuickRatio() or .RealQuickRation() first to get an +// upper bound. +func (m *SequenceMatcher) Ratio() float64 { + matches := 0 + for _, m := range m.GetMatchingBlocks() { + matches += m.Size + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() relatively quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute. +func (m *SequenceMatcher) QuickRatio() float64 { + // viewing a and b as multisets, set matches to the cardinality + // of their intersection; this counts the number of matches + // without regard to order, so is clearly an upper bound + if m.fullBCount == nil { + m.fullBCount = map[string]int{} + for _, s := range m.b { + m.fullBCount[s] = m.fullBCount[s] + 1 + } + } + + // avail[x] is the number of times x appears in 'b' less the + // number of times we've seen it in 'a' so far ... kinda + avail := map[string]int{} + matches := 0 + for _, s := range m.a { + n, ok := avail[s] + if !ok { + n = m.fullBCount[s] + } + avail[s] = n - 1 + if n > 0 { + matches += 1 + } + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() very quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute than either .Ratio() or .QuickRatio(). +func (m *SequenceMatcher) RealQuickRatio() float64 { + la, lb := len(m.a), len(m.b) + return calculateRatio(min(la, lb), la+lb) +} + +// Convert range to the "ed" format +func formatRangeUnified(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 1 { + return fmt.Sprintf("%d", beginning) + } + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + return fmt.Sprintf("%d,%d", beginning, length) +} + +// Unified diff parameters +type UnifiedDiff struct { + A []string // First sequence lines + FromFile string // First file name + FromDate string // First file time + B []string // Second sequence lines + ToFile string // Second file name + ToDate string // Second file time + Eol string // Headers end of line, defaults to LF + Context int // Number of context lines +} + +// Compare two sequences of lines; generate the delta as a unified diff. +// +// Unified diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by 'n' which +// defaults to three. +// +// By default, the diff control lines (those with ---, +++, or @@) are +// created with a trailing newline. This is helpful so that inputs +// created from file.readlines() result in diffs that are suitable for +// file.writelines() since both the inputs and outputs have trailing +// newlines. +// +// For inputs that do not have trailing newlines, set the lineterm +// argument to "" so that the output will be uniformly newline free. +// +// The unidiff format normally has a header for filenames and modification +// times. Any or all of these may be specified using strings for +// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. +// The modification times are normally expressed in the ISO 8601 format. +func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + wf := func(format string, args ...interface{}) error { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + return err + } + ws := func(s string) error { + _, err := buf.WriteString(s) + return err + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + if diff.FromFile != "" || diff.ToFile != "" { + err := wf("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) + if err != nil { + return err + } + err = wf("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) + if err != nil { + return err + } + } + } + first, last := g[0], g[len(g)-1] + range1 := formatRangeUnified(first.I1, last.I2) + range2 := formatRangeUnified(first.J1, last.J2) + if err := wf("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { + return err + } + for _, c := range g { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + if c.Tag == 'e' { + for _, line := range diff.A[i1:i2] { + if err := ws(" " + line); err != nil { + return err + } + } + continue + } + if c.Tag == 'r' || c.Tag == 'd' { + for _, line := range diff.A[i1:i2] { + if err := ws("-" + line); err != nil { + return err + } + } + } + if c.Tag == 'r' || c.Tag == 'i' { + for _, line := range diff.B[j1:j2] { + if err := ws("+" + line); err != nil { + return err + } + } + } + } + } + return nil +} + +// Like WriteUnifiedDiff but returns the diff a string. +func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteUnifiedDiff(w, diff) + return string(w.Bytes()), err +} + +// Convert range to the "ed" format. +func formatRangeContext(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + if length <= 1 { + return fmt.Sprintf("%d", beginning) + } + return fmt.Sprintf("%d,%d", beginning, beginning+length-1) +} + +type ContextDiff UnifiedDiff + +// Compare two sequences of lines; generate the delta as a context diff. +// +// Context diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by diff.Context +// which defaults to three. +// +// By default, the diff control lines (those with *** or ---) are +// created with a trailing newline. +// +// For inputs that do not have trailing newlines, set the diff.Eol +// argument to "" so that the output will be uniformly newline free. +// +// The context diff format normally has a header for filenames and +// modification times. Any or all of these may be specified using +// strings for diff.FromFile, diff.ToFile, diff.FromDate, diff.ToDate. +// The modification times are normally expressed in the ISO 8601 format. +// If not specified, the strings default to blanks. +func WriteContextDiff(writer io.Writer, diff ContextDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + var diffErr error + wf := func(format string, args ...interface{}) { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + if diffErr == nil && err != nil { + diffErr = err + } + } + ws := func(s string) { + _, err := buf.WriteString(s) + if diffErr == nil && err != nil { + diffErr = err + } + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + prefix := map[byte]string{ + 'i': "+ ", + 'd': "- ", + 'r': "! ", + 'e': " ", + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + if diff.FromFile != "" || diff.ToFile != "" { + wf("*** %s%s%s", diff.FromFile, fromDate, diff.Eol) + wf("--- %s%s%s", diff.ToFile, toDate, diff.Eol) + } + } + + first, last := g[0], g[len(g)-1] + ws("***************" + diff.Eol) + + range1 := formatRangeContext(first.I1, last.I2) + wf("*** %s ****%s", range1, diff.Eol) + for _, c := range g { + if c.Tag == 'r' || c.Tag == 'd' { + for _, cc := range g { + if cc.Tag == 'i' { + continue + } + for _, line := range diff.A[cc.I1:cc.I2] { + ws(prefix[cc.Tag] + line) + } + } + break + } + } + + range2 := formatRangeContext(first.J1, last.J2) + wf("--- %s ----%s", range2, diff.Eol) + for _, c := range g { + if c.Tag == 'r' || c.Tag == 'i' { + for _, cc := range g { + if cc.Tag == 'd' { + continue + } + for _, line := range diff.B[cc.J1:cc.J2] { + ws(prefix[cc.Tag] + line) + } + } + break + } + } + } + return diffErr +} + +// Like WriteContextDiff but returns the diff a string. +func GetContextDiffString(diff ContextDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteContextDiff(w, diff) + return string(w.Bytes()), err +} + +// Split a string on "\n" while preserving them. The output can be used +// as input for UnifiedDiff and ContextDiff structures. +func SplitLines(s string) []string { + lines := strings.SplitAfter(s, "\n") + lines[len(lines)-1] += "\n" + return lines +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/LICENSE new file mode 100644 index 00000000..363fa9ee --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/LICENSE @@ -0,0 +1,29 @@ +Copyright 2012 Richard Crowley. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +THIS SOFTWARE IS PROVIDED BY RICHARD CROWLEY ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL RICHARD CROWLEY OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation +are those of the authors and should not be interpreted as representing +official policies, either expressed or implied, of Richard Crowley. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/README.md b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/README.md new file mode 100644 index 00000000..2d1a6dcf --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/README.md @@ -0,0 +1,153 @@ +go-metrics +========== + +![travis build status](https://travis-ci.org/rcrowley/go-metrics.svg?branch=master) + +Go port of Coda Hale's Metrics library: . + +Documentation: . + +Usage +----- + +Create and update metrics: + +```go +c := metrics.NewCounter() +metrics.Register("foo", c) +c.Inc(47) + +g := metrics.NewGauge() +metrics.Register("bar", g) +g.Update(47) + +r := NewRegistry() +g := metrics.NewRegisteredFunctionalGauge("cache-evictions", r, func() int64 { return cache.getEvictionsCount() }) + +s := metrics.NewExpDecaySample(1028, 0.015) // or metrics.NewUniformSample(1028) +h := metrics.NewHistogram(s) +metrics.Register("baz", h) +h.Update(47) + +m := metrics.NewMeter() +metrics.Register("quux", m) +m.Mark(47) + +t := metrics.NewTimer() +metrics.Register("bang", t) +t.Time(func() {}) +t.Update(47) +``` + +Register() is not threadsafe. For threadsafe metric registration use +GetOrRegister: + +``` +t := metrics.GetOrRegisterTimer("account.create.latency", nil) +t.Time(func() {}) +t.Update(47) +``` + +Periodically log every metric in human-readable form to standard error: + +```go +go metrics.Log(metrics.DefaultRegistry, 5 * time.Second, log.New(os.Stderr, "metrics: ", log.Lmicroseconds)) +``` + +Periodically log every metric in slightly-more-parseable form to syslog: + +```go +w, _ := syslog.Dial("unixgram", "/dev/log", syslog.LOG_INFO, "metrics") +go metrics.Syslog(metrics.DefaultRegistry, 60e9, w) +``` + +Periodically emit every metric to Graphite using the [Graphite client](https://github.com/cyberdelia/go-metrics-graphite): + +```go + +import "github.com/cyberdelia/go-metrics-graphite" + +addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:2003") +go graphite.Graphite(metrics.DefaultRegistry, 10e9, "metrics", addr) +``` + +Periodically emit every metric into InfluxDB: + +**NOTE:** this has been pulled out of the library due to constant fluctuations +in the InfluxDB API. In fact, all client libraries are on their way out. see +issues [#121](https://github.com/rcrowley/go-metrics/issues/121) and +[#124](https://github.com/rcrowley/go-metrics/issues/124) for progress and details. + +```go +import "github.com/vrischmann/go-metrics-influxdb" + +go influxdb.Influxdb(metrics.DefaultRegistry, 10e9, &influxdb.Config{ + Host: "127.0.0.1:8086", + Database: "metrics", + Username: "test", + Password: "test", +}) +``` + +Periodically upload every metric to Librato using the [Librato client](https://github.com/mihasya/go-metrics-librato): + +**Note**: the client included with this repository under the `librato` package +has been deprecated and moved to the repository linked above. + +```go +import "github.com/mihasya/go-metrics-librato" + +go librato.Librato(metrics.DefaultRegistry, + 10e9, // interval + "example@example.com", // account owner email address + "token", // Librato API token + "hostname", // source + []float64{0.95}, // percentiles to send + time.Millisecond, // time unit +) +``` + +Periodically emit every metric to StatHat: + +```go +import "github.com/rcrowley/go-metrics/stathat" + +go stathat.Stathat(metrics.DefaultRegistry, 10e9, "example@example.com") +``` + +Maintain all metrics along with expvars at `/debug/metrics`: + +This uses the same mechanism as [the official expvar](http://golang.org/pkg/expvar/) +but exposed under `/debug/metrics`, which shows a json representation of all your usual expvars +as well as all your go-metrics. + + +```go +import "github.com/rcrowley/go-metrics/exp" + +exp.Exp(metrics.DefaultRegistry) +``` + +Installation +------------ + +```sh +go get github.com/rcrowley/go-metrics +``` + +StatHat support additionally requires their Go client: + +```sh +go get github.com/stathat/go +``` + +Publishing Metrics +------------------ + +Clients are available for the following destinations: + +* Librato - [https://github.com/mihasya/go-metrics-librato](https://github.com/mihasya/go-metrics-librato) +* Graphite - [https://github.com/cyberdelia/go-metrics-graphite](https://github.com/cyberdelia/go-metrics-graphite) +* InfluxDB - [https://github.com/vrischmann/go-metrics-influxdb](https://github.com/vrischmann/go-metrics-influxdb) +* Ganglia - [https://github.com/appscode/metlia](https://github.com/appscode/metlia) +* Prometheus - [https://github.com/deathowl/go-metrics-prometheus](https://github.com/deathowl/go-metrics-prometheus) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/cmd/metrics-bench/metrics-bench.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/cmd/metrics-bench/metrics-bench.go new file mode 100644 index 00000000..dddaf4b1 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/cmd/metrics-bench/metrics-bench.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/rcrowley/go-metrics" + "time" +) + +func main() { + r := metrics.NewRegistry() + for i := 0; i < 10000; i++ { + r.Register(fmt.Sprintf("counter-%d", i), metrics.NewCounter()) + r.Register(fmt.Sprintf("gauge-%d", i), metrics.NewGauge()) + r.Register(fmt.Sprintf("gaugefloat64-%d", i), metrics.NewGaugeFloat64()) + r.Register(fmt.Sprintf("histogram-uniform-%d", i), metrics.NewHistogram(metrics.NewUniformSample(1028))) + r.Register(fmt.Sprintf("histogram-exp-%d", i), metrics.NewHistogram(metrics.NewExpDecaySample(1028, 0.015))) + r.Register(fmt.Sprintf("meter-%d", i), metrics.NewMeter()) + } + time.Sleep(600e9) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/cmd/metrics-example/metrics-example.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/cmd/metrics-example/metrics-example.go new file mode 100644 index 00000000..66f42c04 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/cmd/metrics-example/metrics-example.go @@ -0,0 +1,154 @@ +package main + +import ( + "errors" + "github.com/rcrowley/go-metrics" + // "github.com/rcrowley/go-metrics/stathat" + "log" + "math/rand" + "os" + // "syslog" + "time" +) + +const fanout = 10 + +func main() { + + r := metrics.NewRegistry() + + c := metrics.NewCounter() + r.Register("foo", c) + for i := 0; i < fanout; i++ { + go func() { + for { + c.Dec(19) + time.Sleep(300e6) + } + }() + go func() { + for { + c.Inc(47) + time.Sleep(400e6) + } + }() + } + + g := metrics.NewGauge() + r.Register("bar", g) + for i := 0; i < fanout; i++ { + go func() { + for { + g.Update(19) + time.Sleep(300e6) + } + }() + go func() { + for { + g.Update(47) + time.Sleep(400e6) + } + }() + } + + gf := metrics.NewGaugeFloat64() + r.Register("barfloat64", gf) + for i := 0; i < fanout; i++ { + go func() { + for { + g.Update(19.0) + time.Sleep(300e6) + } + }() + go func() { + for { + g.Update(47.0) + time.Sleep(400e6) + } + }() + } + + hc := metrics.NewHealthcheck(func(h metrics.Healthcheck) { + if 0 < rand.Intn(2) { + h.Healthy() + } else { + h.Unhealthy(errors.New("baz")) + } + }) + r.Register("baz", hc) + + s := metrics.NewExpDecaySample(1028, 0.015) + //s := metrics.NewUniformSample(1028) + h := metrics.NewHistogram(s) + r.Register("bang", h) + for i := 0; i < fanout; i++ { + go func() { + for { + h.Update(19) + time.Sleep(300e6) + } + }() + go func() { + for { + h.Update(47) + time.Sleep(400e6) + } + }() + } + + m := metrics.NewMeter() + r.Register("quux", m) + for i := 0; i < fanout; i++ { + go func() { + for { + m.Mark(19) + time.Sleep(300e6) + } + }() + go func() { + for { + m.Mark(47) + time.Sleep(400e6) + } + }() + } + + t := metrics.NewTimer() + r.Register("hooah", t) + for i := 0; i < fanout; i++ { + go func() { + for { + t.Time(func() { time.Sleep(300e6) }) + } + }() + go func() { + for { + t.Time(func() { time.Sleep(400e6) }) + } + }() + } + + metrics.RegisterDebugGCStats(r) + go metrics.CaptureDebugGCStats(r, 5e9) + + metrics.RegisterRuntimeMemStats(r) + go metrics.CaptureRuntimeMemStats(r, 5e9) + + metrics.Log(r, 60e9, log.New(os.Stderr, "metrics: ", log.Lmicroseconds)) + + /* + w, err := syslog.Dial("unixgram", "/dev/log", syslog.LOG_INFO, "metrics") + if nil != err { log.Fatalln(err) } + metrics.Syslog(r, 60e9, w) + */ + + /* + addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:2003") + metrics.Graphite(r, 10e9, "metrics", addr) + */ + + /* + stathat.Stathat(r, 10e9, "example@example.com") + */ + +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/cmd/never-read/never-read.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/cmd/never-read/never-read.go new file mode 100644 index 00000000..dc175b77 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/cmd/never-read/never-read.go @@ -0,0 +1,22 @@ +package main + +import ( + "log" + "net" +) + +func main() { + addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:2003") + l, err := net.ListenTCP("tcp", addr) + if nil != err { + log.Fatalln(err) + } + log.Println("listening", l.Addr()) + for { + c, err := l.AcceptTCP() + if nil != err { + log.Fatalln(err) + } + log.Println("accepted", c.RemoteAddr()) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/counter.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/counter.go new file mode 100644 index 00000000..bb7b039c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/counter.go @@ -0,0 +1,112 @@ +package metrics + +import "sync/atomic" + +// Counters hold an int64 value that can be incremented and decremented. +type Counter interface { + Clear() + Count() int64 + Dec(int64) + Inc(int64) + Snapshot() Counter +} + +// GetOrRegisterCounter returns an existing Counter or constructs and registers +// a new StandardCounter. +func GetOrRegisterCounter(name string, r Registry) Counter { + if nil == r { + r = DefaultRegistry + } + return r.GetOrRegister(name, NewCounter).(Counter) +} + +// NewCounter constructs a new StandardCounter. +func NewCounter() Counter { + if UseNilMetrics { + return NilCounter{} + } + return &StandardCounter{0} +} + +// NewRegisteredCounter constructs and registers a new StandardCounter. +func NewRegisteredCounter(name string, r Registry) Counter { + c := NewCounter() + if nil == r { + r = DefaultRegistry + } + r.Register(name, c) + return c +} + +// CounterSnapshot is a read-only copy of another Counter. +type CounterSnapshot int64 + +// Clear panics. +func (CounterSnapshot) Clear() { + panic("Clear called on a CounterSnapshot") +} + +// Count returns the count at the time the snapshot was taken. +func (c CounterSnapshot) Count() int64 { return int64(c) } + +// Dec panics. +func (CounterSnapshot) Dec(int64) { + panic("Dec called on a CounterSnapshot") +} + +// Inc panics. +func (CounterSnapshot) Inc(int64) { + panic("Inc called on a CounterSnapshot") +} + +// Snapshot returns the snapshot. +func (c CounterSnapshot) Snapshot() Counter { return c } + +// NilCounter is a no-op Counter. +type NilCounter struct{} + +// Clear is a no-op. +func (NilCounter) Clear() {} + +// Count is a no-op. +func (NilCounter) Count() int64 { return 0 } + +// Dec is a no-op. +func (NilCounter) Dec(i int64) {} + +// Inc is a no-op. +func (NilCounter) Inc(i int64) {} + +// Snapshot is a no-op. +func (NilCounter) Snapshot() Counter { return NilCounter{} } + +// StandardCounter is the standard implementation of a Counter and uses the +// sync/atomic package to manage a single int64 value. +type StandardCounter struct { + count int64 +} + +// Clear sets the counter to zero. +func (c *StandardCounter) Clear() { + atomic.StoreInt64(&c.count, 0) +} + +// Count returns the current count. +func (c *StandardCounter) Count() int64 { + return atomic.LoadInt64(&c.count) +} + +// Dec decrements the counter by the given amount. +func (c *StandardCounter) Dec(i int64) { + atomic.AddInt64(&c.count, -i) +} + +// Inc increments the counter by the given amount. +func (c *StandardCounter) Inc(i int64) { + atomic.AddInt64(&c.count, i) +} + +// Snapshot returns a read-only copy of the counter. +func (c *StandardCounter) Snapshot() Counter { + return CounterSnapshot(c.Count()) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/debug.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/debug.go new file mode 100644 index 00000000..043ccefa --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/debug.go @@ -0,0 +1,76 @@ +package metrics + +import ( + "runtime/debug" + "time" +) + +var ( + debugMetrics struct { + GCStats struct { + LastGC Gauge + NumGC Gauge + Pause Histogram + //PauseQuantiles Histogram + PauseTotal Gauge + } + ReadGCStats Timer + } + gcStats debug.GCStats +) + +// Capture new values for the Go garbage collector statistics exported in +// debug.GCStats. This is designed to be called as a goroutine. +func CaptureDebugGCStats(r Registry, d time.Duration) { + for _ = range time.Tick(d) { + CaptureDebugGCStatsOnce(r) + } +} + +// Capture new values for the Go garbage collector statistics exported in +// debug.GCStats. This is designed to be called in a background goroutine. +// Giving a registry which has not been given to RegisterDebugGCStats will +// panic. +// +// Be careful (but much less so) with this because debug.ReadGCStats calls +// the C function runtime·lock(runtime·mheap) which, while not a stop-the-world +// operation, isn't something you want to be doing all the time. +func CaptureDebugGCStatsOnce(r Registry) { + lastGC := gcStats.LastGC + t := time.Now() + debug.ReadGCStats(&gcStats) + debugMetrics.ReadGCStats.UpdateSince(t) + + debugMetrics.GCStats.LastGC.Update(int64(gcStats.LastGC.UnixNano())) + debugMetrics.GCStats.NumGC.Update(int64(gcStats.NumGC)) + if lastGC != gcStats.LastGC && 0 < len(gcStats.Pause) { + debugMetrics.GCStats.Pause.Update(int64(gcStats.Pause[0])) + } + //debugMetrics.GCStats.PauseQuantiles.Update(gcStats.PauseQuantiles) + debugMetrics.GCStats.PauseTotal.Update(int64(gcStats.PauseTotal)) +} + +// Register metrics for the Go garbage collector statistics exported in +// debug.GCStats. The metrics are named by their fully-qualified Go symbols, +// i.e. debug.GCStats.PauseTotal. +func RegisterDebugGCStats(r Registry) { + debugMetrics.GCStats.LastGC = NewGauge() + debugMetrics.GCStats.NumGC = NewGauge() + debugMetrics.GCStats.Pause = NewHistogram(NewExpDecaySample(1028, 0.015)) + //debugMetrics.GCStats.PauseQuantiles = NewHistogram(NewExpDecaySample(1028, 0.015)) + debugMetrics.GCStats.PauseTotal = NewGauge() + debugMetrics.ReadGCStats = NewTimer() + + r.Register("debug.GCStats.LastGC", debugMetrics.GCStats.LastGC) + r.Register("debug.GCStats.NumGC", debugMetrics.GCStats.NumGC) + r.Register("debug.GCStats.Pause", debugMetrics.GCStats.Pause) + //r.Register("debug.GCStats.PauseQuantiles", debugMetrics.GCStats.PauseQuantiles) + r.Register("debug.GCStats.PauseTotal", debugMetrics.GCStats.PauseTotal) + r.Register("debug.ReadGCStats", debugMetrics.ReadGCStats) +} + +// Allocate an initial slice for gcStats.Pause to avoid allocations during +// normal operation. +func init() { + gcStats.Pause = make([]time.Duration, 11) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/ewma.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/ewma.go new file mode 100644 index 00000000..694a1d03 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/ewma.go @@ -0,0 +1,118 @@ +package metrics + +import ( + "math" + "sync" + "sync/atomic" +) + +// EWMAs continuously calculate an exponentially-weighted moving average +// based on an outside source of clock ticks. +type EWMA interface { + Rate() float64 + Snapshot() EWMA + Tick() + Update(int64) +} + +// NewEWMA constructs a new EWMA with the given alpha. +func NewEWMA(alpha float64) EWMA { + if UseNilMetrics { + return NilEWMA{} + } + return &StandardEWMA{alpha: alpha} +} + +// NewEWMA1 constructs a new EWMA for a one-minute moving average. +func NewEWMA1() EWMA { + return NewEWMA(1 - math.Exp(-5.0/60.0/1)) +} + +// NewEWMA5 constructs a new EWMA for a five-minute moving average. +func NewEWMA5() EWMA { + return NewEWMA(1 - math.Exp(-5.0/60.0/5)) +} + +// NewEWMA15 constructs a new EWMA for a fifteen-minute moving average. +func NewEWMA15() EWMA { + return NewEWMA(1 - math.Exp(-5.0/60.0/15)) +} + +// EWMASnapshot is a read-only copy of another EWMA. +type EWMASnapshot float64 + +// Rate returns the rate of events per second at the time the snapshot was +// taken. +func (a EWMASnapshot) Rate() float64 { return float64(a) } + +// Snapshot returns the snapshot. +func (a EWMASnapshot) Snapshot() EWMA { return a } + +// Tick panics. +func (EWMASnapshot) Tick() { + panic("Tick called on an EWMASnapshot") +} + +// Update panics. +func (EWMASnapshot) Update(int64) { + panic("Update called on an EWMASnapshot") +} + +// NilEWMA is a no-op EWMA. +type NilEWMA struct{} + +// Rate is a no-op. +func (NilEWMA) Rate() float64 { return 0.0 } + +// Snapshot is a no-op. +func (NilEWMA) Snapshot() EWMA { return NilEWMA{} } + +// Tick is a no-op. +func (NilEWMA) Tick() {} + +// Update is a no-op. +func (NilEWMA) Update(n int64) {} + +// StandardEWMA is the standard implementation of an EWMA and tracks the number +// of uncounted events and processes them on each tick. It uses the +// sync/atomic package to manage uncounted events. +type StandardEWMA struct { + uncounted int64 // /!\ this should be the first member to ensure 64-bit alignment + alpha float64 + rate float64 + init bool + mutex sync.Mutex +} + +// Rate returns the moving average rate of events per second. +func (a *StandardEWMA) Rate() float64 { + a.mutex.Lock() + defer a.mutex.Unlock() + return a.rate * float64(1e9) +} + +// Snapshot returns a read-only copy of the EWMA. +func (a *StandardEWMA) Snapshot() EWMA { + return EWMASnapshot(a.Rate()) +} + +// Tick ticks the clock to update the moving average. It assumes it is called +// every five seconds. +func (a *StandardEWMA) Tick() { + count := atomic.LoadInt64(&a.uncounted) + atomic.AddInt64(&a.uncounted, -count) + instantRate := float64(count) / float64(5e9) + a.mutex.Lock() + defer a.mutex.Unlock() + if a.init { + a.rate += a.alpha * (instantRate - a.rate) + } else { + a.init = true + a.rate = instantRate + } +} + +// Update adds n uncounted events. +func (a *StandardEWMA) Update(n int64) { + atomic.AddInt64(&a.uncounted, n) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/exp/exp.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/exp/exp.go new file mode 100644 index 00000000..11dd3f89 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/exp/exp.go @@ -0,0 +1,156 @@ +// Hook go-metrics into expvar +// on any /debug/metrics request, load all vars from the registry into expvar, and execute regular expvar handler +package exp + +import ( + "expvar" + "fmt" + "net/http" + "sync" + + "github.com/rcrowley/go-metrics" +) + +type exp struct { + expvarLock sync.Mutex // expvar panics if you try to register the same var twice, so we must probe it safely + registry metrics.Registry +} + +func (exp *exp) expHandler(w http.ResponseWriter, r *http.Request) { + // load our variables into expvar + exp.syncToExpvar() + + // now just run the official expvar handler code (which is not publicly callable, so pasted inline) + w.Header().Set("Content-Type", "application/json; charset=utf-8") + fmt.Fprintf(w, "{\n") + first := true + expvar.Do(func(kv expvar.KeyValue) { + if !first { + fmt.Fprintf(w, ",\n") + } + first = false + fmt.Fprintf(w, "%q: %s", kv.Key, kv.Value) + }) + fmt.Fprintf(w, "\n}\n") +} + +// Exp will register an expvar powered metrics handler with http.DefaultServeMux on "/debug/vars" +func Exp(r metrics.Registry) { + h := ExpHandler(r) + // this would cause a panic: + // panic: http: multiple registrations for /debug/vars + // http.HandleFunc("/debug/vars", e.expHandler) + // haven't found an elegant way, so just use a different endpoint + http.Handle("/debug/metrics", h) +} + +// ExpHandler will return an expvar powered metrics handler. +func ExpHandler(r metrics.Registry) http.Handler { + e := exp{sync.Mutex{}, r} + return http.HandlerFunc(e.expHandler) +} + +func (exp *exp) getInt(name string) *expvar.Int { + var v *expvar.Int + exp.expvarLock.Lock() + p := expvar.Get(name) + if p != nil { + v = p.(*expvar.Int) + } else { + v = new(expvar.Int) + expvar.Publish(name, v) + } + exp.expvarLock.Unlock() + return v +} + +func (exp *exp) getFloat(name string) *expvar.Float { + var v *expvar.Float + exp.expvarLock.Lock() + p := expvar.Get(name) + if p != nil { + v = p.(*expvar.Float) + } else { + v = new(expvar.Float) + expvar.Publish(name, v) + } + exp.expvarLock.Unlock() + return v +} + +func (exp *exp) publishCounter(name string, metric metrics.Counter) { + v := exp.getInt(name) + v.Set(metric.Count()) +} + +func (exp *exp) publishGauge(name string, metric metrics.Gauge) { + v := exp.getInt(name) + v.Set(metric.Value()) +} +func (exp *exp) publishGaugeFloat64(name string, metric metrics.GaugeFloat64) { + exp.getFloat(name).Set(metric.Value()) +} + +func (exp *exp) publishHistogram(name string, metric metrics.Histogram) { + h := metric.Snapshot() + ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + exp.getInt(name + ".count").Set(h.Count()) + exp.getFloat(name + ".min").Set(float64(h.Min())) + exp.getFloat(name + ".max").Set(float64(h.Max())) + exp.getFloat(name + ".mean").Set(float64(h.Mean())) + exp.getFloat(name + ".std-dev").Set(float64(h.StdDev())) + exp.getFloat(name + ".50-percentile").Set(float64(ps[0])) + exp.getFloat(name + ".75-percentile").Set(float64(ps[1])) + exp.getFloat(name + ".95-percentile").Set(float64(ps[2])) + exp.getFloat(name + ".99-percentile").Set(float64(ps[3])) + exp.getFloat(name + ".999-percentile").Set(float64(ps[4])) +} + +func (exp *exp) publishMeter(name string, metric metrics.Meter) { + m := metric.Snapshot() + exp.getInt(name + ".count").Set(m.Count()) + exp.getFloat(name + ".one-minute").Set(float64(m.Rate1())) + exp.getFloat(name + ".five-minute").Set(float64(m.Rate5())) + exp.getFloat(name + ".fifteen-minute").Set(float64((m.Rate15()))) + exp.getFloat(name + ".mean").Set(float64(m.RateMean())) +} + +func (exp *exp) publishTimer(name string, metric metrics.Timer) { + t := metric.Snapshot() + ps := t.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + exp.getInt(name + ".count").Set(t.Count()) + exp.getFloat(name + ".min").Set(float64(t.Min())) + exp.getFloat(name + ".max").Set(float64(t.Max())) + exp.getFloat(name + ".mean").Set(float64(t.Mean())) + exp.getFloat(name + ".std-dev").Set(float64(t.StdDev())) + exp.getFloat(name + ".50-percentile").Set(float64(ps[0])) + exp.getFloat(name + ".75-percentile").Set(float64(ps[1])) + exp.getFloat(name + ".95-percentile").Set(float64(ps[2])) + exp.getFloat(name + ".99-percentile").Set(float64(ps[3])) + exp.getFloat(name + ".999-percentile").Set(float64(ps[4])) + exp.getFloat(name + ".one-minute").Set(float64(t.Rate1())) + exp.getFloat(name + ".five-minute").Set(float64(t.Rate5())) + exp.getFloat(name + ".fifteen-minute").Set(float64((t.Rate15()))) + exp.getFloat(name + ".mean-rate").Set(float64(t.RateMean())) +} + +func (exp *exp) syncToExpvar() { + exp.registry.Each(func(name string, i interface{}) { + switch i.(type) { + case metrics.Counter: + exp.publishCounter(name, i.(metrics.Counter)) + case metrics.Gauge: + exp.publishGauge(name, i.(metrics.Gauge)) + case metrics.GaugeFloat64: + exp.publishGaugeFloat64(name, i.(metrics.GaugeFloat64)) + case metrics.Histogram: + exp.publishHistogram(name, i.(metrics.Histogram)) + case metrics.Meter: + exp.publishMeter(name, i.(metrics.Meter)) + case metrics.Timer: + exp.publishTimer(name, i.(metrics.Timer)) + default: + panic(fmt.Sprintf("unsupported type for '%s': %T", name, i)) + } + }) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/gauge.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/gauge.go new file mode 100644 index 00000000..d618c455 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/gauge.go @@ -0,0 +1,120 @@ +package metrics + +import "sync/atomic" + +// Gauges hold an int64 value that can be set arbitrarily. +type Gauge interface { + Snapshot() Gauge + Update(int64) + Value() int64 +} + +// GetOrRegisterGauge returns an existing Gauge or constructs and registers a +// new StandardGauge. +func GetOrRegisterGauge(name string, r Registry) Gauge { + if nil == r { + r = DefaultRegistry + } + return r.GetOrRegister(name, NewGauge).(Gauge) +} + +// NewGauge constructs a new StandardGauge. +func NewGauge() Gauge { + if UseNilMetrics { + return NilGauge{} + } + return &StandardGauge{0} +} + +// NewRegisteredGauge constructs and registers a new StandardGauge. +func NewRegisteredGauge(name string, r Registry) Gauge { + c := NewGauge() + if nil == r { + r = DefaultRegistry + } + r.Register(name, c) + return c +} + +// NewFunctionalGauge constructs a new FunctionalGauge. +func NewFunctionalGauge(f func() int64) Gauge { + if UseNilMetrics { + return NilGauge{} + } + return &FunctionalGauge{value: f} +} + + +// NewRegisteredFunctionalGauge constructs and registers a new StandardGauge. +func NewRegisteredFunctionalGauge(name string, r Registry, f func() int64) Gauge { + c := NewFunctionalGauge(f) + if nil == r { + r = DefaultRegistry + } + r.Register(name, c) + return c +} + +// GaugeSnapshot is a read-only copy of another Gauge. +type GaugeSnapshot int64 + +// Snapshot returns the snapshot. +func (g GaugeSnapshot) Snapshot() Gauge { return g } + +// Update panics. +func (GaugeSnapshot) Update(int64) { + panic("Update called on a GaugeSnapshot") +} + +// Value returns the value at the time the snapshot was taken. +func (g GaugeSnapshot) Value() int64 { return int64(g) } + +// NilGauge is a no-op Gauge. +type NilGauge struct{} + +// Snapshot is a no-op. +func (NilGauge) Snapshot() Gauge { return NilGauge{} } + +// Update is a no-op. +func (NilGauge) Update(v int64) {} + +// Value is a no-op. +func (NilGauge) Value() int64 { return 0 } + +// StandardGauge is the standard implementation of a Gauge and uses the +// sync/atomic package to manage a single int64 value. +type StandardGauge struct { + value int64 +} + +// Snapshot returns a read-only copy of the gauge. +func (g *StandardGauge) Snapshot() Gauge { + return GaugeSnapshot(g.Value()) +} + +// Update updates the gauge's value. +func (g *StandardGauge) Update(v int64) { + atomic.StoreInt64(&g.value, v) +} + +// Value returns the gauge's current value. +func (g *StandardGauge) Value() int64 { + return atomic.LoadInt64(&g.value) +} +// FunctionalGauge returns value from given function +type FunctionalGauge struct { + value func() int64 +} + +// Value returns the gauge's current value. +func (g FunctionalGauge) Value() int64 { + return g.value() +} + +// Snapshot returns the snapshot. +func (g FunctionalGauge) Snapshot() Gauge { return GaugeSnapshot(g.Value()) } + +// Update panics. +func (FunctionalGauge) Update(int64) { + panic("Update called on a FunctionalGauge") +} \ No newline at end of file diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/gauge_float64.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/gauge_float64.go new file mode 100644 index 00000000..6f93920b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/gauge_float64.go @@ -0,0 +1,127 @@ +package metrics + +import "sync" + +// GaugeFloat64s hold a float64 value that can be set arbitrarily. +type GaugeFloat64 interface { + Snapshot() GaugeFloat64 + Update(float64) + Value() float64 +} + +// GetOrRegisterGaugeFloat64 returns an existing GaugeFloat64 or constructs and registers a +// new StandardGaugeFloat64. +func GetOrRegisterGaugeFloat64(name string, r Registry) GaugeFloat64 { + if nil == r { + r = DefaultRegistry + } + return r.GetOrRegister(name, NewGaugeFloat64()).(GaugeFloat64) +} + +// NewGaugeFloat64 constructs a new StandardGaugeFloat64. +func NewGaugeFloat64() GaugeFloat64 { + if UseNilMetrics { + return NilGaugeFloat64{} + } + return &StandardGaugeFloat64{ + value: 0.0, + } +} + +// NewRegisteredGaugeFloat64 constructs and registers a new StandardGaugeFloat64. +func NewRegisteredGaugeFloat64(name string, r Registry) GaugeFloat64 { + c := NewGaugeFloat64() + if nil == r { + r = DefaultRegistry + } + r.Register(name, c) + return c +} + +// NewFunctionalGauge constructs a new FunctionalGauge. +func NewFunctionalGaugeFloat64(f func() float64) GaugeFloat64 { + if UseNilMetrics { + return NilGaugeFloat64{} + } + return &FunctionalGaugeFloat64{value: f} +} + +// NewRegisteredFunctionalGauge constructs and registers a new StandardGauge. +func NewRegisteredFunctionalGaugeFloat64(name string, r Registry, f func() float64) GaugeFloat64 { + c := NewFunctionalGaugeFloat64(f) + if nil == r { + r = DefaultRegistry + } + r.Register(name, c) + return c +} + +// GaugeFloat64Snapshot is a read-only copy of another GaugeFloat64. +type GaugeFloat64Snapshot float64 + +// Snapshot returns the snapshot. +func (g GaugeFloat64Snapshot) Snapshot() GaugeFloat64 { return g } + +// Update panics. +func (GaugeFloat64Snapshot) Update(float64) { + panic("Update called on a GaugeFloat64Snapshot") +} + +// Value returns the value at the time the snapshot was taken. +func (g GaugeFloat64Snapshot) Value() float64 { return float64(g) } + +// NilGauge is a no-op Gauge. +type NilGaugeFloat64 struct{} + +// Snapshot is a no-op. +func (NilGaugeFloat64) Snapshot() GaugeFloat64 { return NilGaugeFloat64{} } + +// Update is a no-op. +func (NilGaugeFloat64) Update(v float64) {} + +// Value is a no-op. +func (NilGaugeFloat64) Value() float64 { return 0.0 } + +// StandardGaugeFloat64 is the standard implementation of a GaugeFloat64 and uses +// sync.Mutex to manage a single float64 value. +type StandardGaugeFloat64 struct { + mutex sync.Mutex + value float64 +} + +// Snapshot returns a read-only copy of the gauge. +func (g *StandardGaugeFloat64) Snapshot() GaugeFloat64 { + return GaugeFloat64Snapshot(g.Value()) +} + +// Update updates the gauge's value. +func (g *StandardGaugeFloat64) Update(v float64) { + g.mutex.Lock() + defer g.mutex.Unlock() + g.value = v +} + +// Value returns the gauge's current value. +func (g *StandardGaugeFloat64) Value() float64 { + g.mutex.Lock() + defer g.mutex.Unlock() + return g.value +} + +// FunctionalGaugeFloat64 returns value from given function +type FunctionalGaugeFloat64 struct { + value func() float64 +} + +// Value returns the gauge's current value. +func (g FunctionalGaugeFloat64) Value() float64 { + return g.value() +} + +// Snapshot returns the snapshot. +func (g FunctionalGaugeFloat64) Snapshot() GaugeFloat64 { return GaugeFloat64Snapshot(g.Value()) } + +// Update panics. +func (FunctionalGaugeFloat64) Update(float64) { + panic("Update called on a FunctionalGaugeFloat64") +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/graphite.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/graphite.go new file mode 100644 index 00000000..abd0a7d2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/graphite.go @@ -0,0 +1,113 @@ +package metrics + +import ( + "bufio" + "fmt" + "log" + "net" + "strconv" + "strings" + "time" +) + +// GraphiteConfig provides a container with configuration parameters for +// the Graphite exporter +type GraphiteConfig struct { + Addr *net.TCPAddr // Network address to connect to + Registry Registry // Registry to be exported + FlushInterval time.Duration // Flush interval + DurationUnit time.Duration // Time conversion unit for durations + Prefix string // Prefix to be prepended to metric names + Percentiles []float64 // Percentiles to export from timers and histograms +} + +// Graphite is a blocking exporter function which reports metrics in r +// to a graphite server located at addr, flushing them every d duration +// and prepending metric names with prefix. +func Graphite(r Registry, d time.Duration, prefix string, addr *net.TCPAddr) { + GraphiteWithConfig(GraphiteConfig{ + Addr: addr, + Registry: r, + FlushInterval: d, + DurationUnit: time.Nanosecond, + Prefix: prefix, + Percentiles: []float64{0.5, 0.75, 0.95, 0.99, 0.999}, + }) +} + +// GraphiteWithConfig is a blocking exporter function just like Graphite, +// but it takes a GraphiteConfig instead. +func GraphiteWithConfig(c GraphiteConfig) { + log.Printf("WARNING: This go-metrics client has been DEPRECATED! It has been moved to https://github.com/cyberdelia/go-metrics-graphite and will be removed from rcrowley/go-metrics on August 12th 2015") + for _ = range time.Tick(c.FlushInterval) { + if err := graphite(&c); nil != err { + log.Println(err) + } + } +} + +// GraphiteOnce performs a single submission to Graphite, returning a +// non-nil error on failed connections. This can be used in a loop +// similar to GraphiteWithConfig for custom error handling. +func GraphiteOnce(c GraphiteConfig) error { + log.Printf("WARNING: This go-metrics client has been DEPRECATED! It has been moved to https://github.com/cyberdelia/go-metrics-graphite and will be removed from rcrowley/go-metrics on August 12th 2015") + return graphite(&c) +} + +func graphite(c *GraphiteConfig) error { + now := time.Now().Unix() + du := float64(c.DurationUnit) + conn, err := net.DialTCP("tcp", nil, c.Addr) + if nil != err { + return err + } + defer conn.Close() + w := bufio.NewWriter(conn) + c.Registry.Each(func(name string, i interface{}) { + switch metric := i.(type) { + case Counter: + fmt.Fprintf(w, "%s.%s.count %d %d\n", c.Prefix, name, metric.Count(), now) + case Gauge: + fmt.Fprintf(w, "%s.%s.value %d %d\n", c.Prefix, name, metric.Value(), now) + case GaugeFloat64: + fmt.Fprintf(w, "%s.%s.value %f %d\n", c.Prefix, name, metric.Value(), now) + case Histogram: + h := metric.Snapshot() + ps := h.Percentiles(c.Percentiles) + fmt.Fprintf(w, "%s.%s.count %d %d\n", c.Prefix, name, h.Count(), now) + fmt.Fprintf(w, "%s.%s.min %d %d\n", c.Prefix, name, h.Min(), now) + fmt.Fprintf(w, "%s.%s.max %d %d\n", c.Prefix, name, h.Max(), now) + fmt.Fprintf(w, "%s.%s.mean %.2f %d\n", c.Prefix, name, h.Mean(), now) + fmt.Fprintf(w, "%s.%s.std-dev %.2f %d\n", c.Prefix, name, h.StdDev(), now) + for psIdx, psKey := range c.Percentiles { + key := strings.Replace(strconv.FormatFloat(psKey*100.0, 'f', -1, 64), ".", "", 1) + fmt.Fprintf(w, "%s.%s.%s-percentile %.2f %d\n", c.Prefix, name, key, ps[psIdx], now) + } + case Meter: + m := metric.Snapshot() + fmt.Fprintf(w, "%s.%s.count %d %d\n", c.Prefix, name, m.Count(), now) + fmt.Fprintf(w, "%s.%s.one-minute %.2f %d\n", c.Prefix, name, m.Rate1(), now) + fmt.Fprintf(w, "%s.%s.five-minute %.2f %d\n", c.Prefix, name, m.Rate5(), now) + fmt.Fprintf(w, "%s.%s.fifteen-minute %.2f %d\n", c.Prefix, name, m.Rate15(), now) + fmt.Fprintf(w, "%s.%s.mean %.2f %d\n", c.Prefix, name, m.RateMean(), now) + case Timer: + t := metric.Snapshot() + ps := t.Percentiles(c.Percentiles) + fmt.Fprintf(w, "%s.%s.count %d %d\n", c.Prefix, name, t.Count(), now) + fmt.Fprintf(w, "%s.%s.min %d %d\n", c.Prefix, name, t.Min()/int64(du), now) + fmt.Fprintf(w, "%s.%s.max %d %d\n", c.Prefix, name, t.Max()/int64(du), now) + fmt.Fprintf(w, "%s.%s.mean %.2f %d\n", c.Prefix, name, t.Mean()/du, now) + fmt.Fprintf(w, "%s.%s.std-dev %.2f %d\n", c.Prefix, name, t.StdDev()/du, now) + for psIdx, psKey := range c.Percentiles { + key := strings.Replace(strconv.FormatFloat(psKey*100.0, 'f', -1, 64), ".", "", 1) + fmt.Fprintf(w, "%s.%s.%s-percentile %.2f %d\n", c.Prefix, name, key, ps[psIdx], now) + } + fmt.Fprintf(w, "%s.%s.one-minute %.2f %d\n", c.Prefix, name, t.Rate1(), now) + fmt.Fprintf(w, "%s.%s.five-minute %.2f %d\n", c.Prefix, name, t.Rate5(), now) + fmt.Fprintf(w, "%s.%s.fifteen-minute %.2f %d\n", c.Prefix, name, t.Rate15(), now) + fmt.Fprintf(w, "%s.%s.mean-rate %.2f %d\n", c.Prefix, name, t.RateMean(), now) + } + w.Flush() + }) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/healthcheck.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/healthcheck.go new file mode 100644 index 00000000..445131ca --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/healthcheck.go @@ -0,0 +1,61 @@ +package metrics + +// Healthchecks hold an error value describing an arbitrary up/down status. +type Healthcheck interface { + Check() + Error() error + Healthy() + Unhealthy(error) +} + +// NewHealthcheck constructs a new Healthcheck which will use the given +// function to update its status. +func NewHealthcheck(f func(Healthcheck)) Healthcheck { + if UseNilMetrics { + return NilHealthcheck{} + } + return &StandardHealthcheck{nil, f} +} + +// NilHealthcheck is a no-op. +type NilHealthcheck struct{} + +// Check is a no-op. +func (NilHealthcheck) Check() {} + +// Error is a no-op. +func (NilHealthcheck) Error() error { return nil } + +// Healthy is a no-op. +func (NilHealthcheck) Healthy() {} + +// Unhealthy is a no-op. +func (NilHealthcheck) Unhealthy(error) {} + +// StandardHealthcheck is the standard implementation of a Healthcheck and +// stores the status and a function to call to update the status. +type StandardHealthcheck struct { + err error + f func(Healthcheck) +} + +// Check runs the healthcheck function to update the healthcheck's status. +func (h *StandardHealthcheck) Check() { + h.f(h) +} + +// Error returns the healthcheck's status, which will be nil if it is healthy. +func (h *StandardHealthcheck) Error() error { + return h.err +} + +// Healthy marks the healthcheck as healthy. +func (h *StandardHealthcheck) Healthy() { + h.err = nil +} + +// Unhealthy marks the healthcheck as unhealthy. The error is stored and +// may be retrieved by the Error method. +func (h *StandardHealthcheck) Unhealthy(err error) { + h.err = err +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/histogram.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/histogram.go new file mode 100644 index 00000000..dbc837fe --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/histogram.go @@ -0,0 +1,202 @@ +package metrics + +// Histograms calculate distribution statistics from a series of int64 values. +type Histogram interface { + Clear() + Count() int64 + Max() int64 + Mean() float64 + Min() int64 + Percentile(float64) float64 + Percentiles([]float64) []float64 + Sample() Sample + Snapshot() Histogram + StdDev() float64 + Sum() int64 + Update(int64) + Variance() float64 +} + +// GetOrRegisterHistogram returns an existing Histogram or constructs and +// registers a new StandardHistogram. +func GetOrRegisterHistogram(name string, r Registry, s Sample) Histogram { + if nil == r { + r = DefaultRegistry + } + return r.GetOrRegister(name, func() Histogram { return NewHistogram(s) }).(Histogram) +} + +// NewHistogram constructs a new StandardHistogram from a Sample. +func NewHistogram(s Sample) Histogram { + if UseNilMetrics { + return NilHistogram{} + } + return &StandardHistogram{sample: s} +} + +// NewRegisteredHistogram constructs and registers a new StandardHistogram from +// a Sample. +func NewRegisteredHistogram(name string, r Registry, s Sample) Histogram { + c := NewHistogram(s) + if nil == r { + r = DefaultRegistry + } + r.Register(name, c) + return c +} + +// HistogramSnapshot is a read-only copy of another Histogram. +type HistogramSnapshot struct { + sample *SampleSnapshot +} + +// Clear panics. +func (*HistogramSnapshot) Clear() { + panic("Clear called on a HistogramSnapshot") +} + +// Count returns the number of samples recorded at the time the snapshot was +// taken. +func (h *HistogramSnapshot) Count() int64 { return h.sample.Count() } + +// Max returns the maximum value in the sample at the time the snapshot was +// taken. +func (h *HistogramSnapshot) Max() int64 { return h.sample.Max() } + +// Mean returns the mean of the values in the sample at the time the snapshot +// was taken. +func (h *HistogramSnapshot) Mean() float64 { return h.sample.Mean() } + +// Min returns the minimum value in the sample at the time the snapshot was +// taken. +func (h *HistogramSnapshot) Min() int64 { return h.sample.Min() } + +// Percentile returns an arbitrary percentile of values in the sample at the +// time the snapshot was taken. +func (h *HistogramSnapshot) Percentile(p float64) float64 { + return h.sample.Percentile(p) +} + +// Percentiles returns a slice of arbitrary percentiles of values in the sample +// at the time the snapshot was taken. +func (h *HistogramSnapshot) Percentiles(ps []float64) []float64 { + return h.sample.Percentiles(ps) +} + +// Sample returns the Sample underlying the histogram. +func (h *HistogramSnapshot) Sample() Sample { return h.sample } + +// Snapshot returns the snapshot. +func (h *HistogramSnapshot) Snapshot() Histogram { return h } + +// StdDev returns the standard deviation of the values in the sample at the +// time the snapshot was taken. +func (h *HistogramSnapshot) StdDev() float64 { return h.sample.StdDev() } + +// Sum returns the sum in the sample at the time the snapshot was taken. +func (h *HistogramSnapshot) Sum() int64 { return h.sample.Sum() } + +// Update panics. +func (*HistogramSnapshot) Update(int64) { + panic("Update called on a HistogramSnapshot") +} + +// Variance returns the variance of inputs at the time the snapshot was taken. +func (h *HistogramSnapshot) Variance() float64 { return h.sample.Variance() } + +// NilHistogram is a no-op Histogram. +type NilHistogram struct{} + +// Clear is a no-op. +func (NilHistogram) Clear() {} + +// Count is a no-op. +func (NilHistogram) Count() int64 { return 0 } + +// Max is a no-op. +func (NilHistogram) Max() int64 { return 0 } + +// Mean is a no-op. +func (NilHistogram) Mean() float64 { return 0.0 } + +// Min is a no-op. +func (NilHistogram) Min() int64 { return 0 } + +// Percentile is a no-op. +func (NilHistogram) Percentile(p float64) float64 { return 0.0 } + +// Percentiles is a no-op. +func (NilHistogram) Percentiles(ps []float64) []float64 { + return make([]float64, len(ps)) +} + +// Sample is a no-op. +func (NilHistogram) Sample() Sample { return NilSample{} } + +// Snapshot is a no-op. +func (NilHistogram) Snapshot() Histogram { return NilHistogram{} } + +// StdDev is a no-op. +func (NilHistogram) StdDev() float64 { return 0.0 } + +// Sum is a no-op. +func (NilHistogram) Sum() int64 { return 0 } + +// Update is a no-op. +func (NilHistogram) Update(v int64) {} + +// Variance is a no-op. +func (NilHistogram) Variance() float64 { return 0.0 } + +// StandardHistogram is the standard implementation of a Histogram and uses a +// Sample to bound its memory use. +type StandardHistogram struct { + sample Sample +} + +// Clear clears the histogram and its sample. +func (h *StandardHistogram) Clear() { h.sample.Clear() } + +// Count returns the number of samples recorded since the histogram was last +// cleared. +func (h *StandardHistogram) Count() int64 { return h.sample.Count() } + +// Max returns the maximum value in the sample. +func (h *StandardHistogram) Max() int64 { return h.sample.Max() } + +// Mean returns the mean of the values in the sample. +func (h *StandardHistogram) Mean() float64 { return h.sample.Mean() } + +// Min returns the minimum value in the sample. +func (h *StandardHistogram) Min() int64 { return h.sample.Min() } + +// Percentile returns an arbitrary percentile of the values in the sample. +func (h *StandardHistogram) Percentile(p float64) float64 { + return h.sample.Percentile(p) +} + +// Percentiles returns a slice of arbitrary percentiles of the values in the +// sample. +func (h *StandardHistogram) Percentiles(ps []float64) []float64 { + return h.sample.Percentiles(ps) +} + +// Sample returns the Sample underlying the histogram. +func (h *StandardHistogram) Sample() Sample { return h.sample } + +// Snapshot returns a read-only copy of the histogram. +func (h *StandardHistogram) Snapshot() Histogram { + return &HistogramSnapshot{sample: h.sample.Snapshot().(*SampleSnapshot)} +} + +// StdDev returns the standard deviation of the values in the sample. +func (h *StandardHistogram) StdDev() float64 { return h.sample.StdDev() } + +// Sum returns the sum in the sample. +func (h *StandardHistogram) Sum() int64 { return h.sample.Sum() } + +// Update samples a new value. +func (h *StandardHistogram) Update(v int64) { h.sample.Update(v) } + +// Variance returns the variance of the values in the sample. +func (h *StandardHistogram) Variance() float64 { return h.sample.Variance() } diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/json.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/json.go new file mode 100644 index 00000000..2fdcbcfb --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/json.go @@ -0,0 +1,87 @@ +package metrics + +import ( + "encoding/json" + "io" + "time" +) + +// MarshalJSON returns a byte slice containing a JSON representation of all +// the metrics in the Registry. +func (r *StandardRegistry) MarshalJSON() ([]byte, error) { + data := make(map[string]map[string]interface{}) + r.Each(func(name string, i interface{}) { + values := make(map[string]interface{}) + switch metric := i.(type) { + case Counter: + values["count"] = metric.Count() + case Gauge: + values["value"] = metric.Value() + case GaugeFloat64: + values["value"] = metric.Value() + case Healthcheck: + values["error"] = nil + metric.Check() + if err := metric.Error(); nil != err { + values["error"] = metric.Error().Error() + } + case Histogram: + h := metric.Snapshot() + ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + values["count"] = h.Count() + values["min"] = h.Min() + values["max"] = h.Max() + values["mean"] = h.Mean() + values["stddev"] = h.StdDev() + values["median"] = ps[0] + values["75%"] = ps[1] + values["95%"] = ps[2] + values["99%"] = ps[3] + values["99.9%"] = ps[4] + case Meter: + m := metric.Snapshot() + values["count"] = m.Count() + values["1m.rate"] = m.Rate1() + values["5m.rate"] = m.Rate5() + values["15m.rate"] = m.Rate15() + values["mean.rate"] = m.RateMean() + case Timer: + t := metric.Snapshot() + ps := t.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + values["count"] = t.Count() + values["min"] = t.Min() + values["max"] = t.Max() + values["mean"] = t.Mean() + values["stddev"] = t.StdDev() + values["median"] = ps[0] + values["75%"] = ps[1] + values["95%"] = ps[2] + values["99%"] = ps[3] + values["99.9%"] = ps[4] + values["1m.rate"] = t.Rate1() + values["5m.rate"] = t.Rate5() + values["15m.rate"] = t.Rate15() + values["mean.rate"] = t.RateMean() + } + data[name] = values + }) + return json.Marshal(data) +} + +// WriteJSON writes metrics from the given registry periodically to the +// specified io.Writer as JSON. +func WriteJSON(r Registry, d time.Duration, w io.Writer) { + for _ = range time.Tick(d) { + WriteJSONOnce(r, w) + } +} + +// WriteJSONOnce writes metrics from the given registry to the specified +// io.Writer as JSON. +func WriteJSONOnce(r Registry, w io.Writer) { + json.NewEncoder(w).Encode(r) +} + +func (p *PrefixedRegistry) MarshalJSON() ([]byte, error) { + return json.Marshal(p.underlying) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/librato/client.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/librato/client.go new file mode 100644 index 00000000..8c0c850e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/librato/client.go @@ -0,0 +1,102 @@ +package librato + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" +) + +const Operations = "operations" +const OperationsShort = "ops" + +type LibratoClient struct { + Email, Token string +} + +// property strings +const ( + // display attributes + Color = "color" + DisplayMax = "display_max" + DisplayMin = "display_min" + DisplayUnitsLong = "display_units_long" + DisplayUnitsShort = "display_units_short" + DisplayStacked = "display_stacked" + DisplayTransform = "display_transform" + // special gauge display attributes + SummarizeFunction = "summarize_function" + Aggregate = "aggregate" + + // metric keys + Name = "name" + Period = "period" + Description = "description" + DisplayName = "display_name" + Attributes = "attributes" + + // measurement keys + MeasureTime = "measure_time" + Source = "source" + Value = "value" + + // special gauge keys + Count = "count" + Sum = "sum" + Max = "max" + Min = "min" + SumSquares = "sum_squares" + + // batch keys + Counters = "counters" + Gauges = "gauges" + + MetricsPostUrl = "https://metrics-api.librato.com/v1/metrics" +) + +type Measurement map[string]interface{} +type Metric map[string]interface{} + +type Batch struct { + Gauges []Measurement `json:"gauges,omitempty"` + Counters []Measurement `json:"counters,omitempty"` + MeasureTime int64 `json:"measure_time"` + Source string `json:"source"` +} + +func (self *LibratoClient) PostMetrics(batch Batch) (err error) { + var ( + js []byte + req *http.Request + resp *http.Response + ) + + if len(batch.Counters) == 0 && len(batch.Gauges) == 0 { + return nil + } + + if js, err = json.Marshal(batch); err != nil { + return + } + + if req, err = http.NewRequest("POST", MetricsPostUrl, bytes.NewBuffer(js)); err != nil { + return + } + + req.Header.Set("Content-Type", "application/json") + req.SetBasicAuth(self.Email, self.Token) + + if resp, err = http.DefaultClient.Do(req); err != nil { + return + } + + if resp.StatusCode != http.StatusOK { + var body []byte + if body, err = ioutil.ReadAll(resp.Body); err != nil { + body = []byte(fmt.Sprintf("(could not fetch response body for error: %s)", err)) + } + err = fmt.Errorf("Unable to post to Librato: %d %s %s", resp.StatusCode, resp.Status, string(body)) + } + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/librato/librato.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/librato/librato.go new file mode 100644 index 00000000..d7c05746 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/librato/librato.go @@ -0,0 +1,235 @@ +package librato + +import ( + "fmt" + "log" + "math" + "regexp" + "time" + + "github.com/rcrowley/go-metrics" +) + +// a regexp for extracting the unit from time.Duration.String +var unitRegexp = regexp.MustCompile("[^\\d]+$") + +// a helper that turns a time.Duration into librato display attributes for timer metrics +func translateTimerAttributes(d time.Duration) (attrs map[string]interface{}) { + attrs = make(map[string]interface{}) + attrs[DisplayTransform] = fmt.Sprintf("x/%d", int64(d)) + attrs[DisplayUnitsShort] = string(unitRegexp.Find([]byte(d.String()))) + return +} + +type Reporter struct { + Email, Token string + Namespace string + Source string + Interval time.Duration + Registry metrics.Registry + Percentiles []float64 // percentiles to report on histogram metrics + TimerAttributes map[string]interface{} // units in which timers will be displayed + intervalSec int64 +} + +func NewReporter(r metrics.Registry, d time.Duration, e string, t string, s string, p []float64, u time.Duration) *Reporter { + return &Reporter{e, t, "", s, d, r, p, translateTimerAttributes(u), int64(d / time.Second)} +} + +func Librato(r metrics.Registry, d time.Duration, e string, t string, s string, p []float64, u time.Duration) { + NewReporter(r, d, e, t, s, p, u).Run() +} + +func (self *Reporter) Run() { + log.Printf("WARNING: This client has been DEPRECATED! It has been moved to https://github.com/mihasya/go-metrics-librato and will be removed from rcrowley/go-metrics on August 5th 2015") + ticker := time.Tick(self.Interval) + metricsApi := &LibratoClient{self.Email, self.Token} + for now := range ticker { + var metrics Batch + var err error + if metrics, err = self.BuildRequest(now, self.Registry); err != nil { + log.Printf("ERROR constructing librato request body %s", err) + continue + } + if err := metricsApi.PostMetrics(metrics); err != nil { + log.Printf("ERROR sending metrics to librato %s", err) + continue + } + } +} + +// calculate sum of squares from data provided by metrics.Histogram +// see http://en.wikipedia.org/wiki/Standard_deviation#Rapid_calculation_methods +func sumSquares(s metrics.Sample) float64 { + count := float64(s.Count()) + sumSquared := math.Pow(count*s.Mean(), 2) + sumSquares := math.Pow(count*s.StdDev(), 2) + sumSquared/count + if math.IsNaN(sumSquares) { + return 0.0 + } + return sumSquares +} +func sumSquaresTimer(t metrics.Timer) float64 { + count := float64(t.Count()) + sumSquared := math.Pow(count*t.Mean(), 2) + sumSquares := math.Pow(count*t.StdDev(), 2) + sumSquared/count + if math.IsNaN(sumSquares) { + return 0.0 + } + return sumSquares +} + +func (self *Reporter) BuildRequest(now time.Time, r metrics.Registry) (snapshot Batch, err error) { + snapshot = Batch{ + // coerce timestamps to a stepping fn so that they line up in Librato graphs + MeasureTime: (now.Unix() / self.intervalSec) * self.intervalSec, + Source: self.Source, + } + snapshot.Gauges = make([]Measurement, 0) + snapshot.Counters = make([]Measurement, 0) + histogramGaugeCount := 1 + len(self.Percentiles) + r.Each(func(name string, metric interface{}) { + if self.Namespace != "" { + name = fmt.Sprintf("%s.%s", self.Namespace, name) + } + measurement := Measurement{} + measurement[Period] = self.Interval.Seconds() + switch m := metric.(type) { + case metrics.Counter: + if m.Count() > 0 { + measurement[Name] = fmt.Sprintf("%s.%s", name, "count") + measurement[Value] = float64(m.Count()) + measurement[Attributes] = map[string]interface{}{ + DisplayUnitsLong: Operations, + DisplayUnitsShort: OperationsShort, + DisplayMin: "0", + } + snapshot.Counters = append(snapshot.Counters, measurement) + } + case metrics.Gauge: + measurement[Name] = name + measurement[Value] = float64(m.Value()) + snapshot.Gauges = append(snapshot.Gauges, measurement) + case metrics.GaugeFloat64: + measurement[Name] = name + measurement[Value] = float64(m.Value()) + snapshot.Gauges = append(snapshot.Gauges, measurement) + case metrics.Histogram: + if m.Count() > 0 { + gauges := make([]Measurement, histogramGaugeCount, histogramGaugeCount) + s := m.Sample() + measurement[Name] = fmt.Sprintf("%s.%s", name, "hist") + measurement[Count] = uint64(s.Count()) + measurement[Max] = float64(s.Max()) + measurement[Min] = float64(s.Min()) + measurement[Sum] = float64(s.Sum()) + measurement[SumSquares] = sumSquares(s) + gauges[0] = measurement + for i, p := range self.Percentiles { + gauges[i+1] = Measurement{ + Name: fmt.Sprintf("%s.%.2f", measurement[Name], p), + Value: s.Percentile(p), + Period: measurement[Period], + } + } + snapshot.Gauges = append(snapshot.Gauges, gauges...) + } + case metrics.Meter: + measurement[Name] = name + measurement[Value] = float64(m.Count()) + snapshot.Counters = append(snapshot.Counters, measurement) + snapshot.Gauges = append(snapshot.Gauges, + Measurement{ + Name: fmt.Sprintf("%s.%s", name, "1min"), + Value: m.Rate1(), + Period: int64(self.Interval.Seconds()), + Attributes: map[string]interface{}{ + DisplayUnitsLong: Operations, + DisplayUnitsShort: OperationsShort, + DisplayMin: "0", + }, + }, + Measurement{ + Name: fmt.Sprintf("%s.%s", name, "5min"), + Value: m.Rate5(), + Period: int64(self.Interval.Seconds()), + Attributes: map[string]interface{}{ + DisplayUnitsLong: Operations, + DisplayUnitsShort: OperationsShort, + DisplayMin: "0", + }, + }, + Measurement{ + Name: fmt.Sprintf("%s.%s", name, "15min"), + Value: m.Rate15(), + Period: int64(self.Interval.Seconds()), + Attributes: map[string]interface{}{ + DisplayUnitsLong: Operations, + DisplayUnitsShort: OperationsShort, + DisplayMin: "0", + }, + }, + ) + case metrics.Timer: + measurement[Name] = name + measurement[Value] = float64(m.Count()) + snapshot.Counters = append(snapshot.Counters, measurement) + if m.Count() > 0 { + libratoName := fmt.Sprintf("%s.%s", name, "timer.mean") + gauges := make([]Measurement, histogramGaugeCount, histogramGaugeCount) + gauges[0] = Measurement{ + Name: libratoName, + Count: uint64(m.Count()), + Sum: m.Mean() * float64(m.Count()), + Max: float64(m.Max()), + Min: float64(m.Min()), + SumSquares: sumSquaresTimer(m), + Period: int64(self.Interval.Seconds()), + Attributes: self.TimerAttributes, + } + for i, p := range self.Percentiles { + gauges[i+1] = Measurement{ + Name: fmt.Sprintf("%s.timer.%2.0f", name, p*100), + Value: m.Percentile(p), + Period: int64(self.Interval.Seconds()), + Attributes: self.TimerAttributes, + } + } + snapshot.Gauges = append(snapshot.Gauges, gauges...) + snapshot.Gauges = append(snapshot.Gauges, + Measurement{ + Name: fmt.Sprintf("%s.%s", name, "rate.1min"), + Value: m.Rate1(), + Period: int64(self.Interval.Seconds()), + Attributes: map[string]interface{}{ + DisplayUnitsLong: Operations, + DisplayUnitsShort: OperationsShort, + DisplayMin: "0", + }, + }, + Measurement{ + Name: fmt.Sprintf("%s.%s", name, "rate.5min"), + Value: m.Rate5(), + Period: int64(self.Interval.Seconds()), + Attributes: map[string]interface{}{ + DisplayUnitsLong: Operations, + DisplayUnitsShort: OperationsShort, + DisplayMin: "0", + }, + }, + Measurement{ + Name: fmt.Sprintf("%s.%s", name, "rate.15min"), + Value: m.Rate15(), + Period: int64(self.Interval.Seconds()), + Attributes: map[string]interface{}{ + DisplayUnitsLong: Operations, + DisplayUnitsShort: OperationsShort, + DisplayMin: "0", + }, + }, + ) + } + } + }) + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/log.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/log.go new file mode 100644 index 00000000..f8074c04 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/log.go @@ -0,0 +1,80 @@ +package metrics + +import ( + "time" +) + +type Logger interface { + Printf(format string, v ...interface{}) +} + +func Log(r Registry, freq time.Duration, l Logger) { + LogScaled(r, freq, time.Nanosecond, l) +} + +// Output each metric in the given registry periodically using the given +// logger. Print timings in `scale` units (eg time.Millisecond) rather than nanos. +func LogScaled(r Registry, freq time.Duration, scale time.Duration, l Logger) { + du := float64(scale) + duSuffix := scale.String()[1:] + + for _ = range time.Tick(freq) { + r.Each(func(name string, i interface{}) { + switch metric := i.(type) { + case Counter: + l.Printf("counter %s\n", name) + l.Printf(" count: %9d\n", metric.Count()) + case Gauge: + l.Printf("gauge %s\n", name) + l.Printf(" value: %9d\n", metric.Value()) + case GaugeFloat64: + l.Printf("gauge %s\n", name) + l.Printf(" value: %f\n", metric.Value()) + case Healthcheck: + metric.Check() + l.Printf("healthcheck %s\n", name) + l.Printf(" error: %v\n", metric.Error()) + case Histogram: + h := metric.Snapshot() + ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + l.Printf("histogram %s\n", name) + l.Printf(" count: %9d\n", h.Count()) + l.Printf(" min: %9d\n", h.Min()) + l.Printf(" max: %9d\n", h.Max()) + l.Printf(" mean: %12.2f\n", h.Mean()) + l.Printf(" stddev: %12.2f\n", h.StdDev()) + l.Printf(" median: %12.2f\n", ps[0]) + l.Printf(" 75%%: %12.2f\n", ps[1]) + l.Printf(" 95%%: %12.2f\n", ps[2]) + l.Printf(" 99%%: %12.2f\n", ps[3]) + l.Printf(" 99.9%%: %12.2f\n", ps[4]) + case Meter: + m := metric.Snapshot() + l.Printf("meter %s\n", name) + l.Printf(" count: %9d\n", m.Count()) + l.Printf(" 1-min rate: %12.2f\n", m.Rate1()) + l.Printf(" 5-min rate: %12.2f\n", m.Rate5()) + l.Printf(" 15-min rate: %12.2f\n", m.Rate15()) + l.Printf(" mean rate: %12.2f\n", m.RateMean()) + case Timer: + t := metric.Snapshot() + ps := t.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + l.Printf("timer %s\n", name) + l.Printf(" count: %9d\n", t.Count()) + l.Printf(" min: %12.2f%s\n", float64(t.Min())/du, duSuffix) + l.Printf(" max: %12.2f%s\n", float64(t.Max())/du, duSuffix) + l.Printf(" mean: %12.2f%s\n", t.Mean()/du, duSuffix) + l.Printf(" stddev: %12.2f%s\n", t.StdDev()/du, duSuffix) + l.Printf(" median: %12.2f%s\n", ps[0]/du, duSuffix) + l.Printf(" 75%%: %12.2f%s\n", ps[1]/du, duSuffix) + l.Printf(" 95%%: %12.2f%s\n", ps[2]/du, duSuffix) + l.Printf(" 99%%: %12.2f%s\n", ps[3]/du, duSuffix) + l.Printf(" 99.9%%: %12.2f%s\n", ps[4]/du, duSuffix) + l.Printf(" 1-min rate: %12.2f\n", t.Rate1()) + l.Printf(" 5-min rate: %12.2f\n", t.Rate5()) + l.Printf(" 15-min rate: %12.2f\n", t.Rate15()) + l.Printf(" mean rate: %12.2f\n", t.RateMean()) + } + }) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/memory.md b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/memory.md new file mode 100644 index 00000000..47454f54 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/memory.md @@ -0,0 +1,285 @@ +Memory usage +============ + +(Highly unscientific.) + +Command used to gather static memory usage: + +```sh +grep ^Vm "/proc/$(ps fax | grep [m]etrics-bench | awk '{print $1}')/status" +``` + +Program used to gather baseline memory usage: + +```go +package main + +import "time" + +func main() { + time.Sleep(600e9) +} +``` + +Baseline +-------- + +``` +VmPeak: 42604 kB +VmSize: 42604 kB +VmLck: 0 kB +VmHWM: 1120 kB +VmRSS: 1120 kB +VmData: 35460 kB +VmStk: 136 kB +VmExe: 1020 kB +VmLib: 1848 kB +VmPTE: 36 kB +VmSwap: 0 kB +``` + +Program used to gather metric memory usage (with other metrics being similar): + +```go +package main + +import ( + "fmt" + "metrics" + "time" +) + +func main() { + fmt.Sprintf("foo") + metrics.NewRegistry() + time.Sleep(600e9) +} +``` + +1000 counters registered +------------------------ + +``` +VmPeak: 44016 kB +VmSize: 44016 kB +VmLck: 0 kB +VmHWM: 1928 kB +VmRSS: 1928 kB +VmData: 36868 kB +VmStk: 136 kB +VmExe: 1024 kB +VmLib: 1848 kB +VmPTE: 40 kB +VmSwap: 0 kB +``` + +**1.412 kB virtual, TODO 0.808 kB resident per counter.** + +100000 counters registered +-------------------------- + +``` +VmPeak: 55024 kB +VmSize: 55024 kB +VmLck: 0 kB +VmHWM: 12440 kB +VmRSS: 12440 kB +VmData: 47876 kB +VmStk: 136 kB +VmExe: 1024 kB +VmLib: 1848 kB +VmPTE: 64 kB +VmSwap: 0 kB +``` + +**0.1242 kB virtual, 0.1132 kB resident per counter.** + +1000 gauges registered +---------------------- + +``` +VmPeak: 44012 kB +VmSize: 44012 kB +VmLck: 0 kB +VmHWM: 1928 kB +VmRSS: 1928 kB +VmData: 36868 kB +VmStk: 136 kB +VmExe: 1020 kB +VmLib: 1848 kB +VmPTE: 40 kB +VmSwap: 0 kB +``` + +**1.408 kB virtual, 0.808 kB resident per counter.** + +100000 gauges registered +------------------------ + +``` +VmPeak: 55020 kB +VmSize: 55020 kB +VmLck: 0 kB +VmHWM: 12432 kB +VmRSS: 12432 kB +VmData: 47876 kB +VmStk: 136 kB +VmExe: 1020 kB +VmLib: 1848 kB +VmPTE: 60 kB +VmSwap: 0 kB +``` + +**0.12416 kB virtual, 0.11312 resident per gauge.** + +1000 histograms with a uniform sample size of 1028 +-------------------------------------------------- + +``` +VmPeak: 72272 kB +VmSize: 72272 kB +VmLck: 0 kB +VmHWM: 16204 kB +VmRSS: 16204 kB +VmData: 65100 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 80 kB +VmSwap: 0 kB +``` + +**29.668 kB virtual, TODO 15.084 resident per histogram.** + +10000 histograms with a uniform sample size of 1028 +--------------------------------------------------- + +``` +VmPeak: 256912 kB +VmSize: 256912 kB +VmLck: 0 kB +VmHWM: 146204 kB +VmRSS: 146204 kB +VmData: 249740 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 448 kB +VmSwap: 0 kB +``` + +**21.4308 kB virtual, 14.5084 kB resident per histogram.** + +50000 histograms with a uniform sample size of 1028 +--------------------------------------------------- + +``` +VmPeak: 908112 kB +VmSize: 908112 kB +VmLck: 0 kB +VmHWM: 645832 kB +VmRSS: 645588 kB +VmData: 900940 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 1716 kB +VmSwap: 1544 kB +``` + +**17.31016 kB virtual, 12.88936 kB resident per histogram.** + +1000 histograms with an exponentially-decaying sample size of 1028 and alpha of 0.015 +------------------------------------------------------------------------------------- + +``` +VmPeak: 62480 kB +VmSize: 62480 kB +VmLck: 0 kB +VmHWM: 11572 kB +VmRSS: 11572 kB +VmData: 55308 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 64 kB +VmSwap: 0 kB +``` + +**19.876 kB virtual, 10.452 kB resident per histogram.** + +10000 histograms with an exponentially-decaying sample size of 1028 and alpha of 0.015 +-------------------------------------------------------------------------------------- + +``` +VmPeak: 153296 kB +VmSize: 153296 kB +VmLck: 0 kB +VmHWM: 101176 kB +VmRSS: 101176 kB +VmData: 146124 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 240 kB +VmSwap: 0 kB +``` + +**11.0692 kB virtual, 10.0056 kB resident per histogram.** + +50000 histograms with an exponentially-decaying sample size of 1028 and alpha of 0.015 +-------------------------------------------------------------------------------------- + +``` +VmPeak: 557264 kB +VmSize: 557264 kB +VmLck: 0 kB +VmHWM: 501056 kB +VmRSS: 501056 kB +VmData: 550092 kB +VmStk: 136 kB +VmExe: 1048 kB +VmLib: 1848 kB +VmPTE: 1032 kB +VmSwap: 0 kB +``` + +**10.2932 kB virtual, 9.99872 kB resident per histogram.** + +1000 meters +----------- + +``` +VmPeak: 74504 kB +VmSize: 74504 kB +VmLck: 0 kB +VmHWM: 24124 kB +VmRSS: 24124 kB +VmData: 67340 kB +VmStk: 136 kB +VmExe: 1040 kB +VmLib: 1848 kB +VmPTE: 92 kB +VmSwap: 0 kB +``` + +**31.9 kB virtual, 23.004 kB resident per meter.** + +10000 meters +------------ + +``` +VmPeak: 278920 kB +VmSize: 278920 kB +VmLck: 0 kB +VmHWM: 227300 kB +VmRSS: 227300 kB +VmData: 271756 kB +VmStk: 136 kB +VmExe: 1040 kB +VmLib: 1848 kB +VmPTE: 488 kB +VmSwap: 0 kB +``` + +**23.6316 kB virtual, 22.618 kB resident per meter.** diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/meter.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/meter.go new file mode 100644 index 00000000..0389ab0b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/meter.go @@ -0,0 +1,233 @@ +package metrics + +import ( + "sync" + "time" +) + +// Meters count events to produce exponentially-weighted moving average rates +// at one-, five-, and fifteen-minutes and a mean rate. +type Meter interface { + Count() int64 + Mark(int64) + Rate1() float64 + Rate5() float64 + Rate15() float64 + RateMean() float64 + Snapshot() Meter +} + +// GetOrRegisterMeter returns an existing Meter or constructs and registers a +// new StandardMeter. +func GetOrRegisterMeter(name string, r Registry) Meter { + if nil == r { + r = DefaultRegistry + } + return r.GetOrRegister(name, NewMeter).(Meter) +} + +// NewMeter constructs a new StandardMeter and launches a goroutine. +func NewMeter() Meter { + if UseNilMetrics { + return NilMeter{} + } + m := newStandardMeter() + arbiter.Lock() + defer arbiter.Unlock() + arbiter.meters = append(arbiter.meters, m) + if !arbiter.started { + arbiter.started = true + go arbiter.tick() + } + return m +} + +// NewMeter constructs and registers a new StandardMeter and launches a +// goroutine. +func NewRegisteredMeter(name string, r Registry) Meter { + c := NewMeter() + if nil == r { + r = DefaultRegistry + } + r.Register(name, c) + return c +} + +// MeterSnapshot is a read-only copy of another Meter. +type MeterSnapshot struct { + count int64 + rate1, rate5, rate15, rateMean float64 +} + +// Count returns the count of events at the time the snapshot was taken. +func (m *MeterSnapshot) Count() int64 { return m.count } + +// Mark panics. +func (*MeterSnapshot) Mark(n int64) { + panic("Mark called on a MeterSnapshot") +} + +// Rate1 returns the one-minute moving average rate of events per second at the +// time the snapshot was taken. +func (m *MeterSnapshot) Rate1() float64 { return m.rate1 } + +// Rate5 returns the five-minute moving average rate of events per second at +// the time the snapshot was taken. +func (m *MeterSnapshot) Rate5() float64 { return m.rate5 } + +// Rate15 returns the fifteen-minute moving average rate of events per second +// at the time the snapshot was taken. +func (m *MeterSnapshot) Rate15() float64 { return m.rate15 } + +// RateMean returns the meter's mean rate of events per second at the time the +// snapshot was taken. +func (m *MeterSnapshot) RateMean() float64 { return m.rateMean } + +// Snapshot returns the snapshot. +func (m *MeterSnapshot) Snapshot() Meter { return m } + +// NilMeter is a no-op Meter. +type NilMeter struct{} + +// Count is a no-op. +func (NilMeter) Count() int64 { return 0 } + +// Mark is a no-op. +func (NilMeter) Mark(n int64) {} + +// Rate1 is a no-op. +func (NilMeter) Rate1() float64 { return 0.0 } + +// Rate5 is a no-op. +func (NilMeter) Rate5() float64 { return 0.0 } + +// Rate15is a no-op. +func (NilMeter) Rate15() float64 { return 0.0 } + +// RateMean is a no-op. +func (NilMeter) RateMean() float64 { return 0.0 } + +// Snapshot is a no-op. +func (NilMeter) Snapshot() Meter { return NilMeter{} } + +// StandardMeter is the standard implementation of a Meter. +type StandardMeter struct { + lock sync.RWMutex + snapshot *MeterSnapshot + a1, a5, a15 EWMA + startTime time.Time +} + +func newStandardMeter() *StandardMeter { + return &StandardMeter{ + snapshot: &MeterSnapshot{}, + a1: NewEWMA1(), + a5: NewEWMA5(), + a15: NewEWMA15(), + startTime: time.Now(), + } +} + +// Count returns the number of events recorded. +func (m *StandardMeter) Count() int64 { + m.lock.RLock() + count := m.snapshot.count + m.lock.RUnlock() + return count +} + +// Mark records the occurance of n events. +func (m *StandardMeter) Mark(n int64) { + m.lock.Lock() + defer m.lock.Unlock() + m.snapshot.count += n + m.a1.Update(n) + m.a5.Update(n) + m.a15.Update(n) + m.updateSnapshot() +} + +// Rate1 returns the one-minute moving average rate of events per second. +func (m *StandardMeter) Rate1() float64 { + m.lock.RLock() + rate1 := m.snapshot.rate1 + m.lock.RUnlock() + return rate1 +} + +// Rate5 returns the five-minute moving average rate of events per second. +func (m *StandardMeter) Rate5() float64 { + m.lock.RLock() + rate5 := m.snapshot.rate5 + m.lock.RUnlock() + return rate5 +} + +// Rate15 returns the fifteen-minute moving average rate of events per second. +func (m *StandardMeter) Rate15() float64 { + m.lock.RLock() + rate15 := m.snapshot.rate15 + m.lock.RUnlock() + return rate15 +} + +// RateMean returns the meter's mean rate of events per second. +func (m *StandardMeter) RateMean() float64 { + m.lock.RLock() + rateMean := m.snapshot.rateMean + m.lock.RUnlock() + return rateMean +} + +// Snapshot returns a read-only copy of the meter. +func (m *StandardMeter) Snapshot() Meter { + m.lock.RLock() + snapshot := *m.snapshot + m.lock.RUnlock() + return &snapshot +} + +func (m *StandardMeter) updateSnapshot() { + // should run with write lock held on m.lock + snapshot := m.snapshot + snapshot.rate1 = m.a1.Rate() + snapshot.rate5 = m.a5.Rate() + snapshot.rate15 = m.a15.Rate() + snapshot.rateMean = float64(snapshot.count) / time.Since(m.startTime).Seconds() +} + +func (m *StandardMeter) tick() { + m.lock.Lock() + defer m.lock.Unlock() + m.a1.Tick() + m.a5.Tick() + m.a15.Tick() + m.updateSnapshot() +} + +type meterArbiter struct { + sync.RWMutex + started bool + meters []*StandardMeter + ticker *time.Ticker +} + +var arbiter = meterArbiter{ticker: time.NewTicker(5e9)} + +// Ticks meters on the scheduled interval +func (ma *meterArbiter) tick() { + for { + select { + case <-ma.ticker.C: + ma.tickMeters() + } + } +} + +func (ma *meterArbiter) tickMeters() { + ma.RLock() + defer ma.RUnlock() + for _, meter := range ma.meters { + meter.tick() + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/metrics.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/metrics.go new file mode 100644 index 00000000..b97a49ed --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/metrics.go @@ -0,0 +1,13 @@ +// Go port of Coda Hale's Metrics library +// +// +// +// Coda Hale's original work: +package metrics + +// UseNilMetrics is checked by the constructor functions for all of the +// standard metrics. If it is true, the metric returned is a stub. +// +// This global kill-switch helps quantify the observer effect and makes +// for less cluttered pprof profiles. +var UseNilMetrics bool = false diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/opentsdb.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/opentsdb.go new file mode 100644 index 00000000..266b6c93 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/opentsdb.go @@ -0,0 +1,119 @@ +package metrics + +import ( + "bufio" + "fmt" + "log" + "net" + "os" + "strings" + "time" +) + +var shortHostName string = "" + +// OpenTSDBConfig provides a container with configuration parameters for +// the OpenTSDB exporter +type OpenTSDBConfig struct { + Addr *net.TCPAddr // Network address to connect to + Registry Registry // Registry to be exported + FlushInterval time.Duration // Flush interval + DurationUnit time.Duration // Time conversion unit for durations + Prefix string // Prefix to be prepended to metric names +} + +// OpenTSDB is a blocking exporter function which reports metrics in r +// to a TSDB server located at addr, flushing them every d duration +// and prepending metric names with prefix. +func OpenTSDB(r Registry, d time.Duration, prefix string, addr *net.TCPAddr) { + OpenTSDBWithConfig(OpenTSDBConfig{ + Addr: addr, + Registry: r, + FlushInterval: d, + DurationUnit: time.Nanosecond, + Prefix: prefix, + }) +} + +// OpenTSDBWithConfig is a blocking exporter function just like OpenTSDB, +// but it takes a OpenTSDBConfig instead. +func OpenTSDBWithConfig(c OpenTSDBConfig) { + for _ = range time.Tick(c.FlushInterval) { + if err := openTSDB(&c); nil != err { + log.Println(err) + } + } +} + +func getShortHostname() string { + if shortHostName == "" { + host, _ := os.Hostname() + if index := strings.Index(host, "."); index > 0 { + shortHostName = host[:index] + } else { + shortHostName = host + } + } + return shortHostName +} + +func openTSDB(c *OpenTSDBConfig) error { + shortHostname := getShortHostname() + now := time.Now().Unix() + du := float64(c.DurationUnit) + conn, err := net.DialTCP("tcp", nil, c.Addr) + if nil != err { + return err + } + defer conn.Close() + w := bufio.NewWriter(conn) + c.Registry.Each(func(name string, i interface{}) { + switch metric := i.(type) { + case Counter: + fmt.Fprintf(w, "put %s.%s.count %d %d host=%s\n", c.Prefix, name, now, metric.Count(), shortHostname) + case Gauge: + fmt.Fprintf(w, "put %s.%s.value %d %d host=%s\n", c.Prefix, name, now, metric.Value(), shortHostname) + case GaugeFloat64: + fmt.Fprintf(w, "put %s.%s.value %d %f host=%s\n", c.Prefix, name, now, metric.Value(), shortHostname) + case Histogram: + h := metric.Snapshot() + ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + fmt.Fprintf(w, "put %s.%s.count %d %d host=%s\n", c.Prefix, name, now, h.Count(), shortHostname) + fmt.Fprintf(w, "put %s.%s.min %d %d host=%s\n", c.Prefix, name, now, h.Min(), shortHostname) + fmt.Fprintf(w, "put %s.%s.max %d %d host=%s\n", c.Prefix, name, now, h.Max(), shortHostname) + fmt.Fprintf(w, "put %s.%s.mean %d %.2f host=%s\n", c.Prefix, name, now, h.Mean(), shortHostname) + fmt.Fprintf(w, "put %s.%s.std-dev %d %.2f host=%s\n", c.Prefix, name, now, h.StdDev(), shortHostname) + fmt.Fprintf(w, "put %s.%s.50-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[0], shortHostname) + fmt.Fprintf(w, "put %s.%s.75-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[1], shortHostname) + fmt.Fprintf(w, "put %s.%s.95-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[2], shortHostname) + fmt.Fprintf(w, "put %s.%s.99-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[3], shortHostname) + fmt.Fprintf(w, "put %s.%s.999-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[4], shortHostname) + case Meter: + m := metric.Snapshot() + fmt.Fprintf(w, "put %s.%s.count %d %d host=%s\n", c.Prefix, name, now, m.Count(), shortHostname) + fmt.Fprintf(w, "put %s.%s.one-minute %d %.2f host=%s\n", c.Prefix, name, now, m.Rate1(), shortHostname) + fmt.Fprintf(w, "put %s.%s.five-minute %d %.2f host=%s\n", c.Prefix, name, now, m.Rate5(), shortHostname) + fmt.Fprintf(w, "put %s.%s.fifteen-minute %d %.2f host=%s\n", c.Prefix, name, now, m.Rate15(), shortHostname) + fmt.Fprintf(w, "put %s.%s.mean %d %.2f host=%s\n", c.Prefix, name, now, m.RateMean(), shortHostname) + case Timer: + t := metric.Snapshot() + ps := t.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + fmt.Fprintf(w, "put %s.%s.count %d %d host=%s\n", c.Prefix, name, now, t.Count(), shortHostname) + fmt.Fprintf(w, "put %s.%s.min %d %d host=%s\n", c.Prefix, name, now, t.Min()/int64(du), shortHostname) + fmt.Fprintf(w, "put %s.%s.max %d %d host=%s\n", c.Prefix, name, now, t.Max()/int64(du), shortHostname) + fmt.Fprintf(w, "put %s.%s.mean %d %.2f host=%s\n", c.Prefix, name, now, t.Mean()/du, shortHostname) + fmt.Fprintf(w, "put %s.%s.std-dev %d %.2f host=%s\n", c.Prefix, name, now, t.StdDev()/du, shortHostname) + fmt.Fprintf(w, "put %s.%s.50-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[0]/du, shortHostname) + fmt.Fprintf(w, "put %s.%s.75-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[1]/du, shortHostname) + fmt.Fprintf(w, "put %s.%s.95-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[2]/du, shortHostname) + fmt.Fprintf(w, "put %s.%s.99-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[3]/du, shortHostname) + fmt.Fprintf(w, "put %s.%s.999-percentile %d %.2f host=%s\n", c.Prefix, name, now, ps[4]/du, shortHostname) + fmt.Fprintf(w, "put %s.%s.one-minute %d %.2f host=%s\n", c.Prefix, name, now, t.Rate1(), shortHostname) + fmt.Fprintf(w, "put %s.%s.five-minute %d %.2f host=%s\n", c.Prefix, name, now, t.Rate5(), shortHostname) + fmt.Fprintf(w, "put %s.%s.fifteen-minute %d %.2f host=%s\n", c.Prefix, name, now, t.Rate15(), shortHostname) + fmt.Fprintf(w, "put %s.%s.mean-rate %d %.2f host=%s\n", c.Prefix, name, now, t.RateMean(), shortHostname) + } + w.Flush() + }) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/registry.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/registry.go new file mode 100644 index 00000000..9086dcbd --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/registry.go @@ -0,0 +1,270 @@ +package metrics + +import ( + "fmt" + "reflect" + "strings" + "sync" +) + +// DuplicateMetric is the error returned by Registry.Register when a metric +// already exists. If you mean to Register that metric you must first +// Unregister the existing metric. +type DuplicateMetric string + +func (err DuplicateMetric) Error() string { + return fmt.Sprintf("duplicate metric: %s", string(err)) +} + +// A Registry holds references to a set of metrics by name and can iterate +// over them, calling callback functions provided by the user. +// +// This is an interface so as to encourage other structs to implement +// the Registry API as appropriate. +type Registry interface { + + // Call the given function for each registered metric. + Each(func(string, interface{})) + + // Get the metric by the given name or nil if none is registered. + Get(string) interface{} + + // Gets an existing metric or registers the given one. + // The interface can be the metric to register if not found in registry, + // or a function returning the metric for lazy instantiation. + GetOrRegister(string, interface{}) interface{} + + // Register the given metric under the given name. + Register(string, interface{}) error + + // Run all registered healthchecks. + RunHealthchecks() + + // Unregister the metric with the given name. + Unregister(string) + + // Unregister all metrics. (Mostly for testing.) + UnregisterAll() +} + +// The standard implementation of a Registry is a mutex-protected map +// of names to metrics. +type StandardRegistry struct { + metrics map[string]interface{} + mutex sync.Mutex +} + +// Create a new registry. +func NewRegistry() Registry { + return &StandardRegistry{metrics: make(map[string]interface{})} +} + +// Call the given function for each registered metric. +func (r *StandardRegistry) Each(f func(string, interface{})) { + for name, i := range r.registered() { + f(name, i) + } +} + +// Get the metric by the given name or nil if none is registered. +func (r *StandardRegistry) Get(name string) interface{} { + r.mutex.Lock() + defer r.mutex.Unlock() + return r.metrics[name] +} + +// Gets an existing metric or creates and registers a new one. Threadsafe +// alternative to calling Get and Register on failure. +// The interface can be the metric to register if not found in registry, +// or a function returning the metric for lazy instantiation. +func (r *StandardRegistry) GetOrRegister(name string, i interface{}) interface{} { + r.mutex.Lock() + defer r.mutex.Unlock() + if metric, ok := r.metrics[name]; ok { + return metric + } + if v := reflect.ValueOf(i); v.Kind() == reflect.Func { + i = v.Call(nil)[0].Interface() + } + r.register(name, i) + return i +} + +// Register the given metric under the given name. Returns a DuplicateMetric +// if a metric by the given name is already registered. +func (r *StandardRegistry) Register(name string, i interface{}) error { + r.mutex.Lock() + defer r.mutex.Unlock() + return r.register(name, i) +} + +// Run all registered healthchecks. +func (r *StandardRegistry) RunHealthchecks() { + r.mutex.Lock() + defer r.mutex.Unlock() + for _, i := range r.metrics { + if h, ok := i.(Healthcheck); ok { + h.Check() + } + } +} + +// Unregister the metric with the given name. +func (r *StandardRegistry) Unregister(name string) { + r.mutex.Lock() + defer r.mutex.Unlock() + delete(r.metrics, name) +} + +// Unregister all metrics. (Mostly for testing.) +func (r *StandardRegistry) UnregisterAll() { + r.mutex.Lock() + defer r.mutex.Unlock() + for name, _ := range r.metrics { + delete(r.metrics, name) + } +} + +func (r *StandardRegistry) register(name string, i interface{}) error { + if _, ok := r.metrics[name]; ok { + return DuplicateMetric(name) + } + switch i.(type) { + case Counter, Gauge, GaugeFloat64, Healthcheck, Histogram, Meter, Timer: + r.metrics[name] = i + } + return nil +} + +func (r *StandardRegistry) registered() map[string]interface{} { + r.mutex.Lock() + defer r.mutex.Unlock() + metrics := make(map[string]interface{}, len(r.metrics)) + for name, i := range r.metrics { + metrics[name] = i + } + return metrics +} + +type PrefixedRegistry struct { + underlying Registry + prefix string +} + +func NewPrefixedRegistry(prefix string) Registry { + return &PrefixedRegistry{ + underlying: NewRegistry(), + prefix: prefix, + } +} + +func NewPrefixedChildRegistry(parent Registry, prefix string) Registry { + return &PrefixedRegistry{ + underlying: parent, + prefix: prefix, + } +} + +// Call the given function for each registered metric. +func (r *PrefixedRegistry) Each(fn func(string, interface{})) { + wrappedFn := func (prefix string) func(string, interface{}) { + return func(name string, iface interface{}) { + if strings.HasPrefix(name,prefix) { + fn(name, iface) + } else { + return + } + } + } + + baseRegistry, prefix := findPrefix(r, "") + baseRegistry.Each(wrappedFn(prefix)) +} + +func findPrefix(registry Registry, prefix string) (Registry, string) { + switch r := registry.(type) { + case *PrefixedRegistry: + return findPrefix(r.underlying, r.prefix + prefix) + case *StandardRegistry: + return r, prefix + } + return nil, "" +} + +// Get the metric by the given name or nil if none is registered. +func (r *PrefixedRegistry) Get(name string) interface{} { + realName := r.prefix + name + return r.underlying.Get(realName) +} + +// Gets an existing metric or registers the given one. +// The interface can be the metric to register if not found in registry, +// or a function returning the metric for lazy instantiation. +func (r *PrefixedRegistry) GetOrRegister(name string, metric interface{}) interface{} { + realName := r.prefix + name + return r.underlying.GetOrRegister(realName, metric) +} + +// Register the given metric under the given name. The name will be prefixed. +func (r *PrefixedRegistry) Register(name string, metric interface{}) error { + realName := r.prefix + name + return r.underlying.Register(realName, metric) +} + +// Run all registered healthchecks. +func (r *PrefixedRegistry) RunHealthchecks() { + r.underlying.RunHealthchecks() +} + +// Unregister the metric with the given name. The name will be prefixed. +func (r *PrefixedRegistry) Unregister(name string) { + realName := r.prefix + name + r.underlying.Unregister(realName) +} + +// Unregister all metrics. (Mostly for testing.) +func (r *PrefixedRegistry) UnregisterAll() { + r.underlying.UnregisterAll() +} + +var DefaultRegistry Registry = NewRegistry() + +// Call the given function for each registered metric. +func Each(f func(string, interface{})) { + DefaultRegistry.Each(f) +} + +// Get the metric by the given name or nil if none is registered. +func Get(name string) interface{} { + return DefaultRegistry.Get(name) +} + +// Gets an existing metric or creates and registers a new one. Threadsafe +// alternative to calling Get and Register on failure. +func GetOrRegister(name string, i interface{}) interface{} { + return DefaultRegistry.GetOrRegister(name, i) +} + +// Register the given metric under the given name. Returns a DuplicateMetric +// if a metric by the given name is already registered. +func Register(name string, i interface{}) error { + return DefaultRegistry.Register(name, i) +} + +// Register the given metric under the given name. Panics if a metric by the +// given name is already registered. +func MustRegister(name string, i interface{}) { + if err := Register(name, i); err != nil { + panic(err) + } +} + +// Run all registered healthchecks. +func RunHealthchecks() { + DefaultRegistry.RunHealthchecks() +} + +// Unregister the metric with the given name. +func Unregister(name string) { + DefaultRegistry.Unregister(name) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime.go new file mode 100644 index 00000000..11c6b785 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime.go @@ -0,0 +1,212 @@ +package metrics + +import ( + "runtime" + "runtime/pprof" + "time" +) + +var ( + memStats runtime.MemStats + runtimeMetrics struct { + MemStats struct { + Alloc Gauge + BuckHashSys Gauge + DebugGC Gauge + EnableGC Gauge + Frees Gauge + HeapAlloc Gauge + HeapIdle Gauge + HeapInuse Gauge + HeapObjects Gauge + HeapReleased Gauge + HeapSys Gauge + LastGC Gauge + Lookups Gauge + Mallocs Gauge + MCacheInuse Gauge + MCacheSys Gauge + MSpanInuse Gauge + MSpanSys Gauge + NextGC Gauge + NumGC Gauge + GCCPUFraction GaugeFloat64 + PauseNs Histogram + PauseTotalNs Gauge + StackInuse Gauge + StackSys Gauge + Sys Gauge + TotalAlloc Gauge + } + NumCgoCall Gauge + NumGoroutine Gauge + NumThread Gauge + ReadMemStats Timer + } + frees uint64 + lookups uint64 + mallocs uint64 + numGC uint32 + numCgoCalls int64 + + threadCreateProfile = pprof.Lookup("threadcreate") +) + +// Capture new values for the Go runtime statistics exported in +// runtime.MemStats. This is designed to be called as a goroutine. +func CaptureRuntimeMemStats(r Registry, d time.Duration) { + for _ = range time.Tick(d) { + CaptureRuntimeMemStatsOnce(r) + } +} + +// Capture new values for the Go runtime statistics exported in +// runtime.MemStats. This is designed to be called in a background +// goroutine. Giving a registry which has not been given to +// RegisterRuntimeMemStats will panic. +// +// Be very careful with this because runtime.ReadMemStats calls the C +// functions runtime·semacquire(&runtime·worldsema) and runtime·stoptheworld() +// and that last one does what it says on the tin. +func CaptureRuntimeMemStatsOnce(r Registry) { + t := time.Now() + runtime.ReadMemStats(&memStats) // This takes 50-200us. + runtimeMetrics.ReadMemStats.UpdateSince(t) + + runtimeMetrics.MemStats.Alloc.Update(int64(memStats.Alloc)) + runtimeMetrics.MemStats.BuckHashSys.Update(int64(memStats.BuckHashSys)) + if memStats.DebugGC { + runtimeMetrics.MemStats.DebugGC.Update(1) + } else { + runtimeMetrics.MemStats.DebugGC.Update(0) + } + if memStats.EnableGC { + runtimeMetrics.MemStats.EnableGC.Update(1) + } else { + runtimeMetrics.MemStats.EnableGC.Update(0) + } + + runtimeMetrics.MemStats.Frees.Update(int64(memStats.Frees - frees)) + runtimeMetrics.MemStats.HeapAlloc.Update(int64(memStats.HeapAlloc)) + runtimeMetrics.MemStats.HeapIdle.Update(int64(memStats.HeapIdle)) + runtimeMetrics.MemStats.HeapInuse.Update(int64(memStats.HeapInuse)) + runtimeMetrics.MemStats.HeapObjects.Update(int64(memStats.HeapObjects)) + runtimeMetrics.MemStats.HeapReleased.Update(int64(memStats.HeapReleased)) + runtimeMetrics.MemStats.HeapSys.Update(int64(memStats.HeapSys)) + runtimeMetrics.MemStats.LastGC.Update(int64(memStats.LastGC)) + runtimeMetrics.MemStats.Lookups.Update(int64(memStats.Lookups - lookups)) + runtimeMetrics.MemStats.Mallocs.Update(int64(memStats.Mallocs - mallocs)) + runtimeMetrics.MemStats.MCacheInuse.Update(int64(memStats.MCacheInuse)) + runtimeMetrics.MemStats.MCacheSys.Update(int64(memStats.MCacheSys)) + runtimeMetrics.MemStats.MSpanInuse.Update(int64(memStats.MSpanInuse)) + runtimeMetrics.MemStats.MSpanSys.Update(int64(memStats.MSpanSys)) + runtimeMetrics.MemStats.NextGC.Update(int64(memStats.NextGC)) + runtimeMetrics.MemStats.NumGC.Update(int64(memStats.NumGC - numGC)) + runtimeMetrics.MemStats.GCCPUFraction.Update(gcCPUFraction(&memStats)) + + // + i := numGC % uint32(len(memStats.PauseNs)) + ii := memStats.NumGC % uint32(len(memStats.PauseNs)) + if memStats.NumGC-numGC >= uint32(len(memStats.PauseNs)) { + for i = 0; i < uint32(len(memStats.PauseNs)); i++ { + runtimeMetrics.MemStats.PauseNs.Update(int64(memStats.PauseNs[i])) + } + } else { + if i > ii { + for ; i < uint32(len(memStats.PauseNs)); i++ { + runtimeMetrics.MemStats.PauseNs.Update(int64(memStats.PauseNs[i])) + } + i = 0 + } + for ; i < ii; i++ { + runtimeMetrics.MemStats.PauseNs.Update(int64(memStats.PauseNs[i])) + } + } + frees = memStats.Frees + lookups = memStats.Lookups + mallocs = memStats.Mallocs + numGC = memStats.NumGC + + runtimeMetrics.MemStats.PauseTotalNs.Update(int64(memStats.PauseTotalNs)) + runtimeMetrics.MemStats.StackInuse.Update(int64(memStats.StackInuse)) + runtimeMetrics.MemStats.StackSys.Update(int64(memStats.StackSys)) + runtimeMetrics.MemStats.Sys.Update(int64(memStats.Sys)) + runtimeMetrics.MemStats.TotalAlloc.Update(int64(memStats.TotalAlloc)) + + currentNumCgoCalls := numCgoCall() + runtimeMetrics.NumCgoCall.Update(currentNumCgoCalls - numCgoCalls) + numCgoCalls = currentNumCgoCalls + + runtimeMetrics.NumGoroutine.Update(int64(runtime.NumGoroutine())) + + runtimeMetrics.NumThread.Update(int64(threadCreateProfile.Count())) +} + +// Register runtimeMetrics for the Go runtime statistics exported in runtime and +// specifically runtime.MemStats. The runtimeMetrics are named by their +// fully-qualified Go symbols, i.e. runtime.MemStats.Alloc. +func RegisterRuntimeMemStats(r Registry) { + runtimeMetrics.MemStats.Alloc = NewGauge() + runtimeMetrics.MemStats.BuckHashSys = NewGauge() + runtimeMetrics.MemStats.DebugGC = NewGauge() + runtimeMetrics.MemStats.EnableGC = NewGauge() + runtimeMetrics.MemStats.Frees = NewGauge() + runtimeMetrics.MemStats.HeapAlloc = NewGauge() + runtimeMetrics.MemStats.HeapIdle = NewGauge() + runtimeMetrics.MemStats.HeapInuse = NewGauge() + runtimeMetrics.MemStats.HeapObjects = NewGauge() + runtimeMetrics.MemStats.HeapReleased = NewGauge() + runtimeMetrics.MemStats.HeapSys = NewGauge() + runtimeMetrics.MemStats.LastGC = NewGauge() + runtimeMetrics.MemStats.Lookups = NewGauge() + runtimeMetrics.MemStats.Mallocs = NewGauge() + runtimeMetrics.MemStats.MCacheInuse = NewGauge() + runtimeMetrics.MemStats.MCacheSys = NewGauge() + runtimeMetrics.MemStats.MSpanInuse = NewGauge() + runtimeMetrics.MemStats.MSpanSys = NewGauge() + runtimeMetrics.MemStats.NextGC = NewGauge() + runtimeMetrics.MemStats.NumGC = NewGauge() + runtimeMetrics.MemStats.GCCPUFraction = NewGaugeFloat64() + runtimeMetrics.MemStats.PauseNs = NewHistogram(NewExpDecaySample(1028, 0.015)) + runtimeMetrics.MemStats.PauseTotalNs = NewGauge() + runtimeMetrics.MemStats.StackInuse = NewGauge() + runtimeMetrics.MemStats.StackSys = NewGauge() + runtimeMetrics.MemStats.Sys = NewGauge() + runtimeMetrics.MemStats.TotalAlloc = NewGauge() + runtimeMetrics.NumCgoCall = NewGauge() + runtimeMetrics.NumGoroutine = NewGauge() + runtimeMetrics.NumThread = NewGauge() + runtimeMetrics.ReadMemStats = NewTimer() + + r.Register("runtime.MemStats.Alloc", runtimeMetrics.MemStats.Alloc) + r.Register("runtime.MemStats.BuckHashSys", runtimeMetrics.MemStats.BuckHashSys) + r.Register("runtime.MemStats.DebugGC", runtimeMetrics.MemStats.DebugGC) + r.Register("runtime.MemStats.EnableGC", runtimeMetrics.MemStats.EnableGC) + r.Register("runtime.MemStats.Frees", runtimeMetrics.MemStats.Frees) + r.Register("runtime.MemStats.HeapAlloc", runtimeMetrics.MemStats.HeapAlloc) + r.Register("runtime.MemStats.HeapIdle", runtimeMetrics.MemStats.HeapIdle) + r.Register("runtime.MemStats.HeapInuse", runtimeMetrics.MemStats.HeapInuse) + r.Register("runtime.MemStats.HeapObjects", runtimeMetrics.MemStats.HeapObjects) + r.Register("runtime.MemStats.HeapReleased", runtimeMetrics.MemStats.HeapReleased) + r.Register("runtime.MemStats.HeapSys", runtimeMetrics.MemStats.HeapSys) + r.Register("runtime.MemStats.LastGC", runtimeMetrics.MemStats.LastGC) + r.Register("runtime.MemStats.Lookups", runtimeMetrics.MemStats.Lookups) + r.Register("runtime.MemStats.Mallocs", runtimeMetrics.MemStats.Mallocs) + r.Register("runtime.MemStats.MCacheInuse", runtimeMetrics.MemStats.MCacheInuse) + r.Register("runtime.MemStats.MCacheSys", runtimeMetrics.MemStats.MCacheSys) + r.Register("runtime.MemStats.MSpanInuse", runtimeMetrics.MemStats.MSpanInuse) + r.Register("runtime.MemStats.MSpanSys", runtimeMetrics.MemStats.MSpanSys) + r.Register("runtime.MemStats.NextGC", runtimeMetrics.MemStats.NextGC) + r.Register("runtime.MemStats.NumGC", runtimeMetrics.MemStats.NumGC) + r.Register("runtime.MemStats.GCCPUFraction", runtimeMetrics.MemStats.GCCPUFraction) + r.Register("runtime.MemStats.PauseNs", runtimeMetrics.MemStats.PauseNs) + r.Register("runtime.MemStats.PauseTotalNs", runtimeMetrics.MemStats.PauseTotalNs) + r.Register("runtime.MemStats.StackInuse", runtimeMetrics.MemStats.StackInuse) + r.Register("runtime.MemStats.StackSys", runtimeMetrics.MemStats.StackSys) + r.Register("runtime.MemStats.Sys", runtimeMetrics.MemStats.Sys) + r.Register("runtime.MemStats.TotalAlloc", runtimeMetrics.MemStats.TotalAlloc) + r.Register("runtime.NumCgoCall", runtimeMetrics.NumCgoCall) + r.Register("runtime.NumGoroutine", runtimeMetrics.NumGoroutine) + r.Register("runtime.NumThread", runtimeMetrics.NumThread) + r.Register("runtime.ReadMemStats", runtimeMetrics.ReadMemStats) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_cgo.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_cgo.go new file mode 100644 index 00000000..e3391f4e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_cgo.go @@ -0,0 +1,10 @@ +// +build cgo +// +build !appengine + +package metrics + +import "runtime" + +func numCgoCall() int64 { + return runtime.NumCgoCall() +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_gccpufraction.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_gccpufraction.go new file mode 100644 index 00000000..ca12c05b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_gccpufraction.go @@ -0,0 +1,9 @@ +// +build go1.5 + +package metrics + +import "runtime" + +func gcCPUFraction(memStats *runtime.MemStats) float64 { + return memStats.GCCPUFraction +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_no_cgo.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_no_cgo.go new file mode 100644 index 00000000..616a3b47 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_no_cgo.go @@ -0,0 +1,7 @@ +// +build !cgo appengine + +package metrics + +func numCgoCall() int64 { + return 0 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_no_gccpufraction.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_no_gccpufraction.go new file mode 100644 index 00000000..be96aa6f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/runtime_no_gccpufraction.go @@ -0,0 +1,9 @@ +// +build !go1.5 + +package metrics + +import "runtime" + +func gcCPUFraction(memStats *runtime.MemStats) float64 { + return 0 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/sample.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/sample.go new file mode 100644 index 00000000..5f6a3778 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/sample.go @@ -0,0 +1,609 @@ +package metrics + +import ( + "math" + "math/rand" + "sort" + "sync" + "time" +) + +const rescaleThreshold = time.Hour + +// Samples maintain a statistically-significant selection of values from +// a stream. +type Sample interface { + Clear() + Count() int64 + Max() int64 + Mean() float64 + Min() int64 + Percentile(float64) float64 + Percentiles([]float64) []float64 + Size() int + Snapshot() Sample + StdDev() float64 + Sum() int64 + Update(int64) + Values() []int64 + Variance() float64 +} + +// ExpDecaySample is an exponentially-decaying sample using a forward-decaying +// priority reservoir. See Cormode et al's "Forward Decay: A Practical Time +// Decay Model for Streaming Systems". +// +// +type ExpDecaySample struct { + alpha float64 + count int64 + mutex sync.Mutex + reservoirSize int + t0, t1 time.Time + values *expDecaySampleHeap +} + +// NewExpDecaySample constructs a new exponentially-decaying sample with the +// given reservoir size and alpha. +func NewExpDecaySample(reservoirSize int, alpha float64) Sample { + if UseNilMetrics { + return NilSample{} + } + s := &ExpDecaySample{ + alpha: alpha, + reservoirSize: reservoirSize, + t0: time.Now(), + values: newExpDecaySampleHeap(reservoirSize), + } + s.t1 = s.t0.Add(rescaleThreshold) + return s +} + +// Clear clears all samples. +func (s *ExpDecaySample) Clear() { + s.mutex.Lock() + defer s.mutex.Unlock() + s.count = 0 + s.t0 = time.Now() + s.t1 = s.t0.Add(rescaleThreshold) + s.values.Clear() +} + +// Count returns the number of samples recorded, which may exceed the +// reservoir size. +func (s *ExpDecaySample) Count() int64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return s.count +} + +// Max returns the maximum value in the sample, which may not be the maximum +// value ever to be part of the sample. +func (s *ExpDecaySample) Max() int64 { + return SampleMax(s.Values()) +} + +// Mean returns the mean of the values in the sample. +func (s *ExpDecaySample) Mean() float64 { + return SampleMean(s.Values()) +} + +// Min returns the minimum value in the sample, which may not be the minimum +// value ever to be part of the sample. +func (s *ExpDecaySample) Min() int64 { + return SampleMin(s.Values()) +} + +// Percentile returns an arbitrary percentile of values in the sample. +func (s *ExpDecaySample) Percentile(p float64) float64 { + return SamplePercentile(s.Values(), p) +} + +// Percentiles returns a slice of arbitrary percentiles of values in the +// sample. +func (s *ExpDecaySample) Percentiles(ps []float64) []float64 { + return SamplePercentiles(s.Values(), ps) +} + +// Size returns the size of the sample, which is at most the reservoir size. +func (s *ExpDecaySample) Size() int { + s.mutex.Lock() + defer s.mutex.Unlock() + return s.values.Size() +} + +// Snapshot returns a read-only copy of the sample. +func (s *ExpDecaySample) Snapshot() Sample { + s.mutex.Lock() + defer s.mutex.Unlock() + vals := s.values.Values() + values := make([]int64, len(vals)) + for i, v := range vals { + values[i] = v.v + } + return &SampleSnapshot{ + count: s.count, + values: values, + } +} + +// StdDev returns the standard deviation of the values in the sample. +func (s *ExpDecaySample) StdDev() float64 { + return SampleStdDev(s.Values()) +} + +// Sum returns the sum of the values in the sample. +func (s *ExpDecaySample) Sum() int64 { + return SampleSum(s.Values()) +} + +// Update samples a new value. +func (s *ExpDecaySample) Update(v int64) { + s.update(time.Now(), v) +} + +// Values returns a copy of the values in the sample. +func (s *ExpDecaySample) Values() []int64 { + s.mutex.Lock() + defer s.mutex.Unlock() + vals := s.values.Values() + values := make([]int64, len(vals)) + for i, v := range vals { + values[i] = v.v + } + return values +} + +// Variance returns the variance of the values in the sample. +func (s *ExpDecaySample) Variance() float64 { + return SampleVariance(s.Values()) +} + +// update samples a new value at a particular timestamp. This is a method all +// its own to facilitate testing. +func (s *ExpDecaySample) update(t time.Time, v int64) { + s.mutex.Lock() + defer s.mutex.Unlock() + s.count++ + if s.values.Size() == s.reservoirSize { + s.values.Pop() + } + s.values.Push(expDecaySample{ + k: math.Exp(t.Sub(s.t0).Seconds()*s.alpha) / rand.Float64(), + v: v, + }) + if t.After(s.t1) { + values := s.values.Values() + t0 := s.t0 + s.values.Clear() + s.t0 = t + s.t1 = s.t0.Add(rescaleThreshold) + for _, v := range values { + v.k = v.k * math.Exp(-s.alpha*s.t0.Sub(t0).Seconds()) + s.values.Push(v) + } + } +} + +// NilSample is a no-op Sample. +type NilSample struct{} + +// Clear is a no-op. +func (NilSample) Clear() {} + +// Count is a no-op. +func (NilSample) Count() int64 { return 0 } + +// Max is a no-op. +func (NilSample) Max() int64 { return 0 } + +// Mean is a no-op. +func (NilSample) Mean() float64 { return 0.0 } + +// Min is a no-op. +func (NilSample) Min() int64 { return 0 } + +// Percentile is a no-op. +func (NilSample) Percentile(p float64) float64 { return 0.0 } + +// Percentiles is a no-op. +func (NilSample) Percentiles(ps []float64) []float64 { + return make([]float64, len(ps)) +} + +// Size is a no-op. +func (NilSample) Size() int { return 0 } + +// Sample is a no-op. +func (NilSample) Snapshot() Sample { return NilSample{} } + +// StdDev is a no-op. +func (NilSample) StdDev() float64 { return 0.0 } + +// Sum is a no-op. +func (NilSample) Sum() int64 { return 0 } + +// Update is a no-op. +func (NilSample) Update(v int64) {} + +// Values is a no-op. +func (NilSample) Values() []int64 { return []int64{} } + +// Variance is a no-op. +func (NilSample) Variance() float64 { return 0.0 } + +// SampleMax returns the maximum value of the slice of int64. +func SampleMax(values []int64) int64 { + if 0 == len(values) { + return 0 + } + var max int64 = math.MinInt64 + for _, v := range values { + if max < v { + max = v + } + } + return max +} + +// SampleMean returns the mean value of the slice of int64. +func SampleMean(values []int64) float64 { + if 0 == len(values) { + return 0.0 + } + return float64(SampleSum(values)) / float64(len(values)) +} + +// SampleMin returns the minimum value of the slice of int64. +func SampleMin(values []int64) int64 { + if 0 == len(values) { + return 0 + } + var min int64 = math.MaxInt64 + for _, v := range values { + if min > v { + min = v + } + } + return min +} + +// SamplePercentiles returns an arbitrary percentile of the slice of int64. +func SamplePercentile(values int64Slice, p float64) float64 { + return SamplePercentiles(values, []float64{p})[0] +} + +// SamplePercentiles returns a slice of arbitrary percentiles of the slice of +// int64. +func SamplePercentiles(values int64Slice, ps []float64) []float64 { + scores := make([]float64, len(ps)) + size := len(values) + if size > 0 { + sort.Sort(values) + for i, p := range ps { + pos := p * float64(size+1) + if pos < 1.0 { + scores[i] = float64(values[0]) + } else if pos >= float64(size) { + scores[i] = float64(values[size-1]) + } else { + lower := float64(values[int(pos)-1]) + upper := float64(values[int(pos)]) + scores[i] = lower + (pos-math.Floor(pos))*(upper-lower) + } + } + } + return scores +} + +// SampleSnapshot is a read-only copy of another Sample. +type SampleSnapshot struct { + count int64 + values []int64 +} + +// Clear panics. +func (*SampleSnapshot) Clear() { + panic("Clear called on a SampleSnapshot") +} + +// Count returns the count of inputs at the time the snapshot was taken. +func (s *SampleSnapshot) Count() int64 { return s.count } + +// Max returns the maximal value at the time the snapshot was taken. +func (s *SampleSnapshot) Max() int64 { return SampleMax(s.values) } + +// Mean returns the mean value at the time the snapshot was taken. +func (s *SampleSnapshot) Mean() float64 { return SampleMean(s.values) } + +// Min returns the minimal value at the time the snapshot was taken. +func (s *SampleSnapshot) Min() int64 { return SampleMin(s.values) } + +// Percentile returns an arbitrary percentile of values at the time the +// snapshot was taken. +func (s *SampleSnapshot) Percentile(p float64) float64 { + return SamplePercentile(s.values, p) +} + +// Percentiles returns a slice of arbitrary percentiles of values at the time +// the snapshot was taken. +func (s *SampleSnapshot) Percentiles(ps []float64) []float64 { + return SamplePercentiles(s.values, ps) +} + +// Size returns the size of the sample at the time the snapshot was taken. +func (s *SampleSnapshot) Size() int { return len(s.values) } + +// Snapshot returns the snapshot. +func (s *SampleSnapshot) Snapshot() Sample { return s } + +// StdDev returns the standard deviation of values at the time the snapshot was +// taken. +func (s *SampleSnapshot) StdDev() float64 { return SampleStdDev(s.values) } + +// Sum returns the sum of values at the time the snapshot was taken. +func (s *SampleSnapshot) Sum() int64 { return SampleSum(s.values) } + +// Update panics. +func (*SampleSnapshot) Update(int64) { + panic("Update called on a SampleSnapshot") +} + +// Values returns a copy of the values in the sample. +func (s *SampleSnapshot) Values() []int64 { + values := make([]int64, len(s.values)) + copy(values, s.values) + return values +} + +// Variance returns the variance of values at the time the snapshot was taken. +func (s *SampleSnapshot) Variance() float64 { return SampleVariance(s.values) } + +// SampleStdDev returns the standard deviation of the slice of int64. +func SampleStdDev(values []int64) float64 { + return math.Sqrt(SampleVariance(values)) +} + +// SampleSum returns the sum of the slice of int64. +func SampleSum(values []int64) int64 { + var sum int64 + for _, v := range values { + sum += v + } + return sum +} + +// SampleVariance returns the variance of the slice of int64. +func SampleVariance(values []int64) float64 { + if 0 == len(values) { + return 0.0 + } + m := SampleMean(values) + var sum float64 + for _, v := range values { + d := float64(v) - m + sum += d * d + } + return sum / float64(len(values)) +} + +// A uniform sample using Vitter's Algorithm R. +// +// +type UniformSample struct { + count int64 + mutex sync.Mutex + reservoirSize int + values []int64 +} + +// NewUniformSample constructs a new uniform sample with the given reservoir +// size. +func NewUniformSample(reservoirSize int) Sample { + if UseNilMetrics { + return NilSample{} + } + return &UniformSample{ + reservoirSize: reservoirSize, + values: make([]int64, 0, reservoirSize), + } +} + +// Clear clears all samples. +func (s *UniformSample) Clear() { + s.mutex.Lock() + defer s.mutex.Unlock() + s.count = 0 + s.values = make([]int64, 0, s.reservoirSize) +} + +// Count returns the number of samples recorded, which may exceed the +// reservoir size. +func (s *UniformSample) Count() int64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return s.count +} + +// Max returns the maximum value in the sample, which may not be the maximum +// value ever to be part of the sample. +func (s *UniformSample) Max() int64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return SampleMax(s.values) +} + +// Mean returns the mean of the values in the sample. +func (s *UniformSample) Mean() float64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return SampleMean(s.values) +} + +// Min returns the minimum value in the sample, which may not be the minimum +// value ever to be part of the sample. +func (s *UniformSample) Min() int64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return SampleMin(s.values) +} + +// Percentile returns an arbitrary percentile of values in the sample. +func (s *UniformSample) Percentile(p float64) float64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return SamplePercentile(s.values, p) +} + +// Percentiles returns a slice of arbitrary percentiles of values in the +// sample. +func (s *UniformSample) Percentiles(ps []float64) []float64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return SamplePercentiles(s.values, ps) +} + +// Size returns the size of the sample, which is at most the reservoir size. +func (s *UniformSample) Size() int { + s.mutex.Lock() + defer s.mutex.Unlock() + return len(s.values) +} + +// Snapshot returns a read-only copy of the sample. +func (s *UniformSample) Snapshot() Sample { + s.mutex.Lock() + defer s.mutex.Unlock() + values := make([]int64, len(s.values)) + copy(values, s.values) + return &SampleSnapshot{ + count: s.count, + values: values, + } +} + +// StdDev returns the standard deviation of the values in the sample. +func (s *UniformSample) StdDev() float64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return SampleStdDev(s.values) +} + +// Sum returns the sum of the values in the sample. +func (s *UniformSample) Sum() int64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return SampleSum(s.values) +} + +// Update samples a new value. +func (s *UniformSample) Update(v int64) { + s.mutex.Lock() + defer s.mutex.Unlock() + s.count++ + if len(s.values) < s.reservoirSize { + s.values = append(s.values, v) + } else { + r := rand.Int63n(s.count) + if r < int64(len(s.values)) { + s.values[int(r)] = v + } + } +} + +// Values returns a copy of the values in the sample. +func (s *UniformSample) Values() []int64 { + s.mutex.Lock() + defer s.mutex.Unlock() + values := make([]int64, len(s.values)) + copy(values, s.values) + return values +} + +// Variance returns the variance of the values in the sample. +func (s *UniformSample) Variance() float64 { + s.mutex.Lock() + defer s.mutex.Unlock() + return SampleVariance(s.values) +} + +// expDecaySample represents an individual sample in a heap. +type expDecaySample struct { + k float64 + v int64 +} + +func newExpDecaySampleHeap(reservoirSize int) *expDecaySampleHeap { + return &expDecaySampleHeap{make([]expDecaySample, 0, reservoirSize)} +} + +// expDecaySampleHeap is a min-heap of expDecaySamples. +// The internal implementation is copied from the standard library's container/heap +type expDecaySampleHeap struct { + s []expDecaySample +} + +func (h *expDecaySampleHeap) Clear() { + h.s = h.s[:0] +} + +func (h *expDecaySampleHeap) Push(s expDecaySample) { + n := len(h.s) + h.s = h.s[0 : n+1] + h.s[n] = s + h.up(n) +} + +func (h *expDecaySampleHeap) Pop() expDecaySample { + n := len(h.s) - 1 + h.s[0], h.s[n] = h.s[n], h.s[0] + h.down(0, n) + + n = len(h.s) + s := h.s[n-1] + h.s = h.s[0 : n-1] + return s +} + +func (h *expDecaySampleHeap) Size() int { + return len(h.s) +} + +func (h *expDecaySampleHeap) Values() []expDecaySample { + return h.s +} + +func (h *expDecaySampleHeap) up(j int) { + for { + i := (j - 1) / 2 // parent + if i == j || !(h.s[j].k < h.s[i].k) { + break + } + h.s[i], h.s[j] = h.s[j], h.s[i] + j = i + } +} + +func (h *expDecaySampleHeap) down(i, n int) { + for { + j1 := 2*i + 1 + if j1 >= n || j1 < 0 { // j1 < 0 after int overflow + break + } + j := j1 // left child + if j2 := j1 + 1; j2 < n && !(h.s[j1].k < h.s[j2].k) { + j = j2 // = 2*i + 2 // right child + } + if !(h.s[j].k < h.s[i].k) { + break + } + h.s[i], h.s[j] = h.s[j], h.s[i] + i = j + } +} + +type int64Slice []int64 + +func (p int64Slice) Len() int { return len(p) } +func (p int64Slice) Less(i, j int) bool { return p[i] < p[j] } +func (p int64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/stathat/stathat.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/stathat/stathat.go new file mode 100644 index 00000000..0afcb484 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/stathat/stathat.go @@ -0,0 +1,69 @@ +// Metrics output to StatHat. +package stathat + +import ( + "github.com/rcrowley/go-metrics" + "github.com/stathat/go" + "log" + "time" +) + +func Stathat(r metrics.Registry, d time.Duration, userkey string) { + for { + if err := sh(r, userkey); nil != err { + log.Println(err) + } + time.Sleep(d) + } +} + +func sh(r metrics.Registry, userkey string) error { + r.Each(func(name string, i interface{}) { + switch metric := i.(type) { + case metrics.Counter: + stathat.PostEZCount(name, userkey, int(metric.Count())) + case metrics.Gauge: + stathat.PostEZValue(name, userkey, float64(metric.Value())) + case metrics.GaugeFloat64: + stathat.PostEZValue(name, userkey, float64(metric.Value())) + case metrics.Histogram: + h := metric.Snapshot() + ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + stathat.PostEZCount(name+".count", userkey, int(h.Count())) + stathat.PostEZValue(name+".min", userkey, float64(h.Min())) + stathat.PostEZValue(name+".max", userkey, float64(h.Max())) + stathat.PostEZValue(name+".mean", userkey, float64(h.Mean())) + stathat.PostEZValue(name+".std-dev", userkey, float64(h.StdDev())) + stathat.PostEZValue(name+".50-percentile", userkey, float64(ps[0])) + stathat.PostEZValue(name+".75-percentile", userkey, float64(ps[1])) + stathat.PostEZValue(name+".95-percentile", userkey, float64(ps[2])) + stathat.PostEZValue(name+".99-percentile", userkey, float64(ps[3])) + stathat.PostEZValue(name+".999-percentile", userkey, float64(ps[4])) + case metrics.Meter: + m := metric.Snapshot() + stathat.PostEZCount(name+".count", userkey, int(m.Count())) + stathat.PostEZValue(name+".one-minute", userkey, float64(m.Rate1())) + stathat.PostEZValue(name+".five-minute", userkey, float64(m.Rate5())) + stathat.PostEZValue(name+".fifteen-minute", userkey, float64(m.Rate15())) + stathat.PostEZValue(name+".mean", userkey, float64(m.RateMean())) + case metrics.Timer: + t := metric.Snapshot() + ps := t.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + stathat.PostEZCount(name+".count", userkey, int(t.Count())) + stathat.PostEZValue(name+".min", userkey, float64(t.Min())) + stathat.PostEZValue(name+".max", userkey, float64(t.Max())) + stathat.PostEZValue(name+".mean", userkey, float64(t.Mean())) + stathat.PostEZValue(name+".std-dev", userkey, float64(t.StdDev())) + stathat.PostEZValue(name+".50-percentile", userkey, float64(ps[0])) + stathat.PostEZValue(name+".75-percentile", userkey, float64(ps[1])) + stathat.PostEZValue(name+".95-percentile", userkey, float64(ps[2])) + stathat.PostEZValue(name+".99-percentile", userkey, float64(ps[3])) + stathat.PostEZValue(name+".999-percentile", userkey, float64(ps[4])) + stathat.PostEZValue(name+".one-minute", userkey, float64(t.Rate1())) + stathat.PostEZValue(name+".five-minute", userkey, float64(t.Rate5())) + stathat.PostEZValue(name+".fifteen-minute", userkey, float64(t.Rate15())) + stathat.PostEZValue(name+".mean-rate", userkey, float64(t.RateMean())) + } + }) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/syslog.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/syslog.go new file mode 100644 index 00000000..693f1908 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/syslog.go @@ -0,0 +1,78 @@ +// +build !windows + +package metrics + +import ( + "fmt" + "log/syslog" + "time" +) + +// Output each metric in the given registry to syslog periodically using +// the given syslogger. +func Syslog(r Registry, d time.Duration, w *syslog.Writer) { + for _ = range time.Tick(d) { + r.Each(func(name string, i interface{}) { + switch metric := i.(type) { + case Counter: + w.Info(fmt.Sprintf("counter %s: count: %d", name, metric.Count())) + case Gauge: + w.Info(fmt.Sprintf("gauge %s: value: %d", name, metric.Value())) + case GaugeFloat64: + w.Info(fmt.Sprintf("gauge %s: value: %f", name, metric.Value())) + case Healthcheck: + metric.Check() + w.Info(fmt.Sprintf("healthcheck %s: error: %v", name, metric.Error())) + case Histogram: + h := metric.Snapshot() + ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + w.Info(fmt.Sprintf( + "histogram %s: count: %d min: %d max: %d mean: %.2f stddev: %.2f median: %.2f 75%%: %.2f 95%%: %.2f 99%%: %.2f 99.9%%: %.2f", + name, + h.Count(), + h.Min(), + h.Max(), + h.Mean(), + h.StdDev(), + ps[0], + ps[1], + ps[2], + ps[3], + ps[4], + )) + case Meter: + m := metric.Snapshot() + w.Info(fmt.Sprintf( + "meter %s: count: %d 1-min: %.2f 5-min: %.2f 15-min: %.2f mean: %.2f", + name, + m.Count(), + m.Rate1(), + m.Rate5(), + m.Rate15(), + m.RateMean(), + )) + case Timer: + t := metric.Snapshot() + ps := t.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + w.Info(fmt.Sprintf( + "timer %s: count: %d min: %d max: %d mean: %.2f stddev: %.2f median: %.2f 75%%: %.2f 95%%: %.2f 99%%: %.2f 99.9%%: %.2f 1-min: %.2f 5-min: %.2f 15-min: %.2f mean-rate: %.2f", + name, + t.Count(), + t.Min(), + t.Max(), + t.Mean(), + t.StdDev(), + ps[0], + ps[1], + ps[2], + ps[3], + ps[4], + t.Rate1(), + t.Rate5(), + t.Rate15(), + t.RateMean(), + )) + } + }) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/timer.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/timer.go new file mode 100644 index 00000000..17db8f8d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/timer.go @@ -0,0 +1,311 @@ +package metrics + +import ( + "sync" + "time" +) + +// Timers capture the duration and rate of events. +type Timer interface { + Count() int64 + Max() int64 + Mean() float64 + Min() int64 + Percentile(float64) float64 + Percentiles([]float64) []float64 + Rate1() float64 + Rate5() float64 + Rate15() float64 + RateMean() float64 + Snapshot() Timer + StdDev() float64 + Sum() int64 + Time(func()) + Update(time.Duration) + UpdateSince(time.Time) + Variance() float64 +} + +// GetOrRegisterTimer returns an existing Timer or constructs and registers a +// new StandardTimer. +func GetOrRegisterTimer(name string, r Registry) Timer { + if nil == r { + r = DefaultRegistry + } + return r.GetOrRegister(name, NewTimer).(Timer) +} + +// NewCustomTimer constructs a new StandardTimer from a Histogram and a Meter. +func NewCustomTimer(h Histogram, m Meter) Timer { + if UseNilMetrics { + return NilTimer{} + } + return &StandardTimer{ + histogram: h, + meter: m, + } +} + +// NewRegisteredTimer constructs and registers a new StandardTimer. +func NewRegisteredTimer(name string, r Registry) Timer { + c := NewTimer() + if nil == r { + r = DefaultRegistry + } + r.Register(name, c) + return c +} + +// NewTimer constructs a new StandardTimer using an exponentially-decaying +// sample with the same reservoir size and alpha as UNIX load averages. +func NewTimer() Timer { + if UseNilMetrics { + return NilTimer{} + } + return &StandardTimer{ + histogram: NewHistogram(NewExpDecaySample(1028, 0.015)), + meter: NewMeter(), + } +} + +// NilTimer is a no-op Timer. +type NilTimer struct { + h Histogram + m Meter +} + +// Count is a no-op. +func (NilTimer) Count() int64 { return 0 } + +// Max is a no-op. +func (NilTimer) Max() int64 { return 0 } + +// Mean is a no-op. +func (NilTimer) Mean() float64 { return 0.0 } + +// Min is a no-op. +func (NilTimer) Min() int64 { return 0 } + +// Percentile is a no-op. +func (NilTimer) Percentile(p float64) float64 { return 0.0 } + +// Percentiles is a no-op. +func (NilTimer) Percentiles(ps []float64) []float64 { + return make([]float64, len(ps)) +} + +// Rate1 is a no-op. +func (NilTimer) Rate1() float64 { return 0.0 } + +// Rate5 is a no-op. +func (NilTimer) Rate5() float64 { return 0.0 } + +// Rate15 is a no-op. +func (NilTimer) Rate15() float64 { return 0.0 } + +// RateMean is a no-op. +func (NilTimer) RateMean() float64 { return 0.0 } + +// Snapshot is a no-op. +func (NilTimer) Snapshot() Timer { return NilTimer{} } + +// StdDev is a no-op. +func (NilTimer) StdDev() float64 { return 0.0 } + +// Sum is a no-op. +func (NilTimer) Sum() int64 { return 0 } + +// Time is a no-op. +func (NilTimer) Time(func()) {} + +// Update is a no-op. +func (NilTimer) Update(time.Duration) {} + +// UpdateSince is a no-op. +func (NilTimer) UpdateSince(time.Time) {} + +// Variance is a no-op. +func (NilTimer) Variance() float64 { return 0.0 } + +// StandardTimer is the standard implementation of a Timer and uses a Histogram +// and Meter. +type StandardTimer struct { + histogram Histogram + meter Meter + mutex sync.Mutex +} + +// Count returns the number of events recorded. +func (t *StandardTimer) Count() int64 { + return t.histogram.Count() +} + +// Max returns the maximum value in the sample. +func (t *StandardTimer) Max() int64 { + return t.histogram.Max() +} + +// Mean returns the mean of the values in the sample. +func (t *StandardTimer) Mean() float64 { + return t.histogram.Mean() +} + +// Min returns the minimum value in the sample. +func (t *StandardTimer) Min() int64 { + return t.histogram.Min() +} + +// Percentile returns an arbitrary percentile of the values in the sample. +func (t *StandardTimer) Percentile(p float64) float64 { + return t.histogram.Percentile(p) +} + +// Percentiles returns a slice of arbitrary percentiles of the values in the +// sample. +func (t *StandardTimer) Percentiles(ps []float64) []float64 { + return t.histogram.Percentiles(ps) +} + +// Rate1 returns the one-minute moving average rate of events per second. +func (t *StandardTimer) Rate1() float64 { + return t.meter.Rate1() +} + +// Rate5 returns the five-minute moving average rate of events per second. +func (t *StandardTimer) Rate5() float64 { + return t.meter.Rate5() +} + +// Rate15 returns the fifteen-minute moving average rate of events per second. +func (t *StandardTimer) Rate15() float64 { + return t.meter.Rate15() +} + +// RateMean returns the meter's mean rate of events per second. +func (t *StandardTimer) RateMean() float64 { + return t.meter.RateMean() +} + +// Snapshot returns a read-only copy of the timer. +func (t *StandardTimer) Snapshot() Timer { + t.mutex.Lock() + defer t.mutex.Unlock() + return &TimerSnapshot{ + histogram: t.histogram.Snapshot().(*HistogramSnapshot), + meter: t.meter.Snapshot().(*MeterSnapshot), + } +} + +// StdDev returns the standard deviation of the values in the sample. +func (t *StandardTimer) StdDev() float64 { + return t.histogram.StdDev() +} + +// Sum returns the sum in the sample. +func (t *StandardTimer) Sum() int64 { + return t.histogram.Sum() +} + +// Record the duration of the execution of the given function. +func (t *StandardTimer) Time(f func()) { + ts := time.Now() + f() + t.Update(time.Since(ts)) +} + +// Record the duration of an event. +func (t *StandardTimer) Update(d time.Duration) { + t.mutex.Lock() + defer t.mutex.Unlock() + t.histogram.Update(int64(d)) + t.meter.Mark(1) +} + +// Record the duration of an event that started at a time and ends now. +func (t *StandardTimer) UpdateSince(ts time.Time) { + t.mutex.Lock() + defer t.mutex.Unlock() + t.histogram.Update(int64(time.Since(ts))) + t.meter.Mark(1) +} + +// Variance returns the variance of the values in the sample. +func (t *StandardTimer) Variance() float64 { + return t.histogram.Variance() +} + +// TimerSnapshot is a read-only copy of another Timer. +type TimerSnapshot struct { + histogram *HistogramSnapshot + meter *MeterSnapshot +} + +// Count returns the number of events recorded at the time the snapshot was +// taken. +func (t *TimerSnapshot) Count() int64 { return t.histogram.Count() } + +// Max returns the maximum value at the time the snapshot was taken. +func (t *TimerSnapshot) Max() int64 { return t.histogram.Max() } + +// Mean returns the mean value at the time the snapshot was taken. +func (t *TimerSnapshot) Mean() float64 { return t.histogram.Mean() } + +// Min returns the minimum value at the time the snapshot was taken. +func (t *TimerSnapshot) Min() int64 { return t.histogram.Min() } + +// Percentile returns an arbitrary percentile of sampled values at the time the +// snapshot was taken. +func (t *TimerSnapshot) Percentile(p float64) float64 { + return t.histogram.Percentile(p) +} + +// Percentiles returns a slice of arbitrary percentiles of sampled values at +// the time the snapshot was taken. +func (t *TimerSnapshot) Percentiles(ps []float64) []float64 { + return t.histogram.Percentiles(ps) +} + +// Rate1 returns the one-minute moving average rate of events per second at the +// time the snapshot was taken. +func (t *TimerSnapshot) Rate1() float64 { return t.meter.Rate1() } + +// Rate5 returns the five-minute moving average rate of events per second at +// the time the snapshot was taken. +func (t *TimerSnapshot) Rate5() float64 { return t.meter.Rate5() } + +// Rate15 returns the fifteen-minute moving average rate of events per second +// at the time the snapshot was taken. +func (t *TimerSnapshot) Rate15() float64 { return t.meter.Rate15() } + +// RateMean returns the meter's mean rate of events per second at the time the +// snapshot was taken. +func (t *TimerSnapshot) RateMean() float64 { return t.meter.RateMean() } + +// Snapshot returns the snapshot. +func (t *TimerSnapshot) Snapshot() Timer { return t } + +// StdDev returns the standard deviation of the values at the time the snapshot +// was taken. +func (t *TimerSnapshot) StdDev() float64 { return t.histogram.StdDev() } + +// Sum returns the sum at the time the snapshot was taken. +func (t *TimerSnapshot) Sum() int64 { return t.histogram.Sum() } + +// Time panics. +func (*TimerSnapshot) Time(func()) { + panic("Time called on a TimerSnapshot") +} + +// Update panics. +func (*TimerSnapshot) Update(time.Duration) { + panic("Update called on a TimerSnapshot") +} + +// UpdateSince panics. +func (*TimerSnapshot) UpdateSince(time.Time) { + panic("UpdateSince called on a TimerSnapshot") +} + +// Variance returns the variance of the values at the time the snapshot was +// taken. +func (t *TimerSnapshot) Variance() float64 { return t.histogram.Variance() } diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/validate.sh b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/validate.sh new file mode 100755 index 00000000..f6499982 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/validate.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +# check there are no formatting issues +GOFMT_LINES=`gofmt -l . | wc -l | xargs` +test $GOFMT_LINES -eq 0 || echo "gofmt needs to be run, ${GOFMT_LINES} files have issues" + +# run the tests for the root package +go test . diff --git a/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/writer.go b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/writer.go new file mode 100644 index 00000000..091e971d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/rcrowley/go-metrics/writer.go @@ -0,0 +1,100 @@ +package metrics + +import ( + "fmt" + "io" + "sort" + "time" +) + +// Write sorts writes each metric in the given registry periodically to the +// given io.Writer. +func Write(r Registry, d time.Duration, w io.Writer) { + for _ = range time.Tick(d) { + WriteOnce(r, w) + } +} + +// WriteOnce sorts and writes metrics in the given registry to the given +// io.Writer. +func WriteOnce(r Registry, w io.Writer) { + var namedMetrics namedMetricSlice + r.Each(func(name string, i interface{}) { + namedMetrics = append(namedMetrics, namedMetric{name, i}) + }) + + sort.Sort(namedMetrics) + for _, namedMetric := range namedMetrics { + switch metric := namedMetric.m.(type) { + case Counter: + fmt.Fprintf(w, "counter %s\n", namedMetric.name) + fmt.Fprintf(w, " count: %9d\n", metric.Count()) + case Gauge: + fmt.Fprintf(w, "gauge %s\n", namedMetric.name) + fmt.Fprintf(w, " value: %9d\n", metric.Value()) + case GaugeFloat64: + fmt.Fprintf(w, "gauge %s\n", namedMetric.name) + fmt.Fprintf(w, " value: %f\n", metric.Value()) + case Healthcheck: + metric.Check() + fmt.Fprintf(w, "healthcheck %s\n", namedMetric.name) + fmt.Fprintf(w, " error: %v\n", metric.Error()) + case Histogram: + h := metric.Snapshot() + ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + fmt.Fprintf(w, "histogram %s\n", namedMetric.name) + fmt.Fprintf(w, " count: %9d\n", h.Count()) + fmt.Fprintf(w, " min: %9d\n", h.Min()) + fmt.Fprintf(w, " max: %9d\n", h.Max()) + fmt.Fprintf(w, " mean: %12.2f\n", h.Mean()) + fmt.Fprintf(w, " stddev: %12.2f\n", h.StdDev()) + fmt.Fprintf(w, " median: %12.2f\n", ps[0]) + fmt.Fprintf(w, " 75%%: %12.2f\n", ps[1]) + fmt.Fprintf(w, " 95%%: %12.2f\n", ps[2]) + fmt.Fprintf(w, " 99%%: %12.2f\n", ps[3]) + fmt.Fprintf(w, " 99.9%%: %12.2f\n", ps[4]) + case Meter: + m := metric.Snapshot() + fmt.Fprintf(w, "meter %s\n", namedMetric.name) + fmt.Fprintf(w, " count: %9d\n", m.Count()) + fmt.Fprintf(w, " 1-min rate: %12.2f\n", m.Rate1()) + fmt.Fprintf(w, " 5-min rate: %12.2f\n", m.Rate5()) + fmt.Fprintf(w, " 15-min rate: %12.2f\n", m.Rate15()) + fmt.Fprintf(w, " mean rate: %12.2f\n", m.RateMean()) + case Timer: + t := metric.Snapshot() + ps := t.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) + fmt.Fprintf(w, "timer %s\n", namedMetric.name) + fmt.Fprintf(w, " count: %9d\n", t.Count()) + fmt.Fprintf(w, " min: %9d\n", t.Min()) + fmt.Fprintf(w, " max: %9d\n", t.Max()) + fmt.Fprintf(w, " mean: %12.2f\n", t.Mean()) + fmt.Fprintf(w, " stddev: %12.2f\n", t.StdDev()) + fmt.Fprintf(w, " median: %12.2f\n", ps[0]) + fmt.Fprintf(w, " 75%%: %12.2f\n", ps[1]) + fmt.Fprintf(w, " 95%%: %12.2f\n", ps[2]) + fmt.Fprintf(w, " 99%%: %12.2f\n", ps[3]) + fmt.Fprintf(w, " 99.9%%: %12.2f\n", ps[4]) + fmt.Fprintf(w, " 1-min rate: %12.2f\n", t.Rate1()) + fmt.Fprintf(w, " 5-min rate: %12.2f\n", t.Rate5()) + fmt.Fprintf(w, " 15-min rate: %12.2f\n", t.Rate15()) + fmt.Fprintf(w, " mean rate: %12.2f\n", t.RateMean()) + } + } +} + +type namedMetric struct { + name string + m interface{} +} + +// namedMetricSlice is a slice of namedMetrics that implements sort.Interface. +type namedMetricSlice []namedMetric + +func (nms namedMetricSlice) Len() int { return len(nms) } + +func (nms namedMetricSlice) Swap(i, j int) { nms[i], nms[j] = nms[j], nms[i] } + +func (nms namedMetricSlice) Less(i, j int) bool { + return nms[i].name < nms[j].name +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-parser/parser/input.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-parser/parser/input.go new file mode 100644 index 00000000..40be25a2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-parser/parser/input.go @@ -0,0 +1,56 @@ +package parser + +import ( + "io" +) + +// Basic string Input for parsing over a string input. +type StringInput struct { + state State + input []rune + offset int + txn []int +} + +func NewStringInput(s string) *StringInput { + return &StringInput{ + input: []rune(s), + txn: make([]int, 0, 8), + } +} + +func (s *StringInput) Begin() { + s.txn = append(s.txn, s.offset) +} + +func (s *StringInput) End(rollback bool) { + i := s.txn[len(s.txn)-1] + s.txn = s.txn[:len(s.txn)-1] + if rollback { + s.offset = i + } +} + +func (s *StringInput) Get(i int) (string, error) { + if len(s.input) < s.offset+i { + return "", io.EOF + } + + return string(s.input[s.offset : s.offset+i]), nil +} + +func (s *StringInput) Next() (rune, error) { + if len(s.input) < s.offset+1 { + return 0, io.EOF + } + + return s.input[s.offset], nil +} + +func (s *StringInput) Pop(i int) { + s.offset += i +} + +func (s *StringInput) Position() Position { + return Position{Offset: s.offset} +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-parser/parser/parser.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-parser/parser/parser.go new file mode 100644 index 00000000..52815608 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-parser/parser/parser.go @@ -0,0 +1,453 @@ +package parser + +import ( + "errors" + "io" + "unicode" +) + +type Position struct { + Name string + Line int + Column int + Offset int +} + +type Input interface { + Begin() + End(rollback bool) + + Get(int) (string, error) + Next() (rune, error) + Pop(int) + + Position() Position +} + +// Specifications for the parser +type Spec struct { + CommentStart string + CommentEnd string + CommentLine Parser + NestedComments bool + IdentStart Parser + IdentLetter Parser + ReservedNames []string +} + +type State struct { + Spec Spec + Input Input +} + +// A Parser is a function that takes a Input and returns any matches +// (Output) and whether or not the match was valid and any error +type Parser func(*State) (Output, bool, error) + +// Output of Parsers +type Output interface{} + +// Token that satisfies a condition. +func Satisfy(check func(c rune) bool) Parser { + return func(st *State) (Output, bool, error) { + target, err := st.Input.Next() + if err == nil && check(target) { + st.Input.Pop(1) + return target, true, nil + } + + return nil, false, err + } +} + +// Skip whitespace and comments +func Whitespace() Parser { + return Skip(Many(Any(Satisfy(unicode.IsSpace), OneLineComment(), MultiLineComment()))) +} + +// func Comments() Parser { +// parser := Many(Any(Skip(Satisfy(unicode.IsSpace)), OneLineComment(), MultiLineComment())) +// return func(state *State) (Output, bool, error) { +// out, ok := parser(st) +// if !ok { +// return out, ok +// } +// // for _, o := range out.([]interface{}) { +// // switch s := o.(type) { +// // case []byte: +// // println(string(s)) +// // case string: +// // println(s) +// // default: +// // panic(o) +// // panic("Unexpected type") +// // } +// // } +// return out, ok +// } +// } + +func stringUntil(until rune) Parser { + return func(st *State) (Output, bool, error) { + out := make([]rune, 0) + + for { + next, err := st.Input.Next() + if err != nil { + return string(out), false, err + } + st.Input.Pop(1) + if next == until { + break + } + out = append(out, next) + } + return string(out), true, nil + } +} + +func OneLineComment() Parser { + return func(st *State) (Output, bool, error) { + if st.Spec.CommentLine == nil { + return nil, false, nil + } + + return All( + Try(st.Spec.CommentLine), + stringUntil('\n'))(st) + } +} + +func MultiLineComment() Parser { + return func(st *State) (Output, bool, error) { + spec := st.Spec + + return All( + String(spec.CommentStart), + InComment())(st) + } +} + +func InComment() Parser { + return func(st *State) (Output, bool, error) { + if st.Spec.NestedComments { + return inMulti()(st) + } + + return inSingle()(st) + } +} + +func inMulti() Parser { + return func(st *State) (Output, bool, error) { + spec := st.Spec + startEnd := spec.CommentStart + spec.CommentEnd + + return Any( + Try(String(spec.CommentEnd)), + All(MultiLineComment(), inMulti()), + All(Many1(NoneOf(startEnd)), inMulti()), + All(OneOf(startEnd), inMulti()))(st) + } +} + +func inSingle() Parser { + return func(st *State) (Output, bool, error) { + spec := st.Spec + startEnd := spec.CommentStart + spec.CommentEnd + + return Any( + Try(String(spec.CommentEnd)), + All(Many1(NoneOf(startEnd)), inSingle()), + All(OneOf(startEnd), inSingle()))(st) + } +} + +func OneOf(cs string) Parser { + return func(st *State) (Output, bool, error) { + next, err := st.Input.Next() + if err != nil { + return nil, false, err + } + + for _, v := range cs { + if v == next { + st.Input.Pop(1) + return v, true, nil + } + } + + return next, false, nil + } +} + +func NoneOf(cs string) Parser { + return func(st *State) (Output, bool, error) { + next, err := st.Input.Next() + if err != nil { + return nil, false, err + } + + for _, v := range cs { + if v == next { + return v, false, nil + } + } + + st.Input.Pop(1) + return next, true, nil + } +} + +func Skip(match Parser) Parser { + return func(st *State) (Output, bool, error) { + _, ok, err := match(st) + return nil, ok, err + } +} + +func Token() Parser { + return func(st *State) (Output, bool, error) { + next, err := st.Input.Next() + if err != nil { + return next, false, err + } + st.Input.Pop(1) + return next, true, nil + } +} + +// Match a parser and skip whitespace +func Lexeme(match Parser) Parser { + return func(st *State) (Output, bool, error) { + out, matched, err := match(st) + if err != nil { + return nil, false, err + } + + if !matched { + return nil, false, nil + } + + Whitespace()(st) + + return out, true, nil + } +} + +// Match a parser 0 or more times. +func Many(match Parser) Parser { + return func(st *State) (Output, bool, error) { + matches := []interface{}{} + for { + out, parsed, err := match(st) + if err == io.EOF { + break + } else if err != nil { + return nil, false, err + } else if !parsed { + break + } + + if out != nil { + matches = append(matches, out) + } + } + + return matches, true, nil + } +} + +// Match a parser 1 or more times. +func Many1(match Parser) Parser { + return func(st *State) (Output, bool, error) { + a, ok, err := match(st) + if !ok || err != nil { + return nil, false, err + } + + rest, ok, err := Many(match)(st) + if !ok || err != nil { + return nil, false, err + } + + as := rest.([]interface{}) + + all := make([]interface{}, len(as)+1) + all[0] = a + for i := 0; i < len(as); i++ { + all[i+1] = as[i] + } + + return all, true, nil + } +} + +// Match a parser seperated by another parser 0 or more times. +// Trailing delimeters are valid. +func SepBy(delim Parser, match Parser) Parser { + return func(st *State) (Output, bool, error) { + matches := []interface{}{} + for { + out, parsed, err := match(st) + if err != nil { + return nil, false, err + } + + if !parsed { + break + } + + matches = append(matches, out) + + _, sep, err := delim(st) + if err != nil { + return nil, false, err + } + if !sep { + break + } + } + + return matches, true, nil + } +} + +// Go through the parsers until one matches. +func Any(parsers ...Parser) Parser { + return func(st *State) (Output, bool, error) { + for _, parser := range parsers { + match, ok, err := parser(st) + if ok || err != nil { + return match, ok, err + } + } + + return nil, false, nil + } +} + +// Match all parsers, returning the final result. If one fails, it stops. +// NOTE: Consumes input on failure. Wrap calls in Try(...) to avoid. +func All(parsers ...Parser) Parser { + return func(st *State) (match Output, ok bool, err error) { + for _, parser := range parsers { + match, ok, err = parser(st) + if !ok || err != nil { + return + } + } + + return + } +} + +// Match all parsers, collecting their outputs into a vector. +// If one parser fails, the whole thing fails. +// NOTE: Consumes input on failure. Wrap calls in Try(...) to avoid. +func Collect(parsers ...Parser) Parser { + return func(st *State) (Output, bool, error) { + matches := []interface{}{} + for _, parser := range parsers { + match, ok, err := parser(st) + if !ok || err != nil { + return nil, false, err + } + + matches = append(matches, match) + } + + return matches, true, nil + } +} + +// Try matching begin, match, and then end. +func Between(begin Parser, end Parser, match Parser) Parser { + return func(st *State) (Output, bool, error) { + parse, ok, err := Try(Collect(begin, match, end))(st) + if !ok || err != nil { + return nil, false, err + } + + return parse.([]interface{})[1], true, nil + } +} + +// Lexeme parser for `match' wrapped in parens. +func Parens(match Parser) Parser { return Lexeme(Between(Symbol("("), Symbol(")"), match)) } + +// Match a string and consume any following whitespace. +func Symbol(str string) Parser { return Lexeme(String(str)) } + +// Match a string and pop the string's length from the input. +// NOTE: Consumes input on failure. Wrap calls in Try(...) to avoid. +func String(str string) Parser { + return func(st *State) (Output, bool, error) { + for _, v := range str { + next, err := st.Input.Next() + if err != nil || next != v { + return nil, false, err + } + + st.Input.Pop(1) + } + + return str, true, nil + } +} + +// Try a parse and revert the state and position if it fails. +func Try(match Parser) Parser { + return func(st *State) (Output, bool, error) { + st.Input.Begin() + out, ok, err := match(st) + st.Input.End(!ok || err == io.EOF) + if err == io.EOF { + if ok { + err = errors.New("parser: bad state: err == EOF but ok == true") + } else { + err = nil + } + } + return out, ok, err + } +} + +func Ident() Parser { + return func(st *State) (Output, bool, error) { + sp := st.Spec + n, ok, err := sp.IdentStart(st) + if !ok || err != nil { + return nil, ok, err + } + + ns, ok, err := Many(sp.IdentLetter)(st) + if !ok || err != nil { + return nil, ok, err + } + + rest := make([]rune, len(ns.([]interface{}))) + for k, v := range ns.([]interface{}) { + rest[k] = v.(rune) + } + + return string(n.(rune)) + string(rest), true, nil + } +} + +func Identifier() Parser { + return Lexeme(Try(func(st *State) (Output, bool, error) { + name, ok, err := Ident()(st) + if !ok || err != nil { + return name, ok, err + } + + for _, v := range st.Spec.ReservedNames { + if v == name { + return nil, false, nil + } + } + + return name, true, nil + })) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/LICENSE new file mode 100644 index 00000000..3be2b5ea --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2012, Samuel Stauffer +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of the author nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/README.md b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/README.md new file mode 100644 index 00000000..3d1c01ad --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/README.md @@ -0,0 +1,91 @@ +Thrift Package for Go +===================== + +[![Build Status](https://travis-ci.org/samuel/go-thrift.png)](https://travis-ci.org/samuel/go-thrift) + +API Documentation: + +License +------- + +3-clause BSD. See LICENSE file. + +Overview +-------- + +Thrift is an IDL that can be used to generate RPC client and server +bindings for a variety of languages. This package includes client and server +codecs, serialization, and code generation for Go. It tries to be a more +natural mapping to the language compared to other implementations. For instance, +Go already has the idea of a thrift transport in the ReadWriteCloser interfaces. + +Types +----- + +Most types map directly to the native Go types, but there are some +quirks and limitations. + +* Go supports a more limited set of types for map keys than Thrift +* To use a set define the field as []type and provide a tag of "set": + + StringSet []string `thrift:"1,set"` + +* []byte get encoded/decoded as a string because the Thrift binary type + is the same as string on the wire. + +RPC +--- + +The standard Go net/rpc package is used to provide RPC. Although, one +incompatibility is the net/rpc's use of ServiceName.Method for naming +RPC methods. To get around this the Thrift ServerCodec prefixes method +names with "Thrift". + +### Transport + +There are no specific transport "classes" as there are in most Thrift +libraries. Instead, the standard `io.ReadWriteCloser` is used as the +interface. If the value also implements the thrift.Flusher interface +then `Flush() error` is called after `protocol.WriteMessageEnd`. + +_Framed transport_ is supported by wrapping a value implementing +`io.ReadWriteCloser` with `thrift.NewFramedReadWriteCloser(value)` + +### One-way requests + +#### Client + +One-way request support needs to be enabled on the RPC codec explicitly. +The reason they're not allowed by default is because the Go RPC package +doesn't actually support one-way requests. To get around this requires +a rather janky hack of using channels to track pending requests in the +codec and faking responses. + +#### Server + +One-way requests aren't yet implemented on the server side. + +Parser & Code Generator +----------------------- + +The "parser" subdirectory contains a Thrift IDL parser, and "generator" +contains a Go code generator. It could be extended to include other +languages. + +How to use the generator: + + $ go install github.com/samuel/go-thrift/generator + + $ generator --help + Usage of parsimony: [options] inputfile outputpath + -go.binarystring=false: Always use string for binary instead of []byte + -go.json.enumnum=false: For JSON marshal enums by number instead of name + -go.pointers=false: Make all fields pointers + + $ generator cassandra.thrift $GOPATH/src/ + +TODO +---- + +* default values +* oneway requests on the server diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/examples/scribe/thrift.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/examples/scribe/thrift.go new file mode 100644 index 00000000..5f5dc622 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/examples/scribe/thrift.go @@ -0,0 +1,88 @@ +// This file is automatically generated. Do not modify. + +package scribe + +import ( + "fmt" + "strconv" +) + +type ResultCode int32 + +var ( + ResultCodeOk = ResultCode(0) + ResultCodeTryLater = ResultCode(1) + ResultCodeByName = map[string]ResultCode{ + "ResultCode.OK": ResultCodeOk, + "ResultCode.TRY_LATER": ResultCodeTryLater, + } + ResultCodeByValue = map[ResultCode]string{ + ResultCodeOk: "ResultCode.OK", + ResultCodeTryLater: "ResultCode.TRY_LATER", + } +) + +func (e ResultCode) String() string { + name := ResultCodeByValue[e] + if name == "" { + name = fmt.Sprintf("Unknown enum value ResultCode(%d)", e) + } + return name +} + +func (e *ResultCode) UnmarshalJSON(b []byte) error { + st := string(b) + if st[0] == '"' { + *e = ResultCode(ResultCodeByName[st[1:len(st)-1]]) + return nil + } + i, err := strconv.Atoi(st) + *e = ResultCode(i) + return err +} + +type LogEntry struct { + Category string `thrift:"1,required" json:"category"` + Message string `thrift:"2,required" json:"message"` +} + +type RPCClient interface { + Call(method string, request interface{}, response interface{}) error +} + +type Scribe interface { + Log(Messages []*LogEntry) (ResultCode, error) +} + +type ScribeServer struct { + Implementation Scribe +} + +func (s *ScribeServer) Log(req *ScribeLogRequest, res *ScribeLogResponse) error { + val, err := s.Implementation.Log(req.Messages) + switch e := err.(type) { + } + res.Value = val + return err +} + +type ScribeLogRequest struct { + Messages []*LogEntry `thrift:"1,required" json:"messages"` +} + +type ScribeLogResponse struct { + Value ResultCode `thrift:"0,required" json:"value"` +} + +type ScribeClient struct { + Client RPCClient +} + +func (s *ScribeClient) Log(Messages []*LogEntry) (ResultCode, error) { + req := &ScribeLogRequest{ + Messages: Messages, + } + res := &ScribeLogResponse{} + err := s.Client.Call("Log", req, res) + return res.Value, err +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/examples/scribe_client/main.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/examples/scribe_client/main.go new file mode 100644 index 00000000..53f971ad --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/examples/scribe_client/main.go @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "net" + + "github.com/samuel/go-thrift/examples/scribe" + "github.com/samuel/go-thrift/thrift" +) + +func main() { + conn, err := net.Dial("tcp", "127.0.0.1:1463") + if err != nil { + panic(err) + } + + t := thrift.NewTransport(thrift.NewFramedReadWriteCloser(conn, 0), thrift.BinaryProtocol) + client := thrift.NewClient(t, false) + scr := scribe.ScribeClient{Client: client} + res, err := scr.Log([]*scribe.LogEntry{{"category", "message"}}) + if err != nil { + panic(err) + } + + fmt.Printf("Response: %+v\n", res) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/examples/scribe_server/main.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/examples/scribe_server/main.go new file mode 100644 index 00000000..017a11cb --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/examples/scribe_server/main.go @@ -0,0 +1,41 @@ +package main + +import ( + "fmt" + "net" + "net/rpc" + + "github.com/samuel/go-thrift/examples/scribe" + "github.com/samuel/go-thrift/thrift" +) + +// implementation + +type scribeServiceImplementation int + +func (s *scribeServiceImplementation) Log(messages []*scribe.LogEntry) (scribe.ResultCode, error) { + for _, m := range messages { + fmt.Printf("MSG: %+v\n", m) + } + return scribe.ResultCodeOk, nil +} + +func main() { + scribeService := new(scribeServiceImplementation) + rpc.RegisterName("Thrift", &scribe.ScribeServer{Implementation: scribeService}) + + ln, err := net.Listen("tcp", ":1463") + if err != nil { + panic(err) + } + for { + conn, err := ln.Accept() + if err != nil { + fmt.Printf("ERROR: %+v\n", err) + continue + } + fmt.Printf("New connection %+v\n", conn) + t := thrift.NewTransport(thrift.NewFramedReadWriteCloser(conn, 0), thrift.BinaryProtocol) + go rpc.ServeCodec(thrift.NewServerCodec(t)) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/generator/go.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/generator/go.go new file mode 100644 index 00000000..5f68df81 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/generator/go.go @@ -0,0 +1,687 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package main + +// TODO: +// - Default arguments. Possibly don't bother... + +import ( + "bytes" + "flag" + "fmt" + "go/format" + "io" + "os" + "path/filepath" + "runtime" + "strings" + + "github.com/samuel/go-thrift/parser" +) + +var ( + flagGoBinarystring = flag.Bool("go.binarystring", false, "Always use string for binary instead of []byte") + flagGoJsonEnumnum = flag.Bool("go.json.enumnum", false, "For JSON marshal enums by number instead of name") + flagGoPointers = flag.Bool("go.pointers", false, "Make all fields pointers") +) + +var ( + goNamespaceOrder = []string{"go", "perl", "py", "cpp", "rb", "java"} +) + +type ErrUnknownType string + +func (e ErrUnknownType) Error() string { + return fmt.Sprintf("Unknown type %s", string(e)) +} + +type ErrMissingInclude string + +func (e ErrMissingInclude) Error() string { + return fmt.Sprintf("Missing include %s", string(e)) +} + +type GoPackage struct { + Path string + Name string +} + +type GoGenerator struct { + thrift *parser.Thrift + pkg string + + ThriftFiles map[string]*parser.Thrift + Packages map[string]GoPackage +} + +var goKeywords = map[string]bool{ + "break": true, + "default": true, + "func": true, + "interface": true, + "select": true, + "case": true, + "defer": true, + "go": true, + "map": true, + "struct": true, + "chan": true, + "else": true, + "goto": true, + "package": true, + "switch": true, + "const": true, + "fallthrough": true, + "if": true, + "range": true, + "type": true, + "continue": true, + "for": true, + "import": true, + "return": true, + "var": true, +} + +var basicTypes = map[string]bool{ + "byte": true, + "bool": true, + "string": true, + "i16": true, + "i32": true, + "i64": true, + "double": true, +} + +func init() { + if *flagGoBinarystring { + basicTypes["binary"] = true + } +} + +func validGoIdent(id string) string { + if goKeywords[id] { + return "_" + id + } + return id +} + +func (g *GoGenerator) error(err error) { + panic(err) +} + +func (g *GoGenerator) write(w io.Writer, f string, a ...interface{}) error { + if _, err := io.WriteString(w, fmt.Sprintf(f, a...)); err != nil { + g.error(err) + return err + } + return nil +} + +func (g *GoGenerator) formatType(pkg string, thrift *parser.Thrift, typ *parser.Type, optional bool) string { + // Follow includes + if strings.Contains(typ.Name, ".") { + // . + parts := strings.SplitN(typ.Name, ".", 2) + // Get Thrift struct for the given include + thriftFilename := thrift.Includes[parts[0]] + if thriftFilename == "" { + g.error(ErrMissingInclude(parts[0])) + } + thrift = g.ThriftFiles[thriftFilename] + if thrift == nil { + g.error(ErrMissingInclude(thriftFilename)) + } + pkg = g.Packages[thriftFilename].Name + typ = &parser.Type{ + Name: parts[1], + KeyType: typ.KeyType, + ValueType: typ.ValueType, + } + } + + ptr := "" + if *flagGoPointers || optional { + ptr = "*" + } + switch typ.Name { + case "byte", "bool", "string": + return ptr + typ.Name + case "binary": + if *flagGoBinarystring { + return ptr + "string" + } + return "[]byte" + case "i16": + return ptr + "int16" + case "i32": + return ptr + "int32" + case "i64": + return ptr + "int64" + case "double": + return ptr + "float64" + case "set": + valueType := g.formatType(pkg, thrift, typ.ValueType, false) + if valueType == "[]byte" { + valueType = "string" + } + return "map[" + valueType + "]struct{}" + case "list": + return "[]" + g.formatType(pkg, thrift, typ.ValueType, false) + case "map": + keyType := g.formatType(pkg, thrift, typ.KeyType, false) + if keyType == "[]byte" { + // TODO: Log, warn, do something! + // println("key type of []byte not supported for maps") + keyType = "string" + } + return "map[" + keyType + "]" + g.formatType(pkg, thrift, typ.ValueType, false) + } + + if t := thrift.Typedefs[typ.Name]; t != nil { + return g.formatType(pkg, thrift, t, optional) + } + if e := thrift.Enums[typ.Name]; e != nil { + name := e.Name + if pkg != g.pkg { + name = pkg + "." + name + } + return ptr + name + } + if s := thrift.Structs[typ.Name]; s != nil { + name := s.Name + if pkg != g.pkg { + name = pkg + "." + name + } + return "*" + name + } + if e := thrift.Exceptions[typ.Name]; e != nil { + name := e.Name + if pkg != g.pkg { + name = pkg + "." + name + } + return "*" + name + } + + g.error(ErrUnknownType(typ.Name)) + return "" +} + +// Follow typedefs to the actual type +func (g *GoGenerator) resolveType(typ *parser.Type) string { + if t := g.thrift.Typedefs[typ.Name]; t != nil { + return g.resolveType(t) + } + return typ.Name +} + +func (g *GoGenerator) formatField(field *parser.Field) string { + tags := "" + jsonTags := "" + if !field.Optional { + tags = ",required" + } else { + jsonTags = ",omitempty" + } + return fmt.Sprintf( + "%s %s `thrift:\"%d%s\" json:\"%s%s\"`", + camelCase(field.Name), g.formatType(g.pkg, g.thrift, field.Type, field.Optional), field.Id, tags, field.Name, jsonTags) +} + +func (g *GoGenerator) formatArguments(arguments []*parser.Field) string { + args := make([]string, len(arguments)) + for i, arg := range arguments { + args[i] = fmt.Sprintf("%s %s", validGoIdent(lowerCamelCase(arg.Name)), g.formatType(g.pkg, g.thrift, arg.Type, arg.Optional)) + } + return strings.Join(args, ", ") +} + +func (g *GoGenerator) formatReturnType(typ *parser.Type, named bool) string { + if typ == nil || typ.Name == "void" { + if named { + return "(err error)" + } + return "error" + } + if named { + return fmt.Sprintf("(ret %s, err error)", g.formatType(g.pkg, g.thrift, typ, false)) + } + return fmt.Sprintf("(%s, error)", g.formatType(g.pkg, g.thrift, typ, false)) +} + +func (g *GoGenerator) writeConstant(out io.Writer, c *parser.Constant) error { + return g.write(out, "\nconst %s = %+v\n", camelCase(c.Name), c.Value) +} + +func (g *GoGenerator) writeEnum(out io.Writer, enum *parser.Enum) error { + enumName := camelCase(enum.Name) + + g.write(out, "\ntype %s int32\n", enumName) + + valueNames := sortedKeys(enum.Values) + g.write(out, "\nconst (\n") + for _, name := range valueNames { + val := enum.Values[name] + g.write(out, "\t%s%s %s = %d\n", enumName, camelCase(name), enumName, val.Value) + } + g.write(out, ")\n") + + // begin var + g.write(out, "\nvar (\n") + + // EnumByName + g.write(out, "\t%sByName = map[string]%s{\n", enumName, enumName) + for _, name := range valueNames { + realName := enum.Name + "." + name + fullName := enumName + camelCase(name) + g.write(out, "\t\t\"%s\": %s,\n", realName, fullName) + } + g.write(out, "\t}\n") + + // EnumByValue + g.write(out, "\t%sByValue = map[%s]string{\n", enumName, enumName) + for _, name := range valueNames { + realName := enum.Name + "." + name + fullName := enumName + camelCase(name) + g.write(out, "\t\t%s: \"%s\",\n", fullName, realName) + } + g.write(out, "\t}\n") + + // end var + g.write(out, ")\n") + + g.write(out, ` +func (e %s) String() string { + name := %sByValue[e] + if name == "" { + name = fmt.Sprintf("Unknown enum value %s(%%d)", e) + } + return name +} +`, enumName, enumName, enumName) + + if !*flagGoJsonEnumnum { + g.write(out, ` +func (e %s) MarshalJSON() ([]byte, error) { + name := %sByValue[e] + if name == "" { + name = strconv.Itoa(int(e)) + } + return []byte("\""+name+"\""), nil +} +`, enumName, enumName) + } + + g.write(out, ` +func (e *%s) UnmarshalJSON(b []byte) error { + st := string(b) + if st[0] == '"' { + *e = %s(%sByName[st[1:len(st)-1]]) + return nil + } + i, err := strconv.Atoi(st) + *e = %s(i) + return err +} +`, enumName, enumName, enumName, enumName) + + return nil +} + +func (g *GoGenerator) writeStruct(out io.Writer, st *parser.Struct) error { + structName := camelCase(st.Name) + + g.write(out, "\ntype %s struct {\n", structName) + for _, field := range st.Fields { + g.write(out, "\t%s\n", g.formatField(field)) + } + return g.write(out, "}\n") +} + +func (g *GoGenerator) writeException(out io.Writer, ex *parser.Struct) error { + if err := g.writeStruct(out, ex); err != nil { + return err + } + + exName := camelCase(ex.Name) + + g.write(out, "\nfunc (e *%s) Error() string {\n", exName) + if len(ex.Fields) == 0 { + g.write(out, "\treturn \"%s{}\"\n", exName) + } else { + fieldNames := make([]string, len(ex.Fields)) + fieldVars := make([]string, len(ex.Fields)) + for i, field := range ex.Fields { + fieldNames[i] = camelCase(field.Name) + ": %+v" + fieldVars[i] = "e." + camelCase(field.Name) + } + g.write(out, "\treturn fmt.Sprintf(\"%s{%s}\", %s)\n", + exName, strings.Join(fieldNames, ", "), strings.Join(fieldVars, ", ")) + } + return g.write(out, "}\n") +} + +func (g *GoGenerator) writeService(out io.Writer, svc *parser.Service) error { + svcName := camelCase(svc.Name) + + // Service interface + + g.write(out, "\ntype %s interface {\n", svcName) + if svc.Extends != "" { + g.write(out, "\t%s\n", camelCase(svc.Extends)) + } + methodNames := sortedKeys(svc.Methods) + for _, k := range methodNames { + method := svc.Methods[k] + g.write(out, + "\t%s(%s) %s\n", + camelCase(method.Name), g.formatArguments(method.Arguments), + g.formatReturnType(method.ReturnType, false)) + } + g.write(out, "}\n") + + // Server + + if svc.Extends == "" { + g.write(out, "\ntype %sServer struct {\n\tImplementation %s\n}\n", svcName, svcName) + } else { + g.write(out, "\ntype %sServer struct {\n\t%sServer\n\tImplementation %s\n}\n", svcName, camelCase(svc.Extends), svcName) + } + + // Server method wrappers + + for _, k := range methodNames { + method := svc.Methods[k] + mName := camelCase(method.Name) + resArg := "" + if !method.Oneway { + resArg = fmt.Sprintf(", res *%s%sResponse", svcName, mName) + } + g.write(out, "\nfunc (s *%sServer) %s(req *%s%sRequest%s) error {\n", svcName, mName, svcName, mName, resArg) + args := make([]string, 0) + for _, arg := range method.Arguments { + aName := camelCase(arg.Name) + args = append(args, "req."+aName) + } + isVoid := method.ReturnType == nil || method.ReturnType.Name == "void" + val := "" + if !isVoid { + val = "val, " + } + g.write(out, "\t%serr := s.Implementation.%s(%s)\n", val, mName, strings.Join(args, ", ")) + if len(method.Exceptions) > 0 { + g.write(out, "\tswitch e := err.(type) {\n") + for _, ex := range method.Exceptions { + g.write(out, "\tcase %s:\n\t\tres.%s = e\n\t\terr = nil\n", g.formatType(g.pkg, g.thrift, ex.Type, false), camelCase(ex.Name)) + } + g.write(out, "\t}\n") + } + if !isVoid { + if !*flagGoPointers && basicTypes[g.resolveType(method.ReturnType)] { + g.write(out, "\tres.Value = &val\n") + } else { + g.write(out, "\tres.Value = val\n") + } + } + g.write(out, "\treturn err\n}\n") + } + + for _, k := range methodNames { + // Request struct + method := svc.Methods[k] + reqStructName := svcName + camelCase(method.Name) + "Request" + if err := g.writeStruct(out, &parser.Struct{Name: reqStructName, Fields: method.Arguments}); err != nil { + return err + } + + if method.Oneway { + g.write(out, "\nfunc (r *%s) Oneway() bool {\n\treturn true\n}\n", reqStructName) + } else { + // Response struct + args := make([]*parser.Field, 0, len(method.Exceptions)) + if method.ReturnType != nil && method.ReturnType.Name != "void" { + args = append(args, &parser.Field{Id: 0, Name: "value", Optional: true /*len(method.Exceptions) != 0*/, Type: method.ReturnType, Default: nil}) + } + for _, ex := range method.Exceptions { + args = append(args, ex) + } + res := &parser.Struct{Name: svcName + camelCase(method.Name) + "Response", Fields: args} + if err := g.writeStruct(out, res); err != nil { + return err + } + } + } + + if svc.Extends == "" { + g.write(out, "\ntype %sClient struct {\n\tClient RPCClient\n}\n", svcName) + } else { + g.write(out, "\ntype %sClient struct {\n\t%sClient\n}\n", svcName, camelCase(svc.Extends)) + } + + for _, k := range methodNames { + method := svc.Methods[k] + methodName := camelCase(method.Name) + returnType := "err error" + if !method.Oneway { + returnType = g.formatReturnType(method.ReturnType, true) + } + g.write(out, "\nfunc (s *%sClient) %s(%s) %s {\n", + svcName, methodName, + g.formatArguments(method.Arguments), + returnType) + + // Request + g.write(out, "\treq := &%s%sRequest{\n", svcName, methodName) + for _, arg := range method.Arguments { + g.write(out, "\t\t%s: %s,\n", camelCase(arg.Name), validGoIdent(lowerCamelCase(arg.Name))) + } + g.write(out, "\t}\n") + + // Response + if method.Oneway { + // g.write(out, "\tvar res *%s%sResponse = nil\n", svcName, methodName) + g.write(out, "\tvar res interface{} = nil\n") + } else { + g.write(out, "\tres := &%s%sResponse{}\n", svcName, methodName) + } + + // Call + g.write(out, "\terr = s.Client.Call(\"%s\", req, res)\n", method.Name) + + // Exceptions + if len(method.Exceptions) > 0 { + g.write(out, "\tif err == nil {\n\t\tswitch {\n") + for _, ex := range method.Exceptions { + exName := camelCase(ex.Name) + g.write(out, "\t\tcase res.%s != nil:\n\t\t\terr = res.%s\n", exName, exName) + } + g.write(out, "\t\t}\n\t}\n") + } + + if method.ReturnType != nil && method.ReturnType.Name != "void" { + if !*flagGoPointers && basicTypes[g.resolveType(method.ReturnType)] { + g.write(out, "\tif err == nil && res.Value != nil {\n\t ret = *res.Value\n}\n") + } else { + g.write(out, "\tif err == nil {\n\tret = res.Value\n}\n") + } + } + g.write(out, "\treturn\n") + g.write(out, "}\n") + } + + return nil +} + +func (g *GoGenerator) generateSingle(out io.Writer, thriftPath string, thrift *parser.Thrift) { + packageName := g.Packages[thriftPath].Name + g.thrift = thrift + g.pkg = packageName + + g.write(out, "// This file is automatically generated. Do not modify.\n") + g.write(out, "\npackage %s\n", packageName) + + // Imports + imports := []string{"fmt"} + if len(thrift.Enums) > 0 { + imports = append(imports, "strconv") + } + if len(thrift.Includes) > 0 { + for _, path := range thrift.Includes { + pkg := g.Packages[path].Name + if pkg != packageName { + imports = append(imports, pkg) + } + } + } + if len(imports) > 0 { + g.write(out, "\nimport (\n") + for _, in := range imports { + g.write(out, "\t\"%s\"\n", in) + } + g.write(out, ")\n") + } + + g.write(out, "\nvar _ = fmt.Printf\n") + + // + + if len(thrift.Constants) > 0 { + g.write(out, "\nconst (\n") + for _, k := range sortedKeys(thrift.Constants) { + c := thrift.Constants[k] + g.write(out, "\t%s = %+v\n", camelCase(c.Name), c.Value) + } + g.write(out, ")\n") + } + + for _, k := range sortedKeys(thrift.Enums) { + enum := thrift.Enums[k] + if err := g.writeEnum(out, enum); err != nil { + g.error(err) + } + } + + for _, k := range sortedKeys(thrift.Structs) { + st := thrift.Structs[k] + if err := g.writeStruct(out, st); err != nil { + g.error(err) + } + } + + for _, k := range sortedKeys(thrift.Exceptions) { + ex := thrift.Exceptions[k] + if err := g.writeException(out, ex); err != nil { + g.error(err) + } + } + + for _, k := range sortedKeys(thrift.Services) { + svc := thrift.Services[k] + if err := g.writeService(out, svc); err != nil { + g.error(err) + } + } +} + +func (g *GoGenerator) Generate(outPath string) (err error) { + defer func() { + if r := recover(); r != nil { + if _, ok := r.(runtime.Error); ok { + panic(r) + } + err = r.(error) + } + }() + + // Generate package namespace mapping if necessary + if g.Packages == nil { + g.Packages = make(map[string]GoPackage) + } + for path, th := range g.ThriftFiles { + if pkg, ok := g.Packages[path]; !ok || pkg.Name == "" { + pkg := GoPackage{} + for _, k := range goNamespaceOrder { + pkg.Name = th.Namespaces[k] + if pkg.Name != "" { + parts := strings.Split(pkg.Name, ".") + if len(parts) > 1 { + pkg.Path = strings.Join(parts[:len(parts)-1], "/") + pkg.Name = parts[len(parts)-1] + } + break + } + } + if pkg.Name == "" { + pkg.Name = filepath.Base(path) + } + pkg.Name = validIdentifier(strings.ToLower(pkg.Name), "_") + g.Packages[path] = pkg + } + } + + rpcPackages := map[string]string{} + + for path, th := range g.ThriftFiles { + pkg := g.Packages[path] + filename := strings.ToLower(filepath.Base(path)) + for i := len(filename) - 1; i >= 0; i-- { + if filename[i] == '.' { + filename = filename[:i] + } + } + filename += ".go" + pkgpath := filepath.Join(outPath, pkg.Path, pkg.Name) + outfile := filepath.Join(pkgpath, filename) + + if err := os.MkdirAll(pkgpath, 0755); err != nil && !os.IsExist(err) { + g.error(err) + } + + out := &bytes.Buffer{} + g.generateSingle(out, path, th) + + if len(th.Services) > 0 { + rpcPackages[pkgpath] = pkg.Name + } + + outBytes := out.Bytes() + if true { + outBytes, err = format.Source(outBytes) + if err != nil { + g.error(err) + } + } + + fi, err := os.OpenFile(outfile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) + if err != nil { + fmt.Fprintf(os.Stderr, "%s\n", err.Error()) + os.Exit(2) + } + if _, err := fi.Write(outBytes); err != nil { + fi.Close() + g.error(err) + } + fi.Close() + } + + for path, name := range rpcPackages { + outfile := filepath.Join(path, "rpc_stub.go") + + fi, err := os.OpenFile(outfile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) + if err != nil { + fmt.Fprintf(os.Stderr, "%s\n", err.Error()) + os.Exit(2) + } + _, err = fi.WriteString(fmt.Sprintf("package %s\n\ntype RPCClient interface {\n"+ + "\tCall(method string, request interface{}, response interface{}) error\n"+ + "}\n", name)) + fi.Close() + if err != nil { + fmt.Fprintf(os.Stderr, "%s\n", err.Error()) + os.Exit(2) + } + } + + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/generator/main.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/generator/main.go new file mode 100644 index 00000000..90cee96b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/generator/main.go @@ -0,0 +1,118 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package main + +import ( + "flag" + "fmt" + "os" + "reflect" + "regexp" + "sort" + "strings" + + "github.com/samuel/go-thrift/parser" + "github.com/samuel/go-thrift/thrift" +) + +func camelCase(st string) string { + if strings.ToUpper(st) == st { + st = strings.ToLower(st) + } + return thrift.CamelCase(st) +} + +func lowerCamelCase(st string) string { + if len(st) <= 1 { + return strings.ToLower(st) + } + st = thrift.CamelCase(st) + return strings.ToLower(st[:1]) + st[1:] +} + +// Converts a string to a valid Golang identifier, as defined in +// http://golang.org/ref/spec#identifier +// by converting invalid characters to the value of replace. +// If the first character is a Unicode digit, then replace is +// prepended to the string. +func validIdentifier(st string, replace string) string { + var ( + invalid_rune = regexp.MustCompile("[^\\pL\\pN_]") + invalid_start = regexp.MustCompile("^\\pN") + out string + ) + out = invalid_rune.ReplaceAllString(st, "_") + if invalid_start.MatchString(out) { + out = fmt.Sprintf("%v%v", replace, out) + } + return out +} + +// Given a map with string keys, return a sorted list of keys. +// If m is not a map or doesn't have string keys then return nil. +func sortedKeys(m interface{}) []string { + value := reflect.ValueOf(m) + if value.Kind() != reflect.Map || value.Type().Key().Kind() != reflect.String { + return nil + } + + valueKeys := value.MapKeys() + keys := make([]string, len(valueKeys)) + for i, k := range valueKeys { + keys[i] = k.String() + } + sort.Strings(keys) + return keys +} + +func main() { + flag.Parse() + + if flag.NArg() < 2 { + fmt.Fprintf(os.Stderr, "Usage of %s: [options] inputfile outputpath\n", os.Args[0]) + flag.PrintDefaults() + os.Exit(1) + } + + filename := flag.Arg(0) + outpath := flag.Arg(1) + + // out := os.Stdout + // if outfilename != "-" { + // var err error + // out, err = os.OpenFile(outfilename, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0644) + // if err != nil { + // fmt.Fprintf(os.Stderr, "%s\n", err.Error()) + // os.Exit(2) + // } + // } + + p := &parser.Parser{} + parsedThrift, _, err := p.ParseFile(filename) + if e, ok := err.(*parser.ErrSyntaxError); ok { + fmt.Printf("%s\n", e.Left) + fmt.Fprintf(os.Stderr, "%s\n", err.Error()) + os.Exit(2) + } else if err != nil { + fmt.Fprintf(os.Stderr, "%s\n", err.Error()) + os.Exit(2) + } + + // fp := strings.Split(filename, "/") + // name := strings.Split(fp[len(fp)-1], ".")[0] + + generator := &GoGenerator{ + ThriftFiles: parsedThrift, + } + err = generator.Generate(outpath) + if err != nil { + fmt.Fprintf(os.Stderr, "%s\n", err.Error()) + os.Exit(2) + } + + // if outfilename != "-" { + // out.Close() + // } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/parser/parser.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/parser/parser.go new file mode 100644 index 00000000..3316f7b2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/parser/parser.go @@ -0,0 +1,585 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package parser + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/samuel/go-parser/parser" +) + +type Filesystem interface { + Open(filename string) (io.ReadCloser, error) + Abs(path string) (string, error) +} + +type Parser struct { + Filesystem Filesystem // For handling includes. Can be set to nil to fall back to os package. +} + +type ErrSyntaxError struct { + File string + Line int + Column int + Offset int + Left string +} + +func (e *ErrSyntaxError) Error() string { + return fmt.Sprintf("Syntax Error %s:%d column %d offset %d", + e.File, e.Line, e.Column, e.Offset) +} + +var ( + ErrParserFail = errors.New("thrift.parser: parsing failed entirely") + + spec = parser.Spec{ + CommentStart: "/*", + CommentEnd: "*/", + CommentLine: parser.Any(parser.String("#"), parser.String("//")), + NestedComments: true, + IdentStart: parser.Satisfy( + func(c rune) bool { + return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' + }), + IdentLetter: parser.Satisfy( + func(c rune) bool { + return (c >= 'A' && c <= 'Z') || + (c >= 'a' && c <= 'z') || + (c >= '0' && c <= '9') || + c == '.' || c == '_' + }), + ReservedNames: []string{ + "namespace", "struct", "enum", "const", "service", "throws", + "required", "optional", "exception", "list", "map", "set", + }, + } + simpleParser = buildParser() +) + +func quotedString() parser.Parser { + return func(st *parser.State) (parser.Output, bool, error) { + next, err := st.Input.Next() + if err != nil || (next != '"' && next != '\'') { + return nil, false, err + } + quote := next + + st.Input.Pop(1) + + escaped := false + runes := make([]rune, 1, 8) + runes[0] = quote + for { + next, err := st.Input.Next() + if err != nil { + return nil, false, err + } + st.Input.Pop(1) + if escaped { + switch next { + case 'n': + next = '\n' + case 'r': + next = '\r' + case 't': + next = '\t' + } + runes = append(runes, next) + escaped = false + } else { + if next == '\\' { + escaped = true + } else { + runes = append(runes, next) + } + + if next == quote { + break + } + } + } + + return string(runes), true, nil + } +} + +func integer() parser.Parser { + return func(st *parser.State) (parser.Output, bool, error) { + next, err := st.Input.Next() + if err != nil || ((next < '0' || next > '9') && next != '-') { + return nil, false, err + } + + st.Input.Pop(1) + + runes := make([]rune, 1, 8) + runes[0] = next + for { + next, err := st.Input.Next() + if err == io.EOF || !(next >= '0' && next <= '9') { + break + } else if err != nil { + return nil, false, err + } + st.Input.Pop(1) + runes = append(runes, next) + } + + // We're guaranteed to only have integers here so don't check the error + i64, _ := strconv.ParseInt(string(runes), 10, 64) + return i64, true, nil + } +} + +func float() parser.Parser { + return func(st *parser.State) (parser.Output, bool, error) { + next, err := st.Input.Next() + if err != nil || ((next < '0' || next > '9') && next != '-') { + return nil, false, err + } + + st.Input.Pop(1) + + runes := make([]rune, 1, 8) + runes[0] = next + for { + next, err := st.Input.Next() + if err == io.EOF || !((next >= '0' && next <= '9') || next == '.') { + break + } else if err != nil { + return nil, false, err + } + st.Input.Pop(1) + runes = append(runes, next) + } + + f64, err := strconv.ParseFloat(string(runes), 64) + if err != nil { + return nil, false, nil + } + return f64, true, nil + } +} + +type symbolValue struct { + symbol string + value interface{} +} + +func symbolDispatcher(table map[string]parser.Parser) parser.Parser { + ws := parser.Whitespace() + return func(st *parser.State) (parser.Output, bool, error) { + next, err := st.Input.Next() + if err != nil || !(next >= 'a' && next <= 'z') { + return nil, false, err + } + st.Input.Pop(1) + + runes := make([]rune, 1, 8) + runes[0] = next + for { + next, err := st.Input.Next() + if err == io.EOF || next == ' ' { + break + } else if err != nil { + return nil, false, err + } + st.Input.Pop(1) + runes = append(runes, next) + } + + sym := string(runes) + par := table[sym] + if par == nil { + return nil, false, nil + } + _, ok, err := ws(st) + if !ok || err != nil { + return nil, false, err + } + out, ok, err := par(st) + return symbolValue{sym, out}, ok, err + } +} + +func nilParser() parser.Parser { + return func(st *parser.State) (parser.Output, bool, error) { + return nil, true, nil + } +} + +func parseType(t interface{}) *Type { + typ := &Type{} + switch t2 := t.(type) { + case string: + if t2 == "void" { + return nil + } + typ.Name = t2 + case []interface{}: + typ.Name = t2[0].(string) + if typ.Name == "map" { + typ.KeyType = parseType(t2[2]) + typ.ValueType = parseType(t2[4]) + } else if typ.Name == "list" || typ.Name == "set" { + typ.ValueType = parseType(t2[2]) + } else { + panic("Basic type should never not be map or list: " + typ.Name) + } + default: + panic("Type should never be anything but string or []interface{}") + } + return typ +} + +func parseFields(fi []interface{}) []*Field { + fields := make([]*Field, len(fi)) + nextId := 1 + for i, f := range fi { + parts := f.([]interface{}) + field := &Field{} + if parts[0] != nil { + field.Id = int(parts[0].([]interface{})[0].(int64)) + } else { + field.Id = nextId + } + if field.Id >= nextId { + nextId = field.Id + 1 + } + field.Optional = strings.ToLower(parts[1].(string)) == "optional" + field.Type = parseType(parts[2]) + field.Name = parts[3].(string) + field.Default = parts[4] + fields[i] = field + } + return fields +} + +func buildParser() parser.Parser { + constantValue := parser.Lexeme(parser.Any(quotedString(), integer(), float())) + namespaceDef := parser.Collect( + parser.Identifier(), parser.Identifier()) + includeDef := parser.Collect( + parser.Lexeme(quotedString())) + var typeDef func(st *parser.State) (parser.Output, bool, error) + recurseTypeDef := func(st *parser.State) (parser.Output, bool, error) { + return typeDef(st) + } + typeDef = parser.Any( + parser.Identifier(), + parser.Collect(parser.Symbol("list"), + parser.Symbol("<"), + recurseTypeDef, + parser.Symbol(">")), + parser.Collect(parser.Symbol("set"), + parser.Symbol("<"), + recurseTypeDef, + parser.Symbol(">")), + parser.Collect(parser.Symbol("map"), + parser.Symbol("<"), + recurseTypeDef, + parser.Symbol(","), + recurseTypeDef, + parser.Symbol(">")), + ) + typedefDef := parser.Collect(typeDef, parser.Identifier()) + constDef := parser.Collect( + typeDef, parser.Identifier(), parser.Symbol("="), constantValue, + parser.Any( + parser.Symbol(","), + parser.Symbol(";"), + parser.Symbol(""), + ), + ) + enumItemDef := parser.Collect( + parser.Identifier(), + parser.Any( + parser.All(parser.Symbol("="), parser.Lexeme(integer())), + nilParser(), + ), + parser.Any(parser.Symbol(","), parser.Symbol(";"), parser.Symbol("")), + ) + enumDef := parser.Collect( + parser.Identifier(), + parser.Symbol("{"), + parser.Many(enumItemDef), + parser.Symbol("}"), + ) + structFieldDef := parser.Collect( + parser.Any( + parser.Collect(parser.Lexeme(integer()), parser.Symbol(":")), + nilParser(), + ), + parser.Any(parser.Symbol("required"), parser.Symbol("optional"), parser.Symbol("")), + typeDef, parser.Identifier(), + // Default + parser.Any( + parser.All(parser.Symbol("="), + parser.Lexeme(parser.Any( + parser.Identifier(), quotedString(), + parser.Try(float()), integer()))), + nilParser(), + ), + parser.Skip(parser.Any(parser.Symbol(","), parser.Symbol(";"), parser.Symbol(""))), + ) + structDef := parser.Collect( + parser.Identifier(), + parser.Symbol("{"), + parser.Many(structFieldDef), + parser.Symbol("}"), + ) + serviceMethodDef := parser.Collect( + // // parser.Comments(), + // parser.Whitespace(), + parser.Any(parser.Symbol("oneway"), parser.Symbol("")), + typeDef, parser.Identifier(), + parser.Symbol("("), + parser.Many(structFieldDef), + parser.Symbol(")"), + // Exceptions + parser.Any( + parser.Collect( + parser.Symbol("throws"), + parser.Symbol("("), + parser.Many(structFieldDef), + parser.Symbol(")"), + ), + nilParser(), + ), + parser.Any(parser.Symbol(","), parser.Symbol(";"), parser.Symbol("")), + ) + // [extends ] { <*serviceMethodDef> } + serviceDef := parser.Collect( + parser.Identifier(), + parser.Any( + parser.Collect(parser.Symbol("extends"), parser.Identifier()), + nilParser(), + ), + parser.Symbol("{"), + parser.Many(serviceMethodDef), + parser.Symbol("}"), + ) + thriftSpec := parser.All(parser.Whitespace(), parser.Many( + symbolDispatcher(map[string]parser.Parser{ + "namespace": namespaceDef, + "typedef": typedefDef, + "const": constDef, + "include": includeDef, + "enum": enumDef, + "exception": structDef, + "struct": structDef, + "service": serviceDef, + }), + )) + return thriftSpec +} + +func (p *Parser) outputToThrift(obj parser.Output) (*Thrift, error) { + thrift := &Thrift{ + Namespaces: make(map[string]string), + Typedefs: make(map[string]*Type), + Constants: make(map[string]*Constant), + Enums: make(map[string]*Enum), + Structs: make(map[string]*Struct), + Exceptions: make(map[string]*Struct), + Services: make(map[string]*Service), + Includes: make(map[string]string), + } + + for _, symI := range obj.([]interface{}) { + sym := symI.(symbolValue) + val := sym.value.([]interface{}) + switch sym.symbol { + case "namespace": + thrift.Namespaces[strings.ToLower(val[0].(string))] = val[1].(string) + case "typedef": + thrift.Typedefs[val[1].(string)] = parseType(val[0]) + case "const": + thrift.Constants[val[1].(string)] = &Constant{val[1].(string), &Type{Name: val[0].(string)}, val[3]} + case "enum": + en := &Enum{ + Name: val[0].(string), + Values: make(map[string]*EnumValue), + } + next := 0 + for _, e := range val[2].([]interface{}) { + parts := e.([]interface{}) + name := parts[0].(string) + val := -1 + if parts[1] != nil { + val = int(parts[1].(int64)) + } else { + val = next + } + if val >= next { + next = val + 1 + } + en.Values[name] = &EnumValue{name, val} + } + thrift.Enums[en.Name] = en + case "struct": + thrift.Structs[val[0].(string)] = &Struct{ + Name: val[0].(string), + Fields: parseFields(val[2].([]interface{})), + } + case "exception": + thrift.Exceptions[val[0].(string)] = &Struct{ + Name: val[0].(string), + Fields: parseFields(val[2].([]interface{})), + } + case "service": + s := &Service{ + Name: val[0].(string), + Methods: make(map[string]*Method), + } + if val[1] != nil { + extends := val[1].([]interface{}) + s.Extends = extends[1].(string) + } + for _, m := range val[3].([]interface{}) { + parts := m.([]interface{}) + oneway := parts[0].(string) == "oneway" + returnType := parseType(parts[1]) + if oneway && returnType != nil { + return nil, errors.New("thrift: oneway methods must be void") + } + var exc []*Field = nil + if parts[6] != nil { + exc = parseFields((parts[6].([]interface{}))[2].([]interface{})) + } else { + exc = make([]*Field, 0) + } + for _, f := range exc { + f.Optional = true + } + method := &Method{ + Name: parts[2].(string), + Oneway: oneway, + ReturnType: returnType, + Arguments: parseFields(parts[4].([]interface{})), + Exceptions: exc, + } + s.Methods[method.Name] = method + } + thrift.Services[s.Name] = s + case "include": + filename := val[0].(string) + filename = filename[1 : len(filename)-1] + newincludename := strings.Split(filepath.Base(filename), ".")[0] + thrift.Includes[newincludename] = filename + default: + panic("Should never have an unhandled symbol: " + sym.symbol) + } + } + return thrift, nil +} + +func (p *Parser) Parse(r io.Reader) (*Thrift, error) { + b, err := ioutil.ReadAll(r) + if err != nil { + return nil, err + } + + str := string(b) + in := parser.NewStringInput(str) + st := &parser.State{ + Input: in, + Spec: spec, + } + out, ok, err := simpleParser(st) + + if err != nil && err != io.EOF { + return nil, err + } + if !ok { + return nil, ErrParserFail + } + + if err != io.EOF { + _, err = st.Input.Next() + } + if err != io.EOF { + pos := in.Position() + return nil, &ErrSyntaxError{ + File: pos.Name, + Line: pos.Line, + Column: pos.Column, + Offset: pos.Offset, + Left: str[pos.Offset:], + } + } + + return p.outputToThrift(out) +} + +func (p *Parser) ParseFile(filename string) (map[string]*Thrift, string, error) { + files := make(map[string]*Thrift) + + absPath, err := p.abs(filename) + if err != nil { + return nil, "", err + } + basePath := filepath.Dir(absPath) + + path := absPath + for path != "" { + rd, err := p.open(path) + if err != nil { + return nil, "", err + } + thrift, err := p.Parse(rd) + if err != nil { + return nil, "", err + } + files[path] = thrift + + for incName, incPath := range thrift.Includes { + p, err := p.abs(filepath.Join(basePath, incPath)) + if err != nil { + return nil, "", err + } + thrift.Includes[incName] = p + } + + // Find path for next unparsed include + path = "" + for _, th := range files { + for _, incPath := range th.Includes { + if files[incPath] == nil { + path = incPath + break + } + } + } + } + + return files, absPath, nil +} + +func (p *Parser) open(path string) (io.ReadCloser, error) { + if p.Filesystem == nil { + return os.Open(path) + } + return p.Filesystem.Open(path) +} + +func (p *Parser) abs(path string) (string, error) { + if p.Filesystem == nil { + absPath, err := filepath.Abs(path) + if err != nil { + return "", err + } + return filepath.Clean(absPath), nil + } + return p.Filesystem.Abs(path) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/parser/types.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/parser/types.go new file mode 100644 index 00000000..a5105aa6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/parser/types.go @@ -0,0 +1,66 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package parser + +type Type struct { + Name string + KeyType *Type // If map + ValueType *Type // If map or list +} + +type EnumValue struct { + Name string + Value int +} + +type Enum struct { + Name string + Values map[string]*EnumValue +} + +type Constant struct { + Name string + Type *Type + Value interface{} +} + +type Field struct { + Id int + Name string + Optional bool + Type *Type + Default interface{} +} + +type Struct struct { + Name string + Fields []*Field +} + +type Method struct { + Comment string + Name string + Oneway bool + ReturnType *Type + Arguments []*Field + Exceptions []*Field +} + +type Service struct { + Name string + Extends string + Methods map[string]*Method +} + +type Thrift struct { + Includes map[string]string // name -> unique identifier (absolute path generally) + Typedefs map[string]*Type + Namespaces map[string]string + Constants map[string]*Constant + Enums map[string]*Enum + Structs map[string]*Struct + Exceptions map[string]*Struct + Services map[string]*Service +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/testfiles/Hbase.thrift b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/testfiles/Hbase.thrift new file mode 100644 index 00000000..2f1f4bc1 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/testfiles/Hbase.thrift @@ -0,0 +1,925 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ---------------------------------------------------------------- +// Hbase.thrift +// +// This is a Thrift interface definition file for the Hbase service. +// Target language libraries for C++, Java, Ruby, PHP, (and more) are +// generated by running this file through the Thrift compiler with the +// appropriate flags. The Thrift compiler binary and runtime +// libraries for various languages are available +// from the Apache Incubator (http://incubator.apache.org/thrift/) +// +// See the package.html file for information on the version of Thrift +// used to generate the *.java files checked into the Hbase project. +// ---------------------------------------------------------------- + +namespace java org.apache.hadoop.hbase.thrift.generated +namespace cpp apache.hadoop.hbase.thrift +namespace rb Apache.Hadoop.Hbase.Thrift +namespace py hbase +namespace perl Hbase +namespace php Hbase +// +// Types +// + +// NOTE: all variables with the Text type are assumed to be correctly +// formatted UTF-8 strings. This is a programming language and locale +// dependent property that the client application is repsonsible for +// maintaining. If strings with an invalid encoding are sent, an +// IOError will be thrown. + +typedef binary Text +typedef binary Bytes +typedef i32 ScannerID + +/** + * TCell - Used to transport a cell value (byte[]) and the timestamp it was + * stored with together as a result for get and getRow methods. This promotes + * the timestamp of a cell to a first-class value, making it easy to take + * note of temporal data. Cell is used all the way from HStore up to HTable. + */ +struct TCell{ + 1:Bytes value, + 2:i64 timestamp +} + +/** + * An HColumnDescriptor contains information about a column family + * such as the number of versions, compression settings, etc. It is + * used as input when creating a table or adding a column. + */ +struct ColumnDescriptor { + 1:Text name, + 2:i32 maxVersions = 3, + 3:string compression = "NONE", + 4:bool inMemory = 0, + 5:string bloomFilterType = "NONE", + 6:i32 bloomFilterVectorSize = 0, + 7:i32 bloomFilterNbHashes = 0, + 8:bool blockCacheEnabled = 0, + 9:i32 timeToLive = -1 +} + +/** + * A TRegionInfo contains information about an HTable region. + */ +struct TRegionInfo { + 1:Text startKey, + 2:Text endKey, + 3:i64 id, + 4:Text name, + 5:byte version, + 6:Text serverName, + 7:i32 port +} + +/** + * A Mutation object is used to either update or delete a column-value. + */ +struct Mutation { + 1:bool isDelete = 0, + 2:Text column, + 3:Text value, + 4:bool writeToWAL = 1 +} + + +/** + * A BatchMutation object is used to apply a number of Mutations to a single row. + */ +struct BatchMutation { + 1:Text row, + 2:list mutations +} + +/** + * For increments that are not incrementColumnValue + * equivalents. + */ +struct TIncrement { + 1:Text table, + 2:Text row, + 3:Text column, + 4:i64 ammount +} + +/** + * Holds column name and the cell. + */ +struct TColumn { + 1:Text columnName, + 2:TCell cell + } + +/** + * Holds row name and then a map of columns to cells. + */ +struct TRowResult { + 1:Text row, + 2:optional map columns, + 3:optional list sortedColumns +} + +/** + * A Scan object is used to specify scanner parameters when opening a scanner. + */ +struct TScan { + 1:optional Text startRow, + 2:optional Text stopRow, + 3:optional i64 timestamp, + 4:optional list columns, + 5:optional i32 caching, + 6:optional Text filterString, + 7:optional i32 batchSize, + 8:optional bool sortColumns +} + +// +// Exceptions +// +/** + * An IOError exception signals that an error occurred communicating + * to the Hbase master or an Hbase region server. Also used to return + * more general Hbase error conditions. + */ +exception IOError { + 1:string message +} + +/** + * An IllegalArgument exception indicates an illegal or invalid + * argument was passed into a procedure. + */ +exception IllegalArgument { + 1:string message +} + +/** + * An AlreadyExists exceptions signals that a table with the specified + * name already exists + */ +exception AlreadyExists { + 1:string message +} + +// +// Service +// + +service Hbase { + /** + * Brings a table on-line (enables it) + */ + void enableTable( + /** name of the table */ + 1:Bytes tableName + ) throws (1:IOError io) + + /** + * Disables a table (takes it off-line) If it is being served, the master + * will tell the servers to stop serving it. + */ + void disableTable( + /** name of the table */ + 1:Bytes tableName + ) throws (1:IOError io) + + /** + * @return true if table is on-line + */ + bool isTableEnabled( + /** name of the table to check */ + 1:Bytes tableName + ) throws (1:IOError io) + + void compact(1:Bytes tableNameOrRegionName) + throws (1:IOError io) + + void majorCompact(1:Bytes tableNameOrRegionName) + throws (1:IOError io) + + /** + * List all the userspace tables. + * + * @return returns a list of names + */ + list getTableNames() + throws (1:IOError io) + + /** + * List all the column families assoicated with a table. + * + * @return list of column family descriptors + */ + map getColumnDescriptors ( + /** table name */ + 1:Text tableName + ) throws (1:IOError io) + + /** + * List the regions associated with a table. + * + * @return list of region descriptors + */ + list getTableRegions( + /** table name */ + 1:Text tableName) + throws (1:IOError io) + + /** + * Create a table with the specified column families. The name + * field for each ColumnDescriptor must be set and must end in a + * colon (:). All other fields are optional and will get default + * values if not explicitly specified. + * + * @throws IllegalArgument if an input parameter is invalid + * + * @throws AlreadyExists if the table name already exists + */ + void createTable( + /** name of table to create */ + 1:Text tableName, + + /** list of column family descriptors */ + 2:list columnFamilies + ) throws (1:IOError io, 2:IllegalArgument ia, 3:AlreadyExists exist) + + /** + * Deletes a table + * + * @throws IOError if table doesn't exist on server or there was some other + * problem + */ + void deleteTable( + /** name of table to delete */ + 1:Text tableName + ) throws (1:IOError io) + + /** + * Get a single TCell for the specified table, row, and column at the + * latest timestamp. Returns an empty list if no such value exists. + * + * @return value for specified row/column + */ + list get( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** column name */ + 3:Text column, + + /** Get attributes */ + 4:map attributes + ) throws (1:IOError io) + + /** + * Get the specified number of versions for the specified table, + * row, and column. + * + * @return list of cells for specified row/column + */ + list getVer( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** column name */ + 3:Text column, + + /** number of versions to retrieve */ + 4:i32 numVersions, + + /** Get attributes */ + 5:map attributes + ) throws (1:IOError io) + + /** + * Get the specified number of versions for the specified table, + * row, and column. Only versions less than or equal to the specified + * timestamp will be returned. + * + * @return list of cells for specified row/column + */ + list getVerTs( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** column name */ + 3:Text column, + + /** timestamp */ + 4:i64 timestamp, + + /** number of versions to retrieve */ + 5:i32 numVersions, + + /** Get attributes */ + 6:map attributes + ) throws (1:IOError io) + + /** + * Get all the data for the specified table and row at the latest + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list getRow( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** Get attributes */ + 3:map attributes + ) throws (1:IOError io) + + /** + * Get the specified columns for the specified table and row at the latest + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list getRowWithColumns( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** List of columns to return, null for all columns */ + 3:list columns, + + /** Get attributes */ + 4:map attributes + ) throws (1:IOError io) + + /** + * Get all the data for the specified table and row at the specified + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list getRowTs( + /** name of the table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** timestamp */ + 3:i64 timestamp, + + /** Get attributes */ + 4:map attributes + ) throws (1:IOError io) + + /** + * Get the specified columns for the specified table and row at the specified + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list getRowWithColumnsTs( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** List of columns to return, null for all columns */ + 3:list columns, + 4:i64 timestamp, + + /** Get attributes */ + 5:map attributes + ) throws (1:IOError io) + + /** + * Get all the data for the specified table and rows at the latest + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + */ + list getRows( + /** name of table */ + 1:Text tableName, + + /** row keys */ + 2:list rows + + /** Get attributes */ + 3:map attributes + ) throws (1:IOError io) + + /** + * Get the specified columns for the specified table and rows at the latest + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + */ + list getRowsWithColumns( + /** name of table */ + 1:Text tableName, + + /** row keys */ + 2:list rows, + + /** List of columns to return, null for all columns */ + 3:list columns, + + /** Get attributes */ + 4:map attributes + ) throws (1:IOError io) + + /** + * Get all the data for the specified table and rows at the specified + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + */ + list getRowsTs( + /** name of the table */ + 1:Text tableName, + + /** row keys */ + 2:list rows + + /** timestamp */ + 3:i64 timestamp, + + /** Get attributes */ + 4:map attributes + ) throws (1:IOError io) + + /** + * Get the specified columns for the specified table and rows at the specified + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + */ + list getRowsWithColumnsTs( + /** name of table */ + 1:Text tableName, + + /** row keys */ + 2:list rows + + /** List of columns to return, null for all columns */ + 3:list columns, + 4:i64 timestamp, + + /** Get attributes */ + 5:map attributes + ) throws (1:IOError io) + + /** + * Apply a series of mutations (updates/deletes) to a row in a + * single transaction. If an exception is thrown, then the + * transaction is aborted. Default current timestamp is used, and + * all entries will have an identical timestamp. + */ + void mutateRow( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** list of mutation commands */ + 3:list mutations, + + /** Mutation attributes */ + 4:map attributes + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Apply a series of mutations (updates/deletes) to a row in a + * single transaction. If an exception is thrown, then the + * transaction is aborted. The specified timestamp is used, and + * all entries will have an identical timestamp. + */ + void mutateRowTs( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** list of mutation commands */ + 3:list mutations, + + /** timestamp */ + 4:i64 timestamp, + + /** Mutation attributes */ + 5:map attributes + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Apply a series of batches (each a series of mutations on a single row) + * in a single transaction. If an exception is thrown, then the + * transaction is aborted. Default current timestamp is used, and + * all entries will have an identical timestamp. + */ + void mutateRows( + /** name of table */ + 1:Text tableName, + + /** list of row batches */ + 2:list rowBatches, + + /** Mutation attributes */ + 3:map attributes + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Apply a series of batches (each a series of mutations on a single row) + * in a single transaction. If an exception is thrown, then the + * transaction is aborted. The specified timestamp is used, and + * all entries will have an identical timestamp. + */ + void mutateRowsTs( + /** name of table */ + 1:Text tableName, + + /** list of row batches */ + 2:list rowBatches, + + /** timestamp */ + 3:i64 timestamp, + + /** Mutation attributes */ + 4:map attributes + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Atomically increment the column value specified. Returns the next value post increment. + */ + i64 atomicIncrement( + /** name of table */ + 1:Text tableName, + + /** row to increment */ + 2:Text row, + + /** name of column */ + 3:Text column, + + /** amount to increment by */ + 4:i64 value + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Delete all cells that match the passed row and column. + */ + void deleteAll( + /** name of table */ + 1:Text tableName, + + /** Row to update */ + 2:Text row, + + /** name of column whose value is to be deleted */ + 3:Text column, + + /** Delete attributes */ + 4:map attributes + ) throws (1:IOError io) + + /** + * Delete all cells that match the passed row and column and whose + * timestamp is equal-to or older than the passed timestamp. + */ + void deleteAllTs( + /** name of table */ + 1:Text tableName, + + /** Row to update */ + 2:Text row, + + /** name of column whose value is to be deleted */ + 3:Text column, + + /** timestamp */ + 4:i64 timestamp, + + /** Delete attributes */ + 5:map attributes + ) throws (1:IOError io) + + /** + * Completely delete the row's cells. + */ + void deleteAllRow( + /** name of table */ + 1:Text tableName, + + /** key of the row to be completely deleted. */ + 2:Text row, + + /** Delete attributes */ + 3:map attributes + ) throws (1:IOError io) + + /** + * Increment a cell by the ammount. + * Increments can be applied async if hbase.regionserver.thrift.coalesceIncrement is set to true. + * False is the default. Turn to true if you need the extra performance and can accept some + * data loss if a thrift server dies with increments still in the queue. + */ + void increment( + /** The single increment to apply */ + 1:TIncrement increment + ) throws (1:IOError io) + + + void incrementRows( + /** The list of increments */ + 1:list increments + ) throws (1:IOError io) + + /** + * Completely delete the row's cells marked with a timestamp + * equal-to or older than the passed timestamp. + */ + void deleteAllRowTs( + /** name of table */ + 1:Text tableName, + + /** key of the row to be completely deleted. */ + 2:Text row, + + /** timestamp */ + 3:i64 timestamp, + + /** Delete attributes */ + 4:map attributes + ) throws (1:IOError io) + + /** + * Get a scanner on the current table, using the Scan instance + * for the scan parameters. + */ + ScannerID scannerOpenWithScan( + /** name of table */ + 1:Text tableName, + + /** Scan instance */ + 2:TScan scan, + + /** Scan attributes */ + 3:map attributes + ) throws (1:IOError io) + + /** + * Get a scanner on the current table starting at the specified row and + * ending at the last row in the table. Return the specified columns. + * + * @return scanner id to be used with other scanner procedures + */ + ScannerID scannerOpen( + /** name of table */ + 1:Text tableName, + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + 2:Text startRow, + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + 3:list columns, + + /** Scan attributes */ + 4:map attributes + ) throws (1:IOError io) + + /** + * Get a scanner on the current table starting and stopping at the + * specified rows. ending at the last row in the table. Return the + * specified columns. + * + * @return scanner id to be used with other scanner procedures + */ + ScannerID scannerOpenWithStop( + /** name of table */ + 1:Text tableName, + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + 2:Text startRow, + + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + 3:Text stopRow, + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + 4:list columns, + + /** Scan attributes */ + 5:map attributes + ) throws (1:IOError io) + + /** + * Open a scanner for a given prefix. That is all rows will have the specified + * prefix. No other rows will be returned. + * + * @return scanner id to use with other scanner calls + */ + ScannerID scannerOpenWithPrefix( + /** name of table */ + 1:Text tableName, + + /** the prefix (and thus start row) of the keys you want */ + 2:Text startAndPrefix, + + /** the columns you want returned */ + 3:list columns, + + /** Scan attributes */ + 4:map attributes + ) throws (1:IOError io) + + /** + * Get a scanner on the current table starting at the specified row and + * ending at the last row in the table. Return the specified columns. + * Only values with the specified timestamp are returned. + * + * @return scanner id to be used with other scanner procedures + */ + ScannerID scannerOpenTs( + /** name of table */ + 1:Text tableName, + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + 2:Text startRow, + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + 3:list columns, + + /** timestamp */ + 4:i64 timestamp, + + /** Scan attributes */ + 5:map attributes + ) throws (1:IOError io) + + /** + * Get a scanner on the current table starting and stopping at the + * specified rows. ending at the last row in the table. Return the + * specified columns. Only values with the specified timestamp are + * returned. + * + * @return scanner id to be used with other scanner procedures + */ + ScannerID scannerOpenWithStopTs( + /** name of table */ + 1:Text tableName, + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + 2:Text startRow, + + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + 3:Text stopRow, + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + 4:list columns, + + /** timestamp */ + 5:i64 timestamp, + + /** Scan attributes */ + 6:map attributes + ) throws (1:IOError io) + + /** + * Returns the scanner's current row value and advances to the next + * row in the table. When there are no more rows in the table, or a key + * greater-than-or-equal-to the scanner's specified stopRow is reached, + * an empty list is returned. + * + * @return a TRowResult containing the current row and a map of the columns to TCells. + * + * @throws IllegalArgument if ScannerID is invalid + * + * @throws NotFound when the scanner reaches the end + */ + list scannerGet( + /** id of a scanner returned by scannerOpen */ + 1:ScannerID id + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Returns, starting at the scanner's current row value nbRows worth of + * rows and advances to the next row in the table. When there are no more + * rows in the table, or a key greater-than-or-equal-to the scanner's + * specified stopRow is reached, an empty list is returned. + * + * @return a TRowResult containing the current row and a map of the columns to TCells. + * + * @throws IllegalArgument if ScannerID is invalid + * + * @throws NotFound when the scanner reaches the end + */ + list scannerGetList( + /** id of a scanner returned by scannerOpen */ + 1:ScannerID id, + + /** number of results to return */ + 2:i32 nbRows + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Closes the server-state associated with an open scanner. + * + * @throws IllegalArgument if ScannerID is invalid + */ + void scannerClose( + /** id of a scanner returned by scannerOpen */ + 1:ScannerID id + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Get the row just before the specified one. + * + * @return value for specified row/column + */ + list getRowOrBefore( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** column name */ + 3:Text family + ) throws (1:IOError io) + + /** + * Get the regininfo for the specified row. It scans + * the metatable to find region's start and end keys. + * + * @return value for specified row/column + */ + TRegionInfo getRegionInfo( + /** row key */ + 1:Text row, + + ) throws (1:IOError io) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/testfiles/cassandra.thrift b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/testfiles/cassandra.thrift new file mode 100644 index 00000000..0833fdd8 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/testfiles/cassandra.thrift @@ -0,0 +1,886 @@ +#!/usr/local/bin/thrift --java --php --py +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# *** PLEASE REMEMBER TO EDIT THE VERSION CONSTANT WHEN MAKING CHANGES *** +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# +# Interface definition for Cassandra Service +# + +namespace java org.apache.cassandra.thrift +namespace cpp org.apache.cassandra +namespace csharp Apache.Cassandra +namespace py cassandra +namespace php cassandra +namespace perl Cassandra + +# Thrift.rb has a bug where top-level modules that include modules +# with the same name are not properly referenced, so we can't do +# Cassandra::Cassandra::Client. +namespace rb CassandraThrift + +# The API version (NOT the product version), composed as a dot delimited +# string with major, minor, and patch level components. +# +# - Major: Incremented for backward incompatible changes. An example would +# be changes to the number or disposition of method arguments. +# - Minor: Incremented for backward compatible changes. An example would +# be the addition of a new (optional) method. +# - Patch: Incremented for bug fixes. The patch level should be increased +# for every edit that doesn't result in a change to major/minor. +# +# See the Semantic Versioning Specification (SemVer) http://semver.org. +# +# Note that this backwards compatibility is from the perspective of the server, +# not the client. Cassandra should always be able to talk to older client +# software, but client software may not be able to talk to older Cassandra +# instances. +# +# An effort should be made not to break forward-client-compatibility either +# (e.g. one should avoid removing obsolete fields from the IDL), but no +# guarantees in this respect are made by the Cassandra project. +const string VERSION = "19.38.0" + + +# +# data structures +# + +/** Basic unit of data within a ColumnFamily. + * @param name, the name by which this column is set and retrieved. Maximum 64KB long. + * @param value. The data associated with the name. Maximum 2GB long, but in practice you should limit it to small numbers of MB (since Thrift must read the full value into memory to operate on it). + * @param timestamp. The timestamp is used for conflict detection/resolution when two columns with same name need to be compared. + * @param ttl. An optional, positive delay (in seconds) after which the column will be automatically deleted. + */ +struct Column { + 1: required binary name, + 2: optional binary value, + 3: optional i64 timestamp, + 4: optional i32 ttl, +} + +/** A named list of columns. + * @param name. see Column.name. + * @param columns. A collection of standard Columns. The columns within a super column are defined in an adhoc manner. + * Columns within a super column do not have to have matching structures (similarly named child columns). + */ +struct SuperColumn { + 1: required binary name, + 2: required list columns, +} + +struct CounterColumn { + 1: required binary name, + 2: required i64 value +} + +struct CounterSuperColumn { + 1: required binary name, + 2: required list columns +} + +/** + Methods for fetching rows/records from Cassandra will return either a single instance of ColumnOrSuperColumn or a list + of ColumnOrSuperColumns (get_slice()). If you're looking up a SuperColumn (or list of SuperColumns) then the resulting + instances of ColumnOrSuperColumn will have the requested SuperColumn in the attribute super_column. For queries resulting + in Columns, those values will be in the attribute column. This change was made between 0.3 and 0.4 to standardize on + single query methods that may return either a SuperColumn or Column. + + If the query was on a counter column family, you will either get a counter_column (instead of a column) or a + counter_super_column (instead of a super_column) + + @param column. The Column returned by get() or get_slice(). + @param super_column. The SuperColumn returned by get() or get_slice(). + @param counter_column. The Counterolumn returned by get() or get_slice(). + @param counter_super_column. The CounterSuperColumn returned by get() or get_slice(). + */ +struct ColumnOrSuperColumn { + 1: optional Column column, + 2: optional SuperColumn super_column, + 3: optional CounterColumn counter_column, + 4: optional CounterSuperColumn counter_super_column +} + + +# +# Exceptions +# (note that internal server errors will raise a TApplicationException, courtesy of Thrift) +# + +/** A specific column was requested that does not exist. */ +exception NotFoundException { +} + +/** Invalid request could mean keyspace or column family does not exist, required parameters are missing, or a parameter is malformed. + why contains an associated error message. +*/ +exception InvalidRequestException { + 1: required string why +} + +/** Not all the replicas required could be created and/or read. */ +exception UnavailableException { +} + +/** RPC timeout was exceeded. either a node failed mid-operation, or load was too high, or the requested op was too large. */ +exception TimedOutException { + /** + * if a write operation was acknowledged by some replicas but not by enough to + * satisfy the required ConsistencyLevel, the number of successful + * replies will be given here. In case of atomic_batch_mutate method this field + * will be set to -1 if the batch was written to the batchlog and to 0 if it wasn't. + */ + 1: optional i32 acknowledged_by + + /** + * in case of atomic_batch_mutate method this field tells if the batch + * was written to the batchlog. + */ + 2: optional bool acknowledged_by_batchlog + + /** + * for the CAS method, this field tells if we timed out during the paxos + * protocol, as opposed to during the commit of our update + */ + 3: optional bool paxos_in_progress +} + +/** invalid authentication request (invalid keyspace, user does not exist, or credentials invalid) */ +exception AuthenticationException { + 1: required string why +} + +/** invalid authorization request (user does not have access to keyspace) */ +exception AuthorizationException { + 1: required string why +} + +/** + * NOTE: This up outdated exception left for backward compatibility reasons, + * no actual schema agreement validation is done starting from Cassandra 1.2 + * + * schemas are not in agreement across all nodes + */ +exception SchemaDisagreementException { +} + + +# +# service api +# +/** + * The ConsistencyLevel is an enum that controls both read and write + * behavior based on the ReplicationFactor of the keyspace. The + * different consistency levels have different meanings, depending on + * if you're doing a write or read operation. + * + * If W + R > ReplicationFactor, where W is the number of nodes to + * block for on write, and R the number to block for on reads, you + * will have strongly consistent behavior; that is, readers will + * always see the most recent write. Of these, the most interesting is + * to do QUORUM reads and writes, which gives you consistency while + * still allowing availability in the face of node failures up to half + * of . Of course if latency is more important than + * consistency then you can use lower values for either or both. + * + * Some ConsistencyLevels (ONE, TWO, THREE) refer to a specific number + * of replicas rather than a logical concept that adjusts + * automatically with the replication factor. Of these, only ONE is + * commonly used; TWO and (even more rarely) THREE are only useful + * when you care more about guaranteeing a certain level of + * durability, than consistency. + * + * Write consistency levels make the following guarantees before reporting success to the client: + * ANY Ensure that the write has been written once somewhere, including possibly being hinted in a non-target node. + * ONE Ensure that the write has been written to at least 1 node's commit log and memory table + * TWO Ensure that the write has been written to at least 2 node's commit log and memory table + * THREE Ensure that the write has been written to at least 3 node's commit log and memory table + * QUORUM Ensure that the write has been written to / 2 + 1 nodes + * LOCAL_ONE Ensure that the write has been written to 1 node within the local datacenter (requires NetworkTopologyStrategy) + * LOCAL_QUORUM Ensure that the write has been written to / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy) + * EACH_QUORUM Ensure that the write has been written to / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy) + * ALL Ensure that the write is written to <ReplicationFactor> nodes before responding to the client. + * + * Read consistency levels make the following guarantees before returning successful results to the client: + * ANY Not supported. You probably want ONE instead. + * ONE Returns the record obtained from a single replica. + * TWO Returns the record with the most recent timestamp once two replicas have replied. + * THREE Returns the record with the most recent timestamp once three replicas have replied. + * QUORUM Returns the record with the most recent timestamp once a majority of replicas have replied. + * LOCAL_ONE Returns the record with the most recent timestamp once a single replica within the local datacenter have replied. + * LOCAL_QUORUM Returns the record with the most recent timestamp once a majority of replicas within the local datacenter have replied. + * EACH_QUORUM Returns the record with the most recent timestamp once a majority of replicas within each datacenter have replied. + * ALL Returns the record with the most recent timestamp once all replicas have replied (implies no replica may be down).. +*/ +enum ConsistencyLevel { + ONE = 1, + QUORUM = 2, + LOCAL_QUORUM = 3, + EACH_QUORUM = 4, + ALL = 5, + ANY = 6, + TWO = 7, + THREE = 8, + SERIAL = 9, + LOCAL_SERIAL = 10, + LOCAL_ONE = 11, +} + +/** + ColumnParent is used when selecting groups of columns from the same ColumnFamily. In directory structure terms, imagine + ColumnParent as ColumnPath + '/../'. + + See also ColumnPath + */ +struct ColumnParent { + 3: required string column_family, + 4: optional binary super_column, +} + +/** The ColumnPath is the path to a single column in Cassandra. It might make sense to think of ColumnPath and + * ColumnParent in terms of a directory structure. + * + * ColumnPath is used to looking up a single column. + * + * @param column_family. The name of the CF of the column being looked up. + * @param super_column. The super column name. + * @param column. The column name. + */ +struct ColumnPath { + 3: required string column_family, + 4: optional binary super_column, + 5: optional binary column, +} + +/** + A slice range is a structure that stores basic range, ordering and limit information for a query that will return + multiple columns. It could be thought of as Cassandra's version of LIMIT and ORDER BY + + @param start. The column name to start the slice with. This attribute is not required, though there is no default value, + and can be safely set to '', i.e., an empty byte array, to start with the first column name. Otherwise, it + must a valid value under the rules of the Comparator defined for the given ColumnFamily. + @param finish. The column name to stop the slice at. This attribute is not required, though there is no default value, + and can be safely set to an empty byte array to not stop until 'count' results are seen. Otherwise, it + must also be a valid value to the ColumnFamily Comparator. + @param reversed. Whether the results should be ordered in reversed order. Similar to ORDER BY blah DESC in SQL. + @param count. How many columns to return. Similar to LIMIT in SQL. May be arbitrarily large, but Thrift will + materialize the whole result into memory before returning it to the client, so be aware that you may + be better served by iterating through slices by passing the last value of one call in as the 'start' + of the next instead of increasing 'count' arbitrarily large. + */ +struct SliceRange { + 1: required binary start, + 2: required binary finish, + 3: required bool reversed=0, + 4: required i32 count=100, +} + +/** + A SlicePredicate is similar to a mathematic predicate (see http://en.wikipedia.org/wiki/Predicate_(mathematical_logic)), + which is described as "a property that the elements of a set have in common." + + SlicePredicate's in Cassandra are described with either a list of column_names or a SliceRange. If column_names is + specified, slice_range is ignored. + + @param column_name. A list of column names to retrieve. This can be used similar to Memcached's "multi-get" feature + to fetch N known column names. For instance, if you know you wish to fetch columns 'Joe', 'Jack', + and 'Jim' you can pass those column names as a list to fetch all three at once. + @param slice_range. A SliceRange describing how to range, order, and/or limit the slice. + */ +struct SlicePredicate { + 1: optional list column_names, + 2: optional SliceRange slice_range, +} + +enum IndexOperator { + EQ, + GTE, + GT, + LTE, + LT +} + +struct IndexExpression { + 1: required binary column_name, + 2: required IndexOperator op, + 3: required binary value, +} + +/** + * @deprecated use a KeyRange with row_filter in get_range_slices instead + */ +struct IndexClause { + 1: required list expressions, + 2: required binary start_key, + 3: required i32 count=100, +} + + +/** +The semantics of start keys and tokens are slightly different. +Keys are start-inclusive; tokens are start-exclusive. Token +ranges may also wrap -- that is, the end token may be less +than the start one. Thus, a range from keyX to keyX is a +one-element range, but a range from tokenY to tokenY is the +full ring. +*/ +struct KeyRange { + 1: optional binary start_key, + 2: optional binary end_key, + 3: optional string start_token, + 4: optional string end_token, + 6: optional list row_filter, + 5: required i32 count=100 +} + +/** + A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation. + + @param key. a row key + @param columns. List of data represented by the key. Typically, the list is pared down to only the columns specified by + a SlicePredicate. + */ +struct KeySlice { + 1: required binary key, + 2: required list columns, +} + +struct KeyCount { + 1: required binary key, + 2: required i32 count +} + +/** + * Note that the timestamp is only optional in case of counter deletion. + */ +struct Deletion { + 1: optional i64 timestamp, + 2: optional binary super_column, + 3: optional SlicePredicate predicate, +} + +/** + A Mutation is either an insert (represented by filling column_or_supercolumn) or a deletion (represented by filling the deletion attribute). + @param column_or_supercolumn. An insert to a column or supercolumn (possibly counter column or supercolumn) + @param deletion. A deletion of a column or supercolumn +*/ +struct Mutation { + 1: optional ColumnOrSuperColumn column_or_supercolumn, + 2: optional Deletion deletion, +} + +struct EndpointDetails { + 1: string host, + 2: string datacenter, + 3: optional string rack +} + +struct CASResult { + 1: required bool success, + 2: optional list current_values, +} + +/** + A TokenRange describes part of the Cassandra ring, it is a mapping from a range to + endpoints responsible for that range. + @param start_token The first token in the range + @param end_token The last token in the range + @param endpoints The endpoints responsible for the range (listed by their configured listen_address) + @param rpc_endpoints The endpoints responsible for the range (listed by their configured rpc_address) +*/ +struct TokenRange { + 1: required string start_token, + 2: required string end_token, + 3: required list endpoints, + 4: optional list rpc_endpoints + 5: optional list endpoint_details, +} + +/** + Authentication requests can contain any data, dependent on the IAuthenticator used +*/ +struct AuthenticationRequest { + 1: required map credentials +} + +enum IndexType { + KEYS, + CUSTOM, + COMPOSITES +} + +/* describes a column in a column family. */ +struct ColumnDef { + 1: required binary name, + 2: required string validation_class, + 3: optional IndexType index_type, + 4: optional string index_name, + 5: optional map index_options +} + +/** + Describes a trigger. + `options` should include at least 'class' param. + Other options are not supported yet. +*/ +struct TriggerDef { + 1: required string name, + 2: required map options +} + +/* describes a column family. */ +struct CfDef { + 1: required string keyspace, + 2: required string name, + 3: optional string column_type="Standard", + 5: optional string comparator_type="BytesType", + 6: optional string subcomparator_type, + 8: optional string comment, + 12: optional double read_repair_chance, + 13: optional list column_metadata, + 14: optional i32 gc_grace_seconds, + 15: optional string default_validation_class, + 16: optional i32 id, + 17: optional i32 min_compaction_threshold, + 18: optional i32 max_compaction_threshold, + 24: optional bool replicate_on_write, + 26: optional string key_validation_class, + 28: optional binary key_alias, + 29: optional string compaction_strategy, + 30: optional map compaction_strategy_options, + 32: optional map compression_options, + 33: optional double bloom_filter_fp_chance, + 34: optional string caching="keys_only", + 37: optional double dclocal_read_repair_chance = 0.0, + 38: optional bool populate_io_cache_on_flush, + 39: optional i32 memtable_flush_period_in_ms, + 40: optional i32 default_time_to_live, + 41: optional i32 index_interval, + 42: optional string speculative_retry="NONE", + 43: optional list triggers, + + /* All of the following are now ignored and unsupplied. */ + + /** @deprecated */ + 9: optional double row_cache_size, + /** @deprecated */ + 11: optional double key_cache_size, + /** @deprecated */ + 19: optional i32 row_cache_save_period_in_seconds, + /** @deprecated */ + 20: optional i32 key_cache_save_period_in_seconds, + /** @deprecated */ + 21: optional i32 memtable_flush_after_mins, + /** @deprecated */ + 22: optional i32 memtable_throughput_in_mb, + /** @deprecated */ + 23: optional double memtable_operations_in_millions, + /** @deprecated */ + 25: optional double merge_shards_chance, + /** @deprecated */ + 27: optional string row_cache_provider, + /** @deprecated */ + 31: optional i32 row_cache_keys_to_save, +} + +/* describes a keyspace. */ +struct KsDef { + 1: required string name, + 2: required string strategy_class, + 3: optional map strategy_options, + + /** @deprecated ignored */ + 4: optional i32 replication_factor, + + 5: required list cf_defs, + 6: optional bool durable_writes=1, +} + +/** CQL query compression */ +enum Compression { + GZIP = 1, + NONE = 2 +} + +enum CqlResultType { + ROWS = 1, + VOID = 2, + INT = 3 +} + +/** Row returned from a CQL query */ +struct CqlRow { + 1: required binary key, + 2: required list columns +} + +struct CqlMetadata { + 1: required map name_types, + 2: required map value_types, + 3: required string default_name_type, + 4: required string default_value_type +} + +struct CqlResult { + 1: required CqlResultType type, + 2: optional list rows, + 3: optional i32 num, + 4: optional CqlMetadata schema +} + +struct CqlPreparedResult { + 1: required i32 itemId, + 2: required i32 count, + 3: optional list variable_types, + 4: optional list variable_names +} + +/** Represents input splits used by hadoop ColumnFamilyRecordReaders */ +struct CfSplit { + 1: required string start_token, + 2: required string end_token, + 3: required i64 row_count +} + +service Cassandra { + void login(1: required AuthenticationRequest auth_request) throws (1:AuthenticationException authnx, 2:AuthorizationException authzx), + + void set_keyspace(1: required string keyspace) throws (1:InvalidRequestException ire), + + ColumnOrSuperColumn get(1:required binary key, + 2:required ColumnPath column_path, + 3:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:NotFoundException nfe, 3:UnavailableException ue, 4:TimedOutException te), + + /** + Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn name + pair) specified by the given SlicePredicate. If no matching values are found, an empty list is returned. + */ + list get_slice(1:required binary key, + 2:required ColumnParent column_parent, + 3:required SlicePredicate predicate, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + returns the number of columns matching predicate for a particular key, + ColumnFamily and optionally SuperColumn. + */ + i32 get_count(1:required binary key, + 2:required ColumnParent column_parent, + 3:required SlicePredicate predicate, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + Performs a get_slice for column_parent and predicate for the given keys in parallel. + */ + map> multiget_slice(1:required list keys, + 2:required ColumnParent column_parent, + 3:required SlicePredicate predicate, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + Perform a get_count in parallel on the given list keys. The return value maps keys to the count found. + */ + map multiget_count(1:required list keys, + 2:required ColumnParent column_parent, + 3:required SlicePredicate predicate, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + returns a subset of columns for a contiguous range of keys. + */ + list get_range_slices(1:required ColumnParent column_parent, + 2:required SlicePredicate predicate, + 3:required KeyRange range, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + returns a range of columns, wrapping to the next rows if necessary to collect max_results. + */ + list get_paged_slice(1:required string column_family, + 2:required KeyRange range, + 3:required binary start_column, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + Returns the subset of columns specified in SlicePredicate for the rows matching the IndexClause + @deprecated use get_range_slices instead with range.row_filter specified + */ + list get_indexed_slices(1:required ColumnParent column_parent, + 2:required IndexClause index_clause, + 3:required SlicePredicate column_predicate, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + # modification methods + + /** + * Insert a Column at the given column_parent.column_family and optional column_parent.super_column. + */ + void insert(1:required binary key, + 2:required ColumnParent column_parent, + 3:required Column column, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + * Increment or decrement a counter. + */ + void add(1:required binary key, + 2:required ColumnParent column_parent, + 3:required CounterColumn column, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + * Atomic compare and set. + * + * If the cas is successfull, the success boolean in CASResult will be true and there will be no current_values. + * Otherwise, success will be false and current_values will contain the current values for the columns in + * expected (that, by definition of compare-and-set, will differ from the values in expected). + * + * A cas operation takes 2 consistency level. The first one, serial_consistency_level, simply indicates the + * level of serialization required. This can be either ConsistencyLevel.SERIAL or ConsistencyLevel.LOCAL_SERIAL. + * The second one, commit_consistency_level, defines the consistency level for the commit phase of the cas. This + * is a more traditional consistency level (the same CL than for traditional writes are accepted) that impact + * the visibility for reads of the operation. For instance, if commit_consistency_level is QUORUM, then it is + * guaranteed that a followup QUORUM read will see the cas write (if that one was successful obviously). If + * commit_consistency_level is ANY, you will need to use a SERIAL/LOCAL_SERIAL read to be guaranteed to see + * the write. + */ + CASResult cas(1:required binary key, + 2:required string column_family, + 3:list expected, + 4:list updates, + 5:required ConsistencyLevel serial_consistency_level=ConsistencyLevel.SERIAL, + 6:required ConsistencyLevel commit_consistency_level=ConsistencyLevel.QUORUM) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note + that all the values in column_path besides column_path.column_family are truly optional: you can remove the entire + row by just specifying the ColumnFamily, or you can remove a SuperColumn or a single Column by specifying those levels too. + */ + void remove(1:required binary key, + 2:required ColumnPath column_path, + 3:required i64 timestamp, + 4:ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + * Remove a counter at the specified location. + * Note that counters have limited support for deletes: if you remove a counter, you must wait to issue any following update + * until the delete has reached all the nodes and all of them have been fully compacted. + */ + void remove_counter(1:required binary key, + 2:required ColumnPath path, + 3:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + Mutate many columns or super columns for many row keys. See also: Mutation. + + mutation_map maps key to column family to a list of Mutation objects to take place at that scope. + **/ + void batch_mutate(1:required map>> mutation_map, + 2:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + Atomically mutate many columns or super columns for many row keys. See also: Mutation. + + mutation_map maps key to column family to a list of Mutation objects to take place at that scope. + **/ + void atomic_batch_mutate(1:required map>> mutation_map, + 2:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + Truncate will mark and entire column family as deleted. + From the user's perspective a successful call to truncate will result complete data deletion from cfname. + Internally, however, disk space will not be immediatily released, as with all deletes in cassandra, this one + only marks the data as deleted. + The operation succeeds only if all hosts in the cluster at available and will throw an UnavailableException if + some hosts are down. + */ + void truncate(1:required string cfname) + throws (1: InvalidRequestException ire, 2: UnavailableException ue, 3: TimedOutException te), + + + + // Meta-APIs -- APIs to get information about the node or cluster, + // rather than user data. The nodeprobe program provides usage examples. + + /** + * for each schema version present in the cluster, returns a list of nodes at that version. + * hosts that do not respond will be under the key DatabaseDescriptor.INITIAL_VERSION. + * the cluster is all on the same version if the size of the map is 1. + */ + map> describe_schema_versions() + throws (1: InvalidRequestException ire), + + /** list the defined keyspaces in this cluster */ + list describe_keyspaces() + throws (1:InvalidRequestException ire), + + /** get the cluster name */ + string describe_cluster_name(), + + /** get the thrift api version */ + string describe_version(), + + /** get the token ring: a map of ranges to host addresses, + represented as a set of TokenRange instead of a map from range + to list of endpoints, because you can't use Thrift structs as + map keys: + https://issues.apache.org/jira/browse/THRIFT-162 + + for the same reason, we can't return a set here, even though + order is neither important nor predictable. */ + list describe_ring(1:required string keyspace) + throws (1:InvalidRequestException ire), + + /** get the mapping between token->node ip + without taking replication into consideration + https://issues.apache.org/jira/browse/CASSANDRA-4092 */ + map describe_token_map() + throws (1:InvalidRequestException ire), + + /** returns the partitioner used by this cluster */ + string describe_partitioner(), + + /** returns the snitch used by this cluster */ + string describe_snitch(), + + /** describe specified keyspace */ + KsDef describe_keyspace(1:required string keyspace) + throws (1:NotFoundException nfe, 2:InvalidRequestException ire), + + /** experimental API for hadoop/parallel query support. + may change violently and without warning. + + returns list of token strings such that first subrange is (list[0], list[1]], + next is (list[1], list[2]], etc. */ + list describe_splits(1:required string cfName, + 2:required string start_token, + 3:required string end_token, + 4:required i32 keys_per_split) + throws (1:InvalidRequestException ire), + + /** Enables tracing for the next query in this connection and returns the UUID for that trace session + The next query will be traced idependently of trace probability and the returned UUID can be used to query the trace keyspace */ + binary trace_next_query(), + + list describe_splits_ex(1:required string cfName, + 2:required string start_token, + 3:required string end_token, + 4:required i32 keys_per_split) + throws (1:InvalidRequestException ire), + + /** adds a column family. returns the new schema id. */ + string system_add_column_family(1:required CfDef cf_def) + throws (1:InvalidRequestException ire, 2:SchemaDisagreementException sde), + + /** drops a column family. returns the new schema id. */ + string system_drop_column_family(1:required string column_family) + throws (1:InvalidRequestException ire, 2:SchemaDisagreementException sde), + + /** adds a keyspace and any column families that are part of it. returns the new schema id. */ + string system_add_keyspace(1:required KsDef ks_def) + throws (1:InvalidRequestException ire, 2:SchemaDisagreementException sde), + + /** drops a keyspace and any column families that are part of it. returns the new schema id. */ + string system_drop_keyspace(1:required string keyspace) + throws (1:InvalidRequestException ire, 2:SchemaDisagreementException sde), + + /** updates properties of a keyspace. returns the new schema id. */ + string system_update_keyspace(1:required KsDef ks_def) + throws (1:InvalidRequestException ire, 2:SchemaDisagreementException sde), + + /** updates properties of a column family. returns the new schema id. */ + string system_update_column_family(1:required CfDef cf_def) + throws (1:InvalidRequestException ire, 2:SchemaDisagreementException sde), + + + /** + * @deprecated Will become a no-op in 2.2. Please use the CQL3 version instead. + */ + CqlResult execute_cql_query(1:required binary query, 2:required Compression compression) + throws (1:InvalidRequestException ire, + 2:UnavailableException ue, + 3:TimedOutException te, + 4:SchemaDisagreementException sde) + + /** + * Executes a CQL3 (Cassandra Query Language) statement and returns a + * CqlResult containing the results. + */ + CqlResult execute_cql3_query(1:required binary query, 2:required Compression compression, 3:required ConsistencyLevel consistency) + throws (1:InvalidRequestException ire, + 2:UnavailableException ue, + 3:TimedOutException te, + 4:SchemaDisagreementException sde) + + + /** + * @deprecated Will become a no-op in 2.2. Please use the CQL3 version instead. + */ + CqlPreparedResult prepare_cql_query(1:required binary query, 2:required Compression compression) + throws (1:InvalidRequestException ire) + + /** + * Prepare a CQL3 (Cassandra Query Language) statement by compiling and returning + * - the type of CQL statement + * - an id token of the compiled CQL stored on the server side. + * - a count of the discovered bound markers in the statement + */ + CqlPreparedResult prepare_cql3_query(1:required binary query, 2:required Compression compression) + throws (1:InvalidRequestException ire) + + + /** + * @deprecated Will become a no-op in 2.2. Please use the CQL3 version instead. + */ + CqlResult execute_prepared_cql_query(1:required i32 itemId, 2:required list values) + throws (1:InvalidRequestException ire, + 2:UnavailableException ue, + 3:TimedOutException te, + 4:SchemaDisagreementException sde) + + /** + * Executes a prepared CQL3 (Cassandra Query Language) statement by passing an id token, a list of variables + * to bind, and the consistency level, and returns a CqlResult containing the results. + */ + CqlResult execute_prepared_cql3_query(1:required i32 itemId, 2:required list values, 3:required ConsistencyLevel consistency) + throws (1:InvalidRequestException ire, + 2:UnavailableException ue, + 3:TimedOutException te, + 4:SchemaDisagreementException sde) + + /** + * @deprecated This is now a no-op. Please use the CQL3 specific methods instead. + */ + void set_cql_version(1: required string version) throws (1:InvalidRequestException ire) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/client.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/client.go new file mode 100644 index 00000000..167b3084 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/client.go @@ -0,0 +1,171 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "errors" + "io" + "net" + "net/rpc" +) + +// Implements rpc.ClientCodec +type clientCodec struct { + conn Transport + onewayRequests chan pendingRequest + twowayRequests chan pendingRequest + enableOneway bool +} + +type pendingRequest struct { + method string + seq uint64 +} + +type oneway interface { + Oneway() bool +} + +var ( + // ErrTooManyPendingRequests is the error when there's too many requests that have been + // sent that have not yet received responses. + ErrTooManyPendingRequests = errors.New("thrift.client: too many pending requests") + // ErrOnewayNotEnabled is the error when trying to make a one-way RPC call but the + // client was not created with one-way support enabled. + ErrOnewayNotEnabled = errors.New("thrift.client: one way support not enabled on codec") +) + +const maxPendingRequests = 1000 + +// Dial connects to a Thrift RPC server at the specified network address using the specified protocol. +func Dial(network, address string, framed bool, protocol ProtocolBuilder, supportOnewayRequests bool) (*rpc.Client, error) { + conn, err := net.Dial(network, address) + if err != nil { + return nil, err + } + var c io.ReadWriteCloser = conn + if framed { + c = NewFramedReadWriteCloser(conn, DefaultMaxFrameSize) + } + codec := &clientCodec{ + conn: NewTransport(c, protocol), + } + if supportOnewayRequests { + codec.enableOneway = true + codec.onewayRequests = make(chan pendingRequest, maxPendingRequests) + codec.twowayRequests = make(chan pendingRequest, maxPendingRequests) + } + return rpc.NewClientWithCodec(codec), nil +} + +// NewClient returns a new rpc.Client to handle requests to the set of +// services at the other end of the connection. +func NewClient(conn Transport, supportOnewayRequests bool) *rpc.Client { + return rpc.NewClientWithCodec(NewClientCodec(conn, supportOnewayRequests)) +} + +// NewClientCodec returns a new rpc.ClientCodec using Thrift RPC on conn using the specified protocol. +func NewClientCodec(conn Transport, supportOnewayRequests bool) rpc.ClientCodec { + c := &clientCodec{ + conn: conn, + } + if supportOnewayRequests { + c.enableOneway = true + c.onewayRequests = make(chan pendingRequest, maxPendingRequests) + c.twowayRequests = make(chan pendingRequest, maxPendingRequests) + } + return c +} + +func (c *clientCodec) WriteRequest(request *rpc.Request, thriftStruct interface{}) error { + if err := c.conn.WriteMessageBegin(request.ServiceMethod, MessageTypeCall, int32(request.Seq)); err != nil { + return err + } + if err := EncodeStruct(c.conn, thriftStruct); err != nil { + return err + } + if err := c.conn.WriteMessageEnd(); err != nil { + return err + } + if err := c.conn.Flush(); err != nil { + return err + } + ow := false + if o, ok := thriftStruct.(oneway); ok { + ow = o.Oneway() + } + if c.enableOneway { + var err error + if ow { + select { + case c.onewayRequests <- pendingRequest{request.ServiceMethod, request.Seq}: + default: + err = ErrTooManyPendingRequests + } + } else { + select { + case c.twowayRequests <- pendingRequest{request.ServiceMethod, request.Seq}: + default: + err = ErrTooManyPendingRequests + } + } + if err != nil { + return err + } + } else if ow { + return ErrOnewayNotEnabled + } + + return nil +} + +func (c *clientCodec) ReadResponseHeader(response *rpc.Response) error { + if c.enableOneway { + select { + case ow := <-c.onewayRequests: + response.ServiceMethod = ow.method + response.Seq = ow.seq + return nil + case _ = <-c.twowayRequests: + } + } + + name, messageType, seq, err := c.conn.ReadMessageBegin() + if err != nil { + return err + } + response.ServiceMethod = name + response.Seq = uint64(seq) + if messageType == MessageTypeException { + exception := &ApplicationException{} + if err := DecodeStruct(c.conn, exception); err != nil { + return err + } + response.Error = exception.String() + return c.conn.ReadMessageEnd() + } + return nil +} + +func (c *clientCodec) ReadResponseBody(thriftStruct interface{}) error { + if thriftStruct == nil { + // Should only get called if ReadResponseHeader set the Error value in + // which case we've already read the body (ApplicationException) + return nil + } + + if err := DecodeStruct(c.conn, thriftStruct); err != nil { + return err + } + + return c.conn.ReadMessageEnd() +} + +func (c *clientCodec) Close() error { + if cl, ok := c.conn.(io.Closer); ok { + return cl.Close() + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/decoder.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/decoder.go new file mode 100644 index 00000000..1f5a742e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/decoder.go @@ -0,0 +1,266 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "reflect" + "runtime" +) + +// Decoder is the interface that allows types to deserialize themselves from a Thrift stream +type Decoder interface { + DecodeThrift(ProtocolReader) error +} + +type decoder struct { + r ProtocolReader +} + +// DecodeStruct tries to deserialize a struct from a Thrift stream +func DecodeStruct(r ProtocolReader, v interface{}) (err error) { + if de, ok := v.(Decoder); ok { + return de.DecodeThrift(r) + } + + defer func() { + if r := recover(); r != nil { + if _, ok := r.(runtime.Error); ok { + panic(r) + } + err = r.(error) + } + }() + d := &decoder{r} + vo := reflect.ValueOf(v) + for vo.Kind() != reflect.Ptr { + d.error(&UnsupportedValueError{Value: vo, Str: "pointer to struct expected"}) + } + if vo.Elem().Kind() != reflect.Struct { + d.error(&UnsupportedValueError{Value: vo, Str: "expected a struct"}) + } + d.readValue(TypeStruct, vo.Elem()) + return nil +} + +func (d *decoder) error(err interface{}) { + panic(err) +} + +func (d *decoder) readValue(thriftType byte, rf reflect.Value) { + v := rf + kind := rf.Kind() + if kind == reflect.Ptr { + if rf.IsNil() { + rf.Set(reflect.New(rf.Type().Elem())) + } + v = rf.Elem() + kind = v.Kind() + } + + if de, ok := rf.Interface().(Decoder); ok { + if err := de.DecodeThrift(d.r); err != nil { + d.error(err) + } + return + } + + var err error + switch thriftType { + case TypeBool: + if val, err := d.r.ReadBool(); err != nil { + d.error(err) + } else { + v.SetBool(val) + } + case TypeByte: + if val, err := d.r.ReadByte(); err != nil { + d.error(err) + } else { + if kind == reflect.Uint8 { + v.SetUint(uint64(val)) + } else { + v.SetInt(int64(val)) + } + } + case TypeI16: + if val, err := d.r.ReadI16(); err != nil { + d.error(err) + } else { + v.SetInt(int64(val)) + } + case TypeI32: + if val, err := d.r.ReadI32(); err != nil { + d.error(err) + } else { + if kind == reflect.Uint32 { + v.SetUint(uint64(val)) + } else { + v.SetInt(int64(val)) + } + } + case TypeI64: + if val, err := d.r.ReadI64(); err != nil { + d.error(err) + } else { + if kind == reflect.Uint64 { + v.SetUint(uint64(val)) + } else { + v.SetInt(val) + } + } + case TypeDouble: + if val, err := d.r.ReadDouble(); err != nil { + d.error(err) + } else { + v.SetFloat(val) + } + case TypeString: + if kind == reflect.Slice { + elemType := v.Type().Elem() + elemTypeName := elemType.Name() + if elemType.Kind() == reflect.Uint8 && (elemTypeName == "byte" || elemTypeName == "uint8") { + if val, err := d.r.ReadBytes(); err != nil { + d.error(err) + } else { + v.SetBytes(val) + } + } else { + err = &UnsupportedValueError{Value: v, Str: "decoder expected a byte array"} + } + } else { + if val, err := d.r.ReadString(); err != nil { + d.error(err) + } else { + v.SetString(val) + } + } + case TypeStruct: + if err := d.r.ReadStructBegin(); err != nil { + d.error(err) + } + + meta := encodeFields(v.Type()) + req := meta.required + for { + ftype, id, err := d.r.ReadFieldBegin() + if err != nil { + d.error(err) + } + if ftype == TypeStop { + break + } + + ef, ok := meta.fields[int(id)] + if !ok { + SkipValue(d.r, ftype) + } else { + req &= ^(uint64(1) << uint64(id)) + fieldValue := v.Field(ef.i) + if ftype != ef.fieldType { + d.error(&UnsupportedValueError{Value: fieldValue, Str: "type mismatch"}) + } + d.readValue(ftype, fieldValue) + } + + if err = d.r.ReadFieldEnd(); err != nil { + d.error(err) + } + } + + if err := d.r.ReadStructEnd(); err != nil { + d.error(err) + } + + if req != 0 { + for i := 0; req != 0; i, req = i+1, req>>1 { + if req&1 != 0 { + d.error(&MissingRequiredField{ + StructName: v.Type().Name(), + FieldName: meta.fields[i].name, + }) + } + } + } + case TypeMap: + keyType := v.Type().Key() + valueType := v.Type().Elem() + ktype, vtype, n, err := d.r.ReadMapBegin() + if err != nil { + d.error(err) + } + v.Set(reflect.MakeMap(v.Type())) + for i := 0; i < n; i++ { + key := reflect.New(keyType).Elem() + val := reflect.New(valueType).Elem() + d.readValue(ktype, key) + d.readValue(vtype, val) + v.SetMapIndex(key, val) + } + if err := d.r.ReadMapEnd(); err != nil { + d.error(err) + } + case TypeList: + elemType := v.Type().Elem() + et, n, err := d.r.ReadListBegin() + if err != nil { + d.error(err) + } + for i := 0; i < n; i++ { + val := reflect.New(elemType) + d.readValue(et, val.Elem()) + v.Set(reflect.Append(v, val.Elem())) + } + if err := d.r.ReadListEnd(); err != nil { + d.error(err) + } + case TypeSet: + if v.Type().Kind() == reflect.Slice { + elemType := v.Type().Elem() + et, n, err := d.r.ReadSetBegin() + if err != nil { + d.error(err) + } + for i := 0; i < n; i++ { + val := reflect.New(elemType) + d.readValue(et, val.Elem()) + v.Set(reflect.Append(v, val.Elem())) + } + if err := d.r.ReadSetEnd(); err != nil { + d.error(err) + } + } else if v.Type().Kind() == reflect.Map { + elemType := v.Type().Key() + valueType := v.Type().Elem() + et, n, err := d.r.ReadSetBegin() + if err != nil { + d.error(err) + } + v.Set(reflect.MakeMap(v.Type())) + for i := 0; i < n; i++ { + key := reflect.New(elemType).Elem() + d.readValue(et, key) + switch valueType.Kind() { + case reflect.Bool: + v.SetMapIndex(key, reflect.ValueOf(true)) + default: + v.SetMapIndex(key, reflect.Zero(valueType)) + } + } + if err := d.r.ReadSetEnd(); err != nil { + d.error(err) + } + } else { + d.error(&UnsupportedTypeError{v.Type()}) + } + default: + d.error(&UnsupportedTypeError{v.Type()}) + } + + if err != nil { + d.error(err) + } + + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/encoder.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/encoder.go new file mode 100644 index 00000000..41115a52 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/encoder.go @@ -0,0 +1,216 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "reflect" + "runtime" +) + +// Encoder is the interface that allows types to serialize themselves to a Thrift stream +type Encoder interface { + EncodeThrift(ProtocolWriter) error +} + +type encoder struct { + w ProtocolWriter +} + +// EncodeStruct tries to serialize a struct to a Thrift stream +func EncodeStruct(w ProtocolWriter, v interface{}) (err error) { + if en, ok := v.(Encoder); ok { + return en.EncodeThrift(w) + } + + defer func() { + if r := recover(); r != nil { + if _, ok := r.(runtime.Error); ok { + panic(r) + } + err = r.(error) + } + }() + e := &encoder{w} + vo := reflect.ValueOf(v) + e.writeStruct(vo) + return nil +} + +func (e *encoder) error(err interface{}) { + panic(err) +} + +func (e *encoder) writeStruct(v reflect.Value) { + for v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface { + v = v.Elem() + } + if v.Kind() != reflect.Struct { + e.error(&UnsupportedValueError{Value: v, Str: "expected a struct"}) + } + if err := e.w.WriteStructBegin(v.Type().Name()); err != nil { + e.error(err) + } + for _, ef := range encodeFields(v.Type()).fields { + structField := v.Type().Field(ef.i) + fieldValue := v.Field(ef.i) + + if !ef.required && !ef.keepEmpty && isEmptyValue(fieldValue) { + continue + } + + if fieldValue.Kind() == reflect.Ptr { + if ef.required && fieldValue.IsNil() { + e.error(&MissingRequiredField{v.Type().Name(), structField.Name}) + } + } + + ftype := ef.fieldType + + if err := e.w.WriteFieldBegin(structField.Name, ftype, int16(ef.id)); err != nil { + e.error(err) + } + e.writeValue(fieldValue, ftype) + if err := e.w.WriteFieldEnd(); err != nil { + e.error(err) + } + } + e.w.WriteFieldStop() + if err := e.w.WriteStructEnd(); err != nil { + e.error(err) + } +} + +func (e *encoder) writeValue(v reflect.Value, thriftType byte) { + if en, ok := v.Interface().(Encoder); ok { + if err := en.EncodeThrift(e.w); err != nil { + e.error(err) + } + return + } + + kind := v.Kind() + if kind == reflect.Ptr || kind == reflect.Interface { + v = v.Elem() + kind = v.Kind() + } + + var err error + switch thriftType { + case TypeBool: + err = e.w.WriteBool(v.Bool()) + case TypeByte: + if kind == reflect.Uint8 { + err = e.w.WriteByte(byte(v.Uint())) + } else { + err = e.w.WriteByte(byte(v.Int())) + } + case TypeI16: + err = e.w.WriteI16(int16(v.Int())) + case TypeI32: + if kind == reflect.Uint32 { + err = e.w.WriteI32(int32(v.Uint())) + } else { + err = e.w.WriteI32(int32(v.Int())) + } + case TypeI64: + if kind == reflect.Uint64 { + err = e.w.WriteI64(int64(v.Uint())) + } else { + err = e.w.WriteI64(v.Int()) + } + case TypeDouble: + err = e.w.WriteDouble(v.Float()) + case TypeString: + if kind == reflect.Slice { + elemType := v.Type().Elem() + if elemType.Kind() == reflect.Uint8 { + err = e.w.WriteBytes(v.Bytes()) + } else { + err = &UnsupportedValueError{Value: v, Str: "encoder expected a byte array"} + } + } else { + err = e.w.WriteString(v.String()) + } + case TypeStruct: + e.writeStruct(v) + case TypeMap: + keyType := v.Type().Key() + valueType := v.Type().Elem() + keyThriftType := fieldType(keyType) + valueThriftType := fieldType(valueType) + if er := e.w.WriteMapBegin(keyThriftType, valueThriftType, v.Len()); er != nil { + e.error(er) + } + for _, k := range v.MapKeys() { + e.writeValue(k, keyThriftType) + e.writeValue(v.MapIndex(k), valueThriftType) + } + err = e.w.WriteMapEnd() + case TypeList: + elemType := v.Type().Elem() + if elemType.Kind() == reflect.Uint8 { + err = e.w.WriteBytes(v.Bytes()) + } else { + elemThriftType := fieldType(elemType) + if er := e.w.WriteListBegin(elemThriftType, v.Len()); er != nil { + e.error(er) + } + n := v.Len() + for i := 0; i < n; i++ { + e.writeValue(v.Index(i), elemThriftType) + } + err = e.w.WriteListEnd() + } + case TypeSet: + if v.Type().Kind() == reflect.Slice { + elemType := v.Type().Elem() + elemThriftType := fieldType(elemType) + if er := e.w.WriteSetBegin(elemThriftType, v.Len()); er != nil { + e.error(er) + } + n := v.Len() + for i := 0; i < n; i++ { + e.writeValue(v.Index(i), elemThriftType) + } + err = e.w.WriteSetEnd() + } else if v.Type().Kind() == reflect.Map { + elemType := v.Type().Key() + valueType := v.Type().Elem() + elemThriftType := fieldType(elemType) + if valueType.Kind() == reflect.Bool { + n := 0 + for _, k := range v.MapKeys() { + if v.MapIndex(k).Bool() { + n++ + } + } + if er := e.w.WriteSetBegin(elemThriftType, n); er != nil { + e.error(er) + } + for _, k := range v.MapKeys() { + if v.MapIndex(k).Bool() { + e.writeValue(k, elemThriftType) + } + } + } else { + if er := e.w.WriteSetBegin(elemThriftType, v.Len()); er != nil { + e.error(er) + } + for _, k := range v.MapKeys() { + e.writeValue(k, elemThriftType) + } + } + err = e.w.WriteSetEnd() + } else { + e.error(&UnsupportedTypeError{v.Type()}) + } + default: + e.error(&UnsupportedTypeError{v.Type()}) + } + + if err != nil { + e.error(err) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/framed.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/framed.go new file mode 100644 index 00000000..c19d999c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/framed.go @@ -0,0 +1,121 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "bytes" + "encoding/binary" + "fmt" + "io" +) + +const ( + // DefaultMaxFrameSize is the default max size for frames when using the FramedReadWriteCloser + DefaultMaxFrameSize = 1024 * 1024 +) + +type ErrFrameTooBig struct { + Size, MaxSize int64 +} + +func (e ErrFrameTooBig) Error() string { + return fmt.Sprintf("thrift: frame size while reading over allowed size (%d > %d)", e.Size, e.MaxSize) +} + +type Flusher interface { + Flush() error +} + +type FramedReadWriteCloser struct { + wrapped io.ReadWriteCloser + limitedReader *io.LimitedReader + maxFrameSize int64 + rtmp []byte + wtmp []byte + rbuf *bytes.Buffer + wbuf *bytes.Buffer +} + +func NewFramedReadWriteCloser(wrapped io.ReadWriteCloser, maxFrameSize int) *FramedReadWriteCloser { + if maxFrameSize == 0 { + maxFrameSize = DefaultMaxFrameSize + } + return &FramedReadWriteCloser{ + wrapped: wrapped, + limitedReader: &io.LimitedReader{R: wrapped, N: 0}, + maxFrameSize: int64(maxFrameSize), + rtmp: make([]byte, 4), + wtmp: make([]byte, 4), + rbuf: &bytes.Buffer{}, + wbuf: &bytes.Buffer{}, + } +} + +func (f *FramedReadWriteCloser) Read(p []byte) (int, error) { + if err := f.fillBuffer(); err != nil { + return 0, err + } + return f.rbuf.Read(p) +} + +func (f *FramedReadWriteCloser) ReadByte() (byte, error) { + if err := f.fillBuffer(); err != nil { + return 0, err + } + return f.rbuf.ReadByte() +} + +func (f *FramedReadWriteCloser) fillBuffer() error { + if f.rbuf.Len() > 0 { + return nil + } + + f.rbuf.Reset() + if _, err := io.ReadFull(f.wrapped, f.rtmp); err != nil { + return err + } + frameSize := int64(binary.BigEndian.Uint32(f.rtmp)) + if frameSize > f.maxFrameSize { + return ErrFrameTooBig{frameSize, f.maxFrameSize} + } + f.limitedReader.N = frameSize + written, err := io.Copy(f.rbuf, f.limitedReader) + if err != nil { + return err + } + if written < frameSize { + return io.EOF + } + return nil +} + +func (f *FramedReadWriteCloser) Write(p []byte) (int, error) { + n, err := f.wbuf.Write(p) + if err != nil { + return n, err + } + if ln := int64(f.wbuf.Len()); ln > f.maxFrameSize { + return n, &ErrFrameTooBig{ln, f.maxFrameSize} + } + return n, nil +} + +func (f *FramedReadWriteCloser) Close() error { + return f.wrapped.Close() +} + +func (f *FramedReadWriteCloser) Flush() error { + frameSize := uint32(f.wbuf.Len()) + if frameSize > 0 { + binary.BigEndian.PutUint32(f.wtmp, frameSize) + if _, err := f.wrapped.Write(f.wtmp); err != nil { + return err + } + _, err := io.Copy(f.wrapped, f.wbuf) + f.wbuf.Reset() + return err + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/helpers.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/helpers.go new file mode 100644 index 00000000..76381793 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/helpers.go @@ -0,0 +1,41 @@ +package thrift + +// Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it. +func Bool(v bool) *bool { + return &v +} + +// Float32 is a helper routine that allocates a new float32 value to store v and returns a pointer to it. +func Float32(v float32) *float32 { + return &v +} + +// Float64 is a helper routine that allocates a new float64 value to store v and returns a pointer to it. +func Float64(v float64) *float64 { + return &v +} + +// Byte is a helper routine that allocates a new byte value to store v and returns a pointer to it. +func Byte(v byte) *byte { + return &v +} + +// Int16 is a helper routine that allocates a new int16 value to store v and returns a pointer to it. +func Int16(v int16) *int16 { + return &v +} + +// Int32 is a helper routine that allocates a new int32 value to store v and returns a pointer to it. +func Int32(v int32) *int32 { + return &v +} + +// Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it. +func Int64(v int64) *int64 { + return &v +} + +// String is a helper routine that allocates a new string value to store v and returns a pointer to it. +func String(v string) *string { + return &v +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol.go new file mode 100644 index 00000000..03776ff7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol.go @@ -0,0 +1,96 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "fmt" + "io" +) + +type ProtocolError struct { + Protocol string + Message string +} + +func (e ProtocolError) Error() string { + return fmt.Sprintf("thrift: [%s] %s", e.Protocol, e.Message) +} + +type ProtocolBuilder interface { + NewProtocolReader(io.Reader) ProtocolReader + NewProtocolWriter(io.Writer) ProtocolWriter +} + +type protocolBuilder struct { + reader func(io.Reader) ProtocolReader + writer func(io.Writer) ProtocolWriter +} + +func NewProtocolBuilder(r func(io.Reader) ProtocolReader, w func(io.Writer) ProtocolWriter) ProtocolBuilder { + return &protocolBuilder{ + reader: r, + writer: w, + } +} + +func (p *protocolBuilder) NewProtocolReader(r io.Reader) ProtocolReader { + return p.reader(r) +} + +func (p *protocolBuilder) NewProtocolWriter(w io.Writer) ProtocolWriter { + return p.writer(w) +} + +type ProtocolReadWriter interface { + ProtocolReader + ProtocolWriter +} + +type ProtocolWriter interface { + WriteMessageBegin(name string, messageType byte, seqid int32) error + WriteMessageEnd() error + WriteStructBegin(name string) error + WriteStructEnd() error + WriteFieldBegin(name string, fieldType byte, id int16) error + WriteFieldEnd() error + WriteFieldStop() error + WriteMapBegin(keyType byte, valueType byte, size int) error + WriteMapEnd() error + WriteListBegin(elementType byte, size int) error + WriteListEnd() error + WriteSetBegin(elementType byte, size int) error + WriteSetEnd() error + WriteBool(value bool) error + WriteByte(value byte) error + WriteI16(value int16) error + WriteI32(value int32) error + WriteI64(value int64) error + WriteDouble(value float64) error + WriteString(value string) error + WriteBytes(value []byte) error +} + +type ProtocolReader interface { + ReadMessageBegin() (name string, messageType byte, seqid int32, err error) + ReadMessageEnd() error + ReadStructBegin() error + ReadStructEnd() error + ReadFieldBegin() (fieldType byte, id int16, err error) + ReadFieldEnd() error + ReadMapBegin() (keyType byte, valueType byte, size int, err error) + ReadMapEnd() error + ReadListBegin() (elementType byte, size int, err error) + ReadListEnd() error + ReadSetBegin() (elementType byte, size int, err error) + ReadSetEnd() error + ReadBool() (bool, error) + ReadByte() (byte, error) + ReadI16() (int16, error) + ReadI32() (int32, error) + ReadI64() (int64, error) + ReadDouble() (float64, error) + ReadString() (string, error) + ReadBytes() ([]byte, error) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol_binary.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol_binary.go new file mode 100644 index 00000000..144b267d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol_binary.go @@ -0,0 +1,397 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "encoding/binary" + "io" + "math" +) + +const ( + versionMask uint32 = 0xffff0000 + version1 uint32 = 0x80010000 + typeMask uint32 = 0x000000ff +) + +const ( + maxMessageNameSize = 128 +) + +type binaryProtocolWriter struct { + w io.Writer + strict bool + buf []byte +} + +type binaryProtocolReader struct { + r io.Reader + strict bool + buf []byte +} + +var BinaryProtocol = NewProtocolBuilder( + func(r io.Reader) ProtocolReader { return NewBinaryProtocolReader(r, false) }, + func(w io.Writer) ProtocolWriter { return NewBinaryProtocolWriter(w, true) }, +) + +func NewBinaryProtocolWriter(w io.Writer, strict bool) ProtocolWriter { + p := &binaryProtocolWriter{ + w: w, + strict: strict, + buf: make([]byte, 32), + } + return p +} + +func NewBinaryProtocolReader(r io.Reader, strict bool) ProtocolReader { + p := &binaryProtocolReader{ + r: r, + strict: strict, + buf: make([]byte, 32), + } + return p +} + +func (p *binaryProtocolWriter) WriteMessageBegin(name string, messageType byte, seqid int32) error { + if p.strict { + if err := p.WriteI32(int32(version1 | uint32(messageType))); err != nil { + return err + } + if err := p.WriteString(name); err != nil { + return err + } + } else { + if err := p.WriteString(name); err != nil { + return err + } + if err := p.WriteByte(messageType); err != nil { + return err + } + } + return p.WriteI32(seqid) +} + +func (p *binaryProtocolWriter) WriteMessageEnd() error { + return nil +} + +func (p *binaryProtocolWriter) WriteStructBegin(name string) error { + return nil +} + +func (p *binaryProtocolWriter) WriteStructEnd() error { + return nil +} + +func (p *binaryProtocolWriter) WriteFieldBegin(name string, fieldType byte, id int16) error { + if err := p.WriteByte(fieldType); err != nil { + return err + } + return p.WriteI16(id) +} + +func (p *binaryProtocolWriter) WriteFieldEnd() error { + return nil +} + +func (p *binaryProtocolWriter) WriteFieldStop() error { + return p.WriteByte(TypeStop) +} + +func (p *binaryProtocolWriter) WriteMapBegin(keyType byte, valueType byte, size int) error { + if err := p.WriteByte(keyType); err != nil { + return err + } + if err := p.WriteByte(valueType); err != nil { + return err + } + return p.WriteI32(int32(size)) +} + +func (p *binaryProtocolWriter) WriteMapEnd() error { + return nil +} + +func (p *binaryProtocolWriter) WriteListBegin(elementType byte, size int) error { + if err := p.WriteByte(elementType); err != nil { + return err + } + return p.WriteI32(int32(size)) +} + +func (p *binaryProtocolWriter) WriteListEnd() error { + return nil +} + +func (p *binaryProtocolWriter) WriteSetBegin(elementType byte, size int) error { + if err := p.WriteByte(elementType); err != nil { + return err + } + return p.WriteI32(int32(size)) +} + +func (p *binaryProtocolWriter) WriteSetEnd() error { + return nil +} + +func (p *binaryProtocolWriter) WriteBool(value bool) error { + if value { + return p.WriteByte(1) + } + return p.WriteByte(0) +} + +func (p *binaryProtocolWriter) WriteByte(value byte) error { + b := p.buf + if b == nil { + b = []byte{value} + } else { + b[0] = value + } + _, err := p.w.Write(b[:1]) + return err +} + +func (p *binaryProtocolWriter) WriteI16(value int16) error { + b := p.buf + if b == nil { + b = []byte{0, 0} + } + binary.BigEndian.PutUint16(b, uint16(value)) + _, err := p.w.Write(b[:2]) + return err +} + +func (p *binaryProtocolWriter) WriteI32(value int32) error { + b := p.buf + if b == nil { + b = []byte{0, 0, 0, 0} + } + binary.BigEndian.PutUint32(b, uint32(value)) + _, err := p.w.Write(b[:4]) + return err +} + +func (p *binaryProtocolWriter) WriteI64(value int64) error { + b := p.buf + if b == nil { + b = []byte{0, 0, 0, 0, 0, 0, 0, 0} + } + binary.BigEndian.PutUint64(b, uint64(value)) + _, err := p.w.Write(b[:8]) + return err +} + +func (p *binaryProtocolWriter) WriteDouble(value float64) error { + b := p.buf + if b == nil { + b = []byte{0, 0, 0, 0, 0, 0, 0, 0} + } + binary.BigEndian.PutUint64(b, math.Float64bits(value)) + _, err := p.w.Write(b[:8]) + return err +} + +func (p *binaryProtocolWriter) WriteString(value string) error { + if len(value) <= len(p.buf) { + if err := p.WriteI32(int32(len(value))); err != nil { + return err + } + n := copy(p.buf, value) + _, err := p.w.Write(p.buf[:n]) + return err + } + return p.WriteBytes([]byte(value)) +} + +func (p *binaryProtocolWriter) WriteBytes(value []byte) error { + if err := p.WriteI32(int32(len(value))); err != nil { + return err + } + _, err := p.w.Write(value) + return err +} + +func (p *binaryProtocolReader) ReadMessageBegin() (name string, messageType byte, seqid int32, err error) { + size, e := p.ReadI32() + if e != nil { + err = e + return + } + if size < 0 { + version := uint32(size) & versionMask + if version != version1 { + err = ProtocolError{"BinaryProtocol", "bad version in ReadMessageBegin"} + return + } + messageType = byte(uint32(size) & typeMask) + if name, err = p.ReadString(); err != nil { + return + } + } else { + if p.strict { + err = ProtocolError{"BinaryProtocol", "no protocol version header"} + return + } + if size > maxMessageNameSize { + err = ProtocolError{"BinaryProtocol", "message name exceeds max size"} + return + } + nameBytes := make([]byte, size) + if _, err = p.r.Read(nameBytes); err != nil { + return + } + name = string(nameBytes) + if messageType, err = p.ReadByte(); err != nil { + return + } + } + seqid, err = p.ReadI32() + return +} + +func (p *binaryProtocolReader) ReadMessageEnd() error { + return nil +} + +func (p *binaryProtocolReader) ReadStructBegin() error { + return nil +} + +func (p *binaryProtocolReader) ReadStructEnd() error { + return nil +} + +func (p *binaryProtocolReader) ReadFieldBegin() (fieldType byte, id int16, err error) { + if fieldType, err = p.ReadByte(); err != nil || fieldType == TypeStop { + return + } + id, err = p.ReadI16() + return +} + +func (p *binaryProtocolReader) ReadFieldEnd() error { + return nil +} + +func (p *binaryProtocolReader) ReadMapBegin() (keyType byte, valueType byte, size int, err error) { + if keyType, err = p.ReadByte(); err != nil { + return + } + if valueType, err = p.ReadByte(); err != nil { + return + } + var sz int32 + sz, err = p.ReadI32() + size = int(sz) + return +} + +func (p *binaryProtocolReader) ReadMapEnd() error { + return nil +} + +func (p *binaryProtocolReader) ReadListBegin() (elementType byte, size int, err error) { + if elementType, err = p.ReadByte(); err != nil { + return + } + var sz int32 + sz, err = p.ReadI32() + size = int(sz) + return +} + +func (p *binaryProtocolReader) ReadListEnd() error { + return nil +} + +func (p *binaryProtocolReader) ReadSetBegin() (elementType byte, size int, err error) { + if elementType, err = p.ReadByte(); err != nil { + return + } + var sz int32 + sz, err = p.ReadI32() + size = int(sz) + return +} + +func (p *binaryProtocolReader) ReadSetEnd() error { + return nil +} + +func (p *binaryProtocolReader) ReadBool() (bool, error) { + if b, e := p.ReadByte(); e != nil { + return false, e + } else if b != 0 { + return true, nil + } + return false, nil +} + +func (p *binaryProtocolReader) ReadByte() (value byte, err error) { + _, err = io.ReadFull(p.r, p.buf[:1]) + value = p.buf[0] + return +} + +func (p *binaryProtocolReader) ReadI16() (value int16, err error) { + _, err = io.ReadFull(p.r, p.buf[:2]) + value = int16(binary.BigEndian.Uint16(p.buf)) + return +} + +func (p *binaryProtocolReader) ReadI32() (value int32, err error) { + _, err = io.ReadFull(p.r, p.buf[:4]) + value = int32(binary.BigEndian.Uint32(p.buf)) + return +} + +func (p *binaryProtocolReader) ReadI64() (value int64, err error) { + _, err = io.ReadFull(p.r, p.buf[:8]) + value = int64(binary.BigEndian.Uint64(p.buf)) + return +} + +func (p *binaryProtocolReader) ReadDouble() (value float64, err error) { + _, err = io.ReadFull(p.r, p.buf[:8]) + value = math.Float64frombits(binary.BigEndian.Uint64(p.buf)) + return +} + +func (p *binaryProtocolReader) ReadString() (string, error) { + ln, err := p.ReadI32() + if err != nil || ln == 0 { + return "", err + } + if ln < 0 { + return "", ProtocolError{"BinaryProtocol", "negative length while reading string"} + } + b := p.buf + if int(ln) > len(b) { + b = make([]byte, ln) + } else { + b = b[:ln] + } + if _, err := io.ReadFull(p.r, b); err != nil { + return "", err + } + return string(b), nil +} + +func (p *binaryProtocolReader) ReadBytes() ([]byte, error) { + ln, err := p.ReadI32() + if err != nil || ln == 0 { + return nil, err + } + if ln < 0 { + return nil, ProtocolError{"BinaryProtocol", "negative length while reading bytes"} + } + b := make([]byte, ln) + if _, err := io.ReadFull(p.r, b); err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol_compact.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol_compact.go new file mode 100644 index 00000000..863743e9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol_compact.go @@ -0,0 +1,598 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "encoding/binary" + "io" + "math" +) + +const ( + compactProtocolID = 0x82 + compactVersion = 1 + compactVersionMask = 0x1f + compactTypeMask = 0xe0 + compactTypeShiftAmount = 5 +) + +const ( + ctStop = iota + ctTrue + ctFalse + ctByte + ctI16 + ctI32 + ctI64 + ctDouble + ctBinary + ctList + ctSet + ctMap + ctStruct +) + +var thriftTypeToCompactType []byte +var compactTypeToThriftType []byte + +func init() { + thriftTypeToCompactType = make([]byte, 16) + thriftTypeToCompactType[TypeStop] = ctStop + thriftTypeToCompactType[TypeBool] = ctTrue + thriftTypeToCompactType[TypeByte] = ctByte + thriftTypeToCompactType[TypeI16] = ctI16 + thriftTypeToCompactType[TypeI32] = ctI32 + thriftTypeToCompactType[TypeI64] = ctI64 + thriftTypeToCompactType[TypeDouble] = ctDouble + thriftTypeToCompactType[TypeString] = ctBinary + thriftTypeToCompactType[TypeStruct] = ctStruct + thriftTypeToCompactType[TypeList] = ctList + thriftTypeToCompactType[TypeSet] = ctSet + thriftTypeToCompactType[TypeMap] = ctMap + compactTypeToThriftType = make([]byte, 16) + compactTypeToThriftType[ctStop] = TypeStop + compactTypeToThriftType[ctTrue] = TypeBool + compactTypeToThriftType[ctFalse] = TypeBool + compactTypeToThriftType[ctByte] = TypeByte + compactTypeToThriftType[ctI16] = TypeI16 + compactTypeToThriftType[ctI32] = TypeI32 + compactTypeToThriftType[ctI64] = TypeI64 + compactTypeToThriftType[ctDouble] = TypeDouble + compactTypeToThriftType[ctBinary] = TypeString + compactTypeToThriftType[ctStruct] = TypeStruct + compactTypeToThriftType[ctList] = TypeList + compactTypeToThriftType[ctSet] = TypeSet + compactTypeToThriftType[ctMap] = TypeMap +} + +type compactProtocolWriter struct { + w io.Writer + lastFieldID int16 + boolFid int16 + boolValue bool + structs []int16 + container []int + buf []byte +} + +type compactProtocolReader struct { + r io.Reader + lastFieldID int16 + boolFid int16 + boolValue bool + structs []int16 + container []int + buf []byte +} + +var CompactProtocol = NewProtocolBuilder(NewCompactProtocolReader, NewCompactProtocolWriter) + +func NewCompactProtocolWriter(w io.Writer) ProtocolWriter { + return &compactProtocolWriter{ + w: w, + lastFieldID: 0, + boolFid: -1, + boolValue: false, + structs: make([]int16, 0, 8), + container: make([]int, 0, 8), + buf: make([]byte, 64), + } +} + +func NewCompactProtocolReader(r io.Reader) ProtocolReader { + return &compactProtocolReader{ + r: r, + lastFieldID: 0, + boolFid: -1, + boolValue: false, + structs: make([]int16, 0, 8), + container: make([]int, 0, 8), + buf: make([]byte, 64), + } +} + +func (p *compactProtocolWriter) writeVarint(value int64) (err error) { + n := binary.PutVarint(p.buf, value) + _, err = p.w.Write(p.buf[:n]) + return +} + +func (p *compactProtocolWriter) writeUvarint(value uint64) (err error) { + n := binary.PutUvarint(p.buf, value) + _, err = p.w.Write(p.buf[:n]) + return +} + +// Write a message header to the wire. Compact Protocol messages contain the +// protocol version so we can migrate forwards in the future if need be. +func (p *compactProtocolWriter) WriteMessageBegin(name string, messageType byte, seqid int32) (err error) { + if err = p.writeByteDirect(compactProtocolID); err != nil { + return + } + if err = p.writeByteDirect(compactVersion | (messageType << compactTypeShiftAmount)); err != nil { + return + } + if err = p.writeUvarint(uint64(seqid)); err != nil { + return + } + err = p.WriteString(name) + return +} + +// Write a struct begin. This doesn't actually put anything on the wire. We +// use it as an opportunity to put special placeholder markers on the field +// stack so we can get the field id deltas correct. +func (p *compactProtocolWriter) WriteStructBegin(name string) error { + p.structs = append(p.structs, p.lastFieldID) + p.lastFieldID = 0 + return nil +} + +// Write a struct end. This doesn't actually put anything on the wire. We use +// this as an opportunity to pop the last field from the current struct off +// of the field stack. +func (p *compactProtocolWriter) WriteStructEnd() error { + if len(p.structs) == 0 { + return ProtocolError{"CompactProtocol", "Struct end without matching begin"} + } + fid := p.structs[len(p.structs)-1] + p.structs = p.structs[:len(p.structs)-1] + p.lastFieldID = fid + return nil +} + +// Write a field header containing the field id and field type. If the +// difference between the current field id and the last one is small (< 15), +// then the field id will be encoded in the 4 MSB as a delta. Otherwise, the +// field id will follow the type header as a zigzag varint. +func (p *compactProtocolWriter) WriteFieldBegin(name string, fieldType byte, id int16) error { + if fieldType == TypeBool { + // we want to possibly include the value, so we'll wait. + p.boolFid = id + return nil + } + return p.writeFieldBeginInternal(name, fieldType, id, 0xff) +} + +// The workhorse of writeFieldBegin. It has the option of doing a +// 'type override' of the type header. This is used specifically in the +// boolean field case. +func (p *compactProtocolWriter) writeFieldBeginInternal(name string, fieldType byte, id int16, typeOverride byte) error { + // if there's a type override, use that. + typeToWrite := typeOverride + if typeToWrite == 0xff { + typeToWrite = thriftTypeToCompactType[fieldType] + } + + // check if we can use delta encoding for the field id + if id > p.lastFieldID && id-p.lastFieldID <= 15 { + // write them together + if err := p.writeByteDirect(byte((id-p.lastFieldID)<<4 | int16(typeToWrite))); err != nil { + return err + } + } else { + // write them separate + if err := p.writeByteDirect(byte(typeToWrite)); err != nil { + return err + } + if err := p.WriteI16(id); err != nil { + return err + } + } + + p.lastFieldID = id + return nil +} + +// Write the STOP symbol so we know there are no more fields in this struct. +func (p *compactProtocolWriter) WriteFieldStop() error { + return p.writeByteDirect(TypeStop) +} + +// Write a map header. If the map is empty, omit the key and value type +// headers, as we don't need any additional information to skip it. +func (p *compactProtocolWriter) WriteMapBegin(keyType byte, valueType byte, size int) error { + if size == 0 { + return p.writeByteDirect(0) + } + if err := p.writeUvarint(uint64(size)); err != nil { + return err + } + return p.writeByteDirect(byte(thriftTypeToCompactType[keyType]<<4 | thriftTypeToCompactType[valueType])) +} + +// Write a list header. +func (p *compactProtocolWriter) WriteListBegin(elementType byte, size int) error { + return p.writeCollectionBegin(elementType, size) +} + +// Write a set header. +func (p *compactProtocolWriter) WriteSetBegin(elementType byte, size int) error { + return p.writeCollectionBegin(elementType, size) +} + +// Write a boolean value. Potentially, this could be a boolean field, in +// which case the field header info isn't written yet. If so, decide what the +// right type header is for the value and then write the field header. +// Otherwise, write a single byte. +func (p *compactProtocolWriter) WriteBool(value bool) error { + fieldType := byte(ctFalse) + if value { + fieldType = ctTrue + } + if p.boolFid >= 0 { + // we haven't written the field header yet + return p.writeFieldBeginInternal("bool", TypeBool, p.boolFid, fieldType) + } + return p.writeByteDirect(fieldType) +} + +func (p *compactProtocolWriter) WriteByte(value byte) error { + return p.writeByteDirect(value) +} + +func (p *compactProtocolWriter) WriteI16(value int16) error { + return p.writeVarint(int64(value)) +} + +func (p *compactProtocolWriter) WriteI32(value int32) error { + return p.writeVarint(int64(value)) +} + +func (p *compactProtocolWriter) WriteI64(value int64) error { + return p.writeVarint(value) +} + +func (p *compactProtocolWriter) WriteDouble(value float64) (err error) { + b := p.buf + binary.BigEndian.PutUint64(b, math.Float64bits(value)) + _, err = p.w.Write(b[:8]) + return +} + +// Write a string to the wire with a varint size preceeding. +func (p *compactProtocolWriter) WriteString(value string) error { + return p.WriteBytes([]byte(value)) +} + +// Write a byte array, using a varint for the size. +func (p *compactProtocolWriter) WriteBytes(value []byte) error { + if err := p.writeUvarint(uint64(len(value))); err != nil { + return err + } + _, err := p.w.Write(value) + return err +} + +func (p *compactProtocolWriter) WriteMessageEnd() error { + return nil +} + +func (p *compactProtocolWriter) WriteMapEnd() error { + return nil +} + +func (p *compactProtocolWriter) WriteListEnd() error { + return nil +} + +func (p *compactProtocolWriter) WriteSetEnd() error { + return nil +} + +func (p *compactProtocolWriter) WriteFieldEnd() error { + return nil +} + +// Abstract method for writing the start of lists and sets. List and sets on +// the wire differ only by the type indicator. +func (p *compactProtocolWriter) writeCollectionBegin(elemType byte, size int) error { + if size <= 14 { + return p.writeByteDirect(byte(size)<<4 | thriftTypeToCompactType[elemType]) + } + if err := p.writeByteDirect(0xf0 | thriftTypeToCompactType[elemType]); err != nil { + return err + } + return p.writeUvarint(uint64(size)) +} + +// Writes a byte without any possiblity of all that field header nonsense. +// Used internally by other writing methods that know they need to write a byte. +func (p *compactProtocolWriter) writeByteDirect(value byte) error { + p.buf[0] = value + _, err := p.w.Write(p.buf[:1]) + return err +} + +func (p *compactProtocolReader) readVarint() (int64, error) { + if br, ok := p.r.(io.ByteReader); ok { + return binary.ReadVarint(br) + } + // TODO: Make this more efficient + n := 0 + b := p.buf + for { + if _, err := p.r.Read(b[n : n+1]); err != nil { + return 0, err + } + n++ + // n == 0: buf too small + // n < 0: value larger than 64-bits + if val, n := binary.Varint(b[:n]); n > 0 { + return val, nil + } else if n < 0 { + return val, ProtocolError{"CompactProtocol", "varint overflow on read"} + } + } +} + +func (p *compactProtocolReader) readUvarint() (uint64, error) { + if br, ok := p.r.(io.ByteReader); ok { + return binary.ReadUvarint(br) + } + // TODO: Make this more efficient + n := 0 + b := p.buf + for { + if _, err := p.r.Read(b[n : n+1]); err != nil { + return 0, err + } + n++ + // n == 0: buf too small + // n < 0: value larger than 64-bits + if val, n := binary.Uvarint(b[:n]); n > 0 { + return val, nil + } else if n < 0 { + return val, ProtocolError{"CompactProtocol", "varint overflow on read"} + } + } +} + +func (p *compactProtocolReader) ReadMessageBegin() (string, byte, int32, error) { + protocolID, err := p.ReadByte() + if err != nil { + return "", 0, -1, err + } + if protocolID != compactProtocolID { + return "", 0, -1, ProtocolError{"CompactProtocol", "invalid compact protocol ID"} + } + versionAndType, err := p.ReadByte() + if err != nil { + return "", 0, -1, err + } + version := versionAndType & compactVersionMask + if version != compactVersion { + return "", 0, -1, ProtocolError{"CompactProtocol", "invalid compact protocol version"} + } + msgType := (versionAndType >> compactTypeShiftAmount) & 0x03 + seqID, err := p.readUvarint() + if err != nil { + return "", 0, -1, err + } + msgName, err := p.ReadString() + if err != nil { + return "", 0, -1, err + } + return msgName, msgType, int32(seqID), nil +} + +// Read a struct begin. There's nothing on the wire for this, but it is our +// opportunity to push a new struct begin marker onto the field stack. +func (p *compactProtocolReader) ReadStructBegin() error { + p.structs = append(p.structs, p.lastFieldID) + p.lastFieldID = 0 + return nil +} + +// Doesn't actually consume any wire data, just removes the last field for +// this struct from the field stack. +func (p *compactProtocolReader) ReadStructEnd() error { + // consume the last field we read off the wire + p.lastFieldID = p.structs[len(p.structs)-1] + p.structs = p.structs[:len(p.structs)-1] + return nil +} + +// Read a field header off the wire. +func (p *compactProtocolReader) ReadFieldBegin() (byte, int16, error) { + compactType, err := p.ReadByte() + if err != nil { + return 0, -1, err + } + + // if it's a stop, then we can return immediately, as the struct is over + if (compactType & 0x0f) == ctStop { + return TypeStop, -1, nil + } + + // mask off the 4 MSB of the type header. it could contain a field id delta. + var fieldID int16 + modifier := int16((compactType & 0xf0) >> 4) + if modifier == 0 { + // not a delta. look ahead for the zigzag varint field id. + fieldID, err = p.ReadI16() + if err != nil { + return 0, fieldID, err + } + } else { + // has a delta. add the delta to the last read field id + fieldID = p.lastFieldID + modifier + } + + fieldType := compactTypeToThriftType[compactType&0x0f] + + // if this happens to be a boolean field, the value is encoded in the type + if fieldType == TypeBool { + // save the boolean value in a special instance variable. + p.boolValue = (compactType & 0x0f) == ctTrue + p.boolFid = fieldID + } + + // push the new field onto the field stack so we can keep the deltas going. + p.lastFieldID = fieldID + return fieldType, fieldID, nil +} + +// Read a map header off the wire. If the size is zero, skip reading the key +// and value type. This means that 0-length maps will yield TMaps without the +// "correct" types. +func (p *compactProtocolReader) ReadMapBegin() (byte, byte, int, error) { + size, err := p.readUvarint() + if err != nil { + return 0, 0, -1, err + } + keyAndValueType := byte(0) + if size > 0 { + keyAndValueType, err = p.ReadByte() + if err != nil { + return 0, 0, -1, err + } + } + return compactTypeToThriftType[keyAndValueType>>4], compactTypeToThriftType[keyAndValueType&0x0f], int(size), nil +} + +// Read a list header off the wire. If the list size is 0-14, the size will +// be packed into the element type header. If it's a longer list, the 4 MSB +// of the element type header will be 0xF, and a varint will follow with the +// true size. +func (p *compactProtocolReader) ReadListBegin() (byte, int, error) { + sizeAndType, err := p.ReadByte() + if err != nil { + return 0, -1, err + } + size := int((sizeAndType >> 4) & 0x0f) + if size == 15 { + s, err := p.readUvarint() + if err != nil { + return 0, -1, err + } + size = int(s) + } + return compactTypeToThriftType[sizeAndType&0x0f], size, nil +} + +// Read a set header off the wire. If the set size is 0-14, the size will +// be packed into the element type header. If it's a longer set, the 4 MSB +// of the element type header will be 0xF, and a varint will follow with the +// true size. +func (p *compactProtocolReader) ReadSetBegin() (byte, int, error) { + return p.ReadListBegin() +} + +// Read a boolean off the wire. If this is a boolean field, the value should +// already have been read during readFieldBegin, so we'll just consume the +// pre-stored value. Otherwise, read a byte. +func (p *compactProtocolReader) ReadBool() (bool, error) { + if p.boolFid < 0 { + v, err := p.ReadByte() + return v == ctTrue, err + } + + res := p.boolValue + p.boolFid = -1 + return res, nil +} + +// Read a single byte off the wire. Nothing interesting here. +func (p *compactProtocolReader) ReadByte() (byte, error) { + b := p.buf + _, err := io.ReadFull(p.r, b[:1]) + return b[0], err +} + +func (p *compactProtocolReader) ReadI16() (int16, error) { + v, err := p.readVarint() + return int16(v), err +} + +func (p *compactProtocolReader) ReadI32() (int32, error) { + v, err := p.readVarint() + return int32(v), err +} + +func (p *compactProtocolReader) ReadI64() (int64, error) { + v, err := p.readVarint() + return v, err +} + +func (p *compactProtocolReader) ReadDouble() (float64, error) { + b := p.buf + _, err := io.ReadFull(p.r, b[:8]) + value := math.Float64frombits(binary.BigEndian.Uint64(b)) + return value, err +} + +func (p *compactProtocolReader) ReadString() (string, error) { + ln, err := p.readUvarint() + if err != nil || ln == 0 { + return "", err + } else if ln < 0 { + return "", ProtocolError{"CompactProtocol", "negative length in CompactProtocol.ReadString"} + } + b := p.buf + if int(ln) > len(b) { + b = make([]byte, ln) + } else { + b = b[:ln] + } + if _, err := io.ReadFull(p.r, b); err != nil { + return "", err + } + return string(b), nil +} + +func (p *compactProtocolReader) ReadBytes() ([]byte, error) { + ln, err := p.readUvarint() + if err != nil || ln == 0 { + return nil, err + } else if ln < 0 { + return nil, ProtocolError{"CompactProtocol", "negative length in CompactProtocol.ReadBytes"} + } + b := make([]byte, ln) + if _, err := io.ReadFull(p.r, b); err != nil { + return nil, err + } + return b, nil +} + +func (p *compactProtocolReader) ReadMessageEnd() error { + return nil +} + +func (p *compactProtocolReader) ReadFieldEnd() error { + return nil +} + +func (p *compactProtocolReader) ReadMapEnd() error { + return nil +} + +func (p *compactProtocolReader) ReadListEnd() error { + return nil +} + +func (p *compactProtocolReader) ReadSetEnd() error { + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol_text.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol_text.go new file mode 100644 index 00000000..3c18f559 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/protocol_text.go @@ -0,0 +1,229 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "errors" + "fmt" + "io" +) + +var ( + ErrUnimplemented = errors.New("thrift: unimplemented") +) + +type textProtocolWriter struct { + w io.Writer + indentation string +} + +func NewTextProtocolWriter(w io.Writer) ProtocolWriter { + return &textProtocolWriter{w: w} +} + +func (p *textProtocolWriter) indent() { + p.indentation += "\t" +} + +func (p *textProtocolWriter) unindent() { + p.indentation = p.indentation[:len(p.indentation)-1] +} + +func (p *textProtocolWriter) WriteMessageBegin(name string, messageType byte, seqid int32) error { + fmt.Fprintf(p.w, "%sMessageBegin(%s, %d, %.8x)\n", p.indentation, name, messageType, seqid) + p.indent() + return nil +} + +func (p *textProtocolWriter) WriteMessageEnd() error { + p.unindent() + fmt.Fprintf(p.w, "%sMessageEnd()\n", p.indentation) + return nil +} + +func (p *textProtocolWriter) WriteStructBegin(name string) error { + fmt.Fprintf(p.w, "%sStructBegin(%s)\n", p.indentation, name) + p.indent() + return nil +} + +func (p *textProtocolWriter) WriteStructEnd() error { + p.unindent() + fmt.Fprintf(p.w, "%sStructEnd()\n", p.indentation) + return nil +} + +func (p *textProtocolWriter) WriteFieldBegin(name string, fieldType byte, id int16) error { + fmt.Fprintf(p.w, "%sFieldBegin(%s, %d, %d)\n", p.indentation, name, fieldType, id) + p.indent() + return nil +} + +func (p *textProtocolWriter) WriteFieldEnd() error { + p.unindent() + fmt.Fprintf(p.w, "%sFieldEnd()\n", p.indentation) + return nil +} + +func (p *textProtocolWriter) WriteFieldStop() error { + fmt.Fprintf(p.w, "%sFieldStop()\n", p.indentation) + return nil +} + +func (p *textProtocolWriter) WriteMapBegin(keyType byte, valueType byte, size int) error { + fmt.Fprintf(p.w, "%sMapBegin(%d, %d, %d)\n", p.indentation, keyType, valueType, size) + p.indent() + return nil +} + +func (p *textProtocolWriter) WriteMapEnd() error { + p.unindent() + fmt.Fprintf(p.w, "%sMapEnd()\n", p.indentation) + return nil +} + +func (p *textProtocolWriter) WriteListBegin(elementType byte, size int) error { + fmt.Fprintf(p.w, "%sListBegin(%d, %d)\n", p.indentation, elementType, size) + p.indent() + return nil +} + +func (p *textProtocolWriter) WriteListEnd() error { + p.unindent() + fmt.Fprintf(p.w, "%sListEnd()\n", p.indentation) + return nil +} + +func (p *textProtocolWriter) WriteSetBegin(elementType byte, size int) error { + fmt.Fprintf(p.w, "%sSetBegin(%d, %d)\n", p.indentation, elementType, size) + p.indent() + return nil +} + +func (p *textProtocolWriter) WriteSetEnd() error { + p.unindent() + fmt.Fprintf(p.w, "%sSetEnd()\n", p.indentation) + return nil +} + +func (p *textProtocolWriter) WriteBool(value bool) error { + fmt.Fprintf(p.w, "%sBool(%+v)\n", p.indentation, value) + return nil +} + +func (p *textProtocolWriter) WriteByte(value byte) error { + fmt.Fprintf(p.w, "%sByte(%d)\n", p.indentation, value) + return nil +} + +func (p *textProtocolWriter) WriteI16(value int16) error { + fmt.Fprintf(p.w, "%sI16(%d)\n", p.indentation, value) + return nil +} + +func (p *textProtocolWriter) WriteI32(value int32) error { + fmt.Fprintf(p.w, "%sI32(%d)\n", p.indentation, value) + return nil +} + +func (p *textProtocolWriter) WriteI64(value int64) error { + fmt.Fprintf(p.w, "%sI64(%d)\n", p.indentation, value) + return nil +} + +func (p *textProtocolWriter) WriteDouble(value float64) error { + fmt.Fprintf(p.w, "%sDouble(%f)\n", p.indentation, value) + return nil +} + +func (p *textProtocolWriter) WriteString(value string) error { + fmt.Fprintf(p.w, "%sString(%s)\n", p.indentation, value) + return nil +} + +func (p *textProtocolWriter) WriteBytes(value []byte) error { + fmt.Fprintf(p.w, "%sBytes(%+v)\n", p.indentation, value) + return nil +} + +func (p *textProtocolWriter) ReadMessageBegin() (name string, messageType byte, seqid int32, err error) { + return "", 0, 0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadMessageEnd() error { + return ErrUnimplemented +} + +func (p *textProtocolWriter) ReadStructBegin() error { + return ErrUnimplemented +} + +func (p *textProtocolWriter) ReadStructEnd() error { + return ErrUnimplemented +} + +func (p *textProtocolWriter) ReadFieldBegin() (fieldType byte, id int16, err error) { + return 0, 0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadFieldEnd() error { + return ErrUnimplemented +} + +func (p *textProtocolWriter) ReadMapBegin() (keyType byte, valueType byte, size int, err error) { + return 0, 0, 0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadMapEnd() error { + return ErrUnimplemented +} + +func (p *textProtocolWriter) ReadListBegin() (elementType byte, size int, err error) { + return 0, 0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadListEnd() error { + return ErrUnimplemented +} + +func (p *textProtocolWriter) ReadSetBegin() (elementType byte, size int, err error) { + return 0, 0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadSetEnd() error { + return ErrUnimplemented +} + +func (p *textProtocolWriter) ReadBool() (bool, error) { + return false, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadByte() (byte, error) { + return 0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadI16() (int16, error) { + return 0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadI32() (int32, error) { + return 0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadI64() (int64, error) { + return 0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadDouble() (float64, error) { + return 0.0, ErrUnimplemented +} + +func (p *textProtocolWriter) ReadString() (string, error) { + return "", ErrUnimplemented +} + +func (p *textProtocolWriter) ReadBytes() ([]byte, error) { + return nil, ErrUnimplemented +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/server.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/server.go new file mode 100644 index 00000000..c4993c30 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/server.go @@ -0,0 +1,114 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "errors" + "io" + "net/rpc" + "strings" + "sync" +) + +type serverCodec struct { + conn Transport + nameCache map[string]string // incoming name -> registered name + methodName map[uint64]string // sequence ID -> method name + mu sync.Mutex +} + +// ServeConn runs the Thrift RPC server on a single connection. ServeConn blocks, +// serving the connection until the client hangs up. The caller typically invokes +// ServeConn in a go statement. +func ServeConn(conn Transport) { + rpc.ServeCodec(NewServerCodec(conn)) +} + +// NewServerCodec returns a new rpc.ServerCodec using Thrift RPC on conn using the specified protocol. +func NewServerCodec(conn Transport) rpc.ServerCodec { + return &serverCodec{ + conn: conn, + nameCache: make(map[string]string, 8), + methodName: make(map[uint64]string, 8), + } +} + +func (c *serverCodec) ReadRequestHeader(request *rpc.Request) error { + name, messageType, seq, err := c.conn.ReadMessageBegin() + if err != nil { + return err + } + if messageType != MessageTypeCall { // Currently don't support one way + return errors.New("thrift: expected Call message type") + } + + // TODO: should use a limited size cache for the nameCache to avoid a possible + // memory overflow from nefarious or broken clients + newName := c.nameCache[name] + if newName == "" { + newName = CamelCase(name) + if !strings.ContainsRune(newName, '.') { + newName = "Thrift." + newName + } + c.nameCache[name] = newName + } + + c.mu.Lock() + c.methodName[uint64(seq)] = name + c.mu.Unlock() + + request.ServiceMethod = newName + request.Seq = uint64(seq) + + return nil +} + +func (c *serverCodec) ReadRequestBody(thriftStruct interface{}) error { + if thriftStruct == nil { + if err := SkipValue(c.conn, TypeStruct); err != nil { + return err + } + } else { + if err := DecodeStruct(c.conn, thriftStruct); err != nil { + return err + } + } + return c.conn.ReadMessageEnd() +} + +func (c *serverCodec) WriteResponse(response *rpc.Response, thriftStruct interface{}) error { + c.mu.Lock() + methodName := c.methodName[response.Seq] + delete(c.methodName, response.Seq) + c.mu.Unlock() + response.ServiceMethod = methodName + + mtype := byte(MessageTypeReply) + if response.Error != "" { + mtype = MessageTypeException + etype := int32(ExceptionInternalError) + if strings.HasPrefix(response.Error, "rpc: can't find") { + etype = ExceptionUnknownMethod + } + thriftStruct = &ApplicationException{response.Error, etype} + } + if err := c.conn.WriteMessageBegin(response.ServiceMethod, mtype, int32(response.Seq)); err != nil { + return err + } + if err := EncodeStruct(c.conn, thriftStruct); err != nil { + return err + } + if err := c.conn.WriteMessageEnd(); err != nil { + return err + } + return c.conn.Flush() +} + +func (c *serverCodec) Close() error { + if cl, ok := c.conn.(io.Closer); ok { + return cl.Close() + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/tags.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/tags.go new file mode 100644 index 00000000..266a6f6b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/tags.go @@ -0,0 +1,47 @@ +// Copyright 2011 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. + +package thrift + +import ( + "strconv" + "strings" +) + +// tagOptions is the string following a comma in a struct field's "thrift" +// tag, or the empty string. It does not include the leading comma. +type tagOptions string + +// parseTag splits a struct field's thrift tag into its id and +// comma-separated options. +func parseTag(tag string) (int, tagOptions) { + if idx := strings.Index(tag, ","); idx != -1 { + id, _ := strconv.Atoi(tag[:idx]) + return id, tagOptions(tag[idx+1:]) + } + id, _ := strconv.Atoi(tag) + return id, tagOptions("") +} + +// Contains returns whether checks that a comma-separated list of options +// contains a particular substr flag. substr must be surrounded by a +// string boundary or commas. +func (o tagOptions) Contains(optionName string) bool { + if len(o) == 0 { + return false + } + s := string(o) + for s != "" { + var next string + i := strings.Index(s, ",") + if i >= 0 { + s, next = s[:i], s[i+1:] + } + if s == optionName { + return true + } + s = next + } + return false +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/thrift.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/thrift.go new file mode 100644 index 00000000..6d688a36 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/thrift.go @@ -0,0 +1,414 @@ +package thrift + +import ( + "errors" + "fmt" + "reflect" + "sync" +) + +// Type identifiers for serialized Thrift +const ( + TypeStop = 0 + TypeVoid = 1 + TypeBool = 2 + TypeByte = 3 + TypeI08 = 3 + TypeDouble = 4 + TypeI16 = 6 + TypeI32 = 8 + TypeI64 = 10 + TypeString = 11 + TypeUtf7 = 11 + TypeStruct = 12 + TypeMap = 13 + TypeSet = 14 + TypeList = 15 + TypeUtf8 = 16 + TypeUtf16 = 17 +) + +// Message types for RPC +const ( + MessageTypeCall = 1 + MessageTypeReply = 2 + MessageTypeException = 3 + MessageTypeOneway = 4 +) + +// Exception types for RPC responses +const ( + ExceptionUnknown = 0 + ExceptionUnknownMethod = 1 + ExceptionInvalidMessageType = 2 + ExceptionWrongMethodName = 3 + ExceptionBadSequenceID = 4 + ExceptionMissingResult = 5 + ExceptionInternalError = 6 + ExceptionProtocolError = 7 +) + +type MissingRequiredField struct { + StructName string + FieldName string +} + +func (e *MissingRequiredField) Error() string { + return "thrift: missing required field: " + e.StructName + "." + e.FieldName +} + +type UnsupportedTypeError struct { + Type reflect.Type +} + +func (e *UnsupportedTypeError) Error() string { + return "thrift: unsupported type: " + e.Type.String() +} + +type UnsupportedValueError struct { + Value reflect.Value + Str string +} + +func (e *UnsupportedValueError) Error() string { + return fmt.Sprintf("thrift: unsupported value (%+v): %s", e.Value, e.Str) +} + +// ApplicationException is an application level thrift exception +type ApplicationException struct { + Message string `thrift:"1"` + Type int32 `thrift:"2"` +} + +func (e *ApplicationException) String() string { + typeStr := "Unknown Exception" + switch e.Type { + case ExceptionUnknownMethod: + typeStr = "Unknown Method" + case ExceptionInvalidMessageType: + typeStr = "Invalid Message Type" + case ExceptionWrongMethodName: + typeStr = "Wrong Method Name" + case ExceptionBadSequenceID: + typeStr = "Bad Sequence ID" + case ExceptionMissingResult: + typeStr = "Missing Result" + case ExceptionInternalError: + typeStr = "Internal Error" + case ExceptionProtocolError: + typeStr = "Protocol Error" + } + return fmt.Sprintf("%s: %s", typeStr, e.Message) +} + +func fieldType(t reflect.Type) byte { + switch t.Kind() { + case reflect.Bool: + return TypeBool + case reflect.Int8, reflect.Uint8: + return TypeByte + case reflect.Int16: + return TypeI16 + case reflect.Int32, reflect.Uint32, reflect.Int: + return TypeI32 + case reflect.Int64, reflect.Uint64: + return TypeI64 + case reflect.Float64: + return TypeDouble + case reflect.Map: + valueType := t.Elem() + if valueType.Kind() == reflect.Struct && valueType.Name() == "" && valueType.NumField() == 0 { + return TypeSet + } + return TypeMap + case reflect.Slice: + elemType := t.Elem() + if elemType.Kind() == reflect.Uint8 { + return TypeString + } + return TypeList + case reflect.Struct: + return TypeStruct + case reflect.String: + return TypeString + case reflect.Interface, reflect.Ptr: + return fieldType(t.Elem()) + } + panic(&UnsupportedTypeError{t}) +} + +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice: + return v.IsNil() + case reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + return false +} + +// encodeField contains information about how to encode a field of a +// struct. +type encodeField struct { + i int // field index in struct + id int + required bool + keepEmpty bool + fieldType byte + name string +} + +type structMeta struct { + required uint64 // bitmap of required fields + fields map[int]encodeField +} + +var ( + typeCacheLock sync.RWMutex + encodeFieldsCache = make(map[reflect.Type]structMeta) +) + +// encodeFields returns a slice of encodeField for a given +// struct type. +func encodeFields(t reflect.Type) structMeta { + typeCacheLock.RLock() + m, ok := encodeFieldsCache[t] + typeCacheLock.RUnlock() + if ok { + return m + } + + typeCacheLock.Lock() + defer typeCacheLock.Unlock() + m, ok = encodeFieldsCache[t] + if ok { + return m + } + + fs := make(map[int]encodeField) + m = structMeta{fields: fs} + v := reflect.Zero(t) + n := v.NumField() + for i := 0; i < n; i++ { + f := t.Field(i) + if f.PkgPath != "" { + continue + } + if f.Anonymous { + // We want to do a better job with these later, + // so for now pretend they don't exist. + continue + } + tv := f.Tag.Get("thrift") + if tv != "" { + var ef encodeField + ef.i = i + ef.id = 0 + + if tv == "-" { + continue + } + id, opts := parseTag(tv) + if id >= 64 { + // TODO: figure out a better way to deal with this + panic("thrift: field id must be < 64") + } + ef.id = id + ef.name = f.Name + ef.required = opts.Contains("required") + if ef.required { + m.required |= 1 << byte(id) + } + ef.keepEmpty = opts.Contains("keepempty") + if opts.Contains("set") { + ef.fieldType = TypeSet + } else { + ef.fieldType = fieldType(f.Type) + } + + fs[ef.id] = ef + } + } + encodeFieldsCache[t] = m + return m +} + +func SkipValue(r ProtocolReader, thriftType byte) error { + var err error + switch thriftType { + case TypeBool: + _, err = r.ReadBool() + case TypeByte: + _, err = r.ReadByte() + case TypeI16: + _, err = r.ReadI16() + case TypeI32: + _, err = r.ReadI32() + case TypeI64: + _, err = r.ReadI64() + case TypeDouble: + _, err = r.ReadDouble() + case TypeString: + _, err = r.ReadBytes() + case TypeStruct: + if err := r.ReadStructBegin(); err != nil { + return err + } + for { + ftype, _, err := r.ReadFieldBegin() + if err != nil { + return err + } + if ftype == TypeStop { + break + } + if err = SkipValue(r, ftype); err != nil { + return err + } + if err = r.ReadFieldEnd(); err != nil { + return err + } + } + return r.ReadStructEnd() + case TypeMap: + keyType, valueType, n, err := r.ReadMapBegin() + if err != nil { + return err + } + + for i := 0; i < n; i++ { + if err = SkipValue(r, keyType); err != nil { + return err + } + if err = SkipValue(r, valueType); err != nil { + return err + } + } + + return r.ReadMapEnd() + case TypeList: + valueType, n, err := r.ReadListBegin() + if err != nil { + return err + } + for i := 0; i < n; i++ { + if err = SkipValue(r, valueType); err != nil { + return err + } + } + return r.ReadListEnd() + case TypeSet: + valueType, n, err := r.ReadSetBegin() + if err != nil { + return err + } + for i := 0; i < n; i++ { + if err = SkipValue(r, valueType); err != nil { + return err + } + } + return r.ReadSetEnd() + } + return err +} + +func ReadValue(r ProtocolReader, thriftType byte) (interface{}, error) { + switch thriftType { + case TypeBool: + return r.ReadBool() + case TypeByte: + return r.ReadByte() + case TypeI16: + return r.ReadI16() + case TypeI32: + return r.ReadI32() + case TypeI64: + return r.ReadI64() + case TypeDouble: + return r.ReadDouble() + case TypeString: + return r.ReadString() + case TypeStruct: + if err := r.ReadStructBegin(); err != nil { + return nil, err + } + st := make(map[int]interface{}) + for { + ftype, id, err := r.ReadFieldBegin() + if err != nil { + return st, err + } + if ftype == TypeStop { + break + } + v, err := ReadValue(r, ftype) + if err != nil { + return st, err + } + st[int(id)] = v + if err = r.ReadFieldEnd(); err != nil { + return st, err + } + } + return st, r.ReadStructEnd() + case TypeMap: + keyType, valueType, n, err := r.ReadMapBegin() + if err != nil { + return nil, err + } + + mp := make(map[interface{}]interface{}) + for i := 0; i < n; i++ { + k, err := ReadValue(r, keyType) + if err != nil { + return mp, err + } + v, err := ReadValue(r, valueType) + if err != nil { + return mp, err + } + mp[k] = v + } + + return mp, r.ReadMapEnd() + case TypeList: + valueType, n, err := r.ReadListBegin() + if err != nil { + return nil, err + } + lst := make([]interface{}, 0) + for i := 0; i < n; i++ { + v, err := ReadValue(r, valueType) + if err != nil { + return lst, err + } + lst = append(lst, v) + } + return lst, r.ReadListEnd() + case TypeSet: + valueType, n, err := r.ReadSetBegin() + if err != nil { + return nil, err + } + set := make([]interface{}, 0) + for i := 0; i < n; i++ { + v, err := ReadValue(r, valueType) + if err != nil { + return set, err + } + set = append(set, v) + } + return set, r.ReadSetEnd() + } + return nil, errors.New("thrift: unknown type") +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/transport.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/transport.go new file mode 100644 index 00000000..d55c4a20 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/transport.go @@ -0,0 +1,46 @@ +package thrift + +import ( + "bufio" + "io" +) + +type Transport interface { + ProtocolReader + ProtocolWriter + io.Closer + Flusher +} + +type transport struct { + ProtocolReader + ProtocolWriter + io.Closer + f Flusher +} + +func NewTransport(rwc io.ReadWriteCloser, p ProtocolBuilder) Transport { + t := &transport{ + Closer: rwc, + } + if _, ok := rwc.(*FramedReadWriteCloser); ok { + t.ProtocolReader = p.NewProtocolReader(rwc) + t.ProtocolWriter = p.NewProtocolWriter(rwc) + if f, ok := rwc.(Flusher); ok { + t.f = f + } + } else { + w := bufio.NewWriter(rwc) + t.ProtocolWriter = p.NewProtocolWriter(w) + t.ProtocolReader = p.NewProtocolReader(bufio.NewReader(rwc)) + t.f = w + } + return t +} + +func (t *transport) Flush() error { + if t.f != nil { + return t.f.Flush() + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/util.go b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/util.go new file mode 100644 index 00000000..8cdd8403 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/samuel/go-thrift/thrift/util.go @@ -0,0 +1,28 @@ +// Copyright 2012 Samuel Stauffer. All rights reserved. +// Use of this source code is governed by a 3-clause BSD +// license that can be found in the LICENSE file. + +package thrift + +import ( + "strings" + "unicode" +) + +// CamelCase returns the string converted to camel case (e.g. some_name to SomeName) +func CamelCase(s string) string { + prev := '_' + return strings.Map( + func(r rune) rune { + if r == '_' { + prev = r + return -1 + } + if prev == '_' { + prev = r + return unicode.ToUpper(r) + } + prev = r + return r + }, s) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/satori/go.uuid/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/satori/go.uuid/LICENSE new file mode 100644 index 00000000..488357b8 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/satori/go.uuid/LICENSE @@ -0,0 +1,20 @@ +Copyright (C) 2013-2016 by Maxim Bublis + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/satori/go.uuid/README.md b/vendor/github.com/elastic/beats/vendor/github.com/satori/go.uuid/README.md new file mode 100644 index 00000000..b6aad1c8 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/satori/go.uuid/README.md @@ -0,0 +1,65 @@ +# UUID package for Go language + +[![Build Status](https://travis-ci.org/satori/go.uuid.png?branch=master)](https://travis-ci.org/satori/go.uuid) +[![Coverage Status](https://coveralls.io/repos/github/satori/go.uuid/badge.svg?branch=master)](https://coveralls.io/github/satori/go.uuid) +[![GoDoc](http://godoc.org/github.com/satori/go.uuid?status.png)](http://godoc.org/github.com/satori/go.uuid) + +This package provides pure Go implementation of Universally Unique Identifier (UUID). Supported both creation and parsing of UUIDs. + +With 100% test coverage and benchmarks out of box. + +Supported versions: +* Version 1, based on timestamp and MAC address (RFC 4122) +* Version 2, based on timestamp, MAC address and POSIX UID/GID (DCE 1.1) +* Version 3, based on MD5 hashing (RFC 4122) +* Version 4, based on random numbers (RFC 4122) +* Version 5, based on SHA-1 hashing (RFC 4122) + +## Installation + +Use the `go` command: + + $ go get github.com/satori/go.uuid + +## Requirements + +UUID package requires Go >= 1.2. + +## Example + +```go +package main + +import ( + "fmt" + "github.com/satori/go.uuid" +) + +func main() { + // Creating UUID Version 4 + u1 := uuid.NewV4() + fmt.Printf("UUIDv4: %s\n", u1) + + // Parsing UUID from string input + u2, err := uuid.FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8") + if err != nil { + fmt.Printf("Something gone wrong: %s", err) + } + fmt.Printf("Successfully parsed: %s", u2) +} +``` + +## Documentation + +[Documentation](http://godoc.org/github.com/satori/go.uuid) is hosted at GoDoc project. + +## Links +* [RFC 4122](http://tools.ietf.org/html/rfc4122) +* [DCE 1.1: Authentication and Security Services](http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01) + +## Copyright + +Copyright (C) 2013-2016 by Maxim Bublis . + +UUID package released under MIT License. +See [LICENSE](https://github.com/satori/go.uuid/blob/master/LICENSE) for details. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/satori/go.uuid/uuid.go b/vendor/github.com/elastic/beats/vendor/github.com/satori/go.uuid/uuid.go new file mode 100644 index 00000000..9c7fbaa5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/satori/go.uuid/uuid.go @@ -0,0 +1,488 @@ +// Copyright (C) 2013-2015 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// Package uuid provides implementation of Universally Unique Identifier (UUID). +// Supported versions are 1, 3, 4 and 5 (as specified in RFC 4122) and +// version 2 (as specified in DCE 1.1). +package uuid + +import ( + "bytes" + "crypto/md5" + "crypto/rand" + "crypto/sha1" + "database/sql/driver" + "encoding/binary" + "encoding/hex" + "fmt" + "hash" + "net" + "os" + "sync" + "time" +) + +// UUID layout variants. +const ( + VariantNCS = iota + VariantRFC4122 + VariantMicrosoft + VariantFuture +) + +// UUID DCE domains. +const ( + DomainPerson = iota + DomainGroup + DomainOrg +) + +// Difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970). +const epochStart = 122192928000000000 + +// Used in string method conversion +const dash byte = '-' + +// UUID v1/v2 storage. +var ( + storageMutex sync.Mutex + storageOnce sync.Once + epochFunc = unixTimeFunc + clockSequence uint16 + lastTime uint64 + hardwareAddr [6]byte + posixUID = uint32(os.Getuid()) + posixGID = uint32(os.Getgid()) +) + +// String parse helpers. +var ( + urnPrefix = []byte("urn:uuid:") + byteGroups = []int{8, 4, 4, 4, 12} +) + +func initClockSequence() { + buf := make([]byte, 2) + safeRandom(buf) + clockSequence = binary.BigEndian.Uint16(buf) +} + +func initHardwareAddr() { + interfaces, err := net.Interfaces() + if err == nil { + for _, iface := range interfaces { + if len(iface.HardwareAddr) >= 6 { + copy(hardwareAddr[:], iface.HardwareAddr) + return + } + } + } + + // Initialize hardwareAddr randomly in case + // of real network interfaces absence + safeRandom(hardwareAddr[:]) + + // Set multicast bit as recommended in RFC 4122 + hardwareAddr[0] |= 0x01 +} + +func initStorage() { + initClockSequence() + initHardwareAddr() +} + +func safeRandom(dest []byte) { + if _, err := rand.Read(dest); err != nil { + panic(err) + } +} + +// Returns difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and current time. +// This is default epoch calculation function. +func unixTimeFunc() uint64 { + return epochStart + uint64(time.Now().UnixNano()/100) +} + +// UUID representation compliant with specification +// described in RFC 4122. +type UUID [16]byte + +// NullUUID can be used with the standard sql package to represent a +// UUID value that can be NULL in the database +type NullUUID struct { + UUID UUID + Valid bool +} + +// The nil UUID is special form of UUID that is specified to have all +// 128 bits set to zero. +var Nil = UUID{} + +// Predefined namespace UUIDs. +var ( + NamespaceDNS, _ = FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8") + NamespaceURL, _ = FromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8") + NamespaceOID, _ = FromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8") + NamespaceX500, _ = FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8") +) + +// And returns result of binary AND of two UUIDs. +func And(u1 UUID, u2 UUID) UUID { + u := UUID{} + for i := 0; i < 16; i++ { + u[i] = u1[i] & u2[i] + } + return u +} + +// Or returns result of binary OR of two UUIDs. +func Or(u1 UUID, u2 UUID) UUID { + u := UUID{} + for i := 0; i < 16; i++ { + u[i] = u1[i] | u2[i] + } + return u +} + +// Equal returns true if u1 and u2 equals, otherwise returns false. +func Equal(u1 UUID, u2 UUID) bool { + return bytes.Equal(u1[:], u2[:]) +} + +// Version returns algorithm version used to generate UUID. +func (u UUID) Version() uint { + return uint(u[6] >> 4) +} + +// Variant returns UUID layout variant. +func (u UUID) Variant() uint { + switch { + case (u[8] & 0x80) == 0x00: + return VariantNCS + case (u[8]&0xc0)|0x80 == 0x80: + return VariantRFC4122 + case (u[8]&0xe0)|0xc0 == 0xc0: + return VariantMicrosoft + } + return VariantFuture +} + +// Bytes returns bytes slice representation of UUID. +func (u UUID) Bytes() []byte { + return u[:] +} + +// Returns canonical string representation of UUID: +// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. +func (u UUID) String() string { + buf := make([]byte, 36) + + hex.Encode(buf[0:8], u[0:4]) + buf[8] = dash + hex.Encode(buf[9:13], u[4:6]) + buf[13] = dash + hex.Encode(buf[14:18], u[6:8]) + buf[18] = dash + hex.Encode(buf[19:23], u[8:10]) + buf[23] = dash + hex.Encode(buf[24:], u[10:]) + + return string(buf) +} + +// SetVersion sets version bits. +func (u *UUID) SetVersion(v byte) { + u[6] = (u[6] & 0x0f) | (v << 4) +} + +// SetVariant sets variant bits as described in RFC 4122. +func (u *UUID) SetVariant() { + u[8] = (u[8] & 0xbf) | 0x80 +} + +// MarshalText implements the encoding.TextMarshaler interface. +// The encoding is the same as returned by String. +func (u UUID) MarshalText() (text []byte, err error) { + text = []byte(u.String()) + return +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +// Following formats are supported: +// "6ba7b810-9dad-11d1-80b4-00c04fd430c8", +// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", +// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" +func (u *UUID) UnmarshalText(text []byte) (err error) { + if len(text) < 32 { + err = fmt.Errorf("uuid: UUID string too short: %s", text) + return + } + + t := text[:] + braced := false + + if bytes.Equal(t[:9], urnPrefix) { + t = t[9:] + } else if t[0] == '{' { + braced = true + t = t[1:] + } + + b := u[:] + + for i, byteGroup := range byteGroups { + if i > 0 && t[0] == '-' { + t = t[1:] + } else if i > 0 && t[0] != '-' { + err = fmt.Errorf("uuid: invalid string format") + return + } + + if i == 2 { + if !bytes.Contains([]byte("012345"), []byte{t[0]}) { + err = fmt.Errorf("uuid: invalid version number: %s", t[0]) + return + } + } + + if len(t) < byteGroup { + err = fmt.Errorf("uuid: UUID string too short: %s", text) + return + } + + if i == 4 && len(t) > byteGroup && + ((braced && t[byteGroup] != '}') || len(t[byteGroup:]) > 1 || !braced) { + err = fmt.Errorf("uuid: UUID string too long: %s", t) + return + } + + _, err = hex.Decode(b[:byteGroup/2], t[:byteGroup]) + + if err != nil { + return + } + + t = t[byteGroup:] + b = b[byteGroup/2:] + } + + return +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface. +func (u UUID) MarshalBinary() (data []byte, err error) { + data = u.Bytes() + return +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +// It will return error if the slice isn't 16 bytes long. +func (u *UUID) UnmarshalBinary(data []byte) (err error) { + if len(data) != 16 { + err = fmt.Errorf("uuid: UUID must be exactly 16 bytes long, got %d bytes", len(data)) + return + } + copy(u[:], data) + + return +} + +// Value implements the driver.Valuer interface. +func (u UUID) Value() (driver.Value, error) { + return u.String(), nil +} + +// Scan implements the sql.Scanner interface. +// A 16-byte slice is handled by UnmarshalBinary, while +// a longer byte slice or a string is handled by UnmarshalText. +func (u *UUID) Scan(src interface{}) error { + switch src := src.(type) { + case []byte: + if len(src) == 16 { + return u.UnmarshalBinary(src) + } + return u.UnmarshalText(src) + + case string: + return u.UnmarshalText([]byte(src)) + } + + return fmt.Errorf("uuid: cannot convert %T to UUID", src) +} + +// Value implements the driver.Valuer interface. +func (u NullUUID) Value() (driver.Value, error) { + if !u.Valid { + return nil, nil + } + // Delegate to UUID Value function + return u.UUID.Value() +} + +// Scan implements the sql.Scanner interface. +func (u *NullUUID) Scan(src interface{}) error { + if src == nil { + u.UUID, u.Valid = Nil, false + return nil + } + + // Delegate to UUID Scan function + u.Valid = true + return u.UUID.Scan(src) +} + +// FromBytes returns UUID converted from raw byte slice input. +// It will return error if the slice isn't 16 bytes long. +func FromBytes(input []byte) (u UUID, err error) { + err = u.UnmarshalBinary(input) + return +} + +// FromBytesOrNil returns UUID converted from raw byte slice input. +// Same behavior as FromBytes, but returns a Nil UUID on error. +func FromBytesOrNil(input []byte) UUID { + uuid, err := FromBytes(input) + if err != nil { + return Nil + } + return uuid +} + +// FromString returns UUID parsed from string input. +// Input is expected in a form accepted by UnmarshalText. +func FromString(input string) (u UUID, err error) { + err = u.UnmarshalText([]byte(input)) + return +} + +// FromStringOrNil returns UUID parsed from string input. +// Same behavior as FromString, but returns a Nil UUID on error. +func FromStringOrNil(input string) UUID { + uuid, err := FromString(input) + if err != nil { + return Nil + } + return uuid +} + +// Returns UUID v1/v2 storage state. +// Returns epoch timestamp, clock sequence, and hardware address. +func getStorage() (uint64, uint16, []byte) { + storageOnce.Do(initStorage) + + storageMutex.Lock() + defer storageMutex.Unlock() + + timeNow := epochFunc() + // Clock changed backwards since last UUID generation. + // Should increase clock sequence. + if timeNow <= lastTime { + clockSequence++ + } + lastTime = timeNow + + return timeNow, clockSequence, hardwareAddr[:] +} + +// NewV1 returns UUID based on current timestamp and MAC address. +func NewV1() UUID { + u := UUID{} + + timeNow, clockSeq, hardwareAddr := getStorage() + + binary.BigEndian.PutUint32(u[0:], uint32(timeNow)) + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) + binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) + binary.BigEndian.PutUint16(u[8:], clockSeq) + + copy(u[10:], hardwareAddr) + + u.SetVersion(1) + u.SetVariant() + + return u +} + +// NewV2 returns DCE Security UUID based on POSIX UID/GID. +func NewV2(domain byte) UUID { + u := UUID{} + + timeNow, clockSeq, hardwareAddr := getStorage() + + switch domain { + case DomainPerson: + binary.BigEndian.PutUint32(u[0:], posixUID) + case DomainGroup: + binary.BigEndian.PutUint32(u[0:], posixGID) + } + + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) + binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) + binary.BigEndian.PutUint16(u[8:], clockSeq) + u[9] = domain + + copy(u[10:], hardwareAddr) + + u.SetVersion(2) + u.SetVariant() + + return u +} + +// NewV3 returns UUID based on MD5 hash of namespace UUID and name. +func NewV3(ns UUID, name string) UUID { + u := newFromHash(md5.New(), ns, name) + u.SetVersion(3) + u.SetVariant() + + return u +} + +// NewV4 returns random generated UUID. +func NewV4() UUID { + u := UUID{} + safeRandom(u[:]) + u.SetVersion(4) + u.SetVariant() + + return u +} + +// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name. +func NewV5(ns UUID, name string) UUID { + u := newFromHash(sha1.New(), ns, name) + u.SetVersion(5) + u.SetVariant() + + return u +} + +// Returns UUID based on hashing of namespace UUID and name. +func newFromHash(h hash.Hash, ns UUID, name string) UUID { + u := UUID{} + h.Write(ns[:]) + h.Write([]byte(name)) + copy(u[:], h.Sum(nil)) + + return u +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/LICENSE new file mode 100644 index 00000000..602b2c09 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/LICENSE @@ -0,0 +1,27 @@ +gopsutil is distributed under BSD license reproduced below. + +Copyright (c) 2014, WAKAYAMA Shirou +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the gopsutil authors nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/Makefile b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/Makefile new file mode 100644 index 00000000..b5dcc948 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/Makefile @@ -0,0 +1,18 @@ +.PHONY: help check +.DEFAULT_GOAL := help + +SUBPKGS=cpu disk docker host internal load mem net process + +help: ## Show help + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +check: ## Check + errcheck -ignore="Close|Run|Write" ./... + golint ./... | egrep -v 'underscores|HttpOnly|should have comment|comment on exported|CamelCase|VM|UID' + +build_test: ## test only buildable + GOOS=linux go test ./... | grep -v "exec format error" + GOOS=freebsd go test ./... | grep -v "exec format error" + CGO_ENABLED=0 GOOS=darwin go test ./... | grep -v "exec format error" + CGO_ENABLED=1 GOOS=darwin go test ./... | grep -v "exec format error" + GOOS=windows go test ./...| grep -v "exec format error" diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/README.rst b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/README.rst new file mode 100644 index 00000000..b96fd5f4 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/README.rst @@ -0,0 +1,293 @@ +gopsutil: psutil for golang +============================== + +.. image:: https://circleci.com/gh/shirou/gopsutil.svg?&style=shield + :target: https://circleci.com/gh/shirou/gopsutil + +.. image:: https://coveralls.io/repos/shirou/gopsutil/badge.svg?branch=master + :target: https://coveralls.io/r/shirou/gopsutil?branch=master + +.. image:: https://godoc.org/github.com/shirou/gopsutil?status.svg + :target: http://godoc.org/github.com/shirou/gopsutil + +This is a port of psutil (http://pythonhosted.org/psutil/). The challenge is porting all +psutil functions on some architectures... + + +.. highlights:: Breaking Changes! + + Breaking changes is introduced at v2. See `issue 174 `_ . + + +Migrating to v2 +------------------------- + +On gopsutil itself, `v2migration.sh `_ is used for migration. It can not be commly used, but it may help to your migration. + + +Available Architectures +------------------------------------ + +- FreeBSD i386/amd64 +- Linux i386/amd64/arm(raspberry pi) +- Windows/amd64 +- Darwin/amd64 + +All works are implemented without cgo by porting c struct to golang struct. + + +Usage +--------- + +Note: gopsutil v2 breaks compatibility. If you want to stay with compatibility, please use v1 branch and vendoring. + +.. code:: go + + package main + + import ( + "fmt" + + "github.com/shirou/gopsutil/mem" + ) + + func main() { + v, _ := mem.VirtualMemory() + + // almost every return value is a struct + fmt.Printf("Total: %v, Free:%v, UsedPercent:%f%%\n", v.Total, v.Free, v.UsedPercent) + + // convert to JSON. String() is also implemented + fmt.Println(v) + } + +The output is below. + +:: + + Total: 3179569152, Free:284233728, UsedPercent:84.508194% + {"total":3179569152,"available":492572672,"used":2895335424,"usedPercent":84.50819439828305, (snip...)} + +You can set an alternative location to /proc by setting the HOST_PROC environment variable. +You can set an alternative location to /sys by setting the HOST_SYS environment variable. +You can set an alternative location to /etc by setting the HOST_ETC environment variable. + +Documentation +------------------------ + +see http://godoc.org/github.com/shirou/gopsutil + + +More Info +-------------------- + +Several methods have been added which are not present in psutil, but will provide useful information. + +- host/HostInfo() (linux) + + - Hostname + - Uptime + - Procs + - OS (ex: "linux") + - Platform (ex: "ubuntu", "arch") + - PlatformFamily (ex: "debian") + - PlatformVersion (ex: "Ubuntu 13.10") + - VirtualizationSystem (ex: "LXC") + - VirtualizationRole (ex: "guest"/"host") + +- cpu/CPUInfo() (linux, freebsd) + + - CPU (ex: 0, 1, ...) + - VendorID (ex: "GenuineIntel") + - Family + - Model + - Stepping + - PhysicalID + - CoreID + - Cores (ex: 2) + - ModelName (ex: "Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz") + - Mhz + - CacheSize + - Flags (ex: "fpu vme de pse tsc msr pae mce cx8 ...") + +- load/LoadAvg() (linux, freebsd) + + - Load1 + - Load5 + - Load15 + +- docker/GetDockerIDList() (linux only) + + - container id list ([]string) + +- docker/CgroupCPU() (linux only) + + - user + - system + +- docker/CgroupMem() (linux only) + + - various status + +- net_protocols (linux only) + + - system wide stats on network protocols (i.e IP, TCP, UDP, etc.) + - sourced from /proc/net/snmp + +- iptables nf_conntrack (linux only) + + - system wide stats on netfilter conntrack module + - sourced from /proc/sys/net/netfilter/nf_conntrack_count + +Some codes are ported from Ohai. many thanks. + + +Current Status +------------------ + +- x: work +- b: almost work but something broken + +================= ====== ======= ====== ======= +name Linux FreeBSD MacOSX Windows +cpu_times x x x x +cpu_count x x x x +cpu_percent x x x x +cpu_times_percent x x x x +virtual_memory x x x x +swap_memory x x x +disk_partitions x x x x +disk_io_counters x x +disk_usage x x x x +net_io_counters x x b x +boot_time x x x x +users x x x x +pids x x x x +pid_exists x x x x +net_connections x x +net_protocols x +net_if_addrs +net_if_stats +netfilter_conntrack x +================= ====== ======= ====== ======= + +Process class +^^^^^^^^^^^^^^^ + +================ ===== ======= ====== ======= +name Linux FreeBSD MacOSX Windows +pid x x x x +ppid x x x x +name x x x x +cmdline x x x +create_time x +status x x x +cwd x +exe x x x +uids x x x +gids x x x +terminal x x x +io_counters x x +nice x x x x +num_fds x +num_ctx_switches x +num_threads x x x x +cpu_times x +memory_info x x x +memory_info_ex x +memory_maps x +open_files x +send_signal x x x +suspend x x x +resume x x x +terminate x x x +kill x x x +username x +ionice +rlimit +num_handlres +threads +cpu_percent x x +cpu_affinity +memory_percent +parent x x +children x x x +connections x x +is_running +================ ===== ======= ====== ======= + +Original Metrics +^^^^^^^^^^^^^^^^^^^ +================== ===== ======= ====== ======= +item Linux FreeBSD MacOSX Windows +**HostInfo** +hostname x x x x + uptime x x x + proces x x + os x x x x + platform x x x + platformfamiliy x x x + virtualization x +**CPU** + VendorID x x x x + Family x x x x + Model x x x x + Stepping x x x x + PhysicalID x + CoreID x + Cores x x + ModelName x x x x +**LoadAvg** + Load1 x x x + Load5 x x x + Load15 x x x +**GetDockerID** + container id x no no no +**CgroupsCPU** + user x no no no + system x no no no +**CgroupsMem** + various x no no no +================== ===== ======= ====== ======= + +- future work + + - process_iter + - wait_procs + - Process class + + - as_dict + - wait + + +License +------------ + +New BSD License (same as psutil) + + +Related Works +----------------------- + +I have been influenced by the following great works: + +- psutil: http://pythonhosted.org/psutil/ +- dstat: https://github.com/dagwieers/dstat +- gosigar: https://github.com/cloudfoundry/gosigar/ +- goprocinfo: https://github.com/c9s/goprocinfo +- go-ps: https://github.com/mitchellh/go-ps +- ohai: https://github.com/opscode/ohai/ +- bosun: https://github.com/bosun-monitor/bosun/tree/master/cmd/scollector/collectors +- mackerel: https://github.com/mackerelio/mackerel-agent/tree/master/metrics + +How to Contribute +--------------------------- + +1. Fork it +2. Create your feature branch (git checkout -b my-new-feature) +3. Commit your changes (git commit -am 'Add some feature') +4. Push to the branch (git push origin my-new-feature) +5. Create new Pull Request + +My English is terrible, so documentation or correcting comments are also +welcome. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/coverall.sh b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/coverall.sh new file mode 100644 index 00000000..35aa298b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/coverall.sh @@ -0,0 +1,26 @@ +#/bin/sh + +# see http://www.songmu.jp/riji/entry/2015-01-15-goveralls-multi-package.html + +set -e +# cleanup +cleanup() { + if [ $tmpprof != "" ] && [ -f $tmpprof ]; then + rm -f $tmpprof + fi + exit +} +trap cleanup INT QUIT TERM EXIT + +# メインã®å‡¦ç† +prof=${1:-".profile.cov"} +echo "mode: count" > $prof +gopath1=$(echo $GOPATH | cut -d: -f1) +for pkg in $(go list ./...); do + tmpprof=$gopath1/src/$pkg/profile.tmp + go test -covermode=count -coverprofile=$tmpprof $pkg + if [ -f $tmpprof ]; then + cat $tmpprof | tail -n +2 >> $prof + rm $tmpprof + fi +done diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu.go new file mode 100644 index 00000000..71535094 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu.go @@ -0,0 +1,76 @@ +package cpu + +import ( + "encoding/json" + "runtime" + "strconv" + "strings" +) + +type TimesStat struct { + CPU string `json:"cpu"` + User float64 `json:"user"` + System float64 `json:"system"` + Idle float64 `json:"idle"` + Nice float64 `json:"nice"` + Iowait float64 `json:"iowait"` + Irq float64 `json:"irq"` + Softirq float64 `json:"softirq"` + Steal float64 `json:"steal"` + Guest float64 `json:"guest"` + GuestNice float64 `json:"guestNice"` + Stolen float64 `json:"stolen"` +} + +type InfoStat struct { + CPU int32 `json:"cpu"` + VendorID string `json:"vendorId"` + Family string `json:"family"` + Model string `json:"model"` + Stepping int32 `json:"stepping"` + PhysicalID string `json:"physicalId"` + CoreID string `json:"coreId"` + Cores int32 `json:"cores"` + ModelName string `json:"modelName"` + Mhz float64 `json:"mhz"` + CacheSize int32 `json:"cacheSize"` + Flags []string `json:"flags"` +} + +var lastCPUTimes []TimesStat +var lastPerCPUTimes []TimesStat + +func Counts(logical bool) (int, error) { + return runtime.NumCPU(), nil +} + +func (c TimesStat) String() string { + v := []string{ + `"cpu":"` + c.CPU + `"`, + `"user":` + strconv.FormatFloat(c.User, 'f', 1, 64), + `"system":` + strconv.FormatFloat(c.System, 'f', 1, 64), + `"idle":` + strconv.FormatFloat(c.Idle, 'f', 1, 64), + `"nice":` + strconv.FormatFloat(c.Nice, 'f', 1, 64), + `"iowait":` + strconv.FormatFloat(c.Iowait, 'f', 1, 64), + `"irq":` + strconv.FormatFloat(c.Irq, 'f', 1, 64), + `"softirq":` + strconv.FormatFloat(c.Softirq, 'f', 1, 64), + `"steal":` + strconv.FormatFloat(c.Steal, 'f', 1, 64), + `"guest":` + strconv.FormatFloat(c.Guest, 'f', 1, 64), + `"guestNice":` + strconv.FormatFloat(c.GuestNice, 'f', 1, 64), + `"stolen":` + strconv.FormatFloat(c.Stolen, 'f', 1, 64), + } + + return `{` + strings.Join(v, ",") + `}` +} + +// Total returns the total number of seconds in a CPUTimesStat +func (c TimesStat) Total() float64 { + total := c.User + c.System + c.Nice + c.Iowait + c.Irq + c.Softirq + c.Steal + + c.Guest + c.GuestNice + c.Idle + c.Stolen + return total +} + +func (c InfoStat) String() string { + s, _ := json.Marshal(c) + return string(s) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go new file mode 100644 index 00000000..fbb74a82 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go @@ -0,0 +1,106 @@ +// +build darwin + +package cpu + +import ( + "os/exec" + "strconv" + "strings" +) + +// sys/resource.h +const ( + CPUser = 0 + CPNice = 1 + CPSys = 2 + CPIntr = 3 + CPIdle = 4 + CPUStates = 5 +) + +// default value. from time.h +var ClocksPerSec = float64(128) + +func Times(percpu bool) ([]TimesStat, error) { + if percpu { + return perCPUTimes() + } + + return allCPUTimes() +} + +// Returns only one CPUInfoStat on FreeBSD +func Info() ([]InfoStat, error) { + var ret []InfoStat + sysctl, err := exec.LookPath("/usr/sbin/sysctl") + if err != nil { + return ret, err + } + out, err := exec.Command(sysctl, "machdep.cpu").Output() + if err != nil { + return ret, err + } + + c := InfoStat{} + for _, line := range strings.Split(string(out), "\n") { + values := strings.Fields(line) + if len(values) < 1 { + continue + } + + t, err := strconv.ParseInt(values[1], 10, 64) + // err is not checked here because some value is string. + if strings.HasPrefix(line, "machdep.cpu.brand_string") { + c.ModelName = strings.Join(values[1:], " ") + } else if strings.HasPrefix(line, "machdep.cpu.family") { + c.Family = values[1] + } else if strings.HasPrefix(line, "machdep.cpu.model") { + c.Model = values[1] + } else if strings.HasPrefix(line, "machdep.cpu.stepping") { + if err != nil { + return ret, err + } + c.Stepping = int32(t) + } else if strings.HasPrefix(line, "machdep.cpu.features") { + for _, v := range values[1:] { + c.Flags = append(c.Flags, strings.ToLower(v)) + } + } else if strings.HasPrefix(line, "machdep.cpu.leaf7_features") { + for _, v := range values[1:] { + c.Flags = append(c.Flags, strings.ToLower(v)) + } + } else if strings.HasPrefix(line, "machdep.cpu.extfeatures") { + for _, v := range values[1:] { + c.Flags = append(c.Flags, strings.ToLower(v)) + } + } else if strings.HasPrefix(line, "machdep.cpu.core_count") { + if err != nil { + return ret, err + } + c.Cores = int32(t) + } else if strings.HasPrefix(line, "machdep.cpu.cache.size") { + if err != nil { + return ret, err + } + c.CacheSize = int32(t) + } else if strings.HasPrefix(line, "machdep.cpu.vendor") { + c.VendorID = values[1] + } + } + + // Use the rated frequency of the CPU. This is a static value and does not + // account for low power or Turbo Boost modes. + out, err = exec.Command(sysctl, "hw.cpufrequency").Output() + if err != nil { + return ret, err + } + + values := strings.Fields(string(out)) + mhz, err := strconv.ParseFloat(values[1], 64) + if err != nil { + return ret, err + } + c.Mhz = mhz / 1000000.0 + + return append(ret, c), nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go new file mode 100644 index 00000000..ee59fefc --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go @@ -0,0 +1,107 @@ +// +build darwin +// +build cgo + +package cpu + +/* +#include +#include +#include +#include +#include +#include +#include +#include +#include +*/ +import "C" + +import ( + "bytes" + "encoding/binary" + "fmt" + "unsafe" +) + +// these CPU times for darwin is borrowed from influxdb/telegraf. + +func perCPUTimes() ([]TimesStat, error) { + var ( + count C.mach_msg_type_number_t + cpuload *C.processor_cpu_load_info_data_t + ncpu C.natural_t + ) + + status := C.host_processor_info(C.host_t(C.mach_host_self()), + C.PROCESSOR_CPU_LOAD_INFO, + &ncpu, + (*C.processor_info_array_t)(unsafe.Pointer(&cpuload)), + &count) + + if status != C.KERN_SUCCESS { + return nil, fmt.Errorf("host_processor_info error=%d", status) + } + + // jump through some cgo casting hoops and ensure we properly free + // the memory that cpuload points to + target := C.vm_map_t(C.mach_task_self_) + address := C.vm_address_t(uintptr(unsafe.Pointer(cpuload))) + defer C.vm_deallocate(target, address, C.vm_size_t(ncpu)) + + // the body of struct processor_cpu_load_info + // aka processor_cpu_load_info_data_t + var cpu_ticks [C.CPU_STATE_MAX]uint32 + + // copy the cpuload array to a []byte buffer + // where we can binary.Read the data + size := int(ncpu) * binary.Size(cpu_ticks) + buf := C.GoBytes(unsafe.Pointer(cpuload), C.int(size)) + + bbuf := bytes.NewBuffer(buf) + + var ret []TimesStat + + for i := 0; i < int(ncpu); i++ { + err := binary.Read(bbuf, binary.LittleEndian, &cpu_ticks) + if err != nil { + return nil, err + } + + c := TimesStat{ + CPU: fmt.Sprintf("cpu%d", i), + User: float64(cpu_ticks[C.CPU_STATE_USER]) / ClocksPerSec, + System: float64(cpu_ticks[C.CPU_STATE_SYSTEM]) / ClocksPerSec, + Nice: float64(cpu_ticks[C.CPU_STATE_NICE]) / ClocksPerSec, + Idle: float64(cpu_ticks[C.CPU_STATE_IDLE]) / ClocksPerSec, + } + + ret = append(ret, c) + } + + return ret, nil +} + +func allCPUTimes() ([]TimesStat, error) { + var count C.mach_msg_type_number_t = C.HOST_CPU_LOAD_INFO_COUNT + var cpuload C.host_cpu_load_info_data_t + + status := C.host_statistics(C.host_t(C.mach_host_self()), + C.HOST_CPU_LOAD_INFO, + C.host_info_t(unsafe.Pointer(&cpuload)), + &count) + + if status != C.KERN_SUCCESS { + return nil, fmt.Errorf("host_statistics error=%d", status) + } + + c := TimesStat{ + CPU: "cpu-total", + User: float64(cpuload.cpu_ticks[C.CPU_STATE_USER]) / ClocksPerSec, + System: float64(cpuload.cpu_ticks[C.CPU_STATE_SYSTEM]) / ClocksPerSec, + Nice: float64(cpuload.cpu_ticks[C.CPU_STATE_NICE]) / ClocksPerSec, + Idle: float64(cpuload.cpu_ticks[C.CPU_STATE_IDLE]) / ClocksPerSec, + } + + return []TimesStat{c}, nil + +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go new file mode 100644 index 00000000..242b4a8e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go @@ -0,0 +1,14 @@ +// +build darwin +// +build !cgo + +package cpu + +import "github.com/shirou/gopsutil/internal/common" + +func perCPUTimes() ([]TimesStat, error) { + return []TimesStat{}, common.ErrNotImplementedError +} + +func allCPUTimes() ([]TimesStat, error) { + return []TimesStat{}, common.ErrNotImplementedError +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go new file mode 100644 index 00000000..ce1adf3c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go @@ -0,0 +1,147 @@ +// +build freebsd + +package cpu + +import ( + "fmt" + "os/exec" + "regexp" + "strconv" + "strings" + + "github.com/shirou/gopsutil/internal/common" +) + +// sys/resource.h +const ( + CPUser = 0 + CPNice = 1 + CPSys = 2 + CPIntr = 3 + CPIdle = 4 + CPUStates = 5 +) + +var ClocksPerSec = float64(128) + +func init() { + getconf, err := exec.LookPath("/usr/bin/getconf") + if err != nil { + return + } + out, err := exec.Command(getconf, "CLK_TCK").Output() + // ignore errors + if err == nil { + i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) + if err == nil { + ClocksPerSec = float64(i) + } + } +} + +func Times(percpu bool) ([]TimesStat, error) { + var ret []TimesStat + + var sysctlCall string + var ncpu int + if percpu { + sysctlCall = "kern.cp_times" + ncpu, _ = Counts(true) + } else { + sysctlCall = "kern.cp_time" + ncpu = 1 + } + + cpuTimes, err := common.DoSysctrl(sysctlCall) + if err != nil { + return ret, err + } + + for i := 0; i < ncpu; i++ { + offset := CPUStates * i + user, err := strconv.ParseFloat(cpuTimes[CPUser+offset], 64) + if err != nil { + return ret, err + } + nice, err := strconv.ParseFloat(cpuTimes[CPNice+offset], 64) + if err != nil { + return ret, err + } + sys, err := strconv.ParseFloat(cpuTimes[CPSys+offset], 64) + if err != nil { + return ret, err + } + idle, err := strconv.ParseFloat(cpuTimes[CPIdle+offset], 64) + if err != nil { + return ret, err + } + intr, err := strconv.ParseFloat(cpuTimes[CPIntr+offset], 64) + if err != nil { + return ret, err + } + + c := TimesStat{ + User: float64(user / ClocksPerSec), + Nice: float64(nice / ClocksPerSec), + System: float64(sys / ClocksPerSec), + Idle: float64(idle / ClocksPerSec), + Irq: float64(intr / ClocksPerSec), + } + if !percpu { + c.CPU = "cpu-total" + } else { + c.CPU = fmt.Sprintf("cpu%d", i) + } + + ret = append(ret, c) + } + + return ret, nil +} + +// Returns only one CPUInfoStat on FreeBSD +func Info() ([]InfoStat, error) { + filename := "/var/run/dmesg.boot" + lines, _ := common.ReadLines(filename) + + var ret []InfoStat + + c := InfoStat{} + for _, line := range lines { + if matches := regexp.MustCompile(`CPU:\s+(.+) \(([\d.]+).+\)`).FindStringSubmatch(line); matches != nil { + c.ModelName = matches[1] + t, err := strconv.ParseFloat(matches[2], 64) + if err != nil { + return ret, nil + } + c.Mhz = t + } else if matches := regexp.MustCompile(`Origin = "(.+)" Id = (.+) Family = (.+) Model = (.+) Stepping = (.+)`).FindStringSubmatch(line); matches != nil { + c.VendorID = matches[1] + c.Family = matches[3] + c.Model = matches[4] + t, err := strconv.ParseInt(matches[5], 10, 32) + if err != nil { + return ret, nil + } + c.Stepping = int32(t) + } else if matches := regexp.MustCompile(`Features=.+<(.+)>`).FindStringSubmatch(line); matches != nil { + for _, v := range strings.Split(matches[1], ",") { + c.Flags = append(c.Flags, strings.ToLower(v)) + } + } else if matches := regexp.MustCompile(`Features2=[a-f\dx]+<(.+)>`).FindStringSubmatch(line); matches != nil { + for _, v := range strings.Split(matches[1], ",") { + c.Flags = append(c.Flags, strings.ToLower(v)) + } + } else if matches := regexp.MustCompile(`Logical CPUs per core: (\d+)`).FindStringSubmatch(line); matches != nil { + // FIXME: no this line? + t, err := strconv.ParseInt(matches[1], 10, 32) + if err != nil { + return ret, nil + } + c.Cores = int32(t) + } + + } + + return append(ret, c), nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go new file mode 100644 index 00000000..f7cf4c36 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go @@ -0,0 +1,244 @@ +// +build linux + +package cpu + +import ( + "errors" + "fmt" + "os/exec" + "strconv" + "strings" + + "github.com/shirou/gopsutil/internal/common" +) + +var cpu_tick = float64(100) + +func init() { + getconf, err := exec.LookPath("/usr/bin/getconf") + if err != nil { + return + } + out, err := exec.Command(getconf, "CLK_TCK").Output() + // ignore errors + if err == nil { + i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) + if err == nil { + cpu_tick = float64(i) + } + } +} + +func Times(percpu bool) ([]TimesStat, error) { + filename := common.HostProc("stat") + var lines = []string{} + if percpu { + var startIdx uint = 1 + for { + linen, _ := common.ReadLinesOffsetN(filename, startIdx, 1) + line := linen[0] + if !strings.HasPrefix(line, "cpu") { + break + } + lines = append(lines, line) + startIdx++ + } + } else { + lines, _ = common.ReadLinesOffsetN(filename, 0, 1) + } + + ret := make([]TimesStat, 0, len(lines)) + + for _, line := range lines { + ct, err := parseStatLine(line) + if err != nil { + continue + } + ret = append(ret, *ct) + + } + return ret, nil +} + +func sysCPUPath(cpu int32, relPath string) string { + return common.HostSys(fmt.Sprintf("devices/system/cpu/cpu%d", cpu), relPath) +} + +func finishCPUInfo(c *InfoStat) error { + if c.Mhz == 0 { + lines, err := common.ReadLines(sysCPUPath(c.CPU, "cpufreq/cpuinfo_max_freq")) + if err == nil { + value, err := strconv.ParseFloat(lines[0], 64) + if err != nil { + return err + } + c.Mhz = value + } + } + if len(c.CoreID) == 0 { + lines, err := common.ReadLines(sysCPUPath(c.CPU, "topology/coreId")) + if err == nil { + c.CoreID = lines[0] + } + } + return nil +} + +// CPUInfo on linux will return 1 item per physical thread. +// +// CPUs have three levels of counting: sockets, cores, threads. +// Cores with HyperThreading count as having 2 threads per core. +// Sockets often come with many physical CPU cores. +// For example a single socket board with two cores each with HT will +// return 4 CPUInfoStat structs on Linux and the "Cores" field set to 1. +func Info() ([]InfoStat, error) { + filename := common.HostProc("cpuinfo") + lines, _ := common.ReadLines(filename) + + var ret []InfoStat + + c := InfoStat{CPU: -1, Cores: 1} + for _, line := range lines { + fields := strings.Split(line, ":") + if len(fields) < 2 { + continue + } + key := strings.TrimSpace(fields[0]) + value := strings.TrimSpace(fields[1]) + + switch key { + case "processor": + if c.CPU >= 0 { + err := finishCPUInfo(&c) + if err != nil { + return ret, err + } + ret = append(ret, c) + } + c = InfoStat{Cores: 1} + t, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return ret, err + } + c.CPU = int32(t) + case "vendorId": + c.VendorID = value + case "cpu family": + c.Family = value + case "model": + c.Model = value + case "model name": + c.ModelName = value + case "stepping": + t, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return ret, err + } + c.Stepping = int32(t) + case "cpu MHz": + t, err := strconv.ParseFloat(value, 64) + if err != nil { + return ret, err + } + c.Mhz = t + case "cache size": + t, err := strconv.ParseInt(strings.Replace(value, " KB", "", 1), 10, 64) + if err != nil { + return ret, err + } + c.CacheSize = int32(t) + case "physical id": + c.PhysicalID = value + case "core id": + c.CoreID = value + case "flags", "Features": + c.Flags = strings.FieldsFunc(value, func(r rune) bool { + return r == ',' || r == ' ' + }) + } + } + if c.CPU >= 0 { + err := finishCPUInfo(&c) + if err != nil { + return ret, err + } + ret = append(ret, c) + } + return ret, nil +} + +func parseStatLine(line string) (*TimesStat, error) { + fields := strings.Fields(line) + + if strings.HasPrefix(fields[0], "cpu") == false { + // return CPUTimesStat{}, e + return nil, errors.New("not contain cpu") + } + + cpu := fields[0] + if cpu == "cpu" { + cpu = "cpu-total" + } + user, err := strconv.ParseFloat(fields[1], 64) + if err != nil { + return nil, err + } + nice, err := strconv.ParseFloat(fields[2], 64) + if err != nil { + return nil, err + } + system, err := strconv.ParseFloat(fields[3], 64) + if err != nil { + return nil, err + } + idle, err := strconv.ParseFloat(fields[4], 64) + if err != nil { + return nil, err + } + iowait, err := strconv.ParseFloat(fields[5], 64) + if err != nil { + return nil, err + } + irq, err := strconv.ParseFloat(fields[6], 64) + if err != nil { + return nil, err + } + softirq, err := strconv.ParseFloat(fields[7], 64) + if err != nil { + return nil, err + } + + ct := &TimesStat{ + CPU: cpu, + User: float64(user) / cpu_tick, + Nice: float64(nice) / cpu_tick, + System: float64(system) / cpu_tick, + Idle: float64(idle) / cpu_tick, + Iowait: float64(iowait) / cpu_tick, + Irq: float64(irq) / cpu_tick, + Softirq: float64(softirq) / cpu_tick, + } + if len(fields) > 8 { // Linux >= 2.6.11 + steal, err := strconv.ParseFloat(fields[8], 64) + if err != nil { + return nil, err + } + ct.Steal = float64(steal) / cpu_tick + } + if len(fields) > 9 { // Linux >= 2.6.24 + guest, err := strconv.ParseFloat(fields[9], 64) + if err != nil { + return nil, err + } + ct.Guest = float64(guest) / cpu_tick + } + if len(fields) > 10 { // Linux >= 3.2.0 + guestNice, err := strconv.ParseFloat(fields[10], 64) + if err != nil { + return nil, err + } + ct.GuestNice = float64(guestNice) / cpu_tick + } + + return ct, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_unix.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_unix.go new file mode 100644 index 00000000..9f1ea4d7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_unix.go @@ -0,0 +1,59 @@ +// +build linux freebsd darwin + +package cpu + +import ( + "fmt" + "time" +) + +func Percent(interval time.Duration, percpu bool) ([]float64, error) { + getAllBusy := func(t TimesStat) (float64, float64) { + busy := t.User + t.System + t.Nice + t.Iowait + t.Irq + + t.Softirq + t.Steal + t.Guest + t.GuestNice + t.Stolen + return busy + t.Idle, busy + } + + calculate := func(t1, t2 TimesStat) float64 { + t1All, t1Busy := getAllBusy(t1) + t2All, t2Busy := getAllBusy(t2) + + if t2Busy <= t1Busy { + return 0 + } + if t2All <= t1All { + return 1 + } + return (t2Busy - t1Busy) / (t2All - t1All) * 100 + } + + // Get CPU usage at the start of the interval. + cpuTimes1, err := Times(percpu) + if err != nil { + return nil, err + } + + if interval > 0 { + time.Sleep(interval) + } + + // And at the end of the interval. + cpuTimes2, err := Times(percpu) + if err != nil { + return nil, err + } + + // Make sure the CPU measurements have the same length. + if len(cpuTimes1) != len(cpuTimes2) { + return nil, fmt.Errorf( + "received two CPU counts: %d != %d", + len(cpuTimes1), len(cpuTimes2), + ) + } + + ret := make([]float64, len(cpuTimes1)) + for i, t := range cpuTimes2 { + ret[i] = calculate(cpuTimes1[i], t) + } + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_windows.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_windows.go new file mode 100644 index 00000000..fbd25e60 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/cpu/cpu_windows.go @@ -0,0 +1,105 @@ +// +build windows + +package cpu + +import ( + "fmt" + "syscall" + "time" + "unsafe" + + "github.com/StackExchange/wmi" + + "github.com/shirou/gopsutil/internal/common" +) + +type Win32_Processor struct { + LoadPercentage *uint16 + Family uint16 + Manufacturer string + Name string + NumberOfLogicalProcessors uint32 + ProcessorID *string + Stepping *string + MaxClockSpeed uint32 +} + +// TODO: Get percpu +func Times(percpu bool) ([]TimesStat, error) { + var ret []TimesStat + + var lpIdleTime common.FILETIME + var lpKernelTime common.FILETIME + var lpUserTime common.FILETIME + r, _, _ := common.ProcGetSystemTimes.Call( + uintptr(unsafe.Pointer(&lpIdleTime)), + uintptr(unsafe.Pointer(&lpKernelTime)), + uintptr(unsafe.Pointer(&lpUserTime))) + if r == 0 { + return ret, syscall.GetLastError() + } + + LOT := float64(0.0000001) + HIT := (LOT * 4294967296.0) + idle := ((HIT * float64(lpIdleTime.DwHighDateTime)) + (LOT * float64(lpIdleTime.DwLowDateTime))) + user := ((HIT * float64(lpUserTime.DwHighDateTime)) + (LOT * float64(lpUserTime.DwLowDateTime))) + kernel := ((HIT * float64(lpKernelTime.DwHighDateTime)) + (LOT * float64(lpKernelTime.DwLowDateTime))) + system := (kernel - idle) + + ret = append(ret, TimesStat{ + Idle: float64(idle), + User: float64(user), + System: float64(system), + }) + return ret, nil +} + +func Info() ([]InfoStat, error) { + var ret []InfoStat + var dst []Win32_Processor + q := wmi.CreateQuery(&dst, "") + err := wmi.Query(q, &dst) + if err != nil { + return ret, err + } + + var procID string + for i, l := range dst { + procID = "" + if l.ProcessorID != nil { + procID = *l.ProcessorID + } + + cpu := InfoStat{ + CPU: int32(i), + Family: fmt.Sprintf("%d", l.Family), + VendorID: l.Manufacturer, + ModelName: l.Name, + Cores: int32(l.NumberOfLogicalProcessors), + PhysicalID: procID, + Mhz: float64(l.MaxClockSpeed), + Flags: []string{}, + } + ret = append(ret, cpu) + } + + return ret, nil +} + +func Percent(interval time.Duration, percpu bool) ([]float64, error) { + var ret []float64 + var dst []Win32_Processor + q := wmi.CreateQuery(&dst, "") + err := wmi.Query(q, &dst) + if err != nil { + return ret, err + } + for _, l := range dst { + // use range but windows can only get one percent. + if l.LoadPercentage == nil { + continue + } + ret = append(ret, float64(*l.LoadPercentage)) + } + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk.go new file mode 100644 index 00000000..b187a1db --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk.go @@ -0,0 +1,52 @@ +package disk + +import ( + "encoding/json" +) + +type UsageStat struct { + Path string `json:"path"` + Fstype string `json:"fstype"` + Total uint64 `json:"total"` + Free uint64 `json:"free"` + Used uint64 `json:"used"` + UsedPercent float64 `json:"usedPercent"` + InodesTotal uint64 `json:"inodesTotal"` + InodesUsed uint64 `json:"inodesUsed"` + InodesFree uint64 `json:"inodesFree"` + InodesUsedPercent float64 `json:"inodesUsedPercent"` +} + +type PartitionStat struct { + Device string `json:"device"` + Mountpoint string `json:"mountpoint"` + Fstype string `json:"fstype"` + Opts string `json:"opts"` +} + +type IOCountersStat struct { + ReadCount uint64 `json:"readCount"` + WriteCount uint64 `json:"writeCount"` + ReadBytes uint64 `json:"readBytes"` + WriteBytes uint64 `json:"writeBytes"` + ReadTime uint64 `json:"readTime"` + WriteTime uint64 `json:"writeTime"` + Name string `json:"name"` + IoTime uint64 `json:"ioTime"` + SerialNumber string `json:"serialNumber"` +} + +func (d UsageStat) String() string { + s, _ := json.Marshal(d) + return string(s) +} + +func (d PartitionStat) String() string { + s, _ := json.Marshal(d) + return string(s) +} + +func (d IOCountersStat) String() string { + s, _ := json.Marshal(d) + return string(s) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_darwin.go new file mode 100644 index 00000000..83a733b6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_darwin.go @@ -0,0 +1,104 @@ +// +build darwin + +package disk + +import ( + "syscall" + "unsafe" + + "github.com/shirou/gopsutil/internal/common" +) + +func Partitions(all bool) ([]PartitionStat, error) { + var ret []PartitionStat + + count, err := Getfsstat(nil, MntWait) + if err != nil { + return ret, err + } + fs := make([]Statfs_t, count) + _, err = Getfsstat(fs, MntWait) + for _, stat := range fs { + opts := "rw" + if stat.Flags&MntReadOnly != 0 { + opts = "ro" + } + if stat.Flags&MntSynchronous != 0 { + opts += ",sync" + } + if stat.Flags&MntNoExec != 0 { + opts += ",noexec" + } + if stat.Flags&MntNoSuid != 0 { + opts += ",nosuid" + } + if stat.Flags&MntUnion != 0 { + opts += ",union" + } + if stat.Flags&MntAsync != 0 { + opts += ",async" + } + if stat.Flags&MntSuidDir != 0 { + opts += ",suiddir" + } + if stat.Flags&MntSoftDep != 0 { + opts += ",softdep" + } + if stat.Flags&MntNoSymFollow != 0 { + opts += ",nosymfollow" + } + if stat.Flags&MntGEOMJournal != 0 { + opts += ",gjounalc" + } + if stat.Flags&MntMultilabel != 0 { + opts += ",multilabel" + } + if stat.Flags&MntACLs != 0 { + opts += ",acls" + } + if stat.Flags&MntNoATime != 0 { + opts += ",noattime" + } + if stat.Flags&MntClusterRead != 0 { + opts += ",nocluster" + } + if stat.Flags&MntClusterWrite != 0 { + opts += ",noclusterw" + } + if stat.Flags&MntNFS4ACLs != 0 { + opts += ",nfs4acls" + } + d := PartitionStat{ + Device: common.IntToString(stat.Mntfromname[:]), + Mountpoint: common.IntToString(stat.Mntonname[:]), + Fstype: common.IntToString(stat.Fstypename[:]), + Opts: opts, + } + ret = append(ret, d) + } + + return ret, nil +} + +func IOCounters() (map[string]IOCountersStat, error) { + return nil, common.ErrNotImplementedError +} + +func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + var _p0 unsafe.Pointer + var bufsize uintptr + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) + } + r0, _, e1 := syscall.Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = e1 + } + return +} + +func getFsType(stat syscall.Statfs_t) string { + return common.IntToString(stat.Fstypename[:]) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_darwin_amd64.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_darwin_amd64.go new file mode 100644 index 00000000..f58e2131 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_darwin_amd64.go @@ -0,0 +1,58 @@ +// +build darwin +// +build amd64 + +package disk + +const ( + MntWait = 1 + MfsNameLen = 15 /* length of fs type name, not inc. nul */ + MNameLen = 90 /* length of buffer for returned name */ + + MFSTYPENAMELEN = 16 /* length of fs type name including null */ + MAXPATHLEN = 1024 + MNAMELEN = MAXPATHLEN + + SYS_GETFSSTAT64 = 347 +) + +type Fsid struct{ val [2]int32 } /* file system id type */ +type uid_t int32 + +// sys/mount.h +const ( + MntReadOnly = 0x00000001 /* read only filesystem */ + MntSynchronous = 0x00000002 /* filesystem written synchronously */ + MntNoExec = 0x00000004 /* can't exec from filesystem */ + MntNoSuid = 0x00000008 /* don't honor setuid bits on fs */ + MntUnion = 0x00000020 /* union with underlying filesystem */ + MntAsync = 0x00000040 /* filesystem written asynchronously */ + MntSuidDir = 0x00100000 /* special handling of SUID on dirs */ + MntSoftDep = 0x00200000 /* soft updates being done */ + MntNoSymFollow = 0x00400000 /* do not follow symlinks */ + MntGEOMJournal = 0x02000000 /* GEOM journal support enabled */ + MntMultilabel = 0x04000000 /* MAC support for individual objects */ + MntACLs = 0x08000000 /* ACL support enabled */ + MntNoATime = 0x10000000 /* disable update of file access time */ + MntClusterRead = 0x40000000 /* disable cluster read */ + MntClusterWrite = 0x80000000 /* disable cluster write */ + MntNFS4ACLs = 0x00000010 +) + +type Statfs_t struct { + Bsize uint32 + Iosize int32 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Files uint64 + Ffree uint64 + Fsid Fsid + Owner uint32 + Type uint32 + Flags uint32 + Fssubtype uint32 + Fstypename [16]int8 + Mntonname [1024]int8 + Mntfromname [1024]int8 + Reserved [8]uint32 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_freebsd.go new file mode 100644 index 00000000..4ec2d6ea --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_freebsd.go @@ -0,0 +1,168 @@ +// +build freebsd + +package disk + +import ( + "bytes" + "encoding/binary" + "strconv" + "syscall" + "unsafe" + + "github.com/shirou/gopsutil/internal/common" +) + +func Partitions(all bool) ([]PartitionStat, error) { + var ret []PartitionStat + + // get length + count, err := syscall.Getfsstat(nil, MNT_WAIT) + if err != nil { + return ret, err + } + + fs := make([]Statfs, count) + _, err = Getfsstat(fs, MNT_WAIT) + + for _, stat := range fs { + opts := "rw" + if stat.Flags&MNT_RDONLY != 0 { + opts = "ro" + } + if stat.Flags&MNT_SYNCHRONOUS != 0 { + opts += ",sync" + } + if stat.Flags&MNT_NOEXEC != 0 { + opts += ",noexec" + } + if stat.Flags&MNT_NOSUID != 0 { + opts += ",nosuid" + } + if stat.Flags&MNT_UNION != 0 { + opts += ",union" + } + if stat.Flags&MNT_ASYNC != 0 { + opts += ",async" + } + if stat.Flags&MNT_SUIDDIR != 0 { + opts += ",suiddir" + } + if stat.Flags&MNT_SOFTDEP != 0 { + opts += ",softdep" + } + if stat.Flags&MNT_NOSYMFOLLOW != 0 { + opts += ",nosymfollow" + } + if stat.Flags&MNT_GJOURNAL != 0 { + opts += ",gjounalc" + } + if stat.Flags&MNT_MULTILABEL != 0 { + opts += ",multilabel" + } + if stat.Flags&MNT_ACLS != 0 { + opts += ",acls" + } + if stat.Flags&MNT_NOATIME != 0 { + opts += ",noattime" + } + if stat.Flags&MNT_NOCLUSTERR != 0 { + opts += ",nocluster" + } + if stat.Flags&MNT_NOCLUSTERW != 0 { + opts += ",noclusterw" + } + if stat.Flags&MNT_NFS4ACLS != 0 { + opts += ",nfs4acls" + } + + d := PartitionStat{ + Device: common.IntToString(stat.Mntfromname[:]), + Mountpoint: common.IntToString(stat.Mntonname[:]), + Fstype: common.IntToString(stat.Fstypename[:]), + Opts: opts, + } + ret = append(ret, d) + } + + return ret, nil +} + +func IOCounters() (map[string]IOCountersStat, error) { + // statinfo->devinfo->devstat + // /usr/include/devinfo.h + ret := make(map[string]IOCountersStat) + + r, err := syscall.Sysctl("kern.devstat.all") + if err != nil { + return nil, err + } + buf := []byte(r) + length := len(buf) + + count := int(uint64(length) / uint64(sizeOfDevstat)) + + buf = buf[8:] // devstat.all has version in the head. + // parse buf to Devstat + for i := 0; i < count; i++ { + b := buf[i*sizeOfDevstat : i*sizeOfDevstat+sizeOfDevstat] + d, err := parseDevstat(b) + if err != nil { + continue + } + un := strconv.Itoa(int(d.Unit_number)) + name := common.IntToString(d.Device_name[:]) + un + + ds := IOCountersStat{ + ReadCount: d.Operations[DEVSTAT_READ], + WriteCount: d.Operations[DEVSTAT_WRITE], + ReadBytes: d.Bytes[DEVSTAT_READ], + WriteBytes: d.Bytes[DEVSTAT_WRITE], + ReadTime: d.Duration[DEVSTAT_READ].Compute(), + WriteTime: d.Duration[DEVSTAT_WRITE].Compute(), + Name: name, + } + ret[name] = ds + } + + return ret, nil +} + +func (b Bintime) Compute() uint64 { + BINTIME_SCALE := 5.42101086242752217003726400434970855712890625e-20 + return uint64(b.Sec) + b.Frac*uint64(BINTIME_SCALE) +} + +// BT2LD(time) ((long double)(time).sec + (time).frac * BINTIME_SCALE) + +// Getfsstat is borrowed from pkg/syscall/syscall_freebsd.go +// change Statfs_t to Statfs in order to get more information +func Getfsstat(buf []Statfs, flags int) (n int, err error) { + var _p0 unsafe.Pointer + var bufsize uintptr + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + bufsize = unsafe.Sizeof(Statfs{}) * uintptr(len(buf)) + } + r0, _, e1 := syscall.Syscall(syscall.SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = e1 + } + return +} + +func parseDevstat(buf []byte) (Devstat, error) { + var ds Devstat + br := bytes.NewReader(buf) + // err := binary.Read(br, binary.LittleEndian, &ds) + err := common.Read(br, binary.LittleEndian, &ds) + if err != nil { + return ds, err + } + + return ds, nil +} + +func getFsType(stat syscall.Statfs_t) string { + return common.IntToString(stat.Fstypename[:]) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_freebsd_386.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_freebsd_386.go new file mode 100644 index 00000000..6d4b5971 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_freebsd_386.go @@ -0,0 +1,108 @@ +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs types_freebsd.go + +package disk + +const ( + sizeofPtr = 0x4 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x4 + sizeofLongLong = 0x8 + sizeofLongDouble = 0x8 + + DEVSTAT_NO_DATA = 0x00 + DEVSTAT_READ = 0x01 + DEVSTAT_WRITE = 0x02 + DEVSTAT_FREE = 0x03 + + MNT_RDONLY = 0x00000001 + MNT_SYNCHRONOUS = 0x00000002 + MNT_NOEXEC = 0x00000004 + MNT_NOSUID = 0x00000008 + MNT_UNION = 0x00000020 + MNT_ASYNC = 0x00000040 + MNT_SUIDDIR = 0x00100000 + MNT_SOFTDEP = 0x00200000 + MNT_NOSYMFOLLOW = 0x00400000 + MNT_GJOURNAL = 0x02000000 + MNT_MULTILABEL = 0x04000000 + MNT_ACLS = 0x08000000 + MNT_NOATIME = 0x10000000 + MNT_NOCLUSTERR = 0x40000000 + MNT_NOCLUSTERW = 0x80000000 + MNT_NFS4ACLS = 0x00000010 + + MNT_WAIT = 1 + MNT_NOWAIT = 2 + MNT_LAZY = 3 + MNT_SUSPEND = 4 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int32 + _C_long_long int64 + _C_long_double int64 +) + +type Statfs struct { + Version uint32 + Type uint32 + Flags uint64 + Bsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail int64 + Files uint64 + Ffree int64 + Syncwrites uint64 + Asyncwrites uint64 + Syncreads uint64 + Asyncreads uint64 + Spare [10]uint64 + Namemax uint32 + Owner uint32 + Fsid Fsid + Charspare [80]int8 + Fstypename [16]int8 + Mntfromname [88]int8 + Mntonname [88]int8 +} +type Fsid struct { + Val [2]int32 +} + +type Devstat struct { + Sequence0 uint32 + Allocated int32 + Start_count uint32 + End_count uint32 + Busy_from Bintime + Dev_links _Ctype_struct___0 + Device_number uint32 + Device_name [16]int8 + Unit_number int32 + Bytes [4]uint64 + Operations [4]uint64 + Duration [4]Bintime + Busy_time Bintime + Creation_time Bintime + Block_size uint32 + Tag_types [3]uint64 + Flags uint32 + Device_type uint32 + Priority uint32 + ID *byte + Sequence1 uint32 +} +type Bintime struct { + Sec int32 + Frac uint64 +} + +type _Ctype_struct___0 struct { + Empty uint32 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_freebsd_amd64.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_freebsd_amd64.go new file mode 100644 index 00000000..89b617c9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_freebsd_amd64.go @@ -0,0 +1,115 @@ +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs types_freebsd.go + +package disk + +const ( + sizeofPtr = 0x8 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x8 + sizeofLongLong = 0x8 + sizeofLongDouble = 0x8 + + DEVSTAT_NO_DATA = 0x00 + DEVSTAT_READ = 0x01 + DEVSTAT_WRITE = 0x02 + DEVSTAT_FREE = 0x03 + + MNT_RDONLY = 0x00000001 + MNT_SYNCHRONOUS = 0x00000002 + MNT_NOEXEC = 0x00000004 + MNT_NOSUID = 0x00000008 + MNT_UNION = 0x00000020 + MNT_ASYNC = 0x00000040 + MNT_SUIDDIR = 0x00100000 + MNT_SOFTDEP = 0x00200000 + MNT_NOSYMFOLLOW = 0x00400000 + MNT_GJOURNAL = 0x02000000 + MNT_MULTILABEL = 0x04000000 + MNT_ACLS = 0x08000000 + MNT_NOATIME = 0x10000000 + MNT_NOCLUSTERR = 0x40000000 + MNT_NOCLUSTERW = 0x80000000 + MNT_NFS4ACLS = 0x00000010 + + MNT_WAIT = 1 + MNT_NOWAIT = 2 + MNT_LAZY = 3 + MNT_SUSPEND = 4 +) + +const ( + sizeOfDevstat = 0x120 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 + _C_long_double int64 +) + +type Statfs struct { + Version uint32 + Type uint32 + Flags uint64 + Bsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail int64 + Files uint64 + Ffree int64 + Syncwrites uint64 + Asyncwrites uint64 + Syncreads uint64 + Asyncreads uint64 + Spare [10]uint64 + Namemax uint32 + Owner uint32 + Fsid Fsid + Charspare [80]int8 + Fstypename [16]int8 + Mntfromname [88]int8 + Mntonname [88]int8 +} +type Fsid struct { + Val [2]int32 +} + +type Devstat struct { + Sequence0 uint32 + Allocated int32 + Start_count uint32 + End_count uint32 + Busy_from Bintime + Dev_links _Ctype_struct___0 + Device_number uint32 + Device_name [16]int8 + Unit_number int32 + Bytes [4]uint64 + Operations [4]uint64 + Duration [4]Bintime + Busy_time Bintime + Creation_time Bintime + Block_size uint32 + Pad_cgo_0 [4]byte + Tag_types [3]uint64 + Flags uint32 + Device_type uint32 + Priority uint32 + Pad_cgo_1 [4]byte + ID *byte + Sequence1 uint32 + Pad_cgo_2 [4]byte +} +type Bintime struct { + Sec int64 + Frac uint64 +} + +type _Ctype_struct___0 struct { + Empty uint64 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_linux.go new file mode 100644 index 00000000..91e25a10 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_linux.go @@ -0,0 +1,331 @@ +// +build linux + +package disk + +import ( + "fmt" + "os/exec" + "strconv" + "strings" + "syscall" + + "github.com/shirou/gopsutil/internal/common" +) + +const ( + SectorSize = 512 +) +const ( + // man statfs + ADFS_SUPER_MAGIC = 0xadf5 + AFFS_SUPER_MAGIC = 0xADFF + BDEVFS_MAGIC = 0x62646576 + BEFS_SUPER_MAGIC = 0x42465331 + BFS_MAGIC = 0x1BADFACE + BINFMTFS_MAGIC = 0x42494e4d + BTRFS_SUPER_MAGIC = 0x9123683E + CGROUP_SUPER_MAGIC = 0x27e0eb + CIFS_MAGIC_NUMBER = 0xFF534D42 + CODA_SUPER_MAGIC = 0x73757245 + COH_SUPER_MAGIC = 0x012FF7B7 + CRAMFS_MAGIC = 0x28cd3d45 + DEBUGFS_MAGIC = 0x64626720 + DEVFS_SUPER_MAGIC = 0x1373 + DEVPTS_SUPER_MAGIC = 0x1cd1 + EFIVARFS_MAGIC = 0xde5e81e4 + EFS_SUPER_MAGIC = 0x00414A53 + EXT_SUPER_MAGIC = 0x137D + EXT2_OLD_SUPER_MAGIC = 0xEF51 + EXT2_SUPER_MAGIC = 0xEF53 + EXT3_SUPER_MAGIC = 0xEF53 + EXT4_SUPER_MAGIC = 0xEF53 + FUSE_SUPER_MAGIC = 0x65735546 + FUTEXFS_SUPER_MAGIC = 0xBAD1DEA + HFS_SUPER_MAGIC = 0x4244 + HOSTFS_SUPER_MAGIC = 0x00c0ffee + HPFS_SUPER_MAGIC = 0xF995E849 + HUGETLBFS_MAGIC = 0x958458f6 + ISOFS_SUPER_MAGIC = 0x9660 + JFFS2_SUPER_MAGIC = 0x72b6 + JFS_SUPER_MAGIC = 0x3153464a + MINIX_SUPER_MAGIC = 0x137F /* orig. minix */ + MINIX_SUPER_MAGIC2 = 0x138F /* 30 char minix */ + MINIX2_SUPER_MAGIC = 0x2468 /* minix V2 */ + MINIX2_SUPER_MAGIC2 = 0x2478 /* minix V2, 30 char names */ + MINIX3_SUPER_MAGIC = 0x4d5a /* minix V3 fs, 60 char names */ + MQUEUE_MAGIC = 0x19800202 + MSDOS_SUPER_MAGIC = 0x4d44 + NCP_SUPER_MAGIC = 0x564c + NFS_SUPER_MAGIC = 0x6969 + NILFS_SUPER_MAGIC = 0x3434 + NTFS_SB_MAGIC = 0x5346544e + OCFS2_SUPER_MAGIC = 0x7461636f + OPENPROM_SUPER_MAGIC = 0x9fa1 + PIPEFS_MAGIC = 0x50495045 + PROC_SUPER_MAGIC = 0x9fa0 + PSTOREFS_MAGIC = 0x6165676C + QNX4_SUPER_MAGIC = 0x002f + QNX6_SUPER_MAGIC = 0x68191122 + RAMFS_MAGIC = 0x858458f6 + REISERFS_SUPER_MAGIC = 0x52654973 + ROMFS_MAGIC = 0x7275 + SELINUX_MAGIC = 0xf97cff8c + SMACK_MAGIC = 0x43415d53 + SMB_SUPER_MAGIC = 0x517B + SOCKFS_MAGIC = 0x534F434B + SQUASHFS_MAGIC = 0x73717368 + SYSFS_MAGIC = 0x62656572 + SYSV2_SUPER_MAGIC = 0x012FF7B6 + SYSV4_SUPER_MAGIC = 0x012FF7B5 + TMPFS_MAGIC = 0x01021994 + UDF_SUPER_MAGIC = 0x15013346 + UFS_MAGIC = 0x00011954 + USBDEVICE_SUPER_MAGIC = 0x9fa2 + V9FS_MAGIC = 0x01021997 + VXFS_SUPER_MAGIC = 0xa501FCF5 + XENFS_SUPER_MAGIC = 0xabba1974 + XENIX_SUPER_MAGIC = 0x012FF7B4 + XFS_SUPER_MAGIC = 0x58465342 + _XIAFS_SUPER_MAGIC = 0x012FD16D + + AFS_SUPER_MAGIC = 0x5346414F + AUFS_SUPER_MAGIC = 0x61756673 + ANON_INODE_FS_SUPER_MAGIC = 0x09041934 + CEPH_SUPER_MAGIC = 0x00C36400 + ECRYPTFS_SUPER_MAGIC = 0xF15F + FAT_SUPER_MAGIC = 0x4006 + FHGFS_SUPER_MAGIC = 0x19830326 + FUSEBLK_SUPER_MAGIC = 0x65735546 + FUSECTL_SUPER_MAGIC = 0x65735543 + GFS_SUPER_MAGIC = 0x1161970 + GPFS_SUPER_MAGIC = 0x47504653 + MTD_INODE_FS_SUPER_MAGIC = 0x11307854 + INOTIFYFS_SUPER_MAGIC = 0x2BAD1DEA + ISOFS_R_WIN_SUPER_MAGIC = 0x4004 + ISOFS_WIN_SUPER_MAGIC = 0x4000 + JFFS_SUPER_MAGIC = 0x07C0 + KAFS_SUPER_MAGIC = 0x6B414653 + LUSTRE_SUPER_MAGIC = 0x0BD00BD0 + NFSD_SUPER_MAGIC = 0x6E667364 + PANFS_SUPER_MAGIC = 0xAAD7AAEA + RPC_PIPEFS_SUPER_MAGIC = 0x67596969 + SECURITYFS_SUPER_MAGIC = 0x73636673 + UFS_BYTESWAPPED_SUPER_MAGIC = 0x54190100 + VMHGFS_SUPER_MAGIC = 0xBACBACBC + VZFS_SUPER_MAGIC = 0x565A4653 + ZFS_SUPER_MAGIC = 0x2FC12FC1 +) + +// coreutils/src/stat.c +var fsTypeMap = map[int64]string{ + ADFS_SUPER_MAGIC: "adfs", /* 0xADF5 local */ + AFFS_SUPER_MAGIC: "affs", /* 0xADFF local */ + AFS_SUPER_MAGIC: "afs", /* 0x5346414F remote */ + ANON_INODE_FS_SUPER_MAGIC: "anon-inode FS", /* 0x09041934 local */ + AUFS_SUPER_MAGIC: "aufs", /* 0x61756673 remote */ + // AUTOFS_SUPER_MAGIC: "autofs", /* 0x0187 local */ + BEFS_SUPER_MAGIC: "befs", /* 0x42465331 local */ + BDEVFS_MAGIC: "bdevfs", /* 0x62646576 local */ + BFS_MAGIC: "bfs", /* 0x1BADFACE local */ + BINFMTFS_MAGIC: "binfmt_misc", /* 0x42494E4D local */ + BTRFS_SUPER_MAGIC: "btrfs", /* 0x9123683E local */ + CEPH_SUPER_MAGIC: "ceph", /* 0x00C36400 remote */ + CGROUP_SUPER_MAGIC: "cgroupfs", /* 0x0027E0EB local */ + CIFS_MAGIC_NUMBER: "cifs", /* 0xFF534D42 remote */ + CODA_SUPER_MAGIC: "coda", /* 0x73757245 remote */ + COH_SUPER_MAGIC: "coh", /* 0x012FF7B7 local */ + CRAMFS_MAGIC: "cramfs", /* 0x28CD3D45 local */ + DEBUGFS_MAGIC: "debugfs", /* 0x64626720 local */ + DEVFS_SUPER_MAGIC: "devfs", /* 0x1373 local */ + DEVPTS_SUPER_MAGIC: "devpts", /* 0x1CD1 local */ + ECRYPTFS_SUPER_MAGIC: "ecryptfs", /* 0xF15F local */ + EFS_SUPER_MAGIC: "efs", /* 0x00414A53 local */ + EXT_SUPER_MAGIC: "ext", /* 0x137D local */ + EXT2_SUPER_MAGIC: "ext2/ext3", /* 0xEF53 local */ + EXT2_OLD_SUPER_MAGIC: "ext2", /* 0xEF51 local */ + FAT_SUPER_MAGIC: "fat", /* 0x4006 local */ + FHGFS_SUPER_MAGIC: "fhgfs", /* 0x19830326 remote */ + FUSEBLK_SUPER_MAGIC: "fuseblk", /* 0x65735546 remote */ + FUSECTL_SUPER_MAGIC: "fusectl", /* 0x65735543 remote */ + FUTEXFS_SUPER_MAGIC: "futexfs", /* 0x0BAD1DEA local */ + GFS_SUPER_MAGIC: "gfs/gfs2", /* 0x1161970 remote */ + GPFS_SUPER_MAGIC: "gpfs", /* 0x47504653 remote */ + HFS_SUPER_MAGIC: "hfs", /* 0x4244 local */ + HPFS_SUPER_MAGIC: "hpfs", /* 0xF995E849 local */ + HUGETLBFS_MAGIC: "hugetlbfs", /* 0x958458F6 local */ + MTD_INODE_FS_SUPER_MAGIC: "inodefs", /* 0x11307854 local */ + INOTIFYFS_SUPER_MAGIC: "inotifyfs", /* 0x2BAD1DEA local */ + ISOFS_SUPER_MAGIC: "isofs", /* 0x9660 local */ + ISOFS_R_WIN_SUPER_MAGIC: "isofs", /* 0x4004 local */ + ISOFS_WIN_SUPER_MAGIC: "isofs", /* 0x4000 local */ + JFFS_SUPER_MAGIC: "jffs", /* 0x07C0 local */ + JFFS2_SUPER_MAGIC: "jffs2", /* 0x72B6 local */ + JFS_SUPER_MAGIC: "jfs", /* 0x3153464A local */ + KAFS_SUPER_MAGIC: "k-afs", /* 0x6B414653 remote */ + LUSTRE_SUPER_MAGIC: "lustre", /* 0x0BD00BD0 remote */ + MINIX_SUPER_MAGIC: "minix", /* 0x137F local */ + MINIX_SUPER_MAGIC2: "minix (30 char.)", /* 0x138F local */ + MINIX2_SUPER_MAGIC: "minix v2", /* 0x2468 local */ + MINIX2_SUPER_MAGIC2: "minix v2 (30 char.)", /* 0x2478 local */ + MINIX3_SUPER_MAGIC: "minix3", /* 0x4D5A local */ + MQUEUE_MAGIC: "mqueue", /* 0x19800202 local */ + MSDOS_SUPER_MAGIC: "msdos", /* 0x4D44 local */ + NCP_SUPER_MAGIC: "novell", /* 0x564C remote */ + NFS_SUPER_MAGIC: "nfs", /* 0x6969 remote */ + NFSD_SUPER_MAGIC: "nfsd", /* 0x6E667364 remote */ + NILFS_SUPER_MAGIC: "nilfs", /* 0x3434 local */ + NTFS_SB_MAGIC: "ntfs", /* 0x5346544E local */ + OPENPROM_SUPER_MAGIC: "openprom", /* 0x9FA1 local */ + OCFS2_SUPER_MAGIC: "ocfs2", /* 0x7461636f remote */ + PANFS_SUPER_MAGIC: "panfs", /* 0xAAD7AAEA remote */ + PIPEFS_MAGIC: "pipefs", /* 0x50495045 remote */ + PROC_SUPER_MAGIC: "proc", /* 0x9FA0 local */ + PSTOREFS_MAGIC: "pstorefs", /* 0x6165676C local */ + QNX4_SUPER_MAGIC: "qnx4", /* 0x002F local */ + QNX6_SUPER_MAGIC: "qnx6", /* 0x68191122 local */ + RAMFS_MAGIC: "ramfs", /* 0x858458F6 local */ + REISERFS_SUPER_MAGIC: "reiserfs", /* 0x52654973 local */ + ROMFS_MAGIC: "romfs", /* 0x7275 local */ + RPC_PIPEFS_SUPER_MAGIC: "rpc_pipefs", /* 0x67596969 local */ + SECURITYFS_SUPER_MAGIC: "securityfs", /* 0x73636673 local */ + SELINUX_MAGIC: "selinux", /* 0xF97CFF8C local */ + SMB_SUPER_MAGIC: "smb", /* 0x517B remote */ + SOCKFS_MAGIC: "sockfs", /* 0x534F434B local */ + SQUASHFS_MAGIC: "squashfs", /* 0x73717368 local */ + SYSFS_MAGIC: "sysfs", /* 0x62656572 local */ + SYSV2_SUPER_MAGIC: "sysv2", /* 0x012FF7B6 local */ + SYSV4_SUPER_MAGIC: "sysv4", /* 0x012FF7B5 local */ + TMPFS_MAGIC: "tmpfs", /* 0x01021994 local */ + UDF_SUPER_MAGIC: "udf", /* 0x15013346 local */ + UFS_MAGIC: "ufs", /* 0x00011954 local */ + UFS_BYTESWAPPED_SUPER_MAGIC: "ufs", /* 0x54190100 local */ + USBDEVICE_SUPER_MAGIC: "usbdevfs", /* 0x9FA2 local */ + V9FS_MAGIC: "v9fs", /* 0x01021997 local */ + VMHGFS_SUPER_MAGIC: "vmhgfs", /* 0xBACBACBC remote */ + VXFS_SUPER_MAGIC: "vxfs", /* 0xA501FCF5 local */ + VZFS_SUPER_MAGIC: "vzfs", /* 0x565A4653 local */ + XENFS_SUPER_MAGIC: "xenfs", /* 0xABBA1974 local */ + XENIX_SUPER_MAGIC: "xenix", /* 0x012FF7B4 local */ + XFS_SUPER_MAGIC: "xfs", /* 0x58465342 local */ + _XIAFS_SUPER_MAGIC: "xia", /* 0x012FD16D local */ + ZFS_SUPER_MAGIC: "zfs", /* 0x2FC12FC1 local */ +} + +// Get disk partitions. +// should use setmntent(3) but this implement use /etc/mtab file +func Partitions(all bool) ([]PartitionStat, error) { + filename := common.HostEtc("mtab") + lines, err := common.ReadLines(filename) + if err != nil { + return nil, err + } + + ret := make([]PartitionStat, 0, len(lines)) + + for _, line := range lines { + fields := strings.Fields(line) + d := PartitionStat{ + Device: fields[0], + Mountpoint: fields[1], + Fstype: fields[2], + Opts: fields[3], + } + ret = append(ret, d) + } + + return ret, nil +} + +func IOCounters() (map[string]IOCountersStat, error) { + filename := common.HostProc("diskstats") + lines, err := common.ReadLines(filename) + if err != nil { + return nil, err + } + ret := make(map[string]IOCountersStat, 0) + empty := IOCountersStat{} + + for _, line := range lines { + fields := strings.Fields(line) + name := fields[2] + reads, err := strconv.ParseUint((fields[3]), 10, 64) + if err != nil { + return ret, err + } + rbytes, err := strconv.ParseUint((fields[5]), 10, 64) + if err != nil { + return ret, err + } + rtime, err := strconv.ParseUint((fields[6]), 10, 64) + if err != nil { + return ret, err + } + writes, err := strconv.ParseUint((fields[7]), 10, 64) + if err != nil { + return ret, err + } + wbytes, err := strconv.ParseUint((fields[9]), 10, 64) + if err != nil { + return ret, err + } + wtime, err := strconv.ParseUint((fields[10]), 10, 64) + if err != nil { + return ret, err + } + iotime, err := strconv.ParseUint((fields[12]), 10, 64) + if err != nil { + return ret, err + } + d := IOCountersStat{ + ReadBytes: rbytes * SectorSize, + WriteBytes: wbytes * SectorSize, + ReadCount: reads, + WriteCount: writes, + ReadTime: rtime, + WriteTime: wtime, + IoTime: iotime, + } + if d == empty { + continue + } + d.Name = name + + d.SerialNumber = GetDiskSerialNumber(name) + ret[name] = d + } + return ret, nil +} + +func GetDiskSerialNumber(name string) string { + n := fmt.Sprintf("--name=%s", name) + udevadm, err := exec.LookPath("/sbin/udevadm") + if err != nil { + return "" + } + + out, err := exec.Command(udevadm, "info", "--query=property", n).Output() + + // does not return error, just an empty string + if err != nil { + return "" + } + lines := strings.Split(string(out), "\n") + for _, line := range lines { + values := strings.Split(line, "=") + if len(values) < 2 || values[0] != "ID_SERIAL" { + // only get ID_SERIAL, not ID_SERIAL_SHORT + continue + } + return values[1] + } + return "" +} + +func getFsType(stat syscall.Statfs_t) string { + t := int64(stat.Type) + ret, ok := fsTypeMap[t] + if !ok { + return "" + } + return ret +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_unix.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_unix.go new file mode 100644 index 00000000..2858008e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_unix.go @@ -0,0 +1,30 @@ +// +build freebsd linux darwin + +package disk + +import "syscall" + +func Usage(path string) (*UsageStat, error) { + stat := syscall.Statfs_t{} + err := syscall.Statfs(path, &stat) + if err != nil { + return nil, err + } + bsize := stat.Bsize + + ret := &UsageStat{ + Path: path, + Fstype: getFsType(stat), + Total: (uint64(stat.Blocks) * uint64(bsize)), + Free: (uint64(stat.Bavail) * uint64(bsize)), + InodesTotal: (uint64(stat.Files)), + InodesFree: (uint64(stat.Ffree)), + } + + ret.InodesUsed = (ret.InodesTotal - ret.InodesFree) + ret.InodesUsedPercent = (float64(ret.InodesUsed) / float64(ret.InodesTotal)) * 100.0 + ret.Used = (uint64(stat.Blocks) - uint64(stat.Bfree)) * uint64(bsize) + ret.UsedPercent = (float64(ret.Used) / float64(ret.Total)) * 100.0 + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_windows.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_windows.go new file mode 100644 index 00000000..b3a30d69 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/disk_windows.go @@ -0,0 +1,155 @@ +// +build windows + +package disk + +import ( + "bytes" + "syscall" + "unsafe" + + "github.com/StackExchange/wmi" + + "github.com/shirou/gopsutil/internal/common" +) + +var ( + procGetDiskFreeSpaceExW = common.Modkernel32.NewProc("GetDiskFreeSpaceExW") + procGetLogicalDriveStringsW = common.Modkernel32.NewProc("GetLogicalDriveStringsW") + procGetDriveType = common.Modkernel32.NewProc("GetDriveTypeW") + provGetVolumeInformation = common.Modkernel32.NewProc("GetVolumeInformationW") +) + +var ( + FileFileCompression = int64(16) // 0x00000010 + FileReadOnlyVolume = int64(524288) // 0x00080000 +) + +type Win32_PerfFormattedData struct { + Name string + AvgDiskBytesPerRead uint64 + AvgDiskBytesPerWrite uint64 + AvgDiskReadQueueLength uint64 + AvgDiskWriteQueueLength uint64 + AvgDisksecPerRead uint64 + AvgDisksecPerWrite uint64 +} + +const WaitMSec = 500 + +func Usage(path string) (*UsageStat, error) { + ret := &UsageStat{} + + lpFreeBytesAvailable := int64(0) + lpTotalNumberOfBytes := int64(0) + lpTotalNumberOfFreeBytes := int64(0) + diskret, _, err := procGetDiskFreeSpaceExW.Call( + uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(path))), + uintptr(unsafe.Pointer(&lpFreeBytesAvailable)), + uintptr(unsafe.Pointer(&lpTotalNumberOfBytes)), + uintptr(unsafe.Pointer(&lpTotalNumberOfFreeBytes))) + if diskret == 0 { + return nil, err + } + ret = &UsageStat{ + Path: path, + Total: uint64(lpTotalNumberOfBytes), + Free: uint64(lpTotalNumberOfFreeBytes), + Used: uint64(lpTotalNumberOfBytes) - uint64(lpTotalNumberOfFreeBytes), + UsedPercent: (float64(lpTotalNumberOfBytes) - float64(lpTotalNumberOfFreeBytes)) / float64(lpTotalNumberOfBytes) * 100, + // InodesTotal: 0, + // InodesFree: 0, + // InodesUsed: 0, + // InodesUsedPercent: 0, + } + return ret, nil +} + +func Partitions(all bool) ([]PartitionStat, error) { + var ret []PartitionStat + lpBuffer := make([]byte, 254) + diskret, _, err := procGetLogicalDriveStringsW.Call( + uintptr(len(lpBuffer)), + uintptr(unsafe.Pointer(&lpBuffer[0]))) + if diskret == 0 { + return ret, err + } + for _, v := range lpBuffer { + if v >= 65 && v <= 90 { + path := string(v) + ":" + if path == "A:" || path == "B:" { // skip floppy drives + continue + } + typepath, _ := syscall.UTF16PtrFromString(path) + typeret, _, _ := procGetDriveType.Call(uintptr(unsafe.Pointer(typepath))) + if typeret == 0 { + return ret, syscall.GetLastError() + } + // 2: DRIVE_REMOVABLE 3: DRIVE_FIXED 5: DRIVE_CDROM + + if typeret == 2 || typeret == 3 || typeret == 5 { + lpVolumeNameBuffer := make([]byte, 256) + lpVolumeSerialNumber := int64(0) + lpMaximumComponentLength := int64(0) + lpFileSystemFlags := int64(0) + lpFileSystemNameBuffer := make([]byte, 256) + volpath, _ := syscall.UTF16PtrFromString(string(v) + ":/") + driveret, _, err := provGetVolumeInformation.Call( + uintptr(unsafe.Pointer(volpath)), + uintptr(unsafe.Pointer(&lpVolumeNameBuffer[0])), + uintptr(len(lpVolumeNameBuffer)), + uintptr(unsafe.Pointer(&lpVolumeSerialNumber)), + uintptr(unsafe.Pointer(&lpMaximumComponentLength)), + uintptr(unsafe.Pointer(&lpFileSystemFlags)), + uintptr(unsafe.Pointer(&lpFileSystemNameBuffer[0])), + uintptr(len(lpFileSystemNameBuffer))) + if driveret == 0 { + if typeret == 5 { + continue //device is not ready will happen if there is no disk in the drive + } + return ret, err + } + opts := "rw" + if lpFileSystemFlags&FileReadOnlyVolume != 0 { + opts = "ro" + } + if lpFileSystemFlags&FileFileCompression != 0 { + opts += ".compress" + } + + d := PartitionStat{ + Mountpoint: path, + Device: path, + Fstype: string(bytes.Replace(lpFileSystemNameBuffer, []byte("\x00"), []byte(""), -1)), + Opts: opts, + } + ret = append(ret, d) + } + } + } + return ret, nil +} + +func IOCounters() (map[string]IOCountersStat, error) { + ret := make(map[string]IOCountersStat, 0) + var dst []Win32_PerfFormattedData + + err := wmi.Query("SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk ", &dst) + if err != nil { + return ret, err + } + for _, d := range dst { + if len(d.Name) > 3 { // not get _Total or Harddrive + continue + } + ret[d.Name] = IOCountersStat{ + Name: d.Name, + ReadCount: uint64(d.AvgDiskReadQueueLength), + WriteCount: d.AvgDiskWriteQueueLength, + ReadBytes: uint64(d.AvgDiskBytesPerRead), + WriteBytes: uint64(d.AvgDiskBytesPerWrite), + ReadTime: d.AvgDisksecPerRead, + WriteTime: d.AvgDisksecPerWrite, + } + } + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/types_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/types_freebsd.go new file mode 100644 index 00000000..dd6ddc4f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/disk/types_freebsd.go @@ -0,0 +1,88 @@ +// +build ignore +// Hand writing: _Ctype_struct___0 + +/* +Input to cgo -godefs. + +*/ + +package disk + +/* +#include +#include +#include + +enum { + sizeofPtr = sizeof(void*), +}; + +// because statinfo has long double snap_time, redefine with changing long long +struct statinfo2 { + long cp_time[CPUSTATES]; + long tk_nin; + long tk_nout; + struct devinfo *dinfo; + long long snap_time; +}; +*/ +import "C" + +// Machine characteristics; for internal use. + +const ( + sizeofPtr = C.sizeofPtr + sizeofShort = C.sizeof_short + sizeofInt = C.sizeof_int + sizeofLong = C.sizeof_long + sizeofLongLong = C.sizeof_longlong + sizeofLongDouble = C.sizeof_longlong + + DEVSTAT_NO_DATA = 0x00 + DEVSTAT_READ = 0x01 + DEVSTAT_WRITE = 0x02 + DEVSTAT_FREE = 0x03 + + // from sys/mount.h + MNT_RDONLY = 0x00000001 /* read only filesystem */ + MNT_SYNCHRONOUS = 0x00000002 /* filesystem written synchronously */ + MNT_NOEXEC = 0x00000004 /* can't exec from filesystem */ + MNT_NOSUID = 0x00000008 /* don't honor setuid bits on fs */ + MNT_UNION = 0x00000020 /* union with underlying filesystem */ + MNT_ASYNC = 0x00000040 /* filesystem written asynchronously */ + MNT_SUIDDIR = 0x00100000 /* special handling of SUID on dirs */ + MNT_SOFTDEP = 0x00200000 /* soft updates being done */ + MNT_NOSYMFOLLOW = 0x00400000 /* do not follow symlinks */ + MNT_GJOURNAL = 0x02000000 /* GEOM journal support enabled */ + MNT_MULTILABEL = 0x04000000 /* MAC support for individual objects */ + MNT_ACLS = 0x08000000 /* ACL support enabled */ + MNT_NOATIME = 0x10000000 /* disable update of file access time */ + MNT_NOCLUSTERR = 0x40000000 /* disable cluster read */ + MNT_NOCLUSTERW = 0x80000000 /* disable cluster write */ + MNT_NFS4ACLS = 0x00000010 + + MNT_WAIT = 1 /* synchronously wait for I/O to complete */ + MNT_NOWAIT = 2 /* start all I/O, but do not wait for it */ + MNT_LAZY = 3 /* push data not written by filesystem syncer */ + MNT_SUSPEND = 4 /* Suspend file system after sync */ +) + +const ( + sizeOfDevstat = C.sizeof_struct_devstat +) + +// Basic types + +type ( + _C_short C.short + _C_int C.int + _C_long C.long + _C_long_long C.longlong + _C_long_double C.longlong +) + +type Statfs C.struct_statfs +type Fsid C.struct_fsid + +type Devstat C.struct_devstat +type Bintime C.struct_bintime diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/doc.go new file mode 100644 index 00000000..6a65fe26 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/doc.go @@ -0,0 +1 @@ +package gopsutil diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/docker/docker.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/docker/docker.go new file mode 100644 index 00000000..e002f7b2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/docker/docker.go @@ -0,0 +1,41 @@ +package docker + +import "errors" + +var ErrDockerNotAvailable = errors.New("docker not available") +var ErrCgroupNotAvailable = errors.New("cgroup not available") + +type CgroupMemStat struct { + ContainerID string `json:"containerID"` + Cache uint64 `json:"cache"` + RSS uint64 `json:"rss"` + RSSHuge uint64 `json:"rssHuge"` + MappedFile uint64 `json:"mappedFile"` + Pgpgin uint64 `json:"pgpgin"` + Pgpgout uint64 `json:"pgpgout"` + Pgfault uint64 `json:"pgfault"` + Pgmajfault uint64 `json:"pgmajfault"` + InactiveAnon uint64 `json:"inactiveAnon"` + ActiveAnon uint64 `json:"activeAnon"` + InactiveFile uint64 `json:"inactiveFile"` + ActiveFile uint64 `json:"activeFile"` + Unevictable uint64 `json:"unevictable"` + HierarchicalMemoryLimit uint64 `json:"hierarchicalMemoryLimit"` + TotalCache uint64 `json:"totalCache"` + TotalRSS uint64 `json:"totalRss"` + TotalRSSHuge uint64 `json:"totalRssHuge"` + TotalMappedFile uint64 `json:"totalMappedFile"` + TotalPgpgIn uint64 `json:"totalPgpgin"` + TotalPgpgOut uint64 `json:"totalPgpgout"` + TotalPgFault uint64 `json:"totalPgfault"` + TotalPgMajFault uint64 `json:"totalPgmajfault"` + TotalInactiveAnon uint64 `json:"totalInactiveAnon"` + TotalActiveAnon uint64 `json:"totalActiveAnon"` + TotalInactiveFile uint64 `json:"totalInactiveFile"` + TotalActiveFile uint64 `json:"totalActiveFile"` + TotalUnevictable uint64 `json:"totalUnevictable"` + MemUsageInBytes uint64 `json:"memUsageInBytes"` + MemMaxUsageInBytes uint64 `json:"memMaxUsageInBytes"` + MemLimitInBytes uint64 `json:"memoryLimitInBbytes"` + MemFailCnt uint64 `json:"memoryFailcnt"` +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/docker/docker_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/docker/docker_linux.go new file mode 100644 index 00000000..ee74525d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/docker/docker_linux.go @@ -0,0 +1,212 @@ +// +build linux + +package docker + +import ( + "encoding/json" + "fmt" + "os" + "os/exec" + "path" + "strconv" + "strings" + + cpu "github.com/shirou/gopsutil/cpu" + "github.com/shirou/gopsutil/internal/common" +) + +// GetDockerIDList returnes a list of DockerID. +// This requires certain permission. +func GetDockerIDList() ([]string, error) { + path, err := exec.LookPath("docker") + if err != nil { + return nil, ErrDockerNotAvailable + } + + out, err := exec.Command(path, "ps", "-q", "--no-trunc").Output() + if err != nil { + return []string{}, err + } + lines := strings.Split(string(out), "\n") + ret := make([]string, 0, len(lines)) + + for _, l := range lines { + if l == "" { + continue + } + ret = append(ret, l) + } + + return ret, nil +} + +// CgroupCPU returnes specified cgroup id CPU status. +// containerID is same as docker id if you use docker. +// If you use container via systemd.slice, you could use +// containerID = docker-.scope and base=/sys/fs/cgroup/cpuacct/system.slice/ +func CgroupCPU(containerID string, base string) (*cpu.TimesStat, error) { + statfile := getCgroupFilePath(containerID, base, "cpuacct", "cpuacct.stat") + lines, err := common.ReadLines(statfile) + if err != nil { + return nil, err + } + // empty containerID means all cgroup + if len(containerID) == 0 { + containerID = "all" + } + ret := &cpu.TimesStat{CPU: containerID} + for _, line := range lines { + fields := strings.Split(line, " ") + if fields[0] == "user" { + user, err := strconv.ParseFloat(fields[1], 64) + if err == nil { + ret.User = float64(user) + } + } + if fields[0] == "system" { + system, err := strconv.ParseFloat(fields[1], 64) + if err == nil { + ret.System = float64(system) + } + } + } + + return ret, nil +} + +func CgroupCPUDocker(containerid string) (*cpu.TimesStat, error) { + return CgroupCPU(containerid, common.HostSys("fs/cgroup/cpuacct/docker")) +} + +func CgroupMem(containerID string, base string) (*CgroupMemStat, error) { + statfile := getCgroupFilePath(containerID, base, "memory", "memory.stat") + + // empty containerID means all cgroup + if len(containerID) == 0 { + containerID = "all" + } + lines, err := common.ReadLines(statfile) + if err != nil { + return nil, err + } + ret := &CgroupMemStat{ContainerID: containerID} + for _, line := range lines { + fields := strings.Split(line, " ") + v, err := strconv.ParseUint(fields[1], 10, 64) + if err != nil { + continue + } + switch fields[0] { + case "cache": + ret.Cache = v + case "rss": + ret.RSS = v + case "rssHuge": + ret.RSSHuge = v + case "mappedFile": + ret.MappedFile = v + case "pgpgin": + ret.Pgpgin = v + case "pgpgout": + ret.Pgpgout = v + case "pgfault": + ret.Pgfault = v + case "pgmajfault": + ret.Pgmajfault = v + case "inactiveAnon": + ret.InactiveAnon = v + case "activeAnon": + ret.ActiveAnon = v + case "inactiveFile": + ret.InactiveFile = v + case "activeFile": + ret.ActiveFile = v + case "unevictable": + ret.Unevictable = v + case "hierarchicalMemoryLimit": + ret.HierarchicalMemoryLimit = v + case "totalCache": + ret.TotalCache = v + case "totalRss": + ret.TotalRSS = v + case "totalRssHuge": + ret.TotalRSSHuge = v + case "totalMappedFile": + ret.TotalMappedFile = v + case "totalPgpgin": + ret.TotalPgpgIn = v + case "totalPgpgout": + ret.TotalPgpgOut = v + case "totalPgfault": + ret.TotalPgFault = v + case "totalPgmajfault": + ret.TotalPgMajFault = v + case "totalInactiveAnon": + ret.TotalInactiveAnon = v + case "totalActiveAnon": + ret.TotalActiveAnon = v + case "totalInactiveFile": + ret.TotalInactiveFile = v + case "totalActiveFile": + ret.TotalActiveFile = v + case "totalUnevictable": + ret.TotalUnevictable = v + } + } + + r, err := getCgroupMemFile(containerID, base, "memory.usage_in_bytes") + if err == nil { + ret.MemUsageInBytes = r + } + r, err = getCgroupMemFile(containerID, base, "memory.max_usage_in_bytes") + if err == nil { + ret.MemMaxUsageInBytes = r + } + r, err = getCgroupMemFile(containerID, base, "memoryLimitInBbytes") + if err == nil { + ret.MemLimitInBytes = r + } + r, err = getCgroupMemFile(containerID, base, "memoryFailcnt") + if err == nil { + ret.MemFailCnt = r + } + + return ret, nil +} + +func CgroupMemDocker(containerID string) (*CgroupMemStat, error) { + return CgroupMem(containerID, common.HostSys("fs/cgroup/memory/docker")) +} + +func (m CgroupMemStat) String() string { + s, _ := json.Marshal(m) + return string(s) +} + +// getCgroupFilePath constructs file path to get targetted stats file. +func getCgroupFilePath(containerID, base, target, file string) string { + if len(base) == 0 { + base = common.HostSys(fmt.Sprintf("fs/cgroup/%s/docker", target)) + } + statfile := path.Join(base, containerID, file) + + if _, err := os.Stat(statfile); os.IsNotExist(err) { + statfile = path.Join( + common.HostSys(fmt.Sprintf("fs/cgroup/%s/system.slice", target)), "docker-"+containerID+".scope", file) + } + + return statfile +} + +// getCgroupMemFile reads a cgroup file and return the contents as uint64. +func getCgroupMemFile(containerID, base, file string) (uint64, error) { + statfile := getCgroupFilePath(containerID, base, "memory", file) + lines, err := common.ReadLines(statfile) + if err != nil { + return 0, err + } + if len(lines) != 1 { + return 0, fmt.Errorf("wrong format file: %s", statfile) + } + return strconv.ParseUint(lines[0], 10, 64) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/docker/docker_notlinux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/docker/docker_notlinux.go new file mode 100644 index 00000000..03a56e63 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/docker/docker_notlinux.go @@ -0,0 +1,41 @@ +// +build !linux + +package docker + +import ( + "encoding/json" + + "github.com/shirou/gopsutil/cpu" + "github.com/shirou/gopsutil/internal/common" +) + +// GetDockerIDList returnes a list of DockerID. +// This requires certain permission. +func GetDockerIDList() ([]string, error) { + return nil, ErrDockerNotAvailable +} + +// CgroupCPU returnes specified cgroup id CPU status. +// containerid is same as docker id if you use docker. +// If you use container via systemd.slice, you could use +// containerid = docker-.scope and base=/sys/fs/cgroup/cpuacct/system.slice/ +func CgroupCPU(containerid string, base string) (*cpu.TimesStat, error) { + return nil, ErrCgroupNotAvailable +} + +func CgroupCPUDocker(containerid string) (*cpu.TimesStat, error) { + return CgroupCPU(containerid, common.HostSys("fs/cgroup/cpuacct/docker")) +} + +func CgroupMem(containerid string, base string) (*CgroupMemStat, error) { + return nil, ErrCgroupNotAvailable +} + +func CgroupMemDocker(containerid string) (*CgroupMemStat, error) { + return CgroupMem(containerid, common.HostSys("fs/cgroup/memory/docker")) +} + +func (m CgroupMemStat) String() string { + s, _ := json.Marshal(m) + return string(s) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host.go new file mode 100644 index 00000000..d87ada2b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host.go @@ -0,0 +1,38 @@ +package host + +import ( + "encoding/json" +) + +// A HostInfoStat describes the host status. +// This is not in the psutil but it useful. +type InfoStat struct { + Hostname string `json:"hostname"` + Uptime uint64 `json:"uptime"` + BootTime uint64 `json:"bootTime"` + Procs uint64 `json:"procs"` // number of processes + OS string `json:"os"` // ex: freebsd, linux + Platform string `json:"platform"` // ex: ubuntu, linuxmint + PlatformFamily string `json:"platformFamily"` // ex: debian, rhel + PlatformVersion string `json:"platformVersion"` + VirtualizationSystem string `json:"virtualizationSystem"` + VirtualizationRole string `json:"virtualizationRole"` // guest or host + +} + +type UserStat struct { + User string `json:"user"` + Terminal string `json:"terminal"` + Host string `json:"host"` + Started int `json:"started"` +} + +func (h InfoStat) String() string { + s, _ := json.Marshal(h) + return string(s) +} + +func (u UserStat) String() string { + s, _ := json.Marshal(u) + return string(s) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_darwin.go new file mode 100644 index 00000000..f4a8c36a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_darwin.go @@ -0,0 +1,152 @@ +// +build darwin + +package host + +import ( + "bytes" + "encoding/binary" + "io/ioutil" + "os" + "os/exec" + "runtime" + "strconv" + "strings" + "time" + "unsafe" + + "github.com/shirou/gopsutil/internal/common" +) + +// from utmpx.h +const USER_PROCESS = 7 + +func Info() (*InfoStat, error) { + ret := &InfoStat{ + OS: runtime.GOOS, + PlatformFamily: "darwin", + } + + hostname, err := os.Hostname() + if err == nil { + ret.Hostname = hostname + } + + platform, family, version, err := PlatformInformation() + if err == nil { + ret.Platform = platform + ret.PlatformFamily = family + ret.PlatformVersion = version + } + system, role, err := Virtualization() + if err == nil { + ret.VirtualizationSystem = system + ret.VirtualizationRole = role + } + + boot, err := BootTime() + if err == nil { + ret.BootTime = boot + ret.Uptime = uptime(boot) + } + + return ret, nil +} + +func BootTime() (uint64, error) { + values, err := common.DoSysctrl("kern.boottime") + if err != nil { + return 0, err + } + // ex: { sec = 1392261637, usec = 627534 } Thu Feb 13 12:20:37 2014 + v := strings.Replace(values[2], ",", "", 1) + boottime, err := strconv.ParseInt(v, 10, 64) + if err != nil { + return 0, err + } + + return uint64(boottime), nil +} + +func uptime(boot uint64) uint64 { + return uint64(time.Now().Unix()) - boot +} + +func Uptime() (uint64, error) { + boot, err := BootTime() + if err != nil { + return 0, err + } + return uptime(boot), nil +} + +func Users() ([]UserStat, error) { + utmpfile := "/var/run/utmpx" + var ret []UserStat + + file, err := os.Open(utmpfile) + if err != nil { + return ret, err + } + + buf, err := ioutil.ReadAll(file) + if err != nil { + return ret, err + } + + u := Utmpx{} + entrySize := int(unsafe.Sizeof(u)) + count := len(buf) / entrySize + + for i := 0; i < count; i++ { + b := buf[i*entrySize : i*entrySize+entrySize] + + var u Utmpx + br := bytes.NewReader(b) + err := binary.Read(br, binary.LittleEndian, &u) + if err != nil { + continue + } + if u.Type != USER_PROCESS { + continue + } + user := UserStat{ + User: common.IntToString(u.User[:]), + Terminal: common.IntToString(u.Line[:]), + Host: common.IntToString(u.Host[:]), + Started: int(u.Tv.Sec), + } + ret = append(ret, user) + } + + return ret, nil + +} + +func PlatformInformation() (string, string, string, error) { + platform := "" + family := "" + version := "" + + uname, err := exec.LookPath("uname") + if err != nil { + return "", "", "", err + } + out, err := exec.Command(uname, "-s").Output() + if err == nil { + platform = strings.ToLower(strings.TrimSpace(string(out))) + } + + out, err = exec.Command(uname, "-r").Output() + if err == nil { + version = strings.ToLower(strings.TrimSpace(string(out))) + } + + return platform, family, version, nil +} + +func Virtualization() (string, string, error) { + system := "" + role := "" + + return system, role, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_darwin_amd64.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_darwin_amd64.go new file mode 100644 index 00000000..c3596f9f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_darwin_amd64.go @@ -0,0 +1,19 @@ +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs types_darwin.go + +package host + +type Utmpx struct { + User [256]int8 + ID [4]int8 + Line [32]int8 + Pid int32 + Type int16 + Pad_cgo_0 [6]byte + Tv Timeval + Host [256]int8 + Pad [16]uint32 +} +type Timeval struct { + Sec int32 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_freebsd.go new file mode 100644 index 00000000..06142e1c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_freebsd.go @@ -0,0 +1,196 @@ +// +build freebsd + +package host + +import ( + "bytes" + "encoding/binary" + "io/ioutil" + "os" + "os/exec" + "runtime" + "strconv" + "strings" + "time" + "unsafe" + + "github.com/shirou/gopsutil/internal/common" +) + +const ( + UTNameSize = 16 /* see MAXLOGNAME in */ + UTLineSize = 8 + UTHostSize = 16 +) + +func Info() (*InfoStat, error) { + ret := &InfoStat{ + OS: runtime.GOOS, + PlatformFamily: "freebsd", + } + + hostname, err := os.Hostname() + if err == nil { + ret.Hostname = hostname + } + + platform, family, version, err := PlatformInformation() + if err == nil { + ret.Platform = platform + ret.PlatformFamily = family + ret.PlatformVersion = version + } + system, role, err := Virtualization() + if err == nil { + ret.VirtualizationSystem = system + ret.VirtualizationRole = role + } + + boot, err := BootTime() + if err == nil { + ret.BootTime = boot + ret.Uptime = uptime(boot) + } + + return ret, nil +} + +func BootTime() (uint64, error) { + values, err := common.DoSysctrl("kern.boottime") + if err != nil { + return 0, err + } + // ex: { sec = 1392261637, usec = 627534 } Thu Feb 13 12:20:37 2014 + v := strings.Replace(values[2], ",", "", 1) + + boottime, err := strconv.ParseUint(v, 10, 64) + if err != nil { + return 0, err + } + + return boottime, nil +} + +func uptime(boot uint64) uint64 { + return uint64(time.Now().Unix()) - boot +} + +func Uptime() (uint64, error) { + boot, err := BootTime() + if err != nil { + return 0, err + } + return uptime(boot), nil +} + +func Users() ([]UserStat, error) { + utmpfile := "/var/run/utx.active" + if !common.PathExists(utmpfile) { + utmpfile = "/var/run/utmp" // before 9.0 + return getUsersFromUtmp(utmpfile) + } + + var ret []UserStat + file, err := os.Open(utmpfile) + if err != nil { + return ret, err + } + + buf, err := ioutil.ReadAll(file) + if err != nil { + return ret, err + } + + u := Utmpx{} + entrySize := int(unsafe.Sizeof(u)) - 3 + entrySize = 197 // TODO: why should 197 + count := len(buf) / entrySize + + for i := 0; i < count; i++ { + b := buf[i*entrySize : i*entrySize+entrySize] + var u Utmpx + br := bytes.NewReader(b) + err := binary.Read(br, binary.LittleEndian, &u) + if err != nil || u.Type != 4 { + continue + } + sec := (binary.LittleEndian.Uint32(u.Tv.Sec[:])) / 2 // TODO: + user := UserStat{ + User: common.IntToString(u.User[:]), + Terminal: common.IntToString(u.Line[:]), + Host: common.IntToString(u.Host[:]), + Started: int(sec), + } + + ret = append(ret, user) + } + + return ret, nil + +} + +func PlatformInformation() (string, string, string, error) { + platform := "" + family := "" + version := "" + uname, err := exec.LookPath("uname") + if err != nil { + return "", "", "", err + } + + out, err := exec.Command(uname, "-s").Output() + if err == nil { + platform = strings.ToLower(strings.TrimSpace(string(out))) + } + + out, err = exec.Command(uname, "-r").Output() + if err == nil { + version = strings.ToLower(strings.TrimSpace(string(out))) + } + + return platform, family, version, nil +} + +func Virtualization() (string, string, error) { + system := "" + role := "" + + return system, role, nil +} + +// before 9.0 +func getUsersFromUtmp(utmpfile string) ([]UserStat, error) { + var ret []UserStat + file, err := os.Open(utmpfile) + if err != nil { + return ret, err + } + buf, err := ioutil.ReadAll(file) + if err != nil { + return ret, err + } + + u := Utmp{} + entrySize := int(unsafe.Sizeof(u)) + count := len(buf) / entrySize + + for i := 0; i < count; i++ { + b := buf[i*entrySize : i*entrySize+entrySize] + var u Utmp + br := bytes.NewReader(b) + err := binary.Read(br, binary.LittleEndian, &u) + if err != nil || u.Time == 0 { + continue + } + user := UserStat{ + User: common.IntToString(u.Name[:]), + Terminal: common.IntToString(u.Line[:]), + Host: common.IntToString(u.Host[:]), + Started: int(u.Time), + } + + ret = append(ret, user) + } + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_freebsd_amd64.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_freebsd_amd64.go new file mode 100644 index 00000000..9a4c0a47 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_freebsd_amd64.go @@ -0,0 +1,41 @@ +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs types_freebsd.go + +package host + +const ( + sizeofPtr = 0x8 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x8 + sizeofLongLong = 0x8 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type Utmp struct { + Line [8]int8 + Name [16]int8 + Host [16]int8 + Time int32 +} +type Utmpx struct { + Type int16 + Tv Timeval + ID [8]int8 + Pid int32 + User [32]int8 + Line [16]int8 + Host [125]int8 + // Host [128]int8 + // X__ut_spare [64]int8 +} +type Timeval struct { + Sec [4]byte + Usec [3]byte +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux.go new file mode 100644 index 00000000..f56906c2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux.go @@ -0,0 +1,431 @@ +// +build linux + +package host + +import ( + "bytes" + "encoding/binary" + "fmt" + "io/ioutil" + "os" + "os/exec" + "regexp" + "runtime" + "strconv" + "strings" + "time" + "unsafe" + + "github.com/shirou/gopsutil/internal/common" +) + +type LSB struct { + ID string + Release string + Codename string + Description string +} + +// from utmp.h +const USER_PROCESS = 7 + +func Info() (*InfoStat, error) { + ret := &InfoStat{ + OS: runtime.GOOS, + } + + hostname, err := os.Hostname() + if err == nil { + ret.Hostname = hostname + } + + platform, family, version, err := PlatformInformation() + if err == nil { + ret.Platform = platform + ret.PlatformFamily = family + ret.PlatformVersion = version + } + system, role, err := Virtualization() + if err == nil { + ret.VirtualizationSystem = system + ret.VirtualizationRole = role + } + boot, err := BootTime() + if err == nil { + ret.BootTime = boot + ret.Uptime = uptime(boot) + } + + return ret, nil +} + +// BootTime returns the system boot time expressed in seconds since the epoch. +func BootTime() (uint64, error) { + filename := common.HostProc("stat") + lines, err := common.ReadLines(filename) + if err != nil { + return 0, err + } + for _, line := range lines { + if strings.HasPrefix(line, "btime") { + f := strings.Fields(line) + if len(f) != 2 { + return 0, fmt.Errorf("wrong btime format") + } + b, err := strconv.ParseInt(f[1], 10, 64) + if err != nil { + return 0, err + } + return uint64(b), nil + } + } + + return 0, fmt.Errorf("could not find btime") +} + +func uptime(boot uint64) uint64 { + return uint64(time.Now().Unix()) - boot +} + +func Uptime() (uint64, error) { + boot, err := BootTime() + if err != nil { + return 0, err + } + return uptime(boot), nil +} + +func Users() ([]UserStat, error) { + utmpfile := "/var/run/utmp" + + file, err := os.Open(utmpfile) + if err != nil { + return nil, err + } + + buf, err := ioutil.ReadAll(file) + if err != nil { + return nil, err + } + + u := utmp{} + entrySize := int(unsafe.Sizeof(u)) + count := len(buf) / entrySize + + ret := make([]UserStat, 0, count) + + for i := 0; i < count; i++ { + b := buf[i*entrySize : i*entrySize+entrySize] + + var u utmp + br := bytes.NewReader(b) + err := binary.Read(br, binary.LittleEndian, &u) + if err != nil { + continue + } + if u.Type != USER_PROCESS { + continue + } + user := UserStat{ + User: common.IntToString(u.User[:]), + Terminal: common.IntToString(u.Line[:]), + Host: common.IntToString(u.Host[:]), + Started: int(u.Tv.TvSec), + } + ret = append(ret, user) + } + + return ret, nil + +} + +func getLSB() (*LSB, error) { + ret := &LSB{} + if common.PathExists(common.HostEtc("lsb-release")) { + contents, err := common.ReadLines(common.HostEtc("lsb-release")) + if err != nil { + return ret, err // return empty + } + for _, line := range contents { + field := strings.Split(line, "=") + if len(field) < 2 { + continue + } + switch field[0] { + case "DISTRIB_ID": + ret.ID = field[1] + case "DISTRIB_RELEASE": + ret.Release = field[1] + case "DISTRIB_CODENAME": + ret.Codename = field[1] + case "DISTRIB_DESCRIPTION": + ret.Description = field[1] + } + } + } else if common.PathExists("/usr/bin/lsb_release") { + lsb_release, err := exec.LookPath("/usr/bin/lsb_release") + if err != nil { + return ret, err + } + out, err := exec.Command(lsb_release).Output() + if err != nil { + return ret, err + } + for _, line := range strings.Split(string(out), "\n") { + field := strings.Split(line, ":") + if len(field) < 2 { + continue + } + switch field[0] { + case "Distributor ID": + ret.ID = field[1] + case "Release": + ret.Release = field[1] + case "Codename": + ret.Codename = field[1] + case "Description": + ret.Description = field[1] + } + } + + } + + return ret, nil +} + +func PlatformInformation() (platform string, family string, version string, err error) { + + lsb, err := getLSB() + if err != nil { + lsb = &LSB{} + } + + if common.PathExists(common.HostEtc("oracle-release")) { + platform = "oracle" + contents, err := common.ReadLines(common.HostEtc("oracle-release")) + if err == nil { + version = getRedhatishVersion(contents) + } + + } else if common.PathExists(common.HostEtc("enterprise-release")) { + platform = "oracle" + contents, err := common.ReadLines(common.HostEtc("enterprise-release")) + if err == nil { + version = getRedhatishVersion(contents) + } + } else if common.PathExists(common.HostEtc("debian_version")) { + if lsb.ID == "Ubuntu" { + platform = "ubuntu" + version = lsb.Release + } else if lsb.ID == "LinuxMint" { + platform = "linuxmint" + version = lsb.Release + } else { + if common.PathExists("/usr/bin/raspi-config") { + platform = "raspbian" + } else { + platform = "debian" + } + contents, err := common.ReadLines(common.HostEtc("debian_version")) + if err == nil { + version = contents[0] + } + } + } else if common.PathExists(common.HostEtc("redhat-release")) { + contents, err := common.ReadLines(common.HostEtc("redhat-release")) + if err == nil { + version = getRedhatishVersion(contents) + platform = getRedhatishPlatform(contents) + } + } else if common.PathExists(common.HostEtc("system-release")) { + contents, err := common.ReadLines(common.HostEtc("system-release")) + if err == nil { + version = getRedhatishVersion(contents) + platform = getRedhatishPlatform(contents) + } + } else if common.PathExists(common.HostEtc("gentoo-release")) { + platform = "gentoo" + contents, err := common.ReadLines(common.HostEtc("gentoo-release")) + if err == nil { + version = getRedhatishVersion(contents) + } + } else if common.PathExists(common.HostEtc("SuSE-release")) { + contents, err := common.ReadLines(common.HostEtc("SuSE-release")) + if err == nil { + version = getSuseVersion(contents) + platform = getSusePlatform(contents) + } + // TODO: slackware detecion + } else if common.PathExists(common.HostEtc("arch-release")) { + platform = "arch" + version = lsb.Release + } else if lsb.ID == "RedHat" { + platform = "redhat" + version = lsb.Release + } else if lsb.ID == "Amazon" { + platform = "amazon" + version = lsb.Release + } else if lsb.ID == "ScientificSL" { + platform = "scientific" + version = lsb.Release + } else if lsb.ID == "XenServer" { + platform = "xenserver" + version = lsb.Release + } else if lsb.ID != "" { + platform = strings.ToLower(lsb.ID) + version = lsb.Release + } + + switch platform { + case "debian", "ubuntu", "linuxmint", "raspbian": + family = "debian" + case "fedora": + family = "fedora" + case "oracle", "centos", "redhat", "scientific", "enterpriseenterprise", "amazon", "xenserver", "cloudlinux", "ibm_powerkvm": + family = "rhel" + case "suse", "opensuse": + family = "suse" + case "gentoo": + family = "gentoo" + case "slackware": + family = "slackware" + case "arch": + family = "arch" + case "exherbo": + family = "exherbo" + } + + return platform, family, version, nil + +} + +func getRedhatishVersion(contents []string) string { + c := strings.ToLower(strings.Join(contents, "")) + + if strings.Contains(c, "rawhide") { + return "rawhide" + } + if matches := regexp.MustCompile(`release (\d[\d.]*)`).FindStringSubmatch(c); matches != nil { + return matches[1] + } + return "" +} + +func getRedhatishPlatform(contents []string) string { + c := strings.ToLower(strings.Join(contents, "")) + + if strings.Contains(c, "red hat") { + return "redhat" + } + f := strings.Split(c, " ") + + return f[0] +} + +func getSuseVersion(contents []string) string { + version := "" + for _, line := range contents { + if matches := regexp.MustCompile(`VERSION = ([\d.]+)`).FindStringSubmatch(line); matches != nil { + version = matches[1] + } else if matches := regexp.MustCompile(`PATCHLEVEL = ([\d]+)`).FindStringSubmatch(line); matches != nil { + version = version + "." + matches[1] + } + } + return version +} + +func getSusePlatform(contents []string) string { + c := strings.ToLower(strings.Join(contents, "")) + if strings.Contains(c, "opensuse") { + return "opensuse" + } + return "suse" +} + +func Virtualization() (string, string, error) { + var system string + var role string + + filename := common.HostProc("xen") + if common.PathExists(filename) { + system = "xen" + role = "guest" // assume guest + + if common.PathExists(filename + "/capabilities") { + contents, err := common.ReadLines(filename + "/capabilities") + if err == nil { + if common.StringsHas(contents, "control_d") { + role = "host" + } + } + } + } + + filename = common.HostProc("modules") + if common.PathExists(filename) { + contents, err := common.ReadLines(filename) + if err == nil { + if common.StringsContains(contents, "kvm") { + system = "kvm" + role = "host" + } else if common.StringsContains(contents, "vboxdrv") { + system = "vbox" + role = "host" + } else if common.StringsContains(contents, "vboxguest") { + system = "vbox" + role = "guest" + } + } + } + + filename = common.HostProc("cpuinfo") + if common.PathExists(filename) { + contents, err := common.ReadLines(filename) + if err == nil { + if common.StringsHas(contents, "QEMU Virtual CPU") || + common.StringsHas(contents, "Common KVM processor") || + common.StringsHas(contents, "Common 32-bit KVM processor") { + system = "kvm" + role = "guest" + } + } + } + + filename = common.HostProc() + if common.PathExists(filename + "/bc/0") { + system = "openvz" + role = "host" + } else if common.PathExists(filename + "/vz") { + system = "openvz" + role = "guest" + } + + // not use dmidecode because it requires root + if common.PathExists(filename + "/self/status") { + contents, err := common.ReadLines(filename + "/self/status") + if err == nil { + + if common.StringsHas(contents, "s_context:") || + common.StringsHas(contents, "VxID:") { + system = "linux-vserver" + } + // TODO: guest or host + } + } + + if common.PathExists(filename + "/self/cgroup") { + contents, err := common.ReadLines(filename + "/self/cgroup") + if err == nil { + if common.StringsHas(contents, "lxc") || + common.StringsHas(contents, "docker") { + system = "lxc" + role = "guest" + } else if common.PathExists("/usr/bin/lxc-version") { // TODO: which + system = "lxc" + role = "host" + } + } + } + + return system, role, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux_386.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux_386.go new file mode 100644 index 00000000..cab9feed --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux_386.go @@ -0,0 +1,44 @@ +// ATTENTION - FILE MANUAL FIXED AFTER CGO. +// Fixed line: Tv _Ctype_struct_timeval -> Tv UtTv +// Created by cgo -godefs, MANUAL FIXED +// cgo -godefs types_linux.go + +package host + +const ( + sizeofPtr = 0x4 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x4 + sizeofLongLong = 0x8 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int32 + _C_long_long int64 +) + +type utmp struct { + Type int16 + Pad_cgo_0 [2]byte + Pid int32 + Line [32]int8 + ID [4]int8 + User [32]int8 + Host [256]int8 + Exit exit_status + Session int32 + Tv UtTv + Addr_v6 [4]int32 + X__unused [20]int8 +} +type exit_status struct { + Termination int16 + Exit int16 +} +type UtTv struct { + TvSec int32 + TvUsec int32 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux_amd64.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux_amd64.go new file mode 100644 index 00000000..180394bb --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux_amd64.go @@ -0,0 +1,42 @@ +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs types_linux.go + +package host + +const ( + sizeofPtr = 0x8 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x8 + sizeofLongLong = 0x8 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type utmp struct { + Type int16 + Pad_cgo_0 [2]byte + Pid int32 + Line [32]int8 + ID [4]int8 + User [32]int8 + Host [256]int8 + Exit exit_status + Session int32 + Tv UtTv + Addr_v6 [4]int32 + X__glibc_reserved [20]int8 +} +type exit_status struct { + Termination int16 + Exit int16 +} +type UtTv struct { + TvSec int32 + TvUsec int32 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux_arm.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux_arm.go new file mode 100644 index 00000000..5f7e168b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_linux_arm.go @@ -0,0 +1,42 @@ +// +build linux +// +build arm + +package host + +const ( + sizeofPtr = 0x8 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x8 + sizeofLongLong = 0x8 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type utmp struct { + Type int16 + Pad_cgo_0 [2]byte + Pid int32 + Line [32]int8 + ID [4]int8 + User [32]int8 + Host [256]int8 + Exit exit_status + Session int32 + Tv UtTv + Addr_v6 [4]int32 + X__glibc_reserved [20]int8 +} +type exit_status struct { + Termination int16 + Exit int16 +} +type UtTv struct { + TvSec int32 + TvUsec int32 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_windows.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_windows.go new file mode 100644 index 00000000..29f900c6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/host_windows.go @@ -0,0 +1,135 @@ +// +build windows + +package host + +import ( + "fmt" + "os" + "runtime" + "strings" + "time" + + "github.com/StackExchange/wmi" + + "github.com/shirou/gopsutil/internal/common" + process "github.com/shirou/gopsutil/process" +) + +var ( + procGetSystemTimeAsFileTime = common.Modkernel32.NewProc("GetSystemTimeAsFileTime") + osInfo *Win32_OperatingSystem +) + +type Win32_OperatingSystem struct { + Version string + Caption string + ProductType uint32 + BuildNumber string + LastBootUpTime time.Time +} + +func Info() (*InfoStat, error) { + ret := &InfoStat{ + OS: runtime.GOOS, + } + + hostname, err := os.Hostname() + if err == nil { + ret.Hostname = hostname + } + + platform, family, version, err := PlatformInformation() + if err == nil { + ret.Platform = platform + ret.PlatformFamily = family + ret.PlatformVersion = version + } else { + return ret, err + } + + boot, err := BootTime() + if err == nil { + ret.BootTime = boot + ret.Uptime = uptime(boot) + } + + procs, err := process.Pids() + if err != nil { + return ret, err + } + + ret.Procs = uint64(len(procs)) + + return ret, nil +} + +func GetOSInfo() (Win32_OperatingSystem, error) { + var dst []Win32_OperatingSystem + q := wmi.CreateQuery(&dst, "") + err := wmi.Query(q, &dst) + if err != nil { + return Win32_OperatingSystem{}, err + } + + osInfo = &dst[0] + + return dst[0], nil +} + +func BootTime() (uint64, error) { + if osInfo == nil { + _, err := GetOSInfo() + if err != nil { + return 0, err + } + } + now := time.Now() + t := osInfo.LastBootUpTime.Local() + return uint64(now.Sub(t).Seconds()), nil +} + +func uptime(boot uint64) uint64 { + return uint64(time.Now().Unix()) - boot +} + +func Uptime() (uint64, error) { + boot, err := BootTime() + if err != nil { + return 0, err + } + return uptime(boot), nil +} + +func PlatformInformation() (platform string, family string, version string, err error) { + if osInfo == nil { + _, err = GetOSInfo() + if err != nil { + return + } + } + + // Platform + platform = strings.Trim(osInfo.Caption, " ") + + // PlatformFamily + switch osInfo.ProductType { + case 1: + family = "Standalone Workstation" + case 2: + family = "Server (Domain Controller)" + case 3: + family = "Server" + } + + // Platform Version + version = fmt.Sprintf("%s Build %s", osInfo.Version, osInfo.BuildNumber) + + return +} + +func Users() ([]UserStat, error) { + + var ret []UserStat + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/types_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/types_darwin.go new file mode 100644 index 00000000..b8582278 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/types_darwin.go @@ -0,0 +1,17 @@ +// +build ignore +// plus hand editing about timeval + +/* +Input to cgo -godefs. +*/ + +package host + +/* +#include +#include +*/ +import "C" + +type Utmpx C.struct_utmpx +type Timeval C.struct_timeval diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/types_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/types_freebsd.go new file mode 100644 index 00000000..113b22ee --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/types_freebsd.go @@ -0,0 +1,43 @@ +// +build ignore + +/* +Input to cgo -godefs. +*/ + +package host + +/* +#define KERNEL +#include +#include +#include + +enum { + sizeofPtr = sizeof(void*), +}; + +*/ +import "C" + +// Machine characteristics; for internal use. + +const ( + sizeofPtr = C.sizeofPtr + sizeofShort = C.sizeof_short + sizeofInt = C.sizeof_int + sizeofLong = C.sizeof_long + sizeofLongLong = C.sizeof_longlong +) + +// Basic types + +type ( + _C_short C.short + _C_int C.int + _C_long C.long + _C_long_long C.longlong +) + +type Utmp C.struct_utmp +type Utmpx C.struct_utmpx +type Timeval C.struct_timeval diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/types_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/types_linux.go new file mode 100644 index 00000000..92854551 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/host/types_linux.go @@ -0,0 +1,45 @@ +// +build ignore + +/* +Input to cgo -godefs. +*/ + +package host + +/* +#define KERNEL +#include +#include + +enum { + sizeofPtr = sizeof(void*), +}; + +*/ +import "C" + +// Machine characteristics; for internal use. + +const ( + sizeofPtr = C.sizeofPtr + sizeofShort = C.sizeof_short + sizeofInt = C.sizeof_int + sizeofLong = C.sizeof_long + sizeofLongLong = C.sizeof_longlong +) + +// Basic types + +type ( + _C_short C.short + _C_int C.int + _C_long C.long + _C_long_long C.longlong +) + +type utmp C.struct_utmp +type exit_status C.struct_exit_status +type UtTv struct { + TvSec int32 + TvUsec int32 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/binary.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/binary.go new file mode 100644 index 00000000..9b5dc55b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/binary.go @@ -0,0 +1,634 @@ +package common + +// Copyright 2009 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. + +// Package binary implements simple translation between numbers and byte +// sequences and encoding and decoding of varints. +// +// Numbers are translated by reading and writing fixed-size values. +// A fixed-size value is either a fixed-size arithmetic +// type (int8, uint8, int16, float32, complex64, ...) +// or an array or struct containing only fixed-size values. +// +// The varint functions encode and decode single integer values using +// a variable-length encoding; smaller values require fewer bytes. +// For a specification, see +// http://code.google.com/apis/protocolbuffers/docs/encoding.html. +// +// This package favors simplicity over efficiency. Clients that require +// high-performance serialization, especially for large data structures, +// should look at more advanced solutions such as the encoding/gob +// package or protocol buffers. +import ( + "errors" + "io" + "math" + "reflect" +) + +// A ByteOrder specifies how to convert byte sequences into +// 16-, 32-, or 64-bit unsigned integers. +type ByteOrder interface { + Uint16([]byte) uint16 + Uint32([]byte) uint32 + Uint64([]byte) uint64 + PutUint16([]byte, uint16) + PutUint32([]byte, uint32) + PutUint64([]byte, uint64) + String() string +} + +// LittleEndian is the little-endian implementation of ByteOrder. +var LittleEndian littleEndian + +// BigEndian is the big-endian implementation of ByteOrder. +var BigEndian bigEndian + +type littleEndian struct{} + +func (littleEndian) Uint16(b []byte) uint16 { return uint16(b[0]) | uint16(b[1])<<8 } + +func (littleEndian) PutUint16(b []byte, v uint16) { + b[0] = byte(v) + b[1] = byte(v >> 8) +} + +func (littleEndian) Uint32(b []byte) uint32 { + return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 +} + +func (littleEndian) PutUint32(b []byte, v uint32) { + b[0] = byte(v) + b[1] = byte(v >> 8) + b[2] = byte(v >> 16) + b[3] = byte(v >> 24) +} + +func (littleEndian) Uint64(b []byte) uint64 { + return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | + uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 +} + +func (littleEndian) PutUint64(b []byte, v uint64) { + b[0] = byte(v) + b[1] = byte(v >> 8) + b[2] = byte(v >> 16) + b[3] = byte(v >> 24) + b[4] = byte(v >> 32) + b[5] = byte(v >> 40) + b[6] = byte(v >> 48) + b[7] = byte(v >> 56) +} + +func (littleEndian) String() string { return "LittleEndian" } + +func (littleEndian) GoString() string { return "binary.LittleEndian" } + +type bigEndian struct{} + +func (bigEndian) Uint16(b []byte) uint16 { return uint16(b[1]) | uint16(b[0])<<8 } + +func (bigEndian) PutUint16(b []byte, v uint16) { + b[0] = byte(v >> 8) + b[1] = byte(v) +} + +func (bigEndian) Uint32(b []byte) uint32 { + return uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24 +} + +func (bigEndian) PutUint32(b []byte, v uint32) { + b[0] = byte(v >> 24) + b[1] = byte(v >> 16) + b[2] = byte(v >> 8) + b[3] = byte(v) +} + +func (bigEndian) Uint64(b []byte) uint64 { + return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 | + uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56 +} + +func (bigEndian) PutUint64(b []byte, v uint64) { + b[0] = byte(v >> 56) + b[1] = byte(v >> 48) + b[2] = byte(v >> 40) + b[3] = byte(v >> 32) + b[4] = byte(v >> 24) + b[5] = byte(v >> 16) + b[6] = byte(v >> 8) + b[7] = byte(v) +} + +func (bigEndian) String() string { return "BigEndian" } + +func (bigEndian) GoString() string { return "binary.BigEndian" } + +// Read reads structured binary data from r into data. +// Data must be a pointer to a fixed-size value or a slice +// of fixed-size values. +// Bytes read from r are decoded using the specified byte order +// and written to successive fields of the data. +// When reading into structs, the field data for fields with +// blank (_) field names is skipped; i.e., blank field names +// may be used for padding. +// When reading into a struct, all non-blank fields must be exported. +func Read(r io.Reader, order ByteOrder, data interface{}) error { + // Fast path for basic types and slices. + if n := intDataSize(data); n != 0 { + var b [8]byte + var bs []byte + if n > len(b) { + bs = make([]byte, n) + } else { + bs = b[:n] + } + if _, err := io.ReadFull(r, bs); err != nil { + return err + } + switch data := data.(type) { + case *int8: + *data = int8(b[0]) + case *uint8: + *data = b[0] + case *int16: + *data = int16(order.Uint16(bs)) + case *uint16: + *data = order.Uint16(bs) + case *int32: + *data = int32(order.Uint32(bs)) + case *uint32: + *data = order.Uint32(bs) + case *int64: + *data = int64(order.Uint64(bs)) + case *uint64: + *data = order.Uint64(bs) + case []int8: + for i, x := range bs { // Easier to loop over the input for 8-bit values. + data[i] = int8(x) + } + case []uint8: + copy(data, bs) + case []int16: + for i := range data { + data[i] = int16(order.Uint16(bs[2*i:])) + } + case []uint16: + for i := range data { + data[i] = order.Uint16(bs[2*i:]) + } + case []int32: + for i := range data { + data[i] = int32(order.Uint32(bs[4*i:])) + } + case []uint32: + for i := range data { + data[i] = order.Uint32(bs[4*i:]) + } + case []int64: + for i := range data { + data[i] = int64(order.Uint64(bs[8*i:])) + } + case []uint64: + for i := range data { + data[i] = order.Uint64(bs[8*i:]) + } + } + return nil + } + + // Fallback to reflect-based decoding. + v := reflect.ValueOf(data) + size := -1 + switch v.Kind() { + case reflect.Ptr: + v = v.Elem() + size = dataSize(v) + case reflect.Slice: + size = dataSize(v) + } + if size < 0 { + return errors.New("binary.Read: invalid type " + reflect.TypeOf(data).String()) + } + d := &decoder{order: order, buf: make([]byte, size)} + if _, err := io.ReadFull(r, d.buf); err != nil { + return err + } + d.value(v) + return nil +} + +// Write writes the binary representation of data into w. +// Data must be a fixed-size value or a slice of fixed-size +// values, or a pointer to such data. +// Bytes written to w are encoded using the specified byte order +// and read from successive fields of the data. +// When writing structs, zero values are written for fields +// with blank (_) field names. +func Write(w io.Writer, order ByteOrder, data interface{}) error { + // Fast path for basic types and slices. + if n := intDataSize(data); n != 0 { + var b [8]byte + var bs []byte + if n > len(b) { + bs = make([]byte, n) + } else { + bs = b[:n] + } + switch v := data.(type) { + case *int8: + bs = b[:1] + b[0] = byte(*v) + case int8: + bs = b[:1] + b[0] = byte(v) + case []int8: + for i, x := range v { + bs[i] = byte(x) + } + case *uint8: + bs = b[:1] + b[0] = *v + case uint8: + bs = b[:1] + b[0] = byte(v) + case []uint8: + bs = v + case *int16: + bs = b[:2] + order.PutUint16(bs, uint16(*v)) + case int16: + bs = b[:2] + order.PutUint16(bs, uint16(v)) + case []int16: + for i, x := range v { + order.PutUint16(bs[2*i:], uint16(x)) + } + case *uint16: + bs = b[:2] + order.PutUint16(bs, *v) + case uint16: + bs = b[:2] + order.PutUint16(bs, v) + case []uint16: + for i, x := range v { + order.PutUint16(bs[2*i:], x) + } + case *int32: + bs = b[:4] + order.PutUint32(bs, uint32(*v)) + case int32: + bs = b[:4] + order.PutUint32(bs, uint32(v)) + case []int32: + for i, x := range v { + order.PutUint32(bs[4*i:], uint32(x)) + } + case *uint32: + bs = b[:4] + order.PutUint32(bs, *v) + case uint32: + bs = b[:4] + order.PutUint32(bs, v) + case []uint32: + for i, x := range v { + order.PutUint32(bs[4*i:], x) + } + case *int64: + bs = b[:8] + order.PutUint64(bs, uint64(*v)) + case int64: + bs = b[:8] + order.PutUint64(bs, uint64(v)) + case []int64: + for i, x := range v { + order.PutUint64(bs[8*i:], uint64(x)) + } + case *uint64: + bs = b[:8] + order.PutUint64(bs, *v) + case uint64: + bs = b[:8] + order.PutUint64(bs, v) + case []uint64: + for i, x := range v { + order.PutUint64(bs[8*i:], x) + } + } + _, err := w.Write(bs) + return err + } + + // Fallback to reflect-based encoding. + v := reflect.Indirect(reflect.ValueOf(data)) + size := dataSize(v) + if size < 0 { + return errors.New("binary.Write: invalid type " + reflect.TypeOf(data).String()) + } + buf := make([]byte, size) + e := &encoder{order: order, buf: buf} + e.value(v) + _, err := w.Write(buf) + return err +} + +// Size returns how many bytes Write would generate to encode the value v, which +// must be a fixed-size value or a slice of fixed-size values, or a pointer to such data. +// If v is neither of these, Size returns -1. +func Size(v interface{}) int { + return dataSize(reflect.Indirect(reflect.ValueOf(v))) +} + +// dataSize returns the number of bytes the actual data represented by v occupies in memory. +// For compound structures, it sums the sizes of the elements. Thus, for instance, for a slice +// it returns the length of the slice times the element size and does not count the memory +// occupied by the header. If the type of v is not acceptable, dataSize returns -1. +func dataSize(v reflect.Value) int { + if v.Kind() == reflect.Slice { + if s := sizeof(v.Type().Elem()); s >= 0 { + return s * v.Len() + } + return -1 + } + return sizeof(v.Type()) +} + +// sizeof returns the size >= 0 of variables for the given type or -1 if the type is not acceptable. +func sizeof(t reflect.Type) int { + switch t.Kind() { + case reflect.Array: + if s := sizeof(t.Elem()); s >= 0 { + return s * t.Len() + } + + case reflect.Struct: + sum := 0 + for i, n := 0, t.NumField(); i < n; i++ { + s := sizeof(t.Field(i).Type) + if s < 0 { + return -1 + } + sum += s + } + return sum + + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, + reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128, reflect.Ptr: + return int(t.Size()) + } + + return -1 +} + +type coder struct { + order ByteOrder + buf []byte +} + +type decoder coder +type encoder coder + +func (d *decoder) uint8() uint8 { + x := d.buf[0] + d.buf = d.buf[1:] + return x +} + +func (e *encoder) uint8(x uint8) { + e.buf[0] = x + e.buf = e.buf[1:] +} + +func (d *decoder) uint16() uint16 { + x := d.order.Uint16(d.buf[0:2]) + d.buf = d.buf[2:] + return x +} + +func (e *encoder) uint16(x uint16) { + e.order.PutUint16(e.buf[0:2], x) + e.buf = e.buf[2:] +} + +func (d *decoder) uint32() uint32 { + x := d.order.Uint32(d.buf[0:4]) + d.buf = d.buf[4:] + return x +} + +func (e *encoder) uint32(x uint32) { + e.order.PutUint32(e.buf[0:4], x) + e.buf = e.buf[4:] +} + +func (d *decoder) uint64() uint64 { + x := d.order.Uint64(d.buf[0:8]) + d.buf = d.buf[8:] + return x +} + +func (e *encoder) uint64(x uint64) { + e.order.PutUint64(e.buf[0:8], x) + e.buf = e.buf[8:] +} + +func (d *decoder) int8() int8 { return int8(d.uint8()) } + +func (e *encoder) int8(x int8) { e.uint8(uint8(x)) } + +func (d *decoder) int16() int16 { return int16(d.uint16()) } + +func (e *encoder) int16(x int16) { e.uint16(uint16(x)) } + +func (d *decoder) int32() int32 { return int32(d.uint32()) } + +func (e *encoder) int32(x int32) { e.uint32(uint32(x)) } + +func (d *decoder) int64() int64 { return int64(d.uint64()) } + +func (e *encoder) int64(x int64) { e.uint64(uint64(x)) } + +func (d *decoder) value(v reflect.Value) { + switch v.Kind() { + case reflect.Array: + l := v.Len() + for i := 0; i < l; i++ { + d.value(v.Index(i)) + } + + case reflect.Struct: + t := v.Type() + l := v.NumField() + for i := 0; i < l; i++ { + // Note: Calling v.CanSet() below is an optimization. + // It would be sufficient to check the field name, + // but creating the StructField info for each field is + // costly (run "go test -bench=ReadStruct" and compare + // results when making changes to this code). + if v := v.Field(i); v.CanSet() || t.Field(i).Name != "_" { + d.value(v) + } else { + d.skip(v) + } + } + + case reflect.Slice: + l := v.Len() + for i := 0; i < l; i++ { + d.value(v.Index(i)) + } + + case reflect.Int8: + v.SetInt(int64(d.int8())) + case reflect.Int16: + v.SetInt(int64(d.int16())) + case reflect.Int32: + v.SetInt(int64(d.int32())) + case reflect.Int64: + v.SetInt(d.int64()) + + case reflect.Uint8: + v.SetUint(uint64(d.uint8())) + case reflect.Uint16: + v.SetUint(uint64(d.uint16())) + case reflect.Uint32: + v.SetUint(uint64(d.uint32())) + case reflect.Uint64: + v.SetUint(d.uint64()) + + case reflect.Float32: + v.SetFloat(float64(math.Float32frombits(d.uint32()))) + case reflect.Float64: + v.SetFloat(math.Float64frombits(d.uint64())) + + case reflect.Complex64: + v.SetComplex(complex( + float64(math.Float32frombits(d.uint32())), + float64(math.Float32frombits(d.uint32())), + )) + case reflect.Complex128: + v.SetComplex(complex( + math.Float64frombits(d.uint64()), + math.Float64frombits(d.uint64()), + )) + } +} + +func (e *encoder) value(v reflect.Value) { + switch v.Kind() { + case reflect.Array: + l := v.Len() + for i := 0; i < l; i++ { + e.value(v.Index(i)) + } + + case reflect.Struct: + t := v.Type() + l := v.NumField() + for i := 0; i < l; i++ { + // see comment for corresponding code in decoder.value() + if v := v.Field(i); v.CanSet() || t.Field(i).Name != "_" { + e.value(v) + } else { + e.skip(v) + } + } + + case reflect.Slice: + l := v.Len() + for i := 0; i < l; i++ { + e.value(v.Index(i)) + } + + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + switch v.Type().Kind() { + case reflect.Int8: + e.int8(int8(v.Int())) + case reflect.Int16: + e.int16(int16(v.Int())) + case reflect.Int32: + e.int32(int32(v.Int())) + case reflect.Int64: + e.int64(v.Int()) + } + + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + switch v.Type().Kind() { + case reflect.Uint8: + e.uint8(uint8(v.Uint())) + case reflect.Uint16: + e.uint16(uint16(v.Uint())) + case reflect.Uint32: + e.uint32(uint32(v.Uint())) + case reflect.Uint64: + e.uint64(v.Uint()) + } + + case reflect.Float32, reflect.Float64: + switch v.Type().Kind() { + case reflect.Float32: + e.uint32(math.Float32bits(float32(v.Float()))) + case reflect.Float64: + e.uint64(math.Float64bits(v.Float())) + } + + case reflect.Complex64, reflect.Complex128: + switch v.Type().Kind() { + case reflect.Complex64: + x := v.Complex() + e.uint32(math.Float32bits(float32(real(x)))) + e.uint32(math.Float32bits(float32(imag(x)))) + case reflect.Complex128: + x := v.Complex() + e.uint64(math.Float64bits(real(x))) + e.uint64(math.Float64bits(imag(x))) + } + } +} + +func (d *decoder) skip(v reflect.Value) { + d.buf = d.buf[dataSize(v):] +} + +func (e *encoder) skip(v reflect.Value) { + n := dataSize(v) + for i := range e.buf[0:n] { + e.buf[i] = 0 + } + e.buf = e.buf[n:] +} + +// intDataSize returns the size of the data required to represent the data when encoded. +// It returns zero if the type cannot be implemented by the fast path in Read or Write. +func intDataSize(data interface{}) int { + switch data := data.(type) { + case int8, *int8, *uint8: + return 1 + case []int8: + return len(data) + case []uint8: + return len(data) + case int16, *int16, *uint16: + return 2 + case []int16: + return 2 * len(data) + case []uint16: + return 2 * len(data) + case int32, *int32, *uint32: + return 4 + case []int32: + return 4 * len(data) + case []uint32: + return 4 * len(data) + case int64, *int64, *uint64: + return 8 + case []int64: + return 8 * len(data) + case []uint64: + return 8 * len(data) + } + return 0 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common.go new file mode 100644 index 00000000..d9dce5ca --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common.go @@ -0,0 +1,279 @@ +package common + +// +// gopsutil is a port of psutil(http://pythonhosted.org/psutil/). +// This covers these architectures. +// - linux (amd64, arm) +// - freebsd (amd64) +// - windows (amd64) +import ( + "bufio" + "errors" + "io/ioutil" + "net/url" + "os" + "os/exec" + "path" + "path/filepath" + "reflect" + "runtime" + "strconv" + "strings" +) + +type Invoker interface { + Command(string, ...string) ([]byte, error) +} + +type Invoke struct{} + +func (i Invoke) Command(name string, arg ...string) ([]byte, error) { + return exec.Command(name, arg...).Output() +} + +type FakeInvoke struct { + CommandExpectedDir string // CommandExpectedDir specifies dir which includes expected outputs. + Suffix string // Suffix species expected file name suffix such as "fail" + Error error // If Error specfied, return the error. +} + +// Command in FakeInvoke returns from expected file if exists. +func (i FakeInvoke) Command(name string, arg ...string) ([]byte, error) { + if i.Error != nil { + return []byte{}, i.Error + } + + arch := runtime.GOOS + + fname := strings.Join(append([]string{name}, arg...), "") + fname = url.QueryEscape(fname) + var dir string + if i.CommandExpectedDir == "" { + dir = "expected" + } else { + dir = i.CommandExpectedDir + } + fpath := path.Join(dir, arch, fname) + if i.Suffix != "" { + fpath += "_" + i.Suffix + } + if PathExists(fpath) { + return ioutil.ReadFile(fpath) + } + return exec.Command(name, arg...).Output() +} + +var ErrNotImplementedError = errors.New("not implemented yet") + +// ReadLines reads contents from a file and splits them by new lines. +// A convenience wrapper to ReadLinesOffsetN(filename, 0, -1). +func ReadLines(filename string) ([]string, error) { + return ReadLinesOffsetN(filename, 0, -1) +} + +// ReadLines reads contents from file and splits them by new line. +// The offset tells at which line number to start. +// The count determines the number of lines to read (starting from offset): +// n >= 0: at most n lines +// n < 0: whole file +func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error) { + f, err := os.Open(filename) + if err != nil { + return []string{""}, err + } + defer f.Close() + + var ret []string + + r := bufio.NewReader(f) + for i := 0; i < n+int(offset) || n < 0; i++ { + line, err := r.ReadString('\n') + if err != nil { + break + } + if i < int(offset) { + continue + } + ret = append(ret, strings.Trim(line, "\n")) + } + + return ret, nil +} + +func IntToString(orig []int8) string { + ret := make([]byte, len(orig)) + size := -1 + for i, o := range orig { + if o == 0 { + size = i + break + } + ret[i] = byte(o) + } + if size == -1 { + size = len(orig) + } + + return string(ret[0:size]) +} + +func ByteToString(orig []byte) string { + n := -1 + l := -1 + for i, b := range orig { + // skip left side null + if l == -1 && b == 0 { + continue + } + if l == -1 { + l = i + } + + if b == 0 { + break + } + n = i + 1 + } + if n == -1 { + return string(orig) + } + return string(orig[l:n]) +} + +// ReadInts reads contents from single line file and returns them as []int32. +func ReadInts(filename string) ([]int64, error) { + f, err := os.Open(filename) + if err != nil { + return []int64{}, err + } + defer f.Close() + + var ret []int64 + + r := bufio.NewReader(f) + + // The int files that this is concerned with should only be one liners. + line, err := r.ReadString('\n') + if err != nil { + return []int64{}, err + } + + i, err := strconv.ParseInt(strings.Trim(line, "\n"), 10, 32) + if err != nil { + return []int64{}, err + } + ret = append(ret, i) + + return ret, nil +} + +// Parse to int32 without error +func mustParseInt32(val string) int32 { + vv, _ := strconv.ParseInt(val, 10, 32) + return int32(vv) +} + +// Parse to uint64 without error +func mustParseUint64(val string) uint64 { + vv, _ := strconv.ParseInt(val, 10, 64) + return uint64(vv) +} + +// Parse to Float64 without error +func mustParseFloat64(val string) float64 { + vv, _ := strconv.ParseFloat(val, 64) + return vv +} + +// StringsHas checks the target string slice contains src or not +func StringsHas(target []string, src string) bool { + for _, t := range target { + if strings.TrimSpace(t) == src { + return true + } + } + return false +} + +// StringsContains checks the src in any string of the target string slice +func StringsContains(target []string, src string) bool { + for _, t := range target { + if strings.Contains(t, src) { + return true + } + } + return false +} + +// IntContains checks the src in any int of the target int slice. +func IntContains(target []int, src int) bool { + for _, t := range target { + if src == t { + return true + } + } + return false +} + +// get struct attributes. +// This method is used only for debugging platform dependent code. +func attributes(m interface{}) map[string]reflect.Type { + typ := reflect.TypeOf(m) + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + + attrs := make(map[string]reflect.Type) + if typ.Kind() != reflect.Struct { + return nil + } + + for i := 0; i < typ.NumField(); i++ { + p := typ.Field(i) + if !p.Anonymous { + attrs[p.Name] = p.Type + } + } + + return attrs +} + +func PathExists(filename string) bool { + if _, err := os.Stat(filename); err == nil { + return true + } + return false +} + +//GetEnv retrieves the environment variable key. If it does not exist it returns the default. +func GetEnv(key string, dfault string, combineWith ...string) string { + value := os.Getenv(key) + if value == "" { + value = dfault + } + + switch len(combineWith) { + case 0: + return value + case 1: + return filepath.Join(value, combineWith[0]) + default: + all := make([]string, len(combineWith)+1) + all[0] = value + copy(all[1:], combineWith) + return filepath.Join(all...) + } + panic("invalid switch case") +} + +func HostProc(combineWith ...string) string { + return GetEnv("HOST_PROC", "/proc", combineWith...) +} + +func HostSys(combineWith ...string) string { + return GetEnv("HOST_SYS", "/sys", combineWith...) +} + +func HostEtc(combineWith ...string) string { + return GetEnv("HOST_ETC", "/etc", combineWith...) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go new file mode 100644 index 00000000..2e1552ae --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go @@ -0,0 +1,70 @@ +// +build darwin + +package common + +import ( + "os" + "os/exec" + "strings" + "syscall" + "unsafe" +) + +func DoSysctrl(mib string) ([]string, error) { + err := os.Setenv("LC_ALL", "C") + if err != nil { + return []string{}, err + } + + sysctl, err := exec.LookPath("/usr/sbin/sysctl") + if err != nil { + return []string{}, err + } + out, err := exec.Command(sysctl, "-n", mib).Output() + if err != nil { + return []string{}, err + } + v := strings.Replace(string(out), "{ ", "", 1) + v = strings.Replace(string(v), " }", "", 1) + values := strings.Fields(string(v)) + + return values, nil +} + +func CallSyscall(mib []int32) ([]byte, uint64, error) { + miblen := uint64(len(mib)) + + // get required buffer size + length := uint64(0) + _, _, err := syscall.Syscall6( + syscall.SYS___SYSCTL, + uintptr(unsafe.Pointer(&mib[0])), + uintptr(miblen), + 0, + uintptr(unsafe.Pointer(&length)), + 0, + 0) + if err != 0 { + var b []byte + return b, length, err + } + if length == 0 { + var b []byte + return b, length, err + } + // get proc info itself + buf := make([]byte, length) + _, _, err = syscall.Syscall6( + syscall.SYS___SYSCTL, + uintptr(unsafe.Pointer(&mib[0])), + uintptr(miblen), + uintptr(unsafe.Pointer(&buf[0])), + uintptr(unsafe.Pointer(&length)), + 0, + 0) + if err != 0 { + return buf, length, err + } + + return buf, length, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_freebsd.go new file mode 100644 index 00000000..dfdcebd8 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_freebsd.go @@ -0,0 +1,70 @@ +// +build freebsd + +package common + +import ( + "os" + "os/exec" + "strings" + "syscall" + "unsafe" +) + +func DoSysctrl(mib string) ([]string, error) { + err := os.Setenv("LC_ALL", "C") + if err != nil { + return []string{}, err + } + sysctl, err := exec.LookPath("/sbin/sysctl") + if err != nil { + return []string{}, err + } + out, err := exec.Command(sysctl, "-n", mib).Output() + if err != nil { + return []string{}, err + } + v := strings.Replace(string(out), "{ ", "", 1) + v = strings.Replace(string(v), " }", "", 1) + values := strings.Fields(string(v)) + + return values, nil +} + +func CallSyscall(mib []int32) ([]byte, uint64, error) { + mibptr := unsafe.Pointer(&mib[0]) + miblen := uint64(len(mib)) + + // get required buffer size + length := uint64(0) + _, _, err := syscall.Syscall6( + syscall.SYS___SYSCTL, + uintptr(mibptr), + uintptr(miblen), + 0, + uintptr(unsafe.Pointer(&length)), + 0, + 0) + if err != 0 { + var b []byte + return b, length, err + } + if length == 0 { + var b []byte + return b, length, err + } + // get proc info itself + buf := make([]byte, length) + _, _, err = syscall.Syscall6( + syscall.SYS___SYSCTL, + uintptr(mibptr), + uintptr(miblen), + uintptr(unsafe.Pointer(&buf[0])), + uintptr(unsafe.Pointer(&length)), + 0, + 0) + if err != 0 { + return buf, length, err + } + + return buf, length, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go new file mode 100644 index 00000000..0a122e9d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go @@ -0,0 +1,3 @@ +// +build linux + +package common diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_unix.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_unix.go new file mode 100644 index 00000000..6622eecc --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_unix.go @@ -0,0 +1,66 @@ +// +build linux freebsd darwin + +package common + +import ( + "os/exec" + "strconv" + "strings" +) + +func CallLsof(invoke Invoker, pid int32, args ...string) ([]string, error) { + var cmd []string + if pid == 0 { // will get from all processes. + cmd = []string{"-a", "-n", "-P"} + } else { + cmd = []string{"-a", "-n", "-P", "-p", strconv.Itoa(int(pid))} + } + cmd = append(cmd, args...) + lsof, err := exec.LookPath("lsof") + if err != nil { + return []string{}, err + } + out, err := invoke.Command(lsof, cmd...) + if err != nil { + // if no pid found, lsof returnes code 1. + if err.Error() == "exit status 1" && len(out) == 0 { + return []string{}, nil + } + } + lines := strings.Split(string(out), "\n") + + var ret []string + for _, l := range lines[1:] { + if len(l) == 0 { + continue + } + ret = append(ret, l) + } + return ret, nil +} + +func CallPgrep(invoke Invoker, pid int32) ([]int32, error) { + var cmd []string + cmd = []string{"-P", strconv.Itoa(int(pid))} + pgrep, err := exec.LookPath("pgrep") + if err != nil { + return []int32{}, err + } + out, err := invoke.Command(pgrep, cmd...) + if err != nil { + return []int32{}, err + } + lines := strings.Split(string(out), "\n") + ret := make([]int32, 0, len(lines)) + for _, l := range lines { + if len(l) == 0 { + continue + } + i, err := strconv.Atoi(l) + if err != nil { + continue + } + ret = append(ret, int32(i)) + } + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go new file mode 100644 index 00000000..d727378c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go @@ -0,0 +1,110 @@ +// +build windows + +package common + +import ( + "syscall" + "unsafe" +) + +// for double values +type PDH_FMT_COUNTERVALUE_DOUBLE struct { + CStatus uint32 + DoubleValue float64 +} + +// for 64 bit integer values +type PDH_FMT_COUNTERVALUE_LARGE struct { + CStatus uint32 + LargeValue int64 +} + +// for long values +type PDH_FMT_COUNTERVALUE_LONG struct { + CStatus uint32 + LongValue int32 + padding [4]byte +} + +// windows system const +const ( + ERROR_SUCCESS = 0 + ERROR_FILE_NOT_FOUND = 2 + DRIVE_REMOVABLE = 2 + DRIVE_FIXED = 3 + HKEY_LOCAL_MACHINE = 0x80000002 + RRF_RT_REG_SZ = 0x00000002 + RRF_RT_REG_DWORD = 0x00000010 + PDH_FMT_LONG = 0x00000100 + PDH_FMT_DOUBLE = 0x00000200 + PDH_FMT_LARGE = 0x00000400 + PDH_INVALID_DATA = 0xc0000bc6 + PDH_INVALID_HANDLE = 0xC0000bbc + PDH_NO_DATA = 0x800007d5 +) + +var ( + Modkernel32 = syscall.NewLazyDLL("kernel32.dll") + ModNt = syscall.NewLazyDLL("ntdll.dll") + ModPdh = syscall.NewLazyDLL("pdh.dll") + + ProcGetSystemTimes = Modkernel32.NewProc("GetSystemTimes") + ProcNtQuerySystemInformation = ModNt.NewProc("NtQuerySystemInformation") + PdhOpenQuery = ModPdh.NewProc("PdhOpenQuery") + PdhAddCounter = ModPdh.NewProc("PdhAddCounterW") + PdhCollectQueryData = ModPdh.NewProc("PdhCollectQueryData") + PdhGetFormattedCounterValue = ModPdh.NewProc("PdhGetFormattedCounterValue") + PdhCloseQuery = ModPdh.NewProc("PdhCloseQuery") +) + +type FILETIME struct { + DwLowDateTime uint32 + DwHighDateTime uint32 +} + +// borrowed from net/interface_windows.go +func BytePtrToString(p *uint8) string { + a := (*[10000]uint8)(unsafe.Pointer(p)) + i := 0 + for a[i] != 0 { + i++ + } + return string(a[:i]) +} + +// CounterInfo +// copied from https://github.com/mackerelio/mackerel-agent/ +type CounterInfo struct { + PostName string + CounterName string + Counter syscall.Handle +} + +// CreateQuery XXX +// copied from https://github.com/mackerelio/mackerel-agent/ +func CreateQuery() (syscall.Handle, error) { + var query syscall.Handle + r, _, err := PdhOpenQuery.Call(0, 0, uintptr(unsafe.Pointer(&query))) + if r != 0 { + return 0, err + } + return query, nil +} + +// CreateCounter XXX +func CreateCounter(query syscall.Handle, pname, cname string) (*CounterInfo, error) { + var counter syscall.Handle + r, _, err := PdhAddCounter.Call( + uintptr(query), + uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(cname))), + 0, + uintptr(unsafe.Pointer(&counter))) + if r != 0 { + return nil, err + } + return &CounterInfo{ + PostName: pname, + CounterName: cname, + Counter: counter, + }, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load.go new file mode 100644 index 00000000..dfe32a1e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load.go @@ -0,0 +1,35 @@ +package load + +import ( + "encoding/json" + + "github.com/shirou/gopsutil/internal/common" +) + +var invoke common.Invoker + +func init() { + invoke = common.Invoke{} +} + +type AvgStat struct { + Load1 float64 `json:"load1"` + Load5 float64 `json:"load5"` + Load15 float64 `json:"load15"` +} + +func (l AvgStat) String() string { + s, _ := json.Marshal(l) + return string(s) +} + +type MiscStat struct { + ProcsRunning int `json:"procsRunning"` + ProcsBlocked int `json:"procsBlocked"` + Ctxt int `json:"ctxt"` +} + +func (m MiscStat) String() string { + s, _ := json.Marshal(m) + return string(s) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_darwin.go new file mode 100644 index 00000000..34e0653a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_darwin.go @@ -0,0 +1,67 @@ +// +build darwin + +package load + +import ( + "os/exec" + "strconv" + "strings" + + "github.com/shirou/gopsutil/internal/common" +) + +func Avg() (*AvgStat, error) { + values, err := common.DoSysctrl("vm.loadavg") + if err != nil { + return nil, err + } + + load1, err := strconv.ParseFloat(values[0], 64) + if err != nil { + return nil, err + } + load5, err := strconv.ParseFloat(values[1], 64) + if err != nil { + return nil, err + } + load15, err := strconv.ParseFloat(values[2], 64) + if err != nil { + return nil, err + } + + ret := &AvgStat{ + Load1: float64(load1), + Load5: float64(load5), + Load15: float64(load15), + } + + return ret, nil +} + +// Misc returnes miscellaneous host-wide statistics. +// darwin use ps command to get process running/blocked count. +// Almost same as FreeBSD implementation, but state is different. +// U means 'Uninterruptible Sleep'. +func Misc() (*MiscStat, error) { + bin, err := exec.LookPath("ps") + if err != nil { + return nil, err + } + out, err := invoke.Command(bin, "axo", "state") + if err != nil { + return nil, err + } + lines := strings.Split(string(out), "\n") + + ret := MiscStat{} + for _, l := range lines { + if strings.Contains(l, "R") { + ret.ProcsRunning++ + } else if strings.Contains(l, "U") { + // uninterruptible sleep == blocked + ret.ProcsBlocked++ + } + } + + return &ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_freebsd.go new file mode 100644 index 00000000..6d3a0baf --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_freebsd.go @@ -0,0 +1,65 @@ +// +build freebsd + +package load + +import ( + "os/exec" + "strconv" + "strings" + + "github.com/shirou/gopsutil/internal/common" +) + +func Avg() (*AvgStat, error) { + values, err := common.DoSysctrl("vm.loadavg") + if err != nil { + return nil, err + } + + load1, err := strconv.ParseFloat(values[0], 64) + if err != nil { + return nil, err + } + load5, err := strconv.ParseFloat(values[1], 64) + if err != nil { + return nil, err + } + load15, err := strconv.ParseFloat(values[2], 64) + if err != nil { + return nil, err + } + + ret := &AvgStat{ + Load1: float64(load1), + Load5: float64(load5), + Load15: float64(load15), + } + + return ret, nil +} + +// Misc returnes miscellaneous host-wide statistics. +// darwin use ps command to get process running/blocked count. +// Almost same as Darwin implementation, but state is different. +func Misc() (*MiscStat, error) { + bin, err := exec.LookPath("ps") + if err != nil { + return nil, err + } + out, err := invoke.Command(bin, "axo", "state") + if err != nil { + return nil, err + } + lines := strings.Split(string(out), "\n") + + ret := MiscStat{} + for _, l := range lines { + if strings.Contains(l, "R") { + ret.ProcsRunning++ + } else if strings.Contains(l, "D") { + ret.ProcsBlocked++ + } + } + + return &ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_linux.go new file mode 100644 index 00000000..c455397b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_linux.go @@ -0,0 +1,78 @@ +// +build linux + +package load + +import ( + "io/ioutil" + "strconv" + "strings" + + "github.com/shirou/gopsutil/internal/common" +) + +func Avg() (*AvgStat, error) { + filename := common.HostProc("loadavg") + line, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + + values := strings.Fields(string(line)) + + load1, err := strconv.ParseFloat(values[0], 64) + if err != nil { + return nil, err + } + load5, err := strconv.ParseFloat(values[1], 64) + if err != nil { + return nil, err + } + load15, err := strconv.ParseFloat(values[2], 64) + if err != nil { + return nil, err + } + + ret := &AvgStat{ + Load1: load1, + Load5: load5, + Load15: load15, + } + + return ret, nil +} + +// Misc returnes miscellaneous host-wide statistics. +// Note: the name should be changed near future. +func Misc() (*MiscStat, error) { + filename := common.HostProc("stat") + out, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + + ret := &MiscStat{} + lines := strings.Split(string(out), "\n") + for _, line := range lines { + fields := strings.Fields(line) + if len(fields) != 2 { + continue + } + v, err := strconv.ParseInt(fields[1], 10, 64) + if err != nil { + continue + } + switch fields[0] { + case "procs_running": + ret.ProcsRunning = int(v) + case "procs_blocked": + ret.ProcsBlocked = int(v) + case "ctxt": + ret.Ctxt = int(v) + default: + continue + } + + } + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_windows.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_windows.go new file mode 100644 index 00000000..c45c1544 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/load/load_windows.go @@ -0,0 +1,19 @@ +// +build windows + +package load + +import ( + "github.com/shirou/gopsutil/internal/common" +) + +func Avg() (*AvgStat, error) { + ret := AvgStat{} + + return &ret, common.ErrNotImplementedError +} + +func Misc() (*MiscStat, error) { + ret := MiscStat{} + + return &ret, common.ErrNotImplementedError +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem.go new file mode 100644 index 00000000..5f122d11 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem.go @@ -0,0 +1,64 @@ +package mem + +import ( + "encoding/json" +) + +// Memory usage statistics. Total, Available and Used contain numbers of bytes +// for human consumption. +// +// The other fields in this struct contain kernel specific values. +type VirtualMemoryStat struct { + // Total amount of RAM on this system + Total uint64 `json:"total"` + + // RAM available for programs to allocate + // + // This value is computed from the kernel specific values. + Available uint64 `json:"available"` + + // RAM used by programs + // + // This value is computed from the kernel specific values. + Used uint64 `json:"used"` + + // Percentage of RAM used by programs + // + // This value is computed from the kernel specific values. + UsedPercent float64 `json:"usedPercent"` + + // This is the kernel's notion of free memory; RAM chips whose bits nobody + // cares about the value of right now. For a human consumable number, + // Available is what you really want. + Free uint64 `json:"free"` + + // OS X / BSD specific numbers: + // http://www.macyourself.com/2010/02/17/what-is-free-wired-active-and-inactive-system-memory-ram/ + Active uint64 `json:"active"` + Inactive uint64 `json:"inactive"` + Wired uint64 `json:"wired"` + + // Linux specific numbers + // https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-proc-meminfo.html + Buffers uint64 `json:"buffers"` + Cached uint64 `json:"cached"` +} + +type SwapMemoryStat struct { + Total uint64 `json:"total"` + Used uint64 `json:"used"` + Free uint64 `json:"free"` + UsedPercent float64 `json:"usedPercent"` + Sin uint64 `json:"sin"` + Sout uint64 `json:"sout"` +} + +func (m VirtualMemoryStat) String() string { + s, _ := json.Marshal(m) + return string(s) +} + +func (m SwapMemoryStat) String() string { + s, _ := json.Marshal(m) + return string(s) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_darwin.go new file mode 100644 index 00000000..922b05cb --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_darwin.go @@ -0,0 +1,69 @@ +// +build darwin + +package mem + +import ( + "encoding/binary" + "strconv" + "strings" + "syscall" + + "github.com/shirou/gopsutil/internal/common" +) + +func getHwMemsize() (uint64, error) { + totalString, err := syscall.Sysctl("hw.memsize") + if err != nil { + return 0, err + } + + // syscall.sysctl() helpfully assumes the result is a null-terminated string and + // removes the last byte of the result if it's 0 :/ + totalString += "\x00" + + total := uint64(binary.LittleEndian.Uint64([]byte(totalString))) + + return total, nil +} + +// SwapMemory returns swapinfo. +func SwapMemory() (*SwapMemoryStat, error) { + var ret *SwapMemoryStat + + swapUsage, err := common.DoSysctrl("vm.swapusage") + if err != nil { + return ret, err + } + + total := strings.Replace(swapUsage[2], "M", "", 1) + used := strings.Replace(swapUsage[5], "M", "", 1) + free := strings.Replace(swapUsage[8], "M", "", 1) + + total_v, err := strconv.ParseFloat(total, 64) + if err != nil { + return nil, err + } + used_v, err := strconv.ParseFloat(used, 64) + if err != nil { + return nil, err + } + free_v, err := strconv.ParseFloat(free, 64) + if err != nil { + return nil, err + } + + u := float64(0) + if total_v != 0 { + u = ((total_v - free_v) / total_v) * 100.0 + } + + // vm.swapusage shows "M", multiply 1000 + ret = &SwapMemoryStat{ + Total: uint64(total_v * 1000), + Used: uint64(used_v * 1000), + Free: uint64(free_v * 1000), + UsedPercent: u, + } + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_darwin_cgo.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_darwin_cgo.go new file mode 100644 index 00000000..46163197 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_darwin_cgo.go @@ -0,0 +1,53 @@ +// +build darwin +// +build cgo + +package mem + +/* +#include +*/ +import "C" + +import ( + "fmt" + "syscall" + "unsafe" +) + +// VirtualMemory returns VirtualmemoryStat. +func VirtualMemory() (*VirtualMemoryStat, error) { + count := C.mach_msg_type_number_t(C.HOST_VM_INFO_COUNT) + var vmstat C.vm_statistics_data_t + + status := C.host_statistics(C.host_t(C.mach_host_self()), + C.HOST_VM_INFO, + C.host_info_t(unsafe.Pointer(&vmstat)), + &count) + + if status != C.KERN_SUCCESS { + return nil, fmt.Errorf("host_statistics error=%d", status) + } + + pageSize := uint64(syscall.Getpagesize()) + total, err := getHwMemsize() + if err != nil { + return nil, err + } + totalCount := C.natural_t(total / pageSize) + + availableCount := vmstat.inactive_count + vmstat.free_count + usedPercent := 100 * float64(totalCount-availableCount) / float64(totalCount) + + usedCount := totalCount - availableCount + + return &VirtualMemoryStat{ + Total: total, + Available: pageSize * uint64(availableCount), + Used: pageSize * uint64(usedCount), + UsedPercent: usedPercent, + Free: pageSize * uint64(vmstat.free_count), + Active: pageSize * uint64(vmstat.active_count), + Inactive: pageSize * uint64(vmstat.inactive_count), + Wired: pageSize * uint64(vmstat.wire_count), + }, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_darwin_nocgo.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_darwin_nocgo.go new file mode 100644 index 00000000..7094802d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_darwin_nocgo.go @@ -0,0 +1,88 @@ +// +build darwin +// +build !cgo + +package mem + +import ( + "os/exec" + "strconv" + "strings" + "syscall" +) + +// Runs vm_stat and returns Free and inactive pages +func getVMStat(vms *VirtualMemoryStat) error { + vm_stat, err := exec.LookPath("vm_stat") + if err != nil { + return err + } + out, err := exec.Command(vm_stat).Output() + if err != nil { + return err + } + return parseVMStat(string(out), vms) +} + +func parseVMStat(out string, vms *VirtualMemoryStat) error { + var err error + + lines := strings.Split(out, "\n") + pagesize := uint64(syscall.Getpagesize()) + for _, line := range lines { + fields := strings.Split(line, ":") + if len(fields) < 2 { + continue + } + key := strings.TrimSpace(fields[0]) + value := strings.Trim(fields[1], " .") + switch key { + case "Pages free": + free, e := strconv.ParseUint(value, 10, 64) + if e != nil { + err = e + } + vms.Free = free * pagesize + case "Pages inactive": + inactive, e := strconv.ParseUint(value, 10, 64) + if e != nil { + err = e + } + vms.Inactive = inactive * pagesize + case "Pages active": + active, e := strconv.ParseUint(value, 10, 64) + if e != nil { + err = e + } + vms.Active = active * pagesize + case "Pages wired down": + wired, e := strconv.ParseUint(value, 10, 64) + if e != nil { + err = e + } + vms.Wired = wired * pagesize + } + } + return err +} + +// VirtualMemory returns VirtualmemoryStat. +func VirtualMemory() (*VirtualMemoryStat, error) { + ret := &VirtualMemoryStat{} + + total, err := getHwMemsize() + if err != nil { + return nil, err + } + err = getVMStat(ret) + if err != nil { + return nil, err + } + + ret.Available = ret.Free + ret.Inactive + ret.Total = total + + ret.Used = ret.Total - ret.Available + ret.UsedPercent = 100 * float64(ret.Used) / float64(ret.Total) + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_freebsd.go new file mode 100644 index 00000000..71940576 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_freebsd.go @@ -0,0 +1,134 @@ +// +build freebsd + +package mem + +import ( + "errors" + "os/exec" + "strconv" + "strings" + + "github.com/shirou/gopsutil/internal/common" +) + +func VirtualMemory() (*VirtualMemoryStat, error) { + pageSize, err := common.DoSysctrl("vm.stats.vm.v_page_size") + if err != nil { + return nil, err + } + p, err := strconv.ParseUint(pageSize[0], 10, 64) + if err != nil { + return nil, err + } + + pageCount, err := common.DoSysctrl("vm.stats.vm.v_page_count") + if err != nil { + return nil, err + } + free, err := common.DoSysctrl("vm.stats.vm.v_free_count") + if err != nil { + return nil, err + } + active, err := common.DoSysctrl("vm.stats.vm.v_active_count") + if err != nil { + return nil, err + } + inactive, err := common.DoSysctrl("vm.stats.vm.v_inactive_count") + if err != nil { + return nil, err + } + cache, err := common.DoSysctrl("vm.stats.vm.v_cache_count") + if err != nil { + return nil, err + } + buffer, err := common.DoSysctrl("vfs.bufspace") + if err != nil { + return nil, err + } + wired, err := common.DoSysctrl("vm.stats.vm.v_wire_count") + if err != nil { + return nil, err + } + + parsed := make([]uint64, 0, 7) + vv := []string{ + pageCount[0], + free[0], + active[0], + inactive[0], + cache[0], + buffer[0], + wired[0], + } + for _, target := range vv { + t, err := strconv.ParseUint(target, 10, 64) + if err != nil { + return nil, err + } + parsed = append(parsed, t) + } + + ret := &VirtualMemoryStat{ + Total: parsed[0] * p, + Free: parsed[1] * p, + Active: parsed[2] * p, + Inactive: parsed[3] * p, + Cached: parsed[4] * p, + Buffers: parsed[5], + Wired: parsed[6] * p, + } + + ret.Available = ret.Inactive + ret.Cached + ret.Free + ret.Used = ret.Total - ret.Available + ret.UsedPercent = float64(ret.Used) / float64(ret.Total) * 100.0 + + return ret, nil +} + +// Return swapinfo +// FreeBSD can have multiple swap devices. but use only first device +func SwapMemory() (*SwapMemoryStat, error) { + swapinfo, err := exec.LookPath("swapinfo") + if err != nil { + return nil, err + } + + out, err := exec.Command(swapinfo).Output() + if err != nil { + return nil, err + } + for _, line := range strings.Split(string(out), "\n") { + values := strings.Fields(line) + // skip title line + if len(values) == 0 || values[0] == "Device" { + continue + } + + u := strings.Replace(values[4], "%", "", 1) + total_v, err := strconv.ParseUint(values[1], 10, 64) + if err != nil { + return nil, err + } + used_v, err := strconv.ParseUint(values[2], 10, 64) + if err != nil { + return nil, err + } + free_v, err := strconv.ParseUint(values[3], 10, 64) + if err != nil { + return nil, err + } + up_v, err := strconv.ParseFloat(u, 64) + if err != nil { + return nil, err + } + + return &SwapMemoryStat{ + Total: total_v, + Used: used_v, + Free: free_v, + UsedPercent: up_v, + }, nil + } + + return nil, errors.New("no swap devices found") +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_linux.go new file mode 100644 index 00000000..899da83d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_linux.go @@ -0,0 +1,100 @@ +// +build linux + +package mem + +import ( + "strconv" + "strings" + "syscall" + + "github.com/shirou/gopsutil/internal/common" +) + +func VirtualMemory() (*VirtualMemoryStat, error) { + filename := common.HostProc("meminfo") + lines, _ := common.ReadLines(filename) + // flag if MemAvailable is in /proc/meminfo (kernel 3.14+) + memavail := false + + ret := &VirtualMemoryStat{} + for _, line := range lines { + fields := strings.Split(line, ":") + if len(fields) != 2 { + continue + } + key := strings.TrimSpace(fields[0]) + value := strings.TrimSpace(fields[1]) + value = strings.Replace(value, " kB", "", -1) + + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, err + } + switch key { + case "MemTotal": + ret.Total = t * 1024 + case "MemFree": + ret.Free = t * 1024 + case "MemAvailable": + memavail = true + ret.Available = t * 1024 + case "Buffers": + ret.Buffers = t * 1024 + case "Cached": + ret.Cached = t * 1024 + case "Active": + ret.Active = t * 1024 + case "Inactive": + ret.Inactive = t * 1024 + } + } + if !memavail { + ret.Available = ret.Free + ret.Buffers + ret.Cached + } + ret.Used = ret.Total - ret.Available + ret.UsedPercent = float64(ret.Total-ret.Available) / float64(ret.Total) * 100.0 + + return ret, nil +} + +func SwapMemory() (*SwapMemoryStat, error) { + sysinfo := &syscall.Sysinfo_t{} + + if err := syscall.Sysinfo(sysinfo); err != nil { + return nil, err + } + ret := &SwapMemoryStat{ + Total: uint64(sysinfo.Totalswap), + Free: uint64(sysinfo.Freeswap), + } + ret.Used = ret.Total - ret.Free + //check Infinity + if ret.Total != 0 { + ret.UsedPercent = float64(ret.Total-ret.Free) / float64(ret.Total) * 100.0 + } else { + ret.UsedPercent = 0 + } + filename := common.HostProc("vmstat") + lines, _ := common.ReadLines(filename) + for _, l := range lines { + fields := strings.Fields(l) + if len(fields) < 2 { + continue + } + switch fields[0] { + case "pswpin": + value, err := strconv.ParseUint(fields[1], 10, 64) + if err != nil { + continue + } + ret.Sin = value * 4 * 1024 + case "pswpout": + value, err := strconv.ParseUint(fields[1], 10, 64) + if err != nil { + continue + } + ret.Sout = value * 4 * 1024 + } + } + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_windows.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_windows.go new file mode 100644 index 00000000..045af49e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mem/mem_windows.go @@ -0,0 +1,50 @@ +// +build windows + +package mem + +import ( + "syscall" + "unsafe" + + "github.com/shirou/gopsutil/internal/common" +) + +var ( + procGlobalMemoryStatusEx = common.Modkernel32.NewProc("GlobalMemoryStatusEx") +) + +type memoryStatusEx struct { + cbSize uint32 + dwMemoryLoad uint32 + ullTotalPhys uint64 // in bytes + ullAvailPhys uint64 + ullTotalPageFile uint64 + ullAvailPageFile uint64 + ullTotalVirtual uint64 + ullAvailVirtual uint64 + ullAvailExtendedVirtual uint64 +} + +func VirtualMemory() (*VirtualMemoryStat, error) { + var memInfo memoryStatusEx + memInfo.cbSize = uint32(unsafe.Sizeof(memInfo)) + mem, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(&memInfo))) + if mem == 0 { + return nil, syscall.GetLastError() + } + + ret := &VirtualMemoryStat{ + Total: memInfo.ullTotalPhys, + Available: memInfo.ullAvailPhys, + UsedPercent: float64(memInfo.dwMemoryLoad), + } + + ret.Used = ret.Total - ret.Available + return ret, nil +} + +func SwapMemory() (*SwapMemoryStat, error) { + ret := &SwapMemoryStat{} + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mktypes.sh b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mktypes.sh new file mode 100644 index 00000000..7bf2e241 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/mktypes.sh @@ -0,0 +1,37 @@ + +DIRS="cpu disk docker host load mem net process" + +GOOS=`uname | tr '[:upper:]' '[:lower:]'` +ARCH=`uname -m` + +case $ARCH in + amd64) + GOARCH="amd64" + ;; + x86_64) + GOARCH="amd64" + ;; + i386) + GOARCH="386" + ;; + i686) + GOARCH="386" + ;; + arm) + GOARCH="arm" + ;; + *) + echo "unknown arch: $ARCH" + exit 1 +esac + +for DIR in $DIRS +do + if [ -e ${DIR}/types_${GOOS}.go ]; then + echo "// +build $GOOS" > ${DIR}/${DIR}_${GOOS}_${GOARCH}.go + echo "// +build $GOARCH" >> ${DIR}/${DIR}_${GOOS}_${GOARCH}.go + go tool cgo -godefs ${DIR}/types_${GOOS}.go >> ${DIR}/${DIR}_${GOOS}_${GOARCH}.go + fi +done + + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net.go new file mode 100644 index 00000000..5cdd72ac --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net.go @@ -0,0 +1,243 @@ +package net + +import ( + "encoding/json" + "fmt" + "net" + "strconv" + "strings" + "syscall" + + "github.com/shirou/gopsutil/internal/common" +) + +var invoke common.Invoker + +func init() { + invoke = common.Invoke{} +} + +type IOCountersStat struct { + Name string `json:"name"` // interface name + BytesSent uint64 `json:"bytesSent"` // number of bytes sent + BytesRecv uint64 `json:"bytesRecv"` // number of bytes received + PacketsSent uint64 `json:"packetsSent"` // number of packets sent + PacketsRecv uint64 `json:"packetsRecv"` // number of packets received + Errin uint64 `json:"errin"` // total number of errors while receiving + Errout uint64 `json:"errout"` // total number of errors while sending + Dropin uint64 `json:"dropin"` // total number of incoming packets which were dropped + Dropout uint64 `json:"dropout"` // total number of outgoing packets which were dropped (always 0 on OSX and BSD) +} + +// Addr is implemented compatibility to psutil +type Addr struct { + IP string `json:"ip"` + Port uint32 `json:"port"` +} + +type ConnectionStat struct { + Fd uint32 `json:"fd"` + Family uint32 `json:"family"` + Type uint32 `json:"type"` + Laddr Addr `json:"localaddr"` + Raddr Addr `json:"remoteaddr"` + Status string `json:"status"` + Pid int32 `json:"pid"` +} + +// System wide stats about different network protocols +type ProtoCountersStat struct { + Protocol string `json:"protocol"` + Stats map[string]int64 `json:"stats"` +} + +// NetInterfaceAddr is designed for represent interface addresses +type InterfaceAddr struct { + Addr string `json:"addr"` +} + +type InterfaceStat struct { + MTU int `json:"mtu"` // maximum transmission unit + Name string `json:"name"` // e.g., "en0", "lo0", "eth0.100" + HardwareAddr string `json:"hardwareaddr"` // IEEE MAC-48, EUI-48 and EUI-64 form + Flags []string `json:"flags"` // e.g., FlagUp, FlagLoopback, FlagMulticast + Addrs []InterfaceAddr `json:"addrs"` +} + +type FilterStat struct { + ConnTrackCount int64 `json:"conntrackCount"` + ConnTrackMax int64 `json:"conntrackMax"` +} + +var constMap = map[string]int{ + "TCP": syscall.SOCK_STREAM, + "UDP": syscall.SOCK_DGRAM, + "IPv4": syscall.AF_INET, + "IPv6": syscall.AF_INET6, +} + +func (n IOCountersStat) String() string { + s, _ := json.Marshal(n) + return string(s) +} + +func (n ConnectionStat) String() string { + s, _ := json.Marshal(n) + return string(s) +} + +func (n ProtoCountersStat) String() string { + s, _ := json.Marshal(n) + return string(s) +} + +func (a Addr) String() string { + s, _ := json.Marshal(a) + return string(s) +} + +func (n InterfaceStat) String() string { + s, _ := json.Marshal(n) + return string(s) +} + +func (n InterfaceAddr) String() string { + s, _ := json.Marshal(n) + return string(s) +} + +func Interfaces() ([]InterfaceStat, error) { + is, err := net.Interfaces() + if err != nil { + return nil, err + } + ret := make([]InterfaceStat, 0, len(is)) + for _, ifi := range is { + + var flags []string + if ifi.Flags&net.FlagUp != 0 { + flags = append(flags, "up") + } + if ifi.Flags&net.FlagBroadcast != 0 { + flags = append(flags, "broadcast") + } + if ifi.Flags&net.FlagLoopback != 0 { + flags = append(flags, "loopback") + } + if ifi.Flags&net.FlagPointToPoint != 0 { + flags = append(flags, "pointtopoint") + } + if ifi.Flags&net.FlagMulticast != 0 { + flags = append(flags, "multicast") + } + + r := InterfaceStat{ + Name: ifi.Name, + MTU: ifi.MTU, + HardwareAddr: ifi.HardwareAddr.String(), + Flags: flags, + } + addrs, err := ifi.Addrs() + if err == nil { + r.Addrs = make([]InterfaceAddr, 0, len(addrs)) + for _, addr := range addrs { + r.Addrs = append(r.Addrs, InterfaceAddr{ + Addr: addr.String(), + }) + } + + } + ret = append(ret, r) + } + + return ret, nil +} + +func getIOCountersAll(n []IOCountersStat) ([]IOCountersStat, error) { + r := IOCountersStat{ + Name: "all", + } + for _, nic := range n { + r.BytesRecv += nic.BytesRecv + r.PacketsRecv += nic.PacketsRecv + r.Errin += nic.Errin + r.Dropin += nic.Dropin + r.BytesSent += nic.BytesSent + r.PacketsSent += nic.PacketsSent + r.Errout += nic.Errout + r.Dropout += nic.Dropout + } + + return []IOCountersStat{r}, nil +} + +func parseNetLine(line string) (ConnectionStat, error) { + f := strings.Fields(line) + if len(f) < 9 { + return ConnectionStat{}, fmt.Errorf("wrong line,%s", line) + } + + pid, err := strconv.Atoi(f[1]) + if err != nil { + return ConnectionStat{}, err + } + fd, err := strconv.Atoi(strings.Trim(f[3], "u")) + if err != nil { + return ConnectionStat{}, fmt.Errorf("unknown fd, %s", f[3]) + } + netFamily, ok := constMap[f[4]] + if !ok { + return ConnectionStat{}, fmt.Errorf("unknown family, %s", f[4]) + } + netType, ok := constMap[f[7]] + if !ok { + return ConnectionStat{}, fmt.Errorf("unknown type, %s", f[7]) + } + + laddr, raddr, err := parseNetAddr(f[8]) + if err != nil { + return ConnectionStat{}, fmt.Errorf("failed to parse netaddr, %s", f[8]) + } + + n := ConnectionStat{ + Fd: uint32(fd), + Family: uint32(netFamily), + Type: uint32(netType), + Laddr: laddr, + Raddr: raddr, + Pid: int32(pid), + } + if len(f) == 10 { + n.Status = strings.Trim(f[9], "()") + } + + return n, nil +} + +func parseNetAddr(line string) (laddr Addr, raddr Addr, err error) { + parse := func(l string) (Addr, error) { + host, port, err := net.SplitHostPort(l) + if err != nil { + return Addr{}, fmt.Errorf("wrong addr, %s", l) + } + lport, err := strconv.Atoi(port) + if err != nil { + return Addr{}, err + } + return Addr{IP: host, Port: uint32(lport)}, nil + } + + addrs := strings.Split(line, "->") + if len(addrs) == 0 { + return laddr, raddr, fmt.Errorf("wrong netaddr, %s", line) + } + laddr, err = parse(addrs[0]) + if len(addrs) == 2 { // remote addr exists + raddr, err = parse(addrs[1]) + if err != nil { + return laddr, raddr, err + } + } + + return laddr, raddr, err +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_darwin.go new file mode 100644 index 00000000..4fa358a3 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_darwin.go @@ -0,0 +1,114 @@ +// +build darwin + +package net + +import ( + "errors" + "os/exec" + "strconv" + "strings" + + "github.com/shirou/gopsutil/internal/common" +) + +// example of netstat -idbn output on yosemite +// Name Mtu Network Address Ipkts Ierrs Ibytes Opkts Oerrs Obytes Coll Drop +// lo0 16384 869107 0 169411755 869107 0 169411755 0 0 +// lo0 16384 ::1/128 ::1 869107 - 169411755 869107 - 169411755 - - +// lo0 16384 127 127.0.0.1 869107 - 169411755 869107 - 169411755 - - +func IOCounters(pernic bool) ([]IOCountersStat, error) { + netstat, err := exec.LookPath("/usr/sbin/netstat") + if err != nil { + return nil, err + } + out, err := exec.Command(netstat, "-ibdnW").Output() + if err != nil { + return nil, err + } + + lines := strings.Split(string(out), "\n") + ret := make([]IOCountersStat, 0, len(lines)-1) + exists := make([]string, 0, len(ret)) + + for _, line := range lines { + values := strings.Fields(line) + if len(values) < 1 || values[0] == "Name" { + // skip first line + continue + } + if common.StringsHas(exists, values[0]) { + // skip if already get + continue + } + exists = append(exists, values[0]) + + base := 1 + // sometimes Address is ommitted + if len(values) < 11 { + base = 0 + } + + parsed := make([]uint64, 0, 7) + vv := []string{ + values[base+3], // Ipkts == PacketsRecv + values[base+4], // Ierrs == Errin + values[base+5], // Ibytes == BytesRecv + values[base+6], // Opkts == PacketsSent + values[base+7], // Oerrs == Errout + values[base+8], // Obytes == BytesSent + } + if len(values) == 12 { + vv = append(vv, values[base+10]) + } + + for _, target := range vv { + if target == "-" { + parsed = append(parsed, 0) + continue + } + + t, err := strconv.ParseUint(target, 10, 64) + if err != nil { + return nil, err + } + parsed = append(parsed, t) + } + + n := IOCountersStat{ + Name: values[0], + PacketsRecv: parsed[0], + Errin: parsed[1], + BytesRecv: parsed[2], + PacketsSent: parsed[3], + Errout: parsed[4], + BytesSent: parsed[5], + } + if len(parsed) == 7 { + n.Dropout = parsed[6] + } + ret = append(ret, n) + } + + if pernic == false { + return getIOCountersAll(ret) + } + + return ret, nil +} + +// NetIOCountersByFile is an method which is added just a compatibility for linux. +func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) { + return IOCounters(pernic) +} + +func FilterCounters() ([]FilterStat, error) { + return nil, errors.New("NetFilterCounters not implemented for darwin") +} + +// NetProtoCounters returns network statistics for the entire system +// If protocols is empty then all protocols are returned, otherwise +// just the protocols in the list are returned. +// Not Implemented for Darwin +func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { + return nil, errors.New("NetProtoCounters not implemented for darwin") +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_freebsd.go new file mode 100644 index 00000000..3a67b4af --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_freebsd.go @@ -0,0 +1,108 @@ +// +build freebsd + +package net + +import ( + "errors" + "os/exec" + "strconv" + "strings" + + "github.com/shirou/gopsutil/internal/common" +) + +func IOCounters(pernic bool) ([]IOCountersStat, error) { + netstat, err := exec.LookPath("/usr/bin/netstat") + if err != nil { + return nil, err + } + out, err := exec.Command(netstat, "-ibdnW").Output() + if err != nil { + return nil, err + } + + lines := strings.Split(string(out), "\n") + ret := make([]IOCountersStat, 0, len(lines)-1) + exists := make([]string, 0, len(ret)) + + for _, line := range lines { + values := strings.Fields(line) + if len(values) < 1 || values[0] == "Name" { + continue + } + if common.StringsHas(exists, values[0]) { + // skip if already get + continue + } + exists = append(exists, values[0]) + + if len(values) < 12 { + continue + } + base := 1 + // sometimes Address is ommitted + if len(values) < 13 { + base = 0 + } + + parsed := make([]uint64, 0, 8) + vv := []string{ + values[base+3], // PacketsRecv + values[base+4], // Errin + values[base+5], // Dropin + values[base+6], // BytesRecvn + values[base+7], // PacketSent + values[base+8], // Errout + values[base+9], // BytesSent + values[base+11], // Dropout + } + for _, target := range vv { + if target == "-" { + parsed = append(parsed, 0) + continue + } + + t, err := strconv.ParseUint(target, 10, 64) + if err != nil { + return nil, err + } + parsed = append(parsed, t) + } + + n := IOCountersStat{ + Name: values[0], + PacketsRecv: parsed[0], + Errin: parsed[1], + Dropin: parsed[2], + BytesRecv: parsed[3], + PacketsSent: parsed[4], + Errout: parsed[5], + BytesSent: parsed[6], + Dropout: parsed[7], + } + ret = append(ret, n) + } + + if pernic == false { + return getIOCountersAll(ret) + } + + return ret, nil +} + +// NetIOCountersByFile is an method which is added just a compatibility for linux. +func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) { + return IOCounters(pernic) +} + +func FilterCounters() ([]FilterStat, error) { + return nil, errors.New("NetFilterCounters not implemented for freebsd") +} + +// NetProtoCounters returns network statistics for the entire system +// If protocols is empty then all protocols are returned, otherwise +// just the protocols in the list are returned. +// Not Implemented for FreeBSD +func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { + return nil, errors.New("NetProtoCounters not implemented for freebsd") +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_linux.go new file mode 100644 index 00000000..e0247714 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_linux.go @@ -0,0 +1,620 @@ +// +build linux + +package net + +import ( + "encoding/hex" + "errors" + "fmt" + "io/ioutil" + "net" + "os" + "strconv" + "strings" + "syscall" + + "github.com/shirou/gopsutil/internal/common" +) + +// NetIOCounters returnes network I/O statistics for every network +// interface installed on the system. If pernic argument is false, +// return only sum of all information (which name is 'all'). If true, +// every network interface installed on the system is returned +// separately. +func IOCounters(pernic bool) ([]IOCountersStat, error) { + filename := common.HostProc("net/dev") + return IOCountersByFile(pernic, filename) +} + +func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) { + lines, err := common.ReadLines(filename) + if err != nil { + return nil, err + } + + statlen := len(lines) - 1 + + ret := make([]IOCountersStat, 0, statlen) + + for _, line := range lines[2:] { + parts := strings.SplitN(line, ":", 2) + if len(parts) != 2 { + continue + } + interfaceName := strings.TrimSpace(parts[0]) + if interfaceName == "" { + continue + } + + fields := strings.Fields(strings.TrimSpace(parts[1])) + bytesRecv, err := strconv.ParseUint(fields[0], 10, 64) + if err != nil { + return ret, err + } + packetsRecv, err := strconv.ParseUint(fields[1], 10, 64) + if err != nil { + return ret, err + } + errIn, err := strconv.ParseUint(fields[2], 10, 64) + if err != nil { + return ret, err + } + dropIn, err := strconv.ParseUint(fields[3], 10, 64) + if err != nil { + return ret, err + } + bytesSent, err := strconv.ParseUint(fields[8], 10, 64) + if err != nil { + return ret, err + } + packetsSent, err := strconv.ParseUint(fields[9], 10, 64) + if err != nil { + return ret, err + } + errOut, err := strconv.ParseUint(fields[10], 10, 64) + if err != nil { + return ret, err + } + dropOut, err := strconv.ParseUint(fields[13], 10, 64) + if err != nil { + return ret, err + } + + nic := IOCountersStat{ + Name: interfaceName, + BytesRecv: bytesRecv, + PacketsRecv: packetsRecv, + Errin: errIn, + Dropin: dropIn, + BytesSent: bytesSent, + PacketsSent: packetsSent, + Errout: errOut, + Dropout: dropOut, + } + ret = append(ret, nic) + } + + if pernic == false { + return getIOCountersAll(ret) + } + + return ret, nil +} + +var netProtocols = []string{ + "ip", + "icmp", + "icmpmsg", + "tcp", + "udp", + "udplite", +} + +// NetProtoCounters returns network statistics for the entire system +// If protocols is empty then all protocols are returned, otherwise +// just the protocols in the list are returned. +// Available protocols: +// ip,icmp,icmpmsg,tcp,udp,udplite +func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { + if len(protocols) == 0 { + protocols = netProtocols + } + + stats := make([]ProtoCountersStat, 0, len(protocols)) + protos := make(map[string]bool, len(protocols)) + for _, p := range protocols { + protos[p] = true + } + + filename := common.HostProc("net/snmp") + lines, err := common.ReadLines(filename) + if err != nil { + return nil, err + } + + linecount := len(lines) + for i := 0; i < linecount; i++ { + line := lines[i] + r := strings.IndexRune(line, ':') + if r == -1 { + return nil, errors.New(filename + " is not fomatted correctly, expected ':'.") + } + proto := strings.ToLower(line[:r]) + if !protos[proto] { + // skip protocol and data line + i++ + continue + } + + // Read header line + statNames := strings.Split(line[r+2:], " ") + + // Read data line + i++ + statValues := strings.Split(lines[i][r+2:], " ") + if len(statNames) != len(statValues) { + return nil, errors.New(filename + " is not fomatted correctly, expected same number of columns.") + } + stat := ProtoCountersStat{ + Protocol: proto, + Stats: make(map[string]int64, len(statNames)), + } + for j := range statNames { + value, err := strconv.ParseInt(statValues[j], 10, 64) + if err != nil { + return nil, err + } + stat.Stats[statNames[j]] = value + } + stats = append(stats, stat) + } + return stats, nil +} + +// NetFilterCounters returns iptables conntrack statistics +// the currently in use conntrack count and the max. +// If the file does not exist or is invalid it will return nil. +func FilterCounters() ([]FilterStat, error) { + countfile := common.HostProc("sys/net/netfilter/nf_conntrackCount") + maxfile := common.HostProc("sys/net/netfilter/nf_conntrackMax") + + count, err := common.ReadInts(countfile) + + if err != nil { + return nil, err + } + stats := make([]FilterStat, 0, 1) + + max, err := common.ReadInts(maxfile) + if err != nil { + return nil, err + } + + payload := FilterStat{ + ConnTrackCount: count[0], + ConnTrackMax: max[0], + } + + stats = append(stats, payload) + return stats, nil +} + +// http://students.mimuw.edu.pl/lxr/source/include/net/tcp_states.h +var TCPStatuses = map[string]string{ + "01": "ESTABLISHED", + "02": "SYN_SENT", + "03": "SYN_RECV", + "04": "FIN_WAIT1", + "05": "FIN_WAIT2", + "06": "TIME_WAIT", + "07": "CLOSE", + "08": "CLOSE_WAIT", + "09": "LAST_ACK", + "0A": "LISTEN", + "0B": "CLOSING", +} + +type netConnectionKindType struct { + family uint32 + sockType uint32 + filename string +} + +var kindTCP4 = netConnectionKindType{ + family: syscall.AF_INET, + sockType: syscall.SOCK_STREAM, + filename: "tcp", +} +var kindTCP6 = netConnectionKindType{ + family: syscall.AF_INET6, + sockType: syscall.SOCK_STREAM, + filename: "tcp6", +} +var kindUDP4 = netConnectionKindType{ + family: syscall.AF_INET, + sockType: syscall.SOCK_DGRAM, + filename: "udp", +} +var kindUDP6 = netConnectionKindType{ + family: syscall.AF_INET6, + sockType: syscall.SOCK_DGRAM, + filename: "udp6", +} +var kindUNIX = netConnectionKindType{ + family: syscall.AF_UNIX, + filename: "unix", +} + +var netConnectionKindMap = map[string][]netConnectionKindType{ + "all": []netConnectionKindType{kindTCP4, kindTCP6, kindUDP4, kindUDP6, kindUNIX}, + "tcp": []netConnectionKindType{kindTCP4, kindTCP6}, + "tcp4": []netConnectionKindType{kindTCP4}, + "tcp6": []netConnectionKindType{kindTCP6}, + "udp": []netConnectionKindType{kindUDP4, kindUDP6}, + "udp4": []netConnectionKindType{kindUDP4}, + "udp6": []netConnectionKindType{kindUDP6}, + "unix": []netConnectionKindType{kindUNIX}, + "inet": []netConnectionKindType{kindTCP4, kindTCP6, kindUDP4, kindUDP6}, + "inet4": []netConnectionKindType{kindTCP4, kindUDP4}, + "inet6": []netConnectionKindType{kindTCP6, kindUDP6}, +} + +type inodeMap struct { + pid int32 + fd uint32 +} + +type connTmp struct { + fd uint32 + family uint32 + sockType uint32 + laddr Addr + raddr Addr + status string + pid int32 + boundPid int32 + path string +} + +// Return a list of network connections opened. +func Connections(kind string) ([]ConnectionStat, error) { + return ConnectionsPid(kind, 0) +} + +// Return a list of network connections opened by a process. +func ConnectionsPid(kind string, pid int32) ([]ConnectionStat, error) { + tmap, ok := netConnectionKindMap[kind] + if !ok { + return nil, fmt.Errorf("invalid kind, %s", kind) + } + root := common.HostProc() + var err error + var inodes map[string][]inodeMap + if pid == 0 { + inodes, err = getProcInodesAll(root) + } else { + inodes, err = getProcInodes(root, pid) + if len(inodes) == 0 { + // no connection for the pid + return []ConnectionStat{}, nil + } + } + if err != nil { + return nil, fmt.Errorf("cound not get pid(s), %d", pid) + } + + dupCheckMap := make(map[string]bool) + var ret []ConnectionStat + + for _, t := range tmap { + var path string + var ls []connTmp + path = fmt.Sprintf("%s/net/%s", root, t.filename) + switch t.family { + case syscall.AF_INET: + fallthrough + case syscall.AF_INET6: + ls, err = processInet(path, t, inodes, pid) + case syscall.AF_UNIX: + ls, err = processUnix(path, t, inodes, pid) + } + if err != nil { + return nil, err + } + for _, c := range ls { + conn := ConnectionStat{ + Fd: c.fd, + Family: c.family, + Type: c.sockType, + Laddr: c.laddr, + Raddr: c.raddr, + Status: c.status, + Pid: c.pid, + } + if c.pid == 0 { + conn.Pid = c.boundPid + } else { + conn.Pid = c.pid + } + // check duplicate using JSON format + json := conn.String() + _, exists := dupCheckMap[json] + if !exists { + ret = append(ret, conn) + dupCheckMap[json] = true + } + } + + } + + return ret, nil +} + +// getProcInodes returnes fd of the pid. +func getProcInodes(root string, pid int32) (map[string][]inodeMap, error) { + ret := make(map[string][]inodeMap) + + dir := fmt.Sprintf("%s/%d/fd", root, pid) + files, err := ioutil.ReadDir(dir) + if err != nil { + return ret, nil + } + for _, fd := range files { + inodePath := fmt.Sprintf("%s/%d/fd/%s", root, pid, fd.Name()) + + inode, err := os.Readlink(inodePath) + if err != nil { + continue + } + if !strings.HasPrefix(inode, "socket:[") { + continue + } + // the process is using a socket + l := len(inode) + inode = inode[8 : l-1] + _, ok := ret[inode] + if !ok { + ret[inode] = make([]inodeMap, 0) + } + fd, err := strconv.Atoi(fd.Name()) + if err != nil { + continue + } + + i := inodeMap{ + pid: pid, + fd: uint32(fd), + } + ret[inode] = append(ret[inode], i) + } + return ret, nil +} + +// Pids retunres all pids. +// Note: this is a copy of process_linux.Pids() +// FIXME: Import process occures import cycle. +// move to common made other platform breaking. Need consider. +func Pids() ([]int32, error) { + var ret []int32 + + d, err := os.Open(common.HostProc()) + if err != nil { + return nil, err + } + defer d.Close() + + fnames, err := d.Readdirnames(-1) + if err != nil { + return nil, err + } + for _, fname := range fnames { + pid, err := strconv.ParseInt(fname, 10, 32) + if err != nil { + // if not numeric name, just skip + continue + } + ret = append(ret, int32(pid)) + } + + return ret, nil +} + +func getProcInodesAll(root string) (map[string][]inodeMap, error) { + pids, err := Pids() + if err != nil { + return nil, err + } + ret := make(map[string][]inodeMap) + + for _, pid := range pids { + t, err := getProcInodes(root, pid) + if err != nil { + return ret, err + } + if len(t) == 0 { + continue + } + // TODO: update ret. + ret = updateMap(ret, t) + } + return ret, nil +} + +// decodeAddress decode addresse represents addr in proc/net/* +// ex: +// "0500000A:0016" -> "10.0.0.5", 22 +// "0085002452100113070057A13F025401:0035" -> "2400:8500:1301:1052:a157:7:154:23f", 53 +func decodeAddress(family uint32, src string) (Addr, error) { + t := strings.Split(src, ":") + if len(t) != 2 { + return Addr{}, fmt.Errorf("does not contain port, %s", src) + } + addr := t[0] + port, err := strconv.ParseInt("0x"+t[1], 0, 64) + if err != nil { + return Addr{}, fmt.Errorf("invalid port, %s", src) + } + decoded, err := hex.DecodeString(addr) + if err != nil { + return Addr{}, fmt.Errorf("decode error, %s", err) + } + var ip net.IP + // Assumes this is little_endian + if family == syscall.AF_INET { + ip = net.IP(Reverse(decoded)) + } else { // IPv6 + ip, err = parseIPv6HexString(decoded) + if err != nil { + return Addr{}, err + } + } + return Addr{ + IP: ip.String(), + Port: uint32(port), + }, nil +} + +// Reverse reverses array of bytes. +func Reverse(s []byte) []byte { + for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { + s[i], s[j] = s[j], s[i] + } + return s +} + +// parseIPv6HexString parse array of bytes to IPv6 string +func parseIPv6HexString(src []byte) (net.IP, error) { + if len(src) != 16 { + return nil, fmt.Errorf("invalid IPv6 string") + } + + buf := make([]byte, 0, 16) + for i := 0; i < len(src); i += 4 { + r := Reverse(src[i : i+4]) + buf = append(buf, r...) + } + return net.IP(buf), nil +} + +func processInet(file string, kind netConnectionKindType, inodes map[string][]inodeMap, filterPid int32) ([]connTmp, error) { + + if strings.HasSuffix(file, "6") && !common.PathExists(file) { + // IPv6 not supported, return empty. + return []connTmp{}, nil + } + lines, err := common.ReadLines(file) + if err != nil { + return nil, err + } + var ret []connTmp + // skip first line + for _, line := range lines[1:] { + l := strings.Fields(line) + if len(l) < 10 { + continue + } + laddr := l[1] + raddr := l[2] + status := l[3] + inode := l[9] + pid := int32(0) + fd := uint32(0) + i, exists := inodes[inode] + if exists { + pid = i[0].pid + fd = i[0].fd + } + if filterPid > 0 && filterPid != pid { + continue + } + if kind.sockType == syscall.SOCK_STREAM { + status = TCPStatuses[status] + } else { + status = "NONE" + } + la, err := decodeAddress(kind.family, laddr) + if err != nil { + continue + } + ra, err := decodeAddress(kind.family, raddr) + if err != nil { + continue + } + + ret = append(ret, connTmp{ + fd: fd, + family: kind.family, + sockType: kind.sockType, + laddr: la, + raddr: ra, + status: status, + pid: pid, + }) + } + + return ret, nil +} + +func processUnix(file string, kind netConnectionKindType, inodes map[string][]inodeMap, filterPid int32) ([]connTmp, error) { + lines, err := common.ReadLines(file) + if err != nil { + return nil, err + } + + var ret []connTmp + // skip first line + for _, line := range lines[1:] { + tokens := strings.Fields(line) + if len(tokens) < 6 { + continue + } + st, err := strconv.Atoi(tokens[4]) + if err != nil { + return nil, err + } + + inode := tokens[6] + + var pairs []inodeMap + pairs, exists := inodes[inode] + if !exists { + pairs = []inodeMap{ + inodeMap{}, + } + } + for _, pair := range pairs { + if filterPid > 0 && filterPid != pair.pid { + continue + } + var path string + if len(tokens) == 8 { + path = tokens[len(tokens)-1] + } + ret = append(ret, connTmp{ + fd: pair.fd, + family: kind.family, + sockType: uint32(st), + laddr: Addr{ + IP: path, + }, + pid: pair.pid, + status: "NONE", + path: path, + }) + } + } + + return ret, nil +} + +func updateMap(src map[string][]inodeMap, add map[string][]inodeMap) map[string][]inodeMap { + for key, value := range add { + a, exists := src[key] + if !exists { + src[key] = value + continue + } + src[key] = append(a, value...) + } + return src +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_unix.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_unix.go new file mode 100644 index 00000000..45de6b17 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_unix.go @@ -0,0 +1,68 @@ +// +build freebsd darwin + +package net + +import ( + "strings" + + "github.com/shirou/gopsutil/internal/common" +) + +// Return a list of network connections opened. +func Connections(kind string) ([]ConnectionStat, error) { + return ConnectionsPid(kind, 0) +} + +// Return a list of network connections opened by a process. +func ConnectionsPid(kind string, pid int32) ([]ConnectionStat, error) { + var ret []ConnectionStat + + args := []string{"-i"} + switch strings.ToLower(kind) { + default: + fallthrough + case "": + fallthrough + case "all": + fallthrough + case "inet": + args = append(args, "tcp", "-i", "udp") + case "inet4": + args = append(args, "4") + case "inet6": + args = append(args, "6") + case "tcp": + args = append(args, "tcp") + case "tcp4": + args = append(args, "4tcp") + case "tcp6": + args = append(args, "6tcp") + case "udp": + args = append(args, "udp") + case "udp4": + args = append(args, "6udp") + case "udp6": + args = append(args, "6udp") + case "unix": + return ret, common.ErrNotImplementedError + } + + r, err := common.CallLsof(invoke, pid, args...) + if err != nil { + return nil, err + } + for _, rr := range r { + if strings.HasPrefix(rr, "COMMAND") { + continue + } + n, err := parseNetLine(rr) + if err != nil { + + continue + } + + ret = append(ret, n) + } + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_windows.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_windows.go new file mode 100644 index 00000000..f125260c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/net/net_windows.go @@ -0,0 +1,116 @@ +// +build windows + +package net + +import ( + "errors" + "net" + "os" + "syscall" + "unsafe" + + "github.com/shirou/gopsutil/internal/common" +) + +var ( + modiphlpapi = syscall.NewLazyDLL("iphlpapi.dll") + procGetExtendedTCPTable = modiphlpapi.NewProc("GetExtendedTcpTable") + procGetExtendedUDPTable = modiphlpapi.NewProc("GetExtendedUdpTable") +) + +const ( + TCPTableBasicListener = iota + TCPTableBasicConnections + TCPTableBasicAll + TCPTableOwnerPIDListener + TCPTableOwnerPIDConnections + TCPTableOwnerPIDAll + TCPTableOwnerModuleListener + TCPTableOwnerModuleConnections + TCPTableOwnerModuleAll +) + +func IOCounters(pernic bool) ([]IOCountersStat, error) { + ifs, err := net.Interfaces() + if err != nil { + return nil, err + } + + ai, err := getAdapterList() + if err != nil { + return nil, err + } + var ret []IOCountersStat + + for _, ifi := range ifs { + name := ifi.Name + for ; ai != nil; ai = ai.Next { + name = common.BytePtrToString(&ai.Description[0]) + c := IOCountersStat{ + Name: name, + } + + row := syscall.MibIfRow{Index: ai.Index} + e := syscall.GetIfEntry(&row) + if e != nil { + return nil, os.NewSyscallError("GetIfEntry", e) + } + c.BytesSent = uint64(row.OutOctets) + c.BytesRecv = uint64(row.InOctets) + c.PacketsSent = uint64(row.OutUcastPkts) + c.PacketsRecv = uint64(row.InUcastPkts) + c.Errin = uint64(row.InErrors) + c.Errout = uint64(row.OutErrors) + c.Dropin = uint64(row.InDiscards) + c.Dropout = uint64(row.OutDiscards) + + ret = append(ret, c) + } + } + + if pernic == false { + return getIOCountersAll(ret) + } + return ret, nil +} + +// NetIOCountersByFile is an method which is added just a compatibility for linux. +func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) { + return IOCounters(pernic) +} + +// Return a list of network connections opened by a process +func Connections(kind string) ([]ConnectionStat, error) { + var ret []ConnectionStat + + return ret, common.ErrNotImplementedError +} + +// borrowed from src/pkg/net/interface_windows.go +func getAdapterList() (*syscall.IpAdapterInfo, error) { + b := make([]byte, 1000) + l := uint32(len(b)) + a := (*syscall.IpAdapterInfo)(unsafe.Pointer(&b[0])) + err := syscall.GetAdaptersInfo(a, &l) + if err == syscall.ERROR_BUFFER_OVERFLOW { + b = make([]byte, l) + a = (*syscall.IpAdapterInfo)(unsafe.Pointer(&b[0])) + err = syscall.GetAdaptersInfo(a, &l) + } + if err != nil { + return nil, os.NewSyscallError("GetAdaptersInfo", err) + } + return a, nil +} + +func FilterCounters() ([]FilterStat, error) { + return nil, errors.New("NetFilterCounters not implemented for windows") +} + +// NetProtoCounters returns network statistics for the entire system +// If protocols is empty then all protocols are returned, otherwise +// just the protocols in the list are returned. +// Not Implemented for Windows +func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { + return nil, errors.New("NetProtoCounters not implemented for windows") +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/expected/darwin/%2Fbin%2Fps-ax-opid_fail b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/expected/darwin/%2Fbin%2Fps-ax-opid_fail new file mode 100644 index 00000000..fce59efc --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/expected/darwin/%2Fbin%2Fps-ax-opid_fail @@ -0,0 +1,10 @@ + PID + 245 + 247 + 248 + 249 + 254 + 262 + 264 + 265 + 267 diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process.go new file mode 100644 index 00000000..2b9d6854 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process.go @@ -0,0 +1,166 @@ +package process + +import ( + "encoding/json" + "runtime" + "time" + + "github.com/shirou/gopsutil/cpu" + "github.com/shirou/gopsutil/internal/common" + "github.com/shirou/gopsutil/mem" +) + +var invoke common.Invoker + +func init() { + invoke = common.Invoke{} +} + +type Process struct { + Pid int32 `json:"pid"` + name string + status string + numCtxSwitches *NumCtxSwitchesStat + uids []int32 + gids []int32 + numThreads int32 + memInfo *MemoryInfoStat + + lastCPUTimes *cpu.TimesStat + lastCPUTime time.Time +} + +type OpenFilesStat struct { + Path string `json:"path"` + Fd uint64 `json:"fd"` +} + +type MemoryInfoStat struct { + RSS uint64 `json:"rss"` // bytes + VMS uint64 `json:"vms"` // bytes + Swap uint64 `json:"swap"` // bytes +} + +type RlimitStat struct { + Resource int32 `json:"resource"` + Soft int32 `json:"soft"` + Hard int32 `json:"hard"` +} + +type IOCountersStat struct { + ReadCount uint64 `json:"readCount"` + WriteCount uint64 `json:"writeCount"` + ReadBytes uint64 `json:"readBytes"` + WriteBytes uint64 `json:"writeBytes"` +} + +type NumCtxSwitchesStat struct { + Voluntary int64 `json:"voluntary"` + Involuntary int64 `json:"involuntary"` +} + +func (p Process) String() string { + s, _ := json.Marshal(p) + return string(s) +} + +func (o OpenFilesStat) String() string { + s, _ := json.Marshal(o) + return string(s) +} + +func (m MemoryInfoStat) String() string { + s, _ := json.Marshal(m) + return string(s) +} + +func (r RlimitStat) String() string { + s, _ := json.Marshal(r) + return string(s) +} + +func (i IOCountersStat) String() string { + s, _ := json.Marshal(i) + return string(s) +} + +func (p NumCtxSwitchesStat) String() string { + s, _ := json.Marshal(p) + return string(s) +} + +func PidExists(pid int32) (bool, error) { + pids, err := Pids() + if err != nil { + return false, err + } + + for _, i := range pids { + if i == pid { + return true, err + } + } + + return false, err +} + +// If interval is 0, return difference from last call(non-blocking). +// If interval > 0, wait interval sec and return diffrence between start and end. +func (p *Process) Percent(interval time.Duration) (float64, error) { + cpuTimes, err := p.Times() + if err != nil { + return 0, err + } + now := time.Now() + + if interval > 0 { + p.lastCPUTimes = cpuTimes + p.lastCPUTime = now + time.Sleep(interval) + cpuTimes, err = p.Times() + now = time.Now() + if err != nil { + return 0, err + } + } else { + if p.lastCPUTimes == nil { + // invoked first time + p.lastCPUTimes = cpuTimes + p.lastCPUTime = now + return 0, nil + } + } + + numcpu := runtime.NumCPU() + delta := (now.Sub(p.lastCPUTime).Seconds()) * float64(numcpu) + ret := calculatePercent(p.lastCPUTimes, cpuTimes, delta, numcpu) + p.lastCPUTimes = cpuTimes + p.lastCPUTime = now + return ret, nil +} + +func calculatePercent(t1, t2 *cpu.TimesStat, delta float64, numcpu int) float64 { + if delta == 0 { + return 0 + } + delta_proc := t2.Total() - t1.Total() + overall_percent := ((delta_proc / delta) * 100) * float64(numcpu) + return overall_percent +} + +// MemoryPercent returns how many percent of the total RAM this process uses +func (p *Process) MemoryPercent() (float32, error) { + machineMemory, err := mem.VirtualMemory() + if err != nil { + return 0, err + } + total := machineMemory.Total + + processMemory, err := p.MemoryInfo() + if err != nil { + return 0, err + } + used := processMemory.RSS + + return (100 * float32(used) / float32(total)), nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_darwin.go new file mode 100644 index 00000000..cea0803e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_darwin.go @@ -0,0 +1,451 @@ +// +build darwin + +package process + +import ( + "bytes" + "encoding/binary" + "fmt" + "os/exec" + "strconv" + "strings" + "syscall" + "unsafe" + + "github.com/shirou/gopsutil/cpu" + "github.com/shirou/gopsutil/internal/common" + "github.com/shirou/gopsutil/net" +) + +// copied from sys/sysctl.h +const ( + CTLKern = 1 // "high kernel": proc, limits + KernProc = 14 // struct: process entries + KernProcPID = 1 // by process id + KernProcProc = 8 // only return procs + KernProcAll = 0 // everything + KernProcPathname = 12 // path to executable +) + +const ( + ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK) +) + +type _Ctype_struct___0 struct { + Pad uint64 +} + +// MemoryInfoExStat is different between OSes +type MemoryInfoExStat struct { +} + +type MemoryMapsStat struct { +} + +func Pids() ([]int32, error) { + var ret []int32 + + pids, err := callPs("pid", 0, false) + if err != nil { + return ret, err + } + + for _, pid := range pids { + v, err := strconv.Atoi(pid[0]) + if err != nil { + return ret, err + } + ret = append(ret, int32(v)) + } + + return ret, nil +} + +func (p *Process) Ppid() (int32, error) { + r, err := callPs("ppid", p.Pid, false) + v, err := strconv.Atoi(r[0][0]) + if err != nil { + return 0, err + } + + return int32(v), err +} +func (p *Process) Name() (string, error) { + k, err := p.getKProc() + if err != nil { + return "", err + } + + return common.IntToString(k.Proc.P_comm[:]), nil +} +func (p *Process) Exe() (string, error) { + return "", common.ErrNotImplementedError +} + +// Cmdline returns the command line arguments of the process as a string with +// each argument separated by 0x20 ascii character. +func (p *Process) Cmdline() (string, error) { + r, err := callPs("command", p.Pid, false) + if err != nil { + return "", err + } + return strings.Join(r[0], " "), err +} + +// CmdlineSlice returns the command line arguments of the process as a slice with each +// element being an argument. Because of current deficiencies in the way that the command +// line arguments are found, single arguments that have spaces in the will actually be +// reported as two separate items. In order to do something better CGO would be needed +// to use the native darwin functions. +func (p *Process) CmdlineSlice() ([]string, error) { + r, err := callPs("command", p.Pid, false) + if err != nil { + return nil, err + } + return r[0], err +} +func (p *Process) CreateTime() (int64, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Cwd() (string, error) { + return "", common.ErrNotImplementedError +} +func (p *Process) Parent() (*Process, error) { + rr, err := common.CallLsof(invoke, p.Pid, "-FR") + if err != nil { + return nil, err + } + for _, r := range rr { + if strings.HasPrefix(r, "p") { // skip if process + continue + } + l := string(r) + v, err := strconv.Atoi(strings.Replace(l, "R", "", 1)) + if err != nil { + return nil, err + } + return NewProcess(int32(v)) + } + return nil, fmt.Errorf("could not find parent line") +} +func (p *Process) Status() (string, error) { + r, err := callPs("state", p.Pid, false) + if err != nil { + return "", err + } + + return r[0][0], err +} +func (p *Process) Uids() ([]int32, error) { + k, err := p.getKProc() + if err != nil { + return nil, err + } + + // See: http://unix.superglobalmegacorp.com/Net2/newsrc/sys/ucred.h.html + userEffectiveUID := int32(k.Eproc.Ucred.UID) + + return []int32{userEffectiveUID}, nil +} +func (p *Process) Gids() ([]int32, error) { + k, err := p.getKProc() + if err != nil { + return nil, err + } + + gids := make([]int32, 0, 3) + gids = append(gids, int32(k.Eproc.Pcred.P_rgid), int32(k.Eproc.Ucred.Ngroups), int32(k.Eproc.Pcred.P_svgid)) + + return gids, nil +} +func (p *Process) Terminal() (string, error) { + return "", common.ErrNotImplementedError + /* + k, err := p.getKProc() + if err != nil { + return "", err + } + + ttyNr := uint64(k.Eproc.Tdev) + termmap, err := getTerminalMap() + if err != nil { + return "", err + } + + return termmap[ttyNr], nil + */ +} +func (p *Process) Nice() (int32, error) { + k, err := p.getKProc() + if err != nil { + return 0, err + } + return int32(k.Proc.P_nice), nil +} +func (p *Process) IOnice() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Rlimit() ([]RlimitStat, error) { + var rlimit []RlimitStat + return rlimit, common.ErrNotImplementedError +} +func (p *Process) IOCounters() (*IOCountersStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) NumFDs() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) NumThreads() (int32, error) { + r, err := callPs("utime,stime", p.Pid, true) + if err != nil { + return 0, err + } + return int32(len(r)), nil +} +func (p *Process) Threads() (map[string]string, error) { + ret := make(map[string]string, 0) + return ret, common.ErrNotImplementedError +} + +func convertCPUTimes(s string) (ret float64, err error) { + var t int + var _tmp string + if strings.Contains(s, ":") { + _t := strings.Split(s, ":") + hour, err := strconv.Atoi(_t[0]) + if err != nil { + return ret, err + } + t += hour * 60 * 100 + _tmp = _t[1] + } else { + _tmp = s + } + + _t := strings.Split(_tmp, ".") + if err != nil { + return ret, err + } + h, err := strconv.Atoi(_t[0]) + t += h * 100 + h, err = strconv.Atoi(_t[1]) + t += h + return float64(t) / ClockTicks, nil +} +func (p *Process) Times() (*cpu.TimesStat, error) { + r, err := callPs("utime,stime", p.Pid, false) + + if err != nil { + return nil, err + } + + utime, err := convertCPUTimes(r[0][0]) + if err != nil { + return nil, err + } + stime, err := convertCPUTimes(r[0][1]) + if err != nil { + return nil, err + } + + ret := &cpu.TimesStat{ + CPU: "cpu", + User: utime, + System: stime, + } + return ret, nil +} +func (p *Process) CPUAffinity() ([]int32, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + r, err := callPs("rss,vsize,pagein", p.Pid, false) + if err != nil { + return nil, err + } + rss, err := strconv.Atoi(r[0][0]) + if err != nil { + return nil, err + } + vms, err := strconv.Atoi(r[0][1]) + if err != nil { + return nil, err + } + pagein, err := strconv.Atoi(r[0][2]) + if err != nil { + return nil, err + } + + ret := &MemoryInfoStat{ + RSS: uint64(rss) * 1024, + VMS: uint64(vms) * 1024, + Swap: uint64(pagein), + } + + return ret, nil +} +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Children() ([]*Process, error) { + pids, err := common.CallPgrep(invoke, p.Pid) + if err != nil { + return nil, err + } + ret := make([]*Process, 0, len(pids)) + for _, pid := range pids { + np, err := NewProcess(pid) + if err != nil { + return nil, err + } + ret = append(ret, np) + } + return ret, nil +} + +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return net.ConnectionsPid("all", p.Pid) +} + +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) IsRunning() (bool, error) { + return true, common.ErrNotImplementedError +} +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + var ret []MemoryMapsStat + return &ret, common.ErrNotImplementedError +} + +func processes() ([]Process, error) { + results := make([]Process, 0, 50) + + mib := []int32{CTLKern, KernProc, KernProcAll, 0} + buf, length, err := common.CallSyscall(mib) + if err != nil { + return results, err + } + + // get kinfo_proc size + k := KinfoProc{} + procinfoLen := int(unsafe.Sizeof(k)) + count := int(length / uint64(procinfoLen)) + /* + fmt.Println(length, procinfoLen, count) + b := buf[0*procinfoLen : 0*procinfoLen+procinfoLen] + fmt.Println(b) + kk, err := parseKinfoProc(b) + fmt.Printf("%#v", kk) + */ + + // parse buf to procs + for i := 0; i < count; i++ { + b := buf[i*procinfoLen : i*procinfoLen+procinfoLen] + k, err := parseKinfoProc(b) + if err != nil { + continue + } + p, err := NewProcess(int32(k.Proc.P_pid)) + if err != nil { + continue + } + results = append(results, *p) + } + + return results, nil +} + +func parseKinfoProc(buf []byte) (KinfoProc, error) { + var k KinfoProc + br := bytes.NewReader(buf) + + err := common.Read(br, binary.LittleEndian, &k) + if err != nil { + return k, err + } + + return k, nil +} + +// Returns a proc as defined here: +// http://unix.superglobalmegacorp.com/Net2/newsrc/sys/kinfo_proc.h.html +func (p *Process) getKProc() (*KinfoProc, error) { + mib := []int32{CTLKern, KernProc, KernProcPID, p.Pid} + procK := KinfoProc{} + length := uint64(unsafe.Sizeof(procK)) + buf := make([]byte, length) + _, _, syserr := syscall.Syscall6( + syscall.SYS___SYSCTL, + uintptr(unsafe.Pointer(&mib[0])), + uintptr(len(mib)), + uintptr(unsafe.Pointer(&buf[0])), + uintptr(unsafe.Pointer(&length)), + 0, + 0) + if syserr != 0 { + return nil, syserr + } + k, err := parseKinfoProc(buf) + if err != nil { + return nil, err + } + + return &k, nil +} + +func NewProcess(pid int32) (*Process, error) { + p := &Process{Pid: pid} + + return p, nil +} + +// call ps command. +// Return value deletes Header line(you must not input wrong arg). +// And splited by Space. Caller have responsibility to manage. +// If passed arg pid is 0, get information from all process. +func callPs(arg string, pid int32, threadOption bool) ([][]string, error) { + bin, err := exec.LookPath("ps") + if err != nil { + return [][]string{}, err + } + + var cmd []string + if pid == 0 { // will get from all processes. + cmd = []string{"-ax", "-o", arg} + } else if threadOption { + cmd = []string{"-x", "-o", arg, "-M", "-p", strconv.Itoa(int(pid))} + } else { + cmd = []string{"-x", "-o", arg, "-p", strconv.Itoa(int(pid))} + } + out, err := invoke.Command(bin, cmd...) + if err != nil { + return [][]string{}, err + } + lines := strings.Split(string(out), "\n") + + var ret [][]string + for _, l := range lines[1:] { + var lr []string + for _, r := range strings.Split(l, " ") { + if r == "" { + continue + } + lr = append(lr, strings.TrimSpace(r)) + } + if len(lr) != 0 { + ret = append(ret, lr) + } + } + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_darwin_amd64.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_darwin_amd64.go new file mode 100644 index 00000000..f8e92238 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_darwin_amd64.go @@ -0,0 +1,234 @@ +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs types_darwin.go + +package process + +const ( + sizeofPtr = 0x8 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x8 + sizeofLongLong = 0x8 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type Timespec struct { + Sec int64 + Nsec int64 +} + +type Timeval struct { + Sec int64 + Usec int32 + Pad_cgo_0 [4]byte +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int64 + Ixrss int64 + Idrss int64 + Isrss int64 + Minflt int64 + Majflt int64 + Nswap int64 + Inblock int64 + Oublock int64 + Msgsnd int64 + Msgrcv int64 + Nsignals int64 + Nvcsw int64 + Nivcsw int64 +} + +type Rlimit struct { + Cur uint64 + Max uint64 +} + +type UGid_t uint32 + +type KinfoProc struct { + Proc ExternProc + Eproc Eproc +} + +type Eproc struct { + Paddr *uint64 + Sess *Session + Pcred Upcred + Ucred Uucred + Pad_cgo_0 [4]byte + Vm Vmspace + Ppid int32 + Pgid int32 + Jobc int16 + Pad_cgo_1 [2]byte + Tdev int32 + Tpgid int32 + Pad_cgo_2 [4]byte + Tsess *Session + Wmesg [8]int8 + Xsize int32 + Xrssize int16 + Xccount int16 + Xswrss int16 + Pad_cgo_3 [2]byte + Flag int32 + Login [12]int8 + Spare [4]int32 + Pad_cgo_4 [4]byte +} + +type Proc struct{} + +type Session struct{} + +type ucred struct { + Link _Ctype_struct___0 + Ref uint64 + Posix Posix_cred + Label *Label + Audit Au_session +} + +type Uucred struct { + Ref int32 + UID uint32 + Ngroups int16 + Pad_cgo_0 [2]byte + Groups [16]uint32 +} + +type Upcred struct { + Pc_lock [72]int8 + Pc_ucred *ucred + P_ruid uint32 + P_svuid uint32 + P_rgid uint32 + P_svgid uint32 + P_refcnt int32 + Pad_cgo_0 [4]byte +} + +type Vmspace struct { + Dummy int32 + Pad_cgo_0 [4]byte + Dummy2 *int8 + Dummy3 [5]int32 + Pad_cgo_1 [4]byte + Dummy4 [3]*int8 +} + +type Sigacts struct{} + +type ExternProc struct { + P_un [16]byte + P_vmspace uint64 + P_sigacts uint64 + Pad_cgo_0 [3]byte + P_flag int32 + P_stat int8 + P_pid int32 + P_oppid int32 + P_dupfd int32 + Pad_cgo_1 [4]byte + User_stack uint64 + Exit_thread uint64 + P_debugger int32 + Sigwait int32 + P_estcpu uint32 + P_cpticks int32 + P_pctcpu uint32 + Pad_cgo_2 [4]byte + P_wchan uint64 + P_wmesg uint64 + P_swtime uint32 + P_slptime uint32 + P_realtimer Itimerval + P_rtime Timeval + P_uticks uint64 + P_sticks uint64 + P_iticks uint64 + P_traceflag int32 + Pad_cgo_3 [4]byte + P_tracep uint64 + P_siglist int32 + Pad_cgo_4 [4]byte + P_textvp uint64 + P_holdcnt int32 + P_sigmask uint32 + P_sigignore uint32 + P_sigcatch uint32 + P_priority uint8 + P_usrpri uint8 + P_nice int8 + P_comm [17]int8 + Pad_cgo_5 [4]byte + P_pgrp uint64 + P_addr uint64 + P_xstat uint16 + P_acflag uint16 + Pad_cgo_6 [4]byte + P_ru uint64 +} + +type Itimerval struct { + Interval Timeval + Value Timeval +} + +type Vnode struct{} + +type Pgrp struct{} + +type UserStruct struct{} + +type Au_session struct { + Aia_p *AuditinfoAddr + Mask AuMask +} + +type Posix_cred struct { + UID uint32 + Ruid uint32 + Svuid uint32 + Ngroups int16 + Pad_cgo_0 [2]byte + Groups [16]uint32 + Rgid uint32 + Svgid uint32 + Gmuid uint32 + Flags int32 +} + +type Label struct{} + +type AuditinfoAddr struct { + Auid uint32 + Mask AuMask + Termid AuTidAddr + Asid int32 + Flags uint64 +} +type AuMask struct { + Success uint32 + Failure uint32 +} +type AuTidAddr struct { + Port int32 + Type uint32 + Addr [4]uint32 +} + +type UcredQueue struct { + Next *ucred + Prev **ucred +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_freebsd.go new file mode 100644 index 00000000..5362128e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_freebsd.go @@ -0,0 +1,336 @@ +// +build freebsd + +package process + +import ( + "bytes" + "encoding/binary" + "strings" + "syscall" + + cpu "github.com/shirou/gopsutil/cpu" + "github.com/shirou/gopsutil/internal/common" + net "github.com/shirou/gopsutil/net" +) + +// MemoryInfoExStat is different between OSes +type MemoryInfoExStat struct { +} + +type MemoryMapsStat struct { +} + +func Pids() ([]int32, error) { + var ret []int32 + procs, err := processes() + if err != nil { + return ret, nil + } + + for _, p := range procs { + ret = append(ret, p.Pid) + } + + return ret, nil +} + +func (p *Process) Ppid() (int32, error) { + k, err := p.getKProc() + if err != nil { + return 0, err + } + + return k.Ppid, nil +} +func (p *Process) Name() (string, error) { + k, err := p.getKProc() + if err != nil { + return "", err + } + + return common.IntToString(k.Comm[:]), nil +} +func (p *Process) Exe() (string, error) { + return "", common.ErrNotImplementedError +} + +func (p *Process) Cmdline() (string, error) { + mib := []int32{CTLKern, KernProc, KernProcArgs, p.Pid} + buf, _, err := common.CallSyscall(mib) + if err != nil { + return "", err + } + ret := strings.FieldsFunc(string(buf), func(r rune) bool { + if r == '\u0000' { + return true + } + return false + }) + + return strings.Join(ret, " "), nil +} + +func (p *Process) CmdlineSlice() ([]string, error) { + mib := []int32{CTLKern, KernProc, KernProcArgs, p.Pid} + buf, _, err := common.CallSyscall(mib) + if err != nil { + return nil, err + } + if len(buf) == 0 { + return nil, nil + } + if buf[len(buf)-1] == 0 { + buf = buf[:len(buf)-1] + } + parts := bytes.Split(buf, []byte{0}) + var strParts []string + for _, p := range parts { + strParts = append(strParts, string(p)) + } + + return strParts, nil +} +func (p *Process) CreateTime() (int64, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Cwd() (string, error) { + return "", common.ErrNotImplementedError +} +func (p *Process) Parent() (*Process, error) { + return p, common.ErrNotImplementedError +} +func (p *Process) Status() (string, error) { + k, err := p.getKProc() + if err != nil { + return "", err + } + var s string + switch k.Stat { + case SIDL: + s = "I" + case SRUN: + s = "R" + case SSLEEP: + s = "S" + case SSTOP: + s = "T" + case SZOMB: + s = "Z" + case SWAIT: + s = "W" + case SLOCK: + s = "L" + } + + return s, nil +} +func (p *Process) Uids() ([]int32, error) { + k, err := p.getKProc() + if err != nil { + return nil, err + } + + uids := make([]int32, 0, 3) + + uids = append(uids, int32(k.Ruid), int32(k.Uid), int32(k.Svuid)) + + return uids, nil +} +func (p *Process) Gids() ([]int32, error) { + k, err := p.getKProc() + if err != nil { + return nil, err + } + + gids := make([]int32, 0, 3) + gids = append(gids, int32(k.Rgid), int32(k.Ngroups), int32(k.Svgid)) + + return gids, nil +} +func (p *Process) Terminal() (string, error) { + k, err := p.getKProc() + if err != nil { + return "", err + } + + ttyNr := uint64(k.Tdev) + + termmap, err := getTerminalMap() + if err != nil { + return "", err + } + + return termmap[ttyNr], nil +} +func (p *Process) Nice() (int32, error) { + k, err := p.getKProc() + if err != nil { + return 0, err + } + return int32(k.Nice), nil +} +func (p *Process) IOnice() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Rlimit() ([]RlimitStat, error) { + var rlimit []RlimitStat + return rlimit, common.ErrNotImplementedError +} +func (p *Process) IOCounters() (*IOCountersStat, error) { + k, err := p.getKProc() + if err != nil { + return nil, err + } + return &IOCountersStat{ + ReadCount: uint64(k.Rusage.Inblock), + WriteCount: uint64(k.Rusage.Oublock), + }, nil +} +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) NumFDs() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) NumThreads() (int32, error) { + k, err := p.getKProc() + if err != nil { + return 0, err + } + + return k.Numthreads, nil +} +func (p *Process) Threads() (map[string]string, error) { + ret := make(map[string]string, 0) + return ret, common.ErrNotImplementedError +} +func (p *Process) Times() (*cpu.TimesStat, error) { + k, err := p.getKProc() + if err != nil { + return nil, err + } + return &cpu.TimesStat{ + CPU: "cpu", + User: float64(k.Rusage.Utime.Sec) + float64(k.Rusage.Utime.Usec)/1000000, + System: float64(k.Rusage.Stime.Sec) + float64(k.Rusage.Stime.Usec)/1000000, + }, nil +} +func (p *Process) CPUAffinity() ([]int32, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + k, err := p.getKProc() + if err != nil { + return nil, err + } + v, err := syscall.Sysctl("vm.stats.vm.v_page_size") + if err != nil { + return nil, err + } + pageSize := common.LittleEndian.Uint16([]byte(v)) + + return &MemoryInfoStat{ + RSS: uint64(k.Rssize) * uint64(pageSize), + VMS: uint64(k.Size), + }, nil +} +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Children() ([]*Process, error) { + pids, err := common.CallPgrep(invoke, p.Pid) + if err != nil { + return nil, err + } + ret := make([]*Process, 0, len(pids)) + for _, pid := range pids { + np, err := NewProcess(pid) + if err != nil { + return nil, err + } + ret = append(ret, np) + } + return ret, nil +} + +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) IsRunning() (bool, error) { + return true, common.ErrNotImplementedError +} +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + var ret []MemoryMapsStat + return &ret, common.ErrNotImplementedError +} + +func processes() ([]Process, error) { + results := make([]Process, 0, 50) + + mib := []int32{CTLKern, KernProc, KernProcProc, 0} + buf, length, err := common.CallSyscall(mib) + if err != nil { + return results, err + } + + // get kinfo_proc size + count := int(length / uint64(sizeOfKinfoProc)) + + // parse buf to procs + for i := 0; i < count; i++ { + b := buf[i*sizeOfKinfoProc : (i+1)*sizeOfKinfoProc] + k, err := parseKinfoProc(b) + if err != nil { + continue + } + p, err := NewProcess(int32(k.Pid)) + if err != nil { + continue + } + + results = append(results, *p) + } + + return results, nil +} + +func parseKinfoProc(buf []byte) (KinfoProc, error) { + var k KinfoProc + br := bytes.NewReader(buf) + err := common.Read(br, binary.LittleEndian, &k) + return k, err +} + +func (p *Process) getKProc() (*KinfoProc, error) { + mib := []int32{CTLKern, KernProc, KernProcPID, p.Pid} + + buf, length, err := common.CallSyscall(mib) + if err != nil { + return nil, err + } + if length != sizeOfKinfoProc { + return nil, err + } + + k, err := parseKinfoProc(buf) + if err != nil { + return nil, err + } + return &k, nil +} + +func NewProcess(pid int32) (*Process, error) { + p := &Process{Pid: pid} + + return p, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_freebsd_386.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_freebsd_386.go new file mode 100644 index 00000000..201f7146 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_freebsd_386.go @@ -0,0 +1,141 @@ +// +build freebsd +// +build 386 + +package process + +// copied from sys/sysctl.h +const ( + CTLKern = 1 // "high kernel": proc, limits + KernProc = 14 // struct: process entries + KernProcPID = 1 // by process id + KernProcProc = 8 // only return procs + KernProcPathname = 12 // path to executable + KernProcArgs = 7 // get/set arguments/proctitle +) + +const ( + SIDL = 1 + SRUN = 2 + SSLEEP = 3 + SSTOP = 4 + SZOMB = 5 + SWAIT = 6 + SLOCK = 7 +) + +const ( + sizeOfKinfoVmentry = 0x244 // TODO: really? + sizeOfKinfoProc = 0x220 +) + +type Timespec struct { + Sec int32 + Nsec int32 +} + +type Timeval struct { + Sec int32 + Usec int32 +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int32 + Ixrss int32 + Idrss int32 + Isrss int32 + Minflt int32 + Majflt int32 + Nswap int32 + Inblock int32 + Oublock int32 + Msgsnd int32 + Msgrcv int32 + Nsignals int32 + Nvcsw int32 + Nivcsw int32 +} + +// copied from sys/user.h +type KinfoProc struct { + Structsize int32 + Layout int32 + Args int32 + Paddr int32 + Addr int32 + Tracep int32 + Textvp int32 + Fd int32 + Vmspace int32 + Wchan int32 + Pid int32 + Ppid int32 + Pgid int32 + Tpgid int32 + Sid int32 + Tsid int32 + Jobc [2]byte + SpareShort1 [2]byte + Tdev int32 + Siglist [16]byte + Sigmask [16]byte + Sigignore [16]byte + Sigcatch [16]byte + Uid int32 + Ruid int32 + Svuid int32 + Rgid int32 + Svgid int32 + Ngroups int16 + SpareShort2 [2]byte + Groups [64]byte + Size int32 + Rssize int32 + Swrss int32 + Tsize int32 + Dsize int32 + Ssize int32 + Xstat [2]byte + Acflag [2]byte + Pctcpu int32 + Estcpu int32 + Slptime int32 + Swtime int32 + Cow int32 + Runtime int64 + Start [8]byte + Childtime [8]byte + Flag int32 + Kflag int32 + Traceflag int32 + Stat int8 + Nice [1]byte + Lock [1]byte + Rqindex [1]byte + Oncpu [1]byte + Lastcpu [1]byte + Ocomm [17]byte + Wmesg [9]byte + Login [18]byte + Lockname [9]byte + Comm [20]int8 + Emul [17]byte + Sparestrings [68]byte + Spareints [36]byte + CrFlags int32 + Jid int32 + Numthreads int32 + Tid int32 + Pri int32 + Rusage Rusage + RusageCh [72]byte + Pcb int32 + Kstack int32 + Udata int32 + Tdaddr int32 + Spareptrs [24]byte + Spareint64s [48]byte + Sflag int32 + Tdflags int32 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_freebsd_amd64.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_freebsd_amd64.go new file mode 100644 index 00000000..79e2ba88 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_freebsd_amd64.go @@ -0,0 +1,192 @@ +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs types_freebsd.go + +package process + +const ( + CTLKern = 1 + KernProc = 14 + KernProcPID = 1 + KernProcProc = 8 + KernProcPathname = 12 + KernProcArgs = 7 +) + +const ( + sizeofPtr = 0x8 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x8 + sizeofLongLong = 0x8 +) + +const ( + sizeOfKinfoVmentry = 0x488 + sizeOfKinfoProc = 0x440 +) + +const ( + SIDL = 1 + SRUN = 2 + SSLEEP = 3 + SSTOP = 4 + SZOMB = 5 + SWAIT = 6 + SLOCK = 7 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type Timespec struct { + Sec int64 + Nsec int64 +} + +type Timeval struct { + Sec int64 + Usec int64 +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int64 + Ixrss int64 + Idrss int64 + Isrss int64 + Minflt int64 + Majflt int64 + Nswap int64 + Inblock int64 + Oublock int64 + Msgsnd int64 + Msgrcv int64 + Nsignals int64 + Nvcsw int64 + Nivcsw int64 +} + +type Rlimit struct { + Cur int64 + Max int64 +} + +type KinfoProc struct { + Structsize int32 + Layout int32 + Args int64 /* pargs */ + Paddr int64 /* proc */ + Addr int64 /* user */ + Tracep int64 /* vnode */ + Textvp int64 /* vnode */ + Fd int64 /* filedesc */ + Vmspace int64 /* vmspace */ + Wchan int64 + Pid int32 + Ppid int32 + Pgid int32 + Tpgid int32 + Sid int32 + Tsid int32 + Jobc int16 + Spare_short1 int16 + Tdev uint32 + Siglist [16]byte /* sigset */ + Sigmask [16]byte /* sigset */ + Sigignore [16]byte /* sigset */ + Sigcatch [16]byte /* sigset */ + Uid uint32 + Ruid uint32 + Svuid uint32 + Rgid uint32 + Svgid uint32 + Ngroups int16 + Spare_short2 int16 + Groups [16]uint32 + Size uint64 + Rssize int64 + Swrss int64 + Tsize int64 + Dsize int64 + Ssize int64 + Xstat uint16 + Acflag uint16 + Pctcpu uint32 + Estcpu uint32 + Slptime uint32 + Swtime uint32 + Cow uint32 + Runtime uint64 + Start Timeval + Childtime Timeval + Flag int64 + Kiflag int64 + Traceflag int32 + Stat int8 + Nice int8 + Lock int8 + Rqindex int8 + Oncpu uint8 + Lastcpu uint8 + Tdname [17]int8 + Wmesg [9]int8 + Login [18]int8 + Lockname [9]int8 + Comm [20]int8 + Emul [17]int8 + Loginclass [18]int8 + Sparestrings [50]int8 + Spareints [7]int32 + Flag2 int32 + Fibnum int32 + Cr_flags uint32 + Jid int32 + Numthreads int32 + Tid int32 + Pri Priority + Rusage Rusage + Rusage_ch Rusage + Pcb int64 /* pcb */ + Kstack int64 + Udata int64 + Tdaddr int64 /* thread */ + Spareptrs [6]int64 + Sparelongs [12]int64 + Sflag int64 + Tdflags int64 +} + +type Priority struct { + Class uint8 + Level uint8 + Native uint8 + User uint8 +} + +type KinfoVmentry struct { + Structsize int32 + Type int32 + Start uint64 + End uint64 + Offset uint64 + Vn_fileid uint64 + Vn_fsid uint32 + Flags int32 + Resident int32 + Private_resident int32 + Protection int32 + Ref_count int32 + Shadow_count int32 + Vn_type int32 + Vn_size uint64 + Vn_rdev uint32 + Vn_mode uint16 + Status uint16 + X_kve_ispare [12]int32 + Path [1024]int8 +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux.go new file mode 100644 index 00000000..e79ba36e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux.go @@ -0,0 +1,733 @@ +// +build linux + +package process + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "strconv" + "strings" + "syscall" + + "github.com/shirou/gopsutil/cpu" + "github.com/shirou/gopsutil/host" + "github.com/shirou/gopsutil/internal/common" + "github.com/shirou/gopsutil/net" +) + +var ErrorNoChildren = errors.New("process does not have children") + +const ( + PrioProcess = 0 // linux/resource.h +) + +// MemoryInfoExStat is different between OSes +type MemoryInfoExStat struct { + RSS uint64 `json:"rss"` // bytes + VMS uint64 `json:"vms"` // bytes + Shared uint64 `json:"shared"` // bytes + Text uint64 `json:"text"` // bytes + Lib uint64 `json:"lib"` // bytes + Data uint64 `json:"data"` // bytes + Dirty uint64 `json:"dirty"` // bytes +} + +func (m MemoryInfoExStat) String() string { + s, _ := json.Marshal(m) + return string(s) +} + +type MemoryMapsStat struct { + Path string `json:"path"` + Rss uint64 `json:"rss"` + Size uint64 `json:"size"` + Pss uint64 `json:"pss"` + SharedClean uint64 `json:"sharedClean"` + SharedDirty uint64 `json:"sharedDirty"` + PrivateClean uint64 `json:"privateClean"` + PrivateDirty uint64 `json:"privateDirty"` + Referenced uint64 `json:"referenced"` + Anonymous uint64 `json:"anonymous"` + Swap uint64 `json:"swap"` +} + +func (m MemoryMapsStat) String() string { + s, _ := json.Marshal(m) + return string(s) +} + +// NewProcess creates a new Process instance, it only stores the pid and +// checks that the process exists. Other method on Process can be used +// to get more information about the process. An error will be returned +// if the process does not exist. +func NewProcess(pid int32) (*Process, error) { + p := &Process{ + Pid: int32(pid), + } + file, err := os.Open(common.HostProc(strconv.Itoa(int(p.Pid)))) + defer file.Close() + return p, err +} + +func (p *Process) Ppid() (int32, error) { + _, ppid, _, _, _, err := p.fillFromStat() + if err != nil { + return -1, err + } + return ppid, nil +} +func (p *Process) Name() (string, error) { + if p.name == "" { + if err := p.fillFromStatus(); err != nil { + return "", err + } + } + return p.name, nil +} +func (p *Process) Exe() (string, error) { + return p.fillFromExe() +} + +// Cmdline returns the command line arguments of the process as a string with +// each argument separated by 0x20 ascii character. +func (p *Process) Cmdline() (string, error) { + return p.fillFromCmdline() +} + +// CmdlineSlice returns the command line arguments of the process as a slice with each +// element being an argument. +func (p *Process) CmdlineSlice() ([]string, error) { + return p.fillSliceFromCmdline() +} + +func (p *Process) CreateTime() (int64, error) { + _, _, _, createTime, _, err := p.fillFromStat() + if err != nil { + return 0, err + } + return createTime, nil +} + +func (p *Process) Cwd() (string, error) { + return p.fillFromCwd() +} +func (p *Process) Parent() (*Process, error) { + r, err := callLsof("R", p.Pid) + if err != nil { + return nil, err + } + if len(r) != 1 { // TODO: pid 1 + return nil, fmt.Errorf("wrong number of parents") + } + v, err := strconv.Atoi(r[0]) + if err != nil { + return nil, err + } + return NewProcess(int32(v)) +} +func (p *Process) Status() (string, error) { + err := p.fillFromStatus() + if err != nil { + return "", err + } + return p.status, nil +} +func (p *Process) Uids() ([]int32, error) { + err := p.fillFromStatus() + if err != nil { + return []int32{}, err + } + return p.uids, nil +} +func (p *Process) Gids() ([]int32, error) { + err := p.fillFromStatus() + if err != nil { + return []int32{}, err + } + return p.gids, nil +} +func (p *Process) Terminal() (string, error) { + terminal, _, _, _, _, err := p.fillFromStat() + if err != nil { + return "", err + } + return terminal, nil +} +func (p *Process) Nice() (int32, error) { + _, _, _, _, nice, err := p.fillFromStat() + if err != nil { + return 0, err + } + return nice, nil +} +func (p *Process) IOnice() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Rlimit() ([]RlimitStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) IOCounters() (*IOCountersStat, error) { + return p.fillFromIO() +} +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + err := p.fillFromStatus() + if err != nil { + return nil, err + } + return p.numCtxSwitches, nil +} +func (p *Process) NumFDs() (int32, error) { + numFds, _, err := p.fillFromfd() + return numFds, err +} +func (p *Process) NumThreads() (int32, error) { + err := p.fillFromStatus() + if err != nil { + return 0, err + } + return p.numThreads, nil +} +func (p *Process) Threads() (map[string]string, error) { + ret := make(map[string]string, 0) + return ret, nil +} +func (p *Process) Times() (*cpu.TimesStat, error) { + _, _, cpuTimes, _, _, err := p.fillFromStat() + if err != nil { + return nil, err + } + return cpuTimes, nil +} +func (p *Process) CPUAffinity() ([]int32, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + meminfo, _, err := p.fillFromStatm() + if err != nil { + return nil, err + } + return meminfo, nil +} +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + _, memInfoEx, err := p.fillFromStatm() + if err != nil { + return nil, err + } + return memInfoEx, nil +} + +func (p *Process) Children() ([]*Process, error) { + pids, err := common.CallPgrep(invoke, p.Pid) + if err != nil { + if pids == nil || len(pids) == 0 { + return nil, ErrorNoChildren + } + return nil, err + } + ret := make([]*Process, 0, len(pids)) + for _, pid := range pids { + np, err := NewProcess(pid) + if err != nil { + return nil, err + } + ret = append(ret, np) + } + return ret, nil +} + +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + _, ofs, err := p.fillFromfd() + if err != nil { + return nil, err + } + ret := make([]OpenFilesStat, len(ofs)) + for i, o := range ofs { + ret[i] = *o + } + + return ret, nil +} + +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return net.ConnectionsPid("all", p.Pid) +} + +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + filename := common.HostProc(strconv.Itoa(int(p.Pid)), "net/dev") + return net.IOCountersByFile(pernic, filename) +} + +func (p *Process) IsRunning() (bool, error) { + return true, common.ErrNotImplementedError +} + +// MemoryMaps get memory maps from /proc/(pid)/smaps +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + pid := p.Pid + var ret []MemoryMapsStat + smapsPath := common.HostProc(strconv.Itoa(int(pid)), "smaps") + contents, err := ioutil.ReadFile(smapsPath) + if err != nil { + return nil, err + } + lines := strings.Split(string(contents), "\n") + + // function of parsing a block + getBlock := func(first_line []string, block []string) (MemoryMapsStat, error) { + m := MemoryMapsStat{} + m.Path = first_line[len(first_line)-1] + + for _, line := range block { + if strings.Contains(line, "VmFlags") { + continue + } + field := strings.Split(line, ":") + if len(field) < 2 { + continue + } + v := strings.Trim(field[1], " kB") // remove last "kB" + t, err := strconv.ParseUint(v, 10, 64) + if err != nil { + return m, err + } + + switch field[0] { + case "Size": + m.Size = t + case "Rss": + m.Rss = t + case "Pss": + m.Pss = t + case "Shared_Clean": + m.SharedClean = t + case "Shared_Dirty": + m.SharedDirty = t + case "Private_Clean": + m.PrivateClean = t + case "Private_Dirty": + m.PrivateDirty = t + case "Referenced": + m.Referenced = t + case "Anonymous": + m.Anonymous = t + case "Swap": + m.Swap = t + } + } + return m, nil + } + + blocks := make([]string, 16) + for _, line := range lines { + field := strings.Split(line, " ") + if strings.HasSuffix(field[0], ":") == false { + // new block section + if len(blocks) > 0 { + g, err := getBlock(field, blocks) + if err != nil { + return &ret, err + } + ret = append(ret, g) + } + // starts new block + blocks = make([]string, 16) + } else { + blocks = append(blocks, line) + } + } + + return &ret, nil +} + +/** +** Internal functions +**/ + +// Get num_fds from /proc/(pid)/fd +func (p *Process) fillFromfd() (int32, []*OpenFilesStat, error) { + pid := p.Pid + statPath := common.HostProc(strconv.Itoa(int(pid)), "fd") + d, err := os.Open(statPath) + if err != nil { + return 0, nil, err + } + defer d.Close() + fnames, err := d.Readdirnames(-1) + numFDs := int32(len(fnames)) + + var openfiles []*OpenFilesStat + for _, fd := range fnames { + fpath := filepath.Join(statPath, fd) + filepath, err := os.Readlink(fpath) + if err != nil { + continue + } + t, err := strconv.ParseUint(fd, 10, 64) + if err != nil { + return numFDs, openfiles, err + } + o := &OpenFilesStat{ + Path: filepath, + Fd: t, + } + openfiles = append(openfiles, o) + } + + return numFDs, openfiles, nil +} + +// Get cwd from /proc/(pid)/cwd +func (p *Process) fillFromCwd() (string, error) { + pid := p.Pid + cwdPath := common.HostProc(strconv.Itoa(int(pid)), "cwd") + cwd, err := os.Readlink(cwdPath) + if err != nil { + return "", err + } + return string(cwd), nil +} + +// Get exe from /proc/(pid)/exe +func (p *Process) fillFromExe() (string, error) { + pid := p.Pid + exePath := common.HostProc(strconv.Itoa(int(pid)), "exe") + exe, err := os.Readlink(exePath) + if err != nil { + return "", err + } + return string(exe), nil +} + +// Get cmdline from /proc/(pid)/cmdline +func (p *Process) fillFromCmdline() (string, error) { + pid := p.Pid + cmdPath := common.HostProc(strconv.Itoa(int(pid)), "cmdline") + cmdline, err := ioutil.ReadFile(cmdPath) + if err != nil { + return "", err + } + ret := strings.FieldsFunc(string(cmdline), func(r rune) bool { + if r == '\u0000' { + return true + } + return false + }) + + return strings.Join(ret, " "), nil +} + +func (p *Process) fillSliceFromCmdline() ([]string, error) { + pid := p.Pid + cmdPath := common.HostProc(strconv.Itoa(int(pid)), "cmdline") + cmdline, err := ioutil.ReadFile(cmdPath) + if err != nil { + return nil, err + } + if len(cmdline) == 0 { + return nil, nil + } + if cmdline[len(cmdline)-1] == 0 { + cmdline = cmdline[:len(cmdline)-1] + } + parts := bytes.Split(cmdline, []byte{0}) + var strParts []string + for _, p := range parts { + strParts = append(strParts, string(p)) + } + + return strParts, nil +} + +// Get IO status from /proc/(pid)/io +func (p *Process) fillFromIO() (*IOCountersStat, error) { + pid := p.Pid + ioPath := common.HostProc(strconv.Itoa(int(pid)), "io") + ioline, err := ioutil.ReadFile(ioPath) + if err != nil { + return nil, err + } + lines := strings.Split(string(ioline), "\n") + ret := &IOCountersStat{} + + for _, line := range lines { + field := strings.Fields(line) + if len(field) < 2 { + continue + } + t, err := strconv.ParseUint(field[1], 10, 64) + if err != nil { + return nil, err + } + param := field[0] + if strings.HasSuffix(param, ":") { + param = param[:len(param)-1] + } + switch param { + case "syscr": + ret.ReadCount = t + case "syscw": + ret.WriteCount = t + case "readBytes": + ret.ReadBytes = t + case "writeBytes": + ret.WriteBytes = t + } + } + + return ret, nil +} + +// Get memory info from /proc/(pid)/statm +func (p *Process) fillFromStatm() (*MemoryInfoStat, *MemoryInfoExStat, error) { + pid := p.Pid + memPath := common.HostProc(strconv.Itoa(int(pid)), "statm") + contents, err := ioutil.ReadFile(memPath) + if err != nil { + return nil, nil, err + } + fields := strings.Split(string(contents), " ") + + vms, err := strconv.ParseUint(fields[0], 10, 64) + if err != nil { + return nil, nil, err + } + rss, err := strconv.ParseUint(fields[1], 10, 64) + if err != nil { + return nil, nil, err + } + memInfo := &MemoryInfoStat{ + RSS: rss * PageSize, + VMS: vms * PageSize, + } + + shared, err := strconv.ParseUint(fields[2], 10, 64) + if err != nil { + return nil, nil, err + } + text, err := strconv.ParseUint(fields[3], 10, 64) + if err != nil { + return nil, nil, err + } + lib, err := strconv.ParseUint(fields[4], 10, 64) + if err != nil { + return nil, nil, err + } + dirty, err := strconv.ParseUint(fields[5], 10, 64) + if err != nil { + return nil, nil, err + } + + memInfoEx := &MemoryInfoExStat{ + RSS: rss * PageSize, + VMS: vms * PageSize, + Shared: shared * PageSize, + Text: text * PageSize, + Lib: lib * PageSize, + Dirty: dirty * PageSize, + } + + return memInfo, memInfoEx, nil +} + +// Get various status from /proc/(pid)/status +func (p *Process) fillFromStatus() error { + pid := p.Pid + statPath := common.HostProc(strconv.Itoa(int(pid)), "status") + contents, err := ioutil.ReadFile(statPath) + if err != nil { + return err + } + lines := strings.Split(string(contents), "\n") + p.numCtxSwitches = &NumCtxSwitchesStat{} + p.memInfo = &MemoryInfoStat{} + for _, line := range lines { + tabParts := strings.SplitN(line, "\t", 2) + if len(tabParts) < 2 { + continue + } + value := tabParts[1] + switch strings.TrimRight(tabParts[0], ":") { + case "Name": + p.name = strings.Trim(value, " \t") + case "State": + p.status = value[0:1] + case "Uid": + p.uids = make([]int32, 0, 4) + for _, i := range strings.Split(value, "\t") { + v, err := strconv.ParseInt(i, 10, 32) + if err != nil { + return err + } + p.uids = append(p.uids, int32(v)) + } + case "Gid": + p.gids = make([]int32, 0, 4) + for _, i := range strings.Split(value, "\t") { + v, err := strconv.ParseInt(i, 10, 32) + if err != nil { + return err + } + p.gids = append(p.gids, int32(v)) + } + case "Threads": + v, err := strconv.ParseInt(value, 10, 32) + if err != nil { + return err + } + p.numThreads = int32(v) + case "voluntary_ctxt_switches": + v, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return err + } + p.numCtxSwitches.Voluntary = v + case "nonvoluntary_ctxt_switches": + v, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return err + } + p.numCtxSwitches.Involuntary = v + case "VmRSS": + value := strings.Trim(value, " kB") // remove last "kB" + v, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return err + } + p.memInfo.RSS = v * 1024 + case "VmSize": + value := strings.Trim(value, " kB") // remove last "kB" + v, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return err + } + p.memInfo.VMS = v * 1024 + case "VmSwap": + value := strings.Trim(value, " kB") // remove last "kB" + v, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return err + } + p.memInfo.Swap = v * 1024 + } + + } + return nil +} + +func (p *Process) fillFromStat() (string, int32, *cpu.TimesStat, int64, int32, error) { + pid := p.Pid + statPath := common.HostProc(strconv.Itoa(int(pid)), "stat") + contents, err := ioutil.ReadFile(statPath) + if err != nil { + return "", 0, nil, 0, 0, err + } + fields := strings.Fields(string(contents)) + + i := 1 + for !strings.HasSuffix(fields[i], ")") { + i++ + } + + termmap, err := getTerminalMap() + terminal := "" + if err == nil { + t, err := strconv.ParseUint(fields[i+5], 10, 64) + if err != nil { + return "", 0, nil, 0, 0, err + } + terminal = termmap[t] + } + + ppid, err := strconv.ParseInt(fields[i+2], 10, 32) + if err != nil { + return "", 0, nil, 0, 0, err + } + utime, err := strconv.ParseFloat(fields[i+12], 64) + if err != nil { + return "", 0, nil, 0, 0, err + } + + stime, err := strconv.ParseFloat(fields[i+13], 64) + if err != nil { + return "", 0, nil, 0, 0, err + } + + cpuTimes := &cpu.TimesStat{ + CPU: "cpu", + User: float64(utime / ClockTicks), + System: float64(stime / ClockTicks), + } + + bootTime, _ := host.BootTime() + t, err := strconv.ParseUint(fields[i+20], 10, 64) + if err != nil { + return "", 0, nil, 0, 0, err + } + ctime := (t / uint64(ClockTicks)) + uint64(bootTime) + createTime := int64(ctime * 1000) + + // p.Nice = mustParseInt32(fields[18]) + // use syscall instead of parse Stat file + snice, _ := syscall.Getpriority(PrioProcess, int(pid)) + nice := int32(snice) // FIXME: is this true? + + return terminal, int32(ppid), cpuTimes, createTime, nice, nil +} + +func Pids() ([]int32, error) { + var ret []int32 + + d, err := os.Open(common.HostProc()) + if err != nil { + return nil, err + } + defer d.Close() + + fnames, err := d.Readdirnames(-1) + if err != nil { + return nil, err + } + for _, fname := range fnames { + pid, err := strconv.ParseInt(fname, 10, 32) + if err != nil { + // if not numeric name, just skip + continue + } + ret = append(ret, int32(pid)) + } + + return ret, nil +} + +func callLsof(arg string, pid int32) ([]string, error) { + var cmd []string + if pid == 0 { // will get from all processes. + cmd = []string{"-F" + arg} + } else { + cmd = []string{"-a", "-F" + arg, "-p", strconv.Itoa(int(pid))} + } + lsof, err := exec.LookPath("lsof") + if err != nil { + return []string{}, err + } + out, err := invoke.Command(lsof, cmd...) + if err != nil { + return []string{}, err + } + lines := strings.Split(string(out), "\n") + + var ret []string + for _, l := range lines[1:] { + if strings.HasPrefix(l, arg) { + ret = append(ret, l[1:]) // delete first char + } + } + + return ret, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux_386.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux_386.go new file mode 100644 index 00000000..541b854c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux_386.go @@ -0,0 +1,9 @@ +// +build linux +// +build 386 + +package process + +const ( + ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK) + PageSize = 4096 // C.sysconf(C._SC_PAGE_SIZE) +) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux_amd64.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux_amd64.go new file mode 100644 index 00000000..b4a4ce8b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux_amd64.go @@ -0,0 +1,9 @@ +// +build linux +// +build amd64 + +package process + +const ( + ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK) + PageSize = 4096 // C.sysconf(C._SC_PAGE_SIZE) +) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux_arm.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux_arm.go new file mode 100644 index 00000000..c6123a48 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_linux_arm.go @@ -0,0 +1,9 @@ +// +build linux +// +build arm + +package process + +const ( + ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK) + PageSize = 4096 // C.sysconf(C._SC_PAGE_SIZE) +) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_posix.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_posix.go new file mode 100644 index 00000000..92353b8c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_posix.go @@ -0,0 +1,106 @@ +// +build linux freebsd darwin + +package process + +import ( + "os" + "os/exec" + "os/user" + "strconv" + "strings" + "syscall" +) + +// POSIX +func getTerminalMap() (map[uint64]string, error) { + ret := make(map[uint64]string) + var termfiles []string + + d, err := os.Open("/dev") + if err != nil { + return nil, err + } + defer d.Close() + + devnames, err := d.Readdirnames(-1) + for _, devname := range devnames { + if strings.HasPrefix(devname, "/dev/tty") { + termfiles = append(termfiles, "/dev/tty/"+devname) + } + } + + ptsd, err := os.Open("/dev/pts") + if err != nil { + return nil, err + } + defer ptsd.Close() + + ptsnames, err := ptsd.Readdirnames(-1) + for _, ptsname := range ptsnames { + termfiles = append(termfiles, "/dev/pts/"+ptsname) + } + + for _, name := range termfiles { + stat := syscall.Stat_t{} + if err = syscall.Stat(name, &stat); err != nil { + return nil, err + } + rdev := uint64(stat.Rdev) + ret[rdev] = strings.Replace(name, "/dev", "", -1) + } + return ret, nil +} + +func (p *Process) SendSignal(sig syscall.Signal) error { + sigAsStr := "INT" + switch sig { + case syscall.SIGSTOP: + sigAsStr = "STOP" + case syscall.SIGCONT: + sigAsStr = "CONT" + case syscall.SIGTERM: + sigAsStr = "TERM" + case syscall.SIGKILL: + sigAsStr = "KILL" + } + + kill, err := exec.LookPath("kill") + if err != nil { + return err + } + cmd := exec.Command(kill, "-s", sigAsStr, strconv.Itoa(int(p.Pid))) + cmd.Stderr = os.Stderr + err = cmd.Run() + if err != nil { + return err + } + + return nil +} + +func (p *Process) Suspend() error { + return p.SendSignal(syscall.SIGSTOP) +} +func (p *Process) Resume() error { + return p.SendSignal(syscall.SIGCONT) +} +func (p *Process) Terminate() error { + return p.SendSignal(syscall.SIGTERM) +} +func (p *Process) Kill() error { + return p.SendSignal(syscall.SIGKILL) +} +func (p *Process) Username() (string, error) { + uids, err := p.Uids() + if err != nil { + return "", err + } + if len(uids) > 0 { + u, err := user.LookupId(strconv.Itoa(int(uids[0]))) + if err != nil { + return "", err + } + return u.Username, nil + } + return "", nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_windows.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_windows.go new file mode 100644 index 00000000..3176cde0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/process_windows.go @@ -0,0 +1,357 @@ +// +build windows + +package process + +import ( + "errors" + "fmt" + "strings" + "syscall" + "time" + "unsafe" + + "github.com/StackExchange/wmi" + "github.com/shirou/w32" + + cpu "github.com/shirou/gopsutil/cpu" + "github.com/shirou/gopsutil/internal/common" + net "github.com/shirou/gopsutil/net" +) + +const ( + NoMoreFiles = 0x12 + MaxPathLength = 260 +) + +type SystemProcessInformation struct { + NextEntryOffset uint64 + NumberOfThreads uint64 + Reserved1 [48]byte + Reserved2 [3]byte + UniqueProcessID uintptr + Reserved3 uintptr + HandleCount uint64 + Reserved4 [4]byte + Reserved5 [11]byte + PeakPagefileUsage uint64 + PrivatePageCount uint64 + Reserved6 [6]uint64 +} + +// Memory_info_ex is different between OSes +type MemoryInfoExStat struct { +} + +type MemoryMapsStat struct { +} + +type Win32_Process struct { + Name string + ExecutablePath *string + CommandLine *string + Priority uint32 + CreationDate *time.Time + ProcessID uint32 + ThreadCount uint32 + + /* + CSCreationClassName string + CSName string + Caption *string + CreationClassName string + Description *string + ExecutionState *uint16 + HandleCount uint32 + KernelModeTime uint64 + MaximumWorkingSetSize *uint32 + MinimumWorkingSetSize *uint32 + OSCreationClassName string + OSName string + OtherOperationCount uint64 + OtherTransferCount uint64 + PageFaults uint32 + PageFileUsage uint32 + ParentProcessID uint32 + PeakPageFileUsage uint32 + PeakVirtualSize uint64 + PeakWorkingSetSize uint32 + PrivatePageCount uint64 + ReadOperationCount uint64 + ReadTransferCount uint64 + Status *string + TerminationDate *time.Time + UserModeTime uint64 + WorkingSetSize uint64 + WriteOperationCount uint64 + WriteTransferCount uint64 + */ +} + +func Pids() ([]int32, error) { + var ret []int32 + + procs, err := processes() + if err != nil { + return ret, nil + } + + for _, proc := range procs { + ret = append(ret, proc.Pid) + } + + return ret, nil +} + +func (p *Process) Ppid() (int32, error) { + ret, _, _, err := p.getFromSnapProcess(p.Pid) + if err != nil { + return 0, err + } + return ret, nil +} + +func GetWin32Proc(pid int32) ([]Win32_Process, error) { + var dst []Win32_Process + query := fmt.Sprintf("WHERE ProcessId = %d", pid) + q := wmi.CreateQuery(&dst, query) + err := wmi.Query(q, &dst) + if err != nil { + return []Win32_Process{}, fmt.Errorf("could not get win32Proc: %s", err) + } + if len(dst) != 1 { + return []Win32_Process{}, fmt.Errorf("could not get win32Proc: empty") + } + return dst, nil +} + +func (p *Process) Name() (string, error) { + dst, err := GetWin32Proc(p.Pid) + if err != nil { + return "", fmt.Errorf("could not get Name: %s", err) + } + return dst[0].Name, nil +} +func (p *Process) Exe() (string, error) { + dst, err := GetWin32Proc(p.Pid) + if err != nil { + return "", fmt.Errorf("could not get ExecutablePath: %s", err) + } + return *dst[0].ExecutablePath, nil +} +func (p *Process) Cmdline() (string, error) { + dst, err := GetWin32Proc(p.Pid) + if err != nil { + return "", fmt.Errorf("could not get CommandLine: %s", err) + } + return *dst[0].CommandLine, nil +} + +// CmdlineSlice returns the command line arguments of the process as a slice with each +// element being an argument. This merely returns the CommandLine informations passed +// to the process split on the 0x20 ASCII character. +func (p *Process) CmdlineSlice() ([]string, error) { + cmdline, err := p.Cmdline() + if err != nil { + return nil, err + } + return strings.Split(cmdline, " "), nil +} + +func (p *Process) CreateTime() (int64, error) { + dst, err := GetWin32Proc(p.Pid) + if err != nil { + return 0, fmt.Errorf("could not get CreationDate: %s", err) + } + date := *dst[0].CreationDate + return date.Unix(), nil +} + +func (p *Process) Cwd() (string, error) { + return "", common.ErrNotImplementedError +} +func (p *Process) Parent() (*Process, error) { + return p, common.ErrNotImplementedError +} +func (p *Process) Status() (string, error) { + return "", common.ErrNotImplementedError +} +func (p *Process) Username() (string, error) { + return "", common.ErrNotImplementedError +} +func (p *Process) Uids() ([]int32, error) { + var uids []int32 + + return uids, common.ErrNotImplementedError +} +func (p *Process) Gids() ([]int32, error) { + var gids []int32 + return gids, common.ErrNotImplementedError +} +func (p *Process) Terminal() (string, error) { + return "", common.ErrNotImplementedError +} + +// Nice returnes priority in Windows +func (p *Process) Nice() (int32, error) { + dst, err := GetWin32Proc(p.Pid) + if err != nil { + return 0, fmt.Errorf("could not get Priority: %s", err) + } + return int32(dst[0].Priority), nil +} +func (p *Process) IOnice() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Rlimit() ([]RlimitStat, error) { + var rlimit []RlimitStat + + return rlimit, common.ErrNotImplementedError +} +func (p *Process) IOCounters() (*IOCountersStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) NumFDs() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) NumThreads() (int32, error) { + dst, err := GetWin32Proc(p.Pid) + if err != nil { + return 0, fmt.Errorf("could not get ThreadCount: %s", err) + } + return int32(dst[0].ThreadCount), nil +} +func (p *Process) Threads() (map[string]string, error) { + ret := make(map[string]string, 0) + return ret, common.ErrNotImplementedError +} +func (p *Process) Times() (*cpu.TimesStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) CPUAffinity() ([]int32, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Children() ([]*Process, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) IsRunning() (bool, error) { + return true, common.ErrNotImplementedError +} + +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + var ret []MemoryMapsStat + return &ret, common.ErrNotImplementedError +} + +func NewProcess(pid int32) (*Process, error) { + p := &Process{Pid: pid} + + return p, nil +} + +func (p *Process) SendSignal(sig syscall.Signal) error { + return common.ErrNotImplementedError +} + +func (p *Process) Suspend() error { + return common.ErrNotImplementedError +} +func (p *Process) Resume() error { + return common.ErrNotImplementedError +} +func (p *Process) Terminate() error { + return common.ErrNotImplementedError +} +func (p *Process) Kill() error { + return common.ErrNotImplementedError +} + +func (p *Process) getFromSnapProcess(pid int32) (int32, int32, string, error) { + snap := w32.CreateToolhelp32Snapshot(w32.TH32CS_SNAPPROCESS, uint32(pid)) + if snap == 0 { + return 0, 0, "", syscall.GetLastError() + } + defer w32.CloseHandle(snap) + var pe32 w32.PROCESSENTRY32 + pe32.DwSize = uint32(unsafe.Sizeof(pe32)) + if w32.Process32First(snap, &pe32) == false { + return 0, 0, "", syscall.GetLastError() + } + + if pe32.Th32ProcessID == uint32(pid) { + szexe := syscall.UTF16ToString(pe32.SzExeFile[:]) + return int32(pe32.Th32ParentProcessID), int32(pe32.CntThreads), szexe, nil + } + + for w32.Process32Next(snap, &pe32) { + if pe32.Th32ProcessID == uint32(pid) { + szexe := syscall.UTF16ToString(pe32.SzExeFile[:]) + return int32(pe32.Th32ParentProcessID), int32(pe32.CntThreads), szexe, nil + } + } + return 0, 0, "", errors.New("Couldn't find pid:" + string(pid)) +} + +// Get processes +func processes() ([]*Process, error) { + + var dst []Win32_Process + q := wmi.CreateQuery(&dst, "") + err := wmi.Query(q, &dst) + if err != nil { + return []*Process{}, err + } + if len(dst) == 0 { + return []*Process{}, fmt.Errorf("could not get Process") + } + results := make([]*Process, 0, len(dst)) + for _, proc := range dst { + p, err := NewProcess(int32(proc.ProcessID)) + if err != nil { + continue + } + results = append(results, p) + } + + return results, nil +} + +func getProcInfo(pid int32) (*SystemProcessInformation, error) { + initialBufferSize := uint64(0x4000) + bufferSize := initialBufferSize + buffer := make([]byte, bufferSize) + + var sysProcInfo SystemProcessInformation + ret, _, _ := common.ProcNtQuerySystemInformation.Call( + uintptr(unsafe.Pointer(&sysProcInfo)), + uintptr(unsafe.Pointer(&buffer[0])), + uintptr(unsafe.Pointer(&bufferSize)), + uintptr(unsafe.Pointer(&bufferSize))) + if ret != 0 { + return nil, syscall.GetLastError() + } + + return &sysProcInfo, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/types_darwin.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/types_darwin.go new file mode 100644 index 00000000..21216cd0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/types_darwin.go @@ -0,0 +1,160 @@ +// Copyright 2009 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. + +// Hand Writing +// - all pointer in ExternProc to uint64 + +// +build ignore + +/* +Input to cgo -godefs. +*/ + +// +godefs map struct_in_addr [4]byte /* in_addr */ +// +godefs map struct_in6_addr [16]byte /* in6_addr */ +// +godefs map struct_ [16]byte /* in6_addr */ + +package process + +/* +#define __DARWIN_UNIX03 0 +#define KERNEL +#define _DARWIN_USE_64_BIT_INODE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +enum { + sizeofPtr = sizeof(void*), +}; + +union sockaddr_all { + struct sockaddr s1; // this one gets used for fields + struct sockaddr_in s2; // these pad it out + struct sockaddr_in6 s3; + struct sockaddr_un s4; + struct sockaddr_dl s5; +}; + +struct sockaddr_any { + struct sockaddr addr; + char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; +}; + +struct ucred_queue { + struct ucred *tqe_next; + struct ucred **tqe_prev; + TRACEBUF +}; + +*/ +import "C" + +// Machine characteristics; for internal use. + +const ( + sizeofPtr = C.sizeofPtr + sizeofShort = C.sizeof_short + sizeofInt = C.sizeof_int + sizeofLong = C.sizeof_long + sizeofLongLong = C.sizeof_longlong +) + +// Basic types + +type ( + _C_short C.short + _C_int C.int + _C_long C.long + _C_long_long C.longlong +) + +// Time + +type Timespec C.struct_timespec + +type Timeval C.struct_timeval + +// Processes + +type Rusage C.struct_rusage + +type Rlimit C.struct_rlimit + +type UGid_t C.gid_t + +type KinfoProc C.struct_kinfo_proc + +type Eproc C.struct_eproc + +type Proc C.struct_proc + +type Session C.struct_session + +type ucred C.struct_ucred + +type Uucred C.struct__ucred + +type Upcred C.struct__pcred + +type Vmspace C.struct_vmspace + +type Sigacts C.struct_sigacts + +type ExternProc C.struct_extern_proc + +type Itimerval C.struct_itimerval + +type Vnode C.struct_vnode + +type Pgrp C.struct_pgrp + +type UserStruct C.struct_user + +type Au_session C.struct_au_session + +type Posix_cred C.struct_posix_cred + +type Label C.struct_label + +type AuditinfoAddr C.struct_auditinfo_addr +type AuMask C.struct_au_mask +type AuTidAddr C.struct_au_tid_addr + +// TAILQ(ucred) +type UcredQueue C.struct_ucred_queue diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/types_freebsd.go b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/types_freebsd.go new file mode 100644 index 00000000..aa7b3462 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/process/types_freebsd.go @@ -0,0 +1,95 @@ +// +build ignore + +// We still need editing by hands. +// go tool cgo -godefs types_freebsd.go | sed 's/\*int64/int64/' | sed 's/\*byte/int64/' > process_freebsd_amd64.go + +/* +Input to cgo -godefs. +*/ + +// +godefs map struct_pargs int64 /* pargs */ +// +godefs map struct_proc int64 /* proc */ +// +godefs map struct_user int64 /* user */ +// +godefs map struct_vnode int64 /* vnode */ +// +godefs map struct_vnode int64 /* vnode */ +// +godefs map struct_filedesc int64 /* filedesc */ +// +godefs map struct_vmspace int64 /* vmspace */ +// +godefs map struct_pcb int64 /* pcb */ +// +godefs map struct_thread int64 /* thread */ +// +godefs map struct___sigset [16]byte /* sigset */ + +package process + +/* +#include +#include + +enum { + sizeofPtr = sizeof(void*), +}; + + +*/ +import "C" + +// Machine characteristics; for internal use. + +const ( + CTLKern = 1 // "high kernel": proc, limits + KernProc = 14 // struct: process entries + KernProcPID = 1 // by process id + KernProcProc = 8 // only return procs + KernProcPathname = 12 // path to executable + KernProcArgs = 7 // get/set arguments/proctitle +) + +const ( + sizeofPtr = C.sizeofPtr + sizeofShort = C.sizeof_short + sizeofInt = C.sizeof_int + sizeofLong = C.sizeof_long + sizeofLongLong = C.sizeof_longlong +) + +const ( + sizeOfKinfoVmentry = C.sizeof_struct_kinfo_vmentry + sizeOfKinfoProc = C.sizeof_struct_kinfo_proc +) + +// from sys/proc.h +const ( + SIDL = 1 /* Process being created by fork. */ + SRUN = 2 /* Currently runnable. */ + SSLEEP = 3 /* Sleeping on an address. */ + SSTOP = 4 /* Process debugging or suspension. */ + SZOMB = 5 /* Awaiting collection by parent. */ + SWAIT = 6 /* Waiting for interrupt. */ + SLOCK = 7 /* Blocked on a lock. */ +) + +// Basic types + +type ( + _C_short C.short + _C_int C.int + _C_long C.long + _C_long_long C.longlong +) + +// Time + +type Timespec C.struct_timespec + +type Timeval C.struct_timeval + +// Processes + +type Rusage C.struct_rusage + +type Rlimit C.struct_rlimit + +type KinfoProc C.struct_kinfo_proc + +type Priority C.struct_priority + +type KinfoVmentry C.struct_kinfo_vmentry diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/v2migration.sh b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/v2migration.sh new file mode 100644 index 00000000..978cc44e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/v2migration.sh @@ -0,0 +1,134 @@ +# This script is a helper of migration to gopsutil v2 using gorename +# +# go get golang.org/x/tools/cmd/gorename + +IFS=$'\n' + +## Part 1. rename Functions to pass golint. ex) cpu.CPUTimesStat -> cpu.TimesStat + +# +# Note: +# process has IOCounters() for file IO, and also NetIOCounters() for Net IO. +# This scripts replace process.NetIOCounters() to IOCounters(). +# So you need hand-fixing process. + +TARGETS=`cat < TimesStat +CPUInfoStat -> InfoStat +CPUTimes -> Times +CPUInfo -> Info +CPUCounts -> Counts +CPUPercent -> Percent +DiskUsageStat -> UsageStat +DiskPartitionStat -> PartitionStat +DiskIOCountersStat -> IOCountersStat +DiskPartitions -> Partitions +DiskIOCounters -> IOCounters +DiskUsage -> Usage +HostInfoStat -> InfoStat +HostInfo -> Info +GetVirtualization -> Virtualization +GetPlatformInformation -> PlatformInformation +LoadAvgStat -> AvgStat +LoadAvg -> Avg +NetIOCountersStat -> IOCountersStat +NetConnectionStat -> ConnectionStat +NetProtoCountersStat -> ProtoCountersStat +NetInterfaceAddr -> InterfaceAddr +NetInterfaceStat -> InterfaceStat +NetFilterStat -> FilterStat +NetInterfaces -> Interfaces +getNetIOCountersAll -> getIOCountersAll +NetIOCounters -> IOCounters +NetIOCountersByFile -> IOCountersByFile +NetProtoCounters -> ProtoCounters +NetFilterCounters -> FilterCounters +NetConnections -> Connections +NetConnectionsPid -> ConnectionsPid +Uid -> UID +Id -> ID +convertCpuTimes -> convertCPUTimes +EOF` + +for T in $TARGETS +do + echo $T + gofmt -w -r "$T" ./*.go +done + + +###### Part 2 rename JSON key name +## Google JSOn style +## https://google.github.io/styleguide/jsoncstyleguide.xml + +sed -i "" 's/guest_nice/guestNice/g' cpu/*.go +sed -i "" 's/vendor_id/vendorId/g' cpu/*.go +sed -i "" 's/physical_id/physicalId/g' cpu/*.go +sed -i "" 's/model_name/modelName/g' cpu/*.go +sed -i "" 's/cache_size/cacheSize/g' cpu/*.go +sed -i "" 's/core_id/coreId/g' cpu/*.go + +sed -i "" 's/inodes_total/inodesTotal/g' disk/*.go +sed -i "" 's/inodes_used/inodesUsed/g' disk/*.go +sed -i "" 's/inodes_free/inodesFree/g' disk/*.go +sed -i "" 's/inodes_used_percent/inodesUsedPercent/g' disk/*.go +sed -i "" 's/read_count/readCount/g' disk/*.go +sed -i "" 's/write_count/writeCount/g' disk/*.go +sed -i "" 's/read_bytes/readBytes/g' disk/*.go +sed -i "" 's/write_bytes/writeBytes/g' disk/*.go +sed -i "" 's/read_time/readTime/g' disk/*.go +sed -i "" 's/write_time/writeTime/g' disk/*.go +sed -i "" 's/io_time/ioTime/g' disk/*.go +sed -i "" 's/serial_number/serialNumber/g' disk/*.go +sed -i "" 's/used_percent/usedPercent/g' disk/*.go +sed -i "" 's/inodesUsed_percent/inodesUsedPercent/g' disk/*.go + +sed -i "" 's/total_cache/totalCache/g' docker/*.go +sed -i "" 's/total_rss_huge/totalRssHuge/g' docker/*.go +sed -i "" 's/total_rss/totalRss/g' docker/*.go +sed -i "" 's/total_mapped_file/totalMappedFile/g' docker/*.go +sed -i "" 's/total_pgpgin/totalPgpgin/g' docker/*.go +sed -i "" 's/total_pgpgout/totalPgpgout/g' docker/*.go +sed -i "" 's/total_pgfault/totalPgfault/g' docker/*.go +sed -i "" 's/total_pgmajfault/totalPgmajfault/g' docker/*.go +sed -i "" 's/total_inactive_anon/totalInactiveAnon/g' docker/*.go +sed -i "" 's/total_active_anon/totalActiveAnon/g' docker/*.go +sed -i "" 's/total_inactive_file/totalInactiveFile/g' docker/*.go +sed -i "" 's/total_active_file/totalActiveFile/g' docker/*.go +sed -i "" 's/total_unevictable/totalUnevictable/g' docker/*.go +sed -i "" 's/mem_usage_in_bytes/memUsageInBytes/g' docker/*.go +sed -i "" 's/mem_max_usage_in_bytes/memMaxUsageInBytes/g' docker/*.go +sed -i "" 's/memory.limit_in_bytes/memoryLimitInBbytes/g' docker/*.go +sed -i "" 's/memory.failcnt/memoryFailcnt/g' docker/*.go +sed -i "" 's/mapped_file/mappedFile/g' docker/*.go +sed -i "" 's/container_id/containerID/g' docker/*.go +sed -i "" 's/rss_huge/rssHuge/g' docker/*.go +sed -i "" 's/inactive_anon/inactiveAnon/g' docker/*.go +sed -i "" 's/active_anon/activeAnon/g' docker/*.go +sed -i "" 's/inactive_file/inactiveFile/g' docker/*.go +sed -i "" 's/active_file/activeFile/g' docker/*.go +sed -i "" 's/hierarchical_memory_limit/hierarchicalMemoryLimit/g' docker/*.go + +sed -i "" 's/boot_time/bootTime/g' host/*.go +sed -i "" 's/platform_family/platformFamily/g' host/*.go +sed -i "" 's/platform_version/platformVersion/g' host/*.go +sed -i "" 's/virtualization_system/virtualizationSystem/g' host/*.go +sed -i "" 's/virtualization_role/virtualizationRole/g' host/*.go + +sed -i "" 's/used_percent/usedPercent/g' mem/*.go + +sed -i "" 's/bytes_sent/bytesSent/g' net/*.go +sed -i "" 's/bytes_recv/bytesRecv/g' net/*.go +sed -i "" 's/packets_sent/packetsSent/g' net/*.go +sed -i "" 's/packets_recv/packetsRecv/g' net/*.go +sed -i "" 's/conntrack_count/conntrackCount/g' net/*.go +sed -i "" 's/conntrack_max/conntrackMax/g' net/*.go + +sed -i "" 's/read_count/readCount/g' process/*.go +sed -i "" 's/write_count/writeCount/g' process/*.go +sed -i "" 's/read_bytes/readBytes/g' process/*.go +sed -i "" 's/write_bytes/writeBytes/g' process/*.go +sed -i "" 's/shared_clean/sharedClean/g' process/*.go +sed -i "" 's/shared_dirty/sharedDirty/g' process/*.go +sed -i "" 's/private_clean/privateClean/g' process/*.go +sed -i "" 's/private_dirty/privateDirty/g' process/*.go diff --git a/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/windows_memo.rst b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/windows_memo.rst new file mode 100644 index 00000000..38abed81 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/shirou/gopsutil/windows_memo.rst @@ -0,0 +1,36 @@ +Windows memo +===================== + +Size +---------- + +DWORD + 32-bit unsigned integer +DWORDLONG + 64-bit unsigned integer +DWORD_PTR + unsigned long type for pointer precision +DWORD32 + 32-bit unsigned integer +DWORD64 + 64-bit unsigned integer +HALF_PTR + _WIN64 = int, else short +INT + 32-bit signed integer +INT_PTR + _WIN64 = __int64 else int +LONG + 32-bit signed integer +LONGLONG + 64-bit signed integer +LONG_PTR + _WIN64 = __int64 else long +SHORT + 16-bit integer +SIZE_T + maximum number of bytes to which a pointer can point. typedef ULONG_PTR SIZE_T; +SSIZE_T + signed version of SIZE_T. typedef LONG_PTR SSIZE_T; +WORD + 16-bit unsigned integer \ No newline at end of file diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/LICENSE.md b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/LICENSE.md new file mode 100644 index 00000000..21999458 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/LICENSE.md @@ -0,0 +1,23 @@ +objx - by Mat Ryer and Tyler Bunnell + +The MIT License (MIT) + +Copyright (c) 2014 Stretchr, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/README.md b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/README.md new file mode 100644 index 00000000..4aa18068 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/README.md @@ -0,0 +1,3 @@ +# objx + + * Jump into the [API Documentation](http://godoc.org/github.com/stretchr/objx) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/accessors.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/accessors.go new file mode 100644 index 00000000..721bcac7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/accessors.go @@ -0,0 +1,179 @@ +package objx + +import ( + "fmt" + "regexp" + "strconv" + "strings" +) + +// arrayAccesRegexString is the regex used to extract the array number +// from the access path +const arrayAccesRegexString = `^(.+)\[([0-9]+)\]$` + +// arrayAccesRegex is the compiled arrayAccesRegexString +var arrayAccesRegex = regexp.MustCompile(arrayAccesRegexString) + +// Get gets the value using the specified selector and +// returns it inside a new Obj object. +// +// If it cannot find the value, Get will return a nil +// value inside an instance of Obj. +// +// Get can only operate directly on map[string]interface{} and []interface. +// +// Example +// +// To access the title of the third chapter of the second book, do: +// +// o.Get("books[1].chapters[2].title") +func (m Map) Get(selector string) *Value { + rawObj := access(m, selector, nil, false, false) + return &Value{data: rawObj} +} + +// Set sets the value using the specified selector and +// returns the object on which Set was called. +// +// Set can only operate directly on map[string]interface{} and []interface +// +// Example +// +// To set the title of the third chapter of the second book, do: +// +// o.Set("books[1].chapters[2].title","Time to Go") +func (m Map) Set(selector string, value interface{}) Map { + access(m, selector, value, true, false) + return m +} + +// access accesses the object using the selector and performs the +// appropriate action. +func access(current, selector, value interface{}, isSet, panics bool) interface{} { + + switch selector.(type) { + case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64: + + if array, ok := current.([]interface{}); ok { + index := intFromInterface(selector) + + if index >= len(array) { + if panics { + panic(fmt.Sprintf("objx: Index %d is out of range. Slice only contains %d items.", index, len(array))) + } + return nil + } + + return array[index] + } + + return nil + + case string: + + selStr := selector.(string) + selSegs := strings.SplitN(selStr, PathSeparator, 2) + thisSel := selSegs[0] + index := -1 + var err error + + // https://github.com/stretchr/objx/issues/12 + if strings.Contains(thisSel, "[") { + + arrayMatches := arrayAccesRegex.FindStringSubmatch(thisSel) + + if len(arrayMatches) > 0 { + + // Get the key into the map + thisSel = arrayMatches[1] + + // Get the index into the array at the key + index, err = strconv.Atoi(arrayMatches[2]) + + if err != nil { + // This should never happen. If it does, something has gone + // seriously wrong. Panic. + panic("objx: Array index is not an integer. Must use array[int].") + } + + } + } + + if curMap, ok := current.(Map); ok { + current = map[string]interface{}(curMap) + } + + // get the object in question + switch current.(type) { + case map[string]interface{}: + curMSI := current.(map[string]interface{}) + if len(selSegs) <= 1 && isSet { + curMSI[thisSel] = value + return nil + } else { + current = curMSI[thisSel] + } + default: + current = nil + } + + if current == nil && panics { + panic(fmt.Sprintf("objx: '%v' invalid on object.", selector)) + } + + // do we need to access the item of an array? + if index > -1 { + if array, ok := current.([]interface{}); ok { + if index < len(array) { + current = array[index] + } else { + if panics { + panic(fmt.Sprintf("objx: Index %d is out of range. Slice only contains %d items.", index, len(array))) + } + current = nil + } + } + } + + if len(selSegs) > 1 { + current = access(current, selSegs[1], value, isSet, panics) + } + + } + + return current + +} + +// intFromInterface converts an interface object to the largest +// representation of an unsigned integer using a type switch and +// assertions +func intFromInterface(selector interface{}) int { + var value int + switch selector.(type) { + case int: + value = selector.(int) + case int8: + value = int(selector.(int8)) + case int16: + value = int(selector.(int16)) + case int32: + value = int(selector.(int32)) + case int64: + value = int(selector.(int64)) + case uint: + value = int(selector.(uint)) + case uint8: + value = int(selector.(uint8)) + case uint16: + value = int(selector.(uint16)) + case uint32: + value = int(selector.(uint32)) + case uint64: + value = int(selector.(uint64)) + default: + panic("objx: array access argument is not an integer type (this should never happen)") + } + + return value +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/codegen/index.html b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/codegen/index.html new file mode 100644 index 00000000..379ffc3c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/codegen/index.html @@ -0,0 +1,86 @@ + + + + Codegen + + + + + +

+ Template +

+

+ Use {x} as a placeholder for each argument. +

+ + +

+ Arguments (comma separated) +

+

+ One block per line +

+ + +

+ Output +

+ + + + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/constants.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/constants.go new file mode 100644 index 00000000..f9eb42a2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/constants.go @@ -0,0 +1,13 @@ +package objx + +const ( + // PathSeparator is the character used to separate the elements + // of the keypath. + // + // For example, `location.address.city` + PathSeparator string = "." + + // SignatureSeparator is the character that is used to + // separate the Base64 string from the security signature. + SignatureSeparator = "_" +) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/conversions.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/conversions.go new file mode 100644 index 00000000..9cdfa9f9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/conversions.go @@ -0,0 +1,117 @@ +package objx + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "net/url" +) + +// JSON converts the contained object to a JSON string +// representation +func (m Map) JSON() (string, error) { + + result, err := json.Marshal(m) + + if err != nil { + err = errors.New("objx: JSON encode failed with: " + err.Error()) + } + + return string(result), err + +} + +// MustJSON converts the contained object to a JSON string +// representation and panics if there is an error +func (m Map) MustJSON() string { + result, err := m.JSON() + if err != nil { + panic(err.Error()) + } + return result +} + +// Base64 converts the contained object to a Base64 string +// representation of the JSON string representation +func (m Map) Base64() (string, error) { + + var buf bytes.Buffer + + jsonData, err := m.JSON() + if err != nil { + return "", err + } + + encoder := base64.NewEncoder(base64.StdEncoding, &buf) + encoder.Write([]byte(jsonData)) + encoder.Close() + + return buf.String(), nil + +} + +// MustBase64 converts the contained object to a Base64 string +// representation of the JSON string representation and panics +// if there is an error +func (m Map) MustBase64() string { + result, err := m.Base64() + if err != nil { + panic(err.Error()) + } + return result +} + +// SignedBase64 converts the contained object to a Base64 string +// representation of the JSON string representation and signs it +// using the provided key. +func (m Map) SignedBase64(key string) (string, error) { + + base64, err := m.Base64() + if err != nil { + return "", err + } + + sig := HashWithKey(base64, key) + + return base64 + SignatureSeparator + sig, nil + +} + +// MustSignedBase64 converts the contained object to a Base64 string +// representation of the JSON string representation and signs it +// using the provided key and panics if there is an error +func (m Map) MustSignedBase64(key string) string { + result, err := m.SignedBase64(key) + if err != nil { + panic(err.Error()) + } + return result +} + +/* + URL Query + ------------------------------------------------ +*/ + +// URLValues creates a url.Values object from an Obj. This +// function requires that the wrapped object be a map[string]interface{} +func (m Map) URLValues() url.Values { + + vals := make(url.Values) + + for k, v := range m { + //TODO: can this be done without sprintf? + vals.Set(k, fmt.Sprintf("%v", v)) + } + + return vals +} + +// URLQuery gets an encoded URL query representing the given +// Obj. This function requires that the wrapped object be a +// map[string]interface{} +func (m Map) URLQuery() (string, error) { + return m.URLValues().Encode(), nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/doc.go new file mode 100644 index 00000000..47bf85e4 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/doc.go @@ -0,0 +1,72 @@ +// objx - Go package for dealing with maps, slices, JSON and other data. +// +// Overview +// +// Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes +// a powerful `Get` method (among others) that allows you to easily and quickly get +// access to data within the map, without having to worry too much about type assertions, +// missing data, default values etc. +// +// Pattern +// +// Objx uses a preditable pattern to make access data from within `map[string]interface{}'s +// easy. +// +// Call one of the `objx.` functions to create your `objx.Map` to get going: +// +// m, err := objx.FromJSON(json) +// +// NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong, +// the rest will be optimistic and try to figure things out without panicking. +// +// Use `Get` to access the value you're interested in. You can use dot and array +// notation too: +// +// m.Get("places[0].latlng") +// +// Once you have saught the `Value` you're interested in, you can use the `Is*` methods +// to determine its type. +// +// if m.Get("code").IsStr() { /* ... */ } +// +// Or you can just assume the type, and use one of the strong type methods to +// extract the real value: +// +// m.Get("code").Int() +// +// If there's no value there (or if it's the wrong type) then a default value +// will be returned, or you can be explicit about the default value. +// +// Get("code").Int(-1) +// +// If you're dealing with a slice of data as a value, Objx provides many useful +// methods for iterating, manipulating and selecting that data. You can find out more +// by exploring the index below. +// +// Reading data +// +// A simple example of how to use Objx: +// +// // use MustFromJSON to make an objx.Map from some JSON +// m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) +// +// // get the details +// name := m.Get("name").Str() +// age := m.Get("age").Int() +// +// // get their nickname (or use their name if they +// // don't have one) +// nickname := m.Get("nickname").Str(name) +// +// Ranging +// +// Since `objx.Map` is a `map[string]interface{}` you can treat it as such. For +// example, to `range` the data, do what you would expect: +// +// m := objx.MustFromJSON(json) +// for key, value := range m { +// +// /* ... do your magic ... */ +// +// } +package objx diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/map.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/map.go new file mode 100644 index 00000000..eb6ed8e2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/map.go @@ -0,0 +1,222 @@ +package objx + +import ( + "encoding/base64" + "encoding/json" + "errors" + "io/ioutil" + "net/url" + "strings" +) + +// MSIConvertable is an interface that defines methods for converting your +// custom types to a map[string]interface{} representation. +type MSIConvertable interface { + // MSI gets a map[string]interface{} (msi) representing the + // object. + MSI() map[string]interface{} +} + +// Map provides extended functionality for working with +// untyped data, in particular map[string]interface (msi). +type Map map[string]interface{} + +// Value returns the internal value instance +func (m Map) Value() *Value { + return &Value{data: m} +} + +// Nil represents a nil Map. +var Nil Map = New(nil) + +// New creates a new Map containing the map[string]interface{} in the data argument. +// If the data argument is not a map[string]interface, New attempts to call the +// MSI() method on the MSIConvertable interface to create one. +func New(data interface{}) Map { + if _, ok := data.(map[string]interface{}); !ok { + if converter, ok := data.(MSIConvertable); ok { + data = converter.MSI() + } else { + return nil + } + } + return Map(data.(map[string]interface{})) +} + +// MSI creates a map[string]interface{} and puts it inside a new Map. +// +// The arguments follow a key, value pattern. +// +// Panics +// +// Panics if any key arugment is non-string or if there are an odd number of arguments. +// +// Example +// +// To easily create Maps: +// +// m := objx.MSI("name", "Mat", "age", 29, "subobj", objx.MSI("active", true)) +// +// // creates an Map equivalent to +// m := objx.New(map[string]interface{}{"name": "Mat", "age": 29, "subobj": map[string]interface{}{"active": true}}) +func MSI(keyAndValuePairs ...interface{}) Map { + + newMap := make(map[string]interface{}) + keyAndValuePairsLen := len(keyAndValuePairs) + + if keyAndValuePairsLen%2 != 0 { + panic("objx: MSI must have an even number of arguments following the 'key, value' pattern.") + } + + for i := 0; i < keyAndValuePairsLen; i = i + 2 { + + key := keyAndValuePairs[i] + value := keyAndValuePairs[i+1] + + // make sure the key is a string + keyString, keyStringOK := key.(string) + if !keyStringOK { + panic("objx: MSI must follow 'string, interface{}' pattern. " + keyString + " is not a valid key.") + } + + newMap[keyString] = value + + } + + return New(newMap) +} + +// ****** Conversion Constructors + +// MustFromJSON creates a new Map containing the data specified in the +// jsonString. +// +// Panics if the JSON is invalid. +func MustFromJSON(jsonString string) Map { + o, err := FromJSON(jsonString) + + if err != nil { + panic("objx: MustFromJSON failed with error: " + err.Error()) + } + + return o +} + +// FromJSON creates a new Map containing the data specified in the +// jsonString. +// +// Returns an error if the JSON is invalid. +func FromJSON(jsonString string) (Map, error) { + + var data interface{} + err := json.Unmarshal([]byte(jsonString), &data) + + if err != nil { + return Nil, err + } + + return New(data), nil + +} + +// FromBase64 creates a new Obj containing the data specified +// in the Base64 string. +// +// The string is an encoded JSON string returned by Base64 +func FromBase64(base64String string) (Map, error) { + + decoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(base64String)) + + decoded, err := ioutil.ReadAll(decoder) + if err != nil { + return nil, err + } + + return FromJSON(string(decoded)) +} + +// MustFromBase64 creates a new Obj containing the data specified +// in the Base64 string and panics if there is an error. +// +// The string is an encoded JSON string returned by Base64 +func MustFromBase64(base64String string) Map { + + result, err := FromBase64(base64String) + + if err != nil { + panic("objx: MustFromBase64 failed with error: " + err.Error()) + } + + return result +} + +// FromSignedBase64 creates a new Obj containing the data specified +// in the Base64 string. +// +// The string is an encoded JSON string returned by SignedBase64 +func FromSignedBase64(base64String, key string) (Map, error) { + parts := strings.Split(base64String, SignatureSeparator) + if len(parts) != 2 { + return nil, errors.New("objx: Signed base64 string is malformed.") + } + + sig := HashWithKey(parts[0], key) + if parts[1] != sig { + return nil, errors.New("objx: Signature for base64 data does not match.") + } + + return FromBase64(parts[0]) +} + +// MustFromSignedBase64 creates a new Obj containing the data specified +// in the Base64 string and panics if there is an error. +// +// The string is an encoded JSON string returned by Base64 +func MustFromSignedBase64(base64String, key string) Map { + + result, err := FromSignedBase64(base64String, key) + + if err != nil { + panic("objx: MustFromSignedBase64 failed with error: " + err.Error()) + } + + return result +} + +// FromURLQuery generates a new Obj by parsing the specified +// query. +// +// For queries with multiple values, the first value is selected. +func FromURLQuery(query string) (Map, error) { + + vals, err := url.ParseQuery(query) + + if err != nil { + return nil, err + } + + m := make(map[string]interface{}) + for k, vals := range vals { + m[k] = vals[0] + } + + return New(m), nil +} + +// MustFromURLQuery generates a new Obj by parsing the specified +// query. +// +// For queries with multiple values, the first value is selected. +// +// Panics if it encounters an error +func MustFromURLQuery(query string) Map { + + o, err := FromURLQuery(query) + + if err != nil { + panic("objx: MustFromURLQuery failed with error: " + err.Error()) + } + + return o + +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/mutations.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/mutations.go new file mode 100644 index 00000000..b35c8639 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/mutations.go @@ -0,0 +1,81 @@ +package objx + +// Exclude returns a new Map with the keys in the specified []string +// excluded. +func (d Map) Exclude(exclude []string) Map { + + excluded := make(Map) + for k, v := range d { + var shouldInclude bool = true + for _, toExclude := range exclude { + if k == toExclude { + shouldInclude = false + break + } + } + if shouldInclude { + excluded[k] = v + } + } + + return excluded +} + +// Copy creates a shallow copy of the Obj. +func (m Map) Copy() Map { + copied := make(map[string]interface{}) + for k, v := range m { + copied[k] = v + } + return New(copied) +} + +// Merge blends the specified map with a copy of this map and returns the result. +// +// Keys that appear in both will be selected from the specified map. +// This method requires that the wrapped object be a map[string]interface{} +func (m Map) Merge(merge Map) Map { + return m.Copy().MergeHere(merge) +} + +// Merge blends the specified map with this map and returns the current map. +// +// Keys that appear in both will be selected from the specified map. The original map +// will be modified. This method requires that +// the wrapped object be a map[string]interface{} +func (m Map) MergeHere(merge Map) Map { + + for k, v := range merge { + m[k] = v + } + + return m + +} + +// Transform builds a new Obj giving the transformer a chance +// to change the keys and values as it goes. This method requires that +// the wrapped object be a map[string]interface{} +func (m Map) Transform(transformer func(key string, value interface{}) (string, interface{})) Map { + newMap := make(map[string]interface{}) + for k, v := range m { + modifiedKey, modifiedVal := transformer(k, v) + newMap[modifiedKey] = modifiedVal + } + return New(newMap) +} + +// TransformKeys builds a new map using the specified key mapping. +// +// Unspecified keys will be unaltered. +// This method requires that the wrapped object be a map[string]interface{} +func (m Map) TransformKeys(mapping map[string]string) Map { + return m.Transform(func(key string, value interface{}) (string, interface{}) { + + if newKey, ok := mapping[key]; ok { + return newKey, value + } + + return key, value + }) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/security.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/security.go new file mode 100644 index 00000000..fdd6be9c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/security.go @@ -0,0 +1,14 @@ +package objx + +import ( + "crypto/sha1" + "encoding/hex" +) + +// HashWithKey hashes the specified string using the security +// key. +func HashWithKey(data, key string) string { + hash := sha1.New() + hash.Write([]byte(data + ":" + key)) + return hex.EncodeToString(hash.Sum(nil)) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/tests.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/tests.go new file mode 100644 index 00000000..d9e0b479 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/tests.go @@ -0,0 +1,17 @@ +package objx + +// Has gets whether there is something at the specified selector +// or not. +// +// If m is nil, Has will always return false. +func (m Map) Has(selector string) bool { + if m == nil { + return false + } + return !m.Get(selector).IsNil() +} + +// IsNil gets whether the data is nil or not. +func (v *Value) IsNil() bool { + return v == nil || v.data == nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/type_specific_codegen.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/type_specific_codegen.go new file mode 100644 index 00000000..f3ecb29b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/type_specific_codegen.go @@ -0,0 +1,2881 @@ +package objx + +/* + Inter (interface{} and []interface{}) + -------------------------------------------------- +*/ + +// Inter gets the value as a interface{}, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Inter(optionalDefault ...interface{}) interface{} { + if s, ok := v.data.(interface{}); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInter gets the value as a interface{}. +// +// Panics if the object is not a interface{}. +func (v *Value) MustInter() interface{} { + return v.data.(interface{}) +} + +// InterSlice gets the value as a []interface{}, returns the optionalDefault +// value or nil if the value is not a []interface{}. +func (v *Value) InterSlice(optionalDefault ...[]interface{}) []interface{} { + if s, ok := v.data.([]interface{}); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInterSlice gets the value as a []interface{}. +// +// Panics if the object is not a []interface{}. +func (v *Value) MustInterSlice() []interface{} { + return v.data.([]interface{}) +} + +// IsInter gets whether the object contained is a interface{} or not. +func (v *Value) IsInter() bool { + _, ok := v.data.(interface{}) + return ok +} + +// IsInterSlice gets whether the object contained is a []interface{} or not. +func (v *Value) IsInterSlice() bool { + _, ok := v.data.([]interface{}) + return ok +} + +// EachInter calls the specified callback for each object +// in the []interface{}. +// +// Panics if the object is the wrong type. +func (v *Value) EachInter(callback func(int, interface{}) bool) *Value { + + for index, val := range v.MustInterSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInter uses the specified decider function to select items +// from the []interface{}. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInter(decider func(int, interface{}) bool) *Value { + + var selected []interface{} + + v.EachInter(func(index int, val interface{}) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInter uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]interface{}. +func (v *Value) GroupInter(grouper func(int, interface{}) string) *Value { + + groups := make(map[string][]interface{}) + + v.EachInter(func(index int, val interface{}) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]interface{}, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInter uses the specified function to replace each interface{}s +// by iterating each item. The data in the returned result will be a +// []interface{} containing the replaced items. +func (v *Value) ReplaceInter(replacer func(int, interface{}) interface{}) *Value { + + arr := v.MustInterSlice() + replaced := make([]interface{}, len(arr)) + + v.EachInter(func(index int, val interface{}) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInter uses the specified collector function to collect a value +// for each of the interface{}s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInter(collector func(int, interface{}) interface{}) *Value { + + arr := v.MustInterSlice() + collected := make([]interface{}, len(arr)) + + v.EachInter(func(index int, val interface{}) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + MSI (map[string]interface{} and []map[string]interface{}) + -------------------------------------------------- +*/ + +// MSI gets the value as a map[string]interface{}, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) MSI(optionalDefault ...map[string]interface{}) map[string]interface{} { + if s, ok := v.data.(map[string]interface{}); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustMSI gets the value as a map[string]interface{}. +// +// Panics if the object is not a map[string]interface{}. +func (v *Value) MustMSI() map[string]interface{} { + return v.data.(map[string]interface{}) +} + +// MSISlice gets the value as a []map[string]interface{}, returns the optionalDefault +// value or nil if the value is not a []map[string]interface{}. +func (v *Value) MSISlice(optionalDefault ...[]map[string]interface{}) []map[string]interface{} { + if s, ok := v.data.([]map[string]interface{}); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustMSISlice gets the value as a []map[string]interface{}. +// +// Panics if the object is not a []map[string]interface{}. +func (v *Value) MustMSISlice() []map[string]interface{} { + return v.data.([]map[string]interface{}) +} + +// IsMSI gets whether the object contained is a map[string]interface{} or not. +func (v *Value) IsMSI() bool { + _, ok := v.data.(map[string]interface{}) + return ok +} + +// IsMSISlice gets whether the object contained is a []map[string]interface{} or not. +func (v *Value) IsMSISlice() bool { + _, ok := v.data.([]map[string]interface{}) + return ok +} + +// EachMSI calls the specified callback for each object +// in the []map[string]interface{}. +// +// Panics if the object is the wrong type. +func (v *Value) EachMSI(callback func(int, map[string]interface{}) bool) *Value { + + for index, val := range v.MustMSISlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereMSI uses the specified decider function to select items +// from the []map[string]interface{}. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereMSI(decider func(int, map[string]interface{}) bool) *Value { + + var selected []map[string]interface{} + + v.EachMSI(func(index int, val map[string]interface{}) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupMSI uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]map[string]interface{}. +func (v *Value) GroupMSI(grouper func(int, map[string]interface{}) string) *Value { + + groups := make(map[string][]map[string]interface{}) + + v.EachMSI(func(index int, val map[string]interface{}) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]map[string]interface{}, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceMSI uses the specified function to replace each map[string]interface{}s +// by iterating each item. The data in the returned result will be a +// []map[string]interface{} containing the replaced items. +func (v *Value) ReplaceMSI(replacer func(int, map[string]interface{}) map[string]interface{}) *Value { + + arr := v.MustMSISlice() + replaced := make([]map[string]interface{}, len(arr)) + + v.EachMSI(func(index int, val map[string]interface{}) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectMSI uses the specified collector function to collect a value +// for each of the map[string]interface{}s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectMSI(collector func(int, map[string]interface{}) interface{}) *Value { + + arr := v.MustMSISlice() + collected := make([]interface{}, len(arr)) + + v.EachMSI(func(index int, val map[string]interface{}) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + ObjxMap ((Map) and [](Map)) + -------------------------------------------------- +*/ + +// ObjxMap gets the value as a (Map), returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) ObjxMap(optionalDefault ...(Map)) Map { + if s, ok := v.data.((Map)); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return New(nil) +} + +// MustObjxMap gets the value as a (Map). +// +// Panics if the object is not a (Map). +func (v *Value) MustObjxMap() Map { + return v.data.((Map)) +} + +// ObjxMapSlice gets the value as a [](Map), returns the optionalDefault +// value or nil if the value is not a [](Map). +func (v *Value) ObjxMapSlice(optionalDefault ...[](Map)) [](Map) { + if s, ok := v.data.([](Map)); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustObjxMapSlice gets the value as a [](Map). +// +// Panics if the object is not a [](Map). +func (v *Value) MustObjxMapSlice() [](Map) { + return v.data.([](Map)) +} + +// IsObjxMap gets whether the object contained is a (Map) or not. +func (v *Value) IsObjxMap() bool { + _, ok := v.data.((Map)) + return ok +} + +// IsObjxMapSlice gets whether the object contained is a [](Map) or not. +func (v *Value) IsObjxMapSlice() bool { + _, ok := v.data.([](Map)) + return ok +} + +// EachObjxMap calls the specified callback for each object +// in the [](Map). +// +// Panics if the object is the wrong type. +func (v *Value) EachObjxMap(callback func(int, Map) bool) *Value { + + for index, val := range v.MustObjxMapSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereObjxMap uses the specified decider function to select items +// from the [](Map). The object contained in the result will contain +// only the selected items. +func (v *Value) WhereObjxMap(decider func(int, Map) bool) *Value { + + var selected [](Map) + + v.EachObjxMap(func(index int, val Map) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupObjxMap uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][](Map). +func (v *Value) GroupObjxMap(grouper func(int, Map) string) *Value { + + groups := make(map[string][](Map)) + + v.EachObjxMap(func(index int, val Map) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([](Map), 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceObjxMap uses the specified function to replace each (Map)s +// by iterating each item. The data in the returned result will be a +// [](Map) containing the replaced items. +func (v *Value) ReplaceObjxMap(replacer func(int, Map) Map) *Value { + + arr := v.MustObjxMapSlice() + replaced := make([](Map), len(arr)) + + v.EachObjxMap(func(index int, val Map) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectObjxMap uses the specified collector function to collect a value +// for each of the (Map)s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectObjxMap(collector func(int, Map) interface{}) *Value { + + arr := v.MustObjxMapSlice() + collected := make([]interface{}, len(arr)) + + v.EachObjxMap(func(index int, val Map) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Bool (bool and []bool) + -------------------------------------------------- +*/ + +// Bool gets the value as a bool, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Bool(optionalDefault ...bool) bool { + if s, ok := v.data.(bool); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return false +} + +// MustBool gets the value as a bool. +// +// Panics if the object is not a bool. +func (v *Value) MustBool() bool { + return v.data.(bool) +} + +// BoolSlice gets the value as a []bool, returns the optionalDefault +// value or nil if the value is not a []bool. +func (v *Value) BoolSlice(optionalDefault ...[]bool) []bool { + if s, ok := v.data.([]bool); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustBoolSlice gets the value as a []bool. +// +// Panics if the object is not a []bool. +func (v *Value) MustBoolSlice() []bool { + return v.data.([]bool) +} + +// IsBool gets whether the object contained is a bool or not. +func (v *Value) IsBool() bool { + _, ok := v.data.(bool) + return ok +} + +// IsBoolSlice gets whether the object contained is a []bool or not. +func (v *Value) IsBoolSlice() bool { + _, ok := v.data.([]bool) + return ok +} + +// EachBool calls the specified callback for each object +// in the []bool. +// +// Panics if the object is the wrong type. +func (v *Value) EachBool(callback func(int, bool) bool) *Value { + + for index, val := range v.MustBoolSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereBool uses the specified decider function to select items +// from the []bool. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereBool(decider func(int, bool) bool) *Value { + + var selected []bool + + v.EachBool(func(index int, val bool) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupBool uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]bool. +func (v *Value) GroupBool(grouper func(int, bool) string) *Value { + + groups := make(map[string][]bool) + + v.EachBool(func(index int, val bool) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]bool, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceBool uses the specified function to replace each bools +// by iterating each item. The data in the returned result will be a +// []bool containing the replaced items. +func (v *Value) ReplaceBool(replacer func(int, bool) bool) *Value { + + arr := v.MustBoolSlice() + replaced := make([]bool, len(arr)) + + v.EachBool(func(index int, val bool) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectBool uses the specified collector function to collect a value +// for each of the bools in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectBool(collector func(int, bool) interface{}) *Value { + + arr := v.MustBoolSlice() + collected := make([]interface{}, len(arr)) + + v.EachBool(func(index int, val bool) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Str (string and []string) + -------------------------------------------------- +*/ + +// Str gets the value as a string, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Str(optionalDefault ...string) string { + if s, ok := v.data.(string); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return "" +} + +// MustStr gets the value as a string. +// +// Panics if the object is not a string. +func (v *Value) MustStr() string { + return v.data.(string) +} + +// StrSlice gets the value as a []string, returns the optionalDefault +// value or nil if the value is not a []string. +func (v *Value) StrSlice(optionalDefault ...[]string) []string { + if s, ok := v.data.([]string); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustStrSlice gets the value as a []string. +// +// Panics if the object is not a []string. +func (v *Value) MustStrSlice() []string { + return v.data.([]string) +} + +// IsStr gets whether the object contained is a string or not. +func (v *Value) IsStr() bool { + _, ok := v.data.(string) + return ok +} + +// IsStrSlice gets whether the object contained is a []string or not. +func (v *Value) IsStrSlice() bool { + _, ok := v.data.([]string) + return ok +} + +// EachStr calls the specified callback for each object +// in the []string. +// +// Panics if the object is the wrong type. +func (v *Value) EachStr(callback func(int, string) bool) *Value { + + for index, val := range v.MustStrSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereStr uses the specified decider function to select items +// from the []string. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereStr(decider func(int, string) bool) *Value { + + var selected []string + + v.EachStr(func(index int, val string) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupStr uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]string. +func (v *Value) GroupStr(grouper func(int, string) string) *Value { + + groups := make(map[string][]string) + + v.EachStr(func(index int, val string) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]string, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceStr uses the specified function to replace each strings +// by iterating each item. The data in the returned result will be a +// []string containing the replaced items. +func (v *Value) ReplaceStr(replacer func(int, string) string) *Value { + + arr := v.MustStrSlice() + replaced := make([]string, len(arr)) + + v.EachStr(func(index int, val string) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectStr uses the specified collector function to collect a value +// for each of the strings in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectStr(collector func(int, string) interface{}) *Value { + + arr := v.MustStrSlice() + collected := make([]interface{}, len(arr)) + + v.EachStr(func(index int, val string) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int (int and []int) + -------------------------------------------------- +*/ + +// Int gets the value as a int, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int(optionalDefault ...int) int { + if s, ok := v.data.(int); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt gets the value as a int. +// +// Panics if the object is not a int. +func (v *Value) MustInt() int { + return v.data.(int) +} + +// IntSlice gets the value as a []int, returns the optionalDefault +// value or nil if the value is not a []int. +func (v *Value) IntSlice(optionalDefault ...[]int) []int { + if s, ok := v.data.([]int); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustIntSlice gets the value as a []int. +// +// Panics if the object is not a []int. +func (v *Value) MustIntSlice() []int { + return v.data.([]int) +} + +// IsInt gets whether the object contained is a int or not. +func (v *Value) IsInt() bool { + _, ok := v.data.(int) + return ok +} + +// IsIntSlice gets whether the object contained is a []int or not. +func (v *Value) IsIntSlice() bool { + _, ok := v.data.([]int) + return ok +} + +// EachInt calls the specified callback for each object +// in the []int. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt(callback func(int, int) bool) *Value { + + for index, val := range v.MustIntSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt uses the specified decider function to select items +// from the []int. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt(decider func(int, int) bool) *Value { + + var selected []int + + v.EachInt(func(index int, val int) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int. +func (v *Value) GroupInt(grouper func(int, int) string) *Value { + + groups := make(map[string][]int) + + v.EachInt(func(index int, val int) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt uses the specified function to replace each ints +// by iterating each item. The data in the returned result will be a +// []int containing the replaced items. +func (v *Value) ReplaceInt(replacer func(int, int) int) *Value { + + arr := v.MustIntSlice() + replaced := make([]int, len(arr)) + + v.EachInt(func(index int, val int) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt uses the specified collector function to collect a value +// for each of the ints in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt(collector func(int, int) interface{}) *Value { + + arr := v.MustIntSlice() + collected := make([]interface{}, len(arr)) + + v.EachInt(func(index int, val int) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int8 (int8 and []int8) + -------------------------------------------------- +*/ + +// Int8 gets the value as a int8, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int8(optionalDefault ...int8) int8 { + if s, ok := v.data.(int8); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt8 gets the value as a int8. +// +// Panics if the object is not a int8. +func (v *Value) MustInt8() int8 { + return v.data.(int8) +} + +// Int8Slice gets the value as a []int8, returns the optionalDefault +// value or nil if the value is not a []int8. +func (v *Value) Int8Slice(optionalDefault ...[]int8) []int8 { + if s, ok := v.data.([]int8); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInt8Slice gets the value as a []int8. +// +// Panics if the object is not a []int8. +func (v *Value) MustInt8Slice() []int8 { + return v.data.([]int8) +} + +// IsInt8 gets whether the object contained is a int8 or not. +func (v *Value) IsInt8() bool { + _, ok := v.data.(int8) + return ok +} + +// IsInt8Slice gets whether the object contained is a []int8 or not. +func (v *Value) IsInt8Slice() bool { + _, ok := v.data.([]int8) + return ok +} + +// EachInt8 calls the specified callback for each object +// in the []int8. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt8(callback func(int, int8) bool) *Value { + + for index, val := range v.MustInt8Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt8 uses the specified decider function to select items +// from the []int8. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt8(decider func(int, int8) bool) *Value { + + var selected []int8 + + v.EachInt8(func(index int, val int8) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt8 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int8. +func (v *Value) GroupInt8(grouper func(int, int8) string) *Value { + + groups := make(map[string][]int8) + + v.EachInt8(func(index int, val int8) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int8, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt8 uses the specified function to replace each int8s +// by iterating each item. The data in the returned result will be a +// []int8 containing the replaced items. +func (v *Value) ReplaceInt8(replacer func(int, int8) int8) *Value { + + arr := v.MustInt8Slice() + replaced := make([]int8, len(arr)) + + v.EachInt8(func(index int, val int8) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt8 uses the specified collector function to collect a value +// for each of the int8s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt8(collector func(int, int8) interface{}) *Value { + + arr := v.MustInt8Slice() + collected := make([]interface{}, len(arr)) + + v.EachInt8(func(index int, val int8) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int16 (int16 and []int16) + -------------------------------------------------- +*/ + +// Int16 gets the value as a int16, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int16(optionalDefault ...int16) int16 { + if s, ok := v.data.(int16); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt16 gets the value as a int16. +// +// Panics if the object is not a int16. +func (v *Value) MustInt16() int16 { + return v.data.(int16) +} + +// Int16Slice gets the value as a []int16, returns the optionalDefault +// value or nil if the value is not a []int16. +func (v *Value) Int16Slice(optionalDefault ...[]int16) []int16 { + if s, ok := v.data.([]int16); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInt16Slice gets the value as a []int16. +// +// Panics if the object is not a []int16. +func (v *Value) MustInt16Slice() []int16 { + return v.data.([]int16) +} + +// IsInt16 gets whether the object contained is a int16 or not. +func (v *Value) IsInt16() bool { + _, ok := v.data.(int16) + return ok +} + +// IsInt16Slice gets whether the object contained is a []int16 or not. +func (v *Value) IsInt16Slice() bool { + _, ok := v.data.([]int16) + return ok +} + +// EachInt16 calls the specified callback for each object +// in the []int16. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt16(callback func(int, int16) bool) *Value { + + for index, val := range v.MustInt16Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt16 uses the specified decider function to select items +// from the []int16. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt16(decider func(int, int16) bool) *Value { + + var selected []int16 + + v.EachInt16(func(index int, val int16) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt16 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int16. +func (v *Value) GroupInt16(grouper func(int, int16) string) *Value { + + groups := make(map[string][]int16) + + v.EachInt16(func(index int, val int16) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int16, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt16 uses the specified function to replace each int16s +// by iterating each item. The data in the returned result will be a +// []int16 containing the replaced items. +func (v *Value) ReplaceInt16(replacer func(int, int16) int16) *Value { + + arr := v.MustInt16Slice() + replaced := make([]int16, len(arr)) + + v.EachInt16(func(index int, val int16) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt16 uses the specified collector function to collect a value +// for each of the int16s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt16(collector func(int, int16) interface{}) *Value { + + arr := v.MustInt16Slice() + collected := make([]interface{}, len(arr)) + + v.EachInt16(func(index int, val int16) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int32 (int32 and []int32) + -------------------------------------------------- +*/ + +// Int32 gets the value as a int32, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int32(optionalDefault ...int32) int32 { + if s, ok := v.data.(int32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt32 gets the value as a int32. +// +// Panics if the object is not a int32. +func (v *Value) MustInt32() int32 { + return v.data.(int32) +} + +// Int32Slice gets the value as a []int32, returns the optionalDefault +// value or nil if the value is not a []int32. +func (v *Value) Int32Slice(optionalDefault ...[]int32) []int32 { + if s, ok := v.data.([]int32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInt32Slice gets the value as a []int32. +// +// Panics if the object is not a []int32. +func (v *Value) MustInt32Slice() []int32 { + return v.data.([]int32) +} + +// IsInt32 gets whether the object contained is a int32 or not. +func (v *Value) IsInt32() bool { + _, ok := v.data.(int32) + return ok +} + +// IsInt32Slice gets whether the object contained is a []int32 or not. +func (v *Value) IsInt32Slice() bool { + _, ok := v.data.([]int32) + return ok +} + +// EachInt32 calls the specified callback for each object +// in the []int32. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt32(callback func(int, int32) bool) *Value { + + for index, val := range v.MustInt32Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt32 uses the specified decider function to select items +// from the []int32. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt32(decider func(int, int32) bool) *Value { + + var selected []int32 + + v.EachInt32(func(index int, val int32) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt32 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int32. +func (v *Value) GroupInt32(grouper func(int, int32) string) *Value { + + groups := make(map[string][]int32) + + v.EachInt32(func(index int, val int32) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int32, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt32 uses the specified function to replace each int32s +// by iterating each item. The data in the returned result will be a +// []int32 containing the replaced items. +func (v *Value) ReplaceInt32(replacer func(int, int32) int32) *Value { + + arr := v.MustInt32Slice() + replaced := make([]int32, len(arr)) + + v.EachInt32(func(index int, val int32) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt32 uses the specified collector function to collect a value +// for each of the int32s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt32(collector func(int, int32) interface{}) *Value { + + arr := v.MustInt32Slice() + collected := make([]interface{}, len(arr)) + + v.EachInt32(func(index int, val int32) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int64 (int64 and []int64) + -------------------------------------------------- +*/ + +// Int64 gets the value as a int64, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int64(optionalDefault ...int64) int64 { + if s, ok := v.data.(int64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt64 gets the value as a int64. +// +// Panics if the object is not a int64. +func (v *Value) MustInt64() int64 { + return v.data.(int64) +} + +// Int64Slice gets the value as a []int64, returns the optionalDefault +// value or nil if the value is not a []int64. +func (v *Value) Int64Slice(optionalDefault ...[]int64) []int64 { + if s, ok := v.data.([]int64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInt64Slice gets the value as a []int64. +// +// Panics if the object is not a []int64. +func (v *Value) MustInt64Slice() []int64 { + return v.data.([]int64) +} + +// IsInt64 gets whether the object contained is a int64 or not. +func (v *Value) IsInt64() bool { + _, ok := v.data.(int64) + return ok +} + +// IsInt64Slice gets whether the object contained is a []int64 or not. +func (v *Value) IsInt64Slice() bool { + _, ok := v.data.([]int64) + return ok +} + +// EachInt64 calls the specified callback for each object +// in the []int64. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt64(callback func(int, int64) bool) *Value { + + for index, val := range v.MustInt64Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt64 uses the specified decider function to select items +// from the []int64. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt64(decider func(int, int64) bool) *Value { + + var selected []int64 + + v.EachInt64(func(index int, val int64) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt64 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int64. +func (v *Value) GroupInt64(grouper func(int, int64) string) *Value { + + groups := make(map[string][]int64) + + v.EachInt64(func(index int, val int64) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int64, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt64 uses the specified function to replace each int64s +// by iterating each item. The data in the returned result will be a +// []int64 containing the replaced items. +func (v *Value) ReplaceInt64(replacer func(int, int64) int64) *Value { + + arr := v.MustInt64Slice() + replaced := make([]int64, len(arr)) + + v.EachInt64(func(index int, val int64) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt64 uses the specified collector function to collect a value +// for each of the int64s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt64(collector func(int, int64) interface{}) *Value { + + arr := v.MustInt64Slice() + collected := make([]interface{}, len(arr)) + + v.EachInt64(func(index int, val int64) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint (uint and []uint) + -------------------------------------------------- +*/ + +// Uint gets the value as a uint, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint(optionalDefault ...uint) uint { + if s, ok := v.data.(uint); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint gets the value as a uint. +// +// Panics if the object is not a uint. +func (v *Value) MustUint() uint { + return v.data.(uint) +} + +// UintSlice gets the value as a []uint, returns the optionalDefault +// value or nil if the value is not a []uint. +func (v *Value) UintSlice(optionalDefault ...[]uint) []uint { + if s, ok := v.data.([]uint); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUintSlice gets the value as a []uint. +// +// Panics if the object is not a []uint. +func (v *Value) MustUintSlice() []uint { + return v.data.([]uint) +} + +// IsUint gets whether the object contained is a uint or not. +func (v *Value) IsUint() bool { + _, ok := v.data.(uint) + return ok +} + +// IsUintSlice gets whether the object contained is a []uint or not. +func (v *Value) IsUintSlice() bool { + _, ok := v.data.([]uint) + return ok +} + +// EachUint calls the specified callback for each object +// in the []uint. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint(callback func(int, uint) bool) *Value { + + for index, val := range v.MustUintSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint uses the specified decider function to select items +// from the []uint. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint(decider func(int, uint) bool) *Value { + + var selected []uint + + v.EachUint(func(index int, val uint) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint. +func (v *Value) GroupUint(grouper func(int, uint) string) *Value { + + groups := make(map[string][]uint) + + v.EachUint(func(index int, val uint) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint uses the specified function to replace each uints +// by iterating each item. The data in the returned result will be a +// []uint containing the replaced items. +func (v *Value) ReplaceUint(replacer func(int, uint) uint) *Value { + + arr := v.MustUintSlice() + replaced := make([]uint, len(arr)) + + v.EachUint(func(index int, val uint) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint uses the specified collector function to collect a value +// for each of the uints in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint(collector func(int, uint) interface{}) *Value { + + arr := v.MustUintSlice() + collected := make([]interface{}, len(arr)) + + v.EachUint(func(index int, val uint) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint8 (uint8 and []uint8) + -------------------------------------------------- +*/ + +// Uint8 gets the value as a uint8, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint8(optionalDefault ...uint8) uint8 { + if s, ok := v.data.(uint8); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint8 gets the value as a uint8. +// +// Panics if the object is not a uint8. +func (v *Value) MustUint8() uint8 { + return v.data.(uint8) +} + +// Uint8Slice gets the value as a []uint8, returns the optionalDefault +// value or nil if the value is not a []uint8. +func (v *Value) Uint8Slice(optionalDefault ...[]uint8) []uint8 { + if s, ok := v.data.([]uint8); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUint8Slice gets the value as a []uint8. +// +// Panics if the object is not a []uint8. +func (v *Value) MustUint8Slice() []uint8 { + return v.data.([]uint8) +} + +// IsUint8 gets whether the object contained is a uint8 or not. +func (v *Value) IsUint8() bool { + _, ok := v.data.(uint8) + return ok +} + +// IsUint8Slice gets whether the object contained is a []uint8 or not. +func (v *Value) IsUint8Slice() bool { + _, ok := v.data.([]uint8) + return ok +} + +// EachUint8 calls the specified callback for each object +// in the []uint8. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint8(callback func(int, uint8) bool) *Value { + + for index, val := range v.MustUint8Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint8 uses the specified decider function to select items +// from the []uint8. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint8(decider func(int, uint8) bool) *Value { + + var selected []uint8 + + v.EachUint8(func(index int, val uint8) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint8 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint8. +func (v *Value) GroupUint8(grouper func(int, uint8) string) *Value { + + groups := make(map[string][]uint8) + + v.EachUint8(func(index int, val uint8) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint8, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint8 uses the specified function to replace each uint8s +// by iterating each item. The data in the returned result will be a +// []uint8 containing the replaced items. +func (v *Value) ReplaceUint8(replacer func(int, uint8) uint8) *Value { + + arr := v.MustUint8Slice() + replaced := make([]uint8, len(arr)) + + v.EachUint8(func(index int, val uint8) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint8 uses the specified collector function to collect a value +// for each of the uint8s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint8(collector func(int, uint8) interface{}) *Value { + + arr := v.MustUint8Slice() + collected := make([]interface{}, len(arr)) + + v.EachUint8(func(index int, val uint8) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint16 (uint16 and []uint16) + -------------------------------------------------- +*/ + +// Uint16 gets the value as a uint16, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint16(optionalDefault ...uint16) uint16 { + if s, ok := v.data.(uint16); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint16 gets the value as a uint16. +// +// Panics if the object is not a uint16. +func (v *Value) MustUint16() uint16 { + return v.data.(uint16) +} + +// Uint16Slice gets the value as a []uint16, returns the optionalDefault +// value or nil if the value is not a []uint16. +func (v *Value) Uint16Slice(optionalDefault ...[]uint16) []uint16 { + if s, ok := v.data.([]uint16); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUint16Slice gets the value as a []uint16. +// +// Panics if the object is not a []uint16. +func (v *Value) MustUint16Slice() []uint16 { + return v.data.([]uint16) +} + +// IsUint16 gets whether the object contained is a uint16 or not. +func (v *Value) IsUint16() bool { + _, ok := v.data.(uint16) + return ok +} + +// IsUint16Slice gets whether the object contained is a []uint16 or not. +func (v *Value) IsUint16Slice() bool { + _, ok := v.data.([]uint16) + return ok +} + +// EachUint16 calls the specified callback for each object +// in the []uint16. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint16(callback func(int, uint16) bool) *Value { + + for index, val := range v.MustUint16Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint16 uses the specified decider function to select items +// from the []uint16. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint16(decider func(int, uint16) bool) *Value { + + var selected []uint16 + + v.EachUint16(func(index int, val uint16) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint16 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint16. +func (v *Value) GroupUint16(grouper func(int, uint16) string) *Value { + + groups := make(map[string][]uint16) + + v.EachUint16(func(index int, val uint16) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint16, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint16 uses the specified function to replace each uint16s +// by iterating each item. The data in the returned result will be a +// []uint16 containing the replaced items. +func (v *Value) ReplaceUint16(replacer func(int, uint16) uint16) *Value { + + arr := v.MustUint16Slice() + replaced := make([]uint16, len(arr)) + + v.EachUint16(func(index int, val uint16) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint16 uses the specified collector function to collect a value +// for each of the uint16s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint16(collector func(int, uint16) interface{}) *Value { + + arr := v.MustUint16Slice() + collected := make([]interface{}, len(arr)) + + v.EachUint16(func(index int, val uint16) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint32 (uint32 and []uint32) + -------------------------------------------------- +*/ + +// Uint32 gets the value as a uint32, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint32(optionalDefault ...uint32) uint32 { + if s, ok := v.data.(uint32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint32 gets the value as a uint32. +// +// Panics if the object is not a uint32. +func (v *Value) MustUint32() uint32 { + return v.data.(uint32) +} + +// Uint32Slice gets the value as a []uint32, returns the optionalDefault +// value or nil if the value is not a []uint32. +func (v *Value) Uint32Slice(optionalDefault ...[]uint32) []uint32 { + if s, ok := v.data.([]uint32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUint32Slice gets the value as a []uint32. +// +// Panics if the object is not a []uint32. +func (v *Value) MustUint32Slice() []uint32 { + return v.data.([]uint32) +} + +// IsUint32 gets whether the object contained is a uint32 or not. +func (v *Value) IsUint32() bool { + _, ok := v.data.(uint32) + return ok +} + +// IsUint32Slice gets whether the object contained is a []uint32 or not. +func (v *Value) IsUint32Slice() bool { + _, ok := v.data.([]uint32) + return ok +} + +// EachUint32 calls the specified callback for each object +// in the []uint32. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint32(callback func(int, uint32) bool) *Value { + + for index, val := range v.MustUint32Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint32 uses the specified decider function to select items +// from the []uint32. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint32(decider func(int, uint32) bool) *Value { + + var selected []uint32 + + v.EachUint32(func(index int, val uint32) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint32 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint32. +func (v *Value) GroupUint32(grouper func(int, uint32) string) *Value { + + groups := make(map[string][]uint32) + + v.EachUint32(func(index int, val uint32) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint32, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint32 uses the specified function to replace each uint32s +// by iterating each item. The data in the returned result will be a +// []uint32 containing the replaced items. +func (v *Value) ReplaceUint32(replacer func(int, uint32) uint32) *Value { + + arr := v.MustUint32Slice() + replaced := make([]uint32, len(arr)) + + v.EachUint32(func(index int, val uint32) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint32 uses the specified collector function to collect a value +// for each of the uint32s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint32(collector func(int, uint32) interface{}) *Value { + + arr := v.MustUint32Slice() + collected := make([]interface{}, len(arr)) + + v.EachUint32(func(index int, val uint32) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint64 (uint64 and []uint64) + -------------------------------------------------- +*/ + +// Uint64 gets the value as a uint64, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint64(optionalDefault ...uint64) uint64 { + if s, ok := v.data.(uint64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint64 gets the value as a uint64. +// +// Panics if the object is not a uint64. +func (v *Value) MustUint64() uint64 { + return v.data.(uint64) +} + +// Uint64Slice gets the value as a []uint64, returns the optionalDefault +// value or nil if the value is not a []uint64. +func (v *Value) Uint64Slice(optionalDefault ...[]uint64) []uint64 { + if s, ok := v.data.([]uint64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUint64Slice gets the value as a []uint64. +// +// Panics if the object is not a []uint64. +func (v *Value) MustUint64Slice() []uint64 { + return v.data.([]uint64) +} + +// IsUint64 gets whether the object contained is a uint64 or not. +func (v *Value) IsUint64() bool { + _, ok := v.data.(uint64) + return ok +} + +// IsUint64Slice gets whether the object contained is a []uint64 or not. +func (v *Value) IsUint64Slice() bool { + _, ok := v.data.([]uint64) + return ok +} + +// EachUint64 calls the specified callback for each object +// in the []uint64. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint64(callback func(int, uint64) bool) *Value { + + for index, val := range v.MustUint64Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint64 uses the specified decider function to select items +// from the []uint64. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint64(decider func(int, uint64) bool) *Value { + + var selected []uint64 + + v.EachUint64(func(index int, val uint64) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint64 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint64. +func (v *Value) GroupUint64(grouper func(int, uint64) string) *Value { + + groups := make(map[string][]uint64) + + v.EachUint64(func(index int, val uint64) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint64, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint64 uses the specified function to replace each uint64s +// by iterating each item. The data in the returned result will be a +// []uint64 containing the replaced items. +func (v *Value) ReplaceUint64(replacer func(int, uint64) uint64) *Value { + + arr := v.MustUint64Slice() + replaced := make([]uint64, len(arr)) + + v.EachUint64(func(index int, val uint64) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint64 uses the specified collector function to collect a value +// for each of the uint64s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint64(collector func(int, uint64) interface{}) *Value { + + arr := v.MustUint64Slice() + collected := make([]interface{}, len(arr)) + + v.EachUint64(func(index int, val uint64) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uintptr (uintptr and []uintptr) + -------------------------------------------------- +*/ + +// Uintptr gets the value as a uintptr, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uintptr(optionalDefault ...uintptr) uintptr { + if s, ok := v.data.(uintptr); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUintptr gets the value as a uintptr. +// +// Panics if the object is not a uintptr. +func (v *Value) MustUintptr() uintptr { + return v.data.(uintptr) +} + +// UintptrSlice gets the value as a []uintptr, returns the optionalDefault +// value or nil if the value is not a []uintptr. +func (v *Value) UintptrSlice(optionalDefault ...[]uintptr) []uintptr { + if s, ok := v.data.([]uintptr); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUintptrSlice gets the value as a []uintptr. +// +// Panics if the object is not a []uintptr. +func (v *Value) MustUintptrSlice() []uintptr { + return v.data.([]uintptr) +} + +// IsUintptr gets whether the object contained is a uintptr or not. +func (v *Value) IsUintptr() bool { + _, ok := v.data.(uintptr) + return ok +} + +// IsUintptrSlice gets whether the object contained is a []uintptr or not. +func (v *Value) IsUintptrSlice() bool { + _, ok := v.data.([]uintptr) + return ok +} + +// EachUintptr calls the specified callback for each object +// in the []uintptr. +// +// Panics if the object is the wrong type. +func (v *Value) EachUintptr(callback func(int, uintptr) bool) *Value { + + for index, val := range v.MustUintptrSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUintptr uses the specified decider function to select items +// from the []uintptr. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUintptr(decider func(int, uintptr) bool) *Value { + + var selected []uintptr + + v.EachUintptr(func(index int, val uintptr) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUintptr uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uintptr. +func (v *Value) GroupUintptr(grouper func(int, uintptr) string) *Value { + + groups := make(map[string][]uintptr) + + v.EachUintptr(func(index int, val uintptr) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uintptr, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUintptr uses the specified function to replace each uintptrs +// by iterating each item. The data in the returned result will be a +// []uintptr containing the replaced items. +func (v *Value) ReplaceUintptr(replacer func(int, uintptr) uintptr) *Value { + + arr := v.MustUintptrSlice() + replaced := make([]uintptr, len(arr)) + + v.EachUintptr(func(index int, val uintptr) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUintptr uses the specified collector function to collect a value +// for each of the uintptrs in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUintptr(collector func(int, uintptr) interface{}) *Value { + + arr := v.MustUintptrSlice() + collected := make([]interface{}, len(arr)) + + v.EachUintptr(func(index int, val uintptr) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Float32 (float32 and []float32) + -------------------------------------------------- +*/ + +// Float32 gets the value as a float32, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Float32(optionalDefault ...float32) float32 { + if s, ok := v.data.(float32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustFloat32 gets the value as a float32. +// +// Panics if the object is not a float32. +func (v *Value) MustFloat32() float32 { + return v.data.(float32) +} + +// Float32Slice gets the value as a []float32, returns the optionalDefault +// value or nil if the value is not a []float32. +func (v *Value) Float32Slice(optionalDefault ...[]float32) []float32 { + if s, ok := v.data.([]float32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustFloat32Slice gets the value as a []float32. +// +// Panics if the object is not a []float32. +func (v *Value) MustFloat32Slice() []float32 { + return v.data.([]float32) +} + +// IsFloat32 gets whether the object contained is a float32 or not. +func (v *Value) IsFloat32() bool { + _, ok := v.data.(float32) + return ok +} + +// IsFloat32Slice gets whether the object contained is a []float32 or not. +func (v *Value) IsFloat32Slice() bool { + _, ok := v.data.([]float32) + return ok +} + +// EachFloat32 calls the specified callback for each object +// in the []float32. +// +// Panics if the object is the wrong type. +func (v *Value) EachFloat32(callback func(int, float32) bool) *Value { + + for index, val := range v.MustFloat32Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereFloat32 uses the specified decider function to select items +// from the []float32. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereFloat32(decider func(int, float32) bool) *Value { + + var selected []float32 + + v.EachFloat32(func(index int, val float32) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupFloat32 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]float32. +func (v *Value) GroupFloat32(grouper func(int, float32) string) *Value { + + groups := make(map[string][]float32) + + v.EachFloat32(func(index int, val float32) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]float32, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceFloat32 uses the specified function to replace each float32s +// by iterating each item. The data in the returned result will be a +// []float32 containing the replaced items. +func (v *Value) ReplaceFloat32(replacer func(int, float32) float32) *Value { + + arr := v.MustFloat32Slice() + replaced := make([]float32, len(arr)) + + v.EachFloat32(func(index int, val float32) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectFloat32 uses the specified collector function to collect a value +// for each of the float32s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectFloat32(collector func(int, float32) interface{}) *Value { + + arr := v.MustFloat32Slice() + collected := make([]interface{}, len(arr)) + + v.EachFloat32(func(index int, val float32) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Float64 (float64 and []float64) + -------------------------------------------------- +*/ + +// Float64 gets the value as a float64, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Float64(optionalDefault ...float64) float64 { + if s, ok := v.data.(float64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustFloat64 gets the value as a float64. +// +// Panics if the object is not a float64. +func (v *Value) MustFloat64() float64 { + return v.data.(float64) +} + +// Float64Slice gets the value as a []float64, returns the optionalDefault +// value or nil if the value is not a []float64. +func (v *Value) Float64Slice(optionalDefault ...[]float64) []float64 { + if s, ok := v.data.([]float64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustFloat64Slice gets the value as a []float64. +// +// Panics if the object is not a []float64. +func (v *Value) MustFloat64Slice() []float64 { + return v.data.([]float64) +} + +// IsFloat64 gets whether the object contained is a float64 or not. +func (v *Value) IsFloat64() bool { + _, ok := v.data.(float64) + return ok +} + +// IsFloat64Slice gets whether the object contained is a []float64 or not. +func (v *Value) IsFloat64Slice() bool { + _, ok := v.data.([]float64) + return ok +} + +// EachFloat64 calls the specified callback for each object +// in the []float64. +// +// Panics if the object is the wrong type. +func (v *Value) EachFloat64(callback func(int, float64) bool) *Value { + + for index, val := range v.MustFloat64Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereFloat64 uses the specified decider function to select items +// from the []float64. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereFloat64(decider func(int, float64) bool) *Value { + + var selected []float64 + + v.EachFloat64(func(index int, val float64) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupFloat64 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]float64. +func (v *Value) GroupFloat64(grouper func(int, float64) string) *Value { + + groups := make(map[string][]float64) + + v.EachFloat64(func(index int, val float64) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]float64, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceFloat64 uses the specified function to replace each float64s +// by iterating each item. The data in the returned result will be a +// []float64 containing the replaced items. +func (v *Value) ReplaceFloat64(replacer func(int, float64) float64) *Value { + + arr := v.MustFloat64Slice() + replaced := make([]float64, len(arr)) + + v.EachFloat64(func(index int, val float64) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectFloat64 uses the specified collector function to collect a value +// for each of the float64s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectFloat64(collector func(int, float64) interface{}) *Value { + + arr := v.MustFloat64Slice() + collected := make([]interface{}, len(arr)) + + v.EachFloat64(func(index int, val float64) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Complex64 (complex64 and []complex64) + -------------------------------------------------- +*/ + +// Complex64 gets the value as a complex64, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Complex64(optionalDefault ...complex64) complex64 { + if s, ok := v.data.(complex64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustComplex64 gets the value as a complex64. +// +// Panics if the object is not a complex64. +func (v *Value) MustComplex64() complex64 { + return v.data.(complex64) +} + +// Complex64Slice gets the value as a []complex64, returns the optionalDefault +// value or nil if the value is not a []complex64. +func (v *Value) Complex64Slice(optionalDefault ...[]complex64) []complex64 { + if s, ok := v.data.([]complex64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustComplex64Slice gets the value as a []complex64. +// +// Panics if the object is not a []complex64. +func (v *Value) MustComplex64Slice() []complex64 { + return v.data.([]complex64) +} + +// IsComplex64 gets whether the object contained is a complex64 or not. +func (v *Value) IsComplex64() bool { + _, ok := v.data.(complex64) + return ok +} + +// IsComplex64Slice gets whether the object contained is a []complex64 or not. +func (v *Value) IsComplex64Slice() bool { + _, ok := v.data.([]complex64) + return ok +} + +// EachComplex64 calls the specified callback for each object +// in the []complex64. +// +// Panics if the object is the wrong type. +func (v *Value) EachComplex64(callback func(int, complex64) bool) *Value { + + for index, val := range v.MustComplex64Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereComplex64 uses the specified decider function to select items +// from the []complex64. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereComplex64(decider func(int, complex64) bool) *Value { + + var selected []complex64 + + v.EachComplex64(func(index int, val complex64) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupComplex64 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]complex64. +func (v *Value) GroupComplex64(grouper func(int, complex64) string) *Value { + + groups := make(map[string][]complex64) + + v.EachComplex64(func(index int, val complex64) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]complex64, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceComplex64 uses the specified function to replace each complex64s +// by iterating each item. The data in the returned result will be a +// []complex64 containing the replaced items. +func (v *Value) ReplaceComplex64(replacer func(int, complex64) complex64) *Value { + + arr := v.MustComplex64Slice() + replaced := make([]complex64, len(arr)) + + v.EachComplex64(func(index int, val complex64) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectComplex64 uses the specified collector function to collect a value +// for each of the complex64s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectComplex64(collector func(int, complex64) interface{}) *Value { + + arr := v.MustComplex64Slice() + collected := make([]interface{}, len(arr)) + + v.EachComplex64(func(index int, val complex64) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Complex128 (complex128 and []complex128) + -------------------------------------------------- +*/ + +// Complex128 gets the value as a complex128, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Complex128(optionalDefault ...complex128) complex128 { + if s, ok := v.data.(complex128); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustComplex128 gets the value as a complex128. +// +// Panics if the object is not a complex128. +func (v *Value) MustComplex128() complex128 { + return v.data.(complex128) +} + +// Complex128Slice gets the value as a []complex128, returns the optionalDefault +// value or nil if the value is not a []complex128. +func (v *Value) Complex128Slice(optionalDefault ...[]complex128) []complex128 { + if s, ok := v.data.([]complex128); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustComplex128Slice gets the value as a []complex128. +// +// Panics if the object is not a []complex128. +func (v *Value) MustComplex128Slice() []complex128 { + return v.data.([]complex128) +} + +// IsComplex128 gets whether the object contained is a complex128 or not. +func (v *Value) IsComplex128() bool { + _, ok := v.data.(complex128) + return ok +} + +// IsComplex128Slice gets whether the object contained is a []complex128 or not. +func (v *Value) IsComplex128Slice() bool { + _, ok := v.data.([]complex128) + return ok +} + +// EachComplex128 calls the specified callback for each object +// in the []complex128. +// +// Panics if the object is the wrong type. +func (v *Value) EachComplex128(callback func(int, complex128) bool) *Value { + + for index, val := range v.MustComplex128Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereComplex128 uses the specified decider function to select items +// from the []complex128. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereComplex128(decider func(int, complex128) bool) *Value { + + var selected []complex128 + + v.EachComplex128(func(index int, val complex128) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupComplex128 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]complex128. +func (v *Value) GroupComplex128(grouper func(int, complex128) string) *Value { + + groups := make(map[string][]complex128) + + v.EachComplex128(func(index int, val complex128) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]complex128, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceComplex128 uses the specified function to replace each complex128s +// by iterating each item. The data in the returned result will be a +// []complex128 containing the replaced items. +func (v *Value) ReplaceComplex128(replacer func(int, complex128) complex128) *Value { + + arr := v.MustComplex128Slice() + replaced := make([]complex128, len(arr)) + + v.EachComplex128(func(index int, val complex128) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectComplex128 uses the specified collector function to collect a value +// for each of the complex128s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectComplex128(collector func(int, complex128) interface{}) *Value { + + arr := v.MustComplex128Slice() + collected := make([]interface{}, len(arr)) + + v.EachComplex128(func(index int, val complex128) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/value.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/value.go new file mode 100644 index 00000000..956a2211 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/objx/value.go @@ -0,0 +1,56 @@ +package objx + +import ( + "fmt" + "strconv" +) + +// Value provides methods for extracting interface{} data in various +// types. +type Value struct { + // data contains the raw data being managed by this Value + data interface{} +} + +// Data returns the raw data contained by this Value +func (v *Value) Data() interface{} { + return v.data +} + +// String returns the value always as a string +func (v *Value) String() string { + switch { + case v.IsStr(): + return v.Str() + case v.IsBool(): + return strconv.FormatBool(v.Bool()) + case v.IsFloat32(): + return strconv.FormatFloat(float64(v.Float32()), 'f', -1, 32) + case v.IsFloat64(): + return strconv.FormatFloat(v.Float64(), 'f', -1, 64) + case v.IsInt(): + return strconv.FormatInt(int64(v.Int()), 10) + case v.IsInt(): + return strconv.FormatInt(int64(v.Int()), 10) + case v.IsInt8(): + return strconv.FormatInt(int64(v.Int8()), 10) + case v.IsInt16(): + return strconv.FormatInt(int64(v.Int16()), 10) + case v.IsInt32(): + return strconv.FormatInt(int64(v.Int32()), 10) + case v.IsInt64(): + return strconv.FormatInt(v.Int64(), 10) + case v.IsUint(): + return strconv.FormatUint(uint64(v.Uint()), 10) + case v.IsUint8(): + return strconv.FormatUint(uint64(v.Uint8()), 10) + case v.IsUint16(): + return strconv.FormatUint(uint64(v.Uint16()), 10) + case v.IsUint32(): + return strconv.FormatUint(uint64(v.Uint32()), 10) + case v.IsUint64(): + return strconv.FormatUint(v.Uint64(), 10) + } + + return fmt.Sprintf("%#v", v.Data()) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/Godeps/Godeps.json b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/Godeps/Godeps.json new file mode 100644 index 00000000..b206a609 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/Godeps/Godeps.json @@ -0,0 +1,21 @@ +{ + "ImportPath": "github.com/stretchr/testify", + "GoVersion": "go1.5", + "Packages": [ + "./..." + ], + "Deps": [ + { + "ImportPath": "github.com/davecgh/go-spew/spew", + "Rev": "2df174808ee097f90d259e432cc04442cf60be21" + }, + { + "ImportPath": "github.com/pmezard/go-difflib/difflib", + "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" + }, + { + "ImportPath": "github.com/stretchr/objx", + "Rev": "cbeaeb16a013161a98496fad62933b1d21786672" + } + ] +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/Godeps/Readme b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/Godeps/Readme new file mode 100644 index 00000000..4cdaa53d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/Godeps/Readme @@ -0,0 +1,5 @@ +This directory tree is generated automatically by godep. + +Please do not edit. + +See https://github.com/tools/godep for more information. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/LICENSE new file mode 100644 index 00000000..473b670a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell + +Please consider promoting this project if you find it useful. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/README.md b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/README.md new file mode 100644 index 00000000..aaf2aa0a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/README.md @@ -0,0 +1,332 @@ +Testify - Thou Shalt Write Tests +================================ + +[![Build Status](https://travis-ci.org/stretchr/testify.svg)](https://travis-ci.org/stretchr/testify) + +Go code (golang) set of packages that provide many tools for testifying that your code will behave as you intend. + +Features include: + + * [Easy assertions](#assert-package) + * [Mocking](#mock-package) + * [HTTP response trapping](#http-package) + * [Testing suite interfaces and functions](#suite-package) + +Get started: + + * Install testify with [one line of code](#installation), or [update it with another](#staying-up-to-date) + * For an introduction to writing test code in Go, see http://golang.org/doc/code.html#Testing + * Check out the API Documentation http://godoc.org/github.com/stretchr/testify + * To make your testing life easier, check out our other project, [gorc](http://github.com/stretchr/gorc) + * A little about [Test-Driven Development (TDD)](http://en.wikipedia.org/wiki/Test-driven_development) + + + +[`assert`](http://godoc.org/github.com/stretchr/testify/assert "API documentation") package +------------------------------------------------------------------------------------------- + +The `assert` package provides some helpful methods that allow you to write better test code in Go. + + * Prints friendly, easy to read failure descriptions + * Allows for very readable code + * Optionally annotate each assertion with a message + +See it in action: + +```go +package yours + +import ( + "testing" + "github.com/stretchr/testify/assert" +) + +func TestSomething(t *testing.T) { + + // assert equality + assert.Equal(t, 123, 123, "they should be equal") + + // assert inequality + assert.NotEqual(t, 123, 456, "they should not be equal") + + // assert for nil (good for errors) + assert.Nil(t, object) + + // assert for not nil (good when you expect something) + if assert.NotNil(t, object) { + + // now we know that object isn't nil, we are safe to make + // further assertions without causing any errors + assert.Equal(t, "Something", object.Value) + + } + +} +``` + + * Every assert func takes the `testing.T` object as the first argument. This is how it writes the errors out through the normal `go test` capabilities. + * Every assert func returns a bool indicating whether the assertion was successful or not, this is useful for if you want to go on making further assertions under certain conditions. + +if you assert many times, use the below: + +```go +package yours + +import ( + "testing" + "github.com/stretchr/testify/assert" +) + +func TestSomething(t *testing.T) { + assert := assert.New(t) + + // assert equality + assert.Equal(123, 123, "they should be equal") + + // assert inequality + assert.NotEqual(123, 456, "they should not be equal") + + // assert for nil (good for errors) + assert.Nil(object) + + // assert for not nil (good when you expect something) + if assert.NotNil(object) { + + // now we know that object isn't nil, we are safe to make + // further assertions without causing any errors + assert.Equal("Something", object.Value) + } +} +``` + +[`require`](http://godoc.org/github.com/stretchr/testify/require "API documentation") package +--------------------------------------------------------------------------------------------- + +The `require` package provides same global functions as the `assert` package, but instead of returning a boolean result they terminate current test. + +See [t.FailNow](http://golang.org/pkg/testing/#T.FailNow) for details. + + +[`http`](http://godoc.org/github.com/stretchr/testify/http "API documentation") package +--------------------------------------------------------------------------------------- + +The `http` package contains test objects useful for testing code that relies on the `net/http` package. Check out the [(deprecated) API documentation for the `http` package](http://godoc.org/github.com/stretchr/testify/http). + +We recommend you use [httptest](http://golang.org/pkg/net/http/httptest) instead. + +[`mock`](http://godoc.org/github.com/stretchr/testify/mock "API documentation") package +---------------------------------------------------------------------------------------- + +The `mock` package provides a mechanism for easily writing mock objects that can be used in place of real objects when writing test code. + +An example test function that tests a piece of code that relies on an external object `testObj`, can setup expectations (testify) and assert that they indeed happened: + +```go +package yours + +import ( + "testing" + "github.com/stretchr/testify/mock" +) + +/* + Test objects +*/ + +// MyMockedObject is a mocked object that implements an interface +// that describes an object that the code I am testing relies on. +type MyMockedObject struct{ + mock.Mock +} + +// DoSomething is a method on MyMockedObject that implements some interface +// and just records the activity, and returns what the Mock object tells it to. +// +// In the real object, this method would do something useful, but since this +// is a mocked object - we're just going to stub it out. +// +// NOTE: This method is not being tested here, code that uses this object is. +func (m *MyMockedObject) DoSomething(number int) (bool, error) { + + args := m.Called(number) + return args.Bool(0), args.Error(1) + +} + +/* + Actual test functions +*/ + +// TestSomething is an example of how to use our test object to +// make assertions about some target code we are testing. +func TestSomething(t *testing.T) { + + // create an instance of our test object + testObj := new(MyMockedObject) + + // setup expectations + testObj.On("DoSomething", 123).Return(true, nil) + + // call the code we are testing + targetFuncThatDoesSomethingWithObj(testObj) + + // assert that the expectations were met + testObj.AssertExpectations(t) + +} +``` + +For more information on how to write mock code, check out the [API documentation for the `mock` package](http://godoc.org/github.com/stretchr/testify/mock). + +You can use the [mockery tool](http://github.com/vektra/mockery) to autogenerate the mock code against an interface as well, making using mocks much quicker. + +[`suite`](http://godoc.org/github.com/stretchr/testify/suite "API documentation") package +----------------------------------------------------------------------------------------- + +The `suite` package provides functionality that you might be used to from more common object oriented languages. With it, you can build a testing suite as a struct, build setup/teardown methods and testing methods on your struct, and run them with 'go test' as per normal. + +An example suite is shown below: + +```go +// Basic imports +import ( + "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" +) + +// Define the suite, and absorb the built-in basic suite +// functionality from testify - including a T() method which +// returns the current testing context +type ExampleTestSuite struct { + suite.Suite + VariableThatShouldStartAtFive int +} + +// Make sure that VariableThatShouldStartAtFive is set to five +// before each test +func (suite *ExampleTestSuite) SetupTest() { + suite.VariableThatShouldStartAtFive = 5 +} + +// All methods that begin with "Test" are run as tests within a +// suite. +func (suite *ExampleTestSuite) TestExample() { + assert.Equal(suite.T(), 5, suite.VariableThatShouldStartAtFive) +} + +// In order for 'go test' to run this suite, we need to create +// a normal test function and pass our suite to suite.Run +func TestExampleTestSuite(t *testing.T) { + suite.Run(t, new(ExampleTestSuite)) +} +``` + +For a more complete example, using all of the functionality provided by the suite package, look at our [example testing suite](https://github.com/stretchr/testify/blob/master/suite/suite_test.go) + +For more information on writing suites, check out the [API documentation for the `suite` package](http://godoc.org/github.com/stretchr/testify/suite). + +`Suite` object has assertion methods: + +```go +// Basic imports +import ( + "testing" + "github.com/stretchr/testify/suite" +) + +// Define the suite, and absorb the built-in basic suite +// functionality from testify - including assertion methods. +type ExampleTestSuite struct { + suite.Suite + VariableThatShouldStartAtFive int +} + +// Make sure that VariableThatShouldStartAtFive is set to five +// before each test +func (suite *ExampleTestSuite) SetupTest() { + suite.VariableThatShouldStartAtFive = 5 +} + +// All methods that begin with "Test" are run as tests within a +// suite. +func (suite *ExampleTestSuite) TestExample() { + suite.Equal(suite.VariableThatShouldStartAtFive, 5) +} + +// In order for 'go test' to run this suite, we need to create +// a normal test function and pass our suite to suite.Run +func TestExampleTestSuite(t *testing.T) { + suite.Run(t, new(ExampleTestSuite)) +} +``` + +------ + +Installation +============ + +To install Testify, use `go get`: + + * Latest version: go get github.com/stretchr/testify + * Specific version: go get gopkg.in/stretchr/testify.v1 + +This will then make the following packages available to you: + + github.com/stretchr/testify/assert + github.com/stretchr/testify/mock + github.com/stretchr/testify/http + +Import the `testify/assert` package into your code using this template: + +```go +package yours + +import ( + "testing" + "github.com/stretchr/testify/assert" +) + +func TestSomething(t *testing.T) { + + assert.True(t, true, "True is true!") + +} +``` + +------ + +Staying up to date +================== + +To update Testify to the latest version, use `go get -u github.com/stretchr/testify`. + +------ + +Version History +=============== + + * 1.0 - New package versioning strategy adopted. + +------ + +Contributing +============ + +Please feel free to submit issues, fork the repository and send pull requests! + +When submitting an issue, we ask that you please include a complete test function that demonstrates the issue. Extra credit for those using Testify to write the test code that demonstrates it. + +------ + +Licence +======= +Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell + +Please consider promoting this project if you find it useful. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/_codegen/main.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/_codegen/main.go new file mode 100644 index 00000000..328009f8 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/_codegen/main.go @@ -0,0 +1,287 @@ +// This program reads all assertion functions from the assert package and +// automatically generates the corersponding requires and forwarded assertions + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/ast" + "go/build" + "go/doc" + "go/importer" + "go/parser" + "go/token" + "go/types" + "io" + "io/ioutil" + "log" + "os" + "path" + "strings" + "text/template" + + "github.com/ernesto-jimenez/gogen/imports" +) + +var ( + pkg = flag.String("assert-path", "github.com/stretchr/testify/assert", "Path to the assert package") + outputPkg = flag.String("output-package", "", "package for the resulting code") + tmplFile = flag.String("template", "", "What file to load the function template from") + out = flag.String("out", "", "What file to write the source code to") +) + +func main() { + flag.Parse() + + scope, docs, err := parsePackageSource(*pkg) + if err != nil { + log.Fatal(err) + } + + importer, funcs, err := analyzeCode(scope, docs) + if err != nil { + log.Fatal(err) + } + + if err := generateCode(importer, funcs); err != nil { + log.Fatal(err) + } +} + +func generateCode(importer imports.Importer, funcs []testFunc) error { + buff := bytes.NewBuffer(nil) + + tmplHead, tmplFunc, err := parseTemplates() + if err != nil { + return err + } + + // Generate header + if err := tmplHead.Execute(buff, struct { + Name string + Imports map[string]string + }{ + *outputPkg, + importer.Imports(), + }); err != nil { + return err + } + + // Generate funcs + for _, fn := range funcs { + buff.Write([]byte("\n\n")) + if err := tmplFunc.Execute(buff, &fn); err != nil { + return err + } + } + + // Write file + output, err := outputFile() + if err != nil { + return err + } + defer output.Close() + _, err = io.Copy(output, buff) + return err +} + +func parseTemplates() (*template.Template, *template.Template, error) { + tmplHead, err := template.New("header").Parse(headerTemplate) + if err != nil { + return nil, nil, err + } + if *tmplFile != "" { + f, err := ioutil.ReadFile(*tmplFile) + if err != nil { + return nil, nil, err + } + funcTemplate = string(f) + } + tmpl, err := template.New("function").Parse(funcTemplate) + if err != nil { + return nil, nil, err + } + return tmplHead, tmpl, nil +} + +func outputFile() (*os.File, error) { + filename := *out + if filename == "-" || (filename == "" && *tmplFile == "") { + return os.Stdout, nil + } + if filename == "" { + filename = strings.TrimSuffix(strings.TrimSuffix(*tmplFile, ".tmpl"), ".go") + ".go" + } + return os.Create(filename) +} + +// analyzeCode takes the types scope and the docs and returns the import +// information and information about all the assertion functions. +func analyzeCode(scope *types.Scope, docs *doc.Package) (imports.Importer, []testFunc, error) { + testingT := scope.Lookup("TestingT").Type().Underlying().(*types.Interface) + + importer := imports.New(*outputPkg) + var funcs []testFunc + // Go through all the top level functions + for _, fdocs := range docs.Funcs { + // Find the function + obj := scope.Lookup(fdocs.Name) + + fn, ok := obj.(*types.Func) + if !ok { + continue + } + // Check function signatuer has at least two arguments + sig := fn.Type().(*types.Signature) + if sig.Params().Len() < 2 { + continue + } + // Check first argument is of type testingT + first, ok := sig.Params().At(0).Type().(*types.Named) + if !ok { + continue + } + firstType, ok := first.Underlying().(*types.Interface) + if !ok { + continue + } + if !types.Implements(firstType, testingT) { + continue + } + + funcs = append(funcs, testFunc{*outputPkg, fdocs, fn}) + importer.AddImportsFrom(sig.Params()) + } + return importer, funcs, nil +} + +// parsePackageSource returns the types scope and the package documentation from the pa +func parsePackageSource(pkg string) (*types.Scope, *doc.Package, error) { + pd, err := build.Import(pkg, ".", 0) + if err != nil { + return nil, nil, err + } + + fset := token.NewFileSet() + files := make(map[string]*ast.File) + fileList := make([]*ast.File, len(pd.GoFiles)) + for i, fname := range pd.GoFiles { + src, err := ioutil.ReadFile(path.Join(pd.SrcRoot, pd.ImportPath, fname)) + if err != nil { + return nil, nil, err + } + f, err := parser.ParseFile(fset, fname, src, parser.ParseComments|parser.AllErrors) + if err != nil { + return nil, nil, err + } + files[fname] = f + fileList[i] = f + } + + cfg := types.Config{ + Importer: importer.Default(), + } + info := types.Info{ + Defs: make(map[*ast.Ident]types.Object), + } + tp, err := cfg.Check(pkg, fset, fileList, &info) + if err != nil { + return nil, nil, err + } + + scope := tp.Scope() + + ap, _ := ast.NewPackage(fset, files, nil, nil) + docs := doc.New(ap, pkg, 0) + + return scope, docs, nil +} + +type testFunc struct { + CurrentPkg string + DocInfo *doc.Func + TypeInfo *types.Func +} + +func (f *testFunc) Qualifier(p *types.Package) string { + if p == nil || p.Name() == f.CurrentPkg { + return "" + } + return p.Name() +} + +func (f *testFunc) Params() string { + sig := f.TypeInfo.Type().(*types.Signature) + params := sig.Params() + p := "" + comma := "" + to := params.Len() + var i int + + if sig.Variadic() { + to-- + } + for i = 1; i < to; i++ { + param := params.At(i) + p += fmt.Sprintf("%s%s %s", comma, param.Name(), types.TypeString(param.Type(), f.Qualifier)) + comma = ", " + } + if sig.Variadic() { + param := params.At(params.Len() - 1) + p += fmt.Sprintf("%s%s ...%s", comma, param.Name(), types.TypeString(param.Type().(*types.Slice).Elem(), f.Qualifier)) + } + return p +} + +func (f *testFunc) ForwardedParams() string { + sig := f.TypeInfo.Type().(*types.Signature) + params := sig.Params() + p := "" + comma := "" + to := params.Len() + var i int + + if sig.Variadic() { + to-- + } + for i = 1; i < to; i++ { + param := params.At(i) + p += fmt.Sprintf("%s%s", comma, param.Name()) + comma = ", " + } + if sig.Variadic() { + param := params.At(params.Len() - 1) + p += fmt.Sprintf("%s%s...", comma, param.Name()) + } + return p +} + +func (f *testFunc) Comment() string { + return "// " + strings.Replace(strings.TrimSpace(f.DocInfo.Doc), "\n", "\n// ", -1) +} + +func (f *testFunc) CommentWithoutT(receiver string) string { + search := fmt.Sprintf("assert.%s(t, ", f.DocInfo.Name) + replace := fmt.Sprintf("%s.%s(", receiver, f.DocInfo.Name) + return strings.Replace(f.Comment(), search, replace, -1) +} + +var headerTemplate = `/* +* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen +* THIS FILE MUST NOT BE EDITED BY HAND +*/ + +package {{.Name}} + +import ( +{{range $path, $name := .Imports}} + {{$name}} "{{$path}}"{{end}} +) +` + +var funcTemplate = `{{.Comment}} +func (fwd *AssertionsForwarder) {{.DocInfo.Name}}({{.Params}}) bool { + return assert.{{.DocInfo.Name}}({{.ForwardedParams}}) +}` diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/assertion_forward.go new file mode 100644 index 00000000..e6a79604 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/assertion_forward.go @@ -0,0 +1,387 @@ +/* +* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen +* THIS FILE MUST NOT BE EDITED BY HAND +*/ + +package assert + +import ( + + http "net/http" + url "net/url" + time "time" +) + + +// Condition uses a Comparison to assert a complex condition. +func (a *Assertions) Condition(comp Comparison, msgAndArgs ...interface{}) bool { + return Condition(a.t, comp, msgAndArgs...) +} + + +// Contains asserts that the specified string, list(array, slice...) or map contains the +// specified substring or element. +// +// a.Contains("Hello World", "World", "But 'Hello World' does contain 'World'") +// a.Contains(["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") +// a.Contains({"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool { + return Contains(a.t, s, contains, msgAndArgs...) +} + + +// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// a.Empty(obj) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool { + return Empty(a.t, object, msgAndArgs...) +} + + +// Equal asserts that two objects are equal. +// +// a.Equal(123, 123, "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { + return Equal(a.t, expected, actual, msgAndArgs...) +} + + +// EqualError asserts that a function returned an error (i.e. not `nil`) +// and that it is equal to the provided error. +// +// actualObj, err := SomeFunction() +// if assert.Error(t, err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool { + return EqualError(a.t, theError, errString, msgAndArgs...) +} + + +// EqualValues asserts that two objects are equal or convertable to the same types +// and equal. +// +// a.EqualValues(uint32(123), int32(123), "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { + return EqualValues(a.t, expected, actual, msgAndArgs...) +} + + +// Error asserts that a function returned an error (i.e. not `nil`). +// +// actualObj, err := SomeFunction() +// if a.Error(err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool { + return Error(a.t, err, msgAndArgs...) +} + + +// Exactly asserts that two objects are equal is value and type. +// +// a.Exactly(int32(123), int64(123), "123 and 123 should NOT be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { + return Exactly(a.t, expected, actual, msgAndArgs...) +} + + +// Fail reports a failure through +func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) bool { + return Fail(a.t, failureMessage, msgAndArgs...) +} + + +// FailNow fails test +func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) bool { + return FailNow(a.t, failureMessage, msgAndArgs...) +} + + +// False asserts that the specified value is false. +// +// a.False(myBool, "myBool should be false") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool { + return False(a.t, value, msgAndArgs...) +} + + +// HTTPBodyContains asserts that a specified handler returns a +// body that contains a string. +// +// a.HTTPBodyContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) bool { + return HTTPBodyContains(a.t, handler, method, url, values, str) +} + + +// HTTPBodyNotContains asserts that a specified handler returns a +// body that does not contain a string. +// +// a.HTTPBodyNotContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) bool { + return HTTPBodyNotContains(a.t, handler, method, url, values, str) +} + + +// HTTPError asserts that a specified handler returns an error status code. +// +// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values) bool { + return HTTPError(a.t, handler, method, url, values) +} + + +// HTTPRedirect asserts that a specified handler returns a redirect status code. +// +// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values) bool { + return HTTPRedirect(a.t, handler, method, url, values) +} + + +// HTTPSuccess asserts that a specified handler returns a success status code. +// +// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values) bool { + return HTTPSuccess(a.t, handler, method, url, values) +} + + +// Implements asserts that an object is implemented by the specified interface. +// +// a.Implements((*MyInterface)(nil), new(MyObject), "MyObject") +func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { + return Implements(a.t, interfaceObject, object, msgAndArgs...) +} + + +// InDelta asserts that the two numerals are within delta of each other. +// +// a.InDelta(math.Pi, (22 / 7.0), 0.01) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + return InDelta(a.t, expected, actual, delta, msgAndArgs...) +} + + +// InDeltaSlice is the same as InDelta, except it compares two slices. +func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + return InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...) +} + + +// InEpsilon asserts that expected and actual have a relative error less than epsilon +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { + return InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...) +} + + +// InEpsilonSlice is the same as InEpsilon, except it compares two slices. +func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + return InEpsilonSlice(a.t, expected, actual, delta, msgAndArgs...) +} + + +// IsType asserts that the specified objects are of the same type. +func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { + return IsType(a.t, expectedType, object, msgAndArgs...) +} + + +// JSONEq asserts that two JSON strings are equivalent. +// +// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) bool { + return JSONEq(a.t, expected, actual, msgAndArgs...) +} + + +// Len asserts that the specified object has specific length. +// Len also fails if the object has a type that len() not accept. +// +// a.Len(mySlice, 3, "The size of slice is not 3") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) bool { + return Len(a.t, object, length, msgAndArgs...) +} + + +// Nil asserts that the specified object is nil. +// +// a.Nil(err, "err should be nothing") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool { + return Nil(a.t, object, msgAndArgs...) +} + + +// NoError asserts that a function returned no error (i.e. `nil`). +// +// actualObj, err := SomeFunction() +// if a.NoError(err) { +// assert.Equal(t, actualObj, expectedObj) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool { + return NoError(a.t, err, msgAndArgs...) +} + + +// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the +// specified substring or element. +// +// a.NotContains("Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") +// a.NotContains(["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") +// a.NotContains({"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool { + return NotContains(a.t, s, contains, msgAndArgs...) +} + + +// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// if a.NotEmpty(obj) { +// assert.Equal(t, "two", obj[1]) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool { + return NotEmpty(a.t, object, msgAndArgs...) +} + + +// NotEqual asserts that the specified values are NOT equal. +// +// a.NotEqual(obj1, obj2, "two objects shouldn't be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { + return NotEqual(a.t, expected, actual, msgAndArgs...) +} + + +// NotNil asserts that the specified object is not nil. +// +// a.NotNil(err, "err should be something") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool { + return NotNil(a.t, object, msgAndArgs...) +} + + +// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. +// +// a.NotPanics(func(){ +// RemainCalm() +// }, "Calling RemainCalm() should NOT panic") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool { + return NotPanics(a.t, f, msgAndArgs...) +} + + +// NotRegexp asserts that a specified regexp does not match a string. +// +// a.NotRegexp(regexp.MustCompile("starts"), "it's starting") +// a.NotRegexp("^start", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + return NotRegexp(a.t, rx, str, msgAndArgs...) +} + + +// NotZero asserts that i is not the zero value for its type and returns the truth. +func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) bool { + return NotZero(a.t, i, msgAndArgs...) +} + + +// Panics asserts that the code inside the specified PanicTestFunc panics. +// +// a.Panics(func(){ +// GoCrazy() +// }, "Calling GoCrazy() should panic") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool { + return Panics(a.t, f, msgAndArgs...) +} + + +// Regexp asserts that a specified regexp matches a string. +// +// a.Regexp(regexp.MustCompile("start"), "it's starting") +// a.Regexp("start...$", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + return Regexp(a.t, rx, str, msgAndArgs...) +} + + +// True asserts that the specified value is true. +// +// a.True(myBool, "myBool should be true") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool { + return True(a.t, value, msgAndArgs...) +} + + +// WithinDuration asserts that the two times are within duration delta of each other. +// +// a.WithinDuration(time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { + return WithinDuration(a.t, expected, actual, delta, msgAndArgs...) +} + + +// Zero asserts that i is the zero value for its type and returns the truth. +func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) bool { + return Zero(a.t, i, msgAndArgs...) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl new file mode 100644 index 00000000..99f9acfb --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl @@ -0,0 +1,4 @@ +{{.CommentWithoutT "a"}} +func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { + return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/assertions.go new file mode 100644 index 00000000..d7c16c59 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/assertions.go @@ -0,0 +1,1004 @@ +package assert + +import ( + "bufio" + "bytes" + "encoding/json" + "fmt" + "math" + "reflect" + "regexp" + "runtime" + "strings" + "time" + "unicode" + "unicode/utf8" + + "github.com/davecgh/go-spew/spew" + "github.com/pmezard/go-difflib/difflib" +) + +// TestingT is an interface wrapper around *testing.T +type TestingT interface { + Errorf(format string, args ...interface{}) +} + +// Comparison a custom function that returns true on success and false on failure +type Comparison func() (success bool) + +/* + Helper functions +*/ + +// ObjectsAreEqual determines if two objects are considered equal. +// +// This function does no assertion of any kind. +func ObjectsAreEqual(expected, actual interface{}) bool { + + if expected == nil || actual == nil { + return expected == actual + } + + return reflect.DeepEqual(expected, actual) + +} + +// ObjectsAreEqualValues gets whether two objects are equal, or if their +// values are equal. +func ObjectsAreEqualValues(expected, actual interface{}) bool { + if ObjectsAreEqual(expected, actual) { + return true + } + + actualType := reflect.TypeOf(actual) + if actualType == nil { + return false + } + expectedValue := reflect.ValueOf(expected) + if expectedValue.IsValid() && expectedValue.Type().ConvertibleTo(actualType) { + // Attempt comparison after type conversion + return reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), actual) + } + + return false +} + +/* CallerInfo is necessary because the assert functions use the testing object +internally, causing it to print the file:line of the assert method, rather than where +the problem actually occured in calling code.*/ + +// CallerInfo returns an array of strings containing the file and line number +// of each stack frame leading from the current test to the assert call that +// failed. +func CallerInfo() []string { + + pc := uintptr(0) + file := "" + line := 0 + ok := false + name := "" + + callers := []string{} + for i := 0; ; i++ { + pc, file, line, ok = runtime.Caller(i) + if !ok { + return nil + } + + // This is a huge edge case, but it will panic if this is the case, see #180 + if file == "" { + break + } + + parts := strings.Split(file, "/") + dir := parts[len(parts)-2] + file = parts[len(parts)-1] + if (dir != "assert" && dir != "mock" && dir != "require") || file == "mock_test.go" { + callers = append(callers, fmt.Sprintf("%s:%d", file, line)) + } + + f := runtime.FuncForPC(pc) + if f == nil { + break + } + name = f.Name() + // Drop the package + segments := strings.Split(name, ".") + name = segments[len(segments)-1] + if isTest(name, "Test") || + isTest(name, "Benchmark") || + isTest(name, "Example") { + break + } + } + + return callers +} + +// Stolen from the `go test` tool. +// isTest tells whether name looks like a test (or benchmark, according to prefix). +// It is a Test (say) if there is a character after Test that is not a lower-case letter. +// We don't want TesticularCancer. +func isTest(name, prefix string) bool { + if !strings.HasPrefix(name, prefix) { + return false + } + if len(name) == len(prefix) { // "Test" is ok + return true + } + rune, _ := utf8.DecodeRuneInString(name[len(prefix):]) + return !unicode.IsLower(rune) +} + +// getWhitespaceString returns a string that is long enough to overwrite the default +// output from the go testing framework. +func getWhitespaceString() string { + + _, file, line, ok := runtime.Caller(1) + if !ok { + return "" + } + parts := strings.Split(file, "/") + file = parts[len(parts)-1] + + return strings.Repeat(" ", len(fmt.Sprintf("%s:%d: ", file, line))) + +} + +func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { + if len(msgAndArgs) == 0 || msgAndArgs == nil { + return "" + } + if len(msgAndArgs) == 1 { + return msgAndArgs[0].(string) + } + if len(msgAndArgs) > 1 { + return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) + } + return "" +} + +// Indents all lines of the message by appending a number of tabs to each line, in an output format compatible with Go's +// test printing (see inner comment for specifics) +func indentMessageLines(message string, tabs int) string { + outBuf := new(bytes.Buffer) + + for i, scanner := 0, bufio.NewScanner(strings.NewReader(message)); scanner.Scan(); i++ { + if i != 0 { + outBuf.WriteRune('\n') + } + for ii := 0; ii < tabs; ii++ { + outBuf.WriteRune('\t') + // Bizarrely, all lines except the first need one fewer tabs prepended, so deliberately advance the counter + // by 1 prematurely. + if ii == 0 && i > 0 { + ii++ + } + } + outBuf.WriteString(scanner.Text()) + } + + return outBuf.String() +} + +type failNower interface { + FailNow() +} + +// FailNow fails test +func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { + Fail(t, failureMessage, msgAndArgs...) + + // We cannot extend TestingT with FailNow() and + // maintain backwards compatibility, so we fallback + // to panicking when FailNow is not available in + // TestingT. + // See issue #263 + + if t, ok := t.(failNower); ok { + t.FailNow() + } else { + panic("test failed and t is missing `FailNow()`") + } + return false +} + +// Fail reports a failure through +func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { + + message := messageFromMsgAndArgs(msgAndArgs...) + + errorTrace := strings.Join(CallerInfo(), "\n\r\t\t\t") + if len(message) > 0 { + t.Errorf("\r%s\r\tError Trace:\t%s\n"+ + "\r\tError:%s\n"+ + "\r\tMessages:\t%s\n\r", + getWhitespaceString(), + errorTrace, + indentMessageLines(failureMessage, 2), + message) + } else { + t.Errorf("\r%s\r\tError Trace:\t%s\n"+ + "\r\tError:%s\n\r", + getWhitespaceString(), + errorTrace, + indentMessageLines(failureMessage, 2)) + } + + return false +} + +// Implements asserts that an object is implemented by the specified interface. +// +// assert.Implements(t, (*MyInterface)(nil), new(MyObject), "MyObject") +func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { + + interfaceType := reflect.TypeOf(interfaceObject).Elem() + + if !reflect.TypeOf(object).Implements(interfaceType) { + return Fail(t, fmt.Sprintf("%T must implement %v", object, interfaceType), msgAndArgs...) + } + + return true + +} + +// IsType asserts that the specified objects are of the same type. +func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { + + if !ObjectsAreEqual(reflect.TypeOf(object), reflect.TypeOf(expectedType)) { + return Fail(t, fmt.Sprintf("Object expected to be of type %v, but was %v", reflect.TypeOf(expectedType), reflect.TypeOf(object)), msgAndArgs...) + } + + return true +} + +// Equal asserts that two objects are equal. +// +// assert.Equal(t, 123, 123, "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func Equal(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { + + if !ObjectsAreEqual(expected, actual) { + diff := diff(expected, actual) + return Fail(t, fmt.Sprintf("Not equal: %#v (expected)\n"+ + " != %#v (actual)%s", expected, actual, diff), msgAndArgs...) + } + + return true + +} + +// EqualValues asserts that two objects are equal or convertable to the same types +// and equal. +// +// assert.EqualValues(t, uint32(123), int32(123), "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { + + if !ObjectsAreEqualValues(expected, actual) { + return Fail(t, fmt.Sprintf("Not equal: %#v (expected)\n"+ + " != %#v (actual)", expected, actual), msgAndArgs...) + } + + return true + +} + +// Exactly asserts that two objects are equal is value and type. +// +// assert.Exactly(t, int32(123), int64(123), "123 and 123 should NOT be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { + + aType := reflect.TypeOf(expected) + bType := reflect.TypeOf(actual) + + if aType != bType { + return Fail(t, fmt.Sprintf("Types expected to match exactly\n\r\t%v != %v", aType, bType), msgAndArgs...) + } + + return Equal(t, expected, actual, msgAndArgs...) + +} + +// NotNil asserts that the specified object is not nil. +// +// assert.NotNil(t, err, "err should be something") +// +// Returns whether the assertion was successful (true) or not (false). +func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + if !isNil(object) { + return true + } + return Fail(t, "Expected value not to be nil.", msgAndArgs...) +} + +// isNil checks if a specified object is nil or not, without Failing. +func isNil(object interface{}) bool { + if object == nil { + return true + } + + value := reflect.ValueOf(object) + kind := value.Kind() + if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() { + return true + } + + return false +} + +// Nil asserts that the specified object is nil. +// +// assert.Nil(t, err, "err should be nothing") +// +// Returns whether the assertion was successful (true) or not (false). +func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + if isNil(object) { + return true + } + return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...) +} + +var numericZeros = []interface{}{ + int(0), + int8(0), + int16(0), + int32(0), + int64(0), + uint(0), + uint8(0), + uint16(0), + uint32(0), + uint64(0), + float32(0), + float64(0), +} + +// isEmpty gets whether the specified object is considered empty or not. +func isEmpty(object interface{}) bool { + + if object == nil { + return true + } else if object == "" { + return true + } else if object == false { + return true + } + + for _, v := range numericZeros { + if object == v { + return true + } + } + + objValue := reflect.ValueOf(object) + + switch objValue.Kind() { + case reflect.Map: + fallthrough + case reflect.Slice, reflect.Chan: + { + return (objValue.Len() == 0) + } + case reflect.Struct: + switch object.(type) { + case time.Time: + return object.(time.Time).IsZero() + } + case reflect.Ptr: + { + if objValue.IsNil() { + return true + } + switch object.(type) { + case *time.Time: + return object.(*time.Time).IsZero() + default: + return false + } + } + } + return false +} + +// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// assert.Empty(t, obj) +// +// Returns whether the assertion was successful (true) or not (false). +func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + + pass := isEmpty(object) + if !pass { + Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...) + } + + return pass + +} + +// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// if assert.NotEmpty(t, obj) { +// assert.Equal(t, "two", obj[1]) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + + pass := !isEmpty(object) + if !pass { + Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...) + } + + return pass + +} + +// getLen try to get length of object. +// return (false, 0) if impossible. +func getLen(x interface{}) (ok bool, length int) { + v := reflect.ValueOf(x) + defer func() { + if e := recover(); e != nil { + ok = false + } + }() + return true, v.Len() +} + +// Len asserts that the specified object has specific length. +// Len also fails if the object has a type that len() not accept. +// +// assert.Len(t, mySlice, 3, "The size of slice is not 3") +// +// Returns whether the assertion was successful (true) or not (false). +func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) bool { + ok, l := getLen(object) + if !ok { + return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", object), msgAndArgs...) + } + + if l != length { + return Fail(t, fmt.Sprintf("\"%s\" should have %d item(s), but has %d", object, length, l), msgAndArgs...) + } + return true +} + +// True asserts that the specified value is true. +// +// assert.True(t, myBool, "myBool should be true") +// +// Returns whether the assertion was successful (true) or not (false). +func True(t TestingT, value bool, msgAndArgs ...interface{}) bool { + + if value != true { + return Fail(t, "Should be true", msgAndArgs...) + } + + return true + +} + +// False asserts that the specified value is false. +// +// assert.False(t, myBool, "myBool should be false") +// +// Returns whether the assertion was successful (true) or not (false). +func False(t TestingT, value bool, msgAndArgs ...interface{}) bool { + + if value != false { + return Fail(t, "Should be false", msgAndArgs...) + } + + return true + +} + +// NotEqual asserts that the specified values are NOT equal. +// +// assert.NotEqual(t, obj1, obj2, "two objects shouldn't be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { + + if ObjectsAreEqual(expected, actual) { + return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...) + } + + return true + +} + +// containsElement try loop over the list check if the list includes the element. +// return (false, false) if impossible. +// return (true, false) if element was not found. +// return (true, true) if element was found. +func includeElement(list interface{}, element interface{}) (ok, found bool) { + + listValue := reflect.ValueOf(list) + elementValue := reflect.ValueOf(element) + defer func() { + if e := recover(); e != nil { + ok = false + found = false + } + }() + + if reflect.TypeOf(list).Kind() == reflect.String { + return true, strings.Contains(listValue.String(), elementValue.String()) + } + + if reflect.TypeOf(list).Kind() == reflect.Map { + mapKeys := listValue.MapKeys() + for i := 0; i < len(mapKeys); i++ { + if ObjectsAreEqual(mapKeys[i].Interface(), element) { + return true, true + } + } + return true, false + } + + for i := 0; i < listValue.Len(); i++ { + if ObjectsAreEqual(listValue.Index(i).Interface(), element) { + return true, true + } + } + return true, false + +} + +// Contains asserts that the specified string, list(array, slice...) or map contains the +// specified substring or element. +// +// assert.Contains(t, "Hello World", "World", "But 'Hello World' does contain 'World'") +// assert.Contains(t, ["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") +// assert.Contains(t, {"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'") +// +// Returns whether the assertion was successful (true) or not (false). +func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { + + ok, found := includeElement(s, contains) + if !ok { + return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...) + } + if !found { + return Fail(t, fmt.Sprintf("\"%s\" does not contain \"%s\"", s, contains), msgAndArgs...) + } + + return true + +} + +// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the +// specified substring or element. +// +// assert.NotContains(t, "Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") +// assert.NotContains(t, ["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") +// assert.NotContains(t, {"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'") +// +// Returns whether the assertion was successful (true) or not (false). +func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { + + ok, found := includeElement(s, contains) + if !ok { + return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...) + } + if found { + return Fail(t, fmt.Sprintf("\"%s\" should not contain \"%s\"", s, contains), msgAndArgs...) + } + + return true + +} + +// Condition uses a Comparison to assert a complex condition. +func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool { + result := comp() + if !result { + Fail(t, "Condition failed!", msgAndArgs...) + } + return result +} + +// PanicTestFunc defines a func that should be passed to the assert.Panics and assert.NotPanics +// methods, and represents a simple func that takes no arguments, and returns nothing. +type PanicTestFunc func() + +// didPanic returns true if the function passed to it panics. Otherwise, it returns false. +func didPanic(f PanicTestFunc) (bool, interface{}) { + + didPanic := false + var message interface{} + func() { + + defer func() { + if message = recover(); message != nil { + didPanic = true + } + }() + + // call the target function + f() + + }() + + return didPanic, message + +} + +// Panics asserts that the code inside the specified PanicTestFunc panics. +// +// assert.Panics(t, func(){ +// GoCrazy() +// }, "Calling GoCrazy() should panic") +// +// Returns whether the assertion was successful (true) or not (false). +func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { + + if funcDidPanic, panicValue := didPanic(f); !funcDidPanic { + return Fail(t, fmt.Sprintf("func %#v should panic\n\r\tPanic value:\t%v", f, panicValue), msgAndArgs...) + } + + return true +} + +// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. +// +// assert.NotPanics(t, func(){ +// RemainCalm() +// }, "Calling RemainCalm() should NOT panic") +// +// Returns whether the assertion was successful (true) or not (false). +func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { + + if funcDidPanic, panicValue := didPanic(f); funcDidPanic { + return Fail(t, fmt.Sprintf("func %#v should not panic\n\r\tPanic value:\t%v", f, panicValue), msgAndArgs...) + } + + return true +} + +// WithinDuration asserts that the two times are within duration delta of each other. +// +// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") +// +// Returns whether the assertion was successful (true) or not (false). +func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { + + dt := expected.Sub(actual) + if dt < -delta || dt > delta { + return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...) + } + + return true +} + +func toFloat(x interface{}) (float64, bool) { + var xf float64 + xok := true + + switch xn := x.(type) { + case uint8: + xf = float64(xn) + case uint16: + xf = float64(xn) + case uint32: + xf = float64(xn) + case uint64: + xf = float64(xn) + case int: + xf = float64(xn) + case int8: + xf = float64(xn) + case int16: + xf = float64(xn) + case int32: + xf = float64(xn) + case int64: + xf = float64(xn) + case float32: + xf = float64(xn) + case float64: + xf = float64(xn) + default: + xok = false + } + + return xf, xok +} + +// InDelta asserts that the two numerals are within delta of each other. +// +// assert.InDelta(t, math.Pi, (22 / 7.0), 0.01) +// +// Returns whether the assertion was successful (true) or not (false). +func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + + af, aok := toFloat(expected) + bf, bok := toFloat(actual) + + if !aok || !bok { + return Fail(t, fmt.Sprintf("Parameters must be numerical"), msgAndArgs...) + } + + if math.IsNaN(af) { + return Fail(t, fmt.Sprintf("Actual must not be NaN"), msgAndArgs...) + } + + if math.IsNaN(bf) { + return Fail(t, fmt.Sprintf("Expected %v with delta %v, but was NaN", expected, delta), msgAndArgs...) + } + + dt := af - bf + if dt < -delta || dt > delta { + return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...) + } + + return true +} + +// InDeltaSlice is the same as InDelta, except it compares two slices. +func InDeltaSlice(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + if expected == nil || actual == nil || + reflect.TypeOf(actual).Kind() != reflect.Slice || + reflect.TypeOf(expected).Kind() != reflect.Slice { + return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...) + } + + actualSlice := reflect.ValueOf(actual) + expectedSlice := reflect.ValueOf(expected) + + for i := 0; i < actualSlice.Len(); i++ { + result := InDelta(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), delta) + if !result { + return result + } + } + + return true +} + +func calcRelativeError(expected, actual interface{}) (float64, error) { + af, aok := toFloat(expected) + if !aok { + return 0, fmt.Errorf("expected value %q cannot be converted to float", expected) + } + if af == 0 { + return 0, fmt.Errorf("expected value must have a value other than zero to calculate the relative error") + } + bf, bok := toFloat(actual) + if !bok { + return 0, fmt.Errorf("expected value %q cannot be converted to float", actual) + } + + return math.Abs(af-bf) / math.Abs(af), nil +} + +// InEpsilon asserts that expected and actual have a relative error less than epsilon +// +// Returns whether the assertion was successful (true) or not (false). +func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { + actualEpsilon, err := calcRelativeError(expected, actual) + if err != nil { + return Fail(t, err.Error(), msgAndArgs...) + } + if actualEpsilon > epsilon { + return Fail(t, fmt.Sprintf("Relative error is too high: %#v (expected)\n"+ + " < %#v (actual)", actualEpsilon, epsilon), msgAndArgs...) + } + + return true +} + +// InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. +func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { + if expected == nil || actual == nil || + reflect.TypeOf(actual).Kind() != reflect.Slice || + reflect.TypeOf(expected).Kind() != reflect.Slice { + return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...) + } + + actualSlice := reflect.ValueOf(actual) + expectedSlice := reflect.ValueOf(expected) + + for i := 0; i < actualSlice.Len(); i++ { + result := InEpsilon(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), epsilon) + if !result { + return result + } + } + + return true +} + +/* + Errors +*/ + +// NoError asserts that a function returned no error (i.e. `nil`). +// +// actualObj, err := SomeFunction() +// if assert.NoError(t, err) { +// assert.Equal(t, actualObj, expectedObj) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { + if isNil(err) { + return true + } + + return Fail(t, fmt.Sprintf("Received unexpected error %q", err), msgAndArgs...) +} + +// Error asserts that a function returned an error (i.e. not `nil`). +// +// actualObj, err := SomeFunction() +// if assert.Error(t, err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { + + message := messageFromMsgAndArgs(msgAndArgs...) + return NotNil(t, err, "An error is expected but got nil. %s", message) + +} + +// EqualError asserts that a function returned an error (i.e. not `nil`) +// and that it is equal to the provided error. +// +// actualObj, err := SomeFunction() +// if assert.Error(t, err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) bool { + + message := messageFromMsgAndArgs(msgAndArgs...) + if !NotNil(t, theError, "An error is expected but got nil. %s", message) { + return false + } + s := "An error with value \"%s\" is expected but got \"%s\". %s" + return Equal(t, errString, theError.Error(), + s, errString, theError.Error(), message) +} + +// matchRegexp return true if a specified regexp matches a string. +func matchRegexp(rx interface{}, str interface{}) bool { + + var r *regexp.Regexp + if rr, ok := rx.(*regexp.Regexp); ok { + r = rr + } else { + r = regexp.MustCompile(fmt.Sprint(rx)) + } + + return (r.FindStringIndex(fmt.Sprint(str)) != nil) + +} + +// Regexp asserts that a specified regexp matches a string. +// +// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") +// assert.Regexp(t, "start...$", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + + match := matchRegexp(rx, str) + + if !match { + Fail(t, fmt.Sprintf("Expect \"%v\" to match \"%v\"", str, rx), msgAndArgs...) + } + + return match +} + +// NotRegexp asserts that a specified regexp does not match a string. +// +// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") +// assert.NotRegexp(t, "^start", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + match := matchRegexp(rx, str) + + if match { + Fail(t, fmt.Sprintf("Expect \"%v\" to NOT match \"%v\"", str, rx), msgAndArgs...) + } + + return !match + +} + +// Zero asserts that i is the zero value for its type and returns the truth. +func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { + if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { + return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...) + } + return true +} + +// NotZero asserts that i is not the zero value for its type and returns the truth. +func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { + if i == nil || reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { + return Fail(t, fmt.Sprintf("Should not be zero, but was %v", i), msgAndArgs...) + } + return true +} + +// JSONEq asserts that two JSON strings are equivalent. +// +// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// +// Returns whether the assertion was successful (true) or not (false). +func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool { + var expectedJSONAsInterface, actualJSONAsInterface interface{} + + if err := json.Unmarshal([]byte(expected), &expectedJSONAsInterface); err != nil { + return Fail(t, fmt.Sprintf("Expected value ('%s') is not valid json.\nJSON parsing error: '%s'", expected, err.Error()), msgAndArgs...) + } + + if err := json.Unmarshal([]byte(actual), &actualJSONAsInterface); err != nil { + return Fail(t, fmt.Sprintf("Input ('%s') needs to be valid json.\nJSON parsing error: '%s'", actual, err.Error()), msgAndArgs...) + } + + return Equal(t, expectedJSONAsInterface, actualJSONAsInterface, msgAndArgs...) +} + +func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) { + t := reflect.TypeOf(v) + k := t.Kind() + + if k == reflect.Ptr { + t = t.Elem() + k = t.Kind() + } + return t, k +} + +// diff returns a diff of both values as long as both are of the same type and +// are a struct, map, slice or array. Otherwise it returns an empty string. +func diff(expected interface{}, actual interface{}) string { + if expected == nil || actual == nil { + return "" + } + + et, ek := typeAndKind(expected) + at, _ := typeAndKind(actual) + + if et != at { + return "" + } + + if ek != reflect.Struct && ek != reflect.Map && ek != reflect.Slice && ek != reflect.Array { + return "" + } + + spew.Config.SortKeys = true + e := spew.Sdump(expected) + a := spew.Sdump(actual) + + diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{ + A: difflib.SplitLines(e), + B: difflib.SplitLines(a), + FromFile: "Expected", + FromDate: "", + ToFile: "Actual", + ToDate: "", + Context: 1, + }) + + return "\n\nDiff:\n" + diff +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/doc.go new file mode 100644 index 00000000..c9dccc4d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/doc.go @@ -0,0 +1,45 @@ +// Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. +// +// Example Usage +// +// The following is a complete example using assert in a standard test function: +// import ( +// "testing" +// "github.com/stretchr/testify/assert" +// ) +// +// func TestSomething(t *testing.T) { +// +// var a string = "Hello" +// var b string = "Hello" +// +// assert.Equal(t, a, b, "The two words should be the same.") +// +// } +// +// if you assert many times, use the format below: +// +// import ( +// "testing" +// "github.com/stretchr/testify/assert" +// ) +// +// func TestSomething(t *testing.T) { +// assert := assert.New(t) +// +// var a string = "Hello" +// var b string = "Hello" +// +// assert.Equal(a, b, "The two words should be the same.") +// } +// +// Assertions +// +// Assertions allow you to easily write test code, and are global funcs in the `assert` package. +// All assertion functions take, as the first argument, the `*testing.T` object provided by the +// testing framework. This allows the assertion funcs to write the failings and other details to +// the correct place. +// +// Every assertion function also takes an optional string message as the final argument, +// allowing custom error messages to be appended to the message the assertion method outputs. +package assert diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/errors.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/errors.go new file mode 100644 index 00000000..ac9dc9d1 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/errors.go @@ -0,0 +1,10 @@ +package assert + +import ( + "errors" +) + +// AnError is an error instance useful for testing. If the code does not care +// about error specifics, and only needs to return the error for example, this +// error should be used to make the test code more readable. +var AnError = errors.New("assert.AnError general error for testing") diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/forward_assertions.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/forward_assertions.go new file mode 100644 index 00000000..b867e95e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/forward_assertions.go @@ -0,0 +1,16 @@ +package assert + +// Assertions provides assertion methods around the +// TestingT interface. +type Assertions struct { + t TestingT +} + +// New makes a new Assertions object for the specified TestingT. +func New(t TestingT) *Assertions { + return &Assertions{ + t: t, + } +} + +//go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/http_assertions.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/http_assertions.go new file mode 100644 index 00000000..e1b9442b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/assert/http_assertions.go @@ -0,0 +1,106 @@ +package assert + +import ( + "fmt" + "net/http" + "net/http/httptest" + "net/url" + "strings" +) + +// httpCode is a helper that returns HTTP code of the response. It returns -1 +// if building a new request fails. +func httpCode(handler http.HandlerFunc, method, url string, values url.Values) int { + w := httptest.NewRecorder() + req, err := http.NewRequest(method, url+"?"+values.Encode(), nil) + if err != nil { + return -1 + } + handler(w, req) + return w.Code +} + +// HTTPSuccess asserts that a specified handler returns a success status code. +// +// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool { + code := httpCode(handler, method, url, values) + if code == -1 { + return false + } + return code >= http.StatusOK && code <= http.StatusPartialContent +} + +// HTTPRedirect asserts that a specified handler returns a redirect status code. +// +// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool { + code := httpCode(handler, method, url, values) + if code == -1 { + return false + } + return code >= http.StatusMultipleChoices && code <= http.StatusTemporaryRedirect +} + +// HTTPError asserts that a specified handler returns an error status code. +// +// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool { + code := httpCode(handler, method, url, values) + if code == -1 { + return false + } + return code >= http.StatusBadRequest +} + +// HTTPBody is a helper that returns HTTP body of the response. It returns +// empty string if building a new request fails. +func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) string { + w := httptest.NewRecorder() + req, err := http.NewRequest(method, url+"?"+values.Encode(), nil) + if err != nil { + return "" + } + handler(w, req) + return w.Body.String() +} + +// HTTPBodyContains asserts that a specified handler returns a +// body that contains a string. +// +// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool { + body := HTTPBody(handler, method, url, values) + + contains := strings.Contains(body, fmt.Sprint(str)) + if !contains { + Fail(t, fmt.Sprintf("Expected response body for \"%s\" to contain \"%s\" but found \"%s\"", url+"?"+values.Encode(), str, body)) + } + + return contains +} + +// HTTPBodyNotContains asserts that a specified handler returns a +// body that does not contain a string. +// +// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool { + body := HTTPBody(handler, method, url, values) + + contains := strings.Contains(body, fmt.Sprint(str)) + if contains { + Fail(t, "Expected response body for %s to NOT contain \"%s\" but found \"%s\"", url+"?"+values.Encode(), str, body) + } + + return !contains +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/doc.go new file mode 100644 index 00000000..377d5cc5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/doc.go @@ -0,0 +1,22 @@ +// Package testify is a set of packages that provide many tools for testifying that your code will behave as you intend. +// +// testify contains the following packages: +// +// The assert package provides a comprehensive set of assertion functions that tie in to the Go testing system. +// +// The http package contains tools to make it easier to test http activity using the Go testing system. +// +// The mock package provides a system by which it is possible to mock your objects and verify calls are happening as expected. +// +// The suite package provides a basic structure for using structs as testing suites, and methods on those structs as tests. It includes setup/teardown functionality in the way of interfaces. +package testify + +// blank imports help docs. +import ( + // assert package + _ "github.com/stretchr/testify/assert" + // http package + _ "github.com/stretchr/testify/http" + // mock package + _ "github.com/stretchr/testify/mock" +) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/http/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/http/doc.go new file mode 100644 index 00000000..695167c6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/http/doc.go @@ -0,0 +1,2 @@ +// Package http DEPRECATED USE net/http/httptest +package http diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/http/test_response_writer.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/http/test_response_writer.go new file mode 100644 index 00000000..5c3f813f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/http/test_response_writer.go @@ -0,0 +1,49 @@ +package http + +import ( + "net/http" +) + +// TestResponseWriter DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. +type TestResponseWriter struct { + + // StatusCode is the last int written by the call to WriteHeader(int) + StatusCode int + + // Output is a string containing the written bytes using the Write([]byte) func. + Output string + + // header is the internal storage of the http.Header object + header http.Header +} + +// Header DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. +func (rw *TestResponseWriter) Header() http.Header { + + if rw.header == nil { + rw.header = make(http.Header) + } + + return rw.header +} + +// Write DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. +func (rw *TestResponseWriter) Write(bytes []byte) (int, error) { + + // assume 200 success if no header has been set + if rw.StatusCode == 0 { + rw.WriteHeader(200) + } + + // add these bytes to the output string + rw.Output = rw.Output + string(bytes) + + // return normal values + return 0, nil + +} + +// WriteHeader DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. +func (rw *TestResponseWriter) WriteHeader(i int) { + rw.StatusCode = i +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/http/test_round_tripper.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/http/test_round_tripper.go new file mode 100644 index 00000000..b1e32f1d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/http/test_round_tripper.go @@ -0,0 +1,17 @@ +package http + +import ( + "github.com/stretchr/testify/mock" + "net/http" +) + +// TestRoundTripper DEPRECATED USE net/http/httptest +type TestRoundTripper struct { + mock.Mock +} + +// RoundTrip DEPRECATED USE net/http/httptest +func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + args := t.Called(req) + return args.Get(0).(*http.Response), args.Error(1) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/mock/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/mock/doc.go new file mode 100644 index 00000000..7324128e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/mock/doc.go @@ -0,0 +1,44 @@ +// Package mock provides a system by which it is possible to mock your objects +// and verify calls are happening as expected. +// +// Example Usage +// +// The mock package provides an object, Mock, that tracks activity on another object. It is usually +// embedded into a test object as shown below: +// +// type MyTestObject struct { +// // add a Mock object instance +// mock.Mock +// +// // other fields go here as normal +// } +// +// When implementing the methods of an interface, you wire your functions up +// to call the Mock.Called(args...) method, and return the appropriate values. +// +// For example, to mock a method that saves the name and age of a person and returns +// the year of their birth or an error, you might write this: +// +// func (o *MyTestObject) SavePersonDetails(firstname, lastname string, age int) (int, error) { +// args := o.Called(firstname, lastname, age) +// return args.Int(0), args.Error(1) +// } +// +// The Int, Error and Bool methods are examples of strongly typed getters that take the argument +// index position. Given this argument list: +// +// (12, true, "Something") +// +// You could read them out strongly typed like this: +// +// args.Int(0) +// args.Bool(1) +// args.String(2) +// +// For objects of your own type, use the generic Arguments.Get(index) method and make a type assertion: +// +// return args.Get(0).(*MyObject), args.Get(1).(*AnotherObjectOfMine) +// +// This may cause a panic if the object you are getting is nil (the type assertion will fail), in those +// cases you should check for nil first. +package mock diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/mock/mock.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/mock/mock.go new file mode 100644 index 00000000..637896b4 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/mock/mock.go @@ -0,0 +1,683 @@ +package mock + +import ( + "fmt" + "reflect" + "regexp" + "runtime" + "strings" + "sync" + "time" + + "github.com/stretchr/objx" + "github.com/stretchr/testify/assert" +) + +// TestingT is an interface wrapper around *testing.T +type TestingT interface { + Logf(format string, args ...interface{}) + Errorf(format string, args ...interface{}) + FailNow() +} + +/* + Call +*/ + +// Call represents a method call and is used for setting expectations, +// as well as recording activity. +type Call struct { + Parent *Mock + + // The name of the method that was or will be called. + Method string + + // Holds the arguments of the method. + Arguments Arguments + + // Holds the arguments that should be returned when + // this method is called. + ReturnArguments Arguments + + // The number of times to return the return arguments when setting + // expectations. 0 means to always return the value. + Repeatability int + + // Holds a channel that will be used to block the Return until it either + // recieves a message or is closed. nil means it returns immediately. + WaitFor <-chan time.Time + + // Holds a handler used to manipulate arguments content that are passed by + // reference. It's useful when mocking methods such as unmarshalers or + // decoders. + RunFn func(Arguments) +} + +func newCall(parent *Mock, methodName string, methodArguments ...interface{}) *Call { + return &Call{ + Parent: parent, + Method: methodName, + Arguments: methodArguments, + ReturnArguments: make([]interface{}, 0), + Repeatability: 0, + WaitFor: nil, + RunFn: nil, + } +} + +func (c *Call) lock() { + c.Parent.mutex.Lock() +} + +func (c *Call) unlock() { + c.Parent.mutex.Unlock() +} + +// Return specifies the return arguments for the expectation. +// +// Mock.On("DoSomething").Return(errors.New("failed")) +func (c *Call) Return(returnArguments ...interface{}) *Call { + c.lock() + defer c.unlock() + + c.ReturnArguments = returnArguments + + return c +} + +// Once indicates that that the mock should only return the value once. +// +// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Once() +func (c *Call) Once() *Call { + return c.Times(1) +} + +// Twice indicates that that the mock should only return the value twice. +// +// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Twice() +func (c *Call) Twice() *Call { + return c.Times(2) +} + +// Times indicates that that the mock should only return the indicated number +// of times. +// +// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Times(5) +func (c *Call) Times(i int) *Call { + c.lock() + defer c.unlock() + c.Repeatability = i + return c +} + +// WaitUntil sets the channel that will block the mock's return until its closed +// or a message is received. +// +// Mock.On("MyMethod", arg1, arg2).WaitUntil(time.After(time.Second)) +func (c *Call) WaitUntil(w <-chan time.Time) *Call { + c.lock() + defer c.unlock() + c.WaitFor = w + return c +} + +// After sets how long to block until the call returns +// +// Mock.On("MyMethod", arg1, arg2).After(time.Second) +func (c *Call) After(d time.Duration) *Call { + return c.WaitUntil(time.After(d)) +} + +// Run sets a handler to be called before returning. It can be used when +// mocking a method such as unmarshalers that takes a pointer to a struct and +// sets properties in such struct +// +// Mock.On("Unmarshal", AnythingOfType("*map[string]interface{}").Return().Run(function(args Arguments) { +// arg := args.Get(0).(*map[string]interface{}) +// arg["foo"] = "bar" +// }) +func (c *Call) Run(fn func(Arguments)) *Call { + c.lock() + defer c.unlock() + c.RunFn = fn + return c +} + +// On chains a new expectation description onto the mocked interface. This +// allows syntax like. +// +// Mock. +// On("MyMethod", 1).Return(nil). +// On("MyOtherMethod", 'a', 'b', 'c').Return(errors.New("Some Error")) +func (c *Call) On(methodName string, arguments ...interface{}) *Call { + return c.Parent.On(methodName, arguments...) +} + +// Mock is the workhorse used to track activity on another object. +// For an example of its usage, refer to the "Example Usage" section at the top +// of this document. +type Mock struct { + // Represents the calls that are expected of + // an object. + ExpectedCalls []*Call + + // Holds the calls that were made to this mocked object. + Calls []Call + + // TestData holds any data that might be useful for testing. Testify ignores + // this data completely allowing you to do whatever you like with it. + testData objx.Map + + mutex sync.Mutex +} + +// TestData holds any data that might be useful for testing. Testify ignores +// this data completely allowing you to do whatever you like with it. +func (m *Mock) TestData() objx.Map { + + if m.testData == nil { + m.testData = make(objx.Map) + } + + return m.testData +} + +/* + Setting expectations +*/ + +// On starts a description of an expectation of the specified method +// being called. +// +// Mock.On("MyMethod", arg1, arg2) +func (m *Mock) On(methodName string, arguments ...interface{}) *Call { + for _, arg := range arguments { + if v := reflect.ValueOf(arg); v.Kind() == reflect.Func { + panic(fmt.Sprintf("cannot use Func in expectations. Use mock.AnythingOfType(\"%T\")", arg)) + } + } + + m.mutex.Lock() + defer m.mutex.Unlock() + c := newCall(m, methodName, arguments...) + m.ExpectedCalls = append(m.ExpectedCalls, c) + return c +} + +// /* +// Recording and responding to activity +// */ + +func (m *Mock) findExpectedCall(method string, arguments ...interface{}) (int, *Call) { + m.mutex.Lock() + defer m.mutex.Unlock() + for i, call := range m.ExpectedCalls { + if call.Method == method && call.Repeatability > -1 { + + _, diffCount := call.Arguments.Diff(arguments) + if diffCount == 0 { + return i, call + } + + } + } + return -1, nil +} + +func (m *Mock) findClosestCall(method string, arguments ...interface{}) (bool, *Call) { + diffCount := 0 + var closestCall *Call + + for _, call := range m.expectedCalls() { + if call.Method == method { + + _, tempDiffCount := call.Arguments.Diff(arguments) + if tempDiffCount < diffCount || diffCount == 0 { + diffCount = tempDiffCount + closestCall = call + } + + } + } + + if closestCall == nil { + return false, nil + } + + return true, closestCall +} + +func callString(method string, arguments Arguments, includeArgumentValues bool) string { + + var argValsString string + if includeArgumentValues { + var argVals []string + for argIndex, arg := range arguments { + argVals = append(argVals, fmt.Sprintf("%d: %#v", argIndex, arg)) + } + argValsString = fmt.Sprintf("\n\t\t%s", strings.Join(argVals, "\n\t\t")) + } + + return fmt.Sprintf("%s(%s)%s", method, arguments.String(), argValsString) +} + +// Called tells the mock object that a method has been called, and gets an array +// of arguments to return. Panics if the call is unexpected (i.e. not preceeded by +// appropriate .On .Return() calls) +// If Call.WaitFor is set, blocks until the channel is closed or receives a message. +func (m *Mock) Called(arguments ...interface{}) Arguments { + // get the calling function's name + pc, _, _, ok := runtime.Caller(1) + if !ok { + panic("Couldn't get the caller information") + } + functionPath := runtime.FuncForPC(pc).Name() + //Next four lines are required to use GCCGO function naming conventions. + //For Ex: github_com_docker_libkv_store_mock.WatchTree.pN39_github_com_docker_libkv_store_mock.Mock + //uses inteface information unlike golang github.com/docker/libkv/store/mock.(*Mock).WatchTree + //With GCCGO we need to remove interface information starting from pN
. + re := regexp.MustCompile("\\.pN\\d+_") + if re.MatchString(functionPath) { + functionPath = re.Split(functionPath, -1)[0] + } + parts := strings.Split(functionPath, ".") + functionName := parts[len(parts)-1] + + found, call := m.findExpectedCall(functionName, arguments...) + + if found < 0 { + // we have to fail here - because we don't know what to do + // as the return arguments. This is because: + // + // a) this is a totally unexpected call to this method, + // b) the arguments are not what was expected, or + // c) the developer has forgotten to add an accompanying On...Return pair. + + closestFound, closestCall := m.findClosestCall(functionName, arguments...) + + if closestFound { + panic(fmt.Sprintf("\n\nmock: Unexpected Method Call\n-----------------------------\n\n%s\n\nThe closest call I have is: \n\n%s\n", callString(functionName, arguments, true), callString(functionName, closestCall.Arguments, true))) + } else { + panic(fmt.Sprintf("\nassert: mock: I don't know what to return because the method call was unexpected.\n\tEither do Mock.On(\"%s\").Return(...) first, or remove the %s() call.\n\tThis method was unexpected:\n\t\t%s\n\tat: %s", functionName, functionName, callString(functionName, arguments, true), assert.CallerInfo())) + } + } else { + m.mutex.Lock() + switch { + case call.Repeatability == 1: + call.Repeatability = -1 + + case call.Repeatability > 1: + call.Repeatability-- + } + m.mutex.Unlock() + } + + // add the call + m.mutex.Lock() + m.Calls = append(m.Calls, *newCall(m, functionName, arguments...)) + m.mutex.Unlock() + + // block if specified + if call.WaitFor != nil { + <-call.WaitFor + } + + if call.RunFn != nil { + call.RunFn(arguments) + } + + return call.ReturnArguments +} + +/* + Assertions +*/ + +// AssertExpectationsForObjects asserts that everything specified with On and Return +// of the specified objects was in fact called as expected. +// +// Calls may have occurred in any order. +func AssertExpectationsForObjects(t TestingT, testObjects ...interface{}) bool { + var success = true + for _, obj := range testObjects { + mockObj := obj.(Mock) + success = success && mockObj.AssertExpectations(t) + } + return success +} + +// AssertExpectations asserts that everything specified with On and Return was +// in fact called as expected. Calls may have occurred in any order. +func (m *Mock) AssertExpectations(t TestingT) bool { + var somethingMissing bool + var failedExpectations int + + // iterate through each expectation + expectedCalls := m.expectedCalls() + for _, expectedCall := range expectedCalls { + if !m.methodWasCalled(expectedCall.Method, expectedCall.Arguments) { + somethingMissing = true + failedExpectations++ + t.Logf("\u274C\t%s(%s)", expectedCall.Method, expectedCall.Arguments.String()) + } else { + m.mutex.Lock() + if expectedCall.Repeatability > 0 { + somethingMissing = true + failedExpectations++ + } else { + t.Logf("\u2705\t%s(%s)", expectedCall.Method, expectedCall.Arguments.String()) + } + m.mutex.Unlock() + } + } + + if somethingMissing { + t.Errorf("FAIL: %d out of %d expectation(s) were met.\n\tThe code you are testing needs to make %d more call(s).\n\tat: %s", len(expectedCalls)-failedExpectations, len(expectedCalls), failedExpectations, assert.CallerInfo()) + } + + return !somethingMissing +} + +// AssertNumberOfCalls asserts that the method was called expectedCalls times. +func (m *Mock) AssertNumberOfCalls(t TestingT, methodName string, expectedCalls int) bool { + var actualCalls int + for _, call := range m.calls() { + if call.Method == methodName { + actualCalls++ + } + } + return assert.Equal(t, expectedCalls, actualCalls, fmt.Sprintf("Expected number of calls (%d) does not match the actual number of calls (%d).", expectedCalls, actualCalls)) +} + +// AssertCalled asserts that the method was called. +func (m *Mock) AssertCalled(t TestingT, methodName string, arguments ...interface{}) bool { + if !assert.True(t, m.methodWasCalled(methodName, arguments), fmt.Sprintf("The \"%s\" method should have been called with %d argument(s), but was not.", methodName, len(arguments))) { + t.Logf("%v", m.expectedCalls()) + return false + } + return true +} + +// AssertNotCalled asserts that the method was not called. +func (m *Mock) AssertNotCalled(t TestingT, methodName string, arguments ...interface{}) bool { + if !assert.False(t, m.methodWasCalled(methodName, arguments), fmt.Sprintf("The \"%s\" method was called with %d argument(s), but should NOT have been.", methodName, len(arguments))) { + t.Logf("%v", m.expectedCalls()) + return false + } + return true +} + +func (m *Mock) methodWasCalled(methodName string, expected []interface{}) bool { + for _, call := range m.calls() { + if call.Method == methodName { + + _, differences := Arguments(expected).Diff(call.Arguments) + + if differences == 0 { + // found the expected call + return true + } + + } + } + // we didn't find the expected call + return false +} + +func (m *Mock) expectedCalls() []*Call { + m.mutex.Lock() + defer m.mutex.Unlock() + return append([]*Call{}, m.ExpectedCalls...) +} + +func (m *Mock) calls() []Call { + m.mutex.Lock() + defer m.mutex.Unlock() + return append([]Call{}, m.Calls...) +} + +/* + Arguments +*/ + +// Arguments holds an array of method arguments or return values. +type Arguments []interface{} + +const ( + // Anything is used in Diff and Assert when the argument being tested + // shouldn't be taken into consideration. + Anything string = "mock.Anything" +) + +// AnythingOfTypeArgument is a string that contains the type of an argument +// for use when type checking. Used in Diff and Assert. +type AnythingOfTypeArgument string + +// AnythingOfType returns an AnythingOfTypeArgument object containing the +// name of the type to check for. Used in Diff and Assert. +// +// For example: +// Assert(t, AnythingOfType("string"), AnythingOfType("int")) +func AnythingOfType(t string) AnythingOfTypeArgument { + return AnythingOfTypeArgument(t) +} + +// argumentMatcher performs custom argument matching, returning whether or +// not the argument is matched by the expectation fixture function. +type argumentMatcher struct { + // fn is a function which accepts one argument, and returns a bool. + fn reflect.Value +} + +func (f argumentMatcher) Matches(argument interface{}) bool { + expectType := f.fn.Type().In(0) + + if reflect.TypeOf(argument).AssignableTo(expectType) { + result := f.fn.Call([]reflect.Value{reflect.ValueOf(argument)}) + return result[0].Bool() + } + return false +} + +func (f argumentMatcher) String() string { + return fmt.Sprintf("func(%s) bool", f.fn.Type().In(0).Name()) +} + +// MatchedBy can be used to match a mock call based on only certain properties +// from a complex struct or some calculation. It takes a function that will be +// evaluated with the called argument and will return true when there's a match +// and false otherwise. +// +// Example: +// m.On("Do", func(req *http.Request) bool { return req.Host == "example.com" }) +// +// |fn|, must be a function accepting a single argument (of the expected type) +// which returns a bool. If |fn| doesn't match the required signature, +// MathedBy() panics. +func MatchedBy(fn interface{}) argumentMatcher { + fnType := reflect.TypeOf(fn) + + if fnType.Kind() != reflect.Func { + panic(fmt.Sprintf("assert: arguments: %s is not a func", fn)) + } + if fnType.NumIn() != 1 { + panic(fmt.Sprintf("assert: arguments: %s does not take exactly one argument", fn)) + } + if fnType.NumOut() != 1 || fnType.Out(0).Kind() != reflect.Bool { + panic(fmt.Sprintf("assert: arguments: %s does not return a bool", fn)) + } + + return argumentMatcher{fn: reflect.ValueOf(fn)} +} + +// Get Returns the argument at the specified index. +func (args Arguments) Get(index int) interface{} { + if index+1 > len(args) { + panic(fmt.Sprintf("assert: arguments: Cannot call Get(%d) because there are %d argument(s).", index, len(args))) + } + return args[index] +} + +// Is gets whether the objects match the arguments specified. +func (args Arguments) Is(objects ...interface{}) bool { + for i, obj := range args { + if obj != objects[i] { + return false + } + } + return true +} + +// Diff gets a string describing the differences between the arguments +// and the specified objects. +// +// Returns the diff string and number of differences found. +func (args Arguments) Diff(objects []interface{}) (string, int) { + + var output = "\n" + var differences int + + var maxArgCount = len(args) + if len(objects) > maxArgCount { + maxArgCount = len(objects) + } + + for i := 0; i < maxArgCount; i++ { + var actual, expected interface{} + + if len(objects) <= i { + actual = "(Missing)" + } else { + actual = objects[i] + } + + if len(args) <= i { + expected = "(Missing)" + } else { + expected = args[i] + } + + if matcher, ok := expected.(argumentMatcher); ok { + if matcher.Matches(actual) { + output = fmt.Sprintf("%s\t%d: \u2705 %s matched by %s\n", output, i, actual, matcher) + } else { + differences++ + output = fmt.Sprintf("%s\t%d: \u2705 %s not matched by %s\n", output, i, actual, matcher) + } + } else if reflect.TypeOf(expected) == reflect.TypeOf((*AnythingOfTypeArgument)(nil)).Elem() { + + // type checking + if reflect.TypeOf(actual).Name() != string(expected.(AnythingOfTypeArgument)) && reflect.TypeOf(actual).String() != string(expected.(AnythingOfTypeArgument)) { + // not match + differences++ + output = fmt.Sprintf("%s\t%d: \u274C type %s != type %s - %s\n", output, i, expected, reflect.TypeOf(actual).Name(), actual) + } + + } else { + + // normal checking + + if assert.ObjectsAreEqual(expected, Anything) || assert.ObjectsAreEqual(actual, Anything) || assert.ObjectsAreEqual(actual, expected) { + // match + output = fmt.Sprintf("%s\t%d: \u2705 %s == %s\n", output, i, actual, expected) + } else { + // not match + differences++ + output = fmt.Sprintf("%s\t%d: \u274C %s != %s\n", output, i, actual, expected) + } + } + + } + + if differences == 0 { + return "No differences.", differences + } + + return output, differences + +} + +// Assert compares the arguments with the specified objects and fails if +// they do not exactly match. +func (args Arguments) Assert(t TestingT, objects ...interface{}) bool { + + // get the differences + diff, diffCount := args.Diff(objects) + + if diffCount == 0 { + return true + } + + // there are differences... report them... + t.Logf(diff) + t.Errorf("%sArguments do not match.", assert.CallerInfo()) + + return false + +} + +// String gets the argument at the specified index. Panics if there is no argument, or +// if the argument is of the wrong type. +// +// If no index is provided, String() returns a complete string representation +// of the arguments. +func (args Arguments) String(indexOrNil ...int) string { + + if len(indexOrNil) == 0 { + // normal String() method - return a string representation of the args + var argsStr []string + for _, arg := range args { + argsStr = append(argsStr, fmt.Sprintf("%s", reflect.TypeOf(arg))) + } + return strings.Join(argsStr, ",") + } else if len(indexOrNil) == 1 { + // Index has been specified - get the argument at that index + var index = indexOrNil[0] + var s string + var ok bool + if s, ok = args.Get(index).(string); !ok { + panic(fmt.Sprintf("assert: arguments: String(%d) failed because object wasn't correct type: %s", index, args.Get(index))) + } + return s + } + + panic(fmt.Sprintf("assert: arguments: Wrong number of arguments passed to String. Must be 0 or 1, not %d", len(indexOrNil))) + +} + +// Int gets the argument at the specified index. Panics if there is no argument, or +// if the argument is of the wrong type. +func (args Arguments) Int(index int) int { + var s int + var ok bool + if s, ok = args.Get(index).(int); !ok { + panic(fmt.Sprintf("assert: arguments: Int(%d) failed because object wasn't correct type: %v", index, args.Get(index))) + } + return s +} + +// Error gets the argument at the specified index. Panics if there is no argument, or +// if the argument is of the wrong type. +func (args Arguments) Error(index int) error { + obj := args.Get(index) + var s error + var ok bool + if obj == nil { + return nil + } + if s, ok = obj.(error); !ok { + panic(fmt.Sprintf("assert: arguments: Error(%d) failed because object wasn't correct type: %v", index, args.Get(index))) + } + return s +} + +// Bool gets the argument at the specified index. Panics if there is no argument, or +// if the argument is of the wrong type. +func (args Arguments) Bool(index int) bool { + var s bool + var ok bool + if s, ok = args.Get(index).(bool); !ok { + panic(fmt.Sprintf("assert: arguments: Bool(%d) failed because object wasn't correct type: %v", index, args.Get(index))) + } + return s +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/doc.go new file mode 100644 index 00000000..169de392 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/doc.go @@ -0,0 +1,28 @@ +// Package require implements the same assertions as the `assert` package but +// stops test execution when a test fails. +// +// Example Usage +// +// The following is a complete example using require in a standard test function: +// import ( +// "testing" +// "github.com/stretchr/testify/require" +// ) +// +// func TestSomething(t *testing.T) { +// +// var a string = "Hello" +// var b string = "Hello" +// +// require.Equal(t, a, b, "The two words should be the same.") +// +// } +// +// Assertions +// +// The `require` package have same global functions as in the `assert` package, +// but instead of returning a boolean result they call `t.FailNow()`. +// +// Every assertion function also takes an optional string message as the final argument, +// allowing custom error messages to be appended to the message the assertion method outputs. +package require diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/forward_requirements.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/forward_requirements.go new file mode 100644 index 00000000..d3c2ab9b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/forward_requirements.go @@ -0,0 +1,16 @@ +package require + +// Assertions provides assertion methods around the +// TestingT interface. +type Assertions struct { + t TestingT +} + +// New makes a new Assertions object for the specified TestingT. +func New(t TestingT) *Assertions { + return &Assertions{ + t: t, + } +} + +//go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require.go new file mode 100644 index 00000000..1bcfcb0d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require.go @@ -0,0 +1,464 @@ +/* +* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen +* THIS FILE MUST NOT BE EDITED BY HAND +*/ + +package require + +import ( + + assert "github.com/stretchr/testify/assert" + http "net/http" + url "net/url" + time "time" +) + + +// Condition uses a Comparison to assert a complex condition. +func Condition(t TestingT, comp assert.Comparison, msgAndArgs ...interface{}) { + if !assert.Condition(t, comp, msgAndArgs...) { + t.FailNow() + } +} + + +// Contains asserts that the specified string, list(array, slice...) or map contains the +// specified substring or element. +// +// assert.Contains(t, "Hello World", "World", "But 'Hello World' does contain 'World'") +// assert.Contains(t, ["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") +// assert.Contains(t, {"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'") +// +// Returns whether the assertion was successful (true) or not (false). +func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { + if !assert.Contains(t, s, contains, msgAndArgs...) { + t.FailNow() + } +} + + +// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// assert.Empty(t, obj) +// +// Returns whether the assertion was successful (true) or not (false). +func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if !assert.Empty(t, object, msgAndArgs...) { + t.FailNow() + } +} + + +// Equal asserts that two objects are equal. +// +// assert.Equal(t, 123, 123, "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if !assert.Equal(t, expected, actual, msgAndArgs...) { + t.FailNow() + } +} + + +// EqualError asserts that a function returned an error (i.e. not `nil`) +// and that it is equal to the provided error. +// +// actualObj, err := SomeFunction() +// if assert.Error(t, err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) { + if !assert.EqualError(t, theError, errString, msgAndArgs...) { + t.FailNow() + } +} + + +// EqualValues asserts that two objects are equal or convertable to the same types +// and equal. +// +// assert.EqualValues(t, uint32(123), int32(123), "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if !assert.EqualValues(t, expected, actual, msgAndArgs...) { + t.FailNow() + } +} + + +// Error asserts that a function returned an error (i.e. not `nil`). +// +// actualObj, err := SomeFunction() +// if assert.Error(t, err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func Error(t TestingT, err error, msgAndArgs ...interface{}) { + if !assert.Error(t, err, msgAndArgs...) { + t.FailNow() + } +} + + +// Exactly asserts that two objects are equal is value and type. +// +// assert.Exactly(t, int32(123), int64(123), "123 and 123 should NOT be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if !assert.Exactly(t, expected, actual, msgAndArgs...) { + t.FailNow() + } +} + + +// Fail reports a failure through +func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) { + if !assert.Fail(t, failureMessage, msgAndArgs...) { + t.FailNow() + } +} + + +// FailNow fails test +func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) { + if !assert.FailNow(t, failureMessage, msgAndArgs...) { + t.FailNow() + } +} + + +// False asserts that the specified value is false. +// +// assert.False(t, myBool, "myBool should be false") +// +// Returns whether the assertion was successful (true) or not (false). +func False(t TestingT, value bool, msgAndArgs ...interface{}) { + if !assert.False(t, value, msgAndArgs...) { + t.FailNow() + } +} + + +// HTTPBodyContains asserts that a specified handler returns a +// body that contains a string. +// +// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) { + if !assert.HTTPBodyContains(t, handler, method, url, values, str) { + t.FailNow() + } +} + + +// HTTPBodyNotContains asserts that a specified handler returns a +// body that does not contain a string. +// +// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) { + if !assert.HTTPBodyNotContains(t, handler, method, url, values, str) { + t.FailNow() + } +} + + +// HTTPError asserts that a specified handler returns an error status code. +// +// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) { + if !assert.HTTPError(t, handler, method, url, values) { + t.FailNow() + } +} + + +// HTTPRedirect asserts that a specified handler returns a redirect status code. +// +// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) { + if !assert.HTTPRedirect(t, handler, method, url, values) { + t.FailNow() + } +} + + +// HTTPSuccess asserts that a specified handler returns a success status code. +// +// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) { + if !assert.HTTPSuccess(t, handler, method, url, values) { + t.FailNow() + } +} + + +// Implements asserts that an object is implemented by the specified interface. +// +// assert.Implements(t, (*MyInterface)(nil), new(MyObject), "MyObject") +func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { + if !assert.Implements(t, interfaceObject, object, msgAndArgs...) { + t.FailNow() + } +} + + +// InDelta asserts that the two numerals are within delta of each other. +// +// assert.InDelta(t, math.Pi, (22 / 7.0), 0.01) +// +// Returns whether the assertion was successful (true) or not (false). +func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { + if !assert.InDelta(t, expected, actual, delta, msgAndArgs...) { + t.FailNow() + } +} + + +// InDeltaSlice is the same as InDelta, except it compares two slices. +func InDeltaSlice(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { + if !assert.InDeltaSlice(t, expected, actual, delta, msgAndArgs...) { + t.FailNow() + } +} + + +// InEpsilon asserts that expected and actual have a relative error less than epsilon +// +// Returns whether the assertion was successful (true) or not (false). +func InEpsilon(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { + if !assert.InEpsilon(t, expected, actual, epsilon, msgAndArgs...) { + t.FailNow() + } +} + + +// InEpsilonSlice is the same as InEpsilon, except it compares two slices. +func InEpsilonSlice(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { + if !assert.InEpsilonSlice(t, expected, actual, delta, msgAndArgs...) { + t.FailNow() + } +} + + +// IsType asserts that the specified objects are of the same type. +func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { + if !assert.IsType(t, expectedType, object, msgAndArgs...) { + t.FailNow() + } +} + + +// JSONEq asserts that two JSON strings are equivalent. +// +// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// +// Returns whether the assertion was successful (true) or not (false). +func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) { + if !assert.JSONEq(t, expected, actual, msgAndArgs...) { + t.FailNow() + } +} + + +// Len asserts that the specified object has specific length. +// Len also fails if the object has a type that len() not accept. +// +// assert.Len(t, mySlice, 3, "The size of slice is not 3") +// +// Returns whether the assertion was successful (true) or not (false). +func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) { + if !assert.Len(t, object, length, msgAndArgs...) { + t.FailNow() + } +} + + +// Nil asserts that the specified object is nil. +// +// assert.Nil(t, err, "err should be nothing") +// +// Returns whether the assertion was successful (true) or not (false). +func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if !assert.Nil(t, object, msgAndArgs...) { + t.FailNow() + } +} + + +// NoError asserts that a function returned no error (i.e. `nil`). +// +// actualObj, err := SomeFunction() +// if assert.NoError(t, err) { +// assert.Equal(t, actualObj, expectedObj) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func NoError(t TestingT, err error, msgAndArgs ...interface{}) { + if !assert.NoError(t, err, msgAndArgs...) { + t.FailNow() + } +} + + +// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the +// specified substring or element. +// +// assert.NotContains(t, "Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") +// assert.NotContains(t, ["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") +// assert.NotContains(t, {"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'") +// +// Returns whether the assertion was successful (true) or not (false). +func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { + if !assert.NotContains(t, s, contains, msgAndArgs...) { + t.FailNow() + } +} + + +// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// if assert.NotEmpty(t, obj) { +// assert.Equal(t, "two", obj[1]) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if !assert.NotEmpty(t, object, msgAndArgs...) { + t.FailNow() + } +} + + +// NotEqual asserts that the specified values are NOT equal. +// +// assert.NotEqual(t, obj1, obj2, "two objects shouldn't be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if !assert.NotEqual(t, expected, actual, msgAndArgs...) { + t.FailNow() + } +} + + +// NotNil asserts that the specified object is not nil. +// +// assert.NotNil(t, err, "err should be something") +// +// Returns whether the assertion was successful (true) or not (false). +func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if !assert.NotNil(t, object, msgAndArgs...) { + t.FailNow() + } +} + + +// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. +// +// assert.NotPanics(t, func(){ +// RemainCalm() +// }, "Calling RemainCalm() should NOT panic") +// +// Returns whether the assertion was successful (true) or not (false). +func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { + if !assert.NotPanics(t, f, msgAndArgs...) { + t.FailNow() + } +} + + +// NotRegexp asserts that a specified regexp does not match a string. +// +// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") +// assert.NotRegexp(t, "^start", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { + if !assert.NotRegexp(t, rx, str, msgAndArgs...) { + t.FailNow() + } +} + + +// NotZero asserts that i is not the zero value for its type and returns the truth. +func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) { + if !assert.NotZero(t, i, msgAndArgs...) { + t.FailNow() + } +} + + +// Panics asserts that the code inside the specified PanicTestFunc panics. +// +// assert.Panics(t, func(){ +// GoCrazy() +// }, "Calling GoCrazy() should panic") +// +// Returns whether the assertion was successful (true) or not (false). +func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { + if !assert.Panics(t, f, msgAndArgs...) { + t.FailNow() + } +} + + +// Regexp asserts that a specified regexp matches a string. +// +// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") +// assert.Regexp(t, "start...$", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { + if !assert.Regexp(t, rx, str, msgAndArgs...) { + t.FailNow() + } +} + + +// True asserts that the specified value is true. +// +// assert.True(t, myBool, "myBool should be true") +// +// Returns whether the assertion was successful (true) or not (false). +func True(t TestingT, value bool, msgAndArgs ...interface{}) { + if !assert.True(t, value, msgAndArgs...) { + t.FailNow() + } +} + + +// WithinDuration asserts that the two times are within duration delta of each other. +// +// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") +// +// Returns whether the assertion was successful (true) or not (false). +func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { + if !assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) { + t.FailNow() + } +} + + +// Zero asserts that i is the zero value for its type and returns the truth. +func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) { + if !assert.Zero(t, i, msgAndArgs...) { + t.FailNow() + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require.go.tmpl b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require.go.tmpl new file mode 100644 index 00000000..ab1b1e9f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require.go.tmpl @@ -0,0 +1,6 @@ +{{.Comment}} +func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { + if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { + t.FailNow() + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require_forward.go new file mode 100644 index 00000000..58324f10 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require_forward.go @@ -0,0 +1,388 @@ +/* +* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen +* THIS FILE MUST NOT BE EDITED BY HAND +*/ + +package require + +import ( + + assert "github.com/stretchr/testify/assert" + http "net/http" + url "net/url" + time "time" +) + + +// Condition uses a Comparison to assert a complex condition. +func (a *Assertions) Condition(comp assert.Comparison, msgAndArgs ...interface{}) { + Condition(a.t, comp, msgAndArgs...) +} + + +// Contains asserts that the specified string, list(array, slice...) or map contains the +// specified substring or element. +// +// a.Contains("Hello World", "World", "But 'Hello World' does contain 'World'") +// a.Contains(["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") +// a.Contains({"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { + Contains(a.t, s, contains, msgAndArgs...) +} + + +// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// a.Empty(obj) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) { + Empty(a.t, object, msgAndArgs...) +} + + +// Equal asserts that two objects are equal. +// +// a.Equal(123, 123, "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + Equal(a.t, expected, actual, msgAndArgs...) +} + + +// EqualError asserts that a function returned an error (i.e. not `nil`) +// and that it is equal to the provided error. +// +// actualObj, err := SomeFunction() +// if assert.Error(t, err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) { + EqualError(a.t, theError, errString, msgAndArgs...) +} + + +// EqualValues asserts that two objects are equal or convertable to the same types +// and equal. +// +// a.EqualValues(uint32(123), int32(123), "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + EqualValues(a.t, expected, actual, msgAndArgs...) +} + + +// Error asserts that a function returned an error (i.e. not `nil`). +// +// actualObj, err := SomeFunction() +// if a.Error(err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { + Error(a.t, err, msgAndArgs...) +} + + +// Exactly asserts that two objects are equal is value and type. +// +// a.Exactly(int32(123), int64(123), "123 and 123 should NOT be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + Exactly(a.t, expected, actual, msgAndArgs...) +} + + +// Fail reports a failure through +func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) { + Fail(a.t, failureMessage, msgAndArgs...) +} + + +// FailNow fails test +func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) { + FailNow(a.t, failureMessage, msgAndArgs...) +} + + +// False asserts that the specified value is false. +// +// a.False(myBool, "myBool should be false") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) False(value bool, msgAndArgs ...interface{}) { + False(a.t, value, msgAndArgs...) +} + + +// HTTPBodyContains asserts that a specified handler returns a +// body that contains a string. +// +// a.HTTPBodyContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) { + HTTPBodyContains(a.t, handler, method, url, values, str) +} + + +// HTTPBodyNotContains asserts that a specified handler returns a +// body that does not contain a string. +// +// a.HTTPBodyNotContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) { + HTTPBodyNotContains(a.t, handler, method, url, values, str) +} + + +// HTTPError asserts that a specified handler returns an error status code. +// +// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values) { + HTTPError(a.t, handler, method, url, values) +} + + +// HTTPRedirect asserts that a specified handler returns a redirect status code. +// +// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values) { + HTTPRedirect(a.t, handler, method, url, values) +} + + +// HTTPSuccess asserts that a specified handler returns a success status code. +// +// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values) { + HTTPSuccess(a.t, handler, method, url, values) +} + + +// Implements asserts that an object is implemented by the specified interface. +// +// a.Implements((*MyInterface)(nil), new(MyObject), "MyObject") +func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { + Implements(a.t, interfaceObject, object, msgAndArgs...) +} + + +// InDelta asserts that the two numerals are within delta of each other. +// +// a.InDelta(math.Pi, (22 / 7.0), 0.01) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { + InDelta(a.t, expected, actual, delta, msgAndArgs...) +} + + +// InDeltaSlice is the same as InDelta, except it compares two slices. +func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { + InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...) +} + + +// InEpsilon asserts that expected and actual have a relative error less than epsilon +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { + InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...) +} + + +// InEpsilonSlice is the same as InEpsilon, except it compares two slices. +func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { + InEpsilonSlice(a.t, expected, actual, delta, msgAndArgs...) +} + + +// IsType asserts that the specified objects are of the same type. +func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { + IsType(a.t, expectedType, object, msgAndArgs...) +} + + +// JSONEq asserts that two JSON strings are equivalent. +// +// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) { + JSONEq(a.t, expected, actual, msgAndArgs...) +} + + +// Len asserts that the specified object has specific length. +// Len also fails if the object has a type that len() not accept. +// +// a.Len(mySlice, 3, "The size of slice is not 3") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) { + Len(a.t, object, length, msgAndArgs...) +} + + +// Nil asserts that the specified object is nil. +// +// a.Nil(err, "err should be nothing") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) { + Nil(a.t, object, msgAndArgs...) +} + + +// NoError asserts that a function returned no error (i.e. `nil`). +// +// actualObj, err := SomeFunction() +// if a.NoError(err) { +// assert.Equal(t, actualObj, expectedObj) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) { + NoError(a.t, err, msgAndArgs...) +} + + +// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the +// specified substring or element. +// +// a.NotContains("Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") +// a.NotContains(["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") +// a.NotContains({"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { + NotContains(a.t, s, contains, msgAndArgs...) +} + + +// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// if a.NotEmpty(obj) { +// assert.Equal(t, "two", obj[1]) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) { + NotEmpty(a.t, object, msgAndArgs...) +} + + +// NotEqual asserts that the specified values are NOT equal. +// +// a.NotEqual(obj1, obj2, "two objects shouldn't be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + NotEqual(a.t, expected, actual, msgAndArgs...) +} + + +// NotNil asserts that the specified object is not nil. +// +// a.NotNil(err, "err should be something") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) { + NotNil(a.t, object, msgAndArgs...) +} + + +// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. +// +// a.NotPanics(func(){ +// RemainCalm() +// }, "Calling RemainCalm() should NOT panic") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotPanics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { + NotPanics(a.t, f, msgAndArgs...) +} + + +// NotRegexp asserts that a specified regexp does not match a string. +// +// a.NotRegexp(regexp.MustCompile("starts"), "it's starting") +// a.NotRegexp("^start", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { + NotRegexp(a.t, rx, str, msgAndArgs...) +} + + +// NotZero asserts that i is not the zero value for its type and returns the truth. +func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) { + NotZero(a.t, i, msgAndArgs...) +} + + +// Panics asserts that the code inside the specified PanicTestFunc panics. +// +// a.Panics(func(){ +// GoCrazy() +// }, "Calling GoCrazy() should panic") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { + Panics(a.t, f, msgAndArgs...) +} + + +// Regexp asserts that a specified regexp matches a string. +// +// a.Regexp(regexp.MustCompile("start"), "it's starting") +// a.Regexp("start...$", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { + Regexp(a.t, rx, str, msgAndArgs...) +} + + +// True asserts that the specified value is true. +// +// a.True(myBool, "myBool should be true") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) True(value bool, msgAndArgs ...interface{}) { + True(a.t, value, msgAndArgs...) +} + + +// WithinDuration asserts that the two times are within duration delta of each other. +// +// a.WithinDuration(time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { + WithinDuration(a.t, expected, actual, delta, msgAndArgs...) +} + + +// Zero asserts that i is the zero value for its type and returns the truth. +func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) { + Zero(a.t, i, msgAndArgs...) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl new file mode 100644 index 00000000..b93569e0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl @@ -0,0 +1,4 @@ +{{.CommentWithoutT "a"}} +func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { + {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/requirements.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/requirements.go new file mode 100644 index 00000000..41147562 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/require/requirements.go @@ -0,0 +1,9 @@ +package require + +// TestingT is an interface wrapper around *testing.T +type TestingT interface { + Errorf(format string, args ...interface{}) + FailNow() +} + +//go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/suite/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/suite/doc.go new file mode 100644 index 00000000..f91a245d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/suite/doc.go @@ -0,0 +1,65 @@ +// Package suite contains logic for creating testing suite structs +// and running the methods on those structs as tests. The most useful +// piece of this package is that you can create setup/teardown methods +// on your testing suites, which will run before/after the whole suite +// or individual tests (depending on which interface(s) you +// implement). +// +// A testing suite is usually built by first extending the built-in +// suite functionality from suite.Suite in testify. Alternatively, +// you could reproduce that logic on your own if you wanted (you +// just need to implement the TestingSuite interface from +// suite/interfaces.go). +// +// After that, you can implement any of the interfaces in +// suite/interfaces.go to add setup/teardown functionality to your +// suite, and add any methods that start with "Test" to add tests. +// Methods that do not match any suite interfaces and do not begin +// with "Test" will not be run by testify, and can safely be used as +// helper methods. +// +// Once you've built your testing suite, you need to run the suite +// (using suite.Run from testify) inside any function that matches the +// identity that "go test" is already looking for (i.e. +// func(*testing.T)). +// +// Regular expression to select test suites specified command-line +// argument "-run". Regular expression to select the methods +// of test suites specified command-line argument "-m". +// Suite object has assertion methods. +// +// A crude example: +// // Basic imports +// import ( +// "testing" +// "github.com/stretchr/testify/assert" +// "github.com/stretchr/testify/suite" +// ) +// +// // Define the suite, and absorb the built-in basic suite +// // functionality from testify - including a T() method which +// // returns the current testing context +// type ExampleTestSuite struct { +// suite.Suite +// VariableThatShouldStartAtFive int +// } +// +// // Make sure that VariableThatShouldStartAtFive is set to five +// // before each test +// func (suite *ExampleTestSuite) SetupTest() { +// suite.VariableThatShouldStartAtFive = 5 +// } +// +// // All methods that begin with "Test" are run as tests within a +// // suite. +// func (suite *ExampleTestSuite) TestExample() { +// assert.Equal(suite.T(), 5, suite.VariableThatShouldStartAtFive) +// suite.Equal(5, suite.VariableThatShouldStartAtFive) +// } +// +// // In order for 'go test' to run this suite, we need to create +// // a normal test function and pass our suite to suite.Run +// func TestExampleTestSuite(t *testing.T) { +// suite.Run(t, new(ExampleTestSuite)) +// } +package suite diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/suite/interfaces.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/suite/interfaces.go new file mode 100644 index 00000000..20969472 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/suite/interfaces.go @@ -0,0 +1,34 @@ +package suite + +import "testing" + +// TestingSuite can store and return the current *testing.T context +// generated by 'go test'. +type TestingSuite interface { + T() *testing.T + SetT(*testing.T) +} + +// SetupAllSuite has a SetupSuite method, which will run before the +// tests in the suite are run. +type SetupAllSuite interface { + SetupSuite() +} + +// SetupTestSuite has a SetupTest method, which will run before each +// test in the suite. +type SetupTestSuite interface { + SetupTest() +} + +// TearDownAllSuite has a TearDownSuite method, which will run after +// all the tests in the suite have been run. +type TearDownAllSuite interface { + TearDownSuite() +} + +// TearDownTestSuite has a TearDownTest method, which will run after +// each test in the suite. +type TearDownTestSuite interface { + TearDownTest() +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/suite/suite.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/suite/suite.go new file mode 100644 index 00000000..f831e251 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/suite/suite.go @@ -0,0 +1,115 @@ +package suite + +import ( + "flag" + "fmt" + "os" + "reflect" + "regexp" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var matchMethod = flag.String("m", "", "regular expression to select tests of the suite to run") + +// Suite is a basic testing suite with methods for storing and +// retrieving the current *testing.T context. +type Suite struct { + *assert.Assertions + require *require.Assertions + t *testing.T +} + +// T retrieves the current *testing.T context. +func (suite *Suite) T() *testing.T { + return suite.t +} + +// SetT sets the current *testing.T context. +func (suite *Suite) SetT(t *testing.T) { + suite.t = t + suite.Assertions = assert.New(t) + suite.require = require.New(t) +} + +// Require returns a require context for suite. +func (suite *Suite) Require() *require.Assertions { + if suite.require == nil { + suite.require = require.New(suite.T()) + } + return suite.require +} + +// Assert returns an assert context for suite. Normally, you can call +// `suite.NoError(expected, actual)`, but for situations where the embedded +// methods are overridden (for example, you might want to override +// assert.Assertions with require.Assertions), this method is provided so you +// can call `suite.Assert().NoError()`. +func (suite *Suite) Assert() *assert.Assertions { + if suite.Assertions == nil { + suite.Assertions = assert.New(suite.T()) + } + return suite.Assertions +} + +// Run takes a testing suite and runs all of the tests attached +// to it. +func Run(t *testing.T, suite TestingSuite) { + suite.SetT(t) + + if setupAllSuite, ok := suite.(SetupAllSuite); ok { + setupAllSuite.SetupSuite() + } + defer func() { + if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok { + tearDownAllSuite.TearDownSuite() + } + }() + + methodFinder := reflect.TypeOf(suite) + tests := []testing.InternalTest{} + for index := 0; index < methodFinder.NumMethod(); index++ { + method := methodFinder.Method(index) + ok, err := methodFilter(method.Name) + if err != nil { + fmt.Fprintf(os.Stderr, "testify: invalid regexp for -m: %s\n", err) + os.Exit(1) + } + if ok { + test := testing.InternalTest{ + Name: method.Name, + F: func(t *testing.T) { + parentT := suite.T() + suite.SetT(t) + if setupTestSuite, ok := suite.(SetupTestSuite); ok { + setupTestSuite.SetupTest() + } + defer func() { + if tearDownTestSuite, ok := suite.(TearDownTestSuite); ok { + tearDownTestSuite.TearDownTest() + } + suite.SetT(parentT) + }() + method.Func.Call([]reflect.Value{reflect.ValueOf(suite)}) + }, + } + tests = append(tests, test) + } + } + + if !testing.RunTests(func(_, _ string) (bool, error) { return true, nil }, + tests) { + t.Fail() + } +} + +// Filtering method according to set regular expression +// specified command-line argument -m +func methodFilter(name string) (bool, error) { + if ok, _ := regexp.MatchString("^Test", name); !ok { + return false, nil + } + return regexp.MatchString(*matchMethod, name) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/LICENSE new file mode 100644 index 00000000..2a7cfd2b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2012-2013 Dave Collins + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypass.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypass.go new file mode 100644 index 00000000..a8d27a3f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypass.go @@ -0,0 +1,136 @@ +// Copyright (c) 2015 Dave Collins +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when the code is not running on Google App Engine and "-tags disableunsafe" +// is not added to the go build command line. +// +build !appengine,!disableunsafe + +package spew + +import ( + "reflect" + "unsafe" +) + +const ( + // UnsafeDisabled is a build-time constant which specifies whether or + // not access to the unsafe package is available. + UnsafeDisabled = false + + // ptrSize is the size of a pointer on the current arch. + ptrSize = unsafe.Sizeof((*byte)(nil)) +) + +var ( + // offsetPtr, offsetScalar, and offsetFlag are the offsets for the + // internal reflect.Value fields. These values are valid before golang + // commit ecccf07e7f9d which changed the format. The are also valid + // after commit 82f48826c6c7 which changed the format again to mirror + // the original format. Code in the init function updates these offsets + // as necessary. + offsetPtr = uintptr(ptrSize) + offsetScalar = uintptr(0) + offsetFlag = uintptr(ptrSize * 2) + + // flagKindWidth and flagKindShift indicate various bits that the + // reflect package uses internally to track kind information. + // + // flagRO indicates whether or not the value field of a reflect.Value is + // read-only. + // + // flagIndir indicates whether the value field of a reflect.Value is + // the actual data or a pointer to the data. + // + // These values are valid before golang commit 90a7c3c86944 which + // changed their positions. Code in the init function updates these + // flags as necessary. + flagKindWidth = uintptr(5) + flagKindShift = uintptr(flagKindWidth - 1) + flagRO = uintptr(1 << 0) + flagIndir = uintptr(1 << 1) +) + +func init() { + // Older versions of reflect.Value stored small integers directly in the + // ptr field (which is named val in the older versions). Versions + // between commits ecccf07e7f9d and 82f48826c6c7 added a new field named + // scalar for this purpose which unfortunately came before the flag + // field, so the offset of the flag field is different for those + // versions. + // + // This code constructs a new reflect.Value from a known small integer + // and checks if the size of the reflect.Value struct indicates it has + // the scalar field. When it does, the offsets are updated accordingly. + vv := reflect.ValueOf(0xf00) + if unsafe.Sizeof(vv) == (ptrSize * 4) { + offsetScalar = ptrSize * 2 + offsetFlag = ptrSize * 3 + } + + // Commit 90a7c3c86944 changed the flag positions such that the low + // order bits are the kind. This code extracts the kind from the flags + // field and ensures it's the correct type. When it's not, the flag + // order has been changed to the newer format, so the flags are updated + // accordingly. + upf := unsafe.Pointer(uintptr(unsafe.Pointer(&vv)) + offsetFlag) + upfv := *(*uintptr)(upf) + flagKindMask := uintptr((1<>flagKindShift != uintptr(reflect.Int) { + flagKindShift = 0 + flagRO = 1 << 5 + flagIndir = 1 << 6 + } +} + +// unsafeReflectValue converts the passed reflect.Value into a one that bypasses +// the typical safety restrictions preventing access to unaddressable and +// unexported data. It works by digging the raw pointer to the underlying +// value out of the protected value and generating a new unprotected (unsafe) +// reflect.Value to it. +// +// This allows us to check for implementations of the Stringer and error +// interfaces to be used for pretty printing ordinarily unaddressable and +// inaccessible values such as unexported struct fields. +func unsafeReflectValue(v reflect.Value) (rv reflect.Value) { + indirects := 1 + vt := v.Type() + upv := unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetPtr) + rvf := *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetFlag)) + if rvf&flagIndir != 0 { + vt = reflect.PtrTo(v.Type()) + indirects++ + } else if offsetScalar != 0 { + // The value is in the scalar field when it's not one of the + // reference types. + switch vt.Kind() { + case reflect.Uintptr: + case reflect.Chan: + case reflect.Func: + case reflect.Map: + case reflect.Ptr: + case reflect.UnsafePointer: + default: + upv = unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + + offsetScalar) + } + } + + pv := reflect.NewAt(vt, upv) + rv = pv + for i := 0; i < indirects; i++ { + rv = rv.Elem() + } + return rv +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go new file mode 100644 index 00000000..457e4123 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go @@ -0,0 +1,37 @@ +// Copyright (c) 2015 Dave Collins +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// NOTE: Due to the following build constraints, this file will only be compiled +// when either the code is running on Google App Engine or "-tags disableunsafe" +// is added to the go build command line. +// +build appengine disableunsafe + +package spew + +import "reflect" + +const ( + // UnsafeDisabled is a build-time constant which specifies whether or + // not access to the unsafe package is available. + UnsafeDisabled = true +) + +// unsafeReflectValue typically converts the passed reflect.Value into a one +// that bypasses the typical safety restrictions preventing access to +// unaddressable and unexported data. However, doing this relies on access to +// the unsafe package. This is a stub version which simply returns the passed +// reflect.Value when the unsafe package is not available. +func unsafeReflectValue(v reflect.Value) reflect.Value { + return v +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/common.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/common.go new file mode 100644 index 00000000..14f02dc1 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/common.go @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2013 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "fmt" + "io" + "reflect" + "sort" + "strconv" +) + +// Some constants in the form of bytes to avoid string overhead. This mirrors +// the technique used in the fmt package. +var ( + panicBytes = []byte("(PANIC=") + plusBytes = []byte("+") + iBytes = []byte("i") + trueBytes = []byte("true") + falseBytes = []byte("false") + interfaceBytes = []byte("(interface {})") + commaNewlineBytes = []byte(",\n") + newlineBytes = []byte("\n") + openBraceBytes = []byte("{") + openBraceNewlineBytes = []byte("{\n") + closeBraceBytes = []byte("}") + asteriskBytes = []byte("*") + colonBytes = []byte(":") + colonSpaceBytes = []byte(": ") + openParenBytes = []byte("(") + closeParenBytes = []byte(")") + spaceBytes = []byte(" ") + pointerChainBytes = []byte("->") + nilAngleBytes = []byte("") + maxNewlineBytes = []byte("\n") + maxShortBytes = []byte("") + circularBytes = []byte("") + circularShortBytes = []byte("") + invalidAngleBytes = []byte("") + openBracketBytes = []byte("[") + closeBracketBytes = []byte("]") + percentBytes = []byte("%") + precisionBytes = []byte(".") + openAngleBytes = []byte("<") + closeAngleBytes = []byte(">") + openMapBytes = []byte("map[") + closeMapBytes = []byte("]") + lenEqualsBytes = []byte("len=") + capEqualsBytes = []byte("cap=") +) + +// hexDigits is used to map a decimal value to a hex digit. +var hexDigits = "0123456789abcdef" + +// catchPanic handles any panics that might occur during the handleMethods +// calls. +func catchPanic(w io.Writer, v reflect.Value) { + if err := recover(); err != nil { + w.Write(panicBytes) + fmt.Fprintf(w, "%v", err) + w.Write(closeParenBytes) + } +} + +// handleMethods attempts to call the Error and String methods on the underlying +// type the passed reflect.Value represents and outputes the result to Writer w. +// +// It handles panics in any called methods by catching and displaying the error +// as the formatted value. +func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) { + // We need an interface to check if the type implements the error or + // Stringer interface. However, the reflect package won't give us an + // interface on certain things like unexported struct fields in order + // to enforce visibility rules. We use unsafe, when it's available, + // to bypass these restrictions since this package does not mutate the + // values. + if !v.CanInterface() { + if UnsafeDisabled { + return false + } + + v = unsafeReflectValue(v) + } + + // Choose whether or not to do error and Stringer interface lookups against + // the base type or a pointer to the base type depending on settings. + // Technically calling one of these methods with a pointer receiver can + // mutate the value, however, types which choose to satisify an error or + // Stringer interface with a pointer receiver should not be mutating their + // state inside these interface methods. + if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() { + v = unsafeReflectValue(v) + } + if v.CanAddr() { + v = v.Addr() + } + + // Is it an error or Stringer? + switch iface := v.Interface().(type) { + case error: + defer catchPanic(w, v) + if cs.ContinueOnMethod { + w.Write(openParenBytes) + w.Write([]byte(iface.Error())) + w.Write(closeParenBytes) + w.Write(spaceBytes) + return false + } + + w.Write([]byte(iface.Error())) + return true + + case fmt.Stringer: + defer catchPanic(w, v) + if cs.ContinueOnMethod { + w.Write(openParenBytes) + w.Write([]byte(iface.String())) + w.Write(closeParenBytes) + w.Write(spaceBytes) + return false + } + w.Write([]byte(iface.String())) + return true + } + return false +} + +// printBool outputs a boolean value as true or false to Writer w. +func printBool(w io.Writer, val bool) { + if val { + w.Write(trueBytes) + } else { + w.Write(falseBytes) + } +} + +// printInt outputs a signed integer value to Writer w. +func printInt(w io.Writer, val int64, base int) { + w.Write([]byte(strconv.FormatInt(val, base))) +} + +// printUint outputs an unsigned integer value to Writer w. +func printUint(w io.Writer, val uint64, base int) { + w.Write([]byte(strconv.FormatUint(val, base))) +} + +// printFloat outputs a floating point value using the specified precision, +// which is expected to be 32 or 64bit, to Writer w. +func printFloat(w io.Writer, val float64, precision int) { + w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision))) +} + +// printComplex outputs a complex value using the specified float precision +// for the real and imaginary parts to Writer w. +func printComplex(w io.Writer, c complex128, floatPrecision int) { + r := real(c) + w.Write(openParenBytes) + w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision))) + i := imag(c) + if i >= 0 { + w.Write(plusBytes) + } + w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision))) + w.Write(iBytes) + w.Write(closeParenBytes) +} + +// printHexPtr outputs a uintptr formatted as hexidecimal with a leading '0x' +// prefix to Writer w. +func printHexPtr(w io.Writer, p uintptr) { + // Null pointer. + num := uint64(p) + if num == 0 { + w.Write(nilAngleBytes) + return + } + + // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix + buf := make([]byte, 18) + + // It's simpler to construct the hex string right to left. + base := uint64(16) + i := len(buf) - 1 + for num >= base { + buf[i] = hexDigits[num%base] + num /= base + i-- + } + buf[i] = hexDigits[num] + + // Add '0x' prefix. + i-- + buf[i] = 'x' + i-- + buf[i] = '0' + + // Strip unused leading bytes. + buf = buf[i:] + w.Write(buf) +} + +// valuesSorter implements sort.Interface to allow a slice of reflect.Value +// elements to be sorted. +type valuesSorter struct { + values []reflect.Value + strings []string // either nil or same len and values + cs *ConfigState +} + +// newValuesSorter initializes a valuesSorter instance, which holds a set of +// surrogate keys on which the data should be sorted. It uses flags in +// ConfigState to decide if and how to populate those surrogate keys. +func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface { + vs := &valuesSorter{values: values, cs: cs} + if canSortSimply(vs.values[0].Kind()) { + return vs + } + if !cs.DisableMethods { + vs.strings = make([]string, len(values)) + for i := range vs.values { + b := bytes.Buffer{} + if !handleMethods(cs, &b, vs.values[i]) { + vs.strings = nil + break + } + vs.strings[i] = b.String() + } + } + if vs.strings == nil && cs.SpewKeys { + vs.strings = make([]string, len(values)) + for i := range vs.values { + vs.strings[i] = Sprintf("%#v", vs.values[i].Interface()) + } + } + return vs +} + +// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted +// directly, or whether it should be considered for sorting by surrogate keys +// (if the ConfigState allows it). +func canSortSimply(kind reflect.Kind) bool { + // This switch parallels valueSortLess, except for the default case. + switch kind { + case reflect.Bool: + return true + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + return true + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + return true + case reflect.Float32, reflect.Float64: + return true + case reflect.String: + return true + case reflect.Uintptr: + return true + case reflect.Array: + return true + } + return false +} + +// Len returns the number of values in the slice. It is part of the +// sort.Interface implementation. +func (s *valuesSorter) Len() int { + return len(s.values) +} + +// Swap swaps the values at the passed indices. It is part of the +// sort.Interface implementation. +func (s *valuesSorter) Swap(i, j int) { + s.values[i], s.values[j] = s.values[j], s.values[i] + if s.strings != nil { + s.strings[i], s.strings[j] = s.strings[j], s.strings[i] + } +} + +// valueSortLess returns whether the first value should sort before the second +// value. It is used by valueSorter.Less as part of the sort.Interface +// implementation. +func valueSortLess(a, b reflect.Value) bool { + switch a.Kind() { + case reflect.Bool: + return !a.Bool() && b.Bool() + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + return a.Int() < b.Int() + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + return a.Uint() < b.Uint() + case reflect.Float32, reflect.Float64: + return a.Float() < b.Float() + case reflect.String: + return a.String() < b.String() + case reflect.Uintptr: + return a.Uint() < b.Uint() + case reflect.Array: + // Compare the contents of both arrays. + l := a.Len() + for i := 0; i < l; i++ { + av := a.Index(i) + bv := b.Index(i) + if av.Interface() == bv.Interface() { + continue + } + return valueSortLess(av, bv) + } + } + return a.String() < b.String() +} + +// Less returns whether the value at index i should sort before the +// value at index j. It is part of the sort.Interface implementation. +func (s *valuesSorter) Less(i, j int) bool { + if s.strings == nil { + return valueSortLess(s.values[i], s.values[j]) + } + return s.strings[i] < s.strings[j] +} + +// sortValues is a sort function that handles both native types and any type that +// can be converted to error or Stringer. Other inputs are sorted according to +// their Value.String() value to ensure display stability. +func sortValues(values []reflect.Value, cs *ConfigState) { + if len(values) == 0 { + return + } + sort.Sort(newValuesSorter(values, cs)) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/config.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/config.go new file mode 100644 index 00000000..ee1ab07b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/config.go @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2013 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "fmt" + "io" + "os" +) + +// ConfigState houses the configuration options used by spew to format and +// display values. There is a global instance, Config, that is used to control +// all top-level Formatter and Dump functionality. Each ConfigState instance +// provides methods equivalent to the top-level functions. +// +// The zero value for ConfigState provides no indentation. You would typically +// want to set it to a space or a tab. +// +// Alternatively, you can use NewDefaultConfig to get a ConfigState instance +// with default settings. See the documentation of NewDefaultConfig for default +// values. +type ConfigState struct { + // Indent specifies the string to use for each indentation level. The + // global config instance that all top-level functions use set this to a + // single space by default. If you would like more indentation, you might + // set this to a tab with "\t" or perhaps two spaces with " ". + Indent string + + // MaxDepth controls the maximum number of levels to descend into nested + // data structures. The default, 0, means there is no limit. + // + // NOTE: Circular data structures are properly detected, so it is not + // necessary to set this value unless you specifically want to limit deeply + // nested data structures. + MaxDepth int + + // DisableMethods specifies whether or not error and Stringer interfaces are + // invoked for types that implement them. + DisableMethods bool + + // DisablePointerMethods specifies whether or not to check for and invoke + // error and Stringer interfaces on types which only accept a pointer + // receiver when the current type is not a pointer. + // + // NOTE: This might be an unsafe action since calling one of these methods + // with a pointer receiver could technically mutate the value, however, + // in practice, types which choose to satisify an error or Stringer + // interface with a pointer receiver should not be mutating their state + // inside these interface methods. As a result, this option relies on + // access to the unsafe package, so it will not have any effect when + // running in environments without access to the unsafe package such as + // Google App Engine or with the "disableunsafe" build tag specified. + DisablePointerMethods bool + + // ContinueOnMethod specifies whether or not recursion should continue once + // a custom error or Stringer interface is invoked. The default, false, + // means it will print the results of invoking the custom error or Stringer + // interface and return immediately instead of continuing to recurse into + // the internals of the data type. + // + // NOTE: This flag does not have any effect if method invocation is disabled + // via the DisableMethods or DisablePointerMethods options. + ContinueOnMethod bool + + // SortKeys specifies map keys should be sorted before being printed. Use + // this to have a more deterministic, diffable output. Note that only + // native types (bool, int, uint, floats, uintptr and string) and types + // that support the error or Stringer interfaces (if methods are + // enabled) are supported, with other types sorted according to the + // reflect.Value.String() output which guarantees display stability. + SortKeys bool + + // SpewKeys specifies that, as a last resort attempt, map keys should + // be spewed to strings and sorted by those strings. This is only + // considered if SortKeys is true. + SpewKeys bool +} + +// Config is the active configuration of the top-level functions. +// The configuration can be changed by modifying the contents of spew.Config. +var Config = ConfigState{Indent: " "} + +// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the formatted string as a value that satisfies error. See NewFormatter +// for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) { + return fmt.Errorf(format, c.convertArgs(a)...) +} + +// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprint(w, c.convertArgs(a)...) +} + +// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { + return fmt.Fprintf(w, format, c.convertArgs(a)...) +} + +// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it +// passed with a Formatter interface returned by c.NewFormatter. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprintln(w, c.convertArgs(a)...) +} + +// Print is a wrapper for fmt.Print that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Print(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Print(a ...interface{}) (n int, err error) { + return fmt.Print(c.convertArgs(a)...) +} + +// Printf is a wrapper for fmt.Printf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) { + return fmt.Printf(format, c.convertArgs(a)...) +} + +// Println is a wrapper for fmt.Println that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Println(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Println(a ...interface{}) (n int, err error) { + return fmt.Println(c.convertArgs(a)...) +} + +// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Sprint(a ...interface{}) string { + return fmt.Sprint(c.convertArgs(a)...) +} + +// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were +// passed with a Formatter interface returned by c.NewFormatter. It returns +// the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Sprintf(format string, a ...interface{}) string { + return fmt.Sprintf(format, c.convertArgs(a)...) +} + +// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it +// were passed with a Formatter interface returned by c.NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b)) +func (c *ConfigState) Sprintln(a ...interface{}) string { + return fmt.Sprintln(c.convertArgs(a)...) +} + +/* +NewFormatter returns a custom formatter that satisfies the fmt.Formatter +interface. As a result, it integrates cleanly with standard fmt package +printing functions. The formatter is useful for inline printing of smaller data +types similar to the standard %v format specifier. + +The custom formatter only responds to the %v (most compact), %+v (adds pointer +addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb +combinations. Any other verbs such as %x and %q will be sent to the the +standard fmt package for formatting. In addition, the custom formatter ignores +the width and precision arguments (however they will still work on the format +specifiers not handled by the custom formatter). + +Typically this function shouldn't be called directly. It is much easier to make +use of the custom formatter by calling one of the convenience functions such as +c.Printf, c.Println, or c.Printf. +*/ +func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter { + return newFormatter(c, v) +} + +// Fdump formats and displays the passed arguments to io.Writer w. It formats +// exactly the same as Dump. +func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) { + fdump(c, w, a...) +} + +/* +Dump displays the passed parameters to standard out with newlines, customizable +indentation, and additional debug information such as complete types and all +pointer addresses used to indirect to the final value. It provides the +following features over the built-in printing facilities provided by the fmt +package: + + * Pointers are dereferenced and followed + * Circular data structures are detected and handled properly + * Custom Stringer/error interfaces are optionally invoked, including + on unexported types + * Custom types which only implement the Stringer/error interfaces via + a pointer receiver are optionally invoked when passing non-pointer + variables + * Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output + +The configuration options are controlled by modifying the public members +of c. See ConfigState for options documentation. + +See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to +get the formatted result as a string. +*/ +func (c *ConfigState) Dump(a ...interface{}) { + fdump(c, os.Stdout, a...) +} + +// Sdump returns a string with the passed arguments formatted exactly the same +// as Dump. +func (c *ConfigState) Sdump(a ...interface{}) string { + var buf bytes.Buffer + fdump(c, &buf, a...) + return buf.String() +} + +// convertArgs accepts a slice of arguments and returns a slice of the same +// length with each argument converted to a spew Formatter interface using +// the ConfigState associated with s. +func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) { + formatters = make([]interface{}, len(args)) + for index, arg := range args { + formatters[index] = newFormatter(c, arg) + } + return formatters +} + +// NewDefaultConfig returns a ConfigState with the following default settings. +// +// Indent: " " +// MaxDepth: 0 +// DisableMethods: false +// DisablePointerMethods: false +// ContinueOnMethod: false +// SortKeys: false +func NewDefaultConfig() *ConfigState { + return &ConfigState{Indent: " "} +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/doc.go new file mode 100644 index 00000000..5be0c406 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/doc.go @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2013 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* +Package spew implements a deep pretty printer for Go data structures to aid in +debugging. + +A quick overview of the additional features spew provides over the built-in +printing facilities for Go data types are as follows: + + * Pointers are dereferenced and followed + * Circular data structures are detected and handled properly + * Custom Stringer/error interfaces are optionally invoked, including + on unexported types + * Custom types which only implement the Stringer/error interfaces via + a pointer receiver are optionally invoked when passing non-pointer + variables + * Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output (only when using + Dump style) + +There are two different approaches spew allows for dumping Go data structures: + + * Dump style which prints with newlines, customizable indentation, + and additional debug information such as types and all pointer addresses + used to indirect to the final value + * A custom Formatter interface that integrates cleanly with the standard fmt + package and replaces %v, %+v, %#v, and %#+v to provide inline printing + similar to the default %v while providing the additional functionality + outlined above and passing unsupported format verbs such as %x and %q + along to fmt + +Quick Start + +This section demonstrates how to quickly get started with spew. See the +sections below for further details on formatting and configuration options. + +To dump a variable with full newlines, indentation, type, and pointer +information use Dump, Fdump, or Sdump: + spew.Dump(myVar1, myVar2, ...) + spew.Fdump(someWriter, myVar1, myVar2, ...) + str := spew.Sdump(myVar1, myVar2, ...) + +Alternatively, if you would prefer to use format strings with a compacted inline +printing style, use the convenience wrappers Printf, Fprintf, etc with +%v (most compact), %+v (adds pointer addresses), %#v (adds types), or +%#+v (adds types and pointer addresses): + spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + +Configuration Options + +Configuration of spew is handled by fields in the ConfigState type. For +convenience, all of the top-level functions use a global state available +via the spew.Config global. + +It is also possible to create a ConfigState instance that provides methods +equivalent to the top-level functions. This allows concurrent configuration +options. See the ConfigState documentation for more details. + +The following configuration options are available: + * Indent + String to use for each indentation level for Dump functions. + It is a single space by default. A popular alternative is "\t". + + * MaxDepth + Maximum number of levels to descend into nested data structures. + There is no limit by default. + + * DisableMethods + Disables invocation of error and Stringer interface methods. + Method invocation is enabled by default. + + * DisablePointerMethods + Disables invocation of error and Stringer interface methods on types + which only accept pointer receivers from non-pointer variables. + Pointer method invocation is enabled by default. + + * ContinueOnMethod + Enables recursion into types after invoking error and Stringer interface + methods. Recursion after method invocation is disabled by default. + + * SortKeys + Specifies map keys should be sorted before being printed. Use + this to have a more deterministic, diffable output. Note that + only native types (bool, int, uint, floats, uintptr and string) + and types which implement error or Stringer interfaces are + supported with other types sorted according to the + reflect.Value.String() output which guarantees display + stability. Natural map order is used by default. + + * SpewKeys + Specifies that, as a last resort attempt, map keys should be + spewed to strings and sorted by those strings. This is only + considered if SortKeys is true. + +Dump Usage + +Simply call spew.Dump with a list of variables you want to dump: + + spew.Dump(myVar1, myVar2, ...) + +You may also call spew.Fdump if you would prefer to output to an arbitrary +io.Writer. For example, to dump to standard error: + + spew.Fdump(os.Stderr, myVar1, myVar2, ...) + +A third option is to call spew.Sdump to get the formatted output as a string: + + str := spew.Sdump(myVar1, myVar2, ...) + +Sample Dump Output + +See the Dump example for details on the setup of the types and variables being +shown here. + + (main.Foo) { + unexportedField: (*main.Bar)(0xf84002e210)({ + flag: (main.Flag) flagTwo, + data: (uintptr) + }), + ExportedField: (map[interface {}]interface {}) (len=1) { + (string) (len=3) "one": (bool) true + } + } + +Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C +command as shown. + ([]uint8) (len=32 cap=32) { + 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | + 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| + 00000020 31 32 |12| + } + +Custom Formatter + +Spew provides a custom formatter that implements the fmt.Formatter interface +so that it integrates cleanly with standard fmt package printing functions. The +formatter is useful for inline printing of smaller data types similar to the +standard %v format specifier. + +The custom formatter only responds to the %v (most compact), %+v (adds pointer +addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb +combinations. Any other verbs such as %x and %q will be sent to the the +standard fmt package for formatting. In addition, the custom formatter ignores +the width and precision arguments (however they will still work on the format +specifiers not handled by the custom formatter). + +Custom Formatter Usage + +The simplest way to make use of the spew custom formatter is to call one of the +convenience functions such as spew.Printf, spew.Println, or spew.Printf. The +functions have syntax you are most likely already familiar with: + + spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + spew.Println(myVar, myVar2) + spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) + spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) + +See the Index for the full list convenience functions. + +Sample Formatter Output + +Double pointer to a uint8: + %v: <**>5 + %+v: <**>(0xf8400420d0->0xf8400420c8)5 + %#v: (**uint8)5 + %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 + +Pointer to circular struct with a uint8 field and a pointer to itself: + %v: <*>{1 <*>} + %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)} + %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)} + %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)} + +See the Printf example for details on the setup of variables being shown +here. + +Errors + +Since it is possible for custom Stringer/error interfaces to panic, spew +detects them and handles them internally by printing the panic information +inline with the output. Since spew is intended to provide deep pretty printing +capabilities on structures, it intentionally does not return any errors. +*/ +package spew diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/dump.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/dump.go new file mode 100644 index 00000000..36a2b6cc --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/dump.go @@ -0,0 +1,511 @@ +/* + * Copyright (c) 2013 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "encoding/hex" + "fmt" + "io" + "os" + "reflect" + "regexp" + "strconv" + "strings" +) + +var ( + // uint8Type is a reflect.Type representing a uint8. It is used to + // convert cgo types to uint8 slices for hexdumping. + uint8Type = reflect.TypeOf(uint8(0)) + + // cCharRE is a regular expression that matches a cgo char. + // It is used to detect character arrays to hexdump them. + cCharRE = regexp.MustCompile("^.*\\._Ctype_char$") + + // cUnsignedCharRE is a regular expression that matches a cgo unsigned + // char. It is used to detect unsigned character arrays to hexdump + // them. + cUnsignedCharRE = regexp.MustCompile("^.*\\._Ctype_unsignedchar$") + + // cUint8tCharRE is a regular expression that matches a cgo uint8_t. + // It is used to detect uint8_t arrays to hexdump them. + cUint8tCharRE = regexp.MustCompile("^.*\\._Ctype_uint8_t$") +) + +// dumpState contains information about the state of a dump operation. +type dumpState struct { + w io.Writer + depth int + pointers map[uintptr]int + ignoreNextType bool + ignoreNextIndent bool + cs *ConfigState +} + +// indent performs indentation according to the depth level and cs.Indent +// option. +func (d *dumpState) indent() { + if d.ignoreNextIndent { + d.ignoreNextIndent = false + return + } + d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth)) +} + +// unpackValue returns values inside of non-nil interfaces when possible. +// This is useful for data types like structs, arrays, slices, and maps which +// can contain varying types packed inside an interface. +func (d *dumpState) unpackValue(v reflect.Value) reflect.Value { + if v.Kind() == reflect.Interface && !v.IsNil() { + v = v.Elem() + } + return v +} + +// dumpPtr handles formatting of pointers by indirecting them as necessary. +func (d *dumpState) dumpPtr(v reflect.Value) { + // Remove pointers at or below the current depth from map used to detect + // circular refs. + for k, depth := range d.pointers { + if depth >= d.depth { + delete(d.pointers, k) + } + } + + // Keep list of all dereferenced pointers to show later. + pointerChain := make([]uintptr, 0) + + // Figure out how many levels of indirection there are by dereferencing + // pointers and unpacking interfaces down the chain while detecting circular + // references. + nilFound := false + cycleFound := false + indirects := 0 + ve := v + for ve.Kind() == reflect.Ptr { + if ve.IsNil() { + nilFound = true + break + } + indirects++ + addr := ve.Pointer() + pointerChain = append(pointerChain, addr) + if pd, ok := d.pointers[addr]; ok && pd < d.depth { + cycleFound = true + indirects-- + break + } + d.pointers[addr] = d.depth + + ve = ve.Elem() + if ve.Kind() == reflect.Interface { + if ve.IsNil() { + nilFound = true + break + } + ve = ve.Elem() + } + } + + // Display type information. + d.w.Write(openParenBytes) + d.w.Write(bytes.Repeat(asteriskBytes, indirects)) + d.w.Write([]byte(ve.Type().String())) + d.w.Write(closeParenBytes) + + // Display pointer information. + if len(pointerChain) > 0 { + d.w.Write(openParenBytes) + for i, addr := range pointerChain { + if i > 0 { + d.w.Write(pointerChainBytes) + } + printHexPtr(d.w, addr) + } + d.w.Write(closeParenBytes) + } + + // Display dereferenced value. + d.w.Write(openParenBytes) + switch { + case nilFound == true: + d.w.Write(nilAngleBytes) + + case cycleFound == true: + d.w.Write(circularBytes) + + default: + d.ignoreNextType = true + d.dump(ve) + } + d.w.Write(closeParenBytes) +} + +// dumpSlice handles formatting of arrays and slices. Byte (uint8 under +// reflection) arrays and slices are dumped in hexdump -C fashion. +func (d *dumpState) dumpSlice(v reflect.Value) { + // Determine whether this type should be hex dumped or not. Also, + // for types which should be hexdumped, try to use the underlying data + // first, then fall back to trying to convert them to a uint8 slice. + var buf []uint8 + doConvert := false + doHexDump := false + numEntries := v.Len() + if numEntries > 0 { + vt := v.Index(0).Type() + vts := vt.String() + switch { + // C types that need to be converted. + case cCharRE.MatchString(vts): + fallthrough + case cUnsignedCharRE.MatchString(vts): + fallthrough + case cUint8tCharRE.MatchString(vts): + doConvert = true + + // Try to use existing uint8 slices and fall back to converting + // and copying if that fails. + case vt.Kind() == reflect.Uint8: + // TODO(davec): Fix up the disableUnsafe bits... + + // We need an addressable interface to convert the type + // to a byte slice. However, the reflect package won't + // give us an interface on certain things like + // unexported struct fields in order to enforce + // visibility rules. We use unsafe, when available, to + // bypass these restrictions since this package does not + // mutate the values. + vs := v + if !vs.CanInterface() || !vs.CanAddr() { + vs = unsafeReflectValue(vs) + } + if !UnsafeDisabled { + vs = vs.Slice(0, numEntries) + + // Use the existing uint8 slice if it can be + // type asserted. + iface := vs.Interface() + if slice, ok := iface.([]uint8); ok { + buf = slice + doHexDump = true + break + } + } + + // The underlying data needs to be converted if it can't + // be type asserted to a uint8 slice. + doConvert = true + } + + // Copy and convert the underlying type if needed. + if doConvert && vt.ConvertibleTo(uint8Type) { + // Convert and copy each element into a uint8 byte + // slice. + buf = make([]uint8, numEntries) + for i := 0; i < numEntries; i++ { + vv := v.Index(i) + buf[i] = uint8(vv.Convert(uint8Type).Uint()) + } + doHexDump = true + } + } + + // Hexdump the entire slice as needed. + if doHexDump { + indent := strings.Repeat(d.cs.Indent, d.depth) + str := indent + hex.Dump(buf) + str = strings.Replace(str, "\n", "\n"+indent, -1) + str = strings.TrimRight(str, d.cs.Indent) + d.w.Write([]byte(str)) + return + } + + // Recursively call dump for each item. + for i := 0; i < numEntries; i++ { + d.dump(d.unpackValue(v.Index(i))) + if i < (numEntries - 1) { + d.w.Write(commaNewlineBytes) + } else { + d.w.Write(newlineBytes) + } + } +} + +// dump is the main workhorse for dumping a value. It uses the passed reflect +// value to figure out what kind of object we are dealing with and formats it +// appropriately. It is a recursive function, however circular data structures +// are detected and handled properly. +func (d *dumpState) dump(v reflect.Value) { + // Handle invalid reflect values immediately. + kind := v.Kind() + if kind == reflect.Invalid { + d.w.Write(invalidAngleBytes) + return + } + + // Handle pointers specially. + if kind == reflect.Ptr { + d.indent() + d.dumpPtr(v) + return + } + + // Print type information unless already handled elsewhere. + if !d.ignoreNextType { + d.indent() + d.w.Write(openParenBytes) + d.w.Write([]byte(v.Type().String())) + d.w.Write(closeParenBytes) + d.w.Write(spaceBytes) + } + d.ignoreNextType = false + + // Display length and capacity if the built-in len and cap functions + // work with the value's kind and the len/cap itself is non-zero. + valueLen, valueCap := 0, 0 + switch v.Kind() { + case reflect.Array, reflect.Slice, reflect.Chan: + valueLen, valueCap = v.Len(), v.Cap() + case reflect.Map, reflect.String: + valueLen = v.Len() + } + if valueLen != 0 || valueCap != 0 { + d.w.Write(openParenBytes) + if valueLen != 0 { + d.w.Write(lenEqualsBytes) + printInt(d.w, int64(valueLen), 10) + } + if valueCap != 0 { + if valueLen != 0 { + d.w.Write(spaceBytes) + } + d.w.Write(capEqualsBytes) + printInt(d.w, int64(valueCap), 10) + } + d.w.Write(closeParenBytes) + d.w.Write(spaceBytes) + } + + // Call Stringer/error interfaces if they exist and the handle methods flag + // is enabled + if !d.cs.DisableMethods { + if (kind != reflect.Invalid) && (kind != reflect.Interface) { + if handled := handleMethods(d.cs, d.w, v); handled { + return + } + } + } + + switch kind { + case reflect.Invalid: + // Do nothing. We should never get here since invalid has already + // been handled above. + + case reflect.Bool: + printBool(d.w, v.Bool()) + + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + printInt(d.w, v.Int(), 10) + + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + printUint(d.w, v.Uint(), 10) + + case reflect.Float32: + printFloat(d.w, v.Float(), 32) + + case reflect.Float64: + printFloat(d.w, v.Float(), 64) + + case reflect.Complex64: + printComplex(d.w, v.Complex(), 32) + + case reflect.Complex128: + printComplex(d.w, v.Complex(), 64) + + case reflect.Slice: + if v.IsNil() { + d.w.Write(nilAngleBytes) + break + } + fallthrough + + case reflect.Array: + d.w.Write(openBraceNewlineBytes) + d.depth++ + if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { + d.indent() + d.w.Write(maxNewlineBytes) + } else { + d.dumpSlice(v) + } + d.depth-- + d.indent() + d.w.Write(closeBraceBytes) + + case reflect.String: + d.w.Write([]byte(strconv.Quote(v.String()))) + + case reflect.Interface: + // The only time we should get here is for nil interfaces due to + // unpackValue calls. + if v.IsNil() { + d.w.Write(nilAngleBytes) + } + + case reflect.Ptr: + // Do nothing. We should never get here since pointers have already + // been handled above. + + case reflect.Map: + // nil maps should be indicated as different than empty maps + if v.IsNil() { + d.w.Write(nilAngleBytes) + break + } + + d.w.Write(openBraceNewlineBytes) + d.depth++ + if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { + d.indent() + d.w.Write(maxNewlineBytes) + } else { + numEntries := v.Len() + keys := v.MapKeys() + if d.cs.SortKeys { + sortValues(keys, d.cs) + } + for i, key := range keys { + d.dump(d.unpackValue(key)) + d.w.Write(colonSpaceBytes) + d.ignoreNextIndent = true + d.dump(d.unpackValue(v.MapIndex(key))) + if i < (numEntries - 1) { + d.w.Write(commaNewlineBytes) + } else { + d.w.Write(newlineBytes) + } + } + } + d.depth-- + d.indent() + d.w.Write(closeBraceBytes) + + case reflect.Struct: + d.w.Write(openBraceNewlineBytes) + d.depth++ + if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { + d.indent() + d.w.Write(maxNewlineBytes) + } else { + vt := v.Type() + numFields := v.NumField() + for i := 0; i < numFields; i++ { + d.indent() + vtf := vt.Field(i) + d.w.Write([]byte(vtf.Name)) + d.w.Write(colonSpaceBytes) + d.ignoreNextIndent = true + d.dump(d.unpackValue(v.Field(i))) + if i < (numFields - 1) { + d.w.Write(commaNewlineBytes) + } else { + d.w.Write(newlineBytes) + } + } + } + d.depth-- + d.indent() + d.w.Write(closeBraceBytes) + + case reflect.Uintptr: + printHexPtr(d.w, uintptr(v.Uint())) + + case reflect.UnsafePointer, reflect.Chan, reflect.Func: + printHexPtr(d.w, v.Pointer()) + + // There were not any other types at the time this code was written, but + // fall back to letting the default fmt package handle it in case any new + // types are added. + default: + if v.CanInterface() { + fmt.Fprintf(d.w, "%v", v.Interface()) + } else { + fmt.Fprintf(d.w, "%v", v.String()) + } + } +} + +// fdump is a helper function to consolidate the logic from the various public +// methods which take varying writers and config states. +func fdump(cs *ConfigState, w io.Writer, a ...interface{}) { + for _, arg := range a { + if arg == nil { + w.Write(interfaceBytes) + w.Write(spaceBytes) + w.Write(nilAngleBytes) + w.Write(newlineBytes) + continue + } + + d := dumpState{w: w, cs: cs} + d.pointers = make(map[uintptr]int) + d.dump(reflect.ValueOf(arg)) + d.w.Write(newlineBytes) + } +} + +// Fdump formats and displays the passed arguments to io.Writer w. It formats +// exactly the same as Dump. +func Fdump(w io.Writer, a ...interface{}) { + fdump(&Config, w, a...) +} + +// Sdump returns a string with the passed arguments formatted exactly the same +// as Dump. +func Sdump(a ...interface{}) string { + var buf bytes.Buffer + fdump(&Config, &buf, a...) + return buf.String() +} + +/* +Dump displays the passed parameters to standard out with newlines, customizable +indentation, and additional debug information such as complete types and all +pointer addresses used to indirect to the final value. It provides the +following features over the built-in printing facilities provided by the fmt +package: + + * Pointers are dereferenced and followed + * Circular data structures are detected and handled properly + * Custom Stringer/error interfaces are optionally invoked, including + on unexported types + * Custom types which only implement the Stringer/error interfaces via + a pointer receiver are optionally invoked when passing non-pointer + variables + * Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output + +The configuration options are controlled by an exported package global, +spew.Config. See ConfigState for options documentation. + +See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to +get the formatted result as a string. +*/ +func Dump(a ...interface{}) { + fdump(&Config, os.Stdout, a...) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/format.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/format.go new file mode 100644 index 00000000..ecf3b80e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/format.go @@ -0,0 +1,419 @@ +/* + * Copyright (c) 2013 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "bytes" + "fmt" + "reflect" + "strconv" + "strings" +) + +// supportedFlags is a list of all the character flags supported by fmt package. +const supportedFlags = "0-+# " + +// formatState implements the fmt.Formatter interface and contains information +// about the state of a formatting operation. The NewFormatter function can +// be used to get a new Formatter which can be used directly as arguments +// in standard fmt package printing calls. +type formatState struct { + value interface{} + fs fmt.State + depth int + pointers map[uintptr]int + ignoreNextType bool + cs *ConfigState +} + +// buildDefaultFormat recreates the original format string without precision +// and width information to pass in to fmt.Sprintf in the case of an +// unrecognized type. Unless new types are added to the language, this +// function won't ever be called. +func (f *formatState) buildDefaultFormat() (format string) { + buf := bytes.NewBuffer(percentBytes) + + for _, flag := range supportedFlags { + if f.fs.Flag(int(flag)) { + buf.WriteRune(flag) + } + } + + buf.WriteRune('v') + + format = buf.String() + return format +} + +// constructOrigFormat recreates the original format string including precision +// and width information to pass along to the standard fmt package. This allows +// automatic deferral of all format strings this package doesn't support. +func (f *formatState) constructOrigFormat(verb rune) (format string) { + buf := bytes.NewBuffer(percentBytes) + + for _, flag := range supportedFlags { + if f.fs.Flag(int(flag)) { + buf.WriteRune(flag) + } + } + + if width, ok := f.fs.Width(); ok { + buf.WriteString(strconv.Itoa(width)) + } + + if precision, ok := f.fs.Precision(); ok { + buf.Write(precisionBytes) + buf.WriteString(strconv.Itoa(precision)) + } + + buf.WriteRune(verb) + + format = buf.String() + return format +} + +// unpackValue returns values inside of non-nil interfaces when possible and +// ensures that types for values which have been unpacked from an interface +// are displayed when the show types flag is also set. +// This is useful for data types like structs, arrays, slices, and maps which +// can contain varying types packed inside an interface. +func (f *formatState) unpackValue(v reflect.Value) reflect.Value { + if v.Kind() == reflect.Interface { + f.ignoreNextType = false + if !v.IsNil() { + v = v.Elem() + } + } + return v +} + +// formatPtr handles formatting of pointers by indirecting them as necessary. +func (f *formatState) formatPtr(v reflect.Value) { + // Display nil if top level pointer is nil. + showTypes := f.fs.Flag('#') + if v.IsNil() && (!showTypes || f.ignoreNextType) { + f.fs.Write(nilAngleBytes) + return + } + + // Remove pointers at or below the current depth from map used to detect + // circular refs. + for k, depth := range f.pointers { + if depth >= f.depth { + delete(f.pointers, k) + } + } + + // Keep list of all dereferenced pointers to possibly show later. + pointerChain := make([]uintptr, 0) + + // Figure out how many levels of indirection there are by derferencing + // pointers and unpacking interfaces down the chain while detecting circular + // references. + nilFound := false + cycleFound := false + indirects := 0 + ve := v + for ve.Kind() == reflect.Ptr { + if ve.IsNil() { + nilFound = true + break + } + indirects++ + addr := ve.Pointer() + pointerChain = append(pointerChain, addr) + if pd, ok := f.pointers[addr]; ok && pd < f.depth { + cycleFound = true + indirects-- + break + } + f.pointers[addr] = f.depth + + ve = ve.Elem() + if ve.Kind() == reflect.Interface { + if ve.IsNil() { + nilFound = true + break + } + ve = ve.Elem() + } + } + + // Display type or indirection level depending on flags. + if showTypes && !f.ignoreNextType { + f.fs.Write(openParenBytes) + f.fs.Write(bytes.Repeat(asteriskBytes, indirects)) + f.fs.Write([]byte(ve.Type().String())) + f.fs.Write(closeParenBytes) + } else { + if nilFound || cycleFound { + indirects += strings.Count(ve.Type().String(), "*") + } + f.fs.Write(openAngleBytes) + f.fs.Write([]byte(strings.Repeat("*", indirects))) + f.fs.Write(closeAngleBytes) + } + + // Display pointer information depending on flags. + if f.fs.Flag('+') && (len(pointerChain) > 0) { + f.fs.Write(openParenBytes) + for i, addr := range pointerChain { + if i > 0 { + f.fs.Write(pointerChainBytes) + } + printHexPtr(f.fs, addr) + } + f.fs.Write(closeParenBytes) + } + + // Display dereferenced value. + switch { + case nilFound == true: + f.fs.Write(nilAngleBytes) + + case cycleFound == true: + f.fs.Write(circularShortBytes) + + default: + f.ignoreNextType = true + f.format(ve) + } +} + +// format is the main workhorse for providing the Formatter interface. It +// uses the passed reflect value to figure out what kind of object we are +// dealing with and formats it appropriately. It is a recursive function, +// however circular data structures are detected and handled properly. +func (f *formatState) format(v reflect.Value) { + // Handle invalid reflect values immediately. + kind := v.Kind() + if kind == reflect.Invalid { + f.fs.Write(invalidAngleBytes) + return + } + + // Handle pointers specially. + if kind == reflect.Ptr { + f.formatPtr(v) + return + } + + // Print type information unless already handled elsewhere. + if !f.ignoreNextType && f.fs.Flag('#') { + f.fs.Write(openParenBytes) + f.fs.Write([]byte(v.Type().String())) + f.fs.Write(closeParenBytes) + } + f.ignoreNextType = false + + // Call Stringer/error interfaces if they exist and the handle methods + // flag is enabled. + if !f.cs.DisableMethods { + if (kind != reflect.Invalid) && (kind != reflect.Interface) { + if handled := handleMethods(f.cs, f.fs, v); handled { + return + } + } + } + + switch kind { + case reflect.Invalid: + // Do nothing. We should never get here since invalid has already + // been handled above. + + case reflect.Bool: + printBool(f.fs, v.Bool()) + + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + printInt(f.fs, v.Int(), 10) + + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + printUint(f.fs, v.Uint(), 10) + + case reflect.Float32: + printFloat(f.fs, v.Float(), 32) + + case reflect.Float64: + printFloat(f.fs, v.Float(), 64) + + case reflect.Complex64: + printComplex(f.fs, v.Complex(), 32) + + case reflect.Complex128: + printComplex(f.fs, v.Complex(), 64) + + case reflect.Slice: + if v.IsNil() { + f.fs.Write(nilAngleBytes) + break + } + fallthrough + + case reflect.Array: + f.fs.Write(openBracketBytes) + f.depth++ + if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { + f.fs.Write(maxShortBytes) + } else { + numEntries := v.Len() + for i := 0; i < numEntries; i++ { + if i > 0 { + f.fs.Write(spaceBytes) + } + f.ignoreNextType = true + f.format(f.unpackValue(v.Index(i))) + } + } + f.depth-- + f.fs.Write(closeBracketBytes) + + case reflect.String: + f.fs.Write([]byte(v.String())) + + case reflect.Interface: + // The only time we should get here is for nil interfaces due to + // unpackValue calls. + if v.IsNil() { + f.fs.Write(nilAngleBytes) + } + + case reflect.Ptr: + // Do nothing. We should never get here since pointers have already + // been handled above. + + case reflect.Map: + // nil maps should be indicated as different than empty maps + if v.IsNil() { + f.fs.Write(nilAngleBytes) + break + } + + f.fs.Write(openMapBytes) + f.depth++ + if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { + f.fs.Write(maxShortBytes) + } else { + keys := v.MapKeys() + if f.cs.SortKeys { + sortValues(keys, f.cs) + } + for i, key := range keys { + if i > 0 { + f.fs.Write(spaceBytes) + } + f.ignoreNextType = true + f.format(f.unpackValue(key)) + f.fs.Write(colonBytes) + f.ignoreNextType = true + f.format(f.unpackValue(v.MapIndex(key))) + } + } + f.depth-- + f.fs.Write(closeMapBytes) + + case reflect.Struct: + numFields := v.NumField() + f.fs.Write(openBraceBytes) + f.depth++ + if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { + f.fs.Write(maxShortBytes) + } else { + vt := v.Type() + for i := 0; i < numFields; i++ { + if i > 0 { + f.fs.Write(spaceBytes) + } + vtf := vt.Field(i) + if f.fs.Flag('+') || f.fs.Flag('#') { + f.fs.Write([]byte(vtf.Name)) + f.fs.Write(colonBytes) + } + f.format(f.unpackValue(v.Field(i))) + } + } + f.depth-- + f.fs.Write(closeBraceBytes) + + case reflect.Uintptr: + printHexPtr(f.fs, uintptr(v.Uint())) + + case reflect.UnsafePointer, reflect.Chan, reflect.Func: + printHexPtr(f.fs, v.Pointer()) + + // There were not any other types at the time this code was written, but + // fall back to letting the default fmt package handle it if any get added. + default: + format := f.buildDefaultFormat() + if v.CanInterface() { + fmt.Fprintf(f.fs, format, v.Interface()) + } else { + fmt.Fprintf(f.fs, format, v.String()) + } + } +} + +// Format satisfies the fmt.Formatter interface. See NewFormatter for usage +// details. +func (f *formatState) Format(fs fmt.State, verb rune) { + f.fs = fs + + // Use standard formatting for verbs that are not v. + if verb != 'v' { + format := f.constructOrigFormat(verb) + fmt.Fprintf(fs, format, f.value) + return + } + + if f.value == nil { + if fs.Flag('#') { + fs.Write(interfaceBytes) + } + fs.Write(nilAngleBytes) + return + } + + f.format(reflect.ValueOf(f.value)) +} + +// newFormatter is a helper function to consolidate the logic from the various +// public methods which take varying config states. +func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter { + fs := &formatState{value: v, cs: cs} + fs.pointers = make(map[uintptr]int) + return fs +} + +/* +NewFormatter returns a custom formatter that satisfies the fmt.Formatter +interface. As a result, it integrates cleanly with standard fmt package +printing functions. The formatter is useful for inline printing of smaller data +types similar to the standard %v format specifier. + +The custom formatter only responds to the %v (most compact), %+v (adds pointer +addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb +combinations. Any other verbs such as %x and %q will be sent to the the +standard fmt package for formatting. In addition, the custom formatter ignores +the width and precision arguments (however they will still work on the format +specifiers not handled by the custom formatter). + +Typically this function shouldn't be called directly. It is much easier to make +use of the custom formatter by calling one of the convenience functions such as +Printf, Println, or Fprintf. +*/ +func NewFormatter(v interface{}) fmt.Formatter { + return newFormatter(&Config, v) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/spew.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/spew.go new file mode 100644 index 00000000..d8233f54 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/spew.go @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2013 Dave Collins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package spew + +import ( + "fmt" + "io" +) + +// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the formatted string as a value that satisfies error. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Errorf(format string, a ...interface{}) (err error) { + return fmt.Errorf(format, convertArgs(a)...) +} + +// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b)) +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprint(w, convertArgs(a)...) +} + +// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { + return fmt.Fprintf(w, format, convertArgs(a)...) +} + +// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it +// passed with a default Formatter interface returned by NewFormatter. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b)) +func Fprintln(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprintln(w, convertArgs(a)...) +} + +// Print is a wrapper for fmt.Print that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b)) +func Print(a ...interface{}) (n int, err error) { + return fmt.Print(convertArgs(a)...) +} + +// Printf is a wrapper for fmt.Printf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Printf(format string, a ...interface{}) (n int, err error) { + return fmt.Printf(format, convertArgs(a)...) +} + +// Println is a wrapper for fmt.Println that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the number of bytes written and any write error encountered. See +// NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b)) +func Println(a ...interface{}) (n int, err error) { + return fmt.Println(convertArgs(a)...) +} + +// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b)) +func Sprint(a ...interface{}) string { + return fmt.Sprint(convertArgs(a)...) +} + +// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were +// passed with a default Formatter interface returned by NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b)) +func Sprintf(format string, a ...interface{}) string { + return fmt.Sprintf(format, convertArgs(a)...) +} + +// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it +// were passed with a default Formatter interface returned by NewFormatter. It +// returns the resulting string. See NewFormatter for formatting details. +// +// This function is shorthand for the following syntax: +// +// fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b)) +func Sprintln(a ...interface{}) string { + return fmt.Sprintln(convertArgs(a)...) +} + +// convertArgs accepts a slice of arguments and returns a slice of the same +// length with each argument converted to a default spew Formatter interface. +func convertArgs(args []interface{}) (formatters []interface{}) { + formatters = make([]interface{}, len(args)) + for index, arg := range args { + formatters[index] = NewFormatter(arg) + } + return formatters +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/LICENSE new file mode 100644 index 00000000..c67dad61 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013, Patrick Mezard +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + The names of its contributors may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib.go new file mode 100644 index 00000000..64cc40fe --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib.go @@ -0,0 +1,758 @@ +// Package difflib is a partial port of Python difflib module. +// +// It provides tools to compare sequences of strings and generate textual diffs. +// +// The following class and functions have been ported: +// +// - SequenceMatcher +// +// - unified_diff +// +// - context_diff +// +// Getting unified diffs was the main goal of the port. Keep in mind this code +// is mostly suitable to output text differences in a human friendly way, there +// are no guarantees generated diffs are consumable by patch(1). +package difflib + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strings" +) + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func calculateRatio(matches, length int) float64 { + if length > 0 { + return 2.0 * float64(matches) / float64(length) + } + return 1.0 +} + +type Match struct { + A int + B int + Size int +} + +type OpCode struct { + Tag byte + I1 int + I2 int + J1 int + J2 int +} + +// SequenceMatcher compares sequence of strings. The basic +// algorithm predates, and is a little fancier than, an algorithm +// published in the late 1980's by Ratcliff and Obershelp under the +// hyperbolic name "gestalt pattern matching". The basic idea is to find +// the longest contiguous matching subsequence that contains no "junk" +// elements (R-O doesn't address junk). The same idea is then applied +// recursively to the pieces of the sequences to the left and to the right +// of the matching subsequence. This does not yield minimal edit +// sequences, but does tend to yield matches that "look right" to people. +// +// SequenceMatcher tries to compute a "human-friendly diff" between two +// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the +// longest *contiguous* & junk-free matching subsequence. That's what +// catches peoples' eyes. The Windows(tm) windiff has another interesting +// notion, pairing up elements that appear uniquely in each sequence. +// That, and the method here, appear to yield more intuitive difference +// reports than does diff. This method appears to be the least vulnerable +// to synching up on blocks of "junk lines", though (like blank lines in +// ordinary text files, or maybe "

" lines in HTML files). That may be +// because this is the only method of the 3 that has a *concept* of +// "junk" . +// +// Timing: Basic R-O is cubic time worst case and quadratic time expected +// case. SequenceMatcher is quadratic time for the worst case and has +// expected-case behavior dependent in a complicated way on how many +// elements the sequences have in common; best case time is linear. +type SequenceMatcher struct { + a []string + b []string + b2j map[string][]int + IsJunk func(string) bool + autoJunk bool + bJunk map[string]struct{} + matchingBlocks []Match + fullBCount map[string]int + bPopular map[string]struct{} + opCodes []OpCode +} + +func NewMatcher(a, b []string) *SequenceMatcher { + m := SequenceMatcher{autoJunk: true} + m.SetSeqs(a, b) + return &m +} + +func NewMatcherWithJunk(a, b []string, autoJunk bool, + isJunk func(string) bool) *SequenceMatcher { + + m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk} + m.SetSeqs(a, b) + return &m +} + +// Set two sequences to be compared. +func (m *SequenceMatcher) SetSeqs(a, b []string) { + m.SetSeq1(a) + m.SetSeq2(b) +} + +// Set the first sequence to be compared. The second sequence to be compared is +// not changed. +// +// SequenceMatcher computes and caches detailed information about the second +// sequence, so if you want to compare one sequence S against many sequences, +// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other +// sequences. +// +// See also SetSeqs() and SetSeq2(). +func (m *SequenceMatcher) SetSeq1(a []string) { + if &a == &m.a { + return + } + m.a = a + m.matchingBlocks = nil + m.opCodes = nil +} + +// Set the second sequence to be compared. The first sequence to be compared is +// not changed. +func (m *SequenceMatcher) SetSeq2(b []string) { + if &b == &m.b { + return + } + m.b = b + m.matchingBlocks = nil + m.opCodes = nil + m.fullBCount = nil + m.chainB() +} + +func (m *SequenceMatcher) chainB() { + // Populate line -> index mapping + b2j := map[string][]int{} + for i, s := range m.b { + indices := b2j[s] + indices = append(indices, i) + b2j[s] = indices + } + + // Purge junk elements + m.bJunk = map[string]struct{}{} + if m.IsJunk != nil { + junk := m.bJunk + for s, _ := range b2j { + if m.IsJunk(s) { + junk[s] = struct{}{} + } + } + for s, _ := range junk { + delete(b2j, s) + } + } + + // Purge remaining popular elements + popular := map[string]struct{}{} + n := len(m.b) + if m.autoJunk && n >= 200 { + ntest := n/100 + 1 + for s, indices := range b2j { + if len(indices) > ntest { + popular[s] = struct{}{} + } + } + for s, _ := range popular { + delete(b2j, s) + } + } + m.bPopular = popular + m.b2j = b2j +} + +func (m *SequenceMatcher) isBJunk(s string) bool { + _, ok := m.bJunk[s] + return ok +} + +// Find longest matching block in a[alo:ahi] and b[blo:bhi]. +// +// If IsJunk is not defined: +// +// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where +// alo <= i <= i+k <= ahi +// blo <= j <= j+k <= bhi +// and for all (i',j',k') meeting those conditions, +// k >= k' +// i <= i' +// and if i == i', j <= j' +// +// In other words, of all maximal matching blocks, return one that +// starts earliest in a, and of all those maximal matching blocks that +// start earliest in a, return the one that starts earliest in b. +// +// If IsJunk is defined, first the longest matching block is +// determined as above, but with the additional restriction that no +// junk element appears in the block. Then that block is extended as +// far as possible by matching (only) junk elements on both sides. So +// the resulting block never matches on junk except as identical junk +// happens to be adjacent to an "interesting" match. +// +// If no blocks match, return (alo, blo, 0). +func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match { + // CAUTION: stripping common prefix or suffix would be incorrect. + // E.g., + // ab + // acab + // Longest matching block is "ab", but if common prefix is + // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so + // strip, so ends up claiming that ab is changed to acab by + // inserting "ca" in the middle. That's minimal but unintuitive: + // "it's obvious" that someone inserted "ac" at the front. + // Windiff ends up at the same place as diff, but by pairing up + // the unique 'b's and then matching the first two 'a's. + besti, bestj, bestsize := alo, blo, 0 + + // find longest junk-free match + // during an iteration of the loop, j2len[j] = length of longest + // junk-free match ending with a[i-1] and b[j] + j2len := map[int]int{} + for i := alo; i != ahi; i++ { + // look at all instances of a[i] in b; note that because + // b2j has no junk keys, the loop is skipped if a[i] is junk + newj2len := map[int]int{} + for _, j := range m.b2j[m.a[i]] { + // a[i] matches b[j] + if j < blo { + continue + } + if j >= bhi { + break + } + k := j2len[j-1] + 1 + newj2len[j] = k + if k > bestsize { + besti, bestj, bestsize = i-k+1, j-k+1, k + } + } + j2len = newj2len + } + + // Extend the best by non-junk elements on each end. In particular, + // "popular" non-junk elements aren't in b2j, which greatly speeds + // the inner loop above, but also means "the best" match so far + // doesn't contain any junk *or* popular non-junk elements. + for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + !m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + // Now that we have a wholly interesting match (albeit possibly + // empty!), we may as well suck up the matching junk on each + // side of it too. Can't think of a good reason not to, and it + // saves post-processing the (possibly considerable) expense of + // figuring out what to do with it. In the case of an empty + // interesting match, this is clearly the right thing to do, + // because no other kind of match is possible in the regions. + for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + return Match{A: besti, B: bestj, Size: bestsize} +} + +// Return list of triples describing matching subsequences. +// +// Each triple is of the form (i, j, n), and means that +// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in +// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are +// adjacent triples in the list, and the second is not the last triple in the +// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe +// adjacent equal blocks. +// +// The last triple is a dummy, (len(a), len(b), 0), and is the only +// triple with n==0. +func (m *SequenceMatcher) GetMatchingBlocks() []Match { + if m.matchingBlocks != nil { + return m.matchingBlocks + } + + var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match + matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match { + match := m.findLongestMatch(alo, ahi, blo, bhi) + i, j, k := match.A, match.B, match.Size + if match.Size > 0 { + if alo < i && blo < j { + matched = matchBlocks(alo, i, blo, j, matched) + } + matched = append(matched, match) + if i+k < ahi && j+k < bhi { + matched = matchBlocks(i+k, ahi, j+k, bhi, matched) + } + } + return matched + } + matched := matchBlocks(0, len(m.a), 0, len(m.b), nil) + + // It's possible that we have adjacent equal blocks in the + // matching_blocks list now. + nonAdjacent := []Match{} + i1, j1, k1 := 0, 0, 0 + for _, b := range matched { + // Is this block adjacent to i1, j1, k1? + i2, j2, k2 := b.A, b.B, b.Size + if i1+k1 == i2 && j1+k1 == j2 { + // Yes, so collapse them -- this just increases the length of + // the first block by the length of the second, and the first + // block so lengthened remains the block to compare against. + k1 += k2 + } else { + // Not adjacent. Remember the first block (k1==0 means it's + // the dummy we started with), and make the second block the + // new block to compare against. + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + i1, j1, k1 = i2, j2, k2 + } + } + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + + nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0}) + m.matchingBlocks = nonAdjacent + return m.matchingBlocks +} + +// Return list of 5-tuples describing how to turn a into b. +// +// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple +// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the +// tuple preceding it, and likewise for j1 == the previous j2. +// +// The tags are characters, with these meanings: +// +// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2] +// +// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case. +// +// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case. +// +// 'e' (equal): a[i1:i2] == b[j1:j2] +func (m *SequenceMatcher) GetOpCodes() []OpCode { + if m.opCodes != nil { + return m.opCodes + } + i, j := 0, 0 + matching := m.GetMatchingBlocks() + opCodes := make([]OpCode, 0, len(matching)) + for _, m := range matching { + // invariant: we've pumped out correct diffs to change + // a[:i] into b[:j], and the next matching block is + // a[ai:ai+size] == b[bj:bj+size]. So we need to pump + // out a diff to change a[i:ai] into b[j:bj], pump out + // the matching block, and move (i,j) beyond the match + ai, bj, size := m.A, m.B, m.Size + tag := byte(0) + if i < ai && j < bj { + tag = 'r' + } else if i < ai { + tag = 'd' + } else if j < bj { + tag = 'i' + } + if tag > 0 { + opCodes = append(opCodes, OpCode{tag, i, ai, j, bj}) + } + i, j = ai+size, bj+size + // the list of matching blocks is terminated by a + // sentinel with size 0 + if size > 0 { + opCodes = append(opCodes, OpCode{'e', ai, i, bj, j}) + } + } + m.opCodes = opCodes + return m.opCodes +} + +// Isolate change clusters by eliminating ranges with no changes. +// +// Return a generator of groups with up to n lines of context. +// Each group is in the same format as returned by GetOpCodes(). +func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { + if n < 0 { + n = 3 + } + codes := m.GetOpCodes() + if len(codes) == 0 { + codes = []OpCode{OpCode{'e', 0, 1, 0, 1}} + } + // Fixup leading and trailing groups if they show no changes. + if codes[0].Tag == 'e' { + c := codes[0] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2} + } + if codes[len(codes)-1].Tag == 'e' { + c := codes[len(codes)-1] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)} + } + nn := n + n + groups := [][]OpCode{} + group := []OpCode{} + for _, c := range codes { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + // End the current group and start a new one whenever + // there is a large range with no changes. + if c.Tag == 'e' && i2-i1 > nn { + group = append(group, OpCode{c.Tag, i1, min(i2, i1+n), + j1, min(j2, j1+n)}) + groups = append(groups, group) + group = []OpCode{} + i1, j1 = max(i1, i2-n), max(j1, j2-n) + } + group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) + } + if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { + groups = append(groups, group) + } + return groups +} + +// Return a measure of the sequences' similarity (float in [0,1]). +// +// Where T is the total number of elements in both sequences, and +// M is the number of matches, this is 2.0*M / T. +// Note that this is 1 if the sequences are identical, and 0 if +// they have nothing in common. +// +// .Ratio() is expensive to compute if you haven't already computed +// .GetMatchingBlocks() or .GetOpCodes(), in which case you may +// want to try .QuickRatio() or .RealQuickRation() first to get an +// upper bound. +func (m *SequenceMatcher) Ratio() float64 { + matches := 0 + for _, m := range m.GetMatchingBlocks() { + matches += m.Size + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() relatively quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute. +func (m *SequenceMatcher) QuickRatio() float64 { + // viewing a and b as multisets, set matches to the cardinality + // of their intersection; this counts the number of matches + // without regard to order, so is clearly an upper bound + if m.fullBCount == nil { + m.fullBCount = map[string]int{} + for _, s := range m.b { + m.fullBCount[s] = m.fullBCount[s] + 1 + } + } + + // avail[x] is the number of times x appears in 'b' less the + // number of times we've seen it in 'a' so far ... kinda + avail := map[string]int{} + matches := 0 + for _, s := range m.a { + n, ok := avail[s] + if !ok { + n = m.fullBCount[s] + } + avail[s] = n - 1 + if n > 0 { + matches += 1 + } + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() very quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute than either .Ratio() or .QuickRatio(). +func (m *SequenceMatcher) RealQuickRatio() float64 { + la, lb := len(m.a), len(m.b) + return calculateRatio(min(la, lb), la+lb) +} + +// Convert range to the "ed" format +func formatRangeUnified(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 1 { + return fmt.Sprintf("%d", beginning) + } + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + return fmt.Sprintf("%d,%d", beginning, length) +} + +// Unified diff parameters +type UnifiedDiff struct { + A []string // First sequence lines + FromFile string // First file name + FromDate string // First file time + B []string // Second sequence lines + ToFile string // Second file name + ToDate string // Second file time + Eol string // Headers end of line, defaults to LF + Context int // Number of context lines +} + +// Compare two sequences of lines; generate the delta as a unified diff. +// +// Unified diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by 'n' which +// defaults to three. +// +// By default, the diff control lines (those with ---, +++, or @@) are +// created with a trailing newline. This is helpful so that inputs +// created from file.readlines() result in diffs that are suitable for +// file.writelines() since both the inputs and outputs have trailing +// newlines. +// +// For inputs that do not have trailing newlines, set the lineterm +// argument to "" so that the output will be uniformly newline free. +// +// The unidiff format normally has a header for filenames and modification +// times. Any or all of these may be specified using strings for +// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. +// The modification times are normally expressed in the ISO 8601 format. +func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + w := func(format string, args ...interface{}) error { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + return err + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + err := w("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) + if err != nil { + return err + } + err = w("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) + if err != nil { + return err + } + } + first, last := g[0], g[len(g)-1] + range1 := formatRangeUnified(first.I1, last.I2) + range2 := formatRangeUnified(first.J1, last.J2) + if err := w("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { + return err + } + for _, c := range g { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + if c.Tag == 'e' { + for _, line := range diff.A[i1:i2] { + if err := w(" " + line); err != nil { + return err + } + } + continue + } + if c.Tag == 'r' || c.Tag == 'd' { + for _, line := range diff.A[i1:i2] { + if err := w("-" + line); err != nil { + return err + } + } + } + if c.Tag == 'r' || c.Tag == 'i' { + for _, line := range diff.B[j1:j2] { + if err := w("+" + line); err != nil { + return err + } + } + } + } + } + return nil +} + +// Like WriteUnifiedDiff but returns the diff a string. +func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteUnifiedDiff(w, diff) + return string(w.Bytes()), err +} + +// Convert range to the "ed" format. +func formatRangeContext(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + if length <= 1 { + return fmt.Sprintf("%d", beginning) + } + return fmt.Sprintf("%d,%d", beginning, beginning+length-1) +} + +type ContextDiff UnifiedDiff + +// Compare two sequences of lines; generate the delta as a context diff. +// +// Context diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by diff.Context +// which defaults to three. +// +// By default, the diff control lines (those with *** or ---) are +// created with a trailing newline. +// +// For inputs that do not have trailing newlines, set the diff.Eol +// argument to "" so that the output will be uniformly newline free. +// +// The context diff format normally has a header for filenames and +// modification times. Any or all of these may be specified using +// strings for diff.FromFile, diff.ToFile, diff.FromDate, diff.ToDate. +// The modification times are normally expressed in the ISO 8601 format. +// If not specified, the strings default to blanks. +func WriteContextDiff(writer io.Writer, diff ContextDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + var diffErr error + w := func(format string, args ...interface{}) { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + if diffErr == nil && err != nil { + diffErr = err + } + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + prefix := map[byte]string{ + 'i': "+ ", + 'd': "- ", + 'r': "! ", + 'e': " ", + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + w("*** %s%s%s", diff.FromFile, fromDate, diff.Eol) + w("--- %s%s%s", diff.ToFile, toDate, diff.Eol) + } + + first, last := g[0], g[len(g)-1] + w("***************" + diff.Eol) + + range1 := formatRangeContext(first.I1, last.I2) + w("*** %s ****%s", range1, diff.Eol) + for _, c := range g { + if c.Tag == 'r' || c.Tag == 'd' { + for _, cc := range g { + if cc.Tag == 'i' { + continue + } + for _, line := range diff.A[cc.I1:cc.I2] { + w(prefix[cc.Tag] + line) + } + } + break + } + } + + range2 := formatRangeContext(first.J1, last.J2) + w("--- %s ----%s", range2, diff.Eol) + for _, c := range g { + if c.Tag == 'r' || c.Tag == 'i' { + for _, cc := range g { + if cc.Tag == 'd' { + continue + } + for _, line := range diff.B[cc.J1:cc.J2] { + w(prefix[cc.Tag] + line) + } + } + break + } + } + } + return diffErr +} + +// Like WriteContextDiff but returns the diff a string. +func GetContextDiffString(diff ContextDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteContextDiff(w, diff) + return string(w.Bytes()), err +} + +// Split a string on "\n" while preserving them. The output can be used +// as input for UnifiedDiff and ContextDiff structures. +func SplitLines(s string) []string { + lines := strings.SplitAfter(s, "\n") + lines[len(lines)-1] += "\n" + return lines +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/LICENSE.md b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/LICENSE.md new file mode 100644 index 00000000..21999458 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/LICENSE.md @@ -0,0 +1,23 @@ +objx - by Mat Ryer and Tyler Bunnell + +The MIT License (MIT) + +Copyright (c) 2014 Stretchr, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/README.md b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/README.md new file mode 100644 index 00000000..4aa18068 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/README.md @@ -0,0 +1,3 @@ +# objx + + * Jump into the [API Documentation](http://godoc.org/github.com/stretchr/objx) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go new file mode 100644 index 00000000..721bcac7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go @@ -0,0 +1,179 @@ +package objx + +import ( + "fmt" + "regexp" + "strconv" + "strings" +) + +// arrayAccesRegexString is the regex used to extract the array number +// from the access path +const arrayAccesRegexString = `^(.+)\[([0-9]+)\]$` + +// arrayAccesRegex is the compiled arrayAccesRegexString +var arrayAccesRegex = regexp.MustCompile(arrayAccesRegexString) + +// Get gets the value using the specified selector and +// returns it inside a new Obj object. +// +// If it cannot find the value, Get will return a nil +// value inside an instance of Obj. +// +// Get can only operate directly on map[string]interface{} and []interface. +// +// Example +// +// To access the title of the third chapter of the second book, do: +// +// o.Get("books[1].chapters[2].title") +func (m Map) Get(selector string) *Value { + rawObj := access(m, selector, nil, false, false) + return &Value{data: rawObj} +} + +// Set sets the value using the specified selector and +// returns the object on which Set was called. +// +// Set can only operate directly on map[string]interface{} and []interface +// +// Example +// +// To set the title of the third chapter of the second book, do: +// +// o.Set("books[1].chapters[2].title","Time to Go") +func (m Map) Set(selector string, value interface{}) Map { + access(m, selector, value, true, false) + return m +} + +// access accesses the object using the selector and performs the +// appropriate action. +func access(current, selector, value interface{}, isSet, panics bool) interface{} { + + switch selector.(type) { + case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64: + + if array, ok := current.([]interface{}); ok { + index := intFromInterface(selector) + + if index >= len(array) { + if panics { + panic(fmt.Sprintf("objx: Index %d is out of range. Slice only contains %d items.", index, len(array))) + } + return nil + } + + return array[index] + } + + return nil + + case string: + + selStr := selector.(string) + selSegs := strings.SplitN(selStr, PathSeparator, 2) + thisSel := selSegs[0] + index := -1 + var err error + + // https://github.com/stretchr/objx/issues/12 + if strings.Contains(thisSel, "[") { + + arrayMatches := arrayAccesRegex.FindStringSubmatch(thisSel) + + if len(arrayMatches) > 0 { + + // Get the key into the map + thisSel = arrayMatches[1] + + // Get the index into the array at the key + index, err = strconv.Atoi(arrayMatches[2]) + + if err != nil { + // This should never happen. If it does, something has gone + // seriously wrong. Panic. + panic("objx: Array index is not an integer. Must use array[int].") + } + + } + } + + if curMap, ok := current.(Map); ok { + current = map[string]interface{}(curMap) + } + + // get the object in question + switch current.(type) { + case map[string]interface{}: + curMSI := current.(map[string]interface{}) + if len(selSegs) <= 1 && isSet { + curMSI[thisSel] = value + return nil + } else { + current = curMSI[thisSel] + } + default: + current = nil + } + + if current == nil && panics { + panic(fmt.Sprintf("objx: '%v' invalid on object.", selector)) + } + + // do we need to access the item of an array? + if index > -1 { + if array, ok := current.([]interface{}); ok { + if index < len(array) { + current = array[index] + } else { + if panics { + panic(fmt.Sprintf("objx: Index %d is out of range. Slice only contains %d items.", index, len(array))) + } + current = nil + } + } + } + + if len(selSegs) > 1 { + current = access(current, selSegs[1], value, isSet, panics) + } + + } + + return current + +} + +// intFromInterface converts an interface object to the largest +// representation of an unsigned integer using a type switch and +// assertions +func intFromInterface(selector interface{}) int { + var value int + switch selector.(type) { + case int: + value = selector.(int) + case int8: + value = int(selector.(int8)) + case int16: + value = int(selector.(int16)) + case int32: + value = int(selector.(int32)) + case int64: + value = int(selector.(int64)) + case uint: + value = int(selector.(uint)) + case uint8: + value = int(selector.(uint8)) + case uint16: + value = int(selector.(uint16)) + case uint32: + value = int(selector.(uint32)) + case uint64: + value = int(selector.(uint64)) + default: + panic("objx: array access argument is not an integer type (this should never happen)") + } + + return value +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/codegen/index.html b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/codegen/index.html new file mode 100644 index 00000000..379ffc3c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/codegen/index.html @@ -0,0 +1,86 @@ + + + + Codegen + + + + + +

+ Template +

+

+ Use {x} as a placeholder for each argument. +

+ + +

+ Arguments (comma separated) +

+

+ One block per line +

+ + +

+ Output +

+ + + + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/constants.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/constants.go new file mode 100644 index 00000000..f9eb42a2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/constants.go @@ -0,0 +1,13 @@ +package objx + +const ( + // PathSeparator is the character used to separate the elements + // of the keypath. + // + // For example, `location.address.city` + PathSeparator string = "." + + // SignatureSeparator is the character that is used to + // separate the Base64 string from the security signature. + SignatureSeparator = "_" +) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/conversions.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/conversions.go new file mode 100644 index 00000000..9cdfa9f9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/conversions.go @@ -0,0 +1,117 @@ +package objx + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "net/url" +) + +// JSON converts the contained object to a JSON string +// representation +func (m Map) JSON() (string, error) { + + result, err := json.Marshal(m) + + if err != nil { + err = errors.New("objx: JSON encode failed with: " + err.Error()) + } + + return string(result), err + +} + +// MustJSON converts the contained object to a JSON string +// representation and panics if there is an error +func (m Map) MustJSON() string { + result, err := m.JSON() + if err != nil { + panic(err.Error()) + } + return result +} + +// Base64 converts the contained object to a Base64 string +// representation of the JSON string representation +func (m Map) Base64() (string, error) { + + var buf bytes.Buffer + + jsonData, err := m.JSON() + if err != nil { + return "", err + } + + encoder := base64.NewEncoder(base64.StdEncoding, &buf) + encoder.Write([]byte(jsonData)) + encoder.Close() + + return buf.String(), nil + +} + +// MustBase64 converts the contained object to a Base64 string +// representation of the JSON string representation and panics +// if there is an error +func (m Map) MustBase64() string { + result, err := m.Base64() + if err != nil { + panic(err.Error()) + } + return result +} + +// SignedBase64 converts the contained object to a Base64 string +// representation of the JSON string representation and signs it +// using the provided key. +func (m Map) SignedBase64(key string) (string, error) { + + base64, err := m.Base64() + if err != nil { + return "", err + } + + sig := HashWithKey(base64, key) + + return base64 + SignatureSeparator + sig, nil + +} + +// MustSignedBase64 converts the contained object to a Base64 string +// representation of the JSON string representation and signs it +// using the provided key and panics if there is an error +func (m Map) MustSignedBase64(key string) string { + result, err := m.SignedBase64(key) + if err != nil { + panic(err.Error()) + } + return result +} + +/* + URL Query + ------------------------------------------------ +*/ + +// URLValues creates a url.Values object from an Obj. This +// function requires that the wrapped object be a map[string]interface{} +func (m Map) URLValues() url.Values { + + vals := make(url.Values) + + for k, v := range m { + //TODO: can this be done without sprintf? + vals.Set(k, fmt.Sprintf("%v", v)) + } + + return vals +} + +// URLQuery gets an encoded URL query representing the given +// Obj. This function requires that the wrapped object be a +// map[string]interface{} +func (m Map) URLQuery() (string, error) { + return m.URLValues().Encode(), nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/doc.go new file mode 100644 index 00000000..47bf85e4 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/doc.go @@ -0,0 +1,72 @@ +// objx - Go package for dealing with maps, slices, JSON and other data. +// +// Overview +// +// Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes +// a powerful `Get` method (among others) that allows you to easily and quickly get +// access to data within the map, without having to worry too much about type assertions, +// missing data, default values etc. +// +// Pattern +// +// Objx uses a preditable pattern to make access data from within `map[string]interface{}'s +// easy. +// +// Call one of the `objx.` functions to create your `objx.Map` to get going: +// +// m, err := objx.FromJSON(json) +// +// NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong, +// the rest will be optimistic and try to figure things out without panicking. +// +// Use `Get` to access the value you're interested in. You can use dot and array +// notation too: +// +// m.Get("places[0].latlng") +// +// Once you have saught the `Value` you're interested in, you can use the `Is*` methods +// to determine its type. +// +// if m.Get("code").IsStr() { /* ... */ } +// +// Or you can just assume the type, and use one of the strong type methods to +// extract the real value: +// +// m.Get("code").Int() +// +// If there's no value there (or if it's the wrong type) then a default value +// will be returned, or you can be explicit about the default value. +// +// Get("code").Int(-1) +// +// If you're dealing with a slice of data as a value, Objx provides many useful +// methods for iterating, manipulating and selecting that data. You can find out more +// by exploring the index below. +// +// Reading data +// +// A simple example of how to use Objx: +// +// // use MustFromJSON to make an objx.Map from some JSON +// m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) +// +// // get the details +// name := m.Get("name").Str() +// age := m.Get("age").Int() +// +// // get their nickname (or use their name if they +// // don't have one) +// nickname := m.Get("nickname").Str(name) +// +// Ranging +// +// Since `objx.Map` is a `map[string]interface{}` you can treat it as such. For +// example, to `range` the data, do what you would expect: +// +// m := objx.MustFromJSON(json) +// for key, value := range m { +// +// /* ... do your magic ... */ +// +// } +package objx diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/map.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/map.go new file mode 100644 index 00000000..eb6ed8e2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/map.go @@ -0,0 +1,222 @@ +package objx + +import ( + "encoding/base64" + "encoding/json" + "errors" + "io/ioutil" + "net/url" + "strings" +) + +// MSIConvertable is an interface that defines methods for converting your +// custom types to a map[string]interface{} representation. +type MSIConvertable interface { + // MSI gets a map[string]interface{} (msi) representing the + // object. + MSI() map[string]interface{} +} + +// Map provides extended functionality for working with +// untyped data, in particular map[string]interface (msi). +type Map map[string]interface{} + +// Value returns the internal value instance +func (m Map) Value() *Value { + return &Value{data: m} +} + +// Nil represents a nil Map. +var Nil Map = New(nil) + +// New creates a new Map containing the map[string]interface{} in the data argument. +// If the data argument is not a map[string]interface, New attempts to call the +// MSI() method on the MSIConvertable interface to create one. +func New(data interface{}) Map { + if _, ok := data.(map[string]interface{}); !ok { + if converter, ok := data.(MSIConvertable); ok { + data = converter.MSI() + } else { + return nil + } + } + return Map(data.(map[string]interface{})) +} + +// MSI creates a map[string]interface{} and puts it inside a new Map. +// +// The arguments follow a key, value pattern. +// +// Panics +// +// Panics if any key arugment is non-string or if there are an odd number of arguments. +// +// Example +// +// To easily create Maps: +// +// m := objx.MSI("name", "Mat", "age", 29, "subobj", objx.MSI("active", true)) +// +// // creates an Map equivalent to +// m := objx.New(map[string]interface{}{"name": "Mat", "age": 29, "subobj": map[string]interface{}{"active": true}}) +func MSI(keyAndValuePairs ...interface{}) Map { + + newMap := make(map[string]interface{}) + keyAndValuePairsLen := len(keyAndValuePairs) + + if keyAndValuePairsLen%2 != 0 { + panic("objx: MSI must have an even number of arguments following the 'key, value' pattern.") + } + + for i := 0; i < keyAndValuePairsLen; i = i + 2 { + + key := keyAndValuePairs[i] + value := keyAndValuePairs[i+1] + + // make sure the key is a string + keyString, keyStringOK := key.(string) + if !keyStringOK { + panic("objx: MSI must follow 'string, interface{}' pattern. " + keyString + " is not a valid key.") + } + + newMap[keyString] = value + + } + + return New(newMap) +} + +// ****** Conversion Constructors + +// MustFromJSON creates a new Map containing the data specified in the +// jsonString. +// +// Panics if the JSON is invalid. +func MustFromJSON(jsonString string) Map { + o, err := FromJSON(jsonString) + + if err != nil { + panic("objx: MustFromJSON failed with error: " + err.Error()) + } + + return o +} + +// FromJSON creates a new Map containing the data specified in the +// jsonString. +// +// Returns an error if the JSON is invalid. +func FromJSON(jsonString string) (Map, error) { + + var data interface{} + err := json.Unmarshal([]byte(jsonString), &data) + + if err != nil { + return Nil, err + } + + return New(data), nil + +} + +// FromBase64 creates a new Obj containing the data specified +// in the Base64 string. +// +// The string is an encoded JSON string returned by Base64 +func FromBase64(base64String string) (Map, error) { + + decoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(base64String)) + + decoded, err := ioutil.ReadAll(decoder) + if err != nil { + return nil, err + } + + return FromJSON(string(decoded)) +} + +// MustFromBase64 creates a new Obj containing the data specified +// in the Base64 string and panics if there is an error. +// +// The string is an encoded JSON string returned by Base64 +func MustFromBase64(base64String string) Map { + + result, err := FromBase64(base64String) + + if err != nil { + panic("objx: MustFromBase64 failed with error: " + err.Error()) + } + + return result +} + +// FromSignedBase64 creates a new Obj containing the data specified +// in the Base64 string. +// +// The string is an encoded JSON string returned by SignedBase64 +func FromSignedBase64(base64String, key string) (Map, error) { + parts := strings.Split(base64String, SignatureSeparator) + if len(parts) != 2 { + return nil, errors.New("objx: Signed base64 string is malformed.") + } + + sig := HashWithKey(parts[0], key) + if parts[1] != sig { + return nil, errors.New("objx: Signature for base64 data does not match.") + } + + return FromBase64(parts[0]) +} + +// MustFromSignedBase64 creates a new Obj containing the data specified +// in the Base64 string and panics if there is an error. +// +// The string is an encoded JSON string returned by Base64 +func MustFromSignedBase64(base64String, key string) Map { + + result, err := FromSignedBase64(base64String, key) + + if err != nil { + panic("objx: MustFromSignedBase64 failed with error: " + err.Error()) + } + + return result +} + +// FromURLQuery generates a new Obj by parsing the specified +// query. +// +// For queries with multiple values, the first value is selected. +func FromURLQuery(query string) (Map, error) { + + vals, err := url.ParseQuery(query) + + if err != nil { + return nil, err + } + + m := make(map[string]interface{}) + for k, vals := range vals { + m[k] = vals[0] + } + + return New(m), nil +} + +// MustFromURLQuery generates a new Obj by parsing the specified +// query. +// +// For queries with multiple values, the first value is selected. +// +// Panics if it encounters an error +func MustFromURLQuery(query string) Map { + + o, err := FromURLQuery(query) + + if err != nil { + panic("objx: MustFromURLQuery failed with error: " + err.Error()) + } + + return o + +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/mutations.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/mutations.go new file mode 100644 index 00000000..b35c8639 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/mutations.go @@ -0,0 +1,81 @@ +package objx + +// Exclude returns a new Map with the keys in the specified []string +// excluded. +func (d Map) Exclude(exclude []string) Map { + + excluded := make(Map) + for k, v := range d { + var shouldInclude bool = true + for _, toExclude := range exclude { + if k == toExclude { + shouldInclude = false + break + } + } + if shouldInclude { + excluded[k] = v + } + } + + return excluded +} + +// Copy creates a shallow copy of the Obj. +func (m Map) Copy() Map { + copied := make(map[string]interface{}) + for k, v := range m { + copied[k] = v + } + return New(copied) +} + +// Merge blends the specified map with a copy of this map and returns the result. +// +// Keys that appear in both will be selected from the specified map. +// This method requires that the wrapped object be a map[string]interface{} +func (m Map) Merge(merge Map) Map { + return m.Copy().MergeHere(merge) +} + +// Merge blends the specified map with this map and returns the current map. +// +// Keys that appear in both will be selected from the specified map. The original map +// will be modified. This method requires that +// the wrapped object be a map[string]interface{} +func (m Map) MergeHere(merge Map) Map { + + for k, v := range merge { + m[k] = v + } + + return m + +} + +// Transform builds a new Obj giving the transformer a chance +// to change the keys and values as it goes. This method requires that +// the wrapped object be a map[string]interface{} +func (m Map) Transform(transformer func(key string, value interface{}) (string, interface{})) Map { + newMap := make(map[string]interface{}) + for k, v := range m { + modifiedKey, modifiedVal := transformer(k, v) + newMap[modifiedKey] = modifiedVal + } + return New(newMap) +} + +// TransformKeys builds a new map using the specified key mapping. +// +// Unspecified keys will be unaltered. +// This method requires that the wrapped object be a map[string]interface{} +func (m Map) TransformKeys(mapping map[string]string) Map { + return m.Transform(func(key string, value interface{}) (string, interface{}) { + + if newKey, ok := mapping[key]; ok { + return newKey, value + } + + return key, value + }) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/security.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/security.go new file mode 100644 index 00000000..fdd6be9c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/security.go @@ -0,0 +1,14 @@ +package objx + +import ( + "crypto/sha1" + "encoding/hex" +) + +// HashWithKey hashes the specified string using the security +// key. +func HashWithKey(data, key string) string { + hash := sha1.New() + hash.Write([]byte(data + ":" + key)) + return hex.EncodeToString(hash.Sum(nil)) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/tests.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/tests.go new file mode 100644 index 00000000..d9e0b479 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/tests.go @@ -0,0 +1,17 @@ +package objx + +// Has gets whether there is something at the specified selector +// or not. +// +// If m is nil, Has will always return false. +func (m Map) Has(selector string) bool { + if m == nil { + return false + } + return !m.Get(selector).IsNil() +} + +// IsNil gets whether the data is nil or not. +func (v *Value) IsNil() bool { + return v == nil || v.data == nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/type_specific_codegen.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/type_specific_codegen.go new file mode 100644 index 00000000..f3ecb29b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/type_specific_codegen.go @@ -0,0 +1,2881 @@ +package objx + +/* + Inter (interface{} and []interface{}) + -------------------------------------------------- +*/ + +// Inter gets the value as a interface{}, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Inter(optionalDefault ...interface{}) interface{} { + if s, ok := v.data.(interface{}); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInter gets the value as a interface{}. +// +// Panics if the object is not a interface{}. +func (v *Value) MustInter() interface{} { + return v.data.(interface{}) +} + +// InterSlice gets the value as a []interface{}, returns the optionalDefault +// value or nil if the value is not a []interface{}. +func (v *Value) InterSlice(optionalDefault ...[]interface{}) []interface{} { + if s, ok := v.data.([]interface{}); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInterSlice gets the value as a []interface{}. +// +// Panics if the object is not a []interface{}. +func (v *Value) MustInterSlice() []interface{} { + return v.data.([]interface{}) +} + +// IsInter gets whether the object contained is a interface{} or not. +func (v *Value) IsInter() bool { + _, ok := v.data.(interface{}) + return ok +} + +// IsInterSlice gets whether the object contained is a []interface{} or not. +func (v *Value) IsInterSlice() bool { + _, ok := v.data.([]interface{}) + return ok +} + +// EachInter calls the specified callback for each object +// in the []interface{}. +// +// Panics if the object is the wrong type. +func (v *Value) EachInter(callback func(int, interface{}) bool) *Value { + + for index, val := range v.MustInterSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInter uses the specified decider function to select items +// from the []interface{}. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInter(decider func(int, interface{}) bool) *Value { + + var selected []interface{} + + v.EachInter(func(index int, val interface{}) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInter uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]interface{}. +func (v *Value) GroupInter(grouper func(int, interface{}) string) *Value { + + groups := make(map[string][]interface{}) + + v.EachInter(func(index int, val interface{}) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]interface{}, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInter uses the specified function to replace each interface{}s +// by iterating each item. The data in the returned result will be a +// []interface{} containing the replaced items. +func (v *Value) ReplaceInter(replacer func(int, interface{}) interface{}) *Value { + + arr := v.MustInterSlice() + replaced := make([]interface{}, len(arr)) + + v.EachInter(func(index int, val interface{}) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInter uses the specified collector function to collect a value +// for each of the interface{}s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInter(collector func(int, interface{}) interface{}) *Value { + + arr := v.MustInterSlice() + collected := make([]interface{}, len(arr)) + + v.EachInter(func(index int, val interface{}) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + MSI (map[string]interface{} and []map[string]interface{}) + -------------------------------------------------- +*/ + +// MSI gets the value as a map[string]interface{}, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) MSI(optionalDefault ...map[string]interface{}) map[string]interface{} { + if s, ok := v.data.(map[string]interface{}); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustMSI gets the value as a map[string]interface{}. +// +// Panics if the object is not a map[string]interface{}. +func (v *Value) MustMSI() map[string]interface{} { + return v.data.(map[string]interface{}) +} + +// MSISlice gets the value as a []map[string]interface{}, returns the optionalDefault +// value or nil if the value is not a []map[string]interface{}. +func (v *Value) MSISlice(optionalDefault ...[]map[string]interface{}) []map[string]interface{} { + if s, ok := v.data.([]map[string]interface{}); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustMSISlice gets the value as a []map[string]interface{}. +// +// Panics if the object is not a []map[string]interface{}. +func (v *Value) MustMSISlice() []map[string]interface{} { + return v.data.([]map[string]interface{}) +} + +// IsMSI gets whether the object contained is a map[string]interface{} or not. +func (v *Value) IsMSI() bool { + _, ok := v.data.(map[string]interface{}) + return ok +} + +// IsMSISlice gets whether the object contained is a []map[string]interface{} or not. +func (v *Value) IsMSISlice() bool { + _, ok := v.data.([]map[string]interface{}) + return ok +} + +// EachMSI calls the specified callback for each object +// in the []map[string]interface{}. +// +// Panics if the object is the wrong type. +func (v *Value) EachMSI(callback func(int, map[string]interface{}) bool) *Value { + + for index, val := range v.MustMSISlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereMSI uses the specified decider function to select items +// from the []map[string]interface{}. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereMSI(decider func(int, map[string]interface{}) bool) *Value { + + var selected []map[string]interface{} + + v.EachMSI(func(index int, val map[string]interface{}) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupMSI uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]map[string]interface{}. +func (v *Value) GroupMSI(grouper func(int, map[string]interface{}) string) *Value { + + groups := make(map[string][]map[string]interface{}) + + v.EachMSI(func(index int, val map[string]interface{}) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]map[string]interface{}, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceMSI uses the specified function to replace each map[string]interface{}s +// by iterating each item. The data in the returned result will be a +// []map[string]interface{} containing the replaced items. +func (v *Value) ReplaceMSI(replacer func(int, map[string]interface{}) map[string]interface{}) *Value { + + arr := v.MustMSISlice() + replaced := make([]map[string]interface{}, len(arr)) + + v.EachMSI(func(index int, val map[string]interface{}) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectMSI uses the specified collector function to collect a value +// for each of the map[string]interface{}s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectMSI(collector func(int, map[string]interface{}) interface{}) *Value { + + arr := v.MustMSISlice() + collected := make([]interface{}, len(arr)) + + v.EachMSI(func(index int, val map[string]interface{}) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + ObjxMap ((Map) and [](Map)) + -------------------------------------------------- +*/ + +// ObjxMap gets the value as a (Map), returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) ObjxMap(optionalDefault ...(Map)) Map { + if s, ok := v.data.((Map)); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return New(nil) +} + +// MustObjxMap gets the value as a (Map). +// +// Panics if the object is not a (Map). +func (v *Value) MustObjxMap() Map { + return v.data.((Map)) +} + +// ObjxMapSlice gets the value as a [](Map), returns the optionalDefault +// value or nil if the value is not a [](Map). +func (v *Value) ObjxMapSlice(optionalDefault ...[](Map)) [](Map) { + if s, ok := v.data.([](Map)); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustObjxMapSlice gets the value as a [](Map). +// +// Panics if the object is not a [](Map). +func (v *Value) MustObjxMapSlice() [](Map) { + return v.data.([](Map)) +} + +// IsObjxMap gets whether the object contained is a (Map) or not. +func (v *Value) IsObjxMap() bool { + _, ok := v.data.((Map)) + return ok +} + +// IsObjxMapSlice gets whether the object contained is a [](Map) or not. +func (v *Value) IsObjxMapSlice() bool { + _, ok := v.data.([](Map)) + return ok +} + +// EachObjxMap calls the specified callback for each object +// in the [](Map). +// +// Panics if the object is the wrong type. +func (v *Value) EachObjxMap(callback func(int, Map) bool) *Value { + + for index, val := range v.MustObjxMapSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereObjxMap uses the specified decider function to select items +// from the [](Map). The object contained in the result will contain +// only the selected items. +func (v *Value) WhereObjxMap(decider func(int, Map) bool) *Value { + + var selected [](Map) + + v.EachObjxMap(func(index int, val Map) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupObjxMap uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][](Map). +func (v *Value) GroupObjxMap(grouper func(int, Map) string) *Value { + + groups := make(map[string][](Map)) + + v.EachObjxMap(func(index int, val Map) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([](Map), 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceObjxMap uses the specified function to replace each (Map)s +// by iterating each item. The data in the returned result will be a +// [](Map) containing the replaced items. +func (v *Value) ReplaceObjxMap(replacer func(int, Map) Map) *Value { + + arr := v.MustObjxMapSlice() + replaced := make([](Map), len(arr)) + + v.EachObjxMap(func(index int, val Map) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectObjxMap uses the specified collector function to collect a value +// for each of the (Map)s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectObjxMap(collector func(int, Map) interface{}) *Value { + + arr := v.MustObjxMapSlice() + collected := make([]interface{}, len(arr)) + + v.EachObjxMap(func(index int, val Map) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Bool (bool and []bool) + -------------------------------------------------- +*/ + +// Bool gets the value as a bool, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Bool(optionalDefault ...bool) bool { + if s, ok := v.data.(bool); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return false +} + +// MustBool gets the value as a bool. +// +// Panics if the object is not a bool. +func (v *Value) MustBool() bool { + return v.data.(bool) +} + +// BoolSlice gets the value as a []bool, returns the optionalDefault +// value or nil if the value is not a []bool. +func (v *Value) BoolSlice(optionalDefault ...[]bool) []bool { + if s, ok := v.data.([]bool); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustBoolSlice gets the value as a []bool. +// +// Panics if the object is not a []bool. +func (v *Value) MustBoolSlice() []bool { + return v.data.([]bool) +} + +// IsBool gets whether the object contained is a bool or not. +func (v *Value) IsBool() bool { + _, ok := v.data.(bool) + return ok +} + +// IsBoolSlice gets whether the object contained is a []bool or not. +func (v *Value) IsBoolSlice() bool { + _, ok := v.data.([]bool) + return ok +} + +// EachBool calls the specified callback for each object +// in the []bool. +// +// Panics if the object is the wrong type. +func (v *Value) EachBool(callback func(int, bool) bool) *Value { + + for index, val := range v.MustBoolSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereBool uses the specified decider function to select items +// from the []bool. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereBool(decider func(int, bool) bool) *Value { + + var selected []bool + + v.EachBool(func(index int, val bool) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupBool uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]bool. +func (v *Value) GroupBool(grouper func(int, bool) string) *Value { + + groups := make(map[string][]bool) + + v.EachBool(func(index int, val bool) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]bool, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceBool uses the specified function to replace each bools +// by iterating each item. The data in the returned result will be a +// []bool containing the replaced items. +func (v *Value) ReplaceBool(replacer func(int, bool) bool) *Value { + + arr := v.MustBoolSlice() + replaced := make([]bool, len(arr)) + + v.EachBool(func(index int, val bool) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectBool uses the specified collector function to collect a value +// for each of the bools in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectBool(collector func(int, bool) interface{}) *Value { + + arr := v.MustBoolSlice() + collected := make([]interface{}, len(arr)) + + v.EachBool(func(index int, val bool) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Str (string and []string) + -------------------------------------------------- +*/ + +// Str gets the value as a string, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Str(optionalDefault ...string) string { + if s, ok := v.data.(string); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return "" +} + +// MustStr gets the value as a string. +// +// Panics if the object is not a string. +func (v *Value) MustStr() string { + return v.data.(string) +} + +// StrSlice gets the value as a []string, returns the optionalDefault +// value or nil if the value is not a []string. +func (v *Value) StrSlice(optionalDefault ...[]string) []string { + if s, ok := v.data.([]string); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustStrSlice gets the value as a []string. +// +// Panics if the object is not a []string. +func (v *Value) MustStrSlice() []string { + return v.data.([]string) +} + +// IsStr gets whether the object contained is a string or not. +func (v *Value) IsStr() bool { + _, ok := v.data.(string) + return ok +} + +// IsStrSlice gets whether the object contained is a []string or not. +func (v *Value) IsStrSlice() bool { + _, ok := v.data.([]string) + return ok +} + +// EachStr calls the specified callback for each object +// in the []string. +// +// Panics if the object is the wrong type. +func (v *Value) EachStr(callback func(int, string) bool) *Value { + + for index, val := range v.MustStrSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereStr uses the specified decider function to select items +// from the []string. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereStr(decider func(int, string) bool) *Value { + + var selected []string + + v.EachStr(func(index int, val string) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupStr uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]string. +func (v *Value) GroupStr(grouper func(int, string) string) *Value { + + groups := make(map[string][]string) + + v.EachStr(func(index int, val string) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]string, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceStr uses the specified function to replace each strings +// by iterating each item. The data in the returned result will be a +// []string containing the replaced items. +func (v *Value) ReplaceStr(replacer func(int, string) string) *Value { + + arr := v.MustStrSlice() + replaced := make([]string, len(arr)) + + v.EachStr(func(index int, val string) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectStr uses the specified collector function to collect a value +// for each of the strings in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectStr(collector func(int, string) interface{}) *Value { + + arr := v.MustStrSlice() + collected := make([]interface{}, len(arr)) + + v.EachStr(func(index int, val string) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int (int and []int) + -------------------------------------------------- +*/ + +// Int gets the value as a int, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int(optionalDefault ...int) int { + if s, ok := v.data.(int); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt gets the value as a int. +// +// Panics if the object is not a int. +func (v *Value) MustInt() int { + return v.data.(int) +} + +// IntSlice gets the value as a []int, returns the optionalDefault +// value or nil if the value is not a []int. +func (v *Value) IntSlice(optionalDefault ...[]int) []int { + if s, ok := v.data.([]int); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustIntSlice gets the value as a []int. +// +// Panics if the object is not a []int. +func (v *Value) MustIntSlice() []int { + return v.data.([]int) +} + +// IsInt gets whether the object contained is a int or not. +func (v *Value) IsInt() bool { + _, ok := v.data.(int) + return ok +} + +// IsIntSlice gets whether the object contained is a []int or not. +func (v *Value) IsIntSlice() bool { + _, ok := v.data.([]int) + return ok +} + +// EachInt calls the specified callback for each object +// in the []int. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt(callback func(int, int) bool) *Value { + + for index, val := range v.MustIntSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt uses the specified decider function to select items +// from the []int. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt(decider func(int, int) bool) *Value { + + var selected []int + + v.EachInt(func(index int, val int) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int. +func (v *Value) GroupInt(grouper func(int, int) string) *Value { + + groups := make(map[string][]int) + + v.EachInt(func(index int, val int) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt uses the specified function to replace each ints +// by iterating each item. The data in the returned result will be a +// []int containing the replaced items. +func (v *Value) ReplaceInt(replacer func(int, int) int) *Value { + + arr := v.MustIntSlice() + replaced := make([]int, len(arr)) + + v.EachInt(func(index int, val int) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt uses the specified collector function to collect a value +// for each of the ints in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt(collector func(int, int) interface{}) *Value { + + arr := v.MustIntSlice() + collected := make([]interface{}, len(arr)) + + v.EachInt(func(index int, val int) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int8 (int8 and []int8) + -------------------------------------------------- +*/ + +// Int8 gets the value as a int8, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int8(optionalDefault ...int8) int8 { + if s, ok := v.data.(int8); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt8 gets the value as a int8. +// +// Panics if the object is not a int8. +func (v *Value) MustInt8() int8 { + return v.data.(int8) +} + +// Int8Slice gets the value as a []int8, returns the optionalDefault +// value or nil if the value is not a []int8. +func (v *Value) Int8Slice(optionalDefault ...[]int8) []int8 { + if s, ok := v.data.([]int8); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInt8Slice gets the value as a []int8. +// +// Panics if the object is not a []int8. +func (v *Value) MustInt8Slice() []int8 { + return v.data.([]int8) +} + +// IsInt8 gets whether the object contained is a int8 or not. +func (v *Value) IsInt8() bool { + _, ok := v.data.(int8) + return ok +} + +// IsInt8Slice gets whether the object contained is a []int8 or not. +func (v *Value) IsInt8Slice() bool { + _, ok := v.data.([]int8) + return ok +} + +// EachInt8 calls the specified callback for each object +// in the []int8. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt8(callback func(int, int8) bool) *Value { + + for index, val := range v.MustInt8Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt8 uses the specified decider function to select items +// from the []int8. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt8(decider func(int, int8) bool) *Value { + + var selected []int8 + + v.EachInt8(func(index int, val int8) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt8 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int8. +func (v *Value) GroupInt8(grouper func(int, int8) string) *Value { + + groups := make(map[string][]int8) + + v.EachInt8(func(index int, val int8) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int8, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt8 uses the specified function to replace each int8s +// by iterating each item. The data in the returned result will be a +// []int8 containing the replaced items. +func (v *Value) ReplaceInt8(replacer func(int, int8) int8) *Value { + + arr := v.MustInt8Slice() + replaced := make([]int8, len(arr)) + + v.EachInt8(func(index int, val int8) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt8 uses the specified collector function to collect a value +// for each of the int8s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt8(collector func(int, int8) interface{}) *Value { + + arr := v.MustInt8Slice() + collected := make([]interface{}, len(arr)) + + v.EachInt8(func(index int, val int8) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int16 (int16 and []int16) + -------------------------------------------------- +*/ + +// Int16 gets the value as a int16, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int16(optionalDefault ...int16) int16 { + if s, ok := v.data.(int16); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt16 gets the value as a int16. +// +// Panics if the object is not a int16. +func (v *Value) MustInt16() int16 { + return v.data.(int16) +} + +// Int16Slice gets the value as a []int16, returns the optionalDefault +// value or nil if the value is not a []int16. +func (v *Value) Int16Slice(optionalDefault ...[]int16) []int16 { + if s, ok := v.data.([]int16); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInt16Slice gets the value as a []int16. +// +// Panics if the object is not a []int16. +func (v *Value) MustInt16Slice() []int16 { + return v.data.([]int16) +} + +// IsInt16 gets whether the object contained is a int16 or not. +func (v *Value) IsInt16() bool { + _, ok := v.data.(int16) + return ok +} + +// IsInt16Slice gets whether the object contained is a []int16 or not. +func (v *Value) IsInt16Slice() bool { + _, ok := v.data.([]int16) + return ok +} + +// EachInt16 calls the specified callback for each object +// in the []int16. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt16(callback func(int, int16) bool) *Value { + + for index, val := range v.MustInt16Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt16 uses the specified decider function to select items +// from the []int16. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt16(decider func(int, int16) bool) *Value { + + var selected []int16 + + v.EachInt16(func(index int, val int16) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt16 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int16. +func (v *Value) GroupInt16(grouper func(int, int16) string) *Value { + + groups := make(map[string][]int16) + + v.EachInt16(func(index int, val int16) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int16, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt16 uses the specified function to replace each int16s +// by iterating each item. The data in the returned result will be a +// []int16 containing the replaced items. +func (v *Value) ReplaceInt16(replacer func(int, int16) int16) *Value { + + arr := v.MustInt16Slice() + replaced := make([]int16, len(arr)) + + v.EachInt16(func(index int, val int16) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt16 uses the specified collector function to collect a value +// for each of the int16s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt16(collector func(int, int16) interface{}) *Value { + + arr := v.MustInt16Slice() + collected := make([]interface{}, len(arr)) + + v.EachInt16(func(index int, val int16) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int32 (int32 and []int32) + -------------------------------------------------- +*/ + +// Int32 gets the value as a int32, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int32(optionalDefault ...int32) int32 { + if s, ok := v.data.(int32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt32 gets the value as a int32. +// +// Panics if the object is not a int32. +func (v *Value) MustInt32() int32 { + return v.data.(int32) +} + +// Int32Slice gets the value as a []int32, returns the optionalDefault +// value or nil if the value is not a []int32. +func (v *Value) Int32Slice(optionalDefault ...[]int32) []int32 { + if s, ok := v.data.([]int32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInt32Slice gets the value as a []int32. +// +// Panics if the object is not a []int32. +func (v *Value) MustInt32Slice() []int32 { + return v.data.([]int32) +} + +// IsInt32 gets whether the object contained is a int32 or not. +func (v *Value) IsInt32() bool { + _, ok := v.data.(int32) + return ok +} + +// IsInt32Slice gets whether the object contained is a []int32 or not. +func (v *Value) IsInt32Slice() bool { + _, ok := v.data.([]int32) + return ok +} + +// EachInt32 calls the specified callback for each object +// in the []int32. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt32(callback func(int, int32) bool) *Value { + + for index, val := range v.MustInt32Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt32 uses the specified decider function to select items +// from the []int32. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt32(decider func(int, int32) bool) *Value { + + var selected []int32 + + v.EachInt32(func(index int, val int32) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt32 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int32. +func (v *Value) GroupInt32(grouper func(int, int32) string) *Value { + + groups := make(map[string][]int32) + + v.EachInt32(func(index int, val int32) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int32, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt32 uses the specified function to replace each int32s +// by iterating each item. The data in the returned result will be a +// []int32 containing the replaced items. +func (v *Value) ReplaceInt32(replacer func(int, int32) int32) *Value { + + arr := v.MustInt32Slice() + replaced := make([]int32, len(arr)) + + v.EachInt32(func(index int, val int32) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt32 uses the specified collector function to collect a value +// for each of the int32s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt32(collector func(int, int32) interface{}) *Value { + + arr := v.MustInt32Slice() + collected := make([]interface{}, len(arr)) + + v.EachInt32(func(index int, val int32) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Int64 (int64 and []int64) + -------------------------------------------------- +*/ + +// Int64 gets the value as a int64, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Int64(optionalDefault ...int64) int64 { + if s, ok := v.data.(int64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustInt64 gets the value as a int64. +// +// Panics if the object is not a int64. +func (v *Value) MustInt64() int64 { + return v.data.(int64) +} + +// Int64Slice gets the value as a []int64, returns the optionalDefault +// value or nil if the value is not a []int64. +func (v *Value) Int64Slice(optionalDefault ...[]int64) []int64 { + if s, ok := v.data.([]int64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustInt64Slice gets the value as a []int64. +// +// Panics if the object is not a []int64. +func (v *Value) MustInt64Slice() []int64 { + return v.data.([]int64) +} + +// IsInt64 gets whether the object contained is a int64 or not. +func (v *Value) IsInt64() bool { + _, ok := v.data.(int64) + return ok +} + +// IsInt64Slice gets whether the object contained is a []int64 or not. +func (v *Value) IsInt64Slice() bool { + _, ok := v.data.([]int64) + return ok +} + +// EachInt64 calls the specified callback for each object +// in the []int64. +// +// Panics if the object is the wrong type. +func (v *Value) EachInt64(callback func(int, int64) bool) *Value { + + for index, val := range v.MustInt64Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereInt64 uses the specified decider function to select items +// from the []int64. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereInt64(decider func(int, int64) bool) *Value { + + var selected []int64 + + v.EachInt64(func(index int, val int64) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupInt64 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]int64. +func (v *Value) GroupInt64(grouper func(int, int64) string) *Value { + + groups := make(map[string][]int64) + + v.EachInt64(func(index int, val int64) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]int64, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceInt64 uses the specified function to replace each int64s +// by iterating each item. The data in the returned result will be a +// []int64 containing the replaced items. +func (v *Value) ReplaceInt64(replacer func(int, int64) int64) *Value { + + arr := v.MustInt64Slice() + replaced := make([]int64, len(arr)) + + v.EachInt64(func(index int, val int64) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectInt64 uses the specified collector function to collect a value +// for each of the int64s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectInt64(collector func(int, int64) interface{}) *Value { + + arr := v.MustInt64Slice() + collected := make([]interface{}, len(arr)) + + v.EachInt64(func(index int, val int64) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint (uint and []uint) + -------------------------------------------------- +*/ + +// Uint gets the value as a uint, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint(optionalDefault ...uint) uint { + if s, ok := v.data.(uint); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint gets the value as a uint. +// +// Panics if the object is not a uint. +func (v *Value) MustUint() uint { + return v.data.(uint) +} + +// UintSlice gets the value as a []uint, returns the optionalDefault +// value or nil if the value is not a []uint. +func (v *Value) UintSlice(optionalDefault ...[]uint) []uint { + if s, ok := v.data.([]uint); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUintSlice gets the value as a []uint. +// +// Panics if the object is not a []uint. +func (v *Value) MustUintSlice() []uint { + return v.data.([]uint) +} + +// IsUint gets whether the object contained is a uint or not. +func (v *Value) IsUint() bool { + _, ok := v.data.(uint) + return ok +} + +// IsUintSlice gets whether the object contained is a []uint or not. +func (v *Value) IsUintSlice() bool { + _, ok := v.data.([]uint) + return ok +} + +// EachUint calls the specified callback for each object +// in the []uint. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint(callback func(int, uint) bool) *Value { + + for index, val := range v.MustUintSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint uses the specified decider function to select items +// from the []uint. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint(decider func(int, uint) bool) *Value { + + var selected []uint + + v.EachUint(func(index int, val uint) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint. +func (v *Value) GroupUint(grouper func(int, uint) string) *Value { + + groups := make(map[string][]uint) + + v.EachUint(func(index int, val uint) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint uses the specified function to replace each uints +// by iterating each item. The data in the returned result will be a +// []uint containing the replaced items. +func (v *Value) ReplaceUint(replacer func(int, uint) uint) *Value { + + arr := v.MustUintSlice() + replaced := make([]uint, len(arr)) + + v.EachUint(func(index int, val uint) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint uses the specified collector function to collect a value +// for each of the uints in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint(collector func(int, uint) interface{}) *Value { + + arr := v.MustUintSlice() + collected := make([]interface{}, len(arr)) + + v.EachUint(func(index int, val uint) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint8 (uint8 and []uint8) + -------------------------------------------------- +*/ + +// Uint8 gets the value as a uint8, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint8(optionalDefault ...uint8) uint8 { + if s, ok := v.data.(uint8); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint8 gets the value as a uint8. +// +// Panics if the object is not a uint8. +func (v *Value) MustUint8() uint8 { + return v.data.(uint8) +} + +// Uint8Slice gets the value as a []uint8, returns the optionalDefault +// value or nil if the value is not a []uint8. +func (v *Value) Uint8Slice(optionalDefault ...[]uint8) []uint8 { + if s, ok := v.data.([]uint8); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUint8Slice gets the value as a []uint8. +// +// Panics if the object is not a []uint8. +func (v *Value) MustUint8Slice() []uint8 { + return v.data.([]uint8) +} + +// IsUint8 gets whether the object contained is a uint8 or not. +func (v *Value) IsUint8() bool { + _, ok := v.data.(uint8) + return ok +} + +// IsUint8Slice gets whether the object contained is a []uint8 or not. +func (v *Value) IsUint8Slice() bool { + _, ok := v.data.([]uint8) + return ok +} + +// EachUint8 calls the specified callback for each object +// in the []uint8. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint8(callback func(int, uint8) bool) *Value { + + for index, val := range v.MustUint8Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint8 uses the specified decider function to select items +// from the []uint8. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint8(decider func(int, uint8) bool) *Value { + + var selected []uint8 + + v.EachUint8(func(index int, val uint8) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint8 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint8. +func (v *Value) GroupUint8(grouper func(int, uint8) string) *Value { + + groups := make(map[string][]uint8) + + v.EachUint8(func(index int, val uint8) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint8, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint8 uses the specified function to replace each uint8s +// by iterating each item. The data in the returned result will be a +// []uint8 containing the replaced items. +func (v *Value) ReplaceUint8(replacer func(int, uint8) uint8) *Value { + + arr := v.MustUint8Slice() + replaced := make([]uint8, len(arr)) + + v.EachUint8(func(index int, val uint8) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint8 uses the specified collector function to collect a value +// for each of the uint8s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint8(collector func(int, uint8) interface{}) *Value { + + arr := v.MustUint8Slice() + collected := make([]interface{}, len(arr)) + + v.EachUint8(func(index int, val uint8) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint16 (uint16 and []uint16) + -------------------------------------------------- +*/ + +// Uint16 gets the value as a uint16, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint16(optionalDefault ...uint16) uint16 { + if s, ok := v.data.(uint16); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint16 gets the value as a uint16. +// +// Panics if the object is not a uint16. +func (v *Value) MustUint16() uint16 { + return v.data.(uint16) +} + +// Uint16Slice gets the value as a []uint16, returns the optionalDefault +// value or nil if the value is not a []uint16. +func (v *Value) Uint16Slice(optionalDefault ...[]uint16) []uint16 { + if s, ok := v.data.([]uint16); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUint16Slice gets the value as a []uint16. +// +// Panics if the object is not a []uint16. +func (v *Value) MustUint16Slice() []uint16 { + return v.data.([]uint16) +} + +// IsUint16 gets whether the object contained is a uint16 or not. +func (v *Value) IsUint16() bool { + _, ok := v.data.(uint16) + return ok +} + +// IsUint16Slice gets whether the object contained is a []uint16 or not. +func (v *Value) IsUint16Slice() bool { + _, ok := v.data.([]uint16) + return ok +} + +// EachUint16 calls the specified callback for each object +// in the []uint16. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint16(callback func(int, uint16) bool) *Value { + + for index, val := range v.MustUint16Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint16 uses the specified decider function to select items +// from the []uint16. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint16(decider func(int, uint16) bool) *Value { + + var selected []uint16 + + v.EachUint16(func(index int, val uint16) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint16 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint16. +func (v *Value) GroupUint16(grouper func(int, uint16) string) *Value { + + groups := make(map[string][]uint16) + + v.EachUint16(func(index int, val uint16) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint16, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint16 uses the specified function to replace each uint16s +// by iterating each item. The data in the returned result will be a +// []uint16 containing the replaced items. +func (v *Value) ReplaceUint16(replacer func(int, uint16) uint16) *Value { + + arr := v.MustUint16Slice() + replaced := make([]uint16, len(arr)) + + v.EachUint16(func(index int, val uint16) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint16 uses the specified collector function to collect a value +// for each of the uint16s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint16(collector func(int, uint16) interface{}) *Value { + + arr := v.MustUint16Slice() + collected := make([]interface{}, len(arr)) + + v.EachUint16(func(index int, val uint16) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint32 (uint32 and []uint32) + -------------------------------------------------- +*/ + +// Uint32 gets the value as a uint32, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint32(optionalDefault ...uint32) uint32 { + if s, ok := v.data.(uint32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint32 gets the value as a uint32. +// +// Panics if the object is not a uint32. +func (v *Value) MustUint32() uint32 { + return v.data.(uint32) +} + +// Uint32Slice gets the value as a []uint32, returns the optionalDefault +// value or nil if the value is not a []uint32. +func (v *Value) Uint32Slice(optionalDefault ...[]uint32) []uint32 { + if s, ok := v.data.([]uint32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUint32Slice gets the value as a []uint32. +// +// Panics if the object is not a []uint32. +func (v *Value) MustUint32Slice() []uint32 { + return v.data.([]uint32) +} + +// IsUint32 gets whether the object contained is a uint32 or not. +func (v *Value) IsUint32() bool { + _, ok := v.data.(uint32) + return ok +} + +// IsUint32Slice gets whether the object contained is a []uint32 or not. +func (v *Value) IsUint32Slice() bool { + _, ok := v.data.([]uint32) + return ok +} + +// EachUint32 calls the specified callback for each object +// in the []uint32. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint32(callback func(int, uint32) bool) *Value { + + for index, val := range v.MustUint32Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint32 uses the specified decider function to select items +// from the []uint32. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint32(decider func(int, uint32) bool) *Value { + + var selected []uint32 + + v.EachUint32(func(index int, val uint32) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint32 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint32. +func (v *Value) GroupUint32(grouper func(int, uint32) string) *Value { + + groups := make(map[string][]uint32) + + v.EachUint32(func(index int, val uint32) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint32, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint32 uses the specified function to replace each uint32s +// by iterating each item. The data in the returned result will be a +// []uint32 containing the replaced items. +func (v *Value) ReplaceUint32(replacer func(int, uint32) uint32) *Value { + + arr := v.MustUint32Slice() + replaced := make([]uint32, len(arr)) + + v.EachUint32(func(index int, val uint32) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint32 uses the specified collector function to collect a value +// for each of the uint32s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint32(collector func(int, uint32) interface{}) *Value { + + arr := v.MustUint32Slice() + collected := make([]interface{}, len(arr)) + + v.EachUint32(func(index int, val uint32) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uint64 (uint64 and []uint64) + -------------------------------------------------- +*/ + +// Uint64 gets the value as a uint64, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uint64(optionalDefault ...uint64) uint64 { + if s, ok := v.data.(uint64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUint64 gets the value as a uint64. +// +// Panics if the object is not a uint64. +func (v *Value) MustUint64() uint64 { + return v.data.(uint64) +} + +// Uint64Slice gets the value as a []uint64, returns the optionalDefault +// value or nil if the value is not a []uint64. +func (v *Value) Uint64Slice(optionalDefault ...[]uint64) []uint64 { + if s, ok := v.data.([]uint64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUint64Slice gets the value as a []uint64. +// +// Panics if the object is not a []uint64. +func (v *Value) MustUint64Slice() []uint64 { + return v.data.([]uint64) +} + +// IsUint64 gets whether the object contained is a uint64 or not. +func (v *Value) IsUint64() bool { + _, ok := v.data.(uint64) + return ok +} + +// IsUint64Slice gets whether the object contained is a []uint64 or not. +func (v *Value) IsUint64Slice() bool { + _, ok := v.data.([]uint64) + return ok +} + +// EachUint64 calls the specified callback for each object +// in the []uint64. +// +// Panics if the object is the wrong type. +func (v *Value) EachUint64(callback func(int, uint64) bool) *Value { + + for index, val := range v.MustUint64Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUint64 uses the specified decider function to select items +// from the []uint64. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUint64(decider func(int, uint64) bool) *Value { + + var selected []uint64 + + v.EachUint64(func(index int, val uint64) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUint64 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uint64. +func (v *Value) GroupUint64(grouper func(int, uint64) string) *Value { + + groups := make(map[string][]uint64) + + v.EachUint64(func(index int, val uint64) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uint64, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUint64 uses the specified function to replace each uint64s +// by iterating each item. The data in the returned result will be a +// []uint64 containing the replaced items. +func (v *Value) ReplaceUint64(replacer func(int, uint64) uint64) *Value { + + arr := v.MustUint64Slice() + replaced := make([]uint64, len(arr)) + + v.EachUint64(func(index int, val uint64) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUint64 uses the specified collector function to collect a value +// for each of the uint64s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUint64(collector func(int, uint64) interface{}) *Value { + + arr := v.MustUint64Slice() + collected := make([]interface{}, len(arr)) + + v.EachUint64(func(index int, val uint64) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Uintptr (uintptr and []uintptr) + -------------------------------------------------- +*/ + +// Uintptr gets the value as a uintptr, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Uintptr(optionalDefault ...uintptr) uintptr { + if s, ok := v.data.(uintptr); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustUintptr gets the value as a uintptr. +// +// Panics if the object is not a uintptr. +func (v *Value) MustUintptr() uintptr { + return v.data.(uintptr) +} + +// UintptrSlice gets the value as a []uintptr, returns the optionalDefault +// value or nil if the value is not a []uintptr. +func (v *Value) UintptrSlice(optionalDefault ...[]uintptr) []uintptr { + if s, ok := v.data.([]uintptr); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustUintptrSlice gets the value as a []uintptr. +// +// Panics if the object is not a []uintptr. +func (v *Value) MustUintptrSlice() []uintptr { + return v.data.([]uintptr) +} + +// IsUintptr gets whether the object contained is a uintptr or not. +func (v *Value) IsUintptr() bool { + _, ok := v.data.(uintptr) + return ok +} + +// IsUintptrSlice gets whether the object contained is a []uintptr or not. +func (v *Value) IsUintptrSlice() bool { + _, ok := v.data.([]uintptr) + return ok +} + +// EachUintptr calls the specified callback for each object +// in the []uintptr. +// +// Panics if the object is the wrong type. +func (v *Value) EachUintptr(callback func(int, uintptr) bool) *Value { + + for index, val := range v.MustUintptrSlice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereUintptr uses the specified decider function to select items +// from the []uintptr. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereUintptr(decider func(int, uintptr) bool) *Value { + + var selected []uintptr + + v.EachUintptr(func(index int, val uintptr) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupUintptr uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]uintptr. +func (v *Value) GroupUintptr(grouper func(int, uintptr) string) *Value { + + groups := make(map[string][]uintptr) + + v.EachUintptr(func(index int, val uintptr) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]uintptr, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceUintptr uses the specified function to replace each uintptrs +// by iterating each item. The data in the returned result will be a +// []uintptr containing the replaced items. +func (v *Value) ReplaceUintptr(replacer func(int, uintptr) uintptr) *Value { + + arr := v.MustUintptrSlice() + replaced := make([]uintptr, len(arr)) + + v.EachUintptr(func(index int, val uintptr) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectUintptr uses the specified collector function to collect a value +// for each of the uintptrs in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectUintptr(collector func(int, uintptr) interface{}) *Value { + + arr := v.MustUintptrSlice() + collected := make([]interface{}, len(arr)) + + v.EachUintptr(func(index int, val uintptr) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Float32 (float32 and []float32) + -------------------------------------------------- +*/ + +// Float32 gets the value as a float32, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Float32(optionalDefault ...float32) float32 { + if s, ok := v.data.(float32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustFloat32 gets the value as a float32. +// +// Panics if the object is not a float32. +func (v *Value) MustFloat32() float32 { + return v.data.(float32) +} + +// Float32Slice gets the value as a []float32, returns the optionalDefault +// value or nil if the value is not a []float32. +func (v *Value) Float32Slice(optionalDefault ...[]float32) []float32 { + if s, ok := v.data.([]float32); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustFloat32Slice gets the value as a []float32. +// +// Panics if the object is not a []float32. +func (v *Value) MustFloat32Slice() []float32 { + return v.data.([]float32) +} + +// IsFloat32 gets whether the object contained is a float32 or not. +func (v *Value) IsFloat32() bool { + _, ok := v.data.(float32) + return ok +} + +// IsFloat32Slice gets whether the object contained is a []float32 or not. +func (v *Value) IsFloat32Slice() bool { + _, ok := v.data.([]float32) + return ok +} + +// EachFloat32 calls the specified callback for each object +// in the []float32. +// +// Panics if the object is the wrong type. +func (v *Value) EachFloat32(callback func(int, float32) bool) *Value { + + for index, val := range v.MustFloat32Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereFloat32 uses the specified decider function to select items +// from the []float32. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereFloat32(decider func(int, float32) bool) *Value { + + var selected []float32 + + v.EachFloat32(func(index int, val float32) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupFloat32 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]float32. +func (v *Value) GroupFloat32(grouper func(int, float32) string) *Value { + + groups := make(map[string][]float32) + + v.EachFloat32(func(index int, val float32) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]float32, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceFloat32 uses the specified function to replace each float32s +// by iterating each item. The data in the returned result will be a +// []float32 containing the replaced items. +func (v *Value) ReplaceFloat32(replacer func(int, float32) float32) *Value { + + arr := v.MustFloat32Slice() + replaced := make([]float32, len(arr)) + + v.EachFloat32(func(index int, val float32) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectFloat32 uses the specified collector function to collect a value +// for each of the float32s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectFloat32(collector func(int, float32) interface{}) *Value { + + arr := v.MustFloat32Slice() + collected := make([]interface{}, len(arr)) + + v.EachFloat32(func(index int, val float32) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Float64 (float64 and []float64) + -------------------------------------------------- +*/ + +// Float64 gets the value as a float64, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Float64(optionalDefault ...float64) float64 { + if s, ok := v.data.(float64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustFloat64 gets the value as a float64. +// +// Panics if the object is not a float64. +func (v *Value) MustFloat64() float64 { + return v.data.(float64) +} + +// Float64Slice gets the value as a []float64, returns the optionalDefault +// value or nil if the value is not a []float64. +func (v *Value) Float64Slice(optionalDefault ...[]float64) []float64 { + if s, ok := v.data.([]float64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustFloat64Slice gets the value as a []float64. +// +// Panics if the object is not a []float64. +func (v *Value) MustFloat64Slice() []float64 { + return v.data.([]float64) +} + +// IsFloat64 gets whether the object contained is a float64 or not. +func (v *Value) IsFloat64() bool { + _, ok := v.data.(float64) + return ok +} + +// IsFloat64Slice gets whether the object contained is a []float64 or not. +func (v *Value) IsFloat64Slice() bool { + _, ok := v.data.([]float64) + return ok +} + +// EachFloat64 calls the specified callback for each object +// in the []float64. +// +// Panics if the object is the wrong type. +func (v *Value) EachFloat64(callback func(int, float64) bool) *Value { + + for index, val := range v.MustFloat64Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereFloat64 uses the specified decider function to select items +// from the []float64. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereFloat64(decider func(int, float64) bool) *Value { + + var selected []float64 + + v.EachFloat64(func(index int, val float64) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupFloat64 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]float64. +func (v *Value) GroupFloat64(grouper func(int, float64) string) *Value { + + groups := make(map[string][]float64) + + v.EachFloat64(func(index int, val float64) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]float64, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceFloat64 uses the specified function to replace each float64s +// by iterating each item. The data in the returned result will be a +// []float64 containing the replaced items. +func (v *Value) ReplaceFloat64(replacer func(int, float64) float64) *Value { + + arr := v.MustFloat64Slice() + replaced := make([]float64, len(arr)) + + v.EachFloat64(func(index int, val float64) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectFloat64 uses the specified collector function to collect a value +// for each of the float64s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectFloat64(collector func(int, float64) interface{}) *Value { + + arr := v.MustFloat64Slice() + collected := make([]interface{}, len(arr)) + + v.EachFloat64(func(index int, val float64) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Complex64 (complex64 and []complex64) + -------------------------------------------------- +*/ + +// Complex64 gets the value as a complex64, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Complex64(optionalDefault ...complex64) complex64 { + if s, ok := v.data.(complex64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustComplex64 gets the value as a complex64. +// +// Panics if the object is not a complex64. +func (v *Value) MustComplex64() complex64 { + return v.data.(complex64) +} + +// Complex64Slice gets the value as a []complex64, returns the optionalDefault +// value or nil if the value is not a []complex64. +func (v *Value) Complex64Slice(optionalDefault ...[]complex64) []complex64 { + if s, ok := v.data.([]complex64); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustComplex64Slice gets the value as a []complex64. +// +// Panics if the object is not a []complex64. +func (v *Value) MustComplex64Slice() []complex64 { + return v.data.([]complex64) +} + +// IsComplex64 gets whether the object contained is a complex64 or not. +func (v *Value) IsComplex64() bool { + _, ok := v.data.(complex64) + return ok +} + +// IsComplex64Slice gets whether the object contained is a []complex64 or not. +func (v *Value) IsComplex64Slice() bool { + _, ok := v.data.([]complex64) + return ok +} + +// EachComplex64 calls the specified callback for each object +// in the []complex64. +// +// Panics if the object is the wrong type. +func (v *Value) EachComplex64(callback func(int, complex64) bool) *Value { + + for index, val := range v.MustComplex64Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereComplex64 uses the specified decider function to select items +// from the []complex64. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereComplex64(decider func(int, complex64) bool) *Value { + + var selected []complex64 + + v.EachComplex64(func(index int, val complex64) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupComplex64 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]complex64. +func (v *Value) GroupComplex64(grouper func(int, complex64) string) *Value { + + groups := make(map[string][]complex64) + + v.EachComplex64(func(index int, val complex64) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]complex64, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceComplex64 uses the specified function to replace each complex64s +// by iterating each item. The data in the returned result will be a +// []complex64 containing the replaced items. +func (v *Value) ReplaceComplex64(replacer func(int, complex64) complex64) *Value { + + arr := v.MustComplex64Slice() + replaced := make([]complex64, len(arr)) + + v.EachComplex64(func(index int, val complex64) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectComplex64 uses the specified collector function to collect a value +// for each of the complex64s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectComplex64(collector func(int, complex64) interface{}) *Value { + + arr := v.MustComplex64Slice() + collected := make([]interface{}, len(arr)) + + v.EachComplex64(func(index int, val complex64) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} + +/* + Complex128 (complex128 and []complex128) + -------------------------------------------------- +*/ + +// Complex128 gets the value as a complex128, returns the optionalDefault +// value or a system default object if the value is the wrong type. +func (v *Value) Complex128(optionalDefault ...complex128) complex128 { + if s, ok := v.data.(complex128); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return 0 +} + +// MustComplex128 gets the value as a complex128. +// +// Panics if the object is not a complex128. +func (v *Value) MustComplex128() complex128 { + return v.data.(complex128) +} + +// Complex128Slice gets the value as a []complex128, returns the optionalDefault +// value or nil if the value is not a []complex128. +func (v *Value) Complex128Slice(optionalDefault ...[]complex128) []complex128 { + if s, ok := v.data.([]complex128); ok { + return s + } + if len(optionalDefault) == 1 { + return optionalDefault[0] + } + return nil +} + +// MustComplex128Slice gets the value as a []complex128. +// +// Panics if the object is not a []complex128. +func (v *Value) MustComplex128Slice() []complex128 { + return v.data.([]complex128) +} + +// IsComplex128 gets whether the object contained is a complex128 or not. +func (v *Value) IsComplex128() bool { + _, ok := v.data.(complex128) + return ok +} + +// IsComplex128Slice gets whether the object contained is a []complex128 or not. +func (v *Value) IsComplex128Slice() bool { + _, ok := v.data.([]complex128) + return ok +} + +// EachComplex128 calls the specified callback for each object +// in the []complex128. +// +// Panics if the object is the wrong type. +func (v *Value) EachComplex128(callback func(int, complex128) bool) *Value { + + for index, val := range v.MustComplex128Slice() { + carryon := callback(index, val) + if carryon == false { + break + } + } + + return v + +} + +// WhereComplex128 uses the specified decider function to select items +// from the []complex128. The object contained in the result will contain +// only the selected items. +func (v *Value) WhereComplex128(decider func(int, complex128) bool) *Value { + + var selected []complex128 + + v.EachComplex128(func(index int, val complex128) bool { + shouldSelect := decider(index, val) + if shouldSelect == false { + selected = append(selected, val) + } + return true + }) + + return &Value{data: selected} + +} + +// GroupComplex128 uses the specified grouper function to group the items +// keyed by the return of the grouper. The object contained in the +// result will contain a map[string][]complex128. +func (v *Value) GroupComplex128(grouper func(int, complex128) string) *Value { + + groups := make(map[string][]complex128) + + v.EachComplex128(func(index int, val complex128) bool { + group := grouper(index, val) + if _, ok := groups[group]; !ok { + groups[group] = make([]complex128, 0) + } + groups[group] = append(groups[group], val) + return true + }) + + return &Value{data: groups} + +} + +// ReplaceComplex128 uses the specified function to replace each complex128s +// by iterating each item. The data in the returned result will be a +// []complex128 containing the replaced items. +func (v *Value) ReplaceComplex128(replacer func(int, complex128) complex128) *Value { + + arr := v.MustComplex128Slice() + replaced := make([]complex128, len(arr)) + + v.EachComplex128(func(index int, val complex128) bool { + replaced[index] = replacer(index, val) + return true + }) + + return &Value{data: replaced} + +} + +// CollectComplex128 uses the specified collector function to collect a value +// for each of the complex128s in the slice. The data returned will be a +// []interface{}. +func (v *Value) CollectComplex128(collector func(int, complex128) interface{}) *Value { + + arr := v.MustComplex128Slice() + collected := make([]interface{}, len(arr)) + + v.EachComplex128(func(index int, val complex128) bool { + collected[index] = collector(index, val) + return true + }) + + return &Value{data: collected} +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/value.go b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/value.go new file mode 100644 index 00000000..7aaef06b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/value.go @@ -0,0 +1,13 @@ +package objx + +// Value provides methods for extracting interface{} data in various +// types. +type Value struct { + // data contains the raw data being managed by this Value + data interface{} +} + +// Data returns the raw data contained by this Value +func (v *Value) Data() interface{} { + return v.data +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/AUTHORS b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/AUTHORS new file mode 100644 index 00000000..b25ba411 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/AUTHORS @@ -0,0 +1,40 @@ +AUTHORS AND MAINTAINERS: + +MAIN DEVELOPERS: +Graeme Connell + +AUTHORS: +Nigel Tao +Cole Mickens +Ben Daglish +Luis Martinez +Remco Verhoef +Hiroaki Kawai +Lukas Lueg +Laurent Hausermann + +CONTRIBUTORS: +Attila Oláh +Vittus Mikiassen +Matthias Radestock +Matthew Sackman +Loic Prylli +Alexandre Fiori + +----------------------------------------------- +FORKED FROM github.com/akrennmair/gopcap +ALL THE FOLLOWING ARE FOR THAT PROJECT + +MAIN DEVELOPERS: +Andreas Krennmair + +CONTRIBUTORS: +Andrea Nall +Daniel Arndt +Dustin Sallings +Graeme Connell +Guillaume Savary +Mark Smith +Miek Gieben +Mike Bell +Trevor Strohman diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/CHANGELOG b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/CHANGELOG new file mode 100644 index 00000000..6d771b85 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/CHANGELOG @@ -0,0 +1 @@ +See https://code.google.com/p/gopacket/wiki/ChangeLog diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/CONTRIBUTING.md b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/CONTRIBUTING.md new file mode 100644 index 00000000..d3cc6a0e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/CONTRIBUTING.md @@ -0,0 +1,233 @@ +Contributing To gopacket +======================== + +So you've got some code and you'd like it to be part of gopacket... wonderful! +We're happy to accept contributions, whether they're fixes to old protocols, new +protocols entirely, or anything else you think would improve the gopacket +library. This document is designed to help you to do just that. + +The first section deals with the plumbing: how to actually get a change +submitted. + +The second section deals with coding style... Go is great in that it +has a uniform style implemented by 'go fmt', but there's still some decisions +we've made that go above and beyond, and if you follow them, they won't come up +in your code review. + +The third section deals with some of the implementation decisions we've made, +which may help you to understand the current code and which we may ask you to +conform to (or provide compelling reasons for ignoring). + +Overall, we hope this document will help you to understand our system and write +great code which fits in, and help us to turn around on your code review quickly +so the code can make it into the master branch as quickly as possible. + + +How To Submit Code +------------------ + +gopacket uses the code.google.com Git version control system. If you want to +make a new change, you'll first have to get our code: + + go get code.google.com/p/gopacket + cd $GOROOT/src/pkg/code.google.com/p/gopacket + git checkout -b # create a new branch to work from + ... code code code ... + ./gc # Run this to do local commits, it performs a number of checks + ... code code code ... + ./gc --benchmark # Run this whenever your commit could affect performance + +Nw that you're in the gopacket code directory, you can start making your initial +change. PLEASE make sure you're using a new branch to develop whatever feature +you're working on. + +Once you've got your code to a place where you're ready to have us look at it, +send an email to gopacket@googlegroups.com, detailing your change. We'll add +you as a committer, and you can upload your feature branch to code.google.com. +From there, the other folks working on gopacket can give you code reviews with +the code.google.com code review functionality. + +The code review will generally be either emails or line-by-line reviews via +code.google.com. One or more folks might review your code. The review should +be considered "complete" when at least one of the project Owners (see +https://code.google.com/p/gopacket/people/list) gives you permission to merge to +master. At that point, you can merge to master yourself, or you can have one of +the other committers/owners do it for you. + +When doing the final merge, please try to capture any interesting comments or +discussions that came up in code review. This will help future contributors be +able to find and reference those discussions later on. + +To sum up: + +* DO + + Pull down the latest version. + + Make a feature-specific branch. + + Code using the style and methods discussed in the rest of this document. + + Use the ./gc command to do local commits. + + Send an email asking us to make you a committer (if you're new). + + Push your new feature branch up to code.google.com. + + Handle comments and requests from reviewers, pushing new commits up to + your feature branch as problems are addressed. + + Get approval from a project Owner to merge to master. + + Merge yourself, or have another Committer/Owner do it for you. + + Put interesting comments and discussions into commit comments. +* DON'T + + Push directly to master. + + Push to someone else's branch without their permission. + + Merge your own code to master without sign-off from others on the project. + + Rebase (please merge) +* OPTIONAL + + Review others' code as it comes in (politely :) + + Keep contributing! + + +Coding Style +------------ + +* Go code must be run through 'go fmt'. +* Follow http://golang.org/doc/effective_go.html as much as possible. + + In particular, http://golang.org/doc/effective_go.html#mixed-caps. Enums + should be be CamelCase, with acronyms capitalized (TCPSourcePort, vs. + TcpSourcePort or TCP_SOURCE_PORT). +* Bonus points for giving enum types a String() field. +* Any exported types or functions should have commentary + (http://golang.org/doc/effective_go.html#commentary) + + +Coding Methods And Implementation Notes +--------------------------------------- + +### Error Handling + +Many times, you'll be decoding a protocol and run across something bad, a packet +corruption or the like. How do you handle this? First off, ALWAYS report the +error. You can do this either by returning the error from the decode() function +(most common), or if you're up for it you can implement and add an ErrorLayer +through the packet builder (the first method is a simple shortcut that does +exactly this, then stops any future decoding). + +Often, you'll already have decode some part of your protocol by the time you hit +your error. Use your own discretion to determine whether the stuff you've +already decoded should be returned to the caller or not: + + func decodeMyProtocol(data []byte, p gopacket.PacketBuilder) error { + prot := &MyProtocol{} + if len(data) < 10 { + // This error occurred before we did ANYTHING, so there's nothing in my + // protocol that the caller could possibly want. Just return the error. + return fmt.Errorf("Length %d less than 10", len(data)) + } + prot.ImportantField1 = data[:5] + prot.ImportantField2 = data[5:10] + // At this point, we've already got enough information in 'prot' to + // warrant returning it to the caller, so we'll add it now. + p.AddLayer(prot) + if len(data) < 15 { + // We encountered an error later in the packet, but the caller already + // has the important info we've gleaned so far. + return fmt.Errorf("Length %d less than 15", len(data)) + } + prot.ImportantField3 = data[10:15] + return nil // We've already added the layer, we can just return success. + } + +In general, our code follows the approach of returning the first error it +encounters. In general, we don't trust any bytes after the first error we see. + +### What Is A Layer? + +The definition of a layer is up to the discretion of the coder. It should be +something important enough that it's actually useful to the caller (IE: every +TLV value should probably NOT be a layer). However, it can be more granular +than a single protocol... IPv6 and SCTP both implement many layers to handle the +various parts of the protocol. Use your best judgement, and prepare to defend +your decisions during code review. ;) + +### Performance + +We strive to make gopacket as fast as possible while still providing lots of +features. In general, this means: + +* Focus performance tuning on common protocols (IP4/6, TCP, etc), and optimize + others on an as-needed basis (tons of MPLS on your network? Time to optimize + MPLS!) +* Use fast operations. See the toplevel benchmark_test for benchmarks of some + of Go's underlying features and types. +* Test your performance changes! You should use the ./gc script's --benchmark + flag to submit any performance-related changes. Use pcap/gopacket_benchmark + to test your change against a PCAP file based on your traffic patterns. +* Don't be TOO hacky. Sometimes, removing an unused struct from a field causes + a huge performance hit, due to the way that Go currently handles its segmented + stack... don't be afraid to clean it up anyway. We'll trust the Go compiler + to get good enough over time to handle this. Also, this type of + compiler-specific optimization is very fragile; someone adding a field to an + entirely different struct elsewhere in the codebase could reverse any gains + you might achieve by aligning your allocations. +* Try to minimize memory allocations. If possible, use []byte to reference + pieces of the input, instead of using string, which requires copying the bytes + into a new memory allocation. +* Think hard about what should be evaluated lazily vs. not. In general, a + layer's struct should almost exactly mirror the layer's frame. Anything + that's more interesting should be a function. This may not always be + possible, but it's a good rule of thumb. +* Don't fear micro-optimizations. With the above in mind, we welcome + micro-optimizations that we think will have positive/neutral impacts on the + majority of workloads. A prime example of this is pre-allocating certain + structs within a larger one: + + type MyProtocol struct { + // Most packets have 1-4 of VeryCommon, so we preallocate it here. + initialAllocation [4]uint32 + VeryCommon []uint32 + } + + func decodeMyProtocol(data []byte, p gopacket.PacketBuilder) error { + prot := &MyProtocol{} + prot.VeryCommon = proto.initialAllocation[:0] + for len(data) > 4 { + field := binary.BigEndian.Uint32(data[:4]) + data = data[4:] + // Since we're using the underlying initialAllocation, we won't need to + // allocate new memory for the following append unless we more than 16 + // bytes of data, which should be the uncommon case. + prot.VeryCommon = append(prot.VeryCommon, field) + } + p.AddLayer(prot) + if len(data) > 0 { + return fmt.Errorf("MyProtocol packet has %d bytes left after decoding", len(data)) + } + return nil + } + +### Slices And Data + +If you're pulling a slice from the data you're decoding, don't copy it. Just +use the slice itself. + + type MyProtocol struct { + A, B net.IP + } + func decodeMyProtocol(data []byte, p gopacket.PacketBuilder) error { + p.AddLayer(&MyProtocol{ + A: data[:4], + B: data[4:8], + }) + return nil + } + +The caller has already agreed, by using this library, that they won't modify the +set of bytes they pass in to the decoder, or the library has already copied the +set of bytes to a read-only location. See DecodeOptions.NoCopy for more +information. + +### Enums/Types + +If a protocol has an integer field (uint8, uint16, etc) with a couple of known +values that mean something special, make it a type. This allows us to do really +nice things like adding a String() function to them, so we can more easily +display those to users. Check out layers/enums.go for one example, as well as +layers/icmp.go for layer-specific enums. + +When naming things, try for descriptiveness over suscinctness. For example, +choose DNSResponseRecord over DNSRR. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/LICENSE b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/LICENSE new file mode 100644 index 00000000..2100d524 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2012 Google, Inc. All rights reserved. +Copyright (c) 2009-2011 Andreas Krennmair. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Andreas Krennmair, Google, nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/README.mkd b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/README.mkd new file mode 100644 index 00000000..d2195197 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/README.mkd @@ -0,0 +1,7 @@ +# GoPacket + +This library provides packet decoding capabilities for Go. +See doc.go for more details. + +Originally forked from the gopcap project written by Andreas +Krennmair (http://github.com/akrennmair/gopcap). diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/afpacket.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/afpacket.go new file mode 100644 index 00000000..ed0c5ce7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/afpacket.go @@ -0,0 +1,377 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// +build linux + +// Package afpacket provides Go bindings for MMap'd AF_PACKET socket reading. +package afpacket + +// Couldn't have done this without: +// http://lxr.free-electrons.com/source/Documentation/networking/packet_mmap.txt +// http://codemonkeytips.blogspot.co.uk/2011/07/asynchronous-packet-socket-reading-with.html + +import ( + "errors" + "fmt" + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/layers" + "github.com/tsg/gopacket/pcap" + "net" + "runtime" + "sync" + "time" + "unsafe" +) + +/* +#include "if_packet.h" // AF_PACKET, sockaddr_ll +#include // ETH_P_ALL +#include // socket() +#include // close() +#include // htons() +#include // mmap(), munmap() +#include // poll() +*/ +import "C" + +var pageSize = int(C.getpagesize()) +var tpacketAlignment = uint(C.TPACKET_ALIGNMENT) + +func tpacketAlign(v int) int { + return int((uint(v) + tpacketAlignment - 1) & ((^tpacketAlignment) - 1)) +} + +// Stats is a set of counters detailing the work TPacket has done so far. +type Stats struct { + // Packets is the total number of packets returned to the caller. + Packets int64 + // Polls is the number of blocking syscalls made waiting for packets. + // This should always be <= Packets, since with TPacket one syscall + // can (and often does) return many results. + Polls int64 +} + +type TPacket struct { + // fd is the C file descriptor. + fd C.int + // ring points to the memory space of the ring buffer shared by tpacket and the kernel. + ring unsafe.Pointer + // opts contains read-only options for the TPacket object. + opts options + mu sync.Mutex // guards below + // offset is the offset into the ring of the current header. + offset int + // current is the current header. + current header + // pollset is used by TPacket for its poll() call. + pollset C.struct_pollfd + // shouldReleasePacket is set to true whenever we return packet data, to make sure we remember to release that data back to the kernel. + shouldReleasePacket bool + // stats is simple statistics on TPacket's run. + stats Stats + // tpVersion is the version of TPacket actually in use, set by setRequestedTPacketVersion. + tpVersion OptTPacketVersion + // Hackity hack hack hack. We need to return a pointer to the header with + // getTPacketHeader, and we don't want to allocate a v3wrapper every time, + // so we leave it in the TPacket object and return a pointer to it. + v3 v3wrapper +} + +// bindToInterface binds the TPacket socket to a particular named interface. +func (h *TPacket) bindToInterface(ifaceName string) error { + iface, err := net.InterfaceByName(ifaceName) + if err != nil { + return fmt.Errorf("InterfaceByName: %v", err) + } + var ll C.struct_sockaddr_ll + ll.sll_family = C.AF_PACKET + ll.sll_protocol = C.__be16(C.htons(C.ETH_P_ALL)) + ll.sll_ifindex = C.int(iface.Index) + if _, err := C.bind(h.fd, (*C.struct_sockaddr)(unsafe.Pointer(&ll)), C.socklen_t(unsafe.Sizeof(ll))); err != nil { + return fmt.Errorf("bindToInterface: %v", err) + } + return nil +} + +// setTPacketVersion asks the kernel to set TPacket to a particular version, and returns an error on failure. +func (h *TPacket) setTPacketVersion(version OptTPacketVersion) error { + val := C.int(version) + _, err := C.setsockopt(h.fd, C.SOL_PACKET, C.PACKET_VERSION, unsafe.Pointer(&val), C.socklen_t(unsafe.Sizeof(val))) + if err != nil { + return fmt.Errorf("setsockopt packet_version: %v", err) + } + return nil +} + +// setRequestedTPacketVersion tries to set TPacket to the requested version or versions. +func (h *TPacket) setRequestedTPacketVersion() error { + switch { + case (h.opts.version == TPacketVersionHighestAvailable || h.opts.version == TPacketVersion3) && h.setTPacketVersion(TPacketVersion3) == nil: + h.tpVersion = TPacketVersion3 + case (h.opts.version == TPacketVersionHighestAvailable || h.opts.version == TPacketVersion2) && h.setTPacketVersion(TPacketVersion2) == nil: + h.tpVersion = TPacketVersion2 + case (h.opts.version == TPacketVersionHighestAvailable || h.opts.version == TPacketVersion1) && h.setTPacketVersion(TPacketVersion1) == nil: + h.tpVersion = TPacketVersion1 + default: + return errors.New("no known tpacket versions work on this machine") + } + return nil +} + +// setUpRing sets up the shared-memory ring buffer between the user process and the kernel. +func (h *TPacket) setUpRing() (err error) { + totalSize := C.uint(h.opts.framesPerBlock * h.opts.numBlocks * h.opts.frameSize) + switch h.tpVersion { + case TPacketVersion1, TPacketVersion2: + var tp C.struct_tpacket_req + tp.tp_block_size = C.uint(h.opts.blockSize) + tp.tp_block_nr = C.uint(h.opts.numBlocks) + tp.tp_frame_size = C.uint(h.opts.frameSize) + tp.tp_frame_nr = C.uint(h.opts.framesPerBlock * h.opts.numBlocks) + if _, err := C.setsockopt(h.fd, C.SOL_PACKET, C.PACKET_RX_RING, unsafe.Pointer(&tp), C.socklen_t(unsafe.Sizeof(tp))); err != nil { + return fmt.Errorf("setsockopt packet_rx_ring: %v", err) + } + case TPacketVersion3: + var tp C.struct_tpacket_req3 + tp.tp_block_size = C.uint(h.opts.blockSize) + tp.tp_block_nr = C.uint(h.opts.numBlocks) + tp.tp_frame_size = C.uint(h.opts.frameSize) + tp.tp_frame_nr = C.uint(h.opts.framesPerBlock * h.opts.numBlocks) + tp.tp_retire_blk_tov = C.uint(h.opts.blockTimeout / time.Millisecond) + if _, err := C.setsockopt(h.fd, C.SOL_PACKET, C.PACKET_RX_RING, unsafe.Pointer(&tp), C.socklen_t(unsafe.Sizeof(tp))); err != nil { + return fmt.Errorf("setsockopt packet_rx_ring v3: %v", err) + } + default: + return errors.New("invalid tpVersion") + } + if h.ring, err = C.mmap(nil, C.size_t(totalSize), C.PROT_READ|C.PROT_WRITE, C.MAP_SHARED, C.int(h.fd), 0); err != nil { + return + } + if h.ring == nil { + return errors.New("no ring") + } + return nil +} + +// Close cleans up the TPacket. It should not be used after the Close call. +func (h *TPacket) Close() { + if h.fd == -1 { + return // already closed. + } + if h.ring != nil { + C.munmap(h.ring, C.size_t(h.opts.blockSize*h.opts.numBlocks)) + } + h.ring = nil + C.close(h.fd) + h.fd = -1 + runtime.SetFinalizer(h, nil) +} + +// NewTPacket returns a new TPacket object for reading packets off the wire. +// Its behavior may be modified by passing in any/all of afpacket.Opt* to this +// function. +// If this function succeeds, the user should be sure to Close the returned +// TPacket when finished with it. +func NewTPacket(opts ...interface{}) (h *TPacket, err error) { + h = &TPacket{} + if h.opts, err = parseOptions(opts...); err != nil { + return nil, err + } + fd, err := C.socket(C.AF_PACKET, C.int(h.opts.socktype), C.int(C.htons(C.ETH_P_ALL))) + if err != nil { + return nil, err + } + h.fd = fd + if h.opts.iface != "" { + if err = h.bindToInterface(h.opts.iface); err != nil { + goto errlbl + } + } + if err = h.setRequestedTPacketVersion(); err != nil { + goto errlbl + } + if err = h.setUpRing(); err != nil { + goto errlbl + } + runtime.SetFinalizer(h, (*TPacket).Close) + return h, nil +errlbl: + h.Close() + return nil, err +} + +func (h *TPacket) releaseCurrentPacket() error { + h.current.clearStatus() + h.offset++ + h.shouldReleasePacket = false + return nil +} + +// ZeroCopyReadPacketData reads the next packet off the wire, and returns its data. +// The slice returned by ZeroCopyReadPacketData points to bytes owned by the +// TPacket. Each call to ZeroCopyReadPacketData invalidates any data previously +// returned by ZeroCopyReadPacketData. Care must be taken not to keep pointers +// to old bytes when using ZeroCopyReadPacketData... if you need to keep data past +// the next time you call ZeroCopyReadPacketData, use ReadPacketDataData, which copies +// the bytes into a new buffer for you. +// tp, _ := NewTPacket(...) +// data1, _, _ := tp.ZeroCopyReadPacketData() +// // do everything you want with data1 here, copying bytes out of it if you'd like to keep them around. +// data2, _, _ := tp.ZeroCopyReadPacketData() // invalidates bytes in data1 +func (h *TPacket) ZeroCopyReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) { + h.mu.Lock() + if h.current == nil || !h.current.next() { + if h.shouldReleasePacket { + h.releaseCurrentPacket() + } + h.current = h.getTPacketHeader() + if err = h.pollForFirstPacket(h.current); err != nil { + h.mu.Unlock() + return + } + } + data = h.current.getData() + ci.Timestamp = h.current.getTime() + ci.CaptureLength = len(data) + ci.Length = h.current.getLength() + h.stats.Packets++ + h.mu.Unlock() + return +} + +// Stats returns statistics on the packets the TPacket has seen so far. +func (h *TPacket) Stats() (Stats, error) { + h.mu.Lock() + defer h.mu.Unlock() + return h.stats, nil +} + +// ReadPacketDataTo reads packet data into a user-supplied buffer. +// This function reads up to the length of the passed-in slice. +// The number of bytes read into data will be returned in ci.CaptureLength, +// which is the minimum of the size of the passed-in buffer and the size of +// the captured packet. +func (h *TPacket) ReadPacketDataTo(data []byte) (ci gopacket.CaptureInfo, err error) { + var d []byte + d, ci, err = h.ZeroCopyReadPacketData() + if err != nil { + return + } + ci.CaptureLength = copy(data, d) + return +} + +// ReadPacketData reads the next packet, copies it into a new buffer, and returns +// that buffer. Since the buffer is allocated by ReadPacketData, it is safe for long-term +// use. This implements gopacket.PacketDataSource. +func (h *TPacket) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) { + var d []byte + d, ci, err = h.ZeroCopyReadPacketData() + if err != nil { + return + } + data = make([]byte, len(d)) + copy(data, d) + return +} + +func (h *TPacket) getTPacketHeader() header { + switch h.tpVersion { + case TPacketVersion1: + if h.offset >= h.opts.framesPerBlock*h.opts.numBlocks { + h.offset = 0 + } + position := uintptr(h.ring) + uintptr(h.opts.frameSize*h.offset) + return (*v1header)(unsafe.Pointer(position)) + case TPacketVersion2: + if h.offset >= h.opts.framesPerBlock*h.opts.numBlocks { + h.offset = 0 + } + position := uintptr(h.ring) + uintptr(h.opts.frameSize*h.offset) + return (*v2header)(unsafe.Pointer(position)) + case TPacketVersion3: + // TPacket3 uses each block to return values, instead of each frame. Hence we need to rotate when we hit #blocks, not #frames. + if h.offset >= h.opts.numBlocks { + h.offset = 0 + } + position := uintptr(h.ring) + uintptr(h.opts.frameSize*h.offset*h.opts.framesPerBlock) + h.v3 = initV3Wrapper(unsafe.Pointer(position)) + return &h.v3 + } + panic("handle tpacket version is invalid") +} + +func (h *TPacket) pollForFirstPacket(hdr header) error { + for hdr.getStatus()&C.TP_STATUS_USER == 0 { + h.pollset.fd = h.fd + h.pollset.events = C.POLLIN + h.pollset.revents = 0 + timeout := C.int(h.opts.timeout / time.Millisecond) + _, err := C.poll(&h.pollset, 1, timeout) + h.stats.Polls++ + if err != nil { + return err + } + } + h.shouldReleasePacket = true + return nil +} + +// FanoutType determines the type of fanout to use with a TPacket SetFanout call. +type FanoutType int + +const ( + FanoutHash FanoutType = 0 + // It appears that defrag only works with FanoutHash, see: + // http://lxr.free-electrons.com/source/net/packet/af_packet.c#L1204 + FanoutHashWithDefrag FanoutType = 0x8000 + FanoutLoadBalance FanoutType = 1 + FanoutCPU FanoutType = 2 +) + +// SetFanout activates TPacket's fanout ability. +// Use of Fanout requires creating multiple TPacket objects and the same id/type to +// a SetFanout call on each. Note that this can be done cross-process, so if two +// different processes both call SetFanout with the same type/id, they'll share +// packets between them. The same should work for multiple TPacket objects within +// the same process. +func (h *TPacket) SetFanout(t FanoutType, id uint16) error { + h.mu.Lock() + defer h.mu.Unlock() + arg := C.int(t) << 16 + arg |= C.int(id) + _, err := C.setsockopt(h.fd, C.SOL_PACKET, C.PACKET_FANOUT, unsafe.Pointer(&arg), C.socklen_t(unsafe.Sizeof(arg))) + return err +} + +// WritePacketData transmits a raw packet. +func (h *TPacket) WritePacketData(pkt []byte) error { + _, err := C.write(h.fd, unsafe.Pointer(&pkt[0]), C.size_t(len(pkt))) + return err +} + +// SetBPFFilter compiles and sets a BPF filter for the TPacket handle. +func (h *TPacket) SetBPFFilter(expr string) (err error) { + // Open a dummy pcap handle + p, err := pcap.OpenDead(layers.LinkTypeEthernet, int32(h.opts.frameSize)) + if err != nil { + return fmt.Errorf("OpenDead: %s", err) + } + + bpf, err := p.NewBPF(expr) + if err != nil { + return fmt.Errorf("NewBPF: %s", err) + } + + program := bpf.BPF() + + _, err = C.setsockopt(h.fd, C.SOL_SOCKET, C.SO_ATTACH_FILTER, + unsafe.Pointer(&program), C.socklen_t(unsafe.Sizeof(program))) + if err != nil { + return fmt.Errorf("setsockopt: %s", err) + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/header.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/header.go new file mode 100644 index 00000000..1a7f3e5e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/header.go @@ -0,0 +1,137 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// +build linux + +package afpacket + +import ( + "reflect" + "time" + "unsafe" +) + +// #include "if_packet.h" +import "C" + +// Our model of handling all TPacket versions is a little hacky, to say the +// least. We use the header interface to handle interactions with the +// tpacket1/tpacket2 packet header AND the tpacket3 block header. The big +// difference is that tpacket3's block header implements the next() call to get +// the next packet within the block, while v1/v2 just always return false. + +type header interface { + // getStatus returns the TPacket status of the current header. + getStatus() int + // clearStatus clears the status of the current header, releasing its + // underlying data back to the kernel for future use with new packets. + // Using the header after calling clearStatus is an error. clearStatus + // should only be called after next() returns false. + clearStatus() + // getTime returns the timestamp for the current packet pointed to by + // the header. + getTime() time.Time + // getData returns the packet data pointed to by the current header. + getData() []byte + // getLength returns the total length of the packet. + getLength() int + // next moves this header to point to the next packet it contains, + // returning true on success (in which case getTime and getData will + // return values for the new packet) or false if there are no more + // packets (in which case clearStatus should be called). + next() bool +} + +type v1header C.struct_tpacket_hdr +type v2header C.struct_tpacket2_hdr + +func makeSlice(start uintptr, length int) (data []byte) { + slice := (*reflect.SliceHeader)(unsafe.Pointer(&data)) + slice.Data = start + slice.Len = length + slice.Cap = length + return +} + +func (h *v1header) getStatus() int { + return int(h.tp_status) +} +func (h *v1header) clearStatus() { + h.tp_status = 0 +} +func (h *v1header) getTime() time.Time { + return time.Unix(int64(h.tp_sec), int64(h.tp_usec)*1000) +} +func (h *v1header) getData() []byte { + return makeSlice(uintptr(unsafe.Pointer(h))+uintptr(h.tp_mac), int(h.tp_snaplen)) +} +func (h *v1header) getLength() int { + return int(h.tp_len) +} +func (h *v1header) next() bool { + return false +} +func (h *v2header) getStatus() int { + return int(h.tp_status) +} +func (h *v2header) clearStatus() { + h.tp_status = 0 +} +func (h *v2header) getTime() time.Time { + return time.Unix(int64(h.tp_sec), int64(h.tp_nsec)) +} +func (h *v2header) getData() []byte { + return makeSlice(uintptr(unsafe.Pointer(h))+uintptr(h.tp_mac), int(h.tp_snaplen)) +} +func (h *v2header) getLength() int { + return int(h.tp_len) +} +func (h *v2header) next() bool { + return false +} + +type v3wrapper struct { + block *C.struct_tpacket_block_desc + blockhdr *C.struct_tpacket_hdr_v1 + packet *C.struct_tpacket3_hdr + used C.__u32 +} + +func initV3Wrapper(block unsafe.Pointer) (w v3wrapper) { + w.block = (*C.struct_tpacket_block_desc)(block) + w.blockhdr = (*C.struct_tpacket_hdr_v1)(unsafe.Pointer(&w.block.hdr[0])) + w.packet = (*C.struct_tpacket3_hdr)(unsafe.Pointer(uintptr(block) + uintptr(w.blockhdr.offset_to_first_pkt))) + return +} +func (w *v3wrapper) getStatus() int { + return int(w.blockhdr.block_status) +} +func (w *v3wrapper) clearStatus() { + w.blockhdr.block_status = 0 +} +func (w *v3wrapper) getTime() time.Time { + return time.Unix(int64(w.packet.tp_sec), int64(w.packet.tp_nsec)) +} +func (w *v3wrapper) getData() []byte { + return makeSlice(uintptr(unsafe.Pointer(w.packet))+uintptr(w.packet.tp_mac), int(w.packet.tp_snaplen)) +} +func (w *v3wrapper) getLength() int { + return int(w.packet.tp_len) +} +func (w *v3wrapper) next() bool { + w.used++ + if w.used >= w.blockhdr.num_pkts { + return false + } + next := uintptr(unsafe.Pointer(w.packet)) + if w.packet.tp_next_offset != 0 { + next += uintptr(w.packet.tp_next_offset) + } else { + next += uintptr(tpacketAlign(int(w.packet.tp_snaplen) + int(w.packet.tp_mac))) + } + w.packet = (*C.struct_tpacket3_hdr)(unsafe.Pointer(next)) + return true +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/if_packet.h b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/if_packet.h new file mode 100644 index 00000000..263401d1 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/if_packet.h @@ -0,0 +1,282 @@ +#ifndef __LINUX_IF_PACKET_H +#define __LINUX_IF_PACKET_H + +/* + This is the /usr/linux/if_packet.h file, imported here to make + the compilation on CentOS 6 easier. + */ + +#include + +struct sockaddr_pkt { + unsigned short spkt_family; + unsigned char spkt_device[14]; + __be16 spkt_protocol; +}; + +struct sockaddr_ll { + unsigned short sll_family; + __be16 sll_protocol; + int sll_ifindex; + unsigned short sll_hatype; + unsigned char sll_pkttype; + unsigned char sll_halen; + unsigned char sll_addr[8]; +}; + +/* Packet types */ + +#define PACKET_HOST 0 /* To us */ +#define PACKET_BROADCAST 1 /* To all */ +#define PACKET_MULTICAST 2 /* To group */ +#define PACKET_OTHERHOST 3 /* To someone else */ +#define PACKET_OUTGOING 4 /* Outgoing of any type */ +/* These ones are invisible by user level */ +#define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */ +#define PACKET_FASTROUTE 6 /* Fastrouted frame */ + +/* Packet socket options */ + +#define PACKET_ADD_MEMBERSHIP 1 +#define PACKET_DROP_MEMBERSHIP 2 +#define PACKET_RECV_OUTPUT 3 +/* Value 4 is still used by obsolete turbo-packet. */ +#define PACKET_RX_RING 5 +#define PACKET_STATISTICS 6 +#define PACKET_COPY_THRESH 7 +#define PACKET_AUXDATA 8 +#define PACKET_ORIGDEV 9 +#define PACKET_VERSION 10 +#define PACKET_HDRLEN 11 +#define PACKET_RESERVE 12 +#define PACKET_TX_RING 13 +#define PACKET_LOSS 14 +#define PACKET_VNET_HDR 15 +#define PACKET_TX_TIMESTAMP 16 +#define PACKET_TIMESTAMP 17 +#define PACKET_FANOUT 18 + +#define PACKET_FANOUT_HASH 0 +#define PACKET_FANOUT_LB 1 +#define PACKET_FANOUT_CPU 2 +#define PACKET_FANOUT_FLAG_DEFRAG 0x8000 + +struct tpacket_stats { + unsigned int tp_packets; + unsigned int tp_drops; +}; + +struct tpacket_stats_v3 { + unsigned int tp_packets; + unsigned int tp_drops; + unsigned int tp_freeze_q_cnt; +}; + +union tpacket_stats_u { + struct tpacket_stats stats1; + struct tpacket_stats_v3 stats3; +}; + +struct tpacket_auxdata { + __u32 tp_status; + __u32 tp_len; + __u32 tp_snaplen; + __u16 tp_mac; + __u16 tp_net; + __u16 tp_vlan_tci; + __u16 tp_padding; +}; + +/* Rx ring - header status */ +#define TP_STATUS_KERNEL 0x0 +#define TP_STATUS_USER 0x1 +#define TP_STATUS_COPY 0x2 +#define TP_STATUS_LOSING 0x4 +#define TP_STATUS_CSUMNOTREADY 0x8 +#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */ +#define TP_STATUS_BLK_TMO 0x20 + +/* Tx ring - header status */ +#define TP_STATUS_AVAILABLE 0x0 +#define TP_STATUS_SEND_REQUEST 0x1 +#define TP_STATUS_SENDING 0x2 +#define TP_STATUS_WRONG_FORMAT 0x4 + +/* Rx ring - feature request bits */ +#define TP_FT_REQ_FILL_RXHASH 0x1 + +struct tpacket_hdr { + unsigned long tp_status; + unsigned int tp_len; + unsigned int tp_snaplen; + unsigned short tp_mac; + unsigned short tp_net; + unsigned int tp_sec; + unsigned int tp_usec; +}; + +#define TPACKET_ALIGNMENT 16 +#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) +#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) + +struct tpacket2_hdr { + __u32 tp_status; + __u32 tp_len; + __u32 tp_snaplen; + __u16 tp_mac; + __u16 tp_net; + __u32 tp_sec; + __u32 tp_nsec; + __u16 tp_vlan_tci; + __u16 tp_padding; +}; + +struct tpacket_hdr_variant1 { + __u32 tp_rxhash; + __u32 tp_vlan_tci; +}; + +struct tpacket3_hdr { + __u32 tp_next_offset; + __u32 tp_sec; + __u32 tp_nsec; + __u32 tp_snaplen; + __u32 tp_len; + __u32 tp_status; + __u16 tp_mac; + __u16 tp_net; + /* pkt_hdr variants */ + union { + struct tpacket_hdr_variant1 hv1; + }; +}; + +struct tpacket_bd_ts { + unsigned int ts_sec; + union { + unsigned int ts_usec; + unsigned int ts_nsec; + }; +}; + +#ifndef __aligned_u64 +// This is not defined on debian squeeze. +#define __aligned_u64 __u64 __attribute__((aligned(8))) +#endif + +struct tpacket_hdr_v1 { + __u32 block_status; + __u32 num_pkts; + __u32 offset_to_first_pkt; + + /* Number of valid bytes (including padding) + * blk_len <= tp_block_size + */ + __u32 blk_len; + + /* + * Quite a few uses of sequence number: + * 1. Make sure cache flush etc worked. + * Well, one can argue - why not use the increasing ts below? + * But look at 2. below first. + * 2. When you pass around blocks to other user space decoders, + * you can see which blk[s] is[are] outstanding etc. + * 3. Validate kernel code. + */ + __aligned_u64 seq_num; + + /* + * ts_last_pkt: + * + * Case 1. Block has 'N'(N >=1) packets and TMO'd(timed out) + * ts_last_pkt == 'time-stamp of last packet' and NOT the + * time when the timer fired and the block was closed. + * By providing the ts of the last packet we can absolutely + * guarantee that time-stamp wise, the first packet in the + * next block will never precede the last packet of the + * previous block. + * Case 2. Block has zero packets and TMO'd + * ts_last_pkt = time when the timer fired and the block + * was closed. + * Case 3. Block has 'N' packets and NO TMO. + * ts_last_pkt = time-stamp of the last pkt in the block. + * + * ts_first_pkt: + * Is always the time-stamp when the block was opened. + * Case a) ZERO packets + * No packets to deal with but atleast you know the + * time-interval of this block. + * Case b) Non-zero packets + * Use the ts of the first packet in the block. + * + */ + struct tpacket_bd_ts ts_first_pkt, ts_last_pkt; +}; + +union tpacket_bd_header_u { + struct tpacket_hdr_v1 bh1; +}; + +struct tpacket_block_desc { + __u32 version; + __u32 offset_to_priv; + union tpacket_bd_header_u hdr; +}; + +#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) +#define TPACKET3_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket3_hdr)) + sizeof(struct sockaddr_ll)) + +enum tpacket_versions { + TPACKET_V1, + TPACKET_V2, + TPACKET_V3 +}; + +/* + Frame structure: + + - Start. Frame must be aligned to TPACKET_ALIGNMENT=16 + - struct tpacket_hdr + - pad to TPACKET_ALIGNMENT=16 + - struct sockaddr_ll + - Gap, chosen so that packet data (Start+tp_net) alignes to TPACKET_ALIGNMENT=16 + - Start+tp_mac: [ Optional MAC header ] + - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16. + - Pad to align to TPACKET_ALIGNMENT=16 + */ + +struct tpacket_req { + unsigned int tp_block_size; /* Minimal size of contiguous block */ + unsigned int tp_block_nr; /* Number of blocks */ + unsigned int tp_frame_size; /* Size of frame */ + unsigned int tp_frame_nr; /* Total number of frames */ +}; + +struct tpacket_req3 { + unsigned int tp_block_size; /* Minimal size of contiguous block */ + unsigned int tp_block_nr; /* Number of blocks */ + unsigned int tp_frame_size; /* Size of frame */ + unsigned int tp_frame_nr; /* Total number of frames */ + unsigned int tp_retire_blk_tov; /* timeout in msecs */ + unsigned int tp_sizeof_priv; /* offset to private data area */ + unsigned int tp_feature_req_word; +}; + +union tpacket_req_u { + struct tpacket_req req; + struct tpacket_req3 req3; +}; + +struct packet_mreq { + int mr_ifindex; + unsigned short mr_type; + unsigned short mr_alen; + unsigned char mr_address[8]; +}; + +#define PACKET_MR_MULTICAST 0 +#define PACKET_MR_PROMISC 1 +#define PACKET_MR_ALLMULTI 2 +#define PACKET_MR_UNICAST 3 + +#endif diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/options.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/options.go new file mode 100644 index 00000000..50d55f58 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/afpacket/options.go @@ -0,0 +1,171 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// +build linux + +package afpacket + +import ( + "fmt" + "time" +) + +// #include "if_packet.h" +// #include +import "C" + +// OptTPacketVersion is the version of TPacket to use. +// It can be passed into NewTPacket. +type OptTPacketVersion int + +// String returns a string representation of the version, generally of the form V#. +func (t OptTPacketVersion) String() string { + switch t { + case TPacketVersion1: + return "V1" + case TPacketVersion2: + return "V2" + case TPacketVersion3: + return "V3" + case TPacketVersionHighestAvailable: + return "HighestAvailable" + } + return "InvalidVersion" +} + +// OptSockType is the socket type used to open the TPacket socket. +type OptSocketType int + +func (t OptSocketType) String() string { + switch t { + case SocketRaw: + return "SOCK_RAW" + case SocketDgram: + return "SOCK_DGRAM" + } + return "UnknownSocketType" +} + +const ( + // TPacketVersionHighestAvailable tells NewHandle to use the highest available version of tpacket the kernel has available. + // This is the default, should a version number not be given in NewHandle's options. + TPacketVersionHighestAvailable = OptTPacketVersion(-1) + TPacketVersion1 = OptTPacketVersion(C.TPACKET_V1) + TPacketVersion2 = OptTPacketVersion(C.TPACKET_V2) + TPacketVersion3 = OptTPacketVersion(C.TPACKET_V3) + tpacketVersionMax = TPacketVersion3 + tpacketVersionMin = -1 + // SocketRaw is the default socket type. It returns packet data + // including the link layer (ethernet headers, etc). + SocketRaw = OptSocketType(C.SOCK_RAW) + // SocketDgram strips off the link layer when reading packets, and adds + // the link layer back automatically on packet writes (coming soon...) + SocketDgram = OptSocketType(C.SOCK_DGRAM) +) + +// OptInterface is the specific interface to bind to. +// It can be passed into NewTPacket. +type OptInterface string + +// OptFrameSize is TPacket's tp_frame_size +// It can be passed into NewTPacket. +type OptFrameSize int + +// OptBlockSize is TPacket's tp_block_size +// It can be passed into NewTPacket. +type OptBlockSize int + +// OptNumBlocks is TPacket's tp_block_nr +// It can be passed into NewTPacket. +type OptNumBlocks int + +// OptBlockTimeout is TPacket v3's tp_retire_blk_tov. Note that it has only millisecond granularity, so must be >= 1 ms. +// It can be passed into NewTPacket. +type OptBlockTimeout time.Duration + +// OptPollTimeout is the maximum amount of time to wait in the poll system call. +// Note that an empty packet will be returned in most cases when a timeout happens. +// Setting this to BlockForever disables the timeout. +type OptPollTimeout time.Duration + +const BlockForever = -time.Millisecond + +const ( + DefaultFrameSize = 4096 // Default value for OptFrameSize. + DefaultBlockSize = DefaultFrameSize * 128 // Default value for OptBlockSize. + DefaultNumBlocks = 128 // Default value for OptNumBlocks. + DefaultBlockTimeout = 64 * time.Millisecond // Default value for OptBlockTimeout. + DefaultPollTimeout = BlockForever // Default value for OptPollTimeout. +) + +type options struct { + frameSize int + framesPerBlock int + blockSize int + numBlocks int + blockTimeout time.Duration + version OptTPacketVersion + socktype OptSocketType + iface string + timeout time.Duration +} + +var defaultOpts = options{ + frameSize: DefaultFrameSize, + blockSize: DefaultBlockSize, + numBlocks: DefaultNumBlocks, + blockTimeout: DefaultBlockTimeout, + version: TPacketVersionHighestAvailable, + socktype: SocketRaw, + timeout: DefaultPollTimeout, +} + +func parseOptions(opts ...interface{}) (ret options, err error) { + ret = defaultOpts + for _, opt := range opts { + switch v := opt.(type) { + case OptFrameSize: + ret.frameSize = int(v) + case OptBlockSize: + ret.blockSize = int(v) + case OptNumBlocks: + ret.numBlocks = int(v) + case OptBlockTimeout: + ret.blockTimeout = time.Duration(v) + case OptTPacketVersion: + ret.version = v + case OptInterface: + ret.iface = string(v) + case OptSocketType: + ret.socktype = v + case OptPollTimeout: + ret.timeout = time.Duration(v) + default: + err = fmt.Errorf("unknown type in options") + return + } + } + if err = ret.check(); err != nil { + return + } + ret.framesPerBlock = ret.blockSize / ret.frameSize + return +} +func (o options) check() error { + switch { + case o.blockSize%pageSize != 0: + return fmt.Errorf("block size %d must be divisible by page size %d", o.blockSize, pageSize) + case o.blockSize%o.frameSize != 0: + return fmt.Errorf("block size %d must be divisible by frame size %d", o.blockSize, o.frameSize) + case o.numBlocks < 1: + return fmt.Errorf("num blocks %d must be >= 1", o.numBlocks) + case o.blockTimeout < time.Millisecond: + return fmt.Errorf("block timeout %v must be > %v", o.blockTimeout, time.Millisecond) + case o.version < tpacketVersionMin || o.version > tpacketVersionMax: + return fmt.Errorf("tpacket version %v is invalid", o.version) + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/base.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/base.go new file mode 100644 index 00000000..3893cf07 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/base.go @@ -0,0 +1,147 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package gopacket + +import ( + "fmt" +) + +// Layer represents a single decoded packet layer (using either the +// OSI or TCP/IP definition of a layer). When decoding, a packet's data is +// broken up into a number of layers. The caller may call LayerType() to +// figure out which type of layer they've received from the packet. Optionally, +// they may then use a type assertion to get the actual layer type for deep +// inspection of the data. +type Layer interface { + // LayerType is the gopacket type for this layer. + LayerType() LayerType + // LayerContents returns the set of bytes that make up this layer. + LayerContents() []byte + // LayerPayload returns the set of bytes contained within this layer, not + // including the layer itself. + LayerPayload() []byte +} + +// Payload is a Layer containing the payload of a packet. The definition of +// what constitutes the payload of a packet depends on previous layers; for +// TCP and UDP, we stop decoding above layer 4 and return the remaining +// bytes as a Payload. Payload is an ApplicationLayer. +type Payload []byte + +// LayerType returns LayerTypePayload +func (p Payload) LayerType() LayerType { return LayerTypePayload } +func (p Payload) LayerContents() []byte { return []byte(p) } +func (p Payload) LayerPayload() []byte { return nil } +func (p Payload) Payload() []byte { return []byte(p) } +func (p Payload) String() string { return fmt.Sprintf("%d byte(s)", len(p)) } +func (p Payload) CanDecode() LayerClass { return LayerTypePayload } +func (p Payload) NextLayerType() LayerType { return LayerTypeZero } +func (p *Payload) DecodeFromBytes(data []byte, df DecodeFeedback) error { + *p = Payload(data) + return nil +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (p Payload) SerializeTo(b SerializeBuffer, opts SerializeOptions) error { + bytes, err := b.PrependBytes(len(p)) + if err != nil { + return err + } + copy(bytes, p) + return nil +} + +// decodePayload decodes data by returning it all in a Payload layer. +func decodePayload(data []byte, p PacketBuilder) error { + payload := &Payload{} + if err := payload.DecodeFromBytes(data, p); err != nil { + return nil + } + p.AddLayer(payload) + p.SetApplicationLayer(payload) + return nil +} + +// Fragment is a Layer containing a fragment of a larger frame, used by layers +// like IPv4 and IPv6 that allow for fragmentation of their payloads. +type Fragment []byte + +// LayerType returns LayerTypeFragment +func (p *Fragment) LayerType() LayerType { return LayerTypeFragment } +func (p *Fragment) LayerContents() []byte { return []byte(*p) } +func (p *Fragment) LayerPayload() []byte { return nil } +func (p *Fragment) Payload() []byte { return []byte(*p) } +func (p *Fragment) String() string { return fmt.Sprintf("%d byte(s)", len(*p)) } +func (p *Fragment) CanDecode() LayerClass { return LayerTypeFragment } +func (p *Fragment) NextLayerType() LayerType { return LayerTypeZero } +func (p *Fragment) DecodeFromBytes(data []byte, df DecodeFeedback) error { + *p = Fragment(data) + return nil +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (p *Fragment) SerializeTo(b SerializeBuffer, opts SerializeOptions) error { + bytes, err := b.PrependBytes(len(*p)) + if err != nil { + return err + } + copy(bytes, *p) + return nil +} + +// decodeFragment decodes data by returning it all in a Fragment layer. +func decodeFragment(data []byte, p PacketBuilder) error { + payload := &Fragment{} + if err := payload.DecodeFromBytes(data, p); err != nil { + return nil + } + p.AddLayer(payload) + p.SetApplicationLayer(payload) + return nil +} + +// These layers correspond to Internet Protocol Suite (TCP/IP) layers, and their +// corresponding OSI layers, as best as possible. + +// LinkLayer is the packet layer corresponding to TCP/IP layer 1 (OSI layer 2) +type LinkLayer interface { + Layer + LinkFlow() Flow +} + +// NetworkLayer is the packet layer corresponding to TCP/IP layer 2 (OSI +// layer 3) +type NetworkLayer interface { + Layer + NetworkFlow() Flow +} + +// TransportLayer is the packet layer corresponding to the TCP/IP layer 3 (OSI +// layer 4) +type TransportLayer interface { + Layer + TransportFlow() Flow +} + +// ApplicationLayer is the packet layer corresponding to the TCP/IP layer 4 (OSI +// layer 7), also known as the packet payload. +type ApplicationLayer interface { + Layer + Payload() []byte +} + +// ErrorLayer is a packet layer created when decoding of the packet has failed. +// Its payload is all the bytes that we were unable to decode, and the returned +// error details why the decoding failed. +type ErrorLayer interface { + Layer + Error() error +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/bytediff/bytediff.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/bytediff/bytediff.go new file mode 100644 index 00000000..63addd94 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/bytediff/bytediff.go @@ -0,0 +1,217 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// Package bytediff provides a simple diff utility for looking at differences in byte +// slices. It's slow, clunky, and not particularly good by any measure, but +// it does provide very useful visualizations for diffs between small byte +// slices. +// +// Our diff algorithm uses a dynamic programming implementation of longest common +// substring to find matching parts of slices, then recursively calls itself on +// the prefix/suffix of that matching part for each packet. This is a Bad Idea +// (tm) for normal (especially large) input, but for packets where large portions +// repeat frequently and we expect minor changes between results, it's actually +// quite useful. +package bytediff + +import ( + "bytes" + "fmt" +) + +// OutputFormat tells a Differences.String call how to format the set of +// differences into a human-readable string. Its internals are currently +// unexported because we may want to change them drastically in the future. For +// the moment, please just use one of the provided OutputFormats that comes with +// this library. +type OutputFormat struct { + start, finish, add, remove, change, reset string +} + +var ( + // BashOutput uses bash escape sequences to color output. + BashOutput = &OutputFormat{ + reset: "\033[0m", + remove: "\033[32m", + add: "\033[31m", + change: "\033[33m", + } + // HTMLOutput uses a
 to wrap output, and s to color it.
+	// HTMLOutput is pretty experimental, so use at your own risk ;)
+	HTMLOutput = &OutputFormat{
+		start:  "
",
+		finish: "
", + reset: "
", + remove: "", + add: "", + change: "", + } +) + +// longestCommonSubstring uses a O(MN) dynamic programming approach to find the +// longest common substring in a set of slices. It returns the index in each +// slice at which the substring begins, plus the length of the commonality. +func longestCommonSubstring(strA, strB []byte) (indexA, indexB, length int) { + lenA, lenB := len(strA), len(strB) + if lenA == 0 || lenB == 0 { + return 0, 0, 0 + } + arr := make([][]int, lenA) + for i := 0; i < lenA; i++ { + arr[i] = make([]int, lenB) + } + var maxLength int + var maxA, maxB int + for a := 0; a < lenA; a++ { + for b := 0; b < lenB; b++ { + if strA[a] == strB[b] { + length := 1 + if a > 0 && b > 0 { + length = arr[a-1][b-1] + 1 + } + arr[a][b] = length + if length > maxLength { + maxLength = length + maxA = a + maxB = b + } + } + } + } + a, b := maxA, maxB + for a >= 0 && b >= 0 && strA[a] == strB[b] { + indexA = a + indexB = b + a-- + b-- + length++ + } + return +} + +func intMax(a, b int) int { + if a > b { + return a + } + return b +} + +// Difference represents a single part of the data being diffed, containing +// information about both the original and new values. +// From and To are the sets of bytes in the original and the new byte slice. +// !Replace implies From == To (no change) +// len(To) == 0 implies From is being deleted +// len(From) == 0 implies To is being inserted +// else implies From is being replaced by To +type Difference struct { + Replace bool + From, To []byte +} + +// color returns the bash color for a given difference. +func (c *OutputFormat) color(d Difference) string { + switch { + case !d.Replace: + return "" + case len(d.From) == 0: + return c.remove + case len(d.To) == 0: + return c.add + default: + return c.change + } +} + +// Diff diffs strA and strB, returning a list of differences which +// can be used to construct either the original or new string. +// +// Diff is optimized for comparing VERY SHORT slices. It's meant for comparing +// things like packets off the wire, not large files or the like. +// As such, its runtime can be catastrophic if large inputs are passed in. +// You've been warned. +func Diff(strA, strB []byte) Differences { + if len(strA) == 0 && len(strB) == 0 { + return nil + } + ia, ib, l := longestCommonSubstring(strA, strB) + if l == 0 { + return Differences{ + Difference{true, strA, strB}, + } + } + beforeA, match, afterA := strA[:ia], strA[ia:ia+l], strA[ia+l:] + beforeB, afterB := strB[:ib], strB[ib+l:] + var diffs Differences + diffs = append(diffs, Diff(beforeA, beforeB)...) + diffs = append(diffs, Difference{false, match, match}) + diffs = append(diffs, Diff(afterA, afterB)...) + return diffs +} + +// Differences is a set of differences for a given diff'd pair of byte slices. +type Differences []Difference + +// String outputs a previously diff'd set of strings, showing differences +// between them, highlighted by colors. +// +// The output format of this function is NOT guaranteed consistent, and may be +// changed at any time by the library authors. It's meant solely for human +// consumption. +func (c *OutputFormat) String(diffs Differences) string { + var buf bytes.Buffer + count := 0 + fmt.Fprintf(&buf, "%s", c.start) + fmt.Fprintf(&buf, "00000000 ") + for i := 0; i < len(diffs); i++ { + diff := diffs[i] + color := c.color(diff) + reset := "" + if color != "" { + reset = c.reset + } + fmt.Fprint(&buf, color) + for _, b := range diff.From { + fmt.Fprintf(&buf, " %02x", b) + count++ + switch count % 16 { + case 0: + fmt.Fprintf(&buf, "%v\n%08x%v ", reset, count, color) + case 8: + fmt.Fprintf(&buf, " ") + } + } + fmt.Fprint(&buf, reset) + } + fmt.Fprintf(&buf, "\n\n00000000 ") + count = 0 + for i := 0; i < len(diffs); i++ { + diff := diffs[i] + str := diff.From + if diff.Replace { + str = diff.To + } + color := c.color(diff) + reset := "" + if color != "" { + reset = c.reset + } + fmt.Fprint(&buf, color) + for _, b := range str { + fmt.Fprintf(&buf, " %02x", b) + count++ + switch count % 16 { + case 0: + fmt.Fprintf(&buf, "%v\n%08x%v ", reset, count, color) + case 8: + fmt.Fprintf(&buf, " ") + } + } + fmt.Fprint(&buf, reset) + } + fmt.Fprint(&buf, "\n") + fmt.Fprintf(&buf, "%s", c.finish) + return string(buf.Bytes()) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/decode.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/decode.go new file mode 100644 index 00000000..dc390d6f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/decode.go @@ -0,0 +1,146 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package gopacket + +import ( + "errors" +) + +// DecodeFeedback is used by DecodingLayer layers to provide decoding metadata. +type DecodeFeedback interface { + // SetTruncated should be called if during decoding you notice that a packet + // is shorter than internal layer variables (HeaderLength, or the like) say it + // should be. It sets packet.Metadata().Truncated. + SetTruncated() +} + +type nilDecodeFeedback struct{} + +func (nilDecodeFeedback) SetTruncated() {} + +// NilDecodeFeedback implements DecodeFeedback by doing nothing. +var NilDecodeFeedback DecodeFeedback = nilDecodeFeedback{} + +// PacketBuilder is used by layer decoders to store the layers they've decoded, +// and to defer future decoding via NextDecoder. +// Typically, the pattern for use is: +// func (m *myDecoder) Decode(data []byte, p PacketBuilder) error { +// if myLayer, err := myDecodingLogic(data); err != nil { +// return err +// } else { +// p.AddLayer(myLayer) +// } +// // maybe do this, if myLayer is a LinkLayer +// p.SetLinkLayer(myLayer) +// return p.NextDecoder(nextDecoder) +// } +type PacketBuilder interface { + DecodeFeedback + // AddLayer should be called by a decoder immediately upon successful + // decoding of a layer. + AddLayer(l Layer) + // The following functions set the various specific layers in the final + // packet. Note that if many layers call SetX, the first call is kept and all + // other calls are ignored. + SetLinkLayer(LinkLayer) + SetNetworkLayer(NetworkLayer) + SetTransportLayer(TransportLayer) + SetApplicationLayer(ApplicationLayer) + SetErrorLayer(ErrorLayer) + // NextDecoder should be called by a decoder when they're done decoding a + // packet layer but not done with decoding the entire packet. The next + // decoder will be called to decode the last AddLayer's LayerPayload. + // Because of this, NextDecoder must only be called once all other + // PacketBuilder calls have been made. Set*Layer and AddLayer calls after + // NextDecoder calls will behave incorrectly. + NextDecoder(next Decoder) error + // DumpPacketData is used solely for decoding. If you come across an error + // you need to diagnose while processing a packet, call this and your packet's + // data will be dumped to stderr so you can create a test. This should never + // be called from a production decoder. + DumpPacketData() +} + +// Decoder is an interface for logic to decode a packet layer. Users may +// implement a Decoder to handle their own strange packet types, or may use one +// of the many decoders available in the 'layers' subpackage to decode things +// for them. +type Decoder interface { + // Decode decodes the bytes of a packet, sending decoded values and other + // information to PacketBuilder, and returning an error if unsuccessful. See + // the PacketBuilder documentation for more details. + Decode([]byte, PacketBuilder) error +} + +// DecodeFunc wraps a function to make it a Decoder. +type DecodeFunc func([]byte, PacketBuilder) error + +func (d DecodeFunc) Decode(data []byte, p PacketBuilder) error { + // function, call thyself. + return d(data, p) +} + +// DecodePayload is a Decoder that returns a Payload layer containing all +// remaining bytes. +var DecodePayload Decoder = DecodeFunc(decodePayload) + +// DecodeUnknown is a Decoder that returns an Unknown layer containing all +// remaining bytes, useful if you run up against a layer that you're unable to +// decode yet. This layer is considered an ErrorLayer. +var DecodeUnknown Decoder = DecodeFunc(decodeUnknown) + +// DecodeFragment is a Decoder that returns a Fragment layer containing all +// remaining bytes. +var DecodeFragment Decoder = DecodeFunc(decodeFragment) + +// LayerTypeZero is an invalid layer type, but can be used to determine whether +// layer type has actually been set correctly. +var LayerTypeZero LayerType = RegisterLayerType(0, LayerTypeMetadata{"Unknown", DecodeUnknown}) + +// LayerTypeDecodeFailure is the layer type for the default error layer. +var LayerTypeDecodeFailure LayerType = RegisterLayerType(1, LayerTypeMetadata{"DecodeFailure", DecodeUnknown}) + +// LayerTypePayload is the layer type for a payload that we don't try to decode +// but treat as a success, IE: an application-level payload. +var LayerTypePayload LayerType = RegisterLayerType(2, LayerTypeMetadata{"Payload", DecodePayload}) + +// LayerTypeFragment is the layer type for a fragment of a layer transported +// by an underlying layer that supports fragmentation. +var LayerTypeFragment LayerType = RegisterLayerType(3, LayerTypeMetadata{"Fragment", DecodeFragment}) + +// DecodeFailure is a packet layer created if decoding of the packet data failed +// for some reason. It implements ErrorLayer. LayerContents will be the entire +// set of bytes that failed to parse, and Error will return the reason parsing +// failed. +type DecodeFailure struct { + data []byte + err error + stack []byte +} + +// Error returns the error encountered during decoding. +func (d *DecodeFailure) Error() error { return d.err } +func (d *DecodeFailure) LayerContents() []byte { return d.data } +func (d *DecodeFailure) LayerPayload() []byte { return nil } +func (d *DecodeFailure) String() string { + return "Packet decoding error: " + d.Error().Error() +} +func (d *DecodeFailure) Dump() (s string) { + if d.stack != nil { + s = string(d.stack) + } + return +} + +// LayerType returns LayerTypeDecodeFailure +func (d *DecodeFailure) LayerType() LayerType { return LayerTypeDecodeFailure } + +// decodeUnknown "decodes" unsupported data types by returning an error. +// This decoder will thus always return a DecodeFailure layer. +func decodeUnknown(data []byte, p PacketBuilder) error { + return errors.New("Layer type not currently supported") +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/doc.go new file mode 100644 index 00000000..85e96d62 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/doc.go @@ -0,0 +1,365 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +/* +Package gopacket provides packet decoding for the Go language. + +gopacket contains many sub-packages with additional functionality you may find +useful, including: + + * layers: You'll probably use this every time. This contains of the logic + built into gopacket for decoding packet protocols. Note that all example + code below assumes that you have imported both gopacket and + gopacket/layers. + * pcap: C bindings to use libpcap to read packets off the wire. + * pfring: C bindings to use PF_RING to read packets off the wire. + * afpacket: C bindings for Linux's AF_PACKET to read packets off the wire. + * tcpassembly: TCP stream reassembly + +Also, if you're looking to dive right into code, see the examples subdirectory +for numerous simple binaries built using gopacket libraries. + +Basic Usage + +gopacket takes in packet data as a []byte and decodes it into a packet with +a non-zero number of "layers". Each layer corresponds to a protocol +within the bytes. Once a packet has been decoded, the layers of the packet +can be requested from the packet. + + // Decode a packet + packet := gopacket.NewPacket(myPacketData, layers.LayerTypeEthernet, gopacket.Default) + // Get the TCP layer from this packet + if tcpLayer := packet.Layer(layers.LayerTypeTCP); tcpLayer != nil { + fmt.Println("This is a TCP packet!") + // Get actual TCP data from this layer + tcp, _ := tcpLayer.(*layers.TCP) + fmt.Printf("From src port %d to dst port %d\n", tcp.SrcPort, tcp.DstPort) + } + // Iterate over all layers, printing out each layer type + for layer := range packet.Layers() { + fmt.Println("PACKET LAYER:", layer.LayerType()) + } + +Packets can be decoded from a number of starting points. Many of our base +types implement Decoder, which allow us to decode packets for which +we don't have full data. + + // Decode an ethernet packet + ethP := gopacket.NewPacket(p1, layers.LayerTypeEthernet, gopacket.Default) + // Decode an IPv6 header and everything it contains + ipP := gopacket.NewPacket(p2, layers.LayerTypeIPv6, gopacket.Default) + // Decode a TCP header and its payload + tcpP := gopacket.NewPacket(p3, layers.LayerTypeTCP, gopacket.Default) + + +Reading Packets From A Source + +Most of the time, you won't just have a []byte of packet data lying around. +Instead, you'll want to read packets in from somewhere (file, interface, etc) +and process them. To do that, you'll want to build a PacketSource. + +First, you'll need to construct an object that implements the PacketDataSource +interface. There are implementations of this interface bundled with gopacket +in the gopacket/pcap and gopacket/pfring subpackages... see their documentation +for more information on their usage. Once you have a PacketDataSource, you can +pass it into NewPacketSource, along with a Decoder of your choice, to create +a PacketSource. + +Once you have a PacketSource, you can read packets from it in multiple ways. +See the docs for PacketSource for more details. The easiest method is the +Packets function, which returns a channel, then asynchronously writes new +packets into that channel, closing the channel if the packetSource hits an +end-of-file. + + packetSource := ... // construct using pcap or pfring + for packet := range packetSource.Packets() { + handlePacket(packet) // do something with each packet + } + +You can change the decoding options of the packetSource by setting fields in +packetSource.DecodeOptions... see the following sections for more details. + + +Lazy Decoding + +gopacket optionally decodes packet data lazily, meaning it +only decodes a packet layer when it needs to handle a function call. + + // Create a packet, but don't actually decode anything yet + packet := gopacket.NewPacket(myPacketData, layers.LayerTypeEthernet, gopacket.Lazy) + // Now, decode the packet up to the first IPv4 layer found but no further. + // If no IPv4 layer was found, the whole packet will be decoded looking for + // it. + ip4 := packet.Layer(layers.LayerTypeIPv4) + // Decode all layers and return them. The layers up to the first IPv4 layer + // are already decoded, and will not require decoding a second time. + layers := packet.Layers() + +Lazily-decoded packets are not concurrency-safe. Since layers have not all been +decoded, each call to Layer() or Layers() has the potential to mutate the packet +in order to decode the next layer. If a packet is used +in multiple goroutines concurrently, don't use gopacket.Lazy. Then gopacket +will decode the packet fully, and all future function calls won't mutate the +object. + + +NoCopy Decoding + +By default, gopacket will copy the slice passed to NewPacket and store the +copy within the packet, so future mutations to the bytes underlying the slice +don't affect the packet and its layers. If you can guarantee that the +underlying slice bytes won't be changed, you can use NoCopy to tell +gopacket.NewPacket, and it'll use the passed-in slice itself. + + // This channel returns new byte slices, each of which points to a new + // memory location that's guaranteed immutable for the duration of the + // packet. + for data := range myByteSliceChannel { + p := gopacket.NewPacket(data, layers.LayerTypeEthernet, gopacket.NoCopy) + doSomethingWithPacket(p) + } + +The fastest method of decoding is to use both Lazy and NoCopy, but note from +the many caveats above that for some implementations either or both may be +dangerous. + + +Pointers To Known Layers + +During decoding, certain layers are stored in the packet as well-known +layer types. For example, IPv4 and IPv6 are both considered NetworkLayer +layers, while TCP and UDP are both TransportLayer layers. We support 4 +layers, corresponding to the 4 layers of the TCP/IP layering scheme (roughly +anagalous to layers 2, 3, 4, and 7 of the OSI model). To access these, +you can use the packet.LinkLayer, packet.NetworkLayer, +packet.TransportLayer, and packet.ApplicationLayer functions. Each of +these functions returns a corresponding interface +(gopacket.{Link,Network,Transport,Application}Layer). The first three +provide methods for getting src/dst addresses for that particular layer, +while the final layer provides a Payload function to get payload data. +This is helpful, for example, to get payloads for all packets regardless +of their underlying data type: + + // Get packets from some source + for packet := range someSource { + if app := packet.ApplicationLayer(); app != nil { + if strings.Contains(string(app.Payload()), "magic string") { + fmt.Println("Found magic string in a packet!") + } + } + } + +A particularly useful layer is ErrorLayer, which is set whenever there's +an error parsing part of the packet. + + packet := gopacket.NewPacket(myPacketData, layers.LayerTypeEthernet, gopacket.Default) + if err := packet.ErrorLayer(); err != nil { + fmt.Println("Error decoding some part of the packet:", err) + } + +Note that we don't return an error from NewPacket because we may have decoded +a number of layers successfully before running into our erroneous layer. You +may still be able to get your Ethernet and IPv4 layers correctly, even if +your TCP layer is malformed. + + +Flow And Endpoint + +gopacket has two useful objects, Flow and Endpoint, for communicating in a protocol +independent manner the fact that a packet is coming from A and going to B. +The general layer types LinkLayer, NetworkLayer, and TransportLayer all provide +methods for extracting their flow information, without worrying about the type +of the underlying Layer. + +A Flow is a simple object made up of a set of two Endpoints, one source and one +destination. It details the sender and receiver of the Layer of the Packet. + +An Endpoint is a hashable representation of a source or destination. For +example, for LayerTypeIPv4, an Endpoint contains the IP address bytes for a v4 +IP packet. A Flow can be broken into Endpoints, and Endpoints can be combined +into Flows: + + packet := gopacket.NewPacket(myPacketData, layers.LayerTypeEthernet, gopacket.Lazy) + netFlow := packet.NetworkLayer().NetworkFlow() + src, dst := netFlow.Endpoints() + reverseFlow := gopacket.NewFlow(dst, src) + +Both Endpoint and Flow objects can be used as map keys, and the equality +operator can compare them, so you can easily group together all packets +based on endpoint criteria: + + flows := map[gopacket.Endpoint]chan gopacket.Packet + packet := gopacket.NewPacket(myPacketData, layers.LayerTypeEthernet, gopacket.Lazy) + // Send all TCP packets to channels based on their destination port. + if tcp := packet.Layer(layers.LayerTypeTCP); tcp != nil { + flows[tcp.TransportFlow().Dst()] <- packet + } + // Look for all packets with the same source and destination network address + if net := packet.NetworkLayer(); net != nil { + src, dst := net.NetworkFlow().Endpoints() + if src == dst { + fmt.Println("Fishy packet has same network source and dst: %s", src) + } + } + // Find all packets coming from UDP port 1000 to UDP port 500 + interestingFlow := gopacket.NewFlow(layers.NewUDPPortEndpoint(1000), layers.NewUDPPortEndpoint(500)) + if t := packet.NetworkLayer(); t != nil && t.TransportFlow() == interestingFlow { + fmt.Println("Found that UDP flow I was looking for!") + } + +For load-balancing purposes, both Flow and Endpoint have FastHash() functions, +which provide quick, non-cryptographic hashes of their contents. Of particular +importance is the fact that Flow FastHash() is symetric: A->B will have the same +hash as B->A. An example usage could be: + + channels := [8]chan gopacket.Packet + for i := 0; i < 8; i++ { + channels[i] = make(chan gopacket.Packet) + go packetHandler(channels[i]) + } + for packet := range getPackets() { + if net := packet.NetworkLayer(); net != nil { + channels[int(net.NetworkFlow().FastHash()) & 0x7] <- packet + } + } + +This allows us to split up a packet stream while still making sure that each +stream sees all packets for a flow (and its bidirectional opposite). + + +Implementing Your Own Decoder + +If your network has some strange encapsulation, you can implement your own +decoder. In this example, we handle Ethernet packets which are encapsulated +in a 4-byte header. + + // Create a layer type, should be unique and high, so it doesn't conflict, + // giving it a name and a decoder to use. + var MyLayerType = gopacket.RegisterLayerType(12345, "MyLayerType", gopacket.DecodeFunc(decodeMyLayer)) + + // Implement my layer + type MyLayer struct { + StrangeHeader []byte + payload []byte + } + func (m MyLayer) LayerType() LayerType { return MyLayerType } + func (m MyLayer) LayerContents() []byte { return m.StrangeHeader } + func (m MyLayer) LayerPayload() []byte { return m.payload } + + // Now implement a decoder... this one strips off the first 4 bytes of the + // packet. + func decodeMyLayer(data []byte, p gopacket.PacketBuilder) error { + // Create my layer + p.AddLayer(&MyLayer{data[:4], data[4:]}) + // Determine how to handle the rest of the packet + return p.NextDecoder(layers.LayerTypeEthernet) + } + + // Finally, decode your packets: + p := gopacket.NewPacket(data, MyLayerType, gopacket.Lazy) + +See the docs for Decoder and PacketBuilder for more details on how coding +decoders works, or look at RegisterLayerType and RegisterEndpointType to see how +to add layer/endpoint types to gopacket. + + +Fast Decoding With DecodingLayerParser + +TLDR: DecodingLayerParser takes about 10% of the time as NewPacket to decode +packet data, but only for known packet stacks. + +Basic decoding using gopacket.NewPacket or PacketSource.Packets is somewhat slow +due to its need to allocate a new packet and every respective layer. It's very +versatile and can handle all known layer types, but sometimes you really only +care about a specific set of layers regardless, so that versatility is wasted. + +DecodingLayerParser avoids memory allocation altogether by decoding packet +layers directly into preallocated objects, which you can then reference to get +the packet's information. A quick example: + + func main() { + var eth layers.Ethernet + var ip4 layers.IPv4 + var ip6 layers.IPv6 + var tcp layers.TCP + parser := gopacket.NewDecodingLayerParser(layers.LayerTypeEthernet, ð, &ip4, &ip6, &tcp) + decoded := []gopacket.LayerType{} + for packetData := range somehowGetPacketData() { + err := parser.DecodeLayers(packetData, &decoded) + for _, layerType := range decoded { + switch layerType { + case layers.LayerTypeIPv6: + fmt.Println(" IP6 ", ip6.SrcIP, ip6.DstIP) + case layers.LayerTypeIPv4: + fmt.Println(" IP4 ", ip4.SrcIP, ip4.DstIP) + } + } + } + } + +The important thing to note here is that the parser is modifying the passed in +layers (eth, ip4, ip6, tcp) instead of allocating new ones, thus greatly +speeding up the decoding process. It's even branching based on layer type... +it'll handle an (eth, ip4, tcp) or (eth, ip6, tcp) stack. However, it won't +handle any other type... since no other decoders were passed in, an (eth, ip4, +udp) stack will stop decoding after ip4, and only pass back [LayerTypeEthernet, +LayerTypeIPv4] through the 'decoded' slice (along with an error saying it can't +decode a UDP packet). + +Unfortunately, not all layers can be used by DecodingLayerParser... only those +implementing the DecodingLayer interface are usable. Also, it's possible to +create DecodingLayers that are not themselves Layers... see +layers.IPv6ExtensionSkipper for an example of this. + + +Creating Packet Data + +As well as offering the ability to decode packet data, gopacket will allow you +to create packets from scratch, as well. A number of gopacket layers implement +the SerializableLayer interface; these layers can be serialized to a []byte in +the following manner: + + ip := &layers.IPv4{ + SrcIP: net.IP{1, 2, 3, 4}, + DstIP: net.IP{5, 6, 7, 8}, + // etc... + } + buf := gopacket.NewSerializeBuffer() + opts := gopacket.SerializeOptions{} // See SerializeOptions for more details. + err := ip.SerializeTo(&buf, opts) + if err != nil { panic(err) } + fmt.Println(buf.Bytes()) // prints out a byte slice containing the serialized IPv4 layer. + +SerializeTo PREPENDS the given layer onto the SerializeBuffer, and they treat +the current buffer's Bytes() slice as the payload of the serializing layer. +Therefore, you can serialize an entire packet by serializing a set of layers in +reverse order (Payload, then TCP, then IP, then Ethernet, for example). The +SerializeBuffer's SerializeLayers function is a helper that does exactly that. + +To generate a (empty and useless, because no fields are set) +Ethernet(IPv4(TCP(Payload))) packet, for exmaple, you can run: + + buf := gopacket.NewSerializeBuffer() + opts := gopacket.SerializeOptions{} + gopacket.SerializeLayers(buf, opts, + &layers.Ethernet{}, + &layers.IPv4{}, + &layers.TCP{}, + gopacket.Payload([]byte{1, 2, 3, 4})) + packetData := buf.Bytes() + +A Final Note + +If you use gopacket, you'll almost definitely want to make sure gopacket/layers +is imported, since when imported it sets all the LayerType variables and fills +in a lot of interesting variables/maps (DecodersByLayerName, etc). Therefore, +it's recommended that even if you don't use any layers functions directly, you still import with: + + import ( + _ "github.com/tsg/gopacket/layers" + ) +*/ +package gopacket diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/dumpcommand/tcpdump.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/dumpcommand/tcpdump.go new file mode 100644 index 00000000..90b6cce9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/dumpcommand/tcpdump.go @@ -0,0 +1,84 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// Package dumpcommand implements a run function for pfdump and pcapdump +// with many similar flags/features to tcpdump. This code is split out seperate +// from data sources (pcap/pfring) so it can be used by both. +package dumpcommand + +import ( + "flag" + "fmt" + "github.com/tsg/gopacket" + _ "github.com/tsg/gopacket/layers" // pulls in all layers decoders + "log" + "os" + "time" +) + +var print = flag.Bool("print", true, "Print out packets, if false only prints out statistics") +var maxcount = flag.Int("c", -1, "Only grab this many packets, then exit") +var decoder = flag.String("decoder", "Ethernet", "Name of the decoder to use") +var dump = flag.Bool("X", false, "If true, dump very verbose info on each packet") +var statsevery = flag.Int("stats", 1000, "Output statistics every N packets") +var printErrors = flag.Bool("errors", false, "Print out packet dumps of decode errors, useful for checking decoders against live traffic") +var lazy = flag.Bool("lazy", false, "If true, do lazy decoding") + +func Run(src gopacket.PacketDataSource) { + if !flag.Parsed() { + log.Fatalln("Run called without flags.Parse() being called") + } + var dec gopacket.Decoder + var ok bool + if dec, ok = gopacket.DecodersByLayerName[*decoder]; !ok { + log.Fatalln("No decoder named", *decoder) + } + source := gopacket.NewPacketSource(src, dec) + source.Lazy = *lazy + source.NoCopy = true + fmt.Fprintln(os.Stderr, "Starting to read packets") + count := 0 + bytes := int64(0) + start := time.Now() + errors := 0 + truncated := 0 + layertypes := map[gopacket.LayerType]int{} + for packet := range source.Packets() { + count++ + bytes += int64(len(packet.Data())) + if *dump { + fmt.Println(packet.Dump()) + } else if *print { + fmt.Println(packet) + } + if !*lazy || *print || *dump { // if we've already decoded all layers... + for _, layer := range packet.Layers() { + layertypes[layer.LayerType()]++ + } + if packet.Metadata().Truncated { + truncated++ + } + if errLayer := packet.ErrorLayer(); errLayer != nil { + errors++ + if *printErrors { + fmt.Println("Error:", errLayer.Error()) + fmt.Println("--- Packet ---") + fmt.Println(packet.Dump()) + } + } + } + done := *maxcount > 0 && count >= *maxcount + if count%*statsevery == 0 || done { + fmt.Fprintf(os.Stderr, "Processed %v packets (%v bytes) in %v, %v errors and %v truncated packets\n", count, bytes, time.Since(start), errors, truncated) + if len(layertypes) > 0 { + fmt.Fprintf(os.Stderr, "Layer types seen: %+v\n", layertypes) + } + } + if done { + break + } + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/arpscan/arpscan.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/arpscan/arpscan.go new file mode 100644 index 00000000..ffadd6ef --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/arpscan/arpscan.go @@ -0,0 +1,188 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// arpscan implements ARP scanning of all interfaces' local networks using +// gopacket and its subpackages. This example shows, among other things: +// * Generating and sending packet data +// * Reading in packet data and interpreting it +// * Use of the 'pcap' subpackage for reading/writing +package main + +import ( + "bytes" + "encoding/binary" + "fmt" + "log" + "net" + "sync" + "time" + + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/layers" + "github.com/tsg/gopacket/pcap" +) + +func main() { + // Get a list of all interfaces. + ifaces, err := net.Interfaces() + if err != nil { + panic(err) + } + + var wg sync.WaitGroup + for _, iface := range ifaces { + wg.Add(1) + // Start up a scan on each interface. + go func(iface net.Interface) { + defer wg.Done() + if err := scan(&iface); err != nil { + log.Printf("interface %v: %v", iface.Name, err) + } + }(iface) + } + // Wait for all interfaces' scans to complete. They'll try to run + // forever, but will stop on an error, so if we get past this Wait + // it means all attempts to write have failed. + wg.Wait() +} + +// scan scans an individual interface's local network for machines using ARP requests/replies. +// +// scan loops forever, sending packets out regularly. It returns an error if +// it's ever unable to write a packet. +func scan(iface *net.Interface) error { + // We just look for IPv4 addresses, so try to find if the interface has one. + var addr *net.IPNet + if addrs, err := iface.Addrs(); err != nil { + return err + } else { + for _, a := range addrs { + if ipnet, ok := a.(*net.IPNet); ok { + if ip4 := ipnet.IP.To4(); ip4 != nil { + addr = &net.IPNet{ + IP: ip4, + Mask: ipnet.Mask[len(ipnet.Mask)-4:], + } + break + } + } + } + } + // Sanity-check that the interface has a good address. + if addr == nil { + return fmt.Errorf("no good IP network found") + } else if addr.IP[0] == 127 { + return fmt.Errorf("skipping localhost") + } else if addr.Mask[0] != 0xff || addr.Mask[1] != 0xff { + return fmt.Errorf("mask means network is too large") + } + log.Printf("Using network range %v for interface %v", addr, iface.Name) + + // Open up a pcap handle for packet reads/writes. + handle, err := pcap.OpenLive(iface.Name, 65536, true, pcap.BlockForever) + if err != nil { + return err + } + defer handle.Close() + + // Start up a goroutine to read in packet data. + stop := make(chan struct{}) + go readARP(handle, iface, stop) + defer close(stop) + for { + // Write our scan packets out to the handle. + if err := writeARP(handle, iface, addr); err != nil { + log.Printf("error writing packets on %v: %v", iface.Name, err) + return err + } + // We don't know exactly how long it'll take for packets to be + // sent back to us, but 10 seconds should be more than enough + // time ;) + time.Sleep(10 * time.Second) + } +} + +// readARP watches a handle for incoming ARP responses we might care about, and prints them. +// +// readARP loops until 'stop' is closed. +func readARP(handle *pcap.Handle, iface *net.Interface, stop chan struct{}) { + src := gopacket.NewPacketSource(handle, layers.LayerTypeEthernet) + in := src.Packets() + for { + var packet gopacket.Packet + select { + case <-stop: + return + case packet = <-in: + arpLayer := packet.Layer(layers.LayerTypeARP) + if arpLayer == nil { + continue + } + arp := arpLayer.(*layers.ARP) + if arp.Operation != layers.ARPReply || bytes.Equal([]byte(iface.HardwareAddr), arp.SourceHwAddress) { + // This is a packet I sent. + continue + } + // Note: we might get some packets here that aren't responses to ones we've sent, + // if for example someone else sends US an ARP request. Doesn't much matter, though... + // all information is good information :) + log.Printf("IP %v is at %v", net.IP(arp.SourceProtAddress), net.HardwareAddr(arp.SourceHwAddress)) + } + } +} + +// writeARP writes an ARP request for each address on our local network to the +// pcap handle. +func writeARP(handle *pcap.Handle, iface *net.Interface, addr *net.IPNet) error { + // Set up all the layers' fields we can. + eth := layers.Ethernet{ + SrcMAC: iface.HardwareAddr, + DstMAC: net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + EthernetType: layers.EthernetTypeARP, + } + arp := layers.ARP{ + AddrType: layers.LinkTypeEthernet, + Protocol: layers.EthernetTypeIPv4, + HwAddressSize: 6, + ProtAddressSize: 4, + Operation: layers.ARPRequest, + SourceHwAddress: []byte(iface.HardwareAddr), + SourceProtAddress: []byte(addr.IP), + DstHwAddress: []byte{0, 0, 0, 0, 0, 0}, + } + // Set up buffer and options for serialization. + buf := gopacket.NewSerializeBuffer() + opts := gopacket.SerializeOptions{ + FixLengths: true, + ComputeChecksums: true, + } + // Send one packet for every address. + for _, ip := range ips(addr) { + arp.DstProtAddress = []byte(ip) + gopacket.SerializeLayers(buf, opts, ð, &arp) + if err := handle.WritePacketData(buf.Bytes()); err != nil { + return err + } + } + return nil +} + +// ips is a simple and not very good method for getting all IPv4 addresses from a +// net.IPNet. It returns all IPs it can over the channel it sends back, closing +// the channel when done. +func ips(n *net.IPNet) (out []net.IP) { + num := binary.BigEndian.Uint32([]byte(n.IP)) + mask := binary.BigEndian.Uint32([]byte(n.Mask)) + num &= mask + for mask < 0xffffffff { + var buf [4]byte + binary.BigEndian.PutUint32(buf[:], num) + out = append(out, net.IP(buf[:])) + mask += 1 + num += 1 + } + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/bidirectional/main.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/bidirectional/main.go new file mode 100644 index 00000000..a7e9698c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/bidirectional/main.go @@ -0,0 +1,192 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// This binary provides an example of connecting up bidirectional streams from +// the unidirectional streams provided by gopacket/tcpassembly. +package main + +import ( + "flag" + "fmt" + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/examples/util" + "github.com/tsg/gopacket/layers" + "github.com/tsg/gopacket/pcap" + "github.com/tsg/gopacket/tcpassembly" + "log" + "time" +) + +var iface = flag.String("i", "eth0", "Interface to get packets from") +var snaplen = flag.Int("s", 16<<10, "SnapLen for pcap packet capture") +var filter = flag.String("f", "tcp", "BPF filter for pcap") +var logAllPackets = flag.Bool("v", false, "Logs every packet in great detail") + +// key is used to map bidirectional streams to each other. +type key struct { + net, transport gopacket.Flow +} + +// String prints out the key in a human-readable fashion. +func (k key) String() string { + return fmt.Sprintf("%v:%v", k.net, k.transport) +} + +// timeout is the length of time to wait befor flushing connections and +// bidirectional stream pairs. +const timeout time.Duration = time.Minute * 5 + +// myStream implements tcpassembly.Stream +type myStream struct { + bytes int64 // total bytes seen on this stream. + bidi *bidi // maps to my bidirectional twin. + done bool // if true, we've seen the last packet we're going to for this stream. +} + +// bidi stores each unidirectional side of a bidirectional stream. +// +// When a new stream comes in, if we don't have an opposite stream, a bidi is +// created with 'a' set to the new stream. If we DO have an opposite stream, +// 'b' is set to the new stream. +type bidi struct { + key key // Key of the first stream, mostly for logging. + a, b *myStream // the two bidirectional streams. + lastPacketSeen time.Time // last time we saw a packet from either stream. +} + +// myFactory implements tcpassmebly.StreamFactory +type myFactory struct { + // bidiMap maps keys to bidirectional stream pairs. + bidiMap map[key]*bidi +} + +// New handles creating a new tcpassembly.Stream. +func (f *myFactory) New(netFlow, tcpFlow gopacket.Flow) tcpassembly.Stream { + // Create a new stream. + s := &myStream{} + + // Find the bidi bidirectional struct for this stream, creating a new one if + // one doesn't already exist in the map. + k := key{netFlow, tcpFlow} + bd := f.bidiMap[k] + if bd == nil { + bd = &bidi{a: s, key: k} + log.Printf("[%v] created first side of bidirectional stream", bd.key) + // Register bidirectional with the reverse key, so the matching stream going + // the other direction will find it. + f.bidiMap[key{netFlow.Reverse(), tcpFlow.Reverse()}] = bd + } else { + log.Printf("[%v] found second side of bidirectional stream", bd.key) + bd.b = s + // Clear out the bidi we're using from the map, just in case. + delete(f.bidiMap, k) + } + s.bidi = bd + return s +} + +// emptyStream is used to finish bidi that only have one stream, in +// collectOldStreams. +var emptyStream = &myStream{done: true} + +// collectOldStreams finds any streams that haven't received a packet within +// 'timeout', and sets/finishes the 'b' stream inside them. The 'a' stream may +// still receive packets after this. +func (f *myFactory) collectOldStreams() { + cutoff := time.Now().Add(-timeout) + for k, bd := range f.bidiMap { + if bd.lastPacketSeen.Before(cutoff) { + log.Printf("[%v] timing out old stream", bd.key) + bd.b = emptyStream // stub out b with an empty stream. + delete(f.bidiMap, k) // remove it from our map. + bd.maybeFinish() // if b was the last stream we were waiting for, finish up. + } + } +} + +// Reassembled handles reassembled TCP stream data. +func (s *myStream) Reassembled(rs []tcpassembly.Reassembly) { + for _, r := range rs { + // For now, we'll simply count the bytes on each side of the TCP stream. + s.bytes += int64(len(r.Bytes)) + if r.Skip > 0 { + s.bytes += int64(r.Skip) + } + // Mark that we've received new packet data. + // We could just use time.Now, but by using r.Seen we handle the case + // where packets are being read from a file and could be very old. + if s.bidi.lastPacketSeen.After(r.Seen) { + s.bidi.lastPacketSeen = r.Seen + } + } +} + +// ReassemblyComplete marks this stream as finished. +func (s *myStream) ReassemblyComplete() { + s.done = true + s.bidi.maybeFinish() +} + +// maybeFinish will wait until both directions are complete, then print out +// stats. +func (bd *bidi) maybeFinish() { + switch { + case bd.a == nil: + log.Fatalf("[%v] a should always be non-nil, since it's set when bidis are created", bd.key) + case !bd.a.done: + log.Printf("[%v] still waiting on first stream", bd.key) + case bd.b == nil: + log.Printf("[%v] no second stream yet", bd.key) + case !bd.b.done: + log.Printf("[%v] still waiting on second stream", bd.key) + default: + log.Printf("[%v] FINISHED, bytes: %d tx, %d rx", bd.key, bd.a.bytes, bd.b.bytes) + } +} + +func main() { + defer util.Run()() + log.Printf("starting capture on interface %q", *iface) + // Set up pcap packet capture + handle, err := pcap.OpenLive(*iface, int32(*snaplen), true, pcap.BlockForever) + if err != nil { + panic(err) + } + if err := handle.SetBPFFilter(*filter); err != nil { + panic(err) + } + + // Set up assembly + streamFactory := &myFactory{bidiMap: make(map[key]*bidi)} + streamPool := tcpassembly.NewStreamPool(streamFactory) + assembler := tcpassembly.NewAssembler(streamPool) + + log.Println("reading in packets") + // Read in packets, pass to assembler. + packetSource := gopacket.NewPacketSource(handle, handle.LinkType()) + packets := packetSource.Packets() + ticker := time.Tick(timeout / 4) + for { + select { + case packet := <-packets: + if *logAllPackets { + log.Println(packet) + } + if packet.NetworkLayer() == nil || packet.TransportLayer() == nil || packet.TransportLayer().LayerType() != layers.LayerTypeTCP { + log.Println("Unusable packet") + continue + } + tcp := packet.TransportLayer().(*layers.TCP) + assembler.AssembleWithTimestamp(packet.NetworkLayer().NetworkFlow(), tcp, packet.Metadata().Timestamp) + + case <-ticker: + // Every minute, flush connections that haven't seen activity in the past minute. + log.Println("---- FLUSHING ----") + assembler.FlushOlderThan(time.Now().Add(-timeout)) + streamFactory.collectOldStreams() + } + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/bytediff/bytediff.png b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/bytediff/bytediff.png new file mode 100644 index 00000000..5aa3c8a4 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/bytediff/bytediff.png differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/bytediff/main.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/bytediff/main.go new file mode 100644 index 00000000..3cbf9842 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/bytediff/main.go @@ -0,0 +1,96 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// This binary shows how to display byte differences to users via the bytediff +// library. +package main + +import ( + "fmt" + "github.com/tsg/gopacket/bytediff" +) + +var sliceA = []byte{ + 0x00, 0x00, 0x0c, 0x9f, 0xf0, 0x20, 0xbc, 0x30, 0x5b, 0xe8, 0xd3, 0x49, + 0x08, 0x00, 0x45, 0x00, 0x01, 0xa4, 0x39, 0xdf, 0x40, 0x00, 0x40, 0x06, + 0x55, 0x5a, 0xac, 0x11, 0x51, 0x49, 0xad, 0xde, 0xfe, 0xe1, 0xc5, 0xf7, + 0x00, 0x50, 0xc5, 0x7e, 0x0e, 0x48, 0x49, 0x07, 0x42, 0x32, 0x80, 0x18, + 0x00, 0x73, 0x9a, 0x8f, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a, 0x03, 0x77, + 0x37, 0x9c, 0x42, 0x77, 0x5e, 0x3a, 0x47, 0x45, 0x54, 0x20, 0x2f, 0x20, + 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, 0x6f, + 0x73, 0x74, 0x3a, 0x20, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x69, 0x73, 0x68, + 0x2e, 0x63, 0x6f, 0x6d, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6b, 0x65, 0x65, 0x70, 0x2d, 0x61, + 0x6c, 0x69, 0x76, 0x65, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, + 0x61, 0x2f, 0x35, 0x2e, 0x30, 0x20, 0x28, 0x58, 0x31, 0x31, 0x3b, 0x20, + 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x20, 0x78, 0x38, 0x36, 0x5f, 0x36, 0x34, + 0x29, 0x20, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, 0x4b, 0x69, + 0x74, 0x2f, 0x35, 0x33, 0x35, 0x2e, 0x32, 0x20, 0x28, 0x4b, 0x48, 0x54, + 0x4d, 0x4c, 0x2c, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x47, 0x65, 0x63, + 0x6b, 0x6f, 0x29, 0x20, 0x43, 0x68, 0x72, 0x6f, 0x6d, 0x65, 0x2f, 0x31, + 0x35, 0x2e, 0x30, 0x2e, 0x38, 0x37, 0x34, 0x2e, 0x31, 0x32, 0x31, 0x20, + 0x53, 0x61, 0x66, 0x61, 0x72, 0x69, 0x2f, 0x35, 0x2e, 0x31, + 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x74, 0x65, + 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x2c, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x68, 0x74, 0x6d, + 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x2c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x6d, 0x6c, 0x3b, 0x71, 0x3d, + 0x30, 0x2e, 0x39, 0x2c, 0x2a, 0x2f, 0x2a, 0x3b, 0x71, 0x3d, 0x30, 0x2e, + 0x38, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x67, 0x7a, 0x69, 0x70, + 0x2c, 0x64, 0x65, 0x66, 0x6c, 0x61, 0x74, 0x65, 0x2c, 0x73, 0x64, 0x63, + 0x68, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x4c, 0x61, + 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x65, 0x6e, 0x2d, 0x55, + 0x53, 0x2c, 0x65, 0x6e, 0x3b, 0x71, 0x3d, 0x30, 0x2e, 0x38, 0x0d, 0x0a, + 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x43, 0x68, 0x61, 0x72, 0x73, + 0x65, 0x74, 0x3a, 0x20, 0x49, 0x53, 0x4f, 0x2d, 0x38, 0x38, 0x35, 0x39, + 0x2d, 0x31, 0x2c, 0x75, 0x74, 0x66, 0x2d, 0x38, 0x3b, 0x71, 0x3d, 0x30, + 0x2e, 0x37, 0x2c, 0x2a, 0x3b, 0x71, 0x3d, 0x30, 0x2e, 0x33, 0x0d, 0x0a, + 0x0d, 0x0a, +} +var sliceB = []byte{ + 0x00, 0x00, 0x0c, 0x9f, 0xf0, 0x20, 0xbc, 0x30, 0x5b, 0xe8, 0xd3, 0x49, + 0x08, 0x00, 0x45, 0x00, 0x01, 0xa4, 0x39, 0xdf, 0x40, 0x00, 0x40, 0x06, + 0x55, 0x5a, 0xac, 0x11, 0x51, 0x49, 0xad, 0xde, 0xfe, 0xe1, 0xc5, 0xf7, + 0x00, 0x50, 0xc5, 0x7e, 0x0e, 0x48, 0x49, 0x07, 0x42, 0x32, 0x80, 0x18, + 0x00, 0x73, 0x9a, 0x8f, 0x00, 0x00, 0x01, 0x01, 0x08, 0x0a, 0x03, 0x77, + 0x37, 0x9c, 0x42, 0x77, 0x5e, 0x3a, 0x47, 0x45, 0x54, 0x20, 0x2f, 0x20, + 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, 0x6f, + 0x73, 0x74, 0x3a, 0x20, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x69, 0x73, 0x68, + 0x2e, 0x63, 0x6f, 0x6d, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x6c, 0x69, 0x76, 0x65, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, + 0x61, 0x2f, 0x35, 0x2e, 0x30, 0x20, 0x28, 0x58, 0x31, 0x31, 0x3b, 0x20, + 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x20, 0x78, 0x38, 0x36, 0x5f, 0x36, 0x34, + 0x29, 0x20, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, 0x4b, 0x69, + 0x74, 0x2f, 0x35, 0x33, 0x35, 0x2e, 0x32, 0x20, 0x28, 0x4b, 0x48, 0x54, + 0x4d, 0x4c, 0x2c, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x47, 0x65, 0x63, + 0x6b, 0x6f, 0x29, 0x20, 0x43, 0x68, 0x72, 0x6f, 0x6d, 0x65, 0x2f, 0x31, + 0x35, 0x2e, 0x30, 0x2e, 0x38, 0x37, 0x34, 0x2e, 0x31, 0x32, 0x31, 0x20, + 0x53, 0x61, 0x66, 0x61, 0x72, 0x69, 0x2f, 0x35, 0x33, 0x35, 0x2e, 0x32, + 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x74, 0x65, + 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x2c, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x68, 0x74, 0x6d, + 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x2c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x6d, 0x6c, 0x3b, 0x71, 0x3d, + 0x30, 0x2e, 0x39, 0x2c, 0x2a, 0x2f, 0x2a, 0x3b, 0x71, 0x3d, 0x30, 0x2e, + 0x38, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x67, 0x7a, 0x69, 0x70, + 0x2c, 0x64, 0x65, 0x66, 0x6c, 0x61, 0x74, 0x65, 0x2c, 0x73, 0x64, 0x63, + 0x68, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x4c, 0x61, + 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x65, 0x6e, 0x2d, 0x55, + 0x53, 0x2c, 0x65, 0x6e, 0x3b, 0x71, 0x3d, 0x30, 0x2e, 0x38, 0x0d, 0x0a, + 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x43, 0x68, 0x61, 0x72, 0x73, + 0x65, 0x74, 0x3a, 0x20, 0x49, 0x53, 0x4f, 0x2e, 0x39, 0x55, 0x35, 0x39, + 0x2d, 0x31, 0x2c, 0x75, 0x74, 0x66, 0x2d, 0x38, 0x3b, 0x71, 0x3d, 0x30, + 0x2e, 0x37, 0x2c, 0x2a, 0x3b, 0x71, 0x3d, 0x30, 0x2e, 0x33, 0x0d, 0x0a, + 0x0d, 0x0a, +} + +func main() { + fmt.Println(bytediff.BashOutput.String(bytediff.Diff(sliceA, sliceB))) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/httpassembly/main.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/httpassembly/main.go new file mode 100644 index 00000000..1e031db5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/httpassembly/main.go @@ -0,0 +1,127 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// This binary provides sample code for using the gopacket TCP assembler and TCP +// stream reader. It reads packets off the wire and reconstructs HTTP requests +// it sees, logging them. +package main + +import ( + "bufio" + "flag" + "io" + "log" + "net/http" + "time" + + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/examples/util" + "github.com/tsg/gopacket/layers" + "github.com/tsg/gopacket/pcap" + "github.com/tsg/gopacket/tcpassembly" + "github.com/tsg/gopacket/tcpassembly/tcpreader" +) + +var iface = flag.String("i", "eth0", "Interface to get packets from") +var fname = flag.String("r", "", "Filename to read from, overrides -i") +var snaplen = flag.Int("s", 1600, "SnapLen for pcap packet capture") +var filter = flag.String("f", "tcp and dst port 80", "BPF filter for pcap") +var logAllPackets = flag.Bool("v", false, "Logs every packet in great detail") + +// Build a simple HTTP request parser using tcpassembly.StreamFactory and tcpassembly.Stream interfaces + +// httpStreamFactory implements tcpassembly.StreamFactory +type httpStreamFactory struct{} + +// httpStream will handle the actual decoding of http requests. +type httpStream struct { + net, transport gopacket.Flow + r tcpreader.ReaderStream +} + +func (h *httpStreamFactory) New(net, transport gopacket.Flow) tcpassembly.Stream { + hstream := &httpStream{ + net: net, + transport: transport, + r: tcpreader.NewReaderStream(), + } + go hstream.run() // Important... we must guarantee that data from the reader stream is read. + + // ReaderStream implements tcpassembly.Stream, so we can return a pointer to it. + return &hstream.r +} + +func (h *httpStream) run() { + buf := bufio.NewReader(&h.r) + for { + req, err := http.ReadRequest(buf) + if err == io.EOF { + // We must read until we see an EOF... very important! + return + } else if err != nil { + log.Println("Error reading stream", h.net, h.transport, ":", err) + } else { + bodyBytes := tcpreader.DiscardBytesToEOF(req.Body) + req.Body.Close() + log.Println("Received request from stream", h.net, h.transport, ":", req, "with", bodyBytes, "bytes in request body") + } + } +} + +func main() { + defer util.Run()() + var handle *pcap.Handle + var err error + + // Set up pcap packet capture + if *fname != "" { + log.Printf("Reading from pcap dump %q", *fname) + handle, err = pcap.OpenOffline(*fname) + } else { + log.Printf("Starting capture on interface %q", *iface) + handle, err = pcap.OpenLive(*iface, int32(*snaplen), true, pcap.BlockForever) + } + if err != nil { + log.Fatal(err) + } + + if err := handle.SetBPFFilter(*filter); err != nil { + log.Fatal(err) + } + + // Set up assembly + streamFactory := &httpStreamFactory{} + streamPool := tcpassembly.NewStreamPool(streamFactory) + assembler := tcpassembly.NewAssembler(streamPool) + + log.Println("reading in packets") + // Read in packets, pass to assembler. + packetSource := gopacket.NewPacketSource(handle, handle.LinkType()) + packets := packetSource.Packets() + ticker := time.Tick(time.Minute) + for { + select { + case packet := <-packets: + // A nil packet indicates the end of a pcap file. + if packet == nil { + return + } + if *logAllPackets { + log.Println(packet) + } + if packet.NetworkLayer() == nil || packet.TransportLayer() == nil || packet.TransportLayer().LayerType() != layers.LayerTypeTCP { + log.Println("Unusable packet") + continue + } + tcp := packet.TransportLayer().(*layers.TCP) + assembler.AssembleWithTimestamp(packet.NetworkLayer().NetworkFlow(), tcp, packet.Metadata().Timestamp) + + case <-ticker: + // Every minute, flush connections that haven't seen activity in the past 2 minutes. + assembler.FlushOlderThan(time.Now().Add(time.Minute * -2)) + } + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/pcapdump/main.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/pcapdump/main.go new file mode 100644 index 00000000..906ce9ef --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/pcapdump/main.go @@ -0,0 +1,73 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// The pcapdump binary implements a tcpdump-like command line tool with gopacket +// using pcap as a backend data collection mechanism. +package main + +import ( + "flag" + "fmt" + "github.com/tsg/gopacket/dumpcommand" + "github.com/tsg/gopacket/examples/util" + "github.com/tsg/gopacket/pcap" + "log" + "os" + "strings" + "time" +) + +var iface = flag.String("i", "eth0", "Interface to read packets from") +var fname = flag.String("r", "", "Filename to read from, overrides -i") +var snaplen = flag.Int("s", 65536, "Snap length (number of bytes max to read per packet") +var tstype = flag.String("timestamp_type", "", "Type of timestamps to use") +var promisc = flag.Bool("promisc", true, "Set promiscuous mode") + +func main() { + defer util.Run()() + var handle *pcap.Handle + var err error + if *fname != "" { + if handle, err = pcap.OpenOffline(*fname); err != nil { + log.Fatal("PCAP OpenOffline error:", err) + } + } else { + // This is a little complicated because we want to allow all possible options + // for creating the packet capture handle... instead of all this you can + // just call pcap.OpenLive if you want a simple handle. + inactive, err := pcap.NewInactiveHandle(*iface) + if err != nil { + log.Fatal("could not create: %v", err) + } + defer inactive.CleanUp() + if err = inactive.SetSnapLen(*snaplen); err != nil { + log.Fatal("could not set snap length: %v", err) + } else if err = inactive.SetPromisc(*promisc); err != nil { + log.Fatal("could not set promisc mode: %v", err) + } else if err = inactive.SetTimeout(time.Second); err != nil { + log.Fatal("could not set timeout: %v", err) + } + if *tstype != "" { + if t, err := pcap.TimestampSourceFromString(*tstype); err != nil { + log.Fatalf("Supported timestamp types: %v", inactive.SupportedTimestamps()) + } else if err := inactive.SetTimestampSource(t); err != nil { + log.Fatalf("Supported timestamp types: %v", inactive.SupportedTimestamps()) + } + } + if handle, err = inactive.Activate(); err != nil { + log.Fatal("PCAP Activate error:", err) + } + defer handle.Close() + if len(flag.Args()) > 0 { + bpffilter := strings.Join(flag.Args(), " ") + fmt.Fprintf(os.Stderr, "Using BPF filter %q\n", bpffilter) + if err = handle.SetBPFFilter(bpffilter); err != nil { + log.Fatal("BPF filter error:", err) + } + } + } + dumpcommand.Run(handle) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/pfdump/main.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/pfdump/main.go new file mode 100644 index 00000000..acedc9bd --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/pfdump/main.go @@ -0,0 +1,52 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// The pfdump binary implements a tcpdump-like command line tool with gopacket +// using pfring as a backend data collection mechanism. +package main + +import ( + "flag" + "fmt" + "github.com/tsg/gopacket/dumpcommand" + "github.com/tsg/gopacket/examples/util" + "github.com/tsg/gopacket/pfring" + "log" + "os" + "strings" +) + +var iface = flag.String("i", "eth0", "Interface to read packets from") +var snaplen = flag.Int("s", 65536, "Snap length (number of bytes max to read per packet") +var cluster = flag.Int("cluster", -1, "If >= 0, sets the pfring cluster to this value") +var clustertype = flag.Int("clustertype", int(pfring.ClusterPerFlow), "Cluster type") + +func main() { + defer util.Run()() + var ring *pfring.Ring + var err error + if ring, err = pfring.NewRing(*iface, uint32(*snaplen), pfring.FlagPromisc); err != nil { + log.Fatalln("pfring ring creation error:", err) + } + if len(flag.Args()) > 0 { + bpffilter := strings.Join(flag.Args(), " ") + fmt.Fprintf(os.Stderr, "Using BPF filter %q\n", bpffilter) + if err = ring.SetBPFFilter(bpffilter); err != nil { + log.Fatalln("BPF filter error:", err) + } + } + if *cluster >= 0 { + if err = ring.SetCluster(*cluster, pfring.ClusterType(*clustertype)); err != nil { + log.Fatalln("pfring SetCluster error:", err) + } + } + if err = ring.SetSocketMode(pfring.ReadOnly); err != nil { + log.Fatalln("pfring SetSocketMode error:", err) + } else if err = ring.Enable(); err != nil { + log.Fatalln("pfring Enable error:", err) + } + dumpcommand.Run(ring) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/statsassembly/main.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/statsassembly/main.go new file mode 100644 index 00000000..00393e53 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/statsassembly/main.go @@ -0,0 +1,211 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// This binary provides sample code for using the gopacket TCP assembler raw, +// without the help of the tcpreader library. It watches TCP streams and +// reports statistics on completed streams. +// +// It also uses gopacket.DecodingLayerParser instead of the normal +// gopacket.PacketSource, to highlight the methods, pros, and cons of this +// approach. +package main + +import ( + "flag" + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/examples/util" + "github.com/tsg/gopacket/layers" + "github.com/tsg/gopacket/pcap" + "github.com/tsg/gopacket/tcpassembly" + "log" + "time" +) + +var iface = flag.String("i", "eth0", "Interface to get packets from") +var snaplen = flag.Int("s", 65536, "SnapLen for pcap packet capture") +var filter = flag.String("f", "tcp", "BPF filter for pcap") +var logAllPackets = flag.Bool("v", false, "Log whenever we see a packet") +var bufferedPerConnection = flag.Int("connection_max_buffer", 0, ` +Max packets to buffer for a single connection before skipping over a gap in data +and continuing to stream the connection after the buffer. If zero or less, this +is infinite.`) +var bufferedTotal = flag.Int("total_max_buffer", 0, ` +Max packets to buffer total before skipping over gaps in connections and +continuing to stream connection data. If zero or less, this is infinite`) +var flushAfter = flag.String("flush_after", "2m", ` +Connections which have buffered packets (they've gotten packets out of order and +are waiting for old packets to fill the gaps) are flushed after they're this old +(their oldest gap is skipped). Any string parsed by time.ParseDuration is +acceptable here`) +var packetCount = flag.Int("c", -1, ` +Quit after processing this many packets, flushing all currently buffered +connections. If negative, this is infinite`) + +// simpleStreamFactory implements tcpassembly.StreamFactory +type statsStreamFactory struct{} + +// statsStream will handle the actual decoding of stats requests. +type statsStream struct { + net, transport gopacket.Flow + bytes, packets, outOfOrder, skipped int64 + start, end time.Time + sawStart, sawEnd bool +} + +// New creates a new stream. It's called whenever the assembler sees a stream +// it isn't currently following. +func (factory *statsStreamFactory) New(net, transport gopacket.Flow) tcpassembly.Stream { + log.Printf("new stream %v:%v started", net, transport) + s := &statsStream{ + net: net, + transport: transport, + start: time.Now(), + } + s.end = s.start + // ReaderStream implements tcpassembly.Stream, so we can return a pointer to it. + return s +} + +// Reassembled is called whenever new packet data is available for reading. +// Reassembly objects contain stream data IN ORDER. +func (s *statsStream) Reassembled(reassemblies []tcpassembly.Reassembly) { + for _, reassembly := range reassemblies { + if reassembly.Seen.Before(s.end) { + s.outOfOrder++ + } else { + s.end = reassembly.Seen + } + s.bytes += int64(len(reassembly.Bytes)) + s.packets += 1 + if reassembly.Skip > 0 { + s.skipped += int64(reassembly.Skip) + } + s.sawStart = s.sawStart || reassembly.Start + s.sawEnd = s.sawEnd || reassembly.End + } +} + +// ReassemblyComplete is called when the TCP assembler believes a stream has +// finished. +func (s *statsStream) ReassemblyComplete() { + diffSecs := float64(s.end.Sub(s.start)) / float64(time.Second) + log.Printf("Reassembly of stream %v:%v complete - start:%v end:%v bytes:%v packets:%v ooo:%v bps:%v pps:%v skipped:%v", + s.net, s.transport, s.start, s.end, s.bytes, s.packets, s.outOfOrder, + float64(s.bytes)/diffSecs, float64(s.packets)/diffSecs, s.skipped) +} + +func main() { + defer util.Run()() + + flushDuration, err := time.ParseDuration(*flushAfter) + if err != nil { + log.Fatal("invalid flush duration: ", *flushAfter) + } + + log.Printf("starting capture on interface %q", *iface) + // Set up pcap packet capture + handle, err := pcap.OpenLive(*iface, int32(*snaplen), true, flushDuration/2) + if err != nil { + log.Fatal("error opening pcap handle: ", err) + } + if err := handle.SetBPFFilter(*filter); err != nil { + log.Fatal("error setting BPF filter: ", err) + } + + // Set up assembly + streamFactory := &statsStreamFactory{} + streamPool := tcpassembly.NewStreamPool(streamFactory) + assembler := tcpassembly.NewAssembler(streamPool) + assembler.MaxBufferedPagesPerConnection = *bufferedPerConnection + assembler.MaxBufferedPagesTotal = *bufferedTotal + + log.Println("reading in packets") + + // We use a DecodingLayerParser here instead of a simpler PacketSource. + // This approach should be measurably faster, but is also more rigid. + // PacketSource will handle any known type of packet safely and easily, + // but DecodingLayerParser will only handle those packet types we + // specifically pass in. This trade-off can be quite useful, though, in + // high-throughput situations. + var eth layers.Ethernet + var dot1q layers.Dot1Q + var ip4 layers.IPv4 + var ip6 layers.IPv6 + var ip6extensions layers.IPv6ExtensionSkipper + var tcp layers.TCP + var payload gopacket.Payload + parser := gopacket.NewDecodingLayerParser(layers.LayerTypeEthernet, + ð, &dot1q, &ip4, &ip6, &ip6extensions, &tcp, &payload) + decoded := make([]gopacket.LayerType, 0, 4) + + nextFlush := time.Now().Add(flushDuration / 2) + + var byteCount int64 + start := time.Now() + +loop: + for ; *packetCount != 0; *packetCount-- { + // Check to see if we should flush the streams we have + // that haven't seen any new data in a while. Note we set a + // timeout on our PCAP handle, so this should happen even if we + // never see packet data. + if time.Now().After(nextFlush) { + stats, _ := handle.Stats() + log.Printf("flushing all streams that haven't seen packets in the last 2 minutes, pcap stats: %+v", stats) + assembler.FlushOlderThan(time.Now().Add(flushDuration)) + nextFlush = time.Now().Add(flushDuration / 2) + } + + // To speed things up, we're also using the ZeroCopy method for + // reading packet data. This method is faster than the normal + // ReadPacketData, but the returned bytes in 'data' are + // invalidated by any subsequent ZeroCopyReadPacketData call. + // Note that tcpassembly is entirely compatible with this packet + // reading method. This is another trade-off which might be + // appropriate for high-throughput sniffing: it avoids a packet + // copy, but its cost is much more careful handling of the + // resulting byte slice. + data, ci, err := handle.ZeroCopyReadPacketData() + + if err != nil { + log.Printf("error getting packet: %v", err) + continue + } + err = parser.DecodeLayers(data, &decoded) + if err != nil { + log.Printf("error decoding packet: %v", err) + continue + } + if *logAllPackets { + log.Printf("decoded the following layers: %v", decoded) + } + byteCount += int64(len(data)) + // Find either the IPv4 or IPv6 address to use as our network + // layer. + foundNetLayer := false + var netFlow gopacket.Flow + for _, typ := range decoded { + switch typ { + case layers.LayerTypeIPv4: + netFlow = ip4.NetworkFlow() + foundNetLayer = true + case layers.LayerTypeIPv6: + netFlow = ip6.NetworkFlow() + foundNetLayer = true + case layers.LayerTypeTCP: + if foundNetLayer { + assembler.AssembleWithTimestamp(netFlow, &tcp, ci.Timestamp) + } else { + log.Println("could not find IPv4 or IPv6 layer, inoring") + } + continue loop + } + } + log.Println("could not find TCP layer") + } + assembler.FlushAll() + log.Printf("processed %d bytes in %v", byteCount, time.Since(start)) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/synscan/main.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/synscan/main.go new file mode 100644 index 00000000..dbecfaee --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/synscan/main.go @@ -0,0 +1,260 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// synscan implements a TCP syn scanner on top of pcap. +// It's more complicated than arpscan, since it has to handle sending packets +// outside the local network, requiring some routing and ARP work. +// +// Since this is just an example program, it aims for simplicity over +// performance. It doesn't handle sending packets very quickly, it scans IPs +// serially instead of in parallel, and uses gopacket.Packet instead of +// gopacket.DecodingLayerParser for packet processing. We also make use of very +// simple timeout logic with time.Since. +// +// Making it blazingly fast is left as an exercise to the reader. +package main + +import ( + "bytes" + "flag" + "fmt" + "log" + "net" + "time" + + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/examples/util" + "github.com/tsg/gopacket/layers" + "github.com/tsg/gopacket/pcap" + "github.com/tsg/gopacket/routing" +) + +// scanner handles scanning a single IP address. +type scanner struct { + // iface is the interface to send packets on. + iface *net.Interface + // destination, gateway (if applicable), and soruce IP addresses to use. + dst, gw, src net.IP + + handle *pcap.Handle + + // opts and buf allow us to easily serialize packets in the send() + // method. + opts gopacket.SerializeOptions + buf gopacket.SerializeBuffer +} + +// newScanner creates a new scanner for a given destination IP address, using +// router to determine how to route packets to that IP. +func newScanner(ip net.IP, router routing.Router) (*scanner, error) { + s := &scanner{ + dst: ip, + opts: gopacket.SerializeOptions{ + FixLengths: true, + ComputeChecksums: true, + }, + buf: gopacket.NewSerializeBuffer(), + } + // Figure out the route to the IP. + iface, gw, src, err := router.Route(ip) + if err != nil { + return nil, err + } + log.Printf("scanning ip %v with interface %v, gateway %v, src %v", ip, iface.Name, gw, src) + s.gw, s.src, s.iface = gw, src, iface + + // Open the handle for reading/writing. + // Note we could very easily add some BPF filtering here to greatly + // decrease the number of packets we have to look at when getting back + // scan results. + handle, err := pcap.OpenLive(iface.Name, 65536, true, pcap.BlockForever) + if err != nil { + return nil, err + } + s.handle = handle + return s, nil +} + +// close cleans up the handle. +func (s *scanner) close() { + s.handle.Close() +} + +// getHwAddr is a hacky but effective way to get the destination hardware +// address for our packets. It does an ARP request for our gateway (if there is +// one) or destination IP (if no gateway is necessary), then waits for an ARP +// reply. This is pretty slow right now, since it blocks on the ARP +// request/reply. +func (s *scanner) getHwAddr() (net.HardwareAddr, error) { + start := time.Now() + arpDst := s.dst + if s.gw != nil { + arpDst = s.gw + } + // Prepare the layers to send for an ARP request. + eth := layers.Ethernet{ + SrcMAC: s.iface.HardwareAddr, + DstMAC: net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + EthernetType: layers.EthernetTypeARP, + } + arp := layers.ARP{ + AddrType: layers.LinkTypeEthernet, + Protocol: layers.EthernetTypeIPv4, + HwAddressSize: 6, + ProtAddressSize: 4, + Operation: layers.ARPRequest, + SourceHwAddress: []byte(s.iface.HardwareAddr), + SourceProtAddress: []byte(s.src), + DstHwAddress: []byte{0, 0, 0, 0, 0, 0}, + DstProtAddress: []byte(arpDst), + } + // Send a single ARP request packet (we never retry a send, since this + // is just an example ;) + if err := s.send(ð, &arp); err != nil { + return nil, err + } + // Wait 3 seconds for an ARP reply. + for { + if time.Since(start) > time.Second*3 { + return nil, fmt.Errorf("timeout getting ARP reply") + } + data, _, err := s.handle.ReadPacketData() + if err == pcap.NextErrorTimeoutExpired { + continue + } else if err != nil { + return nil, err + } + packet := gopacket.NewPacket(data, layers.LayerTypeEthernet, gopacket.NoCopy) + if arpLayer := packet.Layer(layers.LayerTypeARP); arpLayer != nil { + arp := arpLayer.(*layers.ARP) + if bytes.Equal(arp.SourceProtAddress, arpDst) { + return net.HardwareAddr(arp.SourceHwAddress), nil + } + } + } +} + +// scan scans the dst IP address of this scanner. +func (s *scanner) scan() error { + // First off, get the MAC address we should be sending packets to. + hwaddr, err := s.getHwAddr() + if err != nil { + return err + } + // Construct all the network layers we need. + eth := layers.Ethernet{ + SrcMAC: s.iface.HardwareAddr, + DstMAC: hwaddr, + EthernetType: layers.EthernetTypeIPv4, + } + ip4 := layers.IPv4{ + SrcIP: s.src, + DstIP: s.dst, + Version: 4, + TTL: 64, + Protocol: layers.IPProtocolTCP, + } + tcp := layers.TCP{ + SrcPort: 54321, + DstPort: 0, // will be incremented during the scan + SYN: true, + } + tcp.SetNetworkLayerForChecksum(&ip4) + + // Create the flow we expect returning packets to have, so we can check + // against it and discard useless packets. + ipFlow := gopacket.NewFlow(layers.EndpointIPv4, s.dst, s.src) + start := time.Now() + for { + // Send one packet per loop iteration until we've sent packets + // to all of ports [1, 65535]. + if tcp.DstPort < 65535 { + start = time.Now() + tcp.DstPort++ + if err := s.send(ð, &ip4, &tcp); err != nil { + log.Printf("error sending to port %v: %v", tcp.DstPort, err) + } + } + // Time out 5 seconds after the last packet we sent. + if time.Since(start) > time.Second*5 { + log.Printf("timed out for %v, assuming we've seen all we can", s.dst) + return nil + } + + // Read in the next packet. + data, _, err := s.handle.ReadPacketData() + if err == pcap.NextErrorTimeoutExpired { + continue + } else if err != nil { + log.Printf("error reading packet: %v", err) + continue + } + + // Parse the packet. We'd use DecodingLayerParser here if we + // wanted to be really fast. + packet := gopacket.NewPacket(data, layers.LayerTypeEthernet, gopacket.NoCopy) + + // Find the packets we care about, and print out logging + // information about them. All others are ignored. + if net := packet.NetworkLayer(); net == nil { + // log.Printf("packet has no network layer") + } else if net.NetworkFlow() != ipFlow { + // log.Printf("packet does not match our ip src/dst") + } else if tcpLayer := packet.Layer(layers.LayerTypeTCP); tcpLayer == nil { + // log.Printf("packet has not tcp layer") + } else if tcp, ok := tcpLayer.(*layers.TCP); !ok { + // We panic here because this is guaranteed to never + // happen. + panic("tcp layer is not tcp layer :-/") + } else if tcp.DstPort != 54321 { + // log.Printf("dst port %v does not match", tcp.DstPort) + } else if tcp.RST { + log.Printf(" port %v closed", tcp.SrcPort) + } else if tcp.SYN && tcp.ACK { + log.Printf(" port %v open", tcp.SrcPort) + } else { + // log.Printf("ignoring useless packet") + } + } +} + +// send sends the given layers as a single packet on the network. +func (s *scanner) send(l ...gopacket.SerializableLayer) error { + if err := gopacket.SerializeLayers(s.buf, s.opts, l...); err != nil { + return err + } + return s.handle.WritePacketData(s.buf.Bytes()) +} + +func main() { + defer util.Run()() + router, err := routing.New() + if err != nil { + log.Fatal("routing error:", err) + } + for _, arg := range flag.Args() { + var ip net.IP + if ip = net.ParseIP(arg); ip == nil { + log.Printf("non-ip target: %q", arg) + continue + } else if ip = ip.To4(); ip == nil { + log.Printf("non-ipv4 target: %q", arg) + continue + } + // Note: newScanner creates and closes a pcap Handle once for + // every scan target. We could do much better, were this not an + // example ;) + s, err := newScanner(ip, router) + if err != nil { + log.Printf("unable to create scanner for %v: %v", ip, err) + continue + } + if err := s.scan(); err != nil { + log.Printf("unable to scan %v: %v", ip, err) + } + s.close() + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/util/util.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/util/util.go new file mode 100644 index 00000000..0f698fb9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/examples/util/util.go @@ -0,0 +1,40 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// Package util provides shared utilities for all gopacket examples. +package util + +import ( + "flag" + "log" + "os" + "runtime/pprof" +) + +var cpuprofile = flag.String("cpuprofile", "", "Where to write CPU profile") + +// Run starts up stuff at the beginning of a main function, and returns a +// function to defer until the function completes. It should be used like this: +// +// func main() { +// defer util.Run()() +// ... stuff ... +// } +func Run() func() { + flag.Parse() + if *cpuprofile != "" { + f, err := os.Create(*cpuprofile) + if err != nil { + log.Fatalf("could not open cpu profile file %q", *cpuprofile) + } + pprof.StartCPUProfile(f) + return func() { + pprof.StopCPUProfile() + f.Close() + } + } + return func() {} +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/flows.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/flows.go new file mode 100644 index 00000000..ff8be5ab --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/flows.go @@ -0,0 +1,236 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package gopacket + +import ( + "bytes" + "fmt" + "strconv" +) + +// MaxEndpointSize determines the maximum size in bytes of an endpoint address. +// +// Endpoints/Flows have a problem: They need to be hashable. Therefore, they +// can't use a byte slice. The two obvious choices are to use a string or a +// byte array. Strings work great, but string creation requires memory +// allocation, which can be slow. Arrays work great, but have a fixed size. We +// originally used the former, now we've switched to the latter. Use of a fixed +// byte-array doubles the speed of constructing a flow (due to not needing to +// allocate). This is a huge increase... too much for us to pass up. +// +// The end result of this, though, is that an endpoint/flow can't be created +// using more than MaxEndpointSize bytes per address. +const MaxEndpointSize = 16 + +// Endpoint is the set of bytes used to address packets at various layers. +// See LinkLayer, NetworkLayer, and TransportLayer specifications. +// Endpoints are usable as map keys. +type Endpoint struct { + typ EndpointType + len int + raw [MaxEndpointSize]byte +} + +// EndpointType returns the endpoint type associated with this endpoint. +func (e Endpoint) EndpointType() EndpointType { return e.typ } + +// Raw returns the raw bytes of this endpoint. These aren't human-readable +// most of the time, but they are faster than calling String. +func (e Endpoint) Raw() []byte { return e.raw[:] } + +// LessThan provides a stable ordering for all endpoints. It sorts first based +// on the EndpointType of an endpoint, then based on the raw bytes of that +// endpoint. +// +// For some endpoints, the actual comparison may not make sense, however this +// ordering does provide useful information for most Endpoint types. +// Ordering is based first on endpoint type, then on raw endpoint bytes. +// Endpoint bytes are sorted lexigraphically. +func (a Endpoint) LessThan(b Endpoint) bool { + return a.typ < b.typ || (a.typ == b.typ && bytes.Compare(a.raw[:a.len], b.raw[:b.len]) < 0) +} + +// fnvHash is used by our FastHash functions, and implements the FNV hash +// created by Glenn Fowler, Landon Curt Noll, and Phong Vo. +// See http://isthe.com/chongo/tech/comp/fnv/. +func fnvHash(s []byte) (h uint64) { + h = fnvBasis + for i := 0; i < len(s); i++ { + h ^= uint64(s[i]) + h *= fnvPrime + } + return +} + +const fnvBasis = 14695981039346656037 +const fnvPrime = 1099511628211 + +// FastHash provides a quick hashing function for an endpoint, useful if you'd +// like to split up endpoints by modulos or other load-balancing techniques. +// It uses a variant of Fowler-Noll-Vo hashing. +// +// The output of FastHash is not guaranteed to remain the same through future +// code revisions, so should not be used to key values in persistent storage. +func (a Endpoint) FastHash() (h uint64) { + h = fnvHash(a.raw[:a.len]) + h ^= uint64(a.typ) + h *= fnvPrime + return +} + +// NewEndpoint creates a new Endpoint object. +// +// The size of raw must be less than MaxEndpointSize, otherwise this function +// will panic. +func NewEndpoint(typ EndpointType, raw []byte) (e Endpoint) { + e.len = len(raw) + if e.len > MaxEndpointSize { + panic("raw byte length greater than MaxEndpointSize") + } + e.typ = typ + copy(e.raw[:], raw) + return +} + +// EndpointTypeMetadata is used to register a new endpoint type. +type EndpointTypeMetadata struct { + // Name is the string returned by an EndpointType's String function. + Name string + // Formatter is called from an Endpoint's String function to format the raw + // bytes in an Endpoint into a human-readable string. + Formatter func([]byte) string +} + +// EndpointType is the type of a gopacket Endpoint. This type determines how +// the bytes stored in the endpoint should be interpreted. +type EndpointType int64 + +var endpointTypes = map[EndpointType]EndpointTypeMetadata{} + +// RegisterEndpointType creates a new EndpointType and registers it globally. +// It MUST be passed a unique number, or it will panic. Numbers 0-999 are +// reserved for gopacket's use. +func RegisterEndpointType(num int, meta EndpointTypeMetadata) EndpointType { + t := EndpointType(num) + if _, ok := endpointTypes[t]; ok { + panic("Endpoint type number already in use") + } + endpointTypes[t] = meta + return t +} + +func (e EndpointType) String() string { + if t, ok := endpointTypes[e]; ok { + return t.Name + } + return strconv.Itoa(int(e)) +} + +func (e Endpoint) String() string { + if t, ok := endpointTypes[e.typ]; ok && t.Formatter != nil { + return t.Formatter(e.raw[:e.len]) + } + return fmt.Sprintf("%v:%v", e.typ, e.raw) +} + +// Flow represents the direction of traffic for a packet layer, as a source and destination Endpoint. +// Flows are usable as map keys. +type Flow struct { + typ EndpointType + slen, dlen int + src, dst [MaxEndpointSize]byte +} + +// FlowFromEndpoints creates a new flow by pasting together two endpoints. +// The endpoints must have the same EndpointType, or this function will return +// an error. +func FlowFromEndpoints(src, dst Endpoint) (_ Flow, err error) { + if src.typ != dst.typ { + err = fmt.Errorf("Mismatched endpoint types: %v->%v", src.typ, dst.typ) + return + } + return Flow{src.typ, src.len, dst.len, src.raw, dst.raw}, nil +} + +// FastHash provides a quick hashing function for a flow, useful if you'd +// like to split up flows by modulos or other load-balancing techniques. +// It uses a variant of Fowler-Noll-Vo hashing, and is guaranteed to collide +// with its reverse flow. IE: the flow A->B will have the same hash as the flow +// B->A. +// +// The output of FastHash is not guaranteed to remain the same through future +// code revisions, so should not be used to key values in persistent storage. +func (a Flow) FastHash() (h uint64) { + // This combination must be commutative. We don't use ^, since that would + // give the same hash for all A->A flows. + h = fnvHash(a.src[:a.slen]) + fnvHash(a.dst[:a.dlen]) + h ^= uint64(a.typ) + h *= fnvPrime + return +} + +// String returns a human-readable representation of this flow, in the form +// "Src->Dst" +func (f Flow) String() string { + s, d := f.Endpoints() + return fmt.Sprintf("%v->%v", s, d) +} + +// EndpointType returns the EndpointType for this Flow. +func (f Flow) EndpointType() EndpointType { + return f.typ +} + +// Endpoints returns the two Endpoints for this flow. +func (f Flow) Endpoints() (src, dst Endpoint) { + return Endpoint{f.typ, f.slen, f.src}, Endpoint{f.typ, f.dlen, f.dst} +} + +// Src returns the source Endpoint for this flow. +func (f Flow) Src() (src Endpoint) { + src, _ = f.Endpoints() + return +} + +// Dst returns the destination Endpoint for this flow. +func (f Flow) Dst() (dst Endpoint) { + _, dst = f.Endpoints() + return +} + +// Reverse returns a new flow with endpoints reversed. +func (f Flow) Reverse() Flow { + return Flow{f.typ, f.dlen, f.slen, f.dst, f.src} +} + +// NewFlow creates a new flow. +// +// src and dst must have length <= MaxEndpointSize, otherwise NewFlow will +// panic. +func NewFlow(t EndpointType, src, dst []byte) (f Flow) { + f.slen = len(src) + f.dlen = len(dst) + if f.slen > MaxEndpointSize || f.dlen > MaxEndpointSize { + panic("flow raw byte length greater than MaxEndpointSize") + } + f.typ = t + copy(f.src[:], src) + copy(f.dst[:], dst) + return +} + +// EndpointInvalid is an endpoint type used for invalid endpoints, IE endpoints +// that are specified incorrectly during creation. +var EndpointInvalid EndpointType = RegisterEndpointType(0, EndpointTypeMetadata{"invalid", func(b []byte) string { + return fmt.Sprintf("%v", b) +}}) + +// InvalidEndpoint is a singleton Endpoint of type EndpointInvalid. +var InvalidEndpoint Endpoint = NewEndpoint(EndpointInvalid, nil) + +// InvalidFlow is a singleton Flow of type EndpointInvalid. +var InvalidFlow Flow = NewFlow(EndpointInvalid, nil, nil) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/gc b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/gc new file mode 100755 index 00000000..6ef9f31f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/gc @@ -0,0 +1,271 @@ +#!/bin/bash +# Copyright 2012 Google, Inc. All rights reserved. + +# This script provides a simple way to run benchmarks against previous code and +# keep a log of how benchmarks change over time. When used with the --benchmark +# flag, it runs benchmarks from the current code and from the last commit run +# with --benchmark, then stores the results in the git commit description. We +# rerun the old benchmarks along with the new ones, since there's no guarantee +# that git commits will happen on the same machine, so machine differences could +# cause wildly inaccurate results. +# +# If you're making changes to 'gopacket' which could cause performance changes, +# you may be requested to use this commit script to make sure your changes don't +# have large detrimental effects (or to show off how awesome your performance +# improvements are). +# +# If not run with the --benchmark flag, this script is still very useful... it +# makes sure all the correct go formatting, building, and testing work as +# expected. + +function Usage { + cat < + +--benchmark: Run benchmark comparisons against last benchmark'd commit +--root: Run tests that require root priviledges +--gen: Generate code for MACs/ports by pulling down external data + +Note, some 'git commit' flags are necessary, if all else fails, pass in -a +EOF + exit 1 +} + +BENCH="" +GEN="" +ROOT="" +while [ ! -z "$1" ]; do + case "$1" in + "--benchmark") + BENCH="$2" + shift + shift + ;; + "--gen") + GEN="yes" + shift + ;; + "--root") + ROOT="yes" + shift + ;; + "--help") + Usage + ;; + "-h") + Usage + ;; + "help") + Usage + ;; + *) + break + ;; + esac +done + +function Root { + if [ ! -z "$ROOT" ]; then + local exec="$1" + # Some folks (like me) keep source code in places inaccessible by root (like + # NFS), so to make sure things run smoothly we copy them to a /tmp location. + local tmpfile="$(mktemp -t gopacket_XXXXXXXX)" + echo "Running root test executable $exec as $tmpfile" + cp "$exec" "$tmpfile" + chmod a+x "$tmpfile" + shift + sudo "$tmpfile" "$@" + fi +} + +if [ "$#" -eq "0" ]; then + Usage +fi + +cd $(dirname $0) + +# Check for copyright notices. +for filename in $(find ./ -type f -name '*.go'); do + if ! head -n 1 "$filename" | grep -q Copyright; then + echo "File '$filename' may not have copyright notice" + exit 1 + fi +done + +set -e +set -x + +if [ ! -z "$ROOT" ]; then + echo "Running SUDO to get root priviledges for root tests" + sudo echo "have root" +fi + +if [ ! -z "$GEN" ]; then + pushd macs + go run gen.go | gofmt > valid_mac_prefixes.go + popd + pushd layers + go run gen.go | gofmt > iana_ports.go + popd +fi + +# Make sure everything is formatted, compiles, and tests pass. +go fmt ./... +go test -i ./... 2>/dev/null >/dev/null || true +go test +go build +pushd examples/bytediff +go build +popd +if [ -f /usr/include/pcap.h ]; then + pushd pcap + go test ./... + go build ./... + go build pcap_tester.go + Root pcap_tester --mode=basic + Root pcap_tester --mode=filtered + Root pcap_tester --mode=timestamp || echo "You might not support timestamp sources" + popd + pushd examples/pcapdump + go build + popd + pushd examples/arpscan + go build + popd + pushd examples/bidirectional + go build + popd + pushd examples/synscan + go build + popd + pushd examples/httpassembly + go build + popd + pushd examples/statsassembly + go build + popd +fi +pushd macs +go test ./... +gofmt -w gen.go +go build gen.go +popd +pushd tcpassembly +go test ./... +popd +pushd layers +gofmt -w gen.go +go build gen.go +go test ./... +popd +pushd pcapgo +go test ./... +go build ./... +popd +if [ -f /usr/include/linux/if_packet.h ]; then + if grep -q TPACKET_V3 /usr/include/linux/if_packet.h; then + pushd afpacket + go build ./... + go test ./... + popd + fi +fi +if [ -f /usr/include/pfring.h ]; then + pushd pfring + go test ./... + go build ./... + popd + pushd examples/pfdump + go build + popd +fi + +# Run our initial commit +git commit "$@" + +if [ -z "$BENCH" ]; then + set +x + echo "We're not benchmarking and we've committed... we're done!" + exit +fi + +### If we get here, we want to run benchmarks from current commit, and compare +### then to benchmarks from the last --benchmark commit. + +# Get our current branch. +BRANCH="$(git branch | grep '^*' | awk '{print $2}')" + +# File we're going to build our commit description in. +COMMIT_FILE="$(mktemp /tmp/tmp.XXXXXXXX)" + +# Add the word "BENCH" to the start of the git commit. +echo -n "BENCH " > $COMMIT_FILE + +# Get the current description... there must be an easier way. +git log -n 1 | grep '^ ' | sed 's/^ //' >> $COMMIT_FILE + +# Get the commit sha for the last benchmark commit +PREV=$(git log -n 1 --grep='BENCHMARK_MARKER_DO_NOT_CHANGE' | head -n 1 | awk '{print $2}') + +## Run current benchmarks + +cat >> $COMMIT_FILE <&1 | tee -a $COMMIT_FILE +pushd layers +go test --test.bench="$BENCH" 2>&1 | tee -a $COMMIT_FILE +popd +cat >> $COMMIT_FILE <&1 | tee -a $COMMIT_FILE +fi + + + +## Reset to last benchmark commit, run benchmarks + +git checkout $PREV + +cat >> $COMMIT_FILE <&1 | tee -a $COMMIT_FILE +pushd layers +go test --test.bench="$BENCH" 2>&1 | tee -a $COMMIT_FILE +popd +cat >> $COMMIT_FILE <&1 | tee -a $COMMIT_FILE +fi + + + +## Reset back to the most recent commit, edit the commit message by appending +## benchmark results. +git checkout $BRANCH +git commit --amend -F $COMMIT_FILE diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layerclass.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layerclass.go new file mode 100644 index 00000000..7e76f9c5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layerclass.go @@ -0,0 +1,106 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package gopacket + +// LayerClass is a set of LayerTypes, used for grabbing one of a number of +// different types from a packet. +type LayerClass interface { + // Contains returns true if the given layer type should be considered part + // of this layer class. + Contains(LayerType) bool + // LayerTypes returns the set of all layer types in this layer class. + // Note that this may not be a fast operation on all LayerClass + // implementations. + LayerTypes() []LayerType +} + +// Make LayerType itself be a LayerClass. +func (l LayerType) Contains(a LayerType) bool { + return l == a +} + +func (l LayerType) LayerTypes() []LayerType { + return []LayerType{l} +} + +// LayerClassSlice implements a LayerClass with a slice. +type LayerClassSlice []bool + +// Contains returns true if the given layer type should be considered part +// of this layer class. +func (s LayerClassSlice) Contains(t LayerType) bool { + return int(t) < len(s) && s[t] +} + +// LayerTypes returns all layer types in this LayerClassSlice. +// Because of LayerClassSlice's implementation, this could be quite slow. +func (s LayerClassSlice) LayerTypes() (all []LayerType) { + for i := 0; i < len(s); i++ { + if s[i] { + all = append(all, LayerType(i)) + } + } + return +} + +// NewLayerClassSlice creates a new LayerClassSlice by creating a slice of +// size max(types) and setting slice[t] to true for each type t. Note, if +// you implement your own LayerType and give it a high value, this WILL create +// a very large slice. +func NewLayerClassSlice(types []LayerType) LayerClassSlice { + var max LayerType + for _, typ := range types { + if typ > max { + max = typ + } + } + t := make([]bool, int(max+1)) + for _, typ := range types { + t[typ] = true + } + return t +} + +// LayerClassMap implements a LayerClass with a map. +type LayerClassMap map[LayerType]bool + +// Contains returns true if the given layer type should be considered part +// of this layer class. +func (m LayerClassMap) Contains(t LayerType) bool { + return m[t] +} + +// LayerTypes returns all layer types in this LayerClassMap. +func (m LayerClassMap) LayerTypes() (all []LayerType) { + for t := range m { + all = append(all, t) + } + return +} + +// NewLayerClassMap creates a LayerClassMap and sets map[t] to true for each +// type in types. +func NewLayerClassMap(types []LayerType) LayerClassMap { + m := LayerClassMap{} + for _, typ := range types { + m[typ] = true + } + return m +} + +// NewLayerClass creates a LayerClass, attempting to be smart about which type +// it creates based on which types are passed in. +func NewLayerClass(types []LayerType) LayerClass { + for _, typ := range types { + if typ > maxLayerType { + // NewLayerClassSlice could create a very large object, so instead create + // a map. + return NewLayerClassMap(types) + } + } + return NewLayerClassSlice(types) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/arp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/arp.go new file mode 100644 index 00000000..5a96a4b3 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/arp.go @@ -0,0 +1,107 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" +) + +const ( + ARPRequest = 1 + ARPReply = 2 +) + +// ARP is a ARP packet header. +type ARP struct { + BaseLayer + AddrType LinkType + Protocol EthernetType + HwAddressSize uint8 + ProtAddressSize uint8 + Operation uint16 + SourceHwAddress []byte + SourceProtAddress []byte + DstHwAddress []byte + DstProtAddress []byte +} + +// LayerType returns LayerTypeARP +func (arp *ARP) LayerType() gopacket.LayerType { return LayerTypeARP } + +// DecodeFromBytes decodes the given bytes into this layer. +func (arp *ARP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + arp.AddrType = LinkType(binary.BigEndian.Uint16(data[0:2])) + arp.Protocol = EthernetType(binary.BigEndian.Uint16(data[2:4])) + arp.HwAddressSize = data[4] + arp.ProtAddressSize = data[5] + arp.Operation = binary.BigEndian.Uint16(data[6:8]) + arp.SourceHwAddress = data[8 : 8+arp.HwAddressSize] + arp.SourceProtAddress = data[8+arp.HwAddressSize : 8+arp.HwAddressSize+arp.ProtAddressSize] + arp.DstHwAddress = data[8+arp.HwAddressSize+arp.ProtAddressSize : 8+2*arp.HwAddressSize+arp.ProtAddressSize] + arp.DstProtAddress = data[8+2*arp.HwAddressSize+arp.ProtAddressSize : 8+2*arp.HwAddressSize+2*arp.ProtAddressSize] + + arpLength := 8 + 2*arp.HwAddressSize + 2*arp.ProtAddressSize + arp.Contents = data[:arpLength] + arp.Payload = data[arpLength:] + return nil +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (arp *ARP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + size := 8 + len(arp.SourceHwAddress) + len(arp.SourceProtAddress) + len(arp.DstHwAddress) + len(arp.DstProtAddress) + bytes, err := b.PrependBytes(size) + if err != nil { + return err + } + if opts.FixLengths { + if len(arp.SourceHwAddress) != len(arp.DstHwAddress) { + return fmt.Errorf("mismatched hardware address sizes") + } + arp.HwAddressSize = uint8(len(arp.SourceHwAddress)) + if len(arp.SourceProtAddress) != len(arp.DstProtAddress) { + return fmt.Errorf("mismatched prot address sizes") + } + arp.ProtAddressSize = uint8(len(arp.SourceProtAddress)) + } + binary.BigEndian.PutUint16(bytes, uint16(arp.AddrType)) + binary.BigEndian.PutUint16(bytes[2:], uint16(arp.Protocol)) + bytes[4] = arp.HwAddressSize + bytes[5] = arp.ProtAddressSize + binary.BigEndian.PutUint16(bytes[6:], arp.Operation) + start := 8 + for _, addr := range [][]byte{ + arp.SourceHwAddress, + arp.SourceProtAddress, + arp.DstHwAddress, + arp.DstProtAddress, + } { + copy(bytes[start:], addr) + start += len(addr) + } + return nil +} + +// CanDecode returns the set of layer types that this DecodingLayer can decode. +func (arp *ARP) CanDecode() gopacket.LayerClass { + return LayerTypeARP +} + +// NextLayerType returns the layer type contained by this DecodingLayer. +func (arp *ARP) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypePayload +} + +func decodeARP(data []byte, p gopacket.PacketBuilder) error { + + arp := &ARP{} + return decodingLayerDecoder(arp, data, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/base.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/base.go new file mode 100644 index 00000000..009f490c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/base.go @@ -0,0 +1,52 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "github.com/tsg/gopacket" +) + +// BaseLayer is a convenience struct which implements the LayerData and +// LayerPayload functions of the Layer interface. +type BaseLayer struct { + // Contents is the set of bytes that make up this layer. IE: for an + // Ethernet packet, this would be the set of bytes making up the + // Ethernet frame. + Contents []byte + // Payload is the set of bytes contained by (but not part of) this + // Layer. Again, to take Ethernet as an example, this would be the + // set of bytes encapsulated by the Ethernet protocol. + Payload []byte +} + +// LayerContents returns the bytes of the packet layer. +func (b *BaseLayer) LayerContents() []byte { return b.Contents } + +// LayerPayload returns the bytes contained within the packet layer. +func (b *BaseLayer) LayerPayload() []byte { return b.Payload } + +type layerDecodingLayer interface { + gopacket.Layer + DecodeFromBytes([]byte, gopacket.DecodeFeedback) error + NextLayerType() gopacket.LayerType +} + +func decodingLayerDecoder(d layerDecodingLayer, data []byte, p gopacket.PacketBuilder) error { + err := d.DecodeFromBytes(data, p) + if err != nil { + return err + } + p.AddLayer(d) + next := d.NextLayerType() + if next == gopacket.LayerTypeZero { + return nil + } + return p.NextDecoder(next) +} + +// hacky way to zero out memory... there must be a better way? +var lotsOfZeros [1024]byte diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/cdp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/cdp.go new file mode 100644 index 00000000..86867743 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/cdp.go @@ -0,0 +1,640 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// Enum types courtesy of... +// http://search.cpan.org/~mchapman/Net-CDP-0.09/lib/Net/CDP.pm +// https://code.google.com/p/ladvd/ +// http://anonsvn.wireshark.org/viewvc/releases/wireshark-1.8.6/epan/dissectors/packet-cdp.c + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" + "net" +) + +// CDPTLVType is the type of each TLV value in a CiscoDiscovery packet. +type CDPTLVType uint16 + +const ( + CDPTLVDevID CDPTLVType = 0x0001 + CDPTLVAddress CDPTLVType = 0x0002 + CDPTLVPortID CDPTLVType = 0x0003 + CDPTLVCapabilities CDPTLVType = 0x0004 + CDPTLVVersion CDPTLVType = 0x0005 + CDPTLVPlatform CDPTLVType = 0x0006 + CDPTLVIPPrefix CDPTLVType = 0x0007 + CDPTLVHello CDPTLVType = 0x0008 + CDPTLVVTPDomain CDPTLVType = 0x0009 + CDPTLVNativeVLAN CDPTLVType = 0x000a + CDPTLVFullDuplex CDPTLVType = 0x000b + CDPTLVVLANReply CDPTLVType = 0x000e + CDPTLVVLANQuery CDPTLVType = 0x000f + CDPTLVPower CDPTLVType = 0x0010 + CDPTLVMTU CDPTLVType = 0x0011 + CDPTLVExtendedTrust CDPTLVType = 0x0012 + CDPTLVUntrustedCOS CDPTLVType = 0x0013 + CDPTLVSysName CDPTLVType = 0x0014 + CDPTLVSysOID CDPTLVType = 0x0015 + CDPTLVMgmtAddresses CDPTLVType = 0x0016 + CDPTLVLocation CDPTLVType = 0x0017 + CDPTLVExternalPortID CDPTLVType = 0x0018 + CDPTLVPowerRequested CDPTLVType = 0x0019 + CDPTLVPowerAvailable CDPTLVType = 0x001a + CDPTLVPortUnidirectional CDPTLVType = 0x001b + CDPTLVEnergyWise CDPTLVType = 0x001d + CDPTLVSparePairPOE CDPTLVType = 0x001f +) + +// CiscoDiscoveryValue is a TLV value inside a CiscoDiscovery packet layer. +type CiscoDiscoveryValue struct { + Type CDPTLVType + Length uint16 + Value []byte +} + +// CiscoDiscovery is a packet layer containing the Cisco Discovery Protocol. +// See http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm#31885 +type CiscoDiscovery struct { + BaseLayer + Version byte + TTL byte + Checksum uint16 + Values []CiscoDiscoveryValue +} + +type CDPCapability uint32 + +const ( + CDPCapMaskRouter CDPCapability = 0x0001 + CDPCapMaskTBBridge CDPCapability = 0x0002 + CDPCapMaskSPBridge CDPCapability = 0x0004 + CDPCapMaskSwitch CDPCapability = 0x0008 + CDPCapMaskHost CDPCapability = 0x0010 + CDPCapMaskIGMPFilter CDPCapability = 0x0020 + CDPCapMaskRepeater CDPCapability = 0x0040 + CDPCapMaskPhone CDPCapability = 0x0080 + CDPCapMaskRemote CDPCapability = 0x0100 +) + +// CDPCapabilities represents the capabilities of a device +type CDPCapabilities struct { + L3Router bool + TBBridge bool + SPBridge bool + L2Switch bool + IsHost bool + IGMPFilter bool + L1Repeater bool + IsPhone bool + RemotelyManaged bool +} + +const ( + CDPPoEFourWire byte = 0x01 + CDPPoEPDArch byte = 0x02 + CDPPoEPDRequest byte = 0x04 + CDPPoEPSE byte = 0x08 +) + +type CDPSparePairPoE struct { + PSEFourWire bool // Supported / Not supported + PDArchShared bool // Shared / Independent + PDRequestOn bool // On / Off + PSEOn bool // On / Off +} + +// CDPVLANDialogue encapsulates a VLAN Query/Reply +type CDPVLANDialogue struct { + ID uint8 + VLAN uint16 +} + +// CDPPowerDialogue encapsulates a Power Query/Reply +type CDPPowerDialogue struct { + ID uint16 + MgmtID uint16 + Values []uint32 +} + +type CDPLocation struct { + Type uint8 // Undocumented + Location string +} + +// CDPHello is a Cisco Hello message (undocumented, hence the "Unknown" fields) +type CDPHello struct { + OUI []byte + ProtocolID uint16 + ClusterMaster net.IP + Unknown1 net.IP + Version byte + SubVersion byte + Status byte + Unknown2 byte + ClusterCommander net.HardwareAddr + SwitchMAC net.HardwareAddr + Unknown3 byte + ManagementVLAN uint16 +} + +type CDPEnergyWiseSubtype uint32 + +const ( + CDPEnergyWiseRole CDPEnergyWiseSubtype = 0x00000007 + CDPEnergyWiseDomain CDPEnergyWiseSubtype = 0x00000008 + CDPEnergyWiseName CDPEnergyWiseSubtype = 0x00000009 + CDPEnergyWiseReplyTo CDPEnergyWiseSubtype = 0x00000017 +) + +type CDPEnergyWise struct { + EncryptedData []byte + Unknown1 uint32 + SequenceNumber uint32 + ModelNumber string + Unknown2 uint16 + HardwareID string + SerialNum string + Unknown3 []byte + Role string + Domain string + Name string + ReplyUnknown1 []byte + ReplyPort []byte + ReplyAddress []byte + ReplyUnknown2 []byte + ReplyUnknown3 []byte +} + +// CiscoDiscoveryInfo represents the decoded details for a set of CiscoDiscoveryValues +type CiscoDiscoveryInfo struct { + BaseLayer + CDPHello + DeviceID string + Addresses []net.IP + PortID string + Capabilities CDPCapabilities + Version string + Platform string + IPPrefixes []net.IPNet + VTPDomain string + NativeVLAN uint16 + FullDuplex bool + VLANReply CDPVLANDialogue + VLANQuery CDPVLANDialogue + PowerConsumption uint16 + MTU uint32 + ExtendedTrust uint8 + UntrustedCOS uint8 + SysName string + SysOID string + MgmtAddresses []net.IP + Location CDPLocation + PowerRequest CDPPowerDialogue + PowerAvailable CDPPowerDialogue + SparePairPoe CDPSparePairPoE + EnergyWise CDPEnergyWise + Unknown []CiscoDiscoveryValue +} + +// LayerType returns gopacket.LayerTypeCiscoDiscovery. +func (c *CiscoDiscovery) LayerType() gopacket.LayerType { + return LayerTypeCiscoDiscovery +} + +func decodeCiscoDiscovery(data []byte, p gopacket.PacketBuilder) error { + c := &CiscoDiscovery{ + Version: data[0], + TTL: data[1], + Checksum: binary.BigEndian.Uint16(data[2:4]), + } + if c.Version != 1 && c.Version != 2 { + return fmt.Errorf("Invalid CiscoDiscovery version number %d", c.Version) + } + var err error + c.Values, err = decodeCiscoDiscoveryTLVs(data[4:]) + if err != nil { + return err + } + c.Contents = data[0:4] + c.Payload = data[4:] + p.AddLayer(c) + return p.NextDecoder(gopacket.DecodeFunc(decodeCiscoDiscoveryInfo)) +} + +// LayerType returns gopacket.LayerTypeCiscoDiscoveryInfo. +func (c *CiscoDiscoveryInfo) LayerType() gopacket.LayerType { + return LayerTypeCiscoDiscoveryInfo +} + +func decodeCiscoDiscoveryTLVs(data []byte) (values []CiscoDiscoveryValue, err error) { + for len(data) > 0 { + val := CiscoDiscoveryValue{ + Type: CDPTLVType(binary.BigEndian.Uint16(data[:2])), + Length: binary.BigEndian.Uint16(data[2:4]), + } + if val.Length < 4 { + err = fmt.Errorf("Invalid CiscoDiscovery value length %d", val.Length) + break + } + val.Value = data[4:val.Length] + values = append(values, val) + data = data[val.Length:] + } + return +} + +func decodeCiscoDiscoveryInfo(data []byte, p gopacket.PacketBuilder) error { + var err error + info := &CiscoDiscoveryInfo{BaseLayer: BaseLayer{Contents: data}} + p.AddLayer(info) + values, err := decodeCiscoDiscoveryTLVs(data) + if err != nil { // Unlikely, as parent decode will fail, but better safe... + return err + } + for _, val := range values { + switch val.Type { + case CDPTLVDevID: + info.DeviceID = string(val.Value) + case CDPTLVAddress: + if err = checkCDPTLVLen(val, 4); err != nil { + return err + } + info.Addresses, err = decodeAddresses(val.Value) + if err != nil { + return err + } + case CDPTLVPortID: + info.PortID = string(val.Value) + case CDPTLVCapabilities: + if err = checkCDPTLVLen(val, 4); err != nil { + return err + } + val := CDPCapability(binary.BigEndian.Uint32(val.Value[0:4])) + info.Capabilities.L3Router = (val&CDPCapMaskRouter > 0) + info.Capabilities.TBBridge = (val&CDPCapMaskTBBridge > 0) + info.Capabilities.SPBridge = (val&CDPCapMaskSPBridge > 0) + info.Capabilities.L2Switch = (val&CDPCapMaskSwitch > 0) + info.Capabilities.IsHost = (val&CDPCapMaskHost > 0) + info.Capabilities.IGMPFilter = (val&CDPCapMaskIGMPFilter > 0) + info.Capabilities.L1Repeater = (val&CDPCapMaskRepeater > 0) + info.Capabilities.IsPhone = (val&CDPCapMaskPhone > 0) + info.Capabilities.RemotelyManaged = (val&CDPCapMaskRemote > 0) + case CDPTLVVersion: + info.Version = string(val.Value) + case CDPTLVPlatform: + info.Platform = string(val.Value) + case CDPTLVIPPrefix: + v := val.Value + l := len(v) + if l%5 == 0 && l >= 5 { + for len(v) > 0 { + _, ipnet, _ := net.ParseCIDR(fmt.Sprintf("%d.%d.%d.%d/%d", v[0], v[1], v[2], v[3], v[4])) + info.IPPrefixes = append(info.IPPrefixes, *ipnet) + v = v[5:] + } + } else { + return fmt.Errorf("Invalid TLV %v length %d", val.Type, len(val.Value)) + } + case CDPTLVHello: + if err = checkCDPTLVLen(val, 32); err != nil { + return err + } + v := val.Value + info.CDPHello.OUI = v[0:3] + info.CDPHello.ProtocolID = binary.BigEndian.Uint16(v[3:5]) + info.CDPHello.ClusterMaster = v[5:9] + info.CDPHello.Unknown1 = v[9:13] + info.CDPHello.Version = v[13] + info.CDPHello.SubVersion = v[14] + info.CDPHello.Status = v[15] + info.CDPHello.Unknown2 = v[16] + info.CDPHello.ClusterCommander = v[17:23] + info.CDPHello.SwitchMAC = v[23:29] + info.CDPHello.Unknown3 = v[29] + info.CDPHello.ManagementVLAN = binary.BigEndian.Uint16(v[30:32]) + case CDPTLVVTPDomain: + info.VTPDomain = string(val.Value) + case CDPTLVNativeVLAN: + if err = checkCDPTLVLen(val, 2); err != nil { + return err + } + info.NativeVLAN = binary.BigEndian.Uint16(val.Value[0:2]) + case CDPTLVFullDuplex: + if err = checkCDPTLVLen(val, 1); err != nil { + return err + } + info.FullDuplex = (val.Value[0] == 1) + case CDPTLVVLANReply: + if err = checkCDPTLVLen(val, 3); err != nil { + return err + } + info.VLANReply.ID = uint8(val.Value[0]) + info.VLANReply.VLAN = binary.BigEndian.Uint16(val.Value[1:3]) + case CDPTLVVLANQuery: + if err = checkCDPTLVLen(val, 3); err != nil { + return err + } + info.VLANQuery.ID = uint8(val.Value[0]) + info.VLANQuery.VLAN = binary.BigEndian.Uint16(val.Value[1:3]) + case CDPTLVPower: + if err = checkCDPTLVLen(val, 2); err != nil { + return err + } + info.PowerConsumption = binary.BigEndian.Uint16(val.Value[0:2]) + case CDPTLVMTU: + if err = checkCDPTLVLen(val, 4); err != nil { + return err + } + info.MTU = binary.BigEndian.Uint32(val.Value[0:4]) + case CDPTLVExtendedTrust: + if err = checkCDPTLVLen(val, 1); err != nil { + return err + } + info.ExtendedTrust = uint8(val.Value[0]) + case CDPTLVUntrustedCOS: + if err = checkCDPTLVLen(val, 1); err != nil { + return err + } + info.UntrustedCOS = uint8(val.Value[0]) + case CDPTLVSysName: + info.SysName = string(val.Value) + case CDPTLVSysOID: + info.SysOID = string(val.Value) + case CDPTLVMgmtAddresses: + if err = checkCDPTLVLen(val, 4); err != nil { + return err + } + info.MgmtAddresses, err = decodeAddresses(val.Value) + if err != nil { + return err + } + case CDPTLVLocation: + if err = checkCDPTLVLen(val, 2); err != nil { + return err + } + info.Location.Type = uint8(val.Value[0]) + info.Location.Location = string(val.Value[1:]) + + // case CDPTLVLExternalPortID: + // Undocumented + case CDPTLVPowerRequested: + if err = checkCDPTLVLen(val, 4); err != nil { + return err + } + info.PowerRequest.ID = binary.BigEndian.Uint16(val.Value[0:2]) + info.PowerRequest.MgmtID = binary.BigEndian.Uint16(val.Value[2:4]) + for n := 4; n < len(val.Value); n += 4 { + info.PowerRequest.Values = append(info.PowerRequest.Values, binary.BigEndian.Uint32(val.Value[n:n+4])) + } + case CDPTLVPowerAvailable: + if err = checkCDPTLVLen(val, 4); err != nil { + return err + } + info.PowerAvailable.ID = binary.BigEndian.Uint16(val.Value[0:2]) + info.PowerAvailable.MgmtID = binary.BigEndian.Uint16(val.Value[2:4]) + for n := 4; n < len(val.Value); n += 4 { + info.PowerAvailable.Values = append(info.PowerAvailable.Values, binary.BigEndian.Uint32(val.Value[n:n+4])) + } + // case CDPTLVPortUnidirectional + // Undocumented + case CDPTLVEnergyWise: + if err = checkCDPTLVLen(val, 72); err != nil { + return err + } + info.EnergyWise.EncryptedData = val.Value[0:20] + info.EnergyWise.Unknown1 = binary.BigEndian.Uint32(val.Value[20:24]) + info.EnergyWise.SequenceNumber = binary.BigEndian.Uint32(val.Value[24:28]) + info.EnergyWise.ModelNumber = string(val.Value[28:44]) + info.EnergyWise.Unknown2 = binary.BigEndian.Uint16(val.Value[44:46]) + info.EnergyWise.HardwareID = string(val.Value[46:49]) + info.EnergyWise.SerialNum = string(val.Value[49:60]) + info.EnergyWise.Unknown3 = val.Value[60:68] + tlvLen := binary.BigEndian.Uint16(val.Value[68:70]) + tlvNum := binary.BigEndian.Uint16(val.Value[70:72]) + data := val.Value[72:] + if len(data) < int(tlvLen) { + return fmt.Errorf("Invalid TLV length %d vs %d", tlvLen, len(data)) + } + numSeen := 0 + for len(data) > 8 { + numSeen++ + if numSeen > int(tlvNum) { // Too many TLV's ? + return fmt.Errorf("Too many TLV's - wanted %d, saw %d", tlvNum, numSeen) + } + tType := CDPEnergyWiseSubtype(binary.BigEndian.Uint32(data[0:4])) + tLen := int(binary.BigEndian.Uint32(data[4:8])) + if tLen > len(data)-8 { + return fmt.Errorf("Invalid TLV length %d vs %d", tLen, len(data)-8) + } + data = data[8:] + switch tType { + case CDPEnergyWiseRole: + info.EnergyWise.Role = string(data[:]) + case CDPEnergyWiseDomain: + info.EnergyWise.Domain = string(data[:]) + case CDPEnergyWiseName: + info.EnergyWise.Name = string(data[:]) + case CDPEnergyWiseReplyTo: + if len(data) >= 18 { + info.EnergyWise.ReplyUnknown1 = data[0:2] + info.EnergyWise.ReplyPort = data[2:4] + info.EnergyWise.ReplyAddress = data[4:8] + info.EnergyWise.ReplyUnknown2 = data[8:10] + info.EnergyWise.ReplyUnknown3 = data[10:14] + } + } + data = data[tLen:] + } + case CDPTLVSparePairPOE: + if err = checkCDPTLVLen(val, 1); err != nil { + return err + } + v := val.Value[0] + info.SparePairPoe.PSEFourWire = (v&CDPPoEFourWire > 0) + info.SparePairPoe.PDArchShared = (v&CDPPoEPDArch > 0) + info.SparePairPoe.PDRequestOn = (v&CDPPoEPDRequest > 0) + info.SparePairPoe.PSEOn = (v&CDPPoEPSE > 0) + default: + info.Unknown = append(info.Unknown, val) + } + } + return nil +} + +// CDP Protocol Types +const ( + CDPProtocolTypeNLPID byte = 1 + CDPProtocolType802_2 byte = 2 +) + +type CDPAddressType uint64 + +// CDP Address types. +const ( + CDPAddressTypeCLNP CDPAddressType = 0x81 + CDPAddressTypeIPV4 CDPAddressType = 0xcc + CDPAddressTypeIPV6 CDPAddressType = 0xaaaa030000000800 + CDPAddressTypeDECNET CDPAddressType = 0xaaaa030000006003 + CDPAddressTypeAPPLETALK CDPAddressType = 0xaaaa03000000809b + CDPAddressTypeIPX CDPAddressType = 0xaaaa030000008137 + CDPAddressTypeVINES CDPAddressType = 0xaaaa0300000080c4 + CDPAddressTypeXNS CDPAddressType = 0xaaaa030000000600 + CDPAddressTypeAPOLLO CDPAddressType = 0xaaaa030000008019 +) + +func decodeAddresses(v []byte) (addresses []net.IP, err error) { + numaddr := int(binary.BigEndian.Uint32(v[0:4])) + if numaddr < 1 { + return nil, fmt.Errorf("Invalid Address TLV number %d", numaddr) + } + v = v[4:] + if len(v) < numaddr*8 { + return nil, fmt.Errorf("Invalid Address TLV length %d", len(v)) + } + for i := 0; i < numaddr; i++ { + prottype := v[0] + if prottype != CDPProtocolTypeNLPID && prottype != CDPProtocolType802_2 { // invalid protocol type + return nil, fmt.Errorf("Invalid Address Protocol %d", prottype) + } + protlen := int(v[1]) + if (prottype == CDPProtocolTypeNLPID && protlen != 1) || + (prottype == CDPProtocolType802_2 && protlen != 3 && protlen != 8) { // invalid length + return nil, fmt.Errorf("Invalid Address Protocol length %d", protlen) + } + plen := make([]byte, 8) + copy(plen[8-protlen:], v[2:2+protlen]) + protocol := CDPAddressType(binary.BigEndian.Uint64(plen)) + v = v[2+protlen:] + addrlen := binary.BigEndian.Uint16(v[0:2]) + ab := v[2 : 2+addrlen] + if protocol == CDPAddressTypeIPV4 && addrlen == 4 { + addresses = append(addresses, net.IPv4(ab[0], ab[1], ab[2], ab[3])) + } else if protocol == CDPAddressTypeIPV6 && addrlen == 16 { + addresses = append(addresses, net.IP(ab)) + } else { + // only handle IPV4 & IPV6 for now + } + v = v[2+addrlen:] + if len(v) < 8 { + break + } + } + return +} + +func (t CDPTLVType) String() (s string) { + switch t { + case CDPTLVDevID: + s = "Device ID" + case CDPTLVAddress: + s = "Addresses" + case CDPTLVPortID: + s = "Port ID" + case CDPTLVCapabilities: + s = "Capabilities" + case CDPTLVVersion: + s = "Software Version" + case CDPTLVPlatform: + s = "Platform" + case CDPTLVIPPrefix: + s = "IP Prefix" + case CDPTLVHello: + s = "Protocol Hello" + case CDPTLVVTPDomain: + s = "VTP Management Domain" + case CDPTLVNativeVLAN: + s = "Native VLAN" + case CDPTLVFullDuplex: + s = "Full Duplex" + case CDPTLVVLANReply: + s = "VoIP VLAN Reply" + case CDPTLVVLANQuery: + s = "VLANQuery" + case CDPTLVPower: + s = "Power consumption" + case CDPTLVMTU: + s = "MTU" + case CDPTLVExtendedTrust: + s = "Extended Trust Bitmap" + case CDPTLVUntrustedCOS: + s = "Untrusted Port CoS" + case CDPTLVSysName: + s = "System Name" + case CDPTLVSysOID: + s = "System OID" + case CDPTLVMgmtAddresses: + s = "Management Addresses" + case CDPTLVLocation: + s = "Location" + case CDPTLVExternalPortID: + s = "External Port ID" + case CDPTLVPowerRequested: + s = "Power Requested" + case CDPTLVPowerAvailable: + s = "Power Available" + case CDPTLVPortUnidirectional: + s = "Port Unidirectional" + case CDPTLVEnergyWise: + s = "Energy Wise" + case CDPTLVSparePairPOE: + s = "Spare Pair POE" + default: + s = "Unknown" + } + return +} + +func (a CDPAddressType) String() (s string) { + switch a { + case CDPAddressTypeCLNP: + s = "Connectionless Network Protocol" + case CDPAddressTypeIPV4: + s = "IPv4" + case CDPAddressTypeIPV6: + s = "IPv6" + case CDPAddressTypeDECNET: + s = "DECnet Phase IV" + case CDPAddressTypeAPPLETALK: + s = "Apple Talk" + case CDPAddressTypeIPX: + s = "Novell IPX" + case CDPAddressTypeVINES: + s = "Banyan VINES" + case CDPAddressTypeXNS: + s = "Xerox Network Systems" + case CDPAddressTypeAPOLLO: + s = "Apollo" + default: + s = "Unknown" + } + return +} + +func (t CDPEnergyWiseSubtype) String() (s string) { + switch t { + case CDPEnergyWiseRole: + s = "Role" + case CDPEnergyWiseDomain: + s = "Domain" + case CDPEnergyWiseName: + s = "Name" + case CDPEnergyWiseReplyTo: + s = "ReplyTo" + default: + s = "Unknown" + } + return +} + +func checkCDPTLVLen(v CiscoDiscoveryValue, l int) (err error) { + if len(v.Value) < l { + err = fmt.Errorf("Invalid TLV %v length %d", v.Type, len(v.Value)) + } + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ctp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ctp.go new file mode 100644 index 00000000..c6cdcabe --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ctp.go @@ -0,0 +1,108 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" +) + +// EthernetCTPFunction is the function code used by the EthernetCTP protocol to identify each +// EthernetCTP layer. +type EthernetCTPFunction uint16 + +const ( + EthernetCTPFunctionReply EthernetCTPFunction = 1 + EthernetCTPFunctionForwardData EthernetCTPFunction = 2 +) + +// EthernetCTP implements the EthernetCTP protocol, see http://www.mit.edu/people/jhawk/ctp.html. +// We split EthernetCTP up into the top-level EthernetCTP layer, followed by zero or more +// EthernetCTPForwardData layers, followed by a final EthernetCTPReply layer. +type EthernetCTP struct { + BaseLayer + SkipCount uint16 +} + +// LayerType returns gopacket.LayerTypeEthernetCTP. +func (c *EthernetCTP) LayerType() gopacket.LayerType { + return LayerTypeEthernetCTP +} + +// EthernetCTPForwardData is the ForwardData layer inside EthernetCTP. See EthernetCTP's docs for more +// details. +type EthernetCTPForwardData struct { + BaseLayer + Function EthernetCTPFunction + ForwardAddress []byte +} + +// LayerType returns gopacket.LayerTypeEthernetCTPForwardData. +func (c *EthernetCTPForwardData) LayerType() gopacket.LayerType { + return LayerTypeEthernetCTPForwardData +} + +// ForwardEndpoint returns the EthernetCTPForwardData ForwardAddress as an endpoint. +func (c *EthernetCTPForwardData) ForwardEndpoint() gopacket.Endpoint { + return gopacket.NewEndpoint(EndpointMAC, c.ForwardAddress) +} + +// EthernetCTPReply is the Reply layer inside EthernetCTP. See EthernetCTP's docs for more details. +type EthernetCTPReply struct { + BaseLayer + Function EthernetCTPFunction + ReceiptNumber uint16 + Data []byte +} + +// LayerType returns gopacket.LayerTypeEthernetCTPReply. +func (c *EthernetCTPReply) LayerType() gopacket.LayerType { + return LayerTypeEthernetCTPReply +} + +// Payload returns the EthernetCTP reply's Data bytes. +func (c *EthernetCTPReply) Payload() []byte { return c.Data } + +func decodeEthernetCTP(data []byte, p gopacket.PacketBuilder) error { + c := &EthernetCTP{ + SkipCount: binary.LittleEndian.Uint16(data[:2]), + BaseLayer: BaseLayer{data[:2], data[2:]}, + } + if c.SkipCount%2 != 0 { + return fmt.Errorf("EthernetCTP skip count is odd: %d", c.SkipCount) + } + p.AddLayer(c) + return p.NextDecoder(gopacket.DecodeFunc(decodeEthernetCTPFromFunctionType)) +} + +// decodeEthernetCTPFromFunctionType reads in the first 2 bytes to determine the EthernetCTP +// layer type to decode next, then decodes based on that. +func decodeEthernetCTPFromFunctionType(data []byte, p gopacket.PacketBuilder) error { + function := EthernetCTPFunction(binary.LittleEndian.Uint16(data[:2])) + switch function { + case EthernetCTPFunctionReply: + reply := &EthernetCTPReply{ + Function: function, + ReceiptNumber: binary.LittleEndian.Uint16(data[2:4]), + Data: data[4:], + BaseLayer: BaseLayer{data, nil}, + } + p.AddLayer(reply) + p.SetApplicationLayer(reply) + return nil + case EthernetCTPFunctionForwardData: + forward := &EthernetCTPForwardData{ + Function: function, + ForwardAddress: data[2:8], + BaseLayer: BaseLayer{data[:8], data[8:]}, + } + p.AddLayer(forward) + return p.NextDecoder(gopacket.DecodeFunc(decodeEthernetCTPFromFunctionType)) + } + return fmt.Errorf("Unknown EthernetCTP function type %v", function) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/dns.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/dns.go new file mode 100644 index 00000000..07e4ff3a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/dns.go @@ -0,0 +1,540 @@ +// Copyright 2014 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "errors" + "fmt" + "github.com/tsg/gopacket" + "net" +) + +type DNSClass uint16 + +const ( + DNSClassIN DNSClass = 1 // Internet + DNSClassCS DNSClass = 2 // the CSNET class (Obsolete) + DNSClassCH DNSClass = 3 // the CHAOS class + DNSClassHS DNSClass = 4 // Hesiod [Dyer 87] + DNSClassAny DNSClass = 255 // AnyClass +) + +type DNSType uint16 + +const ( + DNSTypeA DNSType = 1 // a host address + DNSTypeNS DNSType = 2 // an authoritative name server + DNSTypeMD DNSType = 3 // a mail destination (Obsolete - use MX) + DNSTypeMF DNSType = 4 // a mail forwarder (Obsolete - use MX) + DNSTypeCNAME DNSType = 5 // the canonical name for an alias + DNSTypeSOA DNSType = 6 // marks the start of a zone of authority + DNSTypeMB DNSType = 7 // a mailbox domain name (EXPERIMENTAL) + DNSTypeMG DNSType = 8 // a mail group member (EXPERIMENTAL) + DNSTypeMR DNSType = 9 // a mail rename domain name (EXPERIMENTAL) + DNSTypeNULL DNSType = 10 // a null RR (EXPERIMENTAL) + DNSTypeWKS DNSType = 11 // a well known service description + DNSTypePTR DNSType = 12 // a domain name pointer + DNSTypeHINFO DNSType = 13 // host information + DNSTypeMINFO DNSType = 14 // mailbox or mail list information + DNSTypeMX DNSType = 15 // mail exchange + DNSTypeTXT DNSType = 16 // text strings + DNSTypeAAAA DNSType = 28 // a IPv6 host address [RFC3596] + DNSTypeSRV DNSType = 33 // server discovery [RFC2782] [RFC6195] +) + +type DNSResponseCode uint8 + +const ( + DNSResponseCodeFormErr DNSResponseCode = 1 // Format Error [RFC1035] + DNSResponseCodeServFail DNSResponseCode = 2 // Server Failure [RFC1035] + DNSResponseCodeNXDomain DNSResponseCode = 3 // Non-Existent Domain [RFC1035] + DNSResponseCodeNotImp DNSResponseCode = 4 // Not Implemented [RFC1035] + DNSResponseCodeRefused DNSResponseCode = 5 // Query Refused [RFC1035] + DNSResponseCodeYXDomain DNSResponseCode = 6 // Name Exists when it should not [RFC2136] + DNSResponseCodeYXRRSet DNSResponseCode = 7 // RR Set Exists when it should not [RFC2136] + DNSResponseCodeNXRRSet DNSResponseCode = 8 // RR Set that should exist does not [RFC2136] + DNSResponseCodeNotAuth DNSResponseCode = 9 // Server Not Authoritative for zone [RFC2136] + DNSResponseCodeNotZone DNSResponseCode = 10 // Name not contained in zone [RFC2136] + DNSResponseCodeBadVers DNSResponseCode = 16 // Bad OPT Version [RFC2671] + DNSResponseCodeBadSig DNSResponseCode = 16 // TSIG Signature Failure [RFC2845] + DNSResponseCodeBadKey DNSResponseCode = 17 // Key not recognized [RFC2845] + DNSResponseCodeBadTime DNSResponseCode = 18 // Signature out of time window [RFC2845] + DNSResponseCodeBadMode DNSResponseCode = 19 // Bad TKEY Mode [RFC2930] + DNSResponseCodeBadName DNSResponseCode = 20 // Duplicate key name [RFC2930] + DNSResponseCodeBadAlg DNSResponseCode = 21 // Algorithm not supported [RFC2930] + DNSResponseCodeBadTruc DNSResponseCode = 22 // Bad Truncation [RFC4635] +) + +func (drc DNSResponseCode) String() string { + switch drc { + default: + return "Unknown" + case DNSResponseCodeFormErr: + return "Format Error" + case DNSResponseCodeServFail: + return "Server Failure " + case DNSResponseCodeNXDomain: + return "Non-Existent Domain" + case DNSResponseCodeNotImp: + return "Not Implemented" + case DNSResponseCodeRefused: + return "Query Refused" + case DNSResponseCodeYXDomain: + return "Name Exists when it should not" + case DNSResponseCodeYXRRSet: + return "RR Set Exists when it should not" + case DNSResponseCodeNXRRSet: + return "RR Set that should exist does not" + case DNSResponseCodeNotAuth: + return "Server Not Authoritative for zone" + case DNSResponseCodeNotZone: + return "Name not contained in zone" + case DNSResponseCodeBadVers: + return "Bad OPT Version" + case DNSResponseCodeBadKey: + return "Key not recognized" + case DNSResponseCodeBadTime: + return "Signature out of time window" + case DNSResponseCodeBadMode: + return "Bad TKEY Mode" + case DNSResponseCodeBadName: + return "Duplicate key name" + case DNSResponseCodeBadAlg: + return "Algorithm not supported" + case DNSResponseCodeBadTruc: + return "Bad Truncation" + } +} + +type DNSOpCode uint8 + +const ( + DNSOpCodeQuery DNSOpCode = 0 // Query [RFC1035] + DNSOpCodeIQuery DNSOpCode = 1 // Inverse Query Obsolete [RFC3425] + DNSOpCodeStatus DNSOpCode = 2 // Status [RFC1035] + DNSOpCodeNotify DNSOpCode = 4 // Notify [RFC1996] + DNSOpCodeUpdate DNSOpCode = 5 // Update [RFC2136] +) + +// DNS is specified in RFC 1034 / RFC 1035 +// +---------------------+ +// | Header | +// +---------------------+ +// | Question | the question for the name server +// +---------------------+ +// | Answer | RRs answering the question +// +---------------------+ +// | Authority | RRs pointing toward an authority +// +---------------------+ +// | Additional | RRs holding additional information +// +---------------------+ +// +// DNS Header +// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | ID | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// |QR| Opcode |AA|TC|RD|RA| Z | RCODE | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | QDCOUNT | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | ANCOUNT | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | NSCOUNT | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | ARCOUNT | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ + +// DNS contains data from a single Domain Name Service packet. +type DNS struct { + BaseLayer + + // Header fields + ID uint16 + QR bool + OpCode DNSOpCode + + AA bool // Authoritative answer + TC bool // Truncated + RD bool // Recursion desired + RA bool // Recursion available + Z uint8 // Resrved for future use + + ResponseCode DNSResponseCode + QDCount uint16 // Number of questions to expect + ANCount uint16 // Number of answers to expect + NSCount uint16 // Number of authorities to expect + ARCount uint16 // Number of additional records to expect + + // Entries + Questions []DNSQuestion + Answers []DNSResourceRecord + Authorities []DNSResourceRecord + Additionals []DNSResourceRecord + + // buffer for doing name decoding. We use a single reusable buffer to avoid + // name decoding on a single object via multiple DecodeFromBytes calls + // requiring constant allocation of small byte slices. + buffer []byte +} + +// LayerType returns gopacket.LayerTypeDNS. +func (d *DNS) LayerType() gopacket.LayerType { return LayerTypeDNS } + +// decodeDNS decodes the byte slice into a DNS type. It also +// setups the application Layer in PacketBuilder. +func decodeDNS(data []byte, p gopacket.PacketBuilder) error { + d := &DNS{} + err := d.DecodeFromBytes(data, p) + if err != nil { + return err + } + p.AddLayer(d) + p.SetApplicationLayer(d) + return nil +} + +// DecodeFromBytes decodes the slice into the DNS struct. +func (d *DNS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + d.buffer = d.buffer[:0] + + if len(data) < 12 { + df.SetTruncated() + return fmt.Errorf("DNS packet too short") + } + d.ID = binary.BigEndian.Uint16(data[:2]) + d.QR = data[2]&0x80 != 0 + d.OpCode = DNSOpCode(data[2]>>3) & 0x0F + d.AA = data[2]&0x04 != 0 + d.TC = data[2]&0x02 != 0 + d.RD = data[2]&0x01 != 0 + d.RA = data[3]&0x80 != 0 + d.Z = uint8(data[3]>>4) & 0x7 + d.ResponseCode = DNSResponseCode(data[3] & 0xF) + d.QDCount = binary.BigEndian.Uint16(data[4:6]) + d.ANCount = binary.BigEndian.Uint16(data[6:8]) + d.NSCount = binary.BigEndian.Uint16(data[8:10]) + d.ARCount = binary.BigEndian.Uint16(data[10:12]) + + d.Questions = d.Questions[:0] + d.Answers = d.Answers[:0] + d.Authorities = d.Authorities[:0] + d.Additionals = d.Additionals[:0] + + offset := 12 + var err error + for i := 0; i < int(d.QDCount); i++ { + var q DNSQuestion + if offset, err = q.decode(data, offset, df, &d.buffer); err != nil { + return err + } + d.Questions = append(d.Questions, q) + } + + // For some horrible reason, if we do the obvious thing in this loop: + // var r DNSResourceRecord + // if blah := r.decode(blah); err != nil { + // return err + // } + // d.Foo = append(d.Foo, r) + // the Go compiler thinks that 'r' escapes to the heap, causing a malloc for + // every Answer, Authority, and Additional. To get around this, we do + // something really silly: we append an empty resource record to our slice, + // then use the last value in the slice to call decode. Since the value is + // already in the slice, there's no WAY it can escape... on the other hand our + // code is MUCH uglier :( + for i := 0; i < int(d.ANCount); i++ { + d.Answers = append(d.Answers, DNSResourceRecord{}) + if offset, err = d.Answers[i].decode(data, offset, df, &d.buffer); err != nil { + d.Answers = d.Answers[:i] // strip off erroneous value + return err + } + } + for i := 0; i < int(d.NSCount); i++ { + d.Authorities = append(d.Authorities, DNSResourceRecord{}) + if offset, err = d.Authorities[i].decode(data, offset, df, &d.buffer); err != nil { + d.Authorities = d.Authorities[:i] // strip off erroneous value + return err + } + } + for i := 0; i < int(d.ARCount); i++ { + d.Additionals = append(d.Additionals, DNSResourceRecord{}) + if offset, err = d.Additionals[i].decode(data, offset, df, &d.buffer); err != nil { + d.Additionals = d.Additionals[:i] // strip off erroneous value + return err + } + } + + if uint16(len(d.Questions)) != d.QDCount { + return errors.New("Invalid query decoding, not the right number of questions") + } else if uint16(len(d.Answers)) != d.ANCount { + return errors.New("Invalid query decoding, not the right number of answers") + } else if uint16(len(d.Authorities)) != d.NSCount { + return errors.New("Invalid query decoding, not the right number of authorities") + } else if uint16(len(d.Additionals)) != d.ARCount { + return errors.New("Invalid query decoding, not the right number of additionals info") + } + return nil +} + +func (d *DNS) CanDecode() gopacket.LayerClass { + return LayerTypeDNS +} + +func (d *DNS) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypePayload +} + +func (d *DNS) Payload() []byte { + return nil +} + +var maxRecursion = errors.New("max DNS recursion level hit") + +const maxRecursionLevel = 255 + +func decodeName(data []byte, offset int, buffer *[]byte, level int) ([]byte, int, error) { + if level > maxRecursionLevel { + return nil, 0, maxRecursion + } + start := len(*buffer) + index := offset + if data[index] == 0x00 { + return nil, index + 1, nil + } +loop: + for data[index] != 0x00 { + switch data[index] & 0xc0 { + default: + /* RFC 1035 + A domain name represented as a sequence of labels, where + each label consists of a length octet followed by that + number of octets. The domain name terminates with the + zero length octet for the null label of the root. Note + that this field may be an odd number of octets; no + padding is used. + */ + index2 := index + int(data[index]) + 1 + if index2-offset > 255 { + return nil, 0, + fmt.Errorf("dns name is too long") + } + *buffer = append(*buffer, '.') + *buffer = append(*buffer, data[index+1:index2]...) + index = index2 + + case 0xc0: + /* RFC 1035 + The pointer takes the form of a two octet sequence. + + The first two bits are ones. This allows a pointer to + be distinguished from a label, since the label must + begin with two zero bits because labels are restricted + to 63 octets or less. (The 10 and 01 combinations are + reserved for future use.) The OFFSET field specifies + an offset from the start of the message (i.e., the + first octet of the ID field in the domain header). A + zero offset specifies the first byte of the ID field, + etc. + + The compression scheme allows a domain name in a message to be + represented as either: + - a sequence of labels ending in a zero octet + - a pointer + - a sequence of labels ending with a pointer + */ + + offsetp := int(binary.BigEndian.Uint16(data[index:index+2]) & 0x3fff) + // This looks a little tricky, but actually isn't. Because of how + // decodeName is written, calling it appends the decoded name to the + // current buffer. We already have the start of the buffer, then, so + // once this call is done buffer[start:] will contain our full name. + _, _, err := decodeName(data, offsetp, buffer, level+1) + if err != nil { + return nil, 0, err + } + index++ // pointer is two bytes, so add an extra byte here. + break loop + /* EDNS, or other DNS option ? */ + case 0x40: // RFC 2673 + return nil, 0, fmt.Errorf("qname '0x40' - RFC 2673 unsupported yet (data=%x index=%d)", + data[index], index) + + case 0x80: + return nil, 0, fmt.Errorf("qname '0x80' unsupported yet (data=%x index=%d)", + data[index], index) + } + } + return (*buffer)[start+1:], index + 1, nil +} + +type DNSQuestion struct { + Name []byte + Type DNSType + Class DNSClass +} + +func (q *DNSQuestion) decode(data []byte, offset int, df gopacket.DecodeFeedback, buffer *[]byte) (int, error) { + name, endq, err := decodeName(data, offset, buffer, 1) + if err != nil { + return 0, err + } + + q.Name = name + q.Type = DNSType(binary.BigEndian.Uint16(data[endq : endq+2])) + q.Class = DNSClass(binary.BigEndian.Uint16(data[endq+2 : endq+4])) + + return endq + 4, nil +} + +// DNSResourceRecord +// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | | +// / / +// / NAME / +// | | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | TYPE | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | CLASS | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | TTL | +// | | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +// | RDLENGTH | +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--| +// / RDATA / +// / / +// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ + +type DNSResourceRecord struct { + // Header + Name []byte + Type DNSType + Class DNSClass + TTL uint32 + + // RData Raw Values + DataLength uint16 + Data []byte + + // RDATA Decoded Values + IP net.IP + NS, CNAME, PTR, TXT []byte + SOA DNSSOA + SRV DNSSRV + MX DNSMX +} + +// decode decodes the resource record, returning the total length of the record. +func (rr *DNSResourceRecord) decode(data []byte, offset int, df gopacket.DecodeFeedback, buffer *[]byte) (int, error) { + name, endq, err := decodeName(data, offset, buffer, 1) + if err != nil { + return 0, err + } + + rr.Name = name + rr.Type = DNSType(binary.BigEndian.Uint16(data[endq : endq+2])) + rr.Class = DNSClass(binary.BigEndian.Uint16(data[endq+2 : endq+4])) + rr.TTL = binary.BigEndian.Uint32(data[endq+4 : endq+8]) + rr.DataLength = binary.BigEndian.Uint16(data[endq+8 : endq+10]) + rr.Data = data[endq+10 : endq+10+int(rr.DataLength)] + + if err = rr.decodeRData(data, endq+10, buffer); err != nil { + return 0, err + } + + return endq + 10 + int(rr.DataLength), nil +} + +func (rr *DNSResourceRecord) String() string { + if (rr.Class == DNSClassIN) && ((rr.Type == DNSTypeA) || (rr.Type == DNSTypeAAAA)) { + return net.IP(rr.Data).String() + } + return "..." +} + +func (rr *DNSResourceRecord) decodeRData(data []byte, offset int, buffer *[]byte) error { + switch rr.Type { + case DNSTypeA: + rr.IP = rr.Data + case DNSTypeAAAA: + rr.IP = rr.Data + case DNSTypeTXT: + rr.TXT = rr.Data + case DNSTypeHINFO: + rr.TXT = rr.Data + case DNSTypeNS: + name, _, err := decodeName(data, offset, buffer, 1) + if err != nil { + return err + } + rr.NS = name + case DNSTypeCNAME: + name, _, err := decodeName(data, offset, buffer, 1) + if err != nil { + return err + } + rr.CNAME = name + case DNSTypePTR: + name, _, err := decodeName(data, offset, buffer, 1) + if err != nil { + return err + } + rr.PTR = name + case DNSTypeSOA: + name, endq, err := decodeName(data, offset, buffer, 1) + if err != nil { + return err + } + rr.SOA.MName = name + name, endq, err = decodeName(data, endq, buffer, 1) + if err != nil { + return err + } + rr.SOA.RName = name + rr.SOA.Serial = binary.BigEndian.Uint32(data[endq : endq+4]) + rr.SOA.Refresh = binary.BigEndian.Uint32(data[endq+4 : endq+8]) + rr.SOA.Retry = binary.BigEndian.Uint32(data[endq+8 : endq+12]) + rr.SOA.Expire = binary.BigEndian.Uint32(data[endq+12 : endq+16]) + rr.SOA.Minimum = binary.BigEndian.Uint32(data[endq+16 : endq+20]) + case DNSTypeMX: + rr.MX.Preference = binary.BigEndian.Uint16(data[offset : offset+2]) + name, _, err := decodeName(data, offset+2, buffer, 1) + if err != nil { + return err + } + rr.MX.Name = name + case DNSTypeSRV: + rr.SRV.Priority = binary.BigEndian.Uint16(data[offset : offset+2]) + rr.SRV.Weight = binary.BigEndian.Uint16(data[offset+2 : offset+4]) + rr.SRV.Port = binary.BigEndian.Uint16(data[offset+4 : offset+6]) + name, _, err := decodeName(data, offset+6, buffer, 1) + if err != nil { + return err + } + rr.SRV.Name = name + } + return nil +} + +type DNSSOA struct { + MName, RName []byte + Serial, Refresh, Retry, Expire, Minimum uint32 +} + +type DNSSRV struct { + Priority, Weight, Port uint16 + Name []byte +} + +type DNSMX struct { + Preference uint16 + Name []byte +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/doc.go new file mode 100644 index 00000000..e1240da4 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/doc.go @@ -0,0 +1,61 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +/* +Package layers provides decoding layers for many common protocols. + +The layers package contains decode implementations for a number of different +types of packet layers. Users of gopacket will almost always want to also use +layers to actually decode packet data into useful pieces. To see the set of +protocols that gopacket/layers is currently able to decode, +look at the set of LayerTypes defined in the Variables sections. The +layers package also defines endpoints for many of the common packet layers +that have source/destination addresses associated with them, for example IPv4/6 +(IPs) and TCP/UDP (ports). +Finally, layers contains a number of useful enumerations (IPProtocol, +EthernetType, LinkType, PPPType, etc...). Many of these implement the +gopacket.Decoder interface, so they can be passed into gopacket as decoders. + +Most common protocol layers are named using acronyms or other industry-common +names (IPv4, TCP, PPP). Some of the less common ones have their names expanded +(CiscoDiscoveryProtocol). +For certain protocols, sub-parts of the protocol are split out into their own +layers (SCTP, for example). This is done mostly in cases where portions of the +protocol may fulfill the capabilities of interesting layers (SCTPData implements +ApplicationLayer, while base SCTP implements TransportLayer), or possibly +because splitting a protocol into a few layers makes decoding easier. + +This package is meant to be used with its parent, +http://github.com/tsg/gopacket. + +Port Types + +Instead of using raw uint16 or uint8 values for ports, we use a different port +type for every protocol, for example TCPPort and UDPPort. This allows us to +override string behavior for each port, which we do by setting up port name +maps (TCPPortNames, UDPPortNames, etc...). Well-known ports are annotated with +their protocol names, and their String function displays these names: + + p := TCPPort(80) + fmt.Printf("Number: %d String: %v", p, p) + // Prints: "Number: 80 String: 80(http)" + +Modifying Decode Behavior + +layers links together decoding through its enumerations. For example, after +decoding layer type Ethernet, it uses Ethernet.EthernetType as its next decoder. +All enumerations that act as decoders, like EthernetType, can be modified by +users depending on their preferences. For example, if you have a spiffy new +IPv4 decoder that works way better than the one built into layers, you can do +this: + + var mySpiffyIPv4Decoder gopacket.Decoder = ... + layers.EthernetTypeMetadata[EthernetTypeIPv4].DecodeWith = mySpiffyIPv4Decoder + +This will make all future ethernet packets use your new decoder to decode IPv4 +packets, instead of the built-in decoder used by gopacket. +*/ +package layers diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/dot11.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/dot11.go new file mode 100644 index 00000000..e14a5e9e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/dot11.go @@ -0,0 +1,1192 @@ +// Copyright 2014 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// See http://standards.ieee.org/findstds/standard/802.11-2012.html for info on +// all of the layers in this file. + +package layers + +import ( + "bytes" + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" + "hash/crc32" + "net" +) + +// Dot11Flags contains the set of 8 flags in the IEEE 802.11 frame control +// header, all in one place. +type Dot11Flags uint8 + +const ( + Dot11FlagsToDS Dot11Flags = 1 << iota + Dot11FlagsFromDS + Dot11FlagsMF + Dot11FlagsRetry + Dot11FlagsPowerManagement + Dot11FlagsMD + Dot11FlagsWEP + Dot11FlagsOrder +) + +func (d Dot11Flags) ToDS() bool { + return d&Dot11FlagsToDS != 0 +} +func (d Dot11Flags) FromDS() bool { + return d&Dot11FlagsFromDS != 0 +} +func (d Dot11Flags) MF() bool { + return d&Dot11FlagsMF != 0 +} +func (d Dot11Flags) Retry() bool { + return d&Dot11FlagsRetry != 0 +} +func (d Dot11Flags) PowerManagement() bool { + return d&Dot11FlagsPowerManagement != 0 +} +func (d Dot11Flags) MD() bool { + return d&Dot11FlagsMD != 0 +} +func (d Dot11Flags) WEP() bool { + return d&Dot11FlagsWEP != 0 +} +func (d Dot11Flags) Order() bool { + return d&Dot11FlagsOrder != 0 +} + +// String provides a human readable string for Dot11Flags. +// This string is possibly subject to change over time; if you're storing this +// persistently, you should probably store the Dot11Flags value, not its string. +func (a Dot11Flags) String() string { + var out bytes.Buffer + if a.ToDS() { + out.WriteString("TO-DS,") + } + if a.FromDS() { + out.WriteString("FROM-DS,") + } + if a.MF() { + out.WriteString("MF,") + } + if a.Retry() { + out.WriteString("Retry,") + } + if a.PowerManagement() { + out.WriteString("PowerManagement,") + } + if a.MD() { + out.WriteString("MD,") + } + if a.WEP() { + out.WriteString("WEP,") + } + if a.Order() { + out.WriteString("Order,") + } + + if length := out.Len(); length > 0 { + return string(out.Bytes()[:length-1]) // strip final comma + } + return "" +} + +type Dot11Reason uint16 + +// TODO: Verify these reasons, and append more reasons if necessary. + +const ( + Dot11ReasonReserved Dot11Reason = 1 + Dot11ReasonUnspecified Dot11Reason = 2 + Dot11ReasonAuthExpired Dot11Reason = 3 + Dot11ReasonDeauthStLeaving Dot11Reason = 4 + Dot11ReasonInactivity Dot11Reason = 5 + Dot11ReasonApFull Dot11Reason = 6 + Dot11ReasonClass2FromNonAuth Dot11Reason = 7 + Dot11ReasonClass3FromNonAss Dot11Reason = 8 + Dot11ReasonDisasStLeaving Dot11Reason = 9 + Dot11ReasonStNotAuth Dot11Reason = 10 +) + +// String provides a human readable string for Dot11Reason. +// This string is possibly subject to change over time; if you're storing this +// persistently, you should probably store the Dot11Reason value, not its string. +func (a Dot11Reason) String() string { + switch a { + case Dot11ReasonReserved: + return "Reserved" + case Dot11ReasonUnspecified: + return "Unspecified" + case Dot11ReasonAuthExpired: + return "Auth. expired" + case Dot11ReasonDeauthStLeaving: + return "Deauth. st. leaving" + case Dot11ReasonInactivity: + return "Inactivity" + case Dot11ReasonApFull: + return "Ap. full" + case Dot11ReasonClass2FromNonAuth: + return "Class2 from non auth." + case Dot11ReasonClass3FromNonAss: + return "Class3 from non ass." + case Dot11ReasonDisasStLeaving: + return "Disass st. leaving" + case Dot11ReasonStNotAuth: + return "St. not auth." + default: + return "Unknown reason" + } +} + +type Dot11Status uint16 + +const ( + Dot11StatusSuccess Dot11Status = 0 + Dot11StatusFailure Dot11Status = 1 // Unspecified failure + Dot11StatusCannotSupportAllCapabilities Dot11Status = 10 // Cannot support all requested capabilities in the Capability Information field + Dot11StatusInabilityExistsAssociation Dot11Status = 11 // Reassociation denied due to inability to confirm that association exists + Dot11StatusAssociationDenied Dot11Status = 12 // Association denied due to reason outside the scope of this standard + Dot11StatusAlgorithmUnsupported Dot11Status = 13 // Responding station does not support the specified authentication algorithm + Dot11StatusOufOfExpectedSequence Dot11Status = 14 // Received an Authentication frame with authentication transaction sequence number out of expected sequence + Dot11StatusChallengeFailure Dot11Status = 15 // Authentication rejected because of challenge failure + Dot11StatusTimeout Dot11Status = 16 // Authentication rejected due to timeout waiting for next frame in sequence + Dot11StatusAPUnableToHandle Dot11Status = 17 // Association denied because AP is unable to handle additional associated stations + Dot11StatusRateUnsupported Dot11Status = 18 // Association denied due to requesting station not supporting all of the data rates in the BSSBasicRateSet parameter +) + +// String provides a human readable string for Dot11Status. +// This string is possibly subject to change over time; if you're storing this +// persistently, you should probably store the Dot11Status value, not its string. +func (a Dot11Status) String() string { + switch a { + case Dot11StatusSuccess: + return "success" + case Dot11StatusFailure: + return "failure" + case Dot11StatusCannotSupportAllCapabilities: + return "cannot-support-all-capabilities" + case Dot11StatusInabilityExistsAssociation: + return "inability-exists-association" + case Dot11StatusAssociationDenied: + return "association-denied" + case Dot11StatusAlgorithmUnsupported: + return "algorithm-unsupported" + case Dot11StatusOufOfExpectedSequence: + return "out-of-expected-sequence" + case Dot11StatusChallengeFailure: + return "challenge-failure" + case Dot11StatusTimeout: + return "timeout" + case Dot11StatusAPUnableToHandle: + return "ap-unable-to-handle" + case Dot11StatusRateUnsupported: + return "rate-unsupported" + default: + return "unknown status" + } +} + +type Dot11AckPolicy uint8 + +const ( + Dot11AckPolicyNormal Dot11AckPolicy = 0 + Dot11AckPolicyNone Dot11AckPolicy = 1 + Dot11AckPolicyNoExplicit Dot11AckPolicy = 2 + Dot11AckPolicyBlock Dot11AckPolicy = 3 +) + +// String provides a human readable string for Dot11AckPolicy. +// This string is possibly subject to change over time; if you're storing this +// persistently, you should probably store the Dot11AckPolicy value, not its string. +func (a Dot11AckPolicy) String() string { + switch a { + case Dot11AckPolicyNormal: + return "normal-ack" + case Dot11AckPolicyNone: + return "no-ack" + case Dot11AckPolicyNoExplicit: + return "no-explicit-ack" + case Dot11AckPolicyBlock: + return "block-ack" + default: + return "unknown-ack-policy" + } +} + +type Dot11Algorithm uint16 + +const ( + Dot11AlgorithmOpen Dot11Algorithm = 0 + Dot11AlgorithmSharedKey Dot11Algorithm = 1 +) + +// String provides a human readable string for Dot11Algorithm. +// This string is possibly subject to change over time; if you're storing this +// persistently, you should probably store the Dot11Algorithm value, not its string. +func (a Dot11Algorithm) String() string { + switch a { + case Dot11AlgorithmOpen: + return "open" + case Dot11AlgorithmSharedKey: + return "shared-key" + default: + return "unknown-algorithm" + } +} + +type Dot11InformationElementID uint8 + +// TODO: Verify these element ids, and append more ids if more. + +const ( + Dot11InformationElementIDSSID Dot11InformationElementID = 0 + Dot11InformationElementIDRates Dot11InformationElementID = 1 + Dot11InformationElementIDFHSet Dot11InformationElementID = 2 + Dot11InformationElementIDDSSet Dot11InformationElementID = 3 + Dot11InformationElementIDCFSet Dot11InformationElementID = 4 + Dot11InformationElementIDTIM Dot11InformationElementID = 5 + Dot11InformationElementIDIBSSSet Dot11InformationElementID = 6 + Dot11InformationElementIDChallenge Dot11InformationElementID = 16 + Dot11InformationElementIDERPInfo Dot11InformationElementID = 42 + Dot11InformationElementIDQOSCapability Dot11InformationElementID = 46 + Dot11InformationElementIDERPInfo2 Dot11InformationElementID = 47 + Dot11InformationElementIDRSNInfo Dot11InformationElementID = 48 + Dot11InformationElementIDESRates Dot11InformationElementID = 50 + Dot11InformationElementIDVendor Dot11InformationElementID = 221 + Dot11InformationElementIDReserved Dot11InformationElementID = 68 +) + +// String provides a human readable string for Dot11InformationElementID. +// This string is possibly subject to change over time; if you're storing this +// persistently, you should probably store the Dot11InformationElementID value, +// not its string. +func (a Dot11InformationElementID) String() string { + switch a { + case Dot11InformationElementIDSSID: + return "SSID" + case Dot11InformationElementIDRates: + return "Rates" + case Dot11InformationElementIDFHSet: + return "FHset" + case Dot11InformationElementIDDSSet: + return "DSset" + case Dot11InformationElementIDCFSet: + return "CFset" + case Dot11InformationElementIDTIM: + return "TIM" + case Dot11InformationElementIDIBSSSet: + return "IBSSset" + case Dot11InformationElementIDChallenge: + return "Challenge" + case Dot11InformationElementIDERPInfo: + return "ERPinfo" + case Dot11InformationElementIDQOSCapability: + return "QOS capability" + case Dot11InformationElementIDERPInfo2: + return "ERPinfo2" + case Dot11InformationElementIDRSNInfo: + return "RSNinfo" + case Dot11InformationElementIDESRates: + return "ESrates" + case Dot11InformationElementIDVendor: + return "Vendor" + case Dot11InformationElementIDReserved: + return "Reserved" + default: + return "Unknown information element id" + } +} + +// Dot11 provides an IEEE 802.11 base packet header. +// See http://standards.ieee.org/findstds/standard/802.11-2012.html +// for excrutiating detail. +type Dot11 struct { + BaseLayer + Type Dot11Type + Proto uint8 + Flags Dot11Flags + DurationID uint16 + Address1 net.HardwareAddr + Address2 net.HardwareAddr + Address3 net.HardwareAddr + Address4 net.HardwareAddr + SequenceNumber uint16 + FragmentNumber uint16 + Checksum uint32 +} + +func decodeDot11(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11) LayerType() gopacket.LayerType { return LayerTypeDot11 } +func (m *Dot11) CanDecode() gopacket.LayerClass { return LayerTypeDot11 } +func (m *Dot11) NextLayerType() gopacket.LayerType { + if m.Flags.WEP() { + return (LayerTypeDot11WEP) + } + + return m.Type.LayerType() +} + +func (m *Dot11) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Type = Dot11Type((data[0])&0xFC) >> 2 + + m.Proto = uint8(data[0]) & 0x0003 + m.Flags = Dot11Flags(data[1]) + m.DurationID = binary.LittleEndian.Uint16(data[2:4]) + m.Address1 = net.HardwareAddr(data[4:10]) + + offset := 10 + + mainType := m.Type.MainType() + + switch mainType { + case Dot11TypeCtrl: + switch m.Type { + case Dot11TypeCtrlRTS, Dot11TypeCtrlPowersavePoll, Dot11TypeCtrlCFEnd, Dot11TypeCtrlCFEndAck: + m.Address2 = net.HardwareAddr(data[offset : offset+6]) + offset += 6 + } + case Dot11TypeMgmt, Dot11TypeData: + m.Address2 = net.HardwareAddr(data[offset : offset+6]) + offset += 6 + m.Address3 = net.HardwareAddr(data[offset : offset+6]) + offset += 6 + + m.SequenceNumber = (binary.LittleEndian.Uint16(data[offset:offset+2]) & 0xFFC0) >> 6 + m.FragmentNumber = (binary.LittleEndian.Uint16(data[offset:offset+2]) & 0x003F) + offset += 2 + } + + if mainType == Dot11TypeData && m.Flags.FromDS() && m.Flags.ToDS() { + m.Address4 = net.HardwareAddr(data[offset : offset+6]) + offset += 6 + } + + if mainType == Dot11TypeData { + m.BaseLayer = BaseLayer{Contents: data[0:offset], Payload: data[offset:len(data)]} + } else { + m.BaseLayer = BaseLayer{Contents: data[0:offset], Payload: data[offset : len(data)-4]} + m.Checksum = binary.LittleEndian.Uint32(data[len(data)-4 : len(data)]) + } + return nil +} + +func (m *Dot11) ChecksumValid() bool { + // only for CTRL and MGMT frames + h := crc32.NewIEEE() + h.Write(m.Contents) + h.Write(m.Payload) + return m.Checksum == h.Sum32() +} + +// Dot11Mgmt is a base for all IEEE 802.11 management layers. +type Dot11Mgmt struct { + BaseLayer +} + +func (m *Dot11Mgmt) NextLayerType() gopacket.LayerType { return gopacket.LayerTypePayload } +func (m *Dot11Mgmt) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Contents = data + return nil +} + +// Dot11Ctrl is a base for all IEEE 802.11 control layers. +type Dot11Ctrl struct { + BaseLayer +} + +func (m *Dot11Ctrl) NextLayerType() gopacket.LayerType { return gopacket.LayerTypePayload } + +func (m *Dot11Ctrl) LayerType() gopacket.LayerType { return LayerTypeDot11Ctrl } +func (m *Dot11Ctrl) CanDecode() gopacket.LayerClass { return LayerTypeDot11Ctrl } +func (m *Dot11Ctrl) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Contents = data + return nil +} + +func decodeDot11Ctrl(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11Ctrl{} + return decodingLayerDecoder(d, data, p) +} + +// Dot11WEP contains WEP encrpted IEEE 802.11 data. +type Dot11WEP struct { + BaseLayer +} + +func (m *Dot11WEP) NextLayerType() gopacket.LayerType { return LayerTypeLLC } + +func (m *Dot11WEP) LayerType() gopacket.LayerType { return LayerTypeDot11WEP } +func (m *Dot11WEP) CanDecode() gopacket.LayerClass { return LayerTypeDot11WEP } +func (m *Dot11WEP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Contents = data + return nil +} + +func decodeDot11WEP(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11WEP{} + return decodingLayerDecoder(d, data, p) +} + +// Dot11Data is a base for all IEEE 802.11 data layers. +type Dot11Data struct { + BaseLayer +} + +func (m *Dot11Data) NextLayerType() gopacket.LayerType { return LayerTypeLLC } + +func (m *Dot11Data) LayerType() gopacket.LayerType { return LayerTypeDot11Data } +func (m *Dot11Data) CanDecode() gopacket.LayerClass { return LayerTypeDot11Data } +func (m *Dot11Data) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Payload = data + return nil +} + +func decodeDot11Data(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11Data{} + return decodingLayerDecoder(d, data, p) +} + +type Dot11DataCFAck struct { + Dot11Data +} + +func decodeDot11DataCFAck(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataCFAck{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataCFAck) LayerType() gopacket.LayerType { return LayerTypeDot11DataCFAck } +func (m *Dot11DataCFAck) CanDecode() gopacket.LayerClass { return LayerTypeDot11DataCFAck } +func (m *Dot11DataCFAck) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Data.DecodeFromBytes(data, df) +} + +type Dot11DataCFPoll struct { + Dot11Data +} + +func decodeDot11DataCFPoll(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataCFPoll{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataCFPoll) LayerType() gopacket.LayerType { return LayerTypeDot11DataCFPoll } +func (m *Dot11DataCFPoll) CanDecode() gopacket.LayerClass { return LayerTypeDot11DataCFPoll } +func (m *Dot11DataCFPoll) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Data.DecodeFromBytes(data, df) +} + +type Dot11DataCFAckPoll struct { + Dot11Data +} + +func decodeDot11DataCFAckPoll(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataCFAckPoll{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataCFAckPoll) LayerType() gopacket.LayerType { return LayerTypeDot11DataCFAckPoll } +func (m *Dot11DataCFAckPoll) CanDecode() gopacket.LayerClass { return LayerTypeDot11DataCFAckPoll } +func (m *Dot11DataCFAckPoll) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Data.DecodeFromBytes(data, df) +} + +type Dot11DataNull struct { + Dot11Data +} + +func decodeDot11DataNull(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataNull{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataNull) LayerType() gopacket.LayerType { return LayerTypeDot11DataNull } +func (m *Dot11DataNull) CanDecode() gopacket.LayerClass { return LayerTypeDot11DataNull } +func (m *Dot11DataNull) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Data.DecodeFromBytes(data, df) +} + +type Dot11DataCFAckNoData struct { + Dot11Data +} + +func decodeDot11DataCFAckNoData(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataCFAckNoData{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataCFAckNoData) LayerType() gopacket.LayerType { return LayerTypeDot11DataCFAckNoData } +func (m *Dot11DataCFAckNoData) CanDecode() gopacket.LayerClass { return LayerTypeDot11DataCFAckNoData } +func (m *Dot11DataCFAckNoData) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Data.DecodeFromBytes(data, df) +} + +type Dot11DataCFPollNoData struct { + Dot11Data +} + +func decodeDot11DataCFPollNoData(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataCFPollNoData{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataCFPollNoData) LayerType() gopacket.LayerType { return LayerTypeDot11DataCFPollNoData } +func (m *Dot11DataCFPollNoData) CanDecode() gopacket.LayerClass { return LayerTypeDot11DataCFPollNoData } +func (m *Dot11DataCFPollNoData) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Data.DecodeFromBytes(data, df) +} + +type Dot11DataCFAckPollNoData struct { + Dot11Data +} + +func decodeDot11DataCFAckPollNoData(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataCFAckPollNoData{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataCFAckPollNoData) LayerType() gopacket.LayerType { + return LayerTypeDot11DataCFAckPollNoData +} +func (m *Dot11DataCFAckPollNoData) CanDecode() gopacket.LayerClass { + return LayerTypeDot11DataCFAckPollNoData +} +func (m *Dot11DataCFAckPollNoData) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Data.DecodeFromBytes(data, df) +} + +type Dot11DataQOS struct { + Dot11Ctrl + TID uint8 /* Traffic IDentifier */ + EOSP bool /* End of service period */ + AckPolicy Dot11AckPolicy + TXOP uint8 +} + +func (m *Dot11DataQOS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.TID = (uint8(data[0]) & 0x0F) + m.EOSP = (uint8(data[0]) & 0x10) == 0x10 + m.AckPolicy = Dot11AckPolicy((uint8(data[0]) & 0x60) >> 5) + m.TXOP = uint8(data[1]) + // TODO: Mesh Control bytes 2:4 + m.BaseLayer = BaseLayer{Contents: data[0:4], Payload: data[4:]} + return nil +} + +type Dot11DataQOSData struct { + Dot11DataQOS +} + +func decodeDot11DataQOSData(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataQOSData{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataQOSData) LayerType() gopacket.LayerType { return LayerTypeDot11DataQOSData } +func (m *Dot11DataQOSData) CanDecode() gopacket.LayerClass { return LayerTypeDot11DataQOSData } + +func (m *Dot11DataQOSData) NextLayerType() gopacket.LayerType { + return LayerTypeDot11Data +} + +type Dot11DataQOSDataCFAck struct { + Dot11DataQOS +} + +func decodeDot11DataQOSDataCFAck(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataQOSDataCFAck{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataQOSDataCFAck) LayerType() gopacket.LayerType { return LayerTypeDot11DataQOSDataCFAck } +func (m *Dot11DataQOSDataCFAck) CanDecode() gopacket.LayerClass { return LayerTypeDot11DataQOSDataCFAck } +func (m *Dot11DataQOSDataCFAck) NextLayerType() gopacket.LayerType { return LayerTypeDot11DataCFAck } + +type Dot11DataQOSDataCFPoll struct { + Dot11DataQOS +} + +func decodeDot11DataQOSDataCFPoll(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataQOSDataCFPoll{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataQOSDataCFPoll) LayerType() gopacket.LayerType { + return LayerTypeDot11DataQOSDataCFPoll +} +func (m *Dot11DataQOSDataCFPoll) CanDecode() gopacket.LayerClass { + return LayerTypeDot11DataQOSDataCFPoll +} +func (m *Dot11DataQOSDataCFPoll) NextLayerType() gopacket.LayerType { return LayerTypeDot11DataCFPoll } + +type Dot11DataQOSDataCFAckPoll struct { + Dot11DataQOS +} + +func decodeDot11DataQOSDataCFAckPoll(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataQOSDataCFAckPoll{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataQOSDataCFAckPoll) LayerType() gopacket.LayerType { + return LayerTypeDot11DataQOSDataCFAckPoll +} +func (m *Dot11DataQOSDataCFAckPoll) CanDecode() gopacket.LayerClass { + return LayerTypeDot11DataQOSDataCFAckPoll +} +func (m *Dot11DataQOSDataCFAckPoll) NextLayerType() gopacket.LayerType { + return LayerTypeDot11DataCFAckPoll +} + +type Dot11DataQOSNull struct { + Dot11DataQOS +} + +func decodeDot11DataQOSNull(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataQOSNull{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataQOSNull) LayerType() gopacket.LayerType { return LayerTypeDot11DataQOSNull } +func (m *Dot11DataQOSNull) CanDecode() gopacket.LayerClass { return LayerTypeDot11DataQOSNull } +func (m *Dot11DataQOSNull) NextLayerType() gopacket.LayerType { return LayerTypeDot11DataNull } + +type Dot11DataQOSCFPollNoData struct { + Dot11DataQOS +} + +func decodeDot11DataQOSCFPollNoData(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataQOSCFPollNoData{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataQOSCFPollNoData) LayerType() gopacket.LayerType { + return LayerTypeDot11DataQOSCFPollNoData +} +func (m *Dot11DataQOSCFPollNoData) CanDecode() gopacket.LayerClass { + return LayerTypeDot11DataQOSCFPollNoData +} +func (m *Dot11DataQOSCFPollNoData) NextLayerType() gopacket.LayerType { + return LayerTypeDot11DataCFPollNoData +} + +type Dot11DataQOSCFAckPollNoData struct { + Dot11DataQOS +} + +func decodeDot11DataQOSCFAckPollNoData(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11DataQOSCFAckPollNoData{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11DataQOSCFAckPollNoData) LayerType() gopacket.LayerType { + return LayerTypeDot11DataQOSCFAckPollNoData +} +func (m *Dot11DataQOSCFAckPollNoData) CanDecode() gopacket.LayerClass { + return LayerTypeDot11DataQOSCFAckPollNoData +} +func (m *Dot11DataQOSCFAckPollNoData) NextLayerType() gopacket.LayerType { + return LayerTypeDot11DataCFAckPollNoData +} + +type Dot11InformationElement struct { + BaseLayer + ID Dot11InformationElementID + Length uint8 + OUI []byte + Info []byte +} + +func (m *Dot11InformationElement) LayerType() gopacket.LayerType { + return LayerTypeDot11InformationElement +} +func (m *Dot11InformationElement) CanDecode() gopacket.LayerClass { + return LayerTypeDot11InformationElement +} + +func (m *Dot11InformationElement) NextLayerType() gopacket.LayerType { + return LayerTypeDot11InformationElement +} + +func (m *Dot11InformationElement) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.ID = Dot11InformationElementID(data[0]) + m.Length = data[1] + offset := uint8(2) + + if m.ID == 221 { + // Vendor extension + m.OUI = data[offset : offset+4] + m.Info = data[offset+4 : offset+m.Length] + } else { + m.Info = data[offset : offset+m.Length] + } + + offset += m.Length + + m.BaseLayer = BaseLayer{Contents: data[:offset], Payload: data[offset:]} + return nil +} + +func (d *Dot11InformationElement) String() string { + if d.ID == 0 { + return fmt.Sprintf("802.11 Information Element (SSID: %v)", string(d.Info)) + } else if d.ID == 1 { + rates := "" + for i := 0; i < len(d.Info); i++ { + if d.Info[i]&0x80 == 0 { + rates += fmt.Sprintf("%.1f ", float32(d.Info[i])*0.5) + } else { + rates += fmt.Sprintf("%.1f* ", float32(d.Info[i]&0x7F)*0.5) + } + } + return fmt.Sprintf("802.11 Information Element (Rates: %s Mbit)", rates) + } else if d.ID == 221 { + return fmt.Sprintf("802.11 Information Element (Vendor: ID: %v, Length: %v, OUI: %X, Info: %X)", d.ID, d.Length, d.OUI, d.Info) + } else { + return fmt.Sprintf("802.11 Information Element (ID: %v, Length: %v, Info: %X)", d.ID, d.Length, d.Info) + } +} + +func decodeDot11InformationElement(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11InformationElement{} + return decodingLayerDecoder(d, data, p) +} + +type Dot11CtrlCTS struct { + Dot11Ctrl +} + +func decodeDot11CtrlCTS(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11CtrlCTS{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11CtrlCTS) LayerType() gopacket.LayerType { + return LayerTypeDot11CtrlCTS +} +func (m *Dot11CtrlCTS) CanDecode() gopacket.LayerClass { + return LayerTypeDot11CtrlCTS +} +func (m *Dot11CtrlCTS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Ctrl.DecodeFromBytes(data, df) +} + +type Dot11CtrlRTS struct { + Dot11Ctrl +} + +func decodeDot11CtrlRTS(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11CtrlRTS{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11CtrlRTS) LayerType() gopacket.LayerType { + return LayerTypeDot11CtrlRTS +} +func (m *Dot11CtrlRTS) CanDecode() gopacket.LayerClass { + return LayerTypeDot11CtrlRTS +} +func (m *Dot11CtrlRTS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Ctrl.DecodeFromBytes(data, df) +} + +type Dot11CtrlBlockAckReq struct { + Dot11Ctrl +} + +func decodeDot11CtrlBlockAckReq(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11CtrlBlockAckReq{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11CtrlBlockAckReq) LayerType() gopacket.LayerType { + return LayerTypeDot11CtrlBlockAckReq +} +func (m *Dot11CtrlBlockAckReq) CanDecode() gopacket.LayerClass { + return LayerTypeDot11CtrlBlockAckReq +} +func (m *Dot11CtrlBlockAckReq) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Ctrl.DecodeFromBytes(data, df) +} + +type Dot11CtrlBlockAck struct { + Dot11Ctrl +} + +func decodeDot11CtrlBlockAck(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11CtrlBlockAck{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11CtrlBlockAck) LayerType() gopacket.LayerType { return LayerTypeDot11CtrlBlockAck } +func (m *Dot11CtrlBlockAck) CanDecode() gopacket.LayerClass { return LayerTypeDot11CtrlBlockAck } +func (m *Dot11CtrlBlockAck) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Ctrl.DecodeFromBytes(data, df) +} + +type Dot11CtrlPowersavePoll struct { + Dot11Ctrl +} + +func decodeDot11CtrlPowersavePoll(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11CtrlPowersavePoll{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11CtrlPowersavePoll) LayerType() gopacket.LayerType { + return LayerTypeDot11CtrlPowersavePoll +} +func (m *Dot11CtrlPowersavePoll) CanDecode() gopacket.LayerClass { + return LayerTypeDot11CtrlPowersavePoll +} +func (m *Dot11CtrlPowersavePoll) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Ctrl.DecodeFromBytes(data, df) +} + +type Dot11CtrlAck struct { + Dot11Ctrl +} + +func decodeDot11CtrlAck(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11CtrlAck{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11CtrlAck) LayerType() gopacket.LayerType { return LayerTypeDot11CtrlAck } +func (m *Dot11CtrlAck) CanDecode() gopacket.LayerClass { return LayerTypeDot11CtrlAck } +func (m *Dot11CtrlAck) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Ctrl.DecodeFromBytes(data, df) +} + +type Dot11CtrlCFEnd struct { + Dot11Ctrl +} + +func decodeDot11CtrlCFEnd(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11CtrlCFEnd{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11CtrlCFEnd) LayerType() gopacket.LayerType { + return LayerTypeDot11CtrlCFEnd +} +func (m *Dot11CtrlCFEnd) CanDecode() gopacket.LayerClass { + return LayerTypeDot11CtrlCFEnd +} +func (m *Dot11CtrlCFEnd) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Ctrl.DecodeFromBytes(data, df) +} + +type Dot11CtrlCFEndAck struct { + Dot11Ctrl +} + +func decodeDot11CtrlCFEndAck(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11CtrlCFEndAck{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11CtrlCFEndAck) LayerType() gopacket.LayerType { + return LayerTypeDot11CtrlCFEndAck +} +func (m *Dot11CtrlCFEndAck) CanDecode() gopacket.LayerClass { + return LayerTypeDot11CtrlCFEndAck +} +func (m *Dot11CtrlCFEndAck) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + return m.Dot11Ctrl.DecodeFromBytes(data, df) +} + +type Dot11MgmtAssociationReq struct { + Dot11Mgmt + CapabilityInfo uint16 + ListenInterval uint16 +} + +func decodeDot11MgmtAssociationReq(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtAssociationReq{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtAssociationReq) LayerType() gopacket.LayerType { + return LayerTypeDot11MgmtAssociationReq +} +func (m *Dot11MgmtAssociationReq) CanDecode() gopacket.LayerClass { + return LayerTypeDot11MgmtAssociationReq +} +func (m *Dot11MgmtAssociationReq) NextLayerType() gopacket.LayerType { + return LayerTypeDot11InformationElement +} +func (m *Dot11MgmtAssociationReq) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.CapabilityInfo = binary.LittleEndian.Uint16(data[0:2]) + m.ListenInterval = binary.LittleEndian.Uint16(data[2:4]) + return m.Dot11Mgmt.DecodeFromBytes(data, df) +} + +type Dot11MgmtAssociationResp struct { + Dot11Mgmt + CapabilityInfo uint16 + Status Dot11Status + AID uint16 +} + +func decodeDot11MgmtAssociationResp(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtAssociationResp{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtAssociationResp) CanDecode() gopacket.LayerClass { + return LayerTypeDot11MgmtAssociationResp +} +func (m *Dot11MgmtAssociationResp) LayerType() gopacket.LayerType { + return LayerTypeDot11MgmtAssociationResp +} +func (m *Dot11MgmtAssociationResp) NextLayerType() gopacket.LayerType { + return LayerTypeDot11InformationElement +} +func (m *Dot11MgmtAssociationResp) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.CapabilityInfo = binary.LittleEndian.Uint16(data[0:2]) + m.Status = Dot11Status(binary.LittleEndian.Uint16(data[2:4])) + m.AID = binary.LittleEndian.Uint16(data[4:6]) + return m.Dot11Mgmt.DecodeFromBytes(data, df) +} + +type Dot11MgmtReassociationReq struct { + Dot11Mgmt + CapabilityInfo uint16 + ListenInterval uint16 + CurrentApAddress net.HardwareAddr +} + +func decodeDot11MgmtReassociationReq(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtReassociationReq{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtReassociationReq) LayerType() gopacket.LayerType { + return LayerTypeDot11MgmtReassociationReq +} +func (m *Dot11MgmtReassociationReq) CanDecode() gopacket.LayerClass { + return LayerTypeDot11MgmtReassociationReq +} +func (m *Dot11MgmtReassociationReq) NextLayerType() gopacket.LayerType { + return LayerTypeDot11InformationElement +} +func (m *Dot11MgmtReassociationReq) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.CapabilityInfo = binary.LittleEndian.Uint16(data[0:2]) + m.ListenInterval = binary.LittleEndian.Uint16(data[2:4]) + m.CurrentApAddress = net.HardwareAddr(data[4:10]) + return m.Dot11Mgmt.DecodeFromBytes(data, df) +} + +type Dot11MgmtReassociationResp struct { + Dot11Mgmt +} + +func decodeDot11MgmtReassociationResp(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtReassociationResp{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtReassociationResp) LayerType() gopacket.LayerType { + return LayerTypeDot11MgmtReassociationResp +} +func (m *Dot11MgmtReassociationResp) CanDecode() gopacket.LayerClass { + return LayerTypeDot11MgmtReassociationResp +} +func (m *Dot11MgmtReassociationResp) NextLayerType() gopacket.LayerType { + return LayerTypeDot11InformationElement +} + +type Dot11MgmtProbeReq struct { + Dot11Mgmt +} + +func decodeDot11MgmtProbeReq(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtProbeReq{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtProbeReq) LayerType() gopacket.LayerType { return LayerTypeDot11MgmtProbeReq } +func (m *Dot11MgmtProbeReq) CanDecode() gopacket.LayerClass { return LayerTypeDot11MgmtProbeReq } +func (m *Dot11MgmtProbeReq) NextLayerType() gopacket.LayerType { + return LayerTypeDot11InformationElement +} + +type Dot11MgmtProbeResp struct { + Dot11Mgmt +} + +func decodeDot11MgmtProbeResp(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtProbeResp{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtProbeResp) LayerType() gopacket.LayerType { return LayerTypeDot11MgmtProbeResp } +func (m *Dot11MgmtProbeResp) CanDecode() gopacket.LayerClass { return LayerTypeDot11MgmtProbeResp } +func (m *Dot11MgmtProbeResp) NextLayerType() gopacket.LayerType { + return LayerTypeDot11InformationElement +} + +type Dot11MgmtMeasurementPilot struct { + Dot11Mgmt +} + +func decodeDot11MgmtMeasurementPilot(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtMeasurementPilot{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtMeasurementPilot) LayerType() gopacket.LayerType { + return LayerTypeDot11MgmtMeasurementPilot +} +func (m *Dot11MgmtMeasurementPilot) CanDecode() gopacket.LayerClass { + return LayerTypeDot11MgmtMeasurementPilot +} + +type Dot11MgmtBeacon struct { + Dot11Mgmt + Timestamp uint64 + Interval uint16 + Flags uint16 +} + +func decodeDot11MgmtBeacon(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtBeacon{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtBeacon) LayerType() gopacket.LayerType { return LayerTypeDot11MgmtBeacon } +func (m *Dot11MgmtBeacon) CanDecode() gopacket.LayerClass { return LayerTypeDot11MgmtBeacon } +func (m *Dot11MgmtBeacon) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Timestamp = binary.LittleEndian.Uint64(data[0:8]) + m.Interval = binary.LittleEndian.Uint16(data[8:10]) + m.Flags = binary.LittleEndian.Uint16(data[10:12]) + return m.Dot11Mgmt.DecodeFromBytes(data, df) +} + +func (m *Dot11MgmtBeacon) NextLayerType() gopacket.LayerType { return LayerTypeDot11InformationElement } + +type Dot11MgmtATIM struct { + Dot11Mgmt +} + +func decodeDot11MgmtATIM(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtATIM{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtATIM) LayerType() gopacket.LayerType { return LayerTypeDot11MgmtATIM } +func (m *Dot11MgmtATIM) CanDecode() gopacket.LayerClass { return LayerTypeDot11MgmtATIM } + +type Dot11MgmtDisassociation struct { + Dot11Mgmt + Reason Dot11Reason +} + +func decodeDot11MgmtDisassociation(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtDisassociation{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtDisassociation) LayerType() gopacket.LayerType { + return LayerTypeDot11MgmtDisassociation +} +func (m *Dot11MgmtDisassociation) CanDecode() gopacket.LayerClass { + return LayerTypeDot11MgmtDisassociation +} +func (m *Dot11MgmtDisassociation) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Reason = Dot11Reason(binary.LittleEndian.Uint16(data[0:2])) + return m.Dot11Mgmt.DecodeFromBytes(data, df) +} + +type Dot11MgmtAuthentication struct { + Dot11Mgmt + Algorithm Dot11Algorithm + Sequence uint16 + Status Dot11Status +} + +func decodeDot11MgmtAuthentication(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtAuthentication{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtAuthentication) LayerType() gopacket.LayerType { + return LayerTypeDot11MgmtAuthentication +} +func (m *Dot11MgmtAuthentication) CanDecode() gopacket.LayerClass { + return LayerTypeDot11MgmtAuthentication +} +func (m *Dot11MgmtAuthentication) NextLayerType() gopacket.LayerType { + return LayerTypeDot11InformationElement +} +func (m *Dot11MgmtAuthentication) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Algorithm = Dot11Algorithm(binary.LittleEndian.Uint16(data[0:2])) + m.Sequence = binary.LittleEndian.Uint16(data[2:4]) + m.Status = Dot11Status(binary.LittleEndian.Uint16(data[4:6])) + return m.Dot11Mgmt.DecodeFromBytes(data, df) +} + +type Dot11MgmtDeauthentication struct { + Dot11Mgmt + Reason Dot11Reason +} + +func decodeDot11MgmtDeauthentication(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtDeauthentication{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtDeauthentication) LayerType() gopacket.LayerType { + return LayerTypeDot11MgmtDeauthentication +} +func (m *Dot11MgmtDeauthentication) CanDecode() gopacket.LayerClass { + return LayerTypeDot11MgmtDeauthentication +} +func (m *Dot11MgmtDeauthentication) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Reason = Dot11Reason(binary.LittleEndian.Uint16(data[0:2])) + return m.Dot11Mgmt.DecodeFromBytes(data, df) +} + +type Dot11MgmtAction struct { + Dot11Mgmt +} + +func decodeDot11MgmtAction(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtAction{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtAction) LayerType() gopacket.LayerType { return LayerTypeDot11MgmtAction } +func (m *Dot11MgmtAction) CanDecode() gopacket.LayerClass { return LayerTypeDot11MgmtAction } + +type Dot11MgmtActionNoAck struct { + Dot11Mgmt +} + +func decodeDot11MgmtActionNoAck(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtActionNoAck{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtActionNoAck) LayerType() gopacket.LayerType { return LayerTypeDot11MgmtActionNoAck } +func (m *Dot11MgmtActionNoAck) CanDecode() gopacket.LayerClass { return LayerTypeDot11MgmtActionNoAck } + +type Dot11MgmtArubaWLAN struct { + Dot11Mgmt +} + +func decodeDot11MgmtArubaWLAN(data []byte, p gopacket.PacketBuilder) error { + d := &Dot11MgmtArubaWLAN{} + return decodingLayerDecoder(d, data, p) +} + +func (m *Dot11MgmtArubaWLAN) LayerType() gopacket.LayerType { return LayerTypeDot11MgmtArubaWLAN } +func (m *Dot11MgmtArubaWLAN) CanDecode() gopacket.LayerClass { return LayerTypeDot11MgmtArubaWLAN } diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/dot1q.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/dot1q.go new file mode 100644 index 00000000..45ca3e3a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/dot1q.go @@ -0,0 +1,71 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" +) + +// Dot1Q is the packet layer for 802.1Q VLAN headers. +type Dot1Q struct { + BaseLayer + Priority uint8 + DropEligible bool + VLANIdentifier uint16 + Type EthernetType +} + +// LayerType returns gopacket.LayerTypeDot1Q +func (d *Dot1Q) LayerType() gopacket.LayerType { return LayerTypeDot1Q } + +// DecodeFromBytes decodes the given bytes into this layer. +func (d *Dot1Q) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + d.Priority = (data[0] & 0xE0) >> 5 + d.DropEligible = data[0]&0x10 != 0 + d.VLANIdentifier = binary.BigEndian.Uint16(data[:2]) & 0x0FFF + d.Type = EthernetType(binary.BigEndian.Uint16(data[2:4])) + d.BaseLayer = BaseLayer{Contents: data[:4], Payload: data[4:]} + return nil +} + +// CanDecode returns the set of layer types that this DecodingLayer can decode. +func (d *Dot1Q) CanDecode() gopacket.LayerClass { + return LayerTypeDot1Q +} + +// NextLayerType returns the layer type contained by this DecodingLayer. +func (d *Dot1Q) NextLayerType() gopacket.LayerType { + return d.Type.LayerType() +} + +func decodeDot1Q(data []byte, p gopacket.PacketBuilder) error { + d := &Dot1Q{} + return decodingLayerDecoder(d, data, p) +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (d *Dot1Q) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + bytes, err := b.PrependBytes(4) + if err != nil { + return err + } + if d.VLANIdentifier > 0xFFF { + return fmt.Errorf("vlan identifier %v is too high", d.VLANIdentifier) + } + firstBytes := uint16(d.Priority)<<13 | d.VLANIdentifier + if d.DropEligible { + firstBytes |= 0x10 + } + binary.BigEndian.PutUint16(bytes, firstBytes) + binary.BigEndian.PutUint16(bytes[2:], uint16(d.Type)) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/eap.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/eap.go new file mode 100644 index 00000000..ee4e9134 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/eap.go @@ -0,0 +1,106 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" +) + +type EAPCode uint8 +type EAPType uint8 + +const ( + EAPCodeRequest EAPCode = 1 + EAPCodeResponse EAPCode = 2 + EAPCodeSuccess EAPCode = 3 + EAPCodeFailure EAPCode = 4 + + // EAPTypeNone means that this EAP layer has no Type or TypeData. + // Success and Failure EAPs will have this set. + EAPTypeNone EAPType = 0 + + EAPTypeIdentity EAPType = 1 + EAPTypeNotification EAPType = 2 + EAPTypeNACK EAPType = 3 + EAPTypeOTP EAPType = 4 + EAPTypeTokenCard EAPType = 5 +) + +// EAP defines an Extensible Authentication Protocol (rfc 3748) layer. +type EAP struct { + BaseLayer + Code EAPCode + Id uint8 + Length uint16 + Type EAPType + TypeData []byte +} + +// LayerType returns LayerTypeEAP. +func (e *EAP) LayerType() gopacket.LayerType { return LayerTypeEAP } + +// DecodeFromBytes decodes the given bytes into this layer. +func (e *EAP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + e.Code = EAPCode(data[0]) + e.Id = data[1] + e.Length = binary.BigEndian.Uint16(data[2:4]) + switch { + case e.Length > 4: + e.Type = EAPType(data[4]) + e.TypeData = data[5:] + case e.Length == 4: + e.Type = 0 + e.TypeData = nil + default: + return fmt.Errorf("invalid EAP length %d", e.Length) + } + e.BaseLayer.Contents = data[:e.Length] + e.BaseLayer.Payload = data[e.Length:] // Should be 0 bytes + return nil +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (e *EAP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + if opts.FixLengths { + e.Length = uint16(len(e.TypeData) + 1) + } + size := len(e.TypeData) + 4 + if size > 4 { + size++ + } + bytes, err := b.PrependBytes(size) + if err != nil { + return err + } + bytes[0] = byte(e.Code) + bytes[1] = e.Id + binary.BigEndian.PutUint16(bytes[2:], e.Length) + if size > 4 { + bytes[4] = byte(e.Type) + copy(bytes[5:], e.TypeData) + } + return nil +} + +// CanDecode returns the set of layer types that this DecodingLayer can decode. +func (e *EAP) CanDecode() gopacket.LayerClass { + return LayerTypeEAP +} + +// NextLayerType returns the layer type contained by this DecodingLayer. +func (e *EAP) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypeZero +} + +func decodeEAP(data []byte, p gopacket.PacketBuilder) error { + e := &EAP{} + return decodingLayerDecoder(e, data, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/eapol.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/eapol.go new file mode 100644 index 00000000..11b501f5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/eapol.go @@ -0,0 +1,44 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "github.com/tsg/gopacket" +) + +// EAPOL defines an EAP over LAN (802.1x) layer. +type EAPOL struct { + BaseLayer + Version uint8 + Type EAPOLType +} + +// LayerType returns LayerTypeEAPOL. +func (e *EAPOL) LayerType() gopacket.LayerType { return LayerTypeEAPOL } + +// DecodeFromBytes decodes the given bytes into this layer. +func (e *EAPOL) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + e.Version = data[0] + e.Type = EAPOLType(data[1]) + e.BaseLayer = BaseLayer{data[:2], data[2:]} + return nil +} + +// CanDecode returns the set of layer types that this DecodingLayer can decode. +func (e *EAPOL) CanDecode() gopacket.LayerClass { + return LayerTypeEAPOL +} + +// NextLayerType returns the layer type contained by this DecodingLayer. +func (e *EAPOL) NextLayerType() gopacket.LayerType { + return e.Type.LayerType() +} + +func decodeEAPOL(data []byte, p gopacket.PacketBuilder) error { + e := &EAPOL{} + return decodingLayerDecoder(e, data, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/endpoints.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/endpoints.go new file mode 100644 index 00000000..1a34d0cb --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/endpoints.go @@ -0,0 +1,93 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "github.com/tsg/gopacket" + "net" + "strconv" +) + +var ( + // We use two different endpoint types for IPv4 vs IPv6 addresses, so that + // ordering with endpointA.LessThan(endpointB) sanely groups all IPv4 + // addresses and all IPv6 addresses, such that IPv6 > IPv4 for all addresses. + EndpointIPv4 = gopacket.RegisterEndpointType(1, gopacket.EndpointTypeMetadata{"IPv4", func(b []byte) string { + return net.IP(b).String() + }}) + EndpointIPv6 = gopacket.RegisterEndpointType(2, gopacket.EndpointTypeMetadata{"IPv6", func(b []byte) string { + return net.IP(b).String() + }}) + + EndpointMAC = gopacket.RegisterEndpointType(3, gopacket.EndpointTypeMetadata{"MAC", func(b []byte) string { + return net.HardwareAddr(b).String() + }}) + EndpointTCPPort = gopacket.RegisterEndpointType(4, gopacket.EndpointTypeMetadata{"TCP", func(b []byte) string { + return strconv.Itoa(int(binary.BigEndian.Uint16(b))) + }}) + EndpointUDPPort = gopacket.RegisterEndpointType(5, gopacket.EndpointTypeMetadata{"UDP", func(b []byte) string { + return strconv.Itoa(int(binary.BigEndian.Uint16(b))) + }}) + EndpointSCTPPort = gopacket.RegisterEndpointType(6, gopacket.EndpointTypeMetadata{"SCTP", func(b []byte) string { + return strconv.Itoa(int(binary.BigEndian.Uint16(b))) + }}) + EndpointRUDPPort = gopacket.RegisterEndpointType(7, gopacket.EndpointTypeMetadata{"RUDP", func(b []byte) string { + return strconv.Itoa(int(b[0])) + }}) + EndpointUDPLitePort = gopacket.RegisterEndpointType(8, gopacket.EndpointTypeMetadata{"UDPLite", func(b []byte) string { + return strconv.Itoa(int(binary.BigEndian.Uint16(b))) + }}) + EndpointPPP = gopacket.RegisterEndpointType(9, gopacket.EndpointTypeMetadata{"PPP", func([]byte) string { + return "point" + }}) +) + +// NewIPEndpoint creates a new IP (v4 or v6) endpoint from a net.IP address. +// It returns gopacket.InvalidEndpoint if the IP address is invalid. +func NewIPEndpoint(a net.IP) gopacket.Endpoint { + switch len(a) { + case 4: + return gopacket.NewEndpoint(EndpointIPv4, []byte(a)) + case 16: + return gopacket.NewEndpoint(EndpointIPv6, []byte(a)) + } + return gopacket.InvalidEndpoint +} + +// NewMACEndpoint returns a new MAC address endpoint. +func NewMACEndpoint(a net.HardwareAddr) gopacket.Endpoint { + return gopacket.NewEndpoint(EndpointMAC, []byte(a)) +} +func newPortEndpoint(t gopacket.EndpointType, p uint16) gopacket.Endpoint { + return gopacket.NewEndpoint(t, []byte{byte(p >> 8), byte(p)}) +} + +// NewTCPPortEndpoint returns an endpoint based on a TCP port. +func NewTCPPortEndpoint(p TCPPort) gopacket.Endpoint { + return newPortEndpoint(EndpointTCPPort, uint16(p)) +} + +// NewUDPPortEndpoint returns an endpoint based on a UDP port. +func NewUDPPortEndpoint(p UDPPort) gopacket.Endpoint { + return newPortEndpoint(EndpointUDPPort, uint16(p)) +} + +// NewSCTPPortEndpoint returns an endpoint based on a SCTP port. +func NewSCTPPortEndpoint(p SCTPPort) gopacket.Endpoint { + return newPortEndpoint(EndpointSCTPPort, uint16(p)) +} + +// NewRUDPPortEndpoint returns an endpoint based on a RUDP port. +func NewRUDPPortEndpoint(p RUDPPort) gopacket.Endpoint { + return gopacket.NewEndpoint(EndpointRUDPPort, []byte{byte(p)}) +} + +// NewUDPLitePortEndpoint returns an endpoint based on a UDPLite port. +func NewUDPLitePortEndpoint(p UDPLitePort) gopacket.Endpoint { + return newPortEndpoint(EndpointUDPLitePort, uint16(p)) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/enums.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/enums.go new file mode 100644 index 00000000..963f4d84 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/enums.go @@ -0,0 +1,540 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "errors" + "fmt" + "github.com/tsg/gopacket" +) + +// EnumMetadata keeps track of a set of metadata for each enumeration value +// for protocol enumerations. +type EnumMetadata struct { + // DecodeWith is the decoder to use to decode this protocol's data. + DecodeWith gopacket.Decoder + // Name is the name of the enumeration value. + Name string + // LayerType is the layer type implied by the given enum. + LayerType gopacket.LayerType +} + +// errorFunc returns a decoder that spits out a specific error message. +func errorFunc(msg string) gopacket.Decoder { + var e = errors.New(msg) + return gopacket.DecodeFunc(func([]byte, gopacket.PacketBuilder) error { + return e + }) +} + +// EthernetType is an enumeration of ethernet type values, and acts as a decoder +// for any type it supports. +type EthernetType uint16 + +const ( + // EthernetTypeLLC is not an actual ethernet type. It is instead a + // placeholder we use in Ethernet frames that use the 802.3 standard of + // srcmac|dstmac|length|LLC instead of srcmac|dstmac|ethertype. + EthernetTypeLLC EthernetType = 0 + EthernetTypeIPv4 EthernetType = 0x0800 + EthernetTypeARP EthernetType = 0x0806 + EthernetTypeIPv6 EthernetType = 0x86DD + EthernetTypeCiscoDiscovery EthernetType = 0x2000 + EthernetTypeNortelDiscovery EthernetType = 0x01a2 + EthernetTypeDot1Q EthernetType = 0x8100 + EthernetTypePPPoEDiscovery EthernetType = 0x8863 + EthernetTypePPPoESession EthernetType = 0x8864 + EthernetTypeMPLSUnicast EthernetType = 0x8847 + EthernetTypeMPLSMulticast EthernetType = 0x8848 + EthernetTypeEAPOL EthernetType = 0x888e + EthernetTypeLinkLayerDiscovery EthernetType = 0x88cc + EthernetTypeEthernetCTP EthernetType = 0x9000 +) + +// IPProtocol is an enumeration of IP protocol values, and acts as a decoder +// for any type it supports. +type IPProtocol uint8 + +const ( + IPProtocolIPv6HopByHop IPProtocol = 0 + IPProtocolICMPv4 IPProtocol = 1 + IPProtocolIGMP IPProtocol = 2 + IPProtocolTCP IPProtocol = 6 + IPProtocolUDP IPProtocol = 17 + IPProtocolRUDP IPProtocol = 27 + IPProtocolIPv6 IPProtocol = 41 + IPProtocolIPv6Routing IPProtocol = 43 + IPProtocolIPv6Fragment IPProtocol = 44 + IPProtocolGRE IPProtocol = 47 + IPProtocolESP IPProtocol = 50 + IPProtocolAH IPProtocol = 51 + IPProtocolICMPv6 IPProtocol = 58 + IPProtocolNoNextHeader IPProtocol = 59 + IPProtocolIPv6Destination IPProtocol = 60 + IPProtocolIPIP IPProtocol = 94 + IPProtocolEtherIP IPProtocol = 97 + IPProtocolSCTP IPProtocol = 132 + IPProtocolUDPLite IPProtocol = 136 + IPProtocolMPLSInIP IPProtocol = 137 +) + +// LinkType is an enumeration of link types, and acts as a decoder for any +// link type it supports. +type LinkType uint8 + +const ( + // According to pcap-linktype(7). + LinkTypeNull LinkType = 0 + LinkTypeEthernet LinkType = 1 + LinkTypeTokenRing LinkType = 6 + LinkTypeArcNet LinkType = 7 + LinkTypeSLIP LinkType = 8 + LinkTypePPP LinkType = 9 + LinkTypeFDDI LinkType = 10 + LinkTypeATM_RFC1483 LinkType = 100 + LinkTypeRaw LinkType = 101 + LinkTypePPP_HDLC LinkType = 50 + LinkTypePPPEthernet LinkType = 51 + LinkTypeC_HDLC LinkType = 104 + LinkTypeIEEE802_11 LinkType = 105 + LinkTypeFRelay LinkType = 107 + LinkTypeLoop LinkType = 108 + LinkTypeLinuxSLL LinkType = 113 + LinkTypeLTalk LinkType = 104 + LinkTypePFLog LinkType = 117 + LinkTypePrismHeader LinkType = 119 + LinkTypeIPOverFC LinkType = 122 + LinkTypeSunATM LinkType = 123 + LinkTypeIEEE80211Radio LinkType = 127 + LinkTypeARCNetLinux LinkType = 129 + LinkTypeLinuxIRDA LinkType = 144 + LinkTypeLinuxLAPD LinkType = 177 + LinkTypeLinuxUSB LinkType = 220 +) + +// PPPoECode is the PPPoE code enum, taken from http://tools.ietf.org/html/rfc2516 +type PPPoECode uint8 + +const ( + PPPoECodePADI PPPoECode = 0x09 + PPPoECodePADO PPPoECode = 0x07 + PPPoECodePADR PPPoECode = 0x19 + PPPoECodePADS PPPoECode = 0x65 + PPPoECodePADT PPPoECode = 0xA7 + PPPoECodeSession PPPoECode = 0x00 +) + +// PPPType is an enumeration of PPP type values, and acts as a decoder for any +// type it supports. +type PPPType uint16 + +const ( + PPPTypeIPv4 PPPType = 0x0021 + PPPTypeIPv6 PPPType = 0x0057 + PPPTypeMPLSUnicast PPPType = 0x0281 + PPPTypeMPLSMulticast PPPType = 0x0283 +) + +// SCTPChunkType is an enumeration of chunk types inside SCTP packets. +type SCTPChunkType uint8 + +const ( + SCTPChunkTypeData SCTPChunkType = 0 + SCTPChunkTypeInit SCTPChunkType = 1 + SCTPChunkTypeInitAck SCTPChunkType = 2 + SCTPChunkTypeSack SCTPChunkType = 3 + SCTPChunkTypeHeartbeat SCTPChunkType = 4 + SCTPChunkTypeHeartbeatAck SCTPChunkType = 5 + SCTPChunkTypeAbort SCTPChunkType = 6 + SCTPChunkTypeShutdown SCTPChunkType = 7 + SCTPChunkTypeShutdownAck SCTPChunkType = 8 + SCTPChunkTypeError SCTPChunkType = 9 + SCTPChunkTypeCookieEcho SCTPChunkType = 10 + SCTPChunkTypeCookieAck SCTPChunkType = 11 + SCTPChunkTypeShutdownComplete SCTPChunkType = 14 +) + +// FDDIFrameControl is an enumeration of FDDI frame control bytes. +type FDDIFrameControl uint8 + +const ( + FDDIFrameControlLLC FDDIFrameControl = 0x50 +) + +// EAPOLType is an enumeration of EAPOL packet types. +type EAPOLType uint8 + +const ( + EAPOLTypeEAP EAPOLType = 0 + EAPOLTypeStart EAPOLType = 1 + EAPOLTypeLogOff EAPOLType = 2 + EAPOLTypeKey EAPOLType = 3 + EAPOLTypeASFAlert EAPOLType = 4 +) + +// ProtocolFamily is the set of values defined as PF_* in sys/socket.h +type ProtocolFamily uint8 + +const ( + ProtocolFamilyIPv4 ProtocolFamily = 2 + // BSDs use different values for INET6... glory be. These values taken from + // tcpdump 4.3.0. + ProtocolFamilyIPv6BSD ProtocolFamily = 24 + ProtocolFamilyIPv6FreeBSD ProtocolFamily = 28 + ProtocolFamilyIPv6Darwin ProtocolFamily = 30 + ProtocolFamilyIPv6Linux ProtocolFamily = 10 +) + +// Dot11Type is a combination of IEEE 802.11 frame's Type and Subtype fields. +// By combining these two fields together into a single type, we're able to +// provide a String function that correctly displays the subtype given the +// top-level type. +// +// If you just care about the top-level type, use the MainType function. +type Dot11Type uint8 + +// MainType strips the subtype information from the given type, +// returning just the overarching type (Mgmt, Ctrl, Data, Reserved). +func (d Dot11Type) MainType() Dot11Type { + return d & dot11TypeMask +} + +const ( + Dot11TypeMgmt Dot11Type = 0x00 + Dot11TypeCtrl Dot11Type = 0x01 + Dot11TypeData Dot11Type = 0x02 + Dot11TypeReserved Dot11Type = 0x03 + dot11TypeMask = 0x03 + + // The following are type/subtype conglomerations. + + // Management + Dot11TypeMgmtAssociationReq Dot11Type = 0x00 + Dot11TypeMgmtAssociationResp Dot11Type = 0x04 + Dot11TypeMgmtReassociationReq Dot11Type = 0x08 + Dot11TypeMgmtReassociationResp Dot11Type = 0x0c + Dot11TypeMgmtProbeReq Dot11Type = 0x10 + Dot11TypeMgmtProbeResp Dot11Type = 0x14 + Dot11TypeMgmtMeasurementPilot Dot11Type = 0x18 + Dot11TypeMgmtBeacon Dot11Type = 0x20 + Dot11TypeMgmtATIM Dot11Type = 0x24 + Dot11TypeMgmtDisassociation Dot11Type = 0x28 + Dot11TypeMgmtAuthentication Dot11Type = 0x2c + Dot11TypeMgmtDeauthentication Dot11Type = 0x30 + Dot11TypeMgmtAction Dot11Type = 0x34 + Dot11TypeMgmtActionNoAck Dot11Type = 0x38 + + // Control + Dot11TypeCtrlWrapper Dot11Type = 0x1d + Dot11TypeCtrlBlockAckReq Dot11Type = 0x21 + Dot11TypeCtrlBlockAck Dot11Type = 0x25 + Dot11TypeCtrlPowersavePoll Dot11Type = 0x29 + Dot11TypeCtrlRTS Dot11Type = 0x2d + Dot11TypeCtrlCTS Dot11Type = 0x31 + Dot11TypeCtrlAck Dot11Type = 0x35 + Dot11TypeCtrlCFEnd Dot11Type = 0x39 + Dot11TypeCtrlCFEndAck Dot11Type = 0x3d + + // Data + Dot11TypeDataCFAck Dot11Type = 0x06 + Dot11TypeDataCFPoll Dot11Type = 0x0a + Dot11TypeDataCFAckPoll Dot11Type = 0x0e + Dot11TypeDataNull Dot11Type = 0x12 + Dot11TypeDataCFAckNoData Dot11Type = 0x16 + Dot11TypeDataCFPollNoData Dot11Type = 0x1a + Dot11TypeDataCFAckPollNoData Dot11Type = 0x1e + Dot11TypeDataQOSData Dot11Type = 0x22 + Dot11TypeDataQOSDataCFAck Dot11Type = 0x26 + Dot11TypeDataQOSDataCFPoll Dot11Type = 0x2a + Dot11TypeDataQOSDataCFAckPoll Dot11Type = 0x2e + Dot11TypeDataQOSNull Dot11Type = 0x32 + Dot11TypeDataQOSCFPollNoData Dot11Type = 0x3a + Dot11TypeDataQOSCFAckPollNoData Dot11Type = 0x3e +) + +var ( + // Each of the following arrays contains mappings of how to handle enum + // values for various enum types in gopacket/layers. + // + // So, EthernetTypeMetadata[2] contains information on how to handle EthernetType + // 2, including which name to give it and which decoder to use to decode + // packet data of that type. These arrays are filled by default with all of the + // protocols gopacket/layers knows how to handle, but users of the library can + // add new decoders or override existing ones. For example, if you write a better + // TCP decoder, you can override IPProtocolMetadata[IPProtocolTCP].DecodeWith + // with your new decoder, and all gopacket/layers decoding will use your new + // decoder whenever they encounter that IPProtocol. + EthernetTypeMetadata [65536]EnumMetadata + IPProtocolMetadata [265]EnumMetadata + SCTPChunkTypeMetadata [265]EnumMetadata + PPPTypeMetadata [65536]EnumMetadata + PPPoECodeMetadata [256]EnumMetadata + LinkTypeMetadata [256]EnumMetadata + FDDIFrameControlMetadata [256]EnumMetadata + EAPOLTypeMetadata [256]EnumMetadata + ProtocolFamilyMetadata [256]EnumMetadata + Dot11TypeMetadata [256]EnumMetadata + USBTypeMetadata [256]EnumMetadata +) + +func (a EthernetType) Decode(data []byte, p gopacket.PacketBuilder) error { + return EthernetTypeMetadata[a].DecodeWith.Decode(data, p) +} +func (a EthernetType) String() string { + return EthernetTypeMetadata[a].Name +} +func (a EthernetType) LayerType() gopacket.LayerType { + return EthernetTypeMetadata[a].LayerType +} +func (a IPProtocol) Decode(data []byte, p gopacket.PacketBuilder) error { + return IPProtocolMetadata[a].DecodeWith.Decode(data, p) +} +func (a IPProtocol) String() string { + return IPProtocolMetadata[a].Name +} +func (a IPProtocol) LayerType() gopacket.LayerType { + return IPProtocolMetadata[a].LayerType +} +func (a SCTPChunkType) Decode(data []byte, p gopacket.PacketBuilder) error { + return SCTPChunkTypeMetadata[a].DecodeWith.Decode(data, p) +} +func (a SCTPChunkType) String() string { + return SCTPChunkTypeMetadata[a].Name +} +func (a PPPType) Decode(data []byte, p gopacket.PacketBuilder) error { + return PPPTypeMetadata[a].DecodeWith.Decode(data, p) +} +func (a PPPType) String() string { + return PPPTypeMetadata[a].Name +} +func (a LinkType) Decode(data []byte, p gopacket.PacketBuilder) error { + return LinkTypeMetadata[a].DecodeWith.Decode(data, p) +} +func (a LinkType) String() string { + return LinkTypeMetadata[a].Name +} +func (a PPPoECode) Decode(data []byte, p gopacket.PacketBuilder) error { + return PPPoECodeMetadata[a].DecodeWith.Decode(data, p) +} +func (a PPPoECode) String() string { + return PPPoECodeMetadata[a].Name +} +func (a FDDIFrameControl) Decode(data []byte, p gopacket.PacketBuilder) error { + return FDDIFrameControlMetadata[a].DecodeWith.Decode(data, p) +} +func (a FDDIFrameControl) String() string { + return FDDIFrameControlMetadata[a].Name +} +func (a EAPOLType) Decode(data []byte, p gopacket.PacketBuilder) error { + return EAPOLTypeMetadata[a].DecodeWith.Decode(data, p) +} +func (a EAPOLType) String() string { + return EAPOLTypeMetadata[a].Name +} +func (a EAPOLType) LayerType() gopacket.LayerType { + return EAPOLTypeMetadata[a].LayerType +} +func (a ProtocolFamily) Decode(data []byte, p gopacket.PacketBuilder) error { + return ProtocolFamilyMetadata[a].DecodeWith.Decode(data, p) +} +func (a ProtocolFamily) String() string { + return ProtocolFamilyMetadata[a].Name +} +func (a ProtocolFamily) LayerType() gopacket.LayerType { + return ProtocolFamilyMetadata[a].LayerType +} +func (a Dot11Type) Decode(data []byte, p gopacket.PacketBuilder) error { + return Dot11TypeMetadata[a].DecodeWith.Decode(data, p) +} +func (a Dot11Type) String() string { + return Dot11TypeMetadata[a].Name +} +func (a Dot11Type) LayerType() gopacket.LayerType { + return Dot11TypeMetadata[a].LayerType +} + +// Decode a raw v4 or v6 IP packet. +func decodeIPv4or6(data []byte, p gopacket.PacketBuilder) error { + version := data[0] >> 4 + switch version { + case 4: + return decodeIPv4(data, p) + case 6: + return decodeIPv6(data, p) + } + return fmt.Errorf("Invalid IP packet version %v", version) +} + +func init() { + // Here we link up all enumerations with their respective names and decoders. + for i := 0; i < 65536; i++ { + EthernetTypeMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode ethernet type %d", i)), + Name: fmt.Sprintf("UnknownEthernetType(%d)", i), + } + PPPTypeMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode PPP type %d", i)), + Name: fmt.Sprintf("UnknownPPPType(%d)", i), + } + } + for i := 0; i < 256; i++ { + IPProtocolMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode IP protocol %d", i)), + Name: fmt.Sprintf("UnknownIPProtocol(%d)", i), + } + SCTPChunkTypeMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode SCTP chunk type %d", i)), + Name: fmt.Sprintf("UnknownSCTPChunkType(%d)", i), + } + PPPoECodeMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode PPPoE code %d", i)), + Name: fmt.Sprintf("UnknownPPPoECode(%d)", i), + } + LinkTypeMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode link type %d", i)), + Name: fmt.Sprintf("UnknownLinkType(%d)", i), + } + FDDIFrameControlMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode FDDI frame control %d", i)), + Name: fmt.Sprintf("UnknownFDDIFrameControl(%d)", i), + } + EAPOLTypeMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode EAPOL type %d", i)), + Name: fmt.Sprintf("UnknownEAPOLType(%d)", i), + } + ProtocolFamilyMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode protocol family %d", i)), + Name: fmt.Sprintf("UnknownProtocolFamily(%d)", i), + } + Dot11TypeMetadata[i] = EnumMetadata{ + DecodeWith: errorFunc(fmt.Sprintf("Unable to decode Dot11 type %d", i)), + Name: fmt.Sprintf("UnknownDot11Type(%d)", i), + } + } + + EthernetTypeMetadata[EthernetTypeLLC] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLLC), Name: "LLC", LayerType: LayerTypeLLC} + EthernetTypeMetadata[EthernetTypeIPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4", LayerType: LayerTypeIPv4} + EthernetTypeMetadata[EthernetTypeIPv6] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6} + EthernetTypeMetadata[EthernetTypeARP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeARP), Name: "ARP", LayerType: LayerTypeARP} + EthernetTypeMetadata[EthernetTypeDot1Q] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot1Q), Name: "Dot1Q", LayerType: LayerTypeDot1Q} + EthernetTypeMetadata[EthernetTypePPPoEDiscovery] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePPPoE), Name: "PPPoEDiscovery", LayerType: LayerTypePPPoE} + EthernetTypeMetadata[EthernetTypePPPoESession] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePPPoE), Name: "PPPoESession", LayerType: LayerTypePPPoE} + EthernetTypeMetadata[EthernetTypeEthernetCTP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEthernetCTP), Name: "EthernetCTP", LayerType: LayerTypeEthernetCTP} + EthernetTypeMetadata[EthernetTypeCiscoDiscovery] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeCiscoDiscovery), Name: "CiscoDiscovery", LayerType: LayerTypeCiscoDiscovery} + EthernetTypeMetadata[EthernetTypeNortelDiscovery] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeNortelDiscovery), Name: "NortelDiscovery", LayerType: LayerTypeNortelDiscovery} + EthernetTypeMetadata[EthernetTypeLinkLayerDiscovery] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLinkLayerDiscovery), Name: "LinkLayerDiscovery", LayerType: LayerTypeLinkLayerDiscovery} + EthernetTypeMetadata[EthernetTypeMPLSUnicast] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLSUnicast", LayerType: LayerTypeMPLS} + EthernetTypeMetadata[EthernetTypeMPLSMulticast] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLSMulticast", LayerType: LayerTypeMPLS} + EthernetTypeMetadata[EthernetTypeEAPOL] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEAPOL), Name: "EAPOL", LayerType: LayerTypeEAPOL} + + IPProtocolMetadata[IPProtocolTCP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeTCP), Name: "TCP", LayerType: LayerTypeTCP} + IPProtocolMetadata[IPProtocolUDP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUDP), Name: "UDP", LayerType: LayerTypeUDP} + IPProtocolMetadata[IPProtocolICMPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeICMPv4), Name: "ICMPv4", LayerType: LayerTypeICMPv4} + IPProtocolMetadata[IPProtocolICMPv6] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeICMPv6), Name: "ICMPv6", LayerType: LayerTypeICMPv6} + IPProtocolMetadata[IPProtocolSCTP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTP), Name: "SCTP", LayerType: LayerTypeSCTP} + IPProtocolMetadata[IPProtocolIPv6] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6} + IPProtocolMetadata[IPProtocolIPIP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4", LayerType: LayerTypeIPv4} + IPProtocolMetadata[IPProtocolEtherIP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEtherIP), Name: "EtherIP", LayerType: LayerTypeEtherIP} + IPProtocolMetadata[IPProtocolRUDP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeRUDP), Name: "RUDP", LayerType: LayerTypeRUDP} + IPProtocolMetadata[IPProtocolGRE] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeGRE), Name: "GRE", LayerType: LayerTypeGRE} + IPProtocolMetadata[IPProtocolIPv6HopByHop] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6HopByHop), Name: "IPv6HopByHop", LayerType: LayerTypeIPv6HopByHop} + IPProtocolMetadata[IPProtocolIPv6Routing] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6Routing), Name: "IPv6Routing", LayerType: LayerTypeIPv6Routing} + IPProtocolMetadata[IPProtocolIPv6Fragment] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6Fragment), Name: "IPv6Fragment", LayerType: LayerTypeIPv6Fragment} + IPProtocolMetadata[IPProtocolIPv6Destination] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6Destination), Name: "IPv6Destination", LayerType: LayerTypeIPv6Fragment} + IPProtocolMetadata[IPProtocolAH] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPSecAH), Name: "IPSecAH", LayerType: LayerTypeIPSecAH} + IPProtocolMetadata[IPProtocolESP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPSecESP), Name: "IPSecESP", LayerType: LayerTypeIPSecESP} + IPProtocolMetadata[IPProtocolUDPLite] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUDPLite), Name: "UDPLite", LayerType: LayerTypeUDPLite} + IPProtocolMetadata[IPProtocolMPLSInIP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLS", LayerType: LayerTypeMPLS} + IPProtocolMetadata[IPProtocolNoNextHeader] = EnumMetadata{DecodeWith: errorFunc("NoNextHeader with non-zero byte payload"), Name: "NoNextHeader"} + IPProtocolMetadata[IPProtocolIGMP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIGMP), Name: "IGMP", LayerType: LayerTypeIGMP} + + SCTPChunkTypeMetadata[SCTPChunkTypeData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPData), Name: "Data"} + SCTPChunkTypeMetadata[SCTPChunkTypeInit] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPInit), Name: "Init"} + SCTPChunkTypeMetadata[SCTPChunkTypeInitAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPInit), Name: "InitAck"} + SCTPChunkTypeMetadata[SCTPChunkTypeSack] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPSack), Name: "Sack"} + SCTPChunkTypeMetadata[SCTPChunkTypeHeartbeat] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPHeartbeat), Name: "Heartbeat"} + SCTPChunkTypeMetadata[SCTPChunkTypeHeartbeatAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPHeartbeat), Name: "HeartbeatAck"} + SCTPChunkTypeMetadata[SCTPChunkTypeAbort] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPError), Name: "Abort"} + SCTPChunkTypeMetadata[SCTPChunkTypeError] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPError), Name: "Error"} + SCTPChunkTypeMetadata[SCTPChunkTypeShutdown] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPShutdown), Name: "Shutdown"} + SCTPChunkTypeMetadata[SCTPChunkTypeShutdownAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPShutdownAck), Name: "ShutdownAck"} + SCTPChunkTypeMetadata[SCTPChunkTypeCookieEcho] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPCookieEcho), Name: "CookieEcho"} + SCTPChunkTypeMetadata[SCTPChunkTypeCookieAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPEmptyLayer), Name: "CookieAck"} + SCTPChunkTypeMetadata[SCTPChunkTypeShutdownComplete] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPEmptyLayer), Name: "ShutdownComplete"} + + PPPTypeMetadata[PPPTypeIPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4"} + PPPTypeMetadata[PPPTypeIPv6] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6"} + PPPTypeMetadata[PPPTypeMPLSUnicast] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLSUnicast"} + PPPTypeMetadata[PPPTypeMPLSMulticast] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLSMulticast"} + + PPPoECodeMetadata[PPPoECodeSession] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePPP), Name: "PPP"} + + LinkTypeMetadata[LinkTypeEthernet] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEthernet), Name: "Ethernet"} + LinkTypeMetadata[LinkTypePPP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePPP), Name: "PPP"} + LinkTypeMetadata[LinkTypeFDDI] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeFDDI), Name: "FDDI"} + LinkTypeMetadata[LinkTypeNull] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLoopback), Name: "Null"} + LinkTypeMetadata[LinkTypeLoop] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLoopback), Name: "Loop"} + LinkTypeMetadata[LinkTypeRaw] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4or6), Name: "Raw"} + LinkTypeMetadata[LinkTypePFLog] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePFLog), Name: "PFLog"} + LinkTypeMetadata[LinkTypeIEEE80211Radio] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeRadioTap), Name: "RadioTap"} + LinkTypeMetadata[LinkTypeLinuxUSB] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUSB), Name: "USB"} + LinkTypeMetadata[LinkTypeLinuxSLL] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLinuxSLL), Name: "Linux SLL"} + + FDDIFrameControlMetadata[FDDIFrameControlLLC] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLLC), Name: "LLC"} + + EAPOLTypeMetadata[EAPOLTypeEAP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEAP), Name: "EAP", LayerType: LayerTypeEAP} + + ProtocolFamilyMetadata[ProtocolFamilyIPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4", LayerType: LayerTypeIPv4} + ProtocolFamilyMetadata[ProtocolFamilyIPv6BSD] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6} + ProtocolFamilyMetadata[ProtocolFamilyIPv6FreeBSD] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6} + ProtocolFamilyMetadata[ProtocolFamilyIPv6Darwin] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6} + ProtocolFamilyMetadata[ProtocolFamilyIPv6Linux] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6} + + Dot11TypeMetadata[Dot11TypeMgmtAssociationReq] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtAssociationReq), Name: "MgmtAssociationReq", LayerType: LayerTypeDot11MgmtAssociationReq} + Dot11TypeMetadata[Dot11TypeMgmtAssociationResp] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtAssociationResp), Name: "MgmtAssociationResp", LayerType: LayerTypeDot11MgmtAssociationResp} + Dot11TypeMetadata[Dot11TypeMgmtReassociationReq] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtReassociationReq), Name: "MgmtReassociationReq", LayerType: LayerTypeDot11MgmtReassociationReq} + Dot11TypeMetadata[Dot11TypeMgmtReassociationResp] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtReassociationResp), Name: "MgmtReassociationResp", LayerType: LayerTypeDot11MgmtReassociationResp} + Dot11TypeMetadata[Dot11TypeMgmtProbeReq] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtProbeReq), Name: "MgmtProbeReq", LayerType: LayerTypeDot11MgmtProbeReq} + Dot11TypeMetadata[Dot11TypeMgmtProbeResp] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtProbeResp), Name: "MgmtProbeResp", LayerType: LayerTypeDot11MgmtProbeResp} + Dot11TypeMetadata[Dot11TypeMgmtMeasurementPilot] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtMeasurementPilot), Name: "MgmtMeasurementPilot", LayerType: LayerTypeDot11MgmtMeasurementPilot} + Dot11TypeMetadata[Dot11TypeMgmtBeacon] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtBeacon), Name: "MgmtBeacon", LayerType: LayerTypeDot11MgmtBeacon} + Dot11TypeMetadata[Dot11TypeMgmtATIM] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtATIM), Name: "MgmtATIM", LayerType: LayerTypeDot11MgmtATIM} + Dot11TypeMetadata[Dot11TypeMgmtDisassociation] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtDisassociation), Name: "MgmtDisassociation", LayerType: LayerTypeDot11MgmtDisassociation} + Dot11TypeMetadata[Dot11TypeMgmtAuthentication] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtAuthentication), Name: "MgmtAuthentication", LayerType: LayerTypeDot11MgmtAuthentication} + Dot11TypeMetadata[Dot11TypeMgmtDeauthentication] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtDeauthentication), Name: "MgmtDeauthentication", LayerType: LayerTypeDot11MgmtDeauthentication} + Dot11TypeMetadata[Dot11TypeMgmtAction] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtAction), Name: "MgmtAction", LayerType: LayerTypeDot11MgmtAction} + Dot11TypeMetadata[Dot11TypeMgmtActionNoAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtActionNoAck), Name: "MgmtActionNoAck", LayerType: LayerTypeDot11MgmtActionNoAck} + Dot11TypeMetadata[Dot11TypeCtrlWrapper] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11Ctrl), Name: "CtrlWrapper", LayerType: LayerTypeDot11Ctrl} + Dot11TypeMetadata[Dot11TypeCtrlBlockAckReq] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlBlockAckReq), Name: "CtrlBlockAckReq", LayerType: LayerTypeDot11CtrlBlockAckReq} + Dot11TypeMetadata[Dot11TypeCtrlBlockAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlBlockAck), Name: "CtrlBlockAck", LayerType: LayerTypeDot11CtrlBlockAck} + Dot11TypeMetadata[Dot11TypeCtrlPowersavePoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlPowersavePoll), Name: "CtrlPowersavePoll", LayerType: LayerTypeDot11CtrlPowersavePoll} + Dot11TypeMetadata[Dot11TypeCtrlRTS] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlRTS), Name: "CtrlRTS", LayerType: LayerTypeDot11CtrlRTS} + Dot11TypeMetadata[Dot11TypeCtrlCTS] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlCTS), Name: "CtrlCTS", LayerType: LayerTypeDot11CtrlCTS} + Dot11TypeMetadata[Dot11TypeCtrlAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlAck), Name: "CtrlAck", LayerType: LayerTypeDot11CtrlAck} + Dot11TypeMetadata[Dot11TypeCtrlCFEnd] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlCFEnd), Name: "CtrlCFEnd", LayerType: LayerTypeDot11CtrlCFEnd} + Dot11TypeMetadata[Dot11TypeCtrlCFEndAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlCFEndAck), Name: "CtrlCFEndAck", LayerType: LayerTypeDot11CtrlCFEndAck} + Dot11TypeMetadata[Dot11TypeData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11Data), Name: "Data", LayerType: LayerTypeDot11Data} + Dot11TypeMetadata[Dot11TypeDataCFAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFAck), Name: "DataCFAck", LayerType: LayerTypeDot11DataCFAck} + Dot11TypeMetadata[Dot11TypeDataCFPoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFPoll), Name: "DataCFPoll", LayerType: LayerTypeDot11DataCFPoll} + Dot11TypeMetadata[Dot11TypeDataCFAckPoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFAckPoll), Name: "DataCFAckPoll", LayerType: LayerTypeDot11DataCFAckPoll} + Dot11TypeMetadata[Dot11TypeDataNull] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataNull), Name: "DataNull", LayerType: LayerTypeDot11DataNull} + Dot11TypeMetadata[Dot11TypeDataCFAckNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFAckNoData), Name: "DataCFAckNoData", LayerType: LayerTypeDot11DataCFAckNoData} + Dot11TypeMetadata[Dot11TypeDataCFPollNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFPollNoData), Name: "DataCFPollNoData", LayerType: LayerTypeDot11DataCFPollNoData} + Dot11TypeMetadata[Dot11TypeDataCFAckPollNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFAckPollNoData), Name: "DataCFAckPollNoData", LayerType: LayerTypeDot11DataCFAckPollNoData} + Dot11TypeMetadata[Dot11TypeDataQOSData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSData), Name: "DataQOSData", LayerType: LayerTypeDot11DataQOSData} + Dot11TypeMetadata[Dot11TypeDataQOSDataCFAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSDataCFAck), Name: "DataQOSDataCFAck", LayerType: LayerTypeDot11DataQOSDataCFAck} + Dot11TypeMetadata[Dot11TypeDataQOSDataCFPoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSDataCFPoll), Name: "DataQOSDataCFPoll", LayerType: LayerTypeDot11DataQOSDataCFPoll} + Dot11TypeMetadata[Dot11TypeDataQOSDataCFAckPoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSDataCFAckPoll), Name: "DataQOSDataCFAckPoll", LayerType: LayerTypeDot11DataQOSDataCFAckPoll} + Dot11TypeMetadata[Dot11TypeDataQOSNull] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSNull), Name: "DataQOSNull", LayerType: LayerTypeDot11DataQOSNull} + Dot11TypeMetadata[Dot11TypeDataQOSCFPollNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSCFPollNoData), Name: "DataQOSCFPollNoData", LayerType: LayerTypeDot11DataQOSCFPollNoData} + Dot11TypeMetadata[Dot11TypeDataQOSCFAckPollNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSCFAckPollNoData), Name: "DataQOSCFAckPollNoData", LayerType: LayerTypeDot11DataQOSCFAckPollNoData} + + USBTypeMetadata[USBTransportTypeInterrupt] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUSBInterrupt), Name: "Interrupt", LayerType: LayerTypeUSBInterrupt} + USBTypeMetadata[USBTransportTypeControl] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUSBControl), Name: "Control", LayerType: LayerTypeUSBControl} + USBTypeMetadata[USBTransportTypeBulk] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUSBBulk), Name: "Bulk", LayerType: LayerTypeUSBBulk} +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/etherip.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/etherip.go new file mode 100644 index 00000000..a5700d5f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/etherip.go @@ -0,0 +1,45 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "github.com/tsg/gopacket" +) + +// EtherIP is the struct for storing RFC 3378 EtherIP packet headers. +type EtherIP struct { + BaseLayer + Version uint8 + Reserved uint16 +} + +// LayerType returns gopacket.LayerTypeEtherIP. +func (e *EtherIP) LayerType() gopacket.LayerType { return LayerTypeEtherIP } + +// DecodeFromBytes decodes the given bytes into this layer. +func (e *EtherIP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + e.Version = data[0] >> 4 + e.Reserved = binary.BigEndian.Uint16(data[:2]) & 0x0fff + e.BaseLayer = BaseLayer{data[:2], data[2:]} + return nil +} + +// CanDecode returns the set of layer types that this DecodingLayer can decode. +func (e *EtherIP) CanDecode() gopacket.LayerClass { + return LayerTypeEtherIP +} + +// NextLayerType returns the layer type contained by this DecodingLayer. +func (e *EtherIP) NextLayerType() gopacket.LayerType { + return LayerTypeEthernet +} + +func decodeEtherIP(data []byte, p gopacket.PacketBuilder) error { + e := &EtherIP{} + return decodingLayerDecoder(e, data, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ethernet.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ethernet.go new file mode 100644 index 00000000..12a44fe0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ethernet.go @@ -0,0 +1,122 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "errors" + "fmt" + "github.com/tsg/gopacket" + "net" +) + +// EthernetBroadcast is the broadcast MAC address used by Ethernet. +var EthernetBroadcast = net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff} + +// Ethernet is the layer for Ethernet frame headers. +type Ethernet struct { + BaseLayer + SrcMAC, DstMAC net.HardwareAddr + EthernetType EthernetType + // Length is only set if a length field exists within this header. Ethernet + // headers follow two different standards, one that uses an EthernetType, the + // other which defines a length the follows with a LLC header (802.3). If the + // former is the case, we set EthernetType and Length stays 0. In the latter + // case, we set Length and EthernetType = EthernetTypeLLC. + Length uint16 +} + +// LayerType returns LayerTypeEthernet +func (e *Ethernet) LayerType() gopacket.LayerType { return LayerTypeEthernet } + +func (e *Ethernet) LinkFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointMAC, e.SrcMAC, e.DstMAC) +} + +func (eth *Ethernet) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + if len(data) < 14 { + return errors.New("Ethernet packet too small") + } + eth.DstMAC = net.HardwareAddr(data[0:6]) + eth.SrcMAC = net.HardwareAddr(data[6:12]) + eth.EthernetType = EthernetType(binary.BigEndian.Uint16(data[12:14])) + eth.BaseLayer = BaseLayer{data[:14], data[14:]} + if eth.EthernetType < 0x0600 { + eth.Length = uint16(eth.EthernetType) + eth.EthernetType = EthernetTypeLLC + if cmp := len(eth.Payload) - int(eth.Length); cmp < 0 { + df.SetTruncated() + } else if cmp > 0 { + // Strip off bytes at the end, since we have too many bytes + eth.Payload = eth.Payload[:len(eth.Payload)-cmp] + } + // fmt.Println(eth) + } + return nil +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (eth *Ethernet) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + if len(eth.DstMAC) != 6 { + return fmt.Errorf("invalid dst MAC: %v", eth.DstMAC) + } + if len(eth.SrcMAC) != 6 { + return fmt.Errorf("invalid src MAC: %v", eth.SrcMAC) + } + payload := b.Bytes() + bytes, err := b.PrependBytes(14) + if err != nil { + return err + } + copy(bytes, eth.DstMAC) + copy(bytes[6:], eth.SrcMAC) + if eth.Length != 0 || eth.EthernetType == EthernetTypeLLC { + if opts.FixLengths { + eth.Length = uint16(len(payload)) + } + if eth.EthernetType != EthernetTypeLLC { + return fmt.Errorf("ethernet type %v not compatible with length value %v", eth.EthernetType, eth.Length) + } else if eth.Length > 0x0600 { + return fmt.Errorf("invalid ethernet length %v", eth.Length) + } + binary.BigEndian.PutUint16(bytes[12:], eth.Length) + } else { + binary.BigEndian.PutUint16(bytes[12:], uint16(eth.EthernetType)) + } + length := len(b.Bytes()) + if length < 60 { + // Pad out to 60 bytes. + padding, err := b.AppendBytes(60 - length) + if err != nil { + return err + } + copy(padding, lotsOfZeros[:]) + } + return nil +} + +func (eth *Ethernet) CanDecode() gopacket.LayerClass { + return LayerTypeEthernet +} + +func (eth *Ethernet) NextLayerType() gopacket.LayerType { + return eth.EthernetType.LayerType() +} + +func decodeEthernet(data []byte, p gopacket.PacketBuilder) error { + eth := &Ethernet{} + err := eth.DecodeFromBytes(data, p) + if err != nil { + return err + } + p.AddLayer(eth) + p.SetLinkLayer(eth) + return p.NextDecoder(eth.EthernetType) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/fddi.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/fddi.go new file mode 100644 index 00000000..cdbe9dc6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/fddi.go @@ -0,0 +1,41 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "github.com/tsg/gopacket" + "net" +) + +// FDDI contains the header for FDDI frames. +type FDDI struct { + BaseLayer + FrameControl FDDIFrameControl + Priority uint8 + SrcMAC, DstMAC net.HardwareAddr +} + +// LayerType returns LayerTypeFDDI. +func (f *FDDI) LayerType() gopacket.LayerType { return LayerTypeFDDI } + +// LinkFlow returns a new flow of type EndpointMAC. +func (f *FDDI) LinkFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointMAC, f.SrcMAC, f.DstMAC) +} + +func decodeFDDI(data []byte, p gopacket.PacketBuilder) error { + f := &FDDI{ + FrameControl: FDDIFrameControl(data[0] & 0xF8), + Priority: data[0] & 0x07, + SrcMAC: net.HardwareAddr(data[1:7]), + DstMAC: net.HardwareAddr(data[7:13]), + BaseLayer: BaseLayer{data[:13], data[13:]}, + } + p.SetLinkLayer(f) + p.AddLayer(f) + return p.NextDecoder(f.FrameControl) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/gen.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/gen.go new file mode 100644 index 00000000..ab7a0c00 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/gen.go @@ -0,0 +1,109 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// +build ignore + +// This binary pulls known ports from IANA, and uses them to populate +// iana_ports.go's TCPPortNames and UDPPortNames maps. +// +// go run gen.go | gofmt > iana_ports.go +package main + +import ( + "bytes" + "encoding/xml" + "flag" + "fmt" + "io/ioutil" + "net/http" + "os" + "strconv" + "time" +) + +const fmtString = `// Copyright 2012 Google, Inc. All rights reserved. + +package layers + +// Created by gen.go, don't edit manually +// Generated at %s +// Fetched from %q + +// TCPPortNames contains the port names for all TCP ports. +var TCPPortNames = tcpPortNames + +// UDPPortNames contains the port names for all UDP ports. +var UDPPortNames = udpPortNames + +// SCTPPortNames contains the port names for all SCTP ports. +var SCTPPortNames = sctpPortNames + +var tcpPortNames = map[TCPPort]string{ +%s} +var udpPortNames = map[UDPPort]string{ +%s} +var sctpPortNames = map[SCTPPort]string{ +%s} +` + +var url = flag.String("url", "http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml", "URL to grab port numbers from") + +func main() { + fmt.Fprintf(os.Stderr, "Fetching ports from %q\n", *url) + resp, err := http.Get(*url) + if err != nil { + panic(err) + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + panic(err) + } + fmt.Fprintln(os.Stderr, "Parsing XML") + var registry struct { + Records []struct { + Protocol string `xml:"protocol"` + Number string `xml:"number"` + Name string `xml:"name"` + } `xml:"record"` + } + xml.Unmarshal(body, ®istry) + var tcpPorts bytes.Buffer + var udpPorts bytes.Buffer + var sctpPorts bytes.Buffer + done := map[string]map[int]bool{ + "tcp": map[int]bool{}, + "udp": map[int]bool{}, + "sctp": map[int]bool{}, + } + for _, r := range registry.Records { + port, err := strconv.Atoi(r.Number) + if err != nil { + continue + } + if r.Name == "" { + continue + } + var b *bytes.Buffer + switch r.Protocol { + case "tcp": + b = &tcpPorts + case "udp": + b = &udpPorts + case "sctp": + b = &sctpPorts + default: + continue + } + if done[r.Protocol][port] { + continue + } + done[r.Protocol][port] = true + fmt.Fprintf(b, "\t%d: %q,\n", port, r.Name) + } + fmt.Fprintln(os.Stderr, "Writing results to stdout") + fmt.Printf(fmtString, time.Now(), *url, tcpPorts.String(), udpPorts.String(), sctpPorts.String()) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/gre.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/gre.go new file mode 100644 index 00000000..9fb5c82e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/gre.go @@ -0,0 +1,83 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "github.com/tsg/gopacket" +) + +// GRE is a Generic Routing Encapsulation header. +type GRE struct { + BaseLayer + ChecksumPresent, RoutingPresent, KeyPresent, SeqPresent, StrictSourceRoute bool + RecursionControl, Flags, Version uint8 + Protocol EthernetType + Checksum, Offset uint16 + Key, Seq uint32 + *GRERouting +} + +// GRERouting is GRE routing information, present if the RoutingPresent flag is +// set. +type GRERouting struct { + AddressFamily uint16 + SREOffset, SRELength uint8 + RoutingInformation []byte +} + +// LayerType returns gopacket.LayerTypeGRE. +func (g *GRE) LayerType() gopacket.LayerType { return LayerTypeGRE } + +// DecodeFromBytes decodes the given bytes into this layer. +func (g *GRE) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + g.ChecksumPresent = data[0]&0x80 != 0 + g.RoutingPresent = data[0]&0x40 != 0 + g.KeyPresent = data[0]&0x20 != 0 + g.SeqPresent = data[0]&0x10 != 0 + g.StrictSourceRoute = data[0]&0x08 != 0 + g.RecursionControl = data[0] & 0x7 + g.Flags = data[1] >> 3 + g.Version = data[1] & 0x7 + g.Protocol = EthernetType(binary.BigEndian.Uint16(data[2:4])) + g.Checksum = binary.BigEndian.Uint16(data[4:6]) + g.Offset = binary.BigEndian.Uint16(data[6:8]) + g.Key = binary.BigEndian.Uint32(data[8:12]) + g.Seq = binary.BigEndian.Uint32(data[12:16]) + g.BaseLayer = BaseLayer{data[:16], data[16:]} + // reset data to point to after the main gre header + rData := data[16:] + if g.RoutingPresent { + g.GRERouting = &GRERouting{ + AddressFamily: binary.BigEndian.Uint16(rData[:2]), + SREOffset: rData[2], + SRELength: rData[3], + } + end := g.SRELength + 4 + g.RoutingInformation = rData[4:end] + g.Contents = data[:16+end] + g.Payload = data[16+end:] + } else { + g.GRERouting = nil + } + return nil +} + +// CanDecode returns the set of layer types that this DecodingLayer can decode. +func (g *GRE) CanDecode() gopacket.LayerClass { + return LayerTypeGRE +} + +// NextLayerType returns the layer type contained by this DecodingLayer. +func (g *GRE) NextLayerType() gopacket.LayerType { + return g.Protocol.LayerType() +} + +func decodeGRE(data []byte, p gopacket.PacketBuilder) error { + g := &GRE{} + return decodingLayerDecoder(g, data, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/iana_ports.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/iana_ports.go new file mode 100644 index 00000000..fbf281ef --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/iana_ports.go @@ -0,0 +1,11163 @@ +// Copyright 2012 Google, Inc. All rights reserved. + +package layers + +// Created by gen.go, don't edit manually +// Generated at 2014-09-09 10:09:28.309114133 -0600 MDT +// Fetched from "http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml" + +// TCPPortNames contains the port names for all TCP ports. +var TCPPortNames = tcpPortNames + +// UDPPortNames contains the port names for all UDP ports. +var UDPPortNames = udpPortNames + +// SCTPPortNames contains the port names for all SCTP ports. +var SCTPPortNames = sctpPortNames + +var tcpPortNames = map[TCPPort]string{ + 1: "tcpmux", + 2: "compressnet", + 3: "compressnet", + 5: "rje", + 7: "echo", + 9: "discard", + 11: "systat", + 13: "daytime", + 17: "qotd", + 18: "msp", + 19: "chargen", + 20: "ftp-data", + 21: "ftp", + 22: "ssh", + 23: "telnet", + 25: "smtp", + 27: "nsw-fe", + 29: "msg-icp", + 31: "msg-auth", + 33: "dsp", + 37: "time", + 38: "rap", + 39: "rlp", + 41: "graphics", + 42: "name", + 43: "nicname", + 44: "mpm-flags", + 45: "mpm", + 46: "mpm-snd", + 47: "ni-ftp", + 48: "auditd", + 49: "tacacs", + 50: "re-mail-ck", + 52: "xns-time", + 53: "domain", + 54: "xns-ch", + 55: "isi-gl", + 56: "xns-auth", + 58: "xns-mail", + 61: "ni-mail", + 62: "acas", + 63: "whoispp", + 64: "covia", + 65: "tacacs-ds", + 66: "sql-net", + 67: "bootps", + 68: "bootpc", + 69: "tftp", + 70: "gopher", + 71: "netrjs-1", + 72: "netrjs-2", + 73: "netrjs-3", + 74: "netrjs-4", + 76: "deos", + 78: "vettcp", + 79: "finger", + 80: "http", + 82: "xfer", + 83: "mit-ml-dev", + 84: "ctf", + 85: "mit-ml-dev", + 86: "mfcobol", + 88: "kerberos", + 89: "su-mit-tg", + 90: "dnsix", + 91: "mit-dov", + 92: "npp", + 93: "dcp", + 94: "objcall", + 95: "supdup", + 96: "dixie", + 97: "swift-rvf", + 98: "tacnews", + 99: "metagram", + 101: "hostname", + 102: "iso-tsap", + 103: "gppitnp", + 104: "acr-nema", + 105: "cso", + 106: "3com-tsmux", + 107: "rtelnet", + 108: "snagas", + 109: "pop2", + 110: "pop3", + 111: "sunrpc", + 112: "mcidas", + 113: "ident", + 115: "sftp", + 116: "ansanotify", + 117: "uucp-path", + 118: "sqlserv", + 119: "nntp", + 120: "cfdptkt", + 121: "erpc", + 122: "smakynet", + 123: "ntp", + 124: "ansatrader", + 125: "locus-map", + 126: "nxedit", + 127: "locus-con", + 128: "gss-xlicen", + 129: "pwdgen", + 130: "cisco-fna", + 131: "cisco-tna", + 132: "cisco-sys", + 133: "statsrv", + 134: "ingres-net", + 135: "epmap", + 136: "profile", + 137: "netbios-ns", + 138: "netbios-dgm", + 139: "netbios-ssn", + 140: "emfis-data", + 141: "emfis-cntl", + 142: "bl-idm", + 143: "imap", + 144: "uma", + 145: "uaac", + 146: "iso-tp0", + 147: "iso-ip", + 148: "jargon", + 149: "aed-512", + 150: "sql-net", + 151: "hems", + 152: "bftp", + 153: "sgmp", + 154: "netsc-prod", + 155: "netsc-dev", + 156: "sqlsrv", + 157: "knet-cmp", + 158: "pcmail-srv", + 159: "nss-routing", + 160: "sgmp-traps", + 161: "snmp", + 162: "snmptrap", + 163: "cmip-man", + 164: "cmip-agent", + 165: "xns-courier", + 166: "s-net", + 167: "namp", + 168: "rsvd", + 169: "send", + 170: "print-srv", + 171: "multiplex", + 172: "cl-1", + 173: "xyplex-mux", + 174: "mailq", + 175: "vmnet", + 176: "genrad-mux", + 177: "xdmcp", + 178: "nextstep", + 179: "bgp", + 180: "ris", + 181: "unify", + 182: "audit", + 183: "ocbinder", + 184: "ocserver", + 185: "remote-kis", + 186: "kis", + 187: "aci", + 188: "mumps", + 189: "qft", + 190: "gacp", + 191: "prospero", + 192: "osu-nms", + 193: "srmp", + 194: "irc", + 195: "dn6-nlm-aud", + 196: "dn6-smm-red", + 197: "dls", + 198: "dls-mon", + 199: "smux", + 200: "src", + 201: "at-rtmp", + 202: "at-nbp", + 203: "at-3", + 204: "at-echo", + 205: "at-5", + 206: "at-zis", + 207: "at-7", + 208: "at-8", + 209: "qmtp", + 210: "z39-50", + 211: "914c-g", + 212: "anet", + 213: "ipx", + 214: "vmpwscs", + 215: "softpc", + 216: "CAIlic", + 217: "dbase", + 218: "mpp", + 219: "uarps", + 220: "imap3", + 221: "fln-spx", + 222: "rsh-spx", + 223: "cdc", + 224: "masqdialer", + 242: "direct", + 243: "sur-meas", + 244: "inbusiness", + 245: "link", + 246: "dsp3270", + 247: "subntbcst-tftp", + 248: "bhfhs", + 256: "rap", + 257: "set", + 259: "esro-gen", + 260: "openport", + 261: "nsiiops", + 262: "arcisdms", + 263: "hdap", + 264: "bgmp", + 265: "x-bone-ctl", + 266: "sst", + 267: "td-service", + 268: "td-replica", + 269: "manet", + 271: "pt-tls", + 280: "http-mgmt", + 281: "personal-link", + 282: "cableport-ax", + 283: "rescap", + 284: "corerjd", + 286: "fxp", + 287: "k-block", + 308: "novastorbakcup", + 309: "entrusttime", + 310: "bhmds", + 311: "asip-webadmin", + 312: "vslmp", + 313: "magenta-logic", + 314: "opalis-robot", + 315: "dpsi", + 316: "decauth", + 317: "zannet", + 318: "pkix-timestamp", + 319: "ptp-event", + 320: "ptp-general", + 321: "pip", + 322: "rtsps", + 323: "rpki-rtr", + 324: "rpki-rtr-tls", + 333: "texar", + 344: "pdap", + 345: "pawserv", + 346: "zserv", + 347: "fatserv", + 348: "csi-sgwp", + 349: "mftp", + 350: "matip-type-a", + 351: "matip-type-b", + 352: "dtag-ste-sb", + 353: "ndsauth", + 354: "bh611", + 355: "datex-asn", + 356: "cloanto-net-1", + 357: "bhevent", + 358: "shrinkwrap", + 359: "nsrmp", + 360: "scoi2odialog", + 361: "semantix", + 362: "srssend", + 363: "rsvp-tunnel", + 364: "aurora-cmgr", + 365: "dtk", + 366: "odmr", + 367: "mortgageware", + 368: "qbikgdp", + 369: "rpc2portmap", + 370: "codaauth2", + 371: "clearcase", + 372: "ulistproc", + 373: "legent-1", + 374: "legent-2", + 375: "hassle", + 376: "nip", + 377: "tnETOS", + 378: "dsETOS", + 379: "is99c", + 380: "is99s", + 381: "hp-collector", + 382: "hp-managed-node", + 383: "hp-alarm-mgr", + 384: "arns", + 385: "ibm-app", + 386: "asa", + 387: "aurp", + 388: "unidata-ldm", + 389: "ldap", + 390: "uis", + 391: "synotics-relay", + 392: "synotics-broker", + 393: "meta5", + 394: "embl-ndt", + 395: "netcp", + 396: "netware-ip", + 397: "mptn", + 398: "kryptolan", + 399: "iso-tsap-c2", + 400: "osb-sd", + 401: "ups", + 402: "genie", + 403: "decap", + 404: "nced", + 405: "ncld", + 406: "imsp", + 407: "timbuktu", + 408: "prm-sm", + 409: "prm-nm", + 410: "decladebug", + 411: "rmt", + 412: "synoptics-trap", + 413: "smsp", + 414: "infoseek", + 415: "bnet", + 416: "silverplatter", + 417: "onmux", + 418: "hyper-g", + 419: "ariel1", + 420: "smpte", + 421: "ariel2", + 422: "ariel3", + 423: "opc-job-start", + 424: "opc-job-track", + 425: "icad-el", + 426: "smartsdp", + 427: "svrloc", + 428: "ocs-cmu", + 429: "ocs-amu", + 430: "utmpsd", + 431: "utmpcd", + 432: "iasd", + 433: "nnsp", + 434: "mobileip-agent", + 435: "mobilip-mn", + 436: "dna-cml", + 437: "comscm", + 438: "dsfgw", + 439: "dasp", + 440: "sgcp", + 441: "decvms-sysmgt", + 442: "cvc-hostd", + 443: "https", + 444: "snpp", + 445: "microsoft-ds", + 446: "ddm-rdb", + 447: "ddm-dfm", + 448: "ddm-ssl", + 449: "as-servermap", + 450: "tserver", + 451: "sfs-smp-net", + 452: "sfs-config", + 453: "creativeserver", + 454: "contentserver", + 455: "creativepartnr", + 456: "macon-tcp", + 457: "scohelp", + 458: "appleqtc", + 459: "ampr-rcmd", + 460: "skronk", + 461: "datasurfsrv", + 462: "datasurfsrvsec", + 463: "alpes", + 464: "kpasswd", + 465: "urd", + 466: "digital-vrc", + 467: "mylex-mapd", + 468: "photuris", + 469: "rcp", + 470: "scx-proxy", + 471: "mondex", + 472: "ljk-login", + 473: "hybrid-pop", + 474: "tn-tl-w1", + 475: "tcpnethaspsrv", + 476: "tn-tl-fd1", + 477: "ss7ns", + 478: "spsc", + 479: "iafserver", + 480: "iafdbase", + 481: "ph", + 482: "bgs-nsi", + 483: "ulpnet", + 484: "integra-sme", + 485: "powerburst", + 486: "avian", + 487: "saft", + 488: "gss-http", + 489: "nest-protocol", + 490: "micom-pfs", + 491: "go-login", + 492: "ticf-1", + 493: "ticf-2", + 494: "pov-ray", + 495: "intecourier", + 496: "pim-rp-disc", + 497: "retrospect", + 498: "siam", + 499: "iso-ill", + 500: "isakmp", + 501: "stmf", + 502: "mbap", + 503: "intrinsa", + 504: "citadel", + 505: "mailbox-lm", + 506: "ohimsrv", + 507: "crs", + 508: "xvttp", + 509: "snare", + 510: "fcp", + 511: "passgo", + 512: "exec", + 513: "login", + 514: "shell", + 515: "printer", + 516: "videotex", + 517: "talk", + 518: "ntalk", + 519: "utime", + 520: "efs", + 521: "ripng", + 522: "ulp", + 523: "ibm-db2", + 524: "ncp", + 525: "timed", + 526: "tempo", + 527: "stx", + 528: "custix", + 529: "irc-serv", + 530: "courier", + 531: "conference", + 532: "netnews", + 533: "netwall", + 534: "windream", + 535: "iiop", + 536: "opalis-rdv", + 537: "nmsp", + 538: "gdomap", + 539: "apertus-ldp", + 540: "uucp", + 541: "uucp-rlogin", + 542: "commerce", + 543: "klogin", + 544: "kshell", + 545: "appleqtcsrvr", + 546: "dhcpv6-client", + 547: "dhcpv6-server", + 548: "afpovertcp", + 549: "idfp", + 550: "new-rwho", + 551: "cybercash", + 552: "devshr-nts", + 553: "pirp", + 554: "rtsp", + 555: "dsf", + 556: "remotefs", + 557: "openvms-sysipc", + 558: "sdnskmp", + 559: "teedtap", + 560: "rmonitor", + 561: "monitor", + 562: "chshell", + 563: "nntps", + 564: "9pfs", + 565: "whoami", + 566: "streettalk", + 567: "banyan-rpc", + 568: "ms-shuttle", + 569: "ms-rome", + 570: "meter", + 571: "meter", + 572: "sonar", + 573: "banyan-vip", + 574: "ftp-agent", + 575: "vemmi", + 576: "ipcd", + 577: "vnas", + 578: "ipdd", + 579: "decbsrv", + 580: "sntp-heartbeat", + 581: "bdp", + 582: "scc-security", + 583: "philips-vc", + 584: "keyserver", + 586: "password-chg", + 587: "submission", + 588: "cal", + 589: "eyelink", + 590: "tns-cml", + 591: "http-alt", + 592: "eudora-set", + 593: "http-rpc-epmap", + 594: "tpip", + 595: "cab-protocol", + 596: "smsd", + 597: "ptcnameservice", + 598: "sco-websrvrmg3", + 599: "acp", + 600: "ipcserver", + 601: "syslog-conn", + 602: "xmlrpc-beep", + 603: "idxp", + 604: "tunnel", + 605: "soap-beep", + 606: "urm", + 607: "nqs", + 608: "sift-uft", + 609: "npmp-trap", + 610: "npmp-local", + 611: "npmp-gui", + 612: "hmmp-ind", + 613: "hmmp-op", + 614: "sshell", + 615: "sco-inetmgr", + 616: "sco-sysmgr", + 617: "sco-dtmgr", + 618: "dei-icda", + 619: "compaq-evm", + 620: "sco-websrvrmgr", + 621: "escp-ip", + 622: "collaborator", + 623: "oob-ws-http", + 624: "cryptoadmin", + 625: "dec-dlm", + 626: "asia", + 627: "passgo-tivoli", + 628: "qmqp", + 629: "3com-amp3", + 630: "rda", + 631: "ipp", + 632: "bmpp", + 633: "servstat", + 634: "ginad", + 635: "rlzdbase", + 636: "ldaps", + 637: "lanserver", + 638: "mcns-sec", + 639: "msdp", + 640: "entrust-sps", + 641: "repcmd", + 642: "esro-emsdp", + 643: "sanity", + 644: "dwr", + 645: "pssc", + 646: "ldp", + 647: "dhcp-failover", + 648: "rrp", + 649: "cadview-3d", + 650: "obex", + 651: "ieee-mms", + 652: "hello-port", + 653: "repscmd", + 654: "aodv", + 655: "tinc", + 656: "spmp", + 657: "rmc", + 658: "tenfold", + 660: "mac-srvr-admin", + 661: "hap", + 662: "pftp", + 663: "purenoise", + 664: "oob-ws-https", + 665: "sun-dr", + 666: "mdqs", + 667: "disclose", + 668: "mecomm", + 669: "meregister", + 670: "vacdsm-sws", + 671: "vacdsm-app", + 672: "vpps-qua", + 673: "cimplex", + 674: "acap", + 675: "dctp", + 676: "vpps-via", + 677: "vpp", + 678: "ggf-ncp", + 679: "mrm", + 680: "entrust-aaas", + 681: "entrust-aams", + 682: "xfr", + 683: "corba-iiop", + 684: "corba-iiop-ssl", + 685: "mdc-portmapper", + 686: "hcp-wismar", + 687: "asipregistry", + 688: "realm-rusd", + 689: "nmap", + 690: "vatp", + 691: "msexch-routing", + 692: "hyperwave-isp", + 693: "connendp", + 694: "ha-cluster", + 695: "ieee-mms-ssl", + 696: "rushd", + 697: "uuidgen", + 698: "olsr", + 699: "accessnetwork", + 700: "epp", + 701: "lmp", + 702: "iris-beep", + 704: "elcsd", + 705: "agentx", + 706: "silc", + 707: "borland-dsj", + 709: "entrust-kmsh", + 710: "entrust-ash", + 711: "cisco-tdp", + 712: "tbrpf", + 713: "iris-xpc", + 714: "iris-xpcs", + 715: "iris-lwz", + 729: "netviewdm1", + 730: "netviewdm2", + 731: "netviewdm3", + 741: "netgw", + 742: "netrcs", + 744: "flexlm", + 747: "fujitsu-dev", + 748: "ris-cm", + 749: "kerberos-adm", + 750: "rfile", + 751: "pump", + 752: "qrh", + 753: "rrh", + 754: "tell", + 758: "nlogin", + 759: "con", + 760: "ns", + 761: "rxe", + 762: "quotad", + 763: "cycleserv", + 764: "omserv", + 765: "webster", + 767: "phonebook", + 769: "vid", + 770: "cadlock", + 771: "rtip", + 772: "cycleserv2", + 773: "submit", + 774: "rpasswd", + 775: "entomb", + 776: "wpages", + 777: "multiling-http", + 780: "wpgs", + 800: "mdbs-daemon", + 801: "device", + 802: "mbap-s", + 810: "fcp-udp", + 828: "itm-mcell-s", + 829: "pkix-3-ca-ra", + 830: "netconf-ssh", + 831: "netconf-beep", + 832: "netconfsoaphttp", + 833: "netconfsoapbeep", + 847: "dhcp-failover2", + 848: "gdoi", + 860: "iscsi", + 861: "owamp-control", + 862: "twamp-control", + 873: "rsync", + 886: "iclcnet-locate", + 887: "iclcnet-svinfo", + 888: "accessbuilder", + 900: "omginitialrefs", + 901: "smpnameres", + 902: "ideafarm-door", + 903: "ideafarm-panic", + 910: "kink", + 911: "xact-backup", + 912: "apex-mesh", + 913: "apex-edge", + 989: "ftps-data", + 990: "ftps", + 991: "nas", + 992: "telnets", + 993: "imaps", + 995: "pop3s", + 996: "vsinet", + 997: "maitrd", + 998: "busboy", + 999: "garcon", + 1000: "cadlock2", + 1010: "surf", + 1021: "exp1", + 1022: "exp2", + 1025: "blackjack", + 1026: "cap", + 1029: "solid-mux", + 1033: "netinfo-local", + 1034: "activesync", + 1035: "mxxrlogin", + 1036: "nsstp", + 1037: "ams", + 1038: "mtqp", + 1039: "sbl", + 1040: "netarx", + 1041: "danf-ak2", + 1042: "afrog", + 1043: "boinc-client", + 1044: "dcutility", + 1045: "fpitp", + 1046: "wfremotertm", + 1047: "neod1", + 1048: "neod2", + 1049: "td-postman", + 1050: "cma", + 1051: "optima-vnet", + 1052: "ddt", + 1053: "remote-as", + 1054: "brvread", + 1055: "ansyslmd", + 1056: "vfo", + 1057: "startron", + 1058: "nim", + 1059: "nimreg", + 1060: "polestar", + 1061: "kiosk", + 1062: "veracity", + 1063: "kyoceranetdev", + 1064: "jstel", + 1065: "syscomlan", + 1066: "fpo-fns", + 1067: "instl-boots", + 1068: "instl-bootc", + 1069: "cognex-insight", + 1070: "gmrupdateserv", + 1071: "bsquare-voip", + 1072: "cardax", + 1073: "bridgecontrol", + 1074: "warmspotMgmt", + 1075: "rdrmshc", + 1076: "dab-sti-c", + 1077: "imgames", + 1078: "avocent-proxy", + 1079: "asprovatalk", + 1080: "socks", + 1081: "pvuniwien", + 1082: "amt-esd-prot", + 1083: "ansoft-lm-1", + 1084: "ansoft-lm-2", + 1085: "webobjects", + 1086: "cplscrambler-lg", + 1087: "cplscrambler-in", + 1088: "cplscrambler-al", + 1089: "ff-annunc", + 1090: "ff-fms", + 1091: "ff-sm", + 1092: "obrpd", + 1093: "proofd", + 1094: "rootd", + 1095: "nicelink", + 1096: "cnrprotocol", + 1097: "sunclustermgr", + 1098: "rmiactivation", + 1099: "rmiregistry", + 1100: "mctp", + 1101: "pt2-discover", + 1102: "adobeserver-1", + 1103: "adobeserver-2", + 1104: "xrl", + 1105: "ftranhc", + 1106: "isoipsigport-1", + 1107: "isoipsigport-2", + 1108: "ratio-adp", + 1110: "webadmstart", + 1111: "lmsocialserver", + 1112: "icp", + 1113: "ltp-deepspace", + 1114: "mini-sql", + 1115: "ardus-trns", + 1116: "ardus-cntl", + 1117: "ardus-mtrns", + 1118: "sacred", + 1119: "bnetgame", + 1120: "bnetfile", + 1121: "rmpp", + 1122: "availant-mgr", + 1123: "murray", + 1124: "hpvmmcontrol", + 1125: "hpvmmagent", + 1126: "hpvmmdata", + 1127: "kwdb-commn", + 1128: "saphostctrl", + 1129: "saphostctrls", + 1130: "casp", + 1131: "caspssl", + 1132: "kvm-via-ip", + 1133: "dfn", + 1134: "aplx", + 1135: "omnivision", + 1136: "hhb-gateway", + 1137: "trim", + 1138: "encrypted-admin", + 1139: "evm", + 1140: "autonoc", + 1141: "mxomss", + 1142: "edtools", + 1143: "imyx", + 1144: "fuscript", + 1145: "x9-icue", + 1146: "audit-transfer", + 1147: "capioverlan", + 1148: "elfiq-repl", + 1149: "bvtsonar", + 1150: "blaze", + 1151: "unizensus", + 1152: "winpoplanmess", + 1153: "c1222-acse", + 1154: "resacommunity", + 1155: "nfa", + 1156: "iascontrol-oms", + 1157: "iascontrol", + 1158: "dbcontrol-oms", + 1159: "oracle-oms", + 1160: "olsv", + 1161: "health-polling", + 1162: "health-trap", + 1163: "sddp", + 1164: "qsm-proxy", + 1165: "qsm-gui", + 1166: "qsm-remote", + 1167: "cisco-ipsla", + 1168: "vchat", + 1169: "tripwire", + 1170: "atc-lm", + 1171: "atc-appserver", + 1172: "dnap", + 1173: "d-cinema-rrp", + 1174: "fnet-remote-ui", + 1175: "dossier", + 1176: "indigo-server", + 1177: "dkmessenger", + 1178: "sgi-storman", + 1179: "b2n", + 1180: "mc-client", + 1181: "3comnetman", + 1182: "accelenet", + 1183: "llsurfup-http", + 1184: "llsurfup-https", + 1185: "catchpole", + 1186: "mysql-cluster", + 1187: "alias", + 1188: "hp-webadmin", + 1189: "unet", + 1190: "commlinx-avl", + 1191: "gpfs", + 1192: "caids-sensor", + 1193: "fiveacross", + 1194: "openvpn", + 1195: "rsf-1", + 1196: "netmagic", + 1197: "carrius-rshell", + 1198: "cajo-discovery", + 1199: "dmidi", + 1200: "scol", + 1201: "nucleus-sand", + 1202: "caiccipc", + 1203: "ssslic-mgr", + 1204: "ssslog-mgr", + 1205: "accord-mgc", + 1206: "anthony-data", + 1207: "metasage", + 1208: "seagull-ais", + 1209: "ipcd3", + 1210: "eoss", + 1211: "groove-dpp", + 1212: "lupa", + 1213: "mpc-lifenet", + 1214: "kazaa", + 1215: "scanstat-1", + 1216: "etebac5", + 1217: "hpss-ndapi", + 1218: "aeroflight-ads", + 1219: "aeroflight-ret", + 1220: "qt-serveradmin", + 1221: "sweetware-apps", + 1222: "nerv", + 1223: "tgp", + 1224: "vpnz", + 1225: "slinkysearch", + 1226: "stgxfws", + 1227: "dns2go", + 1228: "florence", + 1229: "zented", + 1230: "periscope", + 1231: "menandmice-lpm", + 1232: "first-defense", + 1233: "univ-appserver", + 1234: "search-agent", + 1235: "mosaicsyssvc1", + 1236: "bvcontrol", + 1237: "tsdos390", + 1238: "hacl-qs", + 1239: "nmsd", + 1240: "instantia", + 1241: "nessus", + 1242: "nmasoverip", + 1243: "serialgateway", + 1244: "isbconference1", + 1245: "isbconference2", + 1246: "payrouter", + 1247: "visionpyramid", + 1248: "hermes", + 1249: "mesavistaco", + 1250: "swldy-sias", + 1251: "servergraph", + 1252: "bspne-pcc", + 1253: "q55-pcc", + 1254: "de-noc", + 1255: "de-cache-query", + 1256: "de-server", + 1257: "shockwave2", + 1258: "opennl", + 1259: "opennl-voice", + 1260: "ibm-ssd", + 1261: "mpshrsv", + 1262: "qnts-orb", + 1263: "dka", + 1264: "prat", + 1265: "dssiapi", + 1266: "dellpwrappks", + 1267: "epc", + 1268: "propel-msgsys", + 1269: "watilapp", + 1270: "opsmgr", + 1271: "excw", + 1272: "cspmlockmgr", + 1273: "emc-gateway", + 1274: "t1distproc", + 1275: "ivcollector", + 1277: "miva-mqs", + 1278: "dellwebadmin-1", + 1279: "dellwebadmin-2", + 1280: "pictrography", + 1281: "healthd", + 1282: "emperion", + 1283: "productinfo", + 1284: "iee-qfx", + 1285: "neoiface", + 1286: "netuitive", + 1287: "routematch", + 1288: "navbuddy", + 1289: "jwalkserver", + 1290: "winjaserver", + 1291: "seagulllms", + 1292: "dsdn", + 1293: "pkt-krb-ipsec", + 1294: "cmmdriver", + 1295: "ehtp", + 1296: "dproxy", + 1297: "sdproxy", + 1298: "lpcp", + 1299: "hp-sci", + 1300: "h323hostcallsc", + 1301: "ci3-software-1", + 1302: "ci3-software-2", + 1303: "sftsrv", + 1304: "boomerang", + 1305: "pe-mike", + 1306: "re-conn-proto", + 1307: "pacmand", + 1308: "odsi", + 1309: "jtag-server", + 1310: "husky", + 1311: "rxmon", + 1312: "sti-envision", + 1313: "bmc-patroldb", + 1314: "pdps", + 1315: "els", + 1316: "exbit-escp", + 1317: "vrts-ipcserver", + 1318: "krb5gatekeeper", + 1319: "amx-icsp", + 1320: "amx-axbnet", + 1321: "pip", + 1322: "novation", + 1323: "brcd", + 1324: "delta-mcp", + 1325: "dx-instrument", + 1326: "wimsic", + 1327: "ultrex", + 1328: "ewall", + 1329: "netdb-export", + 1330: "streetperfect", + 1331: "intersan", + 1332: "pcia-rxp-b", + 1333: "passwrd-policy", + 1334: "writesrv", + 1335: "digital-notary", + 1336: "ischat", + 1337: "menandmice-dns", + 1338: "wmc-log-svc", + 1339: "kjtsiteserver", + 1340: "naap", + 1341: "qubes", + 1342: "esbroker", + 1343: "re101", + 1344: "icap", + 1345: "vpjp", + 1346: "alta-ana-lm", + 1347: "bbn-mmc", + 1348: "bbn-mmx", + 1349: "sbook", + 1350: "editbench", + 1351: "equationbuilder", + 1352: "lotusnote", + 1353: "relief", + 1354: "XSIP-network", + 1355: "intuitive-edge", + 1356: "cuillamartin", + 1357: "pegboard", + 1358: "connlcli", + 1359: "ftsrv", + 1360: "mimer", + 1361: "linx", + 1362: "timeflies", + 1363: "ndm-requester", + 1364: "ndm-server", + 1365: "adapt-sna", + 1366: "netware-csp", + 1367: "dcs", + 1368: "screencast", + 1369: "gv-us", + 1370: "us-gv", + 1371: "fc-cli", + 1372: "fc-ser", + 1373: "chromagrafx", + 1374: "molly", + 1375: "bytex", + 1376: "ibm-pps", + 1377: "cichlid", + 1378: "elan", + 1379: "dbreporter", + 1380: "telesis-licman", + 1381: "apple-licman", + 1382: "udt-os", + 1383: "gwha", + 1384: "os-licman", + 1385: "atex-elmd", + 1386: "checksum", + 1387: "cadsi-lm", + 1388: "objective-dbc", + 1389: "iclpv-dm", + 1390: "iclpv-sc", + 1391: "iclpv-sas", + 1392: "iclpv-pm", + 1393: "iclpv-nls", + 1394: "iclpv-nlc", + 1395: "iclpv-wsm", + 1396: "dvl-activemail", + 1397: "audio-activmail", + 1398: "video-activmail", + 1399: "cadkey-licman", + 1400: "cadkey-tablet", + 1401: "goldleaf-licman", + 1402: "prm-sm-np", + 1403: "prm-nm-np", + 1404: "igi-lm", + 1405: "ibm-res", + 1406: "netlabs-lm", + 1407: "dbsa-lm", + 1408: "sophia-lm", + 1409: "here-lm", + 1410: "hiq", + 1411: "af", + 1412: "innosys", + 1413: "innosys-acl", + 1414: "ibm-mqseries", + 1415: "dbstar", + 1416: "novell-lu6-2", + 1417: "timbuktu-srv1", + 1418: "timbuktu-srv2", + 1419: "timbuktu-srv3", + 1420: "timbuktu-srv4", + 1421: "gandalf-lm", + 1422: "autodesk-lm", + 1423: "essbase", + 1424: "hybrid", + 1425: "zion-lm", + 1426: "sais", + 1427: "mloadd", + 1428: "informatik-lm", + 1429: "nms", + 1430: "tpdu", + 1431: "rgtp", + 1432: "blueberry-lm", + 1433: "ms-sql-s", + 1434: "ms-sql-m", + 1435: "ibm-cics", + 1436: "saism", + 1437: "tabula", + 1438: "eicon-server", + 1439: "eicon-x25", + 1440: "eicon-slp", + 1441: "cadis-1", + 1442: "cadis-2", + 1443: "ies-lm", + 1444: "marcam-lm", + 1445: "proxima-lm", + 1446: "ora-lm", + 1447: "apri-lm", + 1448: "oc-lm", + 1449: "peport", + 1450: "dwf", + 1451: "infoman", + 1452: "gtegsc-lm", + 1453: "genie-lm", + 1454: "interhdl-elmd", + 1455: "esl-lm", + 1456: "dca", + 1457: "valisys-lm", + 1458: "nrcabq-lm", + 1459: "proshare1", + 1460: "proshare2", + 1461: "ibm-wrless-lan", + 1462: "world-lm", + 1463: "nucleus", + 1464: "msl-lmd", + 1465: "pipes", + 1466: "oceansoft-lm", + 1467: "csdmbase", + 1468: "csdm", + 1469: "aal-lm", + 1470: "uaiact", + 1471: "csdmbase", + 1472: "csdm", + 1473: "openmath", + 1474: "telefinder", + 1475: "taligent-lm", + 1476: "clvm-cfg", + 1477: "ms-sna-server", + 1478: "ms-sna-base", + 1479: "dberegister", + 1480: "pacerforum", + 1481: "airs", + 1482: "miteksys-lm", + 1483: "afs", + 1484: "confluent", + 1485: "lansource", + 1486: "nms-topo-serv", + 1487: "localinfosrvr", + 1488: "docstor", + 1489: "dmdocbroker", + 1490: "insitu-conf", + 1492: "stone-design-1", + 1493: "netmap-lm", + 1494: "ica", + 1495: "cvc", + 1496: "liberty-lm", + 1497: "rfx-lm", + 1498: "sybase-sqlany", + 1499: "fhc", + 1500: "vlsi-lm", + 1501: "saiscm", + 1502: "shivadiscovery", + 1503: "imtc-mcs", + 1504: "evb-elm", + 1505: "funkproxy", + 1506: "utcd", + 1507: "symplex", + 1508: "diagmond", + 1509: "robcad-lm", + 1510: "mvx-lm", + 1511: "3l-l1", + 1512: "wins", + 1513: "fujitsu-dtc", + 1514: "fujitsu-dtcns", + 1515: "ifor-protocol", + 1516: "vpad", + 1517: "vpac", + 1518: "vpvd", + 1519: "vpvc", + 1520: "atm-zip-office", + 1521: "ncube-lm", + 1522: "ricardo-lm", + 1523: "cichild-lm", + 1524: "ingreslock", + 1525: "orasrv", + 1526: "pdap-np", + 1527: "tlisrv", + 1529: "coauthor", + 1530: "rap-service", + 1531: "rap-listen", + 1532: "miroconnect", + 1533: "virtual-places", + 1534: "micromuse-lm", + 1535: "ampr-info", + 1536: "ampr-inter", + 1537: "sdsc-lm", + 1538: "3ds-lm", + 1539: "intellistor-lm", + 1540: "rds", + 1541: "rds2", + 1542: "gridgen-elmd", + 1543: "simba-cs", + 1544: "aspeclmd", + 1545: "vistium-share", + 1546: "abbaccuray", + 1547: "laplink", + 1548: "axon-lm", + 1549: "shivahose", + 1550: "3m-image-lm", + 1551: "hecmtl-db", + 1552: "pciarray", + 1553: "sna-cs", + 1554: "caci-lm", + 1555: "livelan", + 1556: "veritas-pbx", + 1557: "arbortext-lm", + 1558: "xingmpeg", + 1559: "web2host", + 1560: "asci-val", + 1561: "facilityview", + 1562: "pconnectmgr", + 1563: "cadabra-lm", + 1564: "pay-per-view", + 1565: "winddlb", + 1566: "corelvideo", + 1567: "jlicelmd", + 1568: "tsspmap", + 1569: "ets", + 1570: "orbixd", + 1571: "rdb-dbs-disp", + 1572: "chip-lm", + 1573: "itscomm-ns", + 1574: "mvel-lm", + 1575: "oraclenames", + 1576: "moldflow-lm", + 1577: "hypercube-lm", + 1578: "jacobus-lm", + 1579: "ioc-sea-lm", + 1580: "tn-tl-r1", + 1581: "mil-2045-47001", + 1582: "msims", + 1583: "simbaexpress", + 1584: "tn-tl-fd2", + 1585: "intv", + 1586: "ibm-abtact", + 1587: "pra-elmd", + 1588: "triquest-lm", + 1589: "vqp", + 1590: "gemini-lm", + 1591: "ncpm-pm", + 1592: "commonspace", + 1593: "mainsoft-lm", + 1594: "sixtrak", + 1595: "radio", + 1596: "radio-sm", + 1597: "orbplus-iiop", + 1598: "picknfs", + 1599: "simbaservices", + 1600: "issd", + 1601: "aas", + 1602: "inspect", + 1603: "picodbc", + 1604: "icabrowser", + 1605: "slp", + 1606: "slm-api", + 1607: "stt", + 1608: "smart-lm", + 1609: "isysg-lm", + 1610: "taurus-wh", + 1611: "ill", + 1612: "netbill-trans", + 1613: "netbill-keyrep", + 1614: "netbill-cred", + 1615: "netbill-auth", + 1616: "netbill-prod", + 1617: "nimrod-agent", + 1618: "skytelnet", + 1619: "xs-openstorage", + 1620: "faxportwinport", + 1621: "softdataphone", + 1622: "ontime", + 1623: "jaleosnd", + 1624: "udp-sr-port", + 1625: "svs-omagent", + 1626: "shockwave", + 1627: "t128-gateway", + 1628: "lontalk-norm", + 1629: "lontalk-urgnt", + 1630: "oraclenet8cman", + 1631: "visitview", + 1632: "pammratc", + 1633: "pammrpc", + 1634: "loaprobe", + 1635: "edb-server1", + 1636: "isdc", + 1637: "islc", + 1638: "ismc", + 1639: "cert-initiator", + 1640: "cert-responder", + 1641: "invision", + 1642: "isis-am", + 1643: "isis-ambc", + 1644: "saiseh", + 1645: "sightline", + 1646: "sa-msg-port", + 1647: "rsap", + 1648: "concurrent-lm", + 1649: "kermit", + 1650: "nkd", + 1651: "shiva-confsrvr", + 1652: "xnmp", + 1653: "alphatech-lm", + 1654: "stargatealerts", + 1655: "dec-mbadmin", + 1656: "dec-mbadmin-h", + 1657: "fujitsu-mmpdc", + 1658: "sixnetudr", + 1659: "sg-lm", + 1660: "skip-mc-gikreq", + 1661: "netview-aix-1", + 1662: "netview-aix-2", + 1663: "netview-aix-3", + 1664: "netview-aix-4", + 1665: "netview-aix-5", + 1666: "netview-aix-6", + 1667: "netview-aix-7", + 1668: "netview-aix-8", + 1669: "netview-aix-9", + 1670: "netview-aix-10", + 1671: "netview-aix-11", + 1672: "netview-aix-12", + 1673: "proshare-mc-1", + 1674: "proshare-mc-2", + 1675: "pdp", + 1676: "netcomm1", + 1677: "groupwise", + 1678: "prolink", + 1679: "darcorp-lm", + 1680: "microcom-sbp", + 1681: "sd-elmd", + 1682: "lanyon-lantern", + 1683: "ncpm-hip", + 1684: "snaresecure", + 1685: "n2nremote", + 1686: "cvmon", + 1687: "nsjtp-ctrl", + 1688: "nsjtp-data", + 1689: "firefox", + 1690: "ng-umds", + 1691: "empire-empuma", + 1692: "sstsys-lm", + 1693: "rrirtr", + 1694: "rrimwm", + 1695: "rrilwm", + 1696: "rrifmm", + 1697: "rrisat", + 1698: "rsvp-encap-1", + 1699: "rsvp-encap-2", + 1700: "mps-raft", + 1701: "l2f", + 1702: "deskshare", + 1703: "hb-engine", + 1704: "bcs-broker", + 1705: "slingshot", + 1706: "jetform", + 1707: "vdmplay", + 1708: "gat-lmd", + 1709: "centra", + 1710: "impera", + 1711: "pptconference", + 1712: "registrar", + 1713: "conferencetalk", + 1714: "sesi-lm", + 1715: "houdini-lm", + 1716: "xmsg", + 1717: "fj-hdnet", + 1718: "h323gatedisc", + 1719: "h323gatestat", + 1720: "h323hostcall", + 1721: "caicci", + 1722: "hks-lm", + 1723: "pptp", + 1724: "csbphonemaster", + 1725: "iden-ralp", + 1726: "iberiagames", + 1727: "winddx", + 1728: "telindus", + 1729: "citynl", + 1730: "roketz", + 1731: "msiccp", + 1732: "proxim", + 1733: "siipat", + 1734: "cambertx-lm", + 1735: "privatechat", + 1736: "street-stream", + 1737: "ultimad", + 1738: "gamegen1", + 1739: "webaccess", + 1740: "encore", + 1741: "cisco-net-mgmt", + 1742: "3Com-nsd", + 1743: "cinegrfx-lm", + 1744: "ncpm-ft", + 1745: "remote-winsock", + 1746: "ftrapid-1", + 1747: "ftrapid-2", + 1748: "oracle-em1", + 1749: "aspen-services", + 1750: "sslp", + 1751: "swiftnet", + 1752: "lofr-lm", + 1753: "predatar-comms", + 1754: "oracle-em2", + 1755: "ms-streaming", + 1756: "capfast-lmd", + 1757: "cnhrp", + 1758: "tftp-mcast", + 1759: "spss-lm", + 1760: "www-ldap-gw", + 1761: "cft-0", + 1762: "cft-1", + 1763: "cft-2", + 1764: "cft-3", + 1765: "cft-4", + 1766: "cft-5", + 1767: "cft-6", + 1768: "cft-7", + 1769: "bmc-net-adm", + 1770: "bmc-net-svc", + 1771: "vaultbase", + 1772: "essweb-gw", + 1773: "kmscontrol", + 1774: "global-dtserv", + 1775: "vdab", + 1776: "femis", + 1777: "powerguardian", + 1778: "prodigy-intrnet", + 1779: "pharmasoft", + 1780: "dpkeyserv", + 1781: "answersoft-lm", + 1782: "hp-hcip", + 1784: "finle-lm", + 1785: "windlm", + 1786: "funk-logger", + 1787: "funk-license", + 1788: "psmond", + 1789: "hello", + 1790: "nmsp", + 1791: "ea1", + 1792: "ibm-dt-2", + 1793: "rsc-robot", + 1794: "cera-bcm", + 1795: "dpi-proxy", + 1796: "vocaltec-admin", + 1797: "uma", + 1798: "etp", + 1799: "netrisk", + 1800: "ansys-lm", + 1801: "msmq", + 1802: "concomp1", + 1803: "hp-hcip-gwy", + 1804: "enl", + 1805: "enl-name", + 1806: "musiconline", + 1807: "fhsp", + 1808: "oracle-vp2", + 1809: "oracle-vp1", + 1810: "jerand-lm", + 1811: "scientia-sdb", + 1812: "radius", + 1813: "radius-acct", + 1814: "tdp-suite", + 1815: "mmpft", + 1816: "harp", + 1817: "rkb-oscs", + 1818: "etftp", + 1819: "plato-lm", + 1820: "mcagent", + 1821: "donnyworld", + 1822: "es-elmd", + 1823: "unisys-lm", + 1824: "metrics-pas", + 1825: "direcpc-video", + 1826: "ardt", + 1827: "asi", + 1828: "itm-mcell-u", + 1829: "optika-emedia", + 1830: "net8-cman", + 1831: "myrtle", + 1832: "tht-treasure", + 1833: "udpradio", + 1834: "ardusuni", + 1835: "ardusmul", + 1836: "ste-smsc", + 1837: "csoft1", + 1838: "talnet", + 1839: "netopia-vo1", + 1840: "netopia-vo2", + 1841: "netopia-vo3", + 1842: "netopia-vo4", + 1843: "netopia-vo5", + 1844: "direcpc-dll", + 1845: "altalink", + 1846: "tunstall-pnc", + 1847: "slp-notify", + 1848: "fjdocdist", + 1849: "alpha-sms", + 1850: "gsi", + 1851: "ctcd", + 1852: "virtual-time", + 1853: "vids-avtp", + 1854: "buddy-draw", + 1855: "fiorano-rtrsvc", + 1856: "fiorano-msgsvc", + 1857: "datacaptor", + 1858: "privateark", + 1859: "gammafetchsvr", + 1860: "sunscalar-svc", + 1861: "lecroy-vicp", + 1862: "mysql-cm-agent", + 1863: "msnp", + 1864: "paradym-31port", + 1865: "entp", + 1866: "swrmi", + 1867: "udrive", + 1868: "viziblebrowser", + 1869: "transact", + 1870: "sunscalar-dns", + 1871: "canocentral0", + 1872: "canocentral1", + 1873: "fjmpjps", + 1874: "fjswapsnp", + 1875: "westell-stats", + 1876: "ewcappsrv", + 1877: "hp-webqosdb", + 1878: "drmsmc", + 1879: "nettgain-nms", + 1880: "vsat-control", + 1881: "ibm-mqseries2", + 1882: "ecsqdmn", + 1883: "ibm-mqisdp", + 1884: "idmaps", + 1885: "vrtstrapserver", + 1886: "leoip", + 1887: "filex-lport", + 1888: "ncconfig", + 1889: "unify-adapter", + 1890: "wilkenlistener", + 1891: "childkey-notif", + 1892: "childkey-ctrl", + 1893: "elad", + 1894: "o2server-port", + 1896: "b-novative-ls", + 1897: "metaagent", + 1898: "cymtec-port", + 1899: "mc2studios", + 1900: "ssdp", + 1901: "fjicl-tep-a", + 1902: "fjicl-tep-b", + 1903: "linkname", + 1904: "fjicl-tep-c", + 1905: "sugp", + 1906: "tpmd", + 1907: "intrastar", + 1908: "dawn", + 1909: "global-wlink", + 1910: "ultrabac", + 1911: "mtp", + 1912: "rhp-iibp", + 1913: "armadp", + 1914: "elm-momentum", + 1915: "facelink", + 1916: "persona", + 1917: "noagent", + 1918: "can-nds", + 1919: "can-dch", + 1920: "can-ferret", + 1921: "noadmin", + 1922: "tapestry", + 1923: "spice", + 1924: "xiip", + 1925: "discovery-port", + 1926: "egs", + 1927: "videte-cipc", + 1928: "emsd-port", + 1929: "bandwiz-system", + 1930: "driveappserver", + 1931: "amdsched", + 1932: "ctt-broker", + 1933: "xmapi", + 1934: "xaapi", + 1935: "macromedia-fcs", + 1936: "jetcmeserver", + 1937: "jwserver", + 1938: "jwclient", + 1939: "jvserver", + 1940: "jvclient", + 1941: "dic-aida", + 1942: "res", + 1943: "beeyond-media", + 1944: "close-combat", + 1945: "dialogic-elmd", + 1946: "tekpls", + 1947: "sentinelsrm", + 1948: "eye2eye", + 1949: "ismaeasdaqlive", + 1950: "ismaeasdaqtest", + 1951: "bcs-lmserver", + 1952: "mpnjsc", + 1953: "rapidbase", + 1954: "abr-api", + 1955: "abr-secure", + 1956: "vrtl-vmf-ds", + 1957: "unix-status", + 1958: "dxadmind", + 1959: "simp-all", + 1960: "nasmanager", + 1961: "bts-appserver", + 1962: "biap-mp", + 1963: "webmachine", + 1964: "solid-e-engine", + 1965: "tivoli-npm", + 1966: "slush", + 1967: "sns-quote", + 1968: "lipsinc", + 1969: "lipsinc1", + 1970: "netop-rc", + 1971: "netop-school", + 1972: "intersys-cache", + 1973: "dlsrap", + 1974: "drp", + 1975: "tcoflashagent", + 1976: "tcoregagent", + 1977: "tcoaddressbook", + 1978: "unisql", + 1979: "unisql-java", + 1980: "pearldoc-xact", + 1981: "p2pq", + 1982: "estamp", + 1983: "lhtp", + 1984: "bb", + 1985: "hsrp", + 1986: "licensedaemon", + 1987: "tr-rsrb-p1", + 1988: "tr-rsrb-p2", + 1989: "tr-rsrb-p3", + 1990: "stun-p1", + 1991: "stun-p2", + 1992: "stun-p3", + 1993: "snmp-tcp-port", + 1994: "stun-port", + 1995: "perf-port", + 1996: "tr-rsrb-port", + 1997: "gdp-port", + 1998: "x25-svc-port", + 1999: "tcp-id-port", + 2000: "cisco-sccp", + 2001: "dc", + 2002: "globe", + 2003: "brutus", + 2004: "mailbox", + 2005: "berknet", + 2006: "invokator", + 2007: "dectalk", + 2008: "conf", + 2009: "news", + 2010: "search", + 2011: "raid-cc", + 2012: "ttyinfo", + 2013: "raid-am", + 2014: "troff", + 2015: "cypress", + 2016: "bootserver", + 2017: "cypress-stat", + 2018: "terminaldb", + 2019: "whosockami", + 2020: "xinupageserver", + 2021: "servexec", + 2022: "down", + 2023: "xinuexpansion3", + 2024: "xinuexpansion4", + 2025: "ellpack", + 2026: "scrabble", + 2027: "shadowserver", + 2028: "submitserver", + 2029: "hsrpv6", + 2030: "device2", + 2031: "mobrien-chat", + 2032: "blackboard", + 2033: "glogger", + 2034: "scoremgr", + 2035: "imsldoc", + 2036: "e-dpnet", + 2037: "applus", + 2038: "objectmanager", + 2039: "prizma", + 2040: "lam", + 2041: "interbase", + 2042: "isis", + 2043: "isis-bcast", + 2044: "rimsl", + 2045: "cdfunc", + 2046: "sdfunc", + 2047: "dls", + 2048: "dls-monitor", + 2049: "shilp", + 2050: "av-emb-config", + 2051: "epnsdp", + 2052: "clearvisn", + 2053: "lot105-ds-upd", + 2054: "weblogin", + 2055: "iop", + 2056: "omnisky", + 2057: "rich-cp", + 2058: "newwavesearch", + 2059: "bmc-messaging", + 2060: "teleniumdaemon", + 2061: "netmount", + 2062: "icg-swp", + 2063: "icg-bridge", + 2064: "icg-iprelay", + 2065: "dlsrpn", + 2066: "aura", + 2067: "dlswpn", + 2068: "avauthsrvprtcl", + 2069: "event-port", + 2070: "ah-esp-encap", + 2071: "acp-port", + 2072: "msync", + 2073: "gxs-data-port", + 2074: "vrtl-vmf-sa", + 2075: "newlixengine", + 2076: "newlixconfig", + 2077: "tsrmagt", + 2078: "tpcsrvr", + 2079: "idware-router", + 2080: "autodesk-nlm", + 2081: "kme-trap-port", + 2082: "infowave", + 2083: "radsec", + 2084: "sunclustergeo", + 2085: "ada-cip", + 2086: "gnunet", + 2087: "eli", + 2088: "ip-blf", + 2089: "sep", + 2090: "lrp", + 2091: "prp", + 2092: "descent3", + 2093: "nbx-cc", + 2094: "nbx-au", + 2095: "nbx-ser", + 2096: "nbx-dir", + 2097: "jetformpreview", + 2098: "dialog-port", + 2099: "h2250-annex-g", + 2100: "amiganetfs", + 2101: "rtcm-sc104", + 2102: "zephyr-srv", + 2103: "zephyr-clt", + 2104: "zephyr-hm", + 2105: "minipay", + 2106: "mzap", + 2107: "bintec-admin", + 2108: "comcam", + 2109: "ergolight", + 2110: "umsp", + 2111: "dsatp", + 2112: "idonix-metanet", + 2113: "hsl-storm", + 2114: "newheights", + 2115: "kdm", + 2116: "ccowcmr", + 2117: "mentaclient", + 2118: "mentaserver", + 2119: "gsigatekeeper", + 2120: "qencp", + 2121: "scientia-ssdb", + 2122: "caupc-remote", + 2123: "gtp-control", + 2124: "elatelink", + 2125: "lockstep", + 2126: "pktcable-cops", + 2127: "index-pc-wb", + 2128: "net-steward", + 2129: "cs-live", + 2130: "xds", + 2131: "avantageb2b", + 2132: "solera-epmap", + 2133: "zymed-zpp", + 2134: "avenue", + 2135: "gris", + 2136: "appworxsrv", + 2137: "connect", + 2138: "unbind-cluster", + 2139: "ias-auth", + 2140: "ias-reg", + 2141: "ias-admind", + 2142: "tdmoip", + 2143: "lv-jc", + 2144: "lv-ffx", + 2145: "lv-pici", + 2146: "lv-not", + 2147: "lv-auth", + 2148: "veritas-ucl", + 2149: "acptsys", + 2150: "dynamic3d", + 2151: "docent", + 2152: "gtp-user", + 2153: "ctlptc", + 2154: "stdptc", + 2155: "brdptc", + 2156: "trp", + 2157: "xnds", + 2158: "touchnetplus", + 2159: "gdbremote", + 2160: "apc-2160", + 2161: "apc-2161", + 2162: "navisphere", + 2163: "navisphere-sec", + 2164: "ddns-v3", + 2165: "x-bone-api", + 2166: "iwserver", + 2167: "raw-serial", + 2168: "easy-soft-mux", + 2169: "brain", + 2170: "eyetv", + 2171: "msfw-storage", + 2172: "msfw-s-storage", + 2173: "msfw-replica", + 2174: "msfw-array", + 2175: "airsync", + 2176: "rapi", + 2177: "qwave", + 2178: "bitspeer", + 2179: "vmrdp", + 2180: "mc-gt-srv", + 2181: "eforward", + 2182: "cgn-stat", + 2183: "cgn-config", + 2184: "nvd", + 2185: "onbase-dds", + 2186: "gtaua", + 2187: "ssmc", + 2188: "radware-rpm", + 2189: "radware-rpm-s", + 2190: "tivoconnect", + 2191: "tvbus", + 2192: "asdis", + 2193: "drwcs", + 2197: "mnp-exchange", + 2198: "onehome-remote", + 2199: "onehome-help", + 2200: "ici", + 2201: "ats", + 2202: "imtc-map", + 2203: "b2-runtime", + 2204: "b2-license", + 2205: "jps", + 2206: "hpocbus", + 2207: "hpssd", + 2208: "hpiod", + 2209: "rimf-ps", + 2210: "noaaport", + 2211: "emwin", + 2212: "leecoposserver", + 2213: "kali", + 2214: "rpi", + 2215: "ipcore", + 2216: "vtu-comms", + 2217: "gotodevice", + 2218: "bounzza", + 2219: "netiq-ncap", + 2220: "netiq", + 2221: "rockwell-csp1", + 2222: "EtherNet-IP-1", + 2223: "rockwell-csp2", + 2224: "efi-mg", + 2225: "rcip-itu", + 2226: "di-drm", + 2227: "di-msg", + 2228: "ehome-ms", + 2229: "datalens", + 2230: "queueadm", + 2231: "wimaxasncp", + 2232: "ivs-video", + 2233: "infocrypt", + 2234: "directplay", + 2235: "sercomm-wlink", + 2236: "nani", + 2237: "optech-port1-lm", + 2238: "aviva-sna", + 2239: "imagequery", + 2240: "recipe", + 2241: "ivsd", + 2242: "foliocorp", + 2243: "magicom", + 2244: "nmsserver", + 2245: "hao", + 2246: "pc-mta-addrmap", + 2247: "antidotemgrsvr", + 2248: "ums", + 2249: "rfmp", + 2250: "remote-collab", + 2251: "dif-port", + 2252: "njenet-ssl", + 2253: "dtv-chan-req", + 2254: "seispoc", + 2255: "vrtp", + 2256: "pcc-mfp", + 2257: "simple-tx-rx", + 2258: "rcts", + 2260: "apc-2260", + 2261: "comotionmaster", + 2262: "comotionback", + 2263: "ecwcfg", + 2264: "apx500api-1", + 2265: "apx500api-2", + 2266: "mfserver", + 2267: "ontobroker", + 2268: "amt", + 2269: "mikey", + 2270: "starschool", + 2271: "mmcals", + 2272: "mmcal", + 2273: "mysql-im", + 2274: "pcttunnell", + 2275: "ibridge-data", + 2276: "ibridge-mgmt", + 2277: "bluectrlproxy", + 2278: "s3db", + 2279: "xmquery", + 2280: "lnvpoller", + 2281: "lnvconsole", + 2282: "lnvalarm", + 2283: "lnvstatus", + 2284: "lnvmaps", + 2285: "lnvmailmon", + 2286: "nas-metering", + 2287: "dna", + 2288: "netml", + 2289: "dict-lookup", + 2290: "sonus-logging", + 2291: "eapsp", + 2292: "mib-streaming", + 2293: "npdbgmngr", + 2294: "konshus-lm", + 2295: "advant-lm", + 2296: "theta-lm", + 2297: "d2k-datamover1", + 2298: "d2k-datamover2", + 2299: "pc-telecommute", + 2300: "cvmmon", + 2301: "cpq-wbem", + 2302: "binderysupport", + 2303: "proxy-gateway", + 2304: "attachmate-uts", + 2305: "mt-scaleserver", + 2306: "tappi-boxnet", + 2307: "pehelp", + 2308: "sdhelp", + 2309: "sdserver", + 2310: "sdclient", + 2311: "messageservice", + 2312: "wanscaler", + 2313: "iapp", + 2314: "cr-websystems", + 2315: "precise-sft", + 2316: "sent-lm", + 2317: "attachmate-g32", + 2318: "cadencecontrol", + 2319: "infolibria", + 2320: "siebel-ns", + 2321: "rdlap", + 2322: "ofsd", + 2323: "3d-nfsd", + 2324: "cosmocall", + 2325: "ansysli", + 2326: "idcp", + 2327: "xingcsm", + 2328: "netrix-sftm", + 2329: "nvd", + 2330: "tscchat", + 2331: "agentview", + 2332: "rcc-host", + 2333: "snapp", + 2334: "ace-client", + 2335: "ace-proxy", + 2336: "appleugcontrol", + 2337: "ideesrv", + 2338: "norton-lambert", + 2339: "3com-webview", + 2340: "wrs-registry", + 2341: "xiostatus", + 2342: "manage-exec", + 2343: "nati-logos", + 2344: "fcmsys", + 2345: "dbm", + 2346: "redstorm-join", + 2347: "redstorm-find", + 2348: "redstorm-info", + 2349: "redstorm-diag", + 2350: "psbserver", + 2351: "psrserver", + 2352: "pslserver", + 2353: "pspserver", + 2354: "psprserver", + 2355: "psdbserver", + 2356: "gxtelmd", + 2357: "unihub-server", + 2358: "futrix", + 2359: "flukeserver", + 2360: "nexstorindltd", + 2361: "tl1", + 2362: "digiman", + 2363: "mediacntrlnfsd", + 2364: "oi-2000", + 2365: "dbref", + 2366: "qip-login", + 2367: "service-ctrl", + 2368: "opentable", + 2370: "l3-hbmon", + 2371: "hp-rda", + 2372: "lanmessenger", + 2373: "remographlm", + 2374: "hydra", + 2375: "docker", + 2376: "docker-s", + 2379: "etcd-client", + 2380: "etcd-server", + 2381: "compaq-https", + 2382: "ms-olap3", + 2383: "ms-olap4", + 2384: "sd-request", + 2385: "sd-data", + 2386: "virtualtape", + 2387: "vsamredirector", + 2388: "mynahautostart", + 2389: "ovsessionmgr", + 2390: "rsmtp", + 2391: "3com-net-mgmt", + 2392: "tacticalauth", + 2393: "ms-olap1", + 2394: "ms-olap2", + 2395: "lan900-remote", + 2396: "wusage", + 2397: "ncl", + 2398: "orbiter", + 2399: "fmpro-fdal", + 2400: "opequus-server", + 2401: "cvspserver", + 2402: "taskmaster2000", + 2403: "taskmaster2000", + 2404: "iec-104", + 2405: "trc-netpoll", + 2406: "jediserver", + 2407: "orion", + 2408: "railgun-webaccl", + 2409: "sns-protocol", + 2410: "vrts-registry", + 2411: "netwave-ap-mgmt", + 2412: "cdn", + 2413: "orion-rmi-reg", + 2414: "beeyond", + 2415: "codima-rtp", + 2416: "rmtserver", + 2417: "composit-server", + 2418: "cas", + 2419: "attachmate-s2s", + 2420: "dslremote-mgmt", + 2421: "g-talk", + 2422: "crmsbits", + 2423: "rnrp", + 2424: "kofax-svr", + 2425: "fjitsuappmgr", + 2427: "mgcp-gateway", + 2428: "ott", + 2429: "ft-role", + 2430: "venus", + 2431: "venus-se", + 2432: "codasrv", + 2433: "codasrv-se", + 2434: "pxc-epmap", + 2435: "optilogic", + 2436: "topx", + 2437: "unicontrol", + 2438: "msp", + 2439: "sybasedbsynch", + 2440: "spearway", + 2441: "pvsw-inet", + 2442: "netangel", + 2443: "powerclientcsf", + 2444: "btpp2sectrans", + 2445: "dtn1", + 2446: "bues-service", + 2447: "ovwdb", + 2448: "hpppssvr", + 2449: "ratl", + 2450: "netadmin", + 2451: "netchat", + 2452: "snifferclient", + 2453: "madge-ltd", + 2454: "indx-dds", + 2455: "wago-io-system", + 2456: "altav-remmgt", + 2457: "rapido-ip", + 2458: "griffin", + 2459: "community", + 2460: "ms-theater", + 2461: "qadmifoper", + 2462: "qadmifevent", + 2463: "lsi-raid-mgmt", + 2464: "direcpc-si", + 2465: "lbm", + 2466: "lbf", + 2467: "high-criteria", + 2468: "qip-msgd", + 2469: "mti-tcs-comm", + 2470: "taskman-port", + 2471: "seaodbc", + 2472: "c3", + 2473: "aker-cdp", + 2474: "vitalanalysis", + 2475: "ace-server", + 2476: "ace-svr-prop", + 2477: "ssm-cvs", + 2478: "ssm-cssps", + 2479: "ssm-els", + 2480: "powerexchange", + 2481: "giop", + 2482: "giop-ssl", + 2483: "ttc", + 2484: "ttc-ssl", + 2485: "netobjects1", + 2486: "netobjects2", + 2487: "pns", + 2488: "moy-corp", + 2489: "tsilb", + 2490: "qip-qdhcp", + 2491: "conclave-cpp", + 2492: "groove", + 2493: "talarian-mqs", + 2494: "bmc-ar", + 2495: "fast-rem-serv", + 2496: "dirgis", + 2497: "quaddb", + 2498: "odn-castraq", + 2499: "unicontrol", + 2500: "rtsserv", + 2501: "rtsclient", + 2502: "kentrox-prot", + 2503: "nms-dpnss", + 2504: "wlbs", + 2505: "ppcontrol", + 2506: "jbroker", + 2507: "spock", + 2508: "jdatastore", + 2509: "fjmpss", + 2510: "fjappmgrbulk", + 2511: "metastorm", + 2512: "citrixima", + 2513: "citrixadmin", + 2514: "facsys-ntp", + 2515: "facsys-router", + 2516: "maincontrol", + 2517: "call-sig-trans", + 2518: "willy", + 2519: "globmsgsvc", + 2520: "pvsw", + 2521: "adaptecmgr", + 2522: "windb", + 2523: "qke-llc-v3", + 2524: "optiwave-lm", + 2525: "ms-v-worlds", + 2526: "ema-sent-lm", + 2527: "iqserver", + 2528: "ncr-ccl", + 2529: "utsftp", + 2530: "vrcommerce", + 2531: "ito-e-gui", + 2532: "ovtopmd", + 2533: "snifferserver", + 2534: "combox-web-acc", + 2535: "madcap", + 2536: "btpp2audctr1", + 2537: "upgrade", + 2538: "vnwk-prapi", + 2539: "vsiadmin", + 2540: "lonworks", + 2541: "lonworks2", + 2542: "udrawgraph", + 2543: "reftek", + 2544: "novell-zen", + 2545: "sis-emt", + 2546: "vytalvaultbrtp", + 2547: "vytalvaultvsmp", + 2548: "vytalvaultpipe", + 2549: "ipass", + 2550: "ads", + 2551: "isg-uda-server", + 2552: "call-logging", + 2553: "efidiningport", + 2554: "vcnet-link-v10", + 2555: "compaq-wcp", + 2556: "nicetec-nmsvc", + 2557: "nicetec-mgmt", + 2558: "pclemultimedia", + 2559: "lstp", + 2560: "labrat", + 2561: "mosaixcc", + 2562: "delibo", + 2563: "cti-redwood", + 2564: "hp-3000-telnet", + 2565: "coord-svr", + 2566: "pcs-pcw", + 2567: "clp", + 2568: "spamtrap", + 2569: "sonuscallsig", + 2570: "hs-port", + 2571: "cecsvc", + 2572: "ibp", + 2573: "trustestablish", + 2574: "blockade-bpsp", + 2575: "hl7", + 2576: "tclprodebugger", + 2577: "scipticslsrvr", + 2578: "rvs-isdn-dcp", + 2579: "mpfoncl", + 2580: "tributary", + 2581: "argis-te", + 2582: "argis-ds", + 2583: "mon", + 2584: "cyaserv", + 2585: "netx-server", + 2586: "netx-agent", + 2587: "masc", + 2588: "privilege", + 2589: "quartus-tcl", + 2590: "idotdist", + 2591: "maytagshuffle", + 2592: "netrek", + 2593: "mns-mail", + 2594: "dts", + 2595: "worldfusion1", + 2596: "worldfusion2", + 2597: "homesteadglory", + 2598: "citriximaclient", + 2599: "snapd", + 2600: "hpstgmgr", + 2601: "discp-client", + 2602: "discp-server", + 2603: "servicemeter", + 2604: "nsc-ccs", + 2605: "nsc-posa", + 2606: "netmon", + 2607: "connection", + 2608: "wag-service", + 2609: "system-monitor", + 2610: "versa-tek", + 2611: "lionhead", + 2612: "qpasa-agent", + 2613: "smntubootstrap", + 2614: "neveroffline", + 2615: "firepower", + 2616: "appswitch-emp", + 2617: "cmadmin", + 2618: "priority-e-com", + 2619: "bruce", + 2620: "lpsrecommender", + 2621: "miles-apart", + 2622: "metricadbc", + 2623: "lmdp", + 2624: "aria", + 2625: "blwnkl-port", + 2626: "gbjd816", + 2627: "moshebeeri", + 2628: "dict", + 2629: "sitaraserver", + 2630: "sitaramgmt", + 2631: "sitaradir", + 2632: "irdg-post", + 2633: "interintelli", + 2634: "pk-electronics", + 2635: "backburner", + 2636: "solve", + 2637: "imdocsvc", + 2638: "sybaseanywhere", + 2639: "aminet", + 2640: "sai-sentlm", + 2641: "hdl-srv", + 2642: "tragic", + 2643: "gte-samp", + 2644: "travsoft-ipx-t", + 2645: "novell-ipx-cmd", + 2646: "and-lm", + 2647: "syncserver", + 2648: "upsnotifyprot", + 2649: "vpsipport", + 2650: "eristwoguns", + 2651: "ebinsite", + 2652: "interpathpanel", + 2653: "sonus", + 2654: "corel-vncadmin", + 2655: "unglue", + 2656: "kana", + 2657: "sns-dispatcher", + 2658: "sns-admin", + 2659: "sns-query", + 2660: "gcmonitor", + 2661: "olhost", + 2662: "bintec-capi", + 2663: "bintec-tapi", + 2664: "patrol-mq-gm", + 2665: "patrol-mq-nm", + 2666: "extensis", + 2667: "alarm-clock-s", + 2668: "alarm-clock-c", + 2669: "toad", + 2670: "tve-announce", + 2671: "newlixreg", + 2672: "nhserver", + 2673: "firstcall42", + 2674: "ewnn", + 2675: "ttc-etap", + 2676: "simslink", + 2677: "gadgetgate1way", + 2678: "gadgetgate2way", + 2679: "syncserverssl", + 2680: "pxc-sapxom", + 2681: "mpnjsomb", + 2683: "ncdloadbalance", + 2684: "mpnjsosv", + 2685: "mpnjsocl", + 2686: "mpnjsomg", + 2687: "pq-lic-mgmt", + 2688: "md-cg-http", + 2689: "fastlynx", + 2690: "hp-nnm-data", + 2691: "itinternet", + 2692: "admins-lms", + 2694: "pwrsevent", + 2695: "vspread", + 2696: "unifyadmin", + 2697: "oce-snmp-trap", + 2698: "mck-ivpip", + 2699: "csoft-plusclnt", + 2700: "tqdata", + 2701: "sms-rcinfo", + 2702: "sms-xfer", + 2703: "sms-chat", + 2704: "sms-remctrl", + 2705: "sds-admin", + 2706: "ncdmirroring", + 2707: "emcsymapiport", + 2708: "banyan-net", + 2709: "supermon", + 2710: "sso-service", + 2711: "sso-control", + 2712: "aocp", + 2713: "raventbs", + 2714: "raventdm", + 2715: "hpstgmgr2", + 2716: "inova-ip-disco", + 2717: "pn-requester", + 2718: "pn-requester2", + 2719: "scan-change", + 2720: "wkars", + 2721: "smart-diagnose", + 2722: "proactivesrvr", + 2723: "watchdog-nt", + 2724: "qotps", + 2725: "msolap-ptp2", + 2726: "tams", + 2727: "mgcp-callagent", + 2728: "sqdr", + 2729: "tcim-control", + 2730: "nec-raidplus", + 2731: "fyre-messanger", + 2732: "g5m", + 2733: "signet-ctf", + 2734: "ccs-software", + 2735: "netiq-mc", + 2736: "radwiz-nms-srv", + 2737: "srp-feedback", + 2738: "ndl-tcp-ois-gw", + 2739: "tn-timing", + 2740: "alarm", + 2741: "tsb", + 2742: "tsb2", + 2743: "murx", + 2744: "honyaku", + 2745: "urbisnet", + 2746: "cpudpencap", + 2747: "fjippol-swrly", + 2748: "fjippol-polsvr", + 2749: "fjippol-cnsl", + 2750: "fjippol-port1", + 2751: "fjippol-port2", + 2752: "rsisysaccess", + 2753: "de-spot", + 2754: "apollo-cc", + 2755: "expresspay", + 2756: "simplement-tie", + 2757: "cnrp", + 2758: "apollo-status", + 2759: "apollo-gms", + 2760: "sabams", + 2761: "dicom-iscl", + 2762: "dicom-tls", + 2763: "desktop-dna", + 2764: "data-insurance", + 2765: "qip-audup", + 2766: "compaq-scp", + 2767: "uadtc", + 2768: "uacs", + 2769: "exce", + 2770: "veronica", + 2771: "vergencecm", + 2772: "auris", + 2773: "rbakcup1", + 2774: "rbakcup2", + 2775: "smpp", + 2776: "ridgeway1", + 2777: "ridgeway2", + 2778: "gwen-sonya", + 2779: "lbc-sync", + 2780: "lbc-control", + 2781: "whosells", + 2782: "everydayrc", + 2783: "aises", + 2784: "www-dev", + 2785: "aic-np", + 2786: "aic-oncrpc", + 2787: "piccolo", + 2788: "fryeserv", + 2789: "media-agent", + 2790: "plgproxy", + 2791: "mtport-regist", + 2792: "f5-globalsite", + 2793: "initlsmsad", + 2795: "livestats", + 2796: "ac-tech", + 2797: "esp-encap", + 2798: "tmesis-upshot", + 2799: "icon-discover", + 2800: "acc-raid", + 2801: "igcp", + 2802: "veritas-tcp1", + 2803: "btprjctrl", + 2804: "dvr-esm", + 2805: "wta-wsp-s", + 2806: "cspuni", + 2807: "cspmulti", + 2808: "j-lan-p", + 2809: "corbaloc", + 2810: "netsteward", + 2811: "gsiftp", + 2812: "atmtcp", + 2813: "llm-pass", + 2814: "llm-csv", + 2815: "lbc-measure", + 2816: "lbc-watchdog", + 2817: "nmsigport", + 2818: "rmlnk", + 2819: "fc-faultnotify", + 2820: "univision", + 2821: "vrts-at-port", + 2822: "ka0wuc", + 2823: "cqg-netlan", + 2824: "cqg-netlan-1", + 2826: "slc-systemlog", + 2827: "slc-ctrlrloops", + 2828: "itm-lm", + 2829: "silkp1", + 2830: "silkp2", + 2831: "silkp3", + 2832: "silkp4", + 2833: "glishd", + 2834: "evtp", + 2835: "evtp-data", + 2836: "catalyst", + 2837: "repliweb", + 2838: "starbot", + 2839: "nmsigport", + 2840: "l3-exprt", + 2841: "l3-ranger", + 2842: "l3-hawk", + 2843: "pdnet", + 2844: "bpcp-poll", + 2845: "bpcp-trap", + 2846: "aimpp-hello", + 2847: "aimpp-port-req", + 2848: "amt-blc-port", + 2849: "fxp", + 2850: "metaconsole", + 2851: "webemshttp", + 2852: "bears-01", + 2853: "ispipes", + 2854: "infomover", + 2855: "msrp", + 2856: "cesdinv", + 2857: "simctlp", + 2858: "ecnp", + 2859: "activememory", + 2860: "dialpad-voice1", + 2861: "dialpad-voice2", + 2862: "ttg-protocol", + 2863: "sonardata", + 2864: "astromed-main", + 2865: "pit-vpn", + 2866: "iwlistener", + 2867: "esps-portal", + 2868: "npep-messaging", + 2869: "icslap", + 2870: "daishi", + 2871: "msi-selectplay", + 2872: "radix", + 2874: "dxmessagebase1", + 2875: "dxmessagebase2", + 2876: "sps-tunnel", + 2877: "bluelance", + 2878: "aap", + 2879: "ucentric-ds", + 2880: "synapse", + 2881: "ndsp", + 2882: "ndtp", + 2883: "ndnp", + 2884: "flashmsg", + 2885: "topflow", + 2886: "responselogic", + 2887: "aironetddp", + 2888: "spcsdlobby", + 2889: "rsom", + 2890: "cspclmulti", + 2891: "cinegrfx-elmd", + 2892: "snifferdata", + 2893: "vseconnector", + 2894: "abacus-remote", + 2895: "natuslink", + 2896: "ecovisiong6-1", + 2897: "citrix-rtmp", + 2898: "appliance-cfg", + 2899: "powergemplus", + 2900: "quicksuite", + 2901: "allstorcns", + 2902: "netaspi", + 2903: "suitcase", + 2904: "m2ua", + 2905: "m3ua", + 2906: "caller9", + 2907: "webmethods-b2b", + 2908: "mao", + 2909: "funk-dialout", + 2910: "tdaccess", + 2911: "blockade", + 2912: "epicon", + 2913: "boosterware", + 2914: "gamelobby", + 2915: "tksocket", + 2916: "elvin-server", + 2917: "elvin-client", + 2918: "kastenchasepad", + 2919: "roboer", + 2920: "roboeda", + 2921: "cesdcdman", + 2922: "cesdcdtrn", + 2923: "wta-wsp-wtp-s", + 2924: "precise-vip", + 2926: "mobile-file-dl", + 2927: "unimobilectrl", + 2928: "redstone-cpss", + 2929: "amx-webadmin", + 2930: "amx-weblinx", + 2931: "circle-x", + 2932: "incp", + 2933: "4-tieropmgw", + 2934: "4-tieropmcli", + 2935: "qtp", + 2936: "otpatch", + 2937: "pnaconsult-lm", + 2938: "sm-pas-1", + 2939: "sm-pas-2", + 2940: "sm-pas-3", + 2941: "sm-pas-4", + 2942: "sm-pas-5", + 2943: "ttnrepository", + 2944: "megaco-h248", + 2945: "h248-binary", + 2946: "fjsvmpor", + 2947: "gpsd", + 2948: "wap-push", + 2949: "wap-pushsecure", + 2950: "esip", + 2951: "ottp", + 2952: "mpfwsas", + 2953: "ovalarmsrv", + 2954: "ovalarmsrv-cmd", + 2955: "csnotify", + 2956: "ovrimosdbman", + 2957: "jmact5", + 2958: "jmact6", + 2959: "rmopagt", + 2960: "dfoxserver", + 2961: "boldsoft-lm", + 2962: "iph-policy-cli", + 2963: "iph-policy-adm", + 2964: "bullant-srap", + 2965: "bullant-rap", + 2966: "idp-infotrieve", + 2967: "ssc-agent", + 2968: "enpp", + 2969: "essp", + 2970: "index-net", + 2971: "netclip", + 2972: "pmsm-webrctl", + 2973: "svnetworks", + 2974: "signal", + 2975: "fjmpcm", + 2976: "cns-srv-port", + 2977: "ttc-etap-ns", + 2978: "ttc-etap-ds", + 2979: "h263-video", + 2980: "wimd", + 2981: "mylxamport", + 2982: "iwb-whiteboard", + 2983: "netplan", + 2984: "hpidsadmin", + 2985: "hpidsagent", + 2986: "stonefalls", + 2987: "identify", + 2988: "hippad", + 2989: "zarkov", + 2990: "boscap", + 2991: "wkstn-mon", + 2992: "avenyo", + 2993: "veritas-vis1", + 2994: "veritas-vis2", + 2995: "idrs", + 2996: "vsixml", + 2997: "rebol", + 2998: "realsecure", + 2999: "remoteware-un", + 3000: "hbci", + 3001: "origo-native", + 3002: "exlm-agent", + 3003: "cgms", + 3004: "csoftragent", + 3005: "geniuslm", + 3006: "ii-admin", + 3007: "lotusmtap", + 3008: "midnight-tech", + 3009: "pxc-ntfy", + 3010: "gw", + 3011: "trusted-web", + 3012: "twsdss", + 3013: "gilatskysurfer", + 3014: "broker-service", + 3015: "nati-dstp", + 3016: "notify-srvr", + 3017: "event-listener", + 3018: "srvc-registry", + 3019: "resource-mgr", + 3020: "cifs", + 3021: "agriserver", + 3022: "csregagent", + 3023: "magicnotes", + 3024: "nds-sso", + 3025: "arepa-raft", + 3026: "agri-gateway", + 3027: "LiebDevMgmt-C", + 3028: "LiebDevMgmt-DM", + 3029: "LiebDevMgmt-A", + 3030: "arepa-cas", + 3031: "eppc", + 3032: "redwood-chat", + 3033: "pdb", + 3034: "osmosis-aeea", + 3035: "fjsv-gssagt", + 3036: "hagel-dump", + 3037: "hp-san-mgmt", + 3038: "santak-ups", + 3039: "cogitate", + 3040: "tomato-springs", + 3041: "di-traceware", + 3042: "journee", + 3043: "brp", + 3044: "epp", + 3045: "responsenet", + 3046: "di-ase", + 3047: "hlserver", + 3048: "pctrader", + 3049: "nsws", + 3050: "gds-db", + 3051: "galaxy-server", + 3052: "apc-3052", + 3053: "dsom-server", + 3054: "amt-cnf-prot", + 3055: "policyserver", + 3056: "cdl-server", + 3057: "goahead-fldup", + 3058: "videobeans", + 3059: "qsoft", + 3060: "interserver", + 3061: "cautcpd", + 3062: "ncacn-ip-tcp", + 3063: "ncadg-ip-udp", + 3064: "rprt", + 3065: "slinterbase", + 3066: "netattachsdmp", + 3067: "fjhpjp", + 3068: "ls3bcast", + 3069: "ls3", + 3070: "mgxswitch", + 3071: "csd-mgmt-port", + 3072: "csd-monitor", + 3073: "vcrp", + 3074: "xbox", + 3075: "orbix-locator", + 3076: "orbix-config", + 3077: "orbix-loc-ssl", + 3078: "orbix-cfg-ssl", + 3079: "lv-frontpanel", + 3080: "stm-pproc", + 3081: "tl1-lv", + 3082: "tl1-raw", + 3083: "tl1-telnet", + 3084: "itm-mccs", + 3085: "pcihreq", + 3086: "jdl-dbkitchen", + 3087: "asoki-sma", + 3088: "xdtp", + 3089: "ptk-alink", + 3090: "stss", + 3091: "1ci-smcs", + 3093: "rapidmq-center", + 3094: "rapidmq-reg", + 3095: "panasas", + 3096: "ndl-aps", + 3098: "umm-port", + 3099: "chmd", + 3100: "opcon-xps", + 3101: "hp-pxpib", + 3102: "slslavemon", + 3103: "autocuesmi", + 3104: "autocuelog", + 3105: "cardbox", + 3106: "cardbox-http", + 3107: "business", + 3108: "geolocate", + 3109: "personnel", + 3110: "sim-control", + 3111: "wsynch", + 3112: "ksysguard", + 3113: "cs-auth-svr", + 3114: "ccmad", + 3115: "mctet-master", + 3116: "mctet-gateway", + 3117: "mctet-jserv", + 3118: "pkagent", + 3119: "d2000kernel", + 3120: "d2000webserver", + 3121: "pcmk-remote", + 3122: "vtr-emulator", + 3123: "edix", + 3124: "beacon-port", + 3125: "a13-an", + 3127: "ctx-bridge", + 3128: "ndl-aas", + 3129: "netport-id", + 3130: "icpv2", + 3131: "netbookmark", + 3132: "ms-rule-engine", + 3133: "prism-deploy", + 3134: "ecp", + 3135: "peerbook-port", + 3136: "grubd", + 3137: "rtnt-1", + 3138: "rtnt-2", + 3139: "incognitorv", + 3140: "ariliamulti", + 3141: "vmodem", + 3142: "rdc-wh-eos", + 3143: "seaview", + 3144: "tarantella", + 3145: "csi-lfap", + 3146: "bears-02", + 3147: "rfio", + 3148: "nm-game-admin", + 3149: "nm-game-server", + 3150: "nm-asses-admin", + 3151: "nm-assessor", + 3152: "feitianrockey", + 3153: "s8-client-port", + 3154: "ccmrmi", + 3155: "jpegmpeg", + 3156: "indura", + 3157: "e3consultants", + 3158: "stvp", + 3159: "navegaweb-port", + 3160: "tip-app-server", + 3161: "doc1lm", + 3162: "sflm", + 3163: "res-sap", + 3164: "imprs", + 3165: "newgenpay", + 3166: "sossecollector", + 3167: "nowcontact", + 3168: "poweronnud", + 3169: "serverview-as", + 3170: "serverview-asn", + 3171: "serverview-gf", + 3172: "serverview-rm", + 3173: "serverview-icc", + 3174: "armi-server", + 3175: "t1-e1-over-ip", + 3176: "ars-master", + 3177: "phonex-port", + 3178: "radclientport", + 3179: "h2gf-w-2m", + 3180: "mc-brk-srv", + 3181: "bmcpatrolagent", + 3182: "bmcpatrolrnvu", + 3183: "cops-tls", + 3184: "apogeex-port", + 3185: "smpppd", + 3186: "iiw-port", + 3187: "odi-port", + 3188: "brcm-comm-port", + 3189: "pcle-infex", + 3190: "csvr-proxy", + 3191: "csvr-sslproxy", + 3192: "firemonrcc", + 3193: "spandataport", + 3194: "magbind", + 3195: "ncu-1", + 3196: "ncu-2", + 3197: "embrace-dp-s", + 3198: "embrace-dp-c", + 3199: "dmod-workspace", + 3200: "tick-port", + 3201: "cpq-tasksmart", + 3202: "intraintra", + 3203: "netwatcher-mon", + 3204: "netwatcher-db", + 3205: "isns", + 3206: "ironmail", + 3207: "vx-auth-port", + 3208: "pfu-prcallback", + 3209: "netwkpathengine", + 3210: "flamenco-proxy", + 3211: "avsecuremgmt", + 3212: "surveyinst", + 3213: "neon24x7", + 3214: "jmq-daemon-1", + 3215: "jmq-daemon-2", + 3216: "ferrari-foam", + 3217: "unite", + 3218: "smartpackets", + 3219: "wms-messenger", + 3220: "xnm-ssl", + 3221: "xnm-clear-text", + 3222: "glbp", + 3223: "digivote", + 3224: "aes-discovery", + 3225: "fcip-port", + 3226: "isi-irp", + 3227: "dwnmshttp", + 3228: "dwmsgserver", + 3229: "global-cd-port", + 3230: "sftdst-port", + 3231: "vidigo", + 3232: "mdtp", + 3233: "whisker", + 3234: "alchemy", + 3235: "mdap-port", + 3236: "apparenet-ts", + 3237: "apparenet-tps", + 3238: "apparenet-as", + 3239: "apparenet-ui", + 3240: "triomotion", + 3241: "sysorb", + 3242: "sdp-id-port", + 3243: "timelot", + 3244: "onesaf", + 3245: "vieo-fe", + 3246: "dvt-system", + 3247: "dvt-data", + 3248: "procos-lm", + 3249: "ssp", + 3250: "hicp", + 3251: "sysscanner", + 3252: "dhe", + 3253: "pda-data", + 3254: "pda-sys", + 3255: "semaphore", + 3256: "cpqrpm-agent", + 3257: "cpqrpm-server", + 3258: "ivecon-port", + 3259: "epncdp2", + 3260: "iscsi-target", + 3261: "winshadow", + 3262: "necp", + 3263: "ecolor-imager", + 3264: "ccmail", + 3265: "altav-tunnel", + 3266: "ns-cfg-server", + 3267: "ibm-dial-out", + 3268: "msft-gc", + 3269: "msft-gc-ssl", + 3270: "verismart", + 3271: "csoft-prev", + 3272: "user-manager", + 3273: "sxmp", + 3274: "ordinox-server", + 3275: "samd", + 3276: "maxim-asics", + 3277: "awg-proxy", + 3278: "lkcmserver", + 3279: "admind", + 3280: "vs-server", + 3281: "sysopt", + 3282: "datusorb", + 3283: "Apple Remote Desktop (Net Assistant)", + 3284: "4talk", + 3285: "plato", + 3286: "e-net", + 3287: "directvdata", + 3288: "cops", + 3289: "enpc", + 3290: "caps-lm", + 3291: "sah-lm", + 3292: "cart-o-rama", + 3293: "fg-fps", + 3294: "fg-gip", + 3295: "dyniplookup", + 3296: "rib-slm", + 3297: "cytel-lm", + 3298: "deskview", + 3299: "pdrncs", + 3302: "mcs-fastmail", + 3303: "opsession-clnt", + 3304: "opsession-srvr", + 3305: "odette-ftp", + 3306: "mysql", + 3307: "opsession-prxy", + 3308: "tns-server", + 3309: "tns-adv", + 3310: "dyna-access", + 3311: "mcns-tel-ret", + 3312: "appman-server", + 3313: "uorb", + 3314: "uohost", + 3315: "cdid", + 3316: "aicc-cmi", + 3317: "vsaiport", + 3318: "ssrip", + 3319: "sdt-lmd", + 3320: "officelink2000", + 3321: "vnsstr", + 3326: "sftu", + 3327: "bbars", + 3328: "egptlm", + 3329: "hp-device-disc", + 3330: "mcs-calypsoicf", + 3331: "mcs-messaging", + 3332: "mcs-mailsvr", + 3333: "dec-notes", + 3334: "directv-web", + 3335: "directv-soft", + 3336: "directv-tick", + 3337: "directv-catlg", + 3338: "anet-b", + 3339: "anet-l", + 3340: "anet-m", + 3341: "anet-h", + 3342: "webtie", + 3343: "ms-cluster-net", + 3344: "bnt-manager", + 3345: "influence", + 3346: "trnsprntproxy", + 3347: "phoenix-rpc", + 3348: "pangolin-laser", + 3349: "chevinservices", + 3350: "findviatv", + 3351: "btrieve", + 3352: "ssql", + 3353: "fatpipe", + 3354: "suitjd", + 3355: "ordinox-dbase", + 3356: "upnotifyps", + 3357: "adtech-test", + 3358: "mpsysrmsvr", + 3359: "wg-netforce", + 3360: "kv-server", + 3361: "kv-agent", + 3362: "dj-ilm", + 3363: "nati-vi-server", + 3364: "creativeserver", + 3365: "contentserver", + 3366: "creativepartnr", + 3372: "tip2", + 3373: "lavenir-lm", + 3374: "cluster-disc", + 3375: "vsnm-agent", + 3376: "cdbroker", + 3377: "cogsys-lm", + 3378: "wsicopy", + 3379: "socorfs", + 3380: "sns-channels", + 3381: "geneous", + 3382: "fujitsu-neat", + 3383: "esp-lm", + 3384: "hp-clic", + 3385: "qnxnetman", + 3386: "gprs-data", + 3387: "backroomnet", + 3388: "cbserver", + 3389: "ms-wbt-server", + 3390: "dsc", + 3391: "savant", + 3392: "efi-lm", + 3393: "d2k-tapestry1", + 3394: "d2k-tapestry2", + 3395: "dyna-lm", + 3396: "printer-agent", + 3397: "cloanto-lm", + 3398: "mercantile", + 3399: "csms", + 3400: "csms2", + 3401: "filecast", + 3402: "fxaengine-net", + 3405: "nokia-ann-ch1", + 3406: "nokia-ann-ch2", + 3407: "ldap-admin", + 3408: "BESApi", + 3409: "networklens", + 3410: "networklenss", + 3411: "biolink-auth", + 3412: "xmlblaster", + 3413: "svnet", + 3414: "wip-port", + 3415: "bcinameservice", + 3416: "commandport", + 3417: "csvr", + 3418: "rnmap", + 3419: "softaudit", + 3420: "ifcp-port", + 3421: "bmap", + 3422: "rusb-sys-port", + 3423: "xtrm", + 3424: "xtrms", + 3425: "agps-port", + 3426: "arkivio", + 3427: "websphere-snmp", + 3428: "twcss", + 3429: "gcsp", + 3430: "ssdispatch", + 3431: "ndl-als", + 3432: "osdcp", + 3433: "opnet-smp", + 3434: "opencm", + 3435: "pacom", + 3436: "gc-config", + 3437: "autocueds", + 3438: "spiral-admin", + 3439: "hri-port", + 3440: "ans-console", + 3441: "connect-client", + 3442: "connect-server", + 3443: "ov-nnm-websrv", + 3444: "denali-server", + 3445: "monp", + 3446: "3comfaxrpc", + 3447: "directnet", + 3448: "dnc-port", + 3449: "hotu-chat", + 3450: "castorproxy", + 3451: "asam", + 3452: "sabp-signal", + 3453: "pscupd", + 3454: "mira", + 3455: "prsvp", + 3456: "vat", + 3457: "vat-control", + 3458: "d3winosfi", + 3459: "integral", + 3460: "edm-manager", + 3461: "edm-stager", + 3462: "edm-std-notify", + 3463: "edm-adm-notify", + 3464: "edm-mgr-sync", + 3465: "edm-mgr-cntrl", + 3466: "workflow", + 3467: "rcst", + 3468: "ttcmremotectrl", + 3469: "pluribus", + 3470: "jt400", + 3471: "jt400-ssl", + 3472: "jaugsremotec-1", + 3473: "jaugsremotec-2", + 3474: "ttntspauto", + 3475: "genisar-port", + 3476: "nppmp", + 3477: "ecomm", + 3478: "stun", + 3479: "twrpc", + 3480: "plethora", + 3481: "cleanerliverc", + 3482: "vulture", + 3483: "slim-devices", + 3484: "gbs-stp", + 3485: "celatalk", + 3486: "ifsf-hb-port", + 3487: "ltctcp", + 3488: "fs-rh-srv", + 3489: "dtp-dia", + 3490: "colubris", + 3491: "swr-port", + 3492: "tvdumtray-port", + 3493: "nut", + 3494: "ibm3494", + 3495: "seclayer-tcp", + 3496: "seclayer-tls", + 3497: "ipether232port", + 3498: "dashpas-port", + 3499: "sccip-media", + 3500: "rtmp-port", + 3501: "isoft-p2p", + 3502: "avinstalldisc", + 3503: "lsp-ping", + 3504: "ironstorm", + 3505: "ccmcomm", + 3506: "apc-3506", + 3507: "nesh-broker", + 3508: "interactionweb", + 3509: "vt-ssl", + 3510: "xss-port", + 3511: "webmail-2", + 3512: "aztec", + 3513: "arcpd", + 3514: "must-p2p", + 3515: "must-backplane", + 3516: "smartcard-port", + 3517: "802-11-iapp", + 3518: "artifact-msg", + 3519: "nvmsgd", + 3520: "galileolog", + 3521: "mc3ss", + 3522: "nssocketport", + 3523: "odeumservlink", + 3524: "ecmport", + 3525: "eisport", + 3526: "starquiz-port", + 3527: "beserver-msg-q", + 3528: "jboss-iiop", + 3529: "jboss-iiop-ssl", + 3530: "gf", + 3531: "joltid", + 3532: "raven-rmp", + 3533: "raven-rdp", + 3534: "urld-port", + 3535: "ms-la", + 3536: "snac", + 3537: "ni-visa-remote", + 3538: "ibm-diradm", + 3539: "ibm-diradm-ssl", + 3540: "pnrp-port", + 3541: "voispeed-port", + 3542: "hacl-monitor", + 3543: "qftest-lookup", + 3544: "teredo", + 3545: "camac", + 3547: "symantec-sim", + 3548: "interworld", + 3549: "tellumat-nms", + 3550: "ssmpp", + 3551: "apcupsd", + 3552: "taserver", + 3553: "rbr-discovery", + 3554: "questnotify", + 3555: "razor", + 3556: "sky-transport", + 3557: "personalos-001", + 3558: "mcp-port", + 3559: "cctv-port", + 3560: "iniserve-port", + 3561: "bmc-onekey", + 3562: "sdbproxy", + 3563: "watcomdebug", + 3564: "esimport", + 3565: "m2pa", + 3566: "quest-data-hub", + 3567: "enc-eps", + 3568: "enc-tunnel-sec", + 3569: "mbg-ctrl", + 3570: "mccwebsvr-port", + 3571: "megardsvr-port", + 3572: "megaregsvrport", + 3573: "tag-ups-1", + 3574: "dmaf-server", + 3575: "ccm-port", + 3576: "cmc-port", + 3577: "config-port", + 3578: "data-port", + 3579: "ttat3lb", + 3580: "nati-svrloc", + 3581: "kfxaclicensing", + 3582: "press", + 3583: "canex-watch", + 3584: "u-dbap", + 3585: "emprise-lls", + 3586: "emprise-lsc", + 3587: "p2pgroup", + 3588: "sentinel", + 3589: "isomair", + 3590: "wv-csp-sms", + 3591: "gtrack-server", + 3592: "gtrack-ne", + 3593: "bpmd", + 3594: "mediaspace", + 3595: "shareapp", + 3596: "iw-mmogame", + 3597: "a14", + 3598: "a15", + 3599: "quasar-server", + 3600: "trap-daemon", + 3601: "visinet-gui", + 3602: "infiniswitchcl", + 3603: "int-rcv-cntrl", + 3604: "bmc-jmx-port", + 3605: "comcam-io", + 3606: "splitlock", + 3607: "precise-i3", + 3608: "trendchip-dcp", + 3609: "cpdi-pidas-cm", + 3610: "echonet", + 3611: "six-degrees", + 3612: "hp-dataprotect", + 3613: "alaris-disc", + 3614: "sigma-port", + 3615: "start-network", + 3616: "cd3o-protocol", + 3617: "sharp-server", + 3618: "aairnet-1", + 3619: "aairnet-2", + 3620: "ep-pcp", + 3621: "ep-nsp", + 3622: "ff-lr-port", + 3623: "haipe-discover", + 3624: "dist-upgrade", + 3625: "volley", + 3626: "bvcdaemon-port", + 3627: "jamserverport", + 3628: "ept-machine", + 3629: "escvpnet", + 3630: "cs-remote-db", + 3631: "cs-services", + 3632: "distcc", + 3633: "wacp", + 3634: "hlibmgr", + 3635: "sdo", + 3636: "servistaitsm", + 3637: "scservp", + 3638: "ehp-backup", + 3639: "xap-ha", + 3640: "netplay-port1", + 3641: "netplay-port2", + 3642: "juxml-port", + 3643: "audiojuggler", + 3644: "ssowatch", + 3645: "cyc", + 3646: "xss-srv-port", + 3647: "splitlock-gw", + 3648: "fjcp", + 3649: "nmmp", + 3650: "prismiq-plugin", + 3651: "xrpc-registry", + 3652: "vxcrnbuport", + 3653: "tsp", + 3654: "vaprtm", + 3655: "abatemgr", + 3656: "abatjss", + 3657: "immedianet-bcn", + 3658: "ps-ams", + 3659: "apple-sasl", + 3660: "can-nds-ssl", + 3661: "can-ferret-ssl", + 3662: "pserver", + 3663: "dtp", + 3664: "ups-engine", + 3665: "ent-engine", + 3666: "eserver-pap", + 3667: "infoexch", + 3668: "dell-rm-port", + 3669: "casanswmgmt", + 3670: "smile", + 3671: "efcp", + 3672: "lispworks-orb", + 3673: "mediavault-gui", + 3674: "wininstall-ipc", + 3675: "calltrax", + 3676: "va-pacbase", + 3677: "roverlog", + 3678: "ipr-dglt", + 3679: "Escale (Newton Dock)", + 3680: "npds-tracker", + 3681: "bts-x73", + 3682: "cas-mapi", + 3683: "bmc-ea", + 3684: "faxstfx-port", + 3685: "dsx-agent", + 3686: "tnmpv2", + 3687: "simple-push", + 3688: "simple-push-s", + 3689: "daap", + 3690: "svn", + 3691: "magaya-network", + 3692: "intelsync", + 3695: "bmc-data-coll", + 3696: "telnetcpcd", + 3697: "nw-license", + 3698: "sagectlpanel", + 3699: "kpn-icw", + 3700: "lrs-paging", + 3701: "netcelera", + 3702: "ws-discovery", + 3703: "adobeserver-3", + 3704: "adobeserver-4", + 3705: "adobeserver-5", + 3706: "rt-event", + 3707: "rt-event-s", + 3708: "sun-as-iiops", + 3709: "ca-idms", + 3710: "portgate-auth", + 3711: "edb-server2", + 3712: "sentinel-ent", + 3713: "tftps", + 3714: "delos-dms", + 3715: "anoto-rendezv", + 3716: "wv-csp-sms-cir", + 3717: "wv-csp-udp-cir", + 3718: "opus-services", + 3719: "itelserverport", + 3720: "ufastro-instr", + 3721: "xsync", + 3722: "xserveraid", + 3723: "sychrond", + 3724: "blizwow", + 3725: "na-er-tip", + 3726: "array-manager", + 3727: "e-mdu", + 3728: "e-woa", + 3729: "fksp-audit", + 3730: "client-ctrl", + 3731: "smap", + 3732: "m-wnn", + 3733: "multip-msg", + 3734: "synel-data", + 3735: "pwdis", + 3736: "rs-rmi", + 3737: "xpanel", + 3738: "versatalk", + 3739: "launchbird-lm", + 3740: "heartbeat", + 3741: "wysdma", + 3742: "cst-port", + 3743: "ipcs-command", + 3744: "sasg", + 3745: "gw-call-port", + 3746: "linktest", + 3747: "linktest-s", + 3748: "webdata", + 3749: "cimtrak", + 3750: "cbos-ip-port", + 3751: "gprs-cube", + 3752: "vipremoteagent", + 3753: "nattyserver", + 3754: "timestenbroker", + 3755: "sas-remote-hlp", + 3756: "canon-capt", + 3757: "grf-port", + 3758: "apw-registry", + 3759: "exapt-lmgr", + 3760: "adtempusclient", + 3761: "gsakmp", + 3762: "gbs-smp", + 3763: "xo-wave", + 3764: "mni-prot-rout", + 3765: "rtraceroute", + 3766: "sitewatch-s", + 3767: "listmgr-port", + 3768: "rblcheckd", + 3769: "haipe-otnk", + 3770: "cindycollab", + 3771: "paging-port", + 3772: "ctp", + 3773: "ctdhercules", + 3774: "zicom", + 3775: "ispmmgr", + 3776: "dvcprov-port", + 3777: "jibe-eb", + 3778: "c-h-it-port", + 3779: "cognima", + 3780: "nnp", + 3781: "abcvoice-port", + 3782: "iso-tp0s", + 3783: "bim-pem", + 3784: "bfd-control", + 3785: "bfd-echo", + 3786: "upstriggervsw", + 3787: "fintrx", + 3788: "isrp-port", + 3789: "remotedeploy", + 3790: "quickbooksrds", + 3791: "tvnetworkvideo", + 3792: "sitewatch", + 3793: "dcsoftware", + 3794: "jaus", + 3795: "myblast", + 3796: "spw-dialer", + 3797: "idps", + 3798: "minilock", + 3799: "radius-dynauth", + 3800: "pwgpsi", + 3801: "ibm-mgr", + 3802: "vhd", + 3803: "soniqsync", + 3804: "iqnet-port", + 3805: "tcpdataserver", + 3806: "wsmlb", + 3807: "spugna", + 3808: "sun-as-iiops-ca", + 3809: "apocd", + 3810: "wlanauth", + 3811: "amp", + 3812: "neto-wol-server", + 3813: "rap-ip", + 3814: "neto-dcs", + 3815: "lansurveyorxml", + 3816: "sunlps-http", + 3817: "tapeware", + 3818: "crinis-hb", + 3819: "epl-slp", + 3820: "scp", + 3821: "pmcp", + 3822: "acp-discovery", + 3823: "acp-conduit", + 3824: "acp-policy", + 3825: "ffserver", + 3826: "warmux", + 3827: "netmpi", + 3828: "neteh", + 3829: "neteh-ext", + 3830: "cernsysmgmtagt", + 3831: "dvapps", + 3832: "xxnetserver", + 3833: "aipn-auth", + 3834: "spectardata", + 3835: "spectardb", + 3836: "markem-dcp", + 3837: "mkm-discovery", + 3838: "sos", + 3839: "amx-rms", + 3840: "flirtmitmir", + 3841: "shiprush-db-svr", + 3842: "nhci", + 3843: "quest-agent", + 3844: "rnm", + 3845: "v-one-spp", + 3846: "an-pcp", + 3847: "msfw-control", + 3848: "item", + 3849: "spw-dnspreload", + 3850: "qtms-bootstrap", + 3851: "spectraport", + 3852: "sse-app-config", + 3853: "sscan", + 3854: "stryker-com", + 3855: "opentrac", + 3856: "informer", + 3857: "trap-port", + 3858: "trap-port-mom", + 3859: "nav-port", + 3860: "sasp", + 3861: "winshadow-hd", + 3862: "giga-pocket", + 3863: "asap-tcp", + 3864: "asap-tcp-tls", + 3865: "xpl", + 3866: "dzdaemon", + 3867: "dzoglserver", + 3868: "diameter", + 3869: "ovsam-mgmt", + 3870: "ovsam-d-agent", + 3871: "avocent-adsap", + 3872: "oem-agent", + 3873: "fagordnc", + 3874: "sixxsconfig", + 3875: "pnbscada", + 3876: "dl-agent", + 3877: "xmpcr-interface", + 3878: "fotogcad", + 3879: "appss-lm", + 3880: "igrs", + 3881: "idac", + 3882: "msdts1", + 3883: "vrpn", + 3884: "softrack-meter", + 3885: "topflow-ssl", + 3886: "nei-management", + 3887: "ciphire-data", + 3888: "ciphire-serv", + 3889: "dandv-tester", + 3890: "ndsconnect", + 3891: "rtc-pm-port", + 3892: "pcc-image-port", + 3893: "cgi-starapi", + 3894: "syam-agent", + 3895: "syam-smc", + 3896: "sdo-tls", + 3897: "sdo-ssh", + 3898: "senip", + 3899: "itv-control", + 3900: "udt-os", + 3901: "nimsh", + 3902: "nimaux", + 3903: "charsetmgr", + 3904: "omnilink-port", + 3905: "mupdate", + 3906: "topovista-data", + 3907: "imoguia-port", + 3908: "hppronetman", + 3909: "surfcontrolcpa", + 3910: "prnrequest", + 3911: "prnstatus", + 3912: "gbmt-stars", + 3913: "listcrt-port", + 3914: "listcrt-port-2", + 3915: "agcat", + 3916: "wysdmc", + 3917: "aftmux", + 3918: "pktcablemmcops", + 3919: "hyperip", + 3920: "exasoftport1", + 3921: "herodotus-net", + 3922: "sor-update", + 3923: "symb-sb-port", + 3924: "mpl-gprs-port", + 3925: "zmp", + 3926: "winport", + 3927: "natdataservice", + 3928: "netboot-pxe", + 3929: "smauth-port", + 3930: "syam-webserver", + 3931: "msr-plugin-port", + 3932: "dyn-site", + 3933: "plbserve-port", + 3934: "sunfm-port", + 3935: "sdp-portmapper", + 3936: "mailprox", + 3937: "dvbservdsc", + 3938: "dbcontrol-agent", + 3939: "aamp", + 3940: "xecp-node", + 3941: "homeportal-web", + 3942: "srdp", + 3943: "tig", + 3944: "sops", + 3945: "emcads", + 3946: "backupedge", + 3947: "ccp", + 3948: "apdap", + 3949: "drip", + 3950: "namemunge", + 3951: "pwgippfax", + 3952: "i3-sessionmgr", + 3953: "xmlink-connect", + 3954: "adrep", + 3955: "p2pcommunity", + 3956: "gvcp", + 3957: "mqe-broker", + 3958: "mqe-agent", + 3959: "treehopper", + 3960: "bess", + 3961: "proaxess", + 3962: "sbi-agent", + 3963: "thrp", + 3964: "sasggprs", + 3965: "ati-ip-to-ncpe", + 3966: "bflckmgr", + 3967: "ppsms", + 3968: "ianywhere-dbns", + 3969: "landmarks", + 3970: "lanrevagent", + 3971: "lanrevserver", + 3972: "iconp", + 3973: "progistics", + 3974: "citysearch", + 3975: "airshot", + 3976: "opswagent", + 3977: "opswmanager", + 3978: "secure-cfg-svr", + 3979: "smwan", + 3980: "acms", + 3981: "starfish", + 3982: "eis", + 3983: "eisp", + 3984: "mapper-nodemgr", + 3985: "mapper-mapethd", + 3986: "mapper-ws-ethd", + 3987: "centerline", + 3988: "dcs-config", + 3989: "bv-queryengine", + 3990: "bv-is", + 3991: "bv-smcsrv", + 3992: "bv-ds", + 3993: "bv-agent", + 3995: "iss-mgmt-ssl", + 3996: "abcsoftware", + 3997: "agentsease-db", + 3998: "dnx", + 3999: "nvcnet", + 4000: "terabase", + 4001: "newoak", + 4002: "pxc-spvr-ft", + 4003: "pxc-splr-ft", + 4004: "pxc-roid", + 4005: "pxc-pin", + 4006: "pxc-spvr", + 4007: "pxc-splr", + 4008: "netcheque", + 4009: "chimera-hwm", + 4010: "samsung-unidex", + 4011: "altserviceboot", + 4012: "pda-gate", + 4013: "acl-manager", + 4014: "taiclock", + 4015: "talarian-mcast1", + 4016: "talarian-mcast2", + 4017: "talarian-mcast3", + 4018: "talarian-mcast4", + 4019: "talarian-mcast5", + 4020: "trap", + 4021: "nexus-portal", + 4022: "dnox", + 4023: "esnm-zoning", + 4024: "tnp1-port", + 4025: "partimage", + 4026: "as-debug", + 4027: "bxp", + 4028: "dtserver-port", + 4029: "ip-qsig", + 4030: "jdmn-port", + 4031: "suucp", + 4032: "vrts-auth-port", + 4033: "sanavigator", + 4034: "ubxd", + 4035: "wap-push-http", + 4036: "wap-push-https", + 4037: "ravehd", + 4038: "fazzt-ptp", + 4039: "fazzt-admin", + 4040: "yo-main", + 4041: "houston", + 4042: "ldxp", + 4043: "nirp", + 4044: "ltp", + 4045: "npp", + 4046: "acp-proto", + 4047: "ctp-state", + 4049: "wafs", + 4050: "cisco-wafs", + 4051: "cppdp", + 4052: "interact", + 4053: "ccu-comm-1", + 4054: "ccu-comm-2", + 4055: "ccu-comm-3", + 4056: "lms", + 4057: "wfm", + 4058: "kingfisher", + 4059: "dlms-cosem", + 4060: "dsmeter-iatc", + 4061: "ice-location", + 4062: "ice-slocation", + 4063: "ice-router", + 4064: "ice-srouter", + 4065: "avanti-cdp", + 4066: "pmas", + 4067: "idp", + 4068: "ipfltbcst", + 4069: "minger", + 4070: "tripe", + 4071: "aibkup", + 4072: "zieto-sock", + 4073: "iRAPP", + 4074: "cequint-cityid", + 4075: "perimlan", + 4076: "seraph", + 4078: "cssp", + 4079: "santools", + 4080: "lorica-in", + 4081: "lorica-in-sec", + 4082: "lorica-out", + 4083: "lorica-out-sec", + 4085: "ezmessagesrv", + 4087: "applusservice", + 4088: "npsp", + 4089: "opencore", + 4090: "omasgport", + 4091: "ewinstaller", + 4092: "ewdgs", + 4093: "pvxpluscs", + 4094: "sysrqd", + 4095: "xtgui", + 4096: "bre", + 4097: "patrolview", + 4098: "drmsfsd", + 4099: "dpcp", + 4100: "igo-incognito", + 4101: "brlp-0", + 4102: "brlp-1", + 4103: "brlp-2", + 4104: "brlp-3", + 4105: "shofar", + 4106: "synchronite", + 4107: "j-ac", + 4108: "accel", + 4109: "izm", + 4110: "g2tag", + 4111: "xgrid", + 4112: "apple-vpns-rp", + 4113: "aipn-reg", + 4114: "jomamqmonitor", + 4115: "cds", + 4116: "smartcard-tls", + 4117: "hillrserv", + 4118: "netscript", + 4119: "assuria-slm", + 4121: "e-builder", + 4122: "fprams", + 4123: "z-wave", + 4124: "tigv2", + 4125: "opsview-envoy", + 4126: "ddrepl", + 4127: "unikeypro", + 4128: "nufw", + 4129: "nuauth", + 4130: "fronet", + 4131: "stars", + 4132: "nuts-dem", + 4133: "nuts-bootp", + 4134: "nifty-hmi", + 4135: "cl-db-attach", + 4136: "cl-db-request", + 4137: "cl-db-remote", + 4138: "nettest", + 4139: "thrtx", + 4140: "cedros-fds", + 4141: "oirtgsvc", + 4142: "oidocsvc", + 4143: "oidsr", + 4145: "vvr-control", + 4146: "tgcconnect", + 4147: "vrxpservman", + 4148: "hhb-handheld", + 4149: "agslb", + 4150: "PowerAlert-nsa", + 4151: "menandmice-noh", + 4152: "idig-mux", + 4153: "mbl-battd", + 4154: "atlinks", + 4155: "bzr", + 4156: "stat-results", + 4157: "stat-scanner", + 4158: "stat-cc", + 4159: "nss", + 4160: "jini-discovery", + 4161: "omscontact", + 4162: "omstopology", + 4163: "silverpeakpeer", + 4164: "silverpeakcomm", + 4165: "altcp", + 4166: "joost", + 4167: "ddgn", + 4168: "pslicser", + 4169: "iadt", + 4170: "d-cinema-csp", + 4171: "ml-svnet", + 4172: "pcoip", + 4174: "smcluster", + 4175: "bccp", + 4176: "tl-ipcproxy", + 4177: "wello", + 4178: "storman", + 4179: "MaxumSP", + 4180: "httpx", + 4181: "macbak", + 4182: "pcptcpservice", + 4183: "gmmp", + 4184: "universe-suite", + 4185: "wcpp", + 4186: "boxbackupstore", + 4187: "csc-proxy", + 4188: "vatata", + 4189: "pcep", + 4190: "sieve", + 4192: "azeti", + 4193: "pvxplusio", + 4199: "eims-admin", + 4300: "corelccam", + 4301: "d-data", + 4302: "d-data-control", + 4303: "srcp", + 4304: "owserver", + 4305: "batman", + 4306: "pinghgl", + 4307: "visicron-vs", + 4308: "compx-lockview", + 4309: "dserver", + 4310: "mirrtex", + 4311: "p6ssmc", + 4312: "pscl-mgt", + 4313: "perrla", + 4314: "choiceview-agt", + 4316: "choiceview-clt", + 4320: "fdt-rcatp", + 4321: "rwhois", + 4322: "trim-event", + 4323: "trim-ice", + 4324: "balour", + 4325: "geognosisman", + 4326: "geognosis", + 4327: "jaxer-web", + 4328: "jaxer-manager", + 4329: "publiqare-sync", + 4330: "dey-sapi", + 4331: "ktickets-rest", + 4333: "ahsp", + 4340: "gaia", + 4341: "lisp-data", + 4342: "lisp-cons", + 4343: "unicall", + 4344: "vinainstall", + 4345: "m4-network-as", + 4346: "elanlm", + 4347: "lansurveyor", + 4348: "itose", + 4349: "fsportmap", + 4350: "net-device", + 4351: "plcy-net-svcs", + 4352: "pjlink", + 4353: "f5-iquery", + 4354: "qsnet-trans", + 4355: "qsnet-workst", + 4356: "qsnet-assist", + 4357: "qsnet-cond", + 4358: "qsnet-nucl", + 4359: "omabcastltkm", + 4360: "matrix-vnet", + 4368: "wxbrief", + 4369: "epmd", + 4370: "elpro-tunnel", + 4371: "l2c-control", + 4372: "l2c-data", + 4373: "remctl", + 4374: "psi-ptt", + 4375: "tolteces", + 4376: "bip", + 4377: "cp-spxsvr", + 4378: "cp-spxdpy", + 4379: "ctdb", + 4389: "xandros-cms", + 4390: "wiegand", + 4391: "apwi-imserver", + 4392: "apwi-rxserver", + 4393: "apwi-rxspooler", + 4395: "omnivisionesx", + 4396: "fly", + 4400: "ds-srv", + 4401: "ds-srvr", + 4402: "ds-clnt", + 4403: "ds-user", + 4404: "ds-admin", + 4405: "ds-mail", + 4406: "ds-slp", + 4407: "nacagent", + 4408: "slscc", + 4409: "netcabinet-com", + 4410: "itwo-server", + 4411: "found", + 4425: "netrockey6", + 4426: "beacon-port-2", + 4427: "drizzle", + 4428: "omviserver", + 4429: "omviagent", + 4430: "rsqlserver", + 4431: "wspipe", + 4432: "l-acoustics", + 4433: "vop", + 4442: "saris", + 4443: "pharos", + 4444: "krb524", + 4445: "upnotifyp", + 4446: "n1-fwp", + 4447: "n1-rmgmt", + 4448: "asc-slmd", + 4449: "privatewire", + 4450: "camp", + 4451: "ctisystemmsg", + 4452: "ctiprogramload", + 4453: "nssalertmgr", + 4454: "nssagentmgr", + 4455: "prchat-user", + 4456: "prchat-server", + 4457: "prRegister", + 4458: "mcp", + 4484: "hpssmgmt", + 4485: "assyst-dr", + 4486: "icms", + 4487: "prex-tcp", + 4488: "awacs-ice", + 4500: "ipsec-nat-t", + 4535: "ehs", + 4536: "ehs-ssl", + 4537: "wssauthsvc", + 4538: "swx-gate", + 4545: "worldscores", + 4546: "sf-lm", + 4547: "lanner-lm", + 4548: "synchromesh", + 4549: "aegate", + 4550: "gds-adppiw-db", + 4551: "ieee-mih", + 4552: "menandmice-mon", + 4553: "icshostsvc", + 4554: "msfrs", + 4555: "rsip", + 4556: "dtn-bundle", + 4559: "hylafax", + 4563: "amahi-anywhere", + 4566: "kwtc", + 4567: "tram", + 4568: "bmc-reporting", + 4569: "iax", + 4570: "deploymentmap", + 4590: "rid", + 4591: "l3t-at-an", + 4593: "ipt-anri-anri", + 4594: "ias-session", + 4595: "ias-paging", + 4596: "ias-neighbor", + 4597: "a21-an-1xbs", + 4598: "a16-an-an", + 4599: "a17-an-an", + 4600: "piranha1", + 4601: "piranha2", + 4602: "mtsserver", + 4603: "menandmice-upg", + 4604: "irp", + 4658: "playsta2-app", + 4659: "playsta2-lob", + 4660: "smaclmgr", + 4661: "kar2ouche", + 4662: "oms", + 4663: "noteit", + 4664: "ems", + 4665: "contclientms", + 4666: "eportcomm", + 4667: "mmacomm", + 4668: "mmaeds", + 4669: "eportcommdata", + 4670: "light", + 4671: "acter", + 4672: "rfa", + 4673: "cxws", + 4674: "appiq-mgmt", + 4675: "dhct-status", + 4676: "dhct-alerts", + 4677: "bcs", + 4678: "traversal", + 4679: "mgesupervision", + 4680: "mgemanagement", + 4681: "parliant", + 4682: "finisar", + 4683: "spike", + 4684: "rfid-rp1", + 4685: "autopac", + 4686: "msp-os", + 4687: "nst", + 4688: "mobile-p2p", + 4689: "altovacentral", + 4690: "prelude", + 4691: "mtn", + 4692: "conspiracy", + 4700: "netxms-agent", + 4701: "netxms-mgmt", + 4702: "netxms-sync", + 4703: "npqes-test", + 4704: "assuria-ins", + 4725: "truckstar", + 4727: "fcis", + 4728: "capmux", + 4730: "gearman", + 4731: "remcap", + 4733: "resorcs", + 4737: "ipdr-sp", + 4738: "solera-lpn", + 4739: "ipfix", + 4740: "ipfixs", + 4741: "lumimgrd", + 4742: "sicct", + 4743: "openhpid", + 4744: "ifsp", + 4745: "fmp", + 4749: "profilemac", + 4750: "ssad", + 4751: "spocp", + 4752: "snap", + 4753: "simon", + 4784: "bfd-multi-ctl", + 4786: "smart-install", + 4787: "sia-ctrl-plane", + 4788: "xmcp", + 4800: "iims", + 4801: "iwec", + 4802: "ilss", + 4803: "notateit", + 4827: "htcp", + 4837: "varadero-0", + 4838: "varadero-1", + 4839: "varadero-2", + 4840: "opcua-tcp", + 4841: "quosa", + 4842: "gw-asv", + 4843: "opcua-tls", + 4844: "gw-log", + 4845: "wcr-remlib", + 4846: "contamac-icm", + 4847: "wfc", + 4848: "appserv-http", + 4849: "appserv-https", + 4850: "sun-as-nodeagt", + 4851: "derby-repli", + 4867: "unify-debug", + 4868: "phrelay", + 4869: "phrelaydbg", + 4870: "cc-tracking", + 4871: "wired", + 4876: "tritium-can", + 4877: "lmcs", + 4879: "wsdl-event", + 4880: "hislip", + 4883: "wmlserver", + 4884: "hivestor", + 4885: "abbs", + 4894: "lyskom", + 4899: "radmin-port", + 4900: "hfcs", + 4901: "flr-agent", + 4902: "magiccontrol", + 4912: "lutap", + 4913: "lutcp", + 4914: "bones", + 4915: "frcs", + 4940: "eq-office-4940", + 4941: "eq-office-4941", + 4942: "eq-office-4942", + 4949: "munin", + 4950: "sybasesrvmon", + 4951: "pwgwims", + 4952: "sagxtsds", + 4953: "dbsyncarbiter", + 4969: "ccss-qmm", + 4970: "ccss-qsm", + 4984: "webyast", + 4985: "gerhcs", + 4986: "mrip", + 4987: "smar-se-port1", + 4988: "smar-se-port2", + 4989: "parallel", + 4990: "busycal", + 4991: "vrt", + 4999: "hfcs-manager", + 5000: "commplex-main", + 5001: "commplex-link", + 5002: "rfe", + 5003: "fmpro-internal", + 5004: "avt-profile-1", + 5005: "avt-profile-2", + 5006: "wsm-server", + 5007: "wsm-server-ssl", + 5008: "synapsis-edge", + 5009: "winfs", + 5010: "telelpathstart", + 5011: "telelpathattack", + 5012: "nsp", + 5013: "fmpro-v6", + 5015: "fmwp", + 5020: "zenginkyo-1", + 5021: "zenginkyo-2", + 5022: "mice", + 5023: "htuilsrv", + 5024: "scpi-telnet", + 5025: "scpi-raw", + 5026: "strexec-d", + 5027: "strexec-s", + 5028: "qvr", + 5029: "infobright", + 5030: "surfpass", + 5032: "signacert-agent", + 5042: "asnaacceler8db", + 5043: "swxadmin", + 5044: "lxi-evntsvc", + 5045: "osp", + 5048: "texai", + 5049: "ivocalize", + 5050: "mmcc", + 5051: "ita-agent", + 5052: "ita-manager", + 5053: "rlm", + 5054: "rlm-admin", + 5055: "unot", + 5056: "intecom-ps1", + 5057: "intecom-ps2", + 5059: "sds", + 5060: "sip", + 5061: "sips", + 5062: "na-localise", + 5063: "csrpc", + 5064: "ca-1", + 5065: "ca-2", + 5066: "stanag-5066", + 5067: "authentx", + 5068: "bitforestsrv", + 5069: "i-net-2000-npr", + 5070: "vtsas", + 5071: "powerschool", + 5072: "ayiya", + 5073: "tag-pm", + 5074: "alesquery", + 5075: "pvaccess", + 5080: "onscreen", + 5081: "sdl-ets", + 5082: "qcp", + 5083: "qfp", + 5084: "llrp", + 5085: "encrypted-llrp", + 5086: "aprigo-cs", + 5087: "biotic", + 5093: "sentinel-lm", + 5094: "hart-ip", + 5099: "sentlm-srv2srv", + 5100: "socalia", + 5101: "talarian-tcp", + 5102: "oms-nonsecure", + 5103: "actifio-c2c", + 5106: "actifioudsagent", + 5111: "taep-as-svc", + 5112: "pm-cmdsvr", + 5114: "ev-services", + 5115: "autobuild", + 5117: "gradecam", + 5120: "barracuda-bbs", + 5133: "nbt-pc", + 5134: "ppactivation", + 5135: "erp-scale", + 5137: "ctsd", + 5145: "rmonitor-secure", + 5146: "social-alarm", + 5150: "atmp", + 5151: "esri-sde", + 5152: "sde-discovery", + 5153: "toruxserver", + 5154: "bzflag", + 5155: "asctrl-agent", + 5156: "rugameonline", + 5157: "mediat", + 5161: "snmpssh", + 5162: "snmpssh-trap", + 5163: "sbackup", + 5164: "vpa", + 5165: "ife-icorp", + 5166: "winpcs", + 5167: "scte104", + 5168: "scte30", + 5172: "pcoip-mgmt", + 5190: "aol", + 5191: "aol-1", + 5192: "aol-2", + 5193: "aol-3", + 5194: "cpscomm", + 5195: "ampl-lic", + 5196: "ampl-tableproxy", + 5200: "targus-getdata", + 5201: "targus-getdata1", + 5202: "targus-getdata2", + 5203: "targus-getdata3", + 5209: "nomad", + 5215: "noteza", + 5221: "3exmp", + 5222: "xmpp-client", + 5223: "hpvirtgrp", + 5224: "hpvirtctrl", + 5225: "hp-server", + 5226: "hp-status", + 5227: "perfd", + 5228: "hpvroom", + 5229: "jaxflow", + 5230: "jaxflow-data", + 5231: "crusecontrol", + 5232: "csedaemon", + 5233: "enfs", + 5234: "eenet", + 5235: "galaxy-network", + 5236: "padl2sim", + 5237: "mnet-discovery", + 5245: "downtools", + 5248: "caacws", + 5249: "caaclang2", + 5250: "soagateway", + 5251: "caevms", + 5252: "movaz-ssc", + 5253: "kpdp", + 5264: "3com-njack-1", + 5265: "3com-njack-2", + 5269: "xmpp-server", + 5270: "cartographerxmp", + 5271: "cuelink", + 5272: "pk", + 5280: "xmpp-bosh", + 5281: "undo-lm", + 5282: "transmit-port", + 5298: "presence", + 5299: "nlg-data", + 5300: "hacl-hb", + 5301: "hacl-gs", + 5302: "hacl-cfg", + 5303: "hacl-probe", + 5304: "hacl-local", + 5305: "hacl-test", + 5306: "sun-mc-grp", + 5307: "sco-aip", + 5308: "cfengine", + 5309: "jprinter", + 5310: "outlaws", + 5312: "permabit-cs", + 5313: "rrdp", + 5314: "opalis-rbt-ipc", + 5315: "hacl-poll", + 5316: "hpbladems", + 5317: "hpdevms", + 5318: "pkix-cmc", + 5320: "bsfserver-zn", + 5321: "bsfsvr-zn-ssl", + 5343: "kfserver", + 5344: "xkotodrcp", + 5349: "stuns", + 5352: "dns-llq", + 5353: "mdns", + 5354: "mdnsresponder", + 5355: "llmnr", + 5356: "ms-smlbiz", + 5357: "wsdapi", + 5358: "wsdapi-s", + 5359: "ms-alerter", + 5360: "ms-sideshow", + 5361: "ms-s-sideshow", + 5362: "serverwsd2", + 5363: "net-projection", + 5397: "stresstester", + 5398: "elektron-admin", + 5399: "securitychase", + 5400: "excerpt", + 5401: "excerpts", + 5402: "mftp", + 5403: "hpoms-ci-lstn", + 5404: "hpoms-dps-lstn", + 5405: "netsupport", + 5406: "systemics-sox", + 5407: "foresyte-clear", + 5408: "foresyte-sec", + 5409: "salient-dtasrv", + 5410: "salient-usrmgr", + 5411: "actnet", + 5412: "continuus", + 5413: "wwiotalk", + 5414: "statusd", + 5415: "ns-server", + 5416: "sns-gateway", + 5417: "sns-agent", + 5418: "mcntp", + 5419: "dj-ice", + 5420: "cylink-c", + 5421: "netsupport2", + 5422: "salient-mux", + 5423: "virtualuser", + 5424: "beyond-remote", + 5425: "br-channel", + 5426: "devbasic", + 5427: "sco-peer-tta", + 5428: "telaconsole", + 5429: "base", + 5430: "radec-corp", + 5431: "park-agent", + 5432: "postgresql", + 5433: "pyrrho", + 5434: "sgi-arrayd", + 5435: "sceanics", + 5443: "spss", + 5445: "smbdirect", + 5453: "surebox", + 5454: "apc-5454", + 5455: "apc-5455", + 5456: "apc-5456", + 5461: "silkmeter", + 5462: "ttl-publisher", + 5463: "ttlpriceproxy", + 5464: "quailnet", + 5465: "netops-broker", + 5500: "fcp-addr-srvr1", + 5501: "fcp-addr-srvr2", + 5502: "fcp-srvr-inst1", + 5503: "fcp-srvr-inst2", + 5504: "fcp-cics-gw1", + 5505: "checkoutdb", + 5506: "amc", + 5553: "sgi-eventmond", + 5554: "sgi-esphttp", + 5555: "personal-agent", + 5556: "freeciv", + 5557: "farenet", + 5566: "westec-connect", + 5567: "enc-eps-mc-sec", + 5568: "sdt", + 5569: "rdmnet-ctrl", + 5573: "sdmmp", + 5574: "lsi-bobcat", + 5575: "ora-oap", + 5579: "fdtracks", + 5580: "tmosms0", + 5581: "tmosms1", + 5582: "fac-restore", + 5583: "tmo-icon-sync", + 5584: "bis-web", + 5585: "bis-sync", + 5586: "att-mt-sms", + 5597: "ininmessaging", + 5598: "mctfeed", + 5599: "esinstall", + 5600: "esmmanager", + 5601: "esmagent", + 5602: "a1-msc", + 5603: "a1-bs", + 5604: "a3-sdunode", + 5605: "a4-sdunode", + 5618: "efr", + 5627: "ninaf", + 5628: "htrust", + 5629: "symantec-sfdb", + 5630: "precise-comm", + 5631: "pcanywheredata", + 5632: "pcanywherestat", + 5633: "beorl", + 5634: "xprtld", + 5635: "sfmsso", + 5636: "sfm-db-server", + 5637: "cssc", + 5638: "flcrs", + 5639: "ics", + 5646: "vfmobile", + 5670: "filemq", + 5671: "amqps", + 5672: "amqp", + 5673: "jms", + 5674: "hyperscsi-port", + 5675: "v5ua", + 5676: "raadmin", + 5677: "questdb2-lnchr", + 5678: "rrac", + 5679: "dccm", + 5680: "auriga-router", + 5681: "ncxcp", + 5688: "ggz", + 5689: "qmvideo", + 5693: "rbsystem", + 5696: "kmip", + 5713: "proshareaudio", + 5714: "prosharevideo", + 5715: "prosharedata", + 5716: "prosharerequest", + 5717: "prosharenotify", + 5718: "dpm", + 5719: "dpm-agent", + 5720: "ms-licensing", + 5721: "dtpt", + 5722: "msdfsr", + 5723: "omhs", + 5724: "omsdk", + 5725: "ms-ilm", + 5726: "ms-ilm-sts", + 5727: "asgenf", + 5728: "io-dist-data", + 5729: "openmail", + 5730: "unieng", + 5741: "ida-discover1", + 5742: "ida-discover2", + 5743: "watchdoc-pod", + 5744: "watchdoc", + 5745: "fcopy-server", + 5746: "fcopys-server", + 5747: "tunatic", + 5748: "tunalyzer", + 5750: "rscd", + 5755: "openmailg", + 5757: "x500ms", + 5766: "openmailns", + 5767: "s-openmail", + 5768: "openmailpxy", + 5769: "spramsca", + 5770: "spramsd", + 5771: "netagent", + 5777: "dali-port", + 5780: "vts-rpc", + 5781: "3par-evts", + 5782: "3par-mgmt", + 5783: "3par-mgmt-ssl", + 5785: "3par-rcopy", + 5793: "xtreamx", + 5813: "icmpd", + 5814: "spt-automation", + 5841: "shiprush-d-ch", + 5842: "reversion", + 5859: "wherehoo", + 5863: "ppsuitemsg", + 5868: "diameters", + 5883: "jute", + 5900: "rfb", + 5910: "cm", + 5911: "cpdlc", + 5912: "fis", + 5913: "ads-c", + 5963: "indy", + 5968: "mppolicy-v5", + 5969: "mppolicy-mgr", + 5984: "couchdb", + 5985: "wsman", + 5986: "wsmans", + 5987: "wbem-rmi", + 5988: "wbem-http", + 5989: "wbem-https", + 5990: "wbem-exp-https", + 5991: "nuxsl", + 5992: "consul-insight", + 5999: "cvsup", + 6064: "ndl-ahp-svc", + 6065: "winpharaoh", + 6066: "ewctsp", + 6068: "gsmp-ancp", + 6069: "trip", + 6070: "messageasap", + 6071: "ssdtp", + 6072: "diagnose-proc", + 6073: "directplay8", + 6074: "max", + 6075: "dpm-acm", + 6076: "msft-dpm-cert", + 6077: "iconstructsrv", + 6084: "reload-config", + 6085: "konspire2b", + 6086: "pdtp", + 6087: "ldss", + 6088: "doglms", + 6099: "raxa-mgmt", + 6100: "synchronet-db", + 6101: "synchronet-rtc", + 6102: "synchronet-upd", + 6103: "rets", + 6104: "dbdb", + 6105: "primaserver", + 6106: "mpsserver", + 6107: "etc-control", + 6108: "sercomm-scadmin", + 6109: "globecast-id", + 6110: "softcm", + 6111: "spc", + 6112: "dtspcd", + 6113: "dayliteserver", + 6114: "wrspice", + 6115: "xic", + 6116: "xtlserv", + 6117: "daylitetouch", + 6121: "spdy", + 6122: "bex-webadmin", + 6123: "backup-express", + 6124: "pnbs", + 6130: "damewaremobgtwy", + 6133: "nbt-wol", + 6140: "pulsonixnls", + 6141: "meta-corp", + 6142: "aspentec-lm", + 6143: "watershed-lm", + 6144: "statsci1-lm", + 6145: "statsci2-lm", + 6146: "lonewolf-lm", + 6147: "montage-lm", + 6148: "ricardo-lm", + 6149: "tal-pod", + 6159: "efb-aci", + 6160: "ecmp", + 6161: "patrol-ism", + 6162: "patrol-coll", + 6163: "pscribe", + 6200: "lm-x", + 6222: "radmind", + 6241: "jeol-nsdtp-1", + 6242: "jeol-nsdtp-2", + 6243: "jeol-nsdtp-3", + 6244: "jeol-nsdtp-4", + 6251: "tl1-raw-ssl", + 6252: "tl1-ssh", + 6253: "crip", + 6267: "gld", + 6268: "grid", + 6269: "grid-alt", + 6300: "bmc-grx", + 6301: "bmc-ctd-ldap", + 6306: "ufmp", + 6315: "scup", + 6316: "abb-escp", + 6317: "nav-data-cmd", + 6320: "repsvc", + 6321: "emp-server1", + 6322: "emp-server2", + 6324: "hrd-ncs", + 6325: "dt-mgmtsvc", + 6326: "dt-vra", + 6343: "sflow", + 6344: "streletz", + 6346: "gnutella-svc", + 6347: "gnutella-rtr", + 6350: "adap", + 6355: "pmcs", + 6360: "metaedit-mu", + 6370: "metaedit-se", + 6382: "metatude-mds", + 6389: "clariion-evr01", + 6390: "metaedit-ws", + 6417: "faxcomservice", + 6418: "syserverremote", + 6419: "svdrp", + 6420: "nim-vdrshell", + 6421: "nim-wan", + 6432: "pgbouncer", + 6442: "tarp", + 6443: "sun-sr-https", + 6444: "sge-qmaster", + 6445: "sge-execd", + 6446: "mysql-proxy", + 6455: "skip-cert-recv", + 6456: "skip-cert-send", + 6471: "lvision-lm", + 6480: "sun-sr-http", + 6481: "servicetags", + 6482: "ldoms-mgmt", + 6483: "SunVTS-RMI", + 6484: "sun-sr-jms", + 6485: "sun-sr-iiop", + 6486: "sun-sr-iiops", + 6487: "sun-sr-iiop-aut", + 6488: "sun-sr-jmx", + 6489: "sun-sr-admin", + 6500: "boks", + 6501: "boks-servc", + 6502: "boks-servm", + 6503: "boks-clntd", + 6505: "badm-priv", + 6506: "badm-pub", + 6507: "bdir-priv", + 6508: "bdir-pub", + 6509: "mgcs-mfp-port", + 6510: "mcer-port", + 6513: "netconf-tls", + 6514: "syslog-tls", + 6515: "elipse-rec", + 6543: "lds-distrib", + 6544: "lds-dump", + 6547: "apc-6547", + 6548: "apc-6548", + 6549: "apc-6549", + 6550: "fg-sysupdate", + 6551: "sum", + 6558: "xdsxdm", + 6566: "sane-port", + 6568: "canit-store", + 6579: "affiliate", + 6580: "parsec-master", + 6581: "parsec-peer", + 6582: "parsec-game", + 6583: "joaJewelSuite", + 6600: "mshvlm", + 6601: "mstmg-sstp", + 6602: "wsscomfrmwk", + 6619: "odette-ftps", + 6620: "kftp-data", + 6621: "kftp", + 6622: "mcftp", + 6623: "ktelnet", + 6624: "datascaler-db", + 6625: "datascaler-ctl", + 6626: "wago-service", + 6627: "nexgen", + 6628: "afesc-mc", + 6632: "mxodbc-connect", + 6640: "ovsdb", + 6653: "openflow", + 6655: "pcs-sf-ui-man", + 6656: "emgmsg", + 6670: "vocaltec-gold", + 6671: "p4p-portal", + 6672: "vision-server", + 6673: "vision-elmd", + 6678: "vfbp", + 6679: "osaut", + 6687: "clever-ctrace", + 6688: "clever-tcpip", + 6689: "tsa", + 6697: "ircs-u", + 6701: "kti-icad-srvr", + 6702: "e-design-net", + 6703: "e-design-web", + 6714: "ibprotocol", + 6715: "fibotrader-com", + 6716: "printercare-cc", + 6767: "bmc-perf-agent", + 6768: "bmc-perf-mgrd", + 6769: "adi-gxp-srvprt", + 6770: "plysrv-http", + 6771: "plysrv-https", + 6777: "ntz-tracker", + 6778: "ntz-p2p-storage", + 6785: "dgpf-exchg", + 6786: "smc-jmx", + 6787: "smc-admin", + 6788: "smc-http", + 6789: "smc-https", + 6790: "hnmp", + 6791: "hnm", + 6801: "acnet", + 6817: "pentbox-sim", + 6831: "ambit-lm", + 6841: "netmo-default", + 6842: "netmo-http", + 6850: "iccrushmore", + 6868: "acctopus-cc", + 6888: "muse", + 6901: "jetstream", + 6935: "ethoscan", + 6936: "xsmsvc", + 6946: "bioserver", + 6951: "otlp", + 6961: "jmact3", + 6962: "jmevt2", + 6963: "swismgr1", + 6964: "swismgr2", + 6965: "swistrap", + 6966: "swispol", + 6969: "acmsoda", + 6997: "MobilitySrv", + 6998: "iatp-highpri", + 6999: "iatp-normalpri", + 7000: "afs3-fileserver", + 7001: "afs3-callback", + 7002: "afs3-prserver", + 7003: "afs3-vlserver", + 7004: "afs3-kaserver", + 7005: "afs3-volser", + 7006: "afs3-errors", + 7007: "afs3-bos", + 7008: "afs3-update", + 7009: "afs3-rmtsys", + 7010: "ups-onlinet", + 7011: "talon-disc", + 7012: "talon-engine", + 7013: "microtalon-dis", + 7014: "microtalon-com", + 7015: "talon-webserver", + 7018: "fisa-svc", + 7019: "doceri-ctl", + 7020: "dpserve", + 7021: "dpserveadmin", + 7022: "ctdp", + 7023: "ct2nmcs", + 7024: "vmsvc", + 7025: "vmsvc-2", + 7030: "op-probe", + 7031: "iposplanet", + 7070: "arcp", + 7071: "iwg1", + 7073: "martalk", + 7080: "empowerid", + 7099: "lazy-ptop", + 7100: "font-service", + 7101: "elcn", + 7121: "virprot-lm", + 7128: "scenidm", + 7129: "scenccs", + 7161: "cabsm-comm", + 7162: "caistoragemgr", + 7163: "cacsambroker", + 7164: "fsr", + 7165: "doc-server", + 7166: "aruba-server", + 7167: "casrmagent", + 7168: "cnckadserver", + 7169: "ccag-pib", + 7170: "nsrp", + 7171: "drm-production", + 7172: "metalbend", + 7173: "zsecure", + 7174: "clutild", + 7200: "fodms", + 7201: "dlip", + 7227: "ramp", + 7228: "citrixupp", + 7229: "citrixuppg", + 7236: "display", + 7237: "pads", + 7262: "cnap", + 7272: "watchme-7272", + 7273: "oma-rlp", + 7274: "oma-rlp-s", + 7275: "oma-ulp", + 7276: "oma-ilp", + 7277: "oma-ilp-s", + 7278: "oma-dcdocbs", + 7279: "ctxlic", + 7280: "itactionserver1", + 7281: "itactionserver2", + 7282: "mzca-action", + 7283: "genstat", + 7365: "lcm-server", + 7391: "mindfilesys", + 7392: "mrssrendezvous", + 7393: "nfoldman", + 7394: "fse", + 7395: "winqedit", + 7397: "hexarc", + 7400: "rtps-discovery", + 7401: "rtps-dd-ut", + 7402: "rtps-dd-mt", + 7410: "ionixnetmon", + 7411: "daqstream", + 7421: "mtportmon", + 7426: "pmdmgr", + 7427: "oveadmgr", + 7428: "ovladmgr", + 7429: "opi-sock", + 7430: "xmpv7", + 7431: "pmd", + 7437: "faximum", + 7443: "oracleas-https", + 7471: "sttunnel", + 7473: "rise", + 7474: "neo4j", + 7491: "telops-lmd", + 7500: "silhouette", + 7501: "ovbus", + 7508: "adcp", + 7509: "acplt", + 7510: "ovhpas", + 7511: "pafec-lm", + 7542: "saratoga", + 7543: "atul", + 7544: "nta-ds", + 7545: "nta-us", + 7546: "cfs", + 7547: "cwmp", + 7548: "tidp", + 7549: "nls-tl", + 7560: "sncp", + 7563: "cfw", + 7566: "vsi-omega", + 7569: "dell-eql-asm", + 7570: "aries-kfinder", + 7574: "coherence", + 7588: "sun-lm", + 7624: "indi", + 7626: "simco", + 7627: "soap-http", + 7628: "zen-pawn", + 7629: "xdas", + 7630: "hawk", + 7631: "tesla-sys-msg", + 7633: "pmdfmgt", + 7648: "cuseeme", + 7672: "imqstomp", + 7673: "imqstomps", + 7674: "imqtunnels", + 7675: "imqtunnel", + 7676: "imqbrokerd", + 7677: "sun-user-https", + 7680: "pando-pub", + 7689: "collaber", + 7697: "klio", + 7700: "em7-secom", + 7707: "sync-em7", + 7708: "scinet", + 7720: "medimageportal", + 7724: "nsdeepfreezectl", + 7725: "nitrogen", + 7726: "freezexservice", + 7727: "trident-data", + 7734: "smip", + 7738: "aiagent", + 7741: "scriptview", + 7742: "msss", + 7743: "sstp-1", + 7744: "raqmon-pdu", + 7747: "prgp", + 7777: "cbt", + 7778: "interwise", + 7779: "vstat", + 7781: "accu-lmgr", + 7786: "minivend", + 7787: "popup-reminders", + 7789: "office-tools", + 7794: "q3ade", + 7797: "pnet-conn", + 7798: "pnet-enc", + 7799: "altbsdp", + 7800: "asr", + 7801: "ssp-client", + 7810: "rbt-wanopt", + 7845: "apc-7845", + 7846: "apc-7846", + 7847: "csoauth", + 7869: "mobileanalyzer", + 7870: "rbt-smc", + 7871: "mdm", + 7878: "owms", + 7880: "pss", + 7887: "ubroker", + 7900: "mevent", + 7901: "tnos-sp", + 7902: "tnos-dp", + 7903: "tnos-dps", + 7913: "qo-secure", + 7932: "t2-drm", + 7933: "t2-brm", + 7962: "generalsync", + 7967: "supercell", + 7979: "micromuse-ncps", + 7980: "quest-vista", + 7981: "sossd-collect", + 7982: "sossd-agent", + 7997: "pushns", + 7999: "irdmi2", + 8000: "irdmi", + 8001: "vcom-tunnel", + 8002: "teradataordbms", + 8003: "mcreport", + 8005: "mxi", + 8008: "http-alt", + 8019: "qbdb", + 8020: "intu-ec-svcdisc", + 8021: "intu-ec-client", + 8022: "oa-system", + 8025: "ca-audit-da", + 8026: "ca-audit-ds", + 8032: "pro-ed", + 8033: "mindprint", + 8034: "vantronix-mgmt", + 8040: "ampify", + 8042: "fs-agent", + 8043: "fs-server", + 8044: "fs-mgmt", + 8051: "rocrail", + 8052: "senomix01", + 8053: "senomix02", + 8054: "senomix03", + 8055: "senomix04", + 8056: "senomix05", + 8057: "senomix06", + 8058: "senomix07", + 8059: "senomix08", + 8066: "toad-bi-appsrvr", + 8074: "gadugadu", + 8080: "http-alt", + 8081: "sunproxyadmin", + 8082: "us-cli", + 8083: "us-srv", + 8086: "d-s-n", + 8087: "simplifymedia", + 8088: "radan-http", + 8091: "jamlink", + 8097: "sac", + 8100: "xprint-server", + 8101: "ldoms-migr", + 8102: "kz-migr", + 8115: "mtl8000-matrix", + 8116: "cp-cluster", + 8117: "purityrpc", + 8118: "privoxy", + 8121: "apollo-data", + 8122: "apollo-admin", + 8128: "paycash-online", + 8129: "paycash-wbp", + 8130: "indigo-vrmi", + 8131: "indigo-vbcp", + 8132: "dbabble", + 8148: "isdd", + 8153: "quantastor", + 8160: "patrol", + 8161: "patrol-snmp", + 8162: "lpar2rrd", + 8181: "intermapper", + 8182: "vmware-fdm", + 8183: "proremote", + 8184: "itach", + 8191: "limnerpressure", + 8192: "spytechphone", + 8194: "blp1", + 8195: "blp2", + 8199: "vvr-data", + 8200: "trivnet1", + 8201: "trivnet2", + 8204: "lm-perfworks", + 8205: "lm-instmgr", + 8206: "lm-dta", + 8207: "lm-sserver", + 8208: "lm-webwatcher", + 8230: "rexecj", + 8243: "synapse-nhttps", + 8276: "pando-sec", + 8280: "synapse-nhttp", + 8292: "blp3", + 8293: "hiperscan-id", + 8294: "blp4", + 8300: "tmi", + 8301: "amberon", + 8313: "hub-open-net", + 8320: "tnp-discover", + 8321: "tnp", + 8351: "server-find", + 8376: "cruise-enum", + 8377: "cruise-swroute", + 8378: "cruise-config", + 8379: "cruise-diags", + 8380: "cruise-update", + 8383: "m2mservices", + 8400: "cvd", + 8401: "sabarsd", + 8402: "abarsd", + 8403: "admind", + 8404: "svcloud", + 8405: "svbackup", + 8415: "dlpx-sp", + 8416: "espeech", + 8417: "espeech-rtp", + 8442: "cybro-a-bus", + 8443: "pcsync-https", + 8444: "pcsync-http", + 8445: "copy", + 8450: "npmp", + 8457: "nexentamv", + 8470: "cisco-avp", + 8471: "pim-port", + 8472: "otv", + 8473: "vp2p", + 8474: "noteshare", + 8500: "fmtp", + 8501: "cmtp-mgt", + 8502: "ftnmtp", + 8554: "rtsp-alt", + 8555: "d-fence", + 8567: "enc-tunnel", + 8600: "asterix", + 8610: "canon-mfnp", + 8611: "canon-bjnp1", + 8612: "canon-bjnp2", + 8613: "canon-bjnp3", + 8614: "canon-bjnp4", + 8615: "imink", + 8665: "monetra", + 8666: "monetra-admin", + 8675: "msi-cps-rm", + 8686: "sun-as-jmxrmi", + 8688: "openremote-ctrl", + 8699: "vnyx", + 8711: "nvc", + 8733: "ibus", + 8750: "dey-keyneg", + 8763: "mc-appserver", + 8764: "openqueue", + 8765: "ultraseek-http", + 8766: "amcs", + 8770: "dpap", + 8778: "uec", + 8786: "msgclnt", + 8787: "msgsrvr", + 8793: "acd-pm", + 8800: "sunwebadmin", + 8804: "truecm", + 8873: "dxspider", + 8880: "cddbp-alt", + 8881: "galaxy4d", + 8883: "secure-mqtt", + 8888: "ddi-tcp-1", + 8889: "ddi-tcp-2", + 8890: "ddi-tcp-3", + 8891: "ddi-tcp-4", + 8892: "ddi-tcp-5", + 8893: "ddi-tcp-6", + 8894: "ddi-tcp-7", + 8899: "ospf-lite", + 8900: "jmb-cds1", + 8901: "jmb-cds2", + 8910: "manyone-http", + 8911: "manyone-xml", + 8912: "wcbackup", + 8913: "dragonfly", + 8937: "twds", + 8953: "ub-dns-control", + 8954: "cumulus-admin", + 8989: "sunwebadmins", + 8990: "http-wmap", + 8991: "https-wmap", + 8998: "canto-roboflow", + 8999: "bctp", + 9000: "cslistener", + 9001: "etlservicemgr", + 9002: "dynamid", + 9008: "ogs-server", + 9009: "pichat", + 9010: "sdr", + 9020: "tambora", + 9021: "panagolin-ident", + 9022: "paragent", + 9023: "swa-1", + 9024: "swa-2", + 9025: "swa-3", + 9026: "swa-4", + 9050: "versiera", + 9051: "fio-cmgmt", + 9080: "glrpc", + 9083: "emc-pp-mgmtsvc", + 9084: "aurora", + 9085: "ibm-rsyscon", + 9086: "net2display", + 9087: "classic", + 9088: "sqlexec", + 9089: "sqlexec-ssl", + 9090: "websm", + 9091: "xmltec-xmlmail", + 9092: "XmlIpcRegSvc", + 9093: "copycat", + 9100: "hp-pdl-datastr", + 9101: "bacula-dir", + 9102: "bacula-fd", + 9103: "bacula-sd", + 9104: "peerwire", + 9105: "xadmin", + 9106: "astergate", + 9107: "astergatefax", + 9119: "mxit", + 9122: "grcmp", + 9123: "grcp", + 9131: "dddp", + 9160: "apani1", + 9161: "apani2", + 9162: "apani3", + 9163: "apani4", + 9164: "apani5", + 9191: "sun-as-jpda", + 9200: "wap-wsp", + 9201: "wap-wsp-wtp", + 9202: "wap-wsp-s", + 9203: "wap-wsp-wtp-s", + 9204: "wap-vcard", + 9205: "wap-vcal", + 9206: "wap-vcard-s", + 9207: "wap-vcal-s", + 9208: "rjcdb-vcards", + 9209: "almobile-system", + 9210: "oma-mlp", + 9211: "oma-mlp-s", + 9212: "serverviewdbms", + 9213: "serverstart", + 9214: "ipdcesgbs", + 9215: "insis", + 9216: "acme", + 9217: "fsc-port", + 9222: "teamcoherence", + 9255: "mon", + 9278: "pegasus", + 9279: "pegasus-ctl", + 9280: "pgps", + 9281: "swtp-port1", + 9282: "swtp-port2", + 9283: "callwaveiam", + 9284: "visd", + 9285: "n2h2server", + 9287: "cumulus", + 9292: "armtechdaemon", + 9293: "storview", + 9294: "armcenterhttp", + 9295: "armcenterhttps", + 9300: "vrace", + 9306: "sphinxql", + 9312: "sphinxapi", + 9318: "secure-ts", + 9321: "guibase", + 9343: "mpidcmgr", + 9344: "mphlpdmc", + 9346: "ctechlicensing", + 9374: "fjdmimgr", + 9380: "boxp", + 9387: "d2dconfig", + 9388: "d2ddatatrans", + 9389: "adws", + 9390: "otp", + 9396: "fjinvmgr", + 9397: "mpidcagt", + 9400: "sec-t4net-srv", + 9401: "sec-t4net-clt", + 9402: "sec-pc2fax-srv", + 9418: "git", + 9443: "tungsten-https", + 9444: "wso2esb-console", + 9445: "mindarray-ca", + 9450: "sntlkeyssrvr", + 9500: "ismserver", + 9535: "mngsuite", + 9536: "laes-bf", + 9555: "trispen-sra", + 9592: "ldgateway", + 9593: "cba8", + 9594: "msgsys", + 9595: "pds", + 9596: "mercury-disc", + 9597: "pd-admin", + 9598: "vscp", + 9599: "robix", + 9600: "micromuse-ncpw", + 9612: "streamcomm-ds", + 9614: "iadt-tls", + 9616: "erunbook-agent", + 9617: "erunbook-server", + 9618: "condor", + 9628: "odbcpathway", + 9629: "uniport", + 9630: "peoctlr", + 9631: "peocoll", + 9640: "pqsflows", + 9666: "zoomcp", + 9667: "xmms2", + 9668: "tec5-sdctp", + 9694: "client-wakeup", + 9695: "ccnx", + 9700: "board-roar", + 9747: "l5nas-parchan", + 9750: "board-voip", + 9753: "rasadv", + 9762: "tungsten-http", + 9800: "davsrc", + 9801: "sstp-2", + 9802: "davsrcs", + 9875: "sapv1", + 9876: "sd", + 9888: "cyborg-systems", + 9889: "gt-proxy", + 9898: "monkeycom", + 9900: "iua", + 9909: "domaintime", + 9911: "sype-transport", + 9925: "xybrid-cloud", + 9950: "apc-9950", + 9951: "apc-9951", + 9952: "apc-9952", + 9953: "acis", + 9954: "hinp", + 9955: "alljoyn-stm", + 9966: "odnsp", + 9978: "xybrid-rt", + 9987: "dsm-scm-target", + 9988: "nsesrvr", + 9990: "osm-appsrvr", + 9991: "osm-oev", + 9992: "palace-1", + 9993: "palace-2", + 9994: "palace-3", + 9995: "palace-4", + 9996: "palace-5", + 9997: "palace-6", + 9998: "distinct32", + 9999: "distinct", + 10000: "ndmp", + 10001: "scp-config", + 10002: "documentum", + 10003: "documentum-s", + 10004: "emcrmirccd", + 10005: "emcrmird", + 10006: "netapp-sync", + 10007: "mvs-capacity", + 10008: "octopus", + 10009: "swdtp-sv", + 10010: "rxapi", + 10050: "zabbix-agent", + 10051: "zabbix-trapper", + 10055: "qptlmd", + 10080: "amanda", + 10081: "famdc", + 10100: "itap-ddtp", + 10101: "ezmeeting-2", + 10102: "ezproxy-2", + 10103: "ezrelay", + 10104: "swdtp", + 10107: "bctp-server", + 10110: "nmea-0183", + 10113: "netiq-endpoint", + 10114: "netiq-qcheck", + 10115: "netiq-endpt", + 10116: "netiq-voipa", + 10117: "iqrm", + 10128: "bmc-perf-sd", + 10129: "bmc-gms", + 10160: "qb-db-server", + 10161: "snmptls", + 10162: "snmptls-trap", + 10200: "trisoap", + 10201: "rsms", + 10252: "apollo-relay", + 10260: "axis-wimp-port", + 10288: "blocks", + 10321: "cosir", + 10540: "MOS-lower", + 10541: "MOS-upper", + 10542: "MOS-aux", + 10543: "MOS-soap", + 10544: "MOS-soap-opt", + 10631: "printopia", + 10800: "gap", + 10805: "lpdg", + 10809: "nbd", + 10860: "helix", + 10880: "bveapi", + 10990: "rmiaux", + 11000: "irisa", + 11001: "metasys", + 11095: "weave", + 11103: "origo-sync", + 11104: "netapp-icmgmt", + 11105: "netapp-icdata", + 11106: "sgi-lk", + 11109: "sgi-dmfmgr", + 11110: "sgi-soap", + 11111: "vce", + 11112: "dicom", + 11161: "suncacao-snmp", + 11162: "suncacao-jmxmp", + 11163: "suncacao-rmi", + 11164: "suncacao-csa", + 11165: "suncacao-websvc", + 11172: "oemcacao-jmxmp", + 11173: "t5-straton", + 11174: "oemcacao-rmi", + 11175: "oemcacao-websvc", + 11201: "smsqp", + 11202: "dcsl-backup", + 11208: "wifree", + 11211: "memcache", + 11319: "imip", + 11320: "imip-channels", + 11321: "arena-server", + 11367: "atm-uhas", + 11371: "hkp", + 11489: "asgcypresstcps", + 11600: "tempest-port", + 11623: "emc-xsw-dconfig", + 11720: "h323callsigalt", + 11723: "emc-xsw-dcache", + 11751: "intrepid-ssl", + 11796: "lanschool", + 11876: "xoraya", + 11967: "sysinfo-sp", + 12000: "entextxid", + 12001: "entextnetwk", + 12002: "entexthigh", + 12003: "entextmed", + 12004: "entextlow", + 12005: "dbisamserver1", + 12006: "dbisamserver2", + 12007: "accuracer", + 12008: "accuracer-dbms", + 12010: "edbsrvr", + 12012: "vipera", + 12013: "vipera-ssl", + 12109: "rets-ssl", + 12121: "nupaper-ss", + 12168: "cawas", + 12172: "hivep", + 12300: "linogridengine", + 12302: "rads", + 12321: "warehouse-sss", + 12322: "warehouse", + 12345: "italk", + 12753: "tsaf", + 12865: "netperf", + 13160: "i-zipqd", + 13216: "bcslogc", + 13217: "rs-pias", + 13218: "emc-vcas-tcp", + 13223: "powwow-client", + 13224: "powwow-server", + 13400: "doip-data", + 13720: "bprd", + 13721: "bpdbm", + 13722: "bpjava-msvc", + 13724: "vnetd", + 13782: "bpcd", + 13783: "vopied", + 13785: "nbdb", + 13786: "nomdb", + 13818: "dsmcc-config", + 13819: "dsmcc-session", + 13820: "dsmcc-passthru", + 13821: "dsmcc-download", + 13822: "dsmcc-ccp", + 13823: "bmdss", + 13894: "ucontrol", + 13929: "dta-systems", + 13930: "medevolve", + 14000: "scotty-ft", + 14001: "sua", + 14033: "sage-best-com1", + 14034: "sage-best-com2", + 14141: "vcs-app", + 14142: "icpp", + 14145: "gcm-app", + 14149: "vrts-tdd", + 14150: "vcscmd", + 14154: "vad", + 14250: "cps", + 14414: "ca-web-update", + 14936: "hde-lcesrvr-1", + 14937: "hde-lcesrvr-2", + 15000: "hydap", + 15002: "onep-tls", + 15345: "xpilot", + 15363: "3link", + 15555: "cisco-snat", + 15660: "bex-xr", + 15740: "ptp", + 15999: "programmar", + 16000: "fmsas", + 16001: "fmsascon", + 16002: "gsms", + 16020: "jwpc", + 16021: "jwpc-bin", + 16161: "sun-sea-port", + 16162: "solaris-audit", + 16309: "etb4j", + 16310: "pduncs", + 16311: "pdefmns", + 16360: "netserialext1", + 16361: "netserialext2", + 16367: "netserialext3", + 16368: "netserialext4", + 16384: "connected", + 16619: "xoms", + 16900: "newbay-snc-mc", + 16950: "sgcip", + 16991: "intel-rci-mp", + 16992: "amt-soap-http", + 16993: "amt-soap-https", + 16994: "amt-redir-tcp", + 16995: "amt-redir-tls", + 17007: "isode-dua", + 17184: "vestasdlp", + 17185: "soundsvirtual", + 17219: "chipper", + 17220: "avtp", + 17221: "avdecc", + 17234: "integrius-stp", + 17235: "ssh-mgmt", + 17500: "db-lsp", + 17555: "ailith", + 17729: "ea", + 17754: "zep", + 17755: "zigbee-ip", + 17756: "zigbee-ips", + 17777: "sw-orion", + 18000: "biimenu", + 18104: "radpdf", + 18136: "racf", + 18181: "opsec-cvp", + 18182: "opsec-ufp", + 18183: "opsec-sam", + 18184: "opsec-lea", + 18185: "opsec-omi", + 18186: "ohsc", + 18187: "opsec-ela", + 18241: "checkpoint-rtm", + 18242: "iclid", + 18243: "clusterxl", + 18262: "gv-pf", + 18463: "ac-cluster", + 18634: "rds-ib", + 18635: "rds-ip", + 18769: "ique", + 18881: "infotos", + 18888: "apc-necmp", + 19000: "igrid", + 19007: "scintilla", + 19020: "j-link", + 19191: "opsec-uaa", + 19194: "ua-secureagent", + 19283: "keysrvr", + 19315: "keyshadow", + 19398: "mtrgtrans", + 19410: "hp-sco", + 19411: "hp-sca", + 19412: "hp-sessmon", + 19539: "fxuptp", + 19540: "sxuptp", + 19541: "jcp", + 19998: "iec-104-sec", + 19999: "dnp-sec", + 20000: "dnp", + 20001: "microsan", + 20002: "commtact-http", + 20003: "commtact-https", + 20005: "openwebnet", + 20013: "ss-idi", + 20014: "opendeploy", + 20034: "nburn-id", + 20046: "tmophl7mts", + 20048: "mountd", + 20049: "nfsrdma", + 20167: "tolfab", + 20202: "ipdtp-port", + 20222: "ipulse-ics", + 20480: "emwavemsg", + 20670: "track", + 20999: "athand-mmp", + 21000: "irtrans", + 21010: "notezilla-lan", + 21553: "rdm-tfs", + 21554: "dfserver", + 21590: "vofr-gateway", + 21800: "tvpm", + 21845: "webphone", + 21846: "netspeak-is", + 21847: "netspeak-cs", + 21848: "netspeak-acd", + 21849: "netspeak-cps", + 22000: "snapenetio", + 22001: "optocontrol", + 22002: "optohost002", + 22003: "optohost003", + 22004: "optohost004", + 22005: "optohost004", + 22125: "dcap", + 22128: "gsidcap", + 22222: "easyengine", + 22273: "wnn6", + 22305: "cis", + 22343: "cis-secure", + 22347: "wibukey", + 22350: "codemeter", + 22351: "codemeter-cmwan", + 22537: "caldsoft-backup", + 22555: "vocaltec-wconf", + 22763: "talikaserver", + 22800: "aws-brf", + 22951: "brf-gw", + 23000: "inovaport1", + 23001: "inovaport2", + 23002: "inovaport3", + 23003: "inovaport4", + 23004: "inovaport5", + 23005: "inovaport6", + 23053: "gntp", + 23333: "elxmgmt", + 23400: "novar-dbase", + 23401: "novar-alarm", + 23402: "novar-global", + 23456: "aequus", + 23457: "aequus-alt", + 23546: "areaguard-neo", + 24000: "med-ltp", + 24001: "med-fsp-rx", + 24002: "med-fsp-tx", + 24003: "med-supp", + 24004: "med-ovw", + 24005: "med-ci", + 24006: "med-net-svc", + 24242: "filesphere", + 24249: "vista-4gl", + 24321: "ild", + 24386: "intel-rci", + 24465: "tonidods", + 24554: "binkp", + 24577: "bilobit", + 24676: "canditv", + 24677: "flashfiler", + 24678: "proactivate", + 24680: "tcc-http", + 24754: "cslg", + 24922: "find", + 25000: "icl-twobase1", + 25001: "icl-twobase2", + 25002: "icl-twobase3", + 25003: "icl-twobase4", + 25004: "icl-twobase5", + 25005: "icl-twobase6", + 25006: "icl-twobase7", + 25007: "icl-twobase8", + 25008: "icl-twobase9", + 25009: "icl-twobase10", + 25576: "sauterdongle", + 25604: "idtp", + 25793: "vocaltec-hos", + 25900: "tasp-net", + 25901: "niobserver", + 25902: "nilinkanalyst", + 25903: "niprobe", + 26000: "quake", + 26133: "scscp", + 26208: "wnn6-ds", + 26260: "ezproxy", + 26261: "ezmeeting", + 26262: "k3software-svr", + 26263: "k3software-cli", + 26486: "exoline-tcp", + 26487: "exoconfig", + 26489: "exonet", + 27345: "imagepump", + 27442: "jesmsjc", + 27504: "kopek-httphead", + 27782: "ars-vista", + 27876: "astrolink", + 27999: "tw-auth-key", + 28000: "nxlmd", + 28001: "pqsp", + 28200: "voxelstorm", + 28240: "siemensgsm", + 29167: "otmp", + 29999: "bingbang", + 30000: "ndmps", + 30001: "pago-services1", + 30002: "pago-services2", + 30003: "amicon-fpsu-ra", + 30260: "kingdomsonline", + 30999: "ovobs", + 31020: "autotrac-acp", + 31400: "pace-licensed", + 31416: "xqosd", + 31457: "tetrinet", + 31620: "lm-mon", + 31685: "dsx-monitor", + 31765: "gamesmith-port", + 31948: "iceedcp-tx", + 31949: "iceedcp-rx", + 32034: "iracinghelper", + 32249: "t1distproc60", + 32483: "apm-link", + 32635: "sec-ntb-clnt", + 32636: "DMExpress", + 32767: "filenet-powsrm", + 32768: "filenet-tms", + 32769: "filenet-rpc", + 32770: "filenet-nch", + 32771: "filenet-rmi", + 32772: "filenet-pa", + 32773: "filenet-cm", + 32774: "filenet-re", + 32775: "filenet-pch", + 32776: "filenet-peior", + 32777: "filenet-obrok", + 32801: "mlsn", + 32811: "retp", + 32896: "idmgratm", + 33123: "aurora-balaena", + 33331: "diamondport", + 33333: "dgi-serv", + 33334: "speedtrace", + 33434: "traceroute", + 33656: "snip-slave", + 34249: "turbonote-2", + 34378: "p-net-local", + 34379: "p-net-remote", + 34567: "dhanalakshmi", + 34962: "profinet-rt", + 34963: "profinet-rtm", + 34964: "profinet-cm", + 34980: "ethercat", + 35000: "heathview", + 35001: "rt-viewer", + 35002: "rt-sound", + 35003: "rt-devicemapper", + 35004: "rt-classmanager", + 35005: "rt-labtracker", + 35006: "rt-helper", + 35354: "kitim", + 35355: "altova-lm", + 35356: "guttersnex", + 35357: "openstack-id", + 36001: "allpeers", + 36524: "febooti-aw", + 36602: "observium-agent", + 36865: "kastenxpipe", + 37475: "neckar", + 37483: "gdrive-sync", + 37654: "unisys-eportal", + 38000: "ivs-database", + 38001: "ivs-insertion", + 38201: "galaxy7-data", + 38202: "fairview", + 38203: "agpolicy", + 38800: "sruth", + 38865: "secrmmsafecopya", + 39681: "turbonote-1", + 40000: "safetynetp", + 40404: "sptx", + 40841: "cscp", + 40842: "csccredir", + 40843: "csccfirewall", + 41111: "fs-qos", + 41121: "tentacle", + 41794: "crestron-cip", + 41795: "crestron-ctp", + 41796: "crestron-cips", + 41797: "crestron-ctps", + 42508: "candp", + 42509: "candrp", + 42510: "caerpc", + 43000: "recvr-rc", + 43188: "reachout", + 43189: "ndm-agent-port", + 43190: "ip-provision", + 43191: "noit-transport", + 43210: "shaperai", + 43439: "eq3-update", + 43440: "ew-mgmt", + 43441: "ciscocsdb", + 44123: "z-wave-s", + 44321: "pmcd", + 44322: "pmcdproxy", + 44323: "pmwebapi", + 44444: "cognex-dataman", + 44553: "rbr-debug", + 44818: "EtherNet-IP-2", + 44900: "m3da", + 45000: "asmp", + 45001: "asmps", + 45045: "synctest", + 45054: "invision-ag", + 45678: "eba", + 45824: "dai-shell", + 45825: "qdb2service", + 45966: "ssr-servermgr", + 46998: "spremotetablet", + 46999: "mediabox", + 47000: "mbus", + 47001: "winrm", + 47557: "dbbrowse", + 47624: "directplaysrvr", + 47806: "ap", + 47808: "bacnet", + 48000: "nimcontroller", + 48001: "nimspooler", + 48002: "nimhub", + 48003: "nimgtw", + 48004: "nimbusdb", + 48005: "nimbusdbctrl", + 48049: "3gpp-cbsp", + 48050: "weandsf", + 48128: "isnetserv", + 48129: "blp5", + 48556: "com-bardac-dw", + 48619: "iqobject", + 48653: "robotraconteur", + 49000: "matahari", +} +var udpPortNames = map[UDPPort]string{ + 1: "tcpmux", + 2: "compressnet", + 3: "compressnet", + 5: "rje", + 7: "echo", + 9: "discard", + 11: "systat", + 13: "daytime", + 17: "qotd", + 18: "msp", + 19: "chargen", + 20: "ftp-data", + 21: "ftp", + 22: "ssh", + 23: "telnet", + 25: "smtp", + 27: "nsw-fe", + 29: "msg-icp", + 31: "msg-auth", + 33: "dsp", + 37: "time", + 38: "rap", + 39: "rlp", + 41: "graphics", + 42: "name", + 43: "nicname", + 44: "mpm-flags", + 45: "mpm", + 46: "mpm-snd", + 47: "ni-ftp", + 48: "auditd", + 49: "tacacs", + 50: "re-mail-ck", + 52: "xns-time", + 53: "domain", + 54: "xns-ch", + 55: "isi-gl", + 56: "xns-auth", + 58: "xns-mail", + 61: "ni-mail", + 62: "acas", + 63: "whoispp", + 64: "covia", + 65: "tacacs-ds", + 66: "sql-net", + 67: "bootps", + 68: "bootpc", + 69: "tftp", + 70: "gopher", + 71: "netrjs-1", + 72: "netrjs-2", + 73: "netrjs-3", + 74: "netrjs-4", + 76: "deos", + 78: "vettcp", + 79: "finger", + 80: "http", + 82: "xfer", + 83: "mit-ml-dev", + 84: "ctf", + 85: "mit-ml-dev", + 86: "mfcobol", + 88: "kerberos", + 89: "su-mit-tg", + 90: "dnsix", + 91: "mit-dov", + 92: "npp", + 93: "dcp", + 94: "objcall", + 95: "supdup", + 96: "dixie", + 97: "swift-rvf", + 98: "tacnews", + 99: "metagram", + 101: "hostname", + 102: "iso-tsap", + 103: "gppitnp", + 104: "acr-nema", + 105: "cso", + 106: "3com-tsmux", + 107: "rtelnet", + 108: "snagas", + 109: "pop2", + 110: "pop3", + 111: "sunrpc", + 112: "mcidas", + 113: "auth", + 115: "sftp", + 116: "ansanotify", + 117: "uucp-path", + 118: "sqlserv", + 119: "nntp", + 120: "cfdptkt", + 121: "erpc", + 122: "smakynet", + 123: "ntp", + 124: "ansatrader", + 125: "locus-map", + 126: "nxedit", + 127: "locus-con", + 128: "gss-xlicen", + 129: "pwdgen", + 130: "cisco-fna", + 131: "cisco-tna", + 132: "cisco-sys", + 133: "statsrv", + 134: "ingres-net", + 135: "epmap", + 136: "profile", + 137: "netbios-ns", + 138: "netbios-dgm", + 139: "netbios-ssn", + 140: "emfis-data", + 141: "emfis-cntl", + 142: "bl-idm", + 143: "imap", + 144: "uma", + 145: "uaac", + 146: "iso-tp0", + 147: "iso-ip", + 148: "jargon", + 149: "aed-512", + 150: "sql-net", + 151: "hems", + 152: "bftp", + 153: "sgmp", + 154: "netsc-prod", + 155: "netsc-dev", + 156: "sqlsrv", + 157: "knet-cmp", + 158: "pcmail-srv", + 159: "nss-routing", + 160: "sgmp-traps", + 161: "snmp", + 162: "snmptrap", + 163: "cmip-man", + 164: "cmip-agent", + 165: "xns-courier", + 166: "s-net", + 167: "namp", + 168: "rsvd", + 169: "send", + 170: "print-srv", + 171: "multiplex", + 172: "cl-1", + 173: "xyplex-mux", + 174: "mailq", + 175: "vmnet", + 176: "genrad-mux", + 177: "xdmcp", + 178: "nextstep", + 179: "bgp", + 180: "ris", + 181: "unify", + 182: "audit", + 183: "ocbinder", + 184: "ocserver", + 185: "remote-kis", + 186: "kis", + 187: "aci", + 188: "mumps", + 189: "qft", + 190: "gacp", + 191: "prospero", + 192: "osu-nms", + 193: "srmp", + 194: "irc", + 195: "dn6-nlm-aud", + 196: "dn6-smm-red", + 197: "dls", + 198: "dls-mon", + 199: "smux", + 200: "src", + 201: "at-rtmp", + 202: "at-nbp", + 203: "at-3", + 204: "at-echo", + 205: "at-5", + 206: "at-zis", + 207: "at-7", + 208: "at-8", + 209: "qmtp", + 210: "z39-50", + 211: "914c-g", + 212: "anet", + 213: "ipx", + 214: "vmpwscs", + 215: "softpc", + 216: "CAIlic", + 217: "dbase", + 218: "mpp", + 219: "uarps", + 220: "imap3", + 221: "fln-spx", + 222: "rsh-spx", + 223: "cdc", + 224: "masqdialer", + 242: "direct", + 243: "sur-meas", + 244: "inbusiness", + 245: "link", + 246: "dsp3270", + 247: "subntbcst-tftp", + 248: "bhfhs", + 256: "rap", + 257: "set", + 259: "esro-gen", + 260: "openport", + 261: "nsiiops", + 262: "arcisdms", + 263: "hdap", + 264: "bgmp", + 265: "x-bone-ctl", + 266: "sst", + 267: "td-service", + 268: "td-replica", + 269: "manet", + 270: "gist", + 280: "http-mgmt", + 281: "personal-link", + 282: "cableport-ax", + 283: "rescap", + 284: "corerjd", + 286: "fxp", + 287: "k-block", + 308: "novastorbakcup", + 309: "entrusttime", + 310: "bhmds", + 311: "asip-webadmin", + 312: "vslmp", + 313: "magenta-logic", + 314: "opalis-robot", + 315: "dpsi", + 316: "decauth", + 317: "zannet", + 318: "pkix-timestamp", + 319: "ptp-event", + 320: "ptp-general", + 321: "pip", + 322: "rtsps", + 333: "texar", + 344: "pdap", + 345: "pawserv", + 346: "zserv", + 347: "fatserv", + 348: "csi-sgwp", + 349: "mftp", + 350: "matip-type-a", + 351: "matip-type-b", + 352: "dtag-ste-sb", + 353: "ndsauth", + 354: "bh611", + 355: "datex-asn", + 356: "cloanto-net-1", + 357: "bhevent", + 358: "shrinkwrap", + 359: "nsrmp", + 360: "scoi2odialog", + 361: "semantix", + 362: "srssend", + 363: "rsvp-tunnel", + 364: "aurora-cmgr", + 365: "dtk", + 366: "odmr", + 367: "mortgageware", + 368: "qbikgdp", + 369: "rpc2portmap", + 370: "codaauth2", + 371: "clearcase", + 372: "ulistproc", + 373: "legent-1", + 374: "legent-2", + 375: "hassle", + 376: "nip", + 377: "tnETOS", + 378: "dsETOS", + 379: "is99c", + 380: "is99s", + 381: "hp-collector", + 382: "hp-managed-node", + 383: "hp-alarm-mgr", + 384: "arns", + 385: "ibm-app", + 386: "asa", + 387: "aurp", + 388: "unidata-ldm", + 389: "ldap", + 390: "uis", + 391: "synotics-relay", + 392: "synotics-broker", + 393: "meta5", + 394: "embl-ndt", + 395: "netcp", + 396: "netware-ip", + 397: "mptn", + 398: "kryptolan", + 399: "iso-tsap-c2", + 400: "osb-sd", + 401: "ups", + 402: "genie", + 403: "decap", + 404: "nced", + 405: "ncld", + 406: "imsp", + 407: "timbuktu", + 408: "prm-sm", + 409: "prm-nm", + 410: "decladebug", + 411: "rmt", + 412: "synoptics-trap", + 413: "smsp", + 414: "infoseek", + 415: "bnet", + 416: "silverplatter", + 417: "onmux", + 418: "hyper-g", + 419: "ariel1", + 420: "smpte", + 421: "ariel2", + 422: "ariel3", + 423: "opc-job-start", + 424: "opc-job-track", + 425: "icad-el", + 426: "smartsdp", + 427: "svrloc", + 428: "ocs-cmu", + 429: "ocs-amu", + 430: "utmpsd", + 431: "utmpcd", + 432: "iasd", + 433: "nnsp", + 434: "mobileip-agent", + 435: "mobilip-mn", + 436: "dna-cml", + 437: "comscm", + 438: "dsfgw", + 439: "dasp", + 440: "sgcp", + 441: "decvms-sysmgt", + 442: "cvc-hostd", + 443: "https", + 444: "snpp", + 445: "microsoft-ds", + 446: "ddm-rdb", + 447: "ddm-dfm", + 448: "ddm-ssl", + 449: "as-servermap", + 450: "tserver", + 451: "sfs-smp-net", + 452: "sfs-config", + 453: "creativeserver", + 454: "contentserver", + 455: "creativepartnr", + 456: "macon-udp", + 457: "scohelp", + 458: "appleqtc", + 459: "ampr-rcmd", + 460: "skronk", + 461: "datasurfsrv", + 462: "datasurfsrvsec", + 463: "alpes", + 464: "kpasswd", + 465: "igmpv3lite", + 466: "digital-vrc", + 467: "mylex-mapd", + 468: "photuris", + 469: "rcp", + 470: "scx-proxy", + 471: "mondex", + 472: "ljk-login", + 473: "hybrid-pop", + 474: "tn-tl-w2", + 475: "tcpnethaspsrv", + 476: "tn-tl-fd1", + 477: "ss7ns", + 478: "spsc", + 479: "iafserver", + 480: "iafdbase", + 481: "ph", + 482: "bgs-nsi", + 483: "ulpnet", + 484: "integra-sme", + 485: "powerburst", + 486: "avian", + 487: "saft", + 488: "gss-http", + 489: "nest-protocol", + 490: "micom-pfs", + 491: "go-login", + 492: "ticf-1", + 493: "ticf-2", + 494: "pov-ray", + 495: "intecourier", + 496: "pim-rp-disc", + 497: "retrospect", + 498: "siam", + 499: "iso-ill", + 500: "isakmp", + 501: "stmf", + 502: "mbap", + 503: "intrinsa", + 504: "citadel", + 505: "mailbox-lm", + 506: "ohimsrv", + 507: "crs", + 508: "xvttp", + 509: "snare", + 510: "fcp", + 511: "passgo", + 512: "comsat", + 513: "who", + 514: "syslog", + 515: "printer", + 516: "videotex", + 517: "talk", + 518: "ntalk", + 519: "utime", + 520: "router", + 521: "ripng", + 522: "ulp", + 523: "ibm-db2", + 524: "ncp", + 525: "timed", + 526: "tempo", + 527: "stx", + 528: "custix", + 529: "irc-serv", + 530: "courier", + 531: "conference", + 532: "netnews", + 533: "netwall", + 534: "windream", + 535: "iiop", + 536: "opalis-rdv", + 537: "nmsp", + 538: "gdomap", + 539: "apertus-ldp", + 540: "uucp", + 541: "uucp-rlogin", + 542: "commerce", + 543: "klogin", + 544: "kshell", + 545: "appleqtcsrvr", + 546: "dhcpv6-client", + 547: "dhcpv6-server", + 548: "afpovertcp", + 549: "idfp", + 550: "new-rwho", + 551: "cybercash", + 552: "devshr-nts", + 553: "pirp", + 554: "rtsp", + 555: "dsf", + 556: "remotefs", + 557: "openvms-sysipc", + 558: "sdnskmp", + 559: "teedtap", + 560: "rmonitor", + 561: "monitor", + 562: "chshell", + 563: "nntps", + 564: "9pfs", + 565: "whoami", + 566: "streettalk", + 567: "banyan-rpc", + 568: "ms-shuttle", + 569: "ms-rome", + 570: "meter", + 571: "meter", + 572: "sonar", + 573: "banyan-vip", + 574: "ftp-agent", + 575: "vemmi", + 576: "ipcd", + 577: "vnas", + 578: "ipdd", + 579: "decbsrv", + 580: "sntp-heartbeat", + 581: "bdp", + 582: "scc-security", + 583: "philips-vc", + 584: "keyserver", + 586: "password-chg", + 587: "submission", + 588: "cal", + 589: "eyelink", + 590: "tns-cml", + 591: "http-alt", + 592: "eudora-set", + 593: "http-rpc-epmap", + 594: "tpip", + 595: "cab-protocol", + 596: "smsd", + 597: "ptcnameservice", + 598: "sco-websrvrmg3", + 599: "acp", + 600: "ipcserver", + 601: "syslog-conn", + 602: "xmlrpc-beep", + 603: "idxp", + 604: "tunnel", + 605: "soap-beep", + 606: "urm", + 607: "nqs", + 608: "sift-uft", + 609: "npmp-trap", + 610: "npmp-local", + 611: "npmp-gui", + 612: "hmmp-ind", + 613: "hmmp-op", + 614: "sshell", + 615: "sco-inetmgr", + 616: "sco-sysmgr", + 617: "sco-dtmgr", + 618: "dei-icda", + 619: "compaq-evm", + 620: "sco-websrvrmgr", + 621: "escp-ip", + 622: "collaborator", + 623: "asf-rmcp", + 624: "cryptoadmin", + 625: "dec-dlm", + 626: "asia", + 627: "passgo-tivoli", + 628: "qmqp", + 629: "3com-amp3", + 630: "rda", + 631: "ipp", + 632: "bmpp", + 633: "servstat", + 634: "ginad", + 635: "rlzdbase", + 636: "ldaps", + 637: "lanserver", + 638: "mcns-sec", + 639: "msdp", + 640: "entrust-sps", + 641: "repcmd", + 642: "esro-emsdp", + 643: "sanity", + 644: "dwr", + 645: "pssc", + 646: "ldp", + 647: "dhcp-failover", + 648: "rrp", + 649: "cadview-3d", + 650: "obex", + 651: "ieee-mms", + 652: "hello-port", + 653: "repscmd", + 654: "aodv", + 655: "tinc", + 656: "spmp", + 657: "rmc", + 658: "tenfold", + 660: "mac-srvr-admin", + 661: "hap", + 662: "pftp", + 663: "purenoise", + 664: "asf-secure-rmcp", + 665: "sun-dr", + 666: "mdqs", + 667: "disclose", + 668: "mecomm", + 669: "meregister", + 670: "vacdsm-sws", + 671: "vacdsm-app", + 672: "vpps-qua", + 673: "cimplex", + 674: "acap", + 675: "dctp", + 676: "vpps-via", + 677: "vpp", + 678: "ggf-ncp", + 679: "mrm", + 680: "entrust-aaas", + 681: "entrust-aams", + 682: "xfr", + 683: "corba-iiop", + 684: "corba-iiop-ssl", + 685: "mdc-portmapper", + 686: "hcp-wismar", + 687: "asipregistry", + 688: "realm-rusd", + 689: "nmap", + 690: "vatp", + 691: "msexch-routing", + 692: "hyperwave-isp", + 693: "connendp", + 694: "ha-cluster", + 695: "ieee-mms-ssl", + 696: "rushd", + 697: "uuidgen", + 698: "olsr", + 699: "accessnetwork", + 700: "epp", + 701: "lmp", + 702: "iris-beep", + 704: "elcsd", + 705: "agentx", + 706: "silc", + 707: "borland-dsj", + 709: "entrust-kmsh", + 710: "entrust-ash", + 711: "cisco-tdp", + 712: "tbrpf", + 713: "iris-xpc", + 714: "iris-xpcs", + 715: "iris-lwz", + 716: "pana", + 729: "netviewdm1", + 730: "netviewdm2", + 731: "netviewdm3", + 741: "netgw", + 742: "netrcs", + 744: "flexlm", + 747: "fujitsu-dev", + 748: "ris-cm", + 749: "kerberos-adm", + 750: "loadav", + 751: "pump", + 752: "qrh", + 753: "rrh", + 754: "tell", + 758: "nlogin", + 759: "con", + 760: "ns", + 761: "rxe", + 762: "quotad", + 763: "cycleserv", + 764: "omserv", + 765: "webster", + 767: "phonebook", + 769: "vid", + 770: "cadlock", + 771: "rtip", + 772: "cycleserv2", + 773: "notify", + 774: "acmaint-dbd", + 775: "acmaint-transd", + 776: "wpages", + 777: "multiling-http", + 780: "wpgs", + 800: "mdbs-daemon", + 801: "device", + 802: "mbap-s", + 810: "fcp-udp", + 828: "itm-mcell-s", + 829: "pkix-3-ca-ra", + 830: "netconf-ssh", + 831: "netconf-beep", + 832: "netconfsoaphttp", + 833: "netconfsoapbeep", + 847: "dhcp-failover2", + 848: "gdoi", + 860: "iscsi", + 861: "owamp-control", + 862: "twamp-control", + 873: "rsync", + 886: "iclcnet-locate", + 887: "iclcnet-svinfo", + 888: "accessbuilder", + 900: "omginitialrefs", + 901: "smpnameres", + 902: "ideafarm-door", + 903: "ideafarm-panic", + 910: "kink", + 911: "xact-backup", + 912: "apex-mesh", + 913: "apex-edge", + 989: "ftps-data", + 990: "ftps", + 991: "nas", + 992: "telnets", + 993: "imaps", + 995: "pop3s", + 996: "vsinet", + 997: "maitrd", + 998: "puparp", + 999: "applix", + 1000: "cadlock2", + 1010: "surf", + 1021: "exp1", + 1022: "exp2", + 1025: "blackjack", + 1026: "cap", + 1027: "6a44", + 1029: "solid-mux", + 1033: "netinfo-local", + 1034: "activesync", + 1035: "mxxrlogin", + 1036: "nsstp", + 1037: "ams", + 1038: "mtqp", + 1039: "sbl", + 1040: "netarx", + 1041: "danf-ak2", + 1042: "afrog", + 1043: "boinc-client", + 1044: "dcutility", + 1045: "fpitp", + 1046: "wfremotertm", + 1047: "neod1", + 1048: "neod2", + 1049: "td-postman", + 1050: "cma", + 1051: "optima-vnet", + 1052: "ddt", + 1053: "remote-as", + 1054: "brvread", + 1055: "ansyslmd", + 1056: "vfo", + 1057: "startron", + 1058: "nim", + 1059: "nimreg", + 1060: "polestar", + 1061: "kiosk", + 1062: "veracity", + 1063: "kyoceranetdev", + 1064: "jstel", + 1065: "syscomlan", + 1066: "fpo-fns", + 1067: "instl-boots", + 1068: "instl-bootc", + 1069: "cognex-insight", + 1070: "gmrupdateserv", + 1071: "bsquare-voip", + 1072: "cardax", + 1073: "bridgecontrol", + 1074: "warmspotMgmt", + 1075: "rdrmshc", + 1076: "dab-sti-c", + 1077: "imgames", + 1078: "avocent-proxy", + 1079: "asprovatalk", + 1080: "socks", + 1081: "pvuniwien", + 1082: "amt-esd-prot", + 1083: "ansoft-lm-1", + 1084: "ansoft-lm-2", + 1085: "webobjects", + 1086: "cplscrambler-lg", + 1087: "cplscrambler-in", + 1088: "cplscrambler-al", + 1089: "ff-annunc", + 1090: "ff-fms", + 1091: "ff-sm", + 1092: "obrpd", + 1093: "proofd", + 1094: "rootd", + 1095: "nicelink", + 1096: "cnrprotocol", + 1097: "sunclustermgr", + 1098: "rmiactivation", + 1099: "rmiregistry", + 1100: "mctp", + 1101: "pt2-discover", + 1102: "adobeserver-1", + 1103: "adobeserver-2", + 1104: "xrl", + 1105: "ftranhc", + 1106: "isoipsigport-1", + 1107: "isoipsigport-2", + 1108: "ratio-adp", + 1110: "nfsd-keepalive", + 1111: "lmsocialserver", + 1112: "icp", + 1113: "ltp-deepspace", + 1114: "mini-sql", + 1115: "ardus-trns", + 1116: "ardus-cntl", + 1117: "ardus-mtrns", + 1118: "sacred", + 1119: "bnetgame", + 1120: "bnetfile", + 1121: "rmpp", + 1122: "availant-mgr", + 1123: "murray", + 1124: "hpvmmcontrol", + 1125: "hpvmmagent", + 1126: "hpvmmdata", + 1127: "kwdb-commn", + 1128: "saphostctrl", + 1129: "saphostctrls", + 1130: "casp", + 1131: "caspssl", + 1132: "kvm-via-ip", + 1133: "dfn", + 1134: "aplx", + 1135: "omnivision", + 1136: "hhb-gateway", + 1137: "trim", + 1138: "encrypted-admin", + 1139: "evm", + 1140: "autonoc", + 1141: "mxomss", + 1142: "edtools", + 1143: "imyx", + 1144: "fuscript", + 1145: "x9-icue", + 1146: "audit-transfer", + 1147: "capioverlan", + 1148: "elfiq-repl", + 1149: "bvtsonar", + 1150: "blaze", + 1151: "unizensus", + 1152: "winpoplanmess", + 1153: "c1222-acse", + 1154: "resacommunity", + 1155: "nfa", + 1156: "iascontrol-oms", + 1157: "iascontrol", + 1158: "dbcontrol-oms", + 1159: "oracle-oms", + 1160: "olsv", + 1161: "health-polling", + 1162: "health-trap", + 1163: "sddp", + 1164: "qsm-proxy", + 1165: "qsm-gui", + 1166: "qsm-remote", + 1167: "cisco-ipsla", + 1168: "vchat", + 1169: "tripwire", + 1170: "atc-lm", + 1171: "atc-appserver", + 1172: "dnap", + 1173: "d-cinema-rrp", + 1174: "fnet-remote-ui", + 1175: "dossier", + 1176: "indigo-server", + 1177: "dkmessenger", + 1178: "sgi-storman", + 1179: "b2n", + 1180: "mc-client", + 1181: "3comnetman", + 1182: "accelenet-data", + 1183: "llsurfup-http", + 1184: "llsurfup-https", + 1185: "catchpole", + 1186: "mysql-cluster", + 1187: "alias", + 1188: "hp-webadmin", + 1189: "unet", + 1190: "commlinx-avl", + 1191: "gpfs", + 1192: "caids-sensor", + 1193: "fiveacross", + 1194: "openvpn", + 1195: "rsf-1", + 1196: "netmagic", + 1197: "carrius-rshell", + 1198: "cajo-discovery", + 1199: "dmidi", + 1200: "scol", + 1201: "nucleus-sand", + 1202: "caiccipc", + 1203: "ssslic-mgr", + 1204: "ssslog-mgr", + 1205: "accord-mgc", + 1206: "anthony-data", + 1207: "metasage", + 1208: "seagull-ais", + 1209: "ipcd3", + 1210: "eoss", + 1211: "groove-dpp", + 1212: "lupa", + 1213: "mpc-lifenet", + 1214: "kazaa", + 1215: "scanstat-1", + 1216: "etebac5", + 1217: "hpss-ndapi", + 1218: "aeroflight-ads", + 1219: "aeroflight-ret", + 1220: "qt-serveradmin", + 1221: "sweetware-apps", + 1222: "nerv", + 1223: "tgp", + 1224: "vpnz", + 1225: "slinkysearch", + 1226: "stgxfws", + 1227: "dns2go", + 1228: "florence", + 1229: "zented", + 1230: "periscope", + 1231: "menandmice-lpm", + 1232: "first-defense", + 1233: "univ-appserver", + 1234: "search-agent", + 1235: "mosaicsyssvc1", + 1236: "bvcontrol", + 1237: "tsdos390", + 1238: "hacl-qs", + 1239: "nmsd", + 1240: "instantia", + 1241: "nessus", + 1242: "nmasoverip", + 1243: "serialgateway", + 1244: "isbconference1", + 1245: "isbconference2", + 1246: "payrouter", + 1247: "visionpyramid", + 1248: "hermes", + 1249: "mesavistaco", + 1250: "swldy-sias", + 1251: "servergraph", + 1252: "bspne-pcc", + 1253: "q55-pcc", + 1254: "de-noc", + 1255: "de-cache-query", + 1256: "de-server", + 1257: "shockwave2", + 1258: "opennl", + 1259: "opennl-voice", + 1260: "ibm-ssd", + 1261: "mpshrsv", + 1262: "qnts-orb", + 1263: "dka", + 1264: "prat", + 1265: "dssiapi", + 1266: "dellpwrappks", + 1267: "epc", + 1268: "propel-msgsys", + 1269: "watilapp", + 1270: "opsmgr", + 1271: "excw", + 1272: "cspmlockmgr", + 1273: "emc-gateway", + 1274: "t1distproc", + 1275: "ivcollector", + 1277: "miva-mqs", + 1278: "dellwebadmin-1", + 1279: "dellwebadmin-2", + 1280: "pictrography", + 1281: "healthd", + 1282: "emperion", + 1283: "productinfo", + 1284: "iee-qfx", + 1285: "neoiface", + 1286: "netuitive", + 1287: "routematch", + 1288: "navbuddy", + 1289: "jwalkserver", + 1290: "winjaserver", + 1291: "seagulllms", + 1292: "dsdn", + 1293: "pkt-krb-ipsec", + 1294: "cmmdriver", + 1295: "ehtp", + 1296: "dproxy", + 1297: "sdproxy", + 1298: "lpcp", + 1299: "hp-sci", + 1300: "h323hostcallsc", + 1301: "ci3-software-1", + 1302: "ci3-software-2", + 1303: "sftsrv", + 1304: "boomerang", + 1305: "pe-mike", + 1306: "re-conn-proto", + 1307: "pacmand", + 1308: "odsi", + 1309: "jtag-server", + 1310: "husky", + 1311: "rxmon", + 1312: "sti-envision", + 1313: "bmc-patroldb", + 1314: "pdps", + 1315: "els", + 1316: "exbit-escp", + 1317: "vrts-ipcserver", + 1318: "krb5gatekeeper", + 1319: "amx-icsp", + 1320: "amx-axbnet", + 1321: "pip", + 1322: "novation", + 1323: "brcd", + 1324: "delta-mcp", + 1325: "dx-instrument", + 1326: "wimsic", + 1327: "ultrex", + 1328: "ewall", + 1329: "netdb-export", + 1330: "streetperfect", + 1331: "intersan", + 1332: "pcia-rxp-b", + 1333: "passwrd-policy", + 1334: "writesrv", + 1335: "digital-notary", + 1336: "ischat", + 1337: "menandmice-dns", + 1338: "wmc-log-svc", + 1339: "kjtsiteserver", + 1340: "naap", + 1341: "qubes", + 1342: "esbroker", + 1343: "re101", + 1344: "icap", + 1345: "vpjp", + 1346: "alta-ana-lm", + 1347: "bbn-mmc", + 1348: "bbn-mmx", + 1349: "sbook", + 1350: "editbench", + 1351: "equationbuilder", + 1352: "lotusnote", + 1353: "relief", + 1354: "XSIP-network", + 1355: "intuitive-edge", + 1356: "cuillamartin", + 1357: "pegboard", + 1358: "connlcli", + 1359: "ftsrv", + 1360: "mimer", + 1361: "linx", + 1362: "timeflies", + 1363: "ndm-requester", + 1364: "ndm-server", + 1365: "adapt-sna", + 1366: "netware-csp", + 1367: "dcs", + 1368: "screencast", + 1369: "gv-us", + 1370: "us-gv", + 1371: "fc-cli", + 1372: "fc-ser", + 1373: "chromagrafx", + 1374: "molly", + 1375: "bytex", + 1376: "ibm-pps", + 1377: "cichlid", + 1378: "elan", + 1379: "dbreporter", + 1380: "telesis-licman", + 1381: "apple-licman", + 1382: "udt-os", + 1383: "gwha", + 1384: "os-licman", + 1385: "atex-elmd", + 1386: "checksum", + 1387: "cadsi-lm", + 1388: "objective-dbc", + 1389: "iclpv-dm", + 1390: "iclpv-sc", + 1391: "iclpv-sas", + 1392: "iclpv-pm", + 1393: "iclpv-nls", + 1394: "iclpv-nlc", + 1395: "iclpv-wsm", + 1396: "dvl-activemail", + 1397: "audio-activmail", + 1398: "video-activmail", + 1399: "cadkey-licman", + 1400: "cadkey-tablet", + 1401: "goldleaf-licman", + 1402: "prm-sm-np", + 1403: "prm-nm-np", + 1404: "igi-lm", + 1405: "ibm-res", + 1406: "netlabs-lm", + 1407: "dbsa-lm", + 1408: "sophia-lm", + 1409: "here-lm", + 1410: "hiq", + 1411: "af", + 1412: "innosys", + 1413: "innosys-acl", + 1414: "ibm-mqseries", + 1415: "dbstar", + 1416: "novell-lu6-2", + 1417: "timbuktu-srv1", + 1418: "timbuktu-srv2", + 1419: "timbuktu-srv3", + 1420: "timbuktu-srv4", + 1421: "gandalf-lm", + 1422: "autodesk-lm", + 1423: "essbase", + 1424: "hybrid", + 1425: "zion-lm", + 1426: "sais", + 1427: "mloadd", + 1428: "informatik-lm", + 1429: "nms", + 1430: "tpdu", + 1431: "rgtp", + 1432: "blueberry-lm", + 1433: "ms-sql-s", + 1434: "ms-sql-m", + 1435: "ibm-cics", + 1436: "saism", + 1437: "tabula", + 1438: "eicon-server", + 1439: "eicon-x25", + 1440: "eicon-slp", + 1441: "cadis-1", + 1442: "cadis-2", + 1443: "ies-lm", + 1444: "marcam-lm", + 1445: "proxima-lm", + 1446: "ora-lm", + 1447: "apri-lm", + 1448: "oc-lm", + 1449: "peport", + 1450: "dwf", + 1451: "infoman", + 1452: "gtegsc-lm", + 1453: "genie-lm", + 1454: "interhdl-elmd", + 1455: "esl-lm", + 1456: "dca", + 1457: "valisys-lm", + 1458: "nrcabq-lm", + 1459: "proshare1", + 1460: "proshare2", + 1461: "ibm-wrless-lan", + 1462: "world-lm", + 1463: "nucleus", + 1464: "msl-lmd", + 1465: "pipes", + 1466: "oceansoft-lm", + 1467: "csdmbase", + 1468: "csdm", + 1469: "aal-lm", + 1470: "uaiact", + 1471: "csdmbase", + 1472: "csdm", + 1473: "openmath", + 1474: "telefinder", + 1475: "taligent-lm", + 1476: "clvm-cfg", + 1477: "ms-sna-server", + 1478: "ms-sna-base", + 1479: "dberegister", + 1480: "pacerforum", + 1481: "airs", + 1482: "miteksys-lm", + 1483: "afs", + 1484: "confluent", + 1485: "lansource", + 1486: "nms-topo-serv", + 1487: "localinfosrvr", + 1488: "docstor", + 1489: "dmdocbroker", + 1490: "insitu-conf", + 1492: "stone-design-1", + 1493: "netmap-lm", + 1494: "ica", + 1495: "cvc", + 1496: "liberty-lm", + 1497: "rfx-lm", + 1498: "sybase-sqlany", + 1499: "fhc", + 1500: "vlsi-lm", + 1501: "saiscm", + 1502: "shivadiscovery", + 1503: "imtc-mcs", + 1504: "evb-elm", + 1505: "funkproxy", + 1506: "utcd", + 1507: "symplex", + 1508: "diagmond", + 1509: "robcad-lm", + 1510: "mvx-lm", + 1511: "3l-l1", + 1512: "wins", + 1513: "fujitsu-dtc", + 1514: "fujitsu-dtcns", + 1515: "ifor-protocol", + 1516: "vpad", + 1517: "vpac", + 1518: "vpvd", + 1519: "vpvc", + 1520: "atm-zip-office", + 1521: "ncube-lm", + 1522: "ricardo-lm", + 1523: "cichild-lm", + 1524: "ingreslock", + 1525: "orasrv", + 1526: "pdap-np", + 1527: "tlisrv", + 1529: "coauthor", + 1530: "rap-service", + 1531: "rap-listen", + 1532: "miroconnect", + 1533: "virtual-places", + 1534: "micromuse-lm", + 1535: "ampr-info", + 1536: "ampr-inter", + 1537: "sdsc-lm", + 1538: "3ds-lm", + 1539: "intellistor-lm", + 1540: "rds", + 1541: "rds2", + 1542: "gridgen-elmd", + 1543: "simba-cs", + 1544: "aspeclmd", + 1545: "vistium-share", + 1546: "abbaccuray", + 1547: "laplink", + 1548: "axon-lm", + 1549: "shivasound", + 1550: "3m-image-lm", + 1551: "hecmtl-db", + 1552: "pciarray", + 1553: "sna-cs", + 1554: "caci-lm", + 1555: "livelan", + 1556: "veritas-pbx", + 1557: "arbortext-lm", + 1558: "xingmpeg", + 1559: "web2host", + 1560: "asci-val", + 1561: "facilityview", + 1562: "pconnectmgr", + 1563: "cadabra-lm", + 1564: "pay-per-view", + 1565: "winddlb", + 1566: "corelvideo", + 1567: "jlicelmd", + 1568: "tsspmap", + 1569: "ets", + 1570: "orbixd", + 1571: "rdb-dbs-disp", + 1572: "chip-lm", + 1573: "itscomm-ns", + 1574: "mvel-lm", + 1575: "oraclenames", + 1576: "moldflow-lm", + 1577: "hypercube-lm", + 1578: "jacobus-lm", + 1579: "ioc-sea-lm", + 1580: "tn-tl-r2", + 1581: "mil-2045-47001", + 1582: "msims", + 1583: "simbaexpress", + 1584: "tn-tl-fd2", + 1585: "intv", + 1586: "ibm-abtact", + 1587: "pra-elmd", + 1588: "triquest-lm", + 1589: "vqp", + 1590: "gemini-lm", + 1591: "ncpm-pm", + 1592: "commonspace", + 1593: "mainsoft-lm", + 1594: "sixtrak", + 1595: "radio", + 1596: "radio-bc", + 1597: "orbplus-iiop", + 1598: "picknfs", + 1599: "simbaservices", + 1600: "issd", + 1601: "aas", + 1602: "inspect", + 1603: "picodbc", + 1604: "icabrowser", + 1605: "slp", + 1606: "slm-api", + 1607: "stt", + 1608: "smart-lm", + 1609: "isysg-lm", + 1610: "taurus-wh", + 1611: "ill", + 1612: "netbill-trans", + 1613: "netbill-keyrep", + 1614: "netbill-cred", + 1615: "netbill-auth", + 1616: "netbill-prod", + 1617: "nimrod-agent", + 1618: "skytelnet", + 1619: "xs-openstorage", + 1620: "faxportwinport", + 1621: "softdataphone", + 1622: "ontime", + 1623: "jaleosnd", + 1624: "udp-sr-port", + 1625: "svs-omagent", + 1626: "shockwave", + 1627: "t128-gateway", + 1628: "lontalk-norm", + 1629: "lontalk-urgnt", + 1630: "oraclenet8cman", + 1631: "visitview", + 1632: "pammratc", + 1633: "pammrpc", + 1634: "loaprobe", + 1635: "edb-server1", + 1636: "isdc", + 1637: "islc", + 1638: "ismc", + 1639: "cert-initiator", + 1640: "cert-responder", + 1641: "invision", + 1642: "isis-am", + 1643: "isis-ambc", + 1644: "saiseh", + 1645: "sightline", + 1646: "sa-msg-port", + 1647: "rsap", + 1648: "concurrent-lm", + 1649: "kermit", + 1650: "nkd", + 1651: "shiva-confsrvr", + 1652: "xnmp", + 1653: "alphatech-lm", + 1654: "stargatealerts", + 1655: "dec-mbadmin", + 1656: "dec-mbadmin-h", + 1657: "fujitsu-mmpdc", + 1658: "sixnetudr", + 1659: "sg-lm", + 1660: "skip-mc-gikreq", + 1661: "netview-aix-1", + 1662: "netview-aix-2", + 1663: "netview-aix-3", + 1664: "netview-aix-4", + 1665: "netview-aix-5", + 1666: "netview-aix-6", + 1667: "netview-aix-7", + 1668: "netview-aix-8", + 1669: "netview-aix-9", + 1670: "netview-aix-10", + 1671: "netview-aix-11", + 1672: "netview-aix-12", + 1673: "proshare-mc-1", + 1674: "proshare-mc-2", + 1675: "pdp", + 1676: "netcomm2", + 1677: "groupwise", + 1678: "prolink", + 1679: "darcorp-lm", + 1680: "microcom-sbp", + 1681: "sd-elmd", + 1682: "lanyon-lantern", + 1683: "ncpm-hip", + 1684: "snaresecure", + 1685: "n2nremote", + 1686: "cvmon", + 1687: "nsjtp-ctrl", + 1688: "nsjtp-data", + 1689: "firefox", + 1690: "ng-umds", + 1691: "empire-empuma", + 1692: "sstsys-lm", + 1693: "rrirtr", + 1694: "rrimwm", + 1695: "rrilwm", + 1696: "rrifmm", + 1697: "rrisat", + 1698: "rsvp-encap-1", + 1699: "rsvp-encap-2", + 1700: "mps-raft", + 1701: "l2f", + 1702: "deskshare", + 1703: "hb-engine", + 1704: "bcs-broker", + 1705: "slingshot", + 1706: "jetform", + 1707: "vdmplay", + 1708: "gat-lmd", + 1709: "centra", + 1710: "impera", + 1711: "pptconference", + 1712: "registrar", + 1713: "conferencetalk", + 1714: "sesi-lm", + 1715: "houdini-lm", + 1716: "xmsg", + 1717: "fj-hdnet", + 1718: "h323gatedisc", + 1719: "h323gatestat", + 1720: "h323hostcall", + 1721: "caicci", + 1722: "hks-lm", + 1723: "pptp", + 1724: "csbphonemaster", + 1725: "iden-ralp", + 1726: "iberiagames", + 1727: "winddx", + 1728: "telindus", + 1729: "citynl", + 1730: "roketz", + 1731: "msiccp", + 1732: "proxim", + 1733: "siipat", + 1734: "cambertx-lm", + 1735: "privatechat", + 1736: "street-stream", + 1737: "ultimad", + 1738: "gamegen1", + 1739: "webaccess", + 1740: "encore", + 1741: "cisco-net-mgmt", + 1742: "3Com-nsd", + 1743: "cinegrfx-lm", + 1744: "ncpm-ft", + 1745: "remote-winsock", + 1746: "ftrapid-1", + 1747: "ftrapid-2", + 1748: "oracle-em1", + 1749: "aspen-services", + 1750: "sslp", + 1751: "swiftnet", + 1752: "lofr-lm", + 1754: "oracle-em2", + 1755: "ms-streaming", + 1756: "capfast-lmd", + 1757: "cnhrp", + 1758: "tftp-mcast", + 1759: "spss-lm", + 1760: "www-ldap-gw", + 1761: "cft-0", + 1762: "cft-1", + 1763: "cft-2", + 1764: "cft-3", + 1765: "cft-4", + 1766: "cft-5", + 1767: "cft-6", + 1768: "cft-7", + 1769: "bmc-net-adm", + 1770: "bmc-net-svc", + 1771: "vaultbase", + 1772: "essweb-gw", + 1773: "kmscontrol", + 1774: "global-dtserv", + 1776: "femis", + 1777: "powerguardian", + 1778: "prodigy-intrnet", + 1779: "pharmasoft", + 1780: "dpkeyserv", + 1781: "answersoft-lm", + 1782: "hp-hcip", + 1784: "finle-lm", + 1785: "windlm", + 1786: "funk-logger", + 1787: "funk-license", + 1788: "psmond", + 1789: "hello", + 1790: "nmsp", + 1791: "ea1", + 1792: "ibm-dt-2", + 1793: "rsc-robot", + 1794: "cera-bcm", + 1795: "dpi-proxy", + 1796: "vocaltec-admin", + 1797: "uma", + 1798: "etp", + 1799: "netrisk", + 1800: "ansys-lm", + 1801: "msmq", + 1802: "concomp1", + 1803: "hp-hcip-gwy", + 1804: "enl", + 1805: "enl-name", + 1806: "musiconline", + 1807: "fhsp", + 1808: "oracle-vp2", + 1809: "oracle-vp1", + 1810: "jerand-lm", + 1811: "scientia-sdb", + 1812: "radius", + 1813: "radius-acct", + 1814: "tdp-suite", + 1815: "mmpft", + 1816: "harp", + 1817: "rkb-oscs", + 1818: "etftp", + 1819: "plato-lm", + 1820: "mcagent", + 1821: "donnyworld", + 1822: "es-elmd", + 1823: "unisys-lm", + 1824: "metrics-pas", + 1825: "direcpc-video", + 1826: "ardt", + 1827: "asi", + 1828: "itm-mcell-u", + 1829: "optika-emedia", + 1830: "net8-cman", + 1831: "myrtle", + 1832: "tht-treasure", + 1833: "udpradio", + 1834: "ardusuni", + 1835: "ardusmul", + 1836: "ste-smsc", + 1837: "csoft1", + 1838: "talnet", + 1839: "netopia-vo1", + 1840: "netopia-vo2", + 1841: "netopia-vo3", + 1842: "netopia-vo4", + 1843: "netopia-vo5", + 1844: "direcpc-dll", + 1845: "altalink", + 1846: "tunstall-pnc", + 1847: "slp-notify", + 1848: "fjdocdist", + 1849: "alpha-sms", + 1850: "gsi", + 1851: "ctcd", + 1852: "virtual-time", + 1853: "vids-avtp", + 1854: "buddy-draw", + 1855: "fiorano-rtrsvc", + 1856: "fiorano-msgsvc", + 1857: "datacaptor", + 1858: "privateark", + 1859: "gammafetchsvr", + 1860: "sunscalar-svc", + 1861: "lecroy-vicp", + 1862: "mysql-cm-agent", + 1863: "msnp", + 1864: "paradym-31port", + 1865: "entp", + 1866: "swrmi", + 1867: "udrive", + 1868: "viziblebrowser", + 1869: "transact", + 1870: "sunscalar-dns", + 1871: "canocentral0", + 1872: "canocentral1", + 1873: "fjmpjps", + 1874: "fjswapsnp", + 1875: "westell-stats", + 1876: "ewcappsrv", + 1877: "hp-webqosdb", + 1878: "drmsmc", + 1879: "nettgain-nms", + 1880: "vsat-control", + 1881: "ibm-mqseries2", + 1882: "ecsqdmn", + 1883: "ibm-mqisdp", + 1884: "idmaps", + 1885: "vrtstrapserver", + 1886: "leoip", + 1887: "filex-lport", + 1888: "ncconfig", + 1889: "unify-adapter", + 1890: "wilkenlistener", + 1891: "childkey-notif", + 1892: "childkey-ctrl", + 1893: "elad", + 1894: "o2server-port", + 1896: "b-novative-ls", + 1897: "metaagent", + 1898: "cymtec-port", + 1899: "mc2studios", + 1900: "ssdp", + 1901: "fjicl-tep-a", + 1902: "fjicl-tep-b", + 1903: "linkname", + 1904: "fjicl-tep-c", + 1905: "sugp", + 1906: "tpmd", + 1907: "intrastar", + 1908: "dawn", + 1909: "global-wlink", + 1910: "ultrabac", + 1911: "mtp", + 1912: "rhp-iibp", + 1913: "armadp", + 1914: "elm-momentum", + 1915: "facelink", + 1916: "persona", + 1917: "noagent", + 1918: "can-nds", + 1919: "can-dch", + 1920: "can-ferret", + 1921: "noadmin", + 1922: "tapestry", + 1923: "spice", + 1924: "xiip", + 1925: "discovery-port", + 1926: "egs", + 1927: "videte-cipc", + 1928: "emsd-port", + 1929: "bandwiz-system", + 1930: "driveappserver", + 1931: "amdsched", + 1932: "ctt-broker", + 1933: "xmapi", + 1934: "xaapi", + 1935: "macromedia-fcs", + 1936: "jetcmeserver", + 1937: "jwserver", + 1938: "jwclient", + 1939: "jvserver", + 1940: "jvclient", + 1941: "dic-aida", + 1942: "res", + 1943: "beeyond-media", + 1944: "close-combat", + 1945: "dialogic-elmd", + 1946: "tekpls", + 1947: "sentinelsrm", + 1948: "eye2eye", + 1949: "ismaeasdaqlive", + 1950: "ismaeasdaqtest", + 1951: "bcs-lmserver", + 1952: "mpnjsc", + 1953: "rapidbase", + 1954: "abr-api", + 1955: "abr-secure", + 1956: "vrtl-vmf-ds", + 1957: "unix-status", + 1958: "dxadmind", + 1959: "simp-all", + 1960: "nasmanager", + 1961: "bts-appserver", + 1962: "biap-mp", + 1963: "webmachine", + 1964: "solid-e-engine", + 1965: "tivoli-npm", + 1966: "slush", + 1967: "sns-quote", + 1968: "lipsinc", + 1969: "lipsinc1", + 1970: "netop-rc", + 1971: "netop-school", + 1972: "intersys-cache", + 1973: "dlsrap", + 1974: "drp", + 1975: "tcoflashagent", + 1976: "tcoregagent", + 1977: "tcoaddressbook", + 1978: "unisql", + 1979: "unisql-java", + 1980: "pearldoc-xact", + 1981: "p2pq", + 1982: "estamp", + 1983: "lhtp", + 1984: "bb", + 1985: "hsrp", + 1986: "licensedaemon", + 1987: "tr-rsrb-p1", + 1988: "tr-rsrb-p2", + 1989: "tr-rsrb-p3", + 1990: "stun-p1", + 1991: "stun-p2", + 1992: "stun-p3", + 1993: "snmp-tcp-port", + 1994: "stun-port", + 1995: "perf-port", + 1996: "tr-rsrb-port", + 1997: "gdp-port", + 1998: "x25-svc-port", + 1999: "tcp-id-port", + 2000: "cisco-sccp", + 2001: "wizard", + 2002: "globe", + 2003: "brutus", + 2004: "emce", + 2005: "oracle", + 2006: "raid-cd", + 2007: "raid-am", + 2008: "terminaldb", + 2009: "whosockami", + 2010: "pipe-server", + 2011: "servserv", + 2012: "raid-ac", + 2013: "raid-cd", + 2014: "raid-sf", + 2015: "raid-cs", + 2016: "bootserver", + 2017: "bootclient", + 2018: "rellpack", + 2019: "about", + 2020: "xinupageserver", + 2021: "xinuexpansion1", + 2022: "xinuexpansion2", + 2023: "xinuexpansion3", + 2024: "xinuexpansion4", + 2025: "xribs", + 2026: "scrabble", + 2027: "shadowserver", + 2028: "submitserver", + 2029: "hsrpv6", + 2030: "device2", + 2031: "mobrien-chat", + 2032: "blackboard", + 2033: "glogger", + 2034: "scoremgr", + 2035: "imsldoc", + 2036: "e-dpnet", + 2037: "applus", + 2038: "objectmanager", + 2039: "prizma", + 2040: "lam", + 2041: "interbase", + 2042: "isis", + 2043: "isis-bcast", + 2044: "rimsl", + 2045: "cdfunc", + 2046: "sdfunc", + 2047: "dls", + 2048: "dls-monitor", + 2049: "shilp", + 2050: "av-emb-config", + 2051: "epnsdp", + 2052: "clearvisn", + 2053: "lot105-ds-upd", + 2054: "weblogin", + 2055: "iop", + 2056: "omnisky", + 2057: "rich-cp", + 2058: "newwavesearch", + 2059: "bmc-messaging", + 2060: "teleniumdaemon", + 2061: "netmount", + 2062: "icg-swp", + 2063: "icg-bridge", + 2064: "icg-iprelay", + 2065: "dlsrpn", + 2066: "aura", + 2067: "dlswpn", + 2068: "avauthsrvprtcl", + 2069: "event-port", + 2070: "ah-esp-encap", + 2071: "acp-port", + 2072: "msync", + 2073: "gxs-data-port", + 2074: "vrtl-vmf-sa", + 2075: "newlixengine", + 2076: "newlixconfig", + 2077: "tsrmagt", + 2078: "tpcsrvr", + 2079: "idware-router", + 2080: "autodesk-nlm", + 2081: "kme-trap-port", + 2082: "infowave", + 2083: "radsec", + 2084: "sunclustergeo", + 2085: "ada-cip", + 2086: "gnunet", + 2087: "eli", + 2088: "ip-blf", + 2089: "sep", + 2090: "lrp", + 2091: "prp", + 2092: "descent3", + 2093: "nbx-cc", + 2094: "nbx-au", + 2095: "nbx-ser", + 2096: "nbx-dir", + 2097: "jetformpreview", + 2098: "dialog-port", + 2099: "h2250-annex-g", + 2100: "amiganetfs", + 2101: "rtcm-sc104", + 2102: "zephyr-srv", + 2103: "zephyr-clt", + 2104: "zephyr-hm", + 2105: "minipay", + 2106: "mzap", + 2107: "bintec-admin", + 2108: "comcam", + 2109: "ergolight", + 2110: "umsp", + 2111: "dsatp", + 2112: "idonix-metanet", + 2113: "hsl-storm", + 2114: "newheights", + 2115: "kdm", + 2116: "ccowcmr", + 2117: "mentaclient", + 2118: "mentaserver", + 2119: "gsigatekeeper", + 2120: "qencp", + 2121: "scientia-ssdb", + 2122: "caupc-remote", + 2123: "gtp-control", + 2124: "elatelink", + 2125: "lockstep", + 2126: "pktcable-cops", + 2127: "index-pc-wb", + 2128: "net-steward", + 2129: "cs-live", + 2130: "xds", + 2131: "avantageb2b", + 2132: "solera-epmap", + 2133: "zymed-zpp", + 2134: "avenue", + 2135: "gris", + 2136: "appworxsrv", + 2137: "connect", + 2138: "unbind-cluster", + 2139: "ias-auth", + 2140: "ias-reg", + 2141: "ias-admind", + 2142: "tdmoip", + 2143: "lv-jc", + 2144: "lv-ffx", + 2145: "lv-pici", + 2146: "lv-not", + 2147: "lv-auth", + 2148: "veritas-ucl", + 2149: "acptsys", + 2150: "dynamic3d", + 2151: "docent", + 2152: "gtp-user", + 2153: "ctlptc", + 2154: "stdptc", + 2155: "brdptc", + 2156: "trp", + 2157: "xnds", + 2158: "touchnetplus", + 2159: "gdbremote", + 2160: "apc-2160", + 2161: "apc-2161", + 2162: "navisphere", + 2163: "navisphere-sec", + 2164: "ddns-v3", + 2165: "x-bone-api", + 2166: "iwserver", + 2167: "raw-serial", + 2168: "easy-soft-mux", + 2169: "brain", + 2170: "eyetv", + 2171: "msfw-storage", + 2172: "msfw-s-storage", + 2173: "msfw-replica", + 2174: "msfw-array", + 2175: "airsync", + 2176: "rapi", + 2177: "qwave", + 2178: "bitspeer", + 2179: "vmrdp", + 2180: "mc-gt-srv", + 2181: "eforward", + 2182: "cgn-stat", + 2183: "cgn-config", + 2184: "nvd", + 2185: "onbase-dds", + 2186: "gtaua", + 2187: "ssmd", + 2190: "tivoconnect", + 2191: "tvbus", + 2192: "asdis", + 2193: "drwcs", + 2197: "mnp-exchange", + 2198: "onehome-remote", + 2199: "onehome-help", + 2200: "ici", + 2201: "ats", + 2202: "imtc-map", + 2203: "b2-runtime", + 2204: "b2-license", + 2205: "jps", + 2206: "hpocbus", + 2207: "hpssd", + 2208: "hpiod", + 2209: "rimf-ps", + 2210: "noaaport", + 2211: "emwin", + 2212: "leecoposserver", + 2213: "kali", + 2214: "rpi", + 2215: "ipcore", + 2216: "vtu-comms", + 2217: "gotodevice", + 2218: "bounzza", + 2219: "netiq-ncap", + 2220: "netiq", + 2221: "rockwell-csp1", + 2222: "EtherNet-IP-1", + 2223: "rockwell-csp2", + 2224: "efi-mg", + 2226: "di-drm", + 2227: "di-msg", + 2228: "ehome-ms", + 2229: "datalens", + 2230: "queueadm", + 2231: "wimaxasncp", + 2232: "ivs-video", + 2233: "infocrypt", + 2234: "directplay", + 2235: "sercomm-wlink", + 2236: "nani", + 2237: "optech-port1-lm", + 2238: "aviva-sna", + 2239: "imagequery", + 2240: "recipe", + 2241: "ivsd", + 2242: "foliocorp", + 2243: "magicom", + 2244: "nmsserver", + 2245: "hao", + 2246: "pc-mta-addrmap", + 2247: "antidotemgrsvr", + 2248: "ums", + 2249: "rfmp", + 2250: "remote-collab", + 2251: "dif-port", + 2252: "njenet-ssl", + 2253: "dtv-chan-req", + 2254: "seispoc", + 2255: "vrtp", + 2256: "pcc-mfp", + 2257: "simple-tx-rx", + 2258: "rcts", + 2260: "apc-2260", + 2261: "comotionmaster", + 2262: "comotionback", + 2263: "ecwcfg", + 2264: "apx500api-1", + 2265: "apx500api-2", + 2266: "mfserver", + 2267: "ontobroker", + 2268: "amt", + 2269: "mikey", + 2270: "starschool", + 2271: "mmcals", + 2272: "mmcal", + 2273: "mysql-im", + 2274: "pcttunnell", + 2275: "ibridge-data", + 2276: "ibridge-mgmt", + 2277: "bluectrlproxy", + 2278: "s3db", + 2279: "xmquery", + 2280: "lnvpoller", + 2281: "lnvconsole", + 2282: "lnvalarm", + 2283: "lnvstatus", + 2284: "lnvmaps", + 2285: "lnvmailmon", + 2286: "nas-metering", + 2287: "dna", + 2288: "netml", + 2289: "dict-lookup", + 2290: "sonus-logging", + 2291: "eapsp", + 2292: "mib-streaming", + 2293: "npdbgmngr", + 2294: "konshus-lm", + 2295: "advant-lm", + 2296: "theta-lm", + 2297: "d2k-datamover1", + 2298: "d2k-datamover2", + 2299: "pc-telecommute", + 2300: "cvmmon", + 2301: "cpq-wbem", + 2302: "binderysupport", + 2303: "proxy-gateway", + 2304: "attachmate-uts", + 2305: "mt-scaleserver", + 2306: "tappi-boxnet", + 2307: "pehelp", + 2308: "sdhelp", + 2309: "sdserver", + 2310: "sdclient", + 2311: "messageservice", + 2312: "wanscaler", + 2313: "iapp", + 2314: "cr-websystems", + 2315: "precise-sft", + 2316: "sent-lm", + 2317: "attachmate-g32", + 2318: "cadencecontrol", + 2319: "infolibria", + 2320: "siebel-ns", + 2321: "rdlap", + 2322: "ofsd", + 2323: "3d-nfsd", + 2324: "cosmocall", + 2325: "ansysli", + 2326: "idcp", + 2327: "xingcsm", + 2328: "netrix-sftm", + 2329: "nvd", + 2330: "tscchat", + 2331: "agentview", + 2332: "rcc-host", + 2333: "snapp", + 2334: "ace-client", + 2335: "ace-proxy", + 2336: "appleugcontrol", + 2337: "ideesrv", + 2338: "norton-lambert", + 2339: "3com-webview", + 2340: "wrs-registry", + 2341: "xiostatus", + 2342: "manage-exec", + 2343: "nati-logos", + 2344: "fcmsys", + 2345: "dbm", + 2346: "redstorm-join", + 2347: "redstorm-find", + 2348: "redstorm-info", + 2349: "redstorm-diag", + 2350: "psbserver", + 2351: "psrserver", + 2352: "pslserver", + 2353: "pspserver", + 2354: "psprserver", + 2355: "psdbserver", + 2356: "gxtelmd", + 2357: "unihub-server", + 2358: "futrix", + 2359: "flukeserver", + 2360: "nexstorindltd", + 2361: "tl1", + 2362: "digiman", + 2363: "mediacntrlnfsd", + 2364: "oi-2000", + 2365: "dbref", + 2366: "qip-login", + 2367: "service-ctrl", + 2368: "opentable", + 2370: "l3-hbmon", + 2372: "lanmessenger", + 2381: "compaq-https", + 2382: "ms-olap3", + 2383: "ms-olap4", + 2384: "sd-capacity", + 2385: "sd-data", + 2386: "virtualtape", + 2387: "vsamredirector", + 2388: "mynahautostart", + 2389: "ovsessionmgr", + 2390: "rsmtp", + 2391: "3com-net-mgmt", + 2392: "tacticalauth", + 2393: "ms-olap1", + 2394: "ms-olap2", + 2395: "lan900-remote", + 2396: "wusage", + 2397: "ncl", + 2398: "orbiter", + 2399: "fmpro-fdal", + 2400: "opequus-server", + 2401: "cvspserver", + 2402: "taskmaster2000", + 2403: "taskmaster2000", + 2404: "iec-104", + 2405: "trc-netpoll", + 2406: "jediserver", + 2407: "orion", + 2409: "sns-protocol", + 2410: "vrts-registry", + 2411: "netwave-ap-mgmt", + 2412: "cdn", + 2413: "orion-rmi-reg", + 2414: "beeyond", + 2415: "codima-rtp", + 2416: "rmtserver", + 2417: "composit-server", + 2418: "cas", + 2419: "attachmate-s2s", + 2420: "dslremote-mgmt", + 2421: "g-talk", + 2422: "crmsbits", + 2423: "rnrp", + 2424: "kofax-svr", + 2425: "fjitsuappmgr", + 2427: "mgcp-gateway", + 2428: "ott", + 2429: "ft-role", + 2430: "venus", + 2431: "venus-se", + 2432: "codasrv", + 2433: "codasrv-se", + 2434: "pxc-epmap", + 2435: "optilogic", + 2436: "topx", + 2437: "unicontrol", + 2438: "msp", + 2439: "sybasedbsynch", + 2440: "spearway", + 2441: "pvsw-inet", + 2442: "netangel", + 2443: "powerclientcsf", + 2444: "btpp2sectrans", + 2445: "dtn1", + 2446: "bues-service", + 2447: "ovwdb", + 2448: "hpppssvr", + 2449: "ratl", + 2450: "netadmin", + 2451: "netchat", + 2452: "snifferclient", + 2453: "madge-ltd", + 2454: "indx-dds", + 2455: "wago-io-system", + 2456: "altav-remmgt", + 2457: "rapido-ip", + 2458: "griffin", + 2459: "community", + 2460: "ms-theater", + 2461: "qadmifoper", + 2462: "qadmifevent", + 2463: "lsi-raid-mgmt", + 2464: "direcpc-si", + 2465: "lbm", + 2466: "lbf", + 2467: "high-criteria", + 2468: "qip-msgd", + 2469: "mti-tcs-comm", + 2470: "taskman-port", + 2471: "seaodbc", + 2472: "c3", + 2473: "aker-cdp", + 2474: "vitalanalysis", + 2475: "ace-server", + 2476: "ace-svr-prop", + 2477: "ssm-cvs", + 2478: "ssm-cssps", + 2479: "ssm-els", + 2480: "powerexchange", + 2481: "giop", + 2482: "giop-ssl", + 2483: "ttc", + 2484: "ttc-ssl", + 2485: "netobjects1", + 2486: "netobjects2", + 2487: "pns", + 2488: "moy-corp", + 2489: "tsilb", + 2490: "qip-qdhcp", + 2491: "conclave-cpp", + 2492: "groove", + 2493: "talarian-mqs", + 2494: "bmc-ar", + 2495: "fast-rem-serv", + 2496: "dirgis", + 2497: "quaddb", + 2498: "odn-castraq", + 2499: "unicontrol", + 2500: "rtsserv", + 2501: "rtsclient", + 2502: "kentrox-prot", + 2503: "nms-dpnss", + 2504: "wlbs", + 2505: "ppcontrol", + 2506: "jbroker", + 2507: "spock", + 2508: "jdatastore", + 2509: "fjmpss", + 2510: "fjappmgrbulk", + 2511: "metastorm", + 2512: "citrixima", + 2513: "citrixadmin", + 2514: "facsys-ntp", + 2515: "facsys-router", + 2516: "maincontrol", + 2517: "call-sig-trans", + 2518: "willy", + 2519: "globmsgsvc", + 2520: "pvsw", + 2521: "adaptecmgr", + 2522: "windb", + 2523: "qke-llc-v3", + 2524: "optiwave-lm", + 2525: "ms-v-worlds", + 2526: "ema-sent-lm", + 2527: "iqserver", + 2528: "ncr-ccl", + 2529: "utsftp", + 2530: "vrcommerce", + 2531: "ito-e-gui", + 2532: "ovtopmd", + 2533: "snifferserver", + 2534: "combox-web-acc", + 2535: "madcap", + 2536: "btpp2audctr1", + 2537: "upgrade", + 2538: "vnwk-prapi", + 2539: "vsiadmin", + 2540: "lonworks", + 2541: "lonworks2", + 2542: "udrawgraph", + 2543: "reftek", + 2544: "novell-zen", + 2545: "sis-emt", + 2546: "vytalvaultbrtp", + 2547: "vytalvaultvsmp", + 2548: "vytalvaultpipe", + 2549: "ipass", + 2550: "ads", + 2551: "isg-uda-server", + 2552: "call-logging", + 2553: "efidiningport", + 2554: "vcnet-link-v10", + 2555: "compaq-wcp", + 2556: "nicetec-nmsvc", + 2557: "nicetec-mgmt", + 2558: "pclemultimedia", + 2559: "lstp", + 2560: "labrat", + 2561: "mosaixcc", + 2562: "delibo", + 2563: "cti-redwood", + 2564: "hp-3000-telnet", + 2565: "coord-svr", + 2566: "pcs-pcw", + 2567: "clp", + 2568: "spamtrap", + 2569: "sonuscallsig", + 2570: "hs-port", + 2571: "cecsvc", + 2572: "ibp", + 2573: "trustestablish", + 2574: "blockade-bpsp", + 2575: "hl7", + 2576: "tclprodebugger", + 2577: "scipticslsrvr", + 2578: "rvs-isdn-dcp", + 2579: "mpfoncl", + 2580: "tributary", + 2581: "argis-te", + 2582: "argis-ds", + 2583: "mon", + 2584: "cyaserv", + 2585: "netx-server", + 2586: "netx-agent", + 2587: "masc", + 2588: "privilege", + 2589: "quartus-tcl", + 2590: "idotdist", + 2591: "maytagshuffle", + 2592: "netrek", + 2593: "mns-mail", + 2594: "dts", + 2595: "worldfusion1", + 2596: "worldfusion2", + 2597: "homesteadglory", + 2598: "citriximaclient", + 2599: "snapd", + 2600: "hpstgmgr", + 2601: "discp-client", + 2602: "discp-server", + 2603: "servicemeter", + 2604: "nsc-ccs", + 2605: "nsc-posa", + 2606: "netmon", + 2607: "connection", + 2608: "wag-service", + 2609: "system-monitor", + 2610: "versa-tek", + 2611: "lionhead", + 2612: "qpasa-agent", + 2613: "smntubootstrap", + 2614: "neveroffline", + 2615: "firepower", + 2616: "appswitch-emp", + 2617: "cmadmin", + 2618: "priority-e-com", + 2619: "bruce", + 2620: "lpsrecommender", + 2621: "miles-apart", + 2622: "metricadbc", + 2623: "lmdp", + 2624: "aria", + 2625: "blwnkl-port", + 2626: "gbjd816", + 2627: "moshebeeri", + 2628: "dict", + 2629: "sitaraserver", + 2630: "sitaramgmt", + 2631: "sitaradir", + 2632: "irdg-post", + 2633: "interintelli", + 2634: "pk-electronics", + 2635: "backburner", + 2636: "solve", + 2637: "imdocsvc", + 2638: "sybaseanywhere", + 2639: "aminet", + 2640: "sai-sentlm", + 2641: "hdl-srv", + 2642: "tragic", + 2643: "gte-samp", + 2644: "travsoft-ipx-t", + 2645: "novell-ipx-cmd", + 2646: "and-lm", + 2647: "syncserver", + 2648: "upsnotifyprot", + 2649: "vpsipport", + 2650: "eristwoguns", + 2651: "ebinsite", + 2652: "interpathpanel", + 2653: "sonus", + 2654: "corel-vncadmin", + 2655: "unglue", + 2656: "kana", + 2657: "sns-dispatcher", + 2658: "sns-admin", + 2659: "sns-query", + 2660: "gcmonitor", + 2661: "olhost", + 2662: "bintec-capi", + 2663: "bintec-tapi", + 2664: "patrol-mq-gm", + 2665: "patrol-mq-nm", + 2666: "extensis", + 2667: "alarm-clock-s", + 2668: "alarm-clock-c", + 2669: "toad", + 2670: "tve-announce", + 2671: "newlixreg", + 2672: "nhserver", + 2673: "firstcall42", + 2674: "ewnn", + 2675: "ttc-etap", + 2676: "simslink", + 2677: "gadgetgate1way", + 2678: "gadgetgate2way", + 2679: "syncserverssl", + 2680: "pxc-sapxom", + 2681: "mpnjsomb", + 2683: "ncdloadbalance", + 2684: "mpnjsosv", + 2685: "mpnjsocl", + 2686: "mpnjsomg", + 2687: "pq-lic-mgmt", + 2688: "md-cg-http", + 2689: "fastlynx", + 2690: "hp-nnm-data", + 2691: "itinternet", + 2692: "admins-lms", + 2694: "pwrsevent", + 2695: "vspread", + 2696: "unifyadmin", + 2697: "oce-snmp-trap", + 2698: "mck-ivpip", + 2699: "csoft-plusclnt", + 2700: "tqdata", + 2701: "sms-rcinfo", + 2702: "sms-xfer", + 2703: "sms-chat", + 2704: "sms-remctrl", + 2705: "sds-admin", + 2706: "ncdmirroring", + 2707: "emcsymapiport", + 2708: "banyan-net", + 2709: "supermon", + 2710: "sso-service", + 2711: "sso-control", + 2712: "aocp", + 2713: "raventbs", + 2714: "raventdm", + 2715: "hpstgmgr2", + 2716: "inova-ip-disco", + 2717: "pn-requester", + 2718: "pn-requester2", + 2719: "scan-change", + 2720: "wkars", + 2721: "smart-diagnose", + 2722: "proactivesrvr", + 2723: "watchdog-nt", + 2724: "qotps", + 2725: "msolap-ptp2", + 2726: "tams", + 2727: "mgcp-callagent", + 2728: "sqdr", + 2729: "tcim-control", + 2730: "nec-raidplus", + 2731: "fyre-messanger", + 2732: "g5m", + 2733: "signet-ctf", + 2734: "ccs-software", + 2735: "netiq-mc", + 2736: "radwiz-nms-srv", + 2737: "srp-feedback", + 2738: "ndl-tcp-ois-gw", + 2739: "tn-timing", + 2740: "alarm", + 2741: "tsb", + 2742: "tsb2", + 2743: "murx", + 2744: "honyaku", + 2745: "urbisnet", + 2746: "cpudpencap", + 2747: "fjippol-swrly", + 2748: "fjippol-polsvr", + 2749: "fjippol-cnsl", + 2750: "fjippol-port1", + 2751: "fjippol-port2", + 2752: "rsisysaccess", + 2753: "de-spot", + 2754: "apollo-cc", + 2755: "expresspay", + 2756: "simplement-tie", + 2757: "cnrp", + 2758: "apollo-status", + 2759: "apollo-gms", + 2760: "sabams", + 2761: "dicom-iscl", + 2762: "dicom-tls", + 2763: "desktop-dna", + 2764: "data-insurance", + 2765: "qip-audup", + 2766: "compaq-scp", + 2767: "uadtc", + 2768: "uacs", + 2769: "exce", + 2770: "veronica", + 2771: "vergencecm", + 2772: "auris", + 2773: "rbakcup1", + 2774: "rbakcup2", + 2775: "smpp", + 2776: "ridgeway1", + 2777: "ridgeway2", + 2778: "gwen-sonya", + 2779: "lbc-sync", + 2780: "lbc-control", + 2781: "whosells", + 2782: "everydayrc", + 2783: "aises", + 2784: "www-dev", + 2785: "aic-np", + 2786: "aic-oncrpc", + 2787: "piccolo", + 2788: "fryeserv", + 2789: "media-agent", + 2790: "plgproxy", + 2791: "mtport-regist", + 2792: "f5-globalsite", + 2793: "initlsmsad", + 2795: "livestats", + 2796: "ac-tech", + 2797: "esp-encap", + 2798: "tmesis-upshot", + 2799: "icon-discover", + 2800: "acc-raid", + 2801: "igcp", + 2802: "veritas-udp1", + 2803: "btprjctrl", + 2804: "dvr-esm", + 2805: "wta-wsp-s", + 2806: "cspuni", + 2807: "cspmulti", + 2808: "j-lan-p", + 2809: "corbaloc", + 2810: "netsteward", + 2811: "gsiftp", + 2812: "atmtcp", + 2813: "llm-pass", + 2814: "llm-csv", + 2815: "lbc-measure", + 2816: "lbc-watchdog", + 2817: "nmsigport", + 2818: "rmlnk", + 2819: "fc-faultnotify", + 2820: "univision", + 2821: "vrts-at-port", + 2822: "ka0wuc", + 2823: "cqg-netlan", + 2824: "cqg-netlan-1", + 2826: "slc-systemlog", + 2827: "slc-ctrlrloops", + 2828: "itm-lm", + 2829: "silkp1", + 2830: "silkp2", + 2831: "silkp3", + 2832: "silkp4", + 2833: "glishd", + 2834: "evtp", + 2835: "evtp-data", + 2836: "catalyst", + 2837: "repliweb", + 2838: "starbot", + 2839: "nmsigport", + 2840: "l3-exprt", + 2841: "l3-ranger", + 2842: "l3-hawk", + 2843: "pdnet", + 2844: "bpcp-poll", + 2845: "bpcp-trap", + 2846: "aimpp-hello", + 2847: "aimpp-port-req", + 2848: "amt-blc-port", + 2849: "fxp", + 2850: "metaconsole", + 2851: "webemshttp", + 2852: "bears-01", + 2853: "ispipes", + 2854: "infomover", + 2856: "cesdinv", + 2857: "simctlp", + 2858: "ecnp", + 2859: "activememory", + 2860: "dialpad-voice1", + 2861: "dialpad-voice2", + 2862: "ttg-protocol", + 2863: "sonardata", + 2864: "astromed-main", + 2865: "pit-vpn", + 2866: "iwlistener", + 2867: "esps-portal", + 2868: "npep-messaging", + 2869: "icslap", + 2870: "daishi", + 2871: "msi-selectplay", + 2872: "radix", + 2874: "dxmessagebase1", + 2875: "dxmessagebase2", + 2876: "sps-tunnel", + 2877: "bluelance", + 2878: "aap", + 2879: "ucentric-ds", + 2880: "synapse", + 2881: "ndsp", + 2882: "ndtp", + 2883: "ndnp", + 2884: "flashmsg", + 2885: "topflow", + 2886: "responselogic", + 2887: "aironetddp", + 2888: "spcsdlobby", + 2889: "rsom", + 2890: "cspclmulti", + 2891: "cinegrfx-elmd", + 2892: "snifferdata", + 2893: "vseconnector", + 2894: "abacus-remote", + 2895: "natuslink", + 2896: "ecovisiong6-1", + 2897: "citrix-rtmp", + 2898: "appliance-cfg", + 2899: "powergemplus", + 2900: "quicksuite", + 2901: "allstorcns", + 2902: "netaspi", + 2903: "suitcase", + 2904: "m2ua", + 2906: "caller9", + 2907: "webmethods-b2b", + 2908: "mao", + 2909: "funk-dialout", + 2910: "tdaccess", + 2911: "blockade", + 2912: "epicon", + 2913: "boosterware", + 2914: "gamelobby", + 2915: "tksocket", + 2916: "elvin-server", + 2917: "elvin-client", + 2918: "kastenchasepad", + 2919: "roboer", + 2920: "roboeda", + 2921: "cesdcdman", + 2922: "cesdcdtrn", + 2923: "wta-wsp-wtp-s", + 2924: "precise-vip", + 2926: "mobile-file-dl", + 2927: "unimobilectrl", + 2928: "redstone-cpss", + 2929: "amx-webadmin", + 2930: "amx-weblinx", + 2931: "circle-x", + 2932: "incp", + 2933: "4-tieropmgw", + 2934: "4-tieropmcli", + 2935: "qtp", + 2936: "otpatch", + 2937: "pnaconsult-lm", + 2938: "sm-pas-1", + 2939: "sm-pas-2", + 2940: "sm-pas-3", + 2941: "sm-pas-4", + 2942: "sm-pas-5", + 2943: "ttnrepository", + 2944: "megaco-h248", + 2945: "h248-binary", + 2946: "fjsvmpor", + 2947: "gpsd", + 2948: "wap-push", + 2949: "wap-pushsecure", + 2950: "esip", + 2951: "ottp", + 2952: "mpfwsas", + 2953: "ovalarmsrv", + 2954: "ovalarmsrv-cmd", + 2955: "csnotify", + 2956: "ovrimosdbman", + 2957: "jmact5", + 2958: "jmact6", + 2959: "rmopagt", + 2960: "dfoxserver", + 2961: "boldsoft-lm", + 2962: "iph-policy-cli", + 2963: "iph-policy-adm", + 2964: "bullant-srap", + 2965: "bullant-rap", + 2966: "idp-infotrieve", + 2967: "ssc-agent", + 2968: "enpp", + 2969: "essp", + 2970: "index-net", + 2971: "netclip", + 2972: "pmsm-webrctl", + 2973: "svnetworks", + 2974: "signal", + 2975: "fjmpcm", + 2976: "cns-srv-port", + 2977: "ttc-etap-ns", + 2978: "ttc-etap-ds", + 2979: "h263-video", + 2980: "wimd", + 2981: "mylxamport", + 2982: "iwb-whiteboard", + 2983: "netplan", + 2984: "hpidsadmin", + 2985: "hpidsagent", + 2986: "stonefalls", + 2987: "identify", + 2988: "hippad", + 2989: "zarkov", + 2990: "boscap", + 2991: "wkstn-mon", + 2992: "avenyo", + 2993: "veritas-vis1", + 2994: "veritas-vis2", + 2995: "idrs", + 2996: "vsixml", + 2997: "rebol", + 2998: "realsecure", + 2999: "remoteware-un", + 3000: "hbci", + 3002: "exlm-agent", + 3003: "cgms", + 3004: "csoftragent", + 3005: "geniuslm", + 3006: "ii-admin", + 3007: "lotusmtap", + 3008: "midnight-tech", + 3009: "pxc-ntfy", + 3010: "ping-pong", + 3011: "trusted-web", + 3012: "twsdss", + 3013: "gilatskysurfer", + 3014: "broker-service", + 3015: "nati-dstp", + 3016: "notify-srvr", + 3017: "event-listener", + 3018: "srvc-registry", + 3019: "resource-mgr", + 3020: "cifs", + 3021: "agriserver", + 3022: "csregagent", + 3023: "magicnotes", + 3024: "nds-sso", + 3025: "arepa-raft", + 3026: "agri-gateway", + 3027: "LiebDevMgmt-C", + 3028: "LiebDevMgmt-DM", + 3029: "LiebDevMgmt-A", + 3030: "arepa-cas", + 3031: "eppc", + 3032: "redwood-chat", + 3033: "pdb", + 3034: "osmosis-aeea", + 3035: "fjsv-gssagt", + 3036: "hagel-dump", + 3037: "hp-san-mgmt", + 3038: "santak-ups", + 3039: "cogitate", + 3040: "tomato-springs", + 3041: "di-traceware", + 3042: "journee", + 3043: "brp", + 3044: "epp", + 3045: "responsenet", + 3046: "di-ase", + 3047: "hlserver", + 3048: "pctrader", + 3049: "nsws", + 3050: "gds-db", + 3051: "galaxy-server", + 3052: "apc-3052", + 3053: "dsom-server", + 3054: "amt-cnf-prot", + 3055: "policyserver", + 3056: "cdl-server", + 3057: "goahead-fldup", + 3058: "videobeans", + 3059: "qsoft", + 3060: "interserver", + 3061: "cautcpd", + 3062: "ncacn-ip-tcp", + 3063: "ncadg-ip-udp", + 3064: "rprt", + 3065: "slinterbase", + 3066: "netattachsdmp", + 3067: "fjhpjp", + 3068: "ls3bcast", + 3069: "ls3", + 3070: "mgxswitch", + 3071: "csd-mgmt-port", + 3072: "csd-monitor", + 3073: "vcrp", + 3074: "xbox", + 3075: "orbix-locator", + 3076: "orbix-config", + 3077: "orbix-loc-ssl", + 3078: "orbix-cfg-ssl", + 3079: "lv-frontpanel", + 3080: "stm-pproc", + 3081: "tl1-lv", + 3082: "tl1-raw", + 3083: "tl1-telnet", + 3084: "itm-mccs", + 3085: "pcihreq", + 3086: "jdl-dbkitchen", + 3087: "asoki-sma", + 3088: "xdtp", + 3089: "ptk-alink", + 3090: "stss", + 3091: "1ci-smcs", + 3093: "rapidmq-center", + 3094: "rapidmq-reg", + 3095: "panasas", + 3096: "ndl-aps", + 3098: "umm-port", + 3099: "chmd", + 3100: "opcon-xps", + 3101: "hp-pxpib", + 3102: "slslavemon", + 3103: "autocuesmi", + 3104: "autocuetime", + 3105: "cardbox", + 3106: "cardbox-http", + 3107: "business", + 3108: "geolocate", + 3109: "personnel", + 3110: "sim-control", + 3111: "wsynch", + 3112: "ksysguard", + 3113: "cs-auth-svr", + 3114: "ccmad", + 3115: "mctet-master", + 3116: "mctet-gateway", + 3117: "mctet-jserv", + 3118: "pkagent", + 3119: "d2000kernel", + 3120: "d2000webserver", + 3122: "vtr-emulator", + 3123: "edix", + 3124: "beacon-port", + 3125: "a13-an", + 3127: "ctx-bridge", + 3128: "ndl-aas", + 3129: "netport-id", + 3130: "icpv2", + 3131: "netbookmark", + 3132: "ms-rule-engine", + 3133: "prism-deploy", + 3134: "ecp", + 3135: "peerbook-port", + 3136: "grubd", + 3137: "rtnt-1", + 3138: "rtnt-2", + 3139: "incognitorv", + 3140: "ariliamulti", + 3141: "vmodem", + 3142: "rdc-wh-eos", + 3143: "seaview", + 3144: "tarantella", + 3145: "csi-lfap", + 3146: "bears-02", + 3147: "rfio", + 3148: "nm-game-admin", + 3149: "nm-game-server", + 3150: "nm-asses-admin", + 3151: "nm-assessor", + 3152: "feitianrockey", + 3153: "s8-client-port", + 3154: "ccmrmi", + 3155: "jpegmpeg", + 3156: "indura", + 3157: "e3consultants", + 3158: "stvp", + 3159: "navegaweb-port", + 3160: "tip-app-server", + 3161: "doc1lm", + 3162: "sflm", + 3163: "res-sap", + 3164: "imprs", + 3165: "newgenpay", + 3166: "sossecollector", + 3167: "nowcontact", + 3168: "poweronnud", + 3169: "serverview-as", + 3170: "serverview-asn", + 3171: "serverview-gf", + 3172: "serverview-rm", + 3173: "serverview-icc", + 3174: "armi-server", + 3175: "t1-e1-over-ip", + 3176: "ars-master", + 3177: "phonex-port", + 3178: "radclientport", + 3179: "h2gf-w-2m", + 3180: "mc-brk-srv", + 3181: "bmcpatrolagent", + 3182: "bmcpatrolrnvu", + 3183: "cops-tls", + 3184: "apogeex-port", + 3185: "smpppd", + 3186: "iiw-port", + 3187: "odi-port", + 3188: "brcm-comm-port", + 3189: "pcle-infex", + 3190: "csvr-proxy", + 3191: "csvr-sslproxy", + 3192: "firemonrcc", + 3193: "spandataport", + 3194: "magbind", + 3195: "ncu-1", + 3196: "ncu-2", + 3197: "embrace-dp-s", + 3198: "embrace-dp-c", + 3199: "dmod-workspace", + 3200: "tick-port", + 3201: "cpq-tasksmart", + 3202: "intraintra", + 3203: "netwatcher-mon", + 3204: "netwatcher-db", + 3205: "isns", + 3206: "ironmail", + 3207: "vx-auth-port", + 3208: "pfu-prcallback", + 3209: "netwkpathengine", + 3210: "flamenco-proxy", + 3211: "avsecuremgmt", + 3212: "surveyinst", + 3213: "neon24x7", + 3214: "jmq-daemon-1", + 3215: "jmq-daemon-2", + 3216: "ferrari-foam", + 3217: "unite", + 3218: "smartpackets", + 3219: "wms-messenger", + 3220: "xnm-ssl", + 3221: "xnm-clear-text", + 3222: "glbp", + 3223: "digivote", + 3224: "aes-discovery", + 3225: "fcip-port", + 3226: "isi-irp", + 3227: "dwnmshttp", + 3228: "dwmsgserver", + 3229: "global-cd-port", + 3230: "sftdst-port", + 3231: "vidigo", + 3232: "mdtp", + 3233: "whisker", + 3234: "alchemy", + 3235: "mdap-port", + 3236: "apparenet-ts", + 3237: "apparenet-tps", + 3238: "apparenet-as", + 3239: "apparenet-ui", + 3240: "triomotion", + 3241: "sysorb", + 3242: "sdp-id-port", + 3243: "timelot", + 3244: "onesaf", + 3245: "vieo-fe", + 3246: "dvt-system", + 3247: "dvt-data", + 3248: "procos-lm", + 3249: "ssp", + 3250: "hicp", + 3251: "sysscanner", + 3252: "dhe", + 3253: "pda-data", + 3254: "pda-sys", + 3255: "semaphore", + 3256: "cpqrpm-agent", + 3257: "cpqrpm-server", + 3258: "ivecon-port", + 3259: "epncdp2", + 3260: "iscsi-target", + 3261: "winshadow", + 3262: "necp", + 3263: "ecolor-imager", + 3264: "ccmail", + 3265: "altav-tunnel", + 3266: "ns-cfg-server", + 3267: "ibm-dial-out", + 3268: "msft-gc", + 3269: "msft-gc-ssl", + 3270: "verismart", + 3271: "csoft-prev", + 3272: "user-manager", + 3273: "sxmp", + 3274: "ordinox-server", + 3275: "samd", + 3276: "maxim-asics", + 3277: "awg-proxy", + 3278: "lkcmserver", + 3279: "admind", + 3280: "vs-server", + 3281: "sysopt", + 3282: "datusorb", + 3283: "Apple Remote Desktop (Net Assistant)", + 3284: "4talk", + 3285: "plato", + 3286: "e-net", + 3287: "directvdata", + 3288: "cops", + 3289: "enpc", + 3290: "caps-lm", + 3291: "sah-lm", + 3292: "cart-o-rama", + 3293: "fg-fps", + 3294: "fg-gip", + 3295: "dyniplookup", + 3296: "rib-slm", + 3297: "cytel-lm", + 3298: "deskview", + 3299: "pdrncs", + 3302: "mcs-fastmail", + 3303: "opsession-clnt", + 3304: "opsession-srvr", + 3305: "odette-ftp", + 3306: "mysql", + 3307: "opsession-prxy", + 3308: "tns-server", + 3309: "tns-adv", + 3310: "dyna-access", + 3311: "mcns-tel-ret", + 3312: "appman-server", + 3313: "uorb", + 3314: "uohost", + 3315: "cdid", + 3316: "aicc-cmi", + 3317: "vsaiport", + 3318: "ssrip", + 3319: "sdt-lmd", + 3320: "officelink2000", + 3321: "vnsstr", + 3326: "sftu", + 3327: "bbars", + 3328: "egptlm", + 3329: "hp-device-disc", + 3330: "mcs-calypsoicf", + 3331: "mcs-messaging", + 3332: "mcs-mailsvr", + 3333: "dec-notes", + 3334: "directv-web", + 3335: "directv-soft", + 3336: "directv-tick", + 3337: "directv-catlg", + 3338: "anet-b", + 3339: "anet-l", + 3340: "anet-m", + 3341: "anet-h", + 3342: "webtie", + 3343: "ms-cluster-net", + 3344: "bnt-manager", + 3345: "influence", + 3346: "trnsprntproxy", + 3347: "phoenix-rpc", + 3348: "pangolin-laser", + 3349: "chevinservices", + 3350: "findviatv", + 3351: "btrieve", + 3352: "ssql", + 3353: "fatpipe", + 3354: "suitjd", + 3355: "ordinox-dbase", + 3356: "upnotifyps", + 3357: "adtech-test", + 3358: "mpsysrmsvr", + 3359: "wg-netforce", + 3360: "kv-server", + 3361: "kv-agent", + 3362: "dj-ilm", + 3363: "nati-vi-server", + 3364: "creativeserver", + 3365: "contentserver", + 3366: "creativepartnr", + 3372: "tip2", + 3373: "lavenir-lm", + 3374: "cluster-disc", + 3375: "vsnm-agent", + 3376: "cdbroker", + 3377: "cogsys-lm", + 3378: "wsicopy", + 3379: "socorfs", + 3380: "sns-channels", + 3381: "geneous", + 3382: "fujitsu-neat", + 3383: "esp-lm", + 3384: "hp-clic", + 3385: "qnxnetman", + 3386: "gprs-sig", + 3387: "backroomnet", + 3388: "cbserver", + 3389: "ms-wbt-server", + 3390: "dsc", + 3391: "savant", + 3392: "efi-lm", + 3393: "d2k-tapestry1", + 3394: "d2k-tapestry2", + 3395: "dyna-lm", + 3396: "printer-agent", + 3397: "cloanto-lm", + 3398: "mercantile", + 3399: "csms", + 3400: "csms2", + 3401: "filecast", + 3402: "fxaengine-net", + 3405: "nokia-ann-ch1", + 3406: "nokia-ann-ch2", + 3407: "ldap-admin", + 3408: "BESApi", + 3409: "networklens", + 3410: "networklenss", + 3411: "biolink-auth", + 3412: "xmlblaster", + 3413: "svnet", + 3414: "wip-port", + 3415: "bcinameservice", + 3416: "commandport", + 3417: "csvr", + 3418: "rnmap", + 3419: "softaudit", + 3420: "ifcp-port", + 3421: "bmap", + 3422: "rusb-sys-port", + 3423: "xtrm", + 3424: "xtrms", + 3425: "agps-port", + 3426: "arkivio", + 3427: "websphere-snmp", + 3428: "twcss", + 3429: "gcsp", + 3430: "ssdispatch", + 3431: "ndl-als", + 3432: "osdcp", + 3433: "opnet-smp", + 3434: "opencm", + 3435: "pacom", + 3436: "gc-config", + 3437: "autocueds", + 3438: "spiral-admin", + 3439: "hri-port", + 3440: "ans-console", + 3441: "connect-client", + 3442: "connect-server", + 3443: "ov-nnm-websrv", + 3444: "denali-server", + 3445: "monp", + 3446: "3comfaxrpc", + 3447: "directnet", + 3448: "dnc-port", + 3449: "hotu-chat", + 3450: "castorproxy", + 3451: "asam", + 3452: "sabp-signal", + 3453: "pscupd", + 3454: "mira", + 3455: "prsvp", + 3456: "vat", + 3457: "vat-control", + 3458: "d3winosfi", + 3459: "integral", + 3460: "edm-manager", + 3461: "edm-stager", + 3462: "edm-std-notify", + 3463: "edm-adm-notify", + 3464: "edm-mgr-sync", + 3465: "edm-mgr-cntrl", + 3466: "workflow", + 3467: "rcst", + 3468: "ttcmremotectrl", + 3469: "pluribus", + 3470: "jt400", + 3471: "jt400-ssl", + 3472: "jaugsremotec-1", + 3473: "jaugsremotec-2", + 3474: "ttntspauto", + 3475: "genisar-port", + 3476: "nppmp", + 3477: "ecomm", + 3478: "stun", + 3479: "twrpc", + 3480: "plethora", + 3481: "cleanerliverc", + 3482: "vulture", + 3483: "slim-devices", + 3484: "gbs-stp", + 3485: "celatalk", + 3486: "ifsf-hb-port", + 3487: "ltcudp", + 3488: "fs-rh-srv", + 3489: "dtp-dia", + 3490: "colubris", + 3491: "swr-port", + 3492: "tvdumtray-port", + 3493: "nut", + 3494: "ibm3494", + 3495: "seclayer-tcp", + 3496: "seclayer-tls", + 3497: "ipether232port", + 3498: "dashpas-port", + 3499: "sccip-media", + 3500: "rtmp-port", + 3501: "isoft-p2p", + 3502: "avinstalldisc", + 3503: "lsp-ping", + 3504: "ironstorm", + 3505: "ccmcomm", + 3506: "apc-3506", + 3507: "nesh-broker", + 3508: "interactionweb", + 3509: "vt-ssl", + 3510: "xss-port", + 3511: "webmail-2", + 3512: "aztec", + 3513: "arcpd", + 3514: "must-p2p", + 3515: "must-backplane", + 3516: "smartcard-port", + 3517: "802-11-iapp", + 3518: "artifact-msg", + 3519: "galileo", + 3520: "galileolog", + 3521: "mc3ss", + 3522: "nssocketport", + 3523: "odeumservlink", + 3524: "ecmport", + 3525: "eisport", + 3526: "starquiz-port", + 3527: "beserver-msg-q", + 3528: "jboss-iiop", + 3529: "jboss-iiop-ssl", + 3530: "gf", + 3531: "joltid", + 3532: "raven-rmp", + 3533: "raven-rdp", + 3534: "urld-port", + 3535: "ms-la", + 3536: "snac", + 3537: "ni-visa-remote", + 3538: "ibm-diradm", + 3539: "ibm-diradm-ssl", + 3540: "pnrp-port", + 3541: "voispeed-port", + 3542: "hacl-monitor", + 3543: "qftest-lookup", + 3544: "teredo", + 3545: "camac", + 3547: "symantec-sim", + 3548: "interworld", + 3549: "tellumat-nms", + 3550: "ssmpp", + 3551: "apcupsd", + 3552: "taserver", + 3553: "rbr-discovery", + 3554: "questnotify", + 3555: "razor", + 3556: "sky-transport", + 3557: "personalos-001", + 3558: "mcp-port", + 3559: "cctv-port", + 3560: "iniserve-port", + 3561: "bmc-onekey", + 3562: "sdbproxy", + 3563: "watcomdebug", + 3564: "esimport", + 3567: "enc-eps", + 3568: "enc-tunnel-sec", + 3569: "mbg-ctrl", + 3570: "mccwebsvr-port", + 3571: "megardsvr-port", + 3572: "megaregsvrport", + 3573: "tag-ups-1", + 3574: "dmaf-caster", + 3575: "ccm-port", + 3576: "cmc-port", + 3577: "config-port", + 3578: "data-port", + 3579: "ttat3lb", + 3580: "nati-svrloc", + 3581: "kfxaclicensing", + 3582: "press", + 3583: "canex-watch", + 3584: "u-dbap", + 3585: "emprise-lls", + 3586: "emprise-lsc", + 3587: "p2pgroup", + 3588: "sentinel", + 3589: "isomair", + 3590: "wv-csp-sms", + 3591: "gtrack-server", + 3592: "gtrack-ne", + 3593: "bpmd", + 3594: "mediaspace", + 3595: "shareapp", + 3596: "iw-mmogame", + 3597: "a14", + 3598: "a15", + 3599: "quasar-server", + 3600: "trap-daemon", + 3601: "visinet-gui", + 3602: "infiniswitchcl", + 3603: "int-rcv-cntrl", + 3604: "bmc-jmx-port", + 3605: "comcam-io", + 3606: "splitlock", + 3607: "precise-i3", + 3608: "trendchip-dcp", + 3609: "cpdi-pidas-cm", + 3610: "echonet", + 3611: "six-degrees", + 3612: "hp-dataprotect", + 3613: "alaris-disc", + 3614: "sigma-port", + 3615: "start-network", + 3616: "cd3o-protocol", + 3617: "sharp-server", + 3618: "aairnet-1", + 3619: "aairnet-2", + 3620: "ep-pcp", + 3621: "ep-nsp", + 3622: "ff-lr-port", + 3623: "haipe-discover", + 3624: "dist-upgrade", + 3625: "volley", + 3626: "bvcdaemon-port", + 3627: "jamserverport", + 3628: "ept-machine", + 3629: "escvpnet", + 3630: "cs-remote-db", + 3631: "cs-services", + 3632: "distcc", + 3633: "wacp", + 3634: "hlibmgr", + 3635: "sdo", + 3636: "servistaitsm", + 3637: "scservp", + 3638: "ehp-backup", + 3639: "xap-ha", + 3640: "netplay-port1", + 3641: "netplay-port2", + 3642: "juxml-port", + 3643: "audiojuggler", + 3644: "ssowatch", + 3645: "cyc", + 3646: "xss-srv-port", + 3647: "splitlock-gw", + 3648: "fjcp", + 3649: "nmmp", + 3650: "prismiq-plugin", + 3651: "xrpc-registry", + 3652: "vxcrnbuport", + 3653: "tsp", + 3654: "vaprtm", + 3655: "abatemgr", + 3656: "abatjss", + 3657: "immedianet-bcn", + 3658: "ps-ams", + 3659: "apple-sasl", + 3660: "can-nds-ssl", + 3661: "can-ferret-ssl", + 3662: "pserver", + 3663: "dtp", + 3664: "ups-engine", + 3665: "ent-engine", + 3666: "eserver-pap", + 3667: "infoexch", + 3668: "dell-rm-port", + 3669: "casanswmgmt", + 3670: "smile", + 3671: "efcp", + 3672: "lispworks-orb", + 3673: "mediavault-gui", + 3674: "wininstall-ipc", + 3675: "calltrax", + 3676: "va-pacbase", + 3677: "roverlog", + 3678: "ipr-dglt", + 3679: "Escale (Newton Dock)", + 3680: "npds-tracker", + 3681: "bts-x73", + 3682: "cas-mapi", + 3683: "bmc-ea", + 3684: "faxstfx-port", + 3685: "dsx-agent", + 3686: "tnmpv2", + 3687: "simple-push", + 3688: "simple-push-s", + 3689: "daap", + 3690: "svn", + 3691: "magaya-network", + 3692: "intelsync", + 3695: "bmc-data-coll", + 3696: "telnetcpcd", + 3697: "nw-license", + 3698: "sagectlpanel", + 3699: "kpn-icw", + 3700: "lrs-paging", + 3701: "netcelera", + 3702: "ws-discovery", + 3703: "adobeserver-3", + 3704: "adobeserver-4", + 3705: "adobeserver-5", + 3706: "rt-event", + 3707: "rt-event-s", + 3708: "sun-as-iiops", + 3709: "ca-idms", + 3710: "portgate-auth", + 3711: "edb-server2", + 3712: "sentinel-ent", + 3713: "tftps", + 3714: "delos-dms", + 3715: "anoto-rendezv", + 3716: "wv-csp-sms-cir", + 3717: "wv-csp-udp-cir", + 3718: "opus-services", + 3719: "itelserverport", + 3720: "ufastro-instr", + 3721: "xsync", + 3722: "xserveraid", + 3723: "sychrond", + 3724: "blizwow", + 3725: "na-er-tip", + 3726: "array-manager", + 3727: "e-mdu", + 3728: "e-woa", + 3729: "fksp-audit", + 3730: "client-ctrl", + 3731: "smap", + 3732: "m-wnn", + 3733: "multip-msg", + 3734: "synel-data", + 3735: "pwdis", + 3736: "rs-rmi", + 3738: "versatalk", + 3739: "launchbird-lm", + 3740: "heartbeat", + 3741: "wysdma", + 3742: "cst-port", + 3743: "ipcs-command", + 3744: "sasg", + 3745: "gw-call-port", + 3746: "linktest", + 3747: "linktest-s", + 3748: "webdata", + 3749: "cimtrak", + 3750: "cbos-ip-port", + 3751: "gprs-cube", + 3752: "vipremoteagent", + 3753: "nattyserver", + 3754: "timestenbroker", + 3755: "sas-remote-hlp", + 3756: "canon-capt", + 3757: "grf-port", + 3758: "apw-registry", + 3759: "exapt-lmgr", + 3760: "adtempusclient", + 3761: "gsakmp", + 3762: "gbs-smp", + 3763: "xo-wave", + 3764: "mni-prot-rout", + 3765: "rtraceroute", + 3767: "listmgr-port", + 3768: "rblcheckd", + 3769: "haipe-otnk", + 3770: "cindycollab", + 3771: "paging-port", + 3772: "ctp", + 3773: "ctdhercules", + 3774: "zicom", + 3775: "ispmmgr", + 3776: "dvcprov-port", + 3777: "jibe-eb", + 3778: "c-h-it-port", + 3779: "cognima", + 3780: "nnp", + 3781: "abcvoice-port", + 3782: "iso-tp0s", + 3783: "bim-pem", + 3784: "bfd-control", + 3785: "bfd-echo", + 3786: "upstriggervsw", + 3787: "fintrx", + 3788: "isrp-port", + 3789: "remotedeploy", + 3790: "quickbooksrds", + 3791: "tvnetworkvideo", + 3792: "sitewatch", + 3793: "dcsoftware", + 3794: "jaus", + 3795: "myblast", + 3796: "spw-dialer", + 3797: "idps", + 3798: "minilock", + 3799: "radius-dynauth", + 3800: "pwgpsi", + 3801: "ibm-mgr", + 3802: "vhd", + 3803: "soniqsync", + 3804: "iqnet-port", + 3805: "tcpdataserver", + 3806: "wsmlb", + 3807: "spugna", + 3808: "sun-as-iiops-ca", + 3809: "apocd", + 3810: "wlanauth", + 3811: "amp", + 3812: "neto-wol-server", + 3813: "rap-ip", + 3814: "neto-dcs", + 3815: "lansurveyorxml", + 3816: "sunlps-http", + 3817: "tapeware", + 3818: "crinis-hb", + 3819: "epl-slp", + 3820: "scp", + 3821: "pmcp", + 3822: "acp-discovery", + 3823: "acp-conduit", + 3824: "acp-policy", + 3825: "ffserver", + 3826: "warmux", + 3827: "netmpi", + 3828: "neteh", + 3829: "neteh-ext", + 3830: "cernsysmgmtagt", + 3831: "dvapps", + 3832: "xxnetserver", + 3833: "aipn-auth", + 3834: "spectardata", + 3835: "spectardb", + 3836: "markem-dcp", + 3837: "mkm-discovery", + 3838: "sos", + 3839: "amx-rms", + 3840: "flirtmitmir", + 3842: "nhci", + 3843: "quest-agent", + 3844: "rnm", + 3845: "v-one-spp", + 3846: "an-pcp", + 3847: "msfw-control", + 3848: "item", + 3849: "spw-dnspreload", + 3850: "qtms-bootstrap", + 3851: "spectraport", + 3852: "sse-app-config", + 3853: "sscan", + 3854: "stryker-com", + 3855: "opentrac", + 3856: "informer", + 3857: "trap-port", + 3858: "trap-port-mom", + 3859: "nav-port", + 3860: "sasp", + 3861: "winshadow-hd", + 3862: "giga-pocket", + 3863: "asap-udp", + 3865: "xpl", + 3866: "dzdaemon", + 3867: "dzoglserver", + 3869: "ovsam-mgmt", + 3870: "ovsam-d-agent", + 3871: "avocent-adsap", + 3872: "oem-agent", + 3873: "fagordnc", + 3874: "sixxsconfig", + 3875: "pnbscada", + 3876: "dl-agent", + 3877: "xmpcr-interface", + 3878: "fotogcad", + 3879: "appss-lm", + 3880: "igrs", + 3881: "idac", + 3882: "msdts1", + 3883: "vrpn", + 3884: "softrack-meter", + 3885: "topflow-ssl", + 3886: "nei-management", + 3887: "ciphire-data", + 3888: "ciphire-serv", + 3889: "dandv-tester", + 3890: "ndsconnect", + 3891: "rtc-pm-port", + 3892: "pcc-image-port", + 3893: "cgi-starapi", + 3894: "syam-agent", + 3895: "syam-smc", + 3896: "sdo-tls", + 3897: "sdo-ssh", + 3898: "senip", + 3899: "itv-control", + 3900: "udt-os", + 3901: "nimsh", + 3902: "nimaux", + 3903: "charsetmgr", + 3904: "omnilink-port", + 3905: "mupdate", + 3906: "topovista-data", + 3907: "imoguia-port", + 3908: "hppronetman", + 3909: "surfcontrolcpa", + 3910: "prnrequest", + 3911: "prnstatus", + 3912: "gbmt-stars", + 3913: "listcrt-port", + 3914: "listcrt-port-2", + 3915: "agcat", + 3916: "wysdmc", + 3917: "aftmux", + 3918: "pktcablemmcops", + 3919: "hyperip", + 3920: "exasoftport1", + 3921: "herodotus-net", + 3922: "sor-update", + 3923: "symb-sb-port", + 3924: "mpl-gprs-port", + 3925: "zmp", + 3926: "winport", + 3927: "natdataservice", + 3928: "netboot-pxe", + 3929: "smauth-port", + 3930: "syam-webserver", + 3931: "msr-plugin-port", + 3932: "dyn-site", + 3933: "plbserve-port", + 3934: "sunfm-port", + 3935: "sdp-portmapper", + 3936: "mailprox", + 3937: "dvbservdsc", + 3938: "dbcontrol-agent", + 3939: "aamp", + 3940: "xecp-node", + 3941: "homeportal-web", + 3942: "srdp", + 3943: "tig", + 3944: "sops", + 3945: "emcads", + 3946: "backupedge", + 3947: "ccp", + 3948: "apdap", + 3949: "drip", + 3950: "namemunge", + 3951: "pwgippfax", + 3952: "i3-sessionmgr", + 3953: "xmlink-connect", + 3954: "adrep", + 3955: "p2pcommunity", + 3956: "gvcp", + 3957: "mqe-broker", + 3958: "mqe-agent", + 3959: "treehopper", + 3960: "bess", + 3961: "proaxess", + 3962: "sbi-agent", + 3963: "thrp", + 3964: "sasggprs", + 3965: "ati-ip-to-ncpe", + 3966: "bflckmgr", + 3967: "ppsms", + 3968: "ianywhere-dbns", + 3969: "landmarks", + 3970: "lanrevagent", + 3971: "lanrevserver", + 3972: "iconp", + 3973: "progistics", + 3974: "citysearch", + 3975: "airshot", + 3976: "opswagent", + 3977: "opswmanager", + 3978: "secure-cfg-svr", + 3979: "smwan", + 3980: "acms", + 3981: "starfish", + 3982: "eis", + 3983: "eisp", + 3984: "mapper-nodemgr", + 3985: "mapper-mapethd", + 3986: "mapper-ws-ethd", + 3987: "centerline", + 3988: "dcs-config", + 3989: "bv-queryengine", + 3990: "bv-is", + 3991: "bv-smcsrv", + 3992: "bv-ds", + 3993: "bv-agent", + 3995: "iss-mgmt-ssl", + 3996: "abcsoftware", + 3997: "agentsease-db", + 3998: "dnx", + 3999: "nvcnet", + 4000: "terabase", + 4001: "newoak", + 4002: "pxc-spvr-ft", + 4003: "pxc-splr-ft", + 4004: "pxc-roid", + 4005: "pxc-pin", + 4006: "pxc-spvr", + 4007: "pxc-splr", + 4008: "netcheque", + 4009: "chimera-hwm", + 4010: "samsung-unidex", + 4011: "altserviceboot", + 4012: "pda-gate", + 4013: "acl-manager", + 4014: "taiclock", + 4015: "talarian-mcast1", + 4016: "talarian-mcast2", + 4017: "talarian-mcast3", + 4018: "talarian-mcast4", + 4019: "talarian-mcast5", + 4020: "trap", + 4021: "nexus-portal", + 4022: "dnox", + 4023: "esnm-zoning", + 4024: "tnp1-port", + 4025: "partimage", + 4026: "as-debug", + 4027: "bxp", + 4028: "dtserver-port", + 4029: "ip-qsig", + 4030: "jdmn-port", + 4031: "suucp", + 4032: "vrts-auth-port", + 4033: "sanavigator", + 4034: "ubxd", + 4035: "wap-push-http", + 4036: "wap-push-https", + 4037: "ravehd", + 4038: "fazzt-ptp", + 4039: "fazzt-admin", + 4040: "yo-main", + 4041: "houston", + 4042: "ldxp", + 4043: "nirp", + 4044: "ltp", + 4045: "npp", + 4046: "acp-proto", + 4047: "ctp-state", + 4049: "wafs", + 4050: "cisco-wafs", + 4051: "cppdp", + 4052: "interact", + 4053: "ccu-comm-1", + 4054: "ccu-comm-2", + 4055: "ccu-comm-3", + 4056: "lms", + 4057: "wfm", + 4058: "kingfisher", + 4059: "dlms-cosem", + 4060: "dsmeter-iatc", + 4061: "ice-location", + 4062: "ice-slocation", + 4063: "ice-router", + 4064: "ice-srouter", + 4065: "avanti-cdp", + 4066: "pmas", + 4067: "idp", + 4068: "ipfltbcst", + 4069: "minger", + 4070: "tripe", + 4071: "aibkup", + 4072: "zieto-sock", + 4073: "iRAPP", + 4074: "cequint-cityid", + 4075: "perimlan", + 4076: "seraph", + 4077: "ascomalarm", + 4079: "santools", + 4080: "lorica-in", + 4081: "lorica-in-sec", + 4082: "lorica-out", + 4083: "lorica-out-sec", + 4084: "fortisphere-vm", + 4086: "ftsync", + 4089: "opencore", + 4090: "omasgport", + 4091: "ewinstaller", + 4092: "ewdgs", + 4093: "pvxpluscs", + 4094: "sysrqd", + 4095: "xtgui", + 4096: "bre", + 4097: "patrolview", + 4098: "drmsfsd", + 4099: "dpcp", + 4100: "igo-incognito", + 4101: "brlp-0", + 4102: "brlp-1", + 4103: "brlp-2", + 4104: "brlp-3", + 4105: "shofar", + 4106: "synchronite", + 4107: "j-ac", + 4108: "accel", + 4109: "izm", + 4110: "g2tag", + 4111: "xgrid", + 4112: "apple-vpns-rp", + 4113: "aipn-reg", + 4114: "jomamqmonitor", + 4115: "cds", + 4116: "smartcard-tls", + 4117: "hillrserv", + 4118: "netscript", + 4119: "assuria-slm", + 4121: "e-builder", + 4122: "fprams", + 4123: "z-wave", + 4124: "tigv2", + 4125: "opsview-envoy", + 4126: "ddrepl", + 4127: "unikeypro", + 4128: "nufw", + 4129: "nuauth", + 4130: "fronet", + 4131: "stars", + 4132: "nuts-dem", + 4133: "nuts-bootp", + 4134: "nifty-hmi", + 4135: "cl-db-attach", + 4136: "cl-db-request", + 4137: "cl-db-remote", + 4138: "nettest", + 4139: "thrtx", + 4140: "cedros-fds", + 4141: "oirtgsvc", + 4142: "oidocsvc", + 4143: "oidsr", + 4145: "vvr-control", + 4146: "tgcconnect", + 4147: "vrxpservman", + 4148: "hhb-handheld", + 4149: "agslb", + 4150: "PowerAlert-nsa", + 4151: "menandmice-noh", + 4152: "idig-mux", + 4153: "mbl-battd", + 4154: "atlinks", + 4155: "bzr", + 4156: "stat-results", + 4157: "stat-scanner", + 4158: "stat-cc", + 4159: "nss", + 4160: "jini-discovery", + 4161: "omscontact", + 4162: "omstopology", + 4163: "silverpeakpeer", + 4164: "silverpeakcomm", + 4165: "altcp", + 4166: "joost", + 4167: "ddgn", + 4168: "pslicser", + 4169: "iadt-disc", + 4172: "pcoip", + 4173: "mma-discovery", + 4174: "sm-disc", + 4177: "wello", + 4178: "storman", + 4179: "MaxumSP", + 4180: "httpx", + 4181: "macbak", + 4182: "pcptcpservice", + 4183: "gmmp", + 4184: "universe-suite", + 4185: "wcpp", + 4188: "vatata", + 4191: "dsmipv6", + 4192: "azeti-bd", + 4199: "eims-admin", + 4300: "corelccam", + 4301: "d-data", + 4302: "d-data-control", + 4303: "srcp", + 4304: "owserver", + 4305: "batman", + 4306: "pinghgl", + 4307: "visicron-vs", + 4308: "compx-lockview", + 4309: "dserver", + 4310: "mirrtex", + 4320: "fdt-rcatp", + 4321: "rwhois", + 4322: "trim-event", + 4323: "trim-ice", + 4324: "balour", + 4325: "geognosisman", + 4326: "geognosis", + 4327: "jaxer-web", + 4328: "jaxer-manager", + 4333: "ahsp", + 4340: "gaia", + 4341: "lisp-data", + 4342: "lisp-control", + 4343: "unicall", + 4344: "vinainstall", + 4345: "m4-network-as", + 4346: "elanlm", + 4347: "lansurveyor", + 4348: "itose", + 4349: "fsportmap", + 4350: "net-device", + 4351: "plcy-net-svcs", + 4352: "pjlink", + 4353: "f5-iquery", + 4354: "qsnet-trans", + 4355: "qsnet-workst", + 4356: "qsnet-assist", + 4357: "qsnet-cond", + 4358: "qsnet-nucl", + 4359: "omabcastltkm", + 4361: "nacnl", + 4362: "afore-vdp-disc", + 4368: "wxbrief", + 4369: "epmd", + 4370: "elpro-tunnel", + 4371: "l2c-disc", + 4372: "l2c-data", + 4373: "remctl", + 4375: "tolteces", + 4376: "bip", + 4377: "cp-spxsvr", + 4378: "cp-spxdpy", + 4379: "ctdb", + 4389: "xandros-cms", + 4390: "wiegand", + 4394: "apwi-disc", + 4395: "omnivisionesx", + 4400: "ds-srv", + 4401: "ds-srvr", + 4402: "ds-clnt", + 4403: "ds-user", + 4404: "ds-admin", + 4405: "ds-mail", + 4406: "ds-slp", + 4425: "netrockey6", + 4426: "beacon-port-2", + 4430: "rsqlserver", + 4432: "l-acoustics", + 4441: "netblox", + 4442: "saris", + 4443: "pharos", + 4444: "krb524", + 4445: "upnotifyp", + 4446: "n1-fwp", + 4447: "n1-rmgmt", + 4448: "asc-slmd", + 4449: "privatewire", + 4450: "camp", + 4451: "ctisystemmsg", + 4452: "ctiprogramload", + 4453: "nssalertmgr", + 4454: "nssagentmgr", + 4455: "prchat-user", + 4456: "prchat-server", + 4457: "prRegister", + 4458: "mcp", + 4484: "hpssmgmt", + 4486: "icms", + 4488: "awacs-ice", + 4500: "ipsec-nat-t", + 4534: "armagetronad", + 4535: "ehs", + 4536: "ehs-ssl", + 4537: "wssauthsvc", + 4538: "swx-gate", + 4545: "worldscores", + 4546: "sf-lm", + 4547: "lanner-lm", + 4548: "synchromesh", + 4549: "aegate", + 4550: "gds-adppiw-db", + 4551: "ieee-mih", + 4552: "menandmice-mon", + 4554: "msfrs", + 4555: "rsip", + 4556: "dtn-bundle", + 4557: "mtcevrunqss", + 4558: "mtcevrunqman", + 4559: "hylafax", + 4566: "kwtc", + 4567: "tram", + 4568: "bmc-reporting", + 4569: "iax", + 4591: "l3t-at-an", + 4592: "hrpd-ith-at-an", + 4593: "ipt-anri-anri", + 4594: "ias-session", + 4595: "ias-paging", + 4596: "ias-neighbor", + 4597: "a21-an-1xbs", + 4598: "a16-an-an", + 4599: "a17-an-an", + 4600: "piranha1", + 4601: "piranha2", + 4658: "playsta2-app", + 4659: "playsta2-lob", + 4660: "smaclmgr", + 4661: "kar2ouche", + 4662: "oms", + 4663: "noteit", + 4664: "ems", + 4665: "contclientms", + 4666: "eportcomm", + 4667: "mmacomm", + 4668: "mmaeds", + 4669: "eportcommdata", + 4670: "light", + 4671: "acter", + 4672: "rfa", + 4673: "cxws", + 4674: "appiq-mgmt", + 4675: "dhct-status", + 4676: "dhct-alerts", + 4677: "bcs", + 4678: "traversal", + 4679: "mgesupervision", + 4680: "mgemanagement", + 4681: "parliant", + 4682: "finisar", + 4683: "spike", + 4684: "rfid-rp1", + 4685: "autopac", + 4686: "msp-os", + 4687: "nst", + 4688: "mobile-p2p", + 4689: "altovacentral", + 4690: "prelude", + 4691: "mtn", + 4692: "conspiracy", + 4700: "netxms-agent", + 4701: "netxms-mgmt", + 4702: "netxms-sync", + 4725: "truckstar", + 4726: "a26-fap-fgw", + 4727: "fcis-disc", + 4728: "capmux", + 4729: "gsmtap", + 4730: "gearman", + 4732: "ohmtrigger", + 4737: "ipdr-sp", + 4738: "solera-lpn", + 4739: "ipfix", + 4740: "ipfixs", + 4741: "lumimgrd", + 4742: "sicct-sdp", + 4743: "openhpid", + 4744: "ifsp", + 4745: "fmp", + 4747: "buschtrommel", + 4749: "profilemac", + 4750: "ssad", + 4751: "spocp", + 4752: "snap", + 4753: "simon-disc", + 4784: "bfd-multi-ctl", + 4785: "cncp", + 4789: "vxlan", + 4790: "vxlan-gpe", + 4800: "iims", + 4801: "iwec", + 4802: "ilss", + 4803: "notateit-disc", + 4804: "aja-ntv4-disc", + 4827: "htcp", + 4837: "varadero-0", + 4838: "varadero-1", + 4839: "varadero-2", + 4840: "opcua-udp", + 4841: "quosa", + 4842: "gw-asv", + 4843: "opcua-tls", + 4844: "gw-log", + 4845: "wcr-remlib", + 4846: "contamac-icm", + 4847: "wfc", + 4848: "appserv-http", + 4849: "appserv-https", + 4850: "sun-as-nodeagt", + 4851: "derby-repli", + 4867: "unify-debug", + 4868: "phrelay", + 4869: "phrelaydbg", + 4870: "cc-tracking", + 4871: "wired", + 4876: "tritium-can", + 4877: "lmcs", + 4878: "inst-discovery", + 4881: "socp-t", + 4882: "socp-c", + 4884: "hivestor", + 4885: "abbs", + 4894: "lyskom", + 4899: "radmin-port", + 4900: "hfcs", + 4914: "bones", + 4936: "an-signaling", + 4937: "atsc-mh-ssc", + 4940: "eq-office-4940", + 4941: "eq-office-4941", + 4942: "eq-office-4942", + 4949: "munin", + 4950: "sybasesrvmon", + 4951: "pwgwims", + 4952: "sagxtsds", + 4969: "ccss-qmm", + 4970: "ccss-qsm", + 4986: "mrip", + 4987: "smar-se-port1", + 4988: "smar-se-port2", + 4989: "parallel", + 4990: "busycal", + 4991: "vrt", + 4999: "hfcs-manager", + 5000: "commplex-main", + 5001: "commplex-link", + 5002: "rfe", + 5003: "fmpro-internal", + 5004: "avt-profile-1", + 5005: "avt-profile-2", + 5006: "wsm-server", + 5007: "wsm-server-ssl", + 5008: "synapsis-edge", + 5009: "winfs", + 5010: "telelpathstart", + 5011: "telelpathattack", + 5012: "nsp", + 5013: "fmpro-v6", + 5014: "onpsocket", + 5020: "zenginkyo-1", + 5021: "zenginkyo-2", + 5022: "mice", + 5023: "htuilsrv", + 5024: "scpi-telnet", + 5025: "scpi-raw", + 5026: "strexec-d", + 5027: "strexec-s", + 5029: "infobright", + 5030: "surfpass", + 5031: "dmp", + 5042: "asnaacceler8db", + 5043: "swxadmin", + 5044: "lxi-evntsvc", + 5046: "vpm-udp", + 5047: "iscape", + 5049: "ivocalize", + 5050: "mmcc", + 5051: "ita-agent", + 5052: "ita-manager", + 5053: "rlm-disc", + 5055: "unot", + 5056: "intecom-ps1", + 5057: "intecom-ps2", + 5058: "locus-disc", + 5059: "sds", + 5060: "sip", + 5061: "sips", + 5062: "na-localise", + 5064: "ca-1", + 5065: "ca-2", + 5066: "stanag-5066", + 5067: "authentx", + 5069: "i-net-2000-npr", + 5070: "vtsas", + 5071: "powerschool", + 5072: "ayiya", + 5073: "tag-pm", + 5074: "alesquery", + 5078: "pixelpusher", + 5079: "cp-spxrpts", + 5080: "onscreen", + 5081: "sdl-ets", + 5082: "qcp", + 5083: "qfp", + 5084: "llrp", + 5085: "encrypted-llrp", + 5092: "magpie", + 5093: "sentinel-lm", + 5094: "hart-ip", + 5099: "sentlm-srv2srv", + 5100: "socalia", + 5101: "talarian-udp", + 5102: "oms-nonsecure", + 5104: "tinymessage", + 5105: "hughes-ap", + 5111: "taep-as-svc", + 5112: "pm-cmdsvr", + 5116: "emb-proj-cmd", + 5120: "barracuda-bbs", + 5133: "nbt-pc", + 5136: "minotaur-sa", + 5137: "ctsd", + 5145: "rmonitor-secure", + 5150: "atmp", + 5151: "esri-sde", + 5152: "sde-discovery", + 5154: "bzflag", + 5155: "asctrl-agent", + 5164: "vpa-disc", + 5165: "ife-icorp", + 5166: "winpcs", + 5167: "scte104", + 5168: "scte30", + 5190: "aol", + 5191: "aol-1", + 5192: "aol-2", + 5193: "aol-3", + 5200: "targus-getdata", + 5201: "targus-getdata1", + 5202: "targus-getdata2", + 5203: "targus-getdata3", + 5223: "hpvirtgrp", + 5224: "hpvirtctrl", + 5225: "hp-server", + 5226: "hp-status", + 5227: "perfd", + 5234: "eenet", + 5235: "galaxy-network", + 5236: "padl2sim", + 5237: "mnet-discovery", + 5245: "downtools-disc", + 5246: "capwap-control", + 5247: "capwap-data", + 5248: "caacws", + 5249: "caaclang2", + 5250: "soagateway", + 5251: "caevms", + 5252: "movaz-ssc", + 5264: "3com-njack-1", + 5265: "3com-njack-2", + 5270: "cartographerxmp", + 5271: "cuelink-disc", + 5272: "pk", + 5282: "transmit-port", + 5298: "presence", + 5299: "nlg-data", + 5300: "hacl-hb", + 5301: "hacl-gs", + 5302: "hacl-cfg", + 5303: "hacl-probe", + 5304: "hacl-local", + 5305: "hacl-test", + 5306: "sun-mc-grp", + 5307: "sco-aip", + 5308: "cfengine", + 5309: "jprinter", + 5310: "outlaws", + 5312: "permabit-cs", + 5313: "rrdp", + 5314: "opalis-rbt-ipc", + 5315: "hacl-poll", + 5343: "kfserver", + 5344: "xkotodrcp", + 5349: "stuns", + 5350: "pcp-multicast", + 5351: "pcp", + 5352: "dns-llq", + 5353: "mdns", + 5354: "mdnsresponder", + 5355: "llmnr", + 5356: "ms-smlbiz", + 5357: "wsdapi", + 5358: "wsdapi-s", + 5359: "ms-alerter", + 5360: "ms-sideshow", + 5361: "ms-s-sideshow", + 5362: "serverwsd2", + 5363: "net-projection", + 5364: "kdnet", + 5397: "stresstester", + 5398: "elektron-admin", + 5399: "securitychase", + 5400: "excerpt", + 5401: "excerpts", + 5402: "mftp", + 5403: "hpoms-ci-lstn", + 5404: "hpoms-dps-lstn", + 5405: "netsupport", + 5406: "systemics-sox", + 5407: "foresyte-clear", + 5408: "foresyte-sec", + 5409: "salient-dtasrv", + 5410: "salient-usrmgr", + 5411: "actnet", + 5412: "continuus", + 5413: "wwiotalk", + 5414: "statusd", + 5415: "ns-server", + 5416: "sns-gateway", + 5417: "sns-agent", + 5418: "mcntp", + 5419: "dj-ice", + 5420: "cylink-c", + 5421: "netsupport2", + 5422: "salient-mux", + 5423: "virtualuser", + 5424: "beyond-remote", + 5425: "br-channel", + 5426: "devbasic", + 5427: "sco-peer-tta", + 5428: "telaconsole", + 5429: "base", + 5430: "radec-corp", + 5431: "park-agent", + 5432: "postgresql", + 5433: "pyrrho", + 5434: "sgi-arrayd", + 5435: "sceanics", + 5436: "pmip6-cntl", + 5437: "pmip6-data", + 5443: "spss", + 5453: "surebox", + 5454: "apc-5454", + 5455: "apc-5455", + 5456: "apc-5456", + 5461: "silkmeter", + 5462: "ttl-publisher", + 5463: "ttlpriceproxy", + 5464: "quailnet", + 5465: "netops-broker", + 5500: "fcp-addr-srvr1", + 5501: "fcp-addr-srvr2", + 5502: "fcp-srvr-inst1", + 5503: "fcp-srvr-inst2", + 5504: "fcp-cics-gw1", + 5505: "checkoutdb", + 5506: "amc", + 5553: "sgi-eventmond", + 5554: "sgi-esphttp", + 5555: "personal-agent", + 5556: "freeciv", + 5567: "enc-eps-mc-sec", + 5568: "sdt", + 5569: "rdmnet-device", + 5573: "sdmmp", + 5580: "tmosms0", + 5581: "tmosms1", + 5582: "fac-restore", + 5583: "tmo-icon-sync", + 5584: "bis-web", + 5585: "bis-sync", + 5597: "ininmessaging", + 5598: "mctfeed", + 5599: "esinstall", + 5600: "esmmanager", + 5601: "esmagent", + 5602: "a1-msc", + 5603: "a1-bs", + 5604: "a3-sdunode", + 5605: "a4-sdunode", + 5627: "ninaf", + 5628: "htrust", + 5629: "symantec-sfdb", + 5630: "precise-comm", + 5631: "pcanywheredata", + 5632: "pcanywherestat", + 5633: "beorl", + 5634: "xprtld", + 5670: "zre-disc", + 5671: "amqps", + 5672: "amqp", + 5673: "jms", + 5674: "hyperscsi-port", + 5675: "v5ua", + 5676: "raadmin", + 5677: "questdb2-lnchr", + 5678: "rrac", + 5679: "dccm", + 5680: "auriga-router", + 5681: "ncxcp", + 5682: "brightcore", + 5683: "coap", + 5684: "coaps", + 5687: "gog-multiplayer", + 5688: "ggz", + 5689: "qmvideo", + 5713: "proshareaudio", + 5714: "prosharevideo", + 5715: "prosharedata", + 5716: "prosharerequest", + 5717: "prosharenotify", + 5718: "dpm", + 5719: "dpm-agent", + 5720: "ms-licensing", + 5721: "dtpt", + 5722: "msdfsr", + 5723: "omhs", + 5724: "omsdk", + 5728: "io-dist-group", + 5729: "openmail", + 5730: "unieng", + 5741: "ida-discover1", + 5742: "ida-discover2", + 5743: "watchdoc-pod", + 5744: "watchdoc", + 5745: "fcopy-server", + 5746: "fcopys-server", + 5747: "tunatic", + 5748: "tunalyzer", + 5750: "rscd", + 5755: "openmailg", + 5757: "x500ms", + 5766: "openmailns", + 5767: "s-openmail", + 5768: "openmailpxy", + 5769: "spramsca", + 5770: "spramsd", + 5771: "netagent", + 5777: "dali-port", + 5781: "3par-evts", + 5782: "3par-mgmt", + 5783: "3par-mgmt-ssl", + 5784: "ibar", + 5785: "3par-rcopy", + 5786: "cisco-redu", + 5787: "waascluster", + 5793: "xtreamx", + 5794: "spdp", + 5813: "icmpd", + 5814: "spt-automation", + 5859: "wherehoo", + 5863: "ppsuitemsg", + 5900: "rfb", + 5910: "cm", + 5911: "cpdlc", + 5912: "fis", + 5913: "ads-c", + 5963: "indy", + 5968: "mppolicy-v5", + 5969: "mppolicy-mgr", + 5984: "couchdb", + 5985: "wsman", + 5986: "wsmans", + 5987: "wbem-rmi", + 5988: "wbem-http", + 5989: "wbem-https", + 5990: "wbem-exp-https", + 5991: "nuxsl", + 5992: "consul-insight", + 5999: "cvsup", + 6064: "ndl-ahp-svc", + 6065: "winpharaoh", + 6066: "ewctsp", + 6069: "trip", + 6070: "messageasap", + 6071: "ssdtp", + 6072: "diagnose-proc", + 6073: "directplay8", + 6074: "max", + 6081: "geneve", + 6082: "p25cai", + 6083: "miami-bcast", + 6085: "konspire2b", + 6086: "pdtp", + 6087: "ldss", + 6088: "doglms-notify", + 6100: "synchronet-db", + 6101: "synchronet-rtc", + 6102: "synchronet-upd", + 6103: "rets", + 6104: "dbdb", + 6105: "primaserver", + 6106: "mpsserver", + 6107: "etc-control", + 6108: "sercomm-scadmin", + 6109: "globecast-id", + 6110: "softcm", + 6111: "spc", + 6112: "dtspcd", + 6118: "tipc", + 6122: "bex-webadmin", + 6123: "backup-express", + 6124: "pnbs", + 6133: "nbt-wol", + 6140: "pulsonixnls", + 6141: "meta-corp", + 6142: "aspentec-lm", + 6143: "watershed-lm", + 6144: "statsci1-lm", + 6145: "statsci2-lm", + 6146: "lonewolf-lm", + 6147: "montage-lm", + 6148: "ricardo-lm", + 6149: "tal-pod", + 6160: "ecmp-data", + 6161: "patrol-ism", + 6162: "patrol-coll", + 6163: "pscribe", + 6200: "lm-x", + 6201: "thermo-calc", + 6222: "radmind", + 6241: "jeol-nsddp-1", + 6242: "jeol-nsddp-2", + 6243: "jeol-nsddp-3", + 6244: "jeol-nsddp-4", + 6251: "tl1-raw-ssl", + 6252: "tl1-ssh", + 6253: "crip", + 6268: "grid", + 6269: "grid-alt", + 6300: "bmc-grx", + 6301: "bmc-ctd-ldap", + 6306: "ufmp", + 6315: "scup-disc", + 6316: "abb-escp", + 6317: "nav-data", + 6320: "repsvc", + 6321: "emp-server1", + 6322: "emp-server2", + 6324: "hrd-ns-disc", + 6343: "sflow", + 6346: "gnutella-svc", + 6347: "gnutella-rtr", + 6350: "adap", + 6355: "pmcs", + 6360: "metaedit-mu", + 6363: "ndn", + 6370: "metaedit-se", + 6382: "metatude-mds", + 6389: "clariion-evr01", + 6390: "metaedit-ws", + 6417: "faxcomservice", + 6420: "nim-vdrshell", + 6421: "nim-wan", + 6443: "sun-sr-https", + 6444: "sge-qmaster", + 6445: "sge-execd", + 6446: "mysql-proxy", + 6455: "skip-cert-recv", + 6456: "skip-cert-send", + 6471: "lvision-lm", + 6480: "sun-sr-http", + 6481: "servicetags", + 6482: "ldoms-mgmt", + 6483: "SunVTS-RMI", + 6484: "sun-sr-jms", + 6485: "sun-sr-iiop", + 6486: "sun-sr-iiops", + 6487: "sun-sr-iiop-aut", + 6488: "sun-sr-jmx", + 6489: "sun-sr-admin", + 6500: "boks", + 6501: "boks-servc", + 6502: "boks-servm", + 6503: "boks-clntd", + 6505: "badm-priv", + 6506: "badm-pub", + 6507: "bdir-priv", + 6508: "bdir-pub", + 6509: "mgcs-mfp-port", + 6510: "mcer-port", + 6511: "dccp-udp", + 6514: "syslog-tls", + 6515: "elipse-rec", + 6543: "lds-distrib", + 6544: "lds-dump", + 6547: "apc-6547", + 6548: "apc-6548", + 6549: "apc-6549", + 6550: "fg-sysupdate", + 6551: "sum", + 6558: "xdsxdm", + 6566: "sane-port", + 6568: "rp-reputation", + 6579: "affiliate", + 6580: "parsec-master", + 6581: "parsec-peer", + 6582: "parsec-game", + 6583: "joaJewelSuite", + 6619: "odette-ftps", + 6620: "kftp-data", + 6621: "kftp", + 6622: "mcftp", + 6623: "ktelnet", + 6626: "wago-service", + 6627: "nexgen", + 6628: "afesc-mc", + 6633: "cisco-vpath-tun", + 6634: "mpls-pm", + 6653: "openflow", + 6657: "palcom-disc", + 6670: "vocaltec-gold", + 6671: "p4p-portal", + 6672: "vision-server", + 6673: "vision-elmd", + 6678: "vfbp-disc", + 6679: "osaut", + 6689: "tsa", + 6696: "babel", + 6701: "kti-icad-srvr", + 6702: "e-design-net", + 6703: "e-design-web", + 6714: "ibprotocol", + 6715: "fibotrader-com", + 6767: "bmc-perf-agent", + 6768: "bmc-perf-mgrd", + 6769: "adi-gxp-srvprt", + 6770: "plysrv-http", + 6771: "plysrv-https", + 6784: "bfd-lag", + 6785: "dgpf-exchg", + 6786: "smc-jmx", + 6787: "smc-admin", + 6788: "smc-http", + 6789: "smc-https", + 6790: "hnmp", + 6791: "hnm", + 6801: "acnet", + 6831: "ambit-lm", + 6841: "netmo-default", + 6842: "netmo-http", + 6850: "iccrushmore", + 6868: "acctopus-st", + 6888: "muse", + 6935: "ethoscan", + 6936: "xsmsvc", + 6946: "bioserver", + 6951: "otlp", + 6961: "jmact3", + 6962: "jmevt2", + 6963: "swismgr1", + 6964: "swismgr2", + 6965: "swistrap", + 6966: "swispol", + 6969: "acmsoda", + 6997: "MobilitySrv", + 6998: "iatp-highpri", + 6999: "iatp-normalpri", + 7000: "afs3-fileserver", + 7001: "afs3-callback", + 7002: "afs3-prserver", + 7003: "afs3-vlserver", + 7004: "afs3-kaserver", + 7005: "afs3-volser", + 7006: "afs3-errors", + 7007: "afs3-bos", + 7008: "afs3-update", + 7009: "afs3-rmtsys", + 7010: "ups-onlinet", + 7011: "talon-disc", + 7012: "talon-engine", + 7013: "microtalon-dis", + 7014: "microtalon-com", + 7015: "talon-webserver", + 7019: "doceri-view", + 7020: "dpserve", + 7021: "dpserveadmin", + 7022: "ctdp", + 7023: "ct2nmcs", + 7024: "vmsvc", + 7025: "vmsvc-2", + 7030: "op-probe", + 7040: "quest-disc", + 7070: "arcp", + 7071: "iwg1", + 7080: "empowerid", + 7095: "jdp-disc", + 7099: "lazy-ptop", + 7100: "font-service", + 7101: "elcn", + 7107: "aes-x170", + 7121: "virprot-lm", + 7128: "scenidm", + 7129: "scenccs", + 7161: "cabsm-comm", + 7162: "caistoragemgr", + 7163: "cacsambroker", + 7164: "fsr", + 7165: "doc-server", + 7166: "aruba-server", + 7169: "ccag-pib", + 7170: "nsrp", + 7171: "drm-production", + 7174: "clutild", + 7181: "janus-disc", + 7200: "fodms", + 7201: "dlip", + 7227: "ramp", + 7235: "aspcoordination", + 7262: "cnap", + 7272: "watchme-7272", + 7273: "oma-rlp", + 7274: "oma-rlp-s", + 7275: "oma-ulp", + 7276: "oma-ilp", + 7277: "oma-ilp-s", + 7278: "oma-dcdocbs", + 7279: "ctxlic", + 7280: "itactionserver1", + 7281: "itactionserver2", + 7282: "mzca-alert", + 7365: "lcm-server", + 7391: "mindfilesys", + 7392: "mrssrendezvous", + 7393: "nfoldman", + 7394: "fse", + 7395: "winqedit", + 7397: "hexarc", + 7400: "rtps-discovery", + 7401: "rtps-dd-ut", + 7402: "rtps-dd-mt", + 7410: "ionixnetmon", + 7411: "daqstream", + 7421: "mtportmon", + 7426: "pmdmgr", + 7427: "oveadmgr", + 7428: "ovladmgr", + 7429: "opi-sock", + 7430: "xmpv7", + 7431: "pmd", + 7437: "faximum", + 7443: "oracleas-https", + 7473: "rise", + 7491: "telops-lmd", + 7500: "silhouette", + 7501: "ovbus", + 7510: "ovhpas", + 7511: "pafec-lm", + 7542: "saratoga", + 7543: "atul", + 7544: "nta-ds", + 7545: "nta-us", + 7546: "cfs", + 7547: "cwmp", + 7548: "tidp", + 7549: "nls-tl", + 7550: "cloudsignaling", + 7560: "sncp", + 7566: "vsi-omega", + 7570: "aries-kfinder", + 7574: "coherence-disc", + 7588: "sun-lm", + 7624: "indi", + 7627: "soap-http", + 7628: "zen-pawn", + 7629: "xdas", + 7633: "pmdfmgt", + 7648: "cuseeme", + 7674: "imqtunnels", + 7675: "imqtunnel", + 7676: "imqbrokerd", + 7677: "sun-user-https", + 7680: "pando-pub", + 7689: "collaber", + 7697: "klio", + 7707: "sync-em7", + 7708: "scinet", + 7720: "medimageportal", + 7724: "nsdeepfreezectl", + 7725: "nitrogen", + 7726: "freezexservice", + 7727: "trident-data", + 7734: "smip", + 7738: "aiagent", + 7741: "scriptview", + 7743: "sstp-1", + 7744: "raqmon-pdu", + 7747: "prgp", + 7777: "cbt", + 7778: "interwise", + 7779: "vstat", + 7781: "accu-lmgr", + 7786: "minivend", + 7787: "popup-reminders", + 7789: "office-tools", + 7794: "q3ade", + 7797: "pnet-conn", + 7798: "pnet-enc", + 7799: "altbsdp", + 7800: "asr", + 7801: "ssp-client", + 7802: "vns-tp", + 7810: "rbt-wanopt", + 7845: "apc-7845", + 7846: "apc-7846", + 7872: "mipv6tls", + 7880: "pss", + 7887: "ubroker", + 7900: "mevent", + 7901: "tnos-sp", + 7902: "tnos-dp", + 7903: "tnos-dps", + 7913: "qo-secure", + 7932: "t2-drm", + 7933: "t2-brm", + 7962: "generalsync", + 7967: "supercell", + 7979: "micromuse-ncps", + 7980: "quest-vista", + 7982: "sossd-disc", + 7998: "usicontentpush", + 7999: "irdmi2", + 8000: "irdmi", + 8001: "vcom-tunnel", + 8002: "teradataordbms", + 8003: "mcreport", + 8005: "mxi", + 8008: "http-alt", + 8019: "qbdb", + 8020: "intu-ec-svcdisc", + 8021: "intu-ec-client", + 8022: "oa-system", + 8025: "ca-audit-da", + 8026: "ca-audit-ds", + 8032: "pro-ed", + 8033: "mindprint", + 8034: "vantronix-mgmt", + 8040: "ampify", + 8052: "senomix01", + 8053: "senomix02", + 8054: "senomix03", + 8055: "senomix04", + 8056: "senomix05", + 8057: "senomix06", + 8058: "senomix07", + 8059: "senomix08", + 8060: "aero", + 8074: "gadugadu", + 8080: "http-alt", + 8081: "sunproxyadmin", + 8082: "us-cli", + 8083: "us-srv", + 8086: "d-s-n", + 8087: "simplifymedia", + 8088: "radan-http", + 8097: "sac", + 8100: "xprint-server", + 8115: "mtl8000-matrix", + 8116: "cp-cluster", + 8118: "privoxy", + 8121: "apollo-data", + 8122: "apollo-admin", + 8128: "paycash-online", + 8129: "paycash-wbp", + 8130: "indigo-vrmi", + 8131: "indigo-vbcp", + 8132: "dbabble", + 8148: "isdd", + 8149: "eor-game", + 8160: "patrol", + 8161: "patrol-snmp", + 8182: "vmware-fdm", + 8184: "itach", + 8192: "spytechphone", + 8194: "blp1", + 8195: "blp2", + 8199: "vvr-data", + 8200: "trivnet1", + 8201: "trivnet2", + 8202: "aesop", + 8204: "lm-perfworks", + 8205: "lm-instmgr", + 8206: "lm-dta", + 8207: "lm-sserver", + 8208: "lm-webwatcher", + 8230: "rexecj", + 8243: "synapse-nhttps", + 8276: "pando-sec", + 8280: "synapse-nhttp", + 8292: "blp3", + 8294: "blp4", + 8300: "tmi", + 8301: "amberon", + 8320: "tnp-discover", + 8321: "tnp", + 8351: "server-find", + 8376: "cruise-enum", + 8377: "cruise-swroute", + 8378: "cruise-config", + 8379: "cruise-diags", + 8380: "cruise-update", + 8383: "m2mservices", + 8400: "cvd", + 8401: "sabarsd", + 8402: "abarsd", + 8403: "admind", + 8416: "espeech", + 8417: "espeech-rtp", + 8442: "cybro-a-bus", + 8443: "pcsync-https", + 8444: "pcsync-http", + 8445: "copy-disc", + 8450: "npmp", + 8472: "otv", + 8473: "vp2p", + 8474: "noteshare", + 8500: "fmtp", + 8501: "cmtp-av", + 8554: "rtsp-alt", + 8555: "d-fence", + 8567: "enc-tunnel", + 8600: "asterix", + 8609: "canon-cpp-disc", + 8610: "canon-mfnp", + 8611: "canon-bjnp1", + 8612: "canon-bjnp2", + 8613: "canon-bjnp3", + 8614: "canon-bjnp4", + 8675: "msi-cps-rm-disc", + 8686: "sun-as-jmxrmi", + 8732: "dtp-net", + 8733: "ibus", + 8763: "mc-appserver", + 8764: "openqueue", + 8765: "ultraseek-http", + 8766: "amcs", + 8770: "dpap", + 8786: "msgclnt", + 8787: "msgsrvr", + 8793: "acd-pm", + 8800: "sunwebadmin", + 8804: "truecm", + 8873: "dxspider", + 8880: "cddbp-alt", + 8883: "secure-mqtt", + 8888: "ddi-udp-1", + 8889: "ddi-udp-2", + 8890: "ddi-udp-3", + 8891: "ddi-udp-4", + 8892: "ddi-udp-5", + 8893: "ddi-udp-6", + 8894: "ddi-udp-7", + 8899: "ospf-lite", + 8900: "jmb-cds1", + 8901: "jmb-cds2", + 8910: "manyone-http", + 8911: "manyone-xml", + 8912: "wcbackup", + 8913: "dragonfly", + 8954: "cumulus-admin", + 8989: "sunwebadmins", + 8990: "http-wmap", + 8991: "https-wmap", + 8999: "bctp", + 9000: "cslistener", + 9001: "etlservicemgr", + 9002: "dynamid", + 9007: "ogs-client", + 9009: "pichat", + 9020: "tambora", + 9021: "panagolin-ident", + 9022: "paragent", + 9023: "swa-1", + 9024: "swa-2", + 9025: "swa-3", + 9026: "swa-4", + 9080: "glrpc", + 9084: "aurora", + 9085: "ibm-rsyscon", + 9086: "net2display", + 9087: "classic", + 9088: "sqlexec", + 9089: "sqlexec-ssl", + 9090: "websm", + 9091: "xmltec-xmlmail", + 9092: "XmlIpcRegSvc", + 9100: "hp-pdl-datastr", + 9101: "bacula-dir", + 9102: "bacula-fd", + 9103: "bacula-sd", + 9104: "peerwire", + 9105: "xadmin", + 9106: "astergate-disc", + 9119: "mxit", + 9131: "dddp", + 9160: "apani1", + 9161: "apani2", + 9162: "apani3", + 9163: "apani4", + 9164: "apani5", + 9191: "sun-as-jpda", + 9200: "wap-wsp", + 9201: "wap-wsp-wtp", + 9202: "wap-wsp-s", + 9203: "wap-wsp-wtp-s", + 9204: "wap-vcard", + 9205: "wap-vcal", + 9206: "wap-vcard-s", + 9207: "wap-vcal-s", + 9208: "rjcdb-vcards", + 9209: "almobile-system", + 9210: "oma-mlp", + 9211: "oma-mlp-s", + 9212: "serverviewdbms", + 9213: "serverstart", + 9214: "ipdcesgbs", + 9215: "insis", + 9216: "acme", + 9217: "fsc-port", + 9222: "teamcoherence", + 9255: "mon", + 9277: "traingpsdata", + 9278: "pegasus", + 9279: "pegasus-ctl", + 9280: "pgps", + 9281: "swtp-port1", + 9282: "swtp-port2", + 9283: "callwaveiam", + 9284: "visd", + 9285: "n2h2server", + 9286: "n2receive", + 9287: "cumulus", + 9292: "armtechdaemon", + 9293: "storview", + 9294: "armcenterhttp", + 9295: "armcenterhttps", + 9300: "vrace", + 9318: "secure-ts", + 9321: "guibase", + 9343: "mpidcmgr", + 9344: "mphlpdmc", + 9346: "ctechlicensing", + 9374: "fjdmimgr", + 9380: "boxp", + 9396: "fjinvmgr", + 9397: "mpidcagt", + 9400: "sec-t4net-srv", + 9401: "sec-t4net-clt", + 9402: "sec-pc2fax-srv", + 9418: "git", + 9443: "tungsten-https", + 9444: "wso2esb-console", + 9450: "sntlkeyssrvr", + 9500: "ismserver", + 9522: "sma-spw", + 9535: "mngsuite", + 9536: "laes-bf", + 9555: "trispen-sra", + 9592: "ldgateway", + 9593: "cba8", + 9594: "msgsys", + 9595: "pds", + 9596: "mercury-disc", + 9597: "pd-admin", + 9598: "vscp", + 9599: "robix", + 9600: "micromuse-ncpw", + 9612: "streamcomm-ds", + 9618: "condor", + 9628: "odbcpathway", + 9629: "uniport", + 9632: "mc-comm", + 9667: "xmms2", + 9668: "tec5-sdctp", + 9694: "client-wakeup", + 9695: "ccnx", + 9700: "board-roar", + 9747: "l5nas-parchan", + 9750: "board-voip", + 9753: "rasadv", + 9762: "tungsten-http", + 9800: "davsrc", + 9801: "sstp-2", + 9802: "davsrcs", + 9875: "sapv1", + 9878: "kca-service", + 9888: "cyborg-systems", + 9889: "gt-proxy", + 9898: "monkeycom", + 9899: "sctp-tunneling", + 9900: "iua", + 9901: "enrp", + 9903: "multicast-ping", + 9909: "domaintime", + 9911: "sype-transport", + 9950: "apc-9950", + 9951: "apc-9951", + 9952: "apc-9952", + 9953: "acis", + 9955: "alljoyn-mcm", + 9956: "alljoyn", + 9966: "odnsp", + 9987: "dsm-scm-target", + 9990: "osm-appsrvr", + 9991: "osm-oev", + 9992: "palace-1", + 9993: "palace-2", + 9994: "palace-3", + 9995: "palace-4", + 9996: "palace-5", + 9997: "palace-6", + 9998: "distinct32", + 9999: "distinct", + 10000: "ndmp", + 10001: "scp-config", + 10002: "documentum", + 10003: "documentum-s", + 10007: "mvs-capacity", + 10008: "octopus", + 10009: "swdtp-sv", + 10050: "zabbix-agent", + 10051: "zabbix-trapper", + 10080: "amanda", + 10081: "famdc", + 10100: "itap-ddtp", + 10101: "ezmeeting-2", + 10102: "ezproxy-2", + 10103: "ezrelay", + 10104: "swdtp", + 10107: "bctp-server", + 10110: "nmea-0183", + 10111: "nmea-onenet", + 10113: "netiq-endpoint", + 10114: "netiq-qcheck", + 10115: "netiq-endpt", + 10116: "netiq-voipa", + 10117: "iqrm", + 10128: "bmc-perf-sd", + 10160: "qb-db-server", + 10161: "snmpdtls", + 10162: "snmpdtls-trap", + 10200: "trisoap", + 10201: "rscs", + 10252: "apollo-relay", + 10260: "axis-wimp-port", + 10288: "blocks", + 10439: "bngsync", + 10500: "hip-nat-t", + 10540: "MOS-lower", + 10541: "MOS-upper", + 10542: "MOS-aux", + 10543: "MOS-soap", + 10544: "MOS-soap-opt", + 10800: "gap", + 10805: "lpdg", + 10810: "nmc-disc", + 10860: "helix", + 10880: "bveapi", + 10990: "rmiaux", + 11000: "irisa", + 11001: "metasys", + 10023: "cefd-vmp", + 11095: "weave", + 11106: "sgi-lk", + 11108: "myq-termlink", + 11111: "vce", + 11112: "dicom", + 11161: "suncacao-snmp", + 11162: "suncacao-jmxmp", + 11163: "suncacao-rmi", + 11164: "suncacao-csa", + 11165: "suncacao-websvc", + 11171: "snss", + 11201: "smsqp", + 11208: "wifree", + 11211: "memcache", + 11319: "imip", + 11320: "imip-channels", + 11321: "arena-server", + 11367: "atm-uhas", + 11371: "hkp", + 11430: "lsdp", + 11600: "tempest-port", + 11720: "h323callsigalt", + 11723: "emc-xsw-dcache", + 11751: "intrepid-ssl", + 11796: "lanschool-mpt", + 11876: "xoraya", + 11877: "x2e-disc", + 11967: "sysinfo-sp", + 12000: "entextxid", + 12001: "entextnetwk", + 12002: "entexthigh", + 12003: "entextmed", + 12004: "entextlow", + 12005: "dbisamserver1", + 12006: "dbisamserver2", + 12007: "accuracer", + 12008: "accuracer-dbms", + 12009: "ghvpn", + 12012: "vipera", + 12013: "vipera-ssl", + 12109: "rets-ssl", + 12121: "nupaper-ss", + 12168: "cawas", + 12172: "hivep", + 12300: "linogridengine", + 12321: "warehouse-sss", + 12322: "warehouse", + 12345: "italk", + 12753: "tsaf", + 13160: "i-zipqd", + 13216: "bcslogc", + 13217: "rs-pias", + 13218: "emc-vcas-udp", + 13223: "powwow-client", + 13224: "powwow-server", + 13400: "doip-disc", + 13720: "bprd", + 13721: "bpdbm", + 13722: "bpjava-msvc", + 13724: "vnetd", + 13782: "bpcd", + 13783: "vopied", + 13785: "nbdb", + 13786: "nomdb", + 13818: "dsmcc-config", + 13819: "dsmcc-session", + 13820: "dsmcc-passthru", + 13821: "dsmcc-download", + 13822: "dsmcc-ccp", + 13894: "ucontrol", + 13929: "dta-systems", + 14000: "scotty-ft", + 14001: "sua", + 14002: "scotty-disc", + 14033: "sage-best-com1", + 14034: "sage-best-com2", + 14141: "vcs-app", + 14142: "icpp", + 14145: "gcm-app", + 14149: "vrts-tdd", + 14154: "vad", + 14250: "cps", + 14414: "ca-web-update", + 14936: "hde-lcesrvr-1", + 14937: "hde-lcesrvr-2", + 15000: "hydap", + 15118: "v2g-secc", + 15345: "xpilot", + 15363: "3link", + 15555: "cisco-snat", + 15660: "bex-xr", + 15740: "ptp", + 15998: "2ping", + 16003: "alfin", + 16161: "sun-sea-port", + 16309: "etb4j", + 16310: "pduncs", + 16311: "pdefmns", + 16360: "netserialext1", + 16361: "netserialext2", + 16367: "netserialext3", + 16368: "netserialext4", + 16384: "connected", + 16666: "vtp", + 16900: "newbay-snc-mc", + 16950: "sgcip", + 16991: "intel-rci-mp", + 16992: "amt-soap-http", + 16993: "amt-soap-https", + 16994: "amt-redir-tcp", + 16995: "amt-redir-tls", + 17007: "isode-dua", + 17185: "soundsvirtual", + 17219: "chipper", + 17220: "avtp", + 17221: "avdecc", + 17222: "cpsp", + 17234: "integrius-stp", + 17235: "ssh-mgmt", + 17500: "db-lsp-disc", + 17729: "ea", + 17754: "zep", + 17755: "zigbee-ip", + 17756: "zigbee-ips", + 18000: "biimenu", + 18181: "opsec-cvp", + 18182: "opsec-ufp", + 18183: "opsec-sam", + 18184: "opsec-lea", + 18185: "opsec-omi", + 18186: "ohsc", + 18187: "opsec-ela", + 18241: "checkpoint-rtm", + 18262: "gv-pf", + 18463: "ac-cluster", + 18634: "rds-ib", + 18635: "rds-ip", + 18769: "ique", + 18881: "infotos", + 18888: "apc-necmp", + 19000: "igrid", + 19007: "scintilla", + 19191: "opsec-uaa", + 19194: "ua-secureagent", + 19283: "keysrvr", + 19315: "keyshadow", + 19398: "mtrgtrans", + 19410: "hp-sco", + 19411: "hp-sca", + 19412: "hp-sessmon", + 19539: "fxuptp", + 19540: "sxuptp", + 19541: "jcp", + 19788: "mle", + 19999: "dnp-sec", + 20000: "dnp", + 20001: "microsan", + 20002: "commtact-http", + 20003: "commtact-https", + 20005: "openwebnet", + 20012: "ss-idi-disc", + 20014: "opendeploy", + 20034: "nburn-id", + 20046: "tmophl7mts", + 20048: "mountd", + 20049: "nfsrdma", + 20167: "tolfab", + 20202: "ipdtp-port", + 20222: "ipulse-ics", + 20480: "emwavemsg", + 20670: "track", + 20999: "athand-mmp", + 21000: "irtrans", + 21554: "dfserver", + 21590: "vofr-gateway", + 21800: "tvpm", + 21845: "webphone", + 21846: "netspeak-is", + 21847: "netspeak-cs", + 21848: "netspeak-acd", + 21849: "netspeak-cps", + 22000: "snapenetio", + 22001: "optocontrol", + 22002: "optohost002", + 22003: "optohost003", + 22004: "optohost004", + 22005: "optohost004", + 22273: "wnn6", + 22305: "cis", + 22343: "cis-secure", + 22347: "wibukey", + 22350: "codemeter", + 22555: "vocaltec-phone", + 22763: "talikaserver", + 22800: "aws-brf", + 22951: "brf-gw", + 23000: "inovaport1", + 23001: "inovaport2", + 23002: "inovaport3", + 23003: "inovaport4", + 23004: "inovaport5", + 23005: "inovaport6", + 23272: "s102", + 23333: "elxmgmt", + 23400: "novar-dbase", + 23401: "novar-alarm", + 23402: "novar-global", + 24000: "med-ltp", + 24001: "med-fsp-rx", + 24002: "med-fsp-tx", + 24003: "med-supp", + 24004: "med-ovw", + 24005: "med-ci", + 24006: "med-net-svc", + 24242: "filesphere", + 24249: "vista-4gl", + 24321: "ild", + 24322: "hid", + 24386: "intel-rci", + 24465: "tonidods", + 24554: "binkp", + 24577: "bilobit-update", + 24676: "canditv", + 24677: "flashfiler", + 24678: "proactivate", + 24680: "tcc-http", + 24850: "assoc-disc", + 24922: "find", + 25000: "icl-twobase1", + 25001: "icl-twobase2", + 25002: "icl-twobase3", + 25003: "icl-twobase4", + 25004: "icl-twobase5", + 25005: "icl-twobase6", + 25006: "icl-twobase7", + 25007: "icl-twobase8", + 25008: "icl-twobase9", + 25009: "icl-twobase10", + 25793: "vocaltec-hos", + 25900: "tasp-net", + 25901: "niobserver", + 25902: "nilinkanalyst", + 25903: "niprobe", + 25954: "bf-game", + 25955: "bf-master", + 26000: "quake", + 26133: "scscp", + 26208: "wnn6-ds", + 26260: "ezproxy", + 26261: "ezmeeting", + 26262: "k3software-svr", + 26263: "k3software-cli", + 26486: "exoline-udp", + 26487: "exoconfig", + 26489: "exonet", + 27345: "imagepump", + 27442: "jesmsjc", + 27504: "kopek-httphead", + 27782: "ars-vista", + 27999: "tw-auth-key", + 28000: "nxlmd", + 28119: "a27-ran-ran", + 28200: "voxelstorm", + 28240: "siemensgsm", + 29167: "otmp", + 30001: "pago-services1", + 30002: "pago-services2", + 30003: "amicon-fpsu-ra", + 30004: "amicon-fpsu-s", + 30260: "kingdomsonline", + 30832: "samsung-disc", + 30999: "ovobs", + 31029: "yawn", + 31416: "xqosd", + 31457: "tetrinet", + 31620: "lm-mon", + 31765: "gamesmith-port", + 31948: "iceedcp-tx", + 31949: "iceedcp-rx", + 32034: "iracinghelper", + 32249: "t1distproc60", + 32483: "apm-link", + 32635: "sec-ntb-clnt", + 32636: "DMExpress", + 32767: "filenet-powsrm", + 32768: "filenet-tms", + 32769: "filenet-rpc", + 32770: "filenet-nch", + 32771: "filenet-rmi", + 32772: "filenet-pa", + 32773: "filenet-cm", + 32774: "filenet-re", + 32775: "filenet-pch", + 32776: "filenet-peior", + 32777: "filenet-obrok", + 32801: "mlsn", + 32896: "idmgratm", + 33123: "aurora-balaena", + 33331: "diamondport", + 33334: "speedtrace-disc", + 33434: "traceroute", + 33656: "snip-slave", + 34249: "turbonote-2", + 34378: "p-net-local", + 34379: "p-net-remote", + 34962: "profinet-rt", + 34963: "profinet-rtm", + 34964: "profinet-cm", + 34980: "ethercat", + 35001: "rt-viewer", + 35004: "rt-classmanager", + 35355: "altova-lm-disc", + 36001: "allpeers", + 36865: "kastenxpipe", + 37475: "neckar", + 37654: "unisys-eportal", + 38201: "galaxy7-data", + 38202: "fairview", + 38203: "agpolicy", + 39681: "turbonote-1", + 40000: "safetynetp", + 40841: "cscp", + 40842: "csccredir", + 40843: "csccfirewall", + 40853: "ortec-disc", + 41111: "fs-qos", + 41794: "crestron-cip", + 41795: "crestron-ctp", + 42508: "candp", + 42509: "candrp", + 42510: "caerpc", + 43000: "recvr-rc-disc", + 43188: "reachout", + 43189: "ndm-agent-port", + 43190: "ip-provision", + 43210: "shaperai-disc", + 43439: "eq3-config", + 43440: "ew-disc-cmd", + 43441: "ciscocsdb", + 44321: "pmcd", + 44322: "pmcdproxy", + 44544: "domiq", + 44553: "rbr-debug", + 44600: "asihpi", + 44818: "EtherNet-IP-2", + 44900: "m3da-disc", + 45000: "asmp-mon", + 45054: "invision-ag", + 45678: "eba", + 45825: "qdb2service", + 45966: "ssr-servermgr", + 46999: "mediabox", + 47000: "mbus", + 47100: "jvl-mactalk", + 47557: "dbbrowse", + 47624: "directplaysrvr", + 47806: "ap", + 47808: "bacnet", + 47809: "presonus-ucnet", + 48000: "nimcontroller", + 48001: "nimspooler", + 48002: "nimhub", + 48003: "nimgtw", + 48128: "isnetserv", + 48129: "blp5", + 48556: "com-bardac-dw", + 48619: "iqobject", + 48653: "robotraconteur", +} +var sctpPortNames = map[SCTPPort]string{ + 9: "discard", + 20: "ftp-data", + 21: "ftp", + 22: "ssh", + 80: "http", + 179: "bgp", + 443: "https", + 1021: "exp1", + 1022: "exp2", + 1167: "cisco-ipsla", + 1720: "h323hostcall", + 2049: "nfs", + 2225: "rcip-itu", + 2904: "m2ua", + 2905: "m3ua", + 2944: "megaco-h248", + 2945: "h248-binary", + 3097: "itu-bicc-stc", + 3565: "m2pa", + 3863: "asap-sctp", + 3864: "asap-sctp-tls", + 3868: "diameter", + 4333: "ahsp", + 4502: "a25-fap-fgw", + 4739: "ipfix", + 4740: "ipfixs", + 5060: "sip", + 5061: "sips", + 5090: "car", + 5091: "cxtp", + 5215: "noteza", + 5445: "smbdirect", + 5672: "amqp", + 5675: "v5ua", + 5868: "diameters", + 5910: "cm", + 5911: "cpdlc", + 5912: "fis", + 5913: "ads-c", + 6704: "frc-hp", + 6705: "frc-mp", + 6706: "frc-lp", + 6970: "conductor-mpx", + 7626: "simco", + 8471: "pim-port", + 9082: "lcs-ap", + 9084: "aurora", + 9900: "iua", + 9901: "enrp-sctp", + 9902: "enrp-sctp-tls", + 11997: "wmereceiving", + 11998: "wmedistribution", + 11999: "wmereporting", + 14001: "sua", + 20049: "nfsrdma", + 25471: "rna", + 29118: "sgsap", + 29168: "sbcap", + 29169: "iuhsctpassoc", + 36412: "s1-control", + 36422: "x2-control", + 36443: "m2ap", + 36444: "m3ap", +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/icmp4.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/icmp4.go new file mode 100644 index 00000000..e9599879 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/icmp4.go @@ -0,0 +1,202 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" + "strconv" +) + +type ICMPv4TypeCode uint16 + +const ( + ICMPv4TypeEchoReply = 0 + ICMPv4TypeDestinationUnreachable = 3 + ICMPv4TypeSourceQuench = 4 + ICMPv4TypeRedirect = 5 + ICMPv4TypeEchoRequest = 8 + ICMPv4TypeRouterAdvertisement = 9 + ICMPv4TypeRouterSolicitation = 10 + ICMPv4TypeTimeExceeded = 11 + ICMPv4TypeParameterProblem = 12 + ICMPv4TypeTimestampRequest = 13 + ICMPv4TypeTimestampReply = 14 + ICMPv4TypeInfoRequest = 15 + ICMPv4TypeInfoReply = 16 + ICMPv4TypeAddressMaskRequest = 17 + ICMPv4TypeAddressMaskReply = 18 +) + +// ICMPv4 is the layer for IPv4 ICMP packet data. +type ICMPv4 struct { + BaseLayer + TypeCode ICMPv4TypeCode + Checksum uint16 + Id uint16 + Seq uint16 +} + +// LayerType returns gopacket.LayerTypeICMPv4 +func (i *ICMPv4) LayerType() gopacket.LayerType { return LayerTypeICMPv4 } + +func decodeICMPv4(data []byte, p gopacket.PacketBuilder) error { + i := &ICMPv4{} + err := i.DecodeFromBytes(data, p) + if err != nil { + return err + } + p.AddLayer(i) + return p.NextDecoder(gopacket.LayerTypePayload) +} + +var tooShort error = fmt.Errorf("icmp layer less than 8 bytes") + +func (i *ICMPv4) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + if len(data) < 8 { + df.SetTruncated() + return tooShort + } + i.TypeCode = ICMPv4TypeCode(binary.BigEndian.Uint16(data[:2])) + i.Checksum = binary.BigEndian.Uint16(data[2:4]) + i.Id = binary.BigEndian.Uint16(data[4:6]) + i.Seq = binary.BigEndian.Uint16(data[6:8]) + i.BaseLayer = BaseLayer{data[:8], data[8:]} + return nil +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (i *ICMPv4) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + bytes, err := b.PrependBytes(8) + if err != nil { + return err + } + binary.BigEndian.PutUint16(bytes, uint16(i.TypeCode)) + binary.BigEndian.PutUint16(bytes[4:], i.Id) + binary.BigEndian.PutUint16(bytes[6:], i.Seq) + if opts.ComputeChecksums { + bytes[2] = 0 + bytes[3] = 0 + i.Checksum = tcpipChecksum(b.Bytes(), 0) + } + binary.BigEndian.PutUint16(bytes[2:], i.Checksum) + return nil +} + +func (i *ICMPv4) CanDecode() gopacket.LayerClass { + return LayerTypeICMPv4 +} + +func (i *ICMPv4) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypePayload +} + +func (a ICMPv4TypeCode) String() string { + typ := uint8(a >> 8) + code := uint8(a) + var typeStr, codeStr string + switch typ { + case ICMPv4TypeDestinationUnreachable: + typeStr = "DestinationUnreachable" + switch code { + case 0: + codeStr = "Net" + case 1: + codeStr = "Host" + case 2: + codeStr = "Protocol" + case 3: + codeStr = "Port" + case 4: + codeStr = "FragmentationNeeded" + case 5: + codeStr = "SourceRoutingFailed" + case 6: + codeStr = "NetUnknown" + case 7: + codeStr = "HostUnknown" + case 8: + codeStr = "SourceIsolated" + case 9: + codeStr = "NetAdminProhibited" + case 10: + codeStr = "HostAdminProhibited" + case 11: + codeStr = "NetTOS" + case 12: + codeStr = "HostTOS" + case 13: + codeStr = "CommAdminProhibited" + case 14: + codeStr = "HostPrecedence" + case 15: + codeStr = "PrecedenceCutoff" + } + case ICMPv4TypeTimeExceeded: + typeStr = "TimeExceeded" + switch code { + case 0: + codeStr = "TTLExceeded" + case 1: + codeStr = "FragmentReassemblyTimeExceeded" + } + case ICMPv4TypeParameterProblem: + typeStr = "ParameterProblem" + switch code { + case 0: + codeStr = "PointerIndicatesError" + case 1: + codeStr = "MissingOption" + case 2: + codeStr = "BadLength" + } + case ICMPv4TypeSourceQuench: + typeStr = "SourceQuench" + case ICMPv4TypeRedirect: + typeStr = "Redirect" + switch code { + case 0: + codeStr = "Network" + case 1: + codeStr = "Host" + case 2: + codeStr = "TOS+Network" + case 3: + codeStr = "TOS+Host" + } + case ICMPv4TypeEchoRequest: + typeStr = "EchoRequest" + case ICMPv4TypeEchoReply: + typeStr = "EchoReply" + case ICMPv4TypeTimestampRequest: + typeStr = "TimestampRequest" + case ICMPv4TypeTimestampReply: + typeStr = "TimestampReply" + case ICMPv4TypeInfoRequest: + typeStr = "InfoRequest" + case ICMPv4TypeInfoReply: + typeStr = "InfoReply" + case ICMPv4TypeRouterSolicitation: + typeStr = "RouterSolicitation" + case ICMPv4TypeRouterAdvertisement: + typeStr = "RouterAdvertisement" + case ICMPv4TypeAddressMaskRequest: + typeStr = "AddressMaskRequest" + case ICMPv4TypeAddressMaskReply: + typeStr = "AddressMaskReply" + default: + typeStr = strconv.Itoa(int(typ)) + } + if codeStr == "" { + codeStr = strconv.Itoa(int(code)) + } + return fmt.Sprintf("%s(%s)", typeStr, codeStr) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/icmp6.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/icmp6.go new file mode 100644 index 00000000..f7eae922 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/icmp6.go @@ -0,0 +1,156 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" + "strconv" +) + +type ICMPv6TypeCode uint16 + +const ( + ICMPv6TypeDestinationUnreachable = 1 + ICMPv6TypePacketTooBig = 2 + ICMPv6TypeTimeExceeded = 3 + ICMPv6TypeParameterProblem = 4 + ICMPv6TypeEchoRequest = 128 + ICMPv6TypeEchoReply = 129 + // The following are from RFC 4861 + ICMPv6TypeRouterSolicitation = 133 + ICMPv6TypeRouterAdvertisement = 134 + ICMPv6TypeNeighborSolicitation = 135 + ICMPv6TypeNeighborAdvertisement = 136 + ICMPv6TypeRedirect = 137 +) + +func (a ICMPv6TypeCode) String() string { + typ := uint8(a >> 8) + code := uint8(a) + var typeStr, codeStr string + switch typ { + case ICMPv6TypeDestinationUnreachable: + typeStr = "DestinationUnreachable" + switch code { + case 0: + codeStr = "NoRouteToDst" + case 1: + codeStr = "AdminProhibited" + case 3: + codeStr = "Address" + case 4: + codeStr = "Port" + } + case ICMPv6TypePacketTooBig: + typeStr = "PacketTooBig" + case ICMPv6TypeTimeExceeded: + typeStr = "TimeExceeded" + switch code { + case 0: + codeStr = "HopLimitExceeded" + case 1: + codeStr = "FragmentReassemblyTimeExceeded" + } + case ICMPv6TypeParameterProblem: + typeStr = "ParameterProblem" + switch code { + case 0: + codeStr = "ErroneousHeader" + case 1: + codeStr = "UnrecognizedNextHeader" + case 2: + codeStr = "UnrecognizedIPv6Option" + } + case ICMPv6TypeEchoRequest: + typeStr = "EchoRequest" + case ICMPv6TypeEchoReply: + typeStr = "EchoReply" + case ICMPv6TypeRouterSolicitation: + typeStr = "RouterSolicitation" + case ICMPv6TypeRouterAdvertisement: + typeStr = "RouterAdvertisement" + case ICMPv6TypeNeighborSolicitation: + typeStr = "NeighborSolicitation" + case ICMPv6TypeNeighborAdvertisement: + typeStr = "NeighborAdvertisement" + case ICMPv6TypeRedirect: + typeStr = "Redirect" + default: + typeStr = strconv.Itoa(int(typ)) + } + if codeStr == "" { + codeStr = strconv.Itoa(int(code)) + } + return fmt.Sprintf("%s(%s)", typeStr, codeStr) +} + +// ICMPv6 is the layer for IPv6 ICMP packet data +type ICMPv6 struct { + BaseLayer + TypeCode ICMPv6TypeCode + Checksum uint16 + TypeBytes []byte + tcpipchecksum +} + +// LayerType returns LayerTypeICMPv6. +func (i *ICMPv6) LayerType() gopacket.LayerType { return LayerTypeICMPv6 } + +// DecodeFromBytes decodes the given bytes into this layer. +func (i *ICMPv6) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + i.TypeCode = ICMPv6TypeCode(binary.BigEndian.Uint16(data[:2])) + i.Checksum = binary.BigEndian.Uint16(data[2:4]) + i.TypeBytes = data[4:8] + i.BaseLayer = BaseLayer{data[:8], data[8:]} + return nil +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (i *ICMPv6) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + if i.TypeBytes == nil { + i.TypeBytes = lotsOfZeros[:4] + } else if len(i.TypeBytes) != 4 { + return fmt.Errorf("invalid type bytes for ICMPv6 packet: %v", i.TypeBytes) + } + bytes, err := b.PrependBytes(8) + if err != nil { + return err + } + binary.BigEndian.PutUint16(bytes, uint16(i.TypeCode)) + copy(bytes[4:8], i.TypeBytes) + if opts.ComputeChecksums { + bytes[2] = 0 + bytes[3] = 0 + csum, err := i.computeChecksum(b.Bytes()) + if err != nil { + return err + } + i.Checksum = csum + } + binary.BigEndian.PutUint16(bytes[2:], i.Checksum) + return nil +} + +// CanDecode returns the set of layer types that this DecodingLayer can decode. +func (i *ICMPv6) CanDecode() gopacket.LayerClass { + return LayerTypeICMPv6 +} + +// NextLayerType returns the layer type contained by this DecodingLayer. +func (i *ICMPv6) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypePayload +} + +func decodeICMPv6(data []byte, p gopacket.PacketBuilder) error { + i := &ICMPv6{} + return decodingLayerDecoder(i, data, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/igmp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/igmp.go new file mode 100644 index 00000000..c975bf26 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/igmp.go @@ -0,0 +1,83 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "github.com/tsg/gopacket" + "net" + "time" +) + +type IGMPType uint8 + +// IGMP is the packet structure for IGMP messages. +type IGMP struct { + BaseLayer + Type IGMPType + MaxResponseTime time.Duration + Checksum uint16 + GroupAddress net.IP + // The following are used only by IGMPv3 + SupressRouterProcessing bool + RobustnessValue uint8 + IntervalTime time.Duration + SourceAddresses []net.IP +} + +// LayerType returns LayerTypeIGMP +func (i *IGMP) LayerType() gopacket.LayerType { return LayerTypeIGMP } + +// igmpTimeDecode decodes the duration created by the given byte, using the +// algorithm in http://www.rfc-base.org/txt/rfc-3376.txt section 4.1.1. +func igmpTimeDecode(t uint8) time.Duration { + if t&0x80 == 0 { + return time.Millisecond * 100 * time.Duration(t) + } + mant := (t & 0x70) >> 4 + exp := t & 0x0F + return time.Millisecond * 100 * time.Duration((mant|0x10)<<(exp+3)) +} + +// DecodeFromBytes decodes the given bytes into this layer. +func (i *IGMP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + i.Type = IGMPType(data[0]) + i.MaxResponseTime = igmpTimeDecode(data[1]) + i.Checksum = binary.BigEndian.Uint16(data[2:4]) + i.GroupAddress = net.IP(data[4:8]) + if i.Type == 0x11 && len(data) > 8 { + i.SupressRouterProcessing = data[8]&0x8 != 0 + i.RobustnessValue = data[8] & 0x7 + i.IntervalTime = igmpTimeDecode(data[9]) + numSources := int(binary.BigEndian.Uint16(data[10:12])) + for j := 0; j < numSources; j++ { + i.SourceAddresses = append(i.SourceAddresses, net.IP(data[12+j*4:16+j*4])) + } + } else { + i.SupressRouterProcessing = false + i.RobustnessValue = 0 + i.IntervalTime = 0 + i.SourceAddresses = nil + } + return nil +} + +// CanDecode returns the set of layer types that this DecodingLayer can decode. +func (i *IGMP) CanDecode() gopacket.LayerClass { + return LayerTypeIGMP +} + +// NextLayerType returns the layer type contained by this DecodingLayer. +func (i *IGMP) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypeZero +} + +func decodeIGMP(data []byte, p gopacket.PacketBuilder) error { + i := &IGMP{} + return decodingLayerDecoder(i, data, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ip4.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ip4.go new file mode 100644 index 00000000..59571367 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ip4.go @@ -0,0 +1,221 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" + "net" + "strings" +) + +type IPv4Flag uint8 + +const ( + IPv4EvilBit IPv4Flag = 1 << 2 // http://tools.ietf.org/html/rfc3514 ;) + IPv4DontFragment IPv4Flag = 1 << 1 + IPv4MoreFragments IPv4Flag = 1 << 0 +) + +func (f IPv4Flag) String() string { + var s []string + if f&IPv4EvilBit != 0 { + s = append(s, "Evil") + } + if f&IPv4DontFragment != 0 { + s = append(s, "DF") + } + if f&IPv4MoreFragments != 0 { + s = append(s, "MF") + } + return strings.Join(s, "|") +} + +// IPv4 is the header of an IP packet. +type IPv4 struct { + BaseLayer + Version uint8 + IHL uint8 + TOS uint8 + Length uint16 + Id uint16 + Flags IPv4Flag + FragOffset uint16 + TTL uint8 + Protocol IPProtocol + Checksum uint16 + SrcIP net.IP + DstIP net.IP + Options []IPv4Option + Padding []byte +} + +// LayerType returns LayerTypeIPv4 +func (i *IPv4) LayerType() gopacket.LayerType { return LayerTypeIPv4 } +func (i *IPv4) NetworkFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointIPv4, i.SrcIP, i.DstIP) +} + +type IPv4Option struct { + OptionType uint8 + OptionLength uint8 + OptionData []byte +} + +func (i IPv4Option) String() string { + return fmt.Sprintf("IPv4Option(%v:%v)", i.OptionType, i.OptionData) +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +func (ip *IPv4) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + if len(ip.Options) > 0 { + return fmt.Errorf("cannot currently serialize IPv4 options") + } + bytes, err := b.PrependBytes(20) + if err != nil { + return err + } + if opts.FixLengths { + ip.IHL = 5 // Fix when we add support for options. + ip.Length = uint16(len(b.Bytes())) + } + bytes[0] = (ip.Version << 4) | ip.IHL + bytes[1] = ip.TOS + binary.BigEndian.PutUint16(bytes[2:], ip.Length) + binary.BigEndian.PutUint16(bytes[4:], ip.Id) + binary.BigEndian.PutUint16(bytes[6:], ip.flagsfrags()) + bytes[8] = ip.TTL + bytes[9] = byte(ip.Protocol) + if len(ip.SrcIP) != 4 { + return fmt.Errorf("invalid src IP %v", ip.SrcIP) + } + if len(ip.DstIP) != 4 { + return fmt.Errorf("invalid dst IP %v", ip.DstIP) + } + copy(bytes[12:16], ip.SrcIP) + copy(bytes[16:20], ip.DstIP) + if opts.ComputeChecksums { + // Clear checksum bytes + bytes[10] = 0 + bytes[11] = 0 + // Compute checksum + var csum uint32 + for i := 0; i < len(bytes); i += 2 { + csum += uint32(bytes[i]) << 8 + csum += uint32(bytes[i+1]) + } + ip.Checksum = ^uint16((csum >> 16) + csum) + } + binary.BigEndian.PutUint16(bytes[10:], ip.Checksum) + return nil +} + +func (ip *IPv4) flagsfrags() (ff uint16) { + ff |= uint16(ip.Flags) << 13 + ff |= ip.FragOffset + return +} + +// DecodeFromBytes decodes the given bytes into this layer. +func (ip *IPv4) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + flagsfrags := binary.BigEndian.Uint16(data[6:8]) + + ip.Version = uint8(data[0]) >> 4 + ip.IHL = uint8(data[0]) & 0x0F + ip.TOS = data[1] + ip.Length = binary.BigEndian.Uint16(data[2:4]) + ip.Id = binary.BigEndian.Uint16(data[4:6]) + ip.Flags = IPv4Flag(flagsfrags >> 13) + ip.FragOffset = flagsfrags & 0x1FFF + ip.TTL = data[8] + ip.Protocol = IPProtocol(data[9]) + ip.Checksum = binary.BigEndian.Uint16(data[10:12]) + ip.SrcIP = data[12:16] + ip.DstIP = data[16:20] + // Set up an initial guess for contents/payload... we'll reset these soon. + ip.BaseLayer = BaseLayer{Contents: data} + + // This code is added for the following enviroment: + // * Windows 10 with TSO option activated. ( tested on Hyper-V, RealTek ethernet driver ) + if ip.Length == 0 { + // If using TSO(TCP Segmentation Offload), length is zero. + // The actual packet length is the length of data. + ip.Length = uint16(len(data)) + } + + if ip.Length < 20 { + return fmt.Errorf("Invalid (too small) IP length (%d < 20)", ip.Length) + } else if ip.IHL < 5 { + return fmt.Errorf("Invalid (too small) IP header length (%d < 5)", ip.IHL) + } else if int(ip.IHL*4) > int(ip.Length) { + return fmt.Errorf("Invalid IP header length > IP length (%d > %d)", ip.IHL, ip.Length) + } + if cmp := len(data) - int(ip.Length); cmp > 0 { + data = data[:ip.Length] + } else if cmp < 0 { + df.SetTruncated() + if int(ip.IHL)*4 > len(data) { + return fmt.Errorf("Not all IP header bytes available") + } + } + ip.Contents = data[:ip.IHL*4] + ip.Payload = data[ip.IHL*4:] + // From here on, data contains the header options. + data = data[20 : ip.IHL*4] + // Pull out IP options + for len(data) > 0 { + if ip.Options == nil { + // Pre-allocate to avoid growing the slice too much. + ip.Options = make([]IPv4Option, 0, 4) + } + opt := IPv4Option{OptionType: data[0]} + switch opt.OptionType { + case 0: // End of options + opt.OptionLength = 1 + ip.Options = append(ip.Options, opt) + ip.Padding = data[1:] + break + case 1: // 1 byte padding + opt.OptionLength = 1 + default: + opt.OptionLength = data[1] + opt.OptionData = data[2:opt.OptionLength] + } + if len(data) >= int(opt.OptionLength) { + data = data[opt.OptionLength:] + } else { + return fmt.Errorf("IP option length exceeds remaining IP header size, option type %v length %v", opt.OptionType, opt.OptionLength) + } + ip.Options = append(ip.Options, opt) + } + return nil +} + +func (i *IPv4) CanDecode() gopacket.LayerClass { + return LayerTypeIPv4 +} + +func (i *IPv4) NextLayerType() gopacket.LayerType { + if i.Flags&IPv4MoreFragments != 0 || i.FragOffset != 0 { + return gopacket.LayerTypeFragment + } + return i.Protocol.LayerType() +} + +func decodeIPv4(data []byte, p gopacket.PacketBuilder) error { + ip := &IPv4{} + err := ip.DecodeFromBytes(data, p) + p.AddLayer(ip) + p.SetNetworkLayer(ip) + if err != nil { + return err + } + return p.NextDecoder(ip.NextLayerType()) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ip6.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ip6.go new file mode 100644 index 00000000..82ad244e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ip6.go @@ -0,0 +1,386 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" + "net" +) + +// IPv6 is the layer for the IPv6 header. +type IPv6 struct { + // http://www.networksorcery.com/enp/protocol/ipv6.htm + BaseLayer + Version uint8 + TrafficClass uint8 + FlowLabel uint32 + Length uint16 + NextHeader IPProtocol + HopLimit uint8 + SrcIP net.IP + DstIP net.IP + HopByHop *IPv6HopByHop + // hbh will be pointed to by HopByHop if that layer exists. + hbh IPv6HopByHop +} + +// LayerType returns LayerTypeIPv6 +func (i *IPv6) LayerType() gopacket.LayerType { return LayerTypeIPv6 } +func (i *IPv6) NetworkFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointIPv6, i.SrcIP, i.DstIP) +} + +const ( + IPv6HopByHopOptionJumbogram = 0xC2 // RFC 2675 +) + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (ip6 *IPv6) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + payload := b.Bytes() + if ip6.HopByHop != nil { + return fmt.Errorf("unable to serialize hopbyhop for now") + } + bytes, err := b.PrependBytes(40) + if err != nil { + return err + } + bytes[0] = (ip6.Version << 4) | (ip6.TrafficClass >> 4) + bytes[1] = (ip6.TrafficClass << 4) | uint8(ip6.FlowLabel>>16) + binary.BigEndian.PutUint16(bytes[2:], uint16(ip6.FlowLabel)) + if opts.FixLengths { + ip6.Length = uint16(len(payload)) + } + binary.BigEndian.PutUint16(bytes[4:], ip6.Length) + bytes[6] = byte(ip6.NextHeader) + bytes[7] = byte(ip6.HopLimit) + if len(ip6.SrcIP) != 16 { + return fmt.Errorf("invalid src ip %v", ip6.SrcIP) + } + if len(ip6.DstIP) != 16 { + return fmt.Errorf("invalid dst ip %v", ip6.DstIP) + } + copy(bytes[8:], ip6.SrcIP) + copy(bytes[24:], ip6.DstIP) + return nil +} + +func (ip6 *IPv6) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + ip6.Version = uint8(data[0]) >> 4 + ip6.TrafficClass = uint8((binary.BigEndian.Uint16(data[0:2]) >> 4) & 0x00FF) + ip6.FlowLabel = binary.BigEndian.Uint32(data[0:4]) & 0x000FFFFF + ip6.Length = binary.BigEndian.Uint16(data[4:6]) + ip6.NextHeader = IPProtocol(data[6]) + ip6.HopLimit = data[7] + ip6.SrcIP = data[8:24] + ip6.DstIP = data[24:40] + ip6.HopByHop = nil + // We initially set the payload to all bytes after 40. ip6.Length or the + // HopByHop jumbogram option can both change this eventually, though. + ip6.BaseLayer = BaseLayer{data[:40], data[40:]} + + // We treat a HopByHop IPv6 option as part of the IPv6 packet, since its + // options are crucial for understanding what's actually happening per packet. + if ip6.NextHeader == IPProtocolIPv6HopByHop { + ip6.hbh.DecodeFromBytes(ip6.Payload, df) + hbhLen := len(ip6.hbh.Contents) + // Reset IPv6 contents to include the HopByHop header. + ip6.BaseLayer = BaseLayer{data[:40+hbhLen], data[40+hbhLen:]} + ip6.HopByHop = &ip6.hbh + if ip6.Length == 0 { + for _, o := range ip6.hbh.Options { + if o.OptionType == IPv6HopByHopOptionJumbogram { + if len(o.OptionData) != 4 { + return fmt.Errorf("Invalid jumbo packet option length") + } + payloadLength := binary.BigEndian.Uint32(o.OptionData) + pEnd := int(payloadLength) + if pEnd > len(ip6.Payload) { + df.SetTruncated() + } else { + ip6.Payload = ip6.Payload[:pEnd] + ip6.hbh.Payload = ip6.Payload + } + return nil + } + } + return fmt.Errorf("IPv6 length 0, but HopByHop header does not have jumbogram option") + } + } + if ip6.Length == 0 { + return fmt.Errorf("IPv6 length 0, but next header is %v, not HopByHop", ip6.NextHeader) + } else { + pEnd := int(ip6.Length) + if pEnd > len(ip6.Payload) { + df.SetTruncated() + pEnd = len(ip6.Payload) + } + ip6.Payload = ip6.Payload[:pEnd] + } + return nil +} + +func (i *IPv6) CanDecode() gopacket.LayerClass { + return LayerTypeIPv6 +} +func (i *IPv6) NextLayerType() gopacket.LayerType { + if i.HopByHop != nil { + return i.HopByHop.NextHeader.LayerType() + } + return i.NextHeader.LayerType() +} + +func decodeIPv6(data []byte, p gopacket.PacketBuilder) error { + ip6 := &IPv6{} + err := ip6.DecodeFromBytes(data, p) + p.AddLayer(ip6) + p.SetNetworkLayer(ip6) + if ip6.HopByHop != nil { + // TODO(gconnell): Since HopByHop is now an integral part of the IPv6 + // layer, should it actually be added as its own layer? I'm leaning towards + // no. + p.AddLayer(ip6.HopByHop) + } + if err != nil { + return err + } + if ip6.HopByHop != nil { + return p.NextDecoder(ip6.HopByHop.NextHeader) + } + return p.NextDecoder(ip6.NextHeader) +} + +func (i *IPv6HopByHop) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + i.ipv6ExtensionBase = decodeIPv6ExtensionBase(data) + i.Options = i.opts[:0] + var opt *IPv6HopByHopOption + for d := i.Contents[2:]; len(d) > 0; d = d[opt.ActualLength:] { + i.Options = append(i.Options, IPv6HopByHopOption(decodeIPv6HeaderTLVOption(d))) + opt = &i.Options[len(i.Options)-1] + } + return nil +} + +func decodeIPv6HopByHop(data []byte, p gopacket.PacketBuilder) error { + i := &IPv6HopByHop{} + err := i.DecodeFromBytes(data, p) + p.AddLayer(i) + if err != nil { + return err + } + return p.NextDecoder(i.NextHeader) +} + +type ipv6HeaderTLVOption struct { + OptionType, OptionLength uint8 + ActualLength int + OptionData []byte +} + +func decodeIPv6HeaderTLVOption(data []byte) (h ipv6HeaderTLVOption) { + if data[0] == 0 { + h.ActualLength = 1 + return + } + h.OptionType = data[0] + h.OptionLength = data[1] + h.ActualLength = int(h.OptionLength) + 2 + h.OptionData = data[2:h.ActualLength] + return +} + +func (h *ipv6HeaderTLVOption) serializeTo(b gopacket.SerializeBuffer, fixLengths bool) (int, error) { + if fixLengths { + h.OptionLength = uint8(len(h.OptionData)) + } + length := int(h.OptionLength) + 2 + data, err := b.PrependBytes(length) + if err != nil { + return 0, err + } + data[0] = h.OptionType + data[1] = h.OptionLength + copy(data[2:], h.OptionData) + return length, nil +} + +// IPv6HopByHopOption is a TLV option present in an IPv6 hop-by-hop extension. +type IPv6HopByHopOption ipv6HeaderTLVOption + +type ipv6ExtensionBase struct { + BaseLayer + NextHeader IPProtocol + HeaderLength uint8 + ActualLength int +} + +func decodeIPv6ExtensionBase(data []byte) (i ipv6ExtensionBase) { + i.NextHeader = IPProtocol(data[0]) + i.HeaderLength = data[1] + i.ActualLength = int(i.HeaderLength)*8 + 8 + i.Contents = data[:i.ActualLength] + i.Payload = data[i.ActualLength:] + return +} + +// IPv6ExtensionSkipper is a DecodingLayer which decodes and ignores v6 +// extensions. You can use it with a DecodingLayerParser to handle IPv6 stacks +// which may or may not have extensions. +type IPv6ExtensionSkipper struct { + NextHeader IPProtocol + BaseLayer +} + +func (i *IPv6ExtensionSkipper) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + extension := decodeIPv6ExtensionBase(data) + i.BaseLayer = BaseLayer{data[:extension.ActualLength], data[extension.ActualLength:]} + i.NextHeader = extension.NextHeader + return nil +} +func (i *IPv6ExtensionSkipper) CanDecode() gopacket.LayerClass { + return LayerClassIPv6Extension +} +func (i *IPv6ExtensionSkipper) NextLayerType() gopacket.LayerType { + return i.NextHeader.LayerType() +} + +// IPv6HopByHop is the IPv6 hop-by-hop extension. +type IPv6HopByHop struct { + ipv6ExtensionBase + Options []IPv6HopByHopOption + opts [2]IPv6HopByHopOption +} + +// LayerType returns LayerTypeIPv6HopByHop. +func (i *IPv6HopByHop) LayerType() gopacket.LayerType { return LayerTypeIPv6HopByHop } + +// IPv6Routing is the IPv6 routing extension. +type IPv6Routing struct { + ipv6ExtensionBase + RoutingType uint8 + SegmentsLeft uint8 + // This segment is supposed to be zero according to RFC2460, the second set of + // 4 bytes in the extension. + Reserved []byte + // SourceRoutingIPs is the set of IPv6 addresses requested for source routing, + // set only if RoutingType == 0. + SourceRoutingIPs []net.IP +} + +// LayerType returns LayerTypeIPv6Routing. +func (i *IPv6Routing) LayerType() gopacket.LayerType { return LayerTypeIPv6Routing } + +func decodeIPv6Routing(data []byte, p gopacket.PacketBuilder) error { + i := &IPv6Routing{ + ipv6ExtensionBase: decodeIPv6ExtensionBase(data), + RoutingType: data[2], + SegmentsLeft: data[3], + Reserved: data[4:8], + } + switch i.RoutingType { + case 0: // Source routing + if (len(data)-8)%16 != 0 { + return fmt.Errorf("Invalid IPv6 source routing, length of type 0 packet %d", len(data)) + } + for d := i.Contents[8:]; len(d) >= 16; d = d[16:] { + i.SourceRoutingIPs = append(i.SourceRoutingIPs, net.IP(d[:16])) + } + } + p.AddLayer(i) + return p.NextDecoder(i.NextHeader) +} + +// IPv6Fragment is the IPv6 fragment header, used for packet +// fragmentation/defragmentation. +type IPv6Fragment struct { + BaseLayer + NextHeader IPProtocol + // Reserved1 is bits [8-16), from least to most significant, 0-indexed + Reserved1 uint8 + FragmentOffset uint16 + // Reserved2 is bits [29-31), from least to most significant, 0-indexed + Reserved2 uint8 + MoreFragments bool + Identification uint32 +} + +// LayerType returns LayerTypeIPv6Fragment. +func (i *IPv6Fragment) LayerType() gopacket.LayerType { return LayerTypeIPv6Fragment } + +func decodeIPv6Fragment(data []byte, p gopacket.PacketBuilder) error { + i := &IPv6Fragment{ + BaseLayer: BaseLayer{data[:8], data[8:]}, + NextHeader: IPProtocol(data[0]), + Reserved1: data[1], + FragmentOffset: binary.BigEndian.Uint16(data[2:4]) >> 3, + Reserved2: data[3] & 0x6 >> 1, + MoreFragments: data[3]&0x1 != 0, + Identification: binary.BigEndian.Uint32(data[4:8]), + } + p.AddLayer(i) + return p.NextDecoder(gopacket.DecodeFragment) +} + +// IPv6DestinationOption is a TLV option present in an IPv6 destination options extension. +type IPv6DestinationOption ipv6HeaderTLVOption + +func (o *IPv6DestinationOption) serializeTo(b gopacket.SerializeBuffer, fixLengths bool) (int, error) { + return (*ipv6HeaderTLVOption)(o).serializeTo(b, fixLengths) +} + +// IPv6Destination is the IPv6 destination options header. +type IPv6Destination struct { + ipv6ExtensionBase + Options []IPv6DestinationOption +} + +// LayerType returns LayerTypeIPv6Destination. +func (i *IPv6Destination) LayerType() gopacket.LayerType { return LayerTypeIPv6Destination } + +func decodeIPv6Destination(data []byte, p gopacket.PacketBuilder) error { + i := &IPv6Destination{ + ipv6ExtensionBase: decodeIPv6ExtensionBase(data), + // We guess we'll 1-2 options, one regular option at least, then maybe one + // padding option. + Options: make([]IPv6DestinationOption, 0, 2), + } + var opt *IPv6DestinationOption + for d := i.Contents[2:]; len(d) > 0; d = d[opt.ActualLength:] { + i.Options = append(i.Options, IPv6DestinationOption(decodeIPv6HeaderTLVOption(d))) + opt = &i.Options[len(i.Options)-1] + } + p.AddLayer(i) + return p.NextDecoder(i.NextHeader) +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (i *IPv6Destination) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + optionLength := 0 + for _, opt := range i.Options { + l, err := opt.serializeTo(b, opts.FixLengths) + if err != nil { + return err + } + optionLength += l + } + bytes, err := b.PrependBytes(2) + if err != nil { + return err + } + bytes[0] = uint8(i.NextHeader) + if opts.FixLengths { + i.HeaderLength = uint8((optionLength + 2) / 8) + } + bytes[1] = i.HeaderLength + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ipsec.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ipsec.go new file mode 100644 index 00000000..55d020a0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ipsec.go @@ -0,0 +1,62 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "github.com/tsg/gopacket" +) + +// IPSecAH is the authentication header for IPv4/6 defined in +// http://tools.ietf.org/html/rfc2402 +type IPSecAH struct { + // While the auth header can be used for both IPv4 and v6, its format is that of + // an IPv6 extension (NextHeader, PayloadLength, etc...), so we use ipv6ExtensionBase + // to build it. + ipv6ExtensionBase + Reserved uint16 + SPI, Seq uint32 + AuthenticationData []byte +} + +// LayerType returns LayerTypeIPSecAH. +func (i *IPSecAH) LayerType() gopacket.LayerType { return LayerTypeIPSecAH } + +func decodeIPSecAH(data []byte, p gopacket.PacketBuilder) error { + i := &IPSecAH{ + ipv6ExtensionBase: decodeIPv6ExtensionBase(data), + Reserved: binary.BigEndian.Uint16(data[2:4]), + SPI: binary.BigEndian.Uint32(data[4:8]), + Seq: binary.BigEndian.Uint32(data[8:12]), + } + i.AuthenticationData = i.Contents[12:] + p.AddLayer(i) + return p.NextDecoder(i.NextHeader) +} + +// IPSecESP is the encapsulating security payload defined in +// http://tools.ietf.org/html/rfc2406 +type IPSecESP struct { + BaseLayer + SPI, Seq uint32 + // Encrypted contains the encrypted set of bytes sent in an ESP + Encrypted []byte +} + +// LayerType returns LayerTypeIPSecESP. +func (i *IPSecESP) LayerType() gopacket.LayerType { return LayerTypeIPSecESP } + +func decodeIPSecESP(data []byte, p gopacket.PacketBuilder) error { + i := &IPSecESP{ + BaseLayer: BaseLayer{data, nil}, + SPI: binary.BigEndian.Uint32(data[:4]), + Seq: binary.BigEndian.Uint32(data[4:8]), + Encrypted: data[8:], + } + p.AddLayer(i) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/layertypes.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/layertypes.go new file mode 100644 index 00000000..61e14a12 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/layertypes.go @@ -0,0 +1,167 @@ +// Copyright 2012 Google, gopacket.LayerTypeMetadata{Inc. All rights reserved}. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "github.com/tsg/gopacket" +) + +var ( + LayerTypeARP = gopacket.RegisterLayerType(10, gopacket.LayerTypeMetadata{"ARP", gopacket.DecodeFunc(decodeARP)}) + LayerTypeCiscoDiscovery = gopacket.RegisterLayerType(11, gopacket.LayerTypeMetadata{"CiscoDiscovery", gopacket.DecodeFunc(decodeCiscoDiscovery)}) + LayerTypeEthernetCTP = gopacket.RegisterLayerType(12, gopacket.LayerTypeMetadata{"EthernetCTP", gopacket.DecodeFunc(decodeEthernetCTP)}) + LayerTypeEthernetCTPForwardData = gopacket.RegisterLayerType(13, gopacket.LayerTypeMetadata{"EthernetCTPForwardData", nil}) + LayerTypeEthernetCTPReply = gopacket.RegisterLayerType(14, gopacket.LayerTypeMetadata{"EthernetCTPReply", nil}) + LayerTypeDot1Q = gopacket.RegisterLayerType(15, gopacket.LayerTypeMetadata{"Dot1Q", gopacket.DecodeFunc(decodeDot1Q)}) + LayerTypeEtherIP = gopacket.RegisterLayerType(16, gopacket.LayerTypeMetadata{"EtherIP", gopacket.DecodeFunc(decodeEtherIP)}) + LayerTypeEthernet = gopacket.RegisterLayerType(17, gopacket.LayerTypeMetadata{"Ethernet", gopacket.DecodeFunc(decodeEthernet)}) + LayerTypeGRE = gopacket.RegisterLayerType(18, gopacket.LayerTypeMetadata{"GRE", gopacket.DecodeFunc(decodeGRE)}) + LayerTypeICMPv4 = gopacket.RegisterLayerType(19, gopacket.LayerTypeMetadata{"ICMPv4", gopacket.DecodeFunc(decodeICMPv4)}) + LayerTypeIPv4 = gopacket.RegisterLayerType(20, gopacket.LayerTypeMetadata{"IPv4", gopacket.DecodeFunc(decodeIPv4)}) + LayerTypeIPv6 = gopacket.RegisterLayerType(21, gopacket.LayerTypeMetadata{"IPv6", gopacket.DecodeFunc(decodeIPv6)}) + LayerTypeLLC = gopacket.RegisterLayerType(22, gopacket.LayerTypeMetadata{"LLC", gopacket.DecodeFunc(decodeLLC)}) + LayerTypeSNAP = gopacket.RegisterLayerType(23, gopacket.LayerTypeMetadata{"SNAP", gopacket.DecodeFunc(decodeSNAP)}) + LayerTypeMPLS = gopacket.RegisterLayerType(24, gopacket.LayerTypeMetadata{"MPLS", gopacket.DecodeFunc(decodeMPLS)}) + LayerTypePPP = gopacket.RegisterLayerType(25, gopacket.LayerTypeMetadata{"PPP", gopacket.DecodeFunc(decodePPP)}) + LayerTypePPPoE = gopacket.RegisterLayerType(26, gopacket.LayerTypeMetadata{"PPPoE", gopacket.DecodeFunc(decodePPPoE)}) + LayerTypeRUDP = gopacket.RegisterLayerType(27, gopacket.LayerTypeMetadata{"RUDP", gopacket.DecodeFunc(decodeRUDP)}) + LayerTypeSCTP = gopacket.RegisterLayerType(28, gopacket.LayerTypeMetadata{"SCTP", gopacket.DecodeFunc(decodeSCTP)}) + LayerTypeSCTPUnknownChunkType = gopacket.RegisterLayerType(29, gopacket.LayerTypeMetadata{"SCTPUnknownChunkType", nil}) + LayerTypeSCTPData = gopacket.RegisterLayerType(30, gopacket.LayerTypeMetadata{"SCTPData", nil}) + LayerTypeSCTPInit = gopacket.RegisterLayerType(31, gopacket.LayerTypeMetadata{"SCTPInit", nil}) + LayerTypeSCTPSack = gopacket.RegisterLayerType(32, gopacket.LayerTypeMetadata{"SCTPSack", nil}) + LayerTypeSCTPHeartbeat = gopacket.RegisterLayerType(33, gopacket.LayerTypeMetadata{"SCTPHeartbeat", nil}) + LayerTypeSCTPError = gopacket.RegisterLayerType(34, gopacket.LayerTypeMetadata{"SCTPError", nil}) + LayerTypeSCTPShutdown = gopacket.RegisterLayerType(35, gopacket.LayerTypeMetadata{"SCTPShutdown", nil}) + LayerTypeSCTPShutdownAck = gopacket.RegisterLayerType(36, gopacket.LayerTypeMetadata{"SCTPShutdownAck", nil}) + LayerTypeSCTPCookieEcho = gopacket.RegisterLayerType(37, gopacket.LayerTypeMetadata{"SCTPCookieEcho", nil}) + LayerTypeSCTPEmptyLayer = gopacket.RegisterLayerType(38, gopacket.LayerTypeMetadata{"SCTPEmptyLayer", nil}) + LayerTypeSCTPInitAck = gopacket.RegisterLayerType(39, gopacket.LayerTypeMetadata{"SCTPInitAck", nil}) + LayerTypeSCTPHeartbeatAck = gopacket.RegisterLayerType(40, gopacket.LayerTypeMetadata{"SCTPHeartbeatAck", nil}) + LayerTypeSCTPAbort = gopacket.RegisterLayerType(41, gopacket.LayerTypeMetadata{"SCTPAbort", nil}) + LayerTypeSCTPShutdownComplete = gopacket.RegisterLayerType(42, gopacket.LayerTypeMetadata{"SCTPShutdownComplete", nil}) + LayerTypeSCTPCookieAck = gopacket.RegisterLayerType(43, gopacket.LayerTypeMetadata{"SCTPCookieAck", nil}) + LayerTypeTCP = gopacket.RegisterLayerType(44, gopacket.LayerTypeMetadata{"TCP", gopacket.DecodeFunc(decodeTCP)}) + LayerTypeUDP = gopacket.RegisterLayerType(45, gopacket.LayerTypeMetadata{"UDP", gopacket.DecodeFunc(decodeUDP)}) + LayerTypeIPv6HopByHop = gopacket.RegisterLayerType(46, gopacket.LayerTypeMetadata{"IPv6HopByHop", gopacket.DecodeFunc(decodeIPv6HopByHop)}) + LayerTypeIPv6Routing = gopacket.RegisterLayerType(47, gopacket.LayerTypeMetadata{"IPv6Routing", gopacket.DecodeFunc(decodeIPv6Routing)}) + LayerTypeIPv6Fragment = gopacket.RegisterLayerType(48, gopacket.LayerTypeMetadata{"IPv6Fragment", gopacket.DecodeFunc(decodeIPv6Fragment)}) + LayerTypeIPv6Destination = gopacket.RegisterLayerType(49, gopacket.LayerTypeMetadata{"IPv6Destination", gopacket.DecodeFunc(decodeIPv6Destination)}) + LayerTypeIPSecAH = gopacket.RegisterLayerType(50, gopacket.LayerTypeMetadata{"IPSecAH", gopacket.DecodeFunc(decodeIPSecAH)}) + LayerTypeIPSecESP = gopacket.RegisterLayerType(51, gopacket.LayerTypeMetadata{"IPSecESP", gopacket.DecodeFunc(decodeIPSecESP)}) + LayerTypeUDPLite = gopacket.RegisterLayerType(52, gopacket.LayerTypeMetadata{"UDPLite", gopacket.DecodeFunc(decodeUDPLite)}) + LayerTypeFDDI = gopacket.RegisterLayerType(53, gopacket.LayerTypeMetadata{"FDDI", gopacket.DecodeFunc(decodeFDDI)}) + LayerTypeLoopback = gopacket.RegisterLayerType(54, gopacket.LayerTypeMetadata{"Loopback", gopacket.DecodeFunc(decodeLoopback)}) + LayerTypeEAP = gopacket.RegisterLayerType(55, gopacket.LayerTypeMetadata{"EAP", gopacket.DecodeFunc(decodeEAP)}) + LayerTypeEAPOL = gopacket.RegisterLayerType(56, gopacket.LayerTypeMetadata{"EAPOL", gopacket.DecodeFunc(decodeEAPOL)}) + LayerTypeICMPv6 = gopacket.RegisterLayerType(57, gopacket.LayerTypeMetadata{"ICMPv6", gopacket.DecodeFunc(decodeICMPv6)}) + LayerTypeLinkLayerDiscovery = gopacket.RegisterLayerType(58, gopacket.LayerTypeMetadata{"LinkLayerDiscovery", gopacket.DecodeFunc(decodeLinkLayerDiscovery)}) + LayerTypeCiscoDiscoveryInfo = gopacket.RegisterLayerType(59, gopacket.LayerTypeMetadata{"CiscoDiscoveryInfo", gopacket.DecodeFunc(decodeCiscoDiscoveryInfo)}) + LayerTypeLinkLayerDiscoveryInfo = gopacket.RegisterLayerType(60, gopacket.LayerTypeMetadata{"LinkLayerDiscoveryInfo", nil}) + LayerTypeNortelDiscovery = gopacket.RegisterLayerType(61, gopacket.LayerTypeMetadata{"NortelDiscovery", gopacket.DecodeFunc(decodeNortelDiscovery)}) + LayerTypeIGMP = gopacket.RegisterLayerType(62, gopacket.LayerTypeMetadata{"IGMP", gopacket.DecodeFunc(decodeIGMP)}) + LayerTypePFLog = gopacket.RegisterLayerType(63, gopacket.LayerTypeMetadata{"PFLog", gopacket.DecodeFunc(decodePFLog)}) + LayerTypeRadioTap = gopacket.RegisterLayerType(64, gopacket.LayerTypeMetadata{"RadioTap", gopacket.DecodeFunc(decodeRadioTap)}) + LayerTypeDot11 = gopacket.RegisterLayerType(65, gopacket.LayerTypeMetadata{"Dot11", gopacket.DecodeFunc(decodeDot11)}) + LayerTypeDot11Ctrl = gopacket.RegisterLayerType(66, gopacket.LayerTypeMetadata{"Dot11Ctrl", gopacket.DecodeFunc(decodeDot11Ctrl)}) + LayerTypeDot11Data = gopacket.RegisterLayerType(67, gopacket.LayerTypeMetadata{"Dot11Data", gopacket.DecodeFunc(decodeDot11Data)}) + LayerTypeDot11DataCFAck = gopacket.RegisterLayerType(68, gopacket.LayerTypeMetadata{"Dot11DataCFAck", gopacket.DecodeFunc(decodeDot11DataCFAck)}) + LayerTypeDot11DataCFPoll = gopacket.RegisterLayerType(69, gopacket.LayerTypeMetadata{"Dot11DataCFPoll", gopacket.DecodeFunc(decodeDot11DataCFPoll)}) + LayerTypeDot11DataCFAckPoll = gopacket.RegisterLayerType(70, gopacket.LayerTypeMetadata{"Dot11DataCFAckPoll", gopacket.DecodeFunc(decodeDot11DataCFAckPoll)}) + LayerTypeDot11DataNull = gopacket.RegisterLayerType(71, gopacket.LayerTypeMetadata{"Dot11DataNull", gopacket.DecodeFunc(decodeDot11DataNull)}) + LayerTypeDot11DataCFAckNoData = gopacket.RegisterLayerType(72, gopacket.LayerTypeMetadata{"Dot11DataCFAck", gopacket.DecodeFunc(decodeDot11DataCFAck)}) + LayerTypeDot11DataCFPollNoData = gopacket.RegisterLayerType(73, gopacket.LayerTypeMetadata{"Dot11DataCFPoll", gopacket.DecodeFunc(decodeDot11DataCFPoll)}) + LayerTypeDot11DataCFAckPollNoData = gopacket.RegisterLayerType(74, gopacket.LayerTypeMetadata{"Dot11DataCFAckPoll", gopacket.DecodeFunc(decodeDot11DataCFAckPoll)}) + LayerTypeDot11DataQOSData = gopacket.RegisterLayerType(75, gopacket.LayerTypeMetadata{"Dot11DataQOSData", gopacket.DecodeFunc(decodeDot11DataQOSData)}) + LayerTypeDot11DataQOSDataCFAck = gopacket.RegisterLayerType(76, gopacket.LayerTypeMetadata{"Dot11DataQOSDataCFAck", gopacket.DecodeFunc(decodeDot11DataQOSDataCFAck)}) + LayerTypeDot11DataQOSDataCFPoll = gopacket.RegisterLayerType(77, gopacket.LayerTypeMetadata{"Dot11DataQOSDataCFPoll", gopacket.DecodeFunc(decodeDot11DataQOSDataCFPoll)}) + LayerTypeDot11DataQOSDataCFAckPoll = gopacket.RegisterLayerType(78, gopacket.LayerTypeMetadata{"Dot11DataQOSDataCFAckPoll", gopacket.DecodeFunc(decodeDot11DataQOSDataCFAckPoll)}) + LayerTypeDot11DataQOSNull = gopacket.RegisterLayerType(79, gopacket.LayerTypeMetadata{"Dot11DataQOSNull", gopacket.DecodeFunc(decodeDot11DataQOSNull)}) + LayerTypeDot11DataQOSCFPollNoData = gopacket.RegisterLayerType(80, gopacket.LayerTypeMetadata{"Dot11DataQOSCFPoll", gopacket.DecodeFunc(decodeDot11DataQOSCFPollNoData)}) + LayerTypeDot11DataQOSCFAckPollNoData = gopacket.RegisterLayerType(81, gopacket.LayerTypeMetadata{"Dot11DataQOSCFAckPoll", gopacket.DecodeFunc(decodeDot11DataQOSCFAckPollNoData)}) + LayerTypeDot11InformationElement = gopacket.RegisterLayerType(82, gopacket.LayerTypeMetadata{"Dot11InformationElement", gopacket.DecodeFunc(decodeDot11InformationElement)}) + LayerTypeDot11CtrlCTS = gopacket.RegisterLayerType(83, gopacket.LayerTypeMetadata{"Dot11CtrlCTS", gopacket.DecodeFunc(decodeDot11CtrlCTS)}) + LayerTypeDot11CtrlRTS = gopacket.RegisterLayerType(84, gopacket.LayerTypeMetadata{"Dot11CtrlRTS", gopacket.DecodeFunc(decodeDot11CtrlRTS)}) + LayerTypeDot11CtrlBlockAckReq = gopacket.RegisterLayerType(85, gopacket.LayerTypeMetadata{"Dot11CtrlBlockAckReq", gopacket.DecodeFunc(decodeDot11CtrlBlockAckReq)}) + LayerTypeDot11CtrlBlockAck = gopacket.RegisterLayerType(86, gopacket.LayerTypeMetadata{"Dot11CtrlBlockAck", gopacket.DecodeFunc(decodeDot11CtrlBlockAck)}) + LayerTypeDot11CtrlPowersavePoll = gopacket.RegisterLayerType(87, gopacket.LayerTypeMetadata{"Dot11CtrlPowersavePoll", gopacket.DecodeFunc(decodeDot11CtrlPowersavePoll)}) + LayerTypeDot11CtrlAck = gopacket.RegisterLayerType(88, gopacket.LayerTypeMetadata{"Dot11CtrlAck", gopacket.DecodeFunc(decodeDot11CtrlAck)}) + LayerTypeDot11CtrlCFEnd = gopacket.RegisterLayerType(89, gopacket.LayerTypeMetadata{"Dot11CtrlCFEnd", gopacket.DecodeFunc(decodeDot11CtrlCFEnd)}) + LayerTypeDot11CtrlCFEndAck = gopacket.RegisterLayerType(90, gopacket.LayerTypeMetadata{"Dot11CtrlCFEndAck", gopacket.DecodeFunc(decodeDot11CtrlCFEndAck)}) + LayerTypeDot11MgmtAssociationReq = gopacket.RegisterLayerType(91, gopacket.LayerTypeMetadata{"Dot11MgmtAssociationReq", gopacket.DecodeFunc(decodeDot11MgmtAssociationReq)}) + LayerTypeDot11MgmtAssociationResp = gopacket.RegisterLayerType(92, gopacket.LayerTypeMetadata{"Dot11MgmtAssociationResp", gopacket.DecodeFunc(decodeDot11MgmtAssociationResp)}) + LayerTypeDot11MgmtReassociationReq = gopacket.RegisterLayerType(93, gopacket.LayerTypeMetadata{"Dot11MgmtReassociationReq", gopacket.DecodeFunc(decodeDot11MgmtReassociationReq)}) + LayerTypeDot11MgmtReassociationResp = gopacket.RegisterLayerType(94, gopacket.LayerTypeMetadata{"Dot11MgmtReassociationResp", gopacket.DecodeFunc(decodeDot11MgmtReassociationResp)}) + LayerTypeDot11MgmtProbeReq = gopacket.RegisterLayerType(95, gopacket.LayerTypeMetadata{"Dot11MgmtProbeReq", gopacket.DecodeFunc(decodeDot11MgmtProbeReq)}) + LayerTypeDot11MgmtProbeResp = gopacket.RegisterLayerType(96, gopacket.LayerTypeMetadata{"Dot11MgmtProbeResp", gopacket.DecodeFunc(decodeDot11MgmtProbeResp)}) + LayerTypeDot11MgmtMeasurementPilot = gopacket.RegisterLayerType(97, gopacket.LayerTypeMetadata{"Dot11MgmtMeasurementPilot", gopacket.DecodeFunc(decodeDot11MgmtMeasurementPilot)}) + LayerTypeDot11MgmtBeacon = gopacket.RegisterLayerType(98, gopacket.LayerTypeMetadata{"Dot11MgmtBeacon", gopacket.DecodeFunc(decodeDot11MgmtBeacon)}) + LayerTypeDot11MgmtATIM = gopacket.RegisterLayerType(99, gopacket.LayerTypeMetadata{"Dot11MgmtATIM", gopacket.DecodeFunc(decodeDot11MgmtATIM)}) + LayerTypeDot11MgmtDisassociation = gopacket.RegisterLayerType(100, gopacket.LayerTypeMetadata{"Dot11MgmtDisassociation", gopacket.DecodeFunc(decodeDot11MgmtDisassociation)}) + LayerTypeDot11MgmtAuthentication = gopacket.RegisterLayerType(101, gopacket.LayerTypeMetadata{"Dot11MgmtAuthentication", gopacket.DecodeFunc(decodeDot11MgmtAuthentication)}) + LayerTypeDot11MgmtDeauthentication = gopacket.RegisterLayerType(102, gopacket.LayerTypeMetadata{"Dot11MgmtDeauthentication", gopacket.DecodeFunc(decodeDot11MgmtDeauthentication)}) + LayerTypeDot11MgmtAction = gopacket.RegisterLayerType(103, gopacket.LayerTypeMetadata{"Dot11MgmtAction", gopacket.DecodeFunc(decodeDot11MgmtAction)}) + LayerTypeDot11MgmtActionNoAck = gopacket.RegisterLayerType(104, gopacket.LayerTypeMetadata{"Dot11MgmtActionNoAck", gopacket.DecodeFunc(decodeDot11MgmtActionNoAck)}) + LayerTypeDot11MgmtArubaWLAN = gopacket.RegisterLayerType(105, gopacket.LayerTypeMetadata{"Dot11MgmtArubaWLAN", gopacket.DecodeFunc(decodeDot11MgmtArubaWLAN)}) + LayerTypeDot11WEP = gopacket.RegisterLayerType(106, gopacket.LayerTypeMetadata{"Dot11WEP", gopacket.DecodeFunc(decodeDot11WEP)}) + LayerTypeDNS = gopacket.RegisterLayerType(107, gopacket.LayerTypeMetadata{"DNS", gopacket.DecodeFunc(decodeDNS)}) + LayerTypeUSB = gopacket.RegisterLayerType(108, gopacket.LayerTypeMetadata{"USB", gopacket.DecodeFunc(decodeUSB)}) + LayerTypeUSBRequestBlockSetup = gopacket.RegisterLayerType(109, gopacket.LayerTypeMetadata{"USBRequestBlockSetup", gopacket.DecodeFunc(decodeUSBRequestBlockSetup)}) + LayerTypeUSBControl = gopacket.RegisterLayerType(110, gopacket.LayerTypeMetadata{"USBControl", gopacket.DecodeFunc(decodeUSBControl)}) + LayerTypeUSBInterrupt = gopacket.RegisterLayerType(111, gopacket.LayerTypeMetadata{"USBInterrupt", gopacket.DecodeFunc(decodeUSBInterrupt)}) + LayerTypeUSBBulk = gopacket.RegisterLayerType(112, gopacket.LayerTypeMetadata{"USBBulk", gopacket.DecodeFunc(decodeUSBBulk)}) + LayerTypeLinuxSLL = gopacket.RegisterLayerType(113, gopacket.LayerTypeMetadata{"Linux SLL", gopacket.DecodeFunc(decodeLinuxSLL)}) +) + +var ( + // LayerClassIPNetwork contains TCP/IP network layer types. + LayerClassIPNetwork = gopacket.NewLayerClass([]gopacket.LayerType{ + LayerTypeIPv4, + LayerTypeIPv6, + }) + // LayerClassIPTransport contains TCP/IP transport layer types. + LayerClassIPTransport = gopacket.NewLayerClass([]gopacket.LayerType{ + LayerTypeTCP, + LayerTypeUDP, + LayerTypeSCTP, + }) + // LayerClassIPControl contains TCP/IP control protocols. + LayerClassIPControl = gopacket.NewLayerClass([]gopacket.LayerType{ + LayerTypeICMPv4, + LayerTypeICMPv6, + }) + // LayerClassSCTPChunk contains SCTP chunk types (not the top-level SCTP + // layer). + LayerClassSCTPChunk = gopacket.NewLayerClass([]gopacket.LayerType{ + LayerTypeSCTPUnknownChunkType, + LayerTypeSCTPData, + LayerTypeSCTPInit, + LayerTypeSCTPSack, + LayerTypeSCTPHeartbeat, + LayerTypeSCTPError, + LayerTypeSCTPShutdown, + LayerTypeSCTPShutdownAck, + LayerTypeSCTPCookieEcho, + LayerTypeSCTPEmptyLayer, + LayerTypeSCTPInitAck, + LayerTypeSCTPHeartbeatAck, + LayerTypeSCTPAbort, + LayerTypeSCTPShutdownComplete, + LayerTypeSCTPCookieAck, + }) + // LayerClassIPv6Extension contains IPv6 extension headers. + LayerClassIPv6Extension = gopacket.NewLayerClass([]gopacket.LayerType{ + LayerTypeIPv6HopByHop, + LayerTypeIPv6Routing, + LayerTypeIPv6Fragment, + LayerTypeIPv6Destination, + }) + LayerClassIPSec = gopacket.NewLayerClass([]gopacket.LayerType{ + LayerTypeIPSecAH, + LayerTypeIPSecESP, + }) +) diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/linux_sll.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/linux_sll.go new file mode 100644 index 00000000..3c7e1fba --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/linux_sll.go @@ -0,0 +1,96 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "errors" + "fmt" + "net" + + "github.com/tsg/gopacket" +) + +type LinuxSLLPacketType uint16 + +const ( + LinuxSLLPacketTypeHost LinuxSLLPacketType = 0 // To us + LinuxSLLPacketTypeBroadcast LinuxSLLPacketType = 1 // To all + LinuxSLLPacketTypeMulticast LinuxSLLPacketType = 2 // To group + LinuxSLLPacketTypeOtherhost LinuxSLLPacketType = 3 // To someone else + LinuxSLLPacketTypeOutgoing LinuxSLLPacketType = 4 // Outgoing of any type + // These ones are invisible by user level + LinuxSLLPacketTypeLoopback LinuxSLLPacketType = 5 // MC/BRD frame looped back + LinuxSLLPacketTypeFastroute LinuxSLLPacketType = 6 // Fastrouted frame +) + +func (l LinuxSLLPacketType) String() string { + switch l { + case LinuxSLLPacketTypeHost: + return "host" + case LinuxSLLPacketTypeBroadcast: + return "broadcast" + case LinuxSLLPacketTypeMulticast: + return "multicast" + case LinuxSLLPacketTypeOtherhost: + return "otherhost" + case LinuxSLLPacketTypeOutgoing: + return "outgoing" + case LinuxSLLPacketTypeLoopback: + return "loopback" + case LinuxSLLPacketTypeFastroute: + return "fastroute" + } + return fmt.Sprintf("Unknown(%d)", int(l)) +} + +type LinuxSLL struct { + BaseLayer + PacketType LinuxSLLPacketType + AddrLen uint16 + Addr net.HardwareAddr + EthernetType EthernetType +} + +// LayerType returns LayerTypeLinuxSLL. +func (sll *LinuxSLL) LayerType() gopacket.LayerType { return LayerTypeLinuxSLL } + +func (sll *LinuxSLL) CanDecode() gopacket.LayerClass { + return LayerTypeLinuxSLL +} + +func (sll *LinuxSLL) LinkFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointMAC, sll.Addr, nil) +} + +func (sll *LinuxSLL) NextLayerType() gopacket.LayerType { + return sll.EthernetType.LayerType() +} + +func (sll *LinuxSLL) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + if len(data) < 16 { + return errors.New("Linux SLL packet too small") + } + sll.PacketType = LinuxSLLPacketType(binary.BigEndian.Uint16(data[0:2])) + sll.AddrLen = binary.BigEndian.Uint16(data[4:6]) + + sll.Addr = net.HardwareAddr(data[6 : sll.AddrLen+6]) + sll.EthernetType = EthernetType(binary.BigEndian.Uint16(data[14:16])) + sll.BaseLayer = BaseLayer{data[:16], data[16:]} + + return nil +} + +func decodeLinuxSLL(data []byte, p gopacket.PacketBuilder) error { + sll := &LinuxSLL{} + if err := sll.DecodeFromBytes(data, p); err != nil { + return err + } + p.AddLayer(sll) + p.SetLinkLayer(sll) + return p.NextDecoder(sll.EthernetType) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/llc.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/llc.go new file mode 100644 index 00000000..ac5659aa --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/llc.go @@ -0,0 +1,77 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "github.com/tsg/gopacket" +) + +// LLC is the layer used for 802.2 Logical Link Control headers. +// See http://standards.ieee.org/getieee802/download/802.2-1998.pdf +type LLC struct { + BaseLayer + DSAP uint8 + IG bool // true means group, false means individual + SSAP uint8 + CR bool // true means response, false means command + Control uint16 +} + +// LayerType returns gopacket.LayerTypeLLC. +func (l *LLC) LayerType() gopacket.LayerType { return LayerTypeLLC } + +// SNAP is used inside LLC. See +// http://standards.ieee.org/getieee802/download/802-2001.pdf. +// From http://en.wikipedia.org/wiki/Subnetwork_Access_Protocol: +// "[T]he Subnetwork Access Protocol (SNAP) is a mechanism for multiplexing, +// on networks using IEEE 802.2 LLC, more protocols than can be distinguished +// by the 8-bit 802.2 Service Access Point (SAP) fields." +type SNAP struct { + BaseLayer + OrganizationalCode []byte + Type EthernetType +} + +// LayerType returns gopacket.LayerTypeSNAP. +func (s *SNAP) LayerType() gopacket.LayerType { return LayerTypeSNAP } + +func decodeLLC(data []byte, p gopacket.PacketBuilder) error { + l := &LLC{ + DSAP: data[0] & 0xFE, + IG: data[0]&0x1 != 0, + SSAP: data[1] & 0xFE, + CR: data[1]&0x1 != 0, + Control: uint16(data[2]), + } + if l.Control&0x1 == 0 || l.Control&0x3 == 0x1 { + l.Control = l.Control<<8 | uint16(data[3]) + l.Contents = data[:4] + l.Payload = data[4:] + } else { + l.Contents = data[:3] + l.Payload = data[3:] + } + p.AddLayer(l) + if l.DSAP == 0xAA && l.SSAP == 0xAA { + return p.NextDecoder(LayerTypeSNAP) + } + return p.NextDecoder(gopacket.DecodeUnknown) +} + +func decodeSNAP(data []byte, p gopacket.PacketBuilder) error { + s := &SNAP{ + OrganizationalCode: data[:3], + Type: EthernetType(binary.BigEndian.Uint16(data[3:5])), + BaseLayer: BaseLayer{data[:5], data[5:]}, + } + p.AddLayer(s) + // BUG(gconnell): When decoding SNAP, we treat the SNAP type as an Ethernet + // type. This may not actually be an ethernet type in all cases, + // depending on the organizational code. Right now, we don't check. + return p.NextDecoder(s.Type) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/lldp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/lldp.go new file mode 100644 index 00000000..c77bd981 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/lldp.go @@ -0,0 +1,1528 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" +) + +// LLDPTLVType is the type of each TLV value in a LinkLayerDiscovery packet. +type LLDPTLVType byte + +const ( + LLDPTLVEnd LLDPTLVType = 0 + LLDPTLVChassisID LLDPTLVType = 1 + LLDPTLVPortID LLDPTLVType = 2 + LLDPTLVTTL LLDPTLVType = 3 + LLDPTLVPortDescription LLDPTLVType = 4 + LLDPTLVSysName LLDPTLVType = 5 + LLDPTLVSysDescription LLDPTLVType = 6 + LLDPTLVSysCapabilities LLDPTLVType = 7 + LLDPTLVMgmtAddress LLDPTLVType = 8 + LLDPTLVOrgSpecific LLDPTLVType = 127 +) + +// LinkLayerDiscoveryValue is a TLV value inside a LinkLayerDiscovery packet layer. +type LinkLayerDiscoveryValue struct { + Type LLDPTLVType + Length uint16 + Value []byte +} + +// LLDPChassisIDSubType specifies the value type for a single LLDPChassisID.ID +type LLDPChassisIDSubType byte + +// LLDP Chassis Types +const ( + LLDPChassisIDSubTypeReserved LLDPChassisIDSubType = 0 + LLDPChassisIDSubTypeChassisComp LLDPChassisIDSubType = 1 + LLDPChassisIDSubtypeIfaceAlias LLDPChassisIDSubType = 2 + LLDPChassisIDSubTypePortComp LLDPChassisIDSubType = 3 + LLDPChassisIDSubTypeMACAddr LLDPChassisIDSubType = 4 + LLDPChassisIDSubTypeNetworkAddr LLDPChassisIDSubType = 5 + LLDPChassisIDSubtypeIfaceName LLDPChassisIDSubType = 6 + LLDPChassisIDSubTypeLocal LLDPChassisIDSubType = 7 +) + +type LLDPChassisID struct { + Subtype LLDPChassisIDSubType + ID []byte +} + +// LLDPPortIDSubType specifies the value type for a single LLDPPortID.ID +type LLDPPortIDSubType byte + +// LLDP PortID types +const ( + LLDPPortIDSubtypeReserved LLDPPortIDSubType = 0 + LLDPPortIDSubtypeIfaceAlias LLDPPortIDSubType = 1 + LLDPPortIDSubtypePortComp LLDPPortIDSubType = 2 + LLDPPortIDSubtypeMACAddr LLDPPortIDSubType = 3 + LLDPPortIDSubtypeNetworkAddr LLDPPortIDSubType = 4 + LLDPPortIDSubtypeIfaceName LLDPPortIDSubType = 5 + LLDPPortIDSubtypeAgentCircuitID LLDPPortIDSubType = 6 + LLDPPortIDSubtypeLocal LLDPPortIDSubType = 7 +) + +type LLDPPortID struct { + Subtype LLDPPortIDSubType + ID []byte +} + +// LinkLayerDiscovery is a packet layer containing the LinkLayer Discovery Protocol. +// See http:http://standards.ieee.org/getieee802/download/802.1AB-2009.pdf +// ChassisID, PortID and TTL are mandatory TLV's. Other values can be decoded +// with DecodeValues() +type LinkLayerDiscovery struct { + BaseLayer + ChassisID LLDPChassisID + PortID LLDPPortID + TTL uint16 + Values []LinkLayerDiscoveryValue +} + +type IEEEOUI uint32 + +// http://standards.ieee.org/develop/regauth/oui/oui.txt +const ( + IEEEOUI8021 IEEEOUI = 0x0080c2 + IEEEOUI8023 IEEEOUI = 0x00120f + IEEEOUI80211 IEEEOUI = 0x000fac + IEEEOUI8021Qbg IEEEOUI = 0x0013BF + IEEEOUICisco2 IEEEOUI = 0x000142 + IEEEOUIMedia IEEEOUI = 0x0012bb // TR-41 + IEEEOUIProfinet IEEEOUI = 0x000ecf + IEEEOUIDCBX IEEEOUI = 0x001b21 +) + +// LLDPOrgSpecificTLV is an Organisation-specific TLV +type LLDPOrgSpecificTLV struct { + OUI IEEEOUI + SubType uint8 + Info []byte +} + +// LLDPCapabilities Types +const ( + LLDPCapsOther uint16 = 1 << 0 + LLDPCapsRepeater uint16 = 1 << 1 + LLDPCapsBridge uint16 = 1 << 2 + LLDPCapsWLANAP uint16 = 1 << 3 + LLDPCapsRouter uint16 = 1 << 4 + LLDPCapsPhone uint16 = 1 << 5 + LLDPCapsDocSis uint16 = 1 << 6 + LLDPCapsStationOnly uint16 = 1 << 7 + LLDPCapsCVLAN uint16 = 1 << 8 + LLDPCapsSVLAN uint16 = 1 << 9 + LLDPCapsTmpr uint16 = 1 << 10 +) + +// LLDPCapabilities represents the capabilities of a device +type LLDPCapabilities struct { + Other bool + Repeater bool + Bridge bool + WLANAP bool + Router bool + Phone bool + DocSis bool + StationOnly bool + CVLAN bool + SVLAN bool + TMPR bool +} + +type LLDPSysCapabilities struct { + SystemCap LLDPCapabilities + EnabledCap LLDPCapabilities +} + +type IANAAddressFamily byte + +// LLDP Management Address Subtypes +// http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xml +const ( + IANAAddressFamilyReserved IANAAddressFamily = 0 + IANAAddressFamilyIPV4 IANAAddressFamily = 1 + IANAAddressFamilyIPV6 IANAAddressFamily = 2 + IANAAddressFamilyNSAP IANAAddressFamily = 3 + IANAAddressFamilyHDLC IANAAddressFamily = 4 + IANAAddressFamilyBBN1822 IANAAddressFamily = 5 + IANAAddressFamily802 IANAAddressFamily = 6 + IANAAddressFamilyE163 IANAAddressFamily = 7 + IANAAddressFamilyE164 IANAAddressFamily = 8 + IANAAddressFamilyF69 IANAAddressFamily = 9 + IANAAddressFamilyX121 IANAAddressFamily = 10 + IANAAddressFamilyIPX IANAAddressFamily = 11 + IANAAddressFamilyAtalk IANAAddressFamily = 12 + IANAAddressFamilyDecnet IANAAddressFamily = 13 + IANAAddressFamilyBanyan IANAAddressFamily = 14 + IANAAddressFamilyE164NSAP IANAAddressFamily = 15 + IANAAddressFamilyDNS IANAAddressFamily = 16 + IANAAddressFamilyDistname IANAAddressFamily = 17 + IANAAddressFamilyASNumber IANAAddressFamily = 18 + IANAAddressFamilyXTPIPV4 IANAAddressFamily = 19 + IANAAddressFamilyXTPIPV6 IANAAddressFamily = 20 + IANAAddressFamilyXTP IANAAddressFamily = 21 + IANAAddressFamilyFcWWPN IANAAddressFamily = 22 + IANAAddressFamilyFcWWNN IANAAddressFamily = 23 + IANAAddressFamilyGWID IANAAddressFamily = 24 + IANAAddressFamilyL2VPN IANAAddressFamily = 25 +) + +type LLDPInterfaceSubtype byte + +// LLDP Interface Subtypes +const ( + LLDPInterfaceSubtypeUnknown LLDPInterfaceSubtype = 1 + LLDPInterfaceSubtypeifIndex LLDPInterfaceSubtype = 2 + LLDPInterfaceSubtypeSysPort LLDPInterfaceSubtype = 3 +) + +type LLDPMgmtAddress struct { + Subtype IANAAddressFamily + Address []byte + InterfaceSubtype LLDPInterfaceSubtype + InterfaceNumber uint32 + OID string +} + +// LinkLayerDiscoveryInfo represents the decoded details for a set of LinkLayerDiscoveryValues +// Organisation-specific TLV's can be decoded using the various Decode() methods +type LinkLayerDiscoveryInfo struct { + BaseLayer + PortDescription string + SysName string + SysDescription string + SysCapabilities LLDPSysCapabilities + MgmtAddress LLDPMgmtAddress + OrgTLVs []LLDPOrgSpecificTLV // Private TLVs + Unknown []LinkLayerDiscoveryValue // undecoded TLVs +} + +/// IEEE 802.1 TLV Subtypes +const ( + LLDP8021SubtypePortVLANID uint8 = 1 + LLDP8021SubtypeProtocolVLANID uint8 = 2 + LLDP8021SubtypeVLANName uint8 = 3 + LLDP8021SubtypeProtocolIdentity uint8 = 4 + LLDP8021SubtypeVDIUsageDigest uint8 = 5 + LLDP8021SubtypeManagementVID uint8 = 6 + LLDP8021SubtypeLinkAggregation uint8 = 7 +) + +// VLAN Port Protocol ID options +const ( + LLDPProtocolVLANIDCapability byte = 1 << 1 + LLDPProtocolVLANIDStatus byte = 1 << 2 +) + +type PortProtocolVLANID struct { + Supported bool + Enabled bool + ID uint16 +} + +type VLANName struct { + ID uint16 + Name string +} + +type ProtocolIdentity []byte + +// LACP options +const ( + LLDPAggregationCapability byte = 1 << 0 + LLDPAggregationStatus byte = 1 << 1 +) + +// IEEE 802 Link Aggregation parameters +type LLDPLinkAggregation struct { + Supported bool + Enabled bool + PortID uint32 +} + +// LLDPInfo8021 represents the information carried in 802.1 Org-specific TLVs +type LLDPInfo8021 struct { + PVID uint16 + PPVIDs []PortProtocolVLANID + VLANNames []VLANName + ProtocolIdentities []ProtocolIdentity + VIDUsageDigest uint32 + ManagementVID uint16 + LinkAggregation LLDPLinkAggregation +} + +// IEEE 802.3 TLV Subtypes +const ( + LLDP8023SubtypeMACPHY uint8 = 1 + LLDP8023SubtypeMDIPower uint8 = 2 + LLDP8023SubtypeLinkAggregation uint8 = 3 + LLDP8023SubtypeMTU uint8 = 4 +) + +// MACPHY options +const ( + LLDPMACPHYCapability byte = 1 << 0 + LLDPMACPHYStatus byte = 1 << 1 +) + +// From IANA-MAU-MIB (introduced by RFC 4836) - dot3MauType +const ( + LLDPMAUTypeUnknown uint16 = 0 + LLDPMAUTypeAUI uint16 = 1 + LLDPMAUType10Base5 uint16 = 2 + LLDPMAUTypeFOIRL uint16 = 3 + LLDPMAUType10Base2 uint16 = 4 + LLDPMAUType10BaseT uint16 = 5 + LLDPMAUType10BaseFP uint16 = 6 + LLDPMAUType10BaseFB uint16 = 7 + LLDPMAUType10BaseFL uint16 = 8 + LLDPMAUType10BROAD36 uint16 = 9 + LLDPMAUType10BaseT_HD uint16 = 10 + LLDPMAUType10BaseT_FD uint16 = 11 + LLDPMAUType10BaseFL_HD uint16 = 12 + LLDPMAUType10BaseFL_FD uint16 = 13 + LLDPMAUType100BaseT4 uint16 = 14 + LLDPMAUType100BaseTX_HD uint16 = 15 + LLDPMAUType100BaseTX_FD uint16 = 16 + LLDPMAUType100BaseFX_HD uint16 = 17 + LLDPMAUType100BaseFX_FD uint16 = 18 + LLDPMAUType100BaseT2_HD uint16 = 19 + LLDPMAUType100BaseT2_FD uint16 = 20 + LLDPMAUType1000BaseX_HD uint16 = 21 + LLDPMAUType1000BaseX_FD uint16 = 22 + LLDPMAUType1000BaseLX_HD uint16 = 23 + LLDPMAUType1000BaseLX_FD uint16 = 24 + LLDPMAUType1000BaseSX_HD uint16 = 25 + LLDPMAUType1000BaseSX_FD uint16 = 26 + LLDPMAUType1000BaseCX_HD uint16 = 27 + LLDPMAUType1000BaseCX_FD uint16 = 28 + LLDPMAUType1000BaseT_HD uint16 = 29 + LLDPMAUType1000BaseT_FD uint16 = 30 + LLDPMAUType10GBaseX uint16 = 31 + LLDPMAUType10GBaseLX4 uint16 = 32 + LLDPMAUType10GBaseR uint16 = 33 + LLDPMAUType10GBaseER uint16 = 34 + LLDPMAUType10GBaseLR uint16 = 35 + LLDPMAUType10GBaseSR uint16 = 36 + LLDPMAUType10GBaseW uint16 = 37 + LLDPMAUType10GBaseEW uint16 = 38 + LLDPMAUType10GBaseLW uint16 = 39 + LLDPMAUType10GBaseSW uint16 = 40 + LLDPMAUType10GBaseCX4 uint16 = 41 + LLDPMAUType2BaseTL uint16 = 42 + LLDPMAUType10PASS_TS uint16 = 43 + LLDPMAUType100BaseBX10D uint16 = 44 + LLDPMAUType100BaseBX10U uint16 = 45 + LLDPMAUType100BaseLX10 uint16 = 46 + LLDPMAUType1000BaseBX10D uint16 = 47 + LLDPMAUType1000BaseBX10U uint16 = 48 + LLDPMAUType1000BaseLX10 uint16 = 49 + LLDPMAUType1000BasePX10D uint16 = 50 + LLDPMAUType1000BasePX10U uint16 = 51 + LLDPMAUType1000BasePX20D uint16 = 52 + LLDPMAUType1000BasePX20U uint16 = 53 + LLDPMAUType10GBaseT uint16 = 54 + LLDPMAUType10GBaseLRM uint16 = 55 + LLDPMAUType1000BaseKX uint16 = 56 + LLDPMAUType10GBaseKX4 uint16 = 57 + LLDPMAUType10GBaseKR uint16 = 58 + LLDPMAUType10_1GBasePRX_D1 uint16 = 59 + LLDPMAUType10_1GBasePRX_D2 uint16 = 60 + LLDPMAUType10_1GBasePRX_D3 uint16 = 61 + LLDPMAUType10_1GBasePRX_U1 uint16 = 62 + LLDPMAUType10_1GBasePRX_U2 uint16 = 63 + LLDPMAUType10_1GBasePRX_U3 uint16 = 64 + LLDPMAUType10GBasePR_D1 uint16 = 65 + LLDPMAUType10GBasePR_D2 uint16 = 66 + LLDPMAUType10GBasePR_D3 uint16 = 67 + LLDPMAUType10GBasePR_U1 uint16 = 68 + LLDPMAUType10GBasePR_U3 uint16 = 69 +) + +// From RFC 3636 - ifMauAutoNegCapAdvertisedBits +const ( + LLDPMAUPMDOther uint16 = 1 << 15 + LLDPMAUPMD10BaseT uint16 = 1 << 14 + LLDPMAUPMD10BaseT_FD uint16 = 1 << 13 + LLDPMAUPMD100BaseT4 uint16 = 1 << 12 + LLDPMAUPMD100BaseTX uint16 = 1 << 11 + LLDPMAUPMD100BaseTX_FD uint16 = 1 << 10 + LLDPMAUPMD100BaseT2 uint16 = 1 << 9 + LLDPMAUPMD100BaseT2_FD uint16 = 1 << 8 + LLDPMAUPMDFDXPAUSE uint16 = 1 << 7 + LLDPMAUPMDFDXAPAUSE uint16 = 1 << 6 + LLDPMAUPMDFDXSPAUSE uint16 = 1 << 5 + LLDPMAUPMDFDXBPAUSE uint16 = 1 << 4 + LLDPMAUPMD1000BaseX uint16 = 1 << 3 + LLDPMAUPMD1000BaseX_FD uint16 = 1 << 2 + LLDPMAUPMD1000BaseT uint16 = 1 << 1 + LLDPMAUPMD1000BaseT_FD uint16 = 1 << 0 +) + +// Inverted ifMauAutoNegCapAdvertisedBits if required +// (Some manufacturers misinterpreted the spec - +// see https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1455) +const ( + LLDPMAUPMDOtherInv uint16 = 1 << 0 + LLDPMAUPMD10BaseTInv uint16 = 1 << 1 + LLDPMAUPMD10BaseT_FDInv uint16 = 1 << 2 + LLDPMAUPMD100BaseT4Inv uint16 = 1 << 3 + LLDPMAUPMD100BaseTXInv uint16 = 1 << 4 + LLDPMAUPMD100BaseTX_FDInv uint16 = 1 << 5 + LLDPMAUPMD100BaseT2Inv uint16 = 1 << 6 + LLDPMAUPMD100BaseT2_FDInv uint16 = 1 << 7 + LLDPMAUPMDFDXPAUSEInv uint16 = 1 << 8 + LLDPMAUPMDFDXAPAUSEInv uint16 = 1 << 9 + LLDPMAUPMDFDXSPAUSEInv uint16 = 1 << 10 + LLDPMAUPMDFDXBPAUSEInv uint16 = 1 << 11 + LLDPMAUPMD1000BaseXInv uint16 = 1 << 12 + LLDPMAUPMD1000BaseX_FDInv uint16 = 1 << 13 + LLDPMAUPMD1000BaseTInv uint16 = 1 << 14 + LLDPMAUPMD1000BaseT_FDInv uint16 = 1 << 15 +) + +type LLDPMACPHYConfigStatus struct { + AutoNegSupported bool + AutoNegEnabled bool + AutoNegCapability uint16 + MAUType uint16 +} + +// MDI Power options +const ( + LLDPMDIPowerPortClass byte = 1 << 0 + LLDPMDIPowerCapability byte = 1 << 1 + LLDPMDIPowerStatus byte = 1 << 2 + LLDPMDIPowerPairsAbility byte = 1 << 3 +) + +type LLDPPowerType byte + +type LLDPPowerSource byte + +type LLDPPowerPriority byte + +const ( + LLDPPowerPriorityUnknown LLDPPowerPriority = 0 + LLDPPowerPriorityMedium LLDPPowerPriority = 1 + LLDPPowerPriorityHigh LLDPPowerPriority = 2 + LLDPPowerPriorityLow LLDPPowerPriority = 3 +) + +type LLDPPowerViaMDI8023 struct { + PortClassPSE bool // false = PD + PSESupported bool + PSEEnabled bool + PSEPairsAbility bool + PSEPowerPair uint8 + PSEClass uint8 + Type LLDPPowerType + Source LLDPPowerSource + Priority LLDPPowerPriority + Requested uint16 // 1-510 Watts + Allocated uint16 // 1-510 Watts +} + +// LLDPInfo8023 represents the information carried in 802.3 Org-specific TLVs +type LLDPInfo8023 struct { + MACPHYConfigStatus LLDPMACPHYConfigStatus + PowerViaMDI LLDPPowerViaMDI8023 + LinkAggregation LLDPLinkAggregation + MTU uint16 +} + +// IEEE 802.1Qbg TLV Subtypes +const ( + LLDP8021QbgEVB uint8 = 0 + LLDP8021QbgCDCP uint8 = 1 + LLDP8021QbgVDP uint8 = 2 + LLDP8021QbgEVB22 uint8 = 13 +) + +// LLDPEVBCapabilities Types +const ( + LLDPEVBCapsSTD uint16 = 1 << 7 + LLDPEVBCapsRR uint16 = 1 << 6 + LLDPEVBCapsRTE uint16 = 1 << 2 + LLDPEVBCapsECP uint16 = 1 << 1 + LLDPEVBCapsVDP uint16 = 1 << 0 +) + +// LLDPEVBCapabilities represents the EVB capabilities of a device +type LLDPEVBCapabilities struct { + StandardBridging bool + ReflectiveRelay bool + RetransmissionTimerExponent bool + EdgeControlProtocol bool + VSIDiscoveryProtocol bool +} + +type LLDPEVBSettings struct { + Supported LLDPEVBCapabilities + Enabled LLDPEVBCapabilities + SupportedVSIs uint16 + ConfiguredVSIs uint16 + RTEExponent uint8 +} + +// LLDPInfo8021Qbg represents the information carried in 802.1Qbg Org-specific TLVs +type LLDPInfo8021Qbg struct { + EVBSettings LLDPEVBSettings +} + +type LLDPMediaSubtype uint8 + +// Media TLV Subtypes +const ( + LLDPMediaTypeCapabilities LLDPMediaSubtype = 1 + LLDPMediaTypeNetwork LLDPMediaSubtype = 2 + LLDPMediaTypeLocation LLDPMediaSubtype = 3 + LLDPMediaTypePower LLDPMediaSubtype = 4 + LLDPMediaTypeHardware LLDPMediaSubtype = 5 + LLDPMediaTypeFirmware LLDPMediaSubtype = 6 + LLDPMediaTypeSoftware LLDPMediaSubtype = 7 + LLDPMediaTypeSerial LLDPMediaSubtype = 8 + LLDPMediaTypeManufacturer LLDPMediaSubtype = 9 + LLDPMediaTypeModel LLDPMediaSubtype = 10 + LLDPMediaTypeAssetID LLDPMediaSubtype = 11 +) + +type LLDPMediaClass uint8 + +// Media Class Values +const ( + LLDPMediaClassUndefined LLDPMediaClass = 0 + LLDPMediaClassEndpointI LLDPMediaClass = 1 + LLDPMediaClassEndpointII LLDPMediaClass = 2 + LLDPMediaClassEndpointIII LLDPMediaClass = 3 + LLDPMediaClassNetwork LLDPMediaClass = 4 +) + +// LLDPMediaCapabilities Types +const ( + LLDPMediaCapsLLDP uint16 = 1 << 0 + LLDPMediaCapsNetwork uint16 = 1 << 1 + LLDPMediaCapsLocation uint16 = 1 << 2 + LLDPMediaCapsPowerPSE uint16 = 1 << 3 + LLDPMediaCapsPowerPD uint16 = 1 << 4 + LLDPMediaCapsInventory uint16 = 1 << 5 +) + +// LLDPMediaCapabilities represents the LLDP Media capabilities of a device +type LLDPMediaCapabilities struct { + Capabilities bool + NetworkPolicy bool + Location bool + PowerPSE bool + PowerPD bool + Inventory bool + Class LLDPMediaClass +} + +type LLDPApplicationType uint8 + +const ( + LLDPAppTypeReserved LLDPApplicationType = 0 + LLDPAppTypeVoice LLDPApplicationType = 1 + LLDPappTypeVoiceSignaling LLDPApplicationType = 2 + LLDPappTypeGuestVoice LLDPApplicationType = 3 + LLDPappTypeGuestVoiceSignaling LLDPApplicationType = 4 + LLDPappTypeSoftphoneVoice LLDPApplicationType = 5 + LLDPappTypeVideoConferencing LLDPApplicationType = 6 + LLDPappTypeStreamingVideo LLDPApplicationType = 7 + LLDPappTypeVideoSignaling LLDPApplicationType = 8 +) + +type LLDPNetworkPolicy struct { + ApplicationType LLDPApplicationType + Defined bool + Tagged bool + VLANId uint16 + L2Priority uint16 + DSCPValue uint8 +} + +type LLDPLocationFormat uint8 + +const ( + LLDPLocationFormatInvalid LLDPLocationFormat = 0 + LLDPLocationFormatCoordinate LLDPLocationFormat = 1 + LLDPLocationFormatAddress LLDPLocationFormat = 2 + LLDPLocationFormatECS LLDPLocationFormat = 3 +) + +type LLDPLocationAddressWhat uint8 + +const ( + LLDPLocationAddressWhatDHCP LLDPLocationAddressWhat = 0 + LLDPLocationAddressWhatNetwork LLDPLocationAddressWhat = 1 + LLDPLocationAddressWhatClient LLDPLocationAddressWhat = 2 +) + +type LLDPLocationAddressType uint8 + +const ( + LLDPLocationAddressTypeLanguage LLDPLocationAddressType = 0 + LLDPLocationAddressTypeNational LLDPLocationAddressType = 1 + LLDPLocationAddressTypeCounty LLDPLocationAddressType = 2 + LLDPLocationAddressTypeCity LLDPLocationAddressType = 3 + LLDPLocationAddressTypeCityDivision LLDPLocationAddressType = 4 + LLDPLocationAddressTypeNeighborhood LLDPLocationAddressType = 5 + LLDPLocationAddressTypeStreet LLDPLocationAddressType = 6 + LLDPLocationAddressTypeLeadingStreet LLDPLocationAddressType = 16 + LLDPLocationAddressTypeTrailingStreet LLDPLocationAddressType = 17 + LLDPLocationAddressTypeStreetSuffix LLDPLocationAddressType = 18 + LLDPLocationAddressTypeHouseNum LLDPLocationAddressType = 19 + LLDPLocationAddressTypeHouseSuffix LLDPLocationAddressType = 20 + LLDPLocationAddressTypeLandmark LLDPLocationAddressType = 21 + LLDPLocationAddressTypeAdditional LLDPLocationAddressType = 22 + LLDPLocationAddressTypeName LLDPLocationAddressType = 23 + LLDPLocationAddressTypePostal LLDPLocationAddressType = 24 + LLDPLocationAddressTypeBuilding LLDPLocationAddressType = 25 + LLDPLocationAddressTypeUnit LLDPLocationAddressType = 26 + LLDPLocationAddressTypeFloor LLDPLocationAddressType = 27 + LLDPLocationAddressTypeRoom LLDPLocationAddressType = 28 + LLDPLocationAddressTypePlace LLDPLocationAddressType = 29 + LLDPLocationAddressTypeScript LLDPLocationAddressType = 128 +) + +type LLDPLocationCoordinate struct { + LatitudeResolution uint8 + Latitude uint64 + LongitudeResolution uint8 + Longitude uint64 + AltitudeType uint8 + AltitudeResolution uint16 + Altitude uint32 + Datum uint8 +} + +type LLDPLocationAddressLine struct { + Type LLDPLocationAddressType + Value string +} + +type LLDPLocationAddress struct { + What LLDPLocationAddressWhat + CountryCode string + AddressLines []LLDPLocationAddressLine +} + +type LLDPLocationECS struct { + ELIN string +} + +// LLDP represents a physical location. +// Only one of the embedded types will contain values, depending on Format. +type LLDPLocation struct { + Format LLDPLocationFormat + Coordinate LLDPLocationCoordinate + Address LLDPLocationAddress + ECS LLDPLocationECS +} + +type LLDPPowerViaMDI struct { + Type LLDPPowerType + Source LLDPPowerSource + Priority LLDPPowerPriority + Value uint16 +} + +// LLDPInfoMedia represents the information carried in TR-41 Org-specific TLVs +type LLDPInfoMedia struct { + MediaCapabilities LLDPMediaCapabilities + NetworkPolicy LLDPNetworkPolicy + Location LLDPLocation + PowerViaMDI LLDPPowerViaMDI + HardwareRevision string + FirmwareRevision string + SoftwareRevision string + SerialNumber string + Manufacturer string + Model string + AssetID string +} + +type LLDPCisco2Subtype uint8 + +// Cisco2 TLV Subtypes +const ( + LLDPCisco2PowerViaMDI LLDPCisco2Subtype = 1 +) + +const ( + LLDPCiscoPSESupport uint8 = 1 << 0 + LLDPCiscoArchShared uint8 = 1 << 1 + LLDPCiscoPDSparePair uint8 = 1 << 2 + LLDPCiscoPSESparePair uint8 = 1 << 3 +) + +// LLDPInfoCisco2 represents the information carried in Cisco Org-specific TLVs +type LLDPInfoCisco2 struct { + PSEFourWirePoESupported bool + PDSparePairArchitectureShared bool + PDRequestSparePairPoEOn bool + PSESparePairPoEOn bool +} + +// Profinet Subtypes +type LLDPProfinetSubtype uint8 + +const ( + LLDPProfinetPNIODelay LLDPProfinetSubtype = 1 + LLDPProfinetPNIOPortStatus LLDPProfinetSubtype = 2 + LLDPProfinetPNIOMRPPortStatus LLDPProfinetSubtype = 4 + LLDPProfinetPNIOChassisMAC LLDPProfinetSubtype = 5 + LLDPProfinetPNIOPTCPStatus LLDPProfinetSubtype = 6 +) + +type LLDPPNIODelay struct { + RXLocal uint32 + RXRemote uint32 + TXLocal uint32 + TXRemote uint32 + CableLocal uint32 +} + +type LLDPPNIOPortStatus struct { + Class2 uint16 + Class3 uint16 +} + +type LLDPPNIOMRPPortStatus struct { + UUID []byte + Status uint16 +} + +type LLDPPNIOPTCPStatus struct { + MasterAddress []byte + SubdomainUUID []byte + IRDataUUID []byte + PeriodValid bool + PeriodLength uint32 + RedPeriodValid bool + RedPeriodBegin uint32 + OrangePeriodValid bool + OrangePeriodBegin uint32 + GreenPeriodValid bool + GreenPeriodBegin uint32 +} + +// LLDPInfoProfinet represents the information carried in Profinet Org-specific TLVs +type LLDPInfoProfinet struct { + PNIODelay LLDPPNIODelay + PNIOPortStatus LLDPPNIOPortStatus + PNIOMRPPortStatus LLDPPNIOMRPPortStatus + ChassisMAC []byte + PNIOPTCPStatus LLDPPNIOPTCPStatus +} + +// LayerType returns gopacket.LayerTypeLinkLayerDiscovery. +func (c *LinkLayerDiscovery) LayerType() gopacket.LayerType { + return LayerTypeLinkLayerDiscovery +} + +func decodeLinkLayerDiscovery(data []byte, p gopacket.PacketBuilder) error { + var vals []LinkLayerDiscoveryValue + vData := data[0:] + for len(vData) > 0 { + nbit := vData[0] & 0x01 + t := LLDPTLVType(vData[0] >> 1) + val := LinkLayerDiscoveryValue{Type: t, Length: uint16(nbit<<8 + vData[1])} + if val.Length > 0 { + val.Value = vData[2 : val.Length+2] + } + vals = append(vals, val) + if t == LLDPTLVEnd { + break + } + if len(vData) < int(2+val.Length) { + return fmt.Errorf("Malformed LinkLayerDiscovery Header") + } + vData = vData[2+val.Length:] + } + if len(vals) < 4 { + return fmt.Errorf("Missing mandatory LinkLayerDiscovery TLV") + } + c := &LinkLayerDiscovery{} + gotEnd := false + for _, v := range vals { + switch v.Type { + case LLDPTLVEnd: + gotEnd = true + case LLDPTLVChassisID: + if len(v.Value) < 2 { + return fmt.Errorf("Malformed LinkLayerDiscovery ChassisID TLV") + } + c.ChassisID.Subtype = LLDPChassisIDSubType(v.Value[0]) + c.ChassisID.ID = v.Value[1:] + case LLDPTLVPortID: + if len(v.Value) < 2 { + return fmt.Errorf("Malformed LinkLayerDiscovery PortID TLV") + } + c.PortID.Subtype = LLDPPortIDSubType(v.Value[0]) + c.PortID.ID = v.Value[1:] + case LLDPTLVTTL: + if len(v.Value) < 2 { + return fmt.Errorf("Malformed LinkLayerDiscovery TTL TLV") + } + c.TTL = binary.BigEndian.Uint16(v.Value[0:2]) + default: + c.Values = append(c.Values, v) + } + } + if c.ChassisID.Subtype == 0 || c.PortID.Subtype == 0 || !gotEnd { + return fmt.Errorf("Missing mandatory LinkLayerDiscovery TLV") + } + c.Contents = data + p.AddLayer(c) + + info := &LinkLayerDiscoveryInfo{} + p.AddLayer(info) + for _, v := range c.Values { + switch v.Type { + case LLDPTLVPortDescription: + info.PortDescription = string(v.Value) + case LLDPTLVSysName: + info.SysName = string(v.Value) + case LLDPTLVSysDescription: + info.SysDescription = string(v.Value) + case LLDPTLVSysCapabilities: + if err := checkLLDPTLVLen(v, 4); err != nil { + return err + } + info.SysCapabilities.SystemCap = getCapabilities(binary.BigEndian.Uint16(v.Value[0:2])) + info.SysCapabilities.EnabledCap = getCapabilities(binary.BigEndian.Uint16(v.Value[2:4])) + case LLDPTLVMgmtAddress: + if err := checkLLDPTLVLen(v, 9); err != nil { + return err + } + mlen := v.Value[0] + if err := checkLLDPTLVLen(v, int(mlen+7)); err != nil { + return err + } + info.MgmtAddress.Subtype = IANAAddressFamily(v.Value[1]) + info.MgmtAddress.Address = v.Value[2 : mlen+1] + info.MgmtAddress.InterfaceSubtype = LLDPInterfaceSubtype(v.Value[mlen+1]) + info.MgmtAddress.InterfaceNumber = binary.BigEndian.Uint32(v.Value[mlen+2 : mlen+6]) + olen := v.Value[mlen+6] + if err := checkLLDPTLVLen(v, int(mlen+6+olen)); err != nil { + return err + } + info.MgmtAddress.OID = string(v.Value[mlen+9 : mlen+9+olen]) + case LLDPTLVOrgSpecific: + if err := checkLLDPTLVLen(v, 4); err != nil { + return err + } + info.OrgTLVs = append(info.OrgTLVs, LLDPOrgSpecificTLV{IEEEOUI(binary.BigEndian.Uint32(append([]byte{byte(0)}, v.Value[0:3]...))), uint8(v.Value[3]), v.Value[4:]}) + } + } + return nil +} + +func (l *LinkLayerDiscoveryInfo) Decode8021() (info LLDPInfo8021, err error) { + for _, o := range l.OrgTLVs { + if o.OUI != IEEEOUI8021 { + continue + } + switch o.SubType { + case LLDP8021SubtypePortVLANID: + if err = checkLLDPOrgSpecificLen(o, 2); err != nil { + return + } + info.PVID = binary.BigEndian.Uint16(o.Info[0:2]) + case LLDP8021SubtypeProtocolVLANID: + if err = checkLLDPOrgSpecificLen(o, 3); err != nil { + return + } + sup := (o.Info[0]&LLDPProtocolVLANIDCapability > 0) + en := (o.Info[0]&LLDPProtocolVLANIDStatus > 0) + id := binary.BigEndian.Uint16(o.Info[1:3]) + info.PPVIDs = append(info.PPVIDs, PortProtocolVLANID{sup, en, id}) + case LLDP8021SubtypeVLANName: + if err = checkLLDPOrgSpecificLen(o, 2); err != nil { + return + } + id := binary.BigEndian.Uint16(o.Info[0:2]) + info.VLANNames = append(info.VLANNames, VLANName{id, string(o.Info[3:])}) + case LLDP8021SubtypeProtocolIdentity: + if err = checkLLDPOrgSpecificLen(o, 1); err != nil { + return + } + l := int(o.Info[0]) + if l > 0 { + info.ProtocolIdentities = append(info.ProtocolIdentities, o.Info[1:1+l]) + } + case LLDP8021SubtypeVDIUsageDigest: + if err = checkLLDPOrgSpecificLen(o, 4); err != nil { + return + } + info.VIDUsageDigest = binary.BigEndian.Uint32(o.Info[0:4]) + case LLDP8021SubtypeManagementVID: + if err = checkLLDPOrgSpecificLen(o, 2); err != nil { + return + } + info.ManagementVID = binary.BigEndian.Uint16(o.Info[0:2]) + case LLDP8021SubtypeLinkAggregation: + if err = checkLLDPOrgSpecificLen(o, 5); err != nil { + return + } + sup := (o.Info[0]&LLDPAggregationCapability > 0) + en := (o.Info[0]&LLDPAggregationStatus > 0) + info.LinkAggregation = LLDPLinkAggregation{sup, en, binary.BigEndian.Uint32(o.Info[1:5])} + } + } + return +} + +func (l *LinkLayerDiscoveryInfo) Decode8023() (info LLDPInfo8023, err error) { + for _, o := range l.OrgTLVs { + if o.OUI != IEEEOUI8023 { + continue + } + switch o.SubType { + case LLDP8023SubtypeMACPHY: + if err = checkLLDPOrgSpecificLen(o, 5); err != nil { + return + } + sup := (o.Info[0]&LLDPMACPHYCapability > 0) + en := (o.Info[0]&LLDPMACPHYStatus > 0) + ca := binary.BigEndian.Uint16(o.Info[1:3]) + mau := binary.BigEndian.Uint16(o.Info[3:5]) + info.MACPHYConfigStatus = LLDPMACPHYConfigStatus{sup, en, ca, mau} + case LLDP8023SubtypeMDIPower: + if err = checkLLDPOrgSpecificLen(o, 3); err != nil { + return + } + info.PowerViaMDI.PortClassPSE = (o.Info[0]&LLDPMDIPowerPortClass > 0) + info.PowerViaMDI.PSESupported = (o.Info[0]&LLDPMDIPowerCapability > 0) + info.PowerViaMDI.PSEEnabled = (o.Info[0]&LLDPMDIPowerStatus > 0) + info.PowerViaMDI.PSEPairsAbility = (o.Info[0]&LLDPMDIPowerPairsAbility > 0) + info.PowerViaMDI.PSEPowerPair = uint8(o.Info[1]) + info.PowerViaMDI.PSEClass = uint8(o.Info[2]) + if len(o.Info) >= 7 { + info.PowerViaMDI.Type = LLDPPowerType((o.Info[3] & 0xc0) >> 6) + info.PowerViaMDI.Source = LLDPPowerSource((o.Info[3] & 0x30) >> 4) + if info.PowerViaMDI.Type == 1 || info.PowerViaMDI.Type == 3 { + info.PowerViaMDI.Source += 128 // For Stringify purposes + } + info.PowerViaMDI.Priority = LLDPPowerPriority(o.Info[3] & 0x0f) + info.PowerViaMDI.Requested = binary.BigEndian.Uint16(o.Info[4:6]) + info.PowerViaMDI.Allocated = binary.BigEndian.Uint16(o.Info[6:8]) + } + case LLDP8023SubtypeLinkAggregation: + if err = checkLLDPOrgSpecificLen(o, 5); err != nil { + return + } + sup := (o.Info[0]&LLDPAggregationCapability > 0) + en := (o.Info[0]&LLDPAggregationStatus > 0) + info.LinkAggregation = LLDPLinkAggregation{sup, en, binary.BigEndian.Uint32(o.Info[1:5])} + case LLDP8023SubtypeMTU: + if err = checkLLDPOrgSpecificLen(o, 2); err != nil { + return + } + info.MTU = binary.BigEndian.Uint16(o.Info[0:2]) + } + } + return +} + +func (l *LinkLayerDiscoveryInfo) Decode8021Qbg() (info LLDPInfo8021Qbg, err error) { + for _, o := range l.OrgTLVs { + if o.OUI != IEEEOUI8021Qbg { + continue + } + switch o.SubType { + case LLDP8021QbgEVB: + if err = checkLLDPOrgSpecificLen(o, 9); err != nil { + return + } + info.EVBSettings.Supported = getEVBCapabilities(binary.BigEndian.Uint16(o.Info[0:2])) + info.EVBSettings.Enabled = getEVBCapabilities(binary.BigEndian.Uint16(o.Info[2:4])) + info.EVBSettings.SupportedVSIs = binary.BigEndian.Uint16(o.Info[4:6]) + info.EVBSettings.ConfiguredVSIs = binary.BigEndian.Uint16(o.Info[6:8]) + info.EVBSettings.RTEExponent = uint8(o.Info[8]) + } + } + return +} + +func (l *LinkLayerDiscoveryInfo) DecodeMedia() (info LLDPInfoMedia, err error) { + for _, o := range l.OrgTLVs { + if o.OUI != IEEEOUIMedia { + continue + } + switch LLDPMediaSubtype(o.SubType) { + case LLDPMediaTypeCapabilities: + if err = checkLLDPOrgSpecificLen(o, 3); err != nil { + return + } + b := binary.BigEndian.Uint16(o.Info[0:2]) + info.MediaCapabilities.Capabilities = (b & LLDPMediaCapsLLDP) > 0 + info.MediaCapabilities.NetworkPolicy = (b & LLDPMediaCapsNetwork) > 0 + info.MediaCapabilities.Location = (b & LLDPMediaCapsLocation) > 0 + info.MediaCapabilities.PowerPSE = (b & LLDPMediaCapsPowerPSE) > 0 + info.MediaCapabilities.PowerPD = (b & LLDPMediaCapsPowerPD) > 0 + info.MediaCapabilities.Inventory = (b & LLDPMediaCapsInventory) > 0 + info.MediaCapabilities.Class = LLDPMediaClass(o.Info[2]) + case LLDPMediaTypeNetwork: + if err = checkLLDPOrgSpecificLen(o, 4); err != nil { + return + } + info.NetworkPolicy.ApplicationType = LLDPApplicationType(o.Info[0]) + b := binary.BigEndian.Uint16(o.Info[1:3]) + info.NetworkPolicy.Defined = (b & 0x8000) == 0 + info.NetworkPolicy.Tagged = (b & 0x4000) > 0 + info.NetworkPolicy.VLANId = (b & 0x1ffe) >> 1 + b = binary.BigEndian.Uint16(o.Info[2:4]) + info.NetworkPolicy.L2Priority = (b & 0x01c0) >> 6 + info.NetworkPolicy.DSCPValue = uint8(o.Info[3] & 0x3f) + case LLDPMediaTypeLocation: + if err = checkLLDPOrgSpecificLen(o, 1); err != nil { + return + } + info.Location.Format = LLDPLocationFormat(o.Info[0]) + o.Info = o.Info[1:] + switch info.Location.Format { + case LLDPLocationFormatCoordinate: + if err = checkLLDPOrgSpecificLen(o, 16); err != nil { + return + } + info.Location.Coordinate.LatitudeResolution = uint8(o.Info[0]&0xfc) >> 2 + b := binary.BigEndian.Uint64(o.Info[0:8]) + info.Location.Coordinate.Latitude = (b & 0x03ffffffff000000) >> 24 + info.Location.Coordinate.LongitudeResolution = uint8(o.Info[5]&0xfc) >> 2 + b = binary.BigEndian.Uint64(o.Info[5:13]) + info.Location.Coordinate.Longitude = (b & 0x03ffffffff000000) >> 24 + info.Location.Coordinate.AltitudeType = uint8((o.Info[10] & 0x30) >> 4) + b1 := binary.BigEndian.Uint16(o.Info[10:12]) + info.Location.Coordinate.AltitudeResolution = (b1 & 0xfc0) >> 6 + b2 := binary.BigEndian.Uint32(o.Info[11:15]) + info.Location.Coordinate.Altitude = b2 & 0x3fffffff + info.Location.Coordinate.Datum = uint8(o.Info[15]) + case LLDPLocationFormatAddress: + if err = checkLLDPOrgSpecificLen(o, 3); err != nil { + return + } + //ll := uint8(o.Info[0]) + info.Location.Address.What = LLDPLocationAddressWhat(o.Info[1]) + info.Location.Address.CountryCode = string(o.Info[2:4]) + data := o.Info[4:] + for len(data) > 1 { + aType := LLDPLocationAddressType(data[0]) + aLen := int(data[1]) + if len(data) >= aLen+2 { + info.Location.Address.AddressLines = append(info.Location.Address.AddressLines, LLDPLocationAddressLine{aType, string(data[2 : aLen+2])}) + data = data[aLen+2:] + } else { + break + } + } + case LLDPLocationFormatECS: + info.Location.ECS.ELIN = string(o.Info) + } + case LLDPMediaTypePower: + if err = checkLLDPOrgSpecificLen(o, 3); err != nil { + return + } + info.PowerViaMDI.Type = LLDPPowerType((o.Info[0] & 0xc0) >> 6) + info.PowerViaMDI.Source = LLDPPowerSource((o.Info[0] & 0x30) >> 4) + if info.PowerViaMDI.Type == 1 || info.PowerViaMDI.Type == 3 { + info.PowerViaMDI.Source += 128 // For Stringify purposes + } + info.PowerViaMDI.Priority = LLDPPowerPriority(o.Info[0] & 0x0f) + info.PowerViaMDI.Value = binary.BigEndian.Uint16(o.Info[1:3]) * 100 // 0 to 102.3 w, 0.1W increments + case LLDPMediaTypeHardware: + info.HardwareRevision = string(o.Info) + case LLDPMediaTypeFirmware: + info.FirmwareRevision = string(o.Info) + case LLDPMediaTypeSoftware: + info.SoftwareRevision = string(o.Info) + case LLDPMediaTypeSerial: + info.SerialNumber = string(o.Info) + case LLDPMediaTypeManufacturer: + info.Manufacturer = string(o.Info) + case LLDPMediaTypeModel: + info.Model = string(o.Info) + case LLDPMediaTypeAssetID: + info.AssetID = string(o.Info) + } + } + return +} + +func (l *LinkLayerDiscoveryInfo) DecodeCisco2() (info LLDPInfoCisco2, err error) { + for _, o := range l.OrgTLVs { + if o.OUI != IEEEOUICisco2 { + continue + } + switch LLDPCisco2Subtype(o.SubType) { + case LLDPCisco2PowerViaMDI: + if err = checkLLDPOrgSpecificLen(o, 1); err != nil { + return + } + info.PSEFourWirePoESupported = (o.Info[0] & LLDPCiscoPSESupport) > 0 + info.PDSparePairArchitectureShared = (o.Info[0] & LLDPCiscoArchShared) > 0 + info.PDRequestSparePairPoEOn = (o.Info[0] & LLDPCiscoPDSparePair) > 0 + info.PSESparePairPoEOn = (o.Info[0] & LLDPCiscoPSESparePair) > 0 + } + } + return +} + +func (l *LinkLayerDiscoveryInfo) DecodeProfinet() (info LLDPInfoProfinet, err error) { + for _, o := range l.OrgTLVs { + if o.OUI != IEEEOUIProfinet { + continue + } + switch LLDPProfinetSubtype(o.SubType) { + case LLDPProfinetPNIODelay: + if err = checkLLDPOrgSpecificLen(o, 20); err != nil { + return + } + info.PNIODelay.RXLocal = binary.BigEndian.Uint32(o.Info[0:4]) + info.PNIODelay.RXRemote = binary.BigEndian.Uint32(o.Info[4:8]) + info.PNIODelay.TXLocal = binary.BigEndian.Uint32(o.Info[8:12]) + info.PNIODelay.TXRemote = binary.BigEndian.Uint32(o.Info[12:16]) + info.PNIODelay.CableLocal = binary.BigEndian.Uint32(o.Info[16:20]) + case LLDPProfinetPNIOPortStatus: + if err = checkLLDPOrgSpecificLen(o, 4); err != nil { + return + } + info.PNIOPortStatus.Class2 = binary.BigEndian.Uint16(o.Info[0:2]) + info.PNIOPortStatus.Class3 = binary.BigEndian.Uint16(o.Info[2:4]) + case LLDPProfinetPNIOMRPPortStatus: + if err = checkLLDPOrgSpecificLen(o, 18); err != nil { + return + } + info.PNIOMRPPortStatus.UUID = o.Info[0:16] + info.PNIOMRPPortStatus.Status = binary.BigEndian.Uint16(o.Info[16:18]) + case LLDPProfinetPNIOChassisMAC: + if err = checkLLDPOrgSpecificLen(o, 6); err != nil { + return + } + info.ChassisMAC = o.Info[0:6] + case LLDPProfinetPNIOPTCPStatus: + if err = checkLLDPOrgSpecificLen(o, 54); err != nil { + return + } + info.PNIOPTCPStatus.MasterAddress = o.Info[0:6] + info.PNIOPTCPStatus.SubdomainUUID = o.Info[6:22] + info.PNIOPTCPStatus.IRDataUUID = o.Info[22:38] + b := binary.BigEndian.Uint32(o.Info[38:42]) + info.PNIOPTCPStatus.PeriodValid = (b & 0x80000000) > 0 + info.PNIOPTCPStatus.PeriodLength = b & 0x7fffffff + b = binary.BigEndian.Uint32(o.Info[42:46]) + info.PNIOPTCPStatus.RedPeriodValid = (b & 0x80000000) > 0 + info.PNIOPTCPStatus.RedPeriodBegin = b & 0x7fffffff + b = binary.BigEndian.Uint32(o.Info[46:50]) + info.PNIOPTCPStatus.OrangePeriodValid = (b & 0x80000000) > 0 + info.PNIOPTCPStatus.OrangePeriodBegin = b & 0x7fffffff + b = binary.BigEndian.Uint32(o.Info[50:54]) + info.PNIOPTCPStatus.GreenPeriodValid = (b & 0x80000000) > 0 + info.PNIOPTCPStatus.GreenPeriodBegin = b & 0x7fffffff + } + } + return +} + +// LayerType returns gopacket.LayerTypeLinkLayerDiscoveryInfo. +func (c *LinkLayerDiscoveryInfo) LayerType() gopacket.LayerType { + return LayerTypeLinkLayerDiscoveryInfo +} + +func getCapabilities(v uint16) (c LLDPCapabilities) { + c.Other = (v&LLDPCapsOther > 0) + c.Repeater = (v&LLDPCapsRepeater > 0) + c.Bridge = (v&LLDPCapsBridge > 0) + c.WLANAP = (v&LLDPCapsWLANAP > 0) + c.Router = (v&LLDPCapsRouter > 0) + c.Phone = (v&LLDPCapsPhone > 0) + c.DocSis = (v&LLDPCapsDocSis > 0) + c.StationOnly = (v&LLDPCapsStationOnly > 0) + c.CVLAN = (v&LLDPCapsCVLAN > 0) + c.SVLAN = (v&LLDPCapsSVLAN > 0) + c.TMPR = (v&LLDPCapsTmpr > 0) + return +} + +func getEVBCapabilities(v uint16) (c LLDPEVBCapabilities) { + c.StandardBridging = (v & LLDPEVBCapsSTD) > 0 + c.StandardBridging = (v & LLDPEVBCapsSTD) > 0 + c.ReflectiveRelay = (v & LLDPEVBCapsRR) > 0 + c.RetransmissionTimerExponent = (v & LLDPEVBCapsRTE) > 0 + c.EdgeControlProtocol = (v & LLDPEVBCapsECP) > 0 + c.VSIDiscoveryProtocol = (v & LLDPEVBCapsVDP) > 0 + return +} + +func (t LLDPTLVType) String() (s string) { + switch t { + case LLDPTLVEnd: + s = "TLV End" + case LLDPTLVChassisID: + s = "Chassis ID" + case LLDPTLVPortID: + s = "Port ID" + case LLDPTLVTTL: + s = "TTL" + case LLDPTLVPortDescription: + s = "Port Description" + case LLDPTLVSysName: + s = "System Name" + case LLDPTLVSysDescription: + s = "System Description" + case LLDPTLVSysCapabilities: + s = "System Capabilities" + case LLDPTLVMgmtAddress: + s = "Management Address" + case LLDPTLVOrgSpecific: + s = "Organisation Specific" + default: + s = "Unknown" + } + return +} + +func (t LLDPChassisIDSubType) String() (s string) { + switch t { + case LLDPChassisIDSubTypeReserved: + s = "Reserved" + case LLDPChassisIDSubTypeChassisComp: + s = "Chassis Component" + case LLDPChassisIDSubtypeIfaceAlias: + s = "Interface Alias" + case LLDPChassisIDSubTypePortComp: + s = "Port Component" + case LLDPChassisIDSubTypeMACAddr: + s = "MAC Address" + case LLDPChassisIDSubTypeNetworkAddr: + s = "Network Address" + case LLDPChassisIDSubtypeIfaceName: + s = "Interface Name" + case LLDPChassisIDSubTypeLocal: + s = "Local" + default: + s = "Unknown" + } + return +} + +func (t LLDPPortIDSubType) String() (s string) { + switch t { + case LLDPPortIDSubtypeReserved: + s = "Reserved" + case LLDPPortIDSubtypeIfaceAlias: + s = "Interface Alias" + case LLDPPortIDSubtypePortComp: + s = "Port Component" + case LLDPPortIDSubtypeMACAddr: + s = "MAC Address" + case LLDPPortIDSubtypeNetworkAddr: + s = "Network Address" + case LLDPPortIDSubtypeIfaceName: + s = "Interface Name" + case LLDPPortIDSubtypeAgentCircuitID: + s = "Agent Circuit ID" + case LLDPPortIDSubtypeLocal: + s = "Local" + default: + s = "Unknown" + } + return +} + +func (t IANAAddressFamily) String() (s string) { + switch t { + case IANAAddressFamilyReserved: + s = "Reserved" + case IANAAddressFamilyIPV4: + s = "IPv4" + case IANAAddressFamilyIPV6: + s = "IPv6" + case IANAAddressFamilyNSAP: + s = "NSAP" + case IANAAddressFamilyHDLC: + s = "HDLC" + case IANAAddressFamilyBBN1822: + s = "BBN 1822" + case IANAAddressFamily802: + s = "802 media plus Ethernet 'canonical format'" + case IANAAddressFamilyE163: + s = "E.163" + case IANAAddressFamilyE164: + s = "E.164 (SMDS, Frame Relay, ATM)" + case IANAAddressFamilyF69: + s = "F.69 (Telex)" + case IANAAddressFamilyX121: + s = "X.121, X.25, Frame Relay" + case IANAAddressFamilyIPX: + s = "IPX" + case IANAAddressFamilyAtalk: + s = "Appletalk" + case IANAAddressFamilyDecnet: + s = "Decnet IV" + case IANAAddressFamilyBanyan: + s = "Banyan Vines" + case IANAAddressFamilyE164NSAP: + s = "E.164 with NSAP format subaddress" + case IANAAddressFamilyDNS: + s = "DNS" + case IANAAddressFamilyDistname: + s = "Distinguished Name" + case IANAAddressFamilyASNumber: + s = "AS Number" + case IANAAddressFamilyXTPIPV4: + s = "XTP over IP version 4" + case IANAAddressFamilyXTPIPV6: + s = "XTP over IP version 6" + case IANAAddressFamilyXTP: + s = "XTP native mode XTP" + case IANAAddressFamilyFcWWPN: + s = "Fibre Channel World-Wide Port Name" + case IANAAddressFamilyFcWWNN: + s = "Fibre Channel World-Wide Node Name" + case IANAAddressFamilyGWID: + s = "GWID" + case IANAAddressFamilyL2VPN: + s = "AFI for Layer 2 VPN" + default: + s = "Unknown" + } + return +} + +func (t LLDPInterfaceSubtype) String() (s string) { + switch t { + case LLDPInterfaceSubtypeUnknown: + s = "Unknown" + case LLDPInterfaceSubtypeifIndex: + s = "IfIndex" + case LLDPInterfaceSubtypeSysPort: + s = "System Port Number" + default: + s = "Unknown" + } + return +} + +func (t LLDPPowerType) String() (s string) { + switch t { + case 0: + s = "Type 2 PSE Device" + case 1: + s = "Type 2 PD Device" + case 2: + s = "Type 1 PSE Device" + case 3: + s = "Type 1 PD Device" + default: + s = "Unknown" + } + return +} + +func (t LLDPPowerSource) String() (s string) { + switch t { + // PD Device + case 0: + s = "Unknown" + case 1: + s = "PSE" + case 2: + s = "Local" + case 3: + s = "PSE and Local" + // PSE Device (Actual value + 128) + case 128: + s = "Unknown" + case 129: + s = "Primary Power Source" + case 130: + s = "Backup Power Source" + default: + s = "Unknown" + } + return +} + +func (t LLDPPowerPriority) String() (s string) { + switch t { + case 0: + s = "Unknown" + case 1: + s = "Critical" + case 2: + s = "High" + case 3: + s = "Low" + default: + s = "Unknown" + } + return +} + +func (t LLDPMediaSubtype) String() (s string) { + switch t { + case LLDPMediaTypeCapabilities: + s = "Media Capabilities " + case LLDPMediaTypeNetwork: + s = "Network Policy" + case LLDPMediaTypeLocation: + s = "Location Identification" + case LLDPMediaTypePower: + s = "Extended Power-via-MDI" + case LLDPMediaTypeHardware: + s = "Hardware Revision" + case LLDPMediaTypeFirmware: + s = "Firmware Revision" + case LLDPMediaTypeSoftware: + s = "Software Revision" + case LLDPMediaTypeSerial: + s = "Serial Number" + case LLDPMediaTypeManufacturer: + s = "Manufacturer" + case LLDPMediaTypeModel: + s = "Model" + case LLDPMediaTypeAssetID: + s = "Asset ID" + default: + s = "Unknown" + } + return +} + +func (t LLDPMediaClass) String() (s string) { + switch t { + case LLDPMediaClassUndefined: + s = "Undefined" + case LLDPMediaClassEndpointI: + s = "Endpoint Class I" + case LLDPMediaClassEndpointII: + s = "Endpoint Class II" + case LLDPMediaClassEndpointIII: + s = "Endpoint Class III" + case LLDPMediaClassNetwork: + s = "Network connectivity " + default: + s = "Unknown" + } + return +} + +func (t LLDPApplicationType) String() (s string) { + switch t { + case LLDPAppTypeReserved: + s = "Reserved" + case LLDPAppTypeVoice: + s = "Voice" + case LLDPappTypeVoiceSignaling: + s = "Voice Signaling" + case LLDPappTypeGuestVoice: + s = "Guest Voice" + case LLDPappTypeGuestVoiceSignaling: + s = "Guest Voice Signaling" + case LLDPappTypeSoftphoneVoice: + s = "Softphone Voice" + case LLDPappTypeVideoConferencing: + s = "Video Conferencing" + case LLDPappTypeStreamingVideo: + s = "Streaming Video" + case LLDPappTypeVideoSignaling: + s = "Video Signaling" + default: + s = "Unknown" + } + return +} + +func (t LLDPLocationFormat) String() (s string) { + switch t { + case LLDPLocationFormatInvalid: + s = "Invalid" + case LLDPLocationFormatCoordinate: + s = "Coordinate-based LCI" + case LLDPLocationFormatAddress: + s = "Address-based LCO" + case LLDPLocationFormatECS: + s = "ECS ELIN" + default: + s = "Unknown" + } + return +} + +func (t LLDPLocationAddressType) String() (s string) { + switch t { + case LLDPLocationAddressTypeLanguage: + s = "Language" + case LLDPLocationAddressTypeNational: + s = "National subdivisions (province, state, etc)" + case LLDPLocationAddressTypeCounty: + s = "County, parish, district" + case LLDPLocationAddressTypeCity: + s = "City, township" + case LLDPLocationAddressTypeCityDivision: + s = "City division, borough, ward" + case LLDPLocationAddressTypeNeighborhood: + s = "Neighborhood, block" + case LLDPLocationAddressTypeStreet: + s = "Street" + case LLDPLocationAddressTypeLeadingStreet: + s = "Leading street direction" + case LLDPLocationAddressTypeTrailingStreet: + s = "Trailing street suffix" + case LLDPLocationAddressTypeStreetSuffix: + s = "Street suffix" + case LLDPLocationAddressTypeHouseNum: + s = "House number" + case LLDPLocationAddressTypeHouseSuffix: + s = "House number suffix" + case LLDPLocationAddressTypeLandmark: + s = "Landmark or vanity address" + case LLDPLocationAddressTypeAdditional: + s = "Additional location information" + case LLDPLocationAddressTypeName: + s = "Name" + case LLDPLocationAddressTypePostal: + s = "Postal/ZIP code" + case LLDPLocationAddressTypeBuilding: + s = "Building" + case LLDPLocationAddressTypeUnit: + s = "Unit" + case LLDPLocationAddressTypeFloor: + s = "Floor" + case LLDPLocationAddressTypeRoom: + s = "Room number" + case LLDPLocationAddressTypePlace: + s = "Place type" + case LLDPLocationAddressTypeScript: + s = "Script" + default: + s = "Unknown" + } + return +} + +func checkLLDPTLVLen(v LinkLayerDiscoveryValue, l int) (err error) { + if len(v.Value) < l { + err = fmt.Errorf("Invalid TLV %v length %d (wanted mimimum %v", v.Type, len(v.Value), l) + } + return +} + +func checkLLDPOrgSpecificLen(o LLDPOrgSpecificTLV, l int) (err error) { + if len(o.Info) < l { + err = fmt.Errorf("Invalid Org Specific TLV %v length %d (wanted minimum %v)", o.SubType, len(o.Info), l) + } + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/loopback.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/loopback.go new file mode 100644 index 00000000..19ec210c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/loopback.go @@ -0,0 +1,74 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" +) + +// Loopback contains the header for loopback encapsulation. This header is +// used by both BSD and OpenBSD style loopback decoding (pcap's DLT_NULL +// and DLT_LOOP, respectively). +type Loopback struct { + BaseLayer + Family ProtocolFamily +} + +// LayerType returns LayerTypeLoopback. +func (l *Loopback) LayerType() gopacket.LayerType { return LayerTypeLoopback } + +func (l *Loopback) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + if len(data) < 4 { + return fmt.Errorf("Loopback packet too small") + } + + var prot uint32 + if data[0] == 0 && data[1] == 0 { + prot = binary.BigEndian.Uint32(data[:4]) + } else { + prot = binary.LittleEndian.Uint32(data[:4]) + } + if prot > 0xFF { + return fmt.Errorf("Invalid loopback protocol %q", data[:4]) + } + + l.Family = ProtocolFamily(prot) + + l.BaseLayer = BaseLayer{data[:4], data[4:]} + + return nil +} +func (l *Loopback) CanDecode() gopacket.LayerClass { + return LayerTypeLoopback +} + +func (l *Loopback) NextLayerType() gopacket.LayerType { + return l.Family.LayerType() +} + +func decodeLoopback(data []byte, p gopacket.PacketBuilder) error { + // The protocol could be either big-endian or little-endian, we're + // not sure. But we're PRETTY sure that the value is less than + // 256, so we can check the first two bytes. + var prot uint32 + if data[0] == 0 && data[1] == 0 { + prot = binary.BigEndian.Uint32(data[:4]) + } else { + prot = binary.LittleEndian.Uint32(data[:4]) + } + if prot > 0xFF { + return fmt.Errorf("Invalid loopback protocol %q", data[:4]) + } + l := &Loopback{ + BaseLayer: BaseLayer{data[:4], data[4:]}, + Family: ProtocolFamily(prot), + } + p.AddLayer(l) + return p.NextDecoder(l.Family) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/mpls.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/mpls.go new file mode 100644 index 00000000..6cb51950 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/mpls.go @@ -0,0 +1,87 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "errors" + "github.com/tsg/gopacket" +) + +// MPLS is the MPLS packet header. +type MPLS struct { + BaseLayer + Label uint32 + TrafficClass uint8 + StackBottom bool + TTL uint8 +} + +// LayerType returns gopacket.LayerTypeMPLS. +func (m *MPLS) LayerType() gopacket.LayerType { return LayerTypeMPLS } + +// ProtocolGuessingDecoder attempts to guess the protocol of the bytes it's +// given, then decode the packet accordingly. Its algorithm for guessing is: +// If the packet starts with byte 0x45-0x4F: IPv4 +// If the packet starts with byte 0x60-0x6F: IPv6 +// Otherwise: Error +// See draft-hsmit-isis-aal5mux-00.txt for more detail on this approach. +type ProtocolGuessingDecoder struct{} + +func (ProtocolGuessingDecoder) Decode(data []byte, p gopacket.PacketBuilder) error { + switch data[0] { + // 0x40 | header_len, where header_len is at least 5. + case 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f: + return decodeIPv4(data, p) + // IPv6 can start with any byte whose first 4 bits are 0x6. + case 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f: + return decodeIPv6(data, p) + } + return errors.New("Unable to guess protocol of packet data") +} + +// MPLSPayloadDecoder is the decoder used to data encapsulated by each MPLS +// layer. MPLS contains no type information, so we have to explicitly decide +// which decoder to use. This is initially set to ProtocolGuessingDecoder, our +// simple attempt at guessing protocols based on the first few bytes of data +// available to us. However, if you know that in your environment MPLS always +// encapsulates a specific protocol, you may reset this. +var MPLSPayloadDecoder gopacket.Decoder = ProtocolGuessingDecoder{} + +func decodeMPLS(data []byte, p gopacket.PacketBuilder) error { + decoded := binary.BigEndian.Uint32(data[:4]) + mpls := &MPLS{ + Label: decoded >> 12, + TrafficClass: uint8(decoded>>9) & 0x7, + StackBottom: decoded&0x100 != 0, + TTL: uint8(decoded), + BaseLayer: BaseLayer{data[:4], data[4:]}, + } + p.AddLayer(mpls) + if mpls.StackBottom { + return p.NextDecoder(MPLSPayloadDecoder) + } + return p.NextDecoder(gopacket.DecodeFunc(decodeMPLS)) +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (m *MPLS) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + bytes, err := b.PrependBytes(4) + if err != nil { + return err + } + encoded := m.Label << 12 + encoded |= uint32(m.TrafficClass) << 9 + encoded |= uint32(m.TTL) + if m.StackBottom { + encoded |= 0x100 + } + binary.BigEndian.PutUint32(bytes, encoded) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ndp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ndp.go new file mode 100644 index 00000000..62d896b8 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ndp.go @@ -0,0 +1,611 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// Enum types courtesy of... +// http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-ndp.c + +package layers + +import ( + "fmt" + "github.com/tsg/gopacket" + "net" +) + +type NDPChassisType uint8 + +// Nortel Chassis Types +const ( + NDPChassisother NDPChassisType = 1 + NDPChassis3000 NDPChassisType = 2 + NDPChassis3030 NDPChassisType = 3 + NDPChassis2310 NDPChassisType = 4 + NDPChassis2810 NDPChassisType = 5 + NDPChassis2912 NDPChassisType = 6 + NDPChassis2914 NDPChassisType = 7 + NDPChassis271x NDPChassisType = 8 + NDPChassis2813 NDPChassisType = 9 + NDPChassis2814 NDPChassisType = 10 + NDPChassis2915 NDPChassisType = 11 + NDPChassis5000 NDPChassisType = 12 + NDPChassis2813SA NDPChassisType = 13 + NDPChassis2814SA NDPChassisType = 14 + NDPChassis810M NDPChassisType = 15 + NDPChassisEthercell NDPChassisType = 16 + NDPChassis5005 NDPChassisType = 17 + NDPChassisAlcatelEWC NDPChassisType = 18 + NDPChassis2715SA NDPChassisType = 20 + NDPChassis2486 NDPChassisType = 21 + NDPChassis28000series NDPChassisType = 22 + NDPChassis23000series NDPChassisType = 23 + NDPChassis5DN00xseries NDPChassisType = 24 + NDPChassisBayStackEthernet NDPChassisType = 25 + NDPChassis23100series NDPChassisType = 26 + NDPChassis100BaseTHub NDPChassisType = 27 + NDPChassis3000FastEthernet NDPChassisType = 28 + NDPChassisOrionSwitch NDPChassisType = 29 + NDPChassisDDS NDPChassisType = 31 + NDPChassisCentillion6slot NDPChassisType = 32 + NDPChassisCentillion12slot NDPChassisType = 33 + NDPChassisCentillion1slot NDPChassisType = 34 + NDPChassisBayStack301 NDPChassisType = 35 + NDPChassisBayStackTokenRingHub NDPChassisType = 36 + NDPChassisFVCMultimediaSwitch NDPChassisType = 37 + NDPChassisSwitchNode NDPChassisType = 38 + NDPChassisBayStack302Switch NDPChassisType = 39 + NDPChassisBayStack350Switch NDPChassisType = 40 + NDPChassisBayStack150EthernetHub NDPChassisType = 41 + NDPChassisCentillion50NSwitch NDPChassisType = 42 + NDPChassisCentillion50TSwitch NDPChassisType = 43 + NDPChassisBayStack303304Switches NDPChassisType = 44 + NDPChassisBayStack200EthernetHub NDPChassisType = 45 + NDPChassisBayStack25010100EthernetHub NDPChassisType = 46 + NDPChassisBayStack450101001000Switches NDPChassisType = 48 + NDPChassisBayStack41010100Switches NDPChassisType = 49 + NDPChassisPassport1200L3Switch NDPChassisType = 50 + NDPChassisPassport1250L3Switch NDPChassisType = 51 + NDPChassisPassport1100L3Switch NDPChassisType = 52 + NDPChassisPassport1150L3Switch NDPChassisType = 53 + NDPChassisPassport1050L3Switch NDPChassisType = 54 + NDPChassisPassport1051L3Switch NDPChassisType = 55 + NDPChassisPassport8610L3Switch NDPChassisType = 56 + NDPChassisPassport8606L3Switch NDPChassisType = 57 + NDPChassisPassport8010 NDPChassisType = 58 + NDPChassisPassport8006 NDPChassisType = 59 + NDPChassisBayStack670wirelessaccesspoint NDPChassisType = 60 + NDPChassisPassport740 NDPChassisType = 61 + NDPChassisPassport750 NDPChassisType = 62 + NDPChassisPassport790 NDPChassisType = 63 + NDPChassisBusinessPolicySwitch200010100Switches NDPChassisType = 64 + NDPChassisPassport8110L2Switch NDPChassisType = 65 + NDPChassisPassport8106L2Switch NDPChassisType = 66 + NDPChassisBayStack3580GigSwitch NDPChassisType = 67 + NDPChassisBayStack10PowerSupplyUnit NDPChassisType = 68 + NDPChassisBayStack42010100Switch NDPChassisType = 69 + NDPChassisOPTeraMetro1200EthernetServiceModule NDPChassisType = 70 + NDPChassisOPTera8010co NDPChassisType = 71 + NDPChassisOPTera8610coL3Switch NDPChassisType = 72 + NDPChassisOPTera8110coL2Switch NDPChassisType = 73 + NDPChassisOPTera8003 NDPChassisType = 74 + NDPChassisOPTera8603L3Switch NDPChassisType = 75 + NDPChassisOPTera8103L2Switch NDPChassisType = 76 + NDPChassisBayStack380101001000Switch NDPChassisType = 77 + NDPChassisEthernetSwitch47048T NDPChassisType = 78 + NDPChassisOPTeraMetro1450EthernetServiceModule NDPChassisType = 79 + NDPChassisOPTeraMetro1400EthernetServiceModule NDPChassisType = 80 + NDPChassisAlteonSwitchFamily NDPChassisType = 81 + NDPChassisEthernetSwitch46024TPWR NDPChassisType = 82 + NDPChassisOPTeraMetro8010OPML2Switch NDPChassisType = 83 + NDPChassisOPTeraMetro8010coOPML2Switch NDPChassisType = 84 + NDPChassisOPTeraMetro8006OPML2Switch NDPChassisType = 85 + NDPChassisOPTeraMetro8003OPML2Switch NDPChassisType = 86 + NDPChassisAlteon180e NDPChassisType = 87 + NDPChassisAlteonAD3 NDPChassisType = 88 + NDPChassisAlteon184 NDPChassisType = 89 + NDPChassisAlteonAD4 NDPChassisType = 90 + NDPChassisPassport1424L3Switch NDPChassisType = 91 + NDPChassisPassport1648L3Switch NDPChassisType = 92 + NDPChassisPassport1612L3Switch NDPChassisType = 93 + NDPChassisPassport1624L3Switch NDPChassisType = 94 + NDPChassisBayStack38024FFiber1000Switch NDPChassisType = 95 + NDPChassisEthernetRoutingSwitch551024T NDPChassisType = 96 + NDPChassisEthernetRoutingSwitch551048T NDPChassisType = 97 + NDPChassisEthernetSwitch47024T NDPChassisType = 98 + NDPChassisNortelNetworksWirelessLANAccessPoint2220 NDPChassisType = 99 + NDPChassisPassportRBS2402L3Switch NDPChassisType = 100 + NDPChassisAlteonApplicationSwitch2424 NDPChassisType = 101 + NDPChassisAlteonApplicationSwitch2224 NDPChassisType = 102 + NDPChassisAlteonApplicationSwitch2208 NDPChassisType = 103 + NDPChassisAlteonApplicationSwitch2216 NDPChassisType = 104 + NDPChassisAlteonApplicationSwitch3408 NDPChassisType = 105 + NDPChassisAlteonApplicationSwitch3416 NDPChassisType = 106 + NDPChassisNortelNetworksWirelessLANSecuritySwitch2250 NDPChassisType = 107 + NDPChassisEthernetSwitch42548T NDPChassisType = 108 + NDPChassisEthernetSwitch42524T NDPChassisType = 109 + NDPChassisNortelNetworksWirelessLANAccessPoint2221 NDPChassisType = 110 + NDPChassisNortelMetroEthernetServiceUnit24TSPFswitch NDPChassisType = 111 + NDPChassisNortelMetroEthernetServiceUnit24TLXDCswitch NDPChassisType = 112 + NDPChassisPassport830010slotchassis NDPChassisType = 113 + NDPChassisPassport83006slotchassis NDPChassisType = 114 + NDPChassisEthernetRoutingSwitch552024TPWR NDPChassisType = 115 + NDPChassisEthernetRoutingSwitch552048TPWR NDPChassisType = 116 + NDPChassisNortelNetworksVPNGateway3050 NDPChassisType = 117 + NDPChassisAlteonSSL31010100 NDPChassisType = 118 + NDPChassisAlteonSSL31010100Fiber NDPChassisType = 119 + NDPChassisAlteonSSL31010100FIPS NDPChassisType = 120 + NDPChassisAlteonSSL410101001000 NDPChassisType = 121 + NDPChassisAlteonSSL410101001000Fiber NDPChassisType = 122 + NDPChassisAlteonApplicationSwitch2424SSL NDPChassisType = 123 + NDPChassisEthernetSwitch32524T NDPChassisType = 124 + NDPChassisEthernetSwitch32524G NDPChassisType = 125 + NDPChassisNortelNetworksWirelessLANAccessPoint2225 NDPChassisType = 126 + NDPChassisNortelNetworksWirelessLANSecuritySwitch2270 NDPChassisType = 127 + NDPChassis24portEthernetSwitch47024TPWR NDPChassisType = 128 + NDPChassis48portEthernetSwitch47048TPWR NDPChassisType = 129 + NDPChassisEthernetRoutingSwitch553024TFD NDPChassisType = 130 + NDPChassisEthernetSwitch351024T NDPChassisType = 131 + NDPChassisNortelMetroEthernetServiceUnit12GACL3Switch NDPChassisType = 132 + NDPChassisNortelMetroEthernetServiceUnit12GDCL3Switch NDPChassisType = 133 + NDPChassisNortelSecureAccessSwitch NDPChassisType = 134 + NDPChassisNortelNetworksVPNGateway3070 NDPChassisType = 135 + NDPChassisOPTeraMetro3500 NDPChassisType = 136 + NDPChassisSMBBES101024T NDPChassisType = 137 + NDPChassisSMBBES101048T NDPChassisType = 138 + NDPChassisSMBBES102024TPWR NDPChassisType = 139 + NDPChassisSMBBES102048TPWR NDPChassisType = 140 + NDPChassisSMBBES201024T NDPChassisType = 141 + NDPChassisSMBBES201048T NDPChassisType = 142 + NDPChassisSMBBES202024TPWR NDPChassisType = 143 + NDPChassisSMBBES202048TPWR NDPChassisType = 144 + NDPChassisSMBBES11024T NDPChassisType = 145 + NDPChassisSMBBES11048T NDPChassisType = 146 + NDPChassisSMBBES12024TPWR NDPChassisType = 147 + NDPChassisSMBBES12048TPWR NDPChassisType = 148 + NDPChassisSMBBES21024T NDPChassisType = 149 + NDPChassisSMBBES21048T NDPChassisType = 150 + NDPChassisSMBBES22024TPWR NDPChassisType = 151 + NDPChassisSMBBES22048TPWR NDPChassisType = 152 + NDPChassisOME6500 NDPChassisType = 153 + NDPChassisEthernetRoutingSwitch4548GT NDPChassisType = 154 + NDPChassisEthernetRoutingSwitch4548GTPWR NDPChassisType = 155 + NDPChassisEthernetRoutingSwitch4550T NDPChassisType = 156 + NDPChassisEthernetRoutingSwitch4550TPWR NDPChassisType = 157 + NDPChassisEthernetRoutingSwitch4526FX NDPChassisType = 158 + NDPChassisEthernetRoutingSwitch250026T NDPChassisType = 159 + NDPChassisEthernetRoutingSwitch250026TPWR NDPChassisType = 160 + NDPChassisEthernetRoutingSwitch250050T NDPChassisType = 161 + NDPChassisEthernetRoutingSwitch250050TPWR NDPChassisType = 162 +) + +type NDPBackplaneType uint8 + +// Nortel Backplane Types +const ( + NDPBackplaneOther NDPBackplaneType = 1 + NDPBackplaneEthernet NDPBackplaneType = 2 + NDPBackplaneEthernetTokenring NDPBackplaneType = 3 + NDPBackplaneEthernetFDDI NDPBackplaneType = 4 + NDPBackplaneEthernetTokenringFDDI NDPBackplaneType = 5 + NDPBackplaneEthernetTokenringRedundantPower NDPBackplaneType = 6 + NDPBackplaneEthernetTokenringFDDIRedundantPower NDPBackplaneType = 7 + NDPBackplaneTokenRing NDPBackplaneType = 8 + NDPBackplaneEthernetTokenringFastEthernet NDPBackplaneType = 9 + NDPBackplaneEthernetFastEthernet NDPBackplaneType = 10 + NDPBackplaneEthernetTokenringFastEthernetRedundantPower NDPBackplaneType = 11 + NDPBackplaneEthernetFastEthernetGigabitEthernet NDPBackplaneType = 12 +) + +type NDPState uint8 + +// Device State +const ( + NDPStateTopology NDPState = 1 + NDPStateHeartbeat NDPState = 2 + NDPStateNew NDPState = 3 +) + +// NortelDiscovery is a packet layer containing the Nortel Discovery Protocol. +type NortelDiscovery struct { + BaseLayer + IPAddress net.IP + SegmentID []byte + Chassis NDPChassisType + Backplane NDPBackplaneType + State NDPState + NumLinks uint8 +} + +// LayerType returns gopacket.LayerTypeNortelDiscovery. +func (c *NortelDiscovery) LayerType() gopacket.LayerType { + return LayerTypeNortelDiscovery +} + +func decodeNortelDiscovery(data []byte, p gopacket.PacketBuilder) error { + c := &NortelDiscovery{} + if len(data) < 11 { + return fmt.Errorf("Invalid NortelDiscovery packet length %d", len(data)) + } + c.IPAddress = data[0:4] + c.SegmentID = data[4:7] + c.Chassis = NDPChassisType(data[7]) + c.Backplane = NDPBackplaneType(data[8]) + c.State = NDPState(data[9]) + c.NumLinks = uint8(data[10]) + p.AddLayer(c) + return nil +} + +func (t NDPChassisType) String() (s string) { + switch t { + case NDPChassisother: + s = "other" + case NDPChassis3000: + s = "3000" + case NDPChassis3030: + s = "3030" + case NDPChassis2310: + s = "2310" + case NDPChassis2810: + s = "2810" + case NDPChassis2912: + s = "2912" + case NDPChassis2914: + s = "2914" + case NDPChassis271x: + s = "271x" + case NDPChassis2813: + s = "2813" + case NDPChassis2814: + s = "2814" + case NDPChassis2915: + s = "2915" + case NDPChassis5000: + s = "5000" + case NDPChassis2813SA: + s = "2813SA" + case NDPChassis2814SA: + s = "2814SA" + case NDPChassis810M: + s = "810M" + case NDPChassisEthercell: + s = "Ethercell" + case NDPChassis5005: + s = "5005" + case NDPChassisAlcatelEWC: + s = "Alcatel Ethernet workgroup conc." + case NDPChassis2715SA: + s = "2715SA" + case NDPChassis2486: + s = "2486" + case NDPChassis28000series: + s = "28000 series" + case NDPChassis23000series: + s = "23000 series" + case NDPChassis5DN00xseries: + s = "5DN00x series" + case NDPChassisBayStackEthernet: + s = "BayStack Ethernet" + case NDPChassis23100series: + s = "23100 series" + case NDPChassis100BaseTHub: + s = "100Base-T Hub" + case NDPChassis3000FastEthernet: + s = "3000 Fast Ethernet" + case NDPChassisOrionSwitch: + s = "Orion switch" + case NDPChassisDDS: + s = "DDS" + case NDPChassisCentillion6slot: + s = "Centillion (6 slot)" + case NDPChassisCentillion12slot: + s = "Centillion (12 slot)" + case NDPChassisCentillion1slot: + s = "Centillion (1 slot)" + case NDPChassisBayStack301: + s = "BayStack 301" + case NDPChassisBayStackTokenRingHub: + s = "BayStack TokenRing Hub" + case NDPChassisFVCMultimediaSwitch: + s = "FVC Multimedia Switch" + case NDPChassisSwitchNode: + s = "Switch Node" + case NDPChassisBayStack302Switch: + s = "BayStack 302 Switch" + case NDPChassisBayStack350Switch: + s = "BayStack 350 Switch" + case NDPChassisBayStack150EthernetHub: + s = "BayStack 150 Ethernet Hub" + case NDPChassisCentillion50NSwitch: + s = "Centillion 50N switch" + case NDPChassisCentillion50TSwitch: + s = "Centillion 50T switch" + case NDPChassisBayStack303304Switches: + s = "BayStack 303 and 304 Switches" + case NDPChassisBayStack200EthernetHub: + s = "BayStack 200 Ethernet Hub" + case NDPChassisBayStack25010100EthernetHub: + s = "BayStack 250 10/100 Ethernet Hub" + case NDPChassisBayStack450101001000Switches: + s = "BayStack 450 10/100/1000 Switches" + case NDPChassisBayStack41010100Switches: + s = "BayStack 410 10/100 Switches" + case NDPChassisPassport1200L3Switch: + s = "Passport 1200 L3 Switch" + case NDPChassisPassport1250L3Switch: + s = "Passport 1250 L3 Switch" + case NDPChassisPassport1100L3Switch: + s = "Passport 1100 L3 Switch" + case NDPChassisPassport1150L3Switch: + s = "Passport 1150 L3 Switch" + case NDPChassisPassport1050L3Switch: + s = "Passport 1050 L3 Switch" + case NDPChassisPassport1051L3Switch: + s = "Passport 1051 L3 Switch" + case NDPChassisPassport8610L3Switch: + s = "Passport 8610 L3 Switch" + case NDPChassisPassport8606L3Switch: + s = "Passport 8606 L3 Switch" + case NDPChassisPassport8010: + s = "Passport 8010" + case NDPChassisPassport8006: + s = "Passport 8006" + case NDPChassisBayStack670wirelessaccesspoint: + s = "BayStack 670 wireless access point" + case NDPChassisPassport740: + s = "Passport 740" + case NDPChassisPassport750: + s = "Passport 750" + case NDPChassisPassport790: + s = "Passport 790" + case NDPChassisBusinessPolicySwitch200010100Switches: + s = "Business Policy Switch 2000 10/100 Switches" + case NDPChassisPassport8110L2Switch: + s = "Passport 8110 L2 Switch" + case NDPChassisPassport8106L2Switch: + s = "Passport 8106 L2 Switch" + case NDPChassisBayStack3580GigSwitch: + s = "BayStack 3580 Gig Switch" + case NDPChassisBayStack10PowerSupplyUnit: + s = "BayStack 10 Power Supply Unit" + case NDPChassisBayStack42010100Switch: + s = "BayStack 420 10/100 Switch" + case NDPChassisOPTeraMetro1200EthernetServiceModule: + s = "OPTera Metro 1200 Ethernet Service Module" + case NDPChassisOPTera8010co: + s = "OPTera 8010co" + case NDPChassisOPTera8610coL3Switch: + s = "OPTera 8610co L3 switch" + case NDPChassisOPTera8110coL2Switch: + s = "OPTera 8110co L2 switch" + case NDPChassisOPTera8003: + s = "OPTera 8003" + case NDPChassisOPTera8603L3Switch: + s = "OPTera 8603 L3 switch" + case NDPChassisOPTera8103L2Switch: + s = "OPTera 8103 L2 switch" + case NDPChassisBayStack380101001000Switch: + s = "BayStack 380 10/100/1000 Switch" + case NDPChassisEthernetSwitch47048T: + s = "Ethernet Switch 470-48T" + case NDPChassisOPTeraMetro1450EthernetServiceModule: + s = "OPTera Metro 1450 Ethernet Service Module" + case NDPChassisOPTeraMetro1400EthernetServiceModule: + s = "OPTera Metro 1400 Ethernet Service Module" + case NDPChassisAlteonSwitchFamily: + s = "Alteon Switch Family" + case NDPChassisEthernetSwitch46024TPWR: + s = "Ethernet Switch 460-24T-PWR" + case NDPChassisOPTeraMetro8010OPML2Switch: + s = "OPTera Metro 8010 OPM L2 Switch" + case NDPChassisOPTeraMetro8010coOPML2Switch: + s = "OPTera Metro 8010co OPM L2 Switch" + case NDPChassisOPTeraMetro8006OPML2Switch: + s = "OPTera Metro 8006 OPM L2 Switch" + case NDPChassisOPTeraMetro8003OPML2Switch: + s = "OPTera Metro 8003 OPM L2 Switch" + case NDPChassisAlteon180e: + s = "Alteon 180e" + case NDPChassisAlteonAD3: + s = "Alteon AD3" + case NDPChassisAlteon184: + s = "Alteon 184" + case NDPChassisAlteonAD4: + s = "Alteon AD4" + case NDPChassisPassport1424L3Switch: + s = "Passport 1424 L3 switch" + case NDPChassisPassport1648L3Switch: + s = "Passport 1648 L3 switch" + case NDPChassisPassport1612L3Switch: + s = "Passport 1612 L3 switch" + case NDPChassisPassport1624L3Switch: + s = "Passport 1624 L3 switch" + case NDPChassisBayStack38024FFiber1000Switch: + s = "BayStack 380-24F Fiber 1000 Switch" + case NDPChassisEthernetRoutingSwitch551024T: + s = "Ethernet Routing Switch 5510-24T" + case NDPChassisEthernetRoutingSwitch551048T: + s = "Ethernet Routing Switch 5510-48T" + case NDPChassisEthernetSwitch47024T: + s = "Ethernet Switch 470-24T" + case NDPChassisNortelNetworksWirelessLANAccessPoint2220: + s = "Nortel Networks Wireless LAN Access Point 2220" + case NDPChassisPassportRBS2402L3Switch: + s = "Passport RBS 2402 L3 switch" + case NDPChassisAlteonApplicationSwitch2424: + s = "Alteon Application Switch 2424" + case NDPChassisAlteonApplicationSwitch2224: + s = "Alteon Application Switch 2224" + case NDPChassisAlteonApplicationSwitch2208: + s = "Alteon Application Switch 2208" + case NDPChassisAlteonApplicationSwitch2216: + s = "Alteon Application Switch 2216" + case NDPChassisAlteonApplicationSwitch3408: + s = "Alteon Application Switch 3408" + case NDPChassisAlteonApplicationSwitch3416: + s = "Alteon Application Switch 3416" + case NDPChassisNortelNetworksWirelessLANSecuritySwitch2250: + s = "Nortel Networks Wireless LAN SecuritySwitch 2250" + case NDPChassisEthernetSwitch42548T: + s = "Ethernet Switch 425-48T" + case NDPChassisEthernetSwitch42524T: + s = "Ethernet Switch 425-24T" + case NDPChassisNortelNetworksWirelessLANAccessPoint2221: + s = "Nortel Networks Wireless LAN Access Point 2221" + case NDPChassisNortelMetroEthernetServiceUnit24TSPFswitch: + s = "Nortel Metro Ethernet Service Unit 24-T SPF switch" + case NDPChassisNortelMetroEthernetServiceUnit24TLXDCswitch: + s = " Nortel Metro Ethernet Service Unit 24-T LX DC switch" + case NDPChassisPassport830010slotchassis: + s = "Passport 8300 10-slot chassis" + case NDPChassisPassport83006slotchassis: + s = "Passport 8300 6-slot chassis" + case NDPChassisEthernetRoutingSwitch552024TPWR: + s = "Ethernet Routing Switch 5520-24T-PWR" + case NDPChassisEthernetRoutingSwitch552048TPWR: + s = "Ethernet Routing Switch 5520-48T-PWR" + case NDPChassisNortelNetworksVPNGateway3050: + s = "Nortel Networks VPN Gateway 3050" + case NDPChassisAlteonSSL31010100: + s = "Alteon SSL 310 10/100" + case NDPChassisAlteonSSL31010100Fiber: + s = "Alteon SSL 310 10/100 Fiber" + case NDPChassisAlteonSSL31010100FIPS: + s = "Alteon SSL 310 10/100 FIPS" + case NDPChassisAlteonSSL410101001000: + s = "Alteon SSL 410 10/100/1000" + case NDPChassisAlteonSSL410101001000Fiber: + s = "Alteon SSL 410 10/100/1000 Fiber" + case NDPChassisAlteonApplicationSwitch2424SSL: + s = "Alteon Application Switch 2424-SSL" + case NDPChassisEthernetSwitch32524T: + s = "Ethernet Switch 325-24T" + case NDPChassisEthernetSwitch32524G: + s = "Ethernet Switch 325-24G" + case NDPChassisNortelNetworksWirelessLANAccessPoint2225: + s = "Nortel Networks Wireless LAN Access Point 2225" + case NDPChassisNortelNetworksWirelessLANSecuritySwitch2270: + s = "Nortel Networks Wireless LAN SecuritySwitch 2270" + case NDPChassis24portEthernetSwitch47024TPWR: + s = "24-port Ethernet Switch 470-24T-PWR" + case NDPChassis48portEthernetSwitch47048TPWR: + s = "48-port Ethernet Switch 470-48T-PWR" + case NDPChassisEthernetRoutingSwitch553024TFD: + s = "Ethernet Routing Switch 5530-24TFD" + case NDPChassisEthernetSwitch351024T: + s = "Ethernet Switch 3510-24T" + case NDPChassisNortelMetroEthernetServiceUnit12GACL3Switch: + s = "Nortel Metro Ethernet Service Unit 12G AC L3 switch" + case NDPChassisNortelMetroEthernetServiceUnit12GDCL3Switch: + s = "Nortel Metro Ethernet Service Unit 12G DC L3 switch" + case NDPChassisNortelSecureAccessSwitch: + s = "Nortel Secure Access Switch" + case NDPChassisNortelNetworksVPNGateway3070: + s = "Nortel Networks VPN Gateway 3070" + case NDPChassisOPTeraMetro3500: + s = "OPTera Metro 3500" + case NDPChassisSMBBES101024T: + s = "SMB BES 1010 24T" + case NDPChassisSMBBES101048T: + s = "SMB BES 1010 48T" + case NDPChassisSMBBES102024TPWR: + s = "SMB BES 1020 24T PWR" + case NDPChassisSMBBES102048TPWR: + s = "SMB BES 1020 48T PWR" + case NDPChassisSMBBES201024T: + s = "SMB BES 2010 24T" + case NDPChassisSMBBES201048T: + s = "SMB BES 2010 48T" + case NDPChassisSMBBES202024TPWR: + s = "SMB BES 2020 24T PWR" + case NDPChassisSMBBES202048TPWR: + s = "SMB BES 2020 48T PWR" + case NDPChassisSMBBES11024T: + s = "SMB BES 110 24T" + case NDPChassisSMBBES11048T: + s = "SMB BES 110 48T" + case NDPChassisSMBBES12024TPWR: + s = "SMB BES 120 24T PWR" + case NDPChassisSMBBES12048TPWR: + s = "SMB BES 120 48T PWR" + case NDPChassisSMBBES21024T: + s = "SMB BES 210 24T" + case NDPChassisSMBBES21048T: + s = "SMB BES 210 48T" + case NDPChassisSMBBES22024TPWR: + s = "SMB BES 220 24T PWR" + case NDPChassisSMBBES22048TPWR: + s = "SMB BES 220 48T PWR" + case NDPChassisOME6500: + s = "OME 6500" + case NDPChassisEthernetRoutingSwitch4548GT: + s = "Ethernet Routing Switch 4548GT" + case NDPChassisEthernetRoutingSwitch4548GTPWR: + s = "Ethernet Routing Switch 4548GT-PWR" + case NDPChassisEthernetRoutingSwitch4550T: + s = "Ethernet Routing Switch 4550T" + case NDPChassisEthernetRoutingSwitch4550TPWR: + s = "Ethernet Routing Switch 4550T-PWR" + case NDPChassisEthernetRoutingSwitch4526FX: + s = "Ethernet Routing Switch 4526FX" + case NDPChassisEthernetRoutingSwitch250026T: + s = "Ethernet Routing Switch 2500-26T" + case NDPChassisEthernetRoutingSwitch250026TPWR: + s = "Ethernet Routing Switch 2500-26T-PWR" + case NDPChassisEthernetRoutingSwitch250050T: + s = "Ethernet Routing Switch 2500-50T" + case NDPChassisEthernetRoutingSwitch250050TPWR: + s = "Ethernet Routing Switch 2500-50T-PWR" + default: + s = "Unknown" + } + return +} + +func (t NDPBackplaneType) String() (s string) { + switch t { + case NDPBackplaneOther: + s = "Other" + case NDPBackplaneEthernet: + s = "Ethernet" + case NDPBackplaneEthernetTokenring: + s = "Ethernet and Tokenring" + case NDPBackplaneEthernetFDDI: + s = "Ethernet and FDDI" + case NDPBackplaneEthernetTokenringFDDI: + s = "Ethernet, Tokenring and FDDI" + case NDPBackplaneEthernetTokenringRedundantPower: + s = "Ethernet and Tokenring with redundant power" + case NDPBackplaneEthernetTokenringFDDIRedundantPower: + s = "Ethernet, Tokenring, FDDI with redundant power" + case NDPBackplaneTokenRing: + s = "Token Ring" + case NDPBackplaneEthernetTokenringFastEthernet: + s = "Ethernet, Tokenring and Fast Ethernet" + case NDPBackplaneEthernetFastEthernet: + s = "Ethernet and Fast Ethernet" + case NDPBackplaneEthernetTokenringFastEthernetRedundantPower: + s = "Ethernet, Tokenring, Fast Ethernet with redundant power" + case NDPBackplaneEthernetFastEthernetGigabitEthernet: + s = "Ethernet, Fast Ethernet and Gigabit Ethernet" + default: + s = "Unknown" + } + return +} + +func (t NDPState) String() (s string) { + switch t { + case NDPStateTopology: + s = "Topology Change" + case NDPStateHeartbeat: + s = "Heartbeat" + case NDPStateNew: + s = "New" + default: + s = "Unknown" + } + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/pflog.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/pflog.go new file mode 100644 index 00000000..7815b9c5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/pflog.go @@ -0,0 +1,71 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + + "github.com/tsg/gopacket" +) + +type PFDirection uint8 + +const ( + PFDirectionInOut PFDirection = 0 + PFDirectionIn PFDirection = 1 + PFDirectionOut PFDirection = 2 +) + +// PFLog provides the layer for 'pf' packet-filter logging, as described at +// http://www.freebsd.org/cgi/man.cgi?query=pflog&sektion=4 +type PFLog struct { + BaseLayer + Length uint8 + Family ProtocolFamily + Action, Reason uint8 + IFName, Ruleset []byte + RuleNum, SubruleNum uint32 + UID uint32 + PID int32 + RuleUID uint32 + RulePID int32 + Direction PFDirection + // The remainder is padding +} + +func (pf *PFLog) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + pf.Length = data[0] + pf.Family = ProtocolFamily(data[1]) + pf.Action = data[2] + pf.Reason = data[3] + pf.IFName = data[4:20] + pf.Ruleset = data[20:36] + pf.RuleNum = binary.BigEndian.Uint32(data[36:40]) + pf.SubruleNum = binary.BigEndian.Uint32(data[40:44]) + pf.UID = binary.BigEndian.Uint32(data[44:48]) + pf.PID = int32(binary.BigEndian.Uint32(data[48:52])) + pf.RuleUID = binary.BigEndian.Uint32(data[52:56]) + pf.RulePID = int32(binary.BigEndian.Uint32(data[56:60])) + pf.Direction = PFDirection(data[60]) + pf.Contents = data[:pf.Length] + pf.Payload = data[pf.Length:] + return nil +} + +// LayerType returns layers.LayerTypePFLog +func (pf *PFLog) LayerType() gopacket.LayerType { return LayerTypePFLog } + +func (pf *PFLog) CanDecode() gopacket.LayerClass { return LayerTypePFLog } + +func (pf *PFLog) NextLayerType() gopacket.LayerType { + return pf.Family.LayerType() +} + +func decodePFLog(data []byte, p gopacket.PacketBuilder) error { + pf := &PFLog{} + return decodingLayerDecoder(pf, data, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ports.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ports.go new file mode 100644 index 00000000..3465457e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ports.go @@ -0,0 +1,100 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "fmt" + "strconv" + + "github.com/tsg/gopacket" +) + +// TCPPort is a port in a TCP layer. +type TCPPort uint16 + +// UDPPort is a port in a UDP layer. +type UDPPort uint16 + +// RUDPPort is a port in a RUDP layer. +type RUDPPort uint8 + +// SCTPPort is a port in a SCTP layer. +type SCTPPort uint16 + +// UDPLitePort is a port in a UDPLite layer. +type UDPLitePort uint16 + +// RUDPPortNames contains the string names for all RUDP ports. +var RUDPPortNames = map[RUDPPort]string{} + +// UDPLitePortNames contains the string names for all UDPLite ports. +var UDPLitePortNames = map[UDPLitePort]string{} + +// {TCP,UDP,SCTP}PortNames can be found in iana_ports.go + +// String returns the port as "number(name)" if there's a well-known port name, +// or just "number" if there isn't. Well-known names are stored in +// TCPPortNames. +func (a TCPPort) String() string { + if name, ok := TCPPortNames[a]; ok { + return fmt.Sprintf("%d(%s)", a, name) + } + return strconv.Itoa(int(a)) +} + +// String returns the port as "number(name)" if there's a well-known port name, +// or just "number" if there isn't. Well-known names are stored in +// UDPPortNames. +func (a UDPPort) String() string { + if name, ok := UDPPortNames[a]; ok { + return fmt.Sprintf("%d(%s)", a, name) + } + return strconv.Itoa(int(a)) +} + +// LayerType returns a LayerType that would be able to decode the +// application payload. It use some well-known port such as 53 for DNS. +// +// Returns gopacket.LayerTypePayload for unknown/unsupported port numbers. +func (a UDPPort) LayerType() gopacket.LayerType { + switch a { + case 53: + return LayerTypeDNS + default: + return gopacket.LayerTypePayload + } +} + +// String returns the port as "number(name)" if there's a well-known port name, +// or just "number" if there isn't. Well-known names are stored in +// RUDPPortNames. +func (a RUDPPort) String() string { + if name, ok := RUDPPortNames[a]; ok { + return fmt.Sprintf("%d(%s)", a, name) + } + return strconv.Itoa(int(a)) +} + +// String returns the port as "number(name)" if there's a well-known port name, +// or just "number" if there isn't. Well-known names are stored in +// SCTPPortNames. +func (a SCTPPort) String() string { + if name, ok := SCTPPortNames[a]; ok { + return fmt.Sprintf("%d(%s)", a, name) + } + return strconv.Itoa(int(a)) +} + +// String returns the port as "number(name)" if there's a well-known port name, +// or just "number" if there isn't. Well-known names are stored in +// UDPLitePortNames. +func (a UDPLitePort) String() string { + if name, ok := UDPLitePortNames[a]; ok { + return fmt.Sprintf("%d(%s)", a, name) + } + return strconv.Itoa(int(a)) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ppp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ppp.go new file mode 100644 index 00000000..842bb1a2 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/ppp.go @@ -0,0 +1,74 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "errors" + "github.com/tsg/gopacket" +) + +// PPP is the layer for PPP encapsulation headers. +type PPP struct { + BaseLayer + PPPType PPPType +} + +// PPPEndpoint is a singleton endpoint for PPP. Since there is no actual +// addressing for the two ends of a PPP connection, we use a singleton value +// named 'point' for each endpoint. +var PPPEndpoint = gopacket.NewEndpoint(EndpointPPP, nil) + +// PPPFlow is a singleton flow for PPP. Since there is no actual addressing for +// the two ends of a PPP connection, we use a singleton value to represent the +// flow for all PPP connections. +var PPPFlow = gopacket.NewFlow(EndpointPPP, nil, nil) + +// LayerType returns LayerTypePPP +func (p *PPP) LayerType() gopacket.LayerType { return LayerTypePPP } + +// LinkFlow returns PPPFlow. +func (p *PPP) LinkFlow() gopacket.Flow { return PPPFlow } + +func decodePPP(data []byte, p gopacket.PacketBuilder) error { + ppp := &PPP{} + if data[0]&0x1 == 0 { + if data[1]&0x1 == 0 { + return errors.New("PPP has invalid type") + } + ppp.PPPType = PPPType(binary.BigEndian.Uint16(data[:2])) + ppp.Contents = data[:2] + ppp.Payload = data[2:] + } else { + ppp.PPPType = PPPType(data[0]) + ppp.Contents = data[:1] + ppp.Payload = data[1:] + } + p.AddLayer(ppp) + p.SetLinkLayer(ppp) + return p.NextDecoder(ppp.PPPType) +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (p *PPP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + if p.PPPType&0x100 == 0 { + bytes, err := b.PrependBytes(2) + if err != nil { + return err + } + binary.BigEndian.PutUint16(bytes, uint16(p.PPPType)) + } else { + bytes, err := b.PrependBytes(1) + if err != nil { + return err + } + bytes[0] = uint8(p.PPPType) + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/pppoe.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/pppoe.go new file mode 100644 index 00000000..4bc7efeb --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/pppoe.go @@ -0,0 +1,60 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "github.com/tsg/gopacket" +) + +// PPPoE is the layer for PPPoE encapsulation headers. +type PPPoE struct { + BaseLayer + Version uint8 + Type uint8 + Code PPPoECode + SessionId uint16 + Length uint16 +} + +// LayerType returns gopacket.LayerTypePPPoE. +func (p *PPPoE) LayerType() gopacket.LayerType { + return LayerTypePPPoE +} + +// decodePPPoE decodes the PPPoE header (see http://tools.ietf.org/html/rfc2516). +func decodePPPoE(data []byte, p gopacket.PacketBuilder) error { + pppoe := &PPPoE{ + Version: data[0] >> 4, + Type: data[0] & 0x0F, + Code: PPPoECode(data[1]), + SessionId: binary.BigEndian.Uint16(data[2:4]), + Length: binary.BigEndian.Uint16(data[4:6]), + } + pppoe.BaseLayer = BaseLayer{data[:6], data[6 : 6+pppoe.Length]} + p.AddLayer(pppoe) + return p.NextDecoder(pppoe.Code) +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (p *PPPoE) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + payload := b.Bytes() + bytes, err := b.PrependBytes(6) + if err != nil { + return err + } + bytes[0] = (p.Version << 4) | p.Type + bytes[1] = byte(p.Code) + binary.BigEndian.PutUint16(bytes[2:], p.SessionId) + if opts.FixLengths { + p.Length = uint16(len(payload)) + } + binary.BigEndian.PutUint16(bytes[4:], p.Length) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/radiotap.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/radiotap.go new file mode 100644 index 00000000..44f05dce --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/radiotap.go @@ -0,0 +1,413 @@ +// Copyright 2014 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "bytes" + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" +) + +// align calculates the number of bytes needed to align with the width +// on the offset, returning the number of bytes we need to skip to +// align to the offset (width). +func align(offset uint16, width uint16) uint16 { + return ((((offset) + ((width) - 1)) & (^((width) - 1))) - offset) +} + +type RadioTapPresent uint32 + +const ( + RadioTapPresentTSFT RadioTapPresent = 1 << iota + RadioTapPresentFlags + RadioTapPresentRate + RadioTapPresentChannel + RadioTapPresentFHSS + RadioTapPresentDBMAntennaSignal + RadioTapPresentDBMAntennaNoise + RadioTapPresentLockQuality + RadioTapPresentTxAttenuation + RadioTapPresentDBTxAttenuation + RadioTapPresentDBMTxPower + RadioTapPresentAntenna + RadioTapPresentDBAntennaSignal + RadioTapPresentDBAntennaNoise + RadioTapPresentRxFlags + RadioTapPresentTxFlags + RadioTapPresentRtsRetries + RadioTapPresentDataRetries + RadioTapPresentEXT RadioTapPresent = 1 << 31 +) + +func (r RadioTapPresent) TSFT() bool { + return r&RadioTapPresentTSFT != 0 +} +func (r RadioTapPresent) Flags() bool { + return r&RadioTapPresentFlags != 0 +} +func (r RadioTapPresent) Rate() bool { + return r&RadioTapPresentRate != 0 +} +func (r RadioTapPresent) Channel() bool { + return r&RadioTapPresentChannel != 0 +} +func (r RadioTapPresent) FHSS() bool { + return r&RadioTapPresentFHSS != 0 +} +func (r RadioTapPresent) DBMAntennaSignal() bool { + return r&RadioTapPresentDBMAntennaSignal != 0 +} +func (r RadioTapPresent) DBMAntennaNoise() bool { + return r&RadioTapPresentDBMAntennaNoise != 0 +} +func (r RadioTapPresent) LockQuality() bool { + return r&RadioTapPresentLockQuality != 0 +} +func (r RadioTapPresent) TxAttenuation() bool { + return r&RadioTapPresentTxAttenuation != 0 +} +func (r RadioTapPresent) DBTxAttenuation() bool { + return r&RadioTapPresentDBTxAttenuation != 0 +} +func (r RadioTapPresent) DBMTxPower() bool { + return r&RadioTapPresentDBMTxPower != 0 +} +func (r RadioTapPresent) Antenna() bool { + return r&RadioTapPresentAntenna != 0 +} +func (r RadioTapPresent) DBAntennaSignal() bool { + return r&RadioTapPresentDBAntennaSignal != 0 +} +func (r RadioTapPresent) DBAntennaNoise() bool { + return r&RadioTapPresentDBAntennaNoise != 0 +} +func (r RadioTapPresent) RxFlags() bool { + return r&RadioTapPresentRxFlags != 0 +} +func (r RadioTapPresent) TxFlags() bool { + return r&RadioTapPresentTxFlags != 0 +} +func (r RadioTapPresent) RtsRetries() bool { + return r&RadioTapPresentRtsRetries != 0 +} +func (r RadioTapPresent) DataRetries() bool { + return r&RadioTapPresentDataRetries != 0 +} +func (r RadioTapPresent) EXT() bool { + return r&RadioTapPresentEXT != 0 +} + +type RadioTapChannelFlags uint16 + +const ( + RadioTapChannelFlagsTurbo RadioTapChannelFlags = 0x0010 // Turbo channel + RadioTapChannelFlagsCCK RadioTapChannelFlags = 0x0020 // CCK channel + RadioTapChannelFlagsOFDM RadioTapChannelFlags = 0x0040 // OFDM channel + RadioTapChannelFlagsGhz2 RadioTapChannelFlags = 0x0080 // 2 GHz spectrum channel. + RadioTapChannelFlagsGhz5 RadioTapChannelFlags = 0x0100 // 5 GHz spectrum channel + RadioTapChannelFlagsPassive RadioTapChannelFlags = 0x0200 // Only passive scan allowed + RadioTapChannelFlagsDynamic RadioTapChannelFlags = 0x0400 // Dynamic CCK-OFDM channel + RadioTapChannelFlagsGFSK RadioTapChannelFlags = 0x0800 // GFSK channel (FHSS PHY) +) + +func (r RadioTapChannelFlags) Turbo() bool { + return r&RadioTapChannelFlagsTurbo != 0 +} +func (r RadioTapChannelFlags) CCK() bool { + return r&RadioTapChannelFlagsCCK != 0 +} +func (r RadioTapChannelFlags) OFDM() bool { + return r&RadioTapChannelFlagsOFDM != 0 +} +func (r RadioTapChannelFlags) Ghz2() bool { + return r&RadioTapChannelFlagsGhz2 != 0 +} +func (r RadioTapChannelFlags) Ghz5() bool { + return r&RadioTapChannelFlagsGhz5 != 0 +} +func (r RadioTapChannelFlags) Passive() bool { + return r&RadioTapChannelFlagsPassive != 0 +} +func (r RadioTapChannelFlags) Dynamic() bool { + return r&RadioTapChannelFlagsDynamic != 0 +} +func (r RadioTapChannelFlags) GFSK() bool { + return r&RadioTapChannelFlagsGFSK != 0 +} + +// String provides a human readable string for RadioTapChannelFlags. +// This string is possibly subject to change over time; if you're storing this +// persistently, you should probably store the RadioTapChannelFlags value, not its string. +func (a RadioTapChannelFlags) String() string { + var out bytes.Buffer + if a.Turbo() { + out.WriteString("Turbo,") + } + if a.CCK() { + out.WriteString("CCK,") + } + if a.OFDM() { + out.WriteString("OFDM,") + } + if a.Ghz2() { + out.WriteString("Ghz2,") + } + if a.Ghz5() { + out.WriteString("Ghz5,") + } + if a.Passive() { + out.WriteString("Passive,") + } + if a.Dynamic() { + out.WriteString("Dynamic,") + } + if a.GFSK() { + out.WriteString("GFSK,") + } + + if length := out.Len(); length > 0 { + return string(out.Bytes()[:length-1]) // strip final comma + } + return "" +} + +type RadioTapFlags uint8 + +const ( + RadioTapFlagsCFP RadioTapFlags = 1 << iota // sent/received during CFP + RadioTapFlagsShortPreamble // sent/received * with short * preamble + RadioTapFlagsWEP // sent/received * with WEP encryption + RadioTapFlagsFrag // sent/received * with fragmentation + RadioTapFlagsFCS // frame includes FCS + RadioTapFlagsDatapad // frame has padding between * 802.11 header and payload * (to 32-bit boundary) + RadioTapFlagsBadFCS // does not pass FCS check + RadioTapFlagsShortGI // HT short GI +) + +func (r RadioTapFlags) CFP() bool { + return r&RadioTapFlagsCFP != 0 +} +func (r RadioTapFlags) ShortPreamble() bool { + return r&RadioTapFlagsShortPreamble != 0 +} +func (r RadioTapFlags) WEP() bool { + return r&RadioTapFlagsWEP != 0 +} +func (r RadioTapFlags) Frag() bool { + return r&RadioTapFlagsFrag != 0 +} +func (r RadioTapFlags) FCS() bool { + return r&RadioTapFlagsFCS != 0 +} +func (r RadioTapFlags) Datapad() bool { + return r&RadioTapFlagsDatapad != 0 +} +func (r RadioTapFlags) BadFCS() bool { + return r&RadioTapFlagsBadFCS != 0 +} +func (r RadioTapFlags) ShortGI() bool { + return r&RadioTapFlagsShortGI != 0 +} + +// String provides a human readable string for RadioTapFlags. +// This string is possibly subject to change over time; if you're storing this +// persistently, you should probably store the RadioTapFlags value, not its string. +func (a RadioTapFlags) String() string { + var out bytes.Buffer + if a.CFP() { + out.WriteString("CFP,") + } + if a.ShortPreamble() { + out.WriteString("SHORT-PREAMBLE,") + } + if a.WEP() { + out.WriteString("WEP,") + } + if a.Frag() { + out.WriteString("FRAG,") + } + if a.FCS() { + out.WriteString("FCS,") + } + if a.Datapad() { + out.WriteString("DATAPAD,") + } + if a.ShortGI() { + out.WriteString("SHORT-GI,") + } + + if length := out.Len(); length > 0 { + return string(out.Bytes()[:length-1]) // strip final comma + } + return "" +} + +type RadioTapRate uint8 + +func (a RadioTapRate) String() string { + return fmt.Sprintf("%v Mb/s", 0.5*float32(a)) +} + +type RadioTapChannelFrequency uint16 + +func (a RadioTapChannelFrequency) String() string { + return fmt.Sprintf("%d MHz", a) +} + +func decodeRadioTap(data []byte, p gopacket.PacketBuilder) error { + d := &RadioTap{} + // TODO: Should we set LinkLayer here? And implement LinkFlow + return decodingLayerDecoder(d, data, p) +} + +type RadioTap struct { + BaseLayer + + // Version 0. Only increases for drastic changes, introduction of compatible new fields does not count. + Version uint8 + // Length of the whole header in bytes, including it_version, it_pad, it_len, and data fields. + Length uint16 + // Present is a bitmap telling which fields are present. Set bit 31 (0x80000000) to extend the bitmap by another 32 bits. Additional extensions are made by setting bit 31. + Present RadioTapPresent + // TSFT: value in microseconds of the MAC's 64-bit 802.11 Time Synchronization Function timer when the first bit of the MPDU arrived at the MAC. For received frames, only. + TSFT uint64 + Flags RadioTapFlags + // Rate Tx/Rx data rate + Rate RadioTapRate + // ChannelFrequency Tx/Rx frequency in MHz, followed by flags + ChannelFrequency RadioTapChannelFrequency + ChannelFlags RadioTapChannelFlags + // FHSS For frequency-hopping radios, the hop set (first byte) and pattern (second byte). + FHSS uint16 + // DBMAntennaSignal RF signal power at the antenna, decibel difference from one milliwatt. + DBMAntennaSignal int8 + // DBMAntennaNoise RF noise power at the antenna, decibel difference from one milliwatt. + DBMAntennaNoise int8 + // LockQuality Quality of Barker code lock. Unitless. Monotonically nondecreasing with "better" lock strength. Called "Signal Quality" in datasheets. + LockQuality uint16 + // TxAttenuation Transmit power expressed as unitless distance from max power set at factory calibration. 0 is max power. Monotonically nondecreasing with lower power levels. + TxAttenuation uint16 + // DBTxAttenuation Transmit power expressed as decibel distance from max power set at factory calibration. 0 is max power. Monotonically nondecreasing with lower power levels. + DBTxAttenuation uint16 + // DBMTxPower Transmit power expressed as dBm (decibels from a 1 milliwatt reference). This is the absolute power level measured at the antenna port. + DBMTxPower int8 + // Antenna Unitless indication of the Rx/Tx antenna for this packet. The first antenna is antenna 0. + Antenna uint8 + // DBAntennaSignal RF signal power at the antenna, decibel difference from an arbitrary, fixed reference. + DBAntennaSignal uint8 + // DBAntennaNoise RF noise power at the antenna, decibel difference from an arbitrary, fixed reference point. + DBAntennaNoise uint8 +} + +func (m *RadioTap) LayerType() gopacket.LayerType { return LayerTypeRadioTap } + +func (m *RadioTap) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Version = uint8(data[0]) + m.Length = binary.LittleEndian.Uint16(data[2:4]) + m.Present = RadioTapPresent(binary.LittleEndian.Uint32(data[4:8])) + + offset := uint16(4) + + for (binary.LittleEndian.Uint32(data[offset:offset+4]) & 0x80000000) != 0 { + // Extended bitmap. + offset += 4 + } + + if m.Present.TSFT() { + offset += align(offset, 8) + m.TSFT = binary.LittleEndian.Uint64(data[offset : offset+8]) + offset += 8 + } + if m.Present.Flags() { + m.Flags = RadioTapFlags(data[offset]) + offset++ + } + if m.Present.Rate() { + m.Rate = RadioTapRate(data[offset]) + offset++ + } + if m.Present.FHSS() { + m.FHSS = binary.LittleEndian.Uint16(data[offset : offset+2]) + offset += 2 + } + if m.Present.Channel() { + m.ChannelFrequency = RadioTapChannelFrequency(binary.LittleEndian.Uint16(data[offset : offset+2])) + offset += 2 + m.ChannelFlags = RadioTapChannelFlags(data[offset]) + offset++ + } + if m.Present.DBMAntennaSignal() { + m.DBMAntennaSignal = int8(data[offset]) + offset++ + } + if m.Present.DBMAntennaNoise() { + m.DBMAntennaNoise = int8(data[offset]) + offset++ + } + if m.Present.LockQuality() { + offset += align(offset, 2) + m.LockQuality = binary.LittleEndian.Uint16(data[offset : offset+2]) + offset += 2 + } + if m.Present.TxAttenuation() { + offset += align(offset, 2) + m.TxAttenuation = binary.LittleEndian.Uint16(data[offset : offset+2]) + offset += 2 + } + if m.Present.DBTxAttenuation() { + offset += align(offset, 2) + m.DBTxAttenuation = binary.LittleEndian.Uint16(data[offset : offset+2]) + offset += 2 + } + if m.Present.DBMTxPower() { + m.DBMTxPower = int8(data[offset]) + offset++ + } + if m.Present.Antenna() { + m.Antenna = uint8(data[offset]) + offset++ + } + if m.Present.DBAntennaSignal() { + m.DBAntennaSignal = uint8(data[offset]) + offset++ + } + if m.Present.DBAntennaNoise() { + m.DBAntennaNoise = uint8(data[offset]) + offset++ + } + if m.Present.RxFlags() { + // TODO: Implement RxFlags + } + if m.Present.TxFlags() { + // TODO: Implement TxFlags + } + if m.Present.RtsRetries() { + // TODO: Implement RtsRetries + } + if m.Present.DataRetries() { + // TODO: Implement DataRetries + } + if m.Present.EXT() { + offset += align(offset, 4) + // TODO: Implement EXT + _ = data[offset : offset+4] + offset += 4 + } + + if m.Flags.Datapad() { + // frame has padding between 802.11 header and payload (to 32-bit boundary) + offset += align(offset, 4) + } + + m.BaseLayer = BaseLayer{Contents: data[:m.Length], Payload: data[m.Length:]} + + return nil +} + +func (m *RadioTap) CanDecode() gopacket.LayerClass { return LayerTypeRadioTap } +func (m *RadioTap) NextLayerType() gopacket.LayerType { return LayerTypeDot11 } diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/rudp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/rudp.go new file mode 100644 index 00000000..9923ed7f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/rudp.go @@ -0,0 +1,93 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" +) + +type RUDP struct { + BaseLayer + SYN, ACK, EACK, RST, NUL bool + Version uint8 + HeaderLength uint8 + SrcPort, DstPort RUDPPort + DataLength uint16 + Seq, Ack, Checksum uint32 + VariableHeaderArea []byte + // RUDPHeaderSyn contains SYN information for the RUDP packet, + // if the SYN flag is set + *RUDPHeaderSYN + // RUDPHeaderEack contains EACK information for the RUDP packet, + // if the EACK flag is set. + *RUDPHeaderEACK +} + +type RUDPHeaderSYN struct { + MaxOutstandingSegments, MaxSegmentSize, OptionFlags uint16 +} + +type RUDPHeaderEACK struct { + SeqsReceivedOK []uint32 +} + +// LayerType returns gopacket.LayerTypeRUDP. +func (r *RUDP) LayerType() gopacket.LayerType { return LayerTypeRUDP } + +func decodeRUDP(data []byte, p gopacket.PacketBuilder) error { + r := &RUDP{ + SYN: data[0]&0x80 != 0, + ACK: data[0]&0x40 != 0, + EACK: data[0]&0x20 != 0, + RST: data[0]&0x10 != 0, + NUL: data[0]&0x08 != 0, + Version: data[0] & 0x3, + HeaderLength: data[1], + SrcPort: RUDPPort(data[2]), + DstPort: RUDPPort(data[3]), + DataLength: binary.BigEndian.Uint16(data[4:6]), + Seq: binary.BigEndian.Uint32(data[6:10]), + Ack: binary.BigEndian.Uint32(data[10:14]), + Checksum: binary.BigEndian.Uint32(data[14:18]), + } + if r.HeaderLength < 9 { + return fmt.Errorf("RUDP packet with too-short header length %d", r.HeaderLength) + } + hlen := int(r.HeaderLength) * 2 + r.Contents = data[:hlen] + r.Payload = data[hlen : hlen+int(r.DataLength)] + r.VariableHeaderArea = data[18:hlen] + headerData := r.VariableHeaderArea + switch { + case r.SYN: + if len(headerData) != 6 { + return fmt.Errorf("RUDP packet invalid SYN header length: %d", len(headerData)) + } + r.RUDPHeaderSYN = &RUDPHeaderSYN{ + MaxOutstandingSegments: binary.BigEndian.Uint16(headerData[:2]), + MaxSegmentSize: binary.BigEndian.Uint16(headerData[2:4]), + OptionFlags: binary.BigEndian.Uint16(headerData[4:6]), + } + case r.EACK: + if len(headerData)%4 != 0 { + return fmt.Errorf("RUDP packet invalid EACK header length: %d", len(headerData)) + } + r.RUDPHeaderEACK = &RUDPHeaderEACK{make([]uint32, len(headerData)/4)} + for i := 0; i < len(headerData); i += 4 { + r.SeqsReceivedOK[i/4] = binary.BigEndian.Uint32(headerData[i : i+4]) + } + } + p.AddLayer(r) + p.SetTransportLayer(r) + return p.NextDecoder(gopacket.LayerTypePayload) +} + +func (r *RUDP) TransportFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointRUDPPort, []byte{byte(r.SrcPort)}, []byte{byte(r.DstPort)}) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/sctp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/sctp.go new file mode 100644 index 00000000..fb8c777e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/sctp.go @@ -0,0 +1,608 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" + "hash/crc32" +) + +// SCTP contains information on the top level of an SCTP packet. +type SCTP struct { + BaseLayer + SrcPort, DstPort SCTPPort + VerificationTag uint32 + Checksum uint32 + sPort, dPort []byte +} + +// LayerType returns gopacket.LayerTypeSCTP +func (s *SCTP) LayerType() gopacket.LayerType { return LayerTypeSCTP } + +func decodeSCTP(data []byte, p gopacket.PacketBuilder) error { + sctp := &SCTP{ + SrcPort: SCTPPort(binary.BigEndian.Uint16(data[:2])), + sPort: data[:2], + DstPort: SCTPPort(binary.BigEndian.Uint16(data[2:4])), + dPort: data[2:4], + VerificationTag: binary.BigEndian.Uint32(data[4:8]), + Checksum: binary.BigEndian.Uint32(data[8:12]), + BaseLayer: BaseLayer{data[:12], data[12:]}, + } + p.AddLayer(sctp) + p.SetTransportLayer(sctp) + return p.NextDecoder(sctpChunkTypePrefixDecoder) +} + +var sctpChunkTypePrefixDecoder = gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix) + +// TransportFlow returns a flow based on the source and destination SCTP port. +func (s *SCTP) TransportFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointSCTPPort, s.sPort, s.dPort) +} + +func decodeWithSCTPChunkTypePrefix(data []byte, p gopacket.PacketBuilder) error { + chunkType := SCTPChunkType(data[0]) + return chunkType.Decode(data, p) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (s SCTP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + bytes, err := b.PrependBytes(12) + if err != nil { + return err + } + binary.BigEndian.PutUint16(bytes[0:2], uint16(s.SrcPort)) + binary.BigEndian.PutUint16(bytes[2:4], uint16(s.DstPort)) + binary.BigEndian.PutUint32(bytes[4:8], s.VerificationTag) + if opts.ComputeChecksums { + // Note: MakeTable(Castagnoli) actually only creates the table once, then + // passes back a singleton on every other call, so this shouldn't cause + // excessive memory allocation. + binary.LittleEndian.PutUint32(bytes[8:12], crc32.Checksum(b.Bytes(), crc32.MakeTable(crc32.Castagnoli))) + } + return nil +} + +// SCTPChunk contains the common fields in all SCTP chunks. +type SCTPChunk struct { + BaseLayer + Type SCTPChunkType + Flags uint8 + Length uint16 + // ActualLength is the total length of an SCTP chunk, including padding. + // SCTP chunks start and end on 4-byte boundaries. So if a chunk has a length + // of 18, it means that it has data up to and including byte 18, then padding + // up to the next 4-byte boundary, 20. In this case, Length would be 18, and + // ActualLength would be 20. + ActualLength int +} + +func roundUpToNearest4(i int) int { + if i%4 == 0 { + return i + } + return i + 4 - (i % 4) +} + +func decodeSCTPChunk(data []byte) SCTPChunk { + length := binary.BigEndian.Uint16(data[2:4]) + actual := roundUpToNearest4(int(length)) + return SCTPChunk{ + Type: SCTPChunkType(data[0]), + Flags: data[1], + Length: length, + ActualLength: actual, + BaseLayer: BaseLayer{data[:actual], data[actual:]}, + } +} + +// SCTPParameter is a TLV parameter inside a SCTPChunk. +type SCTPParameter struct { + Type uint16 + Length uint16 + ActualLength int + Value []byte +} + +func decodeSCTPParameter(data []byte) SCTPParameter { + length := binary.BigEndian.Uint16(data[2:4]) + return SCTPParameter{ + Type: binary.BigEndian.Uint16(data[0:2]), + Length: length, + Value: data[4:length], + ActualLength: roundUpToNearest4(int(length)), + } +} + +func (p SCTPParameter) Bytes() []byte { + length := 4 + len(p.Value) + data := make([]byte, roundUpToNearest4(length)) + binary.BigEndian.PutUint16(data[0:2], p.Type) + binary.BigEndian.PutUint16(data[2:4], uint16(length)) + copy(data[4:], p.Value) + return data +} + +// SCTPUnknownChunkType is the layer type returned when we don't recognize the +// chunk type. Since there's a length in a known location, we can skip over +// it even if we don't know what it is, and continue parsing the rest of the +// chunks. This chunk is stored as an ErrorLayer in the packet. +type SCTPUnknownChunkType struct { + SCTPChunk + bytes []byte +} + +func decodeSCTPChunkTypeUnknown(data []byte, p gopacket.PacketBuilder) error { + sc := &SCTPUnknownChunkType{SCTPChunk: decodeSCTPChunk(data)} + sc.bytes = data[:sc.ActualLength] + p.AddLayer(sc) + p.SetErrorLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (s SCTPUnknownChunkType) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + bytes, err := b.PrependBytes(s.ActualLength) + if err != nil { + return err + } + copy(bytes, s.bytes) + return nil +} + +// LayerType returns gopacket.LayerTypeSCTPUnknownChunkType. +func (s *SCTPUnknownChunkType) LayerType() gopacket.LayerType { return LayerTypeSCTPUnknownChunkType } + +// Payload returns all bytes in this header, including the decoded Type, Length, +// and Flags. +func (s *SCTPUnknownChunkType) Payload() []byte { return s.bytes } + +// Error implements ErrorLayer. +func (s *SCTPUnknownChunkType) Error() error { + return fmt.Errorf("No decode method available for SCTP chunk type %s", s.Type) +} + +// SCTPData is the SCTP Data chunk layer. +type SCTPData struct { + SCTPChunk + Unordered, BeginFragment, EndFragment bool + TSN uint32 + StreamId uint16 + StreamSequence uint16 + PayloadProtocol uint32 + PayloadData []byte +} + +// LayerType returns gopacket.LayerTypeSCTPData. +func (s *SCTPData) LayerType() gopacket.LayerType { return LayerTypeSCTPData } + +// Payload returns the data payload of the SCTP data chunk. +func (s *SCTPData) Payload() []byte { + return s.PayloadData +} + +func decodeSCTPData(data []byte, p gopacket.PacketBuilder) error { + sc := &SCTPData{ + SCTPChunk: decodeSCTPChunk(data), + Unordered: data[1]&0x4 != 0, + BeginFragment: data[1]&0x2 != 0, + EndFragment: data[1]&0x1 != 0, + TSN: binary.BigEndian.Uint32(data[4:8]), + StreamId: binary.BigEndian.Uint16(data[8:10]), + StreamSequence: binary.BigEndian.Uint16(data[10:12]), + PayloadProtocol: binary.BigEndian.Uint32(data[12:16]), + } + // Length is the length in bytes of the data, INCLUDING the 16-byte header. + sc.PayloadData = data[16:sc.Length] + p.AddLayer(sc) + p.SetApplicationLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (sc SCTPData) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + length := 16 + len(sc.PayloadData) + bytes, err := b.PrependBytes(roundUpToNearest4(length)) + if err != nil { + return err + } + bytes[0] = uint8(sc.Type) + flags := uint8(0) + if sc.Unordered { + flags |= 0x4 + } + if sc.BeginFragment { + flags |= 0x2 + } + if sc.EndFragment { + flags |= 0x1 + } + bytes[1] = flags + binary.BigEndian.PutUint16(bytes[2:4], uint16(length)) + binary.BigEndian.PutUint32(bytes[4:8], sc.TSN) + binary.BigEndian.PutUint16(bytes[8:10], sc.StreamId) + binary.BigEndian.PutUint16(bytes[10:12], sc.StreamSequence) + binary.BigEndian.PutUint32(bytes[12:16], sc.PayloadProtocol) + copy(bytes[16:], sc.PayloadData) + return nil +} + +// SCTPInitParameter is a parameter for an SCTP Init or InitAck packet. +type SCTPInitParameter SCTPParameter + +// SCTPInit is used as the return value for both SCTPInit and SCTPInitAck +// messages. +type SCTPInit struct { + SCTPChunk + InitiateTag uint32 + AdvertisedReceiverWindowCredit uint32 + OutboundStreams, InboundStreams uint16 + InitialTSN uint32 + Parameters []SCTPInitParameter +} + +// LayerType returns either gopacket.LayerTypeSCTPInit or gopacket.LayerTypeSCTPInitAck. +func (sc *SCTPInit) LayerType() gopacket.LayerType { + if sc.Type == SCTPChunkTypeInitAck { + return LayerTypeSCTPInitAck + } + // sc.Type == SCTPChunkTypeInit + return LayerTypeSCTPInit +} + +func decodeSCTPInit(data []byte, p gopacket.PacketBuilder) error { + sc := &SCTPInit{ + SCTPChunk: decodeSCTPChunk(data), + InitiateTag: binary.BigEndian.Uint32(data[4:8]), + AdvertisedReceiverWindowCredit: binary.BigEndian.Uint32(data[8:12]), + OutboundStreams: binary.BigEndian.Uint16(data[12:14]), + InboundStreams: binary.BigEndian.Uint16(data[14:16]), + InitialTSN: binary.BigEndian.Uint32(data[16:20]), + } + paramData := data[20:sc.ActualLength] + for len(paramData) > 0 { + p := SCTPInitParameter(decodeSCTPParameter(paramData)) + paramData = paramData[p.ActualLength:] + sc.Parameters = append(sc.Parameters, p) + } + p.AddLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (sc SCTPInit) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + var payload []byte + for _, param := range sc.Parameters { + payload = append(payload, SCTPParameter(param).Bytes()...) + } + length := 20 + len(payload) + + bytes, err := b.PrependBytes(roundUpToNearest4(length)) + if err != nil { + return err + } + bytes[0] = uint8(sc.Type) + bytes[1] = sc.Flags + binary.BigEndian.PutUint16(bytes[2:4], uint16(length)) + binary.BigEndian.PutUint32(bytes[4:8], sc.InitiateTag) + binary.BigEndian.PutUint32(bytes[8:12], sc.AdvertisedReceiverWindowCredit) + binary.BigEndian.PutUint16(bytes[12:14], sc.OutboundStreams) + binary.BigEndian.PutUint16(bytes[14:16], sc.InboundStreams) + binary.BigEndian.PutUint32(bytes[16:20], sc.InitialTSN) + copy(bytes[20:], payload) + return nil +} + +// SCTPSack is the SCTP Selective ACK chunk layer. +type SCTPSack struct { + SCTPChunk + CumulativeTSNAck uint32 + AdvertisedReceiverWindowCredit uint32 + NumGapACKs, NumDuplicateTSNs uint16 + GapACKs []uint16 + DuplicateTSNs []uint32 +} + +// LayerType return LayerTypeSCTPSack +func (sc *SCTPSack) LayerType() gopacket.LayerType { + return LayerTypeSCTPSack +} + +func decodeSCTPSack(data []byte, p gopacket.PacketBuilder) error { + sc := &SCTPSack{ + SCTPChunk: decodeSCTPChunk(data), + CumulativeTSNAck: binary.BigEndian.Uint32(data[4:8]), + AdvertisedReceiverWindowCredit: binary.BigEndian.Uint32(data[8:12]), + NumGapACKs: binary.BigEndian.Uint16(data[12:14]), + NumDuplicateTSNs: binary.BigEndian.Uint16(data[14:16]), + } + // We maximize gapAcks and dupTSNs here so we're not allocating tons + // of memory based on a user-controlable field. Our maximums are not exact, + // but should give us sane defaults... we'll still hit slice boundaries and + // fail if the user-supplied values are too high (in the for loops below), but + // the amount of memory we'll have allocated because of that should be small + // (< sc.ActualLength) + gapAcks := sc.SCTPChunk.ActualLength / 2 + dupTSNs := (sc.SCTPChunk.ActualLength - gapAcks*2) / 4 + if gapAcks > int(sc.NumGapACKs) { + gapAcks = int(sc.NumGapACKs) + } + if dupTSNs > int(sc.NumDuplicateTSNs) { + dupTSNs = int(sc.NumDuplicateTSNs) + } + sc.GapACKs = make([]uint16, 0, gapAcks) + sc.DuplicateTSNs = make([]uint32, 0, dupTSNs) + bytesRemaining := data[16:] + for i := 0; i < int(sc.NumGapACKs); i++ { + sc.GapACKs = append(sc.GapACKs, binary.BigEndian.Uint16(bytesRemaining[:2])) + bytesRemaining = bytesRemaining[2:] + } + for i := 0; i < int(sc.NumDuplicateTSNs); i++ { + sc.DuplicateTSNs = append(sc.DuplicateTSNs, binary.BigEndian.Uint32(bytesRemaining[:4])) + bytesRemaining = bytesRemaining[4:] + } + p.AddLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (sc SCTPSack) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + length := 16 + 2*len(sc.GapACKs) + 4*len(sc.DuplicateTSNs) + bytes, err := b.PrependBytes(roundUpToNearest4(length)) + if err != nil { + return err + } + bytes[0] = uint8(sc.Type) + bytes[1] = sc.Flags + binary.BigEndian.PutUint16(bytes[2:4], uint16(length)) + binary.BigEndian.PutUint32(bytes[4:8], sc.CumulativeTSNAck) + binary.BigEndian.PutUint32(bytes[8:12], sc.AdvertisedReceiverWindowCredit) + binary.BigEndian.PutUint16(bytes[12:14], uint16(len(sc.GapACKs))) + binary.BigEndian.PutUint16(bytes[14:16], uint16(len(sc.DuplicateTSNs))) + for i, v := range sc.GapACKs { + binary.BigEndian.PutUint16(bytes[16+i*2:], v) + } + offset := 16 + 2*len(sc.GapACKs) + for i, v := range sc.DuplicateTSNs { + binary.BigEndian.PutUint32(bytes[offset+i*4:], v) + } + return nil +} + +// SCTPHeartbeatParameter is the parameter type used by SCTP heartbeat and +// heartbeat ack layers. +type SCTPHeartbeatParameter SCTPParameter + +// SCTPHeartbeat is the SCTP heartbeat layer, also used for heatbeat ack. +type SCTPHeartbeat struct { + SCTPChunk + Parameters []SCTPHeartbeatParameter +} + +// LayerType returns gopacket.LayerTypeSCTPHeartbeat. +func (sc *SCTPHeartbeat) LayerType() gopacket.LayerType { + if sc.Type == SCTPChunkTypeHeartbeatAck { + return LayerTypeSCTPHeartbeatAck + } + // sc.Type == SCTPChunkTypeHeartbeat + return LayerTypeSCTPHeartbeat +} + +func decodeSCTPHeartbeat(data []byte, p gopacket.PacketBuilder) error { + sc := &SCTPHeartbeat{ + SCTPChunk: decodeSCTPChunk(data), + } + paramData := data[4:sc.Length] + for len(paramData) > 0 { + p := SCTPHeartbeatParameter(decodeSCTPParameter(paramData)) + paramData = paramData[p.ActualLength:] + sc.Parameters = append(sc.Parameters, p) + } + p.AddLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (sc SCTPHeartbeat) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + var payload []byte + for _, param := range sc.Parameters { + payload = append(payload, SCTPParameter(param).Bytes()...) + } + length := 4 + len(payload) + + bytes, err := b.PrependBytes(roundUpToNearest4(length)) + if err != nil { + return err + } + bytes[0] = uint8(sc.Type) + bytes[1] = sc.Flags + binary.BigEndian.PutUint16(bytes[2:4], uint16(length)) + copy(bytes[4:], payload) + return nil +} + +// SCTPErrorParameter is the parameter type used by SCTP Abort and Error layers. +type SCTPErrorParameter SCTPParameter + +// SCTPError is the SCTP error layer, also used for SCTP aborts. +type SCTPError struct { + SCTPChunk + Parameters []SCTPErrorParameter +} + +// LayerType returns LayerTypeSCTPAbort or LayerTypeSCTPError. +func (sc *SCTPError) LayerType() gopacket.LayerType { + if sc.Type == SCTPChunkTypeAbort { + return LayerTypeSCTPAbort + } + // sc.Type == SCTPChunkTypeError + return LayerTypeSCTPError +} + +func decodeSCTPError(data []byte, p gopacket.PacketBuilder) error { + // remarkably similarot decodeSCTPHeartbeat ;) + sc := &SCTPError{ + SCTPChunk: decodeSCTPChunk(data), + } + paramData := data[4:sc.Length] + for len(paramData) > 0 { + p := SCTPErrorParameter(decodeSCTPParameter(paramData)) + paramData = paramData[p.ActualLength:] + sc.Parameters = append(sc.Parameters, p) + } + p.AddLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (sc SCTPError) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + var payload []byte + for _, param := range sc.Parameters { + payload = append(payload, SCTPParameter(param).Bytes()...) + } + length := 4 + len(payload) + + bytes, err := b.PrependBytes(roundUpToNearest4(length)) + if err != nil { + return err + } + bytes[0] = uint8(sc.Type) + bytes[1] = sc.Flags + binary.BigEndian.PutUint16(bytes[2:4], uint16(length)) + copy(bytes[4:], payload) + return nil +} + +// SCTPShutdown is the SCTP shutdown layer. +type SCTPShutdown struct { + SCTPChunk + CumulativeTSNAck uint32 +} + +// LayerType returns gopacket.LayerTypeSCTPShutdown. +func (sc *SCTPShutdown) LayerType() gopacket.LayerType { return LayerTypeSCTPShutdown } + +func decodeSCTPShutdown(data []byte, p gopacket.PacketBuilder) error { + sc := &SCTPShutdown{ + SCTPChunk: decodeSCTPChunk(data), + CumulativeTSNAck: binary.BigEndian.Uint32(data[4:8]), + } + p.AddLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (sc SCTPShutdown) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + bytes, err := b.PrependBytes(8) + if err != nil { + return err + } + bytes[0] = uint8(sc.Type) + bytes[1] = sc.Flags + binary.BigEndian.PutUint16(bytes[2:4], 8) + binary.BigEndian.PutUint32(bytes[4:8], sc.CumulativeTSNAck) + return nil +} + +// SCTPShutdownAck is the SCTP shutdown layer. +type SCTPShutdownAck struct { + SCTPChunk +} + +// LayerType returns gopacket.LayerTypeSCTPShutdownAck. +func (sc *SCTPShutdownAck) LayerType() gopacket.LayerType { return LayerTypeSCTPShutdownAck } + +func decodeSCTPShutdownAck(data []byte, p gopacket.PacketBuilder) error { + sc := &SCTPShutdownAck{ + SCTPChunk: decodeSCTPChunk(data), + } + p.AddLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (sc SCTPShutdownAck) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + bytes, err := b.PrependBytes(4) + if err != nil { + return err + } + bytes[0] = uint8(sc.Type) + bytes[1] = sc.Flags + binary.BigEndian.PutUint16(bytes[2:4], 4) + return nil +} + +// SCTPCookieEcho is the SCTP Cookie Echo layer. +type SCTPCookieEcho struct { + SCTPChunk + Cookie []byte +} + +// LayerType returns gopacket.LayerTypeSCTPCookieEcho. +func (sc *SCTPCookieEcho) LayerType() gopacket.LayerType { return LayerTypeSCTPCookieEcho } + +func decodeSCTPCookieEcho(data []byte, p gopacket.PacketBuilder) error { + sc := &SCTPCookieEcho{ + SCTPChunk: decodeSCTPChunk(data), + } + sc.Cookie = data[4:sc.Length] + p.AddLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (sc SCTPCookieEcho) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + length := 4 + len(sc.Cookie) + bytes, err := b.PrependBytes(roundUpToNearest4(length)) + if err != nil { + return err + } + bytes[0] = uint8(sc.Type) + bytes[1] = sc.Flags + binary.BigEndian.PutUint16(bytes[2:4], uint16(length)) + copy(bytes[4:], sc.Cookie) + return nil +} + +// This struct is used by all empty SCTP chunks (currently CookieAck and +// ShutdownComplete). +type SCTPEmptyLayer struct { + SCTPChunk +} + +// LayerType returns either gopacket.LayerTypeSCTPShutdownComplete or +// LayerTypeSCTPCookieAck. +func (sc *SCTPEmptyLayer) LayerType() gopacket.LayerType { + if sc.Type == SCTPChunkTypeShutdownComplete { + return LayerTypeSCTPShutdownComplete + } + // sc.Type == SCTPChunkTypeCookieAck + return LayerTypeSCTPCookieAck +} + +func decodeSCTPEmptyLayer(data []byte, p gopacket.PacketBuilder) error { + sc := &SCTPEmptyLayer{ + SCTPChunk: decodeSCTPChunk(data), + } + p.AddLayer(sc) + return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) +} + +// SerializeTo is for gopacket.SerializableLayer. +func (sc SCTPEmptyLayer) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + bytes, err := b.PrependBytes(4) + if err != nil { + return err + } + bytes[0] = uint8(sc.Type) + bytes[1] = sc.Flags + binary.BigEndian.PutUint16(bytes[2:4], 4) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/tcp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/tcp.go new file mode 100644 index 00000000..e3fe84d0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/tcp.go @@ -0,0 +1,232 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "errors" + "fmt" + "github.com/tsg/gopacket" +) + +// TCP is the layer for TCP headers. +type TCP struct { + BaseLayer + SrcPort, DstPort TCPPort + Seq uint32 + Ack uint32 + DataOffset uint8 + FIN, SYN, RST, PSH, ACK, URG, ECE, CWR, NS bool + Window uint16 + Checksum uint16 + Urgent uint16 + sPort, dPort []byte + Options []TCPOption + Padding []byte + opts [4]TCPOption + tcpipchecksum +} + +type TCPOption struct { + OptionType uint8 + OptionLength uint8 + OptionData []byte +} + +func (t TCPOption) String() string { + switch t.OptionType { + case 1: + return "NOP" + case 8: + if len(t.OptionData) == 8 { + return fmt.Sprintf("TSOPT:%v/%v", + binary.BigEndian.Uint32(t.OptionData[:4]), + binary.BigEndian.Uint32(t.OptionData[4:8])) + } + } + return fmt.Sprintf("TCPOption(%v:%v)", t.OptionType, t.OptionData) +} + +// LayerType returns gopacket.LayerTypeTCP +func (t *TCP) LayerType() gopacket.LayerType { return LayerTypeTCP } + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (t *TCP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + var optionLength int + for _, o := range t.Options { + switch o.OptionType { + case 0, 1: + optionLength += 1 + default: + optionLength += 2 + len(o.OptionData) + } + } + if opts.FixLengths { + t.Padding = lotsOfZeros[:optionLength%4] + t.DataOffset = uint8((len(t.Padding) + optionLength + 20) / 4) + } + bytes, err := b.PrependBytes(20 + optionLength + len(t.Padding)) + if err != nil { + return err + } + binary.BigEndian.PutUint16(bytes, uint16(t.SrcPort)) + binary.BigEndian.PutUint16(bytes[2:], uint16(t.DstPort)) + binary.BigEndian.PutUint32(bytes[4:], t.Seq) + binary.BigEndian.PutUint32(bytes[8:], t.Ack) + binary.BigEndian.PutUint16(bytes[12:], t.flagsAndOffset()) + binary.BigEndian.PutUint16(bytes[14:], t.Window) + binary.BigEndian.PutUint16(bytes[18:], t.Urgent) + start := 20 + for _, o := range t.Options { + bytes[start] = o.OptionType + switch o.OptionType { + case 0, 1: + start++ + default: + if opts.FixLengths { + o.OptionLength = uint8(len(o.OptionData) + 2) + } + bytes[start+1] = o.OptionLength + copy(bytes[start+2:start+len(o.OptionData)+2], o.OptionData) + start += int(o.OptionLength) + } + } + copy(bytes[start:], t.Padding) + if opts.ComputeChecksums { + // zero out checksum bytes in current serialization. + bytes[16] = 0 + bytes[17] = 0 + csum, err := t.computeChecksum(b.Bytes()) + if err != nil { + return err + } + t.Checksum = csum + } + binary.BigEndian.PutUint16(bytes[16:], t.Checksum) + return nil +} + +func (t *TCP) flagsAndOffset() uint16 { + f := uint16(t.DataOffset) << 12 + if t.FIN { + f |= 0x0001 + } + if t.SYN { + f |= 0x0002 + } + if t.RST { + f |= 0x0004 + } + if t.PSH { + f |= 0x0008 + } + if t.ACK { + f |= 0x0010 + } + if t.URG { + f |= 0x0020 + } + if t.ECE { + f |= 0x0040 + } + if t.CWR { + f |= 0x0080 + } + if t.NS { + f |= 0x0100 + } + return f +} + +func (tcp *TCP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + tcp.SrcPort = TCPPort(binary.BigEndian.Uint16(data[0:2])) + tcp.sPort = data[0:2] + tcp.DstPort = TCPPort(binary.BigEndian.Uint16(data[2:4])) + tcp.dPort = data[2:4] + tcp.Seq = binary.BigEndian.Uint32(data[4:8]) + tcp.Ack = binary.BigEndian.Uint32(data[8:12]) + tcp.DataOffset = data[12] >> 4 + tcp.FIN = data[13]&0x01 != 0 + tcp.SYN = data[13]&0x02 != 0 + tcp.RST = data[13]&0x04 != 0 + tcp.PSH = data[13]&0x08 != 0 + tcp.ACK = data[13]&0x10 != 0 + tcp.URG = data[13]&0x20 != 0 + tcp.ECE = data[13]&0x40 != 0 + tcp.CWR = data[13]&0x80 != 0 + tcp.NS = data[12]&0x01 != 0 + tcp.Window = binary.BigEndian.Uint16(data[14:16]) + tcp.Checksum = binary.BigEndian.Uint16(data[16:18]) + tcp.Urgent = binary.BigEndian.Uint16(data[18:20]) + tcp.Options = tcp.opts[:0] + if tcp.DataOffset < 5 { + return fmt.Errorf("Invalid TCP data offset %d < 5", tcp.DataOffset) + } + dataStart := int(tcp.DataOffset) * 4 + if dataStart > len(data) { + df.SetTruncated() + tcp.Payload = nil + tcp.Contents = data + return errors.New("TCP data offset greater than packet length") + } + tcp.Contents = data[:dataStart] + tcp.Payload = data[dataStart:] + // From here on, data points just to the header options. + data = data[20:dataStart] + for len(data) > 0 { + if tcp.Options == nil { + // Pre-allocate to avoid allocating a slice. + tcp.Options = tcp.opts[:0] + } + tcp.Options = append(tcp.Options, TCPOption{OptionType: data[0]}) + opt := &tcp.Options[len(tcp.Options)-1] + switch opt.OptionType { + case 0: // End of options + opt.OptionLength = 1 + tcp.Padding = data[1:] + break + case 1: // 1 byte padding + opt.OptionLength = 1 + default: + opt.OptionLength = data[1] + if opt.OptionLength < 2 { + return fmt.Errorf("Invalid TCP option length %d < 2", opt.OptionLength) + } else if int(opt.OptionLength) > len(data) { + return fmt.Errorf("Invalid TCP option length %d exceeds remaining %d bytes", opt.OptionLength, len(data)) + } + opt.OptionData = data[2:opt.OptionLength] + } + data = data[opt.OptionLength:] + } + return nil +} + +func (t *TCP) CanDecode() gopacket.LayerClass { + return LayerTypeTCP +} + +func (t *TCP) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypePayload +} + +func decodeTCP(data []byte, p gopacket.PacketBuilder) error { + tcp := &TCP{} + err := tcp.DecodeFromBytes(data, p) + p.AddLayer(tcp) + p.SetTransportLayer(tcp) + if err != nil { + return err + } + return p.NextDecoder(gopacket.LayerTypePayload) +} + +func (t *TCP) TransportFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointTCPPort, t.sPort, t.dPort) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/tcpip.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/tcpip.go new file mode 100644 index 00000000..5767fdef --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/tcpip.go @@ -0,0 +1,94 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "fmt" + "github.com/tsg/gopacket" +) + +// Checksum computation for TCP/UDP. +type tcpipchecksum struct { + pseudoheader tcpipPseudoHeader +} + +type tcpipPseudoHeader interface { + pseudoheaderChecksum() uint32 +} + +func (ip *IPv4) pseudoheaderChecksum() (csum uint32) { + csum += (uint32(ip.SrcIP[0]) + uint32(ip.SrcIP[2])) << 8 + csum += uint32(ip.SrcIP[1]) + uint32(ip.SrcIP[3]) + csum += (uint32(ip.DstIP[0]) + uint32(ip.DstIP[2])) << 8 + csum += uint32(ip.DstIP[1]) + uint32(ip.DstIP[3]) + csum += uint32(ip.Protocol) + return +} + +func (ip *IPv6) pseudoheaderChecksum() (csum uint32) { + for i := 0; i < 16; i += 2 { + csum += uint32(ip.SrcIP[i]) << 8 + csum += uint32(ip.SrcIP[i+1]) + csum += uint32(ip.DstIP[i]) << 8 + csum += uint32(ip.DstIP[i+1]) + } + csum += uint32(ip.NextHeader) + return +} + +// Calculate the TCP/IP checksum defined in rfc1071. The passed-in csum is any +// initial checksum data that's already been computed. +func tcpipChecksum(data []byte, csum uint32) uint16 { + // to handle odd lengths, we loop to length - 1, incrementing by 2, then + // handle the last byte specifically by checking against the original + // length. + length := len(data) - 1 + for i := 0; i < length; i += 2 { + // For our test packet, doing this manually is about 25% faster + // (740 ns vs. 1000ns) than doing it by calling binary.BigEndian.Uint16. + csum += uint32(data[i]) << 8 + csum += uint32(data[i+1]) + } + if len(data)%2 == 1 { + csum += uint32(data[length]) << 8 + } + for csum > 0xffff { + csum = (csum >> 16) + (csum & 0xffff) + } + return ^uint16(csum + (csum >> 16)) +} + +// computeChecksum computes a TCP or UDP checksum. headerAndPayload is the +// serialized TCP or UDP header plus its payload, with the checksum zero'd +// out. +func (c *tcpipchecksum) computeChecksum(headerAndPayload []byte) (uint16, error) { + if c.pseudoheader == nil { + return 0, fmt.Errorf("TCP/IP layer 4 checksum cannot be computed without network layer... call SetNetworkLayerForChecksum to set which layer to use") + } + length := uint32(len(headerAndPayload)) + csum := c.pseudoheader.pseudoheaderChecksum() + csum += length & 0xffff + csum += length >> 16 + return tcpipChecksum(headerAndPayload, csum), nil +} + +// SetNetworkLayerForChecksum tells this layer which network layer is wrapping it. +// This is needed for computing the checksum when serializing, since TCP/IP transport +// layer checksums depends on fields in the IPv4 or IPv6 layer that contains it. +// The passed in layer must be an *IPv4 or *IPv6. +func (i *tcpipchecksum) SetNetworkLayerForChecksum(l gopacket.NetworkLayer) error { + switch v := l.(type) { + case *IPv4: + i.pseudoheader = v + case *IPv6: + i.pseudoheader = v + default: + return fmt.Errorf("cannot use layer type %v for tcp checksum network layer", l.LayerType()) + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/test_creator.py b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/test_creator.py new file mode 100755 index 00000000..c92d2765 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/test_creator.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# Copyright 2012 Google, Inc. All rights reserved. + +"""TestCreator creates test templates from pcap files.""" + +import argparse +import base64 +import glob +import re +import string +import subprocess +import sys + + +class Packet(object): + """Helper class encapsulating packet from a pcap file.""" + + def __init__(self, packet_lines): + self.packet_lines = packet_lines + self.data = self._DecodeText(packet_lines) + + @classmethod + def _DecodeText(cls, packet_lines): + packet_bytes = [] + # First line is timestamp and stuff, skip it. + # Format: 0x0010: 0000 0020 3aff 3ffe 0000 0000 0000 0000 ....:.?......... + + for line in packet_lines[1:]: + m = re.match(r'\s+0x[a-f\d]+:\s+((?:[\da-f]{2,4}\s)*)', line, re.IGNORECASE) + if m is None: continue + for hexpart in m.group(1).split(): + packet_bytes.append(base64.b16decode(hexpart.upper())) + return ''.join(packet_bytes) + + def Test(self, name, link_type): + """Yields a test using this packet, as a set of lines.""" + yield '// testPacket%s is the packet:' % name + for line in self.packet_lines: + yield '// ' + line + yield 'var testPacket%s = []byte{' % name + data = list(self.data) + while data: + linebytes, data = data[:16], data[16:] + yield ''.join(['\t'] + ['0x%02x, ' % ord(c) for c in linebytes]) + yield '}' + yield 'func TestPacket%s(t *testing.T) {' % name + yield '\tp := gopacket.NewPacket(testPacket%s, LinkType%s, gopacket.Default)' % (name, link_type) + yield '\tif p.ErrorLayer() != nil {' + yield '\t\tt.Error("Failed to decode packet:", p.ErrorLayer().Error())' + yield '\t}' + yield '\tcheckLayers(p, []gopacket.LayerType{LayerType%s, FILL_ME_IN_WITH_ACTUAL_LAYERS}, t)' % link_type + yield '}' + yield 'func BenchmarkDecodePacket%s(b *testing.B) {' % name + yield '\tfor i := 0; i < b.N; i++ {' + yield '\t\tgopacket.NewPacket(testPacket%s, LinkType%s, gopacket.NoCopy)' % (name, link_type) + yield '\t}' + yield '}' + + + +def GetTcpdumpOutput(filename): + """Runs tcpdump on the given file, returning output as string.""" + return subprocess.check_output( + ['tcpdump', '-XX', '-s', '0', '-n', '-r', filename]) + + +def TcpdumpOutputToPackets(output): + """Reads a pcap file with TCPDump, yielding Packet objects.""" + pdata = [] + for line in output.splitlines(): + if line[0] not in string.whitespace and pdata: + yield Packet(pdata) + pdata = [] + pdata.append(line) + if pdata: + yield Packet(pdata) + + +def main(): + class CustomHelpFormatter(argparse.ArgumentDefaultsHelpFormatter): + def _format_usage(self, usage, actions, groups, prefix=None): + header =('TestCreator creates gopacket tests using a pcap file.\n\n' + 'Tests are written to standard out... they can then be \n' + 'copied into the file of your choice and modified as \n' + 'you see.\n\n') + return header + argparse.ArgumentDefaultsHelpFormatter._format_usage( + self, usage, actions, groups, prefix) + + parser = argparse.ArgumentParser(formatter_class=CustomHelpFormatter) + parser.add_argument('--link_type', default='Ethernet', help='the link type (default: %(default)s)') + parser.add_argument('--name', default='Packet%d', help='the layer type, must have "%d" inside it') + parser.add_argument('files', metavar='file.pcap', type=str, nargs='+', help='the files to process') + + args = parser.parse_args() + + for arg in args.files: + for path in glob.glob(arg): + for i, packet in enumerate(TcpdumpOutputToPackets(GetTcpdumpOutput(path))): + print '\n'.join(packet.Test( + args.name % i, args.link_type)) + +if __name__ == '__main__': + main() diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/udp.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/udp.go new file mode 100644 index 00000000..f79c526c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/udp.go @@ -0,0 +1,109 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" +) + +// UDP is the layer for UDP headers. +type UDP struct { + BaseLayer + SrcPort, DstPort UDPPort + Length uint16 + Checksum uint16 + sPort, dPort []byte + tcpipchecksum +} + +// LayerType returns gopacket.LayerTypeUDP +func (u *UDP) LayerType() gopacket.LayerType { return LayerTypeUDP } + +func (udp *UDP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + udp.SrcPort = UDPPort(binary.BigEndian.Uint16(data[0:2])) + udp.sPort = data[0:2] + udp.DstPort = UDPPort(binary.BigEndian.Uint16(data[2:4])) + udp.dPort = data[2:4] + udp.Length = binary.BigEndian.Uint16(data[4:6]) + udp.Checksum = binary.BigEndian.Uint16(data[6:8]) + udp.BaseLayer = BaseLayer{Contents: data[:8]} + switch { + case udp.Length >= 8: + hlen := int(udp.Length) + if hlen > len(data) { + df.SetTruncated() + hlen = len(data) + } + udp.Payload = data[8:hlen] + case udp.Length == 0: // Jumbogram, use entire rest of data + udp.Payload = data[8:] + default: + return fmt.Errorf("UDP packet too small: %d bytes", udp.Length) + } + return nil +} + +// SerializeTo writes the serialized form of this layer into the +// SerializationBuffer, implementing gopacket.SerializableLayer. +// See the docs for gopacket.SerializableLayer for more info. +func (u *UDP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error { + payload := b.Bytes() + bytes, err := b.PrependBytes(8) + if err != nil { + return err + } + binary.BigEndian.PutUint16(bytes, uint16(u.SrcPort)) + binary.BigEndian.PutUint16(bytes[2:], uint16(u.DstPort)) + if opts.FixLengths { + u.Length = uint16(len(payload)) + 8 + } + binary.BigEndian.PutUint16(bytes[4:], u.Length) + if opts.ComputeChecksums { + // zero out checksum bytes + bytes[6] = 0 + bytes[7] = 0 + csum, err := u.computeChecksum(b.Bytes()) + if err != nil { + return err + } + u.Checksum = csum + } + binary.BigEndian.PutUint16(bytes[6:], u.Checksum) + return nil +} + +func (u *UDP) CanDecode() gopacket.LayerClass { + return LayerTypeUDP +} + +// NextLayerType use the destination port to select the +// right next decoder. It tries first to decode via the +// destination port, then the source port. +func (u *UDP) NextLayerType() gopacket.LayerType { + if lt := u.DstPort.LayerType(); lt != gopacket.LayerTypePayload { + return lt + } + return u.SrcPort.LayerType() +} + +func decodeUDP(data []byte, p gopacket.PacketBuilder) error { + udp := &UDP{} + err := udp.DecodeFromBytes(data, p) + p.AddLayer(udp) + p.SetTransportLayer(udp) + if err != nil { + return err + } + return p.NextDecoder(udp.NextLayerType()) +} + +func (u *UDP) TransportFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointUDPPort, u.sPort, u.dPort) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/udplite.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/udplite.go new file mode 100644 index 00000000..7d5be17a --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/udplite.go @@ -0,0 +1,44 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "github.com/tsg/gopacket" +) + +// UDPLite is the layer for UDP-Lite headers (rfc 3828). +type UDPLite struct { + BaseLayer + SrcPort, DstPort UDPLitePort + ChecksumCoverage uint16 + Checksum uint16 + sPort, dPort []byte +} + +// LayerType returns gopacket.LayerTypeUDPLite +func (u *UDPLite) LayerType() gopacket.LayerType { return LayerTypeUDPLite } + +func decodeUDPLite(data []byte, p gopacket.PacketBuilder) error { + udp := &UDPLite{ + SrcPort: UDPLitePort(binary.BigEndian.Uint16(data[0:2])), + sPort: data[0:2], + DstPort: UDPLitePort(binary.BigEndian.Uint16(data[2:4])), + dPort: data[2:4], + ChecksumCoverage: binary.BigEndian.Uint16(data[4:6]), + Checksum: binary.BigEndian.Uint16(data[6:8]), + BaseLayer: BaseLayer{data[:8], data[8:]}, + } + p.AddLayer(udp) + p.SetTransportLayer(udp) + return p.NextDecoder(gopacket.LayerTypePayload) +} + +func (u *UDPLite) TransportFlow() gopacket.Flow { + return gopacket.NewFlow(EndpointUDPLitePort, u.sPort, u.dPort) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/usb.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/usb.go new file mode 100644 index 00000000..fada0367 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layers/usb.go @@ -0,0 +1,308 @@ +// Copyright 2014 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package layers + +import ( + "encoding/binary" + "github.com/tsg/gopacket" +) + +type USBEventType uint8 + +const ( + USBEventTypeSubmit USBEventType = 'S' + USBEventTypeComplete USBEventType = 'C' + USBEventTypeError USBEventType = 'E' +) + +func (a USBEventType) String() string { + switch a { + case USBEventTypeSubmit: + return "SUBMIT" + case USBEventTypeComplete: + return "COMPLETE" + case USBEventTypeError: + return "ERROR" + default: + return "Unknown event type" + } +} + +type USBRequestBlockSetupRequest uint8 + +const ( + USBRequestBlockSetupRequestGetStatus USBRequestBlockSetupRequest = 0x00 + USBRequestBlockSetupRequestClearFeature USBRequestBlockSetupRequest = 0x01 + USBRequestBlockSetupRequestSetFeature USBRequestBlockSetupRequest = 0x03 + USBRequestBlockSetupRequestSetAddress USBRequestBlockSetupRequest = 0x05 + USBRequestBlockSetupRequestGetDescriptor USBRequestBlockSetupRequest = 0x06 + USBRequestBlockSetupRequestSetDescriptor USBRequestBlockSetupRequest = 0x07 + USBRequestBlockSetupRequestGetConfiguration USBRequestBlockSetupRequest = 0x08 + USBRequestBlockSetupRequestSetConfiguration USBRequestBlockSetupRequest = 0x09 + USBRequestBlockSetupRequestSetIdle USBRequestBlockSetupRequest = 0x0a +) + +func (a USBRequestBlockSetupRequest) String() string { + switch a { + case USBRequestBlockSetupRequestGetStatus: + return "GET_STATUS" + case USBRequestBlockSetupRequestClearFeature: + return "CLEAR_FEATURE" + case USBRequestBlockSetupRequestSetFeature: + return "SET_FEATURE" + case USBRequestBlockSetupRequestSetAddress: + return "SET_ADDRESS" + case USBRequestBlockSetupRequestGetDescriptor: + return "GET_DESCRIPTOR" + case USBRequestBlockSetupRequestSetDescriptor: + return "SET_DESCRIPTOR" + case USBRequestBlockSetupRequestGetConfiguration: + return "GET_CONFIGURATION" + case USBRequestBlockSetupRequestSetConfiguration: + return "SET_CONFIGURATION" + case USBRequestBlockSetupRequestSetIdle: + return "SET_IDLE" + default: + return "UNKNOWN" + } +} + +type USBTransportType uint8 + +const ( + USBTransportTypeTransferIn USBTransportType = 0x80 // Indicates send or receive + USBTransportTypeIsochronous USBTransportType = 0x00 // Isochronous transfers occur continuously and periodically. They typically contain time sensitive information, such as an audio or video stream. + USBTransportTypeInterrupt USBTransportType = 0x01 // Interrupt transfers are typically non-periodic, small device "initiated" communication requiring bounded latency, such as pointing devices or keyboards. + USBTransportTypeControl USBTransportType = 0x02 // Control transfers are typically used for command and status operations. + USBTransportTypeBulk USBTransportType = 0x03 // Bulk transfers can be used for large bursty data, using all remaining available bandwidth, no guarantees on bandwidth or latency, such as file transfers. +) + +func (a USBTransportType) LayerType() gopacket.LayerType { + return USBTypeMetadata[a].LayerType +} + +func (a USBTransportType) String() string { + switch a { + case USBTransportTypeTransferIn: + return "Transfer In" + case USBTransportTypeIsochronous: + return "Isochronous" + case USBTransportTypeInterrupt: + return "Interrupt" + case USBTransportTypeControl: + return "Control" + case USBTransportTypeBulk: + return "Bulk" + default: + return "Unknown transport type" + } +} + +type USBDirectionType uint8 + +const ( + USBDirectionTypeUnknown USBDirectionType = iota + USBDirectionTypeIn + USBDirectionTypeOut +) + +func (a USBDirectionType) String() string { + switch a { + case USBDirectionTypeIn: + return "In" + case USBDirectionTypeOut: + return "Out" + default: + return "Unknown direction type" + } +} + +// The reference at http://www.beyondlogic.org/usbnutshell/usb1.shtml contains more information about the protocol. +type USB struct { + BaseLayer + ID uint64 + EventType USBEventType + TransferType USBTransportType + Direction USBDirectionType + EndpointNumber uint8 + DeviceAddress uint8 + BusID uint16 + TimestampSec int64 + TimestampUsec int32 + Setup bool + Data bool + Status int32 + UrbLength uint32 + UrbDataLength uint32 + + UrbInterval uint32 + UrbStartFrame uint32 + UrbCopyOfTransferFlags uint32 + IsoNumDesc uint32 +} + +func (u *USB) LayerType() gopacket.LayerType { return LayerTypeUSB } + +func (m *USB) NextLayerType() gopacket.LayerType { + if m.Setup { + return LayerTypeUSBRequestBlockSetup + } else if m.Data { + } + + return m.TransferType.LayerType() +} + +func decodeUSB(data []byte, p gopacket.PacketBuilder) error { + d := &USB{} + + return decodingLayerDecoder(d, data, p) +} + +func (m *USB) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.ID = binary.LittleEndian.Uint64(data[0:8]) + m.EventType = USBEventType(data[8]) + m.TransferType = USBTransportType(data[9]) + + m.EndpointNumber = data[10] & 0x7f + if data[10]&uint8(USBTransportTypeTransferIn) > 0 { + m.Direction = USBDirectionTypeIn + } else { + m.Direction = USBDirectionTypeOut + } + + m.DeviceAddress = data[11] + m.BusID = binary.LittleEndian.Uint16(data[12:14]) + + if uint(data[14]) == 0 { + m.Setup = true + } + + if uint(data[15]) == 0 { + m.Data = true + } + + m.TimestampSec = int64(binary.LittleEndian.Uint64(data[16:24])) + m.TimestampUsec = int32(binary.LittleEndian.Uint32(data[24:28])) + m.Status = int32(binary.LittleEndian.Uint32(data[28:32])) + m.UrbLength = binary.LittleEndian.Uint32(data[32:36]) + m.UrbDataLength = binary.LittleEndian.Uint32(data[36:40]) + + m.Contents = data[:40] + m.Payload = data[40:] + + if m.Setup { + m.Payload = data[40:] + } else if m.Data { + m.Payload = data[uint32(len(data))-m.UrbDataLength:] + } + + // if 64 bit, dissect_linux_usb_pseudo_header_ext + if false { + m.UrbInterval = binary.LittleEndian.Uint32(data[40:44]) + m.UrbStartFrame = binary.LittleEndian.Uint32(data[44:48]) + m.UrbDataLength = binary.LittleEndian.Uint32(data[48:52]) + m.IsoNumDesc = binary.LittleEndian.Uint32(data[52:56]) + m.Contents = data[:56] + m.Payload = data[56:] + } + + // crc5 or crc16 + // eop (end of packet) + + return nil +} + +type USBRequestBlockSetup struct { + BaseLayer + RequestType uint8 + Request USBRequestBlockSetupRequest + Value uint16 + Index uint16 + Length uint16 +} + +func (u *USBRequestBlockSetup) LayerType() gopacket.LayerType { return LayerTypeUSBRequestBlockSetup } + +func (m *USBRequestBlockSetup) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypePayload +} + +func (m *USBRequestBlockSetup) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.RequestType = data[0] + m.Request = USBRequestBlockSetupRequest(data[1]) + m.Value = binary.LittleEndian.Uint16(data[2:4]) + m.Index = binary.LittleEndian.Uint16(data[4:6]) + m.Length = binary.LittleEndian.Uint16(data[6:8]) + m.Contents = data[:8] + m.Payload = data[8:] + return nil +} + +func decodeUSBRequestBlockSetup(data []byte, p gopacket.PacketBuilder) error { + d := &USBRequestBlockSetup{} + return decodingLayerDecoder(d, data, p) +} + +type USBControl struct { + BaseLayer +} + +func (u *USBControl) LayerType() gopacket.LayerType { return LayerTypeUSBControl } + +func (m *USBControl) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypePayload +} + +func (m *USBControl) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Contents = data + return nil +} + +func decodeUSBControl(data []byte, p gopacket.PacketBuilder) error { + d := &USBControl{} + return decodingLayerDecoder(d, data, p) +} + +type USBInterrupt struct { + BaseLayer +} + +func (u *USBInterrupt) LayerType() gopacket.LayerType { return LayerTypeUSBInterrupt } + +func (m *USBInterrupt) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypePayload +} + +func (m *USBInterrupt) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Contents = data + return nil +} + +func decodeUSBInterrupt(data []byte, p gopacket.PacketBuilder) error { + d := &USBInterrupt{} + return decodingLayerDecoder(d, data, p) +} + +type USBBulk struct { + BaseLayer +} + +func (u *USBBulk) LayerType() gopacket.LayerType { return LayerTypeUSBBulk } + +func (m *USBBulk) NextLayerType() gopacket.LayerType { + return gopacket.LayerTypePayload +} + +func (m *USBBulk) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { + m.Contents = data + return nil +} + +func decodeUSBBulk(data []byte, p gopacket.PacketBuilder) error { + d := &USBBulk{} + return decodingLayerDecoder(d, data, p) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layertype.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layertype.go new file mode 100644 index 00000000..31810c39 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/layertype.go @@ -0,0 +1,101 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package gopacket + +import ( + "fmt" + "strconv" +) + +// LayerType is a unique identifier for each type of layer. This enumeration +// does not match with any externally available numbering scheme... it's solely +// usable/useful within this library as a means for requesting layer types +// (see Packet.Layer) and determining which types of layers have been decoded. +// +// New LayerTypes may be created by calling gopacket.RegisterLayerType. +type LayerType int64 + +// LayerTypeMetadata contains metadata associated with each LayerType. +type LayerTypeMetadata struct { + // Name is the string returned by each layer type's String method. + Name string + // Decoder is the decoder to use when the layer type is passed in as a + // Decoder. + Decoder Decoder +} + +type layerTypeMetadata struct { + inUse bool + LayerTypeMetadata +} + +// DecodersByLayerName maps layer names to decoders for those layers. +// This allows users to specify decoders by name to a program and have that +// program pick the correct decoder accordingly. +var DecodersByLayerName = map[string]Decoder{} + +const maxLayerType = 2000 + +var ltMeta [maxLayerType]layerTypeMetadata +var ltMetaMap = map[LayerType]layerTypeMetadata{} + +// RegisterLayerType creates a new layer type and registers it globally. +// The number passed in must be unique, or a runtime panic will occur. Numbers +// 0-999 are reserved for the gopacket library. Numbers 1000-1999 should be +// used for common application-specific types, and are very fast. Any other +// number (negative or >= 2000) may be used for uncommon application-specific +// types, and are somewhat slower (they require a map lookup over an array +// index). +func RegisterLayerType(num int, meta LayerTypeMetadata) LayerType { + if 0 <= num && num < maxLayerType { + if ltMeta[num].inUse { + panic("Layer type already exists") + } + ltMeta[num] = layerTypeMetadata{ + inUse: true, + LayerTypeMetadata: meta, + } + } else { + if ltMetaMap[LayerType(num)].inUse { + panic("Layer type already exists") + } + ltMetaMap[LayerType(num)] = layerTypeMetadata{ + inUse: true, + LayerTypeMetadata: meta, + } + } + DecodersByLayerName[meta.Name] = meta.Decoder + return LayerType(num) +} + +// Decode decodes the given data using the decoder registered with the layer +// type. +func (t LayerType) Decode(data []byte, c PacketBuilder) error { + var d Decoder + if 0 <= int(t) && int(t) < maxLayerType { + d = ltMeta[int(t)].Decoder + } else { + d = ltMetaMap[t].Decoder + } + if d != nil { + return d.Decode(data, c) + } + return fmt.Errorf("Layer type %v has no associated decoder", t) +} + +// String returns the string associated with this layer type. +func (t LayerType) String() (s string) { + if 0 <= int(t) && int(t) < maxLayerType { + s = ltMeta[int(t)].Name + } else { + s = ltMetaMap[t].Name + } + if s == "" { + s = strconv.Itoa(int(t)) + } + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/macs/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/macs/doc.go new file mode 100644 index 00000000..c0d32a8c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/macs/doc.go @@ -0,0 +1,12 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// Package macs provides an in-memory mapping of all valid Ethernet MAC address +// prefixes to their associated organization. +// +// The ValidMACPrefixMap map maps 3-byte prefixes to organization strings. It +// can be updated using 'go run gen.go' in this directory. +package macs diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/macs/gen.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/macs/gen.go new file mode 100644 index 00000000..97776e04 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/macs/gen.go @@ -0,0 +1,78 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// +build ignore + +// This binary pulls the list of known MAC +// prefixes from IEEE and writes them out to a go file which is compiled +// into gopacket. It should be run as follows: +// +// go run gen.go | gofmt > valid_mac_prefixes.go +package main + +import ( + "bufio" + "encoding/hex" + "flag" + "fmt" + "io" + "net/http" + "os" + "regexp" + "time" +) + +const header = `// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package macs + +// Created by gen.go, don't edit manually +// Generated at %s +// Fetched from %q + +// ValidMACPrefixMap maps a valid MAC address prefix to the name of the +// organization that owns the rights to use it. We map it to a hidden +// variable so it won't show up in godoc, since it's a very large map. +var ValidMACPrefixMap map[[3]byte]string= validMACPrefixMap +var validMACPrefixMap = map[[3]byte]string{ +` + +var url = flag.String("url", "http://standards.ieee.org/develop/regauth/oui/oui.txt", "URL to fetch MACs from") + +func main() { + fmt.Fprintf(os.Stderr, "Fetching MACs from %q\n", *url) + resp, err := http.Get(*url) + if err != nil { + panic(err) + } + defer resp.Body.Close() + buffered := bufio.NewReader(resp.Body) + finder := regexp.MustCompile(`^\s*([0-9A-F]{6})\s+\(base 16\)\s+(.*)`) + fmt.Fprintln(os.Stderr, "Starting write to standard output") + fmt.Printf(header, time.Now(), *url) + for { + line, err := buffered.ReadString('\n') + if err == io.EOF { + break + } else if err != nil { + panic(err) + } + if matches := finder.FindStringSubmatch(line); matches != nil { + bytes := make([]byte, 3) + hex.Decode(bytes, []byte(matches[1])) + company := matches[2] + if company == "" { + company = "PRIVATE" + } + fmt.Printf("\t[3]byte{%d, %d, %d}: %q,\n", bytes[0], bytes[1], bytes[2], company) + } + } + fmt.Println("}") +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/macs/valid_mac_prefixes.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/macs/valid_mac_prefixes.go new file mode 100644 index 00000000..4afee40f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/macs/valid_mac_prefixes.go @@ -0,0 +1,19791 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package macs + +// Created by gen.go, don't edit manually +// Generated at 2014-09-09 10:01:58.097553511 -0600 MDT +// Fetched from "http://standards.ieee.org/develop/regauth/oui/oui.txt" + +// ValidMACPrefixMap maps a valid MAC address prefix to the name of the +// organization that owns the rights to use it. We map it to a hidden +// variable so it won't show up in godoc, since it's a very large map. +var ValidMACPrefixMap map[[3]byte]string = validMACPrefixMap +var validMACPrefixMap = map[[3]byte]string{ + [3]byte{0, 0, 0}: "XEROX CORPORATION", + [3]byte{0, 0, 1}: "XEROX CORPORATION", + [3]byte{0, 0, 2}: "XEROX CORPORATION", + [3]byte{0, 0, 3}: "XEROX CORPORATION", + [3]byte{0, 0, 4}: "XEROX CORPORATION", + [3]byte{0, 0, 5}: "XEROX CORPORATION", + [3]byte{0, 0, 6}: "XEROX CORPORATION", + [3]byte{0, 0, 7}: "XEROX CORPORATION", + [3]byte{0, 0, 8}: "XEROX CORPORATION", + [3]byte{0, 0, 9}: "XEROX CORPORATION", + [3]byte{0, 0, 10}: "OMRON TATEISI ELECTRONICS CO.", + [3]byte{0, 0, 11}: "MATRIX CORPORATION", + [3]byte{0, 0, 12}: "CISCO SYSTEMS, INC.", + [3]byte{0, 0, 13}: "FIBRONICS LTD.", + [3]byte{0, 0, 14}: "FUJITSU LIMITED", + [3]byte{0, 0, 15}: "NEXT, INC.", + [3]byte{0, 0, 16}: "SYTEK INC.", + [3]byte{0, 0, 17}: "NORMEREL SYSTEMES", + [3]byte{0, 0, 18}: "INFORMATION TECHNOLOGY LIMITED", + [3]byte{0, 0, 19}: "CAMEX", + [3]byte{0, 0, 20}: "NETRONIX", + [3]byte{0, 0, 21}: "DATAPOINT CORPORATION", + [3]byte{0, 0, 22}: "DU PONT PIXEL SYSTEMS .", + [3]byte{0, 0, 23}: "Oracle", + [3]byte{0, 0, 24}: "WEBSTER COMPUTER CORPORATION", + [3]byte{0, 0, 25}: "APPLIED DYNAMICS INTERNATIONAL", + [3]byte{0, 0, 26}: "ADVANCED MICRO DEVICES", + [3]byte{0, 0, 27}: "NOVELL INC.", + [3]byte{0, 0, 28}: "BELL TECHNOLOGIES", + [3]byte{0, 0, 29}: "CABLETRON SYSTEMS, INC.", + [3]byte{0, 0, 30}: "TELSIST INDUSTRIA ELECTRONICA", + [3]byte{0, 0, 31}: "Telco Systems, Inc.", + [3]byte{0, 0, 32}: "DATAINDUSTRIER DIAB AB", + [3]byte{0, 0, 33}: "SUREMAN COMP. & COMMUN. CORP.", + [3]byte{0, 0, 34}: "VISUAL TECHNOLOGY INC.", + [3]byte{0, 0, 35}: "ABB INDUSTRIAL SYSTEMS AB", + [3]byte{0, 0, 36}: "CONNECT AS", + [3]byte{0, 0, 37}: "RAMTEK CORP.", + [3]byte{0, 0, 38}: "SHA-KEN CO., LTD.", + [3]byte{0, 0, 39}: "JAPAN RADIO COMPANY", + [3]byte{0, 0, 40}: "PRODIGY SYSTEMS CORPORATION", + [3]byte{0, 0, 41}: "IMC NETWORKS CORP.", + [3]byte{0, 0, 42}: "TRW - SEDD/INP", + [3]byte{0, 0, 43}: "CRISP AUTOMATION, INC", + [3]byte{0, 0, 44}: "AUTOTOTE LIMITED", + [3]byte{0, 0, 45}: "CHROMATICS INC", + [3]byte{0, 0, 46}: "SOCIETE EVIRA", + [3]byte{0, 0, 47}: "TIMEPLEX INC.", + [3]byte{0, 0, 48}: "VG LABORATORY SYSTEMS LTD", + [3]byte{0, 0, 49}: "QPSX COMMUNICATIONS PTY LTD", + [3]byte{0, 0, 50}: "Marconi plc", + [3]byte{0, 0, 51}: "EGAN MACHINERY COMPANY", + [3]byte{0, 0, 52}: "NETWORK RESOURCES CORPORATION", + [3]byte{0, 0, 53}: "SPECTRAGRAPHICS CORPORATION", + [3]byte{0, 0, 54}: "ATARI CORPORATION", + [3]byte{0, 0, 55}: "OXFORD METRICS LIMITED", + [3]byte{0, 0, 56}: "CSS LABS", + [3]byte{0, 0, 57}: "TOSHIBA CORPORATION", + [3]byte{0, 0, 58}: "CHYRON CORPORATION", + [3]byte{0, 0, 59}: "i Controls, Inc.", + [3]byte{0, 0, 60}: "AUSPEX SYSTEMS INC.", + [3]byte{0, 0, 61}: "UNISYS", + [3]byte{0, 0, 62}: "SIMPACT", + [3]byte{0, 0, 63}: "SYNTREX, INC.", + [3]byte{0, 0, 64}: "APPLICON, INC.", + [3]byte{0, 0, 65}: "ICE CORPORATION", + [3]byte{0, 0, 66}: "METIER MANAGEMENT SYSTEMS LTD.", + [3]byte{0, 0, 67}: "MICRO TECHNOLOGY", + [3]byte{0, 0, 68}: "CASTELLE CORPORATION", + [3]byte{0, 0, 69}: "FORD AEROSPACE & COMM. CORP.", + [3]byte{0, 0, 70}: "OLIVETTI NORTH AMERICA", + [3]byte{0, 0, 71}: "NICOLET INSTRUMENTS CORP.", + [3]byte{0, 0, 72}: "SEIKO EPSON CORPORATION", + [3]byte{0, 0, 73}: "APRICOT COMPUTERS, LTD", + [3]byte{0, 0, 74}: "ADC CODENOLL TECHNOLOGY CORP.", + [3]byte{0, 0, 75}: "ICL DATA OY", + [3]byte{0, 0, 76}: "NEC CORPORATION", + [3]byte{0, 0, 77}: "DCI CORPORATION", + [3]byte{0, 0, 78}: "AMPEX CORPORATION", + [3]byte{0, 0, 79}: "LOGICRAFT, INC.", + [3]byte{0, 0, 80}: "RADISYS CORPORATION", + [3]byte{0, 0, 81}: "HOB ELECTRONIC GMBH & CO. KG", + [3]byte{0, 0, 82}: "Intrusion.com, Inc.", + [3]byte{0, 0, 83}: "COMPUCORP", + [3]byte{0, 0, 84}: "Schnieder Electric", + [3]byte{0, 0, 85}: "COMMISSARIAT A L`ENERGIE ATOM.", + [3]byte{0, 0, 86}: "DR. B. STRUCK", + [3]byte{0, 0, 87}: "SCITEX CORPORATION LTD.", + [3]byte{0, 0, 88}: "RACORE COMPUTER PRODUCTS INC.", + [3]byte{0, 0, 89}: "HELLIGE GMBH", + [3]byte{0, 0, 90}: "SysKonnect GmbH", + [3]byte{0, 0, 91}: "ELTEC ELEKTRONIK AG", + [3]byte{0, 0, 92}: "TELEMATICS INTERNATIONAL INC.", + [3]byte{0, 0, 93}: "CS TELECOM", + [3]byte{0, 0, 94}: "ICANN, IANA Department", + [3]byte{0, 0, 95}: "SUMITOMO ELECTRIC IND., LTD.", + [3]byte{0, 0, 96}: "KONTRON ELEKTRONIK GMBH", + [3]byte{0, 0, 97}: "GATEWAY COMMUNICATIONS", + [3]byte{0, 0, 98}: "BULL HN INFORMATION SYSTEMS", + [3]byte{0, 0, 99}: "BARCO CONTROL ROOMS GMBH", + [3]byte{0, 0, 100}: "Yokogawa Electric Corporation", + [3]byte{0, 0, 101}: "Network General Corporation", + [3]byte{0, 0, 102}: "TALARIS SYSTEMS, INC.", + [3]byte{0, 0, 103}: "SOFT * RITE, INC.", + [3]byte{0, 0, 104}: "ROSEMOUNT CONTROLS", + [3]byte{0, 0, 105}: "CONCORD COMMUNICATIONS INC", + [3]byte{0, 0, 106}: "COMPUTER CONSOLES INC.", + [3]byte{0, 0, 107}: "SILICON GRAPHICS INC./MIPS", + [3]byte{0, 0, 108}: "PRIVATE", + [3]byte{0, 0, 109}: "CRAY COMMUNICATIONS, LTD.", + [3]byte{0, 0, 110}: "ARTISOFT, INC.", + [3]byte{0, 0, 111}: "Madge Ltd.", + [3]byte{0, 0, 112}: "HCL LIMITED", + [3]byte{0, 0, 113}: "ADRA SYSTEMS INC.", + [3]byte{0, 0, 114}: "MINIWARE TECHNOLOGY", + [3]byte{0, 0, 115}: "SIECOR CORPORATION", + [3]byte{0, 0, 116}: "RICOH COMPANY LTD.", + [3]byte{0, 0, 117}: "Nortel Networks", + [3]byte{0, 0, 118}: "ABEKAS VIDEO SYSTEM", + [3]byte{0, 0, 119}: "INTERPHASE CORPORATION", + [3]byte{0, 0, 120}: "LABTAM LIMITED", + [3]byte{0, 0, 121}: "NETWORTH INCORPORATED", + [3]byte{0, 0, 122}: "DANA COMPUTER INC.", + [3]byte{0, 0, 123}: "RESEARCH MACHINES", + [3]byte{0, 0, 124}: "AMPERE INCORPORATED", + [3]byte{0, 0, 125}: "Oracle Corporation", + [3]byte{0, 0, 126}: "CLUSTRIX CORPORATION", + [3]byte{0, 0, 127}: "LINOTYPE-HELL AG", + [3]byte{0, 0, 128}: "CRAY COMMUNICATIONS A/S", + [3]byte{0, 0, 129}: "BAY NETWORKS", + [3]byte{0, 0, 130}: "LECTRA SYSTEMES SA", + [3]byte{0, 0, 131}: "TADPOLE TECHNOLOGY PLC", + [3]byte{0, 0, 132}: "SUPERNET", + [3]byte{0, 0, 133}: "CANON INC.", + [3]byte{0, 0, 134}: "MEGAHERTZ CORPORATION", + [3]byte{0, 0, 135}: "HITACHI, LTD.", + [3]byte{0, 0, 136}: "Brocade Communications Systems, Inc.", + [3]byte{0, 0, 137}: "CAYMAN SYSTEMS INC.", + [3]byte{0, 0, 138}: "DATAHOUSE INFORMATION SYSTEMS", + [3]byte{0, 0, 139}: "INFOTRON", + [3]byte{0, 0, 140}: "Alloy Computer Products (Australia) Pty Ltd", + [3]byte{0, 0, 141}: "Cryptek Inc.", + [3]byte{0, 0, 142}: "SOLBOURNE COMPUTER, INC.", + [3]byte{0, 0, 143}: "Raytheon", + [3]byte{0, 0, 144}: "MICROCOM", + [3]byte{0, 0, 145}: "ANRITSU CORPORATION", + [3]byte{0, 0, 146}: "COGENT DATA TECHNOLOGIES", + [3]byte{0, 0, 147}: "PROTEON INC.", + [3]byte{0, 0, 148}: "ASANTE TECHNOLOGIES", + [3]byte{0, 0, 149}: "SONY TEKTRONIX CORP.", + [3]byte{0, 0, 150}: "MARCONI ELECTRONICS LTD.", + [3]byte{0, 0, 151}: "EMC Corporation", + [3]byte{0, 0, 152}: "CROSSCOMM CORPORATION", + [3]byte{0, 0, 153}: "MTX, INC.", + [3]byte{0, 0, 154}: "RC COMPUTER A/S", + [3]byte{0, 0, 155}: "INFORMATION INTERNATIONAL, INC", + [3]byte{0, 0, 156}: "ROLM MIL-SPEC COMPUTERS", + [3]byte{0, 0, 157}: "LOCUS COMPUTING CORPORATION", + [3]byte{0, 0, 158}: "MARLI S.A.", + [3]byte{0, 0, 159}: "AMERISTAR TECHNOLOGIES INC.", + [3]byte{0, 0, 160}: "SANYO Electric Co., Ltd.", + [3]byte{0, 0, 161}: "MARQUETTE ELECTRIC CO.", + [3]byte{0, 0, 162}: "BAY NETWORKS", + [3]byte{0, 0, 163}: "NETWORK APPLICATION TECHNOLOGY", + [3]byte{0, 0, 164}: "ACORN COMPUTERS LIMITED", + [3]byte{0, 0, 165}: "Tattile SRL", + [3]byte{0, 0, 166}: "NETWORK GENERAL CORPORATION", + [3]byte{0, 0, 167}: "NETWORK COMPUTING DEVICES INC.", + [3]byte{0, 0, 168}: "STRATUS COMPUTER INC.", + [3]byte{0, 0, 169}: "NETWORK SYSTEMS CORP.", + [3]byte{0, 0, 170}: "XEROX CORPORATION", + [3]byte{0, 0, 171}: "LOGIC MODELING CORPORATION", + [3]byte{0, 0, 172}: "CONWARE COMPUTER CONSULTING", + [3]byte{0, 0, 173}: "BRUKER INSTRUMENTS INC.", + [3]byte{0, 0, 174}: "DASSAULT ELECTRONIQUE", + [3]byte{0, 0, 175}: "NUCLEAR DATA INSTRUMENTATION", + [3]byte{0, 0, 176}: "RND-RAD NETWORK DEVICES", + [3]byte{0, 0, 177}: "ALPHA MICROSYSTEMS INC.", + [3]byte{0, 0, 178}: "TELEVIDEO SYSTEMS, INC.", + [3]byte{0, 0, 179}: "CIMLINC INCORPORATED", + [3]byte{0, 0, 180}: "EDIMAX COMPUTER COMPANY", + [3]byte{0, 0, 181}: "DATABILITY SOFTWARE SYS. INC.", + [3]byte{0, 0, 182}: "MICRO-MATIC RESEARCH", + [3]byte{0, 0, 183}: "DOVE COMPUTER CORPORATION", + [3]byte{0, 0, 184}: "SEIKOSHA CO., LTD.", + [3]byte{0, 0, 185}: "MCDONNELL DOUGLAS COMPUTER SYS", + [3]byte{0, 0, 186}: "SIIG, INC.", + [3]byte{0, 0, 187}: "TRI-DATA", + [3]byte{0, 0, 188}: "Rockwell Automation", + [3]byte{0, 0, 189}: "MITSUBISHI CABLE COMPANY", + [3]byte{0, 0, 190}: "THE NTI GROUP", + [3]byte{0, 0, 191}: "SYMMETRIC COMPUTER SYSTEMS", + [3]byte{0, 0, 192}: "WESTERN DIGITAL CORPORATION", + [3]byte{0, 0, 193}: "Madge Ltd.", + [3]byte{0, 0, 194}: "INFORMATION PRESENTATION TECH.", + [3]byte{0, 0, 195}: "HARRIS CORP COMPUTER SYS DIV", + [3]byte{0, 0, 196}: "WATERS DIV. OF MILLIPORE", + [3]byte{0, 0, 197}: "FARALLON COMPUTING/NETOPIA", + [3]byte{0, 0, 198}: "EON SYSTEMS", + [3]byte{0, 0, 199}: "ARIX CORPORATION", + [3]byte{0, 0, 200}: "ALTOS COMPUTER SYSTEMS", + [3]byte{0, 0, 201}: "Emulex Corporation", + [3]byte{0, 0, 202}: "ARRIS International", + [3]byte{0, 0, 203}: "COMPU-SHACK ELECTRONIC GMBH", + [3]byte{0, 0, 204}: "DENSAN CO., LTD.", + [3]byte{0, 0, 205}: "Allied Telesis Labs Ltd", + [3]byte{0, 0, 206}: "MEGADATA CORP.", + [3]byte{0, 0, 207}: "HAYES MICROCOMPUTER PRODUCTS", + [3]byte{0, 0, 208}: "DEVELCON ELECTRONICS LTD.", + [3]byte{0, 0, 209}: "ADAPTEC INCORPORATED", + [3]byte{0, 0, 210}: "SBE, INC.", + [3]byte{0, 0, 211}: "WANG LABORATORIES INC.", + [3]byte{0, 0, 212}: "PURE DATA LTD.", + [3]byte{0, 0, 213}: "MICROGNOSIS INTERNATIONAL", + [3]byte{0, 0, 214}: "PUNCH LINE HOLDING", + [3]byte{0, 0, 215}: "DARTMOUTH COLLEGE", + [3]byte{0, 0, 216}: "NOVELL, INC.", + [3]byte{0, 0, 217}: "NIPPON TELEGRAPH & TELEPHONE", + [3]byte{0, 0, 218}: "ATEX", + [3]byte{0, 0, 219}: "British Telecommunications plc", + [3]byte{0, 0, 220}: "HAYES MICROCOMPUTER PRODUCTS", + [3]byte{0, 0, 221}: "TCL INCORPORATED", + [3]byte{0, 0, 222}: "CETIA", + [3]byte{0, 0, 223}: "BELL & HOWELL PUB SYS DIV", + [3]byte{0, 0, 224}: "QUADRAM CORP.", + [3]byte{0, 0, 225}: "GRID SYSTEMS", + [3]byte{0, 0, 226}: "ACER TECHNOLOGIES CORP.", + [3]byte{0, 0, 227}: "INTEGRATED MICRO PRODUCTS LTD", + [3]byte{0, 0, 228}: "IN2 GROUPE INTERTECHNIQUE", + [3]byte{0, 0, 229}: "SIGMEX LTD.", + [3]byte{0, 0, 230}: "APTOR PRODUITS DE COMM INDUST", + [3]byte{0, 0, 231}: "STAR GATE TECHNOLOGIES", + [3]byte{0, 0, 232}: "ACCTON TECHNOLOGY CORP.", + [3]byte{0, 0, 233}: "ISICAD, INC.", + [3]byte{0, 0, 234}: "UPNOD AB", + [3]byte{0, 0, 235}: "MATSUSHITA COMM. IND. CO. LTD.", + [3]byte{0, 0, 236}: "MICROPROCESS", + [3]byte{0, 0, 237}: "APRIL", + [3]byte{0, 0, 238}: "NETWORK DESIGNERS, LTD.", + [3]byte{0, 0, 239}: "KTI", + [3]byte{0, 0, 240}: "SAMSUNG ELECTRONICS CO., LTD.", + [3]byte{0, 0, 241}: "MAGNA COMPUTER CORPORATION", + [3]byte{0, 0, 242}: "SPIDER COMMUNICATIONS", + [3]byte{0, 0, 243}: "GANDALF DATA LIMITED", + [3]byte{0, 0, 244}: "Allied Telesis", + [3]byte{0, 0, 245}: "DIAMOND SALES LIMITED", + [3]byte{0, 0, 246}: "APPLIED MICROSYSTEMS CORP.", + [3]byte{0, 0, 247}: "YOUTH KEEP ENTERPRISE CO LTD", + [3]byte{0, 0, 248}: "DIGITAL EQUIPMENT CORPORATION", + [3]byte{0, 0, 249}: "QUOTRON SYSTEMS INC.", + [3]byte{0, 0, 250}: "MICROSAGE COMPUTER SYSTEMS INC", + [3]byte{0, 0, 251}: "RECHNER ZUR KOMMUNIKATION", + [3]byte{0, 0, 252}: "MEIKO", + [3]byte{0, 0, 253}: "HIGH LEVEL HARDWARE", + [3]byte{0, 0, 254}: "ANNAPOLIS MICRO SYSTEMS", + [3]byte{0, 0, 255}: "CAMTEC ELECTRONICS LTD.", + [3]byte{0, 1, 0}: "EQUIP'TRANS", + [3]byte{0, 1, 1}: "PRIVATE", + [3]byte{0, 1, 2}: "3COM CORPORATION", + [3]byte{0, 1, 3}: "3COM CORPORATION", + [3]byte{0, 1, 4}: "DVICO Co., Ltd.", + [3]byte{0, 1, 5}: "Beckhoff Automation GmbH", + [3]byte{0, 1, 6}: "Tews Datentechnik GmbH", + [3]byte{0, 1, 7}: "Leiser GmbH", + [3]byte{0, 1, 8}: "AVLAB Technology, Inc.", + [3]byte{0, 1, 9}: "Nagano Japan Radio Co., Ltd.", + [3]byte{0, 1, 10}: "CIS TECHNOLOGY INC.", + [3]byte{0, 1, 11}: "Space CyberLink, Inc.", + [3]byte{0, 1, 12}: "System Talks Inc.", + [3]byte{0, 1, 13}: "CORECO, INC.", + [3]byte{0, 1, 14}: "Bri-Link Technologies Co., Ltd", + [3]byte{0, 1, 15}: "Brocade Communications Systems, Inc.", + [3]byte{0, 1, 16}: "Gotham Networks", + [3]byte{0, 1, 17}: "iDigm Inc.", + [3]byte{0, 1, 18}: "Shark Multimedia Inc.", + [3]byte{0, 1, 19}: "OLYMPUS CORPORATION", + [3]byte{0, 1, 20}: "KANDA TSUSHIN KOGYO CO., LTD.", + [3]byte{0, 1, 21}: "EXTRATECH CORPORATION", + [3]byte{0, 1, 22}: "Netspect Technologies, Inc.", + [3]byte{0, 1, 23}: "CANAL +", + [3]byte{0, 1, 24}: "EZ Digital Co., Ltd.", + [3]byte{0, 1, 25}: "RTUnet (Australia)", + [3]byte{0, 1, 26}: "Hoffmann und Burmeister GbR", + [3]byte{0, 1, 27}: "Unizone Technologies, Inc.", + [3]byte{0, 1, 28}: "Universal Talkware Corporation", + [3]byte{0, 1, 29}: "Centillium Communications", + [3]byte{0, 1, 30}: "Precidia Technologies, Inc.", + [3]byte{0, 1, 31}: "RC Networks, Inc.", + [3]byte{0, 1, 32}: "OSCILLOQUARTZ S.A.", + [3]byte{0, 1, 33}: "Watchguard Technologies, Inc.", + [3]byte{0, 1, 34}: "Trend Communications, Ltd.", + [3]byte{0, 1, 35}: "DIGITAL ELECTRONICS CORP.", + [3]byte{0, 1, 36}: "Acer Incorporated", + [3]byte{0, 1, 37}: "YAESU MUSEN CO., LTD.", + [3]byte{0, 1, 38}: "PAC Labs", + [3]byte{0, 1, 39}: "OPEN Networks Pty Ltd", + [3]byte{0, 1, 40}: "EnjoyWeb, Inc.", + [3]byte{0, 1, 41}: "DFI Inc.", + [3]byte{0, 1, 42}: "Telematica Sistems Inteligente", + [3]byte{0, 1, 43}: "TELENET Co., Ltd.", + [3]byte{0, 1, 44}: "Aravox Technologies, Inc.", + [3]byte{0, 1, 45}: "Komodo Technology", + [3]byte{0, 1, 46}: "PC Partner Ltd.", + [3]byte{0, 1, 47}: "Twinhead International Corp", + [3]byte{0, 1, 48}: "Extreme Networks", + [3]byte{0, 1, 49}: "Bosch Security Systems, Inc.", + [3]byte{0, 1, 50}: "Dranetz - BMI", + [3]byte{0, 1, 51}: "KYOWA Electronic Instruments C", + [3]byte{0, 1, 52}: "Selectron Systems AG", + [3]byte{0, 1, 53}: "KDC Corp.", + [3]byte{0, 1, 54}: "CyberTAN Technology, Inc.", + [3]byte{0, 1, 55}: "IT Farm Corporation", + [3]byte{0, 1, 56}: "XAVi Technologies Corp.", + [3]byte{0, 1, 57}: "Point Multimedia Systems", + [3]byte{0, 1, 58}: "SHELCAD COMMUNICATIONS, LTD.", + [3]byte{0, 1, 59}: "BNA SYSTEMS", + [3]byte{0, 1, 60}: "TIW SYSTEMS", + [3]byte{0, 1, 61}: "RiscStation Ltd.", + [3]byte{0, 1, 62}: "Ascom Tateco AB", + [3]byte{0, 1, 63}: "Neighbor World Co., Ltd.", + [3]byte{0, 1, 64}: "Sendtek Corporation", + [3]byte{0, 1, 65}: "CABLE PRINT", + [3]byte{0, 1, 66}: "CISCO SYSTEMS, INC.", + [3]byte{0, 1, 67}: "CISCO SYSTEMS, INC.", + [3]byte{0, 1, 68}: "EMC Corporation", + [3]byte{0, 1, 69}: "WINSYSTEMS, INC.", + [3]byte{0, 1, 70}: "Tesco Controls, Inc.", + [3]byte{0, 1, 71}: "Zhone Technologies", + [3]byte{0, 1, 72}: "X-traWeb Inc.", + [3]byte{0, 1, 73}: "T.D.T. Transfer Data Test GmbH", + [3]byte{0, 1, 74}: "Sony Corporation", + [3]byte{0, 1, 75}: "Ennovate Networks, Inc.", + [3]byte{0, 1, 76}: "Berkeley Process Control", + [3]byte{0, 1, 77}: "Shin Kin Enterprises Co., Ltd", + [3]byte{0, 1, 78}: "WIN Enterprises, Inc.", + [3]byte{0, 1, 79}: "ADTRAN INC", + [3]byte{0, 1, 80}: "GILAT COMMUNICATIONS, LTD.", + [3]byte{0, 1, 81}: "Ensemble Communications", + [3]byte{0, 1, 82}: "CHROMATEK INC.", + [3]byte{0, 1, 83}: "ARCHTEK TELECOM CORPORATION", + [3]byte{0, 1, 84}: "G3M Corporation", + [3]byte{0, 1, 85}: "Promise Technology, Inc.", + [3]byte{0, 1, 86}: "FIREWIREDIRECT.COM, INC.", + [3]byte{0, 1, 87}: "SYSWAVE CO., LTD", + [3]byte{0, 1, 88}: "Electro Industries/Gauge Tech", + [3]byte{0, 1, 89}: "S1 Corporation", + [3]byte{0, 1, 90}: "Digital Video Broadcasting", + [3]byte{0, 1, 91}: "ITALTEL S.p.A/RF-UP-I", + [3]byte{0, 1, 92}: "CADANT INC.", + [3]byte{0, 1, 93}: "Oracle Corporation", + [3]byte{0, 1, 94}: "BEST TECHNOLOGY CO., LTD.", + [3]byte{0, 1, 95}: "DIGITAL DESIGN GmbH", + [3]byte{0, 1, 96}: "ELMEX Co., LTD.", + [3]byte{0, 1, 97}: "Meta Machine Technology", + [3]byte{0, 1, 98}: "Cygnet Technologies, Inc.", + [3]byte{0, 1, 99}: "CISCO SYSTEMS, INC.", + [3]byte{0, 1, 100}: "CISCO SYSTEMS, INC.", + [3]byte{0, 1, 101}: "AirSwitch Corporation", + [3]byte{0, 1, 102}: "TC GROUP A/S", + [3]byte{0, 1, 103}: "HIOKI E.E. CORPORATION", + [3]byte{0, 1, 104}: "VITANA CORPORATION", + [3]byte{0, 1, 105}: "Celestix Networks Pte Ltd.", + [3]byte{0, 1, 106}: "ALITEC", + [3]byte{0, 1, 107}: "LightChip, Inc.", + [3]byte{0, 1, 108}: "FOXCONN", + [3]byte{0, 1, 109}: "CarrierComm Inc.", + [3]byte{0, 1, 110}: "Conklin Corporation", + [3]byte{0, 1, 111}: "Inkel Corp.", + [3]byte{0, 1, 112}: "ESE Embedded System Engineer'g", + [3]byte{0, 1, 113}: "Allied Data Technologies", + [3]byte{0, 1, 114}: "TechnoLand Co., LTD.", + [3]byte{0, 1, 115}: "AMCC", + [3]byte{0, 1, 116}: "CyberOptics Corporation", + [3]byte{0, 1, 117}: "Radiant Communications Corp.", + [3]byte{0, 1, 118}: "Orient Silver Enterprises", + [3]byte{0, 1, 119}: "EDSL", + [3]byte{0, 1, 120}: "MARGI Systems, Inc.", + [3]byte{0, 1, 121}: "WIRELESS TECHNOLOGY, INC.", + [3]byte{0, 1, 122}: "Chengdu Maipu Electric Industrial Co., Ltd.", + [3]byte{0, 1, 123}: "Heidelberger Druckmaschinen AG", + [3]byte{0, 1, 124}: "AG-E GmbH", + [3]byte{0, 1, 125}: "ThermoQuest", + [3]byte{0, 1, 126}: "ADTEK System Science Co., Ltd.", + [3]byte{0, 1, 127}: "Experience Music Project", + [3]byte{0, 1, 128}: "AOpen, Inc.", + [3]byte{0, 1, 129}: "Nortel Networks", + [3]byte{0, 1, 130}: "DICA TECHNOLOGIES AG", + [3]byte{0, 1, 131}: "ANITE TELECOMS", + [3]byte{0, 1, 132}: "SIEB & MEYER AG", + [3]byte{0, 1, 133}: "Hitachi Aloka Medical, Ltd.", + [3]byte{0, 1, 134}: "Uwe Disch", + [3]byte{0, 1, 135}: "I2SE GmbH", + [3]byte{0, 1, 136}: "LXCO Technologies ag", + [3]byte{0, 1, 137}: "Refraction Technology, Inc.", + [3]byte{0, 1, 138}: "ROI COMPUTER AG", + [3]byte{0, 1, 139}: "NetLinks Co., Ltd.", + [3]byte{0, 1, 140}: "Mega Vision", + [3]byte{0, 1, 141}: "AudeSi Technologies", + [3]byte{0, 1, 142}: "Logitec Corporation", + [3]byte{0, 1, 143}: "Kenetec, Inc.", + [3]byte{0, 1, 144}: "SMK-M", + [3]byte{0, 1, 145}: "SYRED Data Systems", + [3]byte{0, 1, 146}: "Texas Digital Systems", + [3]byte{0, 1, 147}: "Hanbyul Telecom Co., Ltd.", + [3]byte{0, 1, 148}: "Capital Equipment Corporation", + [3]byte{0, 1, 149}: "Sena Technologies, Inc.", + [3]byte{0, 1, 150}: "CISCO SYSTEMS, INC.", + [3]byte{0, 1, 151}: "CISCO SYSTEMS, INC.", + [3]byte{0, 1, 152}: "Darim Vision", + [3]byte{0, 1, 153}: "HeiSei Electronics", + [3]byte{0, 1, 154}: "LEUNIG GmbH", + [3]byte{0, 1, 155}: "Kyoto Microcomputer Co., Ltd.", + [3]byte{0, 1, 156}: "JDS Uniphase Inc.", + [3]byte{0, 1, 157}: "E-Control Systems, Inc.", + [3]byte{0, 1, 158}: "ESS Technology, Inc.", + [3]byte{0, 1, 159}: "ReadyNet", + [3]byte{0, 1, 160}: "Infinilink Corporation", + [3]byte{0, 1, 161}: "Mag-Tek, Inc.", + [3]byte{0, 1, 162}: "Logical Co., Ltd.", + [3]byte{0, 1, 163}: "GENESYS LOGIC, INC.", + [3]byte{0, 1, 164}: "Microlink Corporation", + [3]byte{0, 1, 165}: "Nextcomm, Inc.", + [3]byte{0, 1, 166}: "Scientific-Atlanta Arcodan A/S", + [3]byte{0, 1, 167}: "UNEX TECHNOLOGY CORPORATION", + [3]byte{0, 1, 168}: "Welltech Computer Co., Ltd.", + [3]byte{0, 1, 169}: "BMW AG", + [3]byte{0, 1, 170}: "Airspan Communications, Ltd.", + [3]byte{0, 1, 171}: "Main Street Networks", + [3]byte{0, 1, 172}: "Sitara Networks, Inc.", + [3]byte{0, 1, 173}: "Coach Master International d.b.a. CMI Worldwide, Inc.", + [3]byte{0, 1, 174}: "Trex Enterprises", + [3]byte{0, 1, 175}: "Artesyn Embedded Technologies", + [3]byte{0, 1, 176}: "Fulltek Technology Co., Ltd.", + [3]byte{0, 1, 177}: "General Bandwidth", + [3]byte{0, 1, 178}: "Digital Processing Systems, Inc.", + [3]byte{0, 1, 179}: "Precision Electronic Manufacturing", + [3]byte{0, 1, 180}: "Wayport, Inc.", + [3]byte{0, 1, 181}: "Turin Networks, Inc.", + [3]byte{0, 1, 182}: "SAEJIN T&M Co., Ltd.", + [3]byte{0, 1, 183}: "Centos, Inc.", + [3]byte{0, 1, 184}: "Netsensity, Inc.", + [3]byte{0, 1, 185}: "SKF Condition Monitoring", + [3]byte{0, 1, 186}: "IC-Net, Inc.", + [3]byte{0, 1, 187}: "Frequentis", + [3]byte{0, 1, 188}: "Brains Corporation", + [3]byte{0, 1, 189}: "Peterson Electro-Musical Products, Inc.", + [3]byte{0, 1, 190}: "Gigalink Co., Ltd.", + [3]byte{0, 1, 191}: "Teleforce Co., Ltd.", + [3]byte{0, 1, 192}: "CompuLab, Ltd.", + [3]byte{0, 1, 193}: "Vitesse Semiconductor Corporation", + [3]byte{0, 1, 194}: "ARK Research Corp.", + [3]byte{0, 1, 195}: "Acromag, Inc.", + [3]byte{0, 1, 196}: "NeoWave, Inc.", + [3]byte{0, 1, 197}: "Simpler Networks", + [3]byte{0, 1, 198}: "Quarry Technologies", + [3]byte{0, 1, 199}: "CISCO SYSTEMS, INC.", + [3]byte{0, 1, 200}: "THOMAS CONRAD CORP.", + [3]byte{0, 1, 200}: "CONRAD CORP.", + [3]byte{0, 1, 201}: "CISCO SYSTEMS, INC.", + [3]byte{0, 1, 202}: "Geocast Network Systems, Inc.", + [3]byte{0, 1, 203}: "EVR", + [3]byte{0, 1, 204}: "Japan Total Design Communication Co., Ltd.", + [3]byte{0, 1, 205}: "ARtem", + [3]byte{0, 1, 206}: "Custom Micro Products, Ltd.", + [3]byte{0, 1, 207}: "Alpha Data Parallel Systems, Ltd.", + [3]byte{0, 1, 208}: "VitalPoint, Inc.", + [3]byte{0, 1, 209}: "CoNet Communications, Inc.", + [3]byte{0, 1, 210}: "inXtron, Inc.", + [3]byte{0, 1, 211}: "PAXCOMM, Inc.", + [3]byte{0, 1, 212}: "Leisure Time, Inc.", + [3]byte{0, 1, 213}: "HAEDONG INFO & COMM CO., LTD", + [3]byte{0, 1, 214}: "manroland AG", + [3]byte{0, 1, 215}: "F5 Networks, Inc.", + [3]byte{0, 1, 216}: "Teltronics, Inc.", + [3]byte{0, 1, 217}: "Sigma, Inc.", + [3]byte{0, 1, 218}: "WINCOMM Corporation", + [3]byte{0, 1, 219}: "Freecom Technologies GmbH", + [3]byte{0, 1, 220}: "Activetelco", + [3]byte{0, 1, 221}: "Avail Networks", + [3]byte{0, 1, 222}: "Trango Systems, Inc.", + [3]byte{0, 1, 223}: "ISDN Communications, Ltd.", + [3]byte{0, 1, 224}: "Fast Systems, Inc.", + [3]byte{0, 1, 225}: "Kinpo Electronics, Inc.", + [3]byte{0, 1, 226}: "Ando Electric Corporation", + [3]byte{0, 1, 227}: "Siemens AG", + [3]byte{0, 1, 228}: "Sitera, Inc.", + [3]byte{0, 1, 229}: "Supernet, Inc.", + [3]byte{0, 1, 230}: "Hewlett-Packard Company", + [3]byte{0, 1, 231}: "Hewlett-Packard Company", + [3]byte{0, 1, 232}: "Force10 Networks, Inc.", + [3]byte{0, 1, 233}: "Litton Marine Systems B.V.", + [3]byte{0, 1, 234}: "Cirilium Corp.", + [3]byte{0, 1, 235}: "C-COM Corporation", + [3]byte{0, 1, 236}: "Ericsson Group", + [3]byte{0, 1, 237}: "SETA Corp.", + [3]byte{0, 1, 238}: "Comtrol Europe, Ltd.", + [3]byte{0, 1, 239}: "Camtel Technology Corp.", + [3]byte{0, 1, 240}: "Tridium, Inc.", + [3]byte{0, 1, 241}: "Innovative Concepts, Inc.", + [3]byte{0, 1, 242}: "Mark of the Unicorn, Inc.", + [3]byte{0, 1, 243}: "QPS, Inc.", + [3]byte{0, 1, 244}: "Enterasys Networks", + [3]byte{0, 1, 245}: "ERIM S.A.", + [3]byte{0, 1, 246}: "Association of Musical Electronics Industry", + [3]byte{0, 1, 247}: "Image Display Systems, Inc.", + [3]byte{0, 1, 248}: "Texio Technology Corporation", + [3]byte{0, 1, 249}: "TeraGlobal Communications Corp.", + [3]byte{0, 1, 250}: "HOROSCAS", + [3]byte{0, 1, 251}: "DoTop Technology, Inc.", + [3]byte{0, 1, 252}: "Keyence Corporation", + [3]byte{0, 1, 253}: "Digital Voice Systems, Inc.", + [3]byte{0, 1, 254}: "DIGITAL EQUIPMENT CORPORATION", + [3]byte{0, 1, 255}: "Data Direct Networks, Inc.", + [3]byte{0, 2, 0}: "Net & Sys Co., Ltd.", + [3]byte{0, 2, 1}: "IFM Electronic gmbh", + [3]byte{0, 2, 2}: "Amino Communications, Ltd.", + [3]byte{0, 2, 3}: "Woonsang Telecom, Inc.", + [3]byte{0, 2, 4}: "Bodmann Industries Elektronik GmbH", + [3]byte{0, 2, 5}: "Hitachi Denshi, Ltd.", + [3]byte{0, 2, 6}: "Telital R&D Denmark A/S", + [3]byte{0, 2, 7}: "VisionGlobal Network Corp.", + [3]byte{0, 2, 8}: "Unify Networks, Inc.", + [3]byte{0, 2, 9}: "Shenzhen SED Information Technology Co., Ltd.", + [3]byte{0, 2, 10}: "Gefran Spa", + [3]byte{0, 2, 11}: "Native Networks, Inc.", + [3]byte{0, 2, 12}: "Metro-Optix", + [3]byte{0, 2, 13}: "Micronpc.com", + [3]byte{0, 2, 14}: "ECI Telecom, Ltd", + [3]byte{0, 2, 15}: "AATR", + [3]byte{0, 2, 16}: "Fenecom", + [3]byte{0, 2, 17}: "Nature Worldwide Technology Corp.", + [3]byte{0, 2, 18}: "SierraCom", + [3]byte{0, 2, 19}: "S.D.E.L.", + [3]byte{0, 2, 20}: "DTVRO", + [3]byte{0, 2, 21}: "Cotas Computer Technology A/B", + [3]byte{0, 2, 22}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 23}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 24}: "Advanced Scientific Corp", + [3]byte{0, 2, 25}: "Paralon Technologies", + [3]byte{0, 2, 26}: "Zuma Networks", + [3]byte{0, 2, 27}: "Kollmorgen-Servotronix", + [3]byte{0, 2, 28}: "Network Elements, Inc.", + [3]byte{0, 2, 29}: "Data General Communication Ltd.", + [3]byte{0, 2, 30}: "SIMTEL S.R.L.", + [3]byte{0, 2, 31}: "Aculab PLC", + [3]byte{0, 2, 32}: "CANON FINETECH INC.", + [3]byte{0, 2, 33}: "DSP Application, Ltd.", + [3]byte{0, 2, 34}: "Chromisys, Inc.", + [3]byte{0, 2, 35}: "ClickTV", + [3]byte{0, 2, 36}: "C-COR", + [3]byte{0, 2, 37}: "One Stop Systems", + [3]byte{0, 2, 38}: "XESystems, Inc.", + [3]byte{0, 2, 39}: "ESD Electronic System Design GmbH", + [3]byte{0, 2, 40}: "Necsom, Ltd.", + [3]byte{0, 2, 41}: "Adtec Corporation", + [3]byte{0, 2, 42}: "Asound Electronic", + [3]byte{0, 2, 43}: "SAXA, Inc.", + [3]byte{0, 2, 44}: "ABB Bomem, Inc.", + [3]byte{0, 2, 45}: "Agere Systems", + [3]byte{0, 2, 46}: "TEAC Corp. R& D", + [3]byte{0, 2, 47}: "P-Cube, Ltd.", + [3]byte{0, 2, 48}: "Intersoft Electronics", + [3]byte{0, 2, 49}: "Ingersoll-Rand", + [3]byte{0, 2, 50}: "Avision, Inc.", + [3]byte{0, 2, 51}: "Mantra Communications, Inc.", + [3]byte{0, 2, 52}: "Imperial Technology, Inc.", + [3]byte{0, 2, 53}: "Paragon Networks International", + [3]byte{0, 2, 54}: "INIT GmbH", + [3]byte{0, 2, 55}: "Cosmo Research Corp.", + [3]byte{0, 2, 56}: "Serome Technology, Inc.", + [3]byte{0, 2, 57}: "Visicom", + [3]byte{0, 2, 58}: "ZSK Stickmaschinen GmbH", + [3]byte{0, 2, 59}: "Ericsson", + [3]byte{0, 2, 60}: "Creative Technology, Ltd.", + [3]byte{0, 2, 61}: "Cisco Systems, Inc.", + [3]byte{0, 2, 62}: "Selta Telematica S.p.a", + [3]byte{0, 2, 63}: "Compal Electronics, Inc.", + [3]byte{0, 2, 64}: "Seedek Co., Ltd.", + [3]byte{0, 2, 65}: "Amer.com", + [3]byte{0, 2, 66}: "Videoframe Systems", + [3]byte{0, 2, 67}: "Raysis Co., Ltd.", + [3]byte{0, 2, 68}: "SURECOM Technology Co.", + [3]byte{0, 2, 69}: "Lampus Co, Ltd.", + [3]byte{0, 2, 70}: "All-Win Tech Co., Ltd.", + [3]byte{0, 2, 71}: "Great Dragon Information Technology (Group) Co., Ltd.", + [3]byte{0, 2, 72}: "Pilz GmbH & Co.", + [3]byte{0, 2, 73}: "Aviv Infocom Co, Ltd.", + [3]byte{0, 2, 74}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 75}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 76}: "SiByte, Inc.", + [3]byte{0, 2, 77}: "Mannesman Dematic Colby Pty. Ltd.", + [3]byte{0, 2, 78}: "Datacard Group", + [3]byte{0, 2, 79}: "IPM Datacom S.R.L.", + [3]byte{0, 2, 80}: "Geyser Networks, Inc.", + [3]byte{0, 2, 81}: "Soma Networks, Inc.", + [3]byte{0, 2, 82}: "Carrier Corporation", + [3]byte{0, 2, 83}: "Televideo, Inc.", + [3]byte{0, 2, 84}: "WorldGate", + [3]byte{0, 2, 85}: "IBM Corp", + [3]byte{0, 2, 86}: "Alpha Processor, Inc.", + [3]byte{0, 2, 87}: "Microcom Corp.", + [3]byte{0, 2, 88}: "Flying Packets Communications", + [3]byte{0, 2, 89}: "Tsann Kuen China (Shanghai)Enterprise Co., Ltd. IT Group", + [3]byte{0, 2, 90}: "Catena Networks", + [3]byte{0, 2, 91}: "Cambridge Silicon Radio", + [3]byte{0, 2, 92}: "SCI Systems (Kunshan) Co., Ltd.", + [3]byte{0, 2, 93}: "Calix Networks", + [3]byte{0, 2, 94}: "High Technology Ltd", + [3]byte{0, 2, 95}: "Nortel Networks", + [3]byte{0, 2, 96}: "Accordion Networks, Inc.", + [3]byte{0, 2, 97}: "Tilgin AB", + [3]byte{0, 2, 98}: "Soyo Group Soyo Com Tech Co., Ltd", + [3]byte{0, 2, 99}: "UPS Manufacturing SRL", + [3]byte{0, 2, 100}: "AudioRamp.com", + [3]byte{0, 2, 101}: "Virditech Co. Ltd.", + [3]byte{0, 2, 102}: "Thermalogic Corporation", + [3]byte{0, 2, 103}: "NODE RUNNER, INC.", + [3]byte{0, 2, 104}: "Harris Government Communications", + [3]byte{0, 2, 105}: "Nadatel Co., Ltd", + [3]byte{0, 2, 106}: "Cocess Telecom Co., Ltd.", + [3]byte{0, 2, 107}: "BCM Computers Co., Ltd.", + [3]byte{0, 2, 108}: "Philips CFT", + [3]byte{0, 2, 109}: "Adept Telecom", + [3]byte{0, 2, 110}: "NeGeN Access, Inc.", + [3]byte{0, 2, 111}: "Senao International Co., Ltd.", + [3]byte{0, 2, 112}: "Crewave Co., Ltd.", + [3]byte{0, 2, 113}: "Zhone Technologies", + [3]byte{0, 2, 114}: "CC&C Technologies, Inc.", + [3]byte{0, 2, 115}: "Coriolis Networks", + [3]byte{0, 2, 116}: "Tommy Technologies Corp.", + [3]byte{0, 2, 117}: "SMART Technologies, Inc.", + [3]byte{0, 2, 118}: "Primax Electronics Ltd.", + [3]byte{0, 2, 119}: "Cash Systemes Industrie", + [3]byte{0, 2, 120}: "Samsung Electro-Mechanics Co., Ltd.", + [3]byte{0, 2, 121}: "Control Applications, Ltd.", + [3]byte{0, 2, 122}: "IOI Technology Corporation", + [3]byte{0, 2, 123}: "Amplify Net, Inc.", + [3]byte{0, 2, 124}: "Trilithic, Inc.", + [3]byte{0, 2, 125}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 126}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 127}: "ask-technologies.com", + [3]byte{0, 2, 128}: "Mu Net, Inc.", + [3]byte{0, 2, 129}: "Madge Ltd.", + [3]byte{0, 2, 130}: "ViaClix, Inc.", + [3]byte{0, 2, 131}: "Spectrum Controls, Inc.", + [3]byte{0, 2, 132}: "AREVA T&D", + [3]byte{0, 2, 133}: "Riverstone Networks", + [3]byte{0, 2, 134}: "Occam Networks", + [3]byte{0, 2, 135}: "Adapcom", + [3]byte{0, 2, 136}: "GLOBAL VILLAGE COMMUNICATION", + [3]byte{0, 2, 137}: "DNE Technologies", + [3]byte{0, 2, 138}: "Ambit Microsystems Corporation", + [3]byte{0, 2, 139}: "VDSL Systems OY", + [3]byte{0, 2, 140}: "Micrel-Synergy Semiconductor", + [3]byte{0, 2, 141}: "Movita Technologies, Inc.", + [3]byte{0, 2, 142}: "Rapid 5 Networks, Inc.", + [3]byte{0, 2, 143}: "Globetek, Inc.", + [3]byte{0, 2, 144}: "Woorigisool, Inc.", + [3]byte{0, 2, 145}: "Open Network Co., Ltd.", + [3]byte{0, 2, 146}: "Logic Innovations, Inc.", + [3]byte{0, 2, 147}: "Solid Data Systems", + [3]byte{0, 2, 148}: "Tokyo Sokushin Co., Ltd.", + [3]byte{0, 2, 149}: "IP.Access Limited", + [3]byte{0, 2, 150}: "Lectron Co,. Ltd.", + [3]byte{0, 2, 151}: "C-COR.net", + [3]byte{0, 2, 152}: "Broadframe Corporation", + [3]byte{0, 2, 153}: "Apex, Inc.", + [3]byte{0, 2, 154}: "Storage Apps", + [3]byte{0, 2, 155}: "Kreatel Communications AB", + [3]byte{0, 2, 156}: "3COM", + [3]byte{0, 2, 157}: "Merix Corp.", + [3]byte{0, 2, 158}: "Information Equipment Co., Ltd.", + [3]byte{0, 2, 159}: "L-3 Communication Aviation Recorders", + [3]byte{0, 2, 160}: "Flatstack Ltd.", + [3]byte{0, 2, 161}: "World Wide Packets", + [3]byte{0, 2, 162}: "Hilscher GmbH", + [3]byte{0, 2, 163}: "ABB Switzerland Ltd, Power Systems", + [3]byte{0, 2, 164}: "AddPac Technology Co., Ltd.", + [3]byte{0, 2, 165}: "Hewlett-Packard Company", + [3]byte{0, 2, 166}: "Effinet Systems Co., Ltd.", + [3]byte{0, 2, 167}: "Vivace Networks", + [3]byte{0, 2, 168}: "Air Link Technology", + [3]byte{0, 2, 169}: "RACOM, s.r.o.", + [3]byte{0, 2, 170}: "PLcom Co., Ltd.", + [3]byte{0, 2, 171}: "CTC Union Technologies Co., Ltd.", + [3]byte{0, 2, 172}: "3PAR data", + [3]byte{0, 2, 173}: "HOYA Corporation", + [3]byte{0, 2, 174}: "Scannex Electronics Ltd.", + [3]byte{0, 2, 175}: "TeleCruz Technology, Inc.", + [3]byte{0, 2, 176}: "Hokubu Communication & Industrial Co., Ltd.", + [3]byte{0, 2, 177}: "Anritsu, Ltd.", + [3]byte{0, 2, 178}: "Cablevision", + [3]byte{0, 2, 179}: "Intel Corporation", + [3]byte{0, 2, 180}: "DAPHNE", + [3]byte{0, 2, 181}: "Avnet, Inc.", + [3]byte{0, 2, 182}: "Acrosser Technology Co., Ltd.", + [3]byte{0, 2, 183}: "Watanabe Electric Industry Co., Ltd.", + [3]byte{0, 2, 184}: "WHI KONSULT AB", + [3]byte{0, 2, 185}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 186}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 187}: "Continuous Computing Corp", + [3]byte{0, 2, 188}: "LVL 7 Systems, Inc.", + [3]byte{0, 2, 189}: "Bionet Co., Ltd.", + [3]byte{0, 2, 190}: "Totsu Engineering, Inc.", + [3]byte{0, 2, 191}: "dotRocket, Inc.", + [3]byte{0, 2, 192}: "Bencent Tzeng Industry Co., Ltd.", + [3]byte{0, 2, 193}: "Innovative Electronic Designs, Inc.", + [3]byte{0, 2, 194}: "Net Vision Telecom", + [3]byte{0, 2, 195}: "Arelnet Ltd.", + [3]byte{0, 2, 196}: "Vector International BVBA", + [3]byte{0, 2, 197}: "Evertz Microsystems Ltd.", + [3]byte{0, 2, 198}: "Data Track Technology PLC", + [3]byte{0, 2, 199}: "ALPS ELECTRIC Co., Ltd.", + [3]byte{0, 2, 200}: "Technocom Communications Technology (pte) Ltd", + [3]byte{0, 2, 201}: "Mellanox Technologies", + [3]byte{0, 2, 202}: "EndPoints, Inc.", + [3]byte{0, 2, 203}: "TriState Ltd.", + [3]byte{0, 2, 204}: "M.C.C.I", + [3]byte{0, 2, 205}: "TeleDream, Inc.", + [3]byte{0, 2, 206}: "FoxJet, Inc.", + [3]byte{0, 2, 207}: "ZyGate Communications, Inc.", + [3]byte{0, 2, 208}: "Comdial Corporation", + [3]byte{0, 2, 209}: "Vivotek, Inc.", + [3]byte{0, 2, 210}: "Workstation AG", + [3]byte{0, 2, 211}: "NetBotz, Inc.", + [3]byte{0, 2, 212}: "PDA Peripherals, Inc.", + [3]byte{0, 2, 213}: "ACR", + [3]byte{0, 2, 214}: "NICE Systems", + [3]byte{0, 2, 215}: "EMPEG Ltd", + [3]byte{0, 2, 216}: "BRECIS Communications Corporation", + [3]byte{0, 2, 217}: "Reliable Controls", + [3]byte{0, 2, 218}: "ExiO Communications, Inc.", + [3]byte{0, 2, 219}: "NETSEC", + [3]byte{0, 2, 220}: "Fujitsu General Limited", + [3]byte{0, 2, 221}: "Bromax Communications, Ltd.", + [3]byte{0, 2, 222}: "Astrodesign, Inc.", + [3]byte{0, 2, 223}: "Net Com Systems, Inc.", + [3]byte{0, 2, 224}: "ETAS GmbH", + [3]byte{0, 2, 225}: "Integrated Network Corporation", + [3]byte{0, 2, 226}: "NDC Infared Engineering", + [3]byte{0, 2, 227}: "LITE-ON Communications, Inc.", + [3]byte{0, 2, 228}: "JC HYUN Systems, Inc.", + [3]byte{0, 2, 229}: "Timeware Ltd.", + [3]byte{0, 2, 230}: "Gould Instrument Systems, Inc.", + [3]byte{0, 2, 231}: "CAB GmbH & Co KG", + [3]byte{0, 2, 232}: "E.D.&A.", + [3]byte{0, 2, 233}: "CS Systemes De Securite - C3S", + [3]byte{0, 2, 234}: "Focus Enhancements", + [3]byte{0, 2, 235}: "Pico Communications", + [3]byte{0, 2, 236}: "Maschoff Design Engineering", + [3]byte{0, 2, 237}: "DXO Telecom Co., Ltd.", + [3]byte{0, 2, 238}: "Nokia Danmark A/S", + [3]byte{0, 2, 239}: "CCC Network Systems Group Ltd.", + [3]byte{0, 2, 240}: "AME Optimedia Technology Co., Ltd.", + [3]byte{0, 2, 241}: "Pinetron Co., Ltd.", + [3]byte{0, 2, 242}: "eDevice, Inc.", + [3]byte{0, 2, 243}: "Media Serve Co., Ltd.", + [3]byte{0, 2, 244}: "PCTEL, Inc.", + [3]byte{0, 2, 245}: "VIVE Synergies, Inc.", + [3]byte{0, 2, 246}: "Equipe Communications", + [3]byte{0, 2, 247}: "ARM", + [3]byte{0, 2, 248}: "SEAKR Engineering, Inc.", + [3]byte{0, 2, 249}: "MIMOS Berhad", + [3]byte{0, 2, 250}: "DX Antenna Co., Ltd.", + [3]byte{0, 2, 251}: "Baumuller Aulugen-Systemtechnik GmbH", + [3]byte{0, 2, 252}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 253}: "CISCO SYSTEMS, INC.", + [3]byte{0, 2, 254}: "Viditec, Inc.", + [3]byte{0, 2, 255}: "Handan BroadInfoCom", + [3]byte{0, 3, 0}: "Barracuda Networks, Inc.", + [3]byte{0, 3, 1}: "EXFO", + [3]byte{0, 3, 2}: "Charles Industries, Ltd.", + [3]byte{0, 3, 3}: "JAMA Electronics Co., Ltd.", + [3]byte{0, 3, 4}: "Pacific Broadband Communications", + [3]byte{0, 3, 5}: "MSC Vertriebs GmbH", + [3]byte{0, 3, 6}: "Fusion In Tech Co., Ltd.", + [3]byte{0, 3, 7}: "Secure Works, Inc.", + [3]byte{0, 3, 8}: "AM Communications, Inc.", + [3]byte{0, 3, 9}: "Texcel Technology PLC", + [3]byte{0, 3, 10}: "Argus Technologies", + [3]byte{0, 3, 11}: "Hunter Technology, Inc.", + [3]byte{0, 3, 12}: "Telesoft Technologies Ltd.", + [3]byte{0, 3, 13}: "Uniwill Computer Corp.", + [3]byte{0, 3, 14}: "Core Communications Co., Ltd.", + [3]byte{0, 3, 15}: "Digital China (Shanghai) Networks Ltd.", + [3]byte{0, 3, 16}: "E-Globaledge Corporation", + [3]byte{0, 3, 17}: "Micro Technology Co., Ltd.", + [3]byte{0, 3, 18}: "TR-Systemtechnik GmbH", + [3]byte{0, 3, 19}: "Access Media SPA", + [3]byte{0, 3, 20}: "Teleware Network Systems", + [3]byte{0, 3, 21}: "Cidco Incorporated", + [3]byte{0, 3, 22}: "Nobell Communications, Inc.", + [3]byte{0, 3, 23}: "Merlin Systems, Inc.", + [3]byte{0, 3, 24}: "Cyras Systems, Inc.", + [3]byte{0, 3, 25}: "Infineon AG", + [3]byte{0, 3, 26}: "Beijing Broad Telecom Ltd., China", + [3]byte{0, 3, 27}: "Cellvision Systems, Inc.", + [3]byte{0, 3, 28}: "Svenska Hardvarufabriken AB", + [3]byte{0, 3, 29}: "Taiwan Commate Computer, Inc.", + [3]byte{0, 3, 30}: "Optranet, Inc.", + [3]byte{0, 3, 31}: "Condev Ltd.", + [3]byte{0, 3, 32}: "Xpeed, Inc.", + [3]byte{0, 3, 33}: "Reco Research Co., Ltd.", + [3]byte{0, 3, 34}: "IDIS Co., Ltd.", + [3]byte{0, 3, 35}: "Cornet Technology, Inc.", + [3]byte{0, 3, 36}: "SANYO Consumer Electronics Co., Ltd.", + [3]byte{0, 3, 37}: "Arima Computer Corp.", + [3]byte{0, 3, 38}: "Iwasaki Information Systems Co., Ltd.", + [3]byte{0, 3, 39}: "ACT'L", + [3]byte{0, 3, 40}: "Mace Group, Inc.", + [3]byte{0, 3, 41}: "F3, Inc.", + [3]byte{0, 3, 42}: "UniData Communication Systems, Inc.", + [3]byte{0, 3, 43}: "GAI Datenfunksysteme GmbH", + [3]byte{0, 3, 44}: "ABB Switzerland Ltd", + [3]byte{0, 3, 45}: "IBASE Technology, Inc.", + [3]byte{0, 3, 46}: "Scope Information Management, Ltd.", + [3]byte{0, 3, 47}: "Global Sun Technology, Inc.", + [3]byte{0, 3, 48}: "Imagenics, Co., Ltd.", + [3]byte{0, 3, 49}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 50}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 51}: "Digitel Co., Ltd.", + [3]byte{0, 3, 52}: "Newport Electronics", + [3]byte{0, 3, 53}: "Mirae Technology", + [3]byte{0, 3, 54}: "Zetes Technologies", + [3]byte{0, 3, 55}: "Vaone, Inc.", + [3]byte{0, 3, 56}: "Oak Technology", + [3]byte{0, 3, 57}: "Eurologic Systems, Ltd.", + [3]byte{0, 3, 58}: "Silicon Wave, Inc.", + [3]byte{0, 3, 59}: "TAMI Tech Co., Ltd.", + [3]byte{0, 3, 60}: "Daiden Co., Ltd.", + [3]byte{0, 3, 61}: "ILSHin Lab", + [3]byte{0, 3, 62}: "Tateyama System Laboratory Co., Ltd.", + [3]byte{0, 3, 63}: "BigBand Networks, Ltd.", + [3]byte{0, 3, 64}: "Floware Wireless Systems, Ltd.", + [3]byte{0, 3, 65}: "Axon Digital Design", + [3]byte{0, 3, 66}: "Nortel Networks", + [3]byte{0, 3, 67}: "Martin Professional A/S", + [3]byte{0, 3, 68}: "Tietech.Co., Ltd.", + [3]byte{0, 3, 69}: "Routrek Networks Corporation", + [3]byte{0, 3, 70}: "Hitachi Kokusai Electric, Inc.", + [3]byte{0, 3, 71}: "Intel Corporation", + [3]byte{0, 3, 72}: "Norscan Instruments, Ltd.", + [3]byte{0, 3, 73}: "Vidicode Datacommunicatie B.V.", + [3]byte{0, 3, 74}: "RIAS Corporation", + [3]byte{0, 3, 75}: "Nortel Networks", + [3]byte{0, 3, 76}: "Shanghai DigiVision Technology Co., Ltd.", + [3]byte{0, 3, 77}: "Chiaro Networks, Ltd.", + [3]byte{0, 3, 78}: "Pos Data Company, Ltd.", + [3]byte{0, 3, 79}: "Sur-Gard Security", + [3]byte{0, 3, 80}: "BTICINO SPA", + [3]byte{0, 3, 81}: "Diebold, Inc.", + [3]byte{0, 3, 82}: "Colubris Networks", + [3]byte{0, 3, 83}: "Mitac, Inc.", + [3]byte{0, 3, 84}: "Fiber Logic Communications", + [3]byte{0, 3, 85}: "TeraBeam Internet Systems", + [3]byte{0, 3, 86}: "Wincor Nixdorf International GmbH", + [3]byte{0, 3, 87}: "Intervoice-Brite, Inc.", + [3]byte{0, 3, 88}: "Hanyang Digitech Co., Ltd.", + [3]byte{0, 3, 89}: "DigitalSis", + [3]byte{0, 3, 90}: "Photron Limited", + [3]byte{0, 3, 91}: "BridgeWave Communications", + [3]byte{0, 3, 92}: "Saint Song Corp.", + [3]byte{0, 3, 93}: "Bosung Hi-Net Co., Ltd.", + [3]byte{0, 3, 94}: "Metropolitan Area Networks, Inc.", + [3]byte{0, 3, 95}: "Prüftechnik Condition Monitoring GmbH & Co. KG", + [3]byte{0, 3, 96}: "PAC Interactive Technology, Inc.", + [3]byte{0, 3, 97}: "Widcomm, Inc.", + [3]byte{0, 3, 98}: "Vodtel Communications, Inc.", + [3]byte{0, 3, 99}: "Miraesys Co., Ltd.", + [3]byte{0, 3, 100}: "Scenix Semiconductor, Inc.", + [3]byte{0, 3, 101}: "Kira Information & Communications, Ltd.", + [3]byte{0, 3, 102}: "ASM Pacific Technology", + [3]byte{0, 3, 103}: "Jasmine Networks, Inc.", + [3]byte{0, 3, 104}: "Embedone Co., Ltd.", + [3]byte{0, 3, 105}: "Nippon Antenna Co., Ltd.", + [3]byte{0, 3, 106}: "Mainnet, Ltd.", + [3]byte{0, 3, 107}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 108}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 109}: "Runtop, Inc.", + [3]byte{0, 3, 110}: "Nicon Systems (Pty) Limited", + [3]byte{0, 3, 111}: "Telsey SPA", + [3]byte{0, 3, 112}: "NXTV, Inc.", + [3]byte{0, 3, 113}: "Acomz Networks Corp.", + [3]byte{0, 3, 114}: "ULAN", + [3]byte{0, 3, 115}: "Aselsan A.S", + [3]byte{0, 3, 116}: "Control Microsystems", + [3]byte{0, 3, 117}: "NetMedia, Inc.", + [3]byte{0, 3, 118}: "Graphtec Technology, Inc.", + [3]byte{0, 3, 119}: "Gigabit Wireless", + [3]byte{0, 3, 120}: "HUMAX Co., Ltd.", + [3]byte{0, 3, 121}: "Proscend Communications, Inc.", + [3]byte{0, 3, 122}: "Taiyo Yuden Co., Ltd.", + [3]byte{0, 3, 123}: "IDEC IZUMI Corporation", + [3]byte{0, 3, 124}: "Coax Media", + [3]byte{0, 3, 125}: "Stellcom", + [3]byte{0, 3, 126}: "PORTech Communications, Inc.", + [3]byte{0, 3, 127}: "Atheros Communications, Inc.", + [3]byte{0, 3, 128}: "SSH Communications Security Corp.", + [3]byte{0, 3, 129}: "Ingenico International", + [3]byte{0, 3, 130}: "A-One Co., Ltd.", + [3]byte{0, 3, 131}: "Metera Networks, Inc.", + [3]byte{0, 3, 132}: "AETA", + [3]byte{0, 3, 133}: "Actelis Networks, Inc.", + [3]byte{0, 3, 134}: "Ho Net, Inc.", + [3]byte{0, 3, 135}: "Blaze Network Products", + [3]byte{0, 3, 136}: "Fastfame Technology Co., Ltd.", + [3]byte{0, 3, 137}: "Plantronics", + [3]byte{0, 3, 138}: "America Online, Inc.", + [3]byte{0, 3, 139}: "PLUS-ONE I&T, Inc.", + [3]byte{0, 3, 140}: "Total Impact", + [3]byte{0, 3, 141}: "PCS Revenue Control Systems, Inc.", + [3]byte{0, 3, 142}: "Atoga Systems, Inc.", + [3]byte{0, 3, 143}: "Weinschel Corporation", + [3]byte{0, 3, 144}: "Digital Video Communications, Inc.", + [3]byte{0, 3, 145}: "Advanced Digital Broadcast, Ltd.", + [3]byte{0, 3, 146}: "Hyundai Teletek Co., Ltd.", + [3]byte{0, 3, 147}: "Apple", + [3]byte{0, 3, 148}: "Connect One", + [3]byte{0, 3, 149}: "California Amplifier", + [3]byte{0, 3, 150}: "EZ Cast Co., Ltd.", + [3]byte{0, 3, 151}: "Watchfront Limited", + [3]byte{0, 3, 152}: "WISI", + [3]byte{0, 3, 153}: "Dongju Informations & Communications Co., Ltd.", + [3]byte{0, 3, 154}: "SiConnect", + [3]byte{0, 3, 155}: "NetChip Technology, Inc.", + [3]byte{0, 3, 156}: "OptiMight Communications, Inc.", + [3]byte{0, 3, 157}: "Qisda Corporation", + [3]byte{0, 3, 158}: "Tera System Co., Ltd.", + [3]byte{0, 3, 159}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 160}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 161}: "HIPER Information & Communication, Inc.", + [3]byte{0, 3, 162}: "Catapult Communications", + [3]byte{0, 3, 163}: "MAVIX, Ltd.", + [3]byte{0, 3, 164}: "Imation Corp.", + [3]byte{0, 3, 165}: "Medea Corporation", + [3]byte{0, 3, 166}: "Traxit Technology, Inc.", + [3]byte{0, 3, 167}: "Unixtar Technology, Inc.", + [3]byte{0, 3, 168}: "IDOT Computers, Inc.", + [3]byte{0, 3, 169}: "AXCENT Media AG", + [3]byte{0, 3, 170}: "Watlow", + [3]byte{0, 3, 171}: "Bridge Information Systems", + [3]byte{0, 3, 172}: "Fronius Schweissmaschinen", + [3]byte{0, 3, 173}: "Emerson Energy Systems AB", + [3]byte{0, 3, 174}: "Allied Advanced Manufacturing Pte, Ltd.", + [3]byte{0, 3, 175}: "Paragea Communications", + [3]byte{0, 3, 176}: "Xsense Technology Corp.", + [3]byte{0, 3, 177}: "Hospira Inc.", + [3]byte{0, 3, 178}: "Radware", + [3]byte{0, 3, 179}: "IA Link Systems Co., Ltd.", + [3]byte{0, 3, 180}: "Macrotek International Corp.", + [3]byte{0, 3, 181}: "Entra Technology Co.", + [3]byte{0, 3, 182}: "QSI Corporation", + [3]byte{0, 3, 183}: "ZACCESS Systems", + [3]byte{0, 3, 184}: "NetKit Solutions, LLC", + [3]byte{0, 3, 185}: "Hualong Telecom Co., Ltd.", + [3]byte{0, 3, 186}: "Oracle Corporation", + [3]byte{0, 3, 187}: "Signal Communications Limited", + [3]byte{0, 3, 188}: "COT GmbH", + [3]byte{0, 3, 189}: "OmniCluster Technologies, Inc.", + [3]byte{0, 3, 190}: "Netility", + [3]byte{0, 3, 191}: "Centerpoint Broadband Technologies, Inc.", + [3]byte{0, 3, 192}: "RFTNC Co., Ltd.", + [3]byte{0, 3, 193}: "Packet Dynamics Ltd", + [3]byte{0, 3, 194}: "Solphone K.K.", + [3]byte{0, 3, 195}: "Micronik Multimedia", + [3]byte{0, 3, 196}: "Tomra Systems ASA", + [3]byte{0, 3, 197}: "Mobotix AG", + [3]byte{0, 3, 198}: "ICUE Systems, Inc.", + [3]byte{0, 3, 199}: "hopf Elektronik GmbH", + [3]byte{0, 3, 200}: "CML Emergency Services", + [3]byte{0, 3, 201}: "TECOM Co., Ltd.", + [3]byte{0, 3, 202}: "MTS Systems Corp.", + [3]byte{0, 3, 203}: "Nippon Systems Development Co., Ltd.", + [3]byte{0, 3, 204}: "Momentum Computer, Inc.", + [3]byte{0, 3, 205}: "Clovertech, Inc.", + [3]byte{0, 3, 206}: "ETEN Technologies, Inc.", + [3]byte{0, 3, 207}: "Muxcom, Inc.", + [3]byte{0, 3, 208}: "KOANKEISO Co., Ltd.", + [3]byte{0, 3, 209}: "Takaya Corporation", + [3]byte{0, 3, 210}: "Crossbeam Systems, Inc.", + [3]byte{0, 3, 211}: "Internet Energy Systems, Inc.", + [3]byte{0, 3, 212}: "Alloptic, Inc.", + [3]byte{0, 3, 213}: "Advanced Communications Co., Ltd.", + [3]byte{0, 3, 214}: "RADVision, Ltd.", + [3]byte{0, 3, 215}: "NextNet Wireless, Inc.", + [3]byte{0, 3, 216}: "iMPath Networks, Inc.", + [3]byte{0, 3, 217}: "Secheron SA", + [3]byte{0, 3, 218}: "Takamisawa Cybernetics Co., Ltd.", + [3]byte{0, 3, 219}: "Apogee Electronics Corp.", + [3]byte{0, 3, 220}: "Lexar Media, Inc.", + [3]byte{0, 3, 221}: "Comark Corp.", + [3]byte{0, 3, 222}: "OTC Wireless", + [3]byte{0, 3, 223}: "Desana Systems", + [3]byte{0, 3, 224}: "ARRIS Group, Inc.", + [3]byte{0, 3, 225}: "Winmate Communication, Inc.", + [3]byte{0, 3, 226}: "Comspace Corporation", + [3]byte{0, 3, 227}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 228}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 229}: "Hermstedt SG", + [3]byte{0, 3, 230}: "Entone, Inc.", + [3]byte{0, 3, 231}: "Logostek Co. Ltd.", + [3]byte{0, 3, 232}: "Wavelength Digital Limited", + [3]byte{0, 3, 233}: "Akara Canada, Inc.", + [3]byte{0, 3, 234}: "Mega System Technologies, Inc.", + [3]byte{0, 3, 235}: "Atrica", + [3]byte{0, 3, 236}: "ICG Research, Inc.", + [3]byte{0, 3, 237}: "Shinkawa Electric Co., Ltd.", + [3]byte{0, 3, 238}: "MKNet Corporation", + [3]byte{0, 3, 239}: "Oneline AG", + [3]byte{0, 3, 240}: "Redfern Broadband Networks", + [3]byte{0, 3, 241}: "Cicada Semiconductor, Inc.", + [3]byte{0, 3, 242}: "Seneca Networks", + [3]byte{0, 3, 243}: "Dazzle Multimedia, Inc.", + [3]byte{0, 3, 244}: "NetBurner", + [3]byte{0, 3, 245}: "Chip2Chip", + [3]byte{0, 3, 246}: "Allegro Networks, Inc.", + [3]byte{0, 3, 247}: "Plast-Control GmbH", + [3]byte{0, 3, 248}: "SanCastle Technologies, Inc.", + [3]byte{0, 3, 249}: "Pleiades Communications, Inc.", + [3]byte{0, 3, 250}: "TiMetra Networks", + [3]byte{0, 3, 251}: "ENEGATE Co.,Ltd.", + [3]byte{0, 3, 252}: "Intertex Data AB", + [3]byte{0, 3, 253}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 254}: "CISCO SYSTEMS, INC.", + [3]byte{0, 3, 255}: "Microsoft Corporation", + [3]byte{0, 4, 0}: "LEXMARK INTERNATIONAL, INC.", + [3]byte{0, 4, 1}: "Osaki Electric Co., Ltd.", + [3]byte{0, 4, 2}: "Nexsan Technologies, Ltd.", + [3]byte{0, 4, 3}: "Nexsi Corporation", + [3]byte{0, 4, 4}: "Makino Milling Machine Co., Ltd.", + [3]byte{0, 4, 5}: "ACN Technologies", + [3]byte{0, 4, 6}: "Fa. Metabox AG", + [3]byte{0, 4, 7}: "Topcon Positioning Systems, Inc.", + [3]byte{0, 4, 8}: "Sanko Electronics Co., Ltd.", + [3]byte{0, 4, 9}: "Cratos Networks", + [3]byte{0, 4, 10}: "Sage Systems", + [3]byte{0, 4, 11}: "3com Europe Ltd.", + [3]byte{0, 4, 12}: "Kanno Works, Ltd.", + [3]byte{0, 4, 13}: "Avaya, Inc.", + [3]byte{0, 4, 14}: "AVM GmbH", + [3]byte{0, 4, 15}: "Asus Network Technologies, Inc.", + [3]byte{0, 4, 16}: "Spinnaker Networks, Inc.", + [3]byte{0, 4, 17}: "Inkra Networks, Inc.", + [3]byte{0, 4, 18}: "WaveSmith Networks, Inc.", + [3]byte{0, 4, 19}: "SNOM Technology AG", + [3]byte{0, 4, 20}: "Umezawa Musen Denki Co., Ltd.", + [3]byte{0, 4, 21}: "Rasteme Systems Co., Ltd.", + [3]byte{0, 4, 22}: "Parks S/A Comunicacoes Digitais", + [3]byte{0, 4, 23}: "ELAU AG", + [3]byte{0, 4, 24}: "Teltronic S.A.U.", + [3]byte{0, 4, 25}: "Fibercycle Networks, Inc.", + [3]byte{0, 4, 26}: "Ines Test and Measurement GmbH & CoKG", + [3]byte{0, 4, 27}: "Bridgeworks Ltd.", + [3]byte{0, 4, 28}: "ipDialog, Inc.", + [3]byte{0, 4, 29}: "Corega of America", + [3]byte{0, 4, 30}: "Shikoku Instrumentation Co., Ltd.", + [3]byte{0, 4, 31}: "Sony Computer Entertainment, Inc.", + [3]byte{0, 4, 32}: "Slim Devices, Inc.", + [3]byte{0, 4, 33}: "Ocular Networks", + [3]byte{0, 4, 34}: "Gordon Kapes, Inc.", + [3]byte{0, 4, 35}: "Intel Corporation", + [3]byte{0, 4, 36}: "TMC s.r.l.", + [3]byte{0, 4, 37}: "Atmel Corporation", + [3]byte{0, 4, 38}: "Autosys", + [3]byte{0, 4, 39}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 40}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 41}: "Pixord Corporation", + [3]byte{0, 4, 42}: "Wireless Networks, Inc.", + [3]byte{0, 4, 43}: "IT Access Co., Ltd.", + [3]byte{0, 4, 44}: "Minet, Inc.", + [3]byte{0, 4, 45}: "Sarian Systems, Ltd.", + [3]byte{0, 4, 46}: "Netous Technologies, Ltd.", + [3]byte{0, 4, 47}: "International Communications Products, Inc.", + [3]byte{0, 4, 48}: "Netgem", + [3]byte{0, 4, 49}: "GlobalStreams, Inc.", + [3]byte{0, 4, 50}: "Voyetra Turtle Beach, Inc.", + [3]byte{0, 4, 51}: "Cyberboard A/S", + [3]byte{0, 4, 52}: "Accelent Systems, Inc.", + [3]byte{0, 4, 53}: "Comptek International, Inc.", + [3]byte{0, 4, 54}: "ELANsat Technologies, Inc.", + [3]byte{0, 4, 55}: "Powin Information Technology, Inc.", + [3]byte{0, 4, 56}: "Nortel Networks", + [3]byte{0, 4, 57}: "Rosco Entertainment Technology, Inc.", + [3]byte{0, 4, 58}: "Intelligent Telecommunications, Inc.", + [3]byte{0, 4, 59}: "Lava Computer Mfg., Inc.", + [3]byte{0, 4, 60}: "SONOS Co., Ltd.", + [3]byte{0, 4, 61}: "INDEL AG", + [3]byte{0, 4, 62}: "Telencomm", + [3]byte{0, 4, 63}: "ESTeem Wireless Modems, Inc", + [3]byte{0, 4, 64}: "cyberPIXIE, Inc.", + [3]byte{0, 4, 65}: "Half Dome Systems, Inc.", + [3]byte{0, 4, 66}: "NACT", + [3]byte{0, 4, 67}: "Agilent Technologies, Inc.", + [3]byte{0, 4, 68}: "Western Multiplex Corporation", + [3]byte{0, 4, 69}: "LMS Skalar Instruments GmbH", + [3]byte{0, 4, 70}: "CYZENTECH Co., Ltd.", + [3]byte{0, 4, 71}: "Acrowave Systems Co., Ltd.", + [3]byte{0, 4, 72}: "Polaroid Corporation", + [3]byte{0, 4, 73}: "Mapletree Networks", + [3]byte{0, 4, 74}: "iPolicy Networks, Inc.", + [3]byte{0, 4, 75}: "NVIDIA", + [3]byte{0, 4, 76}: "JENOPTIK", + [3]byte{0, 4, 77}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 78}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 79}: "Leukhardt Systemelektronik GmbH", + [3]byte{0, 4, 80}: "DMD Computers SRL", + [3]byte{0, 4, 81}: "Medrad, Inc.", + [3]byte{0, 4, 82}: "RocketLogix, Inc.", + [3]byte{0, 4, 83}: "YottaYotta, Inc.", + [3]byte{0, 4, 84}: "Quadriga UK", + [3]byte{0, 4, 85}: "ANTARA.net", + [3]byte{0, 4, 86}: "Cambium Networks Limited", + [3]byte{0, 4, 87}: "Universal Access Technology, Inc.", + [3]byte{0, 4, 88}: "Fusion X Co., Ltd.", + [3]byte{0, 4, 89}: "Veristar Corporation", + [3]byte{0, 4, 90}: "The Linksys Group, Inc.", + [3]byte{0, 4, 91}: "Techsan Electronics Co., Ltd.", + [3]byte{0, 4, 92}: "Mobiwave Pte Ltd", + [3]byte{0, 4, 93}: "BEKA Elektronik", + [3]byte{0, 4, 94}: "PolyTrax Information Technology AG", + [3]byte{0, 4, 95}: "Avalue Technology, Inc.", + [3]byte{0, 4, 96}: "Knilink Technology, Inc.", + [3]byte{0, 4, 97}: "EPOX Computer Co., Ltd.", + [3]byte{0, 4, 98}: "DAKOS Data & Communication Co., Ltd.", + [3]byte{0, 4, 99}: "Bosch Security Systems", + [3]byte{0, 4, 100}: "Pulse-Link Inc", + [3]byte{0, 4, 101}: "i.s.t isdn-support technik GmbH", + [3]byte{0, 4, 102}: "ARMITEL Co.", + [3]byte{0, 4, 103}: "Wuhan Research Institute of MII", + [3]byte{0, 4, 104}: "Vivity, Inc.", + [3]byte{0, 4, 105}: "Innocom, Inc.", + [3]byte{0, 4, 106}: "Navini Networks", + [3]byte{0, 4, 107}: "Palm Wireless, Inc.", + [3]byte{0, 4, 108}: "Cyber Technology Co., Ltd.", + [3]byte{0, 4, 109}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 110}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 111}: "Digitel S/A Industria Eletronica", + [3]byte{0, 4, 112}: "ipUnplugged AB", + [3]byte{0, 4, 113}: "IPrad", + [3]byte{0, 4, 114}: "Telelynx, Inc.", + [3]byte{0, 4, 115}: "Photonex Corporation", + [3]byte{0, 4, 116}: "LEGRAND", + [3]byte{0, 4, 117}: "3 Com Corporation", + [3]byte{0, 4, 118}: "3 Com Corporation", + [3]byte{0, 4, 119}: "Scalant Systems, Inc.", + [3]byte{0, 4, 120}: "G. Star Technology Corporation", + [3]byte{0, 4, 121}: "Radius Co., Ltd.", + [3]byte{0, 4, 122}: "AXXESSIT ASA", + [3]byte{0, 4, 123}: "Schlumberger", + [3]byte{0, 4, 124}: "Skidata AG", + [3]byte{0, 4, 125}: "Pelco", + [3]byte{0, 4, 126}: "Siqura B.V.", + [3]byte{0, 4, 127}: "Chr. Mayr GmbH & Co. KG", + [3]byte{0, 4, 128}: "Brocade Communications Systems, Inc", + [3]byte{0, 4, 129}: "Econolite Control Products, Inc.", + [3]byte{0, 4, 130}: "Medialogic Corp.", + [3]byte{0, 4, 131}: "Deltron Technology, Inc.", + [3]byte{0, 4, 132}: "Amann GmbH", + [3]byte{0, 4, 133}: "PicoLight", + [3]byte{0, 4, 134}: "ITTC, University of Kansas", + [3]byte{0, 4, 135}: "Cogency Semiconductor, Inc.", + [3]byte{0, 4, 136}: "Eurotherm Controls", + [3]byte{0, 4, 137}: "YAFO Networks, Inc.", + [3]byte{0, 4, 138}: "Temia Vertriebs GmbH", + [3]byte{0, 4, 139}: "Poscon Corporation", + [3]byte{0, 4, 140}: "Nayna Networks, Inc.", + [3]byte{0, 4, 141}: "Tone Commander Systems, Inc.", + [3]byte{0, 4, 142}: "Ohm Tech Labs, Inc.", + [3]byte{0, 4, 143}: "TD Systems Corporation", + [3]byte{0, 4, 144}: "Optical Access", + [3]byte{0, 4, 145}: "Technovision, Inc.", + [3]byte{0, 4, 146}: "Hive Internet, Ltd.", + [3]byte{0, 4, 147}: "Tsinghua Unisplendour Co., Ltd.", + [3]byte{0, 4, 148}: "Breezecom, Ltd.", + [3]byte{0, 4, 149}: "Tejas Networks India Limited", + [3]byte{0, 4, 150}: "Extreme Networks", + [3]byte{0, 4, 151}: "MacroSystem Digital Video AG", + [3]byte{0, 4, 152}: "Mahi Networks", + [3]byte{0, 4, 153}: "Chino Corporation", + [3]byte{0, 4, 154}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 155}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 156}: "Surgient Networks, Inc.", + [3]byte{0, 4, 157}: "Ipanema Technologies", + [3]byte{0, 4, 158}: "Wirelink Co., Ltd.", + [3]byte{0, 4, 159}: "Freescale Semiconductor", + [3]byte{0, 4, 160}: "Verity Instruments, Inc.", + [3]byte{0, 4, 161}: "Pathway Connectivity", + [3]byte{0, 4, 162}: "L.S.I. Japan Co., Ltd.", + [3]byte{0, 4, 163}: "Microchip Technology, Inc.", + [3]byte{0, 4, 164}: "NetEnabled, Inc.", + [3]byte{0, 4, 165}: "Barco Projection Systems NV", + [3]byte{0, 4, 166}: "SAF Tehnika Ltd.", + [3]byte{0, 4, 167}: "FabiaTech Corporation", + [3]byte{0, 4, 168}: "Broadmax Technologies, Inc.", + [3]byte{0, 4, 169}: "SandStream Technologies, Inc.", + [3]byte{0, 4, 170}: "Jetstream Communications", + [3]byte{0, 4, 171}: "Comverse Network Systems, Inc.", + [3]byte{0, 4, 172}: "IBM Corp", + [3]byte{0, 4, 173}: "Malibu Networks", + [3]byte{0, 4, 174}: "Sullair Corporation", + [3]byte{0, 4, 175}: "Digital Fountain, Inc.", + [3]byte{0, 4, 176}: "ELESIGN Co., Ltd.", + [3]byte{0, 4, 177}: "Signal Technology, Inc.", + [3]byte{0, 4, 178}: "ESSEGI SRL", + [3]byte{0, 4, 179}: "Videotek, Inc.", + [3]byte{0, 4, 180}: "CIAC", + [3]byte{0, 4, 181}: "Equitrac Corporation", + [3]byte{0, 4, 182}: "Stratex Networks, Inc.", + [3]byte{0, 4, 183}: "AMB i.t. Holding", + [3]byte{0, 4, 184}: "Kumahira Co., Ltd.", + [3]byte{0, 4, 185}: "S.I. Soubou, Inc.", + [3]byte{0, 4, 186}: "KDD Media Will Corporation", + [3]byte{0, 4, 187}: "Bardac Corporation", + [3]byte{0, 4, 188}: "Giantec, Inc.", + [3]byte{0, 4, 189}: "ARRIS Group, Inc.", + [3]byte{0, 4, 190}: "OptXCon, Inc.", + [3]byte{0, 4, 191}: "VersaLogic Corp.", + [3]byte{0, 4, 192}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 193}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 194}: "Magnipix, Inc.", + [3]byte{0, 4, 195}: "CASTOR Informatique", + [3]byte{0, 4, 196}: "Allen & Heath Limited", + [3]byte{0, 4, 197}: "ASE Technologies, USA", + [3]byte{0, 4, 198}: "Yamaha Motor Co., Ltd.", + [3]byte{0, 4, 199}: "NetMount", + [3]byte{0, 4, 200}: "LIBA Maschinenfabrik GmbH", + [3]byte{0, 4, 201}: "Micro Electron Co., Ltd.", + [3]byte{0, 4, 202}: "FreeMs Corp.", + [3]byte{0, 4, 203}: "Tdsoft Communication, Ltd.", + [3]byte{0, 4, 204}: "Peek Traffic B.V.", + [3]byte{0, 4, 205}: "Extenway Solutions Inc", + [3]byte{0, 4, 206}: "Patria Ailon", + [3]byte{0, 4, 207}: "Seagate Technology", + [3]byte{0, 4, 208}: "Softlink s.r.o.", + [3]byte{0, 4, 209}: "Drew Technologies, Inc.", + [3]byte{0, 4, 210}: "Adcon Telemetry GmbH", + [3]byte{0, 4, 211}: "Toyokeiki Co., Ltd.", + [3]byte{0, 4, 212}: "Proview Electronics Co., Ltd.", + [3]byte{0, 4, 213}: "Hitachi Information & Communication Engineering, Ltd.", + [3]byte{0, 4, 214}: "Takagi Industrial Co., Ltd.", + [3]byte{0, 4, 215}: "Omitec Instrumentation Ltd.", + [3]byte{0, 4, 216}: "IPWireless, Inc.", + [3]byte{0, 4, 217}: "Titan Electronics, Inc.", + [3]byte{0, 4, 218}: "Relax Technology, Inc.", + [3]byte{0, 4, 219}: "Tellus Group Corp.", + [3]byte{0, 4, 220}: "Nortel Networks", + [3]byte{0, 4, 221}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 222}: "CISCO SYSTEMS, INC.", + [3]byte{0, 4, 223}: "Teracom Telematica Ltda.", + [3]byte{0, 4, 224}: "Procket Networks", + [3]byte{0, 4, 225}: "Infinior Microsystems", + [3]byte{0, 4, 226}: "SMC Networks, Inc.", + [3]byte{0, 4, 227}: "Accton Technology Corp.", + [3]byte{0, 4, 228}: "Daeryung Ind., Inc.", + [3]byte{0, 4, 229}: "Glonet Systems, Inc.", + [3]byte{0, 4, 230}: "Banyan Network Private Limited", + [3]byte{0, 4, 231}: "Lightpointe Communications, Inc", + [3]byte{0, 4, 232}: "IER, Inc.", + [3]byte{0, 4, 233}: "Infiniswitch Corporation", + [3]byte{0, 4, 234}: "Hewlett-Packard Company", + [3]byte{0, 4, 235}: "Paxonet Communications, Inc.", + [3]byte{0, 4, 236}: "Memobox SA", + [3]byte{0, 4, 237}: "Billion Electric Co., Ltd.", + [3]byte{0, 4, 238}: "Lincoln Electric Company", + [3]byte{0, 4, 239}: "Polestar Corp.", + [3]byte{0, 4, 240}: "International Computers, Ltd", + [3]byte{0, 4, 241}: "WhereNet", + [3]byte{0, 4, 242}: "Polycom", + [3]byte{0, 4, 243}: "FS FORTH-SYSTEME GmbH", + [3]byte{0, 4, 244}: "Infinite Electronics Inc.", + [3]byte{0, 4, 245}: "SnowShore Networks, Inc.", + [3]byte{0, 4, 246}: "Amphus", + [3]byte{0, 4, 247}: "Omega Band, Inc.", + [3]byte{0, 4, 248}: "QUALICABLE TV Industria E Com., Ltda", + [3]byte{0, 4, 249}: "Xtera Communications, Inc.", + [3]byte{0, 4, 250}: "NBS Technologies Inc.", + [3]byte{0, 4, 251}: "Commtech, Inc.", + [3]byte{0, 4, 252}: "Stratus Computer (DE), Inc.", + [3]byte{0, 4, 253}: "Japan Control Engineering Co., Ltd.", + [3]byte{0, 4, 254}: "Pelago Networks", + [3]byte{0, 4, 255}: "Acronet Co., Ltd.", + [3]byte{0, 5, 0}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 1}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 2}: "Apple", + [3]byte{0, 5, 3}: "ICONAG", + [3]byte{0, 5, 4}: "Naray Information & Communication Enterprise", + [3]byte{0, 5, 5}: "Systems Integration Solutions, Inc.", + [3]byte{0, 5, 6}: "Reddo Networks AB", + [3]byte{0, 5, 7}: "Fine Appliance Corp.", + [3]byte{0, 5, 8}: "Inetcam, Inc.", + [3]byte{0, 5, 9}: "AVOC Nishimura Ltd.", + [3]byte{0, 5, 10}: "ICS Spa", + [3]byte{0, 5, 11}: "SICOM Systems, Inc.", + [3]byte{0, 5, 12}: "Network Photonics, Inc.", + [3]byte{0, 5, 13}: "Midstream Technologies, Inc.", + [3]byte{0, 5, 14}: "3ware, Inc.", + [3]byte{0, 5, 15}: "Tanaka S/S Ltd.", + [3]byte{0, 5, 16}: "Infinite Shanghai Communication Terminals Ltd.", + [3]byte{0, 5, 17}: "Complementary Technologies Ltd", + [3]byte{0, 5, 18}: "MeshNetworks, Inc.", + [3]byte{0, 5, 19}: "VTLinx Multimedia Systems, Inc.", + [3]byte{0, 5, 20}: "KDT Systems Co., Ltd.", + [3]byte{0, 5, 21}: "Nuark Co., Ltd.", + [3]byte{0, 5, 22}: "SMART Modular Technologies", + [3]byte{0, 5, 23}: "Shellcomm, Inc.", + [3]byte{0, 5, 24}: "Jupiters Technology", + [3]byte{0, 5, 25}: "Siemens Building Technologies AG,", + [3]byte{0, 5, 26}: "3Com Europe Ltd.", + [3]byte{0, 5, 27}: "Magic Control Technology Corporation", + [3]byte{0, 5, 28}: "Xnet Technology Corp.", + [3]byte{0, 5, 29}: "Airocon, Inc.", + [3]byte{0, 5, 30}: "Brocade Communications Systems, Inc.", + [3]byte{0, 5, 31}: "Taijin Media Co., Ltd.", + [3]byte{0, 5, 32}: "Smartronix, Inc.", + [3]byte{0, 5, 33}: "Control Microsystems", + [3]byte{0, 5, 34}: "LEA*D Corporation, Inc.", + [3]byte{0, 5, 35}: "AVL List GmbH", + [3]byte{0, 5, 36}: "BTL System (HK) Limited", + [3]byte{0, 5, 37}: "Puretek Industrial Co., Ltd.", + [3]byte{0, 5, 38}: "IPAS GmbH", + [3]byte{0, 5, 39}: "SJ Tek Co. Ltd", + [3]byte{0, 5, 40}: "New Focus, Inc.", + [3]byte{0, 5, 41}: "Shanghai Broadan Communication Technology Co., Ltd", + [3]byte{0, 5, 42}: "Ikegami Tsushinki Co., Ltd.", + [3]byte{0, 5, 43}: "HORIBA, Ltd.", + [3]byte{0, 5, 44}: "Supreme Magic Corporation", + [3]byte{0, 5, 45}: "Zoltrix International Limited", + [3]byte{0, 5, 46}: "Cinta Networks", + [3]byte{0, 5, 47}: "Leviton Network Solutions", + [3]byte{0, 5, 48}: "Andiamo Systems, Inc.", + [3]byte{0, 5, 49}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 50}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 51}: "Brocade Communications Systems, Inc.", + [3]byte{0, 5, 52}: "Northstar Engineering Ltd.", + [3]byte{0, 5, 53}: "Chip PC Ltd.", + [3]byte{0, 5, 54}: "Danam Communications, Inc.", + [3]byte{0, 5, 55}: "Nets Technology Co., Ltd.", + [3]byte{0, 5, 56}: "Merilus, Inc.", + [3]byte{0, 5, 57}: "A Brand New World in Sweden AB", + [3]byte{0, 5, 58}: "Willowglen Services Pte Ltd", + [3]byte{0, 5, 59}: "Harbour Networks Ltd., Co. Beijing", + [3]byte{0, 5, 60}: "Xircom", + [3]byte{0, 5, 61}: "Agere Systems", + [3]byte{0, 5, 62}: "KID Systeme GmbH", + [3]byte{0, 5, 63}: "VisionTek, Inc.", + [3]byte{0, 5, 64}: "FAST Corporation", + [3]byte{0, 5, 65}: "Advanced Systems Co., Ltd.", + [3]byte{0, 5, 66}: "Otari, Inc.", + [3]byte{0, 5, 67}: "IQ Wireless GmbH", + [3]byte{0, 5, 68}: "Valley Technologies, Inc.", + [3]byte{0, 5, 69}: "Internet Photonics", + [3]byte{0, 5, 70}: "KDDI Network & Solultions Inc.", + [3]byte{0, 5, 71}: "Starent Networks", + [3]byte{0, 5, 72}: "Disco Corporation", + [3]byte{0, 5, 73}: "Salira Optical Network Systems", + [3]byte{0, 5, 74}: "Ario Data Networks, Inc.", + [3]byte{0, 5, 75}: "Eaton Automation AG", + [3]byte{0, 5, 76}: "RF Innovations Pty Ltd", + [3]byte{0, 5, 77}: "Brans Technologies, Inc.", + [3]byte{0, 5, 78}: "Philips", + [3]byte{0, 5, 79}: "PRIVATE", + [3]byte{0, 5, 80}: "Vcomms Connect Limited", + [3]byte{0, 5, 81}: "F & S Elektronik Systeme GmbH", + [3]byte{0, 5, 82}: "Xycotec Computer GmbH", + [3]byte{0, 5, 83}: "DVC Company, Inc.", + [3]byte{0, 5, 84}: "Rangestar Wireless", + [3]byte{0, 5, 85}: "Japan Cash Machine Co., Ltd.", + [3]byte{0, 5, 86}: "360 Systems", + [3]byte{0, 5, 87}: "Agile TV Corporation", + [3]byte{0, 5, 88}: "Synchronous, Inc.", + [3]byte{0, 5, 89}: "Intracom S.A.", + [3]byte{0, 5, 90}: "Power Dsine Ltd.", + [3]byte{0, 5, 91}: "Charles Industries, Ltd.", + [3]byte{0, 5, 92}: "Kowa Company, Ltd.", + [3]byte{0, 5, 93}: "D-Link Systems, Inc.", + [3]byte{0, 5, 94}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 95}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 96}: "LEADER COMM.CO., LTD", + [3]byte{0, 5, 97}: "nac Image Technology, Inc.", + [3]byte{0, 5, 98}: "Digital View Limited", + [3]byte{0, 5, 99}: "J-Works, Inc.", + [3]byte{0, 5, 100}: "Tsinghua Bitway Co., Ltd.", + [3]byte{0, 5, 101}: "Tailyn Communication Company Ltd.", + [3]byte{0, 5, 102}: "Secui.com Corporation", + [3]byte{0, 5, 103}: "Etymonic Design, Inc.", + [3]byte{0, 5, 104}: "Piltofish Networks AB", + [3]byte{0, 5, 105}: "VMware, Inc.", + [3]byte{0, 5, 106}: "Heuft Systemtechnik GmbH", + [3]byte{0, 5, 107}: "C.P. Technology Co., Ltd.", + [3]byte{0, 5, 108}: "Hung Chang Co., Ltd.", + [3]byte{0, 5, 109}: "Pacific Corporation", + [3]byte{0, 5, 110}: "National Enhance Technology, Inc.", + [3]byte{0, 5, 111}: "Innomedia Technologies Pvt. Ltd.", + [3]byte{0, 5, 112}: "Baydel Ltd.", + [3]byte{0, 5, 113}: "Seiwa Electronics Co.", + [3]byte{0, 5, 114}: "Deonet Co., Ltd.", + [3]byte{0, 5, 115}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 116}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 117}: "CDS-Electronics BV", + [3]byte{0, 5, 118}: "NSM Technology Ltd.", + [3]byte{0, 5, 119}: "SM Information & Communication", + [3]byte{0, 5, 120}: "PRIVATE", + [3]byte{0, 5, 121}: "Universal Control Solution Corp.", + [3]byte{0, 5, 122}: "Overture Networks", + [3]byte{0, 5, 123}: "Chung Nam Electronic Co., Ltd.", + [3]byte{0, 5, 124}: "RCO Security AB", + [3]byte{0, 5, 125}: "Sun Communications, Inc.", + [3]byte{0, 5, 126}: "Eckelmann Steuerungstechnik GmbH", + [3]byte{0, 5, 127}: "Acqis Technology", + [3]byte{0, 5, 128}: "FibroLAN Ltd.", + [3]byte{0, 5, 129}: "Snell", + [3]byte{0, 5, 130}: "ClearCube Technology", + [3]byte{0, 5, 131}: "ImageCom Limited", + [3]byte{0, 5, 132}: "AbsoluteValue Systems, Inc.", + [3]byte{0, 5, 133}: "Juniper Networks, Inc.", + [3]byte{0, 5, 134}: "Lucent Technologies", + [3]byte{0, 5, 135}: "Locus, Incorporated", + [3]byte{0, 5, 136}: "Sensoria Corp.", + [3]byte{0, 5, 137}: "National Datacomputer", + [3]byte{0, 5, 138}: "Netcom Co., Ltd.", + [3]byte{0, 5, 139}: "IPmental, Inc.", + [3]byte{0, 5, 140}: "Opentech Inc.", + [3]byte{0, 5, 141}: "Lynx Photonic Networks, Inc.", + [3]byte{0, 5, 142}: "Flextronics International GmbH & Co. Nfg. KG", + [3]byte{0, 5, 143}: "CLCsoft co.", + [3]byte{0, 5, 144}: "Swissvoice Ltd.", + [3]byte{0, 5, 145}: "Active Silicon Ltd", + [3]byte{0, 5, 146}: "Pultek Corp.", + [3]byte{0, 5, 147}: "Grammar Engine Inc.", + [3]byte{0, 5, 148}: "IXXAT Automation GmbH", + [3]byte{0, 5, 149}: "Alesis Corporation", + [3]byte{0, 5, 150}: "Genotech Co., Ltd.", + [3]byte{0, 5, 151}: "Eagle Traffic Control Systems", + [3]byte{0, 5, 152}: "CRONOS S.r.l.", + [3]byte{0, 5, 153}: "DRS Test and Energy Management or DRS-TEM", + [3]byte{0, 5, 154}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 155}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 156}: "Kleinknecht GmbH, Ing. Büro", + [3]byte{0, 5, 157}: "Daniel Computing Systems, Inc.", + [3]byte{0, 5, 158}: "Zinwell Corporation", + [3]byte{0, 5, 159}: "Yotta Networks, Inc.", + [3]byte{0, 5, 160}: "MOBILINE Kft.", + [3]byte{0, 5, 161}: "Zenocom", + [3]byte{0, 5, 162}: "CELOX Networks", + [3]byte{0, 5, 163}: "QEI, Inc.", + [3]byte{0, 5, 164}: "Lucid Voice Ltd.", + [3]byte{0, 5, 165}: "KOTT", + [3]byte{0, 5, 166}: "Extron Electronics", + [3]byte{0, 5, 167}: "Hyperchip, Inc.", + [3]byte{0, 5, 168}: "WYLE ELECTRONICS", + [3]byte{0, 5, 169}: "Princeton Networks, Inc.", + [3]byte{0, 5, 170}: "Moore Industries International Inc.", + [3]byte{0, 5, 171}: "Cyber Fone, Inc.", + [3]byte{0, 5, 172}: "Northern Digital, Inc.", + [3]byte{0, 5, 173}: "Topspin Communications, Inc.", + [3]byte{0, 5, 174}: "Mediaport USA", + [3]byte{0, 5, 175}: "InnoScan Computing A/S", + [3]byte{0, 5, 176}: "Korea Computer Technology Co., Ltd.", + [3]byte{0, 5, 177}: "ASB Technology BV", + [3]byte{0, 5, 178}: "Medison Co., Ltd.", + [3]byte{0, 5, 179}: "Asahi-Engineering Co., Ltd.", + [3]byte{0, 5, 180}: "Aceex Corporation", + [3]byte{0, 5, 181}: "Broadcom Technologies", + [3]byte{0, 5, 182}: "INSYS Microelectronics GmbH", + [3]byte{0, 5, 183}: "Arbor Technology Corp.", + [3]byte{0, 5, 184}: "Electronic Design Associates, Inc.", + [3]byte{0, 5, 185}: "Airvana, Inc.", + [3]byte{0, 5, 186}: "Area Netwoeks, Inc.", + [3]byte{0, 5, 187}: "Myspace AB", + [3]byte{0, 5, 188}: "Resource Data Management Ltd", + [3]byte{0, 5, 189}: "ROAX BV", + [3]byte{0, 5, 190}: "Kongsberg Seatex AS", + [3]byte{0, 5, 191}: "JustEzy Technology, Inc.", + [3]byte{0, 5, 192}: "Digital Network Alacarte Co., Ltd.", + [3]byte{0, 5, 193}: "A-Kyung Motion, Inc.", + [3]byte{0, 5, 194}: "Soronti, Inc.", + [3]byte{0, 5, 195}: "Pacific Instruments, Inc.", + [3]byte{0, 5, 196}: "Telect, Inc.", + [3]byte{0, 5, 197}: "Flaga HF", + [3]byte{0, 5, 198}: "Triz Communications", + [3]byte{0, 5, 199}: "I/F-COM A/S", + [3]byte{0, 5, 200}: "VERYTECH", + [3]byte{0, 5, 201}: "LG Innotek Co., Ltd.", + [3]byte{0, 5, 202}: "Hitron Technology, Inc.", + [3]byte{0, 5, 203}: "ROIS Technologies, Inc.", + [3]byte{0, 5, 204}: "Sumtel Communications, Inc.", + [3]byte{0, 5, 205}: "Denon, Ltd.", + [3]byte{0, 5, 206}: "Prolink Microsystems Corporation", + [3]byte{0, 5, 207}: "Thunder River Technologies, Inc.", + [3]byte{0, 5, 208}: "Solinet Systems", + [3]byte{0, 5, 209}: "Metavector Technologies", + [3]byte{0, 5, 210}: "DAP Technologies", + [3]byte{0, 5, 211}: "eProduction Solutions, Inc.", + [3]byte{0, 5, 212}: "FutureSmart Networks, Inc.", + [3]byte{0, 5, 213}: "Speedcom Wireless", + [3]byte{0, 5, 214}: "L-3 Linkabit", + [3]byte{0, 5, 215}: "Vista Imaging, Inc.", + [3]byte{0, 5, 216}: "Arescom, Inc.", + [3]byte{0, 5, 217}: "Techno Valley, Inc.", + [3]byte{0, 5, 218}: "Apex Automationstechnik", + [3]byte{0, 5, 219}: "PSI Nentec GmbH", + [3]byte{0, 5, 220}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 221}: "CISCO SYSTEMS, INC.", + [3]byte{0, 5, 222}: "Gi Fone Korea, Inc.", + [3]byte{0, 5, 223}: "Electronic Innovation, Inc.", + [3]byte{0, 5, 224}: "Empirix Corp.", + [3]byte{0, 5, 225}: "Trellis Photonics, Ltd.", + [3]byte{0, 5, 226}: "Creativ Network Technologies", + [3]byte{0, 5, 227}: "LightSand Communications, Inc.", + [3]byte{0, 5, 228}: "Red Lion Controls Inc.", + [3]byte{0, 5, 229}: "Renishaw PLC", + [3]byte{0, 5, 230}: "Egenera, Inc.", + [3]byte{0, 5, 231}: "Netrake an AudioCodes Company", + [3]byte{0, 5, 232}: "TurboWave, Inc.", + [3]byte{0, 5, 233}: "Unicess Network, Inc.", + [3]byte{0, 5, 234}: "Rednix", + [3]byte{0, 5, 235}: "Blue Ridge Networks, Inc.", + [3]byte{0, 5, 236}: "Mosaic Systems Inc.", + [3]byte{0, 5, 237}: "Technikum Joanneum GmbH", + [3]byte{0, 5, 238}: "Siemens AB, Infrastructure & Cities, Building Technologies Division, IC BT SSP SP BA PR", + [3]byte{0, 5, 239}: "ADOIR Digital Technology", + [3]byte{0, 5, 240}: "SATEC", + [3]byte{0, 5, 241}: "Vrcom, Inc.", + [3]byte{0, 5, 242}: "Power R, Inc.", + [3]byte{0, 5, 243}: "Webyn", + [3]byte{0, 5, 244}: "System Base Co., Ltd.", + [3]byte{0, 5, 245}: "Geospace Technologies", + [3]byte{0, 5, 246}: "Young Chang Co. Ltd.", + [3]byte{0, 5, 247}: "Analog Devices, Inc.", + [3]byte{0, 5, 248}: "Real Time Access, Inc.", + [3]byte{0, 5, 249}: "TOA Corporation", + [3]byte{0, 5, 250}: "IPOptical, Inc.", + [3]byte{0, 5, 251}: "ShareGate, Inc.", + [3]byte{0, 5, 252}: "Schenck Pegasus Corp.", + [3]byte{0, 5, 253}: "PacketLight Networks Ltd.", + [3]byte{0, 5, 254}: "Traficon N.V.", + [3]byte{0, 5, 255}: "SNS Solutions, Inc.", + [3]byte{0, 6, 0}: "Toshiba Teli Corporation", + [3]byte{0, 6, 1}: "Otanikeiki Co., Ltd.", + [3]byte{0, 6, 2}: "Cirkitech Electronics Co.", + [3]byte{0, 6, 3}: "Baker Hughes Inc.", + [3]byte{0, 6, 4}: "@Track Communications, Inc.", + [3]byte{0, 6, 5}: "Inncom International, Inc.", + [3]byte{0, 6, 6}: "RapidWAN, Inc.", + [3]byte{0, 6, 7}: "Omni Directional Control Technology Inc.", + [3]byte{0, 6, 8}: "At-Sky SAS", + [3]byte{0, 6, 9}: "Crossport Systems", + [3]byte{0, 6, 10}: "Blue2space", + [3]byte{0, 6, 11}: "Artesyn Embedded Technologies", + [3]byte{0, 6, 12}: "Melco Industries, Inc.", + [3]byte{0, 6, 13}: "Wave7 Optics", + [3]byte{0, 6, 14}: "IGYS Systems, Inc.", + [3]byte{0, 6, 15}: "Narad Networks Inc", + [3]byte{0, 6, 16}: "Abeona Networks Inc", + [3]byte{0, 6, 17}: "Zeus Wireless, Inc.", + [3]byte{0, 6, 18}: "Accusys, Inc.", + [3]byte{0, 6, 19}: "Kawasaki Microelectronics Incorporated", + [3]byte{0, 6, 20}: "Prism Holdings", + [3]byte{0, 6, 21}: "Kimoto Electric Co., Ltd.", + [3]byte{0, 6, 22}: "Tel Net Co., Ltd.", + [3]byte{0, 6, 23}: "Redswitch Inc.", + [3]byte{0, 6, 24}: "DigiPower Manufacturing Inc.", + [3]byte{0, 6, 25}: "Connection Technology Systems", + [3]byte{0, 6, 26}: "Zetari Inc.", + [3]byte{0, 6, 27}: "Notebook Development Lab. Lenovo Japan Ltd.", + [3]byte{0, 6, 28}: "Hoshino Metal Industries, Ltd.", + [3]byte{0, 6, 29}: "MIP Telecom, Inc.", + [3]byte{0, 6, 30}: "Maxan Systems", + [3]byte{0, 6, 31}: "Vision Components GmbH", + [3]byte{0, 6, 32}: "Serial System Ltd.", + [3]byte{0, 6, 33}: "Hinox, Co., Ltd.", + [3]byte{0, 6, 34}: "Chung Fu Chen Yeh Enterprise Corp.", + [3]byte{0, 6, 35}: "MGE UPS Systems France", + [3]byte{0, 6, 36}: "Gentner Communications Corp.", + [3]byte{0, 6, 37}: "The Linksys Group, Inc.", + [3]byte{0, 6, 38}: "MWE GmbH", + [3]byte{0, 6, 39}: "Uniwide Technologies, Inc.", + [3]byte{0, 6, 40}: "CISCO SYSTEMS, INC.", + [3]byte{0, 6, 41}: "IBM Corp", + [3]byte{0, 6, 42}: "CISCO SYSTEMS, INC.", + [3]byte{0, 6, 43}: "INTRASERVER TECHNOLOGY", + [3]byte{0, 6, 44}: "Bivio Networks", + [3]byte{0, 6, 45}: "TouchStar Technologies, L.L.C.", + [3]byte{0, 6, 46}: "Aristos Logic Corp.", + [3]byte{0, 6, 47}: "Pivotech Systems Inc.", + [3]byte{0, 6, 48}: "Adtranz Sweden", + [3]byte{0, 6, 49}: "Calix", + [3]byte{0, 6, 50}: "Mesco Engineering GmbH", + [3]byte{0, 6, 51}: "Cross Match Technologies GmbH", + [3]byte{0, 6, 52}: "GTE Airfone Inc.", + [3]byte{0, 6, 53}: "PacketAir Networks, Inc.", + [3]byte{0, 6, 54}: "Jedai Broadband Networks", + [3]byte{0, 6, 55}: "Toptrend-Meta Information (ShenZhen) Inc.", + [3]byte{0, 6, 56}: "Sungjin C&C Co., Ltd.", + [3]byte{0, 6, 57}: "Newtec", + [3]byte{0, 6, 58}: "Dura Micro, Inc.", + [3]byte{0, 6, 59}: "Arcturus Networks Inc.", + [3]byte{0, 6, 60}: "Intrinsyc Software International Inc.", + [3]byte{0, 6, 61}: "Microwave Data Systems Inc.", + [3]byte{0, 6, 62}: "Opthos Inc.", + [3]byte{0, 6, 63}: "Everex Communications Inc.", + [3]byte{0, 6, 64}: "White Rock Networks", + [3]byte{0, 6, 65}: "ITCN", + [3]byte{0, 6, 66}: "Genetel Systems Inc.", + [3]byte{0, 6, 67}: "SONO Computer Co., Ltd.", + [3]byte{0, 6, 68}: "Neix,Inc", + [3]byte{0, 6, 69}: "Meisei Electric Co. Ltd.", + [3]byte{0, 6, 70}: "ShenZhen XunBao Network Technology Co Ltd", + [3]byte{0, 6, 71}: "Etrali S.A.", + [3]byte{0, 6, 72}: "Seedsware, Inc.", + [3]byte{0, 6, 73}: "3M Deutschland GmbH", + [3]byte{0, 6, 74}: "Honeywell Co., Ltd. (KOREA)", + [3]byte{0, 6, 75}: "Alexon Co., Ltd.", + [3]byte{0, 6, 76}: "Invicta Networks, Inc.", + [3]byte{0, 6, 77}: "Sencore", + [3]byte{0, 6, 78}: "Broad Net Technology Inc.", + [3]byte{0, 6, 79}: "PRO-NETS Technology Corporation", + [3]byte{0, 6, 80}: "Tiburon Networks, Inc.", + [3]byte{0, 6, 81}: "Aspen Networks Inc.", + [3]byte{0, 6, 82}: "CISCO SYSTEMS, INC.", + [3]byte{0, 6, 83}: "CISCO SYSTEMS, INC.", + [3]byte{0, 6, 84}: "Winpresa Building Automation Technologies GmbH", + [3]byte{0, 6, 85}: "Yipee, Inc.", + [3]byte{0, 6, 86}: "Tactel AB", + [3]byte{0, 6, 87}: "Market Central, Inc.", + [3]byte{0, 6, 88}: "Helmut Fischer GmbH Institut für Elektronik und Messtechnik", + [3]byte{0, 6, 89}: "EAL (Apeldoorn) B.V.", + [3]byte{0, 6, 90}: "Strix Systems", + [3]byte{0, 6, 91}: "Dell Computer Corp.", + [3]byte{0, 6, 92}: "Malachite Technologies, Inc.", + [3]byte{0, 6, 93}: "Heidelberg Web Systems", + [3]byte{0, 6, 94}: "Photuris, Inc.", + [3]byte{0, 6, 95}: "ECI Telecom - NGTS Ltd.", + [3]byte{0, 6, 96}: "NADEX Co., Ltd.", + [3]byte{0, 6, 97}: "NIA Home Technologies Corp.", + [3]byte{0, 6, 98}: "MBM Technology Ltd.", + [3]byte{0, 6, 99}: "Human Technology Co., Ltd.", + [3]byte{0, 6, 100}: "Fostex Corporation", + [3]byte{0, 6, 101}: "Sunny Giken, Inc.", + [3]byte{0, 6, 102}: "Roving Networks", + [3]byte{0, 6, 103}: "Tripp Lite", + [3]byte{0, 6, 104}: "Vicon Industries Inc.", + [3]byte{0, 6, 105}: "Datasound Laboratories Ltd", + [3]byte{0, 6, 106}: "InfiniCon Systems, Inc.", + [3]byte{0, 6, 107}: "Sysmex Corporation", + [3]byte{0, 6, 108}: "Robinson Corporation", + [3]byte{0, 6, 109}: "Compuprint S.P.A.", + [3]byte{0, 6, 110}: "Delta Electronics, Inc.", + [3]byte{0, 6, 111}: "Korea Data Systems", + [3]byte{0, 6, 112}: "Upponetti Oy", + [3]byte{0, 6, 113}: "Softing AG", + [3]byte{0, 6, 114}: "Netezza", + [3]byte{0, 6, 115}: "TKH Security Solutions USA", + [3]byte{0, 6, 116}: "Spectrum Control, Inc.", + [3]byte{0, 6, 117}: "Banderacom, Inc.", + [3]byte{0, 6, 118}: "Novra Technologies Inc.", + [3]byte{0, 6, 119}: "SICK AG", + [3]byte{0, 6, 120}: "Marantz Brand Company", + [3]byte{0, 6, 121}: "Konami Corporation", + [3]byte{0, 6, 122}: "JMP Systems", + [3]byte{0, 6, 123}: "Toplink C&C Corporation", + [3]byte{0, 6, 124}: "CISCO SYSTEMS, INC.", + [3]byte{0, 6, 125}: "Takasago Ltd.", + [3]byte{0, 6, 126}: "WinCom Systems, Inc.", + [3]byte{0, 6, 127}: "Digeo, Inc.", + [3]byte{0, 6, 128}: "Card Access, Inc.", + [3]byte{0, 6, 129}: "Goepel Electronic GmbH", + [3]byte{0, 6, 130}: "Convedia", + [3]byte{0, 6, 131}: "Bravara Communications, Inc.", + [3]byte{0, 6, 132}: "Biacore AB", + [3]byte{0, 6, 133}: "NetNearU Corporation", + [3]byte{0, 6, 134}: "ZARDCOM Co., Ltd.", + [3]byte{0, 6, 135}: "Omnitron Systems Technology, Inc.", + [3]byte{0, 6, 136}: "Telways Communication Co., Ltd.", + [3]byte{0, 6, 137}: "yLez Technologies Pte Ltd", + [3]byte{0, 6, 138}: "NeuronNet Co. Ltd. R&D Center", + [3]byte{0, 6, 139}: "AirRunner Technologies, Inc.", + [3]byte{0, 6, 140}: "3Com Corporation", + [3]byte{0, 6, 141}: "SEPATON, Inc.", + [3]byte{0, 6, 142}: "HID Corporation", + [3]byte{0, 6, 143}: "Telemonitor, Inc.", + [3]byte{0, 6, 144}: "Euracom Communication GmbH", + [3]byte{0, 6, 145}: "PT Inovacao", + [3]byte{0, 6, 146}: "Intruvert Networks, Inc.", + [3]byte{0, 6, 147}: "Flexus Computer Technology, Inc.", + [3]byte{0, 6, 148}: "Mobillian Corporation", + [3]byte{0, 6, 149}: "Ensure Technologies, Inc.", + [3]byte{0, 6, 150}: "Advent Networks", + [3]byte{0, 6, 151}: "R & D Center", + [3]byte{0, 6, 152}: "egnite GmbH", + [3]byte{0, 6, 153}: "Vida Design Co.", + [3]byte{0, 6, 154}: "e & Tel", + [3]byte{0, 6, 155}: "AVT Audio Video Technologies GmbH", + [3]byte{0, 6, 156}: "Transmode Systems AB", + [3]byte{0, 6, 157}: "Petards Ltd", + [3]byte{0, 6, 158}: "UNIQA, Inc.", + [3]byte{0, 6, 159}: "Kuokoa Networks", + [3]byte{0, 6, 160}: "Mx Imaging", + [3]byte{0, 6, 161}: "Celsian Technologies, Inc.", + [3]byte{0, 6, 162}: "Microtune, Inc.", + [3]byte{0, 6, 163}: "Bitran Corporation", + [3]byte{0, 6, 164}: "INNOWELL Corp.", + [3]byte{0, 6, 165}: "PINON Corp.", + [3]byte{0, 6, 166}: "Artistic Licence Engineering Ltd", + [3]byte{0, 6, 167}: "Primarion", + [3]byte{0, 6, 168}: "KC Technology, Inc.", + [3]byte{0, 6, 169}: "Universal Instruments Corp.", + [3]byte{0, 6, 170}: "VT Miltope", + [3]byte{0, 6, 171}: "W-Link Systems, Inc.", + [3]byte{0, 6, 172}: "Intersoft Co.", + [3]byte{0, 6, 173}: "KB Electronics Ltd.", + [3]byte{0, 6, 174}: "Himachal Futuristic Communications Ltd", + [3]byte{0, 6, 175}: "Xalted Networks", + [3]byte{0, 6, 176}: "Comtech EF Data Corp.", + [3]byte{0, 6, 177}: "Sonicwall", + [3]byte{0, 6, 178}: "Linxtek Co.", + [3]byte{0, 6, 179}: "Diagraph Corporation", + [3]byte{0, 6, 180}: "Vorne Industries, Inc.", + [3]byte{0, 6, 181}: "Source Photonics, Inc.", + [3]byte{0, 6, 182}: "Nir-Or Israel Ltd.", + [3]byte{0, 6, 183}: "TELEM GmbH", + [3]byte{0, 6, 184}: "Bandspeed Pty Ltd", + [3]byte{0, 6, 185}: "A5TEK Corp.", + [3]byte{0, 6, 186}: "Westwave Communications", + [3]byte{0, 6, 187}: "ATI Technologies Inc.", + [3]byte{0, 6, 188}: "Macrolink, Inc.", + [3]byte{0, 6, 189}: "BNTECHNOLOGY Co., Ltd.", + [3]byte{0, 6, 190}: "Baumer Optronic GmbH", + [3]byte{0, 6, 191}: "Accella Technologies Co., Ltd.", + [3]byte{0, 6, 192}: "United Internetworks, Inc.", + [3]byte{0, 6, 193}: "CISCO SYSTEMS, INC.", + [3]byte{0, 6, 194}: "Smartmatic Corporation", + [3]byte{0, 6, 195}: "Schindler Elevator Ltd.", + [3]byte{0, 6, 196}: "Piolink Inc.", + [3]byte{0, 6, 197}: "INNOVI Technologies Limited", + [3]byte{0, 6, 198}: "lesswire AG", + [3]byte{0, 6, 199}: "RFNET Technologies Pte Ltd (S)", + [3]byte{0, 6, 200}: "Sumitomo Metal Micro Devices, Inc.", + [3]byte{0, 6, 201}: "Technical Marketing Research, Inc.", + [3]byte{0, 6, 202}: "American Computer & Digital Components, Inc. (ACDC)", + [3]byte{0, 6, 203}: "Jotron Electronics A/S", + [3]byte{0, 6, 204}: "JMI Electronics Co., Ltd.", + [3]byte{0, 6, 205}: "Leaf Imaging Ltd.", + [3]byte{0, 6, 206}: "DATENO", + [3]byte{0, 6, 207}: "Thales Avionics In-Flight Systems, LLC", + [3]byte{0, 6, 208}: "Elgar Electronics Corp.", + [3]byte{0, 6, 209}: "Tahoe Networks, Inc.", + [3]byte{0, 6, 210}: "Tundra Semiconductor Corp.", + [3]byte{0, 6, 211}: "Alpha Telecom, Inc. U.S.A.", + [3]byte{0, 6, 212}: "Interactive Objects, Inc.", + [3]byte{0, 6, 213}: "Diamond Systems Corp.", + [3]byte{0, 6, 214}: "CISCO SYSTEMS, INC.", + [3]byte{0, 6, 215}: "CISCO SYSTEMS, INC.", + [3]byte{0, 6, 216}: "Maple Optical Systems", + [3]byte{0, 6, 217}: "IPM-Net S.p.A.", + [3]byte{0, 6, 218}: "ITRAN Communications Ltd.", + [3]byte{0, 6, 219}: "ICHIPS Co., Ltd.", + [3]byte{0, 6, 220}: "Syabas Technology (Amquest)", + [3]byte{0, 6, 221}: "AT & T Laboratories - Cambridge Ltd", + [3]byte{0, 6, 222}: "Flash Technology", + [3]byte{0, 6, 223}: "AIDONIC Corporation", + [3]byte{0, 6, 224}: "MAT Co., Ltd.", + [3]byte{0, 6, 225}: "Techno Trade s.a", + [3]byte{0, 6, 226}: "Ceemax Technology Co., Ltd.", + [3]byte{0, 6, 227}: "Quantitative Imaging Corporation", + [3]byte{0, 6, 228}: "Citel Technologies Ltd.", + [3]byte{0, 6, 229}: "Fujian Newland Computer Ltd. Co.", + [3]byte{0, 6, 230}: "DongYang Telecom Co., Ltd.", + [3]byte{0, 6, 231}: "Bit Blitz Communications Inc.", + [3]byte{0, 6, 232}: "Optical Network Testing, Inc.", + [3]byte{0, 6, 233}: "Intime Corp.", + [3]byte{0, 6, 234}: "ELZET80 Mikrocomputer GmbH&Co. KG", + [3]byte{0, 6, 235}: "Global Data", + [3]byte{0, 6, 236}: "Harris Corporation", + [3]byte{0, 6, 237}: "Inara Networks", + [3]byte{0, 6, 238}: "Shenyang Neu-era Information & Technology Stock Co., Ltd", + [3]byte{0, 6, 239}: "Maxxan Systems, Inc.", + [3]byte{0, 6, 240}: "Digeo, Inc.", + [3]byte{0, 6, 241}: "Optillion", + [3]byte{0, 6, 242}: "Platys Communications", + [3]byte{0, 6, 243}: "AcceLight Networks", + [3]byte{0, 6, 244}: "Prime Electronics & Satellitics Inc.", + [3]byte{0, 6, 245}: "ALPS Co,. Ltd.", + [3]byte{0, 6, 246}: "CISCO SYSTEMS, INC.", + [3]byte{0, 6, 247}: "ALPS Co,. Ltd.", + [3]byte{0, 6, 248}: "The Boeing Company", + [3]byte{0, 6, 249}: "Mitsui Zosen Systems Research Inc.", + [3]byte{0, 6, 250}: "IP SQUARE Co, Ltd.", + [3]byte{0, 6, 251}: "Hitachi Printing Solutions, Ltd.", + [3]byte{0, 6, 252}: "Fnet Co., Ltd.", + [3]byte{0, 6, 253}: "Comjet Information Systems Corp.", + [3]byte{0, 6, 254}: "Ambrado, Inc", + [3]byte{0, 6, 255}: "Sheba Systems Co., Ltd.", + [3]byte{0, 7, 0}: "Zettamedia Korea", + [3]byte{0, 7, 1}: "RACAL-DATACOM", + [3]byte{0, 7, 2}: "Varian Medical Systems", + [3]byte{0, 7, 3}: "CSEE Transport", + [3]byte{0, 7, 4}: "ALPS Co,. Ltd.", + [3]byte{0, 7, 5}: "Endress & Hauser GmbH & Co", + [3]byte{0, 7, 6}: "Sanritz Corporation", + [3]byte{0, 7, 7}: "Interalia Inc.", + [3]byte{0, 7, 8}: "Bitrage Inc.", + [3]byte{0, 7, 9}: "Westerstrand Urfabrik AB", + [3]byte{0, 7, 10}: "Unicom Automation Co., Ltd.", + [3]byte{0, 7, 11}: "Novabase SGPS, SA", + [3]byte{0, 7, 12}: "SVA-Intrusion.com Co. Ltd.", + [3]byte{0, 7, 13}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 14}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 15}: "Fujant, Inc.", + [3]byte{0, 7, 16}: "Adax, Inc.", + [3]byte{0, 7, 17}: "Acterna", + [3]byte{0, 7, 18}: "JAL Information Technology", + [3]byte{0, 7, 19}: "IP One, Inc.", + [3]byte{0, 7, 20}: "Brightcom", + [3]byte{0, 7, 21}: "General Research of Electronics, Inc.", + [3]byte{0, 7, 22}: "J & S Marine Ltd.", + [3]byte{0, 7, 23}: "Wieland Electric GmbH", + [3]byte{0, 7, 24}: "iCanTek Co., Ltd.", + [3]byte{0, 7, 25}: "Mobiis Co., Ltd.", + [3]byte{0, 7, 26}: "Finedigital Inc.", + [3]byte{0, 7, 27}: "CDVI Americas Ltd", + [3]byte{0, 7, 28}: "AT&T Fixed Wireless Services", + [3]byte{0, 7, 29}: "Satelsa Sistemas Y Aplicaciones De Telecomunicaciones, S.A.", + [3]byte{0, 7, 30}: "Tri-M Engineering / Nupak Dev. Corp.", + [3]byte{0, 7, 31}: "European Systems Integration", + [3]byte{0, 7, 32}: "Trutzschler GmbH & Co. KG", + [3]byte{0, 7, 33}: "Formac Elektronik GmbH", + [3]byte{0, 7, 34}: "The Nielsen Company", + [3]byte{0, 7, 35}: "ELCON Systemtechnik GmbH", + [3]byte{0, 7, 36}: "Telemax Co., Ltd.", + [3]byte{0, 7, 37}: "Bematech International Corp.", + [3]byte{0, 7, 38}: "Shenzhen Gongjin Electronics Co., Ltd.", + [3]byte{0, 7, 39}: "Zi Corporation (HK) Ltd.", + [3]byte{0, 7, 40}: "Neo Telecom", + [3]byte{0, 7, 41}: "Kistler Instrumente AG", + [3]byte{0, 7, 42}: "Innovance Networks", + [3]byte{0, 7, 43}: "Jung Myung Telecom Co., Ltd.", + [3]byte{0, 7, 44}: "Fabricom", + [3]byte{0, 7, 45}: "CNSystems", + [3]byte{0, 7, 46}: "North Node AB", + [3]byte{0, 7, 47}: "Intransa, Inc.", + [3]byte{0, 7, 48}: "Hutchison OPTEL Telecom Technology Co., Ltd.", + [3]byte{0, 7, 49}: "Ophir-Spiricon LLC", + [3]byte{0, 7, 50}: "AAEON Technology Inc.", + [3]byte{0, 7, 51}: "DANCONTROL Engineering", + [3]byte{0, 7, 52}: "ONStor, Inc.", + [3]byte{0, 7, 53}: "Flarion Technologies, Inc.", + [3]byte{0, 7, 54}: "Data Video Technologies Co., Ltd.", + [3]byte{0, 7, 55}: "Soriya Co. Ltd.", + [3]byte{0, 7, 56}: "Young Technology Co., Ltd.", + [3]byte{0, 7, 57}: "Scotty Group Austria Gmbh", + [3]byte{0, 7, 58}: "Inventel Systemes", + [3]byte{0, 7, 59}: "Tenovis GmbH & Co KG", + [3]byte{0, 7, 60}: "Telecom Design", + [3]byte{0, 7, 61}: "Nanjing Postel Telecommunications Co., Ltd.", + [3]byte{0, 7, 62}: "China Great-Wall Computer Shenzhen Co., Ltd.", + [3]byte{0, 7, 63}: "Woojyun Systec Co., Ltd.", + [3]byte{0, 7, 64}: "Buffalo Inc.", + [3]byte{0, 7, 65}: "Sierra Automated Systems", + [3]byte{0, 7, 66}: "Current Technologies, LLC", + [3]byte{0, 7, 67}: "Chelsio Communications", + [3]byte{0, 7, 68}: "Unico, Inc.", + [3]byte{0, 7, 69}: "Radlan Computer Communications Ltd.", + [3]byte{0, 7, 70}: "TURCK, Inc.", + [3]byte{0, 7, 71}: "Mecalc", + [3]byte{0, 7, 72}: "The Imaging Source Europe", + [3]byte{0, 7, 73}: "CENiX Inc.", + [3]byte{0, 7, 74}: "Carl Valentin GmbH", + [3]byte{0, 7, 75}: "Daihen Corporation", + [3]byte{0, 7, 76}: "Beicom Inc.", + [3]byte{0, 7, 77}: "Zebra Technologies Corp.", + [3]byte{0, 7, 78}: "IPFRONT Inc", + [3]byte{0, 7, 79}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 80}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 81}: "m-u-t AG", + [3]byte{0, 7, 82}: "Rhythm Watch Co., Ltd.", + [3]byte{0, 7, 83}: "Beijing Qxcomm Technology Co., Ltd.", + [3]byte{0, 7, 84}: "Xyterra Computing, Inc.", + [3]byte{0, 7, 85}: "Lafon", + [3]byte{0, 7, 86}: "Juyoung Telecom", + [3]byte{0, 7, 87}: "Topcall International AG", + [3]byte{0, 7, 88}: "Dragonwave", + [3]byte{0, 7, 89}: "Boris Manufacturing Corp.", + [3]byte{0, 7, 90}: "Air Products and Chemicals, Inc.", + [3]byte{0, 7, 91}: "Gibson Guitars", + [3]byte{0, 7, 92}: "Eastman Kodak Company", + [3]byte{0, 7, 93}: "Celleritas Inc.", + [3]byte{0, 7, 94}: "Ametek Power Instruments", + [3]byte{0, 7, 95}: "VCS Video Communication Systems AG", + [3]byte{0, 7, 96}: "TOMIS Information & Telecom Corp.", + [3]byte{0, 7, 97}: "Logitech Europe SA", + [3]byte{0, 7, 98}: "Group Sense Limited", + [3]byte{0, 7, 99}: "Sunniwell Cyber Tech. Co., Ltd.", + [3]byte{0, 7, 100}: "YoungWoo Telecom Co. Ltd.", + [3]byte{0, 7, 101}: "Jade Quantum Technologies, Inc.", + [3]byte{0, 7, 102}: "Chou Chin Industrial Co., Ltd.", + [3]byte{0, 7, 103}: "Yuxing Electronics Company Limited", + [3]byte{0, 7, 104}: "Danfoss A/S", + [3]byte{0, 7, 105}: "Italiana Macchi SpA", + [3]byte{0, 7, 106}: "NEXTEYE Co., Ltd.", + [3]byte{0, 7, 107}: "Stralfors AB", + [3]byte{0, 7, 108}: "Daehanet, Inc.", + [3]byte{0, 7, 109}: "Flexlight Networks", + [3]byte{0, 7, 110}: "Sinetica Corporation Limited", + [3]byte{0, 7, 111}: "Synoptics Limited", + [3]byte{0, 7, 112}: "Ubiquoss Inc", + [3]byte{0, 7, 113}: "Embedded System Corporation", + [3]byte{0, 7, 114}: "Alcatel Shanghai Bell Co., Ltd.", + [3]byte{0, 7, 115}: "Ascom Powerline Communications Ltd.", + [3]byte{0, 7, 116}: "GuangZhou Thinker Technology Co. Ltd.", + [3]byte{0, 7, 117}: "Valence Semiconductor, Inc.", + [3]byte{0, 7, 118}: "Federal APD", + [3]byte{0, 7, 119}: "Motah Ltd.", + [3]byte{0, 7, 120}: "GERSTEL GmbH & Co. KG", + [3]byte{0, 7, 121}: "Sungil Telecom Co., Ltd.", + [3]byte{0, 7, 122}: "Infoware System Co., Ltd.", + [3]byte{0, 7, 123}: "Millimetrix Broadband Networks", + [3]byte{0, 7, 124}: "Westermo Teleindustri AB", + [3]byte{0, 7, 125}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 126}: "Elrest GmbH", + [3]byte{0, 7, 127}: "J Communications Co., Ltd.", + [3]byte{0, 7, 128}: "Bluegiga Technologies OY", + [3]byte{0, 7, 129}: "Itron Inc.", + [3]byte{0, 7, 130}: "Oracle Corporation", + [3]byte{0, 7, 131}: "SynCom Network, Inc.", + [3]byte{0, 7, 132}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 133}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 134}: "Wireless Networks Inc.", + [3]byte{0, 7, 135}: "Idea System Co., Ltd.", + [3]byte{0, 7, 136}: "Clipcomm, Inc.", + [3]byte{0, 7, 137}: "DONGWON SYSTEMS", + [3]byte{0, 7, 138}: "Mentor Data System Inc.", + [3]byte{0, 7, 139}: "Wegener Communications, Inc.", + [3]byte{0, 7, 140}: "Elektronikspecialisten i Borlange AB", + [3]byte{0, 7, 141}: "NetEngines Ltd.", + [3]byte{0, 7, 142}: "Garz & Friche GmbH", + [3]byte{0, 7, 143}: "Emkay Innovative Products", + [3]byte{0, 7, 144}: "Tri-M Technologies (s) Limited", + [3]byte{0, 7, 145}: "International Data Communications, Inc.", + [3]byte{0, 7, 146}: "Sütron Electronic GmbH", + [3]byte{0, 7, 147}: "Shin Satellite Public Company Limited", + [3]byte{0, 7, 148}: "Simple Devices, Inc.", + [3]byte{0, 7, 149}: "Elitegroup Computer System Co. (ECS)", + [3]byte{0, 7, 150}: "LSI Systems, Inc.", + [3]byte{0, 7, 151}: "Netpower Co., Ltd.", + [3]byte{0, 7, 152}: "Selea SRL", + [3]byte{0, 7, 153}: "Tipping Point Technologies, Inc.", + [3]byte{0, 7, 154}: "Verint Systems Inc", + [3]byte{0, 7, 155}: "Aurora Networks", + [3]byte{0, 7, 156}: "Golden Electronics Technology Co., Ltd.", + [3]byte{0, 7, 157}: "Musashi Co., Ltd.", + [3]byte{0, 7, 158}: "Ilinx Co., Ltd.", + [3]byte{0, 7, 159}: "Action Digital Inc.", + [3]byte{0, 7, 160}: "e-Watch Inc.", + [3]byte{0, 7, 161}: "VIASYS Healthcare GmbH", + [3]byte{0, 7, 162}: "Opteon Corporation", + [3]byte{0, 7, 163}: "Ositis Software, Inc.", + [3]byte{0, 7, 164}: "GN Netcom Ltd.", + [3]byte{0, 7, 165}: "Y.D.K Co. Ltd.", + [3]byte{0, 7, 166}: "Home Automation, Inc.", + [3]byte{0, 7, 167}: "A-Z Inc.", + [3]byte{0, 7, 168}: "Haier Group Technologies Ltd.", + [3]byte{0, 7, 169}: "Novasonics", + [3]byte{0, 7, 170}: "Quantum Data Inc.", + [3]byte{0, 7, 171}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 7, 172}: "Eolring", + [3]byte{0, 7, 173}: "Pentacon GmbH Foto-und Feinwerktechnik", + [3]byte{0, 7, 174}: "Britestream Networks, Inc.", + [3]byte{0, 7, 175}: "N-TRON Corporation", + [3]byte{0, 7, 176}: "Office Details, Inc.", + [3]byte{0, 7, 177}: "Equator Technologies", + [3]byte{0, 7, 178}: "Transaccess S.A.", + [3]byte{0, 7, 179}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 180}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 181}: "Any One Wireless Ltd.", + [3]byte{0, 7, 182}: "Telecom Technology Ltd.", + [3]byte{0, 7, 183}: "Samurai Ind. Prods Eletronicos Ltda", + [3]byte{0, 7, 184}: "Corvalent Corporation", + [3]byte{0, 7, 185}: "Ginganet Corporation", + [3]byte{0, 7, 186}: "UTStarcom, Inc.", + [3]byte{0, 7, 187}: "Candera Inc.", + [3]byte{0, 7, 188}: "Identix Inc.", + [3]byte{0, 7, 189}: "Radionet Ltd.", + [3]byte{0, 7, 190}: "DataLogic SpA", + [3]byte{0, 7, 191}: "Armillaire Technologies, Inc.", + [3]byte{0, 7, 192}: "NetZerver Inc.", + [3]byte{0, 7, 193}: "Overture Networks, Inc.", + [3]byte{0, 7, 194}: "Netsys Telecom", + [3]byte{0, 7, 195}: "Thomson", + [3]byte{0, 7, 196}: "JEAN Co. Ltd.", + [3]byte{0, 7, 197}: "Gcom, Inc.", + [3]byte{0, 7, 198}: "VDS Vosskuhler GmbH", + [3]byte{0, 7, 199}: "Synectics Systems Limited", + [3]byte{0, 7, 200}: "Brain21, Inc.", + [3]byte{0, 7, 201}: "Technol Seven Co., Ltd.", + [3]byte{0, 7, 202}: "Creatix Polymedia Ges Fur Kommunikaitonssysteme", + [3]byte{0, 7, 203}: "Freebox SA", + [3]byte{0, 7, 204}: "Kaba Benzing GmbH", + [3]byte{0, 7, 205}: "Kumoh Electronic Co, Ltd", + [3]byte{0, 7, 206}: "Cabletime Limited", + [3]byte{0, 7, 207}: "Anoto AB", + [3]byte{0, 7, 208}: "Automat Engenharia de Automação Ltda.", + [3]byte{0, 7, 209}: "Spectrum Signal Processing Inc.", + [3]byte{0, 7, 210}: "Logopak Systeme GmbH & Co. KG", + [3]byte{0, 7, 211}: "SPGPrints B.V.", + [3]byte{0, 7, 212}: "Zhejiang Yutong Network Communication Co Ltd.", + [3]byte{0, 7, 213}: "3e Technologies Int;., Inc.", + [3]byte{0, 7, 214}: "Commil Ltd.", + [3]byte{0, 7, 215}: "Caporis Networks AG", + [3]byte{0, 7, 216}: "Hitron Systems Inc.", + [3]byte{0, 7, 217}: "Splicecom", + [3]byte{0, 7, 218}: "Neuro Telecom Co., Ltd.", + [3]byte{0, 7, 219}: "Kirana Networks, Inc.", + [3]byte{0, 7, 220}: "Atek Co, Ltd.", + [3]byte{0, 7, 221}: "Cradle Technologies", + [3]byte{0, 7, 222}: "eCopilt AB", + [3]byte{0, 7, 223}: "Vbrick Systems Inc.", + [3]byte{0, 7, 224}: "Palm Inc.", + [3]byte{0, 7, 225}: "WIS Communications Co. Ltd.", + [3]byte{0, 7, 226}: "Bitworks, Inc.", + [3]byte{0, 7, 227}: "Navcom Technology, Inc.", + [3]byte{0, 7, 228}: "SoftRadio Co., Ltd.", + [3]byte{0, 7, 229}: "Coup Corporation", + [3]byte{0, 7, 230}: "edgeflow Canada Inc.", + [3]byte{0, 7, 231}: "FreeWave Technologies", + [3]byte{0, 7, 232}: "EdgeWave", + [3]byte{0, 7, 233}: "Intel Corporation", + [3]byte{0, 7, 234}: "Massana, Inc.", + [3]byte{0, 7, 235}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 236}: "CISCO SYSTEMS, INC.", + [3]byte{0, 7, 237}: "Altera Corporation", + [3]byte{0, 7, 238}: "telco Informationssysteme GmbH", + [3]byte{0, 7, 239}: "Lockheed Martin Tactical Systems", + [3]byte{0, 7, 240}: "LogiSync LLC", + [3]byte{0, 7, 241}: "TeraBurst Networks Inc.", + [3]byte{0, 7, 242}: "IOA Corporation", + [3]byte{0, 7, 243}: "Thinkengine Networks", + [3]byte{0, 7, 244}: "Eletex Co., Ltd.", + [3]byte{0, 7, 245}: "Bridgeco Co AG", + [3]byte{0, 7, 246}: "Qqest Software Systems", + [3]byte{0, 7, 247}: "Galtronics", + [3]byte{0, 7, 248}: "ITDevices, Inc.", + [3]byte{0, 7, 249}: "Sensaphone", + [3]byte{0, 7, 250}: "ITT Co., Ltd.", + [3]byte{0, 7, 251}: "Giga Stream UMTS Technologies GmbH", + [3]byte{0, 7, 252}: "Adept Systems Inc.", + [3]byte{0, 7, 253}: "LANergy Ltd.", + [3]byte{0, 7, 254}: "Rigaku Corporation", + [3]byte{0, 7, 255}: "Gluon Networks", + [3]byte{0, 8, 0}: "MULTITECH SYSTEMS, INC.", + [3]byte{0, 8, 1}: "HighSpeed Surfing Inc.", + [3]byte{0, 8, 2}: "Hewlett-Packard Company", + [3]byte{0, 8, 3}: "Cos Tron", + [3]byte{0, 8, 4}: "ICA Inc.", + [3]byte{0, 8, 5}: "Techno-Holon Corporation", + [3]byte{0, 8, 6}: "Raonet Systems, Inc.", + [3]byte{0, 8, 7}: "Access Devices Limited", + [3]byte{0, 8, 8}: "PPT Vision, Inc.", + [3]byte{0, 8, 9}: "Systemonic AG", + [3]byte{0, 8, 10}: "Espera-Werke GmbH", + [3]byte{0, 8, 11}: "Birka BPA Informationssystem AB", + [3]byte{0, 8, 12}: "VDA Elettronica spa", + [3]byte{0, 8, 13}: "Toshiba", + [3]byte{0, 8, 14}: "ARRIS Group, Inc.", + [3]byte{0, 8, 15}: "Proximion Fiber Optics AB", + [3]byte{0, 8, 16}: "Key Technology, Inc.", + [3]byte{0, 8, 17}: "VOIX Corporation", + [3]byte{0, 8, 18}: "GM-2 Corporation", + [3]byte{0, 8, 19}: "Diskbank, Inc.", + [3]byte{0, 8, 20}: "TIL Technologies", + [3]byte{0, 8, 21}: "CATS Co., Ltd.", + [3]byte{0, 8, 22}: "Bluelon ApS", + [3]byte{0, 8, 23}: "EmergeCore Networks LLC", + [3]byte{0, 8, 24}: "Pixelworks, Inc.", + [3]byte{0, 8, 25}: "Banksys", + [3]byte{0, 8, 26}: "Sanrad Intelligence Storage Communications (2000) Ltd.", + [3]byte{0, 8, 27}: "Windigo Systems", + [3]byte{0, 8, 28}: "@pos.com", + [3]byte{0, 8, 29}: "Ipsil, Incorporated", + [3]byte{0, 8, 30}: "Repeatit AB", + [3]byte{0, 8, 31}: "Pou Yuen Tech Corp. Ltd.", + [3]byte{0, 8, 32}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 33}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 34}: "InPro Comm", + [3]byte{0, 8, 35}: "Texa Corp.", + [3]byte{0, 8, 36}: "Nuance Document Imaging", + [3]byte{0, 8, 37}: "Acme Packet", + [3]byte{0, 8, 38}: "Colorado Med Tech", + [3]byte{0, 8, 39}: "ADB Broadband Italia", + [3]byte{0, 8, 40}: "Koei Engineering Ltd.", + [3]byte{0, 8, 41}: "Aval Nagasaki Corporation", + [3]byte{0, 8, 42}: "Powerwallz Network Security", + [3]byte{0, 8, 43}: "Wooksung Electronics, Inc.", + [3]byte{0, 8, 44}: "Homag AG", + [3]byte{0, 8, 45}: "Indus Teqsite Private Limited", + [3]byte{0, 8, 46}: "Multitone Electronics PLC", + [3]byte{0, 8, 47}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 48}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 49}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 50}: "Cisco", + [3]byte{0, 8, 78}: "DivergeNet, Inc.", + [3]byte{0, 8, 79}: "Qualstar Corporation", + [3]byte{0, 8, 80}: "Arizona Instrument Corp.", + [3]byte{0, 8, 81}: "Canadian Bank Note Company, Ltd.", + [3]byte{0, 8, 82}: "Davolink Co. Inc.", + [3]byte{0, 8, 83}: "Schleicher GmbH & Co. Relaiswerke KG", + [3]byte{0, 8, 84}: "Netronix, Inc.", + [3]byte{0, 8, 85}: "NASA-Goddard Space Flight Center", + [3]byte{0, 8, 86}: "Gamatronic Electronic Industries Ltd.", + [3]byte{0, 8, 87}: "Polaris Networks, Inc.", + [3]byte{0, 8, 88}: "Novatechnology Inc.", + [3]byte{0, 8, 89}: "ShenZhen Unitone Electronics Co., Ltd.", + [3]byte{0, 8, 90}: "IntiGate Inc.", + [3]byte{0, 8, 91}: "Hanbit Electronics Co., Ltd.", + [3]byte{0, 8, 92}: "Shanghai Dare Technologies Co. Ltd.", + [3]byte{0, 8, 93}: "Aastra", + [3]byte{0, 8, 94}: "PCO AG", + [3]byte{0, 8, 95}: "Picanol N.V.", + [3]byte{0, 8, 96}: "LodgeNet Entertainment Corp.", + [3]byte{0, 8, 97}: "SoftEnergy Co., Ltd.", + [3]byte{0, 8, 98}: "NEC Eluminant Technologies, Inc.", + [3]byte{0, 8, 99}: "Entrisphere Inc.", + [3]byte{0, 8, 100}: "Fasy S.p.A.", + [3]byte{0, 8, 101}: "JASCOM CO., LTD", + [3]byte{0, 8, 102}: "DSX Access Systems, Inc.", + [3]byte{0, 8, 103}: "Uptime Devices", + [3]byte{0, 8, 104}: "PurOptix", + [3]byte{0, 8, 105}: "Command-e Technology Co.,Ltd.", + [3]byte{0, 8, 106}: "Securiton Gmbh", + [3]byte{0, 8, 107}: "MIPSYS", + [3]byte{0, 8, 108}: "Plasmon LMS", + [3]byte{0, 8, 109}: "Missouri FreeNet", + [3]byte{0, 8, 110}: "Hyglo AB", + [3]byte{0, 8, 111}: "Resources Computer Network Ltd.", + [3]byte{0, 8, 112}: "Rasvia Systems, Inc.", + [3]byte{0, 8, 113}: "NORTHDATA Co., Ltd.", + [3]byte{0, 8, 114}: "Sorenson Communications", + [3]byte{0, 8, 115}: "DapTechnology B.V.", + [3]byte{0, 8, 116}: "Dell Computer Corp.", + [3]byte{0, 8, 117}: "Acorp Electronics Corp.", + [3]byte{0, 8, 118}: "SDSystem", + [3]byte{0, 8, 119}: "Liebert-Hiross Spa", + [3]byte{0, 8, 120}: "Benchmark Storage Innovations", + [3]byte{0, 8, 121}: "CEM Corporation", + [3]byte{0, 8, 122}: "Wipotec GmbH", + [3]byte{0, 8, 123}: "RTX Telecom A/S", + [3]byte{0, 8, 124}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 125}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 126}: "Bon Electro-Telecom Inc.", + [3]byte{0, 8, 127}: "SPAUN electronic GmbH & Co. KG", + [3]byte{0, 8, 128}: "BroadTel Canada Communications inc.", + [3]byte{0, 8, 129}: "DIGITAL HANDS CO.,LTD.", + [3]byte{0, 8, 130}: "SIGMA CORPORATION", + [3]byte{0, 8, 131}: "Hewlett-Packard Company", + [3]byte{0, 8, 132}: "Index Braille AB", + [3]byte{0, 8, 133}: "EMS Dr. Thomas Wünsche", + [3]byte{0, 8, 134}: "Hansung Teliann, Inc.", + [3]byte{0, 8, 135}: "Maschinenfabrik Reinhausen GmbH", + [3]byte{0, 8, 136}: "OULLIM Information Technology Inc,.", + [3]byte{0, 8, 137}: "Echostar Technologies Corp", + [3]byte{0, 8, 138}: "Minds@Work", + [3]byte{0, 8, 139}: "Tropic Networks Inc.", + [3]byte{0, 8, 140}: "Quanta Network Systems Inc.", + [3]byte{0, 8, 141}: "Sigma-Links Inc.", + [3]byte{0, 8, 142}: "Nihon Computer Co., Ltd.", + [3]byte{0, 8, 143}: "ADVANCED DIGITAL TECHNOLOGY", + [3]byte{0, 8, 144}: "AVILINKS SA", + [3]byte{0, 8, 145}: "Lyan Inc.", + [3]byte{0, 8, 146}: "EM Solutions", + [3]byte{0, 8, 147}: "LE INFORMATION COMMUNICATION INC.", + [3]byte{0, 8, 148}: "InnoVISION Multimedia Ltd.", + [3]byte{0, 8, 149}: "DIRC Technologie GmbH & Co.KG", + [3]byte{0, 8, 150}: "Printronix, Inc.", + [3]byte{0, 8, 151}: "Quake Technologies", + [3]byte{0, 8, 152}: "Gigabit Optics Corporation", + [3]byte{0, 8, 153}: "Netbind, Inc.", + [3]byte{0, 8, 154}: "Alcatel Microelectronics", + [3]byte{0, 8, 155}: "ICP Electronics Inc.", + [3]byte{0, 8, 156}: "Elecs Industry Co., Ltd.", + [3]byte{0, 8, 157}: "UHD-Elektronik", + [3]byte{0, 8, 158}: "Beijing Enter-Net co.LTD", + [3]byte{0, 8, 159}: "EFM Networks", + [3]byte{0, 8, 160}: "Stotz Feinmesstechnik GmbH", + [3]byte{0, 8, 161}: "CNet Technology Inc.", + [3]byte{0, 8, 162}: "ADI Engineering, Inc.", + [3]byte{0, 8, 163}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 164}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 165}: "Peninsula Systems Inc.", + [3]byte{0, 8, 166}: "Multiware & Image Co., Ltd.", + [3]byte{0, 8, 167}: "iLogic Inc.", + [3]byte{0, 8, 168}: "Systec Co., Ltd.", + [3]byte{0, 8, 169}: "SangSang Technology, Inc.", + [3]byte{0, 8, 170}: "KARAM", + [3]byte{0, 8, 171}: "EnerLinx.com, Inc.", + [3]byte{0, 8, 172}: "Eltromat GmbH", + [3]byte{0, 8, 173}: "Toyo-Linx Co., Ltd.", + [3]byte{0, 8, 174}: "PacketFront Network Products AB", + [3]byte{0, 8, 175}: "Novatec Corporation", + [3]byte{0, 8, 176}: "BKtel communications GmbH", + [3]byte{0, 8, 177}: "ProQuent Systems", + [3]byte{0, 8, 178}: "SHENZHEN COMPASS TECHNOLOGY DEVELOPMENT CO.,LTD", + [3]byte{0, 8, 179}: "Fastwel", + [3]byte{0, 8, 180}: "SYSPOL", + [3]byte{0, 8, 181}: "TAI GUEN ENTERPRISE CO., LTD", + [3]byte{0, 8, 182}: "RouteFree, Inc.", + [3]byte{0, 8, 183}: "HIT Incorporated", + [3]byte{0, 8, 184}: "E.F. Johnson", + [3]byte{0, 8, 185}: "KAON MEDIA Co., Ltd.", + [3]byte{0, 8, 186}: "Erskine Systems Ltd", + [3]byte{0, 8, 187}: "NetExcell", + [3]byte{0, 8, 188}: "Ilevo AB", + [3]byte{0, 8, 189}: "TEPG-US", + [3]byte{0, 8, 190}: "XENPAK MSA Group", + [3]byte{0, 8, 191}: "Aptus Elektronik AB", + [3]byte{0, 8, 192}: "ASA SYSTEMS", + [3]byte{0, 8, 193}: "Avistar Communications Corporation", + [3]byte{0, 8, 194}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 195}: "Contex A/S", + [3]byte{0, 8, 196}: "Hikari Co.,Ltd.", + [3]byte{0, 8, 197}: "Liontech Co., Ltd.", + [3]byte{0, 8, 198}: "Philips Consumer Communications", + [3]byte{0, 8, 199}: "Hewlett-Packard Company", + [3]byte{0, 8, 200}: "Soneticom, Inc.", + [3]byte{0, 8, 201}: "TechniSat Digital GmbH", + [3]byte{0, 8, 202}: "TwinHan Technology Co.,Ltd", + [3]byte{0, 8, 203}: "Zeta Broadband Inc.", + [3]byte{0, 8, 204}: "Remotec, Inc.", + [3]byte{0, 8, 205}: "With-Net Inc", + [3]byte{0, 8, 206}: "IPMobileNet Inc.", + [3]byte{0, 8, 207}: "Nippon Koei Power Systems Co., Ltd.", + [3]byte{0, 8, 208}: "Musashi Engineering Co., LTD.", + [3]byte{0, 8, 209}: "KAREL INC.", + [3]byte{0, 8, 210}: "ZOOM Networks Inc.", + [3]byte{0, 8, 211}: "Hercules Technologies S.A.S.", + [3]byte{0, 8, 212}: "IneoQuest Technologies, Inc", + [3]byte{0, 8, 213}: "Vanguard Networks Solutions, LLC", + [3]byte{0, 8, 214}: "HASSNET Inc.", + [3]byte{0, 8, 215}: "HOW CORPORATION", + [3]byte{0, 8, 216}: "Dowkey Microwave", + [3]byte{0, 8, 217}: "Mitadenshi Co.,LTD", + [3]byte{0, 8, 218}: "SofaWare Technologies Ltd.", + [3]byte{0, 8, 219}: "Corrigent Systems", + [3]byte{0, 8, 220}: "Wiznet", + [3]byte{0, 8, 221}: "Telena Communications, Inc.", + [3]byte{0, 8, 222}: "3UP Systems", + [3]byte{0, 8, 223}: "Alistel Inc.", + [3]byte{0, 8, 224}: "ATO Technology Ltd.", + [3]byte{0, 8, 225}: "Barix AG", + [3]byte{0, 8, 226}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 227}: "CISCO SYSTEMS, INC.", + [3]byte{0, 8, 228}: "Envenergy Inc", + [3]byte{0, 8, 229}: "IDK Corporation", + [3]byte{0, 8, 230}: "Littlefeet", + [3]byte{0, 8, 231}: "SHI ControlSystems,Ltd.", + [3]byte{0, 8, 232}: "Excel Master Ltd.", + [3]byte{0, 8, 233}: "NextGig", + [3]byte{0, 8, 234}: "Motion Control Engineering, Inc", + [3]byte{0, 8, 235}: "ROMWin Co.,Ltd.", + [3]byte{0, 8, 236}: "Optical Zonu Corporation", + [3]byte{0, 8, 237}: "ST&T Instrument Corp.", + [3]byte{0, 8, 238}: "Logic Product Development", + [3]byte{0, 8, 239}: "DIBAL,S.A.", + [3]byte{0, 8, 240}: "Next Generation Systems, Inc.", + [3]byte{0, 8, 241}: "Voltaire", + [3]byte{0, 8, 242}: "C&S Technology", + [3]byte{0, 8, 243}: "WANY", + [3]byte{0, 8, 244}: "Bluetake Technology Co., Ltd.", + [3]byte{0, 8, 245}: "YESTECHNOLOGY Co.,Ltd.", + [3]byte{0, 8, 246}: "Sumitomo Electric System Solutions Co., Ltd.", + [3]byte{0, 8, 247}: "Hitachi Ltd, Semiconductor & Integrated Circuits Gr", + [3]byte{0, 8, 248}: "UTC CCS", + [3]byte{0, 8, 249}: "Artesyn Embedded Technologies", + [3]byte{0, 8, 250}: "Karl E.Brinkmann GmbH", + [3]byte{0, 8, 251}: "SonoSite, Inc.", + [3]byte{0, 8, 252}: "Gigaphoton Inc.", + [3]byte{0, 8, 253}: "BlueKorea Co., Ltd.", + [3]byte{0, 8, 254}: "UNIK C&C Co.,Ltd.", + [3]byte{0, 8, 255}: "Trilogy Communications Ltd", + [3]byte{0, 9, 0}: "TMT", + [3]byte{0, 9, 1}: "Shenzhen Shixuntong Information & Technoligy Co", + [3]byte{0, 9, 2}: "Redline Communications Inc.", + [3]byte{0, 9, 3}: "Panasas, Inc", + [3]byte{0, 9, 4}: "MONDIAL electronic", + [3]byte{0, 9, 5}: "iTEC Technologies Ltd.", + [3]byte{0, 9, 6}: "Esteem Networks", + [3]byte{0, 9, 7}: "Chrysalis Development", + [3]byte{0, 9, 8}: "VTech Technology Corp.", + [3]byte{0, 9, 9}: "Telenor Connect A/S", + [3]byte{0, 9, 10}: "SnedFar Technology Co., Ltd.", + [3]byte{0, 9, 11}: "MTL Instruments PLC", + [3]byte{0, 9, 12}: "Mayekawa Mfg. Co. Ltd.", + [3]byte{0, 9, 13}: "LEADER ELECTRONICS CORP.", + [3]byte{0, 9, 14}: "Helix Technology Inc.", + [3]byte{0, 9, 15}: "Fortinet Inc.", + [3]byte{0, 9, 16}: "Simple Access Inc.", + [3]byte{0, 9, 17}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 18}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 19}: "SystemK Corporation", + [3]byte{0, 9, 20}: "COMPUTROLS INC.", + [3]byte{0, 9, 21}: "CAS Corp.", + [3]byte{0, 9, 22}: "Listman Home Technologies, Inc.", + [3]byte{0, 9, 23}: "WEM Technology Inc", + [3]byte{0, 9, 24}: "SAMSUNG TECHWIN CO.,LTD", + [3]byte{0, 9, 25}: "MDS Gateways", + [3]byte{0, 9, 26}: "Macat Optics & Electronics Co., Ltd.", + [3]byte{0, 9, 27}: "Digital Generation Inc.", + [3]byte{0, 9, 28}: "CacheVision, Inc", + [3]byte{0, 9, 29}: "Proteam Computer Corporation", + [3]byte{0, 9, 30}: "Firstech Technology Corp.", + [3]byte{0, 9, 31}: "A&D Co., Ltd.", + [3]byte{0, 9, 32}: "EpoX COMPUTER CO.,LTD.", + [3]byte{0, 9, 33}: "Planmeca Oy", + [3]byte{0, 9, 34}: "TST Biometrics GmbH", + [3]byte{0, 9, 35}: "Heaman System Co., Ltd", + [3]byte{0, 9, 36}: "Telebau GmbH", + [3]byte{0, 9, 37}: "VSN Systemen BV", + [3]byte{0, 9, 38}: "YODA COMMUNICATIONS, INC.", + [3]byte{0, 9, 39}: "TOYOKEIKI CO.,LTD.", + [3]byte{0, 9, 40}: "Telecore", + [3]byte{0, 9, 41}: "Sanyo Industries (UK) Limited", + [3]byte{0, 9, 42}: "MYTECS Co.,Ltd.", + [3]byte{0, 9, 43}: "iQstor Networks, Inc.", + [3]byte{0, 9, 44}: "Hitpoint Inc.", + [3]byte{0, 9, 45}: "HTC Corporation", + [3]byte{0, 9, 46}: "B&Tech System Inc.", + [3]byte{0, 9, 47}: "Akom Technology Corporation", + [3]byte{0, 9, 48}: "AeroConcierge Inc.", + [3]byte{0, 9, 49}: "Future Internet, Inc.", + [3]byte{0, 9, 50}: "Omnilux", + [3]byte{0, 9, 51}: "Ophit Co.Ltd.", + [3]byte{0, 9, 52}: "Dream-Multimedia-Tv GmbH", + [3]byte{0, 9, 53}: "Sandvine Incorporated", + [3]byte{0, 9, 54}: "Ipetronik GmbH & Co. KG", + [3]byte{0, 9, 55}: "Inventec Appliance Corp", + [3]byte{0, 9, 56}: "Allot Communications", + [3]byte{0, 9, 57}: "ShibaSoku Co.,Ltd.", + [3]byte{0, 9, 58}: "Molex Fiber Optics", + [3]byte{0, 9, 59}: "HYUNDAI NETWORKS INC.", + [3]byte{0, 9, 60}: "Jacques Technologies P/L", + [3]byte{0, 9, 61}: "Newisys,Inc.", + [3]byte{0, 9, 62}: "C&I Technologies", + [3]byte{0, 9, 63}: "Double-Win Enterpirse CO., LTD", + [3]byte{0, 9, 64}: "AGFEO GmbH & Co. KG", + [3]byte{0, 9, 65}: "Allied Telesis K.K.", + [3]byte{0, 9, 66}: "Wireless Technologies, Inc", + [3]byte{0, 9, 67}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 68}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 69}: "Palmmicro Communications Inc", + [3]byte{0, 9, 70}: "Cluster Labs GmbH", + [3]byte{0, 9, 71}: "Aztek, Inc.", + [3]byte{0, 9, 72}: "Vista Control Systems, Corp.", + [3]byte{0, 9, 73}: "Glyph Technologies Inc.", + [3]byte{0, 9, 74}: "Homenet Communications", + [3]byte{0, 9, 75}: "FillFactory NV", + [3]byte{0, 9, 76}: "Communication Weaver Co.,Ltd.", + [3]byte{0, 9, 77}: "Braintree Communications Pty Ltd", + [3]byte{0, 9, 78}: "BARTECH SYSTEMS INTERNATIONAL, INC", + [3]byte{0, 9, 79}: "elmegt GmbH & Co. KG", + [3]byte{0, 9, 80}: "Independent Storage Corporation", + [3]byte{0, 9, 81}: "Apogee Imaging Systems", + [3]byte{0, 9, 82}: "Auerswald GmbH & Co. KG", + [3]byte{0, 9, 83}: "Linkage System Integration Co.Ltd.", + [3]byte{0, 9, 84}: "AMiT spol. s. r. o.", + [3]byte{0, 9, 85}: "Young Generation International Corp.", + [3]byte{0, 9, 86}: "Network Systems Group, Ltd. (NSG)", + [3]byte{0, 9, 87}: "Supercaller, Inc.", + [3]byte{0, 9, 88}: "INTELNET S.A.", + [3]byte{0, 9, 89}: "Sitecsoft", + [3]byte{0, 9, 90}: "RACEWOOD TECHNOLOGY", + [3]byte{0, 9, 91}: "Netgear, Inc.", + [3]byte{0, 9, 92}: "Philips Medical Systems - Cardiac and Monitoring Systems (CM", + [3]byte{0, 9, 93}: "Dialogue Technology Corp.", + [3]byte{0, 9, 94}: "Masstech Group Inc.", + [3]byte{0, 9, 95}: "Telebyte, Inc.", + [3]byte{0, 9, 96}: "YOZAN Inc.", + [3]byte{0, 9, 97}: "Switchgear and Instrumentation Ltd", + [3]byte{0, 9, 98}: "Sonitor Technologies AS", + [3]byte{0, 9, 99}: "Dominion Lasercom Inc.", + [3]byte{0, 9, 100}: "Hi-Techniques, Inc.", + [3]byte{0, 9, 101}: "HyunJu Computer Co., Ltd.", + [3]byte{0, 9, 102}: "Thales Navigation", + [3]byte{0, 9, 103}: "Tachyon, Inc", + [3]byte{0, 9, 104}: "TECHNOVENTURE, INC.", + [3]byte{0, 9, 105}: "Meret Optical Communications", + [3]byte{0, 9, 106}: "Cloverleaf Communications Inc.", + [3]byte{0, 9, 107}: "IBM Corp", + [3]byte{0, 9, 108}: "Imedia Semiconductor Corp.", + [3]byte{0, 9, 109}: "Powernet Technologies Corp.", + [3]byte{0, 9, 110}: "GIANT ELECTRONICS LTD.", + [3]byte{0, 9, 111}: "Beijing Zhongqing Elegant Tech. Corp.,Limited", + [3]byte{0, 9, 112}: "Vibration Research Corporation", + [3]byte{0, 9, 113}: "Time Management, Inc.", + [3]byte{0, 9, 114}: "Securebase,Inc", + [3]byte{0, 9, 115}: "Lenten Technology Co., Ltd.", + [3]byte{0, 9, 116}: "Innopia Technologies, Inc.", + [3]byte{0, 9, 117}: "fSONA Communications Corporation", + [3]byte{0, 9, 118}: "Datasoft ISDN Systems GmbH", + [3]byte{0, 9, 119}: "Brunner Elektronik AG", + [3]byte{0, 9, 120}: "AIJI System Co., Ltd.", + [3]byte{0, 9, 121}: "Advanced Television Systems Committee, Inc.", + [3]byte{0, 9, 122}: "Louis Design Labs.", + [3]byte{0, 9, 123}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 124}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 125}: "SecWell Networks Oy", + [3]byte{0, 9, 126}: "IMI TECHNOLOGY CO., LTD", + [3]byte{0, 9, 127}: "Vsecure 2000 LTD.", + [3]byte{0, 9, 128}: "Power Zenith Inc.", + [3]byte{0, 9, 129}: "Newport Networks", + [3]byte{0, 9, 130}: "Loewe Opta GmbH", + [3]byte{0, 9, 131}: "GlobalTop Technology, Inc.", + [3]byte{0, 9, 132}: "MyCasa Network Inc.", + [3]byte{0, 9, 133}: "Auto Telecom Company", + [3]byte{0, 9, 134}: "Metalink LTD.", + [3]byte{0, 9, 135}: "NISHI NIPPON ELECTRIC WIRE & CABLE CO.,LTD.", + [3]byte{0, 9, 136}: "Nudian Electron Co., Ltd.", + [3]byte{0, 9, 137}: "VividLogic Inc.", + [3]byte{0, 9, 138}: "EqualLogic Inc", + [3]byte{0, 9, 139}: "Entropic Communications, Inc.", + [3]byte{0, 9, 140}: "Option Wireless Sweden", + [3]byte{0, 9, 141}: "Velocity Semiconductor", + [3]byte{0, 9, 142}: "ipcas GmbH", + [3]byte{0, 9, 143}: "Cetacean Networks", + [3]byte{0, 9, 144}: "ACKSYS Communications & systems", + [3]byte{0, 9, 145}: "GE Fanuc Automation Manufacturing, Inc.", + [3]byte{0, 9, 146}: "InterEpoch Technology,INC.", + [3]byte{0, 9, 147}: "Visteon Corporation", + [3]byte{0, 9, 148}: "Cronyx Engineering", + [3]byte{0, 9, 149}: "Castle Technology Ltd", + [3]byte{0, 9, 150}: "RDI", + [3]byte{0, 9, 151}: "Nortel Networks", + [3]byte{0, 9, 152}: "Capinfo Company Limited", + [3]byte{0, 9, 153}: "CP GEORGES RENAULT", + [3]byte{0, 9, 154}: "ELMO COMPANY, LIMITED", + [3]byte{0, 9, 155}: "Western Telematic Inc.", + [3]byte{0, 9, 156}: "Naval Research Laboratory", + [3]byte{0, 9, 157}: "Haliplex Communications", + [3]byte{0, 9, 158}: "Testech, Inc.", + [3]byte{0, 9, 159}: "VIDEX INC.", + [3]byte{0, 9, 160}: "Microtechno Corporation", + [3]byte{0, 9, 161}: "Telewise Communications, Inc.", + [3]byte{0, 9, 162}: "Interface Co., Ltd.", + [3]byte{0, 9, 163}: "Leadfly Techologies Corp. Ltd.", + [3]byte{0, 9, 164}: "HARTEC Corporation", + [3]byte{0, 9, 165}: "HANSUNG ELETRONIC INDUSTRIES DEVELOPMENT CO., LTD", + [3]byte{0, 9, 166}: "Ignis Optics, Inc.", + [3]byte{0, 9, 167}: "Bang & Olufsen A/S", + [3]byte{0, 9, 168}: "Eastmode Pte Ltd", + [3]byte{0, 9, 169}: "Ikanos Communications", + [3]byte{0, 9, 170}: "Data Comm for Business, Inc.", + [3]byte{0, 9, 171}: "Netcontrol Oy", + [3]byte{0, 9, 172}: "LANVOICE", + [3]byte{0, 9, 173}: "HYUNDAI SYSCOMM, INC.", + [3]byte{0, 9, 174}: "OKANO ELECTRIC CO.,LTD", + [3]byte{0, 9, 175}: "e-generis", + [3]byte{0, 9, 176}: "Onkyo Corporation", + [3]byte{0, 9, 177}: "Kanematsu Electronics, Ltd.", + [3]byte{0, 9, 178}: "L&F Inc.", + [3]byte{0, 9, 179}: "MCM Systems Ltd", + [3]byte{0, 9, 180}: "KISAN TELECOM CO., LTD.", + [3]byte{0, 9, 181}: "3J Tech. Co., Ltd.", + [3]byte{0, 9, 182}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 183}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 184}: "Entise Systems", + [3]byte{0, 9, 185}: "Action Imaging Solutions", + [3]byte{0, 9, 186}: "MAKU Informationstechik GmbH", + [3]byte{0, 9, 187}: "MathStar, Inc.", + [3]byte{0, 9, 188}: "Digital Safety Technologies, Inc", + [3]byte{0, 9, 189}: "Epygi Technologies, Ltd.", + [3]byte{0, 9, 190}: "Mamiya-OP Co.,Ltd.", + [3]byte{0, 9, 191}: "Nintendo Co., Ltd.", + [3]byte{0, 9, 192}: "6WIND", + [3]byte{0, 9, 193}: "PROCES-DATA A/S", + [3]byte{0, 9, 194}: "Onity, Inc.", + [3]byte{0, 9, 195}: "NETAS", + [3]byte{0, 9, 196}: "Medicore Co., Ltd", + [3]byte{0, 9, 197}: "KINGENE Technology Corporation", + [3]byte{0, 9, 198}: "Visionics Corporation", + [3]byte{0, 9, 199}: "Movistec", + [3]byte{0, 9, 200}: "SINAGAWA TSUSHIN KEISOU SERVICE", + [3]byte{0, 9, 201}: "BlueWINC Co., Ltd.", + [3]byte{0, 9, 202}: "iMaxNetworks(Shenzhen)Limited.", + [3]byte{0, 9, 203}: "HBrain", + [3]byte{0, 9, 204}: "Moog GmbH", + [3]byte{0, 9, 205}: "HUDSON SOFT CO.,LTD.", + [3]byte{0, 9, 206}: "SpaceBridge Semiconductor Corp.", + [3]byte{0, 9, 207}: "iAd GmbH", + [3]byte{0, 9, 208}: "Solacom Technologies Inc.", + [3]byte{0, 9, 209}: "SERANOA NETWORKS INC", + [3]byte{0, 9, 210}: "Mai Logic Inc.", + [3]byte{0, 9, 211}: "Western DataCom Co., Inc.", + [3]byte{0, 9, 212}: "Transtech Networks", + [3]byte{0, 9, 213}: "Signal Communication, Inc.", + [3]byte{0, 9, 214}: "KNC One GmbH", + [3]byte{0, 9, 215}: "DC Security Products", + [3]byte{0, 9, 216}: "Fält Communications AB", + [3]byte{0, 9, 217}: "Neoscale Systems, Inc", + [3]byte{0, 9, 218}: "Control Module Inc.", + [3]byte{0, 9, 219}: "eSpace", + [3]byte{0, 9, 220}: "Galaxis Technology AG", + [3]byte{0, 9, 221}: "Mavin Technology Inc.", + [3]byte{0, 9, 222}: "Samjin Information & Communications Co., Ltd.", + [3]byte{0, 9, 223}: "Vestel Komunikasyon Sanayi ve Ticaret A.S.", + [3]byte{0, 9, 224}: "XEMICS S.A.", + [3]byte{0, 9, 225}: "Gemtek Technology Co., Ltd.", + [3]byte{0, 9, 226}: "Sinbon Electronics Co., Ltd.", + [3]byte{0, 9, 227}: "Angel Iglesias S.A.", + [3]byte{0, 9, 228}: "K Tech Infosystem Inc.", + [3]byte{0, 9, 229}: "Hottinger Baldwin Messtechnik GmbH", + [3]byte{0, 9, 230}: "Cyber Switching Inc.", + [3]byte{0, 9, 231}: "ADC Techonology", + [3]byte{0, 9, 232}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 233}: "CISCO SYSTEMS, INC.", + [3]byte{0, 9, 234}: "YEM Inc.", + [3]byte{0, 9, 235}: "HuMANDATA LTD.", + [3]byte{0, 9, 236}: "Daktronics, Inc.", + [3]byte{0, 9, 237}: "CipherOptics", + [3]byte{0, 9, 238}: "MEIKYO ELECTRIC CO.,LTD", + [3]byte{0, 9, 239}: "Vocera Communications", + [3]byte{0, 9, 240}: "Shimizu Technology Inc.", + [3]byte{0, 9, 241}: "Yamaki Electric Corporation", + [3]byte{0, 9, 242}: "Cohu, Inc., Electronics Division", + [3]byte{0, 9, 243}: "WELL Communication Corp.", + [3]byte{0, 9, 244}: "Alcon Laboratories, Inc.", + [3]byte{0, 9, 245}: "Emerson Network Power Co.,Ltd", + [3]byte{0, 9, 246}: "Shenzhen Eastern Digital Tech Ltd.", + [3]byte{0, 9, 247}: "SED, a division of Calian", + [3]byte{0, 9, 248}: "UNIMO TECHNOLOGY CO., LTD.", + [3]byte{0, 9, 249}: "ART JAPAN CO., LTD.", + [3]byte{0, 9, 251}: "Philips Patient Monitoring", + [3]byte{0, 9, 252}: "IPFLEX Inc.", + [3]byte{0, 9, 253}: "Ubinetics Limited", + [3]byte{0, 9, 254}: "Daisy Technologies, Inc.", + [3]byte{0, 9, 255}: "X.net 2000 GmbH", + [3]byte{0, 10, 0}: "Mediatek Corp.", + [3]byte{0, 10, 1}: "SOHOware, Inc.", + [3]byte{0, 10, 2}: "ANNSO CO., LTD.", + [3]byte{0, 10, 3}: "ENDESA SERVICIOS, S.L.", + [3]byte{0, 10, 4}: "3Com Ltd", + [3]byte{0, 10, 5}: "Widax Corp.", + [3]byte{0, 10, 6}: "Teledex LLC", + [3]byte{0, 10, 7}: "WebWayOne Ltd", + [3]byte{0, 10, 8}: "ALPINE ELECTRONICS, INC.", + [3]byte{0, 10, 9}: "TaraCom Integrated Products, Inc.", + [3]byte{0, 10, 10}: "SUNIX Co., Ltd.", + [3]byte{0, 10, 11}: "Sealevel Systems, Inc.", + [3]byte{0, 10, 12}: "Scientific Research Corporation", + [3]byte{0, 10, 13}: "FCI Deutschland GmbH", + [3]byte{0, 10, 14}: "Invivo Research Inc.", + [3]byte{0, 10, 15}: "Ilryung Telesys, Inc", + [3]byte{0, 10, 16}: "FAST media integrations AG", + [3]byte{0, 10, 17}: "ExPet Technologies, Inc", + [3]byte{0, 10, 18}: "Azylex Technology, Inc", + [3]byte{0, 10, 19}: "Honeywell Video Systems", + [3]byte{0, 10, 20}: "TECO a.s.", + [3]byte{0, 10, 21}: "Silicon Data, Inc", + [3]byte{0, 10, 22}: "Lassen Research", + [3]byte{0, 10, 23}: "NESTAR COMMUNICATIONS, INC", + [3]byte{0, 10, 24}: "Vichel Inc.", + [3]byte{0, 10, 25}: "Valere Power, Inc.", + [3]byte{0, 10, 26}: "Imerge Ltd", + [3]byte{0, 10, 27}: "Stream Labs", + [3]byte{0, 10, 28}: "Bridge Information Co., Ltd.", + [3]byte{0, 10, 29}: "Optical Communications Products Inc.", + [3]byte{0, 10, 30}: "Red-M Products Limited", + [3]byte{0, 10, 31}: "ART WARE Telecommunication Co., Ltd.", + [3]byte{0, 10, 32}: "SVA Networks, Inc.", + [3]byte{0, 10, 33}: "Integra Telecom Co. Ltd", + [3]byte{0, 10, 34}: "Amperion Inc", + [3]byte{0, 10, 35}: "Parama Networks Inc", + [3]byte{0, 10, 36}: "Octave Communications", + [3]byte{0, 10, 37}: "CERAGON NETWORKS", + [3]byte{0, 10, 38}: "CEIA S.p.A.", + [3]byte{0, 10, 39}: "Apple", + [3]byte{0, 10, 40}: "Motorola", + [3]byte{0, 10, 41}: "Pan Dacom Networking AG", + [3]byte{0, 10, 42}: "QSI Systems Inc.", + [3]byte{0, 10, 43}: "Etherstuff", + [3]byte{0, 10, 44}: "Active Tchnology Corporation", + [3]byte{0, 10, 45}: "Cabot Communications Limited", + [3]byte{0, 10, 46}: "MAPLE NETWORKS CO., LTD", + [3]byte{0, 10, 47}: "Artnix Inc.", + [3]byte{0, 10, 48}: "Visteon Corporation", + [3]byte{0, 10, 49}: "HCV Consulting", + [3]byte{0, 10, 50}: "Xsido Corporation", + [3]byte{0, 10, 51}: "Emulex Corporation", + [3]byte{0, 10, 52}: "Identicard Systems Incorporated", + [3]byte{0, 10, 53}: "Xilinx", + [3]byte{0, 10, 54}: "Synelec Telecom Multimedia", + [3]byte{0, 10, 55}: "Procera Networks, Inc.", + [3]byte{0, 10, 56}: "Apani Networks", + [3]byte{0, 10, 57}: "LoPA Information Technology", + [3]byte{0, 10, 58}: "J-THREE INTERNATIONAL Holding Co., Ltd.", + [3]byte{0, 10, 59}: "GCT Semiconductor, Inc", + [3]byte{0, 10, 60}: "Enerpoint Ltd.", + [3]byte{0, 10, 61}: "Elo Sistemas Eletronicos S.A.", + [3]byte{0, 10, 62}: "EADS Telecom", + [3]byte{0, 10, 63}: "Data East Corporation", + [3]byte{0, 10, 64}: "Crown Audio -- Harmanm International", + [3]byte{0, 10, 65}: "CISCO SYSTEMS, INC.", + [3]byte{0, 10, 66}: "CISCO SYSTEMS, INC.", + [3]byte{0, 10, 67}: "Chunghwa Telecom Co., Ltd.", + [3]byte{0, 10, 68}: "Avery Dennison Deutschland GmbH", + [3]byte{0, 10, 69}: "Audio-Technica Corp.", + [3]byte{0, 10, 70}: "ARO WELDING TECHNOLOGIES SAS", + [3]byte{0, 10, 71}: "Allied Vision Technologies", + [3]byte{0, 10, 72}: "Albatron Technology", + [3]byte{0, 10, 73}: "F5 Networks, Inc.", + [3]byte{0, 10, 74}: "Targa Systems Ltd.", + [3]byte{0, 10, 75}: "DataPower Technology, Inc.", + [3]byte{0, 10, 76}: "Molecular Devices Corporation", + [3]byte{0, 10, 77}: "Noritz Corporation", + [3]byte{0, 10, 78}: "UNITEK Electronics INC.", + [3]byte{0, 10, 79}: "Brain Boxes Limited", + [3]byte{0, 10, 80}: "REMOTEK CORPORATION", + [3]byte{0, 10, 81}: "GyroSignal Technology Co., Ltd.", + [3]byte{0, 10, 82}: "AsiaRF Ltd.", + [3]byte{0, 10, 83}: "Intronics, Incorporated", + [3]byte{0, 10, 84}: "Laguna Hills, Inc.", + [3]byte{0, 10, 85}: "MARKEM Corporation", + [3]byte{0, 10, 86}: "HITACHI Maxell Ltd.", + [3]byte{0, 10, 87}: "Hewlett-Packard Company - Standards", + [3]byte{0, 10, 88}: "Freyer & Siegel Elektronik GmbH & Co. KG", + [3]byte{0, 10, 89}: "HW server", + [3]byte{0, 10, 90}: "GreenNET Technologies Co.,Ltd.", + [3]byte{0, 10, 91}: "Power-One as", + [3]byte{0, 10, 92}: "Carel s.p.a.", + [3]byte{0, 10, 93}: "FingerTec Worldwide Sdn Bhd", + [3]byte{0, 10, 94}: "3COM Corporation", + [3]byte{0, 10, 95}: "almedio inc.", + [3]byte{0, 10, 96}: "Autostar Technology Pte Ltd", + [3]byte{0, 10, 97}: "Cellinx Systems Inc.", + [3]byte{0, 10, 98}: "Crinis Networks, Inc.", + [3]byte{0, 10, 99}: "DHD GmbH", + [3]byte{0, 10, 100}: "Eracom Technologies", + [3]byte{0, 10, 101}: "GentechMedia.co.,ltd.", + [3]byte{0, 10, 102}: "MITSUBISHI ELECTRIC SYSTEM & SERVICE CO.,LTD.", + [3]byte{0, 10, 103}: "OngCorp", + [3]byte{0, 10, 104}: "SolarFlare Communications, Inc.", + [3]byte{0, 10, 105}: "SUNNY bell Technology Co., Ltd.", + [3]byte{0, 10, 106}: "SVM Microwaves s.r.o.", + [3]byte{0, 10, 107}: "Tadiran Telecom Business Systems LTD", + [3]byte{0, 10, 108}: "Walchem Corporation", + [3]byte{0, 10, 109}: "EKS Elektronikservice GmbH", + [3]byte{0, 10, 110}: "Harmonic, Inc", + [3]byte{0, 10, 111}: "ZyFLEX Technologies Inc", + [3]byte{0, 10, 112}: "MPLS Forum", + [3]byte{0, 10, 113}: "Avrio Technologies, Inc", + [3]byte{0, 10, 114}: "STEC, INC.", + [3]byte{0, 10, 115}: "Scientific Atlanta", + [3]byte{0, 10, 116}: "Manticom Networks Inc.", + [3]byte{0, 10, 117}: "Caterpillar, Inc", + [3]byte{0, 10, 118}: "Beida Jade Bird Huaguang Technology Co.,Ltd", + [3]byte{0, 10, 119}: "Bluewire Technologies LLC", + [3]byte{0, 10, 120}: "OLITEC", + [3]byte{0, 10, 121}: "corega K.K", + [3]byte{0, 10, 122}: "Kyoritsu Electric Co., Ltd.", + [3]byte{0, 10, 123}: "Cornelius Consult", + [3]byte{0, 10, 124}: "Tecton Ltd", + [3]byte{0, 10, 125}: "Valo, Inc.", + [3]byte{0, 10, 126}: "The Advantage Group", + [3]byte{0, 10, 127}: "Teradon Industries, Inc", + [3]byte{0, 10, 128}: "Telkonet Inc.", + [3]byte{0, 10, 129}: "TEIMA Audiotex S.L.", + [3]byte{0, 10, 130}: "TATSUTA SYSTEM ELECTRONICS CO.,LTD.", + [3]byte{0, 10, 131}: "SALTO SYSTEMS S.L.", + [3]byte{0, 10, 132}: "Rainsun Enterprise Co., Ltd.", + [3]byte{0, 10, 133}: "PLAT'C2,Inc", + [3]byte{0, 10, 134}: "Lenze", + [3]byte{0, 10, 135}: "Integrated Micromachines Inc.", + [3]byte{0, 10, 136}: "InCypher S.A.", + [3]byte{0, 10, 137}: "Creval Systems, Inc.", + [3]byte{0, 10, 138}: "CISCO SYSTEMS, INC.", + [3]byte{0, 10, 139}: "CISCO SYSTEMS, INC.", + [3]byte{0, 10, 140}: "Guardware Systems Ltd.", + [3]byte{0, 10, 141}: "EUROTHERM LIMITED", + [3]byte{0, 10, 142}: "Invacom Ltd", + [3]byte{0, 10, 143}: "Aska International Inc.", + [3]byte{0, 10, 144}: "Bayside Interactive, Inc.", + [3]byte{0, 10, 145}: "HemoCue AB", + [3]byte{0, 10, 146}: "Presonus Corporation", + [3]byte{0, 10, 147}: "W2 Networks, Inc.", + [3]byte{0, 10, 148}: "ShangHai cellink CO., LTD", + [3]byte{0, 10, 149}: "Apple", + [3]byte{0, 10, 150}: "MEWTEL TECHNOLOGY INC.", + [3]byte{0, 10, 151}: "SONICblue, Inc.", + [3]byte{0, 10, 152}: "M+F Gwinner GmbH & Co", + [3]byte{0, 10, 153}: "Calamp Wireless Networks Inc", + [3]byte{0, 10, 154}: "Aiptek International Inc", + [3]byte{0, 10, 155}: "TB Group Inc", + [3]byte{0, 10, 156}: "Server Technology, Inc.", + [3]byte{0, 10, 157}: "King Young Technology Co. Ltd.", + [3]byte{0, 10, 158}: "BroadWeb Corportation", + [3]byte{0, 10, 159}: "Pannaway Technologies, Inc.", + [3]byte{0, 10, 160}: "Cedar Point Communications", + [3]byte{0, 10, 161}: "V V S Limited", + [3]byte{0, 10, 162}: "SYSTEK INC.", + [3]byte{0, 10, 163}: "SHIMAFUJI ELECTRIC CO.,LTD.", + [3]byte{0, 10, 164}: "SHANGHAI SURVEILLANCE TECHNOLOGY CO,LTD", + [3]byte{0, 10, 165}: "MAXLINK INDUSTRIES LIMITED", + [3]byte{0, 10, 166}: "Hochiki Corporation", + [3]byte{0, 10, 167}: "FEI Electron Optics", + [3]byte{0, 10, 168}: "ePipe Pty. Ltd.", + [3]byte{0, 10, 169}: "Brooks Automation GmbH", + [3]byte{0, 10, 170}: "AltiGen Communications Inc.", + [3]byte{0, 10, 171}: "Toyota Technical Development Corporation", + [3]byte{0, 10, 172}: "TerraTec Electronic GmbH", + [3]byte{0, 10, 173}: "Stargames Corporation", + [3]byte{0, 10, 174}: "Rosemount Process Analytical", + [3]byte{0, 10, 175}: "Pipal Systems", + [3]byte{0, 10, 176}: "LOYTEC electronics GmbH", + [3]byte{0, 10, 177}: "GENETEC Corporation", + [3]byte{0, 10, 178}: "Fresnel Wireless Systems", + [3]byte{0, 10, 179}: "Fa. GIRA", + [3]byte{0, 10, 180}: "ETIC Telecommunications", + [3]byte{0, 10, 181}: "Digital Electronic Network", + [3]byte{0, 10, 182}: "COMPUNETIX, INC", + [3]byte{0, 10, 183}: "CISCO SYSTEMS, INC.", + [3]byte{0, 10, 184}: "CISCO SYSTEMS, INC.", + [3]byte{0, 10, 185}: "Astera Technologies Corp.", + [3]byte{0, 10, 186}: "Arcon Technology Limited", + [3]byte{0, 10, 187}: "Taiwan Secom Co,. Ltd", + [3]byte{0, 10, 188}: "Seabridge Ltd.", + [3]byte{0, 10, 189}: "Rupprecht & Patashnick Co.", + [3]byte{0, 10, 190}: "OPNET Technologies CO., LTD.", + [3]byte{0, 10, 191}: "HIROTA SS", + [3]byte{0, 10, 192}: "Fuyoh Video Industry CO., LTD.", + [3]byte{0, 10, 193}: "Futuretel", + [3]byte{0, 10, 194}: "FiberHome Telecommunication Technologies CO.,LTD", + [3]byte{0, 10, 195}: "eM Technics Co., Ltd.", + [3]byte{0, 10, 196}: "Daewoo Teletech Co., Ltd", + [3]byte{0, 10, 197}: "Color Kinetics", + [3]byte{0, 10, 198}: "Overture Networks.", + [3]byte{0, 10, 199}: "Unication Group", + [3]byte{0, 10, 200}: "ZPSYS CO.,LTD. (Planning&Management)", + [3]byte{0, 10, 201}: "Zambeel Inc", + [3]byte{0, 10, 202}: "YOKOYAMA SHOKAI CO.,Ltd.", + [3]byte{0, 10, 203}: "XPAK MSA Group", + [3]byte{0, 10, 204}: "Winnow Networks, Inc.", + [3]byte{0, 10, 205}: "Sunrich Technology Limited", + [3]byte{0, 10, 206}: "RADIANTECH, INC.", + [3]byte{0, 10, 207}: "PROVIDEO Multimedia Co. Ltd.", + [3]byte{0, 10, 208}: "Niigata Develoment Center, F.I.T. Co., Ltd.", + [3]byte{0, 10, 209}: "MWS", + [3]byte{0, 10, 210}: "JEPICO Corporation", + [3]byte{0, 10, 211}: "INITECH Co., Ltd", + [3]byte{0, 10, 212}: "CoreBell Systems Inc.", + [3]byte{0, 10, 213}: "Brainchild Electronic Co., Ltd.", + [3]byte{0, 10, 214}: "BeamReach Networks", + [3]byte{0, 10, 215}: "Origin ELECTRIC CO.,LTD.", + [3]byte{0, 10, 216}: "IPCserv Technology Corp.", + [3]byte{0, 10, 217}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 10, 218}: "Vindicator Technologies", + [3]byte{0, 10, 219}: "SkyPilot Network, Inc", + [3]byte{0, 10, 220}: "RuggedCom Inc.", + [3]byte{0, 10, 221}: "Allworx Corp.", + [3]byte{0, 10, 222}: "Happy Communication Co., Ltd.", + [3]byte{0, 10, 223}: "Gennum Corporation", + [3]byte{0, 10, 224}: "Fujitsu Softek", + [3]byte{0, 10, 225}: "EG Technology", + [3]byte{0, 10, 226}: "Binatone Electronics International, Ltd", + [3]byte{0, 10, 227}: "YANG MEI TECHNOLOGY CO., LTD", + [3]byte{0, 10, 228}: "Wistron Corp.", + [3]byte{0, 10, 229}: "ScottCare Corporation", + [3]byte{0, 10, 230}: "Elitegroup Computer System Co. (ECS)", + [3]byte{0, 10, 231}: "ELIOP S.A.", + [3]byte{0, 10, 232}: "Cathay Roxus Information Technology Co. LTD", + [3]byte{0, 10, 233}: "AirVast Technology Inc.", + [3]byte{0, 10, 234}: "ADAM ELEKTRONIK LTD. ÅžTI", + [3]byte{0, 10, 235}: "Shenzhen Tp-Link Technology Co; Ltd.", + [3]byte{0, 10, 236}: "Koatsu Gas Kogyo Co., Ltd.", + [3]byte{0, 10, 237}: "HARTING Systems GmbH & Co KG", + [3]byte{0, 10, 238}: "GCD Hard- & Software GmbH", + [3]byte{0, 10, 239}: "OTRUM ASA", + [3]byte{0, 10, 240}: "SHIN-OH ELECTRONICS CO., LTD. R&D", + [3]byte{0, 10, 241}: "Clarity Design, Inc.", + [3]byte{0, 10, 242}: "NeoAxiom Corp.", + [3]byte{0, 10, 243}: "CISCO SYSTEMS, INC.", + [3]byte{0, 10, 244}: "CISCO SYSTEMS, INC.", + [3]byte{0, 10, 245}: "Airgo Networks, Inc.", + [3]byte{0, 10, 246}: "Emerson Climate Technologies Retail Solutions, Inc.", + [3]byte{0, 10, 247}: "Broadcom Corp.", + [3]byte{0, 10, 248}: "American Telecare Inc.", + [3]byte{0, 10, 249}: "HiConnect, Inc.", + [3]byte{0, 10, 250}: "Traverse Technologies Australia", + [3]byte{0, 10, 251}: "Ambri Limited", + [3]byte{0, 10, 252}: "Core Tec Communications, LLC", + [3]byte{0, 10, 253}: "Viking Electronic Services", + [3]byte{0, 10, 254}: "NovaPal Ltd", + [3]byte{0, 10, 255}: "Kilchherr Elektronik AG", + [3]byte{0, 11, 0}: "FUJIAN START COMPUTER EQUIPMENT CO.,LTD", + [3]byte{0, 11, 1}: "DAIICHI ELECTRONICS CO., LTD.", + [3]byte{0, 11, 2}: "Dallmeier electronic", + [3]byte{0, 11, 3}: "Taekwang Industrial Co., Ltd", + [3]byte{0, 11, 4}: "Volktek Corporation", + [3]byte{0, 11, 5}: "Pacific Broadband Networks", + [3]byte{0, 11, 6}: "ARRIS Group, Inc.", + [3]byte{0, 11, 7}: "Voxpath Networks", + [3]byte{0, 11, 8}: "Pillar Data Systems", + [3]byte{0, 11, 9}: "Ifoundry Systems Singapore", + [3]byte{0, 11, 10}: "dBm Optics", + [3]byte{0, 11, 11}: "Corrent Corporation", + [3]byte{0, 11, 12}: "Agile Systems Inc.", + [3]byte{0, 11, 13}: "Air2U, Inc.", + [3]byte{0, 11, 14}: "Trapeze Networks", + [3]byte{0, 11, 15}: "Bosch Rexroth", + [3]byte{0, 11, 16}: "11wave Technonlogy Co.,Ltd", + [3]byte{0, 11, 17}: "HIMEJI ABC TRADING CO.,LTD.", + [3]byte{0, 11, 18}: "NURI Telecom Co., Ltd.", + [3]byte{0, 11, 19}: "ZETRON INC", + [3]byte{0, 11, 20}: "ViewSonic Corporation", + [3]byte{0, 11, 21}: "Platypus Technology", + [3]byte{0, 11, 22}: "Communication Machinery Corporation", + [3]byte{0, 11, 23}: "MKS Instruments", + [3]byte{0, 11, 24}: "PRIVATE", + [3]byte{0, 11, 25}: "Vernier Networks, Inc.", + [3]byte{0, 11, 26}: "Industrial Defender, Inc.", + [3]byte{0, 11, 27}: "Systronix, Inc.", + [3]byte{0, 11, 28}: "SIBCO bv", + [3]byte{0, 11, 29}: "LayerZero Power Systems, Inc.", + [3]byte{0, 11, 30}: "KAPPA opto-electronics GmbH", + [3]byte{0, 11, 31}: "I CON Computer Co.", + [3]byte{0, 11, 32}: "Hirata corporation", + [3]byte{0, 11, 33}: "G-Star Communications Inc.", + [3]byte{0, 11, 34}: "Environmental Systems and Services", + [3]byte{0, 11, 35}: "Siemens Subscriber Networks", + [3]byte{0, 11, 36}: "AirLogic", + [3]byte{0, 11, 37}: "Aeluros", + [3]byte{0, 11, 38}: "Wetek Corporation", + [3]byte{0, 11, 39}: "Scion Corporation", + [3]byte{0, 11, 40}: "Quatech Inc.", + [3]byte{0, 11, 41}: "LS(LG) Industrial Systems co.,Ltd", + [3]byte{0, 11, 42}: "HOWTEL Co., Ltd.", + [3]byte{0, 11, 43}: "HOSTNET CORPORATION", + [3]byte{0, 11, 44}: "Eiki Industrial Co. Ltd.", + [3]byte{0, 11, 45}: "Danfoss Inc.", + [3]byte{0, 11, 46}: "Cal-Comp Electronics (Thailand) Public Company Limited Taipe", + [3]byte{0, 11, 47}: "bplan GmbH", + [3]byte{0, 11, 48}: "Beijing Gongye Science & Technology Co.,Ltd", + [3]byte{0, 11, 49}: "Yantai ZhiYang Scientific and technology industry CO., LTD", + [3]byte{0, 11, 50}: "VORMETRIC, INC.", + [3]byte{0, 11, 51}: "Vivato Technologies", + [3]byte{0, 11, 52}: "ShangHai Broadband Technologies CO.LTD", + [3]byte{0, 11, 53}: "Quad Bit System co., Ltd.", + [3]byte{0, 11, 54}: "Productivity Systems, Inc.", + [3]byte{0, 11, 55}: "MANUFACTURE DES MONTRES ROLEX SA", + [3]byte{0, 11, 56}: "Knürr GmbH", + [3]byte{0, 11, 57}: "Keisoku Giken Co.,Ltd.", + [3]byte{0, 11, 58}: "QuStream Corporation", + [3]byte{0, 11, 59}: "devolo AG", + [3]byte{0, 11, 60}: "Cygnal Integrated Products, Inc.", + [3]byte{0, 11, 61}: "CONTAL OK Ltd.", + [3]byte{0, 11, 62}: "BittWare, Inc", + [3]byte{0, 11, 63}: "Anthology Solutions Inc.", + [3]byte{0, 11, 64}: "Oclaro", + [3]byte{0, 11, 65}: "Ing. Büro Dr. Beutlhauser", + [3]byte{0, 11, 66}: "commax Co., Ltd.", + [3]byte{0, 11, 67}: "Microscan Systems, Inc.", + [3]byte{0, 11, 68}: "Concord IDea Corp.", + [3]byte{0, 11, 69}: "CISCO SYSTEMS, INC.", + [3]byte{0, 11, 70}: "CISCO SYSTEMS, INC.", + [3]byte{0, 11, 71}: "Advanced Energy", + [3]byte{0, 11, 72}: "sofrel", + [3]byte{0, 11, 73}: "RF-Link System Inc.", + [3]byte{0, 11, 74}: "Visimetrics (UK) Ltd", + [3]byte{0, 11, 75}: "VISIOWAVE SA", + [3]byte{0, 11, 76}: "Clarion (M) Sdn Bhd", + [3]byte{0, 11, 77}: "Emuzed", + [3]byte{0, 11, 78}: "VertexRSI, General Dynamics SatCOM Technologies, Inc.", + [3]byte{0, 11, 79}: "Verifone, INC.", + [3]byte{0, 11, 80}: "Oxygnet", + [3]byte{0, 11, 81}: "Micetek International Inc.", + [3]byte{0, 11, 82}: "JOYMAX ELECTRONICS CO. LTD.", + [3]byte{0, 11, 83}: "INITIUM Co., Ltd.", + [3]byte{0, 11, 84}: "BiTMICRO Networks, Inc.", + [3]byte{0, 11, 85}: "ADInstruments", + [3]byte{0, 11, 86}: "Cybernetics", + [3]byte{0, 11, 87}: "Silicon Laboratories", + [3]byte{0, 11, 88}: "Astronautics C.A LTD", + [3]byte{0, 11, 89}: "ScriptPro, LLC", + [3]byte{0, 11, 90}: "HyperEdge", + [3]byte{0, 11, 91}: "Rincon Research Corporation", + [3]byte{0, 11, 92}: "Newtech Co.,Ltd", + [3]byte{0, 11, 93}: "FUJITSU LIMITED", + [3]byte{0, 11, 94}: "Audio Engineering Society Inc.", + [3]byte{0, 11, 95}: "CISCO SYSTEMS, INC.", + [3]byte{0, 11, 96}: "CISCO SYSTEMS, INC.", + [3]byte{0, 11, 97}: "Friedrich Lütze GmbH & Co. KG", + [3]byte{0, 11, 98}: "ib-mohnen KG", + [3]byte{0, 11, 99}: "Kaleidescape", + [3]byte{0, 11, 100}: "Kieback & Peter GmbH & Co KG", + [3]byte{0, 11, 101}: "Sy.A.C. srl", + [3]byte{0, 11, 102}: "Teralink Communications", + [3]byte{0, 11, 103}: "Topview Technology Corporation", + [3]byte{0, 11, 104}: "Addvalue Communications Pte Ltd", + [3]byte{0, 11, 105}: "Franke Finland Oy", + [3]byte{0, 11, 106}: "Asiarock Incorporation", + [3]byte{0, 11, 107}: "Wistron Neweb Corp.", + [3]byte{0, 11, 108}: "Sychip Inc.", + [3]byte{0, 11, 109}: "SOLECTRON JAPAN NAKANIIDA", + [3]byte{0, 11, 110}: "Neff Instrument Corp.", + [3]byte{0, 11, 111}: "Media Streaming Networks Inc", + [3]byte{0, 11, 112}: "Load Technology, Inc.", + [3]byte{0, 11, 113}: "Litchfield Communications Inc.", + [3]byte{0, 11, 114}: "Lawo AG", + [3]byte{0, 11, 115}: "Kodeos Communications", + [3]byte{0, 11, 116}: "Kingwave Technology Co., Ltd.", + [3]byte{0, 11, 117}: "Iosoft Ltd.", + [3]byte{0, 11, 118}: "ET&T Technology Co. Ltd.", + [3]byte{0, 11, 119}: "Cogent Systems, Inc.", + [3]byte{0, 11, 120}: "TAIFATECH INC.", + [3]byte{0, 11, 121}: "X-COM, Inc.", + [3]byte{0, 11, 122}: "L-3 Linkabit", + [3]byte{0, 11, 123}: "Test-Um Inc.", + [3]byte{0, 11, 124}: "Telex Communications", + [3]byte{0, 11, 125}: "SOLOMON EXTREME INTERNATIONAL LTD.", + [3]byte{0, 11, 126}: "SAGINOMIYA Seisakusho Inc.", + [3]byte{0, 11, 127}: "Align Engineering LLC", + [3]byte{0, 11, 128}: "Lycium Networks", + [3]byte{0, 11, 129}: "Kaparel Corporation", + [3]byte{0, 11, 130}: "Grandstream Networks, Inc.", + [3]byte{0, 11, 131}: "DATAWATT B.V.", + [3]byte{0, 11, 132}: "BODET", + [3]byte{0, 11, 133}: "CISCO SYSTEMS, INC.", + [3]byte{0, 11, 134}: "Aruba Networks", + [3]byte{0, 11, 135}: "American Reliance Inc.", + [3]byte{0, 11, 136}: "Vidisco ltd.", + [3]byte{0, 11, 137}: "Top Global Technology, Ltd.", + [3]byte{0, 11, 138}: "MITEQ Inc.", + [3]byte{0, 11, 139}: "KERAJET, S.A.", + [3]byte{0, 11, 140}: "Flextronics", + [3]byte{0, 11, 141}: "Avvio Networks", + [3]byte{0, 11, 142}: "Ascent Corporation", + [3]byte{0, 11, 143}: "AKITA ELECTRONICS SYSTEMS CO.,LTD.", + [3]byte{0, 11, 144}: "ADVA Optical Networking Ltd.", + [3]byte{0, 11, 145}: "Aglaia Gesellschaft für Bildverarbeitung und Kommunikation mbH", + [3]byte{0, 11, 146}: "Ascom Danmark A/S", + [3]byte{0, 11, 147}: "Ritter Elektronik", + [3]byte{0, 11, 148}: "Digital Monitoring Products, Inc.", + [3]byte{0, 11, 149}: "eBet Gaming Systems Pty Ltd", + [3]byte{0, 11, 150}: "Innotrac Diagnostics Oy", + [3]byte{0, 11, 151}: "Matsushita Electric Industrial Co.,Ltd.", + [3]byte{0, 11, 152}: "NiceTechVision", + [3]byte{0, 11, 153}: "SensAble Technologies, Inc.", + [3]byte{0, 11, 154}: "Shanghai Ulink Telecom Equipment Co. Ltd.", + [3]byte{0, 11, 155}: "Sirius System Co, Ltd.", + [3]byte{0, 11, 156}: "TriBeam Technologies, Inc.", + [3]byte{0, 11, 157}: "TwinMOS Technologies Inc.", + [3]byte{0, 11, 158}: "Yasing Technology Corp.", + [3]byte{0, 11, 159}: "Neue ELSA GmbH", + [3]byte{0, 11, 160}: "T&L Information Inc.", + [3]byte{0, 11, 161}: "SYSCOM Ltd.", + [3]byte{0, 11, 162}: "Sumitomo Electric Networks, Inc", + [3]byte{0, 11, 163}: "Siemens AG, I&S", + [3]byte{0, 11, 164}: "Shiron Satellite Communications Ltd. (1996)", + [3]byte{0, 11, 165}: "Quasar Cipta Mandiri, PT", + [3]byte{0, 11, 166}: "Miyakawa Electric Works Ltd.", + [3]byte{0, 11, 167}: "Maranti Networks", + [3]byte{0, 11, 168}: "HANBACK ELECTRONICS CO., LTD.", + [3]byte{0, 11, 169}: "CloudShield Technologies, Inc.", + [3]byte{0, 11, 170}: "Aiphone co.,Ltd", + [3]byte{0, 11, 171}: "Advantech Technology (CHINA) Co., Ltd.", + [3]byte{0, 11, 172}: "3Com Ltd", + [3]byte{0, 11, 173}: "PC-PoS Inc.", + [3]byte{0, 11, 174}: "Vitals System Inc.", + [3]byte{0, 11, 175}: "WOOJU COMMUNICATIONS Co,.Ltd", + [3]byte{0, 11, 176}: "Sysnet Telematica srl", + [3]byte{0, 11, 177}: "Super Star Technology Co., Ltd.", + [3]byte{0, 11, 178}: "SMALLBIG TECHNOLOGY", + [3]byte{0, 11, 179}: "RiT technologies Ltd.", + [3]byte{0, 11, 180}: "RDC Semiconductor Inc.,", + [3]byte{0, 11, 181}: "nStor Technologies, Inc.", + [3]byte{0, 11, 182}: "Metalligence Technology Corp.", + [3]byte{0, 11, 183}: "Micro Systems Co.,Ltd.", + [3]byte{0, 11, 184}: "Kihoku Electronic Co.", + [3]byte{0, 11, 185}: "Imsys AB", + [3]byte{0, 11, 186}: "Harmonic, Inc", + [3]byte{0, 11, 187}: "Etin Systems Co., Ltd", + [3]byte{0, 11, 188}: "En Garde Systems, Inc.", + [3]byte{0, 11, 189}: "Connexionz Limited", + [3]byte{0, 11, 190}: "CISCO SYSTEMS, INC.", + [3]byte{0, 11, 191}: "CISCO SYSTEMS, INC.", + [3]byte{0, 11, 192}: "China IWNComm Co., Ltd.", + [3]byte{0, 11, 193}: "Bay Microsystems, Inc.", + [3]byte{0, 11, 194}: "Corinex Communication Corp.", + [3]byte{0, 11, 195}: "Multiplex, Inc.", + [3]byte{0, 11, 196}: "BIOTRONIK GmbH & Co", + [3]byte{0, 11, 197}: "SMC Networks, Inc.", + [3]byte{0, 11, 198}: "ISAC, Inc.", + [3]byte{0, 11, 199}: "ICET S.p.A.", + [3]byte{0, 11, 200}: "AirFlow Networks", + [3]byte{0, 11, 201}: "Electroline Equipment", + [3]byte{0, 11, 202}: "DATAVAN International Corporation", + [3]byte{0, 11, 203}: "Fagor Automation , S. Coop", + [3]byte{0, 11, 204}: "JUSAN, S.A.", + [3]byte{0, 11, 205}: "Hewlett-Packard Company", + [3]byte{0, 11, 206}: "Free2move AB", + [3]byte{0, 11, 207}: "AGFA NDT INC.", + [3]byte{0, 11, 208}: "XiMeta Technology Americas Inc.", + [3]byte{0, 11, 209}: "Aeronix, Inc.", + [3]byte{0, 11, 210}: "Remopro Technology Inc.", + [3]byte{0, 11, 211}: "cd3o", + [3]byte{0, 11, 212}: "Beijing Wise Technology & Science Development Co.Ltd", + [3]byte{0, 11, 213}: "Nvergence, Inc.", + [3]byte{0, 11, 214}: "Paxton Access Ltd", + [3]byte{0, 11, 215}: "DORMA Time + Access GmbH", + [3]byte{0, 11, 216}: "Industrial Scientific Corp.", + [3]byte{0, 11, 217}: "General Hydrogen", + [3]byte{0, 11, 218}: "EyeCross Co.,Inc.", + [3]byte{0, 11, 219}: "Dell Inc", + [3]byte{0, 11, 220}: "AKCP", + [3]byte{0, 11, 221}: "TOHOKU RICOH Co., LTD.", + [3]byte{0, 11, 222}: "TELDIX GmbH", + [3]byte{0, 11, 223}: "Shenzhen RouterD Networks Limited", + [3]byte{0, 11, 224}: "SercoNet Ltd.", + [3]byte{0, 11, 225}: "Nokia NET Product Operations", + [3]byte{0, 11, 226}: "Lumenera Corporation", + [3]byte{0, 11, 227}: "Key Stream Co., Ltd.", + [3]byte{0, 11, 228}: "Hosiden Corporation", + [3]byte{0, 11, 229}: "HIMS International Corporation", + [3]byte{0, 11, 230}: "Datel Electronics", + [3]byte{0, 11, 231}: "COMFLUX TECHNOLOGY INC.", + [3]byte{0, 11, 232}: "AOIP", + [3]byte{0, 11, 233}: "Actel Corporation", + [3]byte{0, 11, 234}: "Zultys Technologies", + [3]byte{0, 11, 235}: "Systegra AG", + [3]byte{0, 11, 236}: "NIPPON ELECTRIC INSTRUMENT, INC.", + [3]byte{0, 11, 237}: "ELM Inc.", + [3]byte{0, 11, 238}: "inc.jet, Incorporated", + [3]byte{0, 11, 239}: "Code Corporation", + [3]byte{0, 11, 240}: "MoTEX Products Co., Ltd.", + [3]byte{0, 11, 241}: "LAP Laser Applikations", + [3]byte{0, 11, 242}: "Chih-Kan Technology Co., Ltd.", + [3]byte{0, 11, 243}: "BAE SYSTEMS", + [3]byte{0, 11, 244}: "PRIVATE", + [3]byte{0, 11, 245}: "Shanghai Sibo Telecom Technology Co.,Ltd", + [3]byte{0, 11, 246}: "Nitgen Co., Ltd", + [3]byte{0, 11, 247}: "NIDEK CO.,LTD", + [3]byte{0, 11, 248}: "Infinera", + [3]byte{0, 11, 249}: "Gemstone communications, Inc.", + [3]byte{0, 11, 250}: "EXEMYS SRL", + [3]byte{0, 11, 251}: "D-NET International Corporation", + [3]byte{0, 11, 252}: "CISCO SYSTEMS, INC.", + [3]byte{0, 11, 253}: "CISCO SYSTEMS, INC.", + [3]byte{0, 11, 254}: "CASTEL Broadband Limited", + [3]byte{0, 11, 255}: "Berkeley Camera Engineering", + [3]byte{0, 12, 0}: "BEB Industrie-Elektronik AG", + [3]byte{0, 12, 1}: "Abatron AG", + [3]byte{0, 12, 2}: "ABB Oy", + [3]byte{0, 12, 3}: "HDMI Licensing, LLC", + [3]byte{0, 12, 4}: "Tecnova", + [3]byte{0, 12, 5}: "RPA Reserch Co., Ltd.", + [3]byte{0, 12, 6}: "Nixvue Systems Pte Ltd", + [3]byte{0, 12, 7}: "Iftest AG", + [3]byte{0, 12, 8}: "HUMEX Technologies Corp.", + [3]byte{0, 12, 9}: "Hitachi IE Systems Co., Ltd", + [3]byte{0, 12, 10}: "Guangdong Province Electronic Technology Research Institute", + [3]byte{0, 12, 11}: "Broadbus Technologies", + [3]byte{0, 12, 12}: "APPRO TECHNOLOGY INC.", + [3]byte{0, 12, 13}: "Communications & Power Industries / Satcom Division", + [3]byte{0, 12, 14}: "XtremeSpectrum, Inc.", + [3]byte{0, 12, 15}: "Techno-One Co., Ltd", + [3]byte{0, 12, 16}: "PNI Corporation", + [3]byte{0, 12, 17}: "NIPPON DEMPA CO.,LTD.", + [3]byte{0, 12, 18}: "Micro-Optronic-Messtechnik GmbH", + [3]byte{0, 12, 19}: "MediaQ", + [3]byte{0, 12, 20}: "Diagnostic Instruments, Inc.", + [3]byte{0, 12, 21}: "CyberPower Systems, Inc.", + [3]byte{0, 12, 22}: "Concorde Microsystems Inc.", + [3]byte{0, 12, 23}: "AJA Video Systems Inc", + [3]byte{0, 12, 24}: "Zenisu Keisoku Inc.", + [3]byte{0, 12, 25}: "Telio Communications GmbH", + [3]byte{0, 12, 26}: "Quest Technical Solutions Inc.", + [3]byte{0, 12, 27}: "ORACOM Co, Ltd.", + [3]byte{0, 12, 28}: "MicroWeb Co., Ltd.", + [3]byte{0, 12, 29}: "Mettler & Fuchs AG", + [3]byte{0, 12, 30}: "Global Cache", + [3]byte{0, 12, 31}: "Glimmerglass Networks", + [3]byte{0, 12, 32}: "Fi WIn, Inc.", + [3]byte{0, 12, 33}: "Faculty of Science and Technology, Keio University", + [3]byte{0, 12, 34}: "Double D Electronics Ltd", + [3]byte{0, 12, 35}: "Beijing Lanchuan Tech. Co., Ltd.", + [3]byte{0, 12, 36}: "ANATOR", + [3]byte{0, 12, 37}: "Allied Telesis Labs, Inc.", + [3]byte{0, 12, 38}: "Weintek Labs. Inc.", + [3]byte{0, 12, 39}: "Sammy Corporation", + [3]byte{0, 12, 40}: "RIFATRON", + [3]byte{0, 12, 41}: "VMware, Inc.", + [3]byte{0, 12, 42}: "OCTTEL Communication Co., Ltd.", + [3]byte{0, 12, 43}: "ELIAS Technology, Inc.", + [3]byte{0, 12, 44}: "Enwiser Inc.", + [3]byte{0, 12, 45}: "FullWave Technology Co., Ltd.", + [3]byte{0, 12, 46}: "Openet information technology(shenzhen) Co., Ltd.", + [3]byte{0, 12, 47}: "SeorimTechnology Co.,Ltd.", + [3]byte{0, 12, 48}: "CISCO SYSTEMS, INC.", + [3]byte{0, 12, 49}: "CISCO SYSTEMS, INC.", + [3]byte{0, 12, 50}: "Avionic Design Development GmbH", + [3]byte{0, 12, 51}: "Compucase Enterprise Co. Ltd.", + [3]byte{0, 12, 52}: "Vixen Co., Ltd.", + [3]byte{0, 12, 53}: "KaVo Dental GmbH & Co. KG", + [3]byte{0, 12, 54}: "SHARP TAKAYA ELECTRONICS INDUSTRY CO.,LTD.", + [3]byte{0, 12, 55}: "Geomation, Inc.", + [3]byte{0, 12, 56}: "TelcoBridges Inc.", + [3]byte{0, 12, 57}: "Sentinel Wireless Inc.", + [3]byte{0, 12, 58}: "Oxance", + [3]byte{0, 12, 59}: "Orion Electric Co., Ltd.", + [3]byte{0, 12, 60}: "MediaChorus, Inc.", + [3]byte{0, 12, 61}: "Glsystech Co., Ltd.", + [3]byte{0, 12, 62}: "Crest Audio", + [3]byte{0, 12, 63}: "Cogent Defence & Security Networks,", + [3]byte{0, 12, 64}: "Altech Controls", + [3]byte{0, 12, 65}: "Cisco-Linksys", + [3]byte{0, 12, 66}: "Routerboard.com", + [3]byte{0, 12, 67}: "Ralink Technology, Corp.", + [3]byte{0, 12, 68}: "Automated Interfaces, Inc.", + [3]byte{0, 12, 69}: "Animation Technologies Inc.", + [3]byte{0, 12, 70}: "Allied Telesyn Inc.", + [3]byte{0, 12, 71}: "SK Teletech(R&D Planning Team)", + [3]byte{0, 12, 72}: "QoStek Corporation", + [3]byte{0, 12, 73}: "Dangaard Telecom RTC Division A/S", + [3]byte{0, 12, 74}: "Cygnus Microsystems (P) Limited", + [3]byte{0, 12, 75}: "Cheops Elektronik", + [3]byte{0, 12, 76}: "Arcor AG&Co.", + [3]byte{0, 12, 77}: "Curtiss-Wright Controls Avionics & Electronics", + [3]byte{0, 12, 78}: "Winbest Technology CO,LT", + [3]byte{0, 12, 79}: "UDTech Japan Corporation", + [3]byte{0, 12, 80}: "Seagate Technology", + [3]byte{0, 12, 81}: "Scientific Technologies Inc.", + [3]byte{0, 12, 82}: "Roll Systems Inc.", + [3]byte{0, 12, 83}: "PRIVATE", + [3]byte{0, 12, 84}: "Pedestal Networks, Inc", + [3]byte{0, 12, 85}: "Microlink Communications Inc.", + [3]byte{0, 12, 86}: "Megatel Computer (1986) Corp.", + [3]byte{0, 12, 87}: "MACKIE Engineering Services Belgium BVBA", + [3]byte{0, 12, 88}: "M&S Systems", + [3]byte{0, 12, 89}: "Indyme Electronics, Inc.", + [3]byte{0, 12, 90}: "IBSmm Embedded Electronics Consulting", + [3]byte{0, 12, 91}: "HANWANG TECHNOLOGY CO.,LTD", + [3]byte{0, 12, 92}: "GTN Systems B.V.", + [3]byte{0, 12, 93}: "CHIC TECHNOLOGY (CHINA) CORP.", + [3]byte{0, 12, 94}: "Calypso Medical", + [3]byte{0, 12, 95}: "Avtec, Inc.", + [3]byte{0, 12, 96}: "ACM Systems", + [3]byte{0, 12, 97}: "AC Tech corporation DBA Advanced Digital", + [3]byte{0, 12, 98}: "ABB AB, Cewe-Control", + [3]byte{0, 12, 99}: "Zenith Electronics Corporation", + [3]byte{0, 12, 100}: "X2 MSA Group", + [3]byte{0, 12, 101}: "Sunin Telecom", + [3]byte{0, 12, 102}: "Pronto Networks Inc", + [3]byte{0, 12, 103}: "OYO ELECTRIC CO.,LTD", + [3]byte{0, 12, 104}: "SigmaTel, Inc.", + [3]byte{0, 12, 105}: "National Radio Astronomy Observatory", + [3]byte{0, 12, 106}: "MBARI", + [3]byte{0, 12, 107}: "Kurz Industrie-Elektronik GmbH", + [3]byte{0, 12, 108}: "Elgato Systems LLC", + [3]byte{0, 12, 109}: "Edwards Ltd.", + [3]byte{0, 12, 110}: "ASUSTEK COMPUTER INC.", + [3]byte{0, 12, 111}: "Amtek system co.,LTD.", + [3]byte{0, 12, 112}: "ACC GmbH", + [3]byte{0, 12, 113}: "Wybron, Inc", + [3]byte{0, 12, 114}: "Tempearl Industrial Co., Ltd.", + [3]byte{0, 12, 115}: "TELSON ELECTRONICS CO., LTD", + [3]byte{0, 12, 116}: "RIVERTEC CORPORATION", + [3]byte{0, 12, 117}: "Oriental integrated electronics. LTD", + [3]byte{0, 12, 118}: "MICRO-STAR INTERNATIONAL CO., LTD.", + [3]byte{0, 12, 119}: "Life Racing Ltd", + [3]byte{0, 12, 120}: "In-Tech Electronics Limited", + [3]byte{0, 12, 121}: "Extel Communications P/L", + [3]byte{0, 12, 122}: "DaTARIUS Technologies GmbH", + [3]byte{0, 12, 123}: "ALPHA PROJECT Co.,Ltd.", + [3]byte{0, 12, 124}: "Internet Information Image Inc.", + [3]byte{0, 12, 125}: "TEIKOKU ELECTRIC MFG. CO., LTD", + [3]byte{0, 12, 126}: "Tellium Incorporated", + [3]byte{0, 12, 127}: "synertronixx GmbH", + [3]byte{0, 12, 128}: "Opelcomm Inc.", + [3]byte{0, 12, 129}: "Schneider Electric (Australia)", + [3]byte{0, 12, 130}: "NETWORK TECHNOLOGIES INC", + [3]byte{0, 12, 131}: "Logical Solutions", + [3]byte{0, 12, 132}: "Eazix, Inc.", + [3]byte{0, 12, 133}: "CISCO SYSTEMS, INC.", + [3]byte{0, 12, 134}: "CISCO SYSTEMS, INC.", + [3]byte{0, 12, 135}: "AMD", + [3]byte{0, 12, 136}: "Apache Micro Peripherals, Inc.", + [3]byte{0, 12, 137}: "AC Electric Vehicles, Ltd.", + [3]byte{0, 12, 138}: "Bose Corporation", + [3]byte{0, 12, 139}: "Connect Tech Inc", + [3]byte{0, 12, 140}: "KODICOM CO.,LTD.", + [3]byte{0, 12, 141}: "MATRIX VISION GmbH", + [3]byte{0, 12, 142}: "Mentor Engineering Inc", + [3]byte{0, 12, 143}: "Nergal s.r.l.", + [3]byte{0, 12, 144}: "Octasic Inc.", + [3]byte{0, 12, 145}: "Riverhead Networks Inc.", + [3]byte{0, 12, 146}: "WolfVision Gmbh", + [3]byte{0, 12, 147}: "Xeline Co., Ltd.", + [3]byte{0, 12, 148}: "United Electronic Industries, Inc. (EUI)", + [3]byte{0, 12, 149}: "PrimeNet", + [3]byte{0, 12, 150}: "OQO, Inc.", + [3]byte{0, 12, 151}: "NV ADB TTV Technologies SA", + [3]byte{0, 12, 152}: "LETEK Communications Inc.", + [3]byte{0, 12, 153}: "HITEL LINK Co.,Ltd", + [3]byte{0, 12, 154}: "Hitech Electronics Corp.", + [3]byte{0, 12, 155}: "EE Solutions, Inc", + [3]byte{0, 12, 156}: "Chongho information & communications", + [3]byte{0, 12, 157}: "UbeeAirWalk, Inc.", + [3]byte{0, 12, 158}: "MemoryLink Corp.", + [3]byte{0, 12, 159}: "NKE Corporation", + [3]byte{0, 12, 160}: "StorCase Technology, Inc.", + [3]byte{0, 12, 161}: "SIGMACOM Co., LTD.", + [3]byte{0, 12, 162}: "Harmonic Video Network", + [3]byte{0, 12, 163}: "Rancho Technology, Inc.", + [3]byte{0, 12, 164}: "Prompttec Product Management GmbH", + [3]byte{0, 12, 165}: "Naman NZ LTd", + [3]byte{0, 12, 166}: "Mintera Corporation", + [3]byte{0, 12, 167}: "Metro (Suzhou) Technologies Co., Ltd.", + [3]byte{0, 12, 168}: "Garuda Networks Corporation", + [3]byte{0, 12, 169}: "Ebtron Inc.", + [3]byte{0, 12, 170}: "Cubic Transportation Systems Inc", + [3]byte{0, 12, 171}: "COMMEND International", + [3]byte{0, 12, 172}: "Citizen Watch Co., Ltd.", + [3]byte{0, 12, 173}: "BTU International", + [3]byte{0, 12, 174}: "Ailocom Oy", + [3]byte{0, 12, 175}: "TRI TERM CO.,LTD.", + [3]byte{0, 12, 176}: "Star Semiconductor Corporation", + [3]byte{0, 12, 177}: "Salland Engineering (Europe) BV", + [3]byte{0, 12, 178}: "UNION co., ltd.", + [3]byte{0, 12, 179}: "ROUND Co.,Ltd.", + [3]byte{0, 12, 180}: "AutoCell Laboratories, Inc.", + [3]byte{0, 12, 181}: "Premier Technolgies, Inc", + [3]byte{0, 12, 182}: "NANJING SEU MOBILE & INTERNET TECHNOLOGY CO.,LTD", + [3]byte{0, 12, 183}: "Nanjing Huazhuo Electronics Co., Ltd.", + [3]byte{0, 12, 184}: "MEDION AG", + [3]byte{0, 12, 185}: "LEA", + [3]byte{0, 12, 186}: "Jamex, Inc.", + [3]byte{0, 12, 187}: "ISKRAEMECO", + [3]byte{0, 12, 188}: "Iscutum", + [3]byte{0, 12, 189}: "Interface Masters, Inc", + [3]byte{0, 12, 190}: "Innominate Security Technologies AG", + [3]byte{0, 12, 191}: "Holy Stone Ent. Co., Ltd.", + [3]byte{0, 12, 192}: "Genera Oy", + [3]byte{0, 12, 193}: "Cooper Industries Inc.", + [3]byte{0, 12, 194}: "ControlNet (India) Private Limited", + [3]byte{0, 12, 195}: "BeWAN systems", + [3]byte{0, 12, 196}: "Tiptel AG", + [3]byte{0, 12, 197}: "Nextlink Co., Ltd.", + [3]byte{0, 12, 198}: "Ka-Ro electronics GmbH", + [3]byte{0, 12, 199}: "Intelligent Computer Solutions Inc.", + [3]byte{0, 12, 200}: "Xytronix Research & Design, Inc.", + [3]byte{0, 12, 201}: "ILWOO DATA & TECHNOLOGY CO.,LTD", + [3]byte{0, 12, 202}: "HGST a Western Digital Company", + [3]byte{0, 12, 203}: "Design Combus Ltd", + [3]byte{0, 12, 204}: "Aeroscout Ltd.", + [3]byte{0, 12, 205}: "IEC - TC57", + [3]byte{0, 12, 206}: "CISCO SYSTEMS, INC.", + [3]byte{0, 12, 207}: "CISCO SYSTEMS, INC.", + [3]byte{0, 12, 208}: "Symetrix", + [3]byte{0, 12, 209}: "SFOM Technology Corp.", + [3]byte{0, 12, 210}: "Schaffner EMV AG", + [3]byte{0, 12, 211}: "Prettl Elektronik Radeberg GmbH", + [3]byte{0, 12, 212}: "Positron Public Safety Systems inc.", + [3]byte{0, 12, 213}: "Passave Inc.", + [3]byte{0, 12, 214}: "PARTNER TECH", + [3]byte{0, 12, 215}: "Nallatech Ltd", + [3]byte{0, 12, 216}: "M. K. Juchheim GmbH & Co", + [3]byte{0, 12, 217}: "Itcare Co., Ltd", + [3]byte{0, 12, 218}: "FreeHand Systems, Inc.", + [3]byte{0, 12, 219}: "Brocade Communications Systems, Inc", + [3]byte{0, 12, 220}: "BECS Technology, Inc", + [3]byte{0, 12, 221}: "AOS Technologies AG", + [3]byte{0, 12, 222}: "ABB STOTZ-KONTAKT GmbH", + [3]byte{0, 12, 223}: "PULNiX America, Inc", + [3]byte{0, 12, 224}: "Trek Diagnostics Inc.", + [3]byte{0, 12, 225}: "The Open Group", + [3]byte{0, 12, 226}: "Rolls-Royce", + [3]byte{0, 12, 227}: "Option International N.V.", + [3]byte{0, 12, 228}: "NeuroCom International, Inc.", + [3]byte{0, 12, 229}: "ARRIS Group, Inc.", + [3]byte{0, 12, 230}: "Meru Networks Inc", + [3]byte{0, 12, 231}: "MediaTek Inc.", + [3]byte{0, 12, 232}: "GuangZhou AnJuBao Co., Ltd", + [3]byte{0, 12, 233}: "BLOOMBERG L.P.", + [3]byte{0, 12, 234}: "aphona Kommunikationssysteme", + [3]byte{0, 12, 235}: "CNMP Networks, Inc.", + [3]byte{0, 12, 236}: "Spectracom Corp.", + [3]byte{0, 12, 237}: "Real Digital Media", + [3]byte{0, 12, 238}: "jp-embedded", + [3]byte{0, 12, 239}: "Open Networks Engineering Ltd", + [3]byte{0, 12, 240}: "M & N GmbH", + [3]byte{0, 12, 241}: "Intel Corporation", + [3]byte{0, 12, 242}: "GAMESA Eólica", + [3]byte{0, 12, 243}: "CALL IMAGE SA", + [3]byte{0, 12, 244}: "AKATSUKI ELECTRIC MFG.CO.,LTD.", + [3]byte{0, 12, 245}: "InfoExpress", + [3]byte{0, 12, 246}: "Sitecom Europe BV", + [3]byte{0, 12, 247}: "Nortel Networks", + [3]byte{0, 12, 248}: "Nortel Networks", + [3]byte{0, 12, 249}: "Xylem Water Solutions", + [3]byte{0, 12, 250}: "Digital Systems Corp", + [3]byte{0, 12, 251}: "Korea Network Systems", + [3]byte{0, 12, 252}: "S2io Technologies Corp", + [3]byte{0, 12, 253}: "Hyundai ImageQuest Co.,Ltd.", + [3]byte{0, 12, 254}: "Grand Electronic Co., Ltd", + [3]byte{0, 12, 255}: "MRO-TEK LIMITED", + [3]byte{0, 13, 0}: "Seaway Networks Inc.", + [3]byte{0, 13, 1}: "P&E Microcomputer Systems, Inc.", + [3]byte{0, 13, 2}: "NEC Platforms, Ltd.", + [3]byte{0, 13, 3}: "Matrics, Inc.", + [3]byte{0, 13, 4}: "Foxboro Eckardt Development GmbH", + [3]byte{0, 13, 5}: "cybernet manufacturing inc.", + [3]byte{0, 13, 6}: "Compulogic Limited", + [3]byte{0, 13, 7}: "Calrec Audio Ltd", + [3]byte{0, 13, 8}: "AboveCable, Inc.", + [3]byte{0, 13, 9}: "Yuehua(Zhuhai) Electronic CO. LTD", + [3]byte{0, 13, 10}: "Projectiondesign as", + [3]byte{0, 13, 11}: "Buffalo Inc.", + [3]byte{0, 13, 12}: "MDI Security Systems", + [3]byte{0, 13, 13}: "ITSupported, LLC", + [3]byte{0, 13, 14}: "Inqnet Systems, Inc.", + [3]byte{0, 13, 15}: "Finlux Ltd", + [3]byte{0, 13, 16}: "Embedtronics Oy", + [3]byte{0, 13, 17}: "DENTSPLY - Gendex", + [3]byte{0, 13, 18}: "AXELL Corporation", + [3]byte{0, 13, 19}: "Wilhelm Rutenbeck GmbH&Co.KG", + [3]byte{0, 13, 20}: "Vtech Innovation LP dba Advanced American Telephones", + [3]byte{0, 13, 21}: "Voipac s.r.o.", + [3]byte{0, 13, 22}: "UHS Systems Pty Ltd", + [3]byte{0, 13, 23}: "Turbo Networks Co.Ltd", + [3]byte{0, 13, 24}: "Mega-Trend Electronics CO., LTD.", + [3]byte{0, 13, 25}: "ROBE Show lighting", + [3]byte{0, 13, 26}: "Mustek System Inc.", + [3]byte{0, 13, 27}: "Kyoto Electronics Manufacturing Co., Ltd.", + [3]byte{0, 13, 28}: "Amesys Defense", + [3]byte{0, 13, 29}: "HIGH-TEK HARNESS ENT. CO., LTD.", + [3]byte{0, 13, 30}: "Control Techniques", + [3]byte{0, 13, 31}: "AV Digital", + [3]byte{0, 13, 32}: "ASAHIKASEI TECHNOSYSTEM CO.,LTD.", + [3]byte{0, 13, 33}: "WISCORE Inc.", + [3]byte{0, 13, 34}: "Unitronics LTD", + [3]byte{0, 13, 35}: "Smart Solution, Inc", + [3]byte{0, 13, 36}: "SENTEC E&E CO., LTD.", + [3]byte{0, 13, 37}: "SANDEN CORPORATION", + [3]byte{0, 13, 38}: "Primagraphics Limited", + [3]byte{0, 13, 39}: "MICROPLEX Printware AG", + [3]byte{0, 13, 40}: "CISCO SYSTEMS, INC.", + [3]byte{0, 13, 41}: "CISCO SYSTEMS, INC.", + [3]byte{0, 13, 42}: "Scanmatic AS", + [3]byte{0, 13, 43}: "Racal Instruments", + [3]byte{0, 13, 44}: "Patapsco Designs Ltd", + [3]byte{0, 13, 45}: "NCT Deutschland GmbH", + [3]byte{0, 13, 46}: "Matsushita Avionics Systems Corporation", + [3]byte{0, 13, 47}: "AIN Comm.Tech.Co., LTD", + [3]byte{0, 13, 48}: "IceFyre Semiconductor", + [3]byte{0, 13, 49}: "Compellent Technologies, Inc.", + [3]byte{0, 13, 50}: "DispenseSource, Inc.", + [3]byte{0, 13, 51}: "Prediwave Corp.", + [3]byte{0, 13, 52}: "Shell International Exploration and Production, Inc.", + [3]byte{0, 13, 53}: "PAC International Ltd", + [3]byte{0, 13, 54}: "Wu Han Routon Electronic Co., Ltd", + [3]byte{0, 13, 55}: "WIPLUG", + [3]byte{0, 13, 56}: "NISSIN INC.", + [3]byte{0, 13, 57}: "Network Electronics", + [3]byte{0, 13, 58}: "Microsoft Corp.", + [3]byte{0, 13, 59}: "Microelectronics Technology Inc.", + [3]byte{0, 13, 60}: "i.Tech Dynamic Ltd", + [3]byte{0, 13, 61}: "Hammerhead Systems, Inc.", + [3]byte{0, 13, 62}: "APLUX Communications Ltd.", + [3]byte{0, 13, 63}: "VTI Instruments Corporation", + [3]byte{0, 13, 64}: "Verint Loronix Video Solutions", + [3]byte{0, 13, 65}: "Siemens AG ICM MP UC RD IT KLF1", + [3]byte{0, 13, 66}: "Newbest Development Limited", + [3]byte{0, 13, 67}: "DRS Tactical Systems Inc.", + [3]byte{0, 13, 68}: "Audio BU - Logitech", + [3]byte{0, 13, 69}: "Tottori SANYO Electric Co., Ltd.", + [3]byte{0, 13, 70}: "Parker SSD Drives", + [3]byte{0, 13, 71}: "Collex", + [3]byte{0, 13, 72}: "AEWIN Technologies Co., Ltd.", + [3]byte{0, 13, 73}: "Triton Systems of Delaware, Inc.", + [3]byte{0, 13, 74}: "Steag ETA-Optik", + [3]byte{0, 13, 75}: "Roku, LLC", + [3]byte{0, 13, 76}: "Outline Electronics Ltd.", + [3]byte{0, 13, 77}: "Ninelanes", + [3]byte{0, 13, 78}: "NDR Co.,LTD.", + [3]byte{0, 13, 79}: "Kenwood Corporation", + [3]byte{0, 13, 80}: "Galazar Networks", + [3]byte{0, 13, 81}: "DIVR Systems, Inc.", + [3]byte{0, 13, 82}: "Comart system", + [3]byte{0, 13, 83}: "Beijing 5w Communication Corp.", + [3]byte{0, 13, 84}: "3Com Ltd", + [3]byte{0, 13, 85}: "SANYCOM Technology Co.,Ltd", + [3]byte{0, 13, 86}: "Dell Inc", + [3]byte{0, 13, 87}: "Fujitsu I-Network Systems Limited.", + [3]byte{0, 13, 88}: "PRIVATE", + [3]byte{0, 13, 89}: "Amity Systems, Inc.", + [3]byte{0, 13, 90}: "Tiesse SpA", + [3]byte{0, 13, 91}: "Smart Empire Investments Limited", + [3]byte{0, 13, 92}: "Robert Bosch GmbH, VT-ATMO", + [3]byte{0, 13, 93}: "Raritan Computer, Inc", + [3]byte{0, 13, 94}: "NEC Personal Products", + [3]byte{0, 13, 95}: "Minds Inc", + [3]byte{0, 13, 96}: "IBM Corp", + [3]byte{0, 13, 97}: "Giga-Byte Technology Co., Ltd.", + [3]byte{0, 13, 98}: "Funkwerk Dabendorf GmbH", + [3]byte{0, 13, 99}: "DENT Instruments, Inc.", + [3]byte{0, 13, 100}: "COMAG Handels AG", + [3]byte{0, 13, 101}: "CISCO SYSTEMS, INC.", + [3]byte{0, 13, 102}: "CISCO SYSTEMS, INC.", + [3]byte{0, 13, 103}: "Ericsson", + [3]byte{0, 13, 104}: "Vinci Systems, Inc.", + [3]byte{0, 13, 105}: "TMT&D Corporation", + [3]byte{0, 13, 106}: "Redwood Technologies LTD", + [3]byte{0, 13, 107}: "Mita-Teknik A/S", + [3]byte{0, 13, 108}: "M-Audio", + [3]byte{0, 13, 109}: "K-Tech Devices Corp.", + [3]byte{0, 13, 110}: "K-Patents Oy", + [3]byte{0, 13, 111}: "Ember Corporation", + [3]byte{0, 13, 112}: "Datamax Corporation", + [3]byte{0, 13, 113}: "boca systems", + [3]byte{0, 13, 114}: "2Wire, Inc", + [3]byte{0, 13, 115}: "Technical Support, Inc.", + [3]byte{0, 13, 116}: "Sand Network Systems, Inc.", + [3]byte{0, 13, 117}: "Kobian Pte Ltd - Taiwan Branch", + [3]byte{0, 13, 118}: "Hokuto Denshi Co,. Ltd.", + [3]byte{0, 13, 119}: "FalconStor Software", + [3]byte{0, 13, 120}: "Engineering & Security", + [3]byte{0, 13, 121}: "Dynamic Solutions Co,.Ltd.", + [3]byte{0, 13, 122}: "DiGATTO Asia Pacific Pte Ltd", + [3]byte{0, 13, 123}: "Consensys Computers Inc.", + [3]byte{0, 13, 124}: "Codian Ltd", + [3]byte{0, 13, 125}: "Afco Systems", + [3]byte{0, 13, 126}: "Axiowave Networks, Inc.", + [3]byte{0, 13, 127}: "MIDAS COMMUNICATION TECHNOLOGIES PTE LTD ( Foreign Branch)", + [3]byte{0, 13, 128}: "Online Development Inc", + [3]byte{0, 13, 129}: "Pepperl+Fuchs GmbH", + [3]byte{0, 13, 130}: "PHS srl", + [3]byte{0, 13, 131}: "Sanmina-SCI Hungary Ltd.", + [3]byte{0, 13, 132}: "Makus Inc.", + [3]byte{0, 13, 133}: "Tapwave, Inc.", + [3]byte{0, 13, 134}: "Huber + Suhner AG", + [3]byte{0, 13, 135}: "Elitegroup Computer System Co. (ECS)", + [3]byte{0, 13, 136}: "D-Link Corporation", + [3]byte{0, 13, 137}: "Bils Technology Inc", + [3]byte{0, 13, 138}: "Winners Electronics Co., Ltd.", + [3]byte{0, 13, 139}: "T&D Corporation", + [3]byte{0, 13, 140}: "Shanghai Wedone Digital Ltd. CO.", + [3]byte{0, 13, 141}: "Prosoft Technology, Inc", + [3]byte{0, 13, 142}: "Koden Electronics Co., Ltd.", + [3]byte{0, 13, 143}: "King Tsushin Kogyo Co., LTD.", + [3]byte{0, 13, 144}: "Factum Electronics AB", + [3]byte{0, 13, 145}: "Eclipse (HQ Espana) S.L.", + [3]byte{0, 13, 146}: "Arima Communication Corporation", + [3]byte{0, 13, 147}: "Apple", + [3]byte{0, 13, 148}: "AFAR Communications,Inc", + [3]byte{0, 13, 149}: "Opti-cell, Inc.", + [3]byte{0, 13, 150}: "Vtera Technology Inc.", + [3]byte{0, 13, 151}: "Tropos Networks, Inc.", + [3]byte{0, 13, 152}: "S.W.A.C. Schmitt-Walter Automation Consult GmbH", + [3]byte{0, 13, 153}: "Orbital Sciences Corp.; Launch Systems Group", + [3]byte{0, 13, 154}: "INFOTEC LTD", + [3]byte{0, 13, 155}: "Heraeus Electro-Nite International N.V.", + [3]byte{0, 13, 156}: "Elan GmbH & Co KG", + [3]byte{0, 13, 157}: "Hewlett-Packard Company", + [3]byte{0, 13, 158}: "TOKUDEN OHIZUMI SEISAKUSYO Co.,Ltd.", + [3]byte{0, 13, 159}: "RF Micro Devices", + [3]byte{0, 13, 160}: "NEDAP N.V.", + [3]byte{0, 13, 161}: "MIRAE ITS Co.,LTD.", + [3]byte{0, 13, 162}: "Infrant Technologies, Inc.", + [3]byte{0, 13, 163}: "Emerging Technologies Limited", + [3]byte{0, 13, 164}: "DOSCH & AMAND SYSTEMS AG", + [3]byte{0, 13, 165}: "Fabric7 Systems, Inc", + [3]byte{0, 13, 166}: "Universal Switching Corporation", + [3]byte{0, 13, 167}: "PRIVATE", + [3]byte{0, 13, 168}: "Teletronics Technology Corporation", + [3]byte{0, 13, 169}: "T.E.A.M. S.L.", + [3]byte{0, 13, 170}: "S.A.Tehnology co.,Ltd.", + [3]byte{0, 13, 171}: "Parker Hannifin GmbH Electromechanical Division Europe", + [3]byte{0, 13, 172}: "Japan CBM Corporation", + [3]byte{0, 13, 173}: "Dataprobe, Inc.", + [3]byte{0, 13, 174}: "SAMSUNG HEAVY INDUSTRIES CO., LTD.", + [3]byte{0, 13, 175}: "Plexus Corp (UK) Ltd", + [3]byte{0, 13, 176}: "Olym-tech Co.,Ltd.", + [3]byte{0, 13, 177}: "Japan Network Service Co., Ltd.", + [3]byte{0, 13, 178}: "Ammasso, Inc.", + [3]byte{0, 13, 179}: "SDO Communication Corperation", + [3]byte{0, 13, 180}: "NETASQ", + [3]byte{0, 13, 181}: "GLOBALSAT TECHNOLOGY CORPORATION", + [3]byte{0, 13, 182}: "Broadcom Corporation", + [3]byte{0, 13, 183}: "SANKO ELECTRIC CO,.LTD", + [3]byte{0, 13, 184}: "SCHILLER AG", + [3]byte{0, 13, 185}: "PC Engines GmbH", + [3]byte{0, 13, 186}: "Océ Document Technologies GmbH", + [3]byte{0, 13, 187}: "Nippon Dentsu Co.,Ltd.", + [3]byte{0, 13, 188}: "CISCO SYSTEMS, INC.", + [3]byte{0, 13, 189}: "CISCO SYSTEMS, INC.", + [3]byte{0, 13, 190}: "Bel Fuse Europe Ltd.,UK", + [3]byte{0, 13, 191}: "TekTone Sound & Signal Mfg., Inc.", + [3]byte{0, 13, 192}: "Spagat AS", + [3]byte{0, 13, 193}: "SafeWeb Inc", + [3]byte{0, 13, 194}: "PRIVATE", + [3]byte{0, 13, 195}: "First Communication, Inc.", + [3]byte{0, 13, 196}: "Emcore Corporation", + [3]byte{0, 13, 197}: "EchoStar Global B.V.", + [3]byte{0, 13, 198}: "DigiRose Technology Co., Ltd.", + [3]byte{0, 13, 199}: "COSMIC ENGINEERING INC.", + [3]byte{0, 13, 200}: "AirMagnet, Inc", + [3]byte{0, 13, 201}: "THALES Elektronik Systeme GmbH", + [3]byte{0, 13, 202}: "Tait Electronics", + [3]byte{0, 13, 203}: "Petcomkorea Co., Ltd.", + [3]byte{0, 13, 204}: "NEOSMART Corp.", + [3]byte{0, 13, 205}: "GROUPE TXCOM", + [3]byte{0, 13, 206}: "Dynavac Technology Pte Ltd", + [3]byte{0, 13, 207}: "Cidra Corp.", + [3]byte{0, 13, 208}: "TetraTec Instruments GmbH", + [3]byte{0, 13, 209}: "Stryker Corporation", + [3]byte{0, 13, 210}: "Simrad Optronics ASA", + [3]byte{0, 13, 211}: "SAMWOO Telecommunication Co.,Ltd.", + [3]byte{0, 13, 212}: "Symantec Corporation", + [3]byte{0, 13, 213}: "O'RITE TECHNOLOGY CO.,LTD", + [3]byte{0, 13, 214}: "ITI LTD", + [3]byte{0, 13, 215}: "Bright", + [3]byte{0, 13, 216}: "BBN", + [3]byte{0, 13, 217}: "Anton Paar GmbH", + [3]byte{0, 13, 218}: "ALLIED TELESIS K.K.", + [3]byte{0, 13, 219}: "AIRWAVE TECHNOLOGIES INC.", + [3]byte{0, 13, 220}: "VAC", + [3]byte{0, 13, 221}: "Profilo Telra Elektronik Sanayi ve Ticaret. A.Åž", + [3]byte{0, 13, 222}: "Joyteck Co., Ltd.", + [3]byte{0, 13, 223}: "Japan Image & Network Inc.", + [3]byte{0, 13, 224}: "ICPDAS Co.,LTD", + [3]byte{0, 13, 225}: "Control Products, Inc.", + [3]byte{0, 13, 226}: "CMZ Sistemi Elettronici", + [3]byte{0, 13, 227}: "AT Sweden AB", + [3]byte{0, 13, 228}: "DIGINICS, Inc.", + [3]byte{0, 13, 229}: "Samsung Thales", + [3]byte{0, 13, 230}: "YOUNGBO ENGINEERING CO.,LTD", + [3]byte{0, 13, 231}: "Snap-on OEM Group", + [3]byte{0, 13, 232}: "Nasaco Electronics Pte. Ltd", + [3]byte{0, 13, 233}: "Napatech Aps", + [3]byte{0, 13, 234}: "Kingtel Telecommunication Corp.", + [3]byte{0, 13, 235}: "CompXs Limited", + [3]byte{0, 13, 236}: "CISCO SYSTEMS, INC.", + [3]byte{0, 13, 237}: "CISCO SYSTEMS, INC.", + [3]byte{0, 13, 238}: "Andrew RF Power Amplifier Group", + [3]byte{0, 13, 239}: "Soc. Coop. Bilanciai", + [3]byte{0, 13, 240}: "QCOM TECHNOLOGY INC.", + [3]byte{0, 13, 241}: "IONIX INC.", + [3]byte{0, 13, 242}: "PRIVATE", + [3]byte{0, 13, 243}: "Asmax Solutions", + [3]byte{0, 13, 244}: "Watertek Co.", + [3]byte{0, 13, 245}: "Teletronics International Inc.", + [3]byte{0, 13, 246}: "Technology Thesaurus Corp.", + [3]byte{0, 13, 247}: "Space Dynamics Lab", + [3]byte{0, 13, 248}: "ORGA Kartensysteme GmbH", + [3]byte{0, 13, 249}: "NDS Limited", + [3]byte{0, 13, 250}: "Micro Control Systems Ltd.", + [3]byte{0, 13, 251}: "Komax AG", + [3]byte{0, 13, 252}: "ITFOR Inc.", + [3]byte{0, 13, 253}: "Huges Hi-Tech Inc.,", + [3]byte{0, 13, 254}: "Hauppauge Computer Works, Inc.", + [3]byte{0, 13, 255}: "CHENMING MOLD INDUSTRY CORP.", + [3]byte{0, 14, 0}: "Atrie", + [3]byte{0, 14, 1}: "ASIP Technologies Inc.", + [3]byte{0, 14, 2}: "Advantech AMT Inc.", + [3]byte{0, 14, 3}: "Emulex Corporation", + [3]byte{0, 14, 4}: "CMA/Microdialysis AB", + [3]byte{0, 14, 5}: "WIRELESS MATRIX CORP.", + [3]byte{0, 14, 6}: "Team Simoco Ltd", + [3]byte{0, 14, 7}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 14, 8}: "Cisco Linksys LLC", + [3]byte{0, 14, 9}: "Shenzhen Coship Software Co.,LTD.", + [3]byte{0, 14, 10}: "SAKUMA DESIGN OFFICE", + [3]byte{0, 14, 11}: "Netac Technology Co., Ltd.", + [3]byte{0, 14, 12}: "Intel Corporation", + [3]byte{0, 14, 13}: "Hesch Schröder GmbH", + [3]byte{0, 14, 14}: "ESA elettronica S.P.A.", + [3]byte{0, 14, 15}: "ERMME", + [3]byte{0, 14, 16}: "C-guys, Inc.", + [3]byte{0, 14, 17}: "BDT Büro und Datentechnik GmbH & Co.KG", + [3]byte{0, 14, 18}: "Adaptive Micro Systems Inc.", + [3]byte{0, 14, 19}: "Accu-Sort Systems inc.", + [3]byte{0, 14, 20}: "Visionary Solutions, Inc.", + [3]byte{0, 14, 21}: "Tadlys LTD", + [3]byte{0, 14, 22}: "SouthWing S.L.", + [3]byte{0, 14, 23}: "PRIVATE", + [3]byte{0, 14, 24}: "MyA Technology", + [3]byte{0, 14, 25}: "LogicaCMG Pty Ltd", + [3]byte{0, 14, 26}: "JPS Communications", + [3]byte{0, 14, 27}: "IAV GmbH", + [3]byte{0, 14, 28}: "Hach Company", + [3]byte{0, 14, 29}: "ARION Technology Inc.", + [3]byte{0, 14, 30}: "QLogic Corporation", + [3]byte{0, 14, 31}: "TCL Networks Equipment Co., Ltd.", + [3]byte{0, 14, 32}: "ACCESS Systems Americas, Inc.", + [3]byte{0, 14, 33}: "MTU Friedrichshafen GmbH", + [3]byte{0, 14, 34}: "PRIVATE", + [3]byte{0, 14, 35}: "Incipient, Inc.", + [3]byte{0, 14, 36}: "Huwell Technology Inc.", + [3]byte{0, 14, 37}: "Hannae Technology Co., Ltd", + [3]byte{0, 14, 38}: "Gincom Technology Corp.", + [3]byte{0, 14, 39}: "Crere Networks, Inc.", + [3]byte{0, 14, 40}: "Dynamic Ratings P/L", + [3]byte{0, 14, 41}: "Shester Communications Inc", + [3]byte{0, 14, 42}: "PRIVATE", + [3]byte{0, 14, 43}: "Safari Technologies", + [3]byte{0, 14, 44}: "Netcodec co.", + [3]byte{0, 14, 45}: "Hyundai Digital Technology Co.,Ltd.", + [3]byte{0, 14, 46}: "Edimax Technology Co., Ltd.", + [3]byte{0, 14, 47}: "Roche Diagnostics GmbH", + [3]byte{0, 14, 48}: "AERAS Networks, Inc.", + [3]byte{0, 14, 49}: "Olympus Soft Imaging Solutions GmbH", + [3]byte{0, 14, 50}: "Kontron Medical", + [3]byte{0, 14, 51}: "Shuko Electronics Co.,Ltd", + [3]byte{0, 14, 52}: "NexGen City, LP", + [3]byte{0, 14, 53}: "Intel Corp", + [3]byte{0, 14, 54}: "HEINESYS, Inc.", + [3]byte{0, 14, 55}: "Harms & Wende GmbH & Co.KG", + [3]byte{0, 14, 56}: "CISCO SYSTEMS, INC.", + [3]byte{0, 14, 57}: "CISCO SYSTEMS, INC.", + [3]byte{0, 14, 58}: "Cirrus Logic", + [3]byte{0, 14, 59}: "Hawking Technologies, Inc.", + [3]byte{0, 14, 60}: "Transact Technologies Inc", + [3]byte{0, 14, 61}: "Televic N.V.", + [3]byte{0, 14, 62}: "Sun Optronics Inc", + [3]byte{0, 14, 63}: "Soronti, Inc.", + [3]byte{0, 14, 64}: "Nortel Networks", + [3]byte{0, 14, 65}: "NIHON MECHATRONICS CO.,LTD.", + [3]byte{0, 14, 66}: "Motic Incoporation Ltd.", + [3]byte{0, 14, 67}: "G-Tek Electronics Sdn. Bhd.", + [3]byte{0, 14, 68}: "Digital 5, Inc.", + [3]byte{0, 14, 69}: "Beijing Newtry Electronic Technology Ltd", + [3]byte{0, 14, 70}: "Niigata Seimitsu Co.,Ltd.", + [3]byte{0, 14, 71}: "NCI System Co.,Ltd.", + [3]byte{0, 14, 72}: "Lipman TransAction Solutions", + [3]byte{0, 14, 73}: "Forsway Scandinavia AB", + [3]byte{0, 14, 74}: "Changchun Huayu WEBPAD Co.,LTD", + [3]byte{0, 14, 75}: "atrium c and i", + [3]byte{0, 14, 76}: "Bermai Inc.", + [3]byte{0, 14, 77}: "Numesa Inc.", + [3]byte{0, 14, 78}: "Waveplus Technology Co., Ltd.", + [3]byte{0, 14, 79}: "Trajet GmbH", + [3]byte{0, 14, 80}: "Thomson Telecom Belgium", + [3]byte{0, 14, 81}: "tecna elettronica srl", + [3]byte{0, 14, 82}: "Optium Corporation", + [3]byte{0, 14, 83}: "AV TECH CORPORATION", + [3]byte{0, 14, 84}: "AlphaCell Wireless Ltd.", + [3]byte{0, 14, 85}: "AUVITRAN", + [3]byte{0, 14, 86}: "4G Systems GmbH & Co. KG", + [3]byte{0, 14, 87}: "Iworld Networking, Inc.", + [3]byte{0, 14, 88}: "Sonos, Inc.", + [3]byte{0, 14, 89}: "SAGEM SA", + [3]byte{0, 14, 90}: "TELEFIELD inc.", + [3]byte{0, 14, 91}: "ParkerVision - Direct2Data", + [3]byte{0, 14, 92}: "ARRIS Group, Inc.", + [3]byte{0, 14, 93}: "Triple Play Technologies A/S", + [3]byte{0, 14, 94}: "Raisecom Technology", + [3]byte{0, 14, 95}: "activ-net GmbH & Co. KG", + [3]byte{0, 14, 96}: "360SUN Digital Broadband Corporation", + [3]byte{0, 14, 97}: "MICROTROL LIMITED", + [3]byte{0, 14, 98}: "Nortel Networks", + [3]byte{0, 14, 99}: "Lemke Diagnostics GmbH", + [3]byte{0, 14, 100}: "Elphel, Inc", + [3]byte{0, 14, 101}: "TransCore", + [3]byte{0, 14, 102}: "Hitachi Industry & Control Solutions, Ltd.", + [3]byte{0, 14, 103}: "Eltis Microelectronics Ltd.", + [3]byte{0, 14, 104}: "E-TOP Network Technology Inc.", + [3]byte{0, 14, 105}: "China Electric Power Research Institute", + [3]byte{0, 14, 106}: "3Com Ltd", + [3]byte{0, 14, 107}: "Janitza electronics GmbH", + [3]byte{0, 14, 108}: "Device Drivers Limited", + [3]byte{0, 14, 109}: "Murata Manufacturing Co., Ltd.", + [3]byte{0, 14, 110}: "MAT S.A. (Mircrelec Advanced Technology)", + [3]byte{0, 14, 111}: "IRIS Corporation Berhad", + [3]byte{0, 14, 112}: "in2 Networks", + [3]byte{0, 14, 113}: "Gemstar Technology Development Ltd.", + [3]byte{0, 14, 114}: "CTS electronics", + [3]byte{0, 14, 115}: "Tpack A/S", + [3]byte{0, 14, 116}: "Solar Telecom. Tech", + [3]byte{0, 14, 117}: "New York Air Brake Corp.", + [3]byte{0, 14, 118}: "GEMSOC INNOVISION INC.", + [3]byte{0, 14, 119}: "Decru, Inc.", + [3]byte{0, 14, 120}: "Amtelco", + [3]byte{0, 14, 121}: "Ample Communications Inc.", + [3]byte{0, 14, 122}: "GemWon Communications Co., Ltd.", + [3]byte{0, 14, 123}: "Toshiba", + [3]byte{0, 14, 124}: "Televes S.A.", + [3]byte{0, 14, 125}: "Electronics Line 3000 Ltd.", + [3]byte{0, 14, 126}: "ionSign Oy", + [3]byte{0, 14, 127}: "Hewlett-Packard Company", + [3]byte{0, 14, 128}: "Thomson Technology Inc", + [3]byte{0, 14, 129}: "Devicescape Software, Inc.", + [3]byte{0, 14, 130}: "Commtech Wireless", + [3]byte{0, 14, 131}: "CISCO SYSTEMS, INC.", + [3]byte{0, 14, 132}: "CISCO SYSTEMS, INC.", + [3]byte{0, 14, 133}: "Catalyst Enterprises, Inc.", + [3]byte{0, 14, 134}: "Alcatel North America", + [3]byte{0, 14, 135}: "adp Gauselmann GmbH", + [3]byte{0, 14, 136}: "VIDEOTRON CORP.", + [3]byte{0, 14, 137}: "CLEMATIC", + [3]byte{0, 14, 138}: "Avara Technologies Pty. Ltd.", + [3]byte{0, 14, 139}: "Astarte Technology Co, Ltd.", + [3]byte{0, 14, 140}: "Siemens AG A&D ET", + [3]byte{0, 14, 141}: "Systems in Progress Holding GmbH", + [3]byte{0, 14, 142}: "SparkLAN Communications, Inc.", + [3]byte{0, 14, 143}: "Sercomm Corp.", + [3]byte{0, 14, 144}: "PONICO CORP.", + [3]byte{0, 14, 145}: "Navico Auckland Ltd", + [3]byte{0, 14, 146}: "Open Telecom", + [3]byte{0, 14, 147}: "Milénio 3 Sistemas Electrónicos, Lda.", + [3]byte{0, 14, 148}: "Maas International BV", + [3]byte{0, 14, 149}: "Fujiya Denki Seisakusho Co.,Ltd.", + [3]byte{0, 14, 150}: "Cubic Defense Applications, Inc.", + [3]byte{0, 14, 151}: "Ultracker Technology CO., Inc", + [3]byte{0, 14, 152}: "HME Clear-Com LTD.", + [3]byte{0, 14, 153}: "Spectrum Digital, Inc", + [3]byte{0, 14, 154}: "BOE TECHNOLOGY GROUP CO.,LTD", + [3]byte{0, 14, 155}: "Ambit Microsystems Corporation", + [3]byte{0, 14, 156}: "Benchmark Electronics", + [3]byte{0, 14, 157}: "Tiscali UK Ltd", + [3]byte{0, 14, 158}: "Topfield Co., Ltd", + [3]byte{0, 14, 159}: "TEMIC SDS GmbH", + [3]byte{0, 14, 160}: "NetKlass Technology Inc.", + [3]byte{0, 14, 161}: "Formosa Teletek Corporation", + [3]byte{0, 14, 162}: "McAfee, Inc", + [3]byte{0, 14, 163}: "CNCR-IT CO.,LTD,HangZhou P.R.CHINA", + [3]byte{0, 14, 164}: "Certance Inc.", + [3]byte{0, 14, 165}: "BLIP Systems", + [3]byte{0, 14, 166}: "ASUSTEK COMPUTER INC.", + [3]byte{0, 14, 167}: "Endace Technology", + [3]byte{0, 14, 168}: "United Technologists Europe Limited", + [3]byte{0, 14, 169}: "Shanghai Xun Shi Communications Equipment Ltd. Co.", + [3]byte{0, 14, 170}: "Scalent Systems, Inc.", + [3]byte{0, 14, 171}: "Cray Inc", + [3]byte{0, 14, 172}: "MINTRON ENTERPRISE CO., LTD.", + [3]byte{0, 14, 173}: "Metanoia Technologies, Inc.", + [3]byte{0, 14, 174}: "GAWELL TECHNOLOGIES CORP.", + [3]byte{0, 14, 175}: "CASTEL", + [3]byte{0, 14, 176}: "Solutions Radio BV", + [3]byte{0, 14, 177}: "Newcotech,Ltd", + [3]byte{0, 14, 178}: "Micro-Research Finland Oy", + [3]byte{0, 14, 179}: "Hewlett-Packard", + [3]byte{0, 14, 180}: "GUANGZHOU GAOKE COMMUNICATIONS TECHNOLOGY CO.LTD.", + [3]byte{0, 14, 181}: "Ecastle Electronics Co., Ltd.", + [3]byte{0, 14, 182}: "Riverbed Technology, Inc.", + [3]byte{0, 14, 183}: "Knovative, Inc.", + [3]byte{0, 14, 184}: "Iiga co.,Ltd", + [3]byte{0, 14, 185}: "HASHIMOTO Electronics Industry Co.,Ltd.", + [3]byte{0, 14, 186}: "HANMI SEMICONDUCTOR CO., LTD.", + [3]byte{0, 14, 187}: "Everbee Networks", + [3]byte{0, 14, 188}: "Paragon Fidelity GmbH", + [3]byte{0, 14, 189}: "Burdick, a Quinton Compny", + [3]byte{0, 14, 190}: "B&B Electronics Manufacturing Co.", + [3]byte{0, 14, 191}: "Remsdaq Limited", + [3]byte{0, 14, 192}: "Nortel Networks", + [3]byte{0, 14, 193}: "MYNAH Technologies", + [3]byte{0, 14, 194}: "Lowrance Electronics, Inc.", + [3]byte{0, 14, 195}: "Logic Controls, Inc.", + [3]byte{0, 14, 196}: "Iskra Transmission d.d.", + [3]byte{0, 14, 197}: "Digital Multitools Inc", + [3]byte{0, 14, 198}: "ASIX ELECTRONICS CORP.", + [3]byte{0, 14, 199}: "Motorola Korea", + [3]byte{0, 14, 200}: "Zoran Corporation", + [3]byte{0, 14, 201}: "YOKO Technology Corp.", + [3]byte{0, 14, 202}: "WTSS Inc", + [3]byte{0, 14, 203}: "VineSys Technology", + [3]byte{0, 14, 204}: "Tableau, LLC", + [3]byte{0, 14, 205}: "SKOV A/S", + [3]byte{0, 14, 206}: "S.I.T.T.I. S.p.A.", + [3]byte{0, 14, 207}: "PROFIBUS Nutzerorganisation e.V.", + [3]byte{0, 14, 208}: "Privaris, Inc.", + [3]byte{0, 14, 209}: "Osaka Micro Computer.", + [3]byte{0, 14, 210}: "Filtronic plc", + [3]byte{0, 14, 211}: "Epicenter, Inc.", + [3]byte{0, 14, 212}: "CRESITT INDUSTRIE", + [3]byte{0, 14, 213}: "COPAN Systems Inc.", + [3]byte{0, 14, 214}: "CISCO SYSTEMS, INC.", + [3]byte{0, 14, 215}: "CISCO SYSTEMS, INC.", + [3]byte{0, 14, 216}: "Aktino, Inc.", + [3]byte{0, 14, 217}: "Aksys, Ltd.", + [3]byte{0, 14, 218}: "C-TECH UNITED CORP.", + [3]byte{0, 14, 219}: "XiNCOM Corp.", + [3]byte{0, 14, 220}: "Tellion INC.", + [3]byte{0, 14, 221}: "SHURE INCORPORATED", + [3]byte{0, 14, 222}: "REMEC, Inc.", + [3]byte{0, 14, 223}: "PLX Technology", + [3]byte{0, 14, 224}: "Mcharge", + [3]byte{0, 14, 225}: "ExtremeSpeed Inc.", + [3]byte{0, 14, 226}: "Custom Engineering", + [3]byte{0, 14, 227}: "Chiyu Technology Co.,Ltd", + [3]byte{0, 14, 228}: "BOE TECHNOLOGY GROUP CO.,LTD", + [3]byte{0, 14, 229}: "bitWallet, Inc.", + [3]byte{0, 14, 230}: "Adimos Systems LTD", + [3]byte{0, 14, 231}: "AAC ELECTRONICS CORP.", + [3]byte{0, 14, 232}: "zioncom", + [3]byte{0, 14, 233}: "WayTech Development, Inc.", + [3]byte{0, 14, 234}: "Shadong Luneng Jicheng Electronics,Co.,Ltd", + [3]byte{0, 14, 235}: "Sandmartin(zhong shan)Electronics Co.,Ltd", + [3]byte{0, 14, 236}: "Orban", + [3]byte{0, 14, 237}: "Nokia Danmark A/S", + [3]byte{0, 14, 238}: "Muco Industrie BV", + [3]byte{0, 14, 239}: "PRIVATE", + [3]byte{0, 14, 240}: "Festo AG & Co. KG", + [3]byte{0, 14, 241}: "EZQUEST INC.", + [3]byte{0, 14, 242}: "Infinico Corporation", + [3]byte{0, 14, 243}: "Smarthome", + [3]byte{0, 14, 244}: "Kasda Digital Technology Co.,Ltd", + [3]byte{0, 14, 245}: "iPAC Technology Co., Ltd.", + [3]byte{0, 14, 246}: "E-TEN Information Systems Co., Ltd.", + [3]byte{0, 14, 247}: "Vulcan Portals Inc", + [3]byte{0, 14, 248}: "SBC ASI", + [3]byte{0, 14, 249}: "REA Elektronik GmbH", + [3]byte{0, 14, 250}: "Optoway Technology Incorporation", + [3]byte{0, 14, 251}: "Macey Enterprises", + [3]byte{0, 14, 252}: "JTAG Technologies B.V.", + [3]byte{0, 14, 253}: "FUJINON CORPORATION", + [3]byte{0, 14, 254}: "EndRun Technologies LLC", + [3]byte{0, 14, 255}: "Megasolution,Inc.", + [3]byte{0, 15, 0}: "Legra Systems, Inc.", + [3]byte{0, 15, 1}: "DIGITALKS INC", + [3]byte{0, 15, 2}: "Digicube Technology Co., Ltd", + [3]byte{0, 15, 3}: "COM&C CO., LTD", + [3]byte{0, 15, 4}: "cim-usa inc", + [3]byte{0, 15, 5}: "3B SYSTEM INC.", + [3]byte{0, 15, 6}: "Nortel Networks", + [3]byte{0, 15, 7}: "Mangrove Systems, Inc.", + [3]byte{0, 15, 8}: "Indagon Oy", + [3]byte{0, 15, 9}: "PRIVATE", + [3]byte{0, 15, 10}: "Clear Edge Networks", + [3]byte{0, 15, 11}: "Kentima Technologies AB", + [3]byte{0, 15, 12}: "SYNCHRONIC ENGINEERING", + [3]byte{0, 15, 13}: "Hunt Electronic Co., Ltd.", + [3]byte{0, 15, 14}: "WaveSplitter Technologies, Inc.", + [3]byte{0, 15, 15}: "Real ID Technology Co., Ltd.", + [3]byte{0, 15, 16}: "RDM Corporation", + [3]byte{0, 15, 17}: "Prodrive B.V.", + [3]byte{0, 15, 18}: "Panasonic Europe Ltd.", + [3]byte{0, 15, 19}: "Nisca corporation", + [3]byte{0, 15, 20}: "Mindray Co., Ltd.", + [3]byte{0, 15, 21}: "Kjaerulff1 A/S", + [3]byte{0, 15, 22}: "JAY HOW TECHNOLOGY CO.,", + [3]byte{0, 15, 23}: "Insta Elektro GmbH", + [3]byte{0, 15, 24}: "Industrial Control Systems", + [3]byte{0, 15, 25}: "Boston Scientific", + [3]byte{0, 15, 26}: "Gaming Support B.V.", + [3]byte{0, 15, 27}: "Ego Systems Inc.", + [3]byte{0, 15, 28}: "DigitAll World Co., Ltd", + [3]byte{0, 15, 29}: "Cosmo Techs Co., Ltd.", + [3]byte{0, 15, 30}: "Chengdu KT Electric Co.of High & New Technology", + [3]byte{0, 15, 31}: "Dell Inc", + [3]byte{0, 15, 32}: "Hewlett-Packard Company", + [3]byte{0, 15, 33}: "Scientific Atlanta, Inc", + [3]byte{0, 15, 34}: "Helius, Inc.", + [3]byte{0, 15, 35}: "CISCO SYSTEMS, INC.", + [3]byte{0, 15, 36}: "CISCO SYSTEMS, INC.", + [3]byte{0, 15, 37}: "AimValley B.V.", + [3]byte{0, 15, 38}: "WorldAccxx LLC", + [3]byte{0, 15, 39}: "TEAL Electronics, Inc.", + [3]byte{0, 15, 40}: "Itronix Corporation", + [3]byte{0, 15, 41}: "Augmentix Corporation", + [3]byte{0, 15, 42}: "Cableware Electronics", + [3]byte{0, 15, 43}: "GREENBELL SYSTEMS", + [3]byte{0, 15, 44}: "Uplogix, Inc.", + [3]byte{0, 15, 45}: "CHUNG-HSIN ELECTRIC & MACHINERY MFG.CORP.", + [3]byte{0, 15, 46}: "Megapower International Corp.", + [3]byte{0, 15, 47}: "W-LINX TECHNOLOGY CO., LTD.", + [3]byte{0, 15, 48}: "Raza Microelectronics Inc", + [3]byte{0, 15, 49}: "Allied Vision Technologies Canada Inc", + [3]byte{0, 15, 50}: "Lootom Telcovideo Network Wuxi Co Ltd", + [3]byte{0, 15, 51}: "DUALi Inc.", + [3]byte{0, 15, 52}: "CISCO SYSTEMS, INC.", + [3]byte{0, 15, 53}: "CISCO SYSTEMS, INC.", + [3]byte{0, 15, 54}: "Accurate Techhnologies, Inc.", + [3]byte{0, 15, 55}: "Xambala Incorporated", + [3]byte{0, 15, 56}: "Netstar", + [3]byte{0, 15, 57}: "IRIS SENSORS", + [3]byte{0, 15, 58}: "HISHARP", + [3]byte{0, 15, 59}: "Fuji System Machines Co., Ltd.", + [3]byte{0, 15, 60}: "Endeleo Limited", + [3]byte{0, 15, 61}: "D-Link Corporation", + [3]byte{0, 15, 62}: "CardioNet, Inc", + [3]byte{0, 15, 63}: "Big Bear Networks", + [3]byte{0, 15, 64}: "Optical Internetworking Forum", + [3]byte{0, 15, 65}: "Zipher Ltd", + [3]byte{0, 15, 66}: "Xalyo Systems", + [3]byte{0, 15, 67}: "Wasabi Systems Inc.", + [3]byte{0, 15, 68}: "Tivella Inc.", + [3]byte{0, 15, 69}: "Stretch, Inc.", + [3]byte{0, 15, 70}: "SINAR AG", + [3]byte{0, 15, 71}: "ROBOX SPA", + [3]byte{0, 15, 72}: "Polypix Inc.", + [3]byte{0, 15, 73}: "Northover Solutions Limited", + [3]byte{0, 15, 74}: "Kyushu-kyohan co.,ltd", + [3]byte{0, 15, 75}: "Oracle Corporation", + [3]byte{0, 15, 76}: "Elextech INC", + [3]byte{0, 15, 77}: "TalkSwitch", + [3]byte{0, 15, 78}: "Cellink", + [3]byte{0, 15, 79}: "Cadmus Technology Ltd", + [3]byte{0, 15, 80}: "StreamScale Limited", + [3]byte{0, 15, 81}: "Azul Systems, Inc.", + [3]byte{0, 15, 82}: "YORK Refrigeration, Marine & Controls", + [3]byte{0, 15, 83}: "Solarflare Communications Inc", + [3]byte{0, 15, 84}: "Entrelogic Corporation", + [3]byte{0, 15, 85}: "Datawire Communication Networks Inc.", + [3]byte{0, 15, 86}: "Continuum Photonics Inc", + [3]byte{0, 15, 87}: "CABLELOGIC Co., Ltd.", + [3]byte{0, 15, 88}: "Adder Technology Limited", + [3]byte{0, 15, 89}: "Phonak Communications AG", + [3]byte{0, 15, 90}: "Peribit Networks", + [3]byte{0, 15, 91}: "Delta Information Systems, Inc.", + [3]byte{0, 15, 92}: "Day One Digital Media Limited", + [3]byte{0, 15, 93}: "Genexis BV", + [3]byte{0, 15, 94}: "Veo", + [3]byte{0, 15, 95}: "Nicety Technologies Inc. (NTS)", + [3]byte{0, 15, 96}: "Lifetron Co.,Ltd", + [3]byte{0, 15, 97}: "Hewlett-Packard Company", + [3]byte{0, 15, 98}: "Alcatel Bell Space N.V.", + [3]byte{0, 15, 99}: "Obzerv Technologies", + [3]byte{0, 15, 100}: "D&R Electronica Weesp BV", + [3]byte{0, 15, 101}: "icube Corp.", + [3]byte{0, 15, 102}: "Cisco-Linksys", + [3]byte{0, 15, 103}: "West Instruments", + [3]byte{0, 15, 104}: "Vavic Network Technology, Inc.", + [3]byte{0, 15, 105}: "SEW Eurodrive GmbH & Co. KG", + [3]byte{0, 15, 106}: "Nortel Networks", + [3]byte{0, 15, 107}: "GateWare Communications GmbH", + [3]byte{0, 15, 108}: "ADDI-DATA GmbH", + [3]byte{0, 15, 109}: "Midas Engineering", + [3]byte{0, 15, 110}: "BBox", + [3]byte{0, 15, 111}: "FTA Communication Technologies", + [3]byte{0, 15, 112}: "Wintec Industries, inc.", + [3]byte{0, 15, 113}: "Sanmei Electronics Co.,Ltd", + [3]byte{0, 15, 114}: "Sandburst", + [3]byte{0, 15, 115}: "RS Automation Co., Ltd", + [3]byte{0, 15, 116}: "Qamcom Technology AB", + [3]byte{0, 15, 117}: "First Silicon Solutions", + [3]byte{0, 15, 118}: "Digital Keystone, Inc.", + [3]byte{0, 15, 119}: "DENTUM CO.,LTD", + [3]byte{0, 15, 120}: "Datacap Systems Inc", + [3]byte{0, 15, 121}: "Bluetooth Interest Group Inc.", + [3]byte{0, 15, 122}: "BeiJing NuQX Technology CO.,LTD", + [3]byte{0, 15, 123}: "Arce Sistemas, S.A.", + [3]byte{0, 15, 124}: "ACTi Corporation", + [3]byte{0, 15, 125}: "Xirrus", + [3]byte{0, 15, 126}: "Ablerex Electronics Co., LTD", + [3]byte{0, 15, 127}: "UBSTORAGE Co.,Ltd.", + [3]byte{0, 15, 128}: "Trinity Security Systems,Inc.", + [3]byte{0, 15, 129}: "PAL Pacific Inc.", + [3]byte{0, 15, 130}: "Mortara Instrument, Inc.", + [3]byte{0, 15, 131}: "Brainium Technologies Inc.", + [3]byte{0, 15, 132}: "Astute Networks, Inc.", + [3]byte{0, 15, 133}: "ADDO-Japan Corporation", + [3]byte{0, 15, 134}: "Research In Motion Limited", + [3]byte{0, 15, 135}: "Maxcess International", + [3]byte{0, 15, 136}: "AMETEK, Inc.", + [3]byte{0, 15, 137}: "Winnertec System Co., Ltd.", + [3]byte{0, 15, 138}: "WideView", + [3]byte{0, 15, 139}: "Orion MultiSystems Inc", + [3]byte{0, 15, 140}: "Gigawavetech Pte Ltd", + [3]byte{0, 15, 141}: "FAST TV-Server AG", + [3]byte{0, 15, 142}: "DONGYANG TELECOM CO.,LTD.", + [3]byte{0, 15, 143}: "CISCO SYSTEMS, INC.", + [3]byte{0, 15, 144}: "CISCO SYSTEMS, INC.", + [3]byte{0, 15, 145}: "Aerotelecom Co.,Ltd.", + [3]byte{0, 15, 146}: "Microhard Systems Inc.", + [3]byte{0, 15, 147}: "Landis+Gyr Ltd.", + [3]byte{0, 15, 148}: "Genexis BV", + [3]byte{0, 15, 149}: "ELECOM Co.,LTD Laneed Division", + [3]byte{0, 15, 150}: "Telco Systems, Inc.", + [3]byte{0, 15, 151}: "Avanex Corporation", + [3]byte{0, 15, 152}: "Avamax Co. Ltd.", + [3]byte{0, 15, 153}: "APAC opto Electronics Inc.", + [3]byte{0, 15, 154}: "Synchrony, Inc.", + [3]byte{0, 15, 155}: "Ross Video Limited", + [3]byte{0, 15, 156}: "Panduit Corp", + [3]byte{0, 15, 157}: "DisplayLink (UK) Ltd", + [3]byte{0, 15, 158}: "Murrelektronik GmbH", + [3]byte{0, 15, 159}: "ARRIS Group, Inc.", + [3]byte{0, 15, 160}: "CANON KOREA BUSINESS SOLUTIONS INC.", + [3]byte{0, 15, 161}: "Gigabit Systems Inc.", + [3]byte{0, 15, 162}: "2xWireless", + [3]byte{0, 15, 163}: "Alpha Networks Inc.", + [3]byte{0, 15, 164}: "Sprecher Automation GmbH", + [3]byte{0, 15, 165}: "BWA Technology GmbH", + [3]byte{0, 15, 166}: "S2 Security Corporation", + [3]byte{0, 15, 167}: "Raptor Networks Technology", + [3]byte{0, 15, 168}: "Photometrics, Inc.", + [3]byte{0, 15, 169}: "PC Fabrik", + [3]byte{0, 15, 170}: "Nexus Technologies", + [3]byte{0, 15, 171}: "Kyushu Electronics Systems Inc.", + [3]byte{0, 15, 172}: "IEEE 802.11", + [3]byte{0, 15, 173}: "FMN communications GmbH", + [3]byte{0, 15, 174}: "E2O Communications", + [3]byte{0, 15, 175}: "Dialog Inc.", + [3]byte{0, 15, 176}: "Compal Electronics,INC.", + [3]byte{0, 15, 177}: "Cognio Inc.", + [3]byte{0, 15, 178}: "Broadband Pacenet (India) Pvt. Ltd.", + [3]byte{0, 15, 179}: "Actiontec Electronics, Inc", + [3]byte{0, 15, 180}: "Timespace Technology", + [3]byte{0, 15, 181}: "NETGEAR Inc", + [3]byte{0, 15, 182}: "Europlex Technologies", + [3]byte{0, 15, 183}: "Cavium Networks", + [3]byte{0, 15, 184}: "CallURL Inc.", + [3]byte{0, 15, 185}: "Adaptive Instruments", + [3]byte{0, 15, 186}: "Tevebox AB", + [3]byte{0, 15, 187}: "Nokia Siemens Networks GmbH & Co. KG.", + [3]byte{0, 15, 188}: "Onkey Technologies, Inc.", + [3]byte{0, 15, 189}: "MRV Communications (Networks) LTD", + [3]byte{0, 15, 190}: "e-w/you Inc.", + [3]byte{0, 15, 191}: "DGT Sp. z o.o.", + [3]byte{0, 15, 192}: "DELCOMp", + [3]byte{0, 15, 193}: "WAVE Corporation", + [3]byte{0, 15, 194}: "Uniwell Corporation", + [3]byte{0, 15, 195}: "PalmPalm Technology, Inc.", + [3]byte{0, 15, 196}: "NST co.,LTD.", + [3]byte{0, 15, 197}: "KeyMed Ltd", + [3]byte{0, 15, 198}: "Eurocom Industries A/S", + [3]byte{0, 15, 199}: "Dionica R&D Ltd.", + [3]byte{0, 15, 200}: "Chantry Networks", + [3]byte{0, 15, 201}: "Allnet GmbH", + [3]byte{0, 15, 202}: "A-JIN TECHLINE CO, LTD", + [3]byte{0, 15, 203}: "3Com Ltd", + [3]byte{0, 15, 204}: "Netopia, Inc.", + [3]byte{0, 15, 205}: "Nortel Networks", + [3]byte{0, 15, 206}: "Kikusui Electronics Corp.", + [3]byte{0, 15, 207}: "Datawind Research", + [3]byte{0, 15, 208}: "ASTRI", + [3]byte{0, 15, 209}: "Applied Wireless Identifications Group, Inc.", + [3]byte{0, 15, 210}: "EWA Technologies, Inc.", + [3]byte{0, 15, 211}: "Digium", + [3]byte{0, 15, 212}: "Soundcraft", + [3]byte{0, 15, 213}: "Schwechat - RISE", + [3]byte{0, 15, 214}: "Sarotech Co., Ltd", + [3]byte{0, 15, 215}: "Harman Music Group", + [3]byte{0, 15, 216}: "Force, Inc.", + [3]byte{0, 15, 217}: "FlexDSL Telecommunications AG", + [3]byte{0, 15, 218}: "YAZAKI CORPORATION", + [3]byte{0, 15, 219}: "Westell Technologies", + [3]byte{0, 15, 220}: "Ueda Japan Radio Co., Ltd.", + [3]byte{0, 15, 221}: "SORDIN AB", + [3]byte{0, 15, 222}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 15, 223}: "SOLOMON Technology Corp.", + [3]byte{0, 15, 224}: "NComputing Co.,Ltd.", + [3]byte{0, 15, 225}: "ID DIGITAL CORPORATION", + [3]byte{0, 15, 226}: "Hangzhou H3C Technologies Co., Ltd.", + [3]byte{0, 15, 227}: "Damm Cellular Systems A/S", + [3]byte{0, 15, 228}: "Pantech Co.,Ltd", + [3]byte{0, 15, 229}: "MERCURY SECURITY CORPORATION", + [3]byte{0, 15, 230}: "MBTech Systems, Inc.", + [3]byte{0, 15, 231}: "Lutron Electronics Co., Inc.", + [3]byte{0, 15, 232}: "Lobos, Inc.", + [3]byte{0, 15, 233}: "GW TECHNOLOGIES CO.,LTD.", + [3]byte{0, 15, 234}: "Giga-Byte Technology Co.,LTD.", + [3]byte{0, 15, 235}: "Cylon Controls", + [3]byte{0, 15, 236}: "ARKUS Inc.", + [3]byte{0, 15, 237}: "Anam Electronics Co., Ltd", + [3]byte{0, 15, 238}: "XTec, Incorporated", + [3]byte{0, 15, 239}: "Thales e-Transactions GmbH", + [3]byte{0, 15, 240}: "Sunray Co. Ltd.", + [3]byte{0, 15, 241}: "nex-G Systems Pte.Ltd", + [3]byte{0, 15, 242}: "Loud Technologies Inc.", + [3]byte{0, 15, 243}: "Jung Myoung Communications&Technology", + [3]byte{0, 15, 244}: "Guntermann & Drunck GmbH", + [3]byte{0, 15, 245}: "GN&S company", + [3]byte{0, 15, 246}: "Darfon Electronics Corp.", + [3]byte{0, 15, 247}: "CISCO SYSTEMS, INC.", + [3]byte{0, 15, 248}: "CISCO SYSTEMS, INC.", + [3]byte{0, 15, 249}: "Valcretec, Inc.", + [3]byte{0, 15, 250}: "Optinel Systems, Inc.", + [3]byte{0, 15, 251}: "Nippon Denso Industry Co., Ltd.", + [3]byte{0, 15, 252}: "Merit Li-Lin Ent.", + [3]byte{0, 15, 253}: "Glorytek Network Inc.", + [3]byte{0, 15, 254}: "G-PRO COMPUTER", + [3]byte{0, 15, 255}: "Control4", + [3]byte{0, 16, 0}: "CABLE TELEVISION LABORATORIES, INC.", + [3]byte{0, 16, 1}: "Citel", + [3]byte{0, 16, 2}: "ACTIA", + [3]byte{0, 16, 3}: "IMATRON, INC.", + [3]byte{0, 16, 4}: "THE BRANTLEY COILE COMPANY,INC", + [3]byte{0, 16, 5}: "UEC COMMERCIAL", + [3]byte{0, 16, 6}: "Thales Contact Solutions Ltd.", + [3]byte{0, 16, 7}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 8}: "VIENNA SYSTEMS CORPORATION", + [3]byte{0, 16, 9}: "HORO QUARTZ", + [3]byte{0, 16, 10}: "WILLIAMS COMMUNICATIONS GROUP", + [3]byte{0, 16, 11}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 12}: "ITO CO., LTD.", + [3]byte{0, 16, 13}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 14}: "MICRO LINEAR COPORATION", + [3]byte{0, 16, 15}: "INDUSTRIAL CPU SYSTEMS", + [3]byte{0, 16, 16}: "INITIO CORPORATION", + [3]byte{0, 16, 17}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 18}: "PROCESSOR SYSTEMS (I) PVT LTD", + [3]byte{0, 16, 19}: "Kontron America, Inc.", + [3]byte{0, 16, 20}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 21}: "OOmon Inc.", + [3]byte{0, 16, 22}: "T.SQWARE", + [3]byte{0, 16, 23}: "Bosch Access Systems GmbH", + [3]byte{0, 16, 24}: "BROADCOM CORPORATION", + [3]byte{0, 16, 25}: "SIRONA DENTAL SYSTEMS GmbH & Co. KG", + [3]byte{0, 16, 26}: "PictureTel Corp.", + [3]byte{0, 16, 27}: "CORNET TECHNOLOGY, INC.", + [3]byte{0, 16, 28}: "OHM TECHNOLOGIES INTL, LLC", + [3]byte{0, 16, 29}: "WINBOND ELECTRONICS CORP.", + [3]byte{0, 16, 30}: "MATSUSHITA ELECTRONIC INSTRUMENTS CORP.", + [3]byte{0, 16, 31}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 32}: "Hand Held Products Inc", + [3]byte{0, 16, 33}: "ENCANTO NETWORKS, INC.", + [3]byte{0, 16, 34}: "SatCom Media Corporation", + [3]byte{0, 16, 35}: "Network Equipment Technologies", + [3]byte{0, 16, 36}: "NAGOYA ELECTRIC WORKS CO., LTD", + [3]byte{0, 16, 37}: "Grayhill, Inc", + [3]byte{0, 16, 38}: "ACCELERATED NETWORKS, INC.", + [3]byte{0, 16, 39}: "L-3 COMMUNICATIONS EAST", + [3]byte{0, 16, 40}: "COMPUTER TECHNICA, INC.", + [3]byte{0, 16, 41}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 42}: "ZF MICROSYSTEMS, INC.", + [3]byte{0, 16, 43}: "UMAX DATA SYSTEMS, INC.", + [3]byte{0, 16, 44}: "Lasat Networks A/S", + [3]byte{0, 16, 45}: "HITACHI SOFTWARE ENGINEERING", + [3]byte{0, 16, 46}: "NETWORK SYSTEMS & TECHNOLOGIES PVT. LTD.", + [3]byte{0, 16, 47}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 48}: "EION Inc.", + [3]byte{0, 16, 49}: "OBJECTIVE COMMUNICATIONS, INC.", + [3]byte{0, 16, 50}: "ALTA TECHNOLOGY", + [3]byte{0, 16, 51}: "ACCESSLAN COMMUNICATIONS, INC.", + [3]byte{0, 16, 52}: "GNP Computers", + [3]byte{0, 16, 53}: "ELITEGROUP COMPUTER SYSTEMS CO., LTD", + [3]byte{0, 16, 54}: "INTER-TEL INTEGRATED SYSTEMS", + [3]byte{0, 16, 55}: "CYQ've Technology Co., Ltd.", + [3]byte{0, 16, 56}: "MICRO RESEARCH INSTITUTE, INC.", + [3]byte{0, 16, 57}: "Vectron Systems AG", + [3]byte{0, 16, 58}: "DIAMOND NETWORK TECH", + [3]byte{0, 16, 59}: "HIPPI NETWORKING FORUM", + [3]byte{0, 16, 60}: "IC ENSEMBLE, INC.", + [3]byte{0, 16, 61}: "PHASECOM, LTD.", + [3]byte{0, 16, 62}: "NETSCHOOLS CORPORATION", + [3]byte{0, 16, 63}: "TOLLGRADE COMMUNICATIONS, INC.", + [3]byte{0, 16, 64}: "INTERMEC CORPORATION", + [3]byte{0, 16, 65}: "BRISTOL BABCOCK, INC.", + [3]byte{0, 16, 66}: "Alacritech, Inc.", + [3]byte{0, 16, 67}: "A2 CORPORATION", + [3]byte{0, 16, 68}: "InnoLabs Corporation", + [3]byte{0, 16, 69}: "Nortel Networks", + [3]byte{0, 16, 70}: "ALCORN MCBRIDE INC.", + [3]byte{0, 16, 71}: "ECHO ELETRIC CO. LTD.", + [3]byte{0, 16, 72}: "HTRC AUTOMATION, INC.", + [3]byte{0, 16, 73}: "ShoreTel, Inc", + [3]byte{0, 16, 74}: "The Parvus Corporation", + [3]byte{0, 16, 75}: "3COM CORPORATION", + [3]byte{0, 16, 76}: "Teledyne LeCroy, Inc", + [3]byte{0, 16, 77}: "SURTEC INDUSTRIES, INC.", + [3]byte{0, 16, 78}: "CEOLOGIC", + [3]byte{0, 16, 79}: "Oracle Corporation", + [3]byte{0, 16, 80}: "RION CO., LTD.", + [3]byte{0, 16, 81}: "CMICRO CORPORATION", + [3]byte{0, 16, 82}: "METTLER-TOLEDO (ALBSTADT) GMBH", + [3]byte{0, 16, 83}: "COMPUTER TECHNOLOGY CORP.", + [3]byte{0, 16, 84}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 85}: "FUJITSU MICROELECTRONICS, INC.", + [3]byte{0, 16, 86}: "SODICK CO., LTD.", + [3]byte{0, 16, 87}: "Rebel.com, Inc.", + [3]byte{0, 16, 88}: "ArrowPoint Communications", + [3]byte{0, 16, 89}: "DIABLO RESEARCH CO. LLC", + [3]byte{0, 16, 90}: "3COM CORPORATION", + [3]byte{0, 16, 91}: "NET INSIGHT AB", + [3]byte{0, 16, 92}: "QUANTUM DESIGNS (H.K.) LTD.", + [3]byte{0, 16, 93}: "Draeger Medical", + [3]byte{0, 16, 94}: "Spirent plc, Service Assurance Broadband", + [3]byte{0, 16, 95}: "ZODIAC DATA SYSTEMS", + [3]byte{0, 16, 96}: "BILLIONTON SYSTEMS, INC.", + [3]byte{0, 16, 97}: "HOSTLINK CORP.", + [3]byte{0, 16, 98}: "NX SERVER, ILNC.", + [3]byte{0, 16, 99}: "STARGUIDE DIGITAL NETWORKS", + [3]byte{0, 16, 100}: "DNPG, LLC", + [3]byte{0, 16, 101}: "RADYNE CORPORATION", + [3]byte{0, 16, 102}: "ADVANCED CONTROL SYSTEMS, INC.", + [3]byte{0, 16, 103}: "Ericsson", + [3]byte{0, 16, 104}: "COMOS TELECOM", + [3]byte{0, 16, 105}: "HELIOSS COMMUNICATIONS, INC.", + [3]byte{0, 16, 106}: "DIGITAL MICROWAVE CORPORATION", + [3]byte{0, 16, 107}: "SONUS NETWORKS, INC.", + [3]byte{0, 16, 108}: "EDNT GmbH", + [3]byte{0, 16, 109}: "Axxcelera Broadband Wireless", + [3]byte{0, 16, 110}: "TADIRAN COM. LTD.", + [3]byte{0, 16, 111}: "TRENTON TECHNOLOGY INC.", + [3]byte{0, 16, 112}: "CARADON TREND LTD.", + [3]byte{0, 16, 113}: "ADVANET INC.", + [3]byte{0, 16, 114}: "GVN TECHNOLOGIES, INC.", + [3]byte{0, 16, 115}: "Technobox, Inc.", + [3]byte{0, 16, 116}: "ATEN INTERNATIONAL CO., LTD.", + [3]byte{0, 16, 117}: "Segate Technology LLC", + [3]byte{0, 16, 118}: "EUREM GmbH", + [3]byte{0, 16, 119}: "SAF DRIVE SYSTEMS, LTD.", + [3]byte{0, 16, 120}: "NUERA COMMUNICATIONS, INC.", + [3]byte{0, 16, 121}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 122}: "AmbiCom, Inc.", + [3]byte{0, 16, 123}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 124}: "P-COM, INC.", + [3]byte{0, 16, 125}: "AURORA COMMUNICATIONS, LTD.", + [3]byte{0, 16, 126}: "BACHMANN ELECTRONIC GmbH", + [3]byte{0, 16, 127}: "CRESTRON ELECTRONICS, INC.", + [3]byte{0, 16, 128}: "METAWAVE COMMUNICATIONS", + [3]byte{0, 16, 129}: "DPS, INC.", + [3]byte{0, 16, 130}: "JNA TELECOMMUNICATIONS LIMITED", + [3]byte{0, 16, 131}: "HEWLETT-PACKARD COMPANY", + [3]byte{0, 16, 132}: "K-BOT COMMUNICATIONS", + [3]byte{0, 16, 133}: "POLARIS COMMUNICATIONS, INC.", + [3]byte{0, 16, 134}: "ATTO Technology, Inc.", + [3]byte{0, 16, 135}: "Xstreamis PLC", + [3]byte{0, 16, 136}: "AMERICAN NETWORKS INC.", + [3]byte{0, 16, 137}: "WebSonic", + [3]byte{0, 16, 138}: "TeraLogic, Inc.", + [3]byte{0, 16, 139}: "LASERANIMATION SOLLINGER GmbH", + [3]byte{0, 16, 140}: "FUJITSU TELECOMMUNICATIONS EUROPE, LTD.", + [3]byte{0, 16, 141}: "Johnson Controls, Inc.", + [3]byte{0, 16, 142}: "HUGH SYMONS CONCEPT Technologies Ltd.", + [3]byte{0, 16, 143}: "RAPTOR SYSTEMS", + [3]byte{0, 16, 144}: "CIMETRICS, INC.", + [3]byte{0, 16, 145}: "NO WIRES NEEDED BV", + [3]byte{0, 16, 146}: "NETCORE INC.", + [3]byte{0, 16, 147}: "CMS COMPUTERS, LTD.", + [3]byte{0, 16, 148}: "Performance Analysis Broadband, Spirent plc", + [3]byte{0, 16, 149}: "Thomson Inc.", + [3]byte{0, 16, 150}: "TRACEWELL SYSTEMS, INC.", + [3]byte{0, 16, 151}: "WinNet Metropolitan Communications Systems, Inc.", + [3]byte{0, 16, 152}: "STARNET TECHNOLOGIES, INC.", + [3]byte{0, 16, 153}: "InnoMedia, Inc.", + [3]byte{0, 16, 154}: "NETLINE", + [3]byte{0, 16, 155}: "Emulex Corporation", + [3]byte{0, 16, 156}: "M-SYSTEM CO., LTD.", + [3]byte{0, 16, 157}: "CLARINET SYSTEMS, INC.", + [3]byte{0, 16, 158}: "AWARE, INC.", + [3]byte{0, 16, 159}: "PAVO, INC.", + [3]byte{0, 16, 160}: "INNOVEX TECHNOLOGIES, INC.", + [3]byte{0, 16, 161}: "KENDIN SEMICONDUCTOR, INC.", + [3]byte{0, 16, 162}: "TNS", + [3]byte{0, 16, 163}: "OMNITRONIX, INC.", + [3]byte{0, 16, 164}: "XIRCOM", + [3]byte{0, 16, 165}: "OXFORD INSTRUMENTS", + [3]byte{0, 16, 166}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 167}: "UNEX TECHNOLOGY CORPORATION", + [3]byte{0, 16, 168}: "RELIANCE COMPUTER CORP.", + [3]byte{0, 16, 169}: "ADHOC TECHNOLOGIES", + [3]byte{0, 16, 170}: "MEDIA4, INC.", + [3]byte{0, 16, 171}: "KOITO ELECTRIC INDUSTRIES, LTD.", + [3]byte{0, 16, 172}: "IMCI TECHNOLOGIES", + [3]byte{0, 16, 173}: "SOFTRONICS USB, INC.", + [3]byte{0, 16, 174}: "SHINKO ELECTRIC INDUSTRIES CO.", + [3]byte{0, 16, 175}: "TAC SYSTEMS, INC.", + [3]byte{0, 16, 176}: "MERIDIAN TECHNOLOGY CORP.", + [3]byte{0, 16, 177}: "FOR-A CO., LTD.", + [3]byte{0, 16, 178}: "COACTIVE AESTHETICS", + [3]byte{0, 16, 179}: "NOKIA MULTIMEDIA TERMINALS", + [3]byte{0, 16, 180}: "ATMOSPHERE NETWORKS", + [3]byte{0, 16, 181}: "ACCTON TECHNOLOGY CORPORATION", + [3]byte{0, 16, 182}: "ENTRATA COMMUNICATIONS CORP.", + [3]byte{0, 16, 183}: "COYOTE TECHNOLOGIES, LLC", + [3]byte{0, 16, 184}: "ISHIGAKI COMPUTER SYSTEM CO.", + [3]byte{0, 16, 185}: "MAXTOR CORP.", + [3]byte{0, 16, 186}: "MARTINHO-DAVIS SYSTEMS, INC.", + [3]byte{0, 16, 187}: "DATA & INFORMATION TECHNOLOGY", + [3]byte{0, 16, 188}: "Aastra Telecom", + [3]byte{0, 16, 189}: "THE TELECOMMUNICATION TECHNOLOGY COMMITTEE (TTC)", + [3]byte{0, 16, 190}: "MARCH NETWORKS CORPORATION", + [3]byte{0, 16, 191}: "InterAir Wireless", + [3]byte{0, 16, 192}: "ARMA, Inc.", + [3]byte{0, 16, 193}: "OI ELECTRIC CO., LTD.", + [3]byte{0, 16, 194}: "WILLNET, INC.", + [3]byte{0, 16, 195}: "CSI-CONTROL SYSTEMS", + [3]byte{0, 16, 196}: "MEDIA LINKS CO., LTD.", + [3]byte{0, 16, 197}: "PROTOCOL TECHNOLOGIES, INC.", + [3]byte{0, 16, 198}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{0, 16, 199}: "DATA TRANSMISSION NETWORK", + [3]byte{0, 16, 200}: "COMMUNICATIONS ELECTRONICS SECURITY GROUP", + [3]byte{0, 16, 201}: "MITSUBISHI ELECTRONICS LOGISTIC SUPPORT CO.", + [3]byte{0, 16, 202}: "Telco Systems, Inc.", + [3]byte{0, 16, 203}: "FACIT K.K.", + [3]byte{0, 16, 204}: "CLP COMPUTER LOGISTIK PLANUNG GmbH", + [3]byte{0, 16, 205}: "INTERFACE CONCEPT", + [3]byte{0, 16, 206}: "VOLAMP, LTD.", + [3]byte{0, 16, 207}: "FIBERLANE COMMUNICATIONS", + [3]byte{0, 16, 208}: "WITCOM, LTD.", + [3]byte{0, 16, 209}: "Top Layer Networks, Inc.", + [3]byte{0, 16, 210}: "NITTO TSUSHINKI CO., LTD", + [3]byte{0, 16, 211}: "GRIPS ELECTRONIC GMBH", + [3]byte{0, 16, 212}: "STORAGE COMPUTER CORPORATION", + [3]byte{0, 16, 213}: "IMASDE CANARIAS, S.A.", + [3]byte{0, 16, 214}: "Exelis", + [3]byte{0, 16, 215}: "ARGOSY RESEARCH INC.", + [3]byte{0, 16, 216}: "CALISTA", + [3]byte{0, 16, 217}: "IBM JAPAN, FUJISAWA MT+D", + [3]byte{0, 16, 218}: "Kollmorgen Corp", + [3]byte{0, 16, 219}: "Juniper Networks, Inc.", + [3]byte{0, 16, 220}: "MICRO-STAR INTERNATIONAL CO., LTD.", + [3]byte{0, 16, 221}: "ENABLE SEMICONDUCTOR, INC.", + [3]byte{0, 16, 222}: "INTERNATIONAL DATACASTING CORPORATION", + [3]byte{0, 16, 223}: "RISE COMPUTER INC.", + [3]byte{0, 16, 224}: "Oracle Corporation", + [3]byte{0, 16, 225}: "S.I. TECH, INC.", + [3]byte{0, 16, 226}: "ArrayComm, Inc.", + [3]byte{0, 16, 227}: "Hewlett-Packard Company", + [3]byte{0, 16, 228}: "NSI CORPORATION", + [3]byte{0, 16, 229}: "SOLECTRON TEXAS", + [3]byte{0, 16, 230}: "APPLIED INTELLIGENT SYSTEMS, INC.", + [3]byte{0, 16, 231}: "BreezeCom", + [3]byte{0, 16, 232}: "TELOCITY, INCORPORATED", + [3]byte{0, 16, 233}: "RAIDTEC LTD.", + [3]byte{0, 16, 234}: "ADEPT TECHNOLOGY", + [3]byte{0, 16, 235}: "SELSIUS SYSTEMS, INC.", + [3]byte{0, 16, 236}: "RPCG, LLC", + [3]byte{0, 16, 237}: "SUNDANCE TECHNOLOGY, INC.", + [3]byte{0, 16, 238}: "CTI PRODUCTS, INC.", + [3]byte{0, 16, 239}: "DBTEL INCORPORATED", + [3]byte{0, 16, 240}: "RITTAL-WERK RUDOLF LOH GmbH & Co.", + [3]byte{0, 16, 241}: "I-O CORPORATION", + [3]byte{0, 16, 242}: "ANTEC", + [3]byte{0, 16, 243}: "Nexcom International Co., Ltd.", + [3]byte{0, 16, 244}: "Vertical Communications", + [3]byte{0, 16, 245}: "AMHERST SYSTEMS, INC.", + [3]byte{0, 16, 246}: "CISCO SYSTEMS, INC.", + [3]byte{0, 16, 247}: "IRIICHI TECHNOLOGIES Inc.", + [3]byte{0, 16, 248}: "TEXIO TECHNOLOGY CORPORATION", + [3]byte{0, 16, 249}: "UNIQUE SYSTEMS, INC.", + [3]byte{0, 16, 250}: "Apple", + [3]byte{0, 16, 251}: "ZIDA TECHNOLOGIES LIMITED", + [3]byte{0, 16, 252}: "BROADBAND NETWORKS, INC.", + [3]byte{0, 16, 253}: "COCOM A/S", + [3]byte{0, 16, 254}: "DIGITAL EQUIPMENT CORPORATION", + [3]byte{0, 16, 255}: "CISCO SYSTEMS, INC.", + [3]byte{0, 17, 0}: "Schneider Electric", + [3]byte{0, 17, 1}: "CET Technologies Pte Ltd", + [3]byte{0, 17, 2}: "Aurora Multimedia Corp.", + [3]byte{0, 17, 3}: "kawamura electric inc.", + [3]byte{0, 17, 4}: "TELEXY", + [3]byte{0, 17, 5}: "Sunplus Technology Co., Ltd.", + [3]byte{0, 17, 6}: "Siemens NV (Belgium)", + [3]byte{0, 17, 7}: "RGB Networks Inc.", + [3]byte{0, 17, 8}: "Orbital Data Corporation", + [3]byte{0, 17, 9}: "Micro-Star International", + [3]byte{0, 17, 10}: "Hewlett-Packard Company", + [3]byte{0, 17, 11}: "Franklin Technology Systems", + [3]byte{0, 17, 12}: "Atmark Techno, Inc.", + [3]byte{0, 17, 13}: "SANBlaze Technology, Inc.", + [3]byte{0, 17, 14}: "Tsurusaki Sealand Transportation Co. Ltd.", + [3]byte{0, 17, 15}: "netplat,Inc.", + [3]byte{0, 17, 16}: "Maxanna Technology Co., Ltd.", + [3]byte{0, 17, 17}: "Intel Corporation", + [3]byte{0, 17, 18}: "Honeywell CMSS", + [3]byte{0, 17, 19}: "Fraunhofer FOKUS", + [3]byte{0, 17, 20}: "EverFocus Electronics Corp.", + [3]byte{0, 17, 21}: "EPIN Technologies, Inc.", + [3]byte{0, 17, 22}: "COTEAU VERT CO., LTD.", + [3]byte{0, 17, 23}: "CESNET", + [3]byte{0, 17, 24}: "BLX IC Design Corp., Ltd.", + [3]byte{0, 17, 25}: "Solteras, Inc.", + [3]byte{0, 17, 26}: "ARRIS Group, Inc.", + [3]byte{0, 17, 27}: "Targa Systems Div L-3 Communications Canada", + [3]byte{0, 17, 28}: "Pleora Technologies Inc.", + [3]byte{0, 17, 29}: "Hectrix Limited", + [3]byte{0, 17, 30}: "EPSG (Ethernet Powerlink Standardization Group)", + [3]byte{0, 17, 31}: "Doremi Labs, Inc.", + [3]byte{0, 17, 32}: "CISCO SYSTEMS, INC.", + [3]byte{0, 17, 33}: "CISCO SYSTEMS, INC.", + [3]byte{0, 17, 34}: "CIMSYS Inc", + [3]byte{0, 17, 35}: "Appointech, Inc.", + [3]byte{0, 17, 36}: "Apple", + [3]byte{0, 17, 37}: "IBM Corp", + [3]byte{0, 17, 38}: "Venstar Inc.", + [3]byte{0, 17, 39}: "TASI, Inc", + [3]byte{0, 17, 40}: "Streamit", + [3]byte{0, 17, 41}: "Paradise Datacom Ltd.", + [3]byte{0, 17, 42}: "Niko NV", + [3]byte{0, 17, 43}: "NetModule AG", + [3]byte{0, 17, 44}: "IZT GmbH", + [3]byte{0, 17, 45}: "iPulse Systems", + [3]byte{0, 17, 46}: "CEICOM", + [3]byte{0, 17, 47}: "ASUSTek Computer Inc.", + [3]byte{0, 17, 48}: "Allied Telesis (Hong Kong) Ltd.", + [3]byte{0, 17, 49}: "UNATECH. CO.,LTD", + [3]byte{0, 17, 50}: "Synology Incorporated", + [3]byte{0, 17, 51}: "Siemens Austria SIMEA", + [3]byte{0, 17, 52}: "MediaCell, Inc.", + [3]byte{0, 17, 53}: "Grandeye Ltd", + [3]byte{0, 17, 54}: "Goodrich Sensor Systems", + [3]byte{0, 17, 55}: "AICHI ELECTRIC CO., LTD.", + [3]byte{0, 17, 56}: "TAISHIN CO., LTD.", + [3]byte{0, 17, 57}: "STOEBER ANTRIEBSTECHNIK GmbH + Co. KG.", + [3]byte{0, 17, 58}: "SHINBORAM", + [3]byte{0, 17, 59}: "Micronet Communications Inc.", + [3]byte{0, 17, 60}: "Micronas GmbH", + [3]byte{0, 17, 61}: "KN SOLTEC CO.,LTD.", + [3]byte{0, 17, 62}: "JL Corporation", + [3]byte{0, 17, 63}: "Alcatel DI", + [3]byte{0, 17, 64}: "Nanometrics Inc.", + [3]byte{0, 17, 65}: "GoodMan Corporation", + [3]byte{0, 17, 66}: "e-SMARTCOM INC.", + [3]byte{0, 17, 67}: "Dell Inc", + [3]byte{0, 17, 68}: "Assurance Technology Corp", + [3]byte{0, 17, 69}: "ValuePoint Networks", + [3]byte{0, 17, 70}: "Telecard-Pribor Ltd", + [3]byte{0, 17, 71}: "Secom-Industry co.LTD.", + [3]byte{0, 17, 72}: "Prolon Control Systems", + [3]byte{0, 17, 73}: "Proliphix Inc.", + [3]byte{0, 17, 74}: "KAYABA INDUSTRY Co,.Ltd.", + [3]byte{0, 17, 75}: "Francotyp-Postalia GmbH", + [3]byte{0, 17, 76}: "caffeina applied research ltd.", + [3]byte{0, 17, 77}: "Atsumi Electric Co.,LTD.", + [3]byte{0, 17, 78}: "690885 Ontario Inc.", + [3]byte{0, 17, 79}: "US Digital Television, Inc", + [3]byte{0, 17, 80}: "Belkin Corporation", + [3]byte{0, 17, 81}: "Mykotronx", + [3]byte{0, 17, 82}: "Eidsvoll Electronics AS", + [3]byte{0, 17, 83}: "Trident Tek, Inc.", + [3]byte{0, 17, 84}: "Webpro Technologies Inc.", + [3]byte{0, 17, 85}: "Sevis Systems", + [3]byte{0, 17, 86}: "Pharos Systems NZ", + [3]byte{0, 17, 87}: "OF Networks Co., Ltd.", + [3]byte{0, 17, 88}: "Nortel Networks", + [3]byte{0, 17, 89}: "MATISSE NETWORKS INC", + [3]byte{0, 17, 90}: "Ivoclar Vivadent AG", + [3]byte{0, 17, 91}: "Elitegroup Computer System Co. (ECS)", + [3]byte{0, 17, 92}: "CISCO SYSTEMS, INC.", + [3]byte{0, 17, 93}: "CISCO SYSTEMS, INC.", + [3]byte{0, 17, 94}: "ProMinent Dosiertechnik GmbH", + [3]byte{0, 17, 95}: "ITX Security Co., Ltd.", + [3]byte{0, 17, 96}: "ARTDIO Company Co., LTD", + [3]byte{0, 17, 97}: "NetStreams, LLC", + [3]byte{0, 17, 98}: "STAR MICRONICS CO.,LTD.", + [3]byte{0, 17, 99}: "SYSTEM SPA DEPT. ELECTRONICS", + [3]byte{0, 17, 100}: "ACARD Technology Corp.", + [3]byte{0, 17, 101}: "Znyx Networks", + [3]byte{0, 17, 102}: "Taelim Electronics Co., Ltd.", + [3]byte{0, 17, 103}: "Integrated System Solution Corp.", + [3]byte{0, 17, 104}: "HomeLogic LLC", + [3]byte{0, 17, 105}: "EMS Satcom", + [3]byte{0, 17, 106}: "Domo Ltd", + [3]byte{0, 17, 107}: "Digital Data Communications Asia Co.,Ltd", + [3]byte{0, 17, 108}: "Nanwang Multimedia Inc.,Ltd", + [3]byte{0, 17, 109}: "American Time and Signal", + [3]byte{0, 17, 110}: "PePLink Ltd.", + [3]byte{0, 17, 111}: "Netforyou Co., LTD.", + [3]byte{0, 17, 112}: "GSC SRL", + [3]byte{0, 17, 113}: "DEXTER Communications, Inc.", + [3]byte{0, 17, 114}: "COTRON CORPORATION", + [3]byte{0, 17, 115}: "SMART Storage Systems", + [3]byte{0, 17, 116}: "Wibhu Technologies, Inc.", + [3]byte{0, 17, 117}: "PathScale, Inc.", + [3]byte{0, 17, 118}: "Intellambda Systems, Inc.", + [3]byte{0, 17, 119}: "Coaxial Networks, Inc.", + [3]byte{0, 17, 120}: "Chiron Technology Ltd", + [3]byte{0, 17, 121}: "Singular Technology Co. Ltd.", + [3]byte{0, 17, 122}: "Singim International Corp.", + [3]byte{0, 17, 123}: "Büchi Labortechnik AG", + [3]byte{0, 17, 124}: "e-zy.net", + [3]byte{0, 17, 125}: "ZMD America, Inc.", + [3]byte{0, 17, 126}: "Progeny, A division of Midmark Corp", + [3]byte{0, 17, 127}: "Neotune Information Technology Corporation,.LTD", + [3]byte{0, 17, 128}: "ARRIS Group, Inc.", + [3]byte{0, 17, 129}: "InterEnergy Co.Ltd,", + [3]byte{0, 17, 130}: "IMI Norgren Ltd", + [3]byte{0, 17, 131}: "Datalogic ADC, Inc.", + [3]byte{0, 17, 132}: "Humo Laboratory,Ltd.", + [3]byte{0, 17, 133}: "Hewlett-Packard Company", + [3]byte{0, 17, 134}: "Prime Systems, Inc.", + [3]byte{0, 17, 135}: "Category Solutions, Inc", + [3]byte{0, 17, 136}: "Enterasys", + [3]byte{0, 17, 137}: "Aerotech Inc", + [3]byte{0, 17, 138}: "Viewtran Technology Limited", + [3]byte{0, 17, 139}: "Alcatel-Lucent, Enterprise Business Group", + [3]byte{0, 17, 140}: "Missouri Department of Transportation", + [3]byte{0, 17, 141}: "Hanchang System Corp.", + [3]byte{0, 17, 142}: "Halytech Mace", + [3]byte{0, 17, 143}: "EUTECH INSTRUMENTS PTE. LTD.", + [3]byte{0, 17, 144}: "Digital Design Corporation", + [3]byte{0, 17, 145}: "CTS-Clima Temperatur Systeme GmbH", + [3]byte{0, 17, 146}: "CISCO SYSTEMS, INC.", + [3]byte{0, 17, 147}: "CISCO SYSTEMS, INC.", + [3]byte{0, 17, 148}: "Chi Mei Communication Systems, Inc.", + [3]byte{0, 17, 149}: "D-Link Corporation", + [3]byte{0, 17, 150}: "Actuality Systems, Inc.", + [3]byte{0, 17, 151}: "Monitoring Technologies Limited", + [3]byte{0, 17, 152}: "Prism Media Products Limited", + [3]byte{0, 17, 153}: "2wcom Systems GmbH", + [3]byte{0, 17, 154}: "Alkeria srl", + [3]byte{0, 17, 155}: "Telesynergy Research Inc.", + [3]byte{0, 17, 156}: "EP&T Energy", + [3]byte{0, 17, 157}: "Diginfo Technology Corporation", + [3]byte{0, 17, 158}: "Solectron Brazil", + [3]byte{0, 17, 159}: "Nokia Danmark A/S", + [3]byte{0, 17, 160}: "Vtech Engineering Canada Ltd", + [3]byte{0, 17, 161}: "VISION NETWARE CO.,LTD", + [3]byte{0, 17, 162}: "Manufacturing Technology Inc", + [3]byte{0, 17, 163}: "LanReady Technologies Inc.", + [3]byte{0, 17, 164}: "JStream Technologies Inc.", + [3]byte{0, 17, 165}: "Fortuna Electronic Corp.", + [3]byte{0, 17, 166}: "Sypixx Networks", + [3]byte{0, 17, 167}: "Infilco Degremont Inc.", + [3]byte{0, 17, 168}: "Quest Technologies", + [3]byte{0, 17, 169}: "MOIMSTONE Co., LTD", + [3]byte{0, 17, 170}: "Uniclass Technology, Co., LTD", + [3]byte{0, 17, 171}: "TRUSTABLE TECHNOLOGY CO.,LTD.", + [3]byte{0, 17, 172}: "Simtec Electronics", + [3]byte{0, 17, 173}: "Shanghai Ruijie Technology", + [3]byte{0, 17, 174}: "ARRIS Group, Inc.", + [3]byte{0, 17, 175}: "Medialink-i,Inc", + [3]byte{0, 17, 176}: "Fortelink Inc.", + [3]byte{0, 17, 177}: "BlueExpert Technology Corp.", + [3]byte{0, 17, 178}: "2001 Technology Inc.", + [3]byte{0, 17, 179}: "YOSHIMIYA CO.,LTD.", + [3]byte{0, 17, 180}: "Westermo Teleindustri AB", + [3]byte{0, 17, 181}: "Shenzhen Powercom Co.,Ltd", + [3]byte{0, 17, 182}: "Open Systems International", + [3]byte{0, 17, 183}: "Octalix B.V.", + [3]byte{0, 17, 184}: "Liebherr - Elektronik GmbH", + [3]byte{0, 17, 185}: "Inner Range Pty. Ltd.", + [3]byte{0, 17, 186}: "Elexol Pty Ltd", + [3]byte{0, 17, 187}: "CISCO SYSTEMS, INC.", + [3]byte{0, 17, 188}: "CISCO SYSTEMS, INC.", + [3]byte{0, 17, 189}: "Bombardier Transportation", + [3]byte{0, 17, 190}: "AGP Telecom Co. Ltd", + [3]byte{0, 17, 191}: "AESYS S.p.A.", + [3]byte{0, 17, 192}: "Aday Technology Inc", + [3]byte{0, 17, 193}: "4P MOBILE DATA PROCESSING", + [3]byte{0, 17, 194}: "United Fiber Optic Communication", + [3]byte{0, 17, 195}: "Transceiving System Technology Corporation", + [3]byte{0, 17, 196}: "Terminales de Telecomunicacion Terrestre, S.L.", + [3]byte{0, 17, 197}: "TEN Technology", + [3]byte{0, 17, 198}: "Seagate Technology", + [3]byte{0, 17, 199}: "Raymarine UK Ltd", + [3]byte{0, 17, 200}: "Powercom Co., Ltd.", + [3]byte{0, 17, 201}: "MTT Corporation", + [3]byte{0, 17, 202}: "Long Range Systems, Inc.", + [3]byte{0, 17, 203}: "Jacobsons AB", + [3]byte{0, 17, 204}: "Guangzhou Jinpeng Group Co.,Ltd.", + [3]byte{0, 17, 205}: "Axsun Technologies", + [3]byte{0, 17, 206}: "Ubisense Limited", + [3]byte{0, 17, 207}: "Thrane & Thrane A/S", + [3]byte{0, 17, 208}: "Tandberg Data ASA", + [3]byte{0, 17, 209}: "Soft Imaging System GmbH", + [3]byte{0, 17, 210}: "Perception Digital Ltd", + [3]byte{0, 17, 211}: "NextGenTel Holding ASA", + [3]byte{0, 17, 212}: "NetEnrich, Inc", + [3]byte{0, 17, 213}: "Hangzhou Sunyard System Engineering Co.,Ltd.", + [3]byte{0, 17, 214}: "HandEra, Inc.", + [3]byte{0, 17, 215}: "eWerks Inc", + [3]byte{0, 17, 216}: "ASUSTek Computer Inc.", + [3]byte{0, 17, 217}: "TiVo", + [3]byte{0, 17, 218}: "Vivaas Technology Inc.", + [3]byte{0, 17, 219}: "Land-Cellular Corporation", + [3]byte{0, 17, 220}: "Glunz & Jensen", + [3]byte{0, 17, 221}: "FROMUS TEC. Co., Ltd.", + [3]byte{0, 17, 222}: "EURILOGIC", + [3]byte{0, 17, 223}: "Current Energy", + [3]byte{0, 17, 224}: "U-MEDIA Communications, Inc.", + [3]byte{0, 17, 225}: "Arcelik A.S", + [3]byte{0, 17, 226}: "Hua Jung Components Co., Ltd.", + [3]byte{0, 17, 227}: "Thomson, Inc.", + [3]byte{0, 17, 228}: "Danelec Electronics A/S", + [3]byte{0, 17, 229}: "KCodes Corporation", + [3]byte{0, 17, 230}: "Scientific Atlanta", + [3]byte{0, 17, 231}: "WORLDSAT - Texas de France", + [3]byte{0, 17, 232}: "Tixi.Com", + [3]byte{0, 17, 233}: "STARNEX CO., LTD.", + [3]byte{0, 17, 234}: "IWICS Inc.", + [3]byte{0, 17, 235}: "Innovative Integration", + [3]byte{0, 17, 236}: "AVIX INC.", + [3]byte{0, 17, 237}: "802 Global", + [3]byte{0, 17, 238}: "Estari, Inc.", + [3]byte{0, 17, 239}: "Conitec Datensysteme GmbH", + [3]byte{0, 17, 240}: "Wideful Limited", + [3]byte{0, 17, 241}: "QinetiQ Ltd", + [3]byte{0, 17, 242}: "Institute of Network Technologies", + [3]byte{0, 17, 243}: "NeoMedia Europe AG", + [3]byte{0, 17, 244}: "woori-net", + [3]byte{0, 17, 245}: "ASKEY COMPUTER CORP.", + [3]byte{0, 17, 246}: "Asia Pacific Microsystems , Inc.", + [3]byte{0, 17, 247}: "Shenzhen Forward Industry Co., Ltd", + [3]byte{0, 17, 248}: "AIRAYA Corp", + [3]byte{0, 17, 249}: "Nortel Networks", + [3]byte{0, 17, 250}: "Rane Corporation", + [3]byte{0, 17, 251}: "Heidelberg Engineering GmbH", + [3]byte{0, 17, 252}: "HARTING Electric Gmbh & Co.KG", + [3]byte{0, 17, 253}: "KORG INC.", + [3]byte{0, 17, 254}: "Keiyo System Research, Inc.", + [3]byte{0, 17, 255}: "Digitro Tecnologia Ltda", + [3]byte{0, 18, 0}: "CISCO SYSTEMS, INC.", + [3]byte{0, 18, 1}: "CISCO SYSTEMS, INC.", + [3]byte{0, 18, 2}: "Decrane Aerospace - Audio International Inc.", + [3]byte{0, 18, 3}: "ActivNetworks", + [3]byte{0, 18, 4}: "u10 Networks, Inc.", + [3]byte{0, 18, 5}: "Terrasat Communications, Inc.", + [3]byte{0, 18, 6}: "iQuest (NZ) Ltd", + [3]byte{0, 18, 7}: "Head Strong International Limited", + [3]byte{0, 18, 8}: "Gantner Instruments GmbH", + [3]byte{0, 18, 9}: "Fastrax Ltd", + [3]byte{0, 18, 10}: "Emerson Climate Technologies GmbH", + [3]byte{0, 18, 11}: "Chinasys Technologies Limited", + [3]byte{0, 18, 12}: "CE-Infosys Pte Ltd", + [3]byte{0, 18, 13}: "Advanced Telecommunication Technologies, Inc.", + [3]byte{0, 18, 14}: "AboCom", + [3]byte{0, 18, 15}: "IEEE 802.3", + [3]byte{0, 18, 16}: "WideRay Corp", + [3]byte{0, 18, 17}: "Protechna Herbst GmbH & Co. KG", + [3]byte{0, 18, 18}: "PLUS Corporation", + [3]byte{0, 18, 19}: "Metrohm AG", + [3]byte{0, 18, 20}: "Koenig & Bauer AG", + [3]byte{0, 18, 21}: "iStor Networks, Inc.", + [3]byte{0, 18, 22}: "ICP Internet Communication Payment AG", + [3]byte{0, 18, 23}: "Cisco-Linksys, LLC", + [3]byte{0, 18, 24}: "ARUZE Corporation", + [3]byte{0, 18, 25}: "Ahead Communication Systems Inc", + [3]byte{0, 18, 26}: "Techno Soft Systemnics Inc.", + [3]byte{0, 18, 27}: "Sound Devices, LLC", + [3]byte{0, 18, 28}: "PARROT S.A.", + [3]byte{0, 18, 29}: "Netfabric Corporation", + [3]byte{0, 18, 30}: "Juniper Networks, Inc.", + [3]byte{0, 18, 31}: "Harding Instruments", + [3]byte{0, 18, 32}: "Cadco Systems", + [3]byte{0, 18, 33}: "B.Braun Melsungen AG", + [3]byte{0, 18, 34}: "Skardin (UK) Ltd", + [3]byte{0, 18, 35}: "Pixim", + [3]byte{0, 18, 36}: "NexQL Corporation", + [3]byte{0, 18, 37}: "ARRIS Group, Inc.", + [3]byte{0, 18, 38}: "Japan Direx Corporation", + [3]byte{0, 18, 39}: "Franklin Electric Co., Inc.", + [3]byte{0, 18, 40}: "Data Ltd.", + [3]byte{0, 18, 41}: "BroadEasy Technologies Co.,Ltd", + [3]byte{0, 18, 42}: "VTech Telecommunications Ltd.", + [3]byte{0, 18, 43}: "Virbiage Pty Ltd", + [3]byte{0, 18, 44}: "Soenen Controls N.V.", + [3]byte{0, 18, 45}: "SiNett Corporation", + [3]byte{0, 18, 46}: "Signal Technology - AISD", + [3]byte{0, 18, 47}: "Sanei Electric Inc.", + [3]byte{0, 18, 48}: "Picaso Infocommunication CO., LTD.", + [3]byte{0, 18, 49}: "Motion Control Systems, Inc.", + [3]byte{0, 18, 50}: "LeWiz Communications Inc.", + [3]byte{0, 18, 51}: "JRC TOKKI Co.,Ltd.", + [3]byte{0, 18, 52}: "Camille Bauer", + [3]byte{0, 18, 53}: "Andrew Corporation", + [3]byte{0, 18, 54}: "ConSentry Networks", + [3]byte{0, 18, 55}: "Texas Instruments", + [3]byte{0, 18, 56}: "SetaBox Technology Co., Ltd.", + [3]byte{0, 18, 57}: "S Net Systems Inc.", + [3]byte{0, 18, 58}: "Posystech Inc., Co.", + [3]byte{0, 18, 59}: "KeRo Systems ApS", + [3]byte{0, 18, 60}: "Second Rule LLC", + [3]byte{0, 18, 61}: "GES", + [3]byte{0, 18, 62}: "ERUNE technology Co., Ltd.", + [3]byte{0, 18, 63}: "Dell Inc", + [3]byte{0, 18, 64}: "AMOI ELECTRONICS CO.,LTD", + [3]byte{0, 18, 65}: "a2i marketing center", + [3]byte{0, 18, 66}: "Millennial Net", + [3]byte{0, 18, 67}: "CISCO SYSTEMS, INC.", + [3]byte{0, 18, 68}: "CISCO SYSTEMS, INC.", + [3]byte{0, 18, 69}: "Zellweger Analytics, Inc.", + [3]byte{0, 18, 70}: "T.O.M TECHNOLOGY INC..", + [3]byte{0, 18, 71}: "Samsung Electronics Co., Ltd.", + [3]byte{0, 18, 72}: "EMC Corporation (Kashya)", + [3]byte{0, 18, 73}: "Delta Elettronica S.p.A.", + [3]byte{0, 18, 74}: "Dedicated Devices, Inc.", + [3]byte{0, 18, 75}: "Texas Instruments", + [3]byte{0, 18, 76}: "BBWM Corporation", + [3]byte{0, 18, 77}: "Inducon BV", + [3]byte{0, 18, 78}: "XAC AUTOMATION CORP.", + [3]byte{0, 18, 79}: "Pentair Thermal Management", + [3]byte{0, 18, 80}: "Tokyo Aircaft Instrument Co., Ltd.", + [3]byte{0, 18, 81}: "SILINK", + [3]byte{0, 18, 82}: "Citronix, LLC", + [3]byte{0, 18, 83}: "AudioDev AB", + [3]byte{0, 18, 84}: "Spectra Technologies Holdings Company Ltd", + [3]byte{0, 18, 85}: "NetEffect Incorporated", + [3]byte{0, 18, 86}: "LG INFORMATION & COMM.", + [3]byte{0, 18, 87}: "LeapComm Communication Technologies Inc.", + [3]byte{0, 18, 88}: "Activis Polska", + [3]byte{0, 18, 89}: "THERMO ELECTRON KARLSRUHE", + [3]byte{0, 18, 90}: "Microsoft Corporation", + [3]byte{0, 18, 91}: "KAIMEI ELECTRONI", + [3]byte{0, 18, 92}: "Green Hills Software, Inc.", + [3]byte{0, 18, 93}: "CyberNet Inc.", + [3]byte{0, 18, 94}: "CAEN", + [3]byte{0, 18, 95}: "AWIND Inc.", + [3]byte{0, 18, 96}: "Stanton Magnetics,inc.", + [3]byte{0, 18, 97}: "Adaptix, Inc", + [3]byte{0, 18, 98}: "Nokia Danmark A/S", + [3]byte{0, 18, 99}: "Data Voice Technologies GmbH", + [3]byte{0, 18, 100}: "daum electronic gmbh", + [3]byte{0, 18, 101}: "Enerdyne Technologies, Inc.", + [3]byte{0, 18, 102}: "Swisscom Hospitality Services SA", + [3]byte{0, 18, 103}: "Panasonic Corporation", + [3]byte{0, 18, 104}: "IPS d.o.o.", + [3]byte{0, 18, 105}: "Value Electronics", + [3]byte{0, 18, 106}: "OPTOELECTRONICS Co., Ltd.", + [3]byte{0, 18, 107}: "Ascalade Communications Limited", + [3]byte{0, 18, 108}: "Visonic Ltd.", + [3]byte{0, 18, 109}: "University of California, Berkeley", + [3]byte{0, 18, 110}: "Seidel Elektronik GmbH Nfg.KG", + [3]byte{0, 18, 111}: "Rayson Technology Co., Ltd.", + [3]byte{0, 18, 112}: "NGES Denro Systems", + [3]byte{0, 18, 113}: "Measurement Computing Corp", + [3]byte{0, 18, 114}: "Redux Communications Ltd.", + [3]byte{0, 18, 115}: "Stoke Inc", + [3]byte{0, 18, 116}: "NIT lab", + [3]byte{0, 18, 117}: "Sentilla Corporation", + [3]byte{0, 18, 118}: "CG Power Systems Ireland Limited", + [3]byte{0, 18, 119}: "Korenix Technologies Co., Ltd.", + [3]byte{0, 18, 120}: "International Bar Code", + [3]byte{0, 18, 121}: "Hewlett-Packard Company", + [3]byte{0, 18, 122}: "Sanyu Industry Co.,Ltd.", + [3]byte{0, 18, 123}: "VIA Networking Technologies, Inc.", + [3]byte{0, 18, 124}: "SWEGON AB", + [3]byte{0, 18, 125}: "MobileAria", + [3]byte{0, 18, 126}: "Digital Lifestyles Group, Inc.", + [3]byte{0, 18, 127}: "CISCO SYSTEMS, INC.", + [3]byte{0, 18, 128}: "CISCO SYSTEMS, INC.", + [3]byte{0, 18, 129}: "March Networks S.p.A.", + [3]byte{0, 18, 130}: "Qovia", + [3]byte{0, 18, 131}: "Nortel Networks", + [3]byte{0, 18, 132}: "Lab33 Srl", + [3]byte{0, 18, 133}: "Gizmondo Europe Ltd", + [3]byte{0, 18, 134}: "ENDEVCO CORP", + [3]byte{0, 18, 135}: "Digital Everywhere Unterhaltungselektronik GmbH", + [3]byte{0, 18, 136}: "2Wire, Inc", + [3]byte{0, 18, 137}: "Advance Sterilization Products", + [3]byte{0, 18, 138}: "ARRIS Group, Inc.", + [3]byte{0, 18, 139}: "Sensory Networks Inc", + [3]byte{0, 18, 140}: "Woodward Governor", + [3]byte{0, 18, 141}: "STB Datenservice GmbH", + [3]byte{0, 18, 142}: "Q-Free ASA", + [3]byte{0, 18, 143}: "Montilio", + [3]byte{0, 18, 144}: "KYOWA Electric & Machinery Corp.", + [3]byte{0, 18, 145}: "KWS Computersysteme GmbH", + [3]byte{0, 18, 146}: "Griffin Technology", + [3]byte{0, 18, 147}: "GE Energy", + [3]byte{0, 18, 148}: "SUMITOMO ELECTRIC DEVICE INNOVATIONS, INC", + [3]byte{0, 18, 149}: "Aiware Inc.", + [3]byte{0, 18, 150}: "Addlogix", + [3]byte{0, 18, 151}: "O2Micro, Inc.", + [3]byte{0, 18, 152}: "MICO ELECTRIC(SHENZHEN) LIMITED", + [3]byte{0, 18, 153}: "Ktech Telecommunications Inc", + [3]byte{0, 18, 154}: "IRT Electronics Pty Ltd", + [3]byte{0, 18, 155}: "E2S Electronic Engineering Solutions, S.L.", + [3]byte{0, 18, 156}: "Yulinet", + [3]byte{0, 18, 157}: "First International Computer do Brasil", + [3]byte{0, 18, 158}: "Surf Communications Inc.", + [3]byte{0, 18, 159}: "RAE Systems", + [3]byte{0, 18, 160}: "NeoMeridian Sdn Bhd", + [3]byte{0, 18, 161}: "BluePacket Communications Co., Ltd.", + [3]byte{0, 18, 162}: "VITA", + [3]byte{0, 18, 163}: "Trust International B.V.", + [3]byte{0, 18, 164}: "ThingMagic, LLC", + [3]byte{0, 18, 165}: "Stargen, Inc.", + [3]byte{0, 18, 166}: "Dolby Australia", + [3]byte{0, 18, 167}: "ISR TECHNOLOGIES Inc", + [3]byte{0, 18, 168}: "intec GmbH", + [3]byte{0, 18, 169}: "3Com Ltd", + [3]byte{0, 18, 170}: "IEE, Inc.", + [3]byte{0, 18, 171}: "WiLife, Inc.", + [3]byte{0, 18, 172}: "ONTIMETEK INC.", + [3]byte{0, 18, 173}: "IDS GmbH", + [3]byte{0, 18, 174}: "HLS HARD-LINE Solutions Inc.", + [3]byte{0, 18, 175}: "ELPRO Technologies", + [3]byte{0, 18, 176}: "Efore Oyj (Plc)", + [3]byte{0, 18, 177}: "Dai Nippon Printing Co., Ltd", + [3]byte{0, 18, 178}: "AVOLITES LTD.", + [3]byte{0, 18, 179}: "Advance Wireless Technology Corp.", + [3]byte{0, 18, 180}: "Work Microwave GmbH", + [3]byte{0, 18, 181}: "Vialta, Inc.", + [3]byte{0, 18, 182}: "Santa Barbara Infrared, Inc.", + [3]byte{0, 18, 183}: "PTW Freiburg", + [3]byte{0, 18, 184}: "G2 Microsystems", + [3]byte{0, 18, 185}: "Fusion Digital Technology", + [3]byte{0, 18, 186}: "FSI Systems, Inc.", + [3]byte{0, 18, 187}: "Telecommunications Industry Association TR-41 Committee", + [3]byte{0, 18, 188}: "Echolab LLC", + [3]byte{0, 18, 189}: "Avantec Manufacturing Limited", + [3]byte{0, 18, 190}: "Astek Corporation", + [3]byte{0, 18, 191}: "Arcadyan Technology Corporation", + [3]byte{0, 18, 192}: "HotLava Systems, Inc.", + [3]byte{0, 18, 193}: "Check Point Software Technologies", + [3]byte{0, 18, 194}: "Apex Electronics Factory", + [3]byte{0, 18, 195}: "WIT S.A.", + [3]byte{0, 18, 196}: "Viseon, Inc.", + [3]byte{0, 18, 197}: "V-Show Technology (China) Co.,Ltd", + [3]byte{0, 18, 198}: "TGC America, Inc", + [3]byte{0, 18, 199}: "SECURAY Technologies Ltd.Co.", + [3]byte{0, 18, 200}: "Perfect tech", + [3]byte{0, 18, 201}: "ARRIS Group, Inc.", + [3]byte{0, 18, 202}: "Mechatronic Brick Aps", + [3]byte{0, 18, 203}: "CSS Inc.", + [3]byte{0, 18, 204}: "Bitatek CO., LTD", + [3]byte{0, 18, 205}: "ASEM SpA", + [3]byte{0, 18, 206}: "Advanced Cybernetics Group", + [3]byte{0, 18, 207}: "Accton Technology Corporation", + [3]byte{0, 18, 208}: "Gossen-Metrawatt-GmbH", + [3]byte{0, 18, 209}: "Texas Instruments Inc", + [3]byte{0, 18, 210}: "Texas Instruments", + [3]byte{0, 18, 211}: "Zetta Systems, Inc.", + [3]byte{0, 18, 212}: "Princeton Technology, Ltd", + [3]byte{0, 18, 213}: "Motion Reality Inc.", + [3]byte{0, 18, 214}: "Jiangsu Yitong High-Tech Co.,Ltd", + [3]byte{0, 18, 215}: "Invento Networks, Inc.", + [3]byte{0, 18, 216}: "International Games System Co., Ltd.", + [3]byte{0, 18, 217}: "CISCO SYSTEMS, INC.", + [3]byte{0, 18, 218}: "CISCO SYSTEMS, INC.", + [3]byte{0, 18, 219}: "ZIEHL industrie-elektronik GmbH + Co KG", + [3]byte{0, 18, 220}: "SunCorp Industrial Limited", + [3]byte{0, 18, 221}: "Shengqu Information Technology (Shanghai) Co., Ltd.", + [3]byte{0, 18, 222}: "Radio Components Sweden AB", + [3]byte{0, 18, 223}: "Novomatic AG", + [3]byte{0, 18, 224}: "Codan Limited", + [3]byte{0, 18, 225}: "Alliant Networks, Inc", + [3]byte{0, 18, 226}: "ALAXALA Networks Corporation", + [3]byte{0, 18, 227}: "Agat-RT, Ltd.", + [3]byte{0, 18, 228}: "ZIEHL industrie-electronik GmbH + Co KG", + [3]byte{0, 18, 229}: "Time America, Inc.", + [3]byte{0, 18, 230}: "SPECTEC COMPUTER CO., LTD.", + [3]byte{0, 18, 231}: "Projectek Networking Electronics Corp.", + [3]byte{0, 18, 232}: "Fraunhofer IMS", + [3]byte{0, 18, 233}: "Abbey Systems Ltd", + [3]byte{0, 18, 234}: "Trane", + [3]byte{0, 18, 235}: "PDH Solutions, LLC", + [3]byte{0, 18, 236}: "Movacolor b.v.", + [3]byte{0, 18, 237}: "AVG Advanced Technologies", + [3]byte{0, 18, 238}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 18, 239}: "OneAccess SA", + [3]byte{0, 18, 240}: "Intel Corporate", + [3]byte{0, 18, 241}: "IFOTEC", + [3]byte{0, 18, 242}: "Brocade Communications Systems, Inc", + [3]byte{0, 18, 243}: "connectBlue AB", + [3]byte{0, 18, 244}: "Belco International Co.,Ltd.", + [3]byte{0, 18, 245}: "Imarda New Zealand Limited", + [3]byte{0, 18, 246}: "MDK CO.,LTD.", + [3]byte{0, 18, 247}: "Xiamen Xinglian Electronics Co., Ltd.", + [3]byte{0, 18, 248}: "WNI Resources, LLC", + [3]byte{0, 18, 249}: "URYU SEISAKU, LTD.", + [3]byte{0, 18, 250}: "THX LTD", + [3]byte{0, 18, 251}: "Samsung Electronics", + [3]byte{0, 18, 252}: "PLANET System Co.,LTD", + [3]byte{0, 18, 253}: "OPTIMUS IC S.A.", + [3]byte{0, 18, 254}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{0, 18, 255}: "Lely Industries N.V.", + [3]byte{0, 19, 0}: "IT-FACTORY, INC.", + [3]byte{0, 19, 1}: "IronGate S.L.", + [3]byte{0, 19, 2}: "Intel Corporate", + [3]byte{0, 19, 3}: "GateConnect", + [3]byte{0, 19, 4}: "Flaircomm Technologies Co. LTD", + [3]byte{0, 19, 5}: "Epicom, Inc.", + [3]byte{0, 19, 6}: "Always On Wireless", + [3]byte{0, 19, 7}: "Paravirtual Corporation", + [3]byte{0, 19, 8}: "Nuvera Fuel Cells", + [3]byte{0, 19, 9}: "Ocean Broadband Networks", + [3]byte{0, 19, 10}: "Nortel", + [3]byte{0, 19, 11}: "Mextal B.V.", + [3]byte{0, 19, 12}: "HF System Corporation", + [3]byte{0, 19, 13}: "GALILEO AVIONICA", + [3]byte{0, 19, 14}: "Focusrite Audio Engineering Limited", + [3]byte{0, 19, 15}: "EGEMEN Bilgisayar Muh San ve Tic LTD STI", + [3]byte{0, 19, 16}: "Cisco-Linksys, LLC", + [3]byte{0, 19, 17}: "ARRIS International", + [3]byte{0, 19, 18}: "Amedia Networks Inc.", + [3]byte{0, 19, 19}: "GuangZhou Post & Telecom Equipment ltd", + [3]byte{0, 19, 20}: "Asiamajor Inc.", + [3]byte{0, 19, 21}: "SONY Computer Entertainment inc,", + [3]byte{0, 19, 22}: "L-S-B Broadcast Technologies GmbH", + [3]byte{0, 19, 23}: "GN Netcom as", + [3]byte{0, 19, 24}: "DGSTATION Co., Ltd.", + [3]byte{0, 19, 25}: "CISCO SYSTEMS, INC.", + [3]byte{0, 19, 26}: "CISCO SYSTEMS, INC.", + [3]byte{0, 19, 27}: "BeCell Innovations Corp.", + [3]byte{0, 19, 28}: "LiteTouch, Inc.", + [3]byte{0, 19, 29}: "Scanvaegt International A/S", + [3]byte{0, 19, 30}: "Peiker acustic GmbH & Co. KG", + [3]byte{0, 19, 31}: "NxtPhase T&D, Corp.", + [3]byte{0, 19, 32}: "Intel Corporate", + [3]byte{0, 19, 33}: "Hewlett-Packard Company", + [3]byte{0, 19, 34}: "DAQ Electronics, Inc.", + [3]byte{0, 19, 35}: "Cap Co., Ltd.", + [3]byte{0, 19, 36}: "Schneider Electric Ultra Terminal", + [3]byte{0, 19, 37}: "Cortina Systems Inc", + [3]byte{0, 19, 38}: "ECM Systems Ltd", + [3]byte{0, 19, 39}: "Data Acquisitions limited", + [3]byte{0, 19, 40}: "Westech Korea Inc.,", + [3]byte{0, 19, 41}: "VSST Co., LTD", + [3]byte{0, 19, 42}: "Sitronics Telecom Solutions", + [3]byte{0, 19, 43}: "Phoenix Digital", + [3]byte{0, 19, 44}: "MAZ Brandenburg GmbH", + [3]byte{0, 19, 45}: "iWise Communications", + [3]byte{0, 19, 46}: "ITian Coporation", + [3]byte{0, 19, 47}: "Interactek", + [3]byte{0, 19, 48}: "EURO PROTECTION SURVEILLANCE", + [3]byte{0, 19, 49}: "CellPoint Connect", + [3]byte{0, 19, 50}: "Beijing Topsec Network Security Technology Co., Ltd.", + [3]byte{0, 19, 51}: "BaudTec Corporation", + [3]byte{0, 19, 52}: "Arkados, Inc.", + [3]byte{0, 19, 53}: "VS Industry Berhad", + [3]byte{0, 19, 54}: "Tianjin 712 Communication Broadcasting co., ltd.", + [3]byte{0, 19, 55}: "Orient Power Home Network Ltd.", + [3]byte{0, 19, 56}: "FRESENIUS-VIAL", + [3]byte{0, 19, 57}: "CCV Deutschland GmbH", + [3]byte{0, 19, 58}: "VadaTech Inc.", + [3]byte{0, 19, 59}: "Speed Dragon Multimedia Limited", + [3]byte{0, 19, 60}: "QUINTRON SYSTEMS INC.", + [3]byte{0, 19, 61}: "Micro Memory Curtiss Wright Co", + [3]byte{0, 19, 62}: "MetaSwitch", + [3]byte{0, 19, 63}: "Eppendorf Instrumente GmbH", + [3]byte{0, 19, 64}: "AD.EL s.r.l.", + [3]byte{0, 19, 65}: "Shandong New Beiyang Information Technology Co.,Ltd", + [3]byte{0, 19, 66}: "Vision Research, Inc.", + [3]byte{0, 19, 67}: "Matsushita Electronic Components (Europe) GmbH", + [3]byte{0, 19, 68}: "Fargo Electronics Inc.", + [3]byte{0, 19, 69}: "Eaton Corporation", + [3]byte{0, 19, 70}: "D-Link Corporation", + [3]byte{0, 19, 71}: "BlueTree Wireless Data Inc.", + [3]byte{0, 19, 72}: "Artila Electronics Co., Ltd.", + [3]byte{0, 19, 73}: "ZyXEL Communications Corporation", + [3]byte{0, 19, 74}: "Engim, Inc.", + [3]byte{0, 19, 75}: "ToGoldenNet Technology Inc.", + [3]byte{0, 19, 76}: "YDT Technology International", + [3]byte{0, 19, 77}: "Inepro BV", + [3]byte{0, 19, 78}: "Valox Systems, Inc.", + [3]byte{0, 19, 79}: "Tranzeo Wireless Technologies Inc.", + [3]byte{0, 19, 80}: "Silver Spring Networks, Inc", + [3]byte{0, 19, 81}: "Niles Audio Corporation", + [3]byte{0, 19, 82}: "Naztec, Inc.", + [3]byte{0, 19, 83}: "HYDAC Filtertechnik GMBH", + [3]byte{0, 19, 84}: "Zcomax Technologies, Inc.", + [3]byte{0, 19, 85}: "TOMEN Cyber-business Solutions, Inc.", + [3]byte{0, 19, 86}: "FLIR Radiation Inc", + [3]byte{0, 19, 87}: "Soyal Technology Co., Ltd.", + [3]byte{0, 19, 88}: "Realm Systems, Inc.", + [3]byte{0, 19, 89}: "ProTelevision Technologies A/S", + [3]byte{0, 19, 90}: "Project T&E Limited", + [3]byte{0, 19, 91}: "PanelLink Cinema, LLC", + [3]byte{0, 19, 92}: "OnSite Systems, Inc.", + [3]byte{0, 19, 93}: "NTTPC Communications, Inc.", + [3]byte{0, 19, 94}: "EAB/RWI/K", + [3]byte{0, 19, 95}: "CISCO SYSTEMS, INC.", + [3]byte{0, 19, 96}: "CISCO SYSTEMS, INC.", + [3]byte{0, 19, 97}: "Biospace Co., Ltd.", + [3]byte{0, 19, 98}: "ShinHeung Precision Co., Ltd.", + [3]byte{0, 19, 99}: "Verascape, Inc.", + [3]byte{0, 19, 100}: "Paradigm Technology Inc..", + [3]byte{0, 19, 101}: "Nortel", + [3]byte{0, 19, 102}: "Neturity Technologies Inc.", + [3]byte{0, 19, 103}: "Narayon. Co., Ltd.", + [3]byte{0, 19, 104}: "Saab Danmark A/S", + [3]byte{0, 19, 105}: "Honda Electron Co., LED.", + [3]byte{0, 19, 106}: "Hach Lange Sarl", + [3]byte{0, 19, 107}: "E-TEC", + [3]byte{0, 19, 108}: "TomTom", + [3]byte{0, 19, 109}: "Tentaculus AB", + [3]byte{0, 19, 110}: "Techmetro Corp.", + [3]byte{0, 19, 111}: "PacketMotion, Inc.", + [3]byte{0, 19, 112}: "Nokia Danmark A/S", + [3]byte{0, 19, 113}: "ARRIS Group, Inc.", + [3]byte{0, 19, 114}: "Dell Inc", + [3]byte{0, 19, 115}: "BLwave Electronics Co., Ltd", + [3]byte{0, 19, 116}: "Atheros Communications, Inc.", + [3]byte{0, 19, 117}: "American Security Products Co.", + [3]byte{0, 19, 118}: "Tabor Electronics Ltd.", + [3]byte{0, 19, 119}: "Samsung Electronics CO., LTD", + [3]byte{0, 19, 120}: "Qsan Technology, Inc.", + [3]byte{0, 19, 121}: "PONDER INFORMATION INDUSTRIES LTD.", + [3]byte{0, 19, 122}: "Netvox Technology Co., Ltd.", + [3]byte{0, 19, 123}: "Movon Corporation", + [3]byte{0, 19, 124}: "Kaicom co., Ltd.", + [3]byte{0, 19, 125}: "Dynalab, Inc.", + [3]byte{0, 19, 126}: "CorEdge Networks, Inc.", + [3]byte{0, 19, 127}: "CISCO SYSTEMS, INC.", + [3]byte{0, 19, 128}: "CISCO SYSTEMS, INC.", + [3]byte{0, 19, 129}: "CHIPS & Systems, Inc.", + [3]byte{0, 19, 130}: "Cetacea Networks Corporation", + [3]byte{0, 19, 131}: "Application Technologies and Engineering Research Laboratory", + [3]byte{0, 19, 132}: "Advanced Motion Controls", + [3]byte{0, 19, 133}: "Add-On Technology Co., LTD.", + [3]byte{0, 19, 134}: "ABB Inc./Totalflow", + [3]byte{0, 19, 135}: "27M Technologies AB", + [3]byte{0, 19, 136}: "WiMedia Alliance", + [3]byte{0, 19, 137}: "Redes de Telefonía Móvil S.A.", + [3]byte{0, 19, 138}: "QINGDAO GOERTEK ELECTRONICS CO.,LTD.", + [3]byte{0, 19, 139}: "Phantom Technologies LLC", + [3]byte{0, 19, 140}: "Kumyoung.Co.Ltd", + [3]byte{0, 19, 141}: "Kinghold", + [3]byte{0, 19, 142}: "FOAB Elektronik AB", + [3]byte{0, 19, 143}: "Asiarock Incorporation", + [3]byte{0, 19, 144}: "Termtek Computer Co., Ltd", + [3]byte{0, 19, 145}: "OUEN CO.,LTD.", + [3]byte{0, 19, 146}: "Ruckus Wireless", + [3]byte{0, 19, 147}: "Panta Systems, Inc.", + [3]byte{0, 19, 148}: "Infohand Co.,Ltd", + [3]byte{0, 19, 149}: "congatec AG", + [3]byte{0, 19, 150}: "Acbel Polytech Inc.", + [3]byte{0, 19, 151}: "Oracle Corporation", + [3]byte{0, 19, 152}: "TrafficSim Co.,Ltd", + [3]byte{0, 19, 153}: "STAC Corporation.", + [3]byte{0, 19, 154}: "K-ubique ID Corp.", + [3]byte{0, 19, 155}: "ioIMAGE Ltd.", + [3]byte{0, 19, 156}: "Exavera Technologies, Inc.", + [3]byte{0, 19, 157}: "Marvell Hispana S.L.", + [3]byte{0, 19, 158}: "Ciara Technologies Inc.", + [3]byte{0, 19, 159}: "Electronics Design Services, Co., Ltd.", + [3]byte{0, 19, 160}: "ALGOSYSTEM Co., Ltd.", + [3]byte{0, 19, 161}: "Crow Electronic Engeneering", + [3]byte{0, 19, 162}: "MaxStream, Inc", + [3]byte{0, 19, 163}: "Siemens Com CPE Devices", + [3]byte{0, 19, 164}: "KeyEye Communications", + [3]byte{0, 19, 165}: "General Solutions, LTD.", + [3]byte{0, 19, 166}: "Extricom Ltd", + [3]byte{0, 19, 167}: "BATTELLE MEMORIAL INSTITUTE", + [3]byte{0, 19, 168}: "Tanisys Technology", + [3]byte{0, 19, 169}: "Sony Corporation", + [3]byte{0, 19, 170}: "ALS & TEC Ltd.", + [3]byte{0, 19, 171}: "Telemotive AG", + [3]byte{0, 19, 172}: "Sunmyung Electronics Co., LTD", + [3]byte{0, 19, 173}: "Sendo Ltd", + [3]byte{0, 19, 174}: "Radiance Technologies, Inc.", + [3]byte{0, 19, 175}: "NUMA Technology,Inc.", + [3]byte{0, 19, 176}: "Jablotron", + [3]byte{0, 19, 177}: "Intelligent Control Systems (Asia) Pte Ltd", + [3]byte{0, 19, 178}: "Carallon Limited", + [3]byte{0, 19, 179}: "Ecom Communications Technology Co., Ltd.", + [3]byte{0, 19, 180}: "Appear TV", + [3]byte{0, 19, 181}: "Wavesat", + [3]byte{0, 19, 182}: "Sling Media, Inc.", + [3]byte{0, 19, 183}: "Scantech ID", + [3]byte{0, 19, 184}: "RyCo Electronic Systems Limited", + [3]byte{0, 19, 185}: "BM SPA", + [3]byte{0, 19, 186}: "ReadyLinks Inc", + [3]byte{0, 19, 187}: "Smartvue Corporation", + [3]byte{0, 19, 188}: "Artimi Ltd", + [3]byte{0, 19, 189}: "HYMATOM SA", + [3]byte{0, 19, 190}: "Virtual Conexions", + [3]byte{0, 19, 191}: "Media System Planning Corp.", + [3]byte{0, 19, 192}: "Trix Tecnologia Ltda.", + [3]byte{0, 19, 193}: "Asoka USA Corporation", + [3]byte{0, 19, 194}: "WACOM Co.,Ltd", + [3]byte{0, 19, 195}: "CISCO SYSTEMS, INC.", + [3]byte{0, 19, 196}: "CISCO SYSTEMS, INC.", + [3]byte{0, 19, 197}: "LIGHTRON FIBER-OPTIC DEVICES INC.", + [3]byte{0, 19, 198}: "OpenGear, Inc", + [3]byte{0, 19, 199}: "IONOS Co.,Ltd.", + [3]byte{0, 19, 200}: "ADB Broadband Italia", + [3]byte{0, 19, 201}: "Beyond Achieve Enterprises Ltd.", + [3]byte{0, 19, 202}: "Pico Digital", + [3]byte{0, 19, 203}: "Zenitel Norway AS", + [3]byte{0, 19, 204}: "Tall Maple Systems", + [3]byte{0, 19, 205}: "MTI co. LTD", + [3]byte{0, 19, 206}: "Intel Corporate", + [3]byte{0, 19, 207}: "4Access Communications", + [3]byte{0, 19, 208}: "t+ Medical Ltd", + [3]byte{0, 19, 209}: "KIRK telecom A/S", + [3]byte{0, 19, 210}: "PAGE IBERICA, S.A.", + [3]byte{0, 19, 211}: "MICRO-STAR INTERNATIONAL CO., LTD.", + [3]byte{0, 19, 212}: "ASUSTek COMPUTER INC.", + [3]byte{0, 19, 213}: "RuggedCom", + [3]byte{0, 19, 214}: "TII NETWORK TECHNOLOGIES, INC.", + [3]byte{0, 19, 215}: "SPIDCOM Technologies SA", + [3]byte{0, 19, 216}: "Princeton Instruments", + [3]byte{0, 19, 217}: "Matrix Product Development, Inc.", + [3]byte{0, 19, 218}: "Diskware Co., Ltd", + [3]byte{0, 19, 219}: "SHOEI Electric Co.,Ltd", + [3]byte{0, 19, 220}: "IBTEK INC.", + [3]byte{0, 19, 221}: "Abbott Diagnostics", + [3]byte{0, 19, 222}: "Adapt4, LLC", + [3]byte{0, 19, 223}: "Ryvor Corp.", + [3]byte{0, 19, 224}: "Murata Manufacturing Co., Ltd.", + [3]byte{0, 19, 225}: "Iprobe AB", + [3]byte{0, 19, 226}: "GeoVision Inc.", + [3]byte{0, 19, 227}: "CoVi Technologies, Inc.", + [3]byte{0, 19, 228}: "YANGJAE SYSTEMS CORP.", + [3]byte{0, 19, 229}: "TENOSYS, INC.", + [3]byte{0, 19, 230}: "Technolution", + [3]byte{0, 19, 231}: "Halcro", + [3]byte{0, 19, 232}: "Intel Corporate", + [3]byte{0, 19, 233}: "VeriWave, Inc.", + [3]byte{0, 19, 234}: "Kamstrup A/S", + [3]byte{0, 19, 235}: "Sysmaster Corporation", + [3]byte{0, 19, 236}: "Sunbay Software AG", + [3]byte{0, 19, 237}: "PSIA", + [3]byte{0, 19, 238}: "JBX Designs Inc.", + [3]byte{0, 19, 239}: "Kingjon Digital Technology Co.,Ltd", + [3]byte{0, 19, 240}: "Wavefront Semiconductor", + [3]byte{0, 19, 241}: "AMOD Technology Co., Ltd.", + [3]byte{0, 19, 242}: "Klas Ltd", + [3]byte{0, 19, 243}: "Giga-byte Communications Inc.", + [3]byte{0, 19, 244}: "Psitek (Pty) Ltd", + [3]byte{0, 19, 245}: "Akimbi Systems", + [3]byte{0, 19, 246}: "Cintech", + [3]byte{0, 19, 247}: "SMC Networks, Inc.", + [3]byte{0, 19, 248}: "Dex Security Solutions", + [3]byte{0, 19, 249}: "Cavera Systems", + [3]byte{0, 19, 250}: "LifeSize Communications, Inc", + [3]byte{0, 19, 251}: "RKC INSTRUMENT INC.", + [3]byte{0, 19, 252}: "SiCortex, Inc", + [3]byte{0, 19, 253}: "Nokia Danmark A/S", + [3]byte{0, 19, 254}: "GRANDTEC ELECTRONIC CORP.", + [3]byte{0, 19, 255}: "Dage-MTI of MC, Inc.", + [3]byte{0, 20, 0}: "MINERVA KOREA CO., LTD", + [3]byte{0, 20, 1}: "Rivertree Networks Corp.", + [3]byte{0, 20, 2}: "kk-electronic a/s", + [3]byte{0, 20, 3}: "Renasis, LLC", + [3]byte{0, 20, 4}: "ARRIS Group, Inc.", + [3]byte{0, 20, 5}: "OpenIB, Inc.", + [3]byte{0, 20, 6}: "Go Networks", + [3]byte{0, 20, 7}: "Sperian Protection Instrumentation", + [3]byte{0, 20, 8}: "Eka Systems Inc.", + [3]byte{0, 20, 9}: "MAGNETI MARELLI S.E. S.p.A.", + [3]byte{0, 20, 10}: "WEPIO Co., Ltd.", + [3]byte{0, 20, 11}: "FIRST INTERNATIONAL COMPUTER, INC.", + [3]byte{0, 20, 12}: "GKB CCTV CO., LTD.", + [3]byte{0, 20, 13}: "Nortel", + [3]byte{0, 20, 14}: "Nortel", + [3]byte{0, 20, 15}: "Federal State Unitary Enterprise Leningrad R&D Institute of", + [3]byte{0, 20, 16}: "Suzhou Keda Technology CO.,Ltd", + [3]byte{0, 20, 17}: "Deutschmann Automation GmbH & Co. KG", + [3]byte{0, 20, 18}: "S-TEC electronics AG", + [3]byte{0, 20, 19}: "Trebing & Himstedt Prozeßautomation GmbH & Co. KG", + [3]byte{0, 20, 20}: "Jumpnode Systems LLC.", + [3]byte{0, 20, 21}: "Intec Automation Inc.", + [3]byte{0, 20, 22}: "Scosche Industries, Inc.", + [3]byte{0, 20, 23}: "RSE Informations Technologie GmbH", + [3]byte{0, 20, 24}: "C4Line", + [3]byte{0, 20, 25}: "SIDSA", + [3]byte{0, 20, 26}: "DEICY CORPORATION", + [3]byte{0, 20, 27}: "CISCO SYSTEMS, INC.", + [3]byte{0, 20, 28}: "CISCO SYSTEMS, INC.", + [3]byte{0, 20, 29}: "LTi DRIVES GmbH", + [3]byte{0, 20, 30}: "P.A. Semi, Inc.", + [3]byte{0, 20, 31}: "SunKwang Electronics Co., Ltd", + [3]byte{0, 20, 32}: "G-Links networking company", + [3]byte{0, 20, 33}: "Total Wireless Technologies Pte. Ltd.", + [3]byte{0, 20, 34}: "Dell Inc", + [3]byte{0, 20, 35}: "J-S Co. NEUROCOM", + [3]byte{0, 20, 36}: "Merry Electrics CO., LTD.", + [3]byte{0, 20, 37}: "Galactic Computing Corp.", + [3]byte{0, 20, 38}: "NL Technology", + [3]byte{0, 20, 39}: "JazzMutant", + [3]byte{0, 20, 40}: "Vocollect, Inc", + [3]byte{0, 20, 41}: "V Center Technologies Co., Ltd.", + [3]byte{0, 20, 42}: "Elitegroup Computer System Co., Ltd", + [3]byte{0, 20, 43}: "Edata Communication Inc.", + [3]byte{0, 20, 44}: "Koncept International, Inc.", + [3]byte{0, 20, 45}: "Toradex AG", + [3]byte{0, 20, 46}: "77 Elektronika Kft.", + [3]byte{0, 20, 47}: "WildPackets", + [3]byte{0, 20, 48}: "ViPowER, Inc", + [3]byte{0, 20, 49}: "PDL Electronics Ltd", + [3]byte{0, 20, 50}: "Tarallax Wireless, Inc.", + [3]byte{0, 20, 51}: "Empower Technologies(Canada) Inc.", + [3]byte{0, 20, 52}: "Keri Systems, Inc", + [3]byte{0, 20, 53}: "CityCom Corp.", + [3]byte{0, 20, 54}: "Qwerty Elektronik AB", + [3]byte{0, 20, 55}: "GSTeletech Co.,Ltd.", + [3]byte{0, 20, 56}: "Hewlett-Packard Company", + [3]byte{0, 20, 57}: "Blonder Tongue Laboratories, Inc.", + [3]byte{0, 20, 58}: "RAYTALK INTERNATIONAL SRL", + [3]byte{0, 20, 59}: "Sensovation AG", + [3]byte{0, 20, 60}: "Rheinmetall Canada Inc.", + [3]byte{0, 20, 61}: "Aevoe Inc.", + [3]byte{0, 20, 62}: "AirLink Communications, Inc.", + [3]byte{0, 20, 63}: "Hotway Technology Corporation", + [3]byte{0, 20, 64}: "ATOMIC Corporation", + [3]byte{0, 20, 65}: "Innovation Sound Technology Co., LTD.", + [3]byte{0, 20, 66}: "ATTO CORPORATION", + [3]byte{0, 20, 67}: "Consultronics Europe Ltd", + [3]byte{0, 20, 68}: "Grundfos Holding", + [3]byte{0, 20, 69}: "Telefon-Gradnja d.o.o.", + [3]byte{0, 20, 70}: "SuperVision Solutions LLC", + [3]byte{0, 20, 71}: "BOAZ Inc.", + [3]byte{0, 20, 72}: "Inventec Multimedia & Telecom Corporation", + [3]byte{0, 20, 73}: "Sichuan Changhong Electric Ltd.", + [3]byte{0, 20, 74}: "Taiwan Thick-Film Ind. Corp.", + [3]byte{0, 20, 75}: "Hifn, Inc.", + [3]byte{0, 20, 76}: "General Meters Corp.", + [3]byte{0, 20, 77}: "Intelligent Systems", + [3]byte{0, 20, 78}: "SRISA", + [3]byte{0, 20, 79}: "Oracle Corporation", + [3]byte{0, 20, 80}: "Heim Systems GmbH", + [3]byte{0, 20, 81}: "Apple", + [3]byte{0, 20, 82}: "CALCULEX,INC.", + [3]byte{0, 20, 83}: "ADVANTECH TECHNOLOGIES CO.,LTD", + [3]byte{0, 20, 84}: "Symwave", + [3]byte{0, 20, 85}: "Coder Electronics Corporation", + [3]byte{0, 20, 86}: "Edge Products", + [3]byte{0, 20, 87}: "T-VIPS AS", + [3]byte{0, 20, 88}: "HS Automatic ApS", + [3]byte{0, 20, 89}: "Moram Co., Ltd.", + [3]byte{0, 20, 90}: "Neratec Solutions AG", + [3]byte{0, 20, 91}: "SeekerNet Inc.", + [3]byte{0, 20, 92}: "Intronics B.V.", + [3]byte{0, 20, 93}: "WJ Communications, Inc.", + [3]byte{0, 20, 94}: "IBM Corp", + [3]byte{0, 20, 95}: "ADITEC CO. LTD", + [3]byte{0, 20, 96}: "Kyocera Wireless Corp.", + [3]byte{0, 20, 97}: "CORONA CORPORATION", + [3]byte{0, 20, 98}: "Digiwell Technology, inc", + [3]byte{0, 20, 99}: "IDCS N.V.", + [3]byte{0, 20, 100}: "Cryptosoft", + [3]byte{0, 20, 101}: "Novo Nordisk A/S", + [3]byte{0, 20, 102}: "Kleinhenz Elektronik GmbH", + [3]byte{0, 20, 103}: "ArrowSpan Inc.", + [3]byte{0, 20, 104}: "CelPlan International, Inc.", + [3]byte{0, 20, 105}: "CISCO SYSTEMS, INC.", + [3]byte{0, 20, 106}: "CISCO SYSTEMS, INC.", + [3]byte{0, 20, 107}: "Anagran, Inc.", + [3]byte{0, 20, 108}: "Netgear Inc.", + [3]byte{0, 20, 109}: "RF Technologies", + [3]byte{0, 20, 110}: "H. Stoll GmbH & Co. KG", + [3]byte{0, 20, 111}: "Kohler Co", + [3]byte{0, 20, 112}: "Prokom Software SA", + [3]byte{0, 20, 113}: "Eastern Asia Technology Limited", + [3]byte{0, 20, 114}: "China Broadband Wireless IP Standard Group", + [3]byte{0, 20, 115}: "Bookham Inc", + [3]byte{0, 20, 116}: "K40 Electronics", + [3]byte{0, 20, 117}: "Wiline Networks, Inc.", + [3]byte{0, 20, 118}: "MultiCom Industries Limited", + [3]byte{0, 20, 119}: "Nertec Inc.", + [3]byte{0, 20, 120}: "ShenZhen TP-LINK Technologies Co., Ltd.", + [3]byte{0, 20, 121}: "NEC Magnus Communications,Ltd.", + [3]byte{0, 20, 122}: "Eubus GmbH", + [3]byte{0, 20, 123}: "Iteris, Inc.", + [3]byte{0, 20, 124}: "3Com Ltd", + [3]byte{0, 20, 125}: "Aeon Digital International", + [3]byte{0, 20, 126}: "InnerWireless", + [3]byte{0, 20, 127}: "Thomson Telecom Belgium", + [3]byte{0, 20, 128}: "Hitachi-LG Data Storage Korea, Inc", + [3]byte{0, 20, 129}: "Multilink Inc", + [3]byte{0, 20, 130}: "Aurora Networks", + [3]byte{0, 20, 131}: "eXS Inc.", + [3]byte{0, 20, 132}: "Cermate Technologies Inc.", + [3]byte{0, 20, 133}: "Giga-Byte", + [3]byte{0, 20, 134}: "Echo Digital Audio Corporation", + [3]byte{0, 20, 135}: "American Technology Integrators", + [3]byte{0, 20, 136}: "Akorri", + [3]byte{0, 20, 137}: "B15402100 - JANDEI, S.L.", + [3]byte{0, 20, 138}: "Elin Ebg Traction Gmbh", + [3]byte{0, 20, 139}: "Globo Electronic GmbH & Co. KG", + [3]byte{0, 20, 140}: "Fortress Technologies", + [3]byte{0, 20, 141}: "Cubic Defense Simulation Systems", + [3]byte{0, 20, 142}: "Tele Power Inc.", + [3]byte{0, 20, 143}: "Protronic (Far East) Ltd.", + [3]byte{0, 20, 144}: "ASP Corporation", + [3]byte{0, 20, 145}: "Daniels Electronics Ltd. dbo Codan Rado Communications", + [3]byte{0, 20, 146}: "Liteon, Mobile Media Solution SBU", + [3]byte{0, 20, 147}: "Systimax Solutions", + [3]byte{0, 20, 148}: "ESU AG", + [3]byte{0, 20, 149}: "2Wire, Inc.", + [3]byte{0, 20, 150}: "Phonic Corp.", + [3]byte{0, 20, 151}: "ZHIYUAN Eletronics co.,ltd.", + [3]byte{0, 20, 152}: "Viking Design Technology", + [3]byte{0, 20, 153}: "Helicomm Inc", + [3]byte{0, 20, 154}: "ARRIS Group, Inc.", + [3]byte{0, 20, 155}: "Nokota Communications, LLC", + [3]byte{0, 20, 156}: "HF Company", + [3]byte{0, 20, 157}: "Sound ID Inc.", + [3]byte{0, 20, 158}: "UbONE Co., Ltd", + [3]byte{0, 20, 159}: "System and Chips, Inc.", + [3]byte{0, 20, 160}: "Accsense, Inc.", + [3]byte{0, 20, 161}: "Synchronous Communication Corp", + [3]byte{0, 20, 162}: "Core Micro Systems Inc.", + [3]byte{0, 20, 163}: "Vitelec BV", + [3]byte{0, 20, 164}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 20, 165}: "Gemtek Technology Co., Ltd.", + [3]byte{0, 20, 166}: "Teranetics, Inc.", + [3]byte{0, 20, 167}: "Nokia Danmark A/S", + [3]byte{0, 20, 168}: "CISCO SYSTEMS, INC.", + [3]byte{0, 20, 169}: "CISCO SYSTEMS, INC.", + [3]byte{0, 20, 170}: "Ashly Audio, Inc.", + [3]byte{0, 20, 171}: "Senhai Electronic Technology Co., Ltd.", + [3]byte{0, 20, 172}: "Bountiful WiFi", + [3]byte{0, 20, 173}: "Gassner Wiege- und Meßtechnik GmbH", + [3]byte{0, 20, 174}: "Wizlogics Co., Ltd.", + [3]byte{0, 20, 175}: "Datasym POS Inc.", + [3]byte{0, 20, 176}: "Naeil Community", + [3]byte{0, 20, 177}: "Avitec AB", + [3]byte{0, 20, 178}: "mCubelogics Corporation", + [3]byte{0, 20, 179}: "CoreStar International Corp", + [3]byte{0, 20, 180}: "General Dynamics United Kingdom Ltd", + [3]byte{0, 20, 181}: "PHYSIOMETRIX,INC", + [3]byte{0, 20, 182}: "Enswer Technology Inc.", + [3]byte{0, 20, 183}: "AR Infotek Inc.", + [3]byte{0, 20, 184}: "Hill-Rom", + [3]byte{0, 20, 185}: "MSTAR SEMICONDUCTOR", + [3]byte{0, 20, 186}: "Carvers SA de CV", + [3]byte{0, 20, 187}: "Open Interface North America", + [3]byte{0, 20, 188}: "SYNECTIC TELECOM EXPORTS PVT. LTD.", + [3]byte{0, 20, 189}: "incNETWORKS, Inc", + [3]byte{0, 20, 190}: "Wink communication technology CO.LTD", + [3]byte{0, 20, 191}: "Cisco-Linksys LLC", + [3]byte{0, 20, 192}: "Symstream Technology Group Ltd", + [3]byte{0, 20, 193}: "U.S. Robotics Corporation", + [3]byte{0, 20, 194}: "Hewlett-Packard Company", + [3]byte{0, 20, 195}: "Seagate Technology", + [3]byte{0, 20, 196}: "Vitelcom Mobile Technology", + [3]byte{0, 20, 197}: "Alive Technologies Pty Ltd", + [3]byte{0, 20, 198}: "Quixant Ltd", + [3]byte{0, 20, 199}: "Nortel", + [3]byte{0, 20, 200}: "Contemporary Research Corp", + [3]byte{0, 20, 201}: "Brocade Communications Systems, Inc.", + [3]byte{0, 20, 202}: "Key Radio Systems Limited", + [3]byte{0, 20, 203}: "LifeSync Corporation", + [3]byte{0, 20, 204}: "Zetec, Inc.", + [3]byte{0, 20, 205}: "DigitalZone Co., Ltd.", + [3]byte{0, 20, 206}: "NF CORPORATION", + [3]byte{0, 20, 207}: "INVISIO Communications", + [3]byte{0, 20, 208}: "BTI Systems Inc.", + [3]byte{0, 20, 209}: "TRENDnet", + [3]byte{0, 20, 210}: "Kyuden Technosystems Corporation", + [3]byte{0, 20, 211}: "SEPSA", + [3]byte{0, 20, 212}: "K Technology Corporation", + [3]byte{0, 20, 213}: "Datang Telecom Technology CO. , LCD,Optical Communication Br", + [3]byte{0, 20, 214}: "Jeongmin Electronics Co.,Ltd.", + [3]byte{0, 20, 215}: "Datastore Technology Corp", + [3]byte{0, 20, 216}: "bio-logic SA", + [3]byte{0, 20, 217}: "IP Fabrics, Inc.", + [3]byte{0, 20, 218}: "Huntleigh Healthcare", + [3]byte{0, 20, 219}: "Elma Trenew Electronic GmbH", + [3]byte{0, 20, 220}: "Communication System Design & Manufacturing (CSDM)", + [3]byte{0, 20, 221}: "Covergence Inc.", + [3]byte{0, 20, 222}: "Sage Instruments Inc.", + [3]byte{0, 20, 223}: "HI-P Tech Corporation", + [3]byte{0, 20, 224}: "LET'S Corporation", + [3]byte{0, 20, 225}: "Data Display AG", + [3]byte{0, 20, 226}: "datacom systems inc.", + [3]byte{0, 20, 227}: "mm-lab GmbH", + [3]byte{0, 20, 228}: "infinias, LLC", + [3]byte{0, 20, 229}: "Alticast", + [3]byte{0, 20, 230}: "AIM Infrarotmodule GmbH", + [3]byte{0, 20, 231}: "Stolinx,. Inc", + [3]byte{0, 20, 232}: "ARRIS Group, Inc.", + [3]byte{0, 20, 233}: "Nortech International", + [3]byte{0, 20, 234}: "S Digm Inc. (Safe Paradigm Inc.)", + [3]byte{0, 20, 235}: "AwarePoint Corporation", + [3]byte{0, 20, 236}: "Acro Telecom", + [3]byte{0, 20, 237}: "Airak, Inc.", + [3]byte{0, 20, 238}: "Western Digital Technologies, Inc.", + [3]byte{0, 20, 239}: "TZero Technologies, Inc.", + [3]byte{0, 20, 240}: "Business Security OL AB", + [3]byte{0, 20, 241}: "CISCO SYSTEMS, INC.", + [3]byte{0, 20, 242}: "CISCO SYSTEMS, INC.", + [3]byte{0, 20, 243}: "ViXS Systems Inc", + [3]byte{0, 20, 244}: "DekTec Digital Video B.V.", + [3]byte{0, 20, 245}: "OSI Security Devices", + [3]byte{0, 20, 246}: "Juniper Networks, Inc.", + [3]byte{0, 20, 247}: "CREVIS Co., LTD", + [3]byte{0, 20, 248}: "Scientific Atlanta", + [3]byte{0, 20, 249}: "Vantage Controls", + [3]byte{0, 20, 250}: "AsGa S.A.", + [3]byte{0, 20, 251}: "Technical Solutions Inc.", + [3]byte{0, 20, 252}: "Extandon, Inc.", + [3]byte{0, 20, 253}: "Thecus Technology Corp.", + [3]byte{0, 20, 254}: "Artech Electronics", + [3]byte{0, 20, 255}: "Precise Automation, Inc.", + [3]byte{0, 21, 0}: "Intel Corporate", + [3]byte{0, 21, 1}: "LexBox", + [3]byte{0, 21, 2}: "BETA tech", + [3]byte{0, 21, 3}: "PROFIcomms s.r.o.", + [3]byte{0, 21, 4}: "GAME PLUS CO., LTD.", + [3]byte{0, 21, 5}: "Actiontec Electronics, Inc", + [3]byte{0, 21, 6}: "Neo Photonics", + [3]byte{0, 21, 7}: "Renaissance Learning Inc", + [3]byte{0, 21, 8}: "Global Target Enterprise Inc", + [3]byte{0, 21, 9}: "Plus Technology Co., Ltd", + [3]byte{0, 21, 10}: "Sonoa Systems, Inc", + [3]byte{0, 21, 11}: "SAGE INFOTECH LTD.", + [3]byte{0, 21, 12}: "AVM GmbH", + [3]byte{0, 21, 13}: "Hoana Medical, Inc.", + [3]byte{0, 21, 14}: "OPENBRAIN TECHNOLOGIES CO., LTD.", + [3]byte{0, 21, 15}: "mingjong", + [3]byte{0, 21, 16}: "Techsphere Co., Ltd", + [3]byte{0, 21, 17}: "Data Center Systems", + [3]byte{0, 21, 18}: "Zurich University of Applied Sciences", + [3]byte{0, 21, 19}: "EFS sas", + [3]byte{0, 21, 20}: "Hu Zhou NAVA Networks&Electronics Ltd.", + [3]byte{0, 21, 21}: "Leipold+Co.GmbH", + [3]byte{0, 21, 22}: "URIEL SYSTEMS INC.", + [3]byte{0, 21, 23}: "Intel Corporate", + [3]byte{0, 21, 24}: "Shenzhen 10MOONS Technology Development CO.,Ltd", + [3]byte{0, 21, 25}: "StoreAge Networking Technologies", + [3]byte{0, 21, 26}: "Hunter Engineering Company", + [3]byte{0, 21, 27}: "Isilon Systems Inc.", + [3]byte{0, 21, 28}: "LENECO", + [3]byte{0, 21, 29}: "M2I CORPORATION", + [3]byte{0, 21, 30}: "Ethernet Powerlink Standardization Group (EPSG)", + [3]byte{0, 21, 31}: "Multivision Intelligent Surveillance (Hong Kong) Ltd", + [3]byte{0, 21, 32}: "Radiocrafts AS", + [3]byte{0, 21, 33}: "Horoquartz", + [3]byte{0, 21, 34}: "Dea Security", + [3]byte{0, 21, 35}: "Meteor Communications Corporation", + [3]byte{0, 21, 36}: "Numatics, Inc.", + [3]byte{0, 21, 37}: "Chamberlain Access Solutions", + [3]byte{0, 21, 38}: "Remote Technologies Inc", + [3]byte{0, 21, 39}: "Balboa Instruments", + [3]byte{0, 21, 40}: "Beacon Medical Products LLC d.b.a. BeaconMedaes", + [3]byte{0, 21, 41}: "N3 Corporation", + [3]byte{0, 21, 42}: "Nokia GmbH", + [3]byte{0, 21, 43}: "CISCO SYSTEMS, INC.", + [3]byte{0, 21, 44}: "CISCO SYSTEMS, INC.", + [3]byte{0, 21, 45}: "TenX Networks, LLC", + [3]byte{0, 21, 46}: "PacketHop, Inc.", + [3]byte{0, 21, 47}: "ARRIS Group, Inc.", + [3]byte{0, 21, 48}: "EMC Corporation", + [3]byte{0, 21, 49}: "KOCOM", + [3]byte{0, 21, 50}: "Consumer Technologies Group, LLC", + [3]byte{0, 21, 51}: "NADAM.CO.,LTD", + [3]byte{0, 21, 52}: "A Beltrónica-Companhia de Comunicações, Lda", + [3]byte{0, 21, 53}: "OTE Spa", + [3]byte{0, 21, 54}: "Powertech co.,Ltd", + [3]byte{0, 21, 55}: "Ventus Networks", + [3]byte{0, 21, 56}: "RFID, Inc.", + [3]byte{0, 21, 57}: "Technodrive SRL", + [3]byte{0, 21, 58}: "Shenzhen Syscan Technology Co.,Ltd.", + [3]byte{0, 21, 59}: "EMH metering GmbH & Co. KG", + [3]byte{0, 21, 60}: "Kprotech Co., Ltd.", + [3]byte{0, 21, 61}: "ELIM PRODUCT CO.", + [3]byte{0, 21, 62}: "Q-Matic Sweden AB", + [3]byte{0, 21, 63}: "Alcatel Alenia Space Italia", + [3]byte{0, 21, 64}: "Nortel", + [3]byte{0, 21, 65}: "StrataLight Communications, Inc.", + [3]byte{0, 21, 66}: "MICROHARD S.R.L.", + [3]byte{0, 21, 67}: "Aberdeen Test Center", + [3]byte{0, 21, 68}: "coM.s.a.t. AG", + [3]byte{0, 21, 69}: "SEECODE Co., Ltd.", + [3]byte{0, 21, 70}: "ITG Worldwide Sdn Bhd", + [3]byte{0, 21, 71}: "AiZen Solutions Inc.", + [3]byte{0, 21, 72}: "CUBE TECHNOLOGIES", + [3]byte{0, 21, 73}: "Dixtal Biomedica Ind. Com. Ltda", + [3]byte{0, 21, 74}: "WANSHIH ELECTRONIC CO., LTD", + [3]byte{0, 21, 75}: "Wonde Proud Technology Co., Ltd", + [3]byte{0, 21, 76}: "Saunders Electronics", + [3]byte{0, 21, 77}: "Netronome Systems, Inc.", + [3]byte{0, 21, 78}: "IEC", + [3]byte{0, 21, 79}: "one RF Technology", + [3]byte{0, 21, 80}: "Nits Technology Inc", + [3]byte{0, 21, 81}: "RadioPulse Inc.", + [3]byte{0, 21, 82}: "Wi-Gear Inc.", + [3]byte{0, 21, 83}: "Cytyc Corporation", + [3]byte{0, 21, 84}: "Atalum Wireless S.A.", + [3]byte{0, 21, 85}: "DFM GmbH", + [3]byte{0, 21, 86}: "SAGEM COMMUNICATION", + [3]byte{0, 21, 87}: "Olivetti", + [3]byte{0, 21, 88}: "FOXCONN", + [3]byte{0, 21, 89}: "Securaplane Technologies, Inc.", + [3]byte{0, 21, 90}: "DAINIPPON PHARMACEUTICAL CO., LTD.", + [3]byte{0, 21, 91}: "Sampo Corporation", + [3]byte{0, 21, 92}: "Dresser Wayne", + [3]byte{0, 21, 93}: "Microsoft Corporation", + [3]byte{0, 21, 94}: "Morgan Stanley", + [3]byte{0, 21, 95}: "GreenPeak Technologies", + [3]byte{0, 21, 96}: "Hewlett-Packard Company", + [3]byte{0, 21, 97}: "JJPlus Corporation", + [3]byte{0, 21, 98}: "CISCO SYSTEMS, INC.", + [3]byte{0, 21, 99}: "CISCO SYSTEMS, INC.", + [3]byte{0, 21, 100}: "BEHRINGER Spezielle Studiotechnik GmbH", + [3]byte{0, 21, 101}: "XIAMEN YEALINK NETWORK TECHNOLOGY CO.,LTD", + [3]byte{0, 21, 102}: "A-First Technology Co., Ltd.", + [3]byte{0, 21, 103}: "RADWIN Inc.", + [3]byte{0, 21, 104}: "Dilithium Networks", + [3]byte{0, 21, 105}: "PECO II, Inc.", + [3]byte{0, 21, 106}: "DG2L Technologies Pvt. Ltd.", + [3]byte{0, 21, 107}: "Perfisans Networks Corp.", + [3]byte{0, 21, 108}: "SANE SYSTEM CO., LTD", + [3]byte{0, 21, 109}: "Ubiquiti Networks Inc.", + [3]byte{0, 21, 110}: "A. W. Communication Systems Ltd", + [3]byte{0, 21, 111}: "Xiranet Communications GmbH", + [3]byte{0, 21, 112}: "Symbol TechnologiesWholly owned Subsidiary of Motorola", + [3]byte{0, 21, 113}: "Nolan Systems", + [3]byte{0, 21, 114}: "Red-Lemon", + [3]byte{0, 21, 115}: "NewSoft Technology Corporation", + [3]byte{0, 21, 116}: "Horizon Semiconductors Ltd.", + [3]byte{0, 21, 117}: "Nevis Networks Inc.", + [3]byte{0, 21, 118}: "LABiTec - Labor Biomedical Technologies GmbH", + [3]byte{0, 21, 119}: "Allied Telesis", + [3]byte{0, 21, 120}: "Audio / Video Innovations", + [3]byte{0, 21, 121}: "Lunatone Industrielle Elektronik GmbH", + [3]byte{0, 21, 122}: "Telefin S.p.A.", + [3]byte{0, 21, 123}: "Leuze electronic GmbH + Co. KG", + [3]byte{0, 21, 124}: "Dave Networks, Inc.", + [3]byte{0, 21, 125}: "POSDATA CO., LTD.", + [3]byte{0, 21, 126}: "Weidmüller Interface GmbH & Co. KG", + [3]byte{0, 21, 127}: "ChuanG International Holding CO.,LTD.", + [3]byte{0, 21, 128}: "U-WAY CORPORATION", + [3]byte{0, 21, 129}: "MAKUS Inc.", + [3]byte{0, 21, 130}: "Pulse Eight Limited", + [3]byte{0, 21, 131}: "IVT corporation", + [3]byte{0, 21, 132}: "Schenck Process GmbH", + [3]byte{0, 21, 133}: "Aonvision Technolopy Corp.", + [3]byte{0, 21, 134}: "Xiamen Overseas Chinese Electronic Co., Ltd.", + [3]byte{0, 21, 135}: "Takenaka Seisakusho Co.,Ltd", + [3]byte{0, 21, 136}: "Salutica Allied Solutions Sdn Bhd", + [3]byte{0, 21, 137}: "D-MAX Technology Co.,Ltd", + [3]byte{0, 21, 138}: "SURECOM Technology Corp.", + [3]byte{0, 21, 139}: "Park Air Systems Ltd", + [3]byte{0, 21, 140}: "Liab ApS", + [3]byte{0, 21, 141}: "Jennic Ltd", + [3]byte{0, 21, 142}: "Plustek.INC", + [3]byte{0, 21, 143}: "NTT Advanced Technology Corporation", + [3]byte{0, 21, 144}: "Hectronic GmbH", + [3]byte{0, 21, 145}: "RLW Inc.", + [3]byte{0, 21, 146}: "Facom UK Ltd (Melksham)", + [3]byte{0, 21, 147}: "U4EA Technologies Inc.", + [3]byte{0, 21, 148}: "BIXOLON CO.,LTD", + [3]byte{0, 21, 149}: "Quester Tangent Corporation", + [3]byte{0, 21, 150}: "ARRIS International", + [3]byte{0, 21, 151}: "AETA AUDIO SYSTEMS", + [3]byte{0, 21, 152}: "Kolektor group", + [3]byte{0, 21, 153}: "Samsung Electronics Co., LTD", + [3]byte{0, 21, 154}: "ARRIS Group, Inc.", + [3]byte{0, 21, 155}: "Nortel", + [3]byte{0, 21, 156}: "B-KYUNG SYSTEM Co.,Ltd.", + [3]byte{0, 21, 157}: "Tripp Lite", + [3]byte{0, 21, 158}: "Mad Catz Interactive Inc", + [3]byte{0, 21, 159}: "Terascala, Inc.", + [3]byte{0, 21, 160}: "Nokia Danmark A/S", + [3]byte{0, 21, 161}: "ECA-SINTERS", + [3]byte{0, 21, 162}: "ARRIS International", + [3]byte{0, 21, 163}: "ARRIS International", + [3]byte{0, 21, 164}: "ARRIS International", + [3]byte{0, 21, 165}: "DCI Co., Ltd.", + [3]byte{0, 21, 166}: "Digital Electronics Products Ltd.", + [3]byte{0, 21, 167}: "Robatech AG", + [3]byte{0, 21, 168}: "ARRIS Group, Inc.", + [3]byte{0, 21, 169}: "KWANG WOO I&C CO.,LTD", + [3]byte{0, 21, 170}: "Rextechnik International Co.,", + [3]byte{0, 21, 171}: "PRO CO SOUND INC", + [3]byte{0, 21, 172}: "Capelon AB", + [3]byte{0, 21, 173}: "Accedian Networks", + [3]byte{0, 21, 174}: "kyung il", + [3]byte{0, 21, 175}: "AzureWave Technologies, Inc.", + [3]byte{0, 21, 176}: "AUTOTELENET CO.,LTD", + [3]byte{0, 21, 177}: "Ambient Corporation", + [3]byte{0, 21, 178}: "Advanced Industrial Computer, Inc.", + [3]byte{0, 21, 179}: "Caretech AB", + [3]byte{0, 21, 180}: "Polymap Wireless LLC", + [3]byte{0, 21, 181}: "CI Network Corp.", + [3]byte{0, 21, 182}: "ShinMaywa Industries, Ltd.", + [3]byte{0, 21, 183}: "Toshiba", + [3]byte{0, 21, 184}: "Tahoe", + [3]byte{0, 21, 185}: "Samsung Electronics Co., Ltd.", + [3]byte{0, 21, 186}: "iba AG", + [3]byte{0, 21, 187}: "SMA Solar Technology AG", + [3]byte{0, 21, 188}: "Develco", + [3]byte{0, 21, 189}: "Group 4 Technology Ltd", + [3]byte{0, 21, 190}: "Iqua Ltd.", + [3]byte{0, 21, 191}: "technicob", + [3]byte{0, 21, 192}: "DIGITAL TELEMEDIA CO.,LTD.", + [3]byte{0, 21, 193}: "SONY Computer Entertainment inc,", + [3]byte{0, 21, 194}: "3M Germany", + [3]byte{0, 21, 195}: "Ruf Telematik AG", + [3]byte{0, 21, 196}: "FLOVEL CO., LTD.", + [3]byte{0, 21, 197}: "Dell Inc", + [3]byte{0, 21, 198}: "CISCO SYSTEMS, INC.", + [3]byte{0, 21, 199}: "CISCO SYSTEMS, INC.", + [3]byte{0, 21, 200}: "FlexiPanel Ltd", + [3]byte{0, 21, 201}: "Gumstix, Inc", + [3]byte{0, 21, 202}: "TeraRecon, Inc.", + [3]byte{0, 21, 203}: "Surf Communication Solutions Ltd.", + [3]byte{0, 21, 204}: "UQUEST, LTD.", + [3]byte{0, 21, 205}: "Exartech International Corp.", + [3]byte{0, 21, 206}: "ARRIS International", + [3]byte{0, 21, 207}: "ARRIS International", + [3]byte{0, 21, 208}: "ARRIS International", + [3]byte{0, 21, 209}: "ARRIS Group, Inc.", + [3]byte{0, 21, 210}: "Xantech Corporation", + [3]byte{0, 21, 211}: "Pantech&Curitel Communications, Inc.", + [3]byte{0, 21, 212}: "Emitor AB", + [3]byte{0, 21, 213}: "NICEVT", + [3]byte{0, 21, 214}: "OSLiNK Sp. z o.o.", + [3]byte{0, 21, 215}: "Reti Corporation", + [3]byte{0, 21, 216}: "Interlink Electronics", + [3]byte{0, 21, 217}: "PKC Electronics Oy", + [3]byte{0, 21, 218}: "IRITEL A.D.", + [3]byte{0, 21, 219}: "Canesta Inc.", + [3]byte{0, 21, 220}: "KT&C Co., Ltd.", + [3]byte{0, 21, 221}: "IP Control Systems Ltd.", + [3]byte{0, 21, 222}: "Nokia Danmark A/S", + [3]byte{0, 21, 223}: "Clivet S.p.A.", + [3]byte{0, 21, 224}: "Ericsson", + [3]byte{0, 21, 225}: "Picochip Ltd", + [3]byte{0, 21, 226}: "Dr.Ing. Herbert Knauer GmbH", + [3]byte{0, 21, 227}: "Dream Technologies Corporation", + [3]byte{0, 21, 228}: "Zimmer Elektromedizin", + [3]byte{0, 21, 229}: "Cheertek Inc.", + [3]byte{0, 21, 230}: "MOBILE TECHNIKA Inc.", + [3]byte{0, 21, 231}: "Quantec Tontechnik", + [3]byte{0, 21, 232}: "Nortel", + [3]byte{0, 21, 233}: "D-Link Corporation", + [3]byte{0, 21, 234}: "Tellumat (Pty) Ltd", + [3]byte{0, 21, 235}: "ZTE CORPORATION", + [3]byte{0, 21, 236}: "Boca Devices LLC", + [3]byte{0, 21, 237}: "Fulcrum Microsystems, Inc.", + [3]byte{0, 21, 238}: "Omnex Control Systems", + [3]byte{0, 21, 239}: "NEC TOKIN Corporation", + [3]byte{0, 21, 240}: "EGO BV", + [3]byte{0, 21, 241}: "KYLINK Communications Corp.", + [3]byte{0, 21, 242}: "ASUSTek COMPUTER INC.", + [3]byte{0, 21, 243}: "PELTOR AB", + [3]byte{0, 21, 244}: "Eventide", + [3]byte{0, 21, 245}: "Sustainable Energy Systems", + [3]byte{0, 21, 246}: "SCIENCE AND ENGINEERING SERVICES, INC.", + [3]byte{0, 21, 247}: "Wintecronics Ltd.", + [3]byte{0, 21, 248}: "Kingtronics Industrial Co. Ltd.", + [3]byte{0, 21, 249}: "CISCO SYSTEMS, INC.", + [3]byte{0, 21, 250}: "CISCO SYSTEMS, INC.", + [3]byte{0, 21, 251}: "setex schermuly textile computer gmbh", + [3]byte{0, 21, 252}: "Littelfuse Startco", + [3]byte{0, 21, 253}: "Complete Media Systems", + [3]byte{0, 21, 254}: "SCHILLING ROBOTICS LLC", + [3]byte{0, 21, 255}: "Novatel Wireless, Inc.", + [3]byte{0, 22, 0}: "CelleBrite Mobile Synchronization", + [3]byte{0, 22, 1}: "Buffalo Inc.", + [3]byte{0, 22, 2}: "CEYON TECHNOLOGY CO.,LTD.", + [3]byte{0, 22, 3}: "COOLKSKY Co., LTD", + [3]byte{0, 22, 4}: "Sigpro", + [3]byte{0, 22, 5}: "YORKVILLE SOUND INC.", + [3]byte{0, 22, 6}: "Ideal Industries", + [3]byte{0, 22, 7}: "Curves International Inc.", + [3]byte{0, 22, 8}: "Sequans Communications", + [3]byte{0, 22, 9}: "Unitech electronics co., ltd.", + [3]byte{0, 22, 10}: "SWEEX Europe BV", + [3]byte{0, 22, 11}: "TVWorks LLC", + [3]byte{0, 22, 12}: "LPL DEVELOPMENT S.A. DE C.V", + [3]byte{0, 22, 13}: "Be Here Corporation", + [3]byte{0, 22, 14}: "Optica Technologies Inc.", + [3]byte{0, 22, 15}: "BADGER METER INC", + [3]byte{0, 22, 16}: "Carina Technology", + [3]byte{0, 22, 17}: "Altecon Srl", + [3]byte{0, 22, 18}: "Otsuka Electronics Co., Ltd.", + [3]byte{0, 22, 19}: "LibreStream Technologies Inc.", + [3]byte{0, 22, 20}: "Picosecond Pulse Labs", + [3]byte{0, 22, 21}: "Nittan Company, Limited", + [3]byte{0, 22, 22}: "BROWAN COMMUNICATION INC.", + [3]byte{0, 22, 23}: "MSI", + [3]byte{0, 22, 24}: "HIVION Co., Ltd.", + [3]byte{0, 22, 25}: "Lancelan Technologies S.L.", + [3]byte{0, 22, 26}: "Dametric AB", + [3]byte{0, 22, 27}: "Micronet Corporation", + [3]byte{0, 22, 28}: "e:cue", + [3]byte{0, 22, 29}: "Innovative Wireless Technologies, Inc.", + [3]byte{0, 22, 30}: "Woojinnet", + [3]byte{0, 22, 31}: "SUNWAVETEC Co., Ltd.", + [3]byte{0, 22, 32}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 22, 33}: "Colorado Vnet", + [3]byte{0, 22, 34}: "BBH SYSTEMS GMBH", + [3]byte{0, 22, 35}: "Interval Media", + [3]byte{0, 22, 36}: "Teneros, Inc.", + [3]byte{0, 22, 37}: "Impinj, Inc.", + [3]byte{0, 22, 38}: "ARRIS Group, Inc.", + [3]byte{0, 22, 39}: "embedded-logic DESIGN AND MORE GmbH", + [3]byte{0, 22, 40}: "Ultra Electronics Manufacturing and Card Systems", + [3]byte{0, 22, 41}: "Nivus GmbH", + [3]byte{0, 22, 42}: "Antik computers & communications s.r.o.", + [3]byte{0, 22, 43}: "Togami Electric Mfg.co.,Ltd.", + [3]byte{0, 22, 44}: "Xanboo", + [3]byte{0, 22, 45}: "STNet Co., Ltd.", + [3]byte{0, 22, 46}: "Space Shuttle Hi-Tech Co., Ltd.", + [3]byte{0, 22, 47}: "Geutebrück GmbH", + [3]byte{0, 22, 48}: "Vativ Technologies", + [3]byte{0, 22, 49}: "Xteam", + [3]byte{0, 22, 50}: "SAMSUNG ELECTRONICS CO., LTD.", + [3]byte{0, 22, 51}: "Oxford Diagnostics Ltd.", + [3]byte{0, 22, 52}: "Mathtech, Inc.", + [3]byte{0, 22, 53}: "Hewlett-Packard Company", + [3]byte{0, 22, 54}: "Quanta Computer Inc.", + [3]byte{0, 22, 55}: "CITEL SpA", + [3]byte{0, 22, 56}: "TECOM Co., Ltd.", + [3]byte{0, 22, 57}: "UBIQUAM Co.,Ltd", + [3]byte{0, 22, 58}: "YVES TECHNOLOGY CO., LTD.", + [3]byte{0, 22, 59}: "VertexRSI/General Dynamics", + [3]byte{0, 22, 60}: "Rebox B.V.", + [3]byte{0, 22, 61}: "Tsinghua Tongfang Legend Silicon Tech. Co., Ltd.", + [3]byte{0, 22, 62}: "Xensource, Inc.", + [3]byte{0, 22, 63}: "CReTE SYSTEMS Inc.", + [3]byte{0, 22, 64}: "Asmobile Communication Inc.", + [3]byte{0, 22, 65}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{0, 22, 66}: "Pangolin", + [3]byte{0, 22, 67}: "Sunhillo Corporation", + [3]byte{0, 22, 68}: "LITE-ON Technology Corp.", + [3]byte{0, 22, 69}: "Power Distribution, Inc.", + [3]byte{0, 22, 70}: "CISCO SYSTEMS, INC.", + [3]byte{0, 22, 71}: "CISCO SYSTEMS, INC.", + [3]byte{0, 22, 72}: "SSD Company Limited", + [3]byte{0, 22, 73}: "SetOne GmbH", + [3]byte{0, 22, 74}: "Vibration Technology Limited", + [3]byte{0, 22, 75}: "Quorion Data Systems GmbH", + [3]byte{0, 22, 76}: "PLANET INT Co., Ltd", + [3]byte{0, 22, 77}: "Alcatel North America IP Division", + [3]byte{0, 22, 78}: "Nokia Danmark A/S", + [3]byte{0, 22, 79}: "World Ethnic Broadcastin Inc.", + [3]byte{0, 22, 80}: "Herley General Microwave Israel.", + [3]byte{0, 22, 81}: "Exeo Systems", + [3]byte{0, 22, 82}: "Hoatech Technologies, Inc.", + [3]byte{0, 22, 83}: "LEGO System A/S IE Electronics Division", + [3]byte{0, 22, 84}: "Flex-P Industries Sdn. Bhd.", + [3]byte{0, 22, 85}: "FUHO TECHNOLOGY Co., LTD", + [3]byte{0, 22, 86}: "Nintendo Co., Ltd.", + [3]byte{0, 22, 87}: "Aegate Ltd", + [3]byte{0, 22, 88}: "Fusiontech Technologies Inc.", + [3]byte{0, 22, 89}: "Z.M.P. RADWAG", + [3]byte{0, 22, 90}: "Harman Specialty Group", + [3]byte{0, 22, 91}: "Grip Audio", + [3]byte{0, 22, 92}: "Trackflow Ltd", + [3]byte{0, 22, 93}: "AirDefense, Inc.", + [3]byte{0, 22, 94}: "Precision I/O", + [3]byte{0, 22, 95}: "Fairmount Automation", + [3]byte{0, 22, 96}: "Nortel", + [3]byte{0, 22, 97}: "Novatium Solutions (P) Ltd", + [3]byte{0, 22, 98}: "Liyuh Technology Ltd.", + [3]byte{0, 22, 99}: "KBT Mobile", + [3]byte{0, 22, 100}: "Prod-El SpA", + [3]byte{0, 22, 101}: "Cellon France", + [3]byte{0, 22, 102}: "Quantier Communication Inc.", + [3]byte{0, 22, 103}: "A-TEC Subsystem INC.", + [3]byte{0, 22, 104}: "Eishin Electronics", + [3]byte{0, 22, 105}: "MRV Communication (Networks) LTD", + [3]byte{0, 22, 106}: "TPS", + [3]byte{0, 22, 107}: "Samsung Electronics", + [3]byte{0, 22, 108}: "Samsung Electonics Digital Video System Division", + [3]byte{0, 22, 109}: "Yulong Computer Telecommunication Scientific(shenzhen)Co.,Lt", + [3]byte{0, 22, 110}: "Arbitron Inc.", + [3]byte{0, 22, 111}: "Intel Corporate", + [3]byte{0, 22, 112}: "SKNET Corporation", + [3]byte{0, 22, 113}: "Symphox Information Co.", + [3]byte{0, 22, 114}: "Zenway enterprise ltd", + [3]byte{0, 22, 115}: "Bury GmbH & Co. KG", + [3]byte{0, 22, 116}: "EuroCB (Phils.), Inc.", + [3]byte{0, 22, 117}: "ARRIS Group, Inc.", + [3]byte{0, 22, 118}: "Intel Corporate", + [3]byte{0, 22, 119}: "Bihl + Wiedemann GmbH", + [3]byte{0, 22, 120}: "SHENZHEN BAOAN GAOKE ELECTRONICS CO., LTD", + [3]byte{0, 22, 121}: "eOn Communications", + [3]byte{0, 22, 122}: "Skyworth Overseas Dvelopment Ltd.", + [3]byte{0, 22, 123}: "Haver&Boecker", + [3]byte{0, 22, 124}: "iRex Technologies BV", + [3]byte{0, 22, 125}: "Sky-Line Information Co., Ltd.", + [3]byte{0, 22, 126}: "DIBOSS.CO.,LTD", + [3]byte{0, 22, 127}: "Bluebird Soft Inc.", + [3]byte{0, 22, 128}: "Bally Gaming + Systems", + [3]byte{0, 22, 129}: "Vector Informatik GmbH", + [3]byte{0, 22, 130}: "Pro Dex, Inc", + [3]byte{0, 22, 131}: "WEBIO International Co.,.Ltd.", + [3]byte{0, 22, 132}: "Donjin Co.,Ltd.", + [3]byte{0, 22, 133}: "Elisa Oyj", + [3]byte{0, 22, 134}: "Karl Storz Imaging", + [3]byte{0, 22, 135}: "Chubb CSC-Vendor AP", + [3]byte{0, 22, 136}: "ServerEngines LLC", + [3]byte{0, 22, 137}: "Pilkor Electronics Co., Ltd", + [3]byte{0, 22, 138}: "id-Confirm Inc", + [3]byte{0, 22, 139}: "Paralan Corporation", + [3]byte{0, 22, 140}: "DSL Partner AS", + [3]byte{0, 22, 141}: "KORWIN CO., Ltd.", + [3]byte{0, 22, 142}: "Vimicro corporation", + [3]byte{0, 22, 143}: "GN Netcom as", + [3]byte{0, 22, 144}: "J-TEK INCORPORATION", + [3]byte{0, 22, 145}: "Moser-Baer AG", + [3]byte{0, 22, 146}: "Scientific-Atlanta, Inc.", + [3]byte{0, 22, 147}: "PowerLink Technology Inc.", + [3]byte{0, 22, 148}: "Sennheiser Communications A/S", + [3]byte{0, 22, 149}: "AVC Technology (International) Limited", + [3]byte{0, 22, 150}: "QDI Technology (H.K.) Limited", + [3]byte{0, 22, 151}: "NEC Corporation", + [3]byte{0, 22, 152}: "T&A Mobile Phones", + [3]byte{0, 22, 153}: "Tonic DVB Marketing Ltd", + [3]byte{0, 22, 154}: "Quadrics Ltd", + [3]byte{0, 22, 155}: "Alstom Transport", + [3]byte{0, 22, 156}: "CISCO SYSTEMS, INC.", + [3]byte{0, 22, 157}: "CISCO SYSTEMS, INC.", + [3]byte{0, 22, 158}: "TV One Ltd", + [3]byte{0, 22, 159}: "Vimtron Electronics Co., Ltd.", + [3]byte{0, 22, 160}: "Auto-Maskin", + [3]byte{0, 22, 161}: "3Leaf Networks", + [3]byte{0, 22, 162}: "CentraLite Systems, Inc.", + [3]byte{0, 22, 163}: "Ingeteam Transmission&Distribution, S.A.", + [3]byte{0, 22, 164}: "Ezurio Ltd", + [3]byte{0, 22, 165}: "Tandberg Storage ASA", + [3]byte{0, 22, 166}: "Dovado FZ-LLC", + [3]byte{0, 22, 167}: "AWETA G&P", + [3]byte{0, 22, 168}: "CWT CO., LTD.", + [3]byte{0, 22, 169}: "2EI", + [3]byte{0, 22, 170}: "Kei Communication Technology Inc.", + [3]byte{0, 22, 171}: "Dansensor A/S", + [3]byte{0, 22, 172}: "Toho Technology Corp.", + [3]byte{0, 22, 173}: "BT-Links Company Limited", + [3]byte{0, 22, 174}: "INVENTEL", + [3]byte{0, 22, 175}: "Shenzhen Union Networks Equipment Co.,Ltd.", + [3]byte{0, 22, 176}: "VK Corporation", + [3]byte{0, 22, 177}: "KBS", + [3]byte{0, 22, 178}: "DriveCam Inc", + [3]byte{0, 22, 179}: "Photonicbridges (China) Co., Ltd.", + [3]byte{0, 22, 180}: "PRIVATE", + [3]byte{0, 22, 181}: "ARRIS Group, Inc.", + [3]byte{0, 22, 182}: "Cisco-Linksys", + [3]byte{0, 22, 183}: "Seoul Commtech", + [3]byte{0, 22, 184}: "Sony Ericsson Mobile Communications", + [3]byte{0, 22, 185}: "ProCurve Networking", + [3]byte{0, 22, 186}: "WEATHERNEWS INC.", + [3]byte{0, 22, 187}: "Law-Chain Computer Technology Co Ltd", + [3]byte{0, 22, 188}: "Nokia Danmark A/S", + [3]byte{0, 22, 189}: "ATI Industrial Automation", + [3]byte{0, 22, 190}: "INFRANET, Inc.", + [3]byte{0, 22, 191}: "PaloDEx Group Oy", + [3]byte{0, 22, 192}: "Semtech Corporation", + [3]byte{0, 22, 193}: "Eleksen Ltd", + [3]byte{0, 22, 194}: "Avtec Systems Inc", + [3]byte{0, 22, 195}: "BA Systems Inc", + [3]byte{0, 22, 196}: "SiRF Technology, Inc.", + [3]byte{0, 22, 197}: "Shenzhen Xing Feng Industry Co.,Ltd", + [3]byte{0, 22, 198}: "North Atlantic Industries", + [3]byte{0, 22, 199}: "CISCO SYSTEMS, INC.", + [3]byte{0, 22, 200}: "CISCO SYSTEMS, INC.", + [3]byte{0, 22, 201}: "NAT Seattle, Inc.", + [3]byte{0, 22, 202}: "Nortel", + [3]byte{0, 22, 203}: "Apple", + [3]byte{0, 22, 204}: "Xcute Mobile Corp.", + [3]byte{0, 22, 205}: "HIJI HIGH-TECH CO., LTD.", + [3]byte{0, 22, 206}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 22, 207}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 22, 208}: "ATech elektronika d.o.o.", + [3]byte{0, 22, 209}: "ZAT a.s.", + [3]byte{0, 22, 210}: "Caspian", + [3]byte{0, 22, 211}: "Wistron Corporation", + [3]byte{0, 22, 212}: "Compal Communications, Inc.", + [3]byte{0, 22, 213}: "Synccom Co., Ltd", + [3]byte{0, 22, 214}: "TDA Tech Pty Ltd", + [3]byte{0, 22, 215}: "Sunways AG", + [3]byte{0, 22, 216}: "Senea AB", + [3]byte{0, 22, 217}: "NINGBO BIRD CO.,LTD.", + [3]byte{0, 22, 218}: "Futronic Technology Co. Ltd.", + [3]byte{0, 22, 219}: "Samsung Electronics Co., Ltd.", + [3]byte{0, 22, 220}: "ARCHOS", + [3]byte{0, 22, 221}: "Gigabeam Corporation", + [3]byte{0, 22, 222}: "FAST Inc", + [3]byte{0, 22, 223}: "Lundinova AB", + [3]byte{0, 22, 224}: "3Com Ltd", + [3]byte{0, 22, 225}: "SiliconStor, Inc.", + [3]byte{0, 22, 226}: "American Fibertek, Inc.", + [3]byte{0, 22, 227}: "ASKEY COMPUTER CORP.", + [3]byte{0, 22, 228}: "VANGUARD SECURITY ENGINEERING CORP.", + [3]byte{0, 22, 229}: "FORDLEY DEVELOPMENT LIMITED", + [3]byte{0, 22, 230}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{0, 22, 231}: "Dynamix Promotions Limited", + [3]byte{0, 22, 232}: "Sigma Designs, Inc.", + [3]byte{0, 22, 233}: "Tiba Medical Inc", + [3]byte{0, 22, 234}: "Intel Corporate", + [3]byte{0, 22, 235}: "Intel Corporate", + [3]byte{0, 22, 236}: "Elitegroup Computer Systems Co., Ltd.", + [3]byte{0, 22, 237}: "Digital Safety Technologies, Inc", + [3]byte{0, 22, 238}: "RoyalDigital Inc.", + [3]byte{0, 22, 239}: "Koko Fitness, Inc.", + [3]byte{0, 22, 240}: "Dell", + [3]byte{0, 22, 241}: "OmniSense, LLC", + [3]byte{0, 22, 242}: "Dmobile System Co., Ltd.", + [3]byte{0, 22, 243}: "CAST Information Co., Ltd", + [3]byte{0, 22, 244}: "Eidicom Co., Ltd.", + [3]byte{0, 22, 245}: "Dalian Golden Hualu Digital Technology Co.,Ltd", + [3]byte{0, 22, 246}: "Video Products Group", + [3]byte{0, 22, 247}: "L-3 Communications, Aviation Recorders", + [3]byte{0, 22, 248}: "AVIQTECH TECHNOLOGY CO., LTD.", + [3]byte{0, 22, 249}: "CETRTA POT, d.o.o., Kranj", + [3]byte{0, 22, 250}: "ECI Telecom Ltd.", + [3]byte{0, 22, 251}: "SHENZHEN MTC CO.,LTD.", + [3]byte{0, 22, 252}: "TOHKEN CO.,LTD.", + [3]byte{0, 22, 253}: "Jaty Electronics", + [3]byte{0, 22, 254}: "Alps Electric Co., Ltd", + [3]byte{0, 22, 255}: "Wamin Optocomm Mfg Corp", + [3]byte{0, 23, 0}: "ARRIS Group, Inc.", + [3]byte{0, 23, 1}: "KDE, Inc.", + [3]byte{0, 23, 2}: "Osung Midicom Co., Ltd", + [3]byte{0, 23, 3}: "MOSDAN Internation Co.,Ltd", + [3]byte{0, 23, 4}: "Shinco Electronics Group Co.,Ltd", + [3]byte{0, 23, 5}: "Methode Electronics", + [3]byte{0, 23, 6}: "Techfaith Wireless Communication Technology Limited.", + [3]byte{0, 23, 7}: "InGrid, Inc", + [3]byte{0, 23, 8}: "Hewlett-Packard Company", + [3]byte{0, 23, 9}: "Exalt Communications", + [3]byte{0, 23, 10}: "INEW DIGITAL COMPANY", + [3]byte{0, 23, 11}: "Contela, Inc.", + [3]byte{0, 23, 12}: "Twig Com Ltd.", + [3]byte{0, 23, 13}: "Dust Networks Inc.", + [3]byte{0, 23, 14}: "CISCO SYSTEMS, INC.", + [3]byte{0, 23, 15}: "CISCO SYSTEMS, INC.", + [3]byte{0, 23, 16}: "Casa Systems Inc.", + [3]byte{0, 23, 17}: "GE Healthcare Bio-Sciences AB", + [3]byte{0, 23, 18}: "ISCO International", + [3]byte{0, 23, 19}: "Tiger NetCom", + [3]byte{0, 23, 20}: "BR Controls Nederland bv", + [3]byte{0, 23, 21}: "Qstik", + [3]byte{0, 23, 22}: "Qno Technology Inc.", + [3]byte{0, 23, 23}: "Leica Geosystems AG", + [3]byte{0, 23, 24}: "Vansco Electronics Oy", + [3]byte{0, 23, 25}: "AudioCodes USA, Inc", + [3]byte{0, 23, 26}: "Winegard Company", + [3]byte{0, 23, 27}: "Innovation Lab Corp.", + [3]byte{0, 23, 28}: "NT MicroSystems, Inc.", + [3]byte{0, 23, 29}: "DIGIT", + [3]byte{0, 23, 30}: "Theo Benning GmbH & Co. KG", + [3]byte{0, 23, 31}: "IMV Corporation", + [3]byte{0, 23, 32}: "Image Sensing Systems, Inc.", + [3]byte{0, 23, 33}: "FITRE S.p.A.", + [3]byte{0, 23, 34}: "Hanazeder Electronic GmbH", + [3]byte{0, 23, 35}: "Summit Data Communications", + [3]byte{0, 23, 36}: "Studer Professional Audio GmbH", + [3]byte{0, 23, 37}: "Liquid Computing", + [3]byte{0, 23, 38}: "m2c Electronic Technology Ltd.", + [3]byte{0, 23, 39}: "Thermo Ramsey Italia s.r.l.", + [3]byte{0, 23, 40}: "Selex Communications", + [3]byte{0, 23, 41}: "Ubicod Co.LTD", + [3]byte{0, 23, 42}: "Proware Technology Corp.(By Unifosa)", + [3]byte{0, 23, 43}: "Global Technologies Inc.", + [3]byte{0, 23, 44}: "TAEJIN INFOTECH", + [3]byte{0, 23, 45}: "Axcen Photonics Corporation", + [3]byte{0, 23, 46}: "FXC Inc.", + [3]byte{0, 23, 47}: "NeuLion Incorporated", + [3]byte{0, 23, 48}: "Automation Electronics", + [3]byte{0, 23, 49}: "ASUSTek COMPUTER INC.", + [3]byte{0, 23, 50}: "Science-Technical Center \"RISSA\"", + [3]byte{0, 23, 51}: "SFR", + [3]byte{0, 23, 52}: "ADC Telecommunications", + [3]byte{0, 23, 53}: "PRIVATE", + [3]byte{0, 23, 54}: "iiTron Inc.", + [3]byte{0, 23, 55}: "Industrie Dial Face S.p.A.", + [3]byte{0, 23, 56}: "International Business Machines", + [3]byte{0, 23, 57}: "Bright Headphone Electronics Company", + [3]byte{0, 23, 58}: "Reach Systems Inc.", + [3]byte{0, 23, 59}: "Cisco Systems, Inc.", + [3]byte{0, 23, 60}: "Extreme Engineering Solutions", + [3]byte{0, 23, 61}: "Neology", + [3]byte{0, 23, 62}: "LeucotronEquipamentos Ltda.", + [3]byte{0, 23, 63}: "Belkin Corporation", + [3]byte{0, 23, 64}: "Bluberi Gaming Technologies Inc", + [3]byte{0, 23, 65}: "DEFIDEV", + [3]byte{0, 23, 66}: "FUJITSU LIMITED", + [3]byte{0, 23, 67}: "Deck Srl", + [3]byte{0, 23, 68}: "Araneo Ltd.", + [3]byte{0, 23, 69}: "INNOTZ CO., Ltd", + [3]byte{0, 23, 70}: "Freedom9 Inc.", + [3]byte{0, 23, 71}: "Trimble", + [3]byte{0, 23, 72}: "Neokoros Brasil Ltda", + [3]byte{0, 23, 73}: "HYUNDAE YONG-O-SA CO.,LTD", + [3]byte{0, 23, 74}: "SOCOMEC", + [3]byte{0, 23, 75}: "Nokia Danmark A/S", + [3]byte{0, 23, 76}: "Millipore", + [3]byte{0, 23, 77}: "DYNAMIC NETWORK FACTORY, INC.", + [3]byte{0, 23, 78}: "Parama-tech Co.,Ltd.", + [3]byte{0, 23, 79}: "iCatch Inc.", + [3]byte{0, 23, 80}: "GSI Group, MicroE Systems", + [3]byte{0, 23, 81}: "Online Corporation", + [3]byte{0, 23, 82}: "DAGS, Inc", + [3]byte{0, 23, 83}: "nFore Technology Inc.", + [3]byte{0, 23, 84}: "Arkino HiTOP Corporation Limited", + [3]byte{0, 23, 85}: "GE Security", + [3]byte{0, 23, 86}: "Vinci Labs Oy", + [3]byte{0, 23, 87}: "RIX TECHNOLOGY LIMITED", + [3]byte{0, 23, 88}: "ThruVision Ltd", + [3]byte{0, 23, 89}: "CISCO SYSTEMS, INC.", + [3]byte{0, 23, 90}: "CISCO SYSTEMS, INC.", + [3]byte{0, 23, 91}: "ACS Solutions Switzerland Ltd.", + [3]byte{0, 23, 92}: "SHARP CORPORATION", + [3]byte{0, 23, 93}: "Dongseo system.", + [3]byte{0, 23, 94}: "Zed-3", + [3]byte{0, 23, 95}: "XENOLINK Communications Co., Ltd.", + [3]byte{0, 23, 96}: "Naito Densei Machida MFG.CO.,LTD", + [3]byte{0, 23, 97}: "PRIVATE", + [3]byte{0, 23, 98}: "Solar Technology, Inc.", + [3]byte{0, 23, 99}: "Essentia S.p.A.", + [3]byte{0, 23, 100}: "ATMedia GmbH", + [3]byte{0, 23, 101}: "Nortel", + [3]byte{0, 23, 102}: "Accense Technology, Inc.", + [3]byte{0, 23, 103}: "Earforce AS", + [3]byte{0, 23, 104}: "Zinwave Ltd", + [3]byte{0, 23, 105}: "Cymphonix Corp", + [3]byte{0, 23, 106}: "Avago Technologies", + [3]byte{0, 23, 107}: "Kiyon, Inc.", + [3]byte{0, 23, 108}: "Pivot3, Inc.", + [3]byte{0, 23, 109}: "CORE CORPORATION", + [3]byte{0, 23, 110}: "DUCATI SISTEMI", + [3]byte{0, 23, 111}: "PAX Computer Technology(Shenzhen) Ltd.", + [3]byte{0, 23, 112}: "Arti Industrial Electronics Ltd.", + [3]byte{0, 23, 113}: "APD Communications Ltd", + [3]byte{0, 23, 114}: "ASTRO Strobel Kommunikationssysteme GmbH", + [3]byte{0, 23, 115}: "Laketune Technologies Co. Ltd", + [3]byte{0, 23, 116}: "Elesta GmbH", + [3]byte{0, 23, 117}: "TTE Germany GmbH", + [3]byte{0, 23, 118}: "Meso Scale Diagnostics, LLC", + [3]byte{0, 23, 119}: "Obsidian Research Corporation", + [3]byte{0, 23, 120}: "Central Music Co.", + [3]byte{0, 23, 121}: "QuickTel", + [3]byte{0, 23, 122}: "ASSA ABLOY AB", + [3]byte{0, 23, 123}: "Azalea Networks inc", + [3]byte{0, 23, 124}: "Smartlink Network Systems Limited", + [3]byte{0, 23, 125}: "IDT International Limited", + [3]byte{0, 23, 126}: "Meshcom Technologies Inc.", + [3]byte{0, 23, 127}: "Worldsmart Retech", + [3]byte{0, 23, 128}: "Applied Biosystems B.V.", + [3]byte{0, 23, 129}: "Greystone Data System, Inc.", + [3]byte{0, 23, 130}: "LoBenn Inc.", + [3]byte{0, 23, 131}: "Texas Instruments", + [3]byte{0, 23, 132}: "ARRIS Group, Inc.", + [3]byte{0, 23, 133}: "Sparr Electronics Ltd", + [3]byte{0, 23, 134}: "wisembed", + [3]byte{0, 23, 135}: "Brother, Brother & Sons ApS", + [3]byte{0, 23, 136}: "Philips Lighting BV", + [3]byte{0, 23, 137}: "Zenitron Corporation", + [3]byte{0, 23, 138}: "DARTS TECHNOLOGIES CORP.", + [3]byte{0, 23, 139}: "Teledyne Technologies Incorporated", + [3]byte{0, 23, 140}: "Independent Witness, Inc", + [3]byte{0, 23, 141}: "Checkpoint Systems, Inc.", + [3]byte{0, 23, 142}: "Gunnebo Cash Automation AB", + [3]byte{0, 23, 143}: "NINGBO YIDONG ELECTRONIC CO.,LTD.", + [3]byte{0, 23, 144}: "HYUNDAI DIGITECH Co, Ltd.", + [3]byte{0, 23, 145}: "LinTech GmbH", + [3]byte{0, 23, 146}: "Falcom Wireless Comunications Gmbh", + [3]byte{0, 23, 147}: "Tigi Corporation", + [3]byte{0, 23, 148}: "CISCO SYSTEMS, INC.", + [3]byte{0, 23, 149}: "CISCO SYSTEMS, INC.", + [3]byte{0, 23, 150}: "Rittmeyer AG", + [3]byte{0, 23, 151}: "Telsy Elettronica S.p.A.", + [3]byte{0, 23, 152}: "Azonic Technology Co., LTD", + [3]byte{0, 23, 153}: "SmarTire Systems Inc.", + [3]byte{0, 23, 154}: "D-Link Corporation", + [3]byte{0, 23, 155}: "Chant Sincere CO., LTD.", + [3]byte{0, 23, 156}: "DEPRAG SCHULZ GMBH u. CO.", + [3]byte{0, 23, 157}: "Kelman Limited", + [3]byte{0, 23, 158}: "Sirit Inc", + [3]byte{0, 23, 159}: "Apricorn", + [3]byte{0, 23, 160}: "RoboTech srl", + [3]byte{0, 23, 161}: "3soft inc.", + [3]byte{0, 23, 162}: "Camrivox Ltd.", + [3]byte{0, 23, 163}: "MIX s.r.l.", + [3]byte{0, 23, 164}: "Hewlett-Packard Company", + [3]byte{0, 23, 165}: "Ralink Technology Corp", + [3]byte{0, 23, 166}: "YOSIN ELECTRONICS CO., LTD.", + [3]byte{0, 23, 167}: "Mobile Computing Promotion Consortium", + [3]byte{0, 23, 168}: "EDM Corporation", + [3]byte{0, 23, 169}: "Sentivision", + [3]byte{0, 23, 170}: "elab-experience inc.", + [3]byte{0, 23, 171}: "Nintendo Co., Ltd.", + [3]byte{0, 23, 172}: "O'Neil Product Development Inc.", + [3]byte{0, 23, 173}: "AceNet Corporation", + [3]byte{0, 23, 174}: "GAI-Tronics", + [3]byte{0, 23, 175}: "Enermet", + [3]byte{0, 23, 176}: "Nokia Danmark A/S", + [3]byte{0, 23, 177}: "ACIST Medical Systems, Inc.", + [3]byte{0, 23, 178}: "SK Telesys", + [3]byte{0, 23, 179}: "Aftek Infosys Limited", + [3]byte{0, 23, 180}: "Remote Security Systems, LLC", + [3]byte{0, 23, 181}: "Peerless Systems Corporation", + [3]byte{0, 23, 182}: "Aquantia", + [3]byte{0, 23, 183}: "Tonze Technology Co.", + [3]byte{0, 23, 184}: "NOVATRON CO., LTD.", + [3]byte{0, 23, 185}: "Gambro Lundia AB", + [3]byte{0, 23, 186}: "SEDO CO., LTD.", + [3]byte{0, 23, 187}: "Syrinx Industrial Electronics", + [3]byte{0, 23, 188}: "Touchtunes Music Corporation", + [3]byte{0, 23, 189}: "Tibetsystem", + [3]byte{0, 23, 190}: "Tratec Telecom B.V.", + [3]byte{0, 23, 191}: "Coherent Research Limited", + [3]byte{0, 23, 192}: "PureTech Systems, Inc.", + [3]byte{0, 23, 193}: "CM Precision Technology LTD.", + [3]byte{0, 23, 194}: "ADB Broadband Italia", + [3]byte{0, 23, 195}: "KTF Technologies Inc.", + [3]byte{0, 23, 196}: "Quanta Microsystems, INC.", + [3]byte{0, 23, 197}: "SonicWALL", + [3]byte{0, 23, 198}: "Cross Match Technologies Inc", + [3]byte{0, 23, 199}: "MARA Systems Consulting AB", + [3]byte{0, 23, 200}: "KYOCERA Document Solutions Inc.", + [3]byte{0, 23, 201}: "Samsung Electronics Co., Ltd.", + [3]byte{0, 23, 202}: "Qisda Corporation", + [3]byte{0, 23, 203}: "Juniper Networks", + [3]byte{0, 23, 204}: "Alcatel-Lucent", + [3]byte{0, 23, 205}: "CEC Wireless R&D Ltd.", + [3]byte{0, 23, 206}: "Screen Service Spa", + [3]byte{0, 23, 207}: "iMCA-GmbH", + [3]byte{0, 23, 208}: "Opticom Communications, LLC", + [3]byte{0, 23, 209}: "Nortel", + [3]byte{0, 23, 210}: "THINLINX PTY LTD", + [3]byte{0, 23, 211}: "Etymotic Research, Inc.", + [3]byte{0, 23, 212}: "Monsoon Multimedia, Inc", + [3]byte{0, 23, 213}: "Samsung Electronics Co., Ltd.", + [3]byte{0, 23, 214}: "Bluechips Microhouse Co.,Ltd.", + [3]byte{0, 23, 215}: "ION Geophysical Corporation Inc.", + [3]byte{0, 23, 216}: "Magnum Semiconductor, Inc.", + [3]byte{0, 23, 217}: "AAI Corporation", + [3]byte{0, 23, 218}: "Spans Logic", + [3]byte{0, 23, 219}: "CANKO TECHNOLOGIES INC.", + [3]byte{0, 23, 220}: "DAEMYUNG ZERO1", + [3]byte{0, 23, 221}: "Clipsal Australia", + [3]byte{0, 23, 222}: "Advantage Six Ltd", + [3]byte{0, 23, 223}: "CISCO SYSTEMS, INC.", + [3]byte{0, 23, 224}: "CISCO SYSTEMS, INC.", + [3]byte{0, 23, 225}: "DACOS Technologies Co., Ltd.", + [3]byte{0, 23, 226}: "ARRIS Group, Inc.", + [3]byte{0, 23, 227}: "Texas Instruments", + [3]byte{0, 23, 228}: "Texas Instruments", + [3]byte{0, 23, 229}: "Texas Instruments", + [3]byte{0, 23, 230}: "Texas Instruments", + [3]byte{0, 23, 231}: "Texas Instruments", + [3]byte{0, 23, 232}: "Texas Instruments", + [3]byte{0, 23, 233}: "Texas Instruments", + [3]byte{0, 23, 234}: "Texas Instruments", + [3]byte{0, 23, 235}: "Texas Instruments", + [3]byte{0, 23, 236}: "Texas Instruments", + [3]byte{0, 23, 237}: "WooJooIT Ltd.", + [3]byte{0, 23, 238}: "ARRIS Group, Inc.", + [3]byte{0, 23, 239}: "IBM Corp", + [3]byte{0, 23, 240}: "SZCOM Broadband Network Technology Co.,Ltd", + [3]byte{0, 23, 241}: "Renu Electronics Pvt Ltd", + [3]byte{0, 23, 242}: "Apple", + [3]byte{0, 23, 243}: "Harris Corparation", + [3]byte{0, 23, 244}: "ZERON ALLIANCE", + [3]byte{0, 23, 245}: "LIG NEOPTEK", + [3]byte{0, 23, 246}: "Pyramid Meriden Inc.", + [3]byte{0, 23, 247}: "CEM Solutions Pvt Ltd", + [3]byte{0, 23, 248}: "Motech Industries Inc.", + [3]byte{0, 23, 249}: "Forcom Sp. z o.o.", + [3]byte{0, 23, 250}: "Microsoft Corporation", + [3]byte{0, 23, 251}: "FA", + [3]byte{0, 23, 252}: "Suprema Inc.", + [3]byte{0, 23, 253}: "Amulet Hotkey", + [3]byte{0, 23, 254}: "TALOS SYSTEM INC.", + [3]byte{0, 23, 255}: "PLAYLINE Co.,Ltd.", + [3]byte{0, 24, 0}: "UNIGRAND LTD", + [3]byte{0, 24, 1}: "Actiontec Electronics, Inc", + [3]byte{0, 24, 2}: "Alpha Networks Inc.", + [3]byte{0, 24, 3}: "ArcSoft Shanghai Co. LTD", + [3]byte{0, 24, 4}: "E-TEK DIGITAL TECHNOLOGY LIMITED", + [3]byte{0, 24, 5}: "Beijing InHand Networking Technology Co.,Ltd.", + [3]byte{0, 24, 6}: "Hokkei Industries Co., Ltd.", + [3]byte{0, 24, 7}: "Fanstel Corp.", + [3]byte{0, 24, 8}: "SightLogix, Inc.", + [3]byte{0, 24, 9}: "CRESYN", + [3]byte{0, 24, 10}: "Meraki, Inc.", + [3]byte{0, 24, 11}: "Brilliant Telecommunications", + [3]byte{0, 24, 12}: "Optelian Access Networks", + [3]byte{0, 24, 13}: "Terabytes Server Storage Tech Corp", + [3]byte{0, 24, 14}: "Avega Systems", + [3]byte{0, 24, 15}: "Nokia Danmark A/S", + [3]byte{0, 24, 16}: "IPTrade S.A.", + [3]byte{0, 24, 17}: "Neuros Technology International, LLC.", + [3]byte{0, 24, 18}: "Beijing Xinwei Telecom Technology Co., Ltd.", + [3]byte{0, 24, 19}: "Sony Ericsson Mobile Communications", + [3]byte{0, 24, 20}: "Mitutoyo Corporation", + [3]byte{0, 24, 21}: "GZ Technologies, Inc.", + [3]byte{0, 24, 22}: "Ubixon Co., Ltd.", + [3]byte{0, 24, 23}: "D. E. Shaw Research, LLC", + [3]byte{0, 24, 24}: "CISCO SYSTEMS, INC.", + [3]byte{0, 24, 25}: "CISCO SYSTEMS, INC.", + [3]byte{0, 24, 26}: "AVerMedia Information Inc.", + [3]byte{0, 24, 27}: "TaiJin Metal Co., Ltd.", + [3]byte{0, 24, 28}: "Exterity Limited", + [3]byte{0, 24, 29}: "ASIA ELECTRONICS CO.,LTD", + [3]byte{0, 24, 30}: "GDX Technologies Ltd.", + [3]byte{0, 24, 31}: "Palmmicro Communications", + [3]byte{0, 24, 32}: "w5networks", + [3]byte{0, 24, 33}: "SINDORICOH", + [3]byte{0, 24, 34}: "CEC TELECOM CO.,LTD.", + [3]byte{0, 24, 35}: "Delta Electronics, Inc.", + [3]byte{0, 24, 36}: "Kimaldi Electronics, S.L.", + [3]byte{0, 24, 37}: "PRIVATE", + [3]byte{0, 24, 38}: "Cale Access AB", + [3]byte{0, 24, 39}: "NEC UNIFIED SOLUTIONS NEDERLAND B.V.", + [3]byte{0, 24, 40}: "e2v technologies (UK) ltd.", + [3]byte{0, 24, 41}: "Gatsometer", + [3]byte{0, 24, 42}: "Taiwan Video & Monitor", + [3]byte{0, 24, 43}: "Softier", + [3]byte{0, 24, 44}: "Ascend Networks, Inc.", + [3]byte{0, 24, 45}: "Artec Design", + [3]byte{0, 24, 46}: "XStreamHD, LLC", + [3]byte{0, 24, 47}: "Texas Instruments", + [3]byte{0, 24, 48}: "Texas Instruments", + [3]byte{0, 24, 49}: "Texas Instruments", + [3]byte{0, 24, 50}: "Texas Instruments", + [3]byte{0, 24, 51}: "Texas Instruments", + [3]byte{0, 24, 52}: "Texas Instruments", + [3]byte{0, 24, 53}: "Thoratec / ITC", + [3]byte{0, 24, 54}: "Reliance Electric Limited", + [3]byte{0, 24, 55}: "Universal ABIT Co., Ltd.", + [3]byte{0, 24, 56}: "PanAccess Communications,Inc.", + [3]byte{0, 24, 57}: "Cisco-Linksys LLC", + [3]byte{0, 24, 58}: "Westell Technologies", + [3]byte{0, 24, 59}: "CENITS Co., Ltd.", + [3]byte{0, 24, 60}: "Encore Software Limited", + [3]byte{0, 24, 61}: "Vertex Link Corporation", + [3]byte{0, 24, 62}: "Digilent, Inc", + [3]byte{0, 24, 63}: "2Wire, Inc", + [3]byte{0, 24, 64}: "3 Phoenix, Inc.", + [3]byte{0, 24, 65}: "High Tech Computer Corp", + [3]byte{0, 24, 66}: "Nokia Danmark A/S", + [3]byte{0, 24, 67}: "Dawevision Ltd", + [3]byte{0, 24, 68}: "Heads Up Technologies, Inc.", + [3]byte{0, 24, 69}: "Pulsar-Telecom LLC.", + [3]byte{0, 24, 70}: "Crypto S.A.", + [3]byte{0, 24, 71}: "AceNet Technology Inc.", + [3]byte{0, 24, 72}: "Vecima Networks Inc.", + [3]byte{0, 24, 73}: "Pigeon Point Systems LLC", + [3]byte{0, 24, 74}: "Catcher, Inc.", + [3]byte{0, 24, 75}: "Las Vegas Gaming, Inc.", + [3]byte{0, 24, 76}: "Bogen Communications", + [3]byte{0, 24, 77}: "Netgear Inc.", + [3]byte{0, 24, 78}: "Lianhe Technologies, Inc.", + [3]byte{0, 24, 79}: "8 Ways Technology Corp.", + [3]byte{0, 24, 80}: "Secfone Kft", + [3]byte{0, 24, 81}: "SWsoft", + [3]byte{0, 24, 82}: "StorLink Semiconductors, Inc.", + [3]byte{0, 24, 83}: "Atera Networks LTD.", + [3]byte{0, 24, 84}: "Argard Co., Ltd", + [3]byte{0, 24, 85}: "Aeromaritime Systembau GmbH", + [3]byte{0, 24, 86}: "EyeFi, Inc", + [3]byte{0, 24, 87}: "Unilever R&D", + [3]byte{0, 24, 88}: "TagMaster AB", + [3]byte{0, 24, 89}: "Strawberry Linux Co.,Ltd.", + [3]byte{0, 24, 90}: "uControl, Inc.", + [3]byte{0, 24, 91}: "Network Chemistry, Inc", + [3]byte{0, 24, 92}: "EDS Lab Pte Ltd", + [3]byte{0, 24, 93}: "TAIGUEN TECHNOLOGY (SHEN-ZHEN) CO., LTD.", + [3]byte{0, 24, 94}: "Nexterm Inc.", + [3]byte{0, 24, 95}: "TAC Inc.", + [3]byte{0, 24, 96}: "SIM Technology Group Shanghai Simcom Ltd.,", + [3]byte{0, 24, 97}: "Ooma, Inc.", + [3]byte{0, 24, 98}: "Seagate Technology", + [3]byte{0, 24, 99}: "Veritech Electronics Limited", + [3]byte{0, 24, 100}: "Eaton Corporation", + [3]byte{0, 24, 101}: "Siemens Healthcare Diagnostics Manufacturing Ltd", + [3]byte{0, 24, 102}: "Leutron Vision", + [3]byte{0, 24, 103}: "Datalogic ADC", + [3]byte{0, 24, 104}: "Scientific Atlanta, A Cisco Company", + [3]byte{0, 24, 105}: "KINGJIM", + [3]byte{0, 24, 106}: "Global Link Digital Technology Co,.LTD", + [3]byte{0, 24, 107}: "Sambu Communics CO., LTD.", + [3]byte{0, 24, 108}: "Neonode AB", + [3]byte{0, 24, 109}: "Zhenjiang Sapphire Electronic Industry CO.", + [3]byte{0, 24, 110}: "3Com Ltd", + [3]byte{0, 24, 111}: "Setha Industria Eletronica LTDA", + [3]byte{0, 24, 112}: "E28 Shanghai Limited", + [3]byte{0, 24, 113}: "Hewlett-Packard Company", + [3]byte{0, 24, 114}: "Expertise Engineering", + [3]byte{0, 24, 115}: "CISCO SYSTEMS, INC.", + [3]byte{0, 24, 116}: "CISCO SYSTEMS, INC.", + [3]byte{0, 24, 117}: "AnaCise Testnology Pte Ltd", + [3]byte{0, 24, 118}: "WowWee Ltd.", + [3]byte{0, 24, 119}: "Amplex A/S", + [3]byte{0, 24, 120}: "Mackware GmbH", + [3]byte{0, 24, 121}: "dSys", + [3]byte{0, 24, 122}: "Wiremold", + [3]byte{0, 24, 123}: "4NSYS Co. Ltd.", + [3]byte{0, 24, 124}: "INTERCROSS, LLC", + [3]byte{0, 24, 125}: "Armorlink shanghai Co. Ltd", + [3]byte{0, 24, 126}: "RGB Spectrum", + [3]byte{0, 24, 127}: "ZODIANET", + [3]byte{0, 24, 128}: "Maxim Integrated Products", + [3]byte{0, 24, 129}: "Buyang Electronics Industrial Co., Ltd", + [3]byte{0, 24, 130}: "Huawei Technologies Co., Ltd.", + [3]byte{0, 24, 131}: "FORMOSA21 INC.", + [3]byte{0, 24, 132}: "Fon Technology S.L.", + [3]byte{0, 24, 133}: "Avigilon Corporation", + [3]byte{0, 24, 134}: "EL-TECH, INC.", + [3]byte{0, 24, 135}: "Metasystem SpA", + [3]byte{0, 24, 136}: "GOTIVE a.s.", + [3]byte{0, 24, 137}: "WinNet Solutions Limited", + [3]byte{0, 24, 138}: "Infinova LLC", + [3]byte{0, 24, 139}: "Dell Inc", + [3]byte{0, 24, 140}: "Mobile Action Technology Inc.", + [3]byte{0, 24, 141}: "Nokia Danmark A/S", + [3]byte{0, 24, 142}: "Ekahau, Inc.", + [3]byte{0, 24, 143}: "Montgomery Technology, Inc.", + [3]byte{0, 24, 144}: "RadioCOM, s.r.o.", + [3]byte{0, 24, 145}: "Zhongshan General K-mate Electronics Co., Ltd", + [3]byte{0, 24, 146}: "ads-tec GmbH", + [3]byte{0, 24, 147}: "SHENZHEN PHOTON BROADBAND TECHNOLOGY CO.,LTD", + [3]byte{0, 24, 148}: "NPCore, Inc.", + [3]byte{0, 24, 149}: "Hansun Technologies Inc.", + [3]byte{0, 24, 150}: "Great Well Electronic LTD", + [3]byte{0, 24, 151}: "JESS-LINK PRODUCTS Co., LTD", + [3]byte{0, 24, 152}: "KINGSTATE ELECTRONICS CORPORATION", + [3]byte{0, 24, 153}: "ShenZhen jieshun Science&Technology Industry CO,LTD.", + [3]byte{0, 24, 154}: "HANA Micron Inc.", + [3]byte{0, 24, 155}: "Thomson Inc.", + [3]byte{0, 24, 156}: "Weldex Corporation", + [3]byte{0, 24, 157}: "Navcast Inc.", + [3]byte{0, 24, 158}: "OMNIKEY GmbH.", + [3]byte{0, 24, 159}: "Lenntek Corporation", + [3]byte{0, 24, 160}: "Cierma Ascenseurs", + [3]byte{0, 24, 161}: "Tiqit Computers, Inc.", + [3]byte{0, 24, 162}: "XIP Technology AB", + [3]byte{0, 24, 163}: "ZIPPY TECHNOLOGY CORP.", + [3]byte{0, 24, 164}: "ARRIS Group, Inc.", + [3]byte{0, 24, 165}: "ADigit Technologies Corp.", + [3]byte{0, 24, 166}: "Persistent Systems, LLC", + [3]byte{0, 24, 167}: "Yoggie Security Systems LTD.", + [3]byte{0, 24, 168}: "AnNeal Technology Inc.", + [3]byte{0, 24, 169}: "Ethernet Direct Corporation", + [3]byte{0, 24, 170}: "Protec Fire Detection plc", + [3]byte{0, 24, 171}: "BEIJING LHWT MICROELECTRONICS INC.", + [3]byte{0, 24, 172}: "Shanghai Jiao Da HISYS Technology Co. Ltd.", + [3]byte{0, 24, 173}: "NIDEC SANKYO CORPORATION", + [3]byte{0, 24, 174}: "TVT CO.,LTD", + [3]byte{0, 24, 175}: "Samsung Electronics Co., Ltd.", + [3]byte{0, 24, 176}: "Nortel", + [3]byte{0, 24, 177}: "IBM Corp", + [3]byte{0, 24, 178}: "ADEUNIS RF", + [3]byte{0, 24, 179}: "TEC WizHome Co., Ltd.", + [3]byte{0, 24, 180}: "Dawon Media Inc.", + [3]byte{0, 24, 181}: "Magna Carta", + [3]byte{0, 24, 182}: "S3C, Inc.", + [3]byte{0, 24, 183}: "D3 LED, LLC", + [3]byte{0, 24, 184}: "New Voice International AG", + [3]byte{0, 24, 185}: "CISCO SYSTEMS, INC.", + [3]byte{0, 24, 186}: "CISCO SYSTEMS, INC.", + [3]byte{0, 24, 187}: "Eliwell Controls srl", + [3]byte{0, 24, 188}: "ZAO NVP Bolid", + [3]byte{0, 24, 189}: "SHENZHEN DVBWORLD TECHNOLOGY CO., LTD.", + [3]byte{0, 24, 190}: "ANSA Corporation", + [3]byte{0, 24, 191}: "Essence Technology Solution, Inc.", + [3]byte{0, 24, 192}: "ARRIS Group, Inc.", + [3]byte{0, 24, 193}: "Almitec Informática e Comércio", + [3]byte{0, 24, 194}: "Firetide, Inc", + [3]byte{0, 24, 195}: "CS Corporation", + [3]byte{0, 24, 196}: "Raba Technologies LLC", + [3]byte{0, 24, 197}: "Nokia Danmark A/S", + [3]byte{0, 24, 198}: "OPW Fuel Management Systems", + [3]byte{0, 24, 199}: "Real Time Automation", + [3]byte{0, 24, 200}: "ISONAS Inc.", + [3]byte{0, 24, 201}: "EOps Technology Limited", + [3]byte{0, 24, 202}: "Viprinet GmbH", + [3]byte{0, 24, 203}: "Tecobest Technology Limited", + [3]byte{0, 24, 204}: "AXIOHM SAS", + [3]byte{0, 24, 205}: "Erae Electronics Industry Co., Ltd", + [3]byte{0, 24, 206}: "Dreamtech Co., Ltd", + [3]byte{0, 24, 207}: "Baldor Electric Company", + [3]byte{0, 24, 208}: "AtRoad, A Trimble Company", + [3]byte{0, 24, 209}: "Siemens Home & Office Comm. Devices", + [3]byte{0, 24, 210}: "High-Gain Antennas LLC", + [3]byte{0, 24, 211}: "TEAMCAST", + [3]byte{0, 24, 212}: "Unified Display Interface SIG", + [3]byte{0, 24, 213}: "REIGNCOM", + [3]byte{0, 24, 214}: "Swirlnet A/S", + [3]byte{0, 24, 215}: "Javad Navigation Systems Inc.", + [3]byte{0, 24, 216}: "ARCH METER Corporation", + [3]byte{0, 24, 217}: "Santosha Internatonal, Inc", + [3]byte{0, 24, 218}: "AMBER wireless GmbH", + [3]byte{0, 24, 219}: "EPL Technology Ltd", + [3]byte{0, 24, 220}: "Prostar Co., Ltd.", + [3]byte{0, 24, 221}: "Silicondust Engineering Ltd", + [3]byte{0, 24, 222}: "Intel Corporate", + [3]byte{0, 24, 223}: "The Morey Corporation", + [3]byte{0, 24, 224}: "ANAVEO", + [3]byte{0, 24, 225}: "Verkerk Service Systemen", + [3]byte{0, 24, 226}: "Topdata Sistemas de Automacao Ltda", + [3]byte{0, 24, 227}: "Visualgate Systems, Inc.", + [3]byte{0, 24, 228}: "YIGUANG", + [3]byte{0, 24, 229}: "Adhoco AG", + [3]byte{0, 24, 230}: "Computer Hardware Design SIA", + [3]byte{0, 24, 231}: "Cameo Communications, INC.", + [3]byte{0, 24, 232}: "Hacetron Corporation", + [3]byte{0, 24, 233}: "Numata Corporation", + [3]byte{0, 24, 234}: "Alltec GmbH", + [3]byte{0, 24, 235}: "BroVis Wireless Networks", + [3]byte{0, 24, 236}: "Welding Technology Corporation", + [3]byte{0, 24, 237}: "Accutech Ultrasystems Co., Ltd.", + [3]byte{0, 24, 238}: "Videology Imaging Solutions, Inc.", + [3]byte{0, 24, 239}: "Escape Communications, Inc.", + [3]byte{0, 24, 240}: "JOYTOTO Co., Ltd.", + [3]byte{0, 24, 241}: "Chunichi Denshi Co.,LTD.", + [3]byte{0, 24, 242}: "Beijing Tianyu Communication Equipment Co., Ltd", + [3]byte{0, 24, 243}: "ASUSTek COMPUTER INC.", + [3]byte{0, 24, 244}: "EO TECHNICS Co., Ltd.", + [3]byte{0, 24, 245}: "Shenzhen Streaming Video Technology Company Limited", + [3]byte{0, 24, 246}: "Thomson Telecom Belgium", + [3]byte{0, 24, 247}: "Kameleon Technologies", + [3]byte{0, 24, 248}: "Cisco-Linksys LLC", + [3]byte{0, 24, 249}: "VVOND, Inc.", + [3]byte{0, 24, 250}: "Yushin Precision Equipment Co.,Ltd.", + [3]byte{0, 24, 251}: "Compro Technology", + [3]byte{0, 24, 252}: "Altec Electronic AG", + [3]byte{0, 24, 253}: "Optimal Technologies International Inc.", + [3]byte{0, 24, 254}: "Hewlett-Packard Company", + [3]byte{0, 24, 255}: "PowerQuattro Co.", + [3]byte{0, 25, 0}: "Intelliverese - DBA Voicecom", + [3]byte{0, 25, 1}: "F1MEDIA", + [3]byte{0, 25, 2}: "Cambridge Consultants Ltd", + [3]byte{0, 25, 3}: "Bigfoot Networks Inc", + [3]byte{0, 25, 4}: "WB Electronics Sp. z o.o.", + [3]byte{0, 25, 5}: "SCHRACK Seconet AG", + [3]byte{0, 25, 6}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 7}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 8}: "Duaxes Corporation", + [3]byte{0, 25, 9}: "DEVI - Danfoss A/S", + [3]byte{0, 25, 10}: "HASWARE INC.", + [3]byte{0, 25, 11}: "Southern Vision Systems, Inc.", + [3]byte{0, 25, 12}: "Encore Electronics, Inc.", + [3]byte{0, 25, 13}: "IEEE 1394c", + [3]byte{0, 25, 14}: "Atech Technology Co., Ltd.", + [3]byte{0, 25, 15}: "Advansus Corp.", + [3]byte{0, 25, 16}: "Knick Elektronische Messgeraete GmbH & Co. KG", + [3]byte{0, 25, 17}: "Just In Mobile Information Technologies (Shanghai) Co., Ltd.", + [3]byte{0, 25, 18}: "Welcat Inc", + [3]byte{0, 25, 19}: "Chuang-Yi Network Equipment Co.Ltd.", + [3]byte{0, 25, 20}: "Winix Co., Ltd", + [3]byte{0, 25, 21}: "TECOM Co., Ltd.", + [3]byte{0, 25, 22}: "PayTec AG", + [3]byte{0, 25, 23}: "Posiflex Inc.", + [3]byte{0, 25, 24}: "Interactive Wear AG", + [3]byte{0, 25, 25}: "ASTEL Inc.", + [3]byte{0, 25, 26}: "IRLINK", + [3]byte{0, 25, 27}: "Sputnik Engineering AG", + [3]byte{0, 25, 28}: "Sensicast Systems", + [3]byte{0, 25, 29}: "Nintendo Co., Ltd.", + [3]byte{0, 25, 30}: "Beyondwiz Co., Ltd.", + [3]byte{0, 25, 31}: "Microlink communications Inc.", + [3]byte{0, 25, 32}: "KUME electric Co.,Ltd.", + [3]byte{0, 25, 33}: "Elitegroup Computer System Co.", + [3]byte{0, 25, 34}: "CM Comandos Lineares", + [3]byte{0, 25, 35}: "Phonex Korea Co., LTD.", + [3]byte{0, 25, 36}: "LBNL Engineering", + [3]byte{0, 25, 37}: "Intelicis Corporation", + [3]byte{0, 25, 38}: "BitsGen Co., Ltd.", + [3]byte{0, 25, 39}: "ImCoSys Ltd", + [3]byte{0, 25, 40}: "Siemens AG, Transportation Systems", + [3]byte{0, 25, 41}: "2M2B Montadora de Maquinas Bahia Brasil LTDA", + [3]byte{0, 25, 42}: "Antiope Associates", + [3]byte{0, 25, 43}: "Aclara RF Systems Inc.", + [3]byte{0, 25, 44}: "ARRIS Group, Inc.", + [3]byte{0, 25, 45}: "Nokia Corporation", + [3]byte{0, 25, 46}: "Spectral Instruments, Inc.", + [3]byte{0, 25, 47}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 48}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 49}: "Balluff GmbH", + [3]byte{0, 25, 50}: "Gude Analog- und Digialsysteme GmbH", + [3]byte{0, 25, 51}: "Strix Systems, Inc.", + [3]byte{0, 25, 52}: "TRENDON TOUCH TECHNOLOGY CORP.", + [3]byte{0, 25, 53}: "DUERR DENTAL AG", + [3]byte{0, 25, 54}: "STERLITE OPTICAL TECHNOLOGIES LIMITED", + [3]byte{0, 25, 55}: "CommerceGuard AB", + [3]byte{0, 25, 56}: "UMB Communications Co., Ltd.", + [3]byte{0, 25, 57}: "Gigamips", + [3]byte{0, 25, 58}: "OESOLUTIONS", + [3]byte{0, 25, 59}: "Wilibox Deliberant Group LLC", + [3]byte{0, 25, 60}: "HighPoint Technologies Incorporated", + [3]byte{0, 25, 61}: "GMC Guardian Mobility Corp.", + [3]byte{0, 25, 62}: "ADB Broadband Italia", + [3]byte{0, 25, 63}: "RDI technology(Shenzhen) Co.,LTD", + [3]byte{0, 25, 64}: "Rackable Systems", + [3]byte{0, 25, 65}: "Pitney Bowes, Inc", + [3]byte{0, 25, 66}: "ON SOFTWARE INTERNATIONAL LIMITED", + [3]byte{0, 25, 67}: "Belden", + [3]byte{0, 25, 68}: "Fossil Partners, L.P.", + [3]byte{0, 25, 69}: "Ten-Tec Inc.", + [3]byte{0, 25, 70}: "Cianet Industria e Comercio S/A", + [3]byte{0, 25, 71}: "Scientific Atlanta, A Cisco Company", + [3]byte{0, 25, 72}: "AireSpider Networks", + [3]byte{0, 25, 73}: "TENTEL COMTECH CO., LTD.", + [3]byte{0, 25, 74}: "TESTO AG", + [3]byte{0, 25, 75}: "SAGEM COMMUNICATION", + [3]byte{0, 25, 76}: "Fujian Stelcom information & Technology CO.,Ltd", + [3]byte{0, 25, 77}: "Avago Technologies Sdn Bhd", + [3]byte{0, 25, 78}: "Ultra Electronics - TCS (Tactical Communication Systems)", + [3]byte{0, 25, 79}: "Nokia Danmark A/S", + [3]byte{0, 25, 80}: "Harman Multimedia", + [3]byte{0, 25, 81}: "NETCONS, s.r.o.", + [3]byte{0, 25, 82}: "ACOGITO Co., Ltd", + [3]byte{0, 25, 83}: "Chainleader Communications Corp.", + [3]byte{0, 25, 84}: "Leaf Corporation.", + [3]byte{0, 25, 85}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 86}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 87}: "Saafnet Canada Inc.", + [3]byte{0, 25, 88}: "Bluetooth SIG, Inc.", + [3]byte{0, 25, 89}: "Staccato Communications Inc.", + [3]byte{0, 25, 90}: "Jenaer Antriebstechnik GmbH", + [3]byte{0, 25, 91}: "D-Link Corporation", + [3]byte{0, 25, 92}: "Innotech Corporation", + [3]byte{0, 25, 93}: "ShenZhen XinHuaTong Opto Electronics Co.,Ltd", + [3]byte{0, 25, 94}: "ARRIS Group, Inc.", + [3]byte{0, 25, 95}: "Valemount Networks Corporation", + [3]byte{0, 25, 96}: "DoCoMo Systems, Inc.", + [3]byte{0, 25, 97}: "Blaupunkt Embedded Systems GmbH", + [3]byte{0, 25, 98}: "Commerciant, LP", + [3]byte{0, 25, 99}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 25, 100}: "Doorking Inc.", + [3]byte{0, 25, 101}: "YuHua TelTech (ShangHai) Co., Ltd.", + [3]byte{0, 25, 102}: "Asiarock Technology Limited", + [3]byte{0, 25, 103}: "TELDAT Sp.J.", + [3]byte{0, 25, 104}: "Digital Video Networks(Shanghai) CO. LTD.", + [3]byte{0, 25, 105}: "Nortel", + [3]byte{0, 25, 106}: "MikroM GmbH", + [3]byte{0, 25, 107}: "Danpex Corporation", + [3]byte{0, 25, 108}: "ETROVISION TECHNOLOGY", + [3]byte{0, 25, 109}: "Raybit Systems Korea, Inc", + [3]byte{0, 25, 110}: "Metacom (Pty) Ltd.", + [3]byte{0, 25, 111}: "SensoPart GmbH", + [3]byte{0, 25, 112}: "Z-Com, Inc.", + [3]byte{0, 25, 113}: "Guangzhou Unicomp Technology Co.,Ltd", + [3]byte{0, 25, 114}: "Plexus (Xiamen) Co.,ltd", + [3]byte{0, 25, 115}: "Zeugma Systems", + [3]byte{0, 25, 116}: "AboCom Systems, Inc.", + [3]byte{0, 25, 117}: "Beijing Huisen networks technology Inc", + [3]byte{0, 25, 118}: "Xipher Technologies, LLC", + [3]byte{0, 25, 119}: "Aerohive Networks, Inc.", + [3]byte{0, 25, 120}: "Datum Systems, Inc.", + [3]byte{0, 25, 121}: "Nokia Danmark A/S", + [3]byte{0, 25, 122}: "MAZeT GmbH", + [3]byte{0, 25, 123}: "Picotest Corp.", + [3]byte{0, 25, 124}: "Riedel Communications GmbH", + [3]byte{0, 25, 125}: "Hon Hai Precision Ind. Co., Ltd", + [3]byte{0, 25, 126}: "Hon Hai Precision Ind. Co., Ltd", + [3]byte{0, 25, 127}: "PLANTRONICS, INC.", + [3]byte{0, 25, 128}: "Gridpoint Systems", + [3]byte{0, 25, 129}: "Vivox Inc", + [3]byte{0, 25, 130}: "SmarDTV", + [3]byte{0, 25, 131}: "CCT R&D Limited", + [3]byte{0, 25, 132}: "ESTIC Corporation", + [3]byte{0, 25, 133}: "IT Watchdogs, Inc", + [3]byte{0, 25, 134}: "Cheng Hongjian", + [3]byte{0, 25, 135}: "Panasonic Mobile Communications Co., Ltd.", + [3]byte{0, 25, 136}: "Wi2Wi, Inc", + [3]byte{0, 25, 137}: "Sonitrol Corporation", + [3]byte{0, 25, 138}: "Northrop Grumman Systems Corp.", + [3]byte{0, 25, 139}: "Novera Optics Korea, Inc.", + [3]byte{0, 25, 140}: "iXSea", + [3]byte{0, 25, 141}: "Ocean Optics, Inc.", + [3]byte{0, 25, 142}: "Oticon A/S", + [3]byte{0, 25, 143}: "Alcatel Bell N.V.", + [3]byte{0, 25, 144}: "ELM DATA Co., Ltd.", + [3]byte{0, 25, 145}: "avinfo", + [3]byte{0, 25, 146}: "ADTRAN INC.", + [3]byte{0, 25, 147}: "Changshu Switchgear MFG. Co.,Ltd. (Former Changshu Switchgea", + [3]byte{0, 25, 148}: "Jorjin Technologies Inc.", + [3]byte{0, 25, 149}: "Jurong Hi-Tech (Suzhou)Co.ltd", + [3]byte{0, 25, 150}: "TurboChef Technologies Inc.", + [3]byte{0, 25, 151}: "Soft Device Sdn Bhd", + [3]byte{0, 25, 152}: "SATO CORPORATION", + [3]byte{0, 25, 153}: "Fujitsu Technology Solutions", + [3]byte{0, 25, 154}: "EDO-EVI", + [3]byte{0, 25, 155}: "Diversified Technical Systems, Inc.", + [3]byte{0, 25, 156}: "CTRING", + [3]byte{0, 25, 157}: "VIZIO, Inc.", + [3]byte{0, 25, 158}: "Nifty", + [3]byte{0, 25, 159}: "DKT A/S", + [3]byte{0, 25, 160}: "NIHON DATA SYSTENS, INC.", + [3]byte{0, 25, 161}: "LG INFORMATION & COMM.", + [3]byte{0, 25, 162}: "ORDYN TECHNOLOGIES", + [3]byte{0, 25, 163}: "asteel electronique atlantique", + [3]byte{0, 25, 164}: "Austar Technology (hang zhou) Co.,Ltd", + [3]byte{0, 25, 165}: "RadarFind Corporation", + [3]byte{0, 25, 166}: "ARRIS Group, Inc.", + [3]byte{0, 25, 167}: "ITU-T", + [3]byte{0, 25, 168}: "WiQuest Communications", + [3]byte{0, 25, 169}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 170}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 171}: "Raycom CO ., LTD", + [3]byte{0, 25, 172}: "GSP SYSTEMS Inc.", + [3]byte{0, 25, 173}: "BOBST SA", + [3]byte{0, 25, 174}: "Hopling Technologies b.v.", + [3]byte{0, 25, 175}: "Rigol Technologies, Inc.", + [3]byte{0, 25, 176}: "HanYang System", + [3]byte{0, 25, 177}: "Arrow7 Corporation", + [3]byte{0, 25, 178}: "XYnetsoft Co.,Ltd", + [3]byte{0, 25, 179}: "Stanford Research Systems", + [3]byte{0, 25, 180}: "VideoCast Ltd.", + [3]byte{0, 25, 181}: "Famar Fueguina S.A.", + [3]byte{0, 25, 182}: "Euro Emme s.r.l.", + [3]byte{0, 25, 183}: "Nokia Danmark A/S", + [3]byte{0, 25, 184}: "Boundary Devices", + [3]byte{0, 25, 185}: "Dell Inc.", + [3]byte{0, 25, 186}: "Paradox Security Systems Ltd", + [3]byte{0, 25, 187}: "Hewlett-Packard Company", + [3]byte{0, 25, 188}: "ELECTRO CHANCE SRL", + [3]byte{0, 25, 189}: "New Media Life", + [3]byte{0, 25, 190}: "Altai Technologies Limited", + [3]byte{0, 25, 191}: "Citiway technology Co.,ltd", + [3]byte{0, 25, 192}: "ARRIS Group, Inc.", + [3]byte{0, 25, 193}: "Alps Electric Co., Ltd", + [3]byte{0, 25, 194}: "Equustek Solutions, Inc.", + [3]byte{0, 25, 195}: "Qualitrol", + [3]byte{0, 25, 196}: "Infocrypt Inc.", + [3]byte{0, 25, 197}: "SONY Computer Entertainment inc,", + [3]byte{0, 25, 198}: "ZTE Corporation", + [3]byte{0, 25, 199}: "Cambridge Industries(Group) Co.,Ltd.", + [3]byte{0, 25, 200}: "AnyDATA Corporation", + [3]byte{0, 25, 201}: "S&C ELECTRIC COMPANY", + [3]byte{0, 25, 202}: "Broadata Communications, Inc", + [3]byte{0, 25, 203}: "ZyXEL Communications Corporation", + [3]byte{0, 25, 204}: "RCG (HK) Ltd", + [3]byte{0, 25, 205}: "Chengdu ethercom information technology Ltd.", + [3]byte{0, 25, 206}: "Progressive Gaming International", + [3]byte{0, 25, 207}: "SALICRU, S.A.", + [3]byte{0, 25, 208}: "Cathexis", + [3]byte{0, 25, 209}: "Intel Corporate", + [3]byte{0, 25, 210}: "Intel Corporate", + [3]byte{0, 25, 211}: "TRAK Microwave", + [3]byte{0, 25, 212}: "ICX Technologies", + [3]byte{0, 25, 213}: "IP Innovations, Inc.", + [3]byte{0, 25, 214}: "LS Cable and System Ltd.", + [3]byte{0, 25, 215}: "FORTUNETEK CO., LTD", + [3]byte{0, 25, 216}: "MAXFOR", + [3]byte{0, 25, 217}: "Zeutschel GmbH", + [3]byte{0, 25, 218}: "Welltrans O&E Technology Co. , Ltd.", + [3]byte{0, 25, 219}: "MICRO-STAR INTERNATIONAL CO., LTD.", + [3]byte{0, 25, 220}: "ENENSYS Technologies", + [3]byte{0, 25, 221}: "FEI-Zyfer, Inc.", + [3]byte{0, 25, 222}: "MOBITEK", + [3]byte{0, 25, 223}: "Thomson Inc.", + [3]byte{0, 25, 224}: "TP-LINK Technologies Co., Ltd.", + [3]byte{0, 25, 225}: "Nortel", + [3]byte{0, 25, 226}: "Juniper Networks", + [3]byte{0, 25, 227}: "Apple", + [3]byte{0, 25, 228}: "2Wire, Inc", + [3]byte{0, 25, 229}: "Lynx Studio Technology, Inc.", + [3]byte{0, 25, 230}: "TOYO MEDIC CO.,LTD.", + [3]byte{0, 25, 231}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 232}: "CISCO SYSTEMS, INC.", + [3]byte{0, 25, 233}: "S-Information Technolgy, Co., Ltd.", + [3]byte{0, 25, 234}: "TeraMage Technologies Co., Ltd.", + [3]byte{0, 25, 235}: "Pyronix Ltd", + [3]byte{0, 25, 236}: "Sagamore Systems, Inc.", + [3]byte{0, 25, 237}: "Axesstel Inc.", + [3]byte{0, 25, 238}: "CARLO GAVAZZI CONTROLS SPA-Controls Division", + [3]byte{0, 25, 239}: "SHENZHEN LINNKING ELECTRONICS CO.,LTD", + [3]byte{0, 25, 240}: "UNIONMAN TECHNOLOGY CO.,LTD", + [3]byte{0, 25, 241}: "Star Communication Network Technology Co.,Ltd", + [3]byte{0, 25, 242}: "Teradyne K.K.", + [3]byte{0, 25, 243}: "Cetis, Inc", + [3]byte{0, 25, 244}: "Convergens Oy Ltd", + [3]byte{0, 25, 245}: "Imagination Technologies Ltd", + [3]byte{0, 25, 246}: "Acconet (PTE) Ltd", + [3]byte{0, 25, 247}: "Onset Computer Corporation", + [3]byte{0, 25, 248}: "Embedded Systems Design, Inc.", + [3]byte{0, 25, 249}: "TDK-Lambda", + [3]byte{0, 25, 250}: "Cable Vision Electronics CO., LTD.", + [3]byte{0, 25, 251}: "BSkyB Ltd", + [3]byte{0, 25, 252}: "PT. Ufoakses Sukses Luarbiasa", + [3]byte{0, 25, 253}: "Nintendo Co., Ltd.", + [3]byte{0, 25, 254}: "SHENZHEN SEECOMM TECHNOLOGY CO.,LTD.", + [3]byte{0, 25, 255}: "Finnzymes", + [3]byte{0, 26, 0}: "MATRIX INC.", + [3]byte{0, 26, 1}: "Smiths Medical", + [3]byte{0, 26, 2}: "SECURE CARE PRODUCTS, INC", + [3]byte{0, 26, 3}: "Angel Electronics Co., Ltd.", + [3]byte{0, 26, 4}: "Interay Solutions BV", + [3]byte{0, 26, 5}: "OPTIBASE LTD", + [3]byte{0, 26, 6}: "OpVista, Inc.", + [3]byte{0, 26, 7}: "Arecont Vision", + [3]byte{0, 26, 8}: "Simoco Ltd.", + [3]byte{0, 26, 9}: "Wayfarer Transit Systems Ltd", + [3]byte{0, 26, 10}: "Adaptive Micro-Ware Inc.", + [3]byte{0, 26, 11}: "BONA TECHNOLOGY INC.", + [3]byte{0, 26, 12}: "Swe-Dish Satellite Systems AB", + [3]byte{0, 26, 13}: "HandHeld entertainment, Inc.", + [3]byte{0, 26, 14}: "Cheng Uei Precision Industry Co.,Ltd", + [3]byte{0, 26, 15}: "Sistemas Avanzados de Control, S.A.", + [3]byte{0, 26, 16}: "LUCENT TRANS ELECTRONICS CO.,LTD", + [3]byte{0, 26, 17}: "Google Inc.", + [3]byte{0, 26, 18}: "Essilor", + [3]byte{0, 26, 19}: "Wanlida Group Co., LTD", + [3]byte{0, 26, 20}: "Xin Hua Control Engineering Co.,Ltd.", + [3]byte{0, 26, 21}: "gemalto e-Payment", + [3]byte{0, 26, 22}: "Nokia Danmark A/S", + [3]byte{0, 26, 23}: "Teak Technologies, Inc.", + [3]byte{0, 26, 24}: "Advanced Simulation Technology inc.", + [3]byte{0, 26, 25}: "Computer Engineering Limited", + [3]byte{0, 26, 26}: "Gentex Corporation/Electro-Acoustic Products", + [3]byte{0, 26, 27}: "ARRIS Group, Inc.", + [3]byte{0, 26, 28}: "GT&T Engineering Pte Ltd", + [3]byte{0, 26, 29}: "PChome Online Inc.", + [3]byte{0, 26, 30}: "Aruba Networks", + [3]byte{0, 26, 31}: "Coastal Environmental Systems", + [3]byte{0, 26, 32}: "CMOTECH Co. Ltd.", + [3]byte{0, 26, 33}: "Indac B.V.", + [3]byte{0, 26, 34}: "eQ-3 Entwicklung GmbH", + [3]byte{0, 26, 35}: "Ice Qube, Inc", + [3]byte{0, 26, 36}: "Galaxy Telecom Technologies Ltd", + [3]byte{0, 26, 37}: "DELTA DORE", + [3]byte{0, 26, 38}: "Deltanode Solutions AB", + [3]byte{0, 26, 39}: "Ubistar", + [3]byte{0, 26, 40}: "ASWT Co., LTD. Taiwan Branch H.K.", + [3]byte{0, 26, 41}: "Johnson Outdoors Marine Electronics, Inc", + [3]byte{0, 26, 42}: "Arcadyan Technology Corporation", + [3]byte{0, 26, 43}: "Ayecom Technology Co., Ltd.", + [3]byte{0, 26, 44}: "SATEC Co.,LTD", + [3]byte{0, 26, 45}: "The Navvo Group", + [3]byte{0, 26, 46}: "Ziova Coporation", + [3]byte{0, 26, 47}: "CISCO SYSTEMS, INC.", + [3]byte{0, 26, 48}: "CISCO SYSTEMS, INC.", + [3]byte{0, 26, 49}: "SCAN COIN Industries AB", + [3]byte{0, 26, 50}: "ACTIVA MULTIMEDIA", + [3]byte{0, 26, 51}: "ASI Communications, Inc.", + [3]byte{0, 26, 52}: "Konka Group Co., Ltd.", + [3]byte{0, 26, 53}: "BARTEC GmbH", + [3]byte{0, 26, 54}: "Aipermon GmbH & Co. KG", + [3]byte{0, 26, 55}: "Lear Corporation", + [3]byte{0, 26, 56}: "Sanmina-SCI", + [3]byte{0, 26, 57}: "Merten GmbH&CoKG", + [3]byte{0, 26, 58}: "Dongahelecomm", + [3]byte{0, 26, 59}: "Doah Elecom Inc.", + [3]byte{0, 26, 60}: "Technowave Ltd.", + [3]byte{0, 26, 61}: "Ajin Vision Co.,Ltd", + [3]byte{0, 26, 62}: "Faster Technology LLC", + [3]byte{0, 26, 63}: "intelbras", + [3]byte{0, 26, 64}: "A-FOUR TECH CO., LTD.", + [3]byte{0, 26, 65}: "INOCOVA Co.,Ltd", + [3]byte{0, 26, 66}: "Techcity Technology co., Ltd.", + [3]byte{0, 26, 67}: "Logical Link Communications", + [3]byte{0, 26, 68}: "JWTrading Co., Ltd", + [3]byte{0, 26, 69}: "GN Netcom as", + [3]byte{0, 26, 70}: "Digital Multimedia Technology Co., Ltd", + [3]byte{0, 26, 71}: "Agami Systems, Inc.", + [3]byte{0, 26, 72}: "Takacom Corporation", + [3]byte{0, 26, 73}: "Micro Vision Co.,LTD", + [3]byte{0, 26, 74}: "Qumranet Inc.", + [3]byte{0, 26, 75}: "Hewlett-Packard Company", + [3]byte{0, 26, 76}: "Crossbow Technology, Inc", + [3]byte{0, 26, 77}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{0, 26, 78}: "NTI AG / LinMot", + [3]byte{0, 26, 79}: "AVM GmbH", + [3]byte{0, 26, 80}: "PheeNet Technology Corp.", + [3]byte{0, 26, 81}: "Alfred Mann Foundation", + [3]byte{0, 26, 82}: "Meshlinx Wireless Inc.", + [3]byte{0, 26, 83}: "Zylaya", + [3]byte{0, 26, 84}: "Hip Shing Electronics Ltd.", + [3]byte{0, 26, 85}: "ACA-Digital Corporation", + [3]byte{0, 26, 86}: "ViewTel Co,. Ltd.", + [3]byte{0, 26, 87}: "Matrix Design Group, LLC", + [3]byte{0, 26, 88}: "CCV Deutschland GmbH - Celectronic eHealth Div.", + [3]byte{0, 26, 89}: "Ircona", + [3]byte{0, 26, 90}: "Korea Electric Power Data Network (KDN) Co., Ltd", + [3]byte{0, 26, 91}: "NetCare Service Co., Ltd.", + [3]byte{0, 26, 92}: "Euchner GmbH+Co. KG", + [3]byte{0, 26, 93}: "Mobinnova Corp.", + [3]byte{0, 26, 94}: "Thincom Technology Co.,Ltd", + [3]byte{0, 26, 95}: "KitWorks.fi Ltd.", + [3]byte{0, 26, 96}: "Wave Electronics Co.,Ltd.", + [3]byte{0, 26, 97}: "PacStar Corp.", + [3]byte{0, 26, 98}: "Data Robotics, Incorporated", + [3]byte{0, 26, 99}: "Elster Solutions, LLC,", + [3]byte{0, 26, 100}: "IBM Corp", + [3]byte{0, 26, 101}: "Seluxit", + [3]byte{0, 26, 102}: "ARRIS Group, Inc.", + [3]byte{0, 26, 103}: "Infinite QL Sdn Bhd", + [3]byte{0, 26, 104}: "Weltec Enterprise Co., Ltd.", + [3]byte{0, 26, 105}: "Wuhan Yangtze Optical Technology CO.,Ltd.", + [3]byte{0, 26, 106}: "Tranzas, Inc.", + [3]byte{0, 26, 107}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{0, 26, 108}: "CISCO SYSTEMS, INC.", + [3]byte{0, 26, 109}: "CISCO SYSTEMS, INC.", + [3]byte{0, 26, 110}: "Impro Technologies", + [3]byte{0, 26, 111}: "MI.TEL s.r.l.", + [3]byte{0, 26, 112}: "Cisco-Linksys, LLC", + [3]byte{0, 26, 113}: "Diostech Co., Ltd.", + [3]byte{0, 26, 114}: "Mosart Semiconductor Corp.", + [3]byte{0, 26, 115}: "Gemtek Technology Co., Ltd.", + [3]byte{0, 26, 116}: "Procare International Co", + [3]byte{0, 26, 117}: "Sony Ericsson Mobile Communications", + [3]byte{0, 26, 118}: "SDT information Technology Co.,LTD.", + [3]byte{0, 26, 119}: "ARRIS Group, Inc.", + [3]byte{0, 26, 120}: "ubtos", + [3]byte{0, 26, 121}: "TELECOMUNICATION TECHNOLOGIES LTD.", + [3]byte{0, 26, 122}: "Lismore Instruments Limited", + [3]byte{0, 26, 123}: "Teleco, Inc.", + [3]byte{0, 26, 124}: "Hirschmann Multimedia B.V.", + [3]byte{0, 26, 125}: "cyber-blue(HK)Ltd", + [3]byte{0, 26, 126}: "LN Srithai Comm Ltd.", + [3]byte{0, 26, 127}: "GCI Science&Technology Co.,Ltd.", + [3]byte{0, 26, 128}: "Sony Corporation", + [3]byte{0, 26, 129}: "Zelax", + [3]byte{0, 26, 130}: "PROBA Building Automation Co.,LTD", + [3]byte{0, 26, 131}: "Pegasus Technologies Inc.", + [3]byte{0, 26, 132}: "V One Multimedia Pte Ltd", + [3]byte{0, 26, 133}: "NV Michel Van de Wiele", + [3]byte{0, 26, 134}: "AdvancedIO Systems Inc", + [3]byte{0, 26, 135}: "Canhold International Limited", + [3]byte{0, 26, 136}: "Venergy,Co,Ltd", + [3]byte{0, 26, 137}: "Nokia Danmark A/S", + [3]byte{0, 26, 138}: "Samsung Electronics Co., Ltd.", + [3]byte{0, 26, 139}: "CHUNIL ELECTRIC IND., CO.", + [3]byte{0, 26, 140}: "Sophos Ltd", + [3]byte{0, 26, 141}: "AVECS Bergen GmbH", + [3]byte{0, 26, 142}: "3Way Networks Ltd", + [3]byte{0, 26, 143}: "Nortel", + [3]byte{0, 26, 144}: "Trópico Sistemas e Telecomunicações da Amazônia LTDA.", + [3]byte{0, 26, 145}: "FusionDynamic Ltd.", + [3]byte{0, 26, 146}: "ASUSTek COMPUTER INC.", + [3]byte{0, 26, 147}: "ERCO Leuchten GmbH", + [3]byte{0, 26, 148}: "Votronic GmbH", + [3]byte{0, 26, 149}: "Hisense Mobile Communications Technoligy Co.,Ltd.", + [3]byte{0, 26, 150}: "ECLER S.A.", + [3]byte{0, 26, 151}: "fitivision technology Inc.", + [3]byte{0, 26, 152}: "Asotel Communication Limited Taiwan Branch", + [3]byte{0, 26, 153}: "Smarty (HZ) Information Electronics Co., Ltd", + [3]byte{0, 26, 154}: "Skyworth Digital technology(shenzhen)co.ltd.", + [3]byte{0, 26, 155}: "ADEC & Parter AG", + [3]byte{0, 26, 156}: "RightHand Technologies, Inc.", + [3]byte{0, 26, 157}: "Skipper Wireless, Inc.", + [3]byte{0, 26, 158}: "ICON Digital International Limited", + [3]byte{0, 26, 159}: "A-Link Ltd", + [3]byte{0, 26, 160}: "Dell Inc", + [3]byte{0, 26, 161}: "CISCO SYSTEMS, INC.", + [3]byte{0, 26, 162}: "CISCO SYSTEMS, INC.", + [3]byte{0, 26, 163}: "DELORME", + [3]byte{0, 26, 164}: "Future University-Hakodate", + [3]byte{0, 26, 165}: "BRN Phoenix", + [3]byte{0, 26, 166}: "Telefunken Radio Communication Systems GmbH &CO.KG", + [3]byte{0, 26, 167}: "Torian Wireless", + [3]byte{0, 26, 168}: "Mamiya Digital Imaging Co., Ltd.", + [3]byte{0, 26, 169}: "FUJIAN STAR-NET COMMUNICATION CO.,LTD", + [3]byte{0, 26, 170}: "Analogic Corp.", + [3]byte{0, 26, 171}: "eWings s.r.l.", + [3]byte{0, 26, 172}: "Corelatus AB", + [3]byte{0, 26, 173}: "ARRIS Group, Inc.", + [3]byte{0, 26, 174}: "Savant Systems LLC", + [3]byte{0, 26, 175}: "BLUSENS TECHNOLOGY", + [3]byte{0, 26, 176}: "Signal Networks Pvt. Ltd.,", + [3]byte{0, 26, 177}: "Asia Pacific Satellite Industries Co., Ltd.", + [3]byte{0, 26, 178}: "Cyber Solutions Inc.", + [3]byte{0, 26, 179}: "VISIONITE INC.", + [3]byte{0, 26, 180}: "FFEI Ltd.", + [3]byte{0, 26, 181}: "Home Network System", + [3]byte{0, 26, 182}: "Texas Instruments", + [3]byte{0, 26, 183}: "Ethos Networks LTD.", + [3]byte{0, 26, 184}: "Anseri Corporation", + [3]byte{0, 26, 185}: "PMC", + [3]byte{0, 26, 186}: "Caton Overseas Limited", + [3]byte{0, 26, 187}: "Fontal Technology Incorporation", + [3]byte{0, 26, 188}: "U4EA Technologies Ltd", + [3]byte{0, 26, 189}: "Impatica Inc.", + [3]byte{0, 26, 190}: "COMPUTER HI-TECH INC.", + [3]byte{0, 26, 191}: "TRUMPF Laser Marking Systems AG", + [3]byte{0, 26, 192}: "JOYBIEN TECHNOLOGIES CO., LTD.", + [3]byte{0, 26, 193}: "3Com Ltd", + [3]byte{0, 26, 194}: "YEC Co.,Ltd.", + [3]byte{0, 26, 195}: "Scientific-Atlanta, Inc", + [3]byte{0, 26, 196}: "2Wire, Inc", + [3]byte{0, 26, 197}: "BreakingPoint Systems, Inc.", + [3]byte{0, 26, 198}: "Micro Control Designs", + [3]byte{0, 26, 199}: "UNIPOINT", + [3]byte{0, 26, 200}: "ISL (Instrumentation Scientifique de Laboratoire)", + [3]byte{0, 26, 201}: "SUZUKEN CO.,LTD", + [3]byte{0, 26, 202}: "Tilera Corporation", + [3]byte{0, 26, 203}: "Autocom Products Ltd", + [3]byte{0, 26, 204}: "Celestial Semiconductor, Ltd", + [3]byte{0, 26, 205}: "Tidel Engineering LP", + [3]byte{0, 26, 206}: "YUPITERU CORPORATION", + [3]byte{0, 26, 207}: "C.T. ELETTRONICA", + [3]byte{0, 26, 208}: "Albis Technologies AG", + [3]byte{0, 26, 209}: "FARGO CO., LTD.", + [3]byte{0, 26, 210}: "Eletronica Nitron Ltda", + [3]byte{0, 26, 211}: "Vamp Ltd.", + [3]byte{0, 26, 212}: "iPOX Technology Co., Ltd.", + [3]byte{0, 26, 213}: "KMC CHAIN INDUSTRIAL CO., LTD.", + [3]byte{0, 26, 214}: "JIAGNSU AETNA ELECTRIC CO.,LTD", + [3]byte{0, 26, 215}: "Christie Digital Systems, Inc.", + [3]byte{0, 26, 216}: "AlsterAero GmbH", + [3]byte{0, 26, 217}: "International Broadband Electric Communications, Inc.", + [3]byte{0, 26, 218}: "Biz-2-Me Inc.", + [3]byte{0, 26, 219}: "ARRIS Group, Inc.", + [3]byte{0, 26, 220}: "Nokia Danmark A/S", + [3]byte{0, 26, 221}: "PePWave Ltd", + [3]byte{0, 26, 222}: "ARRIS Group, Inc.", + [3]byte{0, 26, 223}: "Interactivetv Pty Limited", + [3]byte{0, 26, 224}: "Mythology Tech Express Inc.", + [3]byte{0, 26, 225}: "EDGE ACCESS INC", + [3]byte{0, 26, 226}: "CISCO SYSTEMS, INC.", + [3]byte{0, 26, 227}: "CISCO SYSTEMS, INC.", + [3]byte{0, 26, 228}: "Medicis Technologies Corporation", + [3]byte{0, 26, 229}: "Mvox Technologies Inc.", + [3]byte{0, 26, 230}: "Atlanta Advanced Communications Holdings Limited", + [3]byte{0, 26, 231}: "Aztek Networks, Inc.", + [3]byte{0, 26, 232}: "Unify GmbH and Co KG", + [3]byte{0, 26, 233}: "Nintendo Co., Ltd.", + [3]byte{0, 26, 234}: "Radio Terminal Systems Pty Ltd", + [3]byte{0, 26, 235}: "Allied Telesis K.K.", + [3]byte{0, 26, 236}: "Keumbee Electronics Co.,Ltd.", + [3]byte{0, 26, 237}: "INCOTEC GmbH", + [3]byte{0, 26, 238}: "Shenztech Ltd", + [3]byte{0, 26, 239}: "Loopcomm Technology, Inc.", + [3]byte{0, 26, 240}: "Alcatel - IPD", + [3]byte{0, 26, 241}: "Embedded Artists AB", + [3]byte{0, 26, 242}: "Dynavisions Schweiz AG", + [3]byte{0, 26, 243}: "Samyoung Electronics", + [3]byte{0, 26, 244}: "Handreamnet", + [3]byte{0, 26, 245}: "PENTAONE. CO., LTD.", + [3]byte{0, 26, 246}: "Woven Systems, Inc.", + [3]byte{0, 26, 247}: "dataschalt e+a GmbH", + [3]byte{0, 26, 248}: "Copley Controls Corporation", + [3]byte{0, 26, 249}: "AeroVIronment (AV Inc)", + [3]byte{0, 26, 250}: "Welch Allyn, Inc.", + [3]byte{0, 26, 251}: "Joby Inc.", + [3]byte{0, 26, 252}: "ModusLink Corporation", + [3]byte{0, 26, 253}: "EVOLIS", + [3]byte{0, 26, 254}: "SOFACREAL", + [3]byte{0, 26, 255}: "Wizyoung Tech.", + [3]byte{0, 27, 0}: "Neopost Technologies", + [3]byte{0, 27, 1}: "Applied Radio Technologies", + [3]byte{0, 27, 2}: "ED Co.Ltd", + [3]byte{0, 27, 3}: "Action Technology (SZ) Co., Ltd", + [3]byte{0, 27, 4}: "Affinity International S.p.a", + [3]byte{0, 27, 5}: "YMC AG", + [3]byte{0, 27, 6}: "Ateliers R. LAUMONIER", + [3]byte{0, 27, 7}: "Mendocino Software", + [3]byte{0, 27, 8}: "Danfoss Drives A/S", + [3]byte{0, 27, 9}: "Matrix Telecom Pvt. Ltd.", + [3]byte{0, 27, 10}: "Intelligent Distributed Controls Ltd", + [3]byte{0, 27, 11}: "Phidgets Inc.", + [3]byte{0, 27, 12}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 13}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 14}: "InoTec GmbH Organisationssysteme", + [3]byte{0, 27, 15}: "Petratec", + [3]byte{0, 27, 16}: "ShenZhen Kang Hui Technology Co.,ltd", + [3]byte{0, 27, 17}: "D-Link Corporation", + [3]byte{0, 27, 18}: "Apprion", + [3]byte{0, 27, 19}: "Icron Technologies Corporation", + [3]byte{0, 27, 20}: "Carex Lighting Equipment Factory", + [3]byte{0, 27, 21}: "Voxtel, Inc.", + [3]byte{0, 27, 22}: "Celtro Ltd.", + [3]byte{0, 27, 23}: "Palo Alto Networks", + [3]byte{0, 27, 24}: "Tsuken Electric Ind. Co.,Ltd", + [3]byte{0, 27, 25}: "IEEE I&M Society TC9", + [3]byte{0, 27, 26}: "e-trees Japan, Inc.", + [3]byte{0, 27, 27}: "Siemens AG,", + [3]byte{0, 27, 28}: "Coherent", + [3]byte{0, 27, 29}: "Phoenix International Co., Ltd", + [3]byte{0, 27, 30}: "HART Communication Foundation", + [3]byte{0, 27, 31}: "DELTA - Danish Electronics, Light & Acoustics", + [3]byte{0, 27, 32}: "TPine Technology", + [3]byte{0, 27, 33}: "Intel Corporate", + [3]byte{0, 27, 34}: "Palit Microsystems ( H.K.) Ltd.", + [3]byte{0, 27, 35}: "SimpleComTools", + [3]byte{0, 27, 36}: "Quanta Computer Inc.", + [3]byte{0, 27, 37}: "Nortel", + [3]byte{0, 27, 38}: "RON-Telecom ZAO", + [3]byte{0, 27, 39}: "Merlin CSI", + [3]byte{0, 27, 40}: "POLYGON, JSC", + [3]byte{0, 27, 41}: "Avantis.Co.,Ltd", + [3]byte{0, 27, 42}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 43}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 44}: "ATRON electronic GmbH", + [3]byte{0, 27, 45}: "Med-Eng Systems Inc.", + [3]byte{0, 27, 46}: "Sinkyo Electron Inc", + [3]byte{0, 27, 47}: "NETGEAR Inc.", + [3]byte{0, 27, 48}: "Solitech Inc.", + [3]byte{0, 27, 49}: "Neural Image. Co. Ltd.", + [3]byte{0, 27, 50}: "QLogic Corporation", + [3]byte{0, 27, 51}: "Nokia Danmark A/S", + [3]byte{0, 27, 52}: "Focus System Inc.", + [3]byte{0, 27, 53}: "ChongQing JINOU Science & Technology Development CO.,Ltd", + [3]byte{0, 27, 54}: "Tsubata Engineering Co.,Ltd. (Head Office)", + [3]byte{0, 27, 55}: "Computec Oy", + [3]byte{0, 27, 56}: "COMPAL INFORMATION (KUNSHAN) CO., LTD.", + [3]byte{0, 27, 57}: "Proxicast", + [3]byte{0, 27, 58}: "SIMS Corp.", + [3]byte{0, 27, 59}: "Yi-Qing CO., LTD", + [3]byte{0, 27, 60}: "Software Technologies Group,Inc.", + [3]byte{0, 27, 61}: "EuroTel Spa", + [3]byte{0, 27, 62}: "Curtis, Inc.", + [3]byte{0, 27, 63}: "ProCurve Networking by HP", + [3]byte{0, 27, 64}: "Network Automation mxc AB", + [3]byte{0, 27, 65}: "General Infinity Co.,Ltd.", + [3]byte{0, 27, 66}: "Wise & Blue", + [3]byte{0, 27, 67}: "Beijing DG Telecommunications equipment Co.,Ltd", + [3]byte{0, 27, 68}: "SanDisk Corporation", + [3]byte{0, 27, 69}: "ABB AS, Division Automation Products", + [3]byte{0, 27, 70}: "Blueone Technology Co.,Ltd", + [3]byte{0, 27, 71}: "Futarque A/S", + [3]byte{0, 27, 72}: "Shenzhen Lantech Electronics Co., Ltd.", + [3]byte{0, 27, 73}: "Roberts Radio limited", + [3]byte{0, 27, 74}: "W&W Communications, Inc.", + [3]byte{0, 27, 75}: "SANION Co., Ltd.", + [3]byte{0, 27, 76}: "Signtech", + [3]byte{0, 27, 77}: "Areca Technology Corporation", + [3]byte{0, 27, 78}: "Navman New Zealand", + [3]byte{0, 27, 79}: "Avaya Inc.", + [3]byte{0, 27, 80}: "Nizhny Novgorod Factory named after M.Frunze, FSUE (NZiF)", + [3]byte{0, 27, 81}: "Vector Technology Corp.", + [3]byte{0, 27, 82}: "ARRIS Group, Inc.", + [3]byte{0, 27, 83}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 84}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 85}: "Hurco Automation Ltd.", + [3]byte{0, 27, 86}: "Tehuti Networks Ltd.", + [3]byte{0, 27, 87}: "SEMINDIA SYSTEMS PRIVATE LIMITED", + [3]byte{0, 27, 88}: "ACE CAD Enterprise Co., Ltd.", + [3]byte{0, 27, 89}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 27, 90}: "Apollo Imaging Technologies, Inc.", + [3]byte{0, 27, 91}: "2Wire, Inc.", + [3]byte{0, 27, 92}: "Azuretec Co., Ltd.", + [3]byte{0, 27, 93}: "Vololink Pty Ltd", + [3]byte{0, 27, 94}: "BPL Limited", + [3]byte{0, 27, 95}: "Alien Technology", + [3]byte{0, 27, 96}: "NAVIGON AG", + [3]byte{0, 27, 97}: "Digital Acoustics, LLC", + [3]byte{0, 27, 98}: "JHT Optoelectronics Co.,Ltd.", + [3]byte{0, 27, 99}: "Apple", + [3]byte{0, 27, 100}: "IsaacLandKorea Co., Ltd,", + [3]byte{0, 27, 101}: "China Gridcom Co., Ltd", + [3]byte{0, 27, 102}: "Sennheiser electronic GmbH & Co. KG", + [3]byte{0, 27, 103}: "Cisco Systems Inc", + [3]byte{0, 27, 104}: "Modnnet Co., Ltd", + [3]byte{0, 27, 105}: "Equaline Corporation", + [3]byte{0, 27, 106}: "Powerwave Technologies Sweden AB", + [3]byte{0, 27, 107}: "Swyx Solutions AG", + [3]byte{0, 27, 108}: "LookX Digital Media BV", + [3]byte{0, 27, 109}: "Midtronics, Inc.", + [3]byte{0, 27, 110}: "Anue Systems, Inc.", + [3]byte{0, 27, 111}: "Teletrak Ltd", + [3]byte{0, 27, 112}: "IRI Ubiteq, INC.", + [3]byte{0, 27, 113}: "Telular Corp.", + [3]byte{0, 27, 114}: "Sicep s.p.a.", + [3]byte{0, 27, 115}: "DTL Broadcast Ltd", + [3]byte{0, 27, 116}: "MiraLink Corporation", + [3]byte{0, 27, 117}: "Hypermedia Systems", + [3]byte{0, 27, 118}: "Ripcode, Inc.", + [3]byte{0, 27, 119}: "Intel Corporate", + [3]byte{0, 27, 120}: "Hewlett-Packard Company", + [3]byte{0, 27, 121}: "FAIVELEY TRANSPORT", + [3]byte{0, 27, 122}: "Nintendo Co., Ltd.", + [3]byte{0, 27, 123}: "The Tintometer Ltd", + [3]byte{0, 27, 124}: "A & R Cambridge", + [3]byte{0, 27, 125}: "CXR Anderson Jacobson", + [3]byte{0, 27, 126}: "Beckmann GmbH", + [3]byte{0, 27, 127}: "TMN Technologies Telecomunicacoes Ltda", + [3]byte{0, 27, 128}: "LORD Corporation", + [3]byte{0, 27, 129}: "DATAQ Instruments, Inc.", + [3]byte{0, 27, 130}: "Taiwan Semiconductor Co., Ltd.", + [3]byte{0, 27, 131}: "Finsoft Ltd", + [3]byte{0, 27, 132}: "Scan Engineering Telecom", + [3]byte{0, 27, 133}: "MAN Diesel SE", + [3]byte{0, 27, 134}: "Bosch Access Systems GmbH", + [3]byte{0, 27, 135}: "Deepsound Tech. Co., Ltd", + [3]byte{0, 27, 136}: "Divinet Access Technologies Ltd", + [3]byte{0, 27, 137}: "EMZA Visual Sense Ltd.", + [3]byte{0, 27, 138}: "2M Electronic A/S", + [3]byte{0, 27, 139}: "NEC Platforms, Ltd.", + [3]byte{0, 27, 140}: "JMicron Technology Corp.", + [3]byte{0, 27, 141}: "Electronic Computer Systems, Inc.", + [3]byte{0, 27, 142}: "Hulu Sweden AB", + [3]byte{0, 27, 143}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 144}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 145}: "EFKON AG", + [3]byte{0, 27, 146}: "l-acoustics", + [3]byte{0, 27, 147}: "JC Decaux SA DNT", + [3]byte{0, 27, 148}: "T.E.M.A. S.p.A.", + [3]byte{0, 27, 149}: "VIDEO SYSTEMS SRL", + [3]byte{0, 27, 150}: "General Sensing", + [3]byte{0, 27, 151}: "Violin Technologies", + [3]byte{0, 27, 152}: "Samsung Electronics Co., Ltd.", + [3]byte{0, 27, 153}: "KS System GmbH", + [3]byte{0, 27, 154}: "Apollo Fire Detectors Ltd", + [3]byte{0, 27, 155}: "Hose-McCann Communications", + [3]byte{0, 27, 156}: "SATEL sp. z o.o.", + [3]byte{0, 27, 157}: "Novus Security Sp. z o.o.", + [3]byte{0, 27, 158}: "ASKEY COMPUTER CORP", + [3]byte{0, 27, 159}: "Calyptech Pty Ltd", + [3]byte{0, 27, 160}: "Awox", + [3]byte{0, 27, 161}: "Ã…mic AB", + [3]byte{0, 27, 162}: "IDS Imaging Development Systems GmbH", + [3]byte{0, 27, 163}: "Flexit Group GmbH", + [3]byte{0, 27, 164}: "S.A.E Afikim", + [3]byte{0, 27, 165}: "MyungMin Systems, Inc.", + [3]byte{0, 27, 166}: "intotech inc.", + [3]byte{0, 27, 167}: "Lorica Solutions", + [3]byte{0, 27, 168}: "UBI&MOBI,.Inc", + [3]byte{0, 27, 169}: "BROTHER INDUSTRIES, LTD.", + [3]byte{0, 27, 170}: "XenICs nv", + [3]byte{0, 27, 171}: "Telchemy, Incorporated", + [3]byte{0, 27, 172}: "Curtiss Wright Controls Embedded Computing", + [3]byte{0, 27, 173}: "iControl Incorporated", + [3]byte{0, 27, 174}: "Micro Control Systems, Inc", + [3]byte{0, 27, 175}: "Nokia Danmark A/S", + [3]byte{0, 27, 176}: "BHARAT ELECTRONICS", + [3]byte{0, 27, 177}: "Wistron Neweb Corp.", + [3]byte{0, 27, 178}: "Intellect International NV", + [3]byte{0, 27, 179}: "Condalo GmbH", + [3]byte{0, 27, 180}: "Airvod Limited", + [3]byte{0, 27, 181}: "ZF Electronics GmbH", + [3]byte{0, 27, 182}: "Bird Electronic Corp.", + [3]byte{0, 27, 183}: "Alta Heights Technology Corp.", + [3]byte{0, 27, 184}: "BLUEWAY ELECTRONIC CO;LTD", + [3]byte{0, 27, 185}: "Elitegroup Computer System Co.", + [3]byte{0, 27, 186}: "Nortel", + [3]byte{0, 27, 187}: "RFTech Co.,Ltd", + [3]byte{0, 27, 188}: "Silver Peak Systems, Inc.", + [3]byte{0, 27, 189}: "FMC Kongsberg Subsea AS", + [3]byte{0, 27, 190}: "ICOP Digital", + [3]byte{0, 27, 191}: "SAGEM COMMUNICATION", + [3]byte{0, 27, 192}: "Juniper Networks", + [3]byte{0, 27, 193}: "HOLUX Technology, Inc.", + [3]byte{0, 27, 194}: "Integrated Control Technology Limitied", + [3]byte{0, 27, 195}: "Mobisolution Co.,Ltd", + [3]byte{0, 27, 196}: "Ultratec, Inc.", + [3]byte{0, 27, 197}: "IEEE Registration Authority", + [3]byte{0, 27, 198}: "Strato Rechenzentrum AG", + [3]byte{0, 27, 199}: "StarVedia Technology Inc.", + [3]byte{0, 27, 200}: "MIURA CO.,LTD", + [3]byte{0, 27, 201}: "FSN DISPLAY INC", + [3]byte{0, 27, 202}: "Beijing Run Technology LTD. Company", + [3]byte{0, 27, 203}: "PEMPEK SYSTEMS PTY LTD", + [3]byte{0, 27, 204}: "KINGTEK CCTV ALLIANCE CO., LTD.", + [3]byte{0, 27, 205}: "DAVISCOMMS (S) PTE LTD", + [3]byte{0, 27, 206}: "Measurement Devices Ltd", + [3]byte{0, 27, 207}: "Dataupia Corporation", + [3]byte{0, 27, 208}: "IDENTEC SOLUTIONS", + [3]byte{0, 27, 209}: "SOGESTMATIC", + [3]byte{0, 27, 210}: "ULTRA-X ASIA PACIFIC Inc.", + [3]byte{0, 27, 211}: "Panasonic Corp. AVC Company", + [3]byte{0, 27, 212}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 213}: "CISCO SYSTEMS, INC.", + [3]byte{0, 27, 214}: "Kelvin Hughes Ltd", + [3]byte{0, 27, 215}: "Scientific Atlanta, A Cisco Company", + [3]byte{0, 27, 216}: "DVTel LTD", + [3]byte{0, 27, 217}: "Edgewater Computer Systems", + [3]byte{0, 27, 218}: "UTStarcom Inc", + [3]byte{0, 27, 219}: "Valeo VECS", + [3]byte{0, 27, 220}: "Vencer Co., Ltd.", + [3]byte{0, 27, 221}: "ARRIS Group, Inc.", + [3]byte{0, 27, 222}: "Renkus-Heinz, Inc.", + [3]byte{0, 27, 223}: "Iskra Sistemi d.d.", + [3]byte{0, 27, 224}: "TELENOT ELECTRONIC GmbH", + [3]byte{0, 27, 225}: "ViaLogy", + [3]byte{0, 27, 226}: "AhnLab,Inc.", + [3]byte{0, 27, 227}: "Health Hero Network, Inc.", + [3]byte{0, 27, 228}: "TOWNET SRL", + [3]byte{0, 27, 229}: "802automation Limited", + [3]byte{0, 27, 230}: "VR AG", + [3]byte{0, 27, 231}: "Postek Electronics Co., Ltd.", + [3]byte{0, 27, 232}: "Ultratronik GmbH", + [3]byte{0, 27, 233}: "Broadcom Corporation", + [3]byte{0, 27, 234}: "Nintendo Co., Ltd.", + [3]byte{0, 27, 235}: "DMP Electronics INC.", + [3]byte{0, 27, 236}: "Netio Technologies Co., Ltd", + [3]byte{0, 27, 237}: "Brocade Communications Systems, Inc", + [3]byte{0, 27, 238}: "Nokia Danmark A/S", + [3]byte{0, 27, 239}: "Blossoms Digital Technology Co.,Ltd.", + [3]byte{0, 27, 240}: "Value Platforms Limited", + [3]byte{0, 27, 241}: "Nanjing SilverNet Software Co., Ltd.", + [3]byte{0, 27, 242}: "KWORLD COMPUTER CO., LTD", + [3]byte{0, 27, 243}: "TRANSRADIO SenderSysteme Berlin AG", + [3]byte{0, 27, 244}: "KENWIN INDUSTRIAL(HK) LTD.", + [3]byte{0, 27, 245}: "Tellink Sistemas de Telecomunicación S.L.", + [3]byte{0, 27, 246}: "CONWISE Technology Corporation Ltd.", + [3]byte{0, 27, 247}: "Lund IP Products AB", + [3]byte{0, 27, 248}: "Digitrax Inc.", + [3]byte{0, 27, 249}: "Intellitect Water Ltd", + [3]byte{0, 27, 250}: "G.i.N. mbH", + [3]byte{0, 27, 251}: "Alps Electric Co., Ltd", + [3]byte{0, 27, 252}: "ASUSTek COMPUTER INC.", + [3]byte{0, 27, 253}: "Dignsys Inc.", + [3]byte{0, 27, 254}: "Zavio Inc.", + [3]byte{0, 27, 255}: "Millennia Media inc.", + [3]byte{0, 28, 0}: "Entry Point, LLC", + [3]byte{0, 28, 1}: "ABB Oy Drives", + [3]byte{0, 28, 2}: "Pano Logic", + [3]byte{0, 28, 3}: "Betty TV Technology AG", + [3]byte{0, 28, 4}: "Airgain, Inc.", + [3]byte{0, 28, 5}: "Nonin Medical Inc.", + [3]byte{0, 28, 6}: "Siemens Numerical Control Ltd., Nanjing", + [3]byte{0, 28, 7}: "Cwlinux Limited", + [3]byte{0, 28, 8}: "Echo360, Inc.", + [3]byte{0, 28, 9}: "SAE Electronic Co.,Ltd.", + [3]byte{0, 28, 10}: "Shenzhen AEE Technology Co.,Ltd.", + [3]byte{0, 28, 11}: "SmartAnt Telecom", + [3]byte{0, 28, 12}: "TANITA Corporation", + [3]byte{0, 28, 13}: "G-Technology, Inc.", + [3]byte{0, 28, 14}: "CISCO SYSTEMS, INC.", + [3]byte{0, 28, 15}: "CISCO SYSTEMS, INC.", + [3]byte{0, 28, 16}: "Cisco-Linksys, LLC", + [3]byte{0, 28, 17}: "ARRIS Group, Inc.", + [3]byte{0, 28, 18}: "ARRIS Group, Inc.", + [3]byte{0, 28, 19}: "OPTSYS TECHNOLOGY CO., LTD.", + [3]byte{0, 28, 20}: "VMware, Inc", + [3]byte{0, 28, 21}: "iPhotonix LLC", + [3]byte{0, 28, 22}: "ThyssenKrupp Elevator", + [3]byte{0, 28, 23}: "Nortel", + [3]byte{0, 28, 24}: "Sicert S.r.L.", + [3]byte{0, 28, 25}: "secunet Security Networks AG", + [3]byte{0, 28, 26}: "Thomas Instrumentation, Inc", + [3]byte{0, 28, 27}: "Hyperstone GmbH", + [3]byte{0, 28, 28}: "Center Communication Systems GmbH", + [3]byte{0, 28, 29}: "CHENZHOU GOSPELL DIGITAL TECHNOLOGY CO.,LTD", + [3]byte{0, 28, 30}: "emtrion GmbH", + [3]byte{0, 28, 31}: "Quest Retail Technology Pty Ltd", + [3]byte{0, 28, 32}: "CLB Benelux", + [3]byte{0, 28, 33}: "Nucsafe Inc.", + [3]byte{0, 28, 34}: "Aeris Elettronica s.r.l.", + [3]byte{0, 28, 35}: "Dell Inc", + [3]byte{0, 28, 36}: "Formosa Wireless Systems Corp.", + [3]byte{0, 28, 37}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{0, 28, 38}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{0, 28, 39}: "Sunell Electronics Co.", + [3]byte{0, 28, 40}: "Sphairon Technologies GmbH", + [3]byte{0, 28, 41}: "CORE DIGITAL ELECTRONICS CO., LTD", + [3]byte{0, 28, 42}: "Envisacor Technologies Inc.", + [3]byte{0, 28, 43}: "Alertme.com Limited", + [3]byte{0, 28, 44}: "Synapse", + [3]byte{0, 28, 45}: "FlexRadio Systems", + [3]byte{0, 28, 46}: "HPN Supply Chain", + [3]byte{0, 28, 47}: "Pfister GmbH", + [3]byte{0, 28, 48}: "Mode Lighting (UK ) Ltd.", + [3]byte{0, 28, 49}: "Mobile XP Technology Co., LTD", + [3]byte{0, 28, 50}: "Telian Corporation", + [3]byte{0, 28, 51}: "Sutron", + [3]byte{0, 28, 52}: "HUEY CHIAO INTERNATIONAL CO., LTD.", + [3]byte{0, 28, 53}: "Nokia Danmark A/S", + [3]byte{0, 28, 54}: "iNEWiT NV", + [3]byte{0, 28, 55}: "Callpod, Inc.", + [3]byte{0, 28, 56}: "Bio-Rad Laboratories, Inc.", + [3]byte{0, 28, 57}: "S Netsystems Inc.", + [3]byte{0, 28, 58}: "Element Labs, Inc.", + [3]byte{0, 28, 59}: "AmRoad Technology Inc.", + [3]byte{0, 28, 60}: "Seon Design Inc.", + [3]byte{0, 28, 61}: "WaveStorm", + [3]byte{0, 28, 62}: "ECKey Corporation", + [3]byte{0, 28, 63}: "International Police Technologies, Inc.", + [3]byte{0, 28, 64}: "VDG-Security bv", + [3]byte{0, 28, 65}: "scemtec Transponder Technology GmbH", + [3]byte{0, 28, 66}: "Parallels, Inc.", + [3]byte{0, 28, 67}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 28, 68}: "Bosch Security Systems BV", + [3]byte{0, 28, 69}: "Chenbro Micom Co., Ltd.", + [3]byte{0, 28, 70}: "QTUM", + [3]byte{0, 28, 71}: "Hangzhou Hollysys Automation Co., Ltd", + [3]byte{0, 28, 72}: "WiDeFi, Inc.", + [3]byte{0, 28, 73}: "Zoltan Technology Inc.", + [3]byte{0, 28, 74}: "AVM GmbH", + [3]byte{0, 28, 75}: "Gener8, Inc.", + [3]byte{0, 28, 76}: "Petrotest Instruments", + [3]byte{0, 28, 77}: "Aplix IP Holdings Corporation", + [3]byte{0, 28, 78}: "TASA International Limited", + [3]byte{0, 28, 79}: "MACAB AB", + [3]byte{0, 28, 80}: "TCL Technoly Electronics(Huizhou)Co.,Ltd", + [3]byte{0, 28, 81}: "Celeno Communications", + [3]byte{0, 28, 82}: "VISIONEE SRL", + [3]byte{0, 28, 83}: "Synergy Lighting Controls", + [3]byte{0, 28, 84}: "Hillstone Networks Inc", + [3]byte{0, 28, 85}: "Shenzhen Kaifa Technology Co.", + [3]byte{0, 28, 86}: "Pado Systems, Inc.", + [3]byte{0, 28, 87}: "CISCO SYSTEMS, INC.", + [3]byte{0, 28, 88}: "CISCO SYSTEMS, INC.", + [3]byte{0, 28, 89}: "DEVON IT", + [3]byte{0, 28, 90}: "Advanced Relay Corporation", + [3]byte{0, 28, 91}: "Chubb Electronic Security Systems Ltd", + [3]byte{0, 28, 92}: "Integrated Medical Systems, Inc.", + [3]byte{0, 28, 93}: "Leica Microsystems", + [3]byte{0, 28, 94}: "ASTON France", + [3]byte{0, 28, 95}: "Winland Electronics, Inc.", + [3]byte{0, 28, 96}: "CSP Frontier Technologies,Inc.", + [3]byte{0, 28, 97}: "Galaxy Microsystems LImited", + [3]byte{0, 28, 98}: "LG Electronics Inc", + [3]byte{0, 28, 99}: "TRUEN", + [3]byte{0, 28, 100}: "Landis+Gyr", + [3]byte{0, 28, 101}: "JoeScan, Inc.", + [3]byte{0, 28, 102}: "UCAMP CO.,LTD", + [3]byte{0, 28, 103}: "Pumpkin Networks, Inc.", + [3]byte{0, 28, 104}: "Anhui Sun Create Electronics Co., Ltd", + [3]byte{0, 28, 105}: "Packet Vision Ltd", + [3]byte{0, 28, 106}: "Weiss Engineering Ltd.", + [3]byte{0, 28, 107}: "COVAX Co. Ltd", + [3]byte{0, 28, 108}: "Jabil Circuit (Guangzhou) Limited", + [3]byte{0, 28, 109}: "KYOHRITSU ELECTRONIC INDUSTRY CO., LTD.", + [3]byte{0, 28, 110}: "Newbury Networks, Inc.", + [3]byte{0, 28, 111}: "Emfit Ltd", + [3]byte{0, 28, 112}: "NOVACOMM LTDA", + [3]byte{0, 28, 113}: "Emergent Electronics", + [3]byte{0, 28, 114}: "Mayer & Cie GmbH & Co KG", + [3]byte{0, 28, 115}: "Arista Networks, Inc.", + [3]byte{0, 28, 116}: "Syswan Technologies Inc.", + [3]byte{0, 28, 117}: "Segnet Ltd.", + [3]byte{0, 28, 118}: "The Wandsworth Group Ltd", + [3]byte{0, 28, 119}: "Prodys", + [3]byte{0, 28, 120}: "WYPLAY SAS", + [3]byte{0, 28, 121}: "Cohesive Financial Technologies LLC", + [3]byte{0, 28, 122}: "Perfectone Netware Company Ltd", + [3]byte{0, 28, 123}: "Castlenet Technology Inc.", + [3]byte{0, 28, 124}: "PERQ SYSTEMS CORPORATION", + [3]byte{0, 28, 125}: "Excelpoint Manufacturing Pte Ltd", + [3]byte{0, 28, 126}: "Toshiba", + [3]byte{0, 28, 127}: "Check Point Software Technologies", + [3]byte{0, 28, 128}: "New Business Division/Rhea-Information CO., LTD.", + [3]byte{0, 28, 129}: "NextGen Venturi LTD", + [3]byte{0, 28, 130}: "Genew Technologies", + [3]byte{0, 28, 131}: "New Level Telecom Co., Ltd.", + [3]byte{0, 28, 132}: "STL Solution Co.,Ltd.", + [3]byte{0, 28, 133}: "Eunicorn", + [3]byte{0, 28, 134}: "Cranite Systems, Inc.", + [3]byte{0, 28, 135}: "Uriver Inc.", + [3]byte{0, 28, 136}: "TRANSYSTEM INC.", + [3]byte{0, 28, 137}: "Force Communications, Inc.", + [3]byte{0, 28, 138}: "Cirrascale Corporation", + [3]byte{0, 28, 139}: "MJ Innovations Ltd.", + [3]byte{0, 28, 140}: "DIAL TECHNOLOGY LTD.", + [3]byte{0, 28, 141}: "Mesa Imaging", + [3]byte{0, 28, 142}: "Alcatel-Lucent IPD", + [3]byte{0, 28, 143}: "Advanced Electronic Design, Inc.", + [3]byte{0, 28, 144}: "Empacket Corporation", + [3]byte{0, 28, 145}: "Gefen Inc.", + [3]byte{0, 28, 146}: "Tervela", + [3]byte{0, 28, 147}: "ExaDigm Inc", + [3]byte{0, 28, 148}: "LI-COR Biosciences", + [3]byte{0, 28, 149}: "Opticomm Corporation", + [3]byte{0, 28, 150}: "Linkwise Technology Pte Ltd", + [3]byte{0, 28, 151}: "Enzytek Technology Inc.,", + [3]byte{0, 28, 152}: "LUCKY TECHNOLOGY (HK) COMPANY LIMITED", + [3]byte{0, 28, 153}: "Shunra Software Ltd.", + [3]byte{0, 28, 154}: "Nokia Danmark A/S", + [3]byte{0, 28, 155}: "FEIG ELECTRONIC GmbH", + [3]byte{0, 28, 156}: "Nortel", + [3]byte{0, 28, 157}: "Liecthi AG", + [3]byte{0, 28, 158}: "Dualtech IT AB", + [3]byte{0, 28, 159}: "Razorstream, LLC", + [3]byte{0, 28, 160}: "Production Resource Group, LLC", + [3]byte{0, 28, 161}: "AKAMAI TECHNOLOGIES, INC.", + [3]byte{0, 28, 162}: "ADB Broadband Italia", + [3]byte{0, 28, 163}: "Terra", + [3]byte{0, 28, 164}: "Sony Ericsson Mobile Communications", + [3]byte{0, 28, 165}: "Zygo Corporation", + [3]byte{0, 28, 166}: "Win4NET", + [3]byte{0, 28, 167}: "International Quartz Limited", + [3]byte{0, 28, 168}: "AirTies Wireless Networks", + [3]byte{0, 28, 169}: "Audiomatica Srl", + [3]byte{0, 28, 170}: "Bellon Pty Ltd", + [3]byte{0, 28, 171}: "Meyer Sound Laboratories, Inc.", + [3]byte{0, 28, 172}: "Qniq Technology Corp.", + [3]byte{0, 28, 173}: "Wuhan Telecommunication Devices Co.,Ltd", + [3]byte{0, 28, 174}: "WiChorus, Inc.", + [3]byte{0, 28, 175}: "Plato Networks Inc.", + [3]byte{0, 28, 176}: "CISCO SYSTEMS, INC.", + [3]byte{0, 28, 177}: "CISCO SYSTEMS, INC.", + [3]byte{0, 28, 178}: "BPT SPA", + [3]byte{0, 28, 179}: "Apple", + [3]byte{0, 28, 180}: "Iridium Satellite LLC", + [3]byte{0, 28, 181}: "Neihua Network Technology Co.,LTD.(NHN)", + [3]byte{0, 28, 182}: "Duzon CNT Co., Ltd.", + [3]byte{0, 28, 183}: "USC DigiArk Corporation", + [3]byte{0, 28, 184}: "CBC Co., Ltd", + [3]byte{0, 28, 185}: "KWANG SUNG ELECTRONICS CO., LTD.", + [3]byte{0, 28, 186}: "VerScient, Inc.", + [3]byte{0, 28, 187}: "MusicianLink", + [3]byte{0, 28, 188}: "CastGrabber, LLC", + [3]byte{0, 28, 189}: "Ezze Mobile Tech., Inc.", + [3]byte{0, 28, 190}: "Nintendo Co., Ltd.", + [3]byte{0, 28, 191}: "Intel Corporate", + [3]byte{0, 28, 192}: "Intel Corporate", + [3]byte{0, 28, 193}: "ARRIS Group, Inc.", + [3]byte{0, 28, 194}: "Part II Research, Inc.", + [3]byte{0, 28, 195}: "Pace plc", + [3]byte{0, 28, 196}: "Hewlett-Packard Company", + [3]byte{0, 28, 197}: "3COM LTD", + [3]byte{0, 28, 198}: "ProStor Systems", + [3]byte{0, 28, 199}: "Rembrandt Technologies, LLC d/b/a REMSTREAM", + [3]byte{0, 28, 200}: "INDUSTRONIC Industrie-Electronic GmbH & Co. KG", + [3]byte{0, 28, 201}: "Kaise Electronic Technology Co., Ltd.", + [3]byte{0, 28, 202}: "Shanghai Gaozhi Science & Technology Development Co.", + [3]byte{0, 28, 203}: "Forth Corporation Public Company Limited", + [3]byte{0, 28, 204}: "Research In Motion Limited", + [3]byte{0, 28, 205}: "Alektrona Corporation", + [3]byte{0, 28, 206}: "By Techdesign", + [3]byte{0, 28, 207}: "LIMETEK", + [3]byte{0, 28, 208}: "Circleone Co.,Ltd.", + [3]byte{0, 28, 209}: "Waves Audio LTD", + [3]byte{0, 28, 210}: "King Champion (Hong Kong) Limited", + [3]byte{0, 28, 211}: "ZP Engineering SEL", + [3]byte{0, 28, 212}: "Nokia Danmark A/S", + [3]byte{0, 28, 213}: "ZeeVee, Inc.", + [3]byte{0, 28, 214}: "Nokia Danmark A/S", + [3]byte{0, 28, 215}: "Harman/Becker Automotive Systems GmbH", + [3]byte{0, 28, 216}: "BlueAnt Wireless", + [3]byte{0, 28, 217}: "GlobalTop Technology Inc.", + [3]byte{0, 28, 218}: "Exegin Technologies Limited", + [3]byte{0, 28, 219}: "CARPOINT CO.,LTD", + [3]byte{0, 28, 220}: "Custom Computer Services, Inc.", + [3]byte{0, 28, 221}: "COWBELL ENGINEERING CO., LTD.", + [3]byte{0, 28, 222}: "Interactive Multimedia eXchange Inc.", + [3]byte{0, 28, 223}: "Belkin International Inc.", + [3]byte{0, 28, 224}: "DASAN TPS", + [3]byte{0, 28, 225}: "INDRA SISTEMAS, S.A.", + [3]byte{0, 28, 226}: "Attero Tech, LLC.", + [3]byte{0, 28, 227}: "Optimedical Systems", + [3]byte{0, 28, 228}: "EleSy JSC", + [3]byte{0, 28, 229}: "MBS Electronic Systems GmbH", + [3]byte{0, 28, 230}: "INNES", + [3]byte{0, 28, 231}: "Rocon PLC Research Centre", + [3]byte{0, 28, 232}: "Cummins Inc", + [3]byte{0, 28, 233}: "Galaxy Technology Limited", + [3]byte{0, 28, 234}: "Scientific-Atlanta, Inc", + [3]byte{0, 28, 235}: "Nortel", + [3]byte{0, 28, 236}: "Mobilesoft (Aust.) Pty Ltd", + [3]byte{0, 28, 237}: "ENVIRONNEMENT SA", + [3]byte{0, 28, 238}: "SHARP Corporation", + [3]byte{0, 28, 239}: "Primax Electronics LTD", + [3]byte{0, 28, 240}: "D-Link Corporation", + [3]byte{0, 28, 241}: "SUPoX Technology Co. , LTD.", + [3]byte{0, 28, 242}: "Tenlon Technology Co.,Ltd.", + [3]byte{0, 28, 243}: "EVS BROADCAST EQUIPMENT", + [3]byte{0, 28, 244}: "Media Technology Systems Inc", + [3]byte{0, 28, 245}: "Wiseblue Technology Limited", + [3]byte{0, 28, 246}: "CISCO SYSTEMS, INC.", + [3]byte{0, 28, 247}: "AudioScience", + [3]byte{0, 28, 248}: "Parade Technologies, Ltd.", + [3]byte{0, 28, 249}: "CISCO SYSTEMS, INC.", + [3]byte{0, 28, 250}: "Alarm.com", + [3]byte{0, 28, 251}: "ARRIS Group, Inc.", + [3]byte{0, 28, 252}: "Suminet Communication Technologies (Shanghai) Co., Ltd.", + [3]byte{0, 28, 253}: "Universal Electronics", + [3]byte{0, 28, 254}: "Quartics Inc", + [3]byte{0, 28, 255}: "Napera Networks Inc", + [3]byte{0, 29, 0}: "Brivo Systems, LLC", + [3]byte{0, 29, 1}: "Neptune Digital", + [3]byte{0, 29, 2}: "Cybertech Telecom Development", + [3]byte{0, 29, 3}: "Design Solutions Inc.", + [3]byte{0, 29, 4}: "Zipit Wireless, Inc.", + [3]byte{0, 29, 5}: "Eaton Corporation", + [3]byte{0, 29, 6}: "HM Electronics, Inc.", + [3]byte{0, 29, 7}: "Shenzhen Sang Fei Consumer Communications Co.,Ltd", + [3]byte{0, 29, 8}: "JIANGSU YINHE ELECTRONICS CO., LTD", + [3]byte{0, 29, 9}: "Dell Inc", + [3]byte{0, 29, 10}: "Davis Instruments, Inc.", + [3]byte{0, 29, 11}: "Power Standards Lab", + [3]byte{0, 29, 12}: "MobileCompia", + [3]byte{0, 29, 13}: "Sony Computer Entertainment inc.", + [3]byte{0, 29, 14}: "Agapha Technology co., Ltd.", + [3]byte{0, 29, 15}: "TP-LINK Technologies Co., Ltd.", + [3]byte{0, 29, 16}: "LightHaus Logic, Inc.", + [3]byte{0, 29, 17}: "Analogue & Micro Ltd", + [3]byte{0, 29, 18}: "ROHM CO., LTD.", + [3]byte{0, 29, 19}: "NextGTV", + [3]byte{0, 29, 20}: "SPERADTONE INFORMATION TECHNOLOGY LIMITED", + [3]byte{0, 29, 21}: "Shenzhen Dolphin Electronic Co., Ltd", + [3]byte{0, 29, 22}: "SFR", + [3]byte{0, 29, 23}: "Digital Sky Corporation", + [3]byte{0, 29, 24}: "Power Innovation GmbH", + [3]byte{0, 29, 25}: "Arcadyan Technology Corporation", + [3]byte{0, 29, 26}: "OvisLink S.A.", + [3]byte{0, 29, 27}: "Sangean Electronics Inc.", + [3]byte{0, 29, 28}: "Gennet s.a.", + [3]byte{0, 29, 29}: "Inter-M Corporation", + [3]byte{0, 29, 30}: "KYUSHU TEN CO.,LTD", + [3]byte{0, 29, 31}: "Siauliu Tauro Televizoriai, JSC", + [3]byte{0, 29, 32}: "COMTREND CO.", + [3]byte{0, 29, 33}: "Alcad SL", + [3]byte{0, 29, 34}: "Foss Analytical A/S", + [3]byte{0, 29, 35}: "SENSUS", + [3]byte{0, 29, 36}: "Aclara Power-Line Systems Inc.", + [3]byte{0, 29, 37}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 29, 38}: "Rockridgesound Technology Co.", + [3]byte{0, 29, 39}: "NAC-INTERCOM", + [3]byte{0, 29, 40}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 29, 41}: "Doro AB", + [3]byte{0, 29, 42}: "SHENZHEN BUL-TECH CO.,LTD.", + [3]byte{0, 29, 43}: "Wuhan Pont Technology CO. , LTD", + [3]byte{0, 29, 44}: "Wavetrend Technologies (Pty) Limited", + [3]byte{0, 29, 45}: "Pylone, Inc.", + [3]byte{0, 29, 46}: "Ruckus Wireless", + [3]byte{0, 29, 47}: "QuantumVision Corporation", + [3]byte{0, 29, 48}: "YX Wireless S.A.", + [3]byte{0, 29, 49}: "HIGHPRO INTERNATIONAL R&D CO,.LTD.", + [3]byte{0, 29, 50}: "Longkay Communication & Technology (Shanghai) Co. Ltd", + [3]byte{0, 29, 51}: "Maverick Systems Inc.", + [3]byte{0, 29, 52}: "SYRIS Technology Corp", + [3]byte{0, 29, 53}: "Viconics Electronics Inc.", + [3]byte{0, 29, 54}: "ELECTRONICS CORPORATION OF INDIA LIMITED", + [3]byte{0, 29, 55}: "Thales-Panda Transportation System", + [3]byte{0, 29, 56}: "Seagate Technology", + [3]byte{0, 29, 57}: "MOOHADIGITAL CO., LTD", + [3]byte{0, 29, 58}: "mh acoustics LLC", + [3]byte{0, 29, 59}: "Nokia Danmark A/S", + [3]byte{0, 29, 60}: "Muscle Corporation", + [3]byte{0, 29, 61}: "Avidyne Corporation", + [3]byte{0, 29, 62}: "SAKA TECHNO SCIENCE CO.,LTD", + [3]byte{0, 29, 63}: "Mitron Pty Ltd", + [3]byte{0, 29, 64}: "Intel – GE Care Innovations LLC", + [3]byte{0, 29, 65}: "Hardy Instruments", + [3]byte{0, 29, 66}: "Nortel", + [3]byte{0, 29, 67}: "Shenzhen G-link Digital Technology Co., Ltd.", + [3]byte{0, 29, 68}: "KROHNE Messtechnik GmbH", + [3]byte{0, 29, 69}: "CISCO SYSTEMS, INC.", + [3]byte{0, 29, 70}: "CISCO SYSTEMS, INC.", + [3]byte{0, 29, 71}: "Covote GmbH & Co KG", + [3]byte{0, 29, 72}: "Sensor-Technik Wiedemann GmbH", + [3]byte{0, 29, 73}: "Innovation Wireless Inc.", + [3]byte{0, 29, 74}: "Carestream Health, Inc.", + [3]byte{0, 29, 75}: "Grid Connect Inc.", + [3]byte{0, 29, 76}: "Alcatel-Lucent", + [3]byte{0, 29, 77}: "Adaptive Recognition Hungary, Inc", + [3]byte{0, 29, 78}: "TCM Mobile LLC", + [3]byte{0, 29, 79}: "Apple", + [3]byte{0, 29, 80}: "SPINETIX SA", + [3]byte{0, 29, 81}: "Babcock & Wilcox Power Generation Group, Inc", + [3]byte{0, 29, 82}: "Defzone B.V.", + [3]byte{0, 29, 83}: "S&O Electronics (Malaysia) Sdn. Bhd.", + [3]byte{0, 29, 84}: "Sunnic Technology & Merchandise INC.", + [3]byte{0, 29, 85}: "ZANTAZ, Inc", + [3]byte{0, 29, 86}: "Kramer Electronics Ltd.", + [3]byte{0, 29, 87}: "CAETEC Messtechnik", + [3]byte{0, 29, 88}: "CQ Inc", + [3]byte{0, 29, 89}: "Mitra Energy & Infrastructure", + [3]byte{0, 29, 90}: "2Wire Inc.", + [3]byte{0, 29, 91}: "Tecvan Informática Ltda", + [3]byte{0, 29, 92}: "Tom Communication Industrial Co.,Ltd.", + [3]byte{0, 29, 93}: "Control Dynamics Pty. Ltd.", + [3]byte{0, 29, 94}: "COMING MEDIA CORP.", + [3]byte{0, 29, 95}: "OverSpeed SARL", + [3]byte{0, 29, 96}: "ASUSTek COMPUTER INC.", + [3]byte{0, 29, 97}: "BIJ Corporation", + [3]byte{0, 29, 98}: "InPhase Technologies", + [3]byte{0, 29, 99}: "Miele & Cie. KG", + [3]byte{0, 29, 100}: "Adam Communications Systems Int Ltd", + [3]byte{0, 29, 101}: "Microwave Radio Communications", + [3]byte{0, 29, 102}: "Hyundai Telecom", + [3]byte{0, 29, 103}: "AMEC", + [3]byte{0, 29, 104}: "Thomson Telecom Belgium", + [3]byte{0, 29, 105}: "Knorr-Bremse IT-Services GmbH", + [3]byte{0, 29, 106}: "Alpha Networks Inc.", + [3]byte{0, 29, 107}: "ARRIS Group, Inc.", + [3]byte{0, 29, 108}: "ClariPhy Communications, Inc.", + [3]byte{0, 29, 109}: "Confidant International LLC", + [3]byte{0, 29, 110}: "Nokia Danmark A/S", + [3]byte{0, 29, 111}: "Chainzone Technology Co., Ltd", + [3]byte{0, 29, 112}: "CISCO SYSTEMS, INC.", + [3]byte{0, 29, 113}: "CISCO SYSTEMS, INC.", + [3]byte{0, 29, 114}: "Wistron Corporation", + [3]byte{0, 29, 115}: "Buffalo Inc.", + [3]byte{0, 29, 116}: "Tianjin China-Silicon Microelectronics Co., Ltd.", + [3]byte{0, 29, 117}: "Radioscape PLC", + [3]byte{0, 29, 118}: "Eyeheight Ltd.", + [3]byte{0, 29, 119}: "NSGate", + [3]byte{0, 29, 120}: "Invengo Information Technology Co.,Ltd", + [3]byte{0, 29, 121}: "SIGNAMAX LLC", + [3]byte{0, 29, 122}: "Wideband Semiconductor, Inc.", + [3]byte{0, 29, 123}: "Ice Energy, Inc.", + [3]byte{0, 29, 124}: "ABE Elettronica S.p.A.", + [3]byte{0, 29, 125}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{0, 29, 126}: "Cisco-Linksys, LLC", + [3]byte{0, 29, 127}: "Tekron International Ltd", + [3]byte{0, 29, 128}: "Beijing Huahuan Eletronics Co.,Ltd", + [3]byte{0, 29, 129}: "GUANGZHOU GATEWAY ELECTRONICS CO., LTD", + [3]byte{0, 29, 130}: "GN A/S (GN Netcom A/S)", + [3]byte{0, 29, 131}: "Emitech Corporation", + [3]byte{0, 29, 132}: "Gateway, Inc.", + [3]byte{0, 29, 133}: "Call Direct Cellular Solutions", + [3]byte{0, 29, 134}: "Shinwa Industries(China) Ltd.", + [3]byte{0, 29, 135}: "VigTech Labs Sdn Bhd", + [3]byte{0, 29, 136}: "Clearwire", + [3]byte{0, 29, 137}: "VaultStor Corporation", + [3]byte{0, 29, 138}: "TechTrex Inc", + [3]byte{0, 29, 139}: "ADB Broadband Italia", + [3]byte{0, 29, 140}: "La Crosse Technology LTD", + [3]byte{0, 29, 141}: "Raytek GmbH", + [3]byte{0, 29, 142}: "Alereon, Inc.", + [3]byte{0, 29, 143}: "PureWave Networks", + [3]byte{0, 29, 144}: "EMCO Flow Systems", + [3]byte{0, 29, 145}: "Digitize, Inc", + [3]byte{0, 29, 146}: "MICRO-STAR INT'L CO.,LTD.", + [3]byte{0, 29, 147}: "Modacom", + [3]byte{0, 29, 148}: "Climax Technology Co., Ltd", + [3]byte{0, 29, 149}: "Flash, Inc.", + [3]byte{0, 29, 150}: "WatchGuard Video", + [3]byte{0, 29, 151}: "Alertus Technologies LLC", + [3]byte{0, 29, 152}: "Nokia Danmark A/S", + [3]byte{0, 29, 153}: "Cyan Optic, Inc.", + [3]byte{0, 29, 154}: "GODEX INTERNATIONAL CO., LTD", + [3]byte{0, 29, 155}: "Hokuyo Automatic Co., Ltd.", + [3]byte{0, 29, 156}: "Rockwell Automation", + [3]byte{0, 29, 157}: "ARTJOY INTERNATIONAL LIMITED", + [3]byte{0, 29, 158}: "AXION TECHNOLOGIES", + [3]byte{0, 29, 159}: "MATT R.P.Traczynscy Sp.J.", + [3]byte{0, 29, 160}: "Heng Yu Electronic Manufacturing Company Limited", + [3]byte{0, 29, 161}: "CISCO SYSTEMS, INC.", + [3]byte{0, 29, 162}: "CISCO SYSTEMS, INC.", + [3]byte{0, 29, 163}: "SabiOso", + [3]byte{0, 29, 164}: "Hangzhou System Technology CO., LTD", + [3]byte{0, 29, 165}: "WB Electronics", + [3]byte{0, 29, 166}: "Media Numerics Limited", + [3]byte{0, 29, 167}: "Seamless Internet", + [3]byte{0, 29, 168}: "Takahata Electronics Co.,Ltd", + [3]byte{0, 29, 169}: "Castles Technology, Co., LTD", + [3]byte{0, 29, 170}: "DrayTek Corp.", + [3]byte{0, 29, 171}: "SwissQual License AG", + [3]byte{0, 29, 172}: "Gigamon Systems LLC", + [3]byte{0, 29, 173}: "Sinotech Engineering Consultants, Inc. Geotechnical Enginee", + [3]byte{0, 29, 174}: "CHANG TSENG TECHNOLOGY CO., LTD", + [3]byte{0, 29, 175}: "Nortel", + [3]byte{0, 29, 176}: "FuJian HengTong Information Technology Co.,Ltd", + [3]byte{0, 29, 177}: "Crescendo Networks", + [3]byte{0, 29, 178}: "HOKKAIDO ELECTRIC ENGINEERING CO.,LTD.", + [3]byte{0, 29, 179}: "HPN Supply Chain", + [3]byte{0, 29, 180}: "KUMHO ENG CO.,LTD", + [3]byte{0, 29, 181}: "Juniper networks", + [3]byte{0, 29, 182}: "BestComm Networks, Inc.", + [3]byte{0, 29, 183}: "Tendril Networks, Inc.", + [3]byte{0, 29, 184}: "Intoto Inc.", + [3]byte{0, 29, 185}: "Wellspring Wireless", + [3]byte{0, 29, 186}: "Sony Corporation", + [3]byte{0, 29, 187}: "Dynamic System Electronics Corp.", + [3]byte{0, 29, 188}: "Nintendo Co., Ltd.", + [3]byte{0, 29, 189}: "Versamed Inc.", + [3]byte{0, 29, 190}: "ARRIS Group, Inc.", + [3]byte{0, 29, 191}: "Radiient Technologies, Inc.", + [3]byte{0, 29, 192}: "Enphase Energy", + [3]byte{0, 29, 193}: "Audinate Pty L", + [3]byte{0, 29, 194}: "XORTEC OY", + [3]byte{0, 29, 195}: "RIKOR TV, Ltd", + [3]byte{0, 29, 196}: "AIOI Systems Co., Ltd.", + [3]byte{0, 29, 197}: "Beijing Jiaxun Feihong Electricial Co., Ltd.", + [3]byte{0, 29, 198}: "SNR Inc.", + [3]byte{0, 29, 199}: "L-3 Communications Geneva Aerospace", + [3]byte{0, 29, 200}: "Navionics Research Inc., dba SCADAmetrics", + [3]byte{0, 29, 201}: "GainSpan Corp.", + [3]byte{0, 29, 202}: "PAV Electronics Limited", + [3]byte{0, 29, 203}: "Exéns Development Oy", + [3]byte{0, 29, 204}: "Hetra Secure Solutions", + [3]byte{0, 29, 205}: "ARRIS Group, Inc.", + [3]byte{0, 29, 206}: "ARRIS Group, Inc.", + [3]byte{0, 29, 207}: "ARRIS Group, Inc.", + [3]byte{0, 29, 208}: "ARRIS Group, Inc.", + [3]byte{0, 29, 209}: "ARRIS Group, Inc.", + [3]byte{0, 29, 210}: "ARRIS Group, Inc.", + [3]byte{0, 29, 211}: "ARRIS Group, Inc.", + [3]byte{0, 29, 212}: "ARRIS Group, Inc.", + [3]byte{0, 29, 213}: "ARRIS Group, Inc.", + [3]byte{0, 29, 214}: "ARRIS Group, Inc.", + [3]byte{0, 29, 215}: "Algolith", + [3]byte{0, 29, 216}: "Microsoft Corporation", + [3]byte{0, 29, 217}: "Hon Hai Precision Ind.Co.,Ltd.", + [3]byte{0, 29, 218}: "Mikroelektronika spol. s r. o.", + [3]byte{0, 29, 219}: "C-BEL Corporation", + [3]byte{0, 29, 220}: "HangZhou DeChangLong Tech&Info Co.,Ltd", + [3]byte{0, 29, 221}: "DAT H.K. LIMITED", + [3]byte{0, 29, 222}: "Zhejiang Broadcast&Television Technology Co.,Ltd.", + [3]byte{0, 29, 223}: "Sunitec Enterprise Co., Ltd.", + [3]byte{0, 29, 224}: "Intel Corporate", + [3]byte{0, 29, 225}: "Intel Corporate", + [3]byte{0, 29, 226}: "Radionor Communications", + [3]byte{0, 29, 227}: "Intuicom", + [3]byte{0, 29, 228}: "Visioneered Image Systems", + [3]byte{0, 29, 229}: "CISCO SYSTEMS, INC.", + [3]byte{0, 29, 230}: "CISCO SYSTEMS, INC.", + [3]byte{0, 29, 231}: "Marine Sonic Technology, Ltd.", + [3]byte{0, 29, 232}: "Nikko Denki Tsushin Corporation(NDTC)", + [3]byte{0, 29, 233}: "Nokia Danmark A/S", + [3]byte{0, 29, 234}: "Commtest Instruments Ltd", + [3]byte{0, 29, 235}: "DINEC International", + [3]byte{0, 29, 236}: "Marusys", + [3]byte{0, 29, 237}: "Grid Net, Inc.", + [3]byte{0, 29, 238}: "NEXTVISION SISTEMAS DIGITAIS DE TELEVISÃO LTDA.", + [3]byte{0, 29, 239}: "TRIMM, INC.", + [3]byte{0, 29, 240}: "Vidient Systems, Inc.", + [3]byte{0, 29, 241}: "Intego Systems, Inc.", + [3]byte{0, 29, 242}: "Netflix, Inc.", + [3]byte{0, 29, 243}: "SBS Science & Technology Co., Ltd", + [3]byte{0, 29, 244}: "Magellan Technology Pty Limited", + [3]byte{0, 29, 245}: "Sunshine Co,LTD", + [3]byte{0, 29, 246}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 29, 247}: "R. STAHL Schaltgeräte GmbH", + [3]byte{0, 29, 248}: "Webpro Vision Technology Corporation", + [3]byte{0, 29, 249}: "Cybiotronics (Far East) Limited", + [3]byte{0, 29, 250}: "Fujian LANDI Commercial Equipment Co.,Ltd", + [3]byte{0, 29, 251}: "NETCLEUS Systems Corporation", + [3]byte{0, 29, 252}: "KSIC", + [3]byte{0, 29, 253}: "Nokia Danmark A/S", + [3]byte{0, 29, 254}: "Palm, Inc", + [3]byte{0, 29, 255}: "Network Critical Solutions Ltd", + [3]byte{0, 30, 0}: "Shantou Institute of Ultrasonic Instruments", + [3]byte{0, 30, 1}: "Renesas Technology Sales Co., Ltd.", + [3]byte{0, 30, 2}: "Sougou Keikaku Kougyou Co.,Ltd.", + [3]byte{0, 30, 3}: "LiComm Co., Ltd.", + [3]byte{0, 30, 4}: "Hanson Research Corporation", + [3]byte{0, 30, 5}: "Xseed Technologies & Computing", + [3]byte{0, 30, 6}: "WIBRAIN", + [3]byte{0, 30, 7}: "Winy Technology Co., Ltd.", + [3]byte{0, 30, 8}: "Centec Networks Inc", + [3]byte{0, 30, 9}: "ZEFATEK Co.,LTD", + [3]byte{0, 30, 10}: "Syba Tech Limited", + [3]byte{0, 30, 11}: "Hewlett-Packard Company", + [3]byte{0, 30, 12}: "Sherwood Information Partners, Inc.", + [3]byte{0, 30, 13}: "Micran Ltd.", + [3]byte{0, 30, 14}: "MAXI VIEW HOLDINGS LIMITED", + [3]byte{0, 30, 15}: "Briot International", + [3]byte{0, 30, 16}: "ShenZhen Huawei Communication Technologies Co.,Ltd.", + [3]byte{0, 30, 17}: "ELELUX INTERNATIONAL LTD", + [3]byte{0, 30, 18}: "Ecolab", + [3]byte{0, 30, 19}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 20}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 21}: "Beech Hill Electronics", + [3]byte{0, 30, 22}: "Keytronix", + [3]byte{0, 30, 23}: "STN BV", + [3]byte{0, 30, 24}: "Radio Activity srl", + [3]byte{0, 30, 25}: "GTRI", + [3]byte{0, 30, 26}: "Best Source Taiwan Inc.", + [3]byte{0, 30, 27}: "Digital Stream Technology, Inc.", + [3]byte{0, 30, 28}: "SWS Australia Pty Limited", + [3]byte{0, 30, 29}: "East Coast Datacom, Inc.", + [3]byte{0, 30, 30}: "Honeywell Life Safety", + [3]byte{0, 30, 31}: "Nortel", + [3]byte{0, 30, 32}: "Intertain Inc.", + [3]byte{0, 30, 33}: "Qisda Co.", + [3]byte{0, 30, 34}: "ARVOO Imaging Products BV", + [3]byte{0, 30, 35}: "Electronic Educational Devices, Inc", + [3]byte{0, 30, 36}: "Zhejiang Bell Technology Co.,ltd", + [3]byte{0, 30, 37}: "Intek Digital Inc", + [3]byte{0, 30, 38}: "Digifriends Co. Ltd", + [3]byte{0, 30, 39}: "SBN TECH Co.,Ltd.", + [3]byte{0, 30, 40}: "Lumexis Corporation", + [3]byte{0, 30, 41}: "Hypertherm Inc", + [3]byte{0, 30, 42}: "Netgear Inc.", + [3]byte{0, 30, 43}: "Radio Systems Design, Inc.", + [3]byte{0, 30, 44}: "CyVerse Corporation", + [3]byte{0, 30, 45}: "STIM", + [3]byte{0, 30, 46}: "SIRTI S.p.A.", + [3]byte{0, 30, 47}: "DiMoto Pty Ltd", + [3]byte{0, 30, 48}: "Shireen Inc", + [3]byte{0, 30, 49}: "INFOMARK CO.,LTD.", + [3]byte{0, 30, 50}: "Zensys", + [3]byte{0, 30, 51}: "Inventec Corporation", + [3]byte{0, 30, 52}: "CryptoMetrics", + [3]byte{0, 30, 53}: "Nintendo Co., Ltd.", + [3]byte{0, 30, 54}: "IPTE", + [3]byte{0, 30, 55}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{0, 30, 56}: "Bluecard Software Technology Co., Ltd.", + [3]byte{0, 30, 57}: "Comsys Communication Ltd.", + [3]byte{0, 30, 58}: "Nokia Danmark A/S", + [3]byte{0, 30, 59}: "Nokia Danmark A/S", + [3]byte{0, 30, 60}: "Lyngbox Media AB", + [3]byte{0, 30, 61}: "Alps Electric Co., Ltd", + [3]byte{0, 30, 62}: "KMW Inc.", + [3]byte{0, 30, 63}: "TrellisWare Technologies, Inc.", + [3]byte{0, 30, 64}: "Shanghai DareGlobal Technologies Co.,Ltd.", + [3]byte{0, 30, 65}: "Microwave Communication & Component, Inc.", + [3]byte{0, 30, 66}: "Teltonika", + [3]byte{0, 30, 67}: "AISIN AW CO.,LTD.", + [3]byte{0, 30, 68}: "SANTEC", + [3]byte{0, 30, 69}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 30, 70}: "ARRIS Group, Inc.", + [3]byte{0, 30, 71}: "PT. Hariff Daya Tunggal Engineering", + [3]byte{0, 30, 72}: "Wi-Links", + [3]byte{0, 30, 73}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 74}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 75}: "City Theatrical", + [3]byte{0, 30, 76}: "Hon Hai Precision Ind.Co., Ltd.", + [3]byte{0, 30, 77}: "Welkin Sciences, LLC", + [3]byte{0, 30, 78}: "DAKO EDV-Ingenieur- und Systemhaus GmbH", + [3]byte{0, 30, 79}: "Dell Inc.", + [3]byte{0, 30, 80}: "BATTISTONI RESEARCH", + [3]byte{0, 30, 81}: "Converter Industry Srl", + [3]byte{0, 30, 82}: "Apple", + [3]byte{0, 30, 83}: "Further Tech Co., LTD", + [3]byte{0, 30, 84}: "TOYO ELECTRIC Corporation", + [3]byte{0, 30, 85}: "COWON SYSTEMS,Inc.", + [3]byte{0, 30, 86}: "Bally Wulff Entertainment GmbH", + [3]byte{0, 30, 87}: "ALCOMA, spol. s r.o.", + [3]byte{0, 30, 88}: "D-Link Corporation", + [3]byte{0, 30, 89}: "Silicon Turnkey Express, LLC", + [3]byte{0, 30, 90}: "ARRIS Group, Inc.", + [3]byte{0, 30, 91}: "Unitron Company, Inc.", + [3]byte{0, 30, 92}: "RB GeneralEkonomik", + [3]byte{0, 30, 93}: "Holosys d.o.o.", + [3]byte{0, 30, 94}: "COmputime Ltd.", + [3]byte{0, 30, 95}: "KwikByte, LLC", + [3]byte{0, 30, 96}: "Digital Lighting Systems, Inc", + [3]byte{0, 30, 97}: "ITEC GmbH", + [3]byte{0, 30, 98}: "Siemon", + [3]byte{0, 30, 99}: "Vibro-Meter SA", + [3]byte{0, 30, 100}: "Intel Corporate", + [3]byte{0, 30, 101}: "Intel Corporate", + [3]byte{0, 30, 102}: "RESOL Elektronische Regelungen GmbH", + [3]byte{0, 30, 103}: "Intel Corporate", + [3]byte{0, 30, 104}: "Quanta Computer", + [3]byte{0, 30, 105}: "Thomson Inc.", + [3]byte{0, 30, 106}: "Beijing Bluexon Technology Co.,Ltd", + [3]byte{0, 30, 107}: "Cisco SPVTG", + [3]byte{0, 30, 108}: "Opaque Systems", + [3]byte{0, 30, 109}: "IT R&D Center", + [3]byte{0, 30, 110}: "Shenzhen First Mile Communications Ltd", + [3]byte{0, 30, 111}: "Magna-Power Electronics, Inc.", + [3]byte{0, 30, 112}: "Cobham Defence Communications Ltd", + [3]byte{0, 30, 113}: "MIrcom Group of Companies", + [3]byte{0, 30, 114}: "PCS", + [3]byte{0, 30, 115}: "ZTE CORPORATION", + [3]byte{0, 30, 116}: "SAGEM COMMUNICATION", + [3]byte{0, 30, 117}: "LG Electronics", + [3]byte{0, 30, 118}: "Thermo Fisher Scientific", + [3]byte{0, 30, 119}: "Air2App", + [3]byte{0, 30, 120}: "Owitek Technology Ltd.,", + [3]byte{0, 30, 121}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 122}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 123}: "R.I.CO. S.r.l.", + [3]byte{0, 30, 124}: "Taiwick Limited", + [3]byte{0, 30, 125}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 30, 126}: "Nortel", + [3]byte{0, 30, 127}: "CBM of America", + [3]byte{0, 30, 128}: "Last Mile Ltd.", + [3]byte{0, 30, 129}: "CNB Technology Inc.", + [3]byte{0, 30, 130}: "SanDisk Corporation", + [3]byte{0, 30, 131}: "LAN/MAN Standards Association (LMSC)", + [3]byte{0, 30, 132}: "Pika Technologies Inc.", + [3]byte{0, 30, 133}: "Lagotek Corporation", + [3]byte{0, 30, 134}: "MEL Co.,Ltd.", + [3]byte{0, 30, 135}: "Realease Limited", + [3]byte{0, 30, 136}: "ANDOR SYSTEM SUPPORT CO., LTD.", + [3]byte{0, 30, 137}: "CRFS Limited", + [3]byte{0, 30, 138}: "eCopy, Inc", + [3]byte{0, 30, 139}: "Infra Access Korea Co., Ltd.", + [3]byte{0, 30, 140}: "ASUSTek COMPUTER INC.", + [3]byte{0, 30, 141}: "ARRIS Group, Inc.", + [3]byte{0, 30, 142}: "Hunkeler AG", + [3]byte{0, 30, 143}: "CANON INC.", + [3]byte{0, 30, 144}: "Elitegroup Computer Systems Co", + [3]byte{0, 30, 145}: "KIMIN Electronic Co., Ltd.", + [3]byte{0, 30, 146}: "JEULIN S.A.", + [3]byte{0, 30, 147}: "CiriTech Systems Inc", + [3]byte{0, 30, 148}: "SUPERCOM TECHNOLOGY CORPORATION", + [3]byte{0, 30, 149}: "SIGMALINK", + [3]byte{0, 30, 150}: "Sepura Plc", + [3]byte{0, 30, 151}: "Medium Link System Technology CO., LTD,", + [3]byte{0, 30, 152}: "GreenLine Communications", + [3]byte{0, 30, 153}: "Vantanol Industrial Corporation", + [3]byte{0, 30, 154}: "HAMILTON Bonaduz AG", + [3]byte{0, 30, 155}: "San-Eisha, Ltd.", + [3]byte{0, 30, 156}: "Fidustron INC", + [3]byte{0, 30, 157}: "Recall Technologies, Inc.", + [3]byte{0, 30, 158}: "ddm hopt + schuler Gmbh + Co. KG", + [3]byte{0, 30, 159}: "Visioneering Systems, Inc.", + [3]byte{0, 30, 160}: "XLN-t", + [3]byte{0, 30, 161}: "Brunata a/s", + [3]byte{0, 30, 162}: "Symx Systems, Inc.", + [3]byte{0, 30, 163}: "Nokia Danmark A/S", + [3]byte{0, 30, 164}: "Nokia Danmark A/S", + [3]byte{0, 30, 165}: "ROBOTOUS, Inc.", + [3]byte{0, 30, 166}: "Best IT World (India) Pvt. Ltd.", + [3]byte{0, 30, 167}: "ActionTec Electronics, Inc", + [3]byte{0, 30, 168}: "Datang Mobile Communications Equipment CO.,LTD", + [3]byte{0, 30, 169}: "Nintendo Co., Ltd.", + [3]byte{0, 30, 170}: "E-Senza Technologies GmbH", + [3]byte{0, 30, 171}: "TeleWell Oy", + [3]byte{0, 30, 172}: "Armadeus Systems", + [3]byte{0, 30, 173}: "Wingtech Group Limited", + [3]byte{0, 30, 174}: "Continental Automotive Systems", + [3]byte{0, 30, 175}: "Ophir Optronics Ltd", + [3]byte{0, 30, 176}: "ImesD Electronica S.L.", + [3]byte{0, 30, 177}: "Cryptsoft Pty Ltd", + [3]byte{0, 30, 178}: "LG innotek", + [3]byte{0, 30, 179}: "Primex Wireless", + [3]byte{0, 30, 180}: "UNIFAT TECHNOLOGY LTD.", + [3]byte{0, 30, 181}: "Ever Sparkle Technologies Ltd", + [3]byte{0, 30, 182}: "TAG Heuer SA", + [3]byte{0, 30, 183}: "TBTech, Co., Ltd.", + [3]byte{0, 30, 184}: "Fortis, Inc.", + [3]byte{0, 30, 185}: "Sing Fai Technology Limited", + [3]byte{0, 30, 186}: "High Density Devices AS", + [3]byte{0, 30, 187}: "BLUELIGHT TECHNOLOGY INC.", + [3]byte{0, 30, 188}: "WINTECH AUTOMATION CO.,LTD.", + [3]byte{0, 30, 189}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 190}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 191}: "Haas Automation Inc.", + [3]byte{0, 30, 192}: "Microchip Technology Inc.", + [3]byte{0, 30, 193}: "3COM EUROPE LTD", + [3]byte{0, 30, 194}: "Apple", + [3]byte{0, 30, 195}: "Kozio, Inc.", + [3]byte{0, 30, 196}: "Celio Corp", + [3]byte{0, 30, 197}: "Middle Atlantic Products Inc", + [3]byte{0, 30, 198}: "Obvius Holdings LLC", + [3]byte{0, 30, 199}: "2Wire, Inc.", + [3]byte{0, 30, 200}: "Rapid Mobile (Pty) Ltd", + [3]byte{0, 30, 201}: "Dell Inc", + [3]byte{0, 30, 202}: "Nortel", + [3]byte{0, 30, 203}: "\"RPC \"Energoautomatika\" Ltd", + [3]byte{0, 30, 204}: "CDVI", + [3]byte{0, 30, 205}: "KYLAND Technology Co. LTD", + [3]byte{0, 30, 206}: "BISA Technologies (Hong Kong) Limited", + [3]byte{0, 30, 207}: "PHILIPS ELECTRONICS UK LTD", + [3]byte{0, 30, 208}: "Ingespace", + [3]byte{0, 30, 209}: "Keyprocessor B.V.", + [3]byte{0, 30, 210}: "Ray Shine Video Technology Inc", + [3]byte{0, 30, 211}: "Dot Technology Int'l Co., Ltd.", + [3]byte{0, 30, 212}: "Doble Engineering", + [3]byte{0, 30, 213}: "Tekon-Automatics", + [3]byte{0, 30, 214}: "Alentec & Orion AB", + [3]byte{0, 30, 215}: "H-Stream Wireless, Inc.", + [3]byte{0, 30, 216}: "Digital United Inc.", + [3]byte{0, 30, 217}: "Mitsubishi Precision Co.,LTd.", + [3]byte{0, 30, 218}: "Wesemann Elektrotechniek B.V.", + [3]byte{0, 30, 219}: "Giken Trastem Co., Ltd.", + [3]byte{0, 30, 220}: "Sony Ericsson Mobile Communications AB", + [3]byte{0, 30, 221}: "WASKO S.A.", + [3]byte{0, 30, 222}: "BYD COMPANY LIMITED", + [3]byte{0, 30, 223}: "Master Industrialization Center Kista", + [3]byte{0, 30, 224}: "Urmet Domus SpA", + [3]byte{0, 30, 225}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 30, 226}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 30, 227}: "T&W Electronics (ShenZhen) Co.,Ltd", + [3]byte{0, 30, 228}: "ACS Solutions France", + [3]byte{0, 30, 229}: "Cisco-Linksys, LLC", + [3]byte{0, 30, 230}: "Shenzhen Advanced Video Info-Tech Co., Ltd.", + [3]byte{0, 30, 231}: "Epic Systems Inc", + [3]byte{0, 30, 232}: "Mytek", + [3]byte{0, 30, 233}: "Stoneridge Electronics AB", + [3]byte{0, 30, 234}: "Sensor Switch, Inc.", + [3]byte{0, 30, 235}: "Talk-A-Phone Co.", + [3]byte{0, 30, 236}: "COMPAL INFORMATION (KUNSHAN) CO., LTD.", + [3]byte{0, 30, 237}: "Adventiq Ltd.", + [3]byte{0, 30, 238}: "ETL Systems Ltd", + [3]byte{0, 30, 239}: "Cantronic International Limited", + [3]byte{0, 30, 240}: "Gigafin Networks", + [3]byte{0, 30, 241}: "Servimat", + [3]byte{0, 30, 242}: "Micro Motion Inc", + [3]byte{0, 30, 243}: "From2", + [3]byte{0, 30, 244}: "L-3 Communications Display Systems", + [3]byte{0, 30, 245}: "Hitek Automated Inc.", + [3]byte{0, 30, 246}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 247}: "CISCO SYSTEMS, INC.", + [3]byte{0, 30, 248}: "Emfinity Inc.", + [3]byte{0, 30, 249}: "Pascom Kommunikations systeme GmbH.", + [3]byte{0, 30, 250}: "PROTEI Ltd.", + [3]byte{0, 30, 251}: "Trio Motion Technology Ltd", + [3]byte{0, 30, 252}: "JSC \"MASSA-K\"", + [3]byte{0, 30, 253}: "Microbit 2.0 AB", + [3]byte{0, 30, 254}: "LEVEL s.r.o.", + [3]byte{0, 30, 255}: "Mueller-Elektronik GmbH & Co. KG", + [3]byte{0, 31, 0}: "Nokia Danmark A/S", + [3]byte{0, 31, 1}: "Nokia Danmark A/S", + [3]byte{0, 31, 2}: "Pixelmetrix Corporation Pte Ltd", + [3]byte{0, 31, 3}: "NUM AG", + [3]byte{0, 31, 4}: "Granch Ltd.", + [3]byte{0, 31, 5}: "iTAS Technology Corp.", + [3]byte{0, 31, 6}: "Integrated Dispatch Solutions", + [3]byte{0, 31, 7}: "AZTEQ Mobile", + [3]byte{0, 31, 8}: "RISCO LTD", + [3]byte{0, 31, 9}: "JASTEC CO., LTD.", + [3]byte{0, 31, 10}: "Nortel", + [3]byte{0, 31, 11}: "Federal State Unitary Enterprise Industrial Union\"Electropribor\"", + [3]byte{0, 31, 12}: "Intelligent Digital Services GmbH", + [3]byte{0, 31, 13}: "L3 Communications - Telemetry West", + [3]byte{0, 31, 14}: "Japan Kyastem Co., Ltd", + [3]byte{0, 31, 15}: "Select Engineered Systems", + [3]byte{0, 31, 16}: "TOLEDO DO BRASIL INDUSTRIA DE BALANCAS LTDA", + [3]byte{0, 31, 17}: "OPENMOKO, INC.", + [3]byte{0, 31, 18}: "Juniper Networks", + [3]byte{0, 31, 19}: "S.& A.S. Ltd.", + [3]byte{0, 31, 20}: "NexG", + [3]byte{0, 31, 21}: "Bioscrypt Inc", + [3]byte{0, 31, 22}: "Wistron Corporation", + [3]byte{0, 31, 23}: "IDX Company, Ltd.", + [3]byte{0, 31, 24}: "Hakusan.Mfg.Co,.Ltd", + [3]byte{0, 31, 25}: "BEN-RI ELECTRONICA S.A.", + [3]byte{0, 31, 26}: "Prominvest", + [3]byte{0, 31, 27}: "RoyalTek Company Ltd.", + [3]byte{0, 31, 28}: "KOBISHI ELECTRIC Co.,Ltd.", + [3]byte{0, 31, 29}: "Atlas Material Testing Technology LLC", + [3]byte{0, 31, 30}: "Astec Technology Co., Ltd", + [3]byte{0, 31, 31}: "Edimax Technology Co. Ltd.", + [3]byte{0, 31, 32}: "Logitech Europe SA", + [3]byte{0, 31, 33}: "Inner Mongolia Yin An Science & Technology Development Co.,L", + [3]byte{0, 31, 34}: "Source Photonics, Inc.", + [3]byte{0, 31, 35}: "Interacoustics", + [3]byte{0, 31, 36}: "DIGITVIEW TECHNOLOGY CO., LTD.", + [3]byte{0, 31, 37}: "MBS GmbH", + [3]byte{0, 31, 38}: "CISCO SYSTEMS, INC.", + [3]byte{0, 31, 39}: "CISCO SYSTEMS, INC.", + [3]byte{0, 31, 40}: "HPN Supply Chain", + [3]byte{0, 31, 41}: "Hewlett-Packard Company", + [3]byte{0, 31, 42}: "ACCM", + [3]byte{0, 31, 43}: "Orange Logic", + [3]byte{0, 31, 44}: "Starbridge Networks", + [3]byte{0, 31, 45}: "Electro-Optical Imaging, Inc.", + [3]byte{0, 31, 46}: "Triangle Research Int'l Pte Ltd", + [3]byte{0, 31, 47}: "Berker GmbH & Co. KG", + [3]byte{0, 31, 48}: "Travelping", + [3]byte{0, 31, 49}: "Radiocomp", + [3]byte{0, 31, 50}: "Nintendo Co., Ltd.", + [3]byte{0, 31, 51}: "Netgear Inc.", + [3]byte{0, 31, 52}: "Lung Hwa Electronics Co., Ltd.", + [3]byte{0, 31, 53}: "AIR802 LLC", + [3]byte{0, 31, 54}: "Bellwin Information Co. Ltd.,", + [3]byte{0, 31, 55}: "Genesis I&C", + [3]byte{0, 31, 56}: "POSITRON", + [3]byte{0, 31, 57}: "Construcciones y Auxiliar de Ferrocarriles, S.A.", + [3]byte{0, 31, 58}: "Hon Hai Precision Ind.Co., Ltd.", + [3]byte{0, 31, 59}: "Intel Corporate", + [3]byte{0, 31, 60}: "Intel Corporate", + [3]byte{0, 31, 61}: "Qbit GmbH", + [3]byte{0, 31, 62}: "RP-Technik e.K.", + [3]byte{0, 31, 63}: "AVM GmbH", + [3]byte{0, 31, 64}: "Speakercraft Inc.", + [3]byte{0, 31, 65}: "Ruckus Wireless", + [3]byte{0, 31, 66}: "Etherstack plc", + [3]byte{0, 31, 67}: "ENTES ELEKTRONIK", + [3]byte{0, 31, 68}: "GE Transportation Systems", + [3]byte{0, 31, 69}: "Enterasys", + [3]byte{0, 31, 70}: "Nortel", + [3]byte{0, 31, 71}: "MCS Logic Inc.", + [3]byte{0, 31, 72}: "Mojix Inc.", + [3]byte{0, 31, 73}: "Eurosat Distribution Ltd", + [3]byte{0, 31, 74}: "Albentia Systems S.A.", + [3]byte{0, 31, 75}: "Lineage Power", + [3]byte{0, 31, 76}: "Roseman Engineering Ltd", + [3]byte{0, 31, 77}: "Segnetics LLC", + [3]byte{0, 31, 78}: "ConMed Linvatec", + [3]byte{0, 31, 79}: "Thinkware Co. Ltd.", + [3]byte{0, 31, 80}: "Swissdis AG", + [3]byte{0, 31, 81}: "HD Communications Corp", + [3]byte{0, 31, 82}: "UVT Unternehmensberatung fur Verkehr und Technik GmbH", + [3]byte{0, 31, 83}: "GEMAC Gesellschaft für Mikroelektronikanwendung Chemnitz mbH", + [3]byte{0, 31, 84}: "Lorex Technology Inc.", + [3]byte{0, 31, 85}: "Honeywell Security (China) Co., Ltd.", + [3]byte{0, 31, 86}: "DIGITAL FORECAST", + [3]byte{0, 31, 87}: "Phonik Innovation Co.,LTD", + [3]byte{0, 31, 88}: "EMH Energiemesstechnik GmbH", + [3]byte{0, 31, 89}: "Kronback Tracers", + [3]byte{0, 31, 90}: "Beckwith Electric Co.", + [3]byte{0, 31, 91}: "Apple", + [3]byte{0, 31, 92}: "Nokia Danmark A/S", + [3]byte{0, 31, 93}: "Nokia Danmark A/S", + [3]byte{0, 31, 94}: "Dyna Technology Co.,Ltd.", + [3]byte{0, 31, 95}: "Blatand GmbH", + [3]byte{0, 31, 96}: "COMPASS SYSTEMS CORP.", + [3]byte{0, 31, 97}: "Talent Communication Networks Inc.", + [3]byte{0, 31, 98}: "JSC \"Stilsoft\"", + [3]byte{0, 31, 99}: "JSC Goodwin-Europa", + [3]byte{0, 31, 100}: "Beijing Autelan Technology Inc.", + [3]byte{0, 31, 101}: "KOREA ELECTRIC TERMINAL CO., LTD.", + [3]byte{0, 31, 102}: "PLANAR LLC", + [3]byte{0, 31, 103}: "Hitachi,Ltd.", + [3]byte{0, 31, 104}: "Martinsson Elektronik AB", + [3]byte{0, 31, 105}: "Pingood Technology Co., Ltd.", + [3]byte{0, 31, 106}: "PacketFlux Technologies, Inc.", + [3]byte{0, 31, 107}: "LG Electronics", + [3]byte{0, 31, 108}: "CISCO SYSTEMS, INC.", + [3]byte{0, 31, 109}: "CISCO SYSTEMS, INC.", + [3]byte{0, 31, 110}: "Vtech Engineering Corporation", + [3]byte{0, 31, 111}: "Fujian Sunnada Communication Co.,Ltd.", + [3]byte{0, 31, 112}: "Botik Technologies LTD", + [3]byte{0, 31, 113}: "xG Technology, Inc.", + [3]byte{0, 31, 114}: "QingDao Hiphone Technology Co,.Ltd", + [3]byte{0, 31, 115}: "Teraview Technology Co., Ltd.", + [3]byte{0, 31, 116}: "Eigen Development", + [3]byte{0, 31, 117}: "GiBahn Media", + [3]byte{0, 31, 118}: "AirLogic Systems Inc.", + [3]byte{0, 31, 119}: "HEOL DESIGN", + [3]byte{0, 31, 120}: "Blue Fox Porini Textile", + [3]byte{0, 31, 121}: "Lodam Electronics A/S", + [3]byte{0, 31, 122}: "WiWide Inc.", + [3]byte{0, 31, 123}: "TechNexion Ltd.", + [3]byte{0, 31, 124}: "Witelcom AS", + [3]byte{0, 31, 125}: "embedded wireless GmbH", + [3]byte{0, 31, 126}: "ARRIS Group, Inc.", + [3]byte{0, 31, 127}: "Phabrix Limited", + [3]byte{0, 31, 128}: "Lucas Holding bv", + [3]byte{0, 31, 129}: "Accel Semiconductor Corp", + [3]byte{0, 31, 130}: "Cal-Comp Electronics & Communications Co., Ltd", + [3]byte{0, 31, 131}: "Teleplan Technology Services Sdn Bhd", + [3]byte{0, 31, 132}: "Gigle Semiconductor", + [3]byte{0, 31, 133}: "Apriva ISS, LLC", + [3]byte{0, 31, 134}: "digEcor", + [3]byte{0, 31, 135}: "Skydigital Inc.", + [3]byte{0, 31, 136}: "FMS Force Measuring Systems AG", + [3]byte{0, 31, 137}: "Signalion GmbH", + [3]byte{0, 31, 138}: "Ellion Digital Inc.", + [3]byte{0, 31, 139}: "Cache IQ", + [3]byte{0, 31, 140}: "CCS Inc.", + [3]byte{0, 31, 141}: "Ingenieurbuero Stark GmbH und Ko. KG", + [3]byte{0, 31, 142}: "Metris USA Inc.", + [3]byte{0, 31, 143}: "Shanghai Bellmann Digital Source Co.,Ltd.", + [3]byte{0, 31, 144}: "Actiontec Electronics, Inc", + [3]byte{0, 31, 145}: "DBS Lodging Technologies, LLC", + [3]byte{0, 31, 146}: "VideoIQ, Inc.", + [3]byte{0, 31, 147}: "Xiotech Corporation", + [3]byte{0, 31, 148}: "Lascar Electronics Ltd", + [3]byte{0, 31, 149}: "SAGEM COMMUNICATION", + [3]byte{0, 31, 150}: "APROTECH CO.LTD", + [3]byte{0, 31, 151}: "BERTANA SRL", + [3]byte{0, 31, 152}: "DAIICHI-DENTSU LTD.", + [3]byte{0, 31, 153}: "SERONICS co.ltd", + [3]byte{0, 31, 154}: "Nortel Networks", + [3]byte{0, 31, 155}: "POSBRO", + [3]byte{0, 31, 156}: "LEDCO", + [3]byte{0, 31, 157}: "CISCO SYSTEMS, INC.", + [3]byte{0, 31, 158}: "CISCO SYSTEMS, INC.", + [3]byte{0, 31, 159}: "Thomson Telecom Belgium", + [3]byte{0, 31, 160}: "A10 Networks", + [3]byte{0, 31, 161}: "Gtran Inc", + [3]byte{0, 31, 162}: "Datron World Communications, Inc.", + [3]byte{0, 31, 163}: "T&W Electronics(Shenzhen)Co.,Ltd.", + [3]byte{0, 31, 164}: "ShenZhen Gongjin Electronics Co.,Ltd", + [3]byte{0, 31, 165}: "Blue-White Industries", + [3]byte{0, 31, 166}: "Stilo srl", + [3]byte{0, 31, 167}: "Sony Computer Entertainment Inc.", + [3]byte{0, 31, 168}: "Smart Energy Instruments Inc.", + [3]byte{0, 31, 169}: "Atlanta DTH, Inc.", + [3]byte{0, 31, 170}: "Taseon, Inc.", + [3]byte{0, 31, 171}: "I.S HIGH TECH.INC", + [3]byte{0, 31, 172}: "Goodmill Systems Ltd", + [3]byte{0, 31, 173}: "Brown Innovations, Inc", + [3]byte{0, 31, 174}: "Blick South Africa (Pty) Ltd", + [3]byte{0, 31, 175}: "NextIO, Inc.", + [3]byte{0, 31, 176}: "TimeIPS, Inc.", + [3]byte{0, 31, 177}: "Cybertech Inc.", + [3]byte{0, 31, 178}: "Sontheim Industrie Elektronik GmbH", + [3]byte{0, 31, 179}: "2Wire", + [3]byte{0, 31, 180}: "SmartShare Systems", + [3]byte{0, 31, 181}: "I/O Interconnect Inc.", + [3]byte{0, 31, 182}: "Chi Lin Technology Co., Ltd.", + [3]byte{0, 31, 183}: "WiMate Technologies Corp.", + [3]byte{0, 31, 184}: "Universal Remote Control, Inc.", + [3]byte{0, 31, 185}: "Paltronics", + [3]byte{0, 31, 186}: "BoYoung Tech. & Marketing, Inc.", + [3]byte{0, 31, 187}: "Xenatech Co.,LTD", + [3]byte{0, 31, 188}: "EVGA Corporation", + [3]byte{0, 31, 189}: "Kyocera Wireless Corp.", + [3]byte{0, 31, 190}: "Shenzhen Mopnet Industrial Co.,Ltd", + [3]byte{0, 31, 191}: "Fulhua Microelectronics Corp. Taiwan Branch", + [3]byte{0, 31, 192}: "Control Express Finland Oy", + [3]byte{0, 31, 193}: "Hanlong Technology Co.,LTD", + [3]byte{0, 31, 194}: "Jow Tong Technology Co Ltd", + [3]byte{0, 31, 195}: "SmartSynch, Inc", + [3]byte{0, 31, 196}: "ARRIS Group, Inc.", + [3]byte{0, 31, 197}: "Nintendo Co., Ltd.", + [3]byte{0, 31, 198}: "ASUSTek COMPUTER INC.", + [3]byte{0, 31, 199}: "Casio Hitachi Mobile Comunications Co., Ltd.", + [3]byte{0, 31, 200}: "Up-Today Industrial Co., Ltd.", + [3]byte{0, 31, 201}: "CISCO SYSTEMS, INC.", + [3]byte{0, 31, 202}: "CISCO SYSTEMS, INC.", + [3]byte{0, 31, 203}: "NIW Solutions", + [3]byte{0, 31, 204}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 31, 205}: "Samsung Electronics", + [3]byte{0, 31, 206}: "QTECH LLC", + [3]byte{0, 31, 207}: "MSI Technology GmbH", + [3]byte{0, 31, 208}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{0, 31, 209}: "OPTEX CO.,LTD.", + [3]byte{0, 31, 210}: "COMMTECH TECHNOLOGY MACAO COMMERCIAL OFFSHORE LTD.", + [3]byte{0, 31, 211}: "RIVA Networks Inc.", + [3]byte{0, 31, 212}: "4IPNET, INC.", + [3]byte{0, 31, 213}: "MICRORISC s.r.o.", + [3]byte{0, 31, 214}: "Shenzhen Allywll", + [3]byte{0, 31, 215}: "TELERAD SA", + [3]byte{0, 31, 216}: "A-TRUST COMPUTER CORPORATION", + [3]byte{0, 31, 217}: "RSD Communications Ltd", + [3]byte{0, 31, 218}: "Nortel Networks", + [3]byte{0, 31, 219}: "Network Supply Corp.,", + [3]byte{0, 31, 220}: "Mobile Safe Track Ltd", + [3]byte{0, 31, 221}: "GDI LLC", + [3]byte{0, 31, 222}: "Nokia Danmark A/S", + [3]byte{0, 31, 223}: "Nokia Danmark A/S", + [3]byte{0, 31, 224}: "EdgeVelocity Corp", + [3]byte{0, 31, 225}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 31, 226}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 31, 227}: "LG Electronics", + [3]byte{0, 31, 228}: "Sony Ericsson Mobile Communications", + [3]byte{0, 31, 229}: "In-Circuit GmbH", + [3]byte{0, 31, 230}: "Alphion Corporation", + [3]byte{0, 31, 231}: "Simet", + [3]byte{0, 31, 232}: "KURUSUGAWA Electronics Industry Inc,.", + [3]byte{0, 31, 233}: "Printrex, Inc.", + [3]byte{0, 31, 234}: "Applied Media Technologies Corporation", + [3]byte{0, 31, 235}: "Trio Datacom Pty Ltd", + [3]byte{0, 31, 236}: "Synapse Électronique", + [3]byte{0, 31, 237}: "Tecan Systems Inc.", + [3]byte{0, 31, 238}: "ubisys technologies GmbH", + [3]byte{0, 31, 239}: "SHINSEI INDUSTRIES CO.,LTD", + [3]byte{0, 31, 240}: "Audio Partnership", + [3]byte{0, 31, 241}: "Paradox Hellas S.A.", + [3]byte{0, 31, 242}: "VIA Technologies, Inc.", + [3]byte{0, 31, 243}: "Apple", + [3]byte{0, 31, 244}: "Power Monitors, Inc.", + [3]byte{0, 31, 245}: "Kongsberg Defence & Aerospace", + [3]byte{0, 31, 246}: "PS Audio International", + [3]byte{0, 31, 247}: "Nakajima All Precision Co., Ltd.", + [3]byte{0, 31, 248}: "Siemens AG, Sector Industry, Drive Technologies, Motion Control Systems", + [3]byte{0, 31, 249}: "Advanced Knowledge Associates", + [3]byte{0, 31, 250}: "Coretree, Co, Ltd", + [3]byte{0, 31, 251}: "Green Packet Bhd", + [3]byte{0, 31, 252}: "Riccius+Sohn GmbH", + [3]byte{0, 31, 253}: "Indigo Mobile Technologies Corp.", + [3]byte{0, 31, 254}: "HPN Supply Chain", + [3]byte{0, 31, 255}: "Respironics, Inc.", + [3]byte{0, 32, 0}: "LEXMARK INTERNATIONAL, INC.", + [3]byte{0, 32, 1}: "DSP SOLUTIONS, INC.", + [3]byte{0, 32, 2}: "SERITECH ENTERPRISE CO., LTD.", + [3]byte{0, 32, 3}: "PIXEL POWER LTD.", + [3]byte{0, 32, 4}: "YAMATAKE-HONEYWELL CO., LTD.", + [3]byte{0, 32, 5}: "SIMPLE TECHNOLOGY", + [3]byte{0, 32, 6}: "GARRETT COMMUNICATIONS, INC.", + [3]byte{0, 32, 7}: "SFA, INC.", + [3]byte{0, 32, 8}: "CABLE & COMPUTER TECHNOLOGY", + [3]byte{0, 32, 9}: "PACKARD BELL ELEC., INC.", + [3]byte{0, 32, 10}: "SOURCE-COMM CORP.", + [3]byte{0, 32, 11}: "OCTAGON SYSTEMS CORP.", + [3]byte{0, 32, 12}: "ADASTRA SYSTEMS CORP.", + [3]byte{0, 32, 13}: "CARL ZEISS", + [3]byte{0, 32, 14}: "SATELLITE TECHNOLOGY MGMT, INC", + [3]byte{0, 32, 15}: "TANBAC CO., LTD.", + [3]byte{0, 32, 16}: "JEOL SYSTEM TECHNOLOGY CO. LTD", + [3]byte{0, 32, 17}: "CANOPUS CO., LTD.", + [3]byte{0, 32, 18}: "CAMTRONICS MEDICAL SYSTEMS", + [3]byte{0, 32, 19}: "DIVERSIFIED TECHNOLOGY, INC.", + [3]byte{0, 32, 20}: "GLOBAL VIEW CO., LTD.", + [3]byte{0, 32, 21}: "ACTIS COMPUTER SA", + [3]byte{0, 32, 22}: "SHOWA ELECTRIC WIRE & CABLE CO", + [3]byte{0, 32, 23}: "ORBOTECH", + [3]byte{0, 32, 24}: "CIS TECHNOLOGY INC.", + [3]byte{0, 32, 25}: "OHLER GmbH", + [3]byte{0, 32, 26}: "MRV Communications, Inc.", + [3]byte{0, 32, 27}: "NORTHERN TELECOM/NETWORK", + [3]byte{0, 32, 28}: "EXCEL, INC.", + [3]byte{0, 32, 29}: "KATANA PRODUCTS", + [3]byte{0, 32, 30}: "NETQUEST CORPORATION", + [3]byte{0, 32, 31}: "BEST POWER TECHNOLOGY, INC.", + [3]byte{0, 32, 32}: "MEGATRON COMPUTER INDUSTRIES PTY, LTD.", + [3]byte{0, 32, 33}: "ALGORITHMS SOFTWARE PVT. LTD.", + [3]byte{0, 32, 34}: "NMS Communications", + [3]byte{0, 32, 35}: "T.C. TECHNOLOGIES PTY. LTD", + [3]byte{0, 32, 36}: "PACIFIC COMMUNICATION SCIENCES", + [3]byte{0, 32, 37}: "CONTROL TECHNOLOGY, INC.", + [3]byte{0, 32, 38}: "AMKLY SYSTEMS, INC.", + [3]byte{0, 32, 39}: "MING FORTUNE INDUSTRY CO., LTD", + [3]byte{0, 32, 40}: "WEST EGG SYSTEMS, INC.", + [3]byte{0, 32, 41}: "TELEPROCESSING PRODUCTS, INC.", + [3]byte{0, 32, 42}: "N.V. DZINE", + [3]byte{0, 32, 43}: "ADVANCED TELECOMMUNICATIONS MODULES, LTD.", + [3]byte{0, 32, 44}: "WELLTRONIX CO., LTD.", + [3]byte{0, 32, 45}: "TAIYO CORPORATION", + [3]byte{0, 32, 46}: "DAYSTAR DIGITAL", + [3]byte{0, 32, 47}: "ZETA COMMUNICATIONS, LTD.", + [3]byte{0, 32, 48}: "ANALOG & DIGITAL SYSTEMS", + [3]byte{0, 32, 49}: "Tattile SRL", + [3]byte{0, 32, 50}: "ALCATEL TAISEL", + [3]byte{0, 32, 51}: "SYNAPSE TECHNOLOGIES, INC.", + [3]byte{0, 32, 52}: "ROTEC INDUSTRIEAUTOMATION GMBH", + [3]byte{0, 32, 53}: "IBM Corp", + [3]byte{0, 32, 54}: "BMC SOFTWARE", + [3]byte{0, 32, 55}: "SEAGATE TECHNOLOGY", + [3]byte{0, 32, 56}: "VME MICROSYSTEMS INTERNATIONAL CORPORATION", + [3]byte{0, 32, 57}: "SCINETS", + [3]byte{0, 32, 58}: "DIGITAL BI0METRICS INC.", + [3]byte{0, 32, 59}: "WISDM LTD.", + [3]byte{0, 32, 60}: "EUROTIME AB", + [3]byte{0, 32, 61}: "Honeywell ECC", + [3]byte{0, 32, 62}: "LogiCan Technologies, Inc.", + [3]byte{0, 32, 63}: "JUKI CORPORATION", + [3]byte{0, 32, 64}: "ARRIS Group, Inc.", + [3]byte{0, 32, 65}: "DATA NET", + [3]byte{0, 32, 66}: "DATAMETRICS CORP.", + [3]byte{0, 32, 67}: "NEURON COMPANY LIMITED", + [3]byte{0, 32, 68}: "GENITECH PTY LTD", + [3]byte{0, 32, 69}: "ION Networks, Inc.", + [3]byte{0, 32, 70}: "CIPRICO, INC.", + [3]byte{0, 32, 71}: "STEINBRECHER CORP.", + [3]byte{0, 32, 72}: "Marconi Communications", + [3]byte{0, 32, 73}: "COMTRON, INC.", + [3]byte{0, 32, 74}: "PRONET GMBH", + [3]byte{0, 32, 75}: "AUTOCOMPUTER CO., LTD.", + [3]byte{0, 32, 76}: "MITRON COMPUTER PTE LTD.", + [3]byte{0, 32, 77}: "INOVIS GMBH", + [3]byte{0, 32, 78}: "NETWORK SECURITY SYSTEMS, INC.", + [3]byte{0, 32, 79}: "DEUTSCHE AEROSPACE AG", + [3]byte{0, 32, 80}: "KOREA COMPUTER INC.", + [3]byte{0, 32, 81}: "Verilink Corporation", + [3]byte{0, 32, 82}: "RAGULA SYSTEMS", + [3]byte{0, 32, 83}: "HUNTSVILLE MICROSYSTEMS, INC.", + [3]byte{0, 32, 84}: "Sycamore Networks", + [3]byte{0, 32, 85}: "ALTECH CO., LTD.", + [3]byte{0, 32, 86}: "NEOPRODUCTS", + [3]byte{0, 32, 87}: "TITZE DATENTECHNIK GmbH", + [3]byte{0, 32, 88}: "ALLIED SIGNAL INC.", + [3]byte{0, 32, 89}: "MIRO COMPUTER PRODUCTS AG", + [3]byte{0, 32, 90}: "COMPUTER IDENTICS", + [3]byte{0, 32, 91}: "Kentrox, LLC", + [3]byte{0, 32, 92}: "InterNet Systems of Florida, Inc.", + [3]byte{0, 32, 93}: "NANOMATIC OY", + [3]byte{0, 32, 94}: "CASTLE ROCK, INC.", + [3]byte{0, 32, 95}: "GAMMADATA COMPUTER GMBH", + [3]byte{0, 32, 96}: "ALCATEL ITALIA S.p.A.", + [3]byte{0, 32, 97}: "GarrettCom, Inc.", + [3]byte{0, 32, 98}: "SCORPION LOGIC, LTD.", + [3]byte{0, 32, 99}: "WIPRO INFOTECH LTD.", + [3]byte{0, 32, 100}: "PROTEC MICROSYSTEMS, INC.", + [3]byte{0, 32, 101}: "SUPERNET NETWORKING INC.", + [3]byte{0, 32, 102}: "GENERAL MAGIC, INC.", + [3]byte{0, 32, 103}: "PRIVATE", + [3]byte{0, 32, 104}: "ISDYNE", + [3]byte{0, 32, 105}: "ISDN SYSTEMS CORPORATION", + [3]byte{0, 32, 106}: "OSAKA COMPUTER CORP.", + [3]byte{0, 32, 107}: "KONICA MINOLTA HOLDINGS, INC.", + [3]byte{0, 32, 108}: "EVERGREEN TECHNOLOGY CORP.", + [3]byte{0, 32, 109}: "DATA RACE, INC.", + [3]byte{0, 32, 110}: "XACT, INC.", + [3]byte{0, 32, 111}: "FLOWPOINT CORPORATION", + [3]byte{0, 32, 112}: "HYNET, LTD.", + [3]byte{0, 32, 113}: "IBR GMBH", + [3]byte{0, 32, 114}: "WORKLINK INNOVATIONS", + [3]byte{0, 32, 115}: "FUSION SYSTEMS CORPORATION", + [3]byte{0, 32, 116}: "SUNGWOON SYSTEMS", + [3]byte{0, 32, 117}: "MOTOROLA COMMUNICATION ISRAEL", + [3]byte{0, 32, 118}: "REUDO CORPORATION", + [3]byte{0, 32, 119}: "KARDIOS SYSTEMS CORP.", + [3]byte{0, 32, 120}: "RUNTOP, INC.", + [3]byte{0, 32, 121}: "MIKRON GMBH", + [3]byte{0, 32, 122}: "WiSE Communications, Inc.", + [3]byte{0, 32, 123}: "Intel Corporation", + [3]byte{0, 32, 124}: "AUTEC GmbH", + [3]byte{0, 32, 125}: "ADVANCED COMPUTER APPLICATIONS", + [3]byte{0, 32, 126}: "FINECOM Co., Ltd.", + [3]byte{0, 32, 127}: "KYOEI SANGYO CO., LTD.", + [3]byte{0, 32, 128}: "SYNERGY (UK) LTD.", + [3]byte{0, 32, 129}: "TITAN ELECTRONICS", + [3]byte{0, 32, 130}: "ONEAC CORPORATION", + [3]byte{0, 32, 131}: "PRESTICOM INCORPORATED", + [3]byte{0, 32, 132}: "OCE PRINTING SYSTEMS, GMBH", + [3]byte{0, 32, 133}: "Eaton Corporation", + [3]byte{0, 32, 134}: "MICROTECH ELECTRONICS LIMITED", + [3]byte{0, 32, 135}: "MEMOTEC, INC.", + [3]byte{0, 32, 136}: "GLOBAL VILLAGE COMMUNICATION", + [3]byte{0, 32, 137}: "T3PLUS NETWORKING, INC.", + [3]byte{0, 32, 138}: "SONIX COMMUNICATIONS, LTD.", + [3]byte{0, 32, 139}: "LAPIS TECHNOLOGIES, INC.", + [3]byte{0, 32, 140}: "GALAXY NETWORKS, INC.", + [3]byte{0, 32, 141}: "CMD TECHNOLOGY", + [3]byte{0, 32, 142}: "CHEVIN SOFTWARE ENG. LTD.", + [3]byte{0, 32, 143}: "ECI TELECOM LTD.", + [3]byte{0, 32, 144}: "ADVANCED COMPRESSION TECHNOLOGY, INC.", + [3]byte{0, 32, 145}: "J125, NATIONAL SECURITY AGENCY", + [3]byte{0, 32, 146}: "CHESS ENGINEERING B.V.", + [3]byte{0, 32, 147}: "LANDINGS TECHNOLOGY CORP.", + [3]byte{0, 32, 148}: "CUBIX CORPORATION", + [3]byte{0, 32, 149}: "RIVA ELECTRONICS", + [3]byte{0, 32, 150}: "Invensys", + [3]byte{0, 32, 151}: "APPLIED SIGNAL TECHNOLOGY", + [3]byte{0, 32, 152}: "HECTRONIC AB", + [3]byte{0, 32, 153}: "BON ELECTRIC CO., LTD.", + [3]byte{0, 32, 154}: "THE 3DO COMPANY", + [3]byte{0, 32, 155}: "ERSAT ELECTRONIC GMBH", + [3]byte{0, 32, 156}: "PRIMARY ACCESS CORP.", + [3]byte{0, 32, 157}: "LIPPERT AUTOMATIONSTECHNIK", + [3]byte{0, 32, 158}: "BROWN'S OPERATING SYSTEM SERVICES, LTD.", + [3]byte{0, 32, 159}: "MERCURY COMPUTER SYSTEMS, INC.", + [3]byte{0, 32, 160}: "OA LABORATORY CO., LTD.", + [3]byte{0, 32, 161}: "DOVATRON", + [3]byte{0, 32, 162}: "GALCOM NETWORKING LTD.", + [3]byte{0, 32, 163}: "Harmonic, Inc", + [3]byte{0, 32, 164}: "MULTIPOINT NETWORKS", + [3]byte{0, 32, 165}: "API ENGINEERING", + [3]byte{0, 32, 166}: "Proxim Wireless", + [3]byte{0, 32, 167}: "PAIRGAIN TECHNOLOGIES, INC.", + [3]byte{0, 32, 168}: "SAST TECHNOLOGY CORP.", + [3]byte{0, 32, 169}: "WHITE HORSE INDUSTRIAL", + [3]byte{0, 32, 170}: "Ericsson Television Limited", + [3]byte{0, 32, 171}: "MICRO INDUSTRIES CORP.", + [3]byte{0, 32, 172}: "INTERFLEX DATENSYSTEME GMBH", + [3]byte{0, 32, 173}: "LINQ SYSTEMS", + [3]byte{0, 32, 174}: "ORNET DATA COMMUNICATION TECH.", + [3]byte{0, 32, 175}: "3COM CORPORATION", + [3]byte{0, 32, 176}: "GATEWAY DEVICES, INC.", + [3]byte{0, 32, 177}: "COMTECH RESEARCH INC.", + [3]byte{0, 32, 178}: "GKD Gesellschaft Fur Kommunikation Und Datentechnik", + [3]byte{0, 32, 179}: "Tattile SRL", + [3]byte{0, 32, 180}: "TERMA ELEKTRONIK AS", + [3]byte{0, 32, 181}: "YASKAWA ELECTRIC CORPORATION", + [3]byte{0, 32, 182}: "AGILE NETWORKS, INC.", + [3]byte{0, 32, 183}: "NAMAQUA COMPUTERWARE", + [3]byte{0, 32, 184}: "PRIME OPTION, INC.", + [3]byte{0, 32, 185}: "METRICOM, INC.", + [3]byte{0, 32, 186}: "CENTER FOR HIGH PERFORMANCE", + [3]byte{0, 32, 187}: "ZAX CORPORATION", + [3]byte{0, 32, 188}: "Long Reach Networks Pty Ltd", + [3]byte{0, 32, 189}: "NIOBRARA R & D CORPORATION", + [3]byte{0, 32, 190}: "LAN ACCESS CORP.", + [3]byte{0, 32, 191}: "AEHR TEST SYSTEMS", + [3]byte{0, 32, 192}: "PULSE ELECTRONICS, INC.", + [3]byte{0, 32, 193}: "SAXA, Inc.", + [3]byte{0, 32, 194}: "TEXAS MEMORY SYSTEMS, INC.", + [3]byte{0, 32, 195}: "COUNTER SOLUTIONS LTD.", + [3]byte{0, 32, 196}: "INET,INC.", + [3]byte{0, 32, 197}: "EAGLE TECHNOLOGY", + [3]byte{0, 32, 198}: "NECTEC", + [3]byte{0, 32, 199}: "AKAI Professional M.I. Corp.", + [3]byte{0, 32, 200}: "LARSCOM INCORPORATED", + [3]byte{0, 32, 201}: "VICTRON BV", + [3]byte{0, 32, 202}: "DIGITAL OCEAN", + [3]byte{0, 32, 203}: "PRETEC ELECTRONICS CORP.", + [3]byte{0, 32, 204}: "DIGITAL SERVICES, LTD.", + [3]byte{0, 32, 205}: "HYBRID NETWORKS, INC.", + [3]byte{0, 32, 206}: "LOGICAL DESIGN GROUP, INC.", + [3]byte{0, 32, 207}: "TEST & MEASUREMENT SYSTEMS INC", + [3]byte{0, 32, 208}: "VERSALYNX CORPORATION", + [3]byte{0, 32, 209}: "MICROCOMPUTER SYSTEMS (M) SDN.", + [3]byte{0, 32, 210}: "RAD DATA COMMUNICATIONS, LTD.", + [3]byte{0, 32, 211}: "OST (OUEST STANDARD TELEMATIQU", + [3]byte{0, 32, 212}: "CABLETRON - ZEITTNET INC.", + [3]byte{0, 32, 213}: "VIPA GMBH", + [3]byte{0, 32, 214}: "BREEZECOM", + [3]byte{0, 32, 215}: "JAPAN MINICOMPUTER SYSTEMS CO., Ltd.", + [3]byte{0, 32, 216}: "Nortel Networks", + [3]byte{0, 32, 217}: "PANASONIC TECHNOLOGIES, INC./MIECO-US", + [3]byte{0, 32, 218}: "Alcatel North America ESD", + [3]byte{0, 32, 219}: "XNET TECHNOLOGY, INC.", + [3]byte{0, 32, 220}: "DENSITRON TAIWAN LTD.", + [3]byte{0, 32, 221}: "Cybertec Pty Ltd", + [3]byte{0, 32, 222}: "JAPAN DIGITAL LABORAT'Y CO.LTD", + [3]byte{0, 32, 223}: "KYOSAN ELECTRIC MFG. CO., LTD.", + [3]byte{0, 32, 224}: "Actiontec Electronics, Inc.", + [3]byte{0, 32, 225}: "ALAMAR ELECTRONICS", + [3]byte{0, 32, 226}: "INFORMATION RESOURCE ENGINEERING", + [3]byte{0, 32, 227}: "MCD KENCOM CORPORATION", + [3]byte{0, 32, 228}: "HSING TECH ENTERPRISE CO., LTD", + [3]byte{0, 32, 229}: "APEX DATA, INC.", + [3]byte{0, 32, 230}: "LIDKOPING MACHINE TOOLS AB", + [3]byte{0, 32, 231}: "B&W NUCLEAR SERVICE COMPANY", + [3]byte{0, 32, 232}: "DATATREK CORPORATION", + [3]byte{0, 32, 233}: "DANTEL", + [3]byte{0, 32, 234}: "EFFICIENT NETWORKS, INC.", + [3]byte{0, 32, 235}: "CINCINNATI MICROWAVE, INC.", + [3]byte{0, 32, 236}: "TECHWARE SYSTEMS CORP.", + [3]byte{0, 32, 237}: "GIGA-BYTE TECHNOLOGY CO., LTD.", + [3]byte{0, 32, 238}: "GTECH CORPORATION", + [3]byte{0, 32, 239}: "USC CORPORATION", + [3]byte{0, 32, 240}: "UNIVERSAL MICROELECTRONICS CO.", + [3]byte{0, 32, 241}: "ALTOS INDIA LIMITED", + [3]byte{0, 32, 242}: "Oracle Corporation", + [3]byte{0, 32, 243}: "RAYNET CORPORATION", + [3]byte{0, 32, 244}: "SPECTRIX CORPORATION", + [3]byte{0, 32, 245}: "PANDATEL AG", + [3]byte{0, 32, 246}: "NET TEK AND KARLNET, INC.", + [3]byte{0, 32, 247}: "CYBERDATA CORPORATION", + [3]byte{0, 32, 248}: "CARRERA COMPUTERS, INC.", + [3]byte{0, 32, 249}: "PARALINK NETWORKS, INC.", + [3]byte{0, 32, 250}: "GDE SYSTEMS, INC.", + [3]byte{0, 32, 251}: "OCTEL COMMUNICATIONS CORP.", + [3]byte{0, 32, 252}: "MATROX", + [3]byte{0, 32, 253}: "ITV TECHNOLOGIES, INC.", + [3]byte{0, 32, 254}: "TOPWARE INC. / GRAND COMPUTER", + [3]byte{0, 32, 255}: "SYMMETRICAL TECHNOLOGIES", + [3]byte{0, 33, 0}: "GemTek Technology Co., Ltd.", + [3]byte{0, 33, 1}: "Aplicaciones Electronicas Quasar (AEQ)", + [3]byte{0, 33, 2}: "UpdateLogic Inc.", + [3]byte{0, 33, 3}: "GHI Electronics, LLC", + [3]byte{0, 33, 4}: "Gigaset Communications GmbH", + [3]byte{0, 33, 5}: "Alcatel-Lucent", + [3]byte{0, 33, 6}: "RIM Testing Services", + [3]byte{0, 33, 7}: "Seowonintech Co Ltd.", + [3]byte{0, 33, 8}: "Nokia Danmark A/S", + [3]byte{0, 33, 9}: "Nokia Danmark A/S", + [3]byte{0, 33, 10}: "byd:sign Corporation", + [3]byte{0, 33, 11}: "GEMINI TRAZE RFID PVT. LTD.", + [3]byte{0, 33, 12}: "Cymtec Systems, Inc.", + [3]byte{0, 33, 13}: "SAMSIN INNOTEC", + [3]byte{0, 33, 14}: "Orpak Systems L.T.D.", + [3]byte{0, 33, 15}: "Cernium Corp", + [3]byte{0, 33, 16}: "Clearbox Systems", + [3]byte{0, 33, 17}: "Uniphone Inc.", + [3]byte{0, 33, 18}: "WISCOM SYSTEM CO.,LTD", + [3]byte{0, 33, 19}: "Padtec S/A", + [3]byte{0, 33, 20}: "Hylab Technology Inc.", + [3]byte{0, 33, 21}: "PHYWE Systeme GmbH & Co. KG", + [3]byte{0, 33, 22}: "Transcon Electronic Systems, spol. s r. o.", + [3]byte{0, 33, 23}: "Tellord", + [3]byte{0, 33, 24}: "Athena Tech, Inc.", + [3]byte{0, 33, 25}: "Samsung Electro-Mechanics", + [3]byte{0, 33, 26}: "LInTech Corporation", + [3]byte{0, 33, 27}: "CISCO SYSTEMS, INC.", + [3]byte{0, 33, 28}: "CISCO SYSTEMS, INC.", + [3]byte{0, 33, 29}: "Dataline AB", + [3]byte{0, 33, 30}: "ARRIS Group, Inc.", + [3]byte{0, 33, 31}: "SHINSUNG DELTATECH CO.,LTD.", + [3]byte{0, 33, 32}: "Sequel Technologies", + [3]byte{0, 33, 33}: "VRmagic GmbH", + [3]byte{0, 33, 34}: "Chip-pro Ltd.", + [3]byte{0, 33, 35}: "Aerosat Avionics", + [3]byte{0, 33, 36}: "Optos Plc", + [3]byte{0, 33, 37}: "KUK JE TONG SHIN Co.,LTD", + [3]byte{0, 33, 38}: "Shenzhen Torch Equipment Co., Ltd.", + [3]byte{0, 33, 39}: "TP-LINK Technology Co., Ltd.", + [3]byte{0, 33, 40}: "Oracle Corporation", + [3]byte{0, 33, 41}: "Cisco-Linksys, LLC", + [3]byte{0, 33, 42}: "Audiovox Corporation", + [3]byte{0, 33, 43}: "MSA Auer", + [3]byte{0, 33, 44}: "SemIndia System Private Limited", + [3]byte{0, 33, 45}: "SCIMOLEX CORPORATION", + [3]byte{0, 33, 46}: "dresden-elektronik", + [3]byte{0, 33, 47}: "Phoebe Micro Inc.", + [3]byte{0, 33, 48}: "Keico Hightech Inc.", + [3]byte{0, 33, 49}: "Blynke Inc.", + [3]byte{0, 33, 50}: "Masterclock, Inc.", + [3]byte{0, 33, 51}: "Building B, Inc", + [3]byte{0, 33, 52}: "Brandywine Communications", + [3]byte{0, 33, 53}: "ALCATEL-LUCENT", + [3]byte{0, 33, 54}: "ARRIS Group, Inc.", + [3]byte{0, 33, 55}: "Bay Controls, LLC", + [3]byte{0, 33, 56}: "Cepheid", + [3]byte{0, 33, 57}: "Escherlogic Inc.", + [3]byte{0, 33, 58}: "Winchester Systems Inc.", + [3]byte{0, 33, 59}: "Berkshire Products, Inc", + [3]byte{0, 33, 60}: "AliphCom", + [3]byte{0, 33, 61}: "Cermetek Microelectronics, Inc.", + [3]byte{0, 33, 62}: "TomTom", + [3]byte{0, 33, 63}: "A-Team Technology Ltd.", + [3]byte{0, 33, 64}: "EN Technologies Inc.", + [3]byte{0, 33, 65}: "RADLIVE", + [3]byte{0, 33, 66}: "Advanced Control Systems doo", + [3]byte{0, 33, 67}: "ARRIS Group, Inc.", + [3]byte{0, 33, 68}: "SS Telecoms", + [3]byte{0, 33, 69}: "Semptian Technologies Ltd.", + [3]byte{0, 33, 70}: "Sanmina-SCI", + [3]byte{0, 33, 71}: "Nintendo Co., Ltd.", + [3]byte{0, 33, 72}: "Kaco Solar Korea", + [3]byte{0, 33, 73}: "China Daheng Group ,Inc.", + [3]byte{0, 33, 74}: "Pixel Velocity, Inc", + [3]byte{0, 33, 75}: "Shenzhen HAMP Science & Technology Co.,Ltd", + [3]byte{0, 33, 76}: "SAMSUNG ELECTRONICS CO., LTD.", + [3]byte{0, 33, 77}: "Guangzhou Skytone Transmission Technology Com. Ltd.", + [3]byte{0, 33, 78}: "GS Yuasa Power Supply Ltd.", + [3]byte{0, 33, 79}: "ALPS Electric Co., Ltd", + [3]byte{0, 33, 80}: "EYEVIEW ELECTRONICS", + [3]byte{0, 33, 81}: "Millinet Co., Ltd.", + [3]byte{0, 33, 82}: "General Satellite Research & Development Limited", + [3]byte{0, 33, 83}: "SeaMicro Inc.", + [3]byte{0, 33, 84}: "D-TACQ Solutions Ltd", + [3]byte{0, 33, 85}: "CISCO SYSTEMS, INC.", + [3]byte{0, 33, 86}: "CISCO SYSTEMS, INC.", + [3]byte{0, 33, 87}: "National Datacast, Inc.", + [3]byte{0, 33, 88}: "Style Flying Technology Co.", + [3]byte{0, 33, 89}: "Juniper Networks", + [3]byte{0, 33, 90}: "Hewlett-Packard Company", + [3]byte{0, 33, 91}: "Inotive", + [3]byte{0, 33, 92}: "Intel Corporate", + [3]byte{0, 33, 93}: "Intel Corporate", + [3]byte{0, 33, 94}: "IBM Corp", + [3]byte{0, 33, 95}: "IHSE GmbH", + [3]byte{0, 33, 96}: "Hidea Solutions Co. Ltd.", + [3]byte{0, 33, 97}: "Yournet Inc.", + [3]byte{0, 33, 98}: "Nortel", + [3]byte{0, 33, 99}: "ASKEY COMPUTER CORP", + [3]byte{0, 33, 100}: "Special Design Bureau for Seismic Instrumentation", + [3]byte{0, 33, 101}: "Presstek Inc.", + [3]byte{0, 33, 102}: "NovAtel Inc.", + [3]byte{0, 33, 103}: "HWA JIN T&I Corp.", + [3]byte{0, 33, 104}: "iVeia, LLC", + [3]byte{0, 33, 105}: "Prologix, LLC.", + [3]byte{0, 33, 106}: "Intel Corporate", + [3]byte{0, 33, 107}: "Intel Corporate", + [3]byte{0, 33, 108}: "ODVA", + [3]byte{0, 33, 109}: "Soltech Co., Ltd.", + [3]byte{0, 33, 110}: "Function ATI (Huizhou) Telecommunications Co., Ltd.", + [3]byte{0, 33, 111}: "SymCom, Inc.", + [3]byte{0, 33, 112}: "Dell Inc", + [3]byte{0, 33, 113}: "Wesung TNC Co., Ltd.", + [3]byte{0, 33, 114}: "Seoultek Valley", + [3]byte{0, 33, 115}: "Ion Torrent Systems, Inc.", + [3]byte{0, 33, 116}: "AvaLAN Wireless", + [3]byte{0, 33, 117}: "Pacific Satellite International Ltd.", + [3]byte{0, 33, 118}: "YMax Telecom Ltd.", + [3]byte{0, 33, 119}: "W. L. Gore & Associates", + [3]byte{0, 33, 120}: "Matuschek Messtechnik GmbH", + [3]byte{0, 33, 121}: "IOGEAR, Inc.", + [3]byte{0, 33, 122}: "Sejin Electron, Inc.", + [3]byte{0, 33, 123}: "Bastec AB", + [3]byte{0, 33, 124}: "2Wire", + [3]byte{0, 33, 125}: "PYXIS S.R.L.", + [3]byte{0, 33, 126}: "Telit Communication s.p.a", + [3]byte{0, 33, 127}: "Intraco Technology Pte Ltd", + [3]byte{0, 33, 128}: "ARRIS Group, Inc.", + [3]byte{0, 33, 129}: "Si2 Microsystems Limited", + [3]byte{0, 33, 130}: "SandLinks Systems, Ltd.", + [3]byte{0, 33, 131}: "VATECH HYDRO", + [3]byte{0, 33, 132}: "POWERSOFT SRL", + [3]byte{0, 33, 133}: "MICRO-STAR INT'L CO.,LTD.", + [3]byte{0, 33, 134}: "Universal Global Scientific Industrial Co., Ltd", + [3]byte{0, 33, 135}: "Imacs GmbH", + [3]byte{0, 33, 136}: "EMC Corporation", + [3]byte{0, 33, 137}: "AppTech, Inc.", + [3]byte{0, 33, 138}: "Electronic Design and Manufacturing Company", + [3]byte{0, 33, 139}: "Wescon Technology, Inc.", + [3]byte{0, 33, 140}: "TopControl GMBH", + [3]byte{0, 33, 141}: "AP Router Ind. Eletronica LTDA", + [3]byte{0, 33, 142}: "MEKICS CO., LTD.", + [3]byte{0, 33, 143}: "Avantgarde Acoustic Lautsprechersysteme GmbH", + [3]byte{0, 33, 144}: "Goliath Solutions", + [3]byte{0, 33, 145}: "D-Link Corporation", + [3]byte{0, 33, 146}: "Baoding Galaxy Electronic Technology Co.,Ltd", + [3]byte{0, 33, 147}: "Videofon MV", + [3]byte{0, 33, 148}: "Ping Communication", + [3]byte{0, 33, 149}: "GWD Media Limited", + [3]byte{0, 33, 150}: "Telsey S.p.A.", + [3]byte{0, 33, 151}: "ELITEGROUP COMPUTER SYSTEM", + [3]byte{0, 33, 152}: "Thai Radio Co, LTD", + [3]byte{0, 33, 153}: "Vacon Plc", + [3]byte{0, 33, 154}: "Cambridge Visual Networks Ltd", + [3]byte{0, 33, 155}: "Dell Inc", + [3]byte{0, 33, 156}: "Honeywld Technology Corp.", + [3]byte{0, 33, 157}: "Adesys BV", + [3]byte{0, 33, 158}: "Sony Ericsson Mobile Communications", + [3]byte{0, 33, 159}: "SATEL OY", + [3]byte{0, 33, 160}: "CISCO SYSTEMS, INC.", + [3]byte{0, 33, 161}: "CISCO SYSTEMS, INC.", + [3]byte{0, 33, 162}: "EKE-Electronics Ltd.", + [3]byte{0, 33, 163}: "Micromint", + [3]byte{0, 33, 164}: "Dbii Networks", + [3]byte{0, 33, 165}: "ERLPhase Power Technologies Ltd.", + [3]byte{0, 33, 166}: "Videotec Spa", + [3]byte{0, 33, 167}: "Hantle System Co., Ltd.", + [3]byte{0, 33, 168}: "Telephonics Corporation", + [3]byte{0, 33, 169}: "Mobilink Telecom Co.,Ltd", + [3]byte{0, 33, 170}: "Nokia Danmark A/S", + [3]byte{0, 33, 171}: "Nokia Danmark A/S", + [3]byte{0, 33, 172}: "Infrared Integrated Systems Ltd", + [3]byte{0, 33, 173}: "Nordic ID Oy", + [3]byte{0, 33, 174}: "ALCATEL-LUCENT FRANCE - WTD", + [3]byte{0, 33, 175}: "Radio Frequency Systems", + [3]byte{0, 33, 176}: "Tyco Telecommunications", + [3]byte{0, 33, 177}: "DIGITAL SOLUTIONS LTD", + [3]byte{0, 33, 178}: "Fiberblaze A/S", + [3]byte{0, 33, 179}: "Ross Controls", + [3]byte{0, 33, 180}: "APRO MEDIA CO., LTD", + [3]byte{0, 33, 181}: "Galvanic Ltd", + [3]byte{0, 33, 182}: "Triacta Power Technologies Inc.", + [3]byte{0, 33, 183}: "Lexmark International Inc.", + [3]byte{0, 33, 184}: "Inphi Corporation", + [3]byte{0, 33, 185}: "Universal Devices Inc.", + [3]byte{0, 33, 186}: "Texas Instruments", + [3]byte{0, 33, 187}: "Riken Keiki Co., Ltd.", + [3]byte{0, 33, 188}: "ZALA COMPUTER", + [3]byte{0, 33, 189}: "Nintendo Co., Ltd.", + [3]byte{0, 33, 190}: "Cisco, Service Provider Video Technology Group", + [3]byte{0, 33, 191}: "Hitachi High-Tech Control Systems Corporation", + [3]byte{0, 33, 192}: "Mobile Appliance, Inc.", + [3]byte{0, 33, 193}: "ABB Oy / Medium Voltage Products", + [3]byte{0, 33, 194}: "GL Communications Inc", + [3]byte{0, 33, 195}: "CORNELL Communications, Inc.", + [3]byte{0, 33, 196}: "Consilium AB", + [3]byte{0, 33, 197}: "3DSP Corp", + [3]byte{0, 33, 198}: "CSJ Global, Inc.", + [3]byte{0, 33, 199}: "Russound", + [3]byte{0, 33, 200}: "LOHUIS Networks", + [3]byte{0, 33, 201}: "Wavecom Asia Pacific Limited", + [3]byte{0, 33, 202}: "ART System Co., Ltd.", + [3]byte{0, 33, 203}: "SMS TECNOLOGIA ELETRONICA LTDA", + [3]byte{0, 33, 204}: "Flextronics International", + [3]byte{0, 33, 205}: "LiveTV", + [3]byte{0, 33, 206}: "NTC-Metrotek", + [3]byte{0, 33, 207}: "The Crypto Group", + [3]byte{0, 33, 208}: "Global Display Solutions Spa", + [3]byte{0, 33, 209}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 33, 210}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 33, 211}: "BOCOM SECURITY(ASIA PACIFIC) LIMITED", + [3]byte{0, 33, 212}: "Vollmer Werke GmbH", + [3]byte{0, 33, 213}: "X2E GmbH", + [3]byte{0, 33, 214}: "LXI Consortium", + [3]byte{0, 33, 215}: "CISCO SYSTEMS, INC.", + [3]byte{0, 33, 216}: "CISCO SYSTEMS, INC.", + [3]byte{0, 33, 217}: "SEKONIC CORPORATION", + [3]byte{0, 33, 218}: "Automation Products Group Inc.", + [3]byte{0, 33, 219}: "Santachi Video Technology (Shenzhen) Co., Ltd.", + [3]byte{0, 33, 220}: "TECNOALARM S.r.l.", + [3]byte{0, 33, 221}: "Northstar Systems Corp", + [3]byte{0, 33, 222}: "Firepro Wireless", + [3]byte{0, 33, 223}: "Martin Christ GmbH", + [3]byte{0, 33, 224}: "CommAgility Ltd", + [3]byte{0, 33, 225}: "Nortel Networks", + [3]byte{0, 33, 226}: "Creative Electronic GmbH", + [3]byte{0, 33, 227}: "SerialTek LLC", + [3]byte{0, 33, 228}: "I-WIN", + [3]byte{0, 33, 229}: "Display Solution AG", + [3]byte{0, 33, 230}: "Starlight Video Limited", + [3]byte{0, 33, 231}: "Informatics Services Corporation", + [3]byte{0, 33, 232}: "Murata Manufacturing Co., Ltd.", + [3]byte{0, 33, 233}: "Apple", + [3]byte{0, 33, 234}: "Bystronic Laser AG", + [3]byte{0, 33, 235}: "ESP SYSTEMS, LLC", + [3]byte{0, 33, 236}: "Solutronic GmbH", + [3]byte{0, 33, 237}: "Telegesis", + [3]byte{0, 33, 238}: "Full Spectrum Inc.", + [3]byte{0, 33, 239}: "Kapsys", + [3]byte{0, 33, 240}: "EW3 Technologies LLC", + [3]byte{0, 33, 241}: "Tutus Data AB", + [3]byte{0, 33, 242}: "EASY3CALL Technology Limited", + [3]byte{0, 33, 243}: "Si14 SpA", + [3]byte{0, 33, 244}: "INRange Systems, Inc", + [3]byte{0, 33, 245}: "Western Engravers Supply, Inc.", + [3]byte{0, 33, 246}: "Oracle Corporation", + [3]byte{0, 33, 247}: "HPN Supply Chain", + [3]byte{0, 33, 248}: "Enseo, Inc.", + [3]byte{0, 33, 249}: "WIRECOM Technologies", + [3]byte{0, 33, 250}: "A4SP Technologies Ltd.", + [3]byte{0, 33, 251}: "LG Electronics", + [3]byte{0, 33, 252}: "Nokia Danmark A/S", + [3]byte{0, 33, 253}: "DSTA S.L.", + [3]byte{0, 33, 254}: "Nokia Danmark A/S", + [3]byte{0, 33, 255}: "Cyfrowy Polsat SA", + [3]byte{0, 34, 0}: "IBM Corp", + [3]byte{0, 34, 1}: "Aksys Networks Inc", + [3]byte{0, 34, 2}: "Excito Elektronik i SkÃ¥ne AB", + [3]byte{0, 34, 3}: "Glensound Electronics Ltd", + [3]byte{0, 34, 4}: "KORATEK", + [3]byte{0, 34, 5}: "WeLink Solutions, Inc.", + [3]byte{0, 34, 6}: "Cyberdyne Inc.", + [3]byte{0, 34, 7}: "Inteno Broadband Technology AB", + [3]byte{0, 34, 8}: "Certicom Corp", + [3]byte{0, 34, 9}: "Omron Healthcare Co., Ltd", + [3]byte{0, 34, 10}: "OnLive, Inc", + [3]byte{0, 34, 11}: "National Source Coding Center", + [3]byte{0, 34, 12}: "CISCO SYSTEMS, INC.", + [3]byte{0, 34, 13}: "CISCO SYSTEMS, INC.", + [3]byte{0, 34, 14}: "Indigo Security Co., Ltd.", + [3]byte{0, 34, 15}: "MoCA (Multimedia over Coax Alliance)", + [3]byte{0, 34, 16}: "ARRIS Group, Inc.", + [3]byte{0, 34, 17}: "Rohati Systems", + [3]byte{0, 34, 18}: "CAI Networks, Inc.", + [3]byte{0, 34, 19}: "PCI CORPORATION", + [3]byte{0, 34, 20}: "RINNAI KOREA", + [3]byte{0, 34, 21}: "ASUSTek COMPUTER INC.", + [3]byte{0, 34, 22}: "SHIBAURA VENDING MACHINE CORPORATION", + [3]byte{0, 34, 23}: "Neat Electronics", + [3]byte{0, 34, 24}: "Verivue Inc.", + [3]byte{0, 34, 25}: "Dell Inc", + [3]byte{0, 34, 26}: "Audio Precision", + [3]byte{0, 34, 27}: "Morega Systems", + [3]byte{0, 34, 28}: "PRIVATE", + [3]byte{0, 34, 29}: "Freegene Technology LTD", + [3]byte{0, 34, 30}: "Media Devices Co., Ltd.", + [3]byte{0, 34, 31}: "eSang Technologies Co., Ltd.", + [3]byte{0, 34, 32}: "Mitac Technology Corp", + [3]byte{0, 34, 33}: "ITOH DENKI CO,LTD.", + [3]byte{0, 34, 34}: "Schaffner Deutschland GmbH", + [3]byte{0, 34, 35}: "TimeKeeping Systems, Inc.", + [3]byte{0, 34, 36}: "Good Will Instrument Co., Ltd.", + [3]byte{0, 34, 37}: "Thales Avionics Ltd", + [3]byte{0, 34, 38}: "Avaak, Inc.", + [3]byte{0, 34, 39}: "uv-electronic GmbH", + [3]byte{0, 34, 40}: "Breeze Innovations Ltd.", + [3]byte{0, 34, 41}: "Compumedics Ltd", + [3]byte{0, 34, 42}: "SoundEar A/S", + [3]byte{0, 34, 43}: "Nucomm, Inc.", + [3]byte{0, 34, 44}: "Ceton Corp", + [3]byte{0, 34, 45}: "SMC Networks Inc.", + [3]byte{0, 34, 46}: "maintech GmbH", + [3]byte{0, 34, 47}: "Open Grid Computing, Inc.", + [3]byte{0, 34, 48}: "FutureLogic Inc.", + [3]byte{0, 34, 49}: "SMT&C Co., Ltd.", + [3]byte{0, 34, 50}: "Design Design Technology Ltd", + [3]byte{0, 34, 51}: "ADB Broadband Italia", + [3]byte{0, 34, 52}: "Corventis Inc.", + [3]byte{0, 34, 53}: "Strukton Systems bv", + [3]byte{0, 34, 54}: "VECTOR SP. Z O.O.", + [3]byte{0, 34, 55}: "Shinhint Group", + [3]byte{0, 34, 56}: "LOGIPLUS", + [3]byte{0, 34, 57}: "Indiana Life Sciences Incorporated", + [3]byte{0, 34, 58}: "Scientific Atlanta, Cisco SPVT Group", + [3]byte{0, 34, 59}: "Communication Networks, LLC", + [3]byte{0, 34, 60}: "RATIO Entwicklungen GmbH", + [3]byte{0, 34, 61}: "JumpGen Systems, LLC", + [3]byte{0, 34, 62}: "IRTrans GmbH", + [3]byte{0, 34, 63}: "Netgear Inc.", + [3]byte{0, 34, 64}: "Universal Telecom S/A", + [3]byte{0, 34, 65}: "Apple", + [3]byte{0, 34, 66}: "Alacron Inc.", + [3]byte{0, 34, 67}: "AzureWave Technologies, Inc.", + [3]byte{0, 34, 68}: "Chengdu Linkon Communications Device Co., Ltd", + [3]byte{0, 34, 69}: "Leine & Linde AB", + [3]byte{0, 34, 70}: "Evoc Intelligent Technology Co.,Ltd.", + [3]byte{0, 34, 71}: "DAC ENGINEERING CO., LTD.", + [3]byte{0, 34, 72}: "Microsoft Corporation", + [3]byte{0, 34, 73}: "HOME MULTIENERGY SL", + [3]byte{0, 34, 74}: "RAYLASE AG", + [3]byte{0, 34, 75}: "AIRTECH TECHNOLOGIES, INC.", + [3]byte{0, 34, 76}: "Nintendo Co., Ltd.", + [3]byte{0, 34, 77}: "MITAC INTERNATIONAL CORP.", + [3]byte{0, 34, 78}: "SEEnergy Corp.", + [3]byte{0, 34, 79}: "Byzoro Networks Ltd.", + [3]byte{0, 34, 80}: "Point Six Wireless, LLC", + [3]byte{0, 34, 81}: "Lumasense Technologies", + [3]byte{0, 34, 82}: "ZOLL Lifecor Corporation", + [3]byte{0, 34, 83}: "Entorian Technologies", + [3]byte{0, 34, 84}: "Bigelow Aerospace", + [3]byte{0, 34, 85}: "CISCO SYSTEMS, INC.", + [3]byte{0, 34, 86}: "CISCO SYSTEMS, INC.", + [3]byte{0, 34, 87}: "3Com Europe Ltd", + [3]byte{0, 34, 88}: "Taiyo Yuden Co., Ltd.", + [3]byte{0, 34, 89}: "Guangzhou New Postcom Equipment Co.,Ltd.", + [3]byte{0, 34, 90}: "Garde Security AB", + [3]byte{0, 34, 91}: "Teradici Corporation", + [3]byte{0, 34, 92}: "Multimedia & Communication Technology", + [3]byte{0, 34, 93}: "Digicable Network India Pvt. Ltd.", + [3]byte{0, 34, 94}: "Uwin Technologies Co.,LTD", + [3]byte{0, 34, 95}: "Liteon Technology Corporation", + [3]byte{0, 34, 96}: "AFREEY Inc.", + [3]byte{0, 34, 97}: "Frontier Silicon Ltd", + [3]byte{0, 34, 98}: "BEP Marine", + [3]byte{0, 34, 99}: "Koos Technical Services, Inc.", + [3]byte{0, 34, 100}: "Hewlett-Packard Company", + [3]byte{0, 34, 101}: "Nokia Danmark A/S", + [3]byte{0, 34, 102}: "Nokia Danmark A/S", + [3]byte{0, 34, 103}: "Nortel Networks", + [3]byte{0, 34, 104}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 34, 105}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 34, 106}: "Honeywell", + [3]byte{0, 34, 107}: "Cisco-Linksys, LLC", + [3]byte{0, 34, 108}: "LinkSprite Technologies, Inc.", + [3]byte{0, 34, 109}: "Shenzhen GIEC Electronics Co., Ltd.", + [3]byte{0, 34, 110}: "Gowell Electronic Limited", + [3]byte{0, 34, 111}: "3onedata Technology Co. Ltd.", + [3]byte{0, 34, 112}: "ABK North America, LLC", + [3]byte{0, 34, 113}: "Jäger Computergesteuerte Meßtechnik GmbH.", + [3]byte{0, 34, 114}: "American Micro-Fuel Device Corp.", + [3]byte{0, 34, 115}: "Techway", + [3]byte{0, 34, 116}: "FamilyPhone AB", + [3]byte{0, 34, 117}: "Belkin International Inc.", + [3]byte{0, 34, 118}: "Triple EYE B.V.", + [3]byte{0, 34, 119}: "NEC Australia Pty Ltd", + [3]byte{0, 34, 120}: "Shenzhen Tongfang Multimedia Technology Co.,Ltd.", + [3]byte{0, 34, 121}: "Nippon Conlux Co., Ltd.", + [3]byte{0, 34, 122}: "Telecom Design", + [3]byte{0, 34, 123}: "Apogee Labs, Inc.", + [3]byte{0, 34, 124}: "Woori SMT Co.,ltd", + [3]byte{0, 34, 125}: "YE DATA INC.", + [3]byte{0, 34, 126}: "Chengdu 30Kaitian Communication Industry Co.Ltd", + [3]byte{0, 34, 127}: "Ruckus Wireless", + [3]byte{0, 34, 128}: "A2B Electronics AB", + [3]byte{0, 34, 129}: "Daintree Networks Pty", + [3]byte{0, 34, 130}: "8086 Consultancy", + [3]byte{0, 34, 131}: "Juniper Networks", + [3]byte{0, 34, 132}: "DESAY A&V SCIENCE AND TECHNOLOGY CO.,LTD", + [3]byte{0, 34, 133}: "NOMUS COMM SYSTEMS", + [3]byte{0, 34, 134}: "ASTRON", + [3]byte{0, 34, 135}: "Titan Wireless LLC", + [3]byte{0, 34, 136}: "Sagrad, Inc.", + [3]byte{0, 34, 137}: "Optosecurity Inc.", + [3]byte{0, 34, 138}: "Teratronik elektronische systeme gmbh", + [3]byte{0, 34, 139}: "Kensington Computer Products Group", + [3]byte{0, 34, 140}: "Photon Europe GmbH", + [3]byte{0, 34, 141}: "GBS Laboratories LLC", + [3]byte{0, 34, 142}: "TV-NUMERIC", + [3]byte{0, 34, 143}: "CNRS", + [3]byte{0, 34, 144}: "CISCO SYSTEMS, INC.", + [3]byte{0, 34, 145}: "CISCO SYSTEMS, INC.", + [3]byte{0, 34, 146}: "Cinetal", + [3]byte{0, 34, 147}: "ZTE Corporation", + [3]byte{0, 34, 148}: "Kyocera Corporation", + [3]byte{0, 34, 149}: "SGM Technology for lighting spa", + [3]byte{0, 34, 150}: "LinoWave Corporation", + [3]byte{0, 34, 151}: "XMOS Semiconductor", + [3]byte{0, 34, 152}: "Sony Ericsson Mobile Communications", + [3]byte{0, 34, 153}: "SeaMicro Inc.", + [3]byte{0, 34, 154}: "Lastar, Inc.", + [3]byte{0, 34, 155}: "AverLogic Technologies, Inc.", + [3]byte{0, 34, 156}: "Verismo Networks Inc", + [3]byte{0, 34, 157}: "PYUNG-HWA IND.CO.,LTD", + [3]byte{0, 34, 158}: "Social Aid Research Co., Ltd.", + [3]byte{0, 34, 159}: "Sensys Traffic AB", + [3]byte{0, 34, 160}: "Delphi Corporation", + [3]byte{0, 34, 161}: "Huawei Symantec Technologies Co.,Ltd.", + [3]byte{0, 34, 162}: "Xtramus Technologies", + [3]byte{0, 34, 163}: "California Eastern Laboratories", + [3]byte{0, 34, 164}: "2Wire", + [3]byte{0, 34, 165}: "Texas Instruments", + [3]byte{0, 34, 166}: "Sony Computer Entertainment America", + [3]byte{0, 34, 167}: "Tyco Electronics AMP GmbH", + [3]byte{0, 34, 168}: "Ouman Oy", + [3]byte{0, 34, 169}: "LG Electronics Inc", + [3]byte{0, 34, 170}: "Nintendo Co., Ltd.", + [3]byte{0, 34, 171}: "Shenzhen Turbosight Technology Ltd", + [3]byte{0, 34, 172}: "Hangzhou Siyuan Tech. Co., Ltd", + [3]byte{0, 34, 173}: "TELESIS TECHNOLOGIES, INC.", + [3]byte{0, 34, 174}: "Mattel Inc.", + [3]byte{0, 34, 175}: "Safety Vision", + [3]byte{0, 34, 176}: "D-Link Corporation", + [3]byte{0, 34, 177}: "Elbit Systems", + [3]byte{0, 34, 178}: "4RF Communications Ltd", + [3]byte{0, 34, 179}: "Sei S.p.A.", + [3]byte{0, 34, 180}: "ARRIS Group, Inc.", + [3]byte{0, 34, 181}: "NOVITA", + [3]byte{0, 34, 182}: "Superflow Technologies Group", + [3]byte{0, 34, 183}: "GSS Grundig SAT-Systems GmbH", + [3]byte{0, 34, 184}: "Norcott", + [3]byte{0, 34, 185}: "Analogix Seminconductor, Inc", + [3]byte{0, 34, 186}: "HUTH Elektronik Systeme GmbH", + [3]byte{0, 34, 187}: "beyerdynamic GmbH & Co. KG", + [3]byte{0, 34, 188}: "JDSU France SAS", + [3]byte{0, 34, 189}: "CISCO SYSTEMS, INC.", + [3]byte{0, 34, 190}: "CISCO SYSTEMS, INC.", + [3]byte{0, 34, 191}: "SieAmp Group of Companies", + [3]byte{0, 34, 192}: "Shenzhen Forcelink Electronic Co, Ltd", + [3]byte{0, 34, 193}: "Active Storage Inc.", + [3]byte{0, 34, 194}: "Proview Eletrônica do Brasil LTDA", + [3]byte{0, 34, 195}: "Zeeport Technology Inc.", + [3]byte{0, 34, 196}: "epro GmbH", + [3]byte{0, 34, 197}: "INFORSON Co,Ltd.", + [3]byte{0, 34, 198}: "Sutus Inc", + [3]byte{0, 34, 199}: "SEGGER Microcontroller GmbH & Co. KG", + [3]byte{0, 34, 200}: "Applied Instruments B.V.", + [3]byte{0, 34, 201}: "Lenord, Bauer & Co GmbH", + [3]byte{0, 34, 202}: "Anviz Biometric Tech. Co., Ltd.", + [3]byte{0, 34, 203}: "IONODES Inc.", + [3]byte{0, 34, 204}: "SciLog, Inc.", + [3]byte{0, 34, 205}: "Ared Technology Co., Ltd.", + [3]byte{0, 34, 206}: "Cisco, Service Provider Video Technology Group", + [3]byte{0, 34, 207}: "PLANEX Communications INC", + [3]byte{0, 34, 208}: "Polar Electro Oy", + [3]byte{0, 34, 209}: "Albrecht Jung GmbH & Co. KG", + [3]byte{0, 34, 210}: "All Earth Comércio de Eletrônicos LTDA.", + [3]byte{0, 34, 211}: "Hub-Tech", + [3]byte{0, 34, 212}: "ComWorth Co., Ltd.", + [3]byte{0, 34, 213}: "Eaton Corp. Electrical Group Data Center Solutions - Pulizzi", + [3]byte{0, 34, 214}: "Cypak AB", + [3]byte{0, 34, 215}: "Nintendo Co., Ltd.", + [3]byte{0, 34, 216}: "Shenzhen GST Security and Safety Technology Limited", + [3]byte{0, 34, 217}: "Fortex Industrial Ltd.", + [3]byte{0, 34, 218}: "ANATEK, LLC", + [3]byte{0, 34, 219}: "Translogic Corporation", + [3]byte{0, 34, 220}: "Vigil Health Solutions Inc.", + [3]byte{0, 34, 221}: "Protecta Electronics Ltd", + [3]byte{0, 34, 222}: "OPPO Digital, Inc.", + [3]byte{0, 34, 223}: "TAMUZ Monitors", + [3]byte{0, 34, 224}: "Atlantic Software Technologies S.r.L.", + [3]byte{0, 34, 225}: "ZORT Labs, LLC.", + [3]byte{0, 34, 226}: "WABTEC Transit Division", + [3]byte{0, 34, 227}: "Amerigon", + [3]byte{0, 34, 228}: "APASS TECHNOLOGY CO., LTD.", + [3]byte{0, 34, 229}: "Fisher-Rosemount Systems Inc.", + [3]byte{0, 34, 230}: "Intelligent Data", + [3]byte{0, 34, 231}: "WPS Parking Systems", + [3]byte{0, 34, 232}: "Applition Co., Ltd.", + [3]byte{0, 34, 233}: "ProVision Communications", + [3]byte{0, 34, 234}: "Rustelcom Inc.", + [3]byte{0, 34, 235}: "Data Respons A/S", + [3]byte{0, 34, 236}: "IDEALBT TECHNOLOGY CORPORATION", + [3]byte{0, 34, 237}: "TSI Power Corporation", + [3]byte{0, 34, 238}: "Algo Communication Products Ltd", + [3]byte{0, 34, 239}: "iWDL Technologies", + [3]byte{0, 34, 240}: "3 Greens Aviation Limited", + [3]byte{0, 34, 241}: "PRIVATE", + [3]byte{0, 34, 242}: "SunPower Corp", + [3]byte{0, 34, 243}: "SHARP Corporation", + [3]byte{0, 34, 244}: "AMPAK Technology, Inc.", + [3]byte{0, 34, 245}: "Advanced Realtime Tracking GmbH", + [3]byte{0, 34, 246}: "Syracuse Research Corporation", + [3]byte{0, 34, 247}: "Conceptronic", + [3]byte{0, 34, 248}: "PIMA Electronic Systems Ltd.", + [3]byte{0, 34, 249}: "Pollin Electronic GmbH", + [3]byte{0, 34, 250}: "Intel Corporate", + [3]byte{0, 34, 251}: "Intel Corporate", + [3]byte{0, 34, 252}: "Nokia Danmark A/S", + [3]byte{0, 34, 253}: "Nokia Danmark A/S", + [3]byte{0, 34, 254}: "Microprocessor Designs Inc", + [3]byte{0, 34, 255}: "iWDL Technologies", + [3]byte{0, 35, 0}: "Cayee Computer Ltd.", + [3]byte{0, 35, 1}: "Witron Technology Limited", + [3]byte{0, 35, 2}: "Cobalt Digital, Inc.", + [3]byte{0, 35, 3}: "LITE-ON IT Corporation", + [3]byte{0, 35, 4}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 5}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 6}: "ALPS Electric Co., Ltd", + [3]byte{0, 35, 7}: "FUTURE INNOVATION TECH CO.,LTD", + [3]byte{0, 35, 8}: "Arcadyan Technology Corporation", + [3]byte{0, 35, 9}: "Janam Technologies LLC", + [3]byte{0, 35, 10}: "ARBURG GmbH & Co KG", + [3]byte{0, 35, 11}: "ARRIS Group, Inc.", + [3]byte{0, 35, 12}: "CLOVER ELECTRONICS CO.,LTD.", + [3]byte{0, 35, 13}: "Nortel Networks", + [3]byte{0, 35, 14}: "Gorba AG", + [3]byte{0, 35, 15}: "Hirsch Electronics Corporation", + [3]byte{0, 35, 16}: "LNC Technology Co., Ltd.", + [3]byte{0, 35, 17}: "Gloscom Co., Ltd.", + [3]byte{0, 35, 18}: "Apple", + [3]byte{0, 35, 19}: "Qool Technologies Ltd.", + [3]byte{0, 35, 20}: "Intel Corporate", + [3]byte{0, 35, 21}: "Intel Corporate", + [3]byte{0, 35, 22}: "KISAN ELECTRONICS CO", + [3]byte{0, 35, 23}: "Lasercraft Inc", + [3]byte{0, 35, 24}: "Toshiba", + [3]byte{0, 35, 25}: "Sielox LLC", + [3]byte{0, 35, 26}: "ITF Co., Ltd.", + [3]byte{0, 35, 27}: "Danaher Motion - Kollmorgen", + [3]byte{0, 35, 28}: "Fourier Systems Ltd.", + [3]byte{0, 35, 29}: "Deltacom Electronics Ltd", + [3]byte{0, 35, 30}: "Cezzer Multimedia Technologies", + [3]byte{0, 35, 31}: "Guangda Electronic & Telecommunication Technology Development Co., Ltd.", + [3]byte{0, 35, 32}: "Nicira Networks", + [3]byte{0, 35, 33}: "Avitech International Corp", + [3]byte{0, 35, 34}: "KISS Teknical Solutions, Inc.", + [3]byte{0, 35, 35}: "Zylin AS", + [3]byte{0, 35, 36}: "G-PRO COMPUTER", + [3]byte{0, 35, 37}: "IOLAN Holding", + [3]byte{0, 35, 38}: "Fujitsu Limited", + [3]byte{0, 35, 39}: "Shouyo Electronics CO., LTD", + [3]byte{0, 35, 40}: "ALCON TELECOMMUNICATIONS CO., LTD.", + [3]byte{0, 35, 41}: "DDRdrive LLC", + [3]byte{0, 35, 42}: "eonas IT-Beratung und -Entwicklung GmbH", + [3]byte{0, 35, 43}: "IRD A/S", + [3]byte{0, 35, 44}: "Senticare", + [3]byte{0, 35, 45}: "SandForce", + [3]byte{0, 35, 46}: "Kedah Electronics Engineering, LLC", + [3]byte{0, 35, 47}: "Advanced Card Systems Ltd.", + [3]byte{0, 35, 48}: "DIZIPIA, INC.", + [3]byte{0, 35, 49}: "Nintendo Co., Ltd.", + [3]byte{0, 35, 50}: "Apple", + [3]byte{0, 35, 51}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 52}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 53}: "Linkflex Co.,Ltd", + [3]byte{0, 35, 54}: "METEL s.r.o.", + [3]byte{0, 35, 55}: "Global Star Solutions ULC", + [3]byte{0, 35, 56}: "OJ-Electronics A/S", + [3]byte{0, 35, 57}: "Samsung Electronics", + [3]byte{0, 35, 58}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 35, 59}: "C-Matic Systems Ltd", + [3]byte{0, 35, 60}: "Alflex", + [3]byte{0, 35, 61}: "Novero holding B.V.", + [3]byte{0, 35, 62}: "Alcatel-Lucent-IPD", + [3]byte{0, 35, 63}: "Purechoice Inc", + [3]byte{0, 35, 64}: "MiX Telematics", + [3]byte{0, 35, 65}: "Siemens AB, Infrastructure & Cities, Building Technologies Division, IC BT SSP SP BA PR", + [3]byte{0, 35, 66}: "Coffee Equipment Company", + [3]byte{0, 35, 67}: "TEM AG", + [3]byte{0, 35, 68}: "Objective Interface Systems, Inc.", + [3]byte{0, 35, 69}: "Sony Ericsson Mobile Communications", + [3]byte{0, 35, 70}: "Vestac", + [3]byte{0, 35, 71}: "ProCurve Networking by HP", + [3]byte{0, 35, 72}: "SAGEM COMMUNICATION", + [3]byte{0, 35, 73}: "Helmholtz Centre Berlin for Material and Energy", + [3]byte{0, 35, 74}: "PRIVATE", + [3]byte{0, 35, 75}: "Inyuan Technology Inc.", + [3]byte{0, 35, 76}: "KTC AB", + [3]byte{0, 35, 77}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 35, 78}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 35, 79}: "Luminous Power Technologies Pvt. Ltd.", + [3]byte{0, 35, 80}: "LynTec", + [3]byte{0, 35, 81}: "2Wire", + [3]byte{0, 35, 82}: "DATASENSOR S.p.A.", + [3]byte{0, 35, 83}: "F E T Elettronica snc", + [3]byte{0, 35, 84}: "ASUSTek COMPUTER INC.", + [3]byte{0, 35, 85}: "Kinco Automation(Shanghai) Ltd.", + [3]byte{0, 35, 86}: "Packet Forensics LLC", + [3]byte{0, 35, 87}: "Pitronot Technologies and Engineering P.T.E. Ltd.", + [3]byte{0, 35, 88}: "SYSTEL SA", + [3]byte{0, 35, 89}: "Benchmark Electronics ( Thailand ) Public Company Limited", + [3]byte{0, 35, 90}: "COMPAL INFORMATION (KUNSHAN) CO., Ltd.", + [3]byte{0, 35, 91}: "Gulfstream", + [3]byte{0, 35, 92}: "Aprius, Inc.", + [3]byte{0, 35, 93}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 94}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 95}: "Silicon Micro Sensors GmbH", + [3]byte{0, 35, 96}: "Lookit Technology Co., Ltd", + [3]byte{0, 35, 97}: "Unigen Corporation", + [3]byte{0, 35, 98}: "Goldline Controls", + [3]byte{0, 35, 99}: "Zhuhai RaySharp Technology Co., Ltd.", + [3]byte{0, 35, 100}: "Power Instruments Pte Ltd", + [3]byte{0, 35, 101}: "ELKA-Elektronik GmbH", + [3]byte{0, 35, 102}: "Beijing Siasun Electronic System Co.,Ltd.", + [3]byte{0, 35, 103}: "UniControls a.s.", + [3]byte{0, 35, 104}: "Motorola", + [3]byte{0, 35, 105}: "Cisco-Linksys, LLC", + [3]byte{0, 35, 106}: "SmartRG Inc", + [3]byte{0, 35, 107}: "Xembedded, Inc.", + [3]byte{0, 35, 108}: "Apple", + [3]byte{0, 35, 109}: "ResMed Ltd", + [3]byte{0, 35, 110}: "Burster GmbH & Co KG", + [3]byte{0, 35, 111}: "DAQ System", + [3]byte{0, 35, 112}: "Snell", + [3]byte{0, 35, 113}: "SOAM Systel", + [3]byte{0, 35, 114}: "MORE STAR INDUSTRIAL GROUP LIMITED", + [3]byte{0, 35, 115}: "GridIron Systems, Inc.", + [3]byte{0, 35, 116}: "ARRIS Group, Inc.", + [3]byte{0, 35, 117}: "ARRIS Group, Inc.", + [3]byte{0, 35, 118}: "HTC Corporation", + [3]byte{0, 35, 119}: "Isotek Electronics Ltd", + [3]byte{0, 35, 120}: "GN Netcom A/S", + [3]byte{0, 35, 121}: "Union Business Machines Co. Ltd.", + [3]byte{0, 35, 122}: "RIM", + [3]byte{0, 35, 123}: "WHDI LLC", + [3]byte{0, 35, 124}: "NEOTION", + [3]byte{0, 35, 125}: "Hewlett-Packard Company", + [3]byte{0, 35, 126}: "ELSTER GMBH", + [3]byte{0, 35, 127}: "PLANTRONICS, INC.", + [3]byte{0, 35, 128}: "Nanoteq", + [3]byte{0, 35, 129}: "Lengda Technology(Xiamen) Co.,Ltd.", + [3]byte{0, 35, 130}: "Lih Rong Electronic Enterprise Co., Ltd.", + [3]byte{0, 35, 131}: "InMage Systems Inc", + [3]byte{0, 35, 132}: "GGH Engineering s.r.l.", + [3]byte{0, 35, 133}: "ANTIPODE", + [3]byte{0, 35, 134}: "Tour & Andersson AB", + [3]byte{0, 35, 135}: "ThinkFlood, Inc.", + [3]byte{0, 35, 136}: "V.T. Telematica S.p.a.", + [3]byte{0, 35, 137}: "HANGZHOU H3C Technologies Co., Ltd.", + [3]byte{0, 35, 138}: "Ciena Corporation", + [3]byte{0, 35, 139}: "Quanta Computer Inc.", + [3]byte{0, 35, 140}: "PRIVATE", + [3]byte{0, 35, 141}: "Techno Design Co., Ltd.", + [3]byte{0, 35, 142}: "Pirelli Tyre S.p.A.", + [3]byte{0, 35, 143}: "NIDEC COPAL CORPORATION", + [3]byte{0, 35, 144}: "Algolware Corporation", + [3]byte{0, 35, 145}: "Maxian", + [3]byte{0, 35, 146}: "Proteus Industries Inc.", + [3]byte{0, 35, 147}: "AJINEXTEK", + [3]byte{0, 35, 148}: "Samjeon", + [3]byte{0, 35, 149}: "ARRIS Group, Inc.", + [3]byte{0, 35, 150}: "ANDES TECHNOLOGY CORPORATION", + [3]byte{0, 35, 151}: "Westell Technologies Inc.", + [3]byte{0, 35, 152}: "Sky Control", + [3]byte{0, 35, 153}: "VD Division, Samsung Electronics Co.", + [3]byte{0, 35, 154}: "EasyData Hardware GmbH", + [3]byte{0, 35, 155}: "Elster Solutions, LLC", + [3]byte{0, 35, 156}: "Juniper Networks", + [3]byte{0, 35, 157}: "Mapower Electronics Co., Ltd", + [3]byte{0, 35, 158}: "Jiangsu Lemote Technology Corporation Limited", + [3]byte{0, 35, 159}: "Institut für Prüftechnik", + [3]byte{0, 35, 160}: "Hana CNS Co., LTD.", + [3]byte{0, 35, 161}: "Trend Electronics Ltd", + [3]byte{0, 35, 162}: "ARRIS Group, Inc.", + [3]byte{0, 35, 163}: "ARRIS Group, Inc.", + [3]byte{0, 35, 164}: "New Concepts Development Corp.", + [3]byte{0, 35, 165}: "SageTV, LLC", + [3]byte{0, 35, 166}: "E-Mon", + [3]byte{0, 35, 167}: "Redpine Signals, Inc.", + [3]byte{0, 35, 168}: "Marshall Electronics", + [3]byte{0, 35, 169}: "Beijing Detianquan Electromechanical Equipment Co., Ltd", + [3]byte{0, 35, 170}: "HFR, Inc.", + [3]byte{0, 35, 171}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 172}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 173}: "Xmark Corporation", + [3]byte{0, 35, 174}: "Dell Inc.", + [3]byte{0, 35, 175}: "ARRIS Group, Inc.", + [3]byte{0, 35, 176}: "COMXION Technology Inc.", + [3]byte{0, 35, 177}: "Longcheer Technology (Singapore) Pte Ltd", + [3]byte{0, 35, 178}: "Intelligent Mechatronic Systems Inc", + [3]byte{0, 35, 179}: "Lyyn AB", + [3]byte{0, 35, 180}: "Nokia Danmark A/S", + [3]byte{0, 35, 181}: "ORTANA LTD", + [3]byte{0, 35, 182}: "SECURITE COMMUNICATIONS / HONEYWELL", + [3]byte{0, 35, 183}: "Q-Light Co., Ltd.", + [3]byte{0, 35, 184}: "Sichuan Jiuzhou Electronic Technology Co.,Ltd", + [3]byte{0, 35, 185}: "EADS Deutschland GmbH", + [3]byte{0, 35, 186}: "Chroma", + [3]byte{0, 35, 187}: "Schmitt Industries", + [3]byte{0, 35, 188}: "EQ-SYS GmbH", + [3]byte{0, 35, 189}: "Digital Ally, Inc.", + [3]byte{0, 35, 190}: "Cisco SPVTG", + [3]byte{0, 35, 191}: "Mainpine, Inc.", + [3]byte{0, 35, 192}: "Broadway Networks", + [3]byte{0, 35, 193}: "Securitas Direct AB", + [3]byte{0, 35, 194}: "SAMSUNG Electronics. Co. LTD", + [3]byte{0, 35, 195}: "LogMeIn, Inc.", + [3]byte{0, 35, 196}: "Lux Lumen", + [3]byte{0, 35, 197}: "Radiation Safety and Control Services Inc", + [3]byte{0, 35, 198}: "SMC Corporation", + [3]byte{0, 35, 199}: "AVSystem", + [3]byte{0, 35, 200}: "TEAM-R", + [3]byte{0, 35, 201}: "Sichuan Tianyi Information Science & Technology Stock CO.,LTD", + [3]byte{0, 35, 202}: "Behind The Set, LLC", + [3]byte{0, 35, 203}: "Shenzhen Full-join Technology Co.,Ltd", + [3]byte{0, 35, 204}: "Nintendo Co., Ltd.", + [3]byte{0, 35, 205}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{0, 35, 206}: "KITA DENSHI CORPORATION", + [3]byte{0, 35, 207}: "CUMMINS-ALLISON CORP.", + [3]byte{0, 35, 208}: "Uniloc USA Inc.", + [3]byte{0, 35, 209}: "TRG", + [3]byte{0, 35, 210}: "Inhand Electronics, Inc.", + [3]byte{0, 35, 211}: "AirLink WiFi Networking Corp.", + [3]byte{0, 35, 212}: "Texas Instruments", + [3]byte{0, 35, 213}: "WAREMA electronic GmbH", + [3]byte{0, 35, 214}: "Samsung Electronics Co.,LTD", + [3]byte{0, 35, 215}: "Samsung Electronics", + [3]byte{0, 35, 216}: "Ball-It Oy", + [3]byte{0, 35, 217}: "Banner Engineering", + [3]byte{0, 35, 218}: "Industrial Computer Source (Deutschland)GmbH", + [3]byte{0, 35, 219}: "saxnet gmbh", + [3]byte{0, 35, 220}: "Benein, Inc", + [3]byte{0, 35, 221}: "ELGIN S.A.", + [3]byte{0, 35, 222}: "Ansync Inc.", + [3]byte{0, 35, 223}: "Apple", + [3]byte{0, 35, 224}: "INO Therapeutics LLC", + [3]byte{0, 35, 225}: "Cavena Image Products AB", + [3]byte{0, 35, 226}: "SEA Signalisation", + [3]byte{0, 35, 227}: "Microtronic AG", + [3]byte{0, 35, 228}: "IPnect co. ltd.", + [3]byte{0, 35, 229}: "IPaXiom Networks", + [3]byte{0, 35, 230}: "Pirkus, Inc.", + [3]byte{0, 35, 231}: "Hinke A/S", + [3]byte{0, 35, 232}: "Demco Corp.", + [3]byte{0, 35, 233}: "F5 Networks, Inc.", + [3]byte{0, 35, 234}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 235}: "CISCO SYSTEMS, INC.", + [3]byte{0, 35, 236}: "Algorithmix GmbH", + [3]byte{0, 35, 237}: "ARRIS Group, Inc.", + [3]byte{0, 35, 238}: "ARRIS Group, Inc.", + [3]byte{0, 35, 239}: "Zuend Systemtechnik AG", + [3]byte{0, 35, 240}: "Shanghai Jinghan Weighing Apparatus Co. Ltd.", + [3]byte{0, 35, 241}: "Sony Ericsson Mobile Communications", + [3]byte{0, 35, 242}: "TVLogic", + [3]byte{0, 35, 243}: "Glocom, Inc.", + [3]byte{0, 35, 244}: "Masternaut", + [3]byte{0, 35, 245}: "WILO SE", + [3]byte{0, 35, 246}: "Softwell Technology Co., Ltd.", + [3]byte{0, 35, 247}: "PRIVATE", + [3]byte{0, 35, 248}: "ZyXEL Communications Corporation", + [3]byte{0, 35, 249}: "Double-Take Software, INC.", + [3]byte{0, 35, 250}: "RG Nets, Inc.", + [3]byte{0, 35, 251}: "IP Datatel, LLC.", + [3]byte{0, 35, 252}: "Ultra Stereo Labs, Inc", + [3]byte{0, 35, 253}: "AFT Atlas Fahrzeugtechnik GmbH", + [3]byte{0, 35, 254}: "Biodevices, SA", + [3]byte{0, 35, 255}: "Beijing HTTC Technology Ltd.", + [3]byte{0, 36, 0}: "Nortel Networks", + [3]byte{0, 36, 1}: "D-Link Corporation", + [3]byte{0, 36, 2}: "Op-Tection GmbH", + [3]byte{0, 36, 3}: "Nokia Danmark A/S", + [3]byte{0, 36, 4}: "Nokia Danmark A/S", + [3]byte{0, 36, 5}: "Dilog Nordic AB", + [3]byte{0, 36, 6}: "Pointmobile", + [3]byte{0, 36, 7}: "TELEM SAS", + [3]byte{0, 36, 8}: "Pacific Biosciences", + [3]byte{0, 36, 9}: "The Toro Company", + [3]byte{0, 36, 10}: "US Beverage Net", + [3]byte{0, 36, 11}: "Virtual Computer Inc.", + [3]byte{0, 36, 12}: "DELEC GmbH", + [3]byte{0, 36, 13}: "OnePath Networks LTD.", + [3]byte{0, 36, 14}: "Inventec Besta Co., Ltd.", + [3]byte{0, 36, 15}: "Ishii Tool & Engineering Corporation", + [3]byte{0, 36, 16}: "NUETEQ Technology,Inc.", + [3]byte{0, 36, 17}: "PharmaSmart LLC", + [3]byte{0, 36, 18}: "Benign Technologies Co, Ltd.", + [3]byte{0, 36, 19}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 20}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 21}: "Magnetic Autocontrol GmbH", + [3]byte{0, 36, 22}: "Any Use", + [3]byte{0, 36, 23}: "Thomson Telecom Belgium", + [3]byte{0, 36, 24}: "Nextwave Semiconductor", + [3]byte{0, 36, 25}: "PRIVATE", + [3]byte{0, 36, 26}: "Red Beetle Inc.", + [3]byte{0, 36, 27}: "iWOW Communications Pte Ltd", + [3]byte{0, 36, 28}: "FuGang Electronic (DG) Co.,Ltd", + [3]byte{0, 36, 29}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{0, 36, 30}: "Nintendo Co., Ltd.", + [3]byte{0, 36, 31}: "DCT-Delta GmbH", + [3]byte{0, 36, 32}: "NetUP Inc.", + [3]byte{0, 36, 33}: "MICRO-STAR INT'L CO., LTD.", + [3]byte{0, 36, 34}: "Knapp Logistik Automation GmbH", + [3]byte{0, 36, 35}: "AzureWave Technologies (Shanghai) Inc.", + [3]byte{0, 36, 36}: "Axis Network Technology", + [3]byte{0, 36, 37}: "Shenzhenshi chuangzhicheng Technology Co.,Ltd", + [3]byte{0, 36, 38}: "NOHMI BOSAI LTD.", + [3]byte{0, 36, 39}: "SSI COMPUTER CORP", + [3]byte{0, 36, 40}: "EnergyICT", + [3]byte{0, 36, 41}: "MK MASTER INC.", + [3]byte{0, 36, 42}: "Hittite Microwave Corporation", + [3]byte{0, 36, 43}: "Hon Hai Precision Ind.Co.,Ltd.", + [3]byte{0, 36, 44}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 36, 46}: "Datastrip Inc.", + [3]byte{0, 36, 47}: "Micron", + [3]byte{0, 36, 48}: "Ruby Tech Corp.", + [3]byte{0, 36, 49}: "Uni-v co.,ltd", + [3]byte{0, 36, 50}: "Neostar Technology Co.,LTD", + [3]byte{0, 36, 51}: "Alps Electric Co., Ltd", + [3]byte{0, 36, 52}: "Lectrosonics, Inc.", + [3]byte{0, 36, 53}: "WIDE CORPORATION", + [3]byte{0, 36, 54}: "Apple", + [3]byte{0, 36, 55}: "Motorola - BSG", + [3]byte{0, 36, 56}: "Brocade Communications Systems, Inc", + [3]byte{0, 36, 57}: "Digital Barriers Advanced Technologies", + [3]byte{0, 36, 58}: "Ludl Electronic Products", + [3]byte{0, 36, 59}: "CSSI (S) Pte Ltd", + [3]byte{0, 36, 60}: "S.A.A.A.", + [3]byte{0, 36, 61}: "Emerson Appliance Motors and Controls", + [3]byte{0, 36, 63}: "Storwize, Inc.", + [3]byte{0, 36, 64}: "Halo Monitoring, Inc.", + [3]byte{0, 36, 65}: "Wanzl Metallwarenfabrik GmbH", + [3]byte{0, 36, 66}: "Axona Limited", + [3]byte{0, 36, 67}: "Nortel Networks", + [3]byte{0, 36, 68}: "Nintendo Co., Ltd.", + [3]byte{0, 36, 69}: "CommScope Canada Inc.", + [3]byte{0, 36, 70}: "MMB Research Inc.", + [3]byte{0, 36, 71}: "Kaztek Systems", + [3]byte{0, 36, 72}: "SpiderCloud Wireless, Inc", + [3]byte{0, 36, 73}: "Shen Zhen Lite Star Electronics Technology Co., Ltd", + [3]byte{0, 36, 74}: "Voyant International", + [3]byte{0, 36, 75}: "PERCEPTRON INC", + [3]byte{0, 36, 76}: "Solartron Metrology Ltd", + [3]byte{0, 36, 77}: "Hokkaido Electronics Corporation", + [3]byte{0, 36, 78}: "RadChips, Inc.", + [3]byte{0, 36, 79}: "Asantron Technologies Ltd.", + [3]byte{0, 36, 80}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 81}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 82}: "Silicon Software GmbH", + [3]byte{0, 36, 83}: "Initra d.o.o.", + [3]byte{0, 36, 84}: "Samsung Electronics CO., LTD", + [3]byte{0, 36, 85}: "MuLogic BV", + [3]byte{0, 36, 86}: "2Wire", + [3]byte{0, 36, 88}: "PA Bastion CC", + [3]byte{0, 36, 89}: "ABB STOTZ-KONTAKT GmbH", + [3]byte{0, 36, 90}: "Nanjing Panda Electronics Company Limited", + [3]byte{0, 36, 91}: "RAIDON TECHNOLOGY, INC.", + [3]byte{0, 36, 92}: "Design-Com Technologies Pty. Ltd.", + [3]byte{0, 36, 93}: "Terberg besturingstechniek B.V.", + [3]byte{0, 36, 94}: "Hivision Co.,ltd", + [3]byte{0, 36, 95}: "Vine Telecom CO.,Ltd.", + [3]byte{0, 36, 96}: "Giaval Science Development Co. Ltd.", + [3]byte{0, 36, 97}: "Shin Wang Tech.", + [3]byte{0, 36, 98}: "Rayzone Corporation", + [3]byte{0, 36, 99}: "Phybridge Inc", + [3]byte{0, 36, 100}: "Bridge Technologies Co AS", + [3]byte{0, 36, 101}: "Elentec", + [3]byte{0, 36, 102}: "Unitron nv", + [3]byte{0, 36, 103}: "AOC International (Europe) GmbH", + [3]byte{0, 36, 104}: "Sumavision Technologies Co.,Ltd", + [3]byte{0, 36, 105}: "Smart Doorphones", + [3]byte{0, 36, 106}: "Solid Year Co., Ltd.", + [3]byte{0, 36, 107}: "Covia, Inc.", + [3]byte{0, 36, 108}: "ARUBA NETWORKS, INC.", + [3]byte{0, 36, 109}: "Weinzierl Engineering GmbH", + [3]byte{0, 36, 110}: "Phihong USA Corp.", + [3]byte{0, 36, 111}: "Onda Communication spa", + [3]byte{0, 36, 112}: "AUROTECH ultrasound AS.", + [3]byte{0, 36, 113}: "Fusion MultiSystems dba Fusion-io", + [3]byte{0, 36, 114}: "ReDriven Power Inc.", + [3]byte{0, 36, 115}: "3Com Europe Ltd", + [3]byte{0, 36, 116}: "Autronica Fire And Securirty", + [3]byte{0, 36, 117}: "Compass System(Embedded Dept.)", + [3]byte{0, 36, 118}: "TAP.tv", + [3]byte{0, 36, 119}: "Tibbo Technology", + [3]byte{0, 36, 120}: "Mag Tech Electronics Co Limited", + [3]byte{0, 36, 121}: "Optec Displays, Inc.", + [3]byte{0, 36, 122}: "FU YI CHENG Technology Co., Ltd.", + [3]byte{0, 36, 123}: "Actiontec Electronics, Inc", + [3]byte{0, 36, 124}: "Nokia Danmark A/S", + [3]byte{0, 36, 125}: "Nokia Danmark A/S", + [3]byte{0, 36, 126}: "Universal Global Scientific Industrial Co., Ltd", + [3]byte{0, 36, 127}: "Nortel Networks", + [3]byte{0, 36, 128}: "Meteocontrol GmbH", + [3]byte{0, 36, 129}: "Hewlett-Packard Company", + [3]byte{0, 36, 130}: "Ruckus Wireless", + [3]byte{0, 36, 131}: "LG Electronics", + [3]byte{0, 36, 132}: "Bang and Olufsen Medicom a/s", + [3]byte{0, 36, 133}: "ConteXtream Ltd", + [3]byte{0, 36, 134}: "DesignArt Networks", + [3]byte{0, 36, 135}: "Blackboard Inc.", + [3]byte{0, 36, 136}: "Centre For Development Of Telematics", + [3]byte{0, 36, 137}: "Vodafone Omnitel N.V.", + [3]byte{0, 36, 138}: "Kaga Electronics Co., Ltd.", + [3]byte{0, 36, 139}: "HYBUS CO., LTD.", + [3]byte{0, 36, 140}: "ASUSTek COMPUTER INC.", + [3]byte{0, 36, 141}: "Sony Computer Entertainment Inc.", + [3]byte{0, 36, 142}: "Infoware ZRt.", + [3]byte{0, 36, 143}: "DO-MONIX", + [3]byte{0, 36, 144}: "Samsung Electronics Co.,LTD", + [3]byte{0, 36, 145}: "Samsung Electronics", + [3]byte{0, 36, 146}: "Motorola, Broadband Solutions Group", + [3]byte{0, 36, 147}: "ARRIS Group, Inc.", + [3]byte{0, 36, 148}: "Shenzhen Baoxin Tech CO., Ltd.", + [3]byte{0, 36, 149}: "ARRIS Group, Inc.", + [3]byte{0, 36, 150}: "Ginzinger electronic systems", + [3]byte{0, 36, 151}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 152}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 153}: "Aquila Technologies", + [3]byte{0, 36, 154}: "Beijing Zhongchuang Telecommunication Test Co., Ltd.", + [3]byte{0, 36, 155}: "Action Star Enterprise Co., Ltd.", + [3]byte{0, 36, 156}: "Bimeng Comunication System Co. Ltd", + [3]byte{0, 36, 157}: "NES Technology Inc.", + [3]byte{0, 36, 158}: "ADC-Elektronik GmbH", + [3]byte{0, 36, 159}: "RIM Testing Services", + [3]byte{0, 36, 160}: "ARRIS Group, Inc.", + [3]byte{0, 36, 161}: "ARRIS Group, Inc.", + [3]byte{0, 36, 162}: "Hong Kong Middleware Technology Limited", + [3]byte{0, 36, 163}: "Sonim Technologies Inc", + [3]byte{0, 36, 164}: "Siklu Communication", + [3]byte{0, 36, 165}: "Buffalo Inc.", + [3]byte{0, 36, 166}: "TELESTAR DIGITAL GmbH", + [3]byte{0, 36, 167}: "Advanced Video Communications Inc.", + [3]byte{0, 36, 168}: "ProCurve Networking by HP", + [3]byte{0, 36, 169}: "Ag Leader Technology", + [3]byte{0, 36, 170}: "Dycor Technologies Ltd.", + [3]byte{0, 36, 171}: "A7 Engineering, Inc.", + [3]byte{0, 36, 172}: "Hangzhou DPtech Technologies Co., Ltd.", + [3]byte{0, 36, 173}: "Adolf Thies Gmbh & Co. KG", + [3]byte{0, 36, 174}: "Morpho", + [3]byte{0, 36, 175}: "EchoStar Technologies", + [3]byte{0, 36, 176}: "ESAB AB", + [3]byte{0, 36, 177}: "Coulomb Technologies", + [3]byte{0, 36, 178}: "Netgear", + [3]byte{0, 36, 179}: "Graf-Syteco GmbH & Co. KG", + [3]byte{0, 36, 180}: "ESCATRONIC GmbH", + [3]byte{0, 36, 181}: "Nortel Networks", + [3]byte{0, 36, 182}: "Seagate Technology", + [3]byte{0, 36, 183}: "GridPoint, Inc.", + [3]byte{0, 36, 184}: "free alliance sdn bhd", + [3]byte{0, 36, 185}: "Wuhan Higheasy Electronic Technology Development Co.Ltd", + [3]byte{0, 36, 186}: "Texas Instruments", + [3]byte{0, 36, 187}: "CENTRAL Corporation", + [3]byte{0, 36, 188}: "HuRob Co.,Ltd", + [3]byte{0, 36, 189}: "Hainzl Industriesysteme GmbH", + [3]byte{0, 36, 190}: "Sony Corporation", + [3]byte{0, 36, 191}: "CIAT", + [3]byte{0, 36, 192}: "NTI COMODO INC", + [3]byte{0, 36, 193}: "ARRIS Group, Inc.", + [3]byte{0, 36, 194}: "Asumo Co.,Ltd.", + [3]byte{0, 36, 195}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 196}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 197}: "Meridian Audio Limited", + [3]byte{0, 36, 198}: "Hager Electro SAS", + [3]byte{0, 36, 199}: "Mobilarm Ltd", + [3]byte{0, 36, 200}: "Broadband Solutions Group", + [3]byte{0, 36, 201}: "Broadband Solutions Group", + [3]byte{0, 36, 202}: "Tobii Technology AB", + [3]byte{0, 36, 203}: "Autonet Mobile", + [3]byte{0, 36, 204}: "Fascinations Toys and Gifts, Inc.", + [3]byte{0, 36, 205}: "Willow Garage, Inc.", + [3]byte{0, 36, 206}: "Exeltech Inc", + [3]byte{0, 36, 207}: "Inscape Data Corporation", + [3]byte{0, 36, 208}: "Shenzhen SOGOOD Industry CO.,LTD.", + [3]byte{0, 36, 209}: "Thomson Inc.", + [3]byte{0, 36, 210}: "Askey Computer", + [3]byte{0, 36, 211}: "QUALICA Inc.", + [3]byte{0, 36, 212}: "FREEBOX SA", + [3]byte{0, 36, 213}: "Winward Industrial Limited", + [3]byte{0, 36, 214}: "Intel Corporate", + [3]byte{0, 36, 215}: "Intel Corporate", + [3]byte{0, 36, 216}: "IlSung Precision", + [3]byte{0, 36, 217}: "BICOM, Inc.", + [3]byte{0, 36, 218}: "Innovar Systems Limited", + [3]byte{0, 36, 219}: "Alcohol Monitoring Systems", + [3]byte{0, 36, 220}: "Juniper Networks", + [3]byte{0, 36, 221}: "Centrak, Inc.", + [3]byte{0, 36, 222}: "GLOBAL Technology Inc.", + [3]byte{0, 36, 223}: "Digitalbox Europe GmbH", + [3]byte{0, 36, 224}: "DS Tech, LLC", + [3]byte{0, 36, 225}: "Convey Computer Corp.", + [3]byte{0, 36, 226}: "HASEGAWA ELECTRIC CO.,LTD.", + [3]byte{0, 36, 227}: "CAO Group", + [3]byte{0, 36, 228}: "Withings", + [3]byte{0, 36, 229}: "Seer Technology, Inc", + [3]byte{0, 36, 230}: "In Motion Technology Inc.", + [3]byte{0, 36, 231}: "Plaster Networks", + [3]byte{0, 36, 232}: "Dell Inc.", + [3]byte{0, 36, 233}: "Samsung Electronics Co., Ltd., Storage System Division", + [3]byte{0, 36, 234}: "iris-GmbH infrared & intelligent sensors", + [3]byte{0, 36, 235}: "ClearPath Networks, Inc.", + [3]byte{0, 36, 236}: "United Information Technology Co.,Ltd.", + [3]byte{0, 36, 237}: "YT Elec. Co,.Ltd.", + [3]byte{0, 36, 238}: "Wynmax Inc.", + [3]byte{0, 36, 239}: "Sony Ericsson Mobile Communications", + [3]byte{0, 36, 240}: "Seanodes", + [3]byte{0, 36, 241}: "Shenzhen Fanhai Sanjiang Electronics Co., Ltd.", + [3]byte{0, 36, 242}: "Uniphone Telecommunication Co., Ltd.", + [3]byte{0, 36, 243}: "Nintendo Co., Ltd.", + [3]byte{0, 36, 244}: "Kaminario Technologies Ltd.", + [3]byte{0, 36, 245}: "NDS Surgical Imaging", + [3]byte{0, 36, 246}: "MIYOSHI ELECTRONICS CORPORATION", + [3]byte{0, 36, 247}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 248}: "Technical Solutions Company Ltd.", + [3]byte{0, 36, 249}: "CISCO SYSTEMS, INC.", + [3]byte{0, 36, 250}: "Hilger u. Kern GMBH", + [3]byte{0, 36, 251}: "PRIVATE", + [3]byte{0, 36, 252}: "QuoPin Co., Ltd.", + [3]byte{0, 36, 253}: "Accedian Networks Inc", + [3]byte{0, 36, 254}: "AVM GmbH", + [3]byte{0, 36, 255}: "QLogic Corporation", + [3]byte{0, 37, 0}: "Apple", + [3]byte{0, 37, 1}: "JSC \"Supertel\"", + [3]byte{0, 37, 2}: "NaturalPoint", + [3]byte{0, 37, 3}: "IBM Corp", + [3]byte{0, 37, 4}: "Valiant Communications Limited", + [3]byte{0, 37, 5}: "eks Engel GmbH & Co. KG", + [3]byte{0, 37, 6}: "A.I. ANTITACCHEGGIO ITALIA SRL", + [3]byte{0, 37, 7}: "ASTAK Inc.", + [3]byte{0, 37, 8}: "Maquet Cardiopulmonary AG", + [3]byte{0, 37, 9}: "SHARETRONIC Group LTD", + [3]byte{0, 37, 10}: "Security Expert Co. Ltd", + [3]byte{0, 37, 11}: "CENTROFACTOR INC", + [3]byte{0, 37, 12}: "Enertrac", + [3]byte{0, 37, 13}: "GZT Telkom-Telmor sp. z o.o.", + [3]byte{0, 37, 14}: "gt german telematics gmbh", + [3]byte{0, 37, 15}: "On-Ramp Wireless, Inc.", + [3]byte{0, 37, 16}: "Pico-Tesla Magnetic Therapies", + [3]byte{0, 37, 17}: "ELITEGROUP COMPUTER SYSTEM CO., LTD.", + [3]byte{0, 37, 18}: "ZTE Corporation", + [3]byte{0, 37, 19}: "CXP DIGITAL BV", + [3]byte{0, 37, 20}: "PC Worth Int'l Co., Ltd.", + [3]byte{0, 37, 21}: "SFR", + [3]byte{0, 37, 22}: "Integrated Design Tools, Inc.", + [3]byte{0, 37, 23}: "Venntis, LLC", + [3]byte{0, 37, 24}: "Power PLUS Communications AG", + [3]byte{0, 37, 25}: "Viaas Inc", + [3]byte{0, 37, 26}: "Psiber Data Systems Inc.", + [3]byte{0, 37, 27}: "Philips CareServant", + [3]byte{0, 37, 28}: "EDT", + [3]byte{0, 37, 29}: "DSA Encore, LLC", + [3]byte{0, 37, 30}: "ROTEL TECHNOLOGIES", + [3]byte{0, 37, 31}: "ZYNUS VISION INC.", + [3]byte{0, 37, 32}: "SMA Railway Technology GmbH", + [3]byte{0, 37, 33}: "Logitek Electronic Systems, Inc.", + [3]byte{0, 37, 34}: "ASRock Incorporation", + [3]byte{0, 37, 35}: "OCP Inc.", + [3]byte{0, 37, 36}: "Lightcomm Technology Co., Ltd", + [3]byte{0, 37, 37}: "CTERA Networks Ltd.", + [3]byte{0, 37, 38}: "Genuine Technologies Co., Ltd.", + [3]byte{0, 37, 39}: "Bitrode Corp.", + [3]byte{0, 37, 40}: "Daido Signal Co., Ltd.", + [3]byte{0, 37, 41}: "COMELIT GROUP S.P.A", + [3]byte{0, 37, 42}: "Chengdu GeeYa Technology Co.,LTD", + [3]byte{0, 37, 43}: "Stirling Energy Systems", + [3]byte{0, 37, 44}: "Entourage Systems, Inc.", + [3]byte{0, 37, 45}: "Kiryung Electronics", + [3]byte{0, 37, 46}: "Cisco SPVTG", + [3]byte{0, 37, 47}: "Energy, Inc.", + [3]byte{0, 37, 48}: "Aetas Systems Inc.", + [3]byte{0, 37, 49}: "Cloud Engines, Inc.", + [3]byte{0, 37, 50}: "Digital Recorders", + [3]byte{0, 37, 51}: "WITTENSTEIN AG", + [3]byte{0, 37, 53}: "Minimax GmbH & Co KG", + [3]byte{0, 37, 54}: "Oki Electric Industry Co., Ltd.", + [3]byte{0, 37, 55}: "Runcom Technologies Ltd.", + [3]byte{0, 37, 56}: "Samsung Electronics Co., Ltd., Memory Division", + [3]byte{0, 37, 57}: "IfTA GmbH", + [3]byte{0, 37, 58}: "CEVA, Ltd.", + [3]byte{0, 37, 59}: "din Dietmar Nocker Facilitymanagement GmbH", + [3]byte{0, 37, 60}: "2Wire", + [3]byte{0, 37, 61}: "DRS Consolidated Controls", + [3]byte{0, 37, 62}: "Sensus Metering Systems", + [3]byte{0, 37, 64}: "Quasar Technologies, Inc.", + [3]byte{0, 37, 65}: "Maquet Critical Care AB", + [3]byte{0, 37, 66}: "Pittasoft", + [3]byte{0, 37, 67}: "MONEYTECH", + [3]byte{0, 37, 68}: "LoJack Corporation", + [3]byte{0, 37, 69}: "CISCO SYSTEMS, INC.", + [3]byte{0, 37, 70}: "CISCO SYSTEMS, INC.", + [3]byte{0, 37, 71}: "Nokia Danmark A/S", + [3]byte{0, 37, 72}: "Nokia Danmark A/S", + [3]byte{0, 37, 73}: "Jeorich Tech. Co.,Ltd.", + [3]byte{0, 37, 74}: "RingCube Technologies, Inc.", + [3]byte{0, 37, 75}: "Apple", + [3]byte{0, 37, 76}: "Videon Central, Inc.", + [3]byte{0, 37, 77}: "Singapore Technologies Electronics Limited", + [3]byte{0, 37, 78}: "Vertex Wireless Co., Ltd.", + [3]byte{0, 37, 79}: "ELETTROLAB Srl", + [3]byte{0, 37, 80}: "Riverbed Technology", + [3]byte{0, 37, 81}: "SE-Elektronic GmbH", + [3]byte{0, 37, 82}: "VXI CORPORATION", + [3]byte{0, 37, 83}: "Pirelli Tyre S.p.A.", + [3]byte{0, 37, 84}: "Pixel8 Networks", + [3]byte{0, 37, 85}: "Visonic Technologies 1993 Ltd", + [3]byte{0, 37, 86}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{0, 37, 87}: "Research In Motion", + [3]byte{0, 37, 88}: "MPEDIA", + [3]byte{0, 37, 89}: "Syphan Technologies Ltd", + [3]byte{0, 37, 90}: "Tantalus Systems Corp.", + [3]byte{0, 37, 91}: "CoachComm, LLC", + [3]byte{0, 37, 92}: "NEC Corporation", + [3]byte{0, 37, 93}: "Morningstar Corporation", + [3]byte{0, 37, 94}: "Shanghai Dare Technologies Co.,Ltd.", + [3]byte{0, 37, 95}: "SenTec AG", + [3]byte{0, 37, 96}: "Ibridge Networks & Communications Ltd.", + [3]byte{0, 37, 97}: "ProCurve Networking by HP", + [3]byte{0, 37, 98}: "interbro Co. Ltd.", + [3]byte{0, 37, 99}: "Luxtera Inc", + [3]byte{0, 37, 100}: "Dell Inc.", + [3]byte{0, 37, 101}: "Vizimax Inc.", + [3]byte{0, 37, 102}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 37, 103}: "Samsung Electronics", + [3]byte{0, 37, 104}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{0, 37, 105}: "SAGEM COMMUNICATION", + [3]byte{0, 37, 106}: "inIT - Institut Industrial IT", + [3]byte{0, 37, 107}: "ATENIX E.E. s.r.l.", + [3]byte{0, 37, 108}: "\"Azimut\" Production Association JSC", + [3]byte{0, 37, 109}: "Broadband Forum", + [3]byte{0, 37, 110}: "Van Breda B.V.", + [3]byte{0, 37, 111}: "Dantherm Power", + [3]byte{0, 37, 112}: "Eastern Communications Company Limited", + [3]byte{0, 37, 113}: "Zhejiang Tianle Digital Electric Co.,Ltd", + [3]byte{0, 37, 114}: "Nemo-Q International AB", + [3]byte{0, 37, 115}: "ST Electronics (Info-Security) Pte Ltd", + [3]byte{0, 37, 116}: "KUNIMI MEDIA DEVICE Co., Ltd.", + [3]byte{0, 37, 117}: "FiberPlex Technologies, LLC", + [3]byte{0, 37, 118}: "NELI TECHNOLOGIES", + [3]byte{0, 37, 119}: "D-BOX Technologies", + [3]byte{0, 37, 120}: "JSC \"Concern \"Sozvezdie\"", + [3]byte{0, 37, 121}: "J & F Labs", + [3]byte{0, 37, 122}: "CAMCO Produktions- und Vertriebs-GmbH für Beschallungs- und Beleuchtungsanlagen", + [3]byte{0, 37, 123}: "STJ ELECTRONICS PVT LTD", + [3]byte{0, 37, 124}: "Huachentel Technology Development Co., Ltd", + [3]byte{0, 37, 125}: "PointRed Telecom Private Ltd.", + [3]byte{0, 37, 126}: "NEW POS Technology Limited", + [3]byte{0, 37, 127}: "CallTechSolution Co.,Ltd", + [3]byte{0, 37, 128}: "Equipson S.A.", + [3]byte{0, 37, 129}: "x-star networks Inc.", + [3]byte{0, 37, 130}: "Maksat Technologies (P) Ltd", + [3]byte{0, 37, 131}: "CISCO SYSTEMS, INC.", + [3]byte{0, 37, 132}: "CISCO SYSTEMS, INC.", + [3]byte{0, 37, 133}: "KOKUYO S&T Co., Ltd.", + [3]byte{0, 37, 134}: "TP-LINK Technologies Co., Ltd.", + [3]byte{0, 37, 135}: "Vitality, Inc.", + [3]byte{0, 37, 136}: "Genie Industries, Inc.", + [3]byte{0, 37, 137}: "Hills Industries Limited", + [3]byte{0, 37, 138}: "Pole/Zero Corporation", + [3]byte{0, 37, 139}: "Mellanox Technologies Ltd", + [3]byte{0, 37, 140}: "ESUS ELEKTRONIK SAN. VE DIS. TIC. LTD. STI.", + [3]byte{0, 37, 141}: "Haier", + [3]byte{0, 37, 142}: "The Weather Channel", + [3]byte{0, 37, 143}: "Trident Microsystems, Inc.", + [3]byte{0, 37, 144}: "Super Micro Computer, Inc.", + [3]byte{0, 37, 145}: "NEXTEK, Inc.", + [3]byte{0, 37, 146}: "Guangzhou Shirui Electronic Co., Ltd", + [3]byte{0, 37, 147}: "DatNet Informatikai Kft.", + [3]byte{0, 37, 148}: "Eurodesign BG LTD", + [3]byte{0, 37, 149}: "Northwest Signal Supply, Inc", + [3]byte{0, 37, 150}: "GIGAVISION srl", + [3]byte{0, 37, 151}: "Kalki Communication Technologies", + [3]byte{0, 37, 152}: "Zhong Shan City Litai Electronic Industrial Co. Ltd", + [3]byte{0, 37, 153}: "Hedon e.d. B.V.", + [3]byte{0, 37, 154}: "CEStronics GmbH", + [3]byte{0, 37, 155}: "Beijing PKUNITY Microsystems Technology Co., Ltd", + [3]byte{0, 37, 156}: "Cisco-Linksys, LLC", + [3]byte{0, 37, 157}: "PRIVATE", + [3]byte{0, 37, 158}: "Huawei Technologies Co., Ltd.", + [3]byte{0, 37, 159}: "TechnoDigital Technologies GmbH", + [3]byte{0, 37, 160}: "Nintendo Co., Ltd.", + [3]byte{0, 37, 161}: "Enalasys", + [3]byte{0, 37, 162}: "Alta Definicion LINCEO S.L.", + [3]byte{0, 37, 163}: "Trimax Wireless, Inc.", + [3]byte{0, 37, 164}: "EuroDesign embedded technologies GmbH", + [3]byte{0, 37, 165}: "Walnut Media Network", + [3]byte{0, 37, 166}: "Central Network Solution Co., Ltd.", + [3]byte{0, 37, 167}: "Comverge, Inc.", + [3]byte{0, 37, 168}: "Kontron (BeiJing) Technology Co.,Ltd", + [3]byte{0, 37, 169}: "Shanghai Embedway Information Technologies Co.,Ltd", + [3]byte{0, 37, 170}: "Beijing Soul Technology Co.,Ltd.", + [3]byte{0, 37, 171}: "AIO LCD PC BU / TPV", + [3]byte{0, 37, 172}: "I-Tech corporation", + [3]byte{0, 37, 173}: "Manufacturing Resources International", + [3]byte{0, 37, 174}: "Microsoft Corporation", + [3]byte{0, 37, 175}: "COMFILE Technology", + [3]byte{0, 37, 176}: "Schmartz Inc", + [3]byte{0, 37, 177}: "Maya-Creation Corporation", + [3]byte{0, 37, 178}: "MBDA Deutschland GmbH", + [3]byte{0, 37, 179}: "Hewlett-Packard Company", + [3]byte{0, 37, 180}: "CISCO SYSTEMS, INC.", + [3]byte{0, 37, 181}: "CISCO SYSTEMS, INC.", + [3]byte{0, 37, 182}: "Telecom FM", + [3]byte{0, 37, 183}: "Costar electronics, inc.,", + [3]byte{0, 37, 184}: "Agile Communications, Inc.", + [3]byte{0, 37, 185}: "Cypress Solutions Inc", + [3]byte{0, 37, 186}: "Alcatel-Lucent IPD", + [3]byte{0, 37, 187}: "INNERINT Co., Ltd.", + [3]byte{0, 37, 188}: "Apple", + [3]byte{0, 37, 189}: "Italdata Ingegneria dell'Idea S.p.A.", + [3]byte{0, 37, 190}: "Tektrap Systems Inc.", + [3]byte{0, 37, 191}: "Wireless Cables Inc.", + [3]byte{0, 37, 192}: "ZillionTV Corporation", + [3]byte{0, 37, 193}: "Nawoo Korea Corp.", + [3]byte{0, 37, 194}: "RingBell Co.,Ltd.", + [3]byte{0, 37, 195}: "Nortel Networks", + [3]byte{0, 37, 196}: "Ruckus Wireless", + [3]byte{0, 37, 197}: "Star Link Communication Pvt. Ltd.", + [3]byte{0, 37, 198}: "kasercorp, ltd", + [3]byte{0, 37, 199}: "altek Corporation", + [3]byte{0, 37, 200}: "S-Access GmbH", + [3]byte{0, 37, 201}: "SHENZHEN HUAPU DIGITAL CO., LTD", + [3]byte{0, 37, 202}: "LS Research, LLC", + [3]byte{0, 37, 203}: "Reiner SCT", + [3]byte{0, 37, 204}: "Mobile Communications Korea Incorporated", + [3]byte{0, 37, 205}: "Skylane Optics", + [3]byte{0, 37, 206}: "InnerSpace", + [3]byte{0, 37, 207}: "Nokia Danmark A/S", + [3]byte{0, 37, 208}: "Nokia Danmark A/S", + [3]byte{0, 37, 209}: "Eastern Asia Technology Limited", + [3]byte{0, 37, 210}: "InpegVision Co., Ltd", + [3]byte{0, 37, 211}: "AzureWave Technologies, Inc", + [3]byte{0, 37, 212}: "Fortress Technologies", + [3]byte{0, 37, 213}: "Robonica (Pty) Ltd", + [3]byte{0, 37, 214}: "The Kroger Co.", + [3]byte{0, 37, 215}: "CEDO", + [3]byte{0, 37, 216}: "KOREA MAINTENANCE", + [3]byte{0, 37, 217}: "DataFab Systems Inc.", + [3]byte{0, 37, 218}: "Secura Key", + [3]byte{0, 37, 219}: "ATI Electronics(Shenzhen) Co., LTD", + [3]byte{0, 37, 220}: "Sumitomo Electric Networks, Inc", + [3]byte{0, 37, 221}: "SUNNYTEK INFORMATION CO., LTD.", + [3]byte{0, 37, 222}: "Probits Co., LTD.", + [3]byte{0, 37, 223}: "PRIVATE", + [3]byte{0, 37, 224}: "CeedTec Sdn Bhd", + [3]byte{0, 37, 225}: "SHANGHAI SEEYOO ELECTRONIC & TECHNOLOGY CO., LTD", + [3]byte{0, 37, 226}: "Everspring Industry Co., Ltd.", + [3]byte{0, 37, 227}: "Hanshinit Inc.", + [3]byte{0, 37, 228}: "OMNI-WiFi, LLC", + [3]byte{0, 37, 229}: "LG Electronics Inc", + [3]byte{0, 37, 230}: "Belgian Monitoring Systems bvba", + [3]byte{0, 37, 231}: "Sony Ericsson Mobile Communications", + [3]byte{0, 37, 232}: "Idaho Technology", + [3]byte{0, 37, 233}: "i-mate Development, Inc.", + [3]byte{0, 37, 234}: "Iphion BV", + [3]byte{0, 37, 235}: "Reutech Radar Systems (PTY) Ltd", + [3]byte{0, 37, 236}: "Humanware", + [3]byte{0, 37, 237}: "NuVo Technologies LLC", + [3]byte{0, 37, 238}: "Avtex Ltd", + [3]byte{0, 37, 239}: "I-TEC Co., Ltd.", + [3]byte{0, 37, 240}: "Suga Electronics Limited", + [3]byte{0, 37, 241}: "ARRIS Group, Inc.", + [3]byte{0, 37, 242}: "ARRIS Group, Inc.", + [3]byte{0, 37, 243}: "Nordwestdeutsche Zählerrevision", + [3]byte{0, 37, 244}: "KoCo Connector AG", + [3]byte{0, 37, 245}: "DVS Korea, Co., Ltd", + [3]byte{0, 37, 246}: "netTALK.com, Inc.", + [3]byte{0, 37, 247}: "Ansaldo STS USA", + [3]byte{0, 37, 249}: "GMK electronic design GmbH", + [3]byte{0, 37, 250}: "J&M Analytik AG", + [3]byte{0, 37, 251}: "Tunstall Healthcare A/S", + [3]byte{0, 37, 252}: "ENDA ENDUSTRIYEL ELEKTRONIK LTD. STI.", + [3]byte{0, 37, 253}: "OBR Centrum Techniki Morskiej S.A.", + [3]byte{0, 37, 254}: "Pilot Electronics Corporation", + [3]byte{0, 37, 255}: "CreNova Multimedia Co., Ltd", + [3]byte{0, 38, 0}: "TEAC Australia Pty Ltd.", + [3]byte{0, 38, 1}: "Cutera Inc", + [3]byte{0, 38, 2}: "SMART Temps LLC", + [3]byte{0, 38, 3}: "Shenzhen Wistar Technology Co., Ltd", + [3]byte{0, 38, 4}: "Audio Processing Technology Ltd", + [3]byte{0, 38, 5}: "CC Systems AB", + [3]byte{0, 38, 6}: "RAUMFELD GmbH", + [3]byte{0, 38, 7}: "Enabling Technology Pty Ltd", + [3]byte{0, 38, 8}: "Apple", + [3]byte{0, 38, 9}: "Phyllis Co., Ltd.", + [3]byte{0, 38, 10}: "CISCO SYSTEMS, INC.", + [3]byte{0, 38, 11}: "CISCO SYSTEMS, INC.", + [3]byte{0, 38, 12}: "Dataram", + [3]byte{0, 38, 13}: "Mercury Systems, Inc.", + [3]byte{0, 38, 14}: "Ablaze Systems, LLC", + [3]byte{0, 38, 15}: "Linn Products Ltd", + [3]byte{0, 38, 16}: "Apacewave Technologies", + [3]byte{0, 38, 17}: "Licera AB", + [3]byte{0, 38, 18}: "Space Exploration Technologies", + [3]byte{0, 38, 19}: "Engel Axil S.L.", + [3]byte{0, 38, 20}: "KTNF", + [3]byte{0, 38, 21}: "Teracom Limited", + [3]byte{0, 38, 22}: "Rosemount Inc.", + [3]byte{0, 38, 23}: "OEM Worldwide", + [3]byte{0, 38, 24}: "ASUSTek COMPUTER INC.", + [3]byte{0, 38, 25}: "FRC", + [3]byte{0, 38, 26}: "Femtocomm System Technology Corp.", + [3]byte{0, 38, 27}: "LAUREL BANK MACHINES CO., LTD.", + [3]byte{0, 38, 28}: "NEOVIA INC.", + [3]byte{0, 38, 29}: "COP SECURITY SYSTEM CORP.", + [3]byte{0, 38, 30}: "QINGBANG ELEC(SZ) CO., LTD", + [3]byte{0, 38, 31}: "SAE Magnetics (H.K.) Ltd.", + [3]byte{0, 38, 32}: "ISGUS GmbH", + [3]byte{0, 38, 33}: "InteliCloud Technology Inc.", + [3]byte{0, 38, 34}: "COMPAL INFORMATION (KUNSHAN) CO., LTD.", + [3]byte{0, 38, 35}: "JRD Communication Inc", + [3]byte{0, 38, 36}: "Thomson Inc.", + [3]byte{0, 38, 37}: "MediaSputnik", + [3]byte{0, 38, 38}: "Geophysical Survey Systems, Inc.", + [3]byte{0, 38, 39}: "Truesell", + [3]byte{0, 38, 40}: "companytec automação e controle ltda.", + [3]byte{0, 38, 41}: "Juphoon System Software Inc.", + [3]byte{0, 38, 42}: "Proxense, LLC", + [3]byte{0, 38, 43}: "Wongs Electronics Co. Ltd.", + [3]byte{0, 38, 44}: "IKT Advanced Technologies s.r.o.", + [3]byte{0, 38, 45}: "Wistron Corporation", + [3]byte{0, 38, 46}: "Chengdu Jiuzhou Electronic Technology Inc", + [3]byte{0, 38, 47}: "HAMAMATSU TOA ELECTRONICS", + [3]byte{0, 38, 48}: "ACOREL S.A.S", + [3]byte{0, 38, 49}: "COMMTACT LTD", + [3]byte{0, 38, 50}: "Instrumentation Technologies d.d.", + [3]byte{0, 38, 51}: "MIR - Medical International Research", + [3]byte{0, 38, 52}: "Infineta Systems, Inc", + [3]byte{0, 38, 53}: "Bluetechnix GmbH", + [3]byte{0, 38, 54}: "ARRIS Group, Inc.", + [3]byte{0, 38, 55}: "Samsung Electro-Mechanics", + [3]byte{0, 38, 56}: "Xia Men Joyatech Co., Ltd.", + [3]byte{0, 38, 57}: "T.M. Electronics, Inc.", + [3]byte{0, 38, 58}: "Digitec Systems", + [3]byte{0, 38, 59}: "Onbnetech", + [3]byte{0, 38, 60}: "Bachmann Technology GmbH & Co. KG", + [3]byte{0, 38, 61}: "MIA Corporation", + [3]byte{0, 38, 62}: "Trapeze Networks", + [3]byte{0, 38, 63}: "LIOS Technology GmbH", + [3]byte{0, 38, 64}: "Baustem Broadband Technologies, Ltd.", + [3]byte{0, 38, 65}: "ARRIS Group, Inc.", + [3]byte{0, 38, 66}: "ARRIS Group, Inc.", + [3]byte{0, 38, 67}: "Alps Electric Co., Ltd", + [3]byte{0, 38, 68}: "Thomson Telecom Belgium", + [3]byte{0, 38, 69}: "Circontrol S.A.", + [3]byte{0, 38, 70}: "SHENYANG TONGFANG MULTIMEDIA TECHNOLOGY COMPANY LIMITED", + [3]byte{0, 38, 71}: "WFE TECHNOLOGY CORP.", + [3]byte{0, 38, 72}: "Emitech Corp.", + [3]byte{0, 38, 74}: "Apple", + [3]byte{0, 38, 76}: "Shanghai DigiVision Technology Co., Ltd.", + [3]byte{0, 38, 77}: "Arcadyan Technology Corporation", + [3]byte{0, 38, 78}: "Rail & Road Protec GmbH", + [3]byte{0, 38, 79}: "Krüger &Gothe GmbH", + [3]byte{0, 38, 80}: "2Wire", + [3]byte{0, 38, 81}: "CISCO SYSTEMS, INC.", + [3]byte{0, 38, 82}: "CISCO SYSTEMS, INC.", + [3]byte{0, 38, 83}: "DaySequerra Corporation", + [3]byte{0, 38, 84}: "3Com Corporation", + [3]byte{0, 38, 85}: "Hewlett-Packard Company", + [3]byte{0, 38, 86}: "Sansonic Electronics USA", + [3]byte{0, 38, 87}: "OOO NPP EKRA", + [3]byte{0, 38, 88}: "T-Platforms (Cyprus) Limited", + [3]byte{0, 38, 89}: "Nintendo Co., Ltd.", + [3]byte{0, 38, 90}: "D-Link Corporation", + [3]byte{0, 38, 91}: "Hitron Technologies. Inc", + [3]byte{0, 38, 92}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{0, 38, 93}: "Samsung Electronics", + [3]byte{0, 38, 94}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{0, 38, 95}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 38, 96}: "Logiways", + [3]byte{0, 38, 97}: "Irumtek Co., Ltd.", + [3]byte{0, 38, 98}: "Actiontec Electronics, Inc", + [3]byte{0, 38, 99}: "Shenzhen Huitaiwei Tech. Ltd, co.", + [3]byte{0, 38, 100}: "Core System Japan", + [3]byte{0, 38, 101}: "ProtectedLogic Corporation", + [3]byte{0, 38, 102}: "EFM Networks", + [3]byte{0, 38, 103}: "CARECOM CO.,LTD.", + [3]byte{0, 38, 104}: "Nokia Danmark A/S", + [3]byte{0, 38, 105}: "Nokia Danmark A/S", + [3]byte{0, 38, 106}: "ESSENSIUM NV", + [3]byte{0, 38, 107}: "SHINE UNION ENTERPRISE LIMITED", + [3]byte{0, 38, 108}: "Inventec", + [3]byte{0, 38, 109}: "MobileAccess Networks", + [3]byte{0, 38, 110}: "Nissho-denki Co.,LTD.", + [3]byte{0, 38, 111}: "Coordiwise Technology Corp.", + [3]byte{0, 38, 112}: "Cinch Connectors", + [3]byte{0, 38, 113}: "AUTOVISION Co., Ltd", + [3]byte{0, 38, 114}: "AAMP of America", + [3]byte{0, 38, 115}: "RICOH COMPANY,LTD.", + [3]byte{0, 38, 116}: "Electronic Solutions, Inc.", + [3]byte{0, 38, 117}: "Aztech Electronics Pte Ltd", + [3]byte{0, 38, 118}: "COMMidt AS", + [3]byte{0, 38, 119}: "DEIF A/S", + [3]byte{0, 38, 120}: "Logic Instrument SA", + [3]byte{0, 38, 121}: "Euphonic Technologies, Inc.", + [3]byte{0, 38, 122}: "wuhan hongxin telecommunication technologies co.,ltd", + [3]byte{0, 38, 123}: "GSI Helmholtzzentrum für Schwerionenforschung GmbH", + [3]byte{0, 38, 124}: "Metz-Werke GmbH & Co KG", + [3]byte{0, 38, 125}: "A-Max Technology Macao Commercial Offshore Company Limited", + [3]byte{0, 38, 126}: "Parrot SA", + [3]byte{0, 38, 127}: "Zenterio AB", + [3]byte{0, 38, 128}: "Lockie Innovation Pty Ltd", + [3]byte{0, 38, 129}: "Interspiro AB", + [3]byte{0, 38, 130}: "Gemtek Technology Co., Ltd.", + [3]byte{0, 38, 131}: "Ajoho Enterprise Co., Ltd.", + [3]byte{0, 38, 132}: "KISAN SYSTEM", + [3]byte{0, 38, 133}: "Digital Innovation", + [3]byte{0, 38, 134}: "Quantenna Communcations, Inc.", + [3]byte{0, 38, 135}: "Corega K.K", + [3]byte{0, 38, 136}: "Juniper Networks", + [3]byte{0, 38, 137}: "General Dynamics Robotic Systems", + [3]byte{0, 38, 138}: "Terrier SC Ltd", + [3]byte{0, 38, 139}: "Guangzhou Escene Computer Technology Limited", + [3]byte{0, 38, 140}: "StarLeaf Ltd.", + [3]byte{0, 38, 141}: "CellTel S.p.A.", + [3]byte{0, 38, 142}: "Alta Solutions, Inc.", + [3]byte{0, 38, 143}: "MTA SpA", + [3]byte{0, 38, 144}: "I DO IT", + [3]byte{0, 38, 145}: "SAGEM COMMUNICATION", + [3]byte{0, 38, 146}: "Mitsubishi Electric Co.", + [3]byte{0, 38, 147}: "QVidium Technologies, Inc.", + [3]byte{0, 38, 148}: "Senscient Ltd", + [3]byte{0, 38, 149}: "ZT Group Int'l Inc", + [3]byte{0, 38, 150}: "NOOLIX Co., Ltd", + [3]byte{0, 38, 151}: "Cheetah Technologies, L.P.", + [3]byte{0, 38, 152}: "CISCO SYSTEMS, INC.", + [3]byte{0, 38, 153}: "CISCO SYSTEMS, INC.", + [3]byte{0, 38, 154}: "Carina System Co., Ltd.", + [3]byte{0, 38, 155}: "SOKRAT Ltd.", + [3]byte{0, 38, 156}: "ITUS JAPAN CO. LTD", + [3]byte{0, 38, 157}: "M2Mnet Co., Ltd.", + [3]byte{0, 38, 158}: "Quanta Computer Inc", + [3]byte{0, 38, 159}: "PRIVATE", + [3]byte{0, 38, 160}: "moblic", + [3]byte{0, 38, 161}: "Megger", + [3]byte{0, 38, 162}: "Instrumentation Technology Systems", + [3]byte{0, 38, 163}: "FQ Ingenieria Electronica S.A.", + [3]byte{0, 38, 164}: "Novus Produtos Eletronicos Ltda", + [3]byte{0, 38, 165}: "MICROROBOT.CO.,LTD", + [3]byte{0, 38, 166}: "TRIXELL", + [3]byte{0, 38, 167}: "CONNECT SRL", + [3]byte{0, 38, 168}: "DAEHAP HYPER-TECH", + [3]byte{0, 38, 169}: "Strong Technologies Pty Ltd", + [3]byte{0, 38, 170}: "Kenmec Mechanical Engineering Co., Ltd.", + [3]byte{0, 38, 171}: "SEIKO EPSON CORPORATION", + [3]byte{0, 38, 172}: "Shanghai LUSTER Teraband photonic Co., Ltd.", + [3]byte{0, 38, 173}: "Arada Systems, Inc.", + [3]byte{0, 38, 174}: "Wireless Measurement Ltd", + [3]byte{0, 38, 175}: "Duelco A/S", + [3]byte{0, 38, 176}: "Apple", + [3]byte{0, 38, 177}: "Navis Auto Motive Systems, Inc.", + [3]byte{0, 38, 178}: "Setrix GmbH", + [3]byte{0, 38, 179}: "Thales Communications Inc", + [3]byte{0, 38, 180}: "Ford Motor Company", + [3]byte{0, 38, 181}: "ICOMM Tele Ltd", + [3]byte{0, 38, 182}: "Askey Computer", + [3]byte{0, 38, 183}: "Kingston Technology Company, Inc.", + [3]byte{0, 38, 184}: "Actiontec Electronics, Inc", + [3]byte{0, 38, 185}: "Dell Inc", + [3]byte{0, 38, 186}: "ARRIS Group, Inc.", + [3]byte{0, 38, 187}: "Apple", + [3]byte{0, 38, 188}: "General Jack Technology Ltd.", + [3]byte{0, 38, 189}: "JTEC Card & Communication Co., Ltd.", + [3]byte{0, 38, 190}: "Schoonderbeek Elektronica Systemen B.V.", + [3]byte{0, 38, 191}: "ShenZhen Temobi Science&Tech Development Co.,Ltd", + [3]byte{0, 38, 192}: "EnergyHub", + [3]byte{0, 38, 193}: "ARTRAY CO., LTD.", + [3]byte{0, 38, 194}: "SCDI Co. LTD", + [3]byte{0, 38, 195}: "Insightek Corp.", + [3]byte{0, 38, 196}: "Cadmos microsystems S.r.l.", + [3]byte{0, 38, 197}: "Guangdong Gosun Telecommunications Co.,Ltd", + [3]byte{0, 38, 198}: "Intel Corporate", + [3]byte{0, 38, 199}: "Intel Corporate", + [3]byte{0, 38, 200}: "System Sensor", + [3]byte{0, 38, 201}: "Proventix Systems, Inc.", + [3]byte{0, 38, 202}: "CISCO SYSTEMS, INC.", + [3]byte{0, 38, 203}: "CISCO SYSTEMS, INC.", + [3]byte{0, 38, 204}: "Nokia Danmark A/S", + [3]byte{0, 38, 205}: "PurpleComm, Inc.", + [3]byte{0, 38, 206}: "Kozumi USA Corp.", + [3]byte{0, 38, 207}: "DEKA R&D", + [3]byte{0, 38, 208}: "Semihalf", + [3]byte{0, 38, 209}: "S Squared Innovations Inc.", + [3]byte{0, 38, 210}: "Pcube Systems, Inc.", + [3]byte{0, 38, 211}: "Zeno Information System", + [3]byte{0, 38, 212}: "IRCA SpA", + [3]byte{0, 38, 213}: "Ory Solucoes em Comercio de Informatica Ltda.", + [3]byte{0, 38, 214}: "Ningbo Andy Optoelectronic Co., Ltd.", + [3]byte{0, 38, 215}: "KM Electornic Technology Co., Ltd.", + [3]byte{0, 38, 216}: "Magic Point Inc.", + [3]byte{0, 38, 217}: "Pace plc", + [3]byte{0, 38, 218}: "Universal Media Corporation /Slovakia/ s.r.o.", + [3]byte{0, 38, 219}: "Ionics EMS Inc.", + [3]byte{0, 38, 220}: "Optical Systems Design", + [3]byte{0, 38, 221}: "Fival Science & Technology Co.,Ltd.", + [3]byte{0, 38, 222}: "FDI MATELEC", + [3]byte{0, 38, 223}: "TaiDoc Technology Corp.", + [3]byte{0, 38, 224}: "ASITEQ", + [3]byte{0, 38, 225}: "Stanford University, OpenFlow Group", + [3]byte{0, 38, 226}: "LG Electronics", + [3]byte{0, 38, 227}: "DTI", + [3]byte{0, 38, 228}: "CANAL OVERSEAS", + [3]byte{0, 38, 229}: "AEG Power Solutions", + [3]byte{0, 38, 230}: "Visionhitech Co., Ltd.", + [3]byte{0, 38, 231}: "Shanghai ONLAN Communication Tech. Co., Ltd.", + [3]byte{0, 38, 232}: "Murata Manufacturing Co., Ltd.", + [3]byte{0, 38, 233}: "SP Corp", + [3]byte{0, 38, 234}: "Cheerchip Electronic Technology (ShangHai) Co., Ltd.", + [3]byte{0, 38, 235}: "Advanced Spectrum Technology Co., Ltd.", + [3]byte{0, 38, 236}: "Legrand Home Systems, Inc", + [3]byte{0, 38, 237}: "zte corporation", + [3]byte{0, 38, 238}: "TKM GmbH", + [3]byte{0, 38, 239}: "Technology Advancement Group, Inc.", + [3]byte{0, 38, 240}: "cTrixs International GmbH.", + [3]byte{0, 38, 241}: "ProCurve Networking by HP", + [3]byte{0, 38, 242}: "Netgear", + [3]byte{0, 38, 243}: "SMC Networks", + [3]byte{0, 38, 244}: "Nesslab", + [3]byte{0, 38, 245}: "XRPLUS Inc.", + [3]byte{0, 38, 246}: "Military Communication Institute", + [3]byte{0, 38, 247}: "Infosys Technologies Ltd.", + [3]byte{0, 38, 248}: "Golden Highway Industry Development Co., Ltd.", + [3]byte{0, 38, 249}: "S.E.M. srl", + [3]byte{0, 38, 250}: "BandRich Inc.", + [3]byte{0, 38, 251}: "AirDio Wireless, Inc.", + [3]byte{0, 38, 252}: "AcSiP Technology Corp.", + [3]byte{0, 38, 253}: "Interactive Intelligence", + [3]byte{0, 38, 254}: "MKD Technology Inc.", + [3]byte{0, 38, 255}: "Research In Motion", + [3]byte{0, 39, 0}: "Shenzhen Siglent Technology Co., Ltd.", + [3]byte{0, 39, 1}: "INCOstartec GmbH", + [3]byte{0, 39, 2}: "SolarEdge Technologies", + [3]byte{0, 39, 3}: "Testech Electronics Pte Ltd", + [3]byte{0, 39, 4}: "Accelerated Concepts, Inc", + [3]byte{0, 39, 5}: "Sectronic", + [3]byte{0, 39, 6}: "YOISYS", + [3]byte{0, 39, 7}: "Lift Complex DS, JSC", + [3]byte{0, 39, 8}: "Nordiag ASA", + [3]byte{0, 39, 9}: "Nintendo Co., Ltd.", + [3]byte{0, 39, 10}: "IEE S.A.", + [3]byte{0, 39, 11}: "Adura Technologies", + [3]byte{0, 39, 12}: "CISCO SYSTEMS, INC.", + [3]byte{0, 39, 13}: "CISCO SYSTEMS, INC.", + [3]byte{0, 39, 14}: "Intel Corporate", + [3]byte{0, 39, 15}: "Envisionnovation Inc", + [3]byte{0, 39, 16}: "Intel Corporate", + [3]byte{0, 39, 17}: "LanPro Inc", + [3]byte{0, 39, 18}: "MaxVision LLC", + [3]byte{0, 39, 19}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{0, 39, 20}: "Grainmustards, Co,ltd.", + [3]byte{0, 39, 21}: "Rebound Telecom. Co., Ltd", + [3]byte{0, 39, 22}: "Adachi-Syokai Co., Ltd.", + [3]byte{0, 39, 23}: "CE Digital(Zhenjiang)Co.,Ltd", + [3]byte{0, 39, 24}: "Suzhou NEW SEAUNION Video Technology Co.,Ltd", + [3]byte{0, 39, 25}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{0, 39, 26}: "Geenovo Technology Ltd.", + [3]byte{0, 39, 27}: "Alec Sicherheitssysteme GmbH", + [3]byte{0, 39, 28}: "MERCURY CORPORATION", + [3]byte{0, 39, 29}: "Comba Telecom Systems (China) Ltd.", + [3]byte{0, 39, 30}: "Xagyl Communications", + [3]byte{0, 39, 31}: "MIPRO Electronics Co., Ltd", + [3]byte{0, 39, 32}: "NEW-SOL COM", + [3]byte{0, 39, 33}: "Shenzhen Baoan Fenda Industrial Co., Ltd", + [3]byte{0, 39, 34}: "Ubiquiti Networks", + [3]byte{0, 39, 248}: "Brocade Communications Systems, Inc.", + [3]byte{0, 42, 106}: "CISCO SYSTEMS, INC.", + [3]byte{0, 42, 175}: "LARsys-Automation GmbH", + [3]byte{0, 45, 118}: "TITECH GmbH", + [3]byte{0, 48, 0}: "ALLWELL TECHNOLOGY CORP.", + [3]byte{0, 48, 1}: "SMP", + [3]byte{0, 48, 2}: "Expand Networks", + [3]byte{0, 48, 3}: "Phasys Ltd.", + [3]byte{0, 48, 4}: "LEADTEK RESEARCH INC.", + [3]byte{0, 48, 5}: "Fujitsu Siemens Computers", + [3]byte{0, 48, 6}: "SUPERPOWER COMPUTER", + [3]byte{0, 48, 7}: "OPTI, INC.", + [3]byte{0, 48, 8}: "AVIO DIGITAL, INC.", + [3]byte{0, 48, 9}: "Tachion Networks, Inc.", + [3]byte{0, 48, 10}: "AZTECH Electronics Pte Ltd", + [3]byte{0, 48, 11}: "mPHASE Technologies, Inc.", + [3]byte{0, 48, 12}: "CONGRUENCY, LTD.", + [3]byte{0, 48, 13}: "MMC Technology, Inc.", + [3]byte{0, 48, 14}: "Klotz Digital AG", + [3]byte{0, 48, 15}: "IMT - Information Management T", + [3]byte{0, 48, 16}: "VISIONETICS INTERNATIONAL", + [3]byte{0, 48, 17}: "HMS Industrial Networks", + [3]byte{0, 48, 18}: "DIGITAL ENGINEERING LTD.", + [3]byte{0, 48, 19}: "NEC Corporation", + [3]byte{0, 48, 20}: "DIVIO, INC.", + [3]byte{0, 48, 21}: "CP CLARE CORP.", + [3]byte{0, 48, 22}: "ISHIDA CO., LTD.", + [3]byte{0, 48, 23}: "BlueArc UK Ltd", + [3]byte{0, 48, 24}: "Jetway Information Co., Ltd.", + [3]byte{0, 48, 25}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 26}: "SMARTBRIDGES PTE. LTD.", + [3]byte{0, 48, 27}: "SHUTTLE, INC.", + [3]byte{0, 48, 28}: "ALTVATER AIRDATA SYSTEMS", + [3]byte{0, 48, 29}: "SKYSTREAM, INC.", + [3]byte{0, 48, 30}: "3COM Europe Ltd.", + [3]byte{0, 48, 31}: "OPTICAL NETWORKS, INC.", + [3]byte{0, 48, 32}: "TSI, Inc..", + [3]byte{0, 48, 33}: "HSING TECH. ENTERPRISE CO.,LTD", + [3]byte{0, 48, 34}: "Fong Kai Industrial Co., Ltd.", + [3]byte{0, 48, 35}: "COGENT COMPUTER SYSTEMS, INC.", + [3]byte{0, 48, 36}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 37}: "CHECKOUT COMPUTER SYSTEMS, LTD", + [3]byte{0, 48, 38}: "HeiTel Digital Video GmbH", + [3]byte{0, 48, 39}: "KERBANGO, INC.", + [3]byte{0, 48, 40}: "FASE Saldatura srl", + [3]byte{0, 48, 41}: "OPICOM", + [3]byte{0, 48, 42}: "SOUTHERN INFORMATION", + [3]byte{0, 48, 43}: "INALP NETWORKS, INC.", + [3]byte{0, 48, 44}: "SYLANTRO SYSTEMS CORPORATION", + [3]byte{0, 48, 45}: "QUANTUM BRIDGE COMMUNICATIONS", + [3]byte{0, 48, 46}: "Hoft & Wessel AG", + [3]byte{0, 48, 47}: "GE Aviation System", + [3]byte{0, 48, 48}: "HARMONIX CORPORATION", + [3]byte{0, 48, 49}: "LIGHTWAVE COMMUNICATIONS, INC.", + [3]byte{0, 48, 50}: "MagicRam, Inc.", + [3]byte{0, 48, 51}: "ORIENT TELECOM CO., LTD.", + [3]byte{0, 48, 52}: "SET ENGINEERING", + [3]byte{0, 48, 53}: "Corning Incorporated", + [3]byte{0, 48, 54}: "RMP ELEKTRONIKSYSTEME GMBH", + [3]byte{0, 48, 55}: "Packard Bell Nec Services", + [3]byte{0, 48, 56}: "XCP, INC.", + [3]byte{0, 48, 57}: "SOFTBOOK PRESS", + [3]byte{0, 48, 58}: "MAATEL", + [3]byte{0, 48, 59}: "PowerCom Technology", + [3]byte{0, 48, 60}: "ONNTO CORP.", + [3]byte{0, 48, 61}: "IVA CORPORATION", + [3]byte{0, 48, 62}: "Radcom Ltd.", + [3]byte{0, 48, 63}: "TurboComm Tech Inc.", + [3]byte{0, 48, 64}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 65}: "SAEJIN T & M CO., LTD.", + [3]byte{0, 48, 66}: "DeTeWe-Deutsche Telephonwerke", + [3]byte{0, 48, 67}: "IDREAM TECHNOLOGIES, PTE. LTD.", + [3]byte{0, 48, 68}: "CradlePoint, Inc", + [3]byte{0, 48, 69}: "Village Networks, Inc. (VNI)", + [3]byte{0, 48, 70}: "Controlled Electronic Manageme", + [3]byte{0, 48, 71}: "NISSEI ELECTRIC CO., LTD.", + [3]byte{0, 48, 72}: "Supermicro Computer, Inc.", + [3]byte{0, 48, 73}: "BRYANT TECHNOLOGY, LTD.", + [3]byte{0, 48, 74}: "Fraunhofer IPMS", + [3]byte{0, 48, 75}: "ORBACOM SYSTEMS, INC.", + [3]byte{0, 48, 76}: "APPIAN COMMUNICATIONS, INC.", + [3]byte{0, 48, 77}: "ESI", + [3]byte{0, 48, 78}: "BUSTEC PRODUCTION LTD.", + [3]byte{0, 48, 79}: "PLANET Technology Corporation", + [3]byte{0, 48, 80}: "Versa Technology", + [3]byte{0, 48, 81}: "ORBIT AVIONIC & COMMUNICATION", + [3]byte{0, 48, 82}: "ELASTIC NETWORKS", + [3]byte{0, 48, 83}: "Basler AG", + [3]byte{0, 48, 84}: "CASTLENET TECHNOLOGY, INC.", + [3]byte{0, 48, 85}: "Renesas Technology America, Inc.", + [3]byte{0, 48, 86}: "Beck IPC GmbH", + [3]byte{0, 48, 87}: "QTelNet, Inc.", + [3]byte{0, 48, 88}: "API MOTION", + [3]byte{0, 48, 89}: "KONTRON COMPACT COMPUTERS AG", + [3]byte{0, 48, 90}: "TELGEN CORPORATION", + [3]byte{0, 48, 91}: "Toko Inc.", + [3]byte{0, 48, 92}: "SMAR Laboratories Corp.", + [3]byte{0, 48, 93}: "DIGITRA SYSTEMS, INC.", + [3]byte{0, 48, 94}: "Abelko Innovation", + [3]byte{0, 48, 95}: "Hasselblad", + [3]byte{0, 48, 96}: "Powerfile, Inc.", + [3]byte{0, 48, 97}: "MobyTEL", + [3]byte{0, 48, 98}: "IP Video Networks Inc", + [3]byte{0, 48, 99}: "SANTERA SYSTEMS, INC.", + [3]byte{0, 48, 100}: "ADLINK TECHNOLOGY, INC.", + [3]byte{0, 48, 101}: "Apple", + [3]byte{0, 48, 102}: "RFM", + [3]byte{0, 48, 103}: "BIOSTAR MICROTECH INT'L CORP.", + [3]byte{0, 48, 104}: "CYBERNETICS TECH. CO., LTD.", + [3]byte{0, 48, 105}: "IMPACCT TECHNOLOGY CORP.", + [3]byte{0, 48, 106}: "PENTA MEDIA CO., LTD.", + [3]byte{0, 48, 107}: "CMOS SYSTEMS, INC.", + [3]byte{0, 48, 108}: "Hitex Holding GmbH", + [3]byte{0, 48, 109}: "LUCENT TECHNOLOGIES", + [3]byte{0, 48, 110}: "HEWLETT PACKARD", + [3]byte{0, 48, 111}: "SEYEON TECH. CO., LTD.", + [3]byte{0, 48, 112}: "1Net Corporation", + [3]byte{0, 48, 113}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 114}: "Intellibyte Inc.", + [3]byte{0, 48, 115}: "International Microsystems, In", + [3]byte{0, 48, 116}: "EQUIINET LTD.", + [3]byte{0, 48, 117}: "ADTECH", + [3]byte{0, 48, 118}: "Akamba Corporation", + [3]byte{0, 48, 119}: "ONPREM NETWORKS", + [3]byte{0, 48, 120}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 121}: "CQOS, INC.", + [3]byte{0, 48, 122}: "Advanced Technology & Systems", + [3]byte{0, 48, 123}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 124}: "ADID SA", + [3]byte{0, 48, 125}: "GRE AMERICA, INC.", + [3]byte{0, 48, 126}: "Redflex Communication Systems", + [3]byte{0, 48, 127}: "IRLAN LTD.", + [3]byte{0, 48, 128}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 129}: "ALTOS C&C", + [3]byte{0, 48, 130}: "TAIHAN ELECTRIC WIRE CO., LTD.", + [3]byte{0, 48, 131}: "Ivron Systems", + [3]byte{0, 48, 132}: "ALLIED TELESYN INTERNAIONAL", + [3]byte{0, 48, 133}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 134}: "Transistor Devices, Inc.", + [3]byte{0, 48, 135}: "VEGA GRIESHABER KG", + [3]byte{0, 48, 136}: "Ericsson", + [3]byte{0, 48, 137}: "Spectrapoint Wireless, LLC", + [3]byte{0, 48, 138}: "NICOTRA SISTEMI S.P.A", + [3]byte{0, 48, 139}: "Brix Networks", + [3]byte{0, 48, 140}: "Quantum Corporation", + [3]byte{0, 48, 141}: "Pinnacle Systems, Inc.", + [3]byte{0, 48, 142}: "CROSS MATCH TECHNOLOGIES, INC.", + [3]byte{0, 48, 143}: "MICRILOR, Inc.", + [3]byte{0, 48, 144}: "CYRA TECHNOLOGIES, INC.", + [3]byte{0, 48, 145}: "TAIWAN FIRST LINE ELEC. CORP.", + [3]byte{0, 48, 146}: "ModuNORM GmbH", + [3]byte{0, 48, 147}: "Sonnet Technologies, Inc", + [3]byte{0, 48, 148}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 149}: "Procomp Informatics, Ltd.", + [3]byte{0, 48, 150}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 151}: "AB Regin", + [3]byte{0, 48, 152}: "Global Converging Technologies", + [3]byte{0, 48, 153}: "BOENIG UND KALLENBACH OHG", + [3]byte{0, 48, 154}: "ASTRO TERRA CORP.", + [3]byte{0, 48, 155}: "Smartware", + [3]byte{0, 48, 156}: "Timing Applications, Inc.", + [3]byte{0, 48, 157}: "Nimble Microsystems, Inc.", + [3]byte{0, 48, 158}: "WORKBIT CORPORATION.", + [3]byte{0, 48, 159}: "AMBER NETWORKS", + [3]byte{0, 48, 160}: "TYCO SUBMARINE SYSTEMS, LTD.", + [3]byte{0, 48, 161}: "WEBGATE Inc.", + [3]byte{0, 48, 162}: "Lightner Engineering", + [3]byte{0, 48, 163}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 164}: "Woodwind Communications System", + [3]byte{0, 48, 165}: "ACTIVE POWER", + [3]byte{0, 48, 166}: "VIANET TECHNOLOGIES, LTD.", + [3]byte{0, 48, 167}: "SCHWEITZER ENGINEERING", + [3]byte{0, 48, 168}: "OL'E COMMUNICATIONS, INC.", + [3]byte{0, 48, 169}: "Netiverse, Inc.", + [3]byte{0, 48, 170}: "AXUS MICROSYSTEMS, INC.", + [3]byte{0, 48, 171}: "DELTA NETWORKS, INC.", + [3]byte{0, 48, 172}: "Systeme Lauer GmbH & Co., Ltd.", + [3]byte{0, 48, 173}: "SHANGHAI COMMUNICATION", + [3]byte{0, 48, 174}: "Times N System, Inc.", + [3]byte{0, 48, 175}: "Honeywell GmbH", + [3]byte{0, 48, 176}: "Convergenet Technologies", + [3]byte{0, 48, 177}: "TrunkNet", + [3]byte{0, 48, 178}: "L-3 Sonoma EO", + [3]byte{0, 48, 179}: "San Valley Systems, Inc.", + [3]byte{0, 48, 180}: "INTERSIL CORP.", + [3]byte{0, 48, 181}: "Tadiran Microwave Networks", + [3]byte{0, 48, 182}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 183}: "Teletrol Systems, Inc.", + [3]byte{0, 48, 184}: "RiverDelta Networks", + [3]byte{0, 48, 185}: "ECTEL", + [3]byte{0, 48, 186}: "AC&T SYSTEM CO., LTD.", + [3]byte{0, 48, 187}: "CacheFlow, Inc.", + [3]byte{0, 48, 188}: "Optronic AG", + [3]byte{0, 48, 189}: "BELKIN COMPONENTS", + [3]byte{0, 48, 190}: "City-Net Technology, Inc.", + [3]byte{0, 48, 191}: "MULTIDATA GMBH", + [3]byte{0, 48, 192}: "Lara Technology, Inc.", + [3]byte{0, 48, 193}: "HEWLETT-PACKARD", + [3]byte{0, 48, 194}: "COMONE", + [3]byte{0, 48, 195}: "FLUECKIGER ELEKTRONIK AG", + [3]byte{0, 48, 196}: "Canon Imaging Systems Inc.", + [3]byte{0, 48, 197}: "CADENCE DESIGN SYSTEMS", + [3]byte{0, 48, 198}: "CONTROL SOLUTIONS, INC.", + [3]byte{0, 48, 199}: "Macromate Corp.", + [3]byte{0, 48, 200}: "GAD LINE, LTD.", + [3]byte{0, 48, 201}: "LuxN, N", + [3]byte{0, 48, 202}: "Discovery Com", + [3]byte{0, 48, 203}: "OMNI FLOW COMPUTERS, INC.", + [3]byte{0, 48, 204}: "Tenor Networks, Inc.", + [3]byte{0, 48, 205}: "CONEXANT SYSTEMS, INC.", + [3]byte{0, 48, 206}: "Zaffire", + [3]byte{0, 48, 207}: "TWO TECHNOLOGIES, INC.", + [3]byte{0, 48, 208}: "Tellabs", + [3]byte{0, 48, 209}: "INOVA CORPORATION", + [3]byte{0, 48, 210}: "WIN TECHNOLOGIES, CO., LTD.", + [3]byte{0, 48, 211}: "Agilent Technologies", + [3]byte{0, 48, 212}: "AAE Systems, Inc.", + [3]byte{0, 48, 213}: "DResearch GmbH", + [3]byte{0, 48, 214}: "MSC VERTRIEBS GMBH", + [3]byte{0, 48, 215}: "Innovative Systems, L.L.C.", + [3]byte{0, 48, 216}: "SITEK", + [3]byte{0, 48, 217}: "DATACORE SOFTWARE CORP.", + [3]byte{0, 48, 218}: "COMTREND CO.", + [3]byte{0, 48, 219}: "Mindready Solutions, Inc.", + [3]byte{0, 48, 220}: "RIGHTECH CORPORATION", + [3]byte{0, 48, 221}: "INDIGITA CORPORATION", + [3]byte{0, 48, 222}: "WAGO Kontakttechnik GmbH", + [3]byte{0, 48, 223}: "KB/TEL TELECOMUNICACIONES", + [3]byte{0, 48, 224}: "OXFORD SEMICONDUCTOR LTD.", + [3]byte{0, 48, 225}: "Network Equipment Technologies, Inc.", + [3]byte{0, 48, 226}: "GARNET SYSTEMS CO., LTD.", + [3]byte{0, 48, 227}: "SEDONA NETWORKS CORP.", + [3]byte{0, 48, 228}: "CHIYODA SYSTEM RIKEN", + [3]byte{0, 48, 229}: "Amper Datos S.A.", + [3]byte{0, 48, 230}: "Draeger Medical Systems, Inc.", + [3]byte{0, 48, 231}: "CNF MOBILE SOLUTIONS, INC.", + [3]byte{0, 48, 232}: "ENSIM CORP.", + [3]byte{0, 48, 233}: "GMA COMMUNICATION MANUFACT'G", + [3]byte{0, 48, 234}: "TeraForce Technology Corporation", + [3]byte{0, 48, 235}: "TURBONET COMMUNICATIONS, INC.", + [3]byte{0, 48, 236}: "BORGARDT", + [3]byte{0, 48, 237}: "Expert Magnetics Corp.", + [3]byte{0, 48, 238}: "DSG Technology, Inc.", + [3]byte{0, 48, 239}: "NEON TECHNOLOGY, INC.", + [3]byte{0, 48, 240}: "Uniform Industrial Corp.", + [3]byte{0, 48, 241}: "Accton Technology Corp.", + [3]byte{0, 48, 242}: "CISCO SYSTEMS, INC.", + [3]byte{0, 48, 243}: "At Work Computers", + [3]byte{0, 48, 244}: "STARDOT TECHNOLOGIES", + [3]byte{0, 48, 245}: "Wild Lab. Ltd.", + [3]byte{0, 48, 246}: "SECURELOGIX CORPORATION", + [3]byte{0, 48, 247}: "RAMIX INC.", + [3]byte{0, 48, 248}: "Dynapro Systems, Inc.", + [3]byte{0, 48, 249}: "Sollae Systems Co., Ltd.", + [3]byte{0, 48, 250}: "TELICA, INC.", + [3]byte{0, 48, 251}: "AZS Technology AG", + [3]byte{0, 48, 252}: "Terawave Communications, Inc.", + [3]byte{0, 48, 253}: "INTEGRATED SYSTEMS DESIGN", + [3]byte{0, 48, 254}: "DSA GmbH", + [3]byte{0, 48, 255}: "DATAFAB SYSTEMS, INC.", + [3]byte{0, 51, 108}: "SynapSense Corporation", + [3]byte{0, 52, 241}: "Radicom Research, Inc.", + [3]byte{0, 53, 50}: "Electro-Metrics Corporation", + [3]byte{0, 53, 96}: "Rosen Aviation", + [3]byte{0, 54, 248}: "Conti Temic microelectronic GmbH", + [3]byte{0, 54, 254}: "SuperVision", + [3]byte{0, 55, 109}: "Murata Manufacturing Co., Ltd.", + [3]byte{0, 58, 152}: "CISCO SYSTEMS, INC.", + [3]byte{0, 58, 153}: "CISCO SYSTEMS, INC.", + [3]byte{0, 58, 154}: "CISCO SYSTEMS, INC.", + [3]byte{0, 58, 155}: "CISCO SYSTEMS, INC.", + [3]byte{0, 58, 156}: "CISCO SYSTEMS, INC.", + [3]byte{0, 58, 157}: "NEC Platforms, Ltd.", + [3]byte{0, 58, 175}: "BlueBit Ltd.", + [3]byte{0, 60, 197}: "WONWOO Engineering Co., Ltd", + [3]byte{0, 61, 65}: "Hatteland Computer AS", + [3]byte{0, 62, 225}: "Apple", + [3]byte{0, 64, 0}: "PCI COMPONENTES DA AMZONIA LTD", + [3]byte{0, 64, 1}: "Zero One Technology Co. Ltd.", + [3]byte{0, 64, 2}: "PERLE SYSTEMS LIMITED", + [3]byte{0, 64, 3}: "Emerson Process Management Power & Water Solutions, Inc.", + [3]byte{0, 64, 4}: "ICM CO. LTD.", + [3]byte{0, 64, 5}: "ANI COMMUNICATIONS INC.", + [3]byte{0, 64, 6}: "SAMPO TECHNOLOGY CORPORATION", + [3]byte{0, 64, 7}: "TELMAT INFORMATIQUE", + [3]byte{0, 64, 8}: "A PLUS INFO CORPORATION", + [3]byte{0, 64, 9}: "TACHIBANA TECTRON CO., LTD.", + [3]byte{0, 64, 10}: "PIVOTAL TECHNOLOGIES, INC.", + [3]byte{0, 64, 11}: "CISCO SYSTEMS, INC.", + [3]byte{0, 64, 12}: "GENERAL MICRO SYSTEMS, INC.", + [3]byte{0, 64, 13}: "LANNET DATA COMMUNICATIONS,LTD", + [3]byte{0, 64, 14}: "MEMOTEC, INC.", + [3]byte{0, 64, 15}: "DATACOM TECHNOLOGIES", + [3]byte{0, 64, 16}: "SONIC SYSTEMS, INC.", + [3]byte{0, 64, 17}: "ANDOVER CONTROLS CORPORATION", + [3]byte{0, 64, 18}: "WINDATA, INC.", + [3]byte{0, 64, 19}: "NTT DATA COMM. SYSTEMS CORP.", + [3]byte{0, 64, 20}: "COMSOFT GMBH", + [3]byte{0, 64, 21}: "ASCOM INFRASYS AG", + [3]byte{0, 64, 22}: "ADC - Global Connectivity Solutions Division", + [3]byte{0, 64, 23}: "Silex Technology America", + [3]byte{0, 64, 24}: "ADOBE SYSTEMS, INC.", + [3]byte{0, 64, 25}: "AEON SYSTEMS, INC.", + [3]byte{0, 64, 26}: "FUJI ELECTRIC CO., LTD.", + [3]byte{0, 64, 27}: "PRINTER SYSTEMS CORP.", + [3]byte{0, 64, 28}: "AST RESEARCH, INC.", + [3]byte{0, 64, 29}: "INVISIBLE SOFTWARE, INC.", + [3]byte{0, 64, 30}: "ICC", + [3]byte{0, 64, 31}: "COLORGRAPH LTD", + [3]byte{0, 64, 32}: "TE Connectivity Ltd.", + [3]byte{0, 64, 33}: "RASTER GRAPHICS", + [3]byte{0, 64, 34}: "KLEVER COMPUTERS, INC.", + [3]byte{0, 64, 35}: "LOGIC CORPORATION", + [3]byte{0, 64, 36}: "COMPAC INC.", + [3]byte{0, 64, 37}: "MOLECULAR DYNAMICS", + [3]byte{0, 64, 38}: "Buffalo Inc.", + [3]byte{0, 64, 39}: "SMC MASSACHUSETTS, INC.", + [3]byte{0, 64, 40}: "NETCOMM LIMITED", + [3]byte{0, 64, 41}: "COMPEX", + [3]byte{0, 64, 42}: "CANOGA-PERKINS", + [3]byte{0, 64, 43}: "TRIGEM COMPUTER, INC.", + [3]byte{0, 64, 44}: "ISIS DISTRIBUTED SYSTEMS, INC.", + [3]byte{0, 64, 45}: "HARRIS ADACOM CORPORATION", + [3]byte{0, 64, 46}: "PRECISION SOFTWARE, INC.", + [3]byte{0, 64, 47}: "XLNT DESIGNS INC.", + [3]byte{0, 64, 48}: "GK COMPUTER", + [3]byte{0, 64, 49}: "KOKUSAI ELECTRIC CO., LTD", + [3]byte{0, 64, 50}: "DIGITAL COMMUNICATIONS", + [3]byte{0, 64, 51}: "ADDTRON TECHNOLOGY CO., LTD.", + [3]byte{0, 64, 52}: "BUSTEK CORPORATION", + [3]byte{0, 64, 53}: "OPCOM", + [3]byte{0, 64, 54}: "TRIBE COMPUTER WORKS, INC.", + [3]byte{0, 64, 55}: "SEA-ILAN, INC.", + [3]byte{0, 64, 56}: "TALENT ELECTRIC INCORPORATED", + [3]byte{0, 64, 57}: "OPTEC DAIICHI DENKO CO., LTD.", + [3]byte{0, 64, 58}: "IMPACT TECHNOLOGIES", + [3]byte{0, 64, 59}: "SYNERJET INTERNATIONAL CORP.", + [3]byte{0, 64, 60}: "FORKS, INC.", + [3]byte{0, 64, 61}: "Teradata Corporation", + [3]byte{0, 64, 62}: "RASTER OPS CORPORATION", + [3]byte{0, 64, 63}: "SSANGYONG COMPUTER SYSTEMS", + [3]byte{0, 64, 64}: "RING ACCESS, INC.", + [3]byte{0, 64, 65}: "FUJIKURA LTD.", + [3]byte{0, 64, 66}: "N.A.T. GMBH", + [3]byte{0, 64, 67}: "Nokia Siemens Networks GmbH & Co. KG.", + [3]byte{0, 64, 68}: "QNIX COMPUTER CO., LTD.", + [3]byte{0, 64, 69}: "TWINHEAD CORPORATION", + [3]byte{0, 64, 70}: "UDC RESEARCH LIMITED", + [3]byte{0, 64, 71}: "WIND RIVER SYSTEMS", + [3]byte{0, 64, 72}: "SMD INFORMATICA S.A.", + [3]byte{0, 64, 73}: "Roche Diagnostics International Ltd.", + [3]byte{0, 64, 74}: "WEST AUSTRALIAN DEPARTMENT", + [3]byte{0, 64, 75}: "MAPLE COMPUTER SYSTEMS", + [3]byte{0, 64, 76}: "HYPERTEC PTY LTD.", + [3]byte{0, 64, 77}: "TELECOMMUNICATIONS TECHNIQUES", + [3]byte{0, 64, 78}: "FLUENT, INC.", + [3]byte{0, 64, 79}: "SPACE & NAVAL WARFARE SYSTEMS", + [3]byte{0, 64, 80}: "IRONICS, INCORPORATED", + [3]byte{0, 64, 81}: "GRACILIS, INC.", + [3]byte{0, 64, 82}: "STAR TECHNOLOGIES, INC.", + [3]byte{0, 64, 83}: "AMPRO COMPUTERS", + [3]byte{0, 64, 84}: "CONNECTION MACHINES SERVICES", + [3]byte{0, 64, 85}: "METRONIX GMBH", + [3]byte{0, 64, 86}: "MCM JAPAN LTD.", + [3]byte{0, 64, 87}: "LOCKHEED - SANDERS", + [3]byte{0, 64, 88}: "KRONOS, INC.", + [3]byte{0, 64, 89}: "YOSHIDA KOGYO K. K.", + [3]byte{0, 64, 90}: "GOLDSTAR INFORMATION & COMM.", + [3]byte{0, 64, 91}: "FUNASSET LIMITED", + [3]byte{0, 64, 92}: "FUTURE SYSTEMS, INC.", + [3]byte{0, 64, 93}: "STAR-TEK, INC.", + [3]byte{0, 64, 94}: "NORTH HILLS ISRAEL", + [3]byte{0, 64, 95}: "AFE COMPUTERS LTD.", + [3]byte{0, 64, 96}: "COMENDEC LTD", + [3]byte{0, 64, 97}: "DATATECH ENTERPRISES CO., LTD.", + [3]byte{0, 64, 98}: "E-SYSTEMS, INC./GARLAND DIV.", + [3]byte{0, 64, 99}: "VIA TECHNOLOGIES, INC.", + [3]byte{0, 64, 100}: "KLA INSTRUMENTS CORPORATION", + [3]byte{0, 64, 101}: "GTE SPACENET", + [3]byte{0, 64, 102}: "Hitachi Metals, Ltd.", + [3]byte{0, 64, 103}: "OMNIBYTE CORPORATION", + [3]byte{0, 64, 104}: "EXTENDED SYSTEMS", + [3]byte{0, 64, 105}: "LEMCOM SYSTEMS, INC.", + [3]byte{0, 64, 106}: "KENTEK INFORMATION SYSTEMS,INC", + [3]byte{0, 64, 107}: "SYSGEN", + [3]byte{0, 64, 108}: "COPERNIQUE", + [3]byte{0, 64, 109}: "LANCO, INC.", + [3]byte{0, 64, 110}: "COROLLARY, INC.", + [3]byte{0, 64, 111}: "SYNC RESEARCH INC.", + [3]byte{0, 64, 112}: "INTERWARE CO., LTD.", + [3]byte{0, 64, 113}: "ATM COMPUTER GMBH", + [3]byte{0, 64, 114}: "Applied Innovation Inc.", + [3]byte{0, 64, 115}: "BASS ASSOCIATES", + [3]byte{0, 64, 116}: "CABLE AND WIRELESS", + [3]byte{0, 64, 117}: "Tattile SRL", + [3]byte{0, 64, 118}: "Sun Conversion Technologies", + [3]byte{0, 64, 119}: "MAXTON TECHNOLOGY CORPORATION", + [3]byte{0, 64, 120}: "WEARNES AUTOMATION PTE LTD", + [3]byte{0, 64, 121}: "JUKO MANUFACTURE COMPANY, LTD.", + [3]byte{0, 64, 122}: "SOCIETE D'EXPLOITATION DU CNIT", + [3]byte{0, 64, 123}: "SCIENTIFIC ATLANTA", + [3]byte{0, 64, 124}: "QUME CORPORATION", + [3]byte{0, 64, 125}: "EXTENSION TECHNOLOGY CORP.", + [3]byte{0, 64, 126}: "EVERGREEN SYSTEMS, INC.", + [3]byte{0, 64, 127}: "FLIR Systems", + [3]byte{0, 64, 128}: "ATHENIX CORPORATION", + [3]byte{0, 64, 129}: "MANNESMANN SCANGRAPHIC GMBH", + [3]byte{0, 64, 130}: "LABORATORY EQUIPMENT CORP.", + [3]byte{0, 64, 131}: "TDA INDUSTRIA DE PRODUTOS", + [3]byte{0, 64, 132}: "HONEYWELL ACS", + [3]byte{0, 64, 133}: "SAAB INSTRUMENTS AB", + [3]byte{0, 64, 134}: "MICHELS & KLEBERHOFF COMPUTER", + [3]byte{0, 64, 135}: "UBITREX CORPORATION", + [3]byte{0, 64, 136}: "MOBIUS TECHNOLOGIES, INC.", + [3]byte{0, 64, 137}: "MEIDENSHA CORPORATION", + [3]byte{0, 64, 138}: "TPS TELEPROCESSING SYS. GMBH", + [3]byte{0, 64, 139}: "RAYLAN CORPORATION", + [3]byte{0, 64, 140}: "AXIS COMMUNICATIONS AB", + [3]byte{0, 64, 141}: "THE GOODYEAR TIRE & RUBBER CO.", + [3]byte{0, 64, 142}: "Tattile SRL", + [3]byte{0, 64, 143}: "WM-DATA MINFO AB", + [3]byte{0, 64, 144}: "ANSEL COMMUNICATIONS", + [3]byte{0, 64, 145}: "PROCOMP INDUSTRIA ELETRONICA", + [3]byte{0, 64, 146}: "ASP COMPUTER PRODUCTS, INC.", + [3]byte{0, 64, 147}: "PAXDATA NETWORKS LTD.", + [3]byte{0, 64, 148}: "SHOGRAPHICS, INC.", + [3]byte{0, 64, 149}: "R.P.T. INTERGROUPS INT'L LTD.", + [3]byte{0, 64, 150}: "Cisco Systems", + [3]byte{0, 64, 151}: "DATEX DIVISION OF", + [3]byte{0, 64, 152}: "DRESSLER GMBH & CO.", + [3]byte{0, 64, 153}: "NEWGEN SYSTEMS CORP.", + [3]byte{0, 64, 154}: "NETWORK EXPRESS, INC.", + [3]byte{0, 64, 155}: "HAL COMPUTER SYSTEMS INC.", + [3]byte{0, 64, 156}: "TRANSWARE", + [3]byte{0, 64, 157}: "DIGIBOARD, INC.", + [3]byte{0, 64, 158}: "CONCURRENT TECHNOLOGIES LTD.", + [3]byte{0, 64, 159}: "Telco Systems, Inc.", + [3]byte{0, 64, 160}: "GOLDSTAR CO., LTD.", + [3]byte{0, 64, 161}: "ERGO COMPUTING", + [3]byte{0, 64, 162}: "KINGSTAR TECHNOLOGY INC.", + [3]byte{0, 64, 163}: "MICROUNITY SYSTEMS ENGINEERING", + [3]byte{0, 64, 164}: "ROSE ELECTRONICS", + [3]byte{0, 64, 165}: "CLINICOMP INTL.", + [3]byte{0, 64, 166}: "Cray, Inc.", + [3]byte{0, 64, 167}: "ITAUTEC PHILCO S.A.", + [3]byte{0, 64, 168}: "IMF INTERNATIONAL LTD.", + [3]byte{0, 64, 169}: "DATACOM INC.", + [3]byte{0, 64, 170}: "Metso Automation", + [3]byte{0, 64, 171}: "ROLAND DG CORPORATION", + [3]byte{0, 64, 172}: "SUPER WORKSTATION, INC.", + [3]byte{0, 64, 173}: "SMA REGELSYSTEME GMBH", + [3]byte{0, 64, 174}: "DELTA CONTROLS, INC.", + [3]byte{0, 64, 175}: "DIGITAL PRODUCTS, INC.", + [3]byte{0, 64, 176}: "BYTEX CORPORATION, ENGINEERING", + [3]byte{0, 64, 177}: "CODONICS INC.", + [3]byte{0, 64, 178}: "SYSTEMFORSCHUNG", + [3]byte{0, 64, 179}: "ParTech Inc.", + [3]byte{0, 64, 180}: "NEXTCOM K.K.", + [3]byte{0, 64, 181}: "VIDEO TECHNOLOGY COMPUTERS LTD", + [3]byte{0, 64, 182}: "COMPUTERM CORPORATION", + [3]byte{0, 64, 183}: "STEALTH COMPUTER SYSTEMS", + [3]byte{0, 64, 184}: "IDEA ASSOCIATES", + [3]byte{0, 64, 185}: "MACQ ELECTRONIQUE SA", + [3]byte{0, 64, 186}: "ALLIANT COMPUTER SYSTEMS CORP.", + [3]byte{0, 64, 187}: "GOLDSTAR CABLE CO., LTD.", + [3]byte{0, 64, 188}: "ALGORITHMICS LTD.", + [3]byte{0, 64, 189}: "STARLIGHT NETWORKS, INC.", + [3]byte{0, 64, 190}: "BOEING DEFENSE & SPACE", + [3]byte{0, 64, 191}: "CHANNEL SYSTEMS INTERN'L INC.", + [3]byte{0, 64, 192}: "VISTA CONTROLS CORPORATION", + [3]byte{0, 64, 193}: "BIZERBA-WERKE WILHEIM KRAUT", + [3]byte{0, 64, 194}: "APPLIED COMPUTING DEVICES", + [3]byte{0, 64, 195}: "FISCHER AND PORTER CO.", + [3]byte{0, 64, 196}: "KINKEI SYSTEM CORPORATION", + [3]byte{0, 64, 197}: "MICOM COMMUNICATIONS INC.", + [3]byte{0, 64, 198}: "FIBERNET RESEARCH, INC.", + [3]byte{0, 64, 199}: "RUBY TECH CORPORATION", + [3]byte{0, 64, 200}: "MILAN TECHNOLOGY CORPORATION", + [3]byte{0, 64, 201}: "NCUBE", + [3]byte{0, 64, 202}: "FIRST INTERNAT'L COMPUTER, INC", + [3]byte{0, 64, 203}: "LANWAN TECHNOLOGIES", + [3]byte{0, 64, 204}: "SILCOM MANUF'G TECHNOLOGY INC.", + [3]byte{0, 64, 205}: "TERA MICROSYSTEMS, INC.", + [3]byte{0, 64, 206}: "NET-SOURCE, INC.", + [3]byte{0, 64, 207}: "STRAWBERRY TREE, INC.", + [3]byte{0, 64, 208}: "MITAC INTERNATIONAL CORP.", + [3]byte{0, 64, 209}: "FUKUDA DENSHI CO., LTD.", + [3]byte{0, 64, 210}: "PAGINE CORPORATION", + [3]byte{0, 64, 211}: "KIMPSION INTERNATIONAL CORP.", + [3]byte{0, 64, 212}: "GAGE TALKER CORP.", + [3]byte{0, 64, 213}: "Sartorius Mechatronics T&H GmbH", + [3]byte{0, 64, 214}: "LOCAMATION B.V.", + [3]byte{0, 64, 215}: "STUDIO GEN INC.", + [3]byte{0, 64, 216}: "OCEAN OFFICE AUTOMATION LTD.", + [3]byte{0, 64, 217}: "AMERICAN MEGATRENDS INC.", + [3]byte{0, 64, 218}: "TELSPEC LTD", + [3]byte{0, 64, 219}: "ADVANCED TECHNICAL SOLUTIONS", + [3]byte{0, 64, 220}: "TRITEC ELECTRONIC GMBH", + [3]byte{0, 64, 221}: "HONG TECHNOLOGIES", + [3]byte{0, 64, 222}: "Elsag Datamat spa", + [3]byte{0, 64, 223}: "DIGALOG SYSTEMS, INC.", + [3]byte{0, 64, 224}: "ATOMWIDE LTD.", + [3]byte{0, 64, 225}: "MARNER INTERNATIONAL, INC.", + [3]byte{0, 64, 226}: "MESA RIDGE TECHNOLOGIES, INC.", + [3]byte{0, 64, 227}: "QUIN SYSTEMS LTD", + [3]byte{0, 64, 228}: "E-M TECHNOLOGY, INC.", + [3]byte{0, 64, 229}: "SYBUS CORPORATION", + [3]byte{0, 64, 230}: "C.A.E.N.", + [3]byte{0, 64, 231}: "ARNOS INSTRUMENTS & COMPUTER", + [3]byte{0, 64, 232}: "CHARLES RIVER DATA SYSTEMS,INC", + [3]byte{0, 64, 233}: "ACCORD SYSTEMS, INC.", + [3]byte{0, 64, 234}: "PLAIN TREE SYSTEMS INC", + [3]byte{0, 64, 235}: "MARTIN MARIETTA CORPORATION", + [3]byte{0, 64, 236}: "MIKASA SYSTEM ENGINEERING", + [3]byte{0, 64, 237}: "NETWORK CONTROLS INT'NATL INC.", + [3]byte{0, 64, 238}: "OPTIMEM", + [3]byte{0, 64, 239}: "HYPERCOM, INC.", + [3]byte{0, 64, 240}: "MicroBrain,Inc.", + [3]byte{0, 64, 241}: "CHUO ELECTRONICS CO., LTD.", + [3]byte{0, 64, 242}: "JANICH & KLASS COMPUTERTECHNIK", + [3]byte{0, 64, 243}: "NETCOR", + [3]byte{0, 64, 244}: "CAMEO COMMUNICATIONS, INC.", + [3]byte{0, 64, 245}: "OEM ENGINES", + [3]byte{0, 64, 246}: "KATRON COMPUTERS INC.", + [3]byte{0, 64, 247}: "Polaroid Corporation", + [3]byte{0, 64, 248}: "SYSTEMHAUS DISCOM", + [3]byte{0, 64, 249}: "COMBINET", + [3]byte{0, 64, 250}: "MICROBOARDS, INC.", + [3]byte{0, 64, 251}: "CASCADE COMMUNICATIONS CORP.", + [3]byte{0, 64, 252}: "IBR COMPUTER TECHNIK GMBH", + [3]byte{0, 64, 253}: "LXE", + [3]byte{0, 64, 254}: "SYMPLEX COMMUNICATIONS", + [3]byte{0, 64, 255}: "TELEBIT CORPORATION", + [3]byte{0, 65, 180}: "Wuxi Zhongxing Optoelectronics Technology Co.,Ltd.", + [3]byte{0, 66, 82}: "RLX Technologies", + [3]byte{0, 67, 255}: "KETRON S.R.L.", + [3]byte{0, 69, 1}: "Versus Technology, Inc.", + [3]byte{0, 70, 75}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{0, 77, 50}: "Andon Health Co.,Ltd.", + [3]byte{0, 80, 0}: "NEXO COMMUNICATIONS, INC.", + [3]byte{0, 80, 1}: "YAMASHITA SYSTEMS CORP.", + [3]byte{0, 80, 2}: "OMNISEC AG", + [3]byte{0, 80, 3}: "Xrite Inc", + [3]byte{0, 80, 4}: "3COM CORPORATION", + [3]byte{0, 80, 6}: "TAC AB", + [3]byte{0, 80, 7}: "SIEMENS TELECOMMUNICATION SYSTEMS LIMITED", + [3]byte{0, 80, 8}: "TIVA MICROCOMPUTER CORP. (TMC)", + [3]byte{0, 80, 9}: "PHILIPS BROADBAND NETWORKS", + [3]byte{0, 80, 10}: "IRIS TECHNOLOGIES, INC.", + [3]byte{0, 80, 11}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 12}: "e-Tek Labs, Inc.", + [3]byte{0, 80, 13}: "SATORI ELECTORIC CO., LTD.", + [3]byte{0, 80, 14}: "CHROMATIS NETWORKS, INC.", + [3]byte{0, 80, 15}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 16}: "NovaNET Learning, Inc.", + [3]byte{0, 80, 18}: "CBL - GMBH", + [3]byte{0, 80, 19}: "Chaparral Network Storage", + [3]byte{0, 80, 20}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 21}: "BRIGHT STAR ENGINEERING", + [3]byte{0, 80, 22}: "SST/WOODHEAD INDUSTRIES", + [3]byte{0, 80, 23}: "RSR S.R.L.", + [3]byte{0, 80, 24}: "AMIT, Inc.", + [3]byte{0, 80, 25}: "SPRING TIDE NETWORKS, INC.", + [3]byte{0, 80, 26}: "IQinVision", + [3]byte{0, 80, 27}: "ABL CANADA, INC.", + [3]byte{0, 80, 28}: "JATOM SYSTEMS, INC.", + [3]byte{0, 80, 30}: "Miranda Technologies, Inc.", + [3]byte{0, 80, 31}: "MRG SYSTEMS, LTD.", + [3]byte{0, 80, 32}: "MEDIASTAR CO., LTD.", + [3]byte{0, 80, 33}: "EIS INTERNATIONAL, INC.", + [3]byte{0, 80, 34}: "ZONET TECHNOLOGY, INC.", + [3]byte{0, 80, 35}: "PG DESIGN ELECTRONICS, INC.", + [3]byte{0, 80, 36}: "NAVIC SYSTEMS, INC.", + [3]byte{0, 80, 38}: "COSYSTEMS, INC.", + [3]byte{0, 80, 39}: "GENICOM CORPORATION", + [3]byte{0, 80, 40}: "AVAL COMMUNICATIONS", + [3]byte{0, 80, 41}: "1394 PRINTER WORKING GROUP", + [3]byte{0, 80, 42}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 43}: "GENRAD LTD.", + [3]byte{0, 80, 44}: "SOYO COMPUTER, INC.", + [3]byte{0, 80, 45}: "ACCEL, INC.", + [3]byte{0, 80, 46}: "CAMBEX CORPORATION", + [3]byte{0, 80, 47}: "TollBridge Technologies, Inc.", + [3]byte{0, 80, 48}: "FUTURE PLUS SYSTEMS", + [3]byte{0, 80, 49}: "AEROFLEX LABORATORIES, INC.", + [3]byte{0, 80, 50}: "PICAZO COMMUNICATIONS, INC.", + [3]byte{0, 80, 51}: "MAYAN NETWORKS", + [3]byte{0, 80, 54}: "NETCAM, LTD.", + [3]byte{0, 80, 55}: "KOGA ELECTRONICS CO.", + [3]byte{0, 80, 56}: "DAIN TELECOM CO., LTD.", + [3]byte{0, 80, 57}: "MARINER NETWORKS", + [3]byte{0, 80, 58}: "DATONG ELECTRONICS LTD.", + [3]byte{0, 80, 59}: "MEDIAFIRE CORPORATION", + [3]byte{0, 80, 60}: "TSINGHUA NOVEL ELECTRONICS", + [3]byte{0, 80, 62}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 63}: "ANCHOR GAMES", + [3]byte{0, 80, 64}: "Panasonic Electric Works Co., Ltd.", + [3]byte{0, 80, 65}: "Coretronic Corporation", + [3]byte{0, 80, 66}: "SCI MANUFACTURING SINGAPORE PTE, LTD.", + [3]byte{0, 80, 67}: "MARVELL SEMICONDUCTOR, INC.", + [3]byte{0, 80, 68}: "ASACA CORPORATION", + [3]byte{0, 80, 69}: "RIOWORKS SOLUTIONS, INC.", + [3]byte{0, 80, 70}: "MENICX INTERNATIONAL CO., LTD.", + [3]byte{0, 80, 71}: "PRIVATE", + [3]byte{0, 80, 72}: "INFOLIBRIA", + [3]byte{0, 80, 73}: "Arbor Networks Inc", + [3]byte{0, 80, 74}: "ELTECO A.S.", + [3]byte{0, 80, 75}: "BARCONET N.V.", + [3]byte{0, 80, 76}: "Galil Motion Control", + [3]byte{0, 80, 77}: "Tokyo Electron Device Limited", + [3]byte{0, 80, 78}: "SIERRA MONITOR CORP.", + [3]byte{0, 80, 79}: "OLENCOM ELECTRONICS", + [3]byte{0, 80, 80}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 81}: "IWATSU ELECTRIC CO., LTD.", + [3]byte{0, 80, 82}: "TIARA NETWORKS, INC.", + [3]byte{0, 80, 83}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 84}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 85}: "DOMS A/S", + [3]byte{0, 80, 86}: "VMware, Inc.", + [3]byte{0, 80, 87}: "BROADBAND ACCESS SYSTEMS", + [3]byte{0, 80, 88}: "VegaStream Group Limted", + [3]byte{0, 80, 89}: "iBAHN", + [3]byte{0, 80, 90}: "NETWORK ALCHEMY, INC.", + [3]byte{0, 80, 91}: "KAWASAKI LSI U.S.A., INC.", + [3]byte{0, 80, 92}: "TUNDO CORPORATION", + [3]byte{0, 80, 94}: "DIGITEK MICROLOGIC S.A.", + [3]byte{0, 80, 95}: "BRAND INNOVATORS", + [3]byte{0, 80, 96}: "TANDBERG TELECOM AS", + [3]byte{0, 80, 98}: "KOUWELL ELECTRONICS CORP. **", + [3]byte{0, 80, 99}: "OY COMSEL SYSTEM AB", + [3]byte{0, 80, 100}: "CAE ELECTRONICS", + [3]byte{0, 80, 101}: "TDK-Lambda Corporation", + [3]byte{0, 80, 102}: "AtecoM GmbH advanced telecomunication modules", + [3]byte{0, 80, 103}: "AEROCOMM, INC.", + [3]byte{0, 80, 104}: "ELECTRONIC INDUSTRIES ASSOCIATION", + [3]byte{0, 80, 105}: "PixStream Incorporated", + [3]byte{0, 80, 106}: "EDEVA, INC.", + [3]byte{0, 80, 107}: "SPX-ATEG", + [3]byte{0, 80, 108}: "Beijer Electronics Products AB", + [3]byte{0, 80, 109}: "VIDEOJET SYSTEMS", + [3]byte{0, 80, 110}: "CORDER ENGINEERING CORPORATION", + [3]byte{0, 80, 111}: "G-CONNECT", + [3]byte{0, 80, 112}: "CHAINTECH COMPUTER CO., LTD.", + [3]byte{0, 80, 113}: "AIWA CO., LTD.", + [3]byte{0, 80, 114}: "CORVIS CORPORATION", + [3]byte{0, 80, 115}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 116}: "ADVANCED HI-TECH CORP.", + [3]byte{0, 80, 117}: "KESTREL SOLUTIONS", + [3]byte{0, 80, 118}: "IBM Corp", + [3]byte{0, 80, 119}: "PROLIFIC TECHNOLOGY, INC.", + [3]byte{0, 80, 120}: "MEGATON HOUSE, LTD.", + [3]byte{0, 80, 121}: "PRIVATE", + [3]byte{0, 80, 122}: "XPEED, INC.", + [3]byte{0, 80, 123}: "MERLOT COMMUNICATIONS", + [3]byte{0, 80, 124}: "VIDEOCON AG", + [3]byte{0, 80, 125}: "IFP", + [3]byte{0, 80, 126}: "NEWER TECHNOLOGY", + [3]byte{0, 80, 127}: "DrayTek Corp.", + [3]byte{0, 80, 128}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 129}: "MURATA MACHINERY, LTD.", + [3]byte{0, 80, 130}: "FORESSON CORPORATION", + [3]byte{0, 80, 131}: "GILBARCO, INC.", + [3]byte{0, 80, 132}: "ATL PRODUCTS", + [3]byte{0, 80, 134}: "TELKOM SA, LTD.", + [3]byte{0, 80, 135}: "TERASAKI ELECTRIC CO., LTD.", + [3]byte{0, 80, 136}: "AMANO CORPORATION", + [3]byte{0, 80, 137}: "SAFETY MANAGEMENT SYSTEMS", + [3]byte{0, 80, 139}: "Hewlett-Packard Company", + [3]byte{0, 80, 140}: "RSI SYSTEMS", + [3]byte{0, 80, 141}: "ABIT COMPUTER CORPORATION", + [3]byte{0, 80, 142}: "OPTIMATION, INC.", + [3]byte{0, 80, 143}: "ASITA TECHNOLOGIES INT'L LTD.", + [3]byte{0, 80, 144}: "DCTRI", + [3]byte{0, 80, 145}: "NETACCESS, INC.", + [3]byte{0, 80, 146}: "RIGAKU INDUSTRIAL CORPORATION", + [3]byte{0, 80, 147}: "BOEING", + [3]byte{0, 80, 148}: "PACE plc", + [3]byte{0, 80, 149}: "PERACOM NETWORKS", + [3]byte{0, 80, 150}: "SALIX TECHNOLOGIES, INC.", + [3]byte{0, 80, 151}: "MMC-EMBEDDED COMPUTERTECHNIK GmbH", + [3]byte{0, 80, 152}: "GLOBALOOP, LTD.", + [3]byte{0, 80, 153}: "3COM EUROPE, LTD.", + [3]byte{0, 80, 154}: "TAG ELECTRONIC SYSTEMS", + [3]byte{0, 80, 155}: "SWITCHCORE AB", + [3]byte{0, 80, 156}: "BETA RESEARCH", + [3]byte{0, 80, 157}: "THE INDUSTREE B.V.", + [3]byte{0, 80, 158}: "Les Technologies SoftAcoustik Inc.", + [3]byte{0, 80, 159}: "HORIZON COMPUTER", + [3]byte{0, 80, 160}: "DELTA COMPUTER SYSTEMS, INC.", + [3]byte{0, 80, 161}: "CARLO GAVAZZI, INC.", + [3]byte{0, 80, 162}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 163}: "TransMedia Communications, Inc.", + [3]byte{0, 80, 164}: "IO TECH, INC.", + [3]byte{0, 80, 165}: "CAPITOL BUSINESS SYSTEMS, LTD.", + [3]byte{0, 80, 166}: "OPTRONICS", + [3]byte{0, 80, 167}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 168}: "OpenCon Systems, Inc.", + [3]byte{0, 80, 169}: "MOLDAT WIRELESS TECHNOLGIES", + [3]byte{0, 80, 170}: "KONICA MINOLTA HOLDINGS, INC.", + [3]byte{0, 80, 171}: "NALTEC, Inc.", + [3]byte{0, 80, 172}: "MAPLE COMPUTER CORPORATION", + [3]byte{0, 80, 173}: "CommUnique Wireless Corp.", + [3]byte{0, 80, 174}: "FDK Co., Ltd", + [3]byte{0, 80, 175}: "INTERGON, INC.", + [3]byte{0, 80, 176}: "TECHNOLOGY ATLANTA CORPORATION", + [3]byte{0, 80, 177}: "GIDDINGS & LEWIS", + [3]byte{0, 80, 178}: "BRODEL GmbH", + [3]byte{0, 80, 179}: "VOICEBOARD CORPORATION", + [3]byte{0, 80, 180}: "SATCHWELL CONTROL SYSTEMS, LTD", + [3]byte{0, 80, 181}: "FICHET-BAUCHE", + [3]byte{0, 80, 182}: "GOOD WAY IND. CO., LTD.", + [3]byte{0, 80, 183}: "BOSER TECHNOLOGY CO., LTD.", + [3]byte{0, 80, 184}: "INOVA COMPUTERS GMBH & CO. KG", + [3]byte{0, 80, 185}: "XITRON TECHNOLOGIES, INC.", + [3]byte{0, 80, 186}: "D-LINK", + [3]byte{0, 80, 187}: "CMS TECHNOLOGIES", + [3]byte{0, 80, 188}: "HAMMER STORAGE SOLUTIONS", + [3]byte{0, 80, 189}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 190}: "FAST MULTIMEDIA AG", + [3]byte{0, 80, 191}: "Metalligence Technology Corp.", + [3]byte{0, 80, 192}: "GATAN, INC.", + [3]byte{0, 80, 193}: "GEMFLEX NETWORKS, LTD.", + [3]byte{0, 80, 194}: "IEEE REGISTRATION AUTHORITY - Please see IAB public listing for more information.", + [3]byte{0, 80, 196}: "IMD", + [3]byte{0, 80, 197}: "ADS Technologies, Inc", + [3]byte{0, 80, 198}: "LOOP TELECOMMUNICATION INTERNATIONAL, INC.", + [3]byte{0, 80, 200}: "Addonics Technologies, Inc.", + [3]byte{0, 80, 201}: "MASPRO DENKOH CORP.", + [3]byte{0, 80, 202}: "NET TO NET TECHNOLOGIES", + [3]byte{0, 80, 203}: "JETTER", + [3]byte{0, 80, 204}: "XYRATEX", + [3]byte{0, 80, 205}: "DIGIANSWER A/S", + [3]byte{0, 80, 206}: "LG INTERNATIONAL CORP.", + [3]byte{0, 80, 207}: "VANLINK COMMUNICATION TECHNOLOGY RESEARCH INSTITUTE", + [3]byte{0, 80, 208}: "MINERVA SYSTEMS", + [3]byte{0, 80, 209}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 210}: "CMC Electronics Inc", + [3]byte{0, 80, 211}: "DIGITAL AUDIO PROCESSING PTY. LTD.", + [3]byte{0, 80, 212}: "JOOHONG INFORMATION &", + [3]byte{0, 80, 213}: "AD SYSTEMS CORP.", + [3]byte{0, 80, 214}: "ATLAS COPCO TOOLS AB", + [3]byte{0, 80, 215}: "TELSTRAT", + [3]byte{0, 80, 216}: "UNICORN COMPUTER CORP.", + [3]byte{0, 80, 217}: "ENGETRON-ENGENHARIA ELETRONICA IND. e COM. LTDA", + [3]byte{0, 80, 218}: "3COM CORPORATION", + [3]byte{0, 80, 219}: "CONTEMPORARY CONTROL", + [3]byte{0, 80, 220}: "TAS TELEFONBAU A. SCHWABE GMBH & CO. KG", + [3]byte{0, 80, 221}: "SERRA SOLDADURA, S.A.", + [3]byte{0, 80, 222}: "SIGNUM SYSTEMS CORP.", + [3]byte{0, 80, 223}: "AirFiber, Inc.", + [3]byte{0, 80, 225}: "NS TECH ELECTRONICS SDN BHD", + [3]byte{0, 80, 226}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 227}: "ARRIS Group, Inc.", + [3]byte{0, 80, 228}: "Apple", + [3]byte{0, 80, 230}: "HAKUSAN CORPORATION", + [3]byte{0, 80, 231}: "PARADISE INNOVATIONS (ASIA)", + [3]byte{0, 80, 232}: "NOMADIX INC.", + [3]byte{0, 80, 234}: "XEL COMMUNICATIONS, INC.", + [3]byte{0, 80, 235}: "ALPHA-TOP CORPORATION", + [3]byte{0, 80, 236}: "OLICOM A/S", + [3]byte{0, 80, 237}: "ANDA NETWORKS", + [3]byte{0, 80, 238}: "TEK DIGITEL CORPORATION", + [3]byte{0, 80, 239}: "SPE Systemhaus GmbH", + [3]byte{0, 80, 240}: "CISCO SYSTEMS, INC.", + [3]byte{0, 80, 241}: "Intel Corporation", + [3]byte{0, 80, 242}: "MICROSOFT CORP.", + [3]byte{0, 80, 243}: "GLOBAL NET INFORMATION CO., Ltd.", + [3]byte{0, 80, 244}: "SIGMATEK GMBH & CO. KG", + [3]byte{0, 80, 246}: "PAN-INTERNATIONAL INDUSTRIAL CORP.", + [3]byte{0, 80, 247}: "VENTURE MANUFACTURING (SINGAPORE) LTD.", + [3]byte{0, 80, 248}: "ENTREGA TECHNOLOGIES, INC.", + [3]byte{0, 80, 249}: "Sensormatic Electronics LLC", + [3]byte{0, 80, 250}: "OXTEL, LTD.", + [3]byte{0, 80, 251}: "VSK ELECTRONICS", + [3]byte{0, 80, 252}: "EDIMAX TECHNOLOGY CO., LTD.", + [3]byte{0, 80, 253}: "VISIONCOMM CO., LTD.", + [3]byte{0, 80, 254}: "PCTVnet ASA", + [3]byte{0, 80, 255}: "HAKKO ELECTRONICS CO., LTD.", + [3]byte{0, 82, 24}: "Wuxi Keboda Electron Co.Ltd", + [3]byte{0, 84, 175}: "Continental Automotive Systems Inc.", + [3]byte{0, 89, 7}: "LenovoEMC Products USA, LLC", + [3]byte{0, 90, 57}: "SHENZHEN FAST TECHNOLOGIES CO., LTD.", + [3]byte{0, 92, 177}: "Gospell DIGITAL TECHNOLOGY CO., LTD", + [3]byte{0, 93, 3}: "Xilinx, Inc", + [3]byte{0, 96, 0}: "XYCOM INC.", + [3]byte{0, 96, 1}: "InnoSys, Inc.", + [3]byte{0, 96, 2}: "SCREEN SUBTITLING SYSTEMS, LTD", + [3]byte{0, 96, 3}: "TERAOKA WEIGH SYSTEM PTE, LTD.", + [3]byte{0, 96, 4}: "COMPUTADORES MODULARES SA", + [3]byte{0, 96, 5}: "FEEDBACK DATA LTD.", + [3]byte{0, 96, 6}: "SOTEC CO., LTD", + [3]byte{0, 96, 7}: "ACRES GAMING, INC.", + [3]byte{0, 96, 8}: "3COM CORPORATION", + [3]byte{0, 96, 9}: "CISCO SYSTEMS, INC.", + [3]byte{0, 96, 10}: "SORD COMPUTER CORPORATION", + [3]byte{0, 96, 11}: "LOGWARE GmbH", + [3]byte{0, 96, 12}: "Eurotech Inc.", + [3]byte{0, 96, 13}: "Digital Logic GmbH", + [3]byte{0, 96, 14}: "WAVENET INTERNATIONAL, INC.", + [3]byte{0, 96, 15}: "WESTELL, INC.", + [3]byte{0, 96, 16}: "NETWORK MACHINES, INC.", + [3]byte{0, 96, 17}: "CRYSTAL SEMICONDUCTOR CORP.", + [3]byte{0, 96, 18}: "POWER COMPUTING CORPORATION", + [3]byte{0, 96, 19}: "NETSTAL MASCHINEN AG", + [3]byte{0, 96, 20}: "EDEC CO., LTD.", + [3]byte{0, 96, 21}: "NET2NET CORPORATION", + [3]byte{0, 96, 22}: "CLARIION", + [3]byte{0, 96, 23}: "TOKIMEC INC.", + [3]byte{0, 96, 24}: "STELLAR ONE CORPORATION", + [3]byte{0, 96, 25}: "Roche Diagnostics", + [3]byte{0, 96, 26}: "KEITHLEY INSTRUMENTS", + [3]byte{0, 96, 27}: "MESA ELECTRONICS", + [3]byte{0, 96, 28}: "TELXON CORPORATION", + [3]byte{0, 96, 29}: "LUCENT TECHNOLOGIES", + [3]byte{0, 96, 30}: "SOFTLAB, INC.", + [3]byte{0, 96, 31}: "STALLION TECHNOLOGIES", + [3]byte{0, 96, 32}: "PIVOTAL NETWORKING, INC.", + [3]byte{0, 96, 33}: "DSC CORPORATION", + [3]byte{0, 96, 34}: "VICOM SYSTEMS, INC.", + [3]byte{0, 96, 35}: "PERICOM SEMICONDUCTOR CORP.", + [3]byte{0, 96, 36}: "GRADIENT TECHNOLOGIES, INC.", + [3]byte{0, 96, 37}: "ACTIVE IMAGING PLC", + [3]byte{0, 96, 38}: "VIKING Modular Solutions", + [3]byte{0, 96, 39}: "Superior Modular Products", + [3]byte{0, 96, 40}: "MACROVISION CORPORATION", + [3]byte{0, 96, 41}: "CARY PERIPHERALS INC.", + [3]byte{0, 96, 42}: "SYMICRON COMPUTER COMMUNICATIONS, LTD.", + [3]byte{0, 96, 43}: "PEAK AUDIO", + [3]byte{0, 96, 44}: "LINX Data Terminals, Inc.", + [3]byte{0, 96, 45}: "ALERTON TECHNOLOGIES, INC.", + [3]byte{0, 96, 46}: "CYCLADES CORPORATION", + [3]byte{0, 96, 47}: "CISCO SYSTEMS, INC.", + [3]byte{0, 96, 48}: "VILLAGE TRONIC ENTWICKLUNG", + [3]byte{0, 96, 49}: "HRK SYSTEMS", + [3]byte{0, 96, 50}: "I-CUBE, INC.", + [3]byte{0, 96, 51}: "ACUITY IMAGING, INC.", + [3]byte{0, 96, 52}: "ROBERT BOSCH GmbH", + [3]byte{0, 96, 53}: "DALLAS SEMICONDUCTOR, INC.", + [3]byte{0, 96, 54}: "AIT Austrian Institute of Technology GmbH", + [3]byte{0, 96, 55}: "NXP Semiconductors", + [3]byte{0, 96, 56}: "Nortel Networks", + [3]byte{0, 96, 57}: "SanCom Technology, Inc.", + [3]byte{0, 96, 58}: "QUICK CONTROLS LTD.", + [3]byte{0, 96, 59}: "AMTEC spa", + [3]byte{0, 96, 60}: "HAGIWARA SYS-COM CO., LTD.", + [3]byte{0, 96, 61}: "3CX", + [3]byte{0, 96, 62}: "CISCO SYSTEMS, INC.", + [3]byte{0, 96, 63}: "PATAPSCO DESIGNS", + [3]byte{0, 96, 64}: "NETRO CORP.", + [3]byte{0, 96, 65}: "Yokogawa Electric Corporation", + [3]byte{0, 96, 66}: "TKS (USA), INC.", + [3]byte{0, 96, 67}: "iDirect, INC.", + [3]byte{0, 96, 68}: "LITTON/POLY-SCIENTIFIC", + [3]byte{0, 96, 69}: "PATHLIGHT TECHNOLOGIES", + [3]byte{0, 96, 70}: "VMETRO, INC.", + [3]byte{0, 96, 71}: "CISCO SYSTEMS, INC.", + [3]byte{0, 96, 72}: "EMC CORPORATION", + [3]byte{0, 96, 73}: "VINA TECHNOLOGIES", + [3]byte{0, 96, 74}: "SAIC IDEAS GROUP", + [3]byte{0, 96, 75}: "Safe-com GmbH & Co. KG", + [3]byte{0, 96, 76}: "SAGEM COMMUNICATION", + [3]byte{0, 96, 77}: "MMC NETWORKS, INC.", + [3]byte{0, 96, 78}: "CYCLE COMPUTER CORPORATION, INC.", + [3]byte{0, 96, 79}: "Tattile SRL", + [3]byte{0, 96, 80}: "INTERNIX INC.", + [3]byte{0, 96, 81}: "QUALITY SEMICONDUCTOR", + [3]byte{0, 96, 82}: "PERIPHERALS ENTERPRISE CO., Ltd.", + [3]byte{0, 96, 83}: "TOYODA MACHINE WORKS, LTD.", + [3]byte{0, 96, 84}: "CONTROLWARE GMBH", + [3]byte{0, 96, 85}: "CORNELL UNIVERSITY", + [3]byte{0, 96, 86}: "NETWORK TOOLS, INC.", + [3]byte{0, 96, 87}: "MURATA MANUFACTURING CO., LTD.", + [3]byte{0, 96, 88}: "COPPER MOUNTAIN COMMUNICATIONS, INC.", + [3]byte{0, 96, 89}: "TECHNICAL COMMUNICATIONS CORP.", + [3]byte{0, 96, 90}: "CELCORE, INC.", + [3]byte{0, 96, 91}: "IntraServer Technology, Inc.", + [3]byte{0, 96, 92}: "CISCO SYSTEMS, INC.", + [3]byte{0, 96, 93}: "SCANIVALVE CORP.", + [3]byte{0, 96, 94}: "LIBERTY TECHNOLOGY NETWORKING", + [3]byte{0, 96, 95}: "NIPPON UNISOFT CORPORATION", + [3]byte{0, 96, 96}: "Data Innovations North America", + [3]byte{0, 96, 97}: "WHISTLE COMMUNICATIONS CORP.", + [3]byte{0, 96, 98}: "TELESYNC, INC.", + [3]byte{0, 96, 99}: "PSION DACOM PLC.", + [3]byte{0, 96, 100}: "NETCOMM LIMITED", + [3]byte{0, 96, 101}: "BERNECKER & RAINER INDUSTRIE-ELEKTRONIC GmbH", + [3]byte{0, 96, 102}: "LACROIX Trafic", + [3]byte{0, 96, 103}: "ACER NETXUS INC.", + [3]byte{0, 96, 104}: "Dialogic Corporation", + [3]byte{0, 96, 105}: "Brocade Communications Systems, Inc.", + [3]byte{0, 96, 106}: "MITSUBISHI WIRELESS COMMUNICATIONS. INC.", + [3]byte{0, 96, 107}: "Synclayer Inc.", + [3]byte{0, 96, 108}: "ARESCOM", + [3]byte{0, 96, 109}: "DIGITAL EQUIPMENT CORP.", + [3]byte{0, 96, 110}: "DAVICOM SEMICONDUCTOR, INC.", + [3]byte{0, 96, 111}: "CLARION CORPORATION OF AMERICA", + [3]byte{0, 96, 112}: "CISCO SYSTEMS, INC.", + [3]byte{0, 96, 113}: "MIDAS LAB, INC.", + [3]byte{0, 96, 114}: "VXL INSTRUMENTS, LIMITED", + [3]byte{0, 96, 115}: "REDCREEK COMMUNICATIONS, INC.", + [3]byte{0, 96, 116}: "QSC AUDIO PRODUCTS", + [3]byte{0, 96, 117}: "PENTEK, INC.", + [3]byte{0, 96, 118}: "SCHLUMBERGER TECHNOLOGIES RETAIL PETROLEUM SYSTEMS", + [3]byte{0, 96, 119}: "PRISA NETWORKS", + [3]byte{0, 96, 120}: "POWER MEASUREMENT LTD.", + [3]byte{0, 96, 121}: "Mainstream Data, Inc.", + [3]byte{0, 96, 122}: "DVS GmbH", + [3]byte{0, 96, 123}: "FORE SYSTEMS, INC.", + [3]byte{0, 96, 124}: "WaveAccess, Ltd.", + [3]byte{0, 96, 125}: "SENTIENT NETWORKS INC.", + [3]byte{0, 96, 126}: "GIGALABS, INC.", + [3]byte{0, 96, 127}: "AURORA TECHNOLOGIES, INC.", + [3]byte{0, 96, 128}: "MICROTRONIX DATACOM LTD.", + [3]byte{0, 96, 129}: "TV/COM INTERNATIONAL", + [3]byte{0, 96, 130}: "NOVALINK TECHNOLOGIES, INC.", + [3]byte{0, 96, 131}: "CISCO SYSTEMS, INC.", + [3]byte{0, 96, 132}: "DIGITAL VIDEO", + [3]byte{0, 96, 133}: "Storage Concepts", + [3]byte{0, 96, 134}: "LOGIC REPLACEMENT TECH. LTD.", + [3]byte{0, 96, 135}: "KANSAI ELECTRIC CO., LTD.", + [3]byte{0, 96, 136}: "WHITE MOUNTAIN DSP, INC.", + [3]byte{0, 96, 137}: "XATA", + [3]byte{0, 96, 138}: "CITADEL COMPUTER", + [3]byte{0, 96, 139}: "ConferTech International", + [3]byte{0, 96, 140}: "3COM CORPORATION", + [3]byte{0, 96, 141}: "UNIPULSE CORP.", + [3]byte{0, 96, 142}: "HE ELECTRONICS, TECHNOLOGIE & SYSTEMTECHNIK GmbH", + [3]byte{0, 96, 143}: "TEKRAM TECHNOLOGY CO., LTD.", + [3]byte{0, 96, 144}: "Artiza Networks Inc", + [3]byte{0, 96, 145}: "FIRST PACIFIC NETWORKS, INC.", + [3]byte{0, 96, 146}: "MICRO/SYS, INC.", + [3]byte{0, 96, 147}: "VARIAN", + [3]byte{0, 96, 148}: "IBM Corp", + [3]byte{0, 96, 149}: "ACCU-TIME SYSTEMS, INC.", + [3]byte{0, 96, 150}: "T.S. MICROTECH INC.", + [3]byte{0, 96, 151}: "3COM CORPORATION", + [3]byte{0, 96, 152}: "HT COMMUNICATIONS", + [3]byte{0, 96, 153}: "SBE, Inc.", + [3]byte{0, 96, 154}: "NJK TECHNO CO.", + [3]byte{0, 96, 155}: "ASTRO-MED, INC.", + [3]byte{0, 96, 156}: "Perkin-Elmer Incorporated", + [3]byte{0, 96, 157}: "PMI FOOD EQUIPMENT GROUP", + [3]byte{0, 96, 158}: "ASC X3 - INFORMATION TECHNOLOGY STANDARDS SECRETARIATS", + [3]byte{0, 96, 159}: "PHAST CORPORATION", + [3]byte{0, 96, 160}: "SWITCHED NETWORK TECHNOLOGIES, INC.", + [3]byte{0, 96, 161}: "VPNet, Inc.", + [3]byte{0, 96, 162}: "NIHON UNISYS LIMITED CO.", + [3]byte{0, 96, 163}: "CONTINUUM TECHNOLOGY CORP.", + [3]byte{0, 96, 164}: "GEW Technologies (PTY)Ltd", + [3]byte{0, 96, 165}: "PERFORMANCE TELECOM CORP.", + [3]byte{0, 96, 166}: "PARTICLE MEASURING SYSTEMS", + [3]byte{0, 96, 167}: "MICROSENS GmbH & CO. KG", + [3]byte{0, 96, 168}: "TIDOMAT AB", + [3]byte{0, 96, 169}: "GESYTEC MbH", + [3]byte{0, 96, 170}: "INTELLIGENT DEVICES INC. (IDI)", + [3]byte{0, 96, 171}: "LARSCOM INCORPORATED", + [3]byte{0, 96, 172}: "RESILIENCE CORPORATION", + [3]byte{0, 96, 173}: "MegaChips Corporation", + [3]byte{0, 96, 174}: "TRIO INFORMATION SYSTEMS AB", + [3]byte{0, 96, 175}: "PACIFIC MICRO DATA, INC.", + [3]byte{0, 96, 176}: "HEWLETT-PACKARD CO.", + [3]byte{0, 96, 177}: "INPUT/OUTPUT, INC.", + [3]byte{0, 96, 178}: "PROCESS CONTROL CORP.", + [3]byte{0, 96, 179}: "Z-COM, INC.", + [3]byte{0, 96, 180}: "GLENAYRE R&D INC.", + [3]byte{0, 96, 181}: "KEBA GmbH", + [3]byte{0, 96, 182}: "LAND COMPUTER CO., LTD.", + [3]byte{0, 96, 183}: "CHANNELMATIC, INC.", + [3]byte{0, 96, 184}: "CORELIS Inc.", + [3]byte{0, 96, 185}: "NEC Platforms, Ltd", + [3]byte{0, 96, 186}: "SAHARA NETWORKS, INC.", + [3]byte{0, 96, 187}: "CABLETRON - NETLINK, INC.", + [3]byte{0, 96, 188}: "KeunYoung Electronics & Communication Co., Ltd.", + [3]byte{0, 96, 189}: "HUBBELL-PULSECOM", + [3]byte{0, 96, 190}: "WEBTRONICS", + [3]byte{0, 96, 191}: "MACRAIGOR SYSTEMS, INC.", + [3]byte{0, 96, 192}: "Nera Networks AS", + [3]byte{0, 96, 193}: "WaveSpan Corporation", + [3]byte{0, 96, 194}: "MPL AG", + [3]byte{0, 96, 195}: "NETVISION CORPORATION", + [3]byte{0, 96, 196}: "SOLITON SYSTEMS K.K.", + [3]byte{0, 96, 197}: "ANCOT CORP.", + [3]byte{0, 96, 198}: "DCS AG", + [3]byte{0, 96, 199}: "AMATI COMMUNICATIONS CORP.", + [3]byte{0, 96, 200}: "KUKA WELDING SYSTEMS & ROBOTS", + [3]byte{0, 96, 201}: "ControlNet, Inc.", + [3]byte{0, 96, 202}: "HARMONIC SYSTEMS INCORPORATED", + [3]byte{0, 96, 203}: "HITACHI ZOSEN CORPORATION", + [3]byte{0, 96, 204}: "EMTRAK, INCORPORATED", + [3]byte{0, 96, 205}: "VideoServer, Inc.", + [3]byte{0, 96, 206}: "ACCLAIM COMMUNICATIONS", + [3]byte{0, 96, 207}: "ALTEON NETWORKS, INC.", + [3]byte{0, 96, 208}: "SNMP RESEARCH INCORPORATED", + [3]byte{0, 96, 209}: "CASCADE COMMUNICATIONS", + [3]byte{0, 96, 210}: "LUCENT TECHNOLOGIES TAIWAN TELECOMMUNICATIONS CO., LTD.", + [3]byte{0, 96, 211}: "AT&T", + [3]byte{0, 96, 212}: "ELDAT COMMUNICATION LTD.", + [3]byte{0, 96, 213}: "MIYACHI TECHNOS CORP.", + [3]byte{0, 96, 214}: "NovAtel Wireless Technologies Ltd.", + [3]byte{0, 96, 215}: "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE (EPFL)", + [3]byte{0, 96, 216}: "ELMIC SYSTEMS, INC.", + [3]byte{0, 96, 217}: "TRANSYS NETWORKS INC.", + [3]byte{0, 96, 218}: "JBM ELECTRONICS CO.", + [3]byte{0, 96, 219}: "NTP ELEKTRONIK A/S", + [3]byte{0, 96, 220}: "Toyo Network Systems & System Integration Co. LTD", + [3]byte{0, 96, 221}: "MYRICOM, INC.", + [3]byte{0, 96, 222}: "Kayser-Threde GmbH", + [3]byte{0, 96, 223}: "Brocade Communications Systems, Inc.", + [3]byte{0, 96, 224}: "AXIOM TECHNOLOGY CO., LTD.", + [3]byte{0, 96, 225}: "ORCKIT COMMUNICATIONS LTD.", + [3]byte{0, 96, 226}: "QUEST ENGINEERING & DEVELOPMENT", + [3]byte{0, 96, 227}: "ARBIN INSTRUMENTS", + [3]byte{0, 96, 228}: "COMPUSERVE, INC.", + [3]byte{0, 96, 229}: "FUJI AUTOMATION CO., LTD.", + [3]byte{0, 96, 230}: "SHOMITI SYSTEMS INCORPORATED", + [3]byte{0, 96, 231}: "RANDATA", + [3]byte{0, 96, 232}: "HITACHI COMPUTER PRODUCTS (AMERICA), INC.", + [3]byte{0, 96, 233}: "ATOP TECHNOLOGIES, INC.", + [3]byte{0, 96, 234}: "StreamLogic", + [3]byte{0, 96, 235}: "FOURTHTRACK SYSTEMS", + [3]byte{0, 96, 236}: "HERMARY OPTO ELECTRONICS INC.", + [3]byte{0, 96, 237}: "RICARDO TEST AUTOMATION LTD.", + [3]byte{0, 96, 238}: "APOLLO", + [3]byte{0, 96, 239}: "FLYTECH TECHNOLOGY CO., LTD.", + [3]byte{0, 96, 240}: "JOHNSON & JOHNSON MEDICAL, INC", + [3]byte{0, 96, 241}: "EXP COMPUTER, INC.", + [3]byte{0, 96, 242}: "LASERGRAPHICS, INC.", + [3]byte{0, 96, 243}: "Performance Analysis Broadband, Spirent plc", + [3]byte{0, 96, 244}: "ADVANCED COMPUTER SOLUTIONS, Inc.", + [3]byte{0, 96, 245}: "ICON WEST, INC.", + [3]byte{0, 96, 246}: "NEXTEST COMMUNICATIONS PRODUCTS, INC.", + [3]byte{0, 96, 247}: "DATAFUSION SYSTEMS", + [3]byte{0, 96, 248}: "Loran International Technologies Inc.", + [3]byte{0, 96, 249}: "DIAMOND LANE COMMUNICATIONS", + [3]byte{0, 96, 250}: "EDUCATIONAL TECHNOLOGY RESOURCES, INC.", + [3]byte{0, 96, 251}: "PACKETEER, INC.", + [3]byte{0, 96, 252}: "CONSERVATION THROUGH INNOVATION LTD.", + [3]byte{0, 96, 253}: "NetICs, Inc.", + [3]byte{0, 96, 254}: "LYNX SYSTEM DEVELOPERS, INC.", + [3]byte{0, 96, 255}: "QuVis, Inc.", + [3]byte{0, 97, 113}: "Apple", + [3]byte{0, 100, 64}: "CISCO SYSTEMS, INC.", + [3]byte{0, 100, 166}: "Maquet CardioVascular", + [3]byte{0, 102, 75}: "Huawei Technologies Co., Ltd", + [3]byte{0, 107, 142}: "Shanghai Feixun Communication Co.,Ltd.", + [3]byte{0, 107, 158}: "VIZIO Inc", + [3]byte{0, 107, 160}: "SHENZHEN UNIVERSAL INTELLISYS PTE LTD", + [3]byte{0, 109, 251}: "Vutrix (UK) Ltd", + [3]byte{0, 112, 176}: "M/A-COM INC. COMPANIES", + [3]byte{0, 112, 179}: "DATA RECALL LTD.", + [3]byte{0, 113, 204}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{0, 115, 141}: "Tinno Mobile Technology Corp", + [3]byte{0, 115, 224}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 117, 50}: "INID BV", + [3]byte{0, 117, 225}: "Ampt, LLC", + [3]byte{0, 120, 158}: "SAGEMCOM", + [3]byte{0, 125, 250}: "Volkswagen Group of America", + [3]byte{0, 127, 40}: "Actiontec Electronics, Inc", + [3]byte{0, 128, 0}: "MULTITECH SYSTEMS, INC.", + [3]byte{0, 128, 1}: "PERIPHONICS CORPORATION", + [3]byte{0, 128, 2}: "SATELCOM (UK) LTD", + [3]byte{0, 128, 3}: "HYTEC ELECTRONICS LTD.", + [3]byte{0, 128, 4}: "ANTLOW COMMUNICATIONS, LTD.", + [3]byte{0, 128, 5}: "CACTUS COMPUTER INC.", + [3]byte{0, 128, 6}: "COMPUADD CORPORATION", + [3]byte{0, 128, 7}: "DLOG NC-SYSTEME", + [3]byte{0, 128, 8}: "DYNATECH COMPUTER SYSTEMS", + [3]byte{0, 128, 9}: "JUPITER SYSTEMS, INC.", + [3]byte{0, 128, 10}: "JAPAN COMPUTER CORP.", + [3]byte{0, 128, 11}: "CSK CORPORATION", + [3]byte{0, 128, 12}: "VIDECOM LIMITED", + [3]byte{0, 128, 13}: "VOSSWINKEL F.U.", + [3]byte{0, 128, 14}: "ATLANTIX CORPORATION", + [3]byte{0, 128, 15}: "STANDARD MICROSYSTEMS", + [3]byte{0, 128, 16}: "COMMODORE INTERNATIONAL", + [3]byte{0, 128, 17}: "DIGITAL SYSTEMS INT'L. INC.", + [3]byte{0, 128, 18}: "INTEGRATED MEASUREMENT SYSTEMS", + [3]byte{0, 128, 19}: "THOMAS-CONRAD CORPORATION", + [3]byte{0, 128, 20}: "ESPRIT SYSTEMS", + [3]byte{0, 128, 21}: "SEIKO SYSTEMS, INC.", + [3]byte{0, 128, 22}: "WANDEL AND GOLTERMANN", + [3]byte{0, 128, 23}: "PFU LIMITED", + [3]byte{0, 128, 24}: "KOBE STEEL, LTD.", + [3]byte{0, 128, 25}: "DAYNA COMMUNICATIONS, INC.", + [3]byte{0, 128, 26}: "BELL ATLANTIC", + [3]byte{0, 128, 27}: "KODIAK TECHNOLOGY", + [3]byte{0, 128, 28}: "NEWPORT SYSTEMS SOLUTIONS", + [3]byte{0, 128, 29}: "INTEGRATED INFERENCE MACHINES", + [3]byte{0, 128, 30}: "XINETRON, INC.", + [3]byte{0, 128, 31}: "KRUPP ATLAS ELECTRONIK GMBH", + [3]byte{0, 128, 32}: "NETWORK PRODUCTS", + [3]byte{0, 128, 33}: "Alcatel Canada Inc.", + [3]byte{0, 128, 34}: "SCAN-OPTICS", + [3]byte{0, 128, 35}: "INTEGRATED BUSINESS NETWORKS", + [3]byte{0, 128, 36}: "KALPANA, INC.", + [3]byte{0, 128, 37}: "STOLLMANN GMBH", + [3]byte{0, 128, 38}: "NETWORK PRODUCTS CORPORATION", + [3]byte{0, 128, 39}: "ADAPTIVE SYSTEMS, INC.", + [3]byte{0, 128, 40}: "TRADPOST (HK) LTD", + [3]byte{0, 128, 41}: "EAGLE TECHNOLOGY, INC.", + [3]byte{0, 128, 42}: "TEST SYSTEMS & SIMULATIONS INC", + [3]byte{0, 128, 43}: "INTEGRATED MARKETING CO", + [3]byte{0, 128, 44}: "THE SAGE GROUP PLC", + [3]byte{0, 128, 45}: "XYLOGICS INC", + [3]byte{0, 128, 46}: "CASTLE ROCK COMPUTING", + [3]byte{0, 128, 47}: "NATIONAL INSTRUMENTS CORP.", + [3]byte{0, 128, 48}: "NEXUS ELECTRONICS", + [3]byte{0, 128, 49}: "BASYS, CORP.", + [3]byte{0, 128, 50}: "ACCESS CO., LTD.", + [3]byte{0, 128, 51}: "EMS Aviation, Inc.", + [3]byte{0, 128, 52}: "SMT GOUPIL", + [3]byte{0, 128, 53}: "TECHNOLOGY WORKS, INC.", + [3]byte{0, 128, 54}: "REFLEX MANUFACTURING SYSTEMS", + [3]byte{0, 128, 55}: "Ericsson Group", + [3]byte{0, 128, 56}: "DATA RESEARCH & APPLICATIONS", + [3]byte{0, 128, 57}: "ALCATEL STC AUSTRALIA", + [3]byte{0, 128, 58}: "VARITYPER, INC.", + [3]byte{0, 128, 59}: "APT COMMUNICATIONS, INC.", + [3]byte{0, 128, 60}: "TVS ELECTRONICS LTD", + [3]byte{0, 128, 61}: "SURIGIKEN CO., LTD.", + [3]byte{0, 128, 62}: "SYNERNETICS", + [3]byte{0, 128, 63}: "TATUNG COMPANY", + [3]byte{0, 128, 64}: "JOHN FLUKE MANUFACTURING CO.", + [3]byte{0, 128, 65}: "VEB KOMBINAT ROBOTRON", + [3]byte{0, 128, 66}: "Artesyn Embedded Technologies", + [3]byte{0, 128, 67}: "NETWORLD, INC.", + [3]byte{0, 128, 68}: "SYSTECH COMPUTER CORP.", + [3]byte{0, 128, 69}: "MATSUSHITA ELECTRIC IND. CO", + [3]byte{0, 128, 70}: "Tattile SRL", + [3]byte{0, 128, 71}: "IN-NET CORP.", + [3]byte{0, 128, 72}: "COMPEX INCORPORATED", + [3]byte{0, 128, 73}: "NISSIN ELECTRIC CO., LTD.", + [3]byte{0, 128, 74}: "PRO-LOG", + [3]byte{0, 128, 75}: "EAGLE TECHNOLOGIES PTY.LTD.", + [3]byte{0, 128, 76}: "CONTEC CO., LTD.", + [3]byte{0, 128, 77}: "CYCLONE MICROSYSTEMS, INC.", + [3]byte{0, 128, 78}: "APEX COMPUTER COMPANY", + [3]byte{0, 128, 79}: "DAIKIN INDUSTRIES, LTD.", + [3]byte{0, 128, 80}: "ZIATECH CORPORATION", + [3]byte{0, 128, 81}: "FIBERMUX", + [3]byte{0, 128, 82}: "TECHNICALLY ELITE CONCEPTS", + [3]byte{0, 128, 83}: "INTELLICOM, INC.", + [3]byte{0, 128, 84}: "FRONTIER TECHNOLOGIES CORP.", + [3]byte{0, 128, 85}: "FERMILAB", + [3]byte{0, 128, 86}: "SPHINX ELEKTRONIK GMBH", + [3]byte{0, 128, 87}: "ADSOFT, LTD.", + [3]byte{0, 128, 88}: "PRINTER SYSTEMS CORPORATION", + [3]byte{0, 128, 89}: "STANLEY ELECTRIC CO., LTD", + [3]byte{0, 128, 90}: "TULIP COMPUTERS INTERNAT'L B.V", + [3]byte{0, 128, 91}: "CONDOR SYSTEMS, INC.", + [3]byte{0, 128, 92}: "AGILIS CORPORATION", + [3]byte{0, 128, 93}: "CANSTAR", + [3]byte{0, 128, 94}: "LSI LOGIC CORPORATION", + [3]byte{0, 128, 95}: "Hewlett-Packard Company", + [3]byte{0, 128, 96}: "NETWORK INTERFACE CORPORATION", + [3]byte{0, 128, 97}: "LITTON SYSTEMS, INC.", + [3]byte{0, 128, 98}: "INTERFACE CO.", + [3]byte{0, 128, 99}: "Hirschmann Automation and Control GmbH", + [3]byte{0, 128, 100}: "WYSE TECHNOLOGY LLC", + [3]byte{0, 128, 101}: "CYBERGRAPHIC SYSTEMS PTY LTD.", + [3]byte{0, 128, 102}: "ARCOM CONTROL SYSTEMS, LTD.", + [3]byte{0, 128, 103}: "SQUARE D COMPANY", + [3]byte{0, 128, 104}: "YAMATECH SCIENTIFIC LTD.", + [3]byte{0, 128, 105}: "COMPUTONE SYSTEMS", + [3]byte{0, 128, 106}: "ERI (EMPAC RESEARCH INC.)", + [3]byte{0, 128, 107}: "SCHMID TELECOMMUNICATION", + [3]byte{0, 128, 108}: "CEGELEC PROJECTS LTD", + [3]byte{0, 128, 109}: "CENTURY SYSTEMS CORP.", + [3]byte{0, 128, 110}: "NIPPON STEEL CORPORATION", + [3]byte{0, 128, 111}: "ONELAN LTD.", + [3]byte{0, 128, 112}: "COMPUTADORAS MICRON", + [3]byte{0, 128, 113}: "SAI TECHNOLOGY", + [3]byte{0, 128, 114}: "MICROPLEX SYSTEMS LTD.", + [3]byte{0, 128, 115}: "DWB ASSOCIATES", + [3]byte{0, 128, 116}: "FISHER CONTROLS", + [3]byte{0, 128, 117}: "PARSYTEC GMBH", + [3]byte{0, 128, 118}: "MCNC", + [3]byte{0, 128, 119}: "BROTHER INDUSTRIES, LTD.", + [3]byte{0, 128, 120}: "PRACTICAL PERIPHERALS, INC.", + [3]byte{0, 128, 121}: "MICROBUS DESIGNS LTD.", + [3]byte{0, 128, 122}: "AITECH SYSTEMS LTD.", + [3]byte{0, 128, 123}: "ARTEL COMMUNICATIONS CORP.", + [3]byte{0, 128, 124}: "FIBERCOM, INC.", + [3]byte{0, 128, 125}: "EQUINOX SYSTEMS INC.", + [3]byte{0, 128, 126}: "SOUTHERN PACIFIC LTD.", + [3]byte{0, 128, 127}: "DY-4 INCORPORATED", + [3]byte{0, 128, 128}: "DATAMEDIA CORPORATION", + [3]byte{0, 128, 129}: "KENDALL SQUARE RESEARCH CORP.", + [3]byte{0, 128, 130}: "PEP MODULAR COMPUTERS GMBH", + [3]byte{0, 128, 131}: "AMDAHL", + [3]byte{0, 128, 132}: "THE CLOUD INC.", + [3]byte{0, 128, 133}: "H-THREE SYSTEMS CORPORATION", + [3]byte{0, 128, 134}: "COMPUTER GENERATION INC.", + [3]byte{0, 128, 135}: "OKI ELECTRIC INDUSTRY CO., LTD", + [3]byte{0, 128, 136}: "VICTOR COMPANY OF JAPAN, LTD.", + [3]byte{0, 128, 137}: "TECNETICS (PTY) LTD.", + [3]byte{0, 128, 138}: "SUMMIT MICROSYSTEMS CORP.", + [3]byte{0, 128, 139}: "DACOLL LIMITED", + [3]byte{0, 128, 140}: "NetScout Systems, Inc.", + [3]byte{0, 128, 141}: "WESTCOAST TECHNOLOGY B.V.", + [3]byte{0, 128, 142}: "RADSTONE TECHNOLOGY", + [3]byte{0, 128, 143}: "C. ITOH ELECTRONICS, INC.", + [3]byte{0, 128, 144}: "MICROTEK INTERNATIONAL, INC.", + [3]byte{0, 128, 145}: "TOKYO ELECTRIC CO.,LTD", + [3]byte{0, 128, 146}: "Silex Technology, Inc.", + [3]byte{0, 128, 147}: "XYRON CORPORATION", + [3]byte{0, 128, 148}: "ALFA LAVAL AUTOMATION AB", + [3]byte{0, 128, 149}: "BASIC MERTON HANDELSGES.M.B.H.", + [3]byte{0, 128, 150}: "HUMAN DESIGNED SYSTEMS, INC.", + [3]byte{0, 128, 151}: "CENTRALP AUTOMATISMES", + [3]byte{0, 128, 152}: "TDK CORPORATION", + [3]byte{0, 128, 153}: "Eaton Industries GmbH", + [3]byte{0, 128, 154}: "NOVUS NETWORKS LTD", + [3]byte{0, 128, 155}: "JUSTSYSTEM CORPORATION", + [3]byte{0, 128, 156}: "LUXCOM, INC.", + [3]byte{0, 128, 157}: "Commscraft Ltd.", + [3]byte{0, 128, 158}: "DATUS GMBH", + [3]byte{0, 128, 159}: "ALCATEL BUSINESS SYSTEMS", + [3]byte{0, 128, 160}: "EDISA HEWLETT PACKARD S/A", + [3]byte{0, 128, 161}: "MICROTEST, INC.", + [3]byte{0, 128, 162}: "CREATIVE ELECTRONIC SYSTEMS", + [3]byte{0, 128, 163}: "Lantronix", + [3]byte{0, 128, 164}: "LIBERTY ELECTRONICS", + [3]byte{0, 128, 165}: "SPEED INTERNATIONAL", + [3]byte{0, 128, 166}: "REPUBLIC TECHNOLOGY, INC.", + [3]byte{0, 128, 167}: "Honeywell International Inc", + [3]byte{0, 128, 168}: "VITACOM CORPORATION", + [3]byte{0, 128, 169}: "CLEARPOINT RESEARCH", + [3]byte{0, 128, 170}: "MAXPEED", + [3]byte{0, 128, 171}: "DUKANE NETWORK INTEGRATION", + [3]byte{0, 128, 172}: "IMLOGIX, DIVISION OF GENESYS", + [3]byte{0, 128, 173}: "CNET TECHNOLOGY, INC.", + [3]byte{0, 128, 174}: "HUGHES NETWORK SYSTEMS", + [3]byte{0, 128, 175}: "ALLUMER CO., LTD.", + [3]byte{0, 128, 176}: "ADVANCED INFORMATION", + [3]byte{0, 128, 177}: "SOFTCOM A/S", + [3]byte{0, 128, 178}: "NETWORK EQUIPMENT TECHNOLOGIES", + [3]byte{0, 128, 179}: "AVAL DATA CORPORATION", + [3]byte{0, 128, 180}: "SOPHIA SYSTEMS", + [3]byte{0, 128, 181}: "UNITED NETWORKS INC.", + [3]byte{0, 128, 182}: "THEMIS COMPUTER", + [3]byte{0, 128, 183}: "STELLAR COMPUTER", + [3]byte{0, 128, 184}: "B.U.G. MORISEIKI, INCORPORATED", + [3]byte{0, 128, 185}: "ARCHE TECHNOLIGIES INC.", + [3]byte{0, 128, 186}: "SPECIALIX (ASIA) PTE, LTD", + [3]byte{0, 128, 187}: "HUGHES LAN SYSTEMS", + [3]byte{0, 128, 188}: "HITACHI ENGINEERING CO., LTD", + [3]byte{0, 128, 189}: "THE FURUKAWA ELECTRIC CO., LTD", + [3]byte{0, 128, 190}: "ARIES RESEARCH", + [3]byte{0, 128, 191}: "TAKAOKA ELECTRIC MFG. CO. LTD.", + [3]byte{0, 128, 192}: "PENRIL DATACOMM", + [3]byte{0, 128, 193}: "LANEX CORPORATION", + [3]byte{0, 128, 194}: "IEEE 802.1 COMMITTEE", + [3]byte{0, 128, 195}: "BICC INFORMATION SYSTEMS & SVC", + [3]byte{0, 128, 196}: "DOCUMENT TECHNOLOGIES, INC.", + [3]byte{0, 128, 197}: "NOVELLCO DE MEXICO", + [3]byte{0, 128, 198}: "NATIONAL DATACOMM CORPORATION", + [3]byte{0, 128, 199}: "XIRCOM", + [3]byte{0, 128, 200}: "D-LINK SYSTEMS, INC.", + [3]byte{0, 128, 201}: "ALBERTA MICROELECTRONIC CENTRE", + [3]byte{0, 128, 202}: "NETCOM RESEARCH INCORPORATED", + [3]byte{0, 128, 203}: "FALCO DATA PRODUCTS", + [3]byte{0, 128, 204}: "MICROWAVE BYPASS SYSTEMS", + [3]byte{0, 128, 205}: "MICRONICS COMPUTER, INC.", + [3]byte{0, 128, 206}: "BROADCAST TELEVISION SYSTEMS", + [3]byte{0, 128, 207}: "EMBEDDED PERFORMANCE INC.", + [3]byte{0, 128, 208}: "COMPUTER PERIPHERALS, INC.", + [3]byte{0, 128, 209}: "KIMTRON CORPORATION", + [3]byte{0, 128, 210}: "SHINNIHONDENKO CO., LTD.", + [3]byte{0, 128, 211}: "SHIVA CORP.", + [3]byte{0, 128, 212}: "CHASE RESEARCH LTD.", + [3]byte{0, 128, 213}: "CADRE TECHNOLOGIES", + [3]byte{0, 128, 214}: "NUVOTECH, INC.", + [3]byte{0, 128, 215}: "Fantum Engineering", + [3]byte{0, 128, 216}: "NETWORK PERIPHERALS INC.", + [3]byte{0, 128, 217}: "EMK Elektronik GmbH & Co. KG", + [3]byte{0, 128, 218}: "Bruel & Kjaer Sound & Vibration Measurement A/S", + [3]byte{0, 128, 219}: "GRAPHON CORPORATION", + [3]byte{0, 128, 220}: "PICKER INTERNATIONAL", + [3]byte{0, 128, 221}: "GMX INC/GIMIX", + [3]byte{0, 128, 222}: "GIPSI S.A.", + [3]byte{0, 128, 223}: "ADC CODENOLL TECHNOLOGY CORP.", + [3]byte{0, 128, 224}: "XTP SYSTEMS, INC.", + [3]byte{0, 128, 225}: "STMICROELECTRONICS", + [3]byte{0, 128, 226}: "T.D.I. CO., LTD.", + [3]byte{0, 128, 227}: "CORAL NETWORK CORPORATION", + [3]byte{0, 128, 228}: "NORTHWEST DIGITAL SYSTEMS, INC", + [3]byte{0, 128, 229}: "NetApp, Inc", + [3]byte{0, 128, 230}: "PEER NETWORKS, INC.", + [3]byte{0, 128, 231}: "LYNWOOD SCIENTIFIC DEV. LTD.", + [3]byte{0, 128, 232}: "CUMULUS CORPORATIION", + [3]byte{0, 128, 233}: "Madge Ltd.", + [3]byte{0, 128, 234}: "ADVA Optical Networking Ltd.", + [3]byte{0, 128, 235}: "COMPCONTROL B.V.", + [3]byte{0, 128, 236}: "SUPERCOMPUTING SOLUTIONS, INC.", + [3]byte{0, 128, 237}: "IQ TECHNOLOGIES, INC.", + [3]byte{0, 128, 238}: "THOMSON CSF", + [3]byte{0, 128, 239}: "RATIONAL", + [3]byte{0, 128, 240}: "Panasonic Communications Co., Ltd.", + [3]byte{0, 128, 241}: "OPUS SYSTEMS", + [3]byte{0, 128, 242}: "RAYCOM SYSTEMS INC", + [3]byte{0, 128, 243}: "SUN ELECTRONICS CORP.", + [3]byte{0, 128, 244}: "TELEMECANIQUE ELECTRIQUE", + [3]byte{0, 128, 245}: "Quantel Ltd", + [3]byte{0, 128, 246}: "SYNERGY MICROSYSTEMS", + [3]byte{0, 128, 247}: "ZENITH ELECTRONICS", + [3]byte{0, 128, 248}: "MIZAR, INC.", + [3]byte{0, 128, 249}: "HEURIKON CORPORATION", + [3]byte{0, 128, 250}: "RWT GMBH", + [3]byte{0, 128, 251}: "BVM LIMITED", + [3]byte{0, 128, 252}: "AVATAR CORPORATION", + [3]byte{0, 128, 253}: "EXSCEED CORPRATION", + [3]byte{0, 128, 254}: "AZURE TECHNOLOGIES, INC.", + [3]byte{0, 128, 255}: "SOC. DE TELEINFORMATIQUE RTC", + [3]byte{0, 134, 160}: "PRIVATE", + [3]byte{0, 136, 101}: "Apple", + [3]byte{0, 139, 67}: "RFTECH", + [3]byte{0, 140, 16}: "Black Box Corp.", + [3]byte{0, 140, 84}: "ADB Broadband Italia", + [3]byte{0, 140, 250}: "Inventec Corporation", + [3]byte{0, 141, 78}: "CJSC NII STT", + [3]byte{0, 141, 218}: "Link One Co., Ltd.", + [3]byte{0, 142, 242}: "NETGEAR INC.,", + [3]byte{0, 144, 0}: "DIAMOND MULTIMEDIA", + [3]byte{0, 144, 1}: "NISHIMU ELECTRONICS INDUSTRIES CO., LTD.", + [3]byte{0, 144, 2}: "ALLGON AB", + [3]byte{0, 144, 3}: "APLIO", + [3]byte{0, 144, 4}: "3COM EUROPE LTD.", + [3]byte{0, 144, 5}: "PROTECH SYSTEMS CO., LTD.", + [3]byte{0, 144, 6}: "HAMAMATSU PHOTONICS K.K.", + [3]byte{0, 144, 7}: "DOMEX TECHNOLOGY CORP.", + [3]byte{0, 144, 8}: "HanA Systems Inc.", + [3]byte{0, 144, 9}: "I Controls, Inc.", + [3]byte{0, 144, 10}: "PROTON ELECTRONIC INDUSTRIAL CO., LTD.", + [3]byte{0, 144, 11}: "LANNER ELECTRONICS, INC.", + [3]byte{0, 144, 12}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 13}: "Overland Storage Inc.", + [3]byte{0, 144, 14}: "HANDLINK TECHNOLOGIES, INC.", + [3]byte{0, 144, 15}: "KAWASAKI HEAVY INDUSTRIES, LTD", + [3]byte{0, 144, 16}: "SIMULATION LABORATORIES, INC.", + [3]byte{0, 144, 17}: "WAVTrace, Inc.", + [3]byte{0, 144, 18}: "GLOBESPAN SEMICONDUCTOR, INC.", + [3]byte{0, 144, 19}: "SAMSAN CORP.", + [3]byte{0, 144, 20}: "ROTORK INSTRUMENTS, LTD.", + [3]byte{0, 144, 21}: "CENTIGRAM COMMUNICATIONS CORP.", + [3]byte{0, 144, 22}: "ZAC", + [3]byte{0, 144, 23}: "Zypcom, Inc", + [3]byte{0, 144, 24}: "ITO ELECTRIC INDUSTRY CO, LTD.", + [3]byte{0, 144, 25}: "HERMES ELECTRONICS CO., LTD.", + [3]byte{0, 144, 26}: "UNISPHERE SOLUTIONS", + [3]byte{0, 144, 27}: "DIGITAL CONTROLS", + [3]byte{0, 144, 28}: "mps Software Gmbh", + [3]byte{0, 144, 29}: "PEC (NZ) LTD.", + [3]byte{0, 144, 30}: "Selesta Ingegneria S.p.A.", + [3]byte{0, 144, 31}: "ADTEC PRODUCTIONS, INC.", + [3]byte{0, 144, 32}: "PHILIPS ANALYTICAL X-RAY B.V.", + [3]byte{0, 144, 33}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 34}: "IVEX", + [3]byte{0, 144, 35}: "ZILOG INC.", + [3]byte{0, 144, 36}: "PIPELINKS, INC.", + [3]byte{0, 144, 37}: "BAE Systems Australia (Electronic Systems) Pty Ltd", + [3]byte{0, 144, 38}: "ADVANCED SWITCHING COMMUNICATIONS, INC.", + [3]byte{0, 144, 39}: "INTEL CORPORATION", + [3]byte{0, 144, 40}: "NIPPON SIGNAL CO., LTD.", + [3]byte{0, 144, 41}: "CRYPTO AG", + [3]byte{0, 144, 42}: "COMMUNICATION DEVICES, INC.", + [3]byte{0, 144, 43}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 44}: "DATA & CONTROL EQUIPMENT LTD.", + [3]byte{0, 144, 45}: "DATA ELECTRONICS (AUST.) PTY, LTD.", + [3]byte{0, 144, 46}: "NAMCO LIMITED", + [3]byte{0, 144, 47}: "NETCORE SYSTEMS, INC.", + [3]byte{0, 144, 48}: "HONEYWELL-DATING", + [3]byte{0, 144, 49}: "MYSTICOM, LTD.", + [3]byte{0, 144, 50}: "PELCOMBE GROUP LTD.", + [3]byte{0, 144, 51}: "INNOVAPHONE AG", + [3]byte{0, 144, 52}: "IMAGIC, INC.", + [3]byte{0, 144, 53}: "ALPHA TELECOM, INC.", + [3]byte{0, 144, 54}: "ens, inc.", + [3]byte{0, 144, 55}: "ACUCOMM, INC.", + [3]byte{0, 144, 56}: "FOUNTAIN TECHNOLOGIES, INC.", + [3]byte{0, 144, 57}: "SHASTA NETWORKS", + [3]byte{0, 144, 58}: "NIHON MEDIA TOOL INC.", + [3]byte{0, 144, 59}: "TriEMS Research Lab, Inc.", + [3]byte{0, 144, 60}: "ATLANTIC NETWORK SYSTEMS", + [3]byte{0, 144, 61}: "BIOPAC SYSTEMS, INC.", + [3]byte{0, 144, 62}: "N.V. PHILIPS INDUSTRIAL ACTIVITIES", + [3]byte{0, 144, 63}: "AZTEC RADIOMEDIA", + [3]byte{0, 144, 64}: "Siemens Network Convergence LLC", + [3]byte{0, 144, 65}: "APPLIED DIGITAL ACCESS", + [3]byte{0, 144, 66}: "ECCS, Inc.", + [3]byte{0, 144, 67}: "Tattile SRL", + [3]byte{0, 144, 68}: "ASSURED DIGITAL, INC.", + [3]byte{0, 144, 69}: "Marconi Communications", + [3]byte{0, 144, 70}: "DEXDYNE, LTD.", + [3]byte{0, 144, 71}: "GIGA FAST E. LTD.", + [3]byte{0, 144, 72}: "ZEAL CORPORATION", + [3]byte{0, 144, 73}: "ENTRIDIA CORPORATION", + [3]byte{0, 144, 74}: "CONCUR SYSTEM TECHNOLOGIES", + [3]byte{0, 144, 75}: "GemTek Technology Co., Ltd.", + [3]byte{0, 144, 76}: "EPIGRAM, INC.", + [3]byte{0, 144, 77}: "SPEC S.A.", + [3]byte{0, 144, 78}: "DELEM BV", + [3]byte{0, 144, 79}: "ABB POWER T&D COMPANY, INC.", + [3]byte{0, 144, 80}: "TELESTE OY", + [3]byte{0, 144, 81}: "ULTIMATE TECHNOLOGY CORP.", + [3]byte{0, 144, 82}: "SELCOM ELETTRONICA S.R.L.", + [3]byte{0, 144, 83}: "DAEWOO ELECTRONICS CO., LTD.", + [3]byte{0, 144, 84}: "INNOVATIVE SEMICONDUCTORS, INC", + [3]byte{0, 144, 85}: "PARKER HANNIFIN CORPORATION COMPUMOTOR DIVISION", + [3]byte{0, 144, 86}: "TELESTREAM, INC.", + [3]byte{0, 144, 87}: "AANetcom, Inc.", + [3]byte{0, 144, 88}: "Ultra Electronics Ltd., Command and Control Systems", + [3]byte{0, 144, 89}: "TELECOM DEVICE K.K.", + [3]byte{0, 144, 90}: "DEARBORN GROUP, INC.", + [3]byte{0, 144, 91}: "RAYMOND AND LAE ENGINEERING", + [3]byte{0, 144, 92}: "EDMI", + [3]byte{0, 144, 93}: "NETCOM SICHERHEITSTECHNIK GmbH", + [3]byte{0, 144, 94}: "RAULAND-BORG CORPORATION", + [3]byte{0, 144, 95}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 96}: "SYSTEM CREATE CORP.", + [3]byte{0, 144, 97}: "PACIFIC RESEARCH & ENGINEERING CORPORATION", + [3]byte{0, 144, 98}: "ICP VORTEX COMPUTERSYSTEME GmbH", + [3]byte{0, 144, 99}: "COHERENT COMMUNICATIONS SYSTEMS CORPORATION", + [3]byte{0, 144, 100}: "Thomson Inc.", + [3]byte{0, 144, 101}: "FINISAR CORPORATION", + [3]byte{0, 144, 102}: "Troika Networks, Inc.", + [3]byte{0, 144, 103}: "WalkAbout Computers, Inc.", + [3]byte{0, 144, 104}: "DVT CORP.", + [3]byte{0, 144, 105}: "JUNIPER NETWORKS, INC.", + [3]byte{0, 144, 106}: "TURNSTONE SYSTEMS, INC.", + [3]byte{0, 144, 107}: "APPLIED RESOURCES, INC.", + [3]byte{0, 144, 108}: "Sartorius Hamburg GmbH", + [3]byte{0, 144, 109}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 110}: "PRAXON, INC.", + [3]byte{0, 144, 111}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 112}: "NEO NETWORKS, INC.", + [3]byte{0, 144, 113}: "Applied Innovation Inc.", + [3]byte{0, 144, 114}: "SIMRAD AS", + [3]byte{0, 144, 115}: "GAIO TECHNOLOGY", + [3]byte{0, 144, 116}: "ARGON NETWORKS, INC.", + [3]byte{0, 144, 117}: "NEC DO BRASIL S.A.", + [3]byte{0, 144, 118}: "FMT AIRCRAFT GATE SUPPORT SYSTEMS AB", + [3]byte{0, 144, 119}: "ADVANCED FIBRE COMMUNICATIONS", + [3]byte{0, 144, 120}: "MER TELEMANAGEMENT SOLUTIONS, LTD.", + [3]byte{0, 144, 121}: "ClearOne, Inc.", + [3]byte{0, 144, 122}: "Spectralink, Inc", + [3]byte{0, 144, 123}: "E-TECH, INC.", + [3]byte{0, 144, 124}: "DIGITALCAST, INC.", + [3]byte{0, 144, 125}: "Lake Communications", + [3]byte{0, 144, 126}: "VETRONIX CORP.", + [3]byte{0, 144, 127}: "WatchGuard Technologies, Inc.", + [3]byte{0, 144, 128}: "NOT LIMITED, INC.", + [3]byte{0, 144, 129}: "ALOHA NETWORKS, INC.", + [3]byte{0, 144, 130}: "FORCE INSTITUTE", + [3]byte{0, 144, 131}: "TURBO COMMUNICATION, INC.", + [3]byte{0, 144, 132}: "ATECH SYSTEM", + [3]byte{0, 144, 133}: "GOLDEN ENTERPRISES, INC.", + [3]byte{0, 144, 134}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 135}: "ITIS", + [3]byte{0, 144, 136}: "BAXALL SECURITY LTD.", + [3]byte{0, 144, 137}: "SOFTCOM MICROSYSTEMS, INC.", + [3]byte{0, 144, 138}: "BAYLY COMMUNICATIONS, INC.", + [3]byte{0, 144, 139}: "Tattile SRL", + [3]byte{0, 144, 140}: "ETREND ELECTRONICS, INC.", + [3]byte{0, 144, 141}: "VICKERS ELECTRONICS SYSTEMS", + [3]byte{0, 144, 142}: "Nortel Networks Broadband Access", + [3]byte{0, 144, 143}: "AUDIO CODES LTD.", + [3]byte{0, 144, 144}: "I-BUS", + [3]byte{0, 144, 145}: "DigitalScape, Inc.", + [3]byte{0, 144, 146}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 147}: "NANAO CORPORATION", + [3]byte{0, 144, 148}: "OSPREY TECHNOLOGIES, INC.", + [3]byte{0, 144, 149}: "UNIVERSAL AVIONICS", + [3]byte{0, 144, 150}: "ASKEY COMPUTER CORP.", + [3]byte{0, 144, 151}: "Sycamore Networks", + [3]byte{0, 144, 152}: "SBC DESIGNS, INC.", + [3]byte{0, 144, 153}: "ALLIED TELESIS, K.K.", + [3]byte{0, 144, 154}: "ONE WORLD SYSTEMS, INC.", + [3]byte{0, 144, 155}: "MARKEM-IMAJE", + [3]byte{0, 144, 156}: "ARRIS Group, Inc.", + [3]byte{0, 144, 157}: "NovaTech Process Solutions, LLC", + [3]byte{0, 144, 158}: "Critical IO, LLC", + [3]byte{0, 144, 159}: "DIGI-DATA CORPORATION", + [3]byte{0, 144, 160}: "8X8 INC.", + [3]byte{0, 144, 161}: "Flying Pig Systems/High End Systems Inc.", + [3]byte{0, 144, 162}: "CYBERTAN TECHNOLOGY, INC.", + [3]byte{0, 144, 163}: "Corecess Inc.", + [3]byte{0, 144, 164}: "ALTIGA NETWORKS", + [3]byte{0, 144, 165}: "SPECTRA LOGIC", + [3]byte{0, 144, 166}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 167}: "CLIENTEC CORPORATION", + [3]byte{0, 144, 168}: "NineTiles Networks, Ltd.", + [3]byte{0, 144, 169}: "WESTERN DIGITAL", + [3]byte{0, 144, 170}: "INDIGO ACTIVE VISION SYSTEMS LIMITED", + [3]byte{0, 144, 171}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 172}: "OPTIVISION, INC.", + [3]byte{0, 144, 173}: "ASPECT ELECTRONICS, INC.", + [3]byte{0, 144, 174}: "ITALTEL S.p.A.", + [3]byte{0, 144, 175}: "J. MORITA MFG. CORP.", + [3]byte{0, 144, 176}: "VADEM", + [3]byte{0, 144, 177}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 178}: "AVICI SYSTEMS INC.", + [3]byte{0, 144, 179}: "AGRANAT SYSTEMS", + [3]byte{0, 144, 180}: "WILLOWBROOK TECHNOLOGIES", + [3]byte{0, 144, 181}: "NIKON CORPORATION", + [3]byte{0, 144, 182}: "FIBEX SYSTEMS", + [3]byte{0, 144, 183}: "DIGITAL LIGHTWAVE, INC.", + [3]byte{0, 144, 184}: "ROHDE & SCHWARZ GMBH & CO. KG", + [3]byte{0, 144, 185}: "BERAN INSTRUMENTS LTD.", + [3]byte{0, 144, 186}: "VALID NETWORKS, INC.", + [3]byte{0, 144, 187}: "TAINET COMMUNICATION SYSTEM Corp.", + [3]byte{0, 144, 188}: "TELEMANN CO., LTD.", + [3]byte{0, 144, 189}: "OMNIA COMMUNICATIONS, INC.", + [3]byte{0, 144, 190}: "IBC/INTEGRATED BUSINESS COMPUTERS", + [3]byte{0, 144, 191}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 192}: "K.J. LAW ENGINEERS, INC.", + [3]byte{0, 144, 193}: "Peco II, Inc.", + [3]byte{0, 144, 194}: "JK microsystems, Inc.", + [3]byte{0, 144, 195}: "TOPIC SEMICONDUCTOR CORP.", + [3]byte{0, 144, 196}: "JAVELIN SYSTEMS, INC.", + [3]byte{0, 144, 197}: "INTERNET MAGIC, INC.", + [3]byte{0, 144, 198}: "OPTIM SYSTEMS, INC.", + [3]byte{0, 144, 199}: "ICOM INC.", + [3]byte{0, 144, 200}: "WAVERIDER COMMUNICATIONS (CANADA) INC.", + [3]byte{0, 144, 201}: "DPAC Technologies", + [3]byte{0, 144, 202}: "ACCORD VIDEO TELECOMMUNICATIONS, LTD.", + [3]byte{0, 144, 203}: "Wireless OnLine, Inc.", + [3]byte{0, 144, 204}: "Planex Communications", + [3]byte{0, 144, 205}: "ENT-EMPRESA NACIONAL DE TELECOMMUNICACOES, S.A.", + [3]byte{0, 144, 206}: "TETRA GmbH", + [3]byte{0, 144, 207}: "NORTEL", + [3]byte{0, 144, 208}: "Thomson Telecom Belgium", + [3]byte{0, 144, 209}: "LEICHU ENTERPRISE CO., LTD.", + [3]byte{0, 144, 210}: "ARTEL VIDEO SYSTEMS", + [3]byte{0, 144, 211}: "GIESECKE & DEVRIENT GmbH", + [3]byte{0, 144, 212}: "BindView Development Corp.", + [3]byte{0, 144, 213}: "EUPHONIX, INC.", + [3]byte{0, 144, 214}: "CRYSTAL GROUP", + [3]byte{0, 144, 215}: "NetBoost Corp.", + [3]byte{0, 144, 216}: "WHITECROSS SYSTEMS", + [3]byte{0, 144, 217}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 218}: "DYNARC, INC.", + [3]byte{0, 144, 219}: "NEXT LEVEL COMMUNICATIONS", + [3]byte{0, 144, 220}: "TECO INFORMATION SYSTEMS", + [3]byte{0, 144, 221}: "MIHARU COMMUNICATIONS Inc", + [3]byte{0, 144, 222}: "CARDKEY SYSTEMS, INC.", + [3]byte{0, 144, 223}: "MITSUBISHI CHEMICAL AMERICA, INC.", + [3]byte{0, 144, 224}: "SYSTRAN CORP.", + [3]byte{0, 144, 225}: "TELENA S.P.A.", + [3]byte{0, 144, 226}: "DISTRIBUTED PROCESSING TECHNOLOGY", + [3]byte{0, 144, 227}: "AVEX ELECTRONICS INC.", + [3]byte{0, 144, 228}: "NEC AMERICA, INC.", + [3]byte{0, 144, 229}: "TEKNEMA, INC.", + [3]byte{0, 144, 230}: "ALi Corporation", + [3]byte{0, 144, 231}: "HORSCH ELEKTRONIK AG", + [3]byte{0, 144, 232}: "MOXA TECHNOLOGIES CORP., LTD.", + [3]byte{0, 144, 233}: "JANZ COMPUTER AG", + [3]byte{0, 144, 234}: "ALPHA TECHNOLOGIES, INC.", + [3]byte{0, 144, 235}: "SENTRY TELECOM SYSTEMS", + [3]byte{0, 144, 236}: "PYRESCOM", + [3]byte{0, 144, 237}: "CENTRAL SYSTEM RESEARCH CO., LTD.", + [3]byte{0, 144, 238}: "PERSONAL COMMUNICATIONS TECHNOLOGIES", + [3]byte{0, 144, 239}: "INTEGRIX, INC.", + [3]byte{0, 144, 240}: "Harmonic Video Systems Ltd.", + [3]byte{0, 144, 241}: "DOT HILL SYSTEMS CORPORATION", + [3]byte{0, 144, 242}: "CISCO SYSTEMS, INC.", + [3]byte{0, 144, 243}: "ASPECT COMMUNICATIONS", + [3]byte{0, 144, 244}: "LIGHTNING INSTRUMENTATION", + [3]byte{0, 144, 245}: "CLEVO CO.", + [3]byte{0, 144, 246}: "ESCALATE NETWORKS, INC.", + [3]byte{0, 144, 247}: "NBASE COMMUNICATIONS LTD.", + [3]byte{0, 144, 248}: "MEDIATRIX TELECOM", + [3]byte{0, 144, 249}: "LEITCH", + [3]byte{0, 144, 250}: "Emulex Corporation", + [3]byte{0, 144, 251}: "PORTWELL, INC.", + [3]byte{0, 144, 252}: "NETWORK COMPUTING DEVICES", + [3]byte{0, 144, 253}: "CopperCom, Inc.", + [3]byte{0, 144, 254}: "ELECOM CO., LTD. (LANEED DIV.)", + [3]byte{0, 144, 255}: "TELLUS TECHNOLOGY INC.", + [3]byte{0, 145, 214}: "Crystal Group, Inc.", + [3]byte{0, 145, 250}: "Synapse Product Development", + [3]byte{0, 146, 250}: "SHENZHEN WISKY TECHNOLOGY CO.,LTD", + [3]byte{0, 147, 99}: "Uni-Link Technology Co., Ltd.", + [3]byte{0, 149, 105}: "LSD Science and Technology Co.,Ltd.", + [3]byte{0, 151, 255}: "Heimann Sensor GmbH", + [3]byte{0, 156, 2}: "Hewlett-Packard Company", + [3]byte{0, 157, 142}: "CARDIAC RECORDERS, INC.", + [3]byte{0, 158, 200}: "Beijing Xiaomi Electronic Products Co., Ltd.", + [3]byte{0, 160, 0}: "CENTILLION NETWORKS, INC.", + [3]byte{0, 160, 1}: "DRS Signal Solutions", + [3]byte{0, 160, 2}: "LEEDS & NORTHRUP AUSTRALIA PTY LTD", + [3]byte{0, 160, 3}: "Siemens Switzerland Ltd., I B T HVP", + [3]byte{0, 160, 4}: "NETPOWER, INC.", + [3]byte{0, 160, 5}: "DANIEL INSTRUMENTS, LTD.", + [3]byte{0, 160, 6}: "IMAGE DATA PROCESSING SYSTEM GROUP", + [3]byte{0, 160, 7}: "APEXX TECHNOLOGY, INC.", + [3]byte{0, 160, 8}: "NETCORP", + [3]byte{0, 160, 9}: "WHITETREE NETWORK", + [3]byte{0, 160, 10}: "Airspan", + [3]byte{0, 160, 11}: "COMPUTEX CO., LTD.", + [3]byte{0, 160, 12}: "KINGMAX TECHNOLOGY, INC.", + [3]byte{0, 160, 13}: "THE PANDA PROJECT", + [3]byte{0, 160, 14}: "VISUAL NETWORKS, INC.", + [3]byte{0, 160, 15}: "Broadband Technologies", + [3]byte{0, 160, 16}: "SYSLOGIC DATENTECHNIK AG", + [3]byte{0, 160, 17}: "MUTOH INDUSTRIES LTD.", + [3]byte{0, 160, 18}: "Telco Systems, Inc.", + [3]byte{0, 160, 19}: "TELTREND LTD.", + [3]byte{0, 160, 20}: "CSIR", + [3]byte{0, 160, 21}: "WYLE", + [3]byte{0, 160, 22}: "MICROPOLIS CORP.", + [3]byte{0, 160, 23}: "J B M CORPORATION", + [3]byte{0, 160, 24}: "CREATIVE CONTROLLERS, INC.", + [3]byte{0, 160, 25}: "NEBULA CONSULTANTS, INC.", + [3]byte{0, 160, 26}: "BINAR ELEKTRONIK AB", + [3]byte{0, 160, 27}: "PREMISYS COMMUNICATIONS, INC.", + [3]byte{0, 160, 28}: "NASCENT NETWORKS CORPORATION", + [3]byte{0, 160, 29}: "SIXNET", + [3]byte{0, 160, 30}: "EST CORPORATION", + [3]byte{0, 160, 31}: "TRICORD SYSTEMS, INC.", + [3]byte{0, 160, 32}: "CITICORP/TTI", + [3]byte{0, 160, 33}: "General Dynamics", + [3]byte{0, 160, 34}: "CENTRE FOR DEVELOPMENT OF ADVANCED COMPUTING", + [3]byte{0, 160, 35}: "APPLIED CREATIVE TECHNOLOGY, INC.", + [3]byte{0, 160, 36}: "3COM CORPORATION", + [3]byte{0, 160, 37}: "REDCOM LABS INC.", + [3]byte{0, 160, 38}: "TELDAT, S.A.", + [3]byte{0, 160, 39}: "FIREPOWER SYSTEMS, INC.", + [3]byte{0, 160, 40}: "CONNER PERIPHERALS", + [3]byte{0, 160, 41}: "COULTER CORPORATION", + [3]byte{0, 160, 42}: "TRANCELL SYSTEMS", + [3]byte{0, 160, 43}: "TRANSITIONS RESEARCH CORP.", + [3]byte{0, 160, 44}: "interWAVE Communications", + [3]byte{0, 160, 45}: "1394 Trade Association", + [3]byte{0, 160, 46}: "BRAND COMMUNICATIONS, LTD.", + [3]byte{0, 160, 47}: "PIRELLI CAVI", + [3]byte{0, 160, 48}: "CAPTOR NV/SA", + [3]byte{0, 160, 49}: "HAZELTINE CORPORATION, MS 1-17", + [3]byte{0, 160, 50}: "GES SINGAPORE PTE. LTD.", + [3]byte{0, 160, 51}: "imc MeBsysteme GmbH", + [3]byte{0, 160, 52}: "AXEL", + [3]byte{0, 160, 53}: "CYLINK CORPORATION", + [3]byte{0, 160, 54}: "APPLIED NETWORK TECHNOLOGY", + [3]byte{0, 160, 55}: "Mindray DS USA, Inc.", + [3]byte{0, 160, 56}: "EMAIL ELECTRONICS", + [3]byte{0, 160, 57}: "ROSS TECHNOLOGY, INC.", + [3]byte{0, 160, 58}: "KUBOTEK CORPORATION", + [3]byte{0, 160, 59}: "TOSHIN ELECTRIC CO., LTD.", + [3]byte{0, 160, 60}: "EG&G NUCLEAR INSTRUMENTS", + [3]byte{0, 160, 61}: "OPTO-22", + [3]byte{0, 160, 62}: "ATM FORUM", + [3]byte{0, 160, 63}: "COMPUTER SOCIETY MICROPROCESSOR & MICROPROCESSOR STANDARDS C", + [3]byte{0, 160, 64}: "Apple", + [3]byte{0, 160, 65}: "INFICON", + [3]byte{0, 160, 66}: "SPUR PRODUCTS CORP.", + [3]byte{0, 160, 67}: "AMERICAN TECHNOLOGY LABS, INC.", + [3]byte{0, 160, 68}: "NTT IT CO., LTD.", + [3]byte{0, 160, 69}: "PHOENIX CONTACT GMBH & CO.", + [3]byte{0, 160, 70}: "SCITEX CORP. LTD.", + [3]byte{0, 160, 71}: "INTEGRATED FITNESS CORP.", + [3]byte{0, 160, 72}: "QUESTECH, LTD.", + [3]byte{0, 160, 73}: "DIGITECH INDUSTRIES, INC.", + [3]byte{0, 160, 74}: "NISSHIN ELECTRIC CO., LTD.", + [3]byte{0, 160, 75}: "TFL LAN INC.", + [3]byte{0, 160, 76}: "INNOVATIVE SYSTEMS & TECHNOLOGIES, INC.", + [3]byte{0, 160, 77}: "EDA INSTRUMENTS, INC.", + [3]byte{0, 160, 78}: "VOELKER TECHNOLOGIES, INC.", + [3]byte{0, 160, 79}: "AMERITEC CORP.", + [3]byte{0, 160, 80}: "CYPRESS SEMICONDUCTOR", + [3]byte{0, 160, 81}: "ANGIA COMMUNICATIONS. INC.", + [3]byte{0, 160, 82}: "STANILITE ELECTRONICS PTY. LTD", + [3]byte{0, 160, 83}: "COMPACT DEVICES, INC.", + [3]byte{0, 160, 84}: "PRIVATE", + [3]byte{0, 160, 85}: "Data Device Corporation", + [3]byte{0, 160, 86}: "MICROPROSS", + [3]byte{0, 160, 87}: "LANCOM Systems GmbH", + [3]byte{0, 160, 88}: "GLORY, LTD.", + [3]byte{0, 160, 89}: "HAMILTON HALLMARK", + [3]byte{0, 160, 90}: "KOFAX IMAGE PRODUCTS", + [3]byte{0, 160, 91}: "MARQUIP, INC.", + [3]byte{0, 160, 92}: "INVENTORY CONVERSION, INC./", + [3]byte{0, 160, 93}: "CS COMPUTER SYSTEME GmbH", + [3]byte{0, 160, 94}: "MYRIAD LOGIC INC.", + [3]byte{0, 160, 95}: "BTG Electronics Design BV", + [3]byte{0, 160, 96}: "ACER PERIPHERALS, INC.", + [3]byte{0, 160, 97}: "PURITAN BENNETT", + [3]byte{0, 160, 98}: "AES PRODATA", + [3]byte{0, 160, 99}: "JRL SYSTEMS, INC.", + [3]byte{0, 160, 100}: "KVB/ANALECT", + [3]byte{0, 160, 101}: "Symantec Corporation", + [3]byte{0, 160, 102}: "ISA CO., LTD.", + [3]byte{0, 160, 103}: "NETWORK SERVICES GROUP", + [3]byte{0, 160, 104}: "BHP LIMITED", + [3]byte{0, 160, 105}: "Symmetricom, Inc.", + [3]byte{0, 160, 106}: "Verilink Corporation", + [3]byte{0, 160, 107}: "DMS DORSCH MIKROSYSTEM GMBH", + [3]byte{0, 160, 108}: "SHINDENGEN ELECTRIC MFG. CO., LTD.", + [3]byte{0, 160, 109}: "MANNESMANN TALLY CORPORATION", + [3]byte{0, 160, 110}: "AUSTRON, INC.", + [3]byte{0, 160, 111}: "THE APPCON GROUP, INC.", + [3]byte{0, 160, 112}: "COASTCOM", + [3]byte{0, 160, 113}: "VIDEO LOTTERY TECHNOLOGIES,INC", + [3]byte{0, 160, 114}: "OVATION SYSTEMS LTD.", + [3]byte{0, 160, 115}: "COM21, INC.", + [3]byte{0, 160, 116}: "PERCEPTION TECHNOLOGY", + [3]byte{0, 160, 117}: "MICRON TECHNOLOGY, INC.", + [3]byte{0, 160, 118}: "CARDWARE LAB, INC.", + [3]byte{0, 160, 119}: "FUJITSU NEXION, INC.", + [3]byte{0, 160, 120}: "Marconi Communications", + [3]byte{0, 160, 121}: "ALPS ELECTRIC (USA), INC.", + [3]byte{0, 160, 122}: "ADVANCED PERIPHERALS TECHNOLOGIES, INC.", + [3]byte{0, 160, 123}: "DAWN COMPUTER INCORPORATION", + [3]byte{0, 160, 124}: "TONYANG NYLON CO., LTD.", + [3]byte{0, 160, 125}: "SEEQ TECHNOLOGY, INC.", + [3]byte{0, 160, 126}: "AVID TECHNOLOGY, INC.", + [3]byte{0, 160, 127}: "GSM-SYNTEL, LTD.", + [3]byte{0, 160, 128}: "Tattile SRL", + [3]byte{0, 160, 129}: "ALCATEL DATA NETWORKS", + [3]byte{0, 160, 130}: "NKT ELEKTRONIK A/S", + [3]byte{0, 160, 131}: "ASIMMPHONY TURKEY", + [3]byte{0, 160, 132}: "Dataplex Pty Ltd", + [3]byte{0, 160, 133}: "PRIVATE", + [3]byte{0, 160, 134}: "AMBER WAVE SYSTEMS, INC.", + [3]byte{0, 160, 135}: "Microsemi Corporation", + [3]byte{0, 160, 136}: "ESSENTIAL COMMUNICATIONS", + [3]byte{0, 160, 137}: "XPOINT TECHNOLOGIES, INC.", + [3]byte{0, 160, 138}: "BROOKTROUT TECHNOLOGY, INC.", + [3]byte{0, 160, 139}: "ASTON ELECTRONIC DESIGNS LTD.", + [3]byte{0, 160, 140}: "MultiMedia LANs, Inc.", + [3]byte{0, 160, 141}: "JACOMO CORPORATION", + [3]byte{0, 160, 142}: "Check Point Software Technologies", + [3]byte{0, 160, 143}: "DESKNET SYSTEMS, INC.", + [3]byte{0, 160, 144}: "TimeStep Corporation", + [3]byte{0, 160, 145}: "APPLICOM INTERNATIONAL", + [3]byte{0, 160, 146}: "H. BOLLMANN MANUFACTURERS, LTD", + [3]byte{0, 160, 147}: "B/E AEROSPACE, Inc.", + [3]byte{0, 160, 148}: "COMSAT CORPORATION", + [3]byte{0, 160, 149}: "ACACIA NETWORKS, INC.", + [3]byte{0, 160, 150}: "MITSUMI ELECTRIC CO., LTD.", + [3]byte{0, 160, 151}: "JC INFORMATION SYSTEMS", + [3]byte{0, 160, 152}: "NetApp", + [3]byte{0, 160, 153}: "K-NET LTD.", + [3]byte{0, 160, 154}: "NIHON KOHDEN AMERICA", + [3]byte{0, 160, 155}: "QPSX COMMUNICATIONS, LTD.", + [3]byte{0, 160, 156}: "Xyplex, Inc.", + [3]byte{0, 160, 157}: "JOHNATHON FREEMAN TECHNOLOGIES", + [3]byte{0, 160, 158}: "ICTV", + [3]byte{0, 160, 159}: "COMMVISION CORP.", + [3]byte{0, 160, 160}: "COMPACT DATA, LTD.", + [3]byte{0, 160, 161}: "EPIC DATA INC.", + [3]byte{0, 160, 162}: "DIGICOM S.P.A.", + [3]byte{0, 160, 163}: "RELIABLE POWER METERS", + [3]byte{0, 160, 164}: "MICROS SYSTEMS, INC.", + [3]byte{0, 160, 165}: "TEKNOR MICROSYSTEME, INC.", + [3]byte{0, 160, 166}: "M.I. SYSTEMS, K.K.", + [3]byte{0, 160, 167}: "VORAX CORPORATION", + [3]byte{0, 160, 168}: "RENEX CORPORATION", + [3]byte{0, 160, 169}: "NAVTEL COMMUNICATIONS INC.", + [3]byte{0, 160, 170}: "SPACELABS MEDICAL", + [3]byte{0, 160, 171}: "NETCS INFORMATIONSTECHNIK GMBH", + [3]byte{0, 160, 172}: "GILAT SATELLITE NETWORKS, LTD.", + [3]byte{0, 160, 173}: "MARCONI SPA", + [3]byte{0, 160, 174}: "NUCOM SYSTEMS, INC.", + [3]byte{0, 160, 175}: "WMS INDUSTRIES", + [3]byte{0, 160, 176}: "I-O DATA DEVICE, INC.", + [3]byte{0, 160, 177}: "FIRST VIRTUAL CORPORATION", + [3]byte{0, 160, 178}: "SHIMA SEIKI", + [3]byte{0, 160, 179}: "ZYKRONIX", + [3]byte{0, 160, 180}: "TEXAS MICROSYSTEMS, INC.", + [3]byte{0, 160, 181}: "3H TECHNOLOGY", + [3]byte{0, 160, 182}: "SANRITZ AUTOMATION CO., LTD.", + [3]byte{0, 160, 183}: "CORDANT, INC.", + [3]byte{0, 160, 184}: "SYMBIOS LOGIC INC.", + [3]byte{0, 160, 185}: "EAGLE TECHNOLOGY, INC.", + [3]byte{0, 160, 186}: "PATTON ELECTRONICS CO.", + [3]byte{0, 160, 187}: "HILAN GMBH", + [3]byte{0, 160, 188}: "VIASAT, INCORPORATED", + [3]byte{0, 160, 189}: "I-TECH CORP.", + [3]byte{0, 160, 190}: "INTEGRATED CIRCUIT SYSTEMS, INC. COMMUNICATIONS GROUP", + [3]byte{0, 160, 191}: "WIRELESS DATA GROUP MOTOROLA", + [3]byte{0, 160, 192}: "DIGITAL LINK CORP.", + [3]byte{0, 160, 193}: "ORTIVUS MEDICAL AB", + [3]byte{0, 160, 194}: "R.A. SYSTEMS CO., LTD.", + [3]byte{0, 160, 195}: "UNICOMPUTER GMBH", + [3]byte{0, 160, 196}: "CRISTIE ELECTRONICS LTD.", + [3]byte{0, 160, 197}: "ZYXEL COMMUNICATION", + [3]byte{0, 160, 198}: "QUALCOMM INCORPORATED", + [3]byte{0, 160, 199}: "TADIRAN TELECOMMUNICATIONS", + [3]byte{0, 160, 200}: "ADTRAN INC.", + [3]byte{0, 160, 201}: "INTEL CORPORATION - HF1-06", + [3]byte{0, 160, 202}: "FUJITSU DENSO LTD.", + [3]byte{0, 160, 203}: "ARK TELECOMMUNICATIONS, INC.", + [3]byte{0, 160, 204}: "LITE-ON COMMUNICATIONS, INC.", + [3]byte{0, 160, 205}: "DR. JOHANNES HEIDENHAIN GmbH", + [3]byte{0, 160, 206}: "Ecessa", + [3]byte{0, 160, 207}: "SOTAS, INC.", + [3]byte{0, 160, 208}: "TEN X TECHNOLOGY, INC.", + [3]byte{0, 160, 209}: "INVENTEC CORPORATION", + [3]byte{0, 160, 210}: "ALLIED TELESIS INTERNATIONAL CORPORATION", + [3]byte{0, 160, 211}: "INSTEM COMPUTER SYSTEMS, LTD.", + [3]byte{0, 160, 212}: "RADIOLAN, INC.", + [3]byte{0, 160, 213}: "SIERRA WIRELESS INC.", + [3]byte{0, 160, 214}: "SBE, INC.", + [3]byte{0, 160, 215}: "KASTEN CHASE APPLIED RESEARCH", + [3]byte{0, 160, 216}: "SPECTRA - TEK", + [3]byte{0, 160, 217}: "CONVEX COMPUTER CORPORATION", + [3]byte{0, 160, 218}: "INTEGRATED SYSTEMS Technology, Inc.", + [3]byte{0, 160, 219}: "FISHER & PAYKEL PRODUCTION", + [3]byte{0, 160, 220}: "O.N. ELECTRONIC CO., LTD.", + [3]byte{0, 160, 221}: "AZONIX CORPORATION", + [3]byte{0, 160, 222}: "YAMAHA CORPORATION", + [3]byte{0, 160, 223}: "STS TECHNOLOGIES, INC.", + [3]byte{0, 160, 224}: "TENNYSON TECHNOLOGIES PTY LTD", + [3]byte{0, 160, 225}: "WESTPORT RESEARCH ASSOCIATES, INC.", + [3]byte{0, 160, 226}: "Keisokugiken Corporation", + [3]byte{0, 160, 227}: "XKL SYSTEMS CORP.", + [3]byte{0, 160, 228}: "OPTIQUEST", + [3]byte{0, 160, 229}: "NHC COMMUNICATIONS", + [3]byte{0, 160, 230}: "DIALOGIC CORPORATION", + [3]byte{0, 160, 231}: "CENTRAL DATA CORPORATION", + [3]byte{0, 160, 232}: "REUTERS HOLDINGS PLC", + [3]byte{0, 160, 233}: "ELECTRONIC RETAILING SYSTEMS INTERNATIONAL", + [3]byte{0, 160, 234}: "ETHERCOM CORP.", + [3]byte{0, 160, 235}: "Encore Networks, Inc.", + [3]byte{0, 160, 236}: "TRANSMITTON LTD.", + [3]byte{0, 160, 237}: "Brooks Automation, Inc.", + [3]byte{0, 160, 238}: "NASHOBA NETWORKS", + [3]byte{0, 160, 239}: "LUCIDATA LTD.", + [3]byte{0, 160, 240}: "TORONTO MICROELECTRONICS INC.", + [3]byte{0, 160, 241}: "MTI", + [3]byte{0, 160, 242}: "INFOTEK COMMUNICATIONS, INC.", + [3]byte{0, 160, 243}: "STAUBLI", + [3]byte{0, 160, 244}: "GE", + [3]byte{0, 160, 245}: "RADGUARD LTD.", + [3]byte{0, 160, 246}: "AutoGas Systems Inc.", + [3]byte{0, 160, 247}: "V.I COMPUTER CORP.", + [3]byte{0, 160, 248}: "SYMBOL TECHNOLOGIES, INC.", + [3]byte{0, 160, 249}: "BINTEC COMMUNICATIONS GMBH", + [3]byte{0, 160, 250}: "Marconi Communication GmbH", + [3]byte{0, 160, 251}: "TORAY ENGINEERING CO., LTD.", + [3]byte{0, 160, 252}: "IMAGE SCIENCES, INC.", + [3]byte{0, 160, 253}: "SCITEX DIGITAL PRINTING, INC.", + [3]byte{0, 160, 254}: "BOSTON TECHNOLOGY, INC.", + [3]byte{0, 160, 255}: "TELLABS OPERATIONS, INC.", + [3]byte{0, 161, 222}: "ShenZhen ShiHua Technology CO.,LTD", + [3]byte{0, 162, 218}: "INAT GmbH", + [3]byte{0, 162, 245}: "Guangzhou Yuanyun Network Technology Co.,Ltd", + [3]byte{0, 162, 255}: "abatec group AG", + [3]byte{0, 170, 0}: "INTEL CORPORATION", + [3]byte{0, 170, 1}: "INTEL CORPORATION", + [3]byte{0, 170, 2}: "INTEL CORPORATION", + [3]byte{0, 170, 60}: "OLIVETTI TELECOM SPA (OLTECO)", + [3]byte{0, 170, 112}: "LG Electronics", + [3]byte{0, 172, 224}: "ARRIS Group, Inc.", + [3]byte{0, 174, 250}: "Murata Manufacturing Co., Ltd.", + [3]byte{0, 176, 9}: "Grass Valley Group", + [3]byte{0, 176, 23}: "InfoGear Technology Corp.", + [3]byte{0, 176, 25}: "UTC CCS", + [3]byte{0, 176, 28}: "Westport Technologies", + [3]byte{0, 176, 30}: "Rantic Labs, Inc.", + [3]byte{0, 176, 42}: "ORSYS GmbH", + [3]byte{0, 176, 45}: "ViaGate Technologies, Inc.", + [3]byte{0, 176, 51}: "OAO \"Izhevskiy radiozavod\"", + [3]byte{0, 176, 59}: "HiQ Networks", + [3]byte{0, 176, 72}: "Marconi Communications Inc.", + [3]byte{0, 176, 74}: "CISCO SYSTEMS, INC.", + [3]byte{0, 176, 82}: "Atheros Communications", + [3]byte{0, 176, 100}: "CISCO SYSTEMS, INC.", + [3]byte{0, 176, 105}: "Honewell Oy", + [3]byte{0, 176, 109}: "Jones Futurex Inc.", + [3]byte{0, 176, 128}: "Mannesmann Ipulsys B.V.", + [3]byte{0, 176, 134}: "LocSoft Limited", + [3]byte{0, 176, 142}: "CISCO SYSTEMS, INC.", + [3]byte{0, 176, 145}: "Transmeta Corp.", + [3]byte{0, 176, 148}: "Alaris, Inc.", + [3]byte{0, 176, 154}: "Morrow Technologies Corp.", + [3]byte{0, 176, 157}: "Point Grey Research Inc.", + [3]byte{0, 176, 172}: "SIAE-Microelettronica S.p.A.", + [3]byte{0, 176, 174}: "Symmetricom", + [3]byte{0, 176, 179}: "Xstreamis PLC", + [3]byte{0, 176, 194}: "CISCO SYSTEMS, INC.", + [3]byte{0, 176, 199}: "Tellabs Operations, Inc.", + [3]byte{0, 176, 206}: "TECHNOLOGY RESCUE", + [3]byte{0, 176, 208}: "Dell Computer Corp.", + [3]byte{0, 176, 219}: "Nextcell, Inc.", + [3]byte{0, 176, 223}: "Starboard Storage Systems", + [3]byte{0, 176, 231}: "British Federal Ltd.", + [3]byte{0, 176, 236}: "EACEM", + [3]byte{0, 176, 238}: "Ajile Systems, Inc.", + [3]byte{0, 176, 240}: "CALY NETWORKS", + [3]byte{0, 176, 245}: "NetWorth Technologies, Inc.", + [3]byte{0, 179, 56}: "Kontron Design Manufacturing Services (M) Sdn. Bhd", + [3]byte{0, 179, 66}: "MacroSAN Technologies Co., Ltd.", + [3]byte{0, 181, 109}: "David Electronics Co., LTD.", + [3]byte{0, 181, 214}: "Omnibit Inc.", + [3]byte{0, 183, 141}: "Nanjing Shining Electric Automation Co., Ltd", + [3]byte{0, 185, 246}: "Shenzhen Super Rich Electronics Co.,Ltd", + [3]byte{0, 186, 192}: "Biometric Access Company", + [3]byte{0, 187, 1}: "OCTOTHORPE CORP.", + [3]byte{0, 187, 58}: "PRIVATE", + [3]byte{0, 187, 142}: "HME Co., Ltd.", + [3]byte{0, 187, 240}: "UNGERMANN-BASS INC.", + [3]byte{0, 189, 39}: "Exar Corp.", + [3]byte{0, 189, 58}: "Nokia Corporation", + [3]byte{0, 191, 21}: "Genetec Inc.", + [3]byte{0, 192, 0}: "LANOPTICS, LTD.", + [3]byte{0, 192, 1}: "DIATEK PATIENT MANAGMENT", + [3]byte{0, 192, 2}: "SERCOMM CORPORATION", + [3]byte{0, 192, 3}: "GLOBALNET COMMUNICATIONS", + [3]byte{0, 192, 4}: "JAPAN BUSINESS COMPUTER CO.LTD", + [3]byte{0, 192, 5}: "LIVINGSTON ENTERPRISES, INC.", + [3]byte{0, 192, 6}: "NIPPON AVIONICS CO., LTD.", + [3]byte{0, 192, 7}: "PINNACLE DATA SYSTEMS, INC.", + [3]byte{0, 192, 8}: "SECO SRL", + [3]byte{0, 192, 9}: "KT TECHNOLOGY (S) PTE LTD", + [3]byte{0, 192, 10}: "MICRO CRAFT", + [3]byte{0, 192, 11}: "NORCONTROL A.S.", + [3]byte{0, 192, 12}: "RELIA TECHNOLGIES", + [3]byte{0, 192, 13}: "ADVANCED LOGIC RESEARCH, INC.", + [3]byte{0, 192, 14}: "PSITECH, INC.", + [3]byte{0, 192, 15}: "QUANTUM SOFTWARE SYSTEMS LTD.", + [3]byte{0, 192, 16}: "HIRAKAWA HEWTECH CORP.", + [3]byte{0, 192, 17}: "INTERACTIVE COMPUTING DEVICES", + [3]byte{0, 192, 18}: "NETSPAN CORPORATION", + [3]byte{0, 192, 19}: "NETRIX", + [3]byte{0, 192, 20}: "TELEMATICS CALABASAS INT'L,INC", + [3]byte{0, 192, 21}: "NEW MEDIA CORPORATION", + [3]byte{0, 192, 22}: "ELECTRONIC THEATRE CONTROLS", + [3]byte{0, 192, 23}: "Fluke Corporation", + [3]byte{0, 192, 24}: "LANART CORPORATION", + [3]byte{0, 192, 25}: "LEAP TECHNOLOGY, INC.", + [3]byte{0, 192, 26}: "COROMETRICS MEDICAL SYSTEMS", + [3]byte{0, 192, 27}: "SOCKET COMMUNICATIONS, INC.", + [3]byte{0, 192, 28}: "INTERLINK COMMUNICATIONS LTD.", + [3]byte{0, 192, 29}: "GRAND JUNCTION NETWORKS, INC.", + [3]byte{0, 192, 30}: "LA FRANCAISE DES JEUX", + [3]byte{0, 192, 31}: "S.E.R.C.E.L.", + [3]byte{0, 192, 32}: "ARCO ELECTRONIC, CONTROL LTD.", + [3]byte{0, 192, 33}: "NETEXPRESS", + [3]byte{0, 192, 34}: "LASERMASTER TECHNOLOGIES, INC.", + [3]byte{0, 192, 35}: "TUTANKHAMON ELECTRONICS", + [3]byte{0, 192, 36}: "EDEN SISTEMAS DE COMPUTACAO SA", + [3]byte{0, 192, 37}: "DATAPRODUCTS CORPORATION", + [3]byte{0, 192, 38}: "LANS TECHNOLOGY CO., LTD.", + [3]byte{0, 192, 39}: "CIPHER SYSTEMS, INC.", + [3]byte{0, 192, 40}: "JASCO CORPORATION", + [3]byte{0, 192, 41}: "Nexans Deutschland GmbH - ANS", + [3]byte{0, 192, 42}: "OHKURA ELECTRIC CO., LTD.", + [3]byte{0, 192, 43}: "GERLOFF GESELLSCHAFT FUR", + [3]byte{0, 192, 44}: "CENTRUM COMMUNICATIONS, INC.", + [3]byte{0, 192, 45}: "FUJI PHOTO FILM CO., LTD.", + [3]byte{0, 192, 46}: "NETWIZ", + [3]byte{0, 192, 47}: "OKUMA CORPORATION", + [3]byte{0, 192, 48}: "INTEGRATED ENGINEERING B. V.", + [3]byte{0, 192, 49}: "DESIGN RESEARCH SYSTEMS, INC.", + [3]byte{0, 192, 50}: "I-CUBED LIMITED", + [3]byte{0, 192, 51}: "TELEBIT COMMUNICATIONS APS", + [3]byte{0, 192, 52}: "TRANSACTION NETWORK", + [3]byte{0, 192, 53}: "QUINTAR COMPANY", + [3]byte{0, 192, 54}: "RAYTECH ELECTRONIC CORP.", + [3]byte{0, 192, 55}: "DYNATEM", + [3]byte{0, 192, 56}: "RASTER IMAGE PROCESSING SYSTEM", + [3]byte{0, 192, 57}: "Teridian Semiconductor Corporation", + [3]byte{0, 192, 58}: "MEN-MIKRO ELEKTRONIK GMBH", + [3]byte{0, 192, 59}: "MULTIACCESS COMPUTING CORP.", + [3]byte{0, 192, 60}: "TOWER TECH S.R.L.", + [3]byte{0, 192, 61}: "WIESEMANN & THEIS GMBH", + [3]byte{0, 192, 62}: "FA. GEBR. HELLER GMBH", + [3]byte{0, 192, 63}: "STORES AUTOMATED SYSTEMS, INC.", + [3]byte{0, 192, 64}: "ECCI", + [3]byte{0, 192, 65}: "DIGITAL TRANSMISSION SYSTEMS", + [3]byte{0, 192, 66}: "DATALUX CORP.", + [3]byte{0, 192, 67}: "STRATACOM", + [3]byte{0, 192, 68}: "EMCOM CORPORATION", + [3]byte{0, 192, 69}: "ISOLATION SYSTEMS, LTD.", + [3]byte{0, 192, 70}: "Blue Chip Technology Ltd", + [3]byte{0, 192, 71}: "UNIMICRO SYSTEMS, INC.", + [3]byte{0, 192, 72}: "BAY TECHNICAL ASSOCIATES", + [3]byte{0, 192, 73}: "U.S. ROBOTICS, INC.", + [3]byte{0, 192, 74}: "GROUP 2000 AG", + [3]byte{0, 192, 75}: "CREATIVE MICROSYSTEMS", + [3]byte{0, 192, 76}: "DEPARTMENT OF FOREIGN AFFAIRS", + [3]byte{0, 192, 77}: "MITEC, INC.", + [3]byte{0, 192, 78}: "COMTROL CORPORATION", + [3]byte{0, 192, 79}: "DELL COMPUTER CORPORATION", + [3]byte{0, 192, 80}: "TOYO DENKI SEIZO K.K.", + [3]byte{0, 192, 81}: "ADVANCED INTEGRATION RESEARCH", + [3]byte{0, 192, 82}: "BURR-BROWN", + [3]byte{0, 192, 83}: "Aspect Software Inc.", + [3]byte{0, 192, 84}: "NETWORK PERIPHERALS, LTD.", + [3]byte{0, 192, 85}: "MODULAR COMPUTING TECHNOLOGIES", + [3]byte{0, 192, 86}: "SOMELEC", + [3]byte{0, 192, 87}: "MYCO ELECTRONICS", + [3]byte{0, 192, 88}: "DATAEXPERT CORP.", + [3]byte{0, 192, 89}: "DENSO CORPORATION", + [3]byte{0, 192, 90}: "SEMAPHORE COMMUNICATIONS CORP.", + [3]byte{0, 192, 91}: "NETWORKS NORTHWEST, INC.", + [3]byte{0, 192, 92}: "ELONEX PLC", + [3]byte{0, 192, 93}: "L&N TECHNOLOGIES", + [3]byte{0, 192, 94}: "VARI-LITE, INC.", + [3]byte{0, 192, 95}: "FINE-PAL COMPANY LIMITED", + [3]byte{0, 192, 96}: "ID SCANDINAVIA AS", + [3]byte{0, 192, 97}: "SOLECTEK CORPORATION", + [3]byte{0, 192, 98}: "IMPULSE TECHNOLOGY", + [3]byte{0, 192, 99}: "MORNING STAR TECHNOLOGIES, INC", + [3]byte{0, 192, 100}: "GENERAL DATACOMM IND. INC.", + [3]byte{0, 192, 101}: "SCOPE COMMUNICATIONS, INC.", + [3]byte{0, 192, 102}: "DOCUPOINT, INC.", + [3]byte{0, 192, 103}: "UNITED BARCODE INDUSTRIES", + [3]byte{0, 192, 104}: "HME Clear-Com LTD.", + [3]byte{0, 192, 105}: "Axxcelera Broadband Wireless", + [3]byte{0, 192, 106}: "ZAHNER-ELEKTRIK GMBH & CO. KG", + [3]byte{0, 192, 107}: "OSI PLUS CORPORATION", + [3]byte{0, 192, 108}: "SVEC COMPUTER CORP.", + [3]byte{0, 192, 109}: "BOCA RESEARCH, INC.", + [3]byte{0, 192, 110}: "HAFT TECHNOLOGY, INC.", + [3]byte{0, 192, 111}: "KOMATSU LTD.", + [3]byte{0, 192, 112}: "SECTRA SECURE-TRANSMISSION AB", + [3]byte{0, 192, 113}: "AREANEX COMMUNICATIONS, INC.", + [3]byte{0, 192, 114}: "KNX LTD.", + [3]byte{0, 192, 115}: "XEDIA CORPORATION", + [3]byte{0, 192, 116}: "TOYODA AUTOMATIC LOOM", + [3]byte{0, 192, 117}: "XANTE CORPORATION", + [3]byte{0, 192, 118}: "I-DATA INTERNATIONAL A-S", + [3]byte{0, 192, 119}: "DAEWOO TELECOM LTD.", + [3]byte{0, 192, 120}: "COMPUTER SYSTEMS ENGINEERING", + [3]byte{0, 192, 121}: "FONSYS CO.,LTD.", + [3]byte{0, 192, 122}: "PRIVA B.V.", + [3]byte{0, 192, 123}: "ASCEND COMMUNICATIONS, INC.", + [3]byte{0, 192, 124}: "HIGHTECH INFORMATION", + [3]byte{0, 192, 125}: "RISC DEVELOPMENTS LTD.", + [3]byte{0, 192, 126}: "KUBOTA CORPORATION ELECTRONIC", + [3]byte{0, 192, 127}: "NUPON COMPUTING CORP.", + [3]byte{0, 192, 128}: "NETSTAR, INC.", + [3]byte{0, 192, 129}: "METRODATA LTD.", + [3]byte{0, 192, 130}: "MOORE PRODUCTS CO.", + [3]byte{0, 192, 131}: "TRACE MOUNTAIN PRODUCTS, INC.", + [3]byte{0, 192, 132}: "DATA LINK CORP. LTD.", + [3]byte{0, 192, 133}: "ELECTRONICS FOR IMAGING, INC.", + [3]byte{0, 192, 134}: "THE LYNK CORPORATION", + [3]byte{0, 192, 135}: "UUNET TECHNOLOGIES, INC.", + [3]byte{0, 192, 136}: "EKF ELEKTRONIK GMBH", + [3]byte{0, 192, 137}: "TELINDUS DISTRIBUTION", + [3]byte{0, 192, 138}: "Lauterbach GmbH", + [3]byte{0, 192, 139}: "RISQ MODULAR SYSTEMS, INC.", + [3]byte{0, 192, 140}: "PERFORMANCE TECHNOLOGIES, INC.", + [3]byte{0, 192, 141}: "TRONIX PRODUCT DEVELOPMENT", + [3]byte{0, 192, 142}: "NETWORK INFORMATION TECHNOLOGY", + [3]byte{0, 192, 143}: "Panasonic Electric Works Co., Ltd.", + [3]byte{0, 192, 144}: "PRAIM S.R.L.", + [3]byte{0, 192, 145}: "JABIL CIRCUIT, INC.", + [3]byte{0, 192, 146}: "MENNEN MEDICAL INC.", + [3]byte{0, 192, 147}: "ALTA RESEARCH CORP.", + [3]byte{0, 192, 148}: "VMX INC.", + [3]byte{0, 192, 149}: "ZNYX", + [3]byte{0, 192, 150}: "TAMURA CORPORATION", + [3]byte{0, 192, 151}: "ARCHIPEL SA", + [3]byte{0, 192, 152}: "CHUNTEX ELECTRONIC CO., LTD.", + [3]byte{0, 192, 153}: "YOSHIKI INDUSTRIAL CO.,LTD.", + [3]byte{0, 192, 154}: "PHOTONICS CORPORATION", + [3]byte{0, 192, 155}: "RELIANCE COMM/TEC, R-TEC", + [3]byte{0, 192, 156}: "HIOKI E.E. CORPORATION", + [3]byte{0, 192, 157}: "DISTRIBUTED SYSTEMS INT'L, INC", + [3]byte{0, 192, 158}: "CACHE COMPUTERS, INC.", + [3]byte{0, 192, 159}: "QUANTA COMPUTER, INC.", + [3]byte{0, 192, 160}: "ADVANCE MICRO RESEARCH, INC.", + [3]byte{0, 192, 161}: "TOKYO DENSHI SEKEI CO.", + [3]byte{0, 192, 162}: "INTERMEDIUM A/S", + [3]byte{0, 192, 163}: "DUAL ENTERPRISES CORPORATION", + [3]byte{0, 192, 164}: "UNIGRAF OY", + [3]byte{0, 192, 165}: "DICKENS DATA SYSTEMS", + [3]byte{0, 192, 166}: "EXICOM AUSTRALIA PTY. LTD", + [3]byte{0, 192, 167}: "SEEL LTD.", + [3]byte{0, 192, 168}: "GVC CORPORATION", + [3]byte{0, 192, 169}: "BARRON MCCANN LTD.", + [3]byte{0, 192, 170}: "SILICON VALLEY COMPUTER", + [3]byte{0, 192, 171}: "Telco Systems, Inc.", + [3]byte{0, 192, 172}: "GAMBIT COMPUTER COMMUNICATIONS", + [3]byte{0, 192, 173}: "MARBEN COMMUNICATION SYSTEMS", + [3]byte{0, 192, 174}: "TOWERCOM CO. INC. DBA PC HOUSE", + [3]byte{0, 192, 175}: "TEKLOGIX INC.", + [3]byte{0, 192, 176}: "GCC TECHNOLOGIES,INC.", + [3]byte{0, 192, 177}: "GENIUS NET CO.", + [3]byte{0, 192, 178}: "NORAND CORPORATION", + [3]byte{0, 192, 179}: "COMSTAT DATACOMM CORPORATION", + [3]byte{0, 192, 180}: "MYSON TECHNOLOGY, INC.", + [3]byte{0, 192, 181}: "CORPORATE NETWORK SYSTEMS,INC.", + [3]byte{0, 192, 182}: "Overland Storage, Inc.", + [3]byte{0, 192, 183}: "AMERICAN POWER CONVERSION CORP", + [3]byte{0, 192, 184}: "FRASER'S HILL LTD.", + [3]byte{0, 192, 185}: "FUNK SOFTWARE, INC.", + [3]byte{0, 192, 186}: "NETVANTAGE", + [3]byte{0, 192, 187}: "FORVAL CREATIVE, INC.", + [3]byte{0, 192, 188}: "TELECOM AUSTRALIA/CSSC", + [3]byte{0, 192, 189}: "INEX TECHNOLOGIES, INC.", + [3]byte{0, 192, 190}: "ALCATEL - SEL", + [3]byte{0, 192, 191}: "TECHNOLOGY CONCEPTS, LTD.", + [3]byte{0, 192, 192}: "SHORE MICROSYSTEMS, INC.", + [3]byte{0, 192, 193}: "QUAD/GRAPHICS, INC.", + [3]byte{0, 192, 194}: "INFINITE NETWORKS LTD.", + [3]byte{0, 192, 195}: "ACUSON COMPUTED SONOGRAPHY", + [3]byte{0, 192, 196}: "COMPUTER OPERATIONAL", + [3]byte{0, 192, 197}: "SID INFORMATICA", + [3]byte{0, 192, 198}: "PERSONAL MEDIA CORP.", + [3]byte{0, 192, 199}: "SPARKTRUM MICROSYSTEMS, INC.", + [3]byte{0, 192, 200}: "MICRO BYTE PTY. LTD.", + [3]byte{0, 192, 201}: "ELSAG BAILEY PROCESS", + [3]byte{0, 192, 202}: "ALFA, INC.", + [3]byte{0, 192, 203}: "CONTROL TECHNOLOGY CORPORATION", + [3]byte{0, 192, 204}: "TELESCIENCES CO SYSTEMS, INC.", + [3]byte{0, 192, 205}: "COMELTA, S.A.", + [3]byte{0, 192, 206}: "CEI SYSTEMS & ENGINEERING PTE", + [3]byte{0, 192, 207}: "IMATRAN VOIMA OY", + [3]byte{0, 192, 208}: "RATOC SYSTEM INC.", + [3]byte{0, 192, 209}: "COMTREE TECHNOLOGY CORPORATION", + [3]byte{0, 192, 210}: "SYNTELLECT, INC.", + [3]byte{0, 192, 211}: "OLYMPUS IMAGE SYSTEMS, INC.", + [3]byte{0, 192, 212}: "AXON NETWORKS, INC.", + [3]byte{0, 192, 213}: "Werbeagentur Jürgen Siebert", + [3]byte{0, 192, 214}: "J1 SYSTEMS, INC.", + [3]byte{0, 192, 215}: "TAIWAN TRADING CENTER DBA", + [3]byte{0, 192, 216}: "UNIVERSAL DATA SYSTEMS", + [3]byte{0, 192, 217}: "QUINTE NETWORK CONFIDENTIALITY", + [3]byte{0, 192, 218}: "NICE SYSTEMS LTD.", + [3]byte{0, 192, 219}: "IPC CORPORATION (PTE) LTD.", + [3]byte{0, 192, 220}: "EOS TECHNOLOGIES, INC.", + [3]byte{0, 192, 221}: "QLogic Corporation", + [3]byte{0, 192, 222}: "ZCOMM, INC.", + [3]byte{0, 192, 223}: "KYE Systems Corp.", + [3]byte{0, 192, 224}: "DSC COMMUNICATION CORP.", + [3]byte{0, 192, 225}: "SONIC SOLUTIONS", + [3]byte{0, 192, 226}: "CALCOMP, INC.", + [3]byte{0, 192, 227}: "OSITECH COMMUNICATIONS, INC.", + [3]byte{0, 192, 228}: "SIEMENS BUILDING", + [3]byte{0, 192, 229}: "GESPAC, S.A.", + [3]byte{0, 192, 230}: "Verilink Corporation", + [3]byte{0, 192, 231}: "FIBERDATA AB", + [3]byte{0, 192, 232}: "PLEXCOM, INC.", + [3]byte{0, 192, 233}: "OAK SOLUTIONS, LTD.", + [3]byte{0, 192, 234}: "ARRAY TECHNOLOGY LTD.", + [3]byte{0, 192, 235}: "SEH COMPUTERTECHNIK GMBH", + [3]byte{0, 192, 236}: "DAUPHIN TECHNOLOGY", + [3]byte{0, 192, 237}: "US ARMY ELECTRONIC", + [3]byte{0, 192, 238}: "KYOCERA CORPORATION", + [3]byte{0, 192, 239}: "ABIT CORPORATION", + [3]byte{0, 192, 240}: "KINGSTON TECHNOLOGY CORP.", + [3]byte{0, 192, 241}: "SHINKO ELECTRIC CO., LTD.", + [3]byte{0, 192, 242}: "TRANSITION NETWORKS", + [3]byte{0, 192, 243}: "NETWORK COMMUNICATIONS CORP.", + [3]byte{0, 192, 244}: "INTERLINK SYSTEM CO., LTD.", + [3]byte{0, 192, 245}: "METACOMP, INC.", + [3]byte{0, 192, 246}: "CELAN TECHNOLOGY INC.", + [3]byte{0, 192, 247}: "ENGAGE COMMUNICATION, INC.", + [3]byte{0, 192, 248}: "ABOUT COMPUTING INC.", + [3]byte{0, 192, 249}: "Artesyn Embedded Technologies", + [3]byte{0, 192, 250}: "CANARY COMMUNICATIONS, INC.", + [3]byte{0, 192, 251}: "ADVANCED TECHNOLOGY LABS", + [3]byte{0, 192, 252}: "ELASTIC REALITY, INC.", + [3]byte{0, 192, 253}: "PROSUM", + [3]byte{0, 192, 254}: "APTEC COMPUTER SYSTEMS, INC.", + [3]byte{0, 192, 255}: "DOT HILL SYSTEMS CORPORATION", + [3]byte{0, 193, 79}: "DDL Co,.ltd.", + [3]byte{0, 194, 198}: "Intel Corporate", + [3]byte{0, 197, 219}: "Datatech Sistemas Digitales Avanzados SL", + [3]byte{0, 198, 16}: "Apple", + [3]byte{0, 203, 189}: "Cambridge Broadband Networks Ltd.", + [3]byte{0, 205, 144}: "MAS Elektronik AG", + [3]byte{0, 207, 28}: "COMMUNICATION MACHINERY CORP.", + [3]byte{0, 208, 0}: "FERRAN SCIENTIFIC, INC.", + [3]byte{0, 208, 1}: "VST TECHNOLOGIES, INC.", + [3]byte{0, 208, 2}: "DITECH CORPORATION", + [3]byte{0, 208, 3}: "COMDA ENTERPRISES CORP.", + [3]byte{0, 208, 4}: "PENTACOM LTD.", + [3]byte{0, 208, 5}: "ZHS ZEITMANAGEMENTSYSTEME", + [3]byte{0, 208, 6}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 7}: "MIC ASSOCIATES, INC.", + [3]byte{0, 208, 8}: "MACTELL CORPORATION", + [3]byte{0, 208, 9}: "HSING TECH. ENTERPRISE CO. LTD", + [3]byte{0, 208, 10}: "LANACCESS TELECOM S.A.", + [3]byte{0, 208, 11}: "RHK TECHNOLOGY, INC.", + [3]byte{0, 208, 12}: "SNIJDER MICRO SYSTEMS", + [3]byte{0, 208, 13}: "MICROMERITICS INSTRUMENT", + [3]byte{0, 208, 14}: "PLURIS, INC.", + [3]byte{0, 208, 15}: "SPEECH DESIGN GMBH", + [3]byte{0, 208, 16}: "CONVERGENT NETWORKS, INC.", + [3]byte{0, 208, 17}: "PRISM VIDEO, INC.", + [3]byte{0, 208, 18}: "GATEWORKS CORP.", + [3]byte{0, 208, 19}: "PRIMEX AEROSPACE COMPANY", + [3]byte{0, 208, 20}: "ROOT, INC.", + [3]byte{0, 208, 21}: "UNIVEX MICROTECHNOLOGY CORP.", + [3]byte{0, 208, 22}: "SCM MICROSYSTEMS, INC.", + [3]byte{0, 208, 23}: "SYNTECH INFORMATION CO., LTD.", + [3]byte{0, 208, 24}: "QWES. COM, INC.", + [3]byte{0, 208, 25}: "DAINIPPON SCREEN CORPORATE", + [3]byte{0, 208, 26}: "URMET TLC S.P.A.", + [3]byte{0, 208, 27}: "MIMAKI ENGINEERING CO., LTD.", + [3]byte{0, 208, 28}: "SBS TECHNOLOGIES,", + [3]byte{0, 208, 29}: "FURUNO ELECTRIC CO., LTD.", + [3]byte{0, 208, 30}: "PINGTEL CORP.", + [3]byte{0, 208, 31}: "Senetas Security", + [3]byte{0, 208, 32}: "AIM SYSTEM, INC.", + [3]byte{0, 208, 33}: "REGENT ELECTRONICS CORP.", + [3]byte{0, 208, 34}: "INCREDIBLE TECHNOLOGIES, INC.", + [3]byte{0, 208, 35}: "INFORTREND TECHNOLOGY, INC.", + [3]byte{0, 208, 36}: "Cognex Corporation", + [3]byte{0, 208, 37}: "XROSSTECH, INC.", + [3]byte{0, 208, 38}: "HIRSCHMANN AUSTRIA GMBH", + [3]byte{0, 208, 39}: "APPLIED AUTOMATION, INC.", + [3]byte{0, 208, 40}: "Harmonic, Inc", + [3]byte{0, 208, 41}: "WAKEFERN FOOD CORPORATION", + [3]byte{0, 208, 42}: "Voxent Systems Ltd.", + [3]byte{0, 208, 43}: "JETCELL, INC.", + [3]byte{0, 208, 44}: "CAMPBELL SCIENTIFIC, INC.", + [3]byte{0, 208, 45}: "ADEMCO", + [3]byte{0, 208, 46}: "COMMUNICATION AUTOMATION CORP.", + [3]byte{0, 208, 47}: "VLSI TECHNOLOGY INC.", + [3]byte{0, 208, 48}: "Safetran Systems Corp", + [3]byte{0, 208, 49}: "INDUSTRIAL LOGIC CORPORATION", + [3]byte{0, 208, 50}: "YANO ELECTRIC CO., LTD.", + [3]byte{0, 208, 51}: "DALIAN DAXIAN NETWORK", + [3]byte{0, 208, 52}: "ORMEC SYSTEMS CORP.", + [3]byte{0, 208, 53}: "BEHAVIOR TECH. COMPUTER CORP.", + [3]byte{0, 208, 54}: "TECHNOLOGY ATLANTA CORP.", + [3]byte{0, 208, 55}: "Pace France", + [3]byte{0, 208, 56}: "FIVEMERE, LTD.", + [3]byte{0, 208, 57}: "UTILICOM, INC.", + [3]byte{0, 208, 58}: "ZONEWORX, INC.", + [3]byte{0, 208, 59}: "VISION PRODUCTS PTY. LTD.", + [3]byte{0, 208, 60}: "Vieo, Inc.", + [3]byte{0, 208, 61}: "GALILEO TECHNOLOGY, LTD.", + [3]byte{0, 208, 62}: "ROCKETCHIPS, INC.", + [3]byte{0, 208, 63}: "AMERICAN COMMUNICATION", + [3]byte{0, 208, 64}: "SYSMATE CO., LTD.", + [3]byte{0, 208, 65}: "AMIGO TECHNOLOGY CO., LTD.", + [3]byte{0, 208, 66}: "MAHLO GMBH & CO. UG", + [3]byte{0, 208, 67}: "ZONAL RETAIL DATA SYSTEMS", + [3]byte{0, 208, 68}: "ALIDIAN NETWORKS, INC.", + [3]byte{0, 208, 69}: "KVASER AB", + [3]byte{0, 208, 70}: "DOLBY LABORATORIES, INC.", + [3]byte{0, 208, 71}: "XN TECHNOLOGIES", + [3]byte{0, 208, 72}: "ECTON, INC.", + [3]byte{0, 208, 73}: "IMPRESSTEK CO., LTD.", + [3]byte{0, 208, 74}: "PRESENCE TECHNOLOGY GMBH", + [3]byte{0, 208, 75}: "LA CIE GROUP S.A.", + [3]byte{0, 208, 76}: "EUROTEL TELECOM LTD.", + [3]byte{0, 208, 77}: "DIV OF RESEARCH & STATISTICS", + [3]byte{0, 208, 78}: "LOGIBAG", + [3]byte{0, 208, 79}: "BITRONICS, INC.", + [3]byte{0, 208, 80}: "ISKRATEL", + [3]byte{0, 208, 81}: "O2 MICRO, INC.", + [3]byte{0, 208, 82}: "ASCEND COMMUNICATIONS, INC.", + [3]byte{0, 208, 83}: "CONNECTED SYSTEMS", + [3]byte{0, 208, 84}: "SAS INSTITUTE INC.", + [3]byte{0, 208, 85}: "KATHREIN-WERKE KG", + [3]byte{0, 208, 86}: "SOMAT CORPORATION", + [3]byte{0, 208, 87}: "ULTRAK, INC.", + [3]byte{0, 208, 88}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 89}: "AMBIT MICROSYSTEMS CORP.", + [3]byte{0, 208, 90}: "SYMBIONICS, LTD.", + [3]byte{0, 208, 91}: "ACROLOOP MOTION CONTROL", + [3]byte{0, 208, 92}: "TECHNOTREND SYSTEMTECHNIK GMBH", + [3]byte{0, 208, 93}: "INTELLIWORXX, INC.", + [3]byte{0, 208, 94}: "STRATABEAM TECHNOLOGY, INC.", + [3]byte{0, 208, 95}: "VALCOM, INC.", + [3]byte{0, 208, 96}: "Panasonic Europe Ltd.", + [3]byte{0, 208, 97}: "TREMON ENTERPRISES CO., LTD.", + [3]byte{0, 208, 98}: "DIGIGRAM", + [3]byte{0, 208, 99}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 100}: "MULTITEL", + [3]byte{0, 208, 101}: "TOKO ELECTRIC", + [3]byte{0, 208, 102}: "WINTRISS ENGINEERING CORP.", + [3]byte{0, 208, 103}: "CAMPIO COMMUNICATIONS", + [3]byte{0, 208, 104}: "IWILL CORPORATION", + [3]byte{0, 208, 105}: "TECHNOLOGIC SYSTEMS", + [3]byte{0, 208, 106}: "LINKUP SYSTEMS CORPORATION", + [3]byte{0, 208, 107}: "SR TELECOM INC.", + [3]byte{0, 208, 108}: "SHAREWAVE, INC.", + [3]byte{0, 208, 109}: "ACRISON, INC.", + [3]byte{0, 208, 110}: "TRENDVIEW RECORDERS LTD.", + [3]byte{0, 208, 111}: "KMC CONTROLS", + [3]byte{0, 208, 112}: "LONG WELL ELECTRONICS CORP.", + [3]byte{0, 208, 113}: "ECHELON CORP.", + [3]byte{0, 208, 114}: "BROADLOGIC", + [3]byte{0, 208, 115}: "ACN ADVANCED COMMUNICATIONS", + [3]byte{0, 208, 116}: "TAQUA SYSTEMS, INC.", + [3]byte{0, 208, 117}: "ALARIS MEDICAL SYSTEMS, INC.", + [3]byte{0, 208, 118}: "Bank of America", + [3]byte{0, 208, 119}: "LUCENT TECHNOLOGIES", + [3]byte{0, 208, 120}: "Eltex of Sweden AB", + [3]byte{0, 208, 121}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 122}: "AMAQUEST COMPUTER CORP.", + [3]byte{0, 208, 123}: "COMCAM INTERNATIONAL INC", + [3]byte{0, 208, 124}: "KOYO ELECTRONICS INC. CO.,LTD.", + [3]byte{0, 208, 125}: "COSINE COMMUNICATIONS", + [3]byte{0, 208, 126}: "KEYCORP LTD.", + [3]byte{0, 208, 127}: "STRATEGY & TECHNOLOGY, LIMITED", + [3]byte{0, 208, 128}: "EXABYTE CORPORATION", + [3]byte{0, 208, 129}: "RTD Embedded Technologies, Inc.", + [3]byte{0, 208, 130}: "IOWAVE INC.", + [3]byte{0, 208, 131}: "INVERTEX, INC.", + [3]byte{0, 208, 132}: "NEXCOMM SYSTEMS, INC.", + [3]byte{0, 208, 133}: "OTIS ELEVATOR COMPANY", + [3]byte{0, 208, 134}: "FOVEON, INC.", + [3]byte{0, 208, 135}: "MICROFIRST INC.", + [3]byte{0, 208, 136}: "ARRIS Group, Inc.", + [3]byte{0, 208, 137}: "DYNACOLOR, INC.", + [3]byte{0, 208, 138}: "PHOTRON USA", + [3]byte{0, 208, 139}: "ADVA Optical Networking Ltd.", + [3]byte{0, 208, 140}: "GENOA TECHNOLOGY, INC.", + [3]byte{0, 208, 141}: "PHOENIX GROUP, INC.", + [3]byte{0, 208, 142}: "NVISION INC.", + [3]byte{0, 208, 143}: "ARDENT TECHNOLOGIES, INC.", + [3]byte{0, 208, 144}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 145}: "SMARTSAN SYSTEMS, INC.", + [3]byte{0, 208, 146}: "GLENAYRE WESTERN MULTIPLEX", + [3]byte{0, 208, 147}: "TQ - COMPONENTS GMBH", + [3]byte{0, 208, 148}: "TIMELINE VISTA, INC.", + [3]byte{0, 208, 149}: "Alcatel-Lucent, Enterprise Business Group", + [3]byte{0, 208, 150}: "3COM EUROPE LTD.", + [3]byte{0, 208, 151}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 152}: "Photon Dynamics Canada Inc.", + [3]byte{0, 208, 153}: "Elcard Wireless Systems Oy", + [3]byte{0, 208, 154}: "FILANET CORPORATION", + [3]byte{0, 208, 155}: "SPECTEL LTD.", + [3]byte{0, 208, 156}: "KAPADIA COMMUNICATIONS", + [3]byte{0, 208, 157}: "VERIS INDUSTRIES", + [3]byte{0, 208, 158}: "2WIRE, INC.", + [3]byte{0, 208, 159}: "NOVTEK TEST SYSTEMS", + [3]byte{0, 208, 160}: "MIPS DENMARK", + [3]byte{0, 208, 161}: "OSKAR VIERLING GMBH + CO. KG", + [3]byte{0, 208, 162}: "INTEGRATED DEVICE", + [3]byte{0, 208, 163}: "VOCAL DATA, INC.", + [3]byte{0, 208, 164}: "ALANTRO COMMUNICATIONS", + [3]byte{0, 208, 165}: "AMERICAN ARIUM", + [3]byte{0, 208, 166}: "LANBIRD TECHNOLOGY CO., LTD.", + [3]byte{0, 208, 167}: "TOKYO SOKKI KENKYUJO CO., LTD.", + [3]byte{0, 208, 168}: "NETWORK ENGINES, INC.", + [3]byte{0, 208, 169}: "SHINANO KENSHI CO., LTD.", + [3]byte{0, 208, 170}: "CHASE COMMUNICATIONS", + [3]byte{0, 208, 171}: "DELTAKABEL TELECOM CV", + [3]byte{0, 208, 172}: "GRAYSON WIRELESS", + [3]byte{0, 208, 173}: "TL INDUSTRIES", + [3]byte{0, 208, 174}: "ORESIS COMMUNICATIONS, INC.", + [3]byte{0, 208, 175}: "CUTLER-HAMMER, INC.", + [3]byte{0, 208, 176}: "BITSWITCH LTD.", + [3]byte{0, 208, 177}: "OMEGA ELECTRONICS SA", + [3]byte{0, 208, 178}: "XIOTECH CORPORATION", + [3]byte{0, 208, 179}: "DRS Technologies Canada Ltd", + [3]byte{0, 208, 180}: "KATSUJIMA CO., LTD.", + [3]byte{0, 208, 181}: "IPricot formerly DotCom", + [3]byte{0, 208, 182}: "CRESCENT NETWORKS, INC.", + [3]byte{0, 208, 183}: "INTEL CORPORATION", + [3]byte{0, 208, 184}: "Iomega Corporation", + [3]byte{0, 208, 185}: "MICROTEK INTERNATIONAL, INC.", + [3]byte{0, 208, 186}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 187}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 188}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 189}: "Silicon Image GmbH", + [3]byte{0, 208, 190}: "EMUTEC INC.", + [3]byte{0, 208, 191}: "PIVOTAL TECHNOLOGIES", + [3]byte{0, 208, 192}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 193}: "HARMONIC DATA SYSTEMS, LTD.", + [3]byte{0, 208, 194}: "BALTHAZAR TECHNOLOGY AB", + [3]byte{0, 208, 195}: "VIVID TECHNOLOGY PTE, LTD.", + [3]byte{0, 208, 196}: "TERATECH CORPORATION", + [3]byte{0, 208, 197}: "COMPUTATIONAL SYSTEMS, INC.", + [3]byte{0, 208, 198}: "THOMAS & BETTS CORP.", + [3]byte{0, 208, 199}: "PATHWAY, INC.", + [3]byte{0, 208, 200}: "Prevas A/S", + [3]byte{0, 208, 201}: "ADVANTECH CO., LTD.", + [3]byte{0, 208, 202}: "Intrinsyc Software International Inc.", + [3]byte{0, 208, 203}: "DASAN CO., LTD.", + [3]byte{0, 208, 204}: "TECHNOLOGIES LYRE INC.", + [3]byte{0, 208, 205}: "ATAN TECHNOLOGY INC.", + [3]byte{0, 208, 206}: "ASYST ELECTRONIC", + [3]byte{0, 208, 207}: "MORETON BAY", + [3]byte{0, 208, 208}: "ZHONGXING TELECOM LTD.", + [3]byte{0, 208, 209}: "Sycamore Networks", + [3]byte{0, 208, 210}: "EPILOG CORPORATION", + [3]byte{0, 208, 211}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 212}: "V-BITS, INC.", + [3]byte{0, 208, 213}: "GRUNDIG AG", + [3]byte{0, 208, 214}: "AETHRA TELECOMUNICAZIONI", + [3]byte{0, 208, 215}: "B2C2, INC.", + [3]byte{0, 208, 216}: "3Com Corporation", + [3]byte{0, 208, 217}: "DEDICATED MICROCOMPUTERS", + [3]byte{0, 208, 218}: "TAICOM DATA SYSTEMS CO., LTD.", + [3]byte{0, 208, 219}: "MCQUAY INTERNATIONAL", + [3]byte{0, 208, 220}: "MODULAR MINING SYSTEMS, INC.", + [3]byte{0, 208, 221}: "SUNRISE TELECOM, INC.", + [3]byte{0, 208, 222}: "PHILIPS MULTIMEDIA NETWORK", + [3]byte{0, 208, 223}: "KUZUMI ELECTRONICS, INC.", + [3]byte{0, 208, 224}: "DOOIN ELECTRONICS CO.", + [3]byte{0, 208, 225}: "AVIONITEK ISRAEL INC.", + [3]byte{0, 208, 226}: "MRT MICRO, INC.", + [3]byte{0, 208, 227}: "ELE-CHEM ENGINEERING CO., LTD.", + [3]byte{0, 208, 228}: "CISCO SYSTEMS, INC.", + [3]byte{0, 208, 229}: "SOLIDUM SYSTEMS CORP.", + [3]byte{0, 208, 230}: "IBOND INC.", + [3]byte{0, 208, 231}: "VCON TELECOMMUNICATION LTD.", + [3]byte{0, 208, 232}: "MAC SYSTEM CO., LTD.", + [3]byte{0, 208, 233}: "Advantage Century Telecommunication Corp.", + [3]byte{0, 208, 234}: "NEXTONE COMMUNICATIONS, INC.", + [3]byte{0, 208, 235}: "LIGHTERA NETWORKS, INC.", + [3]byte{0, 208, 236}: "NAKAYO TELECOMMUNICATIONS, INC", + [3]byte{0, 208, 237}: "XIOX", + [3]byte{0, 208, 238}: "DICTAPHONE CORPORATION", + [3]byte{0, 208, 239}: "IGT", + [3]byte{0, 208, 240}: "CONVISION TECHNOLOGY GMBH", + [3]byte{0, 208, 241}: "SEGA ENTERPRISES, LTD.", + [3]byte{0, 208, 242}: "MONTEREY NETWORKS", + [3]byte{0, 208, 243}: "SOLARI DI UDINE SPA", + [3]byte{0, 208, 244}: "CARINTHIAN TECH INSTITUTE", + [3]byte{0, 208, 245}: "ORANGE MICRO, INC.", + [3]byte{0, 208, 246}: "Alcatel Canada", + [3]byte{0, 208, 247}: "NEXT NETS CORPORATION", + [3]byte{0, 208, 248}: "FUJIAN STAR TERMINAL", + [3]byte{0, 208, 249}: "ACUTE COMMUNICATIONS CORP.", + [3]byte{0, 208, 250}: "Thales e-Security Ltd.", + [3]byte{0, 208, 251}: "TEK MICROSYSTEMS, INCORPORATED", + [3]byte{0, 208, 252}: "GRANITE MICROSYSTEMS", + [3]byte{0, 208, 253}: "OPTIMA TELE.COM, INC.", + [3]byte{0, 208, 254}: "ASTRAL POINT", + [3]byte{0, 208, 255}: "CISCO SYSTEMS, INC.", + [3]byte{0, 209, 28}: "ACETEL", + [3]byte{0, 211, 141}: "Hotel Technology Next Generation", + [3]byte{0, 214, 50}: "GE Energy", + [3]byte{0, 217, 209}: "Sony Computer Entertainment Inc.", + [3]byte{0, 219, 30}: "Albedo Telecom SL", + [3]byte{0, 219, 69}: "THAMWAY CO.,LTD.", + [3]byte{0, 219, 223}: "Intel Corporate", + [3]byte{0, 221, 0}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 1}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 2}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 3}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 4}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 5}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 6}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 7}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 8}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 9}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 10}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 11}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 12}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 13}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 14}: "UNGERMANN-BASS INC.", + [3]byte{0, 221, 15}: "UNGERMANN-BASS INC.", + [3]byte{0, 222, 251}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 0}: "Fujitsu Limited", + [3]byte{0, 224, 1}: "STRAND LIGHTING LIMITED", + [3]byte{0, 224, 2}: "CROSSROADS SYSTEMS, INC.", + [3]byte{0, 224, 3}: "NOKIA WIRELESS BUSINESS COMMUN", + [3]byte{0, 224, 4}: "PMC-SIERRA, INC.", + [3]byte{0, 224, 5}: "TECHNICAL CORP.", + [3]byte{0, 224, 6}: "SILICON INTEGRATED SYS. CORP.", + [3]byte{0, 224, 7}: "Avaya ECS Ltd", + [3]byte{0, 224, 8}: "AMAZING CONTROLS! INC.", + [3]byte{0, 224, 9}: "MARATHON TECHNOLOGIES CORP.", + [3]byte{0, 224, 10}: "DIBA, INC.", + [3]byte{0, 224, 11}: "ROOFTOP COMMUNICATIONS CORP.", + [3]byte{0, 224, 12}: "MOTOROLA", + [3]byte{0, 224, 13}: "RADIANT SYSTEMS", + [3]byte{0, 224, 14}: "AVALON IMAGING SYSTEMS, INC.", + [3]byte{0, 224, 15}: "SHANGHAI BAUD DATA", + [3]byte{0, 224, 16}: "HESS SB-AUTOMATENBAU GmbH", + [3]byte{0, 224, 17}: "Uniden Corporation", + [3]byte{0, 224, 18}: "PLUTO TECHNOLOGIES INTERNATIONAL INC.", + [3]byte{0, 224, 19}: "EASTERN ELECTRONIC CO., LTD.", + [3]byte{0, 224, 20}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 21}: "HEIWA CORPORATION", + [3]byte{0, 224, 22}: "RAPID CITY COMMUNICATIONS", + [3]byte{0, 224, 23}: "EXXACT GmbH", + [3]byte{0, 224, 24}: "ASUSTEK COMPUTER INC.", + [3]byte{0, 224, 25}: "ING. GIORDANO ELETTRONICA", + [3]byte{0, 224, 26}: "COMTEC SYSTEMS. CO., LTD.", + [3]byte{0, 224, 27}: "SPHERE COMMUNICATIONS, INC.", + [3]byte{0, 224, 28}: "Cradlepoint, Inc", + [3]byte{0, 224, 29}: "WebTV NETWORKS, INC.", + [3]byte{0, 224, 30}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 31}: "AVIDIA Systems, Inc.", + [3]byte{0, 224, 32}: "TECNOMEN OY", + [3]byte{0, 224, 33}: "FREEGATE CORP.", + [3]byte{0, 224, 34}: "Analog Devices Inc.", + [3]byte{0, 224, 35}: "TELRAD", + [3]byte{0, 224, 36}: "GADZOOX NETWORKS", + [3]byte{0, 224, 37}: "dit Co., Ltd.", + [3]byte{0, 224, 38}: "Redlake MASD LLC", + [3]byte{0, 224, 39}: "DUX, INC.", + [3]byte{0, 224, 40}: "APTIX CORPORATION", + [3]byte{0, 224, 41}: "STANDARD MICROSYSTEMS CORP.", + [3]byte{0, 224, 42}: "TANDBERG TELEVISION AS", + [3]byte{0, 224, 43}: "EXTREME NETWORKS", + [3]byte{0, 224, 44}: "AST COMPUTER", + [3]byte{0, 224, 45}: "InnoMediaLogic, Inc.", + [3]byte{0, 224, 46}: "SPC ELECTRONICS CORPORATION", + [3]byte{0, 224, 47}: "MCNS HOLDINGS, L.P.", + [3]byte{0, 224, 48}: "MELITA INTERNATIONAL CORP.", + [3]byte{0, 224, 49}: "HAGIWARA ELECTRIC CO., LTD.", + [3]byte{0, 224, 50}: "MISYS FINANCIAL SYSTEMS, LTD.", + [3]byte{0, 224, 51}: "E.E.P.D. GmbH", + [3]byte{0, 224, 52}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 53}: "Artesyn Embedded Technologies", + [3]byte{0, 224, 54}: "PIONEER CORPORATION", + [3]byte{0, 224, 55}: "CENTURY CORPORATION", + [3]byte{0, 224, 56}: "PROXIMA CORPORATION", + [3]byte{0, 224, 57}: "PARADYNE CORP.", + [3]byte{0, 224, 58}: "CABLETRON SYSTEMS, INC.", + [3]byte{0, 224, 59}: "PROMINET CORPORATION", + [3]byte{0, 224, 60}: "AdvanSys", + [3]byte{0, 224, 61}: "FOCON ELECTRONIC SYSTEMS A/S", + [3]byte{0, 224, 62}: "ALFATECH, INC.", + [3]byte{0, 224, 63}: "JATON CORPORATION", + [3]byte{0, 224, 64}: "DeskStation Technology, Inc.", + [3]byte{0, 224, 65}: "CSPI", + [3]byte{0, 224, 66}: "Pacom Systems Ltd.", + [3]byte{0, 224, 67}: "VitalCom", + [3]byte{0, 224, 68}: "LSICS CORPORATION", + [3]byte{0, 224, 69}: "TOUCHWAVE, INC.", + [3]byte{0, 224, 70}: "BENTLY NEVADA CORP.", + [3]byte{0, 224, 71}: "InFocus Corporation", + [3]byte{0, 224, 72}: "SDL COMMUNICATIONS, INC.", + [3]byte{0, 224, 73}: "MICROWI ELECTRONIC GmbH", + [3]byte{0, 224, 74}: "ENHANCED MESSAGING SYSTEMS, INC", + [3]byte{0, 224, 75}: "JUMP INDUSTRIELLE COMPUTERTECHNIK GmbH", + [3]byte{0, 224, 76}: "REALTEK SEMICONDUCTOR CORP.", + [3]byte{0, 224, 77}: "INTERNET INITIATIVE JAPAN, INC", + [3]byte{0, 224, 78}: "SANYO DENKI CO., LTD.", + [3]byte{0, 224, 79}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 80}: "EXECUTONE INFORMATION SYSTEMS, INC.", + [3]byte{0, 224, 81}: "TALX CORPORATION", + [3]byte{0, 224, 82}: "Brocade Communications Systems, Inc", + [3]byte{0, 224, 83}: "CELLPORT LABS, INC.", + [3]byte{0, 224, 84}: "KODAI HITEC CO., LTD.", + [3]byte{0, 224, 85}: "INGENIERIA ELECTRONICA COMERCIAL INELCOM S.A.", + [3]byte{0, 224, 86}: "HOLONTECH CORPORATION", + [3]byte{0, 224, 87}: "HAN MICROTELECOM. CO., LTD.", + [3]byte{0, 224, 88}: "PHASE ONE DENMARK A/S", + [3]byte{0, 224, 89}: "CONTROLLED ENVIRONMENTS, LTD.", + [3]byte{0, 224, 90}: "GALEA NETWORK SECURITY", + [3]byte{0, 224, 91}: "WEST END SYSTEMS CORP.", + [3]byte{0, 224, 92}: "MATSUSHITA KOTOBUKI ELECTRONICS INDUSTRIES, LTD.", + [3]byte{0, 224, 93}: "UNITEC CO., LTD.", + [3]byte{0, 224, 94}: "JAPAN AVIATION ELECTRONICS INDUSTRY, LTD.", + [3]byte{0, 224, 95}: "e-Net, Inc.", + [3]byte{0, 224, 96}: "SHERWOOD", + [3]byte{0, 224, 97}: "EdgePoint Networks, Inc.", + [3]byte{0, 224, 98}: "HOST ENGINEERING", + [3]byte{0, 224, 99}: "CABLETRON - YAGO SYSTEMS, INC.", + [3]byte{0, 224, 100}: "SAMSUNG ELECTRONICS", + [3]byte{0, 224, 101}: "OPTICAL ACCESS INTERNATIONAL", + [3]byte{0, 224, 102}: "ProMax Systems, Inc.", + [3]byte{0, 224, 103}: "eac AUTOMATION-CONSULTING GmbH", + [3]byte{0, 224, 104}: "MERRIMAC SYSTEMS INC.", + [3]byte{0, 224, 105}: "JAYCOR", + [3]byte{0, 224, 106}: "KAPSCH AG", + [3]byte{0, 224, 107}: "W&G SPECIAL PRODUCTS", + [3]byte{0, 224, 108}: "Ultra Electronics Limited (AEP Networks)", + [3]byte{0, 224, 109}: "COMPUWARE CORPORATION", + [3]byte{0, 224, 110}: "FAR SYSTEMS S.p.A.", + [3]byte{0, 224, 111}: "ARRIS Group, Inc.", + [3]byte{0, 224, 112}: "DH TECHNOLOGY", + [3]byte{0, 224, 113}: "EPIS MICROCOMPUTER", + [3]byte{0, 224, 114}: "LYNK", + [3]byte{0, 224, 115}: "NATIONAL AMUSEMENT NETWORK, INC.", + [3]byte{0, 224, 116}: "TIERNAN COMMUNICATIONS, INC.", + [3]byte{0, 224, 117}: "Verilink Corporation", + [3]byte{0, 224, 118}: "DEVELOPMENT CONCEPTS, INC.", + [3]byte{0, 224, 119}: "WEBGEAR, INC.", + [3]byte{0, 224, 120}: "BERKELEY NETWORKS", + [3]byte{0, 224, 121}: "A.T.N.R.", + [3]byte{0, 224, 122}: "MIKRODIDAKT AB", + [3]byte{0, 224, 123}: "BAY NETWORKS", + [3]byte{0, 224, 124}: "METTLER-TOLEDO, INC.", + [3]byte{0, 224, 125}: "NETRONIX, INC.", + [3]byte{0, 224, 126}: "WALT DISNEY IMAGINEERING", + [3]byte{0, 224, 127}: "LOGISTISTEM s.r.l.", + [3]byte{0, 224, 128}: "CONTROL RESOURCES CORPORATION", + [3]byte{0, 224, 129}: "TYAN COMPUTER CORP.", + [3]byte{0, 224, 130}: "ANERMA", + [3]byte{0, 224, 131}: "JATO TECHNOLOGIES, INC.", + [3]byte{0, 224, 132}: "COMPULITE R&D", + [3]byte{0, 224, 133}: "GLOBAL MAINTECH, INC.", + [3]byte{0, 224, 134}: "Emerson Network Power, Avocent Division", + [3]byte{0, 224, 135}: "LeCroy - Networking Productions Division", + [3]byte{0, 224, 136}: "LTX-Credence CORPORATION", + [3]byte{0, 224, 137}: "ION Networks, Inc.", + [3]byte{0, 224, 138}: "GEC AVERY, LTD.", + [3]byte{0, 224, 139}: "QLogic Corp.", + [3]byte{0, 224, 140}: "NEOPARADIGM LABS, INC.", + [3]byte{0, 224, 141}: "PRESSURE SYSTEMS, INC.", + [3]byte{0, 224, 142}: "UTSTARCOM", + [3]byte{0, 224, 143}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 144}: "BECKMAN LAB. AUTOMATION DIV.", + [3]byte{0, 224, 145}: "LG ELECTRONICS, INC.", + [3]byte{0, 224, 146}: "ADMTEK INCORPORATED", + [3]byte{0, 224, 147}: "ACKFIN NETWORKS", + [3]byte{0, 224, 148}: "OSAI SRL", + [3]byte{0, 224, 149}: "ADVANCED-VISION TECHNOLGIES CORP.", + [3]byte{0, 224, 150}: "SHIMADZU CORPORATION", + [3]byte{0, 224, 151}: "CARRIER ACCESS CORPORATION", + [3]byte{0, 224, 152}: "AboCom Systems, Inc.", + [3]byte{0, 224, 153}: "SAMSON AG", + [3]byte{0, 224, 154}: "Positron Inc.", + [3]byte{0, 224, 155}: "ENGAGE NETWORKS, INC.", + [3]byte{0, 224, 156}: "MII", + [3]byte{0, 224, 157}: "SARNOFF CORPORATION", + [3]byte{0, 224, 158}: "QUANTUM CORPORATION", + [3]byte{0, 224, 159}: "PIXEL VISION", + [3]byte{0, 224, 160}: "WILTRON CO.", + [3]byte{0, 224, 161}: "HIMA PAUL HILDEBRANDT GmbH Co. KG", + [3]byte{0, 224, 162}: "MICROSLATE INC.", + [3]byte{0, 224, 163}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 164}: "ESAOTE S.p.A.", + [3]byte{0, 224, 165}: "ComCore Semiconductor, Inc.", + [3]byte{0, 224, 166}: "TELOGY NETWORKS, INC.", + [3]byte{0, 224, 167}: "IPC INFORMATION SYSTEMS, INC.", + [3]byte{0, 224, 168}: "SAT GmbH & Co.", + [3]byte{0, 224, 169}: "FUNAI ELECTRIC CO., LTD.", + [3]byte{0, 224, 170}: "ELECTROSONIC LTD.", + [3]byte{0, 224, 171}: "DIMAT S.A.", + [3]byte{0, 224, 172}: "MIDSCO, INC.", + [3]byte{0, 224, 173}: "EES TECHNOLOGY, LTD.", + [3]byte{0, 224, 174}: "XAQTI CORPORATION", + [3]byte{0, 224, 175}: "GENERAL DYNAMICS INFORMATION SYSTEMS", + [3]byte{0, 224, 176}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 177}: "Alcatel-Lucent, Enterprise Business Group", + [3]byte{0, 224, 178}: "TELMAX COMMUNICATIONS CORP.", + [3]byte{0, 224, 179}: "EtherWAN Systems, Inc.", + [3]byte{0, 224, 180}: "TECHNO SCOPE CO., LTD.", + [3]byte{0, 224, 181}: "ARDENT COMMUNICATIONS CORP.", + [3]byte{0, 224, 182}: "Entrada Networks", + [3]byte{0, 224, 183}: "PI GROUP, LTD.", + [3]byte{0, 224, 184}: "GATEWAY 2000", + [3]byte{0, 224, 185}: "BYAS SYSTEMS", + [3]byte{0, 224, 186}: "BERGHOF AUTOMATIONSTECHNIK GmbH", + [3]byte{0, 224, 187}: "NBX CORPORATION", + [3]byte{0, 224, 188}: "SYMON COMMUNICATIONS, INC.", + [3]byte{0, 224, 189}: "INTERFACE SYSTEMS, INC.", + [3]byte{0, 224, 190}: "GENROCO INTERNATIONAL, INC.", + [3]byte{0, 224, 191}: "TORRENT NETWORKING TECHNOLOGIES CORP.", + [3]byte{0, 224, 192}: "SEIWA ELECTRIC MFG. CO., LTD.", + [3]byte{0, 224, 193}: "MEMOREX TELEX JAPAN, LTD.", + [3]byte{0, 224, 194}: "NECSY S.p.A.", + [3]byte{0, 224, 195}: "SAKAI SYSTEM DEVELOPMENT CORP.", + [3]byte{0, 224, 196}: "HORNER ELECTRIC, INC.", + [3]byte{0, 224, 197}: "BCOM ELECTRONICS INC.", + [3]byte{0, 224, 198}: "LINK2IT, L.L.C.", + [3]byte{0, 224, 199}: "EUROTECH SRL", + [3]byte{0, 224, 200}: "VIRTUAL ACCESS, LTD.", + [3]byte{0, 224, 201}: "AutomatedLogic Corporation", + [3]byte{0, 224, 202}: "BEST DATA PRODUCTS", + [3]byte{0, 224, 203}: "RESON, INC.", + [3]byte{0, 224, 204}: "HERO SYSTEMS, LTD.", + [3]byte{0, 224, 205}: "SAAB SENSIS CORPORATION", + [3]byte{0, 224, 206}: "ARN", + [3]byte{0, 224, 207}: "INTEGRATED DEVICE TECHNOLOGY, INC.", + [3]byte{0, 224, 208}: "NETSPEED, INC.", + [3]byte{0, 224, 209}: "TELSIS LIMITED", + [3]byte{0, 224, 210}: "VERSANET COMMUNICATIONS, INC.", + [3]byte{0, 224, 211}: "DATENTECHNIK GmbH", + [3]byte{0, 224, 212}: "EXCELLENT COMPUTER", + [3]byte{0, 224, 213}: "Emulex Corporation", + [3]byte{0, 224, 214}: "COMPUTER & COMMUNICATION RESEARCH LAB.", + [3]byte{0, 224, 215}: "SUNSHINE ELECTRONICS, INC.", + [3]byte{0, 224, 216}: "LANBit Computer, Inc.", + [3]byte{0, 224, 217}: "TAZMO CO., LTD.", + [3]byte{0, 224, 218}: "Alcatel North America ESD", + [3]byte{0, 224, 219}: "ViaVideo Communications, Inc.", + [3]byte{0, 224, 220}: "NEXWARE CORP.", + [3]byte{0, 224, 221}: "ZENITH ELECTRONICS CORPORATION", + [3]byte{0, 224, 222}: "DATAX NV", + [3]byte{0, 224, 223}: "KEYMILE GmbH", + [3]byte{0, 224, 224}: "SI ELECTRONICS, LTD.", + [3]byte{0, 224, 225}: "G2 NETWORKS, INC.", + [3]byte{0, 224, 226}: "INNOVA CORP.", + [3]byte{0, 224, 227}: "SK-ELEKTRONIK GmbH", + [3]byte{0, 224, 228}: "FANUC ROBOTICS NORTH AMERICA, Inc.", + [3]byte{0, 224, 229}: "CINCO NETWORKS, INC.", + [3]byte{0, 224, 230}: "INCAA DATACOM B.V.", + [3]byte{0, 224, 231}: "RAYTHEON E-SYSTEMS, INC.", + [3]byte{0, 224, 232}: "GRETACODER Data Systems AG", + [3]byte{0, 224, 233}: "DATA LABS, INC.", + [3]byte{0, 224, 234}: "INNOVAT COMMUNICATIONS, INC.", + [3]byte{0, 224, 235}: "DIGICOM SYSTEMS, INCORPORATED", + [3]byte{0, 224, 236}: "CELESTICA INC.", + [3]byte{0, 224, 237}: "SILICOM, LTD.", + [3]byte{0, 224, 238}: "MAREL HF", + [3]byte{0, 224, 239}: "DIONEX", + [3]byte{0, 224, 240}: "ABLER TECHNOLOGY, INC.", + [3]byte{0, 224, 241}: "THAT CORPORATION", + [3]byte{0, 224, 242}: "ARLOTTO COMNET, INC.", + [3]byte{0, 224, 243}: "WebSprint Communications, Inc.", + [3]byte{0, 224, 244}: "INSIDE Technology A/S", + [3]byte{0, 224, 245}: "TELES AG", + [3]byte{0, 224, 246}: "DECISION EUROPE", + [3]byte{0, 224, 247}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 248}: "DICNA CONTROL AB", + [3]byte{0, 224, 249}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 250}: "TRL TECHNOLOGY, LTD.", + [3]byte{0, 224, 251}: "LEIGHTRONIX, INC.", + [3]byte{0, 224, 252}: "HUAWEI TECHNOLOGIES CO., LTD.", + [3]byte{0, 224, 253}: "A-TREND TECHNOLOGY CO., LTD.", + [3]byte{0, 224, 254}: "CISCO SYSTEMS, INC.", + [3]byte{0, 224, 255}: "SECURITY DYNAMICS TECHNOLOGIES, Inc.", + [3]byte{0, 225, 109}: "Cisco", + [3]byte{0, 225, 117}: "AK-Systems Ltd", + [3]byte{0, 227, 178}: "Samsung Electronics Co.,Ltd", + [3]byte{0, 230, 102}: "ARIMA Communications Corp.", + [3]byte{0, 230, 211}: "NIXDORF COMPUTER CORP.", + [3]byte{0, 230, 232}: "Netzin Technology Corporation,.Ltd.", + [3]byte{0, 232, 171}: "Meggitt Training Systems, Inc.", + [3]byte{0, 235, 45}: "Sony Mobile Communications AB", + [3]byte{0, 238, 189}: "HTC Corporation", + [3]byte{0, 240, 81}: "KWB Gmbh", + [3]byte{0, 243, 219}: "WOO Sports", + [3]byte{0, 244, 3}: "Orbis Systems Oy", + [3]byte{0, 244, 111}: "Samsung Elec Co.,Ltd", + [3]byte{0, 244, 185}: "Apple", + [3]byte{0, 247, 111}: "Apple", + [3]byte{0, 248, 96}: "PT. Panggung Electric Citrabuana", + [3]byte{0, 250, 59}: "CLOOS ELECTRONIC GMBH", + [3]byte{0, 252, 88}: "WebSilicon Ltd.", + [3]byte{0, 252, 112}: "Intrepid Control Systems, Inc.", + [3]byte{0, 253, 76}: "NEVATEC", + [3]byte{2, 7, 1}: "RACAL-DATACOM", + [3]byte{2, 28, 124}: "PERQ SYSTEMS CORPORATION", + [3]byte{2, 96, 134}: "LOGIC REPLACEMENT TECH. LTD.", + [3]byte{2, 96, 140}: "3COM CORPORATION", + [3]byte{2, 112, 1}: "RACAL-DATACOM", + [3]byte{2, 112, 176}: "M/A-COM INC. COMPANIES", + [3]byte{2, 112, 179}: "DATA RECALL LTD", + [3]byte{2, 157, 142}: "CARDIAC RECORDERS INC.", + [3]byte{2, 170, 60}: "OLIVETTI TELECOMM SPA (OLTECO)", + [3]byte{2, 187, 1}: "OCTOTHORPE CORP.", + [3]byte{2, 192, 140}: "3COM CORPORATION", + [3]byte{2, 207, 28}: "COMMUNICATION MACHINERY CORP.", + [3]byte{2, 230, 211}: "NIXDORF COMPUTER CORPORATION", + [3]byte{4, 10, 131}: "Alcatel-Lucent", + [3]byte{4, 10, 224}: "XMIT AG COMPUTER NETWORKS", + [3]byte{4, 12, 206}: "Apple", + [3]byte{4, 14, 194}: "ViewSonic Mobile China Limited", + [3]byte{4, 21, 82}: "Apple", + [3]byte{4, 24, 15}: "Samsung Electronics Co.,Ltd", + [3]byte{4, 24, 182}: "PRIVATE", + [3]byte{4, 24, 214}: "Ubiquiti Networks", + [3]byte{4, 26, 4}: "WaveIP", + [3]byte{4, 27, 148}: "Host Mobility AB", + [3]byte{4, 27, 186}: "Samsung Electronics Co.,Ltd", + [3]byte{4, 29, 16}: "Dream Ware Inc.", + [3]byte{4, 30, 100}: "Apple", + [3]byte{4, 32, 154}: "Panasonic AVC Networks Company", + [3]byte{4, 34, 52}: "Wireless Standard Extensions", + [3]byte{4, 38, 5}: "GFR Gesellschaft für Regelungstechnik und Energieeinsparung mbH", + [3]byte{4, 38, 101}: "Apple", + [3]byte{4, 43, 187}: "PicoCELA, Inc.", + [3]byte{4, 47, 86}: "ATOCS (Shenzhen) LTD", + [3]byte{4, 50, 244}: "Partron", + [3]byte{4, 54, 4}: "Gyeyoung I&T", + [3]byte{4, 61, 152}: "ChongQing QingJia Electronics CO.,LTD", + [3]byte{4, 68, 161}: "TELECON GALICIA,S.A.", + [3]byte{4, 70, 101}: "Murata Manufacturing Co., Ltd.", + [3]byte{4, 72, 154}: "Apple", + [3]byte{4, 74, 80}: "Ramaxel Technology (Shenzhen) limited company", + [3]byte{4, 75, 255}: "GuangZhou Hedy Digital Technology Co., Ltd", + [3]byte{4, 76, 239}: "Fujian Sanao Technology Co.,Ltd", + [3]byte{4, 78, 6}: "Ericsson AB", + [3]byte{4, 79, 139}: "Adapteva, Inc.", + [3]byte{4, 79, 170}: "Ruckus Wireless", + [3]byte{4, 84, 83}: "Apple", + [3]byte{4, 85, 202}: "BriView (Xiamen) Corp.", + [3]byte{4, 87, 47}: "Sertel Electronics UK Ltd", + [3]byte{4, 88, 111}: "Sichuan Whayer information industry Co.,LTD", + [3]byte{4, 90, 149}: "Nokia Corporation", + [3]byte{4, 92, 6}: "Zmodo Technology Corporation", + [3]byte{4, 92, 142}: "gosund GROUP CO.,LTD", + [3]byte{4, 93, 86}: "camtron industrial inc.", + [3]byte{4, 95, 167}: "Shenzhen Yichen Technology Development Co.,LTD", + [3]byte{4, 98, 215}: "ALSTOM HYDRO FRANCE", + [3]byte{4, 99, 224}: "Nome Oy", + [3]byte{4, 103, 133}: "scemtec Hard- und Software fuer Mess- und Steuerungstechnik GmbH", + [3]byte{4, 109, 66}: "Bryston Ltd.", + [3]byte{4, 110, 73}: "TaiYear Electronic Technology (Suzhou) Co., Ltd", + [3]byte{4, 112, 188}: "Globalstar Inc.", + [3]byte{4, 116, 161}: "Aligera Equipamentos Digitais Ltda", + [3]byte{4, 117, 245}: "CSST", + [3]byte{4, 118, 110}: "ALPS Co,. Ltd.", + [3]byte{4, 125, 123}: "Quanta Computer Inc.", + [3]byte{4, 129, 174}: "Clack Corporation", + [3]byte{4, 132, 138}: "7INOVA TECHNOLOGY LIMITED", + [3]byte{4, 136, 140}: "Eifelwerk Butler Systeme GmbH", + [3]byte{4, 136, 226}: "Beats Electronics LLC", + [3]byte{4, 138, 21}: "Avaya, Inc", + [3]byte{4, 139, 66}: "Skspruce Technology Limited", + [3]byte{4, 140, 3}: "ThinPAD Technology (Shenzhen)CO.,LTD", + [3]byte{4, 141, 56}: "Netcore Technology Inc.", + [3]byte{4, 148, 161}: "CATCH THE WIND INC", + [3]byte{4, 152, 243}: "ALPS Electric Co,. Ltd.", + [3]byte{4, 153, 230}: "Shenzhen Yoostar Technology Co., Ltd", + [3]byte{4, 155, 156}: "Eadingcore Intelligent Technology Co., Ltd.", + [3]byte{4, 156, 98}: "BMT Medical Technology s.r.o.", + [3]byte{4, 159, 6}: "Smobile Co., Ltd.", + [3]byte{4, 159, 129}: "Netscout Systems, Inc.", + [3]byte{4, 161, 81}: "NETGEAR INC.,", + [3]byte{4, 163, 243}: "Emicon", + [3]byte{4, 168, 42}: "Nokia Corporation", + [3]byte{4, 179, 182}: "Seamap (UK) Ltd", + [3]byte{4, 180, 102}: "BSP Co., Ltd.", + [3]byte{4, 189, 112}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{4, 191, 168}: "ISB Corporation", + [3]byte{4, 192, 91}: "Tigo Energy", + [3]byte{4, 192, 111}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{4, 192, 156}: "Tellabs Inc.", + [3]byte{4, 193, 185}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{4, 197, 164}: "CISCO SYSTEMS, INC.", + [3]byte{4, 200, 128}: "Samtec Inc", + [3]byte{4, 201, 145}: "Phistek INC.", + [3]byte{4, 203, 29}: "Traka plc", + [3]byte{4, 206, 20}: "Wilocity LTD.", + [3]byte{4, 207, 37}: "MANYCOLORS, INC.", + [3]byte{4, 212, 55}: "ZNV", + [3]byte{4, 215, 131}: "Y&H E&C Co.,LTD.", + [3]byte{4, 218, 210}: "Cisco", + [3]byte{4, 219, 86}: "Apple, Inc.", + [3]byte{4, 219, 138}: "Suntech International Ltd.", + [3]byte{4, 221, 76}: "Velocytech", + [3]byte{4, 222, 219}: "Rockport Networks Inc", + [3]byte{4, 223, 105}: "Car Connectivity Consortium", + [3]byte{4, 224, 196}: "TRIUMPH-ADLER AG", + [3]byte{4, 225, 200}: "IMS Soluções em Energia Ltda.", + [3]byte{4, 226, 248}: "AEP Ticketing solutions srl", + [3]byte{4, 228, 81}: "Texas Instruments", + [3]byte{4, 229, 54}: "Apple", + [3]byte{4, 229, 72}: "Cohda Wireless Pty Ltd", + [3]byte{4, 230, 98}: "Acroname Inc.", + [3]byte{4, 230, 118}: "AMPAK Technology Inc.", + [3]byte{4, 233, 229}: "PJRC.COM, LLC", + [3]byte{4, 238, 145}: "x-fabric GmbH", + [3]byte{4, 240, 33}: "Compex Systems Pte Ltd", + [3]byte{4, 241, 62}: "Apple", + [3]byte{4, 241, 125}: "Tarana Wireless", + [3]byte{4, 244, 188}: "Xena Networks", + [3]byte{4, 247, 228}: "Apple", + [3]byte{4, 248, 194}: "Flaircomm Microelectronics, Inc.", + [3]byte{4, 249, 56}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{4, 254, 49}: "Samsung Electronics Co.,Ltd", + [3]byte{4, 254, 127}: "CISCO SYSTEMS, INC.", + [3]byte{4, 255, 81}: "NOVAMEDIA INNOVISION SP. Z O.O.", + [3]byte{8, 0, 1}: "COMPUTERVISION CORPORATION", + [3]byte{8, 0, 2}: "BRIDGE COMMUNICATIONS INC.", + [3]byte{8, 0, 3}: "ADVANCED COMPUTER COMM.", + [3]byte{8, 0, 4}: "CROMEMCO INCORPORATED", + [3]byte{8, 0, 5}: "SYMBOLICS INC.", + [3]byte{8, 0, 6}: "SIEMENS AG", + [3]byte{8, 0, 7}: "Apple", + [3]byte{8, 0, 8}: "BOLT BERANEK AND NEWMAN INC.", + [3]byte{8, 0, 9}: "HEWLETT PACKARD", + [3]byte{8, 0, 10}: "NESTAR SYSTEMS INCORPORATED", + [3]byte{8, 0, 11}: "UNISYS CORPORATION", + [3]byte{8, 0, 12}: "MIKLYN DEVELOPMENT CO.", + [3]byte{8, 0, 13}: "INTERNATIONAL COMPUTERS LTD.", + [3]byte{8, 0, 14}: "NCR CORPORATION", + [3]byte{8, 0, 15}: "MITEL CORPORATION", + [3]byte{8, 0, 17}: "TEKTRONIX INC.", + [3]byte{8, 0, 18}: "BELL ATLANTIC INTEGRATED SYST.", + [3]byte{8, 0, 19}: "EXXON", + [3]byte{8, 0, 20}: "EXCELAN", + [3]byte{8, 0, 21}: "STC BUSINESS SYSTEMS", + [3]byte{8, 0, 22}: "BARRISTER INFO SYS CORP", + [3]byte{8, 0, 23}: "NATIONAL SEMICONDUCTOR", + [3]byte{8, 0, 24}: "PIRELLI FOCOM NETWORKS", + [3]byte{8, 0, 25}: "GENERAL ELECTRIC CORPORATION", + [3]byte{8, 0, 26}: "TIARA/ 10NET", + [3]byte{8, 0, 27}: "EMC Corporation", + [3]byte{8, 0, 28}: "KDD-KOKUSAI DEBNSIN DENWA CO.", + [3]byte{8, 0, 29}: "ABLE COMMUNICATIONS INC.", + [3]byte{8, 0, 30}: "APOLLO COMPUTER INC.", + [3]byte{8, 0, 31}: "SHARP CORPORATION", + [3]byte{8, 0, 32}: "Oracle Corporation", + [3]byte{8, 0, 33}: "3M COMPANY", + [3]byte{8, 0, 34}: "NBI INC.", + [3]byte{8, 0, 35}: "Panasonic Communications Co., Ltd.", + [3]byte{8, 0, 36}: "10NET COMMUNICATIONS/DCA", + [3]byte{8, 0, 37}: "CONTROL DATA", + [3]byte{8, 0, 38}: "NORSK DATA A.S.", + [3]byte{8, 0, 39}: "CADMUS COMPUTER SYSTEMS", + [3]byte{8, 0, 40}: "Texas Instruments", + [3]byte{8, 0, 41}: "MEGATEK CORPORATION", + [3]byte{8, 0, 42}: "MOSAIC TECHNOLOGIES INC.", + [3]byte{8, 0, 43}: "DIGITAL EQUIPMENT CORPORATION", + [3]byte{8, 0, 44}: "BRITTON LEE INC.", + [3]byte{8, 0, 45}: "LAN-TEC INC.", + [3]byte{8, 0, 46}: "METAPHOR COMPUTER SYSTEMS", + [3]byte{8, 0, 47}: "PRIME COMPUTER INC.", + [3]byte{8, 0, 48}: "NETWORK RESEARCH CORPORATION", + [3]byte{8, 0, 48}: "CERN", + [3]byte{8, 0, 48}: "ROYAL MELBOURNE INST OF TECH", + [3]byte{8, 0, 49}: "LITTLE MACHINES INC.", + [3]byte{8, 0, 50}: "TIGAN INCORPORATED", + [3]byte{8, 0, 51}: "BAUSCH & LOMB", + [3]byte{8, 0, 52}: "FILENET CORPORATION", + [3]byte{8, 0, 53}: "MICROFIVE CORPORATION", + [3]byte{8, 0, 54}: "INTERGRAPH CORPORATION", + [3]byte{8, 0, 55}: "FUJI-XEROX CO. LTD.", + [3]byte{8, 0, 56}: "BULL S.A.S.", + [3]byte{8, 0, 57}: "SPIDER SYSTEMS LIMITED", + [3]byte{8, 0, 58}: "ORCATECH INC.", + [3]byte{8, 0, 59}: "TORUS SYSTEMS LIMITED", + [3]byte{8, 0, 60}: "SCHLUMBERGER WELL SERVICES", + [3]byte{8, 0, 61}: "CADNETIX CORPORATIONS", + [3]byte{8, 0, 62}: "CODEX CORPORATION", + [3]byte{8, 0, 63}: "FRED KOSCHARA ENTERPRISES", + [3]byte{8, 0, 64}: "FERRANTI COMPUTER SYS. LIMITED", + [3]byte{8, 0, 65}: "RACAL-MILGO INFORMATION SYS..", + [3]byte{8, 0, 66}: "JAPAN MACNICS CORP.", + [3]byte{8, 0, 67}: "PIXEL COMPUTER INC.", + [3]byte{8, 0, 68}: "DAVID SYSTEMS INC.", + [3]byte{8, 0, 69}: "CONCURRENT COMPUTER CORP.", + [3]byte{8, 0, 70}: "Sony Corporation", + [3]byte{8, 0, 71}: "SEQUENT COMPUTER SYSTEMS INC.", + [3]byte{8, 0, 72}: "EUROTHERM GAUGING SYSTEMS", + [3]byte{8, 0, 73}: "UNIVATION", + [3]byte{8, 0, 74}: "BANYAN SYSTEMS INC.", + [3]byte{8, 0, 75}: "PLANNING RESEARCH CORP.", + [3]byte{8, 0, 76}: "HYDRA COMPUTER SYSTEMS INC.", + [3]byte{8, 0, 77}: "CORVUS SYSTEMS INC.", + [3]byte{8, 0, 78}: "3COM EUROPE LTD.", + [3]byte{8, 0, 79}: "CYGNET SYSTEMS", + [3]byte{8, 0, 80}: "DAISY SYSTEMS CORP.", + [3]byte{8, 0, 81}: "EXPERDATA", + [3]byte{8, 0, 82}: "INSYSTEC", + [3]byte{8, 0, 83}: "MIDDLE EAST TECH. UNIVERSITY", + [3]byte{8, 0, 85}: "STANFORD TELECOMM. INC.", + [3]byte{8, 0, 86}: "STANFORD LINEAR ACCEL. CENTER", + [3]byte{8, 0, 87}: "EVANS & SUTHERLAND", + [3]byte{8, 0, 88}: "SYSTEMS CONCEPTS", + [3]byte{8, 0, 89}: "A/S MYCRON", + [3]byte{8, 0, 90}: "IBM Corp", + [3]byte{8, 0, 91}: "VTA TECHNOLOGIES INC.", + [3]byte{8, 0, 92}: "FOUR PHASE SYSTEMS", + [3]byte{8, 0, 93}: "GOULD INC.", + [3]byte{8, 0, 94}: "COUNTERPOINT COMPUTER INC.", + [3]byte{8, 0, 95}: "SABER TECHNOLOGY CORP.", + [3]byte{8, 0, 96}: "INDUSTRIAL NETWORKING INC.", + [3]byte{8, 0, 97}: "JAROGATE LTD.", + [3]byte{8, 0, 98}: "GENERAL DYNAMICS", + [3]byte{8, 0, 99}: "PLESSEY", + [3]byte{8, 0, 100}: "Sitasys AG", + [3]byte{8, 0, 101}: "GENRAD INC.", + [3]byte{8, 0, 102}: "AGFA CORPORATION", + [3]byte{8, 0, 103}: "COMDESIGN", + [3]byte{8, 0, 104}: "RIDGE COMPUTERS", + [3]byte{8, 0, 105}: "SILICON GRAPHICS INC.", + [3]byte{8, 0, 106}: "ATT BELL LABORATORIES", + [3]byte{8, 0, 107}: "ACCEL TECHNOLOGIES INC.", + [3]byte{8, 0, 108}: "SUNTEK TECHNOLOGY INT'L", + [3]byte{8, 0, 109}: "WHITECHAPEL COMPUTER WORKS", + [3]byte{8, 0, 110}: "MASSCOMP", + [3]byte{8, 0, 111}: "PHILIPS APELDOORN B.V.", + [3]byte{8, 0, 112}: "MITSUBISHI ELECTRIC CORP.", + [3]byte{8, 0, 113}: "MATRA (DSIE)", + [3]byte{8, 0, 114}: "XEROX CORP UNIV GRANT PROGRAM", + [3]byte{8, 0, 115}: "TECMAR INC.", + [3]byte{8, 0, 116}: "CASIO COMPUTER CO. LTD.", + [3]byte{8, 0, 117}: "DANSK DATA ELECTRONIK", + [3]byte{8, 0, 118}: "PC LAN TECHNOLOGIES", + [3]byte{8, 0, 119}: "TSL COMMUNICATIONS LTD.", + [3]byte{8, 0, 120}: "ACCELL CORPORATION", + [3]byte{8, 0, 121}: "THE DROID WORKS", + [3]byte{8, 0, 122}: "INDATA", + [3]byte{8, 0, 123}: "SANYO ELECTRIC CO. LTD.", + [3]byte{8, 0, 124}: "VITALINK COMMUNICATIONS CORP.", + [3]byte{8, 0, 126}: "AMALGAMATED WIRELESS(AUS) LTD", + [3]byte{8, 0, 127}: "CARNEGIE-MELLON UNIVERSITY", + [3]byte{8, 0, 128}: "AES DATA INC.", + [3]byte{8, 0, 129}: "ASTECH INC.", + [3]byte{8, 0, 130}: "VERITAS SOFTWARE", + [3]byte{8, 0, 131}: "Seiko Instruments Inc.", + [3]byte{8, 0, 132}: "TOMEN ELECTRONICS CORP.", + [3]byte{8, 0, 133}: "ELXSI", + [3]byte{8, 0, 134}: "KONICA MINOLTA HOLDINGS, INC.", + [3]byte{8, 0, 135}: "XYPLEX", + [3]byte{8, 0, 136}: "Brocade Communications Systems, Inc.", + [3]byte{8, 0, 137}: "KINETICS", + [3]byte{8, 0, 138}: "PerfTech, Inc.", + [3]byte{8, 0, 139}: "PYRAMID TECHNOLOGY CORP.", + [3]byte{8, 0, 140}: "NETWORK RESEARCH CORPORATION", + [3]byte{8, 0, 141}: "XYVISION INC.", + [3]byte{8, 0, 142}: "TANDEM COMPUTERS", + [3]byte{8, 0, 143}: "CHIPCOM CORPORATION", + [3]byte{8, 0, 144}: "SONOMA SYSTEMS", + [3]byte{8, 3, 113}: "KRG CORPORATE", + [3]byte{8, 5, 205}: "DongGuang EnMai Electronic Product Co.Ltd.", + [3]byte{8, 8, 194}: "Samsung Electronics", + [3]byte{8, 8, 234}: "AMSC", + [3]byte{8, 9, 182}: "Masimo Corp", + [3]byte{8, 12, 11}: "SysMik GmbH Dresden", + [3]byte{8, 12, 201}: "Mission Technology Group, dba Magma", + [3]byte{8, 13, 132}: "GECO, Inc.", + [3]byte{8, 14, 168}: "Velex s.r.l.", + [3]byte{8, 15, 250}: "KSP INC.", + [3]byte{8, 17, 94}: "Bitel Co., Ltd.", + [3]byte{8, 17, 150}: "Intel Corporate", + [3]byte{8, 20, 67}: "UNIBRAIN S.A.", + [3]byte{8, 22, 81}: "Shenzhen Sea Star Technology Co.,Ltd", + [3]byte{8, 23, 53}: "CISCO SYSTEMS, INC.", + [3]byte{8, 23, 244}: "IBM Corp", + [3]byte{8, 24, 26}: "zte corporation", + [3]byte{8, 24, 76}: "A. S. Thomas, Inc.", + [3]byte{8, 25, 166}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{8, 29, 251}: "Shanghai Mexon Communication Technology Co.,Ltd", + [3]byte{8, 31, 63}: "WondaLink Inc.", + [3]byte{8, 31, 243}: "CISCO SYSTEMS, INC.", + [3]byte{8, 37, 34}: "ADVANSEE", + [3]byte{8, 39, 25}: "APS systems/electronic AG", + [3]byte{8, 42, 208}: "SRD Innovations Inc.", + [3]byte{8, 46, 95}: "Hewlett Packard", + [3]byte{8, 53, 113}: "CASwell INC.", + [3]byte{8, 55, 61}: "Samsung Electronics Co.,Ltd", + [3]byte{8, 55, 156}: "Topaz Co. LTD.", + [3]byte{8, 56, 165}: "Funkwerk plettac electronic GmbH", + [3]byte{8, 58, 184}: "Shinoda Plasma Co., Ltd.", + [3]byte{8, 61, 136}: "Samsung Electronics Co.,Ltd", + [3]byte{8, 62, 12}: "ARRIS Group, Inc.", + [3]byte{8, 62, 142}: "Hon Hai Precision Ind.Co.Ltd", + [3]byte{8, 63, 62}: "WSH GmbH", + [3]byte{8, 63, 118}: "Intellian Technologies, Inc.", + [3]byte{8, 64, 39}: "Gridstore Inc.", + [3]byte{8, 70, 86}: "VODALYS Ingénierie", + [3]byte{8, 72, 44}: "Raycore Taiwan Co., LTD.", + [3]byte{8, 78, 28}: "H2A Systems, LLC", + [3]byte{8, 78, 191}: "Broad Net Mux Corporation", + [3]byte{8, 81, 46}: "Orion Diagnostica Oy", + [3]byte{8, 82, 64}: "EbV Elektronikbau- und Vertriebs GmbH", + [3]byte{8, 87, 0}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{8, 90, 224}: "Recovision Technology Co., Ltd.", + [3]byte{8, 91, 14}: "Fortinet, Inc.", + [3]byte{8, 93, 221}: "Mercury Corporation", + [3]byte{8, 96, 110}: "ASUSTek COMPUTER INC.", + [3]byte{8, 99, 97}: "Huawei Technologies Co., Ltd", + [3]byte{8, 104, 208}: "Japan System Design", + [3]byte{8, 104, 234}: "EITO ELECTRONICS CO., LTD.", + [3]byte{8, 109, 242}: "Shenzhen MIMOWAVE Technology Co.,Ltd", + [3]byte{8, 112, 69}: "Apple", + [3]byte{8, 116, 246}: "Winterhalter Gastronom GmbH", + [3]byte{8, 117, 114}: "Obelux Oy", + [3]byte{8, 118, 24}: "ViE Technologies Sdn. Bhd.", + [3]byte{8, 118, 149}: "Auto Industrial Co., Ltd.", + [3]byte{8, 118, 255}: "Thomson Telecom Belgium", + [3]byte{8, 121, 153}: "AIM GmbH", + [3]byte{8, 122, 76}: "Huawei Technologies Co., Ltd", + [3]byte{8, 123, 170}: "SVYAZKOMPLEKTSERVICE, LLC", + [3]byte{8, 124, 190}: "Quintic Corp.", + [3]byte{8, 125, 33}: "Altasec technology corporation", + [3]byte{8, 128, 57}: "Cisco SPVTG", + [3]byte{8, 129, 188}: "HongKong Ipro Technology Co., Limited", + [3]byte{8, 129, 244}: "Juniper Networks", + [3]byte{8, 134, 59}: "Belkin International, Inc.", + [3]byte{8, 141, 200}: "Ryowa Electronics Co.,Ltd", + [3]byte{8, 142, 79}: "SF Software Solutions", + [3]byte{8, 143, 44}: "Hills Sound Vision & Lighting", + [3]byte{8, 150, 215}: "AVM GmbH", + [3]byte{8, 151, 88}: "Shenzhen Strong Rising Electronics Co.,Ltd DongGuan Subsidiary", + [3]byte{8, 158, 1}: "QUANTA COMPUTER INC.", + [3]byte{8, 159, 151}: "LEROY AUTOMATION", + [3]byte{8, 161, 43}: "ShenZhen EZL Technology Co., Ltd", + [3]byte{8, 165, 200}: "Sunnovo International Limited", + [3]byte{8, 169, 90}: "Azurewave", + [3]byte{8, 172, 165}: "Benu Video, Inc.", + [3]byte{8, 175, 120}: "Totus Solutions, Inc.", + [3]byte{8, 178, 163}: "Cynny Italia S.r.L.", + [3]byte{8, 180, 207}: "Abicom International", + [3]byte{8, 183, 56}: "Lite-On Technogy Corp.", + [3]byte{8, 183, 236}: "Wireless Seismic", + [3]byte{8, 187, 204}: "AK-NORD EDV VERTRIEBSGES. mbH", + [3]byte{8, 189, 67}: "NETGEAR INC.,", + [3]byte{8, 190, 9}: "Astrol Electronic AG", + [3]byte{8, 202, 69}: "Toyou Feiji Electronics Co., Ltd.", + [3]byte{8, 204, 104}: "Cisco", + [3]byte{8, 205, 155}: "samtec automotive electronics & software GmbH", + [3]byte{8, 208, 159}: "CISCO SYSTEMS, INC.", + [3]byte{8, 210, 154}: "Proformatique", + [3]byte{8, 212, 12}: "Intel Corporate", + [3]byte{8, 212, 43}: "Samsung Electronics", + [3]byte{8, 213, 192}: "Seers Technology Co., Ltd", + [3]byte{8, 216, 51}: "Shenzhen RF Technology Co,.Ltd", + [3]byte{8, 223, 31}: "Bose Corporation", + [3]byte{8, 229, 218}: "NANJING FUJITSU COMPUTER PRODUCTS CO.,LTD.", + [3]byte{8, 230, 114}: "JEBSEE ELECTRONICS CO.,LTD.", + [3]byte{8, 232, 79}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{8, 234, 68}: "Aerohive Networks, Inc.", + [3]byte{8, 235, 41}: "Jiangsu Huitong Group Co.,Ltd.", + [3]byte{8, 235, 116}: "Humax", + [3]byte{8, 235, 237}: "World Elite Technology Co.,LTD", + [3]byte{8, 237, 185}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{8, 238, 139}: "Samsung Elec Co.,Ltd", + [3]byte{8, 239, 59}: "MCS Logic Inc.", + [3]byte{8, 239, 171}: "SAYME WIRELESS SENSOR NETWORK", + [3]byte{8, 241, 183}: "Towerstream Corpration", + [3]byte{8, 242, 244}: "Net One Partners Co.,Ltd.", + [3]byte{8, 246, 248}: "GET Engineering", + [3]byte{8, 247, 40}: "GLOBO Multimedia Sp. z o.o. Sp.k.", + [3]byte{8, 250, 224}: "Fohhn Audio AG", + [3]byte{8, 252, 82}: "OpenXS BV", + [3]byte{8, 252, 136}: "Samsung Electronics Co.,Ltd", + [3]byte{8, 253, 14}: "Samsung Electronics Co.,Ltd", + [3]byte{12, 4, 0}: "Jantar d.o.o.", + [3]byte{12, 5, 53}: "Juniper Systems", + [3]byte{12, 17, 5}: "Ringslink (Xiamen) Network Communication Technologies Co., Ltd", + [3]byte{12, 18, 98}: "zte corporation", + [3]byte{12, 19, 11}: "Uniqoteq Ltd.", + [3]byte{12, 20, 32}: "Samsung Electronics Co.,Ltd", + [3]byte{12, 21, 197}: "SDTEC Co., Ltd.", + [3]byte{12, 23, 241}: "TELECSYS", + [3]byte{12, 25, 31}: "Inform Electronik", + [3]byte{12, 29, 175}: "Beijing Xiaomi communications co.,ltd", + [3]byte{12, 29, 194}: "SeAH Networks", + [3]byte{12, 32, 38}: "noax Technologies AG", + [3]byte{12, 39, 36}: "Cisco", + [3]byte{12, 39, 85}: "Valuable Techologies Limited", + [3]byte{12, 42, 105}: "electric imp, incorporated", + [3]byte{12, 42, 231}: "Beijing General Research Institute of Mining and Metallurgy", + [3]byte{12, 45, 137}: "QiiQ Communications Inc.", + [3]byte{12, 48, 33}: "Apple", + [3]byte{12, 55, 220}: "Huawei Technologies Co., Ltd", + [3]byte{12, 56, 62}: "Fanvil Technology Co., Ltd.", + [3]byte{12, 57, 86}: "Observator instruments", + [3]byte{12, 60, 101}: "Dome Imaging Inc", + [3]byte{12, 62, 159}: "Apple, Inc", + [3]byte{12, 70, 157}: "MS Sedco", + [3]byte{12, 71, 61}: "Hitron Technologies. Inc", + [3]byte{12, 76, 57}: "Mitrastar Technology", + [3]byte{12, 77, 233}: "Apple", + [3]byte{12, 79, 90}: "ASA-RT s.r.l.", + [3]byte{12, 81, 247}: "CHAUVIN ARNOUX", + [3]byte{12, 84, 165}: "PEGATRON CORPORATION", + [3]byte{12, 85, 33}: "Axiros GmbH", + [3]byte{12, 86, 92}: "HyBroad Vision (Hong Kong) Technology Co Ltd", + [3]byte{12, 87, 235}: "Mueller Systems", + [3]byte{12, 90, 25}: "Axtion Sdn Bhd", + [3]byte{12, 92, 216}: "DOLI Elektronik GmbH", + [3]byte{12, 96, 118}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{12, 99, 252}: "Nanjing Signway Technology Co., Ltd", + [3]byte{12, 104, 3}: "Cisco", + [3]byte{12, 110, 79}: "PrimeVOLT Co., Ltd.", + [3]byte{12, 113, 93}: "Samsung Electronics Co.,Ltd", + [3]byte{12, 114, 44}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{12, 116, 194}: "Apple", + [3]byte{12, 117, 35}: "BEIJING GEHUA CATV NETWORK CO.,LTD", + [3]byte{12, 119, 26}: "Apple", + [3]byte{12, 125, 124}: "Kexiang Information Technology Co, Ltd.", + [3]byte{12, 129, 18}: "PRIVATE", + [3]byte{12, 130, 48}: "SHENZHEN MAGNUS TECHNOLOGIES CO.,LTD", + [3]byte{12, 130, 104}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{12, 130, 106}: "Wuhan Huagong Genuine Optics Technology Co., Ltd", + [3]byte{12, 132, 17}: "A.O. Smith Water Products", + [3]byte{12, 132, 132}: "Zenovia Electronics Inc.", + [3]byte{12, 132, 220}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{12, 133, 37}: "CISCO SYSTEMS, INC.", + [3]byte{12, 137, 16}: "Samsung Electronics Co.,LTD", + [3]byte{12, 139, 253}: "Intel Corporate", + [3]byte{12, 140, 143}: "Kamo Technology Limited", + [3]byte{12, 140, 220}: "Suunto Oy", + [3]byte{12, 141, 152}: "TOP EIGHT IND CORP", + [3]byte{12, 146, 78}: "Rice Lake Weighing Systems", + [3]byte{12, 147, 1}: "PT. Prasimax Inovasi Teknologi", + [3]byte{12, 147, 251}: "BNS Solutions", + [3]byte{12, 150, 191}: "Huawei Technologies Co., Ltd", + [3]byte{12, 155, 19}: "Shanghai Magic Mobile Telecommunication Co.Ltd.", + [3]byte{12, 157, 86}: "Consort Controls Ltd", + [3]byte{12, 158, 145}: "Sankosha Corporation", + [3]byte{12, 161, 56}: "Blinq Wireless Inc.", + [3]byte{12, 162, 244}: "Chameleon Technology (UK) Limited", + [3]byte{12, 164, 2}: "Alcatel Lucent IPD", + [3]byte{12, 164, 42}: "OB Telecom Electronic Technology Co., Ltd", + [3]byte{12, 166, 148}: "Sunitec Enterprise Co.,Ltd", + [3]byte{12, 172, 5}: "Unitend Technologies Inc.", + [3]byte{12, 175, 90}: "GENUS POWER INFRASTRUCTURES LIMITED", + [3]byte{12, 179, 25}: "Samsung Elec Co.,Ltd", + [3]byte{12, 180, 239}: "Digience Co.,Ltd.", + [3]byte{12, 189, 81}: "TCT Mobile Limited", + [3]byte{12, 191, 21}: "Genetec", + [3]byte{12, 192, 192}: "MAGNETI MARELLI SISTEMAS ELECTRONICOS MEXICO", + [3]byte{12, 195, 167}: "Meritec", + [3]byte{12, 196, 122}: "Super Micro Computer, Inc.", + [3]byte{12, 196, 126}: "EUCAST Co., Ltd.", + [3]byte{12, 198, 85}: "Wuxi YSTen Technology Co.,Ltd.", + [3]byte{12, 198, 106}: "Nokia Corporation", + [3]byte{12, 198, 172}: "DAGS", + [3]byte{12, 200, 31}: "Summer Infant, Inc.", + [3]byte{12, 201, 198}: "Samwin Hong Kong Limited", + [3]byte{12, 203, 141}: "ASCO Numatics GmbH", + [3]byte{12, 205, 211}: "EASTRIVER TECHNOLOGY CO., LTD.", + [3]byte{12, 205, 251}: "EDIC Systems Inc.", + [3]byte{12, 207, 209}: "SPRINGWAVE Co., Ltd", + [3]byte{12, 210, 146}: "Intel Corporate", + [3]byte{12, 210, 181}: "Binatone Telecommunication Pvt. Ltd", + [3]byte{12, 213, 2}: "Westell", + [3]byte{12, 214, 150}: "Amimon Ltd", + [3]byte{12, 215, 194}: "Axium Technologies, Inc.", + [3]byte{12, 217, 150}: "CISCO SYSTEMS, INC.", + [3]byte{12, 217, 193}: "Visteon Corporation", + [3]byte{12, 218, 65}: "Hangzhou H3C Technologies Co., Limited", + [3]byte{12, 220, 204}: "Inala Technologies", + [3]byte{12, 221, 239}: "Nokia Corporation", + [3]byte{12, 223, 164}: "Samsung Electronics Co.,Ltd", + [3]byte{12, 224, 228}: "Plantronics, Inc", + [3]byte{12, 229, 211}: "DH electronics GmbH", + [3]byte{12, 231, 9}: "Fox Crypto B.V.", + [3]byte{12, 232, 47}: "Bonfiglioli Vectron GmbH", + [3]byte{12, 233, 54}: "ELIMOS srl", + [3]byte{12, 238, 230}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{12, 239, 124}: "AnaCom Inc", + [3]byte{12, 240, 25}: "Malgn Technology Co., Ltd.", + [3]byte{12, 240, 180}: "Globalsat International Technology Ltd", + [3]byte{12, 243, 97}: "Java Information", + [3]byte{12, 243, 238}: "EM Microelectronic", + [3]byte{12, 244, 5}: "Beijing Signalway Technologies Co.,Ltd", + [3]byte{12, 248, 147}: "ARRIS Group, Inc.", + [3]byte{12, 252, 131}: "Airoha Technology Corp.,", + [3]byte{16, 0, 0}: "PRIVATE", + [3]byte{16, 0, 90}: "IBM Corp", + [3]byte{16, 0, 232}: "NATIONAL SEMICONDUCTOR", + [3]byte{16, 0, 253}: "LaonPeople", + [3]byte{16, 1, 202}: "Ashley Butterworth", + [3]byte{16, 5, 202}: "Cisco", + [3]byte{16, 7, 35}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{16, 8, 177}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{16, 9, 12}: "Janome Sewing Machine Co., Ltd.", + [3]byte{16, 11, 169}: "Intel Corporate", + [3]byte{16, 12, 36}: "pomdevices, LLC", + [3]byte{16, 13, 47}: "Online Security Pty. Ltd.", + [3]byte{16, 13, 50}: "Embedian, Inc.", + [3]byte{16, 13, 127}: "NETGEAR INC.,", + [3]byte{16, 14, 43}: "NEC CASIO Mobile Communications", + [3]byte{16, 14, 126}: "Juniper networks", + [3]byte{16, 15, 24}: "Fu Gang Electronic(KunShan)CO.,LTD", + [3]byte{16, 16, 182}: "McCain Inc", + [3]byte{16, 18, 18}: "Vivo International Corporation Pty Ltd", + [3]byte{16, 18, 24}: "Korins Inc.", + [3]byte{16, 18, 72}: "ITG, Inc.", + [3]byte{16, 19, 238}: "Justec International Technology INC.", + [3]byte{16, 24, 158}: "Elmo Motion Control", + [3]byte{16, 27, 84}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{16, 28, 12}: "Apple", + [3]byte{16, 29, 81}: "ON-Q LLC dba ON-Q Mesh Networks", + [3]byte{16, 29, 192}: "Samsung Electronics Co.,Ltd", + [3]byte{16, 31, 116}: "Hewlett-Packard Company", + [3]byte{16, 34, 121}: "ZeroDesktop, Inc.", + [3]byte{16, 39, 190}: "TVIP", + [3]byte{16, 40, 49}: "Morion Inc.", + [3]byte{16, 45, 150}: "Looxcie Inc.", + [3]byte{16, 46, 175}: "Texas Instruments", + [3]byte{16, 47, 107}: "Microsoft Corporation", + [3]byte{16, 48, 71}: "Samsung Electronics Co.,Ltd", + [3]byte{16, 51, 120}: "FLECTRON Co., LTD", + [3]byte{16, 55, 17}: "Simlink AS", + [3]byte{16, 59, 89}: "Samsung Electronics Co.,Ltd", + [3]byte{16, 61, 234}: "HFC Technology (Beijing) Ltd. Co.", + [3]byte{16, 64, 243}: "Apple", + [3]byte{16, 67, 105}: "Soundmax Electronic Limited", + [3]byte{16, 68, 90}: "Shaanxi Hitech Electronic Co., LTD", + [3]byte{16, 69, 190}: "Norphonic AS", + [3]byte{16, 69, 248}: "LNT-Automation GmbH", + [3]byte{16, 71, 128}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{16, 72, 177}: "Beijing Duokan Technology Limited", + [3]byte{16, 75, 70}: "Mitsubishi Electric Corporation", + [3]byte{16, 77, 119}: "Innovative Computer Engineering", + [3]byte{16, 78, 7}: "Shanghai Genvision Industries Co.,Ltd", + [3]byte{16, 81, 114}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{16, 86, 202}: "Peplink International Ltd.", + [3]byte{16, 92, 59}: "Perma-Pipe, Inc.", + [3]byte{16, 92, 191}: "DuroByte Inc", + [3]byte{16, 95, 6}: "Actiontec Electronics, Inc", + [3]byte{16, 95, 73}: "Cisco SPVTG", + [3]byte{16, 96, 75}: "Hewlett Packard", + [3]byte{16, 98, 201}: "Adatis GmbH & Co. KG", + [3]byte{16, 100, 226}: "ADFweb.com s.r.l.", + [3]byte{16, 101, 163}: "Core Brands LLC", + [3]byte{16, 101, 207}: "IQSIM", + [3]byte{16, 102, 130}: "NEC Platforms, Ltd.", + [3]byte{16, 104, 63}: "LG Electronics", + [3]byte{16, 111, 63}: "Buffalo Inc.", + [3]byte{16, 111, 239}: "Ad-Sol Nissin Corp", + [3]byte{16, 113, 249}: "Cloud Telecomputers, LLC", + [3]byte{16, 118, 138}: "EoCell", + [3]byte{16, 119, 177}: "Samsung Electronics Co.,LTD", + [3]byte{16, 120, 206}: "Hanvit SI, Inc.", + [3]byte{16, 120, 210}: "ELITEGROUP COMPUTER SYSTEM CO., LTD.", + [3]byte{16, 122, 134}: "U&U ENGINEERING INC.", + [3]byte{16, 123, 239}: "ZyXEL Communications Corp", + [3]byte{16, 131, 210}: "Microseven Systems, LLC", + [3]byte{16, 136, 15}: "Daruma Telecomunicações e Informática S.A.", + [3]byte{16, 136, 206}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{16, 138, 27}: "RAONIX Inc.", + [3]byte{16, 140, 207}: "CISCO SYSTEMS, INC.", + [3]byte{16, 146, 102}: "Samsung Electronics Co.,Ltd", + [3]byte{16, 147, 233}: "Apple", + [3]byte{16, 154, 185}: "Tosibox Oy", + [3]byte{16, 154, 221}: "Apple", + [3]byte{16, 159, 169}: "Actiontec Electronics, Inc", + [3]byte{16, 161, 59}: "FUJIKURA RUBBER LTD.", + [3]byte{16, 165, 208}: "Murata Manufacturing Co.,Ltd.", + [3]byte{16, 167, 67}: "SK Mtek Limited", + [3]byte{16, 169, 50}: "Beijing Cyber Cloud Technology Co. ,Ltd.", + [3]byte{16, 174, 96}: "PRIVATE", + [3]byte{16, 178, 107}: "base Co.,Ltd.", + [3]byte{16, 183, 19}: "PRIVATE", + [3]byte{16, 183, 246}: "Plastoform Industries Ltd.", + [3]byte{16, 185, 254}: "Lika srl", + [3]byte{16, 186, 165}: "GANA I&C CO., LTD", + [3]byte{16, 189, 24}: "CISCO SYSTEMS, INC.", + [3]byte{16, 191, 72}: "ASUSTEK COMPUTER INC.", + [3]byte{16, 194, 186}: "UTT Co., Ltd.", + [3]byte{16, 195, 123}: "ASUSTek COMPUTER INC.", + [3]byte{16, 197, 134}: "BIO SOUND LAB CO., LTD.", + [3]byte{16, 198, 31}: "Huawei Technologies Co., Ltd", + [3]byte{16, 198, 126}: "SHENZHEN JUCHIN TECHNOLOGY CO., LTD", + [3]byte{16, 198, 252}: "Garmin International", + [3]byte{16, 199, 63}: "Midas Klark Teknik Ltd", + [3]byte{16, 202, 129}: "PRECIA", + [3]byte{16, 204, 219}: "AXIMUM PRODUITS ELECTRONIQUES", + [3]byte{16, 209, 220}: "INSTAR Deutschland GmbH", + [3]byte{16, 213, 66}: "Samsung Electronics Co.,Ltd", + [3]byte{16, 221, 177}: "Apple", + [3]byte{16, 221, 244}: "Maxway Electronics CO.,LTD", + [3]byte{16, 222, 228}: "automationNEXT GmbH", + [3]byte{16, 226, 213}: "Qi Hardware Inc.", + [3]byte{16, 227, 199}: "Seohwa Telecom", + [3]byte{16, 228, 175}: "APR, LLC", + [3]byte{16, 230, 174}: "Source Technologies, LLC", + [3]byte{16, 232, 238}: "PhaseSpace", + [3]byte{16, 234, 89}: "Cisco SPVTG", + [3]byte{16, 238, 217}: "Canoga Perkins Corporation", + [3]byte{16, 243, 17}: "Cisco", + [3]byte{16, 243, 219}: "Gridco Systems, Inc.", + [3]byte{16, 244, 154}: "T3 Innovation", + [3]byte{16, 246, 129}: "vivo Mobile Communication Co., Ltd.", + [3]byte{16, 249, 111}: "LG Electronics", + [3]byte{16, 249, 238}: "Nokia Corporation", + [3]byte{16, 250, 206}: "Reacheng Communication Technology Co.,Ltd", + [3]byte{16, 251, 240}: "KangSheng LTD.", + [3]byte{16, 252, 84}: "Shany Electronic Co., Ltd.", + [3]byte{16, 254, 237}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{17, 0, 170}: "PRIVATE", + [3]byte{20, 7, 8}: "PRIVATE", + [3]byte{20, 7, 224}: "Abrantix AG", + [3]byte{20, 12, 118}: "FREEBOX SAS", + [3]byte{20, 13, 79}: "Flextronics International", + [3]byte{20, 16, 159}: "Apple", + [3]byte{20, 19, 48}: "Anakreon UK LLP", + [3]byte{20, 20, 75}: "FUJIAN STAR-NET COMMUNICATION CO.,LTD", + [3]byte{20, 26, 81}: "Treetech Sistemas Digitais", + [3]byte{20, 27, 189}: "Volex Inc.", + [3]byte{20, 27, 240}: "Intellimedia Systems Ltd", + [3]byte{20, 31, 186}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{20, 35, 215}: "EUTRONIX CO., LTD.", + [3]byte{20, 43, 210}: "Armtel Ltd.", + [3]byte{20, 43, 214}: "Guangdong Appscomm Co.,Ltd", + [3]byte{20, 45, 39}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{20, 45, 139}: "Incipio Technologies, Inc", + [3]byte{20, 45, 245}: "Amphitech", + [3]byte{20, 48, 122}: "Avermetrics", + [3]byte{20, 48, 198}: "Motorola Mobility LLC", + [3]byte{20, 53, 139}: "Mediabridge Products, LLC.", + [3]byte{20, 53, 179}: "Future Designs, Inc.", + [3]byte{20, 54, 5}: "Nokia Corporation", + [3]byte{20, 54, 198}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{20, 55, 59}: "PROCOM Systems", + [3]byte{20, 58, 234}: "Dynapower Company LLC", + [3]byte{20, 61, 242}: "Beijing Shidai Hongyuan Network Communication Co.,Ltd", + [3]byte{20, 62, 96}: "Alcatel-Lucent", + [3]byte{20, 65, 226}: "Monaco Enterprises, Inc.", + [3]byte{20, 67, 25}: "Creative&Link Technology Limited", + [3]byte{20, 70, 228}: "AVISTEL", + [3]byte{20, 72, 139}: "Shenzhen Doov Technology Co.,Ltd", + [3]byte{20, 73, 120}: "Digital Control Incorporated", + [3]byte{20, 73, 224}: "Samsung Electro Mechanics co.,LTD.", + [3]byte{20, 76, 26}: "Max Communication GmbH", + [3]byte{20, 84, 18}: "Entis Co., Ltd.", + [3]byte{20, 86, 69}: "Savitech Corp.", + [3]byte{20, 88, 208}: "Hewlett Packard", + [3]byte{20, 90, 5}: "Apple", + [3]byte{20, 91, 209}: "ARRIS Group, Inc.", + [3]byte{20, 96, 128}: "zte corporation", + [3]byte{20, 99, 8}: "JABIL CIRCUIT (SHANGHAI) LTD.", + [3]byte{20, 106, 11}: "Cypress Electronics Limited", + [3]byte{20, 110, 10}: "PRIVATE", + [3]byte{20, 115, 115}: "TUBITAK UEKAE", + [3]byte{20, 116, 17}: "RIM", + [3]byte{20, 117, 144}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{20, 125, 179}: "JOA TELECOM.CO.,LTD", + [3]byte{20, 125, 197}: "Murata Manufacturing Co., Ltd.", + [3]byte{20, 130, 91}: "Hefei Radio Communication Technology Co., Ltd", + [3]byte{20, 134, 146}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{20, 137, 253}: "Samsung Electronics", + [3]byte{20, 138, 112}: "ADS GmbH", + [3]byte{20, 143, 198}: "Apple", + [3]byte{20, 144, 144}: "KongTop industrial(shen zhen)CO.,LTD", + [3]byte{20, 148, 72}: "BLU CASTLE S.A.", + [3]byte{20, 153, 226}: "Apple, Inc", + [3]byte{20, 159, 232}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{20, 163, 100}: "Samsung Electronics Co.,Ltd", + [3]byte{20, 166, 44}: "S.M. Dezac S.A.", + [3]byte{20, 168, 107}: "ShenZhen Telacom Science&Technology Co., Ltd", + [3]byte{20, 169, 227}: "MST CORPORATION", + [3]byte{20, 171, 240}: "ARRIS Group, Inc.", + [3]byte{20, 177, 38}: "Industrial Software Co", + [3]byte{20, 177, 200}: "InfiniWing, Inc.", + [3]byte{20, 180, 132}: "Samsung Electronics Co.,Ltd", + [3]byte{20, 183, 61}: "ARCHEAN Technologies", + [3]byte{20, 185, 104}: "Huawei Technologies Co., Ltd", + [3]byte{20, 192, 137}: "DUNE HD LTD", + [3]byte{20, 193, 38}: "Nokia Corporation", + [3]byte{20, 194, 29}: "Sabtech Industries", + [3]byte{20, 204, 32}: "TP-LINK TECHNOLOGIES CO.,LTD", + [3]byte{20, 207, 141}: "OHSUNG ELECTRONICS CO., LTD.", + [3]byte{20, 207, 146}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{20, 207, 226}: "ARRIS Group, Inc.", + [3]byte{20, 212, 254}: "Pace plc", + [3]byte{20, 214, 77}: "D-Link International", + [3]byte{20, 215, 110}: "CONCH ELECTRONIC Co.,Ltd", + [3]byte{20, 218, 233}: "ASUSTek COMPUTER INC.", + [3]byte{20, 219, 133}: "S NET MEDIA", + [3]byte{20, 228, 236}: "mLogic LLC", + [3]byte{20, 230, 228}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{20, 235, 51}: "BSMediasoft Co., Ltd.", + [3]byte{20, 237, 165}: "Wächter GmbH Sicherheitssysteme", + [3]byte{20, 237, 228}: "Kaiam Corporation", + [3]byte{20, 238, 157}: "AirNav Systems LLC", + [3]byte{20, 240, 197}: "Xtremio Ltd.", + [3]byte{20, 242, 142}: "ShenYang ZhongKe-Allwin Technology Co.LTD", + [3]byte{20, 244, 42}: "Samsung Electronics", + [3]byte{20, 246, 90}: "Xiaomi inc.", + [3]byte{20, 248, 147}: "Wuhan FiberHome Digital Technology Co.,Ltd.", + [3]byte{20, 254, 175}: "SAGITTAR LIMITED", + [3]byte{20, 254, 181}: "Dell Inc", + [3]byte{24, 0, 45}: "Sony Mobile Communications AB", + [3]byte{24, 0, 219}: "Fitbit Inc.", + [3]byte{24, 1, 227}: "Elektrobit Wireless Communications Ltd", + [3]byte{24, 3, 115}: "Dell Inc", + [3]byte{24, 3, 250}: "IBT Interfaces", + [3]byte{24, 6, 117}: "DILAX Intelcom GmbH", + [3]byte{24, 11, 82}: "Nanotron Technologies GmbH", + [3]byte{24, 12, 20}: "iSonea Limited", + [3]byte{24, 12, 119}: "Westinghouse Electric Company, LLC", + [3]byte{24, 12, 172}: "CANON INC.", + [3]byte{24, 16, 78}: "CEDINT-UPM", + [3]byte{24, 20, 32}: "TEB SAS", + [3]byte{24, 20, 86}: "Nokia Corporation", + [3]byte{24, 23, 20}: "DAEWOOIS", + [3]byte{24, 23, 37}: "Cameo Communications, Inc.", + [3]byte{24, 25, 63}: "Tamtron Oy", + [3]byte{24, 27, 235}: "Actiontec Electronics, Inc", + [3]byte{24, 30, 120}: "SAGEMCOM", + [3]byte{24, 30, 176}: "Samsung Electronics Co.,Ltd", + [3]byte{24, 32, 18}: "Aztech Associates Inc.", + [3]byte{24, 32, 50}: "Apple", + [3]byte{24, 32, 166}: "Sage Co., Ltd.", + [3]byte{24, 34, 126}: "Samsung Electronics Co.,Ltd", + [3]byte{24, 38, 102}: "Samsung Electronics Co.,Ltd", + [3]byte{24, 40, 97}: "AirTies Wireless Networks", + [3]byte{24, 42, 123}: "Nintendo Co., Ltd.", + [3]byte{24, 43, 5}: "8D Technologies", + [3]byte{24, 44, 145}: "Concept Development, Inc.", + [3]byte{24, 48, 9}: "Woojin Industrial Systems Co., Ltd.", + [3]byte{24, 50, 162}: "LAON TECHNOLOGY CO., LTD.", + [3]byte{24, 51, 157}: "CISCO SYSTEMS, INC.", + [3]byte{24, 52, 81}: "Apple", + [3]byte{24, 54, 252}: "Elecsys International Corporation", + [3]byte{24, 56, 37}: "Wuhan Lingjiu High-tech Co.,Ltd.", + [3]byte{24, 57, 25}: "Unicoi Systems", + [3]byte{24, 59, 210}: "BYD Precision Manufacture Company Ltd.", + [3]byte{24, 61, 162}: "Intel Corporate", + [3]byte{24, 63, 71}: "Samsung Electronics Co.,Ltd", + [3]byte{24, 66, 29}: "PRIVATE", + [3]byte{24, 66, 47}: "Alcatel Lucent", + [3]byte{24, 68, 98}: "Riava Networks, Inc.", + [3]byte{24, 70, 23}: "Samsung Electronics", + [3]byte{24, 72, 216}: "Fastback Networks", + [3]byte{24, 74, 111}: "Alcatel-Lucent Shanghai Bell Co., Ltd", + [3]byte{24, 78, 148}: "MESSOA TECHNOLOGIES INC.", + [3]byte{24, 82, 83}: "Pixord Corporation", + [3]byte{24, 83, 224}: "Hanyang Digitech Co.Ltd", + [3]byte{24, 85, 15}: "Cisco SPVTG", + [3]byte{24, 89, 51}: "Cisco SPVTG", + [3]byte{24, 90, 232}: "Zenotech.Co.,Ltd", + [3]byte{24, 98, 44}: "SAGEMCOM SAS", + [3]byte{24, 100, 114}: "Aruba Networks", + [3]byte{24, 101, 113}: "Top Victory Electronics (Taiwan) Co., Ltd.", + [3]byte{24, 102, 227}: "Veros Systems, Inc.", + [3]byte{24, 103, 63}: "Hanover Displays Limited", + [3]byte{24, 103, 81}: "KOMEG Industrielle Messtechnik GmbH", + [3]byte{24, 103, 176}: "Samsung Electronics Co.,LTD", + [3]byte{24, 109, 153}: "Adanis Inc.", + [3]byte{24, 113, 23}: "eta plus electronic gmbh", + [3]byte{24, 121, 162}: "GMJ ELECTRIC LIMITED", + [3]byte{24, 122, 147}: "AMICCOM Electronics Corporation", + [3]byte{24, 124, 129}: "Valeo Vision Systems", + [3]byte{24, 126, 213}: "shenzhen kaism technology Co. Ltd", + [3]byte{24, 128, 206}: "Barberry Solutions Ltd", + [3]byte{24, 128, 245}: "Alcatel-Lucent Shanghai Bell Co., Ltd", + [3]byte{24, 130, 25}: "Alibaba Cloud Computing Ltd.", + [3]byte{24, 131, 49}: "Samsung Electronics Co.,Ltd", + [3]byte{24, 131, 191}: "Arcadyan Technology Corporation", + [3]byte{24, 132, 16}: "CoreTrust Inc.", + [3]byte{24, 134, 58}: "DIGITAL ART SYSTEM", + [3]byte{24, 134, 172}: "Nokia Danmark A/S", + [3]byte{24, 135, 150}: "HTC Corporation", + [3]byte{24, 136, 87}: "Beijing Jinhong Xi-Dian Information Technology Corp.", + [3]byte{24, 137, 223}: "CerebrEX Inc.", + [3]byte{24, 142, 213}: "TP Vision Belgium N.V. - innovation site Brugge", + [3]byte{24, 146, 44}: "Virtual Instruments", + [3]byte{24, 151, 255}: "TechFaith Wireless Technology Limited", + [3]byte{24, 154, 103}: "CSE-Servelec Limited", + [3]byte{24, 156, 93}: "Cisco", + [3]byte{24, 158, 252}: "Apple", + [3]byte{24, 169, 5}: "Hewlett-Packard Company", + [3]byte{24, 169, 88}: "PROVISION THAI CO., LTD.", + [3]byte{24, 169, 155}: "Dell Inc", + [3]byte{24, 170, 69}: "Fon Technology", + [3]byte{24, 171, 245}: "Ultra Electronics - Electrics", + [3]byte{24, 173, 77}: "Polostar Technology Corporation", + [3]byte{24, 174, 187}: "Siemens Convergence Creators GmbH&Co.KG", + [3]byte{24, 175, 97}: "Apple, Inc", + [3]byte{24, 175, 143}: "Apple", + [3]byte{24, 175, 159}: "DIGITRONIC Automationsanlagen GmbH", + [3]byte{24, 178, 9}: "Torrey Pines Logic, Inc", + [3]byte{24, 179, 186}: "Netlogic AB", + [3]byte{24, 180, 48}: "Nest Labs Inc.", + [3]byte{24, 181, 145}: "I-Storm", + [3]byte{24, 183, 158}: "Invoxia", + [3]byte{24, 192, 134}: "Broadcom Corporation", + [3]byte{24, 196, 81}: "Tucson Embedded Systems", + [3]byte{24, 200, 231}: "Shenzhen Hualistone Technology Co.,Ltd", + [3]byte{24, 204, 35}: "Philio Technology Corporation", + [3]byte{24, 207, 94}: "Liteon Technology Corporation", + [3]byte{24, 208, 113}: "DASAN CO., LTD.", + [3]byte{24, 213, 182}: "SMG Holdings LLC", + [3]byte{24, 214, 106}: "Inmarsat", + [3]byte{24, 214, 207}: "Kurth Electronic GmbH", + [3]byte{24, 217, 73}: "Qvis Labs, LLC", + [3]byte{24, 220, 86}: "Yulong Computer Telecommunication Scientific(shenzhen)Co.,Lt", + [3]byte{24, 226, 136}: "STT Condigi", + [3]byte{24, 226, 194}: "Samsung Electronics", + [3]byte{24, 231, 40}: "Cisco", + [3]byte{24, 231, 244}: "Apple", + [3]byte{24, 232, 15}: "Viking Electronics Inc.", + [3]byte{24, 232, 221}: "MODULETEK", + [3]byte{24, 239, 99}: "CISCO SYSTEMS, INC.", + [3]byte{24, 244, 106}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{24, 246, 80}: "Multimedia Pacific Limited", + [3]byte{24, 248, 122}: "i3 International Inc.", + [3]byte{24, 250, 111}: "ISC applied systems corp", + [3]byte{24, 251, 123}: "Dell Inc", + [3]byte{24, 252, 159}: "Changhe Electronics Co., Ltd.", + [3]byte{24, 254, 52}: "Espressif Inc.", + [3]byte{24, 255, 46}: "Shenzhen Rui Ying Da Technology Co., Ltd", + [3]byte{28, 6, 86}: "IDY Corporation", + [3]byte{28, 8, 193}: "Lg Innotek", + [3]byte{28, 11, 82}: "EPICOM S.A", + [3]byte{28, 15, 207}: "Sypro Optics GmbH", + [3]byte{28, 17, 225}: "Wartsila Finland Oy", + [3]byte{28, 18, 157}: "IEEE PES PSRC/SUB", + [3]byte{28, 20, 72}: "ARRIS Group, Inc.", + [3]byte{28, 23, 211}: "CISCO SYSTEMS, INC.", + [3]byte{28, 24, 74}: "ShenZhen RicherLink Technologies Co.,LTD", + [3]byte{28, 25, 222}: "eyevis GmbH", + [3]byte{28, 26, 192}: "Apple", + [3]byte{28, 27, 104}: "ARRIS Group, Inc.", + [3]byte{28, 28, 253}: "Dalian Hi-Think Computer Technology, Corp", + [3]byte{28, 29, 103}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{28, 29, 134}: "Cisco", + [3]byte{28, 51, 77}: "ITS Telecom", + [3]byte{28, 52, 119}: "Innovation Wireless", + [3]byte{28, 53, 241}: "NEW Lift Neue Elektronische Wege Steuerungsbau GmbH", + [3]byte{28, 55, 191}: "Cloudium Systems Ltd.", + [3]byte{28, 58, 79}: "AccuSpec Electronics, LLC", + [3]byte{28, 61, 231}: "Sigma Koki Co.,Ltd.", + [3]byte{28, 62, 132}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{28, 65, 88}: "Gemalto M2M GmbH", + [3]byte{28, 67, 236}: "JAPAN CIRCUIT CO.,LTD", + [3]byte{28, 69, 147}: "Texas Instruments", + [3]byte{28, 72, 64}: "IMS Messsysteme GmbH", + [3]byte{28, 72, 249}: "GN Netcom A/S", + [3]byte{28, 74, 247}: "AMON INC", + [3]byte{28, 75, 185}: "SMG ENTERPRISE, LLC", + [3]byte{28, 75, 214}: "AzureWave", + [3]byte{28, 81, 181}: "Techaya LTD", + [3]byte{28, 82, 22}: "DONGGUAN HELE ELECTRONICS CO., LTD", + [3]byte{28, 82, 214}: "FLAT DISPLAY TECHNOLOGY CORPORATION", + [3]byte{28, 90, 62}: "Samsung Eletronics Co., Ltd (Visual Display Divison)", + [3]byte{28, 90, 107}: "Philips Electronics Nederland BV", + [3]byte{28, 92, 85}: "PRIMA Cinema, Inc", + [3]byte{28, 92, 96}: "Shenzhen Belzon Technology Co.,LTD.", + [3]byte{28, 95, 255}: "Beijing Ereneben Information Technology Co.,Ltd Shenzhen Branch", + [3]byte{28, 98, 184}: "Samsung Electronics Co.,Ltd", + [3]byte{28, 99, 183}: "OpenProducts 237 AB", + [3]byte{28, 101, 157}: "Liteon Technology Corporation", + [3]byte{28, 102, 109}: "Hon Hai Precision Ind.Co.Ltd", + [3]byte{28, 102, 170}: "Samsung Electronics", + [3]byte{28, 105, 165}: "Research In Motion", + [3]byte{28, 106, 122}: "Cisco", + [3]byte{28, 107, 202}: "Mitsunami Co., Ltd.", + [3]byte{28, 111, 101}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{28, 117, 8}: "COMPAL INFORMATION (KUNSHAN) CO., LTD.", + [3]byte{28, 118, 202}: "Terasic Technologies Inc.", + [3]byte{28, 120, 57}: "Shenzhen Tencent Computer System Co., Ltd.", + [3]byte{28, 123, 33}: "Sony Mobile Communications AB", + [3]byte{28, 124, 17}: "EID", + [3]byte{28, 124, 69}: "Vitek Industrial Video Products, Inc.", + [3]byte{28, 124, 199}: "Coriant GmbH", + [3]byte{28, 126, 81}: "3bumen.com", + [3]byte{28, 126, 229}: "D-Link International", + [3]byte{28, 131, 176}: "Linked IP GmbH", + [3]byte{28, 132, 100}: "FORMOSA WIRELESS COMMUNICATION CORP.", + [3]byte{28, 134, 173}: "MCT CO., LTD.", + [3]byte{28, 142, 142}: "DB Communication & Systems Co., ltd.", + [3]byte{28, 143, 138}: "Phase Motion Control SpA", + [3]byte{28, 145, 121}: "Integrated System Technologies Ltd", + [3]byte{28, 148, 146}: "RUAG Schweiz AG", + [3]byte{28, 149, 93}: "I-LAX ELECTRONICS INC.", + [3]byte{28, 149, 159}: "Veethree Electronics And Marine LLC", + [3]byte{28, 150, 90}: "Weifang goertek Electronics CO.,LTD", + [3]byte{28, 151, 61}: "PRICOM Design", + [3]byte{28, 153, 76}: "Murata Manufactuaring Co.,Ltd.", + [3]byte{28, 156, 38}: "Zoovel Technologies", + [3]byte{28, 158, 203}: "Beijing Nari Smartchip Microelectronics Company Limited", + [3]byte{28, 162, 177}: "ruwido austria gmbh", + [3]byte{28, 167, 112}: "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LT", + [3]byte{28, 170, 7}: "CISCO SYSTEMS, INC.", + [3]byte{28, 171, 1}: "Innovolt", + [3]byte{28, 171, 167}: "Apple", + [3]byte{28, 175, 5}: "Samsung Electronics Co.,Ltd", + [3]byte{28, 175, 247}: "D-LINK INTERNATIONAL PTE LIMITED", + [3]byte{28, 176, 148}: "HTC Corporation", + [3]byte{28, 177, 127}: "NEC Platforms, Ltd.", + [3]byte{28, 178, 67}: "TDC A/S", + [3]byte{28, 186, 140}: "Texas Instruments", + [3]byte{28, 187, 168}: "OJSC \"Ufimskiy Zavod \"Promsvyaz\"", + [3]byte{28, 189, 14}: "Amplified Engineering Pty Ltd", + [3]byte{28, 189, 185}: "D-LINK INTERNATIONAL PTE LIMITED", + [3]byte{28, 193, 26}: "Wavetronix", + [3]byte{28, 193, 222}: "Hewlett-Packard Company", + [3]byte{28, 195, 22}: "MileSight Technology Co., Ltd.", + [3]byte{28, 198, 60}: "Arcadyan Technology Corporation", + [3]byte{28, 212, 12}: "Kriwan Industrie-Elektronik GmbH", + [3]byte{28, 222, 167}: "Cisco", + [3]byte{28, 223, 15}: "CISCO SYSTEMS, INC.", + [3]byte{28, 225, 101}: "Marshal Corporation", + [3]byte{28, 225, 146}: "Qisda Corporation", + [3]byte{28, 226, 204}: "Texas Instruments", + [3]byte{28, 230, 43}: "Apple", + [3]byte{28, 230, 199}: "Cisco", + [3]byte{28, 238, 232}: "Ilshin Elecom", + [3]byte{28, 240, 97}: "SCAPS GmbH", + [3]byte{28, 244, 202}: "PRIVATE", + [3]byte{28, 245, 231}: "Turtle Industry Co., Ltd.", + [3]byte{28, 250, 104}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{28, 252, 187}: "Realfiction ApS", + [3]byte{28, 254, 167}: "IDentytech Solutins Ltd.", + [3]byte{32, 1, 79}: "Linea Research Ltd", + [3]byte{32, 2, 175}: "Murata Manufactuaring Co.,Ltd.", + [3]byte{32, 5, 5}: "RADMAX COMMUNICATION PRIVATE LIMITED", + [3]byte{32, 5, 232}: "OOO InProMedia", + [3]byte{32, 8, 237}: "Huawei Technologies Co., Ltd", + [3]byte{32, 10, 94}: "Xiangshan Giant Eagle Technology Developing co.,LTD", + [3]byte{32, 11, 199}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{32, 12, 200}: "NETGEAR INC.,", + [3]byte{32, 14, 149}: "IEC – TC9 WG43", + [3]byte{32, 16, 122}: "Gemtek Technology Co., Ltd.", + [3]byte{32, 18, 87}: "Most Lucky Trading Ltd", + [3]byte{32, 18, 213}: "Scientech Materials Corporation", + [3]byte{32, 19, 224}: "Samsung Electronics Co.,Ltd", + [3]byte{32, 22, 216}: "Liteon Technology Corporation", + [3]byte{32, 24, 14}: "Shenzhen Sunchip Technology Co., Ltd", + [3]byte{32, 26, 6}: "COMPAL INFORMATION (KUNSHAN) CO., LTD.", + [3]byte{32, 29, 3}: "Elatec GmbH", + [3]byte{32, 33, 165}: "LG Electronics Inc", + [3]byte{32, 37, 100}: "PEGATRON CORPORATION", + [3]byte{32, 37, 152}: "Teleview", + [3]byte{32, 43, 193}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{32, 44, 183}: "Kong Yue Electronics & Information Industry (Xinhui) Ltd.", + [3]byte{32, 55, 6}: "CISCO SYSTEMS, INC.", + [3]byte{32, 55, 188}: "Kuipers Electronic Engineering BV", + [3]byte{32, 58, 7}: "Cisco", + [3]byte{32, 64, 5}: "feno GmbH", + [3]byte{32, 65, 90}: "Smarteh d.o.o.", + [3]byte{32, 68, 58}: "Schneider Electric Asia Pacific Ltd", + [3]byte{32, 70, 161}: "VECOW Co., Ltd", + [3]byte{32, 70, 249}: "Advanced Network Devices (dba:AND)", + [3]byte{32, 74, 170}: "Hanscan Spain S.A.", + [3]byte{32, 76, 109}: "Hugo Brennenstuhl Gmbh & Co. KG.", + [3]byte{32, 78, 107}: "Axxana(israel) ltd", + [3]byte{32, 78, 127}: "NETGEAR", + [3]byte{32, 83, 202}: "Risk Technology Ltd", + [3]byte{32, 84, 118}: "Sony Mobile Communications AB", + [3]byte{32, 87, 33}: "Salix Technology CO., Ltd.", + [3]byte{32, 89, 160}: "Paragon Technologies Inc.", + [3]byte{32, 90, 0}: "Coval", + [3]byte{32, 91, 42}: "PRIVATE", + [3]byte{32, 91, 94}: "Shenzhen Wonhe Technology Co., Ltd", + [3]byte{32, 92, 250}: "Yangzhou ChangLian Network Technology Co,ltd.", + [3]byte{32, 100, 50}: "SAMSUNG ELECTRO MECHANICS CO.,LTD.", + [3]byte{32, 103, 177}: "Pluto inc.", + [3]byte{32, 104, 157}: "Liteon Technology Corporation", + [3]byte{32, 106, 138}: "Wistron InfoComm Manufacturing(Kunshan)Co.,Ltd.", + [3]byte{32, 106, 255}: "Atlas Elektronik UK Limited", + [3]byte{32, 110, 156}: "Samsung Electronics Co.,Ltd", + [3]byte{32, 111, 236}: "Braemac CA LLC", + [3]byte{32, 115, 85}: "ARRIS Group, Inc.", + [3]byte{32, 116, 207}: "Shenzhen Voxtech Co.,Ltd", + [3]byte{32, 118, 0}: "Actiontec Electronics, Inc", + [3]byte{32, 118, 147}: "Lenovo (Beijing) Limited.", + [3]byte{32, 124, 143}: "Quanta Microsystems,Inc.", + [3]byte{32, 125, 116}: "Apple", + [3]byte{32, 133, 140}: "Assa", + [3]byte{32, 135, 172}: "AES motomation", + [3]byte{32, 137, 132}: "COMPAL INFORMATION (KUNSHAN) CO., LTD", + [3]byte{32, 137, 134}: "zte corporation", + [3]byte{32, 145, 138}: "PROFALUX", + [3]byte{32, 145, 217}: "I'M SPA", + [3]byte{32, 147, 77}: "Fujian Star-net Communication Co., Ltd", + [3]byte{32, 154, 233}: "Volacomm Co., Ltd", + [3]byte{32, 155, 165}: "JIAXING GLEAD Electronics Co.,Ltd", + [3]byte{32, 162, 231}: "Lee-Dickens Ltd", + [3]byte{32, 167, 135}: "Bointec Taiwan Corporation Limited", + [3]byte{32, 169, 155}: "Microsoft Corporation", + [3]byte{32, 170, 37}: "IP-NET LLC", + [3]byte{32, 170, 75}: "Cisco-Linksys, LLC", + [3]byte{32, 176, 247}: "Enclustra GmbH", + [3]byte{32, 179, 153}: "Enterasys", + [3]byte{32, 181, 198}: "Mimosa Networks", + [3]byte{32, 183, 192}: "Omicron electronics GmbH", + [3]byte{32, 187, 192}: "Cisco", + [3]byte{32, 187, 198}: "Jabil Circuit Hungary Ltd.", + [3]byte{32, 191, 219}: "DVL", + [3]byte{32, 193, 175}: "i Wit Digital Co., Limited", + [3]byte{32, 195, 143}: "Texas Instruments Inc", + [3]byte{32, 198, 13}: "Shanghai annijie Information technology Co.,LTD", + [3]byte{32, 198, 235}: "Panasonic Corporation AVC Networks Company", + [3]byte{32, 200, 179}: "SHENZHEN BUL-TECH CO.,LTD.", + [3]byte{32, 201, 208}: "Apple", + [3]byte{32, 205, 57}: "Texas Instruments, Inc", + [3]byte{32, 206, 196}: "Peraso Technologies", + [3]byte{32, 207, 48}: "ASUSTek COMPUTER INC.", + [3]byte{32, 210, 31}: "Wincal Technology Corp.", + [3]byte{32, 211, 144}: "Samsung Electronics Co.,Ltd", + [3]byte{32, 213, 171}: "Korea Infocom Co.,Ltd.", + [3]byte{32, 213, 191}: "Samsung Eletronics Co., Ltd", + [3]byte{32, 214, 7}: "Nokia Corporation", + [3]byte{32, 217, 6}: "Iota, Inc.", + [3]byte{32, 220, 147}: "Cheetah Hi-Tech, Inc.", + [3]byte{32, 220, 230}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{32, 223, 63}: "Nanjing SAC Power Grid Automation Co., Ltd.", + [3]byte{32, 229, 42}: "NETGEAR INC.,", + [3]byte{32, 229, 100}: "ARRIS Group, Inc.", + [3]byte{32, 231, 145}: "Siemens Healthcare Diagnostics, Inc", + [3]byte{32, 234, 199}: "SHENZHEN RIOPINE ELECTRONICS CO., LTD", + [3]byte{32, 237, 116}: "Ability enterprise co.,Ltd.", + [3]byte{32, 238, 198}: "Elefirst Science & Tech Co ., ltd", + [3]byte{32, 240, 2}: "MTData Developments Pty. Ltd.", + [3]byte{32, 243, 163}: "Huawei Technologies Co., Ltd", + [3]byte{32, 248, 94}: "Delta Electronics", + [3]byte{32, 250, 187}: "Cambridge Executive Limited", + [3]byte{32, 253, 241}: "3COM EUROPE LTD", + [3]byte{32, 254, 205}: "System In Frontier Inc.", + [3]byte{32, 254, 219}: "M2M Solution S.A.S.", + [3]byte{36, 1, 199}: "Cisco", + [3]byte{36, 5, 15}: "MTN Electronic Co. Ltd", + [3]byte{36, 9, 23}: "Devlin Electronics Limited", + [3]byte{36, 10, 17}: "TCT Mobile Limited", + [3]byte{36, 10, 100}: "AzureWaveTechnologies,Inc", + [3]byte{36, 11, 42}: "Viettel Group", + [3]byte{36, 11, 177}: "KOSTAL Industrie Elektrik GmbH", + [3]byte{36, 16, 100}: "Shenzhen Ecsino Tecnical Co. Ltd", + [3]byte{36, 17, 37}: "Hutek Co., Ltd.", + [3]byte{36, 17, 72}: "Entropix, LLC", + [3]byte{36, 17, 208}: "Chongqing Ehs Science and Technology Development Co.,Ltd.", + [3]byte{36, 26, 140}: "Squarehead Technology AS", + [3]byte{36, 27, 19}: "Shanghai Nutshell Electronic Co., Ltd.", + [3]byte{36, 31, 44}: "Calsys, Inc.", + [3]byte{36, 33, 171}: "Sony Ericsson Mobile Communications", + [3]byte{36, 38, 66}: "SHARP Corporation.", + [3]byte{36, 47, 250}: "Toshiba Global Commerce Solutions", + [3]byte{36, 51, 108}: "PRIVATE", + [3]byte{36, 55, 76}: "Cisco SPVTG", + [3]byte{36, 55, 239}: "EMC Electronic Media Communication SA", + [3]byte{36, 60, 32}: "Dynamode Group", + [3]byte{36, 66, 188}: "Alinco,incorporated", + [3]byte{36, 69, 151}: "GEMUE Gebr. Mueller Apparatebau", + [3]byte{36, 71, 14}: "PentronicAB", + [3]byte{36, 73, 123}: "Innovative Converged Devices Inc", + [3]byte{36, 79, 29}: "iRule LLC", + [3]byte{36, 95, 223}: "KYOCERA Corporation", + [3]byte{36, 98, 120}: "sysmocom - systems for mobile communications GmbH", + [3]byte{36, 100, 239}: "CYG SUNRI CO.,LTD.", + [3]byte{36, 101, 17}: "AVM GmbH", + [3]byte{36, 105, 74}: "Jasmine Systems Inc.", + [3]byte{36, 105, 165}: "Huawei Technologies Co., Ltd", + [3]byte{36, 106, 171}: "IT-IS International", + [3]byte{36, 118, 125}: "Cisco SPVTG", + [3]byte{36, 119, 3}: "Intel Corporate", + [3]byte{36, 128, 0}: "Westcontrol AS", + [3]byte{36, 129, 170}: "KSH International Co., Ltd.", + [3]byte{36, 130, 138}: "Prowave Technologies Ltd.", + [3]byte{36, 134, 244}: "Ctek, Inc.", + [3]byte{36, 135, 7}: "SEnergy Corporation", + [3]byte{36, 147, 202}: "Voxtronic Technology Computer-Systeme GmbH", + [3]byte{36, 148, 66}: "OPEN ROAD SOLUTIONS , INC.", + [3]byte{36, 149, 4}: "SFR", + [3]byte{36, 151, 237}: "Techvision Intelligent Technology Limited", + [3]byte{36, 162, 225}: "Apple, Inc", + [3]byte{36, 164, 44}: "KOUKAAM a.s.", + [3]byte{36, 164, 60}: "Ubiquiti Networks, INC", + [3]byte{36, 164, 149}: "Thales Canada Inc.", + [3]byte{36, 168, 125}: "Panasonic Automotive Systems Asia Pacific(Thailand)Co.,Ltd.", + [3]byte{36, 169, 55}: "PURE Storage", + [3]byte{36, 171, 129}: "Apple", + [3]byte{36, 175, 74}: "Alcatel-Lucent-IPD", + [3]byte{36, 175, 84}: "NEXGEN Mediatech Inc.", + [3]byte{36, 182, 87}: "CISCO SYSTEMS, INC.", + [3]byte{36, 182, 184}: "FRIEM SPA", + [3]byte{36, 182, 253}: "Dell Inc", + [3]byte{36, 184, 140}: "Crenus Co.,Ltd.", + [3]byte{36, 184, 210}: "Opzoon Technology Co.,Ltd.", + [3]byte{36, 186, 48}: "Technical Consumer Products, Inc.", + [3]byte{36, 187, 193}: "Absolute Analysis", + [3]byte{36, 188, 130}: "Dali Wireless, Inc.", + [3]byte{36, 190, 5}: "Hewlett Packard", + [3]byte{36, 191, 116}: "PRIVATE", + [3]byte{36, 192, 179}: "RSF", + [3]byte{36, 198, 150}: "Samsung Electronics Co.,Ltd", + [3]byte{36, 200, 72}: "mywerk system GmbH", + [3]byte{36, 200, 110}: "Chaney Instrument Co.", + [3]byte{36, 201, 161}: "Ruckus Wireless", + [3]byte{36, 201, 222}: "Genoray", + [3]byte{36, 203, 231}: "MYK, Inc.", + [3]byte{36, 207, 33}: "Shenzhen State Micro Technology Co., Ltd", + [3]byte{36, 209, 63}: "MEXUS CO.,LTD", + [3]byte{36, 210, 204}: "SmartDrive Systems Inc.", + [3]byte{36, 217, 33}: "Avaya, Inc", + [3]byte{36, 218, 182}: "Sistemas de Gestión Energética S.A. de C.V", + [3]byte{36, 219, 172}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{36, 219, 173}: "ShopperTrak RCT Corporation", + [3]byte{36, 219, 237}: "Samsung Electronics Co.,Ltd", + [3]byte{36, 222, 198}: "Aruba Networks", + [3]byte{36, 226, 113}: "Qingdao Hisense Communications Co.,Ltd", + [3]byte{36, 227, 20}: "Apple", + [3]byte{36, 230, 186}: "JSC Zavod im. Kozitsky", + [3]byte{36, 233, 179}: "Cisco", + [3]byte{36, 234, 64}: "Systeme Helmholz GmbH", + [3]byte{36, 235, 101}: "SAET I.S. S.r.l.", + [3]byte{36, 236, 153}: "Askey Computer Corp", + [3]byte{36, 236, 214}: "CSG Science & Technology Co.,Ltd.Hefei", + [3]byte{36, 238, 58}: "Chengdu Yingji Electronic Hi-tech Co Ltd", + [3]byte{36, 240, 255}: "GHT Co., Ltd.", + [3]byte{36, 242, 221}: "Radiant Zemax LLC", + [3]byte{36, 245, 170}: "Samsung Electronics Co.,LTD", + [3]byte{36, 253, 82}: "Liteon Technology Corporation", + [3]byte{40, 4, 224}: "FERMAX ELECTRONICA S.A.U.", + [3]byte{40, 6, 30}: "NINGBO GLOBAL USEFUL ELECTRIC CO.,LTD", + [3]byte{40, 6, 141}: "ITL, LLC", + [3]byte{40, 11, 92}: "Apple", + [3]byte{40, 12, 184}: "Mikrosay Yazilim ve Elektronik A.S.", + [3]byte{40, 13, 252}: "Sony Computer Entertainment Inc.", + [3]byte{40, 16, 123}: "D-Link International", + [3]byte{40, 20, 113}: "Lantis co., LTD.", + [3]byte{40, 22, 46}: "2Wire", + [3]byte{40, 23, 206}: "Omnisense Ltd", + [3]byte{40, 24, 120}: "Microsoft Corporation", + [3]byte{40, 24, 253}: "Aditya Infotech Ltd.", + [3]byte{40, 34, 70}: "Beijing Sinoix Communication Co., LTD", + [3]byte{40, 38, 166}: "PBR electronics GmbH", + [3]byte{40, 40, 93}: "ZyXEL Communications Corporation", + [3]byte{40, 41, 204}: "Corsa Technology Incorporated", + [3]byte{40, 41, 217}: "GlobalBeiMing technology (Beijing)Co. Ltd", + [3]byte{40, 44, 178}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{40, 49, 82}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{40, 50, 197}: "Humax.co.,ltd", + [3]byte{40, 52, 16}: "Enigma Diagnostics Limited", + [3]byte{40, 52, 162}: "Cisco", + [3]byte{40, 55, 55}: "Apple", + [3]byte{40, 56, 207}: "Gen2wave", + [3]byte{40, 57, 231}: "Preceno Technology Pte.Ltd.", + [3]byte{40, 59, 150}: "Cool Control LTD", + [3]byte{40, 60, 228}: "Huawei Technologies Co., Ltd", + [3]byte{40, 64, 26}: "C8 MediSensors, Inc.", + [3]byte{40, 65, 33}: "OptiSense Network, LLC", + [3]byte{40, 68, 48}: "GenesisTechnical Systems (UK) Ltd", + [3]byte{40, 71, 170}: "Nokia Corporation", + [3]byte{40, 72, 70}: "GridCentric Inc.", + [3]byte{40, 76, 83}: "Intune Networks", + [3]byte{40, 77, 146}: "Luminator", + [3]byte{40, 78, 215}: "OutSmart Power Systems, Inc.", + [3]byte{40, 79, 206}: "Liaoning Wontel Science and Technology Development Co.,Ltd.", + [3]byte{40, 81, 50}: "Shenzhen Prayfly Technology Co.,Ltd", + [3]byte{40, 87, 103}: "Echostar Technologies Corp", + [3]byte{40, 95, 219}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{40, 96, 70}: "Lantech Communications Global, Inc.", + [3]byte{40, 96, 148}: "CAPELEC", + [3]byte{40, 99, 54}: "Siemens AG - Industrial Automation - EWA", + [3]byte{40, 101, 107}: "Keystone Microtech Corporation", + [3]byte{40, 106, 184}: "Apple", + [3]byte{40, 106, 186}: "Apple", + [3]byte{40, 109, 151}: "SAMJIN Co., Ltd.", + [3]byte{40, 110, 212}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{40, 113, 132}: "Spire Payments", + [3]byte{40, 114, 197}: "Smartmatic Corp", + [3]byte{40, 114, 240}: "ATHENA", + [3]byte{40, 121, 148}: "Realplay Digital Technology(Shenzhen) Co.,Ltd", + [3]byte{40, 128, 35}: "Hewlett Packard", + [3]byte{40, 133, 45}: "Touch Networks", + [3]byte{40, 137, 21}: "CashGuard Sverige AB", + [3]byte{40, 138, 28}: "Juniper networks", + [3]byte{40, 145, 208}: "Stage Tec Entwicklungsgesellschaft für professionelle Audiotechnik mbH", + [3]byte{40, 146, 74}: "Hewlett Packard", + [3]byte{40, 147, 254}: "CISCO SYSTEMS, INC.", + [3]byte{40, 148, 15}: "CISCO SYSTEMS, INC.", + [3]byte{40, 148, 175}: "Samhwa Telecom", + [3]byte{40, 152, 123}: "Samsung Electronics Co.,Ltd", + [3]byte{40, 154, 75}: "SteelSeries ApS", + [3]byte{40, 154, 250}: "TCT Mobile Limited", + [3]byte{40, 158, 223}: "Danfoss Turbocor Compressors, Inc", + [3]byte{40, 161, 134}: "enblink", + [3]byte{40, 161, 146}: "GERP Solution", + [3]byte{40, 161, 235}: "ETEK TECHNOLOGY (SHENZHEN) CO.,LTD", + [3]byte{40, 162, 65}: "exlar corp", + [3]byte{40, 165, 116}: "Miller Electric Mfg. Co.", + [3]byte{40, 165, 238}: "Shenzhen SDGI CATV Co., Ltd", + [3]byte{40, 175, 10}: "Sirius XM Radio Inc", + [3]byte{40, 176, 204}: "Xenya d.o.o.", + [3]byte{40, 178, 189}: "Intel Corporate", + [3]byte{40, 179, 171}: "Genmark Automation", + [3]byte{40, 186, 24}: "NextNav, LLC", + [3]byte{40, 186, 181}: "Samsung Electronics Co.,Ltd", + [3]byte{40, 187, 89}: "RNET Technologies, Inc.", + [3]byte{40, 190, 155}: "Technicolor USA Inc.", + [3]byte{40, 192, 218}: "Juniper Networks", + [3]byte{40, 198, 113}: "Yota Devices OY", + [3]byte{40, 198, 142}: "NETGEAR INC.,", + [3]byte{40, 199, 24}: "Altierre", + [3]byte{40, 199, 206}: "Cisco", + [3]byte{40, 200, 37}: "DellKing Industrial Co., Ltd", + [3]byte{40, 201, 20}: "Taimag Corporation", + [3]byte{40, 203, 235}: "One", + [3]byte{40, 204, 1}: "Samsung Electronics Co.,Ltd", + [3]byte{40, 204, 255}: "Corporacion Empresarial Altra SL", + [3]byte{40, 205, 28}: "Espotel Oy", + [3]byte{40, 205, 76}: "Individual Computers GmbH", + [3]byte{40, 205, 156}: "Shenzhen Dynamax Software Development Co.,Ltd.", + [3]byte{40, 207, 218}: "Apple", + [3]byte{40, 207, 233}: "Apple", + [3]byte{40, 209, 175}: "Nokia Corporation", + [3]byte{40, 210, 68}: "LCFC(HeFei) Electronics Technology Co., Ltd.", + [3]byte{40, 213, 118}: "Premier Wireless, Inc.", + [3]byte{40, 217, 62}: "Telecor Inc.", + [3]byte{40, 217, 138}: "Hangzhou Konke Technology Co.,Ltd.", + [3]byte{40, 217, 151}: "Yuduan Mobile Co., Ltd.", + [3]byte{40, 219, 129}: "Shanghai Guao Electronic Technology Co., Ltd", + [3]byte{40, 222, 246}: "bioMerieux Inc.", + [3]byte{40, 224, 44}: "Apple", + [3]byte{40, 225, 76}: "Apple, Inc.", + [3]byte{40, 226, 151}: "Shanghai InfoTM Microelectronics Co.,Ltd.", + [3]byte{40, 227, 31}: "Xiaomi inc.", + [3]byte{40, 227, 71}: "Liteon Technology Corporation", + [3]byte{40, 230, 8}: "Tokheim", + [3]byte{40, 230, 233}: "SIS Sat Internet Services GmbH", + [3]byte{40, 231, 148}: "Microtime Computer Inc.", + [3]byte{40, 231, 207}: "Apple", + [3]byte{40, 237, 88}: "JAG Jakob AG", + [3]byte{40, 238, 44}: "Frontline Test Equipment", + [3]byte{40, 239, 1}: "PRIVATE", + [3]byte{40, 243, 88}: "2C - Trifonov & Co", + [3]byte{40, 245, 50}: "ADD-Engineering BV", + [3]byte{40, 246, 6}: "Syes srl", + [3]byte{40, 251, 211}: "Ragentek Technology Group", + [3]byte{40, 252, 81}: "The Electric Controller and Manufacturing Co., LLC", + [3]byte{40, 252, 246}: "Shenzhen Xin KingBrand enterprises Co.,Ltd", + [3]byte{44, 0, 44}: "UNOWHY", + [3]byte{44, 0, 51}: "EControls, LLC", + [3]byte{44, 0, 247}: "XOS", + [3]byte{44, 1, 11}: "NASCENT Technology, LLC - RemKon", + [3]byte{44, 6, 35}: "Win Leader Inc.", + [3]byte{44, 7, 60}: "DEVLINE LIMITED", + [3]byte{44, 16, 193}: "Nintendo Co., Ltd.", + [3]byte{44, 24, 174}: "Trend Electronics Co., Ltd.", + [3]byte{44, 25, 132}: "IDN Telecom, Inc.", + [3]byte{44, 26, 49}: "Electronics Company Limited", + [3]byte{44, 30, 234}: "AERODEV", + [3]byte{44, 33, 114}: "Juniper Networks", + [3]byte{44, 36, 95}: "Babolat VS", + [3]byte{44, 38, 197}: "zte corporation", + [3]byte{44, 39, 215}: "Hewlett-Packard Company", + [3]byte{44, 40, 45}: "BBK COMMUNICATIAO TECHNOLOGY CO.,LTD.", + [3]byte{44, 41, 151}: "Microsoft Corporation", + [3]byte{44, 45, 72}: "bct electronic GesmbH", + [3]byte{44, 48, 104}: "Pantech Co.,Ltd", + [3]byte{44, 51, 122}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{44, 52, 39}: "ERCO & GENER", + [3]byte{44, 53, 87}: "ELLIY Power CO..Ltd", + [3]byte{44, 54, 160}: "Capisco Limited", + [3]byte{44, 54, 248}: "CISCO SYSTEMS, INC.", + [3]byte{44, 55, 49}: "ShenZhen Yifang Digital Technology Co.,LTD", + [3]byte{44, 55, 150}: "CYBO CO.,LTD.", + [3]byte{44, 57, 150}: "SAGEMCOM", + [3]byte{44, 57, 193}: "Ciena Corporation", + [3]byte{44, 58, 40}: "Fagor Electrónica", + [3]byte{44, 59, 253}: "Netstor Technology Co., Ltd.", + [3]byte{44, 62, 207}: "Cisco", + [3]byte{44, 63, 56}: "CISCO SYSTEMS, INC.", + [3]byte{44, 63, 62}: "Alge-Timing GmbH", + [3]byte{44, 65, 56}: "Hewlett-Packard Company", + [3]byte{44, 68, 1}: "Samsung Electronics Co.,Ltd", + [3]byte{44, 68, 27}: "Spectrum Medical Limited", + [3]byte{44, 68, 253}: "Hewlett Packard", + [3]byte{44, 80, 137}: "Shenzhen Kaixuan Visual Technology Co.,Limited", + [3]byte{44, 83, 74}: "Shenzhen Winyao Electronic Limited", + [3]byte{44, 84, 45}: "CISCO SYSTEMS, INC.", + [3]byte{44, 84, 207}: "LG Electronics", + [3]byte{44, 85, 60}: "Gainspeed, Inc.", + [3]byte{44, 89, 229}: "Hewlett Packard", + [3]byte{44, 90, 5}: "Nokia Corporation", + [3]byte{44, 90, 163}: "PROMATE ELECTRONIC CO.LTD", + [3]byte{44, 91, 225}: "Centripetal Networks, Inc", + [3]byte{44, 93, 147}: "Ruckus Wireless", + [3]byte{44, 95, 243}: "Pertronic Industries", + [3]byte{44, 96, 12}: "QUANTA COMPUTER INC.", + [3]byte{44, 98, 90}: "Finest Security Systems Co., Ltd", + [3]byte{44, 98, 137}: "Regenersis (Glenrothes) Ltd", + [3]byte{44, 103, 251}: "ShenZhen Zhengjili Electronics Co., LTD", + [3]byte{44, 105, 186}: "RF Controls, LLC", + [3]byte{44, 107, 245}: "Juniper networks", + [3]byte{44, 113, 85}: "HiveMotion", + [3]byte{44, 114, 195}: "Soundmatters", + [3]byte{44, 117, 15}: "Shanghai Dongzhou-Lawton Communication Technology Co. Ltd.", + [3]byte{44, 118, 138}: "Hewlett-Packard Company", + [3]byte{44, 123, 90}: "Milper Ltd", + [3]byte{44, 123, 132}: "OOO Petr Telegin", + [3]byte{44, 126, 207}: "Onzo Ltd", + [3]byte{44, 128, 101}: "HARTING Inc. of North America", + [3]byte{44, 129, 88}: "Hon Hai Precision Ind. Co.,Ltd", + [3]byte{44, 138, 114}: "HTC Corporation", + [3]byte{44, 139, 242}: "Hitachi Metals America Ltd", + [3]byte{44, 145, 39}: "Eintechno Corporation", + [3]byte{44, 146, 44}: "Kishu Giken Kogyou Company Ltd,.", + [3]byte{44, 148, 100}: "Cincoze Co., Ltd.", + [3]byte{44, 149, 127}: "zte corporation", + [3]byte{44, 151, 23}: "I.C.Y. B.V.", + [3]byte{44, 154, 164}: "NGI SpA", + [3]byte{44, 158, 95}: "ARRIS Group, Inc.", + [3]byte{44, 158, 252}: "CANON INC.", + [3]byte{44, 161, 87}: "acromate, Inc.", + [3]byte{44, 163, 14}: "POWER DRAGON DEVELOPMENT LIMITED", + [3]byte{44, 167, 128}: "True Technologies Inc.", + [3]byte{44, 168, 53}: "RIM", + [3]byte{44, 171, 37}: "Shenzhen Gongjin Electronics Co.,Ltd", + [3]byte{44, 171, 164}: "Cisco SPVTG", + [3]byte{44, 176, 93}: "NETGEAR", + [3]byte{44, 176, 223}: "Soliton Technologies Pvt Ltd", + [3]byte{44, 180, 58}: "Apple", + [3]byte{44, 182, 147}: "Radware", + [3]byte{44, 182, 157}: "RED Digital Cinema", + [3]byte{44, 190, 8}: "Apple", + [3]byte{44, 190, 151}: "Ingenieurbuero Bickele und Buehler GmbH", + [3]byte{44, 194, 96}: "Ravello Systems", + [3]byte{44, 204, 21}: "Nokia Corporation", + [3]byte{44, 205, 39}: "Precor Inc", + [3]byte{44, 205, 67}: "Summit Technology Group", + [3]byte{44, 205, 105}: "Aqavi.com", + [3]byte{44, 208, 90}: "Liteon Technology Corporation", + [3]byte{44, 209, 218}: "Sanjole, Inc.", + [3]byte{44, 210, 231}: "Nokia Corporation", + [3]byte{44, 212, 68}: "Fujitsu Limited", + [3]byte{44, 221, 12}: "Discovergy GmbH", + [3]byte{44, 226, 168}: "DeviceDesign", + [3]byte{44, 228, 18}: "SAGEMCOM SAS", + [3]byte{44, 230, 204}: "Ruckus Wireless", + [3]byte{44, 232, 113}: "Alert Metalguard ApS", + [3]byte{44, 237, 235}: "Alpheus Digital Company Limited", + [3]byte{44, 238, 38}: "Petroleum Geo-Services", + [3]byte{44, 240, 238}: "Apple", + [3]byte{44, 242, 3}: "EMKO ELEKTRONIK SAN VE TIC AS", + [3]byte{44, 244, 197}: "Avaya, Inc", + [3]byte{44, 247, 241}: "Seeed Technology Inc.", + [3]byte{44, 250, 162}: "Alcatel-Lucent", + [3]byte{48, 5, 92}: "Brother industries, LTD.", + [3]byte{48, 11, 156}: "Delta Mobile Systems, Inc.", + [3]byte{48, 13, 42}: "Zhejiang Wellcom Technology Co.,Ltd.", + [3]byte{48, 14, 213}: "Hon Hai Precision Ind.Co.Ltd", + [3]byte{48, 16, 179}: "Liteon Technology Corporation", + [3]byte{48, 16, 228}: "Apple, Inc.", + [3]byte{48, 20, 45}: "Piciorgros GmbH", + [3]byte{48, 20, 74}: "Wistron Neweb Corp.", + [3]byte{48, 21, 24}: "Ubiquitous Communication Co. ltd.", + [3]byte{48, 22, 141}: "ProLon", + [3]byte{48, 23, 200}: "Sony Ericsson Mobile Communications AB", + [3]byte{48, 24, 207}: "DEOS control systems GmbH", + [3]byte{48, 25, 102}: "Samsung Electronics Co.,Ltd", + [3]byte{48, 26, 40}: "Mako Networks Ltd", + [3]byte{48, 33, 91}: "Shenzhen Ostar Display Electronic Co.,Ltd", + [3]byte{48, 45, 232}: "JDA, LLC (JDA Systems)", + [3]byte{48, 50, 148}: "W-IE-NE-R Plein & Baus GmbH", + [3]byte{48, 50, 212}: "Hanilstm Co., Ltd.", + [3]byte{48, 51, 53}: "Boosty", + [3]byte{48, 55, 166}: "CISCO SYSTEMS, INC.", + [3]byte{48, 56, 85}: "Nokia Corporation", + [3]byte{48, 57, 38}: "Sony Ericsson Mobile Communications AB", + [3]byte{48, 57, 85}: "Shenzhen Jinhengjia Electronic Co., Ltd.", + [3]byte{48, 57, 242}: "ADB Broadband Italia", + [3]byte{48, 58, 100}: "Intel Corporate", + [3]byte{48, 61, 8}: "GLINTT TES S.A.", + [3]byte{48, 62, 173}: "Sonavox Canada Inc", + [3]byte{48, 65, 116}: "ALTEC LANSING LLC", + [3]byte{48, 66, 37}: "BURG-WÄCHTER KG", + [3]byte{48, 68, 73}: "PLATH GmbH", + [3]byte{48, 70, 154}: "NETGEAR", + [3]byte{48, 73, 59}: "Nanjing Z-Com Wireless Co.,Ltd", + [3]byte{48, 76, 126}: "Panasonic Electric Works Automation Controls Techno Co.,Ltd.", + [3]byte{48, 78, 195}: "Tianjin Techua Technology Co., Ltd.", + [3]byte{48, 81, 248}: "BYK-Gardner GmbH", + [3]byte{48, 82, 90}: "NST Co., LTD", + [3]byte{48, 85, 237}: "Trex Network LLC", + [3]byte{48, 87, 172}: "IRLAB LTD.", + [3]byte{48, 89, 91}: "streamnow AG", + [3]byte{48, 89, 183}: "Microsoft", + [3]byte{48, 93, 56}: "Beissbarth", + [3]byte{48, 96, 35}: "ARRIS Group, Inc.", + [3]byte{48, 97, 18}: "PAV GmbH", + [3]byte{48, 97, 24}: "Paradom Inc.", + [3]byte{48, 101, 236}: "Wistron (ChongQing)", + [3]byte{48, 104, 140}: "Reach Technology Inc.", + [3]byte{48, 105, 75}: "RIM", + [3]byte{48, 108, 190}: "Skymotion Technology (HK) Limited", + [3]byte{48, 110, 92}: "Validus Technologies", + [3]byte{48, 113, 178}: "Hangzhou Prevail Optoelectronic Equipment Co.,LTD.", + [3]byte{48, 115, 80}: "Inpeco SA", + [3]byte{48, 117, 18}: "Sony Mobile Communications AB", + [3]byte{48, 118, 111}: "LG Electronics", + [3]byte{48, 119, 203}: "Maike Industry(Shenzhen)CO.,LTD", + [3]byte{48, 120, 107}: "TIANJIN Golden Pentagon Electronics Co., Ltd.", + [3]byte{48, 120, 194}: "Innowireless, Co. Ltd.", + [3]byte{48, 124, 48}: "RIM", + [3]byte{48, 126, 203}: "SFR", + [3]byte{48, 133, 169}: "Asustek Computer Inc", + [3]byte{48, 135, 48}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{48, 137, 153}: "Guangdong East Power Co.,", + [3]byte{48, 140, 251}: "Dropcam", + [3]byte{48, 144, 171}: "Apple", + [3]byte{48, 145, 143}: "Technicolor", + [3]byte{48, 146, 246}: "SHANGHAI SUNMON COMMUNICATION TECHNOGY CO.,LTD", + [3]byte{48, 155, 173}: "BBK Electronics Corp., Ltd.,", + [3]byte{48, 168, 219}: "Sony Mobile Communications AB", + [3]byte{48, 170, 189}: "Shanghai Reallytek Information Technology Co.,Ltd", + [3]byte{48, 174, 123}: "Deqing Dusun Electron CO., LTD", + [3]byte{48, 174, 246}: "Radio Mobile Access", + [3]byte{48, 178, 22}: "Hytec Geraetebau GmbH", + [3]byte{48, 179, 162}: "Shenzhen Heguang Measurement & Control Technology Co.,Ltd", + [3]byte{48, 181, 194}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{48, 181, 241}: "Aitexin Technology Co., Ltd", + [3]byte{48, 199, 80}: "MIC Technology Group", + [3]byte{48, 199, 174}: "Samsung Electronics Co.,Ltd", + [3]byte{48, 200, 42}: "Wi-Next s.r.l.", + [3]byte{48, 205, 167}: "Samsung Electronics ITS, Printer division", + [3]byte{48, 209, 126}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{48, 211, 87}: "Logosol, Inc.", + [3]byte{48, 212, 106}: "Autosales Incorporated", + [3]byte{48, 213, 135}: "Samsung Electronics Co.,Ltd", + [3]byte{48, 214, 201}: "Samsung Electronics Co.,Ltd", + [3]byte{48, 222, 134}: "Cedac Software S.r.l.", + [3]byte{48, 228, 142}: "Vodafone UK", + [3]byte{48, 228, 219}: "CISCO SYSTEMS, INC.", + [3]byte{48, 235, 37}: "INTEK DIGITAL", + [3]byte{48, 239, 209}: "Alstom Strongwish (Shenzhen) Co., Ltd.", + [3]byte{48, 243, 29}: "zte corporation", + [3]byte{48, 243, 58}: "+plugg srl", + [3]byte{48, 244, 47}: "ESP", + [3]byte{48, 247, 13}: "Cisco Systems", + [3]byte{48, 247, 197}: "Apple", + [3]byte{48, 247, 215}: "Thread Technology Co., Ltd", + [3]byte{48, 249, 237}: "Sony Corporation", + [3]byte{48, 250, 183}: "Tunai Creative", + [3]byte{48, 253, 17}: "MACROTECH (USA) INC.", + [3]byte{52, 0, 163}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{52, 2, 134}: "Intel Corporate", + [3]byte{52, 2, 155}: "CloudBerry Technologies Private Limited", + [3]byte{52, 7, 251}: "Ericsson AB", + [3]byte{52, 8, 4}: "D-Link Corporation", + [3]byte{52, 10, 255}: "Qingdao Hisense Communications Co.,Ltd", + [3]byte{52, 19, 168}: "Mediplan Limited", + [3]byte{52, 19, 232}: "Intel Corporate", + [3]byte{52, 21, 158}: "Apple", + [3]byte{52, 23, 235}: "Dell Inc", + [3]byte{52, 26, 76}: "SHENZHEN WEIBU ELECTRONICS CO.,LTD.", + [3]byte{52, 27, 34}: "Grandbeing Technology Co., Ltd", + [3]byte{52, 33, 9}: "Jensen Scandinavia AS", + [3]byte{52, 35, 135}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{52, 35, 186}: "Samsung Electro Mechanics co.,LTD.", + [3]byte{52, 37, 93}: "Shenzhen Loadcom Technology Co.,Ltd", + [3]byte{52, 40, 240}: "ATN International Limited", + [3]byte{52, 41, 234}: "MCD ELECTRONICS SP. Z O.O.", + [3]byte{52, 47, 110}: "Anywire corporation", + [3]byte{52, 49, 17}: "Samsung Electronics Co.,Ltd", + [3]byte{52, 49, 196}: "AVM GmbH", + [3]byte{52, 56, 175}: "Inlab Software GmbH", + [3]byte{52, 64, 181}: "IBM", + [3]byte{52, 70, 111}: "HiTEM Engineering", + [3]byte{52, 75, 61}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{52, 75, 80}: "ZTE Corporation", + [3]byte{52, 77, 234}: "zte corporation", + [3]byte{52, 77, 247}: "LG Electronics", + [3]byte{52, 79, 63}: "IO-Power Technology Co., Ltd.", + [3]byte{52, 79, 92}: "R&M AG", + [3]byte{52, 79, 105}: "EKINOPS SAS", + [3]byte{52, 81, 170}: "JID GLOBAL", + [3]byte{52, 81, 201}: "Apple", + [3]byte{52, 91, 17}: "EVI HEAT AB", + [3]byte{52, 92, 64}: "Cargt Holdings LLC", + [3]byte{52, 93, 16}: "Wytek", + [3]byte{52, 97, 120}: "The Boeing Company", + [3]byte{52, 98, 136}: "Cisco", + [3]byte{52, 100, 169}: "Hewlett Packard", + [3]byte{52, 104, 74}: "Teraworks Co., Ltd.", + [3]byte{52, 107, 211}: "Huawei Technologies Co., Ltd", + [3]byte{52, 110, 138}: "Ecosense", + [3]byte{52, 111, 144}: "Cisco", + [3]byte{52, 111, 146}: "White Rodgers Division", + [3]byte{52, 117, 199}: "Avaya, Inc", + [3]byte{52, 118, 197}: "I-O DATA DEVICE, INC.", + [3]byte{52, 120, 119}: "O-NET Communications(Shenzhen) Limited", + [3]byte{52, 126, 57}: "Nokia Danmark A/S", + [3]byte{52, 129, 55}: "UNICARD SA", + [3]byte{52, 129, 196}: "AVM GmbH", + [3]byte{52, 130, 222}: "Kayo Technology, Inc.", + [3]byte{52, 131, 2}: "iFORCOM Co., Ltd", + [3]byte{52, 132, 70}: "Ericsson AB", + [3]byte{52, 134, 42}: "Heinz Lackmann GmbH & Co KG", + [3]byte{52, 136, 93}: "Logitech Far East", + [3]byte{52, 138, 174}: "SAGEMCOM SAS", + [3]byte{52, 149, 219}: "Logitec Corporation", + [3]byte{52, 151, 251}: "ADVANCED RF TECHNOLOGIES INC", + [3]byte{52, 153, 111}: "VPI Engineering", + [3]byte{52, 153, 215}: "Universal Flow Monitors, Inc.", + [3]byte{52, 154, 13}: "ZBD Displays Ltd", + [3]byte{52, 157, 144}: "Heinzmann GmbH & CO. KG", + [3]byte{52, 161, 131}: "AWare, Inc", + [3]byte{52, 163, 191}: "Terewave. Inc.", + [3]byte{52, 165, 93}: "TECHNOSOFT INTERNATIONAL SRL", + [3]byte{52, 165, 225}: "Sensorist ApS", + [3]byte{52, 166, 140}: "Shine Profit Development Limited", + [3]byte{52, 167, 9}: "Trevil srl", + [3]byte{52, 167, 186}: "Fischer International Systems Corporation", + [3]byte{52, 168, 67}: "KYOCERA Display Corporation", + [3]byte{52, 168, 78}: "Cisco", + [3]byte{52, 170, 139}: "Samsung Electronics Co.,Ltd", + [3]byte{52, 170, 153}: "Alcatel-Lucent", + [3]byte{52, 170, 238}: "Mikrovisatos Servisas UAB", + [3]byte{52, 173, 228}: "Shanghai Chint Power Systems Co., Ltd.", + [3]byte{52, 175, 44}: "Nintendo Co., Ltd.", + [3]byte{52, 177, 247}: "Texas Instruments", + [3]byte{52, 181, 113}: "PLDS", + [3]byte{52, 183, 253}: "Guangzhou Younghead Electronic Technology Co.,Ltd", + [3]byte{52, 186, 81}: "Se-Kure Controls, Inc.", + [3]byte{52, 186, 154}: "Asiatelco Technologies Co.", + [3]byte{52, 187, 31}: "Research In Motion", + [3]byte{52, 187, 38}: "Motorola Mobility LLC", + [3]byte{52, 188, 166}: "Beijing Ding Qing Technology, Ltd.", + [3]byte{52, 189, 200}: "Cisco Systems", + [3]byte{52, 189, 249}: "Shanghai WDK Industrial Co.,Ltd.", + [3]byte{52, 189, 250}: "Cisco SPVTG", + [3]byte{52, 190, 0}: "Samsung Electronics Co.,Ltd", + [3]byte{52, 191, 144}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{52, 192, 89}: "Apple", + [3]byte{52, 195, 172}: "Samsung Electronics", + [3]byte{52, 197, 208}: "Hagleitner Hygiene International GmbH", + [3]byte{52, 198, 154}: "Enecsys Ltd", + [3]byte{52, 199, 49}: "ALPS Co,. Ltd.", + [3]byte{52, 200, 3}: "Nokia Corporation", + [3]byte{52, 201, 157}: "EIDOLON COMMUNICATIONS TECHNOLOGY CO. LTD.", + [3]byte{52, 205, 109}: "CommSky Technologies", + [3]byte{52, 205, 190}: "Huawei Technologies Co., Ltd", + [3]byte{52, 206, 148}: "Parsec (Pty) Ltd", + [3]byte{52, 208, 155}: "MobilMAX Technology Inc.", + [3]byte{52, 210, 196}: "RENA GmbH Print Systeme", + [3]byte{52, 215, 180}: "Tributary Systems, Inc.", + [3]byte{52, 219, 253}: "Cisco", + [3]byte{52, 222, 26}: "Intel Corporate", + [3]byte{52, 222, 52}: "zte corporation", + [3]byte{52, 223, 42}: "Fujikon Industrial Co.,Limited", + [3]byte{52, 224, 207}: "zte corporation", + [3]byte{52, 224, 215}: "DONGGUAN QISHENG ELECTRONICS INDUSTRIAL CO., LTD", + [3]byte{52, 226, 253}: "Apple", + [3]byte{52, 228, 42}: "Automatic Bar Controls Inc.", + [3]byte{52, 230, 173}: "Intel Corporate", + [3]byte{52, 230, 215}: "Dell Inc.", + [3]byte{52, 239, 68}: "2Wire", + [3]byte{52, 239, 139}: "NTT Communications Corporation", + [3]byte{52, 240, 202}: "Shenzhen Linghangyuan Digital Technology Co.,Ltd.", + [3]byte{52, 243, 155}: "WizLAN Ltd.", + [3]byte{52, 246, 45}: "SHARP Corporation", + [3]byte{52, 246, 210}: "Panasonic Taiwan Co.,Ltd.", + [3]byte{52, 249, 104}: "ATEK Products, LLC", + [3]byte{52, 250, 64}: "Guangzhou Robustel Technologies Co., Limited", + [3]byte{52, 252, 111}: "ALCEA", + [3]byte{56, 1, 151}: "Toshiba Samsung Storage Technolgoy Korea Corporation", + [3]byte{56, 6, 180}: "A.D.C. GmbH", + [3]byte{56, 8, 253}: "Silca Spa", + [3]byte{56, 10, 10}: "Sky-City Communication and Electronics Limited Company", + [3]byte{56, 10, 148}: "Samsung Electronics Co.,Ltd", + [3]byte{56, 11, 64}: "Samsung Electronics Co.,Ltd", + [3]byte{56, 13, 212}: "Primax Electronics LTD.", + [3]byte{56, 14, 123}: "V.P.S. Thai Co., Ltd", + [3]byte{56, 15, 74}: "Apple", + [3]byte{56, 15, 228}: "Dedicated Network Partners Oy", + [3]byte{56, 22, 209}: "Samsung Electronics Co.,Ltd", + [3]byte{56, 23, 102}: "PROMZAKAZ LTD.", + [3]byte{56, 25, 47}: "Nokia Corporation", + [3]byte{56, 28, 26}: "Cisco", + [3]byte{56, 28, 74}: "SIMCom Wireless Solutions Co.,Ltd.", + [3]byte{56, 34, 157}: "Pirelli Tyre S.p.A.", + [3]byte{56, 34, 214}: "H3C Technologies Co., Limited", + [3]byte{56, 38, 43}: "UTran Technology", + [3]byte{56, 38, 205}: "ANDTEK", + [3]byte{56, 40, 234}: "Fujian Netcom Technology Co., LTD", + [3]byte{56, 44, 74}: "ASUSTek COMPUTER INC.", + [3]byte{56, 45, 209}: "Samsung Electronics Co.,Ltd", + [3]byte{56, 49, 172}: "WEG", + [3]byte{56, 59, 200}: "2wire", + [3]byte{56, 63, 16}: "DBL Technology Ltd.", + [3]byte{56, 66, 51}: "Wildeboer Bauteile GmbH", + [3]byte{56, 66, 166}: "Ingenieurbuero Stahlkopf", + [3]byte{56, 67, 105}: "Patrol Products Consortium LLC", + [3]byte{56, 69, 140}: "MyCloud Technology corporation", + [3]byte{56, 70, 8}: "ZTE Corporation", + [3]byte{56, 72, 76}: "Apple", + [3]byte{56, 75, 118}: "AIRTAME ApS", + [3]byte{56, 79, 240}: "Azurewave Technologies, Inc.", + [3]byte{56, 82, 26}: "Alcatel-Lucent 7705", + [3]byte{56, 88, 12}: "Panaccess Systems GmbH", + [3]byte{56, 89, 248}: "MindMade sp. z o.o.", + [3]byte{56, 89, 249}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{56, 90, 168}: "Beijing Zhongdun Security Technology Development Co.", + [3]byte{56, 95, 195}: "Yu Jeong System, Co.Ltd", + [3]byte{56, 96, 119}: "PEGATRON CORPORATION", + [3]byte{56, 99, 187}: "Hewlett Packard", + [3]byte{56, 99, 246}: "3NOD MULTIMEDIA(SHENZHEN)CO.,LTD", + [3]byte{56, 102, 69}: "OOSIC Technology CO.,Ltd", + [3]byte{56, 103, 147}: "Asia Optical Co., Inc.", + [3]byte{56, 107, 187}: "ARRIS Group, Inc.", + [3]byte{56, 108, 155}: "Ivy Biomedical", + [3]byte{56, 110, 33}: "Wasion Group Ltd.", + [3]byte{56, 114, 192}: "COMTREND", + [3]byte{56, 123, 71}: "AKELA, Inc.", + [3]byte{56, 131, 69}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{56, 137, 220}: "Opticon Sensors Europe B.V.", + [3]byte{56, 138, 183}: "ITC Networks", + [3]byte{56, 142, 231}: "Fanhattan LLC", + [3]byte{56, 145, 251}: "Xenox Holding BV", + [3]byte{56, 148, 150}: "Samsung Elec Co.,Ltd", + [3]byte{56, 149, 146}: "Beijing Tendyron Corporation", + [3]byte{56, 159, 131}: "OTN Systems N.V.", + [3]byte{56, 165, 60}: "Veenstra Instruments", + [3]byte{56, 165, 182}: "SHENZHEN MEGMEET ELECTRICAL CO.,LTD", + [3]byte{56, 168, 81}: "Moog, Ing", + [3]byte{56, 168, 107}: "Orga BV", + [3]byte{56, 169, 95}: "Actifio Inc", + [3]byte{56, 170, 60}: "SAMSUNG ELECTRO-MECHANICS", + [3]byte{56, 177, 45}: "Sonotronic Nagel GmbH", + [3]byte{56, 177, 219}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{56, 181, 189}: "E.G.O. Elektro-Ger", + [3]byte{56, 183, 77}: "Fijowave Limited", + [3]byte{56, 187, 35}: "OzVision America LLC", + [3]byte{56, 187, 60}: "Avaya, Inc", + [3]byte{56, 188, 26}: "Meizu technology co.,ltd", + [3]byte{56, 191, 47}: "Espec Corp.", + [3]byte{56, 191, 51}: "NEC CASIO Mobile Communications", + [3]byte{56, 192, 150}: "ALPS ELECTRIC CO.,LTD.", + [3]byte{56, 199, 186}: "CS Services Co.,Ltd.", + [3]byte{56, 200, 92}: "Cisco SPVTG", + [3]byte{56, 201, 169}: "SMART High Reliability Solutions, Inc.", + [3]byte{56, 202, 151}: "Contour Design LLC", + [3]byte{56, 209, 53}: "EasyIO Corporation Sdn. Bhd.", + [3]byte{56, 219, 187}: "Sunbow Telecom Co., Ltd.", + [3]byte{56, 222, 96}: "Mohlenhoff GmbH", + [3]byte{56, 224, 142}: "Mitsubishi Electric Corporation", + [3]byte{56, 229, 149}: "Shenzhen Gongjin Electronics Co.,Ltd", + [3]byte{56, 231, 216}: "HTC Corporation", + [3]byte{56, 232, 223}: "b gmbh medien + datenbanken", + [3]byte{56, 233, 140}: "Reco S.p.A.", + [3]byte{56, 234, 167}: "Hewlett Packard", + [3]byte{56, 236, 17}: "Novatek Microelectronics Corp.", + [3]byte{56, 236, 228}: "Samsung Electronics", + [3]byte{56, 238, 157}: "Anedo Ltd.", + [3]byte{56, 240, 152}: "Vapor Stone Rail Systems", + [3]byte{56, 243, 63}: "TATSUNO CORPORATION", + [3]byte{56, 245, 151}: "home2net GmbH", + [3]byte{56, 247, 8}: "National Resource Management, Inc.", + [3]byte{56, 248, 137}: "Huawei Technologies Co., Ltd", + [3]byte{56, 248, 183}: "V2COM PARTICIPACOES S.A.", + [3]byte{56, 254, 197}: "Ellips B.V.", + [3]byte{60, 2, 177}: "Creation Technologies LP", + [3]byte{60, 4, 191}: "PRAVIS SYSTEMS Co.Ltd.,", + [3]byte{60, 5, 171}: "Product Creation Studio", + [3]byte{60, 7, 84}: "Apple", + [3]byte{60, 7, 113}: "Sony Corporation", + [3]byte{60, 8, 30}: "Beijing Yupont Electric Power Technology Co.,Ltd", + [3]byte{60, 8, 246}: "Cisco", + [3]byte{60, 9, 109}: "Powerhouse Dynamics", + [3]byte{60, 12, 72}: "Servergy, Inc.", + [3]byte{60, 14, 35}: "Cisco", + [3]byte{60, 15, 193}: "KBC Networks", + [3]byte{60, 16, 64}: "daesung network", + [3]byte{60, 16, 111}: "ALBAHITH TECHNOLOGIES", + [3]byte{60, 21, 194}: "Apple", + [3]byte{60, 21, 234}: "TESCOM CO., LTD.", + [3]byte{60, 24, 159}: "Nokia Corporation", + [3]byte{60, 24, 160}: "Luxshare Precision Industry Co.,Ltd.", + [3]byte{60, 25, 21}: "GFI Chrono Time", + [3]byte{60, 25, 125}: "Ericsson AB", + [3]byte{60, 26, 87}: "Cardiopulmonary Corp", + [3]byte{60, 26, 121}: "Huayuan Technology CO.,LTD", + [3]byte{60, 28, 190}: "JADAK LLC", + [3]byte{60, 30, 19}: "HANGZHOU SUNRISE TECHNOLOGY CO., LTD", + [3]byte{60, 37, 215}: "Nokia Corporation", + [3]byte{60, 38, 213}: "Sotera Wireless", + [3]byte{60, 39, 99}: "SLE quality engineering GmbH & Co. KG", + [3]byte{60, 45, 183}: "Texas Instruments", + [3]byte{60, 47, 58}: "SFORZATO Corp.", + [3]byte{60, 48, 12}: "Dewar Electronics Pty Ltd", + [3]byte{60, 54, 61}: "Nokia Corporation", + [3]byte{60, 54, 228}: "Arris Group, Inc.", + [3]byte{60, 56, 136}: "ConnectQuest, llc", + [3]byte{60, 57, 195}: "JW Electronics Co., Ltd.", + [3]byte{60, 57, 231}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{60, 58, 115}: "Avaya, Inc", + [3]byte{60, 64, 79}: "Guangdong Pisen Electronics Co. Ltd.", + [3]byte{60, 67, 142}: "ARRIS Group, Inc.", + [3]byte{60, 70, 216}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{60, 73, 55}: "ASSMANN Electronic GmbH", + [3]byte{60, 74, 146}: "Hewlett-Packard Company", + [3]byte{60, 76, 105}: "Infinity System S.L.", + [3]byte{60, 78, 71}: "Etronic A/S", + [3]byte{60, 87, 189}: "Kessler Crane Inc.", + [3]byte{60, 87, 213}: "FiveCo", + [3]byte{60, 90, 55}: "Samsung Electronics", + [3]byte{60, 90, 180}: "Google", + [3]byte{60, 95, 1}: "Synerchip Co., Ltd.", + [3]byte{60, 97, 4}: "Juniper Networks", + [3]byte{60, 98, 0}: "Samsung electronics CO., LTD", + [3]byte{60, 98, 120}: "SHENZHEN JETNET TECHNOLOGY CO.,LTD.", + [3]byte{60, 103, 44}: "Sciovid Inc.", + [3]byte{60, 106, 125}: "Niigata Power Systems Co., Ltd.", + [3]byte{60, 110, 99}: "Mitron OY", + [3]byte{60, 111, 69}: "Fiberpro Inc.", + [3]byte{60, 111, 247}: "EnTek Systems, Inc.", + [3]byte{60, 112, 89}: "MakerBot Industries", + [3]byte{60, 116, 55}: "RIM", + [3]byte{60, 117, 74}: "ARRIS Group, Inc.", + [3]byte{60, 119, 230}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{60, 125, 177}: "Texas Instruments", + [3]byte{60, 129, 216}: "SAGEMCOM SAS", + [3]byte{60, 131, 181}: "Advance Vision Electronics Co. Ltd.", + [3]byte{60, 134, 168}: "Sangshin elecom .co,, LTD", + [3]byte{60, 137, 166}: "KAPELSE", + [3]byte{60, 138, 176}: "Juniper Networks", + [3]byte{60, 138, 229}: "Tensun Information Technology(Hangzhou) Co.,LTD", + [3]byte{60, 139, 254}: "Samsung Electronics", + [3]byte{60, 145, 87}: "Hangzhou Yulong Conmunication Co.,Ltd", + [3]byte{60, 145, 116}: "ALONG COMMUNICATION TECHNOLOGY", + [3]byte{60, 148, 213}: "Juniper Networks", + [3]byte{60, 151, 14}: "Wistron InfoComm(Kunshan)Co.,Ltd.", + [3]byte{60, 151, 126}: "IPS Technology Limited", + [3]byte{60, 152, 191}: "Quest Controls, Inc.", + [3]byte{60, 153, 247}: "Lansentechnology AB", + [3]byte{60, 159, 129}: "Shenzhen CATIC Bit Communications Technology Co.,Ltd", + [3]byte{60, 161, 13}: "Samsung Electronics Co.,Ltd", + [3]byte{60, 163, 21}: "Bless Information & Communications Co., Ltd", + [3]byte{60, 167, 43}: "MRV Communications (Networks) LTD", + [3]byte{60, 169, 244}: "Intel Corporate", + [3]byte{60, 170, 63}: "iKey, Ltd.", + [3]byte{60, 171, 142}: "Apple", + [3]byte{60, 174, 105}: "ESA Elektroschaltanlagen Grimma GmbH", + [3]byte{60, 177, 91}: "Avaya, Inc", + [3]byte{60, 177, 127}: "Wattwatchers Pty Ld", + [3]byte{60, 184, 122}: "PRIVATE", + [3]byte{60, 185, 166}: "Belden Deutschland GmbH", + [3]byte{60, 189, 216}: "LG ELECTRONICS INC", + [3]byte{60, 192, 198}: "d&b audiotechnik GmbH", + [3]byte{60, 193, 44}: "AES Corporation", + [3]byte{60, 193, 246}: "Melange Systems Pvt. Ltd.", + [3]byte{60, 194, 67}: "Nokia Corporation", + [3]byte{60, 201, 158}: "Huiyang Technology Co., Ltd", + [3]byte{60, 202, 135}: "Iders Incorporated", + [3]byte{60, 205, 90}: "Technische Alternative GmbH", + [3]byte{60, 205, 147}: "LG ELECTRONICS INC", + [3]byte{60, 206, 115}: "CISCO SYSTEMS, INC.", + [3]byte{60, 208, 248}: "Apple", + [3]byte{60, 209, 110}: "Telepower Communication Co., Ltd", + [3]byte{60, 212, 214}: "WirelessWERX, Inc", + [3]byte{60, 215, 218}: "SK Mtek microelectronics(shenzhen)limited", + [3]byte{60, 217, 43}: "Hewlett-Packard Company", + [3]byte{60, 217, 206}: "Eclipse WiFi", + [3]byte{60, 223, 30}: "CISCO SYSTEMS, INC.", + [3]byte{60, 223, 189}: "Huawei Technologies Co., Ltd", + [3]byte{60, 224, 114}: "Apple", + [3]byte{60, 229, 166}: "Hangzhou H3C Technologies Co., Ltd.", + [3]byte{60, 229, 180}: "KIDASEN INDUSTRIA E COMERCIO DE ANTENAS LTDA", + [3]byte{60, 230, 36}: "LG Display", + [3]byte{60, 234, 79}: "2Wire", + [3]byte{60, 234, 251}: "NSE AG", + [3]byte{60, 243, 146}: "Virtualtek. Co. Ltd", + [3]byte{60, 245, 44}: "DSPECIALISTS GmbH", + [3]byte{60, 247, 42}: "Nokia Corporation", + [3]byte{60, 247, 72}: "Shenzhen Linsn Technology Development Co.,Ltd", + [3]byte{60, 248, 8}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{60, 251, 150}: "Emcraft Systems LLC", + [3]byte{64, 1, 7}: "Arista Corp", + [3]byte{64, 1, 198}: "3COM EUROPE LTD", + [3]byte{64, 4, 12}: "A&T", + [3]byte{64, 7, 192}: "Railtec Systems GmbH", + [3]byte{64, 14, 103}: "Tremol Ltd.", + [3]byte{64, 14, 133}: "Samsung Electro Mechanics co.,LTD.", + [3]byte{64, 18, 228}: "Compass-EOS", + [3]byte{64, 19, 217}: "Global ES", + [3]byte{64, 21, 151}: "Protect America, Inc.", + [3]byte{64, 22, 126}: "ASUSTek COMPUTER INC.", + [3]byte{64, 22, 159}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{64, 22, 250}: "EKM Metering", + [3]byte{64, 24, 177}: "Aerohive Networks Inc.", + [3]byte{64, 24, 215}: "Wyle Telemetry and Data Systems", + [3]byte{64, 29, 89}: "Biometric Associates, LP", + [3]byte{64, 34, 237}: "Digital Projection Ltd", + [3]byte{64, 37, 194}: "Intel Corporate", + [3]byte{64, 39, 11}: "Mobileeco Co., Ltd", + [3]byte{64, 43, 161}: "Sony Ericsson Mobile Communications AB", + [3]byte{64, 44, 244}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{64, 48, 4}: "Apple", + [3]byte{64, 48, 103}: "Conlog (Pty) Ltd", + [3]byte{64, 51, 108}: "Godrej & Boyce Mfg. co. ltd", + [3]byte{64, 55, 173}: "Macro Image Technology, Inc.", + [3]byte{64, 60, 252}: "Apple", + [3]byte{64, 64, 34}: "ZIV", + [3]byte{64, 64, 107}: "Icomera", + [3]byte{64, 69, 218}: "Spreadtrum Communications (Shanghai) Co., Ltd.", + [3]byte{64, 74, 3}: "ZyXEL Communications Corporation", + [3]byte{64, 74, 24}: "Addrek Smart Solutions", + [3]byte{64, 77, 142}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{64, 78, 235}: "Higher Way Electronic Co., Ltd.", + [3]byte{64, 80, 224}: "Milton Security Group LLC", + [3]byte{64, 81, 108}: "Grandex International Corporation", + [3]byte{64, 82, 13}: "Pico Technology", + [3]byte{64, 85, 57}: "CISCO SYSTEMS, INC.", + [3]byte{64, 86, 12}: "In Home Displays Ltd", + [3]byte{64, 90, 155}: "ANOVO", + [3]byte{64, 95, 190}: "RIM", + [3]byte{64, 95, 194}: "Texas Instruments", + [3]byte{64, 96, 90}: "Hawkeye Tech Co. Ltd", + [3]byte{64, 97, 134}: "MICRO-STAR INT'L CO.,LTD", + [3]byte{64, 97, 142}: "Stella-Green Co", + [3]byte{64, 102, 122}: "mediola - connected living AG", + [3]byte{64, 104, 38}: "Thales UK Limited", + [3]byte{64, 106, 171}: "RIM", + [3]byte{64, 108, 143}: "Apple", + [3]byte{64, 111, 42}: "Research In Motion", + [3]byte{64, 112, 9}: "ARRIS Group, Inc.", + [3]byte{64, 112, 74}: "Power Idea Technology Limited", + [3]byte{64, 112, 116}: "Life Technology (China) Co., Ltd", + [3]byte{64, 116, 150}: "aFUN TECHNOLOGY INC.", + [3]byte{64, 120, 106}: "Motorola Mobility LLC", + [3]byte{64, 120, 117}: "IMBEL - Industria de Material Belico do Brasil", + [3]byte{64, 122, 128}: "Nokia Corporation", + [3]byte{64, 123, 27}: "Mettle Networks Inc.", + [3]byte{64, 130, 86}: "Continental Automotive GmbH", + [3]byte{64, 131, 222}: "Motorola", + [3]byte{64, 132, 147}: "Clavister AB", + [3]byte{64, 136, 224}: "Beijing Ereneben Information Technology Limited Shenzhen Branch", + [3]byte{64, 138, 154}: "TITENG CO., Ltd.", + [3]byte{64, 139, 7}: "Actiontec Electronics, Inc", + [3]byte{64, 139, 246}: "Shenzhen TCL New Technology Co; Ltd.", + [3]byte{64, 149, 88}: "Aisino Corporation", + [3]byte{64, 151, 209}: "BK Electronics cc", + [3]byte{64, 152, 76}: "Casacom Solutions AG", + [3]byte{64, 152, 78}: "Texas Instruments", + [3]byte{64, 152, 123}: "Aisino Corporation", + [3]byte{64, 155, 13}: "Shenzhen Yourf Kwan Industrial Co., Ltd", + [3]byte{64, 159, 199}: "BAEKCHUN I&C Co., Ltd.", + [3]byte{64, 166, 164}: "PassivSystems Ltd", + [3]byte{64, 166, 217}: "Apple", + [3]byte{64, 168, 240}: "Hewlett Packard", + [3]byte{64, 172, 141}: "Data Management, Inc.", + [3]byte{64, 176, 250}: "LG Electronics", + [3]byte{64, 178, 200}: "Nortel Networks", + [3]byte{64, 179, 149}: "Apple", + [3]byte{64, 179, 205}: "Chiyoda Electronics Co.,Ltd.", + [3]byte{64, 179, 252}: "Logital Co. Limited", + [3]byte{64, 180, 240}: "Juniper Networks", + [3]byte{64, 182, 177}: "SUNGSAM CO,.Ltd", + [3]byte{64, 183, 243}: "ARRIS Group, Inc.", + [3]byte{64, 186, 97}: "Arima Communications Corp.", + [3]byte{64, 188, 115}: "Cronoplast S.L.", + [3]byte{64, 188, 139}: "itelio GmbH", + [3]byte{64, 189, 158}: "Physio-Control, Inc", + [3]byte{64, 191, 23}: "Digistar Telecom. SA", + [3]byte{64, 194, 69}: "Shenzhen Hexicom Technology Co., Ltd.", + [3]byte{64, 196, 214}: "ChongQing Camyu Technology Development Co.,Ltd.", + [3]byte{64, 198, 42}: "Shanghai Jing Ren Electronic Technology Co., Ltd.", + [3]byte{64, 199, 201}: "Naviit Inc.", + [3]byte{64, 203, 168}: "Huawei Technologies Co., Ltd", + [3]byte{64, 205, 58}: "Z3 Technology", + [3]byte{64, 211, 45}: "Apple", + [3]byte{64, 212, 14}: "Biodata Ltd", + [3]byte{64, 213, 89}: "MICRO S.E.R.I.", + [3]byte{64, 216, 85}: "IEEE REGISTRATION AUTHORITY", + [3]byte{64, 226, 48}: "AzureWave Technologies, Inc.", + [3]byte{64, 231, 48}: "DEY Storage Systems, Inc.", + [3]byte{64, 231, 147}: "Shenzhen Siviton Technology Co.,Ltd", + [3]byte{64, 234, 206}: "FOUNDER BROADBAND NETWORK SERVICE CO.,LTD", + [3]byte{64, 236, 248}: "Siemens AG", + [3]byte{64, 239, 76}: "Fihonest communication co.,Ltd", + [3]byte{64, 240, 47}: "Liteon Technology Corporation", + [3]byte{64, 241, 76}: "ISE Europe SPRL", + [3]byte{64, 242, 1}: "SAGEMCOM", + [3]byte{64, 242, 233}: "IBM", + [3]byte{64, 243, 8}: "Murata Manufactuaring Co.,Ltd.", + [3]byte{64, 244, 7}: "Nintendo Co., Ltd.", + [3]byte{64, 244, 236}: "CISCO SYSTEMS, INC.", + [3]byte{64, 245, 46}: "Leica Microsystems (Schweiz) AG", + [3]byte{64, 252, 137}: "ARRIS Group, Inc.", + [3]byte{68, 3, 167}: "Cisco", + [3]byte{68, 12, 253}: "NetMan Co., Ltd.", + [3]byte{68, 17, 194}: "Telegartner Karl Gartner GmbH", + [3]byte{68, 19, 25}: "WKK TECHNOLOGY LTD.", + [3]byte{68, 24, 79}: "Fitview", + [3]byte{68, 25, 182}: "Hangzhou Hikvision Digital Technology Co.,Ltd.", + [3]byte{68, 30, 145}: "ARVIDA Intelligent Electronics Technology Co.,Ltd.", + [3]byte{68, 30, 161}: "Hewlett-Packard Company", + [3]byte{68, 35, 170}: "Farmage Co., Ltd.", + [3]byte{68, 37, 187}: "Bamboo Entertainment Corporation", + [3]byte{68, 41, 56}: "NietZsche enterprise Co.Ltd.", + [3]byte{68, 42, 96}: "Apple", + [3]byte{68, 42, 255}: "E3 Technology, Inc.", + [3]byte{68, 43, 3}: "CISCO SYSTEMS, INC.", + [3]byte{68, 49, 146}: "Hewlett Packard", + [3]byte{68, 50, 42}: "Avaya, Inc", + [3]byte{68, 50, 200}: "Technicolor USA Inc.", + [3]byte{68, 51, 76}: "Shenzhen Bilian electronic CO.,LTD", + [3]byte{68, 52, 143}: "MXT INDUSTRIAL LTDA", + [3]byte{68, 55, 25}: "2 Save Energy Ltd", + [3]byte{68, 55, 111}: "Young Electric Sign Co", + [3]byte{68, 55, 230}: "Hon Hai Precision Ind.Co.Ltd", + [3]byte{68, 56, 57}: "Cumulus Networks, inc", + [3]byte{68, 57, 196}: "Universal Global Scientific Industrial Co.,Ltd", + [3]byte{68, 60, 156}: "Pintsch Tiefenbach GmbH", + [3]byte{68, 61, 33}: "Nuvolt", + [3]byte{68, 62, 178}: "DEOTRON Co., LTD.", + [3]byte{68, 72, 145}: "HDMI Licensing, LLC", + [3]byte{68, 74, 101}: "Silverflare Ltd.", + [3]byte{68, 76, 12}: "Apple", + [3]byte{68, 78, 26}: "Samsung Electronics Co.,Ltd", + [3]byte{68, 79, 94}: "Pan Studios Co.,Ltd.", + [3]byte{68, 81, 219}: "Raytheon BBN Technologies", + [3]byte{68, 84, 192}: "Thompson Aerospace", + [3]byte{68, 86, 141}: "PNC Technologies Co., Ltd.", + [3]byte{68, 86, 183}: "Spawn Labs, Inc", + [3]byte{68, 88, 41}: "Cisco SPVTG", + [3]byte{68, 89, 159}: "Criticare Systems, Inc", + [3]byte{68, 94, 243}: "Tonalite Holding B.V.", + [3]byte{68, 95, 122}: "Shihlin Electric & Engineering Corp.", + [3]byte{68, 97, 50}: "ecobee inc", + [3]byte{68, 97, 156}: "FONsystem co. ltd.", + [3]byte{68, 102, 110}: "IP-LINE", + [3]byte{68, 103, 85}: "Orbit Irrigation", + [3]byte{68, 104, 171}: "JUIN COMPANY, LIMITED", + [3]byte{68, 108, 36}: "Reallin Electronic Co.,Ltd", + [3]byte{68, 109, 87}: "Liteon Technology Corporation", + [3]byte{68, 109, 108}: "Samsung Elec Co.,Ltd", + [3]byte{68, 112, 11}: "IFFU", + [3]byte{68, 112, 152}: "MING HONG TECHNOLOGY (SHEN ZHEN) LIMITED", + [3]byte{68, 116, 108}: "Sony Mobile Communications AB", + [3]byte{68, 123, 196}: "DualShine Technology(SZ)Co.,Ltd", + [3]byte{68, 124, 127}: "Innolight Technology Corporation", + [3]byte{68, 125, 165}: "VTION INFORMATION TECHNOLOGY (FUJIAN) CO.,LTD", + [3]byte{68, 126, 118}: "Trek Technology (S) Pte Ltd", + [3]byte{68, 126, 149}: "Alpha and Omega, Inc", + [3]byte{68, 131, 18}: "Star-Net", + [3]byte{68, 133, 0}: "Intel Corporate", + [3]byte{68, 134, 193}: "Siemens Low Voltage & Products", + [3]byte{68, 135, 252}: "ELITEGROUP COMPUTER SYSTEM CO., LTD.", + [3]byte{68, 136, 203}: "Camco Technologies NV", + [3]byte{68, 138, 91}: "Micro-Star INT'L CO., LTD.", + [3]byte{68, 140, 82}: "KTIS CO., Ltd", + [3]byte{68, 142, 18}: "DT Research, Inc.", + [3]byte{68, 142, 129}: "VIG", + [3]byte{68, 145, 219}: "Shanghai Huaqin Telecom Technology Co.,Ltd", + [3]byte{68, 148, 252}: "NETGEAR INC.,", + [3]byte{68, 149, 250}: "Qingdao Santong Digital Technology Co.Ltd", + [3]byte{68, 155, 120}: "The Now Factory", + [3]byte{68, 156, 181}: "Alcomp, Inc", + [3]byte{68, 164, 45}: "TCT Mobile Limited", + [3]byte{68, 166, 137}: "PROMAX ELECTRONICA SA", + [3]byte{68, 166, 229}: "THINKING TECHNOLOGY CO.,LTD", + [3]byte{68, 167, 207}: "Murata Manufacturing Co., Ltd.", + [3]byte{68, 168, 194}: "SEWOO TECH CO., LTD", + [3]byte{68, 170, 39}: "udworks Co., Ltd.", + [3]byte{68, 170, 232}: "Nanotec Electronic GmbH & Co. KG", + [3]byte{68, 173, 217}: "Cisco", + [3]byte{68, 179, 130}: "Kuang-chi Institute of Advanced Technology", + [3]byte{68, 193, 92}: "Texas Instruments", + [3]byte{68, 194, 51}: "Guangzhou Comet Technology Development Co.Ltd", + [3]byte{68, 195, 6}: "SIFROM Inc.", + [3]byte{68, 195, 155}: "OOO RUBEZH NPO", + [3]byte{68, 196, 169}: "Opticom Communication, LLC", + [3]byte{68, 197, 111}: "NGN Easy Satfinder (Tianjin) Electronic Co., Ltd", + [3]byte{68, 201, 162}: "Greenwald Industries", + [3]byte{68, 206, 125}: "SFR", + [3]byte{68, 209, 94}: "Shanghai Kingto Information Technology Ltd", + [3]byte{68, 210, 202}: "Anvia TV Oy", + [3]byte{68, 211, 202}: "CISCO SYSTEMS, INC.", + [3]byte{68, 212, 224}: "Sony Mobile Communications AB", + [3]byte{68, 214, 61}: "Talari Networks", + [3]byte{68, 216, 50}: "Azurewave Technologies, Inc.", + [3]byte{68, 216, 132}: "Apple", + [3]byte{68, 220, 145}: "PLANEX COMMUNICATIONS INC.", + [3]byte{68, 220, 203}: "SEMINDIA SYSTEMS PVT LTD", + [3]byte{68, 224, 142}: "Cisco SPVTG", + [3]byte{68, 225, 55}: "ARRIS Group, Inc.", + [3]byte{68, 228, 154}: "OMNITRONICS PTY LTD", + [3]byte{68, 228, 217}: "CISCO SYSTEMS, INC.", + [3]byte{68, 232, 165}: "Myreka Technologies Sdn. Bhd.", + [3]byte{68, 237, 87}: "Longicorn, inc.", + [3]byte{68, 238, 48}: "Budelmann Elektronik GmbH", + [3]byte{68, 244, 89}: "Samsung Electronics", + [3]byte{68, 248, 73}: "Union Pacific Railroad", + [3]byte{68, 251, 66}: "Apple", + [3]byte{72, 2, 42}: "B-Link Electronic Limited", + [3]byte{72, 3, 98}: "DESAY ELECTRONICS(HUIZHOU)CO.,LTD", + [3]byte{72, 12, 73}: "NAKAYO TELECOMMUNICATIONS,INC", + [3]byte{72, 18, 73}: "Luxcom Technologies Inc.", + [3]byte{72, 19, 243}: "BBK Electronics Corp., Ltd.", + [3]byte{72, 23, 76}: "MicroPower technologies", + [3]byte{72, 24, 66}: "Shanghai Winaas Co. Equipment Co. Ltd.", + [3]byte{72, 26, 132}: "Pointer Telocation Ltd", + [3]byte{72, 27, 210}: "Intron Scientific co., ltd.", + [3]byte{72, 38, 232}: "Tek-Air Systems, Inc.", + [3]byte{72, 40, 47}: "ZTE Corporation", + [3]byte{72, 44, 234}: "Motorola Inc Business Light Radios", + [3]byte{72, 51, 221}: "ZENNIO AVANCE Y TECNOLOGIA, S.L.", + [3]byte{72, 52, 61}: "IEP GmbH", + [3]byte{72, 61, 50}: "Syscor Controls & Automation", + [3]byte{72, 68, 135}: "Cisco SPVTG", + [3]byte{72, 68, 247}: "Samsung Electronics Co., LTD", + [3]byte{72, 70, 241}: "Uros Oy", + [3]byte{72, 70, 251}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{72, 81, 183}: "Intel Corporate", + [3]byte{72, 82, 97}: "SOREEL", + [3]byte{72, 87, 221}: "Facebook", + [3]byte{72, 89, 41}: "LG Electronics", + [3]byte{72, 90, 63}: "WISOL", + [3]byte{72, 90, 182}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{72, 91, 57}: "ASUSTek COMPUTER INC.", + [3]byte{72, 93, 96}: "Azurewave Technologies, Inc.", + [3]byte{72, 96, 188}: "Apple", + [3]byte{72, 97, 163}: "Concern \"Axion\" JSC", + [3]byte{72, 98, 118}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{72, 107, 44}: "BBK Electronics Corp., Ltd.,", + [3]byte{72, 107, 145}: "Fleetwood Group Inc.", + [3]byte{72, 110, 115}: "Pica8, Inc.", + [3]byte{72, 111, 210}: "StorSimple Inc", + [3]byte{72, 113, 25}: "SGB GROUP LTD.", + [3]byte{72, 116, 110}: "Apple", + [3]byte{72, 118, 4}: "PRIVATE", + [3]byte{72, 130, 68}: "Life Fitness / Div. of Brunswick", + [3]byte{72, 142, 66}: "DIGALOG GmbH", + [3]byte{72, 145, 83}: "Weinmann Geräte für Medizin GmbH + Co. KG", + [3]byte{72, 145, 246}: "Shenzhen Reach software technology CO.,LTD", + [3]byte{72, 155, 226}: "SCI Innovations Ltd", + [3]byte{72, 157, 24}: "Flashbay Limited", + [3]byte{72, 157, 36}: "Research In Motion", + [3]byte{72, 162, 45}: "Shenzhen Huaxuchang Telecom Technology Co.,Ltd", + [3]byte{72, 162, 183}: "Kodofon JSC", + [3]byte{72, 166, 210}: "GJsun Optical Science and Tech Co.,Ltd.", + [3]byte{72, 170, 93}: "Store Electronic Systems", + [3]byte{72, 178, 83}: "Marketaxess Corporation", + [3]byte{72, 181, 167}: "Glory Horse Industries Ltd.", + [3]byte{72, 184, 222}: "HOMEWINS TECHNOLOGY CO.,LTD.", + [3]byte{72, 185, 119}: "PulseOn Oy", + [3]byte{72, 185, 194}: "Teletics Inc.", + [3]byte{72, 190, 45}: "Symanitron", + [3]byte{72, 193, 172}: "PLANTRONICS, INC.", + [3]byte{72, 200, 98}: "Simo Wireless,Inc.", + [3]byte{72, 200, 182}: "SysTec GmbH", + [3]byte{72, 203, 110}: "Cello Electronics (UK) Ltd", + [3]byte{72, 208, 207}: "Universal Electronics, Inc.", + [3]byte{72, 209, 142}: "Metis Communication Co.,Ltd", + [3]byte{72, 210, 36}: "Liteon Technology Corporation", + [3]byte{72, 213, 76}: "Jeda Networks", + [3]byte{72, 215, 5}: "Apple", + [3]byte{72, 215, 255}: "BLANKOM Antennentechnik GmbH", + [3]byte{72, 216, 85}: "Telvent", + [3]byte{72, 216, 254}: "ClarIDy Solutions, Inc.", + [3]byte{72, 220, 251}: "Nokia Corporation", + [3]byte{72, 223, 28}: "Wuhan NEC Fibre Optic Communications industry Co. Ltd", + [3]byte{72, 225, 175}: "Vity", + [3]byte{72, 234, 99}: "Zhejiang Uniview Technologies Co., Ltd.", + [3]byte{72, 235, 48}: "ETERNA TECHNOLOGY, INC.", + [3]byte{72, 237, 128}: "daesung eltec", + [3]byte{72, 238, 7}: "Silver Palm Technologies LLC", + [3]byte{72, 238, 134}: "UTStarcom (China) Co.,Ltd", + [3]byte{72, 242, 48}: "Ubizcore Co.,LTD", + [3]byte{72, 243, 23}: "PRIVATE", + [3]byte{72, 244, 125}: "TechVision Holding Internation Limited", + [3]byte{72, 247, 241}: "Alcatel-Lucent", + [3]byte{72, 248, 179}: "Cisco-Linksys, LLC", + [3]byte{72, 248, 225}: "Alcatel Lucent WT", + [3]byte{72, 249, 37}: "Maestronic", + [3]byte{72, 252, 184}: "Woodstream Corporation", + [3]byte{72, 254, 234}: "HOMA B.V.", + [3]byte{76, 0, 130}: "Cisco", + [3]byte{76, 2, 46}: "CMR KOREA CO., LTD", + [3]byte{76, 2, 137}: "LEX COMPUTECH CO., LTD", + [3]byte{76, 6, 138}: "Basler Electric Company", + [3]byte{76, 7, 201}: "COMPUTER OFFICE Co.,Ltd.", + [3]byte{76, 9, 180}: "zte corporation", + [3]byte{76, 11, 58}: "TCT Mobile Limited", + [3]byte{76, 11, 190}: "Microsoft", + [3]byte{76, 13, 238}: "JABIL CIRCUIT (SHANGHAI) LTD.", + [3]byte{76, 15, 110}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{76, 15, 199}: "Earda Electronics Co.,Ltd", + [3]byte{76, 17, 191}: "ZHEJIANG DAHUA TECHNOLOGY CO.,LTD.", + [3]byte{76, 20, 128}: "NOREGON SYSTEMS, INC", + [3]byte{76, 20, 163}: "TCL Technoly Electronics (Huizhou) Co., Ltd.", + [3]byte{76, 22, 241}: "zte corporation", + [3]byte{76, 23, 235}: "SAGEMCOM", + [3]byte{76, 26, 58}: "PRIMA Research And Production Enterprise Ltd.", + [3]byte{76, 26, 149}: "Novakon Co., Ltd.", + [3]byte{76, 31, 204}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{76, 33, 208}: "Sony Mobile Communications AB", + [3]byte{76, 34, 88}: "cozybit, Inc.", + [3]byte{76, 37, 120}: "Nokia Corporation", + [3]byte{76, 38, 231}: "Welgate Co., Ltd.", + [3]byte{76, 44, 128}: "Beijing Skyway Technologies Co.,Ltd", + [3]byte{76, 44, 131}: "Zhejiang KaNong Network Technology Co.,Ltd.", + [3]byte{76, 47, 157}: "ICM Controls", + [3]byte{76, 48, 137}: "Thales Transportation Systems GmbH", + [3]byte{76, 50, 45}: "TELEDATA NETWORKS", + [3]byte{76, 50, 217}: "M Rutty Holdings Pty. Ltd.", + [3]byte{76, 57, 9}: "HPL Electric & Power Private Limited", + [3]byte{76, 57, 16}: "Newtek Electronics co., Ltd.", + [3]byte{76, 59, 116}: "VOGTEC(H.K.) Co., Ltd", + [3]byte{76, 60, 22}: "Samsung Electronics Co.,Ltd", + [3]byte{76, 72, 218}: "Beijing Autelan Technology Co.,Ltd", + [3]byte{76, 75, 104}: "Mobile Device, Inc.", + [3]byte{76, 78, 53}: "Cisco", + [3]byte{76, 84, 39}: "Linepro Sp. z o.o.", + [3]byte{76, 84, 153}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{76, 85, 133}: "Hamilton Systems", + [3]byte{76, 85, 184}: "Turkcell Teknoloji", + [3]byte{76, 85, 204}: "ACKme Networks Pty Ltd", + [3]byte{76, 93, 205}: "Oy Finnish Electric Vehicle Technologies Ltd", + [3]byte{76, 94, 12}: "Routerboard.com", + [3]byte{76, 95, 210}: "Alcatel-Lucent", + [3]byte{76, 96, 213}: "airPointe of New Hampshire", + [3]byte{76, 96, 222}: "NETGEAR", + [3]byte{76, 98, 85}: "SANMINA-SCI SYSTEM DE MEXICO S.A. DE C.V.", + [3]byte{76, 99, 235}: "Application Solutions (Electronics and Vision) Ltd", + [3]byte{76, 100, 217}: "Guangdong Leawin Group Co., Ltd", + [3]byte{76, 110, 110}: "Comnect Technology CO.,LTD", + [3]byte{76, 114, 185}: "Pegatron Corporation", + [3]byte{76, 115, 103}: "Genius Bytes Software Solutions GmbH", + [3]byte{76, 115, 165}: "KOVE", + [3]byte{76, 116, 3}: "Mundo Reader (bq)", + [3]byte{76, 119, 79}: "Embedded Wireless Labs", + [3]byte{76, 120, 151}: "Arrowhead Alarm Products Ltd", + [3]byte{76, 121, 186}: "Intel Corporate", + [3]byte{76, 127, 98}: "Nokia Corporation", + [3]byte{76, 128, 79}: "Armstrong Monitoring Corp", + [3]byte{76, 128, 147}: "Intel Corporate", + [3]byte{76, 130, 207}: "Echostar Technologies", + [3]byte{76, 131, 222}: "Cisco SPVTG", + [3]byte{76, 139, 48}: "Actiontec Electronics, Inc", + [3]byte{76, 139, 85}: "Grupo Digicon", + [3]byte{76, 139, 239}: "Huawei Technologies Co., Ltd", + [3]byte{76, 141, 121}: "Apple", + [3]byte{76, 143, 165}: "Jastec", + [3]byte{76, 150, 20}: "Juniper Networks", + [3]byte{76, 152, 239}: "Zeo", + [3]byte{76, 158, 128}: "KYOKKO ELECTRIC Co., Ltd.", + [3]byte{76, 158, 228}: "Hanyang Navicom Co.,Ltd.", + [3]byte{76, 158, 255}: "ZyXEL Communications Corp", + [3]byte{76, 165, 109}: "Samsung Electronics Co.,Ltd", + [3]byte{76, 167, 75}: "Alcatel Lucent", + [3]byte{76, 170, 22}: "AzureWave Technologies (Shanghai) Inc.", + [3]byte{76, 171, 51}: "KST technology", + [3]byte{76, 172, 10}: "ZTE Corporation", + [3]byte{76, 177, 108}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{76, 177, 153}: "Apple", + [3]byte{76, 180, 234}: "HRD (S) PTE., LTD.", + [3]byte{76, 184, 28}: "SAM Electronics GmbH", + [3]byte{76, 185, 200}: "CONET CO., LTD.", + [3]byte{76, 186, 163}: "Bison Electronics Inc.", + [3]byte{76, 187, 88}: "Chicony Electronics Co., Ltd.", + [3]byte{76, 188, 66}: "Shenzhen Hangsheng Electronics Co.,Ltd.", + [3]byte{76, 188, 165}: "Samsung Electronics Co.,Ltd", + [3]byte{76, 196, 82}: "Shang Hai Tyd. Electon Technology Ltd.", + [3]byte{76, 198, 2}: "Radios, Inc.", + [3]byte{76, 201, 79}: "Alcatel-Lucent", + [3]byte{76, 202, 83}: "Skyera, Inc.", + [3]byte{76, 203, 245}: "zte corporation", + [3]byte{76, 204, 52}: "Motorola Solutions Inc.", + [3]byte{76, 214, 55}: "Qsono Electronics Co., Ltd", + [3]byte{76, 215, 182}: "Helmer Scientific", + [3]byte{76, 217, 196}: "Magneti Marelli Automotive Electronics (Guangzhou) Co. Ltd", + [3]byte{76, 223, 61}: "TEAM ENGINEERS ADVANCE TECHNOLOGIES INDIA PVT LTD", + [3]byte{76, 225, 187}: "Zhuhai HiFocus Technology Co., Ltd.", + [3]byte{76, 226, 241}: "sclak srl", + [3]byte{76, 230, 118}: "Buffalo Inc.", + [3]byte{76, 233, 51}: "RailComm, LLC", + [3]byte{76, 235, 66}: "Intel Corporate", + [3]byte{76, 237, 222}: "Askey Computer Corp", + [3]byte{76, 240, 46}: "Vifa Denmark A/S", + [3]byte{76, 242, 191}: "Cambridge Industries(Group) Co.,Ltd.", + [3]byte{76, 244, 91}: "Blue Clover Devices", + [3]byte{76, 245, 160}: "Scalable Network Technologies Inc", + [3]byte{76, 247, 55}: "SamJi Electronics Co., Ltd", + [3]byte{80, 0, 140}: "Hong Kong Telecommunications (HKT) Limited", + [3]byte{80, 1, 187}: "Samsung Electronics", + [3]byte{80, 5, 61}: "CyWee Group Ltd", + [3]byte{80, 6, 4}: "Cisco", + [3]byte{80, 11, 50}: "Foxda Technology Industrial(ShenZhen)Co.,LTD", + [3]byte{80, 14, 109}: "TrafficCast International", + [3]byte{80, 17, 235}: "SilverNet Ltd", + [3]byte{80, 20, 181}: "Richfit Information Technology Co., Ltd", + [3]byte{80, 23, 255}: "Cisco", + [3]byte{80, 26, 197}: "Microsoft", + [3]byte{80, 28, 191}: "Cisco", + [3]byte{80, 32, 107}: "Emerson Climate Technologies Transportation Solutions", + [3]byte{80, 34, 103}: "PixeLINK", + [3]byte{80, 37, 43}: "Nethra Imaging Incorporated", + [3]byte{80, 38, 144}: "Fujitsu Limited", + [3]byte{80, 39, 199}: "TECHNART Co.,Ltd", + [3]byte{80, 41, 77}: "NANJING IOT SENSOR TECHNOLOGY CO,LTD", + [3]byte{80, 42, 126}: "Smart electronic GmbH", + [3]byte{80, 42, 139}: "Telekom Research and Development Sdn Bhd", + [3]byte{80, 45, 29}: "Nokia Corporation", + [3]byte{80, 45, 162}: "Intel Corporate", + [3]byte{80, 45, 244}: "Phytec Messtechnik GmbH", + [3]byte{80, 46, 92}: "HTC Corporation", + [3]byte{80, 46, 206}: "Asahi Electronics Co.,Ltd", + [3]byte{80, 50, 117}: "Samsung Electronics Co.,Ltd", + [3]byte{80, 57, 85}: "Cisco SPVTG", + [3]byte{80, 60, 196}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{80, 61, 229}: "CISCO SYSTEMS, INC.", + [3]byte{80, 63, 86}: "Syncmold Enterprise Corp", + [3]byte{80, 70, 93}: "ASUSTek COMPUTER INC.", + [3]byte{80, 72, 235}: "BEIJING HAIHEJINSHENG NETWORK TECHNOLOGY CO. LTD.", + [3]byte{80, 74, 94}: "Masimo Corporation", + [3]byte{80, 74, 110}: "NETGEAR INC.,", + [3]byte{80, 79, 148}: "Loxone Electronics GmbH", + [3]byte{80, 80, 101}: "TAKT Corporation", + [3]byte{80, 86, 99}: "Texas Instruments", + [3]byte{80, 86, 168}: "Jolla Ltd", + [3]byte{80, 86, 191}: "Samsung Electronics Co.,LTD", + [3]byte{80, 87, 168}: "CISCO SYSTEMS, INC.", + [3]byte{80, 88, 0}: "WyTec International, Inc.", + [3]byte{80, 90, 198}: "GUANGDONG SUPER TELECOM CO.,LTD.", + [3]byte{80, 96, 40}: "Xirrus Inc.", + [3]byte{80, 97, 132}: "Avaya, Inc", + [3]byte{80, 97, 214}: "Indu-Sol GmbH", + [3]byte{80, 99, 19}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{80, 100, 65}: "Greenlee", + [3]byte{80, 103, 135}: "iTellus", + [3]byte{80, 103, 174}: "Cisco", + [3]byte{80, 103, 240}: "ZyXEL Communications Corporation", + [3]byte{80, 111, 154}: "Wi-Fi Alliance", + [3]byte{80, 112, 229}: "He Shan World Fair Electronics Technology Limited", + [3]byte{80, 114, 77}: "BEG Brueck Electronic GmbH", + [3]byte{80, 118, 145}: "Tekpea, Inc.", + [3]byte{80, 118, 166}: "Ecil Informatica Ind. Com. Ltda", + [3]byte{80, 121, 91}: "Interexport Telecomunicaciones S.A.", + [3]byte{80, 125, 2}: "BIODIT", + [3]byte{80, 126, 93}: "Arcadyan Technology Corporation", + [3]byte{80, 133, 105}: "Samsung Electronics Co.,LTD", + [3]byte{80, 135, 137}: "Cisco", + [3]byte{80, 135, 184}: "Nuvyyo Inc", + [3]byte{80, 138, 66}: "Uptmate Technology Co., LTD", + [3]byte{80, 138, 203}: "SHENZHEN MAXMADE TECHNOLOGY CO., LTD.", + [3]byte{80, 140, 119}: "DIRMEIER Schanktechnik GmbH &Co KG", + [3]byte{80, 141, 111}: "CHAHOO Limited", + [3]byte{80, 147, 79}: "Gradual Tecnologia Ltda.", + [3]byte{80, 151, 114}: "Westinghouse Digital", + [3]byte{80, 152, 113}: "Inventum Technologies Private Limited", + [3]byte{80, 159, 39}: "Huawei Technologies Co., Ltd", + [3]byte{80, 160, 84}: "Actineon", + [3]byte{80, 160, 191}: "Alba Fiber Systems Inc.", + [3]byte{80, 164, 200}: "Samsung Electronics Co.,Ltd", + [3]byte{80, 166, 227}: "David Clark Company", + [3]byte{80, 167, 21}: "Aboundi, Inc.", + [3]byte{80, 167, 51}: "Ruckus Wireless", + [3]byte{80, 171, 191}: "Hoseo Telecom", + [3]byte{80, 173, 213}: "Dynalec Corporation", + [3]byte{80, 175, 115}: "Shenzhen Bitland Information Technology Co., Ltd.", + [3]byte{80, 182, 149}: "Micropoint Biotechnologies,Inc.", + [3]byte{80, 183, 195}: "Samsung Electronics CO., LTD", + [3]byte{80, 184, 136}: "wi2be Tecnologia S/A", + [3]byte{80, 184, 162}: "ImTech Technologies LLC,", + [3]byte{80, 189, 95}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{80, 192, 6}: "Carmanah Signs", + [3]byte{80, 194, 113}: "SECURETECH INC", + [3]byte{80, 197, 141}: "Juniper Networks", + [3]byte{80, 199, 191}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{80, 201, 113}: "GN Netcom A/S", + [3]byte{80, 201, 160}: "SKIPPER Electronics AS", + [3]byte{80, 204, 248}: "Samsung Electro Mechanics", + [3]byte{80, 205, 50}: "NanJing Chaoran Science & Technology Co.,Ltd.", + [3]byte{80, 206, 117}: "Measy Electronics Ltd", + [3]byte{80, 210, 116}: "Steffes Corporation", + [3]byte{80, 214, 215}: "Takahata Precision", + [3]byte{80, 224, 199}: "TurControlSystme AG", + [3]byte{80, 225, 74}: "PRIVATE", + [3]byte{80, 229, 73}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{80, 234, 214}: "Apple", + [3]byte{80, 235, 26}: "Brocade Communications Systems, Inc.", + [3]byte{80, 237, 120}: "Changzhou Yongse Infotech Co.,Ltd", + [3]byte{80, 237, 148}: "Egatel SL", + [3]byte{80, 240, 3}: "Open Stack, Inc.", + [3]byte{80, 244, 60}: "Leeo Inc", + [3]byte{80, 245, 32}: "Samsung Electronics Co.,Ltd", + [3]byte{80, 246, 26}: "Kunshan JADE Technologies co., Ltd.", + [3]byte{80, 250, 171}: "L-tek d.o.o.", + [3]byte{80, 252, 48}: "Treehouse Labs", + [3]byte{80, 252, 159}: "Samsung Electronics Co.,Ltd", + [3]byte{80, 254, 242}: "Sify Technologies Ltd", + [3]byte{84, 3, 245}: "EBN Technology Corp.", + [3]byte{84, 4, 150}: "Gigawave LTD", + [3]byte{84, 4, 166}: "ASUSTek COMPUTER INC.", + [3]byte{84, 5, 54}: "Vivago Oy", + [3]byte{84, 5, 95}: "Alcatel Lucent", + [3]byte{84, 9, 141}: "deister electronic GmbH", + [3]byte{84, 17, 47}: "Sulzer Pump Solutions Finland Oy", + [3]byte{84, 17, 95}: "Atamo Pty Ltd", + [3]byte{84, 27, 93}: "Techno-Innov", + [3]byte{84, 29, 251}: "Freestyle Energy Ltd", + [3]byte{84, 31, 213}: "Advantage Electronics", + [3]byte{84, 32, 24}: "Tely Labs", + [3]byte{84, 33, 96}: "Resolution Products", + [3]byte{84, 34, 248}: "zte corporation", + [3]byte{84, 38, 150}: "Apple", + [3]byte{84, 39, 30}: "AzureWave Technonloies, Inc.", + [3]byte{84, 42, 156}: "LSY Defense, LLC.", + [3]byte{84, 42, 162}: "Alpha Networks Inc.", + [3]byte{84, 44, 234}: "PROTECTRON", + [3]byte{84, 47, 137}: "Euclid Laboratories, Inc.", + [3]byte{84, 49, 49}: "Raster Vision Ltd", + [3]byte{84, 53, 48}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{84, 53, 223}: "Symeo GmbH", + [3]byte{84, 57, 104}: "Edgewater Networks Inc", + [3]byte{84, 57, 223}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{84, 61, 55}: "Ruckus Wireless", + [3]byte{84, 66, 73}: "Sony Corporation", + [3]byte{84, 68, 8}: "Nokia Corporation", + [3]byte{84, 70, 107}: "Shenzhen CZTIC Electronic Technology Co., Ltd", + [3]byte{84, 74, 0}: "Cisco", + [3]byte{84, 74, 5}: "wenglor sensoric gmbh", + [3]byte{84, 74, 22}: "Texas Instruments", + [3]byte{84, 81, 70}: "AMG Systems Ltd.", + [3]byte{84, 83, 237}: "Sony Corporation", + [3]byte{84, 84, 20}: "Digital RF Corea, Inc", + [3]byte{84, 94, 189}: "NL Technologies", + [3]byte{84, 95, 169}: "Teracom Limited", + [3]byte{84, 97, 234}: "Zaplox AB", + [3]byte{84, 114, 79}: "Apple", + [3]byte{84, 115, 152}: "Toyo Electronics Corporation", + [3]byte{84, 116, 230}: "Webtech Wireless", + [3]byte{84, 117, 208}: "CISCO SYSTEMS, INC.", + [3]byte{84, 120, 26}: "Cisco", + [3]byte{84, 121, 117}: "Nokia Corporation", + [3]byte{84, 127, 84}: "INGENICO", + [3]byte{84, 127, 168}: "TELCO systems, s.r.o.", + [3]byte{84, 127, 238}: "CISCO SYSTEMS, INC.", + [3]byte{84, 129, 173}: "Eagle Research Corporation", + [3]byte{84, 132, 123}: "Digital Devices GmbH", + [3]byte{84, 136, 14}: "Samsung Electro Mechanics co., LTD.", + [3]byte{84, 137, 34}: "Zelfy Inc", + [3]byte{84, 137, 152}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{84, 146, 190}: "Samsung Electronics Co.,Ltd", + [3]byte{84, 147, 89}: "SHENZHEN TWOWING TECHNOLOGIES CO.,LTD.", + [3]byte{84, 148, 120}: "Silvershore Technology Partners", + [3]byte{84, 154, 22}: "Uzushio Electric Co.,Ltd.", + [3]byte{84, 155, 18}: "Samsung Electronics", + [3]byte{84, 157, 133}: "EnerAccess inc", + [3]byte{84, 159, 53}: "Dell Inc.", + [3]byte{84, 160, 79}: "t-mac Technologies Ltd", + [3]byte{84, 160, 80}: "ASUSTek COMPUTER INC.", + [3]byte{84, 163, 27}: "Shenzhen Linkworld Technology Co,.LTD", + [3]byte{84, 165, 27}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{84, 165, 75}: "NSC Communications Siberia Ltd", + [3]byte{84, 166, 25}: "Alcatel-Lucent Shanghai Bell Co., Ltd", + [3]byte{84, 169, 212}: "Minibar Systems", + [3]byte{84, 174, 39}: "Apple", + [3]byte{84, 182, 32}: "SUHDOL E&C Co.Ltd.", + [3]byte{84, 183, 83}: "Hunan Fenghui Yinjia Science And Technology Co.,Ltd", + [3]byte{84, 190, 247}: "PEGATRON CORPORATION", + [3]byte{84, 200, 15}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{84, 205, 167}: "Fujian Shenzhou Electronic Co.,Ltd", + [3]byte{84, 205, 238}: "ShenZhen Apexis Electronic Co.,Ltd", + [3]byte{84, 208, 237}: "AXIM Communications", + [3]byte{84, 209, 99}: "MAX-TECH,INC", + [3]byte{84, 209, 176}: "Universal Laser Systems, Inc", + [3]byte{84, 212, 111}: "Cisco SPVTG", + [3]byte{84, 223, 0}: "Ulterius Technologies, LLC", + [3]byte{84, 223, 99}: "Intrakey technologies GmbH", + [3]byte{84, 224, 50}: "Juniper Networks", + [3]byte{84, 226, 224}: "Pace plc", + [3]byte{84, 227, 176}: "JVL Industri Elektronik", + [3]byte{84, 228, 58}: "Apple, Inc.", + [3]byte{84, 228, 189}: "FN-LINK TECHNOLOGY LIMITED", + [3]byte{84, 230, 63}: "ShenZhen LingKeWeiEr Technology Co., Ltd.", + [3]byte{84, 230, 252}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{84, 234, 168}: "Apple, Inc.", + [3]byte{84, 238, 117}: "Wistron InfoComm(Kunshan)Co.,Ltd.", + [3]byte{84, 239, 146}: "Shenzhen Elink Technology Co., LTD", + [3]byte{84, 245, 182}: "ORIENTAL PACIFIC INTERNATIONAL LIMITED", + [3]byte{84, 246, 102}: "Berthold Technologies GmbH and Co.KG", + [3]byte{84, 248, 118}: "ABB AG", + [3]byte{84, 250, 62}: "Samsung Electronics Co.,LTD", + [3]byte{84, 251, 88}: "WISEWARE, Lda", + [3]byte{84, 253, 191}: "Scheidt & Bachmann GmbH", + [3]byte{84, 255, 207}: "Mopria Alliance", + [3]byte{88, 5, 40}: "LABRIS NETWORKS", + [3]byte{88, 5, 86}: "Elettronica GF S.r.L.", + [3]byte{88, 8, 250}: "Fiber Optic & telecommunication INC.", + [3]byte{88, 9, 67}: "PRIVATE", + [3]byte{88, 9, 229}: "Kivic Inc.", + [3]byte{88, 10, 32}: "Cisco", + [3]byte{88, 16, 140}: "Intelbras", + [3]byte{88, 18, 67}: "AcSiP Technology Corp.", + [3]byte{88, 22, 38}: "Avaya, Inc", + [3]byte{88, 23, 12}: "Sony Ericsson Mobile Communications AB", + [3]byte{88, 28, 189}: "Affinegy", + [3]byte{88, 29, 145}: "Advanced Mobile Telecom co.,ltd.", + [3]byte{88, 31, 103}: "Open-m technology limited", + [3]byte{88, 31, 170}: "Apple", + [3]byte{88, 31, 239}: "Tuttnaer LTD", + [3]byte{88, 33, 54}: "KMB systems, s.r.o.", + [3]byte{88, 35, 140}: "Technicolor CH USA", + [3]byte{88, 46, 254}: "Lighting Science Group", + [3]byte{88, 47, 66}: "Universal Electric Corporation", + [3]byte{88, 52, 59}: "Glovast Technology Ltd.", + [3]byte{88, 53, 217}: "CISCO SYSTEMS, INC.", + [3]byte{88, 60, 198}: "Omneality Ltd.", + [3]byte{88, 66, 228}: "Sigma International General Medical Apparatus, LLC.", + [3]byte{88, 70, 143}: "Koncar Electronics and Informatics", + [3]byte{88, 70, 225}: "Baxter Healthcare", + [3]byte{88, 72, 192}: "COFLEC", + [3]byte{88, 73, 59}: "Palo Alto Networks", + [3]byte{88, 73, 186}: "Chitai Electronic Corp.", + [3]byte{88, 76, 25}: "Chongqing Guohong Technology Development Company Limited", + [3]byte{88, 76, 238}: "Digital One Technologies, Limited", + [3]byte{88, 80, 118}: "Linear Equipamentos Eletronicos SA", + [3]byte{88, 80, 171}: "TLS Corporation", + [3]byte{88, 80, 230}: "Best Buy Corporation", + [3]byte{88, 85, 202}: "Apple", + [3]byte{88, 86, 232}: "ARRIS Group, Inc.", + [3]byte{88, 87, 13}: "Danfoss Solar Inverters", + [3]byte{88, 99, 154}: "TPL SYSTEMES", + [3]byte{88, 101, 230}: "INFOMARK CO., LTD.", + [3]byte{88, 102, 186}: "Hangzhou H3C Technologies Co., Limited", + [3]byte{88, 103, 26}: "BARNES&NOBLE.COM", + [3]byte{88, 103, 127}: "Clare Controls Inc.", + [3]byte{88, 105, 108}: "Fujian Ruijie Networks co, ltd", + [3]byte{88, 105, 249}: "Fusion Transactive Ltd.", + [3]byte{88, 106, 177}: "Hangzhou H3C Technologies Co., Limited", + [3]byte{88, 109, 143}: "Cisco-Linksys, LLC", + [3]byte{88, 110, 214}: "PRIVATE", + [3]byte{88, 117, 33}: "CJSC RTSoft", + [3]byte{88, 118, 117}: "Beijing ECHO Technologies Co.,Ltd", + [3]byte{88, 118, 197}: "DIGI I'S LTD", + [3]byte{88, 122, 77}: "Stonesoft Corporation", + [3]byte{88, 123, 233}: "AirPro Technology India Pvt. Ltd", + [3]byte{88, 126, 97}: "Hisense Electric Co., Ltd", + [3]byte{88, 127, 183}: "SONAR INDUSTRIAL CO., LTD.", + [3]byte{88, 127, 200}: "S2M", + [3]byte{88, 132, 228}: "IP500 Alliance e.V.", + [3]byte{88, 135, 76}: "LITE-ON CLEAN ENERGY TECHNOLOGY CORP.", + [3]byte{88, 135, 226}: "Shenzhen Coship Electronics Co., Ltd.", + [3]byte{88, 141, 9}: "CISCO SYSTEMS, INC.", + [3]byte{88, 145, 207}: "Intel Corporate", + [3]byte{88, 146, 13}: "Kinetic Avionics Limited", + [3]byte{88, 147, 150}: "Ruckus Wireless", + [3]byte{88, 148, 107}: "Intel Corporate", + [3]byte{88, 148, 207}: "Vertex Standard LMR, Inc.", + [3]byte{88, 151, 30}: "Cisco", + [3]byte{88, 152, 53}: "Technicolor", + [3]byte{88, 152, 111}: "Revolution Display", + [3]byte{88, 156, 252}: "FreeBSD Foundation", + [3]byte{88, 162, 181}: "LG Electronics", + [3]byte{88, 167, 111}: "iD corporation", + [3]byte{88, 176, 53}: "Apple", + [3]byte{88, 176, 212}: "ZuniData Systems Inc.", + [3]byte{88, 185, 97}: "SOLEM Electronique", + [3]byte{88, 185, 225}: "Crystalfontz America, Inc.", + [3]byte{88, 188, 39}: "CISCO SYSTEMS, INC.", + [3]byte{88, 189, 163}: "Nintendo Co., Ltd.", + [3]byte{88, 189, 249}: "Sigrand", + [3]byte{88, 191, 234}: "CISCO SYSTEMS, INC.", + [3]byte{88, 194, 50}: "NEC Corporation", + [3]byte{88, 195, 139}: "Samsung Electronics", + [3]byte{88, 207, 75}: "Lufkin Industries", + [3]byte{88, 208, 113}: "BW Broadcast", + [3]byte{88, 208, 143}: "IEEE 1904.1 Working Group", + [3]byte{88, 214, 211}: "Dairy Cheq Inc", + [3]byte{88, 219, 141}: "Fast Co., Ltd.", + [3]byte{88, 224, 44}: "Micro Technic A/S", + [3]byte{88, 227, 38}: "Compass Technologies Inc.", + [3]byte{88, 228, 118}: "CENTRON COMMUNICATIONS TECHNOLOGIES FUJIAN CO.,LTD", + [3]byte{88, 230, 54}: "EVRsafe Technologies", + [3]byte{88, 231, 71}: "Deltanet AG", + [3]byte{88, 232, 8}: "AUTONICS CORPORATION", + [3]byte{88, 235, 20}: "Proteus Digital Health", + [3]byte{88, 236, 225}: "Newport Corporation", + [3]byte{88, 238, 206}: "Icon Time Systems", + [3]byte{88, 243, 135}: "HCCP", + [3]byte{88, 243, 156}: "Cisco", + [3]byte{88, 246, 123}: "Xia Men UnionCore Technology LTD.", + [3]byte{88, 246, 191}: "Kyoto University", + [3]byte{88, 249, 142}: "SECUDOS GmbH", + [3]byte{88, 252, 219}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{88, 253, 32}: "Bravida Sakerhet AB", + [3]byte{92, 2, 106}: "Applied Vision Corporation", + [3]byte{92, 7, 111}: "Thought Creator", + [3]byte{92, 10, 91}: "SAMSUNG ELECTRO-MECHANICS CO., LTD.", + [3]byte{92, 12, 187}: "CELIZION Inc.", + [3]byte{92, 14, 139}: "Motorola", + [3]byte{92, 17, 147}: "Seal One AG", + [3]byte{92, 20, 55}: "Thyssenkrupp Aufzugswerke GmbH", + [3]byte{92, 21, 21}: "ADVAN", + [3]byte{92, 21, 225}: "AIDC TECHNOLOGY (S) PTE LTD", + [3]byte{92, 22, 199}: "Big Switch Networks", + [3]byte{92, 23, 55}: "I-View Now, LLC.", + [3]byte{92, 23, 211}: "LGE", + [3]byte{92, 24, 181}: "Talon Communications", + [3]byte{92, 32, 208}: "Asoni Communication Co., Ltd.", + [3]byte{92, 34, 196}: "DAE EUN ELETRONICS CO., LTD", + [3]byte{92, 36, 121}: "Baltech AG", + [3]byte{92, 37, 76}: "Avire Global Pte Ltd", + [3]byte{92, 38, 10}: "Dell Inc.", + [3]byte{92, 42, 239}: "Open Access Pty Ltd", + [3]byte{92, 43, 245}: "Vivint", + [3]byte{92, 46, 89}: "Samsung Electronics Co.,Ltd", + [3]byte{92, 46, 210}: "ABC(XiSheng) Electronics Co.,Ltd", + [3]byte{92, 49, 62}: "Texas Instruments", + [3]byte{92, 51, 39}: "Spazio Italia srl", + [3]byte{92, 51, 92}: "Swissphone Telecom AG", + [3]byte{92, 51, 142}: "Alpha Networkc Inc.", + [3]byte{92, 53, 59}: "Compal Broadband Networks Inc.", + [3]byte{92, 53, 218}: "There Corporation Oy", + [3]byte{92, 54, 184}: "TCL King Electrical Appliances (Huizhou) Ltd.", + [3]byte{92, 56, 224}: "Shanghai Super Electronics Technology Co.,LTD", + [3]byte{92, 60, 39}: "Samsung Electronics Co.,Ltd", + [3]byte{92, 64, 88}: "Jefferson Audio Video Systems, Inc.", + [3]byte{92, 67, 210}: "HAZEMEYER", + [3]byte{92, 74, 38}: "Enguity Technology Corp", + [3]byte{92, 76, 169}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{92, 80, 21}: "CISCO SYSTEMS, INC.", + [3]byte{92, 81, 79}: "Intel Corporate", + [3]byte{92, 86, 237}: "3pleplay Electronics Private Limited", + [3]byte{92, 87, 26}: "ARRIS Group, Inc.", + [3]byte{92, 87, 200}: "Nokia Corporation", + [3]byte{92, 89, 72}: "Apple", + [3]byte{92, 91, 194}: "YIK Corporation", + [3]byte{92, 94, 171}: "Juniper Networks", + [3]byte{92, 99, 191}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{92, 105, 132}: "NUVICO", + [3]byte{92, 106, 125}: "KENTKART EGE ELEKTRONIK SAN. VE TIC. LTD. STI.", + [3]byte{92, 107, 50}: "Texas Instruments", + [3]byte{92, 109, 32}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{92, 111, 79}: "S.A. SISTEL", + [3]byte{92, 119, 87}: "Haivision Network Video", + [3]byte{92, 125, 94}: "Huawei Technologies Co., Ltd", + [3]byte{92, 132, 134}: "Brightsource Industries Israel LTD", + [3]byte{92, 134, 74}: "Secret Labs LLC", + [3]byte{92, 135, 120}: "Cybertelbridge co.,ltd", + [3]byte{92, 137, 212}: "Beijing Banner Electric Co.,Ltd", + [3]byte{92, 141, 78}: "Apple", + [3]byte{92, 143, 224}: "ARRIS Group, Inc.", + [3]byte{92, 147, 162}: "Liteon Technology Corporation", + [3]byte{92, 149, 174}: "Apple", + [3]byte{92, 150, 106}: "RTNET", + [3]byte{92, 150, 157}: "Apple", + [3]byte{92, 151, 243}: "Apple", + [3]byte{92, 154, 216}: "Fujitsu Limited", + [3]byte{92, 163, 157}: "SAMSUNG ELECTRO-MECHANICS CO., LTD.", + [3]byte{92, 163, 235}: "Lokel s.r.o.", + [3]byte{92, 164, 138}: "Cisco", + [3]byte{92, 170, 253}: "Sonos, Inc.", + [3]byte{92, 172, 76}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{92, 181, 36}: "Sony Ericsson Mobile Communications AB", + [3]byte{92, 182, 204}: "NovaComm Technologies Inc.", + [3]byte{92, 184, 203}: "Allis Communications", + [3]byte{92, 189, 158}: "HONGKONG MIRACLE EAGLE TECHNOLOGY(GROUP) LIMITED", + [3]byte{92, 194, 19}: "Fr. Sauter AG", + [3]byte{92, 197, 212}: "Intel Corporate", + [3]byte{92, 198, 208}: "Skyworth Digital technology(shenzhen)co.ltd.", + [3]byte{92, 201, 211}: "PALLADIUM ENERGY ELETRONICA DA AMAZONIA LTDA", + [3]byte{92, 202, 50}: "Theben AG", + [3]byte{92, 206, 173}: "CDYNE Corporation", + [3]byte{92, 209, 53}: "Xtreme Power Systems", + [3]byte{92, 210, 228}: "Intel Corporate", + [3]byte{92, 212, 27}: "UCZOON Technology Co., LTD", + [3]byte{92, 212, 171}: "Zektor", + [3]byte{92, 214, 31}: "Qardio, Inc", + [3]byte{92, 217, 152}: "D-Link Corporation", + [3]byte{92, 218, 212}: "Murata Manufacturing Co., Ltd.", + [3]byte{92, 221, 112}: "Hangzhou H3C Technologies Co., Limited", + [3]byte{92, 224, 197}: "Intel Corporate", + [3]byte{92, 224, 202}: "FeiTian United (Beijing) System Technology Co., Ltd.", + [3]byte{92, 224, 246}: "NIC.br- Nucleo de Informacao e Coordenacao do Ponto BR", + [3]byte{92, 226, 35}: "Delphin Technology AG", + [3]byte{92, 226, 134}: "Nortel Networks", + [3]byte{92, 226, 244}: "AcSiP Technology Corp.", + [3]byte{92, 231, 191}: "New Singularity International Technical Development Co.,Ltd", + [3]byte{92, 232, 235}: "Samsung Electronics", + [3]byte{92, 235, 78}: "R. STAHL HMI Systems GmbH", + [3]byte{92, 238, 121}: "Global Digitech Co LTD", + [3]byte{92, 242, 7}: "Speco Technologies", + [3]byte{92, 243, 112}: "CC&C Technologies, Inc", + [3]byte{92, 243, 252}: "IBM Corp", + [3]byte{92, 244, 171}: "ZyXEL Communications Corp", + [3]byte{92, 245, 13}: "Institute of microelectronic applications", + [3]byte{92, 246, 220}: "Samsung Electronics Co.,LTD", + [3]byte{92, 248, 161}: "Murata Manufactuaring Co.,Ltd.", + [3]byte{92, 249, 56}: "Apple, Inc", + [3]byte{92, 249, 106}: "Huawei Technologies Co., Ltd", + [3]byte{92, 249, 221}: "Dell Inc", + [3]byte{92, 249, 240}: "Atomos Engineering P/L", + [3]byte{92, 255, 53}: "Wistron Corporation", + [3]byte{92, 255, 255}: "Shenzhen Kezhonglong Optoelectronic Technology Co., Ltd", + [3]byte{96, 2, 146}: "PEGATRON CORPORATION", + [3]byte{96, 2, 180}: "Wistron NeWeb Corp.", + [3]byte{96, 3, 8}: "Apple", + [3]byte{96, 3, 71}: "Billion Electric Co. Ltd.", + [3]byte{96, 4, 23}: "POSBANK CO.,LTD", + [3]byte{96, 15, 119}: "SilverPlus, Inc", + [3]byte{96, 17, 153}: "Siama Systems Inc", + [3]byte{96, 18, 131}: "Soluciones Tecnologicas para la Salud y el Bienestar SA", + [3]byte{96, 21, 199}: "IdaTech", + [3]byte{96, 25, 12}: "RRAMAC", + [3]byte{96, 25, 41}: "VOLTRONIC POWER TECHNOLOGY(SHENZHEN) CORP.", + [3]byte{96, 29, 15}: "Midnite Solar", + [3]byte{96, 30, 2}: "EltexAlatau", + [3]byte{96, 33, 3}: "STCUBE.INC", + [3]byte{96, 33, 192}: "Murata Manufactuaring Co.,Ltd.", + [3]byte{96, 36, 193}: "Jiangsu Zhongxun Electronic Technology Co., Ltd", + [3]byte{96, 42, 84}: "CardioTek B.V.", + [3]byte{96, 42, 208}: "Cisco SPVTG", + [3]byte{96, 50, 240}: "Mplus technology", + [3]byte{96, 51, 75}: "Apple", + [3]byte{96, 53, 83}: "Buwon Technology", + [3]byte{96, 54, 150}: "The Sapling Company", + [3]byte{96, 54, 221}: "Intel Corporate", + [3]byte{96, 56, 14}: "Alps Electric Co.,", + [3]byte{96, 57, 31}: "ABB Ltd", + [3]byte{96, 63, 197}: "COX CO., LTD", + [3]byte{96, 68, 245}: "Easy Digital Ltd.", + [3]byte{96, 69, 94}: "Liptel s.r.o.", + [3]byte{96, 69, 189}: "Microsoft", + [3]byte{96, 70, 22}: "XIAMEN VANN INTELLIGENT CO., LTD", + [3]byte{96, 71, 212}: "FORICS Electronic Technology Co., Ltd.", + [3]byte{96, 72, 38}: "Newbridge Technologies Int. Ltd.", + [3]byte{96, 74, 28}: "SUYIN Corporation", + [3]byte{96, 80, 193}: "Kinetek Sports", + [3]byte{96, 81, 44}: "TCT mobile limited", + [3]byte{96, 82, 208}: "FACTS Engineering", + [3]byte{96, 84, 100}: "Eyedro Green Solutions Inc.", + [3]byte{96, 87, 24}: "Intel Corporate", + [3]byte{96, 96, 31}: "SZ DJI TECHNOLOGY CO.,LTD", + [3]byte{96, 99, 253}: "Transcend Communication Beijing Co.,Ltd.", + [3]byte{96, 100, 161}: "RADiflow Ltd.", + [3]byte{96, 103, 32}: "Intel Corporate", + [3]byte{96, 105, 68}: "Apple, Inc", + [3]byte{96, 105, 155}: "isepos GmbH", + [3]byte{96, 107, 189}: "Samsung Electronics Co., LTD", + [3]byte{96, 108, 102}: "Intel Corporate", + [3]byte{96, 115, 92}: "Cisco", + [3]byte{96, 116, 141}: "Atmaca Elektronik", + [3]byte{96, 118, 136}: "Velodyne", + [3]byte{96, 119, 226}: "Samsung Electronics Co.,Ltd", + [3]byte{96, 129, 43}: "Custom Control Concepts", + [3]byte{96, 129, 249}: "Helium Systems, Inc", + [3]byte{96, 131, 178}: "GkWare e.K.", + [3]byte{96, 132, 59}: "Soladigm, Inc.", + [3]byte{96, 134, 69}: "Avery Weigh-Tronix, LLC", + [3]byte{96, 137, 60}: "Thermo Fisher Scientific P.O.A.", + [3]byte{96, 137, 177}: "Key Digital Systems", + [3]byte{96, 137, 183}: "KAEL MÃœHENDÄ°SLÄ°K ELEKTRONÄ°K TÄ°CARET SANAYÄ° LÄ°MÄ°TED ŞİRKETÄ°", + [3]byte{96, 140, 43}: "Hanson Technology", + [3]byte{96, 141, 23}: "Sentrus Government Systems Division, Inc", + [3]byte{96, 143, 92}: "Samsung Electronics Co.,Ltd", + [3]byte{96, 144, 132}: "DSSD Inc", + [3]byte{96, 146, 23}: "Apple", + [3]byte{96, 150, 32}: "PRIVATE", + [3]byte{96, 153, 209}: "Vuzix / Lenovo", + [3]byte{96, 154, 164}: "GVI SECURITY INC.", + [3]byte{96, 158, 100}: "Vivonic GmbH", + [3]byte{96, 159, 157}: "CloudSwitch", + [3]byte{96, 161, 10}: "Samsung Electronics Co.,Ltd", + [3]byte{96, 164, 76}: "ASUSTek COMPUTER INC.", + [3]byte{96, 168, 254}: "Nokia Solutions and Networks", + [3]byte{96, 169, 176}: "Merchandising Technologies, Inc", + [3]byte{96, 177, 133}: "ATH system", + [3]byte{96, 179, 196}: "Elber Srl", + [3]byte{96, 182, 6}: "Phorus", + [3]byte{96, 182, 23}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{96, 185, 51}: "Deutron Electronics Corp.", + [3]byte{96, 185, 130}: "RO.VE.R. Laboratories S.p.A.", + [3]byte{96, 187, 12}: "Beijing HuaqinWorld Technology Co,Ltd", + [3]byte{96, 188, 76}: "EWM Hightec Welding GmbH", + [3]byte{96, 189, 145}: "Move Innovation", + [3]byte{96, 190, 181}: "Motorola Mobility LLC", + [3]byte{96, 193, 203}: "Fujian Great Power PLC Equipment Co.,Ltd", + [3]byte{96, 195, 151}: "2Wire Inc", + [3]byte{96, 197, 71}: "Apple", + [3]byte{96, 197, 168}: "Beijing LT Honway Technology Co.,Ltd", + [3]byte{96, 199, 152}: "Verifone, Inc.", + [3]byte{96, 201, 128}: "Trymus", + [3]byte{96, 203, 251}: "AirScape Inc.", + [3]byte{96, 205, 169}: "Abloomy", + [3]byte{96, 205, 197}: "Taiwan Carol Electronics., Ltd", + [3]byte{96, 208, 169}: "Samsung Electronics Co.,Ltd", + [3]byte{96, 209, 170}: "Vishal Telecommunications Pvt Ltd", + [3]byte{96, 210, 185}: "REALAND BIO CO., LTD.", + [3]byte{96, 211, 10}: "Quatius Limited", + [3]byte{96, 216, 25}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{96, 217, 199}: "Apple", + [3]byte{96, 218, 35}: "Estech Co.,Ltd", + [3]byte{96, 219, 42}: "HNS", + [3]byte{96, 222, 68}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{96, 224, 14}: "SHINSEI ELECTRONICS CO LTD", + [3]byte{96, 227, 39}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{96, 231, 1}: "Huawei Technologies Co., Ltd", + [3]byte{96, 233, 86}: "Ayla Networks, Inc", + [3]byte{96, 235, 105}: "Quanta computer Inc.", + [3]byte{96, 241, 61}: "JABLOCOM s.r.o.", + [3]byte{96, 242, 129}: "TRANWO TECHNOLOGY CO., LTD.", + [3]byte{96, 242, 239}: "VisionVera International Co., Ltd.", + [3]byte{96, 243, 218}: "Logic Way GmbH", + [3]byte{96, 244, 148}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{96, 245, 156}: "CRU-Dataport", + [3]byte{96, 246, 115}: "TERUMO CORPORATION", + [3]byte{96, 250, 205}: "Apple", + [3]byte{96, 251, 66}: "Apple", + [3]byte{96, 254, 30}: "China Palms Telecom.Ltd", + [3]byte{96, 254, 32}: "2 Wire", + [3]byte{96, 254, 197}: "Apple", + [3]byte{96, 254, 249}: "Thomas & Betts", + [3]byte{96, 255, 221}: "C.E. ELECTRONICS, INC", + [3]byte{100, 0, 45}: "Powerlinq Co., LTD", + [3]byte{100, 0, 241}: "CISCO SYSTEMS, INC.", + [3]byte{100, 5, 190}: "NEW LIGHT LED", + [3]byte{100, 9, 76}: "Beijing Superbee Wireless Technology Co.,Ltd", + [3]byte{100, 9, 128}: "XIAOMI Electronics,CO.,LTD", + [3]byte{100, 11, 74}: "Digital Telecom Technology Limited", + [3]byte{100, 14, 54}: "TAZTAG", + [3]byte{100, 14, 148}: "Pluribus Networks, Inc.", + [3]byte{100, 15, 40}: "2wire", + [3]byte{100, 16, 132}: "HEXIUM Technical Development Co., Ltd.", + [3]byte{100, 18, 37}: "Cisco", + [3]byte{100, 22, 141}: "CISCO SYSTEMS, INC.", + [3]byte{100, 22, 240}: "Shehzhen Huawei Communication Technologies Co., Ltd.", + [3]byte{100, 26, 34}: "Heliospectra/Woodhill Investments", + [3]byte{100, 28, 103}: "DIGIBRAS INDUSTRIA DO BRASILS/A", + [3]byte{100, 30, 129}: "Dowslake Microsystems", + [3]byte{100, 32, 12}: "Apple", + [3]byte{100, 33, 132}: "Nippon Denki Kagaku Co.,LTD", + [3]byte{100, 34, 22}: "Shandong Taixin Electronic co.,Ltd", + [3]byte{100, 36, 0}: "Xorcom Ltd.", + [3]byte{100, 39, 55}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{100, 45, 183}: "SEUNGIL ELECTRONICS", + [3]byte{100, 49, 80}: "Hewlett-Packard Company", + [3]byte{100, 49, 126}: "Dexin Corporation", + [3]byte{100, 52, 9}: "BITwave Pte Ltd", + [3]byte{100, 62, 140}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{100, 63, 95}: "Exablaze", + [3]byte{100, 66, 20}: "Swisscom Energy Solutions AG", + [3]byte{100, 67, 70}: "GuangDong Quick Network Computer CO.,LTD", + [3]byte{100, 75, 195}: "Shanghai WOASiS Telecommunications Ltd., Co.", + [3]byte{100, 75, 240}: "CalDigit, Inc", + [3]byte{100, 77, 112}: "dSPACE GmbH", + [3]byte{100, 79, 116}: "LENUS Co., Ltd.", + [3]byte{100, 79, 176}: "Hyunjin.com", + [3]byte{100, 81, 6}: "Hewlett Packard", + [3]byte{100, 81, 126}: "LONG BEN (DONGGUAN) ELECTRONIC TECHNOLOGY CO.,LTD.", + [3]byte{100, 82, 153}: "The Chamberlain Group, Inc", + [3]byte{100, 83, 93}: "Frauscher Sensortechnik", + [3]byte{100, 84, 34}: "Equinox Payments", + [3]byte{100, 85, 99}: "Intelight Inc.", + [3]byte{100, 85, 127}: "NSFOCUS Information Technology Co., Ltd.", + [3]byte{100, 85, 177}: "ARRIS Group, Inc.", + [3]byte{100, 86, 1}: "TP-LINK TECHNOLOGIES CO.,LTD", + [3]byte{100, 90, 4}: "Chicony Electronics Co., Ltd.", + [3]byte{100, 93, 215}: "Shenzhen Lifesense Medical Electronics Co., Ltd.", + [3]byte{100, 94, 190}: "Yahoo! JAPAN", + [3]byte{100, 95, 255}: "Nicolet Neuro", + [3]byte{100, 98, 35}: "Cellient Co., Ltd.", + [3]byte{100, 100, 155}: "juniper networks", + [3]byte{100, 101, 192}: "Nuvon, Inc", + [3]byte{100, 102, 179}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{100, 103, 7}: "Beijing Omnific Technology, Ltd.", + [3]byte{100, 104, 12}: "COMTREND", + [3]byte{100, 105, 188}: "Hytera Communications Co .,ltd", + [3]byte{100, 108, 178}: "Samsung Electronics Co.,Ltd", + [3]byte{100, 110, 108}: "Radio Datacom LLC", + [3]byte{100, 110, 234}: "Iskratel d.o.o.", + [3]byte{100, 112, 2}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{100, 114, 216}: "GooWi Technology Co.,Limited", + [3]byte{100, 115, 226}: "Arbiter Systems, Inc.", + [3]byte{100, 118, 87}: "Innovative Security Designs", + [3]byte{100, 118, 186}: "Apple", + [3]byte{100, 119, 145}: "Samsung Electronics Co.,Ltd", + [3]byte{100, 123, 212}: "Texas Instruments", + [3]byte{100, 124, 52}: "Ubee Interactive Corp.", + [3]byte{100, 125, 129}: "YOKOTA INDUSTRIAL CO,.LTD", + [3]byte{100, 127, 218}: "TEKTELIC Communications Inc.", + [3]byte{100, 128, 139}: "VG Controls, Inc.", + [3]byte{100, 128, 153}: "Intel Corporate", + [3]byte{100, 129, 37}: "Alphatron Marine BV", + [3]byte{100, 135, 136}: "Juniper Networks", + [3]byte{100, 135, 215}: "Pirelli Tyre S.p.A.", + [3]byte{100, 136, 255}: "Sichuan Changhong Electric Ltd.", + [3]byte{100, 137, 154}: "LG Electronics", + [3]byte{100, 141, 158}: "IVT Electronic Co.,Ltd", + [3]byte{100, 153, 93}: "LGE", + [3]byte{100, 153, 104}: "Elentec", + [3]byte{100, 153, 160}: "AG Elektronik AB", + [3]byte{100, 155, 36}: "V Technology Co., Ltd.", + [3]byte{100, 156, 129}: "Qualcomm iSkoot, Inc.", + [3]byte{100, 156, 142}: "Texas Instruments", + [3]byte{100, 158, 243}: "CISCO SYSTEMS, INC.", + [3]byte{100, 159, 247}: "Kone OYj", + [3]byte{100, 160, 231}: "CISCO SYSTEMS, INC.", + [3]byte{100, 162, 50}: "OOO Samlight", + [3]byte{100, 163, 65}: "Wonderlan (Beijing) Technology Co., Ltd.", + [3]byte{100, 163, 203}: "Apple", + [3]byte{100, 167, 105}: "HTC Corporation", + [3]byte{100, 167, 221}: "Avaya, Inc", + [3]byte{100, 168, 55}: "Juni Korea Co., Ltd", + [3]byte{100, 174, 12}: "CISCO SYSTEMS, INC.", + [3]byte{100, 174, 136}: "Polytec GmbH", + [3]byte{100, 178, 29}: "Chengdu Phycom Tech Co., Ltd.", + [3]byte{100, 179, 16}: "Samsung Electronics Co.,Ltd", + [3]byte{100, 179, 112}: "PowerComm Solutons LLC", + [3]byte{100, 180, 115}: "Xiaomi inc.", + [3]byte{100, 182, 74}: "ViVOtech, Inc.", + [3]byte{100, 184, 83}: "Samsung Elec Co.,Ltd", + [3]byte{100, 185, 232}: "Apple", + [3]byte{100, 186, 189}: "SDJ Technologies, Inc.", + [3]byte{100, 188, 17}: "CombiQ AB", + [3]byte{100, 197, 170}: "South African Broadcasting Corporation", + [3]byte{100, 198, 103}: "Barnes&Noble", + [3]byte{100, 198, 175}: "AXERRA Networks Ltd", + [3]byte{100, 201, 68}: "LARK Technologies, Inc", + [3]byte{100, 208, 45}: "Next Generation Integration (NGI)", + [3]byte{100, 209, 163}: "Sitecom Europe BV", + [3]byte{100, 210, 65}: "Keith & Koep GmbH", + [3]byte{100, 212, 189}: "ALPS ELECTRIC CO.,LTD.", + [3]byte{100, 212, 218}: "Intel Corporate", + [3]byte{100, 216, 20}: "CISCO SYSTEMS, INC.", + [3]byte{100, 217, 18}: "Solidica, Inc.", + [3]byte{100, 217, 84}: "TAICANG AND W ELECTRONICS CO LTD", + [3]byte{100, 217, 137}: "CISCO SYSTEMS, INC.", + [3]byte{100, 219, 24}: "OpenPattern", + [3]byte{100, 220, 1}: "Static Systems Group PLC", + [3]byte{100, 222, 28}: "Kingnetic Pte Ltd", + [3]byte{100, 225, 97}: "DEP Corp.", + [3]byte{100, 229, 153}: "EFM Networks", + [3]byte{100, 230, 37}: "Woxu Wireless Co., Ltd", + [3]byte{100, 230, 130}: "Apple", + [3]byte{100, 232, 79}: "Serialway Communication Technology Co. Ltd", + [3]byte{100, 232, 146}: "Morio Denki Co., Ltd.", + [3]byte{100, 232, 230}: "global moisture management system", + [3]byte{100, 233, 80}: "Cisco", + [3]byte{100, 234, 197}: "SiboTech Automation Co., Ltd.", + [3]byte{100, 235, 140}: "Seiko Epson Corporation", + [3]byte{100, 237, 87}: "ARRIS Group, Inc.", + [3]byte{100, 237, 98}: "WOORI SYSTEMS Co., Ltd", + [3]byte{100, 242, 66}: "Gerdes Aktiengesellschaft", + [3]byte{100, 245, 14}: "Kinion Technology Company Limited", + [3]byte{100, 249, 112}: "Kenade Electronics Technology Co.,LTD.", + [3]byte{100, 249, 135}: "Avvasi Inc.", + [3]byte{100, 252, 140}: "Zonar Systems", + [3]byte{104, 5, 113}: "Samsung Electronics Co.,Ltd", + [3]byte{104, 5, 202}: "Intel Corporate", + [3]byte{104, 9, 39}: "Apple", + [3]byte{104, 10, 215}: "Yancheng Kecheng Optoelectronic Technology Co., Ltd", + [3]byte{104, 18, 45}: "Special Instrument Development Co., Ltd.", + [3]byte{104, 21, 144}: "SAGEMCOM SAS", + [3]byte{104, 21, 211}: "Zaklady Elektroniki i Mechaniki Precyzyjnej R&G S.A.", + [3]byte{104, 22, 5}: "Systems And Electronic Development FZCO", + [3]byte{104, 23, 41}: "Intel Corporate", + [3]byte{104, 25, 63}: "Digital Airways", + [3]byte{104, 26, 178}: "zte corporation", + [3]byte{104, 28, 162}: "Rosewill Inc.", + [3]byte{104, 29, 100}: "Sunwave Communications Co., Ltd", + [3]byte{104, 30, 139}: "InfoSight Corporation", + [3]byte{104, 31, 216}: "Advanced Telemetry", + [3]byte{104, 35, 75}: "Nihon Dengyo Kousaku", + [3]byte{104, 40, 186}: "Dejai", + [3]byte{104, 45, 220}: "Wuhan Changjiang Electro-Communication Equipment CO.,LTD", + [3]byte{104, 54, 181}: "DriveScale, Inc.", + [3]byte{104, 59, 30}: "Countwise LTD", + [3]byte{104, 62, 236}: "ERECA", + [3]byte{104, 67, 82}: "Bhuu Limited", + [3]byte{104, 72, 152}: "Samsung Electronics Co.,Ltd", + [3]byte{104, 75, 136}: "Galtronics Telemetry Inc.", + [3]byte{104, 76, 168}: "Shenzhen Herotel Tech. Co., Ltd.", + [3]byte{104, 81, 183}: "PowerCloud Systems, Inc.", + [3]byte{104, 84, 237}: "Alcatel-Lucent - Nuage", + [3]byte{104, 84, 245}: "enLighted Inc", + [3]byte{104, 89, 127}: "Alcatel Lucent", + [3]byte{104, 91, 53}: "Apple", + [3]byte{104, 91, 54}: "POWERTECH INDUSTRIAL CO., LTD.", + [3]byte{104, 93, 67}: "Intel Corporate", + [3]byte{104, 94, 107}: "PowerRay Co., Ltd.", + [3]byte{104, 99, 89}: "Advanced Digital Broadcast SA", + [3]byte{104, 105, 46}: "Zycoo Co.,Ltd", + [3]byte{104, 105, 242}: "ComAp s.r.o.", + [3]byte{104, 110, 35}: "Wi3 Inc.", + [3]byte{104, 110, 72}: "Prophet Electronic Technology Corp.,Ltd", + [3]byte{104, 114, 81}: "Ubiquiti Networks", + [3]byte{104, 114, 220}: "CETORY.TV Company Limited", + [3]byte{104, 118, 79}: "Sony Mobile Communications AB", + [3]byte{104, 120, 72}: "Westunitis Co., Ltd.", + [3]byte{104, 120, 76}: "Nortel Networks", + [3]byte{104, 121, 36}: "ELS-GmbH & Co. KG", + [3]byte{104, 121, 237}: "SHARP Corporation", + [3]byte{104, 124, 200}: "Measurement Systems S. de R.L.", + [3]byte{104, 124, 213}: "Y Soft Corporation, a.s.", + [3]byte{104, 127, 116}: "Cisco-Linksys, LLC", + [3]byte{104, 131, 26}: "Pandora Mobility Corporation", + [3]byte{104, 132, 112}: "eSSys Co.,Ltd", + [3]byte{104, 133, 64}: "IGI Mobile, Inc.", + [3]byte{104, 133, 106}: "OuterLink Corporation", + [3]byte{104, 134, 167}: "Cisco", + [3]byte{104, 134, 231}: "Orbotix, Inc.", + [3]byte{104, 135, 107}: "INQ Mobile Limited", + [3]byte{104, 138, 181}: "EDP Servicos", + [3]byte{104, 146, 52}: "Ruckus Wireless", + [3]byte{104, 148, 35}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{104, 150, 123}: "Apple", + [3]byte{104, 151, 75}: "Shenzhen Costar Electronics Co. Ltd.", + [3]byte{104, 151, 232}: "Society of Motion Picture & Television Engineers", + [3]byte{104, 153, 205}: "Cisco", + [3]byte{104, 156, 94}: "AcSiP Technology Corp.", + [3]byte{104, 156, 112}: "Apple", + [3]byte{104, 160, 246}: "Huawei Technologies Co., Ltd", + [3]byte{104, 161, 183}: "Honghao Mingchuan Technology (Beijing) CO.,Ltd.", + [3]byte{104, 163, 196}: "Liteon Technology Corporation", + [3]byte{104, 164, 14}: "BSH Bosch and Siemens Home Appliances GmbH", + [3]byte{104, 168, 109}: "Apple", + [3]byte{104, 170, 210}: "DATECS LTD.,", + [3]byte{104, 171, 138}: "RF IDeas", + [3]byte{104, 174, 32}: "Apple", + [3]byte{104, 175, 19}: "Futura Mobility", + [3]byte{104, 176, 148}: "INESA ELECTRON CO.,LTD", + [3]byte{104, 180, 58}: "WaterFurnace International, Inc.", + [3]byte{104, 181, 153}: "Hewlett-Packard Company", + [3]byte{104, 182, 252}: "Hitron Technologies. Inc", + [3]byte{104, 184, 217}: "Act KDE, Inc.", + [3]byte{104, 188, 12}: "CISCO SYSTEMS, INC.", + [3]byte{104, 189, 171}: "CISCO SYSTEMS, INC.", + [3]byte{104, 201, 11}: "Texas Instruments", + [3]byte{104, 202, 0}: "Octopus Systems Limited", + [3]byte{104, 204, 156}: "Mine Site Technologies", + [3]byte{104, 205, 15}: "U Tek Company Limited", + [3]byte{104, 206, 78}: "L-3 Communications Infrared Products", + [3]byte{104, 209, 253}: "Shenzhen Trimax Technology Co.,Ltd", + [3]byte{104, 210, 71}: "Portalis LC", + [3]byte{104, 217, 37}: "ProSys Development Services", + [3]byte{104, 217, 60}: "Apple", + [3]byte{104, 219, 103}: "Nantong Coship Electronics Co., Ltd", + [3]byte{104, 219, 150}: "OPWILL Technologies CO .,LTD", + [3]byte{104, 220, 232}: "PacketStorm Communications", + [3]byte{104, 223, 221}: "Xiaomi inc.", + [3]byte{104, 225, 102}: "PRIVATE", + [3]byte{104, 228, 31}: "Unglaube Identech GmbH", + [3]byte{104, 235, 174}: "Samsung Electronics Co.,Ltd", + [3]byte{104, 235, 197}: "Angstrem Telecom", + [3]byte{104, 236, 98}: "YODO Technology Corp. Ltd.", + [3]byte{104, 237, 67}: "Research In Motion", + [3]byte{104, 238, 150}: "Cisco SPVTG", + [3]byte{104, 239, 189}: "CISCO SYSTEMS, INC.", + [3]byte{104, 240, 109}: "ALONG INDUSTRIAL CO., LIMITED", + [3]byte{104, 241, 37}: "Data Controls Inc.", + [3]byte{104, 247, 40}: "LCFC(HeFei) Electronics Technology co., ltd", + [3]byte{104, 248, 149}: "Redflow Limited", + [3]byte{104, 251, 149}: "Generalplus Technology Inc.", + [3]byte{104, 252, 179}: "Next Level Security Systems, Inc.", + [3]byte{108, 2, 115}: "Shenzhen Jin Yun Video Equipment Co., Ltd.", + [3]byte{108, 4, 96}: "RBH Access Technologies Inc.", + [3]byte{108, 9, 214}: "Digiquest Electronics LTD", + [3]byte{108, 11, 132}: "Universal Global Scientific Industrial Co.,Ltd.", + [3]byte{108, 14, 13}: "Sony Ericsson Mobile Communications AB", + [3]byte{108, 15, 106}: "JDC Tech Co., Ltd.", + [3]byte{108, 20, 247}: "Erhardt+Leimer GmbH", + [3]byte{108, 21, 249}: "Nautronix Limited", + [3]byte{108, 24, 17}: "Decatur Electronics", + [3]byte{108, 25, 143}: "D-Link International", + [3]byte{108, 32, 86}: "Cisco", + [3]byte{108, 34, 171}: "Ainsworth Game Technology", + [3]byte{108, 35, 185}: "Sony Ericsson Mobile Communications AB", + [3]byte{108, 37, 185}: "BBK Electronics Corp., Ltd.,", + [3]byte{108, 41, 149}: "Intel Corporate", + [3]byte{108, 44, 6}: "OOO NPP Systemotechnika-NN", + [3]byte{108, 46, 51}: "Accelink Technologies Co.,Ltd.", + [3]byte{108, 46, 133}: "SAGEMCOM", + [3]byte{108, 47, 44}: "Samsung Electronics Co.,Ltd", + [3]byte{108, 50, 222}: "Indieon Technologies Pvt. Ltd.", + [3]byte{108, 51, 169}: "Magicjack LP", + [3]byte{108, 57, 29}: "Beijing ZhongHuaHun Network Information center", + [3]byte{108, 58, 132}: "Shenzhen Aero-Startech. Co.Ltd", + [3]byte{108, 59, 229}: "Hewlett Packard", + [3]byte{108, 60, 83}: "SoundHawk Corp", + [3]byte{108, 62, 109}: "Apple", + [3]byte{108, 62, 156}: "KE Knestel Elektronik GmbH", + [3]byte{108, 64, 8}: "Apple", + [3]byte{108, 64, 198}: "Nimbus Data Systems, Inc.", + [3]byte{108, 65, 106}: "Cisco", + [3]byte{108, 75, 127}: "Vossloh-Schwabe Deutschland GmbH", + [3]byte{108, 80, 77}: "CISCO SYSTEMS, INC.", + [3]byte{108, 87, 121}: "Aclima, Inc.", + [3]byte{108, 90, 52}: "Shenzhen Haitianxiong Electronic Co., Ltd.", + [3]byte{108, 90, 181}: "TCL Technoly Electronics (Huizhou) Co., Ltd.", + [3]byte{108, 92, 222}: "SunReports, Inc.", + [3]byte{108, 93, 99}: "ShenZhen Rapoo Technology Co., Ltd.", + [3]byte{108, 94, 122}: "Ubiquitous Internet Telecom Co., Ltd", + [3]byte{108, 95, 28}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{108, 97, 38}: "Rinicom Holdings", + [3]byte{108, 98, 109}: "Micro-Star INT'L CO., LTD", + [3]byte{108, 100, 26}: "Penguin Computing", + [3]byte{108, 110, 254}: "Core Logic Inc.", + [3]byte{108, 111, 24}: "Stereotaxis, Inc.", + [3]byte{108, 112, 57}: "Novar GmbH", + [3]byte{108, 112, 159}: "Apple", + [3]byte{108, 113, 217}: "AzureWave Technologies, Inc", + [3]byte{108, 118, 96}: "KYOCERA Corporation", + [3]byte{108, 129, 254}: "Mitsuba Corporation", + [3]byte{108, 131, 54}: "Samsung Electronics Co.,Ltd", + [3]byte{108, 131, 102}: "Nanjing SAC Power Grid Automation Co., Ltd.", + [3]byte{108, 134, 134}: "Technonia", + [3]byte{108, 136, 20}: "Intel Corporate", + [3]byte{108, 139, 47}: "zte corporation", + [3]byte{108, 140, 219}: "Otus Technologies Ltd", + [3]byte{108, 141, 101}: "Wireless Glue Networks, Inc.", + [3]byte{108, 144, 177}: "SanLogic Inc", + [3]byte{108, 146, 191}: "Inspur Electronic Information Industry Co.,Ltd.", + [3]byte{108, 148, 248}: "Apple", + [3]byte{108, 152, 235}: "Ocedo GmbH", + [3]byte{108, 153, 137}: "Cisco", + [3]byte{108, 154, 201}: "Valentine Research, Inc.", + [3]byte{108, 155, 2}: "Nokia Corporation", + [3]byte{108, 156, 233}: "Nimble Storage", + [3]byte{108, 156, 237}: "CISCO SYSTEMS, INC.", + [3]byte{108, 166, 130}: "EDAM information & communications", + [3]byte{108, 167, 128}: "Nokia Corporation", + [3]byte{108, 169, 6}: "Telefield Ltd", + [3]byte{108, 169, 111}: "TransPacket AS", + [3]byte{108, 170, 179}: "Ruckus Wireless", + [3]byte{108, 171, 77}: "Digital Payment Technologies", + [3]byte{108, 172, 96}: "Venetex Corp", + [3]byte{108, 173, 63}: "Hubbell Building Automation, Inc.", + [3]byte{108, 173, 239}: "KZ Broadband Technologies, Ltd.", + [3]byte{108, 173, 248}: "Azurewave Technologies, Inc.", + [3]byte{108, 174, 139}: "IBM Corporation", + [3]byte{108, 176, 206}: "NETGEAR", + [3]byte{108, 179, 17}: "Shenzhen Lianrui Electronics Co.,Ltd", + [3]byte{108, 179, 80}: "Anhui comhigher tech co.,ltd", + [3]byte{108, 183, 244}: "Samsung Electronics Co.,Ltd", + [3]byte{108, 190, 233}: "Alcatel-Lucent-IPD", + [3]byte{108, 191, 181}: "Noon Technology Co., Ltd", + [3]byte{108, 193, 210}: "ARRIS Group, Inc.", + [3]byte{108, 194, 23}: "Hewlett Packard", + [3]byte{108, 194, 107}: "Apple", + [3]byte{108, 208, 50}: "LG Electronics", + [3]byte{108, 209, 70}: "Smartek d.o.o.", + [3]byte{108, 209, 176}: "WING SING ELECTRONICS HONG KONG LIMITED", + [3]byte{108, 214, 138}: "LG Electronics Inc", + [3]byte{108, 220, 106}: "Promethean Limited", + [3]byte{108, 224, 176}: "SOUND4", + [3]byte{108, 228, 206}: "Villiger Security Solutions AG", + [3]byte{108, 232, 115}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{108, 233, 7}: "Nokia Corporation", + [3]byte{108, 233, 131}: "Gastron Co., LTD.", + [3]byte{108, 236, 161}: "SHENZHEN CLOU ELECTRONICS CO. LTD.", + [3]byte{108, 236, 235}: "Texas Instruments", + [3]byte{108, 240, 73}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{108, 243, 115}: "Samsung Electronics Co.,Ltd", + [3]byte{108, 243, 127}: "Aruba Networks", + [3]byte{108, 249, 124}: "Nanoptix Inc.", + [3]byte{108, 250, 88}: "Avaya, Inc", + [3]byte{108, 250, 137}: "Cisco", + [3]byte{108, 250, 167}: "AMPAK Technology Inc.", + [3]byte{108, 253, 185}: "Proware Technologies Co Ltd.", + [3]byte{108, 255, 190}: "MPB Communications Inc.", + [3]byte{112, 2, 88}: "01DB-METRAVIB", + [3]byte{112, 5, 20}: "LG Electronics", + [3]byte{112, 11, 192}: "Dewav Technology Company", + [3]byte{112, 15, 199}: "SHENZHEN IKINLOOP TECHNOLOGY CO.,LTD.", + [3]byte{112, 15, 236}: "Poindus Systems Corp.", + [3]byte{112, 16, 92}: "Cisco", + [3]byte{112, 17, 36}: "Apple", + [3]byte{112, 20, 4}: "Limited Liability Company", + [3]byte{112, 24, 139}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{112, 26, 4}: "Liteon Tech Corp.", + [3]byte{112, 26, 237}: "ADVAS CO., LTD.", + [3]byte{112, 29, 127}: "Comtech Technology Co., Ltd.", + [3]byte{112, 35, 147}: "fos4X GmbH", + [3]byte{112, 37, 38}: "Alcatel-Lucent", + [3]byte{112, 37, 89}: "CyberTAN Technology, Inc.", + [3]byte{112, 43, 29}: "E-Domus International Limited", + [3]byte{112, 44, 31}: "Wisol", + [3]byte{112, 45, 209}: "Newings Communication CO., LTD.", + [3]byte{112, 47, 75}: "PolyVision Inc.", + [3]byte{112, 47, 151}: "Aava Mobile Oy", + [3]byte{112, 48, 24}: "Avaya, Inc", + [3]byte{112, 48, 93}: "Ubiquoss Inc", + [3]byte{112, 48, 94}: "Nanjing Zhongke Menglian Information Technology Co.,LTD", + [3]byte{112, 49, 135}: "ACX GmbH", + [3]byte{112, 50, 213}: "Athena Wireless Communications Inc", + [3]byte{112, 56, 17}: "Invensys Rail", + [3]byte{112, 56, 180}: "Low Tech Solutions", + [3]byte{112, 56, 238}: "Avaya, Inc", + [3]byte{112, 58, 216}: "Shenzhen Afoundry Electronic Co., Ltd", + [3]byte{112, 60, 57}: "SEAWING Kft", + [3]byte{112, 62, 172}: "Apple", + [3]byte{112, 65, 183}: "Edwards Lifesciences LLC", + [3]byte{112, 70, 66}: "CHYNG HONG ELECTRONIC CO., LTD.", + [3]byte{112, 74, 174}: "Xstream Flow (Pty) Ltd", + [3]byte{112, 74, 228}: "Rinstrum Pty Ltd", + [3]byte{112, 76, 237}: "TMRG, Inc.", + [3]byte{112, 78, 1}: "KWANGWON TECH CO., LTD.", + [3]byte{112, 82, 197}: "Avaya, Inc.", + [3]byte{112, 83, 63}: "Alfa Instrumentos Eletronicos Ltda.", + [3]byte{112, 84, 210}: "PEGATRON CORPORATION", + [3]byte{112, 84, 245}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{112, 86, 129}: "Apple", + [3]byte{112, 88, 18}: "Panasonic AVC Networks Company", + [3]byte{112, 89, 87}: "Medallion Instrumentation Systems", + [3]byte{112, 89, 134}: "OOO TTV", + [3]byte{112, 90, 182}: "COMPAL INFORMATION (KUNSHAN) CO., LTD.", + [3]byte{112, 91, 46}: "M2Communication Inc.", + [3]byte{112, 92, 173}: "Konami Gaming Inc", + [3]byte{112, 94, 170}: "Action Target, Inc.", + [3]byte{112, 96, 222}: "LaVision GmbH", + [3]byte{112, 97, 115}: "Calantec GmbH", + [3]byte{112, 98, 184}: "D-Link International", + [3]byte{112, 100, 23}: "ORBIS TECNOLOGIA ELECTRICA S.A.", + [3]byte{112, 101, 130}: "Suzhou Hanming Technologies Co., Ltd.", + [3]byte{112, 111, 129}: "PRIVATE", + [3]byte{112, 112, 76}: "Purple Communications, Inc", + [3]byte{112, 113, 179}: "Brain Corporation", + [3]byte{112, 113, 188}: "PEGATRON CORPORATION", + [3]byte{112, 114, 13}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{112, 114, 60}: "Huawei Technologies Co., Ltd", + [3]byte{112, 114, 207}: "EdgeCore Networks", + [3]byte{112, 115, 203}: "Apple", + [3]byte{112, 118, 48}: "Pace plc.", + [3]byte{112, 118, 221}: "Oxyguard International A/S", + [3]byte{112, 118, 240}: "LevelOne Communications (India) Private Limited", + [3]byte{112, 118, 255}: "KERLINK", + [3]byte{112, 123, 232}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{112, 124, 24}: "ADATA Technology Co., Ltd", + [3]byte{112, 126, 67}: "ARRIS Group, Inc.", + [3]byte{112, 126, 222}: "NASTEC LTD.", + [3]byte{112, 129, 5}: "CISCO SYSTEMS, INC.", + [3]byte{112, 130, 14}: "as electronics GmbH", + [3]byte{112, 130, 142}: "OleumTech Corporation", + [3]byte{112, 133, 198}: "Pace plc.", + [3]byte{112, 139, 120}: "citygrow technology co., ltd", + [3]byte{112, 141, 9}: "Nokia Corporation", + [3]byte{112, 147, 131}: "Intelligent Optical Network High Tech CO.,LTD.", + [3]byte{112, 147, 248}: "Space Monkey, Inc.", + [3]byte{112, 151, 86}: "Happyelectronics Co.,Ltd", + [3]byte{112, 154, 11}: "Italian Institute of Technology", + [3]byte{112, 155, 165}: "Shenzhen Y&D Electronics Co.,LTD.", + [3]byte{112, 155, 252}: "Bryton Inc.", + [3]byte{112, 158, 41}: "Sony Computer Entertainment Inc.", + [3]byte{112, 158, 134}: "X6D Limited", + [3]byte{112, 161, 145}: "Trendsetter Medical, LLC", + [3]byte{112, 164, 28}: "Advanced Wireless Dynamics S.L.", + [3]byte{112, 166, 106}: "Prox Dynamics AS", + [3]byte{112, 168, 227}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{112, 170, 178}: "Research In Motion", + [3]byte{112, 175, 37}: "Nishiyama Industry Co.,LTD.", + [3]byte{112, 176, 53}: "Shenzhen Zowee Technology Co., Ltd", + [3]byte{112, 176, 140}: "Shenou Communication Equipment Co.,Ltd", + [3]byte{112, 177, 78}: "Pace plc", + [3]byte{112, 178, 101}: "Hiltron s.r.l.", + [3]byte{112, 179, 213}: "IEEE REGISTRATION AUTHORITY - Please see OUI36 public listing for more information.", + [3]byte{112, 181, 153}: "Embedded Technologies s.r.o.", + [3]byte{112, 185, 33}: "FiberHome Telecommunication Technologies CO.,LTD", + [3]byte{112, 186, 239}: "Hangzhou H3C Technologies Co., Limited", + [3]byte{112, 198, 172}: "Bosch Automotive Aftermarket", + [3]byte{112, 202, 155}: "CISCO SYSTEMS, INC.", + [3]byte{112, 205, 96}: "Apple", + [3]byte{112, 212, 242}: "RIM", + [3]byte{112, 213, 126}: "Scalar Corporation", + [3]byte{112, 213, 231}: "Wellcore Corporation", + [3]byte{112, 214, 182}: "Metrum Technologies", + [3]byte{112, 216, 128}: "Upos System sp. z o.o.", + [3]byte{112, 221, 161}: "Tellabs", + [3]byte{112, 222, 226}: "Apple", + [3]byte{112, 224, 39}: "HONGYU COMMUNICATION TECHNOLOGY LIMITED", + [3]byte{112, 225, 57}: "3view Ltd", + [3]byte{112, 226, 76}: "SAE IT-systems GmbH & Co. KG", + [3]byte{112, 226, 132}: "Wistron InfoComm(Zhongshan) Corporation", + [3]byte{112, 232, 67}: "Beijing C&W Optical Communication Technology Co.,Ltd.", + [3]byte{112, 238, 80}: "Netatmo", + [3]byte{112, 241, 118}: "Data Modul AG", + [3]byte{112, 241, 150}: "Actiontec Electronics, Inc", + [3]byte{112, 241, 161}: "Liteon Technology Corporation", + [3]byte{112, 241, 229}: "Xetawave LLC", + [3]byte{112, 243, 149}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{112, 249, 39}: "Samsung Electronics", + [3]byte{112, 249, 109}: "Hangzhou H3C Technologies Co., Limited", + [3]byte{112, 252, 140}: "OneAccess SA", + [3]byte{112, 255, 92}: "Cheerzing Communication(Xiamen)Technology Co.,Ltd", + [3]byte{112, 255, 118}: "Texas Instruments", + [3]byte{116, 10, 188}: "JSJS Designs (Europe) Limited", + [3]byte{116, 14, 219}: "Optowiz Co., Ltd", + [3]byte{116, 20, 137}: "SRT Wireless", + [3]byte{116, 21, 226}: "Tri-Sen Systems Corporation", + [3]byte{116, 25, 248}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{116, 30, 147}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{116, 37, 138}: "Hangzhou H3C Technologies Co., Limited", + [3]byte{116, 38, 172}: "Cisco", + [3]byte{116, 39, 60}: "ChangYang Technology (Nanjing) Co., LTD", + [3]byte{116, 39, 234}: "Elitegroup Computer Systems Co., Ltd.", + [3]byte{116, 41, 175}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{116, 43, 15}: "Infinidat Ltd.", + [3]byte{116, 43, 98}: "Fujitsu Limited", + [3]byte{116, 45, 10}: "Norfolk Elektronik AG", + [3]byte{116, 47, 104}: "Azurewave Technologies, Inc.", + [3]byte{116, 49, 112}: "Arcadyan Technology Corporation", + [3]byte{116, 50, 86}: "NT-ware Systemprg GmbH", + [3]byte{116, 55, 47}: "Tongfang Shenzhen Cloudcomputing Technology Co.,Ltd", + [3]byte{116, 56, 137}: "ANNAX Anzeigesysteme GmbH", + [3]byte{116, 62, 203}: "Gentrice tech", + [3]byte{116, 68, 1}: "NETGEAR", + [3]byte{116, 69, 138}: "Samsung Electronics Co.,Ltd", + [3]byte{116, 70, 160}: "Hewlett Packard", + [3]byte{116, 75, 233}: "EXPLORER HYPERTECH CO.,LTD", + [3]byte{116, 77, 121}: "Arrive Systems Inc.", + [3]byte{116, 83, 39}: "COMMSEN CO., LIMITED", + [3]byte{116, 84, 125}: "Cisco SPVTG", + [3]byte{116, 86, 18}: "ARRIS Group, Inc.", + [3]byte{116, 87, 152}: "TRUMPF Laser GmbH + Co. KG", + [3]byte{116, 92, 159}: "TCT mobile ltd.", + [3]byte{116, 94, 28}: "PIONEER CORPORATION", + [3]byte{116, 95, 0}: "Samsung Semiconductor Inc.", + [3]byte{116, 95, 174}: "TSL PPL", + [3]byte{116, 99, 223}: "VTS GmbH", + [3]byte{116, 101, 209}: "Atlinks", + [3]byte{116, 102, 48}: "T:mi Ytti", + [3]byte{116, 106, 137}: "Rezolt Corporation", + [3]byte{116, 106, 143}: "VS Vision Systems GmbH", + [3]byte{116, 107, 130}: "MOVEK", + [3]byte{116, 111, 61}: "Contec GmbH", + [3]byte{116, 114, 242}: "Chipsip Technology Co., Ltd.", + [3]byte{116, 117, 72}: "Amazon Technologies Inc.", + [3]byte{116, 120, 24}: "ServiceAssure", + [3]byte{116, 123, 122}: "ETH Inc.", + [3]byte{116, 125, 182}: "Aliwei Communications, Inc", + [3]byte{116, 126, 26}: "Red Embedded Design Limited", + [3]byte{116, 126, 45}: "Beijing Thomson CITIC Digital Technology Co. LTD.", + [3]byte{116, 134, 122}: "Dell Inc", + [3]byte{116, 136, 42}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{116, 136, 139}: "ADB Broadband Italia", + [3]byte{116, 142, 8}: "Bestek Corp.", + [3]byte{116, 142, 248}: "Brocade Communications Systems, Inc.", + [3]byte{116, 143, 27}: "MasterImage 3D", + [3]byte{116, 143, 77}: "MEN Mikro Elektronik GmbH", + [3]byte{116, 144, 80}: "Renesas Electronics Corporation", + [3]byte{116, 145, 26}: "Ruckus Wireless", + [3]byte{116, 147, 164}: "Zebra Technologies Corp.", + [3]byte{116, 148, 61}: "AgJunction", + [3]byte{116, 153, 117}: "IBM Corporation", + [3]byte{116, 156, 82}: "Huizhou Desay SV Automotive Co., Ltd.", + [3]byte{116, 157, 220}: "2Wire", + [3]byte{116, 164, 167}: "QRS Music Technologies, Inc.", + [3]byte{116, 164, 181}: "Powerleader Science and Technology Co. Ltd.", + [3]byte{116, 167, 34}: "LG Electronics", + [3]byte{116, 173, 183}: "China Mobile Group Device Co.,Ltd.", + [3]byte{116, 174, 118}: "iNovo Broadband, Inc.", + [3]byte{116, 176, 12}: "Network Video Technologies, Inc", + [3]byte{116, 185, 235}: "Fujian JinQianMao Electronic Technology Co.,Ltd", + [3]byte{116, 186, 219}: "Longconn Electornics(shenzhen)Co.,Ltd", + [3]byte{116, 190, 8}: "ATEK Products, LLC", + [3]byte{116, 191, 161}: "HYUNTECK", + [3]byte{116, 198, 33}: "Zhejiang Hite Renewable Energy Co.,LTD", + [3]byte{116, 201, 154}: "Ericsson AB", + [3]byte{116, 202, 37}: "Calxeda, Inc.", + [3]byte{116, 205, 12}: "Smith Myers Communications Ltd.", + [3]byte{116, 206, 86}: "Packet Force Technology Limited Company", + [3]byte{116, 208, 43}: "ASUSTek COMPUTER INC.", + [3]byte{116, 208, 220}: "ERICSSON AB", + [3]byte{116, 212, 53}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{116, 214, 117}: "WYMA Tecnologia", + [3]byte{116, 216, 80}: "Evrisko Systems", + [3]byte{116, 218, 56}: "Edimax Technology Co. Ltd.", + [3]byte{116, 219, 209}: "Ebay Inc", + [3]byte{116, 222, 43}: "Liteon Technology Corporation", + [3]byte{116, 224, 110}: "Ergophone GmbH", + [3]byte{116, 225, 74}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{116, 225, 182}: "Apple", + [3]byte{116, 226, 245}: "Apple", + [3]byte{116, 228, 36}: "APISTE CORPORATION", + [3]byte{116, 229, 11}: "Intel Corporate", + [3]byte{116, 229, 55}: "RADSPIN", + [3]byte{116, 229, 67}: "Liteon Technology Corporation", + [3]byte{116, 230, 226}: "Dell Inc.", + [3]byte{116, 231, 198}: "ARRIS Group, Inc.", + [3]byte{116, 234, 58}: "TP-LINK Technologies Co.,Ltd.", + [3]byte{116, 236, 241}: "Acumen", + [3]byte{116, 240, 109}: "AzureWave Technologies, Inc.", + [3]byte{116, 240, 125}: "BnCOM Co.,Ltd", + [3]byte{116, 241, 2}: "Beijing HCHCOM Technology Co., Ltd", + [3]byte{116, 244, 19}: "Maxwell Forest", + [3]byte{116, 246, 18}: "ARRIS Group, Inc.", + [3]byte{116, 247, 38}: "Neuron Robotics", + [3]byte{116, 248, 93}: "Berkeley Nucleonics Corp", + [3]byte{116, 253, 160}: "Compupal (Group) Corporation", + [3]byte{116, 254, 72}: "ADVANTECH CO., LTD.", + [3]byte{116, 255, 125}: "Wren Sound Systems, LLC", + [3]byte{120, 2, 143}: "Adaptive Spectrum and Signal Alignment (ASSIA), Inc.", + [3]byte{120, 7, 56}: "Z.U.K. Elzab S.A.", + [3]byte{120, 17, 133}: "NBS Payment Solutions Inc.", + [3]byte{120, 18, 184}: "ORANTEK LIMITED", + [3]byte{120, 24, 129}: "AzureWave Technologies, Inc.", + [3]byte{120, 25, 46}: "NASCENT Technology", + [3]byte{120, 25, 247}: "Juniper Networks", + [3]byte{120, 28, 90}: "SHARP Corporation", + [3]byte{120, 29, 186}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{120, 29, 253}: "Jabil Inc", + [3]byte{120, 31, 219}: "Samsung Electronics Co.,Ltd", + [3]byte{120, 34, 61}: "Affirmed Networks", + [3]byte{120, 36, 175}: "ASUSTek COMPUTER INC.", + [3]byte{120, 37, 68}: "Omnima Limited", + [3]byte{120, 37, 173}: "SAMSUNG ELECTRONICS CO., LTD.", + [3]byte{120, 43, 203}: "Dell Inc", + [3]byte{120, 46, 239}: "Nokia Corporation", + [3]byte{120, 48, 59}: "Stephen Technologies Co.,Limited", + [3]byte{120, 48, 225}: "UltraClenz, LLC", + [3]byte{120, 49, 43}: "zte corporation", + [3]byte{120, 49, 193}: "Apple", + [3]byte{120, 50, 79}: "Millennium Group, Inc.", + [3]byte{120, 58, 132}: "Apple", + [3]byte{120, 60, 227}: "Kai-EE", + [3]byte{120, 61, 91}: "TELNET Redes Inteligentes S.A.", + [3]byte{120, 62, 83}: "BSkyB Ltd", + [3]byte{120, 63, 21}: "EasySYNC Ltd.", + [3]byte{120, 68, 5}: "FUJITU(HONG KONG) ELECTRONIC Co.,LTD.", + [3]byte{120, 68, 118}: "Zioncom technology co.,ltd", + [3]byte{120, 69, 97}: "CyberTAN Technology Inc.", + [3]byte{120, 69, 196}: "Dell Inc", + [3]byte{120, 70, 196}: "DAEHAP HYPER-TECH", + [3]byte{120, 71, 29}: "Samsung Electronics Co.,Ltd", + [3]byte{120, 72, 89}: "Hewlett Packard", + [3]byte{120, 73, 29}: "The Will-Burt Company", + [3]byte{120, 75, 8}: "f.robotics acquisitions ltd", + [3]byte{120, 75, 135}: "Murata Manufacturing Co.,Ltd.", + [3]byte{120, 81, 12}: "LiveU Ltd.", + [3]byte{120, 82, 26}: "Samsung Electronics Co.,Ltd", + [3]byte{120, 82, 98}: "Shenzhen Hojy Software Co., Ltd.", + [3]byte{120, 84, 46}: "D-Link International", + [3]byte{120, 85, 23}: "SankyuElectronics", + [3]byte{120, 87, 18}: "Mobile Integration Workgroup", + [3]byte{120, 89, 62}: "RAFI GmbH & Co.KG", + [3]byte{120, 89, 94}: "Samsung Electronics Co.,Ltd", + [3]byte{120, 89, 104}: "Hon Hai Precision Ind.Co.,Ltd.", + [3]byte{120, 92, 114}: "Hioso Technology Co., Ltd.", + [3]byte{120, 97, 124}: "MITSUMI ELECTRIC CO.,LTD", + [3]byte{120, 102, 174}: "ZTEC Instruments, Inc.", + [3]byte{120, 106, 137}: "Huawei Technologies Co., Ltd", + [3]byte{120, 108, 28}: "Apple", + [3]byte{120, 127, 98}: "GiK mbH", + [3]byte{120, 129, 143}: "Server Racks Australia Pty Ltd", + [3]byte{120, 132, 60}: "Sony Corporation", + [3]byte{120, 132, 238}: "INDRA ESPACIO S.A.", + [3]byte{120, 137, 115}: "CMC", + [3]byte{120, 140, 84}: "Eltek Technologies LTD", + [3]byte{120, 141, 247}: "Hitron Technologies. Inc", + [3]byte{120, 146, 62}: "Nokia Corporation", + [3]byte{120, 146, 156}: "Intel Corporate", + [3]byte{120, 150, 132}: "ARRIS Group, Inc.", + [3]byte{120, 152, 253}: "Q9 Networks Inc.", + [3]byte{120, 153, 92}: "Nationz Technologies Inc", + [3]byte{120, 153, 102}: "Musilab Electronics (DongGuan)Co.,Ltd.", + [3]byte{120, 153, 143}: "MEDILINE ITALIA SRL", + [3]byte{120, 156, 231}: "Shenzhen Aikede Technology Co., Ltd", + [3]byte{120, 158, 208}: "Samsung Electronics", + [3]byte{120, 159, 76}: "HOERBIGER Elektronik GmbH", + [3]byte{120, 159, 135}: "Siemens AG I IA PP PRM", + [3]byte{120, 160, 81}: "iiNet Labs Pty Ltd", + [3]byte{120, 161, 6}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{120, 161, 131}: "Advidia", + [3]byte{120, 162, 160}: "Nintendo Co., Ltd.", + [3]byte{120, 163, 228}: "Apple", + [3]byte{120, 165, 4}: "Texas Instruments", + [3]byte{120, 165, 221}: "Shenzhen Smarteye Digital Electronics Co., Ltd", + [3]byte{120, 166, 131}: "Precidata", + [3]byte{120, 166, 189}: "DAEYEON Control&Instrument Co,.Ltd", + [3]byte{120, 167, 20}: "Amphenol", + [3]byte{120, 168, 115}: "Samsung Electronics Co.,Ltd", + [3]byte{120, 171, 96}: "ABB Australia", + [3]byte{120, 171, 187}: "Samsung Electronics Co.,LTD", + [3]byte{120, 172, 192}: "Hewlett-Packard Company", + [3]byte{120, 174, 12}: "Far South Networks", + [3]byte{120, 179, 185}: "ShangHai sunup lighting CO.,LTD", + [3]byte{120, 179, 206}: "Elo touch solutions", + [3]byte{120, 181, 210}: "Ever Treasure Industrial Limited", + [3]byte{120, 182, 193}: "AOBO Telecom Co.,Ltd", + [3]byte{120, 184, 26}: "INTER SALES A/S", + [3]byte{120, 186, 208}: "Shinybow Technology Co. Ltd.", + [3]byte{120, 190, 182}: "Enhanced Vision", + [3]byte{120, 190, 189}: "STULZ GmbH", + [3]byte{120, 196, 14}: "H&D Wireless", + [3]byte{120, 196, 171}: "Shenzhen Runsil Technology Co.,Ltd", + [3]byte{120, 197, 229}: "Texas Instruments", + [3]byte{120, 198, 187}: "Innovasic, Inc.", + [3]byte{120, 202, 4}: "Nokia Corporation", + [3]byte{120, 202, 57}: "Apple", + [3]byte{120, 202, 94}: "ELNO", + [3]byte{120, 203, 51}: "DHC Software Co.,Ltd", + [3]byte{120, 205, 142}: "SMC Networks Inc", + [3]byte{120, 208, 4}: "Neousys Technology Inc.", + [3]byte{120, 209, 41}: "Vicos", + [3]byte{120, 211, 79}: "Pace-O-Matic, Inc.", + [3]byte{120, 211, 141}: "HONGKONG YUNLINK TECHNOLOGY LIMITED", + [3]byte{120, 213, 181}: "NAVIELEKTRO KY", + [3]byte{120, 214, 111}: "Aristocrat Technologies Australia Pty. Ltd.", + [3]byte{120, 214, 240}: "Samsung Electro Mechanics", + [3]byte{120, 215, 82}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{120, 217, 159}: "NuCom HK Ltd.", + [3]byte{120, 218, 110}: "Cisco", + [3]byte{120, 218, 179}: "GBO Technology", + [3]byte{120, 221, 8}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{120, 221, 214}: "c-scape", + [3]byte{120, 222, 228}: "Texas Instruments", + [3]byte{120, 227, 181}: "Hewlett-Packard Company", + [3]byte{120, 228, 0}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{120, 231, 209}: "Hewlett-Packard Company", + [3]byte{120, 232, 182}: "zte corporation", + [3]byte{120, 235, 20}: "SHENZHEN FAST TECHNOLOGIES CO.,LTD", + [3]byte{120, 236, 34}: "Shanghai Qihui Telecom Technology Co., LTD", + [3]byte{120, 236, 116}: "Kyland-USA", + [3]byte{120, 239, 76}: "Unetconvergence Co., Ltd.", + [3]byte{120, 245, 229}: "BEGA Gantenbrink-Leuchten KG", + [3]byte{120, 245, 253}: "Huawei Technologies Co., Ltd", + [3]byte{120, 247, 190}: "Samsung Electronics Co.,Ltd", + [3]byte{120, 247, 208}: "Silverbrook Research", + [3]byte{120, 253, 148}: "Apple", + [3]byte{120, 254, 61}: "Juniper Networks", + [3]byte{120, 254, 65}: "Socus networks", + [3]byte{120, 254, 226}: "Shanghai Diveo Technology Co., Ltd", + [3]byte{120, 255, 87}: "Intel Corporate", + [3]byte{124, 1, 135}: "Curtis Instruments, Inc.", + [3]byte{124, 2, 188}: "Hansung Electronics Co. LTD", + [3]byte{124, 3, 76}: "SAGEMCOM", + [3]byte{124, 3, 216}: "SAGEMCOM SAS", + [3]byte{124, 5, 7}: "PEGATRON CORPORATION", + [3]byte{124, 5, 30}: "RAFAEL LTD.", + [3]byte{124, 6, 35}: "Ultra Electronics, CIS", + [3]byte{124, 8, 217}: "Shanghai B-Star Technology Co", + [3]byte{124, 9, 43}: "Bekey A/S", + [3]byte{124, 10, 80}: "J-MEX Inc.", + [3]byte{124, 14, 206}: "Cisco", + [3]byte{124, 17, 190}: "Apple", + [3]byte{124, 20, 118}: "Damall Technologies SAS", + [3]byte{124, 22, 13}: "Saia-Burgess Controls AG", + [3]byte{124, 26, 3}: "8Locations Co., Ltd.", + [3]byte{124, 26, 252}: "Dalian Co-Edifice Video Technology Co., Ltd", + [3]byte{124, 30, 82}: "Microsoft", + [3]byte{124, 30, 179}: "2N TELEKOMUNIKACE a.s.", + [3]byte{124, 32, 72}: "KoamTac", + [3]byte{124, 32, 100}: "Alcatel Lucent IPD", + [3]byte{124, 37, 135}: "chaowifi.com", + [3]byte{124, 44, 243}: "Secure Electrans Ltd", + [3]byte{124, 46, 13}: "Blackmagic Design", + [3]byte{124, 47, 128}: "Gigaset Communications GmbH", + [3]byte{124, 51, 110}: "MEG Electronics Inc.", + [3]byte{124, 56, 108}: "Real Time Logic", + [3]byte{124, 57, 32}: "SSOMA SECURITY", + [3]byte{124, 59, 213}: "Imago Group", + [3]byte{124, 62, 157}: "PATECH", + [3]byte{124, 67, 143}: "E-Band Communications Corp.", + [3]byte{124, 68, 76}: "Entertainment Solutions, S.L.", + [3]byte{124, 73, 185}: "Plexus Manufacturing Sdn Bhd", + [3]byte{124, 74, 130}: "Portsmith LLC", + [3]byte{124, 74, 168}: "MindTree Wireless PVT Ltd", + [3]byte{124, 75, 120}: "Red Sun Synthesis Pte Ltd", + [3]byte{124, 76, 88}: "Scale Computing, Inc.", + [3]byte{124, 76, 165}: "BSkyB Ltd", + [3]byte{124, 79, 181}: "Arcadyan Technology Corporation", + [3]byte{124, 85, 231}: "YSI, Inc.", + [3]byte{124, 96, 151}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{124, 97, 147}: "HTC Corporation", + [3]byte{124, 102, 157}: "Texas Instruments", + [3]byte{124, 105, 246}: "Cisco", + [3]byte{124, 106, 179}: "IBC TECHNOLOGIES INC.", + [3]byte{124, 106, 195}: "GatesAir, Inc", + [3]byte{124, 106, 219}: "SafeTone Technology Co.,Ltd", + [3]byte{124, 107, 51}: "Tenyu Tech Co. Ltd.", + [3]byte{124, 107, 82}: "Tigaro Wireless", + [3]byte{124, 108, 57}: "PIXSYS SRL", + [3]byte{124, 108, 143}: "AMS NEVE LTD", + [3]byte{124, 109, 98}: "Apple", + [3]byte{124, 109, 248}: "Apple", + [3]byte{124, 111, 6}: "Caterpillar Trimble Control Technologies", + [3]byte{124, 111, 248}: "ShenZhen ACTO Digital Video Technology Co.,Ltd.", + [3]byte{124, 112, 188}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{124, 114, 228}: "Unikey Technologies", + [3]byte{124, 118, 115}: "ENMAS GmbH", + [3]byte{124, 122, 145}: "Intel Corporate", + [3]byte{124, 123, 228}: "Z'SEDAI KENKYUSHO CORPORATION", + [3]byte{124, 125, 65}: "Jinmuyu Electronics Co., Ltd.", + [3]byte{124, 130, 45}: "Nortec", + [3]byte{124, 131, 6}: "Glen Dimplex Nordic as", + [3]byte{124, 141, 145}: "Shanghai Hongzhuo Information Technology co.,LTD", + [3]byte{124, 142, 228}: "Texas Instruments", + [3]byte{124, 148, 178}: "Philips Healthcare PCCI", + [3]byte{124, 149, 243}: "Cisco", + [3]byte{124, 151, 99}: "Openmatics s.r.o.", + [3]byte{124, 154, 155}: "VSE valencia smart energy", + [3]byte{124, 161, 93}: "GN ReSound A/S", + [3]byte{124, 162, 155}: "D.SignT GmbH & Co. KG", + [3]byte{124, 166, 29}: "MHL, LLC", + [3]byte{124, 172, 178}: "Bosch Software Innovations GmbH", + [3]byte{124, 173, 116}: "Cisco", + [3]byte{124, 176, 62}: "OSRAM GmbH", + [3]byte{124, 177, 119}: "Satelco AG", + [3]byte{124, 178, 27}: "Cisco SPVTG", + [3]byte{124, 178, 50}: "TCL King High Frequency EI,Co.,LTD", + [3]byte{124, 181, 66}: "ACES Technology", + [3]byte{124, 183, 51}: "ASKEY COMPUTER CORP", + [3]byte{124, 183, 123}: "Paradigm Electronics Inc", + [3]byte{124, 187, 111}: "Cosco Electronics Co., Ltd.", + [3]byte{124, 189, 6}: "AE REFUsol", + [3]byte{124, 191, 136}: "Mobilicom LTD", + [3]byte{124, 191, 177}: "ARRIS Group, Inc.", + [3]byte{124, 195, 161}: "Apple", + [3]byte{124, 196, 239}: "Devialet", + [3]byte{124, 197, 55}: "Apple", + [3]byte{124, 200, 171}: "Acro Associates, Inc.", + [3]byte{124, 200, 208}: "TIANJIN YAAN TECHNOLOGY CO., LTD.", + [3]byte{124, 200, 215}: "Damalisk", + [3]byte{124, 203, 13}: "Antaira Technologies, LLC", + [3]byte{124, 204, 184}: "Intel Corporate", + [3]byte{124, 205, 17}: "MS-Magnet", + [3]byte{124, 205, 60}: "Guangzhou Juzing Technology Co., Ltd", + [3]byte{124, 207, 207}: "Shanghai SEARI Intelligent System Co., Ltd", + [3]byte{124, 209, 195}: "Apple", + [3]byte{124, 211, 10}: "INVENTEC Corporation", + [3]byte{124, 215, 98}: "Freestyle Technology Pty Ltd", + [3]byte{124, 216, 68}: "Enmotus Inc", + [3]byte{124, 217, 254}: "New Cosmos Electric Co., Ltd.", + [3]byte{124, 218, 132}: "Dongnian Networks Inc.", + [3]byte{124, 221, 17}: "Chongqing MAS SCI&TECH.Co.,Ltd", + [3]byte{124, 221, 32}: "IOXOS Technologies S.A.", + [3]byte{124, 221, 144}: "Shenzhen Ogemray Technology Co., Ltd.", + [3]byte{124, 224, 68}: "NEON Inc", + [3]byte{124, 225, 255}: "Computer Performance, Inc. DBA Digital Loggers, Inc.", + [3]byte{124, 228, 170}: "PRIVATE", + [3]byte{124, 229, 36}: "Quirky, Inc.", + [3]byte{124, 229, 107}: "ESEN Optoelectronics Technology Co.,Ltd.", + [3]byte{124, 233, 211}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{124, 235, 234}: "ASCT", + [3]byte{124, 237, 141}: "MICROSOFT", + [3]byte{124, 239, 24}: "Creative Product Design Pty. Ltd.", + [3]byte{124, 239, 138}: "Inhon International Ltd.", + [3]byte{124, 240, 95}: "Apple", + [3]byte{124, 240, 152}: "Bee Beans Technologies, Inc.", + [3]byte{124, 240, 186}: "Linkwell Telesystems Pvt Ltd", + [3]byte{124, 244, 41}: "NUUO Inc.", + [3]byte{124, 250, 223}: "Apple", + [3]byte{124, 254, 40}: "Salutron Inc.", + [3]byte{124, 254, 78}: "Shenzhen Safe vision Technology Co.,LTD", + [3]byte{124, 255, 98}: "Huizhou Super Electron Technology Co.,Ltd.", + [3]byte{128, 0, 11}: "Intel Corporate", + [3]byte{128, 0, 16}: "ATT BELL LABORATORIES", + [3]byte{128, 0, 110}: "Apple", + [3]byte{128, 5, 223}: "Montage Technology Group Limited", + [3]byte{128, 7, 162}: "Esson Technology Inc.", + [3]byte{128, 9, 2}: "Keysight Technologies, Inc.", + [3]byte{128, 10, 6}: "COMTEC co.,ltd", + [3]byte{128, 14, 36}: "ForgetBox", + [3]byte{128, 20, 64}: "Sunlit System Technology Corp", + [3]byte{128, 20, 168}: "Guangzhou V-SOLUTION Electronic Technology Co., Ltd.", + [3]byte{128, 22, 183}: "Brunel University", + [3]byte{128, 23, 125}: "Nortel Networks", + [3]byte{128, 24, 167}: "Samsung Eletronics Co., Ltd", + [3]byte{128, 25, 52}: "Intel Corporate", + [3]byte{128, 25, 103}: "Shanghai Reallytek Information Technology Co.,Ltd", + [3]byte{128, 29, 170}: "Avaya Inc", + [3]byte{128, 31, 2}: "Edimax Technology Co. Ltd.", + [3]byte{128, 32, 175}: "Trade FIDES, a.s.", + [3]byte{128, 34, 117}: "Beijing Beny Wave Technology Co Ltd", + [3]byte{128, 42, 250}: "Germaneers GmbH", + [3]byte{128, 45, 225}: "Solarbridge Technologies", + [3]byte{128, 46, 20}: "azeti Networks AG", + [3]byte{128, 47, 222}: "Zurich Instruments AG", + [3]byte{128, 52, 87}: "OT Systems Limited", + [3]byte{128, 55, 115}: "Netgear Inc", + [3]byte{128, 56, 253}: "LeapFrog Enterprises, Inc.", + [3]byte{128, 57, 229}: "PATLITE CORPORATION", + [3]byte{128, 59, 154}: "ghe-ces electronic ag", + [3]byte{128, 63, 93}: "Winstars Technology Ltd", + [3]byte{128, 63, 214}: "bytes at work AG", + [3]byte{128, 65, 78}: "BBK Electronics Corp., Ltd.,", + [3]byte{128, 66, 124}: "Adolf Tedsen GmbH & Co. KG", + [3]byte{128, 71, 49}: "Packet Design, Inc.", + [3]byte{128, 72, 165}: "SICHUAN TIANYI COMHEART TELECOM CO.,LTD", + [3]byte{128, 73, 113}: "Apple", + [3]byte{128, 75, 32}: "Ventilation Control", + [3]byte{128, 79, 88}: "ThinkEco, Inc.", + [3]byte{128, 80, 27}: "Nokia Corporation", + [3]byte{128, 86, 242}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{128, 87, 25}: "Samsung Electronics Co.,Ltd", + [3]byte{128, 88, 197}: "NovaTec Kommunikationstechnik GmbH", + [3]byte{128, 89, 253}: "Noviga", + [3]byte{128, 96, 7}: "RIM", + [3]byte{128, 97, 143}: "Shenzhen sangfei consumer communications co.,ltd", + [3]byte{128, 100, 89}: "Nimbus Inc.", + [3]byte{128, 101, 233}: "BenQ Corporation", + [3]byte{128, 102, 41}: "Prescope Technologies CO.,LTD.", + [3]byte{128, 108, 27}: "Motorola Mobility LLC", + [3]byte{128, 108, 139}: "KAESER KOMPRESSOREN AG", + [3]byte{128, 108, 188}: "NET New Electronic Technology GmbH", + [3]byte{128, 113, 31}: "Juniper Networks", + [3]byte{128, 113, 122}: "Huawei Technologies Co., Ltd", + [3]byte{128, 118, 147}: "Newag SA", + [3]byte{128, 121, 174}: "ShanDong Tecsunrise Co.,Ltd", + [3]byte{128, 122, 127}: "ABB Genway Xiamen Electrical Equipment CO., LTD", + [3]byte{128, 123, 30}: "Corsair Components", + [3]byte{128, 125, 27}: "Neosystem Co. Ltd.", + [3]byte{128, 125, 227}: "Chongqing Sichuan Instrument Microcircuit Co.LTD.", + [3]byte{128, 129, 165}: "TONGQING COMMUNICATION EQUIPMENT (SHENZHEN) Co.,Ltd", + [3]byte{128, 130, 135}: "ATCOM Technology Co.Ltd.", + [3]byte{128, 134, 152}: "Netronics Technologies Inc.", + [3]byte{128, 134, 242}: "Intel Corporate", + [3]byte{128, 139, 92}: "Shenzhen Runhuicheng Technology Co., Ltd", + [3]byte{128, 145, 42}: "Lih Rong electronic Enterprise Co., Ltd.", + [3]byte{128, 145, 192}: "AgileMesh, Inc.", + [3]byte{128, 146, 159}: "Apple", + [3]byte{128, 147, 147}: "Xapt GmbH", + [3]byte{128, 148, 108}: "TOKYO RADAR CORPORATION", + [3]byte{128, 150, 177}: "ARRIS Group, Inc.", + [3]byte{128, 150, 202}: "Hon Hai Precision Ind Co.,Ltd", + [3]byte{128, 151, 27}: "Altenergy Power System,Inc.", + [3]byte{128, 155, 32}: "Intel Corporate", + [3]byte{128, 161, 215}: "Shanghai DareGlobal Technologies Co.,Ltd", + [3]byte{128, 170, 164}: "USAG", + [3]byte{128, 173, 103}: "Kasda Digital Technology Co.,Ltd", + [3]byte{128, 178, 25}: "ELEKTRON TECHNOLOGY UK LIMITED", + [3]byte{128, 178, 137}: "Forworld Electronics Ltd.", + [3]byte{128, 179, 42}: "Alstom Grid", + [3]byte{128, 182, 134}: "Huawei Technologies Co., Ltd", + [3]byte{128, 185, 92}: "ELFTECH Co., Ltd.", + [3]byte{128, 186, 172}: "TeleAdapt Ltd", + [3]byte{128, 186, 230}: "Neets", + [3]byte{128, 187, 235}: "Satmap Systems Ltd", + [3]byte{128, 190, 5}: "Apple", + [3]byte{128, 193, 110}: "Hewlett Packard", + [3]byte{128, 198, 63}: "Remec Broadband Wireless , LLC", + [3]byte{128, 198, 171}: "Technicolor USA Inc.", + [3]byte{128, 198, 202}: "Endian s.r.l.", + [3]byte{128, 200, 98}: "Openpeak, Inc", + [3]byte{128, 206, 177}: "Theissen Training Systems GmbH", + [3]byte{128, 207, 65}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{128, 208, 25}: "Embed, Inc", + [3]byte{128, 209, 139}: "Hangzhou I'converge Technology Co.,Ltd", + [3]byte{128, 210, 29}: "AzureWave Technologies, Inc", + [3]byte{128, 212, 51}: "LzLabs GmbH", + [3]byte{128, 215, 51}: "QSR Automations, Inc.", + [3]byte{128, 219, 49}: "Power Quotient International Co., Ltd.", + [3]byte{128, 230, 80}: "Apple", + [3]byte{128, 234, 150}: "Apple", + [3]byte{128, 234, 202}: "Dialog Semiconductor Hellas SA", + [3]byte{128, 238, 115}: "Shuttle Inc.", + [3]byte{128, 242, 94}: "Kyynel", + [3]byte{128, 245, 147}: "IRCO Sistemas de Telecomunicación S.A.", + [3]byte{128, 246, 46}: "Hangzhou H3C Technologies Co., Limited", + [3]byte{128, 248, 235}: "RayTight", + [3]byte{128, 250, 91}: "CLEVO CO.", + [3]byte{128, 251, 6}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{128, 255, 168}: "UNIDIS", + [3]byte{132, 0, 210}: "Sony Ericsson Mobile Communications AB", + [3]byte{132, 1, 167}: "Greyware Automation Products, Inc", + [3]byte{132, 11, 45}: "SAMSUNG ELECTRO-MECHANICS CO., LTD", + [3]byte{132, 15, 69}: "Shanghai GMT Digital Technologies Co., Ltd", + [3]byte{132, 23, 21}: "GP Electronics (HK) Ltd.", + [3]byte{132, 23, 102}: "Weifang GoerTek Electronics Co., Ltd", + [3]byte{132, 24, 38}: "Osram GmbH", + [3]byte{132, 24, 58}: "Ruckus Wireless", + [3]byte{132, 24, 136}: "Juniper Networks", + [3]byte{132, 27, 56}: "Shenzhen Excelsecu Data Technology Co.,Ltd", + [3]byte{132, 27, 94}: "NETGEAR", + [3]byte{132, 30, 38}: "KERNEL-I Co.,LTD", + [3]byte{132, 33, 65}: "Shenzhen Ginwave Technologies Ltd.", + [3]byte{132, 36, 141}: "Motorola Solutions Inc", + [3]byte{132, 37, 63}: "Silex Technology, Inc", + [3]byte{132, 37, 164}: "Tariox Limited", + [3]byte{132, 37, 219}: "Samsung Electronics Co.,Ltd", + [3]byte{132, 38, 21}: "ADB Broadband Italia", + [3]byte{132, 38, 43}: "Alcatel-Lucent", + [3]byte{132, 38, 144}: "BEIJING THOUGHT SCIENCE CO.,LTD.", + [3]byte{132, 39, 206}: "Corporation of the Presiding Bishop of The Church of Jesus Christ of Latter-day Saints", + [3]byte{132, 41, 20}: "EMPORIA TELECOM Produktions- und VertriebsgesmbH & Co KG", + [3]byte{132, 41, 153}: "Apple", + [3]byte{132, 43, 43}: "Dell Inc.", + [3]byte{132, 43, 80}: "Huria Co.,Ltd.", + [3]byte{132, 43, 188}: "Modelleisenbahn GmbH", + [3]byte{132, 47, 117}: "Innokas Group", + [3]byte{132, 48, 229}: "SkyHawke Technologies, LLC", + [3]byte{132, 50, 234}: "ANHUI WANZTEN P&T CO., LTD", + [3]byte{132, 52, 151}: "Hewlett Packard", + [3]byte{132, 54, 17}: "hyungseul publishing networks", + [3]byte{132, 56, 53}: "Apple", + [3]byte{132, 56, 56}: "Samsung Electro Mechanics co., LTD.", + [3]byte{132, 58, 75}: "Intel Corporate", + [3]byte{132, 63, 78}: "Tri-Tech Manufacturing, Inc.", + [3]byte{132, 68, 100}: "ServerU Inc", + [3]byte{132, 72, 35}: "WOXTER TECHNOLOGY Co. Ltd", + [3]byte{132, 73, 21}: "vArmour Networks, Inc.", + [3]byte{132, 75, 245}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{132, 79, 3}: "Ablelink Electronics Ltd", + [3]byte{132, 81, 129}: "Samsung Electronics Co.,Ltd", + [3]byte{132, 85, 165}: "Samsung Elec Co.,Ltd", + [3]byte{132, 86, 156}: "Coho Data, Inc.,", + [3]byte{132, 87, 135}: "DVR C&C Co., Ltd.", + [3]byte{132, 92, 147}: "Chabrier Services", + [3]byte{132, 93, 215}: "Shenzhen Netcom Electronics Co.,Ltd", + [3]byte{132, 98, 35}: "Shenzhen Coship Electronics Co., Ltd.", + [3]byte{132, 98, 166}: "EuroCB (Phils), Inc.", + [3]byte{132, 99, 214}: "Microsoft Corporation", + [3]byte{132, 106, 237}: "Wireless Tsukamoto.,co.LTD", + [3]byte{132, 110, 177}: "Park Assist LLC", + [3]byte{132, 114, 7}: "I&C Technology", + [3]byte{132, 116, 42}: "zte corporation", + [3]byte{132, 118, 22}: "Addat S.r.o.", + [3]byte{132, 120, 139}: "Apple", + [3]byte{132, 120, 172}: "Cisco", + [3]byte{132, 122, 136}: "HTC Corporation", + [3]byte{132, 126, 64}: "Texas Instruments", + [3]byte{132, 130, 244}: "Beijing Huasun Unicreate Technology Co., Ltd", + [3]byte{132, 131, 54}: "Newrun", + [3]byte{132, 131, 113}: "Avaya, Inc", + [3]byte{132, 132, 51}: "Paradox Engineering SA", + [3]byte{132, 133, 6}: "Apple", + [3]byte{132, 133, 10}: "Hella Sonnen- und Wetterschutztechnik GmbH", + [3]byte{132, 134, 243}: "Greenvity Communications", + [3]byte{132, 141, 132}: "Rajant Corporation", + [3]byte{132, 141, 199}: "Cisco SPVTG", + [3]byte{132, 142, 12}: "Apple", + [3]byte{132, 142, 150}: "Embertec Pty Ltd", + [3]byte{132, 142, 223}: "Sony Mobile Communications AB", + [3]byte{132, 143, 105}: "Dell Inc.", + [3]byte{132, 144, 0}: "Arnold & Richter Cine Technik", + [3]byte{132, 147, 12}: "InCoax Networks Europe AB", + [3]byte{132, 148, 140}: "Hitron Technologies. Inc", + [3]byte{132, 150, 129}: "Cathay Communication Co.,Ltd", + [3]byte{132, 150, 216}: "Pace plc", + [3]byte{132, 151, 184}: "Memjet Inc.", + [3]byte{132, 156, 166}: "Arcadyan Technology Corporation", + [3]byte{132, 157, 197}: "Centera Photonics Inc.", + [3]byte{132, 164, 102}: "Samsung Electronics Co.,Ltd", + [3]byte{132, 166, 200}: "Intel Corporate", + [3]byte{132, 167, 131}: "Alcatel Lucent", + [3]byte{132, 168, 228}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{132, 169, 145}: "Cyber Trans Japan Co.,Ltd.", + [3]byte{132, 172, 164}: "Beijing Novel Super Digital TV Technology Co., Ltd", + [3]byte{132, 175, 31}: "Beat System Service Co,. Ltd.", + [3]byte{132, 177, 83}: "Apple", + [3]byte{132, 181, 156}: "Juniper networks", + [3]byte{132, 194, 228}: "Jiangsu Qinheng Co., Ltd.", + [3]byte{132, 199, 39}: "Gnodal Ltd", + [3]byte{132, 199, 169}: "C3PO S.A.", + [3]byte{132, 200, 177}: "Incognito Software Inc.", + [3]byte{132, 201, 178}: "D-Link International", + [3]byte{132, 211, 42}: "IEEE 1905.1", + [3]byte{132, 217, 200}: "Unipattern Co.,", + [3]byte{132, 219, 47}: "Sierra Wireless Inc", + [3]byte{132, 221, 32}: "Texas Instruments", + [3]byte{132, 221, 183}: "Cilag GmbH International", + [3]byte{132, 222, 61}: "Crystal Vision Ltd", + [3]byte{132, 223, 12}: "NET2GRID BV", + [3]byte{132, 224, 88}: "Pace plc", + [3]byte{132, 228, 217}: "Shenzhen NEED technology Ltd.", + [3]byte{132, 230, 41}: "Bluwan SA", + [3]byte{132, 231, 20}: "Liang Herng Enterprise,Co.Ltd.", + [3]byte{132, 234, 153}: "Vieworks", + [3]byte{132, 235, 24}: "Texas Instruments", + [3]byte{132, 237, 51}: "BBMC Co.,Ltd", + [3]byte{132, 244, 147}: "OMS spol. s.r.o.", + [3]byte{132, 246, 76}: "Cross Point BV", + [3]byte{132, 252, 254}: "Apple", + [3]byte{132, 254, 158}: "RTC Industries, Inc.", + [3]byte{136, 3, 85}: "Arcadyan Technology Corp.", + [3]byte{136, 9, 5}: "MTMCommunications", + [3]byte{136, 15, 16}: "Huami Information Technology Co.,Ltd.", + [3]byte{136, 15, 182}: "Jabil Circuits India Pvt Ltd,-EHTP unit", + [3]byte{136, 16, 54}: "Panodic(ShenZhen) Electronics Limted", + [3]byte{136, 18, 78}: "Qualcomm Atheros", + [3]byte{136, 20, 43}: "Protonic Holland", + [3]byte{136, 21, 68}: "Meraki, Inc.", + [3]byte{136, 24, 174}: "Tamron Co., Ltd", + [3]byte{136, 29, 252}: "Cisco", + [3]byte{136, 31, 161}: "Apple", + [3]byte{136, 32, 18}: "LMI Technologies", + [3]byte{136, 33, 227}: "Nebusens, S.L.", + [3]byte{136, 35, 100}: "Watchnet DVR Inc", + [3]byte{136, 35, 254}: "TTTech Computertechnik AG", + [3]byte{136, 37, 44}: "Arcadyan Technology Corporation", + [3]byte{136, 41, 80}: "Dalian Netmoon Tech Develop Co.,Ltd", + [3]byte{136, 46, 90}: "storONE", + [3]byte{136, 48, 138}: "Murata Manufactuaring Co.,Ltd.", + [3]byte{136, 50, 155}: "Samsung Electro Mechanics co.,LTD.", + [3]byte{136, 51, 20}: "Texas Instruments", + [3]byte{136, 53, 76}: "Transics", + [3]byte{136, 54, 18}: "SRC Computers, LLC", + [3]byte{136, 65, 193}: "ORBISAT DA AMAZONIA IND E AEROL SA", + [3]byte{136, 65, 252}: "AirTies Wireless Netowrks", + [3]byte{136, 67, 225}: "CISCO SYSTEMS, INC.", + [3]byte{136, 68, 246}: "Nokia Corporation", + [3]byte{136, 70, 42}: "Telechips Inc.", + [3]byte{136, 75, 57}: "Siemens AG, Healthcare Sector", + [3]byte{136, 81, 251}: "Hewlett Packard", + [3]byte{136, 83, 46}: "Intel Corporate", + [3]byte{136, 83, 149}: "Apple", + [3]byte{136, 83, 212}: "Huawei Technologies Co., Ltd", + [3]byte{136, 87, 109}: "XTA Electronics Ltd", + [3]byte{136, 90, 146}: "Cisco", + [3]byte{136, 91, 221}: "Aerohive Networks Inc.", + [3]byte{136, 92, 71}: "Alcatel Lucent", + [3]byte{136, 97, 90}: "Siano Mobile Silicon Ltd.", + [3]byte{136, 99, 223}: "Apple", + [3]byte{136, 104, 92}: "Shenzhen ChuangDao & Perpetual Eternal Technology Co.,Ltd", + [3]byte{136, 107, 118}: "CHINA HOPEFUL GROUP HOPEFUL ELECTRIC CO.,LTD", + [3]byte{136, 112, 140}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{136, 112, 239}: "SC Professional Trading Co., Ltd.", + [3]byte{136, 115, 152}: "K2E Tekpoint", + [3]byte{136, 117, 86}: "Cisco", + [3]byte{136, 120, 156}: "Game Technologies SA", + [3]byte{136, 134, 3}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{136, 134, 160}: "Simton Technologies, Ltd.", + [3]byte{136, 135, 23}: "CANON INC.", + [3]byte{136, 135, 221}: "DarbeeVision Inc.", + [3]byte{136, 137, 20}: "All Components Incorporated", + [3]byte{136, 137, 100}: "GSI Electronics Inc.", + [3]byte{136, 139, 93}: "Storage Appliance Corporation", + [3]byte{136, 140, 25}: "Brady Corp Asia Pacific Ltd", + [3]byte{136, 145, 102}: "Viewcooper Corp.", + [3]byte{136, 145, 221}: "Racktivity", + [3]byte{136, 148, 113}: "Brocade Communications Systems, Inc.", + [3]byte{136, 148, 249}: "Gemicom Technology, Inc.", + [3]byte{136, 149, 185}: "Unified Packet Systems Crop", + [3]byte{136, 150, 118}: "TTC MARCONI s.r.o.", + [3]byte{136, 151, 223}: "Entrypass Corporation Sdn. Bhd.", + [3]byte{136, 152, 33}: "TERAON", + [3]byte{136, 155, 57}: "Samsung Electronics Co.,Ltd", + [3]byte{136, 156, 166}: "BTB Korea INC", + [3]byte{136, 159, 250}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{136, 163, 204}: "Amatis Controls", + [3]byte{136, 165, 189}: "QPCOM INC.", + [3]byte{136, 167, 60}: "Ragentek Technology Group", + [3]byte{136, 172, 193}: "Generiton Co., Ltd.", + [3]byte{136, 174, 29}: "COMPAL INFORMATION(KUNSHAN)CO.,LTD", + [3]byte{136, 177, 104}: "Delta Control GmbH", + [3]byte{136, 177, 225}: "AirTight Networks, Inc.", + [3]byte{136, 182, 39}: "Gembird Europe BV", + [3]byte{136, 186, 127}: "Qfiednet Co., Ltd.", + [3]byte{136, 191, 213}: "Simple Audio Ltd", + [3]byte{136, 195, 110}: "Beijing Ereneben lnformation Technology Limited", + [3]byte{136, 198, 38}: "Logitech - Ultimate Ears", + [3]byte{136, 198, 99}: "Apple", + [3]byte{136, 201, 208}: "LG Electronics", + [3]byte{136, 203, 135}: "Apple", + [3]byte{136, 215, 188}: "DEP Company", + [3]byte{136, 217, 98}: "Canopus Systems US LLC", + [3]byte{136, 220, 150}: "SENAO Networks, Inc.", + [3]byte{136, 221, 121}: "Voltaire", + [3]byte{136, 224, 160}: "Shenzhen VisionSTOR Technologies Co., Ltd", + [3]byte{136, 224, 243}: "Juniper Networks", + [3]byte{136, 227, 171}: "Huawei Technologies Co., Ltd", + [3]byte{136, 231, 18}: "Whirlpool Corporation", + [3]byte{136, 231, 166}: "iKnowledge Integration Corp.", + [3]byte{136, 232, 248}: "YONG TAI ELECTRONIC (DONGGUAN) LTD.", + [3]byte{136, 233, 23}: "Tamaggo", + [3]byte{136, 237, 28}: "Cudo Communication Co., Ltd.", + [3]byte{136, 240, 49}: "Cisco", + [3]byte{136, 240, 119}: "CISCO SYSTEMS, INC.", + [3]byte{136, 244, 136}: "cellon communications technology(shenzhen)Co.,Ltd.", + [3]byte{136, 244, 144}: "Jetmobile Pte Ltd", + [3]byte{136, 247, 199}: "Technicolor USA Inc.", + [3]byte{136, 253, 21}: "LINEEYE CO., LTD", + [3]byte{136, 254, 214}: "ShangHai WangYong Software Co., Ltd.", + [3]byte{140, 0, 109}: "Apple", + [3]byte{140, 4, 255}: "Technicolor USA Inc.", + [3]byte{140, 5, 81}: "Koubachi AG", + [3]byte{140, 7, 140}: "FLOW DATA INC", + [3]byte{140, 8, 139}: "Remote Solution", + [3]byte{140, 9, 244}: "ARRIS Group, Inc.", + [3]byte{140, 12, 144}: "Ruckus Wireless", + [3]byte{140, 12, 163}: "Amper", + [3]byte{140, 14, 227}: "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD.", + [3]byte{140, 17, 203}: "ABUS Security-Center GmbH & Co. KG", + [3]byte{140, 24, 217}: "Shenzhen RF Technology Co., Ltd", + [3]byte{140, 31, 148}: "RF Surgical System Inc.", + [3]byte{140, 33, 10}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{140, 39, 29}: "QuantHouse", + [3]byte{140, 39, 138}: "Vocollect Inc", + [3]byte{140, 41, 55}: "Apple", + [3]byte{140, 45, 170}: "Apple", + [3]byte{140, 47, 57}: "IBA Dosimetry GmbH", + [3]byte{140, 51, 48}: "EmFirst Co., Ltd.", + [3]byte{140, 51, 87}: "HiteVision Digital Media Technology Co.,Ltd.", + [3]byte{140, 58, 227}: "LG Electronics", + [3]byte{140, 60, 7}: "Skiva Technologies, Inc.", + [3]byte{140, 60, 74}: "NAKAYO TELECOMMUNICATIONS,INC.", + [3]byte{140, 65, 242}: "RDA Technologies Ltd.", + [3]byte{140, 68, 53}: "Shanghai BroadMobi Communication Technology Co., Ltd.", + [3]byte{140, 74, 238}: "GIGA TMS INC", + [3]byte{140, 75, 89}: "3D Imaging & Simulations Corp", + [3]byte{140, 76, 220}: "PLANEX COMMUNICATIONS INC.", + [3]byte{140, 77, 185}: "Unmonday Ltd", + [3]byte{140, 77, 234}: "Cerio Corporation", + [3]byte{140, 81, 5}: "Shenzhen ireadygo Information Technology CO.,LTD.", + [3]byte{140, 83, 247}: "A&D ENGINEERING CO., LTD.", + [3]byte{140, 84, 29}: "LGE", + [3]byte{140, 86, 157}: "Imaging Solutions Group", + [3]byte{140, 86, 197}: "Nintendo Co., Ltd.", + [3]byte{140, 87, 253}: "LVX Western", + [3]byte{140, 88, 119}: "Apple", + [3]byte{140, 89, 139}: "C Technologies AB", + [3]byte{140, 90, 240}: "Exeltech Solar Products", + [3]byte{140, 92, 161}: "d-broad,INC", + [3]byte{140, 93, 96}: "UCI Corporation Co.,Ltd.", + [3]byte{140, 95, 223}: "Beijing Railway Signal Factory", + [3]byte{140, 96, 79}: "CISCO SYSTEMS, INC.", + [3]byte{140, 100, 11}: "Beyond Devices d.o.o.", + [3]byte{140, 100, 34}: "Sony Ericsson Mobile Communications AB", + [3]byte{140, 104, 120}: "Nortek-AS", + [3]byte{140, 106, 228}: "Viogem Limited", + [3]byte{140, 112, 90}: "Intel Corporate", + [3]byte{140, 113, 248}: "Samsung Electronics Co.,Ltd", + [3]byte{140, 115, 110}: "Fujitsu Limited", + [3]byte{140, 118, 193}: "Goden Tech Limited", + [3]byte{140, 119, 18}: "Samsung Electronics Co.,Ltd", + [3]byte{140, 119, 22}: "LONGCHEER TELECOMMUNICATION LIMITED", + [3]byte{140, 123, 157}: "Apple", + [3]byte{140, 124, 146}: "Apple", + [3]byte{140, 124, 181}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{140, 124, 255}: "Brocade Communications Systems, Inc.", + [3]byte{140, 126, 179}: "Lytro, Inc.", + [3]byte{140, 127, 59}: "ARRIS Group, Inc.", + [3]byte{140, 130, 168}: "Insigma Technology Co.,Ltd", + [3]byte{140, 132, 1}: "PRIVATE", + [3]byte{140, 137, 165}: "Micro-Star INT'L CO., LTD", + [3]byte{140, 138, 110}: "ESTUN AUTOMATION TECHNOLOY CO., LTD", + [3]byte{140, 142, 118}: "taskit GmbH", + [3]byte{140, 144, 211}: "Alcatel Lucent", + [3]byte{140, 145, 9}: "Toyoshima Electric Technoeogy(Suzhou) Co.,Ltd.", + [3]byte{140, 146, 54}: "Aus.Linx Technology Co., Ltd.", + [3]byte{140, 148, 207}: "Encell Technology, Inc.", + [3]byte{140, 160, 72}: "Beijing NeTopChip Technology Co.,LTD", + [3]byte{140, 169, 130}: "Intel Corporate", + [3]byte{140, 174, 76}: "Plugable Technologies", + [3]byte{140, 174, 137}: "Y-cam Solutions Ltd", + [3]byte{140, 176, 148}: "Airtech I&C Co., Ltd", + [3]byte{140, 182, 79}: "CISCO SYSTEMS, INC.", + [3]byte{140, 183, 247}: "Shenzhen UniStrong Science & Technology Co., Ltd", + [3]byte{140, 184, 44}: "IPitomy Communications", + [3]byte{140, 184, 100}: "AcSiP Technology Corp.", + [3]byte{140, 190, 190}: "Xiaomi Technology Co.,Ltd", + [3]byte{140, 191, 157}: "Shanghai Xinyou Information Technology Ltd. Co.", + [3]byte{140, 193, 33}: "Panasonic Corporation AVC Networks Company", + [3]byte{140, 197, 225}: "ShenZhen Konka Telecommunication Technology Co.,Ltd", + [3]byte{140, 199, 170}: "Radinet Communications Inc.", + [3]byte{140, 199, 208}: "zhejiang ebang communication co.,ltd", + [3]byte{140, 200, 205}: "Samsung Electronics Co., LTD", + [3]byte{140, 205, 162}: "ACTP, Inc.", + [3]byte{140, 205, 232}: "Nintendo Co., Ltd.", + [3]byte{140, 207, 92}: "BEFEGA GmbH", + [3]byte{140, 209, 123}: "CG Mobile", + [3]byte{140, 211, 162}: "VisSim AS", + [3]byte{140, 214, 40}: "Ikor Metering", + [3]byte{140, 219, 37}: "ESG Solutions", + [3]byte{140, 220, 212}: "Hewlett Packard", + [3]byte{140, 221, 141}: "Wifly-City System Inc.", + [3]byte{140, 222, 82}: "ISSC Technologies Corp.", + [3]byte{140, 222, 153}: "Comlab Inc.", + [3]byte{140, 223, 157}: "NEC Corporation", + [3]byte{140, 224, 129}: "zte corporation", + [3]byte{140, 231, 72}: "PRIVATE", + [3]byte{140, 231, 140}: "DK Networks", + [3]byte{140, 231, 179}: "Sonardyne International Ltd", + [3]byte{140, 238, 198}: "Precepscion Pty. Ltd.", + [3]byte{140, 248, 19}: "ORANGE POLSKA", + [3]byte{140, 249, 69}: "Power Automation pte Ltd", + [3]byte{140, 249, 201}: "MESADA Technology Co.,Ltd.", + [3]byte{140, 250, 186}: "Apple", + [3]byte{140, 253, 240}: "QUALCOMM Incorporated", + [3]byte{144, 0, 78}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{144, 1, 59}: "SAGEMCOM", + [3]byte{144, 2, 138}: "Shenzhen Shidean Legrand Electronic Products Co.,Ltd", + [3]byte{144, 2, 169}: "ZHEJIANG DAHUA TECHNOLOGY CO.,LTD", + [3]byte{144, 3, 183}: "PARROT", + [3]byte{144, 9, 23}: "Far-sighted mobile", + [3]byte{144, 10, 58}: "PSG Plastic Service GmbH", + [3]byte{144, 12, 180}: "Alinket Electronic Technology Co., Ltd", + [3]byte{144, 13, 102}: "Digimore Electronics Co., Ltd", + [3]byte{144, 13, 203}: "ARRIS Group, Inc.", + [3]byte{144, 23, 155}: "Nanomegas", + [3]byte{144, 23, 172}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{144, 24, 94}: "Apex Tool Group GmbH & Co OHG", + [3]byte{144, 24, 124}: "Samsung Electro Mechanics co., LTD.", + [3]byte{144, 24, 174}: "Shanghai Meridian Technologies, Co. Ltd.", + [3]byte{144, 25, 0}: "SCS SA", + [3]byte{144, 26, 202}: "ARRIS Group, Inc.", + [3]byte{144, 27, 14}: "Fujitsu Technology Solutions GmbH", + [3]byte{144, 29, 39}: "zte corporation", + [3]byte{144, 30, 221}: "GREAT COMPUTER CORPORATION", + [3]byte{144, 32, 58}: "BYD Precision Manufacture Co.,Ltd", + [3]byte{144, 32, 131}: "General Engine Management Systems Ltd.", + [3]byte{144, 33, 85}: "HTC Corporation", + [3]byte{144, 33, 129}: "Shanghai Huaqin Telecom Technology Co.,Ltd", + [3]byte{144, 39, 228}: "Apple", + [3]byte{144, 43, 52}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{144, 44, 199}: "C-MAX Asia Limited", + [3]byte{144, 46, 135}: "LabJack", + [3]byte{144, 49, 205}: "Onyx Healthcare Inc.", + [3]byte{144, 52, 43}: "Gatekeeper Systems, Inc.", + [3]byte{144, 52, 252}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{144, 53, 110}: "Vodafone Omnitel N.V.", + [3]byte{144, 56, 223}: "Changzhou Tiannengbo System Co. Ltd.", + [3]byte{144, 58, 160}: "Alcatel-Lucent", + [3]byte{144, 60, 174}: "Yunnan KSEC Digital Technology Co.,Ltd.", + [3]byte{144, 61, 90}: "Shenzhen Wision Technology Holding Limited", + [3]byte{144, 61, 107}: "Zicon Technology Corp.", + [3]byte{144, 62, 171}: "ARRIS Group, Inc.", + [3]byte{144, 70, 183}: "Vadaro Pte Ltd", + [3]byte{144, 71, 22}: "RORZE CORPORATION", + [3]byte{144, 72, 154}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{144, 73, 250}: "Intel Corporation", + [3]byte{144, 76, 229}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{144, 78, 43}: "Huawei Technologies Co., Ltd", + [3]byte{144, 80, 123}: "Advanced PANMOBIL Systems GmbH & Co. KG", + [3]byte{144, 81, 63}: "Elettronica Santerno", + [3]byte{144, 84, 70}: "TES ELECTRONIC SOLUTIONS", + [3]byte{144, 85, 174}: "Ericsson, EAB/RWI/K", + [3]byte{144, 86, 130}: "Lenbrook Industries Limited", + [3]byte{144, 86, 146}: "Autotalks Ltd.", + [3]byte{144, 89, 175}: "Texas Instruments", + [3]byte{144, 95, 46}: "TCT Mobile Limited", + [3]byte{144, 95, 141}: "modas GmbH", + [3]byte{144, 97, 12}: "Fida International (S) Pte Ltd", + [3]byte{144, 103, 23}: "Alphion India Private Limited", + [3]byte{144, 103, 181}: "Alcatel-Lucent", + [3]byte{144, 103, 243}: "Alcatel Lucent", + [3]byte{144, 104, 195}: "Motorola Mobility LLC", + [3]byte{144, 109, 200}: "DLG Automação Industrial Ltda", + [3]byte{144, 110, 187}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{144, 112, 37}: "Garea Microsys Co.,Ltd.", + [3]byte{144, 114, 64}: "Apple", + [3]byte{144, 121, 144}: "Benchmark Electronics Romania SRL", + [3]byte{144, 122, 10}: "Gebr. Bode GmbH & Co KG", + [3]byte{144, 122, 40}: "Beijing Morncloud Information And Technology Co. Ltd.", + [3]byte{144, 122, 241}: "SNUPI Technologies", + [3]byte{144, 126, 186}: "UTEK TECHNOLOGY (SHENZHEN) CO.,LTD", + [3]byte{144, 127, 97}: "Chicony Electronics Co., Ltd.", + [3]byte{144, 130, 96}: "IEEE 1904.1 Working Group", + [3]byte{144, 131, 122}: "General Electric Water & Process Technologies", + [3]byte{144, 132, 13}: "Apple", + [3]byte{144, 136, 162}: "IONICS TECHNOLOGY ME LTDA", + [3]byte{144, 140, 9}: "Total Phase", + [3]byte{144, 140, 68}: "H.K ZONGMU TECHNOLOGY CO., LTD.", + [3]byte{144, 140, 99}: "GZ Weedong Networks Technology Co. , Ltd", + [3]byte{144, 141, 29}: "GH Technologies", + [3]byte{144, 143, 207}: "UNO System Co., Ltd", + [3]byte{144, 144, 60}: "TRISON TECHNOLOGY CORPORATION", + [3]byte{144, 144, 96}: "RSI VIDEO TECHNOLOGIES", + [3]byte{144, 146, 180}: "Diehl BGT Defence GmbH & Co. KG", + [3]byte{144, 148, 228}: "D-Link International", + [3]byte{144, 152, 100}: "Impex-Sat GmbH&Co KG", + [3]byte{144, 153, 22}: "ELVEES NeoTek OJSC", + [3]byte{144, 157, 224}: "Newland Design + Assoc. Inc.", + [3]byte{144, 159, 51}: "EFM Networks", + [3]byte{144, 159, 67}: "Accutron Instruments Inc.", + [3]byte{144, 162, 218}: "GHEO SA", + [3]byte{144, 164, 222}: "Wistron Neweb Corp.", + [3]byte{144, 167, 131}: "JSW PACIFIC CORPORATION", + [3]byte{144, 167, 193}: "Pakedge Device and Software Inc.", + [3]byte{144, 172, 63}: "BrightSign LLC", + [3]byte{144, 174, 27}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{144, 177, 28}: "Dell Inc.", + [3]byte{144, 177, 52}: "ARRIS Group, Inc.", + [3]byte{144, 178, 31}: "Apple", + [3]byte{144, 182, 134}: "Murata Manufacturing Co., Ltd.", + [3]byte{144, 184, 208}: "Joyent, Inc.", + [3]byte{144, 185, 49}: "Apple, Inc", + [3]byte{144, 185, 125}: "Johnson Outdoors Marine Electronics d/b/a Minnkota", + [3]byte{144, 193, 21}: "Sony Ericsson Mobile Communications AB", + [3]byte{144, 199, 146}: "ARRIS Group, Inc.", + [3]byte{144, 204, 36}: "Synaptics, Inc", + [3]byte{144, 207, 21}: "Nokia Corporation", + [3]byte{144, 207, 111}: "Dlogixs Co Ltd", + [3]byte{144, 207, 125}: "Qingdao Hisense Electric Co.,Ltd.", + [3]byte{144, 209, 27}: "Palomar Medical Technologies", + [3]byte{144, 215, 79}: "Bookeen", + [3]byte{144, 215, 235}: "Texas Instruments", + [3]byte{144, 216, 82}: "Comtec Co., Ltd.", + [3]byte{144, 217, 44}: "HUG-WITSCHI AG", + [3]byte{144, 218, 78}: "AVANU", + [3]byte{144, 218, 106}: "FOCUS H&S Co., Ltd.", + [3]byte{144, 219, 70}: "E-LEAD ELECTRONIC CO., LTD", + [3]byte{144, 223, 183}: "s.m.s smart microwave sensors GmbH", + [3]byte{144, 224, 240}: "IEEE 1722a Working Group", + [3]byte{144, 226, 186}: "Intel Corporate", + [3]byte{144, 230, 186}: "ASUSTek COMPUTER INC.", + [3]byte{144, 234, 96}: "SPI Lasers Ltd", + [3]byte{144, 239, 104}: "ZyXEL Communications Corporation", + [3]byte{144, 241, 170}: "Samsung Electronics Co.,LTD", + [3]byte{144, 241, 176}: "Hangzhou Anheng Info&Tech CO.,LTD", + [3]byte{144, 242, 120}: "Radius Gateway", + [3]byte{144, 243, 183}: "Kirisun Communications Co., Ltd.", + [3]byte{144, 244, 193}: "Rand McNally", + [3]byte{144, 246, 82}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{144, 247, 47}: "Phillips Machine & Welding Co., Inc.", + [3]byte{144, 251, 91}: "Avaya, Inc", + [3]byte{144, 251, 166}: "Hon Hai Precision Ind.Co.Ltd", + [3]byte{144, 253, 97}: "Apple", + [3]byte{144, 255, 121}: "Metro Ethernet Forum", + [3]byte{148, 0, 112}: "Nokia Corporation", + [3]byte{148, 1, 73}: "AutoHotBox", + [3]byte{148, 1, 194}: "Samsung Electronics Co.,Ltd", + [3]byte{148, 5, 182}: "Liling FullRiver Electronics & Technology Ltd", + [3]byte{148, 11, 45}: "NetView Technologies(Shenzhen) Co., Ltd", + [3]byte{148, 11, 213}: "Himax Technologies, Inc", + [3]byte{148, 12, 109}: "TP-LINK Technologies Co.,Ltd.", + [3]byte{148, 16, 62}: "Belkin International Inc.", + [3]byte{148, 17, 218}: "ITF Fröschl GmbH", + [3]byte{148, 22, 115}: "Point Core SARL", + [3]byte{148, 29, 28}: "TLab West Systems AB", + [3]byte{148, 32, 83}: "Nokia Corporation", + [3]byte{148, 33, 151}: "Stalmart Technology Limited", + [3]byte{148, 35, 110}: "Shenzhen Junlan Electronic Ltd", + [3]byte{148, 46, 23}: "Schneider Electric Canada Inc", + [3]byte{148, 46, 99}: "Finsécur", + [3]byte{148, 49, 155}: "Alphatronics BV", + [3]byte{148, 51, 221}: "Taco Electronic Solutions, Inc.", + [3]byte{148, 53, 10}: "Samsung Electronics Co.,Ltd", + [3]byte{148, 54, 224}: "Sichuan Bihong Broadcast & Television New Technologies Co.,Ltd", + [3]byte{148, 57, 229}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{148, 58, 240}: "Nokia Corporation", + [3]byte{148, 59, 177}: "KAONMEDIA", + [3]byte{148, 64, 162}: "Anywave Communication Technologies, Inc.", + [3]byte{148, 68, 68}: "LG Innotek", + [3]byte{148, 68, 82}: "Belkin International Inc.", + [3]byte{148, 70, 150}: "BaudTec Corporation", + [3]byte{148, 74, 9}: "BitWise Controls", + [3]byte{148, 80, 71}: "Rechnerbetriebsgruppe", + [3]byte{148, 81, 3}: "Samsung Electronics", + [3]byte{148, 81, 191}: "Hyundai ESG", + [3]byte{148, 84, 147}: "Rigado, LLC", + [3]byte{148, 89, 45}: "EKE Building Technology Systems Ltd", + [3]byte{148, 91, 126}: "TRILOBIT LTDA.", + [3]byte{148, 97, 36}: "Pason Systems", + [3]byte{148, 98, 105}: "Arris Group, Inc.", + [3]byte{148, 99, 209}: "Samsung Electronics Co.,Ltd", + [3]byte{148, 112, 210}: "WINFIRM TECHNOLOGY", + [3]byte{148, 113, 172}: "TCT Mobile Limited", + [3]byte{148, 117, 110}: "QinetiQ North America", + [3]byte{148, 124, 62}: "Polewall Norge AS", + [3]byte{148, 129, 164}: "Azuray Technologies", + [3]byte{148, 133, 122}: "Evantage Industries Corp", + [3]byte{148, 134, 212}: "Surveillance Pro Corporation", + [3]byte{148, 135, 124}: "ARRIS Group, Inc.", + [3]byte{148, 136, 84}: "Texas Instruments", + [3]byte{148, 139, 3}: "EAGET Innovation and Technology Co., Ltd.", + [3]byte{148, 141, 80}: "Beamex Oy Ab", + [3]byte{148, 142, 137}: "INDUSTRIAS UNIDAS SA DE CV", + [3]byte{148, 143, 238}: "Hughes Telematics, Inc.", + [3]byte{148, 148, 38}: "Apple", + [3]byte{148, 152, 162}: "Shanghai LISTEN TECH.LTD", + [3]byte{148, 155, 253}: "Trans New Technology, Inc.", + [3]byte{148, 156, 85}: "Alta Data Technologies", + [3]byte{148, 159, 63}: "Optek Digital Technology company limited", + [3]byte{148, 159, 180}: "ChengDu JiaFaAnTai Technology Co.,Ltd", + [3]byte{148, 167, 188}: "BodyMedia, Inc.", + [3]byte{148, 170, 184}: "Joview(Beijing) Technology Co. Ltd.", + [3]byte{148, 172, 202}: "trivum technologies GmbH", + [3]byte{148, 174, 97}: "Alcatel Lucent", + [3]byte{148, 174, 227}: "Belden Hirschmann Industries (Suzhou) Ltd.", + [3]byte{148, 180, 15}: "Aruba Networks", + [3]byte{148, 184, 197}: "RuggedCom Inc.", + [3]byte{148, 185, 180}: "Aptos Technology", + [3]byte{148, 186, 49}: "Visiontec da Amazônia Ltda.", + [3]byte{148, 186, 86}: "Shenzhen Coship Electronics Co., Ltd.", + [3]byte{148, 191, 30}: "eflow Inc. / Smart Device Planning and Development Division", + [3]byte{148, 191, 149}: "Shenzhen Coship Electronics Co., Ltd", + [3]byte{148, 192, 20}: "Sorter Sp. j. Konrad Grzeszczyk MichaA, Ziomek", + [3]byte{148, 192, 56}: "Tallac Networks", + [3]byte{148, 193, 80}: "2Wire Inc", + [3]byte{148, 195, 228}: "SCA Schucker Gmbh & Co KG", + [3]byte{148, 196, 233}: "PowerLayer Microsystems HongKong Limited", + [3]byte{148, 198, 235}: "NOVA electronics, Inc.", + [3]byte{148, 199, 175}: "Raylios Technology", + [3]byte{148, 201, 98}: "Teseq AG", + [3]byte{148, 202, 15}: "Honeywell Analytics", + [3]byte{148, 204, 185}: "ARRIS Group, Inc.", + [3]byte{148, 205, 172}: "Creowave Oy", + [3]byte{148, 206, 44}: "Sony Mobile Communications AB", + [3]byte{148, 206, 49}: "CTS Limited", + [3]byte{148, 208, 25}: "Cydle Corp.", + [3]byte{148, 214, 14}: "shenzhen yunmao information technologies co., ltd", + [3]byte{148, 215, 35}: "Shanghai DareGlobal Technologies Co., Ltd", + [3]byte{148, 215, 113}: "Samsung Electronics Co.,Ltd", + [3]byte{148, 217, 60}: "ENELPS", + [3]byte{148, 219, 73}: "SITCORP", + [3]byte{148, 219, 201}: "Azurewave", + [3]byte{148, 221, 63}: "A+V Link Technologies, Corp.", + [3]byte{148, 222, 14}: "SmartOptics AS", + [3]byte{148, 222, 128}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{148, 223, 78}: "Wistron InfoComm(Kunshan)Co.,Ltd.", + [3]byte{148, 223, 88}: "IJ Electron CO.,Ltd.", + [3]byte{148, 224, 208}: "HealthStream Taiwan Inc.", + [3]byte{148, 226, 38}: "D. ORtiz Consulting, LLC", + [3]byte{148, 231, 17}: "Xirka Dama Persada PT", + [3]byte{148, 232, 72}: "FYLDE MICRO LTD", + [3]byte{148, 233, 140}: "Alcatel-Lucent", + [3]byte{148, 235, 44}: "Google Inc.", + [3]byte{148, 235, 205}: "Research In Motion Limited", + [3]byte{148, 246, 146}: "Geminico co.,Ltd.", + [3]byte{148, 247, 32}: "Tianjin Deviser Electronics Instrument Co., Ltd", + [3]byte{148, 250, 232}: "Shenzhen Eycom Technology Co., Ltd", + [3]byte{148, 251, 178}: "Shenzhen Gongjin Electronics Co.,Ltd", + [3]byte{148, 253, 29}: "WhereWhen Corp", + [3]byte{148, 253, 46}: "Shanghai Uniscope Technologies Co.,Ltd", + [3]byte{148, 254, 244}: "SAGEMCOM", + [3]byte{152, 2, 132}: "Theobroma Systems GmbH", + [3]byte{152, 3, 160}: "ABB n.v. Power Quality Products", + [3]byte{152, 3, 216}: "Apple", + [3]byte{152, 12, 130}: "Samsung Electro Mechanics", + [3]byte{152, 13, 46}: "HTC Corporation", + [3]byte{152, 14, 228}: "PRIVATE", + [3]byte{152, 16, 148}: "Shenzhen Vsun communication technology Co.,ltd", + [3]byte{152, 22, 236}: "IC Intracom", + [3]byte{152, 32, 142}: "Definium Technologies", + [3]byte{152, 38, 42}: "Applied Research Associates, Inc", + [3]byte{152, 41, 29}: "Jaguar de Mexico, SA de CV", + [3]byte{152, 41, 63}: "Fujian Start Computer Equipment Co.,Ltd", + [3]byte{152, 44, 190}: "2Wire", + [3]byte{152, 45, 86}: "Resolution Audio", + [3]byte{152, 47, 60}: "Sichuan Changhong Electric Ltd.", + [3]byte{152, 48, 0}: "Beijing KEMACOM Technologies Co., Ltd.", + [3]byte{152, 48, 113}: "DAIKYUNG VASCOM", + [3]byte{152, 52, 157}: "Krauss Maffei Technologies GmbH", + [3]byte{152, 53, 113}: "Sub10 Systems Ltd", + [3]byte{152, 53, 184}: "Assembled Products Corporation", + [3]byte{152, 55, 19}: "PT.Navicom Indonesia", + [3]byte{152, 59, 22}: "AMPAK Technology Inc", + [3]byte{152, 63, 159}: "China SSJ (Suzhou) Network Technology Inc.", + [3]byte{152, 66, 70}: "SOL INDUSTRY PTE., LTD", + [3]byte{152, 67, 218}: "INTERTECH", + [3]byte{152, 71, 60}: "SHANGHAI SUNMON COMMUNICATION TECHNOGY CO.,LTD", + [3]byte{152, 74, 71}: "CHG Hospital Beds", + [3]byte{152, 75, 74}: "ARRIS Group, Inc.", + [3]byte{152, 75, 225}: "Hewlett-Packard Company", + [3]byte{152, 76, 4}: "Zhangzhou Keneng Electrical Equipment Co Ltd", + [3]byte{152, 76, 211}: "Mantis Deposition", + [3]byte{152, 78, 151}: "Starlight Marketing (H. K.) Ltd.", + [3]byte{152, 79, 238}: "Intel Corporate", + [3]byte{152, 82, 177}: "Samsung Electronics", + [3]byte{152, 87, 211}: "HON HAI-CCPBG PRECISION IND.CO.,LTD.", + [3]byte{152, 88, 138}: "SYSGRATION Ltd.", + [3]byte{152, 89, 69}: "Texas Instruments", + [3]byte{152, 92, 147}: "SBG Systems SAS", + [3]byte{152, 93, 70}: "PeopleNet Communication", + [3]byte{152, 94, 27}: "ConversDigital Co., Ltd.", + [3]byte{152, 96, 34}: "EMW Co., Ltd.", + [3]byte{152, 102, 234}: "Industrial Control Communications, Inc.", + [3]byte{152, 107, 61}: "ARRIS Group, Inc.", + [3]byte{152, 108, 245}: "zte corporation", + [3]byte{152, 109, 200}: "TOSHIBA MITSUBISHI-ELECTRIC INDUSTRIAL SYSTEMS CORPORATION", + [3]byte{152, 115, 196}: "Sage Electronic Engineering LLC", + [3]byte{152, 118, 182}: "Adafruit", + [3]byte{152, 119, 112}: "Pep Digital Technology (Guangzhou) Co., Ltd", + [3]byte{152, 126, 70}: "Emizon Networks Limited", + [3]byte{152, 130, 23}: "Disruptive Ltd", + [3]byte{152, 134, 177}: "Flyaudio corporation (China)", + [3]byte{152, 137, 237}: "Anadem Information Inc.", + [3]byte{152, 139, 93}: "SAGEM COMMUNICATION", + [3]byte{152, 139, 173}: "Corintech Ltd.", + [3]byte{152, 142, 52}: "ZHEJIANG BOXSAM ELECTRONIC CO.,LTD", + [3]byte{152, 142, 74}: "NOXUS(BEIJING) TECHNOLOGY CO.,LTD", + [3]byte{152, 142, 221}: "TE Connectivity Limerick", + [3]byte{152, 144, 128}: "Linkpower Network System Inc Ltd.", + [3]byte{152, 144, 150}: "Dell Inc", + [3]byte{152, 147, 204}: "LG Electronics Inc.", + [3]byte{152, 148, 73}: "Skyworth Wireless Technology Ltd.", + [3]byte{152, 167, 176}: "MCST ZAO", + [3]byte{152, 170, 215}: "BLUE WAVE NETWORKING CO LTD", + [3]byte{152, 176, 57}: "Alcatel-Lucent", + [3]byte{152, 184, 227}: "Apple", + [3]byte{152, 188, 87}: "SVA TECHNOLOGIES CO.LTD", + [3]byte{152, 188, 153}: "Edeltech Co.,Ltd.", + [3]byte{152, 190, 148}: "IBM", + [3]byte{152, 192, 235}: "Global Regency Ltd", + [3]byte{152, 200, 69}: "PacketAccess", + [3]byte{152, 205, 180}: "Virident Systems, Inc.", + [3]byte{152, 211, 49}: "Shenzhen Bolutek Technology Co.,Ltd.", + [3]byte{152, 214, 134}: "Chyi Lee industry Co., ltd.", + [3]byte{152, 214, 187}: "Apple", + [3]byte{152, 214, 247}: "LG Electronics", + [3]byte{152, 216, 140}: "Nortel Networks", + [3]byte{152, 218, 146}: "Vuzix Corporation", + [3]byte{152, 220, 217}: "UNITEC Co., Ltd.", + [3]byte{152, 225, 101}: "Accutome", + [3]byte{152, 231, 154}: "Foxconn(NanJing) Communication Co.,Ltd.", + [3]byte{152, 236, 101}: "Cosesy ApS", + [3]byte{152, 240, 171}: "Apple", + [3]byte{152, 241, 112}: "Murata Manufacturing Co., Ltd.", + [3]byte{152, 245, 55}: "zte corporation", + [3]byte{152, 248, 193}: "IDT Technology Limited", + [3]byte{152, 248, 219}: "Marini Impianti Industriali s.r.l.", + [3]byte{152, 250, 227}: "Xiaomi inc.", + [3]byte{152, 251, 18}: "Grand Electronics (HK) Ltd", + [3]byte{152, 252, 17}: "Cisco-Linksys, LLC", + [3]byte{152, 254, 3}: "Ericsson - North America", + [3]byte{152, 254, 148}: "Apple", + [3]byte{152, 255, 106}: "OTEC(Shanghai)Technology Co.,Ltd.", + [3]byte{152, 255, 208}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{156, 1, 17}: "Shenzhen Newabel Electronic Co., Ltd.", + [3]byte{156, 2, 152}: "Samsung Electronics Co.,Ltd", + [3]byte{156, 3, 158}: "Beijing Winchannel Software Technology Co., Ltd", + [3]byte{156, 4, 115}: "Tecmobile (International) Ltd.", + [3]byte{156, 4, 235}: "Apple", + [3]byte{156, 6, 110}: "Hytera Communications Corporation Limited", + [3]byte{156, 13, 172}: "Tymphany HK Limited", + [3]byte{156, 20, 101}: "Edata Elektronik San. ve Tic. A.Åž.", + [3]byte{156, 24, 116}: "Nokia Danmark A/S", + [3]byte{156, 28, 18}: "Aruba Networks", + [3]byte{156, 31, 221}: "Accupix Inc.", + [3]byte{156, 32, 123}: "Apple", + [3]byte{156, 33, 106}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{156, 34, 14}: "TASCAN Service GmbH", + [3]byte{156, 40, 64}: "Discovery Technology,LTD..", + [3]byte{156, 40, 191}: "Continental Automotive Czech Republic s.r.o.", + [3]byte{156, 40, 239}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{156, 42, 112}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{156, 49, 120}: "Foshan Huadian Intelligent Communications Teachnologies Co.,Ltd", + [3]byte{156, 49, 182}: "Kulite Semiconductor Products Inc", + [3]byte{156, 53, 131}: "Nipro Diagnostics, Inc", + [3]byte{156, 58, 175}: "Samsung Electronics Co.,Ltd", + [3]byte{156, 62, 170}: "EnvyLogic Co.,Ltd.", + [3]byte{156, 65, 124}: "Hame Technology Co., Limited", + [3]byte{156, 68, 61}: "CHENGDU XUGUANG TECHNOLOGY CO, LTD", + [3]byte{156, 68, 166}: "SwiftTest, Inc.", + [3]byte{156, 69, 99}: "DIMEP Sistemas", + [3]byte{156, 74, 123}: "Nokia Corporation", + [3]byte{156, 76, 174}: "Mesa Labs", + [3]byte{156, 78, 32}: "CISCO SYSTEMS, INC.", + [3]byte{156, 78, 54}: "Intel Corporate", + [3]byte{156, 78, 142}: "ALT Systems Ltd", + [3]byte{156, 78, 191}: "BoxCast", + [3]byte{156, 83, 205}: "ENGICAM s.r.l.", + [3]byte{156, 84, 28}: "Shenzhen My-power Technology Co.,Ltd", + [3]byte{156, 84, 202}: "Zhengzhou VCOM Science and Technology Co.,Ltd", + [3]byte{156, 85, 180}: "I.S.E. S.r.l.", + [3]byte{156, 87, 17}: "Feitian Xunda(Beijing) Aeronautical Information Technology Co., Ltd.", + [3]byte{156, 91, 150}: "NMR Corporation", + [3]byte{156, 92, 141}: "FIREMAX INDÚSTRIA E COMÉRCIO DE PRODUTOS ELETRÔNICOS LTDA", + [3]byte{156, 93, 18}: "Aerohive Networks Inc", + [3]byte{156, 93, 149}: "VTC Electronics Corp.", + [3]byte{156, 94, 115}: "Calibre UK Ltd", + [3]byte{156, 97, 29}: "Omni-ID USA, Inc.", + [3]byte{156, 100, 94}: "Harman Consumer Group", + [3]byte{156, 101, 176}: "Samsung Electronics Co.,Ltd", + [3]byte{156, 101, 249}: "AcSiP Technology Corp.", + [3]byte{156, 102, 80}: "Glodio Technolies Co.,Ltd Tianjin Branch", + [3]byte{156, 106, 190}: "QEES ApS.", + [3]byte{156, 117, 20}: "Wildix srl", + [3]byte{156, 119, 170}: "NADASNV", + [3]byte{156, 121, 172}: "Suntec Software(Shanghai) Co., Ltd.", + [3]byte{156, 123, 210}: "NEOLAB Convergence", + [3]byte{156, 128, 125}: "SYSCABLE Korea Inc.", + [3]byte{156, 128, 223}: "Arcadyan Technology Corporation", + [3]byte{156, 134, 218}: "Phoenix Geophysics Ltd.", + [3]byte{156, 136, 136}: "Simac Techniek NV", + [3]byte{156, 139, 241}: "The Warehouse Limited", + [3]byte{156, 141, 26}: "INTEG process group inc", + [3]byte{156, 142, 153}: "Hewlett-Packard Company", + [3]byte{156, 142, 220}: "Teracom Limited", + [3]byte{156, 147, 78}: "Xerox Corporation", + [3]byte{156, 147, 228}: "PRIVATE", + [3]byte{156, 149, 248}: "SmartDoor Systems, LLC", + [3]byte{156, 151, 38}: "Technicolor", + [3]byte{156, 152, 17}: "Guangzhou Sunrise Electronics Development Co., Ltd", + [3]byte{156, 156, 29}: "Starkey Labs Inc.", + [3]byte{156, 161, 10}: "SCLE SFE", + [3]byte{156, 161, 52}: "Nike, Inc.", + [3]byte{156, 163, 186}: "SAKURA Internet Inc.", + [3]byte{156, 165, 119}: "Osorno Enterprises Inc.", + [3]byte{156, 169, 228}: "zte corporation", + [3]byte{156, 173, 151}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{156, 173, 239}: "Obihai Technology, Inc.", + [3]byte{156, 175, 202}: "CISCO SYSTEMS, INC.", + [3]byte{156, 176, 8}: "Ubiquitous Computing Technology Corporation", + [3]byte{156, 178, 6}: "PROCENTEC", + [3]byte{156, 182, 84}: "Hewlett Packard", + [3]byte{156, 183, 13}: "Liteon Technology Corporation", + [3]byte{156, 183, 147}: "Creatcomm Technology Inc.", + [3]byte{156, 187, 152}: "Shen Zhen RND Electronic Co.,LTD", + [3]byte{156, 189, 157}: "SkyDisk, Inc.", + [3]byte{156, 192, 119}: "PrintCounts, LLC", + [3]byte{156, 192, 210}: "Conductix-Wampfler AG", + [3]byte{156, 193, 114}: "Huawei Technologies Co., Ltd", + [3]byte{156, 199, 166}: "AVM GmbH", + [3]byte{156, 199, 209}: "SHARP Corporation", + [3]byte{156, 202, 217}: "Nokia Corporation", + [3]byte{156, 205, 130}: "CHENG UEI PRECISION INDUSTRY CO.,LTD", + [3]byte{156, 210, 30}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{156, 210, 75}: "zte corporation", + [3]byte{156, 211, 109}: "NETGEAR INC.,", + [3]byte{156, 214, 67}: "D-Link International", + [3]byte{156, 217, 23}: "Motorola Mobility LLC", + [3]byte{156, 223, 3}: "Harman/Becker Automotive Systems GmbH", + [3]byte{156, 225, 14}: "NCTech Ltd", + [3]byte{156, 225, 214}: "Junger Audio-Studiotechnik GmbH", + [3]byte{156, 230, 53}: "Nintendo Co., Ltd.", + [3]byte{156, 230, 231}: "Samsung Electronics Co.,Ltd", + [3]byte{156, 231, 189}: "Winduskorea co., Ltd", + [3]byte{156, 235, 232}: "BizLink (Kunshan) Co.,Ltd", + [3]byte{156, 246, 26}: "UTC Fire and Security", + [3]byte{156, 246, 125}: "Ricardo Prague, s.r.o.", + [3]byte{156, 248, 219}: "shenzhen eyunmei technology co,.ltd", + [3]byte{156, 249, 56}: "AREVA NP GmbH", + [3]byte{156, 251, 241}: "MESOMATIC GmbH & Co.KG", + [3]byte{156, 255, 190}: "OTSL Inc.", + [3]byte{160, 2, 220}: "Amazon Technologies Inc.", + [3]byte{160, 3, 99}: "Robert Bosch Healthcare GmbH", + [3]byte{160, 6, 39}: "NEXPA System", + [3]byte{160, 7, 152}: "Samsung Electronics", + [3]byte{160, 7, 182}: "Advanced Technical Support, Inc.", + [3]byte{160, 10, 191}: "Wieson Technologies Co., Ltd.", + [3]byte{160, 11, 186}: "SAMSUNG ELECTRO-MECHANICS", + [3]byte{160, 12, 161}: "SKTB SKiT", + [3]byte{160, 18, 144}: "Avaya, Inc", + [3]byte{160, 18, 219}: "TABUCHI ELECTRIC CO.,LTD", + [3]byte{160, 19, 59}: "Copyright © HiTi Digital, Inc.", + [3]byte{160, 20, 61}: "PARROT SA", + [3]byte{160, 22, 92}: "Triteka LTD", + [3]byte{160, 24, 89}: "Shenzhen Yidashi Electronics Co Ltd", + [3]byte{160, 25, 23}: "Bertel S.p.a.", + [3]byte{160, 28, 5}: "NIMAX TELECOM CO.,LTD.", + [3]byte{160, 29, 72}: "Hewlett Packard", + [3]byte{160, 33, 149}: "Samsung Electronics Digital Imaging", + [3]byte{160, 33, 183}: "NETGEAR", + [3]byte{160, 35, 27}: "TeleComp R&D Corp.", + [3]byte{160, 43, 184}: "Hewlett Packard", + [3]byte{160, 46, 243}: "United Integrated Services Co., Led.", + [3]byte{160, 54, 159}: "Intel Corporate", + [3]byte{160, 54, 240}: "Comprehensive Power", + [3]byte{160, 54, 250}: "Ettus Research LLC", + [3]byte{160, 58, 117}: "PSS Belgium N.V.", + [3]byte{160, 59, 27}: "Inspire Tech", + [3]byte{160, 64, 37}: "Actioncable, Inc.", + [3]byte{160, 64, 65}: "SAMWONFA Co.,Ltd.", + [3]byte{160, 65, 167}: "NL Ministry of Defense", + [3]byte{160, 66, 63}: "Tyan Computer Corp", + [3]byte{160, 72, 28}: "Hewlett Packard", + [3]byte{160, 76, 193}: "Helixtech Corp.", + [3]byte{160, 78, 4}: "Nokia Corporation", + [3]byte{160, 81, 198}: "Avaya, Inc", + [3]byte{160, 85, 222}: "Pace plc", + [3]byte{160, 86, 178}: "Harman/Becker Automotive Systems GmbH", + [3]byte{160, 89, 58}: "V.D.S. Video Display Systems srl", + [3]byte{160, 90, 164}: "Grand Products Nevada, Inc.", + [3]byte{160, 91, 33}: "ENVINET GmbH", + [3]byte{160, 93, 193}: "TMCT Co., LTD.", + [3]byte{160, 93, 231}: "DIRECTV, Inc.", + [3]byte{160, 94, 107}: "MELPER Co., Ltd.", + [3]byte{160, 101, 24}: "VNPT TECHNOLOGY", + [3]byte{160, 103, 190}: "Sicon s.r.l.", + [3]byte{160, 105, 134}: "Wellav Technologies Ltd", + [3]byte{160, 106, 0}: "Verilink Corporation", + [3]byte{160, 108, 236}: "RIM", + [3]byte{160, 109, 9}: "Intelcan Technosystems Inc.", + [3]byte{160, 110, 80}: "Nanotek Elektronik Sistemler Ltd. Sti.", + [3]byte{160, 113, 169}: "Nokia Corporation", + [3]byte{160, 115, 50}: "Cashmaster International Limited", + [3]byte{160, 115, 252}: "Rancore Technologies Private Limited", + [3]byte{160, 117, 145}: "Samsung Electronics Co.,Ltd", + [3]byte{160, 119, 113}: "Vialis BV", + [3]byte{160, 120, 186}: "Pantech Co., Ltd.", + [3]byte{160, 130, 31}: "Samsung Electronics Co.,Ltd", + [3]byte{160, 130, 199}: "P.T.I Co.,LTD", + [3]byte{160, 134, 29}: "Chengdu Fuhuaxin Technology co.,Ltd", + [3]byte{160, 134, 236}: "SAEHAN HITEC Co., Ltd", + [3]byte{160, 136, 105}: "Intel Corporate", + [3]byte{160, 136, 180}: "Intel Corporate", + [3]byte{160, 137, 228}: "Skyworth Digital Technology(Shenzhen) Co.,Ltd", + [3]byte{160, 138, 135}: "HuiZhou KaiYue Electronic Co.,Ltd", + [3]byte{160, 140, 21}: "Gerhard D. Wempe KG", + [3]byte{160, 140, 155}: "Xtreme Technologies Corp", + [3]byte{160, 144, 222}: "VEEDIMS,LLC", + [3]byte{160, 147, 71}: "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD.", + [3]byte{160, 152, 5}: "OpenVox Communication Co Ltd", + [3]byte{160, 152, 237}: "Shandong Intelligent Optical Communication Development Co., Ltd.", + [3]byte{160, 154, 90}: "Time Domain", + [3]byte{160, 155, 189}: "Total Aviation Solutions Pty Ltd", + [3]byte{160, 161, 48}: "DLI Taiwan Branch office", + [3]byte{160, 162, 60}: "GPMS", + [3]byte{160, 163, 226}: "Actiontec Electronics, Inc", + [3]byte{160, 167, 99}: "Polytron Vertrieb GmbH", + [3]byte{160, 168, 205}: "Intel Corporate", + [3]byte{160, 170, 253}: "EraThink Technologies Corp.", + [3]byte{160, 177, 0}: "ShenZhen Cando Electronics Co.,Ltd", + [3]byte{160, 179, 204}: "Hewlett Packard", + [3]byte{160, 180, 165}: "Samsung Elec Co.,Ltd", + [3]byte{160, 181, 218}: "HongKong THTF Co., Ltd", + [3]byte{160, 182, 98}: "Acutvista Innovation Co., Ltd.", + [3]byte{160, 185, 237}: "Skytap", + [3]byte{160, 186, 184}: "Pixon Imaging", + [3]byte{160, 191, 80}: "S.C. ADD-PRODUCTION S.R.L.", + [3]byte{160, 191, 165}: "CORESYS", + [3]byte{160, 195, 222}: "Triton Electronic Systems Ltd.", + [3]byte{160, 198, 236}: "ShenZhen ANYK Technology Co.,LTD", + [3]byte{160, 206, 200}: "CE LINK LIMITED", + [3]byte{160, 207, 91}: "CISCO SYSTEMS, INC.", + [3]byte{160, 209, 42}: "AXPRO Technology Inc.", + [3]byte{160, 211, 193}: "Hewlett Packard", + [3]byte{160, 218, 146}: "Nanjing Glarun Atten Technology Co. Ltd.", + [3]byte{160, 220, 4}: "Becker-Antriebe GmbH", + [3]byte{160, 221, 151}: "PolarLink Technologies, Ltd", + [3]byte{160, 221, 229}: "SHARP Corporation", + [3]byte{160, 222, 5}: "JSC \"Irbis-T\"", + [3]byte{160, 226, 1}: "AVTrace Ltd.(China)", + [3]byte{160, 226, 90}: "Amicus SK, s.r.o.", + [3]byte{160, 226, 149}: "DAT System Co.,Ltd", + [3]byte{160, 228, 83}: "Sony Mobile Communications AB", + [3]byte{160, 229, 52}: "Stratec Biomedical AG", + [3]byte{160, 229, 233}: "enimai Inc", + [3]byte{160, 230, 248}: "Texas Instruments Inc", + [3]byte{160, 233, 219}: "Ningbo FreeWings Technologies Co.,Ltd", + [3]byte{160, 235, 118}: "AirCUVE Inc.", + [3]byte{160, 236, 128}: "zte corporation", + [3]byte{160, 237, 205}: "Apple", + [3]byte{160, 239, 132}: "Seine Image Int'l Co., Ltd", + [3]byte{160, 242, 23}: "GE Medical System(China) Co., Ltd.", + [3]byte{160, 243, 193}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{160, 243, 228}: "Alcatel Lucent IPD", + [3]byte{160, 244, 25}: "Nokia Corporation", + [3]byte{160, 244, 80}: "HTC Corporation", + [3]byte{160, 244, 89}: "FN-LINK TECHNOLOGY LIMITED", + [3]byte{160, 252, 110}: "Telegrafia a.s.", + [3]byte{160, 254, 145}: "AVAT Automation GmbH", + [3]byte{164, 1, 48}: "ABIsystems Co., LTD", + [3]byte{164, 5, 158}: "STA Infinity LLP", + [3]byte{164, 9, 203}: "Alfred Kaercher GmbH & Co KG", + [3]byte{164, 11, 237}: "Carry Technology Co.,Ltd", + [3]byte{164, 12, 195}: "CISCO SYSTEMS, INC.", + [3]byte{164, 18, 66}: "NEC Platforms, Ltd.", + [3]byte{164, 19, 78}: "Luxul", + [3]byte{164, 21, 102}: "Wei Fang Goertek Electronics Co.,Ltd", + [3]byte{164, 23, 49}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{164, 24, 117}: "CISCO SYSTEMS, INC.", + [3]byte{164, 27, 192}: "Fastec Imaging Corporation", + [3]byte{164, 31, 114}: "Dell Inc.", + [3]byte{164, 33, 138}: "Nortel Networks", + [3]byte{164, 35, 5}: "Open Networking Laboratory", + [3]byte{164, 36, 179}: "FlatFrog Laboratories AB", + [3]byte{164, 37, 27}: "Avaya, Inc", + [3]byte{164, 41, 64}: "Shenzhen YOUHUA Technology Co., Ltd", + [3]byte{164, 41, 183}: "bluesky", + [3]byte{164, 44, 8}: "Masterwork Automodules", + [3]byte{164, 51, 209}: "Fibrlink Communications Co.,Ltd.", + [3]byte{164, 56, 252}: "Plastic Logic", + [3]byte{164, 58, 105}: "Vers Inc", + [3]byte{164, 59, 250}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{164, 61, 120}: "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD", + [3]byte{164, 70, 107}: "EOC Technology", + [3]byte{164, 70, 250}: "AmTRAN Video Corporation", + [3]byte{164, 74, 211}: "ST Electronics(Shanghai) Co.,Ltd", + [3]byte{164, 75, 21}: "Sun Cupid Technology (HK) LTD", + [3]byte{164, 76, 17}: "CISCO SYSTEMS, INC.", + [3]byte{164, 78, 45}: "Adaptive Wireless Solutions, LLC", + [3]byte{164, 78, 49}: "Intel Corporate", + [3]byte{164, 80, 85}: "busware.de", + [3]byte{164, 82, 111}: "ADB Broadband Italia", + [3]byte{164, 86, 27}: "MCOT Corporation", + [3]byte{164, 86, 48}: "CISCO SYSTEMS, INC.", + [3]byte{164, 90, 28}: "smart-electronic GmbH", + [3]byte{164, 92, 39}: "Nintendo Co., Ltd.", + [3]byte{164, 93, 54}: "Hewlett Packard", + [3]byte{164, 93, 161}: "ADB Broadband Italia", + [3]byte{164, 96, 50}: "MRV Communications (Networks) LTD", + [3]byte{164, 103, 6}: "Apple", + [3]byte{164, 108, 193}: "LTi REEnergy GmbH", + [3]byte{164, 110, 121}: "DFT System Co.Ltd", + [3]byte{164, 112, 214}: "Motorola Mobility LLC", + [3]byte{164, 119, 51}: "Google", + [3]byte{164, 119, 96}: "Nokia Corporation", + [3]byte{164, 121, 228}: "KLINFO Corp", + [3]byte{164, 122, 164}: "ARRIS Group, Inc.", + [3]byte{164, 122, 207}: "VIBICOM COMMUNICATIONS INC.", + [3]byte{164, 124, 20}: "ChargeStorm AB", + [3]byte{164, 124, 31}: "Cobham plc", + [3]byte{164, 126, 57}: "zte corporation", + [3]byte{164, 129, 238}: "Nokia Corporation", + [3]byte{164, 133, 107}: "Q Electronics Ltd", + [3]byte{164, 137, 91}: "ARK INFOSOLUTIONS PVT LTD", + [3]byte{164, 144, 5}: "CHINA GREATWALL COMPUTER SHENZHEN CO.,LTD", + [3]byte{164, 147, 76}: "CISCO SYSTEMS, INC.", + [3]byte{164, 151, 187}: "Hitachi Industrial Equipment Systems Co.,Ltd", + [3]byte{164, 153, 71}: "Huawei Technologies Co., Ltd", + [3]byte{164, 153, 129}: "FuJian Elite Power Tech CO.,LTD.", + [3]byte{164, 154, 88}: "Samsung Electronics Co.,Ltd", + [3]byte{164, 155, 19}: "Burroughs Payment Systems, Inc.", + [3]byte{164, 157, 73}: "Ketra, Inc.", + [3]byte{164, 158, 219}: "AutoCrib, Inc.", + [3]byte{164, 159, 133}: "Lyve Minds, Inc", + [3]byte{164, 159, 137}: "Shanghai Rui Rui Communication Technology Co.Ltd.", + [3]byte{164, 161, 194}: "Ericsson AB (EAB)", + [3]byte{164, 162, 74}: "Cisco SPVTG", + [3]byte{164, 164, 211}: "Bluebank Communication Technology Co.Ltd", + [3]byte{164, 168, 15}: "Shenzhen Coship Electronics Co., Ltd.", + [3]byte{164, 173, 0}: "Ragsdale Technology", + [3]byte{164, 173, 184}: "Vitec Group, Camera Dynamics Ltd", + [3]byte{164, 174, 154}: "Maestro Wireless Solutions ltd.", + [3]byte{164, 177, 33}: "Arantia 2010 S.L.", + [3]byte{164, 177, 151}: "Apple", + [3]byte{164, 177, 233}: "Technicolor", + [3]byte{164, 177, 238}: "H. ZANDER GmbH & Co. KG", + [3]byte{164, 178, 167}: "Adaxys Solutions AG", + [3]byte{164, 179, 106}: "JSC SDO Chromatec", + [3]byte{164, 184, 24}: "PENTA Gesellschaft für elektronische Industriedatenverarbeitung mbH", + [3]byte{164, 185, 128}: "Parking BOXX Inc.", + [3]byte{164, 186, 219}: "Dell Inc.", + [3]byte{164, 187, 175}: "Lime Instruments", + [3]byte{164, 190, 97}: "EutroVision System, Inc.", + [3]byte{164, 192, 199}: "ShenZhen Hitom Communication Technology Co..LTD", + [3]byte{164, 192, 225}: "Nintendo Co., Ltd.", + [3]byte{164, 194, 171}: "Hangzhou LEAD-IT Information & Technology Co.,Ltd", + [3]byte{164, 195, 97}: "Apple", + [3]byte{164, 199, 222}: "Cambridge Industries(Group) Co.,Ltd.", + [3]byte{164, 208, 148}: "Erwin Peters Systemtechnik GmbH", + [3]byte{164, 209, 143}: "Shenzhen Skyee Optical Fiber Communication Technology Ltd.", + [3]byte{164, 209, 209}: "ECOtality North America", + [3]byte{164, 209, 210}: "Apple", + [3]byte{164, 211, 181}: "GLITEL Stropkov, s.r.o.", + [3]byte{164, 216, 86}: "Gimbal, Inc", + [3]byte{164, 218, 63}: "Bionics Corp.", + [3]byte{164, 219, 46}: "Kingspan Environmental Ltd", + [3]byte{164, 219, 48}: "Liteon Technology Corporation", + [3]byte{164, 222, 80}: "Total Walther GmbH", + [3]byte{164, 224, 230}: "FILIZOLA S.A. PESAGEM E AUTOMACAO", + [3]byte{164, 227, 46}: "Silicon & Software Systems Ltd.", + [3]byte{164, 227, 145}: "DENY FONTAINE", + [3]byte{164, 228, 184}: "BlackBerry Limited", + [3]byte{164, 231, 49}: "Nokia Corporation", + [3]byte{164, 231, 228}: "Connex GmbH", + [3]byte{164, 233, 145}: "SISTEMAS AUDIOVISUALES ITELSIS S.L.", + [3]byte{164, 233, 163}: "Honest Technology Co., Ltd", + [3]byte{164, 235, 211}: "Samsung Electronics Co.,Ltd", + [3]byte{164, 237, 78}: "ARRIS Group, Inc.", + [3]byte{164, 238, 87}: "SEIKO EPSON CORPORATION", + [3]byte{164, 239, 82}: "Telewave Co., Ltd.", + [3]byte{164, 243, 193}: "Open Source Robotics Foundation, Inc.", + [3]byte{164, 245, 34}: "CHOFU SEISAKUSHO CO.,LTD", + [3]byte{164, 247, 208}: "LAN Accessories Co., Ltd.", + [3]byte{164, 251, 141}: "Hangzhou Dunchong Technology Co.Ltd", + [3]byte{164, 252, 206}: "Security Expert Ltd.", + [3]byte{168, 1, 128}: "IMAGO Technologies GmbH", + [3]byte{168, 6, 0}: "Samsung Electronics Co.,Ltd", + [3]byte{168, 12, 13}: "Cisco", + [3]byte{168, 19, 116}: "Panasonic Corporation AVC Networks Company", + [3]byte{168, 21, 77}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{168, 22, 178}: "LG Electronics", + [3]byte{168, 23, 88}: "Elektronik System i UmeÃ¥ AB", + [3]byte{168, 27, 24}: "XTS CORP", + [3]byte{168, 27, 93}: "Foxtel Management Pty Ltd", + [3]byte{168, 29, 22}: "AzureWave Technologies, Inc", + [3]byte{168, 31, 175}: "KRYPTON POLSKA", + [3]byte{168, 32, 102}: "Apple", + [3]byte{168, 36, 235}: "ZAO NPO Introtest", + [3]byte{168, 38, 217}: "HTC Corporation", + [3]byte{168, 41, 76}: "Precision Optical Transceivers, Inc.", + [3]byte{168, 43, 214}: "Shina System Co., Ltd", + [3]byte{168, 48, 173}: "Wei Fang Goertek Electronics Co.,Ltd", + [3]byte{168, 50, 154}: "Digicom Futuristic Technologies Ltd.", + [3]byte{168, 57, 68}: "Actiontec Electronics, Inc", + [3]byte{168, 64, 65}: "Dragino Technology Co., Limited", + [3]byte{168, 68, 129}: "Nokia Corporation", + [3]byte{168, 69, 233}: "Firich Enterprises CO., LTD.", + [3]byte{168, 73, 165}: "Lisantech Co., Ltd.", + [3]byte{168, 84, 178}: "Wistron Neweb Corp.", + [3]byte{168, 85, 106}: "Pocketnet Technology Inc.", + [3]byte{168, 87, 78}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{168, 91, 176}: "Shenzhen Dehoo Technology Co.,Ltd", + [3]byte{168, 91, 243}: "Audivo GmbH", + [3]byte{168, 97, 170}: "Cloudview Limited", + [3]byte{168, 98, 162}: "JIWUMEDIA CO., LTD.", + [3]byte{168, 99, 223}: "DISPLAIRE CORPORATION", + [3]byte{168, 99, 242}: "Texas Instruments", + [3]byte{168, 100, 5}: "nimbus 9, Inc", + [3]byte{168, 101, 178}: "DONGGUAN YISHANG ELECTRONIC TECHNOLOGY CO., LIMITED", + [3]byte{168, 106, 111}: "RIM", + [3]byte{168, 112, 165}: "UniComm Inc.", + [3]byte{168, 117, 214}: "FreeTek International Co., Ltd.", + [3]byte{168, 117, 226}: "Aventura Technologies, Inc.", + [3]byte{168, 119, 111}: "Zonoff", + [3]byte{168, 123, 57}: "Nokia Corporation", + [3]byte{168, 124, 1}: "Samsung Elec Co.,Ltd", + [3]byte{168, 126, 51}: "Nokia Danmark A/S", + [3]byte{168, 129, 241}: "BMEYE B.V.", + [3]byte{168, 134, 221}: "Apple, Inc.", + [3]byte{168, 135, 146}: "Broadband Antenna Tracking Systems", + [3]byte{168, 135, 237}: "ARC Wireless LLC", + [3]byte{168, 136, 8}: "Apple", + [3]byte{168, 140, 238}: "MicroMade Galka i Drozdz sp.j.", + [3]byte{168, 141, 123}: "SunDroid Global limited.", + [3]byte{168, 142, 36}: "Apple", + [3]byte{168, 146, 44}: "LG Electronics", + [3]byte{168, 147, 230}: "JIANGXI JINGGANGSHAN CKING COMMUNICATION TECHNOLOGY CO.,LTD", + [3]byte{168, 149, 176}: "Aker Subsea Ltd", + [3]byte{168, 150, 138}: "Apple", + [3]byte{168, 151, 220}: "IBM", + [3]byte{168, 152, 198}: "Shinbo Co., Ltd.", + [3]byte{168, 153, 92}: "aizo ag", + [3]byte{168, 155, 16}: "inMotion Ltd.", + [3]byte{168, 157, 210}: "Shanghai DareGlobal Technologies Co., Ltd", + [3]byte{168, 166, 104}: "zte corporation", + [3]byte{168, 173, 61}: "Alcatel-Lucent Shanghai Bell Co., Ltd", + [3]byte{168, 176, 174}: "LEONI", + [3]byte{168, 177, 212}: "CISCO SYSTEMS, INC.", + [3]byte{168, 185, 179}: "ESSYS", + [3]byte{168, 187, 207}: "Apple", + [3]byte{168, 189, 26}: "Honey Bee (Hong Kong) Limited", + [3]byte{168, 189, 58}: "UNIONMAN TECHNOLOGY CO.,LTD", + [3]byte{168, 194, 34}: "TM-Research Inc.", + [3]byte{168, 203, 149}: "EAST BEST CO., LTD.", + [3]byte{168, 204, 197}: "Saab AB (publ)", + [3]byte{168, 206, 144}: "CVC", + [3]byte{168, 208, 227}: "Systech Electronics Ltd.", + [3]byte{168, 208, 229}: "Juniper Networks", + [3]byte{168, 210, 54}: "Lightware Visual Engineering", + [3]byte{168, 211, 200}: "Wachendorff Elektronik GmbH & Co. KG", + [3]byte{168, 216, 138}: "Wyconn", + [3]byte{168, 224, 24}: "Nokia Corporation", + [3]byte{168, 227, 238}: "Sony Computer Entertainment Inc.", + [3]byte{168, 229, 57}: "Moimstone Co.,Ltd", + [3]byte{168, 239, 38}: "Tritonwave", + [3]byte{168, 242, 116}: "Samsung Electronics", + [3]byte{168, 244, 112}: "Fujian Newland Communication Science Technologies Co.,Ltd.", + [3]byte{168, 247, 224}: "PLANET Technology Corporation", + [3]byte{168, 249, 75}: "Eltex Enterprise Ltd.", + [3]byte{168, 250, 216}: "Apple", + [3]byte{168, 251, 112}: "WiseSec L.t.d", + [3]byte{168, 252, 183}: "Consolidated Resource Imaging", + [3]byte{170, 0, 0}: "DIGITAL EQUIPMENT CORPORATION", + [3]byte{170, 0, 1}: "DIGITAL EQUIPMENT CORPORATION", + [3]byte{170, 0, 2}: "DIGITAL EQUIPMENT CORPORATION", + [3]byte{170, 0, 3}: "DIGITAL EQUIPMENT CORPORATION", + [3]byte{170, 0, 4}: "DIGITAL EQUIPMENT CORPORATION", + [3]byte{172, 1, 66}: "Uriel Technologies SIA", + [3]byte{172, 2, 202}: "HI Solutions, Inc.", + [3]byte{172, 2, 207}: "RW Tecnologia Industria e Comercio Ltda", + [3]byte{172, 2, 239}: "Comsis", + [3]byte{172, 6, 19}: "Senselogix Ltd", + [3]byte{172, 10, 97}: "Labor S.r.L.", + [3]byte{172, 13, 254}: "Ekon GmbH - myGEKKO", + [3]byte{172, 17, 211}: "Suzhou HOTEK Video Technology Co. Ltd", + [3]byte{172, 20, 97}: "ATAW Co., Ltd.", + [3]byte{172, 20, 210}: "wi-daq, inc.", + [3]byte{172, 22, 45}: "Hewlett Packard", + [3]byte{172, 23, 2}: "Fibar Group sp. z o.o.", + [3]byte{172, 24, 38}: "SEIKO EPSON CORPORATION", + [3]byte{172, 25, 159}: "SUNGROW POWER SUPPLY CO.,LTD.", + [3]byte{172, 32, 170}: "DMATEK Co., Ltd.", + [3]byte{172, 34, 11}: "ASUSTek COMPUTER INC.", + [3]byte{172, 45, 163}: "TXTR GmbH", + [3]byte{172, 47, 168}: "Humannix Co.,Ltd.", + [3]byte{172, 49, 157}: "Shenzhen TG-NET Botone Technology Co.,Ltd.", + [3]byte{172, 52, 203}: "Shanhai GBCOM Communication Technology Co. Ltd", + [3]byte{172, 54, 19}: "Samsung Electronics Co.,Ltd", + [3]byte{172, 56, 112}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{172, 58, 122}: "Roku", + [3]byte{172, 60, 11}: "Apple", + [3]byte{172, 60, 180}: "Nilan A/S", + [3]byte{172, 61, 5}: "Instorescreen Aisa", + [3]byte{172, 61, 117}: "HANGZHOU ZHIWAY TECHNOLOGIES CO.,LTD.", + [3]byte{172, 63, 164}: "TAIYO YUDEN CO.,LTD", + [3]byte{172, 64, 234}: "C&T Solution Inc.", + [3]byte{172, 65, 34}: "Eclipse Electronic Systems Inc.", + [3]byte{172, 68, 242}: "Revolabs Inc", + [3]byte{172, 71, 35}: "Genelec", + [3]byte{172, 74, 254}: "Hisense Broadband Multimedia Technology Co.,Ltd.", + [3]byte{172, 75, 200}: "Juniper Networks", + [3]byte{172, 78, 145}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{172, 79, 252}: "SVS-VISTEK GmbH", + [3]byte{172, 80, 54}: "Pi-Coral Inc", + [3]byte{172, 81, 53}: "MPI TECH", + [3]byte{172, 81, 238}: "Cambridge Communication Systems Ltd", + [3]byte{172, 84, 236}: "IEEE P1823 Standards Working Group", + [3]byte{172, 88, 59}: "Human Assembler, Inc.", + [3]byte{172, 93, 16}: "Pace Americas", + [3]byte{172, 94, 140}: "Utillink", + [3]byte{172, 97, 35}: "Drivven, Inc.", + [3]byte{172, 103, 6}: "Ruckus Wireless", + [3]byte{172, 107, 172}: "Jenny Science AG", + [3]byte{172, 110, 26}: "Shenzhen Gongjin Electronics Co.,Ltd", + [3]byte{172, 111, 79}: "Enspert Inc", + [3]byte{172, 111, 187}: "TATUNG Technology Inc.", + [3]byte{172, 111, 217}: "Valueplus Inc.", + [3]byte{172, 114, 54}: "Lexking Technology Co., Ltd.", + [3]byte{172, 114, 137}: "Intel Corporate", + [3]byte{172, 122, 66}: "iConnectivity", + [3]byte{172, 123, 161}: "Intel Corporate", + [3]byte{172, 127, 62}: "Apple", + [3]byte{172, 128, 214}: "Hexatronic AB", + [3]byte{172, 129, 18}: "Gemtek Technology Co., Ltd.", + [3]byte{172, 129, 243}: "Nokia Corporation", + [3]byte{172, 131, 23}: "Shenzhen Furtunetel Communication Co., Ltd", + [3]byte{172, 131, 240}: "ImmediaTV Corporation", + [3]byte{172, 133, 61}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{172, 134, 116}: "Open Mesh, Inc.", + [3]byte{172, 134, 126}: "Create New Technology (HK) Limited Company", + [3]byte{172, 135, 163}: "Apple", + [3]byte{172, 138, 205}: "ROGER D.Wensker, G.Wensker sp.j.", + [3]byte{172, 141, 20}: "Smartrove Inc", + [3]byte{172, 147, 47}: "Nokia Corporation", + [3]byte{172, 148, 3}: "Envision Peripherals Inc", + [3]byte{172, 154, 150}: "Lantiq Deutschland GmbH", + [3]byte{172, 155, 132}: "Smak Tecnologia e Automacao", + [3]byte{172, 156, 228}: "Alcatel-Lucent Shanghai Bell Co., Ltd", + [3]byte{172, 160, 22}: "CISCO SYSTEMS, INC.", + [3]byte{172, 162, 19}: "Shenzhen Bilian electronic CO.,LTD", + [3]byte{172, 162, 44}: "Baycity Technologies Ltd", + [3]byte{172, 163, 30}: "Aruba Networks", + [3]byte{172, 164, 48}: "Peerless AV", + [3]byte{172, 169, 25}: "TrekStor GmbH", + [3]byte{172, 169, 160}: "Audioengine, Ltd.", + [3]byte{172, 171, 141}: "Lyngso Marine A/S", + [3]byte{172, 179, 19}: "ARRIS Group, Inc.", + [3]byte{172, 183, 79}: "METEL s.r.o.", + [3]byte{172, 184, 89}: "Uniband Electronic Corp,", + [3]byte{172, 189, 11}: "IMAC CO.,LTD", + [3]byte{172, 190, 117}: "Ufine Technologies Co.,Ltd.", + [3]byte{172, 190, 182}: "Visualedge Technology Co., Ltd.", + [3]byte{172, 194, 236}: "CLT INT'L IND. CORP.", + [3]byte{172, 197, 149}: "Graphite Systems", + [3]byte{172, 198, 152}: "Kohzu Precision Co., Ltd.", + [3]byte{172, 201, 53}: "Ness Corporation", + [3]byte{172, 202, 84}: "Telldus Technologies AB", + [3]byte{172, 202, 142}: "ODA Technologies", + [3]byte{172, 202, 186}: "Midokura Co., Ltd.", + [3]byte{172, 203, 9}: "Hefcom Metering (Pty) Ltd", + [3]byte{172, 204, 142}: "Axis Communications AB", + [3]byte{172, 206, 143}: "HWA YAO TECHNOLOGIES CO., LTD", + [3]byte{172, 207, 35}: "Hi-flying electronics technology Co.,Ltd", + [3]byte{172, 207, 92}: "Apple", + [3]byte{172, 209, 128}: "Crexendo Business Solutions, Inc.", + [3]byte{172, 211, 100}: "ABB SPA, ABB SACE DIV.", + [3]byte{172, 214, 87}: "Shaanxi Guolian Digital TV Technology Co., Ltd.", + [3]byte{172, 217, 214}: "tci GmbH", + [3]byte{172, 219, 218}: "Shenzhen Geniatech Inc, Ltd", + [3]byte{172, 222, 72}: "PRIVATE", + [3]byte{172, 224, 105}: "ISAAC Instruments", + [3]byte{172, 226, 21}: "Huawei Technologies Co., Ltd", + [3]byte{172, 227, 72}: "MadgeTech, Inc", + [3]byte{172, 228, 46}: "SK hynix", + [3]byte{172, 230, 75}: "Shenzhen Baojia Battery Technology Co., Ltd.", + [3]byte{172, 232, 123}: "Huawei Technologies Co., Ltd", + [3]byte{172, 232, 126}: "Bytemark Computer Consulting Ltd", + [3]byte{172, 233, 127}: "IoT Tech Limited", + [3]byte{172, 233, 170}: "Hay Systems Ltd", + [3]byte{172, 234, 106}: "GENIX INFOCOMM CO., LTD.", + [3]byte{172, 238, 59}: "6harmonics Inc", + [3]byte{172, 240, 178}: "Becker Electronics Taiwan Ltd.", + [3]byte{172, 241, 223}: "D-Link International", + [3]byte{172, 242, 197}: "Cisco", + [3]byte{172, 247, 243}: "XIAOMI CORPORATION", + [3]byte{172, 249, 126}: "ELESYS INC.", + [3]byte{172, 253, 206}: "Intel Corporate", + [3]byte{172, 253, 236}: "Apple, Inc", + [3]byte{176, 0, 180}: "Cisco", + [3]byte{176, 5, 148}: "Liteon Technology Corporation", + [3]byte{176, 9, 211}: "Avizia", + [3]byte{176, 16, 65}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{176, 18, 3}: "Dynamics Hong Kong Limited", + [3]byte{176, 18, 102}: "Futaba-Kikaku", + [3]byte{176, 20, 8}: "LIGHTSPEED INTERNATIONAL CO.", + [3]byte{176, 23, 67}: "EDISON GLOBAL CIRCUITS LLC", + [3]byte{176, 27, 124}: "Ontrol A.S.", + [3]byte{176, 28, 145}: "Elim Co", + [3]byte{176, 31, 129}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{176, 36, 243}: "Progeny Systems", + [3]byte{176, 37, 170}: "PRIVATE", + [3]byte{176, 52, 149}: "Apple", + [3]byte{176, 53, 141}: "Nokia Corporation", + [3]byte{176, 56, 41}: "Siliconware Precision Industries Co., Ltd.", + [3]byte{176, 56, 80}: "Nanjing CAS-ZDC IOT SYSTEM CO.,LTD", + [3]byte{176, 67, 93}: "NuLEDs, Inc.", + [3]byte{176, 69, 21}: "mira fitness,LLC.", + [3]byte{176, 69, 25}: "TCT mobile ltd", + [3]byte{176, 69, 69}: "YACOUB Automation GmbH", + [3]byte{176, 70, 252}: "MitraStar Technology Corp.", + [3]byte{176, 72, 122}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{176, 76, 5}: "Fresenius Medical Care Deutschland GmbH", + [3]byte{176, 80, 188}: "SHENZHEN BASICOM ELECTRONIC CO.,LTD.", + [3]byte{176, 81, 142}: "Holl technology CO.Ltd.", + [3]byte{176, 87, 6}: "Vallox Oy", + [3]byte{176, 88, 196}: "Broadcast Microwave Services, Inc", + [3]byte{176, 91, 31}: "THERMO FISHER SCIENTIFIC S.P.A.", + [3]byte{176, 91, 103}: "Huawei Technologies Co., Ltd", + [3]byte{176, 92, 229}: "Nokia Corporation", + [3]byte{176, 97, 199}: "Ericsson-LG Enterprise", + [3]byte{176, 101, 99}: "Shanghai Railway Communication Factory", + [3]byte{176, 101, 189}: "Apple", + [3]byte{176, 104, 182}: "Hangzhou OYE Technology Co. Ltd", + [3]byte{176, 105, 113}: "DEI Sales, Inc.", + [3]byte{176, 108, 191}: "3ality Digital Systems GmbH", + [3]byte{176, 117, 12}: "QA Cafe", + [3]byte{176, 117, 77}: "Alcatel-Lucent", + [3]byte{176, 117, 213}: "ZTE Corporation", + [3]byte{176, 119, 172}: "ARRIS Group, Inc.", + [3]byte{176, 121, 8}: "Cummings Engineering", + [3]byte{176, 121, 60}: "Revolv Inc", + [3]byte{176, 121, 148}: "Motorola Mobility LLC", + [3]byte{176, 125, 98}: "Dipl.-Ing. H. Horstmann GmbH", + [3]byte{176, 128, 140}: "Laser Light Engines", + [3]byte{176, 129, 216}: "I-sys Corp", + [3]byte{176, 131, 254}: "Dell Inc", + [3]byte{176, 134, 158}: "Chloride S.r.L", + [3]byte{176, 136, 7}: "Strata Worldwide", + [3]byte{176, 137, 145}: "LGE", + [3]byte{176, 142, 26}: "URadio Systems Co., Ltd", + [3]byte{176, 144, 116}: "Fulan Electronics Limited", + [3]byte{176, 145, 52}: "Taleo", + [3]byte{176, 145, 55}: "ISis ImageStream Internet Solutions, Inc", + [3]byte{176, 151, 58}: "E-Fuel Corporation", + [3]byte{176, 152, 159}: "LG CNS", + [3]byte{176, 153, 40}: "Fujitsu Limited", + [3]byte{176, 154, 226}: "STEMMER IMAGING GmbH", + [3]byte{176, 155, 212}: "GNH Software India Private Limited", + [3]byte{176, 159, 186}: "Apple", + [3]byte{176, 161, 10}: "Pivotal Systems Corporation", + [3]byte{176, 163, 126}: "Qingdao Haier Electronics Co.,Ltd", + [3]byte{176, 167, 42}: "Ensemble Designs, Inc.", + [3]byte{176, 167, 55}: "Roku, Inc.", + [3]byte{176, 168, 110}: "Juniper Networks", + [3]byte{176, 170, 54}: "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD.", + [3]byte{176, 172, 250}: "Fujitsu Limited", + [3]byte{176, 173, 170}: "Avaya, Inc", + [3]byte{176, 178, 220}: "Zyxel Communications Corporation", + [3]byte{176, 179, 43}: "Slican Sp. z o.o.", + [3]byte{176, 180, 72}: "Texas Instruments", + [3]byte{176, 184, 213}: "Nanjing Nengrui Auto Equipment CO.,Ltd", + [3]byte{176, 189, 109}: "Echostreams Innovative Solutions", + [3]byte{176, 189, 161}: "ZAKLAD ELEKTRONICZNY SIMS", + [3]byte{176, 191, 153}: "WIZITDONGDO", + [3]byte{176, 196, 231}: "Samsung Electronics", + [3]byte{176, 197, 84}: "D-Link International", + [3]byte{176, 198, 154}: "Juniper Networks", + [3]byte{176, 199, 69}: "Buffalo Inc.", + [3]byte{176, 200, 63}: "Jiangsu Cynray IOT Co., Ltd.", + [3]byte{176, 200, 173}: "People Power Company", + [3]byte{176, 201, 91}: "Beijing Symtech CO.,LTD", + [3]byte{176, 206, 24}: "Zhejiang shenghui lighting co.,Ltd", + [3]byte{176, 207, 77}: "MI-Zone Technology Ireland", + [3]byte{176, 208, 156}: "Samsung Electronics Co.,Ltd", + [3]byte{176, 210, 245}: "Vello Systems, Inc.", + [3]byte{176, 213, 157}: "Shenzhen Zowee Technology Co., Ltd", + [3]byte{176, 215, 197}: "STP KFT", + [3]byte{176, 218, 0}: "CERA ELECTRONIQUE", + [3]byte{176, 223, 58}: "Samsung Electronics Co.,Ltd", + [3]byte{176, 227, 157}: "CAT SYSTEM CO.,LTD.", + [3]byte{176, 229, 14}: "NRG SYSTEMS INC", + [3]byte{176, 231, 84}: "2Wire", + [3]byte{176, 232, 146}: "SEIKO EPSON CORPORATION", + [3]byte{176, 233, 126}: "Advanced Micro Peripherals", + [3]byte{176, 236, 113}: "Samsung Electronics Co.,Ltd", + [3]byte{176, 236, 143}: "GMX SAS", + [3]byte{176, 238, 69}: "AzureWave Technologies, Inc.", + [3]byte{176, 241, 188}: "Dhemax Ingenieros Ltda", + [3]byte{176, 250, 235}: "Cisco", + [3]byte{176, 254, 189}: "PRIVATE", + [3]byte{180, 0, 156}: "CableWorld Ltd.", + [3]byte{180, 1, 66}: "GCI Science & Technology Co.,LTD", + [3]byte{180, 4, 24}: "Smartchip Integrated Inc.", + [3]byte{180, 7, 249}: "SAMSUNG ELECTRO-MECHANICS", + [3]byte{180, 8, 50}: "TC Communications", + [3]byte{180, 10, 198}: "DEXON Systems Ltd.", + [3]byte{180, 11, 68}: "Smartisan Technology Co., Ltd.", + [3]byte{180, 11, 122}: "Brusa Elektronik AG", + [3]byte{180, 12, 37}: "Palo Alto Networks", + [3]byte{180, 14, 150}: "HERAN", + [3]byte{180, 14, 220}: "LG-Ericsson Co.,Ltd.", + [3]byte{180, 20, 137}: "CISCO SYSTEMS, INC.", + [3]byte{180, 21, 19}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{180, 23, 128}: "DTI Group Ltd", + [3]byte{180, 24, 209}: "Apple", + [3]byte{180, 29, 239}: "Internet Laboratories, Inc.", + [3]byte{180, 33, 29}: "Beijing GuangXin Technology Co., Ltd", + [3]byte{180, 33, 138}: "Dog Hunter LLC", + [3]byte{180, 36, 231}: "Codetek Technology Co.,Ltd", + [3]byte{180, 40, 241}: "E-Prime Co., Ltd.", + [3]byte{180, 42, 57}: "ORBIT MERRET, spol. s r. o.", + [3]byte{180, 44, 146}: "Zhejiang Weirong Electronic Co., Ltd", + [3]byte{180, 44, 190}: "Direct Payment Solutions Limited", + [3]byte{180, 49, 184}: "Aviwest", + [3]byte{180, 52, 108}: "MATSUNICHI DIGITAL TECHNOLOGY (HONG KONG) LIMITED", + [3]byte{180, 53, 100}: "Fujian Tian Cheng Electron Science & Technical Development Co.,Ltd.", + [3]byte{180, 53, 247}: "Zhejiang Pearmain Electronics Co.ltd.", + [3]byte{180, 55, 65}: "Consert, Inc.", + [3]byte{180, 57, 52}: "Pen Generations, Inc.", + [3]byte{180, 57, 214}: "ProCurve Networking by HP", + [3]byte{180, 58, 40}: "Samsung Electronics Co.,Ltd", + [3]byte{180, 61, 178}: "Degreane Horizon", + [3]byte{180, 62, 59}: "Viableware, Inc", + [3]byte{180, 65, 122}: "ShenZhen Gongjin Electronics Co.,Ltd", + [3]byte{180, 67, 13}: "Broadlink Pty Ltd", + [3]byte{180, 71, 94}: "Avaya, Inc", + [3]byte{180, 76, 194}: "NR ELECTRIC CO., LTD", + [3]byte{180, 81, 249}: "NB Software", + [3]byte{180, 82, 83}: "Seagate Technology", + [3]byte{180, 82, 125}: "Sony Mobile Communications AB", + [3]byte{180, 82, 126}: "Sony Mobile Communications AB", + [3]byte{180, 85, 112}: "Borea", + [3]byte{180, 88, 97}: "CRemote, LLC", + [3]byte{180, 92, 164}: "Thing-talk Wireless Communication Technologies Corporation Limited", + [3]byte{180, 97, 255}: "Lumigon A/S", + [3]byte{180, 98, 56}: "Exablox", + [3]byte{180, 98, 147}: "Samsung Electronics Co.,Ltd", + [3]byte{180, 98, 173}: "raytest GmbH", + [3]byte{180, 102, 152}: "Zealabs srl", + [3]byte{180, 103, 233}: "Qingdao GoerTek Technology Co., Ltd.", + [3]byte{180, 116, 159}: "askey computer corp", + [3]byte{180, 117, 14}: "Belkin International Inc.", + [3]byte{180, 121, 167}: "Samsung Electro Mechanics co., LTD.", + [3]byte{180, 124, 41}: "Shenzhen Guzidi Technology Co.,Ltd", + [3]byte{180, 127, 94}: "Foresight Manufacture (S) Pte Ltd", + [3]byte{180, 130, 85}: "Research Products Corporation", + [3]byte{180, 130, 123}: "AKG Acoustics GmbH", + [3]byte{180, 130, 197}: "Relay2, Inc.", + [3]byte{180, 130, 254}: "Askey Computer Corp", + [3]byte{180, 133, 71}: "Amptown System Company GmbH", + [3]byte{180, 137, 16}: "Coster T.E. S.P.A.", + [3]byte{180, 148, 78}: "WeTelecom Co., Ltd.", + [3]byte{180, 152, 66}: "zte corporation", + [3]byte{180, 153, 76}: "Texas Instruments", + [3]byte{180, 153, 186}: "Hewlett-Packard Company", + [3]byte{180, 157, 180}: "Axion Technologies Inc.", + [3]byte{180, 158, 172}: "Imagik Int'l Corp", + [3]byte{180, 158, 230}: "SHENZHEN TECHNOLOGY CO LTD", + [3]byte{180, 164, 181}: "Zen Eye Co.,Ltd", + [3]byte{180, 164, 227}: "CISCO SYSTEMS, INC.", + [3]byte{180, 165, 169}: "MODI GmbH", + [3]byte{180, 168, 40}: "Shenzhen Concox Information Technology Co., Ltd", + [3]byte{180, 168, 43}: "Histar Digital Electronics Co., Ltd.", + [3]byte{180, 169, 90}: "Avaya, Inc", + [3]byte{180, 170, 77}: "Ensequence, Inc.", + [3]byte{180, 171, 44}: "MtM Technology Corporation", + [3]byte{180, 174, 111}: "Circle Reliance, Inc.", + [3]byte{180, 176, 23}: "Avaya, Inc", + [3]byte{180, 179, 98}: "ZTE Corporation", + [3]byte{180, 181, 47}: "Hewlett Packard", + [3]byte{180, 181, 66}: "Hubbell Power Systems, Inc.", + [3]byte{180, 181, 175}: "Minsung Electronics", + [3]byte{180, 182, 118}: "Intel Corporate", + [3]byte{180, 184, 89}: "Texa Spa", + [3]byte{180, 184, 141}: "Thuh Company", + [3]byte{180, 196, 78}: "VXL eTech Pvt Ltd", + [3]byte{180, 199, 153}: "Motorola Solutions Inc.", + [3]byte{180, 200, 16}: "UMPI Elettronica", + [3]byte{180, 204, 233}: "PROSYST", + [3]byte{180, 206, 246}: "HTC Corporation", + [3]byte{180, 207, 219}: "Shenzhen Jiuzhou Electric Co.,LTD", + [3]byte{180, 216, 169}: "BetterBots", + [3]byte{180, 216, 222}: "iota Computing, Inc.", + [3]byte{180, 221, 21}: "ControlThings Oy Ab", + [3]byte{180, 223, 59}: "Chromlech", + [3]byte{180, 223, 250}: "Litemax Electronics Inc.", + [3]byte{180, 224, 205}: "Fusion-io, Inc", + [3]byte{180, 225, 235}: "PRIVATE", + [3]byte{180, 233, 176}: "Cisco", + [3]byte{180, 237, 25}: "Pie Digital, Inc.", + [3]byte{180, 237, 84}: "Wohler Technologies", + [3]byte{180, 238, 180}: "ASKEY COMPUTER CORP", + [3]byte{180, 238, 212}: "Texas Instruments", + [3]byte{180, 240, 171}: "Apple", + [3]byte{180, 242, 232}: "Pace plc", + [3]byte{180, 243, 35}: "PETATEL INC.", + [3]byte{180, 252, 117}: "SEMA Electronics(HK) CO.,LTD", + [3]byte{180, 254, 140}: "Centro Sicurezza Italia SpA", + [3]byte{184, 3, 5}: "Intel Corporate", + [3]byte{184, 4, 21}: "Bayan Audio", + [3]byte{184, 8, 207}: "Intel Corporate", + [3]byte{184, 11, 157}: "ROPEX Industrie-Elektronik GmbH", + [3]byte{184, 20, 19}: "Keen High Holding(HK) Ltd.", + [3]byte{184, 22, 25}: "ARRIS Group, Inc.", + [3]byte{184, 23, 194}: "Apple", + [3]byte{184, 24, 111}: "ORIENTAL MOTOR CO., LTD.", + [3]byte{184, 25, 153}: "Nesys", + [3]byte{184, 32, 231}: "Guangzhou Horizontal Information & Network Integration Co. Ltd", + [3]byte{184, 36, 16}: "Magneti Marelli Slovakia s.r.o.", + [3]byte{184, 36, 26}: "SWEDA INFORMATICA LTDA", + [3]byte{184, 38, 108}: "ANOV France", + [3]byte{184, 38, 212}: "Furukawa Industrial S.A. Produtos Elétricos", + [3]byte{184, 39, 235}: "Raspberry Pi Foundation", + [3]byte{184, 40, 139}: "Parker Hannifin", + [3]byte{184, 41, 247}: "Blaster Tech", + [3]byte{184, 42, 114}: "Dell Inc", + [3]byte{184, 42, 220}: "EFR Europäische Funk-Rundsteuerung GmbH", + [3]byte{184, 44, 160}: "Honeywell HomMed", + [3]byte{184, 48, 168}: "Road-Track Telematics Development", + [3]byte{184, 54, 216}: "Videoswitch", + [3]byte{184, 56, 97}: "Cisco", + [3]byte{184, 56, 202}: "Kyokko Tsushin System CO.,LTD", + [3]byte{184, 58, 123}: "Worldplay (Canada) Inc.", + [3]byte{184, 61, 78}: "Shenzhen Cultraview Digital Technology Co.,Ltd Shanghai Branch", + [3]byte{184, 62, 89}: "Roku, Inc", + [3]byte{184, 65, 95}: "ASP AG", + [3]byte{184, 67, 228}: "Vlatacom", + [3]byte{184, 71, 198}: "SanJet Technology Corp.", + [3]byte{184, 79, 213}: "Microsoft Corporation", + [3]byte{184, 85, 16}: "Zioncom Electronics (Shenzhen) Ltd.", + [3]byte{184, 88, 16}: "NUMERA, INC.", + [3]byte{184, 90, 247}: "Ouya, Inc", + [3]byte{184, 90, 254}: "Handaer Communication Technology (Beijing) Co., Ltd", + [3]byte{184, 94, 123}: "Samsung Electronics Co.,Ltd", + [3]byte{184, 96, 145}: "Onnet Technologies and Innovations LLC", + [3]byte{184, 97, 111}: "Accton Wireless Broadband(AWB), Corp.", + [3]byte{184, 98, 31}: "CISCO SYSTEMS, INC.", + [3]byte{184, 99, 188}: "ROBOTIS, Co, Ltd", + [3]byte{184, 100, 145}: "CK Telecom Ltd", + [3]byte{184, 101, 59}: "Bolymin, Inc.", + [3]byte{184, 107, 35}: "Toshiba", + [3]byte{184, 108, 232}: "Samsung Electronics Co.,Ltd", + [3]byte{184, 112, 244}: "COMPAL INFORMATION (KUNSHAN) CO., LTD.", + [3]byte{184, 116, 36}: "Viessmann Elektronik GmbH", + [3]byte{184, 116, 71}: "Convergence Technologies", + [3]byte{184, 117, 192}: "PayPal, Inc.", + [3]byte{184, 118, 63}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{184, 119, 195}: "Decagon Devices, Inc.", + [3]byte{184, 120, 46}: "Apple", + [3]byte{184, 121, 126}: "Secure Meters (UK) Limited", + [3]byte{184, 122, 201}: "Siemens Ltd.", + [3]byte{184, 124, 242}: "Aerohive Networks Inc.", + [3]byte{184, 135, 30}: "Good Mind Industries Co., Ltd.", + [3]byte{184, 135, 168}: "Step Ahead Innovations Inc.", + [3]byte{184, 136, 227}: "COMPAL INFORMATION (KUNSHAN) CO., LTD", + [3]byte{184, 137, 202}: "ILJIN ELECTRIC Co., Ltd.", + [3]byte{184, 138, 96}: "Intel Corporate", + [3]byte{184, 141, 18}: "Apple", + [3]byte{184, 142, 58}: "Infinite Technologies JLT", + [3]byte{184, 143, 20}: "Analytica GmbH", + [3]byte{184, 146, 29}: "BG T&A", + [3]byte{184, 148, 210}: "Retail Innovation HTT AB", + [3]byte{184, 150, 116}: "AllDSP GmbH & Co. KG", + [3]byte{184, 151, 90}: "BIOSTAR Microtech Int'l Corp.", + [3]byte{184, 152, 176}: "Atlona Inc.", + [3]byte{184, 152, 247}: "Gionee Communication Equipment Co,Ltd.ShenZhen", + [3]byte{184, 153, 25}: "7signal Solutions, Inc", + [3]byte{184, 154, 237}: "OceanServer Technology, Inc", + [3]byte{184, 155, 201}: "SMC Networks Inc", + [3]byte{184, 155, 228}: "ABB Power Systems Power Generation", + [3]byte{184, 163, 134}: "D-Link International", + [3]byte{184, 163, 224}: "BenRui Technology Co.,Ltd", + [3]byte{184, 168, 175}: "Logic S.p.A.", + [3]byte{184, 172, 111}: "Dell Inc", + [3]byte{184, 173, 62}: "BLUECOM", + [3]byte{184, 174, 110}: "Nintendo Co., Ltd.", + [3]byte{184, 174, 237}: "Elitegroup Computer Systems Co., Ltd.", + [3]byte{184, 175, 103}: "Hewlett-Packard Company", + [3]byte{184, 177, 199}: "BT&COM CO.,LTD", + [3]byte{184, 180, 46}: "Gionee Communication Equipment Co,Ltd.ShenZhen", + [3]byte{184, 183, 215}: "2GIG Technologies", + [3]byte{184, 185, 78}: "Shenzhen iBaby Labs, Inc.", + [3]byte{184, 186, 104}: "Xi'an Jizhong Digital Communication Co.,Ltd", + [3]byte{184, 186, 114}: "Cynove", + [3]byte{184, 187, 109}: "ENERES Co.,Ltd.", + [3]byte{184, 189, 121}: "TrendPoint Systems", + [3]byte{184, 190, 191}: "CISCO SYSTEMS, INC.", + [3]byte{184, 191, 131}: "Intel Corporate", + [3]byte{184, 193, 162}: "Dragon Path Technologies Co., Limited", + [3]byte{184, 196, 111}: "PRIMMCON INDUSTRIES INC", + [3]byte{184, 198, 142}: "Samsung Electronics Co.,Ltd", + [3]byte{184, 199, 22}: "Fiberhome Telecommunication Technologies Co.,LTD", + [3]byte{184, 199, 93}: "Apple", + [3]byte{184, 200, 85}: "Shanghai GBCOM Communication Technology Co.,Ltd.", + [3]byte{184, 202, 58}: "Dell Inc", + [3]byte{184, 205, 147}: "Penetek, Inc", + [3]byte{184, 205, 167}: "Maxeler Technologies Ltd.", + [3]byte{184, 208, 111}: "GUANGZHOU HKUST FOK YING TUNG RESEARCH INSTITUTE", + [3]byte{184, 212, 157}: "M Seven System Ltd.", + [3]byte{184, 216, 18}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{184, 217, 206}: "Samsung Electronics", + [3]byte{184, 218, 241}: "Strahlenschutz- Entwicklungs- und Ausruestungsgesellschaft mbH", + [3]byte{184, 218, 247}: "Advanced Photonics, Inc.", + [3]byte{184, 220, 135}: "IAI Corporation", + [3]byte{184, 223, 107}: "SpotCam Co., Ltd.", + [3]byte{184, 229, 137}: "Payter BV", + [3]byte{184, 230, 37}: "2Wire", + [3]byte{184, 231, 121}: "9Solutions Oy", + [3]byte{184, 232, 86}: "Apple", + [3]byte{184, 233, 55}: "Sonos, Inc.", + [3]byte{184, 238, 101}: "Liteon Technology Corporation", + [3]byte{184, 238, 121}: "YWire Technologies, Inc.", + [3]byte{184, 243, 23}: "iSun Smasher Communications Private Limited", + [3]byte{184, 244, 208}: "Herrmann Ultraschalltechnik GmbH & Co. Kg", + [3]byte{184, 245, 231}: "WayTools, LLC", + [3]byte{184, 246, 177}: "Apple", + [3]byte{184, 247, 50}: "Aryaka Networks Inc", + [3]byte{184, 248, 40}: "Changshu Gaoshida Optoelectronic Technology Co. Ltd.", + [3]byte{184, 249, 52}: "Sony Ericsson Mobile Communications AB", + [3]byte{184, 253, 50}: "Zhejiang ROICX Microelectronics", + [3]byte{184, 255, 97}: "Apple", + [3]byte{184, 255, 111}: "Shanghai Typrotech Technology Co.Ltd", + [3]byte{184, 255, 254}: "Texas Instruments", + [3]byte{188, 2, 0}: "Stewart Audio", + [3]byte{188, 5, 67}: "AVM GmbH", + [3]byte{188, 13, 165}: "Texas Instruments", + [3]byte{188, 15, 43}: "FORTUNE TECHGROUP CO.,LTD", + [3]byte{188, 18, 94}: "Beijing WisVideo INC.", + [3]byte{188, 20, 1}: "Hitron Technologies. Inc", + [3]byte{188, 20, 239}: "ITON Technology Limited", + [3]byte{188, 21, 166}: "Taiwan Jantek Electronics,Ltd.", + [3]byte{188, 22, 101}: "Cisco", + [3]byte{188, 22, 245}: "Cisco", + [3]byte{188, 26, 103}: "YF Technology Co., Ltd", + [3]byte{188, 32, 164}: "Samsung Electronics", + [3]byte{188, 32, 186}: "Inspur (Shandong) Electronic Information Co., Ltd", + [3]byte{188, 37, 240}: "3D Display Technologies Co., Ltd.", + [3]byte{188, 38, 29}: "HONG KONG TECON TECHNOLOGY", + [3]byte{188, 40, 70}: "NextBIT Computing Pvt. Ltd.", + [3]byte{188, 40, 214}: "Rowley Associates Limited", + [3]byte{188, 43, 107}: "Beijing Haier IC Design Co.,Ltd", + [3]byte{188, 43, 215}: "Revogi Innovation Co., Ltd.", + [3]byte{188, 44, 85}: "Bear Flag Design, Inc.", + [3]byte{188, 45, 152}: "ThinGlobal LLC", + [3]byte{188, 48, 91}: "Dell Inc.", + [3]byte{188, 48, 125}: "Wistron Neweb Corp.", + [3]byte{188, 52, 0}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{188, 53, 229}: "Hydro Systems Company", + [3]byte{188, 56, 210}: "Pandachip Limited", + [3]byte{188, 57, 166}: "CSUN System Technology Co.,LTD", + [3]byte{188, 59, 175}: "Apple", + [3]byte{188, 62, 19}: "Accordance Systems Inc.", + [3]byte{188, 65, 0}: "Codaco Electronic s.r.o.", + [3]byte{188, 67, 119}: "Hang Zhou Huite Technology Co.,ltd.", + [3]byte{188, 68, 134}: "Samsung Electronics Co.,Ltd", + [3]byte{188, 71, 96}: "Samsung Electronics Co.,Ltd", + [3]byte{188, 75, 121}: "SensingTek", + [3]byte{188, 77, 251}: "Hitron Technologies. Inc", + [3]byte{188, 78, 60}: "CORE STAFF CO., LTD.", + [3]byte{188, 78, 93}: "ZhongMiao Technology Co., Ltd.", + [3]byte{188, 81, 254}: "Swann Communications Pty Ltd", + [3]byte{188, 82, 180}: "Alcatel-Lucent", + [3]byte{188, 82, 183}: "Apple", + [3]byte{188, 95, 244}: "ASRock Incorporation", + [3]byte{188, 98, 159}: "Telenet Systems P. Ltd.", + [3]byte{188, 102, 65}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{188, 103, 28}: "Cisco", + [3]byte{188, 103, 120}: "Apple", + [3]byte{188, 103, 132}: "Environics Oy", + [3]byte{188, 106, 22}: "tdvine", + [3]byte{188, 106, 41}: "Texas Instruments", + [3]byte{188, 107, 77}: "Alcatel-Lucent", + [3]byte{188, 110, 118}: "Green Energy Options Ltd", + [3]byte{188, 113, 193}: "XTrillion, Inc.", + [3]byte{188, 114, 177}: "Samsung Electronics Co.,Ltd", + [3]byte{188, 116, 215}: "HangZhou JuRu Technology CO.,LTD", + [3]byte{188, 118, 78}: "Rackspace US, Inc.", + [3]byte{188, 118, 112}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{188, 119, 55}: "Intel Corporate", + [3]byte{188, 119, 159}: "SBM Co., Ltd.", + [3]byte{188, 121, 173}: "Samsung Electronics Co.,Ltd", + [3]byte{188, 125, 209}: "Radio Data Comms", + [3]byte{188, 129, 31}: "Ingate Systems", + [3]byte{188, 129, 153}: "BASIC Co.,Ltd.", + [3]byte{188, 131, 167}: "SHENZHEN CHUANGWEI-RGB ELECTRONICS CO.,LT", + [3]byte{188, 133, 31}: "Samsung Electronics", + [3]byte{188, 133, 86}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{188, 136, 147}: "VILLBAU Ltd.", + [3]byte{188, 139, 85}: "NPP ELIKS America Inc. DBA T&M Atlantic", + [3]byte{188, 140, 205}: "Samsung Electro Mechanics co.,LTD.", + [3]byte{188, 141, 14}: "Alcatel-Lucent", + [3]byte{188, 146, 107}: "Apple", + [3]byte{188, 150, 128}: "Shenzhen Gongjin Electronics Co.,Ltd", + [3]byte{188, 152, 137}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{188, 153, 188}: "FonSee Technology Inc.", + [3]byte{188, 156, 197}: "Beijing Huafei Technology Co., Ltd.", + [3]byte{188, 157, 165}: "DASCOM Europe GmbH", + [3]byte{188, 164, 225}: "Nabto", + [3]byte{188, 169, 214}: "Cyber-Rain, Inc.", + [3]byte{188, 174, 197}: "ASUSTek COMPUTER INC.", + [3]byte{188, 177, 129}: "SHARP CORPORATION", + [3]byte{188, 177, 243}: "Samsung Electronics", + [3]byte{188, 184, 82}: "Cybera, Inc.", + [3]byte{188, 186, 225}: "AREC Inc.", + [3]byte{188, 187, 201}: "Kellendonk Elektronik GmbH", + [3]byte{188, 188, 70}: "SKS Welding Systems GmbH", + [3]byte{188, 193, 104}: "DinBox Sverige AB", + [3]byte{188, 194, 58}: "Thomson Video Networks", + [3]byte{188, 195, 66}: "Panasonic System Networks Co., Ltd.", + [3]byte{188, 198, 26}: "SPECTRA EMBEDDED SYSTEMS", + [3]byte{188, 198, 219}: "Nokia Corporation", + [3]byte{188, 200, 16}: "Cisco SPVTG", + [3]byte{188, 202, 181}: "ARRIS Group, Inc.", + [3]byte{188, 205, 69}: "VOISMART", + [3]byte{188, 207, 204}: "HTC Corporation", + [3]byte{188, 209, 119}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{188, 209, 211}: "Tinno Mobile Technology Corp", + [3]byte{188, 213, 182}: "d2d technologies", + [3]byte{188, 217, 64}: "ASR Co,.Ltd.", + [3]byte{188, 224, 157}: "Eoslink", + [3]byte{188, 229, 159}: "WATERWORLD Technology Co.,LTD", + [3]byte{188, 234, 43}: "CityCom GmbH", + [3]byte{188, 234, 250}: "Hewlett Packard", + [3]byte{188, 238, 123}: "ASUSTek COMPUTER INC.", + [3]byte{188, 242, 175}: "devolo AG", + [3]byte{188, 245, 172}: "LG Electronics", + [3]byte{188, 246, 28}: "Geomodeling Wuxi Technology Co. Ltd.", + [3]byte{188, 246, 133}: "D-Link International", + [3]byte{188, 254, 140}: "Altronic, LLC", + [3]byte{188, 255, 172}: "TOPCON CORPORATION", + [3]byte{192, 13, 126}: "Additech, Inc.", + [3]byte{192, 17, 166}: "Fort-Telecom ltd.", + [3]byte{192, 18, 66}: "Alpha Security Products", + [3]byte{192, 20, 61}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{192, 24, 133}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{192, 30, 155}: "Pixavi AS", + [3]byte{192, 34, 80}: "PRIVATE", + [3]byte{192, 37, 6}: "AVM GmbH", + [3]byte{192, 37, 92}: "Cisco", + [3]byte{192, 39, 185}: "Beijing National Railway Research & Design Institute of Signal & Communication Co., Ltd.", + [3]byte{192, 41, 115}: "Audyssey Laboratories Inc.", + [3]byte{192, 41, 243}: "XySystem", + [3]byte{192, 43, 252}: "iNES. applied informatics GmbH", + [3]byte{192, 44, 122}: "Shen Zhen Horn audio Co., Ltd.", + [3]byte{192, 52, 180}: "Gigastone Corporation", + [3]byte{192, 53, 128}: "A&R TECH", + [3]byte{192, 53, 189}: "Velocytech Aps", + [3]byte{192, 53, 197}: "Prosoft Systems LTD", + [3]byte{192, 56, 150}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{192, 56, 249}: "Nokia Danmark A/S", + [3]byte{192, 59, 143}: "Minicom Digital Signage", + [3]byte{192, 61, 70}: "Shanghai Mochui Network Technology Co., Ltd", + [3]byte{192, 62, 15}: "BSkyB Ltd", + [3]byte{192, 63, 14}: "NETGEAR", + [3]byte{192, 63, 42}: "Biscotti, Inc.", + [3]byte{192, 63, 213}: "Elitegroup Computer Systems Co., LTD", + [3]byte{192, 65, 246}: "LG Electronics Inc", + [3]byte{192, 67, 1}: "Epec Oy", + [3]byte{192, 68, 227}: "Shenzhen Sinkna Electronics Co., LTD", + [3]byte{192, 73, 61}: "MAITRISE TECHNOLOGIQUE", + [3]byte{192, 74, 0}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{192, 77, 247}: "SERELEC", + [3]byte{192, 86, 227}: "Hangzhou Hikvision Digital Technology Co.,Ltd.", + [3]byte{192, 87, 188}: "Avaya, Inc", + [3]byte{192, 88, 167}: "Pico Systems Co., Ltd.", + [3]byte{192, 94, 111}: "V. Stonkaus firma \"Kodinis Raktas\"", + [3]byte{192, 94, 121}: "SHENZHEN HUAXUN ARK TECHNOLOGIES CO.,LTD", + [3]byte{192, 97, 24}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{192, 98, 107}: "CISCO SYSTEMS, INC.", + [3]byte{192, 99, 148}: "Apple", + [3]byte{192, 100, 198}: "Nokia Corporation", + [3]byte{192, 101, 153}: "Samsung Electronics Co.,Ltd", + [3]byte{192, 103, 175}: "Cisco", + [3]byte{192, 108, 15}: "Dobbs Stanford", + [3]byte{192, 108, 109}: "MagneMotion, Inc.", + [3]byte{192, 123, 188}: "Cisco", + [3]byte{192, 126, 64}: "SHENZHEN XDK COMMUNICATION EQUIPMENT CO.,LTD", + [3]byte{192, 129, 112}: "Effigis GeoSolutions", + [3]byte{192, 131, 10}: "2Wire", + [3]byte{192, 132, 122}: "Apple", + [3]byte{192, 136, 91}: "SnD Tech Co., Ltd.", + [3]byte{192, 138, 222}: "Ruckus Wireless", + [3]byte{192, 139, 111}: "S I Sistemas Inteligentes Eletrônicos Ltda", + [3]byte{192, 140, 96}: "Cisco", + [3]byte{192, 145, 50}: "Patriot Memory", + [3]byte{192, 145, 52}: "ProCurve Networking by HP", + [3]byte{192, 152, 121}: "Acer Inc.", + [3]byte{192, 152, 229}: "University of Michigan", + [3]byte{192, 156, 146}: "COBY", + [3]byte{192, 157, 38}: "Topicon HK Lmd.", + [3]byte{192, 159, 66}: "Apple", + [3]byte{192, 160, 187}: "D-Link International", + [3]byte{192, 160, 199}: "FAIRFIELD INDUSTRIES", + [3]byte{192, 160, 222}: "Multi Touch Oy", + [3]byte{192, 160, 226}: "Eden Innovations", + [3]byte{192, 162, 109}: "Abbott Point of Care", + [3]byte{192, 163, 100}: "3D Systems Massachusetts", + [3]byte{192, 163, 158}: "EarthCam, Inc.", + [3]byte{192, 170, 104}: "OSASI Technos Inc.", + [3]byte{192, 172, 84}: "SAGEMCOM", + [3]byte{192, 179, 57}: "Comigo Ltd.", + [3]byte{192, 179, 87}: "Yoshiki Electronics Industry Ltd.", + [3]byte{192, 184, 177}: "BitBox Ltd", + [3]byte{192, 186, 230}: "Application Solutions (Electronics and Vision) Ltd", + [3]byte{192, 189, 66}: "ZPA Smart Energy a.s.", + [3]byte{192, 193, 192}: "Cisco-Linksys, LLC", + [3]byte{192, 195, 182}: "Automatic Systems", + [3]byte{192, 197, 32}: "Ruckus Wireless", + [3]byte{192, 197, 105}: "SHANGHAI LYNUC CNC TECHNOLOGY CO.,LTD", + [3]byte{192, 198, 135}: "Cisco SPVTG", + [3]byte{192, 201, 70}: "MITSUYA LABORATORIES INC.", + [3]byte{192, 203, 56}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{192, 207, 163}: "Creative Electronics & Software, Inc.", + [3]byte{192, 208, 68}: "SAGEMCOM", + [3]byte{192, 217, 98}: "Askey Computer Corp.", + [3]byte{192, 218, 116}: "Hangzhou Sunyard Technology Co., Ltd.", + [3]byte{192, 223, 119}: "Conrad Electronic SE", + [3]byte{192, 228, 34}: "Texas Instruments", + [3]byte{192, 229, 78}: "DENX Computer Systems GmbH", + [3]byte{192, 234, 228}: "Sonicwall", + [3]byte{192, 238, 251}: "OnePlus Tech (Shenzhen) Ltd", + [3]byte{192, 241, 196}: "Pacidal Corporation Ltd.", + [3]byte{192, 242, 251}: "Apple", + [3]byte{192, 247, 157}: "Powercode", + [3]byte{192, 248, 218}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{192, 249, 145}: "GME Standard Communications P/L", + [3]byte{196, 0, 6}: "Lipi Data Systems Ltd.", + [3]byte{196, 1, 66}: "MaxMedia Technology Limited", + [3]byte{196, 1, 124}: "Ruckus Wireless", + [3]byte{196, 1, 177}: "SeekTech INC", + [3]byte{196, 1, 206}: "PRESITION (2000) CO., LTD.", + [3]byte{196, 4, 21}: "NETGEAR INC.,", + [3]byte{196, 5, 40}: "Huawei Technologies Co., Ltd", + [3]byte{196, 8, 74}: "Alcatel-Lucent", + [3]byte{196, 8, 128}: "Shenzhen UTEPO Tech Co., Ltd.", + [3]byte{196, 9, 56}: "Fujian Star-net Communication Co., Ltd", + [3]byte{196, 10, 203}: "CISCO SYSTEMS, INC.", + [3]byte{196, 14, 69}: "ACK Networks,Inc.", + [3]byte{196, 15, 9}: "Hermes electronic GmbH", + [3]byte{196, 16, 138}: "Ruckus Wireless", + [3]byte{196, 20, 60}: "Cisco", + [3]byte{196, 22, 250}: "Prysm Inc", + [3]byte{196, 23, 254}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{196, 25, 139}: "Dominion Voting Systems Corporation", + [3]byte{196, 25, 236}: "Qualisys AB", + [3]byte{196, 30, 206}: "HMI Sources Ltd.", + [3]byte{196, 33, 200}: "KYOCERA Corporation", + [3]byte{196, 35, 122}: "WhizNets Inc.", + [3]byte{196, 36, 46}: "Galvanic Applied Sciences Inc", + [3]byte{196, 38, 40}: "Airo Wireless", + [3]byte{196, 39, 149}: "Technicolor USA Inc.", + [3]byte{196, 41, 29}: "KLEMSAN ELEKTRIK ELEKTRONIK SAN.VE TIC.AS.", + [3]byte{196, 44, 3}: "Apple", + [3]byte{196, 52, 107}: "Hewlett Packard", + [3]byte{196, 54, 218}: "Rusteletech Ltd.", + [3]byte{196, 56, 211}: "TAGATEC CO.,LTD", + [3]byte{196, 57, 58}: "SMC Networks Inc", + [3]byte{196, 58, 159}: "Siconix Inc.", + [3]byte{196, 60, 60}: "CYBELEC SA", + [3]byte{196, 61, 199}: "NETGEAR", + [3]byte{196, 66, 2}: "Samsung Electronics Co.,Ltd", + [3]byte{196, 67, 143}: "LG Electronics", + [3]byte{196, 69, 103}: "SAMBON PRECISON and ELECTRONICS", + [3]byte{196, 69, 236}: "Shanghai Yali Electron Co.,LTD", + [3]byte{196, 70, 25}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{196, 72, 56}: "Satcom Direct, Inc.", + [3]byte{196, 74, 208}: "FIREFLIES SYSTEMS", + [3]byte{196, 75, 68}: "Omniprint Inc.", + [3]byte{196, 75, 209}: "Wallys Communications Teachnologies Co.,Ltd.", + [3]byte{196, 78, 31}: "BlueN", + [3]byte{196, 78, 172}: "Shenzhen Shiningworth Technology Co., Ltd.", + [3]byte{196, 80, 6}: "Samsung Electronics Co.,Ltd", + [3]byte{196, 84, 68}: "QUANTA COMPUTER INC.", + [3]byte{196, 85, 166}: "Cadac Holdings Ltd", + [3]byte{196, 85, 194}: "Bach-Simpson", + [3]byte{196, 86, 0}: "Galleon Embedded Computing", + [3]byte{196, 86, 254}: "Lava International Ltd.", + [3]byte{196, 87, 110}: "Samsung Electronics Co.,LTD", + [3]byte{196, 88, 194}: "Shenzhen TATFOOK Technology Co., Ltd.", + [3]byte{196, 89, 118}: "Fugoo Coorporation", + [3]byte{196, 93, 216}: "HDMI Forum", + [3]byte{196, 96, 68}: "Everex Electronics Limited", + [3]byte{196, 98, 107}: "ZPT Vigantice", + [3]byte{196, 98, 234}: "Samsung Electronics Co.,Ltd", + [3]byte{196, 99, 84}: "U-Raku, Inc.", + [3]byte{196, 100, 19}: "CISCO SYSTEMS, INC.", + [3]byte{196, 103, 181}: "Libratone A/S", + [3]byte{196, 106, 183}: "Xiaomi Technology,Inc.", + [3]byte{196, 107, 180}: "myIDkey", + [3]byte{196, 109, 241}: "DataGravity", + [3]byte{196, 110, 31}: "TP-LINK TECHNOLOGIES CO.,LTD", + [3]byte{196, 113, 48}: "Fon Technology S.L.", + [3]byte{196, 113, 254}: "CISCO SYSTEMS, INC.", + [3]byte{196, 115, 30}: "Samsung Eletronics Co., Ltd", + [3]byte{196, 123, 47}: "Beijing JoinHope Image Technology Ltd.", + [3]byte{196, 123, 163}: "NAVIS Inc.", + [3]byte{196, 125, 79}: "CISCO SYSTEMS, INC.", + [3]byte{196, 125, 204}: "Motorola Solutions Inc.", + [3]byte{196, 125, 254}: "A.N. Solutions GmbH", + [3]byte{196, 127, 81}: "Inventek Systems", + [3]byte{196, 130, 63}: "Fujian Newland Auto-ID Tech. Co,.Ltd.", + [3]byte{196, 130, 78}: "Changzhou Uchip Electronics Co., LTD.", + [3]byte{196, 133, 8}: "Intel Corporate", + [3]byte{196, 136, 229}: "Samsung Electronics Co.,Ltd", + [3]byte{196, 145, 58}: "Shenzhen Sanland Electronic Co., ltd.", + [3]byte{196, 147, 0}: "8Devices", + [3]byte{196, 147, 19}: "100fio networks technology llc", + [3]byte{196, 147, 128}: "Speedytel technology", + [3]byte{196, 149, 162}: "SHENZHEN WEIJIU INDUSTRY AND TRADE DEVELOPMENT CO., LTD", + [3]byte{196, 152, 5}: "Minieum Networks, Inc", + [3]byte{196, 168, 29}: "D-Link International", + [3]byte{196, 170, 161}: "SUMMIT DEVELOPMENT, spol.s r.o.", + [3]byte{196, 173, 33}: "MEDIAEDGE Corporation", + [3]byte{196, 181, 18}: "General Electric Digital Energy", + [3]byte{196, 186, 153}: "I+ME Actia Informatik und Mikro-Elektronik GmbH", + [3]byte{196, 189, 106}: "SKF GmbH", + [3]byte{196, 190, 132}: "Texas Instruments.", + [3]byte{196, 192, 174}: "MIDORI ELECTRONIC CO., LTD.", + [3]byte{196, 193, 159}: "National Oilwell Varco Instrumentation, Monitoring, and Optimization (NOV IMO)", + [3]byte{196, 199, 85}: "Beijing HuaqinWorld Technology Co.,Ltd", + [3]byte{196, 201, 25}: "Energy Imports Ltd", + [3]byte{196, 201, 236}: "D&D GROUP sp. z o.o.", + [3]byte{196, 202, 217}: "Hangzhou H3C Technologies Co., Limited", + [3]byte{196, 205, 69}: "Beijing Boomsense Technology CO.,LTD.", + [3]byte{196, 212, 137}: "JiangSu Joyque Information Industry Co.,Ltd", + [3]byte{196, 214, 85}: "Tercel technology co.,ltd", + [3]byte{196, 217, 135}: "Intel Corporate", + [3]byte{196, 218, 38}: "NOBLEX SA", + [3]byte{196, 224, 50}: "IEEE 1904.1 Working Group", + [3]byte{196, 225, 124}: "U2S co.", + [3]byte{196, 231, 190}: "SCSpro Co.,Ltd", + [3]byte{196, 233, 47}: "AB Sciex", + [3]byte{196, 233, 132}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{196, 235, 227}: "RRCN SAS", + [3]byte{196, 237, 186}: "Texas Instruments", + [3]byte{196, 238, 174}: "VSS Monitoring", + [3]byte{196, 238, 245}: "Oclaro, Inc.", + [3]byte{196, 244, 100}: "Spica international", + [3]byte{196, 245, 124}: "Brocade Communications Systems, Inc.", + [3]byte{196, 252, 228}: "DishTV NZ Ltd", + [3]byte{200, 2, 16}: "LG Innotek", + [3]byte{200, 2, 88}: "ITW GSE ApS", + [3]byte{200, 2, 166}: "Beijing Newmine Technology", + [3]byte{200, 7, 24}: "TDSi", + [3]byte{200, 10, 169}: "Quanta Computer Inc.", + [3]byte{200, 14, 119}: "Le Shi Zhi Xin Electronic Technology (Tianjin) Co.,Ltd", + [3]byte{200, 14, 149}: "OmniLync Inc.", + [3]byte{200, 20, 121}: "Samsung Electronics Co.,Ltd", + [3]byte{200, 22, 189}: "HISENSE ELECTRIC CO.,LTD.", + [3]byte{200, 25, 247}: "Samsung Electronics Co.,Ltd", + [3]byte{200, 26, 254}: "DLOGIC GmbH", + [3]byte{200, 27, 107}: "Innova Security", + [3]byte{200, 30, 142}: "ADV Security (S) Pte Ltd", + [3]byte{200, 31, 102}: "Dell Inc", + [3]byte{200, 32, 142}: "Storagedata", + [3]byte{200, 41, 42}: "Barun Electronics", + [3]byte{200, 42, 20}: "Apple", + [3]byte{200, 46, 148}: "Halfa Enterprise Co., Ltd.", + [3]byte{200, 49, 104}: "eZEX corporation", + [3]byte{200, 50, 50}: "Hunting Innova", + [3]byte{200, 51, 75}: "Apple", + [3]byte{200, 53, 184}: "Ericsson, EAB/RWI/K", + [3]byte{200, 58, 53}: "Tenda Technology Co., Ltd.", + [3]byte{200, 59, 69}: "JRI-Maxant", + [3]byte{200, 61, 151}: "Nokia Corporation", + [3]byte{200, 62, 153}: "Texas Instruments", + [3]byte{200, 62, 167}: "KUNBUS GmbH", + [3]byte{200, 69, 41}: "IMK Networks Co.,Ltd", + [3]byte{200, 69, 68}: "Shanghai Enlogic Electric Technology Co., Ltd.", + [3]byte{200, 72, 245}: "MEDISON Xray Co., Ltd", + [3]byte{200, 76, 117}: "CISCO SYSTEMS, INC.", + [3]byte{200, 86, 69}: "Intermas France", + [3]byte{200, 86, 99}: "Sunflex Europe GmbH", + [3]byte{200, 96, 0}: "ASUSTek COMPUTER INC.", + [3]byte{200, 100, 199}: "zte corporation", + [3]byte{200, 108, 30}: "Display Systems Ltd", + [3]byte{200, 108, 135}: "Zyxel Communications Corp", + [3]byte{200, 108, 182}: "Optcom Co., Ltd.", + [3]byte{200, 111, 29}: "Apple", + [3]byte{200, 114, 72}: "Aplicom Oy", + [3]byte{200, 123, 91}: "zte corporation", + [3]byte{200, 124, 188}: "Valink Co., Ltd.", + [3]byte{200, 125, 119}: "Shenzhen Kingtech Communication Equipment Co.,Ltd", + [3]byte{200, 126, 117}: "Samsung Electronics Co.,Ltd", + [3]byte{200, 132, 57}: "Sunrise Technologies", + [3]byte{200, 132, 71}: "Beautiful Enterprise Co., Ltd", + [3]byte{200, 133, 80}: "Apple", + [3]byte{200, 135, 59}: "Net Optics", + [3]byte{200, 138, 131}: "Dongguan HuaHong Electronics Co.,Ltd", + [3]byte{200, 139, 71}: "Nolangroup S.P.A con Socio Unico", + [3]byte{200, 144, 62}: "Pakton Technologies", + [3]byte{200, 145, 249}: "SAGEMCOM", + [3]byte{200, 147, 70}: "MXCHIP Company Limited", + [3]byte{200, 147, 131}: "Embedded Automation, Inc.", + [3]byte{200, 148, 210}: "Jiangsu Datang Electronic Products Co., Ltd", + [3]byte{200, 151, 159}: "Nokia Corporation", + [3]byte{200, 156, 29}: "CISCO SYSTEMS, INC.", + [3]byte{200, 156, 220}: "ELITEGROUP COMPUTER SYSTEM CO., LTD.", + [3]byte{200, 159, 29}: "SHENZHEN COMMUNICATION TECHNOLOGIES CO.,LTD", + [3]byte{200, 159, 66}: "VDII Innovation AB", + [3]byte{200, 160, 48}: "Texas Instruments", + [3]byte{200, 161, 182}: "Shenzhen Longway Technologies Co., Ltd", + [3]byte{200, 161, 186}: "Neul Ltd", + [3]byte{200, 166, 32}: "Nebula, Inc", + [3]byte{200, 167, 10}: "Verizon Business", + [3]byte{200, 167, 41}: "SYStronics Co., Ltd.", + [3]byte{200, 170, 33}: "ARRIS Group, Inc.", + [3]byte{200, 170, 204}: "PRIVATE", + [3]byte{200, 174, 156}: "Shanghai TYD Elecronic Technology Co. Ltd", + [3]byte{200, 175, 64}: "marco Systemanalyse und Entwicklung GmbH", + [3]byte{200, 179, 115}: "Cisco-Linksys, LLC", + [3]byte{200, 181, 183}: "Apple", + [3]byte{200, 186, 148}: "Samsung Electro Mechanics co., LTD.", + [3]byte{200, 187, 211}: "Embrane", + [3]byte{200, 188, 200}: "Apple", + [3]byte{200, 190, 25}: "D-Link International", + [3]byte{200, 193, 38}: "ZPM Industria e Comercio Ltda", + [3]byte{200, 193, 60}: "RuggedTek Hangzhou Co., Ltd", + [3]byte{200, 199, 145}: "Zero1.tv GmbH", + [3]byte{200, 203, 184}: "Hewlett Packard", + [3]byte{200, 205, 114}: "SAGEMCOM", + [3]byte{200, 208, 25}: "Shanghai Tigercel Communication Technology Co.,Ltd", + [3]byte{200, 209, 11}: "Nokia Corporation", + [3]byte{200, 209, 94}: "Huawei Technologies Co., Ltd", + [3]byte{200, 209, 209}: "AGAiT Technology Corporation", + [3]byte{200, 210, 193}: "Jetlun (Shenzhen) Corporation", + [3]byte{200, 211, 163}: "D-Link International", + [3]byte{200, 212, 41}: "Muehlbauer AG", + [3]byte{200, 213, 144}: "FLIGHT DATA SYSTEMS", + [3]byte{200, 213, 254}: "Shenzhen Zowee Technology Co., Ltd", + [3]byte{200, 215, 25}: "Cisco Consumer Products, LLC", + [3]byte{200, 221, 201}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{200, 222, 81}: "Integra Networks, Inc.", + [3]byte{200, 223, 124}: "Nokia Corporation", + [3]byte{200, 224, 235}: "Apple", + [3]byte{200, 225, 167}: "Vertu Corporation Limited", + [3]byte{200, 228, 47}: "Technical Research Design and Development", + [3]byte{200, 231, 216}: "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD.", + [3]byte{200, 238, 8}: "TANGTOP TECHNOLOGY CO.,LTD", + [3]byte{200, 238, 117}: "Pishion International Co. Ltd", + [3]byte{200, 238, 166}: "Shenzhen SHX Technology Co., Ltd", + [3]byte{200, 239, 46}: "Beijing Gefei Tech. Co., Ltd", + [3]byte{200, 243, 107}: "Yamato Scale Co.,Ltd.", + [3]byte{200, 243, 134}: "Shenzhen Xiaoniao Technology Co.,Ltd", + [3]byte{200, 244, 6}: "Avaya, Inc", + [3]byte{200, 246, 80}: "Apple", + [3]byte{200, 246, 141}: "S.E.TECHNOLOGIES LIMITED", + [3]byte{200, 247, 4}: "Building Block Video", + [3]byte{200, 247, 51}: "Intel Corporate", + [3]byte{200, 249, 129}: "Seneca s.r.l.", + [3]byte{200, 249, 249}: "CISCO SYSTEMS, INC.", + [3]byte{200, 251, 38}: "Cisco SPVTG", + [3]byte{200, 254, 48}: "Bejing DAYO Mobile Communication Technology Ltd.", + [3]byte{200, 255, 119}: "Dyson Limited", + [3]byte{204, 0, 128}: "BETTINI SRL", + [3]byte{204, 3, 250}: "Technicolor CH USA", + [3]byte{204, 4, 124}: "G-WAY Microwave", + [3]byte{204, 4, 180}: "Select Comfort", + [3]byte{204, 5, 27}: "Samsung Electronics Co.,Ltd", + [3]byte{204, 7, 171}: "Samsung Electronics Co.,Ltd", + [3]byte{204, 7, 228}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{204, 8, 224}: "Apple", + [3]byte{204, 9, 200}: "IMAQLIQ LTD", + [3]byte{204, 12, 218}: "Miljovakt AS", + [3]byte{204, 13, 236}: "Cisco SPVTG", + [3]byte{204, 16, 163}: "Beijing Nan Bao Technology Co., Ltd.", + [3]byte{204, 20, 166}: "Yichun MyEnergy Domain, Inc", + [3]byte{204, 24, 123}: "Manzanita Systems, Inc.", + [3]byte{204, 26, 250}: "zte corporation", + [3]byte{204, 30, 255}: "Metrological Group BV", + [3]byte{204, 34, 24}: "InnoDigital Co., Ltd.", + [3]byte{204, 38, 45}: "Verifi, LLC", + [3]byte{204, 42, 128}: "Micro-Biz intelligence solutions Co.,Ltd", + [3]byte{204, 45, 140}: "LG ELECTRONICS INC", + [3]byte{204, 48, 128}: "VAIO Corporation", + [3]byte{204, 51, 187}: "SAGEMCOM SAS", + [3]byte{204, 52, 41}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{204, 52, 215}: "GEWISS S.P.A.", + [3]byte{204, 53, 64}: "Technicolor USA Inc.", + [3]byte{204, 57, 140}: "Shiningtek", + [3]byte{204, 58, 97}: "SAMSUNG ELECTRO MECHANICS CO., LTD.", + [3]byte{204, 60, 63}: "SA.S.S. Datentechnik AG", + [3]byte{204, 61, 130}: "Intel Corporate", + [3]byte{204, 62, 95}: "Hewlett Packard", + [3]byte{204, 63, 29}: "Intesis Software SL", + [3]byte{204, 67, 227}: "Trump s.a.", + [3]byte{204, 71, 3}: "Intercon Systems Co., Ltd.", + [3]byte{204, 74, 225}: "Fourtec -Fourier Technologies", + [3]byte{204, 75, 251}: "Hellberg Safety AB", + [3]byte{204, 78, 36}: "Brocade Communications Systems, Inc.", + [3]byte{204, 80, 28}: "KVH Industries, Inc.", + [3]byte{204, 80, 118}: "Ocom Communications, Inc.", + [3]byte{204, 82, 175}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{204, 83, 181}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{204, 84, 89}: "OnTime Networks AS", + [3]byte{204, 85, 173}: "RIM", + [3]byte{204, 89, 62}: "TOUMAZ LTD", + [3]byte{204, 92, 117}: "Weightech Com. Imp. Exp. Equip. Pesagem Ltda", + [3]byte{204, 93, 78}: "ZyXEL Communications Corporation", + [3]byte{204, 93, 87}: "Information System Research Institute,Inc.", + [3]byte{204, 96, 187}: "Empower RF Systems", + [3]byte{204, 101, 173}: "ARRIS Group, Inc.", + [3]byte{204, 105, 176}: "Global Traffic Technologies, LLC", + [3]byte{204, 107, 152}: "Minetec Wireless Technologies", + [3]byte{204, 107, 241}: "Sound Masking Inc.", + [3]byte{204, 109, 160}: "Roku, Inc.", + [3]byte{204, 109, 239}: "TJK Tietolaite Oy", + [3]byte{204, 114, 15}: "Viscount Systems Inc.", + [3]byte{204, 116, 152}: "Filmetrics Inc.", + [3]byte{204, 118, 105}: "SEETECH", + [3]byte{204, 120, 95}: "Apple", + [3]byte{204, 122, 48}: "CMAX Wireless Co., Ltd.", + [3]byte{204, 123, 53}: "zte corporation", + [3]byte{204, 125, 55}: "ARRIS Group, Inc.", + [3]byte{204, 126, 231}: "Panasonic AVC Networks Company", + [3]byte{204, 133, 108}: "SHENZHEN MDK DIGITAL TECHNOLOGY CO.,LTD", + [3]byte{204, 137, 253}: "Nokia Corporation", + [3]byte{204, 140, 227}: "Texas Instruments", + [3]byte{204, 144, 147}: "Hansong Tehnologies", + [3]byte{204, 145, 43}: "TE Connectivity Touch Solutions", + [3]byte{204, 148, 74}: "Pfeiffer Vacuum GmbH", + [3]byte{204, 149, 215}: "VIZIO, Inc", + [3]byte{204, 150, 160}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{204, 158, 0}: "Nintendo Co., Ltd.", + [3]byte{204, 159, 53}: "Transbit Sp. z o.o.", + [3]byte{204, 160, 229}: "DZG Metering GmbH", + [3]byte{204, 162, 35}: "Huawei Technologies Co., Ltd", + [3]byte{204, 163, 116}: "Guangdong Guanglian Electronic Technology Co.Ltd", + [3]byte{204, 164, 98}: "ARRIS Group, Inc.", + [3]byte{204, 166, 20}: "AIFA TECHNOLOGY CORP.", + [3]byte{204, 175, 120}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{204, 178, 85}: "D-Link International", + [3]byte{204, 179, 248}: "FUJITSU ISOTEC LIMITED", + [3]byte{204, 181, 90}: "Fraunhofer ITWM", + [3]byte{204, 182, 145}: "NECMagnusCommunications", + [3]byte{204, 184, 136}: "AnB Securite s.a.", + [3]byte{204, 184, 241}: "EAGLE KINGDOM TECHNOLOGIES LIMITED", + [3]byte{204, 189, 53}: "Steinel GmbH", + [3]byte{204, 189, 211}: "Ultimaker B.V.", + [3]byte{204, 190, 113}: "OptiLogix BV", + [3]byte{204, 193, 4}: "Applied Technical Systems", + [3]byte{204, 195, 234}: "Motorola Mobility LLC", + [3]byte{204, 197, 10}: "SHENZHEN DAJIAHAO TECHNOLOGY CO.,LTD", + [3]byte{204, 198, 43}: "Tri-Systems Corporation", + [3]byte{204, 200, 215}: "CIAS Elettronica srl", + [3]byte{204, 204, 78}: "Sun Fountainhead USA. Corp", + [3]byte{204, 204, 129}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{204, 205, 100}: "SM-Electronic GmbH", + [3]byte{204, 206, 64}: "Janteq Corp", + [3]byte{204, 210, 155}: "Shenzhen Bopengfa Elec&Technology CO.,Ltd", + [3]byte{204, 213, 57}: "Cisco", + [3]byte{204, 216, 17}: "Aiconn Technology Corporation", + [3]byte{204, 216, 193}: "Cisco", + [3]byte{204, 217, 233}: "SCR Engineers Ltd.", + [3]byte{204, 225, 127}: "juniper networks", + [3]byte{204, 225, 213}: "Buffalo Inc.", + [3]byte{204, 231, 152}: "My Social Stuff", + [3]byte{204, 231, 223}: "American Magnetics, Inc.", + [3]byte{204, 232, 172}: "SOYEA Technology Co.,Ltd.", + [3]byte{204, 234, 28}: "DCONWORKS Co., Ltd", + [3]byte{204, 238, 217}: "Deto Mechatronic GmbH", + [3]byte{204, 239, 72}: "CISCO SYSTEMS, INC.", + [3]byte{204, 243, 165}: "Chi Mei Communication Systems, Inc", + [3]byte{204, 244, 7}: "EUKREA ELECTROMATIQUE SARL", + [3]byte{204, 245, 56}: "3isysnetworks", + [3]byte{204, 246, 122}: "Ayecka Communication Systems LTD", + [3]byte{204, 248, 65}: "Lumewave", + [3]byte{204, 248, 240}: "Xi'an HISU Multimedia Technology Co.,Ltd.", + [3]byte{204, 249, 84}: "Avaya, Inc", + [3]byte{204, 249, 232}: "Samsung Electronics Co.,Ltd", + [3]byte{204, 250, 0}: "LG Electronics", + [3]byte{204, 251, 101}: "Nintendo Co., Ltd.", + [3]byte{204, 252, 109}: "RIZ TRANSMITTERS", + [3]byte{204, 252, 177}: "Wireless Technology, Inc.", + [3]byte{204, 254, 60}: "Samsung Electronics", + [3]byte{208, 7, 144}: "Texas Instruments", + [3]byte{208, 10, 171}: "Yokogawa Digital Computer Corporation", + [3]byte{208, 14, 164}: "Porsche Cars North America", + [3]byte{208, 18, 66}: "BIOS Corporation", + [3]byte{208, 19, 30}: "Sunrex Technology Corp", + [3]byte{208, 21, 74}: "zte corporation", + [3]byte{208, 23, 106}: "Samsung Electronics Co.,Ltd", + [3]byte{208, 26, 167}: "UniPrint", + [3]byte{208, 28, 187}: "Beijing Ctimes Digital Technology Co., Ltd.", + [3]byte{208, 34, 18}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{208, 34, 190}: "Samsung Electro Mechanics co.,LTD.", + [3]byte{208, 35, 219}: "Apple", + [3]byte{208, 39, 136}: "Hon Hai Precision Ind.Co.Ltd", + [3]byte{208, 44, 69}: "littleBits Electronics, Inc.", + [3]byte{208, 45, 179}: "Huawei Technologies Co., Ltd", + [3]byte{208, 49, 16}: "Ingenic Semiconductor Co.,Ltd", + [3]byte{208, 55, 97}: "Texas Instruments", + [3]byte{208, 57, 114}: "Texas Instruments", + [3]byte{208, 57, 179}: "ARRIS Group, Inc.", + [3]byte{208, 70, 220}: "Southwest Research Institute", + [3]byte{208, 76, 193}: "SINTRONES Technology Corp.", + [3]byte{208, 79, 126}: "Apple", + [3]byte{208, 80, 153}: "ASRock Incorporation", + [3]byte{208, 81, 98}: "Sony Mobile Communications AB", + [3]byte{208, 82, 168}: "Physical Graph Corporation", + [3]byte{208, 84, 45}: "Cambridge Industries(Group) Co.,Ltd.", + [3]byte{208, 87, 76}: "CISCO SYSTEMS, INC.", + [3]byte{208, 87, 133}: "Pantech Co., Ltd.", + [3]byte{208, 87, 161}: "Werma Signaltechnik GmbH & Co. KG", + [3]byte{208, 88, 117}: "Active Control Technology Inc.", + [3]byte{208, 89, 195}: "CeraMicro Technology Corporation", + [3]byte{208, 89, 228}: "Samsung Electronics Co.,Ltd", + [3]byte{208, 90, 15}: "I-BT DIGITAL CO.,LTD", + [3]byte{208, 90, 241}: "Shenzhen Pulier Tech CO.,Ltd", + [3]byte{208, 91, 168}: "zte corporation", + [3]byte{208, 95, 184}: "Texas Instruments", + [3]byte{208, 95, 206}: "Hitachi Data Systems", + [3]byte{208, 98, 160}: "China Essence Technology (Zhumadian) Co., Ltd.", + [3]byte{208, 99, 77}: "Meiko Maschinenbau GmbH & Co. KG", + [3]byte{208, 99, 180}: "SolidRun Ltd.", + [3]byte{208, 102, 123}: "Samsung Electronics Co., LTD", + [3]byte{208, 103, 229}: "Dell Inc", + [3]byte{208, 105, 158}: "LUMINEX Lighting Control Equipment", + [3]byte{208, 105, 208}: "Verto Medical Solutions, LLC", + [3]byte{208, 114, 220}: "Cisco", + [3]byte{208, 115, 127}: "Mini-Circuits", + [3]byte{208, 115, 142}: "DONG OH PRECISION CO., LTD.", + [3]byte{208, 115, 213}: "LIFI LABS MANAGEMENT PTY LTD", + [3]byte{208, 117, 190}: "Reno A&E", + [3]byte{208, 118, 80}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{208, 122, 181}: "Huawei Technologies Co., Ltd", + [3]byte{208, 125, 229}: "Forward Pay Systems, Inc.", + [3]byte{208, 126, 40}: "Hewlett Packard", + [3]byte{208, 126, 53}: "Intel Corporate", + [3]byte{208, 132, 176}: "Sagemcom", + [3]byte{208, 137, 153}: "APCON, Inc.", + [3]byte{208, 138, 85}: "Skullcandy", + [3]byte{208, 139, 126}: "Passif Semiconductor", + [3]byte{208, 140, 181}: "Texas Instruments", + [3]byte{208, 140, 255}: "UPWIS AB", + [3]byte{208, 147, 248}: "Stonestreet One LLC", + [3]byte{208, 149, 199}: "Pantech Co., Ltd.", + [3]byte{208, 155, 5}: "Emtronix", + [3]byte{208, 156, 48}: "Foster Electric Company, Limited", + [3]byte{208, 157, 10}: "LINKCOM", + [3]byte{208, 160, 214}: "Chengdu TD Tech Ltd.", + [3]byte{208, 163, 17}: "Neuberger Gebäudeautomation GmbH", + [3]byte{208, 174, 236}: "Alpha Networks Inc.", + [3]byte{208, 175, 182}: "Linktop Technology Co., LTD", + [3]byte{208, 179, 63}: "SHENZHEN TINNO MOBILE TECHNOLOGY CO.,LTD.", + [3]byte{208, 180, 152}: "Robert Bosch LLC Automotive Electronics", + [3]byte{208, 181, 35}: "Bestcare Cloucal Corp.", + [3]byte{208, 181, 61}: "SEPRO ROBOTIQUE", + [3]byte{208, 187, 128}: "SHL Telemedicine International Ltd.", + [3]byte{208, 189, 1}: "DS International", + [3]byte{208, 190, 44}: "CNSLink Co., Ltd.", + [3]byte{208, 193, 177}: "Samsung Electronics Co.,Ltd", + [3]byte{208, 194, 130}: "CISCO SYSTEMS, INC.", + [3]byte{208, 196, 47}: "Tamagawa Seiki Co.,Ltd.", + [3]byte{208, 199, 137}: "Cisco", + [3]byte{208, 199, 192}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{208, 205, 225}: "Scientech Electronics", + [3]byte{208, 207, 94}: "Energy Micro AS", + [3]byte{208, 208, 253}: "CISCO SYSTEMS, INC.", + [3]byte{208, 210, 18}: "K2NET Co.,Ltd.", + [3]byte{208, 210, 134}: "Beckman Coulter K.K.", + [3]byte{208, 211, 252}: "Mios, Ltd.", + [3]byte{208, 212, 18}: "ADB Broadband Italia", + [3]byte{208, 212, 113}: "MVTECH co., Ltd", + [3]byte{208, 214, 204}: "Wintop", + [3]byte{208, 219, 50}: "Nokia Corporation", + [3]byte{208, 223, 154}: "Liteon Technology Corporation", + [3]byte{208, 223, 178}: "Genie Networks Limited", + [3]byte{208, 223, 199}: "Samsung Electronics Co.,Ltd", + [3]byte{208, 225, 64}: "Apple, Inc", + [3]byte{208, 227, 71}: "Yoga", + [3]byte{208, 228, 11}: "Wearable Inc.", + [3]byte{208, 229, 77}: "Pace plc", + [3]byte{208, 231, 130}: "Azurewave Technologies, Inc.", + [3]byte{208, 235, 3}: "Zhehua technology limited", + [3]byte{208, 235, 158}: "Seowoo Inc.", + [3]byte{208, 240, 219}: "Ericsson", + [3]byte{208, 242, 127}: "SteadyServ Technoligies, LLC", + [3]byte{208, 247, 59}: "Helmut Mauell GmbH", + [3]byte{208, 250, 29}: "Qihoo 360 Technology Co.,Ltd", + [3]byte{208, 255, 80}: "Texas Instruments, Inc", + [3]byte{212, 0, 13}: "Phoenix Broadband Technologies, LLC.", + [3]byte{212, 0, 87}: "MC Technologies GmbH", + [3]byte{212, 1, 41}: "Broadcom Corporation", + [3]byte{212, 1, 109}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{212, 2, 74}: "Delphian Systems LLC", + [3]byte{212, 11, 185}: "Solid Semecs bv.", + [3]byte{212, 15, 178}: "Applied Micro Electronics AME bv", + [3]byte{212, 16, 144}: "iNFORM Systems AG", + [3]byte{212, 16, 207}: "Huanshun Network Science and Technology Co., Ltd.", + [3]byte{212, 17, 214}: "ShotSpotter, Inc.", + [3]byte{212, 18, 150}: "Anobit Technologies Ltd.", + [3]byte{212, 18, 187}: "Quadrant Components Inc. Ltd", + [3]byte{212, 19, 111}: "Asia Pacific Brands", + [3]byte{212, 28, 28}: "RCF S.P.A.", + [3]byte{212, 30, 53}: "TOHO Electronics INC.", + [3]byte{212, 31, 12}: "TVI Vision Oy", + [3]byte{212, 32, 109}: "HTC Corporation", + [3]byte{212, 33, 34}: "Sercomm Corporation", + [3]byte{212, 34, 63}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{212, 34, 78}: "Alcatel Lucent", + [3]byte{212, 39, 81}: "Infopia Co., Ltd", + [3]byte{212, 40, 178}: "ioBridge, Inc.", + [3]byte{212, 41, 234}: "Zimory GmbH", + [3]byte{212, 44, 61}: "Sky Light Digital Limited", + [3]byte{212, 47, 35}: "Akenori PTE Ltd", + [3]byte{212, 49, 157}: "Sinwatec", + [3]byte{212, 50, 102}: "Fike Corporation", + [3]byte{212, 55, 215}: "zte corporation", + [3]byte{212, 58, 101}: "IGRS Engineering Lab Ltd.", + [3]byte{212, 58, 233}: "DONGGUAN ipt INDUSTRIAL CO., LTD", + [3]byte{212, 61, 103}: "Carma Industries Inc.", + [3]byte{212, 61, 126}: "Micro-Star Int'l Co, Ltd", + [3]byte{212, 67, 168}: "Changzhou Haojie Electric Co., Ltd.", + [3]byte{212, 75, 94}: "TAIYO YUDEN CO., LTD.", + [3]byte{212, 76, 36}: "Vuppalamritha Magnetic Components LTD", + [3]byte{212, 76, 156}: "Shenzhen YOOBAO Technology Co.Ltd", + [3]byte{212, 76, 167}: "Informtekhnika & Communication, LLC", + [3]byte{212, 79, 128}: "Kemper Digital GmbH", + [3]byte{212, 80, 122}: "CEIVA Logic, Inc", + [3]byte{212, 82, 81}: "IBT Ingenieurbureau Broennimann Thun", + [3]byte{212, 82, 151}: "nSTREAMS Technologies, Inc.", + [3]byte{212, 83, 175}: "VIGO System S.A.", + [3]byte{212, 90, 178}: "Galleon Systems", + [3]byte{212, 92, 112}: "Wi-Fi Alliance", + [3]byte{212, 93, 66}: "Nokia Corporation", + [3]byte{212, 97, 50}: "Pro Concept Manufacturer Co.,Ltd.", + [3]byte{212, 100, 247}: "CHENGDU USEE DIGITAL TECHNOLOGY CO., LTD", + [3]byte{212, 102, 168}: "Riedo Networks GmbH", + [3]byte{212, 103, 97}: "SAHAB TECHNOLOGY", + [3]byte{212, 103, 231}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{212, 104, 103}: "Neoventus Design Group", + [3]byte{212, 106, 145}: "Snap AV", + [3]byte{212, 106, 168}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{212, 108, 191}: "Goodrich ISR", + [3]byte{212, 108, 218}: "CSM GmbH", + [3]byte{212, 110, 92}: "Huawei Technologies Co., Ltd", + [3]byte{212, 111, 66}: "WAXESS USA Inc", + [3]byte{212, 121, 195}: "Cameronet GmbH & Co. KG", + [3]byte{212, 123, 53}: "NEO Monitors AS", + [3]byte{212, 123, 117}: "HARTING Electronics GmbH", + [3]byte{212, 129, 202}: "iDevices, LLC", + [3]byte{212, 130, 62}: "Argosy Technologies, Ltd.", + [3]byte{212, 133, 100}: "Hewlett-Packard Company", + [3]byte{212, 135, 216}: "Samsung Electronics", + [3]byte{212, 136, 144}: "Samsung Electronics Co.,Ltd", + [3]byte{212, 140, 181}: "CISCO SYSTEMS, INC.", + [3]byte{212, 141, 217}: "Meld Technology, Inc", + [3]byte{212, 143, 51}: "Microsoft Corporation", + [3]byte{212, 143, 170}: "Sogecam Industrial, S.A.", + [3]byte{212, 145, 175}: "Electroacustica General Iberica, S.A.", + [3]byte{212, 147, 152}: "Nokia Corporation", + [3]byte{212, 147, 160}: "Fidelix Oy", + [3]byte{212, 148, 90}: "COSMO CO., LTD", + [3]byte{212, 148, 161}: "Texas Instruments", + [3]byte{212, 149, 36}: "Clover Network, Inc.", + [3]byte{212, 150, 223}: "SUNGJIN C&T CO.,LTD", + [3]byte{212, 151, 11}: "XIAOMI CORPORATION", + [3]byte{212, 154, 32}: "Apple", + [3]byte{212, 156, 40}: "JayBird Gear LLC", + [3]byte{212, 156, 142}: "University of FUKUI", + [3]byte{212, 158, 109}: "Wuhan Zhongyuan Huadian Science & Technology Co.,", + [3]byte{212, 160, 42}: "CISCO SYSTEMS, INC.", + [3]byte{212, 164, 37}: "SMAX Technology Co., Ltd.", + [3]byte{212, 164, 153}: "InView Technology Corporation", + [3]byte{212, 169, 40}: "GreenWave Reality Inc", + [3]byte{212, 170, 255}: "MICRO WORLD", + [3]byte{212, 172, 78}: "BODi rS, LLC", + [3]byte{212, 173, 45}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{212, 174, 82}: "Dell Inc", + [3]byte{212, 177, 16}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{212, 180, 62}: "Messcomp Datentechnik GmbH", + [3]byte{212, 190, 217}: "Dell Inc", + [3]byte{212, 191, 45}: "SE Controls Asia Pacific Ltd", + [3]byte{212, 191, 127}: "UPVEL", + [3]byte{212, 193, 252}: "Nokia Corporation", + [3]byte{212, 199, 102}: "Acentic GmbH", + [3]byte{212, 201, 239}: "Hewlett Packard", + [3]byte{212, 202, 109}: "Routerboard.com", + [3]byte{212, 202, 110}: "u-blox AG", + [3]byte{212, 203, 175}: "Nokia Corporation", + [3]byte{212, 206, 184}: "Enatel LTD", + [3]byte{212, 207, 249}: "Shenzhen Sen5 Technology Co., Ltd.", + [3]byte{212, 209, 132}: "ADB Broadband Italia", + [3]byte{212, 210, 73}: "Power Ethernet", + [3]byte{212, 213, 13}: "Southwest Microwave, Inc", + [3]byte{212, 215, 72}: "CISCO SYSTEMS, INC.", + [3]byte{212, 216, 152}: "Korea CNO Tech Co., Ltd", + [3]byte{212, 217, 25}: "GoPro", + [3]byte{212, 223, 87}: "Alpinion Medical Systems", + [3]byte{212, 224, 142}: "ValueHD Corporation", + [3]byte{212, 227, 44}: "S. Siedle & Sohne", + [3]byte{212, 227, 63}: "Alcatel-Lucent", + [3]byte{212, 232, 178}: "Samsung Electronics", + [3]byte{212, 234, 14}: "Avaya, Inc", + [3]byte{212, 236, 12}: "Harley-Davidson Motor Company", + [3]byte{212, 236, 134}: "LinkedHope Intelligent Technologies Co., Ltd", + [3]byte{212, 238, 7}: "HIWIFI Co., Ltd.", + [3]byte{212, 240, 39}: "Navetas Energy Management", + [3]byte{212, 240, 180}: "Napco Security Technologies", + [3]byte{212, 241, 67}: "IPROAD.,Inc", + [3]byte{212, 244, 111}: "Apple", + [3]byte{212, 245, 19}: "Texas Instruments", + [3]byte{212, 246, 63}: "IEA S.R.L.", + [3]byte{216, 0, 77}: "Apple", + [3]byte{216, 5, 46}: "Skyviia Corporation", + [3]byte{216, 6, 209}: "Honeywell Fire System (Shanghai) Co,. Ltd.", + [3]byte{216, 8, 245}: "Arcadia Networks Co. Ltd.", + [3]byte{216, 9, 195}: "Cercacor Labs", + [3]byte{216, 12, 207}: "C.G.V. S.A.S.", + [3]byte{216, 13, 227}: "FXI TECHNOLOGIES AS", + [3]byte{216, 21, 13}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{216, 22, 10}: "Nippon Electro-Sensory Devices", + [3]byte{216, 24, 43}: "Conti Temic Microelectronic GmbH", + [3]byte{216, 25, 206}: "Telesquare", + [3]byte{216, 27, 254}: "TWINLINX CORPORATION", + [3]byte{216, 28, 20}: "Compacta International, Ltd.", + [3]byte{216, 30, 222}: "B&W Group Ltd", + [3]byte{216, 36, 189}: "CISCO SYSTEMS, INC.", + [3]byte{216, 37, 34}: "Pace plc", + [3]byte{216, 38, 185}: "Guangdong Coagent Electronics S &T Co., Ltd.", + [3]byte{216, 39, 12}: "MaxTronic International Co., Ltd.", + [3]byte{216, 40, 201}: "General Electric Consumer and Industrial", + [3]byte{216, 41, 22}: "Ascent Communication Technology", + [3]byte{216, 41, 134}: "Best Wish Technology LTD", + [3]byte{216, 42, 21}: "Leitner SpA", + [3]byte{216, 42, 126}: "Nokia Corporation", + [3]byte{216, 45, 155}: "Shenzhen G.Credit Communication Technology Co., Ltd", + [3]byte{216, 45, 225}: "Tricascade Inc.", + [3]byte{216, 48, 98}: "Apple", + [3]byte{216, 49, 207}: "Samsung Electronics Co.,Ltd", + [3]byte{216, 51, 127}: "Office FA.com Co.,Ltd.", + [3]byte{216, 60, 105}: "Tinno Mobile Technology Corp", + [3]byte{216, 66, 172}: "Shanghai Feixun Communication Co.,Ltd.", + [3]byte{216, 70, 6}: "Silicon Valley Global Marketing", + [3]byte{216, 73, 11}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{216, 73, 47}: "CANON INC.", + [3]byte{216, 74, 135}: "OI ELECTRIC CO.,LTD", + [3]byte{216, 75, 42}: "Cognitas Technologies, Inc.", + [3]byte{216, 80, 230}: "ASUSTek COMPUTER INC.", + [3]byte{216, 84, 58}: "Texas Instruments", + [3]byte{216, 87, 239}: "Samsung Electronics", + [3]byte{216, 88, 215}: "CZ.NIC, z.s.p.o.", + [3]byte{216, 93, 76}: "TP-LINK Technologies Co.,Ltd.", + [3]byte{216, 93, 132}: "CAx soft GmbH", + [3]byte{216, 93, 251}: "PRIVATE", + [3]byte{216, 97, 148}: "Objetivos y Sevicios de Valor Añadido", + [3]byte{216, 98, 219}: "Eno Inc.", + [3]byte{216, 101, 149}: "Toy's Myth Inc.", + [3]byte{216, 102, 198}: "Shenzhen Daystar Technology Co.,ltd", + [3]byte{216, 102, 238}: "BOXIN COMMUNICATION CO.,LTD.", + [3]byte{216, 103, 217}: "CISCO SYSTEMS, INC.", + [3]byte{216, 105, 96}: "Steinsvik", + [3]byte{216, 107, 247}: "Nintendo Co., Ltd.", + [3]byte{216, 108, 233}: "SAGEMCOM SAS", + [3]byte{216, 113, 87}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{216, 117, 51}: "Nokia Corporation", + [3]byte{216, 118, 10}: "Escort, Inc.", + [3]byte{216, 120, 229}: "KUHN SA", + [3]byte{216, 121, 136}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{216, 124, 221}: "SANIX INCORPORATED", + [3]byte{216, 126, 177}: "x.o.ware, inc.", + [3]byte{216, 128, 57}: "Microchip Technology Inc.", + [3]byte{216, 129, 206}: "AHN INC.", + [3]byte{216, 132, 102}: "Extreme Networks", + [3]byte{216, 138, 59}: "UNIT-EM", + [3]byte{216, 144, 232}: "Samsung Electronics Co.,Ltd", + [3]byte{216, 149, 47}: "Texas Instruments", + [3]byte{216, 150, 133}: "GoPro", + [3]byte{216, 150, 149}: "Apple", + [3]byte{216, 150, 224}: "Alibaba Cloud Computing Ltd.", + [3]byte{216, 151, 59}: "Artesyn Embedded Technologies", + [3]byte{216, 151, 96}: "C2 Development, Inc.", + [3]byte{216, 151, 124}: "Grey Innovation", + [3]byte{216, 151, 186}: "PEGATRON CORPORATION", + [3]byte{216, 157, 103}: "Hewlett Packard", + [3]byte{216, 157, 185}: "eMegatech International Corp.", + [3]byte{216, 158, 63}: "Apple", + [3]byte{216, 162, 94}: "Apple", + [3]byte{216, 174, 144}: "Itibia Technologies", + [3]byte{216, 175, 59}: "Hangzhou Bigbright Integrated communications system Co.,Ltd", + [3]byte{216, 175, 241}: "Panasonic Appliances Company", + [3]byte{216, 176, 46}: "Guangzhou Zonerich Business Machine Co., Ltd", + [3]byte{216, 176, 76}: "Jinan USR IOT Technology Co., Ltd.", + [3]byte{216, 177, 42}: "Panasonic Mobile Communications Co., Ltd.", + [3]byte{216, 179, 119}: "HTC Corporation", + [3]byte{216, 182, 183}: "Comtrend Corporation", + [3]byte{216, 182, 193}: "NetworkAccountant, Inc.", + [3]byte{216, 182, 214}: "Blu Tether Limited", + [3]byte{216, 184, 246}: "Nantworks", + [3]byte{216, 185, 14}: "Triple Domain Vision Co.,Ltd.", + [3]byte{216, 187, 44}: "Apple", + [3]byte{216, 191, 76}: "Victory Concept Electronics Limited", + [3]byte{216, 192, 104}: "Netgenetech.co.,ltd.", + [3]byte{216, 195, 251}: "DETRACOM", + [3]byte{216, 198, 145}: "Hichan Technology Corp.", + [3]byte{216, 199, 200}: "Aruba Networks", + [3]byte{216, 201, 157}: "EA DISPLAY LIMITED", + [3]byte{216, 203, 138}: "Micro-Star INTL CO., LTD.", + [3]byte{216, 207, 156}: "Apple", + [3]byte{216, 209, 203}: "Apple", + [3]byte{216, 210, 124}: "JEMA ENERGY, SA", + [3]byte{216, 211, 133}: "Hewlett-Packard Company", + [3]byte{216, 212, 60}: "Sony Corporation", + [3]byte{216, 213, 185}: "Rainforest Automation, Inc.", + [3]byte{216, 214, 126}: "GSK CNC EQUIPMENT CO.,LTD", + [3]byte{216, 218, 82}: "APATOR S.A.", + [3]byte{216, 220, 233}: "Kunshan Erlab ductless filtration system Co.,Ltd", + [3]byte{216, 221, 95}: "BALMUDA Inc.", + [3]byte{216, 221, 253}: "Texas Instruments", + [3]byte{216, 222, 206}: "ISUNG CO.,LTD", + [3]byte{216, 223, 13}: "beroNet GmbH", + [3]byte{216, 227, 174}: "CIRTEC MEDICAL SYSTEMS", + [3]byte{216, 229, 109}: "TCT Mobile Limited", + [3]byte{216, 231, 43}: "NetScout Systems, Inc.", + [3]byte{216, 231, 67}: "Wush, Inc", + [3]byte{216, 233, 82}: "KEOPSYS", + [3]byte{216, 235, 151}: "TRENDnet, Inc.", + [3]byte{216, 238, 120}: "Moog Protokraft", + [3]byte{216, 240, 242}: "Zeebo Inc", + [3]byte{216, 247, 16}: "Libre Wireless Technologies Inc.", + [3]byte{216, 251, 17}: "AXACORE", + [3]byte{216, 252, 147}: "Intel Corporate", + [3]byte{216, 254, 143}: "IDFone Co., Ltd.", + [3]byte{216, 254, 227}: "D-Link International", + [3]byte{220, 2, 101}: "Meditech Kft", + [3]byte{220, 2, 142}: "zte corporation", + [3]byte{220, 5, 47}: "National Products Inc.", + [3]byte{220, 5, 117}: "SIEMENS ENERGY AUTOMATION", + [3]byte{220, 5, 237}: "Nabtesco Corporation", + [3]byte{220, 7, 193}: "HangZhou QiYang Technology Co.,Ltd.", + [3]byte{220, 11, 26}: "ADB Broadband Italia", + [3]byte{220, 14, 161}: "COMPAL INFORMATION (KUNSHAN) CO., LTD", + [3]byte{220, 22, 162}: "Medtronic Diabetes", + [3]byte{220, 23, 90}: "Hitachi High-Technologies Corporation", + [3]byte{220, 23, 146}: "Captivate Network", + [3]byte{220, 29, 159}: "U & B tech", + [3]byte{220, 29, 212}: "Microstep-MIS spol. s r.o.", + [3]byte{220, 30, 163}: "Accensus LLC", + [3]byte{220, 32, 8}: "ASD Electronics Ltd", + [3]byte{220, 42, 20}: "Shanghai Longjing Technology Co.", + [3]byte{220, 43, 97}: "Apple", + [3]byte{220, 43, 102}: "InfoBLOCK S.A. de C.V.", + [3]byte{220, 43, 202}: "Zera GmbH", + [3]byte{220, 44, 38}: "Iton Technology Limited", + [3]byte{220, 46, 106}: "HCT. Co., Ltd.", + [3]byte{220, 47, 3}: "Step forward Group Co., Ltd.", + [3]byte{220, 48, 156}: "Heyrex Limited", + [3]byte{220, 51, 80}: "TechSAT GmbH", + [3]byte{220, 55, 210}: "Hunan HKT Electronic Technology Co., Ltd", + [3]byte{220, 56, 225}: "Juniper networks", + [3]byte{220, 57, 121}: "Skyport Systems", + [3]byte{220, 58, 94}: "Roku, Inc", + [3]byte{220, 60, 46}: "Manufacturing System Insights, Inc.", + [3]byte{220, 60, 132}: "Ticom Geomatics, Inc.", + [3]byte{220, 62, 81}: "Solberg & Andersen AS", + [3]byte{220, 62, 248}: "Nokia Corporation", + [3]byte{220, 69, 23}: "ARRIS Group, Inc.", + [3]byte{220, 73, 201}: "CASCO SIGNAL LTD", + [3]byte{220, 78, 222}: "SHINYEI TECHNOLOGY CO., LTD.", + [3]byte{220, 83, 124}: "Compal Broadband Networks, Inc.", + [3]byte{220, 87, 38}: "Power-One", + [3]byte{220, 94, 54}: "Paterson Technology", + [3]byte{220, 100, 124}: "C.R.S. iiMotion GmbH", + [3]byte{220, 102, 58}: "Apacer Technology Inc.", + [3]byte{220, 111, 0}: "Livescribe, Inc.", + [3]byte{220, 111, 8}: "Bay Storage Technology", + [3]byte{220, 112, 20}: "PRIVATE", + [3]byte{220, 113, 68}: "Samsung Electro Mechanics", + [3]byte{220, 123, 148}: "CISCO SYSTEMS, INC.", + [3]byte{220, 130, 91}: "JANUS, spol. s r.o.", + [3]byte{220, 133, 222}: "Azurewave Technologies., inc.", + [3]byte{220, 134, 216}: "Apple, Inc", + [3]byte{220, 155, 30}: "Intercom, Inc.", + [3]byte{220, 155, 156}: "Apple", + [3]byte{220, 156, 82}: "Sapphire Technology Limited.", + [3]byte{220, 159, 164}: "Nokia Corporation", + [3]byte{220, 159, 219}: "Ubiquiti Networks, Inc.", + [3]byte{220, 165, 244}: "Cisco", + [3]byte{220, 166, 189}: "Beijing Lanbo Technology Co., Ltd.", + [3]byte{220, 167, 217}: "Compressor Controls Corp", + [3]byte{220, 168, 207}: "New Spin Golf, LLC.", + [3]byte{220, 169, 113}: "Intel Corporate", + [3]byte{220, 169, 137}: "MACANDC", + [3]byte{220, 173, 158}: "GreenPriz", + [3]byte{220, 174, 4}: "CELOXICA Ltd", + [3]byte{220, 176, 88}: "Burkert Werke GmbH", + [3]byte{220, 180, 196}: "Microsoft XCG", + [3]byte{220, 191, 144}: "HUIZHOU QIAOXING TELECOMMUNICATION INDUSTRY CO.,LTD.", + [3]byte{220, 192, 219}: "Shenzhen Kaiboer Technology Co., Ltd.", + [3]byte{220, 193, 1}: "SOLiD Technologies, Inc.", + [3]byte{220, 196, 34}: "Systembase Limited", + [3]byte{220, 198, 34}: "BUHEUNG SYSTEM", + [3]byte{220, 199, 147}: "Nokia Corporation", + [3]byte{220, 203, 168}: "Explora Technologies Inc", + [3]byte{220, 206, 65}: "FE GLOBAL HONG KONG LIMITED", + [3]byte{220, 206, 188}: "Shenzhen JSR Technology Co.,Ltd.", + [3]byte{220, 207, 148}: "Beijing Rongcheng Hutong Technology Co., Ltd.", + [3]byte{220, 208, 247}: "Bentek Systems Ltd.", + [3]byte{220, 210, 252}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{220, 211, 33}: "HUMAX co.,tld", + [3]byte{220, 213, 42}: "Sunny Heart Limited", + [3]byte{220, 216, 127}: "Shenzhen JoinCyber Telecom Equipment Ltd", + [3]byte{220, 218, 79}: "GETCK TECHNOLOGY, INC", + [3]byte{220, 222, 202}: "Akyllor", + [3]byte{220, 226, 172}: "Lumens Digital Optics Inc.", + [3]byte{220, 229, 120}: "Experimental Factory of Scientific Engineering and Special Design Department", + [3]byte{220, 231, 28}: "AUG Elektronik GmbH", + [3]byte{220, 236, 6}: "Heimi Network Technology Co., Ltd.", + [3]byte{220, 240, 93}: "Letta Teknoloji", + [3]byte{220, 241, 16}: "Nokia Corporation", + [3]byte{220, 247, 85}: "SITRONIK", + [3]byte{220, 248, 88}: "Lorent Networks, Inc.", + [3]byte{220, 250, 213}: "STRONG Ges.m.b.H.", + [3]byte{220, 251, 2}: "Buffalo Inc.", + [3]byte{224, 5, 197}: "TP-LINK Technologies Co.,Ltd.", + [3]byte{224, 6, 230}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{224, 11, 40}: "Inovonics", + [3]byte{224, 12, 127}: "Nintendo Co., Ltd.", + [3]byte{224, 13, 185}: "PRIVATE", + [3]byte{224, 16, 127}: "Ruckus Wireless", + [3]byte{224, 20, 62}: "Modoosis Inc.", + [3]byte{224, 24, 119}: "Fujitsu Limited", + [3]byte{224, 28, 65}: "Aerohive Networks Inc.", + [3]byte{224, 28, 238}: "Bravo Tech, Inc.", + [3]byte{224, 29, 56}: "Beijing HuaqinWorld Technology Co.,Ltd", + [3]byte{224, 29, 59}: "Cambridge Industries(Group) Co.,Ltd", + [3]byte{224, 30, 7}: "Anite Telecoms US. Inc", + [3]byte{224, 31, 10}: "Xslent Energy Technologies. LLC", + [3]byte{224, 36, 127}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{224, 37, 56}: "Titan Pet Products", + [3]byte{224, 38, 48}: "Intrigue Technologies, Inc.", + [3]byte{224, 38, 54}: "Nortel Networks", + [3]byte{224, 39, 26}: "TTC Next-generation Home Network System WG", + [3]byte{224, 42, 130}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{224, 47, 109}: "Cisco", + [3]byte{224, 48, 5}: "Alcatel-Lucent Shanghai Bell Co., Ltd", + [3]byte{224, 49, 208}: "SZ Telstar CO., LTD", + [3]byte{224, 54, 227}: "Stage One International Co., Ltd.", + [3]byte{224, 57, 215}: "Plexxi, Inc.", + [3]byte{224, 60, 91}: "SHENZHEN JIAXINJIE ELECTRON CO.,LTD", + [3]byte{224, 62, 68}: "Broadcom Corporation", + [3]byte{224, 62, 74}: "Cavanagh Group International", + [3]byte{224, 62, 125}: "data-complex GmbH", + [3]byte{224, 63, 73}: "ASUSTek COMPUTER INC.", + [3]byte{224, 70, 154}: "NETGEAR", + [3]byte{224, 85, 151}: "Emergent Vision Technologies Inc.", + [3]byte{224, 86, 244}: "AxesNetwork Solutions inc.", + [3]byte{224, 88, 158}: "Laerdal Medical", + [3]byte{224, 91, 112}: "Innovid, Co., Ltd.", + [3]byte{224, 93, 166}: "Detlef Fink Elektronik & Softwareentwicklung", + [3]byte{224, 95, 185}: "CISCO SYSTEMS, INC.", + [3]byte{224, 97, 178}: "HANGZHOU ZENOINTEL TECHNOLOGY CO., LTD", + [3]byte{224, 98, 144}: "Jinan Jovision Science & Technology Co., Ltd.", + [3]byte{224, 99, 229}: "Sony Mobile Communications AB", + [3]byte{224, 100, 187}: "DigiView S.r.l.", + [3]byte{224, 102, 120}: "Apple", + [3]byte{224, 103, 179}: "C-Data Technology Co., Ltd", + [3]byte{224, 105, 149}: "PEGATRON CORPORATION", + [3]byte{224, 117, 10}: "ALPS ERECTORIC CO.,LTD.", + [3]byte{224, 117, 125}: "Motorola Mobility LLC", + [3]byte{224, 124, 98}: "Whistle Labs, Inc.", + [3]byte{224, 127, 83}: "TECHBOARD SRL", + [3]byte{224, 127, 136}: "EVIDENCE Network SIA", + [3]byte{224, 129, 119}: "GreenBytes, Inc.", + [3]byte{224, 135, 177}: "Nata-Info Ltd.", + [3]byte{224, 136, 93}: "Technicolor CH USA Inc", + [3]byte{224, 138, 126}: "Exponent", + [3]byte{224, 143, 236}: "REPOTEC CO., LTD.", + [3]byte{224, 145, 83}: "XAVi Technologies Corp.", + [3]byte{224, 145, 245}: "NETGEAR", + [3]byte{224, 148, 103}: "Intel Corporate", + [3]byte{224, 149, 121}: "ORTHOsoft inc, d/b/a Zimmer CAS", + [3]byte{224, 151, 150}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{224, 151, 242}: "Atomax Inc.", + [3]byte{224, 157, 49}: "Intel Corporate", + [3]byte{224, 157, 184}: "PLANEX COMMUNICATIONS INC.", + [3]byte{224, 161, 152}: "NOJA Power Switchgear Pty Ltd", + [3]byte{224, 161, 215}: "SFR", + [3]byte{224, 163, 15}: "Pevco", + [3]byte{224, 166, 112}: "Nokia Corporation", + [3]byte{224, 170, 176}: "GENERAL VISION ELECTRONICS CO. LTD.", + [3]byte{224, 171, 254}: "Orb Networks, Inc.", + [3]byte{224, 172, 241}: "Cisco", + [3]byte{224, 174, 94}: "ALPS Co,. Ltd.", + [3]byte{224, 174, 178}: "Bender GmbH & Co.KG", + [3]byte{224, 174, 237}: "LOENK", + [3]byte{224, 175, 75}: "Pluribus Networks, Inc.", + [3]byte{224, 178, 241}: "FN-LINK TECHNOLOGY LIMITED", + [3]byte{224, 181, 45}: "Apple", + [3]byte{224, 183, 177}: "Pace plc", + [3]byte{224, 185, 165}: "Azurewave", + [3]byte{224, 185, 186}: "Apple", + [3]byte{224, 188, 67}: "C2 Microsystems, Inc.", + [3]byte{224, 194, 134}: "Aisai Communication Technology Co., Ltd.", + [3]byte{224, 194, 183}: "Masimo Corporation", + [3]byte{224, 195, 243}: "ZTE Corporation", + [3]byte{224, 198, 179}: "MilDef AB", + [3]byte{224, 199, 157}: "Texas Instruments", + [3]byte{224, 200, 106}: "SHENZHEN TW-SCIE Co., Ltd", + [3]byte{224, 201, 34}: "Jireh Energy Tech., Ltd.", + [3]byte{224, 201, 122}: "Apple", + [3]byte{224, 202, 77}: "Shenzhen Unistar Communication Co.,LTD", + [3]byte{224, 202, 148}: "Askey Computer", + [3]byte{224, 203, 29}: "PRIVATE", + [3]byte{224, 203, 78}: "ASUSTek COMPUTER INC.", + [3]byte{224, 203, 238}: "Samsung Electronics Co.,Ltd", + [3]byte{224, 206, 195}: "ASKEY COMPUTER CORP", + [3]byte{224, 207, 45}: "Gemintek Corporation", + [3]byte{224, 209, 10}: "Katoudenkikougyousyo co ltd", + [3]byte{224, 209, 230}: "Aliph dba Jawbone", + [3]byte{224, 211, 26}: "EQUES Technology Co., Limited", + [3]byte{224, 215, 186}: "Texas Instruments", + [3]byte{224, 217, 162}: "Hippih aps", + [3]byte{224, 218, 220}: "JVC KENWOOD Corporation", + [3]byte{224, 219, 85}: "Dell Inc", + [3]byte{224, 219, 136}: "Open Standard Digital-IF Interface for SATCOM Systems", + [3]byte{224, 220, 160}: "Siemens Electrical Apparatus Ltd., Suzhou Chengdu Branch", + [3]byte{224, 230, 49}: "SNB TECHNOLOGIES LIMITED", + [3]byte{224, 231, 81}: "Nintendo Co., Ltd.", + [3]byte{224, 232, 232}: "Olive Telecommunication Pvt. Ltd", + [3]byte{224, 237, 26}: "vastriver Technology Co., Ltd", + [3]byte{224, 237, 199}: "Shenzhen Friendcom Technology Development Co., Ltd", + [3]byte{224, 238, 27}: "Panasonic Automotive Systems Company of America", + [3]byte{224, 239, 37}: "Lintes Technology Co., Ltd.", + [3]byte{224, 242, 17}: "Digitalwatt", + [3]byte{224, 243, 121}: "Vaddio", + [3]byte{224, 245, 198}: "Apple", + [3]byte{224, 245, 202}: "CHENG UEI PRECISION INDUSTRY CO.,LTD.", + [3]byte{224, 248, 71}: "Apple", + [3]byte{224, 249, 190}: "Cloudena Corp.", + [3]byte{224, 250, 236}: "Platan sp. z o.o. sp. k.", + [3]byte{228, 4, 57}: "TomTom Software Ltd", + [3]byte{228, 17, 91}: "Hewlett Packard", + [3]byte{228, 18, 24}: "ShenZhen Rapoo Technology Co., Ltd.", + [3]byte{228, 18, 29}: "Samsung Electronics Co.,Ltd", + [3]byte{228, 18, 137}: "topsystem Systemhaus GmbH", + [3]byte{228, 28, 75}: "V2 TECHNOLOGY, INC.", + [3]byte{228, 29, 45}: "Mellanox Technologies, Inc.", + [3]byte{228, 31, 19}: "IBM Corp", + [3]byte{228, 35, 84}: "SHENZHEN FUZHI SOFTWARE TECHNOLOGY CO.,LTD", + [3]byte{228, 37, 231}: "Apple", + [3]byte{228, 37, 233}: "Color-Chip", + [3]byte{228, 39, 113}: "Smartlabs", + [3]byte{228, 42, 211}: "Magneti Marelli S.p.A. Powertrain", + [3]byte{228, 44, 86}: "Lilee Systems, Ltd.", + [3]byte{228, 45, 2}: "TCT Mobile Limited", + [3]byte{228, 47, 38}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{228, 47, 246}: "Unicore communication Inc.", + [3]byte{228, 50, 203}: "Samsung Electronics Co.,Ltd", + [3]byte{228, 53, 147}: "Hangzhou GoTo technology Co.Ltd", + [3]byte{228, 53, 251}: "Sabre Technology (Hull) Ltd", + [3]byte{228, 55, 215}: "HENRI DEPAEPE S.A.S.", + [3]byte{228, 56, 242}: "Advantage Controls", + [3]byte{228, 63, 162}: "Wuxi DSP Technologies Inc.", + [3]byte{228, 64, 226}: "Samsung Electronics Co.,Ltd", + [3]byte{228, 65, 230}: "Ottec Technology GmbH", + [3]byte{228, 70, 189}: "C&C TECHNIC TAIWAN CO., LTD.", + [3]byte{228, 72, 199}: "Cisco SPVTG", + [3]byte{228, 76, 108}: "Shenzhen Guo Wei Electronic Co,. Ltd.", + [3]byte{228, 78, 24}: "Gardasoft VisionLimited", + [3]byte{228, 79, 41}: "MA Lighting Technology GmbH", + [3]byte{228, 79, 95}: "EDS Elektronik Destek San.Tic.Ltd.Sti", + [3]byte{228, 85, 234}: "Dedicated Computing", + [3]byte{228, 86, 20}: "Suttle Apparatus", + [3]byte{228, 87, 168}: "Stuart Manufacturing, Inc.", + [3]byte{228, 93, 82}: "Avaya, Inc", + [3]byte{228, 100, 73}: "ARRIS Group, Inc.", + [3]byte{228, 103, 186}: "Danish Interpretation Systems A/S", + [3]byte{228, 104, 163}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{228, 108, 33}: "messMa GmbH", + [3]byte{228, 113, 133}: "Securifi Ltd", + [3]byte{228, 117, 30}: "Getinge Sterilization AB", + [3]byte{228, 119, 35}: "zte corporation", + [3]byte{228, 119, 107}: "AARTESYS AG", + [3]byte{228, 119, 212}: "Minrray Industry Co.,Ltd", + [3]byte{228, 124, 249}: "Samsung Electronics Co., LTD", + [3]byte{228, 125, 90}: "Beijing Hanbang Technology Corp.", + [3]byte{228, 127, 178}: "Fujitsu Limited", + [3]byte{228, 129, 132}: "Alcatel-Lucent", + [3]byte{228, 129, 179}: "Shenzhen ACT Industrial Co.,Ltd.", + [3]byte{228, 131, 153}: "ARRIS Group, Inc.", + [3]byte{228, 138, 213}: "RF WINDOW CO., LTD.", + [3]byte{228, 139, 127}: "Apple", + [3]byte{228, 140, 15}: "Discovery Insure", + [3]byte{228, 144, 105}: "Rockwell Automation", + [3]byte{228, 146, 231}: "Gridlink Tech. Co.,Ltd.", + [3]byte{228, 146, 251}: "Samsung Electronics Co.,Ltd", + [3]byte{228, 149, 110}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{228, 150, 174}: "ALTOGRAPHICS Inc.", + [3]byte{228, 151, 240}: "Shanghai VLC Technologies Ltd. Co.", + [3]byte{228, 152, 214}: "Apple, Inc", + [3]byte{228, 165, 239}: "TRON LINK ELECTRONICS CO., LTD.", + [3]byte{228, 167, 253}: "Cellco Partnership", + [3]byte{228, 171, 70}: "UAB Selteka", + [3]byte{228, 173, 125}: "SCL Elements", + [3]byte{228, 175, 161}: "HES-SO", + [3]byte{228, 176, 33}: "Samsung Electronics Co.,Ltd", + [3]byte{228, 186, 217}: "360 Fly Inc.", + [3]byte{228, 193, 70}: "Objetivos y Servicios de Valor A", + [3]byte{228, 198, 43}: "Airware", + [3]byte{228, 198, 61}: "Apple, Inc.", + [3]byte{228, 198, 230}: "Mophie, LLC", + [3]byte{228, 199, 34}: "Cisco", + [3]byte{228, 200, 6}: "Ceiec Electric Technology Inc.", + [3]byte{228, 206, 143}: "Apple", + [3]byte{228, 211, 50}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{228, 211, 241}: "Cisco", + [3]byte{228, 213, 61}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{228, 215, 29}: "Oraya Therapeutics", + [3]byte{228, 221, 121}: "En-Vision America, Inc.", + [3]byte{228, 224, 197}: "Samsung Electronics Co., LTD", + [3]byte{228, 228, 9}: "LEIFHEIT AG", + [3]byte{228, 236, 16}: "Nokia Corporation", + [3]byte{228, 238, 253}: "MR&D Manufacturing", + [3]byte{228, 243, 101}: "Time-O-Matic, Inc.", + [3]byte{228, 243, 227}: "Shanghai iComhome Co.,Ltd.", + [3]byte{228, 244, 198}: "NETGEAR", + [3]byte{228, 247, 161}: "Datafox GmbH", + [3]byte{228, 248, 239}: "Samsung Elec Co.,Ltd", + [3]byte{228, 250, 29}: "PAD Peripheral Advanced Design Inc.", + [3]byte{228, 255, 221}: "ELECTRON INDIA", + [3]byte{232, 3, 154}: "Samsung Electronics CO., LTD", + [3]byte{232, 4, 11}: "Apple", + [3]byte{232, 4, 16}: "PRIVATE", + [3]byte{232, 4, 98}: "CISCO SYSTEMS, INC.", + [3]byte{232, 4, 243}: "Throughtek Co., Ltd.", + [3]byte{232, 5, 109}: "Nortel Networks", + [3]byte{232, 6, 136}: "Apple", + [3]byte{232, 8, 139}: "Huawei Technologies Co., Ltd", + [3]byte{232, 11, 19}: "Akib Systems Taiwan, INC", + [3]byte{232, 12, 56}: "DAEYOUNG INFORMATION SYSTEM CO., LTD", + [3]byte{232, 12, 117}: "Syncbak, Inc.", + [3]byte{232, 16, 46}: "Really Simple Software, Inc", + [3]byte{232, 17, 50}: "Samsung Electronics CO., LTD", + [3]byte{232, 19, 36}: "GuangZhou Bonsoninfo System CO.,LTD", + [3]byte{232, 21, 14}: "Nokia Corporation", + [3]byte{232, 23, 252}: "NIFTY Corporation", + [3]byte{232, 24, 99}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{232, 40, 119}: "TMY Co., Ltd.", + [3]byte{232, 40, 213}: "Cots Technology", + [3]byte{232, 42, 234}: "Intel Corporate", + [3]byte{232, 46, 36}: "Out of the Fog Research LLC", + [3]byte{232, 51, 129}: "ARRIS Group, Inc.", + [3]byte{232, 57, 53}: "Hewlett Packard", + [3]byte{232, 57, 223}: "Askey Computer", + [3]byte{232, 58, 151}: "OCZ Technology Group", + [3]byte{232, 62, 182}: "RIM", + [3]byte{232, 62, 251}: "GEODESIC LTD.", + [3]byte{232, 62, 252}: "ARRIS Group, Inc.", + [3]byte{232, 64, 64}: "CISCO SYSTEMS, INC.", + [3]byte{232, 64, 242}: "PEGATRON CORPORATION", + [3]byte{232, 67, 182}: "QNAP Systems, Inc.", + [3]byte{232, 72, 31}: "Advanced Automotive Antennas", + [3]byte{232, 78, 6}: "EDUP INTERNATIONAL (HK) CO., LTD", + [3]byte{232, 78, 132}: "Samsung Electronics Co.,Ltd", + [3]byte{232, 78, 206}: "Nintendo Co., Ltd.", + [3]byte{232, 81, 110}: "TSMART Inc.", + [3]byte{232, 81, 157}: "Yeonhab Precision Co.,LTD", + [3]byte{232, 84, 132}: "NEO INFORMATION SYSTEMS CO., LTD.", + [3]byte{232, 86, 214}: "NCTech Ltd", + [3]byte{232, 90, 167}: "LLC Emzior", + [3]byte{232, 91, 91}: "LG ELECTRONICS INC", + [3]byte{232, 91, 240}: "Imaging Diagnostics", + [3]byte{232, 93, 107}: "Luminate Wireless", + [3]byte{232, 94, 83}: "Infratec Datentechnik GmbH", + [3]byte{232, 97, 31}: "Dawning Information Industry Co.,Ltd", + [3]byte{232, 97, 126}: "Liteon Technology Corporation", + [3]byte{232, 97, 131}: "Black Diamond Advanced Technology, LLC", + [3]byte{232, 108, 218}: "Supercomputers and Neurocomputers Research Center", + [3]byte{232, 109, 82}: "ARRIS Group, Inc.", + [3]byte{232, 109, 84}: "Digit Mobile Inc", + [3]byte{232, 109, 110}: "Control & Display Systems Ltd t/a CDSRail", + [3]byte{232, 113, 141}: "Elsys Equipamentos Eletronicos Ltda", + [3]byte{232, 117, 127}: "FIRS Technologies(Shenzhen) Co., Ltd", + [3]byte{232, 120, 161}: "BEOVIEW INTERCOM DOO", + [3]byte{232, 122, 243}: "S5 Tech S.r.l.", + [3]byte{232, 128, 46}: "Apple", + [3]byte{232, 128, 216}: "GNTEK Electronics Co.,Ltd.", + [3]byte{232, 135, 163}: "Loxley Public Company Limited", + [3]byte{232, 137, 44}: "ARRIS Group, Inc.", + [3]byte{232, 141, 40}: "Apple", + [3]byte{232, 141, 245}: "ZNYX Networks, Inc.", + [3]byte{232, 142, 96}: "NSD Corporation", + [3]byte{232, 146, 24}: "Arcontia International AB", + [3]byte{232, 146, 164}: "LG Electronics", + [3]byte{232, 148, 76}: "Cogent Healthcare Systems Ltd", + [3]byte{232, 148, 246}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{232, 150, 6}: "testo Instruments (Shenzhen) Co., Ltd.", + [3]byte{232, 153, 90}: "PiiGAB, Processinformation i Goteborg AB", + [3]byte{232, 153, 196}: "HTC Corporation", + [3]byte{232, 154, 143}: "Quanta Computer Inc.", + [3]byte{232, 154, 255}: "Fujian Landi Commercial Equipment Co.,Ltd", + [3]byte{232, 157, 135}: "Toshiba", + [3]byte{232, 163, 100}: "Signal Path International / Peachtree Audio", + [3]byte{232, 164, 193}: "Deep Sea Electronics PLC", + [3]byte{232, 171, 250}: "Shenzhen Reecam Tech.Ltd.", + [3]byte{232, 177, 252}: "Intel Corporate", + [3]byte{232, 180, 174}: "Shenzhen C&D Electronics Co.,Ltd", + [3]byte{232, 183, 72}: "CISCO SYSTEMS, INC.", + [3]byte{232, 186, 112}: "CISCO SYSTEMS, INC.", + [3]byte{232, 187, 61}: "Sino Prime-Tech Limited", + [3]byte{232, 187, 168}: "GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP.,LTD.", + [3]byte{232, 190, 129}: "SAGEMCOM", + [3]byte{232, 194, 41}: "H-Displays (MSC) Bhd", + [3]byte{232, 195, 32}: "Austco Communication Systems Pty Ltd", + [3]byte{232, 203, 161}: "Nokia Corporation", + [3]byte{232, 204, 24}: "D-Link International", + [3]byte{232, 204, 50}: "Micronet LTD", + [3]byte{232, 205, 45}: "Huawei Technologies Co., Ltd", + [3]byte{232, 206, 6}: "SkyHawke Technologies, LLC.", + [3]byte{232, 208, 250}: "MKS Instruments Deutschland GmbH", + [3]byte{232, 212, 131}: "ULTIMATE Europe Transportation Equipment GmbH", + [3]byte{232, 212, 224}: "Beijing BenyWave Technology Co., Ltd.", + [3]byte{232, 218, 150}: "Zhuhai Tianrui Electrical Power Tech. Co., Ltd.", + [3]byte{232, 218, 170}: "VideoHome Technology Corp.", + [3]byte{232, 222, 39}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{232, 223, 242}: "PRF Co., Ltd.", + [3]byte{232, 224, 143}: "GRAVOTECH MARKING SAS", + [3]byte{232, 224, 183}: "Toshiba", + [3]byte{232, 225, 226}: "Energotest", + [3]byte{232, 229, 214}: "Samsung Electronics Co.,Ltd", + [3]byte{232, 231, 50}: "Alcatel-Lucent", + [3]byte{232, 231, 112}: "Warp9 Tech Design, Inc.", + [3]byte{232, 231, 118}: "Shenzhen Kootion Technology Co., Ltd", + [3]byte{232, 232, 117}: "iS5 Communications Inc.", + [3]byte{232, 234, 106}: "StarTech.com", + [3]byte{232, 234, 218}: "Denkovi Assembly Electroncs LTD", + [3]byte{232, 237, 5}: "ARRIS Group, Inc.", + [3]byte{232, 237, 243}: "Cisco", + [3]byte{232, 239, 137}: "OPMEX Tech.", + [3]byte{232, 241, 176}: "SAGEMCOM SAS", + [3]byte{232, 242, 38}: "MILLSON CUSTOM SOLUTIONS INC.", + [3]byte{232, 249, 40}: "RFTECH SRL", + [3]byte{232, 252, 96}: "ELCOM Innovations Private Limited", + [3]byte{232, 252, 175}: "NETGEAR INC.,", + [3]byte{236, 14, 196}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{236, 14, 214}: "ITECH INSTRUMENTS SAS", + [3]byte{236, 17, 32}: "FloDesign Wind Turbine Corporation", + [3]byte{236, 19, 178}: "Netonix", + [3]byte{236, 20, 246}: "BioControl AS", + [3]byte{236, 23, 47}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{236, 23, 102}: "Research Centre Module", + [3]byte{236, 26, 89}: "Belkin International Inc.", + [3]byte{236, 29, 127}: "zte corporation", + [3]byte{236, 33, 159}: "VidaBox LLC", + [3]byte{236, 34, 87}: "JiangSu NanJing University Electronic Information Technology Co.,Ltd", + [3]byte{236, 34, 128}: "D-Link International", + [3]byte{236, 35, 61}: "Huawei Technologies Co., Ltd", + [3]byte{236, 35, 104}: "IntelliVoice Co.,Ltd.", + [3]byte{236, 36, 184}: "Texas Instruments", + [3]byte{236, 42, 240}: "Ypsomed AG", + [3]byte{236, 44, 73}: "University of Tokyo", + [3]byte{236, 46, 78}: "HITACHI-LG DATA STORAGE INC", + [3]byte{236, 48, 145}: "CISCO SYSTEMS, INC.", + [3]byte{236, 53, 134}: "Apple", + [3]byte{236, 59, 240}: "NovelSat", + [3]byte{236, 60, 90}: "SHEN ZHEN HENG SHENG HUI DIGITAL TECHNOLOGY CO.,LTD", + [3]byte{236, 62, 9}: "PERFORMANCE DESIGNED PRODUCTS, LLC", + [3]byte{236, 63, 5}: "Institute 706, The Second Academy China Aerospace Science & Industry Corp", + [3]byte{236, 66, 240}: "ADL Embedded Solutions, Inc.", + [3]byte{236, 67, 230}: "AWCER Ltd.", + [3]byte{236, 67, 246}: "ZyXEL Communications Corporation", + [3]byte{236, 68, 118}: "CISCO SYSTEMS, INC.", + [3]byte{236, 70, 68}: "TTK SAS", + [3]byte{236, 70, 112}: "Meinberg Funkuhren GmbH & Co. KG", + [3]byte{236, 71, 60}: "Redwire, LLC", + [3]byte{236, 73, 147}: "Qihan Technology Co., Ltd", + [3]byte{236, 76, 77}: "ZAO NPK RoTeK", + [3]byte{236, 84, 46}: "Shanghai XiMei Electronic Technology Co. Ltd", + [3]byte{236, 85, 249}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{236, 89, 231}: "Microsoft Corporation", + [3]byte{236, 92, 105}: "MITSUBISHI HEAVY INDUSTRIES MECHATRONICS SYSTEMS,LTD.", + [3]byte{236, 98, 100}: "Global411 Internet Services, LLC", + [3]byte{236, 99, 229}: "ePBoard Design LLC", + [3]byte{236, 102, 209}: "B&W Group LTD", + [3]byte{236, 108, 159}: "Chengdu Volans Technology CO.,LTD", + [3]byte{236, 113, 219}: "Shenzhen Baichuan Digital Technology Co., Ltd.", + [3]byte{236, 124, 116}: "Justone Technologies Co., Ltd.", + [3]byte{236, 125, 157}: "MEI", + [3]byte{236, 128, 9}: "NovaSparks", + [3]byte{236, 131, 108}: "RM Tech Co., Ltd.", + [3]byte{236, 133, 47}: "Apple", + [3]byte{236, 136, 143}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{236, 137, 245}: "Lenovo Mobile Communication Technology Ltd.", + [3]byte{236, 138, 76}: "zte corporation", + [3]byte{236, 142, 173}: "DLX", + [3]byte{236, 146, 51}: "Eddyfi NDT Inc", + [3]byte{236, 147, 39}: "MEMMERT GmbH + Co. KG", + [3]byte{236, 150, 129}: "2276427 Ontario Inc", + [3]byte{236, 152, 108}: "Lufft Mess- und Regeltechnik GmbH", + [3]byte{236, 152, 193}: "Beijing Risbo Network Technology Co.,Ltd", + [3]byte{236, 154, 116}: "Hewlett Packard", + [3]byte{236, 155, 91}: "Nokia Corporation", + [3]byte{236, 158, 205}: "Artesyn Embedded Technologies", + [3]byte{236, 162, 155}: "Kemppi Oy", + [3]byte{236, 168, 107}: "ELITEGROUP COMPUTER SYSTEMS CO., LTD.", + [3]byte{236, 177, 6}: "Acuro Networks, Inc", + [3]byte{236, 181, 65}: "SHINANO E and E Co.Ltd.", + [3]byte{236, 185, 7}: "CloudGenix Inc", + [3]byte{236, 187, 174}: "Digivoice Tecnologia em Eletronica Ltda", + [3]byte{236, 189, 9}: "FUSION Electronics Ltd", + [3]byte{236, 195, 138}: "Accuenergy (CANADA) Inc", + [3]byte{236, 200, 130}: "CISCO SYSTEMS, INC.", + [3]byte{236, 203, 48}: "Huawei Technologies Co., Ltd", + [3]byte{236, 205, 109}: "Allied Telesis, Inc.", + [3]byte{236, 208, 14}: "MiraeRecognition Co., Ltd.", + [3]byte{236, 208, 64}: "GEA Farm Technologies GmbH", + [3]byte{236, 209, 154}: "Zhuhai Liming Industries Co., Ltd", + [3]byte{236, 217, 37}: "RAMI", + [3]byte{236, 217, 80}: "IRT SA", + [3]byte{236, 217, 209}: "Shenzhen TG-NET Botone Technology Co.,Ltd.", + [3]byte{236, 222, 61}: "Lamprey Networks, Inc.", + [3]byte{236, 224, 155}: "Samsung electronics CO., LTD", + [3]byte{236, 225, 169}: "Cisco", + [3]byte{236, 229, 18}: "tado GmbH", + [3]byte{236, 229, 85}: "Hirschmann Automation", + [3]byte{236, 231, 68}: "Omntec mfg. inc", + [3]byte{236, 233, 11}: "SISTEMA SOLUCOES ELETRONICAS LTDA - EASYTECH", + [3]byte{236, 233, 21}: "STI Ltd", + [3]byte{236, 233, 248}: "Guang Zhou TRI-SUN Electronics Technology Co., Ltd", + [3]byte{236, 234, 3}: "DARFON LIGHTING CORP", + [3]byte{236, 240, 14}: "Abocom", + [3]byte{236, 242, 54}: "NEOMONTANA ELECTRONICS", + [3]byte{236, 243, 91}: "Nokia Corporation", + [3]byte{236, 244, 187}: "Dell Inc", + [3]byte{236, 247, 43}: "HD DIGITAL TECH CO., LTD.", + [3]byte{236, 250, 170}: "The IMS Company", + [3]byte{236, 252, 85}: "A. Eberle GmbH & Co. KG", + [3]byte{236, 254, 126}: "BlueRadios, Inc.", + [3]byte{240, 0, 127}: "Janz - Contadores de Energia, SA", + [3]byte{240, 2, 43}: "Chrontel", + [3]byte{240, 2, 72}: "SmarteBuilding", + [3]byte{240, 7, 134}: "Shandong Bittel Electronics Co., Ltd", + [3]byte{240, 8, 241}: "Samsung Electronics Co.,Ltd", + [3]byte{240, 19, 195}: "SHENZHEN FENDA TECHNOLOGY CO., LTD", + [3]byte{240, 21, 160}: "KyungDong One Co., Ltd.", + [3]byte{240, 28, 19}: "LG Electronics", + [3]byte{240, 28, 45}: "Juniper Networks", + [3]byte{240, 31, 175}: "Dell Inc", + [3]byte{240, 33, 157}: "Cal-Comp Electronics & Communications Company Ltd.", + [3]byte{240, 35, 41}: "SHOWA DENKI CO.,LTD.", + [3]byte{240, 36, 5}: "OPUS High Technology Corporation", + [3]byte{240, 36, 8}: "Talaris (Sweden) AB", + [3]byte{240, 37, 114}: "CISCO SYSTEMS, INC.", + [3]byte{240, 37, 183}: "Samsung Electro Mechanics co., LTD.", + [3]byte{240, 38, 76}: "Dr. Sigrist AG", + [3]byte{240, 39, 101}: "Murata Manufactuaring Co.,Ltd.", + [3]byte{240, 41, 41}: "Cisco", + [3]byte{240, 42, 97}: "Waldo Networks, Inc.", + [3]byte{240, 47, 216}: "Bi2-Vision", + [3]byte{240, 50, 26}: "Mita-Teknik A/S", + [3]byte{240, 55, 161}: "Huike Electronics (SHENZHEN) CO., LTD.", + [3]byte{240, 58, 75}: "Bloombase, Inc.", + [3]byte{240, 58, 85}: "Omega Elektronik AS", + [3]byte{240, 61, 41}: "Actility", + [3]byte{240, 63, 248}: "R L Drake", + [3]byte{240, 67, 53}: "DVN(Shanghai)Ltd.", + [3]byte{240, 74, 43}: "PYRAMID Computer GmbH", + [3]byte{240, 75, 106}: "Scientific Production Association Siberian Arsenal, Ltd.", + [3]byte{240, 75, 242}: "JTECH Communications, Inc.", + [3]byte{240, 77, 162}: "Dell Inc.", + [3]byte{240, 79, 124}: "PRIVATE", + [3]byte{240, 88, 73}: "CareView Communications", + [3]byte{240, 90, 9}: "Samsung Electronics Co.,Ltd", + [3]byte{240, 93, 137}: "Dycon Limited", + [3]byte{240, 93, 200}: "Duracell Powermat", + [3]byte{240, 95, 90}: "Getriebebau NORD GmbH and Co. KG", + [3]byte{240, 97, 48}: "Advantage Pharmacy Services, LLC", + [3]byte{240, 98, 13}: "Shenzhen Egreat Tech Corp.,Ltd", + [3]byte{240, 98, 129}: "ProCurve Networking by HP", + [3]byte{240, 101, 221}: "Primax Electronics Ltd.", + [3]byte{240, 104, 83}: "Integrated Corporation", + [3]byte{240, 107, 202}: "Samsung Electronics Co.,Ltd", + [3]byte{240, 114, 140}: "Samsung Electronics Co.,Ltd", + [3]byte{240, 115, 174}: "PEAK-System Technik", + [3]byte{240, 118, 28}: "COMPAL INFORMATION (KUNSHAN) CO., LTD.", + [3]byte{240, 119, 101}: "Sourcefire, Inc", + [3]byte{240, 119, 208}: "Xcellen", + [3]byte{240, 123, 203}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{240, 125, 104}: "D-Link Corporation", + [3]byte{240, 127, 6}: "Cisco", + [3]byte{240, 127, 12}: "Leopold Kostal GmbH &Co. KG", + [3]byte{240, 129, 175}: "IRZ AUTOMATION TECHNOLOGIES LTD", + [3]byte{240, 130, 97}: "SAGEMCOM", + [3]byte{240, 132, 47}: "ADB Broadband Italia", + [3]byte{240, 132, 201}: "zte corporation", + [3]byte{240, 138, 40}: "JIANGSU HENGSION ELECTRONIC S and T CO.,LTD", + [3]byte{240, 139, 254}: "COSTEL.,CO.LTD", + [3]byte{240, 140, 251}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{240, 142, 219}: "VeloCloud Networks", + [3]byte{240, 146, 28}: "Hewlett Packard", + [3]byte{240, 147, 58}: "NxtConect", + [3]byte{240, 147, 197}: "Garland Technology", + [3]byte{240, 156, 187}: "RaonThink Inc.", + [3]byte{240, 156, 233}: "Aerohive Networks Inc", + [3]byte{240, 158, 99}: "Cisco", + [3]byte{240, 162, 37}: "PRIVATE", + [3]byte{240, 167, 100}: "GST Co., Ltd.", + [3]byte{240, 172, 164}: "HBC-radiomatic", + [3]byte{240, 173, 78}: "Globalscale Technologies, Inc.", + [3]byte{240, 174, 81}: "Xi3 Corp", + [3]byte{240, 180, 121}: "Apple", + [3]byte{240, 182, 235}: "Poslab Technology Co., Ltd.", + [3]byte{240, 188, 200}: "MaxID (Pty) Ltd", + [3]byte{240, 189, 241}: "Sipod Inc.", + [3]byte{240, 191, 151}: "Sony Corporation", + [3]byte{240, 193, 241}: "Apple, Inc.", + [3]byte{240, 194, 76}: "Zhejiang FeiYue Digital Technology Co., Ltd", + [3]byte{240, 194, 124}: "Mianyang Netop Telecom Equipment Co.,Ltd.", + [3]byte{240, 200, 140}: "LeddarTech Inc.", + [3]byte{240, 203, 161}: "Apple", + [3]byte{240, 209, 79}: "LINEAR LLC", + [3]byte{240, 209, 169}: "Apple", + [3]byte{240, 211, 167}: "CobaltRay Co., Ltd", + [3]byte{240, 211, 231}: "Sensometrix SA", + [3]byte{240, 215, 103}: "Axema Passagekontroll AB", + [3]byte{240, 218, 124}: "RLH INDUSTRIES,INC.", + [3]byte{240, 219, 48}: "Yottabyte", + [3]byte{240, 219, 248}: "Apple", + [3]byte{240, 220, 226}: "Apple", + [3]byte{240, 222, 113}: "Shanghai EDO Technologies Co.,Ltd.", + [3]byte{240, 222, 185}: "ShangHai Y&Y Electronics Co., Ltd", + [3]byte{240, 222, 241}: "Wistron InfoComm (Kunshan)Co", + [3]byte{240, 229, 195}: "Drägerwerk AG & Co. KG aA", + [3]byte{240, 231, 126}: "Samsung Electronics Co.,Ltd", + [3]byte{240, 235, 208}: "Shanghai Feixun Communication Co.,Ltd.", + [3]byte{240, 236, 57}: "Essec", + [3]byte{240, 237, 30}: "Bilkon Bilgisayar Kontrollu Cih. Im.Ltd.", + [3]byte{240, 238, 187}: "VIPAR GmbH", + [3]byte{240, 240, 2}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{240, 242, 96}: "Mobitec AB", + [3]byte{240, 243, 54}: "TP-LINK TECHNOLOGIES CO.,LTD", + [3]byte{240, 245, 174}: "Adaptrum Inc.", + [3]byte{240, 246, 28}: "Apple", + [3]byte{240, 246, 68}: "Whitesky Science & Technology Co.,Ltd.", + [3]byte{240, 246, 105}: "Motion Analysis Corporation", + [3]byte{240, 247, 85}: "CISCO SYSTEMS, INC.", + [3]byte{240, 247, 179}: "Phorm", + [3]byte{240, 248, 66}: "KEEBOX, Inc.", + [3]byte{240, 249, 247}: "IES GmbH & Co. KG", + [3]byte{240, 253, 160}: "Acurix Networks LP", + [3]byte{240, 254, 107}: "Shanghai High-Flying Electronics Technology Co., Ltd", + [3]byte{244, 3, 33}: "BeNeXt B.V.", + [3]byte{244, 4, 76}: "ValenceTech Limited", + [3]byte{244, 6, 105}: "Intel Corporate", + [3]byte{244, 6, 141}: "devolo AG", + [3]byte{244, 6, 165}: "Hangzhou Bianfeng Networking Technology Co., Ltd.", + [3]byte{244, 9, 216}: "Samsung Electro Mechanics co., LTD.", + [3]byte{244, 11, 147}: "Research In Motion", + [3]byte{244, 14, 17}: "IEEE REGISTRATION AUTHORITY - Please see MAM public listing for more information.", + [3]byte{244, 15, 27}: "Cisco", + [3]byte{244, 15, 155}: "WAVELINK", + [3]byte{244, 21, 253}: "Shanghai Pateo Electronic Equipment Manufacturing Co., Ltd.", + [3]byte{244, 27, 161}: "Apple", + [3]byte{244, 30, 38}: "Simon-Kaloi Engineering", + [3]byte{244, 31, 11}: "YAMABISHI Corporation", + [3]byte{244, 31, 194}: "Cisco", + [3]byte{244, 32, 18}: "Cuciniale GmbH", + [3]byte{244, 40, 51}: "MMPC Inc.", + [3]byte{244, 40, 83}: "Zioncom Electronics (Shenzhen) Ltd.", + [3]byte{244, 40, 150}: "SPECTO PAINEIS ELETRONICOS LTDA", + [3]byte{244, 54, 225}: "Abilis Systems SARL", + [3]byte{244, 55, 183}: "Apple", + [3]byte{244, 56, 20}: "Shanghai Howell Electronic Co.,Ltd", + [3]byte{244, 61, 128}: "FAG Industrial Services GmbH", + [3]byte{244, 62, 97}: "Shenzhen Gongjin Electronics Co., Ltd", + [3]byte{244, 62, 157}: "Benu Networks, Inc.", + [3]byte{244, 66, 39}: "S & S Research Inc.", + [3]byte{244, 68, 80}: "BND Co., Ltd.", + [3]byte{244, 69, 237}: "Portable Innovation Technology Ltd.", + [3]byte{244, 71, 42}: "Nanjing Rousing Sci. and Tech. Industrial Co., Ltd", + [3]byte{244, 72, 72}: "Amscreen Group Ltd", + [3]byte{244, 78, 5}: "Cisco", + [3]byte{244, 78, 253}: "Actions Semiconductor Co.,Ltd.(Cayman Islands)", + [3]byte{244, 80, 235}: "Telechips Inc", + [3]byte{244, 82, 20}: "Mellanox Technologies, Inc.", + [3]byte{244, 84, 51}: "Rockwell Automation", + [3]byte{244, 85, 149}: "HENGBAO Corporation LTD.", + [3]byte{244, 85, 156}: "Huawei Technologies Co., Ltd", + [3]byte{244, 85, 224}: "Niceway CNC Technology Co.,Ltd.Hunan Province", + [3]byte{244, 88, 66}: "Boxx TV Ltd", + [3]byte{244, 95, 105}: "Matsufu Electronics distribution Company", + [3]byte{244, 95, 212}: "Cisco SPVTG", + [3]byte{244, 95, 247}: "DQ Technology Inc.", + [3]byte{244, 96, 13}: "Panoptic Technology, Inc", + [3]byte{244, 99, 73}: "Diffon Corporation", + [3]byte{244, 106, 188}: "Adonit Corp. Ltd.", + [3]byte{244, 109, 4}: "ASUSTek COMPUTER INC.", + [3]byte{244, 109, 226}: "zte corporation", + [3]byte{244, 115, 202}: "Conversion Sound Inc.", + [3]byte{244, 118, 38}: "Viltechmeda UAB", + [3]byte{244, 122, 78}: "Woojeon&Handan", + [3]byte{244, 122, 204}: "SolidFire, Inc.", + [3]byte{244, 123, 94}: "Samsung Eletronics Co., Ltd", + [3]byte{244, 127, 53}: "CISCO SYSTEMS, INC.", + [3]byte{244, 129, 57}: "CANON INC.", + [3]byte{244, 135, 113}: "Infoblox", + [3]byte{244, 142, 9}: "Nokia Corporation", + [3]byte{244, 144, 202}: "Tensorcom", + [3]byte{244, 144, 234}: "Deciso B.V.", + [3]byte{244, 148, 97}: "NexGen Storage", + [3]byte{244, 148, 102}: "CountMax, ltd", + [3]byte{244, 153, 172}: "WEBER Schraubautomaten GmbH", + [3]byte{244, 159, 84}: "Samsung Electronics", + [3]byte{244, 159, 243}: "Huawei Technologies Co., Ltd", + [3]byte{244, 162, 148}: "EAGLE WORLD DEVELOPMENT CO., LIMITED", + [3]byte{244, 165, 42}: "Hawa Technologies Inc", + [3]byte{244, 172, 193}: "CISCO SYSTEMS, INC.", + [3]byte{244, 177, 100}: "Lightning Telecommunications Technology Co. Ltd", + [3]byte{244, 179, 129}: "WindowMaster A/S", + [3]byte{244, 181, 47}: "Juniper networks", + [3]byte{244, 181, 73}: "Yeastar Technology Co., Ltd.", + [3]byte{244, 182, 229}: "TerraSem Co.,Ltd", + [3]byte{244, 183, 42}: "TIME INTERCONNECT LTD", + [3]byte{244, 183, 226}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{244, 184, 94}: "Texas INstruments", + [3]byte{244, 189, 124}: "Chengdu jinshi communication Co., LTD", + [3]byte{244, 196, 71}: "Coagent International Enterprise Limited", + [3]byte{244, 198, 215}: "blackned GmbH", + [3]byte{244, 199, 20}: "Shenzhen Huawei Communication Technologies Co., Ltd", + [3]byte{244, 199, 149}: "WEY Elektronik AG", + [3]byte{244, 202, 229}: "FREEBOX SA", + [3]byte{244, 205, 144}: "Vispiron Rotec GmbH", + [3]byte{244, 206, 70}: "Hewlett-Packard Company", + [3]byte{244, 207, 226}: "Cisco", + [3]byte{244, 208, 50}: "Yunnan Ideal Information&Technology.,Ltd", + [3]byte{244, 210, 97}: "SEMOCON Co., Ltd", + [3]byte{244, 217, 251}: "Samsung Electronics CO., LTD", + [3]byte{244, 220, 77}: "Beijing CCD Digital Technology Co., Ltd", + [3]byte{244, 220, 218}: "Zhuhai Jiahe Communication Technology Co., limited", + [3]byte{244, 220, 249}: "Huawei Technologies Co., Ltd", + [3]byte{244, 221, 158}: "GoPro", + [3]byte{244, 225, 66}: "Delta Elektronika BV", + [3]byte{244, 230, 215}: "Solar Power Technologies, Inc.", + [3]byte{244, 234, 103}: "CISCO SYSTEMS, INC.", + [3]byte{244, 236, 56}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{244, 238, 20}: "SHENZHEN MERCURY COMMUNICATION TECHNOLOGIES CO.,LTD.", + [3]byte{244, 241, 90}: "Apple", + [3]byte{244, 241, 225}: "Motorola Mobility LLC", + [3]byte{244, 242, 109}: "TP-LINK TECHNOLOGIES CO.,LTD.", + [3]byte{244, 245, 165}: "Nokia corporation", + [3]byte{244, 245, 232}: "Google", + [3]byte{244, 246, 70}: "Dediprog Technology Co. Ltd.", + [3]byte{244, 249, 81}: "Apple", + [3]byte{244, 252, 50}: "Texas Instruments", + [3]byte{244, 253, 43}: "ZOYI Company", + [3]byte{248, 1, 19}: "Huawei Technologies Co., Ltd", + [3]byte{248, 3, 50}: "Khomp", + [3]byte{248, 5, 28}: "DRS Imaging and Targeting Solutions", + [3]byte{248, 11, 190}: "ARRIS Group, Inc.", + [3]byte{248, 11, 208}: "Datang Telecom communication terminal (Tianjin) Co., Ltd.", + [3]byte{248, 12, 243}: "LG Electronics", + [3]byte{248, 13, 67}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{248, 13, 234}: "ZyCast Technology Inc.", + [3]byte{248, 15, 65}: "Wistron InfoComm(ZhongShan) Corporation", + [3]byte{248, 15, 132}: "Natural Security SAS", + [3]byte{248, 16, 55}: "Atopia Systems, LP", + [3]byte{248, 21, 71}: "Avaya, Inc", + [3]byte{248, 22, 84}: "Intel Corporate", + [3]byte{248, 26, 103}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{248, 28, 229}: "Telefonbau Behnke GmbH", + [3]byte{248, 29, 147}: "Longdhua(Beijing) Controls Technology Co.,Ltd", + [3]byte{248, 30, 223}: "Apple", + [3]byte{248, 34, 133}: "Cypress Technology CO., LTD.", + [3]byte{248, 36, 65}: "Yeelink", + [3]byte{248, 39, 147}: "Apple, Inc", + [3]byte{248, 43, 200}: "Jiangsu Switter Co., Ltd", + [3]byte{248, 46, 219}: "RTW GmbH & Co. KG", + [3]byte{248, 47, 91}: "eGauge Systems LLC", + [3]byte{248, 47, 168}: "Hon Hai Precision Ind. Co.,Ltd.", + [3]byte{248, 48, 148}: "Alcatel-Lucent Telecom Limited", + [3]byte{248, 49, 62}: "endeavour GmbH", + [3]byte{248, 51, 118}: "Good Mind Innovation Co., Ltd.", + [3]byte{248, 53, 83}: "Magenta Research Ltd.", + [3]byte{248, 53, 221}: "Gemtek Technology Co., Ltd.", + [3]byte{248, 61, 78}: "Softlink Automation System Co., Ltd", + [3]byte{248, 61, 255}: "Huawei Technologies Co., Ltd", + [3]byte{248, 66, 251}: "Yasuda Joho Co.,ltd.", + [3]byte{248, 67, 96}: "INGENICO", + [3]byte{248, 69, 173}: "Konka Group Co., Ltd.", + [3]byte{248, 70, 45}: "SYNTEC Incorporation", + [3]byte{248, 71, 45}: "X2gen Digital Corp. Ltd", + [3]byte{248, 72, 151}: "Hitachi, Ltd.", + [3]byte{248, 74, 115}: "EUMTECH CO., LTD", + [3]byte{248, 74, 127}: "Innometriks Inc", + [3]byte{248, 74, 191}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{248, 79, 87}: "Cisco", + [3]byte{248, 80, 99}: "Verathon", + [3]byte{248, 81, 109}: "Denwa Technology Corp.", + [3]byte{248, 82, 223}: "VNL Europe AB", + [3]byte{248, 84, 175}: "ECI Telecom Ltd.", + [3]byte{248, 87, 46}: "Core Brands, LLC", + [3]byte{248, 91, 201}: "M-Cube Spa", + [3]byte{248, 92, 69}: "IC Nexus Co. Ltd.", + [3]byte{248, 95, 42}: "Nokia Corporation", + [3]byte{248, 98, 170}: "xn systems", + [3]byte{248, 102, 1}: "Suzhou Chi-tek information technology Co., Ltd", + [3]byte{248, 102, 209}: "Hon Hai Precision Ind. Co., Ltd.", + [3]byte{248, 102, 242}: "CISCO SYSTEMS, INC.", + [3]byte{248, 105, 113}: "Seibu Electric Co.,", + [3]byte{248, 110, 207}: "Arcx Inc", + [3]byte{248, 113, 254}: "The Goldman Sachs Group, Inc.", + [3]byte{248, 114, 234}: "Cisco", + [3]byte{248, 115, 148}: "NETGEAR INC.,", + [3]byte{248, 118, 155}: "Neopis Co., Ltd.", + [3]byte{248, 123, 98}: "FASTWEL INTERNATIONAL CO., LTD. Taiwan Branch", + [3]byte{248, 123, 122}: "ARRIS Group, Inc.", + [3]byte{248, 123, 140}: "Amped Wireless", + [3]byte{248, 129, 26}: "OVERKIZ", + [3]byte{248, 132, 121}: "Yaojin Technology(Shenzhen)Co.,Ltd", + [3]byte{248, 132, 242}: "Samsung Electronics Co.,Ltd", + [3]byte{248, 140, 28}: "KAISHUN ELECTRONIC TECHNOLOGY CO., LTD. BEIJING", + [3]byte{248, 141, 239}: "Tenebraex", + [3]byte{248, 142, 133}: "COMTREND CORPORATION", + [3]byte{248, 143, 202}: "Google Fiber, Inc", + [3]byte{248, 145, 42}: "GLP German Light Products GmbH", + [3]byte{248, 147, 243}: "VOLANS", + [3]byte{248, 149, 80}: "Proton Products Chengdu Ltd", + [3]byte{248, 151, 207}: "DAESHIN-INFORMATION TECHNOLOGY CO., LTD.", + [3]byte{248, 153, 85}: "Fortress Technology Inc", + [3]byte{248, 157, 13}: "Control Technology Inc.", + [3]byte{248, 159, 184}: "YAZAKI Energy System Corporation", + [3]byte{248, 160, 61}: "Dinstar Technologies Co., Ltd.", + [3]byte{248, 162, 180}: "RHEWA-WAAGENFABRIK August Freudewald GmbH &Co. KG", + [3]byte{248, 164, 95}: "Beijing Xiaomi communications co.,ltd", + [3]byte{248, 169, 99}: "COMPAL INFORMATION (KUNSHAN) CO., LTD.", + [3]byte{248, 169, 208}: "LG Electronics", + [3]byte{248, 169, 222}: "PUISSANCE PLUS", + [3]byte{248, 170, 138}: "Axview Technology (Shenzhen) Co.,Ltd", + [3]byte{248, 172, 109}: "Deltenna Ltd", + [3]byte{248, 177, 86}: "Dell Inc", + [3]byte{248, 178, 243}: "GUANGZHOU BOSMA TECHNOLOGY CO.,LTD", + [3]byte{248, 181, 153}: "Guangzhou CHNAVS Digital Technology Co.,Ltd", + [3]byte{248, 188, 18}: "Dell Inc", + [3]byte{248, 188, 65}: "Rosslare Enterprises Limited", + [3]byte{248, 192, 1}: "Juniper Networks", + [3]byte{248, 192, 145}: "Highgates Technology", + [3]byte{248, 194, 136}: "Cisco", + [3]byte{248, 198, 120}: "Carefusion", + [3]byte{248, 208, 172}: "Sony Computer Entertainment Inc.", + [3]byte{248, 208, 189}: "Samsung Electronics Co.,Ltd", + [3]byte{248, 209, 17}: "TP-LINK TECHNOLOGIES CO., LTD.", + [3]byte{248, 211, 169}: "AXAN Networks", + [3]byte{248, 212, 98}: "Pumatronix Equipamentos Eletronicos Ltda.", + [3]byte{248, 215, 86}: "Simm Tronic Limited", + [3]byte{248, 215, 191}: "REV Ritter GmbH", + [3]byte{248, 218, 223}: "EcoTech, Inc.", + [3]byte{248, 218, 226}: "Beta LaserMike", + [3]byte{248, 218, 244}: "Taishan Online Technology Co., Ltd.", + [3]byte{248, 219, 76}: "PNY Technologies, INC.", + [3]byte{248, 219, 127}: "HTC Corporation", + [3]byte{248, 219, 136}: "Dell Inc", + [3]byte{248, 220, 122}: "Variscite LTD", + [3]byte{248, 223, 168}: "ZTE Corporation", + [3]byte{248, 224, 121}: "Motorola Mobility LLC", + [3]byte{248, 228, 251}: "Actiontec Electronics, Inc", + [3]byte{248, 231, 181}: "µTech Tecnologia LTDA", + [3]byte{248, 232, 17}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{248, 233, 3}: "D-Link International", + [3]byte{248, 233, 104}: "Egker Kft.", + [3]byte{248, 234, 10}: "Dipl.-Math. Michael Rauch", + [3]byte{248, 237, 165}: "ARRIS Group, Inc.", + [3]byte{248, 240, 5}: "Newport Media Inc.", + [3]byte{248, 240, 20}: "RackWare Inc.", + [3]byte{248, 240, 130}: "Orion Networks International, Inc", + [3]byte{248, 241, 182}: "Motorola Mobility LLC", + [3]byte{248, 242, 90}: "G-Lab GmbH", + [3]byte{248, 247, 211}: "International Communications Corporation", + [3]byte{248, 247, 255}: "SYN-TECH SYSTEMS INC", + [3]byte{248, 251, 47}: "Santur Corporation", + [3]byte{248, 254, 92}: "Reciprocal Labs Corp", + [3]byte{248, 254, 168}: "Technico Japan Corporation", + [3]byte{248, 255, 95}: "Shenzhen Communication Technology Co.,Ltd", + [3]byte{252, 0, 18}: "Toshiba Samsung Storage Technolgoy Korea Corporation", + [3]byte{252, 1, 158}: "VIEVU", + [3]byte{252, 1, 205}: "FUNDACION TEKNIKER", + [3]byte{252, 6, 71}: "Cortland Research, LLC", + [3]byte{252, 7, 160}: "LRE Medical GmbH", + [3]byte{252, 8, 119}: "Prentke Romich Company", + [3]byte{252, 9, 216}: "ACTEON Group", + [3]byte{252, 9, 246}: "GUANGDONG TONZE ELECTRIC CO.,LTD", + [3]byte{252, 10, 129}: "Motorola Solutions Inc.", + [3]byte{252, 15, 230}: "Sony Computer Entertainment Inc.", + [3]byte{252, 16, 189}: "Control Sistematizado S.A.", + [3]byte{252, 17, 134}: "Logic3 plc", + [3]byte{252, 19, 73}: "Global Apps Corp.", + [3]byte{252, 21, 180}: "Hewlett Packard", + [3]byte{252, 22, 7}: "Taian Technology(Wuxi) Co.,Ltd.", + [3]byte{252, 23, 148}: "InterCreative Co., Ltd", + [3]byte{252, 25, 16}: "Samsung Electronics Co.,Ltd", + [3]byte{252, 25, 208}: "Cloud Vision Networks Technology Co.,Ltd.", + [3]byte{252, 27, 255}: "V-ZUG AG", + [3]byte{252, 29, 89}: "I Smart Cities HK Ltd", + [3]byte{252, 29, 132}: "Autobase", + [3]byte{252, 30, 22}: "IPEVO corp", + [3]byte{252, 31, 25}: "SAMSUNG ELECTRO-MECHANICS CO., LTD.", + [3]byte{252, 31, 192}: "EURECAM", + [3]byte{252, 34, 156}: "Han Kyung I Net Co.,Ltd.", + [3]byte{252, 35, 37}: "EosTek (Shenzhen) Co., Ltd.", + [3]byte{252, 37, 63}: "Apple", + [3]byte{252, 39, 162}: "TRANS ELECTRIC CO., LTD.", + [3]byte{252, 42, 84}: "Connected Data, Inc.", + [3]byte{252, 46, 45}: "Lorom Industrial Co.LTD.", + [3]byte{252, 47, 64}: "Calxeda, Inc.", + [3]byte{252, 53, 152}: "Favite Inc.", + [3]byte{252, 53, 230}: "Visteon corp", + [3]byte{252, 63, 171}: "Henan Lanxin Technology Co., Ltd", + [3]byte{252, 68, 99}: "Universal Audio, Inc", + [3]byte{252, 68, 153}: "Swarco LEA d.o.o.", + [3]byte{252, 69, 95}: "JIANGXI SHANSHUI OPTOELECTRONIC TECHNOLOGY CO.,LTD", + [3]byte{252, 72, 239}: "HUAWEI TECHNOLOGIES CO.,LTD", + [3]byte{252, 74, 233}: "Castlenet Technology Inc.", + [3]byte{252, 75, 28}: "INTERSENSOR S.R.L.", + [3]byte{252, 75, 188}: "Sunplus Technology Co., Ltd.", + [3]byte{252, 77, 212}: "Universal Global Scientific Industrial Co., Ltd.", + [3]byte{252, 80, 144}: "SIMEX Sp. z o.o.", + [3]byte{252, 82, 206}: "Control iD", + [3]byte{252, 88, 250}: "Shen Zhen Shi Xin Zhong Xin Technology Co.,Ltd.", + [3]byte{252, 91, 36}: "Weibel Scientific A/S", + [3]byte{252, 91, 38}: "MikroBits", + [3]byte{252, 91, 57}: "Cisco", + [3]byte{252, 96, 24}: "Zhejiang Kangtai Electric Co., Ltd.", + [3]byte{252, 97, 152}: "NEC Personal Products, Ltd", + [3]byte{252, 98, 110}: "Beijing MDC Telecom", + [3]byte{252, 98, 185}: "ALPS ERECTRIC CO.,LTD", + [3]byte{252, 104, 62}: "Directed Perception, Inc", + [3]byte{252, 108, 49}: "LXinstruments GmbH", + [3]byte{252, 109, 192}: "BME CORPORATION", + [3]byte{252, 117, 22}: "D-Link International", + [3]byte{252, 117, 230}: "Handreamnet", + [3]byte{252, 121, 11}: "Hitachi High Technologies America, Inc.", + [3]byte{252, 124, 231}: "FCI USA LLC", + [3]byte{252, 131, 41}: "Trei technics", + [3]byte{252, 131, 153}: "Avaya, Inc", + [3]byte{252, 139, 151}: "Shenzhen Gongjin Electronics Co.,Ltd", + [3]byte{252, 142, 126}: "Pace plc", + [3]byte{252, 143, 196}: "Intelligent Technology Inc.", + [3]byte{252, 146, 59}: "Nokia Corporation", + [3]byte{252, 148, 108}: "UBIVELOX", + [3]byte{252, 148, 227}: "Technicolor USA Inc.", + [3]byte{252, 153, 71}: "Cisco", + [3]byte{252, 159, 174}: "Fidus Systems Inc", + [3]byte{252, 159, 225}: "CONWIN.Tech. Ltd", + [3]byte{252, 161, 62}: "Samsung Electronics", + [3]byte{252, 168, 65}: "Avaya, Inc", + [3]byte{252, 169, 176}: "MIARTECH (SHANGHAI),INC.", + [3]byte{252, 170, 20}: "GIGA-BYTE TECHNOLOGY CO.,LTD.", + [3]byte{252, 173, 15}: "QTS NETWORKS", + [3]byte{252, 175, 106}: "Conemtech AB", + [3]byte{252, 176, 196}: "Shanghai DareGlobal Technologies Co., Ltd", + [3]byte{252, 187, 161}: "Shenzhen Minicreate Technology Co.,Ltd", + [3]byte{252, 194, 61}: "Atmel Corporation", + [3]byte{252, 194, 222}: "Murata Manufacturing Co., Ltd.", + [3]byte{252, 199, 52}: "Samsung Electronics Co.,Ltd", + [3]byte{252, 200, 151}: "ZTE Corporation", + [3]byte{252, 204, 228}: "Ascon Ltd.", + [3]byte{252, 207, 98}: "IBM Corp", + [3]byte{252, 212, 242}: "The Coca Cola Company", + [3]byte{252, 212, 246}: "Messana Air.Ray Conditioning s.r.l.", + [3]byte{252, 213, 217}: "Shenzhen SDMC Technology Co., Ltd.", + [3]byte{252, 214, 189}: "Robert Bosch GmbH", + [3]byte{252, 216, 23}: "Beijing Hesun Technologies Co.Ltd.", + [3]byte{252, 219, 150}: "ENERVALLEY CO., LTD", + [3]byte{252, 219, 179}: "Murata Manufacturing Co., Ltd.", + [3]byte{252, 221, 85}: "Shenzhen WeWins wireless Co.,Ltd", + [3]byte{252, 225, 134}: "A3M Co., LTD", + [3]byte{252, 225, 146}: "Sichuan Jinwangtong Electronic Science&Technology Co,.Ltd", + [3]byte{252, 225, 217}: "Stable Imaging Solutions LLC", + [3]byte{252, 226, 63}: "CLAY PAKY SPA", + [3]byte{252, 229, 87}: "Nokia Corporation", + [3]byte{252, 232, 146}: "Hangzhou Lancable Technology Co.,Ltd", + [3]byte{252, 237, 185}: "Arrayent", + [3]byte{252, 241, 82}: "Sony Corporation", + [3]byte{252, 241, 205}: "OPTEX-FA CO.,LTD.", + [3]byte{252, 245, 40}: "ZyXEL Communications Corporation", + [3]byte{252, 246, 71}: "Fiberhome Telecommunication Tech.Co.,Ltd.", + [3]byte{252, 248, 174}: "Intel Corporate", + [3]byte{252, 248, 183}: "TRONTEQ Electronic", + [3]byte{252, 250, 247}: "Shanghai Baud Data Communication Co.,Ltd.", + [3]byte{252, 251, 251}: "CISCO SYSTEMS, INC.", + [3]byte{252, 254, 119}: "Hitachi Reftechno, Inc.", + [3]byte{252, 255, 170}: "IEEE REGISTRATION AUTHORITY - Please see MAL public listing for more information.", +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/packet.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/packet.go new file mode 100644 index 00000000..8f0609fc --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/packet.go @@ -0,0 +1,716 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package gopacket + +import ( + "bytes" + "encoding/hex" + "errors" + "fmt" + "io" + "os" + "reflect" + "runtime/debug" + "time" +) + +// CaptureInfo provides standardized information about a packet captured off +// the wire or read from a file. +type CaptureInfo struct { + // Timestamp is the time the packet was captured, if that is known. + Timestamp time.Time + // CaptureLength is the total number of bytes read off of the wire. + CaptureLength int + // Length is the size of the original packet. Should always be >= + // CaptureLength. + Length int +} + +// PacketMetadata contains metadata for a packet. +type PacketMetadata struct { + CaptureInfo + // Truncated is true if packet decoding logic detects that there are fewer + // bytes in the packet than are detailed in various headers (for example, if + // the number of bytes in the IPv4 contents/payload is less than IPv4.Length). + // This is also set automatically for packets captured off the wire if + // CaptureInfo.CaptureLength < CaptureInfo.Length. + Truncated bool +} + +// Packet is the primary object used by gopacket. Packets are created by a +// Decoder's Decode call. A packet is made up of a set of Data, which +// is broken into a number of Layers as it is decoded. +type Packet interface { + //// Functions for outputting the packet as a human-readable string: + //// ------------------------------------------------------------------ + // String returns a human-readable string representation of the packet. + // It uses LayerString on each layer to output the layer. + String() string + // Dump returns a verbose human-readable string representation of the packet, + // including a hex dump of all layers. It uses LayerDump on each layer to + // output the layer. + Dump() string + + //// Functions for accessing arbitrary packet layers: + //// ------------------------------------------------------------------ + // Layers returns all layers in this packet, computing them as necessary + Layers() []Layer + // Layer returns the first layer in this packet of the given type, or nil + Layer(LayerType) Layer + // LayerClass returns the first layer in this packet of the given class, + // or nil. + LayerClass(LayerClass) Layer + + //// Functions for accessing specific types of packet layers. These functions + //// return the first layer of each type found within the packet. + //// ------------------------------------------------------------------ + // LinkLayer returns the first link layer in the packet + LinkLayer() LinkLayer + // NetworkLayer returns the first network layer in the packet + NetworkLayer() NetworkLayer + // TransportLayer returns the first transport layer in the packet + TransportLayer() TransportLayer + // ApplicationLayer returns the first application layer in the packet + ApplicationLayer() ApplicationLayer + // ErrorLayer is particularly useful, since it returns nil if the packet + // was fully decoded successfully, and non-nil if an error was encountered + // in decoding and the packet was only partially decoded. Thus, its output + // can be used to determine if the entire packet was able to be decoded. + ErrorLayer() ErrorLayer + + //// Functions for accessing data specific to the packet: + //// ------------------------------------------------------------------ + // Data returns the set of bytes that make up this entire packet. + Data() []byte + // Metadata returns packet metadata associated with this packet. + Metadata() *PacketMetadata +} + +// packet contains all the information we need to fulfill the Packet interface, +// and its two "subclasses" (yes, no such thing in Go, bear with me), +// eagerPacket and lazyPacket, provide eager and lazy decoding logic around the +// various functions needed to access this information. +type packet struct { + // data contains the entire packet data for a packet + data []byte + // initialLayers is space for an initial set of layers already created inside + // the packet. + initialLayers [6]Layer + // layers contains each layer we've already decoded + layers []Layer + // last is the last layer added to the packet + last Layer + // metadata is the PacketMetadata for this packet + metadata PacketMetadata + + // recoverPanics is true if we should recover from panics we see while + // decoding and set a DecodeFailure layer. + recoverPanics bool + + // Pointers to the various important layers + link LinkLayer + network NetworkLayer + transport TransportLayer + application ApplicationLayer + failure ErrorLayer +} + +func (p *packet) SetTruncated() { + p.metadata.Truncated = true +} + +func (p *packet) SetLinkLayer(l LinkLayer) { + if p.link == nil { + p.link = l + } +} + +func (p *packet) SetNetworkLayer(l NetworkLayer) { + if p.network == nil { + p.network = l + } +} + +func (p *packet) SetTransportLayer(l TransportLayer) { + if p.transport == nil { + p.transport = l + } +} + +func (p *packet) SetApplicationLayer(l ApplicationLayer) { + if p.application == nil { + p.application = l + } +} + +func (p *packet) SetErrorLayer(l ErrorLayer) { + if p.failure == nil { + p.failure = l + } +} + +func (p *packet) AddLayer(l Layer) { + p.layers = append(p.layers, l) + p.last = l +} + +func (p *packet) DumpPacketData() { + fmt.Fprint(os.Stderr, p.packetDump()) + os.Stderr.Sync() +} + +func (p *packet) Metadata() *PacketMetadata { + return &p.metadata +} + +func (p *packet) Data() []byte { + return p.data +} + +func (p *packet) addFinalDecodeError(err error, stack []byte) { + fail := &DecodeFailure{err: err, stack: stack} + if p.last == nil { + fail.data = p.data + } else { + fail.data = p.last.LayerPayload() + } + p.AddLayer(fail) + p.SetErrorLayer(fail) +} + +func (p *packet) recoverDecodeError() { + if p.recoverPanics { + if r := recover(); r != nil { + p.addFinalDecodeError(fmt.Errorf("%v", r), debug.Stack()) + } + } +} + +// LayerString outputs an individual layer as a string. The layer is output +// in a single line, with no trailing newline. This function is specifically +// designed to do the right thing for most layers... it follows the following +// rules: +// * If the Layer has a String function, just output that. +// * Otherwise, output all exported fields in the layer, recursing into +// exported slices and structs. +// NOTE: This is NOT THE SAME AS fmt's "%#v". %#v will output both exported +// and unexported fields... many times packet layers contain unexported stuff +// that would just mess up the output of the layer, see for example the +// Payload layer and it's internal 'data' field, which contains a large byte +// array that would really mess up formatting. +func LayerString(l Layer) string { + return fmt.Sprintf("%v\t%s", l.LayerType(), layerString(l, false, false)) +} + +// Dumper dumps verbose information on a value. If a layer type implements +// Dumper, then its LayerDump() string will include the results in its output. +type Dumper interface { + Dump() string +} + +// LayerDump outputs a very verbose string representation of a layer. Its +// output is a concatenation of LayerString(l) and hex.Dump(l.LayerContents()). +// It contains newlines and ends with a newline. +func LayerDump(l Layer) string { + var b bytes.Buffer + b.WriteString(LayerString(l)) + b.WriteByte('\n') + if d, ok := l.(Dumper); ok { + dump := d.Dump() + if dump != "" { + b.WriteString(dump) + if dump[len(dump)-1] != '\n' { + b.WriteByte('\n') + } + } + } + b.WriteString(hex.Dump(l.LayerContents())) + return b.String() +} + +// layerString outputs, recursively, a layer in a "smart" way. See docs for +// LayerString for more details. +// +// Params: +// i - value to write out +// anonymous: if we're currently recursing an anonymous member of a struct +// writeSpace: if we've already written a value in a struct, and need to +// write a space before writing more. This happens when we write various +// anonymous values, and need to keep writing more. +func layerString(i interface{}, anonymous bool, writeSpace bool) string { + // Let String() functions take precedence. + if s, ok := i.(fmt.Stringer); ok { + return s.String() + } + // Reflect, and spit out all the exported fields as key=value. + v := reflect.ValueOf(i) + switch v.Type().Kind() { + case reflect.Interface, reflect.Ptr: + if v.IsNil() { + return "nil" + } + r := v.Elem() + return layerString(r.Interface(), anonymous, writeSpace) + case reflect.Struct: + var b bytes.Buffer + typ := v.Type() + if !anonymous { + b.WriteByte('{') + } + for i := 0; i < v.NumField(); i++ { + // Check if this is upper-case. + ftype := typ.Field(i) + f := v.Field(i) + if ftype.Anonymous { + anonStr := layerString(f.Interface(), true, writeSpace) + writeSpace = writeSpace || anonStr != "" + b.WriteString(anonStr) + } else if ftype.PkgPath == "" { // exported + if writeSpace { + b.WriteByte(' ') + } + writeSpace = true + fmt.Fprintf(&b, "%s=%s", typ.Field(i).Name, layerString(f.Interface(), false, writeSpace)) + } + } + if !anonymous { + b.WriteByte('}') + } + return b.String() + case reflect.Slice: + var b bytes.Buffer + b.WriteByte('[') + if v.Len() > 4 { + fmt.Fprintf(&b, "..%d..", v.Len()) + } else { + for j := 0; j < v.Len(); j++ { + if j != 0 { + b.WriteString(", ") + } + b.WriteString(layerString(v.Index(j).Interface(), false, false)) + } + } + b.WriteByte(']') + return b.String() + } + return fmt.Sprintf("%v", v.Interface()) +} + +func (p *packet) packetString() string { + var b bytes.Buffer + fmt.Fprintf(&b, "PACKET: %d bytes", len(p.Data())) + if p.metadata.Truncated { + b.WriteString(", truncated") + } + if p.metadata.Length > 0 { + fmt.Fprintf(&b, ", wire length %d cap length %d", p.metadata.Length, p.metadata.CaptureLength) + } + if !p.metadata.Timestamp.IsZero() { + fmt.Fprintf(&b, " @ %v", p.metadata.Timestamp) + } + b.WriteByte('\n') + for i, l := range p.layers { + fmt.Fprintf(&b, "- Layer %d (%02d bytes) = %s\n", i+1, len(l.LayerContents()), LayerString(l)) + } + return b.String() +} + +func (p *packet) packetDump() string { + var b bytes.Buffer + fmt.Fprintf(&b, "-- FULL PACKET DATA (%d bytes) ------------------------------------\n%s", len(p.data), hex.Dump(p.data)) + for i, l := range p.layers { + fmt.Fprintf(&b, "--- Layer %d ---\n%s", i+1, LayerDump(l)) + } + return b.String() +} + +// eagerPacket is a packet implementation that does eager decoding. Upon +// initial construction, it decodes all the layers it can from packet data. +// eagerPacket implements Packet and PacketBuilder. +type eagerPacket struct { + packet +} + +var nilDecoderError = errors.New("NextDecoder passed nil decoder, probably an unsupported decode type") + +func (p *eagerPacket) NextDecoder(next Decoder) error { + if next == nil { + return nilDecoderError + } + if p.last == nil { + return errors.New("NextDecoder called, but no layers added yet") + } + d := p.last.LayerPayload() + if len(d) == 0 { + return nil + } + // Since we're eager, immediately call the next decoder. + return next.Decode(d, p) +} +func (p *eagerPacket) initialDecode(dec Decoder) { + defer p.recoverDecodeError() + err := dec.Decode(p.data, p) + if err != nil { + p.addFinalDecodeError(err, nil) + } +} +func (p *eagerPacket) LinkLayer() LinkLayer { + return p.link +} +func (p *eagerPacket) NetworkLayer() NetworkLayer { + return p.network +} +func (p *eagerPacket) TransportLayer() TransportLayer { + return p.transport +} +func (p *eagerPacket) ApplicationLayer() ApplicationLayer { + return p.application +} +func (p *eagerPacket) ErrorLayer() ErrorLayer { + return p.failure +} +func (p *eagerPacket) Layers() []Layer { + return p.layers +} +func (p *eagerPacket) Layer(t LayerType) Layer { + for _, l := range p.layers { + if l.LayerType() == t { + return l + } + } + return nil +} +func (p *eagerPacket) LayerClass(lc LayerClass) Layer { + for _, l := range p.layers { + if lc.Contains(l.LayerType()) { + return l + } + } + return nil +} +func (p *eagerPacket) String() string { return p.packetString() } +func (p *eagerPacket) Dump() string { return p.packetDump() } + +// lazyPacket does lazy decoding on its packet data. On construction it does +// no initial decoding. For each function call, it decodes only as many layers +// as are necessary to compute the return value for that function. +// lazyPacket implements Packet and PacketBuilder. +type lazyPacket struct { + packet + next Decoder +} + +func (p *lazyPacket) NextDecoder(next Decoder) error { + if next == nil { + return nilDecoderError + } + p.next = next + return nil +} +func (p *lazyPacket) decodeNextLayer() { + if p.next == nil { + return + } + d := p.data + if p.last != nil { + d = p.last.LayerPayload() + } + next := p.next + p.next = nil + // We've just set p.next to nil, so if we see we have no data, this should be + // the final call we get to decodeNextLayer if we return here. + if len(d) == 0 { + return + } + defer p.recoverDecodeError() + err := next.Decode(d, p) + if err != nil { + p.addFinalDecodeError(err, nil) + } +} +func (p *lazyPacket) LinkLayer() LinkLayer { + for p.link == nil && p.next != nil { + p.decodeNextLayer() + } + return p.link +} +func (p *lazyPacket) NetworkLayer() NetworkLayer { + for p.network == nil && p.next != nil { + p.decodeNextLayer() + } + return p.network +} +func (p *lazyPacket) TransportLayer() TransportLayer { + for p.transport == nil && p.next != nil { + p.decodeNextLayer() + } + return p.transport +} +func (p *lazyPacket) ApplicationLayer() ApplicationLayer { + for p.application == nil && p.next != nil { + p.decodeNextLayer() + } + return p.application +} +func (p *lazyPacket) ErrorLayer() ErrorLayer { + for p.failure == nil && p.next != nil { + p.decodeNextLayer() + } + return p.failure +} +func (p *lazyPacket) Layers() []Layer { + for p.next != nil { + p.decodeNextLayer() + } + return p.layers +} +func (p *lazyPacket) Layer(t LayerType) Layer { + for _, l := range p.layers { + if l.LayerType() == t { + return l + } + } + numLayers := len(p.layers) + for p.next != nil { + p.decodeNextLayer() + for _, l := range p.layers[numLayers:] { + if l.LayerType() == t { + return l + } + } + numLayers = len(p.layers) + } + return nil +} +func (p *lazyPacket) LayerClass(lc LayerClass) Layer { + for _, l := range p.layers { + if lc.Contains(l.LayerType()) { + return l + } + } + numLayers := len(p.layers) + for p.next != nil { + p.decodeNextLayer() + for _, l := range p.layers[numLayers:] { + if lc.Contains(l.LayerType()) { + return l + } + } + numLayers = len(p.layers) + } + return nil +} +func (p *lazyPacket) String() string { p.Layers(); return p.packetString() } +func (p *lazyPacket) Dump() string { p.Layers(); return p.packetDump() } + +// DecodeOptions tells gopacket how to decode a packet. +type DecodeOptions struct { + // Lazy decoding decodes the minimum number of layers needed to return data + // for a packet at each function call. Be careful using this with concurrent + // packet processors, as each call to packet.* could mutate the packet, and + // two concurrent function calls could interact poorly. + Lazy bool + // NoCopy decoding doesn't copy its input buffer into storage that's owned by + // the packet. If you can guarantee that the bytes underlying the slice + // passed into NewPacket aren't going to be modified, this can be faster. If + // there's any chance that those bytes WILL be changed, this will invalidate + // your packets. + NoCopy bool + // SkipDecodeRecovery skips over panic recovery during packet decoding. + // Normally, when packets decode, if a panic occurs, that panic is captured + // by a recover(), and a DecodeFailure layer is added to the packet detailing + // the issue. If this flag is set, panics are instead allowed to continue up + // the stack. + SkipDecodeRecovery bool +} + +// Default decoding provides the safest (but slowest) method for decoding +// packets. It eagerly processes all layers (so it's concurrency-safe) and it +// copies its input buffer upon creation of the packet (so the packet remains +// valid if the underlying slice is modified. Both of these take time, +// though, so beware. If you can guarantee that the packet will only be used +// by one goroutine at a time, set Lazy decoding. If you can guarantee that +// the underlying slice won't change, set NoCopy decoding. +var Default DecodeOptions = DecodeOptions{} + +// Lazy is a DecodeOptions with just Lazy set. +var Lazy DecodeOptions = DecodeOptions{Lazy: true} + +// NoCopy is a DecodeOptions with just NoCopy set. +var NoCopy DecodeOptions = DecodeOptions{NoCopy: true} + +// NewPacket creates a new Packet object from a set of bytes. The +// firstLayerDecoder tells it how to interpret the first layer from the bytes, +// future layers will be generated from that first layer automatically. +func NewPacket(data []byte, firstLayerDecoder Decoder, options DecodeOptions) Packet { + if !options.NoCopy { + dataCopy := make([]byte, len(data)) + copy(dataCopy, data) + data = dataCopy + } + if options.Lazy { + p := &lazyPacket{ + packet: packet{data: data}, + next: firstLayerDecoder, + } + p.layers = p.initialLayers[:0] + p.recoverPanics = !options.SkipDecodeRecovery + // Crazy craziness: + // If the following return statemet is REMOVED, and Lazy is FALSE, then + // eager packet processing becomes 17% FASTER. No, there is no logical + // explanation for this. However, it's such a hacky micro-optimization that + // we really can't rely on it. It appears to have to do with the size the + // compiler guesses for this function's stack space, since one symptom is + // that with the return statement in place, we more than double calls to + // runtime.morestack/runtime.lessstack. We'll hope the compiler gets better + // over time and we get this optimization for free. Until then, we'll have + // to live with slower packet processing. + return p + } + p := &eagerPacket{ + packet: packet{data: data}, + } + p.layers = p.initialLayers[:0] + p.recoverPanics = !options.SkipDecodeRecovery + p.initialDecode(firstLayerDecoder) + return p +} + +// PacketDataSource is an interface for some source of packet data. Users may +// create their own implementations, or use the existing implementations in +// gopacket/pcap (libpcap, allows reading from live interfaces or from +// pcap files) or gopacket/pfring (PF_RING, allows reading from live +// interfaces). +type PacketDataSource interface { + // ReadPacketData returns the next packet available from this data source. + // It returns: + // data: The bytes of an individual packet. + // ci: Metadata about the capture + // err: An error encountered while reading packet data. If err != nil, + // then data/ci will be ignored. + ReadPacketData() (data []byte, ci CaptureInfo, err error) +} + +// ZeroCopyPacketDataSource is an interface to pull packet data from sources +// that allow data to be returned without copying to a user-controlled buffer. +// It's very similar to PacketDataSource, except that the caller must be more +// careful in how the returned buffer is handled. +type ZeroCopyPacketDataSource interface { + // ZeroCopyReadPacketData returns the next packet available from this data source. + // It returns: + // data: The bytes of an individual packet. Unlike with + // PacketDataSource's ReadPacketData, the slice returned here points + // to a buffer owned by the data source. In particular, the bytes in + // this buffer may be changed by future calls to + // ZeroCopyReadPacketData. Do not use the returned buffer after + // subsequent ZeroCopyReadPacketData calls. + // ci: Metadata about the capture + // err: An error encountered while reading packet data. If err != nil, + // then data/ci will be ignored. + ZeroCopyReadPacketData() (data []byte, ci CaptureInfo, err error) +} + +// PacketSource reads in packets from a PacketDataSource, decodes them, and +// returns them. +// +// There are currently two different methods for reading packets in through +// a PacketSource: +// +// Reading With Packets Function +// +// This method is the most convenient and easiest to code, but lacks +// flexibility. Packets returns a 'chan Packet', then asynchronously writes +// packets into that channel. Packets uses a blocking channel, and closes +// it if an io.EOF is returned by the underlying PacketDataSource. All other +// PacketDataSource errors are ignored and discarded. +// for packet := range packetSource.Packets() { +// ... +// } +// +// Reading With NextPacket Function +// +// This method is the most flexible, and exposes errors that may be +// encountered by the underlying PacketDataSource. It's also the fastest +// in a tight loop, since it doesn't have the overhead of a channel +// read/write. However, it requires the user to handle errors, most +// importantly the io.EOF error in cases where packets are being read from +// a file. +// for { +// packet, err := packetSource.NextPacket() { +// if err == io.EOF { +// break +// } else if err != nil { +// log.Println("Error:", err) +// continue +// } +// handlePacket(packet) // Do something with each packet. +// } +type PacketSource struct { + source PacketDataSource + decoder Decoder + // DecodeOptions is the set of options to use for decoding each piece + // of packet data. This can/should be changed by the user to reflect the + // way packets should be decoded. + DecodeOptions + c chan Packet +} + +// NewPacketSource creates a packet data source. +func NewPacketSource(source PacketDataSource, decoder Decoder) *PacketSource { + return &PacketSource{ + source: source, + decoder: decoder, + } +} + +// NextPacket returns the next decoded packet from the PacketSource. On error, +// it returns a nil packet and a non-nil error. +func (p *PacketSource) NextPacket() (Packet, error) { + data, ci, err := p.source.ReadPacketData() + if err != nil { + return nil, err + } + packet := NewPacket(data, p.decoder, p.DecodeOptions) + m := packet.Metadata() + m.CaptureInfo = ci + m.Truncated = m.Truncated || ci.CaptureLength < ci.Length + return packet, nil +} + +// packetsToChannel reads in all packets from the packet source and sends them +// to the given channel. When it receives an error, it ignores it. When it +// receives an io.EOF, it closes the channel. +func (p *PacketSource) packetsToChannel() { + defer close(p.c) + for { + packet, err := p.NextPacket() + if err == io.EOF { + return + } else if err == nil { + p.c <- packet + } + } +} + +// Packets returns a channel of packets, allowing easy iterating over +// packets. Packets will be asynchronously read in from the underlying +// PacketDataSource and written to the returned channel. If the underlying +// PacketDataSource returns an io.EOF error, the channel will be closed. +// If any other error is encountered, it is ignored. +// +// for packet := range packetSource.Packets() { +// handlePacket(packet) // Do something with each packet. +// } +// +// If called more than once, returns the same channel. +func (p *PacketSource) Packets() chan Packet { + if p.c == nil { + p.c = make(chan Packet, 1000) + go p.packetsToChannel() + } + return p.c +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/parser.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/parser.go new file mode 100644 index 00000000..f786834e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/parser.go @@ -0,0 +1,198 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package gopacket + +import ( + "fmt" +) + +// DecodingLayer is an interface for packet layers that can decode themselves. +// +// The important part of DecodingLayer is that they decode themselves in-place. +// Calling DecodeFromBytes on a DecodingLayer totally resets the entire layer to +// the new state defined by the data passed in. A returned error leaves the +// DecodingLayer in an unknown intermediate state, thus its fields should not be +// trusted. +// +// Because the DecodingLayer is resetting its own fields, a call to +// DecodeFromBytes should normally not require any memory allocation. +type DecodingLayer interface { + // DecodeFromBytes resets the internal state of this layer to the state + // defined by the passed-in bytes. Slices in the DecodingLayer may + // reference the passed-in data, so care should be taken to copy it + // first should later modification of data be required before the + // DecodingLayer is discarded. + DecodeFromBytes(data []byte, df DecodeFeedback) error + // CanDecode returns the set of LayerTypes this DecodingLayer can + // decode. For Layers that are also DecodingLayers, this will most + // often be that Layer's LayerType(). + CanDecode() LayerClass + // NextLayerType returns the LayerType which should be used to decode + // the LayerPayload. + NextLayerType() LayerType + // LayerPayload is the set of bytes remaining to decode after a call to + // DecodeFromBytes. + LayerPayload() []byte +} + +// DecodingLayerParser parses a given set of layer types. See DecodeLayers for +// more information on how DecodingLayerParser should be used. +type DecodingLayerParser struct { + // DecodingLayerParserOptions is the set of options available to the + // user to define the parser's behavior. + DecodingLayerParserOptions + first LayerType + decoders map[LayerType]DecodingLayer + df DecodeFeedback + // Truncated is set when a decode layer detects that the packet has been + // truncated. + Truncated bool +} + +// AddDecodingLayer adds a decoding layer to the parser. This adds support for +// the decoding layer's CanDecode layers to the parser... should they be +// encountered, they'll be parsed. +func (l *DecodingLayerParser) AddDecodingLayer(d DecodingLayer) { + for _, typ := range d.CanDecode().LayerTypes() { + l.decoders[typ] = d + } +} + +// SetTruncated is used by DecodingLayers to set the Truncated boolean in the +// DecodingLayerParser. Users should simply read Truncated after calling +// DecodeLayers. +func (l *DecodingLayerParser) SetTruncated() { + l.Truncated = true +} + +// NewDecodingLayerParser creates a new DecodingLayerParser and adds in all +// of the given DecodingLayers with AddDecodingLayer. +// +// Each call to DecodeLayers will attempt to decode the given bytes first by +// treating them as a 'first'-type layer, then by using NextLayerType on +// subsequently decoded layers to find the next relevant decoder. Should a +// deoder not be available for the layer type returned by NextLayerType, +// decoding will stop. +func NewDecodingLayerParser(first LayerType, decoders ...DecodingLayer) *DecodingLayerParser { + dlp := &DecodingLayerParser{ + decoders: make(map[LayerType]DecodingLayer), + first: first, + } + dlp.df = dlp // Cast this once to the interface + for _, d := range decoders { + dlp.AddDecodingLayer(d) + } + return dlp +} + +// DecodeLayers decodes as many layers as possible from the given data. It +// initially treats the data as layer type 'typ', then uses NextLayerType on +// each subsequent decoded layer until it gets to a layer type it doesn't know +// how to parse. +// +// For each layer successfully decoded, DecodeLayers appends the layer type to +// the decoded slice. DecodeLayers truncates the 'decoded' slice initially, so +// there's no need to empty it yourself. +// +// This decoding method is about an order of magnitude faster than packet +// decoding, because it only decodes known layers that have already been +// allocated. This means it doesn't need to allocate each layer it returns... +// instead it overwrites the layers that already exist. +// +// Example usage: +// func main() { +// var eth layers.Ethernet +// var ip4 layers.IPv4 +// var ip6 layers.IPv6 +// var tcp layers.TCP +// var udp layers.UDP +// var payload gopacket.Payload +// parser := gopacket.NewDecodingLayerParser(layers.LayerTypeEthernet, ð, &ip4, &ip6, &tcp, &udp, &payload) +// var source gopacket.PacketDataSource = getMyDataSource() +// decodedLayers := make([]gopacket.LayerType, 0, 10) +// for { +// data, _, err := source.ReadPacketData() +// if err == nil { +// fmt.Println("Error reading packet data: ", err) +// continue +// } +// fmt.Println("Decoding packet") +// err = parser.DecodeLayers(data, &decodedLayers) +// for _, typ := range decodedLayers { +// fmt.Println(" Successfully decoded layer type", typ) +// switch typ { +// case layers.LayerTypeEthernet: +// fmt.Println(" Eth ", eth.SrcMAC, eth.DstMAC) +// case layers.LayerTypeIPv4: +// fmt.Println(" IP4 ", ip4.SrcIP, ip4.DstIP) +// case layers.LayerTypeIPv6: +// fmt.Println(" IP6 ", ip6.SrcIP, ip6.DstIP) +// case layers.LayerTypeTCP: +// fmt.Println(" TCP ", tcp.SrcPort, tcp.DstPort) +// case layers.LayerTypeUDP: +// fmt.Println(" UDP ", udp.SrcPort, udp.DstPort) +// } +// } +// if decodedLayers.Truncated { +// fmt.Println(" Packet has been truncated") +// } +// if err != nil { +// fmt.Println(" Error encountered:", err) +// } +// } +// } +// +// If DecodeLayers is unable to decode the next layer type, it will return the +// error UnsupportedLayerType. +func (l *DecodingLayerParser) DecodeLayers(data []byte, decoded *[]LayerType) (err error) { + l.Truncated = false + if !l.IgnorePanic { + defer panicToError(&err) + } + typ := l.first + *decoded = (*decoded)[:0] // Truncated decoded layers. + for len(data) > 0 { + decoder, ok := l.decoders[typ] + if !ok { + return UnsupportedLayerType(typ) + } else if err = decoder.DecodeFromBytes(data, l.df); err != nil { + return err + } + *decoded = append(*decoded, typ) + typ = decoder.NextLayerType() + data = decoder.LayerPayload() + } + return nil +} + +// UnsupportedLayerType is returned by DecodingLayerParser if DecodeLayers +// encounters a layer type that the DecodingLayerParser has no decoder for. +type UnsupportedLayerType LayerType + +// Error implements the error interface, returning a string to say that the +// given layer type is unsupported. +func (e UnsupportedLayerType) Error() string { + return fmt.Sprintf("No decoder for layer type %v", LayerType(e)) +} + +func panicToError(e *error) { + if r := recover(); r != nil { + *e = fmt.Errorf("panic: %v", r) + } +} + +// DecodingLayerParserOptions provides options to affect the behavior of a given +// DecodingLayerParser. +type DecodingLayerParserOptions struct { + // IgnorePanic determines whether a DecodingLayerParser should stop + // panics on its own (by returning them as an error from DecodeLayers) + // or should allow them to raise up the stack. Handling errors does add + // latency to the process of decoding layers, but is much safer for + // callers. IgnorePanic defaults to false, thus if the caller does + // nothing decode panics will be returned as errors. + IgnorePanic bool +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/doc.go new file mode 100644 index 00000000..70b412d3 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/doc.go @@ -0,0 +1,100 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +/* +Package pcap allows users of gopacket to read packets off the wire or from +pcap files. + +This package is meant to be used with its parent, +http://github.com/tsg/gopacket, although it can also be used independently +if you just want to get packet data from the wire. + +Reading PCAP Files + +The following code can be used to read in data from a pcap file. + + if handle, err := pcap.OpenOffline("/path/to/my/file"); err != nil { + panic(err) + } else { + packetSource := gopacket.NewPacketSource(handle, handle.LinkType()) + for packet := range packetSource.Packets() { + handlePacket(packet) // Do something with a packet here. + } + } + +Reading Live Packets + +The following code can be used to read in data from a live device, in this case +"eth0". + + if handle, err := pcap.OpenLive("eth0", 1600, true, 0); err != nil { + panic(err) + } else if err := handle.SetBPFFilter("tcp and port 80"); err != nil { // optional + panic(err) + } else { + packetSource := gopacket.NewPacketSource(handle, handle.LinkType()) + for packet := range packetSource.Packets() { + handlePacket(packet) // Do something with a packet here. + } + } + +Inactive Handles + +Newer PCAP functionality requires the concept of an 'inactive' PCAP handle. +Instead of constantly adding new arguments to pcap_open_live, users now call +pcap_create to create a handle, set it up with a bunch of optional function +calls, then call pcap_activate to activate it. This library mirrors that +mechanism, for those that want to expose/use these new features: + + inactive, err := pcap.NewInactiveHandle(deviceName) + if err != nil { + log.Fatal(err) + } + defer inactive.CleanUp() + + // Call various functions on inactive to set it up the way you'd like: + if err = inactive.SetTimeout(time.Minute); err != nil { + log.Fatal(err) + } else if err = inactive.SetTimestampSource("foo"); err != nil { + log.Fatal(err) + } + + // Finally, create the actual handle by calling Activate: + handle, err := inactive.Activate() // after this, inactive is no longer valid + if err != nil { + log.Fatal(err) + } + defer handle.Close() + + // Now use your handle as you see fit. + +PCAP Timeouts + +pcap.OpenLive and pcap.SetTimeout both take timeouts. +If you don't care about timeouts, just pass in BlockForever, +which should do what you expect with minimal fuss. + +A timeout of 0 is not recommended. Some platforms, like Macs +(http://www.manpages.info/macosx/pcap.3.html) say: + The read timeout is used to arrange that the read not necessarily return + immediately when a packet is seen, but that it wait for some amount of time + to allow more packets to arrive and to read multiple packets from the OS + kernel in one operation. +This means that if you only capture one packet, the kernel might decide to wait +'timeout' for more packets to batch with it before returning. A timeout of +0, then, means 'wait forever for more packets', which is... not good. + +To get around this, we've introduced the following behavior: if a negative +timeout is passed in, we set the positive timeout in the handle, then loop +internally in ReadPacketData/ZeroCopyReadPacketData when we see timeout +errors. + +PCAP File Writing + +This package does not implement PCAP file writing. However, gopacket/pcapgo +does! Look there if you'd like to write PCAP files. +*/ +package pcap diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/gopacket_benchmark/benchmark.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/gopacket_benchmark/benchmark.go new file mode 100644 index 00000000..8ee9609e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/gopacket_benchmark/benchmark.go @@ -0,0 +1,247 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// This benchmark reads in file /gopacket_benchmark.pcap and measures +// the time it takes to decode all packets from that file. If the file doesn't +// exist, it's pulled down from a publicly available location. However, you can +// feel free to substitute your own file at that location, in which case the +// benchmark will run on your own data. +// +// It's also useful for figuring out which packets may be causing errors. Pass +// in the --printErrors flag, and it'll print out error layers for each packet +// that has them. This includes any packets that it's just unable to decode, +// which is a great way to find new protocols to decode, and get test packets to +// write tests for them. +package main + +import ( + "compress/gzip" + "encoding/hex" + "flag" + "fmt" + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/layers" + "github.com/tsg/gopacket/pcap" + "github.com/tsg/gopacket/tcpassembly" + "io" + "io/ioutil" + "net/http" + "os" + "runtime" + "runtime/pprof" + "time" +) + +var decodeLazy *bool = flag.Bool("lazy", false, "If true, use lazy decoding") +var decodeNoCopy *bool = flag.Bool("nocopy", true, "If true, avoid an extra copy when decoding packets") +var printErrors *bool = flag.Bool("printErrors", false, "If true, check for and print error layers.") +var printLayers *bool = flag.Bool("printLayers", false, "If true, print out the layers of each packet") +var repeat *int = flag.Int("repeat", 5, "Read over the file N times") +var cpuProfile *string = flag.String("cpuprofile", "", "If set, write CPU profile to filename") +var url *string = flag.String("url", "http://www.ll.mit.edu/mission/communications/cyber/CSTcorpora/ideval/data/1999/training/week1/tuesday/inside.tcpdump.gz", "URL to gzip'd pcap file") + +type BufferPacketSource struct { + index int + data [][]byte + ci []gopacket.CaptureInfo +} + +func NewBufferPacketSource(p gopacket.PacketDataSource) *BufferPacketSource { + start := time.Now() + b := &BufferPacketSource{} + for { + data, ci, err := p.ReadPacketData() + if err == io.EOF { + break + } + b.data = append(b.data, data) + b.ci = append(b.ci, ci) + } + duration := time.Since(start) + fmt.Printf("Reading packet data into memory: %d packets in %v, %v per packet\n", len(b.data), duration, duration/time.Duration(len(b.data))) + return b +} + +func (b *BufferPacketSource) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) { + if b.index >= len(b.data) { + err = io.EOF + return + } + data = b.data[b.index] + ci = b.ci[b.index] + b.index++ + return +} + +func (b *BufferPacketSource) Reset() { + runtime.GC() + b.index = 0 +} + +func main() { + flag.Parse() + filename := os.TempDir() + string(os.PathSeparator) + "gopacket_benchmark.pcap" + if _, err := os.Stat(filename); err != nil { + // This URL points to a publicly available packet data set from a DARPA + // intrusion detection evaluation. See + // http://www.ll.mit.edu/mission/communications/cyber/CSTcorpora/ideval/data/1999/training/week1/index.html + // for more details. + fmt.Println("Local pcap file", filename, "doesn't exist, reading from", *url) + if resp, err := http.Get(*url); err != nil { + panic(err) + } else if out, err := os.Create(filename); err != nil { + panic(err) + } else if gz, err := gzip.NewReader(resp.Body); err != nil { + panic(err) + } else if n, err := io.Copy(out, gz); err != nil { + panic(err) + } else if err := gz.Close(); err != nil { + panic(err) + } else if err := out.Close(); err != nil { + panic(err) + } else { + fmt.Println("Successfully read", n, "bytes from url, unzipped to local storage") + } + } + fmt.Println("Reading file once through to hopefully cache most of it") + if f, err := os.Open(filename); err != nil { + panic(err) + } else if n, err := io.Copy(ioutil.Discard, f); err != nil { + panic(err) + } else if err := f.Close(); err != nil { + panic(err) + } else { + fmt.Println("Read in file", filename, ", total of", n, "bytes") + } + if *cpuProfile != "" { + if cpu, err := os.Create(*cpuProfile); err != nil { + panic(err) + } else if err := pprof.StartCPUProfile(cpu); err != nil { + panic(err) + } else { + defer func() { + pprof.StopCPUProfile() + cpu.Close() + }() + } + } + var packetDataSource *BufferPacketSource + var packetSource *gopacket.PacketSource + fmt.Printf("Opening file %q for read\n", filename) + if h, err := pcap.OpenOffline(filename); err != nil { + panic(err) + } else { + fmt.Println("Reading all packets into memory with BufferPacketSource.") + start := time.Now() + packetDataSource = NewBufferPacketSource(h) + duration := time.Since(start) + fmt.Printf("Time to read packet data into memory from file: %v\n", duration) + packetSource = gopacket.NewPacketSource(packetDataSource, h.LinkType()) + packetSource.DecodeOptions.Lazy = *decodeLazy + packetSource.DecodeOptions.NoCopy = *decodeNoCopy + } + fmt.Println() + for i := 0; i < *repeat; i++ { + packetDataSource.Reset() + fmt.Printf("Benchmarking decode %d/%d\n", i+1, *repeat) + benchmarkPacketDecode(packetSource) + } + fmt.Println() + for i := 0; i < *repeat; i++ { + packetDataSource.Reset() + fmt.Printf("Benchmarking decoding layer parser %d/%d\n", i+1, *repeat) + benchmarkLayerDecode(packetDataSource, false) + } + fmt.Println() + for i := 0; i < *repeat; i++ { + packetDataSource.Reset() + fmt.Printf("Benchmarking decoding layer parser with assembly %d/%d\n", i+1, *repeat) + benchmarkLayerDecode(packetDataSource, true) + } +} + +func benchmarkPacketDecode(packetSource *gopacket.PacketSource) { + count, errors := 0, 0 + start := time.Now() + for packet, err := packetSource.NextPacket(); err != io.EOF; packet, err = packetSource.NextPacket() { + if err != nil { + fmt.Println("Error reading in packet:", err) + continue + } + count++ + var hasError bool + if *printErrors && packet.ErrorLayer() != nil { + fmt.Println("\n\n\nError decoding packet:", packet.ErrorLayer().Error()) + fmt.Println(hex.Dump(packet.Data())) + fmt.Printf("%#v\n", packet.Data()) + errors++ + hasError = true + } + if *printLayers || hasError { + fmt.Printf("\n=== PACKET %d ===\n", count) + for _, l := range packet.Layers() { + fmt.Printf("--- LAYER %v ---\n%#v\n\n", l.LayerType(), l) + } + fmt.Println() + } + } + duration := time.Since(start) + fmt.Printf("\tRead in %v packets in %v, %v per packet\n", count, duration, duration/time.Duration(count)) + if *printErrors { + fmt.Printf("%v errors, successfully decoded %.02f%%\n", errors, float64(count-errors)*100.0/float64(count)) + } +} + +type streamFactory struct { +} + +func (s *streamFactory) New(netFlow, tcpFlow gopacket.Flow) tcpassembly.Stream { + return s +} +func (s *streamFactory) Reassembled([]tcpassembly.Reassembly) { +} +func (s *streamFactory) ReassemblyComplete() { +} + +func benchmarkLayerDecode(source *BufferPacketSource, assemble bool) { + var tcp layers.TCP + var ip layers.IPv4 + var eth layers.Ethernet + var udp layers.UDP + var icmp layers.ICMPv4 + var payload gopacket.Payload + parser := gopacket.NewDecodingLayerParser( + layers.LayerTypeEthernet, + ð, &ip, &icmp, &tcp, &udp, &payload) + pool := tcpassembly.NewStreamPool(&streamFactory{}) + assembler := tcpassembly.NewAssembler(pool) + var decoded []gopacket.LayerType + start := time.Now() + packets, decodedlayers, assembled := 0, 0, 0 + for { + packets++ + data, ci, err := source.ReadPacketData() + if err == io.EOF { + break + } else if err != nil { + fmt.Println("Error reading packet: ", err) + continue + } + err = parser.DecodeLayers(data, &decoded) + for _, typ := range decoded { + decodedlayers++ + if typ == layers.LayerTypeTCP && assemble { + assembled++ + assembler.AssembleWithTimestamp(ip.NetworkFlow(), &tcp, ci.Timestamp) + } + } + } + if assemble { + assembler.FlushAll() + } + duration := time.Since(start) + fmt.Printf("\tRead in %d packets in %v, decoded %v layers, assembled %v packets: %v per packet\n", packets, duration, decodedlayers, assembled, duration/time.Duration(packets)) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/pcap.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/pcap.go new file mode 100644 index 00000000..f5612e6f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/pcap.go @@ -0,0 +1,841 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package pcap + +/* +#cgo linux LDFLAGS: -lpcap +#cgo freebsd LDFLAGS: -lpcap +#cgo openbsd LDFLAGS: -lpcap +#cgo darwin LDFLAGS: -lpcap +#cgo solaris LDFLAGS: -lpcap +#cgo windows CFLAGS: -I C:/WpdPack/Include +#cgo windows,386 LDFLAGS: -L C:/WpdPack/Lib -lwpcap +#cgo windows,amd64 LDFLAGS: -L C:/WpdPack/Lib/x64 -lwpcap +#include +#include + +// Some old versions of pcap don't define this constant. +#ifndef PCAP_NETMASK_UNKNOWN +#define PCAP_NETMASK_UNKNOWN 0xffffffff +#endif + +// libpcap doesn't actually export its version in a #define-guardable way, +// so we have to use other defined things to differentiate versions. +// We assume at least libpcap v1.1 at the moment. +// See http://upstream-tracker.org/versions/libpcap.html + +#ifndef PCAP_ERROR_TSTAMP_PRECISION_NOTSUP // < v1.5 + +int pcap_set_immediate_mode(pcap_t *p, int mode) { + return PCAP_ERROR; +} + +#ifndef PCAP_TSTAMP_HOST // < v1.2 + +int pcap_set_tstamp_type(pcap_t* p, int t) { return -1; } +int pcap_list_tstamp_types(pcap_t* p, int** t) { return 0; } +void pcap_free_tstamp_types(int *tstamp_types) {} +const char* pcap_tstamp_type_val_to_name(int t) { + return "pcap timestamp types not supported"; +} +int pcap_tstamp_type_name_to_val(const char* t) { + return PCAP_ERROR; +} + +#endif // < v1.2 +#endif // < v1.5 + +#ifndef PCAP_ERROR_PROMISC_PERM_DENIED +#define PCAP_ERROR_PROMISC_PERM_DENIED -11 +#endif + +// WinPcap doesn't export a pcap_statustostr, so use the less-specific +// pcap_strerror. Note that linking against something like cygwin libpcap +// may result is less-specific error messages. +#ifdef WIN32 +#define pcap_statustostr pcap_strerror + +// WinPcap also doesn't export pcap_can_set_rfmon and pcap_set_rfmon, +// as those are handled by separate libraries (airpcap). +// https://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html +// Stub out those functions here, returning values that indicate rfmon +// setting is unavailable/unsuccessful. +int pcap_can_set_rfmon(pcap_t *p) { + return 0; +} + +int pcap_set_rfmon(pcap_t *p, int rfmon) { + return PCAP_ERROR; +} +#endif + +// Windows, Macs, and Linux all use different time types. Joy. +#ifdef WIN32 +#define gopacket_time_secs_t long +#define gopacket_time_usecs_t long +#elif __APPLE__ +#define gopacket_time_secs_t __darwin_time_t +#define gopacket_time_usecs_t __darwin_suseconds_t +#elif __GLIBC__ +#define gopacket_time_secs_t __time_t +#define gopacket_time_usecs_t __suseconds_t +#elif __OpenBSD__ +// time_t is 64-bit, however bpf_timeval uses 32 bit fields +#define gopacket_time_secs_t u_int32_t +#define gopacket_time_usecs_t u_int32_t +#else +#define gopacket_time_secs_t time_t +#define gopacket_time_usecs_t suseconds_t +#endif +*/ +import "C" + +import ( + "errors" + "fmt" + "io" + "net" + "reflect" + "runtime" + "strconv" + "sync" + "syscall" + "time" + "unsafe" + + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/layers" +) + +const errorBufferSize = 256 + +// Handle provides a connection to a pcap handle, allowing users to read packets +// off the wire (Next), inject packets onto the wire (Inject), and +// perform a number of other functions to affect and understand packet output. +// +// Handles are already pcap_activate'd +type Handle struct { + // cptr is the handle for the actual pcap C object. + cptr *C.pcap_t + blockForever bool + device string + mu sync.Mutex + // Since pointers to these objects are passed into a C function, if + // they're declared locally then the Go compiler thinks they may have + // escaped into C-land, so it allocates them on the heap. This causes a + // huge memory hit, so to handle that we store them here instead. + pkthdr *C.struct_pcap_pkthdr + buf_ptr *C.u_char +} + +// Stats contains statistics on how many packets were handled by a pcap handle, +// and what was done with those packets. +type Stats struct { + PacketsReceived int + PacketsDropped int + PacketsIfDropped int +} + +// Interface describes a single network interface on a machine. +type Interface struct { + Name string + Description string + Addresses []InterfaceAddress + // TODO: add more elements +} + +// Datalink describes the datalink +type Datalink struct { + Name string + Description string +} + +// InterfaceAddress describes an address associated with an Interface. +// Currently, it's IPv4/6 specific. +type InterfaceAddress struct { + IP net.IP + Netmask net.IPMask // Netmask may be nil if we were unable to retrieve it. + // TODO: add broadcast + PtP dst ? +} + +// BPF is a compiled filter program, useful for offline packet matching. +type BPF struct { + orig string + bpf _Ctype_struct_bpf_program // takes a finalizer, not overriden by outsiders +} + +// BlockForever, when passed into OpenLive/SetTimeout, causes it to block forever +// waiting for packets, while still returning incoming packets to userland relatively +// quickly. +const BlockForever = -time.Millisecond * 10 + +func timeoutMillis(timeout time.Duration) C.int { + // Flip sign if necessary. See package docs on timeout for reasoning behind this. + if timeout < 0 { + timeout *= -1 + } + // Round up + if timeout != 0 && timeout < time.Millisecond { + timeout = time.Millisecond + } + return C.int(timeout / time.Millisecond) +} + +// OpenLive opens a device and returns a *Handle. +// It takes as arguments the name of the device ("eth0"), the maximum size to +// read for each packet (snaplen), whether to put the interface in promiscuous +// mode, and a timeout. +// +// See the package documentation for important details regarding 'timeout'. +func OpenLive(device string, snaplen int32, promisc bool, timeout time.Duration) (handle *Handle, _ error) { + buf := (*C.char)(C.calloc(errorBufferSize, 1)) + defer C.free(unsafe.Pointer(buf)) + var pro C.int + if promisc { + pro = 1 + } + p := &Handle{} + p.blockForever = timeout < 0 + p.device = device + + dev := C.CString(device) + defer C.free(unsafe.Pointer(dev)) + + p.cptr = C.pcap_open_live(dev, C.int(snaplen), pro, timeoutMillis(timeout), buf) + if p.cptr == nil { + return nil, errors.New(C.GoString(buf)) + } + return p, nil +} + +// OpenOffline opens a file and returns its contents as a *Handle. +func OpenOffline(file string) (handle *Handle, err error) { + buf := (*C.char)(C.calloc(errorBufferSize, 1)) + defer C.free(unsafe.Pointer(buf)) + cf := C.CString(file) + defer C.free(unsafe.Pointer(cf)) + + cptr := C.pcap_open_offline(cf, buf) + if cptr == nil { + return nil, errors.New(C.GoString(buf)) + } + return &Handle{cptr: cptr}, nil +} + +// OpenDead creates a Pcap handle without having it attached to a device +// or to a file. It is typically used when just using the pcap package +// for compiling BPF code. +func OpenDead(linktype layers.LinkType, snaplen int32) (handle *Handle, _ error) { + cptr := C.pcap_open_dead(C.int(linktype), C.int(snaplen)) + if cptr == nil { + return nil, errors.New("pcap_open_dead failed") + } + return &Handle{cptr: cptr}, nil +} + +// NextError is the return code from a call to Next. +type NextError int32 + +// NextError implements the error interface. +func (n NextError) Error() string { + switch n { + case NextErrorOk: + return "OK" + case NextErrorTimeoutExpired: + return "Timeout Expired" + case NextErrorReadError: + return "Read Error" + case NextErrorNoMorePackets: + return "No More Packets In File" + case NextErrorNotActivated: + return "Not Activated" + } + return strconv.Itoa(int(n)) +} + +const ( + NextErrorOk NextError = 1 + NextErrorTimeoutExpired NextError = 0 + NextErrorReadError NextError = -1 + // NextErrorNoMorePackets is returned when reading from a file (OpenOffline) and + // EOF is reached. When this happens, Next() returns io.EOF instead of this. + NextErrorNoMorePackets NextError = -2 + NextErrorNotActivated NextError = -3 +) + +// NextError returns the next packet read from the pcap handle, along with an error +// code associated with that packet. If the packet is read successfully, the +// returned error is nil. +func (p *Handle) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) { + p.mu.Lock() + err = p.getNextBufPtrLocked(&ci) + if err == nil { + data = C.GoBytes(unsafe.Pointer(p.buf_ptr), C.int(ci.CaptureLength)) + } + p.mu.Unlock() + return +} + +type activateError C.int + +const ( + aeNoError = 0 + aeActivated = C.PCAP_ERROR_ACTIVATED + aePromisc = C.PCAP_WARNING_PROMISC_NOTSUP + aeNoSuchDevice = C.PCAP_ERROR_NO_SUCH_DEVICE + aeDenied = C.PCAP_ERROR_PERM_DENIED + aeNotUp = C.PCAP_ERROR_IFACE_NOT_UP +) + +func (a activateError) Error() string { + switch a { + case aeNoError: + return "No Error" + case aeActivated: + return "Already Activated" + case aePromisc: + return "Cannot set as promisc" + case aeNoSuchDevice: + return "No Such Device" + case aeDenied: + return "Permission Denied" + case aeNotUp: + return "Interface Not Up" + default: + return fmt.Sprintf("unknown activated error: %d", a) + } +} + +// getNextBufPtrLocked is shared code for ReadPacketData and +// ZeroCopyReadPacketData. +func (p *Handle) getNextBufPtrLocked(ci *gopacket.CaptureInfo) error { + var result NextError + for { + result = NextError(C.pcap_next_ex(p.cptr, &p.pkthdr, &p.buf_ptr)) + if p.blockForever && result == NextErrorTimeoutExpired { + continue + } + break + } + if result != NextErrorOk { + if result == NextErrorNoMorePackets { + return io.EOF + } else { + return result + } + } + ci.Timestamp = time.Unix(int64(p.pkthdr.ts.tv_sec), + int64(p.pkthdr.ts.tv_usec)*1000) // convert micros to nanos + ci.CaptureLength = int(p.pkthdr.caplen) + ci.Length = int(p.pkthdr.len) + return nil +} + +// ZeroCopyReadPacketData reads the next packet off the wire, and returns its data. +// The slice returned by ZeroCopyReadPacketData points to bytes owned by the +// the Handle. Each call to ZeroCopyReadPacketData invalidates any data previously +// returned by ZeroCopyReadPacketData. Care must be taken not to keep pointers +// to old bytes when using ZeroCopyReadPacketData... if you need to keep data past +// the next time you call ZeroCopyReadPacketData, use ReadPacketData, which copies +// the bytes into a new buffer for you. +// data1, _, _ := handle.ZeroCopyReadPacketData() +// // do everything you want with data1 here, copying bytes out of it if you'd like to keep them around. +// data2, _, _ := handle.ZeroCopyReadPacketData() // invalidates bytes in data1 +func (p *Handle) ZeroCopyReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) { + p.mu.Lock() + err = p.getNextBufPtrLocked(&ci) + if err == nil { + slice := (*reflect.SliceHeader)(unsafe.Pointer(&data)) + slice.Data = uintptr(unsafe.Pointer(p.buf_ptr)) + slice.Len = ci.CaptureLength + slice.Cap = ci.CaptureLength + } + p.mu.Unlock() + return +} + +// Close closes the underlying pcap handle. +func (p *Handle) Close() { + C.pcap_close(p.cptr) +} + +// Error returns the current error associated with a pcap handle (pcap_geterr). +func (p *Handle) Error() error { + return errors.New(C.GoString(C.pcap_geterr(p.cptr))) +} + +// Stats returns statistics on the underlying pcap handle. +func (p *Handle) Stats() (stat *Stats, err error) { + var cstats _Ctype_struct_pcap_stat + if -1 == C.pcap_stats(p.cptr, &cstats) { + return nil, p.Error() + } + return &Stats{ + PacketsReceived: int(cstats.ps_recv), + PacketsDropped: int(cstats.ps_drop), + PacketsIfDropped: int(cstats.ps_ifdrop), + }, nil +} + +// Obtains a list of all possible data link types supported for an interface. +func (p *Handle) ListDataLinks() (datalinks []Datalink, err error) { + var dlt_buf *C.int + + n := int(C.pcap_list_datalinks(p.cptr, &dlt_buf)) + if -1 == n { + return nil, p.Error() + } + + defer C.pcap_free_datalinks(dlt_buf) + + datalinks = make([]Datalink, n) + + dltArray := (*[100]C.int)(unsafe.Pointer(dlt_buf)) + + for i := 0; i < n; i++ { + expr := C.pcap_datalink_val_to_name((*dltArray)[i]) + datalinks[i].Name = C.GoString(expr) + + expr = C.pcap_datalink_val_to_description((*dltArray)[i]) + datalinks[i].Description = C.GoString(expr) + } + + return datalinks, nil +} + +// SetBPFFilter compiles and sets a BPF filter for the pcap handle. +func (p *Handle) SetBPFFilter(expr string) (err error) { + errorBuf := (*C.char)(C.calloc(errorBufferSize, 1)) + defer C.free(unsafe.Pointer(errorBuf)) + + var netp uint32 + var maskp uint32 + + // Only do the lookup on network interfaces. + // No device indicates we're handling a pcap file. + if len(p.device) > 0 { + dev := C.CString(p.device) + defer C.free(unsafe.Pointer(dev)) + if -1 == C.pcap_lookupnet( + dev, + (*C.bpf_u_int32)(unsafe.Pointer(&netp)), + (*C.bpf_u_int32)(unsafe.Pointer(&maskp)), + errorBuf, + ) { + // We can't lookup the network, but that could be because the interface + // doesn't have an IPv4. + } + } + + var bpf _Ctype_struct_bpf_program + cexpr := C.CString(expr) + defer C.free(unsafe.Pointer(cexpr)) + + if -1 == C.pcap_compile(p.cptr, &bpf, cexpr, 1, C.bpf_u_int32(maskp)) { + return p.Error() + } + + if -1 == C.pcap_setfilter(p.cptr, &bpf) { + C.pcap_freecode(&bpf) + return p.Error() + } + + C.pcap_freecode(&bpf) + + return nil +} + +// NewBPF compiles the given string into a new filter program. +// +// BPF filters need to be created from activated handles, because they need to +// know the underlying link type to correctly compile their offsets. +func (p *Handle) NewBPF(expr string) (*BPF, error) { + bpf := &BPF{orig: expr} + cexpr := C.CString(expr) + defer C.free(unsafe.Pointer(cexpr)) + + if C.pcap_compile(p.cptr, &bpf.bpf, cexpr /* optimize */, 1, C.PCAP_NETMASK_UNKNOWN) != 0 { + return nil, p.Error() + } + runtime.SetFinalizer(bpf, destroyBPF) + return bpf, nil +} +func destroyBPF(bpf *BPF) { + C.pcap_freecode(&bpf.bpf) +} + +// String returns the original string this BPF filter was compiled from. +func (b *BPF) String() string { + return b.orig +} + +// BPF returns the compiled BPF program. +func (b *BPF) BPF() _Ctype_struct_bpf_program { + return b.bpf +} + +// Matches returns true if the given packet data matches this filter. +func (b *BPF) Matches(ci gopacket.CaptureInfo, data []byte) bool { + var hdr C.struct_pcap_pkthdr + hdr.ts.tv_sec = C.gopacket_time_secs_t(ci.Timestamp.Unix()) + hdr.ts.tv_usec = C.gopacket_time_usecs_t(ci.Timestamp.Nanosecond() / 1000) + hdr.caplen = C.bpf_u_int32(len(data)) // Trust actual length over ci.Length. + hdr.len = C.bpf_u_int32(ci.Length) + dataptr := (*C.u_char)(unsafe.Pointer(&data[0])) + return C.pcap_offline_filter(&b.bpf, &hdr, dataptr) != 0 +} + +// Version returns pcap_lib_version. +func Version() string { + return C.GoString(C.pcap_lib_version()) +} + +// LinkType returns pcap_datalink, as a layers.LinkType. +func (p *Handle) LinkType() layers.LinkType { + return layers.LinkType(C.pcap_datalink(p.cptr)) +} + +// SetLinkType calls pcap_set_datalink on the pcap handle. +func (p *Handle) SetLinkType(dlt layers.LinkType) error { + if -1 == C.pcap_set_datalink(p.cptr, C.int(dlt)) { + return p.Error() + } + return nil +} + +// FindAllDevs attempts to enumerate all interfaces on the current machine. +func FindAllDevs() (ifs []Interface, err error) { + var buf *C.char + buf = (*C.char)(C.calloc(errorBufferSize, 1)) + defer C.free(unsafe.Pointer(buf)) + var alldevsp *C.pcap_if_t + + if -1 == C.pcap_findalldevs((**C.pcap_if_t)(&alldevsp), buf) { + return nil, errors.New(C.GoString(buf)) + } + defer C.pcap_freealldevs((*C.pcap_if_t)(alldevsp)) + dev := alldevsp + var i uint32 + for i = 0; dev != nil; dev = (*C.pcap_if_t)(dev.next) { + i++ + } + ifs = make([]Interface, i) + dev = alldevsp + for j := uint32(0); dev != nil; dev = (*C.pcap_if_t)(dev.next) { + var iface Interface + iface.Name = C.GoString(dev.name) + iface.Description = C.GoString(dev.description) + iface.Addresses = findalladdresses(dev.addresses) + // TODO: add more elements + ifs[j] = iface + j++ + } + return +} + +func findalladdresses(addresses *_Ctype_struct_pcap_addr) (retval []InterfaceAddress) { + // TODO - make it support more than IPv4 and IPv6? + retval = make([]InterfaceAddress, 0, 1) + for curaddr := addresses; curaddr != nil; curaddr = (*_Ctype_struct_pcap_addr)(curaddr.next) { + var a InterfaceAddress + var err error + if a.IP, err = sockaddr_to_IP((*syscall.RawSockaddr)(unsafe.Pointer(curaddr.addr))); err != nil { + continue + } + if a.Netmask, err = sockaddr_to_IP((*syscall.RawSockaddr)(unsafe.Pointer(curaddr.netmask))); err != nil { + // If we got an IP address but we can't get a netmask, just return the IP + // address. + a.Netmask = nil + } + retval = append(retval, a) + } + return +} + +func sockaddr_to_IP(rsa *syscall.RawSockaddr) (IP []byte, err error) { + switch rsa.Family { + case syscall.AF_INET: + pp := (*syscall.RawSockaddrInet4)(unsafe.Pointer(rsa)) + IP = make([]byte, 4) + for i := 0; i < len(IP); i++ { + IP[i] = pp.Addr[i] + } + return + case syscall.AF_INET6: + pp := (*syscall.RawSockaddrInet6)(unsafe.Pointer(rsa)) + IP = make([]byte, 16) + for i := 0; i < len(IP); i++ { + IP[i] = pp.Addr[i] + } + return + } + err = errors.New("Unsupported address type") + return +} + +// WritePacketData calls pcap_sendpacket, injecting the given data into the pcap handle. +func (p *Handle) WritePacketData(data []byte) (err error) { + if -1 == C.pcap_sendpacket(p.cptr, (*C.u_char)(&data[0]), (C.int)(len(data))) { + err = p.Error() + } + return +} + +// Direction is used by Handle.SetDirection. +type Direction uint8 + +const ( + DirectionIn Direction = C.PCAP_D_IN + DirectionOut Direction = C.PCAP_D_OUT + DirectionInOut Direction = C.PCAP_D_INOUT +) + +// SetDirection sets the direction for which packets will be captured. +func (p *Handle) SetDirection(direction Direction) error { + if direction != DirectionIn && direction != DirectionOut && direction != DirectionInOut { + return fmt.Errorf("Invalid direction: %v", direction) + } + if status := C.pcap_setdirection(p.cptr, (C.pcap_direction_t)(direction)); status < 0 { + return statusError(status) + } + return nil +} + +// TimestampSource tells PCAP which type of timestamp to use for packets. +type TimestampSource C.int + +// String returns the timestamp type as a human-readable string. +func (t TimestampSource) String() string { + return C.GoString(C.pcap_tstamp_type_val_to_name(C.int(t))) +} + +// TimestampSourceFromString translates a string into a timestamp type, case +// insensitive. +func TimestampSourceFromString(s string) (TimestampSource, error) { + t := C.pcap_tstamp_type_name_to_val(C.CString(s)) + if t < 0 { + return 0, statusError(t) + } + return TimestampSource(t), nil +} + +func statusError(status C.int) error { + return errors.New(C.GoString(C.pcap_statustostr(status))) +} + +// InactiveHandle allows you to call pre-pcap_activate functions on your pcap +// handle to set it up just the way you'd like. +type InactiveHandle struct { + // cptr is the handle for the actual pcap C object. + cptr *C.pcap_t + device string + blockForever bool +} + +// Activate activates the handle. The current InactiveHandle becomes invalid +// and all future function calls on it will fail. +func (p *InactiveHandle) Activate() (*Handle, error) { + err := activateError(C.pcap_activate(p.cptr)) + if err != aeNoError { + return nil, err + } + h := &Handle{cptr: p.cptr, device: p.device, blockForever: p.blockForever} + p.cptr = nil + return h, nil +} + +// CleanUp cleans up any stuff left over from a successful or failed building +// of a handle. +func (p *InactiveHandle) CleanUp() { + if p.cptr != nil { + C.pcap_close(p.cptr) + } +} + +// NewInactiveHandle creates a new InactiveHandle, which wraps an un-activated PCAP handle. +// Callers of NewInactiveHandle should immediately defer 'CleanUp', as in: +// inactive := NewInactiveHandle("eth0") +// defer inactive.CleanUp() +func NewInactiveHandle(device string) (*InactiveHandle, error) { + buf := (*C.char)(C.calloc(errorBufferSize, 1)) + defer C.free(unsafe.Pointer(buf)) + dev := C.CString(device) + defer C.free(unsafe.Pointer(dev)) + + // This copies a bunch of the pcap_open_live implementation from pcap.c: + cptr := C.pcap_create(dev, buf) + if cptr == nil { + return nil, errors.New(C.GoString(buf)) + } + return &InactiveHandle{cptr: cptr, device: device}, nil +} + +// SetSnapLen sets the snap length (max bytes per packet to capture). +func (p *InactiveHandle) SetSnapLen(snaplen int) error { + if status := C.pcap_set_snaplen(p.cptr, C.int(snaplen)); status < 0 { + return statusError(status) + } + return nil +} + +// SetPromisc sets the handle to either be promiscuous (capture packets +// unrelated to this host) or not. +func (p *InactiveHandle) SetPromisc(promisc bool) error { + var pro C.int + if promisc { + pro = 1 + } + if status := C.pcap_set_promisc(p.cptr, pro); status < 0 { + return statusError(status) + } + return nil +} + +// SetTimeout sets the read timeout for the handle. +// +// See the package documentation for important details regarding 'timeout'. +func (p *InactiveHandle) SetTimeout(timeout time.Duration) error { + p.blockForever = timeout < 0 + if status := C.pcap_set_timeout(p.cptr, timeoutMillis(timeout)); status < 0 { + return statusError(status) + } + return nil +} + +// SupportedTimestamps returns a list of supported timstamp types for this +// handle. +func (p *InactiveHandle) SupportedTimestamps() (out []TimestampSource) { + var types *C.int + n := int(C.pcap_list_tstamp_types(p.cptr, &types)) + defer C.pcap_free_tstamp_types(types) + typesArray := (*[100]C.int)(unsafe.Pointer(types)) + for i := 0; i < n; i++ { + out = append(out, TimestampSource((*typesArray)[i])) + } + return +} + +// SetTimestampSource sets the type of timestamp generator PCAP uses when +// attaching timestamps to packets. +func (p *InactiveHandle) SetTimestampSource(t TimestampSource) error { + if status := C.pcap_set_tstamp_type(p.cptr, C.int(t)); status < 0 { + return statusError(status) + } + return nil +} + +// CannotSetRFMon is returned by SetRFMon if the handle does not allow +// setting RFMon because pcap_can_set_rfmon returns 0. +var CannotSetRFMon = errors.New("Cannot set rfmon for this handle") + +// SetRFMon turns on radio monitoring mode, similar to promiscuous mode but for +// wireless networks. If this mode is enabled, the interface will not need to +// associate with an access point before it can receive traffic. +func (p *InactiveHandle) SetRFMon(monitor bool) error { + var mon C.int + if monitor { + mon = 1 + } + switch canset := C.pcap_can_set_rfmon(p.cptr); canset { + case 0: + return CannotSetRFMon + case 1: + // success + default: + return statusError(canset) + } + if status := C.pcap_set_rfmon(p.cptr, mon); status != 0 { + return statusError(status) + } + return nil +} + +// SetBufferSize sets the buffer size (in bytes) of the handle. +func (p *InactiveHandle) SetBufferSize(bufferSize int) error { + if status := C.pcap_set_buffer_size(p.cptr, C.int(bufferSize)); status < 0 { + return statusError(status) + } + return nil +} + +// SetImmediateMode sets (or unsets) the immediate mode of the +// handle. In immediate mode, packets are delivered to the application +// as soon as they arrive. In other words, this overrides SetTimeout. +func (p *InactiveHandle) SetImmediateMode(mode bool) error { + var md C.int + if mode { + md = 1 + } + if status := C.pcap_set_immediate_mode(p.cptr, md); status < 0 { + return statusError(status) + } + return nil +} + +// Dumper can be used to write packet data to a file. +type Dumper struct { + h *Handle + cptr *C.pcap_dumper_t +} + +// Returns a Dumper read to write packets from the given pcap +// handler in the file given as parameter. +func (h *Handle) NewDumper(file string) (dumper *Dumper, err error) { + cf := C.CString(file) + defer C.free(unsafe.Pointer(cf)) + + cptr, err := C.pcap_dump_open(h.cptr, cf) + if err != nil { + return + } + if cptr == nil { + return nil, fmt.Errorf("Failed to open file: %s", file) + } + return &Dumper{h: h, cptr: cptr}, nil +} + +// Writes a packet to the file. The return values of ReadPacketData +// can be passed to this function as arguments. +func (d *Dumper) WritePacketData(data []byte, ci gopacket.CaptureInfo) (err error) { + var pkthdr _Ctype_struct_pcap_pkthdr + pkthdr.caplen = C.bpf_u_int32(ci.CaptureLength) + pkthdr.len = C.bpf_u_int32(ci.Length) + + pkthdr.ts.tv_sec = C.gopacket_time_secs_t(ci.Timestamp.Unix()) + pkthdr.ts.tv_usec = C.gopacket_time_usecs_t(ci.Timestamp.Nanosecond() / 1000) + + // pcap_dump takes a u_char pointer to the dumper as first argument + dumper_ptr := (*C.u_char)(unsafe.Pointer(d.cptr)) + + // trick to get a pointer to the underling slice + ptr := (*C.u_char)(unsafe.Pointer(&data[0])) + + _, err = C.pcap_dump(dumper_ptr, &pkthdr, ptr) + return +} + +// Flushes the underling file to disk. +func (d *Dumper) Flush() (err error) { + n, err := C.pcap_dump_flush(d.cptr) + if err != nil { + return err + } + if n != 0 { + return fmt.Errorf("pcap_dump_flush failed: %d", n) + } + return +} + +// Closes the underling file. +func (d *Dumper) Close() (err error) { + _, err = C.pcap_dump_close(d.cptr) + if err != nil { + return err + } + return +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/pcap_tester.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/pcap_tester.go new file mode 100644 index 00000000..62a5f805 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/pcap_tester.go @@ -0,0 +1,107 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// +build ignore + +// This binary tests that PCAP packet capture is working correctly by issuing +// HTTP requests, then making sure we actually capture data off the wire. +package main + +import ( + "flag" + "fmt" + "github.com/tsg/gopacket/pcap" + "log" + "net" + "net/http" + "os" + "time" +) + +var mode = flag.String("mode", "basic", "One of: basic,filtered,timestamp") + +func generatePackets() { + if resp, err := http.Get("http://code.google.com"); err != nil { + log.Printf("Could not get HTTP: %v", err) + } else { + resp.Body.Close() + } +} + +func main() { + flag.Parse() + ifaces, err := net.Interfaces() + if err != nil { + log.Fatal(err) + } + for _, iface := range ifaces { + log.Printf("Trying capture on %q", iface.Name) + if err := tryCapture(iface); err != nil { + log.Printf("Error capturing on %q: %v", iface.Name, err) + } else { + log.Printf("Successfully captured on %q", iface.Name) + return + } + } + os.Exit(1) +} + +func tryCapture(iface net.Interface) error { + if iface.Name[:2] == "lo" { + return fmt.Errorf("skipping loopback") + } + var h *pcap.Handle + var err error + switch *mode { + case "basic": + h, err = pcap.OpenLive(iface.Name, 65536, false, time.Second*3) + if err != nil { + return fmt.Errorf("openlive: %v", err) + } + defer h.Close() + case "filtered": + h, err = pcap.OpenLive(iface.Name, 65536, false, time.Second*3) + if err != nil { + return fmt.Errorf("openlive: %v", err) + } + defer h.Close() + if err := h.SetBPFFilter("port 80 or port 443"); err != nil { + return fmt.Errorf("setbpf: %v", err) + } + case "timestamp": + u, err := pcap.NewInactiveHandle(iface.Name) + if err != nil { + return err + } + defer u.CleanUp() + if err = u.SetSnapLen(65536); err != nil { + return err + } else if err = u.SetPromisc(false); err != nil { + return err + } else if err = u.SetTimeout(time.Second * 3); err != nil { + return err + } + sources := u.SupportedTimestamps() + if len(sources) == 0 { + return fmt.Errorf("no supported timestamp sources") + } else if err := u.SetTimestampSource(sources[0]); err != nil { + return fmt.Errorf("settimestampsource(%v): %v", sources[0], err) + } else if h, err = u.Activate(); err != nil { + return fmt.Errorf("could not activate: %v", err) + } + defer h.Close() + default: + panic("Invalid --mode: " + *mode) + } + go generatePackets() + h.ReadPacketData() // Do one dummy read to clear any timeouts. + data, ci, err := h.ReadPacketData() + if err != nil { + return fmt.Errorf("readpacketdata: %v", err) + } + log.Printf("Read packet, %v bytes, CI: %+v", len(data), ci) + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/test_dns.pcap b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/test_dns.pcap new file mode 100644 index 00000000..3a79f928 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/test_dns.pcap differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/test_ethernet.pcap b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/test_ethernet.pcap new file mode 100644 index 00000000..1f8a87c3 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/test_ethernet.pcap differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/test_loopback.pcap b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/test_loopback.pcap new file mode 100644 index 00000000..ddeb82cd Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/test_loopback.pcap differ diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcapgo/write.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcapgo/write.go new file mode 100644 index 00000000..84a43242 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcapgo/write.go @@ -0,0 +1,97 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// Package pcapgo provides some native PCAP support, not requiring +// C libpcap to be installed. +package pcapgo + +import ( + "encoding/binary" + "fmt" + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/layers" + "io" +) + +// Writer wraps an underlying io.Writer to write packet data in PCAP +// format. See http://wiki.wireshark.org/Development/LibpcapFileFormat +// for information on the file format. +// +// For those that care, we currently write v2.4 files with nanosecond +// timestamp resolution and little-endian encoding. +type Writer struct { + w io.Writer +} + +const magicNanoseconds = 0xA1B2C3D4 +const versionMajor = 2 +const versionMinor = 4 + +// NewWriter returns a new writer object, for writing packet data out +// to the given writer. If this is a new empty writer (as opposed to +// an append), you must call WriteFileHeader before WritePacket. +// +// // Write a new file: +// f, _ := os.Create("/tmp/file.pcap") +// w := pcapgo.NewWriter(f) +// w.WriteFileHeader(65536, layers.LinkTypeEthernet) // new file, must do this. +// w.WritePacket(gopacket.CaptureInfo{...}, data1) +// f.Close() +// // Append to existing file (must have same snaplen and linktype) +// f2, _ := os.OpenFile("/tmp/file.pcap", os.O_APPEND, 0700) +// w2 := pcapgo.NewWriter(f2) +// // no need for file header, it's already written. +// w2.WritePacket(gopacket.CaptureInfo{...}, data2) +// f2.Close() +func NewWriter(w io.Writer) *Writer { + return &Writer{w: w} +} + +// WriteFileHeader writes a file header out to the writer. +// This must be called exactly once per output. +func (w *Writer) WriteFileHeader(snaplen uint32, linktype layers.LinkType) error { + var buf [24]byte + binary.LittleEndian.PutUint32(buf[0:4], magicNanoseconds) + binary.LittleEndian.PutUint16(buf[4:6], versionMajor) + binary.LittleEndian.PutUint16(buf[6:8], versionMinor) + // bytes 8:12 stay 0 (timezone = UTC) + // bytes 12:16 stay 0 (sigfigs is always set to zero, according to + // http://wiki.wireshark.org/Development/LibpcapFileFormat + binary.LittleEndian.PutUint32(buf[16:20], snaplen) + binary.LittleEndian.PutUint32(buf[20:24], uint32(linktype)) + _, err := w.w.Write(buf[:]) + return err +} + +const nanosPerMicro = 1000 +const microsPerSecond = 1000000 + +func (w *Writer) writePacketHeader(ci gopacket.CaptureInfo) error { + var buf [16]byte + micros := ci.Timestamp.UnixNano() / nanosPerMicro + secs, usecs := uint32(micros/microsPerSecond), uint32(micros%microsPerSecond) + binary.LittleEndian.PutUint32(buf[0:4], secs) + binary.LittleEndian.PutUint32(buf[4:8], usecs) + binary.LittleEndian.PutUint32(buf[8:12], uint32(ci.CaptureLength)) + binary.LittleEndian.PutUint32(buf[12:16], uint32(ci.Length)) + _, err := w.w.Write(buf[:]) + return err +} + +// WritePacket writes the given packet data out to the file. +func (w *Writer) WritePacket(ci gopacket.CaptureInfo, data []byte) error { + if ci.CaptureLength != len(data) { + return fmt.Errorf("capture length %d does not match data length %d", ci.CaptureLength, len(data)) + } + if ci.CaptureLength > ci.Length { + return fmt.Errorf("invalid capture info %+v: capture length > length", ci) + } + if err := w.writePacketHeader(ci); err != nil { + return fmt.Errorf("error writing packet header: %v", err) + } + _, err := w.w.Write(data) + return err +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pfring/doc.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pfring/doc.go new file mode 100644 index 00000000..2358294c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pfring/doc.go @@ -0,0 +1,58 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +/* Package pfring wraps the PF_RING C library for Go. + +PF_RING is a high-performance packet capture library written by ntop.org (see +http://www.ntop.org/products/pf_ring/). This library allows you to utilize the +PF_RING library with gopacket to read packet data and decode it. + +This package is meant to be used with its parent, +http://github.com/tsg/gopacket, although it can also be used independently +if you just want to get packet data from the wire. + +Simple Example + +This is probably the simplest code you can use to start getting packets through +pfring: + + if ring, err := pfring.NewRing("eth0", 65536, pfring.FlagPromisc); err != nil { + panic(err) + } else if err := ring.SetBPFFilter("tcp and port 80"); err != nil { // optional + panic(err) + } else if err := ring.Enable(); err != nil { // Must do this!, or you get no packets! + panic(err) + } else { + packetSource := gopacket.NewPacketSource(ring, layers.LinkTypeEthernet) + for packet := range packetSource.Packets() { + handlePacket(packet) // Do something with a packet here. + } + } + +Pfring Tweaks + +PF_RING has a ton of optimizations and tweaks to make sure you get just the +packets you want. For example, if you're only using pfring to read packets, +consider running: + + ring.SetSocketMode(pfring.ReadOnly) + +If you only care about packets received on your interface (not those transmitted +by the interface), you can run: + + ring.SetDirection(pfring.ReceiveOnly) + +Pfring Clusters + +PF_RING has an idea of 'clusters', where multiple applications can all read from +the same cluster, and PF_RING will multiplex packets over that cluster such that +only one application receives each packet. We won't discuss this mechanism in +too much more detail (see the ntop.org docs for more info), but here's how to +utilize this with the pfring go library: + + ring.SetCluster(1, pfring.ClusterPerFlow5Tuple) +*/ +package pfring diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pfring/pfring.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pfring/pfring.go new file mode 100644 index 00000000..b39de231 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pfring/pfring.go @@ -0,0 +1,304 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// Copyright 2009-2011 Andreas Krennmair. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package pfring + +/* +#cgo LDFLAGS: -lpfring -lpcap +#include +#include +#include +*/ +import "C" + +// NOTE: If you install PF_RING with non-standard options, you may also need +// to use LDFLAGS -lnuma and/or -lrt. Both have been reported necessary if +// PF_RING is configured with --disable-bpf. + +import ( + "fmt" + "github.com/tsg/gopacket" + "os" + "strconv" + "sync" + "time" + "unsafe" +) + +const errorBufferSize = 256 + +// Ring provides a handle to a pf_ring. +type Ring struct { + // cptr is the handle for the actual pcap C object. + cptr *C.pfring + snaplen int + + mu sync.Mutex + // Since pointers to these objects are passed into a C function, if + // they're declared locally then the Go compiler thinks they may have + // escaped into C-land, so it allocates them on the heap. This causes a + // huge memory hit, so to handle that we store them here instead. + pkthdr C.struct_pfring_pkthdr + buf_ptr *C.u_char +} + +type Flag uint32 + +const ( + FlagReentrant Flag = C.PF_RING_REENTRANT + FlagLongHeader Flag = C.PF_RING_LONG_HEADER + FlagPromisc Flag = C.PF_RING_PROMISC + FlagDNASymmetricRSS Flag = C.PF_RING_DNA_SYMMETRIC_RSS + FlagTimestamp Flag = C.PF_RING_TIMESTAMP + FlagHWTimestamp Flag = C.PF_RING_HW_TIMESTAMP +) + +// NewRing creates a new PFRing. Note that when the ring is initially created, +// it is disabled. The caller must call Enable to start receiving packets. +// The caller should call Close on the given ring when finished with it. +func NewRing(device string, snaplen uint32, flags Flag) (ring *Ring, _ error) { + dev := C.CString(device) + defer C.free(unsafe.Pointer(dev)) + + cptr, err := C.pfring_open(dev, C.u_int32_t(snaplen), C.u_int32_t(flags)) + if cptr == nil || err != nil { + return nil, fmt.Errorf("pfring NewRing error: %v", err) + } + ring = &Ring{cptr: cptr, snaplen: int(snaplen)} + ring.SetApplicationName(os.Args[0]) + return +} + +// Close closes the given Ring. After this call, the Ring should no longer be +// used. +func (r *Ring) Close() { + C.pfring_close(r.cptr) +} + +// NextResult is the return code from a call to Next. +type NextResult int32 + +const ( + NextNoPacketNonblocking NextResult = 0 + NextError NextResult = -1 + NextOk NextResult = 1 + NextNotEnabled NextResult = -7 +) + +// NextResult implements the error interface. +func (n NextResult) Error() string { + switch n { + case NextNoPacketNonblocking: + return "No packet available, nonblocking socket" + case NextError: + return "Generic error" + case NextOk: + return "Success (not an error)" + case NextNotEnabled: + return "Ring not enabled" + } + return strconv.Itoa(int(n)) +} + +// ReadPacketDataTo reads packet data into a user-supplied buffer. +// This function ignores snaplen and instead reads up to the length of the +// passed-in slice. +// The number of bytes read into data will be returned in ci.CaptureLength. +func (r *Ring) ReadPacketDataTo(data []byte) (ci gopacket.CaptureInfo, err error) { + // This tricky buf_ptr points to the start of our slice data, so pfring_recv + // will actually write directly into our Go slice. Nice! + r.mu.Lock() + r.buf_ptr = (*C.u_char)(unsafe.Pointer(&data[0])) + result := NextResult(C.pfring_recv(r.cptr, &r.buf_ptr, C.u_int(len(data)), &r.pkthdr, 1)) + if result != NextOk { + err = result + r.mu.Unlock() + return + } + ci.Timestamp = time.Unix(int64(r.pkthdr.ts.tv_sec), + int64(r.pkthdr.ts.tv_usec)*1000) // convert micros to nanos + ci.CaptureLength = int(r.pkthdr.caplen) + ci.Length = int(r.pkthdr.len) + r.mu.Unlock() + return +} + +// ReadPacketData returns the next packet read from the pcap handle, along with an error +// code associated with that packet. If the packet is read successfully, the +// returned error is nil. +func (r *Ring) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) { + data = make([]byte, r.snaplen) + ci, err = r.ReadPacketDataTo(data) + if err != nil { + data = nil + return + } + data = data[:ci.CaptureLength] + return +} + +type ClusterType C.cluster_type + +const ( + // ClusterPerFlow clusters by + ClusterPerFlow ClusterType = C.cluster_per_flow + // ClusterRoundRobin round-robins packets between applications, ignoring + // packet information. + ClusterRoundRobin ClusterType = C.cluster_round_robin + // ClusterPerFlow2Tuple clusters by + ClusterPerFlow2Tuple ClusterType = C.cluster_per_flow_2_tuple + // ClusterPerFlow4Tuple clusters by + ClusterPerFlow4Tuple ClusterType = C.cluster_per_flow_4_tuple + // ClusterPerFlow5Tuple clusters by + ClusterPerFlow5Tuple ClusterType = C.cluster_per_flow_5_tuple + // ClusterPerFlowTCP5Tuple acts like ClusterPerFlow5Tuple for TCP packets and + // like ClusterPerFlow2Tuple for all other packets. + ClusterPerFlowTCP5Tuple ClusterType = C.cluster_per_flow_tcp_5_tuple +) + +// SetCluster sets which cluster the ring should be part of, and the cluster +// type to use. +func (r *Ring) SetCluster(cluster int, typ ClusterType) error { + if rv := C.pfring_set_cluster(r.cptr, C.u_int(cluster), C.cluster_type(typ)); rv != 0 { + return fmt.Errorf("Unable to set cluster, got error code %d", rv) + } + return nil +} + +// RemoveFromCluster removes the ring from the cluster it was put in with +// SetCluster. +func (r *Ring) RemoveFromCluster() error { + if rv := C.pfring_remove_from_cluster(r.cptr); rv != 0 { + return fmt.Errorf("Unable to remove from cluster, got error code %d", rv) + } + return nil +} + +// SetSamplingRate sets the sampling rate to 1/. +func (r *Ring) SetSamplingRate(rate int) error { + if rv := C.pfring_set_sampling_rate(r.cptr, C.u_int32_t(rate)); rv != 0 { + return fmt.Errorf("Unable to set sampling rate, got error code %d", rv) + } + return nil +} + +// SetBPFFilter sets the BPF filter for the ring. +func (r *Ring) SetBPFFilter(bpf_filter string) error { + filter := C.CString(bpf_filter) + defer C.free(unsafe.Pointer(filter)) + if rv := C.pfring_set_bpf_filter(r.cptr, filter); rv != 0 { + return fmt.Errorf("Unable to set BPF filter, got error code %d", rv) + } + return nil +} + +// RemoveBPFFilter removes the BPF filter from the ring. +func (r *Ring) RemoveBPFFilter() error { + if rv := C.pfring_remove_bpf_filter(r.cptr); rv != 0 { + return fmt.Errorf("Unable to remove BPF filter, got error code %d", rv) + } + return nil +} + +// WritePacketData uses the ring to send raw packet data to the interface. +func (r *Ring) WritePacketData(data []byte) error { + buf := (*C.char)(unsafe.Pointer(&data[0])) + if rv := C.pfring_send(r.cptr, buf, C.u_int(len(data)), 1); rv != 0 { + return fmt.Errorf("Unable to send packet data, got error code %d", rv) + } + return nil +} + +// Enable enables the given ring. This function MUST be called on each new +// ring after it has been set up, or that ring will NOT receive packets. +func (r *Ring) Enable() error { + if rv := C.pfring_enable_ring(r.cptr); rv != 0 { + return fmt.Errorf("Unable to enable ring, got error code %d", rv) + } + return nil +} + +// Disable disables the given ring. After this call, it will no longer receive +// packets. +func (r *Ring) Disable() error { + if rv := C.pfring_disable_ring(r.cptr); rv != 0 { + return fmt.Errorf("Unable to disable ring, got error code %d", rv) + } + return nil +} + +type Stats struct { + Received, Dropped uint64 +} + +// Stats returns statistsics for the ring. +func (r *Ring) Stats() (s Stats, err error) { + var stats C.pfring_stat + if rv := C.pfring_stats(r.cptr, &stats); rv != 0 { + err = fmt.Errorf("Unable to get ring stats, got error code %d", rv) + return + } + s.Received = uint64(stats.recv) + s.Dropped = uint64(stats.drop) + return +} + +type Direction C.packet_direction + +const ( + // TransmitOnly will only capture packets transmitted by the ring's + // interface(s). + TransmitOnly Direction = C.tx_only_direction + // ReceiveOnly will only capture packets received by the ring's + // interface(s). + ReceiveOnly Direction = C.rx_only_direction + // ReceiveAndTransmit will capture both received and transmitted packets on + // the ring's interface(s). + ReceiveAndTransmit Direction = C.rx_and_tx_direction +) + +// SetDirection sets which packets should be captured by the ring. +func (r *Ring) SetDirection(d Direction) error { + if rv := C.pfring_set_direction(r.cptr, C.packet_direction(d)); rv != 0 { + return fmt.Errorf("Unable to set ring direction, got error code %d", rv) + } + return nil +} + +type SocketMode C.socket_mode + +const ( + // WriteOnly sets up the ring to only send packets (Inject), not read them. + WriteOnly SocketMode = C.send_only_mode + // ReadOnly sets up the ring to only receive packets (ReadPacketData), not + // send them. + ReadOnly SocketMode = C.recv_only_mode + // WriteAndRead sets up the ring to both send and receive packets. + WriteAndRead SocketMode = C.send_and_recv_mode +) + +// SetSocketMode sets the mode of the ring socket to send, receive, or both. +func (r *Ring) SetSocketMode(s SocketMode) error { + if rv := C.pfring_set_socket_mode(r.cptr, C.socket_mode(s)); rv != 0 { + return fmt.Errorf("Unable to set socket mode, got error code %d", rv) + } + return nil +} + +// SetApplicationName sets a string name to the ring. This name is available in +// /proc stats for pf_ring. By default, NewRing automatically calls this with +// argv[0]. +func (r *Ring) SetApplicationName(name string) error { + buf := C.CString(name) + defer C.free(unsafe.Pointer(buf)) + if rv := C.pfring_set_application_name(r.cptr, buf); rv != 0 { + return fmt.Errorf("Unable to set ring application name, got error code %d", rv) + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/routing/common.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/routing/common.go new file mode 100644 index 00000000..a6746d49 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/routing/common.go @@ -0,0 +1,36 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package routing + +import ( + "net" +) + +// Router implements simple IPv4/IPv6 routing based on the kernel's routing +// table. This routing library has very few features and may actually route +// incorrectly in some cases, but it should work the majority of the time. +type Router interface { + // Route returns where to route a packet based on the packet's source + // and destination IP address. + // + // Callers may pass in nil for src, in which case the src is treated as + // either 0.0.0.0 or ::, depending on whether dst is a v4 or v6 address. + // + // It returns the interface on which to send the packet, the gateway IP + // to send the packet to (if necessary), the preferred src IP to use (if + // available). If the preferred src address is not given in the routing + // table, the first IP address of the interface is provided. + // + // If an error is encountered, iface, geteway, and + // preferredSrc will be nil, and err will be set. + Route(dst net.IP) (iface *net.Interface, gateway, preferredSrc net.IP, err error) + + // RouteWithSrc routes based on source information as well as destination + // information. Either or both of input/src can be nil. If both are, this + // should behave exactly like Route(dst) + RouteWithSrc(input net.HardwareAddr, src, dst net.IP) (iface *net.Interface, gateway, preferredSrc net.IP, err error) +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/routing/other.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/routing/other.go new file mode 100644 index 00000000..b53fea94 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/routing/other.go @@ -0,0 +1,15 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// +build !linux + +// Package routing is currently only supported in Linux, but the build system requires a valid go file for all architectures. + +package routing + +func New() (Router, error) { + panic("router only implemented in linux") +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/routing/routing.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/routing/routing.go new file mode 100644 index 00000000..7271cb6b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/routing/routing.go @@ -0,0 +1,241 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// +build linux + +// Package routing provides a very basic but mostly functional implementation of +// a routing table for IPv4/IPv6 addresses. It uses a routing table pulled from +// the kernel via netlink to find the correct interface, gateway, and preferred +// source IP address for packets destined to a particular location. +// +// The routing package is meant to be used with applications that are sending +// raw packet data, which don't have the benefit of having the kernel route +// packets for them. +package routing + +import ( + "bytes" + "fmt" + "net" + "sort" + "strings" + "syscall" + "unsafe" +) + +// Pulled from http://man7.org/linux/man-pages/man7/rtnetlink.7.html +// See the section on RTM_NEWROUTE, specifically 'struct rtmsg'. +type routeInfoInMemory struct { + Family byte + DstLen byte + SrcLen byte + TOS byte + + Table byte + Protocol byte + Scope byte + Type byte + + Flags uint32 +} + +// rtInfo contains information on a single route. +type rtInfo struct { + Src, Dst *net.IPNet + Gateway, PrefSrc net.IP + // We currently ignore the InputIface. + InputIface, OutputIface uint32 + Priority uint32 +} + +// routeSlice implements sort.Interface to sort routes by Priority. +type routeSlice []*rtInfo + +func (r routeSlice) Len() int { + return len(r) +} +func (r routeSlice) Less(i, j int) bool { + return r[i].Priority < r[j].Priority +} +func (r routeSlice) Swap(i, j int) { + r[i], r[j] = r[j], r[i] +} + +type router struct { + ifaces []net.Interface + addrs []ipAddrs + v4, v6 routeSlice +} + +func (r *router) String() string { + strs := []string{"ROUTER", "--- V4 ---"} + for _, route := range r.v4 { + strs = append(strs, fmt.Sprintf("%+v", *route)) + } + strs = append(strs, "--- V6 ---") + for _, route := range r.v6 { + strs = append(strs, fmt.Sprintf("%+v", *route)) + } + return strings.Join(strs, "\n") +} + +type ipAddrs struct { + v4, v6 net.IP +} + +func (r *router) Route(dst net.IP) (iface *net.Interface, gateway, preferredSrc net.IP, err error) { + return r.RouteWithSrc(nil, nil, dst) +} + +func (r *router) RouteWithSrc(input net.HardwareAddr, src, dst net.IP) (iface *net.Interface, gateway, preferredSrc net.IP, err error) { + length := len(dst) + var ifaceIndex int + switch length { + case 4: + ifaceIndex, gateway, preferredSrc, err = r.route(r.v4, input, src, dst) + case 16: + ifaceIndex, gateway, preferredSrc, err = r.route(r.v6, input, src, dst) + default: + err = fmt.Errorf("IP length is not 4 or 16") + return + } + + // Interfaces are 1-indexed, but we store them in a 0-indexed array. + ifaceIndex-- + + iface = &r.ifaces[ifaceIndex] + if preferredSrc == nil { + switch length { + case 4: + preferredSrc = r.addrs[ifaceIndex].v4 + case 16: + preferredSrc = r.addrs[ifaceIndex].v6 + } + } + return +} + +func (r *router) route(routes routeSlice, input net.HardwareAddr, src, dst net.IP) (iface int, gateway, preferredSrc net.IP, err error) { + var inputIndex uint32 + if input != nil { + for i, iface := range r.ifaces { + if bytes.Equal(input, iface.HardwareAddr) { + // Convert from zero- to one-indexed. + inputIndex = uint32(i + 1) + break + } + } + } + for _, rt := range routes { + if rt.InputIface != 0 && rt.InputIface != inputIndex { + continue + } + if rt.Src != nil && !rt.Src.Contains(src) { + continue + } + if rt.Dst != nil && !rt.Dst.Contains(dst) { + continue + } + return int(rt.OutputIface), rt.Gateway, rt.PrefSrc, nil + } + err = fmt.Errorf("no route found for %v", dst) + return +} + +// New creates a new router object. The router returned by New currently does +// not update its routes after construction... care should be taken for +// long-running programs to call New() regularly to take into account any +// changes to the routing table which have occurred since the last New() call. +func New() (Router, error) { + rtr := &router{} + tab, err := syscall.NetlinkRIB(syscall.RTM_GETROUTE, syscall.AF_UNSPEC) + if err != nil { + return nil, err + } + msgs, err := syscall.ParseNetlinkMessage(tab) + if err != nil { + return nil, err + } +loop: + for _, m := range msgs { + switch m.Header.Type { + case syscall.NLMSG_DONE: + break loop + case syscall.RTM_NEWROUTE: + rt := (*routeInfoInMemory)(unsafe.Pointer(&m.Data[0])) + routeInfo := rtInfo{} + attrs, err := syscall.ParseNetlinkRouteAttr(&m) + if err != nil { + return nil, err + } + switch rt.Family { + case syscall.AF_INET: + rtr.v4 = append(rtr.v4, &routeInfo) + case syscall.AF_INET6: + rtr.v6 = append(rtr.v6, &routeInfo) + default: + continue loop + } + for _, attr := range attrs { + switch attr.Attr.Type { + case syscall.RTA_DST: + routeInfo.Dst = &net.IPNet{ + IP: net.IP(attr.Value), + Mask: net.CIDRMask(int(rt.DstLen), len(attr.Value)*8), + } + case syscall.RTA_SRC: + routeInfo.Src = &net.IPNet{ + IP: net.IP(attr.Value), + Mask: net.CIDRMask(int(rt.SrcLen), len(attr.Value)*8), + } + case syscall.RTA_GATEWAY: + routeInfo.Gateway = net.IP(attr.Value) + case syscall.RTA_PREFSRC: + routeInfo.PrefSrc = net.IP(attr.Value) + case syscall.RTA_IIF: + routeInfo.InputIface = *(*uint32)(unsafe.Pointer(&attr.Value[0])) + case syscall.RTA_OIF: + routeInfo.OutputIface = *(*uint32)(unsafe.Pointer(&attr.Value[0])) + case syscall.RTA_PRIORITY: + routeInfo.Priority = *(*uint32)(unsafe.Pointer(&attr.Value[0])) + } + } + } + } + sort.Sort(rtr.v4) + sort.Sort(rtr.v6) + if ifaces, err := net.Interfaces(); err != nil { + return nil, err + } else { + for i, iface := range ifaces { + if i != iface.Index-1 { + return nil, fmt.Errorf("out of order iface %d = %v", i, iface) + } + rtr.ifaces = append(rtr.ifaces, iface) + var addrs ipAddrs + if ifaceAddrs, err := iface.Addrs(); err != nil { + return nil, err + } else { + for _, addr := range ifaceAddrs { + if inet, ok := addr.(*net.IPNet); ok { + // Go has a nasty habit of giving you IPv4s as ::ffff:1.2.3.4 instead of 1.2.3.4. + // We want to use mapped v4 addresses as v4 preferred addresses, never as v6 + // preferred addresses. + if v4 := inet.IP.To4(); v4 != nil { + if addrs.v4 == nil { + addrs.v4 = v4 + } + } else if addrs.v6 == nil { + addrs.v6 = inet.IP + } + } + } + } + rtr.addrs = append(rtr.addrs, addrs) + } + } + return rtr, nil +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/tcpassembly/assembly.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/tcpassembly/assembly.go new file mode 100644 index 00000000..2d845d98 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/tcpassembly/assembly.go @@ -0,0 +1,771 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// Package tcpassembly provides TCP stream re-assembly. +// +// The tcpassembly package implements uni-directional TCP reassembly, for use in +// packet-sniffing applications. The caller reads packets off the wire, then +// presents them to an Assembler in the form of gopacket layers.TCP packets +// (github.com/tsg/gopacket, code.google.com/p/gopacket/layers). +// +// The Assembler uses a user-supplied +// StreamFactory to create a user-defined Stream interface, then passes packet +// data in stream order to that object. A concurrency-safe StreamPool keeps +// track of all current Streams being reassembled, so multiple Assemblers may +// run at once to assemble packets while taking advantage of multiple cores. +package tcpassembly + +import ( + "flag" + "fmt" + "github.com/tsg/gopacket" + "github.com/tsg/gopacket/layers" + "log" + "sync" + "time" +) + +var memLog = flag.Bool("assembly_memuse_log", false, "If true, the github.com/tsg/gopacket/tcpassembly library will log information regarding its memory use every once in a while.") +var debugLog = flag.Bool("assembly_debug_log", false, "If true, the github.com/tsg/gopacket/tcpassembly library will log verbose debugging information (at least one line per packet)") + +const invalidSequence = -1 +const uint32Max = 0xFFFFFFFF + +// Sequence is a TCP sequence number. It provides a few convenience functions +// for handling TCP wrap-around. The sequence should always be in the range +// [0,0xFFFFFFFF]... its other bits are simply used in wrap-around calculations +// and should never be set. +type Sequence int64 + +// Difference defines an ordering for comparing TCP sequences that's safe for +// roll-overs. It returns: +// > 0 : if t comes after s +// < 0 : if t comes before s +// 0 : if t == s +// The number returned is the sequence difference, so 4.Difference(8) will +// return 4. +// +// It handles rollovers by considering any sequence in the first quarter of the +// uint32 space to be after any sequence in the last quarter of that space, thus +// wrapping the uint32 space. +func (s Sequence) Difference(t Sequence) int { + if s > uint32Max-uint32Max/4 && t < uint32Max/4 { + t += uint32Max + } else if t > uint32Max-uint32Max/4 && s < uint32Max/4 { + s += uint32Max + } + return int(t - s) +} + +// Add adds an integer to a sequence and returns the resulting sequence. +func (s Sequence) Add(t int) Sequence { + return (s + Sequence(t)) & uint32Max +} + +// Reassembly objects are passed by an Assembler into Streams using the +// Reassembled call. Callers should not need to create these structs themselves +// except for testing. +type Reassembly struct { + // Bytes is the next set of bytes in the stream. May be empty. + Bytes []byte + // Skip is set to non-zero if bytes were skipped between this and the + // last Reassembly. If this is the first packet in a connection and we + // didn't see the start, we have no idea how many bytes we skipped, so + // we set it to -1. Otherwise, it's set to the number of bytes skipped. + Skip int + // Start is set if this set of bytes has a TCP SYN accompanying it. + Start bool + // End is set if this set of bytes has a TCP FIN or RST accompanying it. + End bool + // Seen is the timestamp this set of bytes was pulled off the wire. + Seen time.Time +} + +const pageBytes = 1900 + +// page is used to store TCP data we're not ready for yet (out-of-order +// packets). Unused pages are stored in and returned from a pageCache, which +// avoids memory allocation. Used pages are stored in a doubly-linked list in +// a connection. +type page struct { + Reassembly + seq Sequence + index int + prev, next *page + buf [pageBytes]byte +} + +// pageCache is a concurrency-unsafe store of page objects we use to avoid +// memory allocation as much as we can. It grows but never shrinks. +type pageCache struct { + free []*page + pcSize int + size, used int + pages [][]page + pageRequests int64 +} + +const initialAllocSize = 1024 + +func newPageCache() *pageCache { + pc := &pageCache{ + free: make([]*page, 0, initialAllocSize), + pcSize: initialAllocSize, + } + pc.grow() + return pc +} + +// grow exponentially increases the size of our page cache as much as necessary. +func (c *pageCache) grow() { + pages := make([]page, c.pcSize) + c.pages = append(c.pages, pages) + c.size += c.pcSize + for i, _ := range pages { + c.free = append(c.free, &pages[i]) + } + if *memLog { + log.Println("PageCache: created", c.pcSize, "new pages") + } + c.pcSize *= 2 +} + +// next returns a clean, ready-to-use page object. +func (c *pageCache) next(ts time.Time) (p *page) { + if *memLog { + c.pageRequests++ + if c.pageRequests&0xFFFF == 0 { + log.Println("PageCache:", c.pageRequests, "requested,", c.used, "used,", len(c.free), "free") + } + } + if len(c.free) == 0 { + c.grow() + } + i := len(c.free) - 1 + p, c.free = c.free[i], c.free[:i] + p.prev = nil + p.next = nil + p.Seen = ts + p.Bytes = p.buf[:0] + c.used++ + return p +} + +// replace replaces a page into the pageCache. +func (c *pageCache) replace(p *page) { + c.used-- + c.free = append(c.free, p) +} + +// Stream is implemented by the caller to handle incoming reassembled +// TCP data. Callers create a StreamFactory, then StreamPool uses +// it to create a new Stream for every TCP stream. +// +// assembly will, in order: +// 1) Create the stream via StreamFactory.New +// 2) Call Reassembled 0 or more times, passing in reassembled TCP data in order +// 3) Call ReassemblyComplete one time, after which the stream is dereferenced by assembly. +type Stream interface { + // Reassembled is called zero or more times. assembly guarantees + // that the set of all Reassembly objects passed in during all + // calls are presented in the order they appear in the TCP stream. + // Reassembly objects are reused after each Reassembled call, + // so it's important to copy anything you need out of them + // (specifically out of Reassembly.Bytes) that you need to stay + // around after you return from the Reassembled call. + Reassembled([]Reassembly) + // ReassemblyComplete is called when assembly decides there is + // no more data for this Stream, either because a FIN or RST packet + // was seen, or because the stream has timed out without any new + // packet data (due to a call to FlushOlderThan). + ReassemblyComplete() +} + +// StreamFactory is used by assembly to create a new stream for each +// new TCP session. +type StreamFactory interface { + // New should return a new stream for the given TCP key. + New(netFlow, tcpFlow gopacket.Flow) Stream +} + +func (p *StreamPool) connections() []*connection { + p.mu.RLock() + conns := make([]*connection, 0, len(p.conns)) + for _, conn := range p.conns { + conns = append(conns, conn) + } + p.mu.RUnlock() + return conns +} + +// FlushOlderThan finds any streams waiting for packets older than +// the given time, and pushes through the data they have (IE: tells +// them to stop waiting and skip the data they're waiting for). +// +// Each Stream maintains a list of zero or more sets of bytes it has received +// out-of-order. For example, if it has processed up through sequence number +// 10, it might have bytes [15-20), [20-25), [30,50) in its list. Each set of +// bytes also has the timestamp it was originally viewed. A flush call will +// look at the smallest subsequent set of bytes, in this case [15-20), and if +// its timestamp is older than the passed-in time, it will push it and all +// contiguous byte-sets out to the Stream's Reassembled function. In this case, +// it will push [15-20), but also [20-25), since that's contiguous. It will +// only push [30-50) if its timestamp is also older than the passed-in time, +// otherwise it will wait until the next FlushOlderThan to see if bytes [25-30) +// come in. +// +// If it pushes all bytes (or there were no sets of bytes to begin with) +// AND the connection has not received any bytes since the passed-in time, +// the connection will be closed. +// +// Returns the number of connections flushed, and of those, the number closed +// because of the flush. +func (a *Assembler) FlushOlderThan(t time.Time) (flushed, closed int) { + conns := a.connPool.connections() + closes := 0 + flushes := 0 + for _, conn := range conns { + flushed := false + conn.mu.Lock() + if conn.closed { + // Already closed connection, nothing to do here. + conn.mu.Unlock() + continue + } + for conn.first != nil && conn.first.Seen.Before(t) { + a.skipFlush(conn) + flushed = true + if conn.closed { + closes++ + break + } + } + if !conn.closed && conn.first == nil && conn.lastSeen.Before(t) { + flushed = true + a.closeConnection(conn) + closes++ + } + if flushed { + flushes++ + } + conn.mu.Unlock() + } + return flushes, closes +} + +// FlushAll flushes all remaining data into all remaining connections, closing +// those connections. It returns the total number of connections flushed/closed +// by the call. +func (a *Assembler) FlushAll() (closed int) { + conns := a.connPool.connections() + closed = len(conns) + for _, conn := range conns { + conn.mu.Lock() + for !conn.closed { + a.skipFlush(conn) + } + conn.mu.Unlock() + } + return +} + +type key [2]gopacket.Flow + +func (k *key) String() string { + return fmt.Sprintf("%s:%s", k[0], k[1]) +} + +// StreamPool stores all streams created by Assemblers, allowing multiple +// assemblers to work together on stream processing while enforcing the fact +// that a single stream receives its data serially. It is safe +// for concurrency, usable by multiple Assemblers at once. +// +// StreamPool handles the creation and storage of Stream objects used by one or +// more Assembler objects. When a new TCP stream is found by an Assembler, it +// creates an associated Stream by calling its StreamFactory's New method. +// Thereafter (until the stream is closed), that Stream object will receive +// assembled TCP data via Assembler's calls to the stream's Reassembled +// function. +// +// Like the Assembler, StreamPool attempts to minimize allocation. Unlike the +// Assembler, though, it does have to do some locking to make sure that the +// connection objects it stores are accessible to multiple Assemblers. +type StreamPool struct { + conns map[key]*connection + users int + mu sync.RWMutex + factory StreamFactory + free []*connection + all [][]connection + nextAlloc int + newConnectionCount int64 +} + +func (p *StreamPool) grow() { + conns := make([]connection, p.nextAlloc) + p.all = append(p.all, conns) + for i, _ := range conns { + p.free = append(p.free, &conns[i]) + } + if *memLog { + log.Println("StreamPool: created", p.nextAlloc, "new connections") + } + p.nextAlloc *= 2 +} + +// NewStreamPool creates a new connection pool. Streams will +// be created as necessary using the passed-in StreamFactory. +func NewStreamPool(factory StreamFactory) *StreamPool { + return &StreamPool{ + conns: make(map[key]*connection, initialAllocSize), + free: make([]*connection, 0, initialAllocSize), + factory: factory, + nextAlloc: initialAllocSize, + } +} + +const assemblerReturnValueInitialSize = 16 + +// NewAssembler creates a new assembler. Pass in the StreamPool +// to use, may be shared across assemblers. +// +// This sets some sane defaults for the assembler options, +// see DefaultAssemblerOptions for details. +func NewAssembler(pool *StreamPool) *Assembler { + pool.mu.Lock() + pool.users++ + pool.mu.Unlock() + return &Assembler{ + ret: make([]Reassembly, assemblerReturnValueInitialSize), + pc: newPageCache(), + connPool: pool, + AssemblerOptions: DefaultAssemblerOptions, + } +} + +// DefaultAssemblerOptions provides default options for an assembler. +// These options are used by default when calling NewAssembler, so if +// modified before a NewAssembler call they'll affect the resulting Assembler. +// +// Note that the default options can result in ever-increasing memory usage +// unless one of the Flush* methods is called on a regular basis. +var DefaultAssemblerOptions = AssemblerOptions{ + MaxBufferedPagesPerConnection: 0, // unlimited + MaxBufferedPagesTotal: 0, // unlimited +} + +type connection struct { + key key + pages int + first, last *page + nextSeq Sequence + created, lastSeen time.Time + stream Stream + closed bool + mu sync.Mutex +} + +func (c *connection) reset(k key, s Stream, ts time.Time) { + c.key = k + c.pages = 0 + c.first, c.last = nil, nil + c.nextSeq = invalidSequence + c.created = ts + c.stream = s + c.closed = false +} + +// AssemblerOptions controls the behavior of each assembler. Modify the +// options of each assembler you create to change their behavior. +type AssemblerOptions struct { + // MaxBufferedPagesTotal is an upper limit on the total number of pages to + // buffer while waiting for out-of-order packets. Once this limit is + // reached, the assembler will degrade to flushing every connection it + // gets a packet for. If <= 0, this is ignored. + MaxBufferedPagesTotal int + // MaxBufferedPagesPerConnection is an upper limit on the number of pages + // buffered for a single connection. Should this limit be reached for a + // particular connection, the smallest sequence number will be flushed, along + // with any contiguous data. If <= 0, this is ignored. + MaxBufferedPagesPerConnection int +} + +// Assembler handles reassembling TCP streams. It is not safe for +// concurrency... after passing a packet in via the Assemble call, the caller +// must wait for that call to return before calling Assemble again. Callers can +// get around this by creating multiple assemblers that share a StreamPool. In +// that case, each individual stream will still be handled serially (each stream +// has an individual mutex associated with it), however multiple assemblers can +// assemble different connections concurrently. +// +// The Assembler provides (hopefully) fast TCP stream re-assembly for sniffing +// applications written in Go. The Assembler uses the following methods to be +// as fast as possible, to keep packet processing speedy: +// +// Avoids Lock Contention +// +// Assemblers locks connections, but each connection has an individual lock, and +// rarely will two Assemblers be looking at the same connection. Assemblers +// lock the StreamPool when looking up connections, but they use Reader +// locks initially, and only force a write lock if they need to create a new +// connection or close one down. These happen much less frequently than +// individual packet handling. +// +// Each assembler runs in its own goroutine, and the only state shared between +// goroutines is through the StreamPool. Thus all internal Assembler state +// can be handled without any locking. +// +// NOTE: If you can guarantee that packets going to a set of Assemblers will +// contain information on different connections per Assembler (for example, +// they're already hashed by PF_RING hashing or some other hashing mechanism), +// then we recommend you use a seperate StreamPool per Assembler, thus +// avoiding all lock contention. Only when different Assemblers could receive +// packets for the same Stream should a StreamPool be shared between them. +// +// Avoids Memory Copying +// +// In the common case, handling of a single TCP packet should result in zero +// memory allocations. The Assembler will look up the connection, figure out +// that the packet has arrived in order, and immediately pass that packet on to +// the appropriate connection's handling code. Only if a packet arrives out of +// order is its contents copied and stored in memory for later. +// +// Avoids Memory Allocation +// +// Assemblers try very hard to not use memory allocation unless absolutely +// necessary. Packet data for sequential packets is passed directly to streams +// with no copying or allocation. Packet data for out-of-order packets is +// copied into reusable pages, and new pages are only allocated rarely when the +// page cache runs out. Page caches are Assembler-specific, thus not used +// concurrently and requiring no locking. +// +// Internal representations for connection objects are also reused over time. +// Because of this, the most common memory allocation done by the Assembler is +// generally what's done by the caller in StreamFactory.New. If no allocation +// is done there, then very little allocation is done ever, mostly to handle +// large increases in bandwidth or numbers of connections. +// +// TODO: The page caches used by an Assembler will grow to the size necessary +// to handle a workload, and currently will never shrink. This means that +// traffic spikes can result in large memory usage which isn't garbage +// collected when typical traffic levels return. +type Assembler struct { + AssemblerOptions + ret []Reassembly + pc *pageCache + connPool *StreamPool +} + +func (p *StreamPool) newConnection(k key, s Stream, ts time.Time) (c *connection) { + if *memLog { + p.newConnectionCount++ + if p.newConnectionCount&0x7FFF == 0 { + log.Println("StreamPool:", p.newConnectionCount, "requests,", len(p.conns), "used,", len(p.free), "free") + } + } + if len(p.free) == 0 { + p.grow() + } + index := len(p.free) - 1 + c, p.free = p.free[index], p.free[:index] + c.reset(k, s, ts) + return c +} + +// getConnection returns a connection. If end is true and a connection +// does not already exist, returns nil. This allows us to check for a +// connection without actually creating one if it doesn't already exist. +func (p *StreamPool) getConnection(k key, end bool, ts time.Time) *connection { + p.mu.RLock() + conn := p.conns[k] + p.mu.RUnlock() + if end || conn != nil { + return conn + } + s := p.factory.New(k[0], k[1]) + p.mu.Lock() + conn = p.newConnection(k, s, ts) + if conn2 := p.conns[k]; conn2 != nil { + p.mu.Unlock() + return conn2 + } + p.conns[k] = conn + p.mu.Unlock() + return conn +} + +// Assemble calls AssembleWithTimestamp with the current timestamp, useful for +// packets being read directly off the wire. +func (a *Assembler) Assemble(netFlow gopacket.Flow, t *layers.TCP) { + a.AssembleWithTimestamp(netFlow, t, time.Now()) +} + +// AssembleWithTimestamp reassembles the given TCP packet into its appropriate +// stream. +// +// The timestamp passed in must be the timestamp the packet was seen. +// For packets read off the wire, time.Now() should be fine. For packets read +// from PCAP files, CaptureInfo.Timestamp should be passed in. This timestamp +// will affect which streams are flushed by a call to FlushOlderThan. +// +// Each Assemble call results in, in order: +// +// zero or one calls to StreamFactory.New, creating a stream +// zero or one calls to Reassembled on a single stream +// zero or one calls to ReassemblyComplete on the same stream +func (a *Assembler) AssembleWithTimestamp(netFlow gopacket.Flow, t *layers.TCP, timestamp time.Time) { + // Ignore empty TCP packets + if !t.SYN && !t.FIN && !t.RST && len(t.LayerPayload()) == 0 { + if *debugLog { + log.Println("ignoring useless packet") + } + return + } + + a.ret = a.ret[:0] + key := key{netFlow, t.TransportFlow()} + var conn *connection + // This for loop handles a race condition where a connection will close, lock + // the connection pool, and remove itself, but before it locked the connection + // pool it's returned to another Assemble statement. This should loop 0-1 + // times for the VAST majority of cases. + for { + conn = a.connPool.getConnection( + key, !t.SYN && len(t.LayerPayload()) == 0, timestamp) + if conn == nil { + if *debugLog { + log.Printf("%v got empty packet on otherwise empty connection", key) + } + return + } + conn.mu.Lock() + if !conn.closed { + break + } + conn.mu.Unlock() + } + if conn.lastSeen.Before(timestamp) { + conn.lastSeen = timestamp + } + seq, bytes := Sequence(t.Seq), t.Payload + if conn.nextSeq == invalidSequence { + if t.SYN { + if *debugLog { + log.Printf("%v saw first SYN packet, returning immediately, seq=%v", key, seq) + } + a.ret = append(a.ret, Reassembly{ + Bytes: bytes, + Skip: 0, + Start: true, + Seen: timestamp, + }) + conn.nextSeq = seq.Add(len(bytes) + 1) + } else { + if *debugLog { + log.Printf("%v waiting for start, storing into connection", key) + } + a.insertIntoConn(t, conn, timestamp) + } + } else if diff := conn.nextSeq.Difference(seq); diff > 0 { + if *debugLog { + log.Printf("%v gap in sequence numbers (%v, %v) diff %v, storing into connection", key, conn.nextSeq, seq, diff) + } + a.insertIntoConn(t, conn, timestamp) + } else { + bytes, conn.nextSeq = byteSpan(conn.nextSeq, seq, bytes) + if *debugLog { + log.Printf("%v found contiguous data (%v, %v), returning immediately", key, seq, conn.nextSeq) + } + a.ret = append(a.ret, Reassembly{ + Bytes: bytes, + Skip: 0, + End: t.RST || t.FIN, + Seen: timestamp, + }) + } + if len(a.ret) > 0 { + a.sendToConnection(conn) + } + conn.mu.Unlock() +} + +func byteSpan(expected, received Sequence, bytes []byte) (toSend []byte, next Sequence) { + if expected == invalidSequence { + return bytes, received.Add(len(bytes)) + } + span := int(received.Difference(expected)) + if span <= 0 { + return bytes, received.Add(len(bytes)) + } else if len(bytes) < span { + return nil, expected + } + return bytes[span:], expected.Add(len(bytes) - span) +} + +// sendToConnection sends the current values in a.ret to the connection, closing +// the connection if the last thing sent had End set. +func (a *Assembler) sendToConnection(conn *connection) { + a.addContiguous(conn) + if conn.stream == nil { + panic("why?") + } + conn.stream.Reassembled(a.ret) + if a.ret[len(a.ret)-1].End { + a.closeConnection(conn) + } +} + +// addContiguous adds contiguous byte-sets to a connection. +func (a *Assembler) addContiguous(conn *connection) { + for conn.first != nil && conn.nextSeq.Difference(conn.first.seq) <= 0 { + a.addNextFromConn(conn) + } +} + +// skipFlush skips the first set of bytes we're waiting for and returns the +// first set of bytes we have. If we have no bytes pending, it closes the +// connection. +func (a *Assembler) skipFlush(conn *connection) { + if *debugLog { + log.Printf("%v skipFlush %v", conn.key, conn.nextSeq) + } + if conn.first == nil { + a.closeConnection(conn) + return + } + a.ret = a.ret[:0] + a.addNextFromConn(conn) + a.addContiguous(conn) + a.sendToConnection(conn) +} + +func (p *StreamPool) remove(conn *connection) { + p.mu.Lock() + delete(p.conns, conn.key) + p.free = append(p.free, conn) + p.mu.Unlock() +} + +func (a *Assembler) closeConnection(conn *connection) { + if *debugLog { + log.Printf("%v closing", conn.key) + } + conn.stream.ReassemblyComplete() + conn.closed = true + a.connPool.remove(conn) + for p := conn.first; p != nil; p = p.next { + a.pc.replace(p) + } +} + +// traverseConn traverses our doubly-linked list of pages for the correct +// position to put the given sequence number. Note that it traverses backwards, +// starting at the highest sequence number and going down, since we assume the +// common case is that TCP packets for a stream will appear in-order, with +// minimal loss or packet reordering. +func (conn *connection) traverseConn(seq Sequence) (prev, current *page) { + prev = conn.last + for prev != nil && prev.seq.Difference(seq) < 0 { + current = prev + prev = current.prev + } + return +} + +// pushBetween inserts the doubly-linked list first-...-last in between the +// nodes prev-next in another doubly-linked list. If prev is nil, makes first +// the new first page in the connection's list. If next is nil, makes last the +// new last page in the list. first/last may point to the same page. +func (conn *connection) pushBetween(prev, next, first, last *page) { + // Maintain our doubly linked list + if next == nil || conn.last == nil { + conn.last = last + } else { + last.next = next + next.prev = last + } + if prev == nil || conn.first == nil { + conn.first = first + } else { + first.prev = prev + prev.next = first + } +} + +func (a *Assembler) insertIntoConn(t *layers.TCP, conn *connection, ts time.Time) { + if conn.first != nil && conn.first.seq == conn.nextSeq { + panic("wtf") + } + p, p2 := a.pagesFromTcp(t, ts) + prev, current := conn.traverseConn(Sequence(t.Seq)) + conn.pushBetween(prev, current, p, p2) + conn.pages++ + if (a.MaxBufferedPagesPerConnection > 0 && conn.pages >= a.MaxBufferedPagesPerConnection) || + (a.MaxBufferedPagesTotal > 0 && a.pc.used >= a.MaxBufferedPagesTotal) { + if *debugLog { + log.Printf("%v hit max buffer size: %+v, %v, %v", conn.key, a.AssemblerOptions, conn.pages, a.pc.used) + } + a.addNextFromConn(conn) + } +} + +// pagesFromTcp creates a page (or set of pages) from a TCP packet. Note that +// it should NEVER receive a SYN packet, as it doesn't handle sequences +// correctly. +// +// It returns the first and last page in its doubly-linked list of new pages. +func (a *Assembler) pagesFromTcp(t *layers.TCP, ts time.Time) (p, p2 *page) { + first := a.pc.next(ts) + current := first + seq, bytes := Sequence(t.Seq), t.Payload + for { + length := min(len(bytes), pageBytes) + current.Bytes = current.buf[:length] + copy(current.Bytes, bytes) + current.seq = seq + bytes = bytes[length:] + if len(bytes) == 0 { + break + } + seq = seq.Add(length) + current.next = a.pc.next(ts) + current.next.prev = current + current = current.next + } + current.End = t.RST || t.FIN + return first, current +} + +// addNextFromConn pops the first page from a connection off and adds it to the +// return array. +func (a *Assembler) addNextFromConn(conn *connection) { + if conn.nextSeq == invalidSequence { + conn.first.Skip = -1 + } else if diff := conn.nextSeq.Difference(conn.first.seq); diff > 0 { + conn.first.Skip = int(diff) + } + conn.first.Bytes, conn.nextSeq = byteSpan(conn.nextSeq, conn.first.seq, conn.first.Bytes) + if *debugLog { + log.Printf("%v adding from conn (%v, %v)", conn.key, conn.first.seq, conn.nextSeq) + } + a.ret = append(a.ret, conn.first.Reassembly) + a.pc.replace(conn.first) + if conn.first == conn.last { + conn.first = nil + conn.last = nil + } else { + conn.first = conn.first.next + conn.first.prev = nil + } + conn.pages-- +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/tcpassembly/tcpreader/reader.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/tcpassembly/tcpreader/reader.go new file mode 100644 index 00000000..b7114f55 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/tcpassembly/tcpreader/reader.go @@ -0,0 +1,209 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +// Package tcpreader provides an implementation for tcpassembly.Stream which presents +// the caller with an io.Reader for easy processing. +// +// The assembly package handles packet data reordering, but its output is +// library-specific, thus not usable by the majority of external Go libraries. +// The io.Reader interface, on the other hand, is used throughout much of Go +// code as an easy mechanism for reading in data streams and decoding them. For +// example, the net/http package provides the ReadRequest function, which can +// parase an HTTP request from a live data stream, just what we'd want when +// sniffing HTTP traffic. Using ReaderStream, this is relatively easy to set +// up: +// +// // Create our StreamFactory +// type httpStreamFactory struct {} +// func (f *httpStreamFactory) New(a, b gopacket.Flow) { +// r := tcpreader.NewReaderStream(false) +// go printRequests(r) +// return &r +// } +// func printRequests(r io.Reader) { +// // Convert to bufio, since that's what ReadRequest wants. +// buf := bufio.NewReader(r) +// for { +// if req, err := http.ReadRequest(buf); err == io.EOF { +// return +// } else if err != nil { +// log.Println("Error parsing HTTP requests:", err) +// } else { +// fmt.Println("HTTP REQUEST:", req) +// fmt.Println("Body contains", tcpreader.DiscardBytesToEOF(req.Body), "bytes") +// } +// } +// } +// +// Using just this code, we're able to reference a powerful, built-in library +// for HTTP request parsing to do all the dirty-work of parsing requests from +// the wire in real-time. Pass this stream factory to an tcpassembly.StreamPool, +// start up an tcpassembly.Assembler, and you're good to go! +package tcpreader + +import ( + "errors" + "github.com/tsg/gopacket/tcpassembly" + "io" +) + +var discardBuffer = make([]byte, 4096) + +// DiscardBytesToFirstError will read in all bytes up to the first error +// reported by the given reader, then return the number of bytes discarded +// and the error encountered. +func DiscardBytesToFirstError(r io.Reader) (discarded int, err error) { + for { + n, e := r.Read(discardBuffer) + discarded += n + if e != nil { + return discarded, e + } + } +} + +// DiscardBytesToEOF will read in all bytes from a Reader until it +// encounters an io.EOF, then return the number of bytes. Be careful +// of this... if used on a Reader that returns a non-io.EOF error +// consistently, this will loop forever discarding that error while +// it waits for an EOF. +func DiscardBytesToEOF(r io.Reader) (discarded int) { + for { + n, e := DiscardBytesToFirstError(r) + discarded += n + if e == io.EOF { + return + } + } +} + +// ReaderStream implements both tcpassembly.Stream and io.Reader. You can use it +// as a building block to make simple, easy stream handlers. +// +// IMPORTANT: If you use a ReaderStream, you MUST read ALL BYTES from it, +// quickly. Not reading available bytes will block TCP stream reassembly. It's +// a common pattern to do this by starting a goroutine in the factory's New +// method: +// +// type myStreamHandler struct { +// r ReaderStream +// } +// func (m *myStreamHandler) run() { +// // Do something here that reads all of the ReaderStream, or your assembly +// // will block. +// fmt.Println(tcpreader.DiscardBytesToEOF(&m.r)) +// } +// func (f *myStreamFactory) New(a, b gopacket.Flow) tcpassembly.Stream { +// s := &myStreamHandler{} +// go s.run() +// // Return the ReaderStream as the stream that assembly should populate. +// return &s.r +// } +type ReaderStream struct { + ReaderStreamOptions + reassembled chan []tcpassembly.Reassembly + done chan bool + current []tcpassembly.Reassembly + closed bool + lossReported bool + first bool + initiated bool +} + +type ReaderStreamOptions struct { + // LossErrors determines whether this stream will return + // ReaderStreamDataLoss errors from its Read function whenever it + // determines data has been lost. + LossErrors bool +} + +// NewReaderStream returns a new ReaderStream object. +func NewReaderStream() ReaderStream { + r := ReaderStream{ + reassembled: make(chan []tcpassembly.Reassembly), + done: make(chan bool), + first: true, + initiated: true, + } + return r +} + +// Reassembled implements tcpassembly.Stream's Reassembled function. +func (r *ReaderStream) Reassembled(reassembly []tcpassembly.Reassembly) { + if !r.initiated { + panic("ReaderStream not created via NewReaderStream") + } + r.reassembled <- reassembly + <-r.done +} + +// ReassemblyComplete implements tcpassembly.Stream's ReassemblyComplete function. +func (r *ReaderStream) ReassemblyComplete() { + close(r.reassembled) + close(r.done) +} + +// stripEmpty strips empty reassembly slices off the front of its current set of +// slices. +func (r *ReaderStream) stripEmpty() { + for len(r.current) > 0 && len(r.current[0].Bytes) == 0 { + r.current = r.current[1:] + r.lossReported = false + } +} + +// DataLost is returned by the ReaderStream's Read function when it encounters +// a Reassembly with Skip != 0. +var DataLost error = errors.New("lost data") + +// Read implements io.Reader's Read function. +// Given a byte slice, it will either copy a non-zero number of bytes into +// that slice and return the number of bytes and a nil error, or it will +// leave slice p as is and return 0, io.EOF. +func (r *ReaderStream) Read(p []byte) (int, error) { + if !r.initiated { + panic("ReaderStream not created via NewReaderStream") + } + var ok bool + r.stripEmpty() + for !r.closed && len(r.current) == 0 { + if r.first { + r.first = false + } else { + r.done <- true + } + if r.current, ok = <-r.reassembled; ok { + r.stripEmpty() + } else { + r.closed = true + } + } + if len(r.current) > 0 { + current := &r.current[0] + if r.LossErrors && !r.lossReported && current.Skip != 0 { + r.lossReported = true + return 0, DataLost + } + length := copy(p, current.Bytes) + current.Bytes = current.Bytes[length:] + return length, nil + } + return 0, io.EOF +} + +// Close implements io.Closer's Close function, making ReaderStream a +// io.ReadCloser. It discards all remaining bytes in the reassembly in a +// manner that's safe for the assembler (IE: it doesn't block). +func (r *ReaderStream) Close() error { + r.current = nil + r.closed = true + for { + if _, ok := <-r.reassembled; !ok { + return nil + } + r.done <- true + } +} diff --git a/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/writer.go b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/writer.go new file mode 100644 index 00000000..dff8bf2d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/github.com/tsg/gopacket/writer.go @@ -0,0 +1,196 @@ +// Copyright 2012 Google, Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file in the root of the source +// tree. + +package gopacket + +import () + +// SerializableLayer allows its implementations to be written out as a set of bytes, +// so those bytes may be sent on the wire or otherwise used by the caller. +// SerializableLayer is implemented by certain Layer types, and can be encoded to +// bytes using the LayerWriter object. +type SerializableLayer interface { + // SerializeTo writes this layer to a slice, growing that slice if necessary + // to make it fit the layer's data. + // Args: + // b: SerializeBuffer to write this layer on to. When called, b.Bytes() + // is the payload this layer should wrap, if any. Note that this + // layer can either prepend itself (common), append itself + // (uncommon), or both (sometimes padding or footers are required at + // the end of packet data). It's also possible (though probably very + // rarely needed) to overwrite any bytes in the current payload. + // After this call, b.Bytes() should return the byte encoding of + // this layer wrapping the original b.Bytes() payload. + // opts: options to use while writing out data. + // Returns: + // error if a problem was encountered during encoding. If an error is + // returned, the bytes in data should be considered invalidated, and + // not used. + // + // SerializeTo calls SHOULD entirely ignore LayerContents and + // LayerPayload. It just serializes based on struct fields, neither + // modifying nor using contents/payload. + SerializeTo(b SerializeBuffer, opts SerializeOptions) error +} + +// SerializeOptions provides options for behaviors that SerializableLayers may want to +// implement. +type SerializeOptions struct { + // FixLengths determines whether, during serialization, layers should fix + // the values for any length field that depends on the payload. + FixLengths bool + // ComputeChecksums determines whether, during serialization, layers + // should recompute checksums based on their payloads. + ComputeChecksums bool +} + +// SerializeBuffer is a helper used by gopacket for writing out packet layers. +// SerializeBuffer starts off as an empty []byte. Subsequent calls to PrependBytes +// return byte slices before the current Bytes(), AppendBytes returns byte +// slices after. +// +// Byte slices returned by PrependBytes/AppendBytes are NOT zero'd out, so if +// you want to make sure they're all zeros, set them as such. +// +// SerializeBuffer is specifically designed to handle packet writing, where unlike +// with normal writes it's easier to start writing at the inner-most layer and +// work out, meaning that we often need to prepend bytes. This runs counter to +// typical writes to byte slices using append(), where we only write at the end +// of the buffer. +// +// It can be reused via Clear. Note, however, that a Clear call will invalidate the +// byte slices returned by any previous Bytes() call (the same buffer is +// reused). +// +// 1) Reusing a write buffer is generally much faster than creating a new one, +// and with the default implementation it avoids additional memory allocations. +// 2) If a byte slice from a previous Bytes() call will continue to be used, +// it's better to create a new SerializeBuffer. +// +// The Clear method is specifically designed to minimize memory allocations for +// similar later workloads on the SerializeBuffer. IE: if you make a set of +// Prepend/Append calls, then clear, then make the same calls with the same +// sizes, the second round (and all future similar rounds) shouldn't allocate +// any new memory. +type SerializeBuffer interface { + // Bytes returns the contiguous set of bytes collected so far by Prepend/Append + // calls. The slice returned by Bytes will be modified by future Clear calls, + // so if you're planning on clearing this SerializeBuffer, you may want to copy + // Bytes somewhere safe first. + Bytes() []byte + // PrependBytes returns a set of bytes which prepends the current bytes in this + // buffer. These bytes start in an indeterminate state, so they should be + // overwritten by the caller. The caller must only call PrependBytes if they + // know they're going to immediately overwrite all bytes returned. + PrependBytes(num int) ([]byte, error) + // AppendBytes returns a set of bytes which prepends the current bytes in this + // buffer. These bytes start in an indeterminate state, so they should be + // overwritten by the caller. The caller must only call AppendBytes if they + // know they're going to immediately overwrite all bytes returned. + AppendBytes(num int) ([]byte, error) + // Clear resets the SerializeBuffer to a new, empty buffer. After a call to clear, + // the byte slice returned by any previous call to Bytes() for this buffer + // should be considered invalidated. + Clear() error +} + +type serializeBuffer struct { + data []byte + start int + prepended, appended int +} + +// NewSerializeBuffer creates a new instance of the default implementation of +// the SerializeBuffer interface. +func NewSerializeBuffer() SerializeBuffer { + return &serializeBuffer{} +} + +// NewSerializeBufferExpectedSize creates a new buffer for serialization, optimized for an +// expected number of bytes prepended/appended. This tends to decrease the +// number of memory allocations made by the buffer during writes. +func NewSerializeBufferExpectedSize(expectedPrependLength, expectedAppendLength int) SerializeBuffer { + return &serializeBuffer{ + data: make([]byte, expectedPrependLength, expectedPrependLength+expectedAppendLength), + start: expectedPrependLength, + prepended: expectedPrependLength, + appended: expectedAppendLength, + } +} + +func (w *serializeBuffer) Bytes() []byte { + return w.data[w.start:] +} + +func (w *serializeBuffer) PrependBytes(num int) ([]byte, error) { + if num < 0 { + panic("num < 0") + } + if w.start < num { + toPrepend := w.prepended + if toPrepend < num { + toPrepend = num + } + w.prepended += toPrepend + length := cap(w.data) + toPrepend + newData := make([]byte, length) + newStart := w.start + toPrepend + copy(newData[newStart:], w.data[w.start:]) + w.start = newStart + w.data = newData[:toPrepend+len(w.data)] + } + w.start -= num + return w.data[w.start : w.start+num], nil +} + +func (w *serializeBuffer) AppendBytes(num int) ([]byte, error) { + if num < 0 { + panic("num < 0") + } + initialLength := len(w.data) + if cap(w.data)-initialLength < num { + toAppend := w.appended + if toAppend < num { + toAppend = num + } + w.appended += toAppend + newData := make([]byte, cap(w.data)+toAppend) + copy(newData[w.start:], w.data[w.start:]) + w.data = newData[:initialLength] + } + // Grow the buffer. We know it'll be under capacity given above. + w.data = w.data[:initialLength+num] + return w.data[initialLength:], nil +} + +func (w *serializeBuffer) Clear() error { + w.start = w.prepended + w.data = w.data[:w.start] + return nil +} + +// SerializeLayers clears the given write buffer, then writes all layers into it so +// they correctly wrap each other. Note that by clearing the buffer, it +// invalidates all slices previously returned by w.Bytes() +// +// Example: +// buf := gopacket.NewSerializeBuffer() +// opts := gopacket.SerializeOptions{} +// gopacket.SerializeLayers(buf, opts, a, b, c) +// firstPayload := buf.Bytes() // contains byte representation of a(b(c)) +// gopacket.SerializeLayers(buf, opts, d, e, f) +// secondPayload := buf.Bytes() // contains byte representation of d(e(f)). firstPayload is now invalidated, since the SerializeLayers call Clears buf. +func SerializeLayers(w SerializeBuffer, opts SerializeOptions, layers ...SerializableLayer) error { + w.Clear() + for i := len(layers) - 1; i >= 0; i-- { + layer := layers[i] + err := layer.SerializeTo(w, opts) + if err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/AUTHORS b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/AUTHORS new file mode 100644 index 00000000..15167cd7 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/CONTRIBUTING.md b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/CONTRIBUTING.md new file mode 100644 index 00000000..88dff59b --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing to Go + +Go is an open source project. + +It is the work of hundreds of contributors. We appreciate your help! + + +## Filing issues + +When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: + +1. What version of Go are you using (`go version`)? +2. What operating system and processor architecture are you using? +3. What did you do? +4. What did you expect to see? +5. What did you see instead? + +General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. +The gophers there will answer or ask you to file an issue if you've tripped over a bug. + +## Contributing code + +Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) +before sending patches. + +**We do not accept GitHub pull requests** +(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). + +Unless otherwise noted, the Go source files are distributed under +the BSD-style license found in the LICENSE file. + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/CONTRIBUTORS b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/CONTRIBUTORS new file mode 100644 index 00000000..1c4577e9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/LICENSE b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/LICENSE new file mode 100644 index 00000000..6a66aea5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/PATENTS b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/PATENTS new file mode 100644 index 00000000..73309904 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/README b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/README new file mode 100644 index 00000000..6b13d8e5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/README @@ -0,0 +1,3 @@ +This repository holds supplementary Go networking libraries. + +To submit changes to this repository, see http://golang.org/doc/contribute.html. diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/context.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/context.go new file mode 100644 index 00000000..77b64d0c --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/context.go @@ -0,0 +1,447 @@ +// Copyright 2014 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. + +// Package context defines the Context type, which carries deadlines, +// cancelation signals, and other request-scoped values across API boundaries +// and between processes. +// +// Incoming requests to a server should create a Context, and outgoing calls to +// servers should accept a Context. The chain of function calls between must +// propagate the Context, optionally replacing it with a modified copy created +// using WithDeadline, WithTimeout, WithCancel, or WithValue. +// +// Programs that use Contexts should follow these rules to keep interfaces +// consistent across packages and enable static analysis tools to check context +// propagation: +// +// Do not store Contexts inside a struct type; instead, pass a Context +// explicitly to each function that needs it. The Context should be the first +// parameter, typically named ctx: +// +// func DoSomething(ctx context.Context, arg Arg) error { +// // ... use ctx ... +// } +// +// Do not pass a nil Context, even if a function permits it. Pass context.TODO +// if you are unsure about which Context to use. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +// +// The same Context may be passed to functions running in different goroutines; +// Contexts are safe for simultaneous use by multiple goroutines. +// +// See http://blog.golang.org/context for example code for a server that uses +// Contexts. +package context // import "golang.org/x/net/context" + +import ( + "errors" + "fmt" + "sync" + "time" +) + +// A Context carries a deadline, a cancelation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context interface { + // Deadline returns the time when work done on behalf of this context + // should be canceled. Deadline returns ok==false when no deadline is + // set. Successive calls to Deadline return the same results. + Deadline() (deadline time.Time, ok bool) + + // Done returns a channel that's closed when work done on behalf of this + // context should be canceled. Done may return nil if this context can + // never be canceled. Successive calls to Done return the same value. + // + // WithCancel arranges for Done to be closed when cancel is called; + // WithDeadline arranges for Done to be closed when the deadline + // expires; WithTimeout arranges for Done to be closed when the timeout + // elapses. + // + // Done is provided for use in select statements: + // + // // Stream generates values with DoSomething and sends them to out + // // until DoSomething returns an error or ctx.Done is closed. + // func Stream(ctx context.Context, out <-chan Value) error { + // for { + // v, err := DoSomething(ctx) + // if err != nil { + // return err + // } + // select { + // case <-ctx.Done(): + // return ctx.Err() + // case out <- v: + // } + // } + // } + // + // See http://blog.golang.org/pipelines for more examples of how to use + // a Done channel for cancelation. + Done() <-chan struct{} + + // Err returns a non-nil error value after Done is closed. Err returns + // Canceled if the context was canceled or DeadlineExceeded if the + // context's deadline passed. No other values for Err are defined. + // After Done is closed, successive calls to Err return the same value. + Err() error + + // Value returns the value associated with this context for key, or nil + // if no value is associated with key. Successive calls to Value with + // the same key returns the same result. + // + // Use context values only for request-scoped data that transits + // processes and API boundaries, not for passing optional parameters to + // functions. + // + // A key identifies a specific value in a Context. Functions that wish + // to store values in Context typically allocate a key in a global + // variable then use that key as the argument to context.WithValue and + // Context.Value. A key can be any type that supports equality; + // packages should define keys as an unexported type to avoid + // collisions. + // + // Packages that define a Context key should provide type-safe accessors + // for the values stores using that key: + // + // // Package user defines a User type that's stored in Contexts. + // package user + // + // import "golang.org/x/net/context" + // + // // User is the type of value stored in the Contexts. + // type User struct {...} + // + // // key is an unexported type for keys defined in this package. + // // This prevents collisions with keys defined in other packages. + // type key int + // + // // userKey is the key for user.User values in Contexts. It is + // // unexported; clients use user.NewContext and user.FromContext + // // instead of using this key directly. + // var userKey key = 0 + // + // // NewContext returns a new Context that carries value u. + // func NewContext(ctx context.Context, u *User) context.Context { + // return context.WithValue(ctx, userKey, u) + // } + // + // // FromContext returns the User value stored in ctx, if any. + // func FromContext(ctx context.Context) (*User, bool) { + // u, ok := ctx.Value(userKey).(*User) + // return u, ok + // } + Value(key interface{}) interface{} +} + +// Canceled is the error returned by Context.Err when the context is canceled. +var Canceled = errors.New("context canceled") + +// DeadlineExceeded is the error returned by Context.Err when the context's +// deadline passes. +var DeadlineExceeded = errors.New("context deadline exceeded") + +// An emptyCtx is never canceled, has no values, and has no deadline. It is not +// struct{}, since vars of this type must have distinct addresses. +type emptyCtx int + +func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { + return +} + +func (*emptyCtx) Done() <-chan struct{} { + return nil +} + +func (*emptyCtx) Err() error { + return nil +} + +func (*emptyCtx) Value(key interface{}) interface{} { + return nil +} + +func (e *emptyCtx) String() string { + switch e { + case background: + return "context.Background" + case todo: + return "context.TODO" + } + return "unknown empty Context" +} + +var ( + background = new(emptyCtx) + todo = new(emptyCtx) +) + +// Background returns a non-nil, empty Context. It is never canceled, has no +// values, and has no deadline. It is typically used by the main function, +// initialization, and tests, and as the top-level Context for incoming +// requests. +func Background() Context { + return background +} + +// TODO returns a non-nil, empty Context. Code should use context.TODO when +// it's unclear which Context to use or it is not yet available (because the +// surrounding function has not yet been extended to accept a Context +// parameter). TODO is recognized by static analysis tools that determine +// whether Contexts are propagated correctly in a program. +func TODO() Context { + return todo +} + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc func() + +// WithCancel returns a copy of parent with a new Done channel. The returned +// context's Done channel is closed when the returned cancel function is called +// or when the parent context's Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { + c := newCancelCtx(parent) + propagateCancel(parent, &c) + return &c, func() { c.cancel(true, Canceled) } +} + +// newCancelCtx returns an initialized cancelCtx. +func newCancelCtx(parent Context) cancelCtx { + return cancelCtx{ + Context: parent, + done: make(chan struct{}), + } +} + +// propagateCancel arranges for child to be canceled when parent is. +func propagateCancel(parent Context, child canceler) { + if parent.Done() == nil { + return // parent is never canceled + } + if p, ok := parentCancelCtx(parent); ok { + p.mu.Lock() + if p.err != nil { + // parent has already been canceled + child.cancel(false, p.err) + } else { + if p.children == nil { + p.children = make(map[canceler]bool) + } + p.children[child] = true + } + p.mu.Unlock() + } else { + go func() { + select { + case <-parent.Done(): + child.cancel(false, parent.Err()) + case <-child.Done(): + } + }() + } +} + +// parentCancelCtx follows a chain of parent references until it finds a +// *cancelCtx. This function understands how each of the concrete types in this +// package represents its parent. +func parentCancelCtx(parent Context) (*cancelCtx, bool) { + for { + switch c := parent.(type) { + case *cancelCtx: + return c, true + case *timerCtx: + return &c.cancelCtx, true + case *valueCtx: + parent = c.Context + default: + return nil, false + } + } +} + +// removeChild removes a context from its parent. +func removeChild(parent Context, child canceler) { + p, ok := parentCancelCtx(parent) + if !ok { + return + } + p.mu.Lock() + if p.children != nil { + delete(p.children, child) + } + p.mu.Unlock() +} + +// A canceler is a context type that can be canceled directly. The +// implementations are *cancelCtx and *timerCtx. +type canceler interface { + cancel(removeFromParent bool, err error) + Done() <-chan struct{} +} + +// A cancelCtx can be canceled. When canceled, it also cancels any children +// that implement canceler. +type cancelCtx struct { + Context + + done chan struct{} // closed by the first cancel call. + + mu sync.Mutex + children map[canceler]bool // set to nil by the first cancel call + err error // set to non-nil by the first cancel call +} + +func (c *cancelCtx) Done() <-chan struct{} { + return c.done +} + +func (c *cancelCtx) Err() error { + c.mu.Lock() + defer c.mu.Unlock() + return c.err +} + +func (c *cancelCtx) String() string { + return fmt.Sprintf("%v.WithCancel", c.Context) +} + +// cancel closes c.done, cancels each of c's children, and, if +// removeFromParent is true, removes c from its parent's children. +func (c *cancelCtx) cancel(removeFromParent bool, err error) { + if err == nil { + panic("context: internal error: missing cancel error") + } + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return // already canceled + } + c.err = err + close(c.done) + for child := range c.children { + // NOTE: acquiring the child's lock while holding parent's lock. + child.cancel(false, err) + } + c.children = nil + c.mu.Unlock() + + if removeFromParent { + removeChild(c.Context, c) + } +} + +// WithDeadline returns a copy of the parent context with the deadline adjusted +// to be no later than d. If the parent's deadline is already earlier than d, +// WithDeadline(parent, d) is semantically equivalent to parent. The returned +// context's Done channel is closed when the deadline expires, when the returned +// cancel function is called, or when the parent context's Done channel is +// closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { + if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { + // The current deadline is already sooner than the new one. + return WithCancel(parent) + } + c := &timerCtx{ + cancelCtx: newCancelCtx(parent), + deadline: deadline, + } + propagateCancel(parent, c) + d := deadline.Sub(time.Now()) + if d <= 0 { + c.cancel(true, DeadlineExceeded) // deadline has already passed + return c, func() { c.cancel(true, Canceled) } + } + c.mu.Lock() + defer c.mu.Unlock() + if c.err == nil { + c.timer = time.AfterFunc(d, func() { + c.cancel(true, DeadlineExceeded) + }) + } + return c, func() { c.cancel(true, Canceled) } +} + +// A timerCtx carries a timer and a deadline. It embeds a cancelCtx to +// implement Done and Err. It implements cancel by stopping its timer then +// delegating to cancelCtx.cancel. +type timerCtx struct { + cancelCtx + timer *time.Timer // Under cancelCtx.mu. + + deadline time.Time +} + +func (c *timerCtx) Deadline() (deadline time.Time, ok bool) { + return c.deadline, true +} + +func (c *timerCtx) String() string { + return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now())) +} + +func (c *timerCtx) cancel(removeFromParent bool, err error) { + c.cancelCtx.cancel(false, err) + if removeFromParent { + // Remove this timerCtx from its parent cancelCtx's children. + removeChild(c.cancelCtx.Context, c) + } + c.mu.Lock() + if c.timer != nil { + c.timer.Stop() + c.timer = nil + } + c.mu.Unlock() +} + +// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete: +// +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } +func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { + return WithDeadline(parent, time.Now().Add(timeout)) +} + +// WithValue returns a copy of parent in which the value associated with key is +// val. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +func WithValue(parent Context, key interface{}, val interface{}) Context { + return &valueCtx{parent, key, val} +} + +// A valueCtx carries a key-value pair. It implements Value for that key and +// delegates all other calls to the embedded Context. +type valueCtx struct { + Context + key, val interface{} +} + +func (c *valueCtx) String() string { + return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val) +} + +func (c *valueCtx) Value(key interface{}) interface{} { + if c.key == key { + return c.val + } + return c.Context.Value(key) +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go new file mode 100644 index 00000000..e3170e33 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go @@ -0,0 +1,19 @@ +// Copyright 2015 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 go1.5 + +package ctxhttp + +import "net/http" + +func canceler(client *http.Client, req *http.Request) func() { + // TODO(djd): Respect any existing value of req.Cancel. + ch := make(chan struct{}) + req.Cancel = ch + + return func() { + close(ch) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go new file mode 100644 index 00000000..56bcbadb --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go @@ -0,0 +1,23 @@ +// Copyright 2015 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 !go1.5 + +package ctxhttp + +import "net/http" + +type requestCanceler interface { + CancelRequest(*http.Request) +} + +func canceler(client *http.Client, req *http.Request) func() { + rc, ok := client.Transport.(requestCanceler) + if !ok { + return func() {} + } + return func() { + rc.CancelRequest(req) + } +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go new file mode 100644 index 00000000..62620d4e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go @@ -0,0 +1,140 @@ +// Copyright 2015 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. + +// Package ctxhttp provides helper functions for performing context-aware HTTP requests. +package ctxhttp // import "golang.org/x/net/context/ctxhttp" + +import ( + "io" + "net/http" + "net/url" + "strings" + + "golang.org/x/net/context" +) + +func nop() {} + +var ( + testHookContextDoneBeforeHeaders = nop + testHookDoReturned = nop + testHookDidBodyClose = nop +) + +// Do sends an HTTP request with the provided http.Client and returns an HTTP response. +// If the client is nil, http.DefaultClient is used. +// If the context is canceled or times out, ctx.Err() will be returned. +func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + if client == nil { + client = http.DefaultClient + } + + // Request cancelation changed in Go 1.5, see cancelreq.go and cancelreq_go14.go. + cancel := canceler(client, req) + + type responseAndError struct { + resp *http.Response + err error + } + result := make(chan responseAndError, 1) + + go func() { + resp, err := client.Do(req) + testHookDoReturned() + result <- responseAndError{resp, err} + }() + + var resp *http.Response + + select { + case <-ctx.Done(): + testHookContextDoneBeforeHeaders() + cancel() + // Clean up after the goroutine calling client.Do: + go func() { + if r := <-result; r.resp != nil { + testHookDidBodyClose() + r.resp.Body.Close() + } + }() + return nil, ctx.Err() + case r := <-result: + var err error + resp, err = r.resp, r.err + if err != nil { + return resp, err + } + } + + c := make(chan struct{}) + go func() { + select { + case <-ctx.Done(): + cancel() + case <-c: + // The response's Body is closed. + } + }() + resp.Body = ¬ifyingReader{resp.Body, c} + + return resp, nil +} + +// Get issues a GET request via the Do function. +func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Head issues a HEAD request via the Do function. +func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("HEAD", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Post issues a POST request via the Do function. +func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { + req, err := http.NewRequest("POST", url, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", bodyType) + return Do(ctx, client, req) +} + +// PostForm issues a POST request via the Do function. +func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { + return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) +} + +// notifyingReader is an io.ReadCloser that closes the notify channel after +// Close is called or a Read fails on the underlying ReadCloser. +type notifyingReader struct { + io.ReadCloser + notify chan<- struct{} +} + +func (r *notifyingReader) Read(p []byte) (int, error) { + n, err := r.ReadCloser.Read(p) + if err != nil && r.notify != nil { + close(r.notify) + r.notify = nil + } + return n, err +} + +func (r *notifyingReader) Close() error { + err := r.ReadCloser.Close() + if r.notify != nil { + close(r.notify) + r.notify = nil + } + return err +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/dict/dict.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/dict/dict.go new file mode 100644 index 00000000..58fef89e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/dict/dict.go @@ -0,0 +1,210 @@ +// Copyright 2010 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. + +// Package dict implements the Dictionary Server Protocol +// as defined in RFC 2229. +package dict // import "golang.org/x/net/dict" + +import ( + "net/textproto" + "strconv" + "strings" +) + +// A Client represents a client connection to a dictionary server. +type Client struct { + text *textproto.Conn +} + +// Dial returns a new client connected to a dictionary server at +// addr on the given network. +func Dial(network, addr string) (*Client, error) { + text, err := textproto.Dial(network, addr) + if err != nil { + return nil, err + } + _, _, err = text.ReadCodeLine(220) + if err != nil { + text.Close() + return nil, err + } + return &Client{text: text}, nil +} + +// Close closes the connection to the dictionary server. +func (c *Client) Close() error { + return c.text.Close() +} + +// A Dict represents a dictionary available on the server. +type Dict struct { + Name string // short name of dictionary + Desc string // long description +} + +// Dicts returns a list of the dictionaries available on the server. +func (c *Client) Dicts() ([]Dict, error) { + id, err := c.text.Cmd("SHOW DB") + if err != nil { + return nil, err + } + + c.text.StartResponse(id) + defer c.text.EndResponse(id) + + _, _, err = c.text.ReadCodeLine(110) + if err != nil { + return nil, err + } + lines, err := c.text.ReadDotLines() + if err != nil { + return nil, err + } + _, _, err = c.text.ReadCodeLine(250) + + dicts := make([]Dict, len(lines)) + for i := range dicts { + d := &dicts[i] + a, _ := fields(lines[i]) + if len(a) < 2 { + return nil, textproto.ProtocolError("invalid dictionary: " + lines[i]) + } + d.Name = a[0] + d.Desc = a[1] + } + return dicts, err +} + +// A Defn represents a definition. +type Defn struct { + Dict Dict // Dict where definition was found + Word string // Word being defined + Text []byte // Definition text, typically multiple lines +} + +// Define requests the definition of the given word. +// The argument dict names the dictionary to use, +// the Name field of a Dict returned by Dicts. +// +// The special dictionary name "*" means to look in all the +// server's dictionaries. +// The special dictionary name "!" means to look in all the +// server's dictionaries in turn, stopping after finding the word +// in one of them. +func (c *Client) Define(dict, word string) ([]*Defn, error) { + id, err := c.text.Cmd("DEFINE %s %q", dict, word) + if err != nil { + return nil, err + } + + c.text.StartResponse(id) + defer c.text.EndResponse(id) + + _, line, err := c.text.ReadCodeLine(150) + if err != nil { + return nil, err + } + a, _ := fields(line) + if len(a) < 1 { + return nil, textproto.ProtocolError("malformed response: " + line) + } + n, err := strconv.Atoi(a[0]) + if err != nil { + return nil, textproto.ProtocolError("invalid definition count: " + a[0]) + } + def := make([]*Defn, n) + for i := 0; i < n; i++ { + _, line, err = c.text.ReadCodeLine(151) + if err != nil { + return nil, err + } + a, _ := fields(line) + if len(a) < 3 { + // skip it, to keep protocol in sync + i-- + n-- + def = def[0:n] + continue + } + d := &Defn{Word: a[0], Dict: Dict{a[1], a[2]}} + d.Text, err = c.text.ReadDotBytes() + if err != nil { + return nil, err + } + def[i] = d + } + _, _, err = c.text.ReadCodeLine(250) + return def, err +} + +// Fields returns the fields in s. +// Fields are space separated unquoted words +// or quoted with single or double quote. +func fields(s string) ([]string, error) { + var v []string + i := 0 + for { + for i < len(s) && (s[i] == ' ' || s[i] == '\t') { + i++ + } + if i >= len(s) { + break + } + if s[i] == '"' || s[i] == '\'' { + q := s[i] + // quoted string + var j int + for j = i + 1; ; j++ { + if j >= len(s) { + return nil, textproto.ProtocolError("malformed quoted string") + } + if s[j] == '\\' { + j++ + continue + } + if s[j] == q { + j++ + break + } + } + v = append(v, unquote(s[i+1:j-1])) + i = j + } else { + // atom + var j int + for j = i; j < len(s); j++ { + if s[j] == ' ' || s[j] == '\t' || s[j] == '\\' || s[j] == '"' || s[j] == '\'' { + break + } + } + v = append(v, s[i:j]) + i = j + } + if i < len(s) { + c := s[i] + if c != ' ' && c != '\t' { + return nil, textproto.ProtocolError("quotes not on word boundaries") + } + } + } + return v, nil +} + +func unquote(s string) string { + if strings.Index(s, "\\") < 0 { + return s + } + b := []byte(s) + w := 0 + for r := 0; r < len(b); r++ { + c := b[r] + if c == '\\' { + r++ + c = b[r] + } + b[w] = c + w++ + } + return string(b[0:w]) +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/atom/atom.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/atom/atom.go new file mode 100644 index 00000000..cd0a8ac1 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/atom/atom.go @@ -0,0 +1,78 @@ +// Copyright 2012 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. + +// Package atom provides integer codes (also known as atoms) for a fixed set of +// frequently occurring HTML strings: tag names and attribute keys such as "p" +// and "id". +// +// Sharing an atom's name between all elements with the same tag can result in +// fewer string allocations when tokenizing and parsing HTML. Integer +// comparisons are also generally faster than string comparisons. +// +// The value of an atom's particular code is not guaranteed to stay the same +// between versions of this package. Neither is any ordering guaranteed: +// whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to +// be dense. The only guarantees are that e.g. looking up "div" will yield +// atom.Div, calling atom.Div.String will return "div", and atom.Div != 0. +package atom // import "golang.org/x/net/html/atom" + +// Atom is an integer code for a string. The zero value maps to "". +type Atom uint32 + +// String returns the atom's name. +func (a Atom) String() string { + start := uint32(a >> 8) + n := uint32(a & 0xff) + if start+n > uint32(len(atomText)) { + return "" + } + return atomText[start : start+n] +} + +func (a Atom) string() string { + return atomText[a>>8 : a>>8+a&0xff] +} + +// fnv computes the FNV hash with an arbitrary starting value h. +func fnv(h uint32, s []byte) uint32 { + for i := range s { + h ^= uint32(s[i]) + h *= 16777619 + } + return h +} + +func match(s string, t []byte) bool { + for i, c := range t { + if s[i] != c { + return false + } + } + return true +} + +// Lookup returns the atom whose name is s. It returns zero if there is no +// such atom. The lookup is case sensitive. +func Lookup(s []byte) Atom { + if len(s) == 0 || len(s) > maxAtomLen { + return 0 + } + h := fnv(hash0, s) + if a := table[h&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { + return a + } + if a := table[(h>>16)&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { + return a + } + return 0 +} + +// String returns a string whose contents are equal to s. In that sense, it is +// equivalent to string(s) but may be more efficient. +func String(s []byte) string { + if a := Lookup(s); a != 0 { + return a.String() + } + return string(s) +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/atom/gen.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/atom/gen.go new file mode 100644 index 00000000..6bfa8660 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/atom/gen.go @@ -0,0 +1,648 @@ +// Copyright 2012 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 + +package main + +// This program generates table.go and table_test.go. +// Invoke as +// +// go run gen.go |gofmt >table.go +// go run gen.go -test |gofmt >table_test.go + +import ( + "flag" + "fmt" + "math/rand" + "os" + "sort" + "strings" +) + +// identifier converts s to a Go exported identifier. +// It converts "div" to "Div" and "accept-charset" to "AcceptCharset". +func identifier(s string) string { + b := make([]byte, 0, len(s)) + cap := true + for _, c := range s { + if c == '-' { + cap = true + continue + } + if cap && 'a' <= c && c <= 'z' { + c -= 'a' - 'A' + } + cap = false + b = append(b, byte(c)) + } + return string(b) +} + +var test = flag.Bool("test", false, "generate table_test.go") + +func main() { + flag.Parse() + + var all []string + all = append(all, elements...) + all = append(all, attributes...) + all = append(all, eventHandlers...) + all = append(all, extra...) + sort.Strings(all) + + if *test { + fmt.Printf("// generated by go run gen.go -test; DO NOT EDIT\n\n") + fmt.Printf("package atom\n\n") + fmt.Printf("var testAtomList = []string{\n") + for _, s := range all { + fmt.Printf("\t%q,\n", s) + } + fmt.Printf("}\n") + return + } + + // uniq - lists have dups + // compute max len too + maxLen := 0 + w := 0 + for _, s := range all { + if w == 0 || all[w-1] != s { + if maxLen < len(s) { + maxLen = len(s) + } + all[w] = s + w++ + } + } + all = all[:w] + + // Find hash that minimizes table size. + var best *table + for i := 0; i < 1000000; i++ { + if best != nil && 1<<(best.k-1) < len(all) { + break + } + h := rand.Uint32() + for k := uint(0); k <= 16; k++ { + if best != nil && k >= best.k { + break + } + var t table + if t.init(h, k, all) { + best = &t + break + } + } + } + if best == nil { + fmt.Fprintf(os.Stderr, "failed to construct string table\n") + os.Exit(1) + } + + // Lay out strings, using overlaps when possible. + layout := append([]string{}, all...) + + // Remove strings that are substrings of other strings + for changed := true; changed; { + changed = false + for i, s := range layout { + if s == "" { + continue + } + for j, t := range layout { + if i != j && t != "" && strings.Contains(s, t) { + changed = true + layout[j] = "" + } + } + } + } + + // Join strings where one suffix matches another prefix. + for { + // Find best i, j, k such that layout[i][len-k:] == layout[j][:k], + // maximizing overlap length k. + besti := -1 + bestj := -1 + bestk := 0 + for i, s := range layout { + if s == "" { + continue + } + for j, t := range layout { + if i == j { + continue + } + for k := bestk + 1; k <= len(s) && k <= len(t); k++ { + if s[len(s)-k:] == t[:k] { + besti = i + bestj = j + bestk = k + } + } + } + } + if bestk > 0 { + layout[besti] += layout[bestj][bestk:] + layout[bestj] = "" + continue + } + break + } + + text := strings.Join(layout, "") + + atom := map[string]uint32{} + for _, s := range all { + off := strings.Index(text, s) + if off < 0 { + panic("lost string " + s) + } + atom[s] = uint32(off<<8 | len(s)) + } + + // Generate the Go code. + fmt.Printf("// generated by go run gen.go; DO NOT EDIT\n\n") + fmt.Printf("package atom\n\nconst (\n") + for _, s := range all { + fmt.Printf("\t%s Atom = %#x\n", identifier(s), atom[s]) + } + fmt.Printf(")\n\n") + + fmt.Printf("const hash0 = %#x\n\n", best.h0) + fmt.Printf("const maxAtomLen = %d\n\n", maxLen) + + fmt.Printf("var table = [1<<%d]Atom{\n", best.k) + for i, s := range best.tab { + if s == "" { + continue + } + fmt.Printf("\t%#x: %#x, // %s\n", i, atom[s], s) + } + fmt.Printf("}\n") + datasize := (1 << best.k) * 4 + + fmt.Printf("const atomText =\n") + textsize := len(text) + for len(text) > 60 { + fmt.Printf("\t%q +\n", text[:60]) + text = text[60:] + } + fmt.Printf("\t%q\n\n", text) + + fmt.Fprintf(os.Stderr, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize) +} + +type byLen []string + +func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) } +func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x byLen) Len() int { return len(x) } + +// fnv computes the FNV hash with an arbitrary starting value h. +func fnv(h uint32, s string) uint32 { + for i := 0; i < len(s); i++ { + h ^= uint32(s[i]) + h *= 16777619 + } + return h +} + +// A table represents an attempt at constructing the lookup table. +// The lookup table uses cuckoo hashing, meaning that each string +// can be found in one of two positions. +type table struct { + h0 uint32 + k uint + mask uint32 + tab []string +} + +// hash returns the two hashes for s. +func (t *table) hash(s string) (h1, h2 uint32) { + h := fnv(t.h0, s) + h1 = h & t.mask + h2 = (h >> 16) & t.mask + return +} + +// init initializes the table with the given parameters. +// h0 is the initial hash value, +// k is the number of bits of hash value to use, and +// x is the list of strings to store in the table. +// init returns false if the table cannot be constructed. +func (t *table) init(h0 uint32, k uint, x []string) bool { + t.h0 = h0 + t.k = k + t.tab = make([]string, 1< len(t.tab) { + return false + } + s := t.tab[i] + h1, h2 := t.hash(s) + j := h1 + h2 - i + if t.tab[j] != "" && !t.push(j, depth+1) { + return false + } + t.tab[j] = s + return true +} + +// The lists of element names and attribute keys were taken from +// https://html.spec.whatwg.org/multipage/indices.html#index +// as of the "HTML Living Standard - Last Updated 21 February 2015" version. + +var elements = []string{ + "a", + "abbr", + "address", + "area", + "article", + "aside", + "audio", + "b", + "base", + "bdi", + "bdo", + "blockquote", + "body", + "br", + "button", + "canvas", + "caption", + "cite", + "code", + "col", + "colgroup", + "command", + "data", + "datalist", + "dd", + "del", + "details", + "dfn", + "dialog", + "div", + "dl", + "dt", + "em", + "embed", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hgroup", + "hr", + "html", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "keygen", + "label", + "legend", + "li", + "link", + "map", + "mark", + "menu", + "menuitem", + "meta", + "meter", + "nav", + "noscript", + "object", + "ol", + "optgroup", + "option", + "output", + "p", + "param", + "pre", + "progress", + "q", + "rp", + "rt", + "ruby", + "s", + "samp", + "script", + "section", + "select", + "small", + "source", + "span", + "strong", + "style", + "sub", + "summary", + "sup", + "table", + "tbody", + "td", + "template", + "textarea", + "tfoot", + "th", + "thead", + "time", + "title", + "tr", + "track", + "u", + "ul", + "var", + "video", + "wbr", +} + +// https://html.spec.whatwg.org/multipage/indices.html#attributes-3 + +var attributes = []string{ + "abbr", + "accept", + "accept-charset", + "accesskey", + "action", + "alt", + "async", + "autocomplete", + "autofocus", + "autoplay", + "challenge", + "charset", + "checked", + "cite", + "class", + "cols", + "colspan", + "command", + "content", + "contenteditable", + "contextmenu", + "controls", + "coords", + "crossorigin", + "data", + "datetime", + "default", + "defer", + "dir", + "dirname", + "disabled", + "download", + "draggable", + "dropzone", + "enctype", + "for", + "form", + "formaction", + "formenctype", + "formmethod", + "formnovalidate", + "formtarget", + "headers", + "height", + "hidden", + "high", + "href", + "hreflang", + "http-equiv", + "icon", + "id", + "inputmode", + "ismap", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "keytype", + "kind", + "label", + "lang", + "list", + "loop", + "low", + "manifest", + "max", + "maxlength", + "media", + "mediagroup", + "method", + "min", + "minlength", + "multiple", + "muted", + "name", + "novalidate", + "open", + "optimum", + "pattern", + "ping", + "placeholder", + "poster", + "preload", + "radiogroup", + "readonly", + "rel", + "required", + "reversed", + "rows", + "rowspan", + "sandbox", + "spellcheck", + "scope", + "scoped", + "seamless", + "selected", + "shape", + "size", + "sizes", + "sortable", + "sorted", + "span", + "src", + "srcdoc", + "srclang", + "start", + "step", + "style", + "tabindex", + "target", + "title", + "translate", + "type", + "typemustmatch", + "usemap", + "value", + "width", + "wrap", +} + +var eventHandlers = []string{ + "onabort", + "onautocomplete", + "onautocompleteerror", + "onafterprint", + "onbeforeprint", + "onbeforeunload", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncuechange", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "onhashchange", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onlanguagechange", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadstart", + "onmessage", + "onmousedown", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onoffline", + "ononline", + "onpagehide", + "onpageshow", + "onpause", + "onplay", + "onplaying", + "onpopstate", + "onprogress", + "onratechange", + "onreset", + "onresize", + "onscroll", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onsort", + "onstalled", + "onstorage", + "onsubmit", + "onsuspend", + "ontimeupdate", + "ontoggle", + "onunload", + "onvolumechange", + "onwaiting", +} + +// extra are ad-hoc values not covered by any of the lists above. +var extra = []string{ + "align", + "annotation", + "annotation-xml", + "applet", + "basefont", + "bgsound", + "big", + "blink", + "center", + "color", + "desc", + "face", + "font", + "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive. + "foreignobject", + "frame", + "frameset", + "image", + "isindex", + "listing", + "malignmark", + "marquee", + "math", + "mglyph", + "mi", + "mn", + "mo", + "ms", + "mtext", + "nobr", + "noembed", + "noframes", + "plaintext", + "prompt", + "public", + "spacer", + "strike", + "svg", + "system", + "tt", + "xmp", +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/atom/table.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/atom/table.go new file mode 100644 index 00000000..2605ba31 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/atom/table.go @@ -0,0 +1,713 @@ +// generated by go run gen.go; DO NOT EDIT + +package atom + +const ( + A Atom = 0x1 + Abbr Atom = 0x4 + Accept Atom = 0x2106 + AcceptCharset Atom = 0x210e + Accesskey Atom = 0x3309 + Action Atom = 0x1f606 + Address Atom = 0x4f307 + Align Atom = 0x1105 + Alt Atom = 0x4503 + Annotation Atom = 0x1670a + AnnotationXml Atom = 0x1670e + Applet Atom = 0x2b306 + Area Atom = 0x2fa04 + Article Atom = 0x38807 + Aside Atom = 0x8305 + Async Atom = 0x7b05 + Audio Atom = 0xa605 + Autocomplete Atom = 0x1fc0c + Autofocus Atom = 0xb309 + Autoplay Atom = 0xce08 + B Atom = 0x101 + Base Atom = 0xd604 + Basefont Atom = 0xd608 + Bdi Atom = 0x1a03 + Bdo Atom = 0xe703 + Bgsound Atom = 0x11807 + Big Atom = 0x12403 + Blink Atom = 0x12705 + Blockquote Atom = 0x12c0a + Body Atom = 0x2f04 + Br Atom = 0x202 + Button Atom = 0x13606 + Canvas Atom = 0x7f06 + Caption Atom = 0x1bb07 + Center Atom = 0x5b506 + Challenge Atom = 0x21f09 + Charset Atom = 0x2807 + Checked Atom = 0x32807 + Cite Atom = 0x3c804 + Class Atom = 0x4de05 + Code Atom = 0x14904 + Col Atom = 0x15003 + Colgroup Atom = 0x15008 + Color Atom = 0x15d05 + Cols Atom = 0x16204 + Colspan Atom = 0x16207 + Command Atom = 0x17507 + Content Atom = 0x42307 + Contenteditable Atom = 0x4230f + Contextmenu Atom = 0x3310b + Controls Atom = 0x18808 + Coords Atom = 0x19406 + Crossorigin Atom = 0x19f0b + Data Atom = 0x44a04 + Datalist Atom = 0x44a08 + Datetime Atom = 0x23c08 + Dd Atom = 0x26702 + Default Atom = 0x8607 + Defer Atom = 0x14b05 + Del Atom = 0x3ef03 + Desc Atom = 0x4db04 + Details Atom = 0x4807 + Dfn Atom = 0x6103 + Dialog Atom = 0x1b06 + Dir Atom = 0x6903 + Dirname Atom = 0x6907 + Disabled Atom = 0x10c08 + Div Atom = 0x11303 + Dl Atom = 0x11e02 + Download Atom = 0x40008 + Draggable Atom = 0x17b09 + Dropzone Atom = 0x39108 + Dt Atom = 0x50902 + Em Atom = 0x6502 + Embed Atom = 0x6505 + Enctype Atom = 0x21107 + Face Atom = 0x5b304 + Fieldset Atom = 0x1b008 + Figcaption Atom = 0x1b80a + Figure Atom = 0x1cc06 + Font Atom = 0xda04 + Footer Atom = 0x8d06 + For Atom = 0x1d803 + ForeignObject Atom = 0x1d80d + Foreignobject Atom = 0x1e50d + Form Atom = 0x1f204 + Formaction Atom = 0x1f20a + Formenctype Atom = 0x20d0b + Formmethod Atom = 0x2280a + Formnovalidate Atom = 0x2320e + Formtarget Atom = 0x2470a + Frame Atom = 0x9a05 + Frameset Atom = 0x9a08 + H1 Atom = 0x26e02 + H2 Atom = 0x29402 + H3 Atom = 0x2a702 + H4 Atom = 0x2e902 + H5 Atom = 0x2f302 + H6 Atom = 0x50b02 + Head Atom = 0x2d504 + Header Atom = 0x2d506 + Headers Atom = 0x2d507 + Height Atom = 0x25106 + Hgroup Atom = 0x25906 + Hidden Atom = 0x26506 + High Atom = 0x26b04 + Hr Atom = 0x27002 + Href Atom = 0x27004 + Hreflang Atom = 0x27008 + Html Atom = 0x25504 + HttpEquiv Atom = 0x2780a + I Atom = 0x601 + Icon Atom = 0x42204 + Id Atom = 0x8502 + Iframe Atom = 0x29606 + Image Atom = 0x29c05 + Img Atom = 0x2a103 + Input Atom = 0x3e805 + Inputmode Atom = 0x3e809 + Ins Atom = 0x1a803 + Isindex Atom = 0x2a907 + Ismap Atom = 0x2b005 + Itemid Atom = 0x33c06 + Itemprop Atom = 0x3c908 + Itemref Atom = 0x5ad07 + Itemscope Atom = 0x2b909 + Itemtype Atom = 0x2c308 + Kbd Atom = 0x1903 + Keygen Atom = 0x3906 + Keytype Atom = 0x53707 + Kind Atom = 0x10904 + Label Atom = 0xf005 + Lang Atom = 0x27404 + Legend Atom = 0x18206 + Li Atom = 0x1202 + Link Atom = 0x12804 + List Atom = 0x44e04 + Listing Atom = 0x44e07 + Loop Atom = 0xf404 + Low Atom = 0x11f03 + Malignmark Atom = 0x100a + Manifest Atom = 0x5f108 + Map Atom = 0x2b203 + Mark Atom = 0x1604 + Marquee Atom = 0x2cb07 + Math Atom = 0x2d204 + Max Atom = 0x2e103 + Maxlength Atom = 0x2e109 + Media Atom = 0x6e05 + Mediagroup Atom = 0x6e0a + Menu Atom = 0x33804 + Menuitem Atom = 0x33808 + Meta Atom = 0x45d04 + Meter Atom = 0x24205 + Method Atom = 0x22c06 + Mglyph Atom = 0x2a206 + Mi Atom = 0x2eb02 + Min Atom = 0x2eb03 + Minlength Atom = 0x2eb09 + Mn Atom = 0x23502 + Mo Atom = 0x3ed02 + Ms Atom = 0x2bc02 + Mtext Atom = 0x2f505 + Multiple Atom = 0x30308 + Muted Atom = 0x30b05 + Name Atom = 0x6c04 + Nav Atom = 0x3e03 + Nobr Atom = 0x5704 + Noembed Atom = 0x6307 + Noframes Atom = 0x9808 + Noscript Atom = 0x3d208 + Novalidate Atom = 0x2360a + Object Atom = 0x1ec06 + Ol Atom = 0xc902 + Onabort Atom = 0x13a07 + Onafterprint Atom = 0x1c00c + Onautocomplete Atom = 0x1fa0e + Onautocompleteerror Atom = 0x1fa13 + Onbeforeprint Atom = 0x6040d + Onbeforeunload Atom = 0x4e70e + Onblur Atom = 0xaa06 + Oncancel Atom = 0xe908 + Oncanplay Atom = 0x28509 + Oncanplaythrough Atom = 0x28510 + Onchange Atom = 0x3a708 + Onclick Atom = 0x31007 + Onclose Atom = 0x31707 + Oncontextmenu Atom = 0x32f0d + Oncuechange Atom = 0x3420b + Ondblclick Atom = 0x34d0a + Ondrag Atom = 0x35706 + Ondragend Atom = 0x35709 + Ondragenter Atom = 0x3600b + Ondragleave Atom = 0x36b0b + Ondragover Atom = 0x3760a + Ondragstart Atom = 0x3800b + Ondrop Atom = 0x38f06 + Ondurationchange Atom = 0x39f10 + Onemptied Atom = 0x39609 + Onended Atom = 0x3af07 + Onerror Atom = 0x3b607 + Onfocus Atom = 0x3bd07 + Onhashchange Atom = 0x3da0c + Oninput Atom = 0x3e607 + Oninvalid Atom = 0x3f209 + Onkeydown Atom = 0x3fb09 + Onkeypress Atom = 0x4080a + Onkeyup Atom = 0x41807 + Onlanguagechange Atom = 0x43210 + Onload Atom = 0x44206 + Onloadeddata Atom = 0x4420c + Onloadedmetadata Atom = 0x45510 + Onloadstart Atom = 0x46b0b + Onmessage Atom = 0x47609 + Onmousedown Atom = 0x47f0b + Onmousemove Atom = 0x48a0b + Onmouseout Atom = 0x4950a + Onmouseover Atom = 0x4a20b + Onmouseup Atom = 0x4ad09 + Onmousewheel Atom = 0x4b60c + Onoffline Atom = 0x4c209 + Ononline Atom = 0x4cb08 + Onpagehide Atom = 0x4d30a + Onpageshow Atom = 0x4fe0a + Onpause Atom = 0x50d07 + Onplay Atom = 0x51706 + Onplaying Atom = 0x51709 + Onpopstate Atom = 0x5200a + Onprogress Atom = 0x52a0a + Onratechange Atom = 0x53e0c + Onreset Atom = 0x54a07 + Onresize Atom = 0x55108 + Onscroll Atom = 0x55f08 + Onseeked Atom = 0x56708 + Onseeking Atom = 0x56f09 + Onselect Atom = 0x57808 + Onshow Atom = 0x58206 + Onsort Atom = 0x58b06 + Onstalled Atom = 0x59509 + Onstorage Atom = 0x59e09 + Onsubmit Atom = 0x5a708 + Onsuspend Atom = 0x5bb09 + Ontimeupdate Atom = 0xdb0c + Ontoggle Atom = 0x5c408 + Onunload Atom = 0x5cc08 + Onvolumechange Atom = 0x5d40e + Onwaiting Atom = 0x5e209 + Open Atom = 0x3cf04 + Optgroup Atom = 0xf608 + Optimum Atom = 0x5eb07 + Option Atom = 0x60006 + Output Atom = 0x49c06 + P Atom = 0xc01 + Param Atom = 0xc05 + Pattern Atom = 0x5107 + Ping Atom = 0x7704 + Placeholder Atom = 0xc30b + Plaintext Atom = 0xfd09 + Poster Atom = 0x15706 + Pre Atom = 0x25e03 + Preload Atom = 0x25e07 + Progress Atom = 0x52c08 + Prompt Atom = 0x5fa06 + Public Atom = 0x41e06 + Q Atom = 0x13101 + Radiogroup Atom = 0x30a + Readonly Atom = 0x2fb08 + Rel Atom = 0x25f03 + Required Atom = 0x1d008 + Reversed Atom = 0x5a08 + Rows Atom = 0x9204 + Rowspan Atom = 0x9207 + Rp Atom = 0x1c602 + Rt Atom = 0x13f02 + Ruby Atom = 0xaf04 + S Atom = 0x2c01 + Samp Atom = 0x4e04 + Sandbox Atom = 0xbb07 + Scope Atom = 0x2bd05 + Scoped Atom = 0x2bd06 + Script Atom = 0x3d406 + Seamless Atom = 0x31c08 + Section Atom = 0x4e207 + Select Atom = 0x57a06 + Selected Atom = 0x57a08 + Shape Atom = 0x4f905 + Size Atom = 0x55504 + Sizes Atom = 0x55505 + Small Atom = 0x18f05 + Sortable Atom = 0x58d08 + Sorted Atom = 0x19906 + Source Atom = 0x1aa06 + Spacer Atom = 0x2db06 + Span Atom = 0x9504 + Spellcheck Atom = 0x3230a + Src Atom = 0x3c303 + Srcdoc Atom = 0x3c306 + Srclang Atom = 0x41107 + Start Atom = 0x38605 + Step Atom = 0x5f704 + Strike Atom = 0x53306 + Strong Atom = 0x55906 + Style Atom = 0x61105 + Sub Atom = 0x5a903 + Summary Atom = 0x61607 + Sup Atom = 0x61d03 + Svg Atom = 0x62003 + System Atom = 0x62306 + Tabindex Atom = 0x46308 + Table Atom = 0x42d05 + Target Atom = 0x24b06 + Tbody Atom = 0x2e05 + Td Atom = 0x4702 + Template Atom = 0x62608 + Textarea Atom = 0x2f608 + Tfoot Atom = 0x8c05 + Th Atom = 0x22e02 + Thead Atom = 0x2d405 + Time Atom = 0xdd04 + Title Atom = 0xa105 + Tr Atom = 0x10502 + Track Atom = 0x10505 + Translate Atom = 0x14009 + Tt Atom = 0x5302 + Type Atom = 0x21404 + Typemustmatch Atom = 0x2140d + U Atom = 0xb01 + Ul Atom = 0x8a02 + Usemap Atom = 0x51106 + Value Atom = 0x4005 + Var Atom = 0x11503 + Video Atom = 0x28105 + Wbr Atom = 0x12103 + Width Atom = 0x50705 + Wrap Atom = 0x58704 + Xmp Atom = 0xc103 +) + +const hash0 = 0xc17da63e + +const maxAtomLen = 19 + +var table = [1 << 9]Atom{ + 0x1: 0x48a0b, // onmousemove + 0x2: 0x5e209, // onwaiting + 0x3: 0x1fa13, // onautocompleteerror + 0x4: 0x5fa06, // prompt + 0x7: 0x5eb07, // optimum + 0x8: 0x1604, // mark + 0xa: 0x5ad07, // itemref + 0xb: 0x4fe0a, // onpageshow + 0xc: 0x57a06, // select + 0xd: 0x17b09, // draggable + 0xe: 0x3e03, // nav + 0xf: 0x17507, // command + 0x11: 0xb01, // u + 0x14: 0x2d507, // headers + 0x15: 0x44a08, // datalist + 0x17: 0x4e04, // samp + 0x1a: 0x3fb09, // onkeydown + 0x1b: 0x55f08, // onscroll + 0x1c: 0x15003, // col + 0x20: 0x3c908, // itemprop + 0x21: 0x2780a, // http-equiv + 0x22: 0x61d03, // sup + 0x24: 0x1d008, // required + 0x2b: 0x25e07, // preload + 0x2c: 0x6040d, // onbeforeprint + 0x2d: 0x3600b, // ondragenter + 0x2e: 0x50902, // dt + 0x2f: 0x5a708, // onsubmit + 0x30: 0x27002, // hr + 0x31: 0x32f0d, // oncontextmenu + 0x33: 0x29c05, // image + 0x34: 0x50d07, // onpause + 0x35: 0x25906, // hgroup + 0x36: 0x7704, // ping + 0x37: 0x57808, // onselect + 0x3a: 0x11303, // div + 0x3b: 0x1fa0e, // onautocomplete + 0x40: 0x2eb02, // mi + 0x41: 0x31c08, // seamless + 0x42: 0x2807, // charset + 0x43: 0x8502, // id + 0x44: 0x5200a, // onpopstate + 0x45: 0x3ef03, // del + 0x46: 0x2cb07, // marquee + 0x47: 0x3309, // accesskey + 0x49: 0x8d06, // footer + 0x4a: 0x44e04, // list + 0x4b: 0x2b005, // ismap + 0x51: 0x33804, // menu + 0x52: 0x2f04, // body + 0x55: 0x9a08, // frameset + 0x56: 0x54a07, // onreset + 0x57: 0x12705, // blink + 0x58: 0xa105, // title + 0x59: 0x38807, // article + 0x5b: 0x22e02, // th + 0x5d: 0x13101, // q + 0x5e: 0x3cf04, // open + 0x5f: 0x2fa04, // area + 0x61: 0x44206, // onload + 0x62: 0xda04, // font + 0x63: 0xd604, // base + 0x64: 0x16207, // colspan + 0x65: 0x53707, // keytype + 0x66: 0x11e02, // dl + 0x68: 0x1b008, // fieldset + 0x6a: 0x2eb03, // min + 0x6b: 0x11503, // var + 0x6f: 0x2d506, // header + 0x70: 0x13f02, // rt + 0x71: 0x15008, // colgroup + 0x72: 0x23502, // mn + 0x74: 0x13a07, // onabort + 0x75: 0x3906, // keygen + 0x76: 0x4c209, // onoffline + 0x77: 0x21f09, // challenge + 0x78: 0x2b203, // map + 0x7a: 0x2e902, // h4 + 0x7b: 0x3b607, // onerror + 0x7c: 0x2e109, // maxlength + 0x7d: 0x2f505, // mtext + 0x7e: 0xbb07, // sandbox + 0x7f: 0x58b06, // onsort + 0x80: 0x100a, // malignmark + 0x81: 0x45d04, // meta + 0x82: 0x7b05, // async + 0x83: 0x2a702, // h3 + 0x84: 0x26702, // dd + 0x85: 0x27004, // href + 0x86: 0x6e0a, // mediagroup + 0x87: 0x19406, // coords + 0x88: 0x41107, // srclang + 0x89: 0x34d0a, // ondblclick + 0x8a: 0x4005, // value + 0x8c: 0xe908, // oncancel + 0x8e: 0x3230a, // spellcheck + 0x8f: 0x9a05, // frame + 0x91: 0x12403, // big + 0x94: 0x1f606, // action + 0x95: 0x6903, // dir + 0x97: 0x2fb08, // readonly + 0x99: 0x42d05, // table + 0x9a: 0x61607, // summary + 0x9b: 0x12103, // wbr + 0x9c: 0x30a, // radiogroup + 0x9d: 0x6c04, // name + 0x9f: 0x62306, // system + 0xa1: 0x15d05, // color + 0xa2: 0x7f06, // canvas + 0xa3: 0x25504, // html + 0xa5: 0x56f09, // onseeking + 0xac: 0x4f905, // shape + 0xad: 0x25f03, // rel + 0xae: 0x28510, // oncanplaythrough + 0xaf: 0x3760a, // ondragover + 0xb0: 0x62608, // template + 0xb1: 0x1d80d, // foreignObject + 0xb3: 0x9204, // rows + 0xb6: 0x44e07, // listing + 0xb7: 0x49c06, // output + 0xb9: 0x3310b, // contextmenu + 0xbb: 0x11f03, // low + 0xbc: 0x1c602, // rp + 0xbd: 0x5bb09, // onsuspend + 0xbe: 0x13606, // button + 0xbf: 0x4db04, // desc + 0xc1: 0x4e207, // section + 0xc2: 0x52a0a, // onprogress + 0xc3: 0x59e09, // onstorage + 0xc4: 0x2d204, // math + 0xc5: 0x4503, // alt + 0xc7: 0x8a02, // ul + 0xc8: 0x5107, // pattern + 0xc9: 0x4b60c, // onmousewheel + 0xca: 0x35709, // ondragend + 0xcb: 0xaf04, // ruby + 0xcc: 0xc01, // p + 0xcd: 0x31707, // onclose + 0xce: 0x24205, // meter + 0xcf: 0x11807, // bgsound + 0xd2: 0x25106, // height + 0xd4: 0x101, // b + 0xd5: 0x2c308, // itemtype + 0xd8: 0x1bb07, // caption + 0xd9: 0x10c08, // disabled + 0xdb: 0x33808, // menuitem + 0xdc: 0x62003, // svg + 0xdd: 0x18f05, // small + 0xde: 0x44a04, // data + 0xe0: 0x4cb08, // ononline + 0xe1: 0x2a206, // mglyph + 0xe3: 0x6505, // embed + 0xe4: 0x10502, // tr + 0xe5: 0x46b0b, // onloadstart + 0xe7: 0x3c306, // srcdoc + 0xeb: 0x5c408, // ontoggle + 0xed: 0xe703, // bdo + 0xee: 0x4702, // td + 0xef: 0x8305, // aside + 0xf0: 0x29402, // h2 + 0xf1: 0x52c08, // progress + 0xf2: 0x12c0a, // blockquote + 0xf4: 0xf005, // label + 0xf5: 0x601, // i + 0xf7: 0x9207, // rowspan + 0xfb: 0x51709, // onplaying + 0xfd: 0x2a103, // img + 0xfe: 0xf608, // optgroup + 0xff: 0x42307, // content + 0x101: 0x53e0c, // onratechange + 0x103: 0x3da0c, // onhashchange + 0x104: 0x4807, // details + 0x106: 0x40008, // download + 0x109: 0x14009, // translate + 0x10b: 0x4230f, // contenteditable + 0x10d: 0x36b0b, // ondragleave + 0x10e: 0x2106, // accept + 0x10f: 0x57a08, // selected + 0x112: 0x1f20a, // formaction + 0x113: 0x5b506, // center + 0x115: 0x45510, // onloadedmetadata + 0x116: 0x12804, // link + 0x117: 0xdd04, // time + 0x118: 0x19f0b, // crossorigin + 0x119: 0x3bd07, // onfocus + 0x11a: 0x58704, // wrap + 0x11b: 0x42204, // icon + 0x11d: 0x28105, // video + 0x11e: 0x4de05, // class + 0x121: 0x5d40e, // onvolumechange + 0x122: 0xaa06, // onblur + 0x123: 0x2b909, // itemscope + 0x124: 0x61105, // style + 0x127: 0x41e06, // public + 0x129: 0x2320e, // formnovalidate + 0x12a: 0x58206, // onshow + 0x12c: 0x51706, // onplay + 0x12d: 0x3c804, // cite + 0x12e: 0x2bc02, // ms + 0x12f: 0xdb0c, // ontimeupdate + 0x130: 0x10904, // kind + 0x131: 0x2470a, // formtarget + 0x135: 0x3af07, // onended + 0x136: 0x26506, // hidden + 0x137: 0x2c01, // s + 0x139: 0x2280a, // formmethod + 0x13a: 0x3e805, // input + 0x13c: 0x50b02, // h6 + 0x13d: 0xc902, // ol + 0x13e: 0x3420b, // oncuechange + 0x13f: 0x1e50d, // foreignobject + 0x143: 0x4e70e, // onbeforeunload + 0x144: 0x2bd05, // scope + 0x145: 0x39609, // onemptied + 0x146: 0x14b05, // defer + 0x147: 0xc103, // xmp + 0x148: 0x39f10, // ondurationchange + 0x149: 0x1903, // kbd + 0x14c: 0x47609, // onmessage + 0x14d: 0x60006, // option + 0x14e: 0x2eb09, // minlength + 0x14f: 0x32807, // checked + 0x150: 0xce08, // autoplay + 0x152: 0x202, // br + 0x153: 0x2360a, // novalidate + 0x156: 0x6307, // noembed + 0x159: 0x31007, // onclick + 0x15a: 0x47f0b, // onmousedown + 0x15b: 0x3a708, // onchange + 0x15e: 0x3f209, // oninvalid + 0x15f: 0x2bd06, // scoped + 0x160: 0x18808, // controls + 0x161: 0x30b05, // muted + 0x162: 0x58d08, // sortable + 0x163: 0x51106, // usemap + 0x164: 0x1b80a, // figcaption + 0x165: 0x35706, // ondrag + 0x166: 0x26b04, // high + 0x168: 0x3c303, // src + 0x169: 0x15706, // poster + 0x16b: 0x1670e, // annotation-xml + 0x16c: 0x5f704, // step + 0x16d: 0x4, // abbr + 0x16e: 0x1b06, // dialog + 0x170: 0x1202, // li + 0x172: 0x3ed02, // mo + 0x175: 0x1d803, // for + 0x176: 0x1a803, // ins + 0x178: 0x55504, // size + 0x179: 0x43210, // onlanguagechange + 0x17a: 0x8607, // default + 0x17b: 0x1a03, // bdi + 0x17c: 0x4d30a, // onpagehide + 0x17d: 0x6907, // dirname + 0x17e: 0x21404, // type + 0x17f: 0x1f204, // form + 0x181: 0x28509, // oncanplay + 0x182: 0x6103, // dfn + 0x183: 0x46308, // tabindex + 0x186: 0x6502, // em + 0x187: 0x27404, // lang + 0x189: 0x39108, // dropzone + 0x18a: 0x4080a, // onkeypress + 0x18b: 0x23c08, // datetime + 0x18c: 0x16204, // cols + 0x18d: 0x1, // a + 0x18e: 0x4420c, // onloadeddata + 0x190: 0xa605, // audio + 0x192: 0x2e05, // tbody + 0x193: 0x22c06, // method + 0x195: 0xf404, // loop + 0x196: 0x29606, // iframe + 0x198: 0x2d504, // head + 0x19e: 0x5f108, // manifest + 0x19f: 0xb309, // autofocus + 0x1a0: 0x14904, // code + 0x1a1: 0x55906, // strong + 0x1a2: 0x30308, // multiple + 0x1a3: 0xc05, // param + 0x1a6: 0x21107, // enctype + 0x1a7: 0x5b304, // face + 0x1a8: 0xfd09, // plaintext + 0x1a9: 0x26e02, // h1 + 0x1aa: 0x59509, // onstalled + 0x1ad: 0x3d406, // script + 0x1ae: 0x2db06, // spacer + 0x1af: 0x55108, // onresize + 0x1b0: 0x4a20b, // onmouseover + 0x1b1: 0x5cc08, // onunload + 0x1b2: 0x56708, // onseeked + 0x1b4: 0x2140d, // typemustmatch + 0x1b5: 0x1cc06, // figure + 0x1b6: 0x4950a, // onmouseout + 0x1b7: 0x25e03, // pre + 0x1b8: 0x50705, // width + 0x1b9: 0x19906, // sorted + 0x1bb: 0x5704, // nobr + 0x1be: 0x5302, // tt + 0x1bf: 0x1105, // align + 0x1c0: 0x3e607, // oninput + 0x1c3: 0x41807, // onkeyup + 0x1c6: 0x1c00c, // onafterprint + 0x1c7: 0x210e, // accept-charset + 0x1c8: 0x33c06, // itemid + 0x1c9: 0x3e809, // inputmode + 0x1cb: 0x53306, // strike + 0x1cc: 0x5a903, // sub + 0x1cd: 0x10505, // track + 0x1ce: 0x38605, // start + 0x1d0: 0xd608, // basefont + 0x1d6: 0x1aa06, // source + 0x1d7: 0x18206, // legend + 0x1d8: 0x2d405, // thead + 0x1da: 0x8c05, // tfoot + 0x1dd: 0x1ec06, // object + 0x1de: 0x6e05, // media + 0x1df: 0x1670a, // annotation + 0x1e0: 0x20d0b, // formenctype + 0x1e2: 0x3d208, // noscript + 0x1e4: 0x55505, // sizes + 0x1e5: 0x1fc0c, // autocomplete + 0x1e6: 0x9504, // span + 0x1e7: 0x9808, // noframes + 0x1e8: 0x24b06, // target + 0x1e9: 0x38f06, // ondrop + 0x1ea: 0x2b306, // applet + 0x1ec: 0x5a08, // reversed + 0x1f0: 0x2a907, // isindex + 0x1f3: 0x27008, // hreflang + 0x1f5: 0x2f302, // h5 + 0x1f6: 0x4f307, // address + 0x1fa: 0x2e103, // max + 0x1fb: 0xc30b, // placeholder + 0x1fc: 0x2f608, // textarea + 0x1fe: 0x4ad09, // onmouseup + 0x1ff: 0x3800b, // ondragstart +} + +const atomText = "abbradiogrouparamalignmarkbdialogaccept-charsetbodyaccesskey" + + "genavaluealtdetailsampatternobreversedfnoembedirnamediagroup" + + "ingasyncanvasidefaultfooterowspanoframesetitleaudionblurubya" + + "utofocusandboxmplaceholderautoplaybasefontimeupdatebdoncance" + + "labelooptgrouplaintextrackindisabledivarbgsoundlowbrbigblink" + + "blockquotebuttonabortranslatecodefercolgroupostercolorcolspa" + + "nnotation-xmlcommandraggablegendcontrolsmallcoordsortedcross" + + "originsourcefieldsetfigcaptionafterprintfigurequiredforeignO" + + "bjectforeignobjectformactionautocompleteerrorformenctypemust" + + "matchallengeformmethodformnovalidatetimeterformtargetheightm" + + "lhgroupreloadhiddenhigh1hreflanghttp-equivideoncanplaythroug" + + "h2iframeimageimglyph3isindexismappletitemscopeditemtypemarqu" + + "eematheaderspacermaxlength4minlength5mtextareadonlymultiplem" + + "utedonclickoncloseamlesspellcheckedoncontextmenuitemidoncuec" + + "hangeondblclickondragendondragenterondragleaveondragoverondr" + + "agstarticleondropzonemptiedondurationchangeonendedonerroronf" + + "ocusrcdocitempropenoscriptonhashchangeoninputmodeloninvalido" + + "nkeydownloadonkeypressrclangonkeyupublicontenteditableonlang" + + "uagechangeonloadeddatalistingonloadedmetadatabindexonloadsta" + + "rtonmessageonmousedownonmousemoveonmouseoutputonmouseoveronm" + + "ouseuponmousewheelonofflineononlineonpagehidesclassectionbef" + + "oreunloaddresshapeonpageshowidth6onpausemaponplayingonpopsta" + + "teonprogresstrikeytypeonratechangeonresetonresizestrongonscr" + + "ollonseekedonseekingonselectedonshowraponsortableonstalledon" + + "storageonsubmitemrefacenteronsuspendontoggleonunloadonvolume" + + "changeonwaitingoptimumanifestepromptoptionbeforeprintstylesu" + + "mmarysupsvgsystemplate" diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/charset.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/charset.go new file mode 100644 index 00000000..13bed159 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/charset.go @@ -0,0 +1,257 @@ +// 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. + +// Package charset provides common text encodings for HTML documents. +// +// The mapping from encoding labels to encodings is defined at +// https://encoding.spec.whatwg.org/. +package charset // import "golang.org/x/net/html/charset" + +import ( + "bytes" + "fmt" + "io" + "mime" + "strings" + "unicode/utf8" + + "golang.org/x/net/html" + "golang.org/x/text/encoding" + "golang.org/x/text/encoding/charmap" + "golang.org/x/text/encoding/htmlindex" + "golang.org/x/text/transform" +) + +// Lookup returns the encoding with the specified label, and its canonical +// name. It returns nil and the empty string if label is not one of the +// standard encodings for HTML. Matching is case-insensitive and ignores +// leading and trailing whitespace. Encoders will use HTML escape sequences for +// runes that are not supported by the character set. +func Lookup(label string) (e encoding.Encoding, name string) { + e, err := htmlindex.Get(label) + if err != nil { + return nil, "" + } + name, _ = htmlindex.Name(e) + return &htmlEncoding{e}, name +} + +type htmlEncoding struct{ encoding.Encoding } + +func (h *htmlEncoding) NewEncoder() *encoding.Encoder { + // HTML requires a non-terminating legacy encoder. We use HTML escapes to + // substitute unsupported code points. + return encoding.HTMLEscapeUnsupported(h.Encoding.NewEncoder()) +} + +// DetermineEncoding determines the encoding of an HTML document by examining +// up to the first 1024 bytes of content and the declared Content-Type. +// +// See http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#determining-the-character-encoding +func DetermineEncoding(content []byte, contentType string) (e encoding.Encoding, name string, certain bool) { + if len(content) > 1024 { + content = content[:1024] + } + + for _, b := range boms { + if bytes.HasPrefix(content, b.bom) { + e, name = Lookup(b.enc) + return e, name, true + } + } + + if _, params, err := mime.ParseMediaType(contentType); err == nil { + if cs, ok := params["charset"]; ok { + if e, name = Lookup(cs); e != nil { + return e, name, true + } + } + } + + if len(content) > 0 { + e, name = prescan(content) + if e != nil { + return e, name, false + } + } + + // Try to detect UTF-8. + // First eliminate any partial rune at the end. + for i := len(content) - 1; i >= 0 && i > len(content)-4; i-- { + b := content[i] + if b < 0x80 { + break + } + if utf8.RuneStart(b) { + content = content[:i] + break + } + } + hasHighBit := false + for _, c := range content { + if c >= 0x80 { + hasHighBit = true + break + } + } + if hasHighBit && utf8.Valid(content) { + return encoding.Nop, "utf-8", false + } + + // TODO: change default depending on user's locale? + return charmap.Windows1252, "windows-1252", false +} + +// NewReader returns an io.Reader that converts the content of r to UTF-8. +// It calls DetermineEncoding to find out what r's encoding is. +func NewReader(r io.Reader, contentType string) (io.Reader, error) { + preview := make([]byte, 1024) + n, err := io.ReadFull(r, preview) + switch { + case err == io.ErrUnexpectedEOF: + preview = preview[:n] + r = bytes.NewReader(preview) + case err != nil: + return nil, err + default: + r = io.MultiReader(bytes.NewReader(preview), r) + } + + if e, _, _ := DetermineEncoding(preview, contentType); e != encoding.Nop { + r = transform.NewReader(r, e.NewDecoder()) + } + return r, nil +} + +// NewReaderLabel returns a reader that converts from the specified charset to +// UTF-8. It uses Lookup to find the encoding that corresponds to label, and +// returns an error if Lookup returns nil. It is suitable for use as +// encoding/xml.Decoder's CharsetReader function. +func NewReaderLabel(label string, input io.Reader) (io.Reader, error) { + e, _ := Lookup(label) + if e == nil { + return nil, fmt.Errorf("unsupported charset: %q", label) + } + return transform.NewReader(input, e.NewDecoder()), nil +} + +func prescan(content []byte) (e encoding.Encoding, name string) { + z := html.NewTokenizer(bytes.NewReader(content)) + for { + switch z.Next() { + case html.ErrorToken: + return nil, "" + + case html.StartTagToken, html.SelfClosingTagToken: + tagName, hasAttr := z.TagName() + if !bytes.Equal(tagName, []byte("meta")) { + continue + } + attrList := make(map[string]bool) + gotPragma := false + + const ( + dontKnow = iota + doNeedPragma + doNotNeedPragma + ) + needPragma := dontKnow + + name = "" + e = nil + for hasAttr { + var key, val []byte + key, val, hasAttr = z.TagAttr() + ks := string(key) + if attrList[ks] { + continue + } + attrList[ks] = true + for i, c := range val { + if 'A' <= c && c <= 'Z' { + val[i] = c + 0x20 + } + } + + switch ks { + case "http-equiv": + if bytes.Equal(val, []byte("content-type")) { + gotPragma = true + } + + case "content": + if e == nil { + name = fromMetaElement(string(val)) + if name != "" { + e, name = Lookup(name) + if e != nil { + needPragma = doNeedPragma + } + } + } + + case "charset": + e, name = Lookup(string(val)) + needPragma = doNotNeedPragma + } + } + + if needPragma == dontKnow || needPragma == doNeedPragma && !gotPragma { + continue + } + + if strings.HasPrefix(name, "utf-16") { + name = "utf-8" + e = encoding.Nop + } + + if e != nil { + return e, name + } + } + } +} + +func fromMetaElement(s string) string { + for s != "" { + csLoc := strings.Index(s, "charset") + if csLoc == -1 { + return "" + } + s = s[csLoc+len("charset"):] + s = strings.TrimLeft(s, " \t\n\f\r") + if !strings.HasPrefix(s, "=") { + continue + } + s = s[1:] + s = strings.TrimLeft(s, " \t\n\f\r") + if s == "" { + return "" + } + if q := s[0]; q == '"' || q == '\'' { + s = s[1:] + closeQuote := strings.IndexRune(s, rune(q)) + if closeQuote == -1 { + return "" + } + return s[:closeQuote] + } + + end := strings.IndexAny(s, "; \t\n\f\r") + if end == -1 { + end = len(s) + } + return s[:end] + } + return "" +} + +var boms = []struct { + bom []byte + enc string +}{ + {[]byte{0xfe, 0xff}, "utf-16be"}, + {[]byte{0xff, 0xfe}, "utf-16le"}, + {[]byte{0xef, 0xbb, 0xbf}, "utf-8"}, +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html new file mode 100644 index 00000000..9915fa0e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html @@ -0,0 +1,48 @@ + + + + HTTP charset + + + + + + + + + + + +

HTTP charset

+ + +
+ + +
 
+ + + + + +
+

The character encoding of a page can be set using the HTTP header charset declaration.

+

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

The only character encoding declaration for this HTML file is in the HTTP header, which sets the encoding to ISO 8859-15.

+
+
+
HTML5
+

the-input-byte-stream-001
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html new file mode 100644 index 00000000..26e5d8b4 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html @@ -0,0 +1,48 @@ + + + + HTTP vs UTF-8 BOM + + + + + + + + + + + +

HTTP vs UTF-8 BOM

+ + +
+ + +
 
+ + + + + +
+

A character encoding set in the HTTP header has lower precedence than the UTF-8 signature.

+

The HTTP header attempts to set the character encoding to ISO 8859-15. The page starts with a UTF-8 signature.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

If the test is unsuccessful, the characters  should appear at the top of the page. These represent the bytes that make up the UTF-8 signature when encountered in the ISO 8859-15 encoding.

+
+
+
HTML5
+

the-input-byte-stream-034
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html new file mode 100644 index 00000000..2f07e951 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html @@ -0,0 +1,49 @@ + + + + HTTP vs meta charset + + + + + + + + + + + +

HTTP vs meta charset

+ + +
+ + +
 
+ + + + + +
+

The HTTP header has a higher precedence than an encoding declaration in a meta charset attribute.

+

The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-1.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-018
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html new file mode 100644 index 00000000..6853cdde --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html @@ -0,0 +1,49 @@ + + + + HTTP vs meta content + + + + + + + + + + + +

HTTP vs meta content

+ + +
+ + +
 
+ + + + + +
+

The HTTP header has a higher precedence than an encoding declaration in a meta content attribute.

+

The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-1.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-016
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html new file mode 100644 index 00000000..612e26c6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html @@ -0,0 +1,47 @@ + + + + No encoding declaration + + + + + + + + + + + +

No encoding declaration

+ + +
+ + +
 
+ + + + + +
+

A page with no encoding information in HTTP, BOM, XML declaration or meta element will be treated as UTF-8.

+

The test on this page contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-015
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/README b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/README new file mode 100644 index 00000000..38ef0f9f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/README @@ -0,0 +1,9 @@ +These test cases come from +http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics + +Distributed under both the W3C Test Suite License +(http://www.w3.org/Consortium/Legal/2008/04-testsuite-license) +and the W3C 3-clause BSD License +(http://www.w3.org/Consortium/Legal/2008/03-bsd-license). +To contribute to a W3C Test Suite, see the policies and contribution +forms (http://www.w3.org/2004/10/27-testcases). diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html new file mode 100644 index 00000000..3abf7a93 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html differ diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html new file mode 100644 index 00000000..76254c98 Binary files /dev/null and b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html differ diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html new file mode 100644 index 00000000..83de4333 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html @@ -0,0 +1,49 @@ + + + + UTF-8 BOM vs meta charset + + + + + + + + + + + +

UTF-8 BOM vs meta charset

+ + +
+ + +
 
+ + + + + +
+

A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta charset attribute declares a different encoding.

+

The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-038
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html new file mode 100644 index 00000000..501aac2d --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html @@ -0,0 +1,48 @@ + + + + UTF-8 BOM vs meta content + + + + + + + + + + + +

UTF-8 BOM vs meta content

+ + +
+ + +
 
+ + + + + +
+

A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta content attribute declares a different encoding.

+

The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-037
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html new file mode 100644 index 00000000..2d7d25ab --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html @@ -0,0 +1,48 @@ + + + + meta charset attribute + + + + + + + + + + + +

meta charset attribute

+ + +
+ + +
 
+ + + + + +
+

The character encoding of the page can be set by a meta element with charset attribute.

+

The only character encoding declaration for this HTML file is in the charset attribute of the meta element, which declares the encoding to be ISO 8859-15.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-009
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html new file mode 100644 index 00000000..1c3f228e --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html @@ -0,0 +1,48 @@ + + + + meta content attribute + + + + + + + + + + + +

meta content attribute

+ + +
+ + +
 
+ + + + + +
+

The character encoding of the page can be set by a meta element with http-equiv and content attributes.

+

The only character encoding declaration for this HTML file is in the content attribute of the meta element, which declares the encoding to be ISO 8859-15.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-007
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/const.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/const.go new file mode 100644 index 00000000..52f651ff --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/const.go @@ -0,0 +1,102 @@ +// Copyright 2011 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. + +package html + +// Section 12.2.3.2 of the HTML5 specification says "The following elements +// have varying levels of special parsing rules". +// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements +var isSpecialElementMap = map[string]bool{ + "address": true, + "applet": true, + "area": true, + "article": true, + "aside": true, + "base": true, + "basefont": true, + "bgsound": true, + "blockquote": true, + "body": true, + "br": true, + "button": true, + "caption": true, + "center": true, + "col": true, + "colgroup": true, + "dd": true, + "details": true, + "dir": true, + "div": true, + "dl": true, + "dt": true, + "embed": true, + "fieldset": true, + "figcaption": true, + "figure": true, + "footer": true, + "form": true, + "frame": true, + "frameset": true, + "h1": true, + "h2": true, + "h3": true, + "h4": true, + "h5": true, + "h6": true, + "head": true, + "header": true, + "hgroup": true, + "hr": true, + "html": true, + "iframe": true, + "img": true, + "input": true, + "isindex": true, + "li": true, + "link": true, + "listing": true, + "marquee": true, + "menu": true, + "meta": true, + "nav": true, + "noembed": true, + "noframes": true, + "noscript": true, + "object": true, + "ol": true, + "p": true, + "param": true, + "plaintext": true, + "pre": true, + "script": true, + "section": true, + "select": true, + "source": true, + "style": true, + "summary": true, + "table": true, + "tbody": true, + "td": true, + "template": true, + "textarea": true, + "tfoot": true, + "th": true, + "thead": true, + "title": true, + "tr": true, + "track": true, + "ul": true, + "wbr": true, + "xmp": true, +} + +func isSpecialElement(element *Node) bool { + switch element.Namespace { + case "", "html": + return isSpecialElementMap[element.Data] + case "svg": + return element.Data == "foreignObject" + } + return false +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/doc.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/doc.go new file mode 100644 index 00000000..94f49687 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/doc.go @@ -0,0 +1,106 @@ +// Copyright 2010 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. + +/* +Package html implements an HTML5-compliant tokenizer and parser. + +Tokenization is done by creating a Tokenizer for an io.Reader r. It is the +caller's responsibility to ensure that r provides UTF-8 encoded HTML. + + z := html.NewTokenizer(r) + +Given a Tokenizer z, the HTML is tokenized by repeatedly calling z.Next(), +which parses the next token and returns its type, or an error: + + for { + tt := z.Next() + if tt == html.ErrorToken { + // ... + return ... + } + // Process the current token. + } + +There are two APIs for retrieving the current token. The high-level API is to +call Token; the low-level API is to call Text or TagName / TagAttr. Both APIs +allow optionally calling Raw after Next but before Token, Text, TagName, or +TagAttr. In EBNF notation, the valid call sequence per token is: + + Next {Raw} [ Token | Text | TagName {TagAttr} ] + +Token returns an independent data structure that completely describes a token. +Entities (such as "<") are unescaped, tag names and attribute keys are +lower-cased, and attributes are collected into a []Attribute. For example: + + for { + if z.Next() == html.ErrorToken { + // Returning io.EOF indicates success. + return z.Err() + } + emitToken(z.Token()) + } + +The low-level API performs fewer allocations and copies, but the contents of +the []byte values returned by Text, TagName and TagAttr may change on the next +call to Next. For example, to extract an HTML page's anchor text: + + depth := 0 + for { + tt := z.Next() + switch tt { + case ErrorToken: + return z.Err() + case TextToken: + if depth > 0 { + // emitBytes should copy the []byte it receives, + // if it doesn't process it immediately. + emitBytes(z.Text()) + } + case StartTagToken, EndTagToken: + tn, _ := z.TagName() + if len(tn) == 1 && tn[0] == 'a' { + if tt == StartTagToken { + depth++ + } else { + depth-- + } + } + } + } + +Parsing is done by calling Parse with an io.Reader, which returns the root of +the parse tree (the document element) as a *Node. It is the caller's +responsibility to ensure that the Reader provides UTF-8 encoded HTML. For +example, to process each anchor node in depth-first order: + + doc, err := html.Parse(r) + if err != nil { + // ... + } + var f func(*html.Node) + f = func(n *html.Node) { + if n.Type == html.ElementNode && n.Data == "a" { + // Do something with n... + } + for c := n.FirstChild; c != nil; c = c.NextSibling { + f(c) + } + } + f(doc) + +The relevant specifications include: +https://html.spec.whatwg.org/multipage/syntax.html and +https://html.spec.whatwg.org/multipage/syntax.html#tokenization +*/ +package html // import "golang.org/x/net/html" + +// The tokenization algorithm implemented by this package is not a line-by-line +// transliteration of the relatively verbose state-machine in the WHATWG +// specification. A more direct approach is used instead, where the program +// counter implies the state, such as whether it is tokenizing a tag or a text +// node. Specification compliance is verified by checking expected and actual +// outputs over a test suite rather than aiming for algorithmic fidelity. + +// TODO(nigeltao): Does a DOM API belong in this package or a separate one? +// TODO(nigeltao): How does parsing interact with a JavaScript engine? diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/doctype.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/doctype.go new file mode 100644 index 00000000..c484e5a9 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/doctype.go @@ -0,0 +1,156 @@ +// Copyright 2011 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. + +package html + +import ( + "strings" +) + +// parseDoctype parses the data from a DoctypeToken into a name, +// public identifier, and system identifier. It returns a Node whose Type +// is DoctypeNode, whose Data is the name, and which has attributes +// named "system" and "public" for the two identifiers if they were present. +// quirks is whether the document should be parsed in "quirks mode". +func parseDoctype(s string) (n *Node, quirks bool) { + n = &Node{Type: DoctypeNode} + + // Find the name. + space := strings.IndexAny(s, whitespace) + if space == -1 { + space = len(s) + } + n.Data = s[:space] + // The comparison to "html" is case-sensitive. + if n.Data != "html" { + quirks = true + } + n.Data = strings.ToLower(n.Data) + s = strings.TrimLeft(s[space:], whitespace) + + if len(s) < 6 { + // It can't start with "PUBLIC" or "SYSTEM". + // Ignore the rest of the string. + return n, quirks || s != "" + } + + key := strings.ToLower(s[:6]) + s = s[6:] + for key == "public" || key == "system" { + s = strings.TrimLeft(s, whitespace) + if s == "" { + break + } + quote := s[0] + if quote != '"' && quote != '\'' { + break + } + s = s[1:] + q := strings.IndexRune(s, rune(quote)) + var id string + if q == -1 { + id = s + s = "" + } else { + id = s[:q] + s = s[q+1:] + } + n.Attr = append(n.Attr, Attribute{Key: key, Val: id}) + if key == "public" { + key = "system" + } else { + key = "" + } + } + + if key != "" || s != "" { + quirks = true + } else if len(n.Attr) > 0 { + if n.Attr[0].Key == "public" { + public := strings.ToLower(n.Attr[0].Val) + switch public { + case "-//w3o//dtd w3 html strict 3.0//en//", "-/w3d/dtd html 4.0 transitional/en", "html": + quirks = true + default: + for _, q := range quirkyIDs { + if strings.HasPrefix(public, q) { + quirks = true + break + } + } + } + // The following two public IDs only cause quirks mode if there is no system ID. + if len(n.Attr) == 1 && (strings.HasPrefix(public, "-//w3c//dtd html 4.01 frameset//") || + strings.HasPrefix(public, "-//w3c//dtd html 4.01 transitional//")) { + quirks = true + } + } + if lastAttr := n.Attr[len(n.Attr)-1]; lastAttr.Key == "system" && + strings.ToLower(lastAttr.Val) == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" { + quirks = true + } + } + + return n, quirks +} + +// quirkyIDs is a list of public doctype identifiers that cause a document +// to be interpreted in quirks mode. The identifiers should be in lower case. +var quirkyIDs = []string{ + "+//silmaril//dtd html pro v0r11 19970101//", + "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", + "-//as//dtd html 3.0 aswedit + extensions//", + "-//ietf//dtd html 2.0 level 1//", + "-//ietf//dtd html 2.0 level 2//", + "-//ietf//dtd html 2.0 strict level 1//", + "-//ietf//dtd html 2.0 strict level 2//", + "-//ietf//dtd html 2.0 strict//", + "-//ietf//dtd html 2.0//", + "-//ietf//dtd html 2.1e//", + "-//ietf//dtd html 3.0//", + "-//ietf//dtd html 3.2 final//", + "-//ietf//dtd html 3.2//", + "-//ietf//dtd html 3//", + "-//ietf//dtd html level 0//", + "-//ietf//dtd html level 1//", + "-//ietf//dtd html level 2//", + "-//ietf//dtd html level 3//", + "-//ietf//dtd html strict level 0//", + "-//ietf//dtd html strict level 1//", + "-//ietf//dtd html strict level 2//", + "-//ietf//dtd html strict level 3//", + "-//ietf//dtd html strict//", + "-//ietf//dtd html//", + "-//metrius//dtd metrius presentational//", + "-//microsoft//dtd internet explorer 2.0 html strict//", + "-//microsoft//dtd internet explorer 2.0 html//", + "-//microsoft//dtd internet explorer 2.0 tables//", + "-//microsoft//dtd internet explorer 3.0 html strict//", + "-//microsoft//dtd internet explorer 3.0 html//", + "-//microsoft//dtd internet explorer 3.0 tables//", + "-//netscape comm. corp.//dtd html//", + "-//netscape comm. corp.//dtd strict html//", + "-//o'reilly and associates//dtd html 2.0//", + "-//o'reilly and associates//dtd html extended 1.0//", + "-//o'reilly and associates//dtd html extended relaxed 1.0//", + "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", + "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", + "-//spyglass//dtd html 2.0 extended//", + "-//sq//dtd html 2.0 hotmetal + extensions//", + "-//sun microsystems corp.//dtd hotjava html//", + "-//sun microsystems corp.//dtd hotjava strict html//", + "-//w3c//dtd html 3 1995-03-24//", + "-//w3c//dtd html 3.2 draft//", + "-//w3c//dtd html 3.2 final//", + "-//w3c//dtd html 3.2//", + "-//w3c//dtd html 3.2s draft//", + "-//w3c//dtd html 4.0 frameset//", + "-//w3c//dtd html 4.0 transitional//", + "-//w3c//dtd html experimental 19960712//", + "-//w3c//dtd html experimental 970421//", + "-//w3c//dtd w3 html//", + "-//w3o//dtd w3 html 3.0//", + "-//webtechs//dtd mozilla html 2.0//", + "-//webtechs//dtd mozilla html//", +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/entity.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/entity.go new file mode 100644 index 00000000..a50c04c6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/entity.go @@ -0,0 +1,2253 @@ +// Copyright 2010 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. + +package html + +// All entities that do not end with ';' are 6 or fewer bytes long. +const longestEntityWithoutSemicolon = 6 + +// entity is a map from HTML entity names to their values. The semicolon matters: +// https://html.spec.whatwg.org/multipage/syntax.html#named-character-references +// lists both "amp" and "amp;" as two separate entries. +// +// Note that the HTML5 list is larger than the HTML4 list at +// http://www.w3.org/TR/html4/sgml/entities.html +var entity = map[string]rune{ + "AElig;": '\U000000C6', + "AMP;": '\U00000026', + "Aacute;": '\U000000C1', + "Abreve;": '\U00000102', + "Acirc;": '\U000000C2', + "Acy;": '\U00000410', + "Afr;": '\U0001D504', + "Agrave;": '\U000000C0', + "Alpha;": '\U00000391', + "Amacr;": '\U00000100', + "And;": '\U00002A53', + "Aogon;": '\U00000104', + "Aopf;": '\U0001D538', + "ApplyFunction;": '\U00002061', + "Aring;": '\U000000C5', + "Ascr;": '\U0001D49C', + "Assign;": '\U00002254', + "Atilde;": '\U000000C3', + "Auml;": '\U000000C4', + "Backslash;": '\U00002216', + "Barv;": '\U00002AE7', + "Barwed;": '\U00002306', + "Bcy;": '\U00000411', + "Because;": '\U00002235', + "Bernoullis;": '\U0000212C', + "Beta;": '\U00000392', + "Bfr;": '\U0001D505', + "Bopf;": '\U0001D539', + "Breve;": '\U000002D8', + "Bscr;": '\U0000212C', + "Bumpeq;": '\U0000224E', + "CHcy;": '\U00000427', + "COPY;": '\U000000A9', + "Cacute;": '\U00000106', + "Cap;": '\U000022D2', + "CapitalDifferentialD;": '\U00002145', + "Cayleys;": '\U0000212D', + "Ccaron;": '\U0000010C', + "Ccedil;": '\U000000C7', + "Ccirc;": '\U00000108', + "Cconint;": '\U00002230', + "Cdot;": '\U0000010A', + "Cedilla;": '\U000000B8', + "CenterDot;": '\U000000B7', + "Cfr;": '\U0000212D', + "Chi;": '\U000003A7', + "CircleDot;": '\U00002299', + "CircleMinus;": '\U00002296', + "CirclePlus;": '\U00002295', + "CircleTimes;": '\U00002297', + "ClockwiseContourIntegral;": '\U00002232', + "CloseCurlyDoubleQuote;": '\U0000201D', + "CloseCurlyQuote;": '\U00002019', + "Colon;": '\U00002237', + "Colone;": '\U00002A74', + "Congruent;": '\U00002261', + "Conint;": '\U0000222F', + "ContourIntegral;": '\U0000222E', + "Copf;": '\U00002102', + "Coproduct;": '\U00002210', + "CounterClockwiseContourIntegral;": '\U00002233', + "Cross;": '\U00002A2F', + "Cscr;": '\U0001D49E', + "Cup;": '\U000022D3', + "CupCap;": '\U0000224D', + "DD;": '\U00002145', + "DDotrahd;": '\U00002911', + "DJcy;": '\U00000402', + "DScy;": '\U00000405', + "DZcy;": '\U0000040F', + "Dagger;": '\U00002021', + "Darr;": '\U000021A1', + "Dashv;": '\U00002AE4', + "Dcaron;": '\U0000010E', + "Dcy;": '\U00000414', + "Del;": '\U00002207', + "Delta;": '\U00000394', + "Dfr;": '\U0001D507', + "DiacriticalAcute;": '\U000000B4', + "DiacriticalDot;": '\U000002D9', + "DiacriticalDoubleAcute;": '\U000002DD', + "DiacriticalGrave;": '\U00000060', + "DiacriticalTilde;": '\U000002DC', + "Diamond;": '\U000022C4', + "DifferentialD;": '\U00002146', + "Dopf;": '\U0001D53B', + "Dot;": '\U000000A8', + "DotDot;": '\U000020DC', + "DotEqual;": '\U00002250', + "DoubleContourIntegral;": '\U0000222F', + "DoubleDot;": '\U000000A8', + "DoubleDownArrow;": '\U000021D3', + "DoubleLeftArrow;": '\U000021D0', + "DoubleLeftRightArrow;": '\U000021D4', + "DoubleLeftTee;": '\U00002AE4', + "DoubleLongLeftArrow;": '\U000027F8', + "DoubleLongLeftRightArrow;": '\U000027FA', + "DoubleLongRightArrow;": '\U000027F9', + "DoubleRightArrow;": '\U000021D2', + "DoubleRightTee;": '\U000022A8', + "DoubleUpArrow;": '\U000021D1', + "DoubleUpDownArrow;": '\U000021D5', + "DoubleVerticalBar;": '\U00002225', + "DownArrow;": '\U00002193', + "DownArrowBar;": '\U00002913', + "DownArrowUpArrow;": '\U000021F5', + "DownBreve;": '\U00000311', + "DownLeftRightVector;": '\U00002950', + "DownLeftTeeVector;": '\U0000295E', + "DownLeftVector;": '\U000021BD', + "DownLeftVectorBar;": '\U00002956', + "DownRightTeeVector;": '\U0000295F', + "DownRightVector;": '\U000021C1', + "DownRightVectorBar;": '\U00002957', + "DownTee;": '\U000022A4', + "DownTeeArrow;": '\U000021A7', + "Downarrow;": '\U000021D3', + "Dscr;": '\U0001D49F', + "Dstrok;": '\U00000110', + "ENG;": '\U0000014A', + "ETH;": '\U000000D0', + "Eacute;": '\U000000C9', + "Ecaron;": '\U0000011A', + "Ecirc;": '\U000000CA', + "Ecy;": '\U0000042D', + "Edot;": '\U00000116', + "Efr;": '\U0001D508', + "Egrave;": '\U000000C8', + "Element;": '\U00002208', + "Emacr;": '\U00000112', + "EmptySmallSquare;": '\U000025FB', + "EmptyVerySmallSquare;": '\U000025AB', + "Eogon;": '\U00000118', + "Eopf;": '\U0001D53C', + "Epsilon;": '\U00000395', + "Equal;": '\U00002A75', + "EqualTilde;": '\U00002242', + "Equilibrium;": '\U000021CC', + "Escr;": '\U00002130', + "Esim;": '\U00002A73', + "Eta;": '\U00000397', + "Euml;": '\U000000CB', + "Exists;": '\U00002203', + "ExponentialE;": '\U00002147', + "Fcy;": '\U00000424', + "Ffr;": '\U0001D509', + "FilledSmallSquare;": '\U000025FC', + "FilledVerySmallSquare;": '\U000025AA', + "Fopf;": '\U0001D53D', + "ForAll;": '\U00002200', + "Fouriertrf;": '\U00002131', + "Fscr;": '\U00002131', + "GJcy;": '\U00000403', + "GT;": '\U0000003E', + "Gamma;": '\U00000393', + "Gammad;": '\U000003DC', + "Gbreve;": '\U0000011E', + "Gcedil;": '\U00000122', + "Gcirc;": '\U0000011C', + "Gcy;": '\U00000413', + "Gdot;": '\U00000120', + "Gfr;": '\U0001D50A', + "Gg;": '\U000022D9', + "Gopf;": '\U0001D53E', + "GreaterEqual;": '\U00002265', + "GreaterEqualLess;": '\U000022DB', + "GreaterFullEqual;": '\U00002267', + "GreaterGreater;": '\U00002AA2', + "GreaterLess;": '\U00002277', + "GreaterSlantEqual;": '\U00002A7E', + "GreaterTilde;": '\U00002273', + "Gscr;": '\U0001D4A2', + "Gt;": '\U0000226B', + "HARDcy;": '\U0000042A', + "Hacek;": '\U000002C7', + "Hat;": '\U0000005E', + "Hcirc;": '\U00000124', + "Hfr;": '\U0000210C', + "HilbertSpace;": '\U0000210B', + "Hopf;": '\U0000210D', + "HorizontalLine;": '\U00002500', + "Hscr;": '\U0000210B', + "Hstrok;": '\U00000126', + "HumpDownHump;": '\U0000224E', + "HumpEqual;": '\U0000224F', + "IEcy;": '\U00000415', + "IJlig;": '\U00000132', + "IOcy;": '\U00000401', + "Iacute;": '\U000000CD', + "Icirc;": '\U000000CE', + "Icy;": '\U00000418', + "Idot;": '\U00000130', + "Ifr;": '\U00002111', + "Igrave;": '\U000000CC', + "Im;": '\U00002111', + "Imacr;": '\U0000012A', + "ImaginaryI;": '\U00002148', + "Implies;": '\U000021D2', + "Int;": '\U0000222C', + "Integral;": '\U0000222B', + "Intersection;": '\U000022C2', + "InvisibleComma;": '\U00002063', + "InvisibleTimes;": '\U00002062', + "Iogon;": '\U0000012E', + "Iopf;": '\U0001D540', + "Iota;": '\U00000399', + "Iscr;": '\U00002110', + "Itilde;": '\U00000128', + "Iukcy;": '\U00000406', + "Iuml;": '\U000000CF', + "Jcirc;": '\U00000134', + "Jcy;": '\U00000419', + "Jfr;": '\U0001D50D', + "Jopf;": '\U0001D541', + "Jscr;": '\U0001D4A5', + "Jsercy;": '\U00000408', + "Jukcy;": '\U00000404', + "KHcy;": '\U00000425', + "KJcy;": '\U0000040C', + "Kappa;": '\U0000039A', + "Kcedil;": '\U00000136', + "Kcy;": '\U0000041A', + "Kfr;": '\U0001D50E', + "Kopf;": '\U0001D542', + "Kscr;": '\U0001D4A6', + "LJcy;": '\U00000409', + "LT;": '\U0000003C', + "Lacute;": '\U00000139', + "Lambda;": '\U0000039B', + "Lang;": '\U000027EA', + "Laplacetrf;": '\U00002112', + "Larr;": '\U0000219E', + "Lcaron;": '\U0000013D', + "Lcedil;": '\U0000013B', + "Lcy;": '\U0000041B', + "LeftAngleBracket;": '\U000027E8', + "LeftArrow;": '\U00002190', + "LeftArrowBar;": '\U000021E4', + "LeftArrowRightArrow;": '\U000021C6', + "LeftCeiling;": '\U00002308', + "LeftDoubleBracket;": '\U000027E6', + "LeftDownTeeVector;": '\U00002961', + "LeftDownVector;": '\U000021C3', + "LeftDownVectorBar;": '\U00002959', + "LeftFloor;": '\U0000230A', + "LeftRightArrow;": '\U00002194', + "LeftRightVector;": '\U0000294E', + "LeftTee;": '\U000022A3', + "LeftTeeArrow;": '\U000021A4', + "LeftTeeVector;": '\U0000295A', + "LeftTriangle;": '\U000022B2', + "LeftTriangleBar;": '\U000029CF', + "LeftTriangleEqual;": '\U000022B4', + "LeftUpDownVector;": '\U00002951', + "LeftUpTeeVector;": '\U00002960', + "LeftUpVector;": '\U000021BF', + "LeftUpVectorBar;": '\U00002958', + "LeftVector;": '\U000021BC', + "LeftVectorBar;": '\U00002952', + "Leftarrow;": '\U000021D0', + "Leftrightarrow;": '\U000021D4', + "LessEqualGreater;": '\U000022DA', + "LessFullEqual;": '\U00002266', + "LessGreater;": '\U00002276', + "LessLess;": '\U00002AA1', + "LessSlantEqual;": '\U00002A7D', + "LessTilde;": '\U00002272', + "Lfr;": '\U0001D50F', + "Ll;": '\U000022D8', + "Lleftarrow;": '\U000021DA', + "Lmidot;": '\U0000013F', + "LongLeftArrow;": '\U000027F5', + "LongLeftRightArrow;": '\U000027F7', + "LongRightArrow;": '\U000027F6', + "Longleftarrow;": '\U000027F8', + "Longleftrightarrow;": '\U000027FA', + "Longrightarrow;": '\U000027F9', + "Lopf;": '\U0001D543', + "LowerLeftArrow;": '\U00002199', + "LowerRightArrow;": '\U00002198', + "Lscr;": '\U00002112', + "Lsh;": '\U000021B0', + "Lstrok;": '\U00000141', + "Lt;": '\U0000226A', + "Map;": '\U00002905', + "Mcy;": '\U0000041C', + "MediumSpace;": '\U0000205F', + "Mellintrf;": '\U00002133', + "Mfr;": '\U0001D510', + "MinusPlus;": '\U00002213', + "Mopf;": '\U0001D544', + "Mscr;": '\U00002133', + "Mu;": '\U0000039C', + "NJcy;": '\U0000040A', + "Nacute;": '\U00000143', + "Ncaron;": '\U00000147', + "Ncedil;": '\U00000145', + "Ncy;": '\U0000041D', + "NegativeMediumSpace;": '\U0000200B', + "NegativeThickSpace;": '\U0000200B', + "NegativeThinSpace;": '\U0000200B', + "NegativeVeryThinSpace;": '\U0000200B', + "NestedGreaterGreater;": '\U0000226B', + "NestedLessLess;": '\U0000226A', + "NewLine;": '\U0000000A', + "Nfr;": '\U0001D511', + "NoBreak;": '\U00002060', + "NonBreakingSpace;": '\U000000A0', + "Nopf;": '\U00002115', + "Not;": '\U00002AEC', + "NotCongruent;": '\U00002262', + "NotCupCap;": '\U0000226D', + "NotDoubleVerticalBar;": '\U00002226', + "NotElement;": '\U00002209', + "NotEqual;": '\U00002260', + "NotExists;": '\U00002204', + "NotGreater;": '\U0000226F', + "NotGreaterEqual;": '\U00002271', + "NotGreaterLess;": '\U00002279', + "NotGreaterTilde;": '\U00002275', + "NotLeftTriangle;": '\U000022EA', + "NotLeftTriangleEqual;": '\U000022EC', + "NotLess;": '\U0000226E', + "NotLessEqual;": '\U00002270', + "NotLessGreater;": '\U00002278', + "NotLessTilde;": '\U00002274', + "NotPrecedes;": '\U00002280', + "NotPrecedesSlantEqual;": '\U000022E0', + "NotReverseElement;": '\U0000220C', + "NotRightTriangle;": '\U000022EB', + "NotRightTriangleEqual;": '\U000022ED', + "NotSquareSubsetEqual;": '\U000022E2', + "NotSquareSupersetEqual;": '\U000022E3', + "NotSubsetEqual;": '\U00002288', + "NotSucceeds;": '\U00002281', + "NotSucceedsSlantEqual;": '\U000022E1', + "NotSupersetEqual;": '\U00002289', + "NotTilde;": '\U00002241', + "NotTildeEqual;": '\U00002244', + "NotTildeFullEqual;": '\U00002247', + "NotTildeTilde;": '\U00002249', + "NotVerticalBar;": '\U00002224', + "Nscr;": '\U0001D4A9', + "Ntilde;": '\U000000D1', + "Nu;": '\U0000039D', + "OElig;": '\U00000152', + "Oacute;": '\U000000D3', + "Ocirc;": '\U000000D4', + "Ocy;": '\U0000041E', + "Odblac;": '\U00000150', + "Ofr;": '\U0001D512', + "Ograve;": '\U000000D2', + "Omacr;": '\U0000014C', + "Omega;": '\U000003A9', + "Omicron;": '\U0000039F', + "Oopf;": '\U0001D546', + "OpenCurlyDoubleQuote;": '\U0000201C', + "OpenCurlyQuote;": '\U00002018', + "Or;": '\U00002A54', + "Oscr;": '\U0001D4AA', + "Oslash;": '\U000000D8', + "Otilde;": '\U000000D5', + "Otimes;": '\U00002A37', + "Ouml;": '\U000000D6', + "OverBar;": '\U0000203E', + "OverBrace;": '\U000023DE', + "OverBracket;": '\U000023B4', + "OverParenthesis;": '\U000023DC', + "PartialD;": '\U00002202', + "Pcy;": '\U0000041F', + "Pfr;": '\U0001D513', + "Phi;": '\U000003A6', + "Pi;": '\U000003A0', + "PlusMinus;": '\U000000B1', + "Poincareplane;": '\U0000210C', + "Popf;": '\U00002119', + "Pr;": '\U00002ABB', + "Precedes;": '\U0000227A', + "PrecedesEqual;": '\U00002AAF', + "PrecedesSlantEqual;": '\U0000227C', + "PrecedesTilde;": '\U0000227E', + "Prime;": '\U00002033', + "Product;": '\U0000220F', + "Proportion;": '\U00002237', + "Proportional;": '\U0000221D', + "Pscr;": '\U0001D4AB', + "Psi;": '\U000003A8', + "QUOT;": '\U00000022', + "Qfr;": '\U0001D514', + "Qopf;": '\U0000211A', + "Qscr;": '\U0001D4AC', + "RBarr;": '\U00002910', + "REG;": '\U000000AE', + "Racute;": '\U00000154', + "Rang;": '\U000027EB', + "Rarr;": '\U000021A0', + "Rarrtl;": '\U00002916', + "Rcaron;": '\U00000158', + "Rcedil;": '\U00000156', + "Rcy;": '\U00000420', + "Re;": '\U0000211C', + "ReverseElement;": '\U0000220B', + "ReverseEquilibrium;": '\U000021CB', + "ReverseUpEquilibrium;": '\U0000296F', + "Rfr;": '\U0000211C', + "Rho;": '\U000003A1', + "RightAngleBracket;": '\U000027E9', + "RightArrow;": '\U00002192', + "RightArrowBar;": '\U000021E5', + "RightArrowLeftArrow;": '\U000021C4', + "RightCeiling;": '\U00002309', + "RightDoubleBracket;": '\U000027E7', + "RightDownTeeVector;": '\U0000295D', + "RightDownVector;": '\U000021C2', + "RightDownVectorBar;": '\U00002955', + "RightFloor;": '\U0000230B', + "RightTee;": '\U000022A2', + "RightTeeArrow;": '\U000021A6', + "RightTeeVector;": '\U0000295B', + "RightTriangle;": '\U000022B3', + "RightTriangleBar;": '\U000029D0', + "RightTriangleEqual;": '\U000022B5', + "RightUpDownVector;": '\U0000294F', + "RightUpTeeVector;": '\U0000295C', + "RightUpVector;": '\U000021BE', + "RightUpVectorBar;": '\U00002954', + "RightVector;": '\U000021C0', + "RightVectorBar;": '\U00002953', + "Rightarrow;": '\U000021D2', + "Ropf;": '\U0000211D', + "RoundImplies;": '\U00002970', + "Rrightarrow;": '\U000021DB', + "Rscr;": '\U0000211B', + "Rsh;": '\U000021B1', + "RuleDelayed;": '\U000029F4', + "SHCHcy;": '\U00000429', + "SHcy;": '\U00000428', + "SOFTcy;": '\U0000042C', + "Sacute;": '\U0000015A', + "Sc;": '\U00002ABC', + "Scaron;": '\U00000160', + "Scedil;": '\U0000015E', + "Scirc;": '\U0000015C', + "Scy;": '\U00000421', + "Sfr;": '\U0001D516', + "ShortDownArrow;": '\U00002193', + "ShortLeftArrow;": '\U00002190', + "ShortRightArrow;": '\U00002192', + "ShortUpArrow;": '\U00002191', + "Sigma;": '\U000003A3', + "SmallCircle;": '\U00002218', + "Sopf;": '\U0001D54A', + "Sqrt;": '\U0000221A', + "Square;": '\U000025A1', + "SquareIntersection;": '\U00002293', + "SquareSubset;": '\U0000228F', + "SquareSubsetEqual;": '\U00002291', + "SquareSuperset;": '\U00002290', + "SquareSupersetEqual;": '\U00002292', + "SquareUnion;": '\U00002294', + "Sscr;": '\U0001D4AE', + "Star;": '\U000022C6', + "Sub;": '\U000022D0', + "Subset;": '\U000022D0', + "SubsetEqual;": '\U00002286', + "Succeeds;": '\U0000227B', + "SucceedsEqual;": '\U00002AB0', + "SucceedsSlantEqual;": '\U0000227D', + "SucceedsTilde;": '\U0000227F', + "SuchThat;": '\U0000220B', + "Sum;": '\U00002211', + "Sup;": '\U000022D1', + "Superset;": '\U00002283', + "SupersetEqual;": '\U00002287', + "Supset;": '\U000022D1', + "THORN;": '\U000000DE', + "TRADE;": '\U00002122', + "TSHcy;": '\U0000040B', + "TScy;": '\U00000426', + "Tab;": '\U00000009', + "Tau;": '\U000003A4', + "Tcaron;": '\U00000164', + "Tcedil;": '\U00000162', + "Tcy;": '\U00000422', + "Tfr;": '\U0001D517', + "Therefore;": '\U00002234', + "Theta;": '\U00000398', + "ThinSpace;": '\U00002009', + "Tilde;": '\U0000223C', + "TildeEqual;": '\U00002243', + "TildeFullEqual;": '\U00002245', + "TildeTilde;": '\U00002248', + "Topf;": '\U0001D54B', + "TripleDot;": '\U000020DB', + "Tscr;": '\U0001D4AF', + "Tstrok;": '\U00000166', + "Uacute;": '\U000000DA', + "Uarr;": '\U0000219F', + "Uarrocir;": '\U00002949', + "Ubrcy;": '\U0000040E', + "Ubreve;": '\U0000016C', + "Ucirc;": '\U000000DB', + "Ucy;": '\U00000423', + "Udblac;": '\U00000170', + "Ufr;": '\U0001D518', + "Ugrave;": '\U000000D9', + "Umacr;": '\U0000016A', + "UnderBar;": '\U0000005F', + "UnderBrace;": '\U000023DF', + "UnderBracket;": '\U000023B5', + "UnderParenthesis;": '\U000023DD', + "Union;": '\U000022C3', + "UnionPlus;": '\U0000228E', + "Uogon;": '\U00000172', + "Uopf;": '\U0001D54C', + "UpArrow;": '\U00002191', + "UpArrowBar;": '\U00002912', + "UpArrowDownArrow;": '\U000021C5', + "UpDownArrow;": '\U00002195', + "UpEquilibrium;": '\U0000296E', + "UpTee;": '\U000022A5', + "UpTeeArrow;": '\U000021A5', + "Uparrow;": '\U000021D1', + "Updownarrow;": '\U000021D5', + "UpperLeftArrow;": '\U00002196', + "UpperRightArrow;": '\U00002197', + "Upsi;": '\U000003D2', + "Upsilon;": '\U000003A5', + "Uring;": '\U0000016E', + "Uscr;": '\U0001D4B0', + "Utilde;": '\U00000168', + "Uuml;": '\U000000DC', + "VDash;": '\U000022AB', + "Vbar;": '\U00002AEB', + "Vcy;": '\U00000412', + "Vdash;": '\U000022A9', + "Vdashl;": '\U00002AE6', + "Vee;": '\U000022C1', + "Verbar;": '\U00002016', + "Vert;": '\U00002016', + "VerticalBar;": '\U00002223', + "VerticalLine;": '\U0000007C', + "VerticalSeparator;": '\U00002758', + "VerticalTilde;": '\U00002240', + "VeryThinSpace;": '\U0000200A', + "Vfr;": '\U0001D519', + "Vopf;": '\U0001D54D', + "Vscr;": '\U0001D4B1', + "Vvdash;": '\U000022AA', + "Wcirc;": '\U00000174', + "Wedge;": '\U000022C0', + "Wfr;": '\U0001D51A', + "Wopf;": '\U0001D54E', + "Wscr;": '\U0001D4B2', + "Xfr;": '\U0001D51B', + "Xi;": '\U0000039E', + "Xopf;": '\U0001D54F', + "Xscr;": '\U0001D4B3', + "YAcy;": '\U0000042F', + "YIcy;": '\U00000407', + "YUcy;": '\U0000042E', + "Yacute;": '\U000000DD', + "Ycirc;": '\U00000176', + "Ycy;": '\U0000042B', + "Yfr;": '\U0001D51C', + "Yopf;": '\U0001D550', + "Yscr;": '\U0001D4B4', + "Yuml;": '\U00000178', + "ZHcy;": '\U00000416', + "Zacute;": '\U00000179', + "Zcaron;": '\U0000017D', + "Zcy;": '\U00000417', + "Zdot;": '\U0000017B', + "ZeroWidthSpace;": '\U0000200B', + "Zeta;": '\U00000396', + "Zfr;": '\U00002128', + "Zopf;": '\U00002124', + "Zscr;": '\U0001D4B5', + "aacute;": '\U000000E1', + "abreve;": '\U00000103', + "ac;": '\U0000223E', + "acd;": '\U0000223F', + "acirc;": '\U000000E2', + "acute;": '\U000000B4', + "acy;": '\U00000430', + "aelig;": '\U000000E6', + "af;": '\U00002061', + "afr;": '\U0001D51E', + "agrave;": '\U000000E0', + "alefsym;": '\U00002135', + "aleph;": '\U00002135', + "alpha;": '\U000003B1', + "amacr;": '\U00000101', + "amalg;": '\U00002A3F', + "amp;": '\U00000026', + "and;": '\U00002227', + "andand;": '\U00002A55', + "andd;": '\U00002A5C', + "andslope;": '\U00002A58', + "andv;": '\U00002A5A', + "ang;": '\U00002220', + "ange;": '\U000029A4', + "angle;": '\U00002220', + "angmsd;": '\U00002221', + "angmsdaa;": '\U000029A8', + "angmsdab;": '\U000029A9', + "angmsdac;": '\U000029AA', + "angmsdad;": '\U000029AB', + "angmsdae;": '\U000029AC', + "angmsdaf;": '\U000029AD', + "angmsdag;": '\U000029AE', + "angmsdah;": '\U000029AF', + "angrt;": '\U0000221F', + "angrtvb;": '\U000022BE', + "angrtvbd;": '\U0000299D', + "angsph;": '\U00002222', + "angst;": '\U000000C5', + "angzarr;": '\U0000237C', + "aogon;": '\U00000105', + "aopf;": '\U0001D552', + "ap;": '\U00002248', + "apE;": '\U00002A70', + "apacir;": '\U00002A6F', + "ape;": '\U0000224A', + "apid;": '\U0000224B', + "apos;": '\U00000027', + "approx;": '\U00002248', + "approxeq;": '\U0000224A', + "aring;": '\U000000E5', + "ascr;": '\U0001D4B6', + "ast;": '\U0000002A', + "asymp;": '\U00002248', + "asympeq;": '\U0000224D', + "atilde;": '\U000000E3', + "auml;": '\U000000E4', + "awconint;": '\U00002233', + "awint;": '\U00002A11', + "bNot;": '\U00002AED', + "backcong;": '\U0000224C', + "backepsilon;": '\U000003F6', + "backprime;": '\U00002035', + "backsim;": '\U0000223D', + "backsimeq;": '\U000022CD', + "barvee;": '\U000022BD', + "barwed;": '\U00002305', + "barwedge;": '\U00002305', + "bbrk;": '\U000023B5', + "bbrktbrk;": '\U000023B6', + "bcong;": '\U0000224C', + "bcy;": '\U00000431', + "bdquo;": '\U0000201E', + "becaus;": '\U00002235', + "because;": '\U00002235', + "bemptyv;": '\U000029B0', + "bepsi;": '\U000003F6', + "bernou;": '\U0000212C', + "beta;": '\U000003B2', + "beth;": '\U00002136', + "between;": '\U0000226C', + "bfr;": '\U0001D51F', + "bigcap;": '\U000022C2', + "bigcirc;": '\U000025EF', + "bigcup;": '\U000022C3', + "bigodot;": '\U00002A00', + "bigoplus;": '\U00002A01', + "bigotimes;": '\U00002A02', + "bigsqcup;": '\U00002A06', + "bigstar;": '\U00002605', + "bigtriangledown;": '\U000025BD', + "bigtriangleup;": '\U000025B3', + "biguplus;": '\U00002A04', + "bigvee;": '\U000022C1', + "bigwedge;": '\U000022C0', + "bkarow;": '\U0000290D', + "blacklozenge;": '\U000029EB', + "blacksquare;": '\U000025AA', + "blacktriangle;": '\U000025B4', + "blacktriangledown;": '\U000025BE', + "blacktriangleleft;": '\U000025C2', + "blacktriangleright;": '\U000025B8', + "blank;": '\U00002423', + "blk12;": '\U00002592', + "blk14;": '\U00002591', + "blk34;": '\U00002593', + "block;": '\U00002588', + "bnot;": '\U00002310', + "bopf;": '\U0001D553', + "bot;": '\U000022A5', + "bottom;": '\U000022A5', + "bowtie;": '\U000022C8', + "boxDL;": '\U00002557', + "boxDR;": '\U00002554', + "boxDl;": '\U00002556', + "boxDr;": '\U00002553', + "boxH;": '\U00002550', + "boxHD;": '\U00002566', + "boxHU;": '\U00002569', + "boxHd;": '\U00002564', + "boxHu;": '\U00002567', + "boxUL;": '\U0000255D', + "boxUR;": '\U0000255A', + "boxUl;": '\U0000255C', + "boxUr;": '\U00002559', + "boxV;": '\U00002551', + "boxVH;": '\U0000256C', + "boxVL;": '\U00002563', + "boxVR;": '\U00002560', + "boxVh;": '\U0000256B', + "boxVl;": '\U00002562', + "boxVr;": '\U0000255F', + "boxbox;": '\U000029C9', + "boxdL;": '\U00002555', + "boxdR;": '\U00002552', + "boxdl;": '\U00002510', + "boxdr;": '\U0000250C', + "boxh;": '\U00002500', + "boxhD;": '\U00002565', + "boxhU;": '\U00002568', + "boxhd;": '\U0000252C', + "boxhu;": '\U00002534', + "boxminus;": '\U0000229F', + "boxplus;": '\U0000229E', + "boxtimes;": '\U000022A0', + "boxuL;": '\U0000255B', + "boxuR;": '\U00002558', + "boxul;": '\U00002518', + "boxur;": '\U00002514', + "boxv;": '\U00002502', + "boxvH;": '\U0000256A', + "boxvL;": '\U00002561', + "boxvR;": '\U0000255E', + "boxvh;": '\U0000253C', + "boxvl;": '\U00002524', + "boxvr;": '\U0000251C', + "bprime;": '\U00002035', + "breve;": '\U000002D8', + "brvbar;": '\U000000A6', + "bscr;": '\U0001D4B7', + "bsemi;": '\U0000204F', + "bsim;": '\U0000223D', + "bsime;": '\U000022CD', + "bsol;": '\U0000005C', + "bsolb;": '\U000029C5', + "bsolhsub;": '\U000027C8', + "bull;": '\U00002022', + "bullet;": '\U00002022', + "bump;": '\U0000224E', + "bumpE;": '\U00002AAE', + "bumpe;": '\U0000224F', + "bumpeq;": '\U0000224F', + "cacute;": '\U00000107', + "cap;": '\U00002229', + "capand;": '\U00002A44', + "capbrcup;": '\U00002A49', + "capcap;": '\U00002A4B', + "capcup;": '\U00002A47', + "capdot;": '\U00002A40', + "caret;": '\U00002041', + "caron;": '\U000002C7', + "ccaps;": '\U00002A4D', + "ccaron;": '\U0000010D', + "ccedil;": '\U000000E7', + "ccirc;": '\U00000109', + "ccups;": '\U00002A4C', + "ccupssm;": '\U00002A50', + "cdot;": '\U0000010B', + "cedil;": '\U000000B8', + "cemptyv;": '\U000029B2', + "cent;": '\U000000A2', + "centerdot;": '\U000000B7', + "cfr;": '\U0001D520', + "chcy;": '\U00000447', + "check;": '\U00002713', + "checkmark;": '\U00002713', + "chi;": '\U000003C7', + "cir;": '\U000025CB', + "cirE;": '\U000029C3', + "circ;": '\U000002C6', + "circeq;": '\U00002257', + "circlearrowleft;": '\U000021BA', + "circlearrowright;": '\U000021BB', + "circledR;": '\U000000AE', + "circledS;": '\U000024C8', + "circledast;": '\U0000229B', + "circledcirc;": '\U0000229A', + "circleddash;": '\U0000229D', + "cire;": '\U00002257', + "cirfnint;": '\U00002A10', + "cirmid;": '\U00002AEF', + "cirscir;": '\U000029C2', + "clubs;": '\U00002663', + "clubsuit;": '\U00002663', + "colon;": '\U0000003A', + "colone;": '\U00002254', + "coloneq;": '\U00002254', + "comma;": '\U0000002C', + "commat;": '\U00000040', + "comp;": '\U00002201', + "compfn;": '\U00002218', + "complement;": '\U00002201', + "complexes;": '\U00002102', + "cong;": '\U00002245', + "congdot;": '\U00002A6D', + "conint;": '\U0000222E', + "copf;": '\U0001D554', + "coprod;": '\U00002210', + "copy;": '\U000000A9', + "copysr;": '\U00002117', + "crarr;": '\U000021B5', + "cross;": '\U00002717', + "cscr;": '\U0001D4B8', + "csub;": '\U00002ACF', + "csube;": '\U00002AD1', + "csup;": '\U00002AD0', + "csupe;": '\U00002AD2', + "ctdot;": '\U000022EF', + "cudarrl;": '\U00002938', + "cudarrr;": '\U00002935', + "cuepr;": '\U000022DE', + "cuesc;": '\U000022DF', + "cularr;": '\U000021B6', + "cularrp;": '\U0000293D', + "cup;": '\U0000222A', + "cupbrcap;": '\U00002A48', + "cupcap;": '\U00002A46', + "cupcup;": '\U00002A4A', + "cupdot;": '\U0000228D', + "cupor;": '\U00002A45', + "curarr;": '\U000021B7', + "curarrm;": '\U0000293C', + "curlyeqprec;": '\U000022DE', + "curlyeqsucc;": '\U000022DF', + "curlyvee;": '\U000022CE', + "curlywedge;": '\U000022CF', + "curren;": '\U000000A4', + "curvearrowleft;": '\U000021B6', + "curvearrowright;": '\U000021B7', + "cuvee;": '\U000022CE', + "cuwed;": '\U000022CF', + "cwconint;": '\U00002232', + "cwint;": '\U00002231', + "cylcty;": '\U0000232D', + "dArr;": '\U000021D3', + "dHar;": '\U00002965', + "dagger;": '\U00002020', + "daleth;": '\U00002138', + "darr;": '\U00002193', + "dash;": '\U00002010', + "dashv;": '\U000022A3', + "dbkarow;": '\U0000290F', + "dblac;": '\U000002DD', + "dcaron;": '\U0000010F', + "dcy;": '\U00000434', + "dd;": '\U00002146', + "ddagger;": '\U00002021', + "ddarr;": '\U000021CA', + "ddotseq;": '\U00002A77', + "deg;": '\U000000B0', + "delta;": '\U000003B4', + "demptyv;": '\U000029B1', + "dfisht;": '\U0000297F', + "dfr;": '\U0001D521', + "dharl;": '\U000021C3', + "dharr;": '\U000021C2', + "diam;": '\U000022C4', + "diamond;": '\U000022C4', + "diamondsuit;": '\U00002666', + "diams;": '\U00002666', + "die;": '\U000000A8', + "digamma;": '\U000003DD', + "disin;": '\U000022F2', + "div;": '\U000000F7', + "divide;": '\U000000F7', + "divideontimes;": '\U000022C7', + "divonx;": '\U000022C7', + "djcy;": '\U00000452', + "dlcorn;": '\U0000231E', + "dlcrop;": '\U0000230D', + "dollar;": '\U00000024', + "dopf;": '\U0001D555', + "dot;": '\U000002D9', + "doteq;": '\U00002250', + "doteqdot;": '\U00002251', + "dotminus;": '\U00002238', + "dotplus;": '\U00002214', + "dotsquare;": '\U000022A1', + "doublebarwedge;": '\U00002306', + "downarrow;": '\U00002193', + "downdownarrows;": '\U000021CA', + "downharpoonleft;": '\U000021C3', + "downharpoonright;": '\U000021C2', + "drbkarow;": '\U00002910', + "drcorn;": '\U0000231F', + "drcrop;": '\U0000230C', + "dscr;": '\U0001D4B9', + "dscy;": '\U00000455', + "dsol;": '\U000029F6', + "dstrok;": '\U00000111', + "dtdot;": '\U000022F1', + "dtri;": '\U000025BF', + "dtrif;": '\U000025BE', + "duarr;": '\U000021F5', + "duhar;": '\U0000296F', + "dwangle;": '\U000029A6', + "dzcy;": '\U0000045F', + "dzigrarr;": '\U000027FF', + "eDDot;": '\U00002A77', + "eDot;": '\U00002251', + "eacute;": '\U000000E9', + "easter;": '\U00002A6E', + "ecaron;": '\U0000011B', + "ecir;": '\U00002256', + "ecirc;": '\U000000EA', + "ecolon;": '\U00002255', + "ecy;": '\U0000044D', + "edot;": '\U00000117', + "ee;": '\U00002147', + "efDot;": '\U00002252', + "efr;": '\U0001D522', + "eg;": '\U00002A9A', + "egrave;": '\U000000E8', + "egs;": '\U00002A96', + "egsdot;": '\U00002A98', + "el;": '\U00002A99', + "elinters;": '\U000023E7', + "ell;": '\U00002113', + "els;": '\U00002A95', + "elsdot;": '\U00002A97', + "emacr;": '\U00000113', + "empty;": '\U00002205', + "emptyset;": '\U00002205', + "emptyv;": '\U00002205', + "emsp;": '\U00002003', + "emsp13;": '\U00002004', + "emsp14;": '\U00002005', + "eng;": '\U0000014B', + "ensp;": '\U00002002', + "eogon;": '\U00000119', + "eopf;": '\U0001D556', + "epar;": '\U000022D5', + "eparsl;": '\U000029E3', + "eplus;": '\U00002A71', + "epsi;": '\U000003B5', + "epsilon;": '\U000003B5', + "epsiv;": '\U000003F5', + "eqcirc;": '\U00002256', + "eqcolon;": '\U00002255', + "eqsim;": '\U00002242', + "eqslantgtr;": '\U00002A96', + "eqslantless;": '\U00002A95', + "equals;": '\U0000003D', + "equest;": '\U0000225F', + "equiv;": '\U00002261', + "equivDD;": '\U00002A78', + "eqvparsl;": '\U000029E5', + "erDot;": '\U00002253', + "erarr;": '\U00002971', + "escr;": '\U0000212F', + "esdot;": '\U00002250', + "esim;": '\U00002242', + "eta;": '\U000003B7', + "eth;": '\U000000F0', + "euml;": '\U000000EB', + "euro;": '\U000020AC', + "excl;": '\U00000021', + "exist;": '\U00002203', + "expectation;": '\U00002130', + "exponentiale;": '\U00002147', + "fallingdotseq;": '\U00002252', + "fcy;": '\U00000444', + "female;": '\U00002640', + "ffilig;": '\U0000FB03', + "fflig;": '\U0000FB00', + "ffllig;": '\U0000FB04', + "ffr;": '\U0001D523', + "filig;": '\U0000FB01', + "flat;": '\U0000266D', + "fllig;": '\U0000FB02', + "fltns;": '\U000025B1', + "fnof;": '\U00000192', + "fopf;": '\U0001D557', + "forall;": '\U00002200', + "fork;": '\U000022D4', + "forkv;": '\U00002AD9', + "fpartint;": '\U00002A0D', + "frac12;": '\U000000BD', + "frac13;": '\U00002153', + "frac14;": '\U000000BC', + "frac15;": '\U00002155', + "frac16;": '\U00002159', + "frac18;": '\U0000215B', + "frac23;": '\U00002154', + "frac25;": '\U00002156', + "frac34;": '\U000000BE', + "frac35;": '\U00002157', + "frac38;": '\U0000215C', + "frac45;": '\U00002158', + "frac56;": '\U0000215A', + "frac58;": '\U0000215D', + "frac78;": '\U0000215E', + "frasl;": '\U00002044', + "frown;": '\U00002322', + "fscr;": '\U0001D4BB', + "gE;": '\U00002267', + "gEl;": '\U00002A8C', + "gacute;": '\U000001F5', + "gamma;": '\U000003B3', + "gammad;": '\U000003DD', + "gap;": '\U00002A86', + "gbreve;": '\U0000011F', + "gcirc;": '\U0000011D', + "gcy;": '\U00000433', + "gdot;": '\U00000121', + "ge;": '\U00002265', + "gel;": '\U000022DB', + "geq;": '\U00002265', + "geqq;": '\U00002267', + "geqslant;": '\U00002A7E', + "ges;": '\U00002A7E', + "gescc;": '\U00002AA9', + "gesdot;": '\U00002A80', + "gesdoto;": '\U00002A82', + "gesdotol;": '\U00002A84', + "gesles;": '\U00002A94', + "gfr;": '\U0001D524', + "gg;": '\U0000226B', + "ggg;": '\U000022D9', + "gimel;": '\U00002137', + "gjcy;": '\U00000453', + "gl;": '\U00002277', + "glE;": '\U00002A92', + "gla;": '\U00002AA5', + "glj;": '\U00002AA4', + "gnE;": '\U00002269', + "gnap;": '\U00002A8A', + "gnapprox;": '\U00002A8A', + "gne;": '\U00002A88', + "gneq;": '\U00002A88', + "gneqq;": '\U00002269', + "gnsim;": '\U000022E7', + "gopf;": '\U0001D558', + "grave;": '\U00000060', + "gscr;": '\U0000210A', + "gsim;": '\U00002273', + "gsime;": '\U00002A8E', + "gsiml;": '\U00002A90', + "gt;": '\U0000003E', + "gtcc;": '\U00002AA7', + "gtcir;": '\U00002A7A', + "gtdot;": '\U000022D7', + "gtlPar;": '\U00002995', + "gtquest;": '\U00002A7C', + "gtrapprox;": '\U00002A86', + "gtrarr;": '\U00002978', + "gtrdot;": '\U000022D7', + "gtreqless;": '\U000022DB', + "gtreqqless;": '\U00002A8C', + "gtrless;": '\U00002277', + "gtrsim;": '\U00002273', + "hArr;": '\U000021D4', + "hairsp;": '\U0000200A', + "half;": '\U000000BD', + "hamilt;": '\U0000210B', + "hardcy;": '\U0000044A', + "harr;": '\U00002194', + "harrcir;": '\U00002948', + "harrw;": '\U000021AD', + "hbar;": '\U0000210F', + "hcirc;": '\U00000125', + "hearts;": '\U00002665', + "heartsuit;": '\U00002665', + "hellip;": '\U00002026', + "hercon;": '\U000022B9', + "hfr;": '\U0001D525', + "hksearow;": '\U00002925', + "hkswarow;": '\U00002926', + "hoarr;": '\U000021FF', + "homtht;": '\U0000223B', + "hookleftarrow;": '\U000021A9', + "hookrightarrow;": '\U000021AA', + "hopf;": '\U0001D559', + "horbar;": '\U00002015', + "hscr;": '\U0001D4BD', + "hslash;": '\U0000210F', + "hstrok;": '\U00000127', + "hybull;": '\U00002043', + "hyphen;": '\U00002010', + "iacute;": '\U000000ED', + "ic;": '\U00002063', + "icirc;": '\U000000EE', + "icy;": '\U00000438', + "iecy;": '\U00000435', + "iexcl;": '\U000000A1', + "iff;": '\U000021D4', + "ifr;": '\U0001D526', + "igrave;": '\U000000EC', + "ii;": '\U00002148', + "iiiint;": '\U00002A0C', + "iiint;": '\U0000222D', + "iinfin;": '\U000029DC', + "iiota;": '\U00002129', + "ijlig;": '\U00000133', + "imacr;": '\U0000012B', + "image;": '\U00002111', + "imagline;": '\U00002110', + "imagpart;": '\U00002111', + "imath;": '\U00000131', + "imof;": '\U000022B7', + "imped;": '\U000001B5', + "in;": '\U00002208', + "incare;": '\U00002105', + "infin;": '\U0000221E', + "infintie;": '\U000029DD', + "inodot;": '\U00000131', + "int;": '\U0000222B', + "intcal;": '\U000022BA', + "integers;": '\U00002124', + "intercal;": '\U000022BA', + "intlarhk;": '\U00002A17', + "intprod;": '\U00002A3C', + "iocy;": '\U00000451', + "iogon;": '\U0000012F', + "iopf;": '\U0001D55A', + "iota;": '\U000003B9', + "iprod;": '\U00002A3C', + "iquest;": '\U000000BF', + "iscr;": '\U0001D4BE', + "isin;": '\U00002208', + "isinE;": '\U000022F9', + "isindot;": '\U000022F5', + "isins;": '\U000022F4', + "isinsv;": '\U000022F3', + "isinv;": '\U00002208', + "it;": '\U00002062', + "itilde;": '\U00000129', + "iukcy;": '\U00000456', + "iuml;": '\U000000EF', + "jcirc;": '\U00000135', + "jcy;": '\U00000439', + "jfr;": '\U0001D527', + "jmath;": '\U00000237', + "jopf;": '\U0001D55B', + "jscr;": '\U0001D4BF', + "jsercy;": '\U00000458', + "jukcy;": '\U00000454', + "kappa;": '\U000003BA', + "kappav;": '\U000003F0', + "kcedil;": '\U00000137', + "kcy;": '\U0000043A', + "kfr;": '\U0001D528', + "kgreen;": '\U00000138', + "khcy;": '\U00000445', + "kjcy;": '\U0000045C', + "kopf;": '\U0001D55C', + "kscr;": '\U0001D4C0', + "lAarr;": '\U000021DA', + "lArr;": '\U000021D0', + "lAtail;": '\U0000291B', + "lBarr;": '\U0000290E', + "lE;": '\U00002266', + "lEg;": '\U00002A8B', + "lHar;": '\U00002962', + "lacute;": '\U0000013A', + "laemptyv;": '\U000029B4', + "lagran;": '\U00002112', + "lambda;": '\U000003BB', + "lang;": '\U000027E8', + "langd;": '\U00002991', + "langle;": '\U000027E8', + "lap;": '\U00002A85', + "laquo;": '\U000000AB', + "larr;": '\U00002190', + "larrb;": '\U000021E4', + "larrbfs;": '\U0000291F', + "larrfs;": '\U0000291D', + "larrhk;": '\U000021A9', + "larrlp;": '\U000021AB', + "larrpl;": '\U00002939', + "larrsim;": '\U00002973', + "larrtl;": '\U000021A2', + "lat;": '\U00002AAB', + "latail;": '\U00002919', + "late;": '\U00002AAD', + "lbarr;": '\U0000290C', + "lbbrk;": '\U00002772', + "lbrace;": '\U0000007B', + "lbrack;": '\U0000005B', + "lbrke;": '\U0000298B', + "lbrksld;": '\U0000298F', + "lbrkslu;": '\U0000298D', + "lcaron;": '\U0000013E', + "lcedil;": '\U0000013C', + "lceil;": '\U00002308', + "lcub;": '\U0000007B', + "lcy;": '\U0000043B', + "ldca;": '\U00002936', + "ldquo;": '\U0000201C', + "ldquor;": '\U0000201E', + "ldrdhar;": '\U00002967', + "ldrushar;": '\U0000294B', + "ldsh;": '\U000021B2', + "le;": '\U00002264', + "leftarrow;": '\U00002190', + "leftarrowtail;": '\U000021A2', + "leftharpoondown;": '\U000021BD', + "leftharpoonup;": '\U000021BC', + "leftleftarrows;": '\U000021C7', + "leftrightarrow;": '\U00002194', + "leftrightarrows;": '\U000021C6', + "leftrightharpoons;": '\U000021CB', + "leftrightsquigarrow;": '\U000021AD', + "leftthreetimes;": '\U000022CB', + "leg;": '\U000022DA', + "leq;": '\U00002264', + "leqq;": '\U00002266', + "leqslant;": '\U00002A7D', + "les;": '\U00002A7D', + "lescc;": '\U00002AA8', + "lesdot;": '\U00002A7F', + "lesdoto;": '\U00002A81', + "lesdotor;": '\U00002A83', + "lesges;": '\U00002A93', + "lessapprox;": '\U00002A85', + "lessdot;": '\U000022D6', + "lesseqgtr;": '\U000022DA', + "lesseqqgtr;": '\U00002A8B', + "lessgtr;": '\U00002276', + "lesssim;": '\U00002272', + "lfisht;": '\U0000297C', + "lfloor;": '\U0000230A', + "lfr;": '\U0001D529', + "lg;": '\U00002276', + "lgE;": '\U00002A91', + "lhard;": '\U000021BD', + "lharu;": '\U000021BC', + "lharul;": '\U0000296A', + "lhblk;": '\U00002584', + "ljcy;": '\U00000459', + "ll;": '\U0000226A', + "llarr;": '\U000021C7', + "llcorner;": '\U0000231E', + "llhard;": '\U0000296B', + "lltri;": '\U000025FA', + "lmidot;": '\U00000140', + "lmoust;": '\U000023B0', + "lmoustache;": '\U000023B0', + "lnE;": '\U00002268', + "lnap;": '\U00002A89', + "lnapprox;": '\U00002A89', + "lne;": '\U00002A87', + "lneq;": '\U00002A87', + "lneqq;": '\U00002268', + "lnsim;": '\U000022E6', + "loang;": '\U000027EC', + "loarr;": '\U000021FD', + "lobrk;": '\U000027E6', + "longleftarrow;": '\U000027F5', + "longleftrightarrow;": '\U000027F7', + "longmapsto;": '\U000027FC', + "longrightarrow;": '\U000027F6', + "looparrowleft;": '\U000021AB', + "looparrowright;": '\U000021AC', + "lopar;": '\U00002985', + "lopf;": '\U0001D55D', + "loplus;": '\U00002A2D', + "lotimes;": '\U00002A34', + "lowast;": '\U00002217', + "lowbar;": '\U0000005F', + "loz;": '\U000025CA', + "lozenge;": '\U000025CA', + "lozf;": '\U000029EB', + "lpar;": '\U00000028', + "lparlt;": '\U00002993', + "lrarr;": '\U000021C6', + "lrcorner;": '\U0000231F', + "lrhar;": '\U000021CB', + "lrhard;": '\U0000296D', + "lrm;": '\U0000200E', + "lrtri;": '\U000022BF', + "lsaquo;": '\U00002039', + "lscr;": '\U0001D4C1', + "lsh;": '\U000021B0', + "lsim;": '\U00002272', + "lsime;": '\U00002A8D', + "lsimg;": '\U00002A8F', + "lsqb;": '\U0000005B', + "lsquo;": '\U00002018', + "lsquor;": '\U0000201A', + "lstrok;": '\U00000142', + "lt;": '\U0000003C', + "ltcc;": '\U00002AA6', + "ltcir;": '\U00002A79', + "ltdot;": '\U000022D6', + "lthree;": '\U000022CB', + "ltimes;": '\U000022C9', + "ltlarr;": '\U00002976', + "ltquest;": '\U00002A7B', + "ltrPar;": '\U00002996', + "ltri;": '\U000025C3', + "ltrie;": '\U000022B4', + "ltrif;": '\U000025C2', + "lurdshar;": '\U0000294A', + "luruhar;": '\U00002966', + "mDDot;": '\U0000223A', + "macr;": '\U000000AF', + "male;": '\U00002642', + "malt;": '\U00002720', + "maltese;": '\U00002720', + "map;": '\U000021A6', + "mapsto;": '\U000021A6', + "mapstodown;": '\U000021A7', + "mapstoleft;": '\U000021A4', + "mapstoup;": '\U000021A5', + "marker;": '\U000025AE', + "mcomma;": '\U00002A29', + "mcy;": '\U0000043C', + "mdash;": '\U00002014', + "measuredangle;": '\U00002221', + "mfr;": '\U0001D52A', + "mho;": '\U00002127', + "micro;": '\U000000B5', + "mid;": '\U00002223', + "midast;": '\U0000002A', + "midcir;": '\U00002AF0', + "middot;": '\U000000B7', + "minus;": '\U00002212', + "minusb;": '\U0000229F', + "minusd;": '\U00002238', + "minusdu;": '\U00002A2A', + "mlcp;": '\U00002ADB', + "mldr;": '\U00002026', + "mnplus;": '\U00002213', + "models;": '\U000022A7', + "mopf;": '\U0001D55E', + "mp;": '\U00002213', + "mscr;": '\U0001D4C2', + "mstpos;": '\U0000223E', + "mu;": '\U000003BC', + "multimap;": '\U000022B8', + "mumap;": '\U000022B8', + "nLeftarrow;": '\U000021CD', + "nLeftrightarrow;": '\U000021CE', + "nRightarrow;": '\U000021CF', + "nVDash;": '\U000022AF', + "nVdash;": '\U000022AE', + "nabla;": '\U00002207', + "nacute;": '\U00000144', + "nap;": '\U00002249', + "napos;": '\U00000149', + "napprox;": '\U00002249', + "natur;": '\U0000266E', + "natural;": '\U0000266E', + "naturals;": '\U00002115', + "nbsp;": '\U000000A0', + "ncap;": '\U00002A43', + "ncaron;": '\U00000148', + "ncedil;": '\U00000146', + "ncong;": '\U00002247', + "ncup;": '\U00002A42', + "ncy;": '\U0000043D', + "ndash;": '\U00002013', + "ne;": '\U00002260', + "neArr;": '\U000021D7', + "nearhk;": '\U00002924', + "nearr;": '\U00002197', + "nearrow;": '\U00002197', + "nequiv;": '\U00002262', + "nesear;": '\U00002928', + "nexist;": '\U00002204', + "nexists;": '\U00002204', + "nfr;": '\U0001D52B', + "nge;": '\U00002271', + "ngeq;": '\U00002271', + "ngsim;": '\U00002275', + "ngt;": '\U0000226F', + "ngtr;": '\U0000226F', + "nhArr;": '\U000021CE', + "nharr;": '\U000021AE', + "nhpar;": '\U00002AF2', + "ni;": '\U0000220B', + "nis;": '\U000022FC', + "nisd;": '\U000022FA', + "niv;": '\U0000220B', + "njcy;": '\U0000045A', + "nlArr;": '\U000021CD', + "nlarr;": '\U0000219A', + "nldr;": '\U00002025', + "nle;": '\U00002270', + "nleftarrow;": '\U0000219A', + "nleftrightarrow;": '\U000021AE', + "nleq;": '\U00002270', + "nless;": '\U0000226E', + "nlsim;": '\U00002274', + "nlt;": '\U0000226E', + "nltri;": '\U000022EA', + "nltrie;": '\U000022EC', + "nmid;": '\U00002224', + "nopf;": '\U0001D55F', + "not;": '\U000000AC', + "notin;": '\U00002209', + "notinva;": '\U00002209', + "notinvb;": '\U000022F7', + "notinvc;": '\U000022F6', + "notni;": '\U0000220C', + "notniva;": '\U0000220C', + "notnivb;": '\U000022FE', + "notnivc;": '\U000022FD', + "npar;": '\U00002226', + "nparallel;": '\U00002226', + "npolint;": '\U00002A14', + "npr;": '\U00002280', + "nprcue;": '\U000022E0', + "nprec;": '\U00002280', + "nrArr;": '\U000021CF', + "nrarr;": '\U0000219B', + "nrightarrow;": '\U0000219B', + "nrtri;": '\U000022EB', + "nrtrie;": '\U000022ED', + "nsc;": '\U00002281', + "nsccue;": '\U000022E1', + "nscr;": '\U0001D4C3', + "nshortmid;": '\U00002224', + "nshortparallel;": '\U00002226', + "nsim;": '\U00002241', + "nsime;": '\U00002244', + "nsimeq;": '\U00002244', + "nsmid;": '\U00002224', + "nspar;": '\U00002226', + "nsqsube;": '\U000022E2', + "nsqsupe;": '\U000022E3', + "nsub;": '\U00002284', + "nsube;": '\U00002288', + "nsubseteq;": '\U00002288', + "nsucc;": '\U00002281', + "nsup;": '\U00002285', + "nsupe;": '\U00002289', + "nsupseteq;": '\U00002289', + "ntgl;": '\U00002279', + "ntilde;": '\U000000F1', + "ntlg;": '\U00002278', + "ntriangleleft;": '\U000022EA', + "ntrianglelefteq;": '\U000022EC', + "ntriangleright;": '\U000022EB', + "ntrianglerighteq;": '\U000022ED', + "nu;": '\U000003BD', + "num;": '\U00000023', + "numero;": '\U00002116', + "numsp;": '\U00002007', + "nvDash;": '\U000022AD', + "nvHarr;": '\U00002904', + "nvdash;": '\U000022AC', + "nvinfin;": '\U000029DE', + "nvlArr;": '\U00002902', + "nvrArr;": '\U00002903', + "nwArr;": '\U000021D6', + "nwarhk;": '\U00002923', + "nwarr;": '\U00002196', + "nwarrow;": '\U00002196', + "nwnear;": '\U00002927', + "oS;": '\U000024C8', + "oacute;": '\U000000F3', + "oast;": '\U0000229B', + "ocir;": '\U0000229A', + "ocirc;": '\U000000F4', + "ocy;": '\U0000043E', + "odash;": '\U0000229D', + "odblac;": '\U00000151', + "odiv;": '\U00002A38', + "odot;": '\U00002299', + "odsold;": '\U000029BC', + "oelig;": '\U00000153', + "ofcir;": '\U000029BF', + "ofr;": '\U0001D52C', + "ogon;": '\U000002DB', + "ograve;": '\U000000F2', + "ogt;": '\U000029C1', + "ohbar;": '\U000029B5', + "ohm;": '\U000003A9', + "oint;": '\U0000222E', + "olarr;": '\U000021BA', + "olcir;": '\U000029BE', + "olcross;": '\U000029BB', + "oline;": '\U0000203E', + "olt;": '\U000029C0', + "omacr;": '\U0000014D', + "omega;": '\U000003C9', + "omicron;": '\U000003BF', + "omid;": '\U000029B6', + "ominus;": '\U00002296', + "oopf;": '\U0001D560', + "opar;": '\U000029B7', + "operp;": '\U000029B9', + "oplus;": '\U00002295', + "or;": '\U00002228', + "orarr;": '\U000021BB', + "ord;": '\U00002A5D', + "order;": '\U00002134', + "orderof;": '\U00002134', + "ordf;": '\U000000AA', + "ordm;": '\U000000BA', + "origof;": '\U000022B6', + "oror;": '\U00002A56', + "orslope;": '\U00002A57', + "orv;": '\U00002A5B', + "oscr;": '\U00002134', + "oslash;": '\U000000F8', + "osol;": '\U00002298', + "otilde;": '\U000000F5', + "otimes;": '\U00002297', + "otimesas;": '\U00002A36', + "ouml;": '\U000000F6', + "ovbar;": '\U0000233D', + "par;": '\U00002225', + "para;": '\U000000B6', + "parallel;": '\U00002225', + "parsim;": '\U00002AF3', + "parsl;": '\U00002AFD', + "part;": '\U00002202', + "pcy;": '\U0000043F', + "percnt;": '\U00000025', + "period;": '\U0000002E', + "permil;": '\U00002030', + "perp;": '\U000022A5', + "pertenk;": '\U00002031', + "pfr;": '\U0001D52D', + "phi;": '\U000003C6', + "phiv;": '\U000003D5', + "phmmat;": '\U00002133', + "phone;": '\U0000260E', + "pi;": '\U000003C0', + "pitchfork;": '\U000022D4', + "piv;": '\U000003D6', + "planck;": '\U0000210F', + "planckh;": '\U0000210E', + "plankv;": '\U0000210F', + "plus;": '\U0000002B', + "plusacir;": '\U00002A23', + "plusb;": '\U0000229E', + "pluscir;": '\U00002A22', + "plusdo;": '\U00002214', + "plusdu;": '\U00002A25', + "pluse;": '\U00002A72', + "plusmn;": '\U000000B1', + "plussim;": '\U00002A26', + "plustwo;": '\U00002A27', + "pm;": '\U000000B1', + "pointint;": '\U00002A15', + "popf;": '\U0001D561', + "pound;": '\U000000A3', + "pr;": '\U0000227A', + "prE;": '\U00002AB3', + "prap;": '\U00002AB7', + "prcue;": '\U0000227C', + "pre;": '\U00002AAF', + "prec;": '\U0000227A', + "precapprox;": '\U00002AB7', + "preccurlyeq;": '\U0000227C', + "preceq;": '\U00002AAF', + "precnapprox;": '\U00002AB9', + "precneqq;": '\U00002AB5', + "precnsim;": '\U000022E8', + "precsim;": '\U0000227E', + "prime;": '\U00002032', + "primes;": '\U00002119', + "prnE;": '\U00002AB5', + "prnap;": '\U00002AB9', + "prnsim;": '\U000022E8', + "prod;": '\U0000220F', + "profalar;": '\U0000232E', + "profline;": '\U00002312', + "profsurf;": '\U00002313', + "prop;": '\U0000221D', + "propto;": '\U0000221D', + "prsim;": '\U0000227E', + "prurel;": '\U000022B0', + "pscr;": '\U0001D4C5', + "psi;": '\U000003C8', + "puncsp;": '\U00002008', + "qfr;": '\U0001D52E', + "qint;": '\U00002A0C', + "qopf;": '\U0001D562', + "qprime;": '\U00002057', + "qscr;": '\U0001D4C6', + "quaternions;": '\U0000210D', + "quatint;": '\U00002A16', + "quest;": '\U0000003F', + "questeq;": '\U0000225F', + "quot;": '\U00000022', + "rAarr;": '\U000021DB', + "rArr;": '\U000021D2', + "rAtail;": '\U0000291C', + "rBarr;": '\U0000290F', + "rHar;": '\U00002964', + "racute;": '\U00000155', + "radic;": '\U0000221A', + "raemptyv;": '\U000029B3', + "rang;": '\U000027E9', + "rangd;": '\U00002992', + "range;": '\U000029A5', + "rangle;": '\U000027E9', + "raquo;": '\U000000BB', + "rarr;": '\U00002192', + "rarrap;": '\U00002975', + "rarrb;": '\U000021E5', + "rarrbfs;": '\U00002920', + "rarrc;": '\U00002933', + "rarrfs;": '\U0000291E', + "rarrhk;": '\U000021AA', + "rarrlp;": '\U000021AC', + "rarrpl;": '\U00002945', + "rarrsim;": '\U00002974', + "rarrtl;": '\U000021A3', + "rarrw;": '\U0000219D', + "ratail;": '\U0000291A', + "ratio;": '\U00002236', + "rationals;": '\U0000211A', + "rbarr;": '\U0000290D', + "rbbrk;": '\U00002773', + "rbrace;": '\U0000007D', + "rbrack;": '\U0000005D', + "rbrke;": '\U0000298C', + "rbrksld;": '\U0000298E', + "rbrkslu;": '\U00002990', + "rcaron;": '\U00000159', + "rcedil;": '\U00000157', + "rceil;": '\U00002309', + "rcub;": '\U0000007D', + "rcy;": '\U00000440', + "rdca;": '\U00002937', + "rdldhar;": '\U00002969', + "rdquo;": '\U0000201D', + "rdquor;": '\U0000201D', + "rdsh;": '\U000021B3', + "real;": '\U0000211C', + "realine;": '\U0000211B', + "realpart;": '\U0000211C', + "reals;": '\U0000211D', + "rect;": '\U000025AD', + "reg;": '\U000000AE', + "rfisht;": '\U0000297D', + "rfloor;": '\U0000230B', + "rfr;": '\U0001D52F', + "rhard;": '\U000021C1', + "rharu;": '\U000021C0', + "rharul;": '\U0000296C', + "rho;": '\U000003C1', + "rhov;": '\U000003F1', + "rightarrow;": '\U00002192', + "rightarrowtail;": '\U000021A3', + "rightharpoondown;": '\U000021C1', + "rightharpoonup;": '\U000021C0', + "rightleftarrows;": '\U000021C4', + "rightleftharpoons;": '\U000021CC', + "rightrightarrows;": '\U000021C9', + "rightsquigarrow;": '\U0000219D', + "rightthreetimes;": '\U000022CC', + "ring;": '\U000002DA', + "risingdotseq;": '\U00002253', + "rlarr;": '\U000021C4', + "rlhar;": '\U000021CC', + "rlm;": '\U0000200F', + "rmoust;": '\U000023B1', + "rmoustache;": '\U000023B1', + "rnmid;": '\U00002AEE', + "roang;": '\U000027ED', + "roarr;": '\U000021FE', + "robrk;": '\U000027E7', + "ropar;": '\U00002986', + "ropf;": '\U0001D563', + "roplus;": '\U00002A2E', + "rotimes;": '\U00002A35', + "rpar;": '\U00000029', + "rpargt;": '\U00002994', + "rppolint;": '\U00002A12', + "rrarr;": '\U000021C9', + "rsaquo;": '\U0000203A', + "rscr;": '\U0001D4C7', + "rsh;": '\U000021B1', + "rsqb;": '\U0000005D', + "rsquo;": '\U00002019', + "rsquor;": '\U00002019', + "rthree;": '\U000022CC', + "rtimes;": '\U000022CA', + "rtri;": '\U000025B9', + "rtrie;": '\U000022B5', + "rtrif;": '\U000025B8', + "rtriltri;": '\U000029CE', + "ruluhar;": '\U00002968', + "rx;": '\U0000211E', + "sacute;": '\U0000015B', + "sbquo;": '\U0000201A', + "sc;": '\U0000227B', + "scE;": '\U00002AB4', + "scap;": '\U00002AB8', + "scaron;": '\U00000161', + "sccue;": '\U0000227D', + "sce;": '\U00002AB0', + "scedil;": '\U0000015F', + "scirc;": '\U0000015D', + "scnE;": '\U00002AB6', + "scnap;": '\U00002ABA', + "scnsim;": '\U000022E9', + "scpolint;": '\U00002A13', + "scsim;": '\U0000227F', + "scy;": '\U00000441', + "sdot;": '\U000022C5', + "sdotb;": '\U000022A1', + "sdote;": '\U00002A66', + "seArr;": '\U000021D8', + "searhk;": '\U00002925', + "searr;": '\U00002198', + "searrow;": '\U00002198', + "sect;": '\U000000A7', + "semi;": '\U0000003B', + "seswar;": '\U00002929', + "setminus;": '\U00002216', + "setmn;": '\U00002216', + "sext;": '\U00002736', + "sfr;": '\U0001D530', + "sfrown;": '\U00002322', + "sharp;": '\U0000266F', + "shchcy;": '\U00000449', + "shcy;": '\U00000448', + "shortmid;": '\U00002223', + "shortparallel;": '\U00002225', + "shy;": '\U000000AD', + "sigma;": '\U000003C3', + "sigmaf;": '\U000003C2', + "sigmav;": '\U000003C2', + "sim;": '\U0000223C', + "simdot;": '\U00002A6A', + "sime;": '\U00002243', + "simeq;": '\U00002243', + "simg;": '\U00002A9E', + "simgE;": '\U00002AA0', + "siml;": '\U00002A9D', + "simlE;": '\U00002A9F', + "simne;": '\U00002246', + "simplus;": '\U00002A24', + "simrarr;": '\U00002972', + "slarr;": '\U00002190', + "smallsetminus;": '\U00002216', + "smashp;": '\U00002A33', + "smeparsl;": '\U000029E4', + "smid;": '\U00002223', + "smile;": '\U00002323', + "smt;": '\U00002AAA', + "smte;": '\U00002AAC', + "softcy;": '\U0000044C', + "sol;": '\U0000002F', + "solb;": '\U000029C4', + "solbar;": '\U0000233F', + "sopf;": '\U0001D564', + "spades;": '\U00002660', + "spadesuit;": '\U00002660', + "spar;": '\U00002225', + "sqcap;": '\U00002293', + "sqcup;": '\U00002294', + "sqsub;": '\U0000228F', + "sqsube;": '\U00002291', + "sqsubset;": '\U0000228F', + "sqsubseteq;": '\U00002291', + "sqsup;": '\U00002290', + "sqsupe;": '\U00002292', + "sqsupset;": '\U00002290', + "sqsupseteq;": '\U00002292', + "squ;": '\U000025A1', + "square;": '\U000025A1', + "squarf;": '\U000025AA', + "squf;": '\U000025AA', + "srarr;": '\U00002192', + "sscr;": '\U0001D4C8', + "ssetmn;": '\U00002216', + "ssmile;": '\U00002323', + "sstarf;": '\U000022C6', + "star;": '\U00002606', + "starf;": '\U00002605', + "straightepsilon;": '\U000003F5', + "straightphi;": '\U000003D5', + "strns;": '\U000000AF', + "sub;": '\U00002282', + "subE;": '\U00002AC5', + "subdot;": '\U00002ABD', + "sube;": '\U00002286', + "subedot;": '\U00002AC3', + "submult;": '\U00002AC1', + "subnE;": '\U00002ACB', + "subne;": '\U0000228A', + "subplus;": '\U00002ABF', + "subrarr;": '\U00002979', + "subset;": '\U00002282', + "subseteq;": '\U00002286', + "subseteqq;": '\U00002AC5', + "subsetneq;": '\U0000228A', + "subsetneqq;": '\U00002ACB', + "subsim;": '\U00002AC7', + "subsub;": '\U00002AD5', + "subsup;": '\U00002AD3', + "succ;": '\U0000227B', + "succapprox;": '\U00002AB8', + "succcurlyeq;": '\U0000227D', + "succeq;": '\U00002AB0', + "succnapprox;": '\U00002ABA', + "succneqq;": '\U00002AB6', + "succnsim;": '\U000022E9', + "succsim;": '\U0000227F', + "sum;": '\U00002211', + "sung;": '\U0000266A', + "sup;": '\U00002283', + "sup1;": '\U000000B9', + "sup2;": '\U000000B2', + "sup3;": '\U000000B3', + "supE;": '\U00002AC6', + "supdot;": '\U00002ABE', + "supdsub;": '\U00002AD8', + "supe;": '\U00002287', + "supedot;": '\U00002AC4', + "suphsol;": '\U000027C9', + "suphsub;": '\U00002AD7', + "suplarr;": '\U0000297B', + "supmult;": '\U00002AC2', + "supnE;": '\U00002ACC', + "supne;": '\U0000228B', + "supplus;": '\U00002AC0', + "supset;": '\U00002283', + "supseteq;": '\U00002287', + "supseteqq;": '\U00002AC6', + "supsetneq;": '\U0000228B', + "supsetneqq;": '\U00002ACC', + "supsim;": '\U00002AC8', + "supsub;": '\U00002AD4', + "supsup;": '\U00002AD6', + "swArr;": '\U000021D9', + "swarhk;": '\U00002926', + "swarr;": '\U00002199', + "swarrow;": '\U00002199', + "swnwar;": '\U0000292A', + "szlig;": '\U000000DF', + "target;": '\U00002316', + "tau;": '\U000003C4', + "tbrk;": '\U000023B4', + "tcaron;": '\U00000165', + "tcedil;": '\U00000163', + "tcy;": '\U00000442', + "tdot;": '\U000020DB', + "telrec;": '\U00002315', + "tfr;": '\U0001D531', + "there4;": '\U00002234', + "therefore;": '\U00002234', + "theta;": '\U000003B8', + "thetasym;": '\U000003D1', + "thetav;": '\U000003D1', + "thickapprox;": '\U00002248', + "thicksim;": '\U0000223C', + "thinsp;": '\U00002009', + "thkap;": '\U00002248', + "thksim;": '\U0000223C', + "thorn;": '\U000000FE', + "tilde;": '\U000002DC', + "times;": '\U000000D7', + "timesb;": '\U000022A0', + "timesbar;": '\U00002A31', + "timesd;": '\U00002A30', + "tint;": '\U0000222D', + "toea;": '\U00002928', + "top;": '\U000022A4', + "topbot;": '\U00002336', + "topcir;": '\U00002AF1', + "topf;": '\U0001D565', + "topfork;": '\U00002ADA', + "tosa;": '\U00002929', + "tprime;": '\U00002034', + "trade;": '\U00002122', + "triangle;": '\U000025B5', + "triangledown;": '\U000025BF', + "triangleleft;": '\U000025C3', + "trianglelefteq;": '\U000022B4', + "triangleq;": '\U0000225C', + "triangleright;": '\U000025B9', + "trianglerighteq;": '\U000022B5', + "tridot;": '\U000025EC', + "trie;": '\U0000225C', + "triminus;": '\U00002A3A', + "triplus;": '\U00002A39', + "trisb;": '\U000029CD', + "tritime;": '\U00002A3B', + "trpezium;": '\U000023E2', + "tscr;": '\U0001D4C9', + "tscy;": '\U00000446', + "tshcy;": '\U0000045B', + "tstrok;": '\U00000167', + "twixt;": '\U0000226C', + "twoheadleftarrow;": '\U0000219E', + "twoheadrightarrow;": '\U000021A0', + "uArr;": '\U000021D1', + "uHar;": '\U00002963', + "uacute;": '\U000000FA', + "uarr;": '\U00002191', + "ubrcy;": '\U0000045E', + "ubreve;": '\U0000016D', + "ucirc;": '\U000000FB', + "ucy;": '\U00000443', + "udarr;": '\U000021C5', + "udblac;": '\U00000171', + "udhar;": '\U0000296E', + "ufisht;": '\U0000297E', + "ufr;": '\U0001D532', + "ugrave;": '\U000000F9', + "uharl;": '\U000021BF', + "uharr;": '\U000021BE', + "uhblk;": '\U00002580', + "ulcorn;": '\U0000231C', + "ulcorner;": '\U0000231C', + "ulcrop;": '\U0000230F', + "ultri;": '\U000025F8', + "umacr;": '\U0000016B', + "uml;": '\U000000A8', + "uogon;": '\U00000173', + "uopf;": '\U0001D566', + "uparrow;": '\U00002191', + "updownarrow;": '\U00002195', + "upharpoonleft;": '\U000021BF', + "upharpoonright;": '\U000021BE', + "uplus;": '\U0000228E', + "upsi;": '\U000003C5', + "upsih;": '\U000003D2', + "upsilon;": '\U000003C5', + "upuparrows;": '\U000021C8', + "urcorn;": '\U0000231D', + "urcorner;": '\U0000231D', + "urcrop;": '\U0000230E', + "uring;": '\U0000016F', + "urtri;": '\U000025F9', + "uscr;": '\U0001D4CA', + "utdot;": '\U000022F0', + "utilde;": '\U00000169', + "utri;": '\U000025B5', + "utrif;": '\U000025B4', + "uuarr;": '\U000021C8', + "uuml;": '\U000000FC', + "uwangle;": '\U000029A7', + "vArr;": '\U000021D5', + "vBar;": '\U00002AE8', + "vBarv;": '\U00002AE9', + "vDash;": '\U000022A8', + "vangrt;": '\U0000299C', + "varepsilon;": '\U000003F5', + "varkappa;": '\U000003F0', + "varnothing;": '\U00002205', + "varphi;": '\U000003D5', + "varpi;": '\U000003D6', + "varpropto;": '\U0000221D', + "varr;": '\U00002195', + "varrho;": '\U000003F1', + "varsigma;": '\U000003C2', + "vartheta;": '\U000003D1', + "vartriangleleft;": '\U000022B2', + "vartriangleright;": '\U000022B3', + "vcy;": '\U00000432', + "vdash;": '\U000022A2', + "vee;": '\U00002228', + "veebar;": '\U000022BB', + "veeeq;": '\U0000225A', + "vellip;": '\U000022EE', + "verbar;": '\U0000007C', + "vert;": '\U0000007C', + "vfr;": '\U0001D533', + "vltri;": '\U000022B2', + "vopf;": '\U0001D567', + "vprop;": '\U0000221D', + "vrtri;": '\U000022B3', + "vscr;": '\U0001D4CB', + "vzigzag;": '\U0000299A', + "wcirc;": '\U00000175', + "wedbar;": '\U00002A5F', + "wedge;": '\U00002227', + "wedgeq;": '\U00002259', + "weierp;": '\U00002118', + "wfr;": '\U0001D534', + "wopf;": '\U0001D568', + "wp;": '\U00002118', + "wr;": '\U00002240', + "wreath;": '\U00002240', + "wscr;": '\U0001D4CC', + "xcap;": '\U000022C2', + "xcirc;": '\U000025EF', + "xcup;": '\U000022C3', + "xdtri;": '\U000025BD', + "xfr;": '\U0001D535', + "xhArr;": '\U000027FA', + "xharr;": '\U000027F7', + "xi;": '\U000003BE', + "xlArr;": '\U000027F8', + "xlarr;": '\U000027F5', + "xmap;": '\U000027FC', + "xnis;": '\U000022FB', + "xodot;": '\U00002A00', + "xopf;": '\U0001D569', + "xoplus;": '\U00002A01', + "xotime;": '\U00002A02', + "xrArr;": '\U000027F9', + "xrarr;": '\U000027F6', + "xscr;": '\U0001D4CD', + "xsqcup;": '\U00002A06', + "xuplus;": '\U00002A04', + "xutri;": '\U000025B3', + "xvee;": '\U000022C1', + "xwedge;": '\U000022C0', + "yacute;": '\U000000FD', + "yacy;": '\U0000044F', + "ycirc;": '\U00000177', + "ycy;": '\U0000044B', + "yen;": '\U000000A5', + "yfr;": '\U0001D536', + "yicy;": '\U00000457', + "yopf;": '\U0001D56A', + "yscr;": '\U0001D4CE', + "yucy;": '\U0000044E', + "yuml;": '\U000000FF', + "zacute;": '\U0000017A', + "zcaron;": '\U0000017E', + "zcy;": '\U00000437', + "zdot;": '\U0000017C', + "zeetrf;": '\U00002128', + "zeta;": '\U000003B6', + "zfr;": '\U0001D537', + "zhcy;": '\U00000436', + "zigrarr;": '\U000021DD', + "zopf;": '\U0001D56B', + "zscr;": '\U0001D4CF', + "zwj;": '\U0000200D', + "zwnj;": '\U0000200C', + "AElig": '\U000000C6', + "AMP": '\U00000026', + "Aacute": '\U000000C1', + "Acirc": '\U000000C2', + "Agrave": '\U000000C0', + "Aring": '\U000000C5', + "Atilde": '\U000000C3', + "Auml": '\U000000C4', + "COPY": '\U000000A9', + "Ccedil": '\U000000C7', + "ETH": '\U000000D0', + "Eacute": '\U000000C9', + "Ecirc": '\U000000CA', + "Egrave": '\U000000C8', + "Euml": '\U000000CB', + "GT": '\U0000003E', + "Iacute": '\U000000CD', + "Icirc": '\U000000CE', + "Igrave": '\U000000CC', + "Iuml": '\U000000CF', + "LT": '\U0000003C', + "Ntilde": '\U000000D1', + "Oacute": '\U000000D3', + "Ocirc": '\U000000D4', + "Ograve": '\U000000D2', + "Oslash": '\U000000D8', + "Otilde": '\U000000D5', + "Ouml": '\U000000D6', + "QUOT": '\U00000022', + "REG": '\U000000AE', + "THORN": '\U000000DE', + "Uacute": '\U000000DA', + "Ucirc": '\U000000DB', + "Ugrave": '\U000000D9', + "Uuml": '\U000000DC', + "Yacute": '\U000000DD', + "aacute": '\U000000E1', + "acirc": '\U000000E2', + "acute": '\U000000B4', + "aelig": '\U000000E6', + "agrave": '\U000000E0', + "amp": '\U00000026', + "aring": '\U000000E5', + "atilde": '\U000000E3', + "auml": '\U000000E4', + "brvbar": '\U000000A6', + "ccedil": '\U000000E7', + "cedil": '\U000000B8', + "cent": '\U000000A2', + "copy": '\U000000A9', + "curren": '\U000000A4', + "deg": '\U000000B0', + "divide": '\U000000F7', + "eacute": '\U000000E9', + "ecirc": '\U000000EA', + "egrave": '\U000000E8', + "eth": '\U000000F0', + "euml": '\U000000EB', + "frac12": '\U000000BD', + "frac14": '\U000000BC', + "frac34": '\U000000BE', + "gt": '\U0000003E', + "iacute": '\U000000ED', + "icirc": '\U000000EE', + "iexcl": '\U000000A1', + "igrave": '\U000000EC', + "iquest": '\U000000BF', + "iuml": '\U000000EF', + "laquo": '\U000000AB', + "lt": '\U0000003C', + "macr": '\U000000AF', + "micro": '\U000000B5', + "middot": '\U000000B7', + "nbsp": '\U000000A0', + "not": '\U000000AC', + "ntilde": '\U000000F1', + "oacute": '\U000000F3', + "ocirc": '\U000000F4', + "ograve": '\U000000F2', + "ordf": '\U000000AA', + "ordm": '\U000000BA', + "oslash": '\U000000F8', + "otilde": '\U000000F5', + "ouml": '\U000000F6', + "para": '\U000000B6', + "plusmn": '\U000000B1', + "pound": '\U000000A3', + "quot": '\U00000022', + "raquo": '\U000000BB', + "reg": '\U000000AE', + "sect": '\U000000A7', + "shy": '\U000000AD', + "sup1": '\U000000B9', + "sup2": '\U000000B2', + "sup3": '\U000000B3', + "szlig": '\U000000DF', + "thorn": '\U000000FE', + "times": '\U000000D7', + "uacute": '\U000000FA', + "ucirc": '\U000000FB', + "ugrave": '\U000000F9', + "uml": '\U000000A8', + "uuml": '\U000000FC', + "yacute": '\U000000FD', + "yen": '\U000000A5', + "yuml": '\U000000FF', +} + +// HTML entities that are two unicode codepoints. +var entity2 = map[string][2]rune{ + // TODO(nigeltao): Handle replacements that are wider than their names. + // "nLt;": {'\u226A', '\u20D2'}, + // "nGt;": {'\u226B', '\u20D2'}, + "NotEqualTilde;": {'\u2242', '\u0338'}, + "NotGreaterFullEqual;": {'\u2267', '\u0338'}, + "NotGreaterGreater;": {'\u226B', '\u0338'}, + "NotGreaterSlantEqual;": {'\u2A7E', '\u0338'}, + "NotHumpDownHump;": {'\u224E', '\u0338'}, + "NotHumpEqual;": {'\u224F', '\u0338'}, + "NotLeftTriangleBar;": {'\u29CF', '\u0338'}, + "NotLessLess;": {'\u226A', '\u0338'}, + "NotLessSlantEqual;": {'\u2A7D', '\u0338'}, + "NotNestedGreaterGreater;": {'\u2AA2', '\u0338'}, + "NotNestedLessLess;": {'\u2AA1', '\u0338'}, + "NotPrecedesEqual;": {'\u2AAF', '\u0338'}, + "NotRightTriangleBar;": {'\u29D0', '\u0338'}, + "NotSquareSubset;": {'\u228F', '\u0338'}, + "NotSquareSuperset;": {'\u2290', '\u0338'}, + "NotSubset;": {'\u2282', '\u20D2'}, + "NotSucceedsEqual;": {'\u2AB0', '\u0338'}, + "NotSucceedsTilde;": {'\u227F', '\u0338'}, + "NotSuperset;": {'\u2283', '\u20D2'}, + "ThickSpace;": {'\u205F', '\u200A'}, + "acE;": {'\u223E', '\u0333'}, + "bne;": {'\u003D', '\u20E5'}, + "bnequiv;": {'\u2261', '\u20E5'}, + "caps;": {'\u2229', '\uFE00'}, + "cups;": {'\u222A', '\uFE00'}, + "fjlig;": {'\u0066', '\u006A'}, + "gesl;": {'\u22DB', '\uFE00'}, + "gvertneqq;": {'\u2269', '\uFE00'}, + "gvnE;": {'\u2269', '\uFE00'}, + "lates;": {'\u2AAD', '\uFE00'}, + "lesg;": {'\u22DA', '\uFE00'}, + "lvertneqq;": {'\u2268', '\uFE00'}, + "lvnE;": {'\u2268', '\uFE00'}, + "nGg;": {'\u22D9', '\u0338'}, + "nGtv;": {'\u226B', '\u0338'}, + "nLl;": {'\u22D8', '\u0338'}, + "nLtv;": {'\u226A', '\u0338'}, + "nang;": {'\u2220', '\u20D2'}, + "napE;": {'\u2A70', '\u0338'}, + "napid;": {'\u224B', '\u0338'}, + "nbump;": {'\u224E', '\u0338'}, + "nbumpe;": {'\u224F', '\u0338'}, + "ncongdot;": {'\u2A6D', '\u0338'}, + "nedot;": {'\u2250', '\u0338'}, + "nesim;": {'\u2242', '\u0338'}, + "ngE;": {'\u2267', '\u0338'}, + "ngeqq;": {'\u2267', '\u0338'}, + "ngeqslant;": {'\u2A7E', '\u0338'}, + "nges;": {'\u2A7E', '\u0338'}, + "nlE;": {'\u2266', '\u0338'}, + "nleqq;": {'\u2266', '\u0338'}, + "nleqslant;": {'\u2A7D', '\u0338'}, + "nles;": {'\u2A7D', '\u0338'}, + "notinE;": {'\u22F9', '\u0338'}, + "notindot;": {'\u22F5', '\u0338'}, + "nparsl;": {'\u2AFD', '\u20E5'}, + "npart;": {'\u2202', '\u0338'}, + "npre;": {'\u2AAF', '\u0338'}, + "npreceq;": {'\u2AAF', '\u0338'}, + "nrarrc;": {'\u2933', '\u0338'}, + "nrarrw;": {'\u219D', '\u0338'}, + "nsce;": {'\u2AB0', '\u0338'}, + "nsubE;": {'\u2AC5', '\u0338'}, + "nsubset;": {'\u2282', '\u20D2'}, + "nsubseteqq;": {'\u2AC5', '\u0338'}, + "nsucceq;": {'\u2AB0', '\u0338'}, + "nsupE;": {'\u2AC6', '\u0338'}, + "nsupset;": {'\u2283', '\u20D2'}, + "nsupseteqq;": {'\u2AC6', '\u0338'}, + "nvap;": {'\u224D', '\u20D2'}, + "nvge;": {'\u2265', '\u20D2'}, + "nvgt;": {'\u003E', '\u20D2'}, + "nvle;": {'\u2264', '\u20D2'}, + "nvlt;": {'\u003C', '\u20D2'}, + "nvltrie;": {'\u22B4', '\u20D2'}, + "nvrtrie;": {'\u22B5', '\u20D2'}, + "nvsim;": {'\u223C', '\u20D2'}, + "race;": {'\u223D', '\u0331'}, + "smtes;": {'\u2AAC', '\uFE00'}, + "sqcaps;": {'\u2293', '\uFE00'}, + "sqcups;": {'\u2294', '\uFE00'}, + "varsubsetneq;": {'\u228A', '\uFE00'}, + "varsubsetneqq;": {'\u2ACB', '\uFE00'}, + "varsupsetneq;": {'\u228B', '\uFE00'}, + "varsupsetneqq;": {'\u2ACC', '\uFE00'}, + "vnsub;": {'\u2282', '\u20D2'}, + "vnsup;": {'\u2283', '\u20D2'}, + "vsubnE;": {'\u2ACB', '\uFE00'}, + "vsubne;": {'\u228A', '\uFE00'}, + "vsupnE;": {'\u2ACC', '\uFE00'}, + "vsupne;": {'\u228B', '\uFE00'}, +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/escape.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/escape.go new file mode 100644 index 00000000..d8561396 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/escape.go @@ -0,0 +1,258 @@ +// Copyright 2010 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. + +package html + +import ( + "bytes" + "strings" + "unicode/utf8" +) + +// These replacements permit compatibility with old numeric entities that +// assumed Windows-1252 encoding. +// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference +var replacementTable = [...]rune{ + '\u20AC', // First entry is what 0x80 should be replaced with. + '\u0081', + '\u201A', + '\u0192', + '\u201E', + '\u2026', + '\u2020', + '\u2021', + '\u02C6', + '\u2030', + '\u0160', + '\u2039', + '\u0152', + '\u008D', + '\u017D', + '\u008F', + '\u0090', + '\u2018', + '\u2019', + '\u201C', + '\u201D', + '\u2022', + '\u2013', + '\u2014', + '\u02DC', + '\u2122', + '\u0161', + '\u203A', + '\u0153', + '\u009D', + '\u017E', + '\u0178', // Last entry is 0x9F. + // 0x00->'\uFFFD' is handled programmatically. + // 0x0D->'\u000D' is a no-op. +} + +// unescapeEntity reads an entity like "<" from b[src:] and writes the +// corresponding "<" to b[dst:], returning the incremented dst and src cursors. +// Precondition: b[src] == '&' && dst <= src. +// attribute should be true if parsing an attribute value. +func unescapeEntity(b []byte, dst, src int, attribute bool) (dst1, src1 int) { + // https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference + + // i starts at 1 because we already know that s[0] == '&'. + i, s := 1, b[src:] + + if len(s) <= 1 { + b[dst] = b[src] + return dst + 1, src + 1 + } + + if s[i] == '#' { + if len(s) <= 3 { // We need to have at least "&#.". + b[dst] = b[src] + return dst + 1, src + 1 + } + i++ + c := s[i] + hex := false + if c == 'x' || c == 'X' { + hex = true + i++ + } + + x := '\x00' + for i < len(s) { + c = s[i] + i++ + if hex { + if '0' <= c && c <= '9' { + x = 16*x + rune(c) - '0' + continue + } else if 'a' <= c && c <= 'f' { + x = 16*x + rune(c) - 'a' + 10 + continue + } else if 'A' <= c && c <= 'F' { + x = 16*x + rune(c) - 'A' + 10 + continue + } + } else if '0' <= c && c <= '9' { + x = 10*x + rune(c) - '0' + continue + } + if c != ';' { + i-- + } + break + } + + if i <= 3 { // No characters matched. + b[dst] = b[src] + return dst + 1, src + 1 + } + + if 0x80 <= x && x <= 0x9F { + // Replace characters from Windows-1252 with UTF-8 equivalents. + x = replacementTable[x-0x80] + } else if x == 0 || (0xD800 <= x && x <= 0xDFFF) || x > 0x10FFFF { + // Replace invalid characters with the replacement character. + x = '\uFFFD' + } + + return dst + utf8.EncodeRune(b[dst:], x), src + i + } + + // Consume the maximum number of characters possible, with the + // consumed characters matching one of the named references. + + for i < len(s) { + c := s[i] + i++ + // Lower-cased characters are more common in entities, so we check for them first. + if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { + continue + } + if c != ';' { + i-- + } + break + } + + entityName := string(s[1:i]) + if entityName == "" { + // No-op. + } else if attribute && entityName[len(entityName)-1] != ';' && len(s) > i && s[i] == '=' { + // No-op. + } else if x := entity[entityName]; x != 0 { + return dst + utf8.EncodeRune(b[dst:], x), src + i + } else if x := entity2[entityName]; x[0] != 0 { + dst1 := dst + utf8.EncodeRune(b[dst:], x[0]) + return dst1 + utf8.EncodeRune(b[dst1:], x[1]), src + i + } else if !attribute { + maxLen := len(entityName) - 1 + if maxLen > longestEntityWithoutSemicolon { + maxLen = longestEntityWithoutSemicolon + } + for j := maxLen; j > 1; j-- { + if x := entity[entityName[:j]]; x != 0 { + return dst + utf8.EncodeRune(b[dst:], x), src + j + 1 + } + } + } + + dst1, src1 = dst+i, src+i + copy(b[dst:dst1], b[src:src1]) + return dst1, src1 +} + +// unescape unescapes b's entities in-place, so that "a<b" becomes "a': + esc = ">" + case '"': + // """ is shorter than """. + esc = """ + case '\r': + esc = " " + default: + panic("unrecognized escape character") + } + s = s[i+1:] + if _, err := w.WriteString(esc); err != nil { + return err + } + i = strings.IndexAny(s, escapedChars) + } + _, err := w.WriteString(s) + return err +} + +// EscapeString escapes special characters like "<" to become "<". It +// escapes only five such characters: <, >, &, ' and ". +// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't +// always true. +func EscapeString(s string) string { + if strings.IndexAny(s, escapedChars) == -1 { + return s + } + var buf bytes.Buffer + escape(&buf, s) + return buf.String() +} + +// UnescapeString unescapes entities like "<" to become "<". It unescapes a +// larger range of entities than EscapeString escapes. For example, "á" +// unescapes to "á", as does "á" and "&xE1;". +// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't +// always true. +func UnescapeString(s string) string { + for _, c := range s { + if c == '&' { + return string(unescape([]byte(s), false)) + } + } + return s +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/foreign.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/foreign.go new file mode 100644 index 00000000..d3b38440 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/foreign.go @@ -0,0 +1,226 @@ +// Copyright 2011 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. + +package html + +import ( + "strings" +) + +func adjustAttributeNames(aa []Attribute, nameMap map[string]string) { + for i := range aa { + if newName, ok := nameMap[aa[i].Key]; ok { + aa[i].Key = newName + } + } +} + +func adjustForeignAttributes(aa []Attribute) { + for i, a := range aa { + if a.Key == "" || a.Key[0] != 'x' { + continue + } + switch a.Key { + case "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show", + "xlink:title", "xlink:type", "xml:base", "xml:lang", "xml:space", "xmlns:xlink": + j := strings.Index(a.Key, ":") + aa[i].Namespace = a.Key[:j] + aa[i].Key = a.Key[j+1:] + } + } +} + +func htmlIntegrationPoint(n *Node) bool { + if n.Type != ElementNode { + return false + } + switch n.Namespace { + case "math": + if n.Data == "annotation-xml" { + for _, a := range n.Attr { + if a.Key == "encoding" { + val := strings.ToLower(a.Val) + if val == "text/html" || val == "application/xhtml+xml" { + return true + } + } + } + } + case "svg": + switch n.Data { + case "desc", "foreignObject", "title": + return true + } + } + return false +} + +func mathMLTextIntegrationPoint(n *Node) bool { + if n.Namespace != "math" { + return false + } + switch n.Data { + case "mi", "mo", "mn", "ms", "mtext": + return true + } + return false +} + +// Section 12.2.5.5. +var breakout = map[string]bool{ + "b": true, + "big": true, + "blockquote": true, + "body": true, + "br": true, + "center": true, + "code": true, + "dd": true, + "div": true, + "dl": true, + "dt": true, + "em": true, + "embed": true, + "h1": true, + "h2": true, + "h3": true, + "h4": true, + "h5": true, + "h6": true, + "head": true, + "hr": true, + "i": true, + "img": true, + "li": true, + "listing": true, + "menu": true, + "meta": true, + "nobr": true, + "ol": true, + "p": true, + "pre": true, + "ruby": true, + "s": true, + "small": true, + "span": true, + "strong": true, + "strike": true, + "sub": true, + "sup": true, + "table": true, + "tt": true, + "u": true, + "ul": true, + "var": true, +} + +// Section 12.2.5.5. +var svgTagNameAdjustments = map[string]string{ + "altglyph": "altGlyph", + "altglyphdef": "altGlyphDef", + "altglyphitem": "altGlyphItem", + "animatecolor": "animateColor", + "animatemotion": "animateMotion", + "animatetransform": "animateTransform", + "clippath": "clipPath", + "feblend": "feBlend", + "fecolormatrix": "feColorMatrix", + "fecomponenttransfer": "feComponentTransfer", + "fecomposite": "feComposite", + "feconvolvematrix": "feConvolveMatrix", + "fediffuselighting": "feDiffuseLighting", + "fedisplacementmap": "feDisplacementMap", + "fedistantlight": "feDistantLight", + "feflood": "feFlood", + "fefunca": "feFuncA", + "fefuncb": "feFuncB", + "fefuncg": "feFuncG", + "fefuncr": "feFuncR", + "fegaussianblur": "feGaussianBlur", + "feimage": "feImage", + "femerge": "feMerge", + "femergenode": "feMergeNode", + "femorphology": "feMorphology", + "feoffset": "feOffset", + "fepointlight": "fePointLight", + "fespecularlighting": "feSpecularLighting", + "fespotlight": "feSpotLight", + "fetile": "feTile", + "feturbulence": "feTurbulence", + "foreignobject": "foreignObject", + "glyphref": "glyphRef", + "lineargradient": "linearGradient", + "radialgradient": "radialGradient", + "textpath": "textPath", +} + +// Section 12.2.5.1 +var mathMLAttributeAdjustments = map[string]string{ + "definitionurl": "definitionURL", +} + +var svgAttributeAdjustments = map[string]string{ + "attributename": "attributeName", + "attributetype": "attributeType", + "basefrequency": "baseFrequency", + "baseprofile": "baseProfile", + "calcmode": "calcMode", + "clippathunits": "clipPathUnits", + "contentscripttype": "contentScriptType", + "contentstyletype": "contentStyleType", + "diffuseconstant": "diffuseConstant", + "edgemode": "edgeMode", + "externalresourcesrequired": "externalResourcesRequired", + "filterres": "filterRes", + "filterunits": "filterUnits", + "glyphref": "glyphRef", + "gradienttransform": "gradientTransform", + "gradientunits": "gradientUnits", + "kernelmatrix": "kernelMatrix", + "kernelunitlength": "kernelUnitLength", + "keypoints": "keyPoints", + "keysplines": "keySplines", + "keytimes": "keyTimes", + "lengthadjust": "lengthAdjust", + "limitingconeangle": "limitingConeAngle", + "markerheight": "markerHeight", + "markerunits": "markerUnits", + "markerwidth": "markerWidth", + "maskcontentunits": "maskContentUnits", + "maskunits": "maskUnits", + "numoctaves": "numOctaves", + "pathlength": "pathLength", + "patterncontentunits": "patternContentUnits", + "patterntransform": "patternTransform", + "patternunits": "patternUnits", + "pointsatx": "pointsAtX", + "pointsaty": "pointsAtY", + "pointsatz": "pointsAtZ", + "preservealpha": "preserveAlpha", + "preserveaspectratio": "preserveAspectRatio", + "primitiveunits": "primitiveUnits", + "refx": "refX", + "refy": "refY", + "repeatcount": "repeatCount", + "repeatdur": "repeatDur", + "requiredextensions": "requiredExtensions", + "requiredfeatures": "requiredFeatures", + "specularconstant": "specularConstant", + "specularexponent": "specularExponent", + "spreadmethod": "spreadMethod", + "startoffset": "startOffset", + "stddeviation": "stdDeviation", + "stitchtiles": "stitchTiles", + "surfacescale": "surfaceScale", + "systemlanguage": "systemLanguage", + "tablevalues": "tableValues", + "targetx": "targetX", + "targety": "targetY", + "textlength": "textLength", + "viewbox": "viewBox", + "viewtarget": "viewTarget", + "xchannelselector": "xChannelSelector", + "ychannelselector": "yChannelSelector", + "zoomandpan": "zoomAndPan", +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/node.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/node.go new file mode 100644 index 00000000..26b657ae --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/node.go @@ -0,0 +1,193 @@ +// Copyright 2011 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. + +package html + +import ( + "golang.org/x/net/html/atom" +) + +// A NodeType is the type of a Node. +type NodeType uint32 + +const ( + ErrorNode NodeType = iota + TextNode + DocumentNode + ElementNode + CommentNode + DoctypeNode + scopeMarkerNode +) + +// Section 12.2.3.3 says "scope markers are inserted when entering applet +// elements, buttons, object elements, marquees, table cells, and table +// captions, and are used to prevent formatting from 'leaking'". +var scopeMarker = Node{Type: scopeMarkerNode} + +// A Node consists of a NodeType and some Data (tag name for element nodes, +// content for text) and are part of a tree of Nodes. Element nodes may also +// have a Namespace and contain a slice of Attributes. Data is unescaped, so +// that it looks like "a 0 { + return (*s)[i-1] + } + return nil +} + +// index returns the index of the top-most occurrence of n in the stack, or -1 +// if n is not present. +func (s *nodeStack) index(n *Node) int { + for i := len(*s) - 1; i >= 0; i-- { + if (*s)[i] == n { + return i + } + } + return -1 +} + +// insert inserts a node at the given index. +func (s *nodeStack) insert(i int, n *Node) { + (*s) = append(*s, nil) + copy((*s)[i+1:], (*s)[i:]) + (*s)[i] = n +} + +// remove removes a node from the stack. It is a no-op if n is not present. +func (s *nodeStack) remove(n *Node) { + i := s.index(n) + if i == -1 { + return + } + copy((*s)[i:], (*s)[i+1:]) + j := len(*s) - 1 + (*s)[j] = nil + *s = (*s)[:j] +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/parse.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/parse.go new file mode 100644 index 00000000..be4b2bf5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/parse.go @@ -0,0 +1,2094 @@ +// Copyright 2010 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. + +package html + +import ( + "errors" + "fmt" + "io" + "strings" + + a "golang.org/x/net/html/atom" +) + +// A parser implements the HTML5 parsing algorithm: +// https://html.spec.whatwg.org/multipage/syntax.html#tree-construction +type parser struct { + // tokenizer provides the tokens for the parser. + tokenizer *Tokenizer + // tok is the most recently read token. + tok Token + // Self-closing tags like
are treated as start tags, except that + // hasSelfClosingToken is set while they are being processed. + hasSelfClosingToken bool + // doc is the document root element. + doc *Node + // The stack of open elements (section 12.2.3.2) and active formatting + // elements (section 12.2.3.3). + oe, afe nodeStack + // Element pointers (section 12.2.3.4). + head, form *Node + // Other parsing state flags (section 12.2.3.5). + scripting, framesetOK bool + // im is the current insertion mode. + im insertionMode + // originalIM is the insertion mode to go back to after completing a text + // or inTableText insertion mode. + originalIM insertionMode + // fosterParenting is whether new elements should be inserted according to + // the foster parenting rules (section 12.2.5.3). + fosterParenting bool + // quirks is whether the parser is operating in "quirks mode." + quirks bool + // fragment is whether the parser is parsing an HTML fragment. + fragment bool + // context is the context element when parsing an HTML fragment + // (section 12.4). + context *Node +} + +func (p *parser) top() *Node { + if n := p.oe.top(); n != nil { + return n + } + return p.doc +} + +// Stop tags for use in popUntil. These come from section 12.2.3.2. +var ( + defaultScopeStopTags = map[string][]a.Atom{ + "": {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template}, + "math": {a.AnnotationXml, a.Mi, a.Mn, a.Mo, a.Ms, a.Mtext}, + "svg": {a.Desc, a.ForeignObject, a.Title}, + } +) + +type scope int + +const ( + defaultScope scope = iota + listItemScope + buttonScope + tableScope + tableRowScope + tableBodyScope + selectScope +) + +// popUntil pops the stack of open elements at the highest element whose tag +// is in matchTags, provided there is no higher element in the scope's stop +// tags (as defined in section 12.2.3.2). It returns whether or not there was +// such an element. If there was not, popUntil leaves the stack unchanged. +// +// For example, the set of stop tags for table scope is: "html", "table". If +// the stack was: +// ["html", "body", "font", "table", "b", "i", "u"] +// then popUntil(tableScope, "font") would return false, but +// popUntil(tableScope, "i") would return true and the stack would become: +// ["html", "body", "font", "table", "b"] +// +// If an element's tag is in both the stop tags and matchTags, then the stack +// will be popped and the function returns true (provided, of course, there was +// no higher element in the stack that was also in the stop tags). For example, +// popUntil(tableScope, "table") returns true and leaves: +// ["html", "body", "font"] +func (p *parser) popUntil(s scope, matchTags ...a.Atom) bool { + if i := p.indexOfElementInScope(s, matchTags...); i != -1 { + p.oe = p.oe[:i] + return true + } + return false +} + +// indexOfElementInScope returns the index in p.oe of the highest element whose +// tag is in matchTags that is in scope. If no matching element is in scope, it +// returns -1. +func (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int { + for i := len(p.oe) - 1; i >= 0; i-- { + tagAtom := p.oe[i].DataAtom + if p.oe[i].Namespace == "" { + for _, t := range matchTags { + if t == tagAtom { + return i + } + } + switch s { + case defaultScope: + // No-op. + case listItemScope: + if tagAtom == a.Ol || tagAtom == a.Ul { + return -1 + } + case buttonScope: + if tagAtom == a.Button { + return -1 + } + case tableScope: + if tagAtom == a.Html || tagAtom == a.Table { + return -1 + } + case selectScope: + if tagAtom != a.Optgroup && tagAtom != a.Option { + return -1 + } + default: + panic("unreachable") + } + } + switch s { + case defaultScope, listItemScope, buttonScope: + for _, t := range defaultScopeStopTags[p.oe[i].Namespace] { + if t == tagAtom { + return -1 + } + } + } + } + return -1 +} + +// elementInScope is like popUntil, except that it doesn't modify the stack of +// open elements. +func (p *parser) elementInScope(s scope, matchTags ...a.Atom) bool { + return p.indexOfElementInScope(s, matchTags...) != -1 +} + +// clearStackToContext pops elements off the stack of open elements until a +// scope-defined element is found. +func (p *parser) clearStackToContext(s scope) { + for i := len(p.oe) - 1; i >= 0; i-- { + tagAtom := p.oe[i].DataAtom + switch s { + case tableScope: + if tagAtom == a.Html || tagAtom == a.Table { + p.oe = p.oe[:i+1] + return + } + case tableRowScope: + if tagAtom == a.Html || tagAtom == a.Tr { + p.oe = p.oe[:i+1] + return + } + case tableBodyScope: + if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead { + p.oe = p.oe[:i+1] + return + } + default: + panic("unreachable") + } + } +} + +// generateImpliedEndTags pops nodes off the stack of open elements as long as +// the top node has a tag name of dd, dt, li, option, optgroup, p, rp, or rt. +// If exceptions are specified, nodes with that name will not be popped off. +func (p *parser) generateImpliedEndTags(exceptions ...string) { + var i int +loop: + for i = len(p.oe) - 1; i >= 0; i-- { + n := p.oe[i] + if n.Type == ElementNode { + switch n.DataAtom { + case a.Dd, a.Dt, a.Li, a.Option, a.Optgroup, a.P, a.Rp, a.Rt: + for _, except := range exceptions { + if n.Data == except { + break loop + } + } + continue + } + } + break + } + + p.oe = p.oe[:i+1] +} + +// addChild adds a child node n to the top element, and pushes n onto the stack +// of open elements if it is an element node. +func (p *parser) addChild(n *Node) { + if p.shouldFosterParent() { + p.fosterParent(n) + } else { + p.top().AppendChild(n) + } + + if n.Type == ElementNode { + p.oe = append(p.oe, n) + } +} + +// shouldFosterParent returns whether the next node to be added should be +// foster parented. +func (p *parser) shouldFosterParent() bool { + if p.fosterParenting { + switch p.top().DataAtom { + case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr: + return true + } + } + return false +} + +// fosterParent adds a child node according to the foster parenting rules. +// Section 12.2.5.3, "foster parenting". +func (p *parser) fosterParent(n *Node) { + var table, parent, prev *Node + var i int + for i = len(p.oe) - 1; i >= 0; i-- { + if p.oe[i].DataAtom == a.Table { + table = p.oe[i] + break + } + } + + if table == nil { + // The foster parent is the html element. + parent = p.oe[0] + } else { + parent = table.Parent + } + if parent == nil { + parent = p.oe[i-1] + } + + if table != nil { + prev = table.PrevSibling + } else { + prev = parent.LastChild + } + if prev != nil && prev.Type == TextNode && n.Type == TextNode { + prev.Data += n.Data + return + } + + parent.InsertBefore(n, table) +} + +// addText adds text to the preceding node if it is a text node, or else it +// calls addChild with a new text node. +func (p *parser) addText(text string) { + if text == "" { + return + } + + if p.shouldFosterParent() { + p.fosterParent(&Node{ + Type: TextNode, + Data: text, + }) + return + } + + t := p.top() + if n := t.LastChild; n != nil && n.Type == TextNode { + n.Data += text + return + } + p.addChild(&Node{ + Type: TextNode, + Data: text, + }) +} + +// addElement adds a child element based on the current token. +func (p *parser) addElement() { + p.addChild(&Node{ + Type: ElementNode, + DataAtom: p.tok.DataAtom, + Data: p.tok.Data, + Attr: p.tok.Attr, + }) +} + +// Section 12.2.3.3. +func (p *parser) addFormattingElement() { + tagAtom, attr := p.tok.DataAtom, p.tok.Attr + p.addElement() + + // Implement the Noah's Ark clause, but with three per family instead of two. + identicalElements := 0 +findIdenticalElements: + for i := len(p.afe) - 1; i >= 0; i-- { + n := p.afe[i] + if n.Type == scopeMarkerNode { + break + } + if n.Type != ElementNode { + continue + } + if n.Namespace != "" { + continue + } + if n.DataAtom != tagAtom { + continue + } + if len(n.Attr) != len(attr) { + continue + } + compareAttributes: + for _, t0 := range n.Attr { + for _, t1 := range attr { + if t0.Key == t1.Key && t0.Namespace == t1.Namespace && t0.Val == t1.Val { + // Found a match for this attribute, continue with the next attribute. + continue compareAttributes + } + } + // If we get here, there is no attribute that matches a. + // Therefore the element is not identical to the new one. + continue findIdenticalElements + } + + identicalElements++ + if identicalElements >= 3 { + p.afe.remove(n) + } + } + + p.afe = append(p.afe, p.top()) +} + +// Section 12.2.3.3. +func (p *parser) clearActiveFormattingElements() { + for { + n := p.afe.pop() + if len(p.afe) == 0 || n.Type == scopeMarkerNode { + return + } + } +} + +// Section 12.2.3.3. +func (p *parser) reconstructActiveFormattingElements() { + n := p.afe.top() + if n == nil { + return + } + if n.Type == scopeMarkerNode || p.oe.index(n) != -1 { + return + } + i := len(p.afe) - 1 + for n.Type != scopeMarkerNode && p.oe.index(n) == -1 { + if i == 0 { + i = -1 + break + } + i-- + n = p.afe[i] + } + for { + i++ + clone := p.afe[i].clone() + p.addChild(clone) + p.afe[i] = clone + if i == len(p.afe)-1 { + break + } + } +} + +// Section 12.2.4. +func (p *parser) acknowledgeSelfClosingTag() { + p.hasSelfClosingToken = false +} + +// An insertion mode (section 12.2.3.1) is the state transition function from +// a particular state in the HTML5 parser's state machine. It updates the +// parser's fields depending on parser.tok (where ErrorToken means EOF). +// It returns whether the token was consumed. +type insertionMode func(*parser) bool + +// setOriginalIM sets the insertion mode to return to after completing a text or +// inTableText insertion mode. +// Section 12.2.3.1, "using the rules for". +func (p *parser) setOriginalIM() { + if p.originalIM != nil { + panic("html: bad parser state: originalIM was set twice") + } + p.originalIM = p.im +} + +// Section 12.2.3.1, "reset the insertion mode". +func (p *parser) resetInsertionMode() { + for i := len(p.oe) - 1; i >= 0; i-- { + n := p.oe[i] + if i == 0 && p.context != nil { + n = p.context + } + + switch n.DataAtom { + case a.Select: + p.im = inSelectIM + case a.Td, a.Th: + p.im = inCellIM + case a.Tr: + p.im = inRowIM + case a.Tbody, a.Thead, a.Tfoot: + p.im = inTableBodyIM + case a.Caption: + p.im = inCaptionIM + case a.Colgroup: + p.im = inColumnGroupIM + case a.Table: + p.im = inTableIM + case a.Head: + p.im = inBodyIM + case a.Body: + p.im = inBodyIM + case a.Frameset: + p.im = inFramesetIM + case a.Html: + p.im = beforeHeadIM + default: + continue + } + return + } + p.im = inBodyIM +} + +const whitespace = " \t\r\n\f" + +// Section 12.2.5.4.1. +func initialIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) + if len(p.tok.Data) == 0 { + // It was all whitespace, so ignore it. + return true + } + case CommentToken: + p.doc.AppendChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + n, quirks := parseDoctype(p.tok.Data) + p.doc.AppendChild(n) + p.quirks = quirks + p.im = beforeHTMLIM + return true + } + p.quirks = true + p.im = beforeHTMLIM + return false +} + +// Section 12.2.5.4.2. +func beforeHTMLIM(p *parser) bool { + switch p.tok.Type { + case DoctypeToken: + // Ignore the token. + return true + case TextToken: + p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) + if len(p.tok.Data) == 0 { + // It was all whitespace, so ignore it. + return true + } + case StartTagToken: + if p.tok.DataAtom == a.Html { + p.addElement() + p.im = beforeHeadIM + return true + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Head, a.Body, a.Html, a.Br: + p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) + return false + default: + // Ignore the token. + return true + } + case CommentToken: + p.doc.AppendChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + } + p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) + return false +} + +// Section 12.2.5.4.3. +func beforeHeadIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) + if len(p.tok.Data) == 0 { + // It was all whitespace, so ignore it. + return true + } + case StartTagToken: + switch p.tok.DataAtom { + case a.Head: + p.addElement() + p.head = p.top() + p.im = inHeadIM + return true + case a.Html: + return inBodyIM(p) + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Head, a.Body, a.Html, a.Br: + p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) + return false + default: + // Ignore the token. + return true + } + case CommentToken: + p.addChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + // Ignore the token. + return true + } + + p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) + return false +} + +// Section 12.2.5.4.4. +func inHeadIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + s := strings.TrimLeft(p.tok.Data, whitespace) + if len(s) < len(p.tok.Data) { + // Add the initial whitespace to the current node. + p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) + if s == "" { + return true + } + p.tok.Data = s + } + case StartTagToken: + switch p.tok.DataAtom { + case a.Html: + return inBodyIM(p) + case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta: + p.addElement() + p.oe.pop() + p.acknowledgeSelfClosingTag() + return true + case a.Script, a.Title, a.Noscript, a.Noframes, a.Style: + p.addElement() + p.setOriginalIM() + p.im = textIM + return true + case a.Head: + // Ignore the token. + return true + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Head: + n := p.oe.pop() + if n.DataAtom != a.Head { + panic("html: bad parser state: element not found, in the in-head insertion mode") + } + p.im = afterHeadIM + return true + case a.Body, a.Html, a.Br: + p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) + return false + default: + // Ignore the token. + return true + } + case CommentToken: + p.addChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + // Ignore the token. + return true + } + + p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) + return false +} + +// Section 12.2.5.4.6. +func afterHeadIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + s := strings.TrimLeft(p.tok.Data, whitespace) + if len(s) < len(p.tok.Data) { + // Add the initial whitespace to the current node. + p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) + if s == "" { + return true + } + p.tok.Data = s + } + case StartTagToken: + switch p.tok.DataAtom { + case a.Html: + return inBodyIM(p) + case a.Body: + p.addElement() + p.framesetOK = false + p.im = inBodyIM + return true + case a.Frameset: + p.addElement() + p.im = inFramesetIM + return true + case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: + p.oe = append(p.oe, p.head) + defer p.oe.remove(p.head) + return inHeadIM(p) + case a.Head: + // Ignore the token. + return true + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Body, a.Html, a.Br: + // Drop down to creating an implied tag. + default: + // Ignore the token. + return true + } + case CommentToken: + p.addChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + // Ignore the token. + return true + } + + p.parseImpliedToken(StartTagToken, a.Body, a.Body.String()) + p.framesetOK = true + return false +} + +// copyAttributes copies attributes of src not found on dst to dst. +func copyAttributes(dst *Node, src Token) { + if len(src.Attr) == 0 { + return + } + attr := map[string]string{} + for _, t := range dst.Attr { + attr[t.Key] = t.Val + } + for _, t := range src.Attr { + if _, ok := attr[t.Key]; !ok { + dst.Attr = append(dst.Attr, t) + attr[t.Key] = t.Val + } + } +} + +// Section 12.2.5.4.7. +func inBodyIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + d := p.tok.Data + switch n := p.oe.top(); n.DataAtom { + case a.Pre, a.Listing: + if n.FirstChild == nil { + // Ignore a newline at the start of a
 block.
+				if d != "" && d[0] == '\r' {
+					d = d[1:]
+				}
+				if d != "" && d[0] == '\n' {
+					d = d[1:]
+				}
+			}
+		}
+		d = strings.Replace(d, "\x00", "", -1)
+		if d == "" {
+			return true
+		}
+		p.reconstructActiveFormattingElements()
+		p.addText(d)
+		if p.framesetOK && strings.TrimLeft(d, whitespace) != "" {
+			// There were non-whitespace characters inserted.
+			p.framesetOK = false
+		}
+	case StartTagToken:
+		switch p.tok.DataAtom {
+		case a.Html:
+			copyAttributes(p.oe[0], p.tok)
+		case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title:
+			return inHeadIM(p)
+		case a.Body:
+			if len(p.oe) >= 2 {
+				body := p.oe[1]
+				if body.Type == ElementNode && body.DataAtom == a.Body {
+					p.framesetOK = false
+					copyAttributes(body, p.tok)
+				}
+			}
+		case a.Frameset:
+			if !p.framesetOK || len(p.oe) < 2 || p.oe[1].DataAtom != a.Body {
+				// Ignore the token.
+				return true
+			}
+			body := p.oe[1]
+			if body.Parent != nil {
+				body.Parent.RemoveChild(body)
+			}
+			p.oe = p.oe[:1]
+			p.addElement()
+			p.im = inFramesetIM
+			return true
+		case a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
+			p.popUntil(buttonScope, a.P)
+			switch n := p.top(); n.DataAtom {
+			case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
+				p.oe.pop()
+			}
+			p.addElement()
+		case a.Pre, a.Listing:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+			// The newline, if any, will be dealt with by the TextToken case.
+			p.framesetOK = false
+		case a.Form:
+			if p.form == nil {
+				p.popUntil(buttonScope, a.P)
+				p.addElement()
+				p.form = p.top()
+			}
+		case a.Li:
+			p.framesetOK = false
+			for i := len(p.oe) - 1; i >= 0; i-- {
+				node := p.oe[i]
+				switch node.DataAtom {
+				case a.Li:
+					p.oe = p.oe[:i]
+				case a.Address, a.Div, a.P:
+					continue
+				default:
+					if !isSpecialElement(node) {
+						continue
+					}
+				}
+				break
+			}
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.Dd, a.Dt:
+			p.framesetOK = false
+			for i := len(p.oe) - 1; i >= 0; i-- {
+				node := p.oe[i]
+				switch node.DataAtom {
+				case a.Dd, a.Dt:
+					p.oe = p.oe[:i]
+				case a.Address, a.Div, a.P:
+					continue
+				default:
+					if !isSpecialElement(node) {
+						continue
+					}
+				}
+				break
+			}
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.Plaintext:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.Button:
+			p.popUntil(defaultScope, a.Button)
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.framesetOK = false
+		case a.A:
+			for i := len(p.afe) - 1; i >= 0 && p.afe[i].Type != scopeMarkerNode; i-- {
+				if n := p.afe[i]; n.Type == ElementNode && n.DataAtom == a.A {
+					p.inBodyEndTagFormatting(a.A)
+					p.oe.remove(n)
+					p.afe.remove(n)
+					break
+				}
+			}
+			p.reconstructActiveFormattingElements()
+			p.addFormattingElement()
+		case a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
+			p.reconstructActiveFormattingElements()
+			p.addFormattingElement()
+		case a.Nobr:
+			p.reconstructActiveFormattingElements()
+			if p.elementInScope(defaultScope, a.Nobr) {
+				p.inBodyEndTagFormatting(a.Nobr)
+				p.reconstructActiveFormattingElements()
+			}
+			p.addFormattingElement()
+		case a.Applet, a.Marquee, a.Object:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.afe = append(p.afe, &scopeMarker)
+			p.framesetOK = false
+		case a.Table:
+			if !p.quirks {
+				p.popUntil(buttonScope, a.P)
+			}
+			p.addElement()
+			p.framesetOK = false
+			p.im = inTableIM
+			return true
+		case a.Area, a.Br, a.Embed, a.Img, a.Input, a.Keygen, a.Wbr:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.oe.pop()
+			p.acknowledgeSelfClosingTag()
+			if p.tok.DataAtom == a.Input {
+				for _, t := range p.tok.Attr {
+					if t.Key == "type" {
+						if strings.ToLower(t.Val) == "hidden" {
+							// Skip setting framesetOK = false
+							return true
+						}
+					}
+				}
+			}
+			p.framesetOK = false
+		case a.Param, a.Source, a.Track:
+			p.addElement()
+			p.oe.pop()
+			p.acknowledgeSelfClosingTag()
+		case a.Hr:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+			p.oe.pop()
+			p.acknowledgeSelfClosingTag()
+			p.framesetOK = false
+		case a.Image:
+			p.tok.DataAtom = a.Img
+			p.tok.Data = a.Img.String()
+			return false
+		case a.Isindex:
+			if p.form != nil {
+				// Ignore the token.
+				return true
+			}
+			action := ""
+			prompt := "This is a searchable index. Enter search keywords: "
+			attr := []Attribute{{Key: "name", Val: "isindex"}}
+			for _, t := range p.tok.Attr {
+				switch t.Key {
+				case "action":
+					action = t.Val
+				case "name":
+					// Ignore the attribute.
+				case "prompt":
+					prompt = t.Val
+				default:
+					attr = append(attr, t)
+				}
+			}
+			p.acknowledgeSelfClosingTag()
+			p.popUntil(buttonScope, a.P)
+			p.parseImpliedToken(StartTagToken, a.Form, a.Form.String())
+			if action != "" {
+				p.form.Attr = []Attribute{{Key: "action", Val: action}}
+			}
+			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
+			p.parseImpliedToken(StartTagToken, a.Label, a.Label.String())
+			p.addText(prompt)
+			p.addChild(&Node{
+				Type:     ElementNode,
+				DataAtom: a.Input,
+				Data:     a.Input.String(),
+				Attr:     attr,
+			})
+			p.oe.pop()
+			p.parseImpliedToken(EndTagToken, a.Label, a.Label.String())
+			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
+			p.parseImpliedToken(EndTagToken, a.Form, a.Form.String())
+		case a.Textarea:
+			p.addElement()
+			p.setOriginalIM()
+			p.framesetOK = false
+			p.im = textIM
+		case a.Xmp:
+			p.popUntil(buttonScope, a.P)
+			p.reconstructActiveFormattingElements()
+			p.framesetOK = false
+			p.addElement()
+			p.setOriginalIM()
+			p.im = textIM
+		case a.Iframe:
+			p.framesetOK = false
+			p.addElement()
+			p.setOriginalIM()
+			p.im = textIM
+		case a.Noembed, a.Noscript:
+			p.addElement()
+			p.setOriginalIM()
+			p.im = textIM
+		case a.Select:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.framesetOK = false
+			p.im = inSelectIM
+			return true
+		case a.Optgroup, a.Option:
+			if p.top().DataAtom == a.Option {
+				p.oe.pop()
+			}
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+		case a.Rp, a.Rt:
+			if p.elementInScope(defaultScope, a.Ruby) {
+				p.generateImpliedEndTags()
+			}
+			p.addElement()
+		case a.Math, a.Svg:
+			p.reconstructActiveFormattingElements()
+			if p.tok.DataAtom == a.Math {
+				adjustAttributeNames(p.tok.Attr, mathMLAttributeAdjustments)
+			} else {
+				adjustAttributeNames(p.tok.Attr, svgAttributeAdjustments)
+			}
+			adjustForeignAttributes(p.tok.Attr)
+			p.addElement()
+			p.top().Namespace = p.tok.Data
+			if p.hasSelfClosingToken {
+				p.oe.pop()
+				p.acknowledgeSelfClosingTag()
+			}
+			return true
+		case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:
+			// Ignore the token.
+		default:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+		}
+	case EndTagToken:
+		switch p.tok.DataAtom {
+		case a.Body:
+			if p.elementInScope(defaultScope, a.Body) {
+				p.im = afterBodyIM
+			}
+		case a.Html:
+			if p.elementInScope(defaultScope, a.Body) {
+				p.parseImpliedToken(EndTagToken, a.Body, a.Body.String())
+				return false
+			}
+			return true
+		case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:
+			p.popUntil(defaultScope, p.tok.DataAtom)
+		case a.Form:
+			node := p.form
+			p.form = nil
+			i := p.indexOfElementInScope(defaultScope, a.Form)
+			if node == nil || i == -1 || p.oe[i] != node {
+				// Ignore the token.
+				return true
+			}
+			p.generateImpliedEndTags()
+			p.oe.remove(node)
+		case a.P:
+			if !p.elementInScope(buttonScope, a.P) {
+				p.parseImpliedToken(StartTagToken, a.P, a.P.String())
+			}
+			p.popUntil(buttonScope, a.P)
+		case a.Li:
+			p.popUntil(listItemScope, a.Li)
+		case a.Dd, a.Dt:
+			p.popUntil(defaultScope, p.tok.DataAtom)
+		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
+			p.popUntil(defaultScope, a.H1, a.H2, a.H3, a.H4, a.H5, a.H6)
+		case a.A, a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.Nobr, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
+			p.inBodyEndTagFormatting(p.tok.DataAtom)
+		case a.Applet, a.Marquee, a.Object:
+			if p.popUntil(defaultScope, p.tok.DataAtom) {
+				p.clearActiveFormattingElements()
+			}
+		case a.Br:
+			p.tok.Type = StartTagToken
+			return false
+		default:
+			p.inBodyEndTagOther(p.tok.DataAtom)
+		}
+	case CommentToken:
+		p.addChild(&Node{
+			Type: CommentNode,
+			Data: p.tok.Data,
+		})
+	}
+
+	return true
+}
+
+func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) {
+	// This is the "adoption agency" algorithm, described at
+	// https://html.spec.whatwg.org/multipage/syntax.html#adoptionAgency
+
+	// TODO: this is a fairly literal line-by-line translation of that algorithm.
+	// Once the code successfully parses the comprehensive test suite, we should
+	// refactor this code to be more idiomatic.
+
+	// Steps 1-4. The outer loop.
+	for i := 0; i < 8; i++ {
+		// Step 5. Find the formatting element.
+		var formattingElement *Node
+		for j := len(p.afe) - 1; j >= 0; j-- {
+			if p.afe[j].Type == scopeMarkerNode {
+				break
+			}
+			if p.afe[j].DataAtom == tagAtom {
+				formattingElement = p.afe[j]
+				break
+			}
+		}
+		if formattingElement == nil {
+			p.inBodyEndTagOther(tagAtom)
+			return
+		}
+		feIndex := p.oe.index(formattingElement)
+		if feIndex == -1 {
+			p.afe.remove(formattingElement)
+			return
+		}
+		if !p.elementInScope(defaultScope, tagAtom) {
+			// Ignore the tag.
+			return
+		}
+
+		// Steps 9-10. Find the furthest block.
+		var furthestBlock *Node
+		for _, e := range p.oe[feIndex:] {
+			if isSpecialElement(e) {
+				furthestBlock = e
+				break
+			}
+		}
+		if furthestBlock == nil {
+			e := p.oe.pop()
+			for e != formattingElement {
+				e = p.oe.pop()
+			}
+			p.afe.remove(e)
+			return
+		}
+
+		// Steps 11-12. Find the common ancestor and bookmark node.
+		commonAncestor := p.oe[feIndex-1]
+		bookmark := p.afe.index(formattingElement)
+
+		// Step 13. The inner loop. Find the lastNode to reparent.
+		lastNode := furthestBlock
+		node := furthestBlock
+		x := p.oe.index(node)
+		// Steps 13.1-13.2
+		for j := 0; j < 3; j++ {
+			// Step 13.3.
+			x--
+			node = p.oe[x]
+			// Step 13.4 - 13.5.
+			if p.afe.index(node) == -1 {
+				p.oe.remove(node)
+				continue
+			}
+			// Step 13.6.
+			if node == formattingElement {
+				break
+			}
+			// Step 13.7.
+			clone := node.clone()
+			p.afe[p.afe.index(node)] = clone
+			p.oe[p.oe.index(node)] = clone
+			node = clone
+			// Step 13.8.
+			if lastNode == furthestBlock {
+				bookmark = p.afe.index(node) + 1
+			}
+			// Step 13.9.
+			if lastNode.Parent != nil {
+				lastNode.Parent.RemoveChild(lastNode)
+			}
+			node.AppendChild(lastNode)
+			// Step 13.10.
+			lastNode = node
+		}
+
+		// Step 14. Reparent lastNode to the common ancestor,
+		// or for misnested table nodes, to the foster parent.
+		if lastNode.Parent != nil {
+			lastNode.Parent.RemoveChild(lastNode)
+		}
+		switch commonAncestor.DataAtom {
+		case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:
+			p.fosterParent(lastNode)
+		default:
+			commonAncestor.AppendChild(lastNode)
+		}
+
+		// Steps 15-17. Reparent nodes from the furthest block's children
+		// to a clone of the formatting element.
+		clone := formattingElement.clone()
+		reparentChildren(clone, furthestBlock)
+		furthestBlock.AppendChild(clone)
+
+		// Step 18. Fix up the list of active formatting elements.
+		if oldLoc := p.afe.index(formattingElement); oldLoc != -1 && oldLoc < bookmark {
+			// Move the bookmark with the rest of the list.
+			bookmark--
+		}
+		p.afe.remove(formattingElement)
+		p.afe.insert(bookmark, clone)
+
+		// Step 19. Fix up the stack of open elements.
+		p.oe.remove(formattingElement)
+		p.oe.insert(p.oe.index(furthestBlock)+1, clone)
+	}
+}
+
+// inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM.
+// "Any other end tag" handling from 12.2.5.5 The rules for parsing tokens in foreign content
+// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign
+func (p *parser) inBodyEndTagOther(tagAtom a.Atom) {
+	for i := len(p.oe) - 1; i >= 0; i-- {
+		if p.oe[i].DataAtom == tagAtom {
+			p.oe = p.oe[:i]
+			break
+		}
+		if isSpecialElement(p.oe[i]) {
+			break
+		}
+	}
+}
+
+// Section 12.2.5.4.8.
+func textIM(p *parser) bool {
+	switch p.tok.Type {
+	case ErrorToken:
+		p.oe.pop()
+	case TextToken:
+		d := p.tok.Data
+		if n := p.oe.top(); n.DataAtom == a.Textarea && n.FirstChild == nil {
+			// Ignore a newline at the start of a -->
+#errors
+#document
+| 
+|   
+|   
+|     -->
+#errors
+#document
+| 
+|   
+|   
+|     
+#errors
+Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE.
+#document
+| 
+|   
+|   
+|     
+#errors
+Line: 1 Col: 9 Unexpected end tag (strong). Expected DOCTYPE.
+Line: 1 Col: 9 Unexpected end tag (strong) after the (implied) root element.
+Line: 1 Col: 13 Unexpected end tag (b) after the (implied) root element.
+Line: 1 Col: 18 Unexpected end tag (em) after the (implied) root element.
+Line: 1 Col: 22 Unexpected end tag (i) after the (implied) root element.
+Line: 1 Col: 26 Unexpected end tag (u) after the (implied) root element.
+Line: 1 Col: 35 Unexpected end tag (strike) after the (implied) root element.
+Line: 1 Col: 39 Unexpected end tag (s) after the (implied) root element.
+Line: 1 Col: 47 Unexpected end tag (blink) after the (implied) root element.
+Line: 1 Col: 52 Unexpected end tag (tt) after the (implied) root element.
+Line: 1 Col: 58 Unexpected end tag (pre) after the (implied) root element.
+Line: 1 Col: 64 Unexpected end tag (big) after the (implied) root element.
+Line: 1 Col: 72 Unexpected end tag (small) after the (implied) root element.
+Line: 1 Col: 79 Unexpected end tag (font) after the (implied) root element.
+Line: 1 Col: 88 Unexpected end tag (select) after the (implied) root element.
+Line: 1 Col: 93 Unexpected end tag (h1) after the (implied) root element.
+Line: 1 Col: 98 Unexpected end tag (h2) after the (implied) root element.
+Line: 1 Col: 103 Unexpected end tag (h3) after the (implied) root element.
+Line: 1 Col: 108 Unexpected end tag (h4) after the (implied) root element.
+Line: 1 Col: 113 Unexpected end tag (h5) after the (implied) root element.
+Line: 1 Col: 118 Unexpected end tag (h6) after the (implied) root element.
+Line: 1 Col: 125 Unexpected end tag (body) after the (implied) root element.
+Line: 1 Col: 130 Unexpected end tag (br). Treated as br element.
+Line: 1 Col: 134 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm.
+Line: 1 Col: 140 This element (img) has no end tag.
+Line: 1 Col: 148 Unexpected end tag (title). Ignored.
+Line: 1 Col: 155 Unexpected end tag (span). Ignored.
+Line: 1 Col: 163 Unexpected end tag (style). Ignored.
+Line: 1 Col: 172 Unexpected end tag (script). Ignored.
+Line: 1 Col: 180 Unexpected end tag (table). Ignored.
+Line: 1 Col: 185 Unexpected end tag (th). Ignored.
+Line: 1 Col: 190 Unexpected end tag (td). Ignored.
+Line: 1 Col: 195 Unexpected end tag (tr). Ignored.
+Line: 1 Col: 203 This element (frame) has no end tag.
+Line: 1 Col: 210 This element (area) has no end tag.
+Line: 1 Col: 217 Unexpected end tag (link). Ignored.
+Line: 1 Col: 225 This element (param) has no end tag.
+Line: 1 Col: 230 This element (hr) has no end tag.
+Line: 1 Col: 238 This element (input) has no end tag.
+Line: 1 Col: 244 Unexpected end tag (col). Ignored.
+Line: 1 Col: 251 Unexpected end tag (base). Ignored.
+Line: 1 Col: 258 Unexpected end tag (meta). Ignored.
+Line: 1 Col: 269 This element (basefont) has no end tag.
+Line: 1 Col: 279 This element (bgsound) has no end tag.
+Line: 1 Col: 287 This element (embed) has no end tag.
+Line: 1 Col: 296 This element (spacer) has no end tag.
+Line: 1 Col: 300 Unexpected end tag (p). Ignored.
+Line: 1 Col: 305 End tag (dd) seen too early. Expected other end tag.
+Line: 1 Col: 310 End tag (dt) seen too early. Expected other end tag.
+Line: 1 Col: 320 Unexpected end tag (caption). Ignored.
+Line: 1 Col: 331 Unexpected end tag (colgroup). Ignored.
+Line: 1 Col: 339 Unexpected end tag (tbody). Ignored.
+Line: 1 Col: 347 Unexpected end tag (tfoot). Ignored.
+Line: 1 Col: 355 Unexpected end tag (thead). Ignored.
+Line: 1 Col: 365 End tag (address) seen too early. Expected other end tag.
+Line: 1 Col: 378 End tag (blockquote) seen too early. Expected other end tag.
+Line: 1 Col: 387 End tag (center) seen too early. Expected other end tag.
+Line: 1 Col: 393 Unexpected end tag (dir). Ignored.
+Line: 1 Col: 399 End tag (div) seen too early. Expected other end tag.
+Line: 1 Col: 404 End tag (dl) seen too early. Expected other end tag.
+Line: 1 Col: 415 End tag (fieldset) seen too early. Expected other end tag.
+Line: 1 Col: 425 End tag (listing) seen too early. Expected other end tag.
+Line: 1 Col: 432 End tag (menu) seen too early. Expected other end tag.
+Line: 1 Col: 437 End tag (ol) seen too early. Expected other end tag.
+Line: 1 Col: 442 End tag (ul) seen too early. Expected other end tag.
+Line: 1 Col: 447 End tag (li) seen too early. Expected other end tag.
+Line: 1 Col: 454 End tag (nobr) violates step 1, paragraph 1 of the adoption agency algorithm.
+Line: 1 Col: 460 This element (wbr) has no end tag.
+Line: 1 Col: 476 End tag (button) seen too early. Expected other end tag.
+Line: 1 Col: 486 End tag (marquee) seen too early. Expected other end tag.
+Line: 1 Col: 495 End tag (object) seen too early. Expected other end tag.
+Line: 1 Col: 513 Unexpected end tag (html). Ignored.
+Line: 1 Col: 513 Unexpected end tag (frameset). Ignored.
+Line: 1 Col: 520 Unexpected end tag (head). Ignored.
+Line: 1 Col: 529 Unexpected end tag (iframe). Ignored.
+Line: 1 Col: 537 This element (image) has no end tag.
+Line: 1 Col: 547 This element (isindex) has no end tag.
+Line: 1 Col: 557 Unexpected end tag (noembed). Ignored.
+Line: 1 Col: 568 Unexpected end tag (noframes). Ignored.
+Line: 1 Col: 579 Unexpected end tag (noscript). Ignored.
+Line: 1 Col: 590 Unexpected end tag (optgroup). Ignored.
+Line: 1 Col: 599 Unexpected end tag (option). Ignored.
+Line: 1 Col: 611 Unexpected end tag (plaintext). Ignored.
+Line: 1 Col: 622 Unexpected end tag (textarea). Ignored.
+#document
+| 
+|   
+|   
+|     
+|

+ +#data +

+| +| +|

+ +#data + +#errors +Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE. +Line: 1 Col: 10 Expected closing tag. Unexpected end of file. +#document +| +| +| diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests10.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests10.dat new file mode 100644 index 00000000..4f8df86f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests10.dat @@ -0,0 +1,799 @@ +#data + +#errors +#document +| +| +| +| +| + +#data +a +#errors +29: Bogus comment +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| + +#data + +#errors +35: Stray “svg†start tag. +42: Stray end tag “svg†+#document +| +| +| +| +| +#errors +43: Stray “svg†start tag. +50: Stray end tag “svg†+#document +| +| +| +| +|

+#errors +34: Start tag “svg†seen in “tableâ€. +41: Stray end tag “svgâ€. +#document +| +| +| +| +| +| + +#data +
foo
+#errors +34: Start tag “svg†seen in “tableâ€. +46: Stray end tag “gâ€. +53: Stray end tag “svgâ€. +#document +| +| +| +| +| +| +| "foo" +| + +#data +
foobar
+#errors +34: Start tag “svg†seen in “tableâ€. +46: Stray end tag “gâ€. +58: Stray end tag “gâ€. +65: Stray end tag “svgâ€. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +| + +#data +
foobar
+#errors +41: Start tag “svg†seen in “tableâ€. +53: Stray end tag “gâ€. +65: Stray end tag “gâ€. +72: Stray end tag “svgâ€. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +| +| + +#data +
foobar
+#errors +45: Start tag “svg†seen in “tableâ€. +57: Stray end tag “gâ€. +69: Stray end tag “gâ€. +76: Stray end tag “svgâ€. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +| +| +| + +#data +
foobar
+#errors +#document +| +| +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" + +#data +
foobar

baz

+#errors +#document +| +| +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" +|

+| "baz" + +#data +
foobar

baz

+#errors +#document +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" +|

+| "baz" + +#data +
foobar

baz

quux +#errors +70: HTML start tag “p†in a foreign namespace context. +81: “table†closed but “caption†was still open. +#document +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" +|

+| "baz" +|

+| "quux" + +#data +
foobarbaz

quux +#errors +78: “table†closed but “caption†was still open. +78: Unclosed elements on stack. +#document +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" +| "baz" +|

+| "quux" + +#data +foobar

baz

quux +#errors +44: Start tag “svg†seen in “tableâ€. +56: Stray end tag “gâ€. +68: Stray end tag “gâ€. +71: HTML start tag “p†in a foreign namespace context. +71: Start tag “p†seen in “tableâ€. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +|

+| "baz" +| +| +|

+| "quux" + +#data +

quux +#errors +50: Stray “svg†start tag. +54: Stray “g†start tag. +62: Stray end tag “g†+66: Stray “g†start tag. +74: Stray end tag “g†+77: Stray “p†start tag. +88: “table†end tag with “select†open. +#document +| +| +| +| +| +| +| +|
+|

quux +#errors +36: Start tag “select†seen in “tableâ€. +42: Stray “svg†start tag. +46: Stray “g†start tag. +54: Stray end tag “g†+58: Stray “g†start tag. +66: Stray end tag “g†+69: Stray “p†start tag. +80: “table†end tag with “select†open. +#document +| +| +| +| +| +|

+| "quux" + +#data +foobar

baz +#errors +41: Stray “svg†start tag. +68: HTML start tag “p†in a foreign namespace context. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +|

+| "baz" + +#data +foobar

baz +#errors +34: Stray “svg†start tag. +61: HTML start tag “p†in a foreign namespace context. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +|

+| "baz" + +#data +

+#errors +31: Stray “svg†start tag. +35: Stray “g†start tag. +40: Stray end tag “g†+44: Stray “g†start tag. +49: Stray end tag “g†+52: Stray “p†start tag. +58: Stray “span†start tag. +58: End of file seen and there were open elements. +#document +| +| +| +| + +#data +

+#errors +42: Stray “svg†start tag. +46: Stray “g†start tag. +51: Stray end tag “g†+55: Stray “g†start tag. +60: Stray end tag “g†+63: Stray “p†start tag. +69: Stray “span†start tag. +#document +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| xlink:href="foo" +| +| xlink href="foo" + +#data + +#errors +#document +| +| +| +| +| xlink:href="foo" +| xml:lang="en" +| +| +| xlink href="foo" +| xml lang="en" + +#data + +#errors +#document +| +| +| +| +| xlink:href="foo" +| xml:lang="en" +| +| +| xlink href="foo" +| xml lang="en" + +#data +bar +#errors +#document +| +| +| +| +| xlink:href="foo" +| xml:lang="en" +| +| +| xlink href="foo" +| xml lang="en" +| "bar" + +#data + +#errors +#document +| +| +| +| + +#data +

a +#errors +#document +| +| +| +|
+| +| "a" + +#data +
a +#errors +#document +| +| +| +|
+| +| +| "a" + +#data +
+#errors +#document +| +| +| +|
+| +| +| + +#data +
a +#errors +#document +| +| +| +|
+| +| +| +| +| "a" + +#data +

a +#errors +#document +| +| +| +|

+| +| +| +|

+| "a" + +#data +
    a +#errors +40: HTML start tag “ul†in a foreign namespace context. +41: End of file in a foreign namespace context. +#document +| +| +| +| +| +| +|
    +| +|
      +| "a" + +#data +
        a +#errors +35: HTML start tag “ul†in a foreign namespace context. +36: End of file in a foreign namespace context. +#document +| +| +| +| +| +| +| +|
          +| "a" + +#data +

          +#errors +#document +| +| +| +| +|

          +| +| +|

          + +#data +

          +#errors +#document +| +| +| +| +|

          +| +| +|

          + +#data +

          +#errors +#document +| +| +| +|

          +| +| +| +|

          +|

          + +#data +
          +#errors +#document +| +| +| +| +| +|
          +| +|
          +| +| + +#data +
          +#errors +#document +| +| +| +| +| +| +| +|
          +|
          +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data +

+#errors +#document +| +| +| +| +|
+| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| + +#data +
+#errors +#document +| +| +| +| +| +| +| +|
+| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests11.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests11.dat new file mode 100644 index 00000000..638cde47 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests11.dat @@ -0,0 +1,482 @@ +#data + +#errors +#document +| +| +| +| +| +| attributeName="" +| attributeType="" +| baseFrequency="" +| baseProfile="" +| calcMode="" +| clipPathUnits="" +| contentScriptType="" +| contentStyleType="" +| diffuseConstant="" +| edgeMode="" +| externalResourcesRequired="" +| filterRes="" +| filterUnits="" +| glyphRef="" +| gradientTransform="" +| gradientUnits="" +| kernelMatrix="" +| kernelUnitLength="" +| keyPoints="" +| keySplines="" +| keyTimes="" +| lengthAdjust="" +| limitingConeAngle="" +| markerHeight="" +| markerUnits="" +| markerWidth="" +| maskContentUnits="" +| maskUnits="" +| numOctaves="" +| pathLength="" +| patternContentUnits="" +| patternTransform="" +| patternUnits="" +| pointsAtX="" +| pointsAtY="" +| pointsAtZ="" +| preserveAlpha="" +| preserveAspectRatio="" +| primitiveUnits="" +| refX="" +| refY="" +| repeatCount="" +| repeatDur="" +| requiredExtensions="" +| requiredFeatures="" +| specularConstant="" +| specularExponent="" +| spreadMethod="" +| startOffset="" +| stdDeviation="" +| stitchTiles="" +| surfaceScale="" +| systemLanguage="" +| tableValues="" +| targetX="" +| targetY="" +| textLength="" +| viewBox="" +| viewTarget="" +| xChannelSelector="" +| yChannelSelector="" +| zoomAndPan="" + +#data + +#errors +#document +| +| +| +| +| +| attributeName="" +| attributeType="" +| baseFrequency="" +| baseProfile="" +| calcMode="" +| clipPathUnits="" +| contentScriptType="" +| contentStyleType="" +| diffuseConstant="" +| edgeMode="" +| externalResourcesRequired="" +| filterRes="" +| filterUnits="" +| glyphRef="" +| gradientTransform="" +| gradientUnits="" +| kernelMatrix="" +| kernelUnitLength="" +| keyPoints="" +| keySplines="" +| keyTimes="" +| lengthAdjust="" +| limitingConeAngle="" +| markerHeight="" +| markerUnits="" +| markerWidth="" +| maskContentUnits="" +| maskUnits="" +| numOctaves="" +| pathLength="" +| patternContentUnits="" +| patternTransform="" +| patternUnits="" +| pointsAtX="" +| pointsAtY="" +| pointsAtZ="" +| preserveAlpha="" +| preserveAspectRatio="" +| primitiveUnits="" +| refX="" +| refY="" +| repeatCount="" +| repeatDur="" +| requiredExtensions="" +| requiredFeatures="" +| specularConstant="" +| specularExponent="" +| spreadMethod="" +| startOffset="" +| stdDeviation="" +| stitchTiles="" +| surfaceScale="" +| systemLanguage="" +| tableValues="" +| targetX="" +| targetY="" +| textLength="" +| viewBox="" +| viewTarget="" +| xChannelSelector="" +| yChannelSelector="" +| zoomAndPan="" + +#data + +#errors +#document +| +| +| +| +| +| attributeName="" +| attributeType="" +| baseFrequency="" +| baseProfile="" +| calcMode="" +| clipPathUnits="" +| contentScriptType="" +| contentStyleType="" +| diffuseConstant="" +| edgeMode="" +| externalResourcesRequired="" +| filterRes="" +| filterUnits="" +| glyphRef="" +| gradientTransform="" +| gradientUnits="" +| kernelMatrix="" +| kernelUnitLength="" +| keyPoints="" +| keySplines="" +| keyTimes="" +| lengthAdjust="" +| limitingConeAngle="" +| markerHeight="" +| markerUnits="" +| markerWidth="" +| maskContentUnits="" +| maskUnits="" +| numOctaves="" +| pathLength="" +| patternContentUnits="" +| patternTransform="" +| patternUnits="" +| pointsAtX="" +| pointsAtY="" +| pointsAtZ="" +| preserveAlpha="" +| preserveAspectRatio="" +| primitiveUnits="" +| refX="" +| refY="" +| repeatCount="" +| repeatDur="" +| requiredExtensions="" +| requiredFeatures="" +| specularConstant="" +| specularExponent="" +| spreadMethod="" +| startOffset="" +| stdDeviation="" +| stitchTiles="" +| surfaceScale="" +| systemLanguage="" +| tableValues="" +| targetX="" +| targetY="" +| textLength="" +| viewBox="" +| viewTarget="" +| xChannelSelector="" +| yChannelSelector="" +| zoomAndPan="" + +#data + +#errors +#document +| +| +| +| +| +| attributename="" +| attributetype="" +| basefrequency="" +| baseprofile="" +| calcmode="" +| clippathunits="" +| contentscripttype="" +| contentstyletype="" +| diffuseconstant="" +| edgemode="" +| externalresourcesrequired="" +| filterres="" +| filterunits="" +| glyphref="" +| gradienttransform="" +| gradientunits="" +| kernelmatrix="" +| kernelunitlength="" +| keypoints="" +| keysplines="" +| keytimes="" +| lengthadjust="" +| limitingconeangle="" +| markerheight="" +| markerunits="" +| markerwidth="" +| maskcontentunits="" +| maskunits="" +| numoctaves="" +| pathlength="" +| patterncontentunits="" +| patterntransform="" +| patternunits="" +| pointsatx="" +| pointsaty="" +| pointsatz="" +| preservealpha="" +| preserveaspectratio="" +| primitiveunits="" +| refx="" +| refy="" +| repeatcount="" +| repeatdur="" +| requiredextensions="" +| requiredfeatures="" +| specularconstant="" +| specularexponent="" +| spreadmethod="" +| startoffset="" +| stddeviation="" +| stitchtiles="" +| surfacescale="" +| systemlanguage="" +| tablevalues="" +| targetx="" +| targety="" +| textlength="" +| viewbox="" +| viewtarget="" +| xchannelselector="" +| ychannelselector="" +| zoomandpan="" + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests12.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests12.dat new file mode 100644 index 00000000..63107d27 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests12.dat @@ -0,0 +1,62 @@ +#data +

foobazeggs

spam

quuxbar +#errors +#document +| +| +| +| +|

+| "foo" +| +| +| +| "baz" +| +| +| +| +| "eggs" +| +| +|

+| "spam" +| +| +| +|
+| +| +| "quux" +| "bar" + +#data +foobazeggs

spam
quuxbar +#errors +#document +| +| +| +| +| "foo" +| +| +| +| "baz" +| +| +| +| +| "eggs" +| +| +|

+| "spam" +| +| +| +|
+| +| +| "quux" +| "bar" diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests14.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests14.dat new file mode 100644 index 00000000..b8713f88 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests14.dat @@ -0,0 +1,74 @@ +#data + +#errors +#document +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +15: Unexpected start tag html +#document +| +| +| abc:def="gh" +| +| +| + +#data + +#errors +15: Unexpected start tag html +#document +| +| +| xml:lang="bar" +| +| + +#data + +#errors +#document +| +| +| 123="456" +| +| + +#data + +#errors +#document +| +| +| 123="456" +| 789="012" +| +| + +#data + +#errors +#document +| +| +| +| +| 789="012" diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests15.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests15.dat new file mode 100644 index 00000000..6ce1c0d1 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests15.dat @@ -0,0 +1,208 @@ +#data +

X +#errors +Line: 1 Col: 31 Unexpected end tag (p). Ignored. +Line: 1 Col: 36 Expected closing tag. Unexpected end of file. +#document +| +| +| +| +|

+| +| +| +| +| +| +| " " +|

+| "X" + +#data +

+

X +#errors +Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE. +Line: 1 Col: 16 Unexpected end tag (p). Ignored. +Line: 2 Col: 4 Expected closing tag. Unexpected end of file. +#document +| +| +| +|

+| +| +| +| +| +| +| " +" +|

+| "X" + +#data + +#errors +Line: 1 Col: 22 Unexpected end tag (html) after the (implied) root element. +#document +| +| +| +| +| " " + +#data + +#errors +Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element. +#document +| +| +| +| +| + +#data + +#errors +Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end tag (html) after the (implied) root element. +#document +| +| +| +| + +#data +X +#errors +Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element. +#document +| +| +| +| +| +| "X" + +#data +<!doctype html><table> X<meta></table> +#errors +Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode. +Line: 1 Col: 30 Unexpected start tag (meta) in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " X" +| <meta> +| <table> + +#data +<!doctype html><table> x</table> +#errors +Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " x" +| <table> + +#data +<!doctype html><table> x </table> +#errors +Line: 1 Col: 25 Unexpected non-space characters in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " x " +| <table> + +#data +<!doctype html><table><tr> x</table> +#errors +Line: 1 Col: 28 Unexpected non-space characters in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " x" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table>X<style> <tr>x </style> </table> +#errors +Line: 1 Col: 23 Unexpected non-space characters in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "X" +| <table> +| <style> +| " <tr>x " +| " " + +#data +<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div> +#errors +Line: 1 Col: 30 Unexpected start tag (a) in table context caused voodoo mode. +Line: 1 Col: 37 Unexpected end tag (a) in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <div> +| <a> +| "foo" +| <table> +| " " +| <tbody> +| <tr> +| <td> +| "bar" +| " " + +#data +<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes> +#errors +6: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>â€. +13: Stray start tag “frameâ€. +21: Stray end tag “frameâ€. +29: Stray end tag “frameâ€. +39: “frameset†start tag after “body†already open. +105: End of file seen inside an [R]CDATA element. +105: End of file seen and there were open elements. +XXX: These errors are wrong, please fix me! +#document +| <html> +| <head> +| <frameset> +| <frame> +| <frameset> +| <frame> +| <noframes> +| "</frameset><noframes>" + +#data +<!DOCTYPE html><object></html> +#errors +1: Expected closing tag. Unexpected end of file +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <object> diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests16.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests16.dat new file mode 100644 index 00000000..c8ef66f0 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests16.dat @@ -0,0 +1,2299 @@ +#data +<!doctype html><script> +#errors +Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| <body> + +#data +<!doctype html><script>a +#errors +Line: 1 Col: 24 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "a" +| <body> + +#data +<!doctype html><script>< +#errors +Line: 1 Col: 24 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<" +| <body> + +#data +<!doctype html><script></ +#errors +Line: 1 Col: 25 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</" +| <body> + +#data +<!doctype html><script></S +#errors +Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</S" +| <body> + +#data +<!doctype html><script></SC +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SC" +| <body> + +#data +<!doctype html><script></SCR +#errors +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SCR" +| <body> + +#data +<!doctype html><script></SCRI +#errors +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SCRI" +| <body> + +#data +<!doctype html><script></SCRIP +#errors +Line: 1 Col: 30 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SCRIP" +| <body> + +#data +<!doctype html><script></SCRIPT +#errors +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SCRIPT" +| <body> + +#data +<!doctype html><script></SCRIPT +#errors +Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| <body> + +#data +<!doctype html><script></s +#errors +Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</s" +| <body> + +#data +<!doctype html><script></sc +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</sc" +| <body> + +#data +<!doctype html><script></scr +#errors +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</scr" +| <body> + +#data +<!doctype html><script></scri +#errors +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</scri" +| <body> + +#data +<!doctype html><script></scrip +#errors +Line: 1 Col: 30 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</scrip" +| <body> + +#data +<!doctype html><script></script +#errors +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</script" +| <body> + +#data +<!doctype html><script></script +#errors +Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| <body> + +#data +<!doctype html><script><! +#errors +Line: 1 Col: 25 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!" +| <body> + +#data +<!doctype html><script><!a +#errors +Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!a" +| <body> + +#data +<!doctype html><script><!- +#errors +Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!-" +| <body> + +#data +<!doctype html><script><!-a +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!-a" +| <body> + +#data +<!doctype html><script><!-- +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--" +| <body> + +#data +<!doctype html><script><!--a +#errors +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--a" +| <body> + +#data +<!doctype html><script><!--< +#errors +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<" +| <body> + +#data +<!doctype html><script><!--<a +#errors +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<a" +| <body> + +#data +<!doctype html><script><!--</ +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--</" +| <body> + +#data +<!doctype html><script><!--</script +#errors +Line: 1 Col: 35 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--</script" +| <body> + +#data +<!doctype html><script><!--</script +#errors +Line: 1 Col: 36 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--" +| <body> + +#data +<!doctype html><script><!--<s +#errors +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<s" +| <body> + +#data +<!doctype html><script><!--<script +#errors +Line: 1 Col: 34 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script" +| <body> + +#data +<!doctype html><script><!--<script +#errors +Line: 1 Col: 35 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script " +| <body> + +#data +<!doctype html><script><!--<script < +#errors +Line: 1 Col: 36 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script <" +| <body> + +#data +<!doctype html><script><!--<script <a +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script <a" +| <body> + +#data +<!doctype html><script><!--<script </ +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </" +| <body> + +#data +<!doctype html><script><!--<script </s +#errors +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </s" +| <body> + +#data +<!doctype html><script><!--<script </script +#errors +Line: 1 Col: 43 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script" +| <body> + +#data +<!doctype html><script><!--<script </scripta +#errors +Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </scripta" +| <body> + +#data +<!doctype html><script><!--<script </script +#errors +Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<!doctype html><script><!--<script </script> +#errors +Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script>" +| <body> + +#data +<!doctype html><script><!--<script </script/ +#errors +Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script/" +| <body> + +#data +<!doctype html><script><!--<script </script < +#errors +Line: 1 Col: 45 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script <" +| <body> + +#data +<!doctype html><script><!--<script </script <a +#errors +Line: 1 Col: 46 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script <a" +| <body> + +#data +<!doctype html><script><!--<script </script </ +#errors +Line: 1 Col: 46 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script </" +| <body> + +#data +<!doctype html><script><!--<script </script </script +#errors +Line: 1 Col: 52 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script </script" +| <body> + +#data +<!doctype html><script><!--<script </script </script +#errors +Line: 1 Col: 53 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<!doctype html><script><!--<script </script </script/ +#errors +Line: 1 Col: 53 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<!doctype html><script><!--<script </script </script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<!doctype html><script><!--<script - +#errors +Line: 1 Col: 36 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -" +| <body> + +#data +<!doctype html><script><!--<script -a +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -a" +| <body> + +#data +<!doctype html><script><!--<script -< +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -<" +| <body> + +#data +<!doctype html><script><!--<script -- +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --" +| <body> + +#data +<!doctype html><script><!--<script --a +#errors +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --a" +| <body> + +#data +<!doctype html><script><!--<script --< +#errors +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --<" +| <body> + +#data +<!doctype html><script><!--<script --> +#errors +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<!doctype html><script><!--<script -->< +#errors +Line: 1 Col: 39 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --><" +| <body> + +#data +<!doctype html><script><!--<script --></ +#errors +Line: 1 Col: 40 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --></" +| <body> + +#data +<!doctype html><script><!--<script --></script +#errors +Line: 1 Col: 46 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --></script" +| <body> + +#data +<!doctype html><script><!--<script --></script +#errors +Line: 1 Col: 47 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<!doctype html><script><!--<script --></script/ +#errors +Line: 1 Col: 47 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<!doctype html><script><!--<script --></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<!doctype html><script><!--<script><\/script>--></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script><\/script>-->" +| <body> + +#data +<!doctype html><script><!--<script></scr'+'ipt>--></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></scr'+'ipt>-->" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>--><!--</script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>--><!--" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>-- ></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>-- >" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>- -></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>- ->" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>- - ></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>- - >" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>-></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>->" +| <body> + +#data +<!doctype html><script><!--<script>--!></script>X +#errors +Line: 1 Col: 49 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script>--!></script>X" +| <body> + +#data +<!doctype html><script><!--<scr'+'ipt></script>--></script> +#errors +Line: 1 Col: 59 Unexpected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<scr'+'ipt>" +| <body> +| "-->" + +#data +<!doctype html><script><!--<script></scr'+'ipt></script>X +#errors +Line: 1 Col: 57 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></scr'+'ipt></script>X" +| <body> + +#data +<!doctype html><style><!--<style></style>--></style> +#errors +Line: 1 Col: 52 Unexpected end tag (style). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--<style>" +| <body> +| "-->" + +#data +<!doctype html><style><!--</style>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--" +| <body> +| "X" + +#data +<!doctype html><style><!--...</style>...--></style> +#errors +Line: 1 Col: 51 Unexpected end tag (style). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--..." +| <body> +| "...-->" + +#data +<!doctype html><style><!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style></style>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style>" +| <body> +| "X" + +#data +<!doctype html><style><!--...<style><!--...--!></style>--></style> +#errors +Line: 1 Col: 66 Unexpected end tag (style). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--...<style><!--...--!>" +| <body> +| "-->" + +#data +<!doctype html><style><!--...</style><!-- --><style>@import ...</style> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--..." +| <!-- --> +| <style> +| "@import ..." +| <body> + +#data +<!doctype html><style>...<style><!--...</style><!-- --></style> +#errors +Line: 1 Col: 63 Unexpected end tag (style). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "...<style><!--..." +| <!-- --> +| <body> + +#data +<!doctype html><style>...<!--[if IE]><style>...</style>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "...<!--[if IE]><style>..." +| <body> +| "X" + +#data +<!doctype html><title><!--<title>--> +#errors +Line: 1 Col: 52 Unexpected end tag (title). +#document +| +| +| +| +| "<!--<title>" +| <body> +| "-->" + +#data +<!doctype html><title></title> +#errors +#document +| +| +| +| +| "" +| + +#data +foo/title><link></head><body>X +#errors +Line: 1 Col: 52 Unexpected end of file. Expected end tag (title). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <title> +| "foo/title><link></head><body>X" +| <body> + +#data +<!doctype html><noscript><!--<noscript></noscript>--></noscript> +#errors +Line: 1 Col: 64 Unexpected end tag (noscript). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noscript> +| "<!--<noscript>" +| <body> +| "-->" + +#data +<!doctype html><noscript><!--</noscript>X<noscript>--></noscript> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noscript> +| "<!--" +| <body> +| "X" +| <noscript> +| "-->" + +#data +<!doctype html><noscript><iframe></noscript>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noscript> +| "<iframe>" +| <body> +| "X" + +#data +<!doctype html><noframes><!--<noframes></noframes>--></noframes> +#errors +Line: 1 Col: 64 Unexpected end tag (noframes). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noframes> +| "<!--<noframes>" +| <body> +| "-->" + +#data +<!doctype html><noframes><body><script><!--...</script></body></noframes></html> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noframes> +| "<body><script><!--...</script></body>" +| <body> + +#data +<!doctype html><textarea><!--<textarea></textarea>--></textarea> +#errors +Line: 1 Col: 64 Unexpected end tag (textarea). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> +| "<!--<textarea>" +| "-->" + +#data +<!doctype html><textarea></textarea></textarea> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> +| "</textarea>" + +#data +<!doctype html><textarea><</textarea> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> +| "<" + +#data +<!doctype html><textarea>a<b</textarea> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> +| "a<b" + +#data +<!doctype html><iframe><!--<iframe></iframe>--></iframe> +#errors +Line: 1 Col: 56 Unexpected end tag (iframe). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <iframe> +| "<!--<iframe>" +| "-->" + +#data +<!doctype html><iframe>...<!--X->...<!--/X->...</iframe> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <iframe> +| "...<!--X->...<!--/X->..." + +#data +<!doctype html><xmp><!--<xmp></xmp>--></xmp> +#errors +Line: 1 Col: 44 Unexpected end tag (xmp). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <xmp> +| "<!--<xmp>" +| "-->" + +#data +<!doctype html><noembed><!--<noembed></noembed>--></noembed> +#errors +Line: 1 Col: 60 Unexpected end tag (noembed). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <noembed> +| "<!--<noembed>" +| "-->" + +#data +<script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 8 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| <body> + +#data +<script>a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 9 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "a" +| <body> + +#data +<script>< +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 9 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<" +| <body> + +#data +<script></ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 10 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</" +| <body> + +#data +<script></S +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</S" +| <body> + +#data +<script></SC +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SC" +| <body> + +#data +<script></SCR +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SCR" +| <body> + +#data +<script></SCRI +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SCRI" +| <body> + +#data +<script></SCRIP +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 15 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SCRIP" +| <body> + +#data +<script></SCRIPT +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 16 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SCRIPT" +| <body> + +#data +<script></SCRIPT +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 17 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| <body> + +#data +<script></s +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</s" +| <body> + +#data +<script></sc +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</sc" +| <body> + +#data +<script></scr +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</scr" +| <body> + +#data +<script></scri +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</scri" +| <body> + +#data +<script></scrip +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 15 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</scrip" +| <body> + +#data +<script></script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 16 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</script" +| <body> + +#data +<script></script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 17 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| <body> + +#data +<script><! +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 10 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!" +| <body> + +#data +<script><!a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!a" +| <body> + +#data +<script><!- +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!-" +| <body> + +#data +<script><!-a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!-a" +| <body> + +#data +<script><!-- +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--" +| <body> + +#data +<script><!--a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--a" +| <body> + +#data +<script><!--< +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<" +| <body> + +#data +<script><!--<a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<a" +| <body> + +#data +<script><!--</ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--</" +| <body> + +#data +<script><!--</script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 20 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--</script" +| <body> + +#data +<script><!--</script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 21 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--" +| <body> + +#data +<script><!--<s +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<s" +| <body> + +#data +<script><!--<script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 19 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script" +| <body> + +#data +<script><!--<script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 20 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script " +| <body> + +#data +<script><!--<script < +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 21 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script <" +| <body> + +#data +<script><!--<script <a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script <a" +| <body> + +#data +<script><!--<script </ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </" +| <body> + +#data +<script><!--<script </s +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </s" +| <body> + +#data +<script><!--<script </script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script" +| <body> + +#data +<script><!--<script </scripta +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </scripta" +| <body> + +#data +<script><!--<script </script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<script><!--<script </script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script>" +| <body> + +#data +<script><!--<script </script/ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script/" +| <body> + +#data +<script><!--<script </script < +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 30 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script <" +| <body> + +#data +<script><!--<script </script <a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script <a" +| <body> + +#data +<script><!--<script </script </ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script </" +| <body> + +#data +<script><!--<script </script </script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script </script" +| <body> + +#data +<script><!--<script </script </script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<script><!--<script </script </script/ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<script><!--<script </script </script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<script><!--<script - +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 21 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -" +| <body> + +#data +<script><!--<script -a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -a" +| <body> + +#data +<script><!--<script -- +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --" +| <body> + +#data +<script><!--<script --a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --a" +| <body> + +#data +<script><!--<script --> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<script><!--<script -->< +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 24 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --><" +| <body> + +#data +<script><!--<script --></ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 25 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --></" +| <body> + +#data +<script><!--<script --></script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --></script" +| <body> + +#data +<script><!--<script --></script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<script><!--<script --></script/ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<script><!--<script --></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<script><!--<script><\/script>--></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script><\/script>-->" +| <body> + +#data +<script><!--<script></scr'+'ipt>--></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></scr'+'ipt>-->" +| <body> + +#data +<script><!--<script></script><script></script></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>" +| <body> + +#data +<script><!--<script></script><script></script>--><!--</script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>--><!--" +| <body> + +#data +<script><!--<script></script><script></script>-- ></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>-- >" +| <body> + +#data +<script><!--<script></script><script></script>- -></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>- ->" +| <body> + +#data +<script><!--<script></script><script></script>- - ></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>- - >" +| <body> + +#data +<script><!--<script></script><script></script>-></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>->" +| <body> + +#data +<script><!--<script>--!></script>X +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 34 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script>--!></script>X" +| <body> + +#data +<script><!--<scr'+'ipt></script>--></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 44 Unexpected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<scr'+'ipt>" +| <body> +| "-->" + +#data +<script><!--<script></scr'+'ipt></script>X +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 42 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script></scr'+'ipt></script>X" +| <body> + +#data +<style><!--<style></style>--></style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 37 Unexpected end tag (style). +#document +| <html> +| <head> +| <style> +| "<!--<style>" +| <body> +| "-->" + +#data +<style><!--</style>X +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| <html> +| <head> +| <style> +| "<!--" +| <body> +| "X" + +#data +<style><!--...</style>...--></style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 36 Unexpected end tag (style). +#document +| <html> +| <head> +| <style> +| "<!--..." +| <body> +| "...-->" + +#data +<style><!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style></style>X +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| <html> +| <head> +| <style> +| "<!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style>" +| <body> +| "X" + +#data +<style><!--...<style><!--...--!></style>--></style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 51 Unexpected end tag (style). +#document +| <html> +| <head> +| <style> +| "<!--...<style><!--...--!>" +| <body> +| "-->" + +#data +<style><!--...</style><!-- --><style>@import ...</style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| <html> +| <head> +| <style> +| "<!--..." +| <!-- --> +| <style> +| "@import ..." +| <body> + +#data +<style>...<style><!--...</style><!-- --></style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 48 Unexpected end tag (style). +#document +| <html> +| <head> +| <style> +| "...<style><!--..." +| <!-- --> +| <body> + +#data +<style>...<!--[if IE]><style>...</style>X +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| <html> +| <head> +| <style> +| "...<!--[if IE]><style>..." +| <body> +| "X" + +#data +<title><!--<title>--> +#errors +Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE. +Line: 1 Col: 37 Unexpected end tag (title). +#document +| +| +| +| "<!--<title>" +| <body> +| "-->" + +#data +<title></title> +#errors +Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE. +#document +| +| +| +| "" +| + +#data +foo/title><link></head><body>X +#errors +Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE. +Line: 1 Col: 37 Unexpected end of file. Expected end tag (title). +#document +| <html> +| <head> +| <title> +| "foo/title><link></head><body>X" +| <body> + +#data +<noscript><!--<noscript></noscript>--></noscript> +#errors +Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE. +Line: 1 Col: 49 Unexpected end tag (noscript). +#document +| <html> +| <head> +| <noscript> +| "<!--<noscript>" +| <body> +| "-->" + +#data +<noscript><!--</noscript>X<noscript>--></noscript> +#errors +Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE. +#document +| <html> +| <head> +| <noscript> +| "<!--" +| <body> +| "X" +| <noscript> +| "-->" + +#data +<noscript><iframe></noscript>X +#errors +Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE. +#document +| <html> +| <head> +| <noscript> +| "<iframe>" +| <body> +| "X" + +#data +<noframes><!--<noframes></noframes>--></noframes> +#errors +Line: 1 Col: 10 Unexpected start tag (noframes). Expected DOCTYPE. +Line: 1 Col: 49 Unexpected end tag (noframes). +#document +| <html> +| <head> +| <noframes> +| "<!--<noframes>" +| <body> +| "-->" + +#data +<noframes><body><script><!--...</script></body></noframes></html> +#errors +Line: 1 Col: 10 Unexpected start tag (noframes). Expected DOCTYPE. +#document +| <html> +| <head> +| <noframes> +| "<body><script><!--...</script></body>" +| <body> + +#data +<textarea><!--<textarea></textarea>--></textarea> +#errors +Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE. +Line: 1 Col: 49 Unexpected end tag (textarea). +#document +| <html> +| <head> +| <body> +| <textarea> +| "<!--<textarea>" +| "-->" + +#data +<textarea></textarea></textarea> +#errors +Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| <textarea> +| "</textarea>" + +#data +<iframe><!--<iframe></iframe>--></iframe> +#errors +Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE. +Line: 1 Col: 41 Unexpected end tag (iframe). +#document +| <html> +| <head> +| <body> +| <iframe> +| "<!--<iframe>" +| "-->" + +#data +<iframe>...<!--X->...<!--/X->...</iframe> +#errors +Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| <iframe> +| "...<!--X->...<!--/X->..." + +#data +<xmp><!--<xmp></xmp>--></xmp> +#errors +Line: 1 Col: 5 Unexpected start tag (xmp). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end tag (xmp). +#document +| <html> +| <head> +| <body> +| <xmp> +| "<!--<xmp>" +| "-->" + +#data +<noembed><!--<noembed></noembed>--></noembed> +#errors +Line: 1 Col: 9 Unexpected start tag (noembed). Expected DOCTYPE. +Line: 1 Col: 45 Unexpected end tag (noembed). +#document +| <html> +| <head> +| <body> +| <noembed> +| "<!--<noembed>" +| "-->" + +#data +<!doctype html><table> + +#errors +Line 2 Col 0 Unexpected end of file. Expected table content. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| " +" + +#data +<!doctype html><table><td><span><font></span><span> +#errors +Line 1 Col 26 Unexpected table cell start tag (td) in the table body phase. +Line 1 Col 45 Unexpected end tag (span). +Line 1 Col 51 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <span> +| <font> +| <font> +| <span> + +#data +<!doctype html><form><table></form><form></table></form> +#errors +35: Stray end tag “formâ€. +41: Start tag “form†seen in “tableâ€. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| <table> +| <form> diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests17.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests17.dat new file mode 100644 index 00000000..7b555f88 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests17.dat @@ -0,0 +1,153 @@ +#data +<!doctype html><table><tbody><select><tr> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table><tr><select><td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <table> +| <tbody> +| <tr> +| <td> + +#data +<!doctype html><table><tr><td><select><td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <select> +| <td> + +#data +<!doctype html><table><tr><th><select><td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <th> +| <select> +| <td> + +#data +<!doctype html><table><caption><select><tr> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <caption> +| <select> +| <tbody> +| <tr> + +#data +<!doctype html><select><tr> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><th> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><tbody> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><thead> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><tfoot> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><caption> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><table><tr></table>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| "a" diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests18.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests18.dat new file mode 100644 index 00000000..680e1f06 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests18.dat @@ -0,0 +1,269 @@ +#data +<!doctype html><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" + +#data +<!doctype html><table><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" +| <table> + +#data +<!doctype html><table><tbody><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" +| <table> +| <tbody> + +#data +<!doctype html><table><tbody><tr><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table><tbody><tr><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table><td><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <plaintext> +| "</plaintext>" + +#data +<!doctype html><table><caption><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <caption> +| <plaintext> +| "</plaintext>" + +#data +<!doctype html><table><tr><style></script></style>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "abc" +| <table> +| <tbody> +| <tr> +| <style> +| "</script>" + +#data +<!doctype html><table><tr><script></style></script>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "abc" +| <table> +| <tbody> +| <tr> +| <script> +| "</style>" + +#data +<!doctype html><table><caption><style></script></style>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <caption> +| <style> +| "</script>" +| "abc" + +#data +<!doctype html><table><td><style></script></style>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <style> +| "</script>" +| "abc" + +#data +<!doctype html><select><script></style></script>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <script> +| "</style>" +| "abc" + +#data +<!doctype html><table><select><script></style></script>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <script> +| "</style>" +| "abc" +| <table> + +#data +<!doctype html><table><tr><select><script></style></script>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <script> +| "</style>" +| "abc" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><frameset></frameset><noframes>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <noframes> +| "abc" + +#data +<!doctype html><frameset></frameset><noframes>abc</noframes><!--abc--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <noframes> +| "abc" +| <!-- abc --> + +#data +<!doctype html><frameset></frameset></html><noframes>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <noframes> +| "abc" + +#data +<!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <noframes> +| "abc" +| <!-- abc --> + +#data +<!doctype html><table><tr></tbody><tfoot> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <tfoot> + +#data +<!doctype html><table><td><svg></svg>abc<td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <svg svg> +| "abc" +| <td> diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests19.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests19.dat new file mode 100644 index 00000000..0d62f5a5 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests19.dat @@ -0,0 +1,1237 @@ +#data +<!doctype html><math><mn DefinitionUrl="foo"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <math math> +| <math mn> +| definitionURL="foo" + +#data +<!doctype html><html></p><!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <!-- foo --> +| <head> +| <body> + +#data +<!doctype html><head></head></p><!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <!-- foo --> +| <body> + +#data +<!doctype html><body><p><pre> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <pre> + +#data +<!doctype html><body><p><listing> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <listing> + +#data +<!doctype html><p><plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <plaintext> + +#data +<!doctype html><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <h1> + +#data +<!doctype html><form><isindex> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> + +#data +<!doctype html><isindex action="POST"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| action="POST" +| <hr> +| <label> +| "This is a searchable index. Enter search keywords: " +| <input> +| name="isindex" +| <hr> + +#data +<!doctype html><isindex prompt="this is isindex"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| <hr> +| <label> +| "this is isindex" +| <input> +| name="isindex" +| <hr> + +#data +<!doctype html><isindex type="hidden"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| <hr> +| <label> +| "This is a searchable index. Enter search keywords: " +| <input> +| name="isindex" +| type="hidden" +| <hr> + +#data +<!doctype html><isindex name="foo"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| <hr> +| <label> +| "This is a searchable index. Enter search keywords: " +| <input> +| name="isindex" +| <hr> + +#data +<!doctype html><ruby><p><rp> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <p> +| <rp> + +#data +<!doctype html><ruby><div><span><rp> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <div> +| <span> +| <rp> + +#data +<!doctype html><ruby><div><p><rp> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <div> +| <p> +| <rp> + +#data +<!doctype html><ruby><p><rt> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <p> +| <rt> + +#data +<!doctype html><ruby><div><span><rt> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <div> +| <span> +| <rt> + +#data +<!doctype html><ruby><div><p><rt> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <div> +| <p> +| <rt> + +#data +<!doctype html><math/><foo> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <math math> +| <foo> + +#data +<!doctype html><svg/><foo> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <svg svg> +| <foo> + +#data +<!doctype html><div></body><!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <div> +| <!-- foo --> + +#data +<!doctype html><h1><div><h3><span></h1>foo +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <h1> +| <div> +| <h3> +| <span> +| "foo" + +#data +<!doctype html><p></h3>foo +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| "foo" + +#data +<!doctype html><h3><li>abc</h2>foo +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <h3> +| <li> +| "abc" +| "foo" + +#data +<!doctype html><table>abc<!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "abc" +| <table> +| <!-- foo --> + +#data +<!doctype html><table> <!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| " " +| <!-- foo --> + +#data +<!doctype html><table> b <!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " b " +| <table> +| <!-- foo --> + +#data +<!doctype html><select><option><option> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <option> +| <option> + +#data +<!doctype html><select><option></optgroup> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <option> + +#data +<!doctype html><select><option></optgroup> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <option> + +#data +<!doctype html><p><math><mi><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mi> +| <p> +| <h1> + +#data +<!doctype html><p><math><mo><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mo> +| <p> +| <h1> + +#data +<!doctype html><p><math><mn><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mn> +| <p> +| <h1> + +#data +<!doctype html><p><math><ms><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math ms> +| <p> +| <h1> + +#data +<!doctype html><p><math><mtext><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mtext> +| <p> +| <h1> + +#data +<!doctype html><frameset></noframes> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!doctype html><html c=d><body></html><html a=b> +#errors +#document +| <!DOCTYPE html> +| <html> +| a="b" +| c="d" +| <head> +| <body> + +#data +<!doctype html><html c=d><frameset></frameset></html><html a=b> +#errors +#document +| <!DOCTYPE html> +| <html> +| a="b" +| c="d" +| <head> +| <frameset> + +#data +<!doctype html><html><frameset></frameset></html><!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <!-- foo --> + +#data +<!doctype html><html><frameset></frameset></html> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| " " + +#data +<!doctype html><html><frameset></frameset></html>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!doctype html><html><frameset></frameset></html><p> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!doctype html><html><frameset></frameset></html></p> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<html><frameset></frameset></html><!doctype html> +#errors +#document +| <html> +| <head> +| <frameset> + +#data +<!doctype html><body><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> + +#data +<!doctype html><p><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><p>a<frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| "a" + +#data +<!doctype html><p> <frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><pre><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <pre> + +#data +<!doctype html><listing><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <listing> + +#data +<!doctype html><li><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <li> + +#data +<!doctype html><dd><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <dd> + +#data +<!doctype html><dt><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <dt> + +#data +<!doctype html><button><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <button> + +#data +<!doctype html><applet><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <applet> + +#data +<!doctype html><marquee><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <marquee> + +#data +<!doctype html><object><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <object> + +#data +<!doctype html><table><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> + +#data +<!doctype html><area><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <area> + +#data +<!doctype html><basefont><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <basefont> +| <frameset> + +#data +<!doctype html><bgsound><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <bgsound> +| <frameset> + +#data +<!doctype html><br><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <br> + +#data +<!doctype html><embed><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <embed> + +#data +<!doctype html><img><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <img> + +#data +<!doctype html><input><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <input> + +#data +<!doctype html><keygen><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <keygen> + +#data +<!doctype html><wbr><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <wbr> + +#data +<!doctype html><hr><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <hr> + +#data +<!doctype html><textarea></textarea><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> + +#data +<!doctype html><xmp></xmp><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <xmp> + +#data +<!doctype html><iframe></iframe><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <iframe> + +#data +<!doctype html><select></select><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><svg></svg><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><math></math><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><svg><foreignObject><div> <frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><svg>a</svg><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <svg svg> +| "a" + +#data +<!doctype html><svg> </svg><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<html>aaa<frameset></frameset> +#errors +#document +| <html> +| <head> +| <body> +| "aaa" + +#data +<html> a <frameset></frameset> +#errors +#document +| <html> +| <head> +| <body> +| "a " + +#data +<!doctype html><div><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!doctype html><div><body><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <div> + +#data +<!doctype html><p><math></p>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| "a" + +#data +<!doctype html><p><math><mn><span></p>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mn> +| <span> +| <p> +| "a" + +#data +<!doctype html><math></html> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <math math> + +#data +<!doctype html><meta charset="ascii"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <meta> +| charset="ascii" +| <body> + +#data +<!doctype html><meta http-equiv="content-type" content="text/html;charset=ascii"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <meta> +| content="text/html;charset=ascii" +| http-equiv="content-type" +| <body> + +#data +<!doctype html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset="utf8"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <!-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --> +| <meta> +| charset="utf8" +| <body> + +#data +<!doctype html><html a=b><head></head><html c=d> +#errors +#document +| <!DOCTYPE html> +| <html> +| a="b" +| c="d" +| <head> +| <body> + +#data +<!doctype html><image/> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <img> + +#data +<!doctype html>a<i>b<table>c<b>d</i>e</b>f +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "a" +| <i> +| "bc" +| <b> +| "de" +| "f" +| <table> + +#data +<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <b> +| "b" +| <b> +| <div> +| <b> +| <i> +| "c" +| <a> +| "d" +| <a> +| "e" +| <a> +| "f" +| <table> + +#data +<!doctype html><i>a<b>b<div>c<a>d</i>e</b>f +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <b> +| "b" +| <b> +| <div> +| <b> +| <i> +| "c" +| <a> +| "d" +| <a> +| "e" +| <a> +| "f" + +#data +<!doctype html><table><i>a<b>b<div>c</i> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <b> +| "b" +| <b> +| <div> +| <i> +| "c" +| <table> + +#data +<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <b> +| "b" +| <b> +| <div> +| <b> +| <i> +| "c" +| <a> +| "d" +| <a> +| "e" +| <a> +| "f" +| <table> + +#data +<!doctype html><table><i>a<div>b<tr>c<b>d</i>e +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <div> +| "b" +| <i> +| "c" +| <b> +| "d" +| <b> +| "e" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table><td><table><i>a<div>b<b>c</i>d +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <i> +| "a" +| <div> +| <i> +| "b" +| <b> +| "c" +| <b> +| "d" +| <table> + +#data +<!doctype html><body><bgsound> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <bgsound> + +#data +<!doctype html><body><basefont> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <basefont> + +#data +<!doctype html><a><b></a><basefont> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <a> +| <b> +| <basefont> + +#data +<!doctype html><a><b></a><bgsound> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <a> +| <b> +| <bgsound> + +#data +<!doctype html><figcaption><article></figcaption>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <figcaption> +| <article> +| "a" + +#data +<!doctype html><summary><article></summary>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <summary> +| <article> +| "a" + +#data +<!doctype html><p><a><plaintext>b +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <a> +| <plaintext> +| <a> +| "b" + +#data +<!DOCTYPE html><div>a<a></div>b<p>c</p>d +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <div> +| "a" +| <a> +| <a> +| "b" +| <p> +| "c" +| "d" diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests2.dat b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests2.dat new file mode 100644 index 00000000..60d85922 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/html/testdata/webkit/tests2.dat @@ -0,0 +1,763 @@ +#data +<!DOCTYPE html>Test +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "Test" + +#data +<textarea>test</div>test +#errors +Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE. +Line: 1 Col: 24 Expected closing tag. Unexpected end of file. +#document +| <html> +| <head> +| <body> +| <textarea> +| "test</div>test" + +#data +<table><td> +#errors +Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase. +Line: 1 Col: 11 Expected closing tag. Unexpected end of file. +#document +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> + +#data +<table><td>test</tbody></table> +#errors +Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase. +#document +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| "test" + +#data +<frame>test +#errors +Line: 1 Col: 7 Unexpected start tag (frame). Expected DOCTYPE. +Line: 1 Col: 7 Unexpected start tag frame. Ignored. +#document +| <html> +| <head> +| <body> +| "test" + +#data +<!DOCTYPE html><frameset>test +#errors +Line: 1 Col: 29 Unepxected characters in the frameset phase. Characters ignored. +Line: 1 Col: 29 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!DOCTYPE html><frameset><!DOCTYPE html> +#errors +Line: 1 Col: 40 Unexpected DOCTYPE. Ignored. +Line: 1 Col: 40 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!DOCTYPE html><font><p><b>test</font> +#errors +Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm. +Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <font> +| <p> +| <font> +| <b> +| "test" + +#data +<!DOCTYPE html><dt><div><dd> +#errors +Line: 1 Col: 28 Missing end tag (div, dt). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <dt> +| <div> +| <dd> + +#data +<script></x +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</x" +| <body> + +#data +<table><plaintext><td> +#errors +Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. +Line: 1 Col: 18 Unexpected start tag (plaintext) in table context caused voodoo mode. +Line: 1 Col: 22 Unexpected end of file. Expected table content. +#document +| <html> +| <head> +| <body> +| <plaintext> +| "<td>" +| <table> + +#data +<plaintext></plaintext> +#errors +Line: 1 Col: 11 Unexpected start tag (plaintext). Expected DOCTYPE. +Line: 1 Col: 23 Expected closing tag. Unexpected end of file. +#document +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" + +#data +<!DOCTYPE html><table><tr>TEST +#errors +Line: 1 Col: 30 Unexpected non-space characters in table context caused voodoo mode. +Line: 1 Col: 30 Unexpected end of file. Expected table content. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "TEST" +| <table> +| <tbody> +| <tr> + +#data +<!DOCTYPE html><body t1=1><body t2=2><body t3=3 t4=4> +#errors +Line: 1 Col: 37 Unexpected start tag (body). +Line: 1 Col: 53 Unexpected start tag (body). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| t1="1" +| t2="2" +| t3="3" +| t4="4" + +#data +</b test +#errors +Line: 1 Col: 8 Unexpected end of file in attribute name. +Line: 1 Col: 8 End tag contains unexpected attributes. +Line: 1 Col: 8 Unexpected end tag (b). Expected DOCTYPE. +Line: 1 Col: 8 Unexpected end tag (b) after the (implied) root element. +#document +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html></b test<b &=&>X +#errors +Line: 1 Col: 32 Named entity didn't end with ';'. +Line: 1 Col: 33 End tag contains unexpected attributes. +Line: 1 Col: 33 Unexpected end tag (b) after the (implied) root element. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "X" + +#data +<!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +Line: 1 Col: 54 Unexpected end of file in the tag name. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| type="text/x-foobar;baz" +| "X</SCRipt" +| <body> + +#data +& +#errors +Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&" + +#data +&# +#errors +Line: 1 Col: 1 Numeric entity expected. Got end of file instead. +Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&#" + +#data +&#X +#errors +Line: 1 Col: 3 Numeric entity expected but none found. +Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&#X" + +#data +&#x +#errors +Line: 1 Col: 3 Numeric entity expected but none found. +Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&#x" + +#data +- +#errors +Line: 1 Col: 4 Numeric entity didn't end with ';'. +Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "-" + +#data +&x-test +#errors +Line: 1 Col: 1 Named entity expected. Got none. +Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&x-test" + +#data +<!doctypehtml><p><li> +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <li> + +#data +<!doctypehtml><p><dt> +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <dt> + +#data +<!doctypehtml><p><dd> +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <dd> + +#data +<!doctypehtml><p><form> +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +Line: 1 Col: 23 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <form> + +#data +<!DOCTYPE html><p></P>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| "X" + +#data +& +#errors +Line: 1 Col: 4 Named entity didn't end with ';'. +Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&" + +#data +&AMp; +#errors +Line: 1 Col: 1 Named entity expected. Got none. +Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&AMp;" + +#data +<!DOCTYPE html><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY> +#errors +Line: 1 Col: 110 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly> + +#data +<!DOCTYPE html>X</body>X +#errors +Line: 1 Col: 24 Unexpected non-space characters in the after body phase. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "XX" + +#data +<!DOCTYPE html><!-- X +#errors +Line: 1 Col: 21 Unexpected end of file in comment. +#document +| <!DOCTYPE html> +| <!-- X --> +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html><table><caption>test TEST</caption><td>test +#errors +Line: 1 Col: 54 Unexpected table cell start tag (td) in the table body phase. +Line: 1 Col: 58 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <caption> +| "test TEST" +| <tbody> +| <tr> +| <td> +| "test" + +#data +<!DOCTYPE html><select><option><optgroup> +#errors +Line: 1 Col: 41 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <option> +| <optgroup> + +#data +<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option> +#errors +Line: 1 Col: 68 Unexpected select start tag in the select phase treated as select end tag. +Line: 1 Col: 76 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <optgroup> +| <option> +| <option> +| <option> + +#data +<!DOCTYPE html><select><optgroup><option><optgroup> +#errors +Line: 1 Col: 51 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <optgroup> +| <option> +| <optgroup> + +#data +<!DOCTYPE html><datalist><option>foo</datalist>bar +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <datalist> +| <option> +| "foo" +| "bar" + +#data +<!DOCTYPE html><font><input><input></font> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <font> +| <input> +| <input> + +#data +<!DOCTYPE html><!-- XXX - XXX --> +#errors +#document +| <!DOCTYPE html> +| <!-- XXX - XXX --> +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html><!-- XXX - XXX +#errors +Line: 1 Col: 29 Unexpected end of file in comment (-) +#document +| <!DOCTYPE html> +| <!-- XXX - XXX --> +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html><!-- XXX - XXX - XXX --> +#errors +#document +| <!DOCTYPE html> +| <!-- XXX - XXX - XXX --> +| <html> +| <head> +| <body> + +#data +<isindex test=x name=x> +#errors +Line: 1 Col: 23 Unexpected start tag (isindex). Expected DOCTYPE. +Line: 1 Col: 23 Unexpected start tag isindex. Don't use it! +#document +| <html> +| <head> +| <body> +| <form> +| <hr> +| <label> +| "This is a searchable index. Enter search keywords: " +| <input> +| name="isindex" +| test="x" +| <hr> + +#data +test +test +#errors +Line: 2 Col: 4 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "test +test" + +#data +<!DOCTYPE html><body><title>test</body> +#errors +#document +| +| +| +| +| +| "test</body>" + +#data +<!DOCTYPE html><body><title>X +#errors +#document +| +| +| +| +| +| "X" +| <meta> +| name="z" +| <link> +| rel="foo" +| <style> +| " +x { content:"</style" } " + +#data +<!DOCTYPE html><select><optgroup></optgroup></select> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <optgroup> + +#data + + +#errors +Line: 2 Col: 1 Unexpected End of file. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html> <html> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html><script> +</script> <title>x +#errors +#document +| +| +| +| +#errors +Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE. +Line: 1 Col: 21 Unexpected start tag (script) that can be in head. Moved. +#document +| +| +| +#errors +Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE. +Line: 1 Col: 28 Unexpected start tag (style) that can be in head. Moved. +#document +| +| +| +#errors +Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE. +#document +| +| +| +| +| "x" +| x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (style). +#document +| +| +| --> x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| +| +| x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| +| +| x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| +| +| x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| +| +|

+#errors +#document +| +| +| +| +| +| ddd +#errors +#document +| +| +| +#errors +#document +| +| +| +| +|
  • +| +| + + +

    /debug/events

    + +
  • + {{range $i, $fam := .Families}} + + + + {{range $j, $bucket := $.Buckets}} + {{$n := index $.Counts $i $j}} + + {{end}} + + {{end}} +
    {{$fam}} + {{if $n}}{{end}} + [{{$n}} {{$bucket.String}}] + {{if $n}}{{end}} +
    + +{{if $.EventLogs}} +


    +

    Family: {{$.Family}}

    + +{{if $.Expanded}}
    {{end}} +[Summary]{{if $.Expanded}}{{end}} + +{{if not $.Expanded}}{{end}} +[Expanded]{{if not $.Expanded}}{{end}} + + + + {{range $el := $.EventLogs}} + + + + + {{if $.Expanded}} + + + + + + {{range $el.Events}} + + + + + + {{end}} + {{end}} + {{end}} +
    WhenElapsed
    {{$el.When}}{{$el.ElapsedTime}}{{$el.Title}} +
    {{$el.Stack|trimSpace}}
    {{.WhenString}}{{elapsed .Elapsed}}.{{if .IsErr}}E{{else}}.{{end}}. {{.What}}
    +{{end}} + + +` diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/trace/histogram.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/trace/histogram.go new file mode 100644 index 00000000..bb42aa53 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/trace/histogram.go @@ -0,0 +1,356 @@ +// Copyright 2015 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. + +package trace + +// This file implements histogramming for RPC statistics collection. + +import ( + "bytes" + "fmt" + "html/template" + "log" + "math" + + "golang.org/x/net/internal/timeseries" +) + +const ( + bucketCount = 38 +) + +// histogram keeps counts of values in buckets that are spaced +// out in powers of 2: 0-1, 2-3, 4-7... +// histogram implements timeseries.Observable +type histogram struct { + sum int64 // running total of measurements + sumOfSquares float64 // square of running total + buckets []int64 // bucketed values for histogram + value int // holds a single value as an optimization + valueCount int64 // number of values recorded for single value +} + +// AddMeasurement records a value measurement observation to the histogram. +func (h *histogram) addMeasurement(value int64) { + // TODO: assert invariant + h.sum += value + h.sumOfSquares += float64(value) * float64(value) + + bucketIndex := getBucket(value) + + if h.valueCount == 0 || (h.valueCount > 0 && h.value == bucketIndex) { + h.value = bucketIndex + h.valueCount++ + } else { + h.allocateBuckets() + h.buckets[bucketIndex]++ + } +} + +func (h *histogram) allocateBuckets() { + if h.buckets == nil { + h.buckets = make([]int64, bucketCount) + h.buckets[h.value] = h.valueCount + h.value = 0 + h.valueCount = -1 + } +} + +func log2(i int64) int { + n := 0 + for ; i >= 0x100; i >>= 8 { + n += 8 + } + for ; i > 0; i >>= 1 { + n += 1 + } + return n +} + +func getBucket(i int64) (index int) { + index = log2(i) - 1 + if index < 0 { + index = 0 + } + if index >= bucketCount { + index = bucketCount - 1 + } + return +} + +// Total returns the number of recorded observations. +func (h *histogram) total() (total int64) { + if h.valueCount >= 0 { + total = h.valueCount + } + for _, val := range h.buckets { + total += int64(val) + } + return +} + +// Average returns the average value of recorded observations. +func (h *histogram) average() float64 { + t := h.total() + if t == 0 { + return 0 + } + return float64(h.sum) / float64(t) +} + +// Variance returns the variance of recorded observations. +func (h *histogram) variance() float64 { + t := float64(h.total()) + if t == 0 { + return 0 + } + s := float64(h.sum) / t + return h.sumOfSquares/t - s*s +} + +// StandardDeviation returns the standard deviation of recorded observations. +func (h *histogram) standardDeviation() float64 { + return math.Sqrt(h.variance()) +} + +// PercentileBoundary estimates the value that the given fraction of recorded +// observations are less than. +func (h *histogram) percentileBoundary(percentile float64) int64 { + total := h.total() + + // Corner cases (make sure result is strictly less than Total()) + if total == 0 { + return 0 + } else if total == 1 { + return int64(h.average()) + } + + percentOfTotal := round(float64(total) * percentile) + var runningTotal int64 + + for i := range h.buckets { + value := h.buckets[i] + runningTotal += value + if runningTotal == percentOfTotal { + // We hit an exact bucket boundary. If the next bucket has data, it is a + // good estimate of the value. If the bucket is empty, we interpolate the + // midpoint between the next bucket's boundary and the next non-zero + // bucket. If the remaining buckets are all empty, then we use the + // boundary for the next bucket as the estimate. + j := uint8(i + 1) + min := bucketBoundary(j) + if runningTotal < total { + for h.buckets[j] == 0 { + j++ + } + } + max := bucketBoundary(j) + return min + round(float64(max-min)/2) + } else if runningTotal > percentOfTotal { + // The value is in this bucket. Interpolate the value. + delta := runningTotal - percentOfTotal + percentBucket := float64(value-delta) / float64(value) + bucketMin := bucketBoundary(uint8(i)) + nextBucketMin := bucketBoundary(uint8(i + 1)) + bucketSize := nextBucketMin - bucketMin + return bucketMin + round(percentBucket*float64(bucketSize)) + } + } + return bucketBoundary(bucketCount - 1) +} + +// Median returns the estimated median of the observed values. +func (h *histogram) median() int64 { + return h.percentileBoundary(0.5) +} + +// Add adds other to h. +func (h *histogram) Add(other timeseries.Observable) { + o := other.(*histogram) + if o.valueCount == 0 { + // Other histogram is empty + } else if h.valueCount >= 0 && o.valueCount > 0 && h.value == o.value { + // Both have a single bucketed value, aggregate them + h.valueCount += o.valueCount + } else { + // Two different values necessitate buckets in this histogram + h.allocateBuckets() + if o.valueCount >= 0 { + h.buckets[o.value] += o.valueCount + } else { + for i := range h.buckets { + h.buckets[i] += o.buckets[i] + } + } + } + h.sumOfSquares += o.sumOfSquares + h.sum += o.sum +} + +// Clear resets the histogram to an empty state, removing all observed values. +func (h *histogram) Clear() { + h.buckets = nil + h.value = 0 + h.valueCount = 0 + h.sum = 0 + h.sumOfSquares = 0 +} + +// CopyFrom copies from other, which must be a *histogram, into h. +func (h *histogram) CopyFrom(other timeseries.Observable) { + o := other.(*histogram) + if o.valueCount == -1 { + h.allocateBuckets() + copy(h.buckets, o.buckets) + } + h.sum = o.sum + h.sumOfSquares = o.sumOfSquares + h.value = o.value + h.valueCount = o.valueCount +} + +// Multiply scales the histogram by the specified ratio. +func (h *histogram) Multiply(ratio float64) { + if h.valueCount == -1 { + for i := range h.buckets { + h.buckets[i] = int64(float64(h.buckets[i]) * ratio) + } + } else { + h.valueCount = int64(float64(h.valueCount) * ratio) + } + h.sum = int64(float64(h.sum) * ratio) + h.sumOfSquares = h.sumOfSquares * ratio +} + +// New creates a new histogram. +func (h *histogram) New() timeseries.Observable { + r := new(histogram) + r.Clear() + return r +} + +func (h *histogram) String() string { + return fmt.Sprintf("%d, %f, %d, %d, %v", + h.sum, h.sumOfSquares, h.value, h.valueCount, h.buckets) +} + +// round returns the closest int64 to the argument +func round(in float64) int64 { + return int64(math.Floor(in + 0.5)) +} + +// bucketBoundary returns the first value in the bucket. +func bucketBoundary(bucket uint8) int64 { + if bucket == 0 { + return 0 + } + return 1 << bucket +} + +// bucketData holds data about a specific bucket for use in distTmpl. +type bucketData struct { + Lower, Upper int64 + N int64 + Pct, CumulativePct float64 + GraphWidth int +} + +// data holds data about a Distribution for use in distTmpl. +type data struct { + Buckets []*bucketData + Count, Median int64 + Mean, StandardDeviation float64 +} + +// maxHTMLBarWidth is the maximum width of the HTML bar for visualizing buckets. +const maxHTMLBarWidth = 350.0 + +// newData returns data representing h for use in distTmpl. +func (h *histogram) newData() *data { + // Force the allocation of buckets to simplify the rendering implementation + h.allocateBuckets() + // We scale the bars on the right so that the largest bar is + // maxHTMLBarWidth pixels in width. + maxBucket := int64(0) + for _, n := range h.buckets { + if n > maxBucket { + maxBucket = n + } + } + total := h.total() + barsizeMult := maxHTMLBarWidth / float64(maxBucket) + var pctMult float64 + if total == 0 { + pctMult = 1.0 + } else { + pctMult = 100.0 / float64(total) + } + + buckets := make([]*bucketData, len(h.buckets)) + runningTotal := int64(0) + for i, n := range h.buckets { + if n == 0 { + continue + } + runningTotal += n + var upperBound int64 + if i < bucketCount-1 { + upperBound = bucketBoundary(uint8(i + 1)) + } else { + upperBound = math.MaxInt64 + } + buckets[i] = &bucketData{ + Lower: bucketBoundary(uint8(i)), + Upper: upperBound, + N: n, + Pct: float64(n) * pctMult, + CumulativePct: float64(runningTotal) * pctMult, + GraphWidth: int(float64(n) * barsizeMult), + } + } + return &data{ + Buckets: buckets, + Count: total, + Median: h.median(), + Mean: h.average(), + StandardDeviation: h.standardDeviation(), + } +} + +func (h *histogram) html() template.HTML { + buf := new(bytes.Buffer) + if err := distTmpl.Execute(buf, h.newData()); err != nil { + buf.Reset() + log.Printf("net/trace: couldn't execute template: %v", err) + } + return template.HTML(buf.String()) +} + +// Input: data +var distTmpl = template.Must(template.New("distTmpl").Parse(` + + + + + + + +
    Count: {{.Count}}Mean: {{printf "%.0f" .Mean}}StdDev: {{printf "%.0f" .StandardDeviation}}Median: {{.Median}}
    +
    + +{{range $b := .Buckets}} +{{if $b}} + + + + + + + + + +{{end}} +{{end}} +
    [{{.Lower}},{{.Upper}}){{.N}}{{printf "%#.3f" .Pct}}%{{printf "%#.3f" .CumulativePct}}%
    +`)) diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/trace/trace.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/trace/trace.go new file mode 100644 index 00000000..0767c8c6 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/trace/trace.go @@ -0,0 +1,1059 @@ +// Copyright 2015 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. + +/* +Package trace implements tracing of requests and long-lived objects. +It exports HTTP interfaces on /debug/requests and /debug/events. + +A trace.Trace provides tracing for short-lived objects, usually requests. +A request handler might be implemented like this: + + func fooHandler(w http.ResponseWriter, req *http.Request) { + tr := trace.New("mypkg.Foo", req.URL.Path) + defer tr.Finish() + ... + tr.LazyPrintf("some event %q happened", str) + ... + if err := somethingImportant(); err != nil { + tr.LazyPrintf("somethingImportant failed: %v", err) + tr.SetError() + } + } + +The /debug/requests HTTP endpoint organizes the traces by family, +errors, and duration. It also provides histogram of request duration +for each family. + +A trace.EventLog provides tracing for long-lived objects, such as RPC +connections. + + // A Fetcher fetches URL paths for a single domain. + type Fetcher struct { + domain string + events trace.EventLog + } + + func NewFetcher(domain string) *Fetcher { + return &Fetcher{ + domain, + trace.NewEventLog("mypkg.Fetcher", domain), + } + } + + func (f *Fetcher) Fetch(path string) (string, error) { + resp, err := http.Get("http://" + f.domain + "/" + path) + if err != nil { + f.events.Errorf("Get(%q) = %v", path, err) + return "", err + } + f.events.Printf("Get(%q) = %s", path, resp.Status) + ... + } + + func (f *Fetcher) Close() error { + f.events.Finish() + return nil + } + +The /debug/events HTTP endpoint organizes the event logs by family and +by time since the last error. The expanded view displays recent log +entries and the log's call stack. +*/ +package trace // import "golang.org/x/net/trace" + +import ( + "bytes" + "fmt" + "html/template" + "io" + "log" + "net" + "net/http" + "runtime" + "sort" + "strconv" + "sync" + "sync/atomic" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/internal/timeseries" +) + +// DebugUseAfterFinish controls whether to debug uses of Trace values after finishing. +// FOR DEBUGGING ONLY. This will slow down the program. +var DebugUseAfterFinish = false + +// AuthRequest determines whether a specific request is permitted to load the +// /debug/requests or /debug/events pages. +// +// It returns two bools; the first indicates whether the page may be viewed at all, +// and the second indicates whether sensitive events will be shown. +// +// AuthRequest may be replaced by a program to customise its authorisation requirements. +// +// The default AuthRequest function returns (true, true) iff the request comes from localhost/127.0.0.1/[::1]. +var AuthRequest = func(req *http.Request) (any, sensitive bool) { + host, _, err := net.SplitHostPort(req.RemoteAddr) + switch { + case err != nil: // Badly formed address; fail closed. + return false, false + case host == "localhost" || host == "127.0.0.1" || host == "::1": + return true, true + default: + return false, false + } +} + +func init() { + http.HandleFunc("/debug/requests", func(w http.ResponseWriter, req *http.Request) { + any, sensitive := AuthRequest(req) + if !any { + http.Error(w, "not allowed", http.StatusUnauthorized) + return + } + w.Header().Set("Content-Type", "text/html; charset=utf-8") + Render(w, req, sensitive) + }) + http.HandleFunc("/debug/events", func(w http.ResponseWriter, req *http.Request) { + any, sensitive := AuthRequest(req) + if !any { + http.Error(w, "not allowed", http.StatusUnauthorized) + return + } + w.Header().Set("Content-Type", "text/html; charset=utf-8") + RenderEvents(w, req, sensitive) + }) +} + +// Render renders the HTML page typically served at /debug/requests. +// It does not do any auth checking; see AuthRequest for the default auth check +// used by the handler registered on http.DefaultServeMux. +// req may be nil. +func Render(w io.Writer, req *http.Request, sensitive bool) { + data := &struct { + Families []string + ActiveTraceCount map[string]int + CompletedTraces map[string]*family + + // Set when a bucket has been selected. + Traces traceList + Family string + Bucket int + Expanded bool + Traced bool + Active bool + ShowSensitive bool // whether to show sensitive events + + Histogram template.HTML + HistogramWindow string // e.g. "last minute", "last hour", "all time" + + // If non-zero, the set of traces is a partial set, + // and this is the total number. + Total int + }{ + CompletedTraces: completedTraces, + } + + data.ShowSensitive = sensitive + if req != nil { + // Allow show_sensitive=0 to force hiding of sensitive data for testing. + // This only goes one way; you can't use show_sensitive=1 to see things. + if req.FormValue("show_sensitive") == "0" { + data.ShowSensitive = false + } + + if exp, err := strconv.ParseBool(req.FormValue("exp")); err == nil { + data.Expanded = exp + } + if exp, err := strconv.ParseBool(req.FormValue("rtraced")); err == nil { + data.Traced = exp + } + } + + completedMu.RLock() + data.Families = make([]string, 0, len(completedTraces)) + for fam := range completedTraces { + data.Families = append(data.Families, fam) + } + completedMu.RUnlock() + sort.Strings(data.Families) + + // We are careful here to minimize the time spent locking activeMu, + // since that lock is required every time an RPC starts and finishes. + data.ActiveTraceCount = make(map[string]int, len(data.Families)) + activeMu.RLock() + for fam, s := range activeTraces { + data.ActiveTraceCount[fam] = s.Len() + } + activeMu.RUnlock() + + var ok bool + data.Family, data.Bucket, ok = parseArgs(req) + switch { + case !ok: + // No-op + case data.Bucket == -1: + data.Active = true + n := data.ActiveTraceCount[data.Family] + data.Traces = getActiveTraces(data.Family) + if len(data.Traces) < n { + data.Total = n + } + case data.Bucket < bucketsPerFamily: + if b := lookupBucket(data.Family, data.Bucket); b != nil { + data.Traces = b.Copy(data.Traced) + } + default: + if f := getFamily(data.Family, false); f != nil { + var obs timeseries.Observable + f.LatencyMu.RLock() + switch o := data.Bucket - bucketsPerFamily; o { + case 0: + obs = f.Latency.Minute() + data.HistogramWindow = "last minute" + case 1: + obs = f.Latency.Hour() + data.HistogramWindow = "last hour" + case 2: + obs = f.Latency.Total() + data.HistogramWindow = "all time" + } + f.LatencyMu.RUnlock() + if obs != nil { + data.Histogram = obs.(*histogram).html() + } + } + } + + if data.Traces != nil { + defer data.Traces.Free() + sort.Sort(data.Traces) + } + + completedMu.RLock() + defer completedMu.RUnlock() + if err := pageTmpl.ExecuteTemplate(w, "Page", data); err != nil { + log.Printf("net/trace: Failed executing template: %v", err) + } +} + +func parseArgs(req *http.Request) (fam string, b int, ok bool) { + if req == nil { + return "", 0, false + } + fam, bStr := req.FormValue("fam"), req.FormValue("b") + if fam == "" || bStr == "" { + return "", 0, false + } + b, err := strconv.Atoi(bStr) + if err != nil || b < -1 { + return "", 0, false + } + + return fam, b, true +} + +func lookupBucket(fam string, b int) *traceBucket { + f := getFamily(fam, false) + if f == nil || b < 0 || b >= len(f.Buckets) { + return nil + } + return f.Buckets[b] +} + +type contextKeyT string + +var contextKey = contextKeyT("golang.org/x/net/trace.Trace") + +// NewContext returns a copy of the parent context +// and associates it with a Trace. +func NewContext(ctx context.Context, tr Trace) context.Context { + return context.WithValue(ctx, contextKey, tr) +} + +// FromContext returns the Trace bound to the context, if any. +func FromContext(ctx context.Context) (tr Trace, ok bool) { + tr, ok = ctx.Value(contextKey).(Trace) + return +} + +// Trace represents an active request. +type Trace interface { + // LazyLog adds x to the event log. It will be evaluated each time the + // /debug/requests page is rendered. Any memory referenced by x will be + // pinned until the trace is finished and later discarded. + LazyLog(x fmt.Stringer, sensitive bool) + + // LazyPrintf evaluates its arguments with fmt.Sprintf each time the + // /debug/requests page is rendered. Any memory referenced by a will be + // pinned until the trace is finished and later discarded. + LazyPrintf(format string, a ...interface{}) + + // SetError declares that this trace resulted in an error. + SetError() + + // SetRecycler sets a recycler for the trace. + // f will be called for each event passed to LazyLog at a time when + // it is no longer required, whether while the trace is still active + // and the event is discarded, or when a completed trace is discarded. + SetRecycler(f func(interface{})) + + // SetTraceInfo sets the trace info for the trace. + // This is currently unused. + SetTraceInfo(traceID, spanID uint64) + + // SetMaxEvents sets the maximum number of events that will be stored + // in the trace. This has no effect if any events have already been + // added to the trace. + SetMaxEvents(m int) + + // Finish declares that this trace is complete. + // The trace should not be used after calling this method. + Finish() +} + +type lazySprintf struct { + format string + a []interface{} +} + +func (l *lazySprintf) String() string { + return fmt.Sprintf(l.format, l.a...) +} + +// New returns a new Trace with the specified family and title. +func New(family, title string) Trace { + tr := newTrace() + tr.ref() + tr.Family, tr.Title = family, title + tr.Start = time.Now() + tr.events = make([]event, 0, maxEventsPerTrace) + + activeMu.RLock() + s := activeTraces[tr.Family] + activeMu.RUnlock() + if s == nil { + activeMu.Lock() + s = activeTraces[tr.Family] // check again + if s == nil { + s = new(traceSet) + activeTraces[tr.Family] = s + } + activeMu.Unlock() + } + s.Add(tr) + + // Trigger allocation of the completed trace structure for this family. + // This will cause the family to be present in the request page during + // the first trace of this family. We don't care about the return value, + // nor is there any need for this to run inline, so we execute it in its + // own goroutine, but only if the family isn't allocated yet. + completedMu.RLock() + if _, ok := completedTraces[tr.Family]; !ok { + go allocFamily(tr.Family) + } + completedMu.RUnlock() + + return tr +} + +func (tr *trace) Finish() { + tr.Elapsed = time.Now().Sub(tr.Start) + if DebugUseAfterFinish { + buf := make([]byte, 4<<10) // 4 KB should be enough + n := runtime.Stack(buf, false) + tr.finishStack = buf[:n] + } + + activeMu.RLock() + m := activeTraces[tr.Family] + activeMu.RUnlock() + m.Remove(tr) + + f := getFamily(tr.Family, true) + for _, b := range f.Buckets { + if b.Cond.match(tr) { + b.Add(tr) + } + } + // Add a sample of elapsed time as microseconds to the family's timeseries + h := new(histogram) + h.addMeasurement(tr.Elapsed.Nanoseconds() / 1e3) + f.LatencyMu.Lock() + f.Latency.Add(h) + f.LatencyMu.Unlock() + + tr.unref() // matches ref in New +} + +const ( + bucketsPerFamily = 9 + tracesPerBucket = 10 + maxActiveTraces = 20 // Maximum number of active traces to show. + maxEventsPerTrace = 10 + numHistogramBuckets = 38 +) + +var ( + // The active traces. + activeMu sync.RWMutex + activeTraces = make(map[string]*traceSet) // family -> traces + + // Families of completed traces. + completedMu sync.RWMutex + completedTraces = make(map[string]*family) // family -> traces +) + +type traceSet struct { + mu sync.RWMutex + m map[*trace]bool + + // We could avoid the entire map scan in FirstN by having a slice of all the traces + // ordered by start time, and an index into that from the trace struct, with a periodic + // repack of the slice after enough traces finish; we could also use a skip list or similar. + // However, that would shift some of the expense from /debug/requests time to RPC time, + // which is probably the wrong trade-off. +} + +func (ts *traceSet) Len() int { + ts.mu.RLock() + defer ts.mu.RUnlock() + return len(ts.m) +} + +func (ts *traceSet) Add(tr *trace) { + ts.mu.Lock() + if ts.m == nil { + ts.m = make(map[*trace]bool) + } + ts.m[tr] = true + ts.mu.Unlock() +} + +func (ts *traceSet) Remove(tr *trace) { + ts.mu.Lock() + delete(ts.m, tr) + ts.mu.Unlock() +} + +// FirstN returns the first n traces ordered by time. +func (ts *traceSet) FirstN(n int) traceList { + ts.mu.RLock() + defer ts.mu.RUnlock() + + if n > len(ts.m) { + n = len(ts.m) + } + trl := make(traceList, 0, n) + + // Fast path for when no selectivity is needed. + if n == len(ts.m) { + for tr := range ts.m { + tr.ref() + trl = append(trl, tr) + } + sort.Sort(trl) + return trl + } + + // Pick the oldest n traces. + // This is inefficient. See the comment in the traceSet struct. + for tr := range ts.m { + // Put the first n traces into trl in the order they occur. + // When we have n, sort trl, and thereafter maintain its order. + if len(trl) < n { + tr.ref() + trl = append(trl, tr) + if len(trl) == n { + // This is guaranteed to happen exactly once during this loop. + sort.Sort(trl) + } + continue + } + if tr.Start.After(trl[n-1].Start) { + continue + } + + // Find where to insert this one. + tr.ref() + i := sort.Search(n, func(i int) bool { return trl[i].Start.After(tr.Start) }) + trl[n-1].unref() + copy(trl[i+1:], trl[i:]) + trl[i] = tr + } + + return trl +} + +func getActiveTraces(fam string) traceList { + activeMu.RLock() + s := activeTraces[fam] + activeMu.RUnlock() + if s == nil { + return nil + } + return s.FirstN(maxActiveTraces) +} + +func getFamily(fam string, allocNew bool) *family { + completedMu.RLock() + f := completedTraces[fam] + completedMu.RUnlock() + if f == nil && allocNew { + f = allocFamily(fam) + } + return f +} + +func allocFamily(fam string) *family { + completedMu.Lock() + defer completedMu.Unlock() + f := completedTraces[fam] + if f == nil { + f = newFamily() + completedTraces[fam] = f + } + return f +} + +// family represents a set of trace buckets and associated latency information. +type family struct { + // traces may occur in multiple buckets. + Buckets [bucketsPerFamily]*traceBucket + + // latency time series + LatencyMu sync.RWMutex + Latency *timeseries.MinuteHourSeries +} + +func newFamily() *family { + return &family{ + Buckets: [bucketsPerFamily]*traceBucket{ + {Cond: minCond(0)}, + {Cond: minCond(50 * time.Millisecond)}, + {Cond: minCond(100 * time.Millisecond)}, + {Cond: minCond(200 * time.Millisecond)}, + {Cond: minCond(500 * time.Millisecond)}, + {Cond: minCond(1 * time.Second)}, + {Cond: minCond(10 * time.Second)}, + {Cond: minCond(100 * time.Second)}, + {Cond: errorCond{}}, + }, + Latency: timeseries.NewMinuteHourSeries(func() timeseries.Observable { return new(histogram) }), + } +} + +// traceBucket represents a size-capped bucket of historic traces, +// along with a condition for a trace to belong to the bucket. +type traceBucket struct { + Cond cond + + // Ring buffer implementation of a fixed-size FIFO queue. + mu sync.RWMutex + buf [tracesPerBucket]*trace + start int // < tracesPerBucket + length int // <= tracesPerBucket +} + +func (b *traceBucket) Add(tr *trace) { + b.mu.Lock() + defer b.mu.Unlock() + + i := b.start + b.length + if i >= tracesPerBucket { + i -= tracesPerBucket + } + if b.length == tracesPerBucket { + // "Remove" an element from the bucket. + b.buf[i].unref() + b.start++ + if b.start == tracesPerBucket { + b.start = 0 + } + } + b.buf[i] = tr + if b.length < tracesPerBucket { + b.length++ + } + tr.ref() +} + +// Copy returns a copy of the traces in the bucket. +// If tracedOnly is true, only the traces with trace information will be returned. +// The logs will be ref'd before returning; the caller should call +// the Free method when it is done with them. +// TODO(dsymonds): keep track of traced requests in separate buckets. +func (b *traceBucket) Copy(tracedOnly bool) traceList { + b.mu.RLock() + defer b.mu.RUnlock() + + trl := make(traceList, 0, b.length) + for i, x := 0, b.start; i < b.length; i++ { + tr := b.buf[x] + if !tracedOnly || tr.spanID != 0 { + tr.ref() + trl = append(trl, tr) + } + x++ + if x == b.length { + x = 0 + } + } + return trl +} + +func (b *traceBucket) Empty() bool { + b.mu.RLock() + defer b.mu.RUnlock() + return b.length == 0 +} + +// cond represents a condition on a trace. +type cond interface { + match(t *trace) bool + String() string +} + +type minCond time.Duration + +func (m minCond) match(t *trace) bool { return t.Elapsed >= time.Duration(m) } +func (m minCond) String() string { return fmt.Sprintf("≥%gs", time.Duration(m).Seconds()) } + +type errorCond struct{} + +func (e errorCond) match(t *trace) bool { return t.IsError } +func (e errorCond) String() string { return "errors" } + +type traceList []*trace + +// Free calls unref on each element of the list. +func (trl traceList) Free() { + for _, t := range trl { + t.unref() + } +} + +// traceList may be sorted in reverse chronological order. +func (trl traceList) Len() int { return len(trl) } +func (trl traceList) Less(i, j int) bool { return trl[i].Start.After(trl[j].Start) } +func (trl traceList) Swap(i, j int) { trl[i], trl[j] = trl[j], trl[i] } + +// An event is a timestamped log entry in a trace. +type event struct { + When time.Time + Elapsed time.Duration // since previous event in trace + NewDay bool // whether this event is on a different day to the previous event + Recyclable bool // whether this event was passed via LazyLog + What interface{} // string or fmt.Stringer + Sensitive bool // whether this event contains sensitive information +} + +// WhenString returns a string representation of the elapsed time of the event. +// It will include the date if midnight was crossed. +func (e event) WhenString() string { + if e.NewDay { + return e.When.Format("2006/01/02 15:04:05.000000") + } + return e.When.Format("15:04:05.000000") +} + +// discarded represents a number of discarded events. +// It is stored as *discarded to make it easier to update in-place. +type discarded int + +func (d *discarded) String() string { + return fmt.Sprintf("(%d events discarded)", int(*d)) +} + +// trace represents an active or complete request, +// either sent or received by this program. +type trace struct { + // Family is the top-level grouping of traces to which this belongs. + Family string + + // Title is the title of this trace. + Title string + + // Timing information. + Start time.Time + Elapsed time.Duration // zero while active + + // Trace information if non-zero. + traceID uint64 + spanID uint64 + + // Whether this trace resulted in an error. + IsError bool + + // Append-only sequence of events (modulo discards). + mu sync.RWMutex + events []event + + refs int32 // how many buckets this is in + recycler func(interface{}) + disc discarded // scratch space to avoid allocation + + finishStack []byte // where finish was called, if DebugUseAfterFinish is set +} + +func (tr *trace) reset() { + // Clear all but the mutex. Mutexes may not be copied, even when unlocked. + tr.Family = "" + tr.Title = "" + tr.Start = time.Time{} + tr.Elapsed = 0 + tr.traceID = 0 + tr.spanID = 0 + tr.IsError = false + tr.events = nil + tr.refs = 0 + tr.recycler = nil + tr.disc = 0 + tr.finishStack = nil +} + +// delta returns the elapsed time since the last event or the trace start, +// and whether it spans midnight. +// L >= tr.mu +func (tr *trace) delta(t time.Time) (time.Duration, bool) { + if len(tr.events) == 0 { + return t.Sub(tr.Start), false + } + prev := tr.events[len(tr.events)-1].When + return t.Sub(prev), prev.Day() != t.Day() +} + +func (tr *trace) addEvent(x interface{}, recyclable, sensitive bool) { + if DebugUseAfterFinish && tr.finishStack != nil { + buf := make([]byte, 4<<10) // 4 KB should be enough + n := runtime.Stack(buf, false) + log.Printf("net/trace: trace used after finish:\nFinished at:\n%s\nUsed at:\n%s", tr.finishStack, buf[:n]) + } + + /* + NOTE TO DEBUGGERS + + If you are here because your program panicked in this code, + it is almost definitely the fault of code using this package, + and very unlikely to be the fault of this code. + + The most likely scenario is that some code elsewhere is using + a requestz.Trace after its Finish method is called. + You can temporarily set the DebugUseAfterFinish var + to help discover where that is; do not leave that var set, + since it makes this package much less efficient. + */ + + e := event{When: time.Now(), What: x, Recyclable: recyclable, Sensitive: sensitive} + tr.mu.Lock() + e.Elapsed, e.NewDay = tr.delta(e.When) + if len(tr.events) < cap(tr.events) { + tr.events = append(tr.events, e) + } else { + // Discard the middle events. + di := int((cap(tr.events) - 1) / 2) + if d, ok := tr.events[di].What.(*discarded); ok { + (*d)++ + } else { + // disc starts at two to count for the event it is replacing, + // plus the next one that we are about to drop. + tr.disc = 2 + if tr.recycler != nil && tr.events[di].Recyclable { + go tr.recycler(tr.events[di].What) + } + tr.events[di].What = &tr.disc + } + // The timestamp of the discarded meta-event should be + // the time of the last event it is representing. + tr.events[di].When = tr.events[di+1].When + + if tr.recycler != nil && tr.events[di+1].Recyclable { + go tr.recycler(tr.events[di+1].What) + } + copy(tr.events[di+1:], tr.events[di+2:]) + tr.events[cap(tr.events)-1] = e + } + tr.mu.Unlock() +} + +func (tr *trace) LazyLog(x fmt.Stringer, sensitive bool) { + tr.addEvent(x, true, sensitive) +} + +func (tr *trace) LazyPrintf(format string, a ...interface{}) { + tr.addEvent(&lazySprintf{format, a}, false, false) +} + +func (tr *trace) SetError() { tr.IsError = true } + +func (tr *trace) SetRecycler(f func(interface{})) { + tr.recycler = f +} + +func (tr *trace) SetTraceInfo(traceID, spanID uint64) { + tr.traceID, tr.spanID = traceID, spanID +} + +func (tr *trace) SetMaxEvents(m int) { + // Always keep at least three events: first, discarded count, last. + if len(tr.events) == 0 && m > 3 { + tr.events = make([]event, 0, m) + } +} + +func (tr *trace) ref() { + atomic.AddInt32(&tr.refs, 1) +} + +func (tr *trace) unref() { + if atomic.AddInt32(&tr.refs, -1) == 0 { + if tr.recycler != nil { + // freeTrace clears tr, so we hold tr.recycler and tr.events here. + go func(f func(interface{}), es []event) { + for _, e := range es { + if e.Recyclable { + f(e.What) + } + } + }(tr.recycler, tr.events) + } + + freeTrace(tr) + } +} + +func (tr *trace) When() string { + return tr.Start.Format("2006/01/02 15:04:05.000000") +} + +func (tr *trace) ElapsedTime() string { + t := tr.Elapsed + if t == 0 { + // Active trace. + t = time.Since(tr.Start) + } + return fmt.Sprintf("%.6f", t.Seconds()) +} + +func (tr *trace) Events() []event { + tr.mu.RLock() + defer tr.mu.RUnlock() + return tr.events +} + +var traceFreeList = make(chan *trace, 1000) // TODO(dsymonds): Use sync.Pool? + +// newTrace returns a trace ready to use. +func newTrace() *trace { + select { + case tr := <-traceFreeList: + return tr + default: + return new(trace) + } +} + +// freeTrace adds tr to traceFreeList if there's room. +// This is non-blocking. +func freeTrace(tr *trace) { + if DebugUseAfterFinish { + return // never reuse + } + tr.reset() + select { + case traceFreeList <- tr: + default: + } +} + +func elapsed(d time.Duration) string { + b := []byte(fmt.Sprintf("%.6f", d.Seconds())) + + // For subsecond durations, blank all zeros before decimal point, + // and all zeros between the decimal point and the first non-zero digit. + if d < time.Second { + dot := bytes.IndexByte(b, '.') + for i := 0; i < dot; i++ { + b[i] = ' ' + } + for i := dot + 1; i < len(b); i++ { + if b[i] == '0' { + b[i] = ' ' + } else { + break + } + } + } + + return string(b) +} + +var pageTmpl = template.Must(template.New("Page").Funcs(template.FuncMap{ + "elapsed": elapsed, + "add": func(a, b int) int { return a + b }, +}).Parse(pageHTML)) + +const pageHTML = ` +{{template "Prolog" .}} +{{template "StatusTable" .}} +{{template "Epilog" .}} + +{{define "Prolog"}} + + + /debug/requests + + + + +

    /debug/requests

    +{{end}} {{/* end of Prolog */}} + +{{define "StatusTable"}} + + {{range $fam := .Families}} + + + + {{$n := index $.ActiveTraceCount $fam}} + + + {{$f := index $.CompletedTraces $fam}} + {{range $i, $b := $f.Buckets}} + {{$empty := $b.Empty}} + + {{end}} + + {{$nb := len $f.Buckets}} + + + + + + {{end}} +
    {{$fam}} + {{if $n}}{{end}} + [{{$n}} active] + {{if $n}}{{end}} + + {{if not $empty}}{{end}} + [{{.Cond}}] + {{if not $empty}}{{end}} + + [minute] + + [hour] + + [total] +
    +{{end}} {{/* end of StatusTable */}} + +{{define "Epilog"}} +{{if $.Traces}} +
    +

    Family: {{$.Family}}

    + +{{if or $.Expanded $.Traced}} + [Normal/Summary] +{{else}} + [Normal/Summary] +{{end}} + +{{if or (not $.Expanded) $.Traced}} + [Normal/Expanded] +{{else}} + [Normal/Expanded] +{{end}} + +{{if not $.Active}} + {{if or $.Expanded (not $.Traced)}} + [Traced/Summary] + {{else}} + [Traced/Summary] + {{end}} + {{if or (not $.Expanded) (not $.Traced)}} + [Traced/Expanded] + {{else}} + [Traced/Expanded] + {{end}} +{{end}} + +{{if $.Total}} +

    Showing {{len $.Traces}} of {{$.Total}} traces.

    +{{end}} + + + + + {{range $tr := $.Traces}} + + + + + {{/* TODO: include traceID/spanID */}} + + {{if $.Expanded}} + {{range $tr.Events}} + + + + + + {{end}} + {{end}} + {{end}} +
    + {{if $.Active}}Active{{else}}Completed{{end}} Requests +
    WhenElapsed (s)
    {{$tr.When}}{{$tr.ElapsedTime}}{{$tr.Title}}
    {{.WhenString}}{{elapsed .Elapsed}}{{if or $.ShowSensitive (not .Sensitive)}}... {{.What}}{{else}}[redacted]{{end}}
    +{{end}} {{/* if $.Traces */}} + +{{if $.Histogram}} +

    Latency (µs) of {{$.Family}} over {{$.HistogramWindow}}

    +{{$.Histogram}} +{{end}} {{/* if $.Histogram */}} + + + +{{end}} {{/* end of Epilog */}} +` diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/file.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/file.go new file mode 100644 index 00000000..9ba1ca16 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/file.go @@ -0,0 +1,795 @@ +// Copyright 2014 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. + +package webdav + +import ( + "io" + "net/http" + "os" + "path" + "path/filepath" + "strings" + "sync" + "time" + + "golang.org/x/net/webdav/internal/xml" +) + +// slashClean is equivalent to but slightly more efficient than +// path.Clean("/" + name). +func slashClean(name string) string { + if name == "" || name[0] != '/' { + name = "/" + name + } + return path.Clean(name) +} + +// A FileSystem implements access to a collection of named files. The elements +// in a file path are separated by slash ('/', U+002F) characters, regardless +// of host operating system convention. +// +// Each method has the same semantics as the os package's function of the same +// name. +// +// Note that the os.Rename documentation says that "OS-specific restrictions +// might apply". In particular, whether or not renaming a file or directory +// overwriting another existing file or directory is an error is OS-dependent. +type FileSystem interface { + Mkdir(name string, perm os.FileMode) error + OpenFile(name string, flag int, perm os.FileMode) (File, error) + RemoveAll(name string) error + Rename(oldName, newName string) error + Stat(name string) (os.FileInfo, error) +} + +// A File is returned by a FileSystem's OpenFile method and can be served by a +// Handler. +// +// A File may optionally implement the DeadPropsHolder interface, if it can +// load and save dead properties. +type File interface { + http.File + io.Writer +} + +// A Dir implements FileSystem using the native file system restricted to a +// specific directory tree. +// +// While the FileSystem.OpenFile method takes '/'-separated paths, a Dir's +// string value is a filename on the native file system, not a URL, so it is +// separated by filepath.Separator, which isn't necessarily '/'. +// +// An empty Dir is treated as ".". +type Dir string + +func (d Dir) resolve(name string) string { + // This implementation is based on Dir.Open's code in the standard net/http package. + if filepath.Separator != '/' && strings.IndexRune(name, filepath.Separator) >= 0 || + strings.Contains(name, "\x00") { + return "" + } + dir := string(d) + if dir == "" { + dir = "." + } + return filepath.Join(dir, filepath.FromSlash(slashClean(name))) +} + +func (d Dir) Mkdir(name string, perm os.FileMode) error { + if name = d.resolve(name); name == "" { + return os.ErrNotExist + } + return os.Mkdir(name, perm) +} + +func (d Dir) OpenFile(name string, flag int, perm os.FileMode) (File, error) { + if name = d.resolve(name); name == "" { + return nil, os.ErrNotExist + } + f, err := os.OpenFile(name, flag, perm) + if err != nil { + return nil, err + } + return f, nil +} + +func (d Dir) RemoveAll(name string) error { + if name = d.resolve(name); name == "" { + return os.ErrNotExist + } + if name == filepath.Clean(string(d)) { + // Prohibit removing the virtual root directory. + return os.ErrInvalid + } + return os.RemoveAll(name) +} + +func (d Dir) Rename(oldName, newName string) error { + if oldName = d.resolve(oldName); oldName == "" { + return os.ErrNotExist + } + if newName = d.resolve(newName); newName == "" { + return os.ErrNotExist + } + if root := filepath.Clean(string(d)); root == oldName || root == newName { + // Prohibit renaming from or to the virtual root directory. + return os.ErrInvalid + } + return os.Rename(oldName, newName) +} + +func (d Dir) Stat(name string) (os.FileInfo, error) { + if name = d.resolve(name); name == "" { + return nil, os.ErrNotExist + } + return os.Stat(name) +} + +// NewMemFS returns a new in-memory FileSystem implementation. +func NewMemFS() FileSystem { + return &memFS{ + root: memFSNode{ + children: make(map[string]*memFSNode), + mode: 0660 | os.ModeDir, + modTime: time.Now(), + }, + } +} + +// A memFS implements FileSystem, storing all metadata and actual file data +// in-memory. No limits on filesystem size are used, so it is not recommended +// this be used where the clients are untrusted. +// +// Concurrent access is permitted. The tree structure is protected by a mutex, +// and each node's contents and metadata are protected by a per-node mutex. +// +// TODO: Enforce file permissions. +type memFS struct { + mu sync.Mutex + root memFSNode +} + +// TODO: clean up and rationalize the walk/find code. + +// walk walks the directory tree for the fullname, calling f at each step. If f +// returns an error, the walk will be aborted and return that same error. +// +// dir is the directory at that step, frag is the name fragment, and final is +// whether it is the final step. For example, walking "/foo/bar/x" will result +// in 3 calls to f: +// - "/", "foo", false +// - "/foo/", "bar", false +// - "/foo/bar/", "x", true +// The frag argument will be empty only if dir is the root node and the walk +// ends at that root node. +func (fs *memFS) walk(op, fullname string, f func(dir *memFSNode, frag string, final bool) error) error { + original := fullname + fullname = slashClean(fullname) + + // Strip any leading "/"s to make fullname a relative path, as the walk + // starts at fs.root. + if fullname[0] == '/' { + fullname = fullname[1:] + } + dir := &fs.root + + for { + frag, remaining := fullname, "" + i := strings.IndexRune(fullname, '/') + final := i < 0 + if !final { + frag, remaining = fullname[:i], fullname[i+1:] + } + if frag == "" && dir != &fs.root { + panic("webdav: empty path fragment for a clean path") + } + if err := f(dir, frag, final); err != nil { + return &os.PathError{ + Op: op, + Path: original, + Err: err, + } + } + if final { + break + } + child := dir.children[frag] + if child == nil { + return &os.PathError{ + Op: op, + Path: original, + Err: os.ErrNotExist, + } + } + if !child.mode.IsDir() { + return &os.PathError{ + Op: op, + Path: original, + Err: os.ErrInvalid, + } + } + dir, fullname = child, remaining + } + return nil +} + +// find returns the parent of the named node and the relative name fragment +// from the parent to the child. For example, if finding "/foo/bar/baz" then +// parent will be the node for "/foo/bar" and frag will be "baz". +// +// If the fullname names the root node, then parent, frag and err will be zero. +// +// find returns an error if the parent does not already exist or the parent +// isn't a directory, but it will not return an error per se if the child does +// not already exist. The error returned is either nil or an *os.PathError +// whose Op is op. +func (fs *memFS) find(op, fullname string) (parent *memFSNode, frag string, err error) { + err = fs.walk(op, fullname, func(parent0 *memFSNode, frag0 string, final bool) error { + if !final { + return nil + } + if frag0 != "" { + parent, frag = parent0, frag0 + } + return nil + }) + return parent, frag, err +} + +func (fs *memFS) Mkdir(name string, perm os.FileMode) error { + fs.mu.Lock() + defer fs.mu.Unlock() + + dir, frag, err := fs.find("mkdir", name) + if err != nil { + return err + } + if dir == nil { + // We can't create the root. + return os.ErrInvalid + } + if _, ok := dir.children[frag]; ok { + return os.ErrExist + } + dir.children[frag] = &memFSNode{ + children: make(map[string]*memFSNode), + mode: perm.Perm() | os.ModeDir, + modTime: time.Now(), + } + return nil +} + +func (fs *memFS) OpenFile(name string, flag int, perm os.FileMode) (File, error) { + fs.mu.Lock() + defer fs.mu.Unlock() + + dir, frag, err := fs.find("open", name) + if err != nil { + return nil, err + } + var n *memFSNode + if dir == nil { + // We're opening the root. + if flag&(os.O_WRONLY|os.O_RDWR) != 0 { + return nil, os.ErrPermission + } + n, frag = &fs.root, "/" + + } else { + n = dir.children[frag] + if flag&(os.O_SYNC|os.O_APPEND) != 0 { + // memFile doesn't support these flags yet. + return nil, os.ErrInvalid + } + if flag&os.O_CREATE != 0 { + if flag&os.O_EXCL != 0 && n != nil { + return nil, os.ErrExist + } + if n == nil { + n = &memFSNode{ + mode: perm.Perm(), + } + dir.children[frag] = n + } + } + if n == nil { + return nil, os.ErrNotExist + } + if flag&(os.O_WRONLY|os.O_RDWR) != 0 && flag&os.O_TRUNC != 0 { + n.mu.Lock() + n.data = nil + n.mu.Unlock() + } + } + + children := make([]os.FileInfo, 0, len(n.children)) + for cName, c := range n.children { + children = append(children, c.stat(cName)) + } + return &memFile{ + n: n, + nameSnapshot: frag, + childrenSnapshot: children, + }, nil +} + +func (fs *memFS) RemoveAll(name string) error { + fs.mu.Lock() + defer fs.mu.Unlock() + + dir, frag, err := fs.find("remove", name) + if err != nil { + return err + } + if dir == nil { + // We can't remove the root. + return os.ErrInvalid + } + delete(dir.children, frag) + return nil +} + +func (fs *memFS) Rename(oldName, newName string) error { + fs.mu.Lock() + defer fs.mu.Unlock() + + oldName = slashClean(oldName) + newName = slashClean(newName) + if oldName == newName { + return nil + } + if strings.HasPrefix(newName, oldName+"/") { + // We can't rename oldName to be a sub-directory of itself. + return os.ErrInvalid + } + + oDir, oFrag, err := fs.find("rename", oldName) + if err != nil { + return err + } + if oDir == nil { + // We can't rename from the root. + return os.ErrInvalid + } + + nDir, nFrag, err := fs.find("rename", newName) + if err != nil { + return err + } + if nDir == nil { + // We can't rename to the root. + return os.ErrInvalid + } + + oNode, ok := oDir.children[oFrag] + if !ok { + return os.ErrNotExist + } + if oNode.children != nil { + if nNode, ok := nDir.children[nFrag]; ok { + if nNode.children == nil { + return errNotADirectory + } + if len(nNode.children) != 0 { + return errDirectoryNotEmpty + } + } + } + delete(oDir.children, oFrag) + nDir.children[nFrag] = oNode + return nil +} + +func (fs *memFS) Stat(name string) (os.FileInfo, error) { + fs.mu.Lock() + defer fs.mu.Unlock() + + dir, frag, err := fs.find("stat", name) + if err != nil { + return nil, err + } + if dir == nil { + // We're stat'ting the root. + return fs.root.stat("/"), nil + } + if n, ok := dir.children[frag]; ok { + return n.stat(path.Base(name)), nil + } + return nil, os.ErrNotExist +} + +// A memFSNode represents a single entry in the in-memory filesystem and also +// implements os.FileInfo. +type memFSNode struct { + // children is protected by memFS.mu. + children map[string]*memFSNode + + mu sync.Mutex + data []byte + mode os.FileMode + modTime time.Time + deadProps map[xml.Name]Property +} + +func (n *memFSNode) stat(name string) *memFileInfo { + n.mu.Lock() + defer n.mu.Unlock() + return &memFileInfo{ + name: name, + size: int64(len(n.data)), + mode: n.mode, + modTime: n.modTime, + } +} + +func (n *memFSNode) DeadProps() (map[xml.Name]Property, error) { + n.mu.Lock() + defer n.mu.Unlock() + if len(n.deadProps) == 0 { + return nil, nil + } + ret := make(map[xml.Name]Property, len(n.deadProps)) + for k, v := range n.deadProps { + ret[k] = v + } + return ret, nil +} + +func (n *memFSNode) Patch(patches []Proppatch) ([]Propstat, error) { + n.mu.Lock() + defer n.mu.Unlock() + pstat := Propstat{Status: http.StatusOK} + for _, patch := range patches { + for _, p := range patch.Props { + pstat.Props = append(pstat.Props, Property{XMLName: p.XMLName}) + if patch.Remove { + delete(n.deadProps, p.XMLName) + continue + } + if n.deadProps == nil { + n.deadProps = map[xml.Name]Property{} + } + n.deadProps[p.XMLName] = p + } + } + return []Propstat{pstat}, nil +} + +type memFileInfo struct { + name string + size int64 + mode os.FileMode + modTime time.Time +} + +func (f *memFileInfo) Name() string { return f.name } +func (f *memFileInfo) Size() int64 { return f.size } +func (f *memFileInfo) Mode() os.FileMode { return f.mode } +func (f *memFileInfo) ModTime() time.Time { return f.modTime } +func (f *memFileInfo) IsDir() bool { return f.mode.IsDir() } +func (f *memFileInfo) Sys() interface{} { return nil } + +// A memFile is a File implementation for a memFSNode. It is a per-file (not +// per-node) read/write position, and a snapshot of the memFS' tree structure +// (a node's name and children) for that node. +type memFile struct { + n *memFSNode + nameSnapshot string + childrenSnapshot []os.FileInfo + // pos is protected by n.mu. + pos int +} + +// A *memFile implements the optional DeadPropsHolder interface. +var _ DeadPropsHolder = (*memFile)(nil) + +func (f *memFile) DeadProps() (map[xml.Name]Property, error) { return f.n.DeadProps() } +func (f *memFile) Patch(patches []Proppatch) ([]Propstat, error) { return f.n.Patch(patches) } + +func (f *memFile) Close() error { + return nil +} + +func (f *memFile) Read(p []byte) (int, error) { + f.n.mu.Lock() + defer f.n.mu.Unlock() + if f.n.mode.IsDir() { + return 0, os.ErrInvalid + } + if f.pos >= len(f.n.data) { + return 0, io.EOF + } + n := copy(p, f.n.data[f.pos:]) + f.pos += n + return n, nil +} + +func (f *memFile) Readdir(count int) ([]os.FileInfo, error) { + f.n.mu.Lock() + defer f.n.mu.Unlock() + if !f.n.mode.IsDir() { + return nil, os.ErrInvalid + } + old := f.pos + if old >= len(f.childrenSnapshot) { + // The os.File Readdir docs say that at the end of a directory, + // the error is io.EOF if count > 0 and nil if count <= 0. + if count > 0 { + return nil, io.EOF + } + return nil, nil + } + if count > 0 { + f.pos += count + if f.pos > len(f.childrenSnapshot) { + f.pos = len(f.childrenSnapshot) + } + } else { + f.pos = len(f.childrenSnapshot) + old = 0 + } + return f.childrenSnapshot[old:f.pos], nil +} + +func (f *memFile) Seek(offset int64, whence int) (int64, error) { + f.n.mu.Lock() + defer f.n.mu.Unlock() + npos := f.pos + // TODO: How to handle offsets greater than the size of system int? + switch whence { + case os.SEEK_SET: + npos = int(offset) + case os.SEEK_CUR: + npos += int(offset) + case os.SEEK_END: + npos = len(f.n.data) + int(offset) + default: + npos = -1 + } + if npos < 0 { + return 0, os.ErrInvalid + } + f.pos = npos + return int64(f.pos), nil +} + +func (f *memFile) Stat() (os.FileInfo, error) { + return f.n.stat(f.nameSnapshot), nil +} + +func (f *memFile) Write(p []byte) (int, error) { + lenp := len(p) + f.n.mu.Lock() + defer f.n.mu.Unlock() + + if f.n.mode.IsDir() { + return 0, os.ErrInvalid + } + if f.pos < len(f.n.data) { + n := copy(f.n.data[f.pos:], p) + f.pos += n + p = p[n:] + } else if f.pos > len(f.n.data) { + // Write permits the creation of holes, if we've seek'ed past the + // existing end of file. + if f.pos <= cap(f.n.data) { + oldLen := len(f.n.data) + f.n.data = f.n.data[:f.pos] + hole := f.n.data[oldLen:] + for i := range hole { + hole[i] = 0 + } + } else { + d := make([]byte, f.pos, f.pos+len(p)) + copy(d, f.n.data) + f.n.data = d + } + } + + if len(p) > 0 { + // We should only get here if f.pos == len(f.n.data). + f.n.data = append(f.n.data, p...) + f.pos = len(f.n.data) + } + f.n.modTime = time.Now() + return lenp, nil +} + +// moveFiles moves files and/or directories from src to dst. +// +// See section 9.9.4 for when various HTTP status codes apply. +func moveFiles(fs FileSystem, src, dst string, overwrite bool) (status int, err error) { + created := false + if _, err := fs.Stat(dst); err != nil { + if !os.IsNotExist(err) { + return http.StatusForbidden, err + } + created = true + } else if overwrite { + // Section 9.9.3 says that "If a resource exists at the destination + // and the Overwrite header is "T", then prior to performing the move, + // the server must perform a DELETE with "Depth: infinity" on the + // destination resource. + if err := fs.RemoveAll(dst); err != nil { + return http.StatusForbidden, err + } + } else { + return http.StatusPreconditionFailed, os.ErrExist + } + if err := fs.Rename(src, dst); err != nil { + return http.StatusForbidden, err + } + if created { + return http.StatusCreated, nil + } + return http.StatusNoContent, nil +} + +func copyProps(dst, src File) error { + d, ok := dst.(DeadPropsHolder) + if !ok { + return nil + } + s, ok := src.(DeadPropsHolder) + if !ok { + return nil + } + m, err := s.DeadProps() + if err != nil { + return err + } + props := make([]Property, 0, len(m)) + for _, prop := range m { + props = append(props, prop) + } + _, err = d.Patch([]Proppatch{{Props: props}}) + return err +} + +// copyFiles copies files and/or directories from src to dst. +// +// See section 9.8.5 for when various HTTP status codes apply. +func copyFiles(fs FileSystem, src, dst string, overwrite bool, depth int, recursion int) (status int, err error) { + if recursion == 1000 { + return http.StatusInternalServerError, errRecursionTooDeep + } + recursion++ + + // TODO: section 9.8.3 says that "Note that an infinite-depth COPY of /A/ + // into /A/B/ could lead to infinite recursion if not handled correctly." + + srcFile, err := fs.OpenFile(src, os.O_RDONLY, 0) + if err != nil { + if os.IsNotExist(err) { + return http.StatusNotFound, err + } + return http.StatusInternalServerError, err + } + defer srcFile.Close() + srcStat, err := srcFile.Stat() + if err != nil { + if os.IsNotExist(err) { + return http.StatusNotFound, err + } + return http.StatusInternalServerError, err + } + srcPerm := srcStat.Mode() & os.ModePerm + + created := false + if _, err := fs.Stat(dst); err != nil { + if os.IsNotExist(err) { + created = true + } else { + return http.StatusForbidden, err + } + } else { + if !overwrite { + return http.StatusPreconditionFailed, os.ErrExist + } + if err := fs.RemoveAll(dst); err != nil && !os.IsNotExist(err) { + return http.StatusForbidden, err + } + } + + if srcStat.IsDir() { + if err := fs.Mkdir(dst, srcPerm); err != nil { + return http.StatusForbidden, err + } + if depth == infiniteDepth { + children, err := srcFile.Readdir(-1) + if err != nil { + return http.StatusForbidden, err + } + for _, c := range children { + name := c.Name() + s := path.Join(src, name) + d := path.Join(dst, name) + cStatus, cErr := copyFiles(fs, s, d, overwrite, depth, recursion) + if cErr != nil { + // TODO: MultiStatus. + return cStatus, cErr + } + } + } + + } else { + dstFile, err := fs.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, srcPerm) + if err != nil { + if os.IsNotExist(err) { + return http.StatusConflict, err + } + return http.StatusForbidden, err + + } + _, copyErr := io.Copy(dstFile, srcFile) + propsErr := copyProps(dstFile, srcFile) + closeErr := dstFile.Close() + if copyErr != nil { + return http.StatusInternalServerError, copyErr + } + if propsErr != nil { + return http.StatusInternalServerError, propsErr + } + if closeErr != nil { + return http.StatusInternalServerError, closeErr + } + } + + if created { + return http.StatusCreated, nil + } + return http.StatusNoContent, nil +} + +// walkFS traverses filesystem fs starting at name up to depth levels. +// +// Allowed values for depth are 0, 1 or infiniteDepth. For each visited node, +// walkFS calls walkFn. If a visited file system node is a directory and +// walkFn returns filepath.SkipDir, walkFS will skip traversal of this node. +func walkFS(fs FileSystem, depth int, name string, info os.FileInfo, walkFn filepath.WalkFunc) error { + // This implementation is based on Walk's code in the standard path/filepath package. + err := walkFn(name, info, nil) + if err != nil { + if info.IsDir() && err == filepath.SkipDir { + return nil + } + return err + } + if !info.IsDir() || depth == 0 { + return nil + } + if depth == 1 { + depth = 0 + } + + // Read directory names. + f, err := fs.OpenFile(name, os.O_RDONLY, 0) + if err != nil { + return walkFn(name, info, err) + } + fileInfos, err := f.Readdir(0) + f.Close() + if err != nil { + return walkFn(name, info, err) + } + + for _, fileInfo := range fileInfos { + filename := path.Join(name, fileInfo.Name()) + fileInfo, err := fs.Stat(filename) + if err != nil { + if err := walkFn(filename, fileInfo, err); err != nil && err != filepath.SkipDir { + return err + } + } else { + err = walkFS(fs, depth, filename, fileInfo, walkFn) + if err != nil { + if !fileInfo.IsDir() || err != filepath.SkipDir { + return err + } + } + } + } + return nil +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/if.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/if.go new file mode 100644 index 00000000..416e81cd --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/if.go @@ -0,0 +1,173 @@ +// Copyright 2014 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. + +package webdav + +// The If header is covered by Section 10.4. +// http://www.webdav.org/specs/rfc4918.html#HEADER_If + +import ( + "strings" +) + +// ifHeader is a disjunction (OR) of ifLists. +type ifHeader struct { + lists []ifList +} + +// ifList is a conjunction (AND) of Conditions, and an optional resource tag. +type ifList struct { + resourceTag string + conditions []Condition +} + +// parseIfHeader parses the "If: foo bar" HTTP header. The httpHeader string +// should omit the "If:" prefix and have any "\r\n"s collapsed to a " ", as is +// returned by req.Header.Get("If") for a http.Request req. +func parseIfHeader(httpHeader string) (h ifHeader, ok bool) { + s := strings.TrimSpace(httpHeader) + switch tokenType, _, _ := lex(s); tokenType { + case '(': + return parseNoTagLists(s) + case angleTokenType: + return parseTaggedLists(s) + default: + return ifHeader{}, false + } +} + +func parseNoTagLists(s string) (h ifHeader, ok bool) { + for { + l, remaining, ok := parseList(s) + if !ok { + return ifHeader{}, false + } + h.lists = append(h.lists, l) + if remaining == "" { + return h, true + } + s = remaining + } +} + +func parseTaggedLists(s string) (h ifHeader, ok bool) { + resourceTag, n := "", 0 + for first := true; ; first = false { + tokenType, tokenStr, remaining := lex(s) + switch tokenType { + case angleTokenType: + if !first && n == 0 { + return ifHeader{}, false + } + resourceTag, n = tokenStr, 0 + s = remaining + case '(': + n++ + l, remaining, ok := parseList(s) + if !ok { + return ifHeader{}, false + } + l.resourceTag = resourceTag + h.lists = append(h.lists, l) + if remaining == "" { + return h, true + } + s = remaining + default: + return ifHeader{}, false + } + } +} + +func parseList(s string) (l ifList, remaining string, ok bool) { + tokenType, _, s := lex(s) + if tokenType != '(' { + return ifList{}, "", false + } + for { + tokenType, _, remaining = lex(s) + if tokenType == ')' { + if len(l.conditions) == 0 { + return ifList{}, "", false + } + return l, remaining, true + } + c, remaining, ok := parseCondition(s) + if !ok { + return ifList{}, "", false + } + l.conditions = append(l.conditions, c) + s = remaining + } +} + +func parseCondition(s string) (c Condition, remaining string, ok bool) { + tokenType, tokenStr, s := lex(s) + if tokenType == notTokenType { + c.Not = true + tokenType, tokenStr, s = lex(s) + } + switch tokenType { + case strTokenType, angleTokenType: + c.Token = tokenStr + case squareTokenType: + c.ETag = tokenStr + default: + return Condition{}, "", false + } + return c, s, true +} + +// Single-rune tokens like '(' or ')' have a token type equal to their rune. +// All other tokens have a negative token type. +const ( + errTokenType = rune(-1) + eofTokenType = rune(-2) + strTokenType = rune(-3) + notTokenType = rune(-4) + angleTokenType = rune(-5) + squareTokenType = rune(-6) +) + +func lex(s string) (tokenType rune, tokenStr string, remaining string) { + // The net/textproto Reader that parses the HTTP header will collapse + // Linear White Space that spans multiple "\r\n" lines to a single " ", + // so we don't need to look for '\r' or '\n'. + for len(s) > 0 && (s[0] == '\t' || s[0] == ' ') { + s = s[1:] + } + if len(s) == 0 { + return eofTokenType, "", "" + } + i := 0 +loop: + for ; i < len(s); i++ { + switch s[i] { + case '\t', ' ', '(', ')', '<', '>', '[', ']': + break loop + } + } + + if i != 0 { + tokenStr, remaining = s[:i], s[i:] + if tokenStr == "Not" { + return notTokenType, "", remaining + } + return strTokenType, tokenStr, remaining + } + + j := 0 + switch s[0] { + case '<': + j, tokenType = strings.IndexByte(s, '>'), angleTokenType + case '[': + j, tokenType = strings.IndexByte(s, ']'), squareTokenType + default: + return rune(s[0]), "", s[1:] + } + if j < 0 { + return errTokenType, "", "" + } + return tokenType, s[1:j], s[j+1:] +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/README b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/README new file mode 100644 index 00000000..89656f48 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/README @@ -0,0 +1,11 @@ +This is a fork of the encoding/xml package at ca1d6c4, the last commit before +https://go.googlesource.com/go/+/c0d6d33 "encoding/xml: restore Go 1.4 name +space behavior" made late in the lead-up to the Go 1.5 release. + +The list of encoding/xml changes is at +https://go.googlesource.com/go/+log/master/src/encoding/xml + +This fork is temporary, and I (nigeltao) expect to revert it after Go 1.6 is +released. + +See http://golang.org/issue/11841 diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/marshal.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/marshal.go new file mode 100644 index 00000000..3c3b6aca --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/marshal.go @@ -0,0 +1,1223 @@ +// Copyright 2011 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. + +package xml + +import ( + "bufio" + "bytes" + "encoding" + "fmt" + "io" + "reflect" + "strconv" + "strings" +) + +const ( + // A generic XML header suitable for use with the output of Marshal. + // This is not automatically added to any output of this package, + // it is provided as a convenience. + Header = `` + "\n" +) + +// Marshal returns the XML encoding of v. +// +// Marshal handles an array or slice by marshalling each of the elements. +// Marshal handles a pointer by marshalling the value it points at or, if the +// pointer is nil, by writing nothing. Marshal handles an interface value by +// marshalling the value it contains or, if the interface value is nil, by +// writing nothing. Marshal handles all other data by writing one or more XML +// elements containing the data. +// +// The name for the XML elements is taken from, in order of preference: +// - the tag on the XMLName field, if the data is a struct +// - the value of the XMLName field of type xml.Name +// - the tag of the struct field used to obtain the data +// - the name of the struct field used to obtain the data +// - the name of the marshalled type +// +// The XML element for a struct contains marshalled elements for each of the +// exported fields of the struct, with these exceptions: +// - the XMLName field, described above, is omitted. +// - a field with tag "-" is omitted. +// - a field with tag "name,attr" becomes an attribute with +// the given name in the XML element. +// - a field with tag ",attr" becomes an attribute with the +// field name in the XML element. +// - a field with tag ",chardata" is written as character data, +// not as an XML element. +// - a field with tag ",innerxml" is written verbatim, not subject +// to the usual marshalling procedure. +// - a field with tag ",comment" is written as an XML comment, not +// subject to the usual marshalling procedure. It must not contain +// the "--" string within it. +// - a field with a tag including the "omitempty" option is omitted +// if the field value is empty. The empty values are false, 0, any +// nil pointer or interface value, and any array, slice, map, or +// string of length zero. +// - an anonymous struct field is handled as if the fields of its +// value were part of the outer struct. +// +// If a field uses a tag "a>b>c", then the element c will be nested inside +// parent elements a and b. Fields that appear next to each other that name +// the same parent will be enclosed in one XML element. +// +// See MarshalIndent for an example. +// +// Marshal will return an error if asked to marshal a channel, function, or map. +func Marshal(v interface{}) ([]byte, error) { + var b bytes.Buffer + if err := NewEncoder(&b).Encode(v); err != nil { + return nil, err + } + return b.Bytes(), nil +} + +// Marshaler is the interface implemented by objects that can marshal +// themselves into valid XML elements. +// +// MarshalXML encodes the receiver as zero or more XML elements. +// By convention, arrays or slices are typically encoded as a sequence +// of elements, one per entry. +// Using start as the element tag is not required, but doing so +// will enable Unmarshal to match the XML elements to the correct +// struct field. +// One common implementation strategy is to construct a separate +// value with a layout corresponding to the desired XML and then +// to encode it using e.EncodeElement. +// Another common strategy is to use repeated calls to e.EncodeToken +// to generate the XML output one token at a time. +// The sequence of encoded tokens must make up zero or more valid +// XML elements. +type Marshaler interface { + MarshalXML(e *Encoder, start StartElement) error +} + +// MarshalerAttr is the interface implemented by objects that can marshal +// themselves into valid XML attributes. +// +// MarshalXMLAttr returns an XML attribute with the encoded value of the receiver. +// Using name as the attribute name is not required, but doing so +// will enable Unmarshal to match the attribute to the correct +// struct field. +// If MarshalXMLAttr returns the zero attribute Attr{}, no attribute +// will be generated in the output. +// MarshalXMLAttr is used only for struct fields with the +// "attr" option in the field tag. +type MarshalerAttr interface { + MarshalXMLAttr(name Name) (Attr, error) +} + +// MarshalIndent works like Marshal, but each XML element begins on a new +// indented line that starts with prefix and is followed by one or more +// copies of indent according to the nesting depth. +func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { + var b bytes.Buffer + enc := NewEncoder(&b) + enc.Indent(prefix, indent) + if err := enc.Encode(v); err != nil { + return nil, err + } + return b.Bytes(), nil +} + +// An Encoder writes XML data to an output stream. +type Encoder struct { + p printer +} + +// NewEncoder returns a new encoder that writes to w. +func NewEncoder(w io.Writer) *Encoder { + e := &Encoder{printer{Writer: bufio.NewWriter(w)}} + e.p.encoder = e + return e +} + +// Indent sets the encoder to generate XML in which each element +// begins on a new indented line that starts with prefix and is followed by +// one or more copies of indent according to the nesting depth. +func (enc *Encoder) Indent(prefix, indent string) { + enc.p.prefix = prefix + enc.p.indent = indent +} + +// Encode writes the XML encoding of v to the stream. +// +// See the documentation for Marshal for details about the conversion +// of Go values to XML. +// +// Encode calls Flush before returning. +func (enc *Encoder) Encode(v interface{}) error { + err := enc.p.marshalValue(reflect.ValueOf(v), nil, nil) + if err != nil { + return err + } + return enc.p.Flush() +} + +// EncodeElement writes the XML encoding of v to the stream, +// using start as the outermost tag in the encoding. +// +// See the documentation for Marshal for details about the conversion +// of Go values to XML. +// +// EncodeElement calls Flush before returning. +func (enc *Encoder) EncodeElement(v interface{}, start StartElement) error { + err := enc.p.marshalValue(reflect.ValueOf(v), nil, &start) + if err != nil { + return err + } + return enc.p.Flush() +} + +var ( + begComment = []byte("") + endProcInst = []byte("?>") + endDirective = []byte(">") +) + +// EncodeToken writes the given XML token to the stream. +// It returns an error if StartElement and EndElement tokens are not +// properly matched. +// +// EncodeToken does not call Flush, because usually it is part of a +// larger operation such as Encode or EncodeElement (or a custom +// Marshaler's MarshalXML invoked during those), and those will call +// Flush when finished. Callers that create an Encoder and then invoke +// EncodeToken directly, without using Encode or EncodeElement, need to +// call Flush when finished to ensure that the XML is written to the +// underlying writer. +// +// EncodeToken allows writing a ProcInst with Target set to "xml" only +// as the first token in the stream. +// +// When encoding a StartElement holding an XML namespace prefix +// declaration for a prefix that is not already declared, contained +// elements (including the StartElement itself) will use the declared +// prefix when encoding names with matching namespace URIs. +func (enc *Encoder) EncodeToken(t Token) error { + + p := &enc.p + switch t := t.(type) { + case StartElement: + if err := p.writeStart(&t); err != nil { + return err + } + case EndElement: + if err := p.writeEnd(t.Name); err != nil { + return err + } + case CharData: + escapeText(p, t, false) + case Comment: + if bytes.Contains(t, endComment) { + return fmt.Errorf("xml: EncodeToken of Comment containing --> marker") + } + p.WriteString("") + return p.cachedWriteError() + case ProcInst: + // First token to be encoded which is also a ProcInst with target of xml + // is the xml declaration. The only ProcInst where target of xml is allowed. + if t.Target == "xml" && p.Buffered() != 0 { + return fmt.Errorf("xml: EncodeToken of ProcInst xml target only valid for xml declaration, first token encoded") + } + if !isNameString(t.Target) { + return fmt.Errorf("xml: EncodeToken of ProcInst with invalid Target") + } + if bytes.Contains(t.Inst, endProcInst) { + return fmt.Errorf("xml: EncodeToken of ProcInst containing ?> marker") + } + p.WriteString(" 0 { + p.WriteByte(' ') + p.Write(t.Inst) + } + p.WriteString("?>") + case Directive: + if !isValidDirective(t) { + return fmt.Errorf("xml: EncodeToken of Directive containing wrong < or > markers") + } + p.WriteString("") + default: + return fmt.Errorf("xml: EncodeToken of invalid token type") + + } + return p.cachedWriteError() +} + +// isValidDirective reports whether dir is a valid directive text, +// meaning angle brackets are matched, ignoring comments and strings. +func isValidDirective(dir Directive) bool { + var ( + depth int + inquote uint8 + incomment bool + ) + for i, c := range dir { + switch { + case incomment: + if c == '>' { + if n := 1 + i - len(endComment); n >= 0 && bytes.Equal(dir[n:i+1], endComment) { + incomment = false + } + } + // Just ignore anything in comment + case inquote != 0: + if c == inquote { + inquote = 0 + } + // Just ignore anything within quotes + case c == '\'' || c == '"': + inquote = c + case c == '<': + if i+len(begComment) < len(dir) && bytes.Equal(dir[i:i+len(begComment)], begComment) { + incomment = true + } else { + depth++ + } + case c == '>': + if depth == 0 { + return false + } + depth-- + } + } + return depth == 0 && inquote == 0 && !incomment +} + +// Flush flushes any buffered XML to the underlying writer. +// See the EncodeToken documentation for details about when it is necessary. +func (enc *Encoder) Flush() error { + return enc.p.Flush() +} + +type printer struct { + *bufio.Writer + encoder *Encoder + seq int + indent string + prefix string + depth int + indentedIn bool + putNewline bool + defaultNS string + attrNS map[string]string // map prefix -> name space + attrPrefix map[string]string // map name space -> prefix + prefixes []printerPrefix + tags []Name +} + +// printerPrefix holds a namespace undo record. +// When an element is popped, the prefix record +// is set back to the recorded URL. The empty +// prefix records the URL for the default name space. +// +// The start of an element is recorded with an element +// that has mark=true. +type printerPrefix struct { + prefix string + url string + mark bool +} + +func (p *printer) prefixForNS(url string, isAttr bool) string { + // The "http://www.w3.org/XML/1998/namespace" name space is predefined as "xml" + // and must be referred to that way. + // (The "http://www.w3.org/2000/xmlns/" name space is also predefined as "xmlns", + // but users should not be trying to use that one directly - that's our job.) + if url == xmlURL { + return "xml" + } + if !isAttr && url == p.defaultNS { + // We can use the default name space. + return "" + } + return p.attrPrefix[url] +} + +// defineNS pushes any namespace definition found in the given attribute. +// If ignoreNonEmptyDefault is true, an xmlns="nonempty" +// attribute will be ignored. +func (p *printer) defineNS(attr Attr, ignoreNonEmptyDefault bool) error { + var prefix string + if attr.Name.Local == "xmlns" { + if attr.Name.Space != "" && attr.Name.Space != "xml" && attr.Name.Space != xmlURL { + return fmt.Errorf("xml: cannot redefine xmlns attribute prefix") + } + } else if attr.Name.Space == "xmlns" && attr.Name.Local != "" { + prefix = attr.Name.Local + if attr.Value == "" { + // Technically, an empty XML namespace is allowed for an attribute. + // From http://www.w3.org/TR/xml-names11/#scoping-defaulting: + // + // The attribute value in a namespace declaration for a prefix may be + // empty. This has the effect, within the scope of the declaration, of removing + // any association of the prefix with a namespace name. + // + // However our namespace prefixes here are used only as hints. There's + // no need to respect the removal of a namespace prefix, so we ignore it. + return nil + } + } else { + // Ignore: it's not a namespace definition + return nil + } + if prefix == "" { + if attr.Value == p.defaultNS { + // No need for redefinition. + return nil + } + if attr.Value != "" && ignoreNonEmptyDefault { + // We have an xmlns="..." value but + // it can't define a name space in this context, + // probably because the element has an empty + // name space. In this case, we just ignore + // the name space declaration. + return nil + } + } else if _, ok := p.attrPrefix[attr.Value]; ok { + // There's already a prefix for the given name space, + // so use that. This prevents us from + // having two prefixes for the same name space + // so attrNS and attrPrefix can remain bijective. + return nil + } + p.pushPrefix(prefix, attr.Value) + return nil +} + +// createNSPrefix creates a name space prefix attribute +// to use for the given name space, defining a new prefix +// if necessary. +// If isAttr is true, the prefix is to be created for an attribute +// prefix, which means that the default name space cannot +// be used. +func (p *printer) createNSPrefix(url string, isAttr bool) { + if _, ok := p.attrPrefix[url]; ok { + // We already have a prefix for the given URL. + return + } + switch { + case !isAttr && url == p.defaultNS: + // We can use the default name space. + return + case url == "": + // The only way we can encode names in the empty + // name space is by using the default name space, + // so we must use that. + if p.defaultNS != "" { + // The default namespace is non-empty, so we + // need to set it to empty. + p.pushPrefix("", "") + } + return + case url == xmlURL: + return + } + // TODO If the URL is an existing prefix, we could + // use it as is. That would enable the + // marshaling of elements that had been unmarshaled + // and with a name space prefix that was not found. + // although technically it would be incorrect. + + // Pick a name. We try to use the final element of the path + // but fall back to _. + prefix := strings.TrimRight(url, "/") + if i := strings.LastIndex(prefix, "/"); i >= 0 { + prefix = prefix[i+1:] + } + if prefix == "" || !isName([]byte(prefix)) || strings.Contains(prefix, ":") { + prefix = "_" + } + if strings.HasPrefix(prefix, "xml") { + // xmlanything is reserved. + prefix = "_" + prefix + } + if p.attrNS[prefix] != "" { + // Name is taken. Find a better one. + for p.seq++; ; p.seq++ { + if id := prefix + "_" + strconv.Itoa(p.seq); p.attrNS[id] == "" { + prefix = id + break + } + } + } + + p.pushPrefix(prefix, url) +} + +// writeNamespaces writes xmlns attributes for all the +// namespace prefixes that have been defined in +// the current element. +func (p *printer) writeNamespaces() { + for i := len(p.prefixes) - 1; i >= 0; i-- { + prefix := p.prefixes[i] + if prefix.mark { + return + } + p.WriteString(" ") + if prefix.prefix == "" { + // Default name space. + p.WriteString(`xmlns="`) + } else { + p.WriteString("xmlns:") + p.WriteString(prefix.prefix) + p.WriteString(`="`) + } + EscapeText(p, []byte(p.nsForPrefix(prefix.prefix))) + p.WriteString(`"`) + } +} + +// pushPrefix pushes a new prefix on the prefix stack +// without checking to see if it is already defined. +func (p *printer) pushPrefix(prefix, url string) { + p.prefixes = append(p.prefixes, printerPrefix{ + prefix: prefix, + url: p.nsForPrefix(prefix), + }) + p.setAttrPrefix(prefix, url) +} + +// nsForPrefix returns the name space for the given +// prefix. Note that this is not valid for the +// empty attribute prefix, which always has an empty +// name space. +func (p *printer) nsForPrefix(prefix string) string { + if prefix == "" { + return p.defaultNS + } + return p.attrNS[prefix] +} + +// markPrefix marks the start of an element on the prefix +// stack. +func (p *printer) markPrefix() { + p.prefixes = append(p.prefixes, printerPrefix{ + mark: true, + }) +} + +// popPrefix pops all defined prefixes for the current +// element. +func (p *printer) popPrefix() { + for len(p.prefixes) > 0 { + prefix := p.prefixes[len(p.prefixes)-1] + p.prefixes = p.prefixes[:len(p.prefixes)-1] + if prefix.mark { + break + } + p.setAttrPrefix(prefix.prefix, prefix.url) + } +} + +// setAttrPrefix sets an attribute name space prefix. +// If url is empty, the attribute is removed. +// If prefix is empty, the default name space is set. +func (p *printer) setAttrPrefix(prefix, url string) { + if prefix == "" { + p.defaultNS = url + return + } + if url == "" { + delete(p.attrPrefix, p.attrNS[prefix]) + delete(p.attrNS, prefix) + return + } + if p.attrPrefix == nil { + // Need to define a new name space. + p.attrPrefix = make(map[string]string) + p.attrNS = make(map[string]string) + } + // Remove any old prefix value. This is OK because we maintain a + // strict one-to-one mapping between prefix and URL (see + // defineNS) + delete(p.attrPrefix, p.attrNS[prefix]) + p.attrPrefix[url] = prefix + p.attrNS[prefix] = url +} + +var ( + marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem() + marshalerAttrType = reflect.TypeOf((*MarshalerAttr)(nil)).Elem() + textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() +) + +// marshalValue writes one or more XML elements representing val. +// If val was obtained from a struct field, finfo must have its details. +func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplate *StartElement) error { + if startTemplate != nil && startTemplate.Name.Local == "" { + return fmt.Errorf("xml: EncodeElement of StartElement with missing name") + } + + if !val.IsValid() { + return nil + } + if finfo != nil && finfo.flags&fOmitEmpty != 0 && isEmptyValue(val) { + return nil + } + + // Drill into interfaces and pointers. + // This can turn into an infinite loop given a cyclic chain, + // but it matches the Go 1 behavior. + for val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { + if val.IsNil() { + return nil + } + val = val.Elem() + } + + kind := val.Kind() + typ := val.Type() + + // Check for marshaler. + if val.CanInterface() && typ.Implements(marshalerType) { + return p.marshalInterface(val.Interface().(Marshaler), p.defaultStart(typ, finfo, startTemplate)) + } + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(marshalerType) { + return p.marshalInterface(pv.Interface().(Marshaler), p.defaultStart(pv.Type(), finfo, startTemplate)) + } + } + + // Check for text marshaler. + if val.CanInterface() && typ.Implements(textMarshalerType) { + return p.marshalTextInterface(val.Interface().(encoding.TextMarshaler), p.defaultStart(typ, finfo, startTemplate)) + } + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { + return p.marshalTextInterface(pv.Interface().(encoding.TextMarshaler), p.defaultStart(pv.Type(), finfo, startTemplate)) + } + } + + // Slices and arrays iterate over the elements. They do not have an enclosing tag. + if (kind == reflect.Slice || kind == reflect.Array) && typ.Elem().Kind() != reflect.Uint8 { + for i, n := 0, val.Len(); i < n; i++ { + if err := p.marshalValue(val.Index(i), finfo, startTemplate); err != nil { + return err + } + } + return nil + } + + tinfo, err := getTypeInfo(typ) + if err != nil { + return err + } + + // Create start element. + // Precedence for the XML element name is: + // 0. startTemplate + // 1. XMLName field in underlying struct; + // 2. field name/tag in the struct field; and + // 3. type name + var start StartElement + + // explicitNS records whether the element's name space has been + // explicitly set (for example an XMLName field). + explicitNS := false + + if startTemplate != nil { + start.Name = startTemplate.Name + explicitNS = true + start.Attr = append(start.Attr, startTemplate.Attr...) + } else if tinfo.xmlname != nil { + xmlname := tinfo.xmlname + if xmlname.name != "" { + start.Name.Space, start.Name.Local = xmlname.xmlns, xmlname.name + } else if v, ok := xmlname.value(val).Interface().(Name); ok && v.Local != "" { + start.Name = v + } + explicitNS = true + } + if start.Name.Local == "" && finfo != nil { + start.Name.Local = finfo.name + if finfo.xmlns != "" { + start.Name.Space = finfo.xmlns + explicitNS = true + } + } + if start.Name.Local == "" { + name := typ.Name() + if name == "" { + return &UnsupportedTypeError{typ} + } + start.Name.Local = name + } + + // defaultNS records the default name space as set by a xmlns="..." + // attribute. We don't set p.defaultNS because we want to let + // the attribute writing code (in p.defineNS) be solely responsible + // for maintaining that. + defaultNS := p.defaultNS + + // Attributes + for i := range tinfo.fields { + finfo := &tinfo.fields[i] + if finfo.flags&fAttr == 0 { + continue + } + attr, err := p.fieldAttr(finfo, val) + if err != nil { + return err + } + if attr.Name.Local == "" { + continue + } + start.Attr = append(start.Attr, attr) + if attr.Name.Space == "" && attr.Name.Local == "xmlns" { + defaultNS = attr.Value + } + } + if !explicitNS { + // Historic behavior: elements use the default name space + // they are contained in by default. + start.Name.Space = defaultNS + } + // Historic behaviour: an element that's in a namespace sets + // the default namespace for all elements contained within it. + start.setDefaultNamespace() + + if err := p.writeStart(&start); err != nil { + return err + } + + if val.Kind() == reflect.Struct { + err = p.marshalStruct(tinfo, val) + } else { + s, b, err1 := p.marshalSimple(typ, val) + if err1 != nil { + err = err1 + } else if b != nil { + EscapeText(p, b) + } else { + p.EscapeString(s) + } + } + if err != nil { + return err + } + + if err := p.writeEnd(start.Name); err != nil { + return err + } + + return p.cachedWriteError() +} + +// fieldAttr returns the attribute of the given field. +// If the returned attribute has an empty Name.Local, +// it should not be used. +// The given value holds the value containing the field. +func (p *printer) fieldAttr(finfo *fieldInfo, val reflect.Value) (Attr, error) { + fv := finfo.value(val) + name := Name{Space: finfo.xmlns, Local: finfo.name} + if finfo.flags&fOmitEmpty != 0 && isEmptyValue(fv) { + return Attr{}, nil + } + if fv.Kind() == reflect.Interface && fv.IsNil() { + return Attr{}, nil + } + if fv.CanInterface() && fv.Type().Implements(marshalerAttrType) { + attr, err := fv.Interface().(MarshalerAttr).MarshalXMLAttr(name) + return attr, err + } + if fv.CanAddr() { + pv := fv.Addr() + if pv.CanInterface() && pv.Type().Implements(marshalerAttrType) { + attr, err := pv.Interface().(MarshalerAttr).MarshalXMLAttr(name) + return attr, err + } + } + if fv.CanInterface() && fv.Type().Implements(textMarshalerType) { + text, err := fv.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return Attr{}, err + } + return Attr{name, string(text)}, nil + } + if fv.CanAddr() { + pv := fv.Addr() + if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { + text, err := pv.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return Attr{}, err + } + return Attr{name, string(text)}, nil + } + } + // Dereference or skip nil pointer, interface values. + switch fv.Kind() { + case reflect.Ptr, reflect.Interface: + if fv.IsNil() { + return Attr{}, nil + } + fv = fv.Elem() + } + s, b, err := p.marshalSimple(fv.Type(), fv) + if err != nil { + return Attr{}, err + } + if b != nil { + s = string(b) + } + return Attr{name, s}, nil +} + +// defaultStart returns the default start element to use, +// given the reflect type, field info, and start template. +func (p *printer) defaultStart(typ reflect.Type, finfo *fieldInfo, startTemplate *StartElement) StartElement { + var start StartElement + // Precedence for the XML element name is as above, + // except that we do not look inside structs for the first field. + if startTemplate != nil { + start.Name = startTemplate.Name + start.Attr = append(start.Attr, startTemplate.Attr...) + } else if finfo != nil && finfo.name != "" { + start.Name.Local = finfo.name + start.Name.Space = finfo.xmlns + } else if typ.Name() != "" { + start.Name.Local = typ.Name() + } else { + // Must be a pointer to a named type, + // since it has the Marshaler methods. + start.Name.Local = typ.Elem().Name() + } + // Historic behaviour: elements use the name space of + // the element they are contained in by default. + if start.Name.Space == "" { + start.Name.Space = p.defaultNS + } + start.setDefaultNamespace() + return start +} + +// marshalInterface marshals a Marshaler interface value. +func (p *printer) marshalInterface(val Marshaler, start StartElement) error { + // Push a marker onto the tag stack so that MarshalXML + // cannot close the XML tags that it did not open. + p.tags = append(p.tags, Name{}) + n := len(p.tags) + + err := val.MarshalXML(p.encoder, start) + if err != nil { + return err + } + + // Make sure MarshalXML closed all its tags. p.tags[n-1] is the mark. + if len(p.tags) > n { + return fmt.Errorf("xml: %s.MarshalXML wrote invalid XML: <%s> not closed", receiverType(val), p.tags[len(p.tags)-1].Local) + } + p.tags = p.tags[:n-1] + return nil +} + +// marshalTextInterface marshals a TextMarshaler interface value. +func (p *printer) marshalTextInterface(val encoding.TextMarshaler, start StartElement) error { + if err := p.writeStart(&start); err != nil { + return err + } + text, err := val.MarshalText() + if err != nil { + return err + } + EscapeText(p, text) + return p.writeEnd(start.Name) +} + +// writeStart writes the given start element. +func (p *printer) writeStart(start *StartElement) error { + if start.Name.Local == "" { + return fmt.Errorf("xml: start tag with no name") + } + + p.tags = append(p.tags, start.Name) + p.markPrefix() + // Define any name spaces explicitly declared in the attributes. + // We do this as a separate pass so that explicitly declared prefixes + // will take precedence over implicitly declared prefixes + // regardless of the order of the attributes. + ignoreNonEmptyDefault := start.Name.Space == "" + for _, attr := range start.Attr { + if err := p.defineNS(attr, ignoreNonEmptyDefault); err != nil { + return err + } + } + // Define any new name spaces implied by the attributes. + for _, attr := range start.Attr { + name := attr.Name + // From http://www.w3.org/TR/xml-names11/#defaulting + // "Default namespace declarations do not apply directly + // to attribute names; the interpretation of unprefixed + // attributes is determined by the element on which they + // appear." + // This means we don't need to create a new namespace + // when an attribute name space is empty. + if name.Space != "" && !name.isNamespace() { + p.createNSPrefix(name.Space, true) + } + } + p.createNSPrefix(start.Name.Space, false) + + p.writeIndent(1) + p.WriteByte('<') + p.writeName(start.Name, false) + p.writeNamespaces() + for _, attr := range start.Attr { + name := attr.Name + if name.Local == "" || name.isNamespace() { + // Namespaces have already been written by writeNamespaces above. + continue + } + p.WriteByte(' ') + p.writeName(name, true) + p.WriteString(`="`) + p.EscapeString(attr.Value) + p.WriteByte('"') + } + p.WriteByte('>') + return nil +} + +// writeName writes the given name. It assumes +// that p.createNSPrefix(name) has already been called. +func (p *printer) writeName(name Name, isAttr bool) { + if prefix := p.prefixForNS(name.Space, isAttr); prefix != "" { + p.WriteString(prefix) + p.WriteByte(':') + } + p.WriteString(name.Local) +} + +func (p *printer) writeEnd(name Name) error { + if name.Local == "" { + return fmt.Errorf("xml: end tag with no name") + } + if len(p.tags) == 0 || p.tags[len(p.tags)-1].Local == "" { + return fmt.Errorf("xml: end tag without start tag", name.Local) + } + if top := p.tags[len(p.tags)-1]; top != name { + if top.Local != name.Local { + return fmt.Errorf("xml: end tag does not match start tag <%s>", name.Local, top.Local) + } + return fmt.Errorf("xml: end tag in namespace %s does not match start tag <%s> in namespace %s", name.Local, name.Space, top.Local, top.Space) + } + p.tags = p.tags[:len(p.tags)-1] + + p.writeIndent(-1) + p.WriteByte('<') + p.WriteByte('/') + p.writeName(name, false) + p.WriteByte('>') + p.popPrefix() + return nil +} + +func (p *printer) marshalSimple(typ reflect.Type, val reflect.Value) (string, []byte, error) { + switch val.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return strconv.FormatInt(val.Int(), 10), nil, nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return strconv.FormatUint(val.Uint(), 10), nil, nil + case reflect.Float32, reflect.Float64: + return strconv.FormatFloat(val.Float(), 'g', -1, val.Type().Bits()), nil, nil + case reflect.String: + return val.String(), nil, nil + case reflect.Bool: + return strconv.FormatBool(val.Bool()), nil, nil + case reflect.Array: + if typ.Elem().Kind() != reflect.Uint8 { + break + } + // [...]byte + var bytes []byte + if val.CanAddr() { + bytes = val.Slice(0, val.Len()).Bytes() + } else { + bytes = make([]byte, val.Len()) + reflect.Copy(reflect.ValueOf(bytes), val) + } + return "", bytes, nil + case reflect.Slice: + if typ.Elem().Kind() != reflect.Uint8 { + break + } + // []byte + return "", val.Bytes(), nil + } + return "", nil, &UnsupportedTypeError{typ} +} + +var ddBytes = []byte("--") + +func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { + s := parentStack{p: p} + for i := range tinfo.fields { + finfo := &tinfo.fields[i] + if finfo.flags&fAttr != 0 { + continue + } + vf := finfo.value(val) + + // Dereference or skip nil pointer, interface values. + switch vf.Kind() { + case reflect.Ptr, reflect.Interface: + if !vf.IsNil() { + vf = vf.Elem() + } + } + + switch finfo.flags & fMode { + case fCharData: + if err := s.setParents(&noField, reflect.Value{}); err != nil { + return err + } + if vf.CanInterface() && vf.Type().Implements(textMarshalerType) { + data, err := vf.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return err + } + Escape(p, data) + continue + } + if vf.CanAddr() { + pv := vf.Addr() + if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { + data, err := pv.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return err + } + Escape(p, data) + continue + } + } + var scratch [64]byte + switch vf.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + Escape(p, strconv.AppendInt(scratch[:0], vf.Int(), 10)) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + Escape(p, strconv.AppendUint(scratch[:0], vf.Uint(), 10)) + case reflect.Float32, reflect.Float64: + Escape(p, strconv.AppendFloat(scratch[:0], vf.Float(), 'g', -1, vf.Type().Bits())) + case reflect.Bool: + Escape(p, strconv.AppendBool(scratch[:0], vf.Bool())) + case reflect.String: + if err := EscapeText(p, []byte(vf.String())); err != nil { + return err + } + case reflect.Slice: + if elem, ok := vf.Interface().([]byte); ok { + if err := EscapeText(p, elem); err != nil { + return err + } + } + } + continue + + case fComment: + if err := s.setParents(&noField, reflect.Value{}); err != nil { + return err + } + k := vf.Kind() + if !(k == reflect.String || k == reflect.Slice && vf.Type().Elem().Kind() == reflect.Uint8) { + return fmt.Errorf("xml: bad type for comment field of %s", val.Type()) + } + if vf.Len() == 0 { + continue + } + p.writeIndent(0) + p.WriteString("" is invalid grammar. Make it "- -->" + p.WriteByte(' ') + } + p.WriteString("-->") + continue + + case fInnerXml: + iface := vf.Interface() + switch raw := iface.(type) { + case []byte: + p.Write(raw) + continue + case string: + p.WriteString(raw) + continue + } + + case fElement, fElement | fAny: + if err := s.setParents(finfo, vf); err != nil { + return err + } + } + if err := p.marshalValue(vf, finfo, nil); err != nil { + return err + } + } + if err := s.setParents(&noField, reflect.Value{}); err != nil { + return err + } + return p.cachedWriteError() +} + +var noField fieldInfo + +// return the bufio Writer's cached write error +func (p *printer) cachedWriteError() error { + _, err := p.Write(nil) + return err +} + +func (p *printer) writeIndent(depthDelta int) { + if len(p.prefix) == 0 && len(p.indent) == 0 { + return + } + if depthDelta < 0 { + p.depth-- + if p.indentedIn { + p.indentedIn = false + return + } + p.indentedIn = false + } + if p.putNewline { + p.WriteByte('\n') + } else { + p.putNewline = true + } + if len(p.prefix) > 0 { + p.WriteString(p.prefix) + } + if len(p.indent) > 0 { + for i := 0; i < p.depth; i++ { + p.WriteString(p.indent) + } + } + if depthDelta > 0 { + p.depth++ + p.indentedIn = true + } +} + +type parentStack struct { + p *printer + xmlns string + parents []string +} + +// setParents sets the stack of current parents to those found in finfo. +// It only writes the start elements if vf holds a non-nil value. +// If finfo is &noField, it pops all elements. +func (s *parentStack) setParents(finfo *fieldInfo, vf reflect.Value) error { + xmlns := s.p.defaultNS + if finfo.xmlns != "" { + xmlns = finfo.xmlns + } + commonParents := 0 + if xmlns == s.xmlns { + for ; commonParents < len(finfo.parents) && commonParents < len(s.parents); commonParents++ { + if finfo.parents[commonParents] != s.parents[commonParents] { + break + } + } + } + // Pop off any parents that aren't in common with the previous field. + for i := len(s.parents) - 1; i >= commonParents; i-- { + if err := s.p.writeEnd(Name{ + Space: s.xmlns, + Local: s.parents[i], + }); err != nil { + return err + } + } + s.parents = finfo.parents + s.xmlns = xmlns + if commonParents >= len(s.parents) { + // No new elements to push. + return nil + } + if (vf.Kind() == reflect.Ptr || vf.Kind() == reflect.Interface) && vf.IsNil() { + // The element is nil, so no need for the start elements. + s.parents = s.parents[:commonParents] + return nil + } + // Push any new parents required. + for _, name := range s.parents[commonParents:] { + start := &StartElement{ + Name: Name{ + Space: s.xmlns, + Local: name, + }, + } + // Set the default name space for parent elements + // to match what we do with other elements. + if s.xmlns != s.p.defaultNS { + start.setDefaultNamespace() + } + if err := s.p.writeStart(start); err != nil { + return err + } + } + return nil +} + +// A MarshalXMLError is returned when Marshal encounters a type +// that cannot be converted into XML. +type UnsupportedTypeError struct { + Type reflect.Type +} + +func (e *UnsupportedTypeError) Error() string { + return "xml: unsupported type: " + e.Type.String() +} + +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + return false +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/read.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/read.go new file mode 100644 index 00000000..75b9f2ba --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/read.go @@ -0,0 +1,692 @@ +// Copyright 2009 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. + +package xml + +import ( + "bytes" + "encoding" + "errors" + "fmt" + "reflect" + "strconv" + "strings" +) + +// BUG(rsc): Mapping between XML elements and data structures is inherently flawed: +// an XML element is an order-dependent collection of anonymous +// values, while a data structure is an order-independent collection +// of named values. +// See package json for a textual representation more suitable +// to data structures. + +// Unmarshal parses the XML-encoded data and stores the result in +// the value pointed to by v, which must be an arbitrary struct, +// slice, or string. Well-formed data that does not fit into v is +// discarded. +// +// Because Unmarshal uses the reflect package, it can only assign +// to exported (upper case) fields. Unmarshal uses a case-sensitive +// comparison to match XML element names to tag values and struct +// field names. +// +// Unmarshal maps an XML element to a struct using the following rules. +// In the rules, the tag of a field refers to the value associated with the +// key 'xml' in the struct field's tag (see the example above). +// +// * If the struct has a field of type []byte or string with tag +// ",innerxml", Unmarshal accumulates the raw XML nested inside the +// element in that field. The rest of the rules still apply. +// +// * If the struct has a field named XMLName of type xml.Name, +// Unmarshal records the element name in that field. +// +// * If the XMLName field has an associated tag of the form +// "name" or "namespace-URL name", the XML element must have +// the given name (and, optionally, name space) or else Unmarshal +// returns an error. +// +// * If the XML element has an attribute whose name matches a +// struct field name with an associated tag containing ",attr" or +// the explicit name in a struct field tag of the form "name,attr", +// Unmarshal records the attribute value in that field. +// +// * If the XML element contains character data, that data is +// accumulated in the first struct field that has tag ",chardata". +// The struct field may have type []byte or string. +// If there is no such field, the character data is discarded. +// +// * If the XML element contains comments, they are accumulated in +// the first struct field that has tag ",comment". The struct +// field may have type []byte or string. If there is no such +// field, the comments are discarded. +// +// * If the XML element contains a sub-element whose name matches +// the prefix of a tag formatted as "a" or "a>b>c", unmarshal +// will descend into the XML structure looking for elements with the +// given names, and will map the innermost elements to that struct +// field. A tag starting with ">" is equivalent to one starting +// with the field name followed by ">". +// +// * If the XML element contains a sub-element whose name matches +// a struct field's XMLName tag and the struct field has no +// explicit name tag as per the previous rule, unmarshal maps +// the sub-element to that struct field. +// +// * If the XML element contains a sub-element whose name matches a +// field without any mode flags (",attr", ",chardata", etc), Unmarshal +// maps the sub-element to that struct field. +// +// * If the XML element contains a sub-element that hasn't matched any +// of the above rules and the struct has a field with tag ",any", +// unmarshal maps the sub-element to that struct field. +// +// * An anonymous struct field is handled as if the fields of its +// value were part of the outer struct. +// +// * A struct field with tag "-" is never unmarshalled into. +// +// Unmarshal maps an XML element to a string or []byte by saving the +// concatenation of that element's character data in the string or +// []byte. The saved []byte is never nil. +// +// Unmarshal maps an attribute value to a string or []byte by saving +// the value in the string or slice. +// +// Unmarshal maps an XML element to a slice by extending the length of +// the slice and mapping the element to the newly created value. +// +// Unmarshal maps an XML element or attribute value to a bool by +// setting it to the boolean value represented by the string. +// +// Unmarshal maps an XML element or attribute value to an integer or +// floating-point field by setting the field to the result of +// interpreting the string value in decimal. There is no check for +// overflow. +// +// Unmarshal maps an XML element to an xml.Name by recording the +// element name. +// +// Unmarshal maps an XML element to a pointer by setting the pointer +// to a freshly allocated value and then mapping the element to that value. +// +func Unmarshal(data []byte, v interface{}) error { + return NewDecoder(bytes.NewReader(data)).Decode(v) +} + +// Decode works like xml.Unmarshal, except it reads the decoder +// stream to find the start element. +func (d *Decoder) Decode(v interface{}) error { + return d.DecodeElement(v, nil) +} + +// DecodeElement works like xml.Unmarshal except that it takes +// a pointer to the start XML element to decode into v. +// It is useful when a client reads some raw XML tokens itself +// but also wants to defer to Unmarshal for some elements. +func (d *Decoder) DecodeElement(v interface{}, start *StartElement) error { + val := reflect.ValueOf(v) + if val.Kind() != reflect.Ptr { + return errors.New("non-pointer passed to Unmarshal") + } + return d.unmarshal(val.Elem(), start) +} + +// An UnmarshalError represents an error in the unmarshalling process. +type UnmarshalError string + +func (e UnmarshalError) Error() string { return string(e) } + +// Unmarshaler is the interface implemented by objects that can unmarshal +// an XML element description of themselves. +// +// UnmarshalXML decodes a single XML element +// beginning with the given start element. +// If it returns an error, the outer call to Unmarshal stops and +// returns that error. +// UnmarshalXML must consume exactly one XML element. +// One common implementation strategy is to unmarshal into +// a separate value with a layout matching the expected XML +// using d.DecodeElement, and then to copy the data from +// that value into the receiver. +// Another common strategy is to use d.Token to process the +// XML object one token at a time. +// UnmarshalXML may not use d.RawToken. +type Unmarshaler interface { + UnmarshalXML(d *Decoder, start StartElement) error +} + +// UnmarshalerAttr is the interface implemented by objects that can unmarshal +// an XML attribute description of themselves. +// +// UnmarshalXMLAttr decodes a single XML attribute. +// If it returns an error, the outer call to Unmarshal stops and +// returns that error. +// UnmarshalXMLAttr is used only for struct fields with the +// "attr" option in the field tag. +type UnmarshalerAttr interface { + UnmarshalXMLAttr(attr Attr) error +} + +// receiverType returns the receiver type to use in an expression like "%s.MethodName". +func receiverType(val interface{}) string { + t := reflect.TypeOf(val) + if t.Name() != "" { + return t.String() + } + return "(" + t.String() + ")" +} + +// unmarshalInterface unmarshals a single XML element into val. +// start is the opening tag of the element. +func (p *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error { + // Record that decoder must stop at end tag corresponding to start. + p.pushEOF() + + p.unmarshalDepth++ + err := val.UnmarshalXML(p, *start) + p.unmarshalDepth-- + if err != nil { + p.popEOF() + return err + } + + if !p.popEOF() { + return fmt.Errorf("xml: %s.UnmarshalXML did not consume entire <%s> element", receiverType(val), start.Name.Local) + } + + return nil +} + +// unmarshalTextInterface unmarshals a single XML element into val. +// The chardata contained in the element (but not its children) +// is passed to the text unmarshaler. +func (p *Decoder) unmarshalTextInterface(val encoding.TextUnmarshaler, start *StartElement) error { + var buf []byte + depth := 1 + for depth > 0 { + t, err := p.Token() + if err != nil { + return err + } + switch t := t.(type) { + case CharData: + if depth == 1 { + buf = append(buf, t...) + } + case StartElement: + depth++ + case EndElement: + depth-- + } + } + return val.UnmarshalText(buf) +} + +// unmarshalAttr unmarshals a single XML attribute into val. +func (p *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error { + if val.Kind() == reflect.Ptr { + if val.IsNil() { + val.Set(reflect.New(val.Type().Elem())) + } + val = val.Elem() + } + + if val.CanInterface() && val.Type().Implements(unmarshalerAttrType) { + // This is an unmarshaler with a non-pointer receiver, + // so it's likely to be incorrect, but we do what we're told. + return val.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr) + } + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(unmarshalerAttrType) { + return pv.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr) + } + } + + // Not an UnmarshalerAttr; try encoding.TextUnmarshaler. + if val.CanInterface() && val.Type().Implements(textUnmarshalerType) { + // This is an unmarshaler with a non-pointer receiver, + // so it's likely to be incorrect, but we do what we're told. + return val.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value)) + } + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { + return pv.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value)) + } + } + + copyValue(val, []byte(attr.Value)) + return nil +} + +var ( + unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem() + unmarshalerAttrType = reflect.TypeOf((*UnmarshalerAttr)(nil)).Elem() + textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() +) + +// Unmarshal a single XML element into val. +func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error { + // Find start element if we need it. + if start == nil { + for { + tok, err := p.Token() + if err != nil { + return err + } + if t, ok := tok.(StartElement); ok { + start = &t + break + } + } + } + + // Load value from interface, but only if the result will be + // usefully addressable. + if val.Kind() == reflect.Interface && !val.IsNil() { + e := val.Elem() + if e.Kind() == reflect.Ptr && !e.IsNil() { + val = e + } + } + + if val.Kind() == reflect.Ptr { + if val.IsNil() { + val.Set(reflect.New(val.Type().Elem())) + } + val = val.Elem() + } + + if val.CanInterface() && val.Type().Implements(unmarshalerType) { + // This is an unmarshaler with a non-pointer receiver, + // so it's likely to be incorrect, but we do what we're told. + return p.unmarshalInterface(val.Interface().(Unmarshaler), start) + } + + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(unmarshalerType) { + return p.unmarshalInterface(pv.Interface().(Unmarshaler), start) + } + } + + if val.CanInterface() && val.Type().Implements(textUnmarshalerType) { + return p.unmarshalTextInterface(val.Interface().(encoding.TextUnmarshaler), start) + } + + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { + return p.unmarshalTextInterface(pv.Interface().(encoding.TextUnmarshaler), start) + } + } + + var ( + data []byte + saveData reflect.Value + comment []byte + saveComment reflect.Value + saveXML reflect.Value + saveXMLIndex int + saveXMLData []byte + saveAny reflect.Value + sv reflect.Value + tinfo *typeInfo + err error + ) + + switch v := val; v.Kind() { + default: + return errors.New("unknown type " + v.Type().String()) + + case reflect.Interface: + // TODO: For now, simply ignore the field. In the near + // future we may choose to unmarshal the start + // element on it, if not nil. + return p.Skip() + + case reflect.Slice: + typ := v.Type() + if typ.Elem().Kind() == reflect.Uint8 { + // []byte + saveData = v + break + } + + // Slice of element values. + // Grow slice. + n := v.Len() + if n >= v.Cap() { + ncap := 2 * n + if ncap < 4 { + ncap = 4 + } + new := reflect.MakeSlice(typ, n, ncap) + reflect.Copy(new, v) + v.Set(new) + } + v.SetLen(n + 1) + + // Recur to read element into slice. + if err := p.unmarshal(v.Index(n), start); err != nil { + v.SetLen(n) + return err + } + return nil + + case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.String: + saveData = v + + case reflect.Struct: + typ := v.Type() + if typ == nameType { + v.Set(reflect.ValueOf(start.Name)) + break + } + + sv = v + tinfo, err = getTypeInfo(typ) + if err != nil { + return err + } + + // Validate and assign element name. + if tinfo.xmlname != nil { + finfo := tinfo.xmlname + if finfo.name != "" && finfo.name != start.Name.Local { + return UnmarshalError("expected element type <" + finfo.name + "> but have <" + start.Name.Local + ">") + } + if finfo.xmlns != "" && finfo.xmlns != start.Name.Space { + e := "expected element <" + finfo.name + "> in name space " + finfo.xmlns + " but have " + if start.Name.Space == "" { + e += "no name space" + } else { + e += start.Name.Space + } + return UnmarshalError(e) + } + fv := finfo.value(sv) + if _, ok := fv.Interface().(Name); ok { + fv.Set(reflect.ValueOf(start.Name)) + } + } + + // Assign attributes. + // Also, determine whether we need to save character data or comments. + for i := range tinfo.fields { + finfo := &tinfo.fields[i] + switch finfo.flags & fMode { + case fAttr: + strv := finfo.value(sv) + // Look for attribute. + for _, a := range start.Attr { + if a.Name.Local == finfo.name && (finfo.xmlns == "" || finfo.xmlns == a.Name.Space) { + if err := p.unmarshalAttr(strv, a); err != nil { + return err + } + break + } + } + + case fCharData: + if !saveData.IsValid() { + saveData = finfo.value(sv) + } + + case fComment: + if !saveComment.IsValid() { + saveComment = finfo.value(sv) + } + + case fAny, fAny | fElement: + if !saveAny.IsValid() { + saveAny = finfo.value(sv) + } + + case fInnerXml: + if !saveXML.IsValid() { + saveXML = finfo.value(sv) + if p.saved == nil { + saveXMLIndex = 0 + p.saved = new(bytes.Buffer) + } else { + saveXMLIndex = p.savedOffset() + } + } + } + } + } + + // Find end element. + // Process sub-elements along the way. +Loop: + for { + var savedOffset int + if saveXML.IsValid() { + savedOffset = p.savedOffset() + } + tok, err := p.Token() + if err != nil { + return err + } + switch t := tok.(type) { + case StartElement: + consumed := false + if sv.IsValid() { + consumed, err = p.unmarshalPath(tinfo, sv, nil, &t) + if err != nil { + return err + } + if !consumed && saveAny.IsValid() { + consumed = true + if err := p.unmarshal(saveAny, &t); err != nil { + return err + } + } + } + if !consumed { + if err := p.Skip(); err != nil { + return err + } + } + + case EndElement: + if saveXML.IsValid() { + saveXMLData = p.saved.Bytes()[saveXMLIndex:savedOffset] + if saveXMLIndex == 0 { + p.saved = nil + } + } + break Loop + + case CharData: + if saveData.IsValid() { + data = append(data, t...) + } + + case Comment: + if saveComment.IsValid() { + comment = append(comment, t...) + } + } + } + + if saveData.IsValid() && saveData.CanInterface() && saveData.Type().Implements(textUnmarshalerType) { + if err := saveData.Interface().(encoding.TextUnmarshaler).UnmarshalText(data); err != nil { + return err + } + saveData = reflect.Value{} + } + + if saveData.IsValid() && saveData.CanAddr() { + pv := saveData.Addr() + if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { + if err := pv.Interface().(encoding.TextUnmarshaler).UnmarshalText(data); err != nil { + return err + } + saveData = reflect.Value{} + } + } + + if err := copyValue(saveData, data); err != nil { + return err + } + + switch t := saveComment; t.Kind() { + case reflect.String: + t.SetString(string(comment)) + case reflect.Slice: + t.Set(reflect.ValueOf(comment)) + } + + switch t := saveXML; t.Kind() { + case reflect.String: + t.SetString(string(saveXMLData)) + case reflect.Slice: + t.Set(reflect.ValueOf(saveXMLData)) + } + + return nil +} + +func copyValue(dst reflect.Value, src []byte) (err error) { + dst0 := dst + + if dst.Kind() == reflect.Ptr { + if dst.IsNil() { + dst.Set(reflect.New(dst.Type().Elem())) + } + dst = dst.Elem() + } + + // Save accumulated data. + switch dst.Kind() { + case reflect.Invalid: + // Probably a comment. + default: + return errors.New("cannot unmarshal into " + dst0.Type().String()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + itmp, err := strconv.ParseInt(string(src), 10, dst.Type().Bits()) + if err != nil { + return err + } + dst.SetInt(itmp) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + utmp, err := strconv.ParseUint(string(src), 10, dst.Type().Bits()) + if err != nil { + return err + } + dst.SetUint(utmp) + case reflect.Float32, reflect.Float64: + ftmp, err := strconv.ParseFloat(string(src), dst.Type().Bits()) + if err != nil { + return err + } + dst.SetFloat(ftmp) + case reflect.Bool: + value, err := strconv.ParseBool(strings.TrimSpace(string(src))) + if err != nil { + return err + } + dst.SetBool(value) + case reflect.String: + dst.SetString(string(src)) + case reflect.Slice: + if len(src) == 0 { + // non-nil to flag presence + src = []byte{} + } + dst.SetBytes(src) + } + return nil +} + +// unmarshalPath walks down an XML structure looking for wanted +// paths, and calls unmarshal on them. +// The consumed result tells whether XML elements have been consumed +// from the Decoder until start's matching end element, or if it's +// still untouched because start is uninteresting for sv's fields. +func (p *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) { + recurse := false +Loop: + for i := range tinfo.fields { + finfo := &tinfo.fields[i] + if finfo.flags&fElement == 0 || len(finfo.parents) < len(parents) || finfo.xmlns != "" && finfo.xmlns != start.Name.Space { + continue + } + for j := range parents { + if parents[j] != finfo.parents[j] { + continue Loop + } + } + if len(finfo.parents) == len(parents) && finfo.name == start.Name.Local { + // It's a perfect match, unmarshal the field. + return true, p.unmarshal(finfo.value(sv), start) + } + if len(finfo.parents) > len(parents) && finfo.parents[len(parents)] == start.Name.Local { + // It's a prefix for the field. Break and recurse + // since it's not ok for one field path to be itself + // the prefix for another field path. + recurse = true + + // We can reuse the same slice as long as we + // don't try to append to it. + parents = finfo.parents[:len(parents)+1] + break + } + } + if !recurse { + // We have no business with this element. + return false, nil + } + // The element is not a perfect match for any field, but one + // or more fields have the path to this element as a parent + // prefix. Recurse and attempt to match these. + for { + var tok Token + tok, err = p.Token() + if err != nil { + return true, err + } + switch t := tok.(type) { + case StartElement: + consumed2, err := p.unmarshalPath(tinfo, sv, parents, &t) + if err != nil { + return true, err + } + if !consumed2 { + if err := p.Skip(); err != nil { + return true, err + } + } + case EndElement: + return true, nil + } + } +} + +// Skip reads tokens until it has consumed the end element +// matching the most recent start element already consumed. +// It recurs if it encounters a start element, so it can be used to +// skip nested structures. +// It returns nil if it finds an end element matching the start +// element; otherwise it returns an error describing the problem. +func (d *Decoder) Skip() error { + for { + tok, err := d.Token() + if err != nil { + return err + } + switch tok.(type) { + case StartElement: + if err := d.Skip(); err != nil { + return err + } + case EndElement: + return nil + } + } +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/typeinfo.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/typeinfo.go new file mode 100644 index 00000000..c9a6421f --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/typeinfo.go @@ -0,0 +1,371 @@ +// Copyright 2011 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. + +package xml + +import ( + "fmt" + "reflect" + "strings" + "sync" +) + +// typeInfo holds details for the xml representation of a type. +type typeInfo struct { + xmlname *fieldInfo + fields []fieldInfo +} + +// fieldInfo holds details for the xml representation of a single field. +type fieldInfo struct { + idx []int + name string + xmlns string + flags fieldFlags + parents []string +} + +type fieldFlags int + +const ( + fElement fieldFlags = 1 << iota + fAttr + fCharData + fInnerXml + fComment + fAny + + fOmitEmpty + + fMode = fElement | fAttr | fCharData | fInnerXml | fComment | fAny +) + +var tinfoMap = make(map[reflect.Type]*typeInfo) +var tinfoLock sync.RWMutex + +var nameType = reflect.TypeOf(Name{}) + +// getTypeInfo returns the typeInfo structure with details necessary +// for marshalling and unmarshalling typ. +func getTypeInfo(typ reflect.Type) (*typeInfo, error) { + tinfoLock.RLock() + tinfo, ok := tinfoMap[typ] + tinfoLock.RUnlock() + if ok { + return tinfo, nil + } + tinfo = &typeInfo{} + if typ.Kind() == reflect.Struct && typ != nameType { + n := typ.NumField() + for i := 0; i < n; i++ { + f := typ.Field(i) + if f.PkgPath != "" || f.Tag.Get("xml") == "-" { + continue // Private field + } + + // For embedded structs, embed its fields. + if f.Anonymous { + t := f.Type + if t.Kind() == reflect.Ptr { + t = t.Elem() + } + if t.Kind() == reflect.Struct { + inner, err := getTypeInfo(t) + if err != nil { + return nil, err + } + if tinfo.xmlname == nil { + tinfo.xmlname = inner.xmlname + } + for _, finfo := range inner.fields { + finfo.idx = append([]int{i}, finfo.idx...) + if err := addFieldInfo(typ, tinfo, &finfo); err != nil { + return nil, err + } + } + continue + } + } + + finfo, err := structFieldInfo(typ, &f) + if err != nil { + return nil, err + } + + if f.Name == "XMLName" { + tinfo.xmlname = finfo + continue + } + + // Add the field if it doesn't conflict with other fields. + if err := addFieldInfo(typ, tinfo, finfo); err != nil { + return nil, err + } + } + } + tinfoLock.Lock() + tinfoMap[typ] = tinfo + tinfoLock.Unlock() + return tinfo, nil +} + +// structFieldInfo builds and returns a fieldInfo for f. +func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, error) { + finfo := &fieldInfo{idx: f.Index} + + // Split the tag from the xml namespace if necessary. + tag := f.Tag.Get("xml") + if i := strings.Index(tag, " "); i >= 0 { + finfo.xmlns, tag = tag[:i], tag[i+1:] + } + + // Parse flags. + tokens := strings.Split(tag, ",") + if len(tokens) == 1 { + finfo.flags = fElement + } else { + tag = tokens[0] + for _, flag := range tokens[1:] { + switch flag { + case "attr": + finfo.flags |= fAttr + case "chardata": + finfo.flags |= fCharData + case "innerxml": + finfo.flags |= fInnerXml + case "comment": + finfo.flags |= fComment + case "any": + finfo.flags |= fAny + case "omitempty": + finfo.flags |= fOmitEmpty + } + } + + // Validate the flags used. + valid := true + switch mode := finfo.flags & fMode; mode { + case 0: + finfo.flags |= fElement + case fAttr, fCharData, fInnerXml, fComment, fAny: + if f.Name == "XMLName" || tag != "" && mode != fAttr { + valid = false + } + default: + // This will also catch multiple modes in a single field. + valid = false + } + if finfo.flags&fMode == fAny { + finfo.flags |= fElement + } + if finfo.flags&fOmitEmpty != 0 && finfo.flags&(fElement|fAttr) == 0 { + valid = false + } + if !valid { + return nil, fmt.Errorf("xml: invalid tag in field %s of type %s: %q", + f.Name, typ, f.Tag.Get("xml")) + } + } + + // Use of xmlns without a name is not allowed. + if finfo.xmlns != "" && tag == "" { + return nil, fmt.Errorf("xml: namespace without name in field %s of type %s: %q", + f.Name, typ, f.Tag.Get("xml")) + } + + if f.Name == "XMLName" { + // The XMLName field records the XML element name. Don't + // process it as usual because its name should default to + // empty rather than to the field name. + finfo.name = tag + return finfo, nil + } + + if tag == "" { + // If the name part of the tag is completely empty, get + // default from XMLName of underlying struct if feasible, + // or field name otherwise. + if xmlname := lookupXMLName(f.Type); xmlname != nil { + finfo.xmlns, finfo.name = xmlname.xmlns, xmlname.name + } else { + finfo.name = f.Name + } + return finfo, nil + } + + if finfo.xmlns == "" && finfo.flags&fAttr == 0 { + // If it's an element no namespace specified, get the default + // from the XMLName of enclosing struct if possible. + if xmlname := lookupXMLName(typ); xmlname != nil { + finfo.xmlns = xmlname.xmlns + } + } + + // Prepare field name and parents. + parents := strings.Split(tag, ">") + if parents[0] == "" { + parents[0] = f.Name + } + if parents[len(parents)-1] == "" { + return nil, fmt.Errorf("xml: trailing '>' in field %s of type %s", f.Name, typ) + } + finfo.name = parents[len(parents)-1] + if len(parents) > 1 { + if (finfo.flags & fElement) == 0 { + return nil, fmt.Errorf("xml: %s chain not valid with %s flag", tag, strings.Join(tokens[1:], ",")) + } + finfo.parents = parents[:len(parents)-1] + } + + // If the field type has an XMLName field, the names must match + // so that the behavior of both marshalling and unmarshalling + // is straightforward and unambiguous. + if finfo.flags&fElement != 0 { + ftyp := f.Type + xmlname := lookupXMLName(ftyp) + if xmlname != nil && xmlname.name != finfo.name { + return nil, fmt.Errorf("xml: name %q in tag of %s.%s conflicts with name %q in %s.XMLName", + finfo.name, typ, f.Name, xmlname.name, ftyp) + } + } + return finfo, nil +} + +// lookupXMLName returns the fieldInfo for typ's XMLName field +// in case it exists and has a valid xml field tag, otherwise +// it returns nil. +func lookupXMLName(typ reflect.Type) (xmlname *fieldInfo) { + for typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + if typ.Kind() != reflect.Struct { + return nil + } + for i, n := 0, typ.NumField(); i < n; i++ { + f := typ.Field(i) + if f.Name != "XMLName" { + continue + } + finfo, err := structFieldInfo(typ, &f) + if finfo.name != "" && err == nil { + return finfo + } + // Also consider errors as a non-existent field tag + // and let getTypeInfo itself report the error. + break + } + return nil +} + +func min(a, b int) int { + if a <= b { + return a + } + return b +} + +// addFieldInfo adds finfo to tinfo.fields if there are no +// conflicts, or if conflicts arise from previous fields that were +// obtained from deeper embedded structures than finfo. In the latter +// case, the conflicting entries are dropped. +// A conflict occurs when the path (parent + name) to a field is +// itself a prefix of another path, or when two paths match exactly. +// It is okay for field paths to share a common, shorter prefix. +func addFieldInfo(typ reflect.Type, tinfo *typeInfo, newf *fieldInfo) error { + var conflicts []int +Loop: + // First, figure all conflicts. Most working code will have none. + for i := range tinfo.fields { + oldf := &tinfo.fields[i] + if oldf.flags&fMode != newf.flags&fMode { + continue + } + if oldf.xmlns != "" && newf.xmlns != "" && oldf.xmlns != newf.xmlns { + continue + } + minl := min(len(newf.parents), len(oldf.parents)) + for p := 0; p < minl; p++ { + if oldf.parents[p] != newf.parents[p] { + continue Loop + } + } + if len(oldf.parents) > len(newf.parents) { + if oldf.parents[len(newf.parents)] == newf.name { + conflicts = append(conflicts, i) + } + } else if len(oldf.parents) < len(newf.parents) { + if newf.parents[len(oldf.parents)] == oldf.name { + conflicts = append(conflicts, i) + } + } else { + if newf.name == oldf.name { + conflicts = append(conflicts, i) + } + } + } + // Without conflicts, add the new field and return. + if conflicts == nil { + tinfo.fields = append(tinfo.fields, *newf) + return nil + } + + // If any conflict is shallower, ignore the new field. + // This matches the Go field resolution on embedding. + for _, i := range conflicts { + if len(tinfo.fields[i].idx) < len(newf.idx) { + return nil + } + } + + // Otherwise, if any of them is at the same depth level, it's an error. + for _, i := range conflicts { + oldf := &tinfo.fields[i] + if len(oldf.idx) == len(newf.idx) { + f1 := typ.FieldByIndex(oldf.idx) + f2 := typ.FieldByIndex(newf.idx) + return &TagPathError{typ, f1.Name, f1.Tag.Get("xml"), f2.Name, f2.Tag.Get("xml")} + } + } + + // Otherwise, the new field is shallower, and thus takes precedence, + // so drop the conflicting fields from tinfo and append the new one. + for c := len(conflicts) - 1; c >= 0; c-- { + i := conflicts[c] + copy(tinfo.fields[i:], tinfo.fields[i+1:]) + tinfo.fields = tinfo.fields[:len(tinfo.fields)-1] + } + tinfo.fields = append(tinfo.fields, *newf) + return nil +} + +// A TagPathError represents an error in the unmarshalling process +// caused by the use of field tags with conflicting paths. +type TagPathError struct { + Struct reflect.Type + Field1, Tag1 string + Field2, Tag2 string +} + +func (e *TagPathError) Error() string { + return fmt.Sprintf("%s field %q with tag %q conflicts with field %q with tag %q", e.Struct, e.Field1, e.Tag1, e.Field2, e.Tag2) +} + +// value returns v's field value corresponding to finfo. +// It's equivalent to v.FieldByIndex(finfo.idx), but initializes +// and dereferences pointers as necessary. +func (finfo *fieldInfo) value(v reflect.Value) reflect.Value { + for i, x := range finfo.idx { + if i > 0 { + t := v.Type() + if t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct { + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + v = v.Elem() + } + } + v = v.Field(x) + } + return v +} diff --git a/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/xml.go b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/xml.go new file mode 100644 index 00000000..ffab4a70 --- /dev/null +++ b/vendor/github.com/elastic/beats/vendor/golang.org/x/net/webdav/internal/xml/xml.go @@ -0,0 +1,1998 @@ +// Copyright 2009 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. + +// Package xml implements a simple XML 1.0 parser that +// understands XML name spaces. +package xml + +// References: +// Annotated XML spec: http://www.xml.com/axml/testaxml.htm +// XML name spaces: http://www.w3.org/TR/REC-xml-names/ + +// TODO(rsc): +// Test error handling. + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "io" + "strconv" + "strings" + "unicode" + "unicode/utf8" +) + +// A SyntaxError represents a syntax error in the XML input stream. +type SyntaxError struct { + Msg string + Line int +} + +func (e *SyntaxError) Error() string { + return "XML syntax error on line " + strconv.Itoa(e.Line) + ": " + e.Msg +} + +// A Name represents an XML name (Local) annotated with a name space +// identifier (Space). In tokens returned by Decoder.Token, the Space +// identifier is given as a canonical URL, not the short prefix used in +// the document being parsed. +// +// As a special case, XML namespace declarations will use the literal +// string "xmlns" for the Space field instead of the fully resolved URL. +// See Encoder.EncodeToken for more information on namespace encoding +// behaviour. +type Name struct { + Space, Local string +} + +// isNamespace reports whether the name is a namespace-defining name. +func (name Name) isNamespace() bool { + return name.Local == "xmlns" || name.Space == "xmlns" +} + +// An Attr represents an attribute in an XML element (Name=Value). +type Attr struct { + Name Name + Value string +} + +// A Token is an interface holding one of the token types: +// StartElement, EndElement, CharData, Comment, ProcInst, or Directive. +type Token interface{} + +// A StartElement represents an XML start element. +type StartElement struct { + Name Name + Attr []Attr +} + +func (e StartElement) Copy() StartElement { + attrs := make([]Attr, len(e.Attr)) + copy(attrs, e.Attr) + e.Attr = attrs + return e +} + +// End returns the corresponding XML end element. +func (e StartElement) End() EndElement { + return EndElement{e.Name} +} + +// setDefaultNamespace sets the namespace of the element +// as the default for all elements contained within it. +func (e *StartElement) setDefaultNamespace() { + if e.Name.Space == "" { + // If there's no namespace on the element, don't + // set the default. Strictly speaking this might be wrong, as + // we can't tell if the element had no namespace set + // or was just using the default namespace. + return + } + // Don't add a default name space if there's already one set. + for _, attr := range e.Attr { + if attr.Name.Space == "" && attr.Name.Local == "xmlns" { + return + } + } + e.Attr = append(e.Attr, Attr{ + Name: Name{ + Local: "xmlns", + }, + Value: e.Name.Space, + }) +} + +// An EndElement represents an XML end element. +type EndElement struct { + Name Name +} + +// A CharData represents XML character data (raw text), +// in which XML escape sequences have been replaced by +// the characters they represent. +type CharData []byte + +func makeCopy(b []byte) []byte { + b1 := make([]byte, len(b)) + copy(b1, b) + return b1 +} + +func (c CharData) Copy() CharData { return CharData(makeCopy(c)) } + +// A Comment represents an XML comment of the form . +// The bytes do not include the comment markers. +type Comment []byte + +func (c Comment) Copy() Comment { return Comment(makeCopy(c)) } + +// A ProcInst represents an XML processing instruction of the form +type ProcInst struct { + Target string + Inst []byte +} + +func (p ProcInst) Copy() ProcInst { + p.Inst = makeCopy(p.Inst) + return p +} + +// A Directive represents an XML directive of the form . +// The bytes do not include the markers. +type Directive []byte + +func (d Directive) Copy() Directive { return Directive(makeCopy(d)) } + +// CopyToken returns a copy of a Token. +func CopyToken(t Token) Token { + switch v := t.(type) { + case CharData: + return v.Copy() + case Comment: + return v.Copy() + case Directive: + return v.Copy() + case ProcInst: + return v.Copy() + case StartElement: + return v.Copy() + } + return t +} + +// A Decoder represents an XML parser reading a particular input stream. +// The parser assumes that its input is encoded in UTF-8. +type Decoder struct { + // Strict defaults to true, enforcing the requirements + // of the XML specification. + // If set to false, the parser allows input containing common + // mistakes: + // * If an element is missing an end tag, the parser invents + // end tags as necessary to keep the return values from Token + // properly balanced. + // * In attribute values and character data, unknown or malformed + // character entities (sequences beginning with &) are left alone. + // + // Setting: + // + // d.Strict = false; + // d.AutoClose = HTMLAutoClose; + // d.Entity = HTMLEntity + // + // creates a parser that can handle typical HTML. + // + // Strict mode does not enforce the requirements of the XML name spaces TR. + // In particular it does not reject name space tags using undefined prefixes. + // Such tags are recorded with the unknown prefix as the name space URL. + Strict bool + + // When Strict == false, AutoClose indicates a set of elements to + // consider closed immediately after they are opened, regardless + // of whether an end element is present. + AutoClose []string + + // Entity can be used to map non-standard entity names to string replacements. + // The parser behaves as if these standard mappings are present in the map, + // regardless of the actual map content: + // + // "lt": "<", + // "gt": ">", + // "amp": "&", + // "apos": "'", + // "quot": `"`, + Entity map[string]string + + // CharsetReader, if non-nil, defines a function to generate + // charset-conversion readers, converting from the provided + // non-UTF-8 charset into UTF-8. If CharsetReader is nil or + // returns an error, parsing stops with an error. One of the + // the CharsetReader's result values must be non-nil. + CharsetReader func(charset string, input io.Reader) (io.Reader, error) + + // DefaultSpace sets the default name space used for unadorned tags, + // as if the entire XML stream were wrapped in an element containing + // the attribute xmlns="DefaultSpace". + DefaultSpace string + + r io.ByteReader + buf bytes.Buffer + saved *bytes.Buffer + stk *stack + free *stack + needClose bool + toClose Name + nextToken Token + nextByte int + ns map[string]string + err error + line int + offset int64 + unmarshalDepth int +} + +// NewDecoder creates a new XML parser reading from r. +// If r does not implement io.ByteReader, NewDecoder will +// do its own buffering. +func NewDecoder(r io.Reader) *Decoder { + d := &Decoder{ + ns: make(map[string]string), + nextByte: -1, + line: 1, + Strict: true, + } + d.switchToReader(r) + return d +} + +// Token returns the next XML token in the input stream. +// At the end of the input stream, Token returns nil, io.EOF. +// +// Slices of bytes in the returned token data refer to the +// parser's internal buffer and remain valid only until the next +// call to Token. To acquire a copy of the bytes, call CopyToken +// or the token's Copy method. +// +// Token expands self-closing elements such as
    +// into separate start and end elements returned by successive calls. +// +// Token guarantees that the StartElement and EndElement +// tokens it returns are properly nested and matched: +// if Token encounters an unexpected end element, +// it will return an error. +// +// Token implements XML name spaces as described by +// http://www.w3.org/TR/REC-xml-names/. Each of the +// Name structures contained in the Token has the Space +// set to the URL identifying its name space when known. +// If Token encounters an unrecognized name space prefix, +// it uses the prefix as the Space rather than report an error. +func (d *Decoder) Token() (t Token, err error) { + if d.stk != nil && d.stk.kind == stkEOF { + err = io.EOF + return + } + if d.nextToken != nil { + t = d.nextToken + d.nextToken = nil + } else if t, err = d.rawToken(); err != nil { + return + } + + if !d.Strict { + if t1, ok := d.autoClose(t); ok { + d.nextToken = t + t = t1 + } + } + switch t1 := t.(type) { + case StartElement: + // In XML name spaces, the translations listed in the + // attributes apply to the element name and + // to the other attribute names, so process + // the translations first. + for _, a := range t1.Attr { + if a.Name.Space == "xmlns" { + v, ok := d.ns[a.Name.Local] + d.pushNs(a.Name.Local, v, ok) + d.ns[a.Name.Local] = a.Value + } + if a.Name.Space == "" && a.Name.Local == "xmlns" { + // Default space for untagged names + v, ok := d.ns[""] + d.pushNs("", v, ok) + d.ns[""] = a.Value + } + } + + d.translate(&t1.Name, true) + for i := range t1.Attr { + d.translate(&t1.Attr[i].Name, false) + } + d.pushElement(t1.Name) + t = t1 + + case EndElement: + d.translate(&t1.Name, true) + if !d.popElement(&t1) { + return nil, d.err + } + t = t1 + } + return +} + +const xmlURL = "http://www.w3.org/XML/1998/namespace" + +// Apply name space translation to name n. +// The default name space (for Space=="") +// applies only to element names, not to attribute names. +func (d *Decoder) translate(n *Name, isElementName bool) { + switch { + case n.Space == "xmlns": + return + case n.Space == "" && !isElementName: + return + case n.Space == "xml": + n.Space = xmlURL + case n.Space == "" && n.Local == "xmlns": + return + } + if v, ok := d.ns[n.Space]; ok { + n.Space = v + } else if n.Space == "" { + n.Space = d.DefaultSpace + } +} + +func (d *Decoder) switchToReader(r io.Reader) { + // Get efficient byte at a time reader. + // Assume that if reader has its own + // ReadByte, it's efficient enough. + // Otherwise, use bufio. + if rb, ok := r.(io.ByteReader); ok { + d.r = rb + } else { + d.r = bufio.NewReader(r) + } +} + +// Parsing state - stack holds old name space translations +// and the current set of open elements. The translations to pop when +// ending a given tag are *below* it on the stack, which is +// more work but forced on us by XML. +type stack struct { + next *stack + kind int + name Name + ok bool +} + +const ( + stkStart = iota + stkNs + stkEOF +) + +func (d *Decoder) push(kind int) *stack { + s := d.free + if s != nil { + d.free = s.next + } else { + s = new(stack) + } + s.next = d.stk + s.kind = kind + d.stk = s + return s +} + +func (d *Decoder) pop() *stack { + s := d.stk + if s != nil { + d.stk = s.next + s.next = d.free + d.free = s + } + return s +} + +// Record that after the current element is finished +// (that element is already pushed on the stack) +// Token should return EOF until popEOF is called. +func (d *Decoder) pushEOF() { + // Walk down stack to find Start. + // It might not be the top, because there might be stkNs + // entries above it. + start := d.stk + for start.kind != stkStart { + start = start.next + } + // The stkNs entries below a start are associated with that + // element too; skip over them. + for start.next != nil && start.next.kind == stkNs { + start = start.next + } + s := d.free + if s != nil { + d.free = s.next + } else { + s = new(stack) + } + s.kind = stkEOF + s.next = start.next + start.next = s +} + +// Undo a pushEOF. +// The element must have been finished, so the EOF should be at the top of the stack. +func (d *Decoder) popEOF() bool { + if d.stk == nil || d.stk.kind != stkEOF { + return false + } + d.pop() + return true +} + +// Record that we are starting an element with the given name. +func (d *Decoder) pushElement(name Name) { + s := d.push(stkStart) + s.name = name +} + +// Record that we are changing the value of ns[local]. +// The old value is url, ok. +func (d *Decoder) pushNs(local string, url string, ok bool) { + s := d.push(stkNs) + s.name.Local = local + s.name.Space = url + s.ok = ok +} + +// Creates a SyntaxError with the current line number. +func (d *Decoder) syntaxError(msg string) error { + return &SyntaxError{Msg: msg, Line: d.line} +} + +// Record that we are ending an element with the given name. +// The name must match the record at the top of the stack, +// which must be a pushElement record. +// After popping the element, apply any undo records from +// the stack to restore the name translations that existed +// before we saw this element. +func (d *Decoder) popElement(t *EndElement) bool { + s := d.pop() + name := t.Name + switch { + case s == nil || s.kind != stkStart: + d.err = d.syntaxError("unexpected end element ") + return false + case s.name.Local != name.Local: + if !d.Strict { + d.needClose = true + d.toClose = t.Name + t.Name = s.name + return true + } + d.err = d.syntaxError("element <" + s.name.Local + "> closed by ") + return false + case s.name.Space != name.Space: + d.err = d.syntaxError("element <" + s.name.Local + "> in space " + s.name.Space + + "closed by in space " + name.Space) + return false + } + + // Pop stack until a Start or EOF is on the top, undoing the + // translations that were associated with the element we just closed. + for d.stk != nil && d.stk.kind != stkStart && d.stk.kind != stkEOF { + s := d.pop() + if s.ok { + d.ns[s.name.Local] = s.name.Space + } else { + delete(d.ns, s.name.Local) + } + } + + return true +} + +// If the top element on the stack is autoclosing and +// t is not the end tag, invent the end tag. +func (d *Decoder) autoClose(t Token) (Token, bool) { + if d.stk == nil || d.stk.kind != stkStart { + return nil, false + } + name := strings.ToLower(d.stk.name.Local) + for _, s := range d.AutoClose { + if strings.ToLower(s) == name { + // This one should be auto closed if t doesn't close it. + et, ok := t.(EndElement) + if !ok || et.Name.Local != name { + return EndElement{d.stk.name}, true + } + break + } + } + return nil, false +} + +var errRawToken = errors.New("xml: cannot use RawToken from UnmarshalXML method") + +// RawToken is like Token but does not verify that +// start and end elements match and does not translate +// name space prefixes to their corresponding URLs. +func (d *Decoder) RawToken() (Token, error) { + if d.unmarshalDepth > 0 { + return nil, errRawToken + } + return d.rawToken() +} + +func (d *Decoder) rawToken() (Token, error) { + if d.err != nil { + return nil, d.err + } + if d.needClose { + // The last element we read was self-closing and + // we returned just the StartElement half. + // Return the EndElement half now. + d.needClose = false + return EndElement{d.toClose}, nil + } + + b, ok := d.getc() + if !ok { + return nil, d.err + } + + if b != '<' { + // Text section. + d.ungetc(b) + data := d.text(-1, false) + if data == nil { + return nil, d.err + } + return CharData(data), nil + } + + if b, ok = d.mustgetc(); !ok { + return nil, d.err + } + switch b { + case '/': + // ' { + d.err = d.syntaxError("invalid characters between ") + return nil, d.err + } + return EndElement{name}, nil + + case '?': + // ' { + break + } + b0 = b + } + data := d.buf.Bytes() + data = data[0 : len(data)-2] // chop ?> + + if target == "xml" { + content := string(data) + ver := procInst("version", content) + if ver != "" && ver != "1.0" { + d.err = fmt.Errorf("xml: unsupported version %q; only version 1.0 is supported", ver) + return nil, d.err + } + enc := procInst("encoding", content) + if enc != "" && enc != "utf-8" && enc != "UTF-8" { + if d.CharsetReader == nil { + d.err = fmt.Errorf("xml: encoding %q declared but Decoder.CharsetReader is nil", enc) + return nil, d.err + } + newr, err := d.CharsetReader(enc, d.r.(io.Reader)) + if err != nil { + d.err = fmt.Errorf("xml: opening charset %q: %v", enc, err) + return nil, d.err + } + if newr == nil { + panic("CharsetReader returned a nil Reader for charset " + enc) + } + d.switchToReader(newr) + } + } + return ProcInst{target, data}, nil + + case '!': + // ' { + break + } + b0, b1 = b1, b + } + data := d.buf.Bytes() + data = data[0 : len(data)-3] // chop --> + return Comment(data), nil + + case '[': // . + data := d.text(-1, true) + if data == nil { + return nil, d.err + } + return CharData(data), nil + } + + // Probably a directive: , , etc. + // We don't care, but accumulate for caller. Quoted angle + // brackets do not count for nesting. + d.buf.Reset() + d.buf.WriteByte(b) + inquote := uint8(0) + depth := 0 + for { + if b, ok = d.mustgetc(); !ok { + return nil, d.err + } + if inquote == 0 && b == '>' && depth == 0 { + break + } + HandleB: + d.buf.WriteByte(b) + switch { + case b == inquote: + inquote = 0 + + case inquote != 0: + // in quotes, no special action + + case b == '\'' || b == '"': + inquote = b + + case b == '>' && inquote == 0: + depth-- + + case b == '<' && inquote == 0: + // Look for