Functions | Variables

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

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

Variables

const ACE_UINT32 GETTIMEOFDAY_TO_NTP_OFFSET = 2208988800U

Function Documentation

TAO_AV_RTCP::ntp64 ntp64time ( timeval  tv  ) 

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

{
  TAO_AV_RTCP::ntp64 n;
  n.upper = (u_int)tv.tv_sec + GETTIMEOFDAY_TO_NTP_OFFSET;
  n.lower = usec2ntp((u_int)tv.tv_usec);
  return (n);
}

ACE_UINT32 ntptime (  ) 

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

{
  //
 ACE_Time_Value tim_v = ACE_OS::gettimeofday();
 //struct timeval tv = (timeval) tim_v;
        return (ntptime ((timeval) tim_v));
}

ACE_UINT32 ntptime ( timeval  t  ) 

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

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

timeval unixtime (  ) 

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

{
  ACE_Time_Value tv = ACE_OS::gettimeofday();
        return ((timeval) tv);
}

u_int usec2ntp ( u_int  usec  ) 

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

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


Variable Documentation

const ACE_UINT32 GETTIMEOFDAY_TO_NTP_OFFSET = 2208988800U

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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines