diff --git a/packetbeat/flows/flowid_test.go b/packetbeat/flows/flowid_test.go index 78c8919b3d8..f15ec4403f7 100644 --- a/packetbeat/flows/flowid_test.go +++ b/packetbeat/flows/flowid_test.go @@ -54,14 +54,6 @@ func addVLan(u []byte) applyAddr { } } -func addUDP(a, b []byte) applyAddr { - src := binary.LittleEndian.Uint16(a) - dst := binary.LittleEndian.Uint16(b) - return func(f *FlowID) { - f.AddUDP(src, dst) - } -} - func addTCP(a, b []byte) applyAddr { src := binary.LittleEndian.Uint16(a) dst := binary.LittleEndian.Uint16(b) diff --git a/packetbeat/npcap/npcap.go b/packetbeat/npcap/npcap.go index d0cc42dce48..8781ced6fb0 100644 --- a/packetbeat/npcap/npcap.go +++ b/packetbeat/npcap/npcap.go @@ -15,19 +15,7 @@ // specific language governing permissions and limitations // under the License. -// Package npcap handles fetching and installing Npcap fow Windows. -// -// The npcap package interacts with a registry and download server that -// provides a current_version end point that serves a JSON message that -// corresponds to the this Go type: -// -// struct { -// Version string // The semverish version of the Npcap installer. -// URL string // The location of the Npcap installer. -// Hash string // The sha256 hash of the Npcap installer. -// } -// -// The URL field will point to the location of anb Npcap installer. +// Package npcap handles fetching and installing Npcap for Windows. package npcap import ( diff --git a/packetbeat/protos/cassandra/internal/gocql/marshal.go b/packetbeat/protos/cassandra/internal/gocql/marshal.go index 3c55781cc81..1c784eeb15d 100644 --- a/packetbeat/protos/cassandra/internal/gocql/marshal.go +++ b/packetbeat/protos/cassandra/internal/gocql/marshal.go @@ -271,60 +271,6 @@ func (t Type) String() string { } } -const ( - apacheCassandraTypePrefix = "org.apache.cassandra.db.marshal." -) - -// get Apache Cassandra types -func getApacheCassandraType(class string) Type { - switch strings.TrimPrefix(class, apacheCassandraTypePrefix) { - case "AsciiType": - return TypeASCII - case "LongType": - return TypeBigInt - case "BytesType": - return TypeBlob - case "BooleanType": - return TypeBoolean - case "CounterColumnType": - return TypeCounter - case "DecimalType": - return TypeDecimal - case "DoubleType": - return TypeDouble - case "FloatType": - return TypeFloat - case "Int32Type": - return TypeInt - case "ShortType": - return TypeSmallInt - case "ByteType": - return TypeTinyInt - case "DateType", "TimestampType": - return TypeTimestamp - case "UUIDType", "LexicalUUIDType": - return TypeUUID - case "UTF8Type": - return TypeVarchar - case "IntegerType": - return TypeVarint - case "TimeUUIDType": - return TypeTimeUUID - case "InetAddressType": - return TypeInet - case "MapType": - return TypeMap - case "ListType": - return TypeList - case "SetType": - return TypeSet - case "TupleType": - return TypeTuple - default: - return TypeCustom - } -} - // error Types type ErrType int @@ -565,15 +511,6 @@ const ( flagHasMorePages int = 0x02 flagNoMetaData int = 0x04 - // query flags - flagValues byte = 0x01 - flagSkipMetaData byte = 0x02 - flagPageSize byte = 0x04 - flagWithPagingState byte = 0x08 - flagWithSerialConsistency byte = 0x10 - flagDefaultTimestamp byte = 0x20 - flagWithNameValues byte = 0x40 - // header flags flagDefault byte = 0x00 flagCompress byte = 0x01 diff --git a/packetbeat/protos/memcache/errors.go b/packetbeat/protos/memcache/errors.go index 282812a3492..aa60b6fd8ca 100644 --- a/packetbeat/protos/memcache/errors.go +++ b/packetbeat/protos/memcache/errors.go @@ -23,16 +23,12 @@ import ( "errors" ) -var errNotImplemented = errors.New("not implemented") - // memcache text parser errors var ( errParserCaughtInError = errors.New("memcache parser caught in error loop") errParserUnknownCommand = errors.New("unknown memcache command found") errNoMoreArgument = errors.New("no more command arguments") - errExpectedNumber = errors.New("expected number value") errExpectedNoReply = errors.New("expected noreply in argument list") - errExpectedCRLF = errors.New("expected CRLF") errExpectedKeys = errors.New("message has no keys") ) @@ -49,11 +45,10 @@ var ( // memcache transaction/message errors var ( - errInvalidMessage = errors.New("message is invalid") - errMixOfBinaryAndText = errors.New("mix of binary and text in one connection") - errResponseUnknownTransaction = errors.New("response from unknown transaction") - errExpectedValueForMerge = errors.New("expected value to merge with") - errExpectedStatsForMerge = errors.New("expected stat response to merge with") + errInvalidMessage = errors.New("message is invalid") + errMixOfBinaryAndText = errors.New("mix of binary and text in one connection") + errExpectedValueForMerge = errors.New("expected value to merge with") + errExpectedStatsForMerge = errors.New("expected stat response to merge with") ) // internal notes to be published with transaction diff --git a/packetbeat/scripts/mage/config.go b/packetbeat/scripts/mage/config.go index c8b3d7242a4..1ae89d8a4f7 100644 --- a/packetbeat/scripts/mage/config.go +++ b/packetbeat/scripts/mage/config.go @@ -23,11 +23,6 @@ import ( devtools "github.com/elastic/beats/v7/dev-tools/mage" ) -const ( - // configTemplateGlob matches Packetbeat protocol config file templates. - configTemplateGlob = "protos/*/_meta/config*.yml.tmpl" -) - var defaultDevice = map[string]string{ "darwin": "en0", "linux": "any",