Skip to content

Commit

Permalink
Improve ABI compatible with version 1.1.
Browse files Browse the repository at this point in the history
Signed-off-by: Erez Geva <[email protected]>
  • Loading branch information
erezgeva committed Apr 25, 2024
1 parent 50455d1 commit 1dffc54
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions pub/bin.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class Binary
* @param[in] length of memory buffer
* @return address
* @note Support MAC addresses
* @remark keep for ABI backward compatibility.
*/
static std::string bufToId(const uint8_t *id, size_t length);
/**
Expand Down
13 changes: 13 additions & 0 deletions pub/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ class SockUnix : public SockBase
* @note address can not be changed after initializing.
* User can close the socket, change this value, and
* initialize a new socket.
* @remark keep for ABI backward compatibility.
*/
bool setSelfAddress(const std::string &string);
/**
Expand Down Expand Up @@ -312,6 +313,7 @@ class SockUnix : public SockBase
* @return true if message is sent
* @note true does @b NOT guarantee the frame was successfully
* arrives its target. Only the network layer sends it.
* @remark keep for ABI backward compatibility.
*/
bool sendTo(const void *msg, size_t len, const std::string &addrStr) const;
/**
Expand Down Expand Up @@ -678,6 +680,17 @@ class SockRaw : public SockBaseIf
* initialize a new socket.
*/
bool setPtpDstMac(const void *ptp_dst_mac, size_t len);
/**
* Set PTP multicast address using binary from
* @param[in] ptp_dst_mac address in binary form
* @param[in] len address length
* @return true if PTP multicast address is updated
* @note PTP multicast address can not be changed after initializing.
* User can close the socket, change this value, and
* initialize a new socket.
* @remark keep for ABI backward compatibility.
*/
bool setPtpDstMac(const uint8_t *ptp_dst_mac, size_t len);
/**
* Set PTP multicast address using configuration file
* @param[in] cfg reference to configuration file object
Expand Down
4 changes: 4 additions & 0 deletions src/sock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,10 @@ bool SockRaw::setPtpDstMac(const void *mac, size_t len)
{
return setPtpDstMac(Binary(mac, len));
}
bool SockRaw::setPtpDstMac(const uint8_t *mac, size_t len)
{
return setPtpDstMac(Binary(mac, len));
}
bool SockRaw::setPtpDstMac(const ConfigFile &cfg, const string &section)
{
if(m_isInit) {
Expand Down

0 comments on commit 1dffc54

Please sign in to comment.