interfaces

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

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.

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.

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.

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 (
	IfaceNameIsNeededMsg         = "the interface name is needed"
	IfaceValidationFaildMsg      = "the interface validation failed, because"
	InvalidIfaceMsg              = "the interface %s is not valid"
	InterfaceConfigInitFailedMsg = "interfaces configutation failed, because"
	InterfacesInitMsg            = "interface intiated successfully"
	InterfacesListFailedMsg      = "unable to list system interfaces, because"
	PFRingInitFaildMsg           = "unable to crate new pf_ring object, because"
	SettingBPFFilterFailedMsg    = "unable to set the BPF filter, because"
	EnablePFRingFailedMsg        = "while enabling PFRing found"
	PFRingEnabledMsg             = "PFRing enabled successflly"
)

Variables

View Source
var (
	ErrIfaceNotProvided = errors.New(IfaceNameIsNeededMsg)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// IFace interface to bind to
	IFace string
	// PFRing enable pf_ring
	PFRing bool
	// BPFfilter BPF filter
	BPFfilter string
}

Config interface internal configuration

func InitConfig

func InitConfig() (*Config, error)

InitConfig initializes interface package

type Interfaces

type Interfaces struct {
	// Config interface's configuration most of its values come from the arguments
	// or configuration file
	Config *Config
}

Interfaces is in charge to manage interfaces

func New

func New() (iface *Interfaces, err error)

New builds and configure the interface object

func (*Interfaces) InitPFRing

func (iface *Interfaces) InitPFRing() (ring *pfring.Ring, err error)

InitPFRing initializes PFRing on the interface defined in the config

func (*Interfaces) PFRingEnabled

func (iface *Interfaces) PFRingEnabled() bool

PFRingEnabled indicated whether PF Ring is enabled

Jump to

Keyboard shortcuts

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