Documentation ¶
Index ¶
- Constants
- func AddInterface(ptpConfig, iface string, masterOnly int) (updatedPtpConfig string)
- func CreatePtpConfigBC(policyName, nodeName, ifMasterName, ifSlaveName string, phc2sys bool) (err error)
- func CreatePtpConfigGrandMaster(nodeName, ifName string) error
- func CreatePtpConfigOC(profileName, nodeName, ifSlaveName string, phc2sys bool, label string) (err error)
- func CreatePtpConfigWPCGrandMaster(policyName string, nodeName string, ifList []string, deviceID string) error
- func CreatePtpConfigurations() error
- func PtpConfigBC(isExtGM bool) error
- func PtpConfigDualNicBC(isExtGM bool) error
- func PtpConfigOC(isExtGM bool) error
- func PtpConfigTelcoGM(isExtGM bool) error
- func Reset()
- type ConfigStatus
- type PTPMode
- type TestConfig
- type TestIfClockRoles
Constants ¶
View Source
const ( // DualNICBoundaryClockString matches the Discovery clock mode in Environement DiscoveryString = "Discovery" // NoneString matches empty environment variable NoneString = "" // StartString Stringer value for the start status StartString = "Start" // InitStatusString Stringer value for the init status InitStatusString = "init" // ConfiguredStatusString Stringer value for the configured status ConfiguredStatusString = "configured" // DiscoverySuccessStatusString Stringer value for the Discovery Success status DiscoverySuccessStatusString = "discoverySuccess" // DiscoveryFailureStatusString Stringer value for the Discovery failure status DiscoveryFailureStatusString = "discoveryFailure" PtpLinuxDaemonNamespace = "openshift-ptp" // OrdinaryClockString matches the OC clock mode in Environement OrdinaryClockString = "OC" // BoundaryClockString matches the BC clock mode in Environement BoundaryClockString = "BC" // DualNICBoundaryClockString matches the DualNICBC clock mode in Environement DualNICBoundaryClockString = "DualNICBC" // TelcoGrandMasterClockString matches the T-GM clock mode in Environement TelcoGrandMasterClockString = "T-GM" SCHED_OTHER = "SCHED_OTHER" SCHED_FIFO = "SCHED_FIFO" L2_DISCOVERY_IMAGE = "quay.io/redhat-cne/l2discovery:v12" )
View Source
const ( AlgoOCString = "OC" AlgoBCString = "BC" AlgoBCWithSlavesString = "BCWithSlaves" AlgoDualNicBCString = "DualNicBC" AlgoTelcoGMString = "T-GM" AlgoDualNicBCWithSlavesString = "DualNicBCWithSlaves" AlgoOCExtGMString = "OCExtGM" AlgoBCExtGMString = "BCExtGM" AlgoDualNicBCExtGMString = "DualNicBCExtGM" AlgoBCWithSlavesExtGMString = "BCWithSlavesExtGM" AlgoDualNicBCWithSlavesExtGMString = "DualNicBCWithSlavesExtGM" )
View Source
const BasePtp4lConfig = `[global]
tx_timestamp_timeout 50
ptp_dst_mac 01:1B:19:00:00:00
p2p_dst_mac 01:80:C2:00:00:0E
domainNumber 24
logging_level 7
`
View Source
const BaseTs2PhcConfig = `` /* 148-byte string literal not displayed */
View Source
const FirstSolution = 0
View Source
const NumTestClockRoles = 7
Variables ¶
This section is empty.
Functions ¶
func AddInterface ¶
helper function to add an interface to the ptp4l config
func CreatePtpConfigBC ¶
func CreatePtpConfigOC ¶
func PtpConfigBC ¶
func PtpConfigDualNicBC ¶
func PtpConfigOC ¶
func PtpConfigTelcoGM ¶
Types ¶
type ConfigStatus ¶
type ConfigStatus int64
const ( // Start starting status when object is created Start ConfigStatus = iota // InitStatus the configuration environment variable was read InitStatus // ConfiguredStatus for OC/BC/DuallinkBC modes this is set after the ptp clock is configured ConfiguredStatus // DiscoverySuccessStatus for all modes, indicates a successful discovery DiscoverySuccessStatus // DiscoveryFailureStatus for all modes, indicates a discovery failure DiscoveryFailureStatus )
func (ConfigStatus) String ¶
func (status ConfigStatus) String() string
type PTPMode ¶
type PTPMode int64
const ( // OrdinaryClock OrdinaryClock mode OrdinaryClock PTPMode = iota // BoundaryClock Boundary Clock mode BoundaryClock // DualNICBoundaryClock DualNIC Boundary Clock mode DualNICBoundaryClock // GrandMaster mode TelcoGrandMasterClock // Discovery Discovery mode Discovery // None initial empty mode None )
func StringToMode ¶
type TestConfig ¶
type TestConfig struct { PtpModeDesired PTPMode PtpModeDiscovered PTPMode Status ConfigStatus DiscoveredGrandMasterPtpConfig, DiscoveredSlave1PtpConfig, DiscoveredSlave2PtpConfig, DiscoveredClockUnderTestPtpConfig, DiscoveredClockUnderTestSecondaryPtpConfig *ptpDiscoveryRes DiscoveredClockUnderTestPod *v1core.Pod L2Config l2lib.L2Info FoundSolutions map[string]bool PtpEventsIsConsumerReady bool }
var GlobalConfig TestConfig
func GetDesiredConfig ¶
func GetDesiredConfig(forceUpdate bool) TestConfig
Gets te desired configuration from the environment
func GetFullDiscoveredConfig ¶
func GetFullDiscoveredConfig(namespace string, forceUpdate bool) TestConfig
Gets the discovered configuration
func (*TestConfig) String ¶
func (obj *TestConfig) String() (out string)
type TestIfClockRoles ¶
type TestIfClockRoles int
indicates the clock roles in the algotithms
const ( Grandmaster TestIfClockRoles = iota Slave1 Slave2 BC1Master BC1Slave BC2Master BC2Slave )
Click to show internal directories.
Click to hide internal directories.