ptp4lconf

package
v0.0.0-...-421ad94 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPTPProfileName

func GetPTPProfileName(ptpConfig string) string

GetPTPProfileName ... get profile name from ptpconfig

Types

type PTP4lConfig

type PTP4lConfig struct {
	Name       string
	Profile    string
	Interfaces []*PTPInterface
}

PTP4lConfig ... get filename, profile name and interfaces

func (*PTP4lConfig) ByInterface

func (ptp4lCfg *PTP4lConfig) ByInterface(iface string) (PTPInterface, error)

ByInterface ... get interface object by interface name

func (*PTP4lConfig) ByPortID

func (ptp4lCfg *PTP4lConfig) ByPortID(id int) (PTPInterface, error)

ByPortID ... get ptp interface by port id

func (*PTP4lConfig) ByRole

func (ptp4lCfg *PTP4lConfig) ByRole(role types.PtpPortRole) (PTPInterface, error)

ByRole ... get interface name by ptp port role

func (*PTP4lConfig) GetAliasByInterface

func (ptp4lCfg *PTP4lConfig) GetAliasByInterface(p PTPInterface) string

GetAliasByInterface ... get alias name by interface name

func (*PTP4lConfig) GetUnknownAlias

func (ptp4lCfg *PTP4lConfig) GetUnknownAlias() (string, error)

GetUnknownAlias ... when master port details are not know, get first interface alias name

func (*PTP4lConfig) String

func (ptp4lCfg *PTP4lConfig) String() string

type PTPInterface

type PTPInterface struct {
	Name     string
	PortID   int
	PortName string
	Role     types.PtpPortRole
}

PTPInterface ... ptp interfaces from ptpConfig

func (*PTPInterface) UpdateRole

func (pi *PTPInterface) UpdateRole(role types.PtpPortRole)

UpdateRole ... update role

type PtpConfigUpdate

type PtpConfigUpdate struct {
	Name      *string `json:"name,omitempty"`
	Ptp4lConf *string `json:"ptp4lConf,omitempty"`
	Profile   *string `json:"profile,omitempty"`
	Removed   bool    `json:"removed,omitempty"`
}

PtpConfigUpdate ... updated ptp config values

func (*PtpConfigUpdate) GetAllInterface

func (p *PtpConfigUpdate) GetAllInterface() []*string

GetAllInterface ... return interfaces

func (*PtpConfigUpdate) String

func (p *PtpConfigUpdate) String() string

type Watcher

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

Watcher monitors a file for changes

func NewPtp4lConfigWatcher

func NewPtp4lConfigWatcher(dirToWatch string, updatedConfig chan<- *PtpConfigUpdate) (w *Watcher, err error)

NewPtp4lConfigWatcher ... create new ptp4l config file watcher

func (*Watcher) Close

func (w *Watcher) Close()

Close ... close watcher

Jump to

Keyboard shortcuts

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