整个流程大概是:
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++;