channel

package module
v0.0.0-...-f34d91d Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

uoicmp

uoicmp provides a drop-in replacement for UDPConn that works over ICMP (currently on IPv4 connections) and lets you have UDP-like connections over ICMP.

Installation

go get github.com/hadi77ir/uoicmp

License

Released under Apache License 2.0

   Copyright (C) 2022 Mohammad Hadi Hosseinpour

   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.

Documentation

Index

Constants

View Source
const MaxPacketSize = 1500
View Source
const MaxPayloadSize = 1468

MaxPayloadSize equals to MaxPacketSize minus icmp header length + 4 for magic number

View Source
const ProtocolICMP = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type DuplexChannel

type DuplexChannel interface {
	net.PacketConn
	StateManager() *endpointstates.Manager
}

func OpenChannel4

func OpenChannel4(magic uint32, isServer bool) (DuplexChannel, error)

OpenChannel4 opens an ICMPv4 channel, enabling sending and receiving datagrams.

type ICMPChannel

type ICMPChannel struct {
	// contains filtered or unexported fields
}

func (*ICMPChannel) Close

func (c *ICMPChannel) Close() error

func (*ICMPChannel) LocalAddr

func (c *ICMPChannel) LocalAddr() net.Addr

func (*ICMPChannel) ReadFrom

func (c *ICMPChannel) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*ICMPChannel) SetDeadline

func (c *ICMPChannel) SetDeadline(t time.Time) error

func (*ICMPChannel) SetReadDeadline

func (c *ICMPChannel) SetReadDeadline(t time.Time) error

func (*ICMPChannel) SetWriteDeadline

func (c *ICMPChannel) SetWriteDeadline(t time.Time) error

func (*ICMPChannel) StateManager

func (c *ICMPChannel) StateManager() *endpointstates.Manager

func (*ICMPChannel) WriteTo

func (c *ICMPChannel) WriteTo(p []byte, addr net.Addr) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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