Changeset 5031:ebd6fe192503 in roaraudio
- Timestamp:
- 05/28/11 14:23:32 (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r5022 r5031 5 5 * Updated drivers to use new sync stream selection logic correctly (Closes: #136) 6 6 * Converted most roarclients to to use VS API (See: #87) 7 * Added support for ROAR_CMD_GETTIMEOFDAY 7 8 8 9 v. 0.4beta6 - Mon May 23 2011 19:49 CEST -
include/libroar/libroar.h
r5010 r5031 167 167 #include "ctl.h" 168 168 #include "caps.h" 169 #include "roartime.h" 169 170 #include "meta.h" 170 171 #include "file.h" -
include/roaraudio/proto.h
r5029 r5031 195 195 #define ROAR_ITST_UIURL 10 196 196 197 // old: do not use. 197 198 struct roar_timeofday { 198 199 int64_t t_sec; // secund part of system time -
libroar/Makefile
r4958 r5031 11 11 PASSWORD=passwordapi.o pinentry.o sshaskpass.o 12 12 CRYPTO=crypto.o random.o $(HASHES) crc.o 13 OBJS=libroar.o config.o debug.o error.o basic.o stream.o client.o simple.o auth.o socket.o ctl.o buffer.o meta.o file.o acl.o cdrom.o $(PASSWORD) $(VIO) stack.o slp.o nnode.o roardl.o roarx11.o beep.o proto.o env.o keyval.o vs.o ltm.o notify.o notify_proxy.o asyncctl.o enumdev.o serverinfo.o $(CRYPTO) authfile.o caps.o roarfloat.o base64.o trap.o memmgr.o 13 OBJS=libroar.o config.o debug.o error.o basic.o stream.o client.o simple.o auth.o socket.o ctl.o buffer.o meta.o file.o acl.o cdrom.o $(PASSWORD) $(VIO) stack.o slp.o nnode.o roardl.o roarx11.o beep.o proto.o env.o keyval.o vs.o ltm.o notify.o notify_proxy.o asyncctl.o enumdev.o serverinfo.o $(CRYPTO) authfile.o caps.o roarfloat.o base64.o trap.o memmgr.o time.o 14 14 15 15 #DEFINES = -DDEBUG -
roarclients/roarctl.c
r5005 r5031 123 123 "\n" 124 124 " serverinfo - Gets general information about the server\n" 125 " servertime - Gets server's time\n" 125 126 " serveroinfo - Gets Information about server output\n" 126 127 " serveroinfo2 DIR - Gets Information about server output for stream direction dir\n" … … 243 244 } 244 245 #undef _pm 246 247 void server_time (struct roar_connection * con) { 248 struct roar_time time; 249 250 if ( roar_get_time(con, &time) == -1 ) { 251 fprintf(stderr, "Error: can not get server time\n"); 252 return; 253 } 254 255 if ( g_verbose ) { 256 printf("Server time : %llu.%06llu [+%llu/2^64] sec\n", 257 (long long unsigned int)time.t_sec, 258 (long long unsigned int) time.t_ssec / 18446744073709LLU, 259 (long long unsigned int) time.t_ssec); 260 } else { 261 printf("Server time : %llu.%06llu sec\n", 262 (long long unsigned int)time.t_sec, 263 (long long unsigned int) time.t_ssec / 18446744073709LLU); 264 } 265 if ( time.c_freq ) 266 printf("Server clock frequency: %f Hz\n", (float)time.c_freq / 1000000000.f); 267 if ( time.c_drift ) 268 printf("Server clock drift : %llu:2^64 (~10^%f)\n", 269 (long long unsigned int)time.c_drift, logf((float)time.c_drift)/2.302585f); 270 } 245 271 246 272 void server_oinfo (struct roar_connection * con, int dir) { … … 1141 1167 } else if ( !strcmp(k, "serverinfo") ) { 1142 1168 server_info(&con); 1169 } else if ( !strcmp(k, "servertime") ) { 1170 server_time(&con); 1143 1171 } else if ( !strcmp(k, "serveroinfo") ) { 1144 1172 server_oinfo(&con, -1); -
roard/commands.c
r4781 r5031 53 53 {ROAR_CMD_PASSFH, _NAME("PASSFH"), req_on_passfh, ACCLEV_PWRUSER}, 54 54 55 {ROAR_CMD_GETTIMEOFDAY, _NAME("GETTIMEOFDAY"), req_on_gettimeofday, ACCLEV_NONE}, 55 56 {ROAR_CMD_SERVER_INFO, _NAME("SERVER_INFO"), req_on_server_info, ACCLEV_NONE}, // allow this early so the client 56 57 // can device ealry if this server -
roard/include/req.h
r4708 r5031 52 52 int req_on_exit (int client, struct roar_message * mes, char ** data, uint32_t flags[2]); 53 53 54 int req_on_gettimeofday(int client, struct roar_message * mes, char ** data, uint32_t flags[2]); 54 55 int req_on_server_info (int client, struct roar_message * mes, char ** data, uint32_t flags[2]); 55 56 -
roard/req.c
r4949 r5031 682 682 #endif 683 683 684 int req_on_gettimeofday (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 685 #if defined(ROAR_HAVE_GETTIMEOFDAY) || defined(ROAR_HAVE_TIME) 686 struct roar_time curtime; 687 #ifdef ROAR_HAVE_GETTIMEOFDAY 688 struct timeval tv; 689 #elif defined(ROAR_HAVE_TIME) 690 time_t now = time(NULL); 691 #endif 692 693 ROAR_DBG("req_on_gettimeofday(client=%i, mes=%p, data=%p, flags=%p) = ?", client, mes, data, flags); 694 695 if ( *data != NULL ) { 696 return -1; 697 } 698 699 ROAR_DBG("req_on_gettimeofday(client=%i, mes=%p, data=%p, flags=%p) = ?", client, mes, data, flags); 700 701 if ( mes->datalen && mes->datalen < 8 ) { 702 return -1; 703 } 704 705 ROAR_DBG("req_on_gettimeofday(client=%i, mes=%p, data=%p, flags=%p) = ?", client, mes, data, flags); 706 707 if ( mes->datalen >= 8 ) { 708 if ( *(uint64_t *)mes->data != 0 ) { 709 return -1; 710 } 711 } 712 713 ROAR_DBG("req_on_gettimeofday(client=%i, mes=%p, data=%p, flags=%p) = ?", client, mes, data, flags); 714 715 memset(&curtime, 0, sizeof(curtime)); 716 717 #ifdef ROAR_HAVE_GETTIMEOFDAY 718 if ( gettimeofday(&tv, NULL) == -1 ) 719 return -1; 720 curtime.t_sec = tv.tv_sec; 721 curtime.t_ssec = (uint64_t)tv.tv_usec * (uint64_t)18446744073709ULL; 722 #elif defined(ROAR_HAVE_TIME) 723 curtime.t_sec = now; 724 #endif 725 726 if ( roar_time_to_msg(mes, &curtime) == -1 ) 727 return -1; 728 729 mes->cmd = ROAR_CMD_OK; 730 731 ROAR_DBG("req_on_gettimeofday(client=%i, mes=%p, data=%p, flags=%p) = ?", client, mes, data, flags); 732 733 return 0; 734 #else 735 return -1; 736 #endif 737 } 738 684 739 int req_on_server_info (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 685 740 #ifdef ROAR_HAVE_UNAME
Note: See TracChangeset
for help on using the changeset viewer.