libptpmgmt  1.4
libptpmgmt library that provides the functionality of linuxptp pmc
Public Member Functions | List of all members
IfInfo Class Reference

Network interface information. More...

#include <ptp.h>

Public Member Functions

bool initUsingName (const std::string &ifName)
 
bool initUsingIndex (int ifIndex)
 
bool isInit () const
 
int ifIndex () const
 
const std::string & ifName () const
 
const char * ifName_c () const
 
const Binarymac () const
 
const uint8_t * mac_c () const
 
size_t mac_size () const
 
int ptpIndex () const
 

Detailed Description

Network interface information.

Member Function Documentation

◆ ifIndex()

int IfInfo::ifIndex ( ) const
inline

Get interface index

Returns
interface index or NO_SUCH_IF if object is not initialized

◆ ifName()

const std::string& IfInfo::ifName ( ) const
inline

Get interface name

Returns
interface name or empty string if object is not initialized

◆ ifName_c()

const char* IfInfo::ifName_c ( ) const
inline

Get interface name

Returns
interface name or empty string if object is not initialized

◆ initUsingIndex()

bool IfInfo::initUsingIndex ( int  ifIndex)

Find network interface information based on its index

Parameters
[in]ifIndexnetwork interface index
Returns
true if network interface exists

◆ initUsingName()

bool IfInfo::initUsingName ( const std::string &  ifName)

Find network interface information based on its name

Parameters
[in]ifNamenetwork interface name
Returns
true if network interface exists

◆ isInit()

bool IfInfo::isInit ( ) const
inline

Is object initialized

Returns
true if network interface was successfully initialized

◆ mac()

const Binary& IfInfo::mac ( ) const
inline

Get interface MAC address

Returns
binary from address or empty string if object is not initialized

◆ mac_c()

const uint8_t* IfInfo::mac_c ( ) const
inline

Get interface MAC address

Returns
binary from address or empty string if object is not initialized

◆ mac_size()

size_t IfInfo::mac_size ( ) const
inline

Get interface MAC address length

Returns
binary from address length or 0 if object is not initialized

◆ ptpIndex()

int IfInfo::ptpIndex ( ) const
inline

Get interface PTP index

Returns
ptp index or NO_SUCH_PTP if object is not initialized or interface does not support PTP
Note
An interface may have multiple PHCs, this function return the index report by the get_ts_info

The documentation for this class was generated from the following file: