+
Skip to content

Tags: gopacket/gopacket

Tags

v1.4.0

Toggle v1.4.0's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
Feature/add serialize to ipv6 routing (#111)

* add SerializeTo IPv6Routing

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add SerializeTo IPv6Routing

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* Update layers/ip6.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Co-authored-by: Ali <hi@n0p.me>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

v1.3.1

Toggle v1.3.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Change ifdef for 64-bit time to check for the right thing (#90)

Currently this checks whether a type is defined which does not appear to
work. Instead, we check for the specific cases where time64 would be
used instead of time.

Closes #89

v1.3.0

Toggle v1.3.0's commit message

Verified

This commit was signed with the committer’s verified signature.
updated dependencies and bump go to 1.23.0

v.1.3.0

Toggle v.1.3.0's commit message

Verified

This commit was signed with the committer’s verified signature.
updated dependencies and bump go to 1.23.0

v1.2.0

Toggle v1.2.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
refactor: don't fill empty metadata slots (#32)

Some metadata arrays are pretty big (e.g. `EthernetTypeMetadata` has
65536 slots), while only a small subset of the values are filled with
actual decoders (e.g. for `EthernetTypeMetadata` that is 18 entries).

The rest were filled in `func init()` to return error on access. This
leads to noticeable startup time delay, as these mappings are pretty
big.

This change simply leaves not used slots unset (zero value), and the
request error values are generated on access to the slot.

Comparing time with `GODEBUG=inittrace=1` on a simple test program which
imports `gopacket/layers`:

before:

```
init internal/bytealg @0 ms, 0 ms clock, 0 bytes, 0 allocs
init runtime @0.009 ms, 0.063 ms clock, 0 bytes, 0 allocs
init math @0.18 ms, 0 ms clock, 0 bytes, 0 allocs
init errors @0.19 ms, 0 ms clock, 0 bytes, 0 allocs
init sync @0.20 ms, 0.002 ms clock, 16 bytes, 1 allocs
init internal/godebug @0.21 ms, 0.020 ms clock, 816 bytes, 20 allocs
init internal/intern @0.23 ms, 0.002 ms clock, 408 bytes, 8 allocs
init hash/crc32 @0.24 ms, 0.008 ms clock, 1024 bytes, 1 allocs
init net/netip @0.26 ms, 0 ms clock, 48 bytes, 2 allocs
init syscall @0.26 ms, 0.003 ms clock, 640 bytes, 3 allocs
init time @0.27 ms, 0.002 ms clock, 0 bytes, 0 allocs
init context @0.28 ms, 0 ms clock, 96 bytes, 1 allocs
init io/fs @0.29 ms, 0 ms clock, 0 bytes, 0 allocs
init os @0.30 ms, 0.006 ms clock, 328 bytes, 7 allocs
init unicode @0.31 ms, 0 ms clock, 512 bytes, 4 allocs
init reflect @0.32 ms, 0 ms clock, 0 bytes, 0 allocs
init vendor/golang.org/x/net/dns/dnsmessage @0.32 ms, 0.002 ms clock, 624 bytes, 6 allocs
init net @0.33 ms, 0.002 ms clock, 688 bytes, 13 allocs
init github.com/gopacket/gopacket @0.34 ms, 0.003 ms clock, 720 bytes, 5 allocs
init github.com/gopacket/gopacket/layers @0.35 ms, 1.3 ms clock, 25136 bytes, 63 allocs
```

after:

```
init internal/bytealg @0 ms, 0 ms clock, 0 bytes, 0 allocs
init runtime @0.011 ms, 0.070 ms clock, 0 bytes, 0 allocs
init math @0.26 ms, 0 ms clock, 0 bytes, 0 allocs
init errors @0.27 ms, 0 ms clock, 0 bytes, 0 allocs
init sync @0.27 ms, 0.003 ms clock, 16 bytes, 1 allocs
init internal/godebug @0.28 ms, 0.023 ms clock, 816 bytes, 20 allocs
init internal/intern @0.31 ms, 0.002 ms clock, 408 bytes, 8 allocs
init hash/crc32 @0.32 ms, 0.008 ms clock, 1024 bytes, 1 allocs
init net/netip @0.33 ms, 0 ms clock, 48 bytes, 2 allocs
init syscall @0.34 ms, 0.003 ms clock, 640 bytes, 3 allocs
init time @0.35 ms, 0.003 ms clock, 0 bytes, 0 allocs
init context @0.37 ms, 0 ms clock, 96 bytes, 1 allocs
init io/fs @0.38 ms, 0 ms clock, 0 bytes, 0 allocs
init os @0.38 ms, 0.009 ms clock, 328 bytes, 7 allocs
init unicode @0.40 ms, 0 ms clock, 512 bytes, 4 allocs
init reflect @0.41 ms, 0 ms clock, 0 bytes, 0 allocs
init vendor/golang.org/x/net/dns/dnsmessage @0.42 ms, 0.002 ms clock, 624 bytes, 6 allocs
init net @0.43 ms, 0.004 ms clock, 688 bytes, 13 allocs
init github.com/gopacket/gopacket @0.44 ms, 0.003 ms clock, 720 bytes, 5 allocs
init github.com/gopacket/gopacket/layers @0.46 ms, 0.086 ms clock, 25872 bytes, 66 allocs
```

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>

v1.1.1

Toggle v1.1.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fixes for Geneve option flags/length field (#17)

* Fix Geneve option flags/length field decoding

The option header length is 5 bits, not 4, so fix the bit shift for
decoding flags, and fix the mask for decoding the length. This also adds
a unit test for decoding a max length option (124 byte payload).

* Fix Geneve option flags/length field serialization

OR-assigning the flag bits into the byte offset for the Geneve option
header flags/length field produced corrupt packets because the buffer
returned by PrependBytes is not guaranteed to be zeroed out. Since this
is the first time that offset is touched, just assign instead.

---------

Co-authored-by: Simeon Miteff <simeon.miteff@corelight.com>

v1.1.0

Toggle v1.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Create .github/FUNDING.yml

v1.0.0

Toggle v1.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
experimental CGO- less afpacket (#11)

v0.1.0

Toggle v0.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Geneve SerializeTo improvements (#9)

* geneve: Fix crash in SerializeTo when lengths are wrong

We run the risk of panicing on buffer overflow if option lengths in the
packet are blindly trusted in serialization.

In line with the precedent set elsewhere (e.g. IPv4, TCP), compute the
necessary buffer size based on the actual options size.

Fill lengths fields from user-provided values, even if those are wrong.

Signed-off-by: Nick Zavaritsky <mejedi@gmail.com>

* geneve: support FixLengths option in SerializeTo

Signed-off-by: Nick Zavaritsky <mejedi@gmail.com>

Signed-off-by: Nick Zavaritsky <mejedi@gmail.com>
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载