unix

package
v1.2.0-rc.1.0...-65ced95 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: GPL-2.0, GPL-2.0-or-later Imports: 32 Imported by: 1

Documentation

Overview

Copyright 2018 Platina Systems, Inc. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

File to catch message updates from linux kernel (via platina-mk1 driver) that signal different networking events (replacement for netlink.go)

  • prefix/nexthop add/delete/replace
  • ifaddr add/delete
  • ifinfo (admin up/down)
  • neighbor add/delete/replace

Index

Constants

View Source
const (
	UNSUPPORTED_VLAN_CTAG_RANGE_MIN = 3000 + iota
	UNSUPPORTED_VLAN_CTAG_RANGE_MAX = 3999
)
View Source
const MAXMSGSPEREVENT = 1000

Variables

View Source
var (
	// Function flags
	FdbOn       bool = true
	AllowBridge bool = true
)

Functions

func AddInterfaceFilter

func AddInterfaceFilter(v *vnet.Vnet, s string, ok bool)

func Init

func Init(v *vnet.Vnet, cf Config)

func InitInterfaceEthtool

func InitInterfaceEthtool(v *vnet.Vnet)

func ProcessFibEntry

func ProcessFibEntry(msg *xeth.MsgFibentry, v *vnet.Vnet) (err error)

NB: Using these tests you could replace interface-address message and just use fibentry - use this test for interface address routes

if (msg.Id == xeth.RT_TABLE_LOCAL && msg.Type == xeth.RTN_LOCAL) ||
	(msg.Id == xeth.RT_TABLE_MAIN && msg.Type == xeth.RTN_UNICAST) {

func ProcessInterfaceAddr

func ProcessInterfaceAddr(msg *xeth.MsgIfa, action vnet.ActionType, v *vnet.Vnet) (err error)

func ProcessInterfaceInfo

func ProcessInterfaceInfo(msg *xeth.MsgIfinfo, action vnet.ActionType, v *vnet.Vnet) (err error)

func ProcessIpNeighbor

func ProcessIpNeighbor(msg *xeth.MsgNeighUpdate, v *vnet.Vnet) (err error)

func ProcessZeroGw

func ProcessZeroGw(msg *xeth.MsgFibentry, v *vnet.Vnet, ns *net_namespace, isDel, isLocal, isMainUc bool) (err error)

Zero Gw processing covers 2 major sub-cases:

  1. Interface-address setting If local table entry and is a known interface of vnet i.e. front-panel then install an interface address
  2. Dummy or any other interface that's not a front panel or vlans of a front panel setting If not a known interface of vnet, we assume it's a dummy and install as a punt adjacency (FIXME - need to filter routes through eth0 and others)

func ScopeTranslate

func ScopeTranslate(scope uint8) string

func SetRxInject

func SetRxInject(v *vnet.Vnet, inject_node_name string)

Types

type Config

type Config struct {
	RxInjectNodeName string
}

type FdbMain

type FdbMain struct {
	loop.Node
	// contains filtered or unexported fields
}

func (*FdbMain) GetEvent

func (m *FdbMain) GetEvent(evType vnet.ActionType) *fdbEvent

func (*FdbMain) Init

func (fm *FdbMain) Init(m *Main)

type Main

type Main struct {
	vnet.Package

	FdbMain
	Config
	// contains filtered or unexported fields
}

func GetMain

func GetMain(v *vnet.Vnet) *Main

func (*Main) Configure

func (m *Main) Configure(in *parse.Input)

func (*Main) Init

func (m *Main) Init() (err error)

func (*Main) LoopInit

func (m *Main) LoopInit(l *loop.Loop)

func (*Main) RegisterHwInterface

func (m *Main) RegisterHwInterface(h vnet.HwInterfacer)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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