Software TSN Switch
A software switch to connect VMs and Containers to a TSN network
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
CncTypes.h File Reference
#include <array>
#include <cstdint>
#include <limits>
#include <optional>
#include <string>
#include <vector>
Include dependency graph for CncTypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TrafficClassData_t
 Struct to represent the traffic-class/traffic-class-table container of the ieee802-dot1q-bridge model. More...
 
struct  GclEntry_t
 Struct to represent a single gate-control-entry in a base-gate-control-entries grouping (aka the admin-control-list or oper-control-list container) of the ieee802-dot1q-sched model. More...
 
struct  RationalTime_t
 Struct to represent an ieee802:rational-grouping. More...
 
struct  PtpTime_t
 Struct to represent an ieee802:ptp-time-grouping. More...
 
struct  queueMaxSduEntry_t
 Struct to represent a single entry of the queue-max-sdu-table list of the ieee802-dot1q-sched model. More...
 
struct  GclConfig_t
 Struct to hold information about the gate-parameter-table of an interface, according to the ieee802-dot1q-sched yang model. More...
 
struct  LldpNeighbor_t
 Struct that represents the basic information about a system connected to an LLDP-port on a host. Corresponds to one instance of /lldp/port/remote-systems-data. More...
 
struct  BridgePort_t
 Struct to hold information about and interfaces bridge-port, as defined by the ieee802-dot1q-bridge yang model. More...
 
struct  ietfInterface_t
 Struct to hold information about an interface, inspired by the ietf-interfaces yang model. More...
 
struct  PtpPerformanceParameters_t
 Struct that represents the 4 values for a statistic: Mean, Max, Min, and StdDev. More...
 
struct  PtpPerformanceRecord_t
 Struct that represents the statistics of the PTP performance metrics (specifically the offset from the time-transmitter and the mean path delay) over a certain period. More...
 
struct  PtpPortPerformanceRecord_t
 Struct that represents the statistics of the PTP performance metrics of a single port, specifically the mean link delay, over a certain period. More...
 
struct  DefaultDs_t
 Struct that represents the fields we use from the "Default data set" of the ieee1588-ptp-tt YANG model. More...
 
struct  CurrentDs_t
 Struct that represents the fields we use from the "Current data set" of the ieee1588-ptp-tt YANG model. More...
 
struct  ParentDs_t
 Struct that represents the fields we use from the "Parent data set" of the ieee1588-ptp-tt YANG model. More...
 
struct  PortDs_t
 Struct that represents the fields we use from the "Port data set" of the ieee1588-ptp-tt YANG model. More...
 
struct  PtpPort_t
 Struct that represents the fields we use from the port element of the ieee1588-ptp-tt YANG model. More...
 
struct  PtpNode_t
 Struct that represents all the PTP information on one host we use, corresponds to one /ptp/instances/instance of the ieee1588-ptp-tt YANG model. More...
 
struct  LldpLocalSystemData_t
 Struct that represents the information about the local system, as available to the LLDP agent. More...
 
struct  LldpPort_t
 Struct that represents one "LLDP-port", aka one interface participating in LLDP. Contains a list of LldpNeighbor_t structs which correspond to basic information about an entry of remote-systems-data. More...
 
struct  LldpNode_t
 Represents all LLDP information of a host. Includes the local configuration and system-data and a list of LldpPort_t structs, one for each interface participating in LLDP. More...
 
struct  CncNode_t
 This struct is used on the CNC side to represent one host with all its interfaces as well as its PTP and LLDP information. More...
 

Macros

#define CNC_TYPES_H
 

Enumerations

enum class  OperStatus : uint8_t {
  UP = 1 , DOWN = 2 , TESTING = 3 , UNKNOWN = 4 ,
  DORMANT = 5 , NOT_PRESENT = 6 , LOWER_LAYER_DOWN = 7
}
 Enum that represents the operational status of an interface, as given by the IFLA_OPERSTATE netlink attribute and required by the oper-status leaf of the ietf-interfaces yang model. More...
 
enum class  IfType : uint8_t { ETHERNET , BRIDGE , LAG , LOOPBACK }
 Enum that represents the iana-if-type of an interface, interpreted from the IFLA_INFO_KIND netlink attribute and required for the mandatory type leaf of the ietf-interfaces model. More...
 
enum class  PtpInstanceType_t : uint8_t {
  PTP_INSTANCE_OC = 0 , PTP_INSTANCE_BC , PTP_INSTANCE_P2P_TC , PTP_INSTANCE_E2E_TC ,
  PTP_INSTANCE_INVALID
}
 Enum that represents the type of a PTP instance, for gPTP either Ordinary Clock or Boundary Clock. More...
 
enum class  PtpPortState_t : uint8_t {
  INITIALIZING = 1 , FAULTY , DISABLED , LISTENING ,
  PRE_TIME_TRANSMITTER , TIME_TRANSMITTER , PASSIVE , UNCALIBRATED ,
  TIME_RECEIVER
}
 Enum that defines which state a port is in. For gPTP only some of them are used. More...
 

Functions

const std::optional< std::string > & operStatusToYangString (OperStatus status)
 Helper method that maps internal OperStatus to YANG enumeration labels.
 
const std::optional< std::string > & ifTypeToIanaString (IfType type)
 Helper method to convert an IfType to a string accepted by a field of type iana-interface-type in a YANG model.
 
const std::optional< std::string > & ptpInstanceTypeToEnum (PtpInstanceType_t type)
 Helper method to convert an PtpInstanceType_t to a string that is valid in the YANG model.
 
const std::optional< std::string > & portStateToString (PtpPortState_t state)
 Helper method to convert an PtpPortState_t to a string that is valid in the YANG model.
 

Variables

constexpr uint64_t kInterfaceSpeedUnknown = std::numeric_limits<uint64_t>::max()
 Constant that represents an unknown interface speed, used as a sentinel value.
 
constexpr uint64_t kMbpsToBps = 1000000ULL
 Conversion factor from megabits per second to bits per second.
 

Macro Definition Documentation

◆ CNC_TYPES_H

#define CNC_TYPES_H

Enumeration Type Documentation

◆ IfType

enum class IfType : uint8_t
strong

Enum that represents the iana-if-type of an interface, interpreted from the IFLA_INFO_KIND netlink attribute and required for the mandatory type leaf of the ietf-interfaces model.

Enumerator
ETHERNET 
BRIDGE 
LAG 
LOOPBACK 

◆ OperStatus

enum class OperStatus : uint8_t
strong

Enum that represents the operational status of an interface, as given by the IFLA_OPERSTATE netlink attribute and required by the oper-status leaf of the ietf-interfaces yang model.

Enumerator
UP 
DOWN 
TESTING 
UNKNOWN 
DORMANT 
NOT_PRESENT 
LOWER_LAYER_DOWN 

◆ PtpInstanceType_t

enum class PtpInstanceType_t : uint8_t
strong

Enum that represents the type of a PTP instance, for gPTP either Ordinary Clock or Boundary Clock.

Enumerator
PTP_INSTANCE_OC 
PTP_INSTANCE_BC 
PTP_INSTANCE_P2P_TC 
PTP_INSTANCE_E2E_TC 
PTP_INSTANCE_INVALID 

◆ PtpPortState_t

enum class PtpPortState_t : uint8_t
strong

Enum that defines which state a port is in. For gPTP only some of them are used.

Enumerator
INITIALIZING 
FAULTY 
DISABLED 
LISTENING 
PRE_TIME_TRANSMITTER 
TIME_TRANSMITTER 
PASSIVE 
UNCALIBRATED 
TIME_RECEIVER 

Function Documentation

◆ ifTypeToIanaString()

const std::optional< std::string > & ifTypeToIanaString ( IfType  type)
inline

Helper method to convert an IfType to a string accepted by a field of type iana-interface-type in a YANG model.

Parameters
typeAn IfType
Returns
An optional string we can use for setting the value of a field in a libyang::DataNode.

◆ operStatusToYangString()

const std::optional< std::string > & operStatusToYangString ( OperStatus  status)
inline

Helper method that maps internal OperStatus to YANG enumeration labels.

Parameters
statusAn OperStatus
Returns
An optional string as it can be used to set the value of a field in a libyang::DataNode.

◆ portStateToString()

const std::optional< std::string > & portStateToString ( PtpPortState_t  state)
inline

Helper method to convert an PtpPortState_t to a string that is valid in the YANG model.

Parameters
state
Returns
An optional string as it can be used to set the value of a field in a libyang::DataNode.

◆ ptpInstanceTypeToEnum()

const std::optional< std::string > & ptpInstanceTypeToEnum ( PtpInstanceType_t  type)
inline

Helper method to convert an PtpInstanceType_t to a string that is valid in the YANG model.

Parameters
typeA PtpInstanceType_t
Returns
An optional string as it can be used to set the value of a field in a libyang::DataNode.

Variable Documentation

◆ kInterfaceSpeedUnknown

constexpr uint64_t kInterfaceSpeedUnknown = std::numeric_limits<uint64_t>::max()
inlineconstexpr

Constant that represents an unknown interface speed, used as a sentinel value.

◆ kMbpsToBps

constexpr uint64_t kMbpsToBps = 1000000ULL
inlineconstexpr

Conversion factor from megabits per second to bits per second.