vizion

package module
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

README

Vizion    Vizion

GoDoc

Vizion is a library designed for building and dissecting network packages with great speed and efficiency.

Installation

To download this library do :

$ go get github.com/AnataarXVI/vizion

Getting started

Vizion can be imported as a library. This library lets you create fully customizable packets.

Here's how to import the library:

import (
    . "github.com/AnataarXVI/vizion"
    "github.com/AnataarXVI/vizion/packet"
    "github.com/AnataarXVI/vizion/layers"
)

Here is an example of how to create a packet :

// Create the packet
pkt := packet.Packet{}

// Create the Ethernet layer with default values set
etherLayer := layers.EtherLayer()
// Modify the Type field of the layer
etherLayer.Type = 0x0806

// Create the ARP layer with default values set 
arpLayer := layers.ARPLayer()

// Add layers to the packet
pkt.AddLayers(&etherLayer, &arpLayer)

// Show the packet composition
pkt.Show()

// Send the packet on 'lo' interface
Send(pkt, "lo")

Result:

Ressources

In the docs folder, you'll find all the documentation you need to get started with the library.

Some useful resources :

Contributing

This project is currently under development. I am open to any improvements or advice.

You can contact me at anataar@protonmail.com or open an issue.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(pkt packet.Packet, iface string) error

Send sends the packet to a raw socket.

func Sniff

func Sniff(iface string, prn func(pkt packet.Packet)) []*packet.Packet

Sniff will capture traffic on an interface.

The iface parameter corresponding to the interface name.

The prn parameter handle a function called when a packet is received. The function need to handle a packet.Packet struct to get the packet.

Types

type RawSocket

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

func NewSocket

func NewSocket(iface string) *RawSocket

Create and return a Raw socket

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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