Skip to content

Commit

Permalink
Merge pull request #194 from spq/gopacket_fork
Browse files Browse the repository at this point in the history
Switch to gopacket/gopacket fork
  • Loading branch information
spq authored Dec 21, 2024
2 parents 644c4f0 + 57bf2ea commit 45cb1d3
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 52 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.23", "1.22", "1.21"]
go: ["1.23", "1.22"]
node: [22, 20]
exclude:
- go: 1.23
node: 20
- go: 1.22
node: 20
- go: 1.21
node: 22
name: Go ${{ matrix.go }}, Node ${{ matrix.node }} build
steps:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ curl --data-binary @some-file.pcap http://localhost:8080/upload/some-file.pcap

## Running

- requires [go](https://go.dev/dl/) 1.22+
- install required dependencies
- libpcap (e.g. `apt install libpcap-dev`)
- run `yarn install && yarn build` in `/web`
Expand Down
4 changes: 2 additions & 2 deletions cmd/pkappa2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (

"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/google/gopacket/pcap"
"github.com/google/gopacket/pcapgo"
"github.com/gopacket/gopacket/pcap"
"github.com/gopacket/gopacket/pcapgo"
"github.com/gorilla/websocket"
"github.com/spq/pkappa2/internal/index"
"github.com/spq/pkappa2/internal/index/manager"
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
module github.com/spq/pkappa2

go 1.19
go 1.22.0

toolchain go1.22.9

require (
github.com/alecthomas/participle/v2 v2.1.1
github.com/fsnotify/fsnotify v1.8.0
github.com/go-chi/chi/v5 v5.2.0
github.com/google/gopacket v1.1.19
github.com/gopacket/gopacket v1.3.1
github.com/gorilla/websocket v1.5.3
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/sys v0.28.0
rsc.io/binaryregexp v0.2.0
)

require golang.org/x/net v0.23.0 // indirect
require golang.org/x/net v0.28.0 // indirect
27 changes: 11 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
github.com/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0=
github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/participle/v2 v2.1.1 h1:hrjKESvSqGHzRb4yW1ciisFJ4p3MGYih6icjJvbsmV8=
github.com/alecthomas/participle/v2 v2.1.1/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0=
github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
github.com/gopacket/gopacket v1.3.1 h1:ZppWyLrOJNZPe5XkdjLbtuTkfQoxQ0xyMJzQCqtqaPU=
github.com/gopacket/gopacket v1.3.1/go.mod h1:3I13qcqSpB2R9fFQg866OOgzylYkZxLTmkvcXhvf6qg=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 h1:gga7acRE695APm9hlsSMoOoE65U4/TcqNj90mc69Rlg=
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
8 changes: 4 additions & 4 deletions internal/index/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"strings"
"time"

"github.com/google/gopacket"
"github.com/google/gopacket/ip4defrag"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/reassembly"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/ip4defrag"
"github.com/gopacket/gopacket/layers"
"github.com/gopacket/gopacket/reassembly"
"github.com/spq/pkappa2/internal/index"
"github.com/spq/pkappa2/internal/index/streams"
"github.com/spq/pkappa2/internal/index/udpreassembly"
Expand Down
6 changes: 3 additions & 3 deletions internal/index/builder/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"path/filepath"
"time"

"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/layers"
"github.com/gopacket/gopacket/pcap"
pcapmetadata "github.com/spq/pkappa2/internal/tools/pcapMetadata"
)

Expand Down
8 changes: 4 additions & 4 deletions internal/index/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"time"

"github.com/fsnotify/fsnotify"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
"github.com/google/gopacket/pcapgo"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/layers"
"github.com/gopacket/gopacket/pcap"
"github.com/gopacket/gopacket/pcapgo"
"github.com/spq/pkappa2/internal/index"
"github.com/spq/pkappa2/internal/index/builder"
"github.com/spq/pkappa2/internal/index/converters"
Expand Down
6 changes: 3 additions & 3 deletions internal/index/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"testing"
"time"

"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcapgo"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/layers"
"github.com/gopacket/gopacket/pcapgo"
"github.com/spq/pkappa2/internal/index/converters"
"github.com/spq/pkappa2/internal/query"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/index/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

"github.com/google/gopacket"
"github.com/google/gopacket/reassembly"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/reassembly"
"github.com/spq/pkappa2/internal/index/streams"
pcapmetadata "github.com/spq/pkappa2/internal/tools/pcapMetadata"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/index/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"testing"
"time"

"github.com/google/gopacket"
"github.com/google/gopacket/reassembly"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/reassembly"
"github.com/spq/pkappa2/internal/index/streams"
"github.com/spq/pkappa2/internal/query"
"github.com/spq/pkappa2/internal/tools"
Expand Down
6 changes: 3 additions & 3 deletions internal/index/streams/streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"flag"
"time"

"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/reassembly"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/layers"
"github.com/gopacket/gopacket/reassembly"
pcapmetadata "github.com/spq/pkappa2/internal/tools/pcapMetadata"
)

Expand Down
6 changes: 3 additions & 3 deletions internal/index/udpreassembly/udpreassembly.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"bytes"
"time"

"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/reassembly"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/layers"
"github.com/gopacket/gopacket/reassembly"
"github.com/spq/pkappa2/internal/index/streams"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/index/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sort"
"time"

"github.com/google/gopacket/reassembly"
"github.com/gopacket/gopacket/reassembly"
"github.com/spq/pkappa2/internal/index/streams"
pcapmetadata "github.com/spq/pkappa2/internal/tools/pcapMetadata"
"github.com/spq/pkappa2/internal/tools/seekbufio"
Expand Down
2 changes: 1 addition & 1 deletion internal/tools/pcapMetadata/pcapMetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package pcapmetadata
import (
"time"

"github.com/google/gopacket"
"github.com/gopacket/gopacket"
)

type (
Expand Down
4 changes: 2 additions & 2 deletions internal/tools/seekablePcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package tools
import (
"math"

"github.com/google/gopacket"
"github.com/google/gopacket/pcap"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/pcap"
)

type (
Expand Down

0 comments on commit 45cb1d3

Please sign in to comment.