static void write_versionfile(bool use_stdout) { FILE *fp = stdout; if (!use_stdout) { char targetfile[256]; fp = fopen(get_tmp_dir_filename(targetfile, sizeof(targetfile), "oscam.version"), "w"); if (!fp) { cs_log("Cannot open %s (errno=%d %s)", targetfile, errno, strerror(errno)); return; } struct tm st; time_t now = time(NULL); localtime_r(&now, &st); fprintf(fp, "Unix starttime: %ld\n", (long)now); fprintf(fp, "Starttime: %02d.%02d.%04d %02d:%02d:%02d\n", st.tm_mday, st.tm_mon + 1, st.tm_year + 1900, st.tm_hour, st.tm_min, st.tm_sec); } fprintf(fp, "Version: oscam-%s-r%s\n", CS_VERSION, CS_SVN_VERSION); fprintf(fp, "\n"); write_conf(WEBIF, "Web interface support"); write_conf(TOUCH, "Touch interface support"); write_conf(WITH_SSL, "SSL support"); write_conf(HAVE_DVBAPI, "DVB API support"); if (config_enabled(HAVE_DVBAPI)) { write_conf(WITH_AZBOX, "DVB API with AZBOX support"); write_conf(WITH_MCA, "DVB API with MCA support"); write_conf(WITH_COOLAPI, "DVB API with COOLAPI support"); write_conf(WITH_STAPI, "DVB API with STAPI support"); } write_conf(CS_ANTICASC, "Anti-cascading support"); write_conf(IRDETO_GUESSING, "Irdeto guessing"); write_conf(WITH_DEBUG, "Debug mode"); write_conf(MODULE_MONITOR, "Monitor"); write_conf(WITH_LB, "Loadbalancing support"); write_conf(CW_CYCLE_CHECK, "CW Cycle Check support"); write_conf(LCDSUPPORT, "LCD support"); write_conf(LEDSUPPORT, "LED support"); write_conf(IPV6SUPPORT, "IPv6 support"); write_conf(CS_CACHEEX, "Cache exchange support"); fprintf(fp, "\n"); write_conf(MODULE_CAMD33, "camd 3.3x"); write_conf(MODULE_CAMD35, "camd 3.5 UDP"); write_conf(MODULE_CAMD35_TCP, "camd 3.5 TCP"); write_conf(MODULE_NEWCAMD, "newcamd"); write_conf(MODULE_CCCAM, "CCcam"); write_conf(MODULE_CCCSHARE, "CCcam share"); write_conf(MODULE_PANDORA, "Pandora"); write_conf(MODULE_GHTTP, "ghttp"); write_conf(MODULE_GBOX, "gbox"); write_conf(MODULE_RADEGAST, "radegast"); write_conf(MODULE_SERIAL, "serial"); write_conf(MODULE_CONSTCW, "constant CW"); fprintf(fp, "\n"); write_conf(WITH_CARDREADER, "Reader support"); if (config_enabled(WITH_CARDREADER)) { fprintf(fp, "\n"); write_readerconf(READER_NAGRA, "Nagra"); write_readerconf(READER_IRDETO, "Irdeto"); write_readerconf(READER_CONAX, "Conax"); write_readerconf(READER_CRYPTOWORKS, "Cryptoworks"); write_readerconf(READER_SECA, "Seca"); write_readerconf(READER_VIACCESS, "Viaccess"); write_readerconf(READER_VIDEOGUARD, "NDS Videoguard"); write_readerconf(READER_DRE, "DRE Crypt"); write_readerconf(READER_TONGFANG, "TONGFANG"); write_readerconf(READER_BULCRYPT, "Bulcrypt"); write_readerconf(READER_GRIFFIN, "Griffin"); write_readerconf(READER_DGCRYPT, "DGCrypt"); fprintf(fp, "\n"); write_cardreaderconf(CARDREADER_PHOENIX, "phoenix"); write_cardreaderconf(CARDREADER_INTERNAL_AZBOX, "internal_azbox"); write_cardreaderconf(CARDREADER_INTERNAL_COOLAPI, "internal_coolapi"); write_cardreaderconf(CARDREADER_INTERNAL_SCI, "internal_sci"); write_cardreaderconf(CARDREADER_SC8IN1, "sc8in1"); write_cardreaderconf(CARDREADER_MP35, "mp35"); write_cardreaderconf(CARDREADER_SMARGO, "smargo"); write_cardreaderconf(CARDREADER_PCSC, "pcsc"); write_cardreaderconf(CARDREADER_SMART, "smartreader"); write_cardreaderconf(CARDREADER_DB2COM, "db2com"); write_cardreaderconf(CARDREADER_STAPI, "stapi"); } else { write_readerconf(WITH_CARDREADER, "Reader Support"); } if (!use_stdout) fclose(fp); }
static void write_versionfile(bool use_stdout) { FILE *fp = stdout; if(!use_stdout) { char targetfile[256]; fp = fopen(get_tmp_dir_filename(targetfile, sizeof(targetfile), "oscam.version"), "w"); if(!fp) { cs_log("Cannot open %s (errno=%d %s)", targetfile, errno, strerror(errno)); return; } struct tm st; time_t walltime = cs_time(); localtime_r(&walltime, &st); fprintf(fp, "Unix starttime: %ld\n", walltime); fprintf(fp, "Starttime: %02d.%02d.%04d %02d:%02d:%02d\n", st.tm_mday, st.tm_mon + 1, st.tm_year + 1900, st.tm_hour, st.tm_min, st.tm_sec); } fprintf(fp, "Version: oscam-%s-r%s\n", CS_VERSION, CS_SVN_VERSION); fprintf(fp, "Compiler: %s\n", CS_TARGET); fprintf(fp, "Box type: %s (%s)\n", boxtype_get(), boxname_get()); fprintf(fp, "TempDir: %s\n", cs_tmpdir); fprintf(fp, "ConfigDir: %s\n", cs_confdir); #ifdef WEBIF fprintf(fp, "WebifPort: %d\n", cfg.http_port); #endif fprintf(fp, "\n"); write_conf(WEBIF, "Web interface support"); write_conf(WEBIF_LIVELOG, "LiveLog support"); write_conf(WEBIF_JQUERY, "jQuery support intern"); write_conf(TOUCH, "Touch interface support"); write_conf(WITH_SSL, "SSL support"); write_conf(HAVE_DVBAPI, "DVB API support"); if(config_enabled(HAVE_DVBAPI)) { write_conf(WITH_AZBOX, "DVB API with AZBOX support"); write_conf(WITH_MCA, "DVB API with MCA support"); write_conf(WITH_COOLAPI, "DVB API with COOLAPI support"); write_conf(WITH_STAPI, "DVB API with STAPI support"); write_conf(WITH_STAPI5, "DVB API with STAPI5 support"); write_conf(READ_SDT_CHARSETS, "DVB API read-sdt charsets"); } write_conf(IRDETO_GUESSING, "Irdeto guessing"); write_conf(CS_ANTICASC, "Anti-cascading support"); write_conf(WITH_DEBUG, "Debug mode"); write_conf(MODULE_MONITOR, "Monitor"); write_conf(WITH_LB, "Loadbalancing support"); write_conf(CS_CACHEEX, "Cache exchange support"); write_conf(CW_CYCLE_CHECK, "CW Cycle Check support"); write_conf(LCDSUPPORT, "LCD support"); write_conf(LEDSUPPORT, "LED support"); switch (cs_getclocktype()) { case CLOCK_TYPE_UNKNOWN : write_conf(CLOCKFIX, "Clockfix with UNKNOWN clock"); break; case CLOCK_TYPE_REALTIME : write_conf(CLOCKFIX, "Clockfix with realtime clock"); break; case CLOCK_TYPE_MONOTONIC: write_conf(CLOCKFIX, "Clockfix with monotonic clock"); break; } write_conf(IPV6SUPPORT, "IPv6 support"); fprintf(fp, "\n"); write_conf(MODULE_CAMD33, "camd 3.3x"); write_conf(MODULE_CAMD35, "camd 3.5 UDP"); write_conf(MODULE_CAMD35_TCP, "camd 3.5 TCP"); write_conf(MODULE_NEWCAMD, "newcamd"); write_conf(MODULE_CCCAM, "CCcam"); write_conf(MODULE_CCCSHARE, "CCcam share"); write_conf(MODULE_GBOX, "gbox"); write_conf(MODULE_RADEGAST, "radegast"); write_conf(MODULE_SCAM, "scam"); write_conf(MODULE_SERIAL, "serial"); write_conf(MODULE_CONSTCW, "constant CW"); write_conf(MODULE_PANDORA, "Pandora"); write_conf(MODULE_GHTTP, "ghttp"); fprintf(fp, "\n"); write_conf(WITH_CARDREADER, "Reader support"); if(config_enabled(WITH_CARDREADER)) { fprintf(fp, "\n"); write_readerconf(READER_NAGRA, "Nagra"); write_readerconf(READER_IRDETO, "Irdeto"); write_readerconf(READER_CONAX, "Conax"); write_readerconf(READER_CRYPTOWORKS, "Cryptoworks"); write_readerconf(READER_SECA, "Seca"); write_readerconf(READER_VIACCESS, "Viaccess"); write_readerconf(READER_VIDEOGUARD, "NDS Videoguard"); write_readerconf(READER_DRE, "DRE Crypt"); write_readerconf(READER_TONGFANG, "TONGFANG"); write_readerconf(READER_BULCRYPT, "Bulcrypt"); write_readerconf(READER_GRIFFIN, "Griffin"); write_readerconf(READER_DGCRYPT, "DGCrypt"); fprintf(fp, "\n"); write_cardreaderconf(CARDREADER_PHOENIX, "phoenix"); write_cardreaderconf(CARDREADER_INTERNAL_AZBOX, "internal_azbox"); write_cardreaderconf(CARDREADER_INTERNAL_COOLAPI, "internal_coolapi"); write_cardreaderconf(CARDREADER_INTERNAL_SCI, "internal_sci"); write_cardreaderconf(CARDREADER_SC8IN1, "sc8in1"); write_cardreaderconf(CARDREADER_MP35, "mp35"); write_cardreaderconf(CARDREADER_SMARGO, "smargo"); write_cardreaderconf(CARDREADER_PCSC, "pcsc"); write_cardreaderconf(CARDREADER_SMART, "smartreader"); write_cardreaderconf(CARDREADER_DB2COM, "db2com"); write_cardreaderconf(CARDREADER_STAPI, "stapi"); write_cardreaderconf(CARDREADER_STAPI5, "stapi5"); write_cardreaderconf(CARDREADER_STINGER, "stinger"); } else { write_readerconf(WITH_CARDREADER, "Reader Support"); } if(!use_stdout) { fclose(fp); } }