ntp-time.h File Reference

#include "orbsvcs/AV/RTCP.h"

Include dependency graph for ntp-time.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ACE_INLINE u_int usec2ntp (u_int usec)
ACE_INLINE TAO_AV_RTCP::ntp64 ntp64time (timeval tv)
ACE_INLINE ACE_UINT32 ntptime (timeval t)
ACE_INLINE ACE_UINT32 ntptime ()
ACE_INLINE timeval unixtime ()

Variables

const ACE_UINT32 GETTIMEOFDAY_TO_NTP_OFFSET = 2208988800U


Function Documentation

ACE_INLINE TAO_AV_RTCP::ntp64 ntp64time ( timeval  tv  ) 

Definition at line 67 of file ntp-time.h.

References GETTIMEOFDAY_TO_NTP_OFFSET, TAO_AV_RTCP::ntp64::lower, TAO_AV_RTCP::ntp64::upper, and usec2ntp().

Referenced by TAO_AV_RTCP_Callback::send_report().

00068 {
00069   TAO_AV_RTCP::ntp64 n;
00070   n.upper = (u_int)tv.tv_sec + GETTIMEOFDAY_TO_NTP_OFFSET;
00071   n.lower = usec2ntp((u_int)tv.tv_usec);
00072   return (n);
00073 }

ACE_INLINE ACE_UINT32 ntptime (  ) 

Definition at line 83 of file ntp-time.h.

References ACE_OS::gettimeofday(), and ntptime().

00084 {
00085   //
00086  ACE_Time_Value tim_v = ACE_OS::gettimeofday();
00087  //struct timeval tv = (timeval) tim_v;
00088         return (ntptime ((timeval) tim_v));
00089 }

ACE_INLINE ACE_UINT32 ntptime ( timeval  t  ) 

Definition at line 76 of file ntp-time.h.

References GETTIMEOFDAY_TO_NTP_OFFSET, and usec2ntp().

Referenced by ntptime().

00077 {
00078         u_int s = (u_int)t.tv_sec + GETTIMEOFDAY_TO_NTP_OFFSET;
00079         return (s << 16 | usec2ntp((u_int)t.tv_usec) >> 16);
00080 }

ACE_INLINE timeval unixtime (  ) 

Definition at line 91 of file ntp-time.h.

References ACE_OS::gettimeofday().

00092 {
00093   ACE_Time_Value tv = ACE_OS::gettimeofday();
00094         return ((timeval) tv);
00095 }

ACE_INLINE u_int usec2ntp ( u_int  usec  ) 

Definition at line 49 of file ntp-time.h.

Referenced by ntp64time(), and ntptime().

00050 {
00051   u_int const t = (usec * 1825) >> 5;
00052   return ((usec << 12) + (usec << 8) - t);
00053 }


Variable Documentation

const ACE_UINT32 GETTIMEOFDAY_TO_NTP_OFFSET = 2208988800U

Definition at line 58 of file ntp-time.h.

Referenced by ntp64time(), and ntptime().


Generated on Tue Feb 2 17:47:53 2010 for TAO_AV by  doxygen 1.4.7