diff options
author | Fritz Elfert <felfert@to.com> | 2002-03-18 05:01:40 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2002-03-18 05:01:40 +0000 |
commit | 23f25b04b95f08f5fc3aeaf9ea745326246dec9f (patch) | |
tree | dbd68bb6a5e228efa95dbfb18fa69c563925163c /lib/psitime.cc | |
parent | 38fc74f68c90aff4909660b89a9c233eac16f626 (diff) | |
download | plptools-23f25b04b95f08f5fc3aeaf9ea745326246dec9f.tar.gz plptools-23f25b04b95f08f5fc3aeaf9ea745326246dec9f.tar.bz2 plptools-23f25b04b95f08f5fc3aeaf9ea745326246dec9f.zip |
- made kpsion SIBO-aware
- Added SIBO-related stuff in PsiTime
- Added new class PsiProcess, renamed rpcs:queryDrive to queryPrograms
and changed it accordingly
- Adapted kspion, plpbackup, plpnfsd and plpftp to use queryPrograms
- Several cleanups in rfsv16
Diffstat (limited to 'lib/psitime.cc')
-rw-r--r-- | lib/psitime.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/psitime.cc b/lib/psitime.cc index 298e494..213858d 100644 --- a/lib/psitime.cc +++ b/lib/psitime.cc @@ -3,7 +3,7 @@ * * This file is part of plptools. * - * Copyright (C) 2000-2001 Fritz Elfert <felfert@to.com> + * Copyright (C) 2000-2002 Fritz Elfert <felfert@to.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,6 +24,8 @@ #include <stdlib.h> #include <plp_inttypes.h> +#define OnePM 3600 // 13:00 offset for SIBO + PsiTime::PsiTime(void) { ptzValid = false; tryPsiZone(); @@ -210,6 +212,22 @@ evalOffset(psi_timezone ptz, time_t time, bool valid) { return offset; } +void PsiTime::setSiboTime(u_int32_t stime) { + unsigned long long micro = evalOffset(ptz, time(0), false); + + micro /= 1000000; + utv.tv_sec = stime + OnePM - micro; + utv.tv_usec = 0; +// unix2psi(); +} + +u_int32_t PsiTime::getSiboTime(void) { + unsigned long long micro = evalOffset(ptz, time(0), false); + + micro /= 1000000; + return utv.tv_sec - OnePM + micro; +} + void PsiTime::psi2unix(void) { u_int64_t micro = ptv.tv_high; micro = (micro << 32) | ptv.tv_low; |