ip6defrag

package
v3.0.4+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2019 BlueCat Networks (USA) Inc. and its affiliates

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.

Index

Constants

View Source
const (
	IPv6MaximumSize            = 65535
	IPv6MaximumFragmentOffset  = 8191
	IPv6MaximumFragmentListLen = 8191
)

need to check

Variables

This section is empty.

Functions

func BenchmarkDefrag

func BenchmarkDefrag(b *testing.B)

func TestDefragBCDNS

func TestDefragBCDNS(t *testing.T)

func TestDefragBCDNSOutOfOrder

func TestDefragBCDNSOutOfOrder(t *testing.T)

func TestDontFragBCDNS

func TestDontFragBCDNS(t *testing.T)

Types

type IPv6Defragmenter

type IPv6Defragmenter struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

IPv6Defragmenter is a struct which embedded a map of all fragment/packet.

func NewIPv6Defragmenter

func NewIPv6Defragmenter() *IPv6Defragmenter

NewIPv6Defragmenter returns a new IPv6Defragmenter with an initialized map.

func (*IPv6Defragmenter) DefragIPv6

func (d *IPv6Defragmenter) DefragIPv6(in *layers.IPv6) (*layers.IPv6, error)

DefragIPv6 takes in an IPv6 packet with a fragment payload.

func (*IPv6Defragmenter) DefragIPv6WithTimestamp

func (d *IPv6Defragmenter) DefragIPv6WithTimestamp(in *layers.IPv6, t time.Time) (*layers.IPv6, error)

DefragIPv6WithTimestamp provides functionality of DefragIPv6 with an additional timestamp parameter which is used for discarding old fragments instead of time.Now()

This is useful when operating on pcap files instead of live captured data

func (*IPv6Defragmenter) DiscardOlderThan

func (d *IPv6Defragmenter) DiscardOlderThan(t time.Time) int

DiscardOlderThan forgets all packets without any activity since time t. It returns the number of FragmentList aka number of fragment packets it has discarded.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL