NTP Class Reference

#include <NTP.h>

List of all members.

Public Member Functions

 NTP ()
virtual ~NTP ()
virtual OStatus DoInit (const OSystemEvent &event)
virtual OStatus DoStart (const OSystemEvent &event)
virtual OStatus DoStop (const OSystemEvent &event)
virtual OStatus DoDestroy (const OSystemEvent &event)
void GetHostByNameCont (ANTENVMSG msg)
void SendCont (ANTENVMSG msg)
void ReceiveCont (ANTENVMSG msg)

Public Attributes

OSubject * subject [numOfSubject]
OObserver * observer [numOfObserver]

Private Member Functions

void GetHostByName (char *hostname)
OStatus InitUDPBuffer ()
OStatus CreateUDPEndpoint ()
OStatus CloseUDPEndpoint ()
OStatus SendNTPPacket ()
OStatus Send ()
OStatus Receive ()

Private Attributes

antStackRef ipstackRef
antModuleRef dnsEndpoint
UDPConnection connection
char ntpserver [128]

Static Private Attributes

const longword SECONDS_OF_100YEARS = 3155673600U


Constructor & Destructor Documentation

NTP::NTP  ) 
 

Definition at line 56 of file NTP.cc.

virtual NTP::~NTP  )  [inline, virtual]
 

Definition at line 29 of file NTP.h.


Member Function Documentation

OStatus NTP::CloseUDPEndpoint  )  [private]
 

Definition at line 391 of file NTP.cc.

Referenced by ReceiveCont(), and SendCont().

OStatus NTP::CreateUDPEndpoint  )  [private]
 

Definition at line 353 of file NTP.cc.

References connection, UDPConnection::endpoint, IP_ADDR_ANY(), ipstackRef, NTP_BUFFER_SIZE, and UDPConnection::state.

Referenced by GetHostByNameCont().

OStatus NTP::DoDestroy const OSystemEvent &  event  )  [virtual]
 

Definition at line 120 of file NTP.cc.

OStatus NTP::DoInit const OSystemEvent &  event  )  [virtual]
 

Definition at line 61 of file NTP.cc.

OStatus NTP::DoStart const OSystemEvent &  event  )  [virtual]
 

Definition at line 68 of file NTP.cc.

References dnsEndpoint, GetHostByName(), InitUDPBuffer(), ipstackRef, NTP_CONF_FILE, and ntpserver.

OStatus NTP::DoStop const OSystemEvent &  event  )  [virtual]
 

Definition at line 113 of file NTP.cc.

void NTP::GetHostByName char *  hostname  )  [private]
 

Definition at line 126 of file NTP.cc.

References dnsEndpoint, and ipstackRef.

Referenced by DoStart().

void NTP::GetHostByNameCont ANTENVMSG  msg  ) 
 

Definition at line 141 of file NTP.cc.

References connection, CreateUDPEndpoint(), is_ipv4addr_dotted_decimal_notation(), UDPConnection::sendAddress, and SendNTPPacket().

OStatus NTP::InitUDPBuffer  )  [private]
 

Definition at line 304 of file NTP.cc.

References byte, connection, ipstackRef, NTP_BUFFER_SIZE, UDPConnection::recvBuffer, UDPConnection::recvData, UDPConnection::recvSize, UDPConnection::sendBuffer, UDPConnection::sendData, and UDPConnection::state.

Referenced by DoStart().

OStatus NTP::Receive  )  [private]
 

Definition at line 245 of file NTP.cc.

References connection, UDPConnection::endpoint, ipstackRef, UDPConnection::recvData, and UDPConnection::recvSize.

Referenced by SendCont().

void NTP::ReceiveCont ANTENVMSG  msg  ) 
 

Definition at line 261 of file NTP.cc.

References byte, CloseUDPEndpoint(), connection, NTPMessage::data, GetTimeDifference(), longword, UDPConnection::recvData, UDPConnection::recvSize, sbyte, and SetTime().

OStatus NTP::Send  )  [private]
 

Definition at line 203 of file NTP.cc.

References connection, UDPConnection::endpoint, ipstackRef, UDPConnection::sendAddress, UDPConnection::sendData, UDPConnection::sendPort, UDPConnection::sendSize, and UDPConnection::state.

Referenced by SendNTPPacket().

void NTP::SendCont ANTENVMSG  msg  ) 
 

Definition at line 224 of file NTP.cc.

References CloseUDPEndpoint(), connection, Receive(), UDPConnection::recvSize, and UDPConnection::state.

OStatus NTP::SendNTPPacket  )  [private]
 

Definition at line 189 of file NTP.cc.

References byte, connection, Send(), UDPConnection::sendData, UDPConnection::sendPort, and UDPConnection::sendSize.

Referenced by GetHostByNameCont().


Member Data Documentation

UDPConnection NTP::connection [private]
 

Definition at line 56 of file NTP.h.

Referenced by CreateUDPEndpoint(), GetHostByNameCont(), InitUDPBuffer(), Receive(), ReceiveCont(), Send(), SendCont(), and SendNTPPacket().

antModuleRef NTP::dnsEndpoint [private]
 

Definition at line 55 of file NTP.h.

Referenced by DoStart(), and GetHostByName().

antStackRef NTP::ipstackRef [private]
 

Definition at line 54 of file NTP.h.

Referenced by CreateUDPEndpoint(), DoStart(), GetHostByName(), InitUDPBuffer(), Receive(), and Send().

char NTP::ntpserver[128] [private]
 

Definition at line 57 of file NTP.h.

Referenced by DoStart().

OObserver* NTP::observer[numOfObserver]
 

Definition at line 32 of file NTP.h.

const longword NTP::SECONDS_OF_100YEARS = 3155673600U [static, private]
 

Definition at line 44 of file NTP.h.

OSubject* NTP::subject[numOfSubject]
 

Definition at line 31 of file NTP.h.


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 23:04:35 2007 for openSDK by  doxygen 1.3.9.1