iproute2

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPSrSetSourceAddress

func IPSrSetSourceAddress(address string) error

Types

type DummyIface

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

IPRoute2 Dummy interface

func NewDummyIface

func NewDummyIface(name string) *DummyIface

Create a new DummyInterface

func (DummyIface) CreateAndUp

func (iface DummyIface) CreateAndUp() error

Create iproute2 dummy interface and set link up

func (DummyIface) Delete

func (iface DummyIface) Delete() error

Delete iproute2 dummy interface

func (DummyIface) Name

func (iface DummyIface) Name() string

Returns name of the iface

type Table

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

IPRoute2 Table

func NewTable

func NewTable(table string, proto string) Table

Create a new Table

func (Table) AddDefaultRoutesBlackhole

func (t Table) AddDefaultRoutesBlackhole() error

Add default blackhole routes

func (Table) AddRoute

func (t Table) AddRoute(args ...string) error

Add a route on this table, protocol independent

func (Table) AddRoute4

func (t Table) AddRoute4(args ...string) error

Add a route on this table, for IPv4

func (Table) AddRoute4Tun

func (t Table) AddRoute4Tun(prefix string, dev string) error

Add IPv4 Route to Tun iface

func (Table) AddRoute6

func (t Table) AddRoute6(args ...string) error

Add a route on this table, for IPv6

func (Table) AddRoute6Tun

func (t Table) AddRoute6Tun(prefix string, dev string) error

Add IPv6 Route to Tun iface

func (Table) AddRule4

func (t Table) AddRule4(to string) error

Add a new rule to lookup the table, for IPv4

func (Table) AddRule6

func (t Table) AddRule6(to string) error

Add a new rule to lookup the table, for IPv6

func (Table) AddSeg6Encap

func (t Table) AddSeg6Encap(prefix string, segmentsList string, dev string) error

Add Linux Headend with encap

func (Table) AddSeg6EncapWithMTU

func (t Table) AddSeg6EncapWithMTU(prefix string, segmentsList string, dev string, mtu string) error

Add Linux Headend with encap and MTU

func (Table) AddSeg6Inline

func (t Table) AddSeg6Inline(prefix string, segmentsList string, dev string) error

Add Linux Headend with inline Inline mode is only for incomming packets already having an IPv6 header

func (Table) AddSeg6Local

func (t Table) AddSeg6Local(sid string, behavior iana.EndpointBehavior, dev string) error

Add Linux SRv6 Endpoint

func (Table) DelDefaultRoutesBlackhole

func (t Table) DelDefaultRoutesBlackhole() error

Delete default blackhole routes

func (Table) DelRoute

func (t Table) DelRoute(args ...string) error

Delete a route on this table, protocol independent

func (Table) DelRoute4

func (t Table) DelRoute4(args ...string) error

Delete a route on this table, for IPv4

func (Table) DelRoute4Tun

func (t Table) DelRoute4Tun(prefix string, dev string) error

Delete IPv4 Route to Tun iface

func (Table) DelRoute6

func (t Table) DelRoute6(args ...string) error

Delete a route on this table, for IPv6

func (Table) DelRoute6Tun

func (t Table) DelRoute6Tun(prefix string, dev string) error

Delete IPv6 Route to Tun iface

func (Table) DelRule4

func (t Table) DelRule4(to string) error

Delete a rule to lookup the table, for IPv4

func (Table) DelRule6

func (t Table) DelRule6(to string) error

Delete a rule to lookup the table, for IPv6

func (Table) DelSeg6Encap

func (t Table) DelSeg6Encap(prefix string, segmentsList string, dev string) error

Delete Linux Headend with encap

func (Table) DelSeg6Inline

func (t Table) DelSeg6Inline(prefix string, segmentsList string, dev string) error

Delete Linux Headend with inline Inline mode is only for incomming packets already having an IPv6 header

func (Table) DelSeg6Local

func (t Table) DelSeg6Local(sid string, behavior iana.EndpointBehavior, dev string) error

Delete Linux SRv6 Endpoint

type TunIface

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

TunIface

func NewTunIface

func NewTunIface(name string) *TunIface

Create a new TunIface

func (*TunIface) CreateAndUp

func (t *TunIface) CreateAndUp() error

Create the TunIface and set it up

func (*TunIface) Delete

func (t *TunIface) Delete() error

Stop TunIface related goroutines and delete the interface

func (*TunIface) IPv4TTL

func (t *TunIface) IPv4TTL() (uint8, error)

IPv4 default TTL

func (*TunIface) IPv6HopLimit

func (t *TunIface) IPv6HopLimit() (uint8, error)

IPv6 Hop Limit of the TunIface

func (*TunIface) MTU

func (t *TunIface) MTU() (int64, error)

MTU of the TunIface

func (*TunIface) Name

func (t *TunIface) Name() string

Name of the TunIface

func (*TunIface) Read

func (t *TunIface) Read(b []byte) (int, error)

Read a packet from the water interface

func (*TunIface) Write

func (t *TunIface) Write(b []byte) (int, error)

Write a packet to the water interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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