interfaces

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 7 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.

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"
	PCAPInitFaildMsg             = "unable to crate new pcap object, because"
	SettingBPFFilterFailedMsg    = "unable to set the BPF filter, because"
	EnablePFRingFailedMsg        = "while enabling PFRing found"
	PFRingEnabledMsg             = "PFRing enabled successflly"
	PCAPEnabledMsg               = "PCAP sniffer enabled successflly"
	PCAPInitFailMsg              = "while initiating pcap got"
	PFRingInitFailMsg            = "while initiating pf_ring got"
	PFRingNotAvaliableMsg        = "PFRing is not avaliable. Falling down to PCAP sniffer"
)

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) GetHandler added in v0.1.1

func (iface *Interfaces) GetHandler() (handle gopacket.PacketDataSource, err error)

GetHandler returns the data source where the packets will came in from

func (*Interfaces) PFRingAvaliable added in v0.1.1

func (iface *Interfaces) PFRingAvaliable() bool

PFRingAvaliable indicated whether PF Ring is enabled

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