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

Base for UDP sockets. More...

#include <sock.h>

Inheritance diagram for SockIp:
Inheritance graph
[legend]
Collaboration diagram for SockIp:
Collaboration graph
[legend]

Public Member Functions

bool setUdpTtl (uint8_t udp_ttl)
 
bool setUdpTtl (const ConfigFile &cfg, const std::string &section="")
 
- Public Member Functions inherited from SockBaseIf
bool setIfUsingName (const std::string &ifName)
 
bool setIfUsingIndex (int ifIndex)
 
bool setIf (const IfInfo &ifObj)
 
bool setAll (const IfInfo &ifObj, const ConfigFile &cfg, const std::string &section="")
 
bool setAllInit (const IfInfo &ifObj, const ConfigFile &cfg, const std::string &section="")
 

Additional Inherited Members

- Protected Member Functions inherited from SockBase
void close ()
 
bool init ()
 
bool send (const void *msg, size_t len)
 
bool send (Buf &buf, size_t len)
 
bool sendBuf (Buf &buf, size_t len)
 
ssize_t rcv (void *buf, size_t bufSize, bool block=false)
 
ssize_t rcv (Buf &buf, bool block=false)
 
ssize_t rcvBuf (Buf &buf, bool block=false)
 
int getFd () const
 
int fileno () const
 
bool poll (uint64_t timeout_ms=0) const
 
bool tpoll (uint64_t &timeout_ms) const
 

Detailed Description

Base for UDP sockets.

provide functions to set IP TTL, send and receive functions for UDP sockets

Member Function Documentation

◆ setUdpTtl() [1/2]

bool SockIp::setUdpTtl ( const ConfigFile cfg,
const std::string &  section = "" 
)

Set IP ttl value using configuration file

Parameters
[in]cfgreference to configuration file object
[in]sectionin configuration file
Returns
true if IP ttl is updated
Note
in IP version 6 the value is used for multicast hops
IP ttl can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.
calling without section will fetch value from "global" section

◆ setUdpTtl() [2/2]

bool SockIp::setUdpTtl ( uint8_t  udp_ttl)

< Set IP ttl value

Parameters
[in]udp_ttlIP time to live
Returns
true if IP ttl is updated
Note
in IP version 6 the value is used for multicast hops
IP ttl can not be changed after initializing. User can close the socket, change this value, and initialize a new socket.

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