ptpd 源码解析_PTPD2源码解析之:packet的接收和发送

整个流程大概是:

do_state(ptp_master状态)

issueAnnounce

netSendGeneral

handle

netRecvGeneral

ssize_t

netSendGeneral(Octet * buf, UInteger16 length, NetPath * netPath,

const const RunTimeOpts *rtOpts, Integer32 destinationAddress)

{

ssize_t ret;

struct sockaddr_in addr;

addr.sin_family = AF_INET;

addr.sin_port = htons(PTP_GENERAL_PORT);

#ifdef PTPD_PCAP

if ((netPath->pcapGeneral != NULL) && (rtOpts->transport == IEEE_802_3)) {

ret = netSendPcapEther(buf, length,

&netPath->etherDest,

(struct ether_addr *)netPath->interfaceID,

netPath->pcapGeneral);

if (ret <= 0)

DBG("Error sending ether multicast general message\n");

else {

netPath->sentPackets++;

猜你喜欢

转载自blog.csdn.net/weixin_39835607/article/details/111544329